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 04-21-2011, 06:17 PM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default NPC heading..

I've browsed forums here for a couple days, not finding any answers, looking for something that's been bugging me, but not "make or break" so haven't stressed on finding a solution.

My problem is with quest npc headings.. I place mobs, and when hailed they work as intended, but they do not return to their set heading.. I've tried adding a waypoint, but that didn't seem to do anything as the npc wasn't moving..

Only thing I can think of, is to set a timer on hail, and maybe have a quest::moveto with #loc values?

If there is another (or easier) way, would really appreciate assistance =) Thx in advance!
Reply With Quote
  #2  
Old 04-22-2011, 03:45 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I am not exactly sure what you are trying to do here, but maybe posting your script would help us to figure out what your issue is. If you want an NPC's heading, you can just do this (2 example of how to get the heading):

Code:
sub EVENT_SAY {

	my $Heading = $npc->GetHeading();
	quest::say("My exported heading is $h and my GetHeading is $Heading.");

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 04-22-2011, 04:17 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I think he wants the npc to face back to spawn heading after quest interaction.
Reply With Quote
  #4  
Old 04-22-2011, 05:14 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Ahh, yeah then you just want to set a timer directly from EVENT_SAY. Just set the timer, then I think moveto should work if you use it like this in your timer:

Code:
my $SpawnHeading = $npc->GetSpawnPointH();
$npc->MoveTo($x, $y, $z, $SpawnHeading);
Or, you might try this:

Code:
my $SpawnHeading = $npc->GetSpawnPointH();
$npc->SetHeading($SpawnHeading);
One of those will probably work.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #5  
Old 04-22-2011, 05:44 AM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

I'm thinking this might not be a bad emu code modification if it was like that on live. It's been a while, but I think I remember them facing back away after the 30 sec or whatever for quest engagement.
Reply With Quote
  #6  
Old 04-22-2011, 09:13 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I imagine that wouldn't be too hard to add at some point. Can anyone confirm for sure that is how it happens on Live and about how long the timer is for it? Not saying I will add it myself soon (or ever), but it is a possibility if I have the time and if it can be confirmed.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 04-22-2011, 11:11 AM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

I vaguely remember that SOME npcs, even those without any pathing would turn back the default direction they were facing... (maybe they did had no move pathing direction adjustment just for this)
I think they were mostly guards....

But I certainly also remember that some would remained turn the wrong way for hours... Most merchants for one...

I remember approaching a merchant/quest npc from behind, hailing him.. and going AFK for like 30 min - when I got back he was still looking at me
Reply With Quote
  #8  
Old 04-22-2011, 11:27 AM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default

Thx for input guys.. =) The quest::moveto does work, I was just wondering if there was a way to do it without going back into .pl and add it in (glad I really looked into it when I did, only had 30ish npc's to edit)

Using 30 seconds myself, but on Live it may have varied per npc but dont quote me on that.. Tried to find any quest npc's on zones that I havent touched yet, and no quest npc that I found, would return to original heading after hailed... Mobs with pathing would obviously return to path tho

Still playing with perl and "learning" so I wasnt aware of the methods you posted Trev.. mine are a bit sloppier and tedious to setup.. #loc of mob (with no interaction of course) then..

Portion of code.. With any possible dialogue outcome resulting in the quest::starttimer
Code:
sub EVENT_TIMER
	{
	if($timer eq "heading")
		{
		quest::moveto(-142.9,104.7,105.3,102.1);
		}
	}

sub EVENT_SAY
	{
	
	if($text=~/hail/i)
		{
		if($class eq 'Warrior' || $class eq 'Cleric' || $class eq 'Paladin' || $class eq 'Shadowknight' || $class eq 'Ranger')
			{
			if(quest::istaskactive(26))
				{
				$client->Message(7, "$NPCName whispers, 'I am sorry $name, but I cannot help you any further.'");
				quest::settimer("heading", 30);
				}
			else
				{
				$client->Message(7, "$NPCName whispers, 'Hello $name. I can craft you a set of $plate identical to the ones some of us wear, if you gather the materials.'");
				quest::settimer("heading", 30);
				}
			}
		}
       }
Heres another question.. Is there a way to start timer easier then what I have done? Possibly a...
Code:
sub EVENT_SAY
   {
   quest::settimer("heading", 30);
       {
        if($text=~/hail/i)
        }
    }

Last edited by deaddraqear; 04-22-2011 at 11:34 AM.. Reason: clarity
Reply With Quote
  #9  
Old 04-22-2011, 12:26 PM
robinreg
Sarnak
 
Join Date: Feb 2010
Location: California
Posts: 88
Default

I know vendor npc without hailing does not change heading at all from what I can tell. On peq, all vendors changed heading regardless of hailing or not and they don't change back to their original heading. I often wondered if I can fix that for all vendor npc for my server without having to do a perl script for every vendor npc. I have not gotten around to fooling with it yet.
Reply With Quote
  #10  
Old 04-22-2011, 12:53 PM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default

From what I gather robin, it has to be done with perl.. =( was originally hoping it could be done somehow without perl myself..

Maybe a coding wiz could throw something into the npc_type tables or something? I wouldn't be able to even guess at how to do it or where to put it in... =P
Reply With Quote
  #11  
Old 04-22-2011, 01:28 PM
robinreg
Sarnak
 
Join Date: Feb 2010
Location: California
Posts: 88
Default

yeah I went on live and check the vendors to see if they change heading and I confirm that they don't change heading at all.
Reply With Quote
  #12  
Old 04-22-2011, 01:48 PM
ChaosSlayerZ's Avatar
ChaosSlayerZ
Demi-God
 
Join Date: Mar 2009
Location: Umm
Posts: 1,492
Default

on Hail or on Opening their wares?
need to check both
Reply With Quote
  #13  
Old 04-22-2011, 02:34 PM
robinreg
Sarnak
 
Join Date: Feb 2010
Location: California
Posts: 88
Default

I did both. They didn't say anything on hails at least most of the vendor don't. only time they say something is when I open up the vendor window.
Reply With Quote
  #14  
Old 04-23-2011, 08:46 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Quote:
Originally Posted by deaddraqear View Post
Thx for input guys.. =) The quest::moveto does work, I was just wondering if there was a way to do it without going back into .pl and add it in (glad I really looked into it when I did, only had 30ish npc's to edit)

Using 30 seconds myself, but on Live it may have varied per npc but dont quote me on that.. Tried to find any quest npc's on zones that I havent touched yet, and no quest npc that I found, would return to original heading after hailed... Mobs with pathing would obviously return to path tho

Still playing with perl and "learning" so I wasnt aware of the methods you posted Trev.. mine are a bit sloppier and tedious to setup.. #loc of mob (with no interaction of course) then..

Portion of code.. With any possible dialogue outcome resulting in the quest::starttimer
Code:
sub EVENT_TIMER
	{
	if($timer eq "heading")
		{
		quest::moveto(-142.9,104.7,105.3,102.1);
		}
	}

sub EVENT_SAY
	{
	
	if($text=~/hail/i)
		{
		if($class eq 'Warrior' || $class eq 'Cleric' || $class eq 'Paladin' || $class eq 'Shadowknight' || $class eq 'Ranger')
			{
			if(quest::istaskactive(26))
				{
				$client->Message(7, "$NPCName whispers, 'I am sorry $name, but I cannot help you any further.'");
				quest::settimer("heading", 30);
				}
			else
				{
				$client->Message(7, "$NPCName whispers, 'Hello $name. I can craft you a set of $plate identical to the ones some of us wear, if you gather the materials.'");
				quest::settimer("heading", 30);
				}
			}
		}
       }
Heres another question.. Is there a way to start timer easier then what I have done? Possibly a...
Code:
sub EVENT_SAY
   {
   quest::settimer("heading", 30);
       {
        if($text=~/hail/i)
        }
    }
Yeah, you can simplify it a bit by doing this:

Code:
sub EVENT_TIMER
{
	if($timer eq "heading")
	{
		my $SpawnHeading = $npc->GetSpawnPointH();
		quest::moveto($x, $y, $z, $SpawnHeading);
	}
}

sub EVENT_SAY
{
	
	if($text=~/hail/i)
	{
		if($class eq 'Warrior' || $class eq 'Cleric' || $class eq 'Paladin' || $class eq 'Shadowknight' || $class eq 'Ranger')
		{
			if(quest::istaskactive(26))
			{
				$client->Message(7, "$NPCName whispers, 'I am sorry $name, but I cannot help you any further.'");
			}
			else
			{
				$client->Message(7, "$NPCName whispers, 'Hello $name. I can craft you a set of $plate identical to the ones some of us wear, if you gather the materials.'");
			}
		}
	}
	quest::settimer("heading", 30);
}
That way, you don't need to get the exact loc of each NPC, this timer should work for all without needing to adjust it. Then, you just add in the the settimer once at the end (or beginning) of EVENT_SAY and you are all set.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #15  
Old 04-23-2011, 11:32 AM
deaddraqear
Sarnak
 
Join Date: May 2008
Location: california
Posts: 45
Default

Many thanks Trev, will try this out on next quest npcs =D
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 04:39 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