*Update flame levi script. Fix the bug that it often gets stuck.
--HG-- branch : trunk
This commit is contained in:
@@ -1058,7 +1058,7 @@ UPDATE `gameobject_template` SET `ScriptName`='go_altar_of_archaedas' WHERE `ent
|
||||
UPDATE `instance_template` SET `script`='instance_ulduar' WHERE `map`=603;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_auriaya' WHERE `entry` = 33515;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_flame_leviathan' WHERE `entry` = 33113;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_flame_leviathan_turret' WHERE entry=33139;
|
||||
UPDATE `creature_template` SET AIName = 'TurretAI',`ScriptName` = '' WHERE entry=33139;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_flame_leviathan_seat' WHERE entry=33114;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_flame_leviathan_defense_turret' WHERE entry=33142;
|
||||
UPDATE `creature_template` SET `ScriptName` = 'boss_flame_leviathan_overload_device' WHERE entry=33143;
|
||||
|
||||
@@ -2116,8 +2116,10 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
-- ULDUAR
|
||||
-- --------
|
||||
INSERT INTO creature_template (entry, vehicleid) VALUES
|
||||
(32930, 312), # Kologarn
|
||||
(33113, 340), # Flame Leviathan
|
||||
(33114, 341) # Flame Leviathan Seat
|
||||
(33114, 341), # Flame Leviathan Seat
|
||||
(33214, 348) # Mechanolift 304-A
|
||||
ON DUPLICATE KEY UPDATE
|
||||
vehicleid = VALUES(vehicleid);
|
||||
|
||||
@@ -2128,6 +2130,7 @@ UPDATE creature_template SET speed=2 WHERE entry=33062;
|
||||
UPDATE creature_template SET faction_A=1965,faction_H=1965 WHERE entry IN (33090,33113,33139);
|
||||
|
||||
UPDATE creature_template SET flags_extra = 0 WHERE entry IN (33114);
|
||||
UPDATE creature_template SET InhabitType = 4 WHERE entry = 33214; # Mechanolift 304-A
|
||||
|
||||
INSERT INTO creature_template (entry, spell1, spell2, spell3, spell4, spell5, spell6, vehicleid) VALUES
|
||||
(33062, 62974, 62286, 62299, 64660, 0, 0, 335), # Salvaged Chopper
|
||||
@@ -2153,7 +2156,8 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-62475,62427);
|
||||
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
|
||||
(-62475,-62399, 0, 'System Shutdown'),
|
||||
(-62475,-62399, 0, 'System Shutdown - Overload Circuit'),
|
||||
(-62475,-62375, 0, 'System Shutdown - Gathering Speed'),
|
||||
(-62475, 62472, 0, 'System Shutdown'), #inform, not correct spell
|
||||
( 62427, 62340, 2, 'Load into Catapult - Passenger Loaded');
|
||||
|
||||
@@ -2161,6 +2165,10 @@ DELETE FROM `npc_spellclick_spells` WHERE `npc_entry` IN (33143);
|
||||
INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `quest_start`, `quest_start_active`, `quest_end`, `cast_flags`) VALUES
|
||||
(33143, 62399, 0, 0, 0, 0); # Overide device
|
||||
|
||||
update creature_template set spell1=62395, AIName = 'TurretAI', scriptname='' where entry = 33139;
|
||||
update creature_template set spell1=62402 where entry = 33142;
|
||||
update creature_template set ScriptName = 'boss_kologarn' where entry = 32930;
|
||||
|
||||
|
||||
-- --------
|
||||
-- WINTERGRASP
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
INSERT INTO creature_template (entry, vehicleid) VALUES
|
||||
(32930, 312), # Kologarn
|
||||
(33214, 348) # Mechanolift 304-A
|
||||
ON DUPLICATE KEY UPDATE
|
||||
vehicleid = VALUES(vehicleid);
|
||||
|
||||
UPDATE creature_template SET InhabitType = 4 WHERE entry = 33214;
|
||||
|
||||
update creature_template set spell1=62395, AIName = 'TurretAI', scriptname='' where entry = 33139;
|
||||
update creature_template set spell1=62402 where entry = 33142;
|
||||
update creature_template set ScriptName = 'boss_kologarn' where entry = 32930;
|
||||
|
||||
DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (-62475,62427);
|
||||
INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
|
||||
(-62475,-62399, 0, 'System Shutdown - Overload Circuit'),
|
||||
(-62475,-62375, 0, 'System Shutdown - Gathering Speed'),
|
||||
(-62475, 62472, 0, 'System Shutdown'), #inform, not correct spell
|
||||
( 62427, 62340, 2, 'Load into Catapult - Passenger Loaded');
|
||||
@@ -55,6 +55,8 @@ enum Events
|
||||
EVENT_PURSUE = 1,
|
||||
EVENT_MISSILE,
|
||||
EVENT_VENT,
|
||||
EVENT_SPEED,
|
||||
EVENT_SUMMON,
|
||||
EVENT_MIMIRON_INFERNO, // Not Blizzlike
|
||||
EVENT_HODIR_FURY, // Not Blizzlike
|
||||
};
|
||||
@@ -88,8 +90,10 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
events.ScheduleEvent(EVENT_PURSUE, 0);
|
||||
events.ScheduleEvent(EVENT_MISSILE, 1500);
|
||||
events.ScheduleEvent(EVENT_VENT, 20000);
|
||||
events.ScheduleEvent(EVENT_MIMIRON_INFERNO, 60000 + (rand()%60000)); // Not Blizzlike
|
||||
events.ScheduleEvent(EVENT_HODIR_FURY, 60000 + (rand()%60000)); // Not Blizzlike
|
||||
events.ScheduleEvent(EVENT_SPEED, 15000);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 0);
|
||||
//events.ScheduleEvent(EVENT_MIMIRON_INFERNO, 60000 + (rand()%60000)); // Not Blizzlike
|
||||
//events.ScheduleEvent(EVENT_HODIR_FURY, 60000 + (rand()%60000)); // Not Blizzlike
|
||||
if (Creature *turret = CAST_CRE(vehicle->GetPassenger(7)))
|
||||
turret->AI()->DoZoneInCombat();
|
||||
}
|
||||
@@ -120,8 +124,8 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
if(summon->GetEntry() == MOB_MECHANOLIFT)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
if(Creature* container = DoSummon(MOB_CONTAINER, summon, 0, 0))
|
||||
container->GetMotionMaster()->MovePoint(1, container->GetPositionX(), container->GetPositionY(), me->GetPositionZ());
|
||||
//if(Creature* container = DoSummon(MOB_CONTAINER, summon, 0, 0))
|
||||
// container->GetMotionMaster()->MovePoint(1, container->GetPositionX(), container->GetPositionY(), me->GetPositionZ());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,17 +134,12 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
if (!me->isInCombat())
|
||||
return;
|
||||
|
||||
if (me->getThreatManager().isThreatListEmpty()) // This is wrong, Flame Leviathan isn't even supposed to have a threat list, he just "switches to another Siege Engine/Demolisher every 30 seconds"
|
||||
if (me->getThreatManager().isThreatListEmpty())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
me->SetHealth(me->GetMaxHealth()); // EnterEvadeMode(); does not work against vehicles
|
||||
return;
|
||||
}
|
||||
|
||||
if(summons.size() < 4)
|
||||
if(Creature *lift = DoSummonFlyer(MOB_MECHANOLIFT, me, 50, rand()%20 + 20, 0))
|
||||
lift->GetMotionMaster()->MoveRandom(100);
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
@@ -154,8 +153,11 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
{
|
||||
case 0: break; // this is a must
|
||||
case EVENT_PURSUE:
|
||||
DoCastAOE(SPELL_PURSUED);
|
||||
events.RepeatEvent(35000);
|
||||
DoCastAOE(SPELL_PURSUED, true);
|
||||
//events.RepeatEvent(35000); // this should not be used because eventId may be overriden
|
||||
events.RescheduleEvent(EVENT_PURSUE, 35000);
|
||||
if(!me->getVictim()) // all siege engines and demolishers are dead
|
||||
UpdateVictim(); // begin to kill other things
|
||||
return;
|
||||
case EVENT_MISSILE:
|
||||
//TODO: without unittarget no visual effect
|
||||
@@ -167,6 +169,16 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
DoCastAOE(SPELL_FLAME_VENTS);
|
||||
events.RepeatEvent(20000);
|
||||
return;
|
||||
case EVENT_SPEED:
|
||||
DoCastAOE(SPELL_GATHERING_SPEED);
|
||||
events.RepeatEvent(15000);
|
||||
return;
|
||||
case EVENT_SUMMON:
|
||||
if(summons.size() < 10)
|
||||
if(Creature *lift = DoSummonFlyer(MOB_MECHANOLIFT, me, rand()%20 + 20, 50, 0))
|
||||
lift->GetMotionMaster()->MoveRandom(100);
|
||||
events.RepeatEvent(2000);
|
||||
return;
|
||||
case EVENT_MIMIRON_INFERNO: // Not Blizzlike
|
||||
DoCast(me->getVictim(), SPELL_MIMIRON_INFERNO);
|
||||
events.RepeatEvent(60000 + (rand()%60000));
|
||||
@@ -183,59 +195,6 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI
|
||||
{
|
||||
boss_flame_leviathan_turretAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
events.ScheduleEvent(1, 5000);
|
||||
}
|
||||
|
||||
void AttackStart(Unit *who)
|
||||
{
|
||||
if(who)
|
||||
me->Attack(who, false);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateCombatState())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if (uint32 eventId = events.GetEvent())
|
||||
{
|
||||
switch(eventId)
|
||||
{
|
||||
case 1:
|
||||
DoCast(me->getVictim(), SPELL_FLAME_CANNON);
|
||||
AttackStart(SelectTarget(SELECT_TARGET_RANDOM));
|
||||
events.RepeatEvent(3000);
|
||||
return;
|
||||
default:
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//#define BOSS_DEBUG
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public PassiveAI
|
||||
@@ -293,50 +252,21 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public PassiveAI
|
||||
}
|
||||
};
|
||||
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI
|
||||
struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public TurretAI
|
||||
{
|
||||
boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c), timer(2000) {}
|
||||
|
||||
uint32 timer;
|
||||
boss_flame_leviathan_defense_turretAI(Creature *c) : TurretAI(c) {}
|
||||
|
||||
void DamageTaken(Unit *who, uint32 &damage)
|
||||
{
|
||||
if (!who->GetVehicle() || who->GetVehicleBase()->GetEntry() != 33114)
|
||||
if(!CanAIAttack(who))
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit *who)
|
||||
bool CanAIAttack(const Unit *who) const
|
||||
{
|
||||
if (me->getVictim())
|
||||
return;
|
||||
|
||||
if (who->GetTypeId() != TYPEID_PLAYER || !who->GetVehicle() || who->GetVehicleBase()->GetEntry() != 33114)
|
||||
return;
|
||||
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
void AttackStart(Unit *who)
|
||||
{
|
||||
if(who)
|
||||
me->Attack(who, false);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->hasUnitState(UNIT_STAT_CASTING))
|
||||
return;
|
||||
|
||||
if(timer > diff)
|
||||
timer -= diff;
|
||||
else
|
||||
{
|
||||
timer = 2000;
|
||||
DoCast(me->getVictim(), SPELL_SEARING_FLAME);
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -388,11 +318,6 @@ CreatureAI* GetAI_boss_flame_leviathan(Creature* pCreature)
|
||||
return new boss_flame_leviathanAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_flame_leviathan_turret(Creature* pCreature)
|
||||
{
|
||||
return new boss_flame_leviathan_turretAI (pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_flame_leviathan_seat(Creature* pCreature)
|
||||
{
|
||||
return new boss_flame_leviathan_seatAI (pCreature);
|
||||
@@ -421,11 +346,6 @@ void AddSC_boss_flame_leviathan()
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_flame_leviathan_turret";
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan_turret;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_flame_leviathan_seat";
|
||||
newscript->GetAI = &GetAI_boss_flame_leviathan_seat;
|
||||
|
||||
@@ -18,3 +18,50 @@
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "def_ulduar.h"
|
||||
#include "Vehicle.h"
|
||||
|
||||
#define SPELL_ARM_DEAD_DAMAGE HEROIC(63629,63979)
|
||||
#define SPELL_TWO_ARM_SMASH HEROIC(63356,64003)
|
||||
#define SPELL_ONE_ARM_SMASH HEROIC(63573,64006)
|
||||
#define SPELL_STONE_SHOUT HEROIC(63716,64005)
|
||||
#define SPELL_PETRIFY_BREATH HEROIC(62030,63980)
|
||||
|
||||
#define SPELL_STONE_GRIP HEROIC(62166,63981)
|
||||
#define SPELL_ARM_SWEEP HEROIC(63766,63983)
|
||||
|
||||
struct TRINITY_DLL_DECL boss_kologarnAI : public BossAI
|
||||
{
|
||||
boss_kologarnAI(Creature *c) : BossAI(c, BOSS_KOLOGARN), vehicle(me->GetVehicleKit())
|
||||
{
|
||||
assert(vehicle);
|
||||
}
|
||||
|
||||
Vehicle *vehicle;
|
||||
|
||||
void AttackStart(Unit *who)
|
||||
{
|
||||
me->Attack(who, true);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_kologarn(Creature* pCreature)
|
||||
{
|
||||
return new boss_kologarnAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_kologarn()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name="boss_kologarn";
|
||||
newscript->GetAI = &GetAI_boss_kologarn;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -291,6 +291,7 @@ extern void AddSC_boss_flame_leviathan();
|
||||
extern void AddSC_boss_ignis();
|
||||
extern void AddSC_boss_razorscale();
|
||||
extern void AddSC_boss_xt002();
|
||||
extern void AddSC_boss_kologarn();
|
||||
extern void AddSC_boss_assembly_of_iron();
|
||||
extern void AddSC_instance_ulduar();
|
||||
extern void AddSC_boss_keleseth(); //Utgarde Keep
|
||||
@@ -684,6 +685,7 @@ void AddScripts()
|
||||
AddSC_boss_razorscale();
|
||||
AddSC_boss_xt002();
|
||||
AddSC_boss_assembly_of_iron();
|
||||
AddSC_boss_kologarn();
|
||||
AddSC_instance_ulduar();
|
||||
AddSC_boss_keleseth(); //Utgarde Keep
|
||||
AddSC_boss_skarvald_dalronn();
|
||||
|
||||
@@ -562,6 +562,8 @@ void Creature::Update(uint32 diff)
|
||||
break;
|
||||
}
|
||||
case DEAD_FALLING:
|
||||
GetMotionMaster()->UpdateMotion(diff);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -1817,6 +1819,7 @@ bool Creature::FallGround()
|
||||
if (fabs(ground_Z - z) < 0.1f)
|
||||
return false;
|
||||
|
||||
RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
|
||||
GetMotionMaster()->MovePoint(EVENT_FALL_GROUND, x, y, ground_Z);
|
||||
Unit::setDeathState(DEAD_FALLING);
|
||||
return true;
|
||||
|
||||
@@ -1034,8 +1034,9 @@ uint32 ObjectMgr::ChooseDisplayId(uint32 team, const CreatureInfo *cinfo, const
|
||||
case 33114: // Flame Leviathan Seat (model 24914 chair)
|
||||
case 33167: // Salvaged Demolisher Mechanic Seat
|
||||
return cinfo->DisplayID_A[0];
|
||||
case 33143: // Overload Control Device
|
||||
case 33218: // Pyrite Safety Container
|
||||
return cinfo->DisplayID_A[1];
|
||||
case 33143: // Overload Control Device
|
||||
return cinfo->DisplayID_H[0];
|
||||
default:
|
||||
return cinfo->GetRandomValidModelId();
|
||||
|
||||
Reference in New Issue
Block a user