diff options
| author | Rat <none@none> | 2009-11-03 13:10:11 +0100 |
|---|---|---|
| committer | Rat <none@none> | 2009-11-03 13:10:11 +0100 |
| commit | 609b8246f508053d4bb1441754af1da785c98867 (patch) | |
| tree | 0ed44d38a01812f550bcf44b6a101502c13a19fd /src/game/CombatAI.cpp | |
| parent | ffb28c06a7719b7a1f908aa4d7d20954d990a82f (diff) | |
*implement new creatureAI called: AOEAI
-it takes the spell1 from creature_template and casts on him self if aura not found, it can not attack or move
-creature becomes unattackable and invisible
NOTE: flag 128 should not be set in flags_extra field in creature_template, otherwise spells will be only visible to GMs
--HG--
branch : trunk
Diffstat (limited to 'src/game/CombatAI.cpp')
| -rw-r--r-- | src/game/CombatAI.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/game/CombatAI.cpp b/src/game/CombatAI.cpp index b4b7e662188..8be14d32787 100644 --- a/src/game/CombatAI.cpp +++ b/src/game/CombatAI.cpp @@ -54,6 +54,11 @@ int TurretAI::Permissible(const Creature *creature) return PERMIT_BASE_NO; } +int AOEAI::Permissible(const Creature *creature) +{ + return PERMIT_BASE_NO; +} + void CombatAI::InitializeAI() { for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i) @@ -246,3 +251,32 @@ void TurretAI::UpdateAI(const uint32 diff) //if(HostilReference *ref = me->getThreatManager().getCurrentVictim()) //ref->removeReference(); } + +////////////// +//AOEAI +////////////// + +AOEAI::AOEAI(Creature *c) : CreatureAI(c) +{ + ASSERT(me->m_spells[0]); + me->SetVisibility(VISIBILITY_ON);//visible to see all spell anims + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);//can't be targeted + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_1);//can't be damaged + me->SetDisplayId(11686);//invisible model,around a size of a player +} + +bool AOEAI::CanAIAttack(const Unit *who) const +{ + return false; +} + +void AOEAI::AttackStart(Unit *who) +{ + +} + +void AOEAI::UpdateAI(const uint32 diff) +{ + if(!me->HasAura(me->m_spells[0])) + me->CastSpell(me, me->m_spells[0],false); +}
\ No newline at end of file |
