TrinityCore / TrinityCore/TrinityCore
Core/Creature: Spawn and aggro sequence
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 10.8k
- Forks
- 6.4k
- Avg merge
- 3d 16m
- Merged PRs (30d)
- 6
Description
Description:
We have 2 npcs "A" and "B", they are aggressive to each other, if I start the server they will engage combat.
NPC "A" get a script that will be executed on spawn (SMART_EVENT_RESPAWN) it will add the unit_flag immune to npc and cast a cosmetic spell.
Current behavior:
The actual sequence:
- Engage combat
- Evade and spawn event happen at the same time
- The flag is set but the spell will not hit as the npc is in an evade state
Expected behavior:
Expected sequence:
- Spawn event executed
- First tick to engage combat happen after the spawn tick
Notice that this happen only when the server starts, not when the npc respawn.
Steps to reproduce the problem:
We have an example
entryorguid, source_type, id, link, event_type, event_phase_mask, event_chance, event_flags, event_param1, event_param2, event_param3, event_param4, event_param5, action_type, action_param1, action_param2, action_param3, action_param4, action_param5, action_param6, target_type, target_param1, target_param2, target_param3, target_param4, target_x, target_y, target_z, target_o, comment
28667, 0, 0, 1, 11, 0, 100, 512, 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, Jaloot - On Respawn - Set Npc Flag
28667, 0, 1, 2, 61, 0, 100, 512, 0, 0, 0, 0, 0, 18, 512, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, Jaloot - On Respawn - Set Flag Immune To NPC's
28667, 0, 2, 0, 61, 0, 100, 512, 0, 0, 0, 0, 0, 11, 52182, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, Jaloot - On Respawn - Cast 'Tomb of the Heartless'
- .go c id 28667
- The little npcs in from of "Artruis the Heartless" use a spawn event to set the npc and cast "Tomb of the Heartless" on self (ice block)
- check you combat log:
Zepik le chasseur de gorloc DAMAGE_SHIELD_MISSED_EVADE Ferveur de Zepik Zepik le chasseur de gorloc.
Zepik le chasseur de gorloc DAMAGE_SHIELD_MISSED_EVADE Tombeau du Sans-coeur Zepik le chasseur de gorloc.
Zepik le chasseur de gorloc lance Tombeau du Sans-coeur.
Jaloot DAMAGE_SHIELD_MISSED_EVADE Tombeau du Sans-coeur Jaloot.
Jaloot lance Tombeau du Sans-coeur.
Tombeau du Sans-coeur |2 Jaloot s'efface |2 Jaloot.
Jaloot gagne Tombeau du Sans-coeur |2 Jaloot.
Tombeau du Sans-coeur |2 Zepik le chasseur de gorloc s'efface |2 Zepik le chasseur de gorloc.
Zepik le chasseur de gorloc gagne Tombeau du Sans-coeur |2 Zepik le chasseur de gorloc.
Zepik le chasseur de gorloc lance Tombeau du Sans-coeur.
Jaloot lance Tombeau du Sans-coeur.
This DAMAGE_SHIELD_MISSED_EVADE happen when a npc get hit by a spell on evade state.
Branch(es): 3.3.5
TC rev. hash/commit: rev. 67d9d04d63cc
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the startup case with creature entry 28667 and the provided SmartAI SQL, then inspect the creature spawn, evade, and aggro handling in the 3.3.5 server core. Compare startup behavior with a normal respawn and verify that the spawn event completes before the first combat tick, including the cosmetic spell cast.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, sql
- Domain
- backend, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100