[Help] Battleground script

luis.seifert

New member
Messages
51
Points
0
Github
Luis~
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.  

 
Last edited by a moderator:
Mapflags gvg, battlegrounds and gvg_castle cause this behavior. Once you're dead, you're immediately teleported back to savepoint (BG savepoint if on BG).

 
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
 

Code:
//guild_vs4	mapflag	gvg
 
Last edited by a moderator:
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.

 
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:

 
Last edited by a moderator:
src/map/pc.c
Code:
	} 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:
Code:
.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.
 
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" .

 
Last edited by a moderator:
Back
Top