Caution deleting NPCs with active quest timers.
This commit is contained in:
@@ -474,8 +474,7 @@ public class FeedableBeasts extends AbstractNpcAI
|
||||
{
|
||||
_feedInfo.remove(npc.getObjectId());
|
||||
}
|
||||
// despawn the mad cow
|
||||
npc.deleteMe();
|
||||
|
||||
// spawn the new mob
|
||||
final Attackable nextNpc = (Attackable) addSpawn(MAD_COW_POLYMORPH.get(npc.getId()), npc);
|
||||
|
||||
@@ -484,6 +483,9 @@ public class FeedableBeasts extends AbstractNpcAI
|
||||
nextNpc.setRunning();
|
||||
nextNpc.addDamageHate(player, 0, 99999);
|
||||
nextNpc.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, player);
|
||||
|
||||
// despawn the mad cow
|
||||
npc.deleteMe();
|
||||
}
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
|
||||
@@ -169,9 +169,9 @@ public class Alarm extends AbstractNpcAI
|
||||
{
|
||||
npc0.getVariables().set("SPAWNED", false);
|
||||
}
|
||||
npc.deleteMe();
|
||||
setMemoState(player, ART_OF_PERSUASION_ID, 4);
|
||||
htmltext = "32367-184_09.html";
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -189,9 +189,9 @@ public class Alarm extends AbstractNpcAI
|
||||
npc0.getVariables().set("SPAWNED", false);
|
||||
}
|
||||
|
||||
npc.deleteMe();
|
||||
setMemoState(player, NIKOLAS_COOPERATION_ID, 4);
|
||||
htmltext = "32367-185_09.html";
|
||||
npc.deleteMe();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -222,9 +222,9 @@ public class StakatoNest extends AbstractNpcAI
|
||||
if (npcId > 0)
|
||||
{
|
||||
npc.getSpawn().decreaseCount(npc);
|
||||
npc.deleteMe();
|
||||
final Npc spawned = addSpawn(npcId, npc.getX(), npc.getY(), npc.getZ(), npc.getHeading(), false, 0, true);
|
||||
addAttackPlayerDesire(spawned, player);
|
||||
npc.deleteMe();
|
||||
}
|
||||
return super.onAdvEvent(event, npc, player);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,6 @@ public class Baium extends AbstractNpcAI
|
||||
{
|
||||
if (getStatus() == ALIVE)
|
||||
{
|
||||
npc.deleteMe();
|
||||
setStatus(IN_FIGHT);
|
||||
_baium = (GrandBossInstance) addSpawn(BAIUM, BAIUM_LOC, false, 0);
|
||||
_baium.disableCoreAI(true);
|
||||
@@ -213,6 +212,7 @@ public class Baium extends AbstractNpcAI
|
||||
startQuestTimer("WAKEUP_ACTION", 50, _baium, null);
|
||||
startQuestTimer("MANAGE_EARTHQUAKE", 2000, _baium, player);
|
||||
startQuestTimer("CHECK_ATTACK", 60000, _baium, null);
|
||||
npc.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -104,8 +104,8 @@ public class IceQueensCastle extends AbstractInstance
|
||||
if (npc != null)
|
||||
{
|
||||
playMovie(player, Movie.SC_BOSS_FREYA_FORCED_DEFEAT);
|
||||
startQuestTimer("TIMER_PC_LEAVE", 24000, null, player);
|
||||
npc.deleteMe();
|
||||
startQuestTimer("TIMER_PC_LEAVE", 24000, npc, player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ public class LastImperialTomb extends AbstractInstance
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
disablePlayers(world);
|
||||
final Npc activeScarlet = world.getParameters().getObject("activeScarlet", Npc.class);
|
||||
activeScarlet.abortAttack();
|
||||
@@ -492,39 +492,39 @@ public class LastImperialTomb extends AbstractInstance
|
||||
activeScarlet.setImmobilized(true);
|
||||
activeScarlet.disableAllSkills();
|
||||
playRandomSong(world);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_1", 2000, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_1", 2000, null, player, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_1":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final Npc frintezza = world.getParameters().getObject("frintezza", Npc.class);
|
||||
broadcastPacket(world, new SocialAction(frintezza.getObjectId(), 4));
|
||||
broadcastPacket(world, new SpecialCamera(frintezza, 250, 120, 15, 0, 1000, 0, 0, 1, 0, 0));
|
||||
broadcastPacket(world, new SpecialCamera(frintezza, 250, 120, 15, 0, 10000, 0, 0, 1, 0, 0));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_2", 7000, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_2", 7000, null, player, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_2":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final Npc frintezza = world.getParameters().getObject("frintezza", Npc.class);
|
||||
broadcastPacket(world, new MagicSkillUse(frintezza, frintezza, 5006, 1, 34000, 0));
|
||||
broadcastPacket(world, new SpecialCamera(frintezza, 500, 70, 15, 3000, 10000, 0, 0, 1, 0, 0));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_3", 3000, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_3", 3000, null, player, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_3":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final Npc frintezza = world.getParameters().getObject("frintezza", Npc.class);
|
||||
broadcastPacket(world, new SpecialCamera(frintezza, 2500, 90, 12, 6000, 10000, 0, 0, 1, 0, 0));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_4", 3000, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_4", 3000, null, player, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_4":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final Npc activeScarlet = world.getParameters().getObject("activeScarlet", Npc.class);
|
||||
final Location scarletLocation = activeScarlet.getLocation();
|
||||
int newHeading = 0;
|
||||
@@ -540,30 +540,30 @@ public class LastImperialTomb extends AbstractInstance
|
||||
world.setParameter("newHeading", newHeading);
|
||||
broadcastPacket(world, new SpecialCamera(activeScarlet, 250, newHeading, 12, 0, 1000, 0, 0, 1, 0, 0));
|
||||
broadcastPacket(world, new SpecialCamera(activeScarlet, 250, newHeading, 12, 0, 10000, 0, 0, 1, 0, 0));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_5", 500, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_5", 500, null, player, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_5":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final Npc activeScarlet = world.getParameters().getObject("activeScarlet", Npc.class);
|
||||
final int newHeading = world.getParameters().getInt("newHeading");
|
||||
activeScarlet.doDie(activeScarlet);
|
||||
broadcastPacket(world, new SpecialCamera(activeScarlet, 450, newHeading, 14, 8000, 8000, 0, 0, 1, 0, 0));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_6", 6250, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_7", 7200, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_6", 6250, null, player, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_7", 7200, null, player, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_6":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final Npc activeScarlet = world.getParameters().getObject("activeScarlet", Npc.class);
|
||||
activeScarlet.deleteMe();
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_7":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Instance world = player.getInstanceWorld();
|
||||
final int newHeading = world.getParameters().getInt("newHeading");
|
||||
final Location scarletLocation = world.getParameters().getLocation("scarletLocation");
|
||||
final Npc activeScarlet = addSpawn(SCARLET2, scarletLocation, false, 0, false, world.getId());
|
||||
@@ -573,24 +573,22 @@ public class LastImperialTomb extends AbstractInstance
|
||||
activeScarlet.setImmobilized(true);
|
||||
activeScarlet.disableAllSkills();
|
||||
broadcastPacket(world, new SpecialCamera(activeScarlet, 450, newHeading, 12, 500, 14000, 0, 0, 1, 0, 0));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_8", 8100, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_8", 8100, activeScarlet, null, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_8":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Npc activeScarlet = world.getParameters().getObject("activeScarlet", Npc.class);
|
||||
broadcastPacket(world, new SocialAction(activeScarlet.getObjectId(), 2));
|
||||
broadcastPacket(world, new SocialAction(npc.getObjectId(), 2));
|
||||
startQuestTimer("SCARLET_SECOND_MORPH_CAMERA_9", 9000, npc, null, false);
|
||||
break;
|
||||
}
|
||||
case "SCARLET_SECOND_MORPH_CAMERA_9":
|
||||
{
|
||||
final Instance world = npc.getInstanceWorld();
|
||||
final Npc activeScarlet = world.getParameters().getObject("activeScarlet", Npc.class);
|
||||
activeScarlet.setInvul(false);
|
||||
activeScarlet.setImmobilized(false);
|
||||
activeScarlet.enableAllSkills();
|
||||
npc.setInvul(false);
|
||||
npc.setImmobilized(false);
|
||||
npc.enableAllSkills();
|
||||
enablePlayers(world);
|
||||
break;
|
||||
}
|
||||
@@ -702,7 +700,7 @@ public class LastImperialTomb extends AbstractInstance
|
||||
if (npc.isScriptValue(1) && (npc.getCurrentHp() < (npc.getMaxHp() * 0.20)))
|
||||
{
|
||||
npc.setScriptValue(2);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH", 1000, npc, null, false);
|
||||
startQuestTimer("SCARLET_SECOND_MORPH", 1000, null, attacker, false);
|
||||
}
|
||||
}
|
||||
if (skill != null)
|
||||
|
||||
@@ -60,8 +60,8 @@ public class QueenShyeed extends AbstractNpcAI
|
||||
{
|
||||
if (!npc.isDead())
|
||||
{
|
||||
npc.deleteMe();
|
||||
startRespawn();
|
||||
npc.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -258,8 +258,8 @@ public class AltarOfShilen extends AbstractInstance
|
||||
}
|
||||
world.setStatus(7);
|
||||
onStatusChanged(world);
|
||||
npc.deleteMe();
|
||||
cancelQuestTimer("check_player", npc, null);
|
||||
npc.deleteMe();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user