From d96f10b41e79d0b07fb58d3768d75efad0041b3c Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Sun, 31 Mar 2024 20:03:20 -0500 Subject: [PATCH] vorg stats finalized --- src/engine/objects/Item.java | 20 ++++++++++++- src/engine/objects/ItemBase.java | 50 ++++++++++++++++++++++++++------ src/engine/objects/MobLoot.java | 9 ++---- 3 files changed, 62 insertions(+), 17 deletions(-) diff --git a/src/engine/objects/Item.java b/src/engine/objects/Item.java index 99fdefd3..22e8c0cc 100644 --- a/src/engine/objects/Item.java +++ b/src/engine/objects/Item.java @@ -98,6 +98,8 @@ public class Item extends AbstractWorldObject { loadEnchantments(); if(this.getItemBase().isVorg() == false) bakeInStats(); + else + Item.BakeVorgStats(this); } public Item(ItemBase itemBase, int ownerID, @@ -129,6 +131,8 @@ public class Item extends AbstractWorldObject { loadEnchantments(); bakeInStats(); + if(this.getItemBase().isVorg()) + Item.BakeVorgStats(this); } /** @@ -161,6 +165,8 @@ public class Item extends AbstractWorldObject { loadEnchantments(); bakeInStats(); + if(this.getItemBase().isVorg()) + Item.BakeVorgStats(this); } /** @@ -234,7 +240,8 @@ public class Item extends AbstractWorldObject { this.value = rs.getInt("item_value"); this.customName = rs.getString("item_name"); - + if(this.getItemBase().isVorg()) + Item.BakeVorgStats(this); } public static void _serializeForClientMsg(Item item, ByteBufferWriter writer) @@ -627,6 +634,8 @@ public class Item extends AbstractWorldObject { } catch (Exception e) { Logger.error(e); } + if(item.getItemBase().isVorg()) + Item.BakeVorgStats(item); return item; } @@ -668,6 +677,15 @@ public class Item extends AbstractWorldObject { return item; } + public static void BakeVorgStats(Item item){ + if (item.getItemBase().isVorg()) { + item.getEnchants().clear(); + for (String powerString : item.getItemBase().getVorgStats()) { + item.addPermanentEnchantment(powerString, 0); + } + item.setName(item.getItemBase().getName()); + } + } public static Item getFromCache(int id) { return (Item) DbManager.getFromCache(GameObjectType.Item, id); } diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index e5832b3e..333efbea 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -926,17 +926,49 @@ public class ItemBase{ } public String[] getVorgStats() { - if(this.isLightArmor() || this.isMediumArmor() || this.isHeavyArmor() || this.isClothArmor()){ - if(this.getValidSlot() == MBServerStatics.SLOT_FEET) { - return new String[]{"PRE-133", "PRE-230", "PRE-210", "PRE-220", "SUF-003","SUF-150"}; - }else { + switch(this.uuid){ + case 27550://bow + case 27560://dagger + case 27570://hammer + case 27580://axe + case 27590://sword + return new String[]{"PRE-010","SUF-260"}; + + case 27600://staff + return new String[]{"PRE-334","PRE-315"}; + + case 188500://HA chest + case 188510://HA arms + case 188520://HA legs + case 188530://HA gloves + case 188550://HA helm + case 188720://CC hood + case 188900://MA chest + case 188910://MA Sleeves + case 188920://MA Legs + case 188930://MA gloves + case 188950://MA helm + case 189100://la chest + case 189110://la arms + case 189120://la legs + case 189130://la gloves + case 189150://la helm + case 189550://CC gloves return new String[]{"PRE-130", "PRE-232", "PRE-212", "PRE-222", "SUF-007"}; - } - } else if(this.isShield()){//shield - return new String[]{"SUF-265","PRE-123","PRE-232", "PRE-212", "PRE-222"}; - } else{//weapon - return new String[]{"PRE-020","PRE-033",}; + case 188540://HA boots + case 188940://MA boots + case 189140://LA boots + case 189560://CC boots + return new String[]{"PRE-133", "PRE-230", "PRE-210", "PRE-220", "SUF-003","SUF-150"}; + + case 188700://CC robe + return new String[]{"PRE-130", "PRE-232", "PRE-212", "PRE-222","SUF-317","SUF-317","SUF-317"}; + + case 189500://MA shield + case 189510://HA shield + return new String[]{"PRE-125","PRE-125","PRE-125", "PRE-230", "PRE-210", "PRE-220"}; } + return new String[]{}; } } diff --git a/src/engine/objects/MobLoot.java b/src/engine/objects/MobLoot.java index af7970a1..fa757c48 100644 --- a/src/engine/objects/MobLoot.java +++ b/src/engine/objects/MobLoot.java @@ -164,13 +164,8 @@ public final class MobLoot extends Item { item.addPermanentEnchantment(this.suffix, 0); this.junk(); - if (item.getItemBase().isVorg()) { - item.getEnchants().clear(); - for (String powerString : item.getItemBase().getVorgStats()) { - item.addPermanentEnchantment(powerString, 0); - } - this.setName(item.getItemBase().getName()); - } + if(item.getItemBase().isVorg()) + Item.BakeVorgStats(item); return item; }