*Update of aura system.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-04-06 13:31:14 +02:00
parent 850537ece9
commit 20c02ef760
98 changed files with 3327 additions and 3754 deletions
@@ -666,9 +666,8 @@ struct TRINITY_DLL_DECL Mob_EventAI : public ScriptedAI
// If cast flag CAST_AURA_NOT_PRESENT is active, check if target already has aura on them
if(param3 & CAST_AURA_NOT_PRESENT)
{
for(uint8 i = 0; i < 3; ++i)
if(target->HasAura(param1, i))
return;
if(target->HasAura(param1))
return;
}
if (canCast)
@@ -138,7 +138,7 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI
if (IsBeingEscorted)
if (ChatTimer < diff)
{
if (m_creature->HasAura(3593, 0))
if (m_creature->HasAura(3593))
{
DoScriptText(SAY_RAND_1, m_creature);
m_creature->CastSpell(m_creature, 11540, false);
@@ -223,7 +223,7 @@ bool ItemUse_item_flying_machine(Player *player, Item* _Item, SpellCastTargets c
bool ItemUse_item_gor_dreks_ointment(Player *player, Item* _Item, SpellCastTargets const& targets)
{
if( targets.getUnitTarget() && targets.getUnitTarget()->GetTypeId()==TYPEID_UNIT &&
targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578,0) )
targets.getUnitTarget()->GetEntry() == 20748 && !targets.getUnitTarget()->HasAura(32578) )
return false;
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,_Item,NULL);
@@ -52,7 +52,7 @@ bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
if (_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED,0))
if (isEventActive()&& !player->GetAura(SPELL_TRICK_OR_TREATED, player->GetGUID()))
{
char* localizedEntry;
switch (player->GetSession()->GetSessionDbLocaleIndex())
@@ -83,7 +83,7 @@ bool GossipHello_npc_innkeeper(Player *player, Creature *_Creature)
bool GossipSelect_npc_innkeeper(Player *player, Creature *_Creature, uint32 sender, uint32 action )
{
if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED,0))
if (action == GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID && isEventActive() && !player->GetAura(SPELL_TRICK_OR_TREATED, player->GetGUID()))
{
player->CLOSE_GOSSIP_MENU();
player->CastSpell(player, SPELL_TRICK_OR_TREATED, true);
@@ -199,7 +199,7 @@ bool ReceiveEmote_npc_dancing_flames( Player *player, Creature *flame, uint32 em
case TEXTEMOTE_JOKE: flame->HandleEmoteCommand(EMOTE_ONESHOT_LAUGH); break;
case TEXTEMOTE_DANCE:
{
if (!player->HasAura(SPELL_SEDUCTION,0))
if (!player->HasAura(SPELL_SEDUCTION))
flame->CastSpell(player,SPELL_SEDUCTION,true);
}
break;
@@ -1213,7 +1213,7 @@ CreatureAI* GetAI_npc_tonk_mine(Creature *_Creature)
bool ReceiveEmote_npc_winter_reveler( Player *player, Creature *_Creature, uint32 emote )
{
//TODO: check auralist.
if(player->HasAura(26218, 0))
if(player->HasAura(26218))
return false;
if( emote == TEXTEMOTE_KISS )
@@ -80,7 +80,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
if (pInstance->GetData(TYPE_OVERSEER) == DONE)
{
if (m_creature->HasAura(SPELL_BANISH,0))
if (m_creature->HasAura(SPELL_BANISH))
m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
Intro = true;
}
@@ -89,7 +89,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if (m_creature->HasAura(SPELL_BANISH,0))
if (m_creature->HasAura(SPELL_BANISH))
return;
ScriptedAI::MoveInLineOfSight(who);
@@ -105,7 +105,7 @@ struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public ScriptedAI
{
DoScriptText(SAY_INTRO, m_creature);
if (m_creature->HasAura(SPELL_BANISH,0))
if (m_creature->HasAura(SPELL_BANISH))
m_creature->RemoveAurasDueToSpell(SPELL_BANISH);
IsBanished = false;
@@ -60,12 +60,6 @@ float VoidPortalCoords[5][3] =
{-261.4533, -297.3298, 17.1}
};
class EmpoweringShadowsAura: public Aura
{
public:
EmpoweringShadowsAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL) {}
};
struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
{
mob_voidtravelerAI(Creature *c) : ScriptedAI(c)
@@ -100,7 +94,7 @@ struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI
{
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS);
if( spell )
Vorpil->AddAura(new EmpoweringShadowsAura(spell, 0, NULL, Vorpil, m_creature));
Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature));
Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25);
DoCast(m_creature, SPELL_SHADOW_NOVA, true);
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
@@ -277,7 +271,7 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
Map::PlayerList const &PlayerList = map->GetPlayers();
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH,0))
if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH))
i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
m_creature->Relocate(VorpilPosition[0],VorpilPosition[1],VorpilPosition[2]);
@@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL boss_murmurAI : public Scripted_NoMovementAI
if (target && target->GetTypeId() == TYPEID_PLAYER)
{
//Not do anything without aura, spell can be resisted!
if (target->HasAura(SPELL_SONIC_BOOM_CAST,1) && m_creature->IsWithinDistInMap(target, 34.0f))
if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f))
{
//This will be wrong calculation. Also, comments suggest it must deal damage
target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8));
@@ -215,7 +215,7 @@ struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI
FelAcidTimer = 25000;
}else FelAcidTimer -= diff;
if(!m_creature->HasAura(SPELL_BERSERK, 0))
if(!m_creature->HasAura(SPELL_BERSERK))
{
if(EnrageTimer < diff)
{
@@ -748,7 +748,7 @@ struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI
if(m_creature->IsNonMeleeSpellCasted(false))
return;
if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED, 0))
if(Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED))
{
switch(Event)
{
@@ -933,7 +933,7 @@ struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI
AttackStart(m_creature->getVictim());
}
}
else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL, 0))
else if(!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL))
{
Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false);
m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE);
@@ -1625,12 +1625,12 @@ struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI
{
if(who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan
{
if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED, 0)))
if(!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED)))
{
IllidanGUID = who->GetGUID();
who->CastSpell(who, SPELL_CAGED, true);
DespawnTimer = 5000;
if(who->HasAura(SPELL_ENRAGE, 0))
if(who->HasAura(SPELL_ENRAGE))
who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage
//if(GameObject* CageTrap = GameObject::GetGameObject(*m_creature, CageTrapGUID))
// CageTrap->SetLootState(GO_JUST_DEACTIVATED);
@@ -1708,7 +1708,7 @@ struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI
if(m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players.
if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE, 0))
if(!m_creature->getVictim()->HasAura(SPELL_PARALYZE))
{
TargetGUID = m_creature->getVictim()->GetGUID();
m_creature->AddThreat(m_creature->getVictim(), 10000000.0f);
@@ -1750,8 +1750,8 @@ struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI
{
if( m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim()))
{
if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
&& !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
if(!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND)
&& !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
{
m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack
}
@@ -1862,8 +1862,8 @@ void boss_illidan_stormrageAI::JustSummoned(Creature* summon)
return;
}
Unit *target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0, 999, true);
if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND, 0)
|| target->HasAura(SPELL_PARASITIC_SHADOWFIEND2, 0))
if(!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND)
|| target->HasAura(SPELL_PARASITIC_SHADOWFIEND2))
target = SelectUnit(SELECT_TARGET_RANDOM, 0, 999, true);
if(target)
summon->AI()->AttackStart(target);
@@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI
}else SaberTimer -= diff;
//Enrage
if(!m_creature->HasAura(SPELL_BERSERK, 0))
if(!m_creature->HasAura(SPELL_BERSERK))
if(EnrageTimer < diff)
{
DoCast(m_creature, SPELL_BERSERK);
@@ -290,7 +290,7 @@ struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI
debug_log("SD2: Increasing Death Count for Shade of Akama encounter");
++DeathCount;
m_creature->RemoveSingleAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2, 0);
m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2);
if(guid)
{
if(Sorcerers.empty())
@@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI
if (!UpdateVictim())
return;
if(!m_creature->HasAura(SPELL_BERSERK, 0))
if(!m_creature->HasAura(SPELL_BERSERK))
{
if(BerserkTimer < diff)
DoCast(m_creature, SPELL_BERSERK);
@@ -276,7 +276,7 @@ struct TRINITY_DLL_DECL npc_volcanoAI : public ScriptedAI
}
else if(Eruption && ((boss_supremusAI*)Supremus->AI())->Phase1)
{
m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION, 0);
m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION);
}
CheckTimer = 1500;
}else CheckTimer -= diff;
@@ -331,7 +331,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
Unit* Ghost = NULL;
if(GhostGUID)
Ghost = Unit::GetUnit((*m_creature), GhostGUID);
if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH, 0))
if(Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH))
{
/*float x,y,z;
Ghost->GetPosition(x,y,z);
@@ -487,7 +487,7 @@ struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI
RandomYellTimer = 50000 + rand()%51 * 1000;
}else RandomYellTimer -= diff;
if(!m_creature->HasAura(SPELL_BERSERK, 0))
if(!m_creature->HasAura(SPELL_BERSERK))
{
if(EnrageTimer < diff)
{
@@ -95,7 +95,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
void SpellHit(Unit *caster, const SpellEntry *spell)
{
if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD, 0))
if(spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD))
{
m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true);
@@ -116,7 +116,7 @@ struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI
{
if(!SpineTargetGUID) return false;
Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID);
if(target && target->HasAura(SPELL_IMPALING_SPINE, 1))
if(target && target->HasAura(SPELL_IMPALING_SPINE))
target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE);
SpineTargetGUID=0;
return true;
@@ -258,11 +258,11 @@ struct TRINITY_DLL_DECL boss_chromaggusAI : public ScriptedAI
DoCast(pUnit, SpellAfflict, true);
//Chromatic mutation if target is effected by all afflictions
if (pUnit->HasAura(SPELL_BROODAF_BLUE,0)
&& pUnit->HasAura(SPELL_BROODAF_BLACK,0)
&& pUnit->HasAura(SPELL_BROODAF_RED,0)
&& pUnit->HasAura(SPELL_BROODAF_BRONZE,0)
&& pUnit->HasAura(SPELL_BROODAF_GREEN,0))
if (pUnit->HasAura(SPELL_BROODAF_BLUE)
&& pUnit->HasAura(SPELL_BROODAF_BLACK)
&& pUnit->HasAura(SPELL_BROODAF_RED)
&& pUnit->HasAura(SPELL_BROODAF_BRONZE)
&& pUnit->HasAura(SPELL_BROODAF_GREEN))
{
//target->RemoveAllAuras();
//DoCast(target,SPELL_CHROMATIC_MUT_1);
@@ -76,7 +76,7 @@ struct TRINITY_DLL_DECL boss_ebonrocAI : public ScriptedAI
ShadowOfEbonroc_Timer = 25000 + rand()%10000;
}else ShadowOfEbonroc_Timer -= diff;
if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC,0))
if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC))
{
if (Heal_Timer < diff)
{
@@ -104,7 +104,7 @@ struct TRINITY_DLL_DECL boss_razorgoreAI : public ScriptedAI
}else Conflagration_Timer -= diff;
// Aura Check. If the gamer is affected by confliguration we attack a random gamer.
if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION,0))
if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION))
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,1);
@@ -258,7 +258,7 @@ struct TRINITY_DLL_DECL npc_daranelleAI : public ScriptedAI
{
if (who->GetTypeId() == TYPEID_PLAYER)
{
if (who->HasAura(36904,0) && m_creature->IsWithinDistInMap(who, 10.0f))
if (who->HasAura(36904) && m_creature->IsWithinDistInMap(who, 10.0f))
{
DoScriptText(SAY_SPELL_INFLUENCE, m_creature, who);
//TODO: Move the below to updateAI and run if this statement == true
@@ -81,7 +81,7 @@ CreatureAI* GetAI_mob_webbed_creature(Creature *_Creature)
bool GossipHello_npc_captured_sunhawk_agent(Player *player, Creature *_Creature)
{
if (player->HasAura(31609,1) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
if (player->HasAura(31609) && player->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE)
{
player->ADD_GOSSIP_ITEM( 0, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(9136, _Creature->GetGUID());
@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL npc_ragged_johnAI : public ScriptedAI
void MoveInLineOfSight(Unit *who)
{
if( who->HasAura(16468,0) )
if( who->HasAura(16468) )
{
if( who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessiblePlaceFor(m_creature) )
{
@@ -79,8 +79,8 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS)
m_creature->CastSpell(m_creature,SPELL_CHANNEL,true);
else if (m_creature->HasAura(SPELL_CHANNEL,0))
m_creature->RemoveAura(SPELL_CHANNEL,0);
else if (m_creature->HasAura(SPELL_CHANNEL))
m_creature->RemoveAura(SPELL_CHANNEL);
m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true);
}
@@ -160,9 +160,9 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
{
pInstance->SetData(TYPE_MEDIVH,SPECIAL);
if (m_creature->HasAura(SPELL_CORRUPT_AEONUS,0))
if (m_creature->HasAura(SPELL_CORRUPT_AEONUS))
SpellCorrupt_Timer = 1000;
else if (m_creature->HasAura(SPELL_CORRUPT,0))
else if (m_creature->HasAura(SPELL_CORRUPT))
SpellCorrupt_Timer = 3000;
else
SpellCorrupt_Timer = 0;
@@ -207,8 +207,8 @@ struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI
DoScriptText(SAY_WIN, m_creature);
Check_Timer = 0;
if (m_creature->HasAura(SPELL_CHANNEL,0))
m_creature->RemoveAura(SPELL_CHANNEL,0);
if (m_creature->HasAura(SPELL_CHANNEL))
m_creature->RemoveAura(SPELL_CHANNEL);
//TODO: start the post-event here
pInstance->SetData(TYPE_MEDIVH,DONE);
@@ -411,9 +411,9 @@ struct TRINITY_DLL_DECL boss_archimondeAI : public ScriptedAI
break;
}
if (m_creature->HasAura(chargeSpell, 0))
if (m_creature->HasAura(chargeSpell))
{
m_creature->RemoveSingleAuraFromStack(chargeSpell, 0);
m_creature->RemoveAuraFromStack(chargeSpell);
DoCast(m_creature->getVictim(), unleashSpell);
HasCast = true;
SoulChargeCount--;
@@ -519,7 +519,7 @@ struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI
return;
}
if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON, 0) )
if( !m_creature->HasAura(SPELL_WINDFURY_WEAPON) )
{
DoCast(m_creature, SPELL_WINDFURY_WEAPON);
}
@@ -365,7 +365,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
Unit *target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER, 0))
if(target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER))
//cast Static Charge every 2 seconds for 20 seconds
DoCast(target, SPELL_STATIC_CHARGE_TRIGGER);
@@ -571,12 +571,7 @@ struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI
}
}
};
class TRINITY_DLL_DECL VashjSurgeAura : public Aura
{
public:
VashjSurgeAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
{}
};
//Enchanted Elemental
//If one of them reaches Vashj he will increase her damage done by 5%.
struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
@@ -660,13 +655,14 @@ struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_SURGE);
if( spell )
{
for(uint32 i = 0;i<3;i++)
uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
Vashj->AddAura(new VashjSurgeAura(spell, i, NULL, Vashj, Vashj));
eff_mask|=1<<i;
}
Vashj->AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj));
}
m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
@@ -918,7 +914,7 @@ struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI
if(Vashj && Vashj->isAlive())
{
//start visual channel
if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER,0))
if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER))
{
m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true);
Casted = true;
@@ -65,12 +65,6 @@ EndScriptData */
#define SAY_FREE -1548019
#define SAY_DEATH -1548020
class TRINITY_DLL_DECL InsidiousAura : public Aura {
public:
InsidiousAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
{}
};
struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
{
mob_inner_demonAI(Creature *c) : ScriptedAI(c)
@@ -91,7 +85,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
void JustDied(Unit *victim)
{
Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID);
if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER,0))
if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER))
pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER);
}
@@ -128,7 +122,7 @@ struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI
}else Link_Timer -= diff;
if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT, 0))
if(!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT))
DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true);
if(ShadowBolt_Timer < diff)
@@ -229,7 +223,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}
void MoveInLineOfSight(Unit *who)
{
if(m_creature->HasAura(AURA_BANISH, 0))
if(m_creature->HasAura(AURA_BANISH))
return;
if( !m_creature->getVictim() && who->isTargetableForAttack() && ( m_creature->IsHostileTo( who )) && who->isInAccessiblePlaceFor(m_creature) )
@@ -267,7 +261,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}
// channelers == 0 remove banish aura
if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH, 0))
if(AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH))
{
// removing banish aura
m_creature->RemoveAurasDueToSpell(AURA_BANISH);
@@ -290,7 +284,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
StartEvent();
}
}
else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH, 0))
else if(AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH))
{
// channelers != 0 apply banish aura
// removing Leotheras banish immune to apply AURA_BANISH
@@ -390,7 +384,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
void Aggro(Unit *who)
{
if(m_creature->HasAura(AURA_BANISH, 0))
if(m_creature->HasAura(AURA_BANISH))
return;
m_creature->LoadEquipment(m_creature->GetEquipmentId());
@@ -399,7 +393,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (m_creature->HasAura(AURA_BANISH, 0) || !UpdateVictim())
if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim())
{
if(BanishTimer<diff)
{
@@ -408,7 +402,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}else BanishTimer -= diff;
return;
}
if(m_creature->HasAura(SPELL_WHIRLWIND, 0))
if(m_creature->HasAura(SPELL_WHIRLWIND))
if(Whirlwind_Timer < diff)
{
Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0);
@@ -422,7 +416,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
}else Whirlwind_Timer -= diff;
// reseting after changing forms and after ending whirlwind
if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND, 0))
if(NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND))
{
// when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding)
if(DemonForm)
@@ -446,7 +440,7 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
if(!DemonForm)
{
//Whirldind Timer
if(!m_creature->HasAura(SPELL_WHIRLWIND, 0))
if(!m_creature->HasAura(SPELL_WHIRLWIND))
{
if(Whirlwind_Timer < diff)
{
@@ -513,12 +507,14 @@ struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI
((ScriptedAI *)demon->AI())->AttackStart( (*itr) );
((mob_inner_demonAI *)demon->AI())->victimGUID = (*itr)->GetGUID();
uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
(*itr)->AddAura(new InsidiousAura(spell, i, NULL, (*itr), (*itr)));
eff_mask|=1<<i;
}
(*itr)->AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr)));
if( InnderDemon_Count > 4 ) InnderDemon_Count = 0;
//Safe storing of creatures
@@ -266,7 +266,7 @@ struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER, 0))
if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER))
i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true);
else if(!i->getSource()->IsInWater())
i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER);
@@ -121,7 +121,7 @@ struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI
{
if(Unit* target = (Unit*)Unit::GetUnit(*m_creature, LevitatedTarget))
{
if(!target->HasAura(SPELL_LEVITATE,0))
if(!target->HasAura(SPELL_LEVITATE))
{
LevitatedTarget = 0;
return;
@@ -62,12 +62,6 @@ const float ShadowmoonChannelers[5][4]=
{316,-109,-24.6,1.257}
};
class TRINITY_DLL_DECL BurningNovaAura : public Aura
{
public:
BurningNovaAura(SpellEntry *spell, uint32 eff, Unit *target, Unit *caster) : Aura(spell, eff, NULL, target, caster, NULL){}
};
struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
{
boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c)
@@ -234,12 +228,14 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
if(SpellEntry *nova = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_BURNING_NOVA))
{
for(uint32 i = 0; i < 3; ++i)
if(nova->Effect[i] == SPELL_EFFECT_APPLY_AURA)
{
Aura *Aur = new BurningNovaAura(nova, i, m_creature, m_creature);
m_creature->AddAura(Aur);
}
uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!nova->Effect[i])
continue;
eff_mask|=1<<i;
}
m_creature->AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature));
}
if (HeroicMode)
@@ -257,7 +257,7 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i)
{
Unit *clicker = Unit::GetUnit(*m_creature, (*i).second);
if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP, 1))
if(!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP))
{
DebuffClicker(clicker);
(*i).second = 0;
@@ -265,12 +265,12 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI
}
// if 5 clickers from other cubes apply shadow cage
if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
if(ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE))
{
DoScriptText(SAY_BANISH, m_creature);
m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true);
}
else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE, 0))
else if(ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE))
m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
if(!ClickerNum) NeedCheckCube = false;
@@ -510,7 +510,7 @@ bool GOHello_go_Manticron_Cube(Player *player, GameObject* _GO)
if(!Magtheridon || !Magtheridon->isAlive()) return true;
// if exhausted or already channeling return
if(player->HasAura(SPELL_MIND_EXHAUSTION, 0) || player->HasAura(SPELL_SHADOW_GRASP, 1))
if(player->HasAura(SPELL_MIND_EXHAUSTION) || player->HasAura(SPELL_SHADOW_GRASP))
return true;
player->InterruptNonMeleeSpells(false);
@@ -164,7 +164,7 @@ struct TRINITY_DLL_DECL npc_greengill_slaveAI : public ScriptedAI
if(!caster)
return;
if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE, 0))
if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !m_creature->HasAura(ENRAGE))
{
PlayerGUID = caster->GetGUID();
if(PlayerGUID)
@@ -150,7 +150,7 @@ struct TRINITY_DLL_DECL boss_moroesAI : public ScriptedAI
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
{
if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0))
if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE))
i->getSource()->RemoveAurasDueToSpell(SPELL_GARROTE);
}
}
@@ -625,7 +625,7 @@ struct TRINITY_DLL_DECL mob_cycloneAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!m_creature->HasAura(SPELL_KNOCKBACK, 0))
if(!m_creature->HasAura(SPELL_KNOCKBACK))
DoCast(m_creature, SPELL_KNOCKBACK, true);
if(MoveTimer < diff)
@@ -277,7 +277,7 @@ struct TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI
{
std::vector<Add*>::iterator itr = Adds.begin() + rand()%Adds.size();
if (Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid))
if (!pAdd->HasAura(SPELL_SHIELD, 0) && pAdd->isAlive())
if (!pAdd->HasAura(SPELL_SHIELD) && pAdd->isAlive())
target = pAdd;
}
DoCast(target, SPELL_SHIELD);
@@ -134,8 +134,8 @@ struct TRINITY_DLL_DECL mob_lumpAI : public ScriptedAI
void Aggro(Unit *who)
{
if (m_creature->HasAura(SPELL_VISUAL_SLEEP,0))
m_creature->RemoveAura(SPELL_VISUAL_SLEEP,0);
if (m_creature->HasAura(SPELL_VISUAL_SLEEP))
m_creature->RemoveAura(SPELL_VISUAL_SLEEP);
if (!m_creature->IsStandState())
m_creature->SetStandState(UNIT_STAND_STATE_STAND);
@@ -109,7 +109,7 @@ struct TRINITY_DLL_DECL boss_anubrekhanAI : public ScriptedAI
{
//Cast Impale on a random target
//Do NOT cast it when we are afflicted by locust swarm
if (!m_creature->HasAura(SPELL_LOCUSTSWARM,1))
if (!m_creature->HasAura(SPELL_LOCUSTSWARM))
{
if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(target,SPELL_IMPALE);
@@ -652,7 +652,7 @@ Creature* SearchDawnforge(Player *source, uint32 entry, float range)
bool AreaTrigger_at_commander_dawnforge(Player *player, AreaTriggerEntry *at)
{
//if player lost aura or not have at all, we should not try start event.
if (!player->HasAura(SPELL_SUNFURY_DISGUISE,0))
if (!player->HasAura(SPELL_SUNFURY_DISGUISE))
return false;
if (player->isAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
@@ -858,7 +858,7 @@ struct TRINITY_DLL_DECL mob_phase_hunterAI : public ScriptedAI
DoScriptText(EMOTE_WEAK, m_creature);
Weak = true;
}
if(Weak && !Drained && m_creature->HasAura(34219, 0))
if(Weak && !Drained && m_creature->HasAura(34219))
{
Drained = true;
@@ -176,7 +176,7 @@ struct TRINITY_DLL_DECL mob_wisp_invisAI : public ScriptedAI
if (!who || Creaturetype != 1 || !who->isTargetableForAttack())
return;
if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL,0))
if (m_creature->GetDistance2d(who) < 0.1 && !who->HasAura(SPELL_SQUASH_SOUL))
DoCast(who,SPELL_SQUASH_SOUL);
}
@@ -505,7 +505,7 @@ struct TRINITY_DLL_DECL boss_headless_horsemanAI : public ScriptedAI
void SpellHitTarget(Unit* unit, const SpellEntry* spell)
{
if (spell->Id == SPELL_CONFLAGRATION)
if (unit->HasAura(SPELL_CONFLAGRATION,0))
if (unit->HasAura(SPELL_CONFLAGRATION))
SaySound(SAY_CONFLAGRATION,unit);
}
@@ -131,7 +131,7 @@ struct TRINITY_DLL_DECL boss_doomwalkerAI : public ScriptedAI
//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
if (InEnrage)
m_creature->RemoveAura(SPELL_ENRAGE, 0);
m_creature->RemoveAura(SPELL_ENRAGE);
DoCast(m_creature,SPELL_EARTHQUAKE);
Quake_Timer = 30000 + rand()%25000;
@@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI
if(!caster)
return;
if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN, 0) && !PlayerGUID)
if(caster->GetTypeId() == TYPEID_PLAYER && spell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN) && !PlayerGUID)
{
float PlayerX, PlayerY, PlayerZ;
caster->GetClosePoint(PlayerX, PlayerY, PlayerZ, m_creature->GetObjectSize());
@@ -280,10 +280,10 @@ struct TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance
if (!pGroupie)
continue;
if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0))
if (pGroupie->HasAura(SPELL_BARON_ULTIMATUM))
pGroupie->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM);
}
} else if (player->HasAura(SPELL_BARON_ULTIMATUM,0))
} else if (player->HasAura(SPELL_BARON_ULTIMATUM))
player->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM);
if (Unit *temp = Unit::GetUnit(*player,GetData64(DATA_BARON)))
@@ -54,12 +54,12 @@ bool GOHello_go_gauntlet_gate(Player *player, GameObject* _GO)
continue;
if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
!pGroupie->HasAura(SPELL_BARON_ULTIMATUM,0) &&
!pGroupie->HasAura(SPELL_BARON_ULTIMATUM) &&
pGroupie->GetMap() == _GO->GetMap())
pGroupie->CastSpell(pGroupie,SPELL_BARON_ULTIMATUM,true);
}
} else if (player->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE &&
!player->HasAura(SPELL_BARON_ULTIMATUM,0) &&
!player->HasAura(SPELL_BARON_ULTIMATUM) &&
player->GetMap() == _GO->GetMap())
player->CastSpell(player,SPELL_BARON_ULTIMATUM,true);
@@ -133,7 +133,7 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI
Unit *Target = m_creature->getVictim();
DoCast(Target,SPELL_STOMP);
if(Target->HasAura(45151,0)) Target->RemoveAura(45151,0);
if(Target->HasAura(45151)) Target->RemoveAura(45151);
StompTimer = 30000;
}else StompTimer -= diff;
@@ -209,9 +209,9 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
switch(TouchedType)
{
case SPELL_FLAME_TOUCHED:
if(!target->HasAura(SPELL_DARK_FLAME,0))
if(!target->HasAura(SPELL_DARK_FLAME))
{
if(target->HasAura(SPELL_DARK_TOUCHED,0))
if(target->HasAura(SPELL_DARK_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -222,9 +222,9 @@ struct TRINITY_DLL_DECL boss_sacrolashAI : public ScriptedAI
}
break;
case SPELL_DARK_TOUCHED:
if(!target->HasAura(SPELL_DARK_FLAME,0))
if(!target->HasAura(SPELL_DARK_FLAME))
{
if(target->HasAura(SPELL_FLAME_TOUCHED,0))
if(target->HasAura(SPELL_FLAME_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -507,9 +507,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
switch(TouchedType)
{
case SPELL_FLAME_TOUCHED:
if(!target->HasAura(SPELL_DARK_FLAME,0))
if(!target->HasAura(SPELL_DARK_FLAME))
{
if(target->HasAura(SPELL_DARK_TOUCHED,0))
if(target->HasAura(SPELL_DARK_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -520,9 +520,9 @@ struct TRINITY_DLL_DECL boss_alythessAI : public Scripted_NoMovementAI
}
break;
case SPELL_DARK_TOUCHED:
if(!target->HasAura(SPELL_DARK_FLAME,0))
if(!target->HasAura(SPELL_DARK_FLAME))
{
if(target->HasAura(SPELL_FLAME_TOUCHED,0))
if(target->HasAura(SPELL_FLAME_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -709,9 +709,9 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
case SPELL_SHADOW_FURY:
case SPELL_DARK_STRIKE:
if(!target->HasAura(SPELL_DARK_FLAME,0))
if(!target->HasAura(SPELL_DARK_FLAME))
{
if(target->HasAura(SPELL_FLAME_TOUCHED,0))
if(target->HasAura(SPELL_FLAME_TOUCHED))
{
target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED);
target->CastSpell(target,SPELL_DARK_FLAME,true);
@@ -726,7 +726,7 @@ struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
if(!m_creature->HasAura(SPELL_IMAGE_VISUAL,0))
if(!m_creature->HasAura(SPELL_IMAGE_VISUAL))
DoCast(m_creature,SPELL_IMAGE_VISUAL);
if(kill_timer < diff)
@@ -384,7 +384,7 @@ struct TRINITY_DLL_DECL boss_sathrovarrAI : public ScriptedAI
if(ResetThreat < diff)
{
if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION,0)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) )
if ( ( m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) )
{
for(std::list<HostilReference*>::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr)
{
@@ -609,7 +609,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
{
//this is a hack. we need to find a victim without aura in core
Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0);
if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION, 0)) )
if( ( target != m_creature->getVictim() ) && target->isAlive() && !(target->HasAura(AURA_SPECTRAL_EXHAUSTION)) )
{
DoCast(target, SPELL_SPECTRAL_BLAST);
SpectralBlastTimer = 20000+(rand()%5000);
@@ -626,7 +626,7 @@ void boss_kalecgosAI::UpdateAI(const uint32 diff)
bool GOkalocegos_teleporter(Player *player, GameObject* _GO)
{
if(player->HasAura(AURA_SPECTRAL_EXHAUSTION, 0))
if(player->HasAura(AURA_SPECTRAL_EXHAUSTION))
player->GetSession()->SendNotification(GO_FAILED);
else
player->CastSpell(player, SPELL_TELEPORT_SPECTRAL, true);
@@ -191,7 +191,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
if( who->GetTypeId() == TYPEID_PLAYER )
{
if( ((Player*)who)->HasAura(34877,1) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
if( ((Player*)who)->HasAura(34877) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE )
{
float Radius = 10.0;
if( m_creature->IsWithinDistInMap(who, Radius) )
@@ -347,7 +347,7 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI
if( pInstance )
{
m_creature->InterruptNonMeleeSpells(true);
m_creature->RemoveSpellsCausingAura(SPELL_AURA_DUMMY);
m_creature->RemoveAurasByType(SPELL_AURA_DUMMY);
switch( Phase )
{
@@ -965,7 +965,7 @@ struct TRINITY_DLL_DECL eye_tentacleAI : public Scripted_NoMovementAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(target,SPELL_MIND_FLAY);
//Mindflay every 10 seconds
@@ -1033,7 +1033,7 @@ struct TRINITY_DLL_DECL claw_tentacleAI : public Scripted_NoMovementAI
return;
}
if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
Unit* p = DoSpawnCreature(MOB_SMALL_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -1129,7 +1129,7 @@ struct TRINITY_DLL_DECL giant_claw_tentacleAI : public Scripted_NoMovementAI
return;
}
if (!target->HasAura(SPELL_DIGESTIVE_ACID, 0))
if (!target->HasAura(SPELL_DIGESTIVE_ACID))
{
m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0);
Unit* p = DoSpawnCreature(MOB_GIANT_PORTAL,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN, 0);
@@ -1213,7 +1213,7 @@ struct TRINITY_DLL_DECL giant_eye_tentacleAI : public Scripted_NoMovementAI
{
Unit* target = NULL;
target = SelectUnit(SELECT_TARGET_RANDOM,0);
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, 0))
if (target && !target->HasAura(SPELL_DIGESTIVE_ACID))
DoCast(target,SPELL_GREEN_BEAM);
//Beam every 2 seconds
@@ -404,13 +404,6 @@ struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI
}
};
class TRINITY_DLL_DECL BugAura : public Aura
{
public:
BugAura(SpellEntry *spell, uint32 eff, int32 *bp, Unit *target, Unit *caster) : Aura(spell, eff, bp, target, caster, NULL)
{}
};
struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI
{
bool IAmVeklor() {return false;}
@@ -441,12 +434,14 @@ struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI
target->setFaction(14);
((CreatureAI*)target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget());
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_MUTATE_BUG);
uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
target->AddAura(new BugAura(spell, i, NULL, target, target));
eff_mask|=1<<i;
}
target->AddAura(new Aura(spell, eff_mask, NULL, target, target));
target->SetHealth(target->GetMaxHealth());
}
@@ -524,12 +519,14 @@ struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI
{
target->setFaction(14);
SpellEntry *spell = (SpellEntry *)GetSpellStore()->LookupEntry(SPELL_EXPLODEBUG);
uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
target->AddAura(new BugAura(spell, i, NULL, target, target));
eff_mask|=1<<i;
}
target->AddAura(new Aura(spell, eff_mask, NULL, target, target));
target->SetHealth(target->GetMaxHealth());
}
@@ -247,13 +247,16 @@ struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI
void GainSentinelAbility(uint32 id)
{
const SpellEntry *spell = GetSpellStore()->LookupEntry(id);
uint8 eff_mask=0;
for (int i=0; i<3; i++)
{
if (!spell->Effect[i])
continue;
SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, i);
m_creature->AddAura(a);
eff_mask=1<<i;
}
SentinelAbilityAura *a = new SentinelAbilityAura(this, (SpellEntry *)spell, id, eff_mask);
m_creature->AddAura(a);
if (id == SPELL_KNOCK_BUFF)
{
m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
@@ -341,6 +344,5 @@ SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry
{
aOwner = abilityOwner;
abilityId = ability;
currentBasePoints = 0;
}
@@ -110,7 +110,7 @@ struct TRINITY_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI
m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY, raX, raY, myZ, 0, TEMPSUMMON_TIMED_DESPAWN, 3000);
LamentEvent_Timer = 2000;
if( !m_creature->HasAura(SPELL_SYLVANAS_CAST, 0))
if( !m_creature->HasAura(SPELL_SYLVANAS_CAST))
{
DoScriptText(SAY_LAMENT_END, m_creature);
DoScriptText(EMOTE_LAMENT_END, m_creature);
@@ -210,7 +210,7 @@ bool GossipHello_npc_parqual_fintallas(Player *player, Creature *_Creature)
if (_Creature->isQuestGiver())
player->PrepareQuestMenu( _Creature->GetGUID() );
if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME,0) )
if (player->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !player->HasAura(SPELL_MARK_OF_SHAME) )
{
player->ADD_GOSSIP_ITEM( 0, GOSSIP_HPF1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->ADD_GOSSIP_ITEM( 0, GOSSIP_HPF2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
@@ -344,7 +344,7 @@ struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI
switch (id)
{
case 1:
ingvar->RemoveAura(SPELL_SUMMON_BANSHEE,1);
ingvar->RemoveAura(SPELL_SUMMON_BANSHEE);
ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true);
DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM);
Resurect_Timer = 8000;
@@ -86,7 +86,7 @@ struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI
void UpdateAI(const uint32 diff)
{
Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID);
if((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB,0)) || !temp )
if((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp )
m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
}
};
@@ -394,7 +394,7 @@ struct TRINITY_DLL_DECL boss_nalorakkAI : public ScriptedAI
if(Mangle_Timer < diff)
{
if(m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT, 0))
if(m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT))
{
DoCast(m_creature->getVictim(), SPELL_MANGLE);
Mangle_Timer = 1000;
+7 -7
View File
@@ -50,7 +50,7 @@ void WorldSession::HandleAuctionHelloOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendAuctionHello(guid, unit);
}
@@ -199,7 +199,7 @@ void WorldSession::HandleAuctionSellItem( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item *it = pl->GetItemByGuid( item );
//do not allow to sell already auctioned items
@@ -304,7 +304,7 @@ void WorldSession::HandleAuctionPlaceBid( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -430,7 +430,7 @@ void WorldSession::HandleAuctionRemoveItem( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -515,7 +515,7 @@ void WorldSession::HandleAuctionListBidderItems( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -564,7 +564,7 @@ void WorldSession::HandleAuctionListOwnerItems( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
@@ -611,7 +611,7 @@ void WorldSession::HandleAuctionListItems( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
AuctionHouseObject* auctionHouse = auctionmgr.GetAuctionsMap( pCreature->getFaction() );
+3 -3
View File
@@ -703,7 +703,7 @@ void BattleGround::EndBattleGround(uint32 winner)
// should remove spirit of redemption
if(plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
if(!plr->isAlive())
{
@@ -928,7 +928,7 @@ void BattleGround::RemovePlayerAtLeave(uint64 guid, bool Transport, bool SendPac
// should remove spirit of redemption
if(plr && plr->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
plr->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
plr->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
if(plr && !plr->isAlive()) // resurrect on exit
{
@@ -1312,7 +1312,7 @@ void BattleGround::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
SpellEntry const *spellInfo = sSpellStore.LookupEntry( SPELL_WAITING_FOR_RESURRECT );
if(spellInfo)
{
Aura *Aur = CreateAura(spellInfo, 0, NULL, plr);
Aura *Aur = new Aura(spellInfo, 1, NULL, plr);
plr->AddAura(Aur);
}
}
+1 -1
View File
@@ -66,7 +66,7 @@ bool LoginQueryHolder::Initialize()
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADFROM, "SELECT guid, account, data, name, race, class, position_x, position_y, position_z, map, orientation, taximask, cinematic, totaltime, leveltime, rest_bonus, logout_time, is_logout_resting, resettalents_cost, resettalents_time, trans_x, trans_y, trans_z, trans_o, transguid, extra_flags, stable_slots, at_login, zone, online, death_expire_time, taxi_path, dungeon_difficulty, arena_pending_points,bgid,bgteam,bgmap,bgx,bgy,bgz,bgo FROM characters WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGROUP, "SELECT leaderGuid FROM group_member WHERE memberGuid ='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADBOUNDINSTANCES, "SELECT id, permanent, map, difficulty, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADAURAS, "SELECT caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2 ,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSPELLS, "SELECT spell,active,disabled FROM character_spell WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADQUESTSTATUS, "SELECT quest,status,rewarded,explored,timer,mobcount1,mobcount2,mobcount3,mobcount4,itemcount1,itemcount2,itemcount3,itemcount4 FROM character_queststatus WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADDAILYQUESTSTATUS,"SELECT quest,time FROM character_queststatus_daily WHERE guid = '%u'", GUID_LOPART(m_guid));
+5 -5
View File
@@ -67,11 +67,11 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
if(langDesc->skill_id != 0 && !_player->HasSkill(langDesc->skill_id))
{
// also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language)
Unit::AuraList const& langAuras = _player->GetAurasByType(SPELL_AURA_COMPREHEND_LANGUAGE);
Unit::AuraEffectList const& langAuras = _player->GetAurasByType(SPELL_AURA_COMPREHEND_LANGUAGE);
bool foundAura = false;
for(Unit::AuraList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i)
for(Unit::AuraEffectList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i)
{
if((*i)->GetModifier()->m_miscvalue == lang)
if((*i)->GetMiscValue() == lang)
{
foundAura = true;
break;
@@ -138,9 +138,9 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
}
// but overwrite it by SPELL_AURA_MOD_LANGUAGE auras (only single case used)
Unit::AuraList const& ModLangAuras = _player->GetAurasByType(SPELL_AURA_MOD_LANGUAGE);
Unit::AuraEffectList const& ModLangAuras = _player->GetAurasByType(SPELL_AURA_MOD_LANGUAGE);
if(!ModLangAuras.empty())
lang = ModLangAuras.front()->GetModifier()->m_miscvalue;
lang = ModLangAuras.front()->GetMiscValue();
}
if (!_player->CanSpeak())
+2 -3
View File
@@ -2066,9 +2066,8 @@ bool Creature::LoadCreaturesAddon(bool reload)
continue;
}
Aura* AdditionalAura = CreateAura(AdditionalSpellInfo, cAura->effect_idx, NULL, this, this, 0);
AddAura(AdditionalAura);
sLog.outDebug("Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[0],GetGUIDLow(),GetEntry());
AddAuraEffect(AdditionalSpellInfo->Id, cAura->effect_idx, this);
sLog.outDebug("Spell: %u with Aura %u added to creature (GUIDLow: %u Entry: %u )", cAura->spell_id, AdditionalSpellInfo->EffectApplyAuraName[cAura->effect_idx],GetGUIDLow(),GetEntry());
}
}
return true;
+3 -3
View File
@@ -118,9 +118,9 @@ void SimpleCharmedAI::UpdateAI(const uint32 /*diff*/)
//kill self if charm aura has infinite duration
if(charmer->IsInEvadeMode())
{
Unit::AuraList const& auras = me->GetAurasByType(SPELL_AURA_MOD_CHARM);
for(Unit::AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->IsPermanent())
Unit::AuraEffectList const& auras = me->GetAurasByType(SPELL_AURA_MOD_CHARM);
for(Unit::AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetParentAura()->IsPermanent())
{
charmer->Kill(me);
return;
+22 -20
View File
@@ -1186,6 +1186,8 @@ struct SoundEntriesEntry
// 28 m_EAXDef
};
#define MAX_SPELL_EFFECTS 3
struct SpellEntry
{
uint32 Id; // 0 m_ID
@@ -1241,26 +1243,26 @@ struct SpellEntry
int32 EquippedItemClass; // 65 m_equippedItemClass (value)
int32 EquippedItemSubClassMask; // 66 m_equippedItemSubclass (mask)
int32 EquippedItemInventoryTypeMask; // 67 m_equippedItemInvTypes (mask)
uint32 Effect[3]; // 68-70 m_effect
int32 EffectDieSides[3]; // 71-73 m_effectDieSides
uint32 EffectBaseDice[3]; // 74-76 m_effectBaseDice
float EffectDicePerLevel[3]; // 77-79 m_effectDicePerLevel
float EffectRealPointsPerLevel[3]; // 80-82 m_effectRealPointsPerLevel
int32 EffectBasePoints[3]; // 83-85 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
uint32 EffectMechanic[3]; // 86-88 m_effectMechanic
uint32 EffectImplicitTargetA[3]; // 89-91 m_implicitTargetA
uint32 EffectImplicitTargetB[3]; // 92-94 m_implicitTargetB
uint32 EffectRadiusIndex[3]; // 95-97 m_effectRadiusIndex - spellradius.dbc
uint32 EffectApplyAuraName[3]; // 98-100 m_effectAura
uint32 EffectAmplitude[3]; // 101-103 m_effectAuraPeriod
float EffectMultipleValue[3]; // 104-106 m_effectAmplitude
uint32 EffectChainTarget[3]; // 107-109 m_effectChainTargets
uint32 EffectItemType[3]; // 110-112 m_effectItemType
int32 EffectMiscValue[3]; // 113-115 m_effectMiscValue
int32 EffectMiscValueB[3]; // 116-118 m_effectMiscValueB
uint32 EffectTriggerSpell[3]; // 119-121 m_effectTriggerSpell
float EffectPointsPerComboPoint[3]; // 122-124 m_effectPointsPerCombo
flag96 EffectSpellClassMask[3]; //
uint32 Effect[MAX_SPELL_EFFECTS]; // 68-70 m_effect
int32 EffectDieSides[MAX_SPELL_EFFECTS]; // 71-73 m_effectDieSides
uint32 EffectBaseDice[MAX_SPELL_EFFECTS]; // 74-76 m_effectBaseDice
float EffectDicePerLevel[MAX_SPELL_EFFECTS]; // 77-79 m_effectDicePerLevel
float EffectRealPointsPerLevel[MAX_SPELL_EFFECTS]; // 80-82 m_effectRealPointsPerLevel
int32 EffectBasePoints[MAX_SPELL_EFFECTS]; // 83-85 m_effectBasePoints (don't must be used in spell/auras explicitly, must be used cached Spell::m_currentBasePoints)
uint32 EffectMechanic[MAX_SPELL_EFFECTS]; // 86-88 m_effectMechanic
uint32 EffectImplicitTargetA[MAX_SPELL_EFFECTS]; // 89-91 m_implicitTargetA
uint32 EffectImplicitTargetB[MAX_SPELL_EFFECTS]; // 92-94 m_implicitTargetB
uint32 EffectRadiusIndex[MAX_SPELL_EFFECTS]; // 95-97 m_effectRadiusIndex - spellradius.dbc
uint32 EffectApplyAuraName[MAX_SPELL_EFFECTS]; // 98-100 m_effectAura
uint32 EffectAmplitude[MAX_SPELL_EFFECTS]; // 101-103 m_effectAuraPeriod
float EffectMultipleValue[MAX_SPELL_EFFECTS]; // 104-106 m_effectAmplitude
uint32 EffectChainTarget[MAX_SPELL_EFFECTS]; // 107-109 m_effectChainTargets
uint32 EffectItemType[MAX_SPELL_EFFECTS]; // 110-112 m_effectItemType
int32 EffectMiscValue[MAX_SPELL_EFFECTS]; // 113-115 m_effectMiscValue
int32 EffectMiscValueB[MAX_SPELL_EFFECTS]; // 116-118 m_effectMiscValueB
uint32 EffectTriggerSpell[MAX_SPELL_EFFECTS]; // 119-121 m_effectTriggerSpell
float EffectPointsPerComboPoint[MAX_SPELL_EFFECTS]; // 122-124 m_effectPointsPerCombo
flag96 EffectSpellClassMask[MAX_SPELL_EFFECTS]; //
uint32 SpellVisual[2]; // 134-135 m_spellVisualID
uint32 SpellIconID; // 136 m_spellIconID
uint32 activeIconID; // 137 m_activeIconID
+1 -1
View File
@@ -155,7 +155,7 @@ void DynamicObject::Delay(int32 delaytime)
m_aliveDuration -= delaytime;
for(AffectedSet::iterator iunit= m_affected.begin();iunit != m_affected.end();++iunit)
if (*iunit)
(*iunit)->DelayAura(m_spellId, m_effIndex, delaytime);
(*iunit)->DelayAura(m_spellId, GetCaster()->GetGUID() , delaytime);
}
bool DynamicObject::isVisibleForInState(Player const* u, bool inVisibleList) const
+1 -1
View File
@@ -960,7 +960,7 @@ namespace Trinity
bool operator()(Unit* u)
{
if(u->isAlive() && u->isInCombat() && /*!i_obj->IsHostileTo(u)*/ i_obj->IsFriendlyTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
!(u->HasAura(i_spell, 0) || u->HasAura(i_spell, 1) || u->HasAura(i_spell, 2)))
!(u->HasAura(i_spell)))
{
return true;
}
+1 -2
View File
@@ -205,8 +205,7 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
if (target->IsImmunedToSpell(spellInfo) || target->IsImmunedToSpellEffect(spellInfo, eff_index))
return;
// Apply PersistentAreaAura on target
PersistentAreaAura* Aur = new PersistentAreaAura(spellInfo, eff_index, NULL, target, i_dynobject.GetCaster());
target->AddAura(Aur);
target->AddAuraEffect(spellInfo->Id, eff_index, i_dynobject.GetCaster());
i_dynobject.AddAffected(target);
}
+11 -8
View File
@@ -30,6 +30,9 @@
#include "Group.h"
#include "SocialMgr.h"
#include "Util.h"
#include "SpellAuras.h"
class Aura;
/* differeces from off:
-you can uninvite yourself - is is useful
@@ -713,8 +716,8 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
{
if(auramask & (uint64(1) << i))
{
AuraSlotEntry * pAura = player->GetVisibleAura(i);
*data << uint32(pAura ? pAura->m_spellId : 0);
Aura * pAura = player->GetVisibleAura(i);
*data << uint32(pAura ? pAura->GetId() : 0);
*data << uint8(1);
}
}
@@ -795,8 +798,8 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
{
if(auramask & (uint64(1) << i))
{
AuraSlotEntry * pAura = pet->GetVisibleAura(i);
*data << uint32(pAura ? pAura->m_spellId : 0);
Aura * pAura = pet->GetVisibleAura(i);
*data << uint32(pAura ? pAura->GetId() : 0);
*data << uint8(1);
}
}
@@ -855,10 +858,10 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
data << (uint64) auramask; // placeholder
for(uint8 i = 0; i < MAX_AURAS; ++i)
{
if(AuraSlotEntry * pAura = player->GetVisibleAura(i))
if(Aura * pAura = player->GetVisibleAura(i))
{
auramask |= (uint64(1) << i);
data << (uint32) pAura->m_spellId;
data << (uint32) pAura->GetId();
data << (uint8) 1;
}
}
@@ -881,10 +884,10 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
data << (uint64) petauramask; // placeholder
for(uint8 i = 0; i < MAX_AURAS; ++i)
{
if(AuraSlotEntry * pAura = pet->GetVisibleAura(i))
if(Aura * pAura = pet->GetVisibleAura(i))
{
petauramask |= (uint64(1) << i);
data << (uint32) pAura->m_spellId;
data << (uint32) pAura->GetId();
data << (uint8) 1;
}
}
+1 -1
View File
@@ -52,7 +52,7 @@ void GuardAI::MoveInLineOfSight(Unit *u)
{
//Need add code to let guard support player
AttackStart(u);
//u->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
//u->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
}
}
}
+1 -1
View File
@@ -793,7 +793,7 @@ void WorldSession::HandleGuildSaveEmblemOpcode(WorldPacket& recvPacket)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
recvPacket >> EmblemStyle;
recvPacket >> EmblemColor;
+3 -3
View File
@@ -528,7 +528,7 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item *pItem = _player->GetItemByGuid( itemguid );
if( pItem )
@@ -633,7 +633,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Item *pItem = _player->GetItemFromBuyBackSlot( slot );
if( pItem )
@@ -720,7 +720,7 @@ void WorldSession::SendListInventory( uint64 vendorguid )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
pCreature->StopMoving();
+1 -1
View File
@@ -127,7 +127,7 @@ bool ChatHandler::HandleDismountCommand(const char* /*args*/)
}
m_session->GetPlayer()->Unmount();
m_session->GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
m_session->GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED);
return true;
}
+22 -46
View File
@@ -4018,6 +4018,7 @@ bool ChatHandler::HandleAuraCommand(const char* args)
uint32 spellID = extractSpellIdFromLink((char*)args);
SpellEntry const *spellInfo = sSpellStore.LookupEntry( spellID );
uint8 eff_mask=0;
if(spellInfo)
{
for(uint32 i = 0;i<3;i++)
@@ -4029,11 +4030,12 @@ bool ChatHandler::HandleAuraCommand(const char* args)
eff == SPELL_EFFECT_APPLY_AURA ||
eff == SPELL_EFFECT_PERSISTENT_AREA_AURA )
{
Aura *Aur = CreateAura(spellInfo, i, NULL, target);
target->AddAura(Aur);
eff_mask|=1<<i;
}
}
}
Aura *Aur = new Aura(spellInfo, eff_mask, NULL, target);
target->AddAura(Aur);
return true;
}
@@ -4938,16 +4940,18 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/)
std::ostringstream ss_name;
ss_name << "|cffffffff|Hspell:" << itr->second->GetId() << "|h[" << name << "]|h|r";
PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffIndex(),
itr->second->GetModifier()->m_auraname, itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffectMask(),
itr->second->GetAuraCharges(), itr->second->GetStackAmount(),itr->second->GetAuraSlot(),
itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
ss_name.str().c_str(),
(itr->second->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
IS_PLAYER_GUID(itr->second->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(itr->second->GetCasterGUID()));
}
else
{
PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffIndex(),
itr->second->GetModifier()->m_auraname, itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
PSendSysMessage(LANG_COMMAND_TARGET_AURADETAIL, itr->second->GetId(), itr->second->GetEffectMask(),
itr->second->GetAuraCharges(), itr->second->GetStackAmount(),itr->second->GetAuraSlot(),
itr->second->GetAuraDuration(), itr->second->GetAuraMaxDuration(),
name,
(itr->second->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
IS_PLAYER_GUID(itr->second->GetCasterGUID()) ? "player" : "creature",GUID_LOPART(itr->second->GetCasterGUID()));
@@ -4955,30 +4959,18 @@ bool ChatHandler::HandleListAurasCommand (const char * /*args*/)
}
for (int i = 0; i < TOTAL_AURAS; i++)
{
Unit::AuraList const& uAuraList = unit->GetAurasByType(AuraType(i));
Unit::AuraEffectList const& uAuraList = unit->GetAurasByType(AuraType(i));
if (uAuraList.empty()) continue;
PSendSysMessage(LANG_COMMAND_TARGET_LISTAURATYPE, uAuraList.size(), i);
for (Unit::AuraList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
for (Unit::AuraEffectList::const_iterator itr = uAuraList.begin(); itr != uAuraList.end(); ++itr)
{
bool talent = GetTalentSpellCost((*itr)->GetId()) > 0;
char const* name = (*itr)->GetSpellProto()->SpellName[m_session->GetSessionDbcLocale()];
if (m_session)
{
std::ostringstream ss_name;
ss_name << "|cffffffff|Hspell:" << (*itr)->GetId() << "|h[" << name << "]|h|r";
std::ostringstream ss_name;
ss_name << "|cffffffff|Hspell:" << (*itr)->GetId() << "|h[" << name << "]|h|r";
PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(),
ss_name.str().c_str(),((*itr)->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
IS_PLAYER_GUID((*itr)->GetCasterGUID()) ? "player" : "creature",GUID_LOPART((*itr)->GetCasterGUID()));
}
else
{
PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(),
name,((*itr)->IsPassive() ? passiveStr : ""),(talent ? talentStr : ""),
IS_PLAYER_GUID((*itr)->GetCasterGUID()) ? "player" : "creature",GUID_LOPART((*itr)->GetCasterGUID()));
}
PSendSysMessage(LANG_COMMAND_TARGET_AURASIMPLE, (*itr)->GetId(), (*itr)->GetEffIndex(),
(*itr)->GetAmount());
}
}
return true;
@@ -7405,26 +7397,10 @@ bool ChatHandler::HandleFreezeCommand(const char *args)
}
}
//stop movement and disable spells
uint32 spellID = 9454;
//m_session->GetPlayer()->CastSpell(player,spellID,false);
SpellEntry const *spellInfo = sSpellStore.LookupEntry( spellID );
if(spellInfo) //TODO: Change the duration of the aura to -1 instead of 5000000
{
for(uint32 i = 0;i<3;i++)
{
uint8 eff = spellInfo->Effect[i];
if (eff>=TOTAL_SPELL_EFFECTS)
continue;
if( eff == SPELL_EFFECT_APPLY_AREA_AURA_PARTY || eff == SPELL_EFFECT_APPLY_AURA ||
eff == SPELL_EFFECT_PERSISTENT_AREA_AURA || eff == SPELL_EFFECT_APPLY_AREA_AURA_FRIEND ||
eff == SPELL_EFFECT_APPLY_AREA_AURA_ENEMY)
{
Aura *Aur = CreateAura(spellInfo, i, NULL, player);
player->AddAura(Aur);
}
}
}
SpellEntry const *spellInfo = sSpellStore.LookupEntry( 9454 );
Aura *Aur = new Aura(spellInfo, 1, NULL, player);
player->AddAura(Aur);
//save player
player->SaveToDB();
@@ -7580,9 +7556,9 @@ bool ChatHandler::HandleUnPossessCommand(const char* args)
Unit* pUnit = getSelectedUnit();
if(!pUnit) pUnit = m_session->GetPlayer();
pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
pUnit->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
pUnit->RemoveAurasByType(SPELL_AURA_MOD_CHARM);
pUnit->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET);
pUnit->RemoveAurasByType(SPELL_AURA_MOD_POSSESS);
return true;
}
+3 -3
View File
@@ -118,7 +118,7 @@ void WorldSession::HandleGossipSelectOptionOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!code.empty())
{
@@ -354,7 +354,7 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
//Can not logout if...
if( GetPlayer()->isInCombat() || //...is in combat
GetPlayer()->duel || //...is in Duel
GetPlayer()->HasAura(9454,0) || //...is frozen by GM via freeze command
GetPlayer()->HasAura(9454) || //...is frozen by GM via freeze command
//...is jumping ...is falling
GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_JUMPING | MOVEMENTFLAG_FALLING))
{
@@ -1648,7 +1648,7 @@ void WorldSession::HandleDismountOpcode( WorldPacket & /*recv_data*/ )
}
_player->Unmount();
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
_player->RemoveAurasByType(SPELL_AURA_MOUNTED);
}
void WorldSession::HandleMoveFlyModeChangeAckOpcode( WorldPacket & recv_data )
+2 -2
View File
@@ -150,7 +150,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
// mount allow check
if(!mEntry->IsMountAllowed())
_player->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
_player->RemoveAurasByType(SPELL_AURA_MOUNTED);
// honorless target
if(GetPlayer()->pvpInfo.inHostileArea)
@@ -262,7 +262,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data )
plMover->UpdateFallInformationIfNeed(movementInfo,recv_data.GetOpcode());
if(plMover->isMovingOrTurning())
plMover->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
plMover->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(movementInfo.z < -500.0f)
{
+15 -15
View File
@@ -54,7 +54,7 @@ void WorldSession::HandleTabardVendorActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendTabardVendorActivate(guid);
}
@@ -85,7 +85,7 @@ void WorldSession::HandleBankerActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendShowBank(guid);
}
@@ -126,7 +126,7 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// trainer list loaded at check;
if(!unit->isCanTrainingOf(_player,true))
@@ -212,7 +212,7 @@ void WorldSession::HandleTrainerBuySpellOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!unit->isCanTrainingOf(_player,true))
return;
@@ -279,7 +279,7 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
GetPlayer()->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
// remove fake death
//if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
// GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
// GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if( unit->isArmorer() || unit->isCivilian() || unit->isQuestGiver() || unit->isServiceProvider())
{
@@ -337,7 +337,7 @@ void WorldSession::HandleGossipHelloOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!code.empty())
{
@@ -370,7 +370,7 @@ void WorldSession::HandleSpiritHealerActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendSpiritResurrect();
}
@@ -431,7 +431,7 @@ void WorldSession::HandleBinderActivateOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
SendBindPoint(unit);
}
@@ -500,11 +500,11 @@ void WorldSession::HandleListStabledPetsOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// remove mounts this fix bug where getting pet from stable while mounted deletes pet.
if(GetPlayer()->IsMounted())
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED);
SendStablePet(npcGUID);
}
@@ -580,7 +580,7 @@ void WorldSession::HandleStablePet( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
Pet *pet = _player->GetPet();
@@ -641,7 +641,7 @@ void WorldSession::HandleUnstablePet( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
WorldPacket data(SMSG_STABLE_RESULT, 200); // guess size
@@ -700,7 +700,7 @@ void WorldSession::HandleBuyStableSlot( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
WorldPacket data(SMSG_STABLE_RESULT, 200);
@@ -746,7 +746,7 @@ void WorldSession::HandleStableSwapPet( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
WorldPacket data(SMSG_STABLE_RESULT, 200); // guess size
@@ -802,7 +802,7 @@ void WorldSession::HandleRepairItemOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// reputation discount
float discountMod = _player->GetReputationPriceDiscount(unit);
+6 -6
View File
@@ -1802,10 +1802,10 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
if(petType == SUMMON_PET && pet->LoadPetFromDB(this, entry))
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
Unit::AuraEffectList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
{
if((*itr)->GetModifier()->m_miscvalue==2228)
if((*itr)->GetMiscValue()==2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
@@ -1880,10 +1880,10 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
if(petType == SUMMON_PET)
{
// Remove Demonic Sacrifice auras (known pet)
Unit::AuraList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
Unit::AuraEffectList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
{
if((*itr)->GetModifier()->m_miscvalue==2228)
if((*itr)->GetMiscValue()==2228)
{
RemoveAurasDueToSpell((*itr)->GetId());
itr = auraClassScripts.begin();
+2 -2
View File
@@ -129,7 +129,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
switch(trigger)
{
case SI_AREATRIGGER_A:
if(plr->GetTeam() == ALLIANCE && plr->HasAura(SI_SILITHYST_FLAG,0))
if(plr->GetTeam() == ALLIANCE && plr->HasAura(SI_SILITHYST_FLAG))
{
// remove aura
plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
@@ -154,7 +154,7 @@ bool OutdoorPvPSI::HandleAreaTrigger(Player *plr, uint32 trigger)
}
return true;
case SI_AREATRIGGER_H:
if(plr->GetTeam() == HORDE && plr->HasAura(SI_SILITHYST_FLAG,0))
if(plr->GetTeam() == HORDE && plr->HasAura(SI_SILITHYST_FLAG))
{
// remove aura
plr->RemoveAurasDueToSpell(SI_SILITHYST_FLAG);
+45 -75
View File
@@ -564,10 +564,10 @@ void Pet::RegenerateFocus()
float addvalue = 24 * sWorld.getRate(RATE_POWER_FOCUS);
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == POWER_FOCUS)
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
AuraEffectList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetMiscValue() == POWER_FOCUS)
addvalue *= ((*i)->GetAmount() + 100) / 100.0f;
ModifyPower(POWER_FOCUS, (int32)addvalue);
}
@@ -1079,41 +1079,39 @@ void Pet::_SaveSpells()
void Pet::_LoadAuras(uint32 timediff)
{
sLog.outDebug("Loading auras for pet %u",GetGUIDLow());
m_Auras.clear();
for (int i = 0; i < TOTAL_AURAS; i++)
m_modAuras[i].clear();
QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2 ,maxduration,remaintime,remaincharges FROM pet_aura WHERE guid = '%u'",m_charmInfo->GetPetNumber());
if(result)
{
do
{
int32 damage[3];
Field *fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
uint32 spellid = fields[1].GetUInt32();
uint32 effindex = fields[2].GetUInt32();
uint32 stackcount= fields[3].GetUInt32();
int32 damage = (int32)fields[4].GetUInt32();
int32 maxduration = (int32)fields[5].GetUInt32();
int32 remaintime = (int32)fields[6].GetUInt32();
int32 remaincharges = (int32)fields[7].GetUInt32();
uint32 effmask = fields[2].GetUInt32();
uint32 stackcount = fields[3].GetUInt32();
damage[0] = int32(fields[4].GetUInt32());
damage[1] = int32(fields[5].GetUInt32());
damage[2] = int32(fields[6].GetUInt32());
int32 maxduration = (int32)fields[7].GetUInt32();
int32 remaintime = (int32)fields[8].GetUInt32();
int32 remaincharges = (int32)fields[9].GetUInt32();
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
if(!spellproto)
{
sLog.outError("Unknown aura (spellid %u, effindex %u), ignore.",spellid,effindex);
continue;
}
if(effindex >= 3)
{
sLog.outError("Invalid effect index (spellid %u, effindex %u), ignore.",spellid,effindex);
sLog.outError("Unknown aura (spellid %u), ignore.",spellid);
continue;
}
// negative effects should continue counting down after logout
if (remaintime != -1 && !IsPositiveEffect(spellid, effindex))
if (remaintime != -1 && !IsPositiveSpell(spellid))
{
if(remaintime <= int32(timediff))
continue;
@@ -1128,21 +1126,12 @@ void Pet::_LoadAuras(uint32 timediff)
remaincharges = spellproto->procCharges;
}
else
remaincharges = -1;
remaincharges = 0;
/// do not load single target auras (unless they were cast by the player)
if (caster_guid != GetGUID() && IsSingleTargetSpell(spellproto))
continue;
for(uint32 i=0; i<stackcount; i++)
{
Aura* aura = CreateAura(spellproto, effindex, NULL, this, NULL);
if(!damage)
damage = aura->GetModifier()->m_amount;
aura->SetLoadedState(caster_guid,damage,maxduration,remaintime,remaincharges);
AddAura(aura);
}
Aura* aura = new Aura(spellproto, effmask, NULL, this, NULL, NULL);
aura->SetLoadedState(caster_guid,maxduration,remaintime,remaincharges, stackcount, &damage[0]);
AddAura(aura);
sLog.outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
while( result->NextRow() );
@@ -1155,52 +1144,33 @@ void Pet::_SaveAuras()
CharacterDatabase.PExecute("DELETE FROM pet_aura WHERE guid = '%u'", m_charmInfo->GetPetNumber());
AuraMap const& auras = GetAuras();
if (auras.empty())
return;
spellEffectPair lastEffectPair = auras.begin()->first;
uint32 stackCounter = 1;
for(AuraMap::const_iterator itr = auras.begin(); ; ++itr)
for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr)
{
if(itr == auras.end() || lastEffectPair != itr->first)
// skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras.
// do not save single target auras (unless they were cast by the player)
if (itr->second->IsPassive()
|| (itr->second->GetCasterGUID() != GetGUID() && itr->second->IsSingleTarget()))
continue;
SpellEntry const *spellInfo = itr->second->GetSpellProto();
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH ||
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_OWNER ||
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PET )
continue;
uint32 amounts[MAX_SPELL_EFFECTS];
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
AuraMap::const_iterator itr2 = itr;
// save previous spellEffectPair to db
itr2--;
SpellEntry const *spellInfo = itr2->second->GetSpellProto();
/// do not save single target auras (unless they were cast by the player)
if (!(itr2->second->GetCasterGUID() != GetGUID() && IsSingleTargetSpell(spellInfo)))
{
if(!itr2->second->IsPassive())
{
// skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras.
uint8 i;
for (i = 0; i < 3; i++)
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH ||
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_OWNER ||
spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AREA_AURA_PET )
break;
if (i == 3)
{
CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "', '%u', '%u', '%u', '%d', '%d', '%d', '%d')",
m_charmInfo->GetPetNumber(), itr2->second->GetCasterGUID(),(uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount ,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
}
}
}
if(itr == auras.end())
break;
if (AuraEffect * partAura = itr->second->GetPartAura(i))
amounts[i]=partAura->GetAmount();
else
amounts[i]=0;
}
if (lastEffectPair == itr->first)
stackCounter++;
else
{
lastEffectPair = itr->first;
stackCounter = 1;
}
CharacterDatabase.PExecute("INSERT INTO pet_aura (guid,caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "', '%u', '%u', '%u', '%u', '%u', '%d', '%d', '%d', '%d')",
m_charmInfo->GetPetNumber(), itr->second->GetCasterGUID(),(uint32)itr->second->GetId(), (uint32)itr->second->GetEffectMask(),
(uint32)itr->second->GetStackAmount(), amounts[0], amounts[1], amounts[2]
,int(itr->second->GetAuraMaxDuration()),int(itr->second->GetAuraDuration()),int(itr->second->GetAuraCharges()));
}
}
+2 -2
View File
@@ -91,7 +91,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket & recv_data)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
uint32 charterid = 0;
uint32 cost = 0;
@@ -915,7 +915,7 @@ void WorldSession::SendPetitionShowList(uint64 guid)
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
uint8 count = 0;
if(pCreature->isTabardDesigner())
+134 -202
View File
@@ -64,6 +64,7 @@
#include "SocialMgr.h"
#include "GameEventMgr.h"
#include "AchievementMgr.h"
#include "SpellAuras.h"
#include <cmath>
@@ -933,9 +934,9 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= sWorld.getConfig(CONFIG_DISABLE_BREATHING))
return DISABLED_MIRROR_TIMER;
int32 UnderWaterTime = 3*MINUTE*IN_MILISECONDS;
AuraList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
for(AuraList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetModifier()->m_amount) / 100.0f);
AuraEffectList const& mModWaterBreathing = GetAurasByType(SPELL_AURA_MOD_WATER_BREATHING);
for(AuraEffectList::const_iterator i = mModWaterBreathing.begin(); i != mModWaterBreathing.end(); ++i)
UnderWaterTime = uint32(UnderWaterTime * (100.0f + (*i)->GetAmount()) / 100.0f);
return UnderWaterTime;
}
case FIRE_TIMER:
@@ -1997,10 +1998,10 @@ void Player::Regenerate(Powers power)
// Exist only for POWER_MANA, POWER_ENERGY, POWER_FOCUS auras
if(power != POWER_MANA)
{
AuraList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == power)
addvalue *= ((*i)->GetModifier()->m_amount + 100) / 100.0f;
AuraEffectList const& ModPowerRegenPCTAuras = GetAurasByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraEffectList::const_iterator i = ModPowerRegenPCTAuras.begin(); i != ModPowerRegenPCTAuras.end(); ++i)
if ((*i)->GetMiscValue() == power)
addvalue *= ((*i)->GetAmount() + 100) / 100.0f;
}
if (power != POWER_RAGE && power != POWER_RUNIC_POWER)
@@ -2039,9 +2040,9 @@ void Player::RegenerateHealth()
addvalue = OCTRegenHPPerSpirit()* HealthIncreaseRate;
if (!isInCombat())
{
AuraList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for(AuraList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
addvalue *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
AuraEffectList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for(AuraEffectList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
addvalue *= (100.0f + (*i)->GetAmount()) / 100.0f;
}
else if(HasAuraType(SPELL_AURA_MOD_REGEN_DURING_COMBAT))
addvalue *= GetTotalAuraModifier(SPELL_AURA_MOD_REGEN_DURING_COMBAT) / 100.0f;
@@ -2112,7 +2113,7 @@ void Player::SetGameMaster(bool on)
else
{
// restore phase
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
AuraEffectList const& phases = GetAurasByType(SPELL_AURA_PHASE);
SetPhaseMask(!phases.empty() ? phases.front()->GetMiscValue() : PHASEMASK_NORMAL,false);
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
@@ -2243,9 +2244,9 @@ void Player::GiveXP(uint32 xp, Unit* victim)
return;
// handle SPELL_AURA_MOD_XP_PCT auras
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
xp = uint32(xp*(1.0f + (*i)->GetModifier()->m_amount / 100.0f));
Unit::AuraEffectList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_XP_PCT);
for(Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin();i != ModXPPctAuras.end(); ++i)
xp = uint32(xp*(1.0f + (*i)->GetAmount() / 100.0f));
// XP resting bonus for kill
uint32 rested_bonus_xp = victim ? GetXPRestBonus(xp) : 0;
@@ -4049,12 +4050,9 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
{
int32 delta = (int32(getLevel()) - startLevel + 1)*MINUTE;
for(int i =0; i < 3; ++i)
if(Aura* Aur = GetAura(SPELL_ID_PASSIVE_RESURRECTION_SICKNESS, GetGUID()))
{
if(Aura* Aur = GetAura(SPELL_ID_PASSIVE_RESURRECTION_SICKNESS,i))
{
Aur->SetAuraDurationAndUpdate(delta*IN_MILISECONDS);
}
Aur->SetAuraDuration(delta*IN_MILISECONDS);
}
}
}
@@ -4780,10 +4778,10 @@ void Player::ApplyRatingMod(CombatRating cr, int32 value, bool apply)
int32 amount = uint32(m_baseRatingValue[cr]);
// Apply bonus from SPELL_AURA_MOD_RATING_FROM_STAT
// stat used stored in miscValueB for this aura
AuraList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
for(AuraList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
AuraEffectList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
for(AuraEffectList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
if ((*i)->GetMiscValue() & (1<<cr))
amount += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetModifier()->m_amount / 100.0f);
amount += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetAmount() / 100.0f);
if (amount < 0)
amount = 0;
SetUInt32Value(PLAYER_FIELD_COMBAT_RATING_1 + cr, uint32(amount));
@@ -5270,15 +5268,15 @@ void Player::SetSkill(uint32 id, uint16 currVal, uint16 maxVal)
SetUInt32Value(PLAYER_SKILL_BONUS_INDEX(i),0);
// temporary bonuses
AuraList const& mModSkill = GetAurasByType(SPELL_AURA_MOD_SKILL);
for(AuraList::const_iterator i = mModSkill.begin(); i != mModSkill.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == int32(id))
AuraEffectList const& mModSkill = GetAurasByType(SPELL_AURA_MOD_SKILL);
for(AuraEffectList::const_iterator i = mModSkill.begin(); i != mModSkill.end(); ++i)
if ((*i)->GetMiscValue() == int32(id))
(*i)->ApplyModifier(true);
// permanent bonuses
AuraList const& mModSkillTalent = GetAurasByType(SPELL_AURA_MOD_SKILL_TALENT);
for(AuraList::const_iterator i = mModSkillTalent.begin(); i != mModSkillTalent.end(); ++i)
if ((*i)->GetModifier()->m_miscvalue == int32(id))
AuraEffectList const& mModSkillTalent = GetAurasByType(SPELL_AURA_MOD_SKILL_TALENT);
for(AuraEffectList::const_iterator i = mModSkillTalent.begin(); i != mModSkillTalent.end(); ++i)
if ((*i)->GetMiscValue() == int32(id))
(*i)->ApplyModifier(true);
// Learn all spells for skill
@@ -6306,7 +6304,7 @@ void Player::DuelComplete(DuelCompleteType type)
}
for(size_t i=0; i<auras2remove.size(); i++)
duel->opponent->RemoveAurasByCasterSpell(auras2remove[i], GetGUID(), AURA_REMOVE_BY_DELETE);
duel->opponent->RemoveAurasDueToSpell(auras2remove[i], GetGUID());
auras2remove.clear();
AuraMap const& auras = GetAuras();
@@ -6316,7 +6314,7 @@ void Player::DuelComplete(DuelCompleteType type)
auras2remove.push_back(i->second->GetId());
}
for(size_t i=0; i<auras2remove.size(); i++)
RemoveAurasByCasterSpell(auras2remove[i], duel->opponent->GetGUID(), AURA_REMOVE_BY_DELETE);
RemoveAurasDueToSpell(auras2remove[i], duel->opponent->GetGUID());
// cleanup combo points
if(GetComboTarget()==duel->opponent->GetGUID())
@@ -6647,20 +6645,20 @@ void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool appl
void Player::_ApplyWeaponDependentAuraMods(Item *item,WeaponAttackType attackType,bool apply)
{
AuraList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT);
for(AuraList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end();++itr)
AuraEffectList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT);
for(AuraEffectList::const_iterator itr = auraCritList.begin(); itr!=auraCritList.end();++itr)
_ApplyWeaponDependentAuraCritMod(item,attackType,*itr,apply);
AuraList const& auraDamageFlatList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
for(AuraList::const_iterator itr = auraDamageFlatList.begin(); itr!=auraDamageFlatList.end();++itr)
AuraEffectList const& auraDamageFlatList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
for(AuraEffectList::const_iterator itr = auraDamageFlatList.begin(); itr!=auraDamageFlatList.end();++itr)
_ApplyWeaponDependentAuraDamageMod(item,attackType,*itr,apply);
AuraList const& auraDamagePCTList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for(AuraList::const_iterator itr = auraDamagePCTList.begin(); itr!=auraDamagePCTList.end();++itr)
AuraEffectList const& auraDamagePCTList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for(AuraEffectList::const_iterator itr = auraDamagePCTList.begin(); itr!=auraDamagePCTList.end();++itr)
_ApplyWeaponDependentAuraDamageMod(item,attackType,*itr,apply);
}
void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply)
void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply)
{
// generic not weapon specific case processes in aura code
if(aura->GetSpellProto()->EquippedItemClass == -1)
@@ -6677,15 +6675,14 @@ void Player::_ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attac
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
HandleBaseModValue(mod, FLAT_MOD, float (aura->GetModifier()->m_amount), apply);
HandleBaseModValue(mod, FLAT_MOD, float (aura->GetAmount()), apply);
}
}
void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply)
void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply)
{
// ignore spell mods for not wands
Modifier const* modifier = aura->GetModifier();
if((modifier->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)==0 && (getClassMask() & CLASSMASK_WAND_USERS)==0)
if((aura->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)==0 && (getClassMask() & CLASSMASK_WAND_USERS)==0)
return;
// generic not weapon specific case processes in aura code
@@ -6702,7 +6699,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
}
UnitModifierType unitModType = TOTAL_VALUE;
switch(modifier->m_auraname)
switch(aura->GetAuraName())
{
case SPELL_AURA_MOD_DAMAGE_DONE: unitModType = TOTAL_VALUE; break;
case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: unitModType = TOTAL_PCT; break;
@@ -6711,7 +6708,7 @@ void Player::_ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType att
if (item->IsFitToSpellRequirements(aura->GetSpellProto()))
{
HandleStatModifier(unitMod, unitModType, float(aura->GetModifier()->m_amount),apply);
HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()),apply);
}
}
@@ -6755,24 +6752,10 @@ void Player::ApplyEquipSpell(SpellEntry const* spellInfo, Item* item, bool apply
if(form_change) // check aura active state from other form
{
bool found = false;
for (int k=0; k < 3; ++k)
{
spellEffectPair spair = spellEffectPair(spellInfo->Id, k);
for (AuraMap::iterator iter = m_Auras.lower_bound(spair); iter != m_Auras.upper_bound(spair); ++iter)
{
if(!item || iter->second->GetCastItemGUID() == item->GetGUID())
{
found = true;
break;
}
}
if(found)
break;
}
if(found) // and skip re-cast already active aura at form change
return;
AuraMap const& auras = GetAuras();
for(AuraMap::const_iterator itr = auras.lower_bound(spellInfo->Id); itr != auras.upper_bound(spellInfo->Id); ++itr)
if(!item || itr->second->GetCastItemGUID()==item->GetGUID())
return;
}
DEBUG_LOG("WORLD: cast %s Equip spellId - %i", (item ? "item" : "itemset"), spellInfo->Id);
@@ -12542,7 +12525,7 @@ void Player::AddQuest( Quest const *pQuest, Object *questGiver )
for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
if(itr->second->autocast && itr->second->IsFitToRequirements(this,zone,area))
if( !HasAura(itr->second->spellId,0) )
if( !HasAura(itr->second->spellId) )
CastSpell(this,itr->second->spellId,true);
}
@@ -12770,7 +12753,7 @@ void Player::RewardQuest( Quest const *pQuest, uint32 reward, Object* questGiver
for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
if(itr->second->autocast && itr->second->IsFitToRequirements(this,zone,area))
if( !HasAura(itr->second->spellId,0) )
if( !HasAura(itr->second->spellId) )
CastSpell(this,itr->second->spellId,true);
}
}
@@ -14695,41 +14678,39 @@ void Player::_LoadActions(QueryResult *result)
void Player::_LoadAuras(QueryResult *result, uint32 timediff)
{
sLog.outDebug("Loading auras for player %u",GetGUIDLow());
m_Auras.clear();
for (int i = 0; i < TOTAL_AURAS; i++)
m_modAuras[i].clear();
//QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow());
//QueryResult *result = CharacterDatabase.PQuery("SELECT caster_guid,spell,effect_mask,stackcount,amount0,amount1,amount2,maxduration,remaintime,remaincharges FROM character_aura WHERE guid = '%u'",GetGUIDLow());
if(result)
{
do
{
int32 damage[3];
Field *fields = result->Fetch();
uint64 caster_guid = fields[0].GetUInt64();
uint32 spellid = fields[1].GetUInt32();
uint32 effindex = fields[2].GetUInt32();
uint32 effmask = fields[2].GetUInt32();
uint32 stackcount = fields[3].GetUInt32();
int32 damage = (int32)fields[4].GetUInt32();
int32 maxduration = (int32)fields[5].GetUInt32();
int32 remaintime = (int32)fields[6].GetUInt32();
int32 remaincharges = (int32)fields[7].GetUInt32();
damage[0] = int32(fields[4].GetUInt32());
damage[1] = int32(fields[5].GetUInt32());
damage[2] = int32(fields[6].GetUInt32());
int32 maxduration = (int32)fields[7].GetUInt32();
int32 remaintime = (int32)fields[8].GetUInt32();
int32 remaincharges = (int32)fields[9].GetUInt32();
SpellEntry const* spellproto = sSpellStore.LookupEntry(spellid);
if(!spellproto)
{
sLog.outError("Unknown aura (spellid %u, effindex %u), ignore.",spellid,effindex);
continue;
}
if(effindex >= 3)
{
sLog.outError("Invalid effect index (spellid %u, effindex %u), ignore.",spellid,effindex);
sLog.outError("Unknown aura (spellid %u), ignore.",spellid);
continue;
}
// negative effects should continue counting down after logout
if (remaintime != -1 && !IsPositiveEffect(spellid, effindex))
if (remaintime != -1 && !IsPositiveSpell(spellid))
{
if(remaintime <= int32(timediff))
continue;
@@ -14746,21 +14727,10 @@ void Player::_LoadAuras(QueryResult *result, uint32 timediff)
else
remaincharges = 0;
for(uint32 i=0; i<stackcount; i++)
{
Aura* aura = CreateAura(spellproto, effindex, NULL, this, NULL);
if(!damage)
damage = aura->GetModifier()->m_amount;
// reset stolen single target auras
if (caster_guid != GetGUID() && aura->IsSingleTarget())
aura->SetIsSingleTarget(false);
aura->SetLoadedState(caster_guid,damage,maxduration,remaintime,remaincharges);
AddAura(aura);
sLog.outDetail("Added aura spellid %u, effect %u", spellproto->Id, effindex);
}
Aura* aura = new Aura(spellproto, effmask, NULL, this, NULL, NULL);
aura->SetLoadedState(caster_guid,maxduration,remaintime,remaincharges, stackcount, &damage[0]);
AddAura(aura);
sLog.outDetail("Added aura spellid %u, effectmask %u", spellproto->Id, effmask);
}
while( result->NextRow() );
@@ -15852,57 +15822,33 @@ void Player::_SaveAuras()
CharacterDatabase.PExecute("DELETE FROM character_aura WHERE guid = '%u'",GetGUIDLow());
AuraMap const& auras = GetAuras();
if (auras.empty())
return;
spellEffectPair lastEffectPair = auras.begin()->first;
uint32 stackCounter = 1;
for(AuraMap::const_iterator itr = auras.begin(); ; ++itr)
for(AuraMap::const_iterator itr = auras.begin(); itr !=auras.end() ; ++itr)
{
if(itr == auras.end() || lastEffectPair != itr->first)
// skip all auras from spell that apply at cast SPELL_AURA_MOD_SHAPESHIFT or pet area auras.
// do not save single target auras (unless they were cast by the player)
if (itr->second->IsPassive()
|| (itr->second->GetCasterGUID() != GetGUID() && itr->second->IsSingleTarget())
|| itr->second->IsRemovedOnShapeLost())
continue;
SpellEntry const *spellInfo = itr->second->GetSpellProto();
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
if (spellInfo->Effect[i] == SPELL_AURA_MOD_SHAPESHIFT ||
spellInfo->Effect[i] == SPELL_AURA_MOD_STEALTH )
continue;
uint32 amounts[MAX_SPELL_EFFECTS];
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
AuraMap::const_iterator itr2 = itr;
// save previous spellEffectPair to db
itr2--;
SpellEntry const *spellInfo = itr2->second->GetSpellProto();
//skip all auras from spells that are passive or need a shapeshift
if (!(itr2->second->IsPassive() || itr2->second->IsRemovedOnShapeLost()))
{
//do not save single target auras (unless they were cast by the player)
if (!(itr2->second->GetCasterGUID() != GetGUID() && itr2->second->IsSingleTarget()))
{
uint8 i;
// or apply at cast SPELL_AURA_MOD_SHAPESHIFT or SPELL_AURA_MOD_STEALTH auras
for (i = 0; i < 3; i++)
if (spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_SHAPESHIFT ||
spellInfo->EffectApplyAuraName[i] == SPELL_AURA_MOD_STEALTH)
break;
if (i == 3)
{
CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_index,stackcount,amount,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "' ,'%u', '%u', '%u', '%d', '%d', '%d', '%d')",
GetGUIDLow(), itr2->second->GetCasterGUID(), (uint32)itr2->second->GetId(), (uint32)itr2->second->GetEffIndex(), (uint32)itr2->second->GetStackAmount(), itr2->second->GetModifier()->m_amount ,int(itr2->second->GetAuraMaxDuration()),int(itr2->second->GetAuraDuration()),int(itr2->second->GetAuraCharges()));
}
}
}
if(itr == auras.end())
break;
if (AuraEffect * partAura = itr->second->GetPartAura(i))
amounts[i]=partAura->GetAmount();
else
amounts[i]=0;
}
//TODO: if need delete this
if (lastEffectPair == itr->first)
stackCounter++;
else
{
lastEffectPair = itr->first;
stackCounter = 1;
}
CharacterDatabase.PExecute("INSERT INTO character_aura (guid,caster_guid,spell,effect_mask,stackcount,amount0, amount1, amount2,maxduration,remaintime,remaincharges) "
"VALUES ('%u', '" I64FMTD "', '%u', '%u', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
GetGUIDLow(), itr->second->GetCasterGUID(),(uint32)itr->second->GetId(), (uint32)itr->second->GetEffectMask(),
(uint32)itr->second->GetStackAmount(), amounts[0], amounts[1], amounts[2]
,int(itr->second->GetAuraMaxDuration()),int(itr->second->GetAuraDuration()),int(itr->second->GetAuraCharges()));
}
}
@@ -16592,9 +16538,9 @@ void Player::StopCastingCharm()
}
if(GetCharmGUID())
{
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_CHARM);
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS_PET);
charm->RemoveSpellsCausingAura(SPELL_AURA_MOD_POSSESS);
charm->RemoveAurasByType(SPELL_AURA_MOD_CHARM);
charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS_PET);
charm->RemoveAurasByType(SPELL_AURA_MOD_POSSESS);
}
if(GetCharmGUID())
@@ -18342,7 +18288,7 @@ void Player::AddComboPoints(Unit* target, int8 count)
return;
// without combo points lost (duration checked in aura)
RemoveSpellsCausingAura(SPELL_AURA_RETAIN_COMBO_POINTS);
RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
if(target->GetGUID() == m_comboTarget)
{
@@ -18372,7 +18318,7 @@ void Player::ClearComboPoints()
return;
// without combopoints lost (duration checked in aura)
RemoveSpellsCausingAura(SPELL_AURA_RETAIN_COMBO_POINTS);
RemoveAurasByType(SPELL_AURA_RETAIN_COMBO_POINTS);
m_comboPoints = 0;
@@ -18468,7 +18414,7 @@ void Player::SendInitialPacketsAfterAddToMap()
};
for(AuraType const* itr = &auratypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr)
{
Unit::AuraList const& auraList = GetAurasByType(*itr);
Unit::AuraEffectList const& auraList = GetAurasByType(*itr);
if(!auraList.empty())
auraList.front()->ApplyModifier(true,true);
}
@@ -18725,43 +18671,29 @@ void Player::SendAurasForTarget(Unit *target)
Unit::VisibleAuraMap const *visibleAuras = target->GetVisibleAuras();
for(Unit::VisibleAuraMap::const_iterator itr = visibleAuras->begin(); itr != visibleAuras->end(); ++itr)
{
Aura * aura=NULL;
for (uint8 i=0 ; i<3; i++)
Aura * aura=itr->second;
data << uint8(aura->GetAuraSlot());
data << uint32(aura->GetId());
// flags
data << aura->m_auraFlags;
// level
data << aura->m_auraLevel;
// charges
data << uint8(aura->GetStackAmount() ? aura->GetStackAmount() : aura->GetAuraCharges());
if(!(aura->m_auraFlags & AFLAG_CASTER))
{
if (itr->second.m_slotAuras[i])
{
aura=itr->second.m_slotAuras[i];
break;
}
if (Unit * caster = aura->GetCaster())
data.append(caster->GetPackGUID());
else
data << uint8(0);
}
if(aura)
if(aura->m_auraFlags & AFLAG_DURATION) // include aura duration
{
data << uint8(aura->GetAuraSlot());
data << uint32(aura->GetId());
if(aura->GetId())
{
// flags
data << itr->second.m_Flags;
// level
data << itr->second.m_Level;
// charges
data << uint8(aura->GetAuraCharges());
if(!(itr->second.m_Flags & AFLAG_CASTER))
{
if (Unit * caster = aura->GetCaster())
data.append(caster->GetPackGUID());
else
data << uint8(0);
}
if(itr->second.m_Flags & AFLAG_DURATION) // include aura duration
{
data << uint32(aura->GetAuraMaxDuration());
data << uint32(aura->GetAuraDuration());
}
}
data << uint32(aura->GetAuraMaxDuration());
data << uint32(aura->GetAuraDuration());
}
}
@@ -19124,8 +19056,8 @@ uint32 Player::GetResurrectionSpellId()
// search priceless resurrection possibilities
uint32 prio = 0;
uint32 spell_id = 0;
AuraList const& dummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
for(AuraList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
AuraEffectList const& dummyAuras = GetAurasByType(SPELL_AURA_DUMMY);
for(AuraEffectList::const_iterator itr = dummyAuras.begin(); itr != dummyAuras.end(); ++itr)
{
// Soulstone Resurrection // prio: 3 (max, non death persistent)
if( prio < 2 && (*itr)->GetSpellProto()->SpellVisual[0] == 99 && (*itr)->GetSpellProto()->SpellIconID == 92 )
@@ -19368,15 +19300,15 @@ void Player::UpdateZoneDependentAuras( uint32 newZone )
// remove new continent flight forms
if( !IsAllowUseFlyMountsHere() )
{
RemoveSpellsCausingAura(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
RemoveSpellsCausingAura(SPELL_AURA_FLY);
RemoveAurasByType(SPELL_AURA_MOD_INCREASE_FLIGHT_SPEED);
RemoveAurasByType(SPELL_AURA_FLY);
}
// Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAreaMapBounds(newZone);
for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
if(itr->second->autocast && itr->second->IsFitToRequirements(this,newZone,0))
if( !HasAura(itr->second->spellId,0) )
if( !HasAura(itr->second->spellId) )
CastSpell(this,itr->second->spellId,true);
}
@@ -19396,7 +19328,7 @@ void Player::UpdateAreaDependentAuras( uint32 newArea )
SpellAreaForAreaMapBounds saBounds = spellmgr.GetSpellAreaForAreaMapBounds(newArea);
for(SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
if(itr->second->autocast && itr->second->IsFitToRequirements(this,m_zoneUpdateId,newArea))
if( !HasAura(itr->second->spellId,0) )
if( !HasAura(itr->second->spellId) )
CastSpell(this,itr->second->spellId,true);
}
@@ -19645,9 +19577,9 @@ void Player::StopCastingBindSight()
{
if(target->isType(TYPEMASK_UNIT))
{
((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_BIND_SIGHT, GetGUID());
((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_MOD_POSSESS, GetGUID());
((Unit*)target)->RemoveAuraTypeByCaster(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
((Unit*)target)->RemoveAura(SPELL_AURA_BIND_SIGHT, GetGUID());
((Unit*)target)->RemoveAura(SPELL_AURA_MOD_POSSESS, GetGUID());
((Unit*)target)->RemoveAura(SPELL_AURA_MOD_POSSESS_PET, GetGUID());
}
}
}
@@ -19703,7 +19635,7 @@ bool Player::CanUseBattleGroundObject()
!isTotalImmune() && // not totally immune
!HasStealthAura() && // not stealthed
!HasInvisibilityAura() && // not invisible
!HasAura(SPELL_RECENTLY_DROPPED_FLAG, 0) && // can't pickup
!HasAura(SPELL_RECENTLY_DROPPED_FLAG) && // can't pickup
//TODO player cannot use object when he is invulnerable (immune) - (ice block, divine shield, divine protection, divine intervention ...)
isAlive() // live player
);
@@ -19866,12 +19798,12 @@ void Player::ExitVehicle(Vehicle *vehicle)
bool Player::isTotalImmune()
{
AuraList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
AuraEffectList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
uint32 immuneMask = 0;
for(AuraList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
for(AuraEffectList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
{
immuneMask |= (*itr)->GetModifier()->m_miscvalue;
immuneMask |= (*itr)->GetMiscValue();
if( immuneMask & SPELL_SCHOOL_MASK_ALL ) // total immunity
return true;
}
@@ -19898,19 +19830,19 @@ void Player::SetTitle(CharTitlesEntry const* title)
/*-----------------------TRINITY--------------------------*/
bool Player::isTotalImmunity()
{
AuraList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
AuraEffectList const& immune = GetAurasByType(SPELL_AURA_SCHOOL_IMMUNITY);
for(AuraList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
for(AuraEffectList::const_iterator itr = immune.begin(); itr != immune.end(); ++itr)
{
if (((*itr)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_ALL) !=0) // total immunity
if (((*itr)->GetMiscValue() & SPELL_SCHOOL_MASK_ALL) !=0) // total immunity
{
return true;
}
if (((*itr)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL) !=0) // physical damage immunity
if (((*itr)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) !=0) // physical damage immunity
{
for(AuraList::const_iterator i = immune.begin(); i != immune.end(); ++i)
for(AuraEffectList::const_iterator i = immune.begin(); i != immune.end(); ++i)
{
if (((*i)->GetModifier()->m_miscvalue & SPELL_SCHOOL_MASK_MAGIC) !=0) // magic immunity
if (((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_MAGIC) !=0) // magic immunity
{
return true;
}
@@ -19928,9 +19860,9 @@ void Player::UpdateCharmedAI()
//kill self if charm aura has infinite duration
if(charmer->IsInEvadeMode())
{
AuraList const& auras = GetAurasByType(SPELL_AURA_MOD_CHARM);
for(AuraList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->IsPermanent())
AuraEffectList const& auras = GetAurasByType(SPELL_AURA_MOD_CHARM);
for(AuraEffectList::const_iterator iter = auras.begin(); iter != auras.end(); ++iter)
if((*iter)->GetCasterGUID() == charmer->GetGUID() && (*iter)->GetParentAura()->IsPermanent())
{
charmer->DealDamage(this, GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
return;
@@ -20137,7 +20069,7 @@ uint32 Player::GetPhaseMaskForSpawn() const
phase = GetPhaseMask();
else
{
AuraList const& phases = GetAurasByType(SPELL_AURA_PHASE);
AuraEffectList const& phases = GetAurasByType(SPELL_AURA_PHASE);
if(!phases.empty())
phase = phases.front()->GetMiscValue();
}
+3 -3
View File
@@ -1729,8 +1729,8 @@ class TRINITY_DLL_SPEC Player : public Unit
void _RemoveAllStatBonuses();
void _ApplyWeaponDependentAuraMods(Item *item, WeaponAttackType attackType, bool apply);
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply);
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, Aura* aura, bool apply);
void _ApplyWeaponDependentAuraCritMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
void _ApplyWeaponDependentAuraDamageMod(Item *item, WeaponAttackType attackType, AuraEffect* aura, bool apply);
void _ApplyItemMods(Item *item,uint8 slot,bool apply);
void _RemoveAllItemMods();
@@ -2359,7 +2359,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
continue;
// special case (skip >10sec spell casts for instant cast setting)
if( mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10*IN_MILISECONDS) && mod->value <= -100)
if( mod->op==SPELLMOD_CASTING_TIME && basevalue >= T(10000) && mod->value <= -100)
continue;
totalpct += mod->value;
+1 -1
View File
@@ -101,7 +101,7 @@ void WorldSession::HandleQuestgiverHelloOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// Stop the npc if moving
pCreature->StopMoving();
+1 -1
View File
@@ -55,7 +55,7 @@ void WorldSession::HandleTalentWipeOpcode( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
if(!(_player->resetTalents()))
{
+99 -68
View File
@@ -1148,7 +1148,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
// TODO: Handle all of special spells in one place?
if(m_preCastSpell==61988)
{
//Cast forbearance
//Cast Forbearance
m_caster->CastSpell(unit,25771, true, m_CastItem);
// Cast Avenging Wrath Marker
m_caster->CastSpell(unit,61987, true, m_CastItem);
@@ -1156,11 +1156,45 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
else
m_caster->CastSpell(unit,m_preCastSpell, true, m_CastItem);
}
uint8 t_effmask=0;
for (uint8 i=0;i<3;++i)
if (effectMask & (1<<i) && (m_spellInfo->Effect[i] == SPELL_EFFECT_APPLY_AURA || IsAreaAuraEffect(m_spellInfo->Effect[i])))
t_effmask |=1<<i;
if (t_effmask)
{
Unit * caster = m_originalCaster ? m_originalCaster : m_caster;
Aura * Aur= new Aura(m_spellInfo, t_effmask, &m_currentBasePoints[0], unit, caster , m_CastItem);
if (!Aur->IsAreaAura())
{
// Now Reduce spell duration using data received at spell hit
int32 duration = Aur->GetAuraMaxDuration();
unit->ApplyDiminishingToDuration(m_diminishGroup,duration,caster,m_diminishLevel);
Aur->setDiminishGroup(m_diminishGroup);
duration = caster->ModSpellDuration(m_spellInfo, unit, duration, Aur->IsPositive());
//mod duration of channeled aura by spell haste
if (IsChanneledSpell(m_spellInfo))
caster->ModSpellCastTime(m_spellInfo, duration, this);
if(duration != Aur->GetAuraMaxDuration())
{
Aur->SetAuraMaxDuration(duration);
Aur->SetAuraDuration(duration);
}
// Prayer of Mending (jump animation), we need formal caster instead original for correct animation
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags[1] & 0x000020))
m_caster->CastSpell(unit, 41637, true, NULL, NULL, m_originalCasterGUID);
}
unit->AddAura(Aur);
}
t_effmask = effectMask& ~t_effmask;
for(uint32 effectNumber=0;effectNumber<3;effectNumber++)
{
if (effectMask & (1<<effectNumber))
if (t_effmask & (1<<effectNumber))
{
HandleEffects(unit,NULL,NULL,effectNumber/*,m_damageMultipliers[effectNumber]*/);
//Only damage and heal spells need this
@@ -1188,20 +1222,23 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask)
int _duration=0;
for(ChanceTriggerSpells::const_iterator i = m_ChanceTriggerSpells.begin(); i != m_ChanceTriggerSpells.end(); ++i)
{
// SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
// set duration equal to triggering spell
if(roll_chance_i(i->second))
{
m_caster->CastSpell(unit, i->first, true);
// SPELL_AURA_ADD_TARGET_TRIGGER auras shouldn't trigger auras without duration
// set duration equal to triggering spell
if (GetSpellDuration(i->first)==-1)
}
if (GetSpellDuration(i->first)==-1)
{
if (Aura * triggeredAur = unit->GetAura(i->first->Id, m_caster->GetGUID()))
{
// get duration from aura-only once
if (!_duration)
{
Aura * aur = unit->GetAuraByCasterSpell(m_spellInfo->Id, m_caster->GetGUID());
Aura * aur = unit->GetAura(m_spellInfo->Id, m_caster->GetGUID());
_duration = aur ? aur->GetAuraDuration() : -1;
}
unit->SetAurasDurationByCasterSpell(i->first->Id, m_caster->GetGUID(), _duration);
triggeredAur->SetAuraDuration(_duration);
}
}
}
@@ -1342,7 +1379,7 @@ void Spell::SearchChainTarget(std::list<Unit*> &TagUnitMap, float max_range, uin
{
if (!(*m)->isAffectedOnSpell(m_spellInfo))
continue;
unMaxTargets+=(*m)->GetModifier()->m_amount;
unMaxTargets+=(*m)->GetAmount();
}*/
//FIXME: This very like horrible hack and wrong for most spells
@@ -1501,11 +1538,11 @@ void Spell::SetTargetMap(uint32 i,uint32 cur,std::list<Unit*> &TagUnitMap)
uint32 EffectChainTarget = m_spellInfo->EffectChainTarget[i];
uint32 unMaxTargets = m_spellInfo->MaxAffectedTargets;
Unit::AuraList const& Auras = m_caster->GetAurasByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS);
for(Unit::AuraList::const_iterator j = Auras.begin();j != Auras.end(); ++j)
Unit::AuraEffectList const& Auras = m_caster->GetAurasByType(SPELL_AURA_MOD_MAX_AFFECTED_TARGETS);
for(Unit::AuraEffectList::const_iterator j = Auras.begin();j != Auras.end(); ++j)
{
if((*j)->isAffectedOnSpell(m_spellInfo))
unMaxTargets+=(*j)->GetModifier()->m_amount;
unMaxTargets+=(*j)->GetAmount();
}
if(m_originalCaster)
@@ -2073,7 +2110,7 @@ struct PrioritizeMana
}
};
void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
void Spell::prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura)
{
if(m_CastItem)
m_castItemGUID = m_CastItem->GetGUID();
@@ -2145,7 +2182,7 @@ void Spell::prepare(SpellCastTargets const* targets, Aura* triggeredByAura)
if(triggeredByAura)
{
SendChannelUpdate(0);
triggeredByAura->SetAuraDuration(0);
triggeredByAura->GetParentAura()->SetAuraDuration(0);
}
SendCastResult(result);
finish(false);
@@ -2208,11 +2245,10 @@ void Spell::cancel()
{
Unit* unit = m_caster->GetGUID()==(*ihit).targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
if( unit && unit->isAlive() )
unit->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID(), AURA_REMOVE_BY_CANCEL);
unit->RemoveAurasDueToSpell(m_spellInfo->Id, m_caster->GetGUID(), AURA_REMOVE_BY_CANCEL);
}
}
m_caster->RemoveAurasByCasterSpell(m_spellInfo->Id, m_caster->GetGUID(), AURA_REMOVE_BY_CANCEL);
m_caster->RemoveAurasDueToSpell(m_spellInfo->Id, m_caster->GetGUID(), AURA_REMOVE_BY_CANCEL);
SendChannelUpdate(0);
SendInterrupted(0);
SendCastResult(SPELL_FAILED_INTERRUPTED);
@@ -2299,8 +2335,8 @@ void Spell::cast(bool skipCheck)
// this is related to combo points so must be done before takepower
// are there any spells need to be triggered after hit?
// handle SPELL_AURA_ADD_TARGET_TRIGGER auras
Unit::AuraList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
for(Unit::AuraList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
Unit::AuraEffectList const& targetTriggers = m_caster->GetAurasByType(SPELL_AURA_ADD_TARGET_TRIGGER);
for(Unit::AuraEffectList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
{
if (!(*i)->isAffectedOnSpell(m_spellInfo))
continue;
@@ -2310,7 +2346,7 @@ void Spell::cast(bool skipCheck)
{
// Calculate chance at that moment (can be depend for example from combo points)
int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL);
m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetStackAmount()));
m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetParentAura()->GetStackAmount()));
}
}
@@ -3579,8 +3615,8 @@ SpellCastResult Spell::CheckCast(bool strict)
{
bool checkForm = true;
// Ignore form req aura
Unit::AuraList const& ignore = m_caster->GetAurasByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
for(Unit::AuraList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
Unit::AuraEffectList const& ignore = m_caster->GetAurasByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
for(Unit::AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
{
if (!(*i)->isAffectedOnSpell(m_spellInfo))
continue;
@@ -3600,12 +3636,12 @@ SpellCastResult Spell::CheckCast(bool strict)
}
bool reqCombat=true;
Unit::AuraList const& stateAuras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for(Unit::AuraList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j)
Unit::AuraEffectList const& stateAuras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_IGNORE_AURASTATE);
for(Unit::AuraEffectList::const_iterator j = stateAuras.begin();j != stateAuras.end(); ++j)
{
if((*j)->isAffectedOnSpell(m_spellInfo))
{
if ((*j)->GetModifier()->m_miscvalue==1)
if ((*j)->GetMiscValue()==1)
{
reqCombat=false;
break;
@@ -4521,37 +4557,43 @@ SpellCastResult Spell::CheckCasterAuras() const
{
if(itr->second)
{
if( GetSpellMechanicMask(itr->second->GetSpellProto(), itr->second->GetEffIndex()) & mechanic_immune )
if( GetAllSpellMechanicMask(itr->second->GetSpellProto()) & mechanic_immune )
continue;
if( GetSpellSchoolMask(itr->second->GetSpellProto()) & school_immune )
if( GetAllSpellMechanicMask(itr->second->GetSpellProto()) & school_immune )
continue;
if( (1<<(itr->second->GetSpellProto()->Dispel)) & dispel_immune)
continue;
//Make a second check for spell failed so the right SPELL_FAILED message is returned.
//That is needed when your casting is prevented by multiple states and you are only immune to some of them.
switch(itr->second->GetModifier()->m_auraname)
for (uint8 i=0;i<MAX_SPELL_EFFECTS;++i)
{
case SPELL_AURA_MOD_STUN:
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
return SPELL_FAILED_STUNNED;
break;
case SPELL_AURA_MOD_CONFUSE:
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
return SPELL_FAILED_CONFUSED;
break;
case SPELL_AURA_MOD_FEAR:
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
return SPELL_FAILED_FLEEING;
break;
case SPELL_AURA_MOD_SILENCE:
case SPELL_AURA_MOD_PACIFY:
case SPELL_AURA_MOD_PACIFY_SILENCE:
if( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
return SPELL_FAILED_PACIFIED;
else if ( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
return SPELL_FAILED_SILENCED;
break;
if (AuraEffect * part = itr->second->GetPartAura(i))
{
switch(part->GetAuraName())
{
case SPELL_AURA_MOD_STUN:
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_STUNNED))
return SPELL_FAILED_STUNNED;
break;
case SPELL_AURA_MOD_CONFUSE:
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_CONFUSED))
return SPELL_FAILED_CONFUSED;
break;
case SPELL_AURA_MOD_FEAR:
if (!(m_spellInfo->AttributesEx5 & SPELL_ATTR_EX5_USABLE_WHILE_FEARED))
return SPELL_FAILED_FLEEING;
break;
case SPELL_AURA_MOD_SILENCE:
case SPELL_AURA_MOD_PACIFY:
case SPELL_AURA_MOD_PACIFY_SILENCE:
if( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_PACIFY)
return SPELL_FAILED_PACIFIED;
else if ( m_spellInfo->PreventionType==SPELL_PREVENTION_TYPE_SILENCE)
return SPELL_FAILED_SILENCED;
break;
}
}
}
}
}
@@ -4573,18 +4615,18 @@ bool Spell::CanAutoCast(Unit* target)
{
if( m_spellInfo->StackAmount <= 1)
{
if( target->HasAura(m_spellInfo->Id, j) )
if( target->HasAuraEffect(m_spellInfo->Id, j) )
return false;
}
else
{
if( target->GetAuras().count(Unit::spellEffectPair(m_spellInfo->Id, j)) >= m_spellInfo->StackAmount)
if( (target->GetAuraEffect(m_spellInfo->Id, j))->GetParentAura()->GetStackAmount() >= m_spellInfo->StackAmount)
return false;
}
}
else if ( IsAreaAuraEffect( m_spellInfo->Effect[j] ))
{
if( target->HasAura(m_spellInfo->Id, j) )
if( target->HasAuraEffect(m_spellInfo->Id, j) )
return false;
}
}
@@ -4746,7 +4788,7 @@ SpellCastResult Spell::CheckPower()
// Check valid power type
if( m_spellInfo->powerType >= MAX_POWERS )
{
sLog.outError("Spell::CheckMana: Unknown power type '%d'", m_spellInfo->powerType);
sLog.outError("Spell::CheckPower: Unknown power type '%d'", m_spellInfo->powerType);
return SPELL_FAILED_UNKNOWN;
}
@@ -5231,11 +5273,8 @@ void Spell::DelayedChannel()
Unit* unit = m_caster->GetGUID()==ihit->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, ihit->targetGUID);
if (unit)
{
for (int j=0;j<3;j++)
if( ihit->effectMask & (1<<j) )
unit->DelayAura(m_spellInfo->Id, j, delaytime);
unit->DelayAura(m_spellInfo->Id, m_caster->GetGUID(), delaytime);
}
}
}
@@ -5266,11 +5305,6 @@ void Spell::UpdatePointers()
m_targets.Update(m_caster);
}
bool Spell::IsAffectedByAura(Aura *aura)
{
return spellmgr.IsAffectedByMod(m_spellInfo, aura->getAuraSpellMod());
}
bool Spell::CheckTargetCreatureType(Unit* target) const
{
uint32 spellCreatureTargetMask = m_spellInfo->TargetCreatureType;
@@ -5405,12 +5439,12 @@ Unit* Spell::SelectMagnetTarget()
if(target && m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MAGIC && target->HasAuraType(SPELL_AURA_SPELL_MAGNET)) //Attributes & 0x10 what is this?
{
Unit::AuraList const& magnetAuras = target->GetAurasByType(SPELL_AURA_SPELL_MAGNET);
for(Unit::AuraList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
Unit::AuraEffectList const& magnetAuras = target->GetAurasByType(SPELL_AURA_SPELL_MAGNET);
for(Unit::AuraEffectList::const_iterator itr = magnetAuras.begin(); itr != magnetAuras.end(); ++itr)
{
if(Unit* magnet = (*itr)->GetCaster())
{
if((*itr)->DropAuraCharge())
if((*itr)->GetParentAura()->DropAuraCharge())
{
target = magnet;
m_targets.setUnitTarget(target);
@@ -5514,9 +5548,6 @@ bool SpellEvent::Execute(uint64 e_time, uint32 p_time)
// another non-melee non-delayed spell is casted now, abort
m_Spell->cancel();
}
// Check if target of channeled spell still in range
else if (m_Spell->CheckRange(false))
m_Spell->cancel();
else
{
// do the action (pass spell to channeling state)
@@ -5620,8 +5651,8 @@ void Spell::CalculateDamageDoneForAllTargets()
}
bool usesAmmo=true;
Unit::AuraList const& Auras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_CONSUME_NO_AMMO);
for(Unit::AuraList::const_iterator j = Auras.begin();j != Auras.end(); ++j)
Unit::AuraEffectList const& Auras = m_caster->GetAurasByType(SPELL_AURA_ABILITY_CONSUME_NO_AMMO);
for(Unit::AuraEffectList::const_iterator j = Auras.begin();j != Auras.end(); ++j)
{
if((*j)->isAffectedOnSpell(m_spellInfo))
usesAmmo=false;
+1 -3
View File
@@ -354,7 +354,7 @@ class Spell
Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL, bool skipCheck = false );
~Spell();
void prepare(SpellCastTargets const* targets, Aura* triggeredByAura = NULL);
void prepare(SpellCastTargets const* targets, AuraEffect* triggeredByAura = NULL);
void cancel();
void update(uint32 difftime);
void cast(bool skipCheck = false);
@@ -461,8 +461,6 @@ class Spell
void UpdatePointers(); // must be used at call Spell code after time delay (non triggered spell cast/update spell call/etc)
bool IsAffectedByAura(Aura *aura);
bool CheckTargetCreatureType(Unit* target) const;
void AddTriggeredSpell(SpellEntry const* spell) { m_TriggerSpells.push_back(spell); }
+1
View File
@@ -21,6 +21,7 @@
#define TRINITY_SPELLAURADEFINES_H
#define MAX_AURAS 64 // client support up to 255, but it will cause problems with group auras updating
#define FRIENDLY_AA_REMOVE_TIME 2*IN_MILISECONDS
enum AURA_FLAGS
{
+1409 -1282
View File
File diff suppressed because it is too large Load Diff
+164 -166
View File
@@ -22,14 +22,6 @@
#include "SpellAuraDefines.h"
struct Modifier
{
AuraType m_auraname;
int32 m_amount;
int32 m_miscvalue;
uint32 periodictime;
};
class Unit;
struct SpellEntry;
struct SpellModifier;
@@ -37,8 +29,9 @@ struct ProcTriggerSpell;
// forward decl
class Aura;
class AuraEffect;
typedef void(Aura::*pAuraHandler)(bool Apply, bool Real);
typedef void(AuraEffect::*pAuraHandler)(bool Apply, bool Real);
// Real == true at aura add/remove
// Real == false at aura mod unapply/reapply; when adding/removing dependent aura/item/stat mods
//
@@ -54,9 +47,121 @@ typedef void(Aura::*pAuraHandler)(bool Apply, bool Real);
class TRINITY_DLL_SPEC Aura
{
friend Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster, Item* castItem);
friend void Player::SendAurasForTarget(Unit *target);
public:
virtual ~Aura();
Aura(SpellEntry const* spellproto, uint32 effMask, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
SpellEntry const* GetSpellProto() const { return m_spellProto; }
uint32 GetId() const{ return m_spellProto->Id; }
uint64 GetCastItemGUID() const { return m_castItemGuid; }
uint64 const& GetCasterGUID() const { return m_caster_guid; }
Unit* GetCaster() const;
Unit* GetTarget() const { return m_target; }
time_t GetAuraApplyTime() const { return m_applyTime; }
int32 GetAuraMaxDuration() const { return m_maxduration; }
void SetAuraMaxDuration(int32 duration) { m_maxduration = duration; }
int32 GetAuraDuration() const { return m_duration; }
void SetAuraDuration(int32 duration);
void RefreshAura(){ SetAuraDuration (m_maxduration); }
void SendAuraUpdate();
uint8 GetAuraSlot() const { return m_auraSlot; }
void SetAuraSlot(uint8 slot) { m_auraSlot = slot; }
uint8 GetAuraCharges() const { return m_procCharges; }
void SetAuraCharges(uint8 charges);
bool DropAuraCharge();
int8 GetStackAmount() const {return m_stackAmount;}
void SetStackAmount(uint8 num);
bool modStackAmount(int32 num); // return true if last charge dropped
uint32 GetAuraStateMask(){return m_auraStateMask;}
void SetAuraState(uint8 num){m_auraStateMask |= 1<<(num-1);} //modifies aura's aura state (not unit!)
void SetRemoveMode(AuraRemoveMode mode) { m_removeMode = mode; }
uint8 GetRemoveMode() const {return m_removeMode;}
inline uint8 GetEffectMask() const {return m_auraFlags & 7;}
AuraEffect * GetPartAura (uint8 effIndex) const {return m_partAuras[effIndex];}
bool SetPartAura(AuraEffect* aurEff, uint8 effIndex);
bool IsPositive() const { return m_positive; }
void SetNegative() { m_positive = false; }
void SetPositive() { m_positive = true; }
bool IsPermanent() const { return m_permanent; }
bool IsPassive() const { return m_isPassive; }
bool IsDeathPersistent() const { return m_isDeathPersist; }
bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; }
bool IsUpdated() const { return m_updated; }
void SetUpdated(bool val) { m_updated = val; }
bool IsInUse() const;
bool IsPersistent() const;
bool IsAreaAura() const;
bool IsAuraType(AuraType type) const;
void SetLoadedState(uint64 caster_guid,int32 maxduration,int32 duration,int32 charges, uint8 stackamount, int32 * amount);
bool HasEffect(uint8 effIndex) const {return bool (m_partAuras[effIndex]);}
inline void HandleEffects(bool apply)
{
for (uint8 i = 0; i<MAX_SPELL_EFFECTS;++i)
if (m_partAuras[i])
m_target->HandleAuraEffect(m_partAuras[i], apply);
}
void ApplyAllModifiers(bool apply, bool Real=false);
void Update(uint32 diff);
void _AddAura();
void _RemoveAura();
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
void setDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
DiminishingGroup getDiminishGroup() const { return m_AuraDRGroup; }
// Single cast aura helpers
void UnregisterSingleCastAura();
bool IsSingleTarget() const {return m_isSingleTargetAura;}
void SetIsSingleTarget(bool val) { m_isSingleTargetAura = val;}
private:
SpellEntry const *m_spellProto;
Unit * const m_target;
uint64 m_caster_guid;
uint64 m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
time_t m_applyTime;
int32 m_maxduration; // Max aura duration
int32 m_duration; // Current time
int32 m_timeCla; // Timer for power per sec calcultion
AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason
DiminishingGroup m_AuraDRGroup:8; // Diminishing
uint8 m_auraSlot; // Aura slot on unit (for show in client)
uint8 m_auraFlags; // Aura info flag (for send data to client)
uint8 m_auraLevel; // Aura level (store caster level for correct show level dep amount)
uint8 m_procCharges; // Aura charges (0 for infinite)
uint32 m_procDamage; // used in aura proc code
uint8 m_stackAmount; // Aura stack amount
uint32 m_auraStateMask;
AuraEffect * m_partAuras[3];
bool m_isDeathPersist:1;
bool m_isRemovedOnShapeLost:1;
bool m_isPassive:1;
bool m_positive:1;
bool m_permanent:1;
bool m_updated:1; // Prevent remove aura by stack if set
bool m_isSingleTargetAura:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
};
class TRINITY_DLL_SPEC AuraEffect
{
public:
friend AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem);
friend void Aura::SetStackAmount(uint8 stackAmount);
//aura handlers
void HandleNULL(bool, bool)
{
@@ -211,192 +316,85 @@ class TRINITY_DLL_SPEC Aura
void HandleAuraIncreaseBaseHealthPercent(bool Apply, bool Real);
void HandleNoReagentUseAura(bool Apply, bool Real);
void HandlePhase(bool Apply, bool Real);
void HandleAuraStateFrozen(bool apply);
virtual ~Aura();
void SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue);
Modifier* GetModifier() {return &m_modifier;}
int32 GetMiscValue() {return m_spellProto->EffectMiscValue[m_effIndex];}
int32 GetMiscBValue() {return m_spellProto->EffectMiscValueB[m_effIndex];}
SpellEntry const* GetSpellProto() const { return m_spellProto; }
uint32 GetId() const{ return m_spellProto->Id; }
uint64 GetCastItemGUID() const { return m_castItemGuid; }
uint32 GetEffIndex() const{ return m_effIndex; }
int32 GetBasePoints() const { return m_currentBasePoints; }
int32 GetAuraMaxDuration() const { return m_maxduration; }
void SetAuraMaxDuration(int32 duration) { m_maxduration = duration; }
int32 GetAuraDuration() const { return m_duration; }
void SetAuraDuration(int32 duration)
{
m_duration = duration;
if (duration<0)
m_permanent=true;
else
m_permanent=false;
}
void SetAuraDurationAndUpdate(int32 duration)
{
SetAuraDuration (duration);
m_target->UpdateAuraForGroup(GetAuraSlot());
}
time_t GetAuraApplyTime() { return m_applyTime; }
SpellModifier *getAuraSpellMod() {return m_spellmod; }
uint64 const& GetCasterGUID() const { return m_caster_guid; }
Unit* GetCaster() const;
Unit* GetTarget() const { return m_target; }
void SetTarget(Unit* target) { m_target = target; }
void SetLoadedState(uint64 caster_guid,int32 damage,int32 maxduration,int32 duration,int32 charges)
{
m_caster_guid = caster_guid;
m_modifier.m_amount = damage;
m_maxduration = maxduration;
m_duration = duration;
m_procCharges = charges;
}
uint8 GetAuraSlot() const { return m_auraSlot; }
void SetAuraSlot(uint8 slot) { m_auraSlot = slot; }
uint8 GetAuraCharges() const { return m_procCharges; }
void SetAuraCharges(uint8 charges)
{
if (m_procCharges == charges)
return;
m_procCharges = charges;
m_target->UpdateAuraForGroup(GetAuraSlot());
}
bool DropAuraCharge() // return true if last charge dropped
{
if (m_procCharges == 0)
return false;
m_procCharges--;
m_target->UpdateAuraForGroup(GetAuraSlot());
return m_procCharges == 0;
}
void UnregisterSingleCastAura();
int8 GetStackAmount() {return m_stackAmount;}
//int32 GetModifierValuePerStack() {return m_modifier.m_amount / m_stackAmount;}
void SetStackAmount(uint8 num);
bool modStackAmount(int32 num); // return true if last charge dropped
void InitStackAmount(uint8 stackAmount);
uint32 GetAuraStateMask(){return m_auraStateMask;}
void SetAuraState(uint8 num){m_auraStateMask |= 1<<(num-1);} //modifies aura's aura state (not unit!)
void RefreshAura();
bool IsPositive() { return m_positive; }
void SetNegative() { m_positive = false; }
void SetPositive() { m_positive = true; }
bool IsPermanent() const { return m_permanent; }
bool IsAreaAura() const { return m_isAreaAura; }
bool IsPeriodic() const { return m_isPeriodic; }
bool IsPassive() const { return m_isPassive; }
bool IsPersistent() const { return m_isPersistent; }
bool IsDeathPersistent() const { return m_isDeathPersist; }
bool IsRemovedOnShapeLost() const { return m_isRemovedOnShapeLost; }
bool IsInUse() const { return m_in_use;}
void CleanupTriggeredSpells();
virtual void Update(uint32 diff);
void ApplyModifier(bool apply, bool Real = false);
void _AddAura();
void _RemoveAura();
bool IsUpdated() { return m_updated; }
void SetUpdated(bool val) { m_updated = val; }
bool IsSingleTarget() {return m_isSingleTargetAura;}
void SetIsSingleTarget(bool val) { m_isSingleTargetAura = val;}
void SetRemoveMode(AuraRemoveMode mode) { m_removeMode = mode; }
Unit* GetTriggerTarget() const;
void HandleAuraAllowOnlyAbility(bool apply, bool Real);
// add/remove SPELL_AURA_MOD_SHAPESHIFT (36) linked auras
void HandleAuraAllowOnlyAbility(bool apply, bool Real);
void HandleShapeshiftBoosts(bool apply);
// Allow Apply Aura Handler to modify and access m_AuraDRGroup
void setDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; }
DiminishingGroup getDiminishGroup() const { return m_AuraDRGroup; }
inline Unit * GetCaster() const{ return m_parentAura->GetCaster(); }
inline uint64 GetCasterGUID() const{ return m_parentAura->GetCasterGUID(); }
Aura * GetParentAura() const { return m_parentAura; }
SpellEntry const* GetSpellProto() const { return m_spellProto; }
uint32 GetId() const { return m_spellProto->Id; }
uint32 GetEffIndex() const { return m_effIndex; }
int32 GetBasePoints() const { return m_currentBasePoints; }
void Update(uint32 diff);
bool IsAreaAura() const { return m_isAreaAura; }
bool IsPeriodic() const { return m_isPeriodic; }
bool IsInUse() const { return m_in_use;}
bool IsPersistent() const { return m_isPersistent; }
bool isAffectedOnSpell(SpellEntry const *spell) const;
void ApplyModifier(bool apply, bool Real = false);
void HandleAuraEffect(bool apply);
void ApplyAllModifiers(bool apply, bool Real);
Unit* GetTriggerTarget() const;
void TriggerSpell();
void TriggerSpellWithValue();
void PeriodicTick();
void PeriodicDummyTick();
bool isAffectedOnSpell(SpellEntry const *spell) const;
protected:
Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
int32 GetMiscBValue() const {return m_spellProto->EffectMiscValueB[m_effIndex];}
int32 GetMiscValue() const {return m_spellProto->EffectMiscValue[m_effIndex];}
uint32 GetAuraName() const {return m_auraName;}
int32 GetAmount() const {return m_amount;}
void SetAmount(int32 amount) { m_amount = amount; }
void CleanupTriggeredSpells();
Modifier m_modifier;
SpellModifier *m_spellmod;
protected:
AuraEffect (Aura * parentAura, uint8 effIndex, int32 * currentBasePoints , Unit * caster,Item * castItem);
Aura * const m_parentAura;
Unit * const m_target;
SpellEntry const *m_spellProto;
Unit* m_target;
uint64 m_caster_guid;
uint64 m_castItemGuid; // it is NOT safe to keep a pointer to the item because it may get deleted
time_t m_applyTime;
int32 m_currentBasePoints; // cache SpellEntry::EffectBasePoints and use for set custom base points
int32 m_maxduration; // Max aura duration
int32 m_duration; // Current time
int32 m_timeCla; // Timer for power per sec calcultion
uint8 m_effIndex;
AuraType m_auraName;
int32 m_currentBasePoints;
int32 m_amount;
SpellModifier *m_spellmod;
int32 m_periodicTimer; // Timer for periodic auras
int32 m_amplitude;
AuraRemoveMode m_removeMode:8; // Store info for know remove aura reason
DiminishingGroup m_AuraDRGroup:8; // Diminishing
uint8 m_effIndex; // Aura effect index in spell
uint8 m_auraSlot; // Aura slot on unit (for show in client)
uint8 m_auraFlags; // Aura info flag (for send data to client)
uint8 m_auraLevel; // Aura level (store caster level for correct show level dep amount)
uint8 m_procCharges; // Aura charges (0 for infinite)
uint8 m_stackAmount; // Aura stack amount
uint32 m_auraStateMask;
bool m_positive:1;
bool m_permanent:1;
bool m_isPeriodic:1;
bool m_isAreaAura:1;
bool m_isPassive:1;
bool m_isPersistent:1;
bool m_isDeathPersist:1;
bool m_isRemovedOnShapeLost:1;
bool m_updated:1; // Prevent remove aura by stack if set
bool m_in_use:1; // true while in Aura::ApplyModifier call
bool m_isSingleTargetAura:1; // true if it's a single target spell and registered at caster - can change at spell steal for example
private:
bool m_isPersistent:1;
};
class TRINITY_DLL_SPEC AreaAura : public Aura
class TRINITY_DLL_SPEC AreaAuraEffect : public AuraEffect
{
public:
AreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
~AreaAura();
AreaAuraEffect(Aura * parentAura, uint32 effIndex, int32 * currentBasePoints, Unit * caster=NULL, Item * castItem=NULL);
~AreaAuraEffect();
void Update(uint32 diff);
private:
float m_radius;
int32 m_removeTime;
AreaAuraType m_areaAuraType;
};
class TRINITY_DLL_SPEC PersistentAreaAura : public Aura
class TRINITY_DLL_SPEC PersistentAreaAuraEffect : public AuraEffect
{
public:
PersistentAreaAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
~PersistentAreaAura();
PersistentAreaAuraEffect(Aura * parentAura, uint32 eff, int32 *currentBasePoints, Unit *caster = NULL, Item* castItem = NULL);
~PersistentAreaAuraEffect();
void Update(uint32 diff);
};
Aura* CreateAura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);
AuraEffect* CreateAuraEffect(Aura * parentAura, uint32 effIndex, int32 *currentBasePoints, Unit * caster, Item * castItem = NULL);
#endif
+149 -269
View File
@@ -340,7 +340,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
{
case 35354: //Hand of Death
{
if(unitTarget && unitTarget->HasAura(38528,0)) //Protection of Elune
if(unitTarget && unitTarget->HasAura(38528)) //Protection of Elune
{
damage = 0;
}
@@ -451,13 +451,13 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE)
{
// for caster applied auras only
Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
Unit::AuraEffectList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags[0] & 4) &&
(*i)->GetCasterGUID()==m_caster->GetGUID() )
{
unitTarget->RemoveAurasByCasterSpell((*i)->GetId(), m_caster->GetGUID());
unitTarget->RemoveAurasDueToSpell((*i)->GetId(), m_caster->GetGUID());
break;
}
}
@@ -497,11 +497,11 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if((m_spellInfo->SpellFamilyFlags.IsEqual(0x1000,0,0) && m_spellInfo->SpellIconID==494) ||
(m_spellInfo->SpellFamilyFlags.IsEqual(0,0x100,0) && m_spellInfo->SpellIconID==2246))
{
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
Unit::AuraEffectList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin(); i != mDummyAuras.end(); ++i)
if((*i)->GetSpellProto()->SpellFamilyFlags[1] & 0x00000440 && (*i)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_DRUID)
{
damage = int32(damage*(100.0f+(*i)->GetModifier()->m_amount)/100.0f);
damage = int32(damage*(100.0f+(*i)->GetAmount())/100.0f);
break;
}
}
@@ -517,13 +517,13 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
{
Aura *poison = 0;
// Lookup for Deadly poison (only attacker applied)
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
Unit::AuraEffectList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_ROGUE &&
(*itr)->GetSpellProto()->SpellFamilyFlags[0] & 0x10000 &&
(*itr)->GetCasterGUID()==m_caster->GetGUID() )
{
poison = *itr;
poison = (*itr)->GetParentAura();
break;
}
// count consumed deadly poison doses at target
@@ -534,7 +534,7 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
if (doses > combo)
doses = combo;
for (int i=0; i< doses; i++)
unitTarget->RemoveSingleSpellAurasFromStack(spellId);
unitTarget->RemoveAuraFromStack(spellId);
damage *= doses;
damage += int32(((Player*)m_caster)->GetTotalAttackPowerValue(BASE_ATTACK) * 0.03f * doses);
}
@@ -599,8 +599,8 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
bool found = false;
// check dazed affect
Unit::AuraList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
for(Unit::AuraList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
Unit::AuraEffectList const& decSpeedList = unitTarget->GetAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
for(Unit::AuraEffectList::const_iterator iter = decSpeedList.begin(); iter != decSpeedList.end(); ++iter)
{
if((*iter)->GetSpellProto()->SpellIconID==15 && (*iter)->GetSpellProto()->Dispel==0)
{
@@ -631,11 +631,11 @@ void Spell::SpellDamageSchoolDmg(uint32 effect_idx)
damage+=int32(ap * 0.14f) + int32(holy * 22 / 100);
// Get stack of Holy Vengeance/Blood Corruption on the target added by caster
uint32 stacks = 0;
Unit::AuraList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
Unit::AuraEffectList const& auras = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE);
for(Unit::AuraEffectList::const_iterator itr = auras.begin(); itr!=auras.end(); ++itr)
if(((*itr)->GetId() == 31803 || (*itr)->GetId() == 53742) && (*itr)->GetCasterGUID()==m_caster->GetGUID())
{
stacks = (*itr)->GetStackAmount();
stacks = (*itr)->GetParentAura()->GetStackAmount();
break;
}
// + 10% for each application of Holy Vengeance/Blood Corruption on the target
@@ -994,7 +994,7 @@ void Spell::EffectDummy(uint32 i)
float flyspeed = m_caster->GetSpeedRate(MOVE_FLIGHT);
float speed = m_caster->GetSpeedRate(MOVE_RUN);
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
m_caster->RemoveAurasByType(SPELL_AURA_MOUNTED);
//5 different spells used depending on mounted speed and if mount can fly or not
if (flyspeed >= 4.1f)
@@ -1020,7 +1020,7 @@ void Spell::EffectDummy(uint32 i)
}
case 28730: // Arcane Torrent (Mana)
{
Aura * dummy = m_caster->GetDummyAura(28734);
Aura * dummy = m_caster->GetAura(28734, m_caster->GetGUID());
if (dummy)
{
int32 bp = damage * dummy->GetStackAmount();
@@ -1243,7 +1243,7 @@ void Spell::EffectDummy(uint32 i)
uint32 spellID = m_spellInfo->CalculateSimpleValue(0);
uint32 reqAuraID = m_spellInfo->CalculateSimpleValue(1);
if (m_caster->HasAura(reqAuraID,0))
if (m_caster->HasAuraEffect(reqAuraID,0))
m_caster->CastSpell(m_caster,spellID,true,NULL);
return;
}
@@ -1355,8 +1355,8 @@ void Spell::EffectDummy(uint32 i)
uint32 rage = m_caster->GetPower(POWER_RAGE);
// Glyph of Execution bonus
if (Aura *aura = m_caster->GetDummyAura(58367))
rage+=aura->GetModifier()->m_amount;
if (AuraEffect *aura = m_caster->GetDummyAura(58367))
rage+=aura->GetAmount();
spell_id = 20647;
bp = damage+int32(rage * m_spellInfo->DmgMultiplier[i] +
@@ -1427,21 +1427,21 @@ void Spell::EffectDummy(uint32 i)
int32 mana = damage;
// Improved Life Tap mod
Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
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)->GetModifier()->m_amount + 100)* mana / 100;
mana = ((*itr)->GetAmount() + 100)* mana / 100;
}
m_caster->CastCustomSpell(unitTarget, 31818, &mana, NULL, NULL, true);
// Mana Feed
int32 manaFeedVal = 0;
Unit::AuraList const& mod = m_caster->GetAurasByType(SPELL_AURA_ADD_FLAT_MODIFIER);
for(Unit::AuraList::const_iterator itr = mod.begin(); itr != mod.end(); ++itr)
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)->GetModifier()->m_amount;
manaFeedVal+= (*itr)->GetAmount();
}
if(manaFeedVal > 0)
{
@@ -1817,8 +1817,8 @@ void Spell::EffectDummy(uint32 i)
// Glyph of Mana Tide
Unit *owner = m_caster->GetOwner();
if (owner)
if (Aura *dummy = owner->GetDummyAura(55441))
damage+=dummy->GetModifier()->m_amount;
if (AuraEffect *dummy = owner->GetDummyAura(55441))
damage+=dummy->GetAmount();
// Regenerate 6% of Total Mana Every 3 secs
int32 EffectBasePoints0 = unitTarget->GetMaxPower(POWER_MANA) * damage / 100;
m_caster->CastCustomSpell(unitTarget,39609,&EffectBasePoints0,NULL,NULL,true,NULL,NULL,m_originalCasterGUID);
@@ -1832,17 +1832,9 @@ void Spell::EffectDummy(uint32 i)
Item *item = ((Player*)m_caster)->GetItemByPos(INVENTORY_SLOT_BAG_0, EQUIPMENT_SLOT_OFFHAND);
if (item)
{
// Damage is increased if your off-hand weapon is enchanted with Flametongue.
Unit::AuraList const& auraDummy = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = auraDummy.begin(); itr != auraDummy.end(); ++itr)
if (m_caster->GetAura(SPELL_AURA_DUMMY, SPELLFAMILY_SHAMAN, 0x200000))
{
if( (*itr)->GetSpellProto()->SpellFamilyName==SPELLFAMILY_SHAMAN &&
(*itr)->GetSpellProto()->SpellFamilyFlags[0] & 0x200000 &&
(*itr)->GetCastItemGUID() == item->GetGUID())
{
m_damage += m_damage * damage / 100;
return;
}
}
}
return;
@@ -1982,9 +1974,9 @@ void Spell::EffectTriggerSpell(uint32 i)
// Vanish
case 18461:
{
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_DECREASE_SPEED);
m_caster->RemoveSpellsCausingAura(SPELL_AURA_MOD_STALKED);
m_caster->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
m_caster->RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED);
m_caster->RemoveAurasByType(SPELL_AURA_MOD_STALKED);
// if this spell is given to NPC it must handle rest by it's own AI
if ( m_caster->GetTypeId() != TYPEID_PLAYER )
@@ -2337,61 +2329,7 @@ void Spell::EffectTeleportUnits(uint32 i)
void Spell::EffectApplyAura(uint32 i)
{
if(!unitTarget)
return;
// ghost spell check, allow apply any auras at player loading in ghost mode (will be cleanup after load)
if( !unitTarget->isAlive() && m_spellInfo->Id != 20584 && m_spellInfo->Id != 8326 &&
(unitTarget->GetTypeId()!=TYPEID_PLAYER || !((Player*)unitTarget)->GetSession()->PlayerLoading()) )
return;
Unit* caster = m_originalCaster ? m_originalCaster : m_caster;
if(!caster)
return;
sLog.outDebug("Spell: Aura is: %u", m_spellInfo->EffectApplyAuraName[i]);
Aura* Aur = CreateAura(m_spellInfo, i, &damage, unitTarget, caster, m_CastItem);
// Now Reduce spell duration using data received at spell hit
int32 duration = Aur->GetAuraMaxDuration();
unitTarget->ApplyDiminishingToDuration(m_diminishGroup,duration,caster,m_diminishLevel);
Aur->setDiminishGroup(m_diminishGroup);
//apply mods only here, area auras don't have duration
duration = caster->ModSpellDuration(m_spellInfo, i, unitTarget, duration);
//mod duration of channeled aura by spell haste
if (IsChanneledSpell(m_spellInfo))
caster->ModSpellCastTime(m_spellInfo, duration, this);
// if Aura removed and deleted, do not continue.
if(duration== 0 && !(Aur->IsPermanent()))
{
delete Aur;
return;
}
if(duration != Aur->GetAuraMaxDuration())
{
Aur->SetAuraMaxDuration(duration);
Aur->SetAuraDuration(duration);
}
bool added = unitTarget->AddAura(Aur);
// Aura not added and deleted in AddAura call;
if (!added)
return;
// found crash at character loading, broken pointer to Aur...
// Aur was deleted in AddAura()...
if(!Aur)
return;
// Prayer of Mending (jump animation), we need formal caster instead original for correct animation
if( m_spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST && (m_spellInfo->SpellFamilyFlags[1] & 0x000020))
m_caster->CastSpell(unitTarget, 41637, true, NULL, Aur, m_originalCasterGUID);
return; //handled elsewhere
}
void Spell::EffectUnlearnSpecialization( uint32 i )
@@ -2551,10 +2489,10 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
{
// Amount of heal - depends from stacked Holy Energy
int damageAmount = 0;
Unit::AuraList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
Unit::AuraEffectList const& mDummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
if((*i)->GetId() == 45062)
damageAmount+=(*i)->GetModifier()->m_amount;
damageAmount+=(*i)->GetAmount();
if (damageAmount)
m_caster->RemoveAurasDueToSpell(45062);
@@ -2563,15 +2501,15 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
// Swiftmend - consumes Regrowth or Rejuvenation
else if (m_spellInfo->TargetAuraState == AURA_STATE_SWIFTMEND && unitTarget->HasAuraState(AURA_STATE_SWIFTMEND, m_spellInfo, m_caster))
{
Unit::AuraList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
Unit::AuraEffectList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_HEAL);
// find most short by duration
Aura *targetAura = NULL;
for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
AuraEffect *targetAura = NULL;
for(Unit::AuraEffectList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i)
{
if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID
&& ((*i)->GetSpellProto()->SpellFamilyFlags.IsEqual(0x40) || (*i)->GetSpellProto()->SpellFamilyFlags.IsEqual(0x10)) )
{
if(!targetAura || (*i)->GetAuraDuration() < targetAura->GetAuraDuration())
if(!targetAura || (*i)->GetParentAura()->GetAuraDuration() < targetAura->GetParentAura()->GetAuraDuration())
targetAura = *i;
}
}
@@ -2582,7 +2520,7 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
return;
}
int32 tickheal = targetAura->GetModifier()->m_amount;
int32 tickheal = targetAura->GetAmount();
if(Unit* auraCaster = targetAura->GetCaster())
tickheal = auraCaster->SpellHealingBonus(unitTarget, targetAura->GetSpellProto(), tickheal, DOT);
//int32 tickheal = targetAura->GetSpellProto()->EffectBasePoints[idx] + 1;
@@ -2591,14 +2529,14 @@ void Spell::SpellDamageHeal(uint32 /*i*/)
int32 tickcount = 0;
if(targetAura->GetSpellProto()->SpellFamilyName == SPELLFAMILY_DRUID)
{
switch(targetAura->GetSpellProto()->SpellFamilyFlags[0])//TODO: proper spellfamily for 3.0.x
switch(targetAura->GetSpellProto()->SpellFamilyFlags[0])
{
case 0x10: tickcount = 4; break; // Rejuvenation
case 0x40: tickcount = 6; break; // Regrowth
}
}
addhealth += tickheal * tickcount;
unitTarget->RemoveAurasByCasterSpell(targetAura->GetId(), targetAura->GetCasterGUID());
unitTarget->RemoveAura(targetAura->GetId(), targetAura->GetCasterGUID());
//addhealth += tickheal * tickcount;
//addhealth = caster->SpellHealingBonus(m_spellInfo, addhealth,HEAL, unitTarget);
@@ -3256,13 +3194,14 @@ void Spell::EffectProficiency(uint32 /*i*/)
void Spell::EffectApplyAreaAura(uint32 i)
{
if(!unitTarget)
return;
/* if(!unitTarget)
return;
if(!unitTarget->isAlive())
return;
AreaAura* Aur = new AreaAura(m_spellInfo, i, &damage, unitTarget, m_caster, m_CastItem);
unitTarget->AddAura(Aur);
unitTarget->AddAura(Aur);*/
}
void Spell::EffectSummonType(uint32 i)
@@ -3340,9 +3279,7 @@ void Spell::EffectDispel(uint32 i)
if(!unitTarget)
return;
//std::vector <DispelEntry> dispel_list;
DispelSet dispel_list;
DispelEntry entry;
std::list < Aura * > dispel_list;
// Create dispel mask by dispel type
uint32 dispel_type = m_spellInfo->EffectMiscValue[i];
@@ -3351,7 +3288,7 @@ void Spell::EffectDispel(uint32 i)
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
Aura *aur = (*itr).second;
if (aur && (1<<aur->GetSpellProto()->Dispel) & dispelMask)
if (aur && ((1<<aur->GetSpellProto()->Dispel) & dispelMask))
{
if(aur->GetSpellProto()->Dispel == DISPEL_MAGIC)
{
@@ -3366,56 +3303,63 @@ void Spell::EffectDispel(uint32 i)
if(positive == unitTarget->IsFriendlyTo(m_caster))
continue;
}
entry.casterGuid = itr->second->GetCasterGUID();
entry.spellId = itr->second->GetId();
entry.caster = itr->second->GetCaster();
entry.stackAmount = itr->second->GetStackAmount();
dispel_list.insert (entry);
for (uint8 i = aur->GetStackAmount();i!=0;--i)
dispel_list.push_back(aur);
}
}
// Ok if exist some buffs for dispel try dispel it
if (uint32 list_size = dispel_list.size())
{
std::list < std::pair<uint32,uint64> > success_list;// (spell_id,casterGuid)
std::list < uint32 > fail_list; // spell_id
uint32 failCount = 0;
std::list < Aura * > success_list;
WorldPacket dataFail(SMSG_DISPEL_FAILED, 8+8+4+4+damage*4);
// dispel N = damage buffs (or while exist buffs for dispel)
for (int32 count=0; count < damage && list_size > 0; ++count)
for (int32 count=0; count < damage && list_size > 0; ++count, list_size = dispel_list.size())
{
// Random select buff for dispel
DispelSet::iterator itr=dispel_list.begin();
for (uint32 i=urand(0, list_size-1);i!=0;--i)
itr++;
std::list < Aura * > ::iterator itr = dispel_list.begin();
for (uint32 i=urand(0, list_size-1);i>0;--i)
itr++;
if (GetDispelChance(this, itr->caster, itr->spellId))
if (GetDispelChance(this, (*itr)->GetCaster(), (*itr)->GetId()))
{
success_list.push_back(std::pair<uint32,uint64>(itr->spellId,itr->casterGuid));
entry.stackAmount-=1;
if (!itr->stackAmount)
dispel_list.erase(itr);
success_list.push_back(*itr);
dispel_list.erase(itr);
}
else
fail_list.push_back(itr->spellId);
}
// Send success log and really remove auras
if (!success_list.empty())
{
int32 count = success_list.size();
WorldPacket data(SMSG_SPELLDISPELLOG, 8+8+4+1+4+count*5);
data.append(unitTarget->GetPackGUID()); // Victim GUID
data.append(m_caster->GetPackGUID()); // Caster GUID
data << uint32(m_spellInfo->Id); // dispel spell id
data << uint8(0); // not used
data << uint32(count); // count
for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
{
SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
data << uint32(spellInfo->Id); // Spell Id
data << uint8(0); // 0 - dispelled !=0 cleansed
//Why are Aura's Removed by EffIndex? Auras should be removed as a whole.....
unitTarget->RemoveAurasDueToSpellByDispel(spellInfo->Id, j->second, m_caster);
}
m_caster->SendMessageToSet(&data, true);
if (!failCount)
{
// Failed to dispell
dataFail << uint64(m_caster->GetGUID()); // Caster GUID
dataFail << uint64(unitTarget->GetGUID()); // Victim GUID
dataFail << uint32(m_spellInfo->Id); // dispel spell id
}
failCount++;
dataFail << uint32((*itr)->GetId()); // Spell Id
}
}
if (failCount)
{
m_caster->SendMessageToSet(&dataFail, true);
}
if (success_list.size())
{
WorldPacket dataSuccess(SMSG_SPELLDISPELLOG, 8+8+4+1+4+damage*5);
// Send packet header
dataSuccess.append(unitTarget->GetPackGUID()); // Victim GUID
dataSuccess.append(m_caster->GetPackGUID()); // Caster GUID
dataSuccess << uint32(m_spellInfo->Id); // dispel spell id
dataSuccess << uint8(0); // not used
dataSuccess << uint32(success_list.size()); // count
for (std::list < Aura * > ::iterator itr = success_list.begin();itr!=success_list.end();++itr)
{
// Send dispelled spell info
dataSuccess << uint32((*itr)->GetId()); // Spell Id
dataSuccess << uint8(0); // 0 - dispelled !=0 cleansed
unitTarget->RemoveAurasDueToSpellByDispel((*itr)->GetId(), (*itr)->GetCasterGUID(), m_caster);
}
m_caster->SendMessageToSet(&dataSuccess, true);
// On succes dispel
// Devour Magic
@@ -3439,18 +3383,6 @@ void Spell::EffectDispel(uint32 i)
m_caster->CastSpell(m_caster, heal_spell, true);
}
}
// Send fail log to client
if (!fail_list.empty())
{
// Failed to dispell
WorldPacket data(SMSG_DISPEL_FAILED, 8+8+4+4*fail_list.size());
data << uint64(m_caster->GetGUID()); // Caster GUID
data << uint64(unitTarget->GetGUID()); // Victim GUID
data << uint32(m_spellInfo->Id); // dispel spell id
for (std::list< uint32 >::iterator j = fail_list.begin(); j != fail_list.end(); ++j)
data << uint32(*j); // Spell Id
m_caster->SendMessageToSet(&data, true);
}
}
}
@@ -4107,21 +4039,12 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
return;
uint32 stack = 0;
int32 maxStack = 0;
Unit::AuraList const& list = unitTarget->GetAurasByType(SPELL_AURA_MOD_RESISTANCE);
for(Unit::AuraList::const_iterator itr=list.begin();itr!=list.end();++itr)
if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_MOD_RESISTANCE,SPELLFAMILY_WARRIOR,SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR, 0, 0, m_caster->GetGUID()))
{
SpellEntry const *proto = (*itr)->GetSpellProto();
if(proto->SpellFamilyName == SPELLFAMILY_WARRIOR
&& proto->SpellFamilyFlags.IsEqual(SPELLFAMILYFLAG_WARRIOR_SUNDERARMOR)
&& (*itr)->GetCasterGUID() == m_caster->GetGUID())
{
(*itr)->RefreshAura();
stack = (*itr)->GetStackAmount();
maxStack = proto->StackAmount;
((Player*)m_caster)->ApplySpellMod(proto->Id, SPELLMOD_CHARGES, maxStack, this);
break;
}
aur->GetParentAura()->RefreshAura();
stack = aur->GetParentAura()->GetStackAmount();
maxStack = aur->GetSpellProto()->StackAmount;
break;
}
for(int j = 0; j < 3; j++)
@@ -4211,11 +4134,11 @@ void Spell::SpellDamageWeaponDmg(uint32 i)
// Stormstrike
if(m_spellInfo->SpellFamilyFlags[1] & 0x0010)
{
Unit::AuraList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraList::const_iterator i = m_OverrideClassScript.begin(); i != m_OverrideClassScript.end(); ++i)
Unit::AuraEffectList const& m_OverrideClassScript = m_caster->GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(Unit::AuraEffectList::const_iterator i = m_OverrideClassScript.begin(); i != m_OverrideClassScript.end(); ++i)
{
// Stormstrike AP Buff
if ( (*i)->GetModifier()->m_miscvalue == 5634 )
if ( (*i)->GetMiscValue() == 5634 )
{
m_caster->CastSpell(m_caster,38430,true,NULL,*i);
break;
@@ -4357,7 +4280,7 @@ void Spell::EffectInterruptCast(uint32 i)
{
if(m_originalCaster)
{
int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, i, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo));
int32 duration = m_originalCaster->ModSpellDuration(m_spellInfo, unitTarget, m_originalCaster->CalcSpellDuration(m_spellInfo), false);
unitTarget->ProhibitSpellScholl(GetSpellSchoolMask(unitTarget->m_currentSpells[i]->m_spellInfo), duration/*GetSpellDuration(m_spellInfo)*/);
}
unitTarget->InterruptSpell(i,false);
@@ -4471,7 +4394,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
// check presence
for(int j = 0; j < 4; ++j)
if(unitTarget->HasAura(spells[j],0))
if(unitTarget->HasAuraEffect(spells[j],0))
return;
// select spell
@@ -4499,11 +4422,11 @@ void Spell::EffectScriptEffect(uint32 effIndex)
}
// Brittle Armor - need remove one 24575 Brittle Armor aura
case 24590:
unitTarget->RemoveSingleSpellAurasFromStack(24575);
unitTarget->RemoveAuraFromStack(24575);
return;
// Mercurial Shield - need remove one 26464 Mercurial Shield aura
case 26465:
unitTarget->RemoveSingleSpellAurasFromStack(26464);
unitTarget->RemoveAuraFromStack(26464);
return;
// Orb teleport spells
case 25140:
@@ -4569,7 +4492,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
return;
// Prevent stacking of mounts
unitTarget->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED);
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)
@@ -4592,8 +4515,9 @@ void Spell::EffectScriptEffect(uint32 effIndex)
if(!unitTarget)
return;
// It is said that removing effects by script should include dispel resist mods
unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_ROOT, this);
unitTarget->RemoveSpellsCausingAuraWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this);
unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_ROOT, this);
unitTarget->RemoveAurasByTypeWithDispel(SPELL_AURA_MOD_DECREASE_SPEED, this);
return;
}
// Mirren's Drinking Hat
case 29830:
@@ -4626,7 +4550,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
if (!aur->IsPositive()) //only remove negative spells
{
// check for mechanic mask
if(GetSpellMechanicMask(aur->GetSpellProto(), aur->GetEffIndex()) & mechanic_mask)
if(GetAllSpellMechanicMask(aur->GetSpellProto()) & mechanic_mask)
{
unitTarget->RemoveAurasDueToSpell(aur->GetId());
if(Auras.empty())
@@ -4838,8 +4762,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
{
uint32 itemtype;
uint32 rank = 0;
Unit::AuraList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
Unit::AuraEffectList const& mDummyAuras = unitTarget->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
{
if((*i)->GetId() == 18692)
{
@@ -4891,19 +4815,9 @@ void Spell::EffectScriptEffect(uint32 effIndex)
// Everlasting Affliction
case 47422:
// Refresh corruption on target
Unit::AuraMap& auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if( spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK &&
spellInfo->SpellFamilyFlags[0] & 0x2 &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
{
unitTarget->RefreshAurasByCasterSpell(spellInfo->Id, m_caster->GetGUID());
return;
}
}
break;
if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_WARLOCK, 0x2, 0, 0, m_caster->GetGUID()))
aur->GetParentAura()->RefreshAura();
return;
}
break;
}
@@ -4917,18 +4831,8 @@ void Spell::EffectScriptEffect(uint32 effIndex)
if (!unitTarget)
return;
// Refresh Shadow Word: Pain on target
Unit::AuraMap& auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator itr = auras.begin(); itr != auras.end(); ++itr)
{
SpellEntry const *spellInfo = (*itr).second->GetSpellProto();
if( spellInfo->SpellFamilyName == SPELLFAMILY_PRIEST &&
spellInfo->SpellFamilyFlags[0] & 0x8000 &&
(*itr).second->GetCasterGUID() == m_caster->GetGUID())
{
unitTarget->RefreshAurasByCasterSpell((*itr).second->GetId(), m_caster->GetGUID());
return;
}
}
if (AuraEffect * aur = unitTarget->GetAura(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PRIEST, 0x8000, 0, 0, m_caster->GetGUID()))
aur->GetParentAura()->RefreshAura();
return;
}
// Divine Hymn
@@ -4969,16 +4873,16 @@ void Spell::EffectScriptEffect(uint32 effIndex)
aura->RefreshAura();
// Serpent Sting - Instantly deals 40% of the damage done by your Serpent Sting.
if (familyFlag[0] & 0x4000 && aura->GetEffIndex() == 0)
if (familyFlag[0] & 0x4000)
{
spellId = 53353; // 53353 Chimera Shot - Serpent
basePoint = aura->GetModifier()->m_amount * 5 * 40 / 100;
basePoint = aura->GetPartAura(0)->GetAmount() * 5 * 40 / 100;
}
// Viper Sting - Instantly restores mana to you equal to 60% of the total amount drained by your Viper Sting.
if (familyFlag[1] & 0x00000080 && aura->GetEffIndex() == 0)
if (familyFlag[1] & 0x00000080)
{
spellId = 53358; // 53358 Chimera Shot - Viper
basePoint = aura->GetModifier()->m_amount * 4 * 60 / 100;
basePoint = aura->GetPartAura(0)->GetAmount() * 4 * 60 / 100;
}
// Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute.
if (familyFlag[0] & 0x00008000)
@@ -5021,14 +4925,14 @@ void Spell::EffectScriptEffect(uint32 effIndex)
return;
}
// all seals have aura dummy in 2 effect
Unit::AuraList const& m_dummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = m_dummyAuras.begin(); itr != m_dummyAuras.end(); ++itr)
Unit::AuraEffectList const& m_dummyAuras = m_caster->GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator itr = m_dummyAuras.begin(); itr != m_dummyAuras.end(); ++itr)
{
SpellEntry const *spellInfo = (*itr)->GetSpellProto();
// search seal (all seals have judgement's aura dummy spell id in 2 effect
if ((*itr)->GetEffIndex() != 2 || !spellInfo || !IsSealSpell(spellInfo))
continue;
spellId2 = (*itr)->GetModifier()->m_amount;
spellId2 = (*itr)->GetAmount();
SpellEntry const *judge = sSpellStore.LookupEntry(spellId2);
if (!judge)
continue;
@@ -5069,7 +4973,7 @@ void Spell::EffectScriptEffect(uint32 effIndex)
// don't overwrite an existing aura
for(uint8 i=0; i<5; i++)
if(unitTarget->HasAura(spellid+i, 0))
if(unitTarget->HasAuraEffect(spellid+i, 0))
return;
unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true);
break;
@@ -5125,7 +5029,7 @@ void Spell::EffectSanctuary(uint32 /*i*/)
// Vanish allows to remove all threat and cast regular stealth so other spells can be used
if(m_spellInfo->SpellFamilyName == SPELLFAMILY_ROGUE && (m_spellInfo->SpellFamilyFlags[0] & SPELLFAMILYFLAG_ROGUE_VANISH))
{
((Player *)m_caster)->RemoveSpellsCausingAura(SPELL_AURA_MOD_ROOT);
((Player *)m_caster)->RemoveAurasByType(SPELL_AURA_MOD_ROOT);
}
}
@@ -5898,26 +5802,17 @@ void Spell::EffectDispelMechanic(uint32 i)
uint32 mechanic = m_spellInfo->EffectMiscValue[i];
DispelSet dispel_list;
DispelEntry entry;
std::queue < Aura * > dispel_list;
Unit::AuraMap& Auras = unitTarget->GetAuras();
for(Unit::AuraMap::iterator iter = Auras.begin(); iter != Auras.end(); iter++)
if(GetAllSpellMechanicMask(iter->second->GetSpellProto()) & (1<<(mechanic-1)))
dispel_list.push(iter->second);
for(;dispel_list.size();dispel_list.pop())
{
SpellEntry const *spell = iter->second->GetSpellProto();
if(GetSpellMechanicMask(spell, iter->second->GetEffIndex()) & (1<<(mechanic-1)))
{
entry.casterGuid = iter->second->GetCasterGUID();
entry.spellId = iter->second->GetId();
entry.caster = iter->second->GetCaster();
dispel_list.insert (entry);
}
}
for(DispelSet::iterator itr = dispel_list.begin(); itr != dispel_list.end();++itr)
{
entry = *itr;
if (GetDispelChance(this, entry.caster, entry.spellId))
unitTarget->RemoveAurasByCasterSpell(entry.spellId, entry.casterGuid);
if (GetDispelChance(this, dispel_list.front()->GetCaster(), dispel_list.front()->GetId()))
unitTarget->RemoveAura(dispel_list.front()->GetId(), dispel_list.front()->GetCasterGUID());
}
}
@@ -6289,7 +6184,7 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
if(!unitTarget || unitTarget==m_caster) // can't steal from self
return;
std::vector <Aura *> steal_list;
std::list <Aura *> steal_list;
// Create dispel mask by dispel type
uint32 dispelMask = GetDispellMask( DispelType(m_spellInfo->EffectMiscValue[i]) );
Unit::AuraMap const& auras = unitTarget->GetAuras();
@@ -6304,48 +6199,33 @@ void Spell::EffectStealBeneficialBuff(uint32 i)
}
}
// Ok if exist some buffs for dispel try dispel it
if (!steal_list.empty())
if (uint32 list_size = steal_list.size())
{
std::list < std::pair<uint32,uint64> > success_list;
int32 list_size = steal_list.size();
std::list < Aura * > success_list;
// dispel N = damage buffs (or while exist buffs for dispel)
for (int32 count=0; count < damage && list_size > 0; ++count)
for (int32 count=0; count < damage && list_size > 0; ++count, list_size = steal_list.size())
{
// Random select buff for dispel
Aura *aur = steal_list[urand(0, list_size-1)];
// Not use chance for steal
// TODO possible need do it
success_list.push_back( std::pair<uint32,uint64>(aur->GetId(),aur->GetCasterGUID()));
// Remove buff from list for prevent doubles
for (std::vector<Aura *>::iterator j = steal_list.begin(); j != steal_list.end(); )
{
Aura *stealed = *j;
if (stealed->GetId() == aur->GetId() && stealed->GetCasterGUID() == aur->GetCasterGUID())
{
j = steal_list.erase(j);
--list_size;
}
else
++j;
}
std::list < Aura * > ::iterator itr = steal_list.begin();
for (uint32 i=urand(0, list_size-1);i>0;--i)
itr++;
success_list.push_back(*itr);
steal_list.erase(itr);
}
// Really try steal and send log
if (!success_list.empty())
if (success_list.size())
{
int32 count = success_list.size();
WorldPacket data(SMSG_SPELLSTEALLOG, 8+8+4+1+4+count*5);
WorldPacket data(SMSG_SPELLSTEALLOG, 8+8+4+1+4+damage*5);
data.append(unitTarget->GetPackGUID()); // Victim GUID
data.append(m_caster->GetPackGUID()); // Caster GUID
data << uint32(m_spellInfo->Id); // dispel spell id
data << uint8(0); // not used
data << uint32(count); // count
for (std::list<std::pair<uint32,uint64> >::iterator j = success_list.begin(); j != success_list.end(); ++j)
data << uint32(success_list.size()); // count
for (std::list < Aura * > ::iterator itr = success_list.begin();itr!=success_list.end();++itr)
{
SpellEntry const* spellInfo = sSpellStore.LookupEntry(j->first);
data << uint32(spellInfo->Id); // Spell Id
data << uint32((*itr)->GetId()); // Spell Id
data << uint8(0); // 0 - steals !=0 transfers
unitTarget->RemoveAurasDueToSpellBySteal(spellInfo->Id, j->second, m_caster);
unitTarget->RemoveAurasDueToSpellBySteal((*itr)->GetId(), (*itr)->GetCasterGUID(), m_caster);
}
m_caster->SendMessageToSet(&data, true);
}
+1 -1
View File
@@ -395,7 +395,7 @@ void WorldSession::HandleCancelAuraOpcode( WorldPacket& recvPacket)
}
// non channeled case
_player->RemoveAurasByCasterSpell(spellId, _player->GetGUID(), AURA_REMOVE_BY_CANCEL);
_player->RemoveAurasDueToSpell(spellId, _player->GetGUID(), AURA_REMOVE_BY_CANCEL);
}
void WorldSession::HandlePetCancelAuraOpcode( WorldPacket& recvPacket)
+10 -33
View File
@@ -240,7 +240,7 @@ bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId)
{
// we assume that aura dispel chance is 100% on start
// need formula for level difference based chance
int32 miss_chance = 100;
int32 miss_chance = 0;
// Apply dispel mod from aura caster
if (caster)
{
@@ -248,7 +248,7 @@ bool GetDispelChance(Spell* spell, Unit* caster, uint32 spellId)
modOwner->ApplySpellMod(spellId, SPELLMOD_RESIST_DISPEL_CHANCE, miss_chance, spell);
}
// Try dispel
return roll_chance_i(miss_chance);
return !roll_chance_i(miss_chance);
}
uint32 GetSpellCastTime(SpellEntry const* spellInfo, Spell const* spell)
@@ -290,33 +290,9 @@ bool IsAutocastableSpell(uint32 spellId)
return true;
}
/*bool IsNoStackAuraDueToAura(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
bool IsHigherHankOfSpell(uint32 spellId_1, uint32 spellId_2)
{
SpellEntry const *spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
SpellEntry const *spellInfo_2 = sSpellStore.LookupEntry(spellId_2);
if(!spellInfo_1 || !spellInfo_2) return false;
if(spellInfo_1->Id == spellId_2) return false;
if (spellInfo_1->Effect[effIndex_1] != spellInfo_2->Effect[effIndex_2] ||
spellInfo_1->EffectItemType[effIndex_1] != spellInfo_2->EffectItemType[effIndex_2] ||
spellInfo_1->EffectMiscValue[effIndex_1] != spellInfo_2->EffectMiscValue[effIndex_2] ||
spellInfo_1->EffectApplyAuraName[effIndex_1] != spellInfo_2->EffectApplyAuraName[effIndex_2])
return false;
return true;
}*/
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2)
{
SpellEntry const*spellInfo_1 = sSpellStore.LookupEntry(spellId_1);
SpellEntry const*spellInfo_2 = sSpellStore.LookupEntry(spellId_2);
if(!spellInfo_1 || !spellInfo_2) return 0;
if (spellId_1 == spellId_2) return 0;
int32 diff = spellInfo_1->EffectBasePoints[effIndex_1] - spellInfo_2->EffectBasePoints[effIndex_2];
if (spellInfo_1->CalculateSimpleValue(effIndex_1) < 0 && spellInfo_2->CalculateSimpleValue(effIndex_2) < 0)
return -diff;
else return diff;
return spellmgr.GetSpellRank(spellId_1)<spellmgr.GetSpellRank(spellId_2);
}
SpellSpecific GetSpellSpecific(uint32 spellId)
@@ -410,9 +386,6 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
if( spellInfo->SpellFamilyFlags[1] & 0x00440000 || spellInfo->SpellFamilyFlags[0] & 0x00380000 || spellInfo->SpellFamilyFlags[2] & 0x00001010)
return SPELL_ASPECT;
if( spellInfo->SpellFamilyFlags[2] & 0x00000002 )
return SPELL_TRACKER;
break;
}
case SPELLFAMILY_PALADIN:
@@ -461,6 +434,10 @@ SpellSpecific GetSpellSpecific(uint32 spellId)
case SPELL_AURA_MOD_POSSESS_PET:
case SPELL_AURA_MOD_POSSESS:
return SPELL_CHARM;
case SPELL_AURA_TRACK_CREATURES:
case SPELL_AURA_TRACK_RESOURCES:
case SPELL_AURA_TRACK_STEALTHED:
return SPELL_TRACKER;
}
}
}
@@ -3111,10 +3088,10 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return false;
if(auraSpell > 0)
// have expected aura
return player->HasAura(auraSpell,0);
return player->HasAura(auraSpell);
else
// not have expected aura
return !player->HasAura(-auraSpell,0);
return !player->HasAura(-auraSpell);
}
return true;
+3 -5
View File
@@ -162,7 +162,7 @@ inline uint32 GetSpellRecoveryTime(SpellEntry const *spellInfo) { return spellIn
int32 GetSpellDuration(SpellEntry const *spellInfo);
int32 GetSpellMaxDuration(SpellEntry const *spellInfo);
struct DispelEntry
/*struct DispelEntry
{
uint64 casterGuid;
uint32 spellId;
@@ -173,9 +173,7 @@ struct DispelEntry
{
return (spellId != _Right.spellId ? spellId < _Right.spellId : casterGuid < _Right.casterGuid);
}
};
typedef std::set < DispelEntry > DispelSet;
};*/
inline bool IsSpellHaveEffect(SpellEntry const *spellInfo, SpellEffects effect)
{
@@ -214,7 +212,7 @@ inline bool IsLootCraftingSpell(SpellEntry const *spellInfo)
(spellInfo->Effect[1]==SPELL_EFFECT_SCRIPT_EFFECT || !spellInfo->EffectItemType[0]);
}
int32 CompareAuraRanks(uint32 spellId_1, uint32 effIndex_1, uint32 spellId_2, uint32 effIndex_2);
bool IsHigherHankOfSpell(uint32 spellId_1,uint32 spellId_2);
bool IsSingleFromSpellSpecificPerCaster(uint32 spellSpec1, uint32 spellSpec2);
bool IsSingleFromSpellSpecificPerTarget(uint32 spellSpec1, uint32 spellSpec2);
bool IsPassiveSpell(uint32 spellId);
+25 -27
View File
@@ -97,8 +97,8 @@ bool Player::UpdateStats(Stats stat)
// Update ratings in exist SPELL_AURA_MOD_RATING_FROM_STAT and only depends from stat
uint32 mask = 0;
AuraList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
for(AuraList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
AuraEffectList const& modRatingFromStat = GetAurasByType(SPELL_AURA_MOD_RATING_FROM_STAT);
for(AuraEffectList::const_iterator i = modRatingFromStat.begin();i != modRatingFromStat.end(); ++i)
if (Stats((*i)->GetMiscBValue()) == stat)
mask |= (*i)->GetMiscValue();
if (mask)
@@ -192,12 +192,11 @@ void Player::UpdateArmor()
value += GetModifierValue(unitMod, TOTAL_VALUE);
//add dynamic flat mods
AuraList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mResbyIntellect.begin();i != mResbyIntellect.end(); ++i)
AuraEffectList const& mResbyIntellect = GetAurasByType(SPELL_AURA_MOD_RESISTANCE_OF_STAT_PERCENT);
for(AuraEffectList::const_iterator i = mResbyIntellect.begin();i != mResbyIntellect.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
if(mod->m_miscvalue & SPELL_SCHOOL_MASK_NORMAL)
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * mod->m_amount / 100.0f);
if((*i)->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
value += int32(GetStat(Stats((*i)->GetMiscBValue())) * (*i)->GetAmount() / 100.0f);
}
value *= GetModifierValue(unitMod, TOTAL_PCT);
@@ -318,13 +317,13 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
case FORM_DIREBEAR:
case FORM_MOONKIN:
{
Unit::AuraList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
Unit::AuraEffectList const& mDummy = GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator itr = mDummy.begin(); itr != mDummy.end(); ++itr)
{
// Predatory Strikes
if ((*itr)->GetSpellProto()->SpellIconID == 1563)
{
mLevelMult = (*itr)->GetModifier()->m_amount / 100.0f;
mLevelMult = (*itr)->GetAmount() / 100.0f;
break;
}
}
@@ -362,16 +361,16 @@ void Player::UpdateAttackPowerAndDamage(bool ranged )
{
if ((getClassMask() & CLASSMASK_WAND_USERS)==0)
{
AuraList const& mRAPbyStat = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mRAPbyStat.begin();i != mRAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
AuraEffectList const& mRAPbyStat = GetAurasByType(SPELL_AURA_MOD_RANGED_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraEffectList::const_iterator i = mRAPbyStat.begin();i != mRAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
}
}
else
{
AuraList const& mAPbyStat = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraList::const_iterator i = mAPbyStat.begin();i != mAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetModifier()->m_miscvalue)) * (*i)->GetModifier()->m_amount / 100.0f);
AuraEffectList const& mAPbyStat = GetAurasByType(SPELL_AURA_MOD_ATTACK_POWER_OF_STAT_PERCENT);
for(AuraEffectList::const_iterator i = mAPbyStat.begin();i != mAPbyStat.end(); ++i)
attPowerMod += int32(GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 100.0f);
}
float attPowerMultiplier = GetModifierValue(unitMod, TOTAL_PCT) - 1.0f;
@@ -652,15 +651,15 @@ void Player::UpdateExpertise(WeaponAttackType attack)
Item *weapon = GetWeaponForAttack(attack);
AuraList const& expAuras = GetAurasByType(SPELL_AURA_MOD_EXPERTISE);
for(AuraList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
AuraEffectList const& expAuras = GetAurasByType(SPELL_AURA_MOD_EXPERTISE);
for(AuraEffectList::const_iterator itr = expAuras.begin(); itr != expAuras.end(); ++itr)
{
// item neutral spell
if((*itr)->GetSpellProto()->EquippedItemClass == -1)
expertise += (*itr)->GetModifier()->m_amount;
expertise += (*itr)->GetAmount();
// item dependent spell
else if(weapon && weapon->IsFitToSpellRequirements((*itr)->GetSpellProto()))
expertise += (*itr)->GetModifier()->m_amount;
expertise += (*itr)->GetAmount();
}
if(expertise < 0)
@@ -692,19 +691,18 @@ void Player::UpdateManaRegen()
float power_regen_mp5 = (GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA) + m_baseManaRegen) / 5.0f;
// Get bonus from SPELL_AURA_MOD_MANA_REGEN_FROM_STAT aura
AuraList const& regenAura = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT);
for(AuraList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
AuraEffectList const& regenAura = GetAurasByType(SPELL_AURA_MOD_MANA_REGEN_FROM_STAT);
for(AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
{
Modifier* mod = (*i)->GetModifier();
power_regen_mp5 += GetStat(Stats(mod->m_miscvalue)) * mod->m_amount / 500.0f;
power_regen_mp5 += GetStat(Stats((*i)->GetMiscValue())) * (*i)->GetAmount() / 500.0f;
}
// Bonus from some dummy auras
AuraList const& mDummyAuras = GetAurasByType(SPELL_AURA_PERIODIC_DUMMY);
for(AuraList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
AuraEffectList const& mDummyAuras = GetAurasByType(SPELL_AURA_PERIODIC_DUMMY);
for(AuraEffectList::const_iterator i = mDummyAuras.begin();i != mDummyAuras.end(); ++i)
if((*i)->GetId() == 34074) // Aspect of the Viper
{
power_regen_mp5 += (*i)->GetModifier()->m_amount * Intellect / 500.0f;
power_regen_mp5 += (*i)->GetAmount() * Intellect / 500.0f;
// Add regen bonus from level in this dummy
power_regen_mp5 += getLevel() * 35 / 100;
}
+2 -2
View File
@@ -89,7 +89,7 @@ void WorldSession::HandleTaxiQueryAvailableNodes( WorldPacket & recv_data )
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
// unknown taxi node case
if( SendLearnNewTaxiNode(unit) )
@@ -123,7 +123,7 @@ void WorldSession::SendDoFlight( uint16 MountId, uint32 path, uint32 pathNode )
{
// remove fake death
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
GetPlayer()->RemoveAurasByType(SPELL_AURA_FEIGN_DEATH);
while(GetPlayer()->GetMotionMaster()->GetCurrentMovementGeneratorType()==FLIGHT_MOTION_TYPE)
GetPlayer()->GetMotionMaster()->MovementExpired(false);
+882 -1164
View File
File diff suppressed because it is too large Load Diff
+47 -75
View File
@@ -281,11 +281,11 @@ enum InventorySlot
};
struct FactionTemplateEntry;
struct Modifier;
struct SpellEntry;
struct SpellEntryExt;
class Aura;
class AuraEffect;
class Creature;
class Spell;
class DynamicObject;
@@ -329,9 +329,10 @@ enum DamageTypeToSchool
enum AuraRemoveMode
{
AURA_REMOVE_BY_DEFAULT,
AURA_REMOVE_BY_DELETE, // change stack, single aura remove, duel complete
AURA_REMOVE_BY_STACK, // change stack, single aura remove,
AURA_REMOVE_BY_CANCEL,
AURA_REMOVE_BY_ENEMY_SPELL, // dispel and absorb aura destroy
AURA_REMOVE_BY_EXPIRE, // dispel and absorb aura destroy
AURA_REMOVE_BY_DEATH
};
@@ -834,14 +835,6 @@ enum ReactiveType
#define SUMMON_SLOT_QUEST 6
#define MAX_SUMMON_SLOT 7
struct AuraSlotEntry
{
uint8 m_Flags;
uint8 m_Level;
uint32 m_spellId;
Aura * m_slotAuras[3];
};
// delay time next attack to prevent client attack animation problems
#define ATTACK_DISPLAY_DELAY 200
@@ -853,12 +846,13 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
typedef std::set<Unit*> AttackerSet;
typedef std::set<Unit*> ControlList;
typedef std::pair<uint32, uint8> spellEffectPair;
typedef std::multimap< spellEffectPair, Aura*> AuraMap;
typedef std::multimap<uint32, Aura*> AuraMap;
typedef std::list<AuraEffect *> AuraEffectList;
typedef std::list<Aura *> AuraList;
typedef std::list<DiminishingReturn> Diminishing;
typedef std::set<uint32> ComboPointHolderSet;
typedef std::map<uint8, AuraSlotEntry> VisibleAuraMap;
typedef std::map<uint8, Aura*> VisibleAuraMap;
virtual ~Unit ( );
@@ -878,7 +872,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 GetSpellRadiusForTarget(Unit* target,const SpellRadiusEntry * radiusEntry);
virtual void Update( uint32 time );
void UpdateAuras();
void setAttackTimer(WeaponAttackType type, uint32 time) { m_attackTimer[type] = time; }
void resetAttackTimer(WeaponAttackType type = BASE_ATTACK);
@@ -1105,13 +1098,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void ClearInCombat();
uint32 GetCombatTimer() const { return m_CombatTimer; }
bool HasAuraType(AuraType auraType) const;
bool HasAura(uint32 spellId, uint32 effIndex) const
{
return m_Auras.find(spellEffectPair(spellId, effIndex)) != m_Auras.end();
}
bool HasAura(uint32 spellId) const;
bool virtual HasSpell(uint32 /*spellID*/) const { return false; }
bool HasStealthAura() const { return HasAuraType(SPELL_AURA_MOD_STEALTH); }
@@ -1132,13 +1118,15 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SendHealSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage, bool critical = false);
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage, bool isTriggeredSpell = false, bool useSpellDamage = true);
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void CastSpell(GameObject *go, uint32 spellId, bool triggered, Item *castItem = NULL, AuraEffect* triggeredByAura = NULL, uint64 originalCaster = 0);
void AddAura(uint32 spellId, Unit *target);
void HandleAuraEffect(AuraEffect * aureff, bool apply);
Aura *AddAuraEffect(uint32 spellId, uint8 effIndex, Unit* caster);
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;
@@ -1244,35 +1232,22 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
bool AddAura(Aura *aur);
void RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode = AURA_REMOVE_BY_DEFAULT);
void RemoveAura(uint32 spellId, uint32 effindex, Aura* except = NULL);
void RemoveSingleSpellAurasFromStack(uint32 spellId);
void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex);
void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL);
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
void RemoveAurasBySpell(uint32 spellId, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasByCasterSpell(uint32 spellId, uint8 effindex, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
void RefreshAurasByCasterSpell(uint32 spellId, uint64 casterGUID);
void SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration);
Aura* GetAuraByCasterSpell(uint32 spellId, uint64 casterGUID);
void RemoveAura(uint32 spellId, uint64 caster = 0 ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasDueToSpell(uint32 spellId, uint64 caster = NULL ,AuraRemoveMode removeMode= AURA_REMOVE_BY_DEFAULT);
void RemoveAuraFromStack(uint32 spellId, uint64 caster = NULL ,AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
inline void RemoveAuraFromStack(AuraMap::iterator &iter,AuraRemoveMode removeMode);
void RemoveAurasDueToSpellByDispel(uint32 spellId, uint64 casterGUID, Unit *dispeler);
void RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit *stealer);
void RemoveAurasAtChanneledTarget(SpellEntry const* spellInfo, Unit * caster);
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
void RemoveAurasByType(AuraType auraType, uint64 casterGUID = 0, Aura * except=NULL);
void RemoveAurasByTypeWithDispel(AuraType auraType, Spell * spell = NULL);
void RemoveNotOwnSingleTargetAuras();
void RemoveSpellsCausingAura(AuraType auraType);
void RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell);
void RemoveAuraTypeByCaster(AuraType auraType, uint64 casterGUID);
void RemoveRankAurasDueToSpell(uint32 spellId);
bool RemoveNoStackAurasDueToAura(Aura *Aur);
void RemoveAurasWithInterruptFlags(uint32 flags, uint32 except = 0);
void RemoveAurasWithDispelType( DispelType type );
void RemoveAurasWithInterruptFlags(uint32 flag, uint32 except = NULL);
void RemoveAllAuras();
void RemoveArenaAuras(bool onleave = false);
void RemoveAllAurasOnDeath();
void DelayAura(uint32 spellId, uint32 effindex, int32 delaytime);
void DelayAura(uint32 spellId, uint64 caster, int32 delaytime);
float GetResistanceBuffMods(SpellSchools school, bool positive) const { return GetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school ); }
void SetResistanceBuffMods(SpellSchools school, bool positive, float val) { SetFloatValue(positive ? UNIT_FIELD_RESISTANCEBUFFMODSPOSITIVE+school : UNIT_FIELD_RESISTANCEBUFFMODSNEGATIVE+school,val); }
@@ -1399,33 +1374,31 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
HostilRefManager& getHostilRefManager() { return m_HostilRefManager; }
VisibleAuraMap const *GetVisibleAuras() { return &m_visibleAuras; }
AuraSlotEntry * GetVisibleAura(uint8 slot)
Aura * GetVisibleAura(uint8 slot)
{
VisibleAuraMap::iterator itr = m_visibleAuras.find(slot);
if(itr != m_visibleAuras.end())
return &itr->second;
return itr->second;
return 0;
}
AuraSlotEntry * GetVisibleAuraSlot(uint8 slot) { return &m_visibleAuras[slot]; }
void RemoveVisibleAura(uint8 slot) { m_visibleAuras.erase(slot); }
const uint64& GetAuraUpdateMask() const { return m_auraUpdateMask; }
void SetAuraUpdateMask(uint8 slot) { m_auraUpdateMask |= (uint64(1) << slot); }
void ResetAuraUpdateMask() { m_auraUpdateMask = 0; }
void SendAuraUpdate(uint8 slot);
Aura* GetAura(uint32 spellId, uint32 effindex);
Aura* GetAura(AuraType type, uint32 family, uint32 familyFlag1 = 0, uint32 familyFlag2 = 0, uint32 familyFlag3 = 0, uint64 casterGUID = 0);
void SetVisibleAura(uint8 slot, Aura * aur){ m_visibleAuras[slot]=aur; }
void RemoveVisibleAura(uint8 slot){ m_visibleAuras.erase(slot); }
AuraMap & GetAuras() { return m_Auras; }
AuraMap const& GetAuras() const { return m_Auras; }
AuraList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
void ApplyAuraProcTriggerDamage(Aura* aura, bool apply);
AuraEffectList const& GetAurasByType(AuraType type) const { return m_modAuras[type]; }
AuraEffect * GetAuraEffect(uint32 spellId, uint8 effIndex, uint64 casterGUID = 0) const;
Aura * GetAura(uint32 spellId, uint64 casterGUID = 0) const;
AuraEffect* GetAura(AuraType type, uint32 family, uint32 familyFlag1 , uint32 familyFlag2=0, uint32 familyFlag3=0, uint64 casterGUID=0);
bool HasAuraEffect(uint32 spellId, uint8 effIndex, uint64 caster = 0) const;
bool HasAura(uint32 spellId, uint64 caster = 0) const;
bool HasAuraType(AuraType auraType) const;
bool HasAuraTypeWithMiscvalue(AuraType auratype, uint32 miscvalue) const;
int32 GetTotalAuraModifier(AuraType auratype) const;
float GetTotalAuraMultiplier(AuraType auratype) const;
int32 GetMaxPositiveAuraModifier(AuraType auratype) const;
int32 GetMaxPositiveAuraModifier(AuraType auratype);
int32 GetMaxNegativeAuraModifier(AuraType auratype) const;
int32 GetTotalAuraModifierByMiscMask(AuraType auratype, uint32 misc_mask) const;
@@ -1438,7 +1411,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
int32 GetMaxPositiveAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
int32 GetMaxNegativeAuraModifierByMiscValue(AuraType auratype, int32 misc_value) const;
Aura* GetDummyAura(uint32 spell_id) const;
AuraEffect* GetDummyAura(uint32 spell_id) const;
uint32 GetInterruptMask() const { return m_interruptMask; }
void AddInterruptMask(uint32 mask) { m_interruptMask |= mask; }
void UpdateInterruptMask();
@@ -1509,7 +1482,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
int32 CalculateSpellDamage(SpellEntry const* spellProto, uint8 effect_index, int32 basePoints, Unit const* target);
int32 CalcSpellDuration(SpellEntry const* spellProto);
int32 ModSpellDuration(SpellEntry const* spellProto, uint8 effect_index, Unit const* target, int32 duration);
int32 ModSpellDuration(SpellEntry const* spellProto, Unit const* target, int32 duration, bool positive);
void ModSpellCastTime(SpellEntry const* spellProto, int32 & castTime, Spell const * spell=NULL);
float CalculateLevelPenalty(SpellEntry const* spellProto) const;
@@ -1593,7 +1566,6 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
DeathState m_deathState;
uint64 m_auraUpdateMask;
AuraMap m_Auras;
typedef std::list<uint64> DynObjectGUIDs;
@@ -1604,7 +1576,7 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
uint32 m_transform;
uint32 m_removedAuras;
AuraList m_modAuras[TOTAL_AURAS];
AuraEffectList m_modAuras[TOTAL_AURAS];
AuraList m_scAuras; // casted singlecast auras
AuraList m_interruptableAuras;
AuraList m_ccAuras;
@@ -1635,14 +1607,14 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void SendAttackStop(Unit* victim); // only from AttackStop(Unit*)
//void SendAttackStart(Unit* pVictim); // only from Unit::AttackStart(Unit*)
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, Aura* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, Aura* triggredByAura, SpellEntry const *procSpell, uint32 cooldown);
bool HandleAuraRaidProcFromChargeWithValue(Aura* triggeredByAura);
bool HandleAuraRaidProcFromCharge(Aura* triggeredByAura);
bool IsTriggeredAtSpellProcEvent(Unit *pVictim, AuraEffect* aura, SpellEntry const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const*& spellProcEvent );
bool HandleDummyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleObsModEnergyAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleHasteAuraProc( Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown);
bool HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraEffect* triggeredByAura, SpellEntry const *procSpell, uint32 cooldown);
bool HandleAuraRaidProcFromChargeWithValue(AuraEffect* triggeredByAura);
bool HandleAuraRaidProcFromCharge(AuraEffect* triggeredByAura);
void SetFeared(bool apply);
void SetConfused(bool apply);
+1 -1
View File
@@ -297,7 +297,7 @@ void WorldSession::LogoutPlayer(bool Save)
else if(_player->HasAuraType(SPELL_AURA_SPIRIT_OF_REDEMPTION))
{
// this will kill character by SPELL_AURA_SPIRIT_OF_REDEMPTION
_player->RemoveSpellsCausingAura(SPELL_AURA_MOD_SHAPESHIFT);
_player->RemoveAurasByType(SPELL_AURA_MOD_SHAPESHIFT);
//_player->SetDeathPvP(*); set at SPELL_AURA_SPIRIT_OF_REDEMPTION apply time
_player->KillPlayer();
_player->BuildPlayerRepop();