Jump to content
  • 0

some way to make more less loaded this function


Question

Posted

I don't know if you can put the npc from id 32071 to 32128 without having to put them all

AlasQuestStart:
if(isequipped(32071)
||isequipped(32072)
||isequipped(32073)
||isequipped(32074)
||isequipped(32075)
||isequipped(32076)
||isequipped(32077)
||isequipped(32078)
||isequipped(32079)
||isequipped(32080)
||isequipped(32081)
||isequipped(32082)
||isequipped(32083)
||isequipped(32084)
||isequipped(32085)
||isequipped(32086)
||isequipped(32087)
||isequipped(32088)
||isequipped(32089)
||isequipped(32090)
||isequipped(32091)
||isequipped(32092)
||isequipped(32093)
||isequipped(32094)
||isequipped(32095)
||isequipped(32096)
||isequipped(32097)
||isequipped(32098)
||isequipped(32099)
||isequipped(32100)
||isequipped(32101)
||isequipped(32102)
||isequipped(32103)
||isequipped(32104)
||isequipped(32105)
||isequipped(32106)
||isequipped(32107)
||isequipped(32108)
||isequipped(32109)
||isequipped(32110)
||isequipped(32111)
||isequipped(32112)
||isequipped(32113)
||isequipped(32114)
||isequipped(32115)
||isequipped(32116)
||isequipped(32117)
||isequipped(32118)
||isequipped(32119)
||isequipped(32120)
||isequipped(32121)
||isequipped(32122)
||isequipped(32123)
||isequipped(32124)
||isequipped(32125)
||isequipped(32126)
||isequipped(32127)
||isequipped(32128)

)
    {    
    } else {
        mes "Lastima que no tienes ningunas Alas Quest...";
        close;
        }

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

If the ids do not have a gap between them you could do it like this:

for(.@i = 0; .@i <= 20; .@i++) {
    .@equipId = getequipid(.@i);

    if(.@equipId >= 32071 && .@equipId <= 32128) {
        .@hasEquip = true;
        break;
    }
}

if(.@hasEquip == true) 
    mes "You wear a equipment with a id between 32071 and 32128";
else
    mes "You don't wear a equipment with a id between 32071 and 32128";

Otherwise you could put the ids into an array and loop trough the check.

Edited by Winterfox
  • 0
Posted

you can also try

if (!isequippedcnt(32071,...,32128)) {
	mes "Lastima que no tienes ningunas Alas Quest...";
	close;
}

 

or

another trick that you could try

-	script	sample	-1,{
	OnInit:
		for (.@i = 32071; .@i <= 32128; .@i++) {
			setitemscript .@i, "{ @eq_32071_32128++; }", 1;
			setitemscript .@i, "{ @eq_32071_32128--; }", 2;
		}
		end;
}

everytime when you equipped one of these items, it will increase a counter, when unequipped it will decrease the counter.

when you want to check if a user equipped it, then do this

if (!@eq_32071_32128) {
	mes "Lastima que no tienes ningunas Alas Quest...";
	close;
}

 

  • Love 1
  • 0
Posted
16 hours ago, Emistry said:

you can also try

if (!isequippedcnt(32071,...,32128)) {
	mes "Lastima que no tienes ningunas Alas Quest...";
	close;
}

 

or

another trick that you could try

-	script	sample	-1,{
	OnInit:
		for (.@i = 32071; .@i <= 32128; .@i++) {
			setitemscript .@i, "{ @eq_32071_32128++; }", 1;
			setitemscript .@i, "{ @eq_32071_32128--; }", 2;
		}
		end;
}

everytime when you equipped one of these items, it will increase a counter, when unequipped it will decrease the counter.

when you want to check if a user equipped it, then do this

if (!@eq_32071_32128) {
	mes "Lastima que no tienes ningunas Alas Quest...";
	close;
}

 

 

Thanks, this only part I had to modify so that when I have it, it will let me continue in the npc and when I don't have it, it works perfectly.

if (!@eq_32071_32128) {
}else {
mes "Lastima que no tienes ningunas Alas Quest...";
    close;}
        

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