mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-14 22:19:25 +01:00
Misc:
- Fix missing newlines - Fix some startup errors
This commit is contained in:
@@ -254,182 +254,6 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_second_trial_controller
|
||||
######*/
|
||||
|
||||
class npc_second_trial_controller : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_second_trial_controller() : CreatureScript("npc_second_trial_controller") { }
|
||||
|
||||
bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest)
|
||||
{
|
||||
// One Player exclusive quest, wait for user go activation
|
||||
if (quest->GetQuestId() == QUEST_SECOND_TRIAL)
|
||||
CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->questPhase = 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
// quest only available if not already started
|
||||
// Quest_template flag is set to : QUEST_FLAGS_EVENT
|
||||
// Escort quests or any other event-driven quests. If player in party, all players that can accept this quest will receive confirmation box to accept quest.
|
||||
// !not sure if this really works!
|
||||
|
||||
if (CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->questPhase == 0)
|
||||
{
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
player->SendPreparedQuest(creature->GetGUID());
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(creature->GetEntry(), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new master_kelerun_bloodmournAI (creature);
|
||||
}
|
||||
|
||||
struct master_kelerun_bloodmournAI : public ScriptedAI
|
||||
{
|
||||
master_kelerun_bloodmournAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
uint8 questPhase;
|
||||
uint8 paladinPhase;
|
||||
uint32 timer;
|
||||
|
||||
uint64 paladinGuid[4];
|
||||
|
||||
void Reset()
|
||||
{
|
||||
questPhase = 0;
|
||||
timer = 60000;
|
||||
paladinPhase = 0;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
paladinGuid[i] = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
// Quest accepted but object not activated, object despawned (if in sync 1 minute!)
|
||||
if (questPhase == 1)
|
||||
{
|
||||
if (timer <= diff)
|
||||
Reset();
|
||||
else
|
||||
timer -= diff;
|
||||
}
|
||||
// fight the 4 paladin mobs phase
|
||||
else if (questPhase == 2)
|
||||
{
|
||||
if (timer <= diff)
|
||||
{
|
||||
if (Creature* paladinSpawn = Unit::GetCreature((*me), paladinGuid[paladinPhase]))
|
||||
{
|
||||
CAST_AI(npc_second_trial_paladin::npc_secondTrialAI, paladinSpawn->AI())->Activate(me->GetGUID());
|
||||
|
||||
switch (paladinPhase)
|
||||
{
|
||||
case 0:
|
||||
Talk(TEXT_SECOND_TRIAL_1);
|
||||
break;
|
||||
case 1:
|
||||
Talk(TEXT_SECOND_TRIAL_2);
|
||||
break;
|
||||
case 2:
|
||||
Talk(TEXT_SECOND_TRIAL_3);
|
||||
break;
|
||||
case 3:
|
||||
Talk(TEXT_SECOND_TRIAL_4);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
Reset();
|
||||
|
||||
questPhase = 4;
|
||||
timer = OFFSET_NEXT_ATTACK;
|
||||
}
|
||||
else
|
||||
timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
if (questPhase == 1)
|
||||
{ // no player check, quest can be finished as group, so no complex PlayerGUID/group search code
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (Creature* summoned = DoSpawnCreature(PaladinEntry[i], SpawnPosition[i].x, SpawnPosition[i].y, SpawnPosition[i].z, SpawnPosition[i].o, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 180000))
|
||||
paladinGuid[i] = summoned->GetGUID();
|
||||
|
||||
timer = OFFSET_NEXT_ATTACK;
|
||||
questPhase = 2;
|
||||
}
|
||||
}
|
||||
|
||||
void SecondTrialKill()
|
||||
{
|
||||
if (questPhase > 0)
|
||||
{
|
||||
++paladinPhase;
|
||||
|
||||
if (paladinPhase < 4)
|
||||
questPhase = 2;
|
||||
else
|
||||
Reset(); // Quest Complete, QuestComplete handler is
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* /*c*/) {}
|
||||
};
|
||||
};
|
||||
|
||||
void npc_second_trial_paladin::npc_secondTrialAI::JustDied(Unit* Killer)
|
||||
{
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (Creature* summoner = Unit::GetCreature((*me), summonerGuid))
|
||||
CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, summoner->AI())->SecondTrialKill();
|
||||
|
||||
// last kill quest complete for group
|
||||
if (me->GetEntry() == CHAMPION_SUNSTRIKER)
|
||||
{
|
||||
if (Killer->GetTypeId() == TYPEID_PLAYER)
|
||||
Killer->ToPlayer()->GroupEventHappens(QUEST_SECOND_TRIAL, Killer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*######
|
||||
## go_second_trial
|
||||
######*/
|
||||
class go_second_trial : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_second_trial() : GameObjectScript("go_second_trial") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go)
|
||||
{
|
||||
// find spawn :: master_kelerun_bloodmourn
|
||||
if (Creature* creature = go->FindNearestCreature(MASTER_KELERUN_BLOODMOURN, 30.0f))
|
||||
CAST_AI(npc_second_trial_controller::master_kelerun_bloodmournAI, creature->AI())->StartEvent();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_apprentice_mirveda
|
||||
######*/
|
||||
@@ -629,9 +453,6 @@ public:
|
||||
|
||||
void AddSC_eversong_woods()
|
||||
{
|
||||
new npc_second_trial_controller();
|
||||
new npc_second_trial_paladin();
|
||||
new go_second_trial();
|
||||
new npc_apprentice_mirveda();
|
||||
new npc_infused_crystal();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user