• Content count

  • Joined

  • Last visited

Community Reputation

65 Decent

1 Follower

About Friya

  • Rank

Recent Profile Visitors

807 profile views
  1. [Released] Priest Love (server mod)

    So, anyway... Apparently I left this mod unmaintained for too long... Note, bug: When mucking about on my test-server earlier today I noticed the detection of improved/failed spells was off, I'll post an update for that when time allows. If the wrong message is a bother, just disable the two options for now (that is: showPowerOnSuccessfulCast and showPowerOnFailedCast) . Changes: - Some refactoring and cleaning up - Drunken development bugfix (get player from persistence instead of logged-ins) - Configuration option: Output strength of cast to user when they successfully land - Configuration option: List of spells affected - Configuration option: useLegacyMessages (power in [...], caster in (...)) - Configuration option: showCasterNameBasedOnPower Example of "Show Power On Successful Cast": (you can toggle output of power for both successful and failed casts) Future of this mod: In the spirit of its name, at some point down the line I'll probably add... Support for free casts - high (and/or lucky) cast = caster gets a free cast (think rare) Support for caster names when it comes to runes (and *possibly* imbues) Ability to specify which spell to dispel on an item (other than fixing this annoyance, this is also relevant since you might want to purge names of other casters due to "reward system" below) Rare prayers (don't we all love them) is rewarded: on PVP server -- 3-5 instant casts; on PVE server -- 3-5 free casts A reward system for casters whose enchants are used. Still prototyping on this, the long-term idea is to at least make it viable to have a priest as (almost) a main and remove the need for "everyone is a priest". The ground work for this is done with this mod as it will start keeping track of who casted what. The configuration file contains some information, so pasting it in here for the details: # # Some love for the poor priests. # # I may or may not add more functionality over time. # # -- Friya, 2018 # classname=com.friya.wurmonline.server.priestlove.Mod classpath=priestlove.jar sharedClassLoader=true # # When priest successfully land a cast, they will see the strength of the cast in the event log. # E.g.: Your Courier cast landed with a power of 98. # # Set to false if you want don't want to ruin the surprise. # # Disable this behaviour by setting this to false. # showPowerOnSuccessfulCast=true # # Instead of just seeing that you failed to improve a cast, show just HOW unlucky you were. # showPowerOnFailedCast=true # # Personally I find the use of [ ] to convey the power of spells extremely ugly. But I can see # that it is of interest because of habits. # # That said, if you prefer ugly messages, set this to true. ;) # useLegacyMessages=false # # I like the idea of obscuring names on low-quality things in Wurm proper, but I do not agree # with how it's done. That said, I added it because it felt appropriate. # # You can turn behaviour off for spell-casters by setting this to false. # showCasterNameBasedOnPower=true # # Spells (their class names) that should be supported with names of the caster (typically only # spells that has a power and that can be cast on items). # # If you have custom spells living in the standard package (com.wurmonline.server.spells), simply # add their class name to the list below. #,Nimbleness,LurkerDeep,Opulence,CircleOfCunning,MindStealer,Bloodthirst,SharedPain,DarkMessenger,LurkerWoods,RottingTouch,Frostbrand,Nolocate,LurkerDark,WindOfAges,Venom,FlamingAura,WebArmour,BlessingDark,LifeTransfer # # For custom spells living outside of the default Wurm spells package, add the following # configuration line: #<name of the package>=<comma separated list of class names> # Make sure class has a doEffect() method with calls to addSpellEffect() and improvePower(). # # Example: #,SubtleSpell # # (Note: this is untested, but should just work, I suppose -- if any trouble, just post in the # announcement thread). # Download link in the original post is updated.
  2. Poor priests, always neglected. Always alts. They grind their faith, they grind their channeling, no one will ever know. This will give credit where it's due. Enchants on items will reveal who did the cast. Example: Given the rather vague name of this mod, I may, or may not, add functionality here. I have ideas, but if you have some as well, I'm all ears. Download *hic* (yes, very untested)
  3. [Released] GM Goto (server)

    # # A little mod to make my life easier; provides the #goto command for GM's. # I was SO fed up with having to use the wand. # That's it. # # Someone else probably already made a mod for this and I just did not know about it. # # Usage: Type #goto in any tab. # # Syntax: #goto <x y> # or #goto <deed name> # or #goto <player name> # # If the deed is multiple words, use quotes. E.g. #goto "Friya's Fantastic Fellowship" # If there is a deed called Friya and also a player with the same name, distinguish the two by doing #goto deed Friya or #goto player Friya # If going to coordinate, make sure it is within the map boundaries. # You cannot go to invisible GMs. # # - Friya, 2018 # Download And here's the source code for anyone wanting to do ... more. package com.friya.wurmonline.server.admin; import java.util.ArrayList; import java.util.StringTokenizer; import org.gotti.wurmunlimited.modloader.interfaces.PlayerMessageListener; import org.gotti.wurmunlimited.modloader.interfaces.WurmServerMod; import com.wurmonline.server.Players; import com.wurmonline.server.creatures.Communicator; import com.wurmonline.server.players.Player; import com.wurmonline.server.villages.NoSuchVillageException; import com.wurmonline.server.villages.Village; import com.wurmonline.server.villages.Villages; import com.wurmonline.server.zones.Zones; public class Mod implements WurmServerMod, PlayerMessageListener { @Override public boolean onPlayerMessage(Communicator com, String msg) { if(com.getPlayer().getPower() > 0) { // Verbose because I -may- want to add more GM commands. if(msg.startsWith("#goto")) { return cmdGoto(com, msg); } } return false; } private boolean cmdGoto(Communicator com, String cmd) { String[] tokens = translateCommandline(cmd); Location loc = null; if(tokens.length == 1) { tell(com, "Syntax:"); tell(com, " #goto <x y> or #goto <deed name> or #goto <player name>"); tell(com, "Examples:"); tell(com, " #goto 500 500"); tell(com, " #goto \"Friya's Home\""); tell(com, " #goto friya"); tell(com, "Notes:"); tell(com, " If the deed name is multiple words, use quotes. E.g. #goto \"Friya's Fantastic Fellowship\""); tell(com, " If there is a deed called Friya and also a player with the sane name, separate the two by doing #goto deed Friya or #goto player Friya"); tell(com, " If going to coordinate, make sure it is within the map boundaries."); tell(com, " You cannot go to invisible GMs."); return true; } if(tokens.length == 3) { if(isNumericUgly(tokens[1]) && isNumericUgly(tokens[2])) { // #goto x y loc = getCoordinateLocation(tokens[1], tokens[2]); } else if(tokens[1].equals("deed")) { // #goto deed loc = getDeedLocationByName(tokens[2]); } else if(tokens[1].equals("player")) { // #goto player loc = getPlayerLocationByName(tokens[2]); } } else if(tokens.length == 2) { // #goto <player name> loc = getPlayerLocationByName(tokens[1]); if(loc == null) { // #goto <deed name> loc = getDeedLocationByName(tokens[1]); } } if(loc == null || gotoTarget(com, loc) == false) { tell(com, "No idea how to go there... Typo? Coordinate is outside map? Target is invisible? Not a player? Already teleporting?"); } else { tell(com, "The fabric of space opens and you appear at " + loc.getName() + " ... or so you hope."); } return true; } private boolean gotoTarget(Communicator c, Location loc) { Player p = c.getPlayer(); p.setTeleportPoints((short)loc.getX(), (short)loc.getY(), loc.getLayer(), 0); if (p.startTeleporting()) { c.sendTeleport(false); p.teleport(); return true; } return false; } private Location getCoordinateLocation(String sx, String sy) { int x = Integer.parseInt(sx); int y = Integer.parseInt(sy); if(x < 1 || x > Zones.worldTileSizeX || y < 1 || y > Zones.worldTileSizeY) { return null; } return new Location(x + "x" + y, x, y, 0); } private Location getPlayerLocationByName(String name) { Player p = Players.getInstance().getPlayerOrNull(name.substring(0, 1).toUpperCase() + name.substring(1).toLowerCase()); // if target is an invisible GM, disallow going to them (caller will give a generic error) if(p == null || (p.getPower() > 0 && p.isVisible() == false)) { return null; } return new Location(p.getName(), p.getTileX(), p.getTileY(), p.getLayer()); } private Location getDeedLocationByName(String name) { Village d = null; try { d = Villages.getVillage(name); } catch (NoSuchVillageException e) { } if(d == null) { return null; } return new Location(d.getName(), d.getTokenX(), d.getTokenY(), 0); } /** * Crack a command line. * * Shamelessly lifted from another mod of mine which shamelessly lifted it from * Apache Commons. See * * @param toProcess the command line to process. * @return the command line broken into strings. * * An empty or null toProcess parameter results in a zero sized array. */ private String[] translateCommandline(String toProcess) { if (toProcess == null || toProcess.length() == 0) { return new String[0]; } final int normal = 0; final int inQuote = 1; final int inDoubleQuote = 2; int state = normal; final StringTokenizer tok = new StringTokenizer(toProcess, "\"\' ", true); final ArrayList<String> result = new ArrayList<String>(); final StringBuilder current = new StringBuilder(); boolean lastTokenHasBeenQuoted = false; while (tok.hasMoreTokens()) { String nextTok = tok.nextToken(); switch (state) { case inQuote: if ("\'".equals(nextTok)) { lastTokenHasBeenQuoted = true; state = normal; } else { current.append(nextTok); } break; case inDoubleQuote: if ("\"".equals(nextTok)) { lastTokenHasBeenQuoted = true; state = normal; } else { current.append(nextTok); } break; default: if ("\'".equals(nextTok)) { state = inQuote; } else if ("\"".equals(nextTok)) { state = inDoubleQuote; } else if (" ".equals(nextTok)) { if (lastTokenHasBeenQuoted || current.length() != 0) { result.add(current.toString()); current.setLength(0); } } else { current.append(nextTok); } lastTokenHasBeenQuoted = false; break; } } if (lastTokenHasBeenQuoted || current.length() != 0) { result.add(current.toString()); } if (state == inQuote || state == inDoubleQuote) { throw new RuntimeException("unbalanced quotes in " + toProcess); } return result.toArray(new String[result.size()]); } /** * Despite this using an exception for functionality, I am okay with it. It's executed rarely enough and definitely rare enough to trigger the exception. * * @param str * @return */ private boolean isNumericUgly(String str) { try { @SuppressWarnings("unused") double d = Double.parseDouble(str); } catch(NumberFormatException nfe) { return false; } return true; } private void tell(Communicator c, String msg) { c.sendNormalServerMessage(msg); } } /* ------------------------------------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------------------------------------- */ package com.friya.wurmonline.server.admin; class Location { private String _name; private int _x; private int _y; private int _layer = 0; Location(String name, int x, int y, int layer) { _name = name; _x = x; _y = y; _layer = layer; } String getName() { return _name; } int getX() { return _x; } int getY() { return _y; } public int getLayer() { return _layer; } }
  4. [Released] Server mod; Loot Tables

    That should just .... work. I use that quite extensively myself. I can't even come up with any idea of what could possibly go wrong? hm
  5. No news. But updated for latest WU.
  6. [Released] Server mod; Loot Tables

    I started dabbling with WU again (we always come back to Wurm! <3) and wanted a bit of new functionality. Sooo.... here's an update to this ... thing. Get some numbers on what is happening with your loot / server You get statistics by typing /lootstats as a GM (power 1+). This will show the stats in the player's Event log as well as in the server log. Any entries not shown when viewing the stats are still 0. That is, a stat will only appear if it's happened at least once. Provided there is activity on the server, statistics will automatically be output to the server log (as INFO) every hour-ish (can be useful for auditing over time, or you know, generate charts). Tracked data points killed.players Total number of times players died on the server killed.npcs Total number of times NPCs died on the server killed.player.[NAME] Number of times a specific player was killed killed.npc.[NAME] Number of times a specific NPC-type was killed killed.ignored Number of suicides or no [valid] players involved in the death of a creature/player or some other reason disqualifying it from giving loot (an invalid player can be e.g. an invisible or invulnerable GM. Think: the target must be 'red' before dying) table.triggered.[ID] Number of times this loot-table was triggered rule.cancelled.[ID].[NAME] Number of times the rule was ignored due to maximum number of items it could drop was set to 0 rule.triggered.[ID].[NAME] Number of times the rule was triggered Total number of items handed out[NAME] Total number of this type of enchantment on items Total number of items handed out that had drop chance set to 100% Total number of items handed out that were rare or better drop.dropped.[ID].[NAME] [*] The number of items that dropped. This can differ from item.drop.triggered because more than one clone may drop. drop.missed.[ID].[NAME] [*] How many times the item was a valid drop, but RNG screwed the player out of the item :) drop.triggered.[ID].[NAME] [*] Number of times (an) item was dropped mods.calls Number of times external mods utilizing LootTables were notified about drops mods.cancelled Number of times an external mod utilizing LootTables prevented an NPC from yielding loot mods.exceptions Number of times an external mod threw an exception (thus preventing any drop) Number of queries to LootRules table Number of players online at the time of printing these stats. Not related to LootTables per se, but can be useful if you want to generate charts (or whatever) based on the periodical output to server log. [*] For some of the drop.* data points, the [NAME] will only be included if the LootItem had a forced name. So, if empty, you'd use [ID] to find out which item it's about. The screenshot gives an idea of what is added. This list will obviously become a lot longer on a live server, for this test I had a small number of rules and spent two minutes killing four creatures (without anything dropping). The link in the original post is updated with latest version. And well, that's it. Enjoy
  7. [Released] Server mod; Loot Tables

    Hello, I have been out of the Wurm Unlimited loop for quite a while and just happened to end up browsing this section; so I apologize for the somewhat late reply. I think you may be right in your assessment that something is off here. Was the 'random' color set by any chance? I can imagine that would have thrown things off a bit. Regardless, I have thrown together a new release that checks if all three color components are -1, then do not set color under any circumstance. There's a caveat here; I have been unable to test the release as my Wurm Unlimited is currently a bit borked and I have not been arsed to fix it I hope this helps you. The download link is the same as was in the original post in this thread.
  8. I saw this happen in the past myself, but have never actually managed to reproduce it on my test/dev server, so at this point I actually don't really know why that happens sometimes. If you have this issue though (albeit frustrating as heck), you can destroy all those creatures and just respawn them (as any model), as long as you get the exact names correct. If you find out why they lose their position in some scenarios, please do let me know!
  9. [Released] Server mod; Loot Tables

    Not sure if I've mentioned this, but you can have any Wurm item inserted into the LootItem table (items from mods too). But the important bit here: By default I only insert a *subset* of Wurm's items. Things that are not very plausible as drops like carts, boats, etc are not inserted. Items like GM wands, mission ruler, etc are also excluded. That said, you can easily insert any missing items yourself by looking up the Wurm template ID in the com/wurmonline/server/items/ItemTemplateCreator* classes. 25Jul2017 Some updates to LootItems Ability to set weight of items, you can also add a random factor to the weight. Use 'weight' and 'weightrandom' (this is in grams). As with other random parameters, if weight is set to 1000 (1kg) and you have a weightrandom set to 500, the weight will be a random value between 1000 and 1500 grams. You can of course modify the weight of any item, say, a light weight huge axe or so. Added ability to force an item to rare. Do this by setting 'forcerare' to 0 for normal, 1 for rare, 2 for supreme and 3 for fantastic. This is different from how rarity works on LootItems otherwise, you could always set items to 'can-be-rare' and then it is done through randomness (bones were an exception, they would always be rare or better). This new option will *force* them to go rare, supreme or fantastic. Ability to set colour. This can be useful for almost every item of course, but I set out to add it for the purpose of being able to drop properly configured scale and hide. Please note that some items are simply not affected by colour -- sadly nothing that I can do about that. As is often the case when defining colours, RGB is used, you can get more information about that here: The fields added to LootItems table: colorR / colorRrandom (redness), colorG / colorGrandom (greenness) and colorB / colorBrandom (blueness). So, setting colorR to 50 and colorRrandom to 205 will create a random 'redness' between 50 and 255. The final value of each color-component (R, G or must be between 0 and 255 or you may get an unpredictable result. As a side-note, dragon scale and drake hide colours are: Red dragon/drake: 215, 40, 40 Black dragon/drake: 10, 10, 10 Green dragon/drake: 10, 210, 10 White dragon/drake: 255, 255, 255 Blue dragon/drake: 40, 40, 215 To test all three additions INSERT INTO FriyaLootItems(id, itemids, name, dropchance, colorr, colorg, colorb, weight) VALUES(150001, 372, "red dragon scale", 100.0, 215, 40, 40, 100); INSERT INTO FriyaLootItems(id, itemids, name, dropchance, weight, weightrandom) VALUES(150002, 347, "tasty meal", 100.0, 500, 500); INSERT INTO FriyaLootItems(id, itemids, name, dropchance, colorr, colorg, colorb, forcerare) VALUES(150003, 2, "sweet satchel", 100.0, 0, 0, 255, 2); INSERT INTO FriyaLootTables values(123457, 150001); INSERT INTO FriyaLootTables values(123457, 150002); INSERT INTO FriyaLootTables values(123457, 150003); INSERT INTO FriyaLootRules(rulename, loottable, creature, age) VALUES("Test of color, weight and forced rarity", 123457, "troll", "venerable"); The above examples will make all venerable trolls drop: a meal weighing between 0.5 and 1.0kg (named tasty meal) 0.1kg red dragon scale a blue satchel that is forced to become supreme (named sweet satchel) As always when we need to update the database: On your next restart of server, the new fields will be merged into the existing database automatically (no action required from your side). But yes, you do have to restart your server to see the new fields. PS. I know I use 'color' in code and 'colour' in text. I am consistent in my inconsistency.
  10. [Released] Server mod; Loot Tables

    It would be fairly easy to make, but I consider it out of scope for the LootTables mod since that is really just about 'random loot'. I am also not sure if I feel any temptation to write that mod myself, but if someone is up for the job, I'd be happy to assist with pointers on how to make it happen (and even tweak the LootTables mod if that is necessary).
  11. [Released] Server mod; Loot Tables

    Except for the detail of it overriding default loot, you are spot on. It will not touch default loot, a troll club will always drop with the troll, regardless of whether you made a loot rule for it or not. But yeah, you can tweak infinitely. People have created some funky stuff out there, far more than I would have imagined. A lack of rules will not do any harm at all. Your world will function as it always did! PS. I like calling it a 'scenario' actually. It is a good description since the loot can be determined by a range of factors. Hmm.
  12. [Released] Server mod; Loot Tables

    You can change decayTime of the items in FriyaLootItems, off the top of my head I don't recall if you need to set it really high or really low. As for BSBing custom named items, yeah, that's a side-effect of bulk-storing, it will store minimal amount of data so some tweaks (like name) will inevitably be lost.
  13. [Released] Server mod; Loot Tables

    An update. The file in the link of the original post is updated with latest version. 11jul2017 Added functionality to enable/disable loot rules. In LootRules table, set to 0 to disable a rule, and 1 to re-enable it. As with everything else in the rules table, it can be done while server is running. Unless you specify otherwise, rules are by default enabled when created. Added ability to create e.g. the various runes as loot. Set the 'realtemplate' field in LootItems to 1102 = rift stone, 1103 = rift crystal, 1104 = rift wood After that it's just a matter of doing your normal thing and setting the item in 'itemids' (1289: rune of Magranon, 1290 Fo, 1291 Vyn, 1292 Lib, 1293 Jackal) and which material you want it to be. See The 'realtemplate' field can also be used to modify food related items in various ways (I have not looked at the details) An example (uses IDs 123456 for the loot table and 150000 for the loot item to make it easy to test and remove) INSERT INTO FriyaLootItems(id, itemids, name, material, startql, endql, canberare, dropchance, realtemplate) VALUES(150000, 1292, "uber rune of Libila", 13, 80.0, 99.99, 1, 100.0, 1104); INSERT INTO FriyaLootTables values(123456, 150000); INSERT INTO FriyaLootRules(rulename, loottable, creature, enabled) VALUES("Rune test", 123456, "black wolf", 1); This will make black wolves have a 100% chance to drop runes of Libila made out of zinc (13, see com.wurmonline.shared.constants.ItemMaterials for full list), and a 'realtemplate' specifying that it's a 'rift wood' subtype (1104). As always when we need to update the database: On your next restart of server, the new fields will be merged into the existing database automatically (no action required from your side). But yes, you do have to restart your server to see the new fields.
  14. Hello! This will be from the top of my head, but half-vampires should not have any special abilities other than bloodlust (and feeding on creatures/ can't eat food). They also cannot be punished by vampire hunters. The closest thing to a list is probably "General Actions" in the original post... That said, it's not impossible that some document went missing here, but I hope this helps.
  15. Long overdue, new release. I actually forgot to fix a few things that were reported way back then. Fixes - Vamp related creatures should now always spawn with the correct gender (Dhampira should be female, the others should be male) - Fixed a typo; carefuly -> carefully A few notes on a few random things I got in PMs If for some reason you find yourself without a "Coven" zone, you can just create it with your GM wand (the name must be exactly: The Coven) If you think that the vamp related NPC's are placed in the wrong place, that you can always just destroy them and just spawn them elsewhere. It can even be any creature template as long as the name matches exactly (note that this is case sensitive) Use latest mod loader. The download link (same as in OP) Cheers, Friya