Jump to content
  • 0
Sign in to follow this  
luis.seifert

[Help] Battleground script

Question

Hello folks, i'm tryning to make this happen in battleground:

 - when you die you still dead for 10 seconds, then you are ressurrected in the same spot that you have died

 

what actually happen:

 - insta respawn in the spawn coordinates of team. 

 

Thanks for the help. /kis

 

also, i'm using AnnieRuru custom BG script... 

OnRedDead:	.bluescore++;	announce ""+strcharinfo(0)+" morreu", bc_map; // just a test to see if its attached	message ""+strcharinfo(0),"Espere 10 segundos para ser revivido!";	bg_updatescore "guild_vs4",.redscore,.bluescore;	sleep2 10000;	percentheal 100,100;	end;

I know that is missing the ressurrect command, this is whats scares me, I don't know how and why he is getting alive alone.  

Edited by luis.seifert

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0
src/map/pc.c
	} else if( sd->bg_id ) {		struct battleground_data *bgd = bg->team_search(sd->bg_id);		if( bgd && bgd->mapindex > 0 ) { // Respawn by BG			if(strcmp( mapindex_id2name(sd->mapindex), "guild_vs3" )){				timer->add(tick+1000, pc->respawn_timer, sd->bl.id, 0);				return 1|8;			}		}	}
Change "guild_vs3" to your map and recompile.
 
Or you can use:
.red=createbgid("",0,0,strnpcinfo(3)+"::OnRedQuit",strnpcinfo(3)+"::OnRedDead");
This way the respawn map do not exist, and will display a little error in map-server, what don't disrupts nothing.

Share this post


Link to post
Share on other sites
  • 0

Thanks for the answer jaBote, mapflag was the first thing that i tested. Check my mapflag: 

//guild_vs4	mapflag	battleground	2guild_vs4	mapflag	nosave	SavePointguild_vs4	mapflag	nowarpguild_vs4	mapflag	nowarptoguild_vs4	mapflag	noteleportguild_vs4	mapflag	nomemoguild_vs4	mapflag	nopenaltyguild_vs4	mapflag	nobranchguild_vs4	mapflag	noicewall

Tested with the battleground and without it.

I'm starting to think that is some configuration in the battleground script or something apart.

 

and npc/mapflag/gvg.txt
 

//guild_vs4	mapflag	gvg
Edited by luis.seifert

Share this post


Link to post
Share on other sites
  • 0

Oh, true. You get respawned because you still belong to a BG team.

 

Look on your src/map/pc.c for something like this inside your pc_dead function:

 

	//GvG	if( map_flag_gvg2(sd->bl.m) ) {		timer->add(tick+1, pc->respawn_timer, sd->bl.id, 0);		return 1|8;	} else if( sd->bg_id ) {		struct battleground_data *bgd = bg->team_search(sd->bg_id);		if( bgd && bgd->mapindex > 0 ) { // Respawn by BG			timer->add(tick+1000, pc->respawn_timer, sd->bl.id, 0);			return 1|8;		}	}

 

Comment the following lines:

 

	} else if( sd->bg_id ) {		struct battleground_data *bgd = bg->team_search(sd->bg_id);		if( bgd && bgd->mapindex > 0 ) { // Respawn by BG			timer->add(tick+1000, pc->respawn_timer, sd->bl.id, 0);			return 1|8;		}

 

And recompile. Now none of your BGs will do the automatic warp out, but you should ask them not to "go back to savepoint" because that will cause them to abandon BG.

Share this post


Link to post
Share on other sites
  • 0

You could edit:

/// Response to the death/system menu (CZ_RESTART)./// 00b2 <type>.B/// type:///     0 = restart (respawn)///     1 = char-select (disconnect)void clif_parse_Restart(int fd, struct map_session_data *sd) {	switch(RFIFOB(fd,2)) {		case 0x00:			pc->respawn(sd,CLR_OUTSIGHT);			break;		case 0x01:			/*	Rovert's Prevent logout option - Fixed [Valaris]	*/			if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] &&				(!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )			{	//Send to char-server for character selection.				chrif->charselectreq(sd, session[fd]->client_addr);			} else {				clif->disconnect_ack(sd, 1);			}			break;	}}

To just not work in BG's or resurrect you at that spot.

void clif_parse_Restart(int fd, struct map_session_data *sd) {	switch(RFIFOB(fd,2)) {		case 0x00:			if( sd->bg_id ) {				if( !pc_isdead(sd) )					return;				status->revive(&sd->bl, 100, 100);				clif->skill_nodamage(&sd->bl,&sd->bl,ALL_RESURRECTION,4,1);				break;			} else {			pc->respawn(sd,CLR_OUTSIGHT);			break;			}		case 0x01:			/*	Rovert's Prevent logout option - Fixed [Valaris]	*/			if( !sd->sc.data[SC_CLOAKING] && !sd->sc.data[SC_HIDING] && !sd->sc.data[SC_CHASEWALK] && !sd->sc.data[SC_CLOAKINGEXCEED] && !sd->sc.data[SC__INVISIBILITY] &&				(!battle_config.prevent_logout || DIFF_TICK(timer->gettick(), sd->canlog_tick) > battle_config.prevent_logout) )			{	//Send to char-server for character selection.				chrif->charselectreq(sd, session[fd]->client_addr);			} else {				clif->disconnect_ack(sd, 1);			}			break;	}}

You just gotta add the 10second timer there so if they do CLICK the button, it'll need to wait 10seconds D:

Share this post


Link to post
Share on other sites
  • 0

if you modify like jabote did, that will affect any other battleground script, which possibly caused them bug

 

I won't touch the source if I were you

 

the practical way to do this, is make them wait inside a room

http://rathena.org/board/topic/97602-annierurus-bg-emp-edit-request/?p=267413

I've seen 2 battleground script using this method

Edited by AnnieRuru

Share this post


Link to post
Share on other sites
  • 0

Thanks for Annie and char0 for the help, I think it's solved for me. 

with the source modifications sugested by char0, you will respawn at the team coordinates with no life when you click in "back to respawn point" .

Edited by luis.seifert

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.