forked from MagicBane/Server
vorg fix
This commit is contained in:
@@ -96,10 +96,7 @@ public class Item extends AbstractWorldObject {
|
||||
this.customName = name;
|
||||
|
||||
loadEnchantments();
|
||||
if(this.getItemBase().isVorg() == false)
|
||||
bakeInStats();
|
||||
else
|
||||
Item.BakeVorgStats(this);
|
||||
bakeInStats();
|
||||
}
|
||||
|
||||
public Item(ItemBase itemBase, int ownerID,
|
||||
@@ -131,8 +128,6 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
loadEnchantments();
|
||||
bakeInStats();
|
||||
if(this.getItemBase().isVorg())
|
||||
Item.BakeVorgStats(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -165,8 +160,6 @@ public class Item extends AbstractWorldObject {
|
||||
|
||||
loadEnchantments();
|
||||
bakeInStats();
|
||||
if(this.getItemBase().isVorg())
|
||||
Item.BakeVorgStats(this);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,8 +233,6 @@ 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)
|
||||
@@ -634,8 +625,6 @@ public class Item extends AbstractWorldObject {
|
||||
} catch (Exception e) {
|
||||
Logger.error(e);
|
||||
}
|
||||
if(item.getItemBase().isVorg())
|
||||
Item.BakeVorgStats(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
@@ -676,21 +665,6 @@ 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()) {
|
||||
try {
|
||||
item.addPermanentEnchantment(powerString, 0);
|
||||
}
|
||||
catch(Exception e){
|
||||
Logger.error("Couldn't find enchantment for: " + powerString);
|
||||
}
|
||||
}
|
||||
item.setName(item.getItemBase().getName());
|
||||
}
|
||||
}
|
||||
public static Item getFromCache(int id) {
|
||||
return (Item) DbManager.getFromCache(GameObjectType.Item, id);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user