mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-19 13:28:25 +00:00
[NPC Scaling] Recalculate Skills and Reload Spells on Level Change (#2416)
* [NPC Scaling] Recalculate Skills and Reload Spells on Level Change - Add $npc->ReloadSpells() to Perl. - Add npc:ReloadSpells() to Lua. Previously, you would you have to manually call RecalculateSkills() after you scale the NPC, now the call is built in to the scaling. Spells did not reload when NPCs were scaled, causing them to continue to use their low/high level spells depending upon which way their level had been scaled, this has been adding to the scaling method. This will make NPCs properly use their level-based spells. RecalculateSkills() and ReloadSpells() can still be used manually if people scale using something other than the source scaling method. Having this functionality built in to the scaling itself just makes more sense to me. Open to any ideas or thoughts. * Reload spell effects, too.
This commit is contained in:
@@ -3643,10 +3643,18 @@ void NPC::RecalculateSkills()
|
||||
}
|
||||
}
|
||||
|
||||
void NPC::ReloadSpells() {
|
||||
AI_AddNPCSpells(GetNPCSpellsID());
|
||||
AI_AddNPCSpellsEffects(GetNPCSpellsEffectsID());
|
||||
}
|
||||
|
||||
void NPC::ScaleNPC(uint8 npc_level) {
|
||||
if (GetLevel() != npc_level) {
|
||||
SetLevel(npc_level);
|
||||
RecalculateSkills();
|
||||
ReloadSpells();
|
||||
}
|
||||
|
||||
npc_scale_manager->ResetNPCScaling(this);
|
||||
npc_scale_manager->ScaleNPC(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user