Set creatures PvP state flag based on creature faction and renamerelated enum. by NoFantasy
--HG-- branch : trunk
This commit is contained in:
@@ -389,14 +389,13 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
|||||||
SetCanModifyStats(true);
|
SetCanModifyStats(true);
|
||||||
UpdateAllStats();
|
UpdateAllStats();
|
||||||
|
|
||||||
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetCreatureInfo()->faction_A);
|
// checked and error show at loading templates
|
||||||
if (factionTemplate) // check and error show at loading templates
|
if (FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(GetCreatureInfo()->faction_A))
|
||||||
{
|
{
|
||||||
FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction);
|
if (factionTemplate->factionFlags & FACTION_TEMPLATE_FLAG_PVP)
|
||||||
if (factionEntry)
|
SetPvP(true);
|
||||||
if( !(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_CIVILIAN) &&
|
else
|
||||||
(factionEntry->team == ALLIANCE || factionEntry->team == HORDE) )
|
SetPvP(false);
|
||||||
SetPvP(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// HACK: trigger creature is always not selectable
|
// HACK: trigger creature is always not selectable
|
||||||
@@ -2318,7 +2317,7 @@ bool Creature::LoadCreaturesAddon(bool reload)
|
|||||||
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
|
// 3 ShapeshiftForm Must be determined/set by shapeshift spell/aura
|
||||||
|
|
||||||
SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
|
SetByteValue(UNIT_FIELD_BYTES_2, 0, uint8(cainfo->bytes2 & 0xFF));
|
||||||
SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
|
//SetByteValue(UNIT_FIELD_BYTES_2, 1, uint8((cainfo->bytes2 >> 8) & 0xFF));
|
||||||
//SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
|
//SetByteValue(UNIT_FIELD_BYTES_2, 2, uint8((cainfo->bytes2 >> 16) & 0xFF));
|
||||||
SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
|
SetByteValue(UNIT_FIELD_BYTES_2, 2, 0);
|
||||||
//SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));
|
//SetByteValue(UNIT_FIELD_BYTES_2, 3, uint8((cainfo->bytes2 >> 24) & 0xFF));
|
||||||
|
|||||||
+2
-1
@@ -270,7 +270,8 @@ enum SpawnMask
|
|||||||
|
|
||||||
enum FactionTemplateFlags
|
enum FactionTemplateFlags
|
||||||
{
|
{
|
||||||
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
|
FACTION_TEMPLATE_FLAG_PVP = 0x00000800, // flagged for PvP
|
||||||
|
FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FactionMasks
|
enum FactionMasks
|
||||||
|
|||||||
+1
-1
@@ -226,7 +226,7 @@ enum SheathState
|
|||||||
#define MAX_SHEATH_STATE 3
|
#define MAX_SHEATH_STATE 3
|
||||||
|
|
||||||
// byte (1 from 0..3) of UNIT_FIELD_BYTES_2
|
// byte (1 from 0..3) of UNIT_FIELD_BYTES_2
|
||||||
enum UnitBytes2_Flags
|
enum UnitPVPStateFlags
|
||||||
{
|
{
|
||||||
UNIT_BYTE2_FLAG_PVP = 0x01,
|
UNIT_BYTE2_FLAG_PVP = 0x01,
|
||||||
UNIT_BYTE2_FLAG_UNK1 = 0x02,
|
UNIT_BYTE2_FLAG_UNK1 = 0x02,
|
||||||
|
|||||||
Reference in New Issue
Block a user