*Remove hack in Brain Freeze code.

*Update Improved Mend Pet to 3.1.3.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-16 19:13:02 +02:00
parent a4b91e2cc4
commit ec5515ee49
5 changed files with 196 additions and 295 deletions
+3 -3
View File
@@ -1066,9 +1066,9 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
( 44472, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 5) ( 44472, 0x00, 3, 0x20E21277, 0x00019048, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Burnout (Rank 5)
( 44543, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 7, 0), -- Fingers of Frost (Rank 1) ( 44543, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 7, 0), -- Fingers of Frost (Rank 1)
( 44545, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 15, 0), -- Fingers of Frost (Rank 2) ( 44545, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00010000, 0x00000000, 0, 15, 0), -- Fingers of Frost (Rank 2)
( 44546, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1) ( 44546, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1)
( 44548, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2) ( 44548, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2)
( 44549, 0x00, 3, 0x020002A0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 3) ( 44549, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 3)
( 44745, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00004000, 0x00002000, 0, 0, 0), -- Shattered Barrier (Rank 1) ( 44745, 0x00, 3, 0x00000000, 0x00000001, 0x00000000, 0x00004000, 0x00002000, 0, 0, 0), -- Shattered Barrier (Rank 1)
( 44835, 0x00, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Maim Interrupt ( 44835, 0x00, 7, 0x00000000, 0x00000080, 0x00000000, 0x00000010, 0x00000000, 0, 0, 0), -- Maim Interrupt
( 45054, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Augment Pain ( 45054, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 15), -- Augment Pain
@@ -0,0 +1,5 @@
DELETE FROM `spell_proc_event` WHERE `entry`IN(44546, 44548, 44549);
INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
( 44546, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 1)
( 44548, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0), -- Brain Freeze (Rank 2)
( 44549, 0x00, 3, 0x00100220, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0); -- Brain Freeze (Rank 3)
+2
View File
@@ -970,6 +970,8 @@ Item* Item::CreateItem( uint32 item, uint32 count, Player const* player )
else else
delete pItem; delete pItem;
} }
else
assert(false);
return NULL; return NULL;
} }
+4 -4
View File
@@ -2308,11 +2308,11 @@ enum CorpseDynFlags
#define SPELL_ID_FROST_PRESENCE 48263 // Frost Presence #define SPELL_ID_FROST_PRESENCE 48263 // Frost Presence
#define SPELL_ID_UNHOLY_PRESENCE 48265 // Unholy Presence #define SPELL_ID_UNHOLY_PRESENCE 48265 // Unholy Presence
#define SPELL_ID_NE_GHOST 20584 // Night Elf Ghost Aura #define SPELL_ID_NE_GHOST 20584 // Night Elf Ghost Aura
#define SPELL_ID_GHOST 8326 // Ghost #define SPELL_ID_GHOST 8326 // Ghost
#define SPELL_ID_DESERTER 26013 // Deserter #define SPELL_ID_DESERTER 26013 // Deserter
#define SPELL_ID_LOGINEFFECT 836 // LOGINEFFECT #define SPELL_ID_LOGINEFFECT 836 // LOGINEFFECT
#define SPELL_ID_HONORLESS_TARGET 2479 // Honorless target #define SPELL_ID_HONORLESS_TARGET 2479 // Honorless target
#define SPELL_ID_DUEL_BEG 7267 // Beg #define SPELL_ID_DUEL_BEG 7267 // Beg
enum WeatherType enum WeatherType
{ {
+182 -288
View File
@@ -5981,6 +5981,16 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
target = this; target = this;
break; break;
} }
// Improved Mend Pet
if ( dummySpell->SpellIconID == 267 )
{
int32 chance = triggeredByAura->GetSpellProto()->EffectBasePoints[triggeredByAura->GetEffIndex()];
if(!roll_chance_i(chance))
return false;
triggered_spell_id = 24406;
break;
}
// Lock and Load // Lock and Load
if ( dummySpell->SpellIconID == 3579 ) if ( dummySpell->SpellIconID == 3579 )
{ {
@@ -7013,43 +7023,48 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL; ? ((Player*)this)->GetItemByGuid(triggeredByAura->GetParentAura()->GetCastItemGUID()) : NULL;
// Try handle unknown trigger spells // Try handle unknown trigger spells
if (sSpellStore.LookupEntry(trigger_spell_id)==NULL) if (sSpellStore.LookupEntry(trigger_spell_id) == NULL)
{ {
switch (auraSpellInfo->SpellFamilyName) switch (auraSpellInfo->SpellFamilyName)
{ {
case SPELLFAMILY_GENERIC: case SPELLFAMILY_GENERIC:
if (auraSpellInfo->Id == 23780) // Aegis of Preservation (Aegis of Preservation trinket) switch (auraSpellInfo->Id)
trigger_spell_id = 23781;
else if (auraSpellInfo->Id==43820) // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket)
{ {
// Pct value stored in dummy case 23780: // Aegis of Preservation (Aegis of Preservation trinket)
basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100; trigger_spell_id = 23781;
target = pVictim; break;
break; case 33896: // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher)
} trigger_spell_id = 33898;
else if (auraSpellInfo->Id==57345) // Darkmoon Card: Greatness break;
{ case 43820: // Charm of the Witch Doctor (Amani Charm of the Witch Doctor trinket)
float stat = 0.0f; // Pct value stored in dummy
// strength basepoints0 = pVictim->GetCreateHealth() * auraSpellInfo->EffectBasePoints[1] / 100;
if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); } target = pVictim;
// agility break;
if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); } case 57345: // Darkmoon Card: Greatness
// intellect {
if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);} float stat = 0.0f;
// spirit // strength
if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235;stat = GetStat(STAT_SPIRIT); } if (GetStat(STAT_STRENGTH) > stat) { trigger_spell_id = 60229;stat = GetStat(STAT_STRENGTH); }
} // agility
else if (auraSpellInfo->Id == 33896) // Desperate Defense (Stonescythe Whelp, Stonescythe Alpha, Stonescythe Ambusher) if (GetStat(STAT_AGILITY) > stat) { trigger_spell_id = 60233;stat = GetStat(STAT_AGILITY); }
trigger_spell_id = 33898; // intellect
else if (auraSpellInfo->Id==27522 || auraSpellInfo->Id==40336) if (GetStat(STAT_INTELLECT)> stat) { trigger_spell_id = 60234;stat = GetStat(STAT_INTELLECT);}
// Mana Drain Trigger // spirit
{ if (GetStat(STAT_SPIRIT) > stat) { trigger_spell_id = 60235;stat = GetStat(STAT_SPIRIT); }
// On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target. break;
if (this && this->isAlive()) }
CastSpell(this, 29471, true, castItem, triggeredByAura); // Mana Drain Trigger
if (pVictim && pVictim->isAlive()) case 27522:
CastSpell(pVictim, 27526, true, castItem, triggeredByAura); case 40336:
return true; {
// On successful melee or ranged attack gain $29471s1 mana and if possible drain $27526s1 mana from the target.
if (this && this->isAlive())
CastSpell(this, 29471, true, castItem, triggeredByAura);
if (pVictim && pVictim->isAlive())
CastSpell(pVictim, 27526, true, castItem, triggeredByAura);
return true;
}
} }
break; break;
case SPELLFAMILY_MAGE: case SPELLFAMILY_MAGE:
@@ -7073,9 +7088,10 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
break; break;
case SPELLFAMILY_WARLOCK: case SPELLFAMILY_WARLOCK:
{ {
// Improved Drain Soul // Drain Soul
if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000) if (auraSpellInfo->SpellFamilyFlags[0] & 0x4000)
{ {
// Improved Drain Soul
Unit::AuraEffectList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_DUMMY); Unit::AuraEffectList const& mAddFlatModifier = GetAurasByType(SPELL_AURA_DUMMY);
for(Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i) for(Unit::AuraEffectList::const_iterator i = mAddFlatModifier.begin(); i != mAddFlatModifier.end(); ++i)
{ {
@@ -7174,161 +7190,154 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
return false; return false;
basepoints0 = int32(damage * triggerAmount / 100 / (GetSpellMaxDuration(TriggerPS) / TriggerPS->EffectAmplitude[0])); basepoints0 = int32(damage * triggerAmount / 100 / (GetSpellMaxDuration(TriggerPS) / TriggerPS->EffectAmplitude[0]));
target = pVictim; target = pVictim;
} }
break; break;
} }
case SPELLFAMILY_PALADIN: case SPELLFAMILY_PALADIN:
{ {
// Healing Discount switch (auraSpellInfo->Id)
if (auraSpellInfo->Id==37705)
{ {
trigger_spell_id = 37706; // Healing Discount
target = this; case 37705:
}
// Soul Preserver
if (auraSpellInfo->Id==60510)
{
trigger_spell_id = 60515;
target = this;
}
// Illumination
else if (auraSpellInfo->SpellIconID==241)
{
if(!procSpell)
return false;
// procspell is triggered spell but we need mana cost of original casted spell
uint32 originalSpellId = procSpell->Id;
// Holy Shock heal
if(procSpell->SpellFamilyFlags[1] & 0x00010000)
{ {
switch(procSpell->Id) trigger_spell_id = 37706;
target = this;
break;
}
// Soul Preserver
case 60510:
{
trigger_spell_id = 60515;
target = this;
break;
}
// Lightning Capacitor
case 37657:
{
if(!pVictim || !pVictim->isAlive())
return false;
// stacking
CastSpell(this, 37658, true, NULL, triggeredByAura);
Aura * dummy = GetAura(37658);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(37658);
trigger_spell_id = 37661;
target = pVictim;
break;
}
// Thunder Capacitor
case 54841:
{
if(!pVictim || !pVictim->isAlive())
return false;
// stacking
CastSpell(this, 54842, true, NULL, triggeredByAura);
// counting
Aura * dummy = GetAura(54842);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(54842);
trigger_spell_id = 54843;
target = pVictim;
break;
}
default:
// Illumination
if (auraSpellInfo->SpellIconID==241)
{ {
case 25914: originalSpellId = 20473; break; if(!procSpell)
case 25913: originalSpellId = 20929; break; return false;
case 25903: originalSpellId = 20930; break; // procspell is triggered spell but we need mana cost of original casted spell
case 27175: originalSpellId = 27174; break; uint32 originalSpellId = procSpell->Id;
case 33074: originalSpellId = 33072; break; // Holy Shock heal
case 48820: originalSpellId = 48824; break; if(procSpell->SpellFamilyFlags[1] & 0x00010000)
case 48821: originalSpellId = 48825; break; {
default: switch(procSpell->Id)
sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id); {
return false; case 25914: originalSpellId = 20473; break;
case 25913: originalSpellId = 20929; break;
case 25903: originalSpellId = 20930; break;
case 27175: originalSpellId = 27174; break;
case 33074: originalSpellId = 33072; break;
case 48820: originalSpellId = 48824; break;
case 48821: originalSpellId = 48825; break;
default:
sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in HShock",procSpell->Id);
return false;
}
}
SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId);
if(!originalSpell)
{
sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId);
return false;
}
// percent stored in effect 1 (class scripts) base points
int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost*auraSpellInfo->CalculateSimpleValue(1)/100;
trigger_spell_id = 20272;
target = this;
} }
} break;
SpellEntry const *originalSpell = sSpellStore.LookupEntry(originalSpellId);
if(!originalSpell)
{
sLog.outError("Unit::HandleProcTriggerSpell: Spell %u unknown but selected as original in Illu",originalSpellId);
return false;
}
// percent stored in effect 1 (class scripts) base points
int32 cost = originalSpell->manaCost + originalSpell->ManaCostPercentage * GetCreateMana() / 100;
basepoints0 = cost*auraSpellInfo->CalculateSimpleValue(1)/100;
trigger_spell_id = 20272;
target = this;
}
// Lightning Capacitor
else if (auraSpellInfo->Id==37657)
{
if(!pVictim || !pVictim->isAlive())
return false;
// stacking
CastSpell(this, 37658, true, NULL, triggeredByAura);
Aura * dummy = GetAura(37658);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(37658);
trigger_spell_id = 37661;
target = pVictim;
}
// Thunder Capacitor
else if (auraSpellInfo->Id == 54841)
{
if(!pVictim || !pVictim->isAlive())
return false;
// stacking
CastSpell(this, 54842, true, NULL, triggeredByAura);
// counting
Aura * dummy = GetAura(54842);
// release at 3 aura in stack (cont contain in basepoint of trigger aura)
if(!dummy || dummy->GetStackAmount() < triggerAmount)
return false;
RemoveAurasDueToSpell(54842);
trigger_spell_id = 54843;
target = pVictim;
} }
break; break;
} }
case SPELLFAMILY_SHAMAN: case SPELLFAMILY_SHAMAN:
{ {
// Lightning Shield (overwrite non existing triggered spell call in spell.dbc switch (auraSpellInfo->Id)
if(auraSpellInfo->SpellFamilyFlags[0] & 0x400)
{ {
switch(auraSpellInfo->Id) // Lightning Shield (The Ten Storms set)
case 23551:
{ {
case 324: // Rank 1 trigger_spell_id = 23552;
trigger_spell_id = 26364; break; target = pVictim;
case 325: // Rank 2 break;
trigger_spell_id = 26365; break;
case 905: // Rank 3
trigger_spell_id = 26366; break;
case 945: // Rank 4
trigger_spell_id = 26367; break;
case 8134: // Rank 5
trigger_spell_id = 26369; break;
case 10431: // Rank 6
trigger_spell_id = 26370; break;
case 10432: // Rank 7
trigger_spell_id = 26363; break;
case 25469: // Rank 8
trigger_spell_id = 26371; break;
case 25472: // Rank 9
trigger_spell_id = 26372; break;
case 49280: // Rank 10
trigger_spell_id = 49278; break;
case 49281: // Rank 11
trigger_spell_id = 49279; break;
default:
sLog.outError("Unit::HandleProcTriggerSpell: Spell %u not handled in LShield", auraSpellInfo->Id);
return false;
} }
} // Damage from Lightning Shield (The Ten Storms set)
// Lightning Shield (The Ten Storms set) case 23552:
else if (auraSpellInfo->Id == 23551) {
{ trigger_spell_id = 27635;
trigger_spell_id = 23552; break;
target = pVictim; }
} // Mana Surge (The Earthfury set)
// Damage from Lightning Shield (The Ten Storms set) case 23572:
else if (auraSpellInfo->Id == 23552) {
trigger_spell_id = 27635; if(!procSpell)
// Mana Surge (The Earthfury set) return false;
else if (auraSpellInfo->Id == 23572) basepoints0 = procSpell->manaCost * 35 / 100;
{ trigger_spell_id = 23571;
if(!procSpell) target = this;
return false; break;
basepoints0 = procSpell->manaCost * 35 / 100; }
trigger_spell_id = 23571; default:
target = this; {
} // Lightning Shield (overwrite non existing triggered spell call in spell.dbc
// Nature's Guardian if(auraSpellInfo->SpellFamilyFlags[0] & 0x400)
else if (auraSpellInfo->SpellIconID == 2013) {
{ trigger_spell_id = spellmgr.GetSpellWithRank(26364, spellmgr.GetSpellRank(auraSpellInfo->Id));
// Check health condition - should drop to less 30% (damage deal after this!) }
if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth())) // Nature's Guardian
return false; else if (auraSpellInfo->SpellIconID == 2013)
{
// Check health condition - should drop to less 30% (damage deal after this!)
if (!(10*(int32(GetHealth() - damage)) < 3 * GetMaxHealth()))
return false;
if(pVictim && pVictim->isAlive()) if(pVictim && pVictim->isAlive())
pVictim->getThreatManager().modifyThreatPercent(this,-10); pVictim->getThreatManager().modifyThreatPercent(this,-10);
basepoints0 = triggerAmount * GetMaxHealth() / 100; basepoints0 = triggerAmount * GetMaxHealth() / 100;
trigger_spell_id = 31616; trigger_spell_id = 31616;
target = this; target = this;
}
}
} }
break; break;
} }
@@ -7399,7 +7408,7 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
// Cheat Death // Cheat Death
case 28845: case 28845:
{ {
// When your health drops below 20% .... // When your health drops below 20%
if (GetHealth() - damage > GetMaxHealth() / 5 || GetHealth() < GetMaxHealth() / 5) if (GetHealth() - damage > GetMaxHealth() / 5 || GetHealth() < GetMaxHealth() / 5)
return false; return false;
break; break;
@@ -7572,30 +7581,6 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
return false; return false;
break; break;
} }
// Brain Freeze
case 57761:
{
if(!procSpell)
return false;
// For trigger from Blizzard need exist Improved Blizzard
if (procSpell->SpellFamilyName==SPELLFAMILY_MAGE && procSpell->SpellFamilyFlags[0] & 0x80)
{
bool found = false;
AuraEffectList const& mOverrideClassScript = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
for(AuraEffectList::const_iterator i = mOverrideClassScript.begin(); i != mOverrideClassScript.end(); ++i)
{
int32 script = (*i)->GetMiscValue();
if(script==836 || script==988 || script==989)
{
found=true;
break;
}
}
if(!found)
return false;
}
break;
}
// Astral Shift // Astral Shift
case 52179: case 52179:
{ {
@@ -7706,16 +7691,6 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE
triggered_spell_id = 12486; triggered_spell_id = 12486;
break; break;
} }
case 4086: // Improved Mend Pet (Rank 1)
case 4087: // Improved Mend Pet (Rank 2)
{
int32 chance = triggeredByAura->GetSpellProto()->EffectBasePoints[triggeredByAura->GetEffIndex()];
if(!roll_chance_i(chance))
return false;
triggered_spell_id = 24406;
break;
}
case 4533: // Dreamwalker Raiment 2 pieces bonus case 4533: // Dreamwalker Raiment 2 pieces bonus
{ {
// Chance 50% // Chance 50%
@@ -7735,19 +7710,9 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit *pVictim, uint32 damage, AuraE
case 4537: // Dreamwalker Raiment 6 pieces bonus case 4537: // Dreamwalker Raiment 6 pieces bonus
triggered_spell_id = 28750; // Blessing of the Claw triggered_spell_id = 28750; // Blessing of the Claw
break; break;
case 5497: // Improved Mana Gems (Serpent-Coil Braid) case 5497: // Improved Mana Gems
triggered_spell_id = 37445; // Mana Surge triggered_spell_id = 37445; // Mana Surge
break; break;
case 8152: // Serendipity
{
// if heal your target over maximum health
if (pVictim->GetHealth() + damage < pVictim->GetMaxHealth())
return false;
int32 cost = procSpell->manaCost + procSpell->ManaCostPercentage * GetCreateMana() / 100;
int32 basepoints0 = cost * triggeredByAura->GetAmount()/100;
CastCustomSpell(this, 47762, &basepoints0, 0, 0, true, 0, triggeredByAura);
return true;
}
case 7010: // Revitalize - can proc on full hp target case 7010: // Revitalize - can proc on full hp target
case 7011: case 7011:
case 7012: case 7012:
@@ -12852,77 +12817,6 @@ void Unit::SendMovementFlagUpdate()
SendMessageToSet(&data, false); SendMessageToSet(&data, false);
} }
/*
void Unit::SetFeared(bool apply, uint64 casterGUID, uint32 spellID, uint32 time)
{
if( apply )
{
if(HasAuraType(SPELL_AURA_PREVENTS_FLEEING))
return;
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
GetMotionMaster()->MovementExpired(false);
CastStop(GetGUID()==casterGUID ? spellID : 0);
Unit* caster = ObjectAccessor::GetUnit(*this,casterGUID);
GetMotionMaster()->MoveFleeing(caster, time); // caster==NULL processed in MoveFleeing
}
else
{
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_FLEEING);
GetMotionMaster()->MovementExpired(false);
if( GetTypeId() != TYPEID_PLAYER && isAlive() )
{
// restore appropriate movement generator
if(getVictim())
GetMotionMaster()->MoveChase(getVictim());
else
GetMotionMaster()->Initialize();
// attack caster if can
Unit* caster = ObjectAccessor::GetObjectInWorld(casterGUID, (Unit*)NULL);
if(caster && ((Creature*)this)->AI())
((Creature*)this)->AI()->AttackedBy(caster);
}
}
if (GetTypeId() == TYPEID_PLAYER)
((Player*)this)->SetClientControl(this, !apply);
}
void Unit::SetConfused(bool apply, uint64 casterGUID, uint32 spellID)
{
if( apply )
{
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
CastStop(GetGUID()==casterGUID ? spellID : 0);
GetMotionMaster()->MoveConfused();
}
else
{
RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_CONFUSED);
GetMotionMaster()->MovementExpired(false);
if (GetTypeId() == TYPEID_UNIT)
{
// if in combat restore movement generator
if(getVictim())
GetMotionMaster()->MoveChase(getVictim());
}
}
if(GetTypeId() == TYPEID_PLAYER)
((Player*)this)->SetClientControl(this, !apply);
}
*/
bool Unit::IsSitState() const bool Unit::IsSitState() const
{ {
uint8 s = getStandState(); uint8 s = getStandState();
@@ -13847,7 +13741,7 @@ void Unit::SetRooted(bool apply)
{ {
if(apply) if(apply)
{ {
AddUnitMovementFlag(MOVEMENTFLAG_ROOT); AddUnitMovementFlag(MOVEMENTFLAG_ROOT);
WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10); WorldPacket data(SMSG_FORCE_MOVE_ROOT, 10);
data.append(GetPackGUID()); data.append(GetPackGUID());