Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1022
CODE
static int pc_respawn(int tid,unsigned int tick,int id,int data)
{
struct map_session_data *sd = map_id2sd(id);
if (sd && pc_isdead(sd))
{ //Auto-respawn [Skotlex]
pc_setstand(sd);
pc_setrestartvalue(sd,3);
if(pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, 0))
clif_resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet.
}
return 0;
}
CODE
void clif_parse_Restart(int fd, struct map_session_data *sd)
{
switch(RFIFOB(fd,2)) {
case 0x00:
if (!pc_isdead(sd))
break;
pc_setstand(sd);
pc_setrestartvalue(sd, 3);
if (pc_setpos(sd, sd->status.save_point.map, sd->status.save_point.x, sd->status.save_point.y, 2))
clif_resurrection(&sd->bl, 1); //If warping fails, send a normal stand up packet.
break;
As you can see these two are identical, except for the 'clrtype' value (0 - fade out effect, 2 - respawn whoosh effect). The first is used by the pvp/gvg respawn timer. I suggest making a decent pc_respawn(player_data* sd, uint8 type) function, and directing these two pieces of code towards it (the timer func would have to get a new name).