Using Or
I'm trying to get a good grasp on item turn ins and I basically wanted to take the jboots example and go from AND to OR.
More or less I want to allow players to turn in hate/fear plate armor and get a token. Now I could create 40 different ifs for plate or couldn't I just do this? Code:
sub EVENT_ITEM Also, this is more obscure but is there a way to cap how many times you can get the faction gain from this? would you do an if inside the if? |
Well
Alright, so that didn't quite work! Any thoughts on this?
Code:
sub EVENT_ITEM |
That way won't work, you'd need to write the much more tedious method of:
Code:
if (($item1 == 4861) || ($item1 == 4862) || ($item1 == 4863) || etc... Code:
|
OKay thank you so much!
I'm glad at least my logic was in the right place. It is tedious but much less so than doing an entire if for every piece. I'll change my code to the && version and let you know! |
You could make an array of the turn-in items and loop through them. Something like this should work for you.
Code:
@items = (1001, 1002, 1003, 1004, 1005); |
Thank you all for the advice!
I've now got it working with reality's idea. That is a load off my mind. I'm down to just getting one more quest npc in and figuring out how to lock them to a faction. |
All times are GMT -4. The time now is 05:56 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.