diff options
Diffstat (limited to 'src/server/scripts')
28 files changed, 725 insertions, 699 deletions
diff --git a/src/server/scripts/Commands/cs_ban.cpp b/src/server/scripts/Commands/cs_ban.cpp index c32a03f9bd8..b1a3dd4bca5 100644 --- a/src/server/scripts/Commands/cs_ban.cpp +++ b/src/server/scripts/Commands/cs_ban.cpp @@ -114,9 +114,19 @@ public: case BAN_SUCCESS: { if (atoi(durationStr) > 0) - handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + { + if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) + sWorld->SendWorldText(LANG_BAN_CHARACTER_YOUBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + else + handler->PSendSysMessage(LANG_BAN_YOUBANNED, name.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + } else - handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr); + { + if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) + sWorld->SendWorldText(LANG_BAN_CHARACTER_YOUPERMBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), name.c_str(), reasonStr); + else + handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, name.c_str(), reasonStr); + } break; } case BAN_NOTFOUND: @@ -189,9 +199,19 @@ public: { case BAN_SUCCESS: if (atoi(durationStr) > 0) - handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); - else - handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reasonStr); + { + if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) + sWorld->SendWorldText(LANG_BAN_ACCOUNT_YOUBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + else + handler->PSendSysMessage(LANG_BAN_YOUBANNED, nameOrIP.c_str(), secsToTimeString(TimeStringToSecs(durationStr), true).c_str(), reasonStr); + } + else + { + if (sWorld->getBoolConfig(CONFIG_SHOW_BAN_IN_WORLD)) + sWorld->SendWorldText(LANG_BAN_ACCOUNT_YOUPERMBANNEDMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), nameOrIP.c_str(), reasonStr); + else + handler->PSendSysMessage(LANG_BAN_YOUPERMBANNED, nameOrIP.c_str(), reasonStr); + } break; case BAN_SYNTAX_ERROR: return false; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 796416b4031..1b8f50b5eab 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -808,12 +808,16 @@ public: if (handler->HasLowerSecurity(target, 0)) return false; - if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD)) - sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); - else - handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); + char const* kickReason = strtok(NULL, "\r"); + std::string kickReasonStr = "No reason"; + if (kickReason != NULL) + kickReasonStr = kickReason; - target->GetSession()->KickPlayer(); + if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD)) + sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), playerName.c_str(), kickReasonStr.c_str()); + else + handler->PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str()); + target->GetSession()->KickPlayer(); return true; } @@ -1835,7 +1839,17 @@ public: int64 muteTime = time(NULL) + notSpeakTime * MINUTE; target->GetSession()->m_muteTime = muteTime; stmt->setInt64(0, muteTime); - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str()); + std::string nameLink = handler->playerLink(targetName); + + if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD)) + { + sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, (handler->GetSession() ? handler->GetSession()->GetPlayerName().c_str() : "Server"), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str()); + } + else + { + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str()); + } } else { @@ -1850,8 +1864,10 @@ public: LoginDatabase.Execute(stmt); std::string nameLink = handler->playerLink(targetName); - handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); - + if (sWorld->getBoolConfig(CONFIG_SHOW_MUTE_IN_WORLD) && !target) + sWorld->SendWorldText(LANG_COMMAND_MUTEMESSAGE_WORLD, handler->GetSession()->GetPlayerName().c_str(), nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); + else + handler->PSendSysMessage(target ? LANG_YOU_DISABLE_CHAT : LANG_COMMAND_DISABLE_CHAT_DELAYED, nameLink.c_str(), notSpeakTime, muteReasonStr.c_str()); return true; } diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index c25002fe4f4..a5b13301403 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -744,7 +744,7 @@ public: for (uint8 i = 0; i < NPCFLAG_COUNT; i++) if (npcflags & npcFlagTexts[i].Value) - handler->PSendSysMessage(npcFlagTexts[i].Name); + handler->PSendSysMessage(npcFlagTexts[i].Name, npcFlagTexts[i].Value); handler->PSendSysMessage(LANG_NPCINFO_MECHANIC_IMMUNE, mechanicImmuneMask); for (uint8 i = 0; i < MAX_MECHANIC; ++i) diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp index b82c0099ce4..bde326a5c37 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp @@ -297,12 +297,7 @@ public: void ClearWeapons() { SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - - //damage - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); - me->UpdateDamagePhysical(BASE_ATTACK); + me->SetCanDualWield(false); } void EnfeebleHealthEffect() @@ -419,19 +414,8 @@ public: //models SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); - //damage - const CreatureTemplate* cinfo = me->GetCreatureTemplate(); - me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); - me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); - me->UpdateDamagePhysical(BASE_ATTACK); - - me->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg); - me->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg); - //Sigh, updating only works on main attack, do it manually .... - me->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); - me->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); - me->SetAttackTime(OFF_ATTACK, (me->GetAttackTime(BASE_ATTACK)*150)/100); + me->SetCanDualWield(true); } } else if (phase == 2) diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp index 646c9ddfe81..eca840dbeb2 100644 --- a/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp +++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_akilzon.cpp @@ -228,7 +228,7 @@ class boss_akilzon : public CreatureScript case EVENT_STATIC_DISRUPTION: { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); - if (!target) + if (!target) target = me->GetVictim(); if (target) { @@ -244,7 +244,7 @@ class boss_akilzon : public CreatureScript case EVENT_GUST_OF_WIND: { Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); - if (!target) + if (!target) target = me->GetVictim(); if (target) DoCast(target, SPELL_GUST_OF_WIND); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 4bf50581108..5b943fd57f2 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -96,24 +96,21 @@ class boss_arlokk : public CreatureScript void Reset() OVERRIDE { + if (events.IsInPhase(PHASE_TWO)) + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack + _Reset(); _summonCountA = 0; _summonCountB = 0; - me->RemoveAllAuras(); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER)); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER)); - if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) - gate->SetGoState(GO_STATE_READY); me->SetWalk(false); me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0]); } void JustDied(Unit* /*killer*/) OVERRIDE { + _JustDied(); Talk(SAY_DEATH); - me->RemoveAllAuras(); - if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) - gate->SetGoState(GO_STATE_ACTIVE); - instance->SetBossState(DATA_ARLOKK, DONE); } void EnterCombat(Unit* /*who*/) OVERRIDE @@ -154,11 +151,9 @@ class boss_arlokk : public CreatureScript void EnterEvadeMode() OVERRIDE { - if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) - object->SetGoState(GO_STATE_ACTIVE); - if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_GONG_OF_BETHEKK))) + BossAI::EnterEvadeMode(); + if (GameObject* object = ObjectAccessor::GetGameObject(*me, instance->GetData64(GO_GONG_OF_BETHEKK))) object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - instance->SetBossState(DATA_ARLOKK, NOT_STARTED); me->DespawnOrUnsummon(4000); } @@ -194,7 +189,7 @@ class boss_arlokk : public CreatureScript case EVENT_SUMMON_PROWLERS: if (_summonCountA < MAX_PROWLERS_PER_SIDE) { - if (Unit* trigger = me->GetUnit(*me, _triggersSideAGUID[urand(0, 4)])) + if (Unit* trigger = ObjectAccessor::GetUnit(*me, _triggersSideAGUID[urand(0, 4)])) { trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER); ++_summonCountA; @@ -202,7 +197,7 @@ class boss_arlokk : public CreatureScript } if (_summonCountB < MAX_PROWLERS_PER_SIDE) { - if (Unit* trigger = me->GetUnit(*me, _triggersSideBGUID[urand(0, 4)])) + if (Unit* trigger = ObjectAccessor::GetUnit(*me, _triggersSideBGUID[urand(0, 4)])) { trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER); ++_summonCountB; @@ -225,13 +220,15 @@ class boss_arlokk : public CreatureScript } case EVENT_TRANSFORM: { - DoCast(me, SPELL_PANTHER_TRANSFORM); + DoCast(me, SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(EQUIP_UNEQUIP)); + /* const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); + */ me->AttackStop(); DoResetThreat(); me->SetReactState(REACT_PASSIVE); @@ -262,6 +259,7 @@ class boss_arlokk : public CreatureScript events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); events.ScheduleEvent(EVENT_TRANSFORM_BACK, urand(15000, 18000), 0, PHASE_TWO); events.SetPhase(PHASE_TWO); + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, true); // hack break; case EVENT_RAVAGE: DoCastVictim(SPELL_RAVAGE, true); @@ -269,14 +267,17 @@ class boss_arlokk : public CreatureScript break; case EVENT_TRANSFORM_BACK: { - me->RemoveAura(SPELL_PANTHER_TRANSFORM); + me->RemoveAura(SPELL_PANTHER_TRANSFORM); // SPELL_AURA_TRANSFORM DoCast(me, SPELL_VANISH_VISUAL); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER)); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER)); + /* const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg)); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg)); me->UpdateDamagePhysical(BASE_ATTACK); + */ + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(4000, 7000), 0, PHASE_ONE); events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); events.ScheduleEvent(EVENT_TRANSFORM, urand(16000, 20000), 0, PHASE_ONE); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp index 3ff18d81032..efd79d89a2b 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_marli.cpp @@ -64,11 +64,6 @@ enum Phases PHASE_THREE = 3 }; -enum ModelId -{ - MODEL_MARLI = 15220 -}; - class boss_marli : public CreatureScript { public: boss_marli() : CreatureScript("boss_marli") { } @@ -79,6 +74,8 @@ class boss_marli : public CreatureScript void Reset() OVERRIDE { + if (events.IsInPhase(PHASE_THREE)) + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack _Reset(); } @@ -155,11 +152,14 @@ class boss_marli : public CreatureScript case EVENT_TRANSFORM: { Talk(SAY_TRANSFORM); - DoCast(me, SPELL_SPIDER_FORM); + DoCast(me, SPELL_SPIDER_FORM); // SPELL_AURA_TRANSFORM + /* CreatureTemplate const* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); + */ + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, true); // hack DoCastVictim(SPELL_ENVOLWINGWEB); if (DoGetThreat(me->GetVictim())) DoModifyThreatPercent(me->GetVictim(), -100); @@ -188,11 +188,14 @@ class boss_marli : public CreatureScript } case EVENT_TRANSFORM_BACK: { - me->SetDisplayId(MODEL_MARLI); + me->RemoveAura(SPELL_SPIDER_FORM); + /* CreatureTemplate const* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); me->UpdateDamagePhysical(BASE_ATTACK); + */ + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack events.ScheduleEvent(EVENT_ASPECT_OF_MARLI, 12000, 0, PHASE_TWO); events.ScheduleEvent(EVENT_TRANSFORM, 45000, 0, PHASE_TWO); events.ScheduleEvent(EVENT_POISON_VOLLEY, 15000); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp index d857bff69e0..a70dd5e0a30 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_thekal.cpp @@ -89,6 +89,8 @@ class boss_thekal : public CreatureScript void Reset() OVERRIDE { + if (events.IsInPhase(PHASE_TWO)) + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 35.0f, false); // hack _Reset(); Enraged = false; WasDead = false; @@ -141,15 +143,17 @@ class boss_thekal : public CreatureScript //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. if (WasDead) { - DoCast(me, SPELL_TIGER_FORM); + DoCast(me, SPELL_TIGER_FORM); // SPELL_AURA_TRANSFORM me->SetObjectScale(2.00f); me->SetStandState(UNIT_STAND_STATE_STAND); me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->SetFullHealth(); + /* const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); me->UpdateDamagePhysical(BASE_ATTACK); + */ + me->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, 40.0f, true); // hack DoResetThreat(); events.ScheduleEvent(EVENT_FRENZY, 30000, 0, PHASE_TWO); // Phase 2 events.ScheduleEvent(EVENT_FORCEPUNCH, 4000, 0, PHASE_TWO); // Phase 2 diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 673450f83d0..67d40abaea3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -27,6 +27,12 @@ EndScriptData */ #include "InstanceScript.h" #include "zulgurub.h" +DoorData const doorData[] = +{ + { GO_FORCEFIELD, DATA_ARLOKK, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END +}; + class instance_zulgurub : public InstanceMapScript { public: instance_zulgurub(): InstanceMapScript(ZGScriptName, 309) { } @@ -36,6 +42,7 @@ class instance_zulgurub : public InstanceMapScript instance_zulgurub_InstanceMapScript(Map* map) : InstanceScript(map) { SetBossNumber(EncounterCount); + LoadDoorData(doorData); } void Initialize() OVERRIDE @@ -46,7 +53,6 @@ class instance_zulgurub : public InstanceMapScript _jindoTheHexxerGUID = 0; _vilebranchSpeakerGUID = 0; _arlokkGUID = 0; - _goForcefieldGUID = 0; _goGongOfBethekkGUID = 0; } @@ -86,7 +92,7 @@ class instance_zulgurub : public InstanceMapScript switch (go->GetEntry()) { case GO_FORCEFIELD: - _goForcefieldGUID = go->GetGUID(); + AddDoor(go, true); break; case GO_GONG_OF_BETHEKK: _goGongOfBethekkGUID = go->GetGUID(); @@ -100,6 +106,18 @@ class instance_zulgurub : public InstanceMapScript } } + void OnGameObjectRemove(GameObject* go) OVERRIDE + { + switch (go->GetEntry()) + { + case GO_FORCEFIELD: + AddDoor(go, false); + break; + default: + break; + } + } + uint64 GetData64(uint32 uiData) const OVERRIDE { switch (uiData) @@ -119,9 +137,6 @@ class instance_zulgurub : public InstanceMapScript case NPC_ARLOKK: return _arlokkGUID; break; - case GO_FORCEFIELD: - return _goForcefieldGUID; - break; case GO_GONG_OF_BETHEKK: return _goGongOfBethekkGUID; break; @@ -181,7 +196,6 @@ class instance_zulgurub : public InstanceMapScript uint64 _jindoTheHexxerGUID; uint64 _vilebranchSpeakerGUID; uint64 _arlokkGUID; - uint64 _goForcefieldGUID; uint64 _goGongOfBethekkGUID; }; diff --git a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp index 0b281c58839..84c9181e495 100644 --- a/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/Ahnkahet/boss_elder_nadox.cpp @@ -232,7 +232,6 @@ public: npc_nadox_eggsAI(Creature* creature) : ScriptedAI(creature) { creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - creature->UpdateAllStats(); } void Reset() OVERRIDE { } diff --git a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp index 0b50375b809..045564ce570 100644 --- a/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp +++ b/src/server/scripts/Northrend/ChamberOfAspects/ObsidianSanctum/boss_sartharion.cpp @@ -467,7 +467,7 @@ public: CallDragon(DATA_TENEBRON); break; case EVENT_CALL_SHADRON: - CallDragon(DATA_SHADRON); + CallDragon(DATA_SHADRON); break; case EVENT_CALL_VESPERON: CallDragon(DATA_VESPERON); diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp index d0120e4c2de..0d7dc9062ad 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_twin_valkyr.cpp @@ -281,7 +281,6 @@ struct boss_twin_baseAI : public BossAI { SetEquipmentSlots(false, Weapon, mode ? Weapon : int32(EQUIP_UNEQUIP), EQUIP_UNEQUIP); me->SetCanDualWield(mode); - me->UpdateDamagePhysical(mode ? OFF_ATTACK : BASE_ATTACK); } void UpdateAI(uint32 diff) OVERRIDE diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp index 0859d43ee85..fe2b818b325 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_forgemaster_garfrost.cpp @@ -111,12 +111,13 @@ class boss_garfrost : public CreatureScript { _JustDied(); Talk(SAY_DEATH); + me->RemoveAllGameObjects(); if (Creature* tyrannus = me->GetCreature(*me, instance->GetData64(DATA_TYRANNUS))) tyrannus->AI()->Talk(SAY_TYRANNUS_DEATH); } - void DamageTaken(Unit* /*attacker*/, uint32& /*uiDamage*/) OVERRIDE + void DamageTaken(Unit* /*attacker*/, uint32& /*damage*/) OVERRIDE { if (events.IsInPhase(PHASE_ONE) && !HealthAbovePct(66)) { diff --git a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp index 3de5b6a7b2b..6769e3429fa 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_grobbulus.cpp @@ -17,18 +17,19 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "naxxramas.h" -#include "SpellInfo.h" enum Spells { SPELL_BOMBARD_SLIME = 28280, - SPELL_POISON_CLOUD = 28240, - SPELL_MUTATING_INJECTION = 28169, SPELL_SLIME_SPRAY = 28157, - H_SPELL_SLIME_SPRAY = 54364, - SPELL_BERSERK = 26662, - SPELL_POISON_CLOUD_ADD = 59116 + SPELL_MUTATING_INJECTION = 28169, + SPELL_MUTATING_EXPLOSION = 28206, + SPELL_POISON_CLOUD = 28240, + SPELL_POISON_CLOUD_PASSIVE = 28158, + SPELL_BERSERK = 26662 }; enum Events @@ -46,115 +47,183 @@ enum CreatureId class boss_grobbulus : public CreatureScript { -public: - boss_grobbulus() : CreatureScript("boss_grobbulus") { } + public: + boss_grobbulus() : CreatureScript("boss_grobbulus") { } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new boss_grobbulusAI(creature); - } - - struct boss_grobbulusAI : public BossAI - { - boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) + struct boss_grobbulusAI : public BossAI { - me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_POISON_CLOUD_ADD, true); - } + boss_grobbulusAI(Creature* creature) : BossAI(creature, BOSS_GROBBULUS) { } - void EnterCombat(Unit* /*who*/) OVERRIDE - { - _EnterCombat(); - events.ScheduleEvent(EVENT_CLOUD, 15000); - events.ScheduleEvent(EVENT_INJECT, 20000); - events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure - events.ScheduleEvent(EVENT_BERSERK, 12*60000); - } + void EnterCombat(Unit* /*who*/) OVERRIDE + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CLOUD, 15000); + events.ScheduleEvent(EVENT_INJECT, 20000); + events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000)); // not sure + events.ScheduleEvent(EVENT_BERSERK, 12 * 60000); + } - void SpellHitTarget(Unit* target, const SpellInfo* spell) OVERRIDE - { - if (spell->Id == uint32(SPELL_SLIME_SPRAY)) + void SpellHitTarget(Unit* target, SpellInfo const* spell) OVERRIDE { - if (TempSummon* slime = me->SummonCreature(NPC_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) - DoZoneInCombat(slime); + if (spell->Id == SPELL_SLIME_SPRAY) + me->SummonCreature(NPC_FALLOUT_SLIME, *target, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT); } - } - void UpdateAI(uint32 diff) OVERRIDE - { - if (!UpdateVictim()) - return; + void UpdateAI(uint32 diff) OVERRIDE + { + if (!UpdateVictim()) + return; - events.Update(diff); + events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) - { - switch (eventId) + while (uint32 eventId = events.ExecuteEvent()) { - case EVENT_CLOUD: - DoCastAOE(SPELL_POISON_CLOUD); - events.ScheduleEvent(EVENT_CLOUD, 15000); - return; - case EVENT_BERSERK: - DoCastAOE(SPELL_BERSERK); - return; - case EVENT_SPRAY: - DoCastAOE(SPELL_SLIME_SPRAY); - events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); - return; - case EVENT_INJECT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) - if (!target->HasAura(SPELL_MUTATING_INJECTION)) + switch (eventId) + { + case EVENT_CLOUD: + DoCastAOE(SPELL_POISON_CLOUD); + events.ScheduleEvent(EVENT_CLOUD, 15000); + return; + case EVENT_BERSERK: + DoCastAOE(SPELL_BERSERK, true); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_SLIME_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, urand(15000, 30000)); + return; + case EVENT_INJECT: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_MUTATING_INJECTION)) DoCast(target, SPELL_MUTATING_INJECTION); - events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct())); - return; + events.ScheduleEvent(EVENT_INJECT, 8000 + uint32(120 * me->GetHealthPct())); + return; + default: + break; + } } + + DoMeleeAttackIfReady(); } + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new boss_grobbulusAI(creature); } - }; - }; class npc_grobbulus_poison_cloud : public CreatureScript { -public: - npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { } + public: + npc_grobbulus_poison_cloud() : CreatureScript("npc_grobbulus_poison_cloud") { } + + struct npc_grobbulus_poison_cloudAI : public ScriptedAI + { + npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature) + { + SetCombatMovement(false); + creature->SetReactState(REACT_PASSIVE); + } + + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE + { + // no visual when casting in ctor or Reset() + DoCast(me, SPELL_POISON_CLOUD_PASSIVE, true); + } - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return new npc_grobbulus_poison_cloudAI(creature); - } + void UpdateAI(uint32 /*diff*/) OVERRIDE { } + }; - struct npc_grobbulus_poison_cloudAI : public ScriptedAI - { - npc_grobbulus_poison_cloudAI(Creature* creature) : ScriptedAI(creature) + CreatureAI* GetAI(Creature* creature) const OVERRIDE { - SetCombatMovement(false); + return new npc_grobbulus_poison_cloudAI(creature); } +}; + +// 28169 - Mutating Injection +class spell_grobbulus_mutating_injection : public SpellScriptLoader +{ + public: + spell_grobbulus_mutating_injection() : SpellScriptLoader("spell_grobbulus_mutating_injection") { } - uint32 Cloud_Timer; + class spell_grobbulus_mutating_injection_AuraScript : public AuraScript + { + PrepareAuraScript(spell_grobbulus_mutating_injection_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_MUTATING_EXPLOSION) + || !sSpellMgr->GetSpellInfo(SPELL_POISON_CLOUD)) + return false; + return true; + } + + void HandleRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + AuraRemoveMode removeMode = GetTargetApplication()->GetRemoveMode(); + if (removeMode != AURA_REMOVE_BY_ENEMY_SPELL && removeMode != AURA_REMOVE_BY_EXPIRE) + return; + + if (Unit* caster = GetCaster()) + { + caster->CastSpell(GetTarget(), SPELL_MUTATING_EXPLOSION, true); + GetTarget()->CastSpell(GetTarget(), SPELL_POISON_CLOUD, true, NULL, aurEff, GetCasterGUID()); + } + } - void Reset() OVERRIDE + void Register() OVERRIDE + { + AfterEffectRemove += AuraEffectRemoveFn(spell_grobbulus_mutating_injection_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE { - Cloud_Timer = 1000; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + return new spell_grobbulus_mutating_injection_AuraScript(); } +}; - void UpdateAI(uint32 diff) OVERRIDE +// 28158, 54362 - Poison (Grobbulus) +class spell_grobbulus_poison_cloud : public SpellScriptLoader +{ + public: + spell_grobbulus_poison_cloud() : SpellScriptLoader("spell_grobbulus_poison_cloud") { } + + class spell_grobbulus_poison_cloud_AuraScript : public AuraScript { - if (Cloud_Timer <= diff) + PrepareAuraScript(spell_grobbulus_poison_cloud_AuraScript); + + bool Validate(SpellInfo const* spellInfo) OVERRIDE { - DoCast(me, SPELL_POISON_CLOUD_ADD); - Cloud_Timer = 10000; - } else Cloud_Timer -= diff; - } - }; + if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell)) + return false; + return true; + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; + int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3); + GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_grobbulus_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_grobbulus_poison_cloud_AuraScript(); + } }; void AddSC_boss_grobbulus() { new boss_grobbulus(); new npc_grobbulus_poison_cloud(); + new spell_grobbulus_mutating_injection(); + new spell_grobbulus_poison_cloud(); } diff --git a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp index aa6bb11447b..93e52c4da73 100644 --- a/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp +++ b/src/server/scripts/Northrend/Nexus/Nexus/boss_ormorok.cpp @@ -195,8 +195,8 @@ public: struct npc_crystal_spike_triggerAI : public ScriptedAI { - npc_crystal_spike_triggerAI(Creature* creature) : ScriptedAI(creature) - { + npc_crystal_spike_triggerAI(Creature* creature) : ScriptedAI(creature) + { _count = 0; _despawntimer = 0; } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp index 08d12d715f9..927f4490770 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_maiden_of_grief.cpp @@ -15,146 +15,130 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* Script Data Start -SDName: Boss maiden_of_grief -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "halls_of_stone.h" +enum Yells +{ + SAY_AGGRO = 0, + SAY_SLAY = 1, + SAY_DEATH = 2, + SAY_STUN = 3 +}; + enum Spells { - SPELL_PARTING_SORROW = 59723, - SPELL_STORM_OF_GRIEF_N = 50752, - SPELL_STORM_OF_GRIEF_H = 59772, - SPELL_SHOCK_OF_SORROW_N = 50760, - SPELL_SHOCK_OF_SORROW_H = 59726, - SPELL_PILLAR_OF_WOE_N = 50761, - SPELL_PILLAR_OF_WOE_H = 59727 + SPELL_PARTING_SORROW = 59723, + SPELL_STORM_OF_GRIEF = 50752, + SPELL_SHOCK_OF_SORROW = 50760, + SPELL_PILLAR_OF_WOE = 50761 }; -enum Yells +enum Events { - SAY_AGGRO = 0, - SAY_SLAY = 1, - SAY_DEATH = 2, - SAY_STUN = 3 + EVENT_PARTING_SORROW = 1, + EVENT_STORM_OF_GRIEF, + EVENT_SHOCK_OF_SORROW, + EVENT_PILLAR_OF_WOE }; enum Achievements { - ACHIEV_GOOD_GRIEF_START_EVENT = 20383, + ACHIEV_GOOD_GRIEF_START_EVENT = 20383, }; class boss_maiden_of_grief : public CreatureScript { -public: - boss_maiden_of_grief() : CreatureScript("boss_maiden_of_grief") { } + public: + boss_maiden_of_grief() : CreatureScript("boss_maiden_of_grief") { } - struct boss_maiden_of_griefAI : public ScriptedAI - { - boss_maiden_of_griefAI(Creature* creature) : ScriptedAI(creature) + struct boss_maiden_of_griefAI : public BossAI { - instance = me->GetInstanceScript(); - } - - InstanceScript* instance; + boss_maiden_of_griefAI(Creature* creature) : BossAI(creature, DATA_MAIDEN_OF_GRIEF) { } - uint32 PartingSorrowTimer; - uint32 StormOfGriefTimer; - uint32 ShockOfSorrowTimer; - uint32 PillarOfWoeTimer; - - void Reset() OVERRIDE - { - PartingSorrowTimer = urand(25000, 30000); - StormOfGriefTimer = 10000; - ShockOfSorrowTimer = 20000+rand()%5000; - PillarOfWoeTimer = urand(5000, 15000); - - instance->SetBossState(DATA_MAIDEN_OF_GRIEF, NOT_STARTED); - instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOOD_GRIEF_START_EVENT); - } - - void EnterCombat(Unit* /*who*/) OVERRIDE - { - Talk(SAY_AGGRO); + void Reset() OVERRIDE + { + _Reset(); - instance->SetBossState(DATA_MAIDEN_OF_GRIEF, IN_PROGRESS); - instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOOD_GRIEF_START_EVENT); - } + if (IsHeroic()) + events.ScheduleEvent(EVENT_PARTING_SORROW, urand(25000, 30000)); + events.ScheduleEvent(EVENT_STORM_OF_GRIEF, 10000); + events.ScheduleEvent(EVENT_SHOCK_OF_SORROW, urand(20000, 25000)); + events.ScheduleEvent(EVENT_PILLAR_OF_WOE, urand(5000, 15000)); - void UpdateAI(uint32 diff) OVERRIDE - { - //Return since we have no target - if (!UpdateVictim()) - return; + instance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOOD_GRIEF_START_EVENT); + } - if (IsHeroic()) + void EnterCombat(Unit* /*who*/) OVERRIDE { - if (PartingSorrowTimer <= diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_PARTING_SORROW); + _EnterCombat(); + Talk(SAY_AGGRO); - PartingSorrowTimer = urand(30000, 40000); - } else PartingSorrowTimer -= diff; + instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOOD_GRIEF_START_EVENT); } - if (StormOfGriefTimer <= diff) + void KilledUnit(Unit* who) OVERRIDE { - DoCastVictim(SPELL_STORM_OF_GRIEF_N, true); - StormOfGriefTimer = urand(15000, 20000); - } else StormOfGriefTimer -= diff; + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_SLAY); + } - if (ShockOfSorrowTimer <= diff) + void JustDied(Unit* /*killer*/) OVERRIDE { - DoResetThreat(); - Talk(SAY_STUN); - DoCast(me, SPELL_SHOCK_OF_SORROW_N); - ShockOfSorrowTimer = urand(20000, 30000); - } else ShockOfSorrowTimer -= diff; + _JustDied(); + Talk(SAY_DEATH); + } - if (PillarOfWoeTimer <= diff) + void UpdateAI(uint32 diff) OVERRIDE { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1); + if (!UpdateVictim()) + return; - if (target) - DoCast(target, SPELL_PILLAR_OF_WOE_N); - else - DoCastVictim(SPELL_PILLAR_OF_WOE_N); + events.Update(diff); - PillarOfWoeTimer = urand(5000, 25000); - } else PillarOfWoeTimer -= diff; - - DoMeleeAttackIfReady(); - } + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; - void JustDied(Unit* /*killer*/) OVERRIDE - { - Talk(SAY_DEATH); - - instance->SetBossState(DATA_MAIDEN_OF_GRIEF, DONE); - } + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_PARTING_SORROW: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) + DoCast(target, SPELL_PARTING_SORROW); + events.ScheduleEvent(EVENT_PARTING_SORROW, urand(30000, 40000)); + break; + case EVENT_STORM_OF_GRIEF: + DoCastVictim(SPELL_STORM_OF_GRIEF, true); + events.ScheduleEvent(EVENT_STORM_OF_GRIEF, urand(15000, 20000)); + break; + case EVENT_SHOCK_OF_SORROW: + DoResetThreat(); + Talk(SAY_STUN); + DoCastAOE(SPELL_SHOCK_OF_SORROW); + events.ScheduleEvent(EVENT_SHOCK_OF_SORROW, urand(20000, 30000)); + break; + case EVENT_PILLAR_OF_WOE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true)) + DoCast(target, SPELL_PILLAR_OF_WOE); + else + DoCastVictim(SPELL_PILLAR_OF_WOE); + events.ScheduleEvent(EVENT_PILLAR_OF_WOE, urand(5000, 25000)); + break; + default: + break; + } + } + + DoMeleeAttackIfReady(); + } + }; - void KilledUnit(Unit* victim) OVERRIDE + CreatureAI* GetAI(Creature* creature) const OVERRIDE { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - Talk(SAY_SLAY); + return GetHallsOfStoneAI<boss_maiden_of_griefAI>(creature); } - }; - - CreatureAI* GetAI(Creature* creature) const OVERRIDE - { - return GetHallsOfStoneAI<boss_maiden_of_griefAI>(creature); - } }; void AddSC_boss_maiden_of_grief() diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp index c46158b0f7a..2a24b1145c0 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardePinnacle/boss_svala.cpp @@ -258,7 +258,7 @@ class boss_svala : public CreatureScript case EVENT_INTRO_TRANSFORM_0: { if (Creature* arthas = ObjectAccessor::GetCreature(*me, _arthasGUID)) - arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, false); + arthas->CastSpell(me, SPELL_TRANSFORMING_CHANNEL, true); Position pos; pos.Relocate(me); pos.m_positionZ += 8.0f; diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index cbad220aed6..0173454ef28 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -428,8 +428,8 @@ public: struct npc_jennyAI : public ScriptedAI { - npc_jennyAI(Creature* creature) : ScriptedAI(creature) - { + npc_jennyAI(Creature* creature) : ScriptedAI(creature) + { setCrateNumber = false; } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h index 193b0be51b0..b2097c34b33 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/blood_furnace.h @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 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 @@ -16,32 +15,59 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef DEF_BLOOD_FURNACE_H -#define DEF_BLOOD_FURNACE_H +#ifndef BLOOD_FURNACE_H_ +#define BLOOD_FURNACE_H_ + +#define BFScriptName "instance_blood_furnace" +uint32 const EncounterCount = 3; enum DataTypes { - DATA_THE_MAKER = 1, - DATA_BROGGOK = 2, - DATA_KELIDAN_THE_MAKER = 3, - TYPE_THE_MAKER_EVENT = 4, - TYPE_BROGGOK_EVENT = 5, - TYPE_KELIDAN_THE_BREAKER_EVENT = 6, - DATA_DOOR1 = 7, - DATA_DOOR2 = 8, - DATA_DOOR3 = 9, - DATA_DOOR4 = 10, - DATA_DOOR5 = 11, - DATA_DOOR6 = 12, - DATA_PRISON_CELL1 = 13, - DATA_PRISON_CELL2 = 14, - DATA_PRISON_CELL3 = 15, - DATA_PRISON_CELL4 = 16, - DATA_PRISON_CELL5 = 17, - DATA_PRISON_CELL6 = 18, - DATA_PRISON_CELL7 = 19, - DATA_PRISON_CELL8 = 20, - DATA_BROGGOK_LEVER = 21 + // Encounter States/Boss GUIDs + DATA_THE_MAKER = 0, + DATA_BROGGOK = 1, + DATA_KELIDAN_THE_BREAKER = 2, + + // Additional Data + DATA_DOOR_4 = 3, + DATA_PRISON_CELL1 = 4, + DATA_PRISON_CELL2 = 5, + DATA_PRISON_CELL3 = 6, + DATA_PRISON_CELL4 = 7, + DATA_PRISON_CELL5 = 8, + DATA_PRISON_CELL6 = 9, + DATA_PRISON_CELL7 = 10, + DATA_PRISON_CELL8 = 11, + DATA_BROGGOK_LEVER = 12 +}; + +enum CreatureIds +{ + NPC_THE_MAKER = 17381, + NPC_BROGGOK = 17380, + NPC_KELIDAN_THE_BREAKER = 17377, + NPC_PRISONER = 17398 +}; + +enum GameObjectIds +{ + GO_PRISON_DOOR_01 = 181766, // Final Exit Door + GO_PRISON_DOOR_02 = 181811, // The Maker Front Door + GO_PRISON_DOOR_03 = 181812, // The Maker Rear Door + GO_PRISON_DOOR_04 = 181819, // Broggok Rear Door + GO_PRISON_DOOR_05 = 181822, // Broggok Front Door + GO_SUMMON_DOOR = 181823, // Kelidan Exit Door + + GO_PRISON_CELL_DOOR_1 = 181813, // The Maker Prison Cell front right + GO_PRISON_CELL_DOOR_2 = 181814, // The Maker Prison Cell back right + GO_PRISON_CELL_DOOR_3 = 181816, // The Maker Prison Cell front left + GO_PRISON_CELL_DOOR_4 = 181815, // The Maker Prison Cell back left + GO_PRISON_CELL_DOOR_5 = 181821, // Broggok Prison Cell front right + GO_PRISON_CELL_DOOR_6 = 181818, // Broggok Prison Cell back right + GO_PRISON_CELL_DOOR_7 = 181820, // Broggok Prison Cell front left + GO_PRISON_CELL_DOOR_8 = 181817, // Broggok Prison Cell back left + + GO_BROGGOK_LEVER = 181982 }; enum ActionIds @@ -51,5 +77,11 @@ enum ActionIds ACTION_PREPARE_BROGGOK = 3 }; -#endif +template<class AI> +AI* GetBloodFurnaceAI(Creature* creature) +{ + return GetInstanceAI<AI>(creature, BFScriptName); +} + +#endif // BLOOD_FURNACE_H_ diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp index 1dda4161b8c..f610d6dd7e0 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp @@ -25,39 +25,32 @@ EndScriptData */ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellScript.h" +#include "SpellAuraEffects.h" #include "blood_furnace.h" enum Yells { - SAY_AGGRO = 0 + SAY_AGGRO = 0 }; enum Spells { - SPELL_SLIME_SPRAY = 30913, - SPELL_POISON_CLOUD = 30916, - SPELL_POISON_BOLT = 30917, + SPELL_SLIME_SPRAY = 30913, + SPELL_POISON_CLOUD = 30916, + SPELL_POISON_BOLT = 30917, - SPELL_POISON = 30914 + SPELL_POISON_CLOUD_PASSIVE = 30914 }; class boss_broggok : public CreatureScript { public: - - boss_broggok() - : CreatureScript("boss_broggok") - { - } + boss_broggok() : CreatureScript("boss_broggok") { } struct boss_broggokAI : public BossAI { - boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; + boss_broggokAI(Creature* creature) : BossAI(creature, DATA_BROGGOK) { } uint32 AcidSpray_Timer; uint32 PoisonSpawn_Timer; @@ -71,28 +64,22 @@ class boss_broggok : public CreatureScript PoisonSpawn_Timer = 5000; PoisonBolt_Timer = 7000; DoAction(ACTION_RESET_BROGGOK); - instance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); } void EnterCombat(Unit* /*who*/) OVERRIDE { + _EnterCombat(); Talk(SAY_AGGRO); } - void JustSummoned(Creature* summoned) OVERRIDE - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->CastSpell(summoned, SPELL_POISON, false, 0, 0, me->GetGUID()); - } - void UpdateAI(uint32 diff) OVERRIDE { if (!UpdateVictim()) return; + if (!canAttack) return; + if (AcidSpray_Timer <= diff) { DoCastVictim(SPELL_SLIME_SPRAY); @@ -122,9 +109,7 @@ class boss_broggok : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { - instance->HandleGameObject(instance->GetData64(DATA_DOOR4), true); - instance->HandleGameObject(instance->GetData64(DATA_DOOR5), true); - instance->SetData(TYPE_BROGGOK_EVENT, DONE); + _JustDied(); } void DoAction(int32 action) OVERRIDE @@ -151,7 +136,34 @@ class boss_broggok : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return GetInstanceAI<boss_broggokAI>(creature); + return GetBloodFurnaceAI<boss_broggokAI>(creature); + } +}; + +class npc_broggok_poison_cloud : public CreatureScript +{ + public: + npc_broggok_poison_cloud() : CreatureScript("npc_broggok_poison_cloud") { } + + struct npc_broggok_poison_cloudAI : public ScriptedAI + { + npc_broggok_poison_cloudAI(Creature* creature) : ScriptedAI(creature) + { + SetCombatMovement(false); + creature->SetReactState(REACT_PASSIVE); + } + + void IsSummonedBy(Unit* /*summoner*/) OVERRIDE + { + DoCast(me, SPELL_POISON_CLOUD_PASSIVE, true); + } + + void UpdateAI(uint32 /*diff*/) OVERRIDE { } + }; + + CreatureAI* GetAI(Creature* creature) const OVERRIDE + { + return new npc_broggok_poison_cloudAI(creature); } }; @@ -163,19 +175,60 @@ class go_broggok_lever : public GameObjectScript bool OnGossipHello(Player* /*player*/, GameObject* go) OVERRIDE { if (InstanceScript* instance = go->GetInstanceScript()) - if (instance->GetData(TYPE_BROGGOK_EVENT) != DONE && instance->GetData(TYPE_BROGGOK_EVENT) != IN_PROGRESS) + if (instance->GetBossState(DATA_BROGGOK) != DONE && instance->GetBossState(DATA_BROGGOK) != IN_PROGRESS) { - instance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); - if (Creature* broggok = Creature::GetCreature(*go, instance->GetData64(DATA_BROGGOK))) + instance->SetBossState(DATA_BROGGOK, IN_PROGRESS); + if (Creature* broggok = ObjectAccessor::GetCreature(*go, instance->GetData64(DATA_BROGGOK))) broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK); } + go->UseDoorOrButton(); return false; } }; +// 30914, 38462 - Poison (Broggok) +class spell_broggok_poison_cloud : public SpellScriptLoader +{ + public: + spell_broggok_poison_cloud() : SpellScriptLoader("spell_broggok_poison_cloud") { } + + class spell_broggok_poison_cloud_AuraScript : public AuraScript + { + PrepareAuraScript(spell_broggok_poison_cloud_AuraScript); + + bool Validate(SpellInfo const* spellInfo) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell)) + return false; + return true; + } + + void PeriodicTick(AuraEffect const* aurEff) + { + PreventDefaultAction(); + + uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; + int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3); + GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff); + } + + void Register() OVERRIDE + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_broggok_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_broggok_poison_cloud_AuraScript(); + } +}; + void AddSC_boss_broggok() { new boss_broggok(); + new npc_broggok_poison_cloud(); new go_broggok_lever(); + new spell_broggok_poison_cloud(); } diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp index 78be2347656..4c04c06b091 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp @@ -16,18 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Kelidan_The_Breaker -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -/* ContentData -boss_kelidan_the_breaker -npc_shadowmoon_channeler -EndContentData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "SpellAuras.h" @@ -71,23 +59,16 @@ const float ShadowmoonChannelers[5][4]= class boss_kelidan_the_breaker : public CreatureScript { public: + boss_kelidan_the_breaker() : CreatureScript("boss_kelidan_the_breaker") { } - boss_kelidan_the_breaker() - : CreatureScript("boss_kelidan_the_breaker") - { - } - - struct boss_kelidan_the_breakerAI : public ScriptedAI + struct boss_kelidan_the_breakerAI : public BossAI { - boss_kelidan_the_breakerAI(Creature* creature) : ScriptedAI(creature) + boss_kelidan_the_breakerAI(Creature* creature) : BossAI(creature, DATA_KELIDAN_THE_BREAKER) { - instance = creature->GetInstanceScript(); - for (uint8 i=0; i<5; ++i) + for (uint8 i = 0; i < 5; ++i) Channelers[i] = 0; } - InstanceScript* instance; - uint32 ShadowVolley_Timer; uint32 BurningNova_Timer; uint32 Firenova_Timer; @@ -99,6 +80,7 @@ class boss_kelidan_the_breaker : public CreatureScript void Reset() OVERRIDE { + _Reset(); ShadowVolley_Timer = 1000; BurningNova_Timer = 15000; Corruption_Timer = 5000; @@ -108,16 +90,15 @@ class boss_kelidan_the_breaker : public CreatureScript SummonChannelers(); me->SetReactState(REACT_PASSIVE); me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE); - instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); } void EnterCombat(Unit* who) OVERRIDE { + _EnterCombat(); Talk(SAY_WAKE); if (me->IsNonMeleeSpellCast(false)) me->InterruptNonMeleeSpells(true); DoStartMovement(who); - instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); } void KilledUnit(Unit* /*victim*/) OVERRIDE @@ -189,11 +170,8 @@ class boss_kelidan_the_breaker : public CreatureScript void JustDied(Unit* /*killer*/) OVERRIDE { + _JustDied(); Talk(SAY_DIE); - - instance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); - instance->HandleGameObject(instance->GetData64(DATA_DOOR1), true); - instance->HandleGameObject(instance->GetData64(DATA_DOOR6), true); } void UpdateAI(uint32 diff) OVERRIDE @@ -270,7 +248,7 @@ class boss_kelidan_the_breaker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return GetInstanceAI<boss_kelidan_the_breakerAI>(creature); + return GetBloodFurnaceAI<boss_kelidan_the_breakerAI>(creature); } }; @@ -368,7 +346,7 @@ class npc_shadowmoon_channeler : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return GetInstanceAI<npc_shadowmoon_channelerAI>(creature); + return GetBloodFurnaceAI<npc_shadowmoon_channelerAI>(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp index 214edf4f5c2..6ab356bfa4a 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp @@ -45,20 +45,11 @@ enum Spells class boss_the_maker : public CreatureScript { public: + boss_the_maker() : CreatureScript("boss_the_maker") { } - boss_the_maker() - : CreatureScript("boss_the_maker") + struct boss_the_makerAI : public BossAI { - } - - struct boss_the_makerAI : public ScriptedAI - { - boss_the_makerAI(Creature* creature) : ScriptedAI(creature) - { - instance = creature->GetInstanceScript(); - } - - InstanceScript* instance; + boss_the_makerAI(Creature* creature) : BossAI(creature, DATA_THE_MAKER) { } uint32 AcidSpray_Timer; uint32 ExplodingBreaker_Timer; @@ -67,37 +58,30 @@ class boss_the_maker : public CreatureScript void Reset() OVERRIDE { + _Reset(); AcidSpray_Timer = 15000; ExplodingBreaker_Timer = 6000; Domination_Timer = 120000; Knockdown_Timer = 10000; - - instance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); - instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true); } void EnterCombat(Unit* /*who*/) OVERRIDE { + _EnterCombat(); Talk(SAY_AGGRO); - - instance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); - instance->HandleGameObject(instance->GetData64(DATA_DOOR2), false); } - void KilledUnit(Unit* /*victim*/) OVERRIDE + void KilledUnit(Unit* who) OVERRIDE { - Talk(SAY_KILL); + if (who->GetTypeId() == TYPEID_PLAYER) + Talk(SAY_KILL); } void JustDied(Unit* /*killer*/) OVERRIDE { + _JustDied(); Talk(SAY_DIE); - - instance->SetData(TYPE_THE_MAKER_EVENT, DONE); - instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true); - instance->HandleGameObject(instance->GetData64(DATA_DOOR3), true); - - } + } void UpdateAI(uint32 diff) OVERRIDE { @@ -147,7 +131,7 @@ class boss_the_maker : public CreatureScript CreatureAI* GetAI(Creature* creature) const OVERRIDE { - return GetInstanceAI<boss_the_makerAI>(creature); + return GetBloodFurnaceAI<boss_the_makerAI>(creature); } }; diff --git a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp index 7a9db8f4a63..bc399e4b43f 100644 --- a/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 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 @@ -16,292 +15,207 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Instance_Blood_Furnace -SD%Complete: 85 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - #include "ScriptMgr.h" +#include "ScriptedCreature.h" #include "InstanceScript.h" #include "blood_furnace.h" -#include "CreatureAI.h" -#define ENTRY_SEWER1 181823 -#define ENTRY_SEWER2 181766 -#define MAX_ENCOUNTER 3 +DoorData const doorData[] = +{ + { GO_PRISON_DOOR_01, DATA_KELIDAN_THE_BREAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { GO_PRISON_DOOR_02, DATA_THE_MAKER, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_PRISON_DOOR_03, DATA_THE_MAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { GO_PRISON_DOOR_04, DATA_BROGGOK, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { GO_PRISON_DOOR_05, DATA_BROGGOK, DOOR_TYPE_ROOM, BOUNDARY_NONE }, + { GO_SUMMON_DOOR, DATA_KELIDAN_THE_BREAKER, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }, + { 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END +}; class instance_blood_furnace : public InstanceMapScript { public: - instance_blood_furnace() - : InstanceMapScript("instance_blood_furnace", 542) { } + instance_blood_furnace() : InstanceMapScript(BFScriptName, 542) { } struct instance_blood_furnace_InstanceMapScript : public InstanceScript { - instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map) { } - - uint64 The_MakerGUID; - uint64 BroggokGUID; - uint64 Kelidan_The_BreakerGUID; - - uint64 Door1GUID; - uint64 Door2GUID; - uint64 Door3GUID; - uint64 Door4GUID; - uint64 Door5GUID; - uint64 Door6GUID; - - uint64 PrisonCell1GUID; - uint64 PrisonCell2GUID; - uint64 PrisonCell3GUID; - uint64 PrisonCell4GUID; - uint64 PrisonCell5GUID; - uint64 PrisonCell6GUID; - uint64 PrisonCell7GUID; - uint64 PrisonCell8GUID; - - std::set<uint64> PrisonersCell5; - std::set<uint64> PrisonersCell6; - std::set<uint64> PrisonersCell7; - std::set<uint64> PrisonersCell8; - - uint8 PrisonerCounter5; - uint8 PrisonerCounter6; - uint8 PrisonerCounter7; - uint8 PrisonerCounter8; + instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map) + { + SetBossNumber(EncounterCount); + LoadDoorData(doorData); - uint64 BroggokLeverGUID; + TheMakerGUID = 0; + BroggokGUID = 0; + KelidanTheBreakerGUID = 0; - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; + BroggokLeverGUID = 0; + PrisonDoor4GUID = 0; - void Initialize() OVERRIDE - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - The_MakerGUID = 0; - BroggokGUID = 0; - Kelidan_The_BreakerGUID = 0; - - Door1GUID = 0; - Door2GUID = 0; - Door3GUID = 0; - Door4GUID = 0; - Door5GUID = 0; - Door6GUID = 0; - - PrisonCell1GUID = 0; - PrisonCell2GUID = 0; - PrisonCell3GUID = 0; - PrisonCell4GUID = 0; - PrisonCell5GUID = 0; - PrisonCell6GUID = 0; - PrisonCell7GUID = 0; - PrisonCell8GUID = 0; + memset(PrisonCellGUIDs, 0, 8 * sizeof(uint64)); PrisonersCell5.clear(); PrisonersCell6.clear(); PrisonersCell7.clear(); PrisonersCell8.clear(); - PrisonerCounter5 = 0; - PrisonerCounter6 = 0; - PrisonerCounter7 = 0; - PrisonerCounter8 = 0; - - BroggokLeverGUID = 0; + PrisonerCounter5 = 0; + PrisonerCounter6 = 0; + PrisonerCounter7 = 0; + PrisonerCounter8 = 0; } void OnCreatureCreate(Creature* creature) OVERRIDE { switch (creature->GetEntry()) { - case 17381: - The_MakerGUID = creature->GetGUID(); + case NPC_THE_MAKER: + TheMakerGUID = creature->GetGUID(); break; - case 17380: + case NPC_BROGGOK: BroggokGUID = creature->GetGUID(); break; - case 17377: - Kelidan_The_BreakerGUID = creature->GetGUID(); + case NPC_KELIDAN_THE_BREAKER: + KelidanTheBreakerGUID = creature->GetGUID(); break; - case 17398: + case NPC_PRISONER: StorePrisoner(creature); break; + default: + break; } } void OnUnitDeath(Unit* unit) OVERRIDE { - if (unit && unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == 17398) + if (unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == NPC_PRISONER) PrisonerDied(unit->GetGUID()); } void OnGameObjectCreate(GameObject* go) OVERRIDE { - if (go->GetEntry() == 181766) //Final exit door - Door1GUID = go->GetGUID(); - if (go->GetEntry() == 181811) //The Maker Front door - Door2GUID = go->GetGUID(); - if (go->GetEntry() == 181812) //The Maker Rear door - Door3GUID = go->GetGUID(); - if (go->GetEntry() == 181822) //Broggok Front door - Door4GUID = go->GetGUID(); - if (go->GetEntry() == 181819) //Broggok Rear door - Door5GUID = go->GetGUID(); - if (go->GetEntry() == 181823) //Kelidan exit door - Door6GUID = go->GetGUID(); - - if (go->GetEntry() == 181813) //The Maker prison cell front right - PrisonCell1GUID = go->GetGUID(); - if (go->GetEntry() == 181814) //The Maker prison cell back right - PrisonCell2GUID = go->GetGUID(); - if (go->GetEntry() == 181816) //The Maker prison cell front left - PrisonCell3GUID = go->GetGUID(); - if (go->GetEntry() == 181815) //The Maker prison cell back left - PrisonCell4GUID = go->GetGUID(); - if (go->GetEntry() == 181821) //Broggok prison cell front right - PrisonCell5GUID = go->GetGUID(); - if (go->GetEntry() == 181818) //Broggok prison cell back right - PrisonCell6GUID = go->GetGUID(); - if (go->GetEntry() == 181820) //Broggok prison cell front left - PrisonCell7GUID = go->GetGUID(); - if (go->GetEntry() == 181817) //Broggok prison cell back left - PrisonCell8GUID = go->GetGUID(); - - if (go->GetEntry() == 181982) - BroggokLeverGUID = go->GetGUID(); //Broggok lever - } - - uint64 GetData64(uint32 data) const OVERRIDE - { - switch (data) + switch (go->GetEntry()) { - case DATA_THE_MAKER: return The_MakerGUID; - case DATA_BROGGOK: return BroggokGUID; - case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; - case DATA_DOOR1: return Door1GUID; - case DATA_DOOR2: return Door2GUID; - case DATA_DOOR3: return Door3GUID; - case DATA_DOOR4: return Door4GUID; - case DATA_DOOR5: return Door5GUID; - case DATA_DOOR6: return Door6GUID; - case DATA_PRISON_CELL1: return PrisonCell1GUID; - case DATA_PRISON_CELL2: return PrisonCell2GUID; - case DATA_PRISON_CELL3: return PrisonCell3GUID; - case DATA_PRISON_CELL4: return PrisonCell4GUID; - case DATA_PRISON_CELL5: return PrisonCell5GUID; - case DATA_PRISON_CELL6: return PrisonCell6GUID; - case DATA_PRISON_CELL7: return PrisonCell7GUID; - case DATA_PRISON_CELL8: return PrisonCell8GUID; - case DATA_BROGGOK_LEVER: return BroggokLeverGUID; + case GO_PRISON_DOOR_04: + PrisonDoor4GUID = go->GetGUID(); + // no break + case GO_PRISON_DOOR_01: + case GO_PRISON_DOOR_02: + case GO_PRISON_DOOR_03: + case GO_PRISON_DOOR_05: + case GO_SUMMON_DOOR: + AddDoor(go, true); + break; + case GO_BROGGOK_LEVER: + BroggokLeverGUID = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_1: + PrisonCellGUIDs[DATA_PRISON_CELL1 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_2: + PrisonCellGUIDs[DATA_PRISON_CELL2 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_3: + PrisonCellGUIDs[DATA_PRISON_CELL3 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_4: + PrisonCellGUIDs[DATA_PRISON_CELL4 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_5: + PrisonCellGUIDs[DATA_PRISON_CELL5 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_6: + PrisonCellGUIDs[DATA_PRISON_CELL6 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_7: + PrisonCellGUIDs[DATA_PRISON_CELL7 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + case GO_PRISON_CELL_DOOR_8: + PrisonCellGUIDs[DATA_PRISON_CELL8 - DATA_PRISON_CELL1] = go->GetGUID(); + break; + default: + break; } - return 0; } - void SetData(uint32 type, uint32 data) OVERRIDE + void OnGameObjectRemove(GameObject* go) OVERRIDE { - switch (type) - { - case TYPE_THE_MAKER_EVENT: - m_auiEncounter[0] = data; - break; - case TYPE_BROGGOK_EVENT: - m_auiEncounter[1] = data; - UpdateBroggokEvent(data); - break; - case TYPE_KELIDAN_THE_BREAKER_EVENT: - m_auiEncounter[2] = data; - break; - } - - if (data == DONE) + switch (go->GetEntry()) { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; + case GO_PRISON_DOOR_01: + case GO_PRISON_DOOR_02: + case GO_PRISON_DOOR_03: + case GO_PRISON_DOOR_04: + case GO_PRISON_DOOR_05: + case GO_SUMMON_DOOR: + AddDoor(go, false); + break; + default: + break; } } - uint32 GetData(uint32 type) const OVERRIDE + uint64 GetData64(uint32 type) const OVERRIDE { switch (type) { - case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; - case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; - case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; + case DATA_THE_MAKER: + return TheMakerGUID; + case DATA_BROGGOK: + return BroggokGUID; + case DATA_KELIDAN_THE_BREAKER: + return KelidanTheBreakerGUID; + case DATA_BROGGOK_LEVER: + return BroggokLeverGUID; } - return 0; - } - const char* Save() - { - return str_data.c_str(); + return 0; } - void Load(const char* in) OVERRIDE + bool SetBossState(uint32 type, EncounterState state) OVERRIDE { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); + if (!InstanceScript::SetBossState(type, state)) + return false; - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; - - for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } - - void UpdateBroggokEvent(uint32 data) - { - switch (data) + switch (type) { - case IN_PROGRESS: - ActivateCell(DATA_PRISON_CELL5); - HandleGameObject(Door4GUID, false); + case DATA_BROGGOK: + switch (state) + { + case IN_PROGRESS: + ActivateCell(DATA_PRISON_CELL5); + break; + case NOT_STARTED: + ResetPrisons(); + if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID)) + lever->Respawn(); + break; + default: + break; + } break; - case NOT_STARTED: - ResetPrisons(); - HandleGameObject(Door5GUID, false); - HandleGameObject(Door4GUID, true); - if (GameObject* lever = instance->GetGameObject(BroggokLeverGUID)) - lever->Respawn(); + default: break; } + + return true; } void ResetPrisons() { PrisonerCounter5 = PrisonersCell5.size(); ResetPrisoners(PrisonersCell5); - HandleGameObject(PrisonCell5GUID, false); + HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL5 - DATA_PRISON_CELL1], false); PrisonerCounter6 = PrisonersCell6.size(); ResetPrisoners(PrisonersCell6); - HandleGameObject(PrisonCell6GUID, false); + HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL6 - DATA_PRISON_CELL1], false); PrisonerCounter7 = PrisonersCell7.size(); ResetPrisoners(PrisonersCell7); - HandleGameObject(PrisonCell7GUID, false); + HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL7 - DATA_PRISON_CELL1], false); PrisonerCounter8 = PrisonersCell8.size(); ResetPrisoners(PrisonersCell8); - HandleGameObject(PrisonCell8GUID, false); + HandleGameObject(PrisonCellGUIDs[DATA_PRISON_CELL8 - DATA_PRISON_CELL1], false); } void ResetPrisoners(const std::set<uint64>& prisoners) @@ -367,7 +281,7 @@ class instance_blood_furnace : public InstanceMapScript else if (PrisonersCell7.find(guid) != PrisonersCell7.end() && --PrisonerCounter7 <= 0) ActivateCell(DATA_PRISON_CELL8); else if (PrisonersCell8.find(guid) != PrisonersCell8.end() && --PrisonerCounter8 <= 0) - ActivateCell(DATA_DOOR5); + ActivateCell(DATA_DOOR_4); } void ActivateCell(uint8 id) @@ -375,30 +289,30 @@ class instance_blood_furnace : public InstanceMapScript switch (id) { case DATA_PRISON_CELL5: - HandleGameObject(PrisonCell5GUID, true); + HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true); ActivatePrisoners(PrisonersCell5); break; case DATA_PRISON_CELL6: - HandleGameObject(PrisonCell6GUID, true); + HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true); ActivatePrisoners(PrisonersCell6); break; case DATA_PRISON_CELL7: - HandleGameObject(PrisonCell7GUID, true); + HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true); ActivatePrisoners(PrisonersCell7); break; case DATA_PRISON_CELL8: - HandleGameObject(PrisonCell8GUID, true); + HandleGameObject(PrisonCellGUIDs[id - DATA_PRISON_CELL1], true); ActivatePrisoners(PrisonersCell8); break; - case DATA_DOOR5: - HandleGameObject(Door5GUID, true); + case DATA_DOOR_4: + HandleGameObject(PrisonDoor4GUID, true); if (Creature* broggok = instance->GetCreature(BroggokGUID)) broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK); break; } } - void ActivatePrisoners(const std::set<uint64>& prisoners) + void ActivatePrisoners(std::set<uint64> const& prisoners) { for (std::set<uint64>::const_iterator i = prisoners.begin(); i != prisoners.end(); ++i) if (Creature* prisoner = instance->GetCreature(*i)) @@ -407,6 +321,69 @@ class instance_blood_furnace : public InstanceMapScript prisoner->SetInCombatWithZone(); } } + + std::string GetSaveData() OVERRIDE + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "B F " << GetBossSaveData(); + + OUT_SAVE_INST_DATA_COMPLETE; + return saveStream.str(); + } + + void Load(char const* str) OVERRIDE + { + if (!str) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(str); + + char dataHead1, dataHead2; + + std::istringstream loadStream(str); + loadStream >> dataHead1 >> dataHead2; + + if (dataHead1 == 'B' && dataHead2 == 'F') + { + for (uint32 i = 0; i < EncounterCount; ++i) + { + uint32 tmpState; + loadStream >> tmpState; + if (tmpState == IN_PROGRESS || tmpState > SPECIAL) + tmpState = NOT_STARTED; + SetBossState(i, EncounterState(tmpState)); + } + } + else + OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } + + protected: + uint64 TheMakerGUID; + uint64 BroggokGUID; + uint64 KelidanTheBreakerGUID; + + uint64 BroggokLeverGUID; + uint64 PrisonDoor4GUID; + + uint64 PrisonCellGUIDs[8]; + + std::set<uint64>PrisonersCell5; + std::set<uint64>PrisonersCell6; + std::set<uint64>PrisonersCell7; + std::set<uint64>PrisonersCell8; + + uint8 PrisonerCounter5; + uint8 PrisonerCounter6; + uint8 PrisonerCounter7; + uint8 PrisonerCounter8; }; InstanceScript* GetInstanceScript(InstanceMap* map) const OVERRIDE diff --git a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp index 83b4f0440e0..cc58be26664 100644 --- a/src/server/scripts/Outland/zone_blades_edge_mountains.cpp +++ b/src/server/scripts/Outland/zone_blades_edge_mountains.cpp @@ -1125,7 +1125,7 @@ public: struct npc_oscillating_frequency_scanner_master_bunnyAI : public ScriptedAI { - npc_oscillating_frequency_scanner_master_bunnyAI(Creature* creature) : ScriptedAI(creature) + npc_oscillating_frequency_scanner_master_bunnyAI(Creature* creature) : ScriptedAI(creature) { playerGuid = 0; } diff --git a/src/server/scripts/Pet/pet_dk.cpp b/src/server/scripts/Pet/pet_dk.cpp index daeb0d71720..61c3de0e6b1 100644 --- a/src/server/scripts/Pet/pet_dk.cpp +++ b/src/server/scripts/Pet/pet_dk.cpp @@ -54,7 +54,7 @@ class npc_pet_dk_ebon_gargoyle : public CreatureScript uint64 ownerGuid = me->GetOwnerGUID(); if (!ownerGuid) return; - + // Find victim of Summon Gargoyle spell std::list<Unit*> targets; Trinity::AnyUnfriendlyUnitInObjectRangeCheck u_check(me, me, 30.0f); diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 0db35bf2fe6..8a0b78b5478 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -25,9 +25,9 @@ enum HunterSpells { - SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper - SPELL_HUNTER_DEADLY_POISON = 34655, // Venomous Snake - SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper + SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper + SPELL_HUNTER_DEADLY_POISON_PASSIVE = 34657, // Venomous Snake + SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper }; enum HunterCreatures @@ -57,14 +57,17 @@ class npc_pet_hunter_snake_trap : public CreatureScript me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f)); // Add delta to make them not all hit the same time uint32 delta = (rand() % 7) * 100; - me->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, float(Info->baseattacktime + delta)); - me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower)); + me->SetAttackTime(BASE_ATTACK, Info->baseattacktime + delta); + //me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower)); // Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target if (!me->GetVictim() && me->IsSummon()) if (Unit* Owner = me->ToTempSummon()->GetSummoner()) if (Owner->getAttackerForHelper()) AttackStart(Owner->getAttackerForHelper()); + + if (!_isViper) + DoCast(me, SPELL_HUNTER_DEADLY_POISON_PASSIVE, true); } // Redefined for random target selection: @@ -99,32 +102,19 @@ class npc_pet_hunter_snake_trap : public CreatureScript return; } - if (_spellTimer <= diff) + // Viper + if (_isViper) { - if (_isViper) // Viper + if (_spellTimer <= diff) { - if (urand(0, 2) == 0) //33% chance to cast - { - uint32 spell; - if (urand(0, 1) == 0) - spell = SPELL_HUNTER_MIND_NUMBING_POISON; - else - spell = SPELL_HUNTER_CRIPPLING_POISON; - - DoCastVictim(spell); - } + if (urand(0, 2) == 0) // 33% chance to cast + DoCastVictim(RAND(SPELL_HUNTER_MIND_NUMBING_POISON, SPELL_HUNTER_CRIPPLING_POISON)); _spellTimer = 3000; } - else // Venomous Snake - { - if (urand(0, 2) == 0) // 33% chance to cast - DoCastVictim(SPELL_HUNTER_DEADLY_POISON); - _spellTimer = 1500 + (rand() % 5) * 100; - } + else + _spellTimer -= diff; } - else - _spellTimer -= diff; DoMeleeAttackIfReady(); } diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 3f5bb34015e..e1ef9ea6862 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -879,7 +879,7 @@ class spell_dk_presence : public SpellScriptLoader { Unit* target = GetTarget(); - if (GetSpellInfo()->Id == SPELL_DK_BLOOD_PRESENCE) + if (GetId() == SPELL_DK_BLOOD_PRESENCE) target->CastSpell(target, SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED, true); else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_R1, EFFECT_0)) if (!target->HasAura(SPELL_DK_IMPROVED_BLOOD_PRESENCE_TRIGGERED)) @@ -890,7 +890,7 @@ class spell_dk_presence : public SpellScriptLoader { Unit* target = GetTarget(); - if (GetSpellInfo()->Id == SPELL_DK_FROST_PRESENCE) + if (GetId() == SPELL_DK_FROST_PRESENCE) target->CastSpell(target, SPELL_DK_FROST_PRESENCE_TRIGGERED, true); else if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_FROST_PRESENCE_R1, EFFECT_0)) if (!target->HasAura(SPELL_DK_FROST_PRESENCE_TRIGGERED)) @@ -901,12 +901,12 @@ class spell_dk_presence : public SpellScriptLoader { Unit* target = GetTarget(); - if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE) + if (GetId() == SPELL_DK_UNHOLY_PRESENCE) target->CastSpell(target, SPELL_DK_UNHOLY_PRESENCE_TRIGGERED, true); if (AuraEffect const* impAurEff = target->GetAuraEffectOfRankedSpell(SPELL_DK_IMPROVED_UNHOLY_PRESENCE_R1, EFFECT_0)) { - if (GetSpellInfo()->Id == SPELL_DK_UNHOLY_PRESENCE) + if (GetId() == SPELL_DK_UNHOLY_PRESENCE) { // Not listed as any effect, only base points set int32 bp = impAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index e9a010868d8..ac30f6f1e80 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -34,7 +34,6 @@ npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 56 npc_injured_patient 100% patients for triage-quests (6622 and 6624) npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage) npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy -npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681 npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap npc_shadowfiend 100% restore 5% of owner's mana when shadowfiend die from damage @@ -1239,86 +1238,6 @@ public: } }; -/*###### -## npc_rogue_trainer -######*/ - -#define GOSSIP_HELLO_ROGUE1 "I wish to unlearn my talents" -#define GOSSIP_HELLO_ROGUE2 "<Take the letter>" -#define GOSSIP_HELLO_ROGUE3 "Purchase a Dual Talent Specialization." - -class npc_rogue_trainer : public CreatureScript -{ -public: - npc_rogue_trainer() : CreatureScript("npc_rogue_trainer") { } - - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (creature->IsTrainer()) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); - - if (player->getClass() == CLASS_ROGUE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE1, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS); - - if (player->GetSpecsCount() == 1 && player->getLevel() >= sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_HELLO_ROGUE3, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_LEARNDUALSPEC); - - if (player->getClass() == CLASS_ROGUE && player->getLevel() >= 24 && !player->HasItemCount(17126) && !player->GetQuestRewardStatus(6681)) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HELLO_ROGUE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - player->SEND_GOSSIP_MENU(5996, creature->GetGUID()); - } else - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, 21100, false); - break; - case GOSSIP_ACTION_TRAIN: - player->GetSession()->SendTrainerList(creature->GetGUID()); - break; - case GOSSIP_OPTION_UNLEARNTALENTS: - player->CLOSE_GOSSIP_MENU(); - player->SendTalentWipeConfirm(creature->GetGUID()); - break; - case GOSSIP_OPTION_LEARNDUALSPEC: - if (player->GetSpecsCount() == 1 && !(player->getLevel() < sWorld->getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))) - { - if (!player->HasEnoughMoney(10000000)) - { - player->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, 0, 0, 0); - player->PlayerTalkClass->SendCloseGossip(); - break; - } - else - { - player->ModifyMoney(-10000000); - - // Cast spells that teach dual spec - // Both are also ImplicitTarget self and must be cast by player - player->CastSpell(player, 63680, true, NULL, NULL, player->GetGUID()); - player->CastSpell(player, 63624, true, NULL, NULL, player->GetGUID()); - - // Should show another Gossip text with "Congratulations..." - player->PlayerTalkClass->SendCloseGossip(); - } - } - break; - } - return true; - } -}; /*###### ## npc_sayge @@ -2445,7 +2364,6 @@ void AddSC_npcs_special() new npc_garments_of_quests(); new npc_guardian(); new npc_mount_vendor(); - new npc_rogue_trainer(); new npc_sayge(); new npc_steam_tonk(); new npc_tonk_mine(); |
