summaryrefslogblamecommitdiff
path: root/npc/functions/mobhunter.txt
blob: 9c3f7657116c20bb710757da8622ea7b13e63344 (plain) (tree)
1
2
3
4
5


                                   
                                       
 














                                                                                











                                                         
                            

                     


                     


                     


                                                                                      















                                                         
                            
                  
               
                                  
                  


                          


                          


                                                                                      





                     
                      
                                         






                                            

                              
         
                                                             
         

                                                                                          
                      
                                           
                                                                                                                                                 



                    



                                                                                                         









                                                                          
              
     

                


 
// TMW-2 Script
// Author: Jesusalva
// Desc:   Grand Hunter Quest Utils
// Note:   Remember to update Aidan too

function	script	mobhunter	{
    if (getq(General_Hunter) == 0)
        return;

    .@ghd=getq(General_Hunter);
    if (killedrid == GHQ_GetMonsterIDByQuestID(.@ghd)) {
        setq2 General_Hunter, getq2(General_Hunter)+1;
        .@ghd=getq2(General_Hunter);
        if (! (.@ghd % 1000))
            dispbottom l("Grand Hunter Quest: @@/10,000", format_number(.@ghd));
    }
    return;

}

// MobID
function	script	GHQ_GetQuestIDByMonsterID	{
    switch (getarg(0)) {
        case Maggot:
            return 1;
            break;
        case Snake:
            return 2;
            break;
        case Scorpion:
            return 3;
            break;
        case ForestMushroom:
            return 4;
            break;
        case Pinkie:
            return 5;
            break;
        case Moggun:
            return 6;
            break;
        default:
            debugmes "Invalid mob ID: " + getarg(0);
            dispbottom l("ERROR, Please report: GHQ GQID: Invalid ID: @@", getarg(0));
            return 0;
            break;
    }

}

// QuestID (basically reverses the previous code)
function	script	GHQ_GetMonsterIDByQuestID	{
    switch (getarg(0)) {
        case 1:
            return Maggot;
            break;
        case 2:
            return Snake;
            break;
        case 3:
            return Scorpion;
            break;
        case 4:
            return ForestMushroom;
            break;
        case 5:
            return Pinkie;
            break;
        case 6:
            return Moggun;
            break;
        default:
            debugmes "Invalid quest ID: " + getarg(0);
            dispbottom l("ERROR, Please report: GHQ GMID: Invalid ID: @@", getarg(0));
            return 0;
            break;
    }

}

// MobID, Place, Prize
function	script	GHQ_Assign	{
    // Arguments
    .@mobId =getarg(0);
    .@loc$  =getarg(1);
    .@prize$=getarg(2);

    // Current Quest Status + vars
    .@id=GHQ_GetQuestIDByMonsterID(.@mobId);
    .@q=getq(General_Hunter);
    .@p=getq2(General_Hunter);
    next;
    //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 (.@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));
        next;
        closedialog;
        goodbye;
    }
    if (.@q) {
        .@m=GHQ_GetMonsterIDByQuestID(.@q);
        mes l("You are currently hunting @@/10000 @@. Do you want to switch?", .@p, getmonsterlink(.@m));
    }
    select
        l("I'm not interested."),
        rif(GHMEMO[.@id] < 10000,l("I'll hunt them for you."));

    switch (@menu) {
    case 2:
        GHMEMO[getq(General_Hunter)]=getq2(General_Hunter);
        setq(General_Hunter, .@id, GHMEMO[.@id]);
        mesn;
        mesq l("Good luck! Don't come back until you reach 10000 kills!");
        break;
    }
    closedialog;
    goodbye;

}