*Update gluth script.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-16 16:52:57 -05:00
parent a0ba5dc206
commit c583767ad6
4 changed files with 84 additions and 42 deletions
+27
View File
@@ -97,6 +97,33 @@ void CreatureAI::MoveInLineOfSight(Unit *who)
AttackStart(who->getVictim());
}
void CreatureAI::SetGazeOn(Unit *target)
{
if(me->canAttack(target))
{
AttackStart(target);
me->SetReactState(REACT_PASSIVE);
}
}
bool CreatureAI::UpdateVictimWithGaze()
{
if(!me->isInCombat())
return false;
if(me->HasReactState(REACT_PASSIVE))
{
if(me->getVictim())
return true;
else
me->SetReactState(REACT_AGGRESSIVE);
}
if(Unit *victim = me->SelectVictim())
AttackStart(victim);
return me->getVictim();
}
bool CreatureAI::UpdateVictimByReact()
{
if(!me->isInCombat())
+3
View File
@@ -83,6 +83,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
bool UpdateVictim();
bool UpdateVictimByReact();
bool UpdateVictimWithGaze();
public:
explicit CreatureAI(Creature *c) : UnitAI((Unit*)c), me(c), m_creature(c) {}
@@ -167,6 +168,8 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
Unit* SelectTarget(SelectAggroTarget target, uint32 position = 0, float dist = 0, bool playerOnly = false, int32 aura = 0);
void SelectTargetList(std::list<Unit*> &targetList, uint32 num, SelectAggroTarget target, float dist = 0, bool playerOnly = false, int32 aura = 0);
void SetGazeOn(Unit *target);
static AISpellInfoType *AISpellInfo;
static void FillAISpellInfo();