diff options
| author | maximius <none@none> | 2009-10-27 17:07:40 -0700 |
|---|---|---|
| committer | maximius <none@none> | 2009-10-27 17:07:40 -0700 |
| commit | 86c7bbc8bb0f48fb98fb8aad7de2a404bd4d00ea (patch) | |
| tree | cc35f9ade1b1d831d01544e55e25c11d5ba645f9 /src/bindings/scripts/base | |
| parent | 9bcb6695af74c57b6f089f46e25b023712b8f02a (diff) | |
*Cleanup..
--HG--
branch : trunk
Diffstat (limited to 'src/bindings/scripts/base')
| -rw-r--r-- | src/bindings/scripts/base/escort_ai.cpp | 2 | ||||
| -rw-r--r-- | src/bindings/scripts/base/follower_ai.cpp | 2 | ||||
| -rw-r--r-- | src/bindings/scripts/base/guard_ai.cpp | 30 | ||||
| -rw-r--r-- | src/bindings/scripts/base/simple_ai.cpp | 2 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 21f56eb99f4..08adf6a534b 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -274,7 +274,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) //Check if player or any member of his group is within range if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !m_creature->getVictim() && !HasEscortState(STATE_ESCORT_RETURNING)) { - if (m_uiPlayerCheckTimer < uiDiff) + if (m_uiPlayerCheckTimer <= uiDiff) { if (DespawnAtFar && !IsPlayerOrGroupInRange()) { diff --git a/src/bindings/scripts/base/follower_ai.cpp b/src/bindings/scripts/base/follower_ai.cpp index 1b938d0e855..644b6194545 100644 --- a/src/bindings/scripts/base/follower_ai.cpp +++ b/src/bindings/scripts/base/follower_ai.cpp @@ -186,7 +186,7 @@ void FollowerAI::UpdateAI(const uint32 uiDiff) { if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !m_creature->getVictim()) { - if (m_uiUpdateFollowTimer < uiDiff) + if (m_uiUpdateFollowTimer <= uiDiff) { if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) { diff --git a/src/bindings/scripts/base/guard_ai.cpp b/src/bindings/scripts/base/guard_ai.cpp index 1001d3a1170..6ba2b684b4b 100644 --- a/src/bindings/scripts/base/guard_ai.cpp +++ b/src/bindings/scripts/base/guard_ai.cpp @@ -68,24 +68,24 @@ void guardAI::UpdateAI(const uint32 diff) //Buff timer (only buff when we are alive and not in combat if (m_creature->isAlive() && !m_creature->isInCombat()) - if (BuffTimer < diff) - { - //Find a spell that targets friendly and applies an aura (these are generally buffs) - SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA); - - if (info && !GlobalCooldown) + if (BuffTimer <= diff) { - //Cast the buff spell - DoCastSpell(m_creature, info); + //Find a spell that targets friendly and applies an aura (these are generally buffs) + SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA); - //Set our global cooldown - GlobalCooldown = GENERIC_CREATURE_COOLDOWN; + if (info && !GlobalCooldown) + { + //Cast the buff spell + DoCastSpell(m_creature, info); + + //Set our global cooldown + GlobalCooldown = GENERIC_CREATURE_COOLDOWN; - //Set our timer to 10 minutes before rebuff - BuffTimer = 600000; - } //Try agian in 30 seconds - else BuffTimer = 30000; - }else BuffTimer -= diff; + //Set our timer to 10 minutes before rebuff + BuffTimer = 600000; + } //Try again in 30 seconds + else BuffTimer = 30000; + } else BuffTimer -= diff; //Return since we have no target if (!UpdateVictim()) diff --git a/src/bindings/scripts/base/simple_ai.cpp b/src/bindings/scripts/base/simple_ai.cpp index 60511d163b7..2c537a92794 100644 --- a/src/bindings/scripts/base/simple_ai.cpp +++ b/src/bindings/scripts/base/simple_ai.cpp @@ -211,7 +211,7 @@ void SimpleAI::UpdateAI(const uint32 diff) if (!Spell[i].Enabled || !Spell[i].Spell_Id) continue; - if (Spell_Timer[i] < diff) + if (Spell_Timer[i] <= diff) { //Check if this is a percentage based if (Spell[i].First_Cast < 0 && Spell[i].First_Cast > -100 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > -Spell[i].First_Cast) |
