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.