Short guide to to creature mechanic immunties

Post Reply
User avatar
Gnurg
Posts: 2420
Joined: 28 Jan 2013 19:38
Location: Oslo, Norway

Short guide to to creature mechanic immunties

#1 » Post by Gnurg » 20 Feb 2017 19:47

This will without a doubt be the shortest and simplest guide, but it's one of the biggest problems we have on the server, so if more people knew how to resolve them we could speed up the process by a lot.

Want something applied? viewtopic.php?f=66&t=37106

https://trinitycore.atlassian.net/wiki/ ... mmune_mask

[hide="The Flags"]Image[/hide]

The Idea
You'll only work with one attribute, the mechanic_immune_mask, which is found in the table creature_template. Each flag (1, 2, 4, 8, 16 ...) represents a type of mechanic (see picture or link). If the flag is set, the creature will be immune to that mechanic.

You have two 'operations':
  • Add: `mechanic_immune_mask` | flag_you_want_to_add
  • Remove: `mechanic_immune_mask` & ~flag_you_want_to_remove
Should you want to add or remove several flags at once, you can do that by just add another | or & ~ flag_you_want_to_add/remove.

Inside the parentheses after IN, you write the entry/id of the creatures you want to update.

Templates

Code: Select all

-- Adding root and stun immunity to Hogger (448) & Buru the Gorger (15370)
UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` | 64 | 2048 WHERE `entry` IN
(448, 15370);

Code: Select all

-- Removing root and stun immunity to Hogger (448) & Buru the Gorger (15370)
UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask` & ~64 & ~2048 WHERE `entry` IN
(448, 15370);
To Consideration

When working with dungeons and raids, there might be another creature_template for each version (10/25) and difficulty (normal/heroic). Take for instance Sartharion. You see that his id is 28860, but if you click on 25 man his id 31311. You should update both, unless the creature should only be immune on one of the version/difficulties.

Be precise and make sure you have the right IDs. You don't want to do changes in other creature or update the wrong immunity. With one error, someone has to do the correction and that will likely be me as I'll be committing your fixes.

I won't be very happy if you don't comment what you do. For small updates, where you update just one creature, you can stick to the template. Should you, however, end up with a larger update, I would prefer to know what each creature was and what immunities you added. The code below should give you an idea on how it should. *Keep in mind that this update is stupid; undeads are by default immune to fear, so it isn't necessary to add that to mechaic_immune_mask.

Code: Select all

-- Add fear immunity
UPDATE `creature_template` SET `mechanic_immune_mask` = `mechanic_immune_mask`| 16 WHERE `entry` IN 
(16236, 29613, -- Eye Stalk
16290, 29388, -- Fallout Slime
16243, 29575, -- Plague Slime
16375, 29354, -- Sewage Slime
16018, 29353, -- Bile Retcher
16167, 29835, -- Bony Construct
16573, 29256, -- Crypt Guard
15978, 30389, -- Crypt Reaver
16146, 29823, -- Death Knight
16145, 29824, -- Death Knight Captain
16067, 29852, -- Deathcharger Steed
29818, 29853, -- Deathcharger Steed
16441, 30057, -- Guardian of Icecrown
16244, 29574, -- Infectious Ghoul
16021, 29359, -- Living Monstrosity
16020, 29362, -- Mad Scientist
30083, 30424, -- Marauding Geist
16165, 29828, -- Necro Knight
16034, 29609, -- Plagued Beast
16984, 29632, -- Plagued Warrior
16983, 29633, -- Plagued Champion
16981, 29634, -- Plagued Guardian
16447, 30097, -- Plagued Ghoul
16061, 29831, -- Risen Squire
16164, 29825, -- Shade of Naxxramas
16154, 29837, -- Skeletal Smith
16427, 30015, -- Soldier of the Frozen Wastes
23561, 30016, -- Soldier of the Frozen Wastes
16429, 30018, -- Soul Weaver
23563, 30047, -- Soul Weaver
16148, 29990, -- Spectral Death Knight
16150, 29988, -- Spectral Rider
16149, 29989, -- Spectral Horse
16127, 30264, -- Spectral Trainee
30071, 30075, -- Stitched Colossus
16025, 29371, -- Stitched Giant
16022, 29363, -- Surgical Assisstant
15979, 29286, -- Tomb Horror
16194, 29898, -- Unholy Axe 
16215, 29899, -- Unholy Staff
16216, 29900, -- Unholy Swords
16124, 29987, -- Unrelenting Trainee 
16125, 29985, -- Unrelenting Death Knight
16126, 29986, -- Unrelenting Rider
16428, 30048, -- Unstoppable Abomnination
23562, 30049, -- Unstoppable Abomination
30085, 30087, -- Vigilant Shade
16360, 30303); -- Zombie Chow
If you have any questions, feel free to ask.
HAI
CAN HAZ STDIO?
VISIBLE "HAI WORLD, IZ GNURF!"
KTHXBYE

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests