diff options
Diffstat (limited to 'src')
9 files changed, 617 insertions, 617 deletions
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 529f9dbecdc..86f4ab7a06a 100644 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -32,133 +32,133 @@ EndContentData */ ## npc_professor_phizzlethorpe ######*/ -#define SAY_PROGRESS_1 -1000235 -#define SAY_PROGRESS_2 -1000236 -#define SAY_PROGRESS_3 -1000237 -#define EMOTE_PROGRESS_4 -1000238 -#define SAY_AGGRO -1000239 -#define SAY_PROGRESS_5 -1000240 -#define SAY_PROGRESS_6 -1000241 -#define SAY_PROGRESS_7 -1000242 -#define EMOTE_PROGRESS_8 -1000243 -#define SAY_PROGRESS_9 -1000244 - -#define QUEST_SUNKEN_TREASURE 665 -#define MOB_VENGEFUL_SURGE 2776 +#define SAY_PROGRESS_1 -1000235 +#define SAY_PROGRESS_2 -1000236 +#define SAY_PROGRESS_3 -1000237 +#define EMOTE_PROGRESS_4 -1000238 +#define SAY_AGGRO -1000239 +#define SAY_PROGRESS_5 -1000240 +#define SAY_PROGRESS_6 -1000241 +#define SAY_PROGRESS_7 -1000242 +#define EMOTE_PROGRESS_8 -1000243 +#define SAY_PROGRESS_9 -1000244 + +#define QUEST_SUNKEN_TREASURE 665 +#define MOB_VENGEFUL_SURGE 2776 struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI { - npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();} + npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();} bool Completed; - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - switch(i) - { - case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break; - case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break; - case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break; - case 9: - { - m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - } - case 10:DoScriptText(SAY_PROGRESS_5, m_creature, player);break; - case 11:DoScriptText(SAY_PROGRESS_6, m_creature, player);break; - case 19:DoScriptText(SAY_PROGRESS_7, m_creature, player); break; - case 20: - DoScriptText(EMOTE_PROGRESS_8, m_creature); - DoScriptText(SAY_PROGRESS_9, m_creature, player); + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(i) + { + case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break; + case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break; + case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break; + case 9: + { + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + } + case 10:DoScriptText(SAY_PROGRESS_5, m_creature, player);break; + case 11:DoScriptText(SAY_PROGRESS_6, m_creature, player);break; + case 19:DoScriptText(SAY_PROGRESS_7, m_creature, player); break; + case 20: + DoScriptText(EMOTE_PROGRESS_8, m_creature); + DoScriptText(SAY_PROGRESS_9, m_creature, player); Completed = true; - if(player) + if(player) ((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); - break; - } - } + break; + } + } - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - } + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + } - void Reset() + void Reset() { Completed = true; m_creature->setFaction(35); } - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature, NULL); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed ) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player) - ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature, NULL); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed ) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) { - DoScriptText(SAY_PROGRESS_1, creature, player); + DoScriptText(SAY_PROGRESS_1, creature, player); ((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID()); - creature->setFaction(113); + creature->setFaction(113); } return true; } CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature) { - npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature); - - professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08); - professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24); - professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24); - professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67); - professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000); - professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000); - professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56); - professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31); - professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000); - professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000); - professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000); - professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000); - professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31); - professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56); - professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42); - professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67); - professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24); - professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24); - professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08); - professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000); - professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000); - - return (CreatureAI*)professor_phizzlethorpeAI; + npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature); + + professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08); + professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24); + professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24); + professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67); + professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000); + professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000); + professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56); + professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31); + professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000); + professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000); + professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000); + professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000); + professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31); + professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56); + professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42); + professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67); + professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24); + professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24); + professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08); + professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000); + professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000); + + return (CreatureAI*)professor_phizzlethorpeAI; } void AddSC_arathi_highlands() { - Script * newscript; + Script * newscript; - newscript = new Script; - newscript->Name = "npc_professor_phizzlethorpe"; - newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; - newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_professor_phizzlethorpe"; + newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; + newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp index 2ffc6f33497..9c408475503 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -353,53 +353,53 @@ CreatureAI* GetAI_npc_time_rift(Creature *_Creature) bool GossipHello_npc_saat(Player *player, Creature *_Creature) { - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu(_Creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID()); - return true; - } - else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID()); - return true; - } - - player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID()); - return true; + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu(_Creature->GetGUID()); + + if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID()); + return true; + } + else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID()); + return true; + } + + player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID()); + return true; } bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - _Creature->CastSpell(player,SPELL_CHRONO_BEACON,false); - } - return true; + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + _Creature->CastSpell(player,SPELL_CHRONO_BEACON,false); + } + return true; } void AddSC_dark_portal() { - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_medivh_bm"; - newscript->GetAI = &GetAI_npc_medivh_bm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_time_rift"; - newscript->GetAI = &GetAI_npc_time_rift; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_saat"; - newscript->pGossipHello = &GossipHello_npc_saat; - newscript->pGossipSelect = &GossipSelect_npc_saat; - newscript->RegisterSelf(); + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_medivh_bm"; + newscript->GetAI = &GetAI_npc_medivh_bm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_time_rift"; + newscript->GetAI = &GetAI_npc_time_rift; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_saat"; + newscript->pGossipHello = &GossipHello_npc_saat; + newscript->pGossipSelect = &GossipSelect_npc_saat; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp index 290c7e86470..36740b0ed34 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -36,347 +36,347 @@ inline uint32 RandRiftBoss() { return rand()%2 ? C_RKEEP : C_RLORD; } float PortalLocation[4][4]= { - {-2041.06, 7042.08, 29.99, 1.30}, - {-1968.18, 7042.11, 21.93, 2.12}, - {-1885.82, 7107.36, 22.32, 3.07}, - {-1928.11, 7175.95, 22.11, 3.44} + {-2041.06, 7042.08, 29.99, 1.30}, + {-1968.18, 7042.11, 21.93, 2.12}, + {-1885.82, 7107.36, 22.32, 3.07}, + {-1928.11, 7175.95, 22.11, 3.44} }; struct Wave { - uint32 PortalBoss; //protector of current portal - uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed + uint32 PortalBoss; //protector of current portal + uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed }; static Wave RiftWaves[]= { - {RIFT_BOSS, 0}, - {C_DEJA, 0}, - {RIFT_BOSS, 120000}, - {C_TEMPO, 140000}, - {RIFT_BOSS, 120000}, - {C_AEONUS, 0} + {RIFT_BOSS, 0}, + {C_DEJA, 0}, + {RIFT_BOSS, 120000}, + {C_TEMPO, 140000}, + {RIFT_BOSS, 120000}, + {C_AEONUS, 0} }; struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance { - instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();}; - - uint32 Encounter[ENCOUNTERS]; - - uint32 mRiftPortalCount; - uint32 mShieldPercent; - uint8 mRiftWaveCount; - uint8 mRiftWaveId; - - uint32 NextPortal_Timer; - - uint64 MedivhGUID; - uint8 CurrentRiftId; - - void Initialize() - { - MedivhGUID = 0; - Clear(); - } - - void Clear() - { - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; - - mRiftPortalCount = 0; - mShieldPercent = 100; - mRiftWaveCount = 0; - mRiftWaveId = 0; - - CurrentRiftId = 0; - - NextPortal_Timer = 0; - } - - 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 Black Portal: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void UpdateBMWorldState(uint32 id, uint32 state) - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* player = itr->getSource()) - player->SendUpdateWorldState(id,state); - } - }else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!"); - } - - void InitWorldState(bool Enable = true) - { - UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0); - UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100); - UpdateBMWorldState(WORLD_STATE_BM_RIFT,0); - } - - bool IsEncounterInProgress() - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return true; - - return false; - } - - void OnPlayerEnter(Player *player) - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return; - - player->SendUpdateWorldState(WORLD_STATE_BM,0); - } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) - { - if (creature->GetEntry() == C_MEDIVH) - MedivhGUID = creature->GetGUID(); - } - - //what other conditions to check? - bool CanProgressEvent() - { - if (!GetPlayerInMap()) - return false; - - return true; - } - - uint8 GetRiftWaveId() - { - switch(mRiftPortalCount) - { - case 6: - mRiftWaveId = 2; - return 1; - case 12: - mRiftWaveId = 4; - return 3; - case 18: - return 5; - default: - return mRiftWaveId; - } - } - - void SetData(uint32 type, uint32 data) - { - Player *player = GetPlayerInMap(); - - if (!player) - { - debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } - - switch(type) - { - case TYPE_MEDIVH: - if (data == SPECIAL && Encounter[0] == IN_PROGRESS) - { - --mShieldPercent; - UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent); - - if (!mShieldPercent) - { - if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) - { - if (medivh->isAlive()) - { - medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Encounter[0] = FAIL; - Encounter[1] = NOT_STARTED; - } - } - } - } - else - { - if (data == IN_PROGRESS) - { - debug_log("SD2: Instance Dark Portal: Starting event."); - InitWorldState(); - Encounter[1] = IN_PROGRESS; - NextPortal_Timer = 15000; - } - - if (data == DONE) - { - //this may be completed further out in the post-event - if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) - { - player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh); - player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh); - } - } - - Encounter[0] = data; - } - break; - case TYPE_RIFT: - if (data == SPECIAL) - { - if (mRiftPortalCount < 7) - NextPortal_Timer = 5000; - } - else - Encounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_MEDIVH: - return Encounter[0]; - case TYPE_RIFT: - return Encounter[1]; - case DATA_PORTAL_COUNT: - return mRiftPortalCount; - case DATA_SHIELD: - return mShieldPercent; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - if (data == DATA_MEDIVH) - return MedivhGUID; - - return 0; - } - - Unit* SummonedPortalBoss(Unit* source) - { - uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; - if (entry == RIFT_BOSS) - entry = RandRiftBoss(); - - float x,y,z; - source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z); - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); - - debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry); - - Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(), - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - - if (Summon) - return Summon; - - debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); - return NULL; - } - - void DoSpawnPortal() - { - Player *player = GetPlayerInMap(); - if (!player) - return; - - if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) - { - for(uint8 i = 0; i < 4; i++) - { - int tmp = rand()%4; - if (tmp != CurrentRiftId) - { - debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); - - CurrentRiftId = tmp; - - Unit *temp = medivh->SummonCreature(C_TIME_RIFT, - PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], - TEMPSUMMON_CORPSE_DESPAWN,0); - if (temp) - { - - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - - if (Unit* boss = SummonedPortalBoss(temp)) - { - if (boss->GetEntry() == C_AEONUS) - { - boss->AddThreat(medivh,0.0f); - } - else - { - boss->AddThreat(temp,0.0f); - temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false); - } - } - } - break; - } - } - } - } - - void Update(uint32 diff) - { - if (Encounter[1] != IN_PROGRESS) - return; - - //add delay timer? - if (!CanProgressEvent()) - { - Clear(); - return; - } - - if (NextPortal_Timer) - { - if (NextPortal_Timer < diff) - { - ++mRiftPortalCount; - UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount); - - DoSpawnPortal(); - NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; - }else NextPortal_Timer -= diff; - } - } + instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();}; + + uint32 Encounter[ENCOUNTERS]; + + uint32 mRiftPortalCount; + uint32 mShieldPercent; + uint8 mRiftWaveCount; + uint8 mRiftWaveId; + + uint32 NextPortal_Timer; + + uint64 MedivhGUID; + uint8 CurrentRiftId; + + void Initialize() + { + MedivhGUID = 0; + Clear(); + } + + void Clear() + { + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounter[i] = NOT_STARTED; + + mRiftPortalCount = 0; + mShieldPercent = 100; + mRiftWaveCount = 0; + mRiftWaveId = 0; + + CurrentRiftId = 0; + + NextPortal_Timer = 0; + } + + 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 Black Portal: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void UpdateBMWorldState(uint32 id, uint32 state) + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* player = itr->getSource()) + player->SendUpdateWorldState(id,state); + } + }else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!"); + } + + void InitWorldState(bool Enable = true) + { + UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0); + UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100); + UpdateBMWorldState(WORLD_STATE_BM_RIFT,0); + } + + bool IsEncounterInProgress() + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return true; + + return false; + } + + void OnPlayerEnter(Player *player) + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return; + + player->SendUpdateWorldState(WORLD_STATE_BM,0); + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + if (creature->GetEntry() == C_MEDIVH) + MedivhGUID = creature->GetGUID(); + } + + //what other conditions to check? + bool CanProgressEvent() + { + if (!GetPlayerInMap()) + return false; + + return true; + } + + uint8 GetRiftWaveId() + { + switch(mRiftPortalCount) + { + case 6: + mRiftWaveId = 2; + return 1; + case 12: + mRiftWaveId = 4; + return 3; + case 18: + return 5; + default: + return mRiftWaveId; + } + } + + void SetData(uint32 type, uint32 data) + { + Player *player = GetPlayerInMap(); + + if (!player) + { + debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } + + switch(type) + { + case TYPE_MEDIVH: + if (data == SPECIAL && Encounter[0] == IN_PROGRESS) + { + --mShieldPercent; + UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent); + + if (!mShieldPercent) + { + if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) + { + if (medivh->isAlive()) + { + medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Encounter[0] = FAIL; + Encounter[1] = NOT_STARTED; + } + } + } + } + else + { + if (data == IN_PROGRESS) + { + debug_log("SD2: Instance Dark Portal: Starting event."); + InitWorldState(); + Encounter[1] = IN_PROGRESS; + NextPortal_Timer = 15000; + } + + if (data == DONE) + { + //this may be completed further out in the post-event + if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) + { + player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh); + player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh); + } + } + + Encounter[0] = data; + } + break; + case TYPE_RIFT: + if (data == SPECIAL) + { + if (mRiftPortalCount < 7) + NextPortal_Timer = 5000; + } + else + Encounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_MEDIVH: + return Encounter[0]; + case TYPE_RIFT: + return Encounter[1]; + case DATA_PORTAL_COUNT: + return mRiftPortalCount; + case DATA_SHIELD: + return mShieldPercent; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + if (data == DATA_MEDIVH) + return MedivhGUID; + + return 0; + } + + Unit* SummonedPortalBoss(Unit* source) + { + uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; + if (entry == RIFT_BOSS) + entry = RandRiftBoss(); + + float x,y,z; + source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z); + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); + + debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry); + + Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(), + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + + if (Summon) + return Summon; + + debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); + return NULL; + } + + void DoSpawnPortal() + { + Player *player = GetPlayerInMap(); + if (!player) + return; + + if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) + { + for(uint8 i = 0; i < 4; i++) + { + int tmp = rand()%4; + if (tmp != CurrentRiftId) + { + debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + + CurrentRiftId = tmp; + + Unit *temp = medivh->SummonCreature(C_TIME_RIFT, + PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], + TEMPSUMMON_CORPSE_DESPAWN,0); + if (temp) + { + + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + + if (Unit* boss = SummonedPortalBoss(temp)) + { + if (boss->GetEntry() == C_AEONUS) + { + boss->AddThreat(medivh,0.0f); + } + else + { + boss->AddThreat(temp,0.0f); + temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false); + } + } + } + break; + } + } + } + } + + void Update(uint32 diff) + { + if (Encounter[1] != IN_PROGRESS) + return; + + //add delay timer? + if (!CanProgressEvent()) + { + Clear(); + return; + } + + if (NextPortal_Timer) + { + if (NextPortal_Timer < diff) + { + ++mRiftPortalCount; + UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount); + + DoSpawnPortal(); + NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; + }else NextPortal_Timer -= diff; + } + } }; InstanceData* GetInstanceData_instance_dark_portal(Map* map) { - return new instance_dark_portal(map); + return new instance_dark_portal(map); } void AddSC_instance_dark_portal() { - Script *newscript; + Script *newscript; - newscript = new Script; - newscript->Name = "instance_dark_portal"; - newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "instance_dark_portal"; + newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp index 9d975a2ff02..caf40a50dce 100644 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp @@ -306,5 +306,5 @@ void AddSC_boss_onyxia() newscript = new Script; newscript->Name="boss_onyxia"; newscript->GetAI = &GetAI_boss_onyxiaAI; - newscript->RegisterSelf(); + newscript->RegisterSelf(); } 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 0a230e4e262..e7391a51a4d 100644 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp @@ -47,158 +47,158 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI { npc_willixAI(Creature *c) : npc_escortAI(c) {Reset();} - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if (!player) - return; - - switch (i) - { - case 3: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - DoScriptText(SAY_POINT, m_creature, player); - break; - case 4: - m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 8: - DoScriptText(SAY_BLUELEAF, m_creature, player); - break; - case 9: - DoScriptText(SAY_DANGER, m_creature, player); - break; - case 13: - DoScriptText(SAY_BAD, m_creature, player); - break; - case 14: - m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 25: - DoScriptText(SAY_THINK, m_creature, player); - break; - case 31: - DoScriptText(SAY_SOON, m_creature, player); - break; - case 42: - DoScriptText(SAY_FINALY, m_creature, player); - break; - case 43: - m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 45: - DoScriptText(SAY_WIN, m_creature, player); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); - break; - case 46: - DoScriptText(SAY_END, m_creature, player); - break; - } - } - - void Reset() {} - - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO1, m_creature, NULL); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch (i) + { + case 3: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, m_creature, player); + break; + case 4: + m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, m_creature, player); + break; + case 9: + DoScriptText(SAY_DANGER, m_creature, player); + break; + case 13: + DoScriptText(SAY_BAD, m_creature, player); + break; + case 14: + m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, m_creature, player); + break; + case 31: + DoScriptText(SAY_SOON, m_creature, player); + break; + case 42: + DoScriptText(SAY_FINALY, m_creature, player); + break; + case 43: + m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, m_creature, player); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); + break; + case 46: + DoScriptText(SAY_END, m_creature, player); + break; + } + } + + void Reset() {} + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO1, m_creature, NULL); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) + ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) - { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); - creature->setFaction(113); - } - - return true; + if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) + { + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + DoScriptText(SAY_READY, creature, player); + creature->setFaction(113); + } + + return true; } CreatureAI* GetAI_npc_willix(Creature *_Creature) { - npc_willixAI* thisAI = new npc_willixAI(_Creature); - - thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); - thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); - thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); - thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); - thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); - thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); - thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); - thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); - thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); - thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); - thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); - thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); - thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); - thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); - thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); - thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); - thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); - thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); - thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); - thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); - thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); - thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); - thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); - thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); - thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); - thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); - thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); - thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); - thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); - thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); - thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); - thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); - thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); - thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); - thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); - thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); - thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); - thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); - thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); - thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); - thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); - thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); - thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); - thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); - thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); - thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); - thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - - return (CreatureAI*)thisAI; + npc_willixAI* thisAI = new npc_willixAI(_Creature); + + thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); + thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); + thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); + thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); + thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); + thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); + thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); + thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); + thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); + thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); + thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); + thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); + thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); + thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); + thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); + thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); + thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); + thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); + thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); + thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); + thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); + thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); + thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); + thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); + thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); + thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); + thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); + thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); + thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); + thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); + thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); + thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); + thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); + thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); + thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); + thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); + thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); + thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); + thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); + thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); + thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); + thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); + thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); + thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); + thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); + thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); + thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); + + return (CreatureAI*)thisAI; } void AddSC_razorfen_kraul() { - Script *newscript; + Script *newscript; - newscript = new Script; - newscript->Name = "npc_willix"; - newscript->GetAI = &GetAI_npc_willix; - newscript->pQuestAccept = &QuestAccept_npc_willix; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_willix"; + newscript->GetAI = &GetAI_npc_willix; + newscript->pQuestAccept = &QuestAccept_npc_willix; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h index 3c5532baf21..aa0dfa8b925 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h @@ -10,6 +10,6 @@ #define DATA_WHITEMANE 3 #define DATA_DOOR_WHITEMANE 4 -#define DATA_HORSEMAN_EVENT 5 -#define GAMEOBJECT_PUMPKIN_SHRINE 6 +#define DATA_HORSEMAN_EVENT 5 +#define GAMEOBJECT_PUMPKIN_SHRINE 6 #endif diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 8ba8320b432..c2fdb8a461e 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7566,35 +7566,35 @@ CreatureInfo const *GetCreatureInfo(uint32 id) void ObjectMgr::LoadTransportEvents() { - QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events"); + QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events"); if( !result ) { barGoLink bar1( 1 ); bar1.step(); - sLog.outString( "\n>> Transport events table is empty \n" ); + sLog.outString( "\n>> Transport events table is empty \n" ); return; } - barGoLink bar1( result->GetRowCount() ); + barGoLink bar1( result->GetRowCount() ); do { bar1.step(); - Field *fields = result->Fetch(); + Field *fields = result->Fetch(); - //Load event values + //Load event values uint32 entry = fields[0].GetUInt32(); uint32 waypoint_id = fields[1].GetUInt32(); - uint32 event_id = fields[2].GetUInt32(); + uint32 event_id = fields[2].GetUInt32(); - uint32 event_count = (entry*100)+waypoint_id; - TransportEventMap[event_count] = event_id; - } - while(result->NextRow()); + uint32 event_count = (entry*100)+waypoint_id; + TransportEventMap[event_count] = event_id; + } + while(result->NextRow()); - sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() ); + sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() ); - delete result; + delete result; } diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8b0a7a7a01f..19b7eaab9e5 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2246,7 +2246,7 @@ void Spell::cast(bool skipCheck) if (IsAffectedBy(auraSpellInfo, auraSpellIdx)) { if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx])) - { + { // Calculate chance at that moment (can be depend for example from combo points) int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL); m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetStackAmount())); diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 435481de949..5dcfde68512 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2187,7 +2187,7 @@ void SpellMgr::LoadSpellCustomAttr() case 41635: // Prayer of Mending case 44869: // Spectral Blast case 45027: // Revitalize - case 45976: // Muru Portal Channel + case 45976: // Muru Portal Channel spellInfo->MaxAffectedTargets = 1; break; case 41376: // Spite |