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 01-15-2010, 10:11 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default please help i cant figure this out

ok this is my code and it doesnt seem to wanna work please help
Code:
 sub EVENT_SAY {
   if ($text=~/hail/i && $MM == 0) {
 	quest::say("You must kill lord Mith Mar to talk to me $name.");
   }
 if ($text=~/hail/i && $MM == 1) {
 	  quest::say("AHHH, So you defeated him would you like to go to The Ascent?");
 	}
 	if ($text=~/Ascent/i) {
 	  quest::say("Have fun on your Journey");
 	  quest::movepc(319,169,1027,44);
 	  
 	}
   }
 }
and this is what gives the global
Code:
 sub EVENT_SAY {
   if ($text=~/hail/i {
 	  quest::say("Here. is your flag for The Ascent");
 	  quest::setglobal("MM",1,0,"F");
 	}
   }
Reply With Quote
  #2  
Old 01-15-2010, 10:52 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Could be multiple things.

First, you should make sure your NPC has access to quest globals (see npc_types).

Second, you should read at the bottom of the quest tutorial to see which NPC/PC/Zone combo you are using: http://www.eqemulator.net/wiki/wikka...=QuestTutorial

Third, you should really use the $qglobal{} method to read globals. Something like:
Code:
if (defined($qglobals{MM}) && $qglobals{MM} == 1) {
Reply With Quote
  #3  
Old 01-15-2010, 11:25 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

now with that command that u said how would i add a iftext hail to it and npc is set to global commands

and the npc player and zone is set to 0 which is this npc this player and this zone

Last edited by jkennedy; 01-15-2010 at 11:26 PM.. Reason: messed up
Reply With Quote
  #4  
Old 01-16-2010, 08:52 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

In your post, you have 2 script sections, each including their own EVENT_SAY. That suggests that you have 2 separate NPCs each using one of those EVENT_SAYs. If you do have 2 NPCs using these scripts, the second one will never recognize the qglobal, because you set it to 0, which means that only the NPC that gave the qglobal will ever recognize it. And, if that isn't the case and both of these script sections are on the same NPC, it is probably breaking because you aren't supposed to have more than 1 of each event type per NPC, including EVENT_SAY.

If you do have 2 NPCs, you will want to use either option 1 or option 5 for your qglobal btw.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 01-16-2010, 09:04 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

You might be looking for something like this:
Code:
 sub EVENT_SAY {
  if ($text=~/hail/i) {
    if (!defined($qglobals{MM})) {
      quest::say("You must kill lord Mith Mar to talk to me $name.");
    }
    if (defined($qglobals{MM}) && ($qglobals{MM} == 1)) {
      quest::say("AHHH, So you defeated him would you like to go to The Ascent?");
    }
  }
  if ($text=~/ascent/i && defined($qglobals{MM}) && ($qglobals{MM} == 1)) {
    quest::say("Have fun on your Journey");
    quest::movepc(319,169,1027,44);
  }
}
Typed on an iPod so don't freak if I misformatted
Reply With Quote
  #6  
Old 01-16-2010, 01:13 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default this what what im using now

[/ode] sub EVENT_SAY {
if ($text=~/hail/i) {
if (!defined($qglobals{MM})) {
quest::say("You must kill lord Mith Mar to talk to me $name.");
}}
if ($text=~/hail/i) { if (defined($qglobals{MM}) && ($qglobals{MM} == 1)) {
quest::say("AHHH, So you defeated him would you like to go to The Ascent?");
}
}
if ($text=~/ascent/i && defined($qglobals{MM}) && ($qglobals{MM} == 1)) {
quest::say("Have fun on your Journey");
quest::movepc(319,169,1027,44);
}
}
} [/code]
he responds to the first line even if u have the flag he wont go tot the second line the ahh so you defeated him part
Reply With Quote
  #7  
Old 01-16-2010, 02:18 PM
Sylaei
Hill Giant
 
Join Date: Jan 2007
Posts: 124
Default

jkennedy, you have an extra brace at the bottom and you have two ($text=~/hail/i). If this did work you would get the contents of both 'hail' statements when 'MM' is set to 1. Try this:

Code:
sub EVENT_SAY 
{
    if ($text=~/hail/i) 
    {
        if (defined($qglobals{MM}) && ($qglobals{MM} == 1))
        {
            quest::say("AHHH, So you defeated him would you like to go to The [Ascent]?");
        }
        else
        {    
            quest::say("You must kill lord Mith Mar to talk to me $name.");
        }
        
    }
    if ($text=~/ascent/i && defined($qglobals{MM}) && ($qglobals{MM} == 1)) 
    {
        quest::say("Have fun on your Journey");
        quest::movepc(319,169,1027,44);
    }
}
First we check for the 'hail', then if 'hail' is true we check to see if 'MM' is defined and is equal to 1. If the answer is yes we ask if the pc wants to go to The Ascent. If any check fails we fall into the else and tell them to go kill Lord Mith Mar.

HTH
__________________
Syl

"The significant problems we have cannot be solved at the same level of thinking with which we created them."
Albert Einstein
Reply With Quote
  #8  
Old 01-16-2010, 02:53 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

that still wont work
i have the flag which is set to an id then the charid is mine the npc id is 0 and zoneid is 0 name is MM value 1 and exp date is null and the npc is set to qglobal 1 so i have no clue why its not ready the qglobal its like skipping it
Reply With Quote
  #9  
Old 01-16-2010, 03:02 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

As Trevius stated, you have the flag set to 0. Two NPCs will not be able to read that qglobal.
Reply With Quote
  #10  
Old 01-16-2010, 03:58 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

Code:
sub EVENT_SAY {
   if ($text=~/hail/i) {
 	  quest::say("Here. is your flag for The Ascent");
 	   	  quest::setglobal("MM",1,5,"f"); }
   }
this is my new one and i made sure the mobs are qglobal set to 1 and still nothing
Reply With Quote
  #11  
Old 01-16-2010, 07:13 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

can someone test this on there server for me and see if it works maybe its my server or plugins files or somthing
Reply With Quote
  #12  
Old 01-16-2010, 07:47 PM
jkennedy
Hill Giant
 
Join Date: Dec 2009
Posts: 175
Default

think i got it think since i was using the lowercase f it wouldnt saving right but i change to uppercase and works fine thanks again for all ur guys help
Reply With Quote
  #13  
Old 01-16-2010, 07:55 PM
Sylaei
Hill Giant
 
Join Date: Jan 2007
Posts: 124
Default

Ok, the code below worked for me. I changed the text it was looking for so that it did not work from 'hail'. I used an existing script and just added these lines to it. I walked up to the mob, typed 'haly', it told me I must go kill Mith Mar. I have it setting theqglobal right after it displays the kill Mith Mar text, this line would be removed from your script. I typed 'haly' again and it said I defeated him did I want to go to the ascent.

So the code works, your problem must lie elsewhere.
Code:
    if ($text=~/haly/i) 
    {
        if (defined($qglobals{MM}) && ($qglobals{MM} == 1))
        {
            quest::say("AHHH, So you defeated him would you like to go to The [Ascent]?");
        }
        else
        {    
            quest::say("You must kill lord Mith Mar to talk to me $name.");
            quest::setglobal("MM",1,5,"f");
        }
        
    }
    if ($text=~/ascent/i && defined($qglobals{MM}) && ($qglobals{MM} == 1)) 
    {
        quest::say("Have fun on your Journey");
        quest::movepc(319,169,1027,44);
    }
Just read your post where you got it to work. Gratz.
__________________
Syl

"The significant problems we have cannot be solved at the same level of thinking with which we created them."
Albert Einstein
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 03: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