forked from MagicBane/Server
vorg stats finalized
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user