Jump to content

Question

Posted

 

Hello community, I would like to add a constraint to a custom command: (https://pastebin.com/txQA4J2f) being forbidden to activate this command if it is equipped with the item (ID 4263 + 1755) it already has this restriction, however, to spam or change of equipment the command it is possible to circumvent the restriction, I would somehow not be able to cheat the restriction of item

2 answers to this question

Recommended Posts

  • 1
Posted

Based on Mahiro's suggestion:

-	script	paytowinbuffs	-1,{
OnPCStatCalcEvent:
	if(isequippedcnt(4263,1755) > 0) {
		for(;.@i < .ele_size;.@i++)
			sc_end .elements[.@i];
	}
	end;
OnBuffs:
	if(gettimetick(2) < @use_delay){
		dispbottom( "You have to wait "+Time2Str(@use_delay)+" to use the command again.", 0xFF0000 );
		end;
	}
	if(getgroupid() <= 4) {
		message strcharinfo(0),"Falha, você não possui VIP.";
		end;
	}
	if(isequippedcnt(4263,1755) > 0) {
		message strcharinfo(0),"Não funciona equipado com Samurai Encarnado.";
		end;
	}
	for(;.@i < .ele_size;.@i++)
		sc_end .elements[.@i];
	.@menu$ = implode(.buffs$,":");
	.@i = prompt(.@menu$) -1;
	if(.@i < 254 && gettimetick(2) >= @use_delay && isequippedcnt(4263,1755) < 1) {
		sc_start .elements[.@i],180000,5;
		@use_delay = gettimetick(2) + .use_delay;
	}
	end;
OnInit:
	.use_delay = 30; // 30 second use delay
	setarray .buffs$, "^800080Envenenar Arma^000000", "^40E0D0Aspersio^000000", "^000000Sombrio^000000", "^FFD700Encantar com Ventania^000000", "^0000FFEncantar com Geada^000000", "^FF0000Encantar com Chama^000000", "^B8860BEncantar com Terremoto^000000";
	setarray .elements, 26, 37, 144, 98, 97, 96, 99;
	.ele_size = getarraysize(.elements);
	bindatcmd "encantar","paytowinbuffs::OnBuffs",0,99;
	end;
}

 

  • Upvote 1

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