summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-11-26 16:58:56 +0300
committerAndrei Karas <akaras@inbox.ru>2014-11-26 16:58:56 +0300
commit369f7b3a44b0838e168ef7dcdc36d182845e8874 (patch)
tree57690592aef1c0560aef150ea87e2e6f2f8c7e1b /src/map
parente7434a2c9bb05e2c2404092cab842236e9a155e8 (diff)
downloadevol-hercules-369f7b3a44b0838e168ef7dcdc36d182845e8874.tar.gz
evol-hercules-369f7b3a44b0838e168ef7dcdc36d182845e8874.tar.bz2
evol-hercules-369f7b3a44b0838e168ef7dcdc36d182845e8874.tar.xz
evol-hercules-369f7b3a44b0838e168ef7dcdc36d182845e8874.zip
Replace script function misceffect2 to misceffect.
Diffstat (limited to 'src/map')
-rw-r--r--src/map/init.c3
-rw-r--r--src/map/script.c30
-rw-r--r--src/map/script.h1
3 files changed, 32 insertions, 2 deletions
diff --git a/src/map/init.c b/src/map/init.c
index 910b5df..03e6320 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -74,8 +74,7 @@ HPExport void plugin_init (void)
addScriptCommand("setnpcdir", "*", setNpcDir);
addScriptCommand("rif", "is*", rif);
addScriptCommand("countitemcolor", "v*", countItemColor);
- // must be replaced to misceffect
- addScriptCommand("misceffect2", "i*", dummy);
+ addScriptCommand("misceffect", "i*", miscEffect);
do_init_langs();
diff --git a/src/map/script.c b/src/map/script.c
index bdf8bb2..618f89c 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -401,3 +401,33 @@ BUILDIN(countItemColor)
script_pushint(st, count);
return true;
}
+
+BUILDIN(miscEffect)
+{
+ int type = script_getnum(st, 2);
+ struct block_list *bl = NULL;
+
+ if (script_hasdata(st, 3))
+ {
+ if (script_isstring(st, 3))
+ {
+ TBL_PC *sd = map->nick2sd(script_getstr(st, 3));
+ if (sd)
+ bl = &sd->bl;
+ }
+ else if (script_isint(st, 3))
+ {
+ bl = map->id2bl(script_getnum(st, 3));
+ }
+ }
+
+ if (!bl)
+ {
+ TBL_PC *sd = script->rid2sd (st);
+ if (sd)
+ bl = &sd->bl;
+ }
+ if (bl)
+ clif->specialeffect(bl, type, AREA);
+ return true;
+}
diff --git a/src/map/script.h b/src/map/script.h
index a58b071..15efc00 100644
--- a/src/map/script.h
+++ b/src/map/script.h
@@ -19,5 +19,6 @@ BUILDIN(getNpcDir);
BUILDIN(setNpcDir);
BUILDIN(rif);
BUILDIN(countItemColor);
+BUILDIN(miscEffect);
#endif // EVOL_MAP_SCRIPT