diff options
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; +} |