*Update gluth script.
--HG-- branch : trunk
This commit is contained in:
@@ -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())
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user