@ -9,6 +9,7 @@
@@ -9,6 +9,7 @@
package engine.objects ;
import engine.Enum ;
import engine.exception.SerializationException ;
import engine.gameManager.PowersManager ;
import engine.net.ByteBufferWriter ;
@ -107,8 +108,13 @@ public class MobEquipment extends AbstractGameObject {
@@ -107,8 +108,13 @@ public class MobEquipment extends AbstractGameObject {
public static void serializeForVendor ( MobEquipment mobEquipment , ByteBufferWriter writer , float percent ) throws SerializationException {
_serializeForClientMsg ( mobEquipment , writer , false ) ;
int baseValue = mobEquipment . itemBase . getBaseValue ( ) + mobEquipment . itemBase . getMagicValue ( ) ;
writer . putInt ( mobEquipment . magicValue ) ;
writer . putInt ( mobEquipment . magicValue ) ;
if ( mobEquipment . itemBase . getType ( ) . equals ( Enum . ItemType . POTION ) ) {
writer . putInt ( ( int ) ( mobEquipment . itemBase . getBaseValue ( ) * 0 . 5f ) ) ;
writer . putInt ( ( int ) ( mobEquipment . itemBase . getBaseValue ( ) * 0 . 5f ) ) ;
} else {
writer . putInt ( mobEquipment . magicValue ) ;
writer . putInt ( mobEquipment . magicValue ) ;
}
}
public static void serializeForClientMsg ( MobEquipment mobEquipment , ByteBufferWriter writer ) throws SerializationException {