Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------- SpellAuraEffects.cpp --------------------
- -- Under void AuraEffect::HandleAuraModIncreaseHealth(AuraApplication const* aurApp, uint8 mode, bool apply) const --
- {
- if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
- return;
- Unit* target = aurApp->GetTarget();
- float amount = GetAmount();
- // Special case of the Frenzied Regeneration the BP in dbc correspond to the porciento (bp = 30)
- if (aurApp->GetBase()->GetSpellInfo()->Id == 22842)
- {
- if (apply)
- // We calculate the ammount that corresponds to 30 % when the aura is applied
- amount = target->GetMaxHealth() * amount / 100;
- else
- // We calculate the original HP when the aura is removed
- amount = target->GetMaxHealth() * amount / (100 + amount);
- }
- if (apply)
- {
- target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
- // Frenzied Regeneration
- if (aurApp->GetBase()->GetSpellInfo()->Id == 22842)
- {
- // "increases health to 30% (if below that value)"
- if (target->GetHealth() < amount)
- target->SetHealth(amount);
- }
- else
- target->ModifyHealth(amount);
- }
- else
- {
- if (target->GetHealth() > 0)
- {
- int32 value = std::min<int32>(target->GetHealth() - 1, GetAmount());
- target->ModifyHealth(-value);
- }
- target->HandleStatModifier(UNIT_MOD_HEALTH, TOTAL_VALUE, float(GetAmount()), apply);
- }
- }
- ----- Insert ---------
- case SPELL_AURA_MOD_INCREASE_HEALTH_2:
- {
- switch (GetId())
- {
- // Frenzied Regeneration
- case 22842:
- {
- if (caster->GetShapeshiftForm() == FORM_BEAR)
- amount = GetBase()->GetUnitOwner()->CountPctFromMaxHealth(30);
- break;
- }
- // Mass Regeneration
- case 105737:
- {
- if (caster->GetShapeshiftForm() == FORM_BEAR)
- amount = GetBase()->GetUnitOwner()->CountPctFromMaxHealth(15);
- }
- }
- break;
- }
- ---- under SPELL_FAMILY_DRUID --------
- // Frenzied Regeneration
- case 22842:
- {
- // Converts up to 10 rage per second into health for $d. Each point of rage is converted into ${$m2/10}.1% of max health.
- // Should be manauser
- if (target->getPowerType() != POWER_RAGE)
- break;
- uint32 rage = target->GetPower(POWER_RAGE);
- // Nothing todo
- if (rage == 0)
- break;
- int32 mod = (rage < 100) ? rage : 100;
- int32 points = target->CalculateSpellDamage(target, GetSpellInfo(), 1);
- int32 regen = (target->GetMaxHealth() * (mod * points / 10) / 100) / 210;
- target->CastCustomSpell(target, 22845, ®en, 0, 0, true, 0, this);
- target->SetPower(POWER_RAGE, rage - mod);
- // Mass Regeneration
- if (target->HasAura(105735))
- // Mass Regeneration
- target->CastCustomSpell(target, 105739, ®en, NULL, NULL, true, NULL, this);
- target->SetPower(POWER_RAGE, rage - mod);
- break;
Advertisement
Add Comment
Please, Sign In to add comment