Scripts/VP: fixed achievement 'Extra Credit Bonus Stage!'

This commit is contained in:
Ovahlord
2019-11-10 14:33:56 +01:00
parent 53d2ecf123
commit f0a5b4f400
5 changed files with 104 additions and 13 deletions

View File

@@ -0,0 +1,39 @@
SET @CGUID := 395096;
DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+8;
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `PhaseId`, `PhaseGroup`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
(@CGUID+0, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -430.007, -111.033, 626.0352, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+1, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -754.8438, -61.96528, 635.946, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+2, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -1032.677, -38.38542, 705.9167, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+3, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -1088.38, -56.26042, 705.9065, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+4, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -1190.595, 73.69444, 754.2231, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+5, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -1226.01, 88.93056, 754.2231, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+6, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -1046.92, 419.4653, 698.1262, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+7, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -1004.285, 430.224, 657.9739, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595), -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
(@CGUID+8, 51157, 657, 0, 0, 2, 169, 0, 0, 0, -763.6198, 411.309, 682.6913, 0, 604800, 0, 0, 0, 0, 0, 0, 0, 0, 15595); -- Golden Orb (Area: -Unknown- - Difficulty: 0) (Auras: 94316 - Golden Orb Visual)
DELETE FROM `creature_addon` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+242;
INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
(@CGUID+0, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+1, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+2, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+3, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+4, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+5, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+6, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+7, 0, 0, 0, 1, 0, '94316'), -- Golden Orb - 94316 - Golden Orb Visual
(@CGUID+8, 0, 0, 0, 1, 0, '94316'); -- Golden Orb - 94316 - Golden Orb Visual
DELETE FROM `creature_template_movement` WHERE `CreatureId`= 51157;
INSERT INTO `creature_template_movement` (`CreatureId`, `Flight`) VALUES
(51157, 1);
UPDATE `npc_spellclick_spells` SET `spell_id`= 68742 WHERE `npc_entry`= 51157;
-- Creature Golden Orb 51157 SAI
SET @ENTRY := 51157;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`= @ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(@ENTRY, 0, 0, 1, 8, 0, 100, 1, 68742, 0, 0, 0, 34, 14, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "On spell Interact Dummy (68742) hit - Set instance data #14 to 0 // "),
(@ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 28, 94316, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Remove aura due to spell Golden Orb Visual (94316) // "),
(@ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 41, 1400, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, " Linked - Self: Despawn in 1400 ms // ");

View File

@@ -9689,6 +9689,13 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
data << uint32(3106) << uint32(0); // 10 WORLD_STATE_ZULAMAN_TIMER
}
break;
// The Vortex Pinnacle
case 5035:
if (instance && mapid == 657)
instance->FillInitialWorldStates(data);
else
data << uint32(5649) << uint32 (0);
break;
// Twin Peaks
case 5031:
if (bg && bg->GetTypeID(true) == BATTLEGROUND_TP)

View File

@@ -118,7 +118,8 @@ class instance_vortex_pinnacle : public InstanceMapScript
SummonGroundingFieldPrism(FirstPrismGroundingFieldTop, FirstPrismGroundingFieldPoints);
SummonGroundingFieldPrism(SecondPrismGroundingFieldTop, SecondPrismGroundingFieldPoints);
events.ScheduleEvent(EVENT_SUMMON_ZEPHYRS, 1s);
_events.ScheduleEvent(EVENT_SUMMON_ZEPHYRS, 1s);
_collectedGoldenOrbs = 0;
}
void OnCreatureCreate(Creature* creature) override
@@ -131,7 +132,7 @@ class instance_vortex_pinnacle : public InstanceMapScript
creature->SetDisplayId(creature->GetCreatureTemplate()->Modelid2);
break;
case NPC_AIR_CURRENT:
airCurrentGUIDs.push_back(creature->GetGUID());
_airCurrentGUIDs.push_back(creature->GetGUID());
break;
case NPC_SLIPSTREAM:
for (SlipstreamVehicleData info : SlipStreamInfo)
@@ -165,6 +166,9 @@ class instance_vortex_pinnacle : public InstanceMapScript
}
}
break;
case NPC_GOLDEN_ORB:
creature->SetDisplayId(creature->GetCreatureTemplate()->Modelid2);
break;
default:
break;
}
@@ -176,21 +180,37 @@ class instance_vortex_pinnacle : public InstanceMapScript
if (type == DATA_ALTAIRUS && (state == DONE || state == FAIL))
{
for (ObjectGuid guid : airCurrentGUIDs)
for (ObjectGuid guid : _airCurrentGUIDs)
if (Creature* air = instance->GetCreature(guid))
air->DespawnOrUnsummon(0, 30s);
airCurrentGUIDs.clear();
_airCurrentGUIDs.clear();
}
return true;
}
void SetData(uint32 type, uint32 value) override
{
switch (type)
{
case DATA_COLLECTED_GOLDEN_ORB:
_collectedGoldenOrbs++;
DoUpdateWorldState(WS_GOLDEN_ORBS_COLLECTED, _collectedGoldenOrbs);
if (_collectedGoldenOrbs == 5)
DoUpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET2, SPELL_ACHIEVEMENT_CHECK);
SaveToDB();
break;
default:
break;
}
}
void Update(uint32 diff) override
{
events.Update(diff);
_events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
@@ -201,7 +221,7 @@ class instance_vortex_pinnacle : public InstanceMapScript
if (instance->IsGridLoaded(NorthZephyrSummonLocation))
if (TempSummon* zephyr = instance->SummonCreature(NPC_ZEPHYR, NorthZephyrSummonLocation, nullptr, 18 * IN_MILLISECONDS))
zephyr->GetMotionMaster()->MovePath(PATH_ZEPHYR_NORTH, false);
events.Repeat(10s);
_events.Repeat(10s);
break;
default:
break;
@@ -209,6 +229,21 @@ class instance_vortex_pinnacle : public InstanceMapScript
}
}
void FillInitialWorldStates(WorldPacket& data) override
{
data << uint32(WS_GOLDEN_ORBS_COLLECTED) << uint32(_collectedGoldenOrbs);
}
void WriteSaveDataMore(std::ostringstream& data) override
{
data << _collectedGoldenOrbs;
}
void ReadSaveDataMore(std::istringstream& data) override
{
data >> _collectedGoldenOrbs;
}
private:
// Spawns Grounding Field prism
void SummonGroundingFieldPrism(Position positionTop, const Position positionPoints[PrismGroundingFieldPoints])
@@ -230,8 +265,9 @@ class instance_vortex_pinnacle : public InstanceMapScript
}
}
EventMap events;
GuidVector airCurrentGUIDs;
EventMap _events;
GuidVector _airCurrentGUIDs;
uint8 _collectedGoldenOrbs;
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override

View File

@@ -32,7 +32,7 @@
enum Texts
{
SAY_FEIGN_DEATH = 0,
SAY_FEIGN_DEATH = 0
};
enum Spells

View File

@@ -45,7 +45,9 @@ enum DataTypes
DATA_SLIPSTREAM_ASAAD_1,
DATA_SLIPSTREAM_ENTRANCE_1,
DATA_SLIPSTREAM_ENTRANCE_2
DATA_SLIPSTREAM_ENTRANCE_2,
DATA_COLLECTED_GOLDEN_ORB
};
enum VPCreatureIds
@@ -71,16 +73,18 @@ enum VPCreatureIds
NPC_ZEPHYR = 45991,
NPC_SKYFALL = 45981,
NPC_SKYFALL_STAR = 52019,
NPC_GOLDEN_ORB = 51157,
// Grounding Field
NPC_GROUNDING_FIELD = 47085
NPC_GROUNDING_FIELD = 47085,
};
enum VPSpells
{
SPELL_BEAM_A = 87721,
SPELL_BEAM_B = 87722,
SPELL_BEAM_C = 87723
SPELL_BEAM_C = 87723,
SPELL_ACHIEVEMENT_CHECK = 94756
};
enum VPActions
@@ -95,6 +99,11 @@ enum VPMisc
PATH_ZEPHYR_NORTH = 4599101
};
enum VPWorldStates
{
WS_GOLDEN_ORBS_COLLECTED = 5649
};
template <class AI, class T>
inline AI* GetVortexPinnacleAI(T* obj)
{