WotLK Daily Heroic progression awareness

This commit is contained in:
郑佩茹
2022-09-29 17:44:56 -06:00
parent a1db49f672
commit 0fd19ea840
2 changed files with 142 additions and 0 deletions

View File

@@ -76,3 +76,5 @@ INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `b
DELETE FROM `creature_template_addon` WHERE `entry`=31629;
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `visibilityDistanceType`, `auras`) VALUES (31629, 0, 0, 50331648, 0, 0, 0, '');
UPDATE `quest_template` SET `RewardItem1` = 40752 WHERE id IN (13245, 13246, 13247, 13248, 13249, 13250, 13251, 13252, 13253, 13254, 13255, 13256, 14199);

View File

@@ -2,6 +2,7 @@
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "ScriptedGossip.h"
#include "IndividualProgression.h"
enum ArchmageTimearQuests
{
@@ -134,7 +135,146 @@ public:
};
};
enum ArchmageLandalockQuests
{
QUEST_SARTHARION_MUST_DIE = 24579,
QUEST_ANUBREKHAN_MUST_DIE = 24580,
QUEST_NOTH_THE_PLAGUEBINGER_MUST_DIE = 24581,
QUEST_INSTRUCTOR_RAZUVIOUS_MUST_DIE = 24582,
QUEST_PATCHWERK_MUST_DIE = 24583,
QUEST_MALYGOS_MUST_DIE = 24584,
QUEST_FLAME_LEVIATHAN_MUST_DIE = 24585,
QUEST_RAZORSCALE_MUST_DIE = 24586,
QUEST_IGNIS_THE_FURNACE_MASTER_MUST_DIE = 24587,
QUEST_XT_002_DECONSTRUCTOR_MUST_DIE = 24588,
QUEST_LORD_JARAXXUS_MUST_DIE = 24589,
QUEST_LORD_MARROWGAR_MUST_DIE = 24590
};
enum ArchmageLandalockImages
{
NPC_SARTHARION_IMAGE = 37849,
NPC_ANUBREKHAN_IMAGE = 37850,
NPC_NOTH_THE_PLAGUEBINGER_IMAGE = 37851,
NPC_INSTRUCTOR_RAZUVIOUS_IMAGE = 37853,
NPC_PATCHWERK_IMAGE = 37854,
NPC_MALYGOS_IMAGE = 37855,
NPC_FLAME_LEVIATHAN_IMAGE = 37856,
NPC_RAZORSCALE_IMAGE = 37858,
NPC_IGNIS_THE_FURNACE_MASTER_IMAGE = 37859,
NPC_XT_002_DECONSTRUCTOR_IMAGE = 37861,
NPC_LORD_JARAXXUS_IMAGE = 37862,
NPC_LORD_MARROWGAR_IMAGE = 37864
};
class npc_archmage_landalock_ipp : public CreatureScript
{
public:
npc_archmage_landalock_ipp() : CreatureScript("npc_archmage_landalock")
{
}
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_archmage_landalock_ippAI(creature);
}
struct npc_archmage_landalock_ippAI : public ScriptedAI
{
npc_archmage_landalock_ippAI(Creature* creature) : ScriptedAI(creature)
{
_switchImageTimer = MINUTE * IN_MILLISECONDS;
_summonGUID.Clear();
}
bool CanBeSeen(Player const* player) override
{
if (player->IsGameMaster())
{
return true;
}
Player* target = ObjectAccessor::FindConnectedPlayer(player->GetGUID());
return sIndividualProgression->hasPassedProgression(target, PROGRESSION_WOTLK_TIER_3);
}
uint32 GetImageEntry(uint32 QuestId)
{
switch (QuestId)
{
case QUEST_SARTHARION_MUST_DIE:
return NPC_SARTHARION_IMAGE;
case QUEST_ANUBREKHAN_MUST_DIE:
return NPC_ANUBREKHAN_IMAGE;
case QUEST_NOTH_THE_PLAGUEBINGER_MUST_DIE:
return NPC_NOTH_THE_PLAGUEBINGER_IMAGE;
case QUEST_INSTRUCTOR_RAZUVIOUS_MUST_DIE:
return NPC_INSTRUCTOR_RAZUVIOUS_IMAGE;
case QUEST_PATCHWERK_MUST_DIE:
return NPC_PATCHWERK_IMAGE;
case QUEST_MALYGOS_MUST_DIE:
return NPC_MALYGOS_IMAGE;
case QUEST_FLAME_LEVIATHAN_MUST_DIE:
return NPC_FLAME_LEVIATHAN_IMAGE;
case QUEST_RAZORSCALE_MUST_DIE:
return NPC_RAZORSCALE_IMAGE;
case QUEST_IGNIS_THE_FURNACE_MASTER_MUST_DIE:
return NPC_IGNIS_THE_FURNACE_MASTER_IMAGE;
case QUEST_XT_002_DECONSTRUCTOR_MUST_DIE:
return NPC_XT_002_DECONSTRUCTOR_IMAGE;
case QUEST_LORD_JARAXXUS_MUST_DIE:
return NPC_LORD_JARAXXUS_IMAGE;
default: //case QUEST_LORD_MARROWGAR_MUST_DIE:
return NPC_LORD_MARROWGAR_IMAGE;
}
}
void JustSummoned(Creature* image) override
{
// xinef: screams like a baby
if (image->GetEntry() != NPC_ANUBREKHAN_IMAGE)
image->SetUnitMovementFlags(MOVEMENTFLAG_RIGHT);
_summonGUID = image->GetGUID();
}
void UpdateAI(uint32 diff) override
{
ScriptedAI::UpdateAI(diff);
_switchImageTimer += diff;
if (_switchImageTimer > MINUTE * IN_MILLISECONDS)
{
_switchImageTimer = 0;
QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(me->GetEntry());
for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i)
{
uint32 questId = i->second;
Quest const* quest = sObjectMgr->GetQuestTemplate(questId);
if (!quest || !quest->IsWeekly())
continue;
uint32 newEntry = GetImageEntry(questId);
if (_summonGUID.GetEntry() != newEntry)
{
if (Creature* image = ObjectAccessor::GetCreature(*me, _summonGUID))
image->DespawnOrUnsummon();
float z = 653.622f;
if (newEntry == NPC_MALYGOS_IMAGE || newEntry == NPC_RAZORSCALE_IMAGE || newEntry == NPC_SARTHARION_IMAGE)
z += 3.0f;
me->SummonCreature(newEntry, 5703.077f, 583.9757f, z, 3.926991f);
}
}
}
}
private:
uint32 _switchImageTimer;
ObjectGuid _summonGUID;
};
};
void AddSC_npc_archmage_timear()
{
new npc_archmage_timear();
new npc_archmage_landalock_ipp();
}