summaryrefslogblamecommitdiff
path: root/npc/014-3/fountain.txt
blob: 65d7416bbed775748988cfd58eb4b2fb72cab8f5 (plain) (tree)



























































                                                                              
// TMW-2 Script
// Author:
//    Saulc
//    Jesusalva
// Description:
//    Hurnscald doesn't have a well

014-3,151,117,0	script	Fountain#Hurns	NPC_NO_SPRITE,{
    mes col("There is fresh water here. I could use it to fill a bottle.", 9);
    mes col("But I probably should not do it. It might be poisoned!", 9);
    close;

    // TODO FIXME: We don't have a "Hurnscald" water, and we might add
    // Mahed or Mahad, another well master (Mehoud? Muhoud?)
    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;
    inventoryplace BottleOfTonoriWater, .@count;

    Zeny=Zeny-.@Cost;
    delitem "EmptyBottle", .@count;
    getitem "BottleOfTonoriWater", .@count;
    close;

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

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

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

    .@npcId = getnpcid(0, .name$);
    // Check items.xml for info about this
    setunitdata(.@npcId, UDT_HEADTOP, InfantryHelmet);
    setunitdata(.@npcId, UDT_HEADMIDDLE, SailorShirt);
    setunitdata(.@npcId, UDT_HEADBOTTOM, RaidTrousers);
    setunitdata(.@npcId, UDT_HAIRSTYLE, 7);
    setunitdata(.@npcId, UDT_HAIRCOLOR, 17);

    end;
}