Core/SAI: Implemented new source type SMART_SCRIPT_TYPE_EVENT (3)

Port From (https://github.com/TrinityCore/TrinityCore/commit/d015711fbb7a8bf57f7bb64ba8113c942d5125de)
This commit is contained in:
hondacrx
2023-07-23 18:06:11 -04:00
parent bef7b60baa
commit 25a4d5b354
10 changed files with 208 additions and 74 deletions
+21 -21
View File
@@ -1874,30 +1874,30 @@ namespace Game.Entities
foreach (var spellEntry in mSpellInfoMap.Values)
{
if (spellEntry.Difficulty != Difficulty.None)
continue;
foreach (var spellEffectInfo in spellEntry.GetEffects())
{
foreach (var spellEffectInfo in spellEntry.GetEffects())
if (spellEffectInfo.Effect == SpellEffectName.Summon || spellEffectInfo.Effect == SpellEffectName.SummonPet)
{
if (spellEffectInfo.Effect == SpellEffectName.Summon || spellEffectInfo.Effect == SpellEffectName.SummonPet)
int creature_id = spellEffectInfo.MiscValue;
CreatureTemplate cInfo = Global.ObjectMgr.GetCreatureTemplate((uint)creature_id);
if (cInfo == null)
continue;
// get default pet spells from creature_template
uint petSpellsId = cInfo.Entry;
if (mPetDefaultSpellsMap.LookupByKey(cInfo.Entry) != null)
continue;
PetDefaultSpellsEntry petDefSpells = new();
for (byte j = 0; j < SharedConst.MaxCreatureSpellDataSlots; ++j)
petDefSpells.spellid[j] = cInfo.Spells[j];
if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
{
int creature_id = spellEffectInfo.MiscValue;
CreatureTemplate cInfo = Global.ObjectMgr.GetCreatureTemplate((uint)creature_id);
if (cInfo == null)
continue;
// get default pet spells from creature_template
uint petSpellsId = cInfo.Entry;
if (mPetDefaultSpellsMap.LookupByKey(cInfo.Entry) != null)
continue;
PetDefaultSpellsEntry petDefSpells = new();
for (byte j = 0; j < SharedConst.MaxCreatureSpellDataSlots; ++j)
petDefSpells.spellid[j] = cInfo.Spells[j];
if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
{
mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
++countCreature;
}
mPetDefaultSpellsMap[petSpellsId] = petDefSpells;
++countCreature;
}
}
}