summaryrefslogblamecommitdiff
path: root/npc/003-1/mahoud.txt
blob: 0aa508292fa4d310157b201a9a5a2500fce219fc (plain) (tree)
1
2
3
4
5
6
7
8

           
               
 
                                            
 
                           
 














                                                                                             
                                             




                                   
                                                                                












                                                               


                  
                  

                                    
                                          

                                               
                                               


                                            
        
 
// Author:
//    Saulc
//    Jesusalva

003-1,46,79,0	script	Mahoud	NPC_PLAYER,{

    .@COST_PER_BOTTLE = 50;

    mes l("I can fill your bottle with water for only @@ gp the bottle.", .@COST_PER_BOTTLE);
    mes l("After all, I am the Well Master!");
    input .@count;

    if (.@count == 0)
        close;
    .@Cost = .@count * .@COST_PER_BOTTLE;
    .@empty = countitem("EmptyBottle");

    if (.@empty < .@count)
        goto L_NotEnoughBottles;
    if (Zeny < .@Cost)
        goto L_NotEnoughMoney;
    getinventorylist;
    if (@inventorylist_count == 100
        && countitem("BottleOfSeaWater") == 0
        && .@empty > .@count)
            goto L_NotEnoughSlots;

    set Zeny, Zeny - .@Cost;
    delitem "EmptyBottle", .@count;
    getitem "BottleOfSeaWater", .@count; // TODO FIXME: This is not sea water...
    close;

L_NotEnoughBottles:
    mes l("You don't have that many empty bottles!");
    close;

L_NotEnoughMoney:
    mes l("You don't have enough gp! You need @@ gp.", .@Cost);
    close;

L_NotEnoughSlots:
    mes l("You don't have room for these bottles!");
    close;

OnInit:
    .sex = G_MALE;
    .distance = 7;

    .@npcId = getnpcid(0, "Mahoud");
    // Check items.xml for info about this
    setunitdata(.@npcId, UDT_HEADTOP, 2911);
    setunitdata(.@npcId, UDT_HEADMIDDLE, 1303);
    setunitdata(.@npcId, UDT_HEADBOTTOM, 2201);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 7);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 17);

    end;
}