EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   please help i cant figure this out (https://www.eqemulator.org/forums/showthread.php?t=30329)

jkennedy 01-15-2010 10:11 PM

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");
        }
  }


joligario 01-15-2010 10:52 PM

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) {

jkennedy 01-15-2010 11:25 PM

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

trevius 01-16-2010 08:52 AM

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.

joligario 01-16-2010 09:04 AM

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

jkennedy 01-16-2010 01:13 PM

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

Sylaei 01-16-2010 02:18 PM

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

jkennedy 01-16-2010 02:53 PM

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

joligario 01-16-2010 03:02 PM

As Trevius stated, you have the flag set to 0. Two NPCs will not be able to read that qglobal.

jkennedy 01-16-2010 03:58 PM

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

jkennedy 01-16-2010 07:13 PM

can someone test this on there server for me and see if it works maybe its my server or plugins files or somthing

jkennedy 01-16-2010 07:47 PM

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

Sylaei 01-16-2010 07:55 PM

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.


All times are GMT -4. The time now is 03:46 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.