diff options
Diffstat (limited to 'src/game/CreatureEventAI.cpp')
-rw-r--r-- | src/game/CreatureEventAI.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/game/CreatureEventAI.cpp b/src/game/CreatureEventAI.cpp index e1203ef35cc..74ed23304f6 100644 --- a/src/game/CreatureEventAI.cpp +++ b/src/game/CreatureEventAI.cpp @@ -71,7 +71,7 @@ CreatureEventAI::CreatureEventAI(Creature *c ) : CreatureAI(c) if ((*i).event_flags & EFLAG_DEBUG_ONLY) continue; #endif - if(m_creature->GetMap()->IsDungeon()) + if (m_creature->GetMap()->IsDungeon()) { if ((1 << (m_creature->GetMap()->GetSpawnMode()+1)) & (*i).event_flags) { @@ -296,7 +296,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction //Note: checked only aura for effect 0, if need check aura for effect 1/2 then // possible way: pack in event.buffed.amount 2 uint16 (ammount+effectIdx) Aura const * aura = m_creature->GetAura(event.buffed.spellId); - if(!aura || aura->GetStackAmount() < event.buffed.amount) + if (!aura || aura->GetStackAmount() < event.buffed.amount) return false; //Repeat Timers @@ -312,7 +312,7 @@ bool CreatureEventAI::ProcessEvent(CreatureEventAIHolder& pHolder, Unit* pAction //Note: checked only aura for effect 0, if need check aura for effect 1/2 then // possible way: pack in event.buffed.amount 2 uint16 (ammount+effectIdx) Aura const * aura = pActionInvoker->GetAura(event.buffed.spellId); - if(!aura || aura->GetStackAmount() < event.buffed.amount) + if (!aura || aura->GetStackAmount() < event.buffed.amount) return false; //Repeat Timers @@ -457,9 +457,9 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 bool canCast = !caster->IsNonMeleeSpellCasted(false) || (action.cast.castFlags & (CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS)); // If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them - if(action.cast.castFlags & CAST_AURA_NOT_PRESENT) + if (action.cast.castFlags & CAST_AURA_NOT_PRESENT) { - if(target->HasAura(action.cast.spellId)) + if (target->HasAura(action.cast.spellId)) return; } @@ -527,7 +527,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 { std::list<HostileReference*>& threatList = m_creature->getThreatManager().getThreatList(); for (std::list<HostileReference*>::iterator i = threatList.begin(); i != threatList.end(); ++i) - if(Unit* Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid())) + if (Unit* Temp = Unit::GetUnit(*m_creature,(*i)->getUnitGuid())) m_creature->getThreatManager().modifyThreatPercent(Temp, action.threat_all_pct.percent); break; } @@ -567,7 +567,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 break; case ACTION_T_COMBAT_MOVEMENT: // ignore no affect case - if(CombatMovementEnabled==(action.combat_movement.state!=0)) + if (CombatMovementEnabled==(action.combat_movement.state!=0)) return; CombatMovementEnabled = action.combat_movement.state != 0; @@ -818,7 +818,7 @@ void CreatureEventAI::ProcessAction(CreatureEventAI_Action const& action, uint32 } case ACTION_T_SET_INVINCIBILITY_HP_LEVEL: { - if(action.invincibility_hp_level.is_percent) + if (action.invincibility_hp_level.is_percent) InvinceabilityHpLevel = m_creature->GetMaxHealth()*action.invincibility_hp_level.hp_level/100; else InvinceabilityHpLevel = action.invincibility_hp_level.hp_level; @@ -1003,7 +1003,7 @@ void CreatureEventAI::AttackStart(Unit *who) void CreatureEventAI::MoveInLineOfSight(Unit *who) { - if(me->getVictim()) + if (me->getVictim()) return; //Check for OOC LOS Event @@ -1238,7 +1238,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* sLog.outDebug("CreatureEventAI: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); - if((*i).second.SoundId) + if ((*i).second.SoundId) { if (GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) pSource->PlayDirectSound((*i).second.SoundId); @@ -1246,7 +1246,7 @@ void CreatureEventAI::DoScriptText(int32 textEntry, WorldObject* pSource, Unit* sLog.outErrorDb("CreatureEventAI: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId); } - if((*i).second.Emote) + if ((*i).second.Emote) { if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) { @@ -1341,9 +1341,9 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote) void CreatureEventAI::DamageTaken( Unit* done_by, uint32& damage ) { - if(InvinceabilityHpLevel > 0 && m_creature->GetHealth() < InvinceabilityHpLevel+damage) + if (InvinceabilityHpLevel > 0 && m_creature->GetHealth() < InvinceabilityHpLevel+damage) { - if(m_creature->GetHealth() <= InvinceabilityHpLevel) + if (m_creature->GetHealth() <= InvinceabilityHpLevel) damage = 0; else damage = m_creature->GetHealth() - InvinceabilityHpLevel; @@ -1352,7 +1352,7 @@ void CreatureEventAI::DamageTaken( Unit* done_by, uint32& damage ) bool CreatureEventAI::SpawnedEventConditionsCheck(CreatureEventAI_Event const& event) { - if(event.event_type != EVENT_T_SPAWNED) + if (event.event_type != EVENT_T_SPAWNED) return false; switch (event.spawned.condition) |