diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-06-09 15:35:51 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-06-09 15:35:51 -0300 |
commit | 0ed191532f85812bfd1dcd74e834084ee4963f2f (patch) | |
tree | f88ae8ed49fce937028f7373b416c209a2f0a3a1 | |
parent | 6a686144d7d36761e6e69c100f836e932367d17e (diff) | |
download | serverdata-0ed191532f85812bfd1dcd74e834084ee4963f2f.tar.gz serverdata-0ed191532f85812bfd1dcd74e834084ee4963f2f.tar.bz2 serverdata-0ed191532f85812bfd1dcd74e834084ee4963f2f.tar.xz serverdata-0ed191532f85812bfd1dcd74e834084ee4963f2f.zip |
Fix *possible* bugs on Dan's Pious
-rw-r--r-- | npc/002-1/dan.txt | 25 |
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; |