tested and fixed novice Red Potion exchanger

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@9027 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
Lupus 2006-10-20 15:46:07 +00:00
parent 8c699742a8
commit 5b5aa4081c
2 changed files with 27 additions and 22 deletions

View File

@ -3,7 +3,7 @@
//===== By: ================================================== //===== By: ==================================================
//= ???, eAthena Team //= ???, eAthena Team
//===== Current Version: ===================================== //===== Current Version: =====================================
//= 1.1 //= 1.1a
//===== Compatible With: ===================================== //===== Compatible With: =====================================
//= eAthena 1.0+ //= eAthena 1.0+
//===== Description: ========================================= //===== Description: =========================================
@ -20,47 +20,50 @@ function script F_NMerch {
close; close;
} }
mes "Good day!"; mes "Good day!";
mes "Do you have any collection items such as "+getitemname(getarg(1))+"s or "+getitemname(getarg(3))+"s ?"; mes "Do you have any collection items such as "+getitemname(getarg(1))+" or "+getitemname(getarg(3))+"?";
if(getarg(5)) if(getarg(5))
mes "...how about "+getitemname(getarg(5))+"-s ?.."; mes "...how about "+getitemname(getarg(5))+"?..";
mes "Oh, yeah, I need those for something."; mes "Oh, yeah, I need those for something.";
next; next;
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "Of course I am not asking you to give those for free!"; mes "Of course I am not asking you to give those for free!";
mes "How about...if I give you 1 Red"; mes "How about... if I give you 1 Red";
mes "Potion for "+getarg(2)+" "+getitemname(getarg(1))+"s or "+getarg(4)+" "+getitemname(getarg(3))+"s ?"; mes "Potion for "+getarg(2)+" "+getitemname(getarg(1))+" or "+getarg(4)+" "+getitemname(getarg(3))+"?";
if(getarg(5)) if(getarg(5))
mes "or "+getarg(6)+" "+getitemname(getarg(5))+" ?"; mes "Or "+getarg(6)+" "+getitemname(getarg(5))+"?";
next; next;
switch (select("Sure!:Think you're ripping me off...:No, thanks")) { switch (select("Sure!:Think you're ripping me off...:No, thanks")) {
case 1: case 1:
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "So which item do you bring me ?"; mes "So which item do you bring me?";
mes ""+getitemname(getarg(1))+"-s? "+getitemname(getarg(3))+"-s ?"; mes ""+getitemname(getarg(1))+"? "+getitemname(getarg(3))+"?";
mes "Or "+getitemname(getarg(5))+"-s?"; if(getarg(5))
mes "Or "+getitemname(getarg(5))+"?";
next; next;
if(getarg(5)) if(getarg(5))
set @i,select(""+getitemname(getarg(1))+"",""+getitemname(getarg(3))+"",""+getitemname(getarg(5))+"","Cancel"); set @i,select(""+getitemname(getarg(1))+"",""+getitemname(getarg(3))+"",""+getitemname(getarg(5))+"","Cancel")-1;
else else
set @i,select(""+getitemname(getarg(1))+"",""+getitemname(getarg(3))+"","Cancel"); set @i,select(""+getitemname(getarg(1))+"",""+getitemname(getarg(3))+"","Cancel")-1;
if(@i==4 || (@i==3 && !getarg(5))) { if(@i==4 || (@i==3 && !getarg(5))) {
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "Sure, no problem."; mes "Sure, no problem.";
close; close;
} }
set @have,countitem(getarg(1+@i*2)); set @item,getarg(1+@i*2);
if(@have < getarg(2+@i*2)) { set @amount,getarg(2+@i*2);
set @have,countitem(@item);
if(@have < @amount) {
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "Hey, where are all those"; mes "Hey, where are all those";
mes getitemname(getarg(1+@i*2))+"-s you promised?"; mes getitemname(@item)+" you promised?";
close; close;
} }
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "Okay, let me take a look at the stuff you brought."; mes "Okay, let me take a look at the stuff you brought.";
next; next;
set @max,@have / getarg(2+@i*2); set @max,@have / @amount;
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "You have total "+@have+" "+getitemname(getarg(1+@i*2))+"-s..."; mes "You have total "+@have+" "+getitemname(@item)+"...";
mes "I can give you"; mes "I can give you";
mes "total "+@max+" Red Potion for those."; mes "total "+@max+" Red Potion for those.";
next; next;
@ -75,7 +78,7 @@ function script F_NMerch {
} }
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "You know the exact number of Red Potions"; mes "You know the exact number of Red Potions";
mes "you can receive for "+getitemname(getarg(1+@i*2))+"-s, don't you?"; mes "you can receive for "+getitemname(@item)+", don't you?";
next; next;
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "You can get Red Potions"; mes "You can get Red Potions";
@ -89,8 +92,8 @@ function script F_NMerch {
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "Uh oh, the number you entered"; mes "Uh oh, the number you entered";
mes "seemed incorrect."; mes "seemed incorrect.";
mes "You'd better check how many red"; mes "You'd better check how many Red";
mes "potions you can get."; mes "Potions you can get.";
continue; continue;
} }
break; break;
@ -110,7 +113,7 @@ function script F_NMerch {
mes "potions you can get."; mes "potions you can get.";
close; close;
} }
delitem getarg(1+@i*2),getarg(2+@i*2)*@val; delitem @item,@amount*@val;
getitem 501,@val; getitem 501,@val;
mes "There you go!"; mes "There you go!";
mes "Thanks, it was a good deal."; mes "Thanks, it was a good deal.";
@ -119,6 +122,8 @@ function script F_NMerch {
mes "["+getarg(0)+"]"; mes "["+getarg(0)+"]";
mes "Did you say I am ripping you off?!"; mes "Did you say I am ripping you off?!";
mes "You got to know how ignorant that comment was!"; mes "You got to know how ignorant that comment was!";
next;
mes "["+getarg(0)+"]";
mes "When you check the price of each item,"; mes "When you check the price of each item,";
mes "I am doing a losing business."; mes "I am doing a losing business.";
mes "If you don't want to do then, fine!"; mes "If you don't want to do then, fine!";
@ -138,6 +143,7 @@ prontera.gat,123,102,5 script Merchant#1 85,{
geffen.gat,173,88,5 script Merchant#2 85,{ geffen.gat,173,88,5 script Merchant#2 85,{
callfunc "F_NMerch","Merchant",935,5,915,6,909,10; callfunc "F_NMerch","Merchant",935,5,915,6,909,10;
} }
morocc.gat,180,259,3 script Merchant#3 85,{ morocc.gat,180,259,3 script Merchant#3 85,{
callfunc "F_NMerch","Merchant",935,5,916,7,909,10; callfunc "F_NMerch","Merchant",935,5,916,7,909,10;
} }

View File

@ -56,8 +56,7 @@ npc: npc/merchants/shuriken_maker.txt
npc: npc/merchants/socket_enchant.txt npc: npc/merchants/socket_enchant.txt
npc: npc/merchants/ammo_boxes.txt npc: npc/merchants/ammo_boxes.txt
npc: npc/merchants/ammo_dealer.txt npc: npc/merchants/ammo_dealer.txt
//Not properly tested yet npc: npc/merchants/novice_exchange.txt
//npc: npc/merchants/novice_exchange.txt
// -------------------------------------------------------------- // --------------------------------------------------------------
// -------------------------- Airport --------------------------- // -------------------------- Airport ---------------------------
npc: npc/airports/airships.txt npc: npc/airports/airships.txt