Jump to content
  • 0

how to make npc script with required equiped item.


Question

Posted

i want to try to make an npc. but before he talks to you. you should equip an item.

example.

You need to equip this before talking to Alex:

Helmet

Boots

or else you can do that quest.

5 answers to this question

Recommended Posts

Posted

if (!isequipped(<ID>{,<ID>,...})) { mes "You need to have _____ equipped to continue."; close; }
// script resumes

thanks.

if (!isequipped(<ID>{,<ID>,...})) { mes "You need to have _____ equipped to continue."; close; }
// script resumes

can you check my script?

aldebaran,150,147,6 script Toji 766,{
set .@n$,"^0000FF[Toji]^000000";
mes .@n$;
mes "You have 200 Bacillus and 150 Mould Powder?";
menu "Yes",-,"It's Hard",end2;
if (isequipped(5009, 2406) || countitem(7119) < 200 || countitem(7001)  < 150 ) goto L_NOTENOUGH;
next;
delitem 7119,200;
delitem 7001,150;
next;
mes .@n$;
mes "Oh my God,you got it all.";
mes "thanks for helping older guy.";
mes "here is your reward.";
next;
getitem 5131,1;
mes .@n$;
mes "Take it...it's such a nice";
mes "item...";
close;
end2:
next;
mes .@n$;
mes "Too bad...You are too lazy";
mes "to do this job.";
close;
L_NOTENOUGH:
next;
mes .@n$;
mes "You still miss some items";
close;
}

he needs 200 Bacillus and 150 Mould Powder. but you should wear a Safety Helmet and Boots [1]

before you can do this quest.

after you finish the quest you will get Close Helmet as a reward.

Posted

maybe like this?

aldebaran,150,147,6 script Toji 766,{
if (!isequipped(5009, 2406)) { mes "Please use Safety Helmet[0] & Boots[1] Before Talk."; close; }

set .@n$,"^0000FF[Toji]^000000";
mes .@n$;
mes "You have 200 Bacillus and 150 Mould Powder?";
menu "Yes",-,"It's Hard",end2;
if (countitem(7119) < 200 || countitem(7001)  < 150) goto L_NOTENOUGH;
next;
delitem 7119,200;
delitem 7001,150;
next;
mes .@n$;
mes "Oh my God,you got it all.";
mes "thanks for helping older guy.";
mes "here is your reward.";
next;
getitem 5131,1;
mes .@n$;
mes "Take it...it's such a nice";
mes "item...";
close;
end2:
next;
mes .@n$;
mes "Too bad...You are too lazy";
mes "to do this job.";
close;
L_NOTENOUGH:
next;
mes .@n$;
mes "You still miss some items";
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...