Jump to content
  • 0

About PVP Drop Skull


Question

Posted

Its possible if yes how can you do it please

about pvp drop skull because i have problem on pvp drop skull some of my player is farming skull

so i want 2-3 skulls from a player in a day, you are not allowed to get anymore skulls from the player even if you have killed him/her. Once 24 hours has passed, the limit will reset back to 0 therefore enabling you to collect 2-3 skulls from that player again.

Example: You have collected the 3rd skull from a player in around 5:00 PM

You must wait for the next day in the exact time to be able to collect the skulls from that player again

12 answers to this question

Recommended Posts

  • 1
Posted

a new technique has been found in this topic, by abusing SQL table to save the kills

so this will effectively break the limit of player data storage, rendering it unlimited

/*
create table last_pvp_kill (
id int(11) unsigned primary key auto_increment,
killercid int(11) unsigned not null,
killedcid int(11) unsigned not null,
count smallint(6) unsigned,
key (killercid),
key (killedcid)
) engine = innodb;
*/

-	script	jfhdksfjhsk	-1,{
OnClock0000:
query_sql "truncate last_pvp_kill;";
end;
OnPCKillEvent:
if ( killedrid == getcharid(3) ) end;
if ( query_sql( "select count from last_pvp_kill where killercid = "+( .@killercid = getcharid(0) )+" and killedcid = "+( .@killedcid = getcharid( 0, rid2name( killedrid ) ) ), .@count ) ) { // check if the user is in the list
	if ( .@count == .max_skull ) {
		dispbottom "you have reach the max amount of skull for that player today";
		end;
	}
	query_sql "update last_pvp_kill set count = count +1 where killercid = "+ .@killercid +" and killedcid = "+ .@killedcid;
}
else
	query_sql "insert into last_pvp_kill values ( null, "+ .@killercid +", "+ .@killedcid +", 1 )"; // insert into table
getitem2 7420, 1,1,0,0, 254, 0, .@killedcid % ( 1 << 16 ), .@killedcid >> 16;
end;
OnInit:
.max_skull = 3;
end;
}

  • Upvote 2
Posted

I rather do something like this

-	script	blah	-1,{
OnPCKillEvent:
set .@counttopunish, 3; // 3 times kill in same minute = OUT
if ( killedrid == getcharid(3) ) end;
attachrid killedrid;
.@charid = getcharid(0);
attachrid killerrid;
setd "@count"+ gettime(2) +"_"+ killedrid, getd( "@count"+ gettime(2) +"_"+ killedrid ) +1;
if ( getd( "@count"+ gettime(2) +"_"+ killedrid ) < .@counttopunish )
	getitem2 7420, 1,1,0,0, 254, 0, .@charid % pow(2,16), .@charid / pow(2,16);
else {
	announce strcharinfo(0) +", Stop killing "+ rid2name(killedrid) +" !!!", 0;
	warp "Save", 0,0;
}
end;
}

http://www.eathena.w...ype=post&id=334

... hmm ... this script is seriously unoptimized ...

Posted (edited)

i want 3 skulls from a player in a day, you are not allowed to get anymore skulls from the player even if you have killed him/her. Once 24 hours has passed

Edited by Zack-
Posted
-	script	kasdhkasdjhsd	-1,{
OnPCKillEvent:
if ( pvp_skull_limit_day != atoi( gettimestr("%Y%m%d", 9) ) ) {
	pvp_skull_limit_day = atoi( gettimestr("%Y%m%d", 9) );
	pvp_skull_limit_collect = 0;
}
if ( killedrid == getcharid(3) || pvp_skull_limit_collect >= 3 ) end;
attachrid killedrid;
.@charid = getcharid(0);
attachrid killerrid;
getitem2 7420, 1,1,0,0, 254, 0, .@charid % pow(2,16), .@charid / pow(2,16);
pvp_skull_limit_collect++;
}

Posted (edited)

OnPCKillEvent:

attachrid killerrid;

Not 100% sure, but if I remember correctly, OnPCKillEvent just create 'killedrid' variable, as 'killerrid = getcharid(3)'.

Anyway, better to store it to avoid any kind of problem :P

.@killer = getcharid(3);
attachrid killedrid;
// Do stuff
attachrid .@killer;

Edited by Ryokem
Posted

yeah now working but.. this is imposible to make it every player? have only 3 skull per player not all player

erm...i dont think it's a good way to do it using npc script if you want to limit all player with 3 skull..

because it will required to create / save alot data using variable for each player he/she killed ..

imagine if your server everyday having 100 player killing each other...about 20,000 ( AID + Count ) variable is needed ...O.O

anyway you can try this..

http://pastebin.com/raw.php?i=1pBA4HBM

by default only limited to 3 players....

  • Upvote 1
Posted

Why not simply create a check that blocks the (3 times) defeated character from entering the PVP room? So you won't need to save the variables just like Emistry has said.

too bad to say that alot players will bombard you if you use this method..xD

haha because they cant enter the PVP Room after they die for 3 times or more... LOL...

player love pvp...but not restricted from PVP area haha ~

so, this idea wont work ~ xD

Posted

yeah now working but.. this is imposible to make it every player? have only 3 skull per player not all player

erm...i dont think it's a good way to do it using npc script if you want to limit all player with 3 skull..

because it will required to create / save alot data using variable for each player he/she killed ..

imagine if your server everyday having 100 player killing each other...about 20,000 ( AID + Count ) variable is needed ...O.O

anyway you can try this..

http://pastebin.com/raw.php?i=1pBA4HBM

by default only limited to 3 players....

Thanks its working now

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