Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 04-20-2009, 02:31 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default Event_proximity_say

Following discussion in another thread, I added a new EVENT_PROXIMITY_SAY.

Example quest:
Code:
sub EVENT_SPAWN {
   $x = $npc->GetX();
   $y = $npc->GetY();
   quest::set_proximity($x - 500, $x + 500, $y - 500, $y + 500);
}

sub EVENT_PROXIMITY_SAY {

        if($text=~/hate bixby/i) {
                quest::shout("So $name hates me huh ? I'll show you!");
                quest::attack($name);
        }
}
The way it works is this. When you call quest::set_proximity, the code checks to see if the NPC also has an EVENT_PROXIMITY_SAY. If it does, it sets a flag in the proximity entry, and also sets a global flag to indicate that EVENT_PROXIMITY_SAY is in use for this instance of this zone.

When a client says something and has nothing targetted, if the global flag is set, the proximities are run through, looking for one that is associated with an NPC that has an EVENT_PROXIMITY_SAY and for which the client is within the proximity.

I'm unsure as to whether the EVENT_PROXIMITY_SAY should be called even if the player has something targetted. You quest writers let me know and I can change it if required.
Reply With Quote
  #2  
Old 04-20-2009, 03:33 PM
So_1337
Dragon
 
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
Default

Very nice work, as always. I do have one concern that needs to be stated, though. I can only imagine what would happen if a group of NPCs that all have the PROXIMITY_SAY activated and all have "hail" triggers were to be used in a populated zone like PoK. They'd be talking non-stop, to no one nearby.

With that in mind I'd have to say this is something that should only be used in a very few limited instances, such as the throne in Kael for the Coldain Ring quest line. Not something that we should go back and blanket all quest givers with.

Just that quick word of caution. Other than that, brilliant work! =)
Reply With Quote
  #3  
Old 04-20-2009, 03:56 PM
Andrew80k
Dragon
 
Join Date: Feb 2007
Posts: 659
Default

Oh, I was thinking about putting these on my buffers in PoK to see if they would talk to each other if I was sitting in the middle of them. Setup some random phrases...could be a lot of fun.
Reply With Quote
  #4  
Old 04-20-2009, 04:19 PM
janusd
Sarnak
 
Join Date: Jan 2008
Posts: 47
Default

I Love You Derision!
Reply With Quote
  #5  
Old 04-20-2009, 06:00 PM
blackdragonsdg
Dragon
 
Join Date: Dec 2008
Location: Tennessee
Posts: 654
Default

Quote:
Originally Posted by So_1337 View Post
Very nice work, as always. I do have one concern that needs to be stated, though. I can only imagine what would happen if a group of NPCs that all have the PROXIMITY_SAY activated and all have "hail" triggers were to be used in a populated zone like PoK. They'd be talking non-stop, to no one nearby.

With that in mind I'd have to say this is something that should only be used in a very few limited instances, such as the throne in Kael for the Coldain Ring quest line. Not something that we should go back and blanket all quest givers with.

Just that quick word of caution. Other than that, brilliant work! =)

Triggering multiple npc's could be overcome with a check to see which npc has priority. What i mean is if multiple npcs would be triggered use the distance from you to the npc's to determine which one you are closest to and make the closest have priority. If it is a class specific quest you could make the check look at the characters class and only trigger on a specific class. You could also use targeting or any other form of check to help keep npc's from chattering mindlessly.
Reply With Quote
  #6  
Old 04-20-2009, 07:07 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

That is really awesome, Derision! Very nice way of handling it without causing too much overhead.

Personally, I think that the target should not matter. If they are within the proximity, it should parse the say, target or not. If someone wanted to require a target, they can always put that requirement into the script easy enough.

One example I can think of for this is the invisible NPC in PoGrowth that would kill you if you said something like "ph4t l3wtz" and were in range of it. Obviously, you wouldn't have this targeted when you said this, but if you targeted yourself, a group member or any other NPC in the zone, I still think it should parse that say. It isn't really a big deal, but just something to consider. Either way, I am glad to see this functionality added. I am sure Kayen and myself can come up with some fun uses for it on Storm Haven
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #7  
Old 04-20-2009, 10:18 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

May want to ignore "hail" in that if you are going to do non-target responses. Would be funny to hear 10 NPCs in PoK respond to 1 hail...
Reply With Quote
  #8  
Old 04-21-2009, 03:43 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

You may be misunderstanding what this is for. This will not effect how any current NPC scripts work. So, you won't see 10 NPCs in pok responding to a hail unless that is something that was setup specifically to be that way by the script writer. I don't think hail should be ignored. If someone wants hail to require a target, they could set it that way.

What if I wanted to write a quest where people have to go through a zone looking for an invisible NPC and the only way to find them is by running around hailing to see if they get a response?

Code:
sub EVENT_SPAWN {
   $x = $npc->GetX();
   $y = $npc->GetY();
   quest::set_proximity($x - 500, $x + 500, $y - 500, $y + 500);
}

sub EVENT_PROXIMITY_SAY {

        if($text=~/Hail/i) {
                quest::me("A mysterious voice responds from the darkness.");
                quest::say("So, you have found me at last.  Would you please [free] my soul?");
        }

#and so on...
}
IMO, the proximity say should have no restrictions, because any wanted restriction could be added by the script writer in the individual script. Proximity say probably won't be used overly much, so there isn't much reason to set restrictions on it. But, it will certainly be nice to have the option to use it now.

I didn't check the code for it yet, but I was curious if Proximity says would work even if the NPC has aggro on the player?
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 04-21-2009 at 11:52 AM..
Reply With Quote
  #9  
Old 04-21-2009, 12:15 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,490
Default

Ah, I see. Yeah, no problem then.
Reply With Quote
  #10  
Old 07-19-2009, 07:00 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I went ahead and removed the No Target requirement for proximity says. So, now you can have a target and still trigger a proximity say, which I think makes them a bit more flexible. You can still check for a target within the script easily enough if you really don't want the player to have a target when triggering a proximity say.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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 03:54 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