Jump to content
  • 0

PVP Point on specific Map


Question

Posted

Hello, I would like to have a PVP Point on a specific map

Ex:

Map(prontera) 

In prontera if you kill a person - you will gain 2 points but not cashpoints [ for example: pvppoint ]

then if you died you will lose 1 point there

 

Also for PvP Point Shop...

 

As I gathering Scripts

-    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);
}


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);
end;
}

This is all I can get, and it is in form of Cashpoints

Thanks in advance !

3 answers to this question

Recommended Posts

  • 1
Posted

You can try below script and let me know if it works ?

-	shop	PVPSHOP	-1,501:20000

prontera,150,150,0	script	PVP Points Shop	100,{
    callshop "PVPSHOP", 1;
    npcshopattach "PVPSHOP";
    end;
   
    OnBuyItem:
        for (.@j = 0; .@j < getarraysize(.items); .@j += 2) {
            for (.@k = 0; .@k < getarraysize(@bought_nameid); .@k++) {
                if (@bought_nameid[.@k] == .items[.@j]) {
                    if (checkweight(@bought_nameid[.@k],@bought_quantity[.@k])) {
                        if (#PVPPOINTS < .items[.@j+1] || #PVPPOINTS < (.items[.@j+1] * @bought_quantity[.@k]))
                            dispbottom "You don't have enough PVP points";
                        else {
							#PVPPOINTS -= .items[.@j+1] * @bought_quantity[.@k];
                            getitem @bought_nameid[.@k], @bought_quantity[.@k];
                        }
                    } else dispbottom "You cannot carry out more items with you";
                }
            }
        }
		// clean up before ending
        deletearray @bought_quantity, getarraysize(@bought_quantity);
        deletearray @bought_nameid, getarraysize(@bought_nameid);
        end;
 
    OnInit:
        setarray .items, 1000,1,1001,2; // Usage : <item id>,<price>{,<item id>,<price>}
        npcshopitem "PVPSHOP",0,0;
        for (.@i = 0; .@i < getarraysize(.items); .@i += 2)
            npcshopadditem "PVPSHOP", .items[.@i], .items[.@i+1];
        end;
}

-	script	Func_PVP	-1,{
	OnPCKillEvent:
		if (getcharid(3) == killedrid || strcharinfo(3) != "prontera") end;
		#PVPPOINTS += .p[0];
		dispbottom "You won " + .p[0] + " pvp points. New pvp points is " + #PVPPOINTS;
		end;
		
	OnPCDieEvent:
		if (getcharid(3) == killerrid  || strcharinfo(3) != "prontera") end;
		if (#PVPPOINTS > .p[1]) {#PVPPOINTS -= .p[1];}
		else {#PVPPOINTS = 0;}
		dispbottom "You lost " + .p[1] + " pvp points. New pvp points is " + #PVPPOINTS;
		end;

	OnCheckPoint:
		dispbottom "You currently have " + #PVPPOINTS + " pvp points.";
		end;
	OnInit:
		setarray .p[0], 2, 1; // points per kill, points per death
		bindatcmd "checkpoints", strnpcinfo(0) + "::OnCheckPoint";
		end;
}

 

  • 0
Posted (edited)
9 hours ago, Patskie said:

You can try below script and let me know if it works ?


-	shop	PVPSHOP	-1,501:20000

prontera,150,150,0	script	PVP Points Shop	100,{
    callshop "PVPSHOP", 1;
    npcshopattach "PVPSHOP";
    end;
   
    OnBuyItem:
        for (.@j = 0; .@j < getarraysize(.items); .@j += 2) {
            for (.@k = 0; .@k < getarraysize(@bought_nameid); .@k++) {
                if (@bought_nameid[.@k] == .items[.@j]) {
                    if (checkweight(@bought_nameid[.@k],@bought_quantity[.@k])) {
                        if (#PVPPOINTS < .items[.@j+1] || #PVPPOINTS < (.items[.@j+1] * @bought_quantity[.@k]))
                            dispbottom "You don't have enough PVP points";
                        else {
							#PVPPOINTS -= .items[.@j+1] * @bought_quantity[.@k];
                            getitem @bought_nameid[.@k], @bought_quantity[.@k];
                        }
                    } else dispbottom "You cannot carry out more items with you";
                }
            }
        }
		// clean up before ending
        deletearray @bought_quantity, getarraysize(@bought_quantity);
        deletearray @bought_nameid, getarraysize(@bought_nameid);
        end;
 
    OnInit:
        setarray .items, 1000,1,1001,2; // Usage : <item id>,<price>{,<item id>,<price>}
        npcshopitem "PVPSHOP",0,0;
        for (.@i = 0; .@i < getarraysize(.items); .@i += 2)
            npcshopadditem "PVPSHOP", .items[.@i], .items[.@i+1];
        end;
}

-	script	Func_PVP	-1,{
	OnPCKillEvent:
		if (getcharid(3) == killedrid || strcharinfo(3) != "prontera") end;
		#PVPPOINTS += .p[0];
		dispbottom "You won " + .p[0] + " pvp points. New pvp points is " + #PVPPOINTS;
		end;
		
	OnPCDieEvent:
		if (getcharid(3) == killerrid  || strcharinfo(3) != "prontera") end;
		if (#PVPPOINTS > .p[1]) {#PVPPOINTS -= .p[1];}
		else {#PVPPOINTS = 0;}
		dispbottom "You lost " + .p[1] + " pvp points. New pvp points is " + #PVPPOINTS;
		end;

	OnCheckPoint:
		dispbottom "You currently have " + #PVPPOINTS + " pvp points.";
		end;
	OnInit:
		setarray .p[0], 2, 1; // points per kill, points per death
		bindatcmd "checkpoints", strnpcinfo(0) + "::OnCheckPoint";
		end;
}

 

hello, is this based on prontera map only?

 

Thanks ! It really works , i just edit the line "prontera" into my pvp map which is "arena_4" !

Edited by Vale
  • 0
Posted

 

On 3/23/2020 at 10:22 PM, Patskie said:

You can try below script and let me know if it works ?


-	shop	PVPSHOP	-1,501:20000

prontera,150,150,0	script	PVP Points Shop	100,{
    callshop "PVPSHOP", 1;
    npcshopattach "PVPSHOP";
    end;
   
    OnBuyItem:
        for (.@j = 0; .@j < getarraysize(.items); .@j += 2) {
            for (.@k = 0; .@k < getarraysize(@bought_nameid); .@k++) {
                if (@bought_nameid[.@k] == .items[.@j]) {
                    if (checkweight(@bought_nameid[.@k],@bought_quantity[.@k])) {
                        if (#PVPPOINTS < .items[.@j+1] || #PVPPOINTS < (.items[.@j+1] * @bought_quantity[.@k]))
                            dispbottom "You don't have enough PVP points";
                        else {
							#PVPPOINTS -= .items[.@j+1] * @bought_quantity[.@k];
                            getitem @bought_nameid[.@k], @bought_quantity[.@k];
                        }
                    } else dispbottom "You cannot carry out more items with you";
                }
            }
        }
		// clean up before ending
        deletearray @bought_quantity, getarraysize(@bought_quantity);
        deletearray @bought_nameid, getarraysize(@bought_nameid);
        end;
 
    OnInit:
        setarray .items, 1000,1,1001,2; // Usage : <item id>,<price>{,<item id>,<price>}
        npcshopitem "PVPSHOP",0,0;
        for (.@i = 0; .@i < getarraysize(.items); .@i += 2)
            npcshopadditem "PVPSHOP", .items[.@i], .items[.@i+1];
        end;
}

-	script	Func_PVP	-1,{
	OnPCKillEvent:
		if (getcharid(3) == killedrid || strcharinfo(3) != "prontera") end;
		#PVPPOINTS += .p[0];
		dispbottom "You won " + .p[0] + " pvp points. New pvp points is " + #PVPPOINTS;
		end;
		
	OnPCDieEvent:
		if (getcharid(3) == killerrid  || strcharinfo(3) != "prontera") end;
		if (#PVPPOINTS > .p[1]) {#PVPPOINTS -= .p[1];}
		else {#PVPPOINTS = 0;}
		dispbottom "You lost " + .p[1] + " pvp points. New pvp points is " + #PVPPOINTS;
		end;

	OnCheckPoint:
		dispbottom "You currently have " + #PVPPOINTS + " pvp points.";
		end;
	OnInit:
		setarray .p[0], 2, 1; // points per kill, points per death
		bindatcmd "checkpoints", strnpcinfo(0) + "::OnCheckPoint";
		end;
}

 

I would like to ask regarding this one, how to add maps? || strcharinfo(3) != "prontera" to? || strcharinfo(3) != "pvp_y_5-2" || strcharinfo(3) != "pvp_y_5-3")???

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