From 62f0c65cd908cf17c092a33fbfa94a12d9b30af1 Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Thu, 28 Feb 2008 05:15:27 +0000 Subject: Implemented several "checkweight" NPC merchants. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12257 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/Changelog.txt | 2 ++ npc/merchants/dye_maker.txt | 5 +++-- npc/merchants/gemstone.txt | 16 ++++++++-------- npc/merchants/milk_trader.txt | 29 +++++++++++++---------------- npc/merchants/novice_exchange.txt | 15 ++++++++------- npc/merchants/old_pharmacist.txt | 13 +++++++++++-- npc/merchants/quivers.txt | 13 ++++++------- 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/npc/Changelog.txt b/npc/Changelog.txt index 9a26b37b1..fae5e265c 100644 --- a/npc/Changelog.txt +++ b/npc/Changelog.txt @@ -1,5 +1,7 @@ Date Added ====== +2008/02/28 + * Rev 12257 Implemented several "checkweight" NPC merchants. [L0ne_W0lf] 2008/02/27 * Rev 12256 Removed "F_CheckMaxCount" as it seems "checkweight". [L0ne_W0lf] preforms the aforementioned check in addition to checking weight. diff --git a/npc/merchants/dye_maker.txt b/npc/merchants/dye_maker.txt index cdcde978d..2d3983452 100644 --- a/npc/merchants/dye_maker.txt +++ b/npc/merchants/dye_maker.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= eAthena Dev Team //===== Current Version: ===================================== -//= 1.3b +//= 1.4 //===== Compatible With: ===================================== //= eAthena SVN //===== Description: ========================================= @@ -15,10 +15,11 @@ //= 1.2b Fixed typos in variable names [ultramage] //= 1.3 Made the checks more dynamic [ultramage] //= 1.3b Fixed incorrect checking loop structure [ultramage] +//= 1.4 Added a checkweight. [L0ne_W0lf] //============================================================ morocc_in,146,99,3 script Java Dullihan 58,{ - if (MaxWeight-Weight < 200) { + if ((MaxWeight-Weight) < 200 || checkweight(1201,1) == 0) { mes "- Wait a moment! -"; mes "- Currently you're carrying -"; mes "- too many items with you. -"; diff --git a/npc/merchants/gemstone.txt b/npc/merchants/gemstone.txt index f542cb75f..c591b32f9 100644 --- a/npc/merchants/gemstone.txt +++ b/npc/merchants/gemstone.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= L0ne_W0lf //===== Current Version: ===================================== -//= 1.1 +//= 1.2 //===== Compatible With: ===================================== //= eAhena SVN //===== Description: ========================================= @@ -14,15 +14,15 @@ //= Any notes pertaining to the prior trader may be found //= in the cities/payon.txt //= 1.1 Corrected NPC names to fall within proper restrictions. [L0ne_W0lf] +//= 1.2 Updated input with min/max values. [L0ne_W0lf] +//= Added a checkweight. //============================================================ payon,173,238,5 script Jade#pay 754,{ - //Ensure the player can hold at least one item - //set max_max_c,CheckMaxCount; - //if (max_max_c == 1) { - // mes "^3355FFWait a second! Right now, you're carrying too many items with you. Please come back after putting some of your things into Kafra Storage.^000000"; - // close; - //} + if (checkweight(1201,1) == 0) { + mes "^3355FFWait a second! Right now, you're carrying too many items with you. Please come back after putting some of your things into Kafra Storage.^000000"; + close; + } mes "[Jade]"; mes "Bring me two"; mes "Gemstones of the"; @@ -75,7 +75,7 @@ S_TradeGems: mes "that you can enter is 100."; next; while(1) { - input .@input; + input .@input,0,101; if (.@input == 0) { mes "[Jade]"; mes "None at all?"; diff --git a/npc/merchants/milk_trader.txt b/npc/merchants/milk_trader.txt index 9e3472843..f960ee284 100644 --- a/npc/merchants/milk_trader.txt +++ b/npc/merchants/milk_trader.txt @@ -3,33 +3,31 @@ //===== By: ================================================== //= kobra_k88; L0ne_W0lf //===== Current Version: ===================================== -//= 1.3 +//= 1.4 //===== Compatible With: ===================================== //= eAthena SVN //===== Description: ========================================= //= [Aegis Conversion] -//= trades bottles for milk +//= Trades bottles for milk //===== Additional Comments: ================================= //= Fully working //= 1.1 Negative input bug fixed [Lupus] //= 1.2 Raised the price to close zeny exploit [Lupus] //= 1.2a Switched to Lupus's "loopless" technique.[kobra_k88] //= 1.3 Rescripted to Aegis 10.3 standards. [L0ne_W0lf] +//= 1.4 Implemented checkweight. [L0ne_W0lf] //============================================================ prontera,73,140,0 script Milk Vendor 86,{ - //Supposedly this is to make sure the character - //has room to accept items in their inventory. - //var max_max_c = CheckMaxCount 1201 1 - //if max_max_c == 1 - // mes "^3355FFJust a minute!"; - // mes "I can't offer any of my"; - // mes "services to you because"; - // mes "you're carrying too much"; - // mes "stuff. Put your extra items in"; - // mes "Kafra Storage and come again~"; - // close; - //} + if (checkweight(1201,1) == 0) { + mes "^3355FFJust a minute!"; + mes "I can't offer any of my"; + mes "services to you because"; + mes "you're carrying too much"; + mes "stuff. Put your extra items in"; + mes "Kafra Storage and come again~"; + close; + } mes "[Milk Vendor]"; mes "Hey, hey..."; mes "If you bring me"; @@ -52,7 +50,6 @@ prontera,73,140,0 script Milk Vendor 86,{ set .@bottles,countitem(713); set .@total_weight,.@bottles * 50; set .@total_cost,.@bottles * 15; - set .@now_weight,maxweight-weight; if (zeny < .@Total_cost) { mes "[Milk Vendor]"; mes "Oh, whoa~!"; @@ -63,7 +60,7 @@ prontera,73,140,0 script Milk Vendor 86,{ mes "at least " + gap + " zeny."; close; } - if (.@now_weight < .@total_weight) { + if ((maxweight-weight) < .@total_weight) { mes "[Milk Vendor]"; mes "Hmm..."; mes "Would you make"; diff --git a/npc/merchants/novice_exchange.txt b/npc/merchants/novice_exchange.txt index f3d1af076..4d5688d30 100644 --- a/npc/merchants/novice_exchange.txt +++ b/npc/merchants/novice_exchange.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= ???, eAthena Team //===== Current Version: ===================================== -//= 1.3 +//= 1.4 //===== Compatible With: ===================================== //= eAthena SVN //===== Description: ========================================= @@ -14,11 +14,12 @@ //= Made it easier to add new items to exhange list //= meaning only the exchange is done in a function now. //= 1.3 Fixed dialog mix-up in function. [L0ne_W0lf] +//= 1.4 Added checkweight, and input min/max values. [L0ne_W0lf] //============================================================ prontera,123,102,5 script Merchant#pron 85,{ set .@now_weight,MaxWeight-Weight; - if (.@now_weight < 6301) { + if (.@now_weight < 6301 || checkweight(1201,1) == 0) { mes "[Merchant]"; mes "Haha!"; mes "What are you, superhuman?"; @@ -75,7 +76,7 @@ prontera,123,102,5 script Merchant#pron 85,{ morocc,180,259,3 script Merchant#morroc 85,{ set .@now_weight,MaxWeight-Weight; - if (.@now_weight < 6301) { + if (.@now_weight < 6301 || checkweight(1201,1) == 0) { mes "[Merchant]"; mes "Haha!"; mes "What are you, superhuman?"; @@ -133,7 +134,7 @@ morocc,180,259,3 script Merchant#morroc 85,{ payon,200,134,5 script Merchant#pay 85,{ set .@now_weight,MaxWeight-Weight; - if (.@now_weight < 6301) { + if (.@now_weight < 6301 || checkweight(1201,1) == 0) { mes "[Merchant]"; mes "Haha!"; mes "What are you, superhuman?"; @@ -188,7 +189,7 @@ payon,200,134,5 script Merchant#pay 85,{ aldebaran,152,63,5 script Merchant#alde 85,{ set .@now_weight,MaxWeight-Weight; - if (.@now_weight < 6301) { + if (.@now_weight < 6301 || checkweight(1201,1) == 0) { mes "[Merchant]"; mes "Haha!"; mes "What are you, superhuman?"; @@ -246,7 +247,7 @@ aldebaran,152,63,5 script Merchant#alde 85,{ geffen,173,88,5 script Merchant#geff 85,{ set .@now_weight,MaxWeight-Weight; - if (.@now_weight < 6301) { + if (.@now_weight < 6301 || checkweight(1201,1) == 0) { mes "[Merchant]"; mes "Haha!"; mes "What are you, superhuman?"; @@ -340,7 +341,7 @@ function script F_PotExchange { mes "mind, just enter '0' to cancel."; next; while(1) { - input .@input; + input .@input,0,101; if (.@input == 0) { mes "[Merchant]"; mes "What...?"; diff --git a/npc/merchants/old_pharmacist.txt b/npc/merchants/old_pharmacist.txt index f53eae7cf..530eed128 100644 --- a/npc/merchants/old_pharmacist.txt +++ b/npc/merchants/old_pharmacist.txt @@ -3,7 +3,7 @@ //===== By: ================================================== //= DZeroX //===== Current Version: ===================================== -//= 1.1b +//= 1.2 //===== Compatible With: ===================================== //= eAthena SVN Trunk //===== Description: ========================================= @@ -20,9 +20,18 @@ //= the official information. [DZeroX] //= 1.1a Removed .GATs [Lupus] //= 1.1b Fixed a bug in Orange Potion creating. Copy&Pasting = bad. [L0ne_W0lf] +//= 1.2 Added checkweight, and input min/max values. [L0ne_W0lf] //============================================================ alberta_in,16,28,4 script Old Pharmacist 61,{ + if (checkweight(1201,1) == 0) { + mes "- Wait a moment! -"; + mes "- Currently you're carrying -"; + mes "- too many items with you. -"; + mes "- Please come back later -"; + mes "- after you put some items into kafra storage. -"; + close; + } mes "[Old Pharmacist]"; mes "Err....Are you a customer...?"; switch(select("Make Potion","Talk.","Instruction of making potions","Cancel")) { @@ -87,7 +96,7 @@ alberta_in,16,28,4 script Old Pharmacist 61,{ next; mes "[Old Pharmacist]"; mes "Then pick a number below 100. If you don't want any, just enter '0'. With the materials you have, you can make about "+.@max+" potions."; - input .@amount; + input .@amount,0,101; if (.@amount == 0) { next; mes "[Old Pharmacist]"; diff --git a/npc/merchants/quivers.txt b/npc/merchants/quivers.txt index c035f9e25..9690b7323 100644 --- a/npc/merchants/quivers.txt +++ b/npc/merchants/quivers.txt @@ -25,13 +25,12 @@ //============================================================ payon_in01,5,134,5 script Inventor Jaax 89,{ - //set max_max_c1,CheckMaxCount; - //if (max_max_c1 == 1) { - // mes "[Inventor Jaax]"; - // mes "Hey, you're carrying"; - // mes "way too much stuff. Why don't you stash it away in Kafra Storage? We can talk after you do that, right?"; - // close; - //} + if (checkweight(1201,1) == 0) { + mes "[Inventor Jaax]"; + mes "Hey, you're carrying"; + mes "way too much stuff. Why don't you stash it away in Kafra Storage? We can talk after you do that, right?"; + close; + } set .@now_weight,MaxWeight-Weight; if (.@now_weight < 2000) { mes "[Inventor Jaax]"; -- cgit v1.2.3-70-g09d2