Jump to content
  • 0

Basic Script Convert


Onairda

Question


  • Group:  Members
  • Topic Count:  70
  • Topics Per Day:  0.03
  • Content Count:  164
  • Reputation:   8
  • Joined:  12/30/16
  • Last Seen:  

Hello! ?
 

Can someone help me to edit this script?

What I want is If player get killed on the pvp map, he will loose 100,000z, and the player who killed will got 100,000z and white potion.

but if the player who got died doesn't have a Zeny the killer will also not get any Zeny and a potion.

 

-	script	PVPPOINTS	-1,{

OnPCKillEvent:
getmapxy.@map$,.@x,.@y,0;
if(getcharid(3) == killedrid) end;
if(.@map$ != "pvp_y_1-2") end;

set .@player1, getcharid(3);
set .@player2, killedrid;

attachrid(.@player2);
set .@player2points, #CASHPOINTS;
if(.@player2points) {
 set #CASHPOINTS, #CASHPOINTS - 1;
 dispbottom "You Lost 1 Cash Point from "+rid2name(killerrid);
}
 emotion e_sob,1;

attachrid(.@player1);
if(.@player2points) {
 set #CASHPOINTS, #CASHPOINTS + 1;
 dispbottom "You Gained 1 Cash Points from "+rid2name(killedrid);
}
else
 dispbottom "Sorry no cash points on the "+rid2name(killedrid);
 emotion e_meh,1;
end;
} 

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  924
  • Reputation:   166
  • Joined:  04/05/13
  • Last Seen:  

You can use my scripts (Make sure you modify it to your own way)

https://raw.githubusercontent.com/kaninhot004/rathena/team-craft/npc/utilities/die_event.txt

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  177
  • Reputation:   25
  • Joined:  12/24/14
  • Last Seen:  

try this, but not tested
 

-	script	PVPPOINTS	-1,{

OnPCKillEvent:
	getmapxy.@map$,.@x,.@y,0;

	if (getcharid(3) == killedrid) end;
	if (.@map$ != "pvp_y_1-2") end;

	set .@player1, getcharid(3);
	set .@player2, killedrid;

	attachrid(.@player2);
	if (Zeny > 100000) {
		set Zeny, Zeny - 100000;
		dispbottom "You Lost 100.000 Zeny from "+rid2name(killerrid);
		emotion e_sob,1;
	}
	else {
		dispbottom "Sorry no Zeny on the "+rid2name(killedrid);
		emotion e_meh,1;
	}

	attachrid(.@player1);
	if (Zeny > 100000) {
		set Zeny, Zeny + 100000;
		getitem 504,1;
		dispbottom "You Gained 100.000 Zeny from "+rid2name(killedrid);
		dispbottom "You Gained 1 White Potion from "+rid2name(killedrid);
	}
	else {
		dispbottom "Sorry no Zeny on the "+rid2name(killedrid);
		emotion e_meh,1;
	}
end;
}

 

  • Upvote 1
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...