Beispiel #1
0
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     Unit* caster = GetCaster();
     if (Unit* target = GetHitUnit())
         caster->CastSpell(target, uint32(GetEffectValue()), true);
 }
            void HandleScript(SpellEffIndex /*effIndex*/)
            {
                int32 basePoints0 = int32(GetHitUnit()->CountPctFromMaxHealth(GetEffectValue()));

                GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_WARRIOR_RALLYING_CRY, &basePoints0, NULL, NULL, true);
            }
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     if (Unit* hitUnit = GetHitUnit())
         GetCaster()->CastSpell(hitUnit, uint32(GetEffectValue()), true);
 }
 void HandleDummy(SpellEffIndex /* effIndex */)
 {
     int32 damage = GetEffectValue();
     if (GetCaster() && GetHitUnit())
         GetCaster()->CastCustomSpell(GetHitUnit(), SHAMAN_SPELL_ANCESTRAL_AWAKENING_PROC, &damage, NULL, NULL, true);
 }
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     SetHitDamage(CalculatePct(GetCaster()->GetTotalAttackPowerValue(BASE_ATTACK), GetEffectValue()));
 }
Beispiel #6
0
void cBlizzard::Update(const float & _delta)
{
	SetEffectValue(m_pOwnerStatus->GetAttackDamage()*0.2f);
	m_skillRange.vCenter = GetOwner()->GetVPos();
	
	if (m_pOwnerStatus->GetCurrentHP() < 1)
	{
		SetCast(false);
		SetCoolDown(false);
		m_fCoolDownPassedTime = 0.0f;
		m_fPassedTime = 0.0f;
	}

	if (IsCast())
	{
		m_fPassedTime += _delta;
		if (m_fPassedTime < m_fRunTime)
		{
			m_vPos = m_skillRange.vCenter;
			D3DXMatrixTranslation(&m_matWorld,m_vPos.x,m_vPos.y,m_vPos.z);
			m_pParticleEffect->SetMatrix(m_matWorld);
			m_pParticleEffect->Update(_delta);
			if (m_fPassedTime > m_fNextHitTime)
			{
				for (size_t i = 0; i < m_vecTargetTag.size(); ++i)
				{
					const std::vector<cGameObject*> targets = g_pObjectManager->FindObjectByTag(m_vecTargetTag[i]);
					for (size_t j = 0; j < targets.size(); ++j)
					{
						D3DXVECTOR3	vCheckPos = targets[j]->GetVPos();
						D3DXVECTOR3	vRange;
						D3DXVec3Normalize(&vRange, &(m_vPos - vCheckPos));
						vRange *= targets[j]->GetBoundSphere().fRadius;
						vCheckPos += vRange;
						if (m_skillRange.IsPointIn(vCheckPos))
						{
							packet_hit = new Packet_Hit(GetEffectValue());
							g_pMessageDispatcher->Dispatch(m_ownerID, targets[j]->GetID(), 0.0f, Msg_Hit, packet_hit);
						}
					}
				}
				m_fNextHitTime += m_fPerHitTime;
				g_pSoundManager->Start("Blizzard");
			}
		}
		else
		{
			if (m_pDelegate)
				m_pDelegate->OnSkillDelegate(this);
			SetCast(false);
			SetCoolDown(true);
		}
	}
	else if(IsCoolDown())
	{
		m_fCoolDownPassedTime += _delta;
		if (m_fCoolDownPassedTime > m_fCoolDownTime)
		{
			SetCoolDown(false);
		}
	}
	
}
 void HandleScriptEffect(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue()), true);
 }
Beispiel #8
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     Unit* caster = GetCaster();
     caster->CastSpell(caster, GetEffectValue(), true);
 }
Beispiel #9
0
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     GetHitUnit()->CastSpell(GetCaster(), GetEffectValue(), true);
 }
Beispiel #10
0
 void HandleScript(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetHitUnit()->CastSpell(GetHitUnit(), GetEffectValue(), false);
 }
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     GetCaster()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
     GetCaster()->ToCreature()->AI()->Talk(EMOTE_PUNGENT_BLIGHT);
 }
Beispiel #12
0
 void HandleScript(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     if (Unit* target = GetHitUnit())
         target->CastSpell(target, GetEffectValue(), false);
 }
