Changed trader restocking to use a new object, added 20% boat speed to vynora, started on wood essence
This commit is contained in:
2
.idea/artifacts/wyvern_jar.xml
generated
2
.idea/artifacts/wyvern_jar.xml
generated
@@ -1,7 +1,7 @@
|
|||||||
<component name="ArtifactManager">
|
<component name="ArtifactManager">
|
||||||
<artifact type="jar" name="wyvern:jar">
|
<artifact type="jar" name="wyvern:jar">
|
||||||
<output-path>$PROJECT_DIR$/classes/artifacts/wyvern_jar</output-path>
|
<output-path>$PROJECT_DIR$/classes/artifacts/wyvern_jar</output-path>
|
||||||
<root id="archive" name="WyvernMods_main.jar">
|
<root id="archive" name="wyvern.jar">
|
||||||
<element id="module-output" name="WyvernMods_main" />
|
<element id="module-output" name="WyvernMods_main" />
|
||||||
</root>
|
</root>
|
||||||
</artifact>
|
</artifact>
|
||||||
|
|||||||
44
src/main/java/mod/sin/actions/RecipeFillAction.java
Normal file
44
src/main/java/mod/sin/actions/RecipeFillAction.java
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
package mod.sin.actions;
|
||||||
|
|
||||||
|
import com.wurmonline.server.behaviours.ActionEntry;
|
||||||
|
import com.wurmonline.server.creatures.Creature;
|
||||||
|
import com.wurmonline.server.items.Recipe;
|
||||||
|
import com.wurmonline.server.items.Recipes;
|
||||||
|
import com.wurmonline.server.items.RecipesByPlayer;
|
||||||
|
import org.gotti.wurmunlimited.modsupport.actions.*;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class RecipeFillAction implements ModAction, BehaviourProvider, ActionPerformer {
|
||||||
|
private static Logger logger = Logger.getLogger(RecipeFillAction.class.getName());
|
||||||
|
|
||||||
|
private final short actionId;
|
||||||
|
private final ActionEntry actionEntry;
|
||||||
|
|
||||||
|
public RecipeFillAction() {
|
||||||
|
logger.log(Level.INFO, "RecipeFillAction()");
|
||||||
|
|
||||||
|
actionId = (short) ModActions.getNextActionId();
|
||||||
|
actionEntry = new ActionEntryBuilder(actionId, "Fill", "filling").build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public short getActionId() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Recipe> getValidRecipes(Creature performer) {
|
||||||
|
List<Recipe> knownRecipes = Arrays.asList(RecipesByPlayer.getKnownRecipesFor(performer.getWurmId()));
|
||||||
|
Set<Recipe> hasIngredientsFor = new HashSet<>();
|
||||||
|
for(Recipe r:knownRecipes) {
|
||||||
|
|
||||||
|
}
|
||||||
|
return new HashSet<Recipe>();
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ import java.util.logging.Level;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class PipingKitAction implements ModAction {
|
public class PipingKitAction implements ModAction {
|
||||||
private static Logger logger = Logger.getLogger(EnchantOrbAction.class.getName());
|
private static Logger logger = Logger.getLogger(PipingKit.class.getName());
|
||||||
|
|
||||||
private final short actionId;
|
private final short actionId;
|
||||||
private final ActionEntry actionEntry;
|
private final ActionEntry actionEntry;
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class Charger implements ModCreature, CreatureTypes {
|
|||||||
vehicle.setSeatFightMod(0, 0.8f, 1.1f);
|
vehicle.setSeatFightMod(0, 0.8f, 1.1f);
|
||||||
vehicle.setSeatOffset(0, 0.0f, 0.0f, 0.0f);
|
vehicle.setSeatOffset(0, 0.0f, 0.0f, 0.0f);
|
||||||
vehicle.setCreature(true);
|
vehicle.setCreature(true);
|
||||||
vehicle.setSkillNeeded(Servers.localServer.PVPSERVER ? 25.0f : 41.0f);
|
vehicle.setSkillNeeded(Servers.localServer.PVPSERVER ? 25.0f : 37.0f);
|
||||||
vehicle.setName(creature.getName());
|
vehicle.setName(creature.getName());
|
||||||
vehicle.setMaxHeightDiff(0.06f);
|
vehicle.setMaxHeightDiff(0.06f);
|
||||||
vehicle.setMaxDepth(-1.7f);
|
vehicle.setMaxDepth(-1.7f);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ public class WyvernRed implements ModCreature, CreatureTypes {
|
|||||||
vehicle.setName(creature.getName());
|
vehicle.setName(creature.getName());
|
||||||
vehicle.setMaxHeightDiff(0.10f);
|
vehicle.setMaxHeightDiff(0.10f);
|
||||||
vehicle.setMaxDepth(-50f);
|
vehicle.setMaxDepth(-50f);
|
||||||
vehicle.setMaxSpeed(35.0f);
|
vehicle.setMaxSpeed(40.0f);
|
||||||
vehicle.setCommandType((byte) 3);
|
vehicle.setCommandType((byte) 3);
|
||||||
vehicle.setCanHaveEquipment(true);
|
vehicle.setCanHaveEquipment(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public class ChaosCrystal implements ItemTypes, MiscConstants {
|
|||||||
itemBuilder.difficulty(5.0f);
|
itemBuilder.difficulty(5.0f);
|
||||||
itemBuilder.weightGrams(250);
|
itemBuilder.weightGrams(250);
|
||||||
itemBuilder.material(Materials.MATERIAL_CRYSTAL);
|
itemBuilder.material(Materials.MATERIAL_CRYSTAL);
|
||||||
itemBuilder.value(500000);
|
itemBuilder.value(10000);
|
||||||
itemBuilder.isTraded(false);
|
itemBuilder.isTraded(true);
|
||||||
|
|
||||||
ItemTemplate template = itemBuilder.build();
|
ItemTemplate template = itemBuilder.build();
|
||||||
templateId = template.getTemplateId();
|
templateId = template.getTemplateId();
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ public class EnchantersCrystal implements ItemTypes, MiscConstants {
|
|||||||
itemBuilder.difficulty(5.0f);
|
itemBuilder.difficulty(5.0f);
|
||||||
itemBuilder.weightGrams(250);
|
itemBuilder.weightGrams(250);
|
||||||
itemBuilder.material(Materials.MATERIAL_CRYSTAL);
|
itemBuilder.material(Materials.MATERIAL_CRYSTAL);
|
||||||
itemBuilder.value(500000);
|
itemBuilder.value(100000);
|
||||||
itemBuilder.isTraded(false);
|
itemBuilder.isTraded(true);
|
||||||
|
|
||||||
ItemTemplate template = itemBuilder.build();
|
ItemTemplate template = itemBuilder.build();
|
||||||
templateId = template.getTemplateId();
|
templateId = template.getTemplateId();
|
||||||
|
|||||||
22
src/main/java/mod/sin/items/MoreAnchors.java
Normal file
22
src/main/java/mod/sin/items/MoreAnchors.java
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
package mod.sin.items;
|
||||||
|
|
||||||
|
import com.wurmonline.server.MiscConstants;
|
||||||
|
import com.wurmonline.server.items.*;
|
||||||
|
import com.wurmonline.server.skills.SkillList;
|
||||||
|
import org.gotti.wurmunlimited.modsupport.ItemTemplateBuilder;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class MoreAnchors implements ItemTypes, MiscConstants {
|
||||||
|
public static Logger logger = Logger.getLogger(MoreAnchors.class.getName());
|
||||||
|
|
||||||
|
public void initCreationEntry(){
|
||||||
|
logger.info("Adding more anchor types...");
|
||||||
|
for(int metal:ItemFactory.metalLumpList) {
|
||||||
|
if(metal != ItemList.leadBar) {
|
||||||
|
CreationEntryCreator.createSimpleEntry(SkillList.SMITHING_BLACKSMITHING, ItemList.anvilLarge, metal, ItemList.anchor, false, true, 0.0f, false, true, CreationCategories.SHIPBUILDING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -36,7 +36,7 @@ public class SealedMap implements ItemTypes, MiscConstants {
|
|||||||
itemBuilder.weightGrams(500);
|
itemBuilder.weightGrams(500);
|
||||||
itemBuilder.material(Materials.MATERIAL_MAGIC);
|
itemBuilder.material(Materials.MATERIAL_MAGIC);
|
||||||
itemBuilder.value(2000000);
|
itemBuilder.value(2000000);
|
||||||
itemBuilder.isTraded(false);
|
itemBuilder.isTraded(true);
|
||||||
|
|
||||||
ItemTemplate template = itemBuilder.build();
|
ItemTemplate template = itemBuilder.build();
|
||||||
templateId = template.getTemplateId();
|
templateId = template.getTemplateId();
|
||||||
|
|||||||
54
src/main/java/mod/sin/items/WoodEssence.java
Normal file
54
src/main/java/mod/sin/items/WoodEssence.java
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
package mod.sin.items;
|
||||||
|
|
||||||
|
import com.wurmonline.server.MiscConstants;
|
||||||
|
import com.wurmonline.server.items.*;
|
||||||
|
import com.wurmonline.server.skills.SkillList;
|
||||||
|
import org.gotti.wurmunlimited.modsupport.ItemTemplateBuilder;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
public class WoodEssence implements ItemTypes, MiscConstants {
|
||||||
|
public static Logger logger = Logger.getLogger(WoodEssence.class.getName());
|
||||||
|
public static int templateId;
|
||||||
|
|
||||||
|
public void createTemplate() throws IOException {
|
||||||
|
String name = "wood essence";
|
||||||
|
ItemTemplateBuilder itemBuilder = new ItemTemplateBuilder("mod.item.wood.essence");
|
||||||
|
itemBuilder.name(name, "wood essences", "A tool kit for directing pipes into a source of water.");
|
||||||
|
itemBuilder.descriptions("excellent", "good", "ok", "poor");
|
||||||
|
itemBuilder.itemTypes(new short[]{ // {108, 146, 44, 21, 147, 113} - War Arrow
|
||||||
|
ItemTypes.ITEM_TYPE_FULLPRICE,
|
||||||
|
ItemTypes.ITEM_TYPE_NOSELLBACK,
|
||||||
|
ItemTypes.ITEM_TYPE_ALWAYS_BANKABLE,
|
||||||
|
ItemTypes.ITEM_TYPE_WOOD
|
||||||
|
});
|
||||||
|
itemBuilder.imageNumber((short) 859);
|
||||||
|
itemBuilder.behaviourType((short) 1);
|
||||||
|
itemBuilder.combatDamage(0);
|
||||||
|
itemBuilder.decayTime(Long.MAX_VALUE);
|
||||||
|
itemBuilder.dimensions(15, 15, 50);
|
||||||
|
itemBuilder.primarySkill((int) NOID);
|
||||||
|
itemBuilder.bodySpaces(MiscConstants.EMPTY_BYTE_PRIMITIVE_ARRAY);
|
||||||
|
itemBuilder.modelName("model.valrei.");
|
||||||
|
itemBuilder.difficulty(300.0f);
|
||||||
|
itemBuilder.weightGrams(4500);
|
||||||
|
itemBuilder.material(Materials.MATERIAL_WOOD_BIRCH);
|
||||||
|
itemBuilder.value(1);
|
||||||
|
itemBuilder.isTraded(true);
|
||||||
|
|
||||||
|
ItemTemplate template = itemBuilder.build();
|
||||||
|
templateId = template.getTemplateId();
|
||||||
|
logger.info(name+" TemplateID: "+templateId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void initCreationEntry() {
|
||||||
|
logger.info("initCreationEntry()");
|
||||||
|
if(templateId > 0) {
|
||||||
|
CreationEntryCreator.createSimpleEntry(SkillList.FORESTRY, ItemList.sourceSalt, ItemList.log, templateId, true, true, 0.0f, true, false, CreationCategories.RESOURCES);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
logger.info("woodEssence does not have a template ID on creation entry.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,8 @@ public class MaartensMight implements ItemTypes, MiscConstants {
|
|||||||
ItemTypes.ITEM_TYPE_METAL,
|
ItemTypes.ITEM_TYPE_METAL,
|
||||||
ItemTypes.ITEM_TYPE_REPAIRABLE,
|
ItemTypes.ITEM_TYPE_REPAIRABLE,
|
||||||
ItemTypes.ITEM_TYPE_WEAPON,
|
ItemTypes.ITEM_TYPE_WEAPON,
|
||||||
ItemTypes.ITEM_TYPE_WEAPON_CRUSH
|
ItemTypes.ITEM_TYPE_WEAPON_CRUSH,
|
||||||
|
ItemTypes.ITEM_TYPE_NO_IMPROVE
|
||||||
});
|
});
|
||||||
itemBuilder.imageNumber((short) 1339);
|
itemBuilder.imageNumber((short) 1339);
|
||||||
itemBuilder.behaviourType((short) 35);
|
itemBuilder.behaviourType((short) 35);
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ public class ItemMod {
|
|||||||
//Ocnoc
|
//Ocnoc
|
||||||
public static PipingKit PIPING_KIT = new PipingKit();
|
public static PipingKit PIPING_KIT = new PipingKit();
|
||||||
public static StableContract STABLE_CONTRACT = new StableContract();
|
public static StableContract STABLE_CONTRACT = new StableContract();
|
||||||
|
public static MoreAnchors MORE_ANCHORS = new MoreAnchors();
|
||||||
|
|
||||||
public static void createItems(){
|
public static void createItems(){
|
||||||
logger.info("createItems()");
|
logger.info("createItems()");
|
||||||
@@ -213,6 +214,7 @@ public class ItemMod {
|
|||||||
WARHAMMER.initCreationEntry();
|
WARHAMMER.initCreationEntry();
|
||||||
WARHAMMER_HEAD.initCreationEntry();
|
WARHAMMER_HEAD.initCreationEntry();
|
||||||
//HUGE_CRATE.initCreationEntry();
|
//HUGE_CRATE.initCreationEntry();
|
||||||
|
MORE_ANCHORS.initCreationEntry();
|
||||||
|
|
||||||
// Spectral set
|
// Spectral set
|
||||||
/*SPECTRAL_BOOT.initCreationEntry();
|
/*SPECTRAL_BOOT.initCreationEntry();
|
||||||
@@ -280,7 +282,7 @@ public class ItemMod {
|
|||||||
logger.info("Beginning custom weapon creation.");
|
logger.info("Beginning custom weapon creation.");
|
||||||
new Weapon(BattleYoyo.templateId, 6.85f, 3.85f, 0.008f, 2, 2, 0.0f, 0d);
|
new Weapon(BattleYoyo.templateId, 6.85f, 3.85f, 0.008f, 2, 2, 0.0f, 0d);
|
||||||
new Weapon(Club.templateId, 8.1f, 4.5f, 0.002f, 3, 3, 0.4f, 0.5d);
|
new Weapon(Club.templateId, 8.1f, 4.5f, 0.002f, 3, 3, 0.4f, 0.5d);
|
||||||
new Weapon(Knuckles.templateId, 3.6f, 2.2f, 0.002f, 1, 1, 0.2f, 0.5d);
|
new Weapon(Knuckles.templateId, 3.6f, 2.1f, 0.002f, 1, 1, 0.2f, 0.5d);
|
||||||
new Weapon(Warhammer.templateId, 9.40f, 5.6f, 0.008f, 4, 3, 1f, 0d);
|
new Weapon(Warhammer.templateId, 9.40f, 5.6f, 0.008f, 4, 3, 1f, 0d);
|
||||||
// Titan weaponry
|
// Titan weaponry
|
||||||
new Weapon(MaartensMight.templateId, 11, 5, 0.02f, 4, 4, 1.0f, 0d);
|
new Weapon(MaartensMight.templateId, 11, 5, 0.02f, 4, 4, 1.0f, 0d);
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ package mod.sin.wyvern;
|
|||||||
import com.wurmonline.server.*;
|
import com.wurmonline.server.*;
|
||||||
import com.wurmonline.server.bodys.Wound;
|
import com.wurmonline.server.bodys.Wound;
|
||||||
import com.wurmonline.server.creatures.Creature;
|
import com.wurmonline.server.creatures.Creature;
|
||||||
import com.wurmonline.server.items.Item;
|
import com.wurmonline.server.creatures.CreatureTemplateIds;
|
||||||
import com.wurmonline.server.items.ItemTemplate;
|
import com.wurmonline.server.creatures.Creatures;
|
||||||
import com.wurmonline.server.items.SimpleCreationEntry;
|
import com.wurmonline.server.deities.Deities;
|
||||||
|
import com.wurmonline.server.economy.Economy;
|
||||||
|
import com.wurmonline.server.items.*;
|
||||||
import com.wurmonline.server.players.Player;
|
import com.wurmonline.server.players.Player;
|
||||||
import com.wurmonline.server.players.PlayerInfo;
|
import com.wurmonline.server.players.PlayerInfo;
|
||||||
import com.wurmonline.server.players.PlayerInfoFactory;
|
import com.wurmonline.server.players.PlayerInfoFactory;
|
||||||
@@ -21,18 +23,21 @@ import javassist.bytecode.Descriptor;
|
|||||||
import javassist.expr.ExprEditor;
|
import javassist.expr.ExprEditor;
|
||||||
import javassist.expr.FieldAccess;
|
import javassist.expr.FieldAccess;
|
||||||
import javassist.expr.MethodCall;
|
import javassist.expr.MethodCall;
|
||||||
|
import mod.sin.items.ChaosCrystal;
|
||||||
|
import mod.sin.items.EnchantersCrystal;
|
||||||
|
import mod.sin.items.SealedMap;
|
||||||
|
import mod.sin.kingdomoffices.ItemCreator;
|
||||||
import mod.sin.lib.Util;
|
import mod.sin.lib.Util;
|
||||||
|
import mod.sin.wyvern.util.TraderItem;
|
||||||
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;
|
||||||
import org.nyxcode.wurm.discordrelay.DiscordRelay;
|
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.PreparedStatement;
|
import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Objects;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
public class MiscChanges {
|
public class MiscChanges {
|
||||||
@@ -153,6 +158,18 @@ public class MiscChanges {
|
|||||||
return food.getFoodComplexity()*mult;
|
return food.getFoodComplexity()*mult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static float boatSpeedBonus(Creature captain) {
|
||||||
|
if(captain.getDeity().getNumber() != Deities.DEITY_VYNORA) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(captain.getFaith() >= 60.0) {
|
||||||
|
return (float)1.2;
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static long getBedBonus(long secs, long bed){
|
public static long getBedBonus(long secs, long bed){
|
||||||
Optional<Item> beds = Items.getItemOptional(bed);
|
Optional<Item> beds = Items.getItemOptional(bed);
|
||||||
if(beds.isPresent()) {
|
if(beds.isPresent()) {
|
||||||
@@ -182,6 +199,51 @@ public class MiscChanges {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void restockTrader(Creature trader) {
|
||||||
|
try {
|
||||||
|
if(trader.getTemplate().getTemplateId() != CreatureTemplateIds.SALESMAN_CID || Economy.getEconomy().getShop(trader).isPersonal()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
int count = 0;
|
||||||
|
Item item;
|
||||||
|
// Hashset of trader items
|
||||||
|
Set<TraderItem> toRestock = new HashSet<>();
|
||||||
|
|
||||||
|
// Sleep powder added
|
||||||
|
toRestock.add(new TraderItem(ItemList.sleepPowder, 99, false, 99, 99, 20));
|
||||||
|
logger.info("Adding sleep powder to trader restock list");
|
||||||
|
// Kingdom tokens added
|
||||||
|
toRestock.add(new TraderItem(ItemCreator.KINGDOM_TOKEN.getTemplateId(), 99, false, 99, 99, 20));
|
||||||
|
logger.info("Adding kingdom tokens to trader restock list");
|
||||||
|
// Sealed maps added, use ranom qualities between 10 and 100 (inclusive)
|
||||||
|
toRestock.add(new TraderItem(SealedMap.templateId, 99, true, 10, 101, 3));
|
||||||
|
logger.info("Adding sealed maps to trader restock list");
|
||||||
|
toRestock.add(new TraderItem(EnchantersCrystal.templateId, 99, true, 10, 101, 10));
|
||||||
|
logger.info("Adding enchant crystals to trader restock list");
|
||||||
|
toRestock.add(new TraderItem(ChaosCrystal.templateId, 99, true, 10, 101, 10));
|
||||||
|
logger.info("Adding chaos crystals to trader restock list");
|
||||||
|
|
||||||
|
|
||||||
|
for (TraderItem tItem : toRestock) {
|
||||||
|
logger.info("Counting number of " + ItemTemplateFactory.getInstance().getTemplate(tItem.getTemplateid()).getName() + " instances in trader inventory.");
|
||||||
|
count = 0;
|
||||||
|
for (Item i : trader.getInventory().getItemsAsArray()) {
|
||||||
|
if (i.getTemplateId() == tItem.getTemplateid()) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
logger.info("Trader had " + count + " " + ItemTemplateFactory.getInstance().getTemplate(tItem.getTemplateid()).getName() + ".");
|
||||||
|
while (count < tItem.getQuantity()) {
|
||||||
|
item = Creature.createItem(tItem.getTemplateid(), tItem.getQuality());
|
||||||
|
trader.getInventory().insertItem(item);
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static int getNewFoodFill(float qlevel){
|
public static int getNewFoodFill(float qlevel){
|
||||||
float startPercent = 0.004f;
|
float startPercent = 0.004f;
|
||||||
float endPercent = 0.015f;
|
float endPercent = 0.015f;
|
||||||
@@ -715,6 +777,31 @@ public class MiscChanges {
|
|||||||
"}";
|
"}";
|
||||||
Util.instrumentDeclared(thisClass, ctPlayer, "poll", "nextInt", replace);
|
Util.instrumentDeclared(thisClass, ctPlayer, "poll", "nextInt", replace);
|
||||||
|
|
||||||
|
CtClass ctShop = classPool.get("com.wurmonline.server.items.Trade");
|
||||||
|
Util.setReason("Restock certain items after every trade with a trader");
|
||||||
|
replace = "$_ = $proceed($$);" + MiscChanges.class.getName() + ".restockTrader($1);";
|
||||||
|
Util.instrumentDeclared(thisClass, ctShop, "makeTrade", "getShop", replace);
|
||||||
|
|
||||||
|
CtClass ctVehicles = classPool.get("com.wurmonline.server.behaviours.VehicleBehaviour");
|
||||||
|
Util.setReason("Allow preists of vynora to gain 20% boat speed above 60 faith.");
|
||||||
|
replace = "$_ = $proceed($1, $2 * " + MiscChanges.class.getName() + ".boatSpeedBonus(Players.getInstance().getPlayer(this.pilotId)));";
|
||||||
|
ctVehicles.getDeclaredMethod("calculateNewBoatSpeed").instrument(new ExprEditor() {
|
||||||
|
private boolean first = true;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void edit(MethodCall m) throws CannotCompileException {
|
||||||
|
if(m.getMethodName().equals("min")) {
|
||||||
|
if(first) {
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
m.replace("$_ = $proceed($1, $2 * " + MiscChanges.class.getName() + ".boatSpeedBonus(Players.getInstance().getPlayer(this.pilotId)));");
|
||||||
|
logger.info("Allowing preists of vynora to gain 20% boat speed above 60 faith.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
CtClass ctSimpleCreationEntry = classPool.get("com.wurmonline.server.items.SimpleCreationEntry");
|
CtClass ctSimpleCreationEntry = classPool.get("com.wurmonline.server.items.SimpleCreationEntry");
|
||||||
ctSimpleCreationEntry.getDeclaredMethod("run").instrument(new ExprEditor() {
|
ctSimpleCreationEntry.getDeclaredMethod("run").instrument(new ExprEditor() {
|
||||||
private boolean first = true;
|
private boolean first = true;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package mod.sin.wyvern.bestiary;
|
package mod.sin.wyvern.bestiary;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.Random;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import com.wurmonline.mesh.Tiles;
|
import com.wurmonline.mesh.Tiles;
|
||||||
@@ -249,6 +250,9 @@ public class MethodsBestiary {
|
|||||||
}else if(creature.getTemplate().getTemplateId() == Charger.templateId){
|
}else if(creature.getTemplate().getTemplateId() == Charger.templateId){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else if(creature.getTemplate().getTemplateId() == CreatureTemplateFactory.UNICORN_CID) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return creature.isHorse();
|
return creature.isHorse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -649,6 +653,10 @@ public class MethodsBestiary {
|
|||||||
protected static void sendAddEffect(Communicator comm, long creatureId, byte effectNum){
|
protected static void sendAddEffect(Communicator comm, long creatureId, byte effectNum){
|
||||||
comm.sendAttachEffect(creatureId, effectNum, (byte) 1, (byte) -1, (byte) -1, (byte) 1);
|
comm.sendAttachEffect(creatureId, effectNum, (byte) 1, (byte) -1, (byte) -1, (byte) 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected static void sendRepaintEffect(Communicator comm, long wurmId, byte r, byte g, byte b, byte a) {
|
||||||
|
comm.sendRepaint(wurmId, r, g, b, a, (byte)0);
|
||||||
|
}
|
||||||
// - Good Effects -
|
// - Good Effects -
|
||||||
// rift01 [large], rift02 [small]
|
// rift01 [large], rift02 [small]
|
||||||
// treasureP [light bubbles]
|
// treasureP [light bubbles]
|
||||||
@@ -677,6 +685,13 @@ public class MethodsBestiary {
|
|||||||
}else if(templateId == FireGiant.templateId){
|
}else if(templateId == FireGiant.templateId){
|
||||||
sendAddEffect(comm, creatureId, (byte) 1);
|
sendAddEffect(comm, creatureId, (byte) 1);
|
||||||
}
|
}
|
||||||
|
else if(templateId == CreatureTemplateFactory.UNICORN_CID) {
|
||||||
|
Random random = new Random();
|
||||||
|
byte r = (byte)random.nextInt(257);
|
||||||
|
byte g = (byte)random.nextInt(257);
|
||||||
|
byte b = (byte)random.nextInt(257);
|
||||||
|
sendRepaintEffect(comm, creatureId, r, g, b, (byte)255);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void preInit(){
|
public static void preInit(){
|
||||||
|
|||||||
@@ -128,6 +128,11 @@ public class LootBounty {
|
|||||||
corpse.insertItem(cache);
|
corpse.insertItem(cache);
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
Item item = ItemFactory.createItem(ItemUtil.getMysteryEggID(), 50, (byte)1, "");
|
||||||
|
if(random.nextInt(100) < 25) {
|
||||||
|
item.setRarity((byte)3);
|
||||||
|
}
|
||||||
|
corpse.insertItem(item);
|
||||||
if(mob.isDragon()) {
|
if(mob.isDragon()) {
|
||||||
int mTemplate = mob.getTemplate().getTemplateId();
|
int mTemplate = mob.getTemplate().getTemplateId();
|
||||||
int lootTemplate = ItemList.drakeHide;
|
int lootTemplate = ItemList.drakeHide;
|
||||||
@@ -279,7 +284,7 @@ public class LootBounty {
|
|||||||
int[] caches = {
|
int[] caches = {
|
||||||
TreasureMapCache.templateId,
|
TreasureMapCache.templateId,
|
||||||
GemCache.templateId,
|
GemCache.templateId,
|
||||||
RiftCache.templateId
|
CrystalCache.templateId
|
||||||
};
|
};
|
||||||
int cacheSelected = random.nextInt(3);
|
int cacheSelected = random.nextInt(3);
|
||||||
Item item = ItemFactory.createItem(caches[cacheSelected], 20 + random.nextInt(40), "");
|
Item item = ItemFactory.createItem(caches[cacheSelected], 20 + random.nextInt(40), "");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public class Mastercraft {
|
|||||||
diff -= skill.affinity;
|
diff -= skill.affinity;
|
||||||
}
|
}
|
||||||
if(skill.getKnowledge() > 99.0d){
|
if(skill.getKnowledge() > 99.0d){
|
||||||
diff -= 4d-((100d-skill.getKnowledge())*4d);
|
diff -= 8d-((100d-skill.getKnowledge())*8d);
|
||||||
}
|
}
|
||||||
if(skill.getKnowledge() > 90.0d){
|
if(skill.getKnowledge() > 90.0d){
|
||||||
diff -= 2d-((100d-skill.getKnowledge())*0.2d);
|
diff -= 2d-((100d-skill.getKnowledge())*0.2d);
|
||||||
@@ -175,6 +175,10 @@ public class Mastercraft {
|
|||||||
ExtendTitleEnum.getSingletonInstance().addExtendEntry("HeadSmithing_Minor", 1129, "Renowned Headsmither", "Renowned Headsmither", SkillList.SMITHING_WEAPON_HEADS, "MINOR");
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("HeadSmithing_Minor", 1129, "Renowned Headsmither", "Renowned Headsmither", SkillList.SMITHING_WEAPON_HEADS, "MINOR");
|
||||||
ExtendTitleEnum.getSingletonInstance().addExtendEntry("HeadSmithing_Master", 1130, "Master Headsmither", "Master Headsmither", SkillList.SMITHING_WEAPON_HEADS, "MASTER");
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("HeadSmithing_Master", 1130, "Master Headsmither", "Master Headsmither", SkillList.SMITHING_WEAPON_HEADS, "MASTER");
|
||||||
ExtendTitleEnum.getSingletonInstance().addExtendEntry("HeadSmithing_Legendary", 1131, "Legendary Headsmither", "Legendary Headsmither", SkillList.SMITHING_WEAPON_HEADS, "LEGENDARY");
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("HeadSmithing_Legendary", 1131, "Legendary Headsmither", "Legendary Headsmither", SkillList.SMITHING_WEAPON_HEADS, "LEGENDARY");
|
||||||
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("Hatchet_Normal", 1132, "Hatcheter", "Hatcheter", SkillList.HATCHET, "NORMAL");
|
||||||
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("Hatchet_Minor", 1133, "Renowned Hatcheter", "Renowned Hatcheter", SkillList.HATCHET, "MINOR");
|
||||||
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("Hatchet_Master", 1134, "Master Hatcheter", "Master Hatcheter", SkillList.HATCHET, "MASTER");
|
||||||
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("Hatchet_Legendary", 1135, "Hatchslinging Slasher", "Hatchslinging Slasher", SkillList.HATCHET, "LEGENDARY");
|
||||||
|
|
||||||
// Skill Titles (100)
|
// Skill Titles (100)
|
||||||
ExtendTitleEnum.getSingletonInstance().addExtendEntry("Archery_Legendary", 1500, "Legendary Marksman", "Legendary Marksman", 1030, "LEGENDARY");
|
ExtendTitleEnum.getSingletonInstance().addExtendEntry("Archery_Legendary", 1500, "Legendary Marksman", "Legendary Marksman", 1030, "LEGENDARY");
|
||||||
|
|||||||
39
src/main/java/mod/sin/wyvern/util/TraderItem.java
Normal file
39
src/main/java/mod/sin/wyvern/util/TraderItem.java
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package mod.sin.wyvern.util;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class TraderItem {
|
||||||
|
int templateid;
|
||||||
|
int quality;
|
||||||
|
boolean randomQuality;
|
||||||
|
int lowerQuality, upperQuality;
|
||||||
|
int quantity;
|
||||||
|
|
||||||
|
public TraderItem(int templateid, int quality, boolean randomQuality, int lowerQuality, int upperQuality, int quantity) {
|
||||||
|
this.templateid = templateid;
|
||||||
|
this.quality = quality;
|
||||||
|
this.randomQuality = randomQuality;
|
||||||
|
this.lowerQuality = lowerQuality;
|
||||||
|
this.upperQuality = upperQuality;
|
||||||
|
this.quantity = quantity;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getQuality() {
|
||||||
|
if(!randomQuality) {
|
||||||
|
return quality;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Random rand = new Random();
|
||||||
|
int q = lowerQuality + rand.nextInt(upperQuality-lowerQuality);
|
||||||
|
return q;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getTemplateid() {
|
||||||
|
return templateid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getQuantity() {
|
||||||
|
return quantity;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user