summaryrefslogblamecommitdiff
path: root/world/map/npc/034-1/yetiSpawn.txt
blob: 9c1b537a77805df69a16058ac810410697b3ad05 (plain) (tree)
1
2
3
4
5


                                                                        
                                                        
                                                                                   










                                              
                                             

















                                                                                       
                                                                                   
                    
                            

                          

                                                                                                                       
 
      



                                   




                                                                                

                             

                                                       

               
// This file belongs to the yeti hunting quest given by 033-1/yerrnk.txt
// Author: Jenalya

034-1.gat,79,98,0|script|#Yerrnk_YetiTrigger|32767,1,3,{
    set @state, ((QUEST_Barbarians & $@Q_Barbarians_MASK) >> $@Q_Barbarians_SHIFT);
    if (@state != 7)
        end;

    if ($@Yerrnk_Yeti_Active != 0)
        end;
    set $@Yerrnk_Yetifighter_ID, getcharid(3);
    set $@Yerrnk_Yeti_Active, 1;
    donpcevent "#Yerrnk_Yeti::OnYeti";
    end;
}

034-1.gat,78,98,0|script|#Yerrnk_Yeti|32767,{
end;

OnYeti:
    if (attachrid($@Yerrnk_Yetifighter_ID) == 0)
        goto L_Abort;

    message strcharinfo(0), "There is the Yeti!";
    areamonster "034-1.gat", 67, 93, 74, 102, "", 1072, 1, "#Yerrnk_Yeti::OnYetiDeath";
    end;

L_Abort:
    set $@Yerrnk_Yeti_Active, 0;
    set $@Yerrnk_Yetifighter_ID, 0;
    end;

OnYetiDeath:
    set @MobID, 1072;

    set @state, ((QUEST_Barbarians & $@Q_Barbarians_MASK) >> $@Q_Barbarians_SHIFT);
    if (@state != 7)
        goto L_NonQuestKill;
    set @state, 8;
    callsub S_Update_Mask;
    set BOSS_POINTS, BOSS_POINTS + 40;
    message strcharinfo(0), "You defeated the Yeti and gain 40 Boss Points giving you a total of " + BOSS_POINTS + ".";

L_End:
    set $@Yerrnk_Yeti_Active, 0;
    set $@Yerrnk_Yetifighter_ID, 0;
    end;

L_NonQuestKill:
    message strcharinfo(0), "The dying Yeti takes you along to the other side.";
    percentheal -100, 0;
    goto L_End;

S_Update_Mask:
        set QUEST_Barbarians,
            (QUEST_Barbarians & ~($@Q_Barbarians_MASK))
                | (@state << $@Q_Barbarians_SHIFT);
        return;
}