Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
- index 3991595..11f1a02 100644
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -7603,6 +7603,80 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
- }
- case SPELLFAMILY_PALADIN:
- {
- + // Ancient Crusader (player)
- + if (dummySpell->Id == 86701)
- + {
- + if (!etTypeId() != TYPEID_PLAYER)
- + return false;
- +
- + // if caster has no guardian of ancient kings aura then remove dummy aura
- + if (!HasAura(86698))
- + {
- + RemoveAurasDueToSpell(86701);
- + return false;
- + }
- +
- + CastSpell(this, 86700, true);
- + return true;
- + }
- + // Ancient Crusader (guardian)
- + if (dummySpell->Id == 86703)
- + {
- +
- + if (!GetOwner() || GetOwner()->GetTypeId() != TYPEID_PLAYER)
- + return false;
- +
- + GetOwner()->CastSpell(this, 86700, true);
- + return true;
- + }
- + // Ancient Healer
- + if (dummySpell->Id == 86674)
- + {
- + if (GetTypeId() != TYPEID_PLAYER)
- + return false;
- +
- + // if caster has no guardian of ancient kings aura then remove dummy aura
- + if (!HasAura(86669))
- + {
- + RemoveAurasDueToSpell(86674);
- + return false;
- + }
- +
- + // check for single target spell (TARGET_SINGLE_FRIEND, NO_TARGET)
- + if (!(procSpell->EffectImplicitTargetA[triggeredByAura->GetEffIndex()] == 21 &&
- + procSpell->EffectImplicitTargetB[triggeredByAura->GetEffIndex()] == 0))
- + return false;
- +
- + // Need to get guardian but that do NOT WORK!!!
- + //if (Creature* pet = ObjectAccessor::GetCreatureOrPetOrVehicle(*this, GetPetGUID()))
- +
- + std::list<Creature*> petlist;
- + GetCreatureListWithEntryInGrid(petlist, 46499, 100.0f);
- + if (!petlist.empty())
- + for (std::list<Creature*>::const_iterator itr = petlist.begin(); itr != petlist.end(); ++itr)
- + {
- + Unit* pPet = (*itr);
- + if (pPet->GetOwnerGUID() == GetGUID())
- + {
- + //need to save num of heals up to 5
- + //I've done it with AI, maybe there's better way
- + uint32 heals = pPet->GetAI()->GetData(1001);
- + int32 bp0 = damage;
- + int32 bp1 = damage / 10;
- + pPet->CastCustomSpell(pVictim, 86678, &bp0, &bp1, NULL, true);
- + if (heals > 3)
- + {
- + //Dismiss guardian and remove auras
- + pPet->ToCreature()->ForcedDespawn();
- + RemoveAurasDueToSpell(86669);
- + RemoveAurasDueToSpell(86674);
- + }
- + else
- + pPet->GetAI()->SetData(1001, heals + 1);
- + }
- + }
- + return true;
- + }
- // Seal of Righteousness - melee proc dummy (addition {$MWS*(0.011*$AP+0.022*$SPH)} damage)
- if (dummySpell->Id == 20154 && !procSpell)
- {
- @@ -7905,12 +7979,6 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
- target = pVictim;
- break;
- }
- - case 86698:
- - {
- - target = GetOwner() ? GetOwner() : this;
- - target->CastSpell(target, 86700, true);
- - return true;
- - }
- }
- break;
- }
- @@ -14290,21 +14358,6 @@ void Unit::setDeathState(DeathState s)
- }
- }
- break;
- - case 46506:
- - case 46499:
- - case 46490:
- - if (Unit* owner = GetOwner())
- - {
- - if (owner->isAlive())
- - {
- - owner->RemoveAurasDueToSpell(86659);
- - owner->RemoveAurasDueToSpell(86669);
- - owner->RemoveAurasDueToSpell(86698);
- - if (GetEntry() == 46506)
- - owner->CastSpell(owner, 86704, true);
- - }
- - }
- - break;
- }
- }
- else if (s == JUST_ALIVED)
- diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- index 4314832..d3b8c8c 100644
- --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- @@ -7002,6 +7002,27 @@ void AuraEffect::HandleAuraDummy(AuraApplication const *aurApp, uint8 mode, bool
- break;
- }
- case SPELLFAMILY_PALADIN:
- + {
- + switch (GetId())
- + {
- + //Guardian of Ancient Kings (retribution)
- + case 86698:
- + if (!apply)
- + {
- + if (caster->HasAura(86700))
- + {
- + caster->CastSpell(caster, 86704, true);
- + caster->RemoveAurasDueToSpell(86700);
- + caster->RemoveAurasDueToSpell(86701);
- + }
- + }
- + break;
- + //Guardian of Ancient Kings (holy)
- + case 86669:
- + if (!apply)
- + caster->RemoveAurasDueToSpell(86674);
- + break;
- + }
- break;
- case SPELLFAMILY_DEATHKNIGHT:
- {
- diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
- index 576cbf4..871d4e6 100644
- --- a/src/server/game/Spells/SpellEffects.cpp
- +++ b/src/server/game/Spells/SpellEffects.cpp
- @@ -394,10 +394,6 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex)
- switch(m_spellInfo->Id) // better way to check unknown
- {
- - case 86150: // Guardian of Ancient Kings
- - if (unitTarget)
- - m_caster->CastSpell(m_caster, 86698, false, NULL);
- - return;
- // Positive/Negative Charge
- case 28062:
- case 28085:
- @@ -541,16 +537,6 @@ void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex)
- (m_caster->getLevel() * 2) + (m_caster->GetStat(STAT_INTELLECT) * 0.50193f));
- break;
- }
- - case 86704:
- - {
- - if (m_caster->GetTypeId() != TYPEID_PLAYER || !m_caster->isAlive() || !m_UniqueTargetInfo.size())
- - return;
- -
- - int32 total = m_caster->getLevel() * 2.5f;
- - total *= m_caster->GetAuraCount(86700);
- - damage = total / (m_UniqueTargetInfo.size() ? m_UniqueTargetInfo.size() : 1);
- - break;
- - }
- }
- break;
- }
- @@ -2038,6 +2024,28 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
- switch (m_spellInfo->Id)
- {
- + // Guardian of ancient kings
- + case 86150:
- + {
- + if (m_caster->GetTypeId() != TYPEID_PLAYER)
- + return;
- +
- + switch (m_caster->ToPlayer()->GetTalentBranchSpec(GetCaster()->ToPlayer()->GetActiveSpec()))
- + {
- + case BS_PALADIN_HOLY:
- + m_caster->CastSpell(m_caster, 86669, true);
- + m_caster->CastSpell(m_caster, 86674, true);
- + break;
- + case BS_PALADIN_PROTECTION:
- + m_caster->CastSpell(m_caster, 86659, true);
- + break;
- + case BS_PALADIN_RETRIBUTION)
- + m_caster->CastSpell(m_caster, 86698, true);
- + m_caster->CastSpell(m_caster, 86701, true);
- + break;
- + }
- + break;
- + }
- case 31789: // Righteous Defense (step 1)
- {
- // Clear targets for eff 1
- @@ -2524,16 +2532,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex)
- // Coldflame
- case 33801:
- return; // just make the core stfu
- - case 86760:
- - for (Unit::ControlList::iterator itr = m_caster->m_Controlled.begin(); itr != m_caster->m_Controlled.end(); ++itr)
- - {
- - if ((*itr)->GetEntry() == 46506 && (*itr)->isSummon() && (*itr)->isAlive())
- - {
- - unitTarget->AddAura(86698, *itr);
- - return;
- - }
- - }
- - return;
- }
- // normal case
- @@ -3230,30 +3228,6 @@ void Spell::SpellDamageHeal(SpellEffIndex effIndex)
- m_caster->RemoveAura(74434);
- }
- - if (m_caster->GetTypeId() == TYPEID_PLAYER && m_caster->getClass() == CLASS_PALADIN)
- - {
- - // Light of the Ancient Kings
- - if (Aura* aur = m_caster->GetAura(86669))
- - {
- - Unit* summon = NULL;
- - for (Unit::ControlList::iterator itr = m_caster->m_Controlled.begin(); itr != m_caster->m_Controlled.end(); ++itr)
- - {
- - if ((*itr)->GetEntry() == 46499 && (*itr)->isSummon() && (*itr)->isAlive())
- - {
- - summon = *itr;
- - break;
- - }
- - }
- -
- - if (summon && aur->HasEffect(1) && aur->GetEffect(1)->GetAmount())
- - {
- - int32 bp1 = CalculatePctN(addhealth, 10);
- - summon->CastCustomSpell(unitTarget, 86678, &addhealth, &bp1, NULL, true);
- - aur->GetEffect(1)->SetAmount(aur->GetEffect(1)->GetAmount()-1);
- - }
- - }
- - }
- -
- // Divine Purpose
- if (m_spellInfo->Id == 85222)
- addhealth *= GetPowerCost();
- diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
- index 1fc07b8..2ff3c5c 100644
- --- a/src/server/game/Spells/SpellMgr.cpp
- +++ b/src/server/game/Spells/SpellMgr.cpp
- @@ -3597,13 +3597,6 @@ void SpellMgr::LoadSpellCustomAttr()
- case 72505: // Ooze Eruption
- case 72624: // Ooze Eruption
- case 72625: // Ooze Eruption
- - case 86704: // Ancient Fury
- - // ONLY SPELLS WITH SPELLFAMILY_GENERIC and EFFECT_SCHOOL_DAMAGE
- - spellInfo->AttributesCu |= SPELL_ATTR0_CU_SHARE_DAMAGE;
- - break;
- - case 86674: // Ancient Healer
- - spellInfo->ProcCharges = 5;
- - break;
- case 18500: // Wing Buffet
- case 33086: // Wild Bite
- case 49749: // Piercing Blow
- @@ -3654,10 +3647,6 @@ void SpellMgr::LoadSpellCustomAttr()
- // 4.06 dbc issue which was fixed in 4.20 (or 4.10?)
- spellInfo->Effects[1].BasePoints = 7;
- break;
- - case 86150: // Guardian of Ancient Kings
- - spellInfo->Effects[0].TriggerSpell = 86698;
- - spellInfo->Effects[0].TargetA = TARGET_UNIT_CASTER;
- - break;
- default:
- break;
- }
- diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
- index f5b4837..d197c8e 100644
- --- a/src/server/scripts/World/npcs_special.cpp
- +++ b/src/server/scripts/World/npcs_special.cpp
- @@ -2974,82 +2974,6 @@ public:
- }
- };
- -// Uncomment this once guardians are able to cast spells
- -// on owner at AI initialization and be able to cast spells based on owner's triggered spellcasts.
- -
- -enum GuardianSpellsAndEntries
- -{
- - NPC_PROTECTION_GUARDIAN = 46490,
- - NPC_HOLY_GUARDIAN = 46499,
- - NPC_RETRI_GUARDIAN = 46506,
- - SPELL_ANCIENT_GUARDIAN_VISUAL = 86657,
- - SPELL_ANCIENT_CRUSADER_PLAYER = 86703,
- - SPELL_ANCIENT_CRUSADER_GUARDIAN = 86701
- -};
- -
- -class npc_guardian_of_ancient_kings : public CreatureScript
- -{
- -public:
- - npc_guardian_of_ancient_kings() : CreatureScript("npc_guardian_of_ancient_kings") { }
- -
- - struct npc_guardian_of_ancient_kingsAI : public ScriptedAI
- - {
- - npc_guardian_of_ancient_kingsAI(Creature *creature) : ScriptedAI(creature)
- - {
- - _healcount = 0;
- - }
- -
- - void InitializeAI()
- - {
- - Unit* owner = me->GetOwner();
- -
- - if (!owner || owner->GetTypeId() != TYPEID_PLAYER)
- - return;
- -
- - if (me->GetEntry() == NPC_PROTECTION_GUARDIAN)
- - {
- - me->SetUnitMovementFlags(MOVEMENTFLAG_ROOT);
- - me->SetReactState(REACT_PASSIVE);
- - me->CastSpell(owner, SPELL_ANCIENT_GUARDIAN_VISUAL, true);
- - }
- - }
- -
- - void UpdateAI(const uint32 diff)
- - {
- - Unit* owner = me->GetOwner();
- -
- - if (!UpdateVictim() || !owner)
- - return;
- -
- - if (me->GetEntry() == NPC_RETRI_GUARDIAN) // Only the retpaladin guardian hits melee,
- - DoMeleeAttackIfReady(); // at least is what i saw on vids.
- - }
- -
- - void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell)
- - {
- - if (me->GetEntry() == NPC_HOLY_GUARDIAN) // Holy paladin guardian
- - {
- - for (uint32 i = 0; i = MAX_SPELL_EFFECTS;)
- - {
- - if (spell->Effects[i].Effect == SPELL_EFFECT_HEAL // if the spell is a heal...
- - && spell->Effects[i].TargetA.GetTarget() == TARGET_UNIT_TARGET_ALLY) //... and is single target
- - _healcount++;
- -
- - if (_healcount == 5) // "Your Guardian of Ancient Spirits heals the target of your next 5 heals for the same amount as your heal"
- - me->DespawnOrUnsummon();
- - }
- - }
- - }
- - private:
- - uint32 _healcount;
- - };
- -
- - CreatureAI* GetAI(Creature* creature) const
- - {
- - return new npc_guardian_of_ancient_kingsAI(creature);
- - }
- -};
- -
- // Power Word Barrier
- class npc_power_word_barrier : public CreatureScript
- {
- @@ -3128,6 +3052,73 @@ class npc_power_word_barrier : public CreatureScript
- }
- };
- +class npc_guardian_of_ancient_kings : public CreatureScript
- +{
- +public:
- + npc_guardian_of_ancient_kings() : CreatureScript("npc_guardian_of_ancient_kings") { }
- +
- + CreatureAI *GetAI(Creature *creature) const
- + {
- + return new npc_guardian_of_ancient_kingsAI(creature);
- + }
- +
- + struct npc_guardian_of_ancient_kingsAI : public ScriptedAI
- + {
- + npc_guardian_of_ancient_kingsAI(Creature *c) : ScriptedAI(c)
- + {
- + uiHeals = 0;
- + }
- +
- + uint32 uiHeals;
- +
- + void Reset()
- + {
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
- +
- + if (me->GetEntry() == 46506)
- + me->SetReactState(REACT_AGGRESSIVE);
- + else
- + me->SetReactState(REACT_PASSIVE);
- +
- + if (me->GetEntry() == 46490)
- + {
- + if (me->GetOwner())
- + DoCast(me->GetOwner(), 86657);
- + }
- + else if (me->GetEntry() == 46506)
- + {
- + if (me->GetOwner())
- + DoCast(me, 86703, true);
- + }
- + }
- +
- + void SetData(uint32 type, uint32 data)
- + {
- + if (type == 1001)
- + uiHeals = data;
- + }
- +
- + uint32 GetData(uint32 type)
- + {
- + if (type == 1001)
- + return uiHeals;
- + return 0;
- + }
- +
- + void UpdateAI(const uint32 diff)
- + {
- + if (!UpdateVictim())
- + return;
- +
- + if (me->HasUnitState(UNIT_STAT_CASTING))
- + return;
- +
- + DoMeleeAttackIfReady();
- + }
- + };
- +};
- +
- void AddSC_npcs_special()
- {
- new npc_air_force_bots;
- @@ -3159,6 +3150,6 @@ void AddSC_npcs_special()
- new npc_tabard_vendor;
- new npc_experience;
- new npc_firework;
- - new npc_guardian_of_ancient_kings;
- new npc_power_word_barrier;
- + new npc_guardian_of_ancient_kings();
- }
Advertisement
Add Comment
Please, Sign In to add comment