Instant sell NPC + new features

Donation Box NPC sells instantly items from inventory. Minor patches.
This commit is contained in:
ronancpl
2016-07-18 13:46:28 -03:00
parent 7e32e5a762
commit d7a2243319
28 changed files with 290 additions and 67 deletions

View File

@@ -11,9 +11,14 @@ function action(mode, type, selection) {
return;
}
if (cm.c.getPlayer().getMapId() == 103000100 || cm.c.getPlayer().getMapId() == 600010001){
if(cm.getMeso() >= 5000){
var item = 4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000);
if(!cm.canHold(item)) {
cm.sendNext("You don't have a etc. slot available.");
}
else if(cm.getMeso() >= 5000){
cm.gainMeso(-5000);
cm.gainItem(4031711 + parseInt(cm.c.getPlayer().getMapId() / 300000000), 1);
cm.gainItem(item, 1);
cm.sendNext("There you go.");
}else
cm.sendNext("You don't have enough mesos.");