Can't figure this out
I'm trying to build a quest template i'll use for a weapon NPC. The part I can't get to work is the class checks on the items. It seems like he's not doing them at all. I removed warrior as a class, then tried a turn in after reloading quests and he still gave me all of the items. This is a problem since the actual items he gives will be class specific!
I've been trying to figure out what I have wrong for 2 hours now, but alas I'm still stuck. Any help would be appreciated..I'm new to this. Code:
sub EVENT_SAY |
I think your line here:
Code:
($class == "Ranger, Beastlord") Code:
($class eq 'Ranger' || $class eq 'Beastlord') |
Nope, now he just eats the items and doesn't say anything ><. I also tried normal quotes around the class, still nothing.
|
Sorry, try this format instead:
Code:
($class eq "Ranger" || $class eq "Beastlord") You should also be able to do it this way: Code:
($class == 'Ranger' || $class == 'Beastlord') |
That's what I meant, I tried double quotes and it didn't work. I'll try reverting back to using == and see if that works. Thanks for the help.
edit: nope...still not working! argh >< this is going to drive me mental. Could you give me an example test template maybe? One that's similiar, that way I can just modify it? |
When having problems with complex scripts, there are 2 things to do to help figure them out as quickly as possible:
1. Break your script down into separate parts to make sure you have each piece working individually. Since you think your issue is related to the class checks, try something like this: Code:
sub EVENT_ITEM { 2. Use debugging text in your scripts if they are giving you problems. What I mean by this is to basically put an quest::say message after almost every line of the script, so you can see the exact steps that the NPC made it to. Here is an example of debugging a portion of a version of your script: Code:
sub EVENT_ITEM { |
Looks like this is a work in progress for you as there are duplicates, etc. So you can try this and work with it more:
Code:
sub EVENT_SAY { |
Try to do the item check last: Qglobal check -> class check -> item check
For some reason if you do an item + qglobal check (in this order), if you don't have the proper qglobal but you turn in the proper item, the npc will still eat it. Changing the check order should solve this issue. |
Quote:
|
yep, to save some headache for serverops, always do the itemcheck last ;)
|
Thanks for all the help, joligario's code worked. I kept my event_say because the one he put didn't work for some reason, but the event_item is now fixed. =)
|
All times are GMT -4. The time now is 11:07 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.