summaryrefslogtreecommitdiff
path: root/src/emap/script_buildins.c
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-08-25 00:35:15 -0300
committerJesusaves <cpntb1@ymail.com>2019-08-25 00:35:15 -0300
commit548057e189f0cb222833036836d5cda76e9f69c0 (patch)
tree10f8284fb50072a2e3dc91a07bb401ecd6ac827f /src/emap/script_buildins.c
parent7e0df96304fc6cc6019a46e89f64fbdb16cf7571 (diff)
downloadevol-hercules-548057e189f0cb222833036836d5cda76e9f69c0.tar.gz
evol-hercules-548057e189f0cb222833036836d5cda76e9f69c0.tar.bz2
evol-hercules-548057e189f0cb222833036836d5cda76e9f69c0.tar.xz
evol-hercules-548057e189f0cb222833036836d5cda76e9f69c0.zip
[TMW2 Patch]
Diffstat (limited to 'src/emap/script_buildins.c')
-rw-r--r--src/emap/script_buildins.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/src/emap/script_buildins.c b/src/emap/script_buildins.c
index 99bae19..7393da8 100644
--- a/src/emap/script_buildins.c
+++ b/src/emap/script_buildins.c
@@ -187,7 +187,8 @@ BUILDIN(npcTalk3)
BUILDIN(closeDialog)
{
getSD();
- send_npccommand(sd, st->oid, 5);
+ //send_npccommand(sd, st->oid, 5);
+ send_npccommand(sd, st->oid, 14);
return true;
}
@@ -198,6 +199,32 @@ BUILDIN(closeClientDialog)
return true;
}
+// npcshopattach(npc) will tell the scripts to run an event
+// Enabling OnBuyItem and OnSellItem events of npc
+BUILDIN(npcshopattach)
+{
+ const char* npcname = script_getstr(st,2);
+ struct npc_data* nd = npc->name2id(npcname);
+ int flag = 1;
+
+ if( script_hasdata(st,3) )
+ flag = script_getnum(st,3);
+
+ if( !nd ) {
+ //Not found.
+ script_pushint(st,0);
+ return true;
+ }
+
+ if (flag)
+ nd->master_nd = map->id2nd(st->oid);
+ else
+ nd->master_nd = NULL;
+
+ script_pushint(st,1);
+ return true;
+}
+
BUILDIN(shop)
{
getSD();
@@ -209,8 +236,14 @@ BUILDIN(shop)
return false;
}
+ // TMW2 Shops
+ /*
+ Move this to a new function, and comment the autoclose
+ Skip the forced check of SHOP type because I don't like it.
+
st->state = sd->state.dialog == 1 ? CLOSE : END;
clif->scriptclose(sd, st->oid);
+ */
clif->npcbuysell (sd, nd->bl.id);
return true;