athlum_in,94,157,3 script Branch Manager 865,{
set @npc$, "[^0000FFBranch Manager^000000]";
mes @npc$;
mes "Hi!";
mes "I can convert your Dead Branch to Bloody Branch, and your Bloody Branch to Dead Branch.";
next;
set .@makestr$, "Make "+getitemname(.@items[0])+":Make "+getitemname(.@items[1]);
set .@i, select(.@makestr$)-1;
setarray @items[0], 604, 12103;
set .@converts_from, @items[.@i];
set .@converts_to, @items[.@i^1];
// this check is technically duplicate. keep ?
if (countitem(.@converts_from))
{
mes @npc$;
mes "You don't even have enough "+getitemname(.@converts_from)+" to convert to "+getitemname(.@converts_to)+"!";
close;
}
mes @npc$;
mes "Input how many "+getitemname(.@converts_from)+" you want to exchange.";
input(.@amount);
if (.@amount == 0)
{
mes "..That's not enough!";
close;
}
if (.@amount > countitem(.@converts_from))
{
mes "You don't have that many "+getitemname(.@converts_from)+"!";
close;
}
if (!checkweight(.@converts_to, .@amount))
{
mes "You can't hold that many "+getitemname(.@converts_from)+"!";
close;
}
delitem(.@converts_from, .@amount);
getitem(.@converts_to, .@amount);
close;
}