*Fix Gargoyle feeding behaviour - original patch by thenecromancer.
*Add SPELL_TARGET_TYPE_CONTROLLED for spell_script_target table for fast search of units(grid search skipped) and to prevent applying effects to not owned summons --HG-- branch : trunk
This commit is contained in:
@@ -143,9 +143,13 @@ INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comm
|
||||
-- --------
|
||||
-- TARGET
|
||||
-- --------
|
||||
-- Mirror Image
|
||||
DELETE FROM `spell_script_target` WHERE `entry` IN (58836);
|
||||
INSERT INTO `spell_script_target` VALUES (58836, 1, 31216);
|
||||
|
||||
DELETE FROM `spell_script_target` WHERE `entry` IN (58836, 50524, 50515);
|
||||
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
(58836, 3, 31216), -- Mirror Image
|
||||
(50524, 3, 27829), -- Runic Power Feed
|
||||
(50515, 3, 27829); -- Dismiss Gargoyle
|
||||
|
||||
-- zulaman
|
||||
DELETE FROM `spell_script_target` WHERE `entry` IN
|
||||
(42577,42471,43734,42631);
|
||||
@@ -1953,8 +1957,7 @@ INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
(52479, 1, 28822),
|
||||
(52576, 1, 28834), -- Electro-magnetic Pulse
|
||||
(52576, 1, 28886),
|
||||
(53110, 1, 28940), -- Devour Humanoid
|
||||
(48743, 1, 26125); -- Death pact
|
||||
(53110, 1, 28940); -- Devour Humanoid
|
||||
|
||||
-- Eye of Acherus
|
||||
DELETE FROM `spell_target_position` WHERE `id`=51852;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
DELETE FROM `spell_script_target` WHERE `entry` IN (58836, 48743, 50524, 50515);
|
||||
INSERT INTO `spell_script_target` (`entry`, `type`, `targetEntry`) VALUES
|
||||
(58836, 3, 31216),
|
||||
(50524, 3, 27829),
|
||||
(50515, 3, 27829);
|
||||
+15
-2
@@ -1730,6 +1730,15 @@ WorldObject* Spell::SearchNearbyTarget(float range, SpellTargets TargetType)
|
||||
{
|
||||
switch(i_spellST->second.type)
|
||||
{
|
||||
case SPELL_TARGET_TYPE_CONTROLLED:
|
||||
for(Unit::ControlList::iterator itr = m_caster->m_Controlled.begin(); itr != m_caster->m_Controlled.end(); ++itr)
|
||||
if ((*itr)->GetEntry() == i_spellST->second.targetEntry && (*itr)->IsWithinDistInMap(m_caster, range))
|
||||
{
|
||||
goScriptTarget = NULL;
|
||||
range = m_caster->GetDistance(creatureScriptTarget);
|
||||
creatureScriptTarget = ((Creature *)*itr);
|
||||
}
|
||||
break;
|
||||
case SPELL_TARGET_TYPE_GAMEOBJECT:
|
||||
if(i_spellST->second.targetEntry)
|
||||
{
|
||||
@@ -2261,8 +2270,6 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
|
||||
{
|
||||
case 46584: // Raise Dead
|
||||
{
|
||||
// TODO: change visual of corpses which gave ghoul?
|
||||
// Allow corpses to be ghouled only once?
|
||||
m_targets.m_targetMask &= ~TARGET_FLAG_DEST_LOCATION;
|
||||
WorldObject* result = FindCorpseUsing<MaNGOS::RaiseDeadObjectCheck> ();
|
||||
if(result)
|
||||
@@ -2332,6 +2339,12 @@ void Spell::SetTargetMap(uint32 i, uint32 cur)
|
||||
{
|
||||
if(i_spellST->second.type == SPELL_TARGET_TYPE_CREATURE)
|
||||
SearchAreaTarget(unitList, radius, pushType, SPELL_TARGETS_ENTRY, i_spellST->second.targetEntry);
|
||||
else if (i_spellST->second.type == SPELL_TARGET_TYPE_CONTROLLED)
|
||||
{
|
||||
for(Unit::ControlList::iterator itr = m_caster->m_Controlled.begin(); itr != m_caster->m_Controlled.end(); ++itr)
|
||||
if ((*itr)->GetEntry() == i_spellST->second.targetEntry && (*itr)->IsWithinDistInMap(m_caster, radius))
|
||||
unitList.push_back(*itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+12
-2
@@ -2813,6 +2813,14 @@ void AuraEffect::HandleAuraDummy(bool apply, bool Real, bool changeAmount)
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case SPELLFAMILY_DEATHKNIGHT:
|
||||
// Summon Gargoyle ( will start feeding gargoyle )
|
||||
if(GetId()==61777)
|
||||
{
|
||||
m_target->CastSpell(m_target,m_spellProto->EffectTriggerSpell[m_effIndex],true);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -7214,8 +7222,9 @@ void AuraEffect::PeriodicDummyTick()
|
||||
return;
|
||||
}
|
||||
// Summon Gargoyle
|
||||
// if (spell->SpellFamilyFlags & 0x0000008000000000LL)
|
||||
// return;
|
||||
// Being pursuaded by Gargoyle - AI related?
|
||||
// if (spell->SpellFamilyFlags[1] & 0x00000080)
|
||||
// break;
|
||||
// Death Rune Mastery
|
||||
// if (spell->SpellFamilyFlags & 0x0000000000004000LL)
|
||||
// return;
|
||||
@@ -7612,6 +7621,7 @@ void AuraEffect::HandleAuraCloneCaster( bool Apply, bool Real , bool /*changeAmo
|
||||
{
|
||||
if (!Real)
|
||||
return;
|
||||
|
||||
if (Apply)
|
||||
{
|
||||
Unit * caster = GetCaster();
|
||||
|
||||
@@ -1936,11 +1936,30 @@ void Spell::EffectDummy(uint32 i)
|
||||
bp = damage;
|
||||
}
|
||||
m_caster->CastCustomSpell(unitTarget,m_spellInfo->CalculateSimpleValue(1),&bp,NULL,NULL,true);
|
||||
// Suicide
|
||||
// Corpse Explosion (Suicide)
|
||||
unitTarget->CastCustomSpell(unitTarget,43999,&bp,NULL,NULL,true);
|
||||
// Set corpse look
|
||||
unitTarget->SetDisplayId(25537+urand(0,3));
|
||||
}
|
||||
// Runic Power Feed ( keeping Gargoyle alive )
|
||||
else if (m_spellInfo->Id == 50524)
|
||||
{
|
||||
// No power, dismiss Gargoyle
|
||||
if (m_caster->GetPower(POWER_RUNIC_POWER)<30)
|
||||
m_caster->CastSpell((Unit*)NULL,50515,true);
|
||||
else
|
||||
m_caster->ModifyPower(POWER_RUNIC_POWER,-30);
|
||||
|
||||
return;
|
||||
}
|
||||
// Dismiss Gargoyle
|
||||
else if (m_spellInfo->Id == 50515)
|
||||
{
|
||||
// FIXME: gargoyle should fly away
|
||||
unitTarget->setDeathState(JUST_DIED);
|
||||
m_caster->RemoveAurasDueToSpell(50514);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -720,6 +720,7 @@ bool IsPositiveEffect(uint32 spellId, uint32 effIndex, bool deep)
|
||||
case 31719: // Suspension
|
||||
case 61987: // Avenging Wrath Marker
|
||||
case 11196: // Recently Bandadged
|
||||
case 50524: // Runic Power Feed
|
||||
return false;
|
||||
case 12042: // Arcane Power
|
||||
return true;
|
||||
@@ -1933,6 +1934,9 @@ void SpellMgr::LoadSpellScriptTarget()
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPELL_TARGET_TYPE_CONTROLLED:
|
||||
if( targetEntry==0 )
|
||||
sLog.outErrorDb("Table `spell_script_target`: creature template entry %u does not exist.",targetEntry);
|
||||
default:
|
||||
{
|
||||
//players
|
||||
|
||||
+3
-2
@@ -533,10 +533,11 @@ enum SpellScriptTargetType
|
||||
{
|
||||
SPELL_TARGET_TYPE_GAMEOBJECT = 0,
|
||||
SPELL_TARGET_TYPE_CREATURE = 1,
|
||||
SPELL_TARGET_TYPE_DEAD = 2
|
||||
SPELL_TARGET_TYPE_DEAD = 2,
|
||||
SPELL_TARGET_TYPE_CONTROLLED = 3,
|
||||
};
|
||||
|
||||
#define MAX_SPELL_TARGET_TYPE 3
|
||||
#define MAX_SPELL_TARGET_TYPE 4
|
||||
|
||||
struct SpellTargetEntry
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user