|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Quests::Q&A This is the quest support section |
01-15-2010, 10:11 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
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");
}
}
|
01-15-2010, 10:52 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
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) {
|
01-15-2010, 11:25 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
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
|
01-16-2010, 08:52 AM
|
|
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
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.
|
01-16-2010, 09:04 AM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
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
|
01-16-2010, 01:13 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
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
|
|
|
|
01-16-2010, 02:18 PM
|
Hill Giant
|
|
Join Date: Jan 2007
Posts: 124
|
|
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
|
|
|
|
01-16-2010, 02:53 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
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
|
01-16-2010, 03:02 PM
|
|
Developer
|
|
Join Date: Mar 2003
Posts: 1,497
|
|
As Trevius stated, you have the flag set to 0. Two NPCs will not be able to read that qglobal.
|
01-16-2010, 03:58 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
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
|
01-16-2010, 07:13 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
can someone test this on there server for me and see if it works maybe its my server or plugins files or somthing
|
01-16-2010, 07:47 PM
|
Hill Giant
|
|
Join Date: Dec 2009
Posts: 175
|
|
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
|
|
|
|
01-16-2010, 07:55 PM
|
Hill Giant
|
|
Join Date: Jan 2007
Posts: 124
|
|
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
|
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 11:12 AM.
|
|
|
|
|
|
|
|
|
|
|
|
|