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 06-07-2018, 03:55 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default Q&A Thread

Have any questions, issues, or concerns about the way Lua/Perl quests work? Feel free to ask here. In my time working with EQEmulator I've written probably 1,000,000 different scripts in dozens of different formats and languages. If you are stuck on a script or have an idea you can't put in to script form, ask here. I'll either write you a mockup, solve your issue, or give you an idea as to what you're doing incorrectly.

TL;DR: I'm bored of not working on a server and I want to help the new server operators who may not know the ins and outs of Perl/Lua.
Reply With Quote
  #2  
Old 06-08-2018, 09:18 AM
swansona65
Fire Beetle
 
Join Date: Oct 2013
Posts: 11
Default

I am trying to create a script for NPC's that will teleport people to tier zones.. So you would hail the NPC and he would teleport you to said zone. I have no idea where to even start, thank you for your help.
Reply With Quote
  #3  
Old 06-08-2018, 11:22 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Take a look here.
Reply With Quote
  #4  
Old 06-08-2018, 02:57 PM
swansona65
Fire Beetle
 
Join Date: Oct 2013
Posts: 11
Default

Thanks man! Can you give me dumbed down version with only a hail and port to a specific zone name i can fill in. I will deal with flags later.
Reply With Quote
  #5  
Old 06-16-2018, 02:07 PM
Castious
Fire Beetle
 
Join Date: Jun 2015
Posts: 19
Default

A way to limit the amount of damage able to be done via melee to a NPC. Like say I only want players to be able to hit something for 20 damage max.
Reply With Quote
  #6  
Old 09-06-2018, 08:09 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default Help with quest::follow ?

Been trying to figure out what I am missing here with simple script. The text response works, but not the follow.

Code:
sub EVENT_SAY {

	my $gather = $entity_list->GetClientByCharID($charid);

	if($text=~/hail/i) {
	quest::say("I'm with you $name and following.");
	quest::follow($gather);
    }
}
Reply With Quote
  #7  
Old 09-06-2018, 08:28 PM
Akkadius's Avatar
Akkadius
Administrator
 
Join Date: Feb 2009
Location: MN
Posts: 2,071
Default

Try using $name in quest::follow - or $gather->GetCleanName(), but $name should suffice in your given example
Reply With Quote
  #8  
Old 09-06-2018, 08:42 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

Quote:
Originally Posted by Akkadius View Post
Try using $name in quest::follow - or $gather->GetCleanName(), but $name should suffice in your given example
Ok, I will give that a shot. I did try using GetClientByName($name) as well as a few other variables, but I will see what happens with your suggestion. Thank You
Reply With Quote
  #9  
Old 09-07-2018, 08:41 AM
Almusious
Fire Beetle
 
Join Date: Sep 2012
Posts: 25
Default

Quote:
Originally Posted by Huppy View Post
Ok, I will give that a shot. I did try using GetClientByName($name) as well as a few other variables, but I will see what happens with your suggestion. Thank You
In your quest::follow is where you try $name he means

You shouldn't have to get the client object, as it is the initiator of EVENT_SAY, so just $client would suffice

Ive always used an ID of a pc/npc, give it a try:

Code:
sub EVENT_SAY {
	if($text=~/hail/i) 
	{
		quest::say("I'm with you $name and following.");
		quest::follow($userid);
    }
}
Reply With Quote
  #10  
Old 09-07-2018, 09:38 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

Quote:
Originally Posted by Almusious View Post
Ive always used an ID of a pc/npc, give it a try:

Code:
sub EVENT_SAY {
	if($text=~/hail/i) 
	{
		quest::say("I'm with you $name and following.");
		quest::follow($userid);
    }
}
Hey Almuscious, thank you, that little sample works like a charm

I'd already tried a few variables with the quest::follow before I even posted the question, including $name and $client, etc.

My intentions for this little task, was just for any player that hails the NPC, it will start to follow.

I've already got scripts running with NPC's following other NPC's with id's but this was my first crack at a random PC follow.

I was going through everything on the wiki with entities, etc., and had no luck, but I sometimes I overlook the obvious, lol

EDIT: This works good with an EVENT_ENTER as well. I set the proximity so all you have to do is run by and it clings to you, lol
Reply With Quote
  #11  
