summaryrefslogtreecommitdiff
path: root/npc
diff options
context:
space:
mode:
Diffstat (limited to 'npc')
-rw-r--r--npc/002-1/dan.txt25
1 files changed, 14 insertions, 11 deletions
diff --git a/npc/002-1/dan.txt b/npc/002-1/dan.txt
index 28a670d3e..5dd9a0153 100644
--- a/npc/002-1/dan.txt
+++ b/npc/002-1/dan.txt
@@ -91,12 +91,15 @@ OnInit:
// TODO this code below is bad and should be entirely rewritten
002-1,0,0,0 script PiouSpwn NPC_HIDDEN,{
function DanCheck {
- if (getq(ShipQuests_Dan) != 1)
- end;
- .@t=getq2(ShipQuests_Dan);
- if (.@t+1 >= 12) setq ShipQuests_Dan, 2, 0;
- if (.@t+1 < 12) setq2 ShipQuests_Dan, .@t+1;
- dispbottom l("@@/@@", .@t+1, 12);
+ if (player_attached()) {
+ if (getq(ShipQuests_Dan) != 1)
+ return;
+ .@t=getq2(ShipQuests_Dan);
+ if (.@t+1 >= 12) setq ShipQuests_Dan, 2, 0;
+ if (.@t+1 < 12) setq2 ShipQuests_Dan, .@t+1;
+ dispbottom l("@@/@@", .@t+1, 12);
+ }
+ return;
}
OnFakeKill:
@@ -104,27 +107,27 @@ OnFakeKill:
end;
OnRespawnPiou1:
- if (getq(ShipQuests_Dan) == 1) DanCheck();
+ DanCheck();
sleep 49000;
areamonster(instance_mapname("002-1"), 52, 32, 73, 41, "Piou", Piou, 1, instance_npcname("PiouSpwn")+"::OnRespawnPiou1");
end;
OnRespawnPiou2:
- if (getq(ShipQuests_Dan) == 1) DanCheck();
+ DanCheck();
sleep 51000;
areamonster(instance_mapname("002-1"), 52, 32, 73, 41, "Piou", Piou, 1, instance_npcname("PiouSpwn")+"::OnRespawnPiou2");
end;
OnRespawnPiou3:
- if (getq(ShipQuests_Dan) == 1) DanCheck();
+ DanCheck();
sleep 49500;
areamonster(instance_mapname("002-1"), 52, 32, 73, 41, "Piou", Piou, 1, instance_npcname("PiouSpwn")+"::OnRespawnPiou3");
end;
OnRespawnPiou4:
- if (getq(ShipQuests_Dan) == 1) DanCheck();
+ DanCheck();
sleep 51500;
areamonster(instance_mapname("002-1"), 52, 32, 73, 41, "Piou", Piou, 1, instance_npcname("PiouSpwn")+"::OnRespawnPiou4");
end;
OnRespawnPiou5:
- if (getq(ShipQuests_Dan) == 1) DanCheck();
+ DanCheck();
sleep 50000;
areamonster(instance_mapname("002-3"), 31, 26, 40, 31, "Piou", Piou, 1, instance_npcname("PiouSpwn")+"::OnRespawnPiou5");
end;