Addition of generic getRandomEntry method.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user