Jump to content
  • 0
mleo1

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

Question

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?

Edited by mleo1

Share this post


Link to post
Share on other sites

3 answers to this question

Recommended Posts

  • 0

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.

Share this post


Link to post
Share on other sites
  • 0

@@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)

Edited by mleo1

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.