forked from MagicBane/Server
Refactor itembase.name to template.
This commit is contained in:
@@ -242,8 +242,11 @@ public enum BuildingManager {
|
||||
if (resourceAmount <= 0)
|
||||
continue;
|
||||
|
||||
if (Warehouse.loot(warehouse, player, resourceBase, resourceAmount, true))
|
||||
ChatManager.chatInfoInfo(player, "You have looted " + resourceAmount + ' ' + resourceBase.getName());
|
||||
if (Warehouse.loot(warehouse, player, resourceBase, resourceAmount, true)) {
|
||||
ItemTemplate template = ItemTemplate.itemTemplates.get(resourceBase.getUUID());
|
||||
ChatManager.chatInfoInfo(player, "You have looted " + resourceAmount + ' ' + template.item_base_name);
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -612,7 +612,8 @@ public enum ChatManager {
|
||||
name = amount + " gold ";
|
||||
else {
|
||||
String vowels = "aeiou";
|
||||
String iName = item.getItemBase().getName();
|
||||
ItemTemplate template = ItemTemplate.itemTemplates.get(item.getItemBaseID());
|
||||
String iName = template.item_base_name;
|
||||
if (iName.length() > 0)
|
||||
if (vowels.indexOf(iName.substring(0, 1).toLowerCase()) >= 0)
|
||||
name = "an " + iName + ' ';
|
||||
|
||||
@@ -83,10 +83,14 @@ public enum LootManager {
|
||||
for (Item it : mob.getInventory()) {
|
||||
|
||||
ItemBase ib = it.getItemBase();
|
||||
if(ib == null)
|
||||
|
||||
if (ib == null)
|
||||
break;
|
||||
if (ib.isDiscRune() || ib.getName().toLowerCase().contains("of the gods")) {
|
||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + ib.getName() + ". Are you tough enough to take it?");
|
||||
|
||||
ItemTemplate template = ItemTemplate.itemTemplates.get(it.getItemBaseID());
|
||||
|
||||
if (ib.isDiscRune() || template.item_base_name.toLowerCase().contains("of the gods")) {
|
||||
ChatSystemMsg chatMsg = new ChatSystemMsg(null, mob.getName() + " in " + mob.getParentZone().zoneName + " has found the " + template.item_base_name + ". Are you tough enough to take it?");
|
||||
chatMsg.setMessageType(10);
|
||||
chatMsg.setChannel(Enum.ChatChannelType.SYSTEM.getChannelID());
|
||||
DispatchMessage.dispatchMsgToAll(chatMsg);
|
||||
|
||||
Reference in New Issue
Block a user