diff options
| author | joschiwald <joschiwald.trinity@gmail.com> | 2015-08-23 14:43:11 +0200 |
|---|---|---|
| committer | joschiwald <joschiwald.trinity@gmail.com> | 2015-08-23 14:43:11 +0200 |
| commit | df21162fe44d2ff29c201a9004586f560789c38b (patch) | |
| tree | 5ba7d971af1c49ddbb6be895e8eab460d6188a14 /src/server/game | |
| parent | 68e6c95f16dc978066bb957407a1c3bfd4cb8505 (diff) | |
Scripts/VioletHold: rewrote the whole instance
thanks @MitchesD for help
Diffstat (limited to 'src/server/game')
| -rw-r--r-- | src/server/game/AI/ScriptedAI/ScriptedCreature.cpp | 16 | ||||
| -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, 69 insertions, 5 deletions
diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index aa7ec3b847f..f1ba985458e 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -457,7 +457,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() { @@ -467,6 +473,7 @@ void BossAI::_Reset() me->ResetLootMode(); events.Reset(); summons.DespawnAll(); + scheduler.CancelAll(); if (instance) instance->SetBossState(_bossId, NOT_STARTED); } @@ -475,14 +482,13 @@ void BossAI::_JustDied() { events.Reset(); summons.DespawnAll(); + scheduler.CancelAll(); if (instance) instance->SetBossState(_bossId, DONE); } void BossAI::_EnterCombat() { - me->setActive(true); - DoZoneInCombat(); if (instance) { // bosses do not respawn, check only on enter combat @@ -493,6 +499,10 @@ void BossAI::_EnterCombat() } instance->SetBossState(_bossId, IN_PROGRESS); } + + 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 1a4c3064a59..7d7811d9e75 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)) @@ -359,6 +360,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(); } @@ -384,6 +387,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 362c40a0982..5e1d1d37950 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -9590,6 +9590,17 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid) data << uint32(4131) << uint32(0); // 10 WORLDSTATE_ALGALON_DESPAWN_TIMER } break; + // Violet Hold + case 4415: + if (instance && mapid == 608) + instance->FillInitialWorldStates(data); + else + { + data << uint32(3816) << uint32(0); // 9 WORLD_STATE_VH_SHOW + data << uint32(3815) << uint32(100); // 10 WORLD_STATE_VH_PRISON_STATE + data << uint32(3810) << uint32(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 da806e5b038..5d44f3ec696 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 be05a9f4495..3e90e430590 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -273,6 +273,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 2b323e196a7..b69322f5720 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -423,6 +423,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 d9f24a9010a..f27f9220aaa 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3355,6 +3355,19 @@ void SpellMgr::LoadSpellInfoCorrections() //! HACK: This spell break quest complete for alliance and on retail not used °_O spellInfo->Effects[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 + spellInfo->Effects[EFFECT_0].RadiusEntry = sSpellRadiusStore.LookupEntry(EFFECT_RADIUS_25_YARDS); + break; + // ENDOF VIOLET HOLD + // // ULDUAR SPELLS // case 62374: // Pursued (Flame Leviathan) |
