vorg stats finalized

This commit is contained in:
2024-03-31 20:03:20 -05:00
parent 595d0ba9ba
commit d96f10b41e
3 changed files with 63 additions and 18 deletions
+19 -1
View File
@@ -98,6 +98,8 @@ public class Item extends AbstractWorldObject {
loadEnchantments(); loadEnchantments();
if(this.getItemBase().isVorg() == false) if(this.getItemBase().isVorg() == false)
bakeInStats(); bakeInStats();
else
Item.BakeVorgStats(this);
} }
public Item(ItemBase itemBase, int ownerID, public Item(ItemBase itemBase, int ownerID,
@@ -129,6 +131,8 @@ public class Item extends AbstractWorldObject {
loadEnchantments(); loadEnchantments();
bakeInStats(); bakeInStats();
if(this.getItemBase().isVorg())
Item.BakeVorgStats(this);
} }
/** /**
@@ -161,6 +165,8 @@ public class Item extends AbstractWorldObject {
loadEnchantments(); loadEnchantments();
bakeInStats(); bakeInStats();
if(this.getItemBase().isVorg())
Item.BakeVorgStats(this);
} }
/** /**
@@ -234,7 +240,8 @@ public class Item extends AbstractWorldObject {
this.value = rs.getInt("item_value"); this.value = rs.getInt("item_value");
this.customName = rs.getString("item_name"); this.customName = rs.getString("item_name");
if(this.getItemBase().isVorg())
Item.BakeVorgStats(this);
} }
public static void _serializeForClientMsg(Item item, ByteBufferWriter writer) public static void _serializeForClientMsg(Item item, ByteBufferWriter writer)
@@ -627,6 +634,8 @@ public class Item extends AbstractWorldObject {
} catch (Exception e) { } catch (Exception e) {
Logger.error(e); Logger.error(e);
} }
if(item.getItemBase().isVorg())
Item.BakeVorgStats(item);
return item; return item;
} }
@@ -668,6 +677,15 @@ public class Item extends AbstractWorldObject {
return item; 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) { public static Item getFromCache(int id) {
return (Item) DbManager.getFromCache(GameObjectType.Item, id); return (Item) DbManager.getFromCache(GameObjectType.Item, id);
} }
+42 -10
View File
@@ -926,17 +926,49 @@ public class ItemBase{
} }
public String[] getVorgStats() { public String[] getVorgStats() {
if(this.isLightArmor() || this.isMediumArmor() || this.isHeavyArmor() || this.isClothArmor()){ switch(this.uuid){
if(this.getValidSlot() == MBServerStatics.SLOT_FEET) { case 27550://bow
return new String[]{"PRE-133", "PRE-230", "PRE-210", "PRE-220", "SUF-003","SUF-150"}; case 27560://dagger
}else { case 27570://hammer
return new String[]{"PRE-130", "PRE-232", "PRE-212", "PRE-222", "SUF-007"}; case 27580://axe
} case 27590://sword
return new String[]{"PRE-010","SUF-260"};
} else if(this.isShield()){//shield case 27600://staff
return new String[]{"SUF-265","PRE-123","PRE-232", "PRE-212", "PRE-222"}; return new String[]{"PRE-334","PRE-315"};
} else{//weapon
return new String[]{"PRE-020","PRE-033",}; 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"};
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[]{};
} }
} }
+2 -7
View File
@@ -164,13 +164,8 @@ public final class MobLoot extends Item {
item.addPermanentEnchantment(this.suffix, 0); item.addPermanentEnchantment(this.suffix, 0);
this.junk(); this.junk();
if (item.getItemBase().isVorg()) { if(item.getItemBase().isVorg())
item.getEnchants().clear(); Item.BakeVorgStats(item);
for (String powerString : item.getItemBase().getVorgStats()) {
item.addPermanentEnchantment(powerString, 0);
}
this.setName(item.getItemBase().getName());
}
return item; return item;
} }