mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-02 23:26:37 +01:00
Missing change from merge
This commit is contained in:
@@ -146,207 +146,6 @@ public:
|
||||
};
|
||||
};
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
/*######
|
||||
## npc_rinji
|
||||
######*/
|
||||
|
||||
enum eRinji
|
||||
{
|
||||
SAY_RIN_BY_OUTRUNNER = 0,
|
||||
|
||||
SAY_RIN_FREE = 0, //from here
|
||||
SAY_RIN_HELP = 1,
|
||||
SAY_RIN_COMPLETE = 2,
|
||||
SAY_RIN_PROGRESS_1 = 3,
|
||||
SAY_RIN_PROGRESS_2 = 4,
|
||||
|
||||
QUEST_RINJI_TRAPPED = 2742,
|
||||
NPC_RANGER = 2694,
|
||||
NPC_OUTRUNNER = 2691,
|
||||
GO_RINJI_CAGE = 142036
|
||||
};
|
||||
|
||||
struct Location
|
||||
{
|
||||
float m_fX, m_fY, m_fZ;
|
||||
};
|
||||
|
||||
Location m_afAmbushSpawn[] =
|
||||
{
|
||||
{191.296204f, -2839.329346f, 107.388f},
|
||||
{70.972466f, -2848.674805f, 109.459f}
|
||||
};
|
||||
|
||||
Location m_afAmbushMoveTo[] =
|
||||
{
|
||||
{166.630386f, -2824.780273f, 108.153f},
|
||||
{70.886589f, -2874.335449f, 116.675f}
|
||||
};
|
||||
|
||||
class npc_rinji : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_rinji() : CreatureScript("npc_rinji") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_RINJI_TRAPPED)
|
||||
{
|
||||
if (GameObject* go = creature->FindNearestGameObject(GO_RINJI_CAGE, INTERACTION_DISTANCE))
|
||||
go->UseDoorOrButton();
|
||||
|
||||
if (npc_rinjiAI* pEscortAI = CAST_AI(npc_rinji::npc_rinjiAI, creature->AI()))
|
||||
pEscortAI->Start(false, false, player->GetGUID(), quest);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_rinjiAI(creature);
|
||||
}
|
||||
|
||||
struct npc_rinjiAI : public npc_escortAI
|
||||
{
|
||||
npc_rinjiAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
m_bIsByOutrunner = false;
|
||||
m_iSpawnId = 0;
|
||||
}
|
||||
|
||||
bool m_bIsByOutrunner;
|
||||
uint32 m_uiPostEventCount;
|
||||
uint32 m_uiPostEventTimer;
|
||||
int m_iSpawnId;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
m_uiPostEventCount = 0;
|
||||
m_uiPostEventTimer = 3000;
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
m_bIsByOutrunner = false;
|
||||
m_iSpawnId = 0;
|
||||
|
||||
npc_escortAI::JustRespawned();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
{
|
||||
if (who->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner)
|
||||
{
|
||||
if (Creature* talker = who->ToCreature())
|
||||
talker->AI()->Talk(SAY_RIN_BY_OUTRUNNER);
|
||||
m_bIsByOutrunner = true;
|
||||
}
|
||||
|
||||
if (rand()%4)
|
||||
return;
|
||||
|
||||
//only if attacked and escorter is not in combat?
|
||||
Talk(SAY_RIN_HELP);
|
||||
}
|
||||
}
|
||||
|
||||
void DoSpawnAmbush(bool bFirst)
|
||||
{
|
||||
if (!bFirst)
|
||||
m_iSpawnId = 1;
|
||||
|
||||
me->SummonCreature(NPC_RANGER,
|
||||
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
|
||||
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
|
||||
|
||||
for (int i = 0; i < 2; ++i)
|
||||
{
|
||||
me->SummonCreature(NPC_OUTRUNNER,
|
||||
m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f,
|
||||
TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summoned->SetWalk(false);
|
||||
summoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_RIN_FREE, player->GetGUID());
|
||||
break;
|
||||
case 7:
|
||||
DoSpawnAmbush(true);
|
||||
break;
|
||||
case 13:
|
||||
DoSpawnAmbush(false);
|
||||
break;
|
||||
case 17:
|
||||
Talk(SAY_RIN_COMPLETE, player->GetGUID());
|
||||
player->GroupEventHappens(QUEST_RINJI_TRAPPED, me);
|
||||
SetRun();
|
||||
m_uiPostEventCount = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateEscortAI(const uint32 uiDiff)
|
||||
{
|
||||
//Check if we have a current target
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount)
|
||||
{
|
||||
if (m_uiPostEventTimer <= uiDiff)
|
||||
{
|
||||
m_uiPostEventTimer = 3000;
|
||||
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
{
|
||||
switch (m_uiPostEventCount)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_RIN_PROGRESS_1, player->GetGUID());
|
||||
++m_uiPostEventCount;
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_RIN_PROGRESS_2, player->GetGUID());
|
||||
m_uiPostEventCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
m_uiPostEventTimer -= uiDiff;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
>>>>>>> master
|
||||
void AddSC_hinterlands()
|
||||
{
|
||||
new npc_00x09hl();
|
||||
|
||||
Reference in New Issue
Block a user