Core/Scripts: Fix startup errors

This commit is contained in:
ariel-
2016-02-21 20:32:48 -03:00
parent 2de8d6b4bb
commit 35aa198984
6 changed files with 106 additions and 102 deletions

View File

@@ -1083,7 +1083,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
}
};
// -33943 - Flight Form
// 33943 - Flight Form (Shapeshift)
class spell_dru_flight_form : public SpellScriptLoader
{
public:

View File

@@ -52,6 +52,7 @@ enum RogueSpells
SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628,
SPELL_ROGUE_SERRATED_BLADES_R1 = 14171,
SPELL_ROGUE_RUPTURE = 1943,
SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED = 51699
};
enum RogueSpellIcons
@@ -1008,6 +1009,58 @@ public:
}
};
// -51698 - Honor Among Thieves
class spell_rog_honor_among_thieves : public SpellScriptLoader
{
public:
spell_rog_honor_among_thieves() : SpellScriptLoader("spell_rog_honor_among_thieves") { }
class spell_rog_honor_among_thieves_AuraScript : public AuraScript
{
PrepareAuraScript(spell_rog_honor_among_thieves_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED))
return false;
return true;
}
bool CheckProc(ProcEventInfo& /*eventInfo*/)
{
Unit* caster = GetCaster();
if (!caster)
return false;
return !caster->GetSpellHistory()->HasCooldown(SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED);
}
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
Unit* caster = GetCaster();
if (!caster)
return;
if (Player* player = caster->ToPlayer())
if (Unit* target = ObjectAccessor::GetUnit(*player, player->GetTarget()))
caster->CastSpell(target, SPELL_ROGUE_HONOR_AMONG_THIEVES_TRIGGERED, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD), nullptr, aurEff);
}
void Register() override
{
DoCheckProc += AuraCheckProcFn(spell_rog_honor_among_thieves_AuraScript::CheckProc);
OnEffectProc += AuraEffectProcFn(spell_rog_honor_among_thieves_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_rog_honor_among_thieves_AuraScript();
}
};
void AddSC_rogue_spell_scripts()
{
new spell_rog_blade_flurry();
@@ -1028,4 +1081,5 @@ void AddSC_rogue_spell_scripts()
new spell_rog_tricks_of_the_trade();
new spell_rog_tricks_of_the_trade_proc();
new spell_rog_serrated_blades();
new spell_rog_honor_among_thieves();
}

View File

@@ -61,7 +61,8 @@ enum ShamanSpells
SPELL_SHAMAN_TOTEM_EARTHBIND_TOTEM = 6474,
SPELL_SHAMAN_TOTEM_EARTHEN_POWER = 59566,
SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL = 52042,
SPELL_SHAMAN_TIDAL_WAVES = 53390
SPELL_SHAMAN_TIDAL_WAVES = 53390,
SPELL_SHAMAN_TOTEMIC_MASTERY = 38437
};
enum ShamanSpellIcons
@@ -1231,6 +1232,46 @@ class spell_sha_tidal_waves : public SpellScriptLoader
}
};
// 38443 - Totemic Mastery (Tier 6 - 2P)
class spell_sha_totemic_mastery : public SpellScriptLoader
{
public:
spell_sha_totemic_mastery() : SpellScriptLoader("spell_sha_totemic_mastery") { }
class spell_sha_totemic_mastery_AuraScript : public AuraScript
{
PrepareAuraScript(spell_sha_totemic_mastery_AuraScript);
bool Validate(SpellInfo const* /*spellInfo*/) override
{
if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_TOTEMIC_MASTERY))
return false;
return true;
}
void HandleDummy(AuraEffect const* /*aurEff*/)
{
Unit* target = GetTarget();
for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
if (!target->m_SummonSlot[i])
return;
target->CastSpell(target, SPELL_SHAMAN_TOTEMIC_MASTERY, true);
PreventDefaultAction();
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_totemic_mastery_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_sha_totemic_mastery_AuraScript();
}
};
void AddSC_shaman_spell_scripts()
{
new spell_sha_ancestral_awakening();
@@ -1260,4 +1301,5 @@ void AddSC_shaman_spell_scripts()
new spell_sha_telluric_currents();
new spell_sha_thunderstorm();
new spell_sha_tidal_waves();
new spell_sha_totemic_mastery();
}

View File

