WyvernMods Configurable Final Phase

This commit is contained in:
Sindusk
2019-05-14 15:19:18 -04:00
parent 17ddab3783
commit e865977407
8 changed files with 1243 additions and 448 deletions

View File

@@ -242,6 +242,12 @@ disableSmeltingPots=true
hideSorceryBuffBar=true hideSorceryBuffBar=true
#sqlAchievementFix: Fixes the errors that occur with achievements in SQL in WU 1.9. #sqlAchievementFix: Fixes the errors that occur with achievements in SQL in WU 1.9.
sqlAchievementFix=true sqlAchievementFix=true
#changePumpkinKingTitle: Changes the Pumpkin King title (100 farming) for females from "Pumpkin King" to "Pumpkin Queen"
changePumpkinKingTitle=true
#changeDeityPassives: Changes some of the deity passives for demigods with ID 101 and 102.
# This option is specifically for compatibility to Revenant for the time being.
changeDeityPassives=true
#TODO: Remove this option and add deity passive configuration to Spellcraft.
## >> END MISCELLANEOUS CHANGES MODULE << ## ## >> END MISCELLANEOUS CHANGES MODULE << ##
@@ -929,6 +935,317 @@ depotRespawnTime=39600000
## >> END SUPPLY DEPOT MODULE << ## ## >> END SUPPLY DEPOT MODULE << ##
## >> BESTIARY MODULE << ##
## The Bestiary Module controls a variety of features regarding creatures in Wurm.
## This module includes options that controls creature attributes, changing their behavior, and additions of new creatures.
enableBestiaryModule=true
#fixSacrificingStrongCreatures: Removes the ability to sacrifice strong modded creatures such as titans and rare spawns.
fixSacrificingStrongCreatures=true
#disableAfkTraining: Disables afk training by doing combat with a creature while not targeting it.
# This is usually called "shield training" when you engage in combat with a creature then target another to prevent attacking it back.
# With this enabled, it will prevent players from gaining skill from a creature unless they are targeting it as well.
# If DUSKombat is active, this is built into it. Probably not necessary to enable if you have DUSKombat installed, but will do no harm if enabled.
disableAfkTraining=true
#fixChargersWalkingThroughWalls: By default, since Chargers are considered ghost units like templars, they are allowed to walk through walls.
# This option will add a hard override to their pathing and prevent them from walking through walls despite being ghosts.
fixChargersWalkingThroughWalls=true
#conditionWildCreatures: Adds conditions randomly to creatures spawned naturally in the wild.
# By default, only creatures spawned from a den will have a condition (greenish, angry, etc.)
# This option will allow *any* natural spawn to have a condition.
# Will not affect creatures which cannot have a condition by default (such as horses, pigs, etc)
# Chance is 1/5 for a random condition, and 1/250 to be a champion.
conditionWildCreatures=true
#allowGhostArchery: Allows archery against targets marked as "ghosts" - including chargers and spirit templars.
# This is done to prevent players from mounting chargers and being immune to archery to dismount them.
allowGhostArchery=true
#disableArcheryOnStrongCreatures: Disables archery against strong creatures such as titans and rare spawns.
disableArcheryOnStrongCreatures=true
#genesisEnchantedGrassNewborns: When a new creature is born on enchanted grass, it will automatically remove a negative trait.
genesisEnchantedGrassNewborns=true
#useCustomCorpseSizes: Custom creatures can sometimes have poor corpse sizes when slain.
# This option fixes that issue by utilizing custom corpse sizes when they die and adjusting the size to be closer to their normal size.
useCustomCorpseSizes=true
#allowCustomCreatureBreedNames: Allows some custom creatures (Chargers) to have breeding names similar to horses.
allowCustomCreatureBreedNames=true
#allowGhostBreeding: Allows breeding of ghost creatures (such as Chargers).
allowGhostBreeding=true
#allowGhostCorpses: Allows ghost creatures (Chargers and Spirit Trolls) to drop corpses.
allowGhostCorpses=true
#useCustomCreatureSizes: Adjusts the size of creatures when they're alive.
# This makes wyverns smaller than drakes, forest spiders smaller than large spiders, etc.
useCustomCreatureSizes=true
#TODO: Allow custom settings for unit sizes.
#useCustomCreatureSFX: Uses special effects to augment some of the custom creatures (such as fire crabs).
useCustomCreatureSFX=true
#preventLegendaryHitching: When a player dominates a legendary creature such as a dragon, it can sometimes be hitched.
# When hitched, it uses the body strength of the creature to determine speed of the vehicle.
# This usually results in vehicles that go ~30-40kmh. This option prevents this instance from occurring.
preventLegendaryHitching=true
#modifyNewCreatures: Modifies custom creatures in a variety of ways to make sure they function properly.
# Also handles announcement of some custom creatures such as titans.
modifyNewCreatures=true
#logCreatureSpawns: Logs all spawns of creatures to the server log. This is purely informative and has no gameplay effect.
logCreatureSpawns=true
#allowEpicCreatureNaturalSpawns: Allows Sol Demons, Lava Fiends, and Worgs to spawn naturally in the world.
# Sol Demons and Lava Fiends spawn on sand. Worgs spawn on grass and steppe.
allowEpicCreatureNaturalSpawns=true
#TODO: Enable customization of the spawn rates for creatures individually.
# > CUSTOM CREATURES < #
# Custom Creatures are new creatures independent from vanilla ones that are designed to add additional content for players.
enableCustomCreatures=true
#TODO: This module needs to be restructured to allow configuration of each creature independently.
#enableWyverns: Enables the Black, Blue, Green, Red, and White Wyvern creatures.
# These are difficult creatures that spawn naturally on unique tilesets.
# All are able to be mounted and hitched.
# They are unable to spawn on PvP servers.
enableWyverns=true
#enableFlavorMobs: Enables the Avenger, Fire Crab, Forest Spider, Giant, Charger, Horned Pony, Large Boar, and Spirit Troll creatures.
# These creatures all spawn naturally.
# Giants and Avengers are unable to spawn on PvP servers.
enableFlavorMobs=true
#enableEventMobs: Enables the Ice Cat, Fire Giant, Terror, and Guardian of Magranon event creatures.
# These creatures do not spawn naturally.
enableEventMobs=true
#enableRareSpawns: Enables the Reaper and Spectral Drake creatures.
# These creatures only spawn naturally if using the Rare Spawns module.
enableRareSpawns=true
#enableCustomLegendaries: Enables the Facebreyker legendary creature.
# Only spawns naturally if using the Misc Changes addition to add to the spawn list.
enableCustomLegendaries=true
#enableTitans: Enables the Ifrit and Lilith titan creatures. Also includes their additional creatures.
# Only spawns naturally if configured to do so through the Titan module.
enableTitans=true
# > END CUSTOM CREATURES < #
## >> END BESTIARY MODULE << ##
## >> BOUNTY MODULE << ##
## The Bounty Module handles effects and rewards that occur when a player slays a creature.
enableBountyModule=true
#TODO: This module needs to be restructured to give more options for what type of drops and rewards occur.
#usePlayerBounty: Allows players to be rewarded directly when they slay a creature.
usePlayerBounty=true
#TODO: Give further options for player bounty.
#useLootTable: Allows creatures to drop rewards on their corpses.
useLootTable=true
#TODO: Give further options for loot tables.
## >> END BOUNTY MODULE << ##
## >> ITEM MODULE << ##
## The Item Module handles the implementation of new items and their effects.
## It also grants options that change default items in a variety of ways.
enableItemModule=true
#TODO: This module needs to be restructured to give more options regarding each individual item instead of using true/false.
#combineLeather: Allows leather to be combined.
# Will prevent improvement with leather lower than item QL unless the Misc Changes configuration is enabled.
combineLeather=true
#combineLogs: Allows logs to be combined.
combineLogs=true
#reduceLogVolume: Reduces the volume of logs by 50%, making twice as many fit in bulk containers.
# This also makes them easier to fit into containers that otherwise would not hold them.
reduceLogVolume=true
#reduceKindlingVolume: Reduces the volume of kindling by 75%, preventing them from being technically larger than logs.
# In vanilla gameplay, turning logs into kindling would actually yield a higher volume of material... which doesn't make sense.
reduceKindlingVolume=true
#droppableSleepPowder: Allows sleep powder to be dropped.
# This will cause players to drop sleep powder if they die, but also makes them able to be mailed.
droppableSleepPowder=true
#setSilverMirrorPrice: Sets silver mirrors to cost 20 silver instead of 1 iron. This should allow them to be sold on traders.
setSilverMirrorPrice=true
#setGoldMirrorPrice: Sets gold mirrors to cost 1 gold instead of 1 iron. This should allow them to be sold on traders.
setGoldMirrorPrice=true
#setCreatureCratePrice: Sets creature cages to cost 10 silver. This allows them to be sold on traders.
setCreatureCratePrice=true
#setResurrectionStonePrice: Sets resurrection stones to cost 2 silver instead of 5 silver.
setResurrectionStonePrice=true
#loadableMailbox: Allows mailboxes (spirit cottage, spirit castle, etc) to be loaded into vehicles.
# Does not work on PvP servers even if enabled.
loadableMailbox=true
#loadableBellTower: Allows bell towers to be loaded into vehicles.
loadableBellTower=true
#loadableTrashBin: Allows trash bins to be loaded into vehicles.
loadableTrashBin=true
#loadableAltars: Allows altars (wood, stone, silver, gold) to be loaded into vehicles.
# Does not affect the huge altars (White Light and Black Light).
loadableAltars=true
#oneHandedLongSpear: Makes long spears one-handed, allowing them to be equipped in dual wield or with a shield.
oneHandedLongSpear=true
#reduceDirtDifficulty: Reduces the difficulty of crafting dirt from 99 to 50.
# Dirt by default has no crafting recipe so this does nothing on it's own.
reduceDirtDifficulty=true
#reduceSandDifficulty: Reduces the difficulty of crafting sand from 99 to 50.
# Sand by default has no crafting recipe so this does nothing on it's own.
reduceSandDifficulty=true
#reduceSandstoneDifficulty: Reduces the difficulty of crafting sandstone from 99 to 50.
# Sandstone by default has no crafting recipe so this does nothing on it's own.
reduceSandstoneDifficulty=true
#decorationStoneKeystone: Makes stone keystones into a decoration item.
# This prevents them from going into piles of items when dropped, allowing them to be used for decorative purposes.
decorationStoneKeystone=true
#decorationMarbleKeystone: Makes marble keystons into a decoration item.
# This prevents them from going into piles of items when dropped, allowing them to be used for decorative purposes.
decorationMarbleKeystone=true
#useCustomCacheFragments: Modifies the fragment count for archaeology with the custom caches from WyvernMods.
useCustomCacheFragments=true
#adjustStatueFragmentCount: Adjusts the fragment count for some statues in Archaeology.
# Worg and Eagle: 40 fragments.
# Hell Horse and Drake: 45 fragments.
# Fo, Magranon, Libila, and Vynora: 50 fragments.
adjustStatueFragmentCount=true
#removeLockpickSkillRequirement: Removes the 20 locksmithing requirement to begin crafting lockpicks.
# If the quality of materials is too low, players might still not be able to craft them with less than 20 skill.
removeLockpickSkillRequirement=true
#createCustomItemTemplates: Creates the item templates for the custom items from WyvernMods.
# This only initializes the item so it can be used on the server. Enabling this option does not make any items craftable.
# The ability to craft items is set in other configurations below this one.
# It is highly recommended to enable this and keep it enabled if you plan on using any of the custom items.
# If you want to remove an item, disabling this is not advised. Instead, remove the ability to craft that item in other configurations.
createCustomItemTemplates=true
# > CUSTOM ITEM CREATION < #
# Custom Item Creation identifies which of the custom items you want to have be player-made.
# Each option will list the creation recipe and requirements.
enableCustomItemCreation=true
#TODO: Recode to allow custom recipes for both modded items and non-modded items.
#craftHuntingArrowPacks: Creation Entry for Hunting Arrow Packs.
# Start with quiver + hunting arrow. Finish with 39 additional hunting arrows.
# Uses Fletching and requires 50 skill to begin.
craftHuntingArrowPacks=true
#craftWarArrowPacks: Creation Entry for War Arrow Packs.
# Start with quiver + war arrow. Finish with 39 additional war arrows.
# Uses Fletching and requires 50 skill to begin.
craftWarArrowPacks=true
#craftBattleYoyo: Creation Entry for Battle Yoyo.
# Crafted with a string of cloth and shaft.
# Uses Toymaking.
craftBattleYoyo=true
#craftClub: Creation Entry for Club.
# Crafted using a carving knife on a log.
# Uses Carpentry.
craftClub=true
#craftDepthDrill: Creation Entry for Depth Drill.
# Start with ribbon and shaft. Finish with a two wooden handles and a small nails.
# Uses Fine Carpentry.
craftDepthDrill=true
#craftEternalReservoir: Creation Entry for Eternal Reservoir. Used in Soulstealing.
# Start with a star diamond + dirt. Finish with 99 additional dirt, 200 pottery bricks, 30 chaos crystals, and 20 hearts.
# Uses Pottery.
craftEternalReservoir=true
#craftEviscerator: Creation Entry for Eviscerator. NOTE: This is meant to be a GM-only weapon.
# Crafted using a Wilhelm's Wrath on another Wilhelm's Wrath. This is not intended to be done.
# Uses Weapon Smithing.
# This creation entry is only made to enable the material functionality on the weapon. It is not meant to be used.
# The Eviscerator is a weapon designed to help with testing against tough targets (like titans) because it does insane damage.
craftEviscerator=true
#craftKnuckles: Creation Entry for Knuckles.
# Crafted using a lump of metal on a small anvil.
# Uses Weapon Heads Smithing.
craftKnuckles=true
#craftMassStorageUnit: Creation Entry for Mass Storage Unit.
# Start with wood beam + wood beam. Finish with 500 planks, 200 shafts, 50 ribbons, and 100 large nails.
# Uses Fine Carpentry and requires 70 skill to begin.
craftMassStorageUnit=true
#craftStatuetteDeities: Creation Entries for statuette of (Demigod).
# Created the same way normal statuettes are.
# The current statuettes are Thelastdab and Reevi. These are hardcoded.
craftStatuetteDeities=true
#TODO: Allow creation of new deity statuettes through configuration.
#craftWarhammer: Creation Entry for Warhammer and Warhammer Head.
# Warhammer Head is crafted using a lump of metal on a large anvil.
# Warhammer is crafted using a Warhammer Head on a shaft.
# Both use Weapon Heads Smithing.
craftWarhammer=true
# > END CUSTOM ITEM CREATION < #
## >> END ITEM MODULE << ##
## >> SOULSTEALING MODULE << ##
## The Soulstealing Module is the implementation of a new skill, Soulstealing. This replaces the standard Stealing skill.
## When a creature dies, players can use a Sacrificial Knife to collect the creature's soul instead of butchering it.
## Stealing the soul will generate a small item, a soul, which can then be used for various purposes.
## When the soul is stolen, the corpse of the creature will be removed. This makes Soulstealing a handy skill for light hunting.
## Souls can be used in the Eternal Reservoir to charge it, which will automatically feed carnivore creatures nearby and keep forges and ovens lit.
enableSoulstealingModule=true
#TODO: This section needs more configurations for the eternal reservoir effects and how soulstealing functions.
#pollEternalReservoirTime: Amount of time, in milliseconds, to poll Eternal Reservoirs for their effects.
# This will reduce their fuel and provide the effects of feeding nearby carnivores and lighting nearby forges and ovens.
# Default is 600000, or 10 minutes.
pollEternalReservoirTime=600000
## >> END SOULSTEALING MODULE << ##
## >> ACTION MODULE << ##
## The Action Module handles new actions which are unrelated to other functions. Some serve as QoL and others as new features.
enableActionModule=true
#actionUnequipAll: Provides an "Unequip All" action when players right-click an item they are wearing.
# This is slightly different than the body action for Unequip All that was added to the base game. It does not conflict with it.
actionUnequipAll=true
#actionReceiveAllMail: Provides a "Receive All Mail" action when players right-click a mailbox.
# This will not accept CoD items, and only accepts mail with no cost.
# It will accept up to 100 items at a time and place them in the mailbox upon action completion.
actionReceiveAllMail=true
#actionSplitSorcery: Provides a "Split Sorcery" action when players right-click any sorcery/tome.
# This allows them to split it into several tomes each with one charge.
# Amount of items granted is equivalent to the amount of charges in the original sorcery/tome.
actionSplitSorcery=true
#actionLeaderboard: Provides a "Leaderboard" action when players right-click their body. Also works when right-clicking skills.
# This opens up a full leaderboard dialogue where players can see the skill levels, achievements, and similar of other players.
# The system is opt-in, with each player opted out by default.
actionLeaderboard=true
#TODO: Allow customization of the leaderboard dialogue colors and similar.
#actionSorceryFragmentCombine: Allows sorcery fragments to be combined at a huge altar (White Light or Black Light).
actionSorceryFragmentCombine=true
#actionArenaTeleports: Provides the "Arena Teleport" and "Arena Escape" actions.
# These are hardcoded heavily for Revenant and likely will not work well on any other server.
actionArenaTeleports=true
#TODO: Expand on these actions to enable better teleportation options.
#actionAddMissionDev: Adds action "Add Mission" to the body of GM power 5 accounts.
# This adds a random mission using the custom Mission Creator.
actionAddMissionDev=true
#TODO: Allow configuration of power requirement.
#actionRemoveMissionDev: Adds action "Remove Mission" to the body of GM power 5 accounts.
# This removes a random active mission.
actionRemoveMissionDev=true
#TODO: Allow configuration of power requirement.
#actionCreatureReportDev: Adds action "Creature Report" to the body of GM power 5 accounts.
# This provides a list of current creatures on the server.
# Thanks to Bdew for providing the code to make this action work.
actionCreatureReportDev=true
#TODO: Allow configuration of power requirement.
#actionSmoothTerrainDev: Adds action "Smooth Terrain" when targeting a tile corner for GM power 5 accounts.
# This will enact "erosion" on the area and smooth the terrain by 1 step.
# Binding the action to a key and pressing it multiple times will demonstrate the effects of the Erosion system.
actionSmoothTerrainDev=true
#TODO: Allow configuration of the power requirement.
## >> END ACTION MODULE << ##
## >> EROSION MODULE << ##
## The Erosion Module handles a new system that helps smooth the terrain on otherwise bumpy maps.
## In some cases, the heightmap generation when making a new map is flawed and will create a very bumpy terrain.
## The erosion system is a slow but effective method by which to smooth the bumps in the terrain and make it more natural.
## This operation occurs on an interval, but is fairly expensive when it executes.
## If you notice laggspikes while this system is enabled, it is recommended that you either disable it or increase the interval.
enableErosionModule=true
#pollTerrainSmoothTime: Amount of time, in milliseconds, between each terrain smoothing attempt.
# This operation selects a random spot on the map and smooths a 10x10 area.
# Default is 5000, or 5 seconds.
pollTerrainSmoothTime=5000
## >> END EROSION MODULE << ##
## >> TREASURE CHEST LOOT MODULE << ## ## >> TREASURE CHEST LOOT MODULE << ##
## The Treasure Chest Loot Module affects the vanilla treasure chests. ## The Treasure Chest Loot Module affects the vanilla treasure chests.
## By default, treasure chests can spawn randomly in the wild. This module reconfigures the loot that spawns in them. ## By default, treasure chests can spawn randomly in the wild. This module reconfigures the loot that spawns in them.

