*Cleanup, better cast for Bear/Dire Bear part of Furor.

--HG--
branch : trunk
This commit is contained in:
maximius
2009-11-21 02:19:19 -08:00
parent 4f8f69a805
commit 056c6fa680
3 changed files with 19 additions and 24 deletions
+1 -4
View File
@@ -3562,10 +3562,7 @@ void AuraEffect::HandleAuraModShapeshift(bool apply, bool Real, bool changeAmoun
case FORM_BEAR: case FORM_BEAR:
case FORM_DIREBEAR: case FORM_DIREBEAR:
if (urand(0,99) < FurorChance) if (urand(0,99) < FurorChance)
{ m_target->CastSpell(m_target, 17057, true);
int32 basePoints = 100; // Not sure if 100 is correct basePoints, maybe it should be 10?
m_target->CastCustomSpell(m_target, 17057, &basePoints, NULL, NULL, true, NULL, this);
}
default: default:
{ {
uint32 newEnergy = std::min(m_target->GetPower(POWER_ENERGY), FurorChance); uint32 newEnergy = std::min(m_target->GetPower(POWER_ENERGY), FurorChance);
+15 -15
View File
@@ -1606,8 +1606,8 @@ void Spell::EffectDummy(uint32 i)
if (!unitTarget || !unitTarget->isAlive()) if (!unitTarget || !unitTarget->isAlive())
return; return;
int hurt = 0; uint32 hurt = 0;
int heal = 0; uint32 heal = 0;
switch(m_spellInfo->Id) switch(m_spellInfo->Id)
{ {
case 47540: hurt = 47758; heal = 47757; break; case 47540: hurt = 47758; heal = 47757; break;
@@ -1630,15 +1630,15 @@ void Spell::EffectDummy(uint32 i)
if (m_spellInfo->SpellFamilyFlags[2] & 0x100) if (m_spellInfo->SpellFamilyFlags[2] & 0x100)
{ {
//Shapeshifting into an animal form or mounting cancels the effect. //Shapeshifting into an animal form or mounting cancels the effect.
if(m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted()) if (m_caster->GetCreatureType() == CREATURE_TYPE_BEAST || m_caster->IsMounted())
{ {
if(m_triggeredByAuraSpell) if (m_triggeredByAuraSpell)
m_caster->RemoveAurasDueToSpell(m_triggeredByAuraSpell->Id); m_caster->RemoveAurasDueToSpell(m_triggeredByAuraSpell->Id);
return; return;
} }
//Any effect which causes you to lose control of your character will supress the starfall effect. //Any effect which causes you to lose control of your character will supress the starfall effect.
if(m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED)) if (m_caster->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_FLEEING | UNIT_STAT_ROOT | UNIT_STAT_CONFUSED))
return; return;
m_caster->CastSpell(unitTarget, damage, true); m_caster->CastSpell(unitTarget, damage, true);
@@ -1652,35 +1652,35 @@ void Spell::EffectDummy(uint32 i)
m_caster->CastSpell(m_caster, 63848, true); m_caster->CastSpell(m_caster, 63848, true);
break; break;
} }
switch(m_spellInfo->Id ) switch(m_spellInfo->Id)
{ {
case 5938: // Shiv case 5938: // Shiv
{ {
if(m_caster->GetTypeId() != TYPEID_PLAYER) if (m_caster->GetTypeId() != TYPEID_PLAYER)
return; return;
Player *pCaster = ((Player*)m_caster); Player *pCaster = ((Player*)m_caster);
Item *item = pCaster->GetWeaponForAttack(OFF_ATTACK); Item *item = pCaster->GetWeaponForAttack(OFF_ATTACK);
if(!item) if (!item)
return; return;
// all poison enchantments is temporary // all poison enchantments is temporary
uint32 enchant_id = item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT); uint32 enchant_id = item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT);
if(!enchant_id) if (!enchant_id)
return; return;
SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id); SpellItemEnchantmentEntry const *pEnchant = sSpellItemEnchantmentStore.LookupEntry(enchant_id);
if(!pEnchant) if (!pEnchant)
return; return;
for (int s=0; s<3; s++) for (uint8 s = 0; s < 3; ++s)
{ {
if(pEnchant->type[s]!=ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL) if(pEnchant->type[s] != ITEM_ENCHANTMENT_TYPE_COMBAT_SPELL)
continue; continue;
SpellEntry const* combatEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]); SpellEntry const *combatEntry = sSpellStore.LookupEntry(pEnchant->spellid[s]);
if(!combatEntry || combatEntry->Dispel != DISPEL_POISON) if (!combatEntry || combatEntry->Dispel != DISPEL_POISON)
continue; continue;
m_caster->CastSpell(unitTarget, combatEntry, true, item); m_caster->CastSpell(unitTarget, combatEntry, true, item);
@@ -1691,7 +1691,7 @@ void Spell::EffectDummy(uint32 i)
} }
case 14185: // Preparation case 14185: // Preparation
{ {
if(m_caster->GetTypeId() != TYPEID_PLAYER) if (m_caster->GetTypeId() != TYPEID_PLAYER)
return; return;
//immediately finishes the cooldown on certain Rogue abilities //immediately finishes the cooldown on certain Rogue abilities
+3 -5
View File
@@ -929,7 +929,7 @@ void Unit::CastStop(uint32 except_spellid)
void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster) void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{ {
SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId);
if (!spellInfo) if (!spellInfo)
{ {
@@ -937,10 +937,10 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte
return; return;
} }
CastSpell(Victim,spellInfo,triggered,castItem,triggeredByAura, originalCaster); CastSpell(Victim, spellInfo, triggered, castItem, triggeredByAura, originalCaster);
} }
void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster) void Unit::CastSpell(Unit* Victim, SpellEntry const *spellInfo, bool triggered, Item *castItem, AuraEffect* triggeredByAura, uint64 originalCaster)
{ {
if (!spellInfo) if (!spellInfo)
{ {
@@ -14790,9 +14790,7 @@ void Unit::KnockbackFrom(float x, float y, float speedXY, float speedZ)
} }
if (!player) if (!player)
{
GetMotionMaster()->MoveKnockbackFrom(x, y, speedXY, speedZ); GetMotionMaster()->MoveKnockbackFrom(x, y, speedXY, speedZ);
}
else else
{ {
float vcos, vsin; float vcos, vsin;