示例#1
0
		bool Load() {
			absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
					EFFECT_0, GetCaster());
			hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
					EFFECT_1, GetCaster());
			return true;
		}
		bool Load() {
			healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
					EFFECT_1);
			absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
					EFFECT_0);
			return GetUnitOwner()->ToPlayer();
		}
示例#3
0
 bool Load ()
 {
     absorbPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0, GetCaster());
     if (GetCaster()->HasSpell(49224))
         absorbPct += 8;
     if (GetCaster()->HasSpell(49610))
         absorbPct += 16;
     if (GetCaster()->HasSpell(49611))
         absorbPct += 25;
     hpPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1, GetCaster());
     return true;
 }
            void PeriodicTick(AuraEffect const* /*aurEff*/)
            {
                PreventDefaultAction();
                uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[0];

                if (Unit* caster = GetCaster())
                    caster->CastCustomSpell(triggerSpellId, SPELLVALUE_MAX_TARGETS, irand(1, 2), caster, true);
            }
示例#5
0
		int32 CalcAbsorbAmount()
		{
			Player* caster = GetPlayerCaster();
			if(caster != NULL)
				return caster->GetMaxHealth() * (GetSpellProto()->EffectBasePoints[1] + 1) / 100;
			else
				return mod->m_amount;
		}
            void HandleTriggerSpell(AuraEffect const* aurEff)
            {
                PreventDefaultAction();
                Unit* target = GetTarget();
                uint32 triggerSpellId = GetSpellProto()->EffectTriggerSpell[aurEff->GetEffIndex()];
                target->CastSpell(target, triggerSpellId, true);

                if (Unit* caster = GetCaster())
                    if (target->GetDistance(caster) <= 12.0f)
                        target->CastSpell(caster, SPELL_SIPHONED_MIGHT, true);
            }
示例#7
0
 void HandleUpdatePeriodic(AuraEffect * aurEff)
 {
     if (Unit* pTarget = GetUnitOwner())
         if (Player* pPlayerTarget = pTarget->ToPlayer())
         {
             int32 baseAmount = aurEff->GetBaseAmount();
             int32 amount = pPlayerTarget->isMoving() ?
                 pTarget->CalculateSpellDamage(pTarget, GetSpellProto(), aurEff->GetEffIndex(), &baseAmount) :
                 aurEff->GetAmount() - 1;
             aurEff->SetAmount(amount);
         }
 }
示例#8
0
            void Absorb(AuraEffect * /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
            {
                // min pct of hp is stored in effect 0 of talent spell
                uint32 rank = sSpellMgr->GetSpellRank(GetSpellProto()->Id);
                SpellEntry const * talentProto = sSpellStore.LookupEntry(sSpellMgr->GetSpellWithRank(DK_SPELL_WILL_OF_THE_NECROPOLIS_TALENT_R1, rank));

                int32 remainingHp = int32(GetTarget()->GetHealth() - dmgInfo.GetDamage());
                int32 minHp = int32(GetTarget()->CountPctFromMaxHealth(SpellMgr::CalculateSpellEffectAmount(talentProto, EFFECT_0, GetCaster())));

                // Damage that would take you below [effect0] health or taken while you are at [effect0]
                if (remainingHp < minHp)
                    absorbAmount = CalculatePctN(dmgInfo.GetDamage(), absorbPct);
            }
示例#9
0
		uint32 AbsorbDamage(uint32 School, uint32* dmg)
		{
			// Checking for 1 min cooldown
			if(dSpell == NULL || ! p_target->Cooldown_CanCast(dSpell))
				return 0;

			// Check for proc chance
			if(RandomFloat(100.0f) > GetSpellProto()->EffectBasePoints[0] + 1)
				return 0;

			// Check if damage will kill player.
			uint32 cur_hlth = p_target->GetHealth();
			if((*dmg) < cur_hlth)
				return 0;

			uint32 max_hlth = p_target->GetMaxHealth();
			uint32 min_hlth = max_hlth / 10;

			/*
				looks like the following lines are not so good, we check and cast on spell id 31231_
				and adding the cooldown to it, but it looks like this spell is useless(all it's doing is_
				casting 45182, so we can do all this stuff on 45182 at first place), BUT_
				as long as proceeding cheat death is not so height (how many rogue at the same time_
				gonna get to this point?) so it's better to use it because we wont lose anything!!
			*/
			p_target->CastSpell(p_target->GetGUID(), dSpell, true);

			// set dummy effect,
			// this spell is used to procced the post effect of cheat death later.
			// Move next line to SPELL::SpellEffectDummy ?!! well it's better in case of dbc changing!!
			p_target->CastSpell(p_target->GetGUID(), 45182, true);

			// Better to add custom cooldown procedure then f*****g with entry, or not!!
			dSpell->RecoveryTime = 60000;
			p_target->Cooldown_Add(dSpell, NULL);

			// Calc abs and applying it
			uint32 real_dmg = (cur_hlth > min_hlth ? cur_hlth - min_hlth : 0);
			uint32 absorbed_dmg = *dmg - real_dmg;

			*dmg = real_dmg;
			return absorbed_dmg;
		}
示例#10
0
		uint32 AbsorbDamage(uint32 School, uint32* dmg)
		{
			Unit* caster = GetUnitCaster();
			if(caster == NULL)
				return 0;

			int health_pct = caster->GetHealthPct();
			uint32 cur_health = caster->GetHealth();
			uint32 max_health = caster->GetMaxHealth();
			uint32 new_health_pct = (cur_health - *dmg) * 100 / max_health;

			// "Damage that would take you below $s1% health or taken while you are at $s1% health is reduced by $52284s1%."
			if((health_pct > 35 && new_health_pct < 35) || health_pct == 35)
			{
				uint32 dmg_absorbed = *dmg * (GetSpellProto()->EffectBasePoints[0] + 1) / 100;
				*dmg -= dmg_absorbed;

				return dmg_absorbed;
			}
			else
				return 0;
		}
示例#11
0
 bool Load()
 {
     healPct = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_1);
     return true;
 }
示例#12
0
 bool Load()
 {
     absorbChance = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(), EFFECT_0);
     return GetUnitOwner()->ToPlayer();
 }
示例#13
0
		bool Load() {
			// Max absorb stored in 1 dummy effect
			limit = SpellMgr::CalculateSpellEffectAmount(GetSpellProto(),
					EFFECT_1);
			return true;
		}
示例#14
0
		int32 CalcPctDamage()
		{
			return GetSpellProto()->EffectBasePoints[0] + 1;
		}