fix(Scripts/HallowsEnd): Fixed starting "Let the fires come" event. (#13487)
Fixes #13440 Fixes #13441
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
--
|
||||
UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x00000200 WHERE `entry`=23543;
|
||||
@@ -233,8 +233,6 @@ enum costumedOrphan
|
||||
|
||||
// Actions
|
||||
ACTION_START_EVENT = 1,
|
||||
DATA_EVENT = 1,
|
||||
DATA_ALLOW_START = 2,
|
||||
|
||||
// Talks
|
||||
TALK_SHADE_CONFLAGRATION = 0,
|
||||
@@ -403,14 +401,6 @@ struct npc_costumed_orphan_matron : public ScriptedAI
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 param) const override
|
||||
{
|
||||
if (param == DATA_ALLOW_START)
|
||||
return allowQuest;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (eventStarted)
|
||||
@@ -423,12 +413,11 @@ struct npc_costumed_orphan_matron : public ScriptedAI
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
void sGossipHello(Player* player) override
|
||||
{
|
||||
QuestRelationBounds pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
|
||||
QuestRelationBounds pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry());
|
||||
QuestRelationBounds pObjectQR = sObjectMgr->GetCreatureQuestRelationBounds(me->GetEntry());
|
||||
QuestRelationBounds pObjectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(me->GetEntry());
|
||||
|
||||
QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu();
|
||||
qm.ClearMenu();
|
||||
@@ -438,33 +427,45 @@ bool OnGossipHello(Player* player, Creature* creature)
|
||||
uint32 quest_id = i->second;
|
||||
QuestStatus status = player->GetQuestStatus(quest_id);
|
||||
if (status == QUEST_STATUS_COMPLETE)
|
||||
{
|
||||
qm.AddMenuItem(quest_id, 4);
|
||||
}
|
||||
else if (status == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
qm.AddMenuItem(quest_id, 4);
|
||||
}
|
||||
}
|
||||
|
||||
for (QuestRelations::const_iterator i = pObjectQR.first; i != pObjectQR.second; ++i)
|
||||
{
|
||||
uint32 quest_id = i->second;
|
||||
Quest const* pQuest = sObjectMgr->GetQuestTemplate(quest_id);
|
||||
if (!pQuest)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!player->CanTakeQuest(pQuest, false))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
else if (player->GetQuestStatus(quest_id) == QUEST_STATUS_NONE)
|
||||
{
|
||||
switch (quest_id)
|
||||
{
|
||||
case QUEST_LET_THE_FIRES_COME_A:
|
||||
case QUEST_LET_THE_FIRES_COME_H:
|
||||
if (!creature->AI()->GetData(DATA_ALLOW_START))
|
||||
if (!allowQuest)
|
||||
{
|
||||
qm.AddMenuItem(quest_id, 2);
|
||||
}
|
||||
break;
|
||||
case QUEST_STOP_THE_FIRES_A:
|
||||
case QUEST_STOP_THE_FIRES_H:
|
||||
if (creature->AI()->GetData(DATA_ALLOW_START))
|
||||
if (allowQuest)
|
||||
{
|
||||
qm.AddMenuItem(quest_id, 2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
qm.AddMenuItem(quest_id, 2);
|
||||
@@ -473,17 +474,17 @@ bool OnGossipHello(Player* player, Creature* creature)
|
||||
}
|
||||
}
|
||||
|
||||
player->SendPreparedQuest(creature->GetGUID());
|
||||
return true;
|
||||
player->SendPreparedQuest(me->GetGUID());
|
||||
}
|
||||
|
||||
bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest)
|
||||
void sQuestAccept(Player* /*player*/, Quest const* quest) override
|
||||
{
|
||||
if ((quest->GetQuestId() == QUEST_LET_THE_FIRES_COME_A || quest->GetQuestId() == QUEST_LET_THE_FIRES_COME_H) && !creature->AI()->GetData(DATA_ALLOW_START))
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
|
||||
return true;
|
||||
if ((quest->GetQuestId() == QUEST_LET_THE_FIRES_COME_A || quest->GetQuestId() == QUEST_LET_THE_FIRES_COME_H) && !allowQuest)
|
||||
{
|
||||
DoAction(ACTION_START_EVENT);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct npc_soh_fire_trigger : public NullCreatureAI
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user