Cleanup for PlaySound, QuestList and TutorialCloseHtml serverpackets.

This commit is contained in:
MobiusDevelopment
2020-01-24 15:41:54 +00:00
parent 44f5fbdcef
commit 7307d8d53d
38 changed files with 171 additions and 145 deletions

View File

@@ -958,7 +958,7 @@ public class Antharas extends Quest
{
if ((npc.getNpcId() == 29019) || (npc.getNpcId() == 29066) || (npc.getNpcId() == 29067) || (npc.getNpcId() == 29068))
{
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS01_D", npc));
if (!npc.getSpawn().is_customBossInstance())
{

View File

@@ -418,7 +418,7 @@ public class Baium extends Quest
@Override
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
{
npc.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS01_D", npc));
if (!npc.getSpawn().is_customBossInstance())
{

View File

@@ -146,7 +146,7 @@ public class Core extends Quest
public void spawnBoss(GrandBossInstance npc)
{
GrandBossManager.getInstance().addBoss(npc);
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS01_A", npc));
// Spawn minions
Attackable mob;
Location spawnLocation;
@@ -223,11 +223,10 @@ public class Core extends Quest
final String name = npc.getName();
if (npcId == CORE)
{
final int objId = npc.getObjectId();
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, objId, npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new CreatureSay(objId, 0, name, "A fatal error has occurred."));
npc.broadcastPacket(new CreatureSay(objId, 0, name, "System is being shut down..."));
npc.broadcastPacket(new CreatureSay(objId, 0, name, "......"));
npc.broadcastPacket(new PlaySound(1, "BS02_D", npc));
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, name, "A fatal error has occurred."));
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, name, "System is being shut down..."));
npc.broadcastPacket(new CreatureSay(npc.getObjectId(), 0, name, "......"));
_firstAttacked = false;
if (!npc.getSpawn().is_customBossInstance())

View File

@@ -102,7 +102,7 @@ public class DrChaos extends Quest
final NpcInstance golem = addSpawn(CHAOS_GOLEM, 94640, -112496, -3336, 0, false, 0);
_golemSpawned = 1;
startQuestTimer("6", 1000, golem, player);
player.sendPacket(new PlaySound(1, "Rm03_A", 0, 0, 0, 0, 0));
player.sendPacket(new PlaySound(1, "Rm03_A"));
}
break;
}

View File

@@ -1232,7 +1232,7 @@ public class Frintezza extends Quest
if (npc.isDead())
{
_onMorph = 1;
_zone.broadcastPacket(new PlaySound(1, "BS01_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
_zone.broadcastPacket(new PlaySound(1, "BS01_D", npc));
startQuestTimer("attack_stop", 0, _frintezza, null);
startQuestTimer("stop_pc", 0, npc, null);

View File

@@ -234,7 +234,7 @@ public class Orfen extends Quest
{
if (npc.getNpcId() == ORFEN)
{
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS02_D", npc));
if (!npc.getSpawn().is_customBossInstance())
{

View File

@@ -150,7 +150,7 @@ public class QueenAnt extends Quest
private void spawnBoss(GrandBossInstance npc)
{
startQuestTimer("ACTION", 10000, npc, null, true);
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS02_D", npc));
startQuestTimer("SPAWN_ROYAL", 1000, npc, null);
startQuestTimer("NURSES_SPAWN", 1000, npc, null);
startQuestTimer("CHECK_MINIONS_ZONE", 30000, npc, null, true);
@@ -365,7 +365,7 @@ public class QueenAnt extends Quest
if (npcId == QUEEN)
{
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS02_D", npc));
if (!npc.getSpawn().is_customBossInstance())
{

View File

@@ -599,7 +599,7 @@ public class Valakas extends Quest
public String onKill(NpcInstance npc, PlayerInstance killer, boolean isPet)
{
npc.broadcastPacket(new SpecialCamera(npc.getObjectId(), 1700, 2000, 130, -1, 0));
npc.broadcastPacket(new PlaySound(1, "B03_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "B03_D", npc));
startQuestTimer("1111", 500, npc, null);
if (!npc.getSpawn().is_customBossInstance())
@@ -969,7 +969,7 @@ public class Valakas extends Quest
{
if ((obj instanceof PlayerInstance) && Util.checkIfInRange(10000, npc, obj, true))
{
((Creature) obj).sendPacket(new PlaySound(1, "B03_A", 1, npc.getObjectId(), 212852, -114842, -1632));
((Creature) obj).sendPacket(new PlaySound(1, "B03_A", npc));
((Creature) obj).sendPacket(new SocialAction(npc.getObjectId(), 3));
}
}

View File

@@ -205,7 +205,7 @@ public class Zaken extends Quest
}
GrandBossManager.getInstance().addBoss(npc);
npc.broadcastPacket(new PlaySound(1, "BS01_A", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS01_A", npc));
_ai0 = 0;
_ai1 = npc.getX();
_ai2 = npc.getY();
@@ -857,7 +857,7 @@ public class Zaken extends Quest
if (npcId == ZAKEN)
{
npc.broadcastPacket(new PlaySound(1, "BS02_D", 1, npc.getObjectId(), npc.getX(), npc.getY(), npc.getZ()));
npc.broadcastPacket(new PlaySound(1, "BS02_D", npc));
if (!npc.getSpawn().is_customBossInstance())
{

View File

@@ -125,7 +125,7 @@ public class Q635_InTheDimensionalRift extends Quest
qs.exitQuest(true);
htmltext = "1.htm";
}
else if (player.getAllActiveQuests().length > MAX_QUEST)
else if (player.getAllActiveQuests().size() > MAX_QUEST)
{
qs.exitQuest(true);
htmltext = "1a.htm";

View File

@@ -429,7 +429,7 @@ public class OracleTeleport extends Quest
htmltext = "1.htm";
st.exitQuest(true);
}
else if (player.getAllActiveQuests().length >= 25)
else if (player.getAllActiveQuests().size() >= 25)
{
htmltext = "1a.htm";
st.exitQuest(true);
@@ -452,7 +452,7 @@ public class OracleTeleport extends Quest
htmltext = "ziggurat_lowlevel.htm";
st.exitQuest(true);
}
else if (player.getAllActiveQuests().length >= 25)
else if (player.getAllActiveQuests().size() >= 25)
{
player.sendPacket(SystemMessageId.TOO_MANY_QUESTS);
st.exitQuest(true);