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 10-13-2014, 04:12 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default Basic if/elsif syntax - What am I doing wrong?

I am trying to get an NPC to respond differently to a player if they are holding a certain item, which I have finally gotten to work - problem is, now my other possible dialogue for the NPC, responding to the word 'drink' isn't working. I'm sure it's a basic error that I've made, just can't figure out what exactly went wrong.

Code:
sub EVENT_SAY {

if ($text =~/Hail/i){
if(plugin::check_hasitem($client, 2487)) {
quest::say ("White fish, light salt, extra lemon slices.");
}
else {
quest::emote ("stares down at the floor, clearly nervous about being in a room full of people.");
quest::say ("It's just so scary. A murder.... in my own home. Just terrifying!");
quest::emote ("wipes tears from her eyes with a silken handkerchief.");
}
if ($text =~/drink/i){
quest::say ("I don't know why I'm telling you this, stranger, but I've never touched a drop of alcohol in my life. But, oh... darn it all! I'll have some... um.. I'll have some white wine.");
quest::emote ("nervously glances at her mother, and then quickly back at the ground.");
quest::say ("Um... Bishop... would you like to come to our prayer group next week? We would love to have you there. You've been a big help to me. Um... us. You've done a lot for the family, I mean.");
}
}
Reply With Quote
  #2  
Old 10-13-2014, 04:16 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

I believe you were missing a right curly, formatting is king.
Code:
sub EVENT_SAY {
    if ($text=~/Hail/i){
        if(plugin::check_hasitem($client, 2487)) {
            plugin::Whisper("White fish, light salt, extra lemon slices.");
        } else {
            quest::emote("stares down at the floor, clearly nervous about being in a room full of people.");
            plugin::Whisper("It's just so scary. A murder.... in my own home. Just terrifying!");
            quest::emote("wipes tears from her eyes with a silken handkerchief.");
        }
    } elsif ($text =~/^Drink$/i){
        plugin::Whisper("I don't know why I'm telling you this, stranger, but I've never touched a drop of alcohol in my life. But, oh... darn it all! I'll have some... um.. I'll have some white wine.");
        quest::emote("nervously glances at her mother, and then quickly back at the ground.");
        plugin::Whisper("Um... Bishop... would you like to come to our prayer group next week? We would love to have you there. You've been a big help to me. Um... us. You've done a lot for the family, I mean.");
    }
}
Reply With Quote
  #3  
Old 10-13-2014, 04:19 PM
zerjz3
Banned
 
Join Date: Aug 2010
Location: Sanctuary
Posts: 269
Default

Thanks - that fixed it.
Reply With Quote
  #4  
Old 10-13-2014, 04:20 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

You're welcome.
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 12:49 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