Skip to content

Comments

Improvements#31

Open
Stoabrogga wants to merge 14 commits intoazerothcore:masterfrom
Stoabrogga:improvements
Open

Improvements#31
Stoabrogga wants to merge 14 commits intoazerothcore:masterfrom
Stoabrogga:improvements

Conversation

@Stoabrogga
Copy link
Contributor

@Stoabrogga Stoabrogga commented Feb 13, 2026

Changes Proposed:

A few improvements to the module:

  • Add a new config option MorphSummon.Enabled (Closes Option to disable the module #9)
  • Add a new gossip option to change the name of demons and ghouls; can be enabled using the config option MorphSummon.NewNameEnabled (I think this is the only part of my fork worth taking over, the other stuff is not needed)
  • In morphsummon_ddl.sql: Use int instead of int(10)
  • In morphsummon.sql:
    • The UPDATE statement is not needed, the correct npcflag is now in the INSERT statement above.
    • Set VerifiedBuild in creature_template_model to 0 as this is a custom creature which cannot be sniffed.
  • The default of config option MorphSummon.Announce in the code is set to false to reflect the default in the config file.
  • Use the correct spell ID for SUMMON_WATER_ELEMENTAL.
  • Use UNITHOOK_ON_AURA_REMOVE to ensure that the water elemental always has the correct scale.
  • A few bug fixes concerning the gossip options.

Issues Addressed:

SOURCE:

none

Tests Performed:

Tested applying the SQL scripts, compilation and in-game.

How to Test the Changes:

Add creature with ID 601072 to the world and check the gossip options with different player classes. Warlocks and Death Knights have an additional option to generate a new name for their pet if config option MorphSummon.NewNameEnabled is set to 1.

@Stoabrogga Stoabrogga mentioned this pull request Feb 13, 2026
@Stoabrogga
Copy link
Contributor Author

I pushed another commit which ensures that the display IDs (and the Felguard's weapon) are reset to their default values if the module is disabled.

@sudlud
Copy link
Member

sudlud commented Feb 16, 2026

Thanks for the pr! Just wondering, do you plan to propose the dbc changes that you mentioned

@Stoabrogga
Copy link
Contributor Author

Thanks for the pr! Just wondering, do you plan to propose the dbc changes that you mentioned

I did not test this, but I think you have to copy the entries 4907, 17045 and 27029 to new IDs, set scale to 0.85 and use those IDs in the config file for the water elementals (525 is the default, no need to copy this). But I still don't understand why all the other models are scaled automatically, despite having different scaling factors in CreatureDisplayInfo. Only the water elementals do not work.

@Stoabrogga
Copy link
Contributor Author

Ok, I tested this by adding these lines to CreatureDisplayInfo.dbc:

"ID","ModelID","SoundID","ExtendedDisplayInfoID","CreatureModelScale","CreatureModelAlpha","TextureVariation_1","TextureVariation_2","TextureVariation_3","PortraitTextureName","BloodLevel","BloodID","NPCSoundID","ParticleColorID","CreatureGeosetData","ObjectEffectPackageID"
"601072","110","0","0","0,85","255","WaterElementalGreenSkin","","","","1","0","0","295","0","0"
"601073","110","2187","0","0,85","255","WaterElementalRedSkin","","","","-1","0","0","329","0","0"
"601074","2948","110","0","0,85","255","WaterElementalPurpleSkin","","","","1","0","0","292","0","0"

In morphsummon.conf I updated the IDs for the water elemental accordingly:

MorphSummon.Mage.WaterElemental = "Water Elemental,525,Water Elemental Green,601072,Water Elemental Red,601073,Water Elemental Purple,601074"

The water elementals now have the same size.

@sudlud
Copy link
Member

sudlud commented Feb 17, 2026

Thanks for checking, I'm just wondering because to my understanding this pr now makes the scaling of the water elementals worse than before without providing the dbc fix / patch it what would be required?
But maybe I'm not getting the full context, haven't work work the module before :p

@Stoabrogga
Copy link
Contributor Author

I saw that spells can reset the scaling here:

if (petOrMinion->GetUInt32Value(UNIT_CREATED_BY_SPELL) == SUMMON_WATER_ELEMENTAL)
{
// The size of the water elemental model is not automatically scaled, so needs to be done here
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(petOrMinion->GetNativeDisplayId());
petOrMinion->SetObjectScale(0.85f / displayInfo->scale);
}
if (Aura *aura = petOrMinion->AddAura(SUBMERGE, pet))
aura->SetDuration(2000);

After changing the display ID an aura is applied to hide the pet for 2 seconds, this is just meant to look better than just switching models. But the aura "Submerge" (ID 53421) resets scaling, so you end up with bigger water elementals.

Should I remove the "Submerge" aura and add the scaling for water elementals again?

@Stoabrogga
Copy link
Contributor Author

I think I've found a solution: Using UNITHOOK_ON_AURA_REMOVE the correct scale for the water elemental is set if an aura is removed. This will ensure that the water elemental always has the correct scale. I also restored the scale correction to PLAYERHOOK_ON_AFTER_GUARDIAN_INIT_STATS_FOR_LEVEL.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adds several improvements to the MorphSummon module for AzerothCore:

Changes:

  • Adds a new config option MorphSummon.Enabled to enable/disable the module (addresses issue #9)
  • Adds a new gossip option to generate new pet names for demons and ghouls, controlled by MorphSummon.NewNameEnabled
  • Fixes SQL schema to use int instead of deprecated int(10) syntax
  • Corrects the default value of MorphSummon.Announce config to match the config file
  • Fixes water elemental spell ID and adds improved scaling logic via OnAuraRemove hook
  • Refactors gossip menu logic to fix bugs with sorry flag initialization
  • Adds pet restoration logic to reset to default appearances when module is disabled

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
src/morphsummon.cpp Implements module enable/disable logic, new name generation feature, pet restoration when disabled, water elemental scaling improvements, and gossip menu bug fixes
data/sql/db-world/base/morphsummon.sql Updates creature template to set npcflag correctly, removes redundant UPDATE statement, sets VerifiedBuild to 0 for custom creature, adds new gossip option
data/sql/db-characters/base/morphsummon_ddl.sql Updates column types from deprecated int(10) to int
conf/morphsummon.conf.dist Adds new config options for Enabled and NewNameEnabled features
Comments suppressed due to low confidence (1)

src/morphsummon.cpp:181

  • Missing null pointer check for displayInfo. The LookupEntry() can return null if the display ID is not found. Add a null check before dereferencing to prevent a crash: if (displayInfo) { pet->SetObjectScale(0.85f / displayInfo->scale); }
                CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.LookupEntry(pet->GetNativeDisplayId());
                pet->SetObjectScale(0.85f / displayInfo->scale);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Downward compatibility. If people upgrade to the new version they probably don't want any new gossip options suddenly appearing.
@Stoabrogga
Copy link
Contributor Author

I think this is ready to be merged. If there's anything else I can do, please let me know.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Stoabrogga
Copy link
Contributor Author

Pushed a new commit to address the copilot feedback.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Stoabrogga
Copy link
Contributor Author

Ok, another try...

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@sudlud
Copy link
Member

sudlud commented Feb 21, 2026

Just let me know when copilots requests get too wild :p

@Stoabrogga
Copy link
Contributor Author

Just let me know when copilots requests get too wild :p

Some of the complaints are still valid. Would be great if it could bring this up in one review, though. Btw, pushed another commit :-)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to disable the module

2 participants