Originally posted by [b]BabyIze[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=4858
Simple script
QUOTE
function script F_OnCore_Sell {
function F_OnValuePrice
{
switch(getarg(0))
{
case 2302:
return 500;
case 1228:
return 1000000;
}
return getiteminfo(getarg(0),0);
}
set .@tmp_zeny, 0;
for (set .@i, 0; .@i < getarraysize(@sold_nameid); set .@i, .@i + 1)
{
set .@nameid, @sold_nameid[.@i];
set .@amount, @sold_quantity[.@i];
if (.@nameid <= 0 || countitem(.@nameid) < .@amount)
continue;
// add tmp
set .@t, getarraysize(.@tmp_nameid);
set .@tmp_nameid[.@t], .@nameid;
set .@tmp_amount[.@t], .@amount;
set .@tmp_zeny, .@tmp_zeny + F_OnValuePrice(.@nameid) * .@amount;
}
set zeny,zeny+ .@tmp_zeny;
for (set .@i, 0; .@i < getarraysize(.@tmp_nameid); set .@i, .@i + 1)
{
if (.@tmp_nameid[.@i] <= 0 || .@tmp_amount[.@i] <= 0)
continue;
delitem .@tmp_nameid[.@i], .@tmp_amount[.@i];
}
return;
}
Simple event
If the items within the same item id.
However, different parts of the upgrade.
QUOTE
Event For example
1. Buy weapons in the shop to 3-4 ea
2. Equip weapons in hand and then use the command @refine 0 10
- knife +10 1ea in hand
- knife +0 1ea in inventory
- knife +0 1ea in inventory
- knife +0 1ea in inventory
3. Unequip weapons in hand
- knife +10 1ea in inventory
- knife +0 1ea in inventory
- knife +0 1ea in inventory
- knife +0 1ea in inventory
4. Sell for script control, Select the items sold not upgrade.
Results event
Item that upgrade, Be sold by
I think it would have a problem with array itemlist and sort item
Between inventory and sell windows type.
Sorry for my language is not strong. (IMG:
style_emoticons/default/smile.gif)
This post has been edited by BabyIze: Apr 10 2011, 04:28 AM