diff options
| author | Meji <alvaromegias_46@hotmail.com> | 2021-12-25 15:27:58 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-12-25 15:27:58 +0100 |
| commit | 924182f692bde38d8fed85d5dbe7531a09790501 (patch) | |
| tree | ec5b5c5842315ad391d1da9cd236952159a03fd4 /src/server/game/Spells/SpellEffects.cpp | |
| parent | 8ac0388870519a085115454783dafed873c1535f (diff) | |
Core/BattlePets: Misc fixes (#27446)
* Added script for "Summon Battle Pet" spell (118301).
* Set the saved display of the battle pet when summoning it.
* If a summon has SummonPropertiesFlags::SummonFromBattlePetJournal it will remove NpcFlag UNIT_NPC_FLAG_WILD_BATTLE_PET (Wild battle pets).
* When a creature is summoned with SummonTitle::Companion, it will check to see if it has SummonPropertiesFlags::SummonFromBattlePetJournal before updating the battle pet's update fields. (If you have a summoned battle pet and summon a creature with that SummonTitle, it will incorrectly update the battle pet's update fields with the summoned battle pet's data).
* Implemented SummonPropertiesFlags::UseCreatureLevel. If a summon has this flag, it will use the owner's level (If the summon doesn't have SummonProperties it will always use the selected level).
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
| -rw-r--r-- | src/server/game/Spells/SpellEffects.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 6004dc11ac7..f862ee5e717 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -1924,9 +1924,6 @@ void Spell::EffectSummonType() if (!summon || !summon->HasUnitTypeMask(UNIT_MASK_MINION)) return; - summon->SelectLevel(); // some summoned creaters have different from 1 DB data for level/hp - summon->SetNpcFlags(NPCFlags(summon->GetCreatureTemplate()->npcflag & 0xFFFFFFFF)); - summon->SetNpcFlags2(NPCFlags2(summon->GetCreatureTemplate()->npcflag >> 32)); summon->SetImmuneToAll(true); break; } @@ -4763,15 +4760,6 @@ void Spell::SummonGuardian(SpellEffectInfo const* effect, uint32 entry, SummonPr unitCaster = unitCaster->ToTotem()->GetOwner(); // in another case summon new - uint8 level = unitCaster->GetLevel(); - - // level of pet summoned using engineering item based at engineering skill level - if (m_CastItem && unitCaster->GetTypeId() == TYPEID_PLAYER) - if (ItemTemplate const* proto = m_CastItem->GetTemplate()) - if (proto->GetRequiredSkill() == SKILL_ENGINEERING) - if (uint16 skill202 = unitCaster->ToPlayer()->GetSkillValue(SKILL_ENGINEERING)) - level = skill202 / 5; - float radius = 5.0f; int32 duration = m_spellInfo->CalcDuration(m_originalCaster); @@ -4791,7 +4779,20 @@ void Spell::SummonGuardian(SpellEffectInfo const* effect, uint32 entry, SummonPr return; if (summon->HasUnitTypeMask(UNIT_MASK_GUARDIAN)) + { + uint8 level = summon->GetLevel(); + if (properties && !properties->GetFlags().HasFlag(SummonPropertiesFlags::UseCreatureLevel)) + level = unitCaster->GetLevel(); + + // level of pet summoned using engineering item based at engineering skill level + if (m_CastItem && unitCaster->GetTypeId() == TYPEID_PLAYER) + if (ItemTemplate const* proto = m_CastItem->GetTemplate()) + if (proto->GetRequiredSkill() == SKILL_ENGINEERING) + if (uint16 skill202 = unitCaster->ToPlayer()->GetSkillValue(SKILL_ENGINEERING)) + level = skill202 / 5; + ((Guardian*)summon)->InitStatsForLevel(level); + } if (summon->HasUnitTypeMask(UNIT_MASK_MINION) && m_targets.HasDst()) ((Minion*)summon)->SetFollowAngle(unitCaster->GetAbsoluteAngle(summon)); |
