Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/src/server/game/Entities/Creature/TemporarySummon.cpp b/src/server/game/Entities/Creature/TemporarySummon.cpp
- index 2af6b4c..ca75c1c 100755
- --- a/src/server/game/Entities/Creature/TemporarySummon.cpp
- +++ b/src/server/game/Entities/Creature/TemporarySummon.cpp
- @@ -243,9 +243,13 @@ void TempSummon::UnSummon(uint32 msTime)
- }
- Unit* owner = GetSummoner();
- + if (owner && GetEntry() == 30230) // Risen ally
- + {
- + owner->RemoveAurasDueToSpell(62218);
- + owner->RemoveAurasDueToSpell(46619);
- + }
- if (owner && owner->GetTypeId() == TYPEID_UNIT && owner->ToCreature()->IsAIEnabled)
- owner->ToCreature()->AI()->SummonedCreatureDespawn(this);
- diff --git a/src/server/game/Entities/Creature/TemporarySummon.h b/src/server/game/Entities/Creature/TemporarySummon.h
- index 829eb73..bae305b 100755
- --- a/src/server/game/Entities/Creature/TemporarySummon.h
- +++ b/src/server/game/Entities/Creature/TemporarySummon.h
- @@ -54,7 +54,7 @@ class Minion : public TempSummon
- Unit* GetOwner() { return m_owner; }
- float GetFollowAngle() const { return m_followAngle; }
- void SetFollowAngle(float angle) { m_followAngle = angle; }
- - bool IsPetGhoul() const {return GetEntry() == 26125;} // Ghoul may be guardian or pet
- + bool IsPetGhoul() const {return (GetEntry() == 26125 || GetEntry() == 30230);} // Ghoul may be guardian or pet
- bool IsGuardianPet() const;
- protected:
- Unit* const m_owner;
- diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
- index 9366672..747808b 100755
- --- a/src/server/game/Entities/Unit/Unit.cpp
- +++ b/src/server/game/Entities/Unit/Unit.cpp
- @@ -12840,7 +12840,7 @@ void Unit::setDeathState(DeathState s)
- // it can be used to check creation of death items (such as soul shards).
- m_deathState = s;
- - if (s != ALIVE && s != JUST_ALIVED)
- + if (s != ALIVE && s != JUST_ALIVED && s != GHOULED)
- {
- CombatStop();
- DeleteThreatList();
- diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
- index 5a6276d..b260278 100755
- --- a/src/server/game/Entities/Unit/Unit.h
- +++ b/src/server/game/Entities/Unit/Unit.h
- @@ -466,6 +466,7 @@ enum DeathState
- CORPSE = 2,
- DEAD = 3,
- JUST_ALIVED = 4,
- + GHOULED = 5, //Raise ally, Deathknight's spell
- };
- enum UnitState
- diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- index 31a8e57..19513d0 100755
- --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
- @@ -5253,8 +5253,34 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
- break;
- case SPELLFAMILY_DEATHKNIGHT:
- {
- - //if (!(mode & AURA_EFFECT_HANDLE_REAL))
- - // break;
- + if (!(mode & AURA_EFFECT_HANDLE_REAL))
- + break;
- +
- + if (GetId() == 46619) // Raise Ally
- + {
- + if (!target || target->GetTypeId() != TYPEID_PLAYER)
- + break;
- + Player* player = target->ToPlayer();
- + if (apply)
- + {
- + player->setDeathState(GHOULED);
- + WorldPacket data(SMSG_PRE_RESURRECT, player->GetPackGUID().size());
- + data.append(player->GetPackGUID());
- + player->GetSession()->SendPacket(&data);
- + player->StopMirrorTimers();
- + player->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, float(1.0f));
- + player->SetHealth(1);
- + player->SetMovement(MOVE_ROOT);
- + }
- + else
- + {
- + player->RemoveAurasDueToSpell(62218);
- + player->SetMovement(MOVE_UNROOT);
- + player->SetHealth(0);
- + player->setDeathState(JUST_DIED);
- + }
- + break;
- + }
- break;
- }
- }
- diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
- index 28b089f..2fcb2a6 100755
- --- a/src/server/game/Spells/Spell.cpp
- +++ b/src/server/game/Spells/Spell.cpp
- @@ -5565,7 +5565,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
- // dead owner (pets still alive when owners ressed?)
- if (Unit* owner = m_caster->GetCharmerOrOwner())
- - if (!owner->isAlive())
- + if (!owner->isAlive() && owner->getDeathState() != GHOULED)
- return SPELL_FAILED_CASTER_DEAD;
- if (!target && m_targets.GetUnitTarget())
- diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
- index d3566c2..43ab326 100755
- --- a/src/server/game/Spells/SpellEffects.cpp
- +++ b/src/server/game/Spells/SpellEffects.cpp
- @@ -4722,6 +4722,20 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex)
- }
- case SPELLFAMILY_DEATHKNIGHT:
- {
- + if (m_spellInfo->Id == 61999) // Raise Ally
- + {
- + if (!unitTarget || m_caster->GetTypeId() != TYPEID_PLAYER || unitTarget->isAlive())
- + {
- + SendCastResult(SPELL_FAILED_TARGET_NOT_DEAD);
- + finish(false);
- + CancelGlobalCooldown();
- + m_caster->ToPlayer()->RemoveSpellCooldown(61999);
- + return;
- + }
- + unitTarget->CastSpell(unitTarget, 46619, true);
- + CancelGlobalCooldown();
- + return;
- + }
- // Pestilence
- if (m_spellInfo->SpellFamilyFlags[1]&0x10000)
- {
- diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
- index e1cfd07..da37de9 100644
- --- a/src/server/scripts/World/npcs_special.cpp
- +++ b/src/server/scripts/World/npcs_special.cpp
- @@ -2965,6 +2965,66 @@ public:
- };
- };
- +class npc_risen_ally : public CreatureScript
- +{
- +public:
- + npc_risen_ally() : CreatureScript("npc_risen_ally") { }
- +
- + CreatureAI* GetAI(Creature* creature) const
- + {
- + return new npc_risen_allyAI(creature);
- + }
- +
- + struct npc_risen_allyAI : ScriptedAI
- + {
- + npc_risen_allyAI(Creature* creature) : ScriptedAI(creature) {}
- +
- + void InitializeAI()
- + {
- + me->setPowerType(POWER_ENERGY);
- + me->SetMaxPower(POWER_ENERGY, 100);
- + me->SetPower(POWER_ENERGY, 100);
- + me->SetSheath(SHEATH_STATE_MELEE);
- + me->SetByteFlag(UNIT_FIELD_BYTES_2, 2, UNIT_CAN_BE_ABANDONED);
- + me->SetUInt32Value(UNIT_FIELD_BYTES_0, 2048);
- + me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
- + me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
- + me->SetFloatValue(UNIT_FIELD_COMBATREACH, 1.5f);
- + }
- +
- + void Reset()
- + {
- + me->setPowerType(POWER_ENERGY);
- + me->SetMaxPower(POWER_ENERGY, 100);
- + }
- +
- + void IsSummonedBy(Unit* owner)
- + {
- + me->setPowerType(POWER_ENERGY);
- + me->SetMaxPower(POWER_ENERGY, 100);
- + me->SetPower(POWER_ENERGY, 100);
- + }
- +
- + void JustDied(Unit* /*killer*/)
- + {
- + if (me->GetOwner())
- + {
- + me->GetOwner()->RemoveAurasDueToSpell(62218);
- + me->GetOwner()->RemoveAurasDueToSpell(46619);
- + }
- + }
- +
- + void UpdateAI(const uint32 diff)
- + {
- + if (!me->isCharmed())
- + me->DespawnOrUnsummon();
- +
- + if (me->isInCombat())
- + DoMeleeAttackIfReady();
- + }
- + };
- +};
- +
- void AddSC_npcs_special()
- {
- new npc_air_force_bots();
- @@ -2997,4 +3057,5 @@ void AddSC_npcs_special()
- new npc_earth_elemental();
- new npc_firework();
- new npc_spring_rabbit();
- + new npc_risen_ally();
- }
Advertisement
Add Comment
Please, Sign In to add comment