Looking to prevent engage with Faction
Hi everyone I"m in the process of creating an event and I'm looking for ways to prevent players who have a $faction > 9 from engaging the NPCs. I thought about using the Banish code from Vox/Naggy or possibly having them DT anyone who engages and isn't Scowling(faction = 9).
There will be an entire zone full of NPCs with this script on them and I'm not sure if the Banish/DT scripts would cause sever strain on the system or not. If anyone has an ideas on ways to handle this the help would be greatly appreciated. |
Perhaps you can run a check on the player to see how their faction stands with the mob and if it isn't within the chosen parameters then instead of "banishing" them, you can maybe teleport them to another part of the zone, or send them back to bind point?
If you don't want the player to be able to attack and deal damage to said mobs, then you might could make could run the same check and if the faction holds true to your parameters, then you can have the mob not attack and not be attacked (invul) and this should prevent the player(s) in question from progressing. It has been a while since I messed around with Perl code, and I haven't had the chance to check out the new LUA scripts/coding since it was implemented , otherwise I would have posted a script similar to what I would think you are wanting. ~Kingmen |
Quote:
|
Quote:
|
Would I use GetFactionLevel(FactionID) to extract the faction from the entity list of a PC on the hate list?
|
This is what I have so far.
Code:
sub EVENT_AGGRO { quest;;say("Is Client named $h_ent hate list is $hate_count "); so what I am having issue with is if ($h_ent->GetCharacterFactionLevel(GetNPCFaction()) > 1) { It is this the correct way to full the PC who is on the hatelist's faction with the NPC? |
Pretty sure it should be $npc->GetNPCFactionID. Suggestion below. Personal preference, but when you post code would you mind putting it in better formatting, looks really bad when everything's jumbled together.
This: Code:
($h_ent->GetCharacterFactionLevel(GetNPCFaction()) > 1) Code:
($h_ent->GetCharacterFactionLevel($npc->GetNPCFactionID()) > 1) |
Thanks for the response. I will clean up my code for future posts.
The faction check is still not firing it seems. As before it gets to the Is Entity a Client check which passes. I have also tried to specifiy the faction id with no success. Code:
if ($h_ent->GetCharacterFactionLevel(1117) > 1) I also tried to store the faction ID as a variable and call it back in a quest::say with no success Code:
my $h_faction = $ent->GetCharacterFactionLevel(1117); |
Likely because GetCharacterFactionLevel happens to be a $client call, weird I didn't notice, rather tired at the moment. Try the below suggestion, please.
Code:
($client->GetCharacterFactionLevel($npc->GetNPCFactionID()) > 1) |
Code:
sub EVENT_COMBAT { Thats how you seem to get faction level when its not in a client activated script. Code:
my $FACTION = $h_ent->GetFactionLevel($h_ent->CharacterID(), $npc->GetID(), $h_ent->GetRace(), $h_ent->GetClass(), $h_ent->GetDeity(), $npc->GetPrimaryFaction(), $npc); |
This is exactly what I needed. I had tried over 30 different ways and I would have never figured this out without your help. Thank You!
Code:
my $FACTION = $h_ent->GetFactionLevel($h_ent->CharacterID(), $npc->GetID(), $h_ent->GetRace(), $h_ent->GetClass(), $h_ent->GetDeity(), $npc->GetPrimaryFaction(), $npc); |
No problem :)
|
All times are GMT -4. The time now is 04:08 PM. |
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.