diff options
Diffstat (limited to 'src/map/npc.c')
-rw-r--r-- | src/map/npc.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c index 383558eaf..a8bf7d371 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -40,6 +40,7 @@ #include "map/skill.h" #include "map/status.h" #include "map/unit.h" +#include "map/achievement.h" #include "common/HPM.h" #include "common/cbasetypes.h" #include "common/db.h" @@ -1761,8 +1762,8 @@ static bool npc_trader_pay(struct npc_data *nd, struct map_session_data *sd, int snprintf(evname, EVENT_NAME_LENGTH, "%s::OnPayFunds",nd->exname); if ( (ev = strdb_get(npc->ev_db, evname)) ) { - pc->setreg(sd,script->add_str("@price"),price); - pc->setreg(sd,script->add_str("@points"),points); + pc->setreg(sd,script->add_variable("@price"),price); + pc->setreg(sd,script->add_variable("@points"),points); script->run_npc(ev->nd->u.scr.script, ev->pos, sd->bl.id, ev->nd->bl.id); } else ShowError("npc_trader_pay: '%s' event '%s' not found, operation failed\n",nd->exname,evname); @@ -2271,7 +2272,11 @@ static int npc_selllist(struct map_session_data *sd, struct itemlist *item_list) } } + // Achievements [Smokexyz/Hercules] + achievement->validate_item_sell(sd, sd->status.inventory[idx].nameid, entry->amount); + pc->delitem(sd, idx, entry->amount, 0, DELITEM_SOLD, LOG_TYPE_NPC); + } if (z + sd->status.zeny > MAX_ZENY && nd->master_nd == NULL) @@ -2863,7 +2868,7 @@ static const char *npc_parse_shop(const char *w1, const char *w2, const char *w3 struct npc_item_list *items = NULL; size_t items_count = 40; // Starting items size - char *p; + const char *p; int x, y, dir, m, i, class_; struct npc_data *nd; enum npc_subtype type; @@ -4975,6 +4980,7 @@ static int npc_reload(void) instance->reload(); + map->zone_reload(); map->zone_init(); npc->motd = npc->name2id("HerculesMOTD"); /* [Ind/Hercules] */ |