From 0884f746a4c82c31b7d98d2f2f95ad9508d01525 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Tue, 17 Mar 2009 22:32:49 +0000 Subject: - Implemented official battlechat packets (thanks to Pakpil). - Implemented the scoreboard packets (thanks to Pakpil). - Updates to Tierra Valley according to official info. * There are no barricades around each base, barricades are in the middle left path. * There is another graveyard used for the owners of the middle base, with faster spawn (each 20 seconds). * I added a flag respawn in the middle, currently I don't know if this if official or not, but it allows each team recapture the middle base. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13593 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/script.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/map/script.c') diff --git a/src/map/script.c b/src/map/script.c index d7a3b1e07..5c1836c97 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -13405,6 +13405,20 @@ BUILDIN_FUNC(waitingroom2bg_single) return 0; } +BUILDIN_FUNC(bg_team_setxy) +{ + struct battleground_data *bg; + int bg_id; + + bg_id = script_getnum(st,2); + if( (bg = bg_team_search(bg_id)) == NULL ) + return 0; + + bg->x = script_getnum(st,3); + bg->y = script_getnum(st,4); + return 0; +} + BUILDIN_FUNC(bg_warp) { int x, y, mapindex, bg_id; @@ -13437,6 +13451,26 @@ BUILDIN_FUNC(bg_monster) return 0; } +BUILDIN_FUNC(bg_monster_set_team) +{ + struct mob_data *md; + struct block_list *mbl; + int id = script_getnum(st,2), + bg_id = script_getnum(st,3); + + if( (mbl = map_id2bl(id)) == NULL || mbl->type != BL_MOB ) + return 0; + md = (TBL_MOB *)mbl; + md->state.bg_id = bg_id; + + mob_stop_attack(md); + mob_stop_walking(md, 0); + md->target_id = md->attacked_id = 0; + clif_charnameack(0, &md->bl); + + return 0; +} + BUILDIN_FUNC(bg_leave) { struct map_session_data *sd = script_rid2sd(st); @@ -13489,6 +13523,22 @@ BUILDIN_FUNC(bg_getareausers) return 0; } +BUILDIN_FUNC(bg_updatescore) +{ + const char *str; + int m; + + str = script_getstr(st,2); + if( (m = map_mapname2mapid(str)) < 0 ) + return 0; + + map[m].bgscore_lion = script_getnum(st,3); + map[m].bgscore_eagle = script_getnum(st,4); + + clif_bg_updatescore(m); + return 0; +} + BUILDIN_FUNC(bg_get_data) { struct battleground_data *bg; @@ -13874,12 +13924,15 @@ struct script_function buildin_func[] = { // BattleGround BUILDIN_DEF(waitingroom2bg,"siiiss?"), BUILDIN_DEF(waitingroom2bg_single,"isiis"), + BUILDIN_DEF(bg_team_setxy,"iii"), BUILDIN_DEF(bg_warp,"isii"), BUILDIN_DEF(bg_monster,"isiisi*"), + BUILDIN_DEF(bg_monster_set_team,"ii"), BUILDIN_DEF(bg_leave,""), BUILDIN_DEF(bg_destroy,"i"), BUILDIN_DEF(areapercentheal,"siiiiii"), BUILDIN_DEF(bg_get_data,"ii"), BUILDIN_DEF(bg_getareausers,"isiiii"), + BUILDIN_DEF(bg_updatescore,"sii"), {NULL,NULL,NULL}, }; -- cgit v1.2.3-60-g2f50