[svn] * Little fix in RandomMovementGenerator
* Updated to 6731 and 680 --HG-- branch : trunk rename : 6721-676 => 6731-680
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -35,8 +35,8 @@ void ScriptedAI::MoveInLineOfSight(Unit *who)
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -54,8 +54,8 @@ void ScriptedAI::AttackStart(Unit* who)
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -582,8 +582,8 @@ void Scripted_NoMovementAI::MoveInLineOfSight(Unit *who)
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -601,8 +601,8 @@ void Scripted_NoMovementAI::AttackStart(Unit* who)
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,8 +55,6 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
case EVENT_T_SPAWNED:
|
||||
ProcessEvent(*i);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -612,12 +610,18 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
caster = target;
|
||||
}
|
||||
|
||||
//Interrupt any previous spell
|
||||
if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
|
||||
caster->InterruptNonMeleeSpells(false);
|
||||
//Allowed to cast only if not casting (unless we interrupt ourself) or if spell is triggered
|
||||
bool canCast = !(caster->IsNonMeleeSpellCasted(false) && (param3 & CAST_TRIGGERED | CAST_INTURRUPT_PREVIOUS));
|
||||
|
||||
//Cast only if not casting or if spell is triggered
|
||||
if (param3 & CAST_TRIGGERED || !caster->IsNonMeleeSpellCasted(false))
|
||||
// If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
|
||||
if(param3 & CAST_AURA_NOT_PRESENT)
|
||||
{
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
if(target->HasAura(param1, i))
|
||||
return;
|
||||
}
|
||||
|
||||
if (canCast)
|
||||
{
|
||||
const SpellEntry* tSpell = GetSpellStore()->LookupEntry(param1);
|
||||
|
||||
@@ -638,7 +642,14 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), AttackDistance, AttackAngle);
|
||||
}
|
||||
|
||||
}else caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
|
||||
}else
|
||||
{
|
||||
//Interrupt any previous spell
|
||||
if (caster->IsNonMeleeSpellCasted(false) && param3 & CAST_INTURRUPT_PREVIOUS)
|
||||
caster->InterruptNonMeleeSpells(false);
|
||||
|
||||
caster->CastSpell(target, param1, (param3 & CAST_TRIGGERED));
|
||||
}
|
||||
|
||||
}else if (EAI_ErrorLevel > 0)
|
||||
error_db_log("SD2: EventAI event %d creature %d attempt to cast spell that doesn't exist %d", EventId, m_creature->GetEntry(), param1);
|
||||
@@ -996,11 +1007,11 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
error_db_log("SD2: Creature %u using Event %u (Type = %u) has InitialMax < InitialMin. Event disabled.", m_creature->GetEntry(), (*i).Event.event_id, (*i).Event.event_type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
//default:
|
||||
//TODO: enable below code line / verify this is correct to enable events previously disabled (ex. aggro yell), instead of enable this in void Aggro()
|
||||
//(*i).Enabled = true;
|
||||
//(*i).Time = 0;
|
||||
break;
|
||||
//break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1029,8 +1040,6 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
case EVENT_T_EVADE:
|
||||
ProcessEvent(*i);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1050,8 +1059,6 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
case EVENT_T_DEATH:
|
||||
ProcessEvent(*i, killer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1069,8 +1076,6 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
case EVENT_T_KILL:
|
||||
ProcessEvent(*i, victim);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1089,8 +1094,6 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
case EVENT_T_SUMMONED_UNIT:
|
||||
ProcessEvent(*i, pUnit);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1145,8 +1148,8 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1193,8 +1196,8 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1215,8 +1218,6 @@ struct MANGOS_DLL_DECL Mob_EventAI : public ScriptedAI
|
||||
ProcessEvent(*i, pUnit);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,6 +113,7 @@ enum CastFlags
|
||||
CAST_FORCE_CAST = 0x04, //Forces cast even if creature is out of mana or out of range
|
||||
CAST_NO_MELEE_IF_OOM = 0x08, //Prevents creature from entering melee if out of mana or out of range
|
||||
CAST_FORCE_TARGET_SELF = 0x10, //Forces the target to cast this spell on itself
|
||||
CAST_AURA_NOT_PRESENT = 0x20, //Only casts the spell if the target does not have an aura from the spell
|
||||
};
|
||||
|
||||
enum EventFlags
|
||||
|
||||
+1
-3
@@ -104,8 +104,6 @@ struct MANGOS_DLL_DECL mob_stolen_soulAI : public ScriptedAI
|
||||
DoCast(m_creature->getVictim(), SPELL_MOONFIRE);
|
||||
Class_Timer = 10000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}else Class_Timer -= diff;
|
||||
|
||||
@@ -204,8 +202,8 @@ struct MANGOS_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -106,8 +106,8 @@ struct MANGOS_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -115,8 +115,8 @@ struct MANGOS_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -125,8 +125,8 @@ struct MANGOS_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,8 +74,8 @@ struct MANGOS_DLL_DECL boss_murmurAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -95,8 +95,8 @@ struct MANGOS_DLL_DECL boss_murmurAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,8 +61,8 @@ struct MANGOS_DLL_DECL npc_ragged_johnAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -117,8 +117,8 @@ struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -138,8 +138,8 @@ struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -108,8 +108,8 @@ struct MANGOS_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f))
|
||||
|
||||
+2
-2
@@ -200,8 +200,8 @@ struct MANGOS_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
|
||||
|
||||
if( !InCombat )
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,8 +237,8 @@ struct MANGOS_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI
|
||||
|
||||
if( !InCombat )
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -582,13 +582,13 @@ struct MANGOS_DLL_DECL boss_malchezaarAI : public ScriptedAI
|
||||
if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) && !m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
//Check for base attack
|
||||
if( m_creature->isAttackReady())
|
||||
if( m_creature->isAttackReady() && m_creature->getVictim() )
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
}
|
||||
//Check for offhand attack
|
||||
if( m_creature->isAttackReady(OFF_ATTACK))
|
||||
if( m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim() )
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
|
||||
m_creature->resetAttackTimer(OFF_ATTACK);
|
||||
|
||||
@@ -163,9 +163,6 @@ class MANGOS_DLL_SPEC instance_molten_core : public ScriptedInstance
|
||||
case ID_FLAMEWAKERPRIEST:
|
||||
FlamewakerPriest = creature->GetGUID();
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -264,8 +264,6 @@ struct MANGOS_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI
|
||||
}
|
||||
++Phase;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else Event_Timer -= diff;
|
||||
|
||||
|
||||
@@ -138,8 +138,8 @@ struct MANGOS_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -153,8 +153,8 @@ struct MANGOS_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -444,8 +444,6 @@ struct MANGOS_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
|
||||
case 7:
|
||||
pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CanSpawn = true;
|
||||
}
|
||||
@@ -505,8 +503,6 @@ struct MANGOS_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
|
||||
DoYell(YELL_WELCOME,LANG_UNIVERSAL,NULL);
|
||||
DoPlaySoundToSet(m_creature,SOUND_WELCOME);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
CanSpawn = false;
|
||||
++Phase;
|
||||
@@ -553,8 +549,6 @@ struct MANGOS_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
|
||||
DoPrepareForPhase();
|
||||
EventProgress_Timer = 15000;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else EventProgress_Timer -= diff;
|
||||
|
||||
@@ -130,8 +130,8 @@ struct MANGOS_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -148,8 +148,8 @@ struct MANGOS_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
|
||||
|
||||
if( !InCombat )
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,8 +236,6 @@ struct MANGOS_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI
|
||||
case 3:
|
||||
Intro = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}else Intro_Timer -=diff;
|
||||
}
|
||||
|
||||
@@ -215,8 +215,8 @@ struct MANGOS_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -234,8 +234,8 @@ struct MANGOS_DLL_DECL advisorbase_ai : public ScriptedAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -863,14 +863,10 @@ struct MANGOS_DLL_DECL boss_kaelthasAI : public ScriptedAI
|
||||
DoYell(SAY_SUMMON_PHOENIX1, LANG_UNIVERSAL, NULL);
|
||||
DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX1);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
DoYell(SAY_SUMMON_PHOENIX2, LANG_UNIVERSAL, NULL);
|
||||
DoPlaySoundToSet(m_creature, SOUND_SUMMON_PHOENIX2);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Phoenix_Timer = 60000;
|
||||
@@ -1252,8 +1248,8 @@ struct MANGOS_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_a
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -665,8 +665,8 @@ struct MANGOS_DLL_DECL boss_veklorAI : public boss_twinemperorsAI
|
||||
|
||||
if (!InCombat)
|
||||
{
|
||||
Aggro(who);
|
||||
InCombat = true;
|
||||
Aggro(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user