diff options
-rw-r--r-- | sql/FULL/world_spell_full.sql | 13 | ||||
-rw-r--r-- | sql/updates/4753_world.sql | 5 | ||||
-rw-r--r-- | src/game/Spell.cpp | 17 | ||||
-rw-r--r-- | src/game/SpellAuras.cpp | 14 | ||||
-rw-r--r-- | src/game/SpellEffects.cpp | 21 | ||||
-rw-r--r-- | src/game/SpellMgr.cpp | 4 | ||||
-rw-r--r-- | src/game/SpellMgr.h | 5 |
7 files changed, 67 insertions, 12 deletions
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql index 21f94c29f42..e041f9763d4 100644 --- a/sql/FULL/world_spell_full.sql +++ b/sql/FULL/world_spell_full.sql @@ -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; diff --git a/sql/updates/4753_world.sql b/sql/updates/4753_world.sql new file mode 100644 index 00000000000..059a6427b9b --- /dev/null +++ b/sql/updates/4753_world.sql @@ -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); diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 837b8606398..999cdd8c893 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -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); + } } } } diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 6e893611304..aa8c2014b7a 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -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(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3f95efcdeed..b3ee8baa7e8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -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; } diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 3802e1c230b..2bc51076de2 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -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 diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index b2ba185f82a..42767a7df09 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -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 { |