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
commit35467de0fb6dc06a402315ea478495d74080e3c5 (patch)
tree79659d470525996eb45773c0d196df440b35330e /src/map/script.c
parent89974727211311dc13f3c823ab6f565f8942455b (diff)
downloadhercules-35467de0fb6dc06a402315ea478495d74080e3c5.tar.gz
hercules-35467de0fb6dc06a402315ea478495d74080e3c5.tar.bz2
hercules-35467de0fb6dc06a402315ea478495d74080e3c5.tar.xz
hercules-35467de0fb6dc06a402315ea478495d74080e3c5.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/trunk@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,""),