Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 11-27-2009, 05:59 AM
tandcemerson
Sarnak
 
Join Date: Jun 2008
Location: Ukraine
Posts: 31
Default Using OR in NPC script

Some strange happenings going on. Awhile ago I tried writing a simple script which would provide a slightly altered quest for each player based on their class. Basically it went something like if $class="Shadowknight" or $class="paladin" { blah blah }. Anyways, I lost the original script when I painstakingly removed all my OR's so I didn't have anything concrete to submit. I don't have direct access to the NPC scripts, but go through someone else and didn't want to trouble him.

However, yesterday one of the other quest writers came acros the same thing so I wanted to submit his example so I can try and figure out why I can't even use a simple OR statement?

*NOTE* In my original example, I used double quotes and when I saw the preliminary quest submitted, I saw that he used single quotes and figured maybe I missed something, but they both cause the NPC to seize up and become unresponsive.

Code:
if ($class !='shadowknight' || $class !='necromancer') {
   if($text=~/Hail/i) {
      quest::say("Blah blah");
      }
So this section of code works well if I separate out the two class into their own if statements, but it won't work like this. Any clue?
__________________
Proud player of The Hidden Forest
"omg I've only been here 30 seconds and I know I'm staying" - New player on THF (name withheld)

Jerant the Loremaster - Cleric
Hans Poisondirk - Rogue
< Evolution >
Reply With Quote
  #2  
Old 11-27-2009, 08:15 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

When using classes and eq (equal for strings) or ne (not equal for strings), you will need to capitalize the class. So for your given example:

Code:
if ($class ne "Shadowknight" || $class ne "Necromancer") {
Reply With Quote
  #3  
Old 11-27-2009, 08:43 AM
tandcemerson
Sarnak
 
Join Date: Jun 2008
Location: Ukraine
Posts: 31
Default

Ahhh! Wonderful! This will save me a lot of work in the future. Thanks!
__________________
Proud player of The Hidden Forest
"omg I've only been here 30 seconds and I know I'm staying" - New player on THF (name withheld)

Jerant the Loremaster - Cleric
Hans Poisondirk - Rogue
< Evolution >
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:27 AM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3