mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
[svn] Send AttackStart package when update visibility.
Update DoMeleeAttackIfReady to support dual wield. Show player modelid2 instead id3 of triggers. This should fix the bug that gameobject::castspell summon a human model. Remove the correct flag to make creature attackable. This should fix the bug that Illidan and Magtheridon are unattackable. Add NullCreatureAI for trinityscript. Fix channeler's soul transfer. Some update of black temple scripts. --HG-- branch : trunk
This commit is contained in:
@@ -202,6 +202,15 @@ void ScriptedAI::DoMeleeAttackIfReady()
|
||||
m_creature->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
|
||||
m_creature->resetAttackTimer(OFF_ATTACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ScriptedAI::DoStopAttack()
|
||||
|
||||
@@ -181,4 +181,20 @@ struct TRINITY_DLL_DECL Scripted_NoMovementAI : public ScriptedAI
|
||||
//Called at each attack of m_creature by any victim
|
||||
void AttackStart(Unit *);
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL NullCreatureAI : public CreatureAI
|
||||
{
|
||||
NullCreatureAI(Creature* c) : m_creature(c) {}
|
||||
~NullCreatureAI() {}
|
||||
|
||||
Creature *m_creature;
|
||||
|
||||
void MoveInLineOfSight(Unit *) {}
|
||||
void AttackStart(Unit *) {}
|
||||
void EnterEvadeMode() {}
|
||||
bool IsVisible(Unit *) const { return false; }
|
||||
|
||||
void UpdateAI(const uint32) {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -71,6 +71,7 @@ EndScriptData */
|
||||
#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him.
|
||||
#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect)
|
||||
#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off)
|
||||
#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic
|
||||
#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :(
|
||||
#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY
|
||||
#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY
|
||||
@@ -553,7 +554,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
|
||||
if(Glaive)
|
||||
{
|
||||
GlaiveGUID[i] = Glaive->GetGUID();
|
||||
Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
|
||||
Glaive->setFaction(m_creature->getFaction());
|
||||
DoCast(Glaive, SPELL_THROW_GLAIVE2);
|
||||
@@ -570,7 +571,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
|
||||
if(Glaive)
|
||||
{
|
||||
GlaiveGUID[i] = Glaive->GetGUID();
|
||||
Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
Glaive->SetUInt32Value(UNIT_FIELD_DISPLAYID, 11686);
|
||||
Glaive->setFaction(m_creature->getFaction());
|
||||
DoCast(Glaive, SPELL_THROW_GLAIVE, true);
|
||||
@@ -1337,6 +1338,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
|
||||
Elite->AI()->AttackStart(m_creature);
|
||||
Elite->AddThreat(m_creature, 1000000.0f);
|
||||
AttackStart(Elite);
|
||||
m_creature->AddThreat(Elite, 1000000.0f);
|
||||
}
|
||||
Timer = 10000 + rand()%6000;
|
||||
GETUNIT(Illidan, IllidanGUID);
|
||||
@@ -1349,7 +1351,7 @@ struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
if(!m_creature->SelectHostilTarget() || !m_creature->getVictim())
|
||||
if(!m_creature->SelectHostilTarget() && !m_creature->getVictim())
|
||||
return;
|
||||
|
||||
if(m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20)
|
||||
@@ -1741,9 +1743,9 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
|
||||
{
|
||||
if( m_creature->isAttackReady() && m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
{
|
||||
if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0))
|
||||
if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0) && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
|
||||
{
|
||||
m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, true, 0, 0, IllidanGUID); //do not stack
|
||||
m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
|
||||
}
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
@@ -1912,6 +1914,7 @@ void boss_illidan_stormrageAI::Reset()
|
||||
TransformCount = 0;
|
||||
|
||||
m_creature->SetUInt32Value(UNIT_FIELD_DISPLAYID, 21135);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN2);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_DISPLAY, 0);
|
||||
@@ -1926,6 +1929,7 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
|
||||
{
|
||||
switch(summon->GetEntry())
|
||||
{
|
||||
case PARASITIC_SHADOWFIEND:
|
||||
case SHADOW_DEMON:
|
||||
{
|
||||
if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players.
|
||||
@@ -2158,7 +2162,7 @@ void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase)
|
||||
Timer[EVENT_FLIGHT_SEQUENCE] = 1;
|
||||
m_creature->RemoveAllAuras();
|
||||
m_creature->InterruptNonMeleeSpells(false);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->GetMotionMaster()->Clear(false);
|
||||
m_creature->AttackStop();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ EndScriptData */
|
||||
//Spells
|
||||
#define SPELL_MOLTEN_PUNCH 40126
|
||||
#define SPELL_HURTFUL_STRIKE 41926
|
||||
#define SPELL_MOLTEN_FLAME 40253
|
||||
#define SPELL_MOLTEN_FLAME 40980
|
||||
#define SPELL_VOLCANIC_ERUPTION 40117
|
||||
#define SPELL_VOLCANIC_SUMMON 40276
|
||||
#define SPELL_BERSERK 45078
|
||||
@@ -35,47 +35,14 @@ EndScriptData */
|
||||
#define CREATURE_VOLCANO 23085
|
||||
#define CREATURE_STALKER 23095
|
||||
|
||||
struct TRINITY_DLL_DECL molten_flameAI : public ScriptedAI
|
||||
struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI
|
||||
{
|
||||
molten_flameAI(Creature *c) : ScriptedAI(c)
|
||||
molten_flameAI(Creature *c) : NullCreatureAI(c)
|
||||
{
|
||||
FlameTimer = 0;
|
||||
float x, y, z;
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->GetNearPoint(m_creature, x, y, z, 1, 50, M_PI*2*rand_norm());
|
||||
m_creature->GetMotionMaster()->MovePoint(0, x, y, z);
|
||||
}
|
||||
|
||||
uint32 FlameTimer;
|
||||
|
||||
void Reset() {}
|
||||
void Aggro(Unit *who) {}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit *who) {}
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(FlameTimer < diff)
|
||||
{
|
||||
m_creature->CastSpell(m_creature, SPELL_MOLTEN_FLAME, true);
|
||||
FlameTimer = 1000;
|
||||
}else FlameTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
|
||||
{
|
||||
npc_volcanoAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
m_creature->CastSpell(m_creature, SPELL_VOLCANIC_ERUPTION, false);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void Reset() {}
|
||||
void Aggro(Unit *who) {}
|
||||
void AttackStart(Unit* who) {}
|
||||
void MoveInLineOfSight(Unit* who) {}
|
||||
void UpdateAI(const uint32 diff) {}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
|
||||
@@ -263,11 +230,6 @@ CreatureAI* GetAI_molten_flame(Creature *_Creature)
|
||||
return new molten_flameAI (_Creature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_npc_volcano(Creature *_Creature)
|
||||
{
|
||||
return new npc_volcanoAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_supremus()
|
||||
{
|
||||
Script *newscript;
|
||||
@@ -280,9 +242,4 @@ void AddSC_boss_supremus()
|
||||
newscript->Name="molten_flame";
|
||||
newscript->GetAI = GetAI_molten_flame;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="npc_volcano";
|
||||
newscript->GetAI = GetAI_npc_volcano;
|
||||
m_scripts[nrscripts++] = newscript;
|
||||
}
|
||||
|
||||
@@ -227,6 +227,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
|
||||
|
||||
m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNKNOWN2);
|
||||
m_creature->addUnitState(UNIT_STAT_STUNNED);
|
||||
m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user