[WIP] Eredar Deathbringer

UPDATE: Updated my query according to Warpten and Biohazards’ suggestions.

Issue: https://github.com/TrinityCore/TrinityCore/issues/9573

I have made a fix for the issue I linked above, but I’m having couple of problems.

[ul][li]Problem #1: I’ve put ‘difficulty_entry_1’ for Eredar HC version and everything is ok. HC version spawns in HC dungeon, Normal spawns in Normal version of the dungeon. The thing is, HC Eredar is using same spells as Normal Eredar. And that is not the case on retail where HC Eredar is using empowered versions of the same spells.[/li][/ul]

[ul][li]Problem #2: If I actually put ‘SmartAI’ for ‘difficulty_entry_1’ for Eredar HC to get him to use empowered spells. I get error in log saying[/li][/ul]

  "Creature (Entry: 20880) lists difficulty 1 mode entry 21594 with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead." --  so it's ignoring the 'SmartAI' I made for HC Eredar.

[ul][li]Problem #3: In the above mentioned issue it was stated that “in the room where EDs should spawn, the number is random 1 or 2” , basically I don’t understand how the pool_creature system works[/li][/ul]
Here is the code and I hope someone will be able to help me understand these problems.

– Eredar Deathbringer

SET @EREDAR := 20880;
SET @EREDARHC := 21594;
SET @GUID := 79442; – note I used TC unused Guid Search

– Eredar creature_template NORMAL
UPDATE creature_template SET spell1 = 0, spell2 = 0 WHERE entry = @EREDAR;

– Creature equip template for Eredar
DELETE FROM creature_equip_template WHERE entry=@EREDAR;
INSERT INTO creature_equip_template (entry, id, itemEntry1, itemEntry2, itemEntry3) VALUES (@EREDAR, 1, 18822, 0, 0);

