aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Creature.cpp12
-rw-r--r--src/game/Level1.cpp2
-rw-r--r--src/game/Pet.cpp6
-rw-r--r--src/game/SpellAuras.cpp14
-rw-r--r--src/game/Unit.cpp2
5 files changed, 18 insertions, 18 deletions
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 6a149d97b33..78b40f28194 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -352,9 +352,9 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
SelectLevel(GetCreatureInfo());
if (team == HORDE)
- SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, GetCreatureInfo()->faction_H);
+ setFaction(GetCreatureInfo()->faction_H);
else
- SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, GetCreatureInfo()->faction_A);
+ setFaction(GetCreatureInfo()->faction_A);
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_WORLDEVENT)
SetUInt32Value(UNIT_NPC_FLAGS,GetCreatureInfo()->npcflag | gameeventmgr.GetNPCFlag(this));
@@ -1715,10 +1715,10 @@ void Creature::setDeathState(DeathState s)
if(s == JUST_DIED)
{
- SetUInt64Value (UNIT_FIELD_TARGET,0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
- SetUInt32Value(UNIT_NPC_FLAGS, 0);
- //if(!isPet())
- setActive(false);
+ SetUInt64Value(UNIT_FIELD_TARGET,0); // remove target selection in any cases (can be set at aura remove in Unit::setDeathState)
+ SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
+
+ setActive(false);
if(!isPet() && GetCreatureInfo()->SkinLootId)
if ( LootTemplates_Skinning.HaveLootFor(GetCreatureInfo()->SkinLootId) )
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp
index 0cde7dc5eb8..86a689e7383 100644
--- a/src/game/Level1.cpp
+++ b/src/game/Level1.cpp
@@ -2012,7 +2012,7 @@ bool ChatHandler::HandleModifyMountCommand(const char* args)
if (needReportToTarget(chr))
ChatHandler(chr).PSendSysMessage(LANG_MOUNT_GIVED, GetNameLink().c_str());
- chr->SetUInt32Value( UNIT_FIELD_FLAGS , 0x001000 );
+ chr->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP);
chr->Mount(mId);
WorldPacket data( SMSG_FORCE_RUN_SPEED_CHANGE, (8+4+1+4) );
diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp
index 3a72120cb79..caf37a6a61f 100644
--- a/src/game/Pet.cpp
+++ b/src/game/Pet.cpp
@@ -169,7 +169,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
}
setPetType(PetType(fields[18].GetUInt8()));
- SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, owner->getFaction());
+ setFaction(owner->getFaction());
SetUInt32Value(UNIT_CREATED_BY_SPELL, summon_spell_id);
CreatureInfo const *cinfo = GetCreatureInfo();
@@ -185,7 +185,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool
SetDisplayId(fields[3].GetUInt32());
SetNativeDisplayId(fields[3].GetUInt32());
uint32 petlevel = fields[4].GetUInt32();
- SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
SetName(fields[8].GetString());
switch (getPetType())
@@ -736,7 +736,7 @@ bool Pet::CreateBaseAtCreature(Creature* creature)
SetUInt32Value(UNIT_FIELD_PET_NAME_TIMESTAMP, 0);
SetUInt32Value(UNIT_FIELD_PETEXPERIENCE, 0);
SetUInt32Value(UNIT_FIELD_PETNEXTLEVELEXP, objmgr.GetXPForLevel(creature->getLevel())*PET_XP_FACTOR);
- SetUInt32Value(UNIT_NPC_FLAGS, 0);
+ SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
if(CreatureFamilyEntry const* cFamily = sCreatureFamilyStore.LookupEntry(cinfo->family))
SetName(cFamily->Name[sWorld.GetDefaultDbcLocale()]);
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index ee0b677bf8a..46ed4f12c58 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -3527,7 +3527,7 @@ void AuraEffect::HandleAuraModScale(bool apply, bool Real, bool /*changeAmount*/
if( apply )
{
m_target->SetCharmerGUID(GetCasterGUID());
- m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
+ m_target->setFaction(caster->getFaction());
caster->SetCharm(m_target);
@@ -3569,7 +3569,7 @@ void AuraEffect::HandleAuraModScale(bool apply, bool Real, bool /*changeAmount*/
else if(m_target->GetTypeId() == TYPEID_UNIT)
{
CreatureInfo const *cinfo = ((Creature*)m_target)->GetCreatureInfo();
- m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A);
+ m_target->setFaction(cinfo->faction_A);
}
caster->SetCharm(NULL);
@@ -3662,8 +3662,8 @@ void AuraEffect::HandleAuraModPetTalentsPoints(bool Apply, bool Real, bool chang
if( apply )
{
m_target->SetCharmerGUID(GetCasterGUID());
- m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,caster->getFaction());
- m_target->CastStop(m_target==caster ? GetId() : 0);
+ m_target->setFaction(caster->getFaction());
+ m_target->CastStop(m_target == caster ? GetId() : 0);
caster->SetCharm(m_target);
m_target->CombatStop();
@@ -3711,12 +3711,12 @@ void AuraEffect::HandleAuraModPetTalentsPoints(bool Apply, bool Real, bool chang
if(((Creature*)m_target)->isPet())
{
if(Unit* owner = m_target->GetOwner())
- m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,owner->getFaction());
+ m_target->setFaction(owner->getFaction());
else if(cinfo)
- m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A);
+ m_target->setFaction(cinfo->faction_A);
}
else if(cinfo) // normal creature
- m_target->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE,cinfo->faction_A);
+ m_target->setFaction(cinfo->faction_A);
// restore UNIT_FIELD_BYTES_0
if(cinfo && caster->GetTypeId() == TYPEID_PLAYER && caster->getClass() == CLASS_WARLOCK && cinfo->type == CREATURE_TYPE_DEMON)
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 9fd46ad2db6..20c0aea62cc 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -12951,7 +12951,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget,uint32 spell_id)
}
pet->SetCreatorGUID(GetGUID());
- pet->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, getFaction());
+ pet->setFaction(getFaction());
pet->SetUInt32Value(UNIT_CREATED_BY_SPELL, spell_id);
if(GetTypeId()==TYPEID_PLAYER)