Permalink
Browse files

DB/Quests: Fix It Was The Orcs, Honest! Closes #2037

  • Loading branch information...
1 parent d89626f commit 294fac60a03a69d6f618c9d0e163615f379a9d33 Pitcrawler committed Apr 1, 2013
Showing with 70 additions and 0 deletions.
  1. +20 −0 sql/updates/world/2013_04_01_00_world_misc.sql
  2. +50 −0 src/server/scripts/Spells/spell_generic.cpp
@@ -0,0 +1,20 @@
+DELETE FROM `spell_script_names` WHERE `spell_id`=45759;
+INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
+(45759,'spell_gen_orc_disguise');
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=45742;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(17,0,45742,0,0,1,0,45760,0,0,0,0,'','Spell Plant Warsong Banner can be casted only if player has aura Warsong Orc Disguise (Male)'),
+(17,0,45742,0,0,31,1,3,25430,0,0,0,'','Spell Plant Warsong Banner can be casted only on Magmothregar'),
+(17,0,45742,0,0,36,1,0,0,0,1,0,'','Spell Plant Warsong Banner can be casted only if target is dead'),
+(17,0,45742,0,1,1,0,45762,0,0,0,0,'','Spell Plant Warsong Banner can be casted only if player has aura Warsong Orc Disguise (Female)'),
+(17,0,45742,0,1,31,1,3,25430,0,0,0,'','Spell Plant Warsong Banner can be casted only on Magmothregar'),
+(17,0,45742,0,1,36,1,0,0,0,1,0,'','Spell Plant Warsong Banner can be casted only if target is dead');
+
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25430;
+DELETE FROM `creature_ai_scripts` WHERE `creature_id`=25430;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=25430 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(25430,0,0,0,4,0,100,0,0,0,0,0,11,50413,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Magmothregar - On aggro - Spellcast Magnataur Charge'),
+(25430,0,1,0,0,0,100,0,3500,12800,10100,14000,11,50822,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Magmothregar - On update IC - Spellcast Fervor'),
+(25430,0,2,0,8,0,100,0,45742,0,0,0,11,45744,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Magmothregar - On spellhit Plant Warsong Banner - Spellcast It Was The Orcs, Honest!: Plant Banner Kill Credit');
@@ -3513,6 +3513,55 @@ class spell_gen_aura_service_uniform : public SpellScriptLoader
}
};
+enum OrcDisguiseSpells
+{
+ SPELL_ORC_DISGUISE_TRIGGER = 45759,
+ SPELL_ORC_DISGUISE_MALE = 45760,
+ SPELL_ORC_DISGUISE_FEMALE = 45762,
+};
+
+class spell_gen_orc_disguise : public SpellScriptLoader
+{
+ public:
+ spell_gen_orc_disguise() : SpellScriptLoader("spell_gen_orc_disguise") { }
+
+ class spell_gen_orc_disguise_SpellScript : public SpellScript
+ {
+ PrepareSpellScript(spell_gen_orc_disguise_SpellScript);
+
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_TRIGGER) || !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_MALE) ||
+ !sSpellMgr->GetSpellInfo(SPELL_ORC_DISGUISE_FEMALE))
+ return false;
+ return true;
+ }
+
+ void HandleScript(SpellEffIndex /*effIndex*/)
+ {
+ Unit* caster = GetCaster();
+ if (Player* target = GetHitPlayer())
+ {
+ uint8 gender = target->getGender();
+ if (!gender)
+ caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
+ else
+ caster->CastSpell(target, SPELL_ORC_DISGUISE_FEMALE, true);
+ }
+ }
+
+ void Register()
+ {
+ OnEffectHitTarget += SpellEffectFn(spell_gen_orc_disguise_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
+ }
+ };
+
+ SpellScript* GetSpellScript() const
+ {
+ return new spell_gen_orc_disguise_SpellScript();
+ }
+};
+
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -3592,4 +3641,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_gift_of_naaru();
new spell_gen_replenishment();
new spell_gen_aura_service_uniform();
+ new spell_gen_orc_disguise();
@thomas33
thomas33 Apr 2, 2013 Contributor

ohm

}

0 comments on commit 294fac6

Please sign in to comment.