Core/Scripts: fixed startup errors

Closes #14730
This commit is contained in:
joschiwald
2015-09-12 18:51:11 +02:00
parent 4cdab0cdcb
commit 497aa4425b
5 changed files with 148 additions and 100 deletions

View File

@@ -0,0 +1,5 @@
UPDATE `creature_template` SET `ScriptName`='npc_brann_bronzebeard_ulduar_intro' WHERE `entry`=33579;
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=48750 AND `spell_effect`=48770;
DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_burning_depths_necrolyte_image';
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(48750, 'spell_gen_burning_depths_necrolyte_image');

View File

@@ -97,9 +97,6 @@ enum Creatures
NPC_MIMIRON_TARGET_BEACON = 33369,
NPC_HODIR_TARGET_BEACON = 33108,
NPC_FREYA_TARGET_BEACON = 33366,
NPC_LOREKEEPER = 33686, // Hard mode starter
NPC_BRANZ_BRONZBEARD = 33579,
NPC_DELORAH = 33701,
NPC_ULDUAR_GAUNTLET_GENERATOR = 33571, // Trigger tied to towers
};
@@ -1167,9 +1164,49 @@ class npc_freya_ward_summon : public CreatureScript
}
};
//npc lore keeper
#define GOSSIP_ITEM_1 "Activate secondary defensive systems"
#define GOSSIP_ITEM_2 "Confirmed"
enum BrannBronzebeardGossips
{
GOSSIP_MENU_BRANN_BRONZEBEARD = 10355,
GOSSIP_OPTION_BRANN_BRONZEBEARD = 0
};
class npc_brann_bronzebeard_ulduar_intro : public CreatureScript
{
public:
npc_brann_bronzebeard_ulduar_intro() : CreatureScript("npc_brann_bronzebeard_ulduar_intro") { }
struct npc_brann_bronzebeard_ulduar_introAI : public ScriptedAI
{
npc_brann_bronzebeard_ulduar_introAI(Creature* creature) : ScriptedAI(creature)
{
_instance = creature->GetInstanceScript();
}
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
{
if (menuId == GOSSIP_MENU_BRANN_BRONZEBEARD && gossipListId == GOSSIP_OPTION_BRANN_BRONZEBEARD)
{
player->PlayerTalkClass->SendCloseGossip();
if (Creature* loreKeeper = _instance->GetCreature(DATA_LORE_KEEPER_OF_NORGANNON))
loreKeeper->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}
}
private:
InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override
{
return GetUlduarAI<npc_brann_bronzebeard_ulduar_introAI>(creature);
}
};
enum LoreKeeperGossips
{
GOSSIP_MENU_LORE_KEEPER = 10477,
GOSSIP_OPTION_LORE_KEEPER = 0
};
class npc_lorekeeper : public CreatureScript
{
@@ -1180,6 +1217,7 @@ class npc_lorekeeper : public CreatureScript
{
npc_lorekeeperAI(Creature* creature) : ScriptedAI(creature)
{
_instance = creature->GetInstanceScript();
}
void DoAction(int32 action) override
@@ -1187,66 +1225,42 @@ class npc_lorekeeper : public CreatureScript
// Start encounter
if (action == ACTION_SPAWN_VEHICLES)
{
for (int32 i = 0; i < RAID_MODE(2, 5); ++i)
for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
DoSummon(VEHICLE_SIEGE, PosSiege[i], 3000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
for (int32 i = 0; i < RAID_MODE(2, 5); ++i)
for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
DoSummon(VEHICLE_CHOPPER, PosChopper[i], 3000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
for (int32 i = 0; i < RAID_MODE(2, 5); ++i)
for (uint8 i = 0; i < RAID_MODE(2, 5); ++i)
DoSummon(VEHICLE_DEMOLISHER, PosDemolisher[i], 3000, TEMPSUMMON_CORPSE_TIMED_DESPAWN);
return;
}
}
};
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->CLOSE_GOSSIP_MENU();
InstanceScript* instance = creature->GetInstanceScript();
if (!instance)
return true;
switch (action)
void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override
{
case GOSSIP_ACTION_INFO_DEF+1:
player->PrepareGossipMenu(creature);
instance->instance->LoadGrid(364, -16); //make sure leviathan is loaded
if (menuId == GOSSIP_MENU_LORE_KEEPER && gossipListId == GOSSIP_OPTION_LORE_KEEPER)
{
player->PlayerTalkClass->SendCloseGossip();
_instance->instance->LoadGrid(364, -16); // make sure leviathan is loaded
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
if (Creature* leviathan = instance->instance->GetCreature(instance->GetGuidData(BOSS_LEVIATHAN)))
if (Creature* leviathan = _instance->instance->GetCreature(_instance->GetGuidData(BOSS_LEVIATHAN)))
{
leviathan->AI()->DoAction(ACTION_START_HARD_MODE);
creature->SetVisible(false);
creature->AI()->DoAction(ACTION_SPAWN_VEHICLES); // spawn the vehicles
if (Creature* Delorah = creature->FindNearestCreature(NPC_DELORAH, 1000, true))
me->SetVisible(false);
DoAction(ACTION_SPAWN_VEHICLES); // spawn the vehicles
if (Creature* delorah = _instance->GetCreature(DATA_DELLORAH))
{
if (Creature* Branz = creature->FindNearestCreature(NPC_BRANZ_BRONZBEARD, 1000, true))
if (Creature* brann = _instance->GetCreature(DATA_BRANN_BRONZEBEARD_INTRO))
{
Delorah->GetMotionMaster()->MovePoint(0, Branz->GetPositionX()-4, Branz->GetPositionY(), Branz->GetPositionZ());
/// @todo Delorah->AI()->Talk(xxxx, Branz->GetGUID()); when reached at branz
delorah->GetMotionMaster()->MovePoint(0, brann->GetPositionX() - 4, brann->GetPositionY(), brann->GetPositionZ());
/// @todo delorah->AI()->Talk(xxxx, brann->GetGUID()); when reached at branz
}
}
}
break;
}
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
InstanceScript* instance = creature->GetInstanceScript();
if (instance && instance->GetData(BOSS_LEVIATHAN) != DONE && player)
{
player->PrepareGossipMenu(creature);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
}
return true;
}
private:
InstanceScript* _instance;
};
CreatureAI* GetAI(Creature* creature) const override
{
@@ -1254,56 +1268,6 @@ class npc_lorekeeper : public CreatureScript
}
};
//enable hardmode
////npc_brann_bronzebeard this requires more work involving area triggers. if reached this guy speaks through his radio..
//#define GOSSIP_ITEM_1 "xxxxx"
//#define GOSSIP_ITEM_2 "xxxxx"
//
/*
class npc_brann_bronzebeard : public CreatureScript
{
public:
npc_brann_bronzebeard() : CreatureScript("npc_brann_bronzebeard") { }
//bool OnGossipSelect(Player* player, Creature* creature, uint32 sender, uint32 action) override
//{
// player->PlayerTalkClass->ClearMenus();
// switch (action)
// {
// case GOSSIP_ACTION_INFO_DEF+1:
// if (player)
// {
// player->PrepareGossipMenu(creature);
//
// player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
// player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
// }
// break;
// case GOSSIP_ACTION_INFO_DEF+2:
// if (player)
// player->CLOSE_GOSSIP_MENU();
// if (Creature* Lorekeeper = creature->FindNearestCreature(NPC_LOREKEEPER, 1000, true)) //lore keeper of lorgannon
// Lorekeeper->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
// break;
// }
// return true;
//}
//bool OnGossipHello(Player* player, Creature* creature) override
//{
// InstanceScript* instance = creature->GetInstanceScript();
// if (instance && instance->GetData(BOSS_LEVIATHAN) !=DONE)
// {
// player->PrepareGossipMenu(creature);
//
// player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
// player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
// }
// return true;
//}
//
}
*/
class go_ulduar_tower : public GameObjectScript
{
public:
@@ -1836,8 +1800,8 @@ void AddSC_boss_flame_leviathan()
new npc_hodirs_fury();
new npc_freyas_ward();
new npc_freya_ward_summon();
new npc_brann_bronzebeard_ulduar_intro();
new npc_lorekeeper();
// new npc_brann_bronzebeard();
new go_ulduar_tower();
new achievement_three_car_garage_demolisher();

View File

@@ -54,6 +54,15 @@ MinionData const minionData[] =
{ 0, 0, }
};
ObjectData const creatureData[] =
{
{ NPC_BRANN_BRONZEBEARD_INTRO, DATA_BRANN_BRONZEBEARD_INTRO },
{ NPC_LORE_KEEPER_OF_NORGANNON, DATA_LORE_KEEPER_OF_NORGANNON },
{ NPC_HIGH_EXPLORER_DELLORAH, DATA_DELLORAH },
{ NPC_BRONZEBEARD_RADIO, DATA_BRONZEBEARD_RADIO },
{ 0, 0, }
};
class instance_ulduar : public InstanceMapScript
{
public:
@@ -68,6 +77,7 @@ class instance_ulduar : public InstanceMapScript
LoadDoorData(doorData);
LoadMinionData(minionData);
LoadObjectData(creatureData, nullptr);
_algalonTimer = 61;
_maxArmorItemLevel = 0;
@@ -420,6 +430,8 @@ class instance_ulduar : public InstanceMapScript
algalon->AI()->JustSummoned(creature);
break;
}
InstanceScript::OnCreatureCreate(creature);
}
void OnCreatureRemove(Creature* creature) override
@@ -446,6 +458,8 @@ class instance_ulduar : public InstanceMapScript
default:
break;
}
InstanceScript::OnCreatureRemove(creature);
}
void OnGameObjectCreate(GameObject* gameObject) override

View File

@@ -80,6 +80,23 @@ enum UlduarNPCs
NPC_YOGG_SARON = 33288,
NPC_ALGALON = 32871,
// Flame Leviathan
NPC_ULDUAR_COLOSSUS = 33237,
NPC_BRANN_BRONZEBEARD_INTRO = 33579,
NPC_BRANN_BRONZEBEARD_FLYING_MACHINE = 34119,
NPC_BRANN_S_FLYING_MACHINE = 34120,
NPC_ARCHMAGE_PENTARUS = 33624,
NPC_ARCHMAGE_RHYDIAN = 33696,
NPC_LORE_KEEPER_OF_NORGANNON = 33686,
NPC_HIGH_EXPLORER_DELLORAH = 33701,
NPC_BRONZEBEARD_RADIO = 34054,
NPC_FLAME_LEVIATHAN = 33113,
NPC_FLAME_LEVIATHAN_SEAT = 33114,
NPC_FLAME_LEVIATHAN_TURRET = 33139,
NPC_LEVIATHAN_DEFENSE_TURRET = 33142,
NPC_OVERLOAD_CONTROL_DEVICE = 33143,
NPC_ORBITAL_SUPPORT = 34286,
// Mimiron
NPC_LEVIATHAN_MKII = 33432,
NPC_VX_001 = 33651,
@@ -382,6 +399,12 @@ enum UlduarData
DATA_UNIVERSE_GLOBE,
DATA_ALGALON_TRAPDOOR,
DATA_BRANN_BRONZEBEARD_ALG,
// Misc
DATA_BRANN_BRONZEBEARD_INTRO,
DATA_LORE_KEEPER_OF_NORGANNON,
DATA_DELLORAH,
DATA_BRONZEBEARD_RADIO
};
enum UlduarWorldStates

View File

@@ -614,6 +614,47 @@ class spell_gen_burn_brutallus : public SpellScriptLoader
}
};
// 48750 - Burning Depths Necrolyte Image
class spell_gen_burning_depths_necrolyte_image : public SpellScriptLoader
{
public:
spell_gen_burning_depths_necrolyte_image() : SpellScriptLoader("spell_gen_burning_depths_necrolyte_image") { }
class spell_gen_burning_depths_necrolyte_image_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_burning_depths_necrolyte_image_AuraScript);
bool Validate(SpellInfo const* spellInfo) override
{
if (!sSpellMgr->GetSpellInfo(uint32(spellInfo->Effects[EFFECT_2].CalcValue())))
return false;
return true;
}
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Unit* caster = GetCaster())
caster->CastSpell(GetTarget(), uint32(GetSpellInfo()->Effects[EFFECT_2].CalcValue()));
}
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
GetTarget()->RemoveAurasDueToSpell(uint32(GetSpellInfo()->Effects[EFFECT_2].CalcValue()), GetCasterGUID());
}
void Register() override
{
AfterEffectApply += AuraEffectApplyFn(spell_gen_burning_depths_necrolyte_image_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
AfterEffectRemove += AuraEffectRemoveFn(spell_gen_burning_depths_necrolyte_image_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
}
};
AuraScript* GetAuraScript() const override
{
return new spell_gen_burning_depths_necrolyte_image_AuraScript();
}
};
enum CannibalizeSpells
{
SPELL_CANNIBALIZE_TRIGGERED = 20578
@@ -4093,6 +4134,7 @@ void AddSC_generic_spell_scripts()
new spell_gen_break_shield("spell_gen_break_shield");
new spell_gen_break_shield("spell_gen_tournament_counterattack");
new spell_gen_burn_brutallus();
new spell_gen_burning_depths_necrolyte_image();
new spell_gen_cannibalize();
new spell_gen_chaos_blast();
new spell_gen_clone();