Core/Creature: implement INHABIT_ROOT to apply UNIT_STATE_ROOT to creature (#17543)

Add flag 8 to InhabitType for creatures that should appear rooted client-side
This commit is contained in:
SnapperRy
2016-07-15 16:48:04 +02:00
committed by GitHub
parent 1a2bd0dc3a
commit f78ab9aba4
3 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
--
UPDATE `creature_template` SET `InhabitType`=`InhabitType`|8 WHERE `entry` IN (1921, 2674, 5674, 8035, 16236, 16400, 16897, 20251, 20561, 21322, 21413, 14697, 18679, 18695, 23076, 23077, 23876, 23996, 24210, 25284, 25534, 27064, 27430, 27894, 28156, 28366, 29475, 29483, 29613, 29747, 29790, 30236, 30475, 31103, 31280, 31424, 32347, 32795, 32938, 33174, 33184, 33229, 33243, 33272, 33342, 33352, 33353, 33651, 34047, 34050, 34068, 34071, 34096, 34108, 34110, 34121, 34149, 34362, 34363);

View File

@@ -481,6 +481,9 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/)
ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
}
if (cInfo->InhabitType & INHABIT_ROOT)
SetControlled(true, UNIT_STATE_ROOT);
UpdateMovementFlags();
LoadCreaturesAddon();
return true;

View File

@@ -294,7 +294,8 @@ enum InhabitTypeValues
INHABIT_GROUND = 1,
INHABIT_WATER = 2,
INHABIT_AIR = 4,
INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR
INHABIT_ROOT = 8,
INHABIT_ANYWHERE = INHABIT_GROUND | INHABIT_WATER | INHABIT_AIR | INHABIT_ROOT
};
// Enums used by StringTextData::Type (CreatureEventAI)