NPCs Taxis and Crafters now checks properly
Fixed taxis that wouldn't check for mesos upon travel. Fixed crafters that wouldn't check for inventory slots available before crafting items.
This commit is contained in:
@@ -146,10 +146,23 @@ function action(mode, type, selection) {
|
||||
}
|
||||
else if (status == 5 && mode == 1) {
|
||||
var complete = true;
|
||||
var recvItem = item, recvQty;
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
recvQty = 1000 - (item - 2060000) * 100;
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
recvQty = 1000 - (item - 2061000) * 100;
|
||||
else if (item == 4003000)//screws
|
||||
recvQty = 15 * qty;
|
||||
else
|
||||
recvQty = qty;
|
||||
|
||||
if (cm.getMeso() < cost * qty)
|
||||
if(!cm.canHold(recvItem, recvQty)) {
|
||||
cm.sendOk("I'm afraid you are short in inventory slots for this.");
|
||||
}
|
||||
else if (cm.getMeso() < cost * qty)
|
||||
{
|
||||
cm.sendOk("I'm afraid you cannot afford my services.")
|
||||
cm.sendOk("I'm afraid you cannot afford my services.");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -188,14 +201,7 @@ function action(mode, type, selection) {
|
||||
if (cost > 0)
|
||||
cm.gainMeso(-cost * qty);
|
||||
|
||||
if (item >= 2060000 && item <= 2060002) //bow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2060000) * 100);
|
||||
else if (item >= 2061000 && item <= 2061002) //xbow arrows
|
||||
cm.gainItem(item, 1000 - (item - 2061000) * 100);
|
||||
else if (item == 4003000)//screws
|
||||
cm.gainItem(4003000, 15 * qty);
|
||||
else
|
||||
cm.gainItem(item, qty);
|
||||
cm.gainItem(recvItem, recvQty);
|
||||
cm.sendOk("There, finished. What do you think, a piece of art, isn't it? Well, if you need anything else, you know where to find me.");
|
||||
}
|
||||
cm.dispose();
|
||||
|
||||
Reference in New Issue
Block a user