diff options
author | HoraK-FDF <horak-fdf@web.de> | 2023-07-14 15:42:41 +0000 |
---|---|---|
committer | Led Mitz <smoothshifter@tuta.io> | 2023-07-14 15:42:41 +0000 |
commit | b048e5c26c46f542d99b4f0660fb8bf85e7f0edf (patch) | |
tree | faabde58de069fd2cee0e837a7ac762f3518a435 /world/map/npc/mobs/mob_kill_handler.txt | |
parent | d8eb983f077617326bf86900a9f249ab9171d4dd (diff) | |
download | serverdata-b048e5c26c46f542d99b4f0660fb8bf85e7f0edf.tar.gz serverdata-b048e5c26c46f542d99b4f0660fb8bf85e7f0edf.tar.bz2 serverdata-b048e5c26c46f542d99b4f0660fb8bf85e7f0edf.tar.xz serverdata-b048e5c26c46f542d99b4f0660fb8bf85e7f0edf.zip |
mob kill handler
Diffstat (limited to 'world/map/npc/mobs/mob_kill_handler.txt')
-rw-r--r-- | world/map/npc/mobs/mob_kill_handler.txt | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/world/map/npc/mobs/mob_kill_handler.txt b/world/map/npc/mobs/mob_kill_handler.txt new file mode 100644 index 00000000..5542dcdb --- /dev/null +++ b/world/map/npc/mobs/mob_kill_handler.txt @@ -0,0 +1,66 @@ + +-|script|#MobKillHandlerInit|32767 +{ + end; + +OnInit: + setarray $@QuestMobs, Maggot, Scorpion, RedScorpion, BlackScorpion, Pinkie, Fluffy, EasterFluffy, Mouboo, Squirrel, TameScorpion, HouseMaggot, AngryScorpion, + Terranite, Yeti, Reinboo, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar, Santaboo, Pollett; + setarray $@NatureKarmaGood, Scorpion, RedScorpion, BlackScorpion, AngryScorpion, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar; + setarray $@NatureKarmaBad, Pinkie, Fluffy, EasterFluffy, Mouboo, Squirrel, Reinboo, Santaboo, Pollett; + setarray $@NatureKarmaBadVal, 3, 3, 3, 4, 2, 3, 3, 3; + end; +} + +function|script|MobKillHandler +{ + if (@mobID < 1002) goto L_Return; + + set .@find, array_search(@mobID, $@QuestMobs); + if (.@find < 0) goto L_Return; + + callfunc "ValonCount"; + if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobID == $@ValonMob[@valon_mob])) + goto L_ValonMobKill; + goto L_NatureKarma; + +L_ValonMobKill: + callfunc "AddValonCntMask"; + goto L_NatureKarma; + +L_NatureKarma: + set .@find, array_search(@mobID, $@NatureKarmaGood); + if (.@find >= 0) goto L_Good; + set .@find, array_search(@mobID, $@NatureKarmaBad); + if (.@find >= 0) goto L_Bad; + goto L_Celestia; + + // Attitude adjustment for the witch (can we refactor this to another function? Not sure about max. recursion depth) + +L_Bad: + set @value, $@NatureKarmaBadVal[.@find]; + callfunc "QuestSagathaAnnoy"; + goto L_Celestia; + +L_Good: + set @value, 1; + callfunc "QuestSagathaHappy"; + goto L_Celestia; + +L_Celestia: + if (QL_CELESTIA < 5 || QL_CELESTIA >= 205 || @mobID != Yeti) goto L_Terranite; + set QL_CELESTIA, QL_CELESTIA + 1; + if (QL_CELESTIA == 205) + message strcharinfo(0), "Yeti : ##3This should be enough yetis killed to please Celestia."; + goto L_Terranite; + +L_Terranite: + if (TERRAC < 1 || TERRAC > 1500 || @mobID != Terranite) goto L_Return; + if (TERRAC % 100 == 0) + message strcharinfo(0), "Terranite : ##3Total Terranites Slain: "+TERRAC; + set TERRAC, TERRAC + 1; + goto L_Return; + +L_Return: + return; +} |