forked from MagicBane/Server
Begin constructor refactor
This commit is contained in:
@@ -1245,7 +1245,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
cost = sell.getBaseValue();
|
||||
|
||||
//apply damaged value reduction
|
||||
float durabilityCurrent = sell.getDurabilityCurrent();
|
||||
float durabilityCurrent = (short) sell.durabilityCurrent;
|
||||
float durabilityMax = sell.getDurabilityMax();
|
||||
float damagedModifier = durabilityCurrent / durabilityMax;
|
||||
cost *= damagedModifier;
|
||||
@@ -1639,7 +1639,7 @@ public class ClientMessagePump implements NetMsgHandler {
|
||||
return;
|
||||
|
||||
//make sure item is damaged and not destroyed
|
||||
short dur = toRepair.getDurabilityCurrent();
|
||||
short dur = (short) toRepair.durabilityCurrent;
|
||||
short max = toRepair.getDurabilityMax();
|
||||
//account for durability modifications
|
||||
float durMod = toRepair.getBonusPercent(ModType.Durability, SourceType.NONE);
|
||||
|
||||
@@ -64,7 +64,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
|
||||
|
||||
charter = msg.getCharter();
|
||||
|
||||
if (charter == null || charter.getOwnerType() != OwnerType.PlayerCharacter || charter.getOwnerID() != player.getObjectUUID()) {
|
||||
if (charter == null || charter.ownerType != OwnerType.PlayerCharacter || charter.getOwnerID() != player.getObjectUUID()) {
|
||||
ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
|
||||
removeRune(player, origin, comps.get(1).intValue());
|
||||
}
|
||||
break;
|
||||
} else if (item.getChargesRemaining() > 0) {
|
||||
} else if ((byte) item.chargesRemaining > 0) {
|
||||
ArrayList<Long> tarList = msg.getTargetCompID();
|
||||
AbstractWorldObject target = player;
|
||||
if (tarList.size() > 1) {
|
||||
|
||||
@@ -284,7 +284,7 @@ public class ItemProductionMsg extends ClientNetMsg {
|
||||
writer.putInt(this.itemUUID);
|
||||
writer.putInt(0); //items left to produce?
|
||||
if (toRoll != null) {
|
||||
writer.putInt(toRoll.getItemBaseID());
|
||||
writer.putInt(toRoll.getTemplsteID());
|
||||
writer.putInt(toRoll.getValue());
|
||||
} else {
|
||||
writer.putInt(0);
|
||||
@@ -301,7 +301,7 @@ public class ItemProductionMsg extends ClientNetMsg {
|
||||
|
||||
timeLeft /= 1000;
|
||||
writer.putInt((int) timeLeft);
|
||||
writer.putInt(vendor.getRollingTimeInSeconds(toRoll.getItemBaseID()));
|
||||
writer.putInt(vendor.getRollingTimeInSeconds(toRoll.getTemplsteID()));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@@ -449,15 +449,15 @@ public class ManageNPCMsg extends ClientNetMsg {
|
||||
writer.putInt(i.getObjectUUID());
|
||||
|
||||
writer.putInt(0);
|
||||
writer.putInt(i.getItemBaseID());
|
||||
writer.putInt(ib.getBaseValue());
|
||||
writer.putInt(i.getTemplsteID());
|
||||
writer.putInt(ib.getBaseValue());
|
||||
|
||||
long timeLife = i.getDateToUpgrade() - System.currentTimeMillis();
|
||||
|
||||
timeLife /= 1000;
|
||||
writer.putInt((int) timeLife);
|
||||
writer.putInt(npc.getRollingTimeInSeconds(i.getItemBaseID()));
|
||||
writer.putInt(1);
|
||||
writer.putInt((int) timeLife);
|
||||
writer.putInt(npc.getRollingTimeInSeconds(i.getTemplsteID()));
|
||||
writer.putInt(1);
|
||||
|
||||
if (i.isComplete())
|
||||
writer.put((byte) 1);
|
||||
|
||||
Reference in New Issue
Block a user