Show
Ignore:
Timestamp:
11/22/08 00:35:41 (17 years ago)
Author:
yumileroy
Message:

Delete possessed AI only on creature delete.

Original author: gvcoman
Date: 2008-11-16 14:38:02-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/SpellAuras.cpp

    r257 r272  
    171171    &Aura::HandleNoImmediateEffect,                         //113 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN implemented in Unit::MeleeDamageBonus 
    172172    &Aura::HandleNoImmediateEffect,                         //114 SPELL_AURA_MOD_RANGED_DAMAGE_TAKEN_PCT implemented in Unit::MeleeDamageBonus 
    173     &Aura::HandleNoImmediateEffect,                         //115 SPELL_AURA_MOD_HEALING                 implemented in Unit::SpellBaseHealingBonusForVictim 
     173    &Aura::HandleAuraHealing,                               //115 SPELL_AURA_MOD_HEALING 
    174174    &Aura::HandleNoImmediateEffect,                         //116 SPELL_AURA_MOD_REGEN_DURING_COMBAT 
    175175    &Aura::HandleNoImmediateEffect,                         //117 SPELL_AURA_MOD_MECHANIC_RESISTANCE     implemented in Unit::MagicSpellHitResult 
    176     &Aura::HandleNoImmediateEffect,                         //118 SPELL_AURA_MOD_HEALING_PCT             implemented in Unit::SpellHealingBonus 
     176    &Aura::HandleAuraHealingPct,                            //118 SPELL_AURA_MOD_HEALING_PCT 
    177177    &Aura::HandleUnused,                                    //119 SPELL_AURA_SHARE_PET_TRACKING useless 
    178178    &Aura::HandleAuraUntrackable,                           //120 SPELL_AURA_UNTRACKABLE 
     
    192192    &Aura::HandleAuraModRegenInterrupt,                     //134 SPELL_AURA_MOD_MANA_REGEN_INTERRUPT 
    193193    &Aura::HandleModHealingDone,                            //135 SPELL_AURA_MOD_HEALING_DONE 
    194     &Aura::HandleNoImmediateEffect,                         //136 SPELL_AURA_MOD_HEALING_DONE_PERCENT   implemented in Unit::SpellHealingBonus 
     194    &Aura::HandleAuraHealingPct,                            //136 SPELL_AURA_MOD_HEALING_DONE_PERCENT   implemented in Unit::SpellHealingBonus 
    195195    &Aura::HandleModTotalPercentStat,                       //137 SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE 
    196196    &Aura::HandleHaste,                                     //138 SPELL_AURA_MOD_HASTE 
     
    221221    &Aura::HandleNoImmediateEffect,                         //163 SPELL_AURA_MOD_CRIT_DAMAGE_BONUS_MELEE 
    222222    &Aura::HandleUnused,                                    //164 useless, only one test spell 
    223     &Aura::HandleNoImmediateEffect,                         //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus 
     223    &Aura::HandleAuraAttackPowerAttacker,                   //165 SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS implemented in Unit::MeleeDamageBonus 
    224224    &Aura::HandleAuraModAttackPowerPercent,                 //166 SPELL_AURA_MOD_ATTACK_POWER_PCT 
    225225    &Aura::HandleAuraModRangedAttackPowerPercent,           //167 SPELL_AURA_MOD_RANGED_ATTACK_POWER_PCT 
     
    20002000        } 
    20012001 
    2002         // Waiting to Resurrect 
    2003         if(GetId()==2584) 
    2004         { 
    2005             // Waiting to resurrect spell cancel, we must remove player from resurrect queue 
    2006             if(m_target->GetTypeId() == TYPEID_PLAYER) 
    2007                 if(BattleGround *bg = ((Player*)m_target)->GetBattleGround()) 
    2008                     bg->RemovePlayerFromResurrectQueue(m_target->GetGUID()); 
    2009             return; 
    2010         } 
    2011  
    20122002        // Dark Fiend 
    20132003        if(GetId()==45934) 
     
    23052295void Aura::HandleAuraMounted(bool apply, bool Real) 
    23062296{ 
    2307     // only at real add/remove aura 
    2308     if(!Real) 
    2309         return; 
    2310  
    23112297    if(apply) 
    23122298    { 
     
    27082694            else 
    27092695            { 
    2710                                                             // Will use the default model here 
    2711                 if (uint32 modelid = ci->GetRandomValidModelId()) 
    2712                     m_target->SetDisplayId(modelid); 
     2696                if (uint32 modelid = ci->GetRandomValidModelId()) m_target->SetDisplayId(modelid); 
    27132697 
    27142698                // Dragonmaw Illusion (set mount model also) 
     
    36063590/***                  MODIFY SPEED                     ***/ 
    36073591/*********************************************************/ 
    3608 void Aura::HandleAuraModIncreaseSpeed(bool /*apply*/, bool Real) 
     3592void Aura::HandleAuraModIncreaseSpeed(bool apply, bool Real) 
    36093593{ 
    36103594    // all applied/removed only at real aura add/remove 
     
    36153599} 
    36163600 
    3617 void Aura::HandleAuraModIncreaseMountedSpeed(bool /*apply*/, bool Real) 
     3601void Aura::HandleAuraModIncreaseMountedSpeed(bool apply, bool Real) 
    36183602{ 
    36193603    // all applied/removed only at real aura add/remove 
     
    36543638} 
    36553639 
    3656 void Aura::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real) 
     3640void Aura::HandleAuraModIncreaseSwimSpeed(bool apply, bool Real) 
    36573641{ 
    36583642    // all applied/removed only at real aura add/remove 
     
    36633647} 
    36643648 
    3665 void Aura::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real) 
     3649void Aura::HandleAuraModDecreaseSpeed(bool apply, bool Real) 
    36663650{ 
    36673651    // all applied/removed only at real aura add/remove 
     
    36743658} 
    36753659 
    3676 void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real) 
     3660void Aura::HandleAuraModUseNormalSpeed(bool apply, bool Real) 
    36773661{ 
    36783662    // all applied/removed only at real aura add/remove 
     
    43594343} 
    43604344 
    4361 void Aura::HandleModSpellDamagePercentFromStat(bool /*apply*/, bool Real) 
     4345void Aura::HandleModSpellDamagePercentFromStat(bool apply, bool Real) 
    43624346{ 
    43634347    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    43704354} 
    43714355 
    4372 void Aura::HandleModSpellHealingPercentFromStat(bool /*apply*/, bool Real) 
     4356void Aura::HandleModSpellHealingPercentFromStat(bool apply, bool Real) 
    43734357{ 
    43744358    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    43884372} 
    43894373 
    4390 void Aura::HandleModSpellDamagePercentFromAttackPower(bool /*apply*/, bool Real) 
     4374void Aura::HandleModSpellDamagePercentFromAttackPower(bool apply, bool Real) 
    43914375{ 
    43924376    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    43994383} 
    44004384 
    4401 void Aura::HandleModSpellHealingPercentFromAttackPower(bool /*apply*/, bool Real) 
     4385void Aura::HandleModSpellHealingPercentFromAttackPower(bool apply, bool Real) 
    44024386{ 
    44034387    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    44084392} 
    44094393 
    4410 void Aura::HandleModHealingDone(bool /*apply*/, bool Real) 
     4394void Aura::HandleModHealingDone(bool apply, bool Real) 
    44114395{ 
    44124396    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    44484432} 
    44494433 
    4450 void Aura::HandleAuraModResistenceOfStatPercent(bool /*apply*/, bool Real) 
     4434void Aura::HandleAuraModResistenceOfStatPercent(bool apply, bool Real) 
    44514435{ 
    44524436    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    45834567} 
    45844568 
    4585 void Aura::HandleModPowerRegenPCT(bool /*apply*/, bool Real) 
     4569void Aura::HandleModPowerRegenPCT(bool apply, bool Real) 
    45864570{ 
    45874571    // spells required only Real aura add/remove 
     
    45974581} 
    45984582 
    4599 void Aura::HandleModManaRegen(bool /*apply*/, bool Real) 
     4583void Aura::HandleModManaRegen(bool apply, bool Real) 
    46004584{ 
    46014585    // spells required only Real aura add/remove 
     
    46844668/********************************/ 
    46854669 
    4686 void Aura::HandleAuraModParryPercent(bool /*apply*/, bool Real) 
     4670void Aura::HandleAuraModParryPercent(bool apply, bool Real) 
    46874671{ 
    46884672    if(m_target->GetTypeId()!=TYPEID_PLAYER) 
     
    46924676} 
    46934677 
    4694 void Aura::HandleAuraModDodgePercent(bool /*apply*/, bool Real) 
     4678void Aura::HandleAuraModDodgePercent(bool apply, bool Real) 
    46954679{ 
    46964680    if(m_target->GetTypeId()!=TYPEID_PLAYER) 
     
    47014685} 
    47024686 
    4703 void Aura::HandleAuraModBlockPercent(bool /*apply*/, bool Real) 
     4687void Aura::HandleAuraModBlockPercent(bool apply, bool Real) 
    47044688{ 
    47054689    if(m_target->GetTypeId()!=TYPEID_PLAYER) 
     
    47104694} 
    47114695 
    4712 void Aura::HandleAuraModRegenInterrupt(bool /*apply*/, bool Real) 
     4696void Aura::HandleAuraModRegenInterrupt(bool apply, bool Real) 
    47134697{ 
    47144698    // spells required only Real aura add/remove 
     
    47784762} 
    47794763 
    4780 void Aura::HandleModSpellCritChanceShool(bool /*apply*/, bool Real) 
     4764void Aura::HandleModSpellCritChanceShool(bool apply, bool Real) 
    47814765{ 
    47824766    // spells required only Real aura add/remove 
     
    48584842 
    48594843    m_target->HandleStatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     4844} 
     4845 
     4846void Aura::HandleAuraAttackPowerAttacker(bool apply, bool Real) 
     4847{ 
     4848    // spells required only Real aura add/remove 
     4849    if(!Real) 
     4850        return; 
     4851    Unit *caster = GetCaster(); 
     4852 
     4853    if (!caster) 
     4854        return; 
     4855 
     4856    // Hunter's Mark 
     4857    if (m_spellProto->SpellFamilyName == SPELLFAMILY_HUNTER && m_spellProto->SpellFamilyFlags & 0x0000000000000400LL) 
     4858    { 
     4859        // Check Improved Hunter's Mark bonus on caster 
     4860        Unit::AuraList const& mOverrideClassScript = caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS); 
     4861        for(Unit::AuraList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i) 
     4862        { 
     4863            Modifier* mod = (*i)->GetModifier(); 
     4864            // mproved Hunter's Mark script from 5236 to 5240 
     4865            if (mod->m_miscvalue >= 5236 && mod->m_miscvalue <= 5240) 
     4866            { 
     4867                // Get amount of ranged bonus for this spell.. 
     4868                int32 ranged_bonus = caster->CalculateSpellDamage(m_spellProto, 1, m_spellProto->EffectBasePoints[1], m_target); 
     4869                // Set melee attack power bonus % from ranged depends from Improved mask aura 
     4870                m_modifier.m_amount = mod->m_amount * ranged_bonus / 100; 
     4871                m_currentBasePoints = m_modifier.m_amount; 
     4872                break; 
     4873            } 
     4874        } 
     4875        return; 
     4876    } 
    48604877} 
    48614878 
     
    53075324} 
    53085325 
    5309 void Aura::HandleAuraModExpertise(bool /*apply*/, bool Real) 
     5326void Aura::HandleAuraModExpertise(bool apply, bool Real) 
    53105327{ 
    53115328    if(m_target->GetTypeId() != TYPEID_PLAYER) 
     
    53305347    if (m_target->GetTypeId() == TYPEID_PLAYER && (m_modifier.m_miscvalue & SPELL_SCHOOL_MASK_SPELL)==SPELL_SCHOOL_MASK_SPELL) 
    53315348        m_target->ApplyModInt32Value(PLAYER_FIELD_MOD_TARGET_RESISTANCE,m_modifier.m_amount, apply); 
     5349} 
     5350 
     5351//HandleNoImmediateEffect auras implementation to support new stat system 
     5352void Aura::HandleAuraHealing(bool apply, bool Real) 
     5353{ 
     5354    //m_target->HandleStatModifier(UNIT_MOD_HEALING, TOTAL_VALUE, float(m_modifier.m_amount), apply); 
     5355} 
     5356 
     5357void Aura::HandleAuraHealingPct(bool apply, bool Real) 
     5358{ 
     5359    //m_target->HandleStatModifier(UNIT_MOD_HEALING, TOTAL_PCT, float(m_modifier.m_amount), apply); 
    53325360} 
    53335361