From cd0e31f39dce43fd716a0ce9a78539ad1087f081 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 11 Jan 2023 21:02:18 -0600 Subject: [PATCH 1/2] discipline and godly drop messages added --- src/engine/objects/Mob.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index bf845159..52fac8f0 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -31,6 +31,7 @@ import engine.net.client.msg.ErrorPopupMsg; import engine.net.client.msg.ManageCityAssetsMsg; import engine.net.client.msg.PetMsg; import engine.net.client.msg.PlaceAssetMsg; +import engine.net.client.msg.chat.ChatSystemMsg; import engine.powers.EffectsBase; import engine.server.MBServerStatics; import engine.server.world.WorldServer; @@ -1323,6 +1324,25 @@ public class Mob extends AbstractIntelligenceAgent { } catch (Exception e) { Logger.error(e); } + + //send announcement if disc or godly rune + for(Item it : this.getInventory()) { + ItemBase ib = it.getItemBase(); + if (ib.isRune()) { + //if disc rune send system message + ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() +". Are you tough enough to take it?"); + chatMsg.setMessageType(2); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + } + if (ib.isStatRune() && ib.getName().toLowerCase().contains("of the gods")) { + //godly rune send system message + ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() +". Are you tough enough to take it?"); + chatMsg.setMessageType(2); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + } + } } public void respawn() { From 73edd8d93259271be6115546819d1da69e9c5153 Mon Sep 17 00:00:00 2001 From: FatBoy-DOTC Date: Wed, 11 Jan 2023 21:58:24 -0600 Subject: [PATCH 2/2] discipline and godly drop messages added --- src/engine/objects/ItemBase.java | 10 +++++++- src/engine/objects/Mob.java | 39 ++++++++++++++++---------------- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/engine/objects/ItemBase.java b/src/engine/objects/ItemBase.java index f6b0dee4..49286e31 100644 --- a/src/engine/objects/ItemBase.java +++ b/src/engine/objects/ItemBase.java @@ -313,7 +313,15 @@ public class ItemBase { int ID = uuid; return ID > 249999 && ID < 250045; } - + public boolean isDiscRune(){ + int ID = uuid; + if (ID > 2499 && ID < 3050) { //class, discipline runes + return true; + } + else{ + return false; + } + } public boolean isGlass() { int ID = uuid; return ID > 7000099 && ID < 7000281; diff --git a/src/engine/objects/Mob.java b/src/engine/objects/Mob.java index 52fac8f0..4f0979bd 100644 --- a/src/engine/objects/Mob.java +++ b/src/engine/objects/Mob.java @@ -1324,25 +1324,6 @@ public class Mob extends AbstractIntelligenceAgent { } catch (Exception e) { Logger.error(e); } - - //send announcement if disc or godly rune - for(Item it : this.getInventory()) { - ItemBase ib = it.getItemBase(); - if (ib.isRune()) { - //if disc rune send system message - ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() +". Are you tough enough to take it?"); - chatMsg.setMessageType(2); - chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(chatMsg); - } - if (ib.isStatRune() && ib.getName().toLowerCase().contains("of the gods")) { - //godly rune send system message - ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() +". Are you tough enough to take it?"); - chatMsg.setMessageType(2); - chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); - DispatchMessage.dispatchMsgToAll(chatMsg); - } - } } public void respawn() { @@ -1451,7 +1432,25 @@ public class Mob extends AbstractIntelligenceAgent { this.charItemManager.addItemToInventory(ml); } - +//send announcement if disc or godly rune + for(Item it : this.getInventory()) { + ItemBase ib = it.getItemBase(); + if (ib.isDiscRune()) { + //if disc rune send system message + ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() +". Are you tough enough to take it?"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + } + if (ib.isStatRune() && ib.getName().toLowerCase().contains("of the gods")) { + //godly rune send system message + ChatSystemMsg chatMsg = new ChatSystemMsg(null, this.getName() + " in " + this.getParentZone().getName() + " has found the " + ib.getName() +". Are you tough enough to take it?"); + chatMsg.setMessageType(10); + chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID()); + DispatchMessage.dispatchMsgToAll(chatMsg); + return; + } + } //add special loot to mob }