diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-09 11:00:49 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-09 11:00:49 -0300 |
commit | 8a4bf716002a017de77fe7df301ef8e4aaf00a2e (patch) | |
tree | 4947d0b015baad639fa07133369e9a09c8a468bc /npc/001-2-23/ratto.txt | |
download | serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.gz serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.bz2 serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.tar.xz serverdata-8a4bf716002a017de77fe7df301ef8e4aaf00a2e.zip |
Initial commit
Diffstat (limited to 'npc/001-2-23/ratto.txt')
-rw-r--r-- | npc/001-2-23/ratto.txt | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/npc/001-2-23/ratto.txt b/npc/001-2-23/ratto.txt new file mode 100644 index 00000000..24bb1e1a --- /dev/null +++ b/npc/001-2-23/ratto.txt @@ -0,0 +1,98 @@ +// Evol Script. +// Author: +// Ablu +// Alastrim +// Jesusalva +// Reid +// Description: +// Ratto killer. +// The only "lose" conditions are: +// 1- dying, but this is not handled anywhere +// 2- Time running out, Peter handles that automatically. +// Note that if you die here, you won't be able to return and will need to +// start the quest over again. (I wonder why it is not handled by an OnDeath event) +// iirc, logout will automatically destroy the instance and clear timers, so it +// doesn't needs the script writer to handle logout cleanup (only death). + +001-2-23,0,0,0 script RattosControl#Artis NPC_HIDDEN,{ + end; + +// Each monster on the basement have its own respawn cycle. +// We use a XOR (^) operand to mark that the killed monster is not dead anymore. +// This is to reproduce as accurate as possible the legacy behavior of the quest. +OnRatto1Respawn: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2^1; + areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl#Artis::OnRatto1Death"; + end; + +OnRatto2Respawn: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2^2; + areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl#Artis::OnRatto2Death"; + end; + +OnRatto3Respawn: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2^4; + areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl#Artis::OnRatto3Death"; + end; + +OnRatto4Respawn: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2^8; + areamonster @MAP_NAME$, 23, 19, 57, 40, strmobinfo(1, @pt_mob), @pt_mob, 1, "RattosControl#Artis::OnRatto4Death"; + end; + +// When you kill a monster on basement, we must check the mob as dead, see if you +// finally killed the last one and quest is complete, and add a timer to respawn it +// after 1m25s (for flavor purposes, makes quest harder though) +OnRatto1Death: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2|1; + .@q2=getq2(ShipQuests_Peter); + if (.@q2 == 15) + goto L_Victor; + addtimer(85000, "RattosControl#Artis::OnRatto1Respawn"); + end; + +OnRatto2Death: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2|2; + .@q2=getq2(ShipQuests_Peter); + if (.@q2 == 15) + goto L_Victor; + addtimer(85000, "RattosControl#Artis::OnRatto2Respawn"); + end; + +OnRatto3Death: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2|4; + .@q2=getq2(ShipQuests_Peter); + if (.@q2 == 15) + goto L_Victor; + addtimer(85000, "RattosControl#Artis::OnRatto3Respawn"); + end; + +OnRatto4Death: + .@q2=getq2(ShipQuests_Peter); + setq2 ShipQuests_Peter, .@q2|8; + .@q2=getq2(ShipQuests_Peter); + if (.@q2 == 15) + goto L_Victor; + addtimer(85000, "RattosControl#Artis::OnRatto4Respawn"); + end; + +// This label is reached when all rattos are dead. We clear the respawn timers +// (as we are going to delete the instance map anyway), warp you outside, and +// from there onwards, Peter handles properly rewarding you. +L_Victor: + deltimer("RattosControl#Artis::OnRatto1Respawn"); + deltimer("RattosControl#Artis::OnRatto2Respawn"); + deltimer("RattosControl#Artis::OnRatto3Respawn"); + deltimer("RattosControl#Artis::OnRatto4Respawn"); + addtimercount("Peter#Artis::OnTimeout", 5000); + addtimer(5000, "Peter#Artis::OnDone"); + dispbottom l("It looks like all monsters were killed."); + end; +} |