normally this script hasn't anybug (I had tested)

you can found it here(pasterbin)
I wish that script is helpful

Lien... & Wario
This forum houses many years of development, tracing back to some of the earliest posts that exist on the board. Its current use is for the continued development of the server and game it has always served: The Mana World.
1:1... well, if it's 1:2 and player do @num irregular how cut a herb in two parts !argul wrote:that is a nice idea...
But do you think an elf would change that in a ration 1:1?
I would put that elf on that map before the graveyard. At some location, where many wisps are flying around?
Pjotr
Crush wrote:Having an NPC which exchanges herbs at the rate 1:1 would pretty much defeat the purpose of having differently colored herbs.
It also has an exploit which is not that obvious at first. You are checking the amount of herbs the character has during the dialog, but not again right before doing the exchange. This will allow the player to trade away his herbs during the dialog. Because @delitem will do nothing when the character hasn't got the item but @getitems will work properly afterwards, this will allow the players to duplicate herbs. But don't worry, we trapped in that trap, too.
Code: Select all
if(@num > countitem(@hkind)) goto L_notherb;
Division always rounds down to the next integer. So when the player enters an uneven number one herb will be lost. Alternatively, let the player enter the number of herbs he wants, not the number he gives.lien wrote:1:1... well, if it's 1:2 and player do @num irregular how cut a herb in two parts !
Yes, checking the number again just before calling delitem will fix this exploit.lien wrote:can be reuse in L_change ?Code: Select all
if(@num > countitem(@hkind)) goto L_notherb;
ok so L change will looks like something like thatCrush wrote:Division always rounds down to the next integer. So when the player enters an uneven number one herb will be lost. Alternatively, let the player enter the number of herbs he wants, not the number he gives.lien wrote:1:1... well, if it's 1:2 and player do @num irregular how cut a herb in two parts !
"How many of my herbs do you want?"
(Player enters 42)
"Then I want 84 of your herbs."
Yes, checking the number again just before calling delitem will fix this exploit.lien wrote:can be reuse in L_change ?Code: Select all
if(@num > countitem(@hkind)) goto L_notherb;
Code: Select all
L_change:
if(@num > countitem(@hkind)) goto L_notherb;
mes "[Elf]";
mes "\"well, there is .\"";
delitem @hkind,@num*2; //ratio 2:1
getitem @want,@num;
close;
}
Code: Select all
009-1.gat,80,47,0 script pearlchanger 120,{
set @NPCName$, "[test]";
set @item_type$, "pearl";
setarray @menu_Item_Wanted$, "Never Mind", "Diamond", "Ruby", "Emerauld","Sapphire","Topaz","Amethist";
setarray @item_wanted_ID, 0, 4002, 4003, 4004, 4005, 4006, 4007;
set @items_number, 7;
set @ratio, 1;
callfunc "itemchanger";
}