Jump to content
  • 0
Jayz

About PVP Drop Skull

Question

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

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 1

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 = "+( [email protected] = getcharid(0) )+" and killedcid = "+( [email protected] = getcharid( 0, rid2name( killedrid ) ) ), [email protected] ) ) { // check if the user is in the list
	if ( [email protected] == .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 = "+ [email protected] +" and killedcid = "+ [email protected];
}
else
	query_sql "insert into last_pvp_kill values ( null, "+ [email protected] +", "+ [email protected] +", 1 )"; // insert into table
getitem2 7420, 1,1,0,0, 254, 0, [email protected] % ( 1 << 16 ), [email protected] >> 16;
end;
OnInit:
.max_skull = 3;
end;
}

  • Upvote 2
Link to comment
Share on other sites

You will have to turn off skull_drops from battle config and uses a script engine to do this.

Use a base of AnnieRuru's script here and add some last_skull global variable time check.

Link to comment
Share on other sites

I rather do something like this

-	script	blah	-1,{
OnPCKillEvent:
set [email protected], 3; // 3 times kill in same minute = OUT
if ( killedrid == getcharid(3) ) end;
attachrid killedrid;
[email protected] = getcharid(0);
attachrid killerrid;
setd "@count"+ gettime(2) +"_"+ killedrid, getd( "@count"+ gettime(2) +"_"+ killedrid ) +1;
if ( getd( "@count"+ gettime(2) +"_"+ killedrid ) < [email protected] )
	getitem2 7420, 1,1,0,0, 254, 0, [email protected] % pow(2,16), [email protected] / 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 ...

Link to comment
Share on other sites

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

-	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;
[email protected] = getcharid(0);
attachrid killerrid;
getitem2 7420, 1,1,0,0, 254, 0, [email protected] % pow(2,16), [email protected] / pow(2,16);
pvp_skull_limit_collect++;
}

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

[email protected] = getcharid(3);
attachrid killedrid;
// Do stuff
attachrid [email protected];

Edited by Ryokem
Link to comment
Share on other sites

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

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

Link to comment
Share on other sites

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

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