*Fix a creature spell use bug.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-05-09 22:00:18 -05:00
parent 3b14179f65
commit 67876f9dfe
3 changed files with 6 additions and 25 deletions
+3 -2
View File
@@ -151,13 +151,14 @@ INSERT INTO creature_template (entry, spell1, flags_extra, scriptname) VALUES
(23069, 40029, 128, ''), # demon fire (23069, 40029, 128, ''), # demon fire
(24187, 43218, 128, ''), # pillar of fire (24187, 43218, 128, ''), # pillar of fire
(17662, 30914, 128, ''), # Broggok Poison Cloud (17662, 30914, 128, ''), # Broggok Poison Cloud
(25879, 46262, 128, '') # Void Zone Periodic (25879, 46262, 128, ''), # Void Zone Periodic
(16363, 28158, 128, ''), # Grobbulus Cloud
(29379, 54362, 128, ''), # Grobbulus Cloud (H)
ON DUPLICATE KEY UPDATE ON DUPLICATE KEY UPDATE
spell1 = VALUES(spell1), spell1 = VALUES(spell1),
flags_extra = VALUES(flags_extra), flags_extra = VALUES(flags_extra),
scriptname = VALUES(scriptname); scriptname = VALUES(scriptname);
UPDATE creature_template SET spell1 = 28158, spell2 = 54362, flags_extra = 128 WHERE entry = 16363;
UPDATE creature_template SET speed = 1.0 WHERE entry = 23095; # molten_flame UPDATE creature_template SET speed = 1.0 WHERE entry = 23095; # molten_flame
@@ -166,25 +166,8 @@ struct TRINITY_DLL_DECL trigger_periodicAI : public NullCreatureAI
{ {
trigger_periodicAI(Creature* c) : NullCreatureAI(c) trigger_periodicAI(Creature* c) : NullCreatureAI(c)
{ {
if(me->m_spells[0]) spell = me->m_spells[0] ? GetSpellStore()->LookupEntry(me->m_spells[0]) : NULL;
{ interval = me->m_spells[1] ? me->m_spells[1] : 1000;
if(me->m_spells[1])
spell = GetSpellStore()->LookupEntry(HEROIC(me->m_spells[0], me->m_spells[1]));
else
spell = GetSpellStore()->LookupEntry(me->m_spells[0]);
}
else
spell = NULL;
if(me->m_spells[2])
{
if(me->m_spells[3])
interval = HEROIC(me->m_spells[2], me->m_spells[3]);
else
interval = me->m_spells[2];
}
else
interval = 1000;
timer = interval; timer = interval;
} }
+1 -4
View File
@@ -208,10 +208,7 @@ void TempSummon::InitSummon()
if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && m_spells[0]) if(GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER && m_spells[0])
{ {
setFaction(owner->getFaction()); setFaction(owner->getFaction());
if(m_spells[1] && GetMap()->IsHeroic()) CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID);
CastSpell(this, m_spells[1], false, 0, 0, m_summonerGUID);
else
CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID);
} }
} }
} }