diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2015-08-23 14:43:11 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2015-11-01 13:09:30 +0100 |
| commit | 92b08fc74b368e9512c5238d91e381b6df644219 (patch) | |
| tree | f5e6bba399cdca2d41a89006f6efbd0673fb5cda /src/server/game | |
| parent | 7b684e8813376a82526d78c44d00f282229fe471 (diff) | |
Scripts/VioletHold: rewrote the whole instance
thanks @MitchesD for help
(cherry picked from commit df21162fe44d2ff29c201a9004586f560789c38b)
(cherry picked from commit 3a4f54197c05ce4209c7e659acfd382896607265)
(cherry picked from commit f50df728201849ee7185d33c5a061c91e781c8de)
(cherry picked from commit 95bae7143f0f4bb7d5975f8a61daa3c533f48225)
(cherry picked from commit 5406f82044e7bd6ceb024a67f33c1674400cdc1f)
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 18 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.h | 4 | ||||
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedEscortAI.h | 4 | ||||
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 11 | ||||
| -rw-r--r-- | src/server/game/Instances/InstanceScript.cpp | 5 | ||||
| -rw-r--r-- | src/server/game/Instances/InstanceScript.h | 2 | ||||
| -rw-r--r-- | src/server/game/Movement/MotionMaster.cpp | 18 | ||||
| -rw-r--r-- | src/server/game/Movement/MotionMaster.h | 1 | ||||
| -rw-r--r-- | src/server/game/Spells/SpellMgr.cpp | 13 |
9 files changed, 70 insertions, 6 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 512385a67b6..28f9ad591df 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -446,7 +446,13 @@ BossAI::BossAI(Creature* creature, uint32 bossId) : ScriptedAI(creature), instance(creature->GetInstanceScript()), summons(creature), _boundary(instance ? instance->GetBossBoundary(bossId) : NULL), - _bossId(bossId) { } + _bossId(bossId) +{ + scheduler.SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }); +} void BossAI::_Reset() { @@ -457,6 +463,7 @@ void BossAI::_Reset() me->ResetLootMode(); events.Reset(); summons.DespawnAll(); + scheduler.CancelAll(); if (instance) instance->SetBossState(_bossId, NOT_STARTED); } @@ -465,15 +472,13 @@ void BossAI::_JustDied() { events.Reset(); summons.DespawnAll(); + scheduler.CancelAll(); if (instance) instance->SetBossState(_bossId, DONE); } void BossAI::_EnterCombat() { - me->SetCombatPulseDelay(5); - me->setActive(true); - DoZoneInCombat(); if (instance) { // bosses do not respawn, check only on enter combat @@ -484,6 +489,11 @@ void BossAI::_EnterCombat() } instance->SetBossState(_bossId, IN_PROGRESS); } + + me->SetCombatPulseDelay(5); + me->setActive(true); + DoZoneInCombat(); + ScheduleTasks(); } void BossAI::TeleportCheaters() diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 74d0654dff2..49e2e0e8518 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -23,6 +23,7 @@ #include "CreatureAI.h" #include "CreatureAIImpl.h" #include "InstanceScript.h" +#include "TaskScheduler.h" #define CAST_AI(a, b) (dynamic_cast<a*>(b)) #define ENSURE_AI(a,b) (EnsureAI<a>(b)) @@ -356,6 +357,8 @@ class BossAI : public ScriptedAI // is supposed to run more than once virtual void ExecuteEvent(uint32 /*eventId*/) { } + virtual void ScheduleTasks() { } + void Reset() override { _Reset(); } void EnterCombat(Unit* /*who*/) override { _EnterCombat(); } void JustDied(Unit* /*killer*/) override { _JustDied(); } @@ -382,6 +385,7 @@ class BossAI : public ScriptedAI EventMap events; SummonList summons; + TaskScheduler scheduler; private: BossBoundaryMap const* const _boundary; diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h index 1d71652c948..deabd1dc484 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.h @@ -68,8 +68,8 @@ struct npc_escortAI : public ScriptedAI void EnterEvadeMode() override; - void UpdateAI(uint32 diff) override; //the "internal" update, calls UpdateEscortAI() - virtual void UpdateEscortAI(uint32 const diff); //used when it's needed to add code in update (abilities, scripted events, etc) + void UpdateAI(uint32 diff) override; // the "internal" update, calls UpdateEscortAI() + virtual void UpdateEscortAI(uint32 diff); // used when it's needed to add code in update (abilities, scripted events, etc) void MovementInform(uint32, uint32) override; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index ab2d4fbdbd0..a1acbb9d7aa 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9267,6 +9267,17 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) packet.Worldstates.emplace_back(4131, 0); // 10 WORLDSTATE_ALGALON_DESPAWN_TIMER } break; + // Violet Hold + case 4415: + if (instance && mapid == 608) + instance->FillInitialWorldStates(packet); + else + { + packet.Worldstates.emplace_back(3816, 0); // 9 WORLD_STATE_VH_SHOW + packet.Worldstates.emplace_back(3815, 100); // 10 WORLD_STATE_VH_PRISON_STATE + packet.Worldstates.emplace_back(3810, 0); // 11 WORLD_STATE_VH_WAVE_COUNT + } + break; // Halls of Refection case 4820: if (instance && mapid == 668) diff --git a/src/server/game/Instances/InstanceScript.cpp b/src/server/game/Instances/InstanceScript.cpp index 80024879a43..01a82ecb5af 100644 --- a/src/server/game/Instances/InstanceScript.cpp +++ b/src/server/game/Instances/InstanceScript.cpp @@ -319,6 +319,11 @@ bool InstanceScript::SetBossState(uint32 id, EncounterState state) return false; } +bool InstanceScript::_SkipCheckRequiredBosses(Player const* player /*= nullptr*/) const +{ + return player && player->GetSession()->HasPermission(rbac::RBAC_PERM_SKIP_CHECK_INSTANCE_REQUIRED_BOSSES); +} + void InstanceScript::Load(char const* data) { if (!data) diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index d932c24abf3..609c43417d5 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -280,6 +280,8 @@ class InstanceScript : public ZoneScript void WriteSaveDataBossStates(std::ostringstream& data); virtual void WriteSaveDataMore(std::ostringstream& /*data*/) { } + bool _SkipCheckRequiredBosses(Player const* player = nullptr) const; + private: static void LoadObjectData(ObjectData const* creatureData, ObjectInfoMap& objectInfo); diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 117f4b675bf..ad6f1b457aa 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -417,6 +417,24 @@ void MotionMaster::MoveCirclePath(float x, float y, float z, float radius, bool init.Launch(); } +void MotionMaster::MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk) +{ + Movement::PointsArray path(pathPoints, pathPoints + pathSize); + + Movement::MoveSplineInit init(_owner); + init.MovebyPath(path); + init.SetSmooth(); + init.SetWalk(walk); + init.Launch(); + + // This code is not correct + // EffectMovementGenerator does not affect UNIT_STATE_ROAMING | UNIT_STATE_ROAMING_MOVE + // need to call PointMovementGenerator with various pointIds + Mutate(new EffectMovementGenerator(pointId), MOTION_SLOT_ACTIVE); + //Position pos(pathPoints[pathSize - 1].x, pathPoints[pathSize - 1].y, pathPoints[pathSize - 1].z); + //MovePoint(EVENT_CHARGE_PREPATH, pos, false); +} + void MotionMaster::MoveFall(uint32 id /*=0*/) { // use larger distance for vmap height search than in most other cases diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h index c8da50364ba..9a8950de9f7 100644 --- a/src/server/game/Movement/MotionMaster.h +++ b/src/server/game/Movement/MotionMaster.h @@ -185,6 +185,7 @@ class MotionMaster //: private std::stack<MovementGenerator *> { MoveJump(pos.m_positionX, pos.m_positionY, pos.m_positionZ, speedXY, speedZ, id); } void MoveJump(float x, float y, float z, float speedXY, float speedZ, uint32 id = EVENT_JUMP); void MoveCirclePath(float x, float y, float z, float radius, bool clockwise, uint8 stepCount); + void MoveSmoothPath(uint32 pointId, G3D::Vector3 const* pathPoints, size_t pathSize, bool walk); void MoveFall(uint32 id = 0); void MoveSeekAssistance(float x, float y, float z); diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index 9d6466dfab7..75f419dc99e 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3228,6 +3228,19 @@ void SpellMgr::LoadSpellInfoCorrections() //! HACK: This spell break quest complete for alliance and on retail not used °_O const_cast<SpellEffectInfo*>(spellInfo->GetEffect(EFFECT_0))->Effect = 0; break; + // VIOLET HOLD SPELLS + // + case 54258: // Water Globule (Ichoron) + case 54264: // Water Globule (Ichoron) + case 54265: // Water Globule (Ichoron) + case 54266: // Water Globule (Ichoron) + case 54267: // Water Globule (Ichoron) + // in 3.3.5 there is only one radius in dbc which is 0 yards in this case + // use max radius from 4.3.4 + const_cast<SpellEffectInfo*>(spellInfo->GetEffect(EFFECT_0))->RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); + break; + // ENDOF VIOLET HOLD + // // ULDUAR SPELLS // case 62374: // Pursued (Flame Leviathan) |
