From 01c47d4231848107c45ca42cacaf5b04ad4dbfdf Mon Sep 17 00:00:00 2001 From: Reid Yaro Date: Sun, 26 May 2013 18:58:14 +0100 Subject: Add argument on inventoryplace. --- npc/000-1/ale.txt | 4 +--- npc/000-1/astapolos.txt | 4 +--- npc/000-1/chest.txt | 4 +--- npc/000-1/cookiemaster.txt | 2 +- npc/000-1/couwan.txt | 4 +--- npc/000-1/gulukan.txt | 2 +- npc/000-1/jalad.txt | 4 +--- npc/000-1/muller.txt | 4 +--- npc/000-1/tibbo.txt | 4 +--- npc/000-2-1/alige.txt | 6 ++---- npc/000-2-1/chefgado.txt | 8 ++------ npc/000-2-1/chest.txt | 2 +- npc/000-2-1/knife.txt | 2 +- npc/000-2-3/box.txt | 9 ++------- npc/000-2-3/nard.txt | 4 +--- npc/functions/inventoryplace.txt | 16 ++++++++-------- 16 files changed, 26 insertions(+), 53 deletions(-) (limited to 'npc') diff --git a/npc/000-1/ale.txt b/npc/000-1/ale.txt index df231c80..2a2189b3 100644 --- a/npc/000-1/ale.txt +++ b/npc/000-1/ale.txt @@ -30,9 +30,7 @@ mesq l("Hmm... Let's see, take this one."); next; - set @item, 714; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 714, 1; setq ShipQuests_Ale, 1; getitem "AquadaBox", 1; diff --git a/npc/000-1/astapolos.txt b/npc/000-1/astapolos.txt index 29edc84c..ab677af9 100644 --- a/npc/000-1/astapolos.txt +++ b/npc/000-1/astapolos.txt @@ -57,9 +57,7 @@ mesq lg("You have been so nice to me. So please, take one."); next; - set @item, 715; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 715, 1; setq ShipQuests_Astapolos, 1; getitem "CroconutBox", 1; diff --git a/npc/000-1/chest.txt b/npc/000-1/chest.txt index d502b04b..1ae22bdb 100644 --- a/npc/000-1/chest.txt +++ b/npc/000-1/chest.txt @@ -24,9 +24,7 @@ l_Give: if (@q > 0) goto l_Close; - set @item, 514; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 514, 1; setq ShipQuests_TreasureChest, 1; diff --git a/npc/000-1/cookiemaster.txt b/npc/000-1/cookiemaster.txt index 9558ed5b..d0f24e99 100644 --- a/npc/000-1/cookiemaster.txt +++ b/npc/000-1/cookiemaster.txt @@ -168,7 +168,7 @@ l_Reward: set @item, 517; set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 517, 1; setq General_Cookies, 1; getitem "DeliciousCookie", 1; diff --git a/npc/000-1/couwan.txt b/npc/000-1/couwan.txt index 624d54af..9789e599 100644 --- a/npc/000-1/couwan.txt +++ b/npc/000-1/couwan.txt @@ -42,9 +42,7 @@ mesq l("Yeye ask too much but do too less. Take this box and stop talking."); next; - set @item, 713; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 713, 1; mesn "Narrator"; mes col(l("Couwan hands you a box full of fish."), 9); diff --git a/npc/000-1/gulukan.txt b/npc/000-1/gulukan.txt index 1948a36b..0b4bc08f 100644 --- a/npc/000-1/gulukan.txt +++ b/npc/000-1/gulukan.txt @@ -53,7 +53,7 @@ l_Continue2: set @item, 715; set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 715, 1; setq ShipQuests_Gulukan, 1; getitem "CroconutBox", 1; diff --git a/npc/000-1/jalad.txt b/npc/000-1/jalad.txt index 035aecc6..7d70259a 100644 --- a/npc/000-1/jalad.txt +++ b/npc/000-1/jalad.txt @@ -39,9 +39,7 @@ l_Continue: mesq l("Surely. Take this box full of @@s.", getitemlink("Plushroom")); next; - set @item, 716; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 716, 1; setq ShipQuests_Jalad, 1; getitem "PlushroomBox", 1; diff --git a/npc/000-1/muller.txt b/npc/000-1/muller.txt index b3b25ed2..4ec728d8 100644 --- a/npc/000-1/muller.txt +++ b/npc/000-1/muller.txt @@ -42,9 +42,7 @@ mesq l("Well then... Take this one!"); next; - set @item, 716; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 716, 1; setq ShipQuests_QMuller, 1; getitem "PlushroomBox", 1; diff --git a/npc/000-1/tibbo.txt b/npc/000-1/tibbo.txt index 6dc57c2d..96eeae6a 100644 --- a/npc/000-1/tibbo.txt +++ b/npc/000-1/tibbo.txt @@ -39,9 +39,7 @@ mesq l("Bring this box to Gugli. He will be extremely happy!"); next; - set @item, 714; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 714, 1; setq ShipQuests_Tibbo, 1; getitem "AquadaBox", 1; diff --git a/npc/000-2-1/alige.txt b/npc/000-2-1/alige.txt index 1ebfd4cc..c416c42c 100644 --- a/npc/000-2-1/alige.txt +++ b/npc/000-2-1/alige.txt @@ -189,13 +189,11 @@ l_GiveFood: // if (@id == item's ID) then food is correct. // Do not put any other number than -1, 0, 1, 2 or the item's ID, that'll avoid confusion. - mes ""; - set @item, 507; - set @count, 3; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 507, 3; delitem @id, 1; setcamnpc; + mes ""; mesn; mesq l("Thank you so much! Here, have some of my berries."); diff --git a/npc/000-2-1/chefgado.txt b/npc/000-2-1/chefgado.txt index 5680265b..c50eddf2 100644 --- a/npc/000-2-1/chefgado.txt +++ b/npc/000-2-1/chefgado.txt @@ -120,9 +120,7 @@ l_OpenCroconut: l_GotAll: mes ""; - set @item, 717; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 717, 1; delitem "PiouLegs", 2; delitem "HalfCroconut", 1; @@ -162,9 +160,7 @@ l_PoisonJulia: mesn; mesq l("The usurper has been punished! This is a great day! Take this reward as a prize for your loyalty to the old commander!"); - set @item, 502; - set @count, 2; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 502, 2; set zeny, zeny + 60; message strcharinfo(0), l("You receive @@ E!", 60); diff --git a/npc/000-2-1/chest.txt b/npc/000-2-1/chest.txt index a6214373..bc57dcac 100644 --- a/npc/000-2-1/chest.txt +++ b/npc/000-2-1/chest.txt @@ -25,7 +25,7 @@ l_Give: if (@q > 1) goto l_Quit; set @item, 1300; set @count, 2; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 1300, 2; setq ShipQuests_Arpan, 2; getitem "CreasedShirt", 1; diff --git a/npc/000-2-1/knife.txt b/npc/000-2-1/knife.txt index 7797f4f5..4a37ffc9 100644 --- a/npc/000-2-1/knife.txt +++ b/npc/000-2-1/knife.txt @@ -28,7 +28,7 @@ l_Give: mes ""; set @item, 3500; set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 3500, 1; setq ShipQuests_Knife, 1; getitem "Knife", 1; diff --git a/npc/000-2-3/box.txt b/npc/000-2-3/box.txt index 1ae2b53d..ccc53420 100644 --- a/npc/000-2-3/box.txt +++ b/npc/000-2-3/box.txt @@ -73,10 +73,7 @@ l_NoQuest: mesq l("Now go outside and talk with Gugli, he'll tell you what we need."); next; - set @item, 718; - set @count, 1; - callfunc "InventoryPlace", @item, @count; - + callfunc "InventoryPlace", 718, 1; setq ShipQuests_Nard, 1; getitem "JohanneKey", 1; @@ -88,9 +85,7 @@ l_Give: mesn "Nard"; mesq l("You are now part of the crew. Thanks again for your help."); - set @item, 2900; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 2900, 1; setq ShipQuests_Nard, 5; getitem "Bandana", 1; diff --git a/npc/000-2-3/nard.txt b/npc/000-2-3/nard.txt index f67f89cb..8c236d0e 100644 --- a/npc/000-2-3/nard.txt +++ b/npc/000-2-3/nard.txt @@ -100,9 +100,7 @@ l_NeedContent: mesq l("Now go outside and talk with Gugli, he'll tell you what we need."); next; - set @item, 718; - set @count, 1; - callfunc "InventoryPlace", @item, @count; + callfunc "InventoryPlace", 718, 1; setq ShipQuests_Nard, 1; getitem "JohanneKey", 1; diff --git a/npc/functions/inventoryplace.txt b/npc/functions/inventoryplace.txt index 5d4b2d20..b34e773a 100644 --- a/npc/functions/inventoryplace.txt +++ b/npc/functions/inventoryplace.txt @@ -2,22 +2,22 @@ // Author: // Reid // Description: -// Check if the player have enough place on his inventory to accept new items. +// Check if the player have enough place on his inventory to accept new items with arguments: +// getarg(0) item ID, +// getarg(1) number of items, // Variables: -// @item = Item ID. -// @count = Number of items. // @iteminfo = Item information type. (See doc for list of item's types) // @countitem = Count item's number. function script InventoryPlace { getinventorylist; - set @iteminfo, getiteminfo(@item, 2); - set @countitem, countitem(@item); + set @iteminfo, getiteminfo(getarg(0), 2); + set @countitem, countitem(getarg(0)); - if (checkweight(@item, @count) == 0) goto l_Warn; + if (checkweight(getarg(0), getarg(1)) == 0) goto l_Warn; if ((@iteminfo < 4) && (@countitem == 0) && (@inventorylist_count < 100)) return; if ((@iteminfo < 4) && (@countitem > 0)) return; - if (@inventorylist_count + @count <= 100) return; + if (@inventorylist_count + getarg(1) <= 100) return; l_Warn: mes ""; @@ -27,4 +27,4 @@ l_Warn: mes col(l("You should come back when you'll have some free space."), 9); close; -} \ No newline at end of file +} -- cgit v1.2.3-60-g2f50