fix(Scripts/Shattrath): Daily Dungeon quests holograms (#19233)

* fix(Scripts/Shattrath): Daily Dungeon quests holographs

* Move to single script + doaction SAI

* ocd

* use NEAR_PLAYER

* use only Wind Trader as SAI

* use creature_guid target

* rename action

* cleanup

* zzz

* Update zone_shattrath_city.cpp
This commit is contained in:
avarishd
2024-07-04 21:50:11 +03:00
committed by GitHub
parent ee3763392a
commit 7cf25c94ab
2 changed files with 168 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
-- Shattrath Daily Normal/Heroic holograms
UPDATE `creature_template` SET `ScriptName` = 'npc_shattrath_daily_quest' WHERE `entry` IN (24410,24854);
UPDATE `creature_template` SET `AIName` = 'SmartAI' WHERE `entry` = 24369;
DELETE FROM `smart_scripts` WHERE (`source_type` = 0 AND `entryorguid` = 24369);
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`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(24369, 0, 0, 1, 1, 0, 100, 1, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79464, 24854, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - Out of Combat - Do Action ID 1 (No Repeat)'),
(24369, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79462, 24410, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - Out of Combat - Do Action ID 1 (No Repeat)'),
(24369, 0, 2, 3, 101, 0, 100, 0, 1, 30, 60000, 60000, 60000, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79464, 24854, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - On 1 or More Players in Range - Do Action ID 1'),
(24369, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 10, 79462, 24410, 0, 0, 0, 0, 0, 0, 'Wind Trader Zhareem - On 1 or More Players in Range - Do Action ID 1');

View File

@@ -16,6 +16,7 @@
*/
#include "CreatureScript.h"
#include "PassiveAI.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "ScriptedEscortAI.h"
@@ -253,9 +254,166 @@ public:
};
};
enum ShattrathQuests
{
// QuestID : Creature Template ID
// Heroic Daily Quests
QUEST_H_NAZZAN = 11354, // 24410
QUEST_H_KELIDAN = 11362, // 24413
QUEST_H_BLADEFIST = 11363, // 24414
QUEST_H_QUAG = 11368, // 24419
QUEST_H_BLACKSTALKER = 11369, // 24420
QUEST_H_WARLORD = 11370, // 24421
QUEST_H_IKISS = 11372, // 24422
QUEST_H_SHAFFAR = 11373, // 24423
QUEST_H_EXARCH = 11374, // 24424
QUEST_H_MURMUR = 11375, // 24425
QUEST_H_EPOCH = 11378, // 24427
QUEST_H_AEONUS = 11382, // 24428
QUEST_H_WARP = 11384, // 24431
QUEST_H_CALCULATOR = 11386, // 21504
QUEST_H_SKYRISS = 11388, // 24435
QUEST_H_KAEL = 11499, // 24855
// Normal Daily Quests
QUEST_N_CENTURIONS = 11364, // 24411
QUEST_N_MYRMIDONS = 11371, // 24415
QUEST_N_INSTRUCTORS = 11376, // 24426
QUEST_N_LORDS = 11383, // 24429
QUEST_N_CHANNELERS = 11385, // 24430
QUEST_N_DESTROYERS = 11387, // 24432
QUEST_N_SENTINELS = 11389, // 24434
QUEST_N_SISTERS = 11500, // 24854
ACTION_UPDATE_QUEST_STATUS = 1,
POOL_SHATTRATH_DAILY_H = 356,
POOL_SHATTRATH_DAILY_N = 357,
// Image NPCs
NPC_SHATTRATH_DAILY_H = 24854,
NPC_SHATTRATH_DAILY_N = 24410
};
struct npc_shattrath_daily_quest : public NullCreatureAI
{
npc_shattrath_daily_quest(Creature* c) : NullCreatureAI(c) {}
void DoAction(int32 action) override
{
if (action == ACTION_UPDATE_QUEST_STATUS)
{
uint32 creature = me->GetEntry();
QueryResult result = CharacterDatabase.Query("SELECT `quest_id` FROM `pool_quest_save` WHERE `pool_id` = '{}'", creature == NPC_SHATTRATH_DAILY_H ? POOL_SHATTRATH_DAILY_H : POOL_SHATTRATH_DAILY_N);
if (result)
{
Field *fields = result->Fetch();
int quest_id = fields[0].Get<int>();
uint32 templateID;
if (creature == NPC_SHATTRATH_DAILY_H)
{
switch (quest_id)
{
case QUEST_H_NAZZAN:
templateID = 24410;
break;
case QUEST_H_KELIDAN:
templateID = 24413;
break;
case QUEST_H_BLADEFIST:
templateID = 24414;
break;
case QUEST_H_QUAG:
templateID = 24419;
break;
case QUEST_H_BLACKSTALKER:
templateID = 24420;
break;
case QUEST_H_WARLORD:
templateID = 24421;
break;
case QUEST_H_IKISS:
templateID = 24422;
break;
case QUEST_H_SHAFFAR:
templateID = 24423;
break;
case QUEST_H_EXARCH:
templateID = 24424;
break;
case QUEST_H_MURMUR:
templateID = 24425;
break;
case QUEST_H_EPOCH:
templateID = 24427;
break;
case QUEST_H_AEONUS:
templateID = 24428;
break;
case QUEST_H_WARP:
templateID = 24431;
break;
case QUEST_H_CALCULATOR:
templateID = 21504;
break;
case QUEST_H_SKYRISS:
templateID = 24435;
break;
case QUEST_H_KAEL:
templateID = 24855;
break;
default:
break;
}
}
if (creature == NPC_SHATTRATH_DAILY_N)
{
switch (quest_id)
{
case QUEST_N_CENTURIONS:
templateID = 24411;
break;
case QUEST_N_MYRMIDONS:
templateID = 24415;
break;
case QUEST_N_INSTRUCTORS:
templateID = 24426;
break;
case QUEST_N_LORDS:
templateID = 24429;
break;
case QUEST_N_CHANNELERS:
templateID = 24430;
break;
case QUEST_N_DESTROYERS:
templateID = 24432;
break;
case QUEST_N_SENTINELS:
templateID = 24434;
break;
case QUEST_N_SISTERS:
templateID = 24854;
break;
default:
break;
}
}
if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(templateID))
{
CreatureModel const* model = ObjectMgr::ChooseDisplayId(ci);
me->SetDisplayId(model->CreatureDisplayID, model->DisplayScale);
}
}
}
}
};
void AddSC_shattrath_city()
{
new npc_shattrathflaskvendors();
new npc_zephyr();
new npc_kservant();
RegisterCreatureAI(npc_shattrath_daily_quest);
}