diff options
author | mercurial123 <mercurial123@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-23 03:49:47 +0000 |
---|---|---|
committer | mercurial123 <mercurial123@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2011-12-23 03:49:47 +0000 |
commit | f004cda67cb7f252633b43ba6cff438bb67294da (patch) | |
tree | f08353fe3a7bb8064e59fae8a319c58257e2bc83 /npc | |
parent | 3d22fef9ff923950bc07af734ba32da65ce409c9 (diff) | |
download | hercules-f004cda67cb7f252633b43ba6cff438bb67294da.tar.gz hercules-f004cda67cb7f252633b43ba6cff438bb67294da.tar.bz2 hercules-f004cda67cb7f252633b43ba6cff438bb67294da.tar.xz hercules-f004cda67cb7f252633b43ba6cff438bb67294da.zip |
- Rebranded NPC Information
- Optimized Poison Herb Salesman since an optimized version already exist. (Tested and Approved)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15221 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'npc')
-rw-r--r-- | npc/merchants/3rd_trader.txt | 311 |
1 files changed, 99 insertions, 212 deletions
diff --git a/npc/merchants/3rd_trader.txt b/npc/merchants/3rd_trader.txt index 7d16b1a1a..34667fa0a 100644 --- a/npc/merchants/3rd_trader.txt +++ b/npc/merchants/3rd_trader.txt @@ -1,259 +1,145 @@ -//===== eAthena Script =======================================
+//===== rAthena Script =======================================
//= 3rd Item Seller
//===== By: ==================================================
//= Masao
+//= Mercurial
//===== Current Version: =====================================
-//= 1.0
+//= 1.1
//===== Compatible With: =====================================
-//= eAthena SVN
+//= rAthena SVN
//===== Description: =========================================
//= [Aegis Conversion]
//= Sells some 3rd Job related Items.
//===== Additional Comments: =================================
+//= v1.1 Optimized Poison Herb Salesman NPC
//= v1.0 First Version.
//============================================================
-job3_guil01,79,96,3 script Poison Herb Salesman::phsale 877,{
- if(checkweight(1201,1) == 0 || MaxWeight - Weight < 20000)
+job3_guil01,79,96,3 script Poison Herb Salesman::PHS 877,{
+
+ // We are unsure about agis script command equivalent please refer to 3rd_trader.sc line 3
+ //if( (countitem(1201)>=30000) || checkweight() )
+
+ for(set .x,0; .x<getarraysize(.herbs); set .x,.x+1)
{
- mes "- Wait a minute !! -";
- mes "- Currently you're carrying -";
- mes "- too many items with you. -";
- mes "- Please try again -";
- mes "- after you loose some weight. -";
- close;
+ if(!checkweight(.herbs[.x],.maxHerbs))
+ {
+ mes "- Wait a minute !! -";
+ mes "- Currently you're carrying -";
+ mes "- too many items with you. -";
+ mes "- Please try again -";
+ mes "- after you loose some weight. -";
+ close;
+ }
}
-
- mes "[Poison Herb Salesman]";
+
+ mes .npcName$;
mes "I am the professional";
mes "poison herb seller.";
mes "Which one do you want?";
- mes "They cost 4,000 zeny each!";
+ mes "They cost "+.herbCost[0]+" zeny each!";
+ set .herbType,select("Nerium:Rantana:Makulata:Seratum:Scopolia:Amoena:Poison Kit")-1;
next;
- switch(select("Nerium:Rantana:Makulata:Seratum:Scopolia:Amoena:Poison Kit"))
+ if(.herbType==(getarraysize(.herbs)-1))
{
- case 1:
- mes "[Poison Herb Salesman]";
- mes "How many do you want? You can";
- mes "only buy a maximum of 2000ea";
- mes "and if you want to cancel, enter '0'.";
- next;
- input .@amount;
- if(.@amount == 0)
- {
- mes "[Poison Herb Salesman]";
- mes "You've cancelled the trade.";
- close;
- }
- else if(.@amount > 2000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the maximum";
- mes "amount and then try again.";
- close;
- }
- else if(Zeny < .@amount * 4000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the money you have,";
- mes "It doesn't seem like you have enough money.";
- close;
- }
- set Zeny,Zeny - .@amount * 4000;
- getitem 7932,.@amount;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 2:
- mes "[Poison Herb Salesman]";
- mes "How many do you want? You can";
- mes "only buy a maximum of 2000ea";
- mes "and if you want to cancel, enter '0'.";
- next;
- input .@amount;
- if(.@amount == 0)
- {
- mes "[Poison Herb Salesman]";
- mes "You've cancelled the trade.";
- close;
- }
- else if(.@amount > 2000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the maximum";
- mes "amount and then try again.";
- close;
- }
- else if(Zeny < .@amount * 4000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the money you have,";
- mes "It doesn't seem like you have enough money.";
- close;
- }
- set Zeny,Zeny - .@amount * 4000;
- getitem 7933,.@amount;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 3:
- mes "[Poison Herb Salesman]";
- mes "How many do you want? You can";
- mes "only buy a maximum of 2000ea";
- mes "and if you want to cancel, enter '0'.";
- next;
- input .@amount;
- if(.@amount == 0)
- {
- mes "[Poison Herb Salesman]";
- mes "You've cancelled the trade.";
- close;
- }
- else if(.@amount > 2000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the maximum";
- mes "amount and then try again.";
- close;
- }
- else if(Zeny < .@amount * 4000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the money you have,";
- mes "It doesn't seem like you have enough money.";
- close;
- }
- set Zeny,Zeny - .@amount * 4000;
- getitem 7934,.@amount;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 4:
- mes "[Poison Herb Salesman]";
- mes "How many do you want? You can";
- mes "only buy a maximum of 2000ea";
- mes "and if you want to cancel, enter '0'.";
- next;
- input .@amount;
- if(.@amount == 0)
- {
- mes "[Poison Herb Salesman]";
- mes "You've cancelled the trade.";
- close;
- }
- else if(.@amount > 2000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the maximum";
- mes "amount and then try again.";
- close;
- }
- else if(Zeny < .@amount * 4000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the money you have,";
- mes "It doesn't seem like you have enough money.";
- close;
- }
- set Zeny,Zeny - .@amount * 4000;
- getitem 7935,.@amount;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 5:
- mes "[Poison Herb Salesman]";
- mes "How many do you want? You can";
- mes "only buy a maximum of 2000ea";
- mes "and if you want to cancel, enter '0'.";
- next;
- input .@amount;
- if(.@amount == 0)
- {
- mes "[Poison Herb Salesman]";
- mes "You've cancelled the trade.";
- close;
- }
- else if(.@amount > 2000)
- {
- mes "[Poison Herb Salesman]";
- mes "Please check the maximum";
- mes "amount and then try again.";
- close;
- }
- else if(Zeny < .@amount * 4000)
+ mes .npcName$;
+ mes "You can only buy";
+ mes "1 Poison Kit and it costs "+.herbCost[(getarraysize(.herbs)-1)]+" zeny.";
+ mes "Will you buy it?";
+
+ switch(select("Yes, I will.:No, I won't."))
{
- mes "[Poison Herb Salesman]";
- mes "Please check the money you have,";
- mes "It doesn't seem like you have enough money.";
- close;
+ case 1:
+ if(Zeny < .poisHerbCost)
+ {
+ next;
+ mes .npcName$;
+ mes "Please check the money you have.";
+ mes "It doesn't seem like you have enough money.";
+ close;
+ }
+ else
+ {
+ set Zeny,Zeny-.poisHerbCost;
+ getitem .herbs[getarraysize(.herbs)-1],1;
+ next;
+ mes .npcName$;
+ mes "Thank you. See you~!";
+ close;
+ }
+ break;
+ case 2:
+ next;
+ mes "[Poison Herb Salesman]";
+ mes "Well, I see. See you~!";
+ close;
+ break;
}
- set Zeny,Zeny - .@amount * 4000;
- getitem 7936,.@amount;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 6:
- mes "[Poison Herb Salesman]";
+ }
+ else
+ {
+ mes .npcName$;
mes "How many do you want? You can";
- mes "only buy a maximum of 2000ea";
+ mes "only buy a maximum of "+.maxHerbs+" ea";
mes "and if you want to cancel, enter '0'.";
- next;
- input .@amount;
- if(.@amount == 0)
+ input .herbsCount;
+ if(.herbsCount<=0) // check if player canceled herb purchase
{
- mes "[Poison Herb Salesman]";
+ next;
+ mes .npcName$;
mes "You've cancelled the trade.";
close;
}
- else if(.@amount > 2000)
+ else if(.herbsCount>.maxHerbs) // checks if herbs count exceeds maxHerbs limit
{
- mes "[Poison Herb Salesman]";
+ next;
+ mes .npcName$;
mes "Please check the maximum";
mes "amount and then try again.";
close;
}
- else if(Zeny < .@amount * 4000)
+ else if(.herbsCount+countitem(.herbs[.herbType]) > .maxItemStack) // Check item stack according to Aegis script
{
- mes "[Poison Herb Salesman]";
- mes "Please check the money you have,";
- mes "It doesn't seem like you have enough money.";
+ mes "- Wait a minute !! -";
+ mes "- Currently you're carrying -";
+ mes "- too many items with you. -";
+ mes "- Please try again -";
+ mes "- after you loose some weight. -";
close;
}
- set Zeny,Zeny - .@amount * 4000;
- getitem 7937,.@amount;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 7:
- mes "[Poison Herb Salesman]";
- mes "You can only buy";
- mes "1 Poison Kit and it costs 5,000 zeny.";
- mes "Will you buy it?";
- next;
- switch(select("Yes, I will.:No, I won't."))
+ else
{
- case 1:
- if(Zeny < 5000)
+ if(Zeny<(.herbsCount*.herbCost)) // Check if Zeny is enough
{
- mes "[Poison Herb Salesman]";
+ next;
+ mes .npcName$;
mes "Please check the money you have.";
mes "It doesn't seem like you have enough money.";
close;
}
- set Zeny,Zeny - 5000;
- getitem 7931,1;
- mes "[Poison Herb Salesman]";
- mes "Thank you. See you~!";
- close;
- case 2:
- mes "[Poison Herb Salesman]";
- mes "Well, I see. See you~!";
- close;
+ else // all requirements are met give the item
+ {
+ set Zeny,Zeny-(.herbsCount*.herbCost);
+ getitem .herbs[.herbType],.herbsCount;
+ next;
+ mes .npcName$;
+ mes "Thank you. See you~!";
+ close;
+ }
}
}
+OnInit:
+// Initialize Item Id's on script engine Init Event
+ set .npcName$,"[Poison Herb Salesman]";
+ setarray .herbs[0],7932,7933,7934,7935,7936,7937,7931;
+ setarray .herbCost[0],4000,4000,4000,4000,4000,4000,5000;
+ set .maxHerbs,2000;
+ set .poisHerbCost,5000;
+ set .maxItemStack,30000;
}
+
job3_rune01,90,62,3 script Rune Salesman::runesale 853,{
if(checkweight(1201,1) == 0 || MaxWeight - Weight < 20000)
@@ -629,6 +515,7 @@ gef_tower,105,172,5 script Point Salesman#Sorcerer 700,{ }
}
-morocc,190,96,4 duplicate(phsale) Poison Herb Salesman#1 877
-lhz_in02,16,205,4 duplicate(phsale) Poison Herb Salesman#2 877
+
+morocc,190,96,4 duplicate(PHS) Poison Herb Salesman#moc 877
+lhz_in02,16,205,4 duplicate(PHS) Poison Herb Salesman#lhz 877
prontera,168,228,3 duplicate(runesale) Rune Salesman#1 853
\ No newline at end of file |