diff options
author | QAston <none@none> | 2009-08-11 19:57:27 +0200 |
---|---|---|
committer | QAston <none@none> | 2009-08-11 19:57:27 +0200 |
commit | e2e70b936b5fe30cc6c7592c8a6a1e870b9420ad (patch) | |
tree | 70bfad16dcb9dd70ae4674c02aa61fc591c53b60 /src | |
parent | 08d4aac16153c6ea87fb74f129ca1bafbe2a3f6b (diff) |
*Cleanups and obsolete spell handlers remove.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/include/sc_creature.h | 4 | ||||
-rw-r--r-- | src/game/CreatureGroups.h | 2 | ||||
-rw-r--r-- | src/game/OutdoorPvPHP.h | 14 | ||||
-rw-r--r-- | src/game/OutdoorPvPNA.h | 13 | ||||
-rw-r--r-- | src/game/OutdoorPvPSI.h | 14 | ||||
-rw-r--r-- | src/game/OutdoorPvPZM.h | 24 | ||||
-rw-r--r-- | src/game/SharedDefines.h | 12 | ||||
-rw-r--r-- | src/game/Spell.cpp | 9 | ||||
-rw-r--r-- | src/game/Spell.h | 1 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 128 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 251 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 25 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 2 | ||||
-rw-r--r-- | src/game/Unit.cpp | 25 | ||||
-rw-r--r-- | src/game/Unit.h | 3 | ||||
-rw-r--r-- | src/game/Wintergrasp.h | 2 |
16 files changed, 187 insertions, 342 deletions
diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index b4328f2fd66..13d721f01ab 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -189,11 +189,11 @@ struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI bool CanCast(Unit* Target, SpellEntry const *Spell, bool Triggered = false); void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); - + void SetCombatMovement(bool CombatMove); bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); - + protected: bool CombatMovement; diff --git a/src/game/CreatureGroups.h b/src/game/CreatureGroups.h index 8c345aadd40..cc3eacfe185 100644 --- a/src/game/CreatureGroups.h +++ b/src/game/CreatureGroups.h @@ -54,7 +54,7 @@ class CreatureGroup uint32 m_groupID; bool m_Formed; - + public: //Group cannot be created empty explicit CreatureGroup(uint32 id) : m_groupID(id), m_leader(NULL), m_Formed(false) {} diff --git a/src/game/OutdoorPvPHP.h b/src/game/OutdoorPvPHP.h index de543b6c656..3c9b531630b 100644 --- a/src/game/OutdoorPvPHP.h +++ b/src/game/OutdoorPvPHP.h @@ -25,13 +25,13 @@ // HP, citadel, ramparts, blood furnace, shattered halls, mag's lair const uint32 OutdoorPvPHPBuffZones[OutdoorPvPHPBuffZonesNum] = { 3483, 3563, 3562, 3713, 3714, 3836 }; -#define AllianceBuff 32071 - -#define HordeBuff 32049 - -const uint32 AlliancePlayerKillReward = 32155; - -const uint32 HordePlayerKillReward = 32158; +enum OutdoorPvPHPSpells +{ + AlliancePlayerKillReward = 32155, + HordePlayerKillReward = 32158, + AllianceBuff = 32071, + HordeBuff = 32049 +}; enum OutdoorPvPHPTowerType{ HP_TOWER_BROKEN_HILL = 0, diff --git a/src/game/OutdoorPvPNA.h b/src/game/OutdoorPvPNA.h index f10972b5ebf..bfafda34340 100644 --- a/src/game/OutdoorPvPNA.h +++ b/src/game/OutdoorPvPNA.h @@ -22,15 +22,14 @@ // TODO: "sometimes" set to neutral #include "OutdoorPvPImpl.h" - +enum OutdoorPvPNASpells +{ + NA_KILL_TOKEN_ALLIANCE = 33005, + NA_KILL_TOKEN_HORDE = 33004, + NA_CAPTURE_BUFF = 33795 // strength of the halaani +}; // kill credit for pks const uint32 NA_CREDIT_MARKER = 24867; - -const uint32 NA_KILL_TOKEN_ALLIANCE = 33005; -const uint32 NA_KILL_TOKEN_HORDE = 33004; - -const uint32 NA_CAPTURE_BUFF = 33795; // strength of the halaani - const uint32 NA_GUARDS_MAX = 15; const uint32 NA_BUFF_ZONE = 3518; diff --git a/src/game/OutdoorPvPSI.h b/src/game/OutdoorPvPSI.h index 2ef5822ba8e..569e7c62057 100644 --- a/src/game/OutdoorPvPSI.h +++ b/src/game/OutdoorPvPSI.h @@ -21,13 +21,13 @@ #include "OutdoorPvPImpl.h" -const uint32 SI_SILITHYST_FLAG_GO_SPELL = 29518; - -const uint32 SI_SILITHYST_FLAG = 29519; - -const uint32 SI_TRACES_OF_SILITHYST = 29534; - -const uint32 SI_CENARION_FAVOR = 30754; +enum OutdoorPvPSISpells +{ + SI_SILITHYST_FLAG_GO_SPELL = 29518, + SI_SILITHYST_FLAG = 29519, + SI_TRACES_OF_SILITHYST = 29534, + SI_CENARION_FAVOR = 30754 +}; const uint32 SI_MAX_RESOURCES = 200; diff --git a/src/game/OutdoorPvPZM.h b/src/game/OutdoorPvPZM.h index 229dfe268de..fc2c48f4eec 100644 --- a/src/game/OutdoorPvPZM.h +++ b/src/game/OutdoorPvPZM.h @@ -25,20 +25,24 @@ const uint32 OutdoorPvPZMBuffZonesNum = 5; // the buff is cast in these zones const uint32 OutdoorPvPZMBuffZones[OutdoorPvPZMBuffZonesNum] = {3521,3607,3717,3715,3716}; -// cast on the players of the controlling faction -#define ZM_CAPTURE_BUFF 33779 // twin spire blessing -// spell that the field scout casts on the player to carry the flag -const uint32 ZM_BATTLE_STANDARD_A = 32430; -// spell that the field scout casts on the player to carry the flag -const uint32 ZM_BATTLE_STANDARD_H = 32431; // linked when the central tower is controlled const uint32 ZM_GRAVEYARD_ZONE = 3521; // linked when the central tower is controlled const uint32 ZM_GRAVEYARD_ID = 969; -// token create spell -const uint32 ZM_AlliancePlayerKillReward = 32155; -// token create spell -const uint32 ZM_HordePlayerKillReward = 32158; + +enum OutdoorPvPZMSpells +{ + // cast on the players of the controlling faction + ZM_CAPTURE_BUFF = 33779, // twin spire blessing + // spell that the field scout casts on the player to carry the flag + ZM_BATTLE_STANDARD_A = 32430, + // spell that the field scout casts on the player to carry the flag + ZM_BATTLE_STANDARD_H = 32431, + // token create spell + ZM_AlliancePlayerKillReward = 32155, + // token create spell + ZM_HordePlayerKillReward = 32158 +}; // banners 182527, 182528, 182529, gotta check them ingame const go_type ZM_Banner_A = { 182527,530,253.54,7083.81,36.7728,-0.017453,0,0,0.008727,-0.999962 }; diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 987eea769f5..43c8e68c60b 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -209,12 +209,6 @@ enum ItemQualities #define MAX_ITEM_QUALITY 8 -enum SpellCategory -{ - SPELL_CATEGORY_FOOD = 11, - SPELL_CATEGORY_DRINK = 59, -}; - // *********************************** // Spell Attributes definitions // *********************************** @@ -2285,9 +2279,9 @@ enum CorpseDynFlags #define SPELL_ID_WEAPON_SWITCH_COOLDOWN_1_0s 6123 #define SPELL_ID_AUTOSHOT 75 // used for checks in other spells interruption #define SPELL_ID_SHADOWMELD 58984 // used for check ignore stealth stance state -#define SPELL_ID_BLOOD_PRESENCE 48266 // Blood Presence -#define SPELL_ID_FROST_PRESENCE 48263 // Frost Presence -#define SPELL_ID_UNHOLY_PRESENCE 48265 // Unholy Presence +#define SPELL_ID_BLOOD_PRESENCE 48266 // Blood Presence +#define SPELL_ID_FROST_PRESENCE 48263 // Frost Presence +#define SPELL_ID_UNHOLY_PRESENCE 48265 // Unholy Presence enum WeatherType { WEATHER_TYPE_FINE = 0, diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 991b525afa7..d997955710f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4179,9 +4179,12 @@ void Spell::TakeRunePower() { if (plr->GetBaseRune(i) != RUNE_DEATH) { + // Death Rune Mastery if ((*itr)->GetSpellProto()->SpellIconID != 2622) continue; } + // Blood of the North + // Reaping else if ((*itr)->GetSpellProto()->SpellIconID != 3041 && (*itr)->GetSpellProto()->SpellIconID != 22) continue; @@ -4731,7 +4734,7 @@ SpellCastResult Spell::CheckCast(bool strict) else if(m_spellInfo->SpellIconID == 156) // Holy Shock { // spell different for friends and enemies - // hart version required facing + // hurt version required facing if(m_targets.getUnitTarget() && !m_caster->IsFriendlyTo(m_targets.getUnitTarget()) && !m_caster->HasInArc( M_PI, m_targets.getUnitTarget() )) return SPELL_FAILED_UNIT_NOT_INFRONT; } @@ -4744,7 +4747,7 @@ SpellCastResult Spell::CheckCast(bool strict) else if (m_spellInfo->Id == 19938) // Awaken Peon { Unit *unit = m_targets.getUnitTarget(); - if(!unit || !unit->HasAura(17743, 0)) + if(!unit || !unit->HasAura(17743)) return SPELL_FAILED_BAD_TARGETS; } else if (m_spellInfo->Id == 52264) // Deliver Stolen Horse @@ -5224,7 +5227,7 @@ SpellCastResult Spell::CheckPetCast(Unit* target) SpellCastResult Spell::CheckCasterAuras() const { - // spells totally immuned to caster auras ( wsg flag drop, give marks etc + // spells totally immuned to caster auras ( wsg flag drop, give marks etc) if(m_spellInfo->AttributesEx6& SPELL_ATTR_EX6_IGNORE_CASTER_AURAS) return SPELL_CAST_OK; diff --git a/src/game/Spell.h b/src/game/Spell.h index b593bf79881..02256c5447d 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -339,7 +339,6 @@ class Spell void EffectAddExtraAttacks(uint32 i); void EffectSpiritHeal(uint32 i); void EffectSkinPlayerCorpse(uint32 i); - void EffectSummonDemon(uint32 i); void EffectStealBeneficialBuff(uint32 i); void EffectUnlearnSpecialization(uint32 i); void EffectHealPct(uint32 i); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 244b85d38dc..038583bee42 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -944,6 +944,9 @@ void Aura::ApplyAllModifiers(bool apply, bool Real) void Aura::HandleAuraSpecificMods(bool apply) { + //******************** + // MODS AT AURA APPLY + //******************** if (apply) { if(m_spellProto->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT) @@ -958,10 +961,10 @@ void Aura::HandleAuraSpecificMods(bool apply) { int32 value = int32((auraeff->GetAmount()*-1)-10); uint32 defva = uint32(((Player*)caster)->GetSkillValue(SKILL_DEFENSE) + ((Player*)caster)->GetRatingBonusValue(CR_DEFENSE_SKILL)); - + if(defva > 400) value += int32((defva-400)*0.15); - + // Glyph of Icebound Fortitude if (AuraEffect *auradummy = caster->GetAuraEffect(58625,0)) { @@ -1009,8 +1012,30 @@ void Aura::HandleAuraSpecificMods(bool apply) } } } + // Gronn Lord's Grasp, becomes stoned + else if (GetId() == 33572) + { + if (GetStackAmount() >= 5 && !m_target->HasAura(33652)) + m_target->CastSpell(m_target, 33652, true); + } + // Heroic Fury (remove Intercept cooldown) + else if(GetId() == 60970 && m_target->GetTypeId() == TYPEID_PLAYER ) + { + ((Player*)m_target)->RemoveSpellCooldown(20252, true); + } + // Demonic Circle + else if (GetId() == 48020 && m_target->GetTypeId() == TYPEID_PLAYER ) + { + GameObject* obj = m_target->GetGameObject(48018); + if (obj) + ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation()); + } } + //******************************* + // MODS AT AURA APPLY AND REMOVE + //******************************* + // Aura Mastery Triggered Spell Handler // If apply Concentration Aura -> trigger -> apply Aura Mastery Immunity // If remove Concentration Aura -> trigger -> remove Aura Mastery Immunity @@ -1025,7 +1050,7 @@ void Aura::HandleAuraSpecificMods(bool apply) { m_target->CastSpell(m_target,64364,true); return; - } + } } else { @@ -1034,6 +1059,23 @@ void Aura::HandleAuraSpecificMods(bool apply) } } + // Bestial Wrath + if (GetSpellProto()->Id == 19574) + { + // The Beast Within cast on owner if talent present + if ( Unit* owner = m_target->GetOwner() ) + { + // Search talent + if (owner->HasAura(34692)) + { + if (apply) + owner->CastSpell(owner, 34471, true, 0, GetPartAura(0)); + else + owner->RemoveAurasDueToSpell(34471); + } + } + } + if (GetSpellSpecific(m_spellProto->Id) == SPELL_PRESENCE) { AuraEffect *bloodPresenceAura=0; // healing by damage done @@ -2057,20 +2099,6 @@ void AuraEffect::TriggerSpell() // trigger_spell_id not set and unknown effect triggered in this case, ignoring for while case 768: return; - // Frenzied Regeneration - case 22842: - case 26999: - { - int32 LifePerRage = GetAmount(); - - int32 lRage = m_target->GetPower(POWER_RAGE); - if(lRage > 100) // rage stored as rage*10 - lRage = 100; - m_target->ModifyPower(POWER_RAGE, -lRage); - int32 FRTriggerBasePoints = int32(lRage*LifePerRage/10); - m_target->CastCustomSpell(m_target,22845,&FRTriggerBasePoints,NULL,NULL,true,NULL,this); - return; - } default: break; } @@ -2434,7 +2462,7 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount) case 46308: // Burning Winds casted only at creatures at spawn m_target->CastSpell(m_target,47287,true,NULL,this); return; - case 52173: // Coyote Spirit Despawn Aura + case 52172: // Coyote Spirit Despawn Aura case 60244: // Blood Parrot Despawn Aura m_target->CastSpell((Unit*)NULL, GetAmount(), true, NULL, this); return; @@ -3018,15 +3046,8 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun { // get furor proc chance int32 FurorChance = 0; - Unit::AuraEffectList const& mDummy = m_target->GetAurasByType(SPELL_AURA_DUMMY); - for(Unit::AuraEffectList::const_iterator i = mDummy.begin(); i != mDummy.end(); ++i) - { - if ((*i)->GetSpellProto()->SpellIconID == 238) - { - FurorChance = (*i)->GetAmount(); - break; - } - } + if(AuraEffect const * dummy = m_target->GetDummyAura(SPELLFAMILY_DRUID, 238, 0)) + FurorChance = dummy->GetAmount(); if (GetMiscValue() == FORM_CAT) { @@ -4082,16 +4103,6 @@ void AuraEffect::HandleAuraModDecreaseSpeed(bool apply, bool Real, bool changeAm if(!Real && !changeAmount) return; - if (apply) - { - // Gronn Lord's Grasp, becomes stoned - if (GetId() == 33572) - { - if (GetParentAura()->GetStackAmount() >= 5 && !m_target->HasAura(33652)) - m_target->CastSpell(m_target, 33652, true); - } - } - m_target->UpdateSpeed(MOVE_RUN, true); m_target->UpdateSpeed(MOVE_SWIM, true); m_target->UpdateSpeed(MOVE_FLIGHT, true); @@ -4199,29 +4210,8 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA m_target->ApplySpellImmune(GetId(),IMMUNITY_MECHANIC,GetMiscValue(),apply); - // Bestial Wrath - if (GetSpellProto()->Id == 19574) - { - // The Beast Within cast on owner if talent present - if ( Unit* owner = m_target->GetOwner() ) - { - // Search talent - if (owner->GetAuraEffect(34692, 0)) - { - if (apply) - owner->CastSpell(owner, 34471, true, 0, this); - else - owner->RemoveAurasDueToSpell(34471); - } - } - } - // Heroic Fury (remove Intercept cooldown) - else if( apply && GetId() == 60970 && m_target->GetTypeId() == TYPEID_PLAYER ) - { - ((Player*)m_target)->RemoveSpellCooldown(20252, true); - } // Demonic Empowerment -- voidwalker -- missing movement impairing effects immunity - else if (GetId() == 54508) + if (GetId() == 54508) { if (apply) m_target->RemoveMovementImpairingAuras(); @@ -4229,18 +4219,6 @@ void AuraEffect::HandleModMechanicImmunity(bool apply, bool Real, bool /*changeA m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_ROOT,apply); m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,SPELL_AURA_MOD_DECREASE_SPEED,apply); } - // Demonic Circle - else if (GetId() == 48020) - { - if (m_target->GetTypeId() != TYPEID_PLAYER) - return; - if (apply) - { - GameObject* obj = m_target->GetGameObject(48018); - if (obj) - ((Player*)m_target)->TeleportTo(obj->GetMapId(),obj->GetPositionX(),obj->GetPositionY(),obj->GetPositionZ(),obj->GetOrientation()); - } - } } void AuraEffect::HandleAuraModEffectImmunity(bool apply, bool Real, bool /*changeAmount*/) @@ -4341,7 +4319,7 @@ void AuraEffect::HandleAuraProcTriggerSpell(bool apply, bool Real, bool /*change { SpellModifier *mod = new SpellModifier; mod->op = SPELLMOD_EFFECT2; - mod->value = (GetId() == 51466) ? 5 : 10; + mod->value = m_target->CalculateSpellDamage(GetSpellProto(), 1, GetSpellProto()->EffectBasePoints[1], m_target); mod->type = SPELLMOD_FLAT; mod->spellId = GetId(); mod->mask[1] = 0x0004000; @@ -6356,11 +6334,6 @@ void AuraEffect::PeriodicTick() // eating anim m_target->HandleEmoteCommand(EMOTE_ONESHOT_EAT); } - else if( GetId() == 20577 ) - { - // cannibalize anim - m_target->HandleEmoteCommand(EMOTE_STATE_CANNIBALIZE); - } // Butchery else if (m_spellProto->SpellFamilyName==SPELLFAMILY_DEATHKNIGHT && m_spellProto->SpellIconID==2664) @@ -6431,7 +6404,6 @@ void AuraEffect::PeriodicDummyTick() case 34291: case 43182: case 43183: - case 43706: case 46755: case 49472: // Drink Coffee case 57073: diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5b1179c0ed8..3a45b57c9a3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -669,34 +669,6 @@ void Spell::EffectDummy(uint32 i) m_caster->DealDamage(casttarget, damage, NULL, SPELL_DIRECT_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, spellInfo, false); } } - // Encapsulate Voidwalker - case 29364: - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT || ((Creature*)unitTarget)->isPet()) return; - - GameObject* pGameObj = new GameObject; - - if (!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 181574, unitTarget->GetMap(), unitTarget->GetPhaseMask(), - unitTarget->GetPositionX(), unitTarget->GetPositionY(), unitTarget->GetPositionZ(), - unitTarget->GetOrientation(), 0, 0, 0, 0, 100, GO_STATE_READY)) - { - delete pGameObj; - return; - } - - pGameObj->SetRespawnTime(0); - pGameObj->SetOwnerGUID(m_caster->GetGUID()); - //pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); - pGameObj->SetSpellId(m_spellInfo->Id); - - unitTarget->GetMap()->Add(pGameObj); - - WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8); - data << uint64(pGameObj->GetGUID()); - m_caster->SendMessageToSet(&data,true); - - return; - } // Demon Broiled Surprise case 43723: { @@ -1416,25 +1388,16 @@ void Spell::EffectDummy(uint32 i) int32 mana = damage; // Improved Life Tap mod - Unit::AuraEffectList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY); - for(Unit::AuraEffectList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr) - { - if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 208) - mana = ((*itr)->GetAmount() + 100)* mana / 100; - } + if (AuraEffect const * aurEff = m_caster->GetDummyAura(SPELLFAMILY_WARLOCK, 208, 0)) + mana = (aurEff->GetAmount() + 100)* mana / 100; + m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, true); // Mana Feed int32 manaFeedVal = 0; - Unit::AuraEffectList const& mod = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER); - for(Unit::AuraEffectList::const_iterator itr = mod.begin(); itr != mod.end(); ++itr) - { - if((*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_WARLOCK && (*itr)->GetSpellProto()->SpellIconID == 1982) - { - manaFeedVal = (*itr)->GetAmount(); - break; - } - } + if (AuraEffect const * aurEff = m_caster->GetAuraEffect(SPELL_AURA_ADD_FLAT_MODIFIER, SPELLFAMILY_WARLOCK, 1982, 0)) + manaFeedVal = aurEff->GetAmount(); + if(manaFeedVal > 0) { manaFeedVal = manaFeedVal * mana / 100; @@ -2933,6 +2896,9 @@ void Spell::EffectEnergize(uint32 i) case 31930: // Judgements of the Wise case 63375: // Improved Stormstrike damage = damage * unitTarget->GetCreateMana() / 100; + case 48542: // Revitalize + damage = damage * unitTarget->GetMaxPower(power) / 100; + break; default: break; } @@ -2946,12 +2912,6 @@ void Spell::EffectEnergize(uint32 i) if(unitTarget->GetMaxPower(power) == 0) return; - // Spells which use pct of max mana, but have wrong effect - if (m_spellInfo->Id == 48542) - { - damage = damage * unitTarget->GetMaxPower(power) / 100; - } - m_caster->EnergizeBySpell(unitTarget, m_spellInfo->Id, damage, power); // Mad Alchemist's Potion @@ -4305,9 +4265,10 @@ void Spell::SpellDamageWeaponDmg(uint32 i) else if(m_spellInfo->SpellFamilyFlags[1] & 0x40000) { // 50% more damage with daggers - if (Item* item = ((Player*)m_caster)->GetWeaponForAttack(m_attackType)) - if (item->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER) - totalDamagePercentMod *= 1.5f; + if(m_caster->GetTypeId()==TYPEID_PLAYER) + if (Item* item = ((Player*)m_caster)->GetWeaponForAttack(m_attackType, true)) + if (item->GetProto()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER) + totalDamagePercentMod *= 1.5f; } // Mutilate (for each hand) else if(m_spellInfo->SpellFamilyFlags[1] & 0x6) @@ -4363,7 +4324,7 @@ void Spell::SpellDamageWeaponDmg(uint32 i) case SPELLFAMILY_DRUID: { // Mangle (Cat): CP - if(m_spellInfo->SpellFamilyFlags.IsEqual(0,0x00000400)) + if(m_spellInfo->SpellFamilyFlags[1] & 0x400) { if(m_caster->GetTypeId()==TYPEID_PLAYER) ((Player*)m_caster)->AddComboPoints(unitTarget,1, this); @@ -4669,9 +4630,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) // Dispelling Analysis case 37028: { - if (unitTarget->HasAura(36904)) - unitTarget->RemoveAurasDueToSpell(36904); - + unitTarget->RemoveAurasDueToSpell(36904); return; } case 45204: // Clone Me! @@ -4789,22 +4748,6 @@ void Spell::EffectScriptEffect(uint32 effIndex) m_caster->CastSpell(unitTarget, 22682, true); return; } - // Summon Black Qiraji Battle Tank - case 26656: - { - if(!unitTarget) - return; - - // Prevent stacking of mounts - unitTarget->RemoveAurasByType(SPELL_AURA_MOUNTED); - - // Two separate mounts depending on area id (allows use both in and out of specific instance) - if (unitTarget->GetAreaId() == 3428) - unitTarget->CastSpell(unitTarget, 25863, false); - else - unitTarget->CastSpell(unitTarget, 26655, false); - return; - } // Piccolo of the Flaming Fire case 17512: { @@ -4818,9 +4761,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) { if(!unitTarget) return; - // It is said that removing effects by script should include dispel resist mods - unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_ROOT, this); - unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this); + unitTarget->RemoveMovementImpairingAuras(); return; } // Decimate @@ -4857,26 +4798,10 @@ void Spell::EffectScriptEffect(uint32 effIndex) case 30918: { // Removes snares and roots. - uint32 mechanic_mask = (1<<MECHANIC_ROOT) | (1<<MECHANIC_SNARE); - Unit::AuraMap& Auras = unitTarget->GetAuras(); - for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end();) - { - Aura *aur = iter->second; - if (!aur->IsPositive()) //only remove negative spells - { - // check for mechanic mask - if(GetAllSpellMechanicMask(aur->GetSpellProto()) & mechanic_mask) - { - unitTarget->RemoveAura(iter); - } - else - iter++; - } - else - iter++; - } + unitTarget->RemoveMovementImpairingAuras(); break; } + // Tidal Surge case 38358: if(unitTarget) m_caster->CastSpell(unitTarget, 38353, true); @@ -4930,6 +4855,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) } break; } + // Mug Transformation case 41931: { if(m_caster->GetTypeId() != TYPEID_PLAYER) @@ -4968,27 +4894,26 @@ void Spell::EffectScriptEffect(uint32 effIndex) unitTarget->CastSpell(unitTarget, 44870, true); break; - } + } // spell of Brutallus - Stomp case 45185: { - if(!unitTarget) - return; + if(!unitTarget) + return; - if(unitTarget->HasAura(46394)) // spell of Brutallus - Burn - unitTarget->RemoveAurasDueToSpell(46394); + unitTarget->RemoveAurasDueToSpell(46394); - break; + break; } // Negative Energy case 46289: { if(!unitTarget) return; - + m_caster->CastSpell(unitTarget, 46285, true); break; - } + } // Goblin Weather Machine case 46203: { @@ -5027,6 +4952,43 @@ void Spell::EffectScriptEffect(uint32 effIndex) return; } + // Death Knight Initiate Visual + case 51519: + { + if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) + return; + + uint32 iTmpSpellId = 0; + switch (unitTarget->GetDisplayId()) + { + case 25369: iTmpSpellId = 51552; break; // bloodelf female + case 25373: iTmpSpellId = 51551; break; // bloodelf male + case 25363: iTmpSpellId = 51542; break; // draenei female + case 25357: iTmpSpellId = 51541; break; // draenei male + case 25361: iTmpSpellId = 51537; break; // dwarf female + case 25356: iTmpSpellId = 51538; break; // dwarf male + case 25372: iTmpSpellId = 51550; break; // forsaken female + case 25367: iTmpSpellId = 51549; break; // forsaken male + case 25362: iTmpSpellId = 51540; break; // gnome female + case 25359: iTmpSpellId = 51539; break; // gnome male + case 25355: iTmpSpellId = 51534; break; // human female + case 25354: iTmpSpellId = 51520; break; // human male + case 25360: iTmpSpellId = 51536; break; // nightelf female + case 25358: iTmpSpellId = 51535; break; // nightelf male + case 25368: iTmpSpellId = 51544; break; // orc female + case 25364: iTmpSpellId = 51543; break; // orc male + case 25371: iTmpSpellId = 51548; break; // tauren female + case 25366: iTmpSpellId = 51547; break; // tauren male + case 25370: iTmpSpellId = 51545; break; // troll female + case 25365: iTmpSpellId = 51546; break; // troll male + default: return; + } + + unitTarget->CastSpell(unitTarget, iTmpSpellId, true); + Creature* npc = (Creature*)unitTarget; + npc->LoadEquipment(npc->GetEquipmentId()); + return; + } // Emblazon Runeblade case 51770: { @@ -5251,19 +5213,22 @@ void Spell::EffectScriptEffect(uint32 effIndex) { uint32 itemtype; uint32 rank = 0; - Unit::AuraEffectList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY); - for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i) + + // Improved Healthstone + if (AuraEffect const * aurEff = unitTarget->GetDummyAura(SPELLFAMILY_WARLOCK, 284, 0)) { - if((*i)->GetId() == 18692) + if(aurEff->GetId() == 18692) { rank = 1; break; } - else if((*i)->GetId() == 18693) + else if(aurEff->GetId() == 18693) { rank = 2; break; } + else + sLog.outError("Unknown rank of Improved Healthstone id: %f", aurEff->GetId()); } static uint32 const itypes[8][3] = { @@ -5511,43 +5476,6 @@ void Spell::EffectScriptEffect(uint32 effIndex) { switch(m_spellInfo->Id) { - // Death Knight Initiate Visual - case 51519: - { - if(!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT) - return; - - uint32 iTmpSpellId = 0; - switch (unitTarget->GetDisplayId()) - { - case 25369: iTmpSpellId = 51552; break; // bloodelf female - case 25373: iTmpSpellId = 51551; break; // bloodelf male - case 25363: iTmpSpellId = 51542; break; // draenei female - case 25357: iTmpSpellId = 51541; break; // draenei male - case 25361: iTmpSpellId = 51537; break; // dwarf female - case 25356: iTmpSpellId = 51538; break; // dwarf male - case 25372: iTmpSpellId = 51550; break; // forsaken female - case 25367: iTmpSpellId = 51549; break; // forsaken male - case 25362: iTmpSpellId = 51540; break; // gnome female - case 25359: iTmpSpellId = 51539; break; // gnome male - case 25355: iTmpSpellId = 51534; break; // human female - case 25354: iTmpSpellId = 51520; break; // human male - case 25360: iTmpSpellId = 51536; break; // nightelf female - case 25358: iTmpSpellId = 51535; break; // nightelf male - case 25368: iTmpSpellId = 51544; break; // orc female - case 25364: iTmpSpellId = 51543; break; // orc male - case 25371: iTmpSpellId = 51548; break; // tauren female - case 25366: iTmpSpellId = 51547; break; // tauren male - case 25370: iTmpSpellId = 51545; break; // troll female - case 25365: iTmpSpellId = 51546; break; // troll male - default: return; - } - - unitTarget->CastSpell(unitTarget, iTmpSpellId, true); - Creature* npc = (Creature*)unitTarget; - npc->LoadEquipment(npc->GetEquipmentId()); - return; - } // Dreaming Glory case 28698: { @@ -5572,7 +5500,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) // don't overwrite an existing aura for(uint8 i = 0; i < 5; ++i) - if(unitTarget->HasAuraEffect(spellid + i, 0)) + if(unitTarget->HasAura(spellid + i)) return; unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true); break; @@ -5620,7 +5548,7 @@ void Spell::EffectScriptEffect(uint32 effIndex) if(!unitTarget) return; // remove shields, will still display immune to damage part - unitTarget->RemoveAurasWithMechanic(1<<MECHANIC_IMMUNE_SHIELD); + unitTarget->RemoveAurasWithMechanic(1<<MECHANIC_IMMUNE_SHIELD, AURA_REMOVE_BY_ENEMY_SPELL); return; } break; @@ -6358,7 +6286,7 @@ void Spell::EffectJump2(uint32 i) else { //1891: Disengage - m_caster->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891); + m_caster->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891); } } @@ -6717,39 +6645,6 @@ void Spell::EffectSkill(uint32 /*i*/) sLog.outDebug("WORLD: SkillEFFECT"); } -void Spell::EffectSummonDemon(uint32 i) -{ - float radius = GetSpellRadiusForFriend(sSpellRadiusStore.LookupEntry(m_spellInfo->EffectRadiusIndex[i])); - - int32 amount = damage > 0 ? damage : 1; - - for(uint32 count = 0; count < amount; ++count) - { - float px, py, pz; - GetSummonPosition(i, px, py, pz, radius, count); - - int32 duration = GetSpellDuration(m_spellInfo); - - Creature* Charmed = m_caster->SummonCreature(m_spellInfo->EffectMiscValue[i], px, py, pz, m_caster->GetOrientation(),TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,duration); - if (!Charmed) // something fatal, not attempt more - return; - - // might not always work correctly, maybe the creature that dies from CoD casts the effect on itself and is therefore the caster? - Charmed->SetLevel(m_caster->getLevel()); - - // TODO: Add damage/mana/hp according to level - - if (m_spellInfo->EffectMiscValue[i] == 89) // Inferno summon - { - // Enslave demon effect, without mana cost and cooldown - m_caster->CastSpell(Charmed, 20882, true); // FIXME: enslave does not scale with level, level 62+ minions cannot be enslaved - - // Inferno effect - Charmed->CastSpell(Charmed, 22703, true, 0); - } - } -} - /* There is currently no need for this effect. We handle it in BattleGround.cpp If we would handle the resurrection here, the spiritguide would instantly disappear as the player revives, and so we wouldn't see the spirit heal visual effect on the npc. diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index c353bc9fa6d..b1e5279166a 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -50,7 +50,6 @@ SpellMgr::SpellMgr() case SPELL_EFFECT_SUMMON_OBJECT_SLOT3: //106 case SPELL_EFFECT_SUMMON_OBJECT_SLOT4: //107 case SPELL_EFFECT_SUMMON_DEAD_PET: //109 - //case SPELL_EFFECT_SUMMON_DEMON: //112 not 303 case SPELL_EFFECT_TRIGGER_SPELL_2: //151 ritual of summon EffectTargetType[i] = SPELL_REQUIRE_DEST; break; @@ -408,7 +407,7 @@ AuraState GetSpellAuraState(SpellEntry const * spellInfo) { // Seals if (IsSealSpell(spellInfo)) - return (AURA_STATE_JUDGEMENT); + return AURA_STATE_JUDGEMENT; // Conflagrate aura state on Immolate and Shadowflame if (spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && @@ -416,35 +415,35 @@ AuraState GetSpellAuraState(SpellEntry const * spellInfo) ((spellInfo->SpellFamilyFlags[0] & 4) || // Shadowflame (spellInfo->SpellFamilyFlags[2] & 2))) - return (AURA_STATE_CONFLAGRATE); + return AURA_STATE_CONFLAGRATE; // Faerie Fire (druid versions) if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && spellInfo->SpellFamilyFlags[0] & 0x400) - return (AURA_STATE_FAERIE_FIRE); + return AURA_STATE_FAERIE_FIRE; // Sting (hunter's pet ability) if (spellInfo->Category == 1133) - return (AURA_STATE_FAERIE_FIRE); + return AURA_STATE_FAERIE_FIRE; // Victorious if (spellInfo->SpellFamilyName == SPELLFAMILY_WARRIOR && spellInfo->SpellFamilyFlags[1] & 0x00040000) - return (AURA_STATE_WARRIOR_VICTORY_RUSH); + return AURA_STATE_WARRIOR_VICTORY_RUSH; // Swiftmend state on Regrowth & Rejuvenation if (spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && spellInfo->SpellFamilyFlags[0] & 0x50 ) - return (AURA_STATE_SWIFTMEND); + return AURA_STATE_SWIFTMEND; // Deadly poison aura state if(spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && spellInfo->SpellFamilyFlags[0] & 0x10000) - return (AURA_STATE_DEADLY_POISON); + return AURA_STATE_DEADLY_POISON; // Enrage aura state if(spellInfo->Dispel == DISPEL_ENRAGE) - return (AURA_STATE_ENRAGE); + return AURA_STATE_ENRAGE; // Bleeding aura state if (GetAllSpellMechanicMask(spellInfo) & 1<<MECHANIC_BLEED) - return (AURA_STATE_BLEEDING); + return AURA_STATE_BLEEDING; if(GetSpellSchoolMask(spellInfo) & SPELL_SCHOOL_MASK_FROST) { @@ -452,10 +451,7 @@ AuraState GetSpellAuraState(SpellEntry const * spellInfo) { if (spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_STUN || spellInfo->EffectApplyAuraName[i]==SPELL_AURA_MOD_ROOT) - { - return (AURA_STATE_FROZEN); - break; - } + return AURA_STATE_FROZEN; } } return AURA_STATE_NONE; @@ -3649,6 +3645,7 @@ void SpellMgr::LoadSpellCustomAttr() case 42384: // Brutal Swipe case 45150: // Meteor Slash case 64422: case 64688: // Sonic Screech + // ONLY SPELLS WITH SPELLFAMILY_GENERIC and EFFECT_SCHOOL_DAMAGE mSpellCustomAttr[i] |= SPELL_ATTR_CU_SHARE_DAMAGE; break; case 59725: // Improved Spell Reflection - aoe aura diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index e651283fa48..af1652d85e0 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -46,6 +46,8 @@ enum SpellCategories SPELLCATEGORY_HEALTH_MANA_POTIONS = 4, SPELLCATEGORY_DEVOUR_MAGIC = 12, SPELLCATEGORY_JUDGEMENT = 1210, // Judgement (seal trigger) + SPELLCATEGORY_FOOD = 11, + SPELLCATEGORY_DRINK = 59, }; enum SpellDisableTypes diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index e372aafd7c0..22cb8895d89 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -553,7 +553,7 @@ void Unit::RemoveAurasWithFamily(uint32 family, uint32 familyFlag1, uint32 famil } } -void Unit::RemoveAurasWithMechanic(uint32 mechanic_mask, uint32 except) +void Unit::RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode, uint32 except) { for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end();) { @@ -561,7 +561,7 @@ void Unit::RemoveAurasWithMechanic(uint32 mechanic_mask, uint32 except) { if(GetAllSpellMechanicMask(iter->second->GetSpellProto()) & mechanic_mask) { - RemoveAura(iter, AURA_REMOVE_BY_ENEMY_SPELL); + RemoveAura(iter, removemode); continue; } } @@ -4220,24 +4220,6 @@ void Unit::RemoveAurasByType(AuraType auraType, uint64 casterGUID, Aura * except } } -void Unit::RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell) -{ - std::queue < std::pair < uint32, uint64 > > remove_list; - - for (AuraEffectList::iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();++iter) - { - if(GetDispelChance((*iter)->GetCaster(), (*iter)->GetId())) - { - remove_list.push(std::make_pair((*iter)->GetId(), (*iter)->GetCasterGUID() ) ); - } - } - - for(;remove_list.size();remove_list.pop()) - { - RemoveAura(remove_list.front().first, remove_list.front().second, AURA_REMOVE_BY_ENEMY_SPELL); - } -} - void Unit::RemoveNotOwnSingleTargetAuras(uint32 newPhase) { // single target auras from other casters @@ -5910,8 +5892,7 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger case 47570: case 47569: { - RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_ROOT); - RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_DECREASE_SPEED); + RemoveMovementImpairingAuras(); break; } // Rapture diff --git a/src/game/Unit.h b/src/game/Unit.h index 9ae293a577a..26344480c8d 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1449,7 +1449,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer); void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId); void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except=NULL, bool negative = true, bool positive = true); - void RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell = NULL); void RemoveNotOwnSingleTargetAuras(uint32 newPhase = 0x0); void RemoveSpellsCausingAura(AuraType auraType); @@ -1458,7 +1457,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL); void RemoveAurasWithFamily(uint32 family, uint32 familyFlag1, uint32 familyFlag2, uint32 familyFlag3, uint64 casterGUID); void RemoveMovementImpairingAuras(); - void RemoveAurasWithMechanic(uint32 mechanic_mask, uint32 except=0); + void RemoveAurasWithMechanic(uint32 mechanic_mask, AuraRemoveMode removemode = AURA_REMOVE_BY_DEFAULT, uint32 except=0); void RemoveAllAuras(); void RemoveArenaAuras(bool onleave = false); void RemoveAllAurasOnDeath(); diff --git a/src/game/Wintergrasp.h b/src/game/Wintergrasp.h index b9d67a5431a..8b18061845a 100644 --- a/src/game/Wintergrasp.h +++ b/src/game/Wintergrasp.h @@ -44,7 +44,7 @@ const uint32 WintergraspFaction[2] = {1732, 1735}; const uint32 WG_KEEP_CM = 0; //Need data const uint32 WG_RULERS_BUFF = 52108; -//some cosmetics :D +//some cosmetics : const uint32 WG_VICTORY_AURA = 60044; enum OutdoorPvP_WG_Sounds |