Browse Source

Cleanup in bane handling

combat-2
MagicBot 7 months ago
parent
commit
91016dd53c
  1. 26
      src/engine/net/client/handlers/ObjectActionMsgHandler.java

26
src/engine/net/client/handlers/ObjectActionMsgHandler.java

@ -185,42 +185,42 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -185,42 +185,42 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
case BUCKET: //water bucket
case POTION: //potions, tears of saedron
case SCROLL: //runes, petition, warrant, scrolls
if (uuid > 680069 && uuid < 680074) //Handle Charter, Deed, Petition, Warrant here
{
break;
} else if (uuid > 910010 && uuid < 910019) {
int rank = uuid - 910010;
if (item.template.item_bane_rank > 0) {
if (rank < 1 || rank > 8) {
ChatManager.chatSystemError(player, "Invalid Rank for bane scroll!");
return true;
}
// Only one banestone at a time
lock.writeLock().lock();
try {
if (Bane.summonBanestone(player, origin, rank) == true)
if (Bane.summonBanestone(player, origin, item.template.item_bane_rank) == true)
itemMan.consume(item);
} finally {
lock.writeLock().unlock();
}
break;
} else if (uuid == 910010) { //tears of saedron
}
if (uuid == 910010) { //tears of saedron
if (comps.size() > 1) {
AbstractCharacter.removeRune(player, origin, comps.get(1).intValue());
}
break;
} else if ((byte) item.chargesRemaining > 0) {
}
if (item.chargesRemaining > 0) {
ArrayList<Long> tarList = msg.getTargetCompID();
AbstractWorldObject target = player;
if (tarList.size() > 1) {
long tarID = tarList.get(1);
if (tarID != 0) {
AbstractGameObject tarAgo = AbstractGameObject.getFromTypeAndID(tarID);
if (tarAgo != null && tarAgo instanceof AbstractWorldObject) {
if (tarAgo instanceof AbstractWorldObject) {
target = (AbstractWorldObject) tarAgo;
}
}
@ -228,8 +228,6 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler { @@ -228,8 +228,6 @@ public class ObjectActionMsgHandler extends AbstractClientMsgHandler {
// Bypass for waterbuckets
// test character targeted
if (item.template.item_type.equals(mbEnums.ItemType.BUCKET)) {
// test for valid target type

Loading…
Cancel
Save