summaryrefslogblamecommitdiff
path: root/npc/015-2/contrabandist.txt
blob: 6db8ab0ba6515d7cc8b713fbe2fa575b7c5bc8ed (plain) (tree)
1
2
3
4
5
6
7





                                  
                                                       




                      
         

      












                                         
                                                          














                                                      


                   
                   




                                       
 
                           

                                   





                                   


                                   





                                        

                                     


        
// TMW-2 Script
// Author:
//    Jesusalva
// Description:
//    Contraband of foreing goods.

015-2,166,250,0	script	#Contraband	NPC_NO_SPRITE,{

// Store not available
if (!.active)
    end;

openshop;
close;

    function Contraband_Unload {
        if (getarg(0,0) & 1)
            stopselling(IronOre);
        if (getarg(0,0) & 2)
            stopselling(TitaniumOre);
        if (getarg(0,0) & 4)
            stopselling(LeatherPatch);
        if (getarg(0,0) & 8)
            stopselling(GoldenPearlRing);
        if (getarg(0,0) & 16)
            stopselling(ThornArrow);
    }
    function Contraband_Load {
        .DDMPrice=max(30000,50000-($ARKIM_ST/2)+(4500/2));
        if ($ARKIM_ST > 4500)
            sellitem DarkDesertMushroom, .DDMPrice, 1;

        if (getarg(0,0) & 1)
            sellitem IronOre, 2000, 1;
        if (getarg(0,0) & 2)
            sellitem TitaniumOre, 4000, 1;
        if (getarg(0,0) & 4)
            sellitem LeatherPatch, 2500, 1;
        if (getarg(0,0) & 8)
            sellitem GoldenPearlRing, 1000000, 1;
        if (getarg(0,0) & 16)
            sellitem ThornArrow, -1, 3;
    }

OnInit:
    .active=0;
    .sex = G_OTHER;
    .distance = 12;

    if (true || debug) {
        setnpcdisplay .name$, NPC_KOGA;
        .active=1;
    }

    tradertype(NST_MARKET);
    .CurrentValue=rand(1,31);
    Contraband_Load(.CurrentValue);
    end;

OnMinute21:
OnMinute46:
    setnpcdisplay .name$, NPC_KOGA;
    .active=1;

    .CurrentValue=rand(1,31);
    Contraband_Load(.CurrentValue);
    end;

OnMinute23:
OnMinute48:
    setnpcdisplay .name$, NPC_NO_SPRITE;
    .active=0;

    Contraband_Unload(.CurrentValue);
    end;

}