Browse Source

vorg stats finalized

lakebane-master
FatBoy-DOTC 7 months ago
parent
commit
d96f10b41e
  1. 20
      src/engine/objects/Item.java
  2. 50
      src/engine/objects/ItemBase.java
  3. 9
      src/engine/objects/MobLoot.java

20
src/engine/objects/Item.java

@ -98,6 +98,8 @@ public class Item extends AbstractWorldObject { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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);
}

50
src/engine/objects/ItemBase.java

@ -926,17 +926,49 @@ public class ItemBase{ @@ -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[]{};
}
}

9
src/engine/objects/MobLoot.java

@ -164,13 +164,8 @@ public final class MobLoot extends Item { @@ -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;
}

Loading…
Cancel
Save