From 5cc1535c48a2f255e5449fd4b7cce62a37d46761 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Mon, 14 Jan 2019 11:06:11 -0200 Subject: Redesign mob hunter quest entirely. It's now fully dependent on Pet Detective. --- npc/functions/mobhunter.txt | 122 ++++++++++++++------------------------------ 1 file changed, 39 insertions(+), 83 deletions(-) (limited to 'npc/functions/mobhunter.txt') diff --git a/npc/functions/mobhunter.txt b/npc/functions/mobhunter.txt index 65513fa22..21bb55516 100644 --- a/npc/functions/mobhunter.txt +++ b/npc/functions/mobhunter.txt @@ -71,18 +71,26 @@ function script GHQ_GetMonsterIDByQuestID { ///////////////////////////////////////////////////////////////////////////////// // Handle milestone rewards; it does NOT update stuff +// Syntax: GHQ_GetRewardsOnMilestone ( rewardoverrideid ) function script GHQ_GetRewardsOnMilestone { // Check if you can store a Strange Coin (you really should) // Another item too, which I'm sure you won't get it anywhere. inventoryplace StrangeCoin, 1, NPCEyes, 1; + + // Global setup + .@q=getq(General_Hunter); + .@k=getq2(General_Hunter); + .@monsterId=GHQ_GetMonsterIDByQuestID(getq(General_Hunter)); + // Setup .@old=GHMEMO[getq(General_Hunter)]; .@new=getq2(General_Hunter); - .@blv=atoi(strmobinfo(3, GHQ_GetMonsterIDByQuestID(getq(General_Hunter)))); - .@bhp=atoi(strmobinfo(4, GHQ_GetMonsterIDByQuestID(getq(General_Hunter)))); + .@blv=atoi(strmobinfo(3, .@monsterId)); + .@bhp=atoi(strmobinfo(4, .@monsterId)); .@xp=0; .@gp=0; .@jp=0; + //if (getq2(General_Hunter) >= 10000) goto L_Finish; // 1st step: 1000 kills if (VarDiffValue(.@old, .@new, 1000)) { @@ -127,7 +135,22 @@ function script GHQ_GetRewardsOnMilestone { // 5th step: 10000 kills if (VarDiffValue(.@old, .@new, 10000)) { mesc l("Goal: @@/@@ reached!", .@new, 10000), 2; - mesc l("You must talk to Aidan to claim rewards!"); + + // Main reward + getitem StrangeCoin, .@blv*2; + Zeny=Zeny+.@bhp*25; // Maggot: 10.000 gp. That's plenty. + getexp .@bhp*BaseLevel, .@bhp; // The monster hp, once again, drastically affects + + // Grand Prize + switch (.@monsterId) { + case Pinkie: + getitem PinkHelmet, 1; + mesc l("And here's a rare for you, a @@! Good job!", getitemlink(PinkHelmet)); + break; + default: + mesc l("A new pet has been unlocked on the @@!", l("Pet Detective")); + } + } // Get reward (must have Job Exp) @@ -135,17 +158,21 @@ function script GHQ_GetRewardsOnMilestone { getexp .@xp, .@jp; Zeny=Zeny+.@gp; } + + // Update Grand Hunter memory + GHMEMO[.@q]=.@k; + return; } ///////////////////////////////////////////////////////////////////////////////// -// MobID, Place, Prize +// MobID, Place, Prize Override function script GHQ_Assign { // Arguments .@mobId =getarg(0); .@loc$ =getarg(1); - .@prize$=getarg(2); + .@prize$=getarg(2, ""); // Current Quest Status + vars .@id=GHQ_GetQuestIDByMonsterID(.@mobId); @@ -155,10 +182,15 @@ function script GHQ_Assign { //mesq l("Current Quest Progress: @@/10,000 kills", .@p); mesn; mes l("I represent the @@ Hunters. We hunt @@.", .@loc$, getmonsterlink(.@mobId)); - mes l("The great prize is @@. It can be claimed with Aidan, on Tulimshar.", .@prize$); + if (.@prize$ != "") + mes l("The great prize is @@.", .@prize$); + else + mes l("The great prize is to unlock a pet!"); + + GHQ_GetRewardsOnMilestone(); if (.@q == .@id) { .@m=GHQ_GetMonsterIDByQuestID(.@q); - mes l("You are currently hunting @@/10000 @@. When done, remember to claim rewards with Aidan, on Tulimshar!", .@p, getmonsterlink(.@m)); + mes l("You are currently hunting @@/10000 @@.", .@p, getmonsterlink(.@m)); next; closedialog; goodbye; @@ -173,7 +205,6 @@ function script GHQ_Assign { switch (@menu) { case 2: - GHQ_GetRewardsOnMilestone(); GHMEMO[getq(General_Hunter)]=getq2(General_Hunter); setq(General_Hunter, .@id, GHMEMO[.@id]); mesn; @@ -186,81 +217,6 @@ function script GHQ_Assign { } -// Handle rewards (must check beforehand) -function script GHQ_GetRewardsOnCompletion { - // Check if you can store a Strange Coin (you really should) - // Another item too, which I'm sure you won't get it anywhere. - inventoryplace StrangeCoin, 1, NPCEyes, 1; - mes l("Current progress: @@/10000 @@", getq2(General_Hunter), getmonsterlink(GHQ_GetMonsterIDByQuestID(getq(General_Hunter)))); - mes ""; - GHQ_GetRewardsOnMilestone(); - - GHMEMO[getq(General_Hunter)]=getq2(General_Hunter); - .@xp=atoi(strmobinfo(3, GHQ_GetMonsterIDByQuestID(getq(General_Hunter))))*3150; - getexp .@xp, 100; - switch (GHQ_GetMonsterIDByQuestID(getq(General_Hunter))) { - case Maggot: - setq General_Hunter, 0, 0; - Zeny=Zeny+25000; - inventoryplace MaggotCocoon, 1; - makepet(Maggot); // Works the same, even if I'm using mob_db constant - mesn; - mesq l("Good job, here is 25,000 GP and 15,750 EXP."); - mesq l("And your rare, a @@! Enjoy!", getitemlink(MaggotCocoon)); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - case Snake: - setq General_Hunter, 0, 0; - Zeny=Zeny+300000; - getitem StrangeCoin, 80; - mesn; - mesq l("Good job, here is @@ GP and @@ @@!", format_number(300000), format_number(80), getitemlink(StrangeCoin)); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - case Scorpion: - setq General_Hunter, 0, 0; - Zeny=Zeny+100000; - mesn; - mesq l("Good job, here is 100,000 GP!"); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - case ForestMushroom: - setq General_Hunter, 0, 0; - Zeny=Zeny+175000; - getitem StrangeCoin, 60; - mesn; - mesq l("Good job, here is @@ GP and @@ @@!", format_number(175000), format_number(60), getitemlink(StrangeCoin)); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - case Pinkie: - setq General_Hunter, 0, 0; - getitem PinkHelmet, 1; - getexp 15750, 100; - mesn; - mesq l("And your rare, a @@! Enjoy!", getitemlink(PinkHelmet)); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - case Moggun: - setq General_Hunter, 0, 0; - Zeny=Zeny+150000; - getitem StrangeCoin, 60; - mesn; - mesq l("Good job, here is @@ GP and @@ @@!", format_number(150000), format_number(60), getitemlink(StrangeCoin)); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - case Fluffy: - setq General_Hunter, 0, 0; - Zeny=Zeny+125000; - getitem StrangeCoin, 60; - mesn; - mesq l("Good job, here is @@ GP and @@ @@!", format_number(125000), format_number(60), getitemlink(StrangeCoin)); - mesc l("Gained @@ XP", format_number(.@xp)); - close; - } - mesc l("ILLEGAL SCRIPT LOGIC REACHED, PLEASE REPORT. (GHQ_GROC)", 1); - return; -} - function script mobhunter { if (getq(General_Hunter) == 0) return; -- cgit v1.2.3-70-g09d2