EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Being able to have conditional responses (https://www.eqemulator.org/forums/showthread.php?t=39354)

Greyhelm 02-12-2015 11:15 AM

Being able to have conditional responses
 
I looked aorund and either I am not seeing it or I just am searching wrong.. I was looking to see how about doing a conditional reponse for quest characters that have more than one turn-in. Example;


Character X: Hail toon
Toon Response: I am looking for a [code], can you find one?
Character X: a code
Toon Response: Yes silly text to have something do something for you.
Character X: Gives Toon code.
Character X: Hail toon.
Toon response: Now that I have the code, script this.

Character Y: Hail toon.
Ton response: I am looking for a [code], can you find one?

I am guessing it will have to do with flagging the character for the turn in. But ultimately I want to have the dialogue progress as things are turned in and not repeat. Can I get pointed to where I need ot be. I was reading through the PoP flagging but I am still new to scripting. Thanks in advance!

trevius 02-12-2015 11:19 AM

You should look into qglobals. Search the forums and wiki and there should be plenty of information about what you are looking for.

Greyhelm 02-12-2015 12:11 PM

Will do thanks.

Greyhelm 02-12-2015 01:46 PM

Ok I caruised a few posts I say and came across the Hails one. I decided to try it out. I copied it to an NPC with no quest assigned, set his qglobal to 1. Restarted the server. I had one error in the logs when I tried hailing him fixed the squiggle right I missed. Restarted again. But I still do not get the NPC to respond. I removed plugin::whisper with quest::say since I do not have the whisper plugin. I do not get any log output of any error.

I read different guides and a lto of conflicting data...

example one
Code:

quest::setglobals("Hails", 1, 5, "F");
I assume this is in correct because
Code:

quest::setglobals("Hails", "1", "5", "F");
works not the first one.. Learning.... Thanks for putting me back into the boards Trevius, learned more than just being handed the info...

chrsschb 02-19-2015 10:16 AM

Quote:

Originally Posted by Greyhelm (Post 237790)
Ok I caruised a few posts I say and came across the Hails one. I decided to try it out. I copied it to an NPC with no quest assigned, set his qglobal to 1. Restarted the server. I had one error in the logs when I tried hailing him fixed the squiggle right I missed. Restarted again. But I still do not get the NPC to respond. I removed plugin::whisper with quest::say since I do not have the whisper plugin. I do not get any log output of any error.

I read different guides and a lto of conflicting data...

example one
Code:

quest::setglobals("Hails", 1, 5, "F");
I assume this is in correct because
Code:

quest::setglobals("Hails", "1", "5", "F");
works not the first one.. Learning.... Thanks for putting me back into the boards Trevius, learned more than just being handed the info...


This is what I use:
Code:

quest::setglobal("global", 1, 5, F);
I've also used the first one you quoted with the F in quotes. Both work.


Example of conditional conversation from a quest I wrote a while back:
Code:

sub EVENT_SAY
  {

  my $deal = quest::saylink("deal", 1);
  my $coin = quest::saylink("coin", 1);
  my $estate = quest::saylink("Estate", 1);
  my $inny = quest::saylink("Innoruuk", 1);
  my $bladesmith = quest::saylink("bladesmith", 1);

  if($text=~/hail/i)
      {
      if($qglobals{hateblade} == 0)
        {
        if($class eq "Warrior")
            {
            plugin::Whisper("Hello fellow Warrior, I may have a splendid [$deal] for you!");
            }
        else
            {
            plugin::Whisper("Where have all the traders gone?");
            }
        }
           
      if($qglobals{hateblade} == 1)
        {
        plugin::Whisper("I said it was splendid; I did not say it was useful!");
        quest::doanim(54);
        plugin::Whisper("It truly IS one of a kind... literally; however, I hear it may be of more use when forged with a rare sword from the old [$estate].");
        }

      if($qglobals{hateblade} == 2)
        {
        plugin::Whisper("Did you fashion the blade? Let me see it!");
        } 
     
      if($qglobals{hateblade} == 3)
        {
        plugin::Whisper("Seek out Tirapulin V'Thex, the master bladesmith.");
        }
     
      if($qglobals{hateblade} == 4)
        {
        plugin::Whisper("You have returned! Let me see the blade!");
        }
     
      if($qglobals{hateblade} >=5 && $qglobals{hateblade} <=7)
        {
        plugin::Whisper("Ever have the strangest feeling of dejavu?");
        }
     
      }
     
  if($text=~/deal/i && $class eq "Warrior")
      {
      plugin::Whisper("If you have the [$coin], I may be able to provide you with a splendid blade!");
      } 
       
  if($text=~/coin/i && $class eq "Warrior")
      {
      plugin::Whisper("For a measly 250 platinum pieces, I will provide you with a blade no warrior has seen the likes of!");
      } 
       
  if($text=~/estate/i && $qglobals{hateblade} == 1)
      {
      plugin::Whisper("Unrest of course.  Here, take these notes.  Now leave me alone.");
      quest::summonitem(2669);
      quest::setglobal("hateblade", 2, 5, "F");
      } 
     
     
  if($text=~/innoruuk/i && $qglobals{hateblade} == 2)
      {
      plugin::Whisper("That is right, Innoruuk himself gave a blade to King Thex of the Tier'Dal, that has resemblance to that of which you hold.  Perhaps a maaster Tier'Dal [$bladesmith] may assist you further.");
      } 
       
  if($text=~/bladesmith/i && $qglobals{hateblade} == 2)
      {
      plugin::Whisper("Seek out Tirapulin V'Thex in the Bazaar.  I imagine he has migrated his wares there like every other trader.");
      quest::setglobal("hateblade", 3, 5, "F");
      } 
     
  }



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

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