Proximity check for surrounding NPCs
Hi all,
I am trying to have a NPC do proximity check that will check for any NPC in the proximity. The purpose of this is, im starting from scratch and im trying to globally do a scripted distance chain aggro so I can bypass factions. Also other uses. I have read that NPC proximity can only check for PC. If thats the case. there is also the Code:
if(plugin::CheckDistBetween2Ents($npc1, $npc2, 50)){ Everything I have tried so far has failed, am just looken for direction. Hopefully I can write it when on the path lol Thank you. |
I've written small tutorials for NPC list iterations in the entity list:
http://wiki.eqemulator.org/p?Entity_...ow_to_Use_Them Anytime you are using $client or $npc, those are IMPLIED entity objects. You can create your own entity objects by fetching them selectively in your code. Code:
$some_boss = $entity_list->GetNPCByNPCTypeID(40005); # Example Code:
if(plugin::CheckDistBetween2Ents($npc, $some_boss, 50)){ Code:
my @nlist = $entity_list->GetNPCList(); #::: Use Entity List Object to get this |
Nice! Thank you, reading over it all now :)
|
Well I would think this would work, been worken on it and tryen to get it to work but it does not and i am blinded by the reason why.
Its fairly simple, It looks like it would work but it doesnt. Code:
sub EVENT_SPAWN{ |
How is the script bring initiated and how are you testing
|
I have the script on 2 npcs in a zone by themselves. I agro one from a distance and run it by the other one to check if they recognize each other to eventually chain aggro.
|
Quote:
|
Code:
sub EVENT_SPAWN{ |
Script above works, Thank you
EDIT: Now I just gotta get the agro to share lol |
Finalized Template to get npc to npc distance checks and add agro, to script agro linking for whatever reason you may want. I will be usen it for many reasons including bypassing faction linking on a wiped custom server.
GetHateRandom can be changed to whatever you like, GetHateTop works as well, depending what you want to happen. Code:
sub EVENT_TIMER{ |
Modified for use as a "guard" without using faction. Basically you can change the target NPCIDs to have the guard attack specific npcs that come close enough.
Code:
#2211 Enclave_Protector in postorms v.1 |
All times are GMT -4. The time now is 04:52 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.