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





                                  
                                                       
 

















                                                                                     




                  




                                
               


                              
               


                                 
               
                           

                                    
                


                                     
                
                          

                                     
                


                                  
                 






                                       
     











                                             
     
          
 
       



                                   
 

                                                      

        
         




                                        
 




                   
      



                                       
      
        

 
// 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;

    mesn;
    mesc l("I have a few items for sale...");
    next;
    menuint
        rif(.CurrentValue & 1, l("Treasure Map")), 1,
        rif(.CurrentValue & 2, l("Lock Picks")), 2,
        rif(.CurrentValue & 4, l("Return Potion")), 4,
        rif(.CurrentValue & 8, l("Golden Pearl Ring")), 8,
        rif(.CurrentValue & 16, l("Mysterious Bottle")), 16,
        rif(.CurrentValue & 32, l("Ancient Blueprint")), 32,
        rif(.CurrentValue & 64, l("Arcmage Boxset")), 64,
        rif($ARKIM_ST > 7500 && .CurrentValue & 128, l("Dark Desert Mushroom")), 128,
        l("Nothing"), 0;
    mes "";

    // Fallback
    if (!@menuret)
        close;

    switch (@menuret) {
        case 1:
            .@price=600;
            .@prize=TreasureMap;
            break;
        case 2:
            .@price=1000;
            .@prize=Lockpicks;
            break;
        case 4:
            .@price=2200;
            .@prize=ReturnPotion;
            break;
        case 8:
            .@price=500000;
            .@prize=GoldenPearlRing;
            break;
        case 16:
            .@price=4000;
            .@prize=MysteriousBottle;
            break;
        case 32:
            .@price=15000;
            .@prize=AncientBlueprint;
            break;
        case 64:
            .@price=21000;
            .@prize=ArcmageBoxset;
            break;
        case 128:
            .@price=.DDMPrice;
            .@prize=DarkDesertMushroom;
            break;
        default:
            .@price=999999999;
            .@prize=Acorn;
            break;
    }
    mesc l("Only @@ GP.", .@price);
    if (Zeny < .@price)
        close;
    if (askyesno() == ASK_YES) {
        if (!(.CurrentValue & @menuret)) {
            mesc l("Out of Stock."), 1;
            close;
        }
        .CurrentValue=.CurrentValue^@menuret;
        Zeny-=.@price;
        getitem .@prize, 1;
        mesc l("Item sold!"), 2;
    }
    close;

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

    .CurrentValue=rand2(1,255);
    .DDMPrice=max(30000,50000-($ARKIM_ST/2)+(7500/2));
    end;

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

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

    /*
    if (debug) {
        setnpcdisplay .name$, NPC_KOGA;
        .active=1;
    }
    */
    end;

}