diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/creature/mob_event_ai.cpp | 39 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/creature/mob_event_ai.h | 8 |
2 files changed, 26 insertions, 21 deletions
diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp index af945282935..289b6b925c5 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.cpp +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.cpp @@ -6,12 +6,12 @@ * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* ScriptData @@ -965,6 +965,17 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI DoZoneInCombat(); } break; + + // TRINITY ONLY + case ACTION_T_SET_ACTIVE: + m_creature->setActive(param1 ? true : false); + break; + case ACTION_T_SET_AGGRESSIVE: + m_creature->SetAggressive(param1 ? true : false); + break; + case ACTION_T_ATTACK_START_PULSE: + AttackStart(m_creature->SelectNearestTarget((float)param1)); + break; } } @@ -1192,24 +1203,12 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI } } - if (m_creature->isCivilian() && m_creature->IsNeutralToAll()) - return; - - if (m_creature->canAttack(who) && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; + // do we need this? + //if (m_creature->isCivilian() && m_creature->IsNeutralToAll()) + // return; - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //if(who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - - //Begin melee attack if we are within range - AttackStart(who); - } - } + if(m_creature->canStartAttack(who)) + AttackStart(who); } void SpellHit(Unit* pUnit, const SpellEntry* pSpell) @@ -1292,6 +1291,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI //Do not decrement timers if event cannot trigger in this phase if (!((*i).Event.event_inverse_phase_mask & (1 << Phase))) (*i).Time -= EventDiff; + //Skip processing of events that have time remaining continue; } @@ -1328,6 +1328,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI //Melee Auto-Attack if (Combat && MeleeEnabled) DoMeleeAttackIfReady(); + } }; diff --git a/src/bindings/scripts/scripts/creature/mob_event_ai.h b/src/bindings/scripts/scripts/creature/mob_event_ai.h index 1183fdd3c73..d08a6b33a2b 100644 --- a/src/bindings/scripts/scripts/creature/mob_event_ai.h +++ b/src/bindings/scripts/scripts/creature/mob_event_ai.h @@ -1,6 +1,6 @@ /* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ #ifndef SC_EVENTAI_H #define SC_EVENTAI_H @@ -76,6 +76,10 @@ enum Action_Types ACTION_T_DIE = 37, //No Params ACTION_T_ZONE_COMBAT_PULSE = 38, //No Params + ACTION_T_SET_ACTIVE = 101, //Apply + ACTION_T_SET_AGGRESSIVE = 102, //Apply + ACTION_T_ATTACK_START_PULSE = 103, //Distance + ACTION_T_END, }; |