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 13f5503..939b099 100644
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -6620,6 +6620,81 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
- }
- case SPELLFAMILY_PALADIN:
- {
- + // Ancient Crusader (player)
- + if (dummySpell->Id == 86701)
- + {
- + if (GetTypeId() != 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's 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* pet = (*itr);
- + if (pet->GetOwnerGUID() == GetGUID())
- + {
- + //need to save num of heals up to 5
- + //I've done it with AI, maybe there's better way
- + uint32 heals = pet->GetAI()->GetData(1001);
- + int32 bp0 = damage;
- + int32 bp1 = damage / 10;
- + pet->CastCustomSpell(pVictim, 86678, &bp0, &bp1, NULL, true);
- + if (heals > 3)
- + {
- + //Dismiss guardian and remove auras
- + pet->ToCreature()->ForcedDespawn();
- + RemoveAurasDueToSpell(86669);
- + RemoveAurasDueToSpell(86674);
- + }
- + else
- + pet->GetAI()->SetData(1001, heals + 1);
- + }
- + }
- + return true;
- + }
- // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage)
- if (dummySpell->SpellFamilyFlags[0]&0x8000000)
- {
- diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- index 8929f75..bc524a5 100644
- --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- @@ -6663,11 +6663,26 @@ void AuraEffect::HandleAuraDummy(AuraApplication const *aurApp, uint8 mode, bool
- break;
- }
- case SPELLFAMILY_PALADIN:
- - // Holy shield
- switch(GetId())
- {
- - case 20925:
- - //HandleShieldBlockValue(aurApp, mode, apply);
- + //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;
- diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
- index 0110f15..434ac7b 100644
- --- a/src/server/game/Spells/SpellEffects.cpp
- +++ b/src/server/game/Spells/SpellEffects.cpp
- @@ -340,6 +340,22 @@ void Spell::EffectEnvirinmentalDMG(SpellEffIndex effIndex)
- void Spell::EffectSchoolDMG(SpellEffIndex /*effIndex*/)
- {
- + // Ancient Fury
- + if (m_spellInfo->Id == 86704)
- + {
- + if (m_caster->GetTypeId() == TYPEID_PLAYER)
- + {
- + if (Aura* aura = m_caster->GetAura(86700))
- + {
- + uint8 stacks = aura->GetStackAmount();
- + uint32 count = 0;
- + for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
- + ++count;
- + damage = (damage + damage * stacks) / count;
- + }
- + }
- + }
- + m_damage += damage;
- }
- void Spell::SpellDamageSchoolDmg(SpellEffIndex effIndex)
- @@ -1752,6 +1768,30 @@ void Spell::EffectDummy(SpellEffIndex effIndex)
- switch (m_spellInfo->Id)
- {
- + case 86150: // Guardian of ancient kings
- + {
- + if (m_caster->GetTypeId() == TYPEID_PLAYER)
- + {
- + //Holy, check holy shock spell
- + if (m_caster->HasSpell(20473))
- + {
- + m_caster->CastSpell(m_caster, 86669, true);
- + m_caster->CastSpell(m_caster, 86674, true);
- + }
- + //Protection, check avenger's shield
- + else if (m_caster->HasSpell(31935))
- + {
- + m_caster->CastSpell(m_caster, 86659, true);
- + }
- + //Retribution, check templar's verdict
- + else if (m_caster->HasSpell(85256))
- + {
- + m_caster->CastSpell(m_caster, 86698, true);
- + m_caster->CastSpell(m_caster, 86701, true);
- + }
- + }
- + break;
- + }
- case 19740: // Blessing of Might
- {
- if (m_caster->GetTypeId() == TYPEID_PLAYER)
- diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
- index 10757d6..b3591fc 100644
- --- a/src/server/scripts/World/npcs_special.cpp
- +++ b/src/server/scripts/World/npcs_special.cpp
- @@ -3043,6 +3043,73 @@ public:
- };
- };
- +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;
- @@ -3077,5 +3144,6 @@ void AddSC_npcs_special()
- new npc_flame_orb;
- new npc_power_word_barrier;
- new npc_bloodworm();
- + new npc_guardian_of_ancient_kings();
- }
Advertisement
Add Comment
Please, Sign In to add comment