GuildType lookup work
This commit is contained in:
@@ -2557,81 +2557,6 @@ public class mbEnums {
|
|||||||
GuildCharterType.templateLookup.put(guildCharterType.templateID, guildCharterType);
|
GuildCharterType.templateLookup.put(guildCharterType.templateID, guildCharterType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static GuildCharterType getGuildTypeFromCharter(Item charter) {
|
|
||||||
|
|
||||||
GuildCharterType charterType;
|
|
||||||
|
|
||||||
// Must be a valid charter object
|
|
||||||
|
|
||||||
if (charter.template.item_type.equals(ItemType.CHARTER) == false)
|
|
||||||
return GuildCharterType.NONE; //No guild Type
|
|
||||||
|
|
||||||
switch (charter.template.template_id) {
|
|
||||||
|
|
||||||
case 559:
|
|
||||||
charterType = GuildCharterType.CATHEDRAL;
|
|
||||||
break;
|
|
||||||
case 560:
|
|
||||||
charterType = GuildCharterType.MILITARY;
|
|
||||||
break;
|
|
||||||
case 561:
|
|
||||||
charterType = GuildCharterType.TEMPLE;
|
|
||||||
break;
|
|
||||||
case 562:
|
|
||||||
charterType = GuildCharterType.BARBARIAN;
|
|
||||||
break;
|
|
||||||
case 563:
|
|
||||||
charterType = GuildCharterType.RANGER;
|
|
||||||
break;
|
|
||||||
case 564:
|
|
||||||
charterType = GuildCharterType.AMAZON;
|
|
||||||
break;
|
|
||||||
case 565:
|
|
||||||
charterType = GuildCharterType.NOBLE;
|
|
||||||
break;
|
|
||||||
case 566:
|
|
||||||
charterType = GuildCharterType.WIZARD;
|
|
||||||
break;
|
|
||||||
case 567:
|
|
||||||
charterType = GuildCharterType.MERCENARY;
|
|
||||||
break;
|
|
||||||
case 568:
|
|
||||||
charterType = GuildCharterType.THIEVES;
|
|
||||||
break;
|
|
||||||
case 569:
|
|
||||||
charterType = GuildCharterType.DWARF;
|
|
||||||
break;
|
|
||||||
case 570:
|
|
||||||
charterType = GuildCharterType.HIGHCOURT;
|
|
||||||
break;
|
|
||||||
case 571:
|
|
||||||
charterType = GuildCharterType.VIRAKT;
|
|
||||||
break;
|
|
||||||
case 572:
|
|
||||||
charterType = GuildCharterType.SCOURGE;
|
|
||||||
break;
|
|
||||||
case 573:
|
|
||||||
charterType = GuildCharterType.KHREE;
|
|
||||||
break;
|
|
||||||
case 574:
|
|
||||||
charterType = GuildCharterType.CENTAUR;
|
|
||||||
break;
|
|
||||||
case 575:
|
|
||||||
charterType = GuildCharterType.UNHOLY;
|
|
||||||
break;
|
|
||||||
case 576:
|
|
||||||
charterType = GuildCharterType.PIRATE;
|
|
||||||
break;
|
|
||||||
case 577:
|
|
||||||
charterType = GuildCharterType.BRIALIA;
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
charterType = GuildCharterType.HERALD;
|
|
||||||
}
|
|
||||||
|
|
||||||
return charterType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static GuildCharterType getGuildTypeFromInt(int i) {
|
public static GuildCharterType getGuildTypeFromInt(int i) {
|
||||||
return GuildCharterType.values()[i];
|
return GuildCharterType.values()[i];
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class GuildCreationFinalizeHandler extends AbstractClientMsgHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
charterType = mbEnums.GuildCharterType.getGuildTypeFromCharter(charter);
|
charterType = mbEnums.GuildCharterType.templateLookup.get(charter.templateID);
|
||||||
|
|
||||||
if (charterType == null) {
|
if (charterType == null) {
|
||||||
ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND);
|
ErrorPopupMsg.sendErrorPopup(player, GuildManager.NO_CHARTER_FOUND);
|
||||||
|
|||||||
@@ -968,7 +968,7 @@ public class Guild extends AbstractWorldObject {
|
|||||||
|
|
||||||
public GuildCharterType getGuildType() {
|
public GuildCharterType getGuildType() {
|
||||||
try {
|
try {
|
||||||
return GuildCharterType.values()[this.charter];
|
return GuildCharterType.templateLookup.get(this.charter);//GuildCharterType.values()[this.charter];
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.error(e);
|
Logger.error(e);
|
||||||
return GuildCharterType.NONE;
|
return GuildCharterType.NONE;
|
||||||
|
|||||||
@@ -376,6 +376,9 @@ public class WorldServer {
|
|||||||
Logger.info("Loading Minion Bases.");
|
Logger.info("Loading Minion Bases.");
|
||||||
MinionType.InitializeMinions();
|
MinionType.InitializeMinions();
|
||||||
|
|
||||||
|
Logger.info("Loading Charter Types.");
|
||||||
|
mbEnums.GuildCharterType.init();
|
||||||
|
|
||||||
Logger.info("Loading Pirate Names.");
|
Logger.info("Loading Pirate Names.");
|
||||||
NPCManager.loadAllPirateNames();
|
NPCManager.loadAllPirateNames();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user