diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-01-24 17:01:12 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-01-24 17:01:12 -0300 |
commit | b0426bb0f242a5aad76dee782801538feb4984fe (patch) | |
tree | 49bb9595be2b5000017e40a90bac607b10919604 | |
parent | d021f436122b5417ae6774d90a30a972a888bcf5 (diff) | |
download | serverdata-b0426bb0f242a5aad76dee782801538feb4984fe.tar.gz serverdata-b0426bb0f242a5aad76dee782801538feb4984fe.tar.bz2 serverdata-b0426bb0f242a5aad76dee782801538feb4984fe.tar.xz serverdata-b0426bb0f242a5aad76dee782801538feb4984fe.zip |
Commander Cadis - Optimize code for reuse
-rw-r--r-- | npc/025-1/commander.txt | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/npc/025-1/commander.txt b/npc/025-1/commander.txt index 366d986ec..2b9b93b09 100644 --- a/npc/025-1/commander.txt +++ b/npc/025-1/commander.txt @@ -22,6 +22,7 @@ OnInit: ///////////////////////////////////////////////////////////////////////////////// 025-1,59,86,0 script Commander Cadis NPC_BRGUARD_SWORD,{ + function cadisReward; mesn; mesq l("Greetings %s, I am %s, I am in charge of monster extermination.", (strcharinfo(0) == $MOST_HEROIC$ ? lg("Hero") : lg("Adventurer")), .name$); next; @@ -33,6 +34,8 @@ OnInit: next; mesn; mesq l("You will be rewarded by me shall you succeed in any of the tasks."); + mesc l("%s: Once accepted, you must complete them before taking another one.", b(l("WARNING"))); + // Well, we *could* make it more GHQ-like but lazy devs are lazy. next; do { @@ -63,8 +66,12 @@ OnInit: close; L_SlimeHunter: - .@kill=getq2(FortressQuest_SlimeHunter); - .@rewa=getq3(FortressQuest_SlimeHunter); + cadisReward(FortressQuest_SlimeHunter); + close; + +function cadisReward { + .@kill=getq2(getarg(0)); + .@rewa=getq3(getarg(0)); mesn; mesq l("Thus far you've slain %s/%s %s for me!", fnum(.@kill), fnum(.million), b(l("Slimes"))); inventoryplace NPCEyes, 4, Iten, 2; @@ -72,7 +79,7 @@ L_SlimeHunter: // ***** ***** ***** Rewards ***** ***** ***** if (.@kill >= .tier1 && .@rewa < 1) { mesc l("Milestone reached: %s kills", fnum(.tier1)); - setq3 FortressQuest_SlimeHunter, 1; + setq3 getarg(0), 1; getitem MercenaryBoxsetDD, 3; getitem SacredImmortalityPotion, 2; getitem MercenaryBoxsetE, 1; @@ -80,7 +87,7 @@ L_SlimeHunter: if (.@kill >= .tier2 && .@rewa < 2) { mesc l("Milestone reached: %s kills", fnum(.tier2)); - setq3 FortressQuest_SlimeHunter, 2; + setq3 getarg(0), 2; getitem MercenaryBoxsetEE, 1; getitem MagicApple, 1; getitem EquipmentBlueprintE, 1; @@ -89,7 +96,7 @@ L_SlimeHunter: if (.@kill >= .tier3 && .@rewa < 3) { mesc l("Milestone reached: %s kills", fnum(.tier3)); - setq3 FortressQuest_SlimeHunter, 3; + setq3 getarg(0), 3; getitem MercenaryBoxsetEE, 2; getitem StrangeCoin, 50; getitem EarthPowder, 2; @@ -98,7 +105,7 @@ L_SlimeHunter: if (.@kill >= .tier4 && .@rewa < 4) { mesc l("Milestone reached: %s kills", fnum(.tier4)); - setq3 FortressQuest_SlimeHunter, 4; + setq3 getarg(0), 4; getitem MercenaryBoxsetEE, 3; getitem ElixirOfLife, 5; getitem EarthPowder, 2; @@ -109,8 +116,8 @@ L_SlimeHunter: // Quest complete if (.@kill >= .million) { mesc b(l("Quest complete: Congratulations!")), 3; - setq1 FortressQuest_SlimeHunter, 2; - setq3 FortressQuest_SlimeHunter, 5; + setq1 getarg(0), 2; + setq3 getarg(0), 5; getitem MercenaryBoxsetEE, 5; getitem StrangeCoin, 100; getitem EarthPowder, 3; @@ -118,7 +125,8 @@ L_SlimeHunter: getitem MysteriousFruit, 1; //getitem PrismGift, 1; } - close; + return; +} OnInit: .sex = G_MALE; |