[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:
megamage
2008-11-09 14:54:13 -06:00
parent 2c83fc42fc
commit ee02a2fc84
11 changed files with 82 additions and 62 deletions

View File

@@ -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()

View File

@@ -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