Jayz Posted October 15, 2012 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 407 Reputation: 55 Joined: 07/24/12 Last Seen: October 22, 2024 Share Posted October 15, 2012 http://www.eathena.ws/board/index.php?showtopic=239404&st=0 i need this Quote Link to comment Share on other sites More sharing options...
goddameit Posted October 16, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted October 16, 2012 (edited) like this ? http://goo.gl/2hb5S Edited October 16, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 16, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 16, 2012 yes, similar to that however I still think its much better to script this using battleground system as the battleground system itself auto-create team and prevented players killing teammate PS: this topic also now under 1 of my to-do list, please leave this topic to me I did say I wanted to support anyone who wanted to make that but nobody even PM me how to make it so I guess I personally make this myself Quote Link to comment Share on other sites More sharing options...
goddameit Posted October 16, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted October 16, 2012 (edited) bg is a good way, but it needs to create a waitingroom to give a bg team (we have bg_monster_set_team but no bg_set_team? blablabla :3) Edited October 16, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 16, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 16, 2012 use this http://www.eathena.w...howtopic=275949 hmm ............... http://trac.rathena..../battleground.c no wonder it broke however I don't think that patch might work in rathena anymore ... maybe need to update the patch 1st before start writing this script Quote Link to comment Share on other sites More sharing options...
Michi Posted October 16, 2012 Group: Members Topic Count: 13 Topics Per Day: 0.00 Content Count: 99 Reputation: 10 Joined: 11/21/11 Last Seen: August 17, 2023 Share Posted October 16, 2012 I found that -> http://www.eathena.w...howtopic=248127 battleground script commands for rAthena last revision: Index: map/battleground.c =================================================================== --- map/battleground.c (revision 16819) +++ map/battleground.c (working copy) @@ -23,7 +23,7 @@ #include <stdio.h> static DBMap* bg_team_db; // int bg_id -> struct battleground_data* -static unsigned int bg_team_counter = 0; // Next bg_id +static unsigned int bg_team_counter = 1000; // Next bg_id struct battleground_data* bg_team_search(int bg_id) { // Search a BG Team using bg_id @@ -171,6 +171,22 @@ return bg->bg_id; } +int bg_create2( unsigned short bg_id, unsigned short mapindex, short rx, short ry, const char *ev, const char *dev ) { + struct battleground_data *bg = bg_team_search(bg_id); + if ( bg ) return 0; + CREATE(bg, struct battleground_data, 1); + bg->bg_id = bg_id; + bg->count = 0; + bg->mapindex = mapindex; + bg->x = rx; + bg->y = ry; + safestrncpy(bg->logout_event, ev, sizeof(bg->logout_event)); + safestrncpy(bg->die_event, dev, sizeof(bg->die_event)); + memset(&bg->members, 0, sizeof(bg->members)); + idb_put(bg_team_db, bg_id, bg); + return bg_id; +} + int bg_team_get_id(struct block_list *bl) { nullpo_ret(bl); Index: map/battleground.h =================================================================== --- map/battleground.h (revision 16819) +++ map/battleground.h (working copy) @@ -35,6 +35,7 @@ struct map_session_data* bg_getavailablesd(struct battleground_data *bg); int bg_create(unsigned short mapindex, short rx, short ry, const char *ev, const char *dev); +int bg_create2( unsigned short bg_id, unsigned short mapindex, short rx, short ry, const char *ev, const char *dev ); int bg_team_join(int bg_id, struct map_session_data *sd); int bg_team_delete(int bg_id); int bg_team_leave(struct map_session_data *sd, int flag); Index: map/script.c =================================================================== --- map/script.c (revision 16819) +++ map/script.c (working copy) @@ -16980,7 +16980,79 @@ return 0; } +// createbgid <battleground ID>, <respawn map>, <respawn x>, <respawn y>, <On Quit event>, <On Death event>; +BUILDIN_FUNC(createbgid) { + if ( bg_create2( script_getnum(st,2), mapindex_name2id( script_getstr(st,3) ), script_getnum(st,4), script_getnum(st,5), script_getstr(st,6), script_getstr(st,7) ) > 0 ) + script_pushint( st, script_getnum(st,2) ); + else + script_pushint( st, 0 ); + return 0; +} +// setbgid <battleground ID> {, <player name> }; +BUILDIN_FUNC(setbgid) { + unsigned short bg_id = script_getnum(st,2); + struct battleground_data *bg = bg_team_search(bg_id); + TBL_PC* sd; + if ( bg_id < 0 || bg_id > 1000 ) { + script_pushint( st, -4 ); + return 0; + } + if ( script_hasdata(st,3) ) + sd = map_nick2sd( script_getstr(st,3) ); + else + sd = script_rid2sd(st); + if ( sd == NULL ) { + script_pushint( st, -3 ); + return 0; + } + if ( bg_id > 0 && bg == NULL ) { + script_pushint( st, -1 ); + return 0; + } + if ( sd->bg_id == bg_id && bg_id != 0 ) { + script_pushint( st, -5 ); + return 0; + } + if ( sd->bg_id ) + bg_team_leave(sd,0); + if ( bg_id == 0 ) { + script_pushint( st, 0 ); + return 0; + } + if ( bg_team_join( bg_id, sd ) == 0 ) + script_pushint( st, -2 ); + else + script_pushint( st, bg_id ); + return 0; +} + +// getbgusers <battleground ID>; +BUILDIN_FUNC(getbgusers) { + struct battleground_data *bg = bg_team_search( script_getnum(st,2) ); + unsigned char i; + if ( bg == NULL ) { + script_pushint( st, -1 ); + return 0; + } + for ( i = 0; bg->members[i].sd != NULL; i++ ) + mapreg_setreg( reference_uid( add_str("$@arenamembers"), i ), bg->members[i].sd->bl.id ); + mapreg_setreg( add_str("$@arenamembersnum"), i ); + script_pushint( st, i ); + return 0; +} + +// bg_kickall <battleground ID>; +BUILDIN_FUNC(bg_kickall) { + struct battleground_data *bg = bg_team_search( script_getnum(st,2) ); + unsigned char i; + if ( bg == NULL ) + return 0; + for ( i = 0; bg->members[i].sd != NULL; i++ ) + bg_team_leave( bg->members[i].sd , 0 ); + return 0; +} + // declarations that were supposed to be exported from npc_chat.c #ifdef PCRE_SUPPORT BUILDIN_FUNC(defpattern); @@ -17433,5 +17505,9 @@ BUILDIN_DEF(checkquest, "i?"), BUILDIN_DEF(changequest, "ii"), BUILDIN_DEF(showevent, "ii"), + + BUILDIN_DEF(createbgid,"isiiss"), + BUILDIN_DEF(setbgid,"i?"), + BUILDIN_DEF(getbgusers,"i"), + BUILDIN_DEF(bg_kickall,"i"), {NULL,NULL,NULL}, -}; Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted October 16, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted October 16, 2012 (edited) at that time I overlooked that topic because a lot members complain about tabbing ... heading... etc which I thought that script might not get popular ... though and now comparing this request and that topic, its just simply not the same thing - request for randomizing team members, but the script use fix party vs party - request player from same team can attack each other, but the script use pvp ( I'll go for battleground ) - request for 1 specific player to be crown as king, but the script doesn't has one anyway thx for fixing the modification for me, I'll test it soon and post in source snippet PS: to list out top player kills in your team, sorting algorithm is required XD if you play counter-strike, and show the score, that's what I mean EDIT: I found that patch don't even have to fix anything lol Edited October 17, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
Cephaler Posted October 17, 2012 Group: Members Topic Count: 17 Topics Per Day: 0.00 Content Count: 132 Reputation: 2 Joined: 02/02/12 Last Seen: May 25, 2019 Share Posted October 17, 2012 like this ? http://goo.gl/2hb5S That's amazing.. is it working with latest rathena? Quote Link to comment Share on other sites More sharing options...
Jayz Posted October 17, 2012 Group: Members Topic Count: 59 Topics Per Day: 0.01 Content Count: 407 Reputation: 55 Joined: 07/24/12 Last Seen: October 22, 2024 Author Share Posted October 17, 2012 waiting for this btw thank annie and to all to writing script like this event Quote Link to comment Share on other sites More sharing options...
goddameit Posted October 17, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted October 17, 2012 like this ? http://goo.gl/2hb5S That's amazing.. is it working with latest rathena? I only use basic commands, so I think it could. Quote Link to comment Share on other sites More sharing options...
stydianx Posted November 5, 2012 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 390 Reputation: 27 Joined: 07/12/12 Last Seen: October 24, 2022 Share Posted November 5, 2012 will this evre be done? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 5, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 5, 2012 damn... I scare people bump unnecessary topics =/ this one will get started after I finish that wow battleground, and maybe your ro-bust event and I felt this script can be as challenging as wow battleground Quote Link to comment Share on other sites More sharing options...
stydianx Posted November 5, 2012 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 390 Reputation: 27 Joined: 07/12/12 Last Seen: October 24, 2022 Share Posted November 5, 2012 (edited) damn... I scare people bump unnecessary topics =/ this one will get started after I finish that wow battleground, and maybe your ro-bust event and I felt this script can be as challenging as wow battleground are you going to do what GDI said? as shown here in the bottom link? like this ? http://goo.gl/2hb5S Edited November 5, 2012 by stydianx Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 5, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 5, 2012 (edited) nah ... I'm going to do in my own way btw, please be more considerable that there are certain kind of scripts can take up to weeks or even months to finish this one is estimated need to tackle for about 2 weeks after declare started and right now I have TONS of PMs need to solve first EDIT you seriously think every script here is done in 1 night ? true ... some below 100 lines script I can finish in hours but this one will be estimated over 600 lines Edited November 5, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
miczster Posted April 3, 2013 Group: Members Topic Count: 40 Topics Per Day: 0.01 Content Count: 275 Reputation: 7 Joined: 10/08/12 Last Seen: May 21, 2016 Share Posted April 3, 2013 wow,,,,also been looking for this Like this brings me back memories of some server I played way back years ago(Forgot it though).... I'll be checking this post... Quote Link to comment Share on other sites More sharing options...
Question
Jayz
http://www.eathena.ws/board/index.php?showtopic=239404&st=0
i need this
Link to comment
Share on other sites
14 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.