Core/Vehicles: Move most of hardcoded vehicle immunities to DB

This commit is contained in:
tobmaps
2011-07-15 21:37:09 +07:00
parent 0b40d39dcf
commit 99530dcde2
2 changed files with 56 additions and 12 deletions

View File

@@ -0,0 +1,54 @@
-- TODO: this list of vehicles isn't complete, need to find more vehicles with missing immunities
UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` |
0x00000002| -- MECHANIC_DISORIENTED (Blind)
0x00000004| -- MECHANIC_DISARM (Disarm)
0x00000008| -- MECHANIC_DISTRACT (Distract)
0x00000010| -- MECHANIC_FEAR (Fear, Psychic Scream)
0x00000020| -- MECHANIC_GRIP (Death Grip)
0x00000040| -- MECHANIC_ROOT (Entangling Roots)
0x00000100| -- MECHANIC_SILENCE (Silence)
0x00000200| -- MECHANIC_SLEEP (Wyvern Sting)
0x00000400| -- MECHANIC_SNARE (Crippling Poison, Piercing Howl)
0x00000800| -- MECHANIC_STUN (Hammer of Justice)
0x00001000| -- MECHANIC_FREEZE (Freezing Trap)
0x00002000| -- MECHANIC_KNOUCKOUT (Gouge, Blast Wave)
-- 0x00004000| -- MECHANIC_BLEED (Rend, Deep Wounds) - requires confirmation
0x00010000| -- MECHANIC_POLYMORPH (Polymorph)
0x00040000| -- MECHANIC_SHIELD (Power word: Shield)
-- 0x00200000| -- MECHANIC_INFECTED (Frost Fever, Blood Plague) - requires confirmation
0x00800000| -- MECHANIC_HORROR (warlock's Death Coil)
0x10000000| -- MECHANIC_IMMUNE_SHIELD (Hand of Protection)
0x02000000| -- MECHANIC_INTERRUPT (Kick, Counterspell)
0x04000000 -- MECHANIC_DAZE (Dazed)
where entry IN (
-- Some random quest vehicles
25334, -- Horde Siege Tank
26523, -- Forsaken Blight Spreader
-- Strand of the Ancients vehicles
28781, -- Battleground Demolisher
27894, -- Antipersonnel Cannon
-- Wintergrasp vehicles
27881, -- Wintergrasp Catapult (both)
28094, -- Wintergrasp Demolisher (both)
28312, -- Wintergrasp Siege Engine (alliance)
28319, -- Wintergrasp Siege Turret (alliance)
28366, -- Wintergrasp Tower Cannon (both)
32627, -- Wintergrasp Siege Engine (horde)
32629, -- Wintergrasp Siege Turret (alliance)
-- Ulduar Vehicles
33060, -- Salvaged Siege Engine
33062, -- Salvaged Chopper
33067, -- Salvaged Siege Turret
33109, -- Salvaged Demolisher
-- Isle of Conquest vehicles
34793, -- Catapult (both)
34775, -- Demolisher (both)
34776, -- Siege Engine (alliance)
34777, -- Siege Turret (alliance)
34778, -- Flame Turret (alliance)
34802, -- Glaive Thrower (alliance)
34944, -- Keep Cannon (both)
35069, -- Siege Engine (horde)
35273, -- Glaive Thrower (horde)
36355, -- Siege Turret (horde)
36356); -- Flame Turret (horde)

View File

@@ -137,21 +137,11 @@ void Vehicle::Reset(bool evading /*= false*/)
void Vehicle::ApplyAllImmunities()
{
// This couldn't be done in DB, because Vehicle's immunities are overriden by Player's ones
// This couldn't be done in DB, because some spells have MECHANIC_NONE
// Vehicles should be immune on Knockback, Deathgrip ...
// Vehicles should be immune on Knockback ...
_me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
_me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, true);
_me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
// ... Fear, Snare, Root, Stun ...
_me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_FEAR, true);
_me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SNARE, true);
_me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_ROOT, true);
_me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true);
_me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_STUN, true);
_me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, true);
_me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true);
// Mechanical units & vehicles ( which are not Bosses, they have own immunities in DB ) should be also immune on healing ( exceptions in switch below )
if (_me->ToCreature() && _me->ToCreature()->GetCreatureInfo()->type == CREATURE_TYPE_MECHANICAL && !_me->ToCreature()->isWorldBoss())