Jump to content
  • 0

I need script which when killed twice in PVP


Question

Posted (edited)

I need a script that when you killed the player twice in PVP they will automatically warped back on their save points. I use Guild_vs3 as map of my pvp room in my server and i have already set the mapflag pvp. somebody here can help me out as soon as possible? Thanks in advance.

Edited by hirmitiph

7 answers to this question

Recommended Posts

Posted

Here is the code already in trunk/src/map/pc.c

    // pvp
   // disable certain pvp functions on pk_mode [Valaris]
   if( map[sd->bl.m].flag.pvp && !battle_config.pk_mode && !map[sd->bl.m].flag.pvp_nocalcrank )
   {
       sd->pvp_point -= 5;
       sd->pvp_lost++;
       if( src && src->type == BL_PC )
       {
           struct map_session_data *ssd = (struct map_session_data *)src;
           ssd->pvp_point++;
           ssd->pvp_won++;
       }
       if( sd->pvp_point < 0 )
       {
           add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0);
           return 1|8;
       }
   }

They will auto-respawn after dying twice if:

- the map has the 'pvp' mapflag

- 'pk_mode' is off

- the map does NOT have the 'pvp_nocalcrank' mapflag

Posted (edited)

OnPCDieEvent:
set @Die,@Die + 1;
if( @Die % 2 == 0 ) warp "SavePoint",0,0;
end;

Your script is working but, if I attack other players, me as the attacker....I will warp in my savepoint.

Here is the code already in trunk/src/map/pc.c

	// pvp
// disable certain pvp functions on pk_mode [Valaris]
if( map[sd->bl.m].flag.pvp && !battle_config.pk_mode && !map[sd->bl.m].flag.pvp_nocalcrank )
{
	sd->pvp_point -= 5;
	sd->pvp_lost++;
	if( src && src->type == BL_PC )
	{
		struct map_session_data *ssd = (struct map_session_data *)src;
		ssd->pvp_point++;
		ssd->pvp_won++;
	}
	if( sd->pvp_point < 0 )
	{
		add_timer(tick+1000, pc_respawn_timer,sd->bl.id,0);
		return 1|8;
	}
}

They will auto-respawn after dying twice if:

- the map has the 'pvp' mapflag

- 'pk_mode' is off

- the map does NOT have the 'pvp_nocalcrank' mapflag

It is not working in my server. i don't know why :/

Edited by hirmitiph
Posted
Your script is working but, if I attack other players, me as the attacker...... if I attack other player...I will warp in my savepoint.

/hmm ? the script are suppose to trigger upon your character is died...not during attack...and it shouldnt warp the attacker but only the 1 that killed by attacker...

it will warp ur character that died for second times...

work fine and tested in my server.

Posted
Your script is working but, if I attack other players, me as the attacker...... if I attack other player...I will warp in my savepoint.

/hmm ? the script are suppose to trigger upon your character is died...not during attack...and it shouldnt warp the attacker but only the 1 that killed by attacker...

it will warp ur character that died for second times...

work fine and tested in my server.

Yeah, it is working when the player died twice, but if I attack another player after I killed that one, the another one that I killed will remain in the pvp but I, as the attacker or the killer will warp back to my savepoint.

Posted

did you added another scripts or you have another script that trigger it ?

because like i mentioned above...this script wont be triggered untill the player died ..

no matter it is killer or the death person....this script will only warp the death person....

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.   Paste as plain text instead

  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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...