delete item even char is offline

humble

New member
Messages
5
Points
0
Hello everyone,
I would like to ask if it is possible to remove or add an item/items to an offline player?
what i want to do is who ever is the top 1 on PvP Ladder will get an item(cannot be remove from inventory) and at the same time remove an item to the previous top 1 of the PvP Ladder? 

If yes anyone can teach me
default_biggrin.png
thank you

 
you can always send a mail to the offline player

however you mean ... the item is bound ?

seems like hercules still doesn't support get bounded item from mail

 
@@humble maybe the easiest way to do it is..

Since there is only 1 ITEM for Top 1 Player then if the top 1 has been down to top 2 then this is my idea.

1. If the former Top 1 Player is OFFLINE ( automatically remove item if he will login in game by using OnPCLoginEvent of course their will be a sql query for that ), then the new TOP 1 player will have the item

2. If the Top 1 Player is ONLINE, npc script will sort out the ladder and remove the item on his inventory, since item cannot be put in STORAGE/CART/MAIL/GSTORAGE

 
ahhhh ... now I understand

then there is no need an item

just use OnPCStatCalcEvent will do

Code:
prontera,155,185,5	script	sdkjfhdsfs	1_F_MARIA,{	input $pvpwinner; // debug	close;OnPCStatCalcEvent:	if ( getcharid(3) == $pvpwinner ) {		bonus bStr, 1000;	}	end;}
whoever wins the top ladder, gains bonus +1000 str
 
Last edited by a moderator:
I hope I didn't this time

most people would have thought that item bonuses can only gain through equipments, (official)

but there are custom mods like OnPCStatCalcEvent and Charms can also give item bonuses

if wanna change sprite, there are always setaura custom mod, or just use changelook script command

so I wouldn't think inside the box, always think outside the box !

 
Code:
.@aid = getcharid( 3,rid2name( $pvp_aid ) );if ( .@aid ) {	delitem 501,1,.@aid;}else {	query_sql( "DELETE FROM `inventory` WHERE `nameid` = 501 AND `char_id` = "+$pvp_aid+" LIMIT 1" );}
 
better I write out the script to prove which method usable

just do the talking doesn't go everywhere

Code:
prontera,155,185,5 script kjsdfsjdf 1_F_MARIA,{.@nb = query_sql( "select name, killcount from pvpladder order by killcount desc limit 3", .@name$, .@kill );for ( .@i = 0; .@i < .@nb; ++.@i )mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@kill[.@i];close;OnPCKillEvent:query_sql "insert into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', "+ getcharid(3) +", 1 ) on duplicate key update killcount = killcount +1";query_sql "select name, aid, cid from pvpladder order by killcount desc", .@name$, .@aid, .@cid;if ( $pvptopcid == .@cid ) end;announce .@name$ +" is top 1", bc_all;if ( isloggedin( $pvptopaid, $pvptopcid ) ) {.@origin = getcharid(3);attachrid $pvptopaid;if ( .@count = countitem(1201) )delitem 1201, .@count;attachrid .@origin;}elsequery_sql "delete from inventory where nameid = 1201 and char_id = "+ $pvptopcid;$pvptopaid = .@aid;$pvptopcid = .@cid;if ( checkweight(1201,1) )getitembound 1201, 1, 4;end;}prontera mapflag pvp
if use an item, if the player failed the checkweight, and didn't use the checkweight script command

the item may drop on the floor

but hmm ... we can't attack at 90% weight anyway so I think this shouldn't be a problem

.

.

Code:
prontera,155,185,5 script kjsdfsjdf 1_F_MARIA,{.@nb = query_sql( "select name, killcount from pvpladder order by killcount desc limit 3", .@name$, .@kill );for ( .@i = 0; .@i < .@nb; ++.@i )mes ( .@i +1 )+". "+ .@name$[.@i] +" -> "+ .@kill[.@i];close;OnPCKillEvent:query_sql "insert into pvpladder values ( "+ getcharid(0) +", '"+ escape_sql( strcharinfo(0) ) +"', "+ getcharid(3) +", 1 ) on duplicate key update killcount = killcount +1";query_sql "select name, aid, cid from pvpladder order by killcount desc", .@name$, .@aid, .@cid;if ( $pvptopcid == .@cid ) end;announce .@name$ +" is top 1", bc_all;$pvptopcid = .@cid;end;OnPCStatCalcEvent:if ( $pvptopcid == getcharid(0) )bonus bStr, 100;end;}prontera mapflag pvp
hmm ... now I wish the stat_recalc command works

because the stats doesn't update on killing other player

unequip command might work but hercules still doesn't have equip2 script command

EDIT: hell yeah the codebox broken again

 
Last edited by a moderator:
Back
Top