@ -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,9 +108,14 @@ public class MobEquipment extends AbstractGameObject {
@@ -107,9 +108,14 @@ 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 ( ) ;
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 {
_serializeForClientMsg ( mobEquipment , writer , true ) ;