summaryrefslogtreecommitdiff
path: root/src/map/script.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-23 09:26:00 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-23 09:26:00 +0000
commit7d7f935061145b4f387ce904ec3d1c44612341bb (patch)
tree81961130b37c75bd7915bc46247fea87c3709f40 /src/map/script.c
parent012a470926be6d0d0f51f877c6ba1ffd3422ea3a (diff)
downloadhercules-7d7f935061145b4f387ce904ec3d1c44612341bb.tar.gz
hercules-7d7f935061145b4f387ce904ec3d1c44612341bb.tar.bz2
hercules-7d7f935061145b4f387ce904ec3d1c44612341bb.tar.xz
hercules-7d7f935061145b4f387ce904ec3d1c44612341bb.zip
* Added script command pushpc, which is required by newer scripts.
- Moved knockback-part of skill_blown into unit_blown, to allow unconditional knockback required by pushpc without copy-pasting code. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14492 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/script.c')
-rw-r--r--src/map/script.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/map/script.c b/src/map/script.c
index d823ae597..906dce510 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -14380,6 +14380,44 @@ BUILDIN_FUNC(progressbar)
return 0;
}
+BUILDIN_FUNC(pushpc)
+{
+ int direction, cells, dx, dy;
+ struct map_session_data* sd;
+
+ if((sd = script_rid2sd(st))==NULL)
+ {
+ return 0;
+ }
+
+ direction = script_getnum(st,2);
+ cells = script_getnum(st,3);
+
+ if(direction<0 || direction>7)
+ {
+ ShowWarning("buildin_pushpc: Invalid direction %d specified.\n", direction);
+ script_reportsrc(st);
+
+ direction%= 8; // trim spin-over
+ }
+
+ if(!cells)
+ {// zero distance
+ return 0;
+ }
+ else if(cells<0)
+ {// pushing backwards
+ direction = (direction+4)%8; // turn around
+ cells = -cells;
+ }
+
+ dx = dirx[direction];
+ dy = diry[direction];
+
+ unit_blown(&sd->bl, dx, dy, cells, 0);
+ return 0;
+}
+
// declarations that were supposed to be exported from npc_chat.c
#ifdef PCRE_SUPPORT
BUILDIN_FUNC(defpattern);
@@ -14739,6 +14777,7 @@ struct script_function buildin_func[] = {
BUILDIN_DEF(setfont,"i"),
BUILDIN_DEF(areamobuseskill,"siiiiviiiii"),
BUILDIN_DEF(progressbar, "si"),
+ BUILDIN_DEF(pushpc,"ii"),
// WoE SE
BUILDIN_DEF(agitstart2,""),
BUILDIN_DEF(agitend2,""),