mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 00:48:56 +01:00
[svn] Send AttackStart package when update visibility.
Update DoMeleeAttackIfReady to support dual wield. Show player modelid2 instead id3 of triggers. This should fix the bug that gameobject::castspell summon a human model. Remove the correct flag to make creature attackable. This should fix the bug that Illidan and Magtheridon are unattackable. Add NullCreatureAI for trinityscript. Fix channeler's soul transfer. Some update of black temple scripts. --HG-- branch : trunk
This commit is contained in:
@@ -202,6 +202,15 @@ void ScriptedAI::DoMeleeAttackIfReady()
|
||||
m_creature->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
|
||||
m_creature->resetAttackTimer(OFF_ATTACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptedAI::DoStopAttack()
|
||||
|
||||
@@ -181,4 +181,20 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
|
||||
//Called at each attack of m_creature by any victim
|
||||
void AttackStart(Unit *);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL NullCreatureAI : public CreatureAI
|
||||
{
|
||||
NullCreatureAI(Creature* c) : m_creature(c) {}
|
||||
~NullCreatureAI() {}
|
||||
|
||||
Creature *m_creature;
|
||||
|
||||
void MoveInLineOfSight(Unit *) {}
|
||||
void AttackStart(Unit *) {}
|
||||
void EnterEvadeMode() {}
|
||||
bool IsVisible(Unit *) const { return false; }
|
||||
|
||||
void UpdateAI(const uint32) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user