diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-28 18:36:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-28 18:36:58 +0300 |
commit | 07758e21abf23ad6742b0f6aacedbb7c60c81e98 (patch) | |
tree | 7f5b9b0bd7107426f97bc91150b52d2655e0d3f4 /src/emap/script.c | |
parent | 7218f15b792d6ae2bf88b65f6901ae5aa86ecb7a (diff) | |
download | evol-hercules-07758e21abf23ad6742b0f6aacedbb7c60c81e98.tar.gz evol-hercules-07758e21abf23ad6742b0f6aacedbb7c60c81e98.tar.bz2 evol-hercules-07758e21abf23ad6742b0f6aacedbb7c60c81e98.tar.xz evol-hercules-07758e21abf23ad6742b0f6aacedbb7c60c81e98.zip |
Add support for team id for battleground players.
New script function: setbgteam bgid, num
It set for 'bgid' team id to 'num'.
Diffstat (limited to 'src/emap/script.c')
-rw-r--r-- | src/emap/script.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/emap/script.c b/src/emap/script.c index 72b50c7..ebcc33b 100644 --- a/src/emap/script.c +++ b/src/emap/script.c @@ -27,9 +27,11 @@ #include "emap/lang.h" #include "emap/scriptdefines.h" #include "emap/send.h" +#include "emap/data/bgd.h" #include "emap/data/mapd.h" #include "emap/data/npcd.h" #include "emap/data/session.h" +#include "emap/struct/bgdext.h" #include "emap/struct/mapdext.h" #include "emap/struct/npcdext.h" #include "emap/struct/sessionext.h" @@ -1669,3 +1671,21 @@ BUILDIN(npcWalkTo) return true; } + +BUILDIN(setBgTeam) +{ + int bgId = script_getnum(st, 2); + int teamId = script_getnum(st, 3); + + struct battleground_data *bgd = bg->team_search(bgId); + struct BgdExt *data = bgd_get(bgd); + if (!data) + { + ShowWarning("bettle ground not found\n"); + script->reportsrc(st); + return false; + } + + data->teamId = teamId; + return true; +} |