summaryrefslogblamecommitdiff
path: root/npc/functions/mobpoint.txt
blob: 224515bf164908b53ff03d062aa3dfb63f6cde64 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12




                                                                               






                                                      
                                         

                 

                                          





                                                                         
                             



           
                                            

        

                                        
                                                                                                      

        
               
                        

                                                                           
                                            

     
                           
                                                                    
      
      
                                                                 

                                                
     

                     
                        
                         
                            
                             
                                  
                                         

                
        
 
                                                      
                                                                             
                                                                  
              
                       
                
                  



                                                                        

                                          
                                 
                                  

                                                                    
                                                                   
                               

                                                                     
                                         
                        

                                                                     
                                           

                                                                                 
                                                                              

                                           

                                                                            



                                                                       
     

        
 
// TMW2 Scripts
// Author: Crazyfefe
//         Jesusalva
// Desc:   Mob Points for Aidan & Ishi. You will gain MONSTER-LEVEL mob points.

// fix_mobkill(mobID) → Manual fix for scripted mobs
function	script	fix_mobkill	{
    killedrid=getarg(0);
    doevent "#mobptsys::OnNPCKillEvent";
    return;
}

function	script	mobpoint	{
    if (!MPQUEST)
        return;
    //if (killedrid < 1002) goto L_Return;

    // You get MobLv + 20% as MobPoints.
    // So a level 100 monster gives you 120 MobPt. Slimes gives no bonus.
    if (compare("slime", strtolower(strmobinfo(1, killedrid))))
        .@addval=strmobinfo(3,killedrid);
    else
        .@addval=strmobinfo(3,killedrid)*12/10;
    Mobpt = Mobpt + .@addval;
    return;

}

-	script	#mobptsys	NPC_HIDDEN,{
    end;

OnUnlock:
    if (checkpcblock() & PCBLOCK_ATTACK)
        setpcblock(PCBLOCK_ATTACK|PCBLOCK_SKILL|PCBLOCK_USEITEM|PCBLOCK_MOVE|PCBLOCK_COMMANDS, false);
    end;

OnNPCKillEvent:
    $MONSTERS_KILLED+=1;
    if (killedrid == MonsterKing) {
        announce "An illusionary monster king was killed.", bc_all | bc_pc;
        getexp min(641500, BaseLevel**3), 0;
    }

    // Remove undue Job exp
    // The check is probably correct, but setparam is not working =/
    /*
    */
    if (strmobinfo(7, killedrid) == 0 && readparam(JobExp) > 0) {
        //setparam(JobExp, readparam(JobExp)-1);
        JobExp-=1;
    }

    // call functions
    callfunc "mobpoint";
    callfunc "mobhunter";
    callfunc "SQuest_Hasan";
    callfunc "SaggyMobCount";
    callfunc "dausen_mobtutorial";
    callfunc "Guardhouse_RandQuestCheck";

    killedrid=0;
    end;

// When you kill a player, some special care is needed
// Only a few maps will give you experience for PK: Tulimshar's Guards Arena,
// Frostia Imperial PVP Arena, Call Of Dusty, Arena Quirino Voraz.
OnPCKillEvent:
    $PLAYERS_KILLED+=1;
    // killedrid
    .@m$=getmap();
    // TODO: Start using readparam2() to read if the opponent was worthy
    // That is, read total attack, defense, HP, evasion and hit chance
    // And compare with your own readparam2(), then use a % and a table
    // based on your (assassin's) level.
    .@bxp=readparam(BaseLevel, killedrid);
    .@jxp=readparam(JobLevel, killedrid);
    if (compare(.@m$, "001-8")) {
        // Quirino Voraz PVP Arena
        // You get 5 times killed player level, and 1 time job level
        getexp .@bxp*5, .@jxp;
    } else if (compare(.@m$, "ARENA") || compare(.@m$, "003-13")) {
        // Tulimshar Duel Arena
        // You get 3 times killed player level, and 2 times job level
        getexp .@bxp*3, .@jxp*2;
    } else if (compare(.@m$, "001-10")) {
        // Call Of Dusty
        // You get 3 times killed player level, and 3 times job level
        getexp .@bxp*3, .@jxp*3;
    } else if (compare(.@m$, "001-10-1")) {
        // Call Of Dusty Boss Room
        // You _may_ get a Bottled Dusty at random, but dead player status affect
        .@bagistr=(readparam2(bAgi, killedrid)*2)+readparam2(bDex, killedrid);
        //.@b2=readparam(MaxHp, killedrid);
        if (.@bagistr > 20)
            if (rand2(0,250) < readparam2(bLuk)+readparam2(bLuk, killedrid))
                getitem BottledDust, any(1,1,2);
    } else {
        // Anywhere else
        // You get 0.5 times killed player level, and 0 times job level
        getexp (.@bxp/2), 0;
    }
    end;

}