Old 09-07-2018, 10:25 AM
Almusious
Fire Beetle
 
Join Date: Sep 2012
Posts: 25
Default

Quote:
Originally Posted by Huppy View Post
Hey Almuscious, thank you, that little sample works like a charm

I'd already tried a few variables with the quest::follow before I even posted the question, including $name and $client, etc.

My intentions for this little task, was just for any player that hails the NPC, it will start to follow.

I've already got scripts running with NPC's following other NPC's with id's but this was my first crack at a random PC follow.

I was going through everything on the wiki with entities, etc., and had no luck, but I sometimes I overlook the obvious, lol

EDIT: This works good with an EVENT_ENTER as well. I set the proximity so all you have to do is run by and it clings to you, lol
Before the recent work on the eqemu wiki I would often turn to the source (embparser.cpp, etc.) to see what what expects as data but keep this in your arsenal, it will likely be your go to:

https://github.com/EQEmu/Server/wiki/Perl-API

If we look up the quest::follow we'll see it expects an entity id rather than the object itself
Code:
quest::follow(int entity_id, [int distance = 10])
Consequently you can define a following distance with the below

Code:
quest::follow($userid, 50);
otherwise
Code:
quest::follow($userid);
without a distance defined it will default to 10

Happy coding
Reply With Quote
  #12  
Old 09-07-2018, 10:51 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

Thanks a lot Almusious. Just thought I would mention. Did some testing with the proximity trigger and a 2nd PC wandering by.
If Player A has the NPC following and Player B happens to come along, NPC picks up the new player and follows. It's funny, lol
Reply With Quote
  #13  
Old 09-07-2018, 11:14 AM
Almusious
Fire Beetle
 
Join Date: Sep 2012
Posts: 25
Default

Quote:
Originally Posted by Huppy View Post
Thanks a lot Almusious. Just thought I would mention. Did some testing with the proximity trigger and a 2nd PC wandering by.
If Player A has the NPC following and Player B happens to come along, NPC picks up the new player and follows. It's funny, lol
Code:
sub EVENT_SAY {
	if ($text=~/hail/i and !$entity->GetEntityVariable("master"))
	{
		$entity->SetEntityVariable("master", $charid);
		quest::say("I'm with you $name and following.");
		quest::follow($userid);		
    }
	elsif ($text=~/leave/i and $entity->GetEntityVariable("master") == $charid)
	{
		quest::say("Fine $name!  Be all alone in your travels...");
		$entity->SetEntityVariable("master", 0); # just in case it doesnt poof i guess
		quest::depop();
	}
}
Reply With Quote
  #14  
Old 09-08-2018, 08:53 AM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

Quote:
Originally Posted by Almusious View Post
Code:
sub EVENT_SAY {
	if ($text=~/hail/i and !$entity->GetEntityVariable("master"))
	{
		$entity->SetEntityVariable("master", $charid);
		quest::say("I'm with you $name and following.");
		quest::follow($userid);		
    }
	elsif ($text=~/leave/i and $entity->GetEntityVariable("master") == $charid)
	{
		quest::say("Fine $name!  Be all alone in your travels...");
		$entity->SetEntityVariable("master", 0); # just in case it doesnt poof i guess
		quest::depop();
	}
}
Hey Almusious, I just got around to testing this out, this morning. I couldn't get any response out of the NPC with it.

The initial hail>follow script will serve it's purpose, but thinking ahead, would open up an exploit with conflicting players.

Could end up with 2 players (or more) spamming the npc with "Hail's" to steal it away. Would be funny to watch, lol
Reply With Quote
  #15  
Old 09-09-2018, 02:10 PM
Huppy's Avatar
Huppy
Demi-God
 
Join Date: Oct 2010
Posts: 1,333
Default

I almost forgot about another question I had regarding this follow thing and wondering if an idea I had was possible.

For example, NPC starts following player, but then the player is moving too fast, creating a big distance between them.

Is there a way to set an "sfollow" when a certain distance happens ? Like if the player gets too far away, the NPC quits ?
Reply With Quote
Reply

Thread Tools
Display Modes

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 06:34 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