View File

@@ -124,14 +124,14 @@ public class WyvernBlack implements ModCreature, CreatureTypes {
new EncounterBuilder(Tiles.Tile.TILE_SAND.id) new EncounterBuilder(Tiles.Tile.TILE_SAND.id)
.addCreatures(templateId, 1) .addCreatures(templateId, 1)
.build(1); .build(1);
//}else if(Servers.localServer.PVPSERVER){ }/*else if(Servers.localServer.PVPSERVER){
/*new EncounterBuilder(Tiles.Tile.TILE_GRASS.id) new EncounterBuilder(Tiles.Tile.TILE_GRASS.id)
.addCreatures(templateId, 1) .addCreatures(templateId, 1)
.build(1); .build(1);
new EncounterBuilder(Tiles.Tile.TILE_TREE.id) new EncounterBuilder(Tiles.Tile.TILE_TREE.id)
.addCreatures(templateId, 1) .addCreatures(templateId, 1)
.build(1);*/ .build(1);
} }*/
} }
} }

View File

@@ -1,11 +1,10 @@
package mod.sin.wyvern.bestiary; package mod.sin.wyvern;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.logging.Logger; import java.util.logging.Logger;
import com.wurmonline.mesh.Tiles; import com.wurmonline.mesh.Tiles;
import com.wurmonline.server.Servers; import com.wurmonline.server.Servers;
import com.wurmonline.server.behaviours.AutoEquipMethods;
import com.wurmonline.server.combat.Weapon; import com.wurmonline.server.combat.Weapon;
import com.wurmonline.server.creatures.*; import com.wurmonline.server.creatures.*;
import com.wurmonline.server.items.*; import com.wurmonline.server.items.*;
@@ -21,8 +20,6 @@ import javassist.expr.ExprEditor;
import javassist.expr.MethodCall; import javassist.expr.MethodCall;
import mod.sin.items.SealedMap; import mod.sin.items.SealedMap;
import mod.sin.lib.Util; import mod.sin.lib.Util;
import mod.sin.wyvern.RareSpawns;
import mod.sin.wyvern.Titans;
import org.gotti.wurmunlimited.modloader.ReflectionUtil; import org.gotti.wurmunlimited.modloader.ReflectionUtil;
import com.wurmonline.server.FailedException; import com.wurmonline.server.FailedException;
@@ -38,12 +35,11 @@ import mod.sin.creatures.*;
import mod.sin.creatures.titans.*; import mod.sin.creatures.titans.*;
import mod.sin.weapons.Club; import mod.sin.weapons.Club;
import mod.sin.weapons.titan.*; import mod.sin.weapons.titan.*;
import mod.sin.wyvern.MiscChanges;
import org.gotti.wurmunlimited.modloader.classhooks.HookException; import org.gotti.wurmunlimited.modloader.classhooks.HookException;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager; import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
public class MethodsBestiary { public class Bestiary {
protected static Logger logger = Logger.getLogger(MethodsBestiary.class.getName()); protected static Logger logger = Logger.getLogger(Bestiary.class.getName());
protected static boolean isUsuallyHitched(int templateId){ protected static boolean isUsuallyHitched(int templateId){
if(templateId == Charger.templateId){ if(templateId == Charger.templateId){
@@ -701,14 +697,21 @@ public class MethodsBestiary {
public static void preInit(){ public static void preInit(){
try{ try{
ClassPool classPool = HookManager.getInstance().getClassPool(); ClassPool classPool = HookManager.getInstance().getClassPool();
final Class<MethodsBestiary> thisClass = MethodsBestiary.class; final Class<Bestiary> thisClass = Bestiary.class;
String replace; String replace;
Util.setReason("Disable sacrificing strong creatures.");
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature"); CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
CtClass ctItem = classPool.get("com.wurmonline.server.items.Item"); CtClass ctItem = classPool.get("com.wurmonline.server.items.Item");
CtClass ctAction = classPool.get("com.wurmonline.server.behaviours.Action"); CtClass ctAction = classPool.get("com.wurmonline.server.behaviours.Action");
CtClass ctMethodsReligion = classPool.get("com.wurmonline.server.behaviours.MethodsReligion"); CtClass ctMethodsReligion = classPool.get("com.wurmonline.server.behaviours.MethodsReligion");
CtClass ctPathFinder = classPool.get("com.wurmonline.server.creatures.ai.PathFinder");
CtClass ctArchery = classPool.get("com.wurmonline.server.combat.Archery");
CtClass ctVirtualZone = classPool.get("com.wurmonline.server.zones.VirtualZone");
CtClass ctVehicle = classPool.get("com.wurmonline.server.behaviours.Vehicle");
CtClass ctCreatureStatus = classPool.get("com.wurmonline.server.creatures.CreatureStatus");
if (WyvernMods.fixSacrificingStrongCreatures) {
Util.setReason("Disable sacrificing strong creatures.");
CtClass[] params1 = { CtClass[] params1 = {
ctCreature, ctCreature,
ctCreature, ctCreature,
@@ -717,30 +720,35 @@ public class MethodsBestiary {
CtClass.floatType CtClass.floatType
}; };
String desc1 = Descriptor.ofMethod(CtClass.booleanType, params1); String desc1 = Descriptor.ofMethod(CtClass.booleanType, params1);
replace = "if("+MethodsBestiary.class.getName()+".isSacrificeImmune($2)){" + replace = "if(" + Bestiary.class.getName() + ".isSacrificeImmune($2)){" +
" performer.getCommunicator().sendNormalServerMessage(\"This creature cannot be sacrificed.\");" + " performer.getCommunicator().sendNormalServerMessage(\"This creature cannot be sacrificed.\");" +
" return true;" + " return true;" +
"}"; "}";
Util.insertBeforeDescribed(thisClass, ctMethodsReligion, "sacrifice", desc1, replace); Util.insertBeforeDescribed(thisClass, ctMethodsReligion, "sacrifice", desc1, replace);
}
if (WyvernMods.disableAfkTraining) {
Util.setReason("Disable afk training."); Util.setReason("Disable afk training.");
CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler"); CtClass ctCombatHandler = classPool.get("com.wurmonline.server.creatures.CombatHandler");
replace = "if("+MethodsBestiary.class.getName()+".blockSkillFrom($1, $0)){"+//"if($1.isPlayer() && $1.getTarget() != $0){" + replace = "if(" + Bestiary.class.getName() + ".blockSkillFrom($1, $0)){" +//"if($1.isPlayer() && $1.getTarget() != $0){" +
//" logger.info(\"Non-targeted mob detected - \" + $1.getName());" + //" logger.info(\"Non-targeted mob detected - \" + $1.getName());" +
" $_ = true;" + " $_ = true;" +
"}else{" + "}else{" +
" $_ = $proceed($$);" + " $_ = $proceed($$);" +
"}"; "}";
Util.instrumentDeclared(thisClass, ctCombatHandler, "setDamage", "isNoSkillFor", replace); Util.instrumentDeclared(thisClass, ctCombatHandler, "setDamage", "isNoSkillFor", replace);
Util.setReason("Disable afk training.");
Util.instrumentDeclared(thisClass, ctCombatHandler, "checkDefenderParry", "isNoSkillFor", replace); Util.instrumentDeclared(thisClass, ctCombatHandler, "checkDefenderParry", "isNoSkillFor", replace);
Util.setReason("Disable afk training.");
Util.instrumentDeclared(thisClass, ctCombatHandler, "checkShield", "isNoSkillFor", replace); Util.instrumentDeclared(thisClass, ctCombatHandler, "checkShield", "isNoSkillFor", replace);
Util.setReason("Disable afk training.");
Util.instrumentDeclared(thisClass, ctCombatHandler, "setBonuses", "isNoSkillFor", replace); Util.instrumentDeclared(thisClass, ctCombatHandler, "setBonuses", "isNoSkillFor", replace);
CtMethod[] ctGetDamages = ctCombatHandler.getDeclaredMethods("getDamage"); CtMethod[] ctGetDamages = ctCombatHandler.getDeclaredMethods("getDamage");
for(CtMethod method : ctGetDamages){ for (CtMethod method : ctGetDamages) {
method.instrument(new ExprEditor(){ method.instrument(new ExprEditor() {
public void edit(MethodCall m) throws CannotCompileException { public void edit(MethodCall m) throws CannotCompileException {
if (m.getMethodName().equals("isNoSkillFor")) { if (m.getMethodName().equals("isNoSkillFor")) {
m.replace("if("+MethodsBestiary.class.getName()+".blockSkillFrom($1, $0)){" + //"if($1.isPlayer() && $1.getTarget() != $0){" + m.replace("if(" + Bestiary.class.getName() + ".blockSkillFrom($1, $0)){" + //"if($1.isPlayer() && $1.getTarget() != $0){" +
//" logger.info(\"Non-targeted mob detected - \" + $1.getName());" + //" logger.info(\"Non-targeted mob detected - \" + $1.getName());" +
" $_ = true;" + " $_ = true;" +
"}else{" + "}else{" +
@@ -750,6 +758,7 @@ public class MethodsBestiary {
} }
}); });
} }
}
// Die method description // Die method description
CtClass ctString = classPool.get("java.lang.String"); CtClass ctString = classPool.get("java.lang.String");
@@ -760,20 +769,27 @@ public class MethodsBestiary {
}; };
String desc5 = Descriptor.ofMethod(CtClass.voidType, params5); String desc5 = Descriptor.ofMethod(CtClass.voidType, params5);
if (WyvernMods.fixChargersWalkingThroughWalls) {
Util.setReason("Deny chargers walking through walls."); Util.setReason("Deny chargers walking through walls.");
CtClass ctPathFinder = classPool.get("com.wurmonline.server.creatures.ai.PathFinder"); replace = "if(" + Bestiary.class.getName() + ".denyPathingOverride($0)){" +
replace = "if("+MethodsBestiary.class.getName()+".denyPathingOverride($0)){" +
" $_ = false;" + " $_ = false;" +
"}else{" + "}else{" +
" $_ = $proceed($$);" + " $_ = $proceed($$);" +
"}"; "}";
Util.instrumentDeclared(thisClass, ctPathFinder, "canPass", "isGhost", replace); Util.instrumentDeclared(thisClass, ctPathFinder, "canPass", "isGhost", replace);
Util.setReason("Deny chargers walking through walls.");
Util.instrumentDeclared(thisClass, ctCreature, "setPathing", "isGhost", replace); Util.instrumentDeclared(thisClass, ctCreature, "setPathing", "isGhost", replace);
Util.setReason("Deny chargers walking through walls.");
Util.instrumentDeclared(thisClass, ctCreature, "startPathingToTile", "isGhost", replace); Util.instrumentDeclared(thisClass, ctCreature, "startPathingToTile", "isGhost", replace);
Util.setReason("Deny chargers walking through walls.");
Util.instrumentDeclared(thisClass, ctCreature, "moveAlongPath", "isGhost", replace); Util.instrumentDeclared(thisClass, ctCreature, "moveAlongPath", "isGhost", replace);
Util.setReason("Deny chargers walking through walls.");
Util.instrumentDeclared(thisClass, ctCreature, "takeSimpleStep", "isGhost", replace); Util.instrumentDeclared(thisClass, ctCreature, "takeSimpleStep", "isGhost", replace);
Util.setReason("Deny chargers walking through walls.");
Util.instrumentDescribed(thisClass, ctCreature, "die", desc5, "isGhost", replace); Util.instrumentDescribed(thisClass, ctCreature, "die", desc5, "isGhost", replace);
}
if (WyvernMods.conditionWildCreatures) {
Util.setReason("Apply random types to creatures in the wilderness."); Util.setReason("Apply random types to creatures in the wilderness.");
CtClass[] params2 = { CtClass[] params2 = {
CtClass.intType, CtClass.intType,
@@ -791,14 +807,15 @@ public class MethodsBestiary {
CtClass.intType CtClass.intType
}; };
String desc2 = Descriptor.ofMethod(ctCreature, params2); String desc2 = Descriptor.ofMethod(ctCreature, params2);
replace = "$10 = "+MethodsBestiary.class.getName()+".newCreatureType($1, $10);"; replace = "$10 = " + Bestiary.class.getName() + ".newCreatureType($1, $10);";
Util.insertBeforeDescribed(thisClass, ctCreature, "doNew", desc2, replace); Util.insertBeforeDescribed(thisClass, ctCreature, "doNew", desc2, replace);
}
if (WyvernMods.allowGhostArchery) {
Util.setReason("Enable archery against ghost targets."); Util.setReason("Enable archery against ghost targets.");
CtClass ctArchery = classPool.get("com.wurmonline.server.combat.Archery");
CtMethod[] archeryAttacks = ctArchery.getDeclaredMethods("attack"); CtMethod[] archeryAttacks = ctArchery.getDeclaredMethods("attack");
for(CtMethod method : archeryAttacks){ for (CtMethod method : archeryAttacks) {
method.instrument(new ExprEditor(){ method.instrument(new ExprEditor() {
public void edit(MethodCall m) throws CannotCompileException { public void edit(MethodCall m) throws CannotCompileException {
if (m.getMethodName().equals("isGhost")) { if (m.getMethodName().equals("isGhost")) {
m.replace("$_ = false;"); m.replace("$_ = false;");
@@ -807,7 +824,9 @@ public class MethodsBestiary {
} }
}); });
} }
}
if (WyvernMods.disableArcheryOnStrongCreatures) {
Util.setReason("Disable archery altogether against certain creatures."); Util.setReason("Disable archery altogether against certain creatures.");
CtClass[] params3 = { CtClass[] params3 = {
ctCreature, ctCreature,
@@ -817,49 +836,91 @@ public class MethodsBestiary {
ctAction ctAction
}; };
String desc3 = Descriptor.ofMethod(CtClass.booleanType, params3); String desc3 = Descriptor.ofMethod(CtClass.booleanType, params3);
replace = "if("+MethodsBestiary.class.getName()+".isArcheryImmune($1, $2)){" replace = "if(" + Bestiary.class.getName() + ".isArcheryImmune($1, $2)){"
+ " return true;" + " return true;"
+ "}"; + "}";
Util.insertBeforeDescribed(thisClass, ctArchery, "attack", desc3, replace); Util.insertBeforeDescribed(thisClass, ctArchery, "attack", desc3, replace);
}
if (WyvernMods.genesisEnchantedGrassNewborns) {
Util.setReason("Auto-Genesis a creature born on enchanted grass"); Util.setReason("Auto-Genesis a creature born on enchanted grass");
replace = MethodsBestiary.class.getName()+".checkEnchantedBreed(newCreature);" replace = Bestiary.class.getName() + ".checkEnchantedBreed(newCreature);"
+ "$_ = $proceed($$);"; + "$_ = $proceed($$);";
Util.instrumentDeclared(thisClass, ctCreature, "checkPregnancy", "saveCreatureName", replace); Util.instrumentDeclared(thisClass, ctCreature, "checkPregnancy", "saveCreatureName", replace);
}
if (WyvernMods.useCustomCorpseSizes) {
Util.setReason("Set custom corpse sizes."); Util.setReason("Set custom corpse sizes.");
replace = "$_ = $proceed($$);" replace = "$_ = $proceed($$);"
+ "if("+MethodsBestiary.class.getName()+".hasCustomCorpseSize(this)){" + "if(" + Bestiary.class.getName() + ".hasCustomCorpseSize(this)){"
+ " "+MethodsBestiary.class.getName()+".setCorpseSizes(this, corpse);" + " " + Bestiary.class.getName() + ".setCorpseSizes(this, corpse);"
+ "}"; + "}";
Util.instrumentDescribed(thisClass, ctCreature, "die", desc5, "addItem", replace); Util.instrumentDescribed(thisClass, ctCreature, "die", desc5, "addItem", replace);
}
/* Disabled for 1.9 - Probably not necessary anymore. Remains for reference or re-implementation.
Util.setReason("Add spell resistance to custom creatures."); Util.setReason("Add spell resistance to custom creatures.");
replace = "float cResist = "+MethodsBestiary.class.getName()+".getCustomSpellResistance(this);" + replace = "float cResist = "+Bestiary.class.getName()+".getCustomSpellResistance(this);" +
"if(cResist >= 0f){" + "if(cResist >= 0f){" +
" return cResist;" + " return cResist;" +
"}"; "}";
Util.insertBeforeDeclared(thisClass, ctCreature, "addSpellResistance", replace); Util.insertBeforeDeclared(thisClass, ctCreature, "addSpellResistance", replace);*/
if (WyvernMods.allowCustomCreatureBreedNames) {
Util.setReason("Allow custom creatures to have breeding names."); Util.setReason("Allow custom creatures to have breeding names.");
replace = "$_ = "+MethodsBestiary.class.getName()+".shouldBreedName(this);"; replace = "$_ = " + Bestiary.class.getName() + ".shouldBreedName(this);";
Util.instrumentDeclared(thisClass, ctCreature, "checkPregnancy", "isHorse", replace); Util.instrumentDeclared(thisClass, ctCreature, "checkPregnancy", "isHorse", replace);
}
if (WyvernMods.allowGhostBreeding) {
Util.setReason("Allow ghost creatures to breed (Chargers)."); Util.setReason("Allow ghost creatures to breed (Chargers).");
CtClass ctMethodsCreatures = classPool.get("com.wurmonline.server.behaviours.MethodsCreatures"); CtClass ctMethodsCreatures = classPool.get("com.wurmonline.server.behaviours.MethodsCreatures");
replace = "$_ = false;"; replace = "$_ = false;";
Util.instrumentDeclared(thisClass, ctMethodsCreatures, "breed", "isGhost", replace); Util.instrumentDeclared(thisClass, ctMethodsCreatures, "breed", "isGhost", replace);
}
if (WyvernMods.allowGhostCorpses) {
Util.setReason("Allow ghost creatures to drop corpses."); Util.setReason("Allow ghost creatures to drop corpses.");
replace = "if("+MethodsBestiary.class.getName()+".isGhostCorpse(this)){" replace = "if(" + Bestiary.class.getName() + ".isGhostCorpse(this)){"
+ " $_ = false;" + " $_ = false;"
+ "}else{" + "}else{"
+ " $_ = $proceed($$);" + " $_ = $proceed($$);"
+ "}"; + "}";
Util.instrumentDescribed(thisClass, ctCreature, "die", desc5, "isGhost", replace); Util.instrumentDescribed(thisClass, ctCreature, "die", desc5, "isGhost", replace);
}
if (WyvernMods.useCustomCreatureSizes) {
Util.setReason("Enable custom sizes for creatures.");
replace = "{return " + Bestiary.class.getName() + ".getAdjustedSizeMod(this);}";
Util.setBodyDeclared(thisClass, ctCreatureStatus, "getSizeMod", replace);
}
CtClass[] params2 = {
CtClass.intType,
CtClass.booleanType,
CtClass.floatType,
CtClass.floatType,
CtClass.floatType,
CtClass.intType,
classPool.get("java.lang.String"),
CtClass.byteType,
CtClass.byteType,
CtClass.byteType,
CtClass.booleanType,
CtClass.byteType,
CtClass.intType
};
String desc2 = Descriptor.ofMethod(ctCreature, params2);
if (WyvernMods.modifyNewCreatures) {
Util.setReason("Modify newly created creatures.");
replace = "$_ = $proceed($$);"
+ Bestiary.class.getName() + ".modifyNewCreature($1);";
Util.instrumentDescribed(thisClass, ctCreature, "doNew", desc2, "sendToWorld", replace);
}
if (WyvernMods.useCustomCreatureSFX) {
Util.setReason("Attach special effects to creatures."); Util.setReason("Attach special effects to creatures.");
CtClass ctVirtualZone = classPool.get("com.wurmonline.server.zones.VirtualZone");
CtClass[] params4 = { CtClass[] params4 = {
CtClass.longType, CtClass.longType,
CtClass.booleanType, CtClass.booleanType,
@@ -870,15 +931,41 @@ public class MethodsBestiary {
}; };
String desc4 = Descriptor.ofMethod(CtClass.booleanType, params4); String desc4 = Descriptor.ofMethod(CtClass.booleanType, params4);
replace = "$_ = $proceed($$);" + replace = "$_ = $proceed($$);" +
MethodsBestiary.class.getName()+".addCreatureSpecialEffect(copyId != -10 ? copyId : creatureId, $0, creature);"; Bestiary.class.getName() + ".addCreatureSpecialEffect(copyId != -10 ? copyId : creatureId, $0, creature);";
Util.instrumentDescribed(thisClass, ctVirtualZone, "addCreature", desc4, "sendNewCreature", replace); Util.instrumentDescribed(thisClass, ctVirtualZone, "addCreature", desc4, "sendNewCreature", replace);
}
if (WyvernMods.preventLegendaryHitching) {
Util.setReason("Ensure unique creatures cannot be hitched to vehicles."); Util.setReason("Ensure unique creatures cannot be hitched to vehicles.");
CtClass ctVehicle = classPool.get("com.wurmonline.server.behaviours.Vehicle"); replace = "if(" + Bestiary.class.getName() + ".isNotHitchable($1)){" +
replace = "if("+MethodsBestiary.class.getName()+".isNotHitchable($1)){" +
" return false;" + " return false;" +
"}"; "}";
Util.insertBeforeDeclared(thisClass, ctVehicle, "addDragger", replace); Util.insertBeforeDeclared(thisClass, ctVehicle, "addDragger", replace);
}
// doNew(int templateid, boolean createPossessions, float aPosX, float aPosY, float aRot, int layer, String name, byte gender, byte kingdom, byte ctype, boolean reborn, byte age)
CtClass[] params3 = {
CtClass.intType,
CtClass.booleanType,
CtClass.floatType,
CtClass.floatType,
CtClass.floatType,
CtClass.intType,
classPool.get("java.lang.String"),
CtClass.byteType,
CtClass.byteType,
CtClass.byteType,
CtClass.booleanType,
CtClass.byteType,
CtClass.intType
};
String desc3 = Descriptor.ofMethod(ctCreature, params3);
if (WyvernMods.logCreatureSpawns) {
Util.setReason("Log new creature spawns.");
replace = "logger.info(\"Creating new creature: \"+templateid+\" - \"+(aPosX/4)+\", \"+(aPosY/4)+\" [\"+com.wurmonline.server.creatures.CreatureTemplateFactory.getInstance().getTemplate(templateid).getName()+\"]\");";
Util.insertBeforeDescribed(thisClass, ctCreature, "doNew", desc3, replace);
}
} catch ( CannotCompileException | NotFoundException | IllegalArgumentException | ClassCastException e) { } catch ( CannotCompileException | NotFoundException | IllegalArgumentException | ClassCastException e) {
throw new HookException(e); throw new HookException(e);

View File

@@ -17,7 +17,6 @@ import javassist.CtClass;
import javassist.NotFoundException; import javassist.NotFoundException;
import javassist.bytecode.Descriptor; import javassist.bytecode.Descriptor;
import mod.sin.lib.Util; import mod.sin.lib.Util;
import mod.sin.wyvern.bestiary.MethodsBestiary;
import mod.sin.wyvern.bounty.LootBounty; import mod.sin.wyvern.bounty.LootBounty;
import mod.sin.wyvern.bounty.PlayerBounty; import mod.sin.wyvern.bounty.PlayerBounty;
@@ -95,9 +94,12 @@ public class Bounty {
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature"); CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
replace = PlayerBounty.class.getName()+".checkPlayerBounty(player, this);" if (WyvernMods.usePlayerBounty) {
Util.setReason("Hook for Player Bounty.");
replace = PlayerBounty.class.getName() + ".checkPlayerBounty(player, this);"
+ "$_ = $proceed($$);"; + "$_ = $proceed($$);";
Util.instrumentDeclared(thisClass, ctCreature, "modifyFightSkill", "checkCoinAward", replace); Util.instrumentDeclared(thisClass, ctCreature, "modifyFightSkill", "checkCoinAward", replace);
}
// Die method description // Die method description
CtClass ctString = classPool.get("java.lang.String"); CtClass ctString = classPool.get("java.lang.String");
@@ -113,60 +115,29 @@ public class Bounty {
Util.instrumentDescribed(thisClass, ctCreature, "die", desc1, "setRotation", replace); Util.instrumentDescribed(thisClass, ctCreature, "die", desc1, "setRotation", replace);
// doNew(int templateid, boolean createPossessions, float aPosX, float aPosY, float aRot, int layer, String name, byte gender, byte kingdom, byte ctype, boolean reborn, byte age) // doNew(int templateid, boolean createPossessions, float aPosX, float aPosY, float aRot, int layer, String name, byte gender, byte kingdom, byte ctype, boolean reborn, byte age)
CtClass[] params2 = {
CtClass.intType,
CtClass.booleanType,
CtClass.floatType,
CtClass.floatType,
CtClass.floatType,
CtClass.intType,
classPool.get("java.lang.String"),
CtClass.byteType,
CtClass.byteType,
CtClass.byteType,
CtClass.booleanType,
CtClass.byteType,
CtClass.intType
};
String desc2 = Descriptor.ofMethod(ctCreature, params2);
Util.setReason("Log new creature spawns.");
replace = "logger.info(\"Creating new creature: \"+templateid+\" - \"+(aPosX/4)+\", \"+(aPosY/4)+\" [\"+com.wurmonline.server.creatures.CreatureTemplateFactory.getInstance().getTemplate(templateid).getName()+\"]\");";
Util.insertBeforeDescribed(thisClass, ctCreature, "doNew", desc2, replace);
Util.setReason("Modify newly created creatures.");
replace = "$_ = $proceed($$);"
//+ "mod.sin.wyvern.bestiary.MethodsBestiary.modifyNewCreature($1);";
+ MethodsBestiary.class.getName()+".modifyNewCreature($1);";
Util.instrumentDescribed(thisClass, ctCreature, "doNew", desc2, "sendToWorld", replace);
// -- Enable adjusting size for creatures -- //
CtClass ctCreatureStatus = classPool.get("com.wurmonline.server.creatures.CreatureStatus");
Util.setBodyDeclared(thisClass, ctCreatureStatus, "getSizeMod", "{return "+MethodsBestiary.class.getName()+".getAdjustedSizeMod(this);}");
//ctCreatureStatus.getDeclaredMethod("getSizeMod").setBody("{return mod.sin.wyvern.bestiary.MethodsBestiary.getAdjustedSizeMod(this);}");
// -- Enable adjusting color for creatures -- // // -- Enable adjusting color for creatures -- //
/*CtClass ctCreatureTemplate = classPool.get("com.wurmonline.server.creatures.CreatureTemplate"); /*CtClass ctCreatureTemplate = classPool.get("com.wurmonline.server.creatures.CreatureTemplate");
replace = "if("+MethodsBestiary.class.getName()+".checkColorTemplate(this)){" replace = "if("+Bestiary.class.getName()+".checkColorTemplate(this)){"
+ " return "+MethodsBestiary.class.getName()+".getCreatureColorRed(this);" + " return "+Bestiary.class.getName()+".getCreatureColorRed(this);"
+ "}"; + "}";
Util.insertBeforeDeclared(thisClass, ctCreatureTemplate, "getColorRed", replace); Util.insertBeforeDeclared(thisClass, ctCreatureTemplate, "getColorRed", replace);
replace = "if("+MethodsBestiary.class.getName()+".checkColorTemplate(this)){" replace = "if("+Bestiary.class.getName()+".checkColorTemplate(this)){"
+ " return "+MethodsBestiary.class.getName()+".getCreatureColorGreen(this);" + " return "+Bestiary.class.getName()+".getCreatureColorGreen(this);"
+ "}"; + "}";
Util.insertBeforeDeclared(thisClass, ctCreatureTemplate, "getColorGreen", replace); Util.insertBeforeDeclared(thisClass, ctCreatureTemplate, "getColorGreen", replace);
replace = "if("+MethodsBestiary.class.getName()+".checkColorTemplate(this)){" replace = "if("+Bestiary.class.getName()+".checkColorTemplate(this)){"
+ " return "+MethodsBestiary.class.getName()+".getCreatureColorBlue(this);" + " return "+Bestiary.class.getName()+".getCreatureColorBlue(this);"
+ "}"; + "}";
Util.insertBeforeDeclared(thisClass, ctCreatureTemplate, "getColorBlue", replace);*/ Util.insertBeforeDeclared(thisClass, ctCreatureTemplate, "getColorBlue", replace);*/
/*ctCreatureTemplate.getDeclaredMethod("getColorRed").insertBefore("if(mod.sin.wyvern.bestiary.MethodsBestiary.checkColorTemplate(this)){" /*ctCreatureTemplate.getDeclaredMethod("getColorRed").insertBefore("if(mod.sin.wyvern.Bestiary.checkColorTemplate(this)){"
+ " return mod.sin.wyvern.bestiary.MethodsBestiary.getCreatureColorRed(this);" + " return mod.sin.wyvern.Bestiary.getCreatureColorRed(this);"
+ "}"); + "}");
ctCreatureTemplate.getDeclaredMethod("getColorGreen").insertBefore("if(mod.sin.wyvern.bestiary.MethodsBestiary.checkColorTemplate(this)){" ctCreatureTemplate.getDeclaredMethod("getColorGreen").insertBefore("if(mod.sin.wyvern.Bestiary.checkColorTemplate(this)){"
+ " return mod.sin.wyvern.bestiary.MethodsBestiary.getCreatureColorGreen(this);" + " return mod.sin.wyvern.Bestiary.getCreatureColorGreen(this);"
+ "}"); + "}");
ctCreatureTemplate.getDeclaredMethod("getColorBlue").insertBefore("if(mod.sin.wyvern.bestiary.MethodsBestiary.checkColorTemplate(this)){" ctCreatureTemplate.getDeclaredMethod("getColorBlue").insertBefore("if(mod.sin.wyvern.Bestiary.checkColorTemplate(this)){"
+ " return mod.sin.wyvern.bestiary.MethodsBestiary.getCreatureColorBlue(this);" + " return mod.sin.wyvern.Bestiary.getCreatureColorBlue(this);"
+ "}");*/ + "}");*/
// -- When a creature takes damage, track the damage taken -- // // -- When a creature takes damage, track the damage taken -- //

View File

@@ -10,6 +10,7 @@ import java.util.logging.Logger;
import com.wurmonline.server.Servers; import com.wurmonline.server.Servers;
import com.wurmonline.server.combat.ArmourTemplate; import com.wurmonline.server.combat.ArmourTemplate;
import com.wurmonline.server.items.*;
import mod.sin.items.caches.*; import mod.sin.items.caches.*;
import org.gotti.wurmunlimited.modloader.ReflectionUtil; import org.gotti.wurmunlimited.modloader.ReflectionUtil;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager; import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
@@ -19,11 +20,6 @@ import org.gotti.wurmunlimited.modsupport.actions.ModActions;
import com.wurmonline.server.behaviours.ActionEntry; import com.wurmonline.server.behaviours.ActionEntry;
import com.wurmonline.server.combat.Weapon; import com.wurmonline.server.combat.Weapon;
import com.wurmonline.server.creatures.Creature; import com.wurmonline.server.creatures.Creature;
import com.wurmonline.server.items.Item;
import com.wurmonline.server.items.ItemList;
import com.wurmonline.server.items.ItemTemplate;
import com.wurmonline.server.items.ItemTemplateFactory;
import com.wurmonline.server.items.NoSuchTemplateException;
import javassist.CtClass; import javassist.CtClass;
import javassist.bytecode.Descriptor; import javassist.bytecode.Descriptor;
import mod.sin.actions.items.*; import mod.sin.actions.items.*;
@@ -52,6 +48,7 @@ public class ItemMod {
//public static TitaniumLump ELECTRUM_LUMP = new TitaniumLump(); //public static TitaniumLump ELECTRUM_LUMP = new TitaniumLump();
public static EnchantOrb ENCHANT_ORB = new EnchantOrb(); public static EnchantOrb ENCHANT_ORB = new EnchantOrb();
public static EternalOrb ETERNAL_ORB = new EternalOrb(); public static EternalOrb ETERNAL_ORB = new EternalOrb();
public static EternalReservoir ETERNAL_RESERVOIR = new EternalReservoir();
public static Eviscerator EVISCERATOR = new Eviscerator(); public static Eviscerator EVISCERATOR = new Eviscerator();
public static FriyanTablet FRIYAN_TABLET = new FriyanTablet(); public static FriyanTablet FRIYAN_TABLET = new FriyanTablet();
public static HugeCrate HUGE_CRATE = new HugeCrate(); public static HugeCrate HUGE_CRATE = new HugeCrate();
@@ -60,7 +57,6 @@ public class ItemMod {
public static SealedMap SEALED_MAP = new SealedMap(); public static SealedMap SEALED_MAP = new SealedMap();
public static SkeletonDecoration SKELETON_DECORATION = new SkeletonDecoration(); public static SkeletonDecoration SKELETON_DECORATION = new SkeletonDecoration();
public static Soul SOUL = new Soul(); public static Soul SOUL = new Soul();
public static EternalReservoir SOUL_FORGE = new EternalReservoir();
public static StatuetteBreyk STATUETTE_BREYK = new StatuetteBreyk(); public static StatuetteBreyk STATUETTE_BREYK = new StatuetteBreyk();
public static StatuetteCyberhusky STATUETTE_CYBERHUSKY = new StatuetteCyberhusky(); public static StatuetteCyberhusky STATUETTE_CYBERHUSKY = new StatuetteCyberhusky();
public static TreasureBox TREASURE_BOX = new TreasureBox(); public static TreasureBox TREASURE_BOX = new TreasureBox();
@@ -117,6 +113,7 @@ public class ItemMod {
DISINTEGRATION_ROD.createTemplate(); DISINTEGRATION_ROD.createTemplate();
ENCHANT_ORB.createTemplate(); ENCHANT_ORB.createTemplate();
ETERNAL_ORB.createTemplate(); ETERNAL_ORB.createTemplate();
ETERNAL_RESERVOIR.createTemplate();
EVISCERATOR.createTemplate(); EVISCERATOR.createTemplate();
FRIYAN_TABLET.createTemplate(); FRIYAN_TABLET.createTemplate();
HUGE_CRATE.createTemplate(); HUGE_CRATE.createTemplate();
@@ -125,7 +122,6 @@ public class ItemMod {
SEALED_MAP.createTemplate(); SEALED_MAP.createTemplate();
SKELETON_DECORATION.createTemplate(); SKELETON_DECORATION.createTemplate();
SOUL.createTemplate(); SOUL.createTemplate();
SOUL_FORGE.createTemplate();
STATUETTE_BREYK.createTemplate(); STATUETTE_BREYK.createTemplate();
STATUETTE_CYBERHUSKY.createTemplate(); STATUETTE_CYBERHUSKY.createTemplate();
TREASURE_BOX.createTemplate(); TREASURE_BOX.createTemplate();
@@ -190,23 +186,44 @@ public class ItemMod {
} }
public static void initCreationEntries(){ public static void initCreationEntries(){
logger.info("initCreationEntries()"); if (WyvernMods.craftHuntingArrowPacks) {
ARROW_PACK_HUNTING.initCreationEntry(); ARROW_PACK_HUNTING.initCreationEntry();
}
if (WyvernMods.craftWarArrowPacks) {
ARROW_PACK_WAR.initCreationEntry(); ARROW_PACK_WAR.initCreationEntry();
}
if (WyvernMods.craftBattleYoyo) {
BATTLE_YOYO.initCreationEntry(); BATTLE_YOYO.initCreationEntry();
}
if (WyvernMods.craftClub) {
CLUB.initCreationEntry(); CLUB.initCreationEntry();
}
//COIN_DECORATION.initCreationEntry(); //COIN_DECORATION.initCreationEntry();
//CORPSE_DECORATION.initCreationEntry(); //CORPSE_DECORATION.initCreationEntry();
if (WyvernMods.craftDepthDrill) {
DEPTH_DRILL.initCreationEntry(); DEPTH_DRILL.initCreationEntry();
}
if (WyvernMods.craftEternalReservoir) {
ETERNAL_RESERVOIR.initCreationEntry();
}
if (WyvernMods.craftEviscerator) {
EVISCERATOR.initCreationEntry(); EVISCERATOR.initCreationEntry();
}
if (WyvernMods.craftKnuckles) {
KNUCKLES.initCreationEntry(); KNUCKLES.initCreationEntry();
}
if (WyvernMods.craftMassStorageUnit) {
MASS_STORAGE_UNIT.initCreationEntry(); MASS_STORAGE_UNIT.initCreationEntry();
}
//SKELETON_DECORATION.initCreationEntry(); //SKELETON_DECORATION.initCreationEntry();
SOUL_FORGE.initCreationEntry(); if (WyvernMods.craftStatuetteDeities) {
STATUETTE_BREYK.initCreationEntry(); STATUETTE_BREYK.initCreationEntry();
STATUETTE_CYBERHUSKY.initCreationEntry(); STATUETTE_CYBERHUSKY.initCreationEntry();
}
if (WyvernMods.craftWarhammer) {
WARHAMMER.initCreationEntry(); WARHAMMER.initCreationEntry();
WARHAMMER_HEAD.initCreationEntry(); WARHAMMER_HEAD.initCreationEntry();
}
// Spectral set // Spectral set
/*SPECTRAL_BOOT.initCreationEntry(); /*SPECTRAL_BOOT.initCreationEntry();
@@ -310,45 +327,66 @@ public class ItemMod {
public static void modifyItems() throws NoSuchTemplateException, IllegalArgumentException, IllegalAccessException, ClassCastException, NoSuchFieldException{ public static void modifyItems() throws NoSuchTemplateException, IllegalArgumentException, IllegalAccessException, ClassCastException, NoSuchFieldException{
// Make leather able to be combined. // Make leather able to be combined.
if (WyvernMods.combineLeather) {
ItemTemplate leather = ItemTemplateFactory.getInstance().getTemplate(ItemList.leather); ItemTemplate leather = ItemTemplateFactory.getInstance().getTemplate(ItemList.leather);
ReflectionUtil.setPrivateField(leather, ReflectionUtil.getField(leather.getClass(), "combine"), true); ReflectionUtil.setPrivateField(leather, ReflectionUtil.getField(leather.getClass(), "combine"), true);
}
// Make logs able to be combined. Also reduce their volume. // Make logs able to be combined. Also reduce their volume.
ItemTemplate log = ItemTemplateFactory.getInstance().getTemplate(ItemList.log); ItemTemplate log = ItemTemplateFactory.getInstance().getTemplate(ItemList.log);
if (WyvernMods.combineLogs) {
ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "combine"), true); ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "combine"), true);
}
if (WyvernMods.reduceLogVolume) {
ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "centimetersZ"), 50); ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "centimetersZ"), 50);
int newVolume = log.getSizeX()*log.getSizeY()*log.getSizeZ(); int newVolume = log.getSizeX() * log.getSizeY() * log.getSizeZ();
ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "volume"), newVolume); ReflectionUtil.setPrivateField(log, ReflectionUtil.getField(log.getClass(), "volume"), newVolume);
}
// Reduce kindling volume as well to make sure they're not larger than logs. // Reduce kindling volume as well to make sure they're not larger than logs.
if (WyvernMods.reduceKindlingVolume) {
ItemTemplate kindling = ItemTemplateFactory.getInstance().getTemplate(ItemList.kindling); ItemTemplate kindling = ItemTemplateFactory.getInstance().getTemplate(ItemList.kindling);
ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "centimetersY"), 10); ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "centimetersY"), 10);
ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "centimetersZ"), 10); ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "centimetersZ"), 10);
int newKindlingVolume = kindling.getSizeX()*kindling.getSizeY()*kindling.getSizeZ(); int newKindlingVolume = kindling.getSizeX() * kindling.getSizeY() * kindling.getSizeZ();
ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "volume"), newKindlingVolume); ReflectionUtil.setPrivateField(kindling, ReflectionUtil.getField(kindling.getClass(), "volume"), newKindlingVolume);
}
// Allow sleep powder to be dropped. // Allow sleep powder to be dropped.
if (WyvernMods.droppableSleepPowder) {
ItemTemplate sleepPowder = ItemTemplateFactory.getInstance().getTemplate(ItemList.sleepPowder); ItemTemplate sleepPowder = ItemTemplateFactory.getInstance().getTemplate(ItemList.sleepPowder);
ReflectionUtil.setPrivateField(sleepPowder, ReflectionUtil.getField(sleepPowder.getClass(), "nodrop"), false); ReflectionUtil.setPrivateField(sleepPowder, ReflectionUtil.getField(sleepPowder.getClass(), "nodrop"), false);
}
// Set silver mirror price to 10 silver instead of 1 iron. // Set silver mirror price to 20 silver instead of 1 iron.
if (WyvernMods.setSilverMirrorPrice) {
ItemTemplate handMirror = ItemTemplateFactory.getInstance().getTemplate(ItemList.handMirror); ItemTemplate handMirror = ItemTemplateFactory.getInstance().getTemplate(ItemList.handMirror);
ReflectionUtil.setPrivateField(handMirror, ReflectionUtil.getField(handMirror.getClass(), "value"), 200000); ReflectionUtil.setPrivateField(handMirror, ReflectionUtil.getField(handMirror.getClass(), "value"), 200000);
}
// Set golden mirror price to 1 gold instead of 1 iron.
if (WyvernMods.setGoldMirrorPrice) {
ItemTemplate goldMirror = ItemTemplateFactory.getInstance().getTemplate(ItemList.goldenMirror); ItemTemplate goldMirror = ItemTemplateFactory.getInstance().getTemplate(ItemList.goldenMirror);
ReflectionUtil.setPrivateField(goldMirror, ReflectionUtil.getField(goldMirror.getClass(), "value"), 1000000); ReflectionUtil.setPrivateField(goldMirror, ReflectionUtil.getField(goldMirror.getClass(), "value"), 1000000);
}
// Creature crates to 10 silver. // Creature crates to 10 silver.
if (WyvernMods.setCreatureCratePrice) {
ItemTemplate creatureCage = ItemTemplateFactory.getInstance().getTemplate(ItemList.creatureCrate); ItemTemplate creatureCage = ItemTemplateFactory.getInstance().getTemplate(ItemList.creatureCrate);
ReflectionUtil.setPrivateField(creatureCage, ReflectionUtil.getField(creatureCage.getClass(), "value"), 100000); ReflectionUtil.setPrivateField(creatureCage, ReflectionUtil.getField(creatureCage.getClass(), "value"), 100000);
ReflectionUtil.setPrivateField(creatureCage, ReflectionUtil.getField(creatureCage.getClass(), "fullprice"), true); ReflectionUtil.setPrivateField(creatureCage, ReflectionUtil.getField(creatureCage.getClass(), "fullprice"), true);
}
// Resurrection Stones to 2 silver instead of 5 silver. // Resurrection Stones to 2 silver instead of 5 silver.
if (WyvernMods.setResurrectionStonePrice) {
ItemTemplate resurrectionStone = ItemTemplateFactory.getInstance().getTemplate(ItemList.resurrectionStone); ItemTemplate resurrectionStone = ItemTemplateFactory.getInstance().getTemplate(ItemList.resurrectionStone);
ReflectionUtil.setPrivateField(resurrectionStone, ReflectionUtil.getField(resurrectionStone.getClass(), "value"), 20000); ReflectionUtil.setPrivateField(resurrectionStone, ReflectionUtil.getField(resurrectionStone.getClass(), "value"), 20000);
}
// Shaker Orbs to 2 silver instead of 5 silver. // Shaker Orbs to 2 silver instead of 5 silver.
if (WyvernMods.setShakerOrbPrice) {
ItemTemplate shakerOrb = ItemTemplateFactory.getInstance().getTemplate(ItemList.shakerOrb); ItemTemplate shakerOrb = ItemTemplateFactory.getInstance().getTemplate(ItemList.shakerOrb);
ReflectionUtil.setPrivateField(shakerOrb, ReflectionUtil.getField(shakerOrb.getClass(), "value"), 20000); ReflectionUtil.setPrivateField(shakerOrb, ReflectionUtil.getField(shakerOrb.getClass(), "value"), 20000);
}
// Set transmutation rod to 2 gold instead of 50 silver. // Set transmutation rod to 2 gold instead of 50 silver.
//ItemTemplate transmutationRod = ItemTemplateFactory.getInstance().getTemplate(668); //ItemTemplate transmutationRod = ItemTemplateFactory.getInstance().getTemplate(668);
@@ -356,7 +394,7 @@ public class ItemMod {
// " return this.isTransportable || (this.getTemplateId() >= 510 && this.getTemplateId() <= 513) || this.getTemplateId() == 722 || this.getTemplateId() == 670;" // " return this.isTransportable || (this.getTemplateId() >= 510 && this.getTemplateId() <= 513) || this.getTemplateId() == 722 || this.getTemplateId() == 670;"
// Make mailboxes loadable (PvE Only) // Make mailboxes loadable (PvE Only)
if(!Servers.localServer.PVPSERVER) { if(WyvernMods.loadableMailbox && !Servers.localServer.PVPSERVER) {
ItemTemplate mailboxWood = ItemTemplateFactory.getInstance().getTemplate(ItemList.mailboxWood); ItemTemplate mailboxWood = ItemTemplateFactory.getInstance().getTemplate(ItemList.mailboxWood);
ReflectionUtil.setPrivateField(mailboxWood, ReflectionUtil.getField(mailboxWood.getClass(), "isTransportable"), true); ReflectionUtil.setPrivateField(mailboxWood, ReflectionUtil.getField(mailboxWood.getClass(), "isTransportable"), true);
ItemTemplate mailboxStone = ItemTemplateFactory.getInstance().getTemplate(ItemList.mailboxStone); ItemTemplate mailboxStone = ItemTemplateFactory.getInstance().getTemplate(ItemList.mailboxStone);
@@ -368,12 +406,17 @@ public class ItemMod {
} }
// Make bell towers and trash bins loadable // Make bell towers and trash bins loadable
if (WyvernMods.loadableBellTower) {
ItemTemplate bellTower = ItemTemplateFactory.getInstance().getTemplate(ItemList.bellTower); ItemTemplate bellTower = ItemTemplateFactory.getInstance().getTemplate(ItemList.bellTower);
ReflectionUtil.setPrivateField(bellTower, ReflectionUtil.getField(bellTower.getClass(), "isTransportable"), true); ReflectionUtil.setPrivateField(bellTower, ReflectionUtil.getField(bellTower.getClass(), "isTransportable"), true);
}
if (WyvernMods.loadableTrashBin) {
ItemTemplate trashBin = ItemTemplateFactory.getInstance().getTemplate(ItemList.trashBin); ItemTemplate trashBin = ItemTemplateFactory.getInstance().getTemplate(ItemList.trashBin);
ReflectionUtil.setPrivateField(trashBin, ReflectionUtil.getField(trashBin.getClass(), "isTransportable"), true); ReflectionUtil.setPrivateField(trashBin, ReflectionUtil.getField(trashBin.getClass(), "isTransportable"), true);
}
// Make altars loadable // Make altars loadable
if (WyvernMods.loadableAltars) {
ItemTemplate stoneAltar = ItemTemplateFactory.getInstance().getTemplate(ItemList.altarStone); ItemTemplate stoneAltar = ItemTemplateFactory.getInstance().getTemplate(ItemList.altarStone);
ReflectionUtil.setPrivateField(stoneAltar, ReflectionUtil.getField(stoneAltar.getClass(), "isTransportable"), true); ReflectionUtil.setPrivateField(stoneAltar, ReflectionUtil.getField(stoneAltar.getClass(), "isTransportable"), true);
ItemTemplate woodAltar = ItemTemplateFactory.getInstance().getTemplate(ItemList.altarWood); ItemTemplate woodAltar = ItemTemplateFactory.getInstance().getTemplate(ItemList.altarWood);
@@ -382,30 +425,46 @@ public class ItemMod {
ReflectionUtil.setPrivateField(silverAltar, ReflectionUtil.getField(silverAltar.getClass(), "isTransportable"), true); ReflectionUtil.setPrivateField(silverAltar, ReflectionUtil.getField(silverAltar.getClass(), "isTransportable"), true);
ItemTemplate goldAltar = ItemTemplateFactory.getInstance().getTemplate(ItemList.altarGold); ItemTemplate goldAltar = ItemTemplateFactory.getInstance().getTemplate(ItemList.altarGold);
ReflectionUtil.setPrivateField(goldAltar, ReflectionUtil.getField(goldAltar.getClass(), "isTransportable"), true); ReflectionUtil.setPrivateField(goldAltar, ReflectionUtil.getField(goldAltar.getClass(), "isTransportable"), true);
}
// Make long spears one-handed. // Make long spears one-handed.
if (WyvernMods.oneHandedLongSpear) {
ItemTemplate longSpear = ItemTemplateFactory.getInstance().getTemplate(ItemList.spearLong); ItemTemplate longSpear = ItemTemplateFactory.getInstance().getTemplate(ItemList.spearLong);
ReflectionUtil.setPrivateField(longSpear, ReflectionUtil.getField(longSpear.getClass(), "isTwohanded"), false); ReflectionUtil.setPrivateField(longSpear, ReflectionUtil.getField(longSpear.getClass(), "isTwohanded"), false);
}
// Make dirt/sand difficulty easier // Make dirt/sand difficulty easier
if (WyvernMods.reduceDirtDifficulty) {
ItemTemplate dirt = ItemTemplateFactory.getInstance().getTemplate(ItemList.dirtPile); ItemTemplate dirt = ItemTemplateFactory.getInstance().getTemplate(ItemList.dirtPile);
ReflectionUtil.setPrivateField(dirt, ReflectionUtil.getField(dirt.getClass(), "difficulty"), 50.0f); ReflectionUtil.setPrivateField(dirt, ReflectionUtil.getField(dirt.getClass(), "difficulty"), 50.0f);
}
if (WyvernMods.reduceSandDifficulty) {
ItemTemplate sand = ItemTemplateFactory.getInstance().getTemplate(ItemList.sand); ItemTemplate sand = ItemTemplateFactory.getInstance().getTemplate(ItemList.sand);
ReflectionUtil.setPrivateField(sand, ReflectionUtil.getField(sand.getClass(), "difficulty"), 50.0f); ReflectionUtil.setPrivateField(sand, ReflectionUtil.getField(sand.getClass(), "difficulty"), 50.0f);
}
if (WyvernMods.reduceSandstoneDifficulty) {
ItemTemplate sandstone = ItemTemplateFactory.getInstance().getTemplate(ItemList.sandstone); ItemTemplate sandstone = ItemTemplateFactory.getInstance().getTemplate(ItemList.sandstone);
ReflectionUtil.setPrivateField(sandstone, ReflectionUtil.getField(sandstone.getClass(), "difficulty"), 50.0f); ReflectionUtil.setPrivateField(sandstone, ReflectionUtil.getField(sandstone.getClass(), "difficulty"), 50.0f);
}
// Make some useless items decorations for added interior design. // Make some useless items decorations for added interior design.
if (WyvernMods.decorationStoneKeystone) {
ItemTemplate stoneKeystone = ItemTemplateFactory.getInstance().getTemplate(ItemList.stoneKeystone); ItemTemplate stoneKeystone = ItemTemplateFactory.getInstance().getTemplate(ItemList.stoneKeystone);
ReflectionUtil.setPrivateField(stoneKeystone, ReflectionUtil.getField(stoneKeystone.getClass(), "decoration"), true); ReflectionUtil.setPrivateField(stoneKeystone, ReflectionUtil.getField(stoneKeystone.getClass(), "decoration"), true);
}
if (WyvernMods.decorationMarbleKeystone) {
ItemTemplate marbleKeystone = ItemTemplateFactory.getInstance().getTemplate(ItemList.marbleKeystone); ItemTemplate marbleKeystone = ItemTemplateFactory.getInstance().getTemplate(ItemList.marbleKeystone);
ReflectionUtil.setPrivateField(marbleKeystone, ReflectionUtil.getField(marbleKeystone.getClass(), "decoration"), true); ReflectionUtil.setPrivateField(marbleKeystone, ReflectionUtil.getField(marbleKeystone.getClass(), "decoration"), true);
}
if (WyvernMods.decorationSkull) {
ItemTemplate skull = ItemTemplateFactory.getInstance().getTemplate(ItemList.skull); ItemTemplate skull = ItemTemplateFactory.getInstance().getTemplate(ItemList.skull);
ReflectionUtil.setPrivateField(skull, ReflectionUtil.getField(skull.getClass(), "decoration"), true); ReflectionUtil.setPrivateField(skull, ReflectionUtil.getField(skull.getClass(), "decoration"), true);
}
// Modify fragment counts // Modify fragment counts
if (WyvernMods.useCustomCacheFragments) {
setFragments(ArmourCache.templateId, 18); setFragments(ArmourCache.templateId, 18);
setFragments(ArtifactCache.templateId, 33); setFragments(ArtifactCache.templateId, 33);
setFragments(CrystalCache.templateId, 11); setFragments(CrystalCache.templateId, 11);
@@ -419,7 +478,9 @@ public class ItemMod {
setFragments(TreasureMapCache.templateId, 38); setFragments(TreasureMapCache.templateId, 38);
setFragments(AffinityOrb.templateId, 20); setFragments(AffinityOrb.templateId, 20);
}
if (WyvernMods.adjustStatueFragmentCount) {
// Tier 4 // Tier 4
setFragments(ItemList.statueWorg, 40); setFragments(ItemList.statueWorg, 40);
setFragments(ItemList.statueEagle, 40); setFragments(ItemList.statueEagle, 40);
@@ -433,15 +494,31 @@ public class ItemMod {
setFragments(ItemList.statueMagranon, 50); setFragments(ItemList.statueMagranon, 50);
setFragments(ItemList.statueLibila, 50); setFragments(ItemList.statueLibila, 50);
setFragments(ItemList.statueVynora, 50); setFragments(ItemList.statueVynora, 50);
}
if (WyvernMods.enableCustomItemCreation) {
createCustomWeapons(); createCustomWeapons();
createCustomArmours(); createCustomArmours();
}
// Make huge crates larger // Make huge crates larger
//ItemTemplate hugeCrate = ItemTemplateFactory.getInstance().getTemplate(HUGE_CRATE.getTemplateId()); //ItemTemplate hugeCrate = ItemTemplateFactory.getInstance().getTemplate(HUGE_CRATE.getTemplateId());
//ReflectionUtil.setPrivateField(hugeCrate, ReflectionUtil.getField(hugeCrate.getClass(), "combine"), true); //ReflectionUtil.setPrivateField(hugeCrate, ReflectionUtil.getField(hugeCrate.getClass(), "combine"), true);
} }
public static void onServerStarted(){
if (WyvernMods.removeLockpickSkillRequirement) {
CreationEntry lockpicks = CreationMatrix.getInstance().getCreationEntry(ItemList.lockpick);
try {
ReflectionUtil.setPrivateField(lockpicks, ReflectionUtil.getField(lockpicks.getClass(), "hasMinimumSkillRequirement"), false);
ReflectionUtil.setPrivateField(lockpicks, ReflectionUtil.getField(lockpicks.getClass(), "minimumSkill"), 0.0);
} catch (IllegalAccessException | NoSuchFieldException e) {
logger.info("Failed to set lockpick creation entry changes!");
e.printStackTrace();
}
}
}
public static void registerPermissionsHook(){ public static void registerPermissionsHook(){
try { try {
CtClass[] input = { CtClass[] input = {

View File

@@ -67,17 +67,6 @@ public class Mastercraft {
return mult; return mult;
} }
public static void changeExistingTitles(){
for (Titles.Title title : Titles.Title.values()) {
if (Objects.equals("Pumpkin King", title.getFemaleName())){
try {
ReflectionUtil.setPrivateField(title, ReflectionUtil.getField(title.getClass(), "femaleName"), "Pumpkin Queen");
} catch (IllegalArgumentException | IllegalAccessException | ClassCastException | NoSuchFieldException e) {
e.printStackTrace();
}
}
}
}
public static void preInit(){ public static void preInit(){
try { try {
ClassPool classPool = HookManager.getInstance().getClassPool(); ClassPool classPool = HookManager.getInstance().getClassPool();

View File

@@ -28,6 +28,7 @@ import javassist.expr.ExprEditor;
import javassist.expr.FieldAccess; import javassist.expr.FieldAccess;
import javassist.expr.MethodCall; import javassist.expr.MethodCall;
import mod.sin.lib.Util; import mod.sin.lib.Util;
import org.gotti.wurmunlimited.modloader.ReflectionUtil;
import org.gotti.wurmunlimited.modloader.classhooks.HookException; import org.gotti.wurmunlimited.modloader.classhooks.HookException;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager; import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modsupport.ModSupportDb; import org.gotti.wurmunlimited.modsupport.ModSupportDb;
@@ -326,6 +327,18 @@ public class MiscChanges {
return true; return true;
} }
public static void changeExistingTitles(){
for (Titles.Title title : Titles.Title.values()) {
if (Objects.equals("Pumpkin King", title.getFemaleName())){
try {
ReflectionUtil.setPrivateField(title, ReflectionUtil.getField(title.getClass(), "femaleName"), "Pumpkin Queen");
} catch (IllegalArgumentException | IllegalAccessException | ClassCastException | NoSuchFieldException e) {
e.printStackTrace();
}
}
}
}
public static void preInit(){ public static void preInit(){
try{ try{
ClassPool classPool = HookManager.getInstance().getClassPool(); ClassPool classPool = HookManager.getInstance().getClassPool();

View File

@@ -3,7 +3,8 @@ package mod.sin.wyvern;
import com.wurmonline.server.Message; import com.wurmonline.server.Message;
import com.wurmonline.server.TimeConstants; import com.wurmonline.server.TimeConstants;
import com.wurmonline.server.creatures.Creature; import com.wurmonline.server.creatures.Creature;
import com.wurmonline.server.items.*; import com.wurmonline.server.items.Item;
import com.wurmonline.server.items.NoSuchTemplateException;
import com.wurmonline.server.players.Player; import com.wurmonline.server.players.Player;
import javassist.CannotCompileException; import javassist.CannotCompileException;
import javassist.ClassPool; import javassist.ClassPool;
@@ -18,8 +19,6 @@ import mod.sin.creatures.titans.*;
import mod.sin.lib.Prop; import mod.sin.lib.Prop;
import mod.sin.lib.SkillAssist; import mod.sin.lib.SkillAssist;
import mod.sin.lib.Util; import mod.sin.lib.Util;
import mod.sin.wyvern.bestiary.MethodsBestiary;
import org.gotti.wurmunlimited.modloader.ReflectionUtil;
import org.gotti.wurmunlimited.modloader.classhooks.HookException; import org.gotti.wurmunlimited.modloader.classhooks.HookException;
import org.gotti.wurmunlimited.modloader.classhooks.HookManager; import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
import org.gotti.wurmunlimited.modloader.interfaces.*; import org.gotti.wurmunlimited.modloader.interfaces.*;
@@ -95,6 +94,8 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
public static boolean disableSmeltingPots = true; public static boolean disableSmeltingPots = true;
public static boolean hideSorceryBuffBar = true; public static boolean hideSorceryBuffBar = true;
public static boolean sqlAchievementFix = true; public static boolean sqlAchievementFix = true;
public static boolean changePumpkinKingTitle = true;
public static boolean changeDeityPassives = true;
// Arena Module Configuration // Arena Module Configuration
public static boolean enableArenaModule = true; public static boolean enableArenaModule = true;
@@ -265,6 +266,99 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
public static long captureMessageInterval = TimeConstants.MINUTE_MILLIS*3L; public static long captureMessageInterval = TimeConstants.MINUTE_MILLIS*3L;
public static long depotRespawnTime = TimeConstants.HOUR_MILLIS*11L; public static long depotRespawnTime = TimeConstants.HOUR_MILLIS*11L;
// Bestiary Module Configuration
public static boolean enableBestiaryModule = true;
public static boolean fixSacrificingStrongCreatures = true;
public static boolean disableAfkTraining = true;
public static boolean fixChargersWalkingThroughWalls = true;
public static boolean conditionWildCreatures = true;
public static boolean allowGhostArchery = true;
public static boolean disableArcheryOnStrongCreatures = true;
public static boolean genesisEnchantedGrassNewborns = true;
public static boolean useCustomCorpseSizes = true;
public static boolean allowCustomCreatureBreedNames = true;
public static boolean allowGhostBreeding = true;
public static boolean allowGhostCorpses = true;
public static boolean useCustomCreatureSizes = true;
public static boolean useCustomCreatureSFX = true;
public static boolean preventLegendaryHitching = true;
public static boolean modifyNewCreatures = true;
public static boolean logCreatureSpawns = true;
public static boolean allowEpicCreatureNaturalSpawns = true;
public static boolean enableCustomCreatures = true;
public static boolean enableWyverns = true;
public static boolean enableFlavorMobs = true;
public static boolean enableEventMobs = true;
public static boolean enableRareSpawns = true;
public static boolean enableCustomLegendaries = true;
public static boolean enableTitans = true;
// Bounty Module Configuration
public static boolean enableBountyModule = true;
public static boolean usePlayerBounty = true;
public static boolean useLootTable = true;
// Item Module Configuration
public static boolean enableItemModule = true;
public static boolean combineLeather = true;
public static boolean combineLogs = true;
public static boolean reduceLogVolume = true;
public static boolean reduceKindlingVolume = true;
public static boolean droppableSleepPowder = true;
public static boolean setSilverMirrorPrice = true;
public static boolean setGoldMirrorPrice = true;
public static boolean setCreatureCratePrice = true;
public static boolean setResurrectionStonePrice = true;
public static boolean setShakerOrbPrice = true;
public static boolean loadableMailbox = true;
public static boolean loadableBellTower = true;
public static boolean loadableTrashBin = true;
public static boolean loadableAltars = true;
public static boolean oneHandedLongSpear = true;
public static boolean reduceDirtDifficulty = true;
public static boolean reduceSandDifficulty = true;
public static boolean reduceSandstoneDifficulty = true;
public static boolean decorationStoneKeystone = true;
public static boolean decorationMarbleKeystone = true;
public static boolean decorationSkull = true;
public static boolean useCustomCacheFragments = true;
public static boolean adjustStatueFragmentCount = true;
public static boolean removeLockpickSkillRequirement = true;
public static boolean createCustomItemTemplates = true;
public static boolean enableCustomItemCreation = true;
public static boolean craftHuntingArrowPacks = true;
public static boolean craftWarArrowPacks = true;
public static boolean craftBattleYoyo = true;
public static boolean craftClub = true;
public static boolean craftDepthDrill = true;
public static boolean craftEternalReservoir = true;
public static boolean craftEviscerator = true;
public static boolean craftKnuckles = true;
public static boolean craftMassStorageUnit = true;
public static boolean craftStatuetteDeities = true;
public static boolean craftWarhammer = true;
// Soulstealing Module Configuration
public static boolean enableSoulstealingModule = true;
public static long pollEternalReservoirTime = TimeConstants.MINUTE_MILLIS*10;
// Action Module Configuration
public static boolean enableActionModule = true;
public static boolean actionUnequipAll = true;
public static boolean actionReceiveAllMail = true;
public static boolean actionSplitSorcery = true;
public static boolean actionLeaderboard = true;
public static boolean actionSorceryFragmentCombine = true;
public static boolean actionArenaTeleports = true;
public static boolean actionAddMissionDev = true;
public static boolean actionRemoveMissionDev = true;
public static boolean actionCreatureReportDev = true;
public static boolean actionSmoothTerrainDev = true;
// Erosion Module Configuration
public static boolean enableErosionModule = true;
public static long pollTerrainSmoothTime = TimeConstants.SECOND_MILLIS*5;
// Treasure Chest Loot Module Configuration // Treasure Chest Loot Module Configuration
public static boolean enableTreasureChestLootModule = true; public static boolean enableTreasureChestLootModule = true;
@@ -385,6 +479,8 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
disableSmeltingPots = Prop.getBooleanProperty("disableSmeltingPots", disableSmeltingPots); disableSmeltingPots = Prop.getBooleanProperty("disableSmeltingPots", disableSmeltingPots);
hideSorceryBuffBar = Prop.getBooleanProperty("hideSorceryBuffBar", hideSorceryBuffBar); hideSorceryBuffBar = Prop.getBooleanProperty("hideSorceryBuffBar", hideSorceryBuffBar);
sqlAchievementFix = Prop.getBooleanProperty("sqlAchievementFix", sqlAchievementFix); sqlAchievementFix = Prop.getBooleanProperty("sqlAchievementFix", sqlAchievementFix);
changePumpkinKingTitle = Prop.getBooleanProperty("changePumpkinKingTitle", changePumpkinKingTitle);
changeDeityPassives = Prop.getBooleanProperty("changeDeityPassives", changeDeityPassives);
// Arena Module // Arena Module
enableArenaModule = Prop.getBooleanProperty("enableArenaModule", enableArenaModule); enableArenaModule = Prop.getBooleanProperty("enableArenaModule", enableArenaModule);
@@ -550,6 +646,98 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
captureMessageInterval = Prop.getLongProperty("captureMessageInterval", captureMessageInterval); captureMessageInterval = Prop.getLongProperty("captureMessageInterval", captureMessageInterval);
depotRespawnTime = Prop.getLongProperty("depotRespawnTime", depotRespawnTime); depotRespawnTime = Prop.getLongProperty("depotRespawnTime", depotRespawnTime);
// Bestiary Module
enableBestiaryModule = Prop.getBooleanProperty("enableBestiaryModule", enableBestiaryModule);
fixSacrificingStrongCreatures = Prop.getBooleanProperty("fixSacrificingStrongCreatures", fixSacrificingStrongCreatures);
disableAfkTraining = Prop.getBooleanProperty("disableAfkTraining", disableAfkTraining);
fixChargersWalkingThroughWalls = Prop.getBooleanProperty("fixChargersWalkingThroughWalls", fixChargersWalkingThroughWalls);
conditionWildCreatures = Prop.getBooleanProperty("conditionWildCreatures", conditionWildCreatures);
allowGhostArchery = Prop.getBooleanProperty("allowGhostArchery", allowGhostArchery);
disableArcheryOnStrongCreatures = Prop.getBooleanProperty("disableArcheryOnStrongCreatures", disableArcheryOnStrongCreatures);
genesisEnchantedGrassNewborns = Prop.getBooleanProperty("genesisEnchantedGrassNewborns", genesisEnchantedGrassNewborns);
useCustomCorpseSizes = Prop.getBooleanProperty("useCustomCorpseSizes", useCustomCorpseSizes);
allowCustomCreatureBreedNames = Prop.getBooleanProperty("allowCustomCreatureBreedNames", allowCustomCreatureBreedNames);
allowGhostBreeding = Prop.getBooleanProperty("allowGhostBreeding", allowGhostBreeding);
useCustomCreatureSizes = Prop.getBooleanProperty("useCustomCreatureSizes", useCustomCreatureSizes);
useCustomCreatureSFX = Prop.getBooleanProperty("useCustomCreatureSFX", useCustomCreatureSFX);
preventLegendaryHitching = Prop.getBooleanProperty("preventLegendaryHitching", preventLegendaryHitching);
modifyNewCreatures = Prop.getBooleanProperty("modifyNewCreatures", modifyNewCreatures);
logCreatureSpawns = Prop.getBooleanProperty("logCreatureSpawns", logCreatureSpawns);
allowEpicCreatureNaturalSpawns = Prop.getBooleanProperty("allowEpicCreatureNaturalSpawns", allowEpicCreatureNaturalSpawns);
enableCustomCreatures = Prop.getBooleanProperty("enableCustomCreatures", enableCustomCreatures);
enableWyverns = Prop.getBooleanProperty("enableWyverns", enableWyverns);
enableFlavorMobs = Prop.getBooleanProperty("enableFlavorMobs", enableFlavorMobs);
enableEventMobs = Prop.getBooleanProperty("enableEventMobs", enableEventMobs);
enableRareSpawns = Prop.getBooleanProperty("enableRareSpawns", enableRareSpawns);
enableCustomLegendaries = Prop.getBooleanProperty("enableCustomLegendaries", enableCustomLegendaries);
enableTitans = Prop.getBooleanProperty("enableTitans", enableTitans);
// Bounty Module
enableBountyModule = Prop.getBooleanProperty("enableBountyModule", enableBountyModule);
usePlayerBounty = Prop.getBooleanProperty("usePlayerBounty", usePlayerBounty);
useLootTable = Prop.getBooleanProperty("useLootTable", useLootTable);
// Item Module
enableItemModule = Prop.getBooleanProperty("enableItemModule", enableItemModule);
combineLeather = Prop.getBooleanProperty("combineLeather", combineLeather);
combineLogs = Prop.getBooleanProperty("combineLogs", combineLogs);
reduceLogVolume = Prop.getBooleanProperty("reduceLogVolume", reduceLogVolume);
reduceKindlingVolume = Prop.getBooleanProperty("reduceKindlingVolume", reduceKindlingVolume);
droppableSleepPowder = Prop.getBooleanProperty("droppableSleepPowder", droppableSleepPowder);
setSilverMirrorPrice = Prop.getBooleanProperty("setSilverMirrorPrice", setSilverMirrorPrice);
setGoldMirrorPrice = Prop.getBooleanProperty("setGoldMirrorPrice", setGoldMirrorPrice);
setCreatureCratePrice = Prop.getBooleanProperty("setCreatureCratePrice", setCreatureCratePrice);
setResurrectionStonePrice = Prop.getBooleanProperty("setResurrectionStonePrice", setResurrectionStonePrice);
setShakerOrbPrice = Prop.getBooleanProperty("setShakerOrbPrice", setShakerOrbPrice);
loadableMailbox = Prop.getBooleanProperty("loadableMailbox", loadableMailbox);
loadableBellTower = Prop.getBooleanProperty("loadableBellTower", loadableBellTower);
loadableTrashBin = Prop.getBooleanProperty("loadableTrashBin", loadableTrashBin);
loadableAltars = Prop.getBooleanProperty("loadableAltars", loadableAltars);
oneHandedLongSpear = Prop.getBooleanProperty("oneHandedLongSpear", oneHandedLongSpear);
reduceDirtDifficulty = Prop.getBooleanProperty("reduceDirtDifficulty", reduceDirtDifficulty);
reduceSandDifficulty = Prop.getBooleanProperty("reduceSandDifficulty", reduceSandDifficulty);
reduceSandstoneDifficulty = Prop.getBooleanProperty("reduceSandstoneDifficulty", reduceSandstoneDifficulty);
decorationStoneKeystone = Prop.getBooleanProperty("decorationStoneKeystone", decorationStoneKeystone);
decorationMarbleKeystone = Prop.getBooleanProperty("decorationMarbleKeystone", decorationMarbleKeystone);
decorationSkull = Prop.getBooleanProperty("decorationSkull", decorationSkull);
useCustomCacheFragments = Prop.getBooleanProperty("useCustomCacheFragments", useCustomCacheFragments);
adjustStatueFragmentCount = Prop.getBooleanProperty("adjustStatueFragmentCount", adjustStatueFragmentCount);
removeLockpickSkillRequirement = Prop.getBooleanProperty("removeLockpickSkillRequirement", removeLockpickSkillRequirement);
createCustomItemTemplates = Prop.getBooleanProperty("createCustomItemTemplates", createCustomItemTemplates);
enableCustomItemCreation = Prop.getBooleanProperty("enableCustomItemCreation", enableCustomItemCreation);
craftHuntingArrowPacks = Prop.getBooleanProperty("craftHuntingArrowPacks", craftHuntingArrowPacks);
craftWarArrowPacks = Prop.getBooleanProperty("craftWarArrowPacks", craftWarArrowPacks);
craftBattleYoyo = Prop.getBooleanProperty("craftBattleYoyo", craftBattleYoyo);
craftClub = Prop.getBooleanProperty("craftClub", craftClub);
craftDepthDrill = Prop.getBooleanProperty("craftDepthDrill", craftDepthDrill);
craftEternalReservoir = Prop.getBooleanProperty("craftEternalReservoir", craftEternalReservoir);
craftEviscerator = Prop.getBooleanProperty("craftEviscerator", craftEviscerator);
craftKnuckles = Prop.getBooleanProperty("craftKnuckles", craftKnuckles);
craftMassStorageUnit = Prop.getBooleanProperty("craftMassStorageUnit", craftMassStorageUnit);
craftStatuetteDeities = Prop.getBooleanProperty("craftStatuetteDeities", craftStatuetteDeities);
craftWarhammer = Prop.getBooleanProperty("craftWarhammer", craftWarhammer);
// Soulstealing Module
enableSoulstealingModule = Prop.getBooleanProperty("enableSoulstealingModule", enableSoulstealingModule);
pollEternalReservoirTime = Prop.getLongProperty("pollEternalReservoirTime", pollEternalReservoirTime);
// Action Module
enableActionModule = Prop.getBooleanProperty("enableActionModule", enableActionModule);
actionUnequipAll = Prop.getBooleanProperty("actionUnequipAll", actionUnequipAll);
actionReceiveAllMail = Prop.getBooleanProperty("actionReceiveAllMail", actionReceiveAllMail);
actionSplitSorcery = Prop.getBooleanProperty("actionSplitSorcery", actionSplitSorcery);
actionLeaderboard = Prop.getBooleanProperty("actionLeaderboard", actionLeaderboard);
actionSorceryFragmentCombine = Prop.getBooleanProperty("actionSorceryFragmentCombine", actionSorceryFragmentCombine);
actionArenaTeleports = Prop.getBooleanProperty("actionArenaTeleports", actionArenaTeleports);
actionAddMissionDev = Prop.getBooleanProperty("actionAddMissionDev", actionAddMissionDev);
actionRemoveMissionDev = Prop.getBooleanProperty("actionRemoveMissionDev", actionRemoveMissionDev);
actionCreatureReportDev = Prop.getBooleanProperty("actionCreatureReportDev", actionCreatureReportDev);
actionSmoothTerrainDev = Prop.getBooleanProperty("actionSmoothTerrainDev", actionSmoothTerrainDev);
// Erosion Module
enableErosionModule = Prop.getBooleanProperty("enableErosionModule", enableErosionModule);
pollTerrainSmoothTime = Prop.getLongProperty("pollTerrainSmoothTime", pollTerrainSmoothTime);
// Treasure Chest Loot Module // Treasure Chest Loot Module
enableTreasureChestLootModule = Prop.getBooleanProperty("enableTreasureChestLootModule", enableTreasureChestLootModule); enableTreasureChestLootModule = Prop.getBooleanProperty("enableTreasureChestLootModule", enableTreasureChestLootModule);
@@ -716,6 +904,8 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
logger.info("Disable Smelting Pots: " + disableSmeltingPots); logger.info("Disable Smelting Pots: " + disableSmeltingPots);
logger.info("Hide Sorcery Buff Bar: " + hideSorceryBuffBar); logger.info("Hide Sorcery Buff Bar: " + hideSorceryBuffBar);
logger.info("SQL Achievement Fix: " + sqlAchievementFix); logger.info("SQL Achievement Fix: " + sqlAchievementFix);
logger.info("Change Pumpkin King Title: "+changePumpkinKingTitle);
logger.info("Change Deity Passives: "+changeDeityPassives);
} }
logger.info("Arena Module: "+enableArenaModule); logger.info("Arena Module: "+enableArenaModule);
@@ -929,6 +1119,109 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
logger.info("Depot Respawn Timer: "+depotRespawnTime); logger.info("Depot Respawn Timer: "+depotRespawnTime);
} }
logger.info("Bestiary Module: "+enableBestiaryModule);
if (enableBestiaryModule){
logger.info("Fix Sacrificing Strong Creatures: "+fixSacrificingStrongCreatures);
logger.info("Disable AFK Training: "+disableAfkTraining);
logger.info("Fix Chargers Walking Through Walls: "+fixChargersWalkingThroughWalls);
logger.info("Condition Wild Creatures: "+conditionWildCreatures);
logger.info("Allow Ghost Archery: "+allowGhostArchery);
logger.info("Disable Archery On Strong Creatures: "+disableArcheryOnStrongCreatures);
logger.info("Genesis Enchanted Grass Newborns: "+genesisEnchantedGrassNewborns);
logger.info("Use Custom Corpse Sizes: "+useCustomCorpseSizes);
logger.info("Allow Custom Creature Breed Names: "+allowCustomCreatureBreedNames);
logger.info("Allow Ghost Breeding: "+allowGhostBreeding);
logger.info("Allow Ghost Corpses: "+allowGhostCorpses);
logger.info("Use Custom Creature Sizes: "+useCustomCreatureSizes);
logger.info("Use Custom Creature SFX: "+useCustomCreatureSFX);
logger.info("Prevent Legendary Hitching: "+preventLegendaryHitching);
logger.info("Modify New Creatures: "+modifyNewCreatures);
logger.info("Log Creature Spawns: "+logCreatureSpawns);
logger.info("Enable Epic Creature Natural Spawns: "+allowEpicCreatureNaturalSpawns);
logger.info("Custom Creatures: "+enableCustomCreatures);
if (enableCustomCreatures){
logger.info("Enable Wyverns: "+enableWyverns);
logger.info("Enable Flavor Mobs: "+enableFlavorMobs);
logger.info("Enable Event Mobs: "+enableEventMobs);
logger.info("Enable Rare Spawn Mobs: "+enableRareSpawns);
logger.info("Enable Custom Legendaries: "+enableCustomLegendaries);
logger.info("Enable Titans: "+enableTitans);
}
}
logger.info("Bounty Module: "+enableBountyModule);
if (enableBountyModule){
logger.info("Use Player Bounty: "+usePlayerBounty);
logger.info("Use Loot Table: "+useLootTable);
}
logger.info("Item Module: "+enableItemModule);
if (enableItemModule){
logger.info("Combine Leather: "+combineLeather);
logger.info("Combine Logs: "+combineLogs);
logger.info("Reduce Log Volume: "+reduceLogVolume);
logger.info("Reduce Kindling Volume: "+reduceKindlingVolume);
logger.info("Droppable Sleep Powder: "+droppableSleepPowder);
logger.info("Set Silver Mirror Price: "+setSilverMirrorPrice);
logger.info("Set Gold Mirror Price: "+setGoldMirrorPrice);
logger.info("Set Creature Crate Price: "+setCreatureCratePrice);
logger.info("Set Resurrection Stone Price: "+setResurrectionStonePrice);
logger.info("Set Shaker Orb Price: "+setShakerOrbPrice);
logger.info("Loadable Mailbox: "+loadableMailbox);
logger.info("Loadable Bell Tower: "+loadableBellTower);
logger.info("Loadable Trash Bin: "+loadableTrashBin);
logger.info("Loadable Altars: "+loadableAltars);
logger.info("One Handed Long Spear: "+oneHandedLongSpear);
logger.info("Reduce Dirt Difficulty: "+reduceDirtDifficulty);
logger.info("Reduce Sand Difficulty: "+reduceSandDifficulty);
logger.info("Reduce Sandstone Difficulty: "+reduceSandstoneDifficulty);
logger.info("Decoration Stone Keystone: "+decorationStoneKeystone);
logger.info("Decoration Marble Keystone: "+decorationMarbleKeystone);
logger.info("Decoration Skull: "+decorationSkull);
logger.info("Use Custom Cache Fragments: "+useCustomCacheFragments);
logger.info("Adjust Statue Fragment Count: "+adjustStatueFragmentCount);
logger.info("Remove Lockpick Skill Requirement: "+removeLockpickSkillRequirement);
logger.info("Create Custom Item Templates: "+createCustomItemTemplates);
logger.info("Custom Item Creation: "+enableCustomItemCreation);
if (enableCustomItemCreation){
logger.info("Craft Hunting Arrow Packs: "+craftHuntingArrowPacks);
logger.info("Craft War Arrow Packs: "+craftWarArrowPacks);
logger.info("Craft Battle Yoyo: "+craftBattleYoyo);
logger.info("Craft Club: "+craftClub);
logger.info("Craft Depth Drill: "+craftDepthDrill);
logger.info("Craft Eternal Reservoir: "+craftEternalReservoir);
logger.info("Craft Eviscerator: "+craftEviscerator);
logger.info("Craft Knuckles: "+craftKnuckles);
logger.info("Craft Mass Storage Unit: "+craftMassStorageUnit);
logger.info("Craft Statuette Deities: "+craftStatuetteDeities);
logger.info("Craft Warhammer: "+craftWarhammer);
}
}
logger.info("Soulstealing Module: "+enableSoulstealingModule);
if (enableSoulstealingModule){
logger.info("Poll Eternal Reservoir Timer: "+pollEternalReservoirTime);
}
logger.info("Action Module: "+enableActionModule);
if (enableActionModule){
logger.info("Unequip All Action: "+actionUnequipAll);
logger.info("Receive All Mail Action: "+actionReceiveAllMail);
logger.info("Split Sorcery Action: "+actionSplitSorcery);
logger.info("Leaderboard Action: "+actionLeaderboard);
logger.info("Sorcery Fragment Combine Action: "+actionSorceryFragmentCombine);
logger.info("Arena Teleport Actions: "+actionArenaTeleports);
logger.info("Add Mission Dev Action: "+actionAddMissionDev);
logger.info("Remove Mission Dev Action: "+actionRemoveMissionDev);
logger.info("Creature Report Dev Action: "+actionCreatureReportDev);
logger.info("Smooth Terrain Dev Action: "+actionSmoothTerrainDev);
}
logger.info("Erosion Module: "+enableErosionModule);
if (enableErosionModule){
logger.info("Poll Terrain Smooth Timer: "+pollTerrainSmoothTime);
}
logger.info("Treasure Chest Loot Module: "+enableTreasureChestLootModule); logger.info("Treasure Chest Loot Module: "+enableTreasureChestLootModule);
} }
@@ -1024,13 +1317,16 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
SupplyDepots.preInit(); SupplyDepots.preInit();
} }
// Bestiary Module Pre-Init
if (enableBestiaryModule) {
Bestiary.preInit();
}
// Treasure Chest Loot Module Pre-Init // Treasure Chest Loot Module Pre-Init
if (enableTreasureChestLootModule) { if (enableTreasureChestLootModule) {
TreasureChests.preInit(); TreasureChests.preInit();
} }
MethodsBestiary.preInit();
// Only clears responses, doesn't have any effect. Harmless to run even if key fragments are not used. // Only clears responses, doesn't have any effect. Harmless to run even if key fragments are not used.
KeyEvent.preInit(); KeyEvent.preInit();
@@ -1068,34 +1364,48 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
@Override @Override
public void init() { public void init() {
logger.info("Initializing."); logger.info("Initializing.");
if (WyvernMods.enableCustomTitlesModule) {
PlayerTitles.init();
}
ModCreatures.init(); ModCreatures.init();
ModVehicleBehaviours.init(); ModVehicleBehaviours.init();
if (WyvernMods.enableCustomTitlesModule) {
PlayerTitles.init();
}
if (WyvernMods.enableMiscChangesModule) {
MiscChanges.changeExistingTitles();
}
if (WyvernMods.enableBountyModule) {
Bounty.init();
}
// Vanilla: // Vanilla:
logger.info("Registering Vanilla creature changes."); if (WyvernMods.enableMountedModule && WyvernMods.allowBisonMounts) {
if (enableMountedModule && allowBisonMounts) {
logger.info("Allowing Bison to be mounted."); logger.info("Allowing Bison to be mounted.");
ModCreatures.addCreature(new Bison()); ModCreatures.addCreature(new Bison());
} }
// Epic: // Epic:
logger.info("Registering Epic creatures."); if (WyvernMods.enableBestiaryModule && WyvernMods.allowEpicCreatureNaturalSpawns) {
logger.info("Allowing epic creatures to spawn naturally.");
ModCreatures.addCreature(new LavaFiend()); ModCreatures.addCreature(new LavaFiend());
ModCreatures.addCreature(new SolDemon()); ModCreatures.addCreature(new SolDemon());
ModCreatures.addCreature(new Worg()); ModCreatures.addCreature(new Worg());
}
if (WyvernMods.enableBestiaryModule && WyvernMods.enableCustomCreatures) {
// Wyverns: // Wyverns:
if (WyvernMods.enableWyverns) {
logger.info("Registering Wyverns."); logger.info("Registering Wyverns.");
ModCreatures.addCreature(new WyvernBlack()); ModCreatures.addCreature(new WyvernBlack());
ModCreatures.addCreature(new WyvernGreen()); ModCreatures.addCreature(new WyvernGreen());
ModCreatures.addCreature(new WyvernRed()); ModCreatures.addCreature(new WyvernRed());
ModCreatures.addCreature(new WyvernWhite()); ModCreatures.addCreature(new WyvernWhite());
ModCreatures.addCreature(new WyvernBlue()); ModCreatures.addCreature(new WyvernBlue());
}
// Flavor Mobs: // Flavor Mobs:
if (WyvernMods.enableFlavorMobs) {
logger.info("Registering Flavor creatures."); logger.info("Registering Flavor creatures.");
ModCreatures.addCreature(new Avenger()); ModCreatures.addCreature(new Avenger());
ModCreatures.addCreature(new FireCrab()); ModCreatures.addCreature(new FireCrab());
@@ -1105,48 +1415,54 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
ModCreatures.addCreature(new HornedPony()); ModCreatures.addCreature(new HornedPony());
ModCreatures.addCreature(new LargeBoar()); ModCreatures.addCreature(new LargeBoar());
ModCreatures.addCreature(new SpiritTroll()); ModCreatures.addCreature(new SpiritTroll());
}
// Event Mobs: // Event Mobs:
if (WyvernMods.enableEventMobs) {
logger.info("Registering Event creatures."); logger.info("Registering Event creatures.");
ModCreatures.addCreature(new IceCat()); ModCreatures.addCreature(new IceCat());
ModCreatures.addCreature(new FireGiant()); ModCreatures.addCreature(new FireGiant());
ModCreatures.addCreature(new GuardianMagranon()); ModCreatures.addCreature(new GuardianMagranon());
ModCreatures.addCreature(new Terror());
}
// Bosses: // Rare Spawns:
logger.info("Registering Custom Boss creatures."); if (WyvernMods.enableRareSpawns) {
logger.info("Registering Rare Spawn creatures.");
ModCreatures.addCreature(new Reaper()); ModCreatures.addCreature(new Reaper());
ModCreatures.addCreature(new SpectralDrake()); ModCreatures.addCreature(new SpectralDrake());
// Uniques: }
// Legendaries:
if (WyvernMods.enableCustomLegendaries) {
logger.info("Registering Legendary creatures.");
ModCreatures.addCreature(new Facebreyker()); ModCreatures.addCreature(new Facebreyker());
}
// Titans: // Titans:
if (WyvernMods.enableTitans) {
logger.info("Registering Titans.");
ModCreatures.addCreature(new Ifrit()); ModCreatures.addCreature(new Ifrit());
ModCreatures.addCreature(new Lilith()); ModCreatures.addCreature(new Lilith());
// Titan Spawns: // Titan Spawns:
logger.info("Register Titan Spawns.");
ModCreatures.addCreature(new IfritFiend()); ModCreatures.addCreature(new IfritFiend());
ModCreatures.addCreature(new IfritSpider()); ModCreatures.addCreature(new IfritSpider());
ModCreatures.addCreature(new LilithWraith()); ModCreatures.addCreature(new LilithWraith());
ModCreatures.addCreature(new LilithZombie()); ModCreatures.addCreature(new LilithZombie());
}
// NPC's }
logger.info("Registering Custom NPC creatures.");
//ModCreatures.addCreature(new RobZombie());
//ModCreatures.addCreature(new MacroSlayer());
ModCreatures.addCreature(new Terror());
Bounty.init();
Mastercraft.changeExistingTitles();
} }
@Override @Override
public void onItemTemplatesCreated() { public void onItemTemplatesCreated() {
logger.info("Creating Item Mod items."); if (WyvernMods.enableItemModule) {
if (WyvernMods.createCustomItemTemplates) {
logger.info("Creating Item Mod item templates.");
ItemMod.createItems(); ItemMod.createItems();
logger.info("Creating Cache items."); logger.info("Creating Cache item templates.");
Caches.createItems(); Caches.createItems();
logger.info("Initiating Title changes."); }
//PlayerTitles.onItemTemplatesCreated();
try { try {
logger.info("Editing existing item templates."); logger.info("Editing existing item templates.");
ItemMod.modifyItems(); ItemMod.modifyItems();
@@ -1156,6 +1472,7 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
e.printStackTrace(); e.printStackTrace();
} }
} }
}
@Override @Override
public void onPlayerLogin(Player p) { public void onPlayerLogin(Player p) {
@@ -1170,52 +1487,78 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
@Override @Override
public void onServerStarted() { public void onServerStarted() {
try { try {
if (WyvernMods.enableBestiaryModule) {
logger.info("Setting custom creature template variables.");
Bestiary.setTemplateVariables();
}
if (WyvernMods.enableItemModule) {
ItemMod.onServerStarted();
if (WyvernMods.enableCustomItemCreation) {
logger.info("Registering Item Mod creation entries."); logger.info("Registering Item Mod creation entries.");
ItemMod.initCreationEntries(); ItemMod.initCreationEntries();
}
if (WyvernMods.createCustomItemTemplates) {
logger.info("Registering Item Mod actions."); logger.info("Registering Item Mod actions.");
ItemMod.registerActions(); ItemMod.registerActions();
logger.info("Registering Cache actions."); logger.info("Registering Cache actions.");
Caches.registerActions(); Caches.registerActions();
}
}
if (WyvernMods.enableSoulstealingModule) {
logger.info("Registering Soulstealer actions."); logger.info("Registering Soulstealer actions.");
Soulstealing.registerActions(); Soulstealing.registerActions();
}
if (WyvernMods.enableActionModule) {
logger.info("Registering Custom actions."); logger.info("Registering Custom actions.");
if (WyvernMods.actionUnequipAll) {
ModActions.registerAction(new UnequipAllAction()); ModActions.registerAction(new UnequipAllAction());
}
if (WyvernMods.actionReceiveAllMail) {
ModActions.registerAction(new ReceiveMailAction()); ModActions.registerAction(new ReceiveMailAction());
ModActions.registerAction(new LeaderboardAction()); }
ModActions.registerAction(new AddSubGroupAction()); if (WyvernMods.actionSplitSorcery) {
ModActions.registerAction(new SorcerySplitAction()); ModActions.registerAction(new SorcerySplitAction());
}
if (WyvernMods.actionLeaderboard) {
ModActions.registerAction(new LeaderboardAction());
ModActions.registerAction(new LeaderboardSkillAction()); ModActions.registerAction(new LeaderboardSkillAction());
}
//ModActions.registerAction(new AddSubGroupAction()); // [5/14/19] Disabled - Added to base game.
logger.info("Registering Arena actions."); logger.info("Registering Arena actions.");
if (WyvernMods.actionSorceryFragmentCombine) {
ModActions.registerAction(new SorceryCombineAction()); ModActions.registerAction(new SorceryCombineAction());
//ModActions.registerAction(new VillageTeleportAction()); // [3/28/18] Disabled - Highway Portals added instead. }
if (WyvernMods.actionArenaTeleports) {
ModActions.registerAction(new ArenaTeleportAction()); ModActions.registerAction(new ArenaTeleportAction());
ModActions.registerAction(new ArenaEscapeAction()); ModActions.registerAction(new ArenaEscapeAction());
}
logger.info("Registering Dev actions."); logger.info("Registering Dev actions.");
if (WyvernMods.actionAddMissionDev) {
ModActions.registerAction(new MissionAddAction()); ModActions.registerAction(new MissionAddAction());
}
if (WyvernMods.actionRemoveMissionDev) {
ModActions.registerAction(new MissionRemoveAction()); ModActions.registerAction(new MissionRemoveAction());
}
if (WyvernMods.actionCreatureReportDev) {
ModActions.registerAction(new CreatureReportAction()); ModActions.registerAction(new CreatureReportAction());
}
if (WyvernMods.actionSmoothTerrainDev) {
ModActions.registerAction(new SmoothTerrainAction()); ModActions.registerAction(new SmoothTerrainAction());
logger.info("Setting custom creature corpse models."); }
MethodsBestiary.setTemplateVariables();
logger.info("Setting up Achievement templates.");
AchievementChanges.onServerStarted();
DeityChanges.onServerStarted();
//espCounter = Servers.localServer.PVPSERVER; // Enables on PvP server by default.
//espCounter = false;
if (enableSkillModule) {
SkillChanges.onServerStarted();
} }
CreationEntry lockpicks = CreationMatrix.getInstance().getCreationEntry(ItemList.lockpick); // Sets up achievement changes specifically for the Leaderboard system.
try { if (WyvernMods.enableActionModule && WyvernMods.actionLeaderboard) {
ReflectionUtil.setPrivateField(lockpicks, ReflectionUtil.getField(lockpicks.getClass(), "hasMinimumSkillRequirement"), false); logger.info("Setting up Leaderboard Achievement templates.");
ReflectionUtil.setPrivateField(lockpicks, ReflectionUtil.getField(lockpicks.getClass(), "minimumSkill"), 0.0); AchievementChanges.onServerStarted();
} catch (IllegalAccessException | NoSuchFieldException e) { }
logger.info("Failed to set lockpick creation entry changes!");
e.printStackTrace(); if (WyvernMods.enableMiscChangesModule && WyvernMods.changeDeityPassives) {
DeityChanges.onServerStarted();
}
if (WyvernMods.enableSkillModule) {
SkillChanges.onServerStarted();
} }
} catch (IllegalArgumentException | ClassCastException e) { } catch (IllegalArgumentException | ClassCastException e) {
@@ -1230,7 +1573,6 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
public static long lastPolledDepots = 0; public static long lastPolledDepots = 0;
public static long lastPolledRareSpawns = 0; public static long lastPolledRareSpawns = 0;
public static long lastPolledEternalReservoirs = 0; public static long lastPolledEternalReservoirs = 0;
public static final long pollEternalReservoirTime = TimeConstants.MINUTE_MILLIS*10;
public static long lastPolledMissionCreator = 0; public static long lastPolledMissionCreator = 0;
/* Disabled for now, might need to be revisited. /* Disabled for now, might need to be revisited.
public static long lastPolledBloodlust = 0; public static long lastPolledBloodlust = 0;
@@ -1240,31 +1582,30 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
public static long lastPolledUniqueCollection = 0; public static long lastPolledUniqueCollection = 0;
public static final long pollUniqueCollectionTime = TimeConstants.MINUTE_MILLIS*5; public static final long pollUniqueCollectionTime = TimeConstants.MINUTE_MILLIS*5;
public static long lastPolledTerrainSmooth = 0; public static long lastPolledTerrainSmooth = 0;
public static final long pollTerrainSmoothTime = TimeConstants.SECOND_MILLIS*5;
@Override @Override
public void onServerPoll() { public void onServerPoll() {
if((lastSecondPolled + TimeConstants.SECOND_MILLIS) < System.currentTimeMillis()){ if((lastSecondPolled + TimeConstants.SECOND_MILLIS) < System.currentTimeMillis()){
if(enableSupplyDepotModule && lastPolledDepots + pollDepotTime < System.currentTimeMillis()){ if(WyvernMods.enableSupplyDepotModule && lastPolledDepots + pollDepotTime < System.currentTimeMillis()){
SupplyDepots.pollDepotSpawn(); SupplyDepots.pollDepotSpawn();
lastPolledDepots += pollDepotTime; lastPolledDepots += pollDepotTime;
} }
if(enableTitanModule && lastPolledTitanSpawn + pollTitanSpawnTime < System.currentTimeMillis()){ if(WyvernMods.enableTitanModule && lastPolledTitanSpawn + pollTitanSpawnTime < System.currentTimeMillis()){
Titans.pollTitanSpawn(); Titans.pollTitanSpawn();
lastPolledTitanSpawn += pollTitanSpawnTime; lastPolledTitanSpawn += pollTitanSpawnTime;
} }
if(enableTitanModule && lastPolledTitans + pollTitanTime < System.currentTimeMillis()){ if(WyvernMods.enableTitanModule && lastPolledTitans + pollTitanTime < System.currentTimeMillis()){
Titans.pollTitans(); Titans.pollTitans();
lastPolledTitans += pollTitanTime; lastPolledTitans += pollTitanTime;
} }
if(enableRareSpawnModule && lastPolledRareSpawns + pollRareSpawnTime < System.currentTimeMillis()){ if(WyvernMods.enableRareSpawnModule && lastPolledRareSpawns + pollRareSpawnTime < System.currentTimeMillis()){
RareSpawns.pollRareSpawns(); RareSpawns.pollRareSpawns();
lastPolledRareSpawns += pollRareSpawnTime; lastPolledRareSpawns += pollRareSpawnTime;
} }
if(lastPolledEternalReservoirs + pollEternalReservoirTime < System.currentTimeMillis()){ if(WyvernMods.enableSoulstealingModule && lastPolledEternalReservoirs + pollEternalReservoirTime < System.currentTimeMillis()){
Soulstealing.pollSoulForges(); Soulstealing.pollSoulForges();
lastPolledEternalReservoirs += pollEternalReservoirTime; lastPolledEternalReservoirs += pollEternalReservoirTime;
} }
if(enableMissionModule && enableNewMissionCreator && lastPolledMissionCreator + pollMissionCreatorTime < System.currentTimeMillis()){ if(WyvernMods.enableMissionModule && enableNewMissionCreator && lastPolledMissionCreator + pollMissionCreatorTime < System.currentTimeMillis()){
MissionCreator.pollMissions(); MissionCreator.pollMissions();
lastPolledMissionCreator += pollMissionCreatorTime; lastPolledMissionCreator += pollMissionCreatorTime;
} }
@@ -1273,7 +1614,7 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
Bloodlust.pollLusts(); Bloodlust.pollLusts();
lastPolledBloodlust += pollBloodlustTime; lastPolledBloodlust += pollBloodlustTime;
}*/ }*/
if(WyvernMods.useStaticLegendaryRegeneration && lastPolledUniqueRegeneration + pollUniqueRegenerationTime < System.currentTimeMillis()){ if(WyvernMods.enableCombatModule && WyvernMods.useStaticLegendaryRegeneration && lastPolledUniqueRegeneration + pollUniqueRegenerationTime < System.currentTimeMillis()){
CombatChanges.pollUniqueRegeneration(); CombatChanges.pollUniqueRegeneration();
lastPolledUniqueRegeneration += pollUniqueRegenerationTime; lastPolledUniqueRegeneration += pollUniqueRegenerationTime;
} }
@@ -1281,7 +1622,7 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
CombatChanges.pollUniqueCollection(); CombatChanges.pollUniqueCollection();
lastPolledUniqueCollection += pollUniqueCollectionTime; lastPolledUniqueCollection += pollUniqueCollectionTime;
} }
if(lastPolledTerrainSmooth + pollTerrainSmoothTime < System.currentTimeMillis()){ if(WyvernMods.enableErosionModule && lastPolledTerrainSmooth + pollTerrainSmoothTime < System.currentTimeMillis()){
SmoothTerrainAction.onServerPoll(); SmoothTerrainAction.onServerPoll();
lastPolledTerrainSmooth += pollTerrainSmoothTime; lastPolledTerrainSmooth += pollTerrainSmoothTime;
} }