mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9914] Add script effect of spell 51864, 51889 and 51910
In addition, dummy effect of spell 51866 and 51872 and dummy aura effect of spell 51870. Dummy effect of 51866 might need additional work (see comments). Code expect additional spell cast by AI (summon dummy at death of related quest target creatures). Signed-off-by: NoFantasy <nofantasy@nf.no>
This commit is contained in:
parent
fab9a3ae96
commit
628f11e1a7
3 changed files with 111 additions and 1 deletions
|
|
@ -2488,6 +2488,16 @@ void Aura::HandleAuraDummy(bool apply, bool Real)
|
|||
m_target->CastSpell(m_target, 47287, true, NULL, this);
|
||||
return;
|
||||
}
|
||||
case 51870: // Collect Hair Sample
|
||||
{
|
||||
if (Unit* pCaster = GetCaster())
|
||||
{
|
||||
if (m_removeMode == AURA_REMOVE_BY_DEFAULT)
|
||||
pCaster->CastSpell(m_target, 51872, true, NULL, this);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
case 58600: // Restricted Flight Area
|
||||
{
|
||||
// Remove Flight Auras
|
||||
|
|
|
|||
|
|
@ -1507,6 +1507,64 @@ void Spell::EffectDummy(SpellEffectIndex eff_idx)
|
|||
((Creature*)unitTarget)->ForcedDespawn();
|
||||
return;
|
||||
}
|
||||
case 51866: // Kick Nass
|
||||
{
|
||||
// It is possible that Nass Heartbeat (spell id 61438) is involved in this
|
||||
// If so, unclear how it should work and using the below instead (even though it could be a bit hack-ish)
|
||||
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
// Only own guardian pet
|
||||
if (m_caster != unitTarget->GetOwner())
|
||||
return;
|
||||
|
||||
// This means we already set state (see below) and need to wait.
|
||||
if (unitTarget->hasUnitState(UNIT_STAT_ROOT))
|
||||
return;
|
||||
|
||||
// Expecting pTargetDummy to be summoned by AI at death of target creatures.
|
||||
|
||||
Creature* pTargetDummy = NULL;
|
||||
float fRange = GetSpellMaxRange(sSpellRangeStore.LookupEntry(m_spellInfo->rangeIndex));
|
||||
|
||||
MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck u_check(*m_caster, 28523, true, fRange*2);
|
||||
MaNGOS::CreatureLastSearcher<MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck> searcher(m_caster, pTargetDummy, u_check);
|
||||
|
||||
Cell::VisitGridObjects(m_caster, searcher, fRange*2);
|
||||
|
||||
if (pTargetDummy)
|
||||
{
|
||||
if (unitTarget->hasUnitState(UNIT_STAT_FOLLOW | UNIT_STAT_FOLLOW_MOVE))
|
||||
unitTarget->GetMotionMaster()->MovementExpired();
|
||||
|
||||
unitTarget->MonsterMove(pTargetDummy->GetPositionX(), pTargetDummy->GetPositionY(), pTargetDummy->GetPositionZ(), IN_MILLISECONDS);
|
||||
|
||||
// Add state to temporarily prevent follow
|
||||
unitTarget->addUnitState(UNIT_STAT_ROOT);
|
||||
|
||||
// Collect Hair Sample
|
||||
unitTarget->CastSpell(pTargetDummy, 51870, true);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
case 51872: // Hair Sample Collected
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
return;
|
||||
|
||||
// clear state to allow follow again
|
||||
m_caster->clearUnitState(UNIT_STAT_ROOT);
|
||||
|
||||
// Nass Kill Credit
|
||||
m_caster->CastSpell(m_caster, 51871, true);
|
||||
|
||||
// Despawn dummy creature
|
||||
((Creature*)unitTarget)->ForcedDespawn();
|
||||
|
||||
return;
|
||||
}
|
||||
case 51964: // Tormentor's Incense
|
||||
{
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_UNIT)
|
||||
|
|
@ -5708,6 +5766,48 @@ void Spell::EffectScriptEffect(SpellEffectIndex eff_idx)
|
|||
caster->CastSpell(caster, damage, false);
|
||||
break;
|
||||
}
|
||||
case 51864: // Player Summon Nass
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
// Summon Nass
|
||||
if (const SpellEntry* pSpell = sSpellStore.LookupEntry(51865))
|
||||
{
|
||||
// Only if he is not already there
|
||||
if (!m_caster->FindGuardianWithEntry(pSpell->EffectMiscValue[EFFECT_INDEX_0]))
|
||||
{
|
||||
m_caster->CastSpell(m_caster, pSpell, true);
|
||||
|
||||
if (Pet* pPet = m_caster->FindGuardianWithEntry(pSpell->EffectMiscValue[EFFECT_INDEX_0]))
|
||||
{
|
||||
// Nass Periodic Say aura
|
||||
pPet->CastSpell(pPet, 51868, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 51889: // Quest Accept Summon Nass
|
||||
{
|
||||
// This is clearly for quest accept, is spell 51864 then for gossip and does pretty much the same thing?
|
||||
// Just "jumping" to what may be the "gossip-spell" for now, doing the same thing
|
||||
m_caster->CastSpell(m_caster, 51864, true);
|
||||
return;
|
||||
}
|
||||
case 51910: // Kickin' Nass: Quest Completion
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (const SpellEntry* pSpell = sSpellStore.LookupEntry(51865))
|
||||
{
|
||||
// Is this all to be done at completion?
|
||||
if (Pet* pPet = m_caster->FindGuardianWithEntry(pSpell->EffectMiscValue[EFFECT_INDEX_0]))
|
||||
((Player*)m_caster)->RemovePet(pPet, PET_SAVE_NOT_IN_SLOT);
|
||||
}
|
||||
return;
|
||||
}
|
||||
case 52751: // Death Gate
|
||||
{
|
||||
if (!unitTarget || unitTarget->getClass() != CLASS_DEATH_KNIGHT)
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "9913"
|
||||
#define REVISION_NR "9914"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue