diff options
author | megamage <none@none> | 2009-01-18 17:58:13 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-18 17:58:13 -0600 |
commit | c85c89dc0b0564113e48bfcaf96dc2af55d73bb8 (patch) | |
tree | b75e19414c6a9dc8bfd438f9e0c7a2e42aada9a6 /src | |
parent | 54ed3974138f2f51c3c42c4469f9f1541818f631 (diff) | |
parent | 613217fca7c2959fe3abbe593f4be65beedaeca8 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src')
55 files changed, 1362 insertions, 1357 deletions
diff --git a/src/bindings/interface/CMakeLists.txt b/src/bindings/interface/CMakeLists.txt index 4a8f0872422..4cffc6446fd 100644 --- a/src/bindings/interface/CMakeLists.txt +++ b/src/bindings/interface/CMakeLists.txt @@ -11,7 +11,7 @@ SET(trinityinterface_LIB_SRCS Scripts/sc_defines.h ) -add_library(trinityinterface STATIC ${trinityinterface_LIB_SRCS}) +add_library(trinityinterface SHARED ${trinityinterface_LIB_SRCS}) target_link_libraries(trinityinterface) diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 636530b9527..0ee315816e1 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -380,7 +380,7 @@ SET(trinityscript_LIB_SRCS system.cpp ) -add_library(trinityscript STATIC ${trinityscript_LIB_SRCS}) +add_library(trinityscript SHARED ${trinityscript_LIB_SRCS}) target_link_libraries(trinityscript) diff --git a/src/bindings/scripts/Makefile.am b/src/bindings/scripts/Makefile.am index 87cdb11db0a..e5eb629a84d 100644 --- a/src/bindings/scripts/Makefile.am +++ b/src/bindings/scripts/Makefile.am @@ -102,24 +102,18 @@ scripts/zone/black_temple/def_black_temple.h \ scripts/zone/black_temple/illidari_council.cpp \ scripts/zone/black_temple/instance_black_temple.cpp \ scripts/zone/blackrock_depths/blackrock_depths.cpp \ -scripts/zone/blackrock_depths/instance_blackrock_depths.cpp \ -scripts/zone/blackrock_depths/def_blackrock_depths.h \ scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp \ -scripts/zone/blackrock_depths/boss_angerrel.cpp \ scripts/zone/blackrock_depths/boss_anubshiah.cpp \ -scripts/zone/blackrock_depths/boss_doomrel.cpp \ -scripts/zone/blackrock_depths/boss_doperel.cpp \ scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp \ scripts/zone/blackrock_depths/boss_general_angerforge.cpp \ -scripts/zone/blackrock_depths/boss_gloomrel.cpp \ scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp \ scripts/zone/blackrock_depths/boss_grizzle.cpp \ -scripts/zone/blackrock_depths/boss_haterel.cpp \ scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp \ scripts/zone/blackrock_depths/boss_magmus.cpp \ scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp \ -scripts/zone/blackrock_depths/boss_seethrel.cpp \ -scripts/zone/blackrock_depths/boss_vilerel.cpp \ +scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp \ +scripts/zone/blackrock_depths/def_blackrock_depths.h \ +scripts/zone/blackrock_depths/instance_blackrock_depths.cpp \ scripts/zone/blackrock_spire/boss_drakkisath.cpp \ scripts/zone/blackrock_spire/boss_gyth.cpp \ scripts/zone/blackrock_spire/boss_halycon.cpp \ diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index bcd7ec54a54..5876fa63b06 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -163,21 +163,16 @@ extern void AddSC_instance_black_temple(); //Blackrock Depths extern void AddSC_blackrock_depths(); extern void AddSC_boss_ambassador_flamelash(); -extern void AddSC_boss_angerrel(); extern void AddSC_boss_anubshiah(); -extern void AddSC_boss_doomrel(); -extern void AddSC_boss_doperel(); extern void AddSC_boss_draganthaurissan(); extern void AddSC_boss_general_angerforge(); -extern void AddSC_boss_gloomrel(); extern void AddSC_boss_gorosh_the_dervish(); extern void AddSC_boss_grizzle(); -extern void AddSC_boss_haterel(); extern void AddSC_boss_high_interrogator_gerstahn(); extern void AddSC_boss_magmus(); extern void AddSC_boss_moira_bronzebeard(); -extern void AddSC_boss_seethrel(); -extern void AddSC_boss_vilerel(); +extern void AddSC_boss_tomb_of_seven(); +extern void AddSC_instance_blackrock_depths(); //Blackrock Spire extern void AddSC_boss_drakkisath(); @@ -1372,22 +1367,17 @@ void ScriptsInit() //Blackfathom Depths //Blackrock Depths AddSC_blackrock_depths(); - AddSC_boss_ambassador_flamelash(); - AddSC_boss_angerrel(); - AddSC_boss_anubshiah(); - AddSC_boss_doomrel(); - AddSC_boss_doperel(); - AddSC_boss_draganthaurissan(); - AddSC_boss_general_angerforge(); - AddSC_boss_gloomrel(); - AddSC_boss_gorosh_the_dervish(); - AddSC_boss_grizzle(); - AddSC_boss_haterel(); - AddSC_boss_high_interrogator_gerstahn(); - AddSC_boss_magmus(); - AddSC_boss_moira_bronzebeard(); - AddSC_boss_seethrel(); - AddSC_boss_vilerel(); + AddSC_boss_ambassador_flamelash(); + AddSC_boss_anubshiah(); + AddSC_boss_draganthaurissan(); + AddSC_boss_general_angerforge(); + AddSC_boss_gorosh_the_dervish(); + AddSC_boss_grizzle(); + AddSC_boss_high_interrogator_gerstahn(); + AddSC_boss_magmus(); + AddSC_boss_moira_bronzebeard(); + AddSC_boss_tomb_of_seven(); + AddSC_instance_blackrock_depths(); //Blackrock Spire AddSC_boss_drakkisath(); diff --git a/src/bindings/scripts/VC71/71ScriptDev2.vcproj b/src/bindings/scripts/VC71/71ScriptDev2.vcproj index 2559d4a9bff..a6e625e9c30 100644 --- a/src/bindings/scripts/VC71/71ScriptDev2.vcproj +++ b/src/bindings/scripts/VC71/71ScriptDev2.vcproj @@ -2188,23 +2188,11 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_angerrel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_doomrel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_doperel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" > @@ -2212,11 +2200,7 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_gloomrel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" > @@ -2224,11 +2208,7 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_haterel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" > @@ -2240,13 +2220,9 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_seethrel.cpp" - > - </File> + </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_vilerel.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" > </File> </Filter> diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 1c7bbd6e3c0..540a6d0fa30 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2364,23 +2364,11 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_ambassador_flamelash.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_angerrel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_doomrel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_doperel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" > @@ -2388,11 +2376,7 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_general_angerforge.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_gloomrel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" > @@ -2400,11 +2384,7 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_grizzle.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_haterel.cpp" - > - </File> + </File> <File RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" > @@ -2416,13 +2396,9 @@ <File RelativePath="..\scripts\zone\blackrock_depths\boss_moira_bronzebeard.cpp" > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_seethrel.cpp" - > - </File> + </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_vilerel.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" > </File> </Filter> diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 8dfa9aafe8c..d8cda32f0e8 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2379,22 +2379,10 @@ > </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_angerrel.cpp" - > - </File> - <File RelativePath="..\scripts\zone\blackrock_depths\boss_anubshiah.cpp" > </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_doomrel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_doperel.cpp" - > - </File> - <File RelativePath="..\scripts\zone\blackrock_depths\boss_emperor_dagran_thaurissan.cpp" > </File> @@ -2403,10 +2391,6 @@ > </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_gloomrel.cpp" - > - </File> - <File RelativePath="..\scripts\zone\blackrock_depths\boss_gorosh_the_dervish.cpp" > </File> @@ -2415,10 +2399,6 @@ > </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_haterel.cpp" - > - </File> - <File RelativePath="..\scripts\zone\blackrock_depths\boss_high_interrogator_gerstahn.cpp" > </File> @@ -2431,11 +2411,7 @@ > </File> <File - RelativePath="..\scripts\zone\blackrock_depths\boss_seethrel.cpp" - > - </File> - <File - RelativePath="..\scripts\zone\blackrock_depths\boss_vilerel.cpp" + RelativePath="..\scripts\zone\blackrock_depths\boss_tomb_of_seven.cpp" > </File> <File diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp index ad43b63b5f3..7aff80c0d02 100644 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -111,6 +111,7 @@ bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, { creature->Say(SAY_PROGRESS_1, LANG_UNIVERSAL, player->GetGUID()); ((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID()); + creature->setFaction(113); } return true; } diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index 49935651cb6..85ce5ea0bea 100644 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -55,6 +55,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI uint32 Rend_Timer; uint32 Thunderclap_Timer; + bool Completed; void WaypointReached(uint32 i) { @@ -79,6 +80,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI break; case 20: DoScriptText(SAY_WIN, m_creature, player); + Completed = true; if (player && player->GetTypeId() == TYPEID_PLAYER) ((Player*)player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); break; @@ -92,6 +94,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI { Rend_Timer = 5000; Thunderclap_Timer = 8000; + Completed = false; } void Aggro(Unit* who) @@ -105,7 +108,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) + if (PlayerGUID && !Completed) { if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) ((Player*)player)->FailQuest(QUEST_TOREK_ASSULT); @@ -140,6 +143,7 @@ bool QuestAccept_npc_torek(Player* player, Creature* creature, Quest const* ques //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) ((npc_escortAI*)(creature->AI()))->Start(true, true, true, player->GetGUID()); DoScriptText(SAY_READY, creature, player); + creature->setFaction(113); } return true; @@ -258,7 +262,7 @@ bool QuestAccept_npc_ruul_snowhoof(Player* player, Creature* creature, Quest con { if (quest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) { - creature->setFaction(1603); + creature->setFaction(113); ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp index 9b56561e16b..440f233bccf 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -50,6 +50,7 @@ EndContentData */ #define SPELL_ETHEREAL_BEACON_VISUAL 32368 #define ENTRY_BEACON 18431 +#define ENTRY_SHAFFAR 18344 struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI { @@ -204,6 +205,7 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI { HeroicMode = m_creature->GetMap()->IsHeroic(); Reset(); + CanEvade = false; } bool HeroicMode; @@ -239,6 +241,13 @@ struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI { DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); ArcaneBolt_Timer = 2000 + rand()%2500; + Unit *shaffar = FindCreature(ENTRY_SHAFFAR, 100); + if(!shaffar || shaffar->isDead()) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetLootRecipient(NULL); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } }else ArcaneBolt_Timer -= diff; if( Apprentice_Timer < diff ) diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp index f27fe6d0226..de45a54e043 100644 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -41,16 +41,19 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance instance_shadow_labyrinth(Map *map) : ScriptedInstance(map) {Initialize();}; uint32 Encounter[ENCOUNTERS]; + std::string str_data; + + uint64 RefectoryDoorGUID; + uint64 ScreamingHallDoorGUID; - GameObject *RefectoryDoor; - GameObject *ScreamingHallDoor; uint64 GrandmasterVorpil; uint32 FelOverseerCount; void Initialize() { - RefectoryDoor = NULL; - ScreamingHallDoor = NULL; + RefectoryDoorGUID = 0; + ScreamingHallDoorGUID = 0; + GrandmasterVorpil = 0; FelOverseerCount = 0; @@ -70,12 +73,8 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance { switch(go->GetEntry()) { - case REFECTORY_DOOR: - RefectoryDoor = go; - break; - case SCREAMING_HALL_DOOR: - ScreamingHallDoor = go; - break; + case REFECTORY_DOOR: RefectoryDoorGUID = go->GetGUID(); break; + case SCREAMING_HALL_DOOR: ScreamingHallDoorGUID = go->GetGUID(); break; } } @@ -93,6 +92,37 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance } } + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Shadow Labyrinth: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void HandleGameObject(uint64 guid, uint32 state) + { + Player *player = GetPlayerInMap(); + + if (!player || !guid) + { + debug_log("SD2: Shadow Labyrinth: HandleGameObject fail"); + return; + } + + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); + } + void SetData(uint32 type, uint32 data) { switch(type) @@ -119,8 +149,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance case DATA_BLACKHEARTTHEINCITEREVENT: if( data == DONE ) { - if( RefectoryDoor ) - RefectoryDoor->UseDoorOrButton(); + HandleGameObject(RefectoryDoorGUID,0); } Encounter[2] = data; break; @@ -128,8 +157,7 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance case DATA_GRANDMASTERVORPILEVENT: if( data == DONE ) { - if( ScreamingHallDoor ) - ScreamingHallDoor->UseDoorOrButton(); + HandleGameObject(ScreamingHallDoorGUID,0); } Encounter[3] = data; break; @@ -138,6 +166,23 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance Encounter[4] = data; break; } + + if (data == DONE) + { + if (type == TYPE_OVERSEER && FelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " + << Encounter[2] << " " << Encounter[3] << " " << Encounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } uint32 GetData(uint32 type) @@ -161,6 +206,31 @@ struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance return 0; } + + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] >> Encounter[4]; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* map) diff --git a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp index b4eefc43ce1..8e94e1adc18 100644 --- a/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/zone/azuremyst_isle/azuremyst_isle.cpp @@ -385,7 +385,7 @@ bool QuestAccept_npc_magwin(Player* player, Creature* creature, Quest const* que { if (quest->GetQuestId() == QUEST_A_CRY_FOR_HELP) { - creature->setFaction(10); + creature->setFaction(113); ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; diff --git a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp index 879076e1067..24f4d134464 100644 --- a/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp +++ b/src/bindings/scripts/scripts/zone/barrens/the_barrens.cpp @@ -407,7 +407,8 @@ struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI if(Mercenary) { ((Creature*)Mercenary)->Yell(SAY_MERCENARY_4, LANG_UNIVERSAL, NULL); - Mercenary->Attack(m_creature, true); + ((Creature*)Mercenary)->AI()->AttackStart(m_creature); + AttackStart(Mercenary); } }break; case 21: DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, NULL); @@ -451,7 +452,7 @@ bool QuestAccept_npc_wizzlecrank_shredder(Player* player, Creature* creature, Qu if (quest->GetQuestId() == QUEST_ESCAPE) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - creature->setFaction(35); + creature->setFaction(113); } return true; } @@ -474,7 +475,7 @@ CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature *_Creature) thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); - thisAI->AddWaypoint(14, 1096.97, -3051,99, 82.50); + thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp index 2930f6eafec..e0aa40d060c 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp @@ -17,11 +17,13 @@ /* ScriptData SDName: Blackrock_Depths SD%Complete: 95 -SDComment: Quest support: 4001, 4342, 7604, 4322. Vendor Lokhtos Darkbargainer. +SDComment: Quest support: 4001, 4342, 7604, 4322. Vendor Lokhtos Darkbargainer. Need to rewrite the Jail Break support SDCategory: Blackrock Depths EndScriptData */ /* ContentData +at_ring_of_law +npc_grimstone mob_phalanx npc_kharan_mighthammer npc_lokhtos_darkbargainer @@ -29,12 +31,305 @@ npc_dughal_stormwing npc_marshal_windsor npc_marshal_reginald_windsor npc_tobias_seecher +npc_rocknot EndContentData */ #include "precompiled.h" #include "../../npc/npc_escortAI.h" #include "def_blackrock_depths.h" +#define C_GRIMSTONE 10096 +#define C_THELDREN 16059 + +//4 or 6 in total? 1+2+1 / 2+2+2 / 3+3. Depending on this, code should be changed. +#define MOB_AMOUNT 4 + +uint32 RingMob[]= +{ + 8925, // Dredge Worm + 8926, // Deep Stinger + 8927, // Dark Screecher + 8928, // Burrowing Thundersnout + 8933, // Cave Creeper + 8932, // Borer Beetle +}; + +uint32 RingBoss[]= +{ + 9027, // Gorosh + 9028, // Grizzle + 9029, // Eviscerator + 9030, // Ok'thor + 9031, // Anub'shiah + 9032, // Hedrum +}; + +float RingLocations[6][3]= +{ + {604.802673, -191.081985, -54.058590}, // ring + {604.072998, -222.106918, -52.743759}, // first gate + {621.400391, -214.499054, -52.814453}, // hiding in corner + {601.300781, -198.556992, -53.950256}, // ring + {631.818359, -180.548126, -52.654770}, // second gate + {627.390381, -201.075974, -52.692917} // hiding in corner +}; + +bool AreaTrigger_at_ring_of_law(Player *player, AreaTriggerEntry *at) +{ + ScriptedInstance* pInstance = ((ScriptedInstance*)player->GetInstanceData()); + + if (pInstance) + { + if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE) + return false; + + pInstance->SetData(TYPE_RING_OF_LAW,IN_PROGRESS); + player->SummonCreature(C_GRIMSTONE,625.559,-205.618,-52.735,2.609,TEMPSUMMON_DEAD_DESPAWN,0); + + return false; + } + return false; +} + +/*###### +## npc_grimstone +######*/ + +//TODO: implement quest part of event (different end boss) +struct TRINITY_DLL_DECL npc_grimstoneAI : public npc_escortAI +{ + npc_grimstoneAI(Creature *c) : npc_escortAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + MobSpawnId = rand()%6; + Reset(); + } + + ScriptedInstance* pInstance; + + uint8 EventPhase; + uint32 Event_Timer; + + uint8 MobSpawnId; + uint8 MobCount; + uint32 MobDeath_Timer; + + uint64 RingMobGUID[4]; + uint64 RingBossGUID; + + bool CanWalk; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + EventPhase = 0; + Event_Timer = 1000; + + MobCount = 0; + MobDeath_Timer = 0; + + for(uint8 i = 0; i < MOB_AMOUNT; i++) + RingMobGUID[i] = 0; + + RingBossGUID = 0; + + CanWalk = false; + } + + void Aggro(Unit *who) { } + + void DoGate(uint32 id, uint32 state) + { + if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) + go->SetGoState(state); + + debug_log("SD2: npc_grimstone, arena gate update state."); + } + + //TODO: move them to center + void SummonRingMob() + { + if (Creature* tmp = m_creature->SummonCreature(RingMob[MobSpawnId],608.960,-235.322,-53.907,1.857,TEMPSUMMON_DEAD_DESPAWN,0)) + RingMobGUID[MobCount] = tmp->GetGUID(); + + ++MobCount; + + if (MobCount == MOB_AMOUNT) + MobDeath_Timer = 2500; + } + + //TODO: move them to center + void SummonRingBoss() + { + if (Creature* tmp = m_creature->SummonCreature(RingBoss[rand()%6],644.300,-175.989,-53.739,3.418,TEMPSUMMON_DEAD_DESPAWN,0)) + RingBossGUID = tmp->GetGUID(); + + MobDeath_Timer = 2500; + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0: + DoScriptText(-1000000, m_creature);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(-1000000, m_creature);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(-1000000, m_creature);//5 + break; + case 4: + DoScriptText(-1000000, m_creature);//6 + CanWalk = false; + Event_Timer = 5000; + break; + case 5: + if (pInstance) + { + pInstance->SetData(TYPE_RING_OF_LAW,DONE); + debug_log("SD2: npc_grimstone: event reached end and set complete."); + } + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (MobDeath_Timer) + { + if (MobDeath_Timer <= diff) + { + MobDeath_Timer = 2500; + + if (RingBossGUID) + { + Creature *boss = (Creature*)Unit::GetUnit(*m_creature,RingBossGUID); + if (boss && !boss->isAlive() && boss->isDead()) + { + RingBossGUID = 0; + Event_Timer = 5000; + MobDeath_Timer = 0; + return; + } + return; + } + + for(uint8 i = 0; i < MOB_AMOUNT; i++) + { + Creature *mob = (Creature*)Unit::GetUnit(*m_creature,RingMobGUID[i]); + if (mob && !mob->isAlive() && mob->isDead()) + { + RingMobGUID[i] = 0; + --MobCount; + + //seems all are gone, so set timer to continue and discontinue this + if (!MobCount) + { + Event_Timer = 5000; + MobDeath_Timer = 0; + } + } + } + }else MobDeath_Timer -= diff; + } + + if (Event_Timer) + { + if (Event_Timer <= diff) + { + switch(EventPhase) + { + case 0: + DoScriptText(-1000000, m_creature);//1 + DoGate(DATA_ARENA4,1); + Start(false, false, false); + CanWalk = true; + Event_Timer = 0; + break; + case 1: + CanWalk = true; + Event_Timer = 0; + break; + case 2: + Event_Timer = 2000; + break; + case 3: + DoGate(DATA_ARENA1,0); + Event_Timer = 3000; + break; + case 4: + CanWalk = true; + m_creature->SetVisibility(VISIBILITY_OFF); + SummonRingMob(); + Event_Timer = 8000; + break; + case 5: + SummonRingMob(); + SummonRingMob(); + Event_Timer = 8000; + break; + case 6: + SummonRingMob(); + Event_Timer = 0; + break; + case 7: + m_creature->SetVisibility(VISIBILITY_ON); + DoGate(DATA_ARENA1,1); + DoScriptText(-1000000, m_creature);//4 + CanWalk = true; + Event_Timer = 0; + break; + case 8: + DoGate(DATA_ARENA2,0); + Event_Timer = 5000; + break; + case 9: + m_creature->SetVisibility(VISIBILITY_OFF); + SummonRingBoss(); + Event_Timer = 0; + break; + case 10: + //if quest, complete + DoGate(DATA_ARENA2,1); + DoGate(DATA_ARENA3,0); + DoGate(DATA_ARENA4,0); + CanWalk = true; + Event_Timer = 0; + break; + } + ++EventPhase; + }else Event_Timer -= diff; + } + + if (CanWalk) + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_grimstone(Creature *_Creature) +{ + npc_grimstoneAI* Grimstone_AI = new npc_grimstoneAI(_Creature); + + for(uint8 i = 0; i < 6; ++i) + Grimstone_AI->AddWaypoint(i, RingLocations[i][0], RingLocations[i][1], RingLocations[i][2]); + + return (CreatureAI*)Grimstone_AI; + +} + /*###### ## mob_phalanx ######*/ @@ -107,19 +402,33 @@ CreatureAI* GetAI_mob_phalanx(Creature *_Creature) #define QUEST_4001 4001 #define QUEST_4342 4342 +#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" +#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" + +#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." +#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." +#define GOSSIP_ITEM_KHARAN_5 "So what happened?" +#define GOSSIP_ITEM_KHARAN_6 "Continue..." +#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" +#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." +#define GOSSIP_ITEM_KHARAN_9 "Indeed." +#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." + bool GossipHello_npc_kharan_mighthammer(Player *player, Creature *_Creature) { if( _Creature->isQuestGiver() ) player->PrepareQuestMenu( _Creature->GetGUID() ); if( player->GetQuestStatus(QUEST_4001) == QUEST_STATUS_INCOMPLETE ) - player->ADD_GOSSIP_ITEM( 0, "I need to know where the princess are, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); if( player->GetQuestStatus(4342) == QUEST_STATUS_INCOMPLETE ) - player->ADD_GOSSIP_ITEM( 0, "All is not lost, Kharan!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - if( player->GetTeam() == HORDE ) player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID()); - if( player->GetTeam() == ALLIANCE ) player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID()); + if (player->GetTeam() == HORDE) + player->SEND_GOSSIP_MENU(2473, _Creature->GetGUID()); + else + player->SEND_GOSSIP_MENU(2474, _Creature->GetGUID()); return true; } @@ -129,42 +438,44 @@ bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, ui switch (action) { case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM(0, "Gor'shak is my friend, you can trust me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); player->SEND_GOSSIP_MENU(2475, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM(0, "Not enough, you need to tell me more.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); player->SEND_GOSSIP_MENU(2476, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM(0, "So what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); player->SEND_GOSSIP_MENU(2477, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+4: - player->ADD_GOSSIP_ITEM(0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); player->SEND_GOSSIP_MENU(2478, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+5: - player->ADD_GOSSIP_ITEM(0, "So you suspect that someone on the inside was involved? That they were tipped off?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); player->SEND_GOSSIP_MENU(2479, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+6: - player->ADD_GOSSIP_ITEM(0, "Continue with your story please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); player->SEND_GOSSIP_MENU(2480, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+7: - player->ADD_GOSSIP_ITEM(0, "Indeed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); player->SEND_GOSSIP_MENU(2481, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+8: - player->ADD_GOSSIP_ITEM(0, "The door is open, Kharan. You are a free man.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); player->SEND_GOSSIP_MENU(2482, _Creature->GetGUID()); break; case GOSSIP_ACTION_INFO_DEF+9: player->CLOSE_GOSSIP_MENU(); - if( player->GetTeam() == HORDE ) player->AreaExploredOrEventHappens(QUEST_4001); - if( player->GetTeam() == ALLIANCE ) player->AreaExploredOrEventHappens(QUEST_4342); + if (player->GetTeam() == HORDE) + player->AreaExploredOrEventHappens(QUEST_4001); + else + player->AreaExploredOrEventHappens(QUEST_4342); break; } return true; @@ -179,19 +490,22 @@ bool GossipSelect_npc_kharan_mighthammer(Player *player, Creature *_Creature, ui #define QUEST_A_BINDING_CONTRACT 7604 #define SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND 23059 +#define GOSSIP_ITEM_SHOW_ACCESS "Show me what I have access to, Lothos." +#define GOSSIP_ITEM_GET_CONTRACT "Get Thorium Brotherhood Contract" + bool GossipHello_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature) { if (_Creature->isQuestGiver()) player->PrepareQuestMenu( _Creature->GetGUID() ); if (_Creature->isVendor() && player->GetReputationRank(59) >= REP_FRIENDLY) - player->ADD_GOSSIP_ITEM( 1, "Show me what I have access to, Lothos.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + player->ADD_GOSSIP_ITEM( 1, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); if (player->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) != 1 && !player->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) && player->HasItemCount(ITEM_SULFURON_INGOT, 1)) { - player->ADD_GOSSIP_ITEM(0, "Get Thorium Brotherhood Contract", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); } if (player->GetReputationRank(59) < REP_FRIENDLY) @@ -209,10 +523,9 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, player->CLOSE_GOSSIP_MENU(); player->CastSpell(player, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT_DND, false); } - if (action == GOSSIP_ACTION_TRADE) - { - player->SEND_VENDORLIST( _Creature->GetGUID() ); - } + if (action == GOSSIP_ACTION_TRADE) + player->SEND_VENDORLIST( _Creature->GetGUID() ); + return true; } @@ -225,7 +538,7 @@ bool GossipSelect_npc_lokhtos_darkbargainer(Player *player, Creature *_Creature, #define GOSSIP_DUGHAL "You're free, Dughal! Get out of here!" ScriptedInstance *pInstance; - +/* struct TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI { npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) { Reset(); } @@ -308,7 +621,7 @@ bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint } return true; } - + */ /*###### ## npc_marshal_windsor ######*/ @@ -325,7 +638,7 @@ bool GossipSelect_npc_dughal_stormwing(Player *player, Creature *_Creature, uint #define MOB_ENTRY_REGINALD_WINDSOR 9682 Player* PlayerStart; - +/* struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI { npc_marshal_windsorAI(Creature *c) : npc_escortAI(c) @@ -354,7 +667,7 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); break; case 13: - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);/*EMOTE_STATE_WORK*/ + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK break; case 14: pInstance->SetData(DATA_GATE_SR,0); @@ -364,7 +677,7 @@ struct TRINITY_DLL_DECL npc_marshal_windsorAI : public npc_escortAI m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); break; case 17: - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);/*EMOTE_STATE_WORK*/ + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK break; case 18: pInstance->SetData(DATA_GATE_SC,0); @@ -468,7 +781,7 @@ bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest c } return false; } - + */ /*###### ## npc_marshal_reginald_windsor ######*/ @@ -491,7 +804,7 @@ bool QuestAccept_npc_marshal_windsor(Player *player, Creature *creature, Quest c #define MOB_ENTRY_CREST_KILLER 9680 int wp = 0; - +/* struct TRINITY_DLL_DECL npc_marshal_reginald_windsorAI : public npc_escortAI { npc_marshal_reginald_windsorAI(Creature *c) : npc_escortAI(c) @@ -681,13 +994,13 @@ CreatureAI* GetAI_npc_marshal_reginald_windsor(Creature *_Creature) return (CreatureAI*)marshal_reginald_windsorAI; } - +*/ /*###### ## npc_tobias_seecher ######*/ #define SAY_TOBIAS_FREE "Thank you! I will run for safety immediately!" - +/* struct TRINITY_DLL_DECL npc_tobias_seecherAI : public npc_escortAI { npc_tobias_seecherAI(Creature *c) :npc_escortAI(c) {Reset();} @@ -775,6 +1088,172 @@ bool GossipSelect_npc_tobias_seecher(Player *player, Creature *_Creature, uint32 } return true; } +*/ + +/*###### +## npc_rocknot +######*/ + +#define SAY_GOT_BEER -1230000 +#define SPELL_DRUNKEN_RAGE 14872 +#define QUEST_ALE 4295 + +float BarWpLocations[8][3]= +{ + {883.294861, -188.926300, -43.703655}, + {872.763550, -185.605621, -43.703655}, //b1 + {867.923401, -188.006393, -43.703655}, //b2 + {863.295898, -190.795212, -43.703655}, //b3 + {856.139587, -194.652756, -43.703655}, //b4 + {851.878906, -196.928131, -43.703655}, //b5 + {877.035217, -187.048080, -43.703655}, + {891.198000, -197.924000, -43.620400} //home +}; + +uint32 BarWpWait[8]= +{ + 0, + 5000, + 5000, + 5000, + 5000, + 15000, + 0, + 0 +}; + +struct TRINITY_DLL_DECL npc_rocknotAI : public npc_escortAI +{ + npc_rocknotAI(Creature *c) : npc_escortAI(c) + { + pInstance = ((ScriptedInstance*)c->GetInstanceData()); + Reset(); + } + + ScriptedInstance* pInstance; + + uint32 BreakKeg_Timer; + uint32 BreakDoor_Timer; + + void Reset() + { + if (IsBeingEscorted) + return; + + BreakKeg_Timer = 0; + BreakDoor_Timer = 0; + } + + void Aggro(Unit *who) { } + + void DoGo(uint32 id, uint32 state) + { + if (GameObject *go = GameObject::GetGameObject(*m_creature,pInstance->GetData64(id))) + go->SetGoState(state); + } + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch(i) + { + case 1: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 3: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 4: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + BreakKeg_Timer = 2000; + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (BreakKeg_Timer) + { + if (BreakKeg_Timer <= diff) + { + DoGo(DATA_GO_BAR_KEG,0); + BreakKeg_Timer = 0; + BreakDoor_Timer = 1000; + }else BreakKeg_Timer -= diff; + } + + if (BreakDoor_Timer) + { + if (BreakDoor_Timer <= diff) + { + DoGo(DATA_GO_BAR_DOOR,2); + DoGo(DATA_GO_BAR_KEG_TRAP,0); //doesn't work very well, leaving code here for future + //spell by trap has effect61, this indicate the bar go hostile + + if (Unit *tmp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_PHALANX))) + tmp->setFaction(14); + + //for later, this event(s) has alot more to it. + //optionally, DONE can trigger bar to go hostile. + pInstance->SetData(TYPE_BAR,DONE); + + BreakDoor_Timer = 0; + }else BreakDoor_Timer -= diff; + } + + npc_escortAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_npc_rocknot(Creature *_Creature) +{ + npc_rocknotAI* Rocknot_AI = new npc_rocknotAI(_Creature); + + for(uint8 i = 0; i < 8; ++i) + Rocknot_AI->AddWaypoint(i, BarWpLocations[i][0], BarWpLocations[i][1], BarWpLocations[i][2], BarWpWait[i]); + + return (CreatureAI*)Rocknot_AI; +} + +bool ChooseReward_npc_rocknot(Player *player, Creature *_Creature, const Quest *_Quest, uint32 item) +{ + ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + + if (!pInstance) + return true; + + if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL) + return true; + + if (_Quest->GetQuestId() == QUEST_ALE) + { + if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS) + pInstance->SetData(TYPE_BAR,IN_PROGRESS); + + pInstance->SetData(TYPE_BAR,SPECIAL); + + //keep track of amount in instance script, returns SPECIAL if amount ok and event in progress + if (pInstance->GetData(TYPE_BAR) == SPECIAL) + { + DoScriptText(SAY_GOT_BEER, _Creature); + _Creature->CastSpell(_Creature,SPELL_DRUNKEN_RAGE,false); + ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); + } + } + + return true; +} /*###### ## @@ -784,6 +1263,16 @@ void AddSC_blackrock_depths() { Script *newscript; + newscript = new Script; + newscript->Name = "at_ring_of_law"; + newscript->pAreaTrigger = &AreaTrigger_at_ring_of_law; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_grimstone"; + newscript->GetAI = &GetAI_npc_grimstone; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name="phalanx"; newscript->GetAI = &GetAI_mob_phalanx; @@ -800,7 +1289,7 @@ void AddSC_blackrock_depths() newscript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer; newscript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer; newscript->RegisterSelf(); - +/* newscript = new Script; newscript->Name="npc_dughal_stormwing"; newscript->pGossipHello = &GossipHello_npc_dughal_stormwing; @@ -824,5 +1313,11 @@ void AddSC_blackrock_depths() newscript = new Script; newscript->Name="npc_marshal_reginald_windsor"; newscript->GetAI = &GetAI_npc_marshal_reginald_windsor; - newscript->RegisterSelf(); + newscript->RegisterSelf();*/ + + newscript = new Script; + newscript->Name = "npc_rocknot"; + newscript->GetAI = &GetAI_npc_rocknot; + newscript->pChooseReward = &ChooseReward_npc_rocknot; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp deleted file mode 100644 index 4cc3a8cc424..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_angerrel.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Angerrel -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SUNDERARMOR 24317 -#define SPELL_SHIELDBLOCK 12169 -#define SPELL_STRIKE 15580 - -struct TRINITY_DLL_DECL boss_angerrelAI : public ScriptedAI -{ - boss_angerrelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 SunderArmor_Timer; - uint32 ShieldBlock_Timer; - uint32 Strike_Timer; - - void Reset() - { - SunderArmor_Timer = 8000; - ShieldBlock_Timer = 15000; - Strike_Timer = 12000; - } - - void Aggro(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //SunderArmor_Timer - if (SunderArmor_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR); - SunderArmor_Timer = 28000; - }else SunderArmor_Timer -= diff; - - //ShieldBlock_Timer - if (ShieldBlock_Timer < diff) - { - DoCast(m_creature,SPELL_SHIELDBLOCK); - ShieldBlock_Timer = 25000; - }else ShieldBlock_Timer -= diff; - - //Strike_Timer - if (Strike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STRIKE); - Strike_Timer = 10000; - }else Strike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_angerrel(Creature *_Creature) -{ - return new boss_angerrelAI (_Creature); -} - -void AddSC_boss_angerrel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_angerrel"; - newscript->GetAI = &GetAI_boss_angerrel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp deleted file mode 100644 index 216321a5762..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doomrel.cpp +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Doomrel -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SHADOWBOLTVOLLEY 17228 -#define SPELL_IMMOLATE 15505 -#define SPELL_CURSEOFWEAKNESS 17227 -#define SPELL_DEMONARMOR 11735 - -struct TRINITY_DLL_DECL boss_doomrelAI : public ScriptedAI -{ - boss_doomrelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 ShadowVolley_Timer; - uint32 Immolate_Timer; - uint32 CurseOfWeakness_Timer; - uint32 DemonArmor_Timer; - bool Voidwalkers; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - void Reset() - { - ShadowVolley_Timer = 10000; - Immolate_Timer = 18000; - CurseOfWeakness_Timer = 5000; - DemonArmor_Timer = 16000; - Voidwalkers = false; - } - - void Aggro(Unit *who) - { - } - - void SummonVoidwalkers(Unit* victim) - { - Rand = rand()%5; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%5; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(16119, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); - if(Summoned) - ((CreatureAI*)Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); - ShadowVolley_Timer = 12000; - }else ShadowVolley_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target)DoCast(target,SPELL_IMMOLATE); - Immolate_Timer = 25000; - }else Immolate_Timer -= diff; - - //CurseOfWeakness_Timer - if (CurseOfWeakness_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); - CurseOfWeakness_Timer = 45000; - }else CurseOfWeakness_Timer -= diff; - - //DemonArmor_Timer - if (DemonArmor_Timer < diff) - { - DoCast(m_creature,SPELL_DEMONARMOR); - DemonArmor_Timer = 300000; - }else DemonArmor_Timer -= diff; - - //Summon Voidwalkers - if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51 ) - { - SummonVoidwalkers(m_creature->getVictim()); - SummonVoidwalkers(m_creature->getVictim()); - SummonVoidwalkers(m_creature->getVictim()); - Voidwalkers = true; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_doomrel(Creature *_Creature) -{ - return new boss_doomrelAI (_Creature); -} - -void AddSC_boss_doomrel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_doomrel"; - newscript->GetAI = &GetAI_boss_doomrel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp deleted file mode 100644 index bfecf682764..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_doperel.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Doperel -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SINISTERSTRIKE 15581 -#define SPELL_BACKSTAB 15582 -#define SPELL_GOUGE 13579 - -struct TRINITY_DLL_DECL boss_doperelAI : public ScriptedAI -{ - boss_doperelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 SinisterStrike_Timer; - uint32 BackStab_Timer; - uint32 Gouge_Timer; - - void Reset() - { - SinisterStrike_Timer = 8000; - BackStab_Timer = 12000; - Gouge_Timer = 6000; - } - - void Aggro(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //SinisterStrike_Timer - if (SinisterStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE); - SinisterStrike_Timer = 7000; - }else SinisterStrike_Timer -= diff; - - //BackStab_Timer - if (BackStab_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BACKSTAB); - BackStab_Timer = 6000; - }else BackStab_Timer -= diff; - - //Gouge_Timer - if (Gouge_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GOUGE); - Gouge_Timer = 8000; - }else Gouge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_doperel(Creature *_Creature) -{ - return new boss_doperelAI (_Creature); -} - -void AddSC_boss_doperel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_doperel"; - newscript->GetAI = &GetAI_boss_doperel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp deleted file mode 100644 index 1c426688d47..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gloomrel.cpp +++ /dev/null @@ -1,142 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gloomrel -SD%Complete: 80 -SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Missing event and re-spawn GO Spectral Chalice -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_HAMSTRING 9080 -#define SPELL_CLEAVE 15579 -#define SPELL_MORTALSTRIKE 15708 - -struct TRINITY_DLL_DECL boss_gloomrelAI : public ScriptedAI -{ - boss_gloomrelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 HamString_Timer; - uint32 Cleave_Timer; - uint32 MortalStrike_Timer; - - void Reset() - { - HamString_Timer = 19000; - Cleave_Timer = 6000; - MortalStrike_Timer = 10000; - - m_creature->setFaction(734); - } - - void Aggro(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //HamString_Timer - if (HamString_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMSTRING); - HamString_Timer = 14000; - }else HamString_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 8000; - }else Cleave_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); - MortalStrike_Timer = 12000; - }else MortalStrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gloomrel(Creature *_Creature) -{ - return new boss_gloomrelAI (_Creature); -} - -bool GossipHello_boss_gloomrel(Player *player, Creature *_Creature) -{ - if (player->GetQuestRewardStatus(4083) == 1 && player->GetSkillValue(SKILL_MINING) >= 230 && !player->HasSpell(14891) ) - player->ADD_GOSSIP_ITEM(0, "Teach me the art of smelting dark iron", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetQuestRewardStatus(4083) == 0 && player->GetSkillValue(SKILL_MINING) >= 230) - player->ADD_GOSSIP_ITEM(0, "I want to pay tribute", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->ADD_GOSSIP_ITEM(0, "Challenge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - player->SEND_GOSSIP_MENU(2602, _Creature->GetGUID()); - - return true; -} - -bool GossipSelect_boss_gloomrel(Player *player, Creature *_Creature, uint32 sender, uint32 action ) -{ - switch (action) - { - case GOSSIP_ACTION_INFO_DEF+1: - player->ADD_GOSSIP_ITEM( 0, "Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); - player->SEND_GOSSIP_MENU(2606, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+11: - player->CLOSE_GOSSIP_MENU(); - _Creature->CastSpell(player, 14894, false); - break; - case GOSSIP_ACTION_INFO_DEF+2: - player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); - player->SEND_GOSSIP_MENU(2604, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+22: - player->CLOSE_GOSSIP_MENU(); - //re-spawn object here - break; - case GOSSIP_ACTION_INFO_DEF+3: - player->ADD_GOSSIP_ITEM( 0, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 33); - player->SEND_GOSSIP_MENU(2605, _Creature->GetGUID()); - break; - case GOSSIP_ACTION_INFO_DEF+33: - player->CLOSE_GOSSIP_MENU(); - //start event here, below code just temporary - _Creature->setFaction(754); - break; - } - return true; -} - -void AddSC_boss_gloomrel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gloomrel"; - newscript->GetAI = &GetAI_boss_gloomrel; - newscript->pGossipHello = &GossipHello_boss_gloomrel; - newscript->pGossipSelect = &GossipSelect_boss_gloomrel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp deleted file mode 100644 index 640f528706f..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_haterel.cpp +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Haterel -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SHADOWBOLT 17483 //Not sure if right ID -#define SPELL_MANABURN 10876 -#define SPELL_SHADOWSHIELD 22417 -#define SPELL_STRIKE 15580 - -struct TRINITY_DLL_DECL boss_haterelAI : public ScriptedAI -{ - boss_haterelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 ShadowBolt_Timer; - uint32 ManaBurn_Timer; - uint32 ShadowShield_Timer; - uint32 Strike_Timer; - - void Reset() - { - ShadowBolt_Timer = 15000; - ManaBurn_Timer = 3000; - ShadowShield_Timer = 8000; - Strike_Timer = 12000; - } - - void Aggro(Unit *who) - { - } - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //ShadowBolt_Timer - if (ShadowBolt_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_SHADOWBOLT); - ShadowBolt_Timer = 7000; - }else ShadowBolt_Timer -= diff; - - //ManaBurn_Timer - if (ManaBurn_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_MANABURN); - ManaBurn_Timer = 13000; - }else ManaBurn_Timer -= diff; - - //ShadowShield_Timer - if (ShadowShield_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWSHIELD); - ShadowShield_Timer = 25000; - }else ShadowShield_Timer -= diff; - - //Strike_Timer - if (Strike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STRIKE); - Strike_Timer = 10000; - }else Strike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_haterel(Creature *_Creature) -{ - return new boss_haterelAI (_Creature); -} - -void AddSC_boss_haterel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_haterel"; - newscript->GetAI = &GetAI_boss_haterel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp deleted file mode 100644 index 4d6d6ea3916..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_seethrel.cpp +++ /dev/null @@ -1,115 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Seethrel -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FROSTBOLT 16799 -#define SPELL_FROSTARMOR 15784 //This is actually a buff he gives himself -#define SPELL_BLIZZARD 19099 -#define SPELL_FROSTNOVA 15063 -#define SPELL_FROSTWARD 15004 - -struct TRINITY_DLL_DECL boss_seethrelAI : public ScriptedAI -{ - boss_seethrelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 FrostArmor_Timer; - uint32 Frostbolt_Timer; - uint32 Blizzard_Timer; - uint32 FrostNova_Timer; - uint32 FrostWard_Timer; - - void Reset() - { - FrostArmor_Timer = 2000; - Frostbolt_Timer = 6000; - Blizzard_Timer = 18000; - FrostNova_Timer = 12000; - FrostWard_Timer = 25000; - - m_creature->CastSpell(m_creature,SPELL_FROSTARMOR,true); - } - - void Aggro(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //FrostArmor_Timer - if (FrostArmor_Timer < diff) - { - DoCast(m_creature, SPELL_FROSTARMOR); - FrostArmor_Timer = 180000; - }else FrostArmor_Timer -= diff; - - //Frostbolt_Timer - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 15000; - }else Frostbolt_Timer -= diff; - - //Blizzard_Timer - if (Blizzard_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_BLIZZARD); - Blizzard_Timer = 22000; - }else Blizzard_Timer -= diff; - - //FrostNova_Timer - if (FrostNova_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTNOVA); - FrostNova_Timer = 14000; - }else FrostNova_Timer -= diff; - - //FrostWard_Timer - if (FrostWard_Timer < diff) - { - DoCast(m_creature,SPELL_FROSTWARD); - FrostWard_Timer = 68000; - }else FrostWard_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_seethrel(Creature *_Creature) -{ - return new boss_seethrelAI (_Creature); -} - -void AddSC_boss_seethrel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_seethrel"; - newscript->GetAI = &GetAI_boss_seethrel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp deleted file mode 100644 index 962b243ff28..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_vilerel.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Vilerel -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_MINDBLAST 15587 -#define SPELL_HEAL 15586 -#define SPELL_PRAYEROFHEALING 15585 -#define SPELL_SHIELD 10901 - -struct TRINITY_DLL_DECL boss_vilerelAI : public ScriptedAI -{ - boss_vilerelAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 MindBlast_Timer; - uint32 Heal_Timer; - uint32 PrayerOfHealing_Timer; - uint32 Shield_Timer; - - void Reset() - { - MindBlast_Timer = 10000; - Heal_Timer = 35000; - PrayerOfHealing_Timer = 25000; - Shield_Timer = 3000; - } - - void Aggro(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!m_creature->SelectHostilTarget() || !m_creature->getVictim() ) - return; - - //MindBlast_Timer - if (MindBlast_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MINDBLAST); - MindBlast_Timer = 7000; - }else MindBlast_Timer -= diff; - - //Heal_Timer - if (Heal_Timer < diff) - { - DoCast(m_creature,SPELL_HEAL); - Heal_Timer = 20000; - }else Heal_Timer -= diff; - - //PrayerOfHealing_Timer - if (PrayerOfHealing_Timer < diff) - { - DoCast(m_creature,SPELL_PRAYEROFHEALING); - PrayerOfHealing_Timer = 30000; - }else PrayerOfHealing_Timer -= diff; - - //Shield_Timer - if (Shield_Timer < diff) - { - DoCast(m_creature,SPELL_SHIELD); - Shield_Timer = 30000; - }else Shield_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_vilerel(Creature *_Creature) -{ - return new boss_vilerelAI (_Creature); -} - -void AddSC_boss_vilerel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_vilerel"; - newscript->GetAI = &GetAI_boss_vilerel; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h b/src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h index f6da69c8044..1a7f8962752 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h @@ -1,35 +1,26 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLACKROCK_DEPTHS_H -#define DEF_BLACKROCK_DEPTHS_H - -#define DATA_DUGHAL 0 -#define DATA_SUPPLY_ROOM 1 -#define DATA_JAZ 2 -#define DATA_SHILL 3 -#define DATA_CREST 4 -#define DATA_TOBIAS 5 -#define DATA_QUEST_JAIL_BREAK 6 - -#define ENCOUNTER_STATE_NOT_STARTED 100 -#define ENCOUNTER_STATE_BEFORE_START 101 -#define ENCOUNTER_STATE_IN_PROGRESS 102 -#define ENCOUNTER_STATE_OBJECTIVE_COMPLETED 103 -#define ENCOUNTER_STATE_ENDED 104 -#define ENCOUNTER_STATE_FAILED 105 - -#define DATA_GATE_D 111 -#define DATA_GATE_SR 112 -#define DATA_GATE_J 113 -#define DATA_GATE_S 114 -#define DATA_GATE_C 115 -#define DATA_GATE_T 116 -#define DATA_GATE_SC 117 -#define DATA_CREATURE_JAZ 118 -#define DATA_CREATURE_OGRABISI 119 -#define DATA_CREATURE_CREST 120 -#define DATA_CREATURE_SHILL 121 - +/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BRD_H +#define DEF_BRD_H + +#define TYPE_RING_OF_LAW 1 +#define TYPE_VAULT 2 +#define TYPE_BAR 3 +#define TYPE_TOMB_OF_SEVEN 4 +#define TYPE_LYCEUM 5 +#define TYPE_IRON_HALL 6 + +#define DATA_EMPEROR 10 +#define DATA_PHALANX 11 + +#define DATA_ARENA1 12 +#define DATA_ARENA2 13 +#define DATA_ARENA3 14 +#define DATA_ARENA4 15 + +#define DATA_GO_BAR_KEG 16 +#define DATA_GO_BAR_KEG_TRAP 17 +#define DATA_GO_BAR_DOOR 18 #endif
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp index aa89d902573..8a45955c706 100644 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp @@ -32,209 +32,276 @@ update `instance_template` set `script`='instance_blackrock_depths' where `map`= #include "precompiled.h" #include "def_blackrock_depths.h" -#define ENCOUNTERS 7 - +#define ENCOUNTERS 6 + +#define C_EMPEROR 9019 +#define C_PHALANX 9502 + +#define GO_ARENA1 161525 +#define GO_ARENA2 161522 +#define GO_ARENA3 161524 +#define GO_ARENA4 161523 +#define GO_SHADOW_LOCK 161460 +#define GO_SHADOW_MECHANISM 161461 +#define GO_SHADOW_GIANT_DOOR 157923 +#define GO_SHADOW_DUMMY 161516 +#define GO_BAR_KEG_SHOT 170607 +#define GO_BAR_KEG_TRAP 171941 +#define GO_BAR_DOOR 170571 +#define GO_TOMB_ENTER 170576 +#define GO_TOMB_EXIT 170577 +#define GO_LYCEUM 170558 +#define GO_GOLEM_ROOM_N 170573 +#define GO_GOLEM_ROOM_S 170574 +#define GO_THONE_ROOM 170575 + struct TRINITY_DLL_DECL instance_blackrock_depths : public ScriptedInstance { instance_blackrock_depths(Map *map) : ScriptedInstance(map) {Initialize();}; + + uint32 Encounter[ENCOUNTERS]; + std::string str_data; + + uint64 EmperorGUID; + uint64 PhalanxGUID; + + uint64 GoArena1GUID; + uint64 GoArena2GUID; + uint64 GoArena3GUID; + uint64 GoArena4GUID; + uint64 GoShadowLockGUID; + uint64 GoShadowMechGUID; + uint64 GoShadowGiantGUID; + uint64 GoShadowDummyGUID; + uint64 GoBarKegGUID; + uint64 GoBarKegTrapGUID; + uint64 GoBarDoorGUID; + uint64 GoTombEnterGUID; + uint64 GoTombExitGUID; + uint64 GoLyceumGUID; + uint64 GoGolemNGUID; + uint64 GoGolemSGUID; + uint64 GoThoneGUID; - uint64 GateDughal; - uint64 SupplyRoomGate; - uint64 GateJaz; - uint64 GateShill; - uint64 GateCrest; - uint64 GateTobias; - uint64 SupplyCrate; - - uint64 Jaz; - uint64 Ograbisi; - uint64 ShillDinger; - uint64 CrestKiller; - - uint32 state; - - bool Encounters[ENCOUNTERS]; - + uint32 BarAleCount; + void Initialize() - { - - GateDughal = 0; - SupplyRoomGate = 0; - GateJaz = 0; - GateShill = 0; - GateCrest = 0; - GateTobias = 0; - SupplyCrate = 0; - - Jaz = 0; - Ograbisi = 0; - ShillDinger = 0; - CrestKiller = 0; + { + EmperorGUID = 0; + PhalanxGUID = 0; - state = 0; + GoArena1GUID = 0; + GoArena2GUID = 0; + GoArena3GUID = 0; + GoArena4GUID = 0; + GoShadowLockGUID = 0; + GoShadowMechGUID = 0; + GoShadowGiantGUID = 0; + GoShadowDummyGUID = 0; + GoBarKegGUID = 0; + GoBarKegTrapGUID = 0; + GoBarDoorGUID = 0; + GoTombEnterGUID = 0; + GoTombExitGUID = 0; + GoLyceumGUID = 0; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThoneGUID = 0; + BarAleCount = 0; + for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounters[i] = false; - } - - bool IsEncounterInProgress() const + Encounter[i] = NOT_STARTED; + } + + Player* GetPlayerInMap() { - for(uint8 i = 0; i < ENCOUNTERS; i++) - if(Encounters[i]) return true; - - return false; - } - - void OpenGO(uint64 DoorGUID, bool open) - { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetGoState(open ? 0 : 1); - } + Map::PlayerList const& players = instance->GetPlayers(); - void CloseGO(uint64 DoorGUID, bool close) - { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetGoState(close ? 1 : 0); - } + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Blackrock Depths: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + switch(creature->GetEntry()) + { + case C_EMPEROR: EmperorGUID = creature->GetGUID(); break; + case C_PHALANX: PhalanxGUID = creature->GetGUID(); break; + } + } - uint32 GetData(uint32 type) + void OnObjectCreate(GameObject* go) + { + switch(go->GetEntry()) + { + case GO_ARENA1: GoArena1GUID = go->GetGUID(); break; + case GO_ARENA2: GoArena2GUID = go->GetGUID(); break; + case GO_ARENA3: GoArena3GUID = go->GetGUID(); break; + case GO_ARENA4: GoArena4GUID = go->GetGUID(); break; + case GO_SHADOW_LOCK: GoShadowLockGUID = go->GetGUID(); break; + case GO_SHADOW_MECHANISM: GoShadowMechGUID = go->GetGUID(); break; + case GO_SHADOW_GIANT_DOOR: GoShadowGiantGUID = go->GetGUID(); break; + case GO_SHADOW_DUMMY: GoShadowDummyGUID = go->GetGUID(); break; + case GO_BAR_KEG_SHOT: GoBarKegGUID = go->GetGUID(); break; + case GO_BAR_KEG_TRAP: GoBarKegTrapGUID = go->GetGUID(); break; + case GO_BAR_DOOR: GoBarDoorGUID = go->GetGUID(); break; + case GO_TOMB_ENTER: GoTombEnterGUID = go->GetGUID(); break; + case GO_TOMB_EXIT: GoTombExitGUID = go->GetGUID(); break; + case GO_LYCEUM: GoLyceumGUID = go->GetGUID(); break; + case GO_GOLEM_ROOM_N: GoGolemNGUID = go->GetGUID(); break; + case GO_GOLEM_ROOM_S: GoGolemSGUID = go->GetGUID(); break; + case GO_THONE_ROOM: GoThoneGUID = go->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) { + Player *player = GetPlayerInMap(); + + if (!player) + { + debug_log("SD2: Instance Blackrock Depths: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } + + debug_log("SD2: Instance Blackrock Depths: SetData update (Type: %u Data %u)", type, data); + switch(type) { - case DATA_DUGHAL: return Encounters[0];break; - case DATA_SUPPLY_ROOM: return Encounters[1];break; - case DATA_JAZ: return Encounters[2];break; - case DATA_SHILL: return Encounters[3];break; - case DATA_CREST: return Encounters[4];break; - case DATA_TOBIAS: return Encounters[5];break; - case DATA_QUEST_JAIL_BREAK: return Encounters[6];break; - case DATA_GATE_D: return GateDughal; break; - case DATA_GATE_T: return GateTobias; break; - case DATA_GATE_C: return GateCrest; break; - case DATA_GATE_J: return GateJaz; break; - case DATA_GATE_S: return GateShill; break; - case DATA_CREATURE_JAZ: - if((((Creature*)Jaz)->isDead())) - state = 1; - else - state = 0; + case TYPE_RING_OF_LAW: + Encounter[0] = data; break; - case DATA_CREATURE_OGRABISI: - if((((Creature*)Ograbisi)->isDead())) - state = 1; - else - state = 0; + case TYPE_VAULT: + Encounter[1] = data; break; - case DATA_CREATURE_CREST: - if((((Creature*)CrestKiller)->isDead())) - state = 1; + case TYPE_BAR: + if (data == SPECIAL) + ++BarAleCount; else - state = 0; + Encounter[2] = data; break; - case DATA_CREATURE_SHILL: - if((((Creature*)ShillDinger)->isDead())) - state = 1; - else - state = 0; + case TYPE_TOMB_OF_SEVEN: + Encounter[3] = data; + break; + case TYPE_LYCEUM: + Encounter[4] = data; + break; + case TYPE_IRON_HALL: + Encounter[5] = data; break; } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " + << Encounter[3] << " " << Encounter[4] << " " << Encounter[5]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_RING_OF_LAW: + return Encounter[0]; + case TYPE_VAULT: + return Encounter[1]; + case TYPE_BAR: + if (Encounter[2] == IN_PROGRESS && BarAleCount == 3) + return SPECIAL; + else + return Encounter[2]; + case TYPE_TOMB_OF_SEVEN: + return Encounter[3]; + case TYPE_LYCEUM: + return Encounter[4]; + case TYPE_IRON_HALL: + return Encounter[5]; + } return 0; } - - void OnObjectCreate(GameObject *go) + + uint64 GetData64(uint32 data) { - switch(go->GetEntry()) + switch(data) { - case 170561: SupplyRoomGate = go->GetGUID(); state = go->GetGoState(); break; - case 170562: GateDughal = go->GetGUID(); state = go->GetGoState(); break; - case 170566: GateTobias = go->GetGUID(); state = go->GetGoState(); break; - case 170567: GateCrest = go->GetGUID(); state = go->GetGoState(); break; - case 170568: GateJaz = go->GetGUID(); state = go->GetGoState(); break; - case 170569: GateShill = go->GetGUID(); state = go->GetGoState(); break; - case 166872: SupplyCrate = go->GetGUID(); state = go->GetGoState(); break; + case DATA_EMPEROR: + return EmperorGUID; + case DATA_PHALANX: + return PhalanxGUID; + case DATA_ARENA1: + return GoArena1GUID; + case DATA_ARENA2: + return GoArena2GUID; + case DATA_ARENA3: + return GoArena3GUID; + case DATA_ARENA4: + return GoArena4GUID; + case DATA_GO_BAR_KEG: + return GoBarKegGUID; + case DATA_GO_BAR_KEG_TRAP: + return GoBarKegTrapGUID; + case DATA_GO_BAR_DOOR: + return GoBarDoorGUID; } + return 0; } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) + + const char* Save() { - switch(creature_entry) - { - case 9680: CrestKiller = creature->GetGUID(); break; - case 9677: Ograbisi = creature->GetGUID(); break; - case 9681: Jaz = creature->GetGUID(); break; - case 9678: ShillDinger = creature->GetGUID(); break; - } + return str_data.c_str(); } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_DUGHAL: Encounters[0] = data; break; - case DATA_SUPPLY_ROOM: Encounters[1] = data; break; - case DATA_JAZ: Encounters[2] = data; break; - case DATA_SHILL: Encounters[3] = data; break; - case DATA_CREST: Encounters[4] = data; break; - case DATA_TOBIAS: Encounters[5] = data; break; - case DATA_QUEST_JAIL_BREAK: Encounters[6] = data; break; - case DATA_GATE_SR: - if(SupplyRoomGate) - { - if(data == NOT_STARTED) - OpenGO(SupplyRoomGate, true); - else - CloseGO(SupplyRoomGate, true); - } - break; - case DATA_GATE_SC: - if(SupplyCrate) - { - if(data == NOT_STARTED) - OpenGO(SupplyCrate, true); - else - CloseGO(SupplyCrate, true); - } - break; - case DATA_CREATURE_JAZ: - if(data) - { - (((Creature*)Jaz)->setFaction(54)); - (((Creature*)Ograbisi)->setFaction(54)); - (((Creature*)Ograbisi)->Say("Ograbisi needs new hat", LANG_UNIVERSAL, NULL)); - } - else - { - (((Creature*)Jaz)->setFaction(35)); - (((Creature*)Ograbisi)->setFaction(35)); - } - break; - case DATA_CREATURE_SHILL: - if(data) - (((Creature*)ShillDinger)->setFaction(54)); - else - (((Creature*)ShillDinger)->setFaction(35)); - break; - case DATA_CREATURE_CREST: - if(data) - (((Creature*)CrestKiller)->setFaction(54)); - else - (((Creature*)CrestKiller)->setFaction(35)); - break; - } - } + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3] + >> Encounter[4] >> Encounter[5]; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } }; - + InstanceData* GetInstanceData_instance_blackrock_depths(Map* map) { - return new instance_blackrock_depths(map); + return new instance_blackrock_depths(map); } - -void AddSC_instance_blackrock_depths() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blackrock_depths"; - newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths; - newscript->RegisterSelf(); -}
\ No newline at end of file + + void AddSC_instance_blackrock_depths() + { + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blackrock_depths"; + newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths; + newscript->RegisterSelf(); + }
\ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp index 53a013bed5a..cbb8ce53b91 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp @@ -230,13 +230,6 @@ void hyjalAI::StartEvent(Player* player) if(!player) return; - Map* Hyjal = m_creature->GetMap(); - if(Hyjal->GetPlayersCountExceptGMs() < 15) //check if there are more than 15 players in hyjal (abuse prevent) - { - //error_log("Some Players try to farm in Hyjal (less than 15 people)"); - return; - } - Talk(BEGIN); EventBegun = true; diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp index b7a7e666b92..e3a6f226dcd 100644 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -91,11 +91,16 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI } ScriptedInstance* pInstance; + Map::PlayerList const *PlayerList; uint32 TidalWave_Timer; uint32 WateryGrave_Timer; uint32 Earthquake_Timer; uint32 WateryGlobules_Timer; + uint32 SummonSpell; + uint32 globulespell[4]; + int8 Playercount; + int8 counter; bool Earthquake; bool Phase2; @@ -106,6 +111,10 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI WateryGrave_Timer = 30000; Earthquake_Timer = 40000; WateryGlobules_Timer = 0; + globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; + globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; + globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; + globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; Earthquake = false; Phase2 = false; @@ -126,9 +135,9 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI { switch(rand()%3) { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; } } @@ -139,17 +148,22 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI if (pInstance) pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); } - - void Aggro(Unit *who) { StartEvent(); } - - void ApplyWateryGrave(Unit *player, uint8 target) + + void Aggro(Unit *who) + { + PlayerList = &((InstanceMap*)m_creature->GetMap())->GetPlayers(); + Playercount = PlayerList->getSize(); + StartEvent(); + } + + void ApplyWateryGrave(Unit *player, uint8 i) { - switch(target) + switch(i) { - case 0: DoCast(player, SPELL_WATERY_GRAVE_1); break; - case 1: DoCast(player, SPELL_WATERY_GRAVE_2); break; - case 2: DoCast(player, SPELL_WATERY_GRAVE_3); break; - case 3: DoCast(player, SPELL_WATERY_GRAVE_4); break; + case 0: player->CastSpell(player, SPELL_WATERY_GRAVE_1, true); break; + case 1: player->CastSpell(player, SPELL_WATERY_GRAVE_2, true); break; + case 2: player->CastSpell(player, SPELL_WATERY_GRAVE_3, true); break; + case 3: player->CastSpell(player, SPELL_WATERY_GRAVE_4, true); break; } } @@ -176,28 +190,42 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI case 1: DoScriptText(SAY_SUMMON2, m_creature); break; } - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - //north - DoCast(target, SPELL_SUMMON_MURLOC_A6); - DoCast(target, SPELL_SUMMON_MURLOC_A7); - DoCast(target, SPELL_SUMMON_MURLOC_A8); - DoCast(target, SPELL_SUMMON_MURLOC_A9); - DoCast(target, SPELL_SUMMON_MURLOC_A10); - - //south - DoCast(target, SPELL_SUMMON_MURLOC_B6); - DoCast(target, SPELL_SUMMON_MURLOC_B7); - DoCast(target, SPELL_SUMMON_MURLOC_B8); - DoCast(target, SPELL_SUMMON_MURLOC_B9); - DoCast(target, SPELL_SUMMON_MURLOC_B10); + Unit* target; + using std::set; + set<int> SummonList; + set<int>::iterator itr; + + target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true); + m_creature->CastSpell(target, SummonSpell, false); + SummonSpell++; + + for (int8 i = 0; i < 9; i++) //bad hack + { //instead of casting 9 spell in one update + counter = 0; // selecet 9 players which cast our spells + do{target = SelectUnit(SELECT_TARGET_RANDOM, 0, 50, true); //check if player is already selected + if(counter > Playercount) + break; + if(target) itr = SummonList.find(target->GetGUID()); + counter++; + } while (itr != SummonList.end()); + + if(target){ + SummonList.insert(target->GetGUID()); + target->CastSpell(target, SummonSpell, false); //player cast on himself (this works) + } + SummonSpell++; + + if(SummonSpell > SPELL_SUMMON_MURLOC_B10) //reset all variables for earthquake + { + SummonSpell = SPELL_SUMMON_MURLOC_A6; + SummonList.clear(); + DoScriptText(EMOTE_EARTHQUAKE, m_creature); + Earthquake = false; + Earthquake_Timer = 40000+rand()%5000; + } } - DoScriptText(EMOTE_EARTHQUAKE, m_creature); - - Earthquake = false; - Earthquake_Timer = 40000+rand()%5000; - } - }else Earthquake_Timer -= diff; + } + }else Earthquake_Timer -= diff; //TidalWave_Timer if (TidalWave_Timer < diff) @@ -213,11 +241,21 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI { //Teleport 4 players under the waterfalls Unit *target; + using std::set; + set<int>list; + set<int>::iterator itr; for(uint8 i = 0; i < 4; i++) { - target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && (target->GetTypeId() == TYPEID_PLAYER) && !target->HasAura(SPELL_WATERY_GRAVE, 0) && target->IsWithinDistInMap(m_creature, 50)) - ApplyWateryGrave(target, i); + counter = 0; + do{target = SelectUnit(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + if(counter < Playercount) + break; + if(target) itr = list.find(target->GetGUID()); + counter++; + }while(itr != list.end()); + if(target){list.insert(target->GetGUID()); + ApplyWateryGrave(target, i); + } } switch(rand()%2) @@ -239,13 +277,22 @@ struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI //WateryGlobules_Timer if (WateryGlobules_Timer < diff) { - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_SUMMON_WATER_GLOBULE_1); - DoCast(target, SPELL_SUMMON_WATER_GLOBULE_2); - DoCast(target, SPELL_SUMMON_WATER_GLOBULE_3); - DoCast(target, SPELL_SUMMON_WATER_GLOBULE_4); - } + Unit* globuletarget; + using std::set; + set<int>globulelist; + set<int>::iterator itr; + for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD + { + counter = 0; + do {globuletarget = SelectUnit(SELECT_TARGET_RANDOM, 0,50,true); + if(globuletarget) itr = globulelist.find(globuletarget->GetGUID()); + if (counter > Playercount) + break; + counter++; + } while (itr != globulelist.end()); + if(globuletarget)globulelist.insert(globuletarget->GetGUID()); + globuletarget->CastSpell(globuletarget, globulespell[g], true); + } DoScriptText(EMOTE_WATERY_GLOBULES, m_creature); WateryGlobules_Timer = 25000; }else WateryGlobules_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp index 6350040cfe4..acef59df670 100644 --- a/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp +++ b/src/bindings/scripts/scripts/zone/ghostlands/ghostlands.cpp @@ -237,7 +237,7 @@ bool QuestAccept_npc_ranger_lilatha(Player* player, Creature* creature, Quest co { if (quest->GetQuestId() == QUEST_ESCAPE_FROM_THE_CATACOMBS) { - creature->setFaction(1603); + creature->setFaction(113); ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp index 2d70b503a77..45e95d1c407 100644 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp @@ -131,6 +131,7 @@ bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* que { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); DoScriptText(SAY_READY, creature, player); + creature->setFaction(113); } return true; diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp index 61aca9df2e3..5ae6ca9a583 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp @@ -31,36 +31,61 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance instance_shadowfang_keep(Map *map) : ScriptedInstance(map) {Initialize();}; uint32 Encounter[ENCOUNTERS]; + std::string str_data; - uint64 DoorCourtyard; - uint64 DoorSorcerer; - uint64 DoorArugal; + uint64 DoorCourtyardGUID; + uint64 DoorSorcererGUID; + uint64 DoorArugalGUID; void Initialize() { - DoorCourtyard = 0; - DoorSorcerer = 0; - DoorArugal = 0; + DoorCourtyardGUID = 0; + DoorSorcererGUID = 0; + DoorArugalGUID = 0; for(uint8 i=0; i < ENCOUNTERS; ++i) Encounter[i] = NOT_STARTED; } + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + debug_log("TSCR: Instance Shadowfang Keep: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + void OnObjectCreate(GameObject *go) { switch(go->GetEntry()) { - case 18895: DoorCourtyard = go->GetGUID(); break; - case 18972: DoorSorcerer = go->GetGUID(); break; - case 18971: DoorArugal = go->GetGUID(); break; + case 18895: DoorCourtyardGUID = go->GetGUID(); break; + case 18972: DoorSorcererGUID = go->GetGUID(); break; + case 18971: DoorArugalGUID = go->GetGUID(); break; } } - void OpenDoor(uint64 DoorGUID, bool open) - { - if(GameObject *Door = instance->GetGameObjectInMap(DoorGUID)) - Door->SetGoState(open ? 0 : 1); - } + void HandleGameObject(uint64 guid, uint32 state) + { + Player *player = GetPlayerInMap(); + + if (!player || !guid) + { + debug_log("SD2: Instance Shadowfang Keep: HandleGameObject fail"); + return; + } + + if (GameObject *go = GameObject::GetGameObject(*player,guid)) + go->SetGoState(state); + } void SetData(uint32 type, uint32 data) { @@ -68,7 +93,7 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance { case TYPE_FREE_NPC: if(data == DONE) - OpenDoor(DoorCourtyard, true); + HandleGameObject(DoorCourtyardGUID,0); Encounter[0] = data; break; case TYPE_RETHILGORE: @@ -76,15 +101,28 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance break; case TYPE_FENRUS: if(data == DONE) - OpenDoor(DoorSorcerer, true); + HandleGameObject(DoorSorcererGUID,0); Encounter[2] = data; break; case TYPE_NANDOS: if(data == DONE) - OpenDoor(DoorArugal, true); + HandleGameObject(DoorArugalGUID,0); Encounter[3] = data; break; } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << Encounter[0] << " " << Encounter[1] << " " << Encounter[2] << " " << Encounter[3]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } } uint32 GetData(uint32 type) @@ -103,6 +141,30 @@ struct TRINITY_DLL_DECL instance_shadowfang_keep : public ScriptedInstance return 0; } + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> Encounter[0] >> Encounter[1] >> Encounter[2] >> Encounter[3]; + + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } }; InstanceData* GetInstanceData_instance_shadowfang_keep(Map* map) diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp index 94d09998acc..471efff8c95 100644 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp @@ -84,8 +84,12 @@ CreatureAI* GetAI_npc_shadowfang_prisoner(Creature *_Creature) bool GossipHello_npc_shadowfang_prisoner(Player *player, Creature *_Creature) { ScriptedInstance* pInstance = ((ScriptedInstance*)_Creature->GetInstanceData()); + + if (!pInstance) + return false; - player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) + player->ADD_GOSSIP_ITEM( 0, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(), _Creature->GetGUID()); @@ -97,7 +101,7 @@ bool GossipSelect_npc_shadowfang_prisoner(Player *player, Creature *_Creature, u if (action == GOSSIP_ACTION_INFO_DEF+1) { player->CLOSE_GOSSIP_MENU(); - ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false, player->GetGUID()); + ((npc_escortAI*)(_Creature->AI()))->Start(false, false, false); } return true; } diff --git a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp index be29cf79f0e..38f84f5ca7a 100644 --- a/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/zone/shadowmoon_valley/shadowmoon_valley.cpp @@ -1271,7 +1271,7 @@ bool QuestAccept_npc_earthmender_wilda(Player* player, Creature* creature, Quest { if (quest->GetQuestId() == QUEST_ESCAPE_FROM_COILSKAR_CISTERN) { - creature->setFaction(1725); + creature->setFaction(113); ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); } return true; diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp index 2d8b4f7c31b..71dededae54 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp @@ -51,6 +51,11 @@ EndScriptData */ #define SPELL_BERSERK 26662 #define SPELL_DUAL_WIELD 42459 +#define FREEZING 45203 +#define FROST_BOLT 44843 +#define ENCAPSULATE 45665 +#define ENCAPSULATE_CHANELLING 45661 + struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI { boss_brutallusAI(Creature *c) : ScriptedAI(c) @@ -66,6 +71,9 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI uint32 StompTimer; uint32 BerserkTimer; + uint32 ConversationTimer; + bool Intro; + void Reset() { SlashTimer = 11000; @@ -73,11 +81,17 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI BurnTimer = 60000; BerserkTimer = 360000; m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + + if(pInstance) + pInstance->SetData(DATA_BRUTALLUS, NOT_STARTED); } void Aggro(Unit *who) { DoScriptText(YELL_AGGRO, m_creature); + + if(pInstance) + pInstance->SetData(DATA_BRUTALLUS, IN_PROGRESS); } void KilledUnit(Unit* victim) @@ -93,6 +107,9 @@ struct TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI void JustDied(Unit* Killer) { DoScriptText(YELL_DEATH, m_creature); + + if(pInstance) + pInstance->SetData(DATA_BRUTALLUS, DONE); } void UpdateAI(const uint32 diff) diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h index 4ded3e5f47d..95ff1f112bf 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h @@ -18,6 +18,7 @@ #define DATA_KALECGOS_HUMAN 7 #define DATA_SATHROVARR 8 #define DATA_BRUTALLUS 9 +#define DATA_MADRIGOSA 24 #define DATA_FELMYST 10 #define DATA_ALYTHESS 11 #define DATA_SACROLASH 12 diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp index f5772840c89..3de2c14e93a 100644 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp +++ b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp @@ -34,6 +34,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance uint64 Kalecgos_Human; uint64 Sathrovarr; uint64 Brutallus; + uint64 Madrigosa; uint64 Felmyst; uint64 Alythess; uint64 Sacrolash; @@ -58,6 +59,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance Kalecgos_Human = 0; Sathrovarr = 0; Brutallus = 0; + Madrigosa = 0; Felmyst = 0; Alythess = 0; Sacrolash = 0; @@ -100,6 +102,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance case 24891: Kalecgos_Human = creature->GetGUID(); break; case 24892: Sathrovarr = creature->GetGUID(); break; case 24882: Brutallus = creature->GetGUID(); break; + case 24895: Madrigosa = creature->GetGUID(); break; case 25038: Felmyst = creature->GetGUID(); break; case 25166: Alythess = creature->GetGUID(); break; case 25165: Sacrolash = creature->GetGUID(); break; @@ -147,6 +150,7 @@ struct TRINITY_DLL_DECL instance_sunwell_plateau : public ScriptedInstance case DATA_KALECGOS_HUMAN: return Kalecgos_Human; break; case DATA_SATHROVARR: return Sathrovarr; break; case DATA_BRUTALLUS: return Brutallus; break; + case DATA_MADRIGOSA: return Madrigosa; break; case DATA_FELMYST: return Felmyst; break; case DATA_ALYTHESS: return Alythess; break; case DATA_SACROLASH: return Sacrolash; break; diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp index 5f93ac2d5a0..d4433c7afe5 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp @@ -258,8 +258,6 @@ CreatureAI* GetAI_npc_millhouse_manastorm(Creature *_Creature) #define SPELL_TARGET_OMEGA 36852 #define SPELL_BUBBLE_VISUAL 36849 -#define GOBJECT_SHIELD 184802 - struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI { npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) @@ -360,7 +358,8 @@ struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI case 2: DoCast(m_creature,SPELL_TARGET_ALPHA); pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); - m_creature->SummonGameObject(GOBJECT_SHIELD, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()-0.5, m_creature->GetOrientation(), 0, 0, 0, 0, 0); + if (GameObject *Sphere = GameObject::GetGameObject(*m_creature,pInstance->GetData64(DATA_SPHERE_SHIELD))) + Sphere->SetGoState(1); break; case 3: DoCast(m_creature,SPELL_TARGET_BETA); diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp index 905f2361c55..823d35ed414 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -79,7 +79,8 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI void Reset() { - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + if(!Intro) + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); IsImage33 = false; IsImage66 = false; @@ -95,19 +96,13 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI void MoveInLineOfSight(Unit *who) { if(!Intro) - ScriptedAI::MoveInLineOfSight(who); + { + return; + } + ScriptedAI::MoveInLineOfSight(who); } - void AttackStart(Unit* who) - { - if(!Intro) - ScriptedAI::AttackStart(who); - } - - void Aggro(Unit *who) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - } + void Aggro(Unit *who) {} void JustDied(Unit* Killer) { @@ -129,11 +124,6 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI } } - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - void DoSplit(uint32 val) { if( m_creature->IsNonMeleeSpellCasted(false) ) @@ -149,7 +139,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI void UpdateAI(const uint32 diff) { - if( !Intro && !InCombat ) + if(!Intro) { if( !pInstance ) return; @@ -178,6 +168,7 @@ struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI Intro_Timer = 3000; break; case 3: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); Intro = true; break; } diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp index 2f52eef8c05..c7e832fd172 100644 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp @@ -120,7 +120,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI { target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); //18 yard radius minimum - if(target && target->GetDistance2d(m_creature) > 18) + if(target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && target->GetDistance2d(m_creature) > 18) target_list.push_back(target); target = NULL; } @@ -128,7 +128,7 @@ struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI target = *(target_list.begin()+rand()%target_list.size()); if (target) - DoCast(target, SPELL_ARCANE_ORB); + m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, true); ArcaneOrb_Timer = 3000; }else ArcaneOrb_Timer -= diff; diff --git a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp index 47ba4a33e1d..81268dd5cea 100644 --- a/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/zone/terokkar_forest/terokkar_forest.cpp @@ -441,6 +441,7 @@ bool QuestAccept_npc_isla_starmane(Player* player, Creature* creature, Quest con if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + creature->setFaction(113); } return true; } diff --git a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp index 6d230a49e3b..91b1e0ae3e5 100644 --- a/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/zone/thousand_needles/thousand_needles.cpp @@ -102,7 +102,7 @@ bool QuestAccept_npc_swiftmountain(Player* player, Creature* creature, Quest con ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); DoScriptText(SAY_READY, creature, player); // Change faction so mobs attack - creature->setFaction(775); + creature->setFaction(113); } return true; diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp index 6f3ca0149bb..72c283f9f32 100644 --- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp @@ -305,6 +305,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player); break; case 26: DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, player); + Completed = true; if(player) ((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature); break; @@ -313,7 +314,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) + if (PlayerGUID && !Completed) { Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); if (player && !Completed) @@ -332,7 +333,7 @@ bool QuestAccept_npc_kayra_longmane(Player* player, Creature* creature, Quest co if (quest->GetQuestId() == QUEST_EFU) { ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - creature->setFaction(775); + creature->setFaction(113); } return true; } diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 26e54d4d64a..a114d6b4de6 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -290,66 +290,6 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) GetPlayer()->HandleFallUnderMap(); } -/*void WorldSession::HandlePossessedMovement(WorldPacket& recv_data, MovementInfo& movementInfo, uint32& MovementFlags) -{ - // Whatever the client is controlling, it will send the GUID of the original player. - // If current player is controlling, it must be handled like the controlled player sent these opcodes - - Unit* pos_unit = GetPlayer()->GetCharm(); - - if (pos_unit->GetTypeId() == TYPEID_PLAYER && ((Player*)pos_unit)->GetDontMove()) - return; - - //Save movement flags - pos_unit->SetUnitMovementFlags(MovementFlags); - - // Remove possession if possessed unit enters a transport - if (MovementFlags & MOVEMENTFLAG_ONTRANSPORT) - { - GetPlayer()->RemovePossess(true); - return; - } - - recv_data.put<uint32>(5, getMSTime()); - WorldPacket data(recv_data.GetOpcode(), pos_unit->GetPackGUID().size()+recv_data.size()); - data.append(pos_unit->GetPackGUID()); - data.append(recv_data.contents(), recv_data.size()); - // Send the packet to self but not to the possessed player; for creatures the first bool is irrelevant - pos_unit->SendMessageToSet(&data, true, false); - - // Possessed is a player - if (pos_unit->GetTypeId() == TYPEID_PLAYER) - { - Player* plr = (Player*)pos_unit; - - if (recv_data.GetOpcode() == MSG_MOVE_FALL_LAND) - plr->HandleFallDamage(movementInfo); - - if(((MovementFlags & MOVEMENTFLAG_SWIMMING) != 0) != plr->IsInWater()) - { - // Now client not include swimming flag in case jumping under water - plr->SetInWater( !plr->IsInWater() || plr->GetBaseMap()->IsUnderWater(movementInfo.x, movementInfo.y, movementInfo.z) ); - } - - plr->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o, false); - plr->m_movementInfo = movementInfo; - - if(plr->isMovingOrTurning()) - plr->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH); - - if(movementInfo.z < -500.0f) - { - GetPlayer()->RemovePossess(false); - plr->HandleFallUnderMap(); - } - } - else // Possessed unit is a creature - { - Map* map = MapManager::Instance().GetMap(pos_unit->GetMapId(), pos_unit); - map->CreatureRelocation((Creature*)pos_unit, movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); - } -}*/ - void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) { sLog.outDebug("WORLD: Recvd %s (%u, 0x%X) opcode", LookupOpcodeName(recv_data.GetOpcode()), recv_data.GetOpcode(), recv_data.GetOpcode()); diff --git a/src/game/PointMovementGenerator.cpp b/src/game/PointMovementGenerator.cpp index 31b696bcd3b..bb37d7b9479 100644 --- a/src/game/PointMovementGenerator.cpp +++ b/src/game/PointMovementGenerator.cpp @@ -57,7 +57,7 @@ bool PointMovementGenerator<T>::Update(T &unit, const uint32 &diff) if(i_destinationHolder.HasArrived()) { - unit.StopMoving(); + //unit.StopMoving(); if(!unit.hasUnitState(UNIT_STAT_CHARGING)) MovementInform(unit); return false; diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index b57b2f3ff5f..390adcecab2 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4394,11 +4394,33 @@ uint8 Spell::CanCast(bool strict) case SPELL_AURA_FLY: { // not allow cast fly spells at old maps by players (all spells is self target) - if(m_caster->GetTypeId()==TYPEID_PLAYER) + if(m_caster->GetTypeId()==TYPEID_PLAYER && !((Player*)m_caster)->isGameMaster()) { uint32 v_map = GetVirtualMapForMapAndZone(m_caster->GetMapId(), m_caster->GetZoneId()); - if( !((Player*)m_caster)->isGameMaster() && v_map != 530 && !(v_map == 571 && ((Player*)m_caster)->HasSpell(54197))) - return SPELL_FAILED_NOT_HERE; + switch(v_map) + { + case 0: + case 1: + { + if (!sWorld.getConfig(CONFIG_FLYING_MOUNTS_AZEROTH)) + return SPELL_FAILED_NOT_HERE; + } break; + case 530: + { + if (!sWorld.getConfig(CONFIG_FLYING_MOUNTS_OUTLAND)) + return SPELL_FAILED_NOT_HERE; + } break; + case 571: + { + if(!((Player*)m_caster)->HasSpell(54197)) + return SPELL_FAILED_NOT_HERE; + } break; + default: + { + if (!sWorld.getConfig(CONFIG_FLYING_MOUNTS_OTHERS)) + return SPELL_FAILED_NOT_HERE; + } break; + } } break; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index f6bf10e5d62..39b881b9dcb 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -3698,7 +3698,8 @@ void Spell::EffectSummonGuardian(uint32 i) } // trigger - if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER /*m_spellInfo->Id == 40276*/) + if(!m_originalCaster || m_originalCaster->GetTypeId() != TYPEID_PLAYER + && !((Creature*)m_originalCaster)->isTotem()/*m_spellInfo->Id == 40276*/) { EffectSummonWild(i); return; @@ -6047,14 +6048,16 @@ void Spell::EffectKnockBack(uint32 i) float vsin = sin(m_caster->GetAngle(unitTarget)); float vcos = cos(m_caster->GetAngle(unitTarget)); + float speedxy = float(m_spellInfo->EffectMiscValue[i])/10; + float speedz = float(damage/-10); WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4)); data.append(unitTarget->GetPackGUID()); data << uint32(0); // Sequence data << float(vcos); // x direction data << float(vsin); // y direction - data << float(m_spellInfo->EffectMiscValue[i])/10; // Horizontal speed - data << float(damage/-10); // Z Movement speed (vertical) + data << float(speedxy); // Horizontal speed + data << float(speedz); // Z Movement speed (vertical) ((Player*)unitTarget)->GetSession()->SendPacket(&data); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 8d16842145a..093e5f03643 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -182,8 +182,12 @@ Unit::~Unit() if(m_charmInfo) delete m_charmInfo; - RemoveAllAuras(); - assert(m_Auras.begin() == m_Auras.end()); + if(m_uint32Values) + { + sLog.outDetail("Deconstruct Unit Entry = %u", GetEntry()); + if(m_scAuras.size()) + sLog.outError("Unit %u has sc auras during deconstruction", GetEntry()); + } } void Unit::Update( uint32 p_time ) @@ -297,6 +301,11 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, uint8 ty case 1: // stop packet SendMessageToSet( &data, true ); return; + case 2: // not used currently + data << float(0); // orientation + data << float(0); + data << float(0); + break; case 3: // not used currently data << uint64(0); // probably target guid break; @@ -3980,13 +3989,6 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) assert(!Aur->IsInUse()); Aur->ApplyModifier(false,true); Aur->_RemoveAura(); - delete Aur; - - if(caster_channeled) - RemoveAurasAtChanneledTarget (AurSpellInfo); - - if(statue) - statue->UnSummon(); if(mode != AURA_REMOVE_BY_STACK) { @@ -4002,6 +4004,14 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) } } + delete Aur; + + if(caster_channeled) + RemoveAurasAtChanneledTarget (AurSpellInfo); + + if(statue) + statue->UnSummon(); + // only way correctly remove all auras from list if( m_Auras.empty() ) i = m_Auras.end(); diff --git a/src/game/World.cpp b/src/game/World.cpp index 82821f44544..1e1ca227d1b 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -532,6 +532,11 @@ void World::LoadConfigSettings(bool reload) ///- Read other configuration items from the config file + ///- Do we allow flying mounts in Azeroth/Outland and others (others being instances, BGs, arenas)? + m_configs[CONFIG_FLYING_MOUNTS_AZEROTH] = sConfig.GetBoolDefault("FlyingMounts.Azeroth", false); + m_configs[CONFIG_FLYING_MOUNTS_OUTLAND] = sConfig.GetBoolDefault("FlyingMounts.Outland", true); + m_configs[CONFIG_FLYING_MOUNTS_OTHERS] = sConfig.GetBoolDefault("FlyingMounts.Others", false); + m_configs[CONFIG_COMPRESSION] = sConfig.GetIntDefault("Compression", 1); if(m_configs[CONFIG_COMPRESSION] < 1 || m_configs[CONFIG_COMPRESSION] > 9) { diff --git a/src/game/World.h b/src/game/World.h index c684ac11e96..119f4af63e9 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -193,6 +193,9 @@ enum WorldConfigs CONFIG_ARENA_SEASON_IN_PROGRESS, CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER, CONFIG_SKILL_MILLING, + CONFIG_FLYING_MOUNTS_AZEROTH, + CONFIG_FLYING_MOUNTS_OUTLAND, + CONFIG_FLYING_MOUNTS_OTHERS, CONFIG_MAX_WHO, CONFIG_BG_START_MUSIC, diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index a02a3db1761..0492a85a8f4 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -133,8 +133,12 @@ bool ChatHandler::HandleBuyErrorCommand(const char* args) bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/) { Unit *unit = getSelectedUnit(); + Player *player = NULL; if (!unit || (unit->GetTypeId() != TYPEID_PLAYER)) - unit = m_session->GetPlayer(); + player = m_session->GetPlayer(); + else + player = (Player*)unit; + if(!unit) unit = player; std::ifstream ifs("opcode.txt"); if(ifs.bad()) @@ -193,6 +197,14 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/) { data.append(unit->GetPackGUID()); } + else if(type == "myguid") + data.append(player->GetPackGUID()); + else if(type == "pos") + { + data << unit->GetPositionX(); + data << unit->GetPositionY(); + data << unit->GetPositionZ(); + } else { sLog.outDebug("Sending opcode: unknown type '%s'", type.c_str()); @@ -202,7 +214,7 @@ bool ChatHandler::HandleSendOpcodeCommand(const char* /*args*/) ifs.close(); sLog.outDebug("Sending opcode %u", data.GetOpcode()); data.hexlike(); - ((Player*)unit)->GetSession()->SendPacket(&data); + player->GetSession()->SendPacket(&data); PSendSysMessage(LANG_COMMAND_OPCODESENT, data.GetOpcode(), unit->GetName()); return true; } diff --git a/src/shared/Database/CMakeLists.txt b/src/shared/Database/CMakeLists.txt index a819a66dec7..78cc48436e7 100644 --- a/src/shared/Database/CMakeLists.txt +++ b/src/shared/Database/CMakeLists.txt @@ -13,7 +13,6 @@ SET(trinitydatabase_STAT_SRCS DatabasePostgre.h DatabaseSqlite.cpp DatabaseSqlite.h -#Brian likes men Field.cpp Field.h MySQLDelayThread.h diff --git a/src/shared/SystemConfig.h b/src/shared/SystemConfig.h index aeb38891c11..9e7fe3e3045 100644 --- a/src/shared/SystemConfig.h +++ b/src/shared/SystemConfig.h @@ -1,4 +1,4 @@ -/* +/* * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/> * * Copyright (C) 2008 Trinity <http://www.trinitycore.org/> @@ -25,7 +25,7 @@ #define TRINITY_SYSTEMCONFIG_H #include "Platform/Define.h" -#include "revision.h" //-----here u are ------ _REVISION is the magic key +#include "revision.h" #define _PACKAGENAME "TrinityCore " @@ -39,12 +39,12 @@ #if PLATFORM == PLATFORM_WINDOWS # ifdef _WIN64 -# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Win64," _ENDIAN_STRING ")" +# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Win64," _ENDIAN_STRING ")" # else -# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Win32," _ENDIAN_STRING ")" +# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Win32," _ENDIAN_STRING ")" # endif #else -# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " (Unix," _ENDIAN_STRING ")" +# define _FULLVERSION _PACKAGENAME "Rev: " _REVISION " Hash: " _HASH " (Unix," _ENDIAN_STRING ")" #endif #define DEFAULT_PLAYER_LIMIT 100 diff --git a/src/shared/revision.h b/src/shared/revision.h new file mode 100644 index 00000000000..e2fa39e47fd --- /dev/null +++ b/src/shared/revision.h @@ -0,0 +1,7 @@ +#ifndef __REVISION_H__ +#define __REVISION_H__ + #define _REVISION "1008" + #define _HASH "30a554889aa4" + #define _REVISION_DATE "*" + #define _REVISION_TIME "*" +#endif // __REVISION_H__ diff --git a/src/shared/revision.h.in b/src/shared/revision.h.in deleted file mode 100644 index a84170529eb..00000000000 --- a/src/shared/revision.h.in +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef __SVN_REVISION_H__ -#define __SVN_REVISION_H__ - #define _REVISION "794" //change this to your current revision -#endif // __SVN_REVISION_H__ diff --git a/src/tools/genrevision/genrevision.cpp b/src/tools/genrevision/genrevision.cpp index a9e39d93c26..f9abc71b47a 100644 --- a/src/tools/genrevision/genrevision.cpp +++ b/src/tools/genrevision/genrevision.cpp @@ -26,6 +26,7 @@ struct RawData { + char hash_str[200]; char rev_str[200]; char date_str[200]; char time_str[200]; @@ -55,6 +56,45 @@ void extractDataFromSvn(FILE* EntriesFile, bool url, RawData& data) strcpy(data.rev_str,num_str); } +void extractDataFromHG(FILE* EntriesFile, std::string path, bool url, RawData& data) +{ + char buf[200]; + + char hash_str[200]; + char revision_str[200]; + + bool found = false; + while(fgets(buf,200,EntriesFile)) + { + if(sscanf(buf,"%s %s",hash_str,revision_str)==2) + { + found = true; + break; + } + } + + if(!found) + { + strcpy(data.hash_str,"*"); + strcpy(data.rev_str,"*"); + strcpy(data.date_str,"*"); + strcpy(data.time_str,"*"); + return; + } + + char thash_str[200]; + for(int i = 11;i >= 0; --i) + { + thash_str[i] = hash_str[i]; + } + + strcpy(data.hash_str,thash_str); + strcpy(data.rev_str,revision_str); + + strcpy(data.date_str,"*"); + strcpy(data.time_str,"*"); +} + void extractDataFromGit(FILE* EntriesFile, std::string path, bool url, RawData& data) { char buf[200]; @@ -75,6 +115,7 @@ void extractDataFromGit(FILE* EntriesFile, std::string path, bool url, RawData& if(!found) { + strcpy(data.hash_str,"*"); strcpy(data.rev_str,"*"); strcpy(data.date_str,"*"); strcpy(data.time_str,"*"); @@ -116,6 +157,7 @@ void extractDataFromGit(FILE* EntriesFile, std::string path, bool url, RawData& } else strcpy(data.rev_str,hash_str); + strcpy(data.hash_str,"*"); time_t rev_time = 0; // extracting date/time @@ -187,14 +229,26 @@ bool extractDataFromGit(std::string filename, std::string path, bool url, RawDat return true; } -std::string generateHeader(char const* rev_str, char const* date_str, char const* time_str) +bool extractDataFromHG(std::string filename, std::string path, bool url, RawData& data) +{ + FILE* EntriesFile = fopen(filename.c_str(), "r"); + if(!EntriesFile) + return false; + + extractDataFromHG(EntriesFile,path,url,data); + fclose(EntriesFile); + return true; +} + +std::string generateHeader(char const* rev_str, char const* date_str, char const* time_str, char const* hash_str) { std::ostringstream newData; newData << "#ifndef __REVISION_H__" << std::endl; newData << "#define __REVISION_H__" << std::endl; - newData << " #define REVISION_ID \"" << rev_str << "\"" << std::endl; - newData << " #define REVISION_DATE \"" << date_str << "\"" << std::endl; - newData << " #define REVISION_TIME \"" << time_str << "\""<< std::endl; + newData << " #define _REVISION \"" << rev_str << "\"" << std::endl; + newData << " #define _HASH \"" << hash_str << "\"" << std::endl; + newData << " #define _REVISION_DATE \"" << date_str << "\"" << std::endl; + newData << " #define _REVISION_TIME \"" << time_str << "\""<< std::endl; newData << "#endif // __REVISION_H__" << std::endl; return newData.str(); } @@ -202,11 +256,14 @@ std::string generateHeader(char const* rev_str, char const* date_str, char const int main(int argc, char **argv) { bool use_url = false; + bool hg_prefered = true; + bool git_prefered = false; bool svn_prefered = false; std::string path; // Call: tool {options} [path] - // -g use git prefered (default) + // -h use hg prefered (default) + // -g use git prefered // -s use svn prefered // -r use only revision (without repo URL) (default) // -u include repositire URL as commit URL or "rev at URL" @@ -225,13 +282,22 @@ int main(int argc, char **argv) switch(argv[k][1]) { + case 'h': + hg_prefered = true; + git_prefered = false; + svn_prefered = false; + continue; case 'g': + hg_prefered = false; + git_prefered = true; svn_prefered = false; continue; case 'r': use_url = false; continue; case 's': + hg_prefered = false; + git_prefered = false; svn_prefered = true; continue; case 'u': @@ -243,6 +309,7 @@ int main(int argc, char **argv) } } + /// new data extraction std::string newData; @@ -257,25 +324,56 @@ int main(int argc, char **argv) res = extractDataFromSvn(path+".svn/entries",use_url,data); if (!res) res = extractDataFromSvn(path+"_svn/entries",use_url,data); + // HG data + if (!res) + res = extractDataFromHG(path+".hg/branch.cache",path,use_url,data); + if (!res) + res = extractDataFromHG(path+"_hg/branch.cache",path,use_url,data); // GIT data if (!res) res = extractDataFromGit(path+".git/FETCH_HEAD",path,use_url,data); + if (!res) + res = extractDataFromGit(path+"_git/FETCH_HEAD",path,use_url,data); } - else + else if(git_prefered) { // GIT data res = extractDataFromGit(path+".git/FETCH_HEAD",path,use_url,data); - /// SVN data + if (!res) + res = extractDataFromGit(path+"_git/FETCH_HEAD",path,use_url,data); + // HG data + if (!res) + res = extractDataFromHG(path+".hg/branch.cache",path,use_url,data); + if (!res) + res = extractDataFromHG(path+"_hg/branch.cache",path,use_url,data); + /// SVN data if (!res) res = extractDataFromSvn(path+".svn/entries",use_url,data); if (!res) res = extractDataFromSvn(path+"_svn/entries",use_url,data); } + else if(hg_prefered) + { + // HG data + res = extractDataFromHG(path+".hg/branch.cache",path,use_url,data); + if (!res) + res = extractDataFromHG(path+"_hg/branch.cache",path,use_url,data); + /// SVN data + if (!res) + res = extractDataFromSvn(path+".svn/entries",use_url,data); + if (!res) + res = extractDataFromSvn(path+"_svn/entries",use_url,data); + // GIT data + if (!res) + res = extractDataFromGit(path+".git/FETCH_HEAD",path,use_url,data); + if (!res) + res = extractDataFromGit(path+"_git/FETCH_HEAD",path,use_url,data); + } if(res) - newData = generateHeader(data.rev_str,data.date_str,data.time_str); + newData = generateHeader(data.rev_str,data.date_str,data.time_str,data.hash_str); else - newData = generateHeader("*", "*", "*"); + newData = generateHeader("*", "*", "*", "*"); } /// get existed header data for compare diff --git a/src/trinitycore/Main.cpp b/src/trinitycore/Main.cpp index 4c85ecd6d68..d24ae02d426 100644 --- a/src/trinitycore/Main.cpp +++ b/src/trinitycore/Main.cpp @@ -64,7 +64,7 @@ uint32 realmID; ///< Id of the realm void usage(const char *prog) { sLog.outString("Usage: \n %s [<options>]\n" - " --version print version and exist\n\r" + " --version print version and exit\n\r" " -c config_file use config_file as configuration file\n\r" #ifdef WIN32 " Running as service functions:\n\r" diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist index af81a84038f..7da04b0bdf6 100644 --- a/src/trinitycore/trinitycore.conf.dist +++ b/src/trinitycore/trinitycore.conf.dist @@ -502,6 +502,21 @@ LogColors = "" # Default: 0 (false) # 1 (true) # +# FlyingMounts.Azeroth +# Enable/disable flying mounts in Azeroth (map 0 and 1). +# Default: 0 - off +# 1 - on (may be crashy) +# +# FlyingMounts.Outland +# Enable/disable flying mounts in Outland (map 530). +# Default: 1 - on +# 0 - off +# +# FlyingMounts.Others +# Enable/disable flying mounts in other maps (instances, arenas, BGs, etc). +# Default: 0 - off +# 1 - on (may be crashy) +# # CastUnstuck # Allow cast or not Unstuck spell at .start or client Help option use # Default: 1 (true) @@ -607,6 +622,9 @@ ActivateWeather = 1 Battleground.CastDeserter = 1 Battleground.QueueAnnouncer.Enable = 1 Battleground.QueueAnnouncer.PlayerOnly = 0 +FlyingMounts.Azeroth = 0 +FlyingMounts.Outland = 1 +FlyingMounts.Others = 0 CastUnstuck = 1 Instance.IgnoreLevel = 0 Instance.IgnoreRaid = 0 @@ -653,6 +671,11 @@ Server.LoginInfo = 0 # Default: 0 (Not allowed) # 1 (Allowed) # +# AllowTwoSide.Trade +# Allow or not trading with other team in party. +# Default: 0 (Not allowed) +# 1 (Allowed) +# # TalentsInspecting # Allow other players see character talents in inspect dialog (Characters in Gamemaster mode can # inspect talents always) diff --git a/src/trinityrealm/Main.cpp b/src/trinityrealm/Main.cpp index 3e2739ec6b5..274aabf0717 100644 --- a/src/trinityrealm/Main.cpp +++ b/src/trinityrealm/Main.cpp @@ -71,7 +71,7 @@ DatabaseType LoginDatabase; ///< Accessor to the void usage(const char *prog) { sLog.outString("Usage: \n %s [<options>]\n" - " --version print version and exist\n\r" + " --version print version and exit\n\r" " -c config_file use config_file as configuration file\n\r" #ifdef WIN32 " Running as service functions:\n\r" |