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 05-28-2006, 02:38 PM
Adrianne
Fire Beetle
 
Join Date: Oct 2004
Posts: 20
Exclamation Qglobal problem

Ok. Im creating an npc named Ambassador Dumont. I have him created and all, and I had the script working perfectly, however, I would like to add a feature to where he gives 20 pp to beginning players to buy some starter gear from a merchant, and not be able to get 20 more pp again from him. Im very confused about qglobal. Ive searched probably every thread on this forum, but I cant seem to find an explination here. It just seems vague. I understand the basic jist of it, but I cant figure out how to make it work. I looked in the npc_types in the db, and I cannot find the npcid of the character in there anywhere. But, he is in the database, and can run the basic areas of the quest, but just has problems with qglobal. I would appreciate any help anyone can give on this, because I have racked my brain for hours on end on this one.

Code:
sub EVENT_SAY
{
 if($text=~/Hail/i) { quest::say("Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?"); }
 if($text=~/flyer/i) { quest::say("Ah good, good. Just give the flyer back to me and we shall begin."); }
 if ($text=~/agree/i) {if($begincash == "") { quest::say("Good. Then all you need is some adventuring equipment and your ready to go. Here take a few platinum and go buy what you need from the armourers and weaponsmiths of the city. Dont worry, important buildings have magical signs at their entrances. You shall find it easy to locate the merchant shops that sell the items you seek. When you are [ready], return to me.");} elsif($begincash=="1") { quest::targlobal("begincash","1","Y5,336103,$charid,26);
quest::me("You have recieved a character flag!"); quest::say("Now dont be greedy. That is all the cash I am going to give you $name); } if ($text=~/ready/i) { quest::say("Good you are ready to begin, we shall start you off on something simple. The councils scouts have recently discovered a strange new race of humanoids dwelling in a place they call Crushbone. The reason it is called this is a matter of dispute between the council members, but nonetheless, the task before you is simple enough. The council wishes to gain information on the humanoids in Crushbone. An ambassador was sent a few days ago. When he returned he was missing a few vital body parts.  Visit this place and get to know their history and lore. The scouts report seeing small books on a few of the more intelligent humanoids there. Bring back 4 of these 'Orcish tomes' for the council to study. Oh and $name, the council does not care how you obtain them."); }
if ($text=~/spellcaster/i) { quest::say("Then I suppose you will need these as well.");
quest::scribespells();
quest::say("There you go! For more powerful spells, I suggest you visit the librarians inside the Orders Library. There are many spells inside that great library, but keep in mind that you will have to pay for scrolls. The harder to find scrolls do not come cheap."); }
}
sub EVENT_ITEM
{
 if ($item1 == 1001) { quest::say("Ok $name lets get started. Hmm your not very experienced are you? Well it doesnt matter, I can fix that."); quest::level(45); quest::setallskill(60); quest::say("Ah there we go, much better wouldnt you [agree]? It will take you a while to get used to your new skills, but if you wish to speed up the process, simply pay a visit to a trainer of your class. Of course you will have to pay for their services. Would you happen to be a [spellcaster]?"); }
}
Guess im just really confused. Im pretty new at this, but Im really interested in learning coding.
Reply With Quote
  #2  
Old 05-28-2006, 11:58 PM
ylosh
Sarnak
 
Join Date: Jan 2006
Posts: 39
Default

use quest::setglobal instead of targlobal.

set the qglobal field in npc_types to 1 if you haven't already to enable quest globals for your chosen npc. target the npc and use #showstats or #npcstats to get the npcid number.

the quest tutorial wiki page explains everything else pretty well.
Reply With Quote
  #3  
Old 05-30-2006, 01:16 PM
Adrianne
Fire Beetle
 
Join Date: Oct 2004
Posts: 20
Default

thats the thing.. I cant find any good examples there that were working.. all I saw were works in progress.. and the examples that were there were vague.. my npc is in the database.. he spawns when the server starts, but I cant find his npcid in the npc_type field.. I know his npcid. I just dont understand alot of this. I guess I just need to play around with it some more.
Reply With Quote
  #4  
Old 05-30-2006, 06:55 PM
ylosh
Sarnak
 
Join Date: Jan 2006
Posts: 39
Default

update npc_types set qglobal=1 where id=(ambassador dumont npcid);
quick example, maybe it'll help you.
Code:
  sub EVENT_SAY {
    if ($text=~/hail/i) {
  	if ($monkey == 1) {
  	  quest::say("global is set");
  	}
  	else {
  	  quest::say("hello there");
  	}
    }
  }
  
  sub EVENT_ITEM {
    if (plugin::check_handin(\%itemcount, 1001 => 1)) {
  	quest::say("here is your quest global");
  	quest::setglobal("monkey",1,0,"Y1"); #option 0 - this npc, this player, this zone for 1 year
    }
    plugin::return_items(\%itemcount);
  }
Reply With Quote
  #5  
Old 05-31-2006, 10:02 AM
Adrianne
Fire Beetle
 
Join Date: Oct 2004
Posts: 20
Default

Thanks. I appreciate the feedback. Much appreciated.
Reply With Quote
  #6  
Old 06-06-2006, 12:24 PM
Adrianne
Fire Beetle
 
Join Date: Oct 2004
Posts: 20
Default

ok went through and havin some problems with this. it works for the most part, however when I hail, the both the "Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?" and "May you travel with the Fives blessing $name." show up when there is no quest global entry for it in the database, and when it sets the global to 1, the "May you travel with the Fives blessing $name." doesnt show up at all. What am I doin wrong here?
Ive tried every combination I could think of, searched this forum and peq forum, and have come up with no solution. Without the

Code:
else
  {
    quest::say("May you travel with the Fives blessing $name.");
  }
Here is what I have so far:

Code:
sub EVENT_SAY
  {
  if ($flyer == 0)
  {
  if ($text=~/Hail/i)
  {
    quest::say("Ahh, hello young $race, what brings you to the Orders Library?
    You wouldnt happen to be responding to one of the [flyers] I sent out
    now would you?");
  }
  if ($text=~/flyer/i)
  {
    quest::say("Ah good, good. Just give the flyer back to me and we shall
    begin.");
  }
  if ($text=~/ready/i)
  {
    quest::say("Here. This item will return you to our fair city. It holds
    enchantments that will make you more powerful as well. Ill start you off on
    something simple. The councils scouts have recently discovered a strange new
    race of humanoids dwelling in a place they call Crushbone. The council
    wishes to gain further information on the humanoids in Crushbone. An
    Ambassador was sent a few days ago. He returned with a few missing body
    parts. The scouts report seeing small books on a few of the more intelligent
    looking humanoids there. Bring back at least four of these books for the
    council to study. The council does not care how you obtain them. Feel free
    to get them by any means necessary. Upon your return, find my apprentice.
    He will handle the books accordingly.");
    quest::summonitem(1002);
    quest::setglobal("flyer",1,0,"M2");
  }
  else
  {
    quest::say("May you travel with the Fives blessing $name.");
  }
  }
}
I have sub EVENT_ITEM stuff too, but it doesnt relate to this, Im just wanting him to not allow people to repeat the quest. When they have said ready, I want it to consider the quest done, and instead of Hail saying:

"Ahh, hello young $race, what brings you to the Orders Library?
You wouldnt happen to be responding to one of the [flyers] I sent out
now would you?"

Id like it to say:

"May you travel with the Fives blessing $name."

Any help would be appreciated here.
Reply With Quote
  #7  
Old 06-06-2006, 03:22 PM
ylosh
Sarnak
 
Join Date: Jan 2006
Posts: 39
Default

Code:
 sub EVENT_SAY {
   if ($text=~/hail/i && $flyer == 1) {
 	quest::say("May you travel with the Fives' blessing, $name.");
   }
   if ($flyer == 0) {
 	if ($text=~/Hail/i) {
 	  quest::say("Ahh, hello young $race, what brings you to the Orders Library? You wouldnt happen to be responding to one of the [flyers] I sent out now would you?");
 	}
 	if ($text=~/flyer/i) {
 	  quest::say("Ah good, good. Just give the flyer back to me and we shall begin.");
 	}
 	if ($text=~/ready/i) {
 	  quest::say("Here. This item will return you to our fair city. It holds enchantments that will make you more powerful as well. Ill start you off on something simple. The councils scouts have recently discovered a strange new race of humanoids dwelling in a place they call Crushbone. The council wishes to gain further information on the humanoids in Crushbone. An Ambassador was sent a few days ago. He returned with a few missing body parts. The scouts report seeing small books on a few of the more intelligent looking humanoids there. Bring back at least four of these books for the council to study. The council does not care how you obtain them. Feel free to get them by any means necessary. Upon your return, find my apprentice. He will handle the books accordingly.");
 	  quest::summonitem(1002);
 	  quest::setglobal("flyer",1,0,"M2");
 	}
   }
 }
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:59 PM.


 

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