Jump to content
  • 0

I need script which when killed twice in PVP


hirmitiph

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  06/06/12
  • Last Seen:  

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
Link to comment
Share on other sites

7 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  713
  • Reputation:   70
  • Joined:  11/08/11
  • Last Seen:  

that is the official behavior AFAIK o.O have you removed the old gvg mapflag?

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  06/06/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  06/06/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

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....

Link to comment
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.   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.

×
×
  • Create New...