@@ -26,7 +26,6 @@ EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "GameObjectAI.h"
#include "Player.h"
#include "SpellInfo.h"
#include "WorldSession.h"
@@ -149,12 +148,6 @@ enum ProfessionSpells
S_GOBLIN = 20222,
S_GNOMISH = 20219,
S_LEARN_GOBLIN = 20221,
S_LEARN_GNOMISH = 20220,
S_UNLEARN_GOBLIN = 68334,
S_UNLEARN_GNOMISH = 68333,
S_SPELLFIRE = 26797,
S_MOONCLOTH = 26798,
S_SHADOWEAVE = 26801,
@@ -378,27 +371,6 @@ void ProfessionUnlearnSpells(Player* player, uint32 type)
player->RemoveSpell(36075); // Wildfeather Leggings
player->RemoveSpell(36078); // Living Crystal Breastplate
break;
case S_UNLEARN_GOBLIN: // S_UNLEARN_GOBLIN
player->RemoveSpell(30565); // Foreman's Enchanted Helmet
player->RemoveSpell(30566); // Foreman's Reinforced Helmet
player->RemoveSpell(30563); // Goblin Rocket Launcher
player->RemoveSpell(56514); // Global Thermal Sapper Charge
player->RemoveSpell(36954); // Dimensional Ripper - Area 52
player->RemoveSpell(23486); // Dimensional Ripper - Everlook
player->RemoveSpell(23078); // Goblin Jumper Cables XL
player->RemoveSpell(72952); // Shatter Rounds
break;
case S_UNLEARN_GNOMISH: // S_UNLEARN_GNOMISH
player->RemoveSpell(30575); // Gnomish Battle Goggles
player->RemoveSpell(30574); // Gnomish Power Goggles
player->RemoveSpell(56473); // Gnomish X-Ray Specs
player->RemoveSpell(30569); // Gnomish Poultryizer
player->RemoveSpell(30563); // Ultrasafe Transporter - Toshley's Station
player->RemoveSpell(23489); // Ultrasafe Transporter - Gadgetzan
player->RemoveSpell(23129); // World Enlarger
player->RemoveSpell(23096); // Gnomish Alarm-o-Bot
player->RemoveSpell(72953); // Iceblade Arrow
break;
case S_UNLEARN_SPELLFIRE: // S_UNLEARN_SPELLFIRE
player->RemoveSpell(26752); // Spellfire Belt
player->RemoveSpell(26753); // Spellfire Gloves
@@ -946,76 +918,6 @@ public:
}
};
// Object ID - 177226
// Book "Soothsaying for dummies"
enum SoothsayingForDummies
{
GOSSIP_ID = 7058,
// Engineering
OPTION_UNLEARN_GNOMISH = 0,
OPTION_UNLEARN_GOBLIN = 1,
OPTION_LEARN_GNOMISH = 2,
OPTION_LEARN_GOBLIN = 3,
// Leatherworking
OPTION_LEARN_DRAGONSCALE = 4,
OPTION_LEARN_ELEMENTAL = 5,
OPTION_LEARN_TRIBAL = 6
};
class go_soothsaying_for_dummies : public GameObjectScript
{
public:
go_soothsaying_for_dummies() : GameObjectScript("go_soothsaying_for_dummies") { }
struct go_soothsaying_for_dummiesAI : public GameObjectAI
{
go_soothsaying_for_dummiesAI(GameObject* go) : GameObjectAI(go) { }
bool GossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
{
if (menuId != GOSSIP_ID)
return false;
switch (gossipListId)
{
case OPTION_UNLEARN_GNOMISH:
ProcessUnlearnAction(player, nullptr, S_UNLEARN_GNOMISH, 0, 0); // cost is handled by gossip code
break;
case OPTION_UNLEARN_GOBLIN:
ProcessUnlearnAction(player, nullptr, S_UNLEARN_GOBLIN, 0, 0);
break;
case OPTION_LEARN_GNOMISH:
player->CastSpell(player, S_LEARN_GNOMISH, true);
break;
case OPTION_LEARN_GOBLIN:
player->CastSpell(player, S_LEARN_GOBLIN, true);
break;
case OPTION_LEARN_DRAGONSCALE:
player->CastSpell(player, S_LEARN_DRAGON, true);
break;
case OPTION_LEARN_ELEMENTAL:
player->CastSpell(player, S_LEARN_ELEMENTAL, true);
break;
case OPTION_LEARN_TRIBAL:
player->CastSpell(player, S_LEARN_TRIBAL, true);
break;
default:
return false;
}
player->CLOSE_GOSSIP_MENU();
return true; // prevent further processing
}
};
GameObjectAI* GetAI(GameObject* go) const override
{
return new go_soothsaying_for_dummiesAI(go);
}
};
/*###
# start menues leatherworking
###*/
@@ -1305,7 +1207,6 @@ void AddSC_npc_professions()
new npc_prof_alchemy();
new npc_prof_blacksmith();
new npc_engineering_tele_trinket();
new go_soothsaying_for_dummies();
new npc_prof_leather();
new npc_prof_tailor();
}