void HandleTriggerMissile(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     if (Position const* pos = GetHitDest())
         if (TempSummon* summon = GetCaster()->SummonCreature(NPC_ICY_BLAST, *pos, TEMPSUMMON_TIMED_DESPAWN, 60000))
             summon->CastSpell(summon, SPELL_ICY_BLAST_AURA, true);
 }
示例#2
0
		void HandleEffectDummy(SpellEffIndex /*effIndex*/)
		{
			Unit* caster = GetCaster();
			Position destPos;
			GetHitDest()->GetPosition(&destPos);

			// Body and soul
			if (AuraEffect* bodyAndSoul = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2218, EFFECT_0))
			{
				switch (bodyAndSoul->GetAmount())
				{
				case 30:
					caster->CastSpell(GetHitUnit(), 64128, true);
					break;
				case 60:
					caster->CastSpell(GetHitUnit(), 65081, true);
					break;
				}
			}

			SpellCastTargets targets;
			targets.SetDst(destPos);
			targets.SetUnitTarget(caster);
			GetHitUnit()->CastSpell(targets, sSpellMgr->GetSpellInfo(GetEffectValue()), NULL);
		}
 void ChangeSummonPos(SpellEffIndex /*effIndex*/)
 {
     WorldLocation summonPos = *GetExplTargetDest();
     Position offset = {0.0f, 0.0f, 15.0f, 0.0f};
     summonPos.RelocateOffset(offset);
     SetExplTargetDest(summonPos);
     GetHitDest()->RelocateOffset(offset);
 }
void SpellValanarKineticBombSpellScript::ChangeSummonPos(SpellEffIndex /*effIndex*/)
{
    WorldLocation summonPos = *GetExplTargetDest();
    Position offset = {0.0f, 0.0f, 20.0f, 0.0f};
    summonPos.RelocateOffset(offset);
    SetExplTargetDest(summonPos);
    GetHitDest()->RelocateOffset(offset);
}
示例#5
0
            void HandleEffectDummy(SpellEffIndex /*effIndex*/)
            {
                Position destPos = GetHitDest()->GetPosition();

                SpellCastTargets targets;
                targets.SetDst(destPos);
                targets.SetUnitTarget(GetCaster());
                GetHitUnit()->CastSpell(targets, sSpellMgr->GetSpellInfo(GetEffectValue()), NULL);
            }
示例#6
0
        void SetDestPosition(SpellEffIndex effIndex)
        {
            // Do our own calculations for the destination position.
            /// TODO: Remove this once we find a general rule for WorldObject::MovePosition (this spell shouldn't take the Z change into consideration)
            Unit* caster = GetCaster();
            float angle = float(rand_norm()) * static_cast<float>(2 * M_PI);
            uint32 dist = caster->GetObjectSize() + GetSpellInfo()->GetEffect(effIndex)->CalcRadius(GetCaster()) * (float)rand_norm();

            float x = caster->GetPositionX() + dist * std::cos(angle);
            float y = caster->GetPositionY() + dist * std::sin(angle);
            float z = caster->GetMap()->GetHeight(x, y, caster->GetPositionZ());

            const_cast<WorldLocation*>(GetExplTargetDest())->Relocate(x, y, z);
            GetHitDest()->Relocate(x, y, z);
        }
示例#7
0
 void SpawnGameObject(SpellEffIndex /*effIndex*/)
 {
     if (WorldLocation* loc = GetHitDest())
         GetCaster()->SummonGameObject(GAMEOBJECT_TWILIGHT_DOCUMENTS, loc->GetPositionX(), loc->GetPositionY(), loc->GetPositionZ(), loc->GetOrientation(), 0, 0, 0, 0, 7200);
 }
            void HandleSummon(SpellEffIndex effIndex)
            {
                PreventHitEffect(effIndex);

                uint32 entry = GetSpellInfo()->Effects[effIndex].MiscValue;
                SummonPropertiesEntry const* properties = sSummonPropertiesStore.LookupEntry(GetSpellInfo()->Effects[effIndex].MiscValueB);
                int32 duration = GetSpellInfo()->GetDuration();
                if (!GetOriginalCaster() || !properties)
                    return;

                if (TempSummon* summon = GetCaster()->GetMap()->SummonCreature(entry, *GetHitDest(), properties, duration, GetOriginalCaster(), GetSpellInfo()->Id))
                {
                    summon->SetCreatorGUID(GetOriginalCaster()->GetGUID());
                    summon->HandleSpellClick(GetCaster());
                }
            }
示例#9
0
 void ModDestHeight(SpellEffIndex /*effIndex*/)
 {
     Position offset = {0.0f, 0.0f, 30.0f, 0.0f};
     const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset);
     GetHitDest()->RelocateOffset(offset);
 }
示例#10
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if (WorldLocation* dest = GetHitDest())
         GetCaster()->CastSpell(dest->GetPositionX(), dest->GetPositionY(), dest->GetPositionZ(), SPELL_WARRIOR_HEROIC_LEAP_JUMP, true);
 }
示例#11
0
 void HandleScriptEffect(SpellEffIndex /*effIndex*/)
 {
     GetCaster()->CastSpell(GetHitDest()->GetPositionX(), GetHitDest()->GetPositionY(), GetHitDest()->GetPositionZ(), SPELL_ICE_BOMBARDMENT, true);
 }