Core/Spells: Fixed quest Stopping the Spread

This commit is contained in:
Lopin
2011-08-24 15:57:14 +02:00
parent 0c410bda43
commit ededca3311
4 changed files with 50 additions and 40 deletions

View File

@@ -0,0 +1,4 @@
DELETE FROM `conditions` WHERE `SourceEntry`=32146;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`)
VALUES
(13,0,32146,0,18,1,18240,0,0,'','Spell Liquid Fire can only be cast at Sunspring Villager');

View File

@@ -0,0 +1,4 @@
DELETE FROM `spell_script_names` WHERE `spell_id`=32146;
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`)
VALUES
(32146,'spell_q9874_liquid_fire');

View File

@@ -26,7 +26,6 @@ EndScriptData */
/* ContentData
mob_shattered_rumbler
mob_lump
mob_sunspring_villager
npc_altruis_the_sufferer
npc_greatmother_geyah
npc_lantresor_of_the_blade
@@ -243,44 +242,6 @@ public:
};
/*####
# mob_sunspring_villager - should be done with ACID
####*/
class mob_sunspring_villager : public CreatureScript
{
public:
mob_sunspring_villager() : CreatureScript("mob_sunspring_villager") { }
CreatureAI* GetAI(Creature* creature) const
{
return new mob_sunspring_villagerAI (creature);
}
struct mob_sunspring_villagerAI : public ScriptedAI
{
mob_sunspring_villagerAI(Creature* c) : ScriptedAI(c) {}
void Reset()
{
me->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
me->SetStandState(UNIT_STAND_STATE_DEAD);
}
void EnterCombat(Unit* /*who*/) {}
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
{
if (spell->Id == 32146)
{
me->DealDamage(me, me->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
me->RemoveCorpse();
}
}
};
};
/*######
## npc_altruis_the_sufferer
######*/
@@ -1013,7 +974,6 @@ void AddSC_nagrand()
{
new mob_shattered_rumbler();
new mob_lump();
new mob_sunspring_villager();
new npc_altruis_the_sufferer();
new npc_greatmother_geyah();
new npc_lantresor_of_the_blade();

View File

@@ -857,6 +857,47 @@ public:
};
};
enum StoppingTheSpread
{
NPC_KILL_CREDIT = 18240,
SPELL_FLAMES = 39199,
};
class spell_q9874_liquid_fire : public SpellScriptLoader
{
public:
spell_q9874_liquid_fire() : SpellScriptLoader("spell_q9874_liquid_fire")
{
}
class spell_q9874_liquid_fire_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q9874_liquid_fire_SpellScript);
void HandleDummy(SpellEffIndex /*effIndex*/)
{
Player* caster = GetCaster()->ToPlayer();
Creature* target = GetHitUnit()->ToCreature();
if (!caster || !target || (target && target->HasAura(SPELL_FLAMES)))
return;
caster->KilledMonsterCredit(NPC_KILL_CREDIT, 0);
target->CastSpell(target, SPELL_FLAMES, true);
target->DespawnOrUnsummon(60000);
}
void Register()
{
OnEffect += SpellEffectFn(spell_q9874_liquid_fire_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
}
};
SpellScript* GetSpellScript() const
{
return new spell_q9874_liquid_fire_SpellScript();
};
};
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -877,4 +918,5 @@ void AddSC_quest_spell_scripts()
new spell_q10041_q10040_who_are_they();
new spell_symbol_of_life_dummy();
new spell_q12659_ahunaes_knife();
new spell_q9874_liquid_fire();
}