Beispiel #13
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if (Unit* unitTarget = GetHitUnit())
         if (SpellInfo const* spell_proto = sSpellMgr->GetSpellInfo(GetEffectValue()))
             GetCaster()->CastSpell(unitTarget, spell_proto, true, NULL);
 }
            void HandleEffect(SpellEffIndex /*effIndex*/)
            {
                Unit* caster = GetCaster();
                if (GetHitUnit())
                {
                    SpellInfo const* spellInfo = GetSpellInfo();
                    int32 rageUsed = std::min<int32>(200 - spellInfo->CalcPowerCost(caster, SpellSchoolMask(spellInfo->SchoolMask)), caster->GetPower(POWER_RAGE));
                    int32 newRage = std::max<int32>(0, caster->GetPower(POWER_RAGE) - rageUsed);

                    // Sudden Death rage save
                    if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_GENERIC, ICON_ID_SUDDEN_DEATH, EFFECT_0))
                    {
                        int32 ragesave = aurEff->GetSpellInfo()->Effects[EFFECT_0].CalcValue() * 10;
                        newRage = std::max(newRage, ragesave);
                    }

                    caster->SetPower(POWER_RAGE, uint32(newRage));

                    /// Formula taken from the DBC: "${10+$AP*0.437*$m1/100}"
                    int32 baseDamage = int32(10 + caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.437f * GetEffectValue() / 100.0f);
                    /// Formula taken from the DBC: "${$ap*0.874*$m1/100-1} = 20 rage"
                    int32 moreDamage = int32(rageUsed * (caster->GetTotalAttackPowerValue(BASE_ATTACK) * 0.874f * GetEffectValue() / 100.0f - 1) / 200);
                    SetHitDamage(baseDamage + moreDamage);
                }
            }
Beispiel #15
0
 void HandleScript(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
     GetHitUnit()->GetMotionMaster()->MovePoint(POINT_LAND, SavianaRagefireFlyInPos);
 }
Beispiel #16
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     GetCaster()->CastSpell(GetCaster(), GetEffectValue(), true);
 }
Beispiel #17
0
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     GetHitUnit()->RemoveAurasDueToSpell(GetEffectValue());
 }
Beispiel #18
0
 void HandleScript(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
 }
Beispiel #19
0
 void HandleDummy(SpellEffIndex /* effIndex */)
 {
     int32 bp0 = GetEffectValue();
     if (GetHitUnit())
         GetCaster()->CastCustomSpell(GetHitUnit(), SPELL_SLAM, &bp0, NULL, NULL, true, 0);
 }
Beispiel #20
0
 void HandleQuestComplete(SpellEffIndex effIndex)
 {
     GetHitUnit()->RemoveAurasDueToSpell(uint32(GetEffectValue()));
 }
 void HandleScriptEffect(SpellEffIndex effIndex)
 {
     PreventHitDefaultEffect(effIndex);
     for (uint8 i = 0; i < 4; ++i)
         GetCaster()->CastSpell(GetHitUnit(), uint32(GetEffectValue() + i), true);
 }
Beispiel #22
0
 void HandleTaunt(SpellEffIndex /*effIndex*/)
 {
     if (Unit* target = GetHitUnit())
         target->CastSpell(GetCaster(), uint32(GetEffectValue()), true);
 }
Beispiel #23
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     int32 damage = GetEffectValue();
     GetCaster()->CastCustomSpell(GetCaster(), SPELL_WARRIOR_BLOODTHIRST, &damage, NULL, NULL, true, NULL);
 }
Beispiel #24
0
 void HandleDummy(SpellEffIndex /* effIndex */)
 {
     int32 rageAmount = GetEffectValue();
     GetCaster()->CastCustomSpell(GetCaster(), SPELL_CHARGE_ENERGIZE, &rageAmount, NULL, NULL, true);
 }
Beispiel #25
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     Unit* caster = GetCaster();
     int32 healthModSpellBasePoints0 = int32(caster->CountPctFromMaxHealth(GetEffectValue()));
     caster->CastCustomSpell(caster, SPELL_WARRIOR_LAST_STAND_TRIGGERED, &healthModSpellBasePoints0, NULL, NULL, true, NULL);
 }
Beispiel #26
0
 void HandleScript(SpellEffIndex /*effIndex*/)
 {
     if (Player* target = GetHitPlayer())
         target->RemoveAura(uint32(GetEffectValue()));
 }
Beispiel #27
0
 void HandleDummy(SpellEffIndex /*effIndex*/)
 {
     if (GetHitUnit())
         GetCaster()->CastCustomSpell(SPELL_WARRIOR_SLAM, SPELLVALUE_BASE_POINT0, GetEffectValue(), GetHitUnit(), TRIGGERED_FULL_MASK);
 }
Beispiel #28
0
     void HandleDummy(SpellEffIndex /*effIndex*/)
     {
         Unit* caster = GetCaster();
         if (Unit* unitTarget = GetHitUnit())
         m_multip = (GetEffectValue() * unitTarget->GetDiseasesByCaster(caster->GetGUID())) / 100.0f;
 }