*Update flame leviathan script.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-08-23 01:08:09 -05:00
parent b35fe879ad
commit dee4a9fd87
12 changed files with 247 additions and 54 deletions
+1
View File
@@ -1062,6 +1062,7 @@ UPDATE `creature_template` SET `ScriptName` = 'boss_flame_leviathan_turret' WHER
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;
UPDATE `creature_template` SET `ScriptName` = 'spell_pool_of_tar' WHERE `entry` = 33090;
UPDATE `creature_template` SET `ScriptName` = 'boss_ignis' WHERE `entry` = 33118;
UPDATE `creature_template` SET `ScriptName` = 'boss_razorscale' WHERE `entry` = 33186;
UPDATE `creature_template` SET `ScriptName` = 'boss_xt002' WHERE `entry` = 33293;
+19 -5
View File
@@ -1972,9 +1972,6 @@ INSERT INTO `spell_elixir` (`entry`, `mask`) VALUES
-- --------
-- Death Knight
-- --------
# endless hunger
UPDATE `creature_template` SET `KillCredit1` = '29519' WHERE `entry` IN ('29519','29520','29565','29566','29567');
DELETE FROM `spell_script_target` WHERE entry IN
(51859, 48743, 52124, 52479, 52576, 53110);
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
@@ -2113,7 +2110,13 @@ INSERT INTO creature_template (entry, vehicleid) VALUES
ON DUPLICATE KEY UPDATE
vehicleid = VALUES(vehicleid);
UPDATE creature_template SET flags_extra = 128 WHERE entry IN (33114);
UPDATE creature_template SET spell1=62288 WHERE entry = 33090;
UPDATE creature_template SET speed=1 WHERE entry=33113;
UPDATE creature_template SET speed=1.25 WHERE entry IN (33060,33109);
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);
INSERT INTO creature_template (entry, spell1, spell2, spell3, spell4, spell5, spell6, vehicleid) VALUES
(33062, 62974, 62286, 62299, 64660, 0, 0, 335), # Salvaged Chopper
@@ -2130,12 +2133,23 @@ spell5 = VALUES(spell5),
spell6 = VALUES(spell6),
vehicleid = VALUES(vehicleid);
DELETE FROM `spell_script_target` WHERE `entry` IN (62374,62399);
DELETE FROM `spell_script_target` WHERE `entry` IN (62427,62374,62399);
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
(62427, 1, 33109), # Load into Catapult
(62374, 1, 33060), # Pursued
(62374, 1, 33109),
(62399, 1, 33139); # Overload Circuit
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, 62472, 0, 'System Shutdown'), #inform, not correct spell
( 62427, 62340, 2, 'Load into Catapult - Passenger Loaded');
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
-- --------
-- WINTERGRASP
+26
View File
@@ -0,0 +1,26 @@
UPDATE creature_template SET scriptname = "spell_pool_of_tar" WHERE entry = 33090;
UPDATE creature_template SET spell1=62288 WHERE entry = 33090;
UPDATE creature_template SET speed=1 WHERE entry=33113;
UPDATE creature_template SET speed=1.25 WHERE entry IN (33060,33109);
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);
DELETE FROM `spell_script_target` WHERE `entry` IN (62427,62374,62399);
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
(62427, 1, 33109), # Load into Catapult
(62374, 1, 33060), # Pursued
(62374, 1, 33109),
(62399, 1, 33139); # Overload Circuit
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, 62472, 0, 'System Shutdown'), #inform, not correct spell
( 62427, 62340, 2, 'Load into Catapult - Passenger Loaded');
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
@@ -20,6 +20,7 @@
#include "def_ulduar.h"
#include "Vehicle.h"
#define SPELL_PURSUED 62374
#define SPELL_GATHERING_SPEED 62375
#define SPELL_BATTERING_RAM 62376
@@ -27,12 +28,15 @@
#define SPELL_MISSILE_BARRAGE 62400
#define SPELL_SYSTEMS_SHUTDOWN 62475
#define SPELL_CANNON 62397
#define SPELL_FLAME_CANNON 62395
//#define SPELL_FLAME_CANNON 64692 trigger the same spell
#define SPELL_OVERLOAD_CIRCUIT 62399
#define SPELL_SEARING_FLAME 62402
#define SPELL_BLAZE 62292
enum Events
{
EVENT_PURSUE = 1,
@@ -40,15 +44,21 @@ enum Events
EVENT_VENT,
};
enum Seats
{
SEAT_PLAYER = 0,
SEAT_TURRET = 1,
SEAT_DEVICE = 2,
};
struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
{
boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN)
{
assert(c->isVehicle());
me->SetReactState(REACT_DEFENSIVE);
}
void MoveInLineOfSight(Unit* who) {}
void EnterCombat(Unit *who)
{
_EnterCombat();
@@ -66,6 +76,12 @@ struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI
AttackStart(target);
}
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if(spell->Id == 62472)
CAST_VEH(me)->InstallAllAccessories();
}
void UpdateAI(const uint32 diff)
{
if (!me->isInCombat())
@@ -133,6 +149,12 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI
events.ScheduleEvent(1, 5000);
}
void AttackStart(Unit *who)
{
if(who)
me->Attack(who, false);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateCombatState())
@@ -148,8 +170,9 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI
switch(eventId)
{
case 1:
DoCast(SelectTarget(SELECT_TARGET_RANDOM), SPELL_CANNON);
events.RepeatEvent(10000);
DoCast(me->getVictim(), SPELL_FLAME_CANNON);
AttackStart(SelectTarget(SELECT_TARGET_RANDOM));
events.RepeatEvent(3000);
return;
default:
events.PopEvent();
@@ -160,44 +183,63 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI
};
struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI
struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public PassiveAI
{
boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c)
boss_flame_leviathan_seatAI(Creature *c) : PassiveAI(c)
{
assert(c->isVehicle());
if (const CreatureInfo *cInfo = me->GetCreatureInfo())
me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible
//me->SetReactState(REACT_AGGRESSIVE);
}
void Reset()
/*
void MoveInLineOfSight(Unit *who)
{
me->SetReactState(REACT_AGGRESSIVE);
if(who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->isGameMaster()
&& !who->m_Vehicle && CAST_VEH(me)->GetPassenger(SEAT_TURRET))
who->EnterVehicle((Vehicle*)me, 0);
}
*/
void PassengerBoarded(Unit *who, int8 seatId)
{
if(!me->m_Vehicle)
return;
if(seatId == SEAT_PLAYER)
{
if(Unit *turret = CAST_VEH(me)->GetPassenger(SEAT_TURRET))
{
turret->setFaction(me->m_Vehicle->getFaction());
turret->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
}
if(Unit *device = CAST_VEH(me)->GetPassenger(SEAT_DEVICE))
{
device->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
device->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
}
}
void MoveInLineOfSight(Unit *who) // for test
void PassengerLeft(Unit *who, int8 seatId)
{
if (who->GetTypeId() == TYPEID_PLAYER && !who->m_Vehicle
&& !CAST_VEH(me)->GetPassenger(0) && CAST_VEH(me)->GetPassenger(2))
who->EnterVehicle(CAST_VEH(me), 0);
}
void UpdateAI(const uint32 diff)
{
if (!CAST_VEH(me)->GetPassenger(2))
if (Unit *who = CAST_VEH(me)->GetPassenger(0))
who->ExitVehicle();
if(seatId == SEAT_TURRET)
{
if(Unit *device = CAST_VEH(me)->GetPassenger(SEAT_DEVICE))
{
device->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
device->SetUInt32Value(UNIT_FIELD_FLAGS, 0); // unselectable
}
}
}
};
struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI
{
boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c)
{
}
boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c), timer(2000) {}
void Reset()
{
}
uint32 timer;
void DamageTaken(Unit *who, uint32 &damage)
{
@@ -216,6 +258,12 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedA
AttackStart(who);
}
void AttackStart(Unit *who)
{
if(who)
me->Attack(who, false);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
@@ -224,30 +272,53 @@ struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedA
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
DoCast(me->getVictim(), SPELL_SEARING_FLAME);
if(timer > diff)
timer -= diff;
else
{
timer = 2000;
DoCast(me->getVictim(), SPELL_SEARING_FLAME);
}
}
};
struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public ScriptedAI
struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public PassiveAI
{
boss_flame_leviathan_overload_deviceAI(Creature *c) : ScriptedAI(c)
boss_flame_leviathan_overload_deviceAI(Creature *c) : PassiveAI(c)
{
if (const CreatureInfo *cInfo = me->GetCreatureInfo())
me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device
}
void Reset()
void DoAction(const int32 param)
{
if(param == EVENT_SPELLCLICK)
{
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if(me->m_Vehicle)
if(Unit *player = me->m_Vehicle->GetPassenger(SEAT_PLAYER))
player->ExitVehicle();
}
}
};
struct TRINITY_DLL_DECL spell_pool_of_tarAI : public TriggerAI
{
spell_pool_of_tarAI(Creature *c) : TriggerAI(c)
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
}
void DamageTaken(Unit *who, uint32 &damage)
{
if (damage >= me->GetHealth())
{
damage = 0;
if (!me->hasUnitState(UNIT_STAT_CASTING))
DoCastAOE(SPELL_OVERLOAD_CIRCUIT);
}
damage = 0;
}
void SpellHit(Unit* caster, const SpellEntry *spell)
{
if(spell->SchoolMask & SPELL_SCHOOL_MASK_FIRE && !me->HasAura(SPELL_BLAZE))
me->CastSpell(me, SPELL_BLAZE, true);
}
};
@@ -276,6 +347,11 @@ CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature* pCreature)
return new boss_flame_leviathan_overload_deviceAI (pCreature);
}
CreatureAI* GetAI_spell_pool_of_tar(Creature* pCreature)
{
return new spell_pool_of_tarAI (pCreature);
}
void AddSC_boss_flame_leviathan()
{
Script *newscript;
@@ -303,4 +379,9 @@ void AddSC_boss_flame_leviathan()
newscript->Name="boss_flame_leviathan_overload_device";
newscript->GetAI = &GetAI_boss_flame_leviathan_overload_device;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name="spell_pool_of_tar";
newscript->GetAI = &GetAI_spell_pool_of_tar;
newscript->RegisterSelf();
}
+6
View File
@@ -19075,6 +19075,9 @@ void Player::UpdateVisibilityOf(WorldObject* target)
{
if(target->isVisibleForInState(this,false))
{
//if(target->isType(TYPEMASK_UNIT) && ((Unit*)target)->m_Vehicle)
// UpdateVisibilityOf(((Unit*)target)->m_Vehicle);
target->SendUpdateToPlayer(this);
UpdateVisibilityOf_helper(m_clientGUIDs, target);
@@ -19123,6 +19126,9 @@ void Player::UpdateVisibilityOf(T* target, UpdateData& data, std::set<WorldObjec
{
if(target->isVisibleForInState(this,false))
{
//if(target->isType(TYPEMASK_UNIT) && ((Unit*)target)->m_Vehicle)
// UpdateVisibilityOf(((Unit*)target)->m_Vehicle, data, visibleNow);
visibleNow.insert(target);
target->BuildCreateUpdateBlockForPlayer(&data, this);
UpdateVisibilityOf_helper(m_clientGUIDs,target);
+5
View File
@@ -2497,6 +2497,11 @@ enum SummonType
SUMMON_TYPE_OBJECT = 11,
};
enum EventId
{
EVENT_SPELLCLICK = 1001,
};
enum ResponseCodes
{
RESPONSE_SUCCESS = 0x00,
+18
View File
@@ -4480,6 +4480,20 @@ void AuraEffect::HandleAuraPeriodicDummy(bool apply, bool Real, bool changeAmoun
SpellEntry const*spell = GetSpellProto();
switch( spell->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
if(spell->Id == 62399) // Overload Circuit
{
if(m_target->GetMap()->IsDungeon())
if(m_target->GetAuras().count(62399) >= (m_target->GetMap()->IsHeroic() ? 4 : 2))
{
m_target->CastSpell(m_target, 62475, true); // System Shutdown
if(m_target->m_Vehicle)
m_target->m_Vehicle->CastSpell(m_target, 62475, true);
}
}
break;
}
case SPELLFAMILY_WARLOCK:
{
switch (spell->Id)
@@ -6344,6 +6358,10 @@ void AuraEffect::PeriodicDummyTick()
case 59911: // Tenacity (vehicle)
GetParentAura()->RefreshAura();
break;
case 62292: // Blaze (Pool of Tar)
// should we use custom damage?
m_target->CastSpell((Unit*)NULL, m_spellProto->EffectTriggerSpell[m_effIndex], true);
break;
default:
break;
}
+41 -3
View File
@@ -1216,6 +1216,42 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster,spell_id,true,NULL);
return;
}
case 62324: // Throw Passenger
if(m_targets.HasTraj())
{
if(Vehicle *vehicle = dynamic_cast<Vehicle*>(m_caster))
if(Unit *passenger = vehicle->GetPassenger(damage - 1))
{
std::list<Unit*> unitList;
// use 99 because it is 3d search
SearchAreaTarget(unitList, 99, PUSH_DST_CENTER, SPELL_TARGETS_ENTRY, 33114);
float minDist = 99 * 99;
Vehicle *target = NULL;
for(std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
{
if(Vehicle *seat = dynamic_cast<Vehicle*>(*itr))
if(!seat->GetPassenger(0))
if(Unit *device = seat->GetPassenger(2))
if(!device->GetCurrentSpell(CURRENT_CHANNELED_SPELL))
{
float dist = seat->GetExactDistSq(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ);
if(dist < minDist)
{
minDist = dist;
target = seat;
}
}
}
if(target && target->IsWithinDist2d(m_targets.m_destX, m_targets.m_destY, GetSpellRadius(m_spellInfo, i, false) * 2)) // now we use *2 because the location of the seat is not correct
passenger->EnterVehicle(target, 0);
else
{
passenger->ExitVehicle();
passenger->GetMotionMaster()->MoveJump(m_targets.m_destX, m_targets.m_destY, m_targets.m_destZ, m_targets.GetSpeedXY(), m_targets.GetSpeedZ());
}
}
}
return;
}
//All IconID Check in there
@@ -5195,9 +5231,10 @@ void Spell::EffectScriptEffect(uint32 effIndex)
return;
}
case 62428: // Load into Catapult
if(m_caster->m_Vehicle && m_caster->GetTypeId() == TYPEID_UNIT && ((Creature*)m_caster)->isVehicle())
if(Unit *passenger = ((Vehicle*)m_caster)->GetPassenger(0))
passenger->CastSpell(m_caster->m_Vehicle, damage, true);
if(Vehicle *demolisher = m_caster->m_Vehicle)
if(Vehicle *seat = dynamic_cast<Vehicle*>(m_caster))
if(Unit *passenger = seat->GetPassenger(0))
passenger->CastSpell(demolisher, damage, true);
return;
case 60123: // Lightwell
{
@@ -5227,6 +5264,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
else
((TempSummon*)m_caster)->UnSummon();
return;
}
}
break;
+3
View File
@@ -31,6 +31,7 @@
#include "Totem.h"
#include "TemporarySummon.h"
#include "SpellAuras.h"
#include "CreatureAI.h"
void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket)
{
@@ -516,6 +517,8 @@ void WorldSession::HandleSpellClick( WorldPacket & recv_data )
if(unit->isVehicle())
_player->EnterVehicle((Vehicle*)unit);
unit->AI()->DoAction(EVENT_SPELLCLICK);
}
void WorldSession::HandleMirrrorImageDataRequest( WorldPacket & recv_data )
+4
View File
@@ -3729,6 +3729,10 @@ void SpellMgr::LoadSpellCustomAttr()
case 30421: // Nether Portal - Perseverence
spellInfo->EffectBasePoints[2] += 30000;
break;
// some dummy spell only has dest, should push caster in this case
case 62324: // Throw Passenger
spellInfo->Targets |= TARGET_FLAG_CASTER;
break;
default:
break;
}
+3 -2
View File
@@ -10524,8 +10524,9 @@ bool Unit::canAttack(Unit const* target, bool force) const
if(target->GetVisibility() == VISIBILITY_GROUP_STEALTH && !canDetectStealthOf(target, GetDistance(target)))
return false;
if(target == m_Vehicle)
return false;
if(m_Vehicle)
if(target == m_Vehicle || m_Vehicle->m_Vehicle && target == m_Vehicle->m_Vehicle)
return false;
return true;
}
+4 -8
View File
@@ -90,11 +90,8 @@ void Vehicle::InstallAllAccessories()
InstallAccessory(33139,7);
break;
case 33114:
InstallAccessory(33142,0);
//InstallAccessory(33143,1);
//InstallAccessory(33142,2);
InstallAccessory(33143,2);
InstallAccessory(33142,1);
InstallAccessory(33143,2); // Overload Control Device
InstallAccessory(33142,1); // Leviathan Defense Turret
break;
}
}
@@ -122,7 +119,8 @@ void Vehicle::setDeathState(DeathState s) // overwrite vir
if(passenger->GetOwnerGUID() == GetGUID())
{
passenger->ExitVehicle();
((Vehicle*)passenger)->setDeathState(s);
passenger->setDeathState(s);
passenger->AddObjectToRemoveList();
}
}
RemoveAllPassengers();
@@ -266,7 +264,6 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId)
const CreatureInfo *cInfo = objmgr.GetCreatureTemplate(entry);
if(!cInfo)
return;
Creature *accessory;
if(cInfo->VehicleId)
accessory = SummonVehicle(entry, GetPositionX(), GetPositionY(), GetPositionZ());
@@ -274,7 +271,6 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId)
accessory = SummonCreature(entry, GetPositionX(), GetPositionY(), GetPositionZ());
if(!accessory)
return;
accessory->EnterVehicle(this, seatId);
// This is not good, we have to send update twice
accessory->SendMovementFlagUpdate();