summaryrefslogblamecommitdiff
path: root/npc/024-1/guard.txt
blob: f98c1c18c23010d1fd11719b7622178863be7d35 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
              



                               

                                                 


                                     

                                     
 
            

                         





                                                       





                                                     
 

                                                     


                                                  


                     
                                                
                                
                    



                                       


            

                                                   
          

 



                                                                         

                       



                                            
           

                                                                                               
         




















                                                                                                                                          



                                 
 
       
                               











                                                       









                                                                   
// TMW2 Script
// Author:
//  Jesusalva
// Description:
//  Controls access to Frostia.

024-1,93,73,0	script	Frostia Guard	NPC_ELF,{
    // Main Quest Have Precedence
    if (getq(General_Narrator) == 11)
        goto L_MainQuest;
    if (getq(General_Narrator) == 12)
        goto L_MainQuest2;

L_MainLogic:
    if (BaseLevel < 40)
        goto L_Unallowed;
    if (Class == Elven)
    {
        slide 93, 69;
        npctalk3 l("Elves are always allowed inside.");
        end;
    }
    // You have a house inside
    if (ESTATE_RENTTIME >= gettimetick(2)) {
        slide 93, 69;
        npctalk3 l("I don't trust @@s.", get_race());
        end;
    }

    //.@tax=1001-min(1000, reputation("Frostia")*10);
    .@tax=501-min(500, reputation("Frostia")*5);
    mesn;
    mesc l("The guard eyes you with suspcion.");
    mesq l("You should not be here. Get moving.");
    if (Zeny < .@tax)
        close;
    next;
    mesc l("Bribe the guard for @@ GP?", .@tax);
    if (askyesno() == ASK_YES) {
        Zeny-=.@tax;
        closeclientdialog;
        slide 93, 69;
        npctalk3 l("Behave yourself.");
    }
    close;

L_Unallowed:
    mesn;
    mesq l("You're not welcome here. Get moving.");
    close;


L_MainQuest:
    mesc b(l(".:: Main Quest 4-1 ::.")), 3;
    msObjective(BaseLevel >= 40, l("* @@/@@ Base Level", BaseLevel, 40));
    mesc l("* Deliver Nikolai's Letter to Frostia Mayor"), 9;
    if (BaseLevel < 40)
        close;
    next;
    mesn strcharinfo(0);
    select
        l("I have a letter for the Mayor.");
    mes "";
    mesn;
    mesq l("We don't have a mayor. The independent city-state of Frostia is ruled by a King.");
    next;
    mesn;
    mesq l("King Gelid Frozenheart II rules over all elves and dwarves who live here peacefully, and he also presides the city council.");
    next;
    mesn;
    mesq l("I hate foreigners. They know nothing about us and want to impose their \"ideals\" about democracy and whatever.");
    next;
    mesn;
    mesq l("Anyway, you had a letter to our @@, you meant? Sure thing, I'll let him know at once.", b(l("king")));
    setq General_Narrator, 12;
    close;

L_MainQuest2:
    mesn;
    mesq l("King Gelid Frozenheart II will have you.");
    next;
    mesn;
    mesq l("His policy is to never read a letter without the sender being present. Of course we checked for poison and traps.");
    next;
    mesn;
    mesq l("Behave yourself, or you'll be executed in the town square mercilessly. You have been warned.");
    next;
    closeclientdialog;
    // Maybe an instance instead?
    warp "024-16", 30, 52;
    end;

OnInit:
    .@npcId = getnpcid(.name$);
    setunitdata(.@npcId, UDT_HEADTOP, WarlordHelmet);
    setunitdata(.@npcId, UDT_HEADMIDDLE, WarlordPlate);
    setunitdata(.@npcId, UDT_HEADBOTTOM, NPCEyes);
    setunitdata(.@npcId, UDT_WEAPON, JeansChaps);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 2);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 4);

    .sex = G_MALE;
    .distance = 5;
    end;
}

// This small script controls if you can visit King Gelid II or not
024-1,97,20,0	script	#FrostiaCastle	NPC_HIDDEN,1,0,{
end;
OnTouch:
    if (getq(General_Narrator) >= 12)
        warp "024-16", 30, 52;
    end;
}