mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 11:28:25 +00:00
[PVP] Pvp guard assist code. (Guards will assist in PvP based on faction) (#1367)
* Added Guard Assist Code * Added PvP Rule and Detrimental Spell Check * Added IsGuard() Method * Change from uint to bool * Added a faction check to IsGuard() * Simplified Guard Checks, reduced costs * Added IsNPC check to guard check * simplified pet check * Removed Magic numbers * Formatting Fix * Code fixes * Fixed constants Co-authored-by: ProducerZekServer <go@away.com>
This commit is contained in:
@@ -3368,3 +3368,35 @@ void NPC::ScaleNPC(uint8 npc_level) {
|
||||
npc_scale_manager->ResetNPCScaling(this);
|
||||
npc_scale_manager->ScaleNPC(this);
|
||||
}
|
||||
|
||||
bool NPC::IsGuard()
|
||||
{
|
||||
switch (GetRace()) {
|
||||
case RT_GUARD:
|
||||
if (GetTexture() == 1 || GetTexture() == 2)
|
||||
return true;
|
||||
break;
|
||||
case RT_IKSAR_2:
|
||||
if (GetTexture() == 1)
|
||||
return true;
|
||||
break;
|
||||
case RT_GUARD_2:
|
||||
case RT_GUARD_3:
|
||||
case RT_GUARD_4:
|
||||
case RT_HUMAN_3:
|
||||
case RT_HALFLING_2:
|
||||
case RT_ERUDITE_2:
|
||||
case RT_BARBARIAN_2:
|
||||
case RT_DARK_ELF_2:
|
||||
case RT_TROLL_2:
|
||||
case OGGOK_CITIZEN:
|
||||
case RT_DWARF_2:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (GetPrimaryFaction() == DB_FACTION_GEM_CHOPPERS || GetPrimaryFaction() == DB_FACTION_HERETICS || GetPrimaryFaction() == DB_FACTION_KING_AKANON) { //these 3 factions of guards use player races instead of their own races so we must define them by faction.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user