[svn] *** Source: MaNGOS ***
* Fixed build extractor at Windows Vista. Author: Vladimir * Fixed comment text and code indentifiers spelling. Author: Vladimir & Paradox. * Access cached member lists in guild handlers instead of querying the DB. Author: Hunuza * Small fixes in send/received packet and simple code cleanup also. Author: Vladimir * Not output error at loading empty character_ticket table. Author: Vladimir * Not reset display model at shapeshift aura remove if it not set at apply. Author: Arthorius * Applied props to few files. --HG-- branch : trunk
This commit is contained in:
@@ -73,7 +73,7 @@ bool ScriptedAI::IsVisible(Unit* who) const
|
||||
|
||||
void ScriptedAI::MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if(m_creature->getVictim() || !m_creature->IsHostileTo(who) || !who->isInAccessablePlaceFor(m_creature))
|
||||
if(m_creature->getVictim() || !m_creature->IsHostileTo(who) || !who->isInAccessiblePlaceFor(m_creature))
|
||||
return;
|
||||
|
||||
if(!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
@@ -786,7 +786,7 @@ std::list<Creature*> ScriptedAI::DoFindFriendlyMissingBuff(float range, uint32 s
|
||||
|
||||
void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && m_creature->canAttack(who) && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -1195,7 +1195,7 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
if (m_creature->isCivilian() && m_creature->IsNeutralToAll())
|
||||
return;
|
||||
|
||||
if (m_creature->canAttack(who) && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
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;
|
||||
|
||||
@@ -60,7 +60,7 @@ void npc_escortAI::MoveInLineOfSight(Unit *who)
|
||||
if (IsBeingEscorted && !Attack)
|
||||
return;
|
||||
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
+1
-1
@@ -172,7 +172,7 @@ struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature))
|
||||
{
|
||||
if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0))
|
||||
{
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if( !HasTaunted && m_creature->IsWithinDistInMap(who, 100.0) )
|
||||
{
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if(!Intro && m_creature->IsWithinDistInMap(who, 100))
|
||||
{
|
||||
|
||||
+1
-1
@@ -178,7 +178,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||
|
||||
@@ -189,7 +189,7 @@ struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -162,7 +162,7 @@ struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI
|
||||
if(!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID))
|
||||
return;
|
||||
|
||||
if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
|
||||
@@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
|
||||
{
|
||||
if(!who || (!who->isAlive())) return;
|
||||
|
||||
if(who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if(who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -41,14 +41,14 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
|
||||
{
|
||||
if( who->HasAura(16468,0) )
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
DoCast(who,16472);
|
||||
((Player*)who)->AreaExploredOrEventHappens(4866);
|
||||
}
|
||||
}
|
||||
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
+1
-1
@@ -278,7 +278,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||
|
||||
+1
-1
@@ -236,7 +236,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
|
||||
if(m_creature->HasAura(AURA_BANISH, 0))
|
||||
return;
|
||||
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
+182
-182
@@ -1,182 +1,182 @@
|
||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_the_lurker_below
|
||||
SD%Complete: 10
|
||||
SDComment:
|
||||
SDCategory: The Lurker Below
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_serpent_shrine.h"
|
||||
#include "../../../creature/simple_ai.h"
|
||||
#include "Spell.h"
|
||||
|
||||
#define SPELL_SPOUT 37433
|
||||
#define SPELL_SPOUT_2 42835
|
||||
#define SPELL_KNOCKBACK 19813
|
||||
#define SPELL_GEYSER 37478
|
||||
#define SPELL_WHIRL 37660
|
||||
#define SPELL_WATERBOLT 37138
|
||||
#define SPELL_SUBMERGE 37550
|
||||
#define SPELL_EMERGE 20568
|
||||
|
||||
#define EMOTE_SPOUT "takes a deep breath."
|
||||
|
||||
#define MOB_COILFANG_GUARDIAN 21873
|
||||
#define MOB_COILFANG_AMBUSHER 21865
|
||||
|
||||
//Ambusher spells
|
||||
#define SPELL_SPREAD_SHOT 37790
|
||||
#define SPELL_SHOOT 37770
|
||||
|
||||
//Guardian spells
|
||||
#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one.
|
||||
#define SPELL_HAMSTRING 26211
|
||||
|
||||
struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public ScriptedAI
|
||||
{
|
||||
boss_the_lurker_belowAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_coilfang_guardian(Creature *_Creature)
|
||||
{
|
||||
SimpleAI* ai = new SimpleAI (_Creature);
|
||||
|
||||
ai->Spell[0].Enabled = true;
|
||||
ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH;
|
||||
ai->Spell[0].Cooldown = 15000;
|
||||
ai->Spell[0].First_Cast = 5000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
ai->Spell[1].Enabled = true;
|
||||
ai->Spell[1].Spell_Id = SPELL_HAMSTRING;
|
||||
ai->Spell[1].Cooldown = 10000;
|
||||
ai->Spell[1].First_Cast = 2000;
|
||||
ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Reset();
|
||||
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT);
|
||||
if(TempSpell)
|
||||
TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg
|
||||
}
|
||||
|
||||
uint32 MultiShotTimer;
|
||||
uint32 ShootBowTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
MultiShotTimer = 10000;
|
||||
ShootBowTimer = 4000;
|
||||
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!who || m_creature->getVictim()) return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
AttackStart(who);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(MultiShotTimer < diff)
|
||||
{
|
||||
if(m_creature->getVictim())
|
||||
DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true);
|
||||
|
||||
MultiShotTimer = 10000;
|
||||
ShootBowTimer += 1500;//add global cooldown
|
||||
}else MultiShotTimer -= diff;
|
||||
|
||||
if(ShootBowTimer < diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
int bp0 = 1100;
|
||||
if(target)
|
||||
m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true);
|
||||
ShootBowTimer = 4000;
|
||||
MultiShotTimer += 1500;//add global cooldown
|
||||
}else ShootBowTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_coilfang_ambusher(Creature *_Creature)
|
||||
{
|
||||
return new mob_coilfang_ambusherAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_the_lurker_below(Creature *_Creature)
|
||||
{
|
||||
return new boss_the_lurker_belowAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_the_lurker_below()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_the_lurker_below";
|
||||
newscript->GetAI = GetAI_boss_the_lurker_below;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_coilfang_guardian";
|
||||
newscript->GetAI = GetAI_mob_coilfang_guardian;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_coilfang_ambusher";
|
||||
newscript->GetAI = GetAI_mob_coilfang_ambusher;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
}
|
||||
|
||||
/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* 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
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: boss_the_lurker_below
|
||||
SD%Complete: 10
|
||||
SDComment:
|
||||
SDCategory: The Lurker Below
|
||||
EndScriptData */
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_serpent_shrine.h"
|
||||
#include "../../../creature/simple_ai.h"
|
||||
#include "Spell.h"
|
||||
|
||||
#define SPELL_SPOUT 37433
|
||||
#define SPELL_SPOUT_2 42835
|
||||
#define SPELL_KNOCKBACK 19813
|
||||
#define SPELL_GEYSER 37478
|
||||
#define SPELL_WHIRL 37660
|
||||
#define SPELL_WATERBOLT 37138
|
||||
#define SPELL_SUBMERGE 37550
|
||||
#define SPELL_EMERGE 20568
|
||||
|
||||
#define EMOTE_SPOUT "takes a deep breath."
|
||||
|
||||
#define MOB_COILFANG_GUARDIAN 21873
|
||||
#define MOB_COILFANG_AMBUSHER 21865
|
||||
|
||||
//Ambusher spells
|
||||
#define SPELL_SPREAD_SHOT 37790
|
||||
#define SPELL_SHOOT 37770
|
||||
|
||||
//Guardian spells
|
||||
#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one.
|
||||
#define SPELL_HAMSTRING 26211
|
||||
|
||||
struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public ScriptedAI
|
||||
{
|
||||
boss_the_lurker_belowAI(Creature *c) : ScriptedAI(c) {Reset();}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_coilfang_guardian(Creature *_Creature)
|
||||
{
|
||||
SimpleAI* ai = new SimpleAI (_Creature);
|
||||
|
||||
ai->Spell[0].Enabled = true;
|
||||
ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH;
|
||||
ai->Spell[0].Cooldown = 15000;
|
||||
ai->Spell[0].First_Cast = 5000;
|
||||
ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
ai->Spell[1].Enabled = true;
|
||||
ai->Spell[1].Spell_Id = SPELL_HAMSTRING;
|
||||
ai->Spell[1].Cooldown = 10000;
|
||||
ai->Spell[1].First_Cast = 2000;
|
||||
ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET;
|
||||
|
||||
return ai;
|
||||
}
|
||||
|
||||
struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI
|
||||
{
|
||||
mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c)
|
||||
{
|
||||
Reset();
|
||||
SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_SHOOT);
|
||||
if(TempSpell)
|
||||
TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg
|
||||
}
|
||||
|
||||
uint32 MultiShotTimer;
|
||||
uint32 ShootBowTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
MultiShotTimer = 10000;
|
||||
ShootBowTimer = 4000;
|
||||
|
||||
}
|
||||
|
||||
void Aggro(Unit *who)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!who || m_creature->getVictim()) return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
AttackStart(who);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(MultiShotTimer < diff)
|
||||
{
|
||||
if(m_creature->getVictim())
|
||||
DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true);
|
||||
|
||||
MultiShotTimer = 10000;
|
||||
ShootBowTimer += 1500;//add global cooldown
|
||||
}else MultiShotTimer -= diff;
|
||||
|
||||
if(ShootBowTimer < diff)
|
||||
{
|
||||
Unit* target = NULL;
|
||||
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
|
||||
int bp0 = 1100;
|
||||
if(target)
|
||||
m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true);
|
||||
ShootBowTimer = 4000;
|
||||
MultiShotTimer += 1500;//add global cooldown
|
||||
}else ShootBowTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_coilfang_ambusher(Creature *_Creature)
|
||||
{
|
||||
return new mob_coilfang_ambusherAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_the_lurker_below(Creature *_Creature)
|
||||
{
|
||||
return new boss_the_lurker_belowAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_the_lurker_below()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_the_lurker_below";
|
||||
newscript->GetAI = GetAI_boss_the_lurker_below;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_coilfang_guardian";
|
||||
newscript->GetAI = GetAI_mob_coilfang_guardian;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="mob_coilfang_ambusher";
|
||||
newscript->GetAI = GetAI_mob_coilfang_ambusher;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -303,7 +303,7 @@ struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
//no attack radius check - it attacks the first target that moves in his los
|
||||
who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
|
||||
|
||||
@@ -452,7 +452,7 @@ struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI
|
||||
}
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
@@ -582,7 +582,7 @@ struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
@@ -696,7 +696,7 @@ struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI
|
||||
}
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!IntroOnce && m_creature->IsWithinDistInMap(who, 75))
|
||||
{
|
||||
|
||||
@@ -99,7 +99,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL boss_faerlinaAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -49,7 +49,7 @@ struct TRINITY_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
|
||||
|
||||
@@ -421,7 +421,7 @@ struct TRINITY_DLL_DECL boss_alythessAI : public ScriptedAI
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
|
||||
@@ -349,7 +349,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
|
||||
if( IsRunning )
|
||||
return;
|
||||
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -117,7 +117,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
|
||||
if( !Intro )
|
||||
return;
|
||||
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -202,7 +202,7 @@ struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessablePlaceFor(m_creature) )
|
||||
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
@@ -495,7 +495,7 @@ struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (!m_creature->getVictim() && who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
@@ -345,7 +345,7 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
|
||||
if (!who || m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who))
|
||||
{
|
||||
float attackRadius = m_creature->GetAttackDistance(who);
|
||||
if (attackRadius < PULL_RANGE)
|
||||
|
||||
Reference in New Issue
Block a user