Jump to content
  • 0

Requesting a PvP System with Kill = Points and more stuff


Question

Posted

Hi, i found these scripts and are kinda similar what i want but no what i really want...

https://rathena.org/board/topic/80649-pvp-points/

https://rathena.org/board/topic/72509-pvp-points-system/

 

what i want is this...

If you kill a player on X, Y and Z Maps, you get +2 Points.

If you die by a player on X, Y and Z Maps, you get -1 Point.

a NPC that "Check" for those points i mean you have 0~100 points the NPC give you a "set" i mean ( set PvPRank,1; ) but if you have less than "100" will remove that rank
if you have something like 101~200 a new rank...
Also i want more than 1 rank something like.... Rank1, 2, 3, 4, 5, 6, 7...10 i need that, to use other an Euphy's Quest Shop and check if have that rank to sell stuff 

PD: i already have that Euphy's Quest Shop, just requesting the NPC Rank with check & Ranks, and the script that if you kill +2, if you die -1, con X,Y,Z Maps...

i saw something similar on a server years ago... so i guess is possible but i dont know how do it... Thx! ^^

15 answers to this question

Recommended Posts

  • 0
Posted (edited)

working on this - code coming soon

EDIT: Here you go. Again, not sure if I am using the variable scope (or array) correctly or not. Someone with more experience, please fix this if it's wrong. You can use the variable "pvpRank" for your shop NPC.

-	script	pvpCounter	-1,{

	//define maps where script is actively checking
	$@pvpMaps$[0] = "enter map name";  //map #1
	$@pvpMaps$[1] = "enter map name";  //map #2
	//add more maps like above
	
	OnPCDieEvent:
		if(strcharinfo(3) == $@pvpMaps$[0] || strcharinfo(3) == $@pvpMaps$[1]){
			pvpPoints--;
			message strcharinfo(0),"You have been killed and lost 1 point. "+pvpPoints+" total points.";
			end;
		}
		end;

	OnPCKillEvent:
		if(strcharinfo(3) == $@pvpMaps$[0] || strcharinfo(3) == $@pvpMaps$[1]){
			pvpPoints++;
			pvpPoints++;
			message strcharinfo(0),"You have killed a player and gained 2 points. "+pvpPoints+" total points.";
			end;
		}
		end;
}
<YOUR_MAP>,<YOUR_X>,<YOUR_Y>,<YOUR_Z>	script	PvP Clerk::pvpClerk	111,{

	if (pvpPoints <= 99) {
		mes "Your PvP Rank is "+pvpRank+";
		close;
	}
	if (pvpPoints >= 100 && pvpPoints <= 199 && pvpRank == 0) {
		pvpRank = 1;
		mes "You have "+pvpPoints+" points.";
		mes "Your PvP Rank is "+pvpRank+";
		close;
	}
	if (pvpPoints >= 200 && pvpPoints <= 299 && pvpRank == 1) {
		pvpRank = 2;
		mes "You have "+pvpPoints+" points.";
		mes "Your PvP Rank is "+pvpRank+";
		close;
	}
	else { end; }
}

 

Edited by SpiritD
added script
  • Like 1
  • 0
Posted (edited)
15 minutes ago, ItsFree said:

Thx! waiting ^^ take the time you need :P

posted /ok 

edit: it looks like the forum software doesn't like "$@" variables. Here's what those should look like (attached)

 

script_blocking.png

Edited by SpiritD
  • 0
Posted (edited)

so the npc is like this:

https://pastebin.com/PHdacipd

i've edit this

OnPCDieEvent:
		if(getmapxy(0) == $@pvpMaps$[0] || getmapxy(0) == $@pvpMaps$[1]){
			pvpPoints--;

to this ?
 

OnPCDieEvent:
		if(getmapxy(0) == $@pvpMaps$[0] || getmapxy(0) == $@pvpMaps$[1]){
			pvpPoints-1;

same with the other giht ¿? also dont need be something like " . pvpPoints " ¿?

also about something said stolao some days ago

 

Also $randmap can probably be .@randmap or .randmap since it doesn't need to be a server variable.

not tested yet just saying to try avoid problems on console :D well i gonna try on a minutes anyway...

not working :c trying to fix problems with = , ; ( { on console but they keep happening posting a screenshot...

firs was my mistake about 2 missing } then something about ) happen i change to , as the console said but then a new problem :/

 

error1.png

error2.png

Edited by ItsFree
  • 0
Posted
16 minutes ago, ItsFree said:

almost working just got an error on console

error en pvp system.png
 

 

 

I don't understand why you can't fix a simple typo from the script itself. Better don't build a server if you don't know how to do simple fixing stuff.

-	script	F_PvPCounter	-1,{
	end;

	//define maps where script is actively checking
	$@pvpMaps$[0] = "enter map name";  //map #1
	$@pvpMaps$[1] = "enter map name";  //map #2
	//add more maps like above
	
	OnPCDieEvent:
		if(strcharinfo(3) == $@pvpMaps$[0] || strcharinfo(3) == $@pvpMaps$[1]){
			pvpPoints--;
			message strcharinfo(0),"You have been killed and lost 1 point. "+pvpPoints+" total points.";
			end;
		}
		end;

	OnPCKillEvent:
		if(strcharinfo(3) == $@pvpMaps$[0] || strcharinfo(3) == $@pvpMaps$[1]){
			pvpPoints++;
			message strcharinfo(0),"You have killed a player and gained 2 points. "+pvpPoints+" total points.";
			end;
		}
		end;
}
prontera.gat,156,180,4	script	PvP Clerk	4_F_KAFRA7,{

	if(pvpPoints <= 99) {
		pvpRank = 0;
		mes "Your PvP Rank is: "+pvpRank;
		close;
	}
	if(pvpPoints >= 100 && pvpPoints <= 199 && pvpRank == 0) {
		pvpRank = 1;
		mes "You have "+pvpPoints+" points.";
		mes "Your PvP Rank is: "+pvpRank;
		close;
	}
	if(pvpPoints >= 200 && pvpPoints <= 299 && pvpRank == 1) {
		pvpRank = 2;
		mes "You have "+pvpPoints+" points.";
		mes "Your PvP Rank is: "+pvpRank;
		close;
	}
}

 

  • 0
Posted (edited)

i tried fix it, but still error, for that reason i put this as request and no support did think about that?, and not building atm, thx for help ^^ btw what was the fix ¿? to check my mistake :P

Tested and not working the script no error on console, but not counting points, no message, even the npc also "0 points" :c

Edited by ItsFree
  • 0
Posted
14 minutes ago, ItsFree said:

i tried fix it, but still error, for that reason i put this as request and no support did think about that?, and not building atm, thx for help ^^ btw what was the fix ¿? to check my mistake :P

Tested and not working the script no error on console, but not counting points, no message, even the npc also "0 points" :c

I made you a handy version of the script.

SpiritD Simple PvP

  • Like 1
  • 0
Posted (edited)
6 hours ago, Kaze said:

I made you a handy version of the script.

SpiritD Simple PvP

Thank you, Kaze. I knew someone with more experience than me would clean this up. I am just a beginner myself so I've been taking as many simple requests as I can... I guess this one wasn't as simple as I thought. You really lost me with the logic inside OnInit: - I see the loop that goes through the map list array but I don't understand how you used it for 

	if( getd( "." + strcharinfo(3) ) == 1 ) {

 

Edited by SpiritD
  • 0
Posted

Tested, Working but i found a "bug" after i get enough points to get the next rank, i talk with the npc and yeah tell me the rank but, when i click again just it dont talk to me :c no console error~

pvp rank error.png

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