*Fix a crash caused by feedpet.
*Also have delay for jump spells. --HG-- branch : trunk
This commit is contained in:
@@ -333,7 +333,6 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
|
|||||||
{
|
{
|
||||||
uint32 moveFlag = MOVEFLAG_JUMP | MOVEFLAG_WALK;
|
uint32 moveFlag = MOVEFLAG_JUMP | MOVEFLAG_WALK;
|
||||||
uint32 time = speedZ * 100;
|
uint32 time = speedZ * 100;
|
||||||
i_owner->SendMonsterMove(x, y, z, moveFlag, time, speedZ);
|
|
||||||
|
|
||||||
i_owner->addUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
|
i_owner->addUnitState(UNIT_STAT_CHARGING | UNIT_STAT_JUMPING);
|
||||||
i_owner->m_TempSpeed = speedXY;
|
i_owner->m_TempSpeed = speedXY;
|
||||||
@@ -348,6 +347,8 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee
|
|||||||
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z );
|
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z );
|
||||||
Mutate(new PointMovementGenerator<Creature>(0,x,y,z), MOTION_SLOT_CONTROLLED);
|
Mutate(new PointMovementGenerator<Creature>(0,x,y,z), MOTION_SLOT_CONTROLLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i_owner->SendMonsterMove(x, y, z, moveFlag, time, speedZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
template<class T>
|
template<class T>
|
||||||
void PointMovementGenerator<T>::Initialize(T &unit)
|
void PointMovementGenerator<T>::Initialize(T &unit)
|
||||||
{
|
{
|
||||||
//unit.StopMoving();
|
unit.StopMoving();
|
||||||
unit.clearUnitState(UNIT_STAT_MOVING);
|
unit.clearUnitState(UNIT_STAT_MOVING);
|
||||||
Traveller<T> traveller(unit);
|
Traveller<T> traveller(unit);
|
||||||
i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, !unit.hasUnitState(UNIT_STAT_JUMPING));
|
i_destinationHolder.SetDestination(traveller,i_x,i_y,i_z, !unit.hasUnitState(UNIT_STAT_JUMPING));
|
||||||
|
|||||||
+22
-16
@@ -365,6 +365,7 @@ Spell::Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 origi
|
|||||||
m_delayAtDamageCount = 0;
|
m_delayAtDamageCount = 0;
|
||||||
|
|
||||||
m_applyMultiplierMask = 0;
|
m_applyMultiplierMask = 0;
|
||||||
|
m_effectMask = 0;
|
||||||
|
|
||||||
// Get data for type of attack
|
// Get data for type of attack
|
||||||
switch (m_spellInfo->DmgClass)
|
switch (m_spellInfo->DmgClass)
|
||||||
@@ -2450,7 +2451,21 @@ void Spell::cast(bool skipCheck)
|
|||||||
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
|
SendSpellGo(); // we must send smsg_spell_go packet before m_castItem delete in TakeCastItem()...
|
||||||
|
|
||||||
if(m_customAttr & SPELL_ATTR_CU_CHARGE)
|
if(m_customAttr & SPELL_ATTR_CU_CHARGE)
|
||||||
EffectCharge(0);
|
{
|
||||||
|
for(uint32 i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
switch(m_spellInfo->Effect[i])
|
||||||
|
{
|
||||||
|
case SPELL_EFFECT_CHARGE:
|
||||||
|
case SPELL_EFFECT_JUMP:
|
||||||
|
case SPELL_EFFECT_JUMP2:
|
||||||
|
case SPELL_EFFECT_138:
|
||||||
|
HandleEffects(NULL,NULL,NULL,i);
|
||||||
|
m_effectMask |= (1<<i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
|
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
|
||||||
if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo))
|
if (m_spellInfo->speed > 0.0f && !IsChanneledSpell(m_spellInfo))
|
||||||
@@ -3660,8 +3675,12 @@ void Spell::HandleThreatSpells(uint32 spellId)
|
|||||||
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threatSpell->threat);
|
DEBUG_LOG("Spell %u, rank %u, added an additional %i threat", spellId, spellmgr.GetSpellRank(spellId), threatSpell->threat);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float /*DamageMultiplier*/)
|
void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i)
|
||||||
{
|
{
|
||||||
|
//effect has been handled, skip it
|
||||||
|
if(m_effectMask & (1<<i))
|
||||||
|
return;
|
||||||
|
|
||||||
unitTarget = pUnitTarget;
|
unitTarget = pUnitTarget;
|
||||||
itemTarget = pItemTarget;
|
itemTarget = pItemTarget;
|
||||||
gameObjTarget = pGOTarget;
|
gameObjTarget = pGOTarget;
|
||||||
@@ -3676,21 +3695,8 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar
|
|||||||
if(eff<TOTAL_SPELL_EFFECTS)
|
if(eff<TOTAL_SPELL_EFFECTS)
|
||||||
{
|
{
|
||||||
//sLog.outDebug( "WORLD: Spell FX %d < TOTAL_SPELL_EFFECTS ", eff);
|
//sLog.outDebug( "WORLD: Spell FX %d < TOTAL_SPELL_EFFECTS ", eff);
|
||||||
(*this.*SpellEffects[eff])(i);
|
(this->*SpellEffects[eff])(i);
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sLog.outDebug( "WORLD: Spell FX %d > TOTAL_SPELL_EFFECTS ", eff);
|
|
||||||
if (m_CastItem)
|
|
||||||
EffectEnchantItemTmp(i);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sLog.outError("SPELL: unknown effect %u spell id %u",
|
|
||||||
eff, m_spellInfo->Id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Spell::TriggerSpell()
|
void Spell::TriggerSpell()
|
||||||
|
|||||||
+2
-1
@@ -428,7 +428,7 @@ class Spell
|
|||||||
void SendResurrectRequest(Player* target);
|
void SendResurrectRequest(Player* target);
|
||||||
void SendPlaySpellVisual(uint32 SpellID);
|
void SendPlaySpellVisual(uint32 SpellID);
|
||||||
|
|
||||||
void HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i, float DamageMultiplier = 1.0);
|
void HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTarget,uint32 i);
|
||||||
void HandleThreatSpells(uint32 spellId);
|
void HandleThreatSpells(uint32 spellId);
|
||||||
//void HandleAddAura(Unit* Target);
|
//void HandleAddAura(Unit* Target);
|
||||||
|
|
||||||
@@ -639,6 +639,7 @@ class Spell
|
|||||||
|
|
||||||
uint32 m_customAttr;
|
uint32 m_customAttr;
|
||||||
bool m_skipCheck;
|
bool m_skipCheck;
|
||||||
|
uint32 m_effectMask;
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace Trinity
|
namespace Trinity
|
||||||
|
|||||||
@@ -2168,7 +2168,7 @@ void Spell::EffectJump(uint32 i)
|
|||||||
Unit* pTarget = NULL;
|
Unit* pTarget = NULL;
|
||||||
if(m_targets.getUnitTarget() && m_targets.getUnitTarget()!=m_caster)
|
if(m_targets.getUnitTarget() && m_targets.getUnitTarget()!=m_caster)
|
||||||
pTarget = m_targets.getUnitTarget();
|
pTarget = m_targets.getUnitTarget();
|
||||||
else if(unitTarget->getVictim())
|
else if(m_caster->getVictim())
|
||||||
pTarget = m_caster->getVictim();
|
pTarget = m_caster->getVictim();
|
||||||
else if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
else if(m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||||
pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());
|
pTarget = ObjectAccessor::GetUnit(*m_caster, ((Player*)m_caster)->GetSelection());
|
||||||
@@ -2178,14 +2178,14 @@ void Spell::EffectJump(uint32 i)
|
|||||||
else
|
else
|
||||||
o = m_caster->GetOrientation();
|
o = m_caster->GetOrientation();
|
||||||
}
|
}
|
||||||
else if(unitTarget)
|
else if(m_targets.getUnitTarget())
|
||||||
{
|
{
|
||||||
unitTarget->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE);
|
m_targets.getUnitTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE);
|
||||||
o = m_caster->GetOrientation();
|
o = m_caster->GetOrientation();
|
||||||
}
|
}
|
||||||
else if(gameObjTarget)
|
else if(m_targets.getGOTarget())
|
||||||
{
|
{
|
||||||
gameObjTarget->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE);
|
m_targets.getGOTarget()->GetContactPoint(m_caster,x,y,z,CONTACT_DISTANCE);
|
||||||
o = m_caster->GetOrientation();
|
o = m_caster->GetOrientation();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -5851,20 +5851,17 @@ void Spell::EffectKnockBack(uint32 i)
|
|||||||
|
|
||||||
void Spell::EffectJump2(uint32 i)
|
void Spell::EffectJump2(uint32 i)
|
||||||
{
|
{
|
||||||
if(!unitTarget)
|
|
||||||
return;
|
|
||||||
|
|
||||||
float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
|
float speedxy = float(m_spellInfo->EffectMiscValue[i])/10;
|
||||||
float speedz = float(damage/10);
|
float speedz = float(damage/10);
|
||||||
if(!speedxy)
|
if(!speedxy)
|
||||||
{
|
{
|
||||||
if(m_targets.getUnitTarget())
|
if(m_targets.getUnitTarget())
|
||||||
unitTarget->JumpTo(m_targets.getUnitTarget(), speedz);
|
m_caster->JumpTo(m_targets.getUnitTarget(), speedz);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//1891: Disengage
|
//1891: Disengage
|
||||||
unitTarget->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891);
|
m_caster->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+11
-2
@@ -64,7 +64,9 @@ SpellMgr::SpellMgr()
|
|||||||
case SPELL_EFFECT_ENCHANT_ITEM:
|
case SPELL_EFFECT_ENCHANT_ITEM:
|
||||||
case SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY:
|
case SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY:
|
||||||
case SPELL_EFFECT_DISENCHANT:
|
case SPELL_EFFECT_DISENCHANT:
|
||||||
case SPELL_EFFECT_FEED_PET:
|
//in 243 this is 0, in 309 it is 1
|
||||||
|
//so both item target and unit target is pushed, and cause crash
|
||||||
|
//case SPELL_EFFECT_FEED_PET:
|
||||||
case SPELL_EFFECT_PROSPECTING:
|
case SPELL_EFFECT_PROSPECTING:
|
||||||
case SPELL_EFFECT_MILLING:
|
case SPELL_EFFECT_MILLING:
|
||||||
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
|
case SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC:
|
||||||
@@ -76,7 +78,10 @@ SpellMgr::SpellMgr()
|
|||||||
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY:
|
||||||
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
|
case SPELL_EFFECT_APPLY_AREA_AURA_PET:
|
||||||
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
|
case SPELL_EFFECT_APPLY_AREA_AURA_OWNER:
|
||||||
case SPELL_EFFECT_JUMP2: //42
|
case SPELL_EFFECT_CHARGE:
|
||||||
|
case SPELL_EFFECT_JUMP:
|
||||||
|
case SPELL_EFFECT_JUMP2:
|
||||||
|
case SPELL_EFFECT_138:
|
||||||
EffectTargetType[i] = SPELL_REQUIRE_CASTER;
|
EffectTargetType[i] = SPELL_REQUIRE_CASTER;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -2360,9 +2365,13 @@ void SpellMgr::LoadSpellCustomAttr()
|
|||||||
mSpellCustomAttr[i] |= SPELL_ATTR_CU_DIRECT_DAMAGE;
|
mSpellCustomAttr[i] |= SPELL_ATTR_CU_DIRECT_DAMAGE;
|
||||||
break;
|
break;
|
||||||
case SPELL_EFFECT_CHARGE:
|
case SPELL_EFFECT_CHARGE:
|
||||||
|
case SPELL_EFFECT_JUMP:
|
||||||
|
case SPELL_EFFECT_JUMP2:
|
||||||
|
case SPELL_EFFECT_138:
|
||||||
if(!spellInfo->speed && !spellInfo->SpellFamilyName)
|
if(!spellInfo->speed && !spellInfo->SpellFamilyName)
|
||||||
spellInfo->speed = SPEED_CHARGE;
|
spellInfo->speed = SPEED_CHARGE;
|
||||||
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CHARGE;
|
mSpellCustomAttr[i] |= SPELL_ATTR_CU_CHARGE;
|
||||||
|
break;
|
||||||
case SPELL_EFFECT_TRIGGER_SPELL:
|
case SPELL_EFFECT_TRIGGER_SPELL:
|
||||||
if (SpellTargetType[spellInfo->EffectImplicitTargetA[j]]== TARGET_TYPE_DEST_CASTER ||
|
if (SpellTargetType[spellInfo->EffectImplicitTargetA[j]]== TARGET_TYPE_DEST_CASTER ||
|
||||||
SpellTargetType[spellInfo->EffectImplicitTargetA[j]]== TARGET_TYPE_DEST_TARGET ||
|
SpellTargetType[spellInfo->EffectImplicitTargetA[j]]== TARGET_TYPE_DEST_TARGET ||
|
||||||
|
|||||||
Reference in New Issue
Block a user