– Creature location for Eredar NORMAL
DELETE FROM creature WHERE guid IN (@GUID, @GUID+1);
INSERT INTO creature (guid, id, map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES
(@GUID, @EREDAR, 552, 3, 1, 19949, 0, 301.971, 124.751, 22.22676, 4.685557, 7200, 0, 0, 39123, 12620, 0, 0, 0, 8);

– SAI for Eredar NORMAL
DELETE FROM smart_scripts WHERE (entryorguid=@EREDAR AND source_type=0);
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES
(@EREDAR, 0, 0, 0, 11, 0, 100, 1, 0, 0, 0, 0, 11, 27987, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, “Eredar Deathbringer - On Respawn - Cast Unholy Aura”),
(@EREDAR, 0, 1, 0, 2, 0, 100, 0, 0, 50, 11000, 15000, 11, 36787, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, “Eredar Deathbringer - At 50% HP - Cast Forceful Cleave”);

– Creature Loot for Eredar Deathbringer NORMAL
DELETE FROM creature_loot_template WHERE entry=@EREDAR;
INSERT INTO creature_loot_template VALUES
(@EREDAR, 30809, 45, 1, 0, 1, 1),
(@EREDAR, 22556, 29, 1, 0, 2, 3),
(@EREDAR, 21877, 28, 1, 0, 1, 1),
(@EREDAR, 32902, 7, 1, 0, 1, 2),
(@EREDAR, 27854, 5, 1, 0, 1, 1),
(@EREDAR, 29740, 4, 1, 0, 1, 1),
(@EREDAR, 32905, 3, 1, 0, 1, 2),
(@EREDAR, 27860, 1.8, 1, 0, 1, 1),
(@EREDAR, 25404, 0.9, 1, 0, 1, 1);

– Eredar Deathbringer HEROIC
UPDATE creature_template SET spell1 = 0, spell2 = 0 WHERE entry = @EREDARHC;

– Pool_template for Eredar Spawns
DELETE FROM pool_template WHERE entry = 1160;
INSERT INTO pool_template (entry, max_limit, description) VALUES
(1160, 1, ‘Eredar Deathbringer’);

– Pool_creature for Eredar Spawns
DELETE FROM pool_creature WHERE guid = @GUID;
INSERT INTO pool_creature (guid, pool_entry, chance, description) VALUES
(@GUID, 1160, 0, ‘Eredar Deathbringer - Spawn 1’);

As you can see I’ve made a pool_template and pool_creature but I don’t understand how the ‘chance’ system works. I was looking at other creatures that use pool_creature. Like ‘King Ping’ that has 5 spawn locations and 0 chance. And in pool_template he has max_limit 1 which is ok because he’s a rare spawn. But Eredar should be random. Either 1 or 2. So I need help with this too.

Thanks.

¿Why you delete the creature template for that mob?

Because it had spell1, spell2, and HC eredar had spell1,spell2 and name set wrong. Oh and I did not change anything, except removing the spell1,spell2 and name for HC eredar. All the numbers are exactly the same.

Also, I’m working to fix the Eredar Soul Eaters right now.

use UPDATE statements if you change only a few fields

Also, name is WDB field, don’t change it.

Don’t change the name for the heroic NPC; the client receives the NM name.

I did not know that.

Ok.

Partial-Update for Eredar Soul-Eater. Anyone is welcome to tweak it.

[CODE]
– Eredar Soul eater

SET @SOULEATER := 20879;
SET @SOULEATERHC := 21595;
SET @GUID := 79446; – TC Unused GUID search tool

– Eredar Soul Eater creature_template NORMAL
UPDATE creature_template SET spell1 = 0, spell2 = 0, spell3 = 0, AIName = ‘SmartAI’ WHERE entry = @SOULEATER;

– Eredar Soul Eater SAI // not sure how to implement behaviour for spell:36778(SOUL STEAL)
DELETE FROM smart_scripts WHERE (entryorguid=@SOULEATER AND source_type=0);
INSERT INTO smart_scripts (entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_x, target_y, target_z, target_o, comment) VALUES
(@SOULEATER, 0, 0, 0, 1, 0, 100, 0, 0, 0, 0, 0, 11, 36784, 0, 0, 0, 0, 0, 17, 0, 100, 0, 0, 0, 0, 0, “Eredar Soul Eater - At Range - Cast Entropic Aura”),
(@SOULEATER, 0, 1, 0, 0, 0, 100, 0, 6000, 12000, 30000, 30000, 11, 36786, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, “Eredar Soul Eater - In Combat - Cast Soul Chill”);

– Creature equip template for Eredar Soul Eater
DELETE FROM creature_equip_template WHERE entry=@SOULEATER;
INSERT INTO creature_equip_template (entry, id, itemEntry1, itemEntry2, itemEntry3) VALUES (@SOULEATER, 1, 31308, 0, 0);

– Creature location for Eredar Soul Eater
DELETE FROM linked_respawn WHERE guid = 86053;
DELETE FROM creature WHERE guid IN (@GUID, @GUID+1) OR id = @SOULEATER;
INSERT INTO creature (guid, id, map, spawnMask, phaseMask, modelid, equipment_id, position_x, position_y, position_z, orientation, spawntimesecs, spawndist, currentwaypoint, curhealth, curmana, MovementType, npcflag, unit_flags, dynamicflags) VALUES
(@GUID, @SOULEATER, 552, 3, 1, 19950, 0, 280.787, 145.315, 22.22593, 0.005122, 7200, 0, 0, 39123, 12620, 0, 0, 0, 8),
(@GUID+1, @SOULEATER, 552, 3, 1, 19950, 0, 307.477, 150.934, 24.85841, 3.959065, 7200, 0, 0, 39123, 12620, 0, 0, 0, 8);

– Creature template update for Eredar Soul Eater HC
UPDATE creature_template SET spell1 = 0, spell2 = 0, spell3 = 0 WHERE entry = @SOULEATERHC;

– Creature Loot for Eredar Soul Eater
DELETE FROM creature_loot_template WHERE entry=@SOULEATER;
INSERT INTO creature_loot_template VALUES
(@SOULEATER, 30809, 70, 1, 0, 1, 1),
(@SOULEATER, 21877, 39, 1, 0, 2, 3),
(@SOULEATER, 32902, 11, 1, 0, 1, 2),
(@SOULEATER, 27854, 7, 1, 0, 1, 1),
(@SOULEATER, 29740, 5, 1, 0, 1, 1),
(@SOULEATER, 27860, 1.8, 1, 0, 1, 1);

– Creature Pickpocketing Loot for Eredar Soul Eater
DELETE FROM pickpocketing_loot_template WHERE (entry=@SOULEATER);
INSERT INTO pickpocketing_loot_template VALUES
(@SOULEATER, 29570, 67, 1, 0, 1, 1),
(@SOULEATER, 29569, 42, 1, 0, 1, 1),
(@SOULEATER, 27855, 25, 1, 0, 1, 1),
(@SOULEATER, 22829, 17, 1, 0, 1, 1),
(@SOULEATER, 27854, 8, 1, 0, 1, 1);

– Pool_template for Eredar Soul Eater Spawns
DELETE FROM pool_template WHERE entry = 1161;
INSERT INTO pool_template (entry, max_limit, description) VALUES
(1161, 2, ‘Eredar Soul-Eater’);

– Pool_creature for Eredar Soul Eater Spawns
DELETE FROM pool_creature WHERE guid IN (@GUID, @GUID+1);
INSERT INTO pool_creature (guid, pool_entry, chance, description) VALUES
(@GUID, 1161, 0, ‘Eredar Soul-Eater - Spawn 1’),
(@GUID+1, 1161, 0, ‘Eredar Soul-Eater - Spawn 2’);[/CODE]