I want to deequip armors with +8refine and above in specific map. How?

mleo1

Community Contributors
Messages
314
Points
0
Age
10
Location
Failippines
Github
mleo1
Emulator
lets say 
max refine is 7

map is pvpizlude

if you go to pvpizlude, you will unequip the armor if it is above the allowable max refine
if you try to equip armor with above refine in the map, it will not equip

How?

 
Last edited by a moderator:
How? where? dunno please help 
default_que.gif
 
bamp

 
for 'if you try to equip armor with above refine in the map, it will not equip' i think it need source edit like mapflag custom, but idk about src and if you want to try this script.. the different is this script will check every configured second (i set default 1 sec) on the selected map you set and if it refine count is higher than script .max_refine set it will unequip..

- script chk_refine -1,{ end;OnPCLoadMapEvent:OnCheck: for(.@j = 0; .@j < getarraysize(.map_list$); .@j++) { if (strcharinfo(3) == .map_list$[.@j]) { for(.@i = 1; .@i <= 10; ++.@i) { if(getequipisequiped(.@i)) { if (getequiprefinerycnt(.@i) > .max_refine) unequip .@i; } } addtimer .chk_delay, strnpcinfo(3)+"::OnCheck"; } } end;OnInit: .chk_delay = 1 *1000; // check delay default 1 second .max_refine = 7; setarray .map_list$, "prontera"; // add your map here for (.@m = 0; .@m < getarraysize(.map_list$); .@m++) setmapflag .map_list$[.@m], mf_loadevent; end;}

Litro.

 
@@Litro
Thank you for your time, I'm gonna tweak your code and remove the timer and use below code
 

if you try to equip armor with above refine in the map, it will not equip

I lazily lurk around the code, dunno c, here's what I added

on PC.c's pc_equipitem

if (sd->mapindex == mapindex->name2id("pvpizlude") && sd->status.inventory[n].refine > 7) { clif->equipitemack(sd,n,0,EIA_FAIL); // fail return 0;}

It looks working but did I do wrong? (I dont wanna crash the shit)

 
Last edited by a moderator:
Back
Top