initial
This commit is contained in:
@@ -23,7 +23,6 @@ import mod.sin.items.caches.*;
|
||||
import mod.sin.lib.Util;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookException;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
|
||||
import org.nyxcode.wurm.discordrelay.DiscordRelay;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
@@ -82,9 +81,6 @@ public class Arena {
|
||||
nsq.sendQuestion();
|
||||
}
|
||||
|
||||
public static void sendHotaMessage(String message){
|
||||
DiscordRelay.sendToDiscord("arena", message, true);
|
||||
}
|
||||
|
||||
public static void createNewHotaPrize(Village v, int winStreak){
|
||||
try {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package mod.sin.wyvern;
|
||||
|
||||
import com.wurmonline.server.items.Item;
|
||||
import com.wurmonline.server.items.ItemTemplateFactory;
|
||||
import com.wurmonline.server.villages.GuardPlan;
|
||||
import com.wurmonline.server.villages.Village;
|
||||
import com.wurmonline.server.villages.Villages;
|
||||
|
||||
@@ -10,6 +10,8 @@ import java.util.Map;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.wurmonline.server.Servers;
|
||||
import com.wurmonline.server.behaviours.Action;
|
||||
import mod.sin.lib.Util;
|
||||
import org.gotti.wurmunlimited.modloader.ReflectionUtil;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.InvocationHandlerFactory;
|
||||
@@ -95,6 +97,10 @@ public class ItemMod {
|
||||
public static GlimmerscaleHose GLIMMERSCALE_HOSE = new GlimmerscaleHose();
|
||||
public static GlimmerscaleSleeve GLIMMERSCALE_SLEEVE = new GlimmerscaleSleeve();
|
||||
public static GlimmerscaleVest GLIMMERSCALE_VEST = new GlimmerscaleVest();
|
||||
|
||||
//Ocnoc
|
||||
public static PipingKit PIPING_KIT = new PipingKit();
|
||||
public static StableContract STABLE_CONTRACT = new StableContract();
|
||||
|
||||
public static void createItems(){
|
||||
logger.info("createItems()");
|
||||
@@ -126,6 +132,9 @@ public class ItemMod {
|
||||
TREASURE_BOX.createTemplate();
|
||||
WARHAMMER.createTemplate();
|
||||
WARHAMMER_HEAD.createTemplate();
|
||||
PIPING_KIT.createTemplate();
|
||||
STABLE_CONTRACT.createTemplate();
|
||||
|
||||
|
||||
// Arena Fragments
|
||||
KEY_FRAGMENT.createTemplate();
|
||||
@@ -178,6 +187,8 @@ public class ItemMod {
|
||||
ModActions.registerAction(new SealedMapAction());
|
||||
ModActions.registerAction(new SupplyDepotAction());
|
||||
ModActions.registerAction(new TreasureBoxAction());
|
||||
ModActions.registerAction(new PipingKitAction());
|
||||
ModActions.registerAction(new StableContractAction());
|
||||
}
|
||||
|
||||
public static void initCreationEntries(){
|
||||
@@ -198,6 +209,7 @@ public class ItemMod {
|
||||
//STATUETTE_CYBERHUSKY.initCreationEntry();
|
||||
WARHAMMER.initCreationEntry();
|
||||
WARHAMMER_HEAD.initCreationEntry();
|
||||
//HUGE_CRATE.initCreationEntry();
|
||||
|
||||
// Spectral set
|
||||
/*SPECTRAL_BOOT.initCreationEntry();
|
||||
@@ -326,9 +338,21 @@ public class ItemMod {
|
||||
ItemTemplate goldMirror = ItemTemplateFactory.getInstance().getTemplate(ItemList.goldenMirror);
|
||||
ReflectionUtil.setPrivateField(goldMirror, ReflectionUtil.getField(goldMirror.getClass(), "value"), 1000000);
|
||||
|
||||
// Set transmutation rod to 2 gold instead of 50 silver.
|
||||
//ItemTemplate transmutationRod = ItemTemplateFactory.getInstance().getTemplate(668);
|
||||
//ReflectionUtil.setPrivateField(transmutationRod, ReflectionUtil.getField(transmutationRod.getClass(), "value"), 2000000);
|
||||
// Set sculpting wand to be 25 silver
|
||||
ItemTemplate sculptingWand = ItemTemplateFactory.getInstance().getTemplate(ItemList.wandSculpting);
|
||||
ReflectionUtil.setPrivateField(sculptingWand, ReflectionUtil.getField(sculptingWand.getClass(), "value"), 250000);
|
||||
ReflectionUtil.setPrivateField(sculptingWand, ReflectionUtil.getField(sculptingWand.getClass(), "nodrop"), false);
|
||||
|
||||
// Set mysteryEgg to be 5 silver
|
||||
int mysteryEggID = ItemTemplateFactory.getInstance().getTemplate("mystery egg").getTemplateId();
|
||||
ItemTemplate mysteryEgg = ItemTemplateFactory.getInstance().getTemplate(mysteryEggID);
|
||||
ReflectionUtil.setPrivateField(mysteryEgg, ReflectionUtil.getField(mysteryEgg.getClass(), "value"), 50000);
|
||||
ReflectionUtil.setPrivateField(mysteryEgg, ReflectionUtil.getField(mysteryEgg.getClass(), "fullprice"), true);
|
||||
|
||||
//Set transmutation rod to 2 gold instead of 50 silver.
|
||||
ItemTemplate transmutationRod = ItemTemplateFactory.getInstance().getTemplate(ItemList.rodTransmutation);
|
||||
ReflectionUtil.setPrivateField(transmutationRod, ReflectionUtil.getField(transmutationRod.getClass(), "value"), 2000000);
|
||||
|
||||
|
||||
// " return this.isTransportable || (this.getTemplateId() >= 510 && this.getTemplateId() <= 513) || this.getTemplateId() == 722 || this.getTemplateId() == 670;"
|
||||
// Make mailboxes loadable (PvE Only)
|
||||
@@ -380,6 +404,7 @@ public class ItemMod {
|
||||
ReflectionUtil.setPrivateField(marbleKeystone, ReflectionUtil.getField(marbleKeystone.getClass(), "decoration"), true);
|
||||
ItemTemplate skull = ItemTemplateFactory.getInstance().getTemplate(ItemList.skull);
|
||||
ReflectionUtil.setPrivateField(skull, ReflectionUtil.getField(skull.getClass(), "decoration"), true);
|
||||
// Still need to override the method for getting spaceLeft
|
||||
|
||||
createCustomWeapons();
|
||||
createCustomArmours();
|
||||
|
||||
@@ -25,7 +25,6 @@ import mod.sin.lib.Util;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookException;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
|
||||
import org.gotti.wurmunlimited.modsupport.ModSupportDb;
|
||||
import org.nyxcode.wurm.discordrelay.DiscordRelay;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
@@ -46,7 +45,6 @@ public class MiscChanges {
|
||||
}
|
||||
|
||||
public static void sendServerTabMessage(String channel, final String message, final int red, final int green, final int blue){
|
||||
DiscordRelay.sendToDiscord(channel, message, true);
|
||||
// WARNING: Never change this from a new Runnable. Lambdas are a lie and will break everything.
|
||||
Runnable r = new Runnable() {
|
||||
public void run() {
|
||||
@@ -84,7 +82,6 @@ public class MiscChanges {
|
||||
sendGlobalFreedomChat(player, slayMessage+slayers, 200, 25, 25);
|
||||
addPlayerStatsDeath(player.getName());
|
||||
addPlayerStatsKill(slayers);
|
||||
DiscordRelay.sendToDiscord("deaths", player.getName()+" "+slayMessage+slayers, true);
|
||||
}
|
||||
|
||||
public static void addPlayerStat(String playerName, String stat){
|
||||
@@ -314,8 +311,8 @@ public class MiscChanges {
|
||||
|
||||
// - Enable creature custom colors - (Used for creating custom color creatures eg. Lilith) - //
|
||||
CtClass ctCreature = classPool.get("com.wurmonline.server.creatures.Creature");
|
||||
replace = "{ return true; }";
|
||||
Util.setBodyDeclared(thisClass, ctCreature, "hasCustomColor", replace);
|
||||
/** replace = "{ return true; }";
|
||||
Util.setBodyDeclared(thisClass, ctCreature, "hasCustomColor", replace);**/
|
||||
|
||||
// - Increase the amount of checks for new unique spawns by 5x - //
|
||||
CtClass ctServer = classPool.get("com.wurmonline.server.Server");
|
||||
@@ -626,10 +623,16 @@ public class MiscChanges {
|
||||
"}";
|
||||
Util.instrumentDeclared(thisClass, ctAffinitiesTimed, "add", "getExpires", replace);
|
||||
|
||||
Util.setReason("Make weaponsmithing oils actually help with weaponsmithing");
|
||||
replace = "if($1 == 1016){" +
|
||||
"return $0.getSpellEffectPower((byte)77);" +
|
||||
"}";
|
||||
Util.insertBeforeDeclared(thisClass, ctItem, "getSkillSpellImprovement", replace);
|
||||
|
||||
Util.setReason("Make bed QL affect sleep bonus timer.");
|
||||
CtClass ctPlayerInfo = classPool.get("com.wurmonline.server.players.PlayerInfo");
|
||||
replace = "secs = "+MiscChanges.class.getName()+".getBedBonus(secs, this.bed);" +
|
||||
"$_ = $proceed($$);";
|
||||
replace = "long secs2 = "+MiscChanges.class.getName()+".getBedBonus(secs, this.bed);" +
|
||||
"$_ = $proceed((int)(this.sleep + secs2));";
|
||||
Util.instrumentDeclared(thisClass, ctPlayerInfo, "calculateSleep", "setSleep", replace);
|
||||
|
||||
Util.setReason("Fix intrateleport block bug.");
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package mod.sin.wyvern;
|
||||
|
||||
import com.wurmonline.server.FailedException;
|
||||
import com.wurmonline.server.Items;
|
||||
import com.wurmonline.server.NoSuchItemException;
|
||||
import com.wurmonline.server.NoSuchPlayerException;
|
||||
import com.wurmonline.server.creatures.Creature;
|
||||
import com.wurmonline.server.creatures.NoSuchCreatureException;
|
||||
import com.wurmonline.server.items.Item;
|
||||
import com.wurmonline.server.items.ItemList;
|
||||
import com.wurmonline.server.items.*;
|
||||
import com.wurmonline.server.skills.Skill;
|
||||
import com.wurmonline.server.zones.NoSuchZoneException;
|
||||
import javassist.ClassPool;
|
||||
import javassist.CtClass;
|
||||
import javassist.NotFoundException;
|
||||
import javassist.bytecode.Descriptor;
|
||||
import mod.sin.items.HugeCrate;
|
||||
import mod.sin.lib.Util;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookException;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
|
||||
@@ -53,6 +55,7 @@ public class QualityOfLife {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Item getVehicleSafe(Creature pilot) {
|
||||
try {
|
||||
if (pilot.getVehicle() != -10)
|
||||
@@ -126,6 +129,7 @@ public class QualityOfLife {
|
||||
QualityOfLife.class.getName()+".vehicleHook(performer, $0);";
|
||||
Util.instrumentDescribed(thisClass, ctTileRockBehaviour, "action", desc2, "setDataXY", replace);*/
|
||||
|
||||
|
||||
Util.setReason("Allow players to surface mine directly into vehicles.");
|
||||
CtClass ctTileRockBehaviour = classPool.get("com.wurmonline.server.behaviours.TileRockBehaviour");
|
||||
replace = "$_ = $proceed($$);" +
|
||||
@@ -148,6 +152,18 @@ public class QualityOfLife {
|
||||
replace = "$_ = false;";
|
||||
Util.instrumentDeclared(thisClass, ctMethodsCreatures, "tame", "isPriest", replace);
|
||||
|
||||
Util.setReason("Allow dirt to add up to 100 dirt to a container.");
|
||||
CtClass ctDirt = classPool.get("com.wurmonline.server.spells.Dirt");
|
||||
replace = "$1 = 100;"
|
||||
+ "$_ = $proceed($$);";
|
||||
Util.instrumentDeclared(thisClass, ctDirt, "doEffect", "min", replace);
|
||||
|
||||
Util.setReason("Rescale Wild Growth to work up to an 8x8 area");
|
||||
CtClass ctWildGrowth = classPool.get("com.wurmonline.server.spells.WildGrowth");
|
||||
replace = "$2 = (power / 10.0); $_ = $proceed($$);";
|
||||
Util.instrumentDeclared(thisClass, ctWildGrowth, "doEffect", "max", replace);
|
||||
|
||||
|
||||
Util.setReason("Send gems, source crystals, flint, etc. into vehicle.");
|
||||
CtClass[] params2 = {
|
||||
CtClass.intType,
|
||||
|
||||
@@ -3,6 +3,8 @@ package mod.sin.wyvern;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.InvocationHandler;
|
||||
import java.lang.reflect.Method;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.file.Paths;
|
||||
import java.sql.Connection;
|
||||
@@ -16,13 +18,18 @@ import java.util.logging.Logger;
|
||||
import java.util.logging.SimpleFormatter;
|
||||
|
||||
import com.wurmonline.server.Items;
|
||||
import com.wurmonline.server.Server;
|
||||
import com.wurmonline.server.creatures.Communicator;
|
||||
import com.wurmonline.server.creatures.Creature;
|
||||
import com.wurmonline.server.items.*;
|
||||
import javassist.bytecode.Descriptor;
|
||||
import mod.sin.items.*;
|
||||
import mod.sin.kingdomoffices.ItemCreator;
|
||||
import mod.sin.lib.Util;
|
||||
import org.gotti.wurmunlimited.modloader.ReflectionUtil;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookException;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.HookManager;
|
||||
import org.gotti.wurmunlimited.modloader.classhooks.InvocationHandlerFactory;
|
||||
import org.gotti.wurmunlimited.modloader.interfaces.*;
|
||||
import org.gotti.wurmunlimited.modsupport.ModSupportDb;
|
||||
import org.gotti.wurmunlimited.modsupport.actions.ModActions;
|
||||
@@ -259,6 +266,65 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
|
||||
} catch (NoSuchTemplateException | IllegalArgumentException | IllegalAccessException | ClassCastException | NoSuchFieldException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
logger.info("Attempting Shop Hook...");
|
||||
logger.info("Creating Hook Descriptor...");
|
||||
String descriptor = Descriptor.ofMethod(CtClass.voidType, new CtClass[] {
|
||||
HookManager.getInstance().getClassPool().get("com.wurmonline.server.creatures.Creature")
|
||||
});
|
||||
logger.info("Hooking createShop...");
|
||||
HookManager.getInstance().registerHook("com.wurmonline.server.economy.Shop", "createShop", descriptor, new InvocationHandlerFactory()
|
||||
{
|
||||
@Override
|
||||
public InvocationHandler createInvocationHandler() {
|
||||
return new InvocationHandler() {
|
||||
@Override
|
||||
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
|
||||
Object result = method.invoke(proxy, args);
|
||||
Item inventory = ((Creature)args[0]).getInventory();
|
||||
for(int x = 0; x < 3; ++x) {
|
||||
// this is our item...
|
||||
Item item;
|
||||
// Book of conversion
|
||||
item = Creature.createItem(BookOfConversion.templateId, 50.0f);
|
||||
inventory.insertItem(item);
|
||||
// Common mystery egg
|
||||
int mysteryEggID = ItemTemplateFactory.getInstance().getTemplate("mystery egg").getTemplateId();
|
||||
item = Creature.createItem(mysteryEggID, 100);
|
||||
inventory.insertItem(item);
|
||||
// Affinity orb
|
||||
item = Creature.createItem(AffinityOrb.templateId, 50 + Server.rand.nextInt(50));
|
||||
inventory.insertItem(item);
|
||||
// Chaos crystal
|
||||
item = Creature.createItem(ChaosCrystal.templateId, 5);
|
||||
inventory.insertItem(item);
|
||||
// Enchanter's Crystal
|
||||
item = Creature.createItem(EnchantersCrystal.templateId, 1 + Server.rand.nextInt(99));
|
||||
inventory.insertItem(item);
|
||||
// Sealed map
|
||||
item = Creature.createItem(SealedMap.templateId, 1 + Server.rand.nextInt(99));
|
||||
inventory.insertItem(item);
|
||||
// Sculpting wand
|
||||
item = Creature.createItem(ItemList.wandSculpting, 50);
|
||||
inventory.insertItem(item);
|
||||
// Piping kit
|
||||
item = Creature.createItem(PipingKit.templateId, 50);
|
||||
inventory.insertItem(item);
|
||||
// Stable master contract
|
||||
item = Creature.createItem(StableContract.templateId, 50);
|
||||
inventory.insertItem(item);
|
||||
// Kingdom token
|
||||
item = Creature.createItem(ItemCreator.KINGDOM_TOKEN.getTemplateId(), 50);
|
||||
inventory.insertItem(item);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
} catch ( IllegalArgumentException | ClassCastException | NotFoundException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -341,8 +407,8 @@ implements WurmServerMod, Configurable, PreInitable, Initable, ItemTemplatesCrea
|
||||
logger.info("Registering Arena actions.");
|
||||
ModActions.registerAction(new SorceryCombineAction());
|
||||
//ModActions.registerAction(new VillageTeleportAction()); // [3/28/18] Disabled - Highway Portals added instead.
|
||||
ModActions.registerAction(new ArenaTeleportAction());
|
||||
ModActions.registerAction(new ArenaEscapeAction());
|
||||
//ModActions.registerAction(new ArenaTeleportAction());
|
||||
//ModActions.registerAction(new ArenaEscapeAction());
|
||||
logger.info("Registering Dev actions.");
|
||||
ModActions.registerAction(new MissionAddAction());
|
||||
ModActions.registerAction(new MissionRemoveAction());
|
||||
|
||||
@@ -113,6 +113,22 @@ public class MethodsBestiary {
|
||||
return (byte)127;
|
||||
}
|
||||
|
||||
public static String generateGuardMaleName() {
|
||||
final int rand = Server.rand.nextInt(50);
|
||||
final String[] firstPart = { "Carl", "John", "Bil", "Strong", "Dare", "Grave", "Hard", "Marde", "Verde", "Vold", "Tolk", "Roe", "Bee", "Har", "Rol", "Ma", "Lo", "Claw", "Drag", "Hug", "Te", "Two", "Fu", "Ji", "La", "Ze", "Jal", "Milk", "War", "Wild", "Hang", "Just", "Fan", "Cloclo", "Buy", "Bought", "Sard", "Smart", "Slo", "Shield", "Dark", "Hung", "Sed", "Sold", "Swing", "Gar", "Dig", "Bur", "Angel", "Sorrow" };
|
||||
final int rand2 = Server.rand.nextInt(50);
|
||||
final String[] secondPart = { "ho", "john", "fish", "tree", "ooy", "olli", "tack", "rank", "sy", "moy", "dangly", "tok", "rich", "do", "mark", "stuf", "sin", "nyt", "wer", "mor", "emort", "vaar", "salm", "holm", "wyr", "zah", "ty", "fast", "der", "mar", "star", "bark", "oo", "flifil", "innow", "shoo", "husk", "eric", "ic", "o", "moon", "little", "ien", "strong", "arm", "hope", "slem", "tro", "rot", "heart" };
|
||||
return firstPart[rand] + secondPart[rand2];
|
||||
}
|
||||
|
||||
public static String generateGuardFemaleName() {
|
||||
final int rand = Server.rand.nextInt(50);
|
||||
final String[] firstPart = { "Too", "Sand", "Tree", "Whisper", "Lore", "Yan", "Van", "Vard", "Nard", "Oli", "Ala", "Krady", "Whe", "Har", "Zizi", "Zaza", "Lyn", "Claw", "Mali", "High", "Bright", "Star", "Nord", "Jala", "Yna", "Ze", "Jal", "Milk", "War", "Wild", "Fine", "Sweet", "Witty", "Cloclo", "Lory", "Tran", "Vide", "Lax", "Quick", "Shield", "Dark", "Light", "Cry", "Sold", "Juna", "Tear", "Cheek", "Ani", "Angel", "Sorro" };
|
||||
final int rand2 = Server.rand.nextInt(50);
|
||||
final String[] secondPart = { "peno", "hag", "maiden", "woman", "loy", "oa", "dei", "sai", "nai", "nae", "ane", "aei", "peno", "doa", "ela", "hofaire", "sina", "nyta", "wera", "more", "emorta", "vaara", "salma", "holmi", "wyre", "zahe", "tya", "faste", "dere", "mara", "stare", "barkia", "ooa", "fila", "innowyn", "shoein", "huskyn", "erica", "ica", "oa", "moonie", "littly", "ieny", "strongie", "ermy", "hope", "steam", "high", "wind", "heart" };
|
||||
return firstPart[rand] + secondPart[rand2];
|
||||
}
|
||||
|
||||
protected static boolean isUsuallyHitched(int templateId){
|
||||
if(templateId == Charger.templateId){
|
||||
return true;
|
||||
@@ -485,7 +501,9 @@ public class MethodsBestiary {
|
||||
|
||||
public static byte newCreatureType(int templateid, byte ctype) throws Exception{
|
||||
CreatureTemplate template = CreatureTemplateFactory.getInstance().getTemplate(templateid);
|
||||
if(ctype == 0 && (template.isAggHuman() || template.getBaseCombatRating() > 10) && !template.isUnique() && !Titans.isTitan(templateid)){
|
||||
// Disallow this from occuring to minipets, it crashes
|
||||
int minipetid = CreatureTemplateFactory.getInstance().getTemplate("Mini Pet").getTemplateId();
|
||||
if(ctype == 0 && (template.isAggHuman() || template.getBaseCombatRating() > 10) && !template.isUnique() && !Titans.isTitan(templateid) && !(templateid == minipetid)) {
|
||||
if(Server.rand.nextInt(5) == 0){
|
||||
ctype = (byte) (Server.rand.nextInt(11)+1);
|
||||
if(Server.rand.nextInt(50) == 0){
|
||||
|
||||
@@ -21,9 +21,14 @@ import com.wurmonline.server.villages.Villages;
|
||||
import mod.sin.armour.SpectralHide;
|
||||
import mod.sin.creatures.Reaper;
|
||||
import mod.sin.creatures.SpectralDrake;
|
||||
import mod.sin.items.AffinityOrb;
|
||||
import mod.sin.items.ChaosCrystal;
|
||||
import mod.sin.items.EnchantersCrystal;
|
||||
import mod.sin.items.FriyanTablet;
|
||||
import mod.sin.items.caches.GemCache;
|
||||
import mod.sin.items.caches.RiftCache;
|
||||
import mod.sin.items.caches.ToolCache;
|
||||
import mod.sin.items.caches.TreasureMapCache;
|
||||
import mod.sin.wyvern.Bounty;
|
||||
import mod.sin.wyvern.MiscChanges;
|
||||
import mod.sin.wyvern.Arena;
|
||||
@@ -219,6 +224,21 @@ public class LootBounty {
|
||||
if(random.nextInt(100) < 75){
|
||||
corpse.insertItem(ItemFactory.createItem((random.nextBoolean() ? ItemList.adamantineBar : ItemList.glimmerSteelBar), 30+(30*random.nextFloat()), ""));
|
||||
}
|
||||
if(random.nextInt(100) < 25) {
|
||||
Item item = ItemFactory.createItem(ItemUtil.getMysteryEggID(), 50, "");
|
||||
item.setRarity((byte)1);
|
||||
corpse.insertItem(item);
|
||||
}
|
||||
if(random.nextInt(100) < 5) {
|
||||
int[] caches = {
|
||||
TreasureMapCache.templateId,
|
||||
GemCache.templateId,
|
||||
RiftCache.templateId
|
||||
};
|
||||
int cacheSelected = random.nextInt(3);
|
||||
Item item = ItemFactory.createItem(caches[cacheSelected], 20 + random.nextInt(40), "");
|
||||
corpse.insertItem(item);
|
||||
}
|
||||
if(random.nextInt(100) < 5){
|
||||
//int[] maskTemplates = {973, 974, 975, 976, 977, 978, 1099};
|
||||
int[] maskTemplates = {
|
||||
@@ -270,7 +290,8 @@ public class LootBounty {
|
||||
if(templateId == Reaper.templateId || templateId == SpectralDrake.templateId){
|
||||
Server.getInstance().broadCastAlert("The "+mob.getName()+" has been slain. A new creature shall enter the realm shortly.");
|
||||
sendLootHelp = true;
|
||||
}else if(Titans.isTitan(mob)){
|
||||
}
|
||||
else if(Titans.isTitan(mob)){
|
||||
Server.getInstance().broadCastAlert("The Titan "+mob.getName()+" has been defeated!");
|
||||
MiscChanges.sendGlobalFreedomChat(mob, "The Titan "+mob.getName()+" has been defeated!", 255, 105, 180);
|
||||
MiscChanges.sendServerTabMessage("titan", "The Titan "+mob.getName()+" has been defeated!", 255, 105, 180);
|
||||
@@ -310,7 +331,21 @@ public class LootBounty {
|
||||
blessWorldWithMoonVeins(mob);
|
||||
// Spawn 5-10 friyan tablets throughout the world.
|
||||
spawnFriyanTablets();
|
||||
|
||||
|
||||
try {
|
||||
// guaranteed rare egg, 15% chance it's fantastic
|
||||
Item item = ItemFactory.createItem(ItemUtil.getMysteryEggID(), 50, "");
|
||||
item.setRarity((byte)1);
|
||||
if(random.nextInt( 100) < 15) {
|
||||
item.setRarity((byte)3);
|
||||
}
|
||||
corpse.insertItem(item);
|
||||
|
||||
//free affinity orb
|
||||
item = ItemFactory.createItem(AffinityOrb.templateId, 50, "");
|
||||
} catch (FailedException | NoSuchTemplateException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
// Spawn Spectral Drake
|
||||
/*if (mob.isDragon()) { // Spawn the spectral drake and add extra hide/scale
|
||||
handleDragonLoot(mob, corpse);
|
||||
|
||||
@@ -18,14 +18,13 @@ import com.wurmonline.server.items.ItemTemplate;
|
||||
import com.wurmonline.server.items.NoSuchTemplateException;
|
||||
import com.wurmonline.server.players.Player;
|
||||
import com.wurmonline.server.players.Titles.Title;
|
||||
import com.wurmonline.server.skills.NoSuchSkillException;
|
||||
import com.wurmonline.server.skills.SkillList;
|
||||
import mod.sin.armour.SpectralHide;
|
||||
import mod.sin.creatures.Reaper;
|
||||
import mod.sin.creatures.SpectralDrake;
|
||||
import mod.sin.items.AffinityOrb;
|
||||
import mod.sin.items.caches.RiftCache;
|
||||
import mod.sin.items.caches.TitanCache;
|
||||
import mod.sin.kingdomoffices.ItemCreator;
|
||||
import mod.sin.wyvern.*;
|
||||
import mod.sin.wyvern.util.ItemUtil;
|
||||
|
||||
@@ -141,6 +140,7 @@ public class PlayerBounty {
|
||||
}*/
|
||||
if(mob.isUnique()){
|
||||
MiscChanges.addPlayerStat(player.getName(), "UNIQUES");
|
||||
rewardPowerfulLoot(player, mob);
|
||||
}
|
||||
if(RareSpawns.isRareCreature(mob)){
|
||||
Item riftCache = ItemFactory.createItem(RiftCache.templateId, 50f+(30f*Server.rand.nextFloat()), mob.getName());
|
||||
@@ -199,6 +199,9 @@ public class PlayerBounty {
|
||||
strBuilder += " for slaying the " + mob.getName() + ".";
|
||||
player.getCommunicator().sendSafeServerMessage(strBuilder);
|
||||
long playerSteamId = steamIdMap.get(player.getName());
|
||||
Item creatureToken = ItemFactory.createItem(ItemCreator.CREATURE_TOKEN.getTemplateId(), 50, (byte)0, "");
|
||||
inventory.insertItem(creatureToken);
|
||||
player.getCommunicator().sendSafeServerMessage("You also receive a " + creatureToken.getName() + "!");
|
||||
if(playersRewarded.containsKey(mobWurmId)){
|
||||
playersRewarded.get(mobWurmId).add(playerSteamId);
|
||||
}else{
|
||||
|
||||
@@ -23,7 +23,7 @@ public class Mastercraft {
|
||||
diff -= skill.affinity;
|
||||
}
|
||||
if(skill.getKnowledge() > 99.0d){
|
||||
diff -= 2d-((100d-skill.getKnowledge())*2d);
|
||||
diff -= 4d-((100d-skill.getKnowledge())*4d);
|
||||
}
|
||||
if(skill.getKnowledge() > 90.0d){
|
||||
diff -= 2d-((100d-skill.getKnowledge())*0.2d);
|
||||
@@ -33,7 +33,7 @@ public class Mastercraft {
|
||||
diff -= item.getRarity();
|
||||
}
|
||||
if(item.getCurrentQualityLevel() > 99.0f){
|
||||
diff -= 1d-((100d-item.getCurrentQualityLevel())*1d);
|
||||
diff -= 3d-((100d-item.getCurrentQualityLevel())*3d);
|
||||
}
|
||||
if(item.getCurrentQualityLevel() > 90.0f){
|
||||
diff -= 1d-((100d-item.getCurrentQualityLevel())*0.1d);
|
||||
|
||||
@@ -119,6 +119,11 @@ public class ItemUtil {
|
||||
}
|
||||
item.setDescription(item.getDescription()+eff.getName().substring(0,1)+Math.round(power));
|
||||
}
|
||||
|
||||
public static int getMysteryEggID() {
|
||||
return ItemTemplateFactory.getInstance().getTemplate("mystery egg").getTemplateId();
|
||||
}
|
||||
|
||||
public static Item createRandomSorcery(byte charges){
|
||||
try {
|
||||
Item sorcery = ItemFactory.createItem(sorceryIds[Server.rand.nextInt(sorceryIds.length)], 90+(10*Server.rand.nextFloat()), null);
|
||||
|
||||
Reference in New Issue
Block a user