Addition of generic getRandomEntry method.

This commit is contained in:
MobiusDevelopment
2019-10-29 13:52:24 +00:00
parent 60b7afe5e3
commit dde3a7274f
542 changed files with 1650 additions and 1309 deletions

View File

@@ -51,7 +51,7 @@ public class Toma extends AbstractNpcAI
{
if (event.equals("RESPAWN_TOMA"))
{
addSpawn(TOMA, LOCATIONS[getRandom(LOCATIONS.length)], false, TELEPORT_DELAY);
addSpawn(TOMA, getRandomEntry(LOCATIONS), false, TELEPORT_DELAY);
}
return null;
}

View File

@@ -59,7 +59,7 @@ public class TimakOrcTroopLeader extends AbstractNpcAI
{
addMinion((MonsterInstance) npc, is.getId());
}
npc.broadcastSay(ChatType.NPC_GENERAL, ON_ATTACK_MSG[getRandom(ON_ATTACK_MSG.length)]);
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(ON_ATTACK_MSG));
}
}
}

View File

@@ -116,7 +116,7 @@ public class FactionSystem extends AbstractNpcAI
{
if (npc != null)
{
npc.broadcastSay(ChatType.NPC_GENERAL, TEXTS[getRandom(TEXTS.length)], 1500);
npc.broadcastSay(ChatType.NPC_GENERAL, getRandomEntry(TEXTS), 1500);
}
break;
}

View File

@@ -95,8 +95,7 @@ public class Elpies extends Event
EVENT_ACTIVE = true;
final EventLocation[] locations = EventLocation.values();
final EventLocation randomLoc = locations[getRandom(locations.length)];
final EventLocation randomLoc = getRandomEntry(EventLocation.values());
CURRENT_ELPY_COUNT = 0;
final long despawnDelay = EVENT_DURATION_MINUTES * 60000;