Create ScriptedAIs that require a InstanceScript reference only if the InstanceScript exists, so if these Creatures are in an instance. ScriptedAIs that don't require a InstanceScript reference have not been modified.
This fixes many possible NULL dereference crashes happening when spawning a scripted Creature outside of an instance.
Fixed a GetOwner() and a ToPlayer() NULL dereference crashes too.
* Moved everything into one specialized method instead of being scattered all over the place
* Allow localizing creature names in chat messages (when using $N)
* Send SMSG_GM_MESSAGECHAT for gm messages
Moved bosses Glutton, Mordresh Fire Eye, Tuten Kash to cpp.
Cleaned up code for boss Amnennar The Coldbringer.
Fixed up gong event for gong to have sound and proper spawning.
Scripted quest 3525 "Extinguishing the Idol" so you can now fight Plagmaw the Rotting.
Fix some static analysis issues, mostly false positive about fields not initialized in the constructor. It's good practice anyway to always initialize them.
Valgrind log:
Conditional jump or move depends on uninitialised value(s)
at 0x1798C2C: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:192)
by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)
Conditional jump or move depends on uninitialised value(s)
at 0x1798C7E: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:200)
by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)
Conditional jump or move depends on uninitialised value(s)
at 0x1798CB0: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:205)
by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)
Conditional jump or move depends on uninitialised value(s)
at 0x1798CE2: npc_medivh_bm::npc_medivh_bmAI::UpdateAI(unsigned int) (the_black_morass.cpp:210)
by 0x11AEFC0: Creature::Update(unsigned int) (Creature.cpp:542)
by 0x12E96F8: Trinity::ObjectUpdater::Visit(GridRefManager<Creature>&) (GridNotifiersImpl.h:45)
- Remove EAI's ACTION_T_CAST_EVENT and ACTION_T_CAST_EVENT_ALL
- Remove SAI's SMART_ACTION_CALL_CASTEDCREATUREORGO
- Split QUEST_TRINITY_FLAGS_KILL_OR_CAST into QUEST_TRINITY_FLAGS_KILL and QUEST_TRINITY_FLAGS_CAST
- Assign QUEST_TRINITY_FLAGS_CAST to all the quests that were using RequiredSpellCastX
- (unrelated) Fix a warning in Player.cpp
- Replace CastedCreatureOrGO usage in scripts by KilledMonsterCredit
TODO: Convert the two EAI scripts commented out in the .sql to proper SAI
Closes#10667