diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/Object.cpp | 5 | ||||
-rw-r--r-- | src/game/Spell.cpp | 28 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 10 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 49 | ||||
-rw-r--r-- | src/game/Unit.cpp | 82 |
5 files changed, 124 insertions, 50 deletions
diff --git a/src/game/Object.cpp b/src/game/Object.cpp index ea4f35dda82..ca622edb9c6 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -420,8 +420,13 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const *data << uint32(GetGUIDLow()); // GetGUIDLow() break; case TYPEID_UNIT: + { + if(((Creature*)this)->canFly()) + flags |= MOVEMENTFLAG_LEVITATING; + *data << uint32(0x0000000B); // unk, can be 0xB or 0xC break; + } case TYPEID_PLAYER: if(flags & UPDATEFLAG_SELF) *data << uint32(0x0000002F); // unk, can be 0x15 or 0x22 diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 7130eb1ad1f..d43b0b16dd1 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4795,6 +4795,16 @@ SpellCastResult Spell::CheckCast(bool strict) if(!m_caster->FindNearestCreature(28653,5)) return SPELL_FAILED_OUT_OF_RANGE; } + else if (m_spellInfo->Id == 31789) // Righteous Defense + { + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_DONT_REPORT; + + Unit* target = m_targets.getUnitTarget(); + if (!target || !target->IsFriendlyTo(m_caster) || target->getAttackers().empty()) + return SPELL_FAILED_BAD_TARGETS; + + } break; } case SPELL_EFFECT_LEARN_SPELL: @@ -5089,6 +5099,24 @@ SpellCastResult Spell::CheckCast(bool strict) if(m_caster->GetTypeId() != TYPEID_PLAYER || !((Player*)m_caster)->IsInFeralForm()) return SPELL_FAILED_ONLY_SHAPESHIFT; break; + // Wild Growth + case 48438: + case 53248: + case 53249: + case 53251: + { + if (m_caster->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_DONT_REPORT; + + Unit* target = m_targets.getUnitTarget(); + if (!target || target->GetTypeId() != TYPEID_PLAYER) + return SPELL_FAILED_BAD_TARGETS; + + if (!((Player*)m_caster)->IsInSameRaidWith(((Player*)target))) + return SPELL_FAILED_TARGET_NOT_IN_RAID; + + break; + } case 1515: { if (m_caster->GetTypeId() != TYPEID_PLAYER) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 9af5ece985f..c9867e1b2c5 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -6003,6 +6003,16 @@ void AuraEffect::PeriodicTick() m_amount *= 2; break; } + case 31803: + case 53742: + { + float ap = pCaster->GetTotalAttackPowerValue(BASE_ATTACK); + int32 holy = pCaster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellProto)) + + pCaster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellProto), m_target); + + m_amount = (0.013f * holy + 0.025f * ap) * 6 / 5 * m_tickNumber; + break; + } default: break; } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index cbc63b39827..c738fcc13ef 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -533,6 +533,17 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) if(back_damage < unitTarget->GetHealth()) m_caster->CastCustomSpell(m_caster, 32409, &back_damage, 0, 0, true); } + // Mind Blast - applies Mind Trauma if: + else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x2000)) + { + // We are in Shadow Form + if (m_caster->m_form == FORM_SHADOW) + // We have Improved Mind Blast + if (AuraEffect * aurEff = m_caster->GetDummyAura(SPELLFAMILY_PRIEST,95,0)) + // Chance has been successfully rolled + if (roll_chance_i(aurEff->GetSpellProto()->EffectBasePoints[1] + 1)) + m_caster->CastSpell(unitTarget, 48301, true); + } // Smite else if (m_spellInfo->SpellFamilyFlags[0] & 0x80) { @@ -688,8 +699,17 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx) } case SPELLFAMILY_PALADIN: { + // Hammer of Wrath + if (m_spellInfo->SpellFamilyFlags[1]&0x00000080) + { + float ap = m_caster->GetTotalAttackPowerValue(BASE_ATTACK); + int32 holy = m_caster->SpellBaseDamageBonus(GetSpellSchoolMask(m_spellInfo)) + + m_caster->SpellBaseDamageBonusForVictim(GetSpellSchoolMask(m_spellInfo), unitTarget); + + damage += int32(ap * 0.15f) + int32(holy * 0.15f); + } // Hammer of the Righteous - if (m_spellInfo->SpellFamilyFlags[1]&0x00040000) + else if (m_spellInfo->SpellFamilyFlags[1]&0x00040000) { // Add main hand dps * effect[2] amount float average = (m_caster->GetFloatValue(UNIT_FIELD_MINDAMAGE) + m_caster->GetFloatValue(UNIT_FIELD_MAXDAMAGE)) / 2; @@ -1892,37 +1912,12 @@ void Spell::EffectDummy(uint32 i) } case 31789: // Righteous Defense (step 1) { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - { - SendCastResult(SPELL_FAILED_TARGET_AFFECTING_COMBAT); - return; - } - - // 31989 -> dummy effect (step 1) + dummy effect (step 2) -> 31709 (taunt like spell for each target) - - Unit* friendTarget = !unitTarget || unitTarget->IsFriendlyTo(m_caster) ? unitTarget : unitTarget->getVictim(); - if (friendTarget) - { - Player* player = friendTarget->GetCharmerOrOwnerPlayerOrPlayerItself(); - if (!player || !player->IsInSameRaidWith((Player*)m_caster)) - friendTarget = NULL; - } - - // non-standard cast requirement check - if (!friendTarget || friendTarget->getAttackers().empty()) - { - ((Player*)m_caster)->RemoveSpellCooldown(m_spellInfo->Id,true); - SendCastResult(SPELL_FAILED_TARGET_AFFECTING_COMBAT); - return; - } - - // Righteous Defense (step 2) (in old version 31980 dummy effect) // Clear targets for eff 1 for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) ihit->effectMask &= ~(1<<1); // not empty (checked), copy - Unit::AttackerSet attackers = friendTarget->getAttackers(); + Unit::AttackerSet attackers = unitTarget->getAttackers(); // selected from list 3 for(int i = 0; i < std::min(size_t(3),attackers.size()); ++i) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index bc36ca8aaf4..e72a0024f24 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1984,6 +1984,44 @@ void Unit::CalcAbsorbResist(Unit *pVictim, SpellSchoolMask schoolMask, DamageEff } break; } + case SPELLFAMILY_PALADIN: + { + // Ardent Defender + if (spellProto->SpellIconID == 2135 && pVictim->GetTypeId() == TYPEID_PLAYER) + { + int32 remainingHealth = pVictim->GetHealth() - RemainingDamage; + uint32 allowedHealth = pVictim->GetMaxHealth() * 0.35f; + // If damage kills us + if (remainingHealth <= 0 && !((Player*)pVictim)->HasSpellCooldown(66235)) + { + // Cast healing spell, completely avoid damage + RemainingDamage = 0; + + uint32 defenseSkillValue = pVictim->GetDefenseSkillValue(); + // Max heal when defense skill denies critical hits from raid bosses + // Formula: max defense at level + 140 (raiting from gear) + uint32 reqDefForMaxHeal = pVictim->getLevel() * 5 + 140; + float pctFromDefense = (defenseSkillValue >= reqDefForMaxHeal) + ? 1.0f + : float(defenseSkillValue) / float(reqDefForMaxHeal); + + int32 healAmount = pVictim->GetMaxHealth() * ((*i)->GetSpellProto()->EffectBasePoints[1] + 1) / 100.0f * pctFromDefense; + pVictim->CastCustomSpell(pVictim, 66235, &healAmount, NULL, NULL, true); + ((Player*)pVictim)->AddSpellCooldown(66235,0,time(NULL) + 120); + } + else if (remainingHealth < allowedHealth) + { + // Reduce damage that brings us under 35% (or full damage if we are already under 35%) by x% + uint32 damageToReduce = (pVictim->GetHealth() < allowedHealth) + ? RemainingDamage + : allowedHealth - remainingHealth; + RemainingDamage -= damageToReduce * currentAbsorb / 100; + } + continue; + + } + break; + } case SPELLFAMILY_SHAMAN: { // Astral Shift @@ -5812,7 +5850,15 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Divine Aegis if (dummySpell->SpellIconID == 2820) { - basepoints0 = damage * triggerAmount/100; + // Multiple effects stack, so let's try to find this aura. + int32 bonus = 0; + if (AuraEffect *aurEff = target->GetAuraEffect(47753, 0)) + bonus = aurEff->GetAmount(); + + basepoints0 = damage * triggerAmount/100 + bonus; + if (basepoints0 > target->getLevel() * 125) + basepoints0 = target->getLevel() * 125; + triggered_spell_id = 47753; break; } @@ -6136,30 +6182,20 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger // Eclipse if (dummySpell->SpellIconID == 2856 && GetTypeId() == TYPEID_PLAYER) { - if (!procSpell) + if (!procSpell || effIndex != 0) return false; - // Only 0 aura can proc - if (effIndex!=0) + + bool isWrathSpell = (procSpell->SpellFamilyFlags[1] & 0x00000001); + + if (!roll_chance_f(dummySpell->procChance * (isWrathSpell ? 0.6f : 1.0f))) return false; - // Wrath crit - if (procSpell->SpellFamilyFlags[0] & 0x1) - { - if (!roll_chance_i(60)) - return false; - ((Player*)this)->AddSpellCooldown(48517,0,time(NULL) + cooldown); - triggered_spell_id = 48518; - target = this; - break; - } - // Starfire crit - if (procSpell->SpellFamilyFlags[0] & 0x4) - { - ((Player*)this)->AddSpellCooldown(48518,0,time(NULL) + cooldown); - triggered_spell_id = 48517; - target = this; - break; - } - return false; + + target = this; + if (target->HasAura(isWrathSpell ? 48517 : 48518)) + return false; + + triggered_spell_id = isWrathSpell ? 48518 : 48517; + break; } // Living Seed else if (dummySpell->SpellIconID == 2860) |