mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Merge branch '4.3.4' of https://gitlab.com/trinitycore/TrinityCore_434 into 4.3.4
This commit is contained in:
@@ -55,6 +55,7 @@ public:
|
||||
{ "xyz", rbac::RBAC_PERM_COMMAND_GO_XYZ, false, &HandleGoXYZCommand, "" },
|
||||
{ "ticket", rbac::RBAC_PERM_COMMAND_GO_TICKET, false, &HandleGoTicketCommand, "" },
|
||||
{ "offset", rbac::RBAC_PERM_COMMAND_GO_OFFSET, false, &HandleGoOffsetCommand, "" },
|
||||
{ "instance", rbac::RBAC_PERM_COMMAND_GO_INSTANCE, false, &HandleGoInstanceCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
@@ -596,6 +597,104 @@ public:
|
||||
player->TeleportTo(player->GetMapId(), x, y, z, o);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleGoInstanceCommand(ChatHandler* handler, char const* args)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
char* pos = const_cast<char*>(args);
|
||||
do *pos = tolower(*pos);
|
||||
while (*(++pos));
|
||||
|
||||
Tokenizer labels(args, ' ');
|
||||
uint32 mapid = 0;
|
||||
if (labels.size() == 1)
|
||||
{
|
||||
try { mapid = std::stoi(labels[0]); }
|
||||
catch (...) {}
|
||||
}
|
||||
|
||||
if (!mapid)
|
||||
{
|
||||
std::multimap<uint32, std::pair<uint16, std::string>> matches;
|
||||
for (auto const& pair : sObjectMgr->GetInstanceTemplates())
|
||||
{
|
||||
uint32 count = 0;
|
||||
std::string const& scriptName = sObjectMgr->GetScriptName(pair.second.ScriptId);
|
||||
for (char const* label : labels)
|
||||
if (scriptName.find(label) != std::string::npos)
|
||||
++count;
|
||||
|
||||
if (count)
|
||||
matches.emplace(count, decltype(matches)::mapped_type({ pair.first, scriptName }));
|
||||
}
|
||||
if (matches.empty())
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_NO_INSTANCES_MATCH);
|
||||
return false;
|
||||
}
|
||||
auto it = matches.rbegin();
|
||||
uint32 maxCount = it->first;
|
||||
mapid = it->second.first;
|
||||
if (++it != matches.rend() && it->first == maxCount)
|
||||
{
|
||||
handler->SendSysMessage(LANG_COMMAND_MULTIPLE_INSTANCES_MATCH);
|
||||
--it;
|
||||
do
|
||||
handler->PSendSysMessage(LANG_COMMAND_MULTIPLE_INSTANCES_ENTRY, it->second.first, it->second.second);
|
||||
while (++it != matches.rend() && it->first == maxCount);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(mapid);
|
||||
|
||||
InstanceTemplate const* temp = sObjectMgr->GetInstanceTemplate(mapid);
|
||||
if (!temp)
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_MAP_NOT_INSTANCE, mapid);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
std::string const& scriptname = sObjectMgr->GetScriptName(temp->ScriptId);
|
||||
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
if (player->IsInFlight())
|
||||
{
|
||||
player->GetMotionMaster()->MovementExpired();
|
||||
player->CleanupAfterTaxiFlight();
|
||||
}
|
||||
else
|
||||
player->SaveRecallPosition();
|
||||
|
||||
// try going to entrance
|
||||
AreaTriggerStruct const* exit = sObjectMgr->GetGoBackTrigger(mapid);
|
||||
if (!exit)
|
||||
handler->PSendSysMessage(LANG_COMMAND_INSTANCE_NO_EXIT, mapid, scriptname);
|
||||
|
||||
if (exit && player->TeleportTo(exit->target_mapId, exit->target_X, exit->target_Y, exit->target_Z, exit->target_Orientation + M_PI))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_WENT_TO_INSTANCE_GATE, mapid, scriptname);
|
||||
return true;
|
||||
}
|
||||
|
||||
// try going to start
|
||||
AreaTriggerStruct const* entrance = sObjectMgr->GetMapEntranceTrigger(mapid);
|
||||
if (!entrance)
|
||||
handler->PSendSysMessage(LANG_COMMAND_INSTANCE_NO_ENTRANCE, mapid, scriptname);
|
||||
|
||||
if (entrance && player->TeleportTo(entrance->target_mapId, entrance->target_X, entrance->target_Y, entrance->target_Z, entrance->target_Orientation))
|
||||
{
|
||||
handler->PSendSysMessage(LANG_COMMAND_WENT_TO_INSTANCE_START, mapid, scriptname);
|
||||
return true;
|
||||
}
|
||||
|
||||
handler->PSendSysMessage(LANG_COMMAND_GO_INSTANCE_FAILED, mapid, scriptname, exit->target_mapId);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_go_commandscript()
|
||||
|
||||
@@ -47,6 +47,7 @@ public:
|
||||
uiMovementDone = 0;
|
||||
uiGrandChampionsDeaths = 0;
|
||||
uiArgentSoldierDeaths = 0;
|
||||
teamInInstance = 0;
|
||||
|
||||
bDone = false;
|
||||
|
||||
@@ -55,6 +56,7 @@ public:
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint32 teamInInstance;
|
||||
uint16 uiMovementDone;
|
||||
uint16 uiGrandChampionsDeaths;
|
||||
uint8 uiArgentSoldierDeaths;
|
||||
@@ -87,46 +89,16 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
uint32 TeamInInstance = 0;
|
||||
|
||||
if (!players.isEmpty())
|
||||
{
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
TeamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
// Champions
|
||||
case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT);
|
||||
break;
|
||||
case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_AMBROSE_BOLTSPARK_MOUNT);
|
||||
break;
|
||||
case VEHICLE_RUNOK_WILDMANE_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_COLOSOS_MOUNT);
|
||||
break;
|
||||
case VEHICLE_ZUL_TORE_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_EVENSONG_MOUNT);
|
||||
break;
|
||||
case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
|
||||
if (TeamInInstance == HORDE)
|
||||
creature->UpdateEntry(VEHICLE_LANA_STOUTHAMMER_MOUNT);
|
||||
break;
|
||||
// Coliseum Announcer || Just NPC_JAEREN must be spawned.
|
||||
case NPC_JAEREN:
|
||||
uiAnnouncerGUID = creature->GetGUID();
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ARELAS);
|
||||
break;
|
||||
case VEHICLE_ARGENT_WARHORSE:
|
||||
case VEHICLE_ARGENT_BATTLEWORG:
|
||||
VehicleList.push_back(creature->GetGUID());
|
||||
@@ -135,6 +107,42 @@ public:
|
||||
case NPC_PALETRESS:
|
||||
uiArgentChampionGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_JAEREN:
|
||||
case NPC_ARELAS:
|
||||
uiAnnouncerGUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
{
|
||||
case VEHICLE_MOKRA_SKILLCRUSHER_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_MARSHAL_JACOB_ALERIUS_MOUNT : VEHICLE_MOKRA_SKILLCRUSHER_MOUNT;
|
||||
case VEHICLE_ERESSEA_DAWNSINGER_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_AMBROSE_BOLTSPARK_MOUNT : VEHICLE_ERESSEA_DAWNSINGER_MOUNT;
|
||||
case VEHICLE_RUNOK_WILDMANE_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_COLOSOS_MOUNT : VEHICLE_RUNOK_WILDMANE_MOUNT;
|
||||
case VEHICLE_ZUL_TORE_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_EVENSONG_MOUNT : VEHICLE_ZUL_TORE_MOUNT;
|
||||
case VEHICLE_DEATHSTALKER_VESCERI_MOUNT:
|
||||
return teamInInstance == HORDE ? VEHICLE_LANA_STOUTHAMMER_MOUNT : VEHICLE_DEATHSTALKER_VESCERI_MOUNT;
|
||||
case NPC_JAEREN:
|
||||
return teamInInstance == HORDE ? NPC_ARELAS : NPC_JAEREN;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,14 +54,6 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_BRONJAHM:
|
||||
@@ -70,18 +62,30 @@ class instance_forge_of_souls : public InstanceMapScript
|
||||
case NPC_DEVOURER:
|
||||
devourerOfSouls = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
if (!teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
{
|
||||
case NPC_SYLVANAS_PART1:
|
||||
if (teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART1);
|
||||
break;
|
||||
return teamInInstance == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
case NPC_LORALEN:
|
||||
if (teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ELANDRA);
|
||||
break;
|
||||
return teamInInstance == ALLIANCE ? NPC_ELANDRA : NPC_LORALEN;
|
||||
case NPC_KALIRA:
|
||||
if (teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_KORELN);
|
||||
break;
|
||||
return teamInInstance == ALLIANCE ? NPC_KORELN : NPC_KALIRA;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -89,84 +89,60 @@ class instance_pit_of_saron : public InstanceMapScript
|
||||
case NPC_TYRANNUS_EVENTS:
|
||||
_tyrannusEventGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SYLVANAS_PART1:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART1);
|
||||
_jainaOrSylvanas1GUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SYLVANAS_PART2:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JAINA_PART2);
|
||||
_jainaOrSylvanas2GUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_KILARA:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ELANDRA);
|
||||
break;
|
||||
case NPC_KORALEN:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_KORLAEN);
|
||||
break;
|
||||
case NPC_CHAMPION_1_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_CHAMPION_1_ALLIANCE);
|
||||
break;
|
||||
case NPC_CHAMPION_2_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_CHAMPION_2_ALLIANCE);
|
||||
break;
|
||||
case NPC_CHAMPION_3_HORDE: // No 3rd set for Alliance?
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_CHAMPION_2_ALLIANCE);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_1:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_1);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_2:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_2);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_3:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_3);
|
||||
break;
|
||||
case NPC_HORDE_SLAVE_4:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_SLAVE_4);
|
||||
break;
|
||||
case NPC_FREED_SLAVE_1_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_FREED_SLAVE_1_ALLIANCE);
|
||||
break;
|
||||
case NPC_FREED_SLAVE_2_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_FREED_SLAVE_2_ALLIANCE);
|
||||
break;
|
||||
case NPC_FREED_SLAVE_3_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_FREED_SLAVE_3_ALLIANCE);
|
||||
break;
|
||||
case NPC_RESCUED_SLAVE_HORDE:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_RESCUED_SLAVE_ALLIANCE);
|
||||
break;
|
||||
case NPC_MARTIN_VICTUS_1:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_MARTIN_VICTUS_1);
|
||||
break;
|
||||
case NPC_MARTIN_VICTUS_2:
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_MARTIN_VICTUS_2);
|
||||
break;
|
||||
case NPC_CAVERN_EVENT_TRIGGER:
|
||||
_cavernstriggersVector.push_back(creature->GetGUID());
|
||||
break;
|
||||
case NPC_SYLVANAS_PART1:
|
||||
case NPC_SYLVANAS_PART2:
|
||||
case NPC_JAINA_PART1:
|
||||
case NPC_JAINA_PART2:
|
||||
_jainaOrSylvanas1GUID = creature->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
{
|
||||
case NPC_SYLVANAS_PART1:
|
||||
return _teamInInstance == ALLIANCE ? NPC_JAINA_PART1 : NPC_SYLVANAS_PART1;
|
||||
case NPC_SYLVANAS_PART2:
|
||||
return _teamInInstance == ALLIANCE ? NPC_JAINA_PART2 : NPC_SYLVANAS_PART2;
|
||||
case NPC_KILARA:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ELANDRA : NPC_KILARA;
|
||||
case NPC_KORALEN:
|
||||
return _teamInInstance == ALLIANCE ? NPC_KORLAEN : NPC_KORALEN;
|
||||
case NPC_CHAMPION_1_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_CHAMPION_1_ALLIANCE : NPC_CHAMPION_1_HORDE;
|
||||
case NPC_CHAMPION_2_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_CHAMPION_2_ALLIANCE : NPC_CHAMPION_2_HORDE;
|
||||
case NPC_CHAMPION_3_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_CHAMPION_2_ALLIANCE : NPC_CHAMPION_3_HORDE;
|
||||
case NPC_HORDE_SLAVE_1:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_1 : NPC_HORDE_SLAVE_1;
|
||||
case NPC_HORDE_SLAVE_2:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_2 : NPC_HORDE_SLAVE_2;
|
||||
case NPC_HORDE_SLAVE_3:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_3 : NPC_HORDE_SLAVE_3;
|
||||
case NPC_HORDE_SLAVE_4:
|
||||
return _teamInInstance == ALLIANCE ? NPC_ALLIANCE_SLAVE_4 : NPC_HORDE_SLAVE_4;
|
||||
case NPC_FREED_SLAVE_1_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_FREED_SLAVE_1_ALLIANCE : NPC_FREED_SLAVE_1_HORDE;
|
||||
case NPC_FREED_SLAVE_2_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_FREED_SLAVE_2_ALLIANCE : NPC_FREED_SLAVE_2_HORDE;
|
||||
case NPC_FREED_SLAVE_3_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_FREED_SLAVE_3_ALLIANCE : NPC_FREED_SLAVE_3_HORDE;
|
||||
case NPC_RESCUED_SLAVE_HORDE:
|
||||
return _teamInInstance == ALLIANCE ? NPC_RESCUED_SLAVE_ALLIANCE : NPC_RESCUED_SLAVE_HORDE;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
|
||||
@@ -187,14 +187,6 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
{
|
||||
if (!TeamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
TeamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_LORD_MARROWGAR:
|
||||
@@ -203,42 +195,6 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
case NPC_LADY_DEATHWHISPER:
|
||||
LadyDeahtwhisperGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_KOR_KRON_GENERAL:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALLIANCE_COMMANDER);
|
||||
break;
|
||||
case NPC_KOR_KRON_LIEUTENANT:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_SKYBREAKER_LIEUTENANT);
|
||||
break;
|
||||
case NPC_TORTUNOK:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_ALANA_MOONSTRIKE);
|
||||
break;
|
||||
case NPC_GERARDO_THE_SUAVE:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_TALAN_MOONSTRIKE);
|
||||
break;
|
||||
case NPC_UVLUS_BANEFIRE:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_MALFUS_GRIMFROST);
|
||||
break;
|
||||
case NPC_IKFIRUS_THE_VILE:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_YILI);
|
||||
break;
|
||||
case NPC_VOL_GUK:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_JEDEBIA);
|
||||
break;
|
||||
case NPC_HARAGG_THE_UNSEEN:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_NIBY_THE_ALMIGHTY);
|
||||
break;
|
||||
case NPC_GARROSH_HELLSCREAM:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_KING_VARIAN_WRYNN);
|
||||
break;
|
||||
case NPC_DEATHBRINGER_SAURFANG:
|
||||
DeathbringerSaurfangGUID = creature->GetGUID();
|
||||
break;
|
||||
@@ -247,16 +203,8 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
creature->SetControlled(true, UNIT_STATE_ROOT);
|
||||
break;
|
||||
case NPC_SE_HIGH_OVERLORD_SAURFANG:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_SE_MURADIN_BRONZEBEARD, creature->GetCreatureData());
|
||||
// no break;
|
||||
case NPC_SE_MURADIN_BRONZEBEARD:
|
||||
DeathbringerSaurfangEventGUID = creature->GetGUID();
|
||||
creature->LastUsedScriptID = creature->GetScriptId();
|
||||
break;
|
||||
case NPC_SE_KOR_KRON_REAVER:
|
||||
if (TeamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_SE_SKYBREAKER_MARINE);
|
||||
break;
|
||||
case NPC_FESTERGUT:
|
||||
FestergutGUID = creature->GetGUID();
|
||||
@@ -358,6 +306,14 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
// Weekly quest spawn prevention
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
if (!TeamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
TeamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
{
|
||||
@@ -379,6 +335,9 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (entry == NPC_KOR_KRON_LIEUTENANT && TeamInInstance == ALLIANCE)
|
||||
return NPC_SKYBREAKER_LIEUTENANT;
|
||||
break;
|
||||
}
|
||||
case NPC_HORDE_GUNSHIP_CANNON:
|
||||
@@ -404,6 +363,26 @@ class instance_icecrown_citadel : public InstanceMapScript
|
||||
(TeamInInstance == HORDE && data->spawnPoint.GetPositionX() < 10.0f))
|
||||
return entry;
|
||||
return 0;
|
||||
case NPC_SE_HIGH_OVERLORD_SAURFANG:
|
||||
return TeamInInstance == ALLIANCE ? NPC_SE_MURADIN_BRONZEBEARD : NPC_SE_HIGH_OVERLORD_SAURFANG;
|
||||
case NPC_KOR_KRON_GENERAL:
|
||||
return TeamInInstance == ALLIANCE ? NPC_ALLIANCE_COMMANDER : NPC_KOR_KRON_GENERAL;
|
||||
case NPC_TORTUNOK:
|
||||
return TeamInInstance == ALLIANCE ? NPC_ALANA_MOONSTRIKE : NPC_TORTUNOK;
|
||||
case NPC_GERARDO_THE_SUAVE:
|
||||
return TeamInInstance == ALLIANCE ? NPC_TALAN_MOONSTRIKE : NPC_GERARDO_THE_SUAVE;
|
||||
case NPC_UVLUS_BANEFIRE:
|
||||
return TeamInInstance == ALLIANCE ? NPC_MALFUS_GRIMFROST : NPC_UVLUS_BANEFIRE;
|
||||
case NPC_IKFIRUS_THE_VILE:
|
||||
return TeamInInstance == ALLIANCE ? NPC_YILI : NPC_IKFIRUS_THE_VILE;
|
||||
case NPC_VOL_GUK:
|
||||
return TeamInInstance == ALLIANCE ? NPC_JEDEBIA : NPC_VOL_GUK;
|
||||
case NPC_HARAGG_THE_UNSEEN:
|
||||
return TeamInInstance == ALLIANCE ? NPC_NIBY_THE_ALMIGHTY : NPC_HARAGG_THE_UNSEEN;
|
||||
case NPC_GARROSH_HELLSCREAM:
|
||||
return TeamInInstance == ALLIANCE ? NPC_KING_VARIAN_WRYNN : NPC_GARROSH_HELLSCREAM;
|
||||
case NPC_SE_KOR_KRON_REAVER:
|
||||
return TeamInInstance == ALLIANCE ? NPC_SE_SKYBREAKER_MARINE : NPC_SE_KOR_KRON_REAVER;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -54,42 +54,47 @@ class instance_nexus : public InstanceMapScript
|
||||
case NPC_KERISTRASZA:
|
||||
KeristraszaGUID = creature->GetGUID();
|
||||
break;
|
||||
// Alliance npcs are spawned by default, if you are alliance, you will fight against horde npcs.
|
||||
case NPC_ALLIANCE_BERSERKER:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_BERSERKER);
|
||||
break;
|
||||
case NPC_ALLIANCE_RANGER:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_RANGER);
|
||||
break;
|
||||
case NPC_ALLIANCE_CLERIC:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_CLERIC);
|
||||
break;
|
||||
case NPC_ALLIANCE_COMMANDER:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_HORDE_COMMANDER);
|
||||
break;
|
||||
case NPC_COMMANDER_STOUTBEARD:
|
||||
if (ServerAllowsTwoSideGroups())
|
||||
creature->SetFaction(FACTION_MONSTER_2);
|
||||
if (_teamInInstance == ALLIANCE)
|
||||
creature->UpdateEntry(NPC_COMMANDER_KOLURG);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetCreatureEntry(ObjectGuid::LowType /*guidLow*/, CreatureData const* data) override
|
||||
{
|
||||
if (!_teamInInstance)
|
||||
{
|
||||
Map::PlayerList const& players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
_teamInInstance = player->GetTeam();
|
||||
}
|
||||
|
||||
uint32 entry = data->id;
|
||||
switch (entry)
|
||||
{
|
||||
case NPC_ALLIANCE_BERSERKER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_BERSERKER : NPC_ALLIANCE_BERSERKER;
|
||||
case NPC_ALLIANCE_RANGER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_RANGER : NPC_ALLIANCE_RANGER;
|
||||
case NPC_ALLIANCE_CLERIC:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_CLERIC : NPC_ALLIANCE_CLERIC;
|
||||
case NPC_ALLIANCE_COMMANDER:
|
||||
return _teamInInstance == ALLIANCE ? NPC_HORDE_COMMANDER : NPC_ALLIANCE_COMMANDER;
|
||||
case NPC_COMMANDER_STOUTBEARD:
|
||||
return _teamInInstance == ALLIANCE ? NPC_COMMANDER_KOLURG : NPC_COMMANDER_STOUTBEARD;
|
||||
default:
|
||||
return entry;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go) override
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
|
||||
@@ -161,57 +161,6 @@ class AreaTrigger_at_scent_larkorwi : public AreaTriggerScript
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
## at_last_rites
|
||||
#####*/
|
||||
|
||||
enum AtLastRites
|
||||
{
|
||||
QUEST_LAST_RITES = 12019,
|
||||
QUEST_BREAKING_THROUGH = 11898,
|
||||
};
|
||||
|
||||
class AreaTrigger_at_last_rites : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
AreaTrigger_at_last_rites() : AreaTriggerScript("at_last_rites") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger) override
|
||||
{
|
||||
if (!(player->GetQuestStatus(QUEST_LAST_RITES) == QUEST_STATUS_INCOMPLETE ||
|
||||
player->GetQuestStatus(QUEST_LAST_RITES) == QUEST_STATUS_COMPLETE ||
|
||||
player->GetQuestStatus(QUEST_BREAKING_THROUGH) == QUEST_STATUS_INCOMPLETE ||
|
||||
player->GetQuestStatus(QUEST_BREAKING_THROUGH) == QUEST_STATUS_COMPLETE))
|
||||
return false;
|
||||
|
||||
WorldLocation pPosition;
|
||||
|
||||
switch (trigger->id)
|
||||
{
|
||||
case 5332:
|
||||
case 5338:
|
||||
pPosition = WorldLocation(571, 3733.68f, 3563.25f, 290.812f, 3.665192f);
|
||||
break;
|
||||
case 5334:
|
||||
pPosition = WorldLocation(571, 3802.38f, 3585.95f, 49.5765f, 0.0f);
|
||||
break;
|
||||
case 5340:
|
||||
if (player->GetQuestStatus(QUEST_LAST_RITES) == QUEST_STATUS_INCOMPLETE ||
|
||||
player->GetQuestStatus(QUEST_LAST_RITES) == QUEST_STATUS_COMPLETE)
|
||||
pPosition = WorldLocation(571, 3687.91f, 3577.28f, 473.342f);
|
||||
else
|
||||
pPosition = WorldLocation(571, 3739.38f, 3567.09f, 341.58f);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
player->TeleportTo(pPosition);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_sholazar_waygate
|
||||
######*/
|
||||
@@ -485,7 +434,6 @@ void AddSC_areatrigger_scripts()
|
||||
new AreaTrigger_at_legion_teleporter();
|
||||
new AreaTrigger_at_stormwright_shelf();
|
||||
new AreaTrigger_at_scent_larkorwi();
|
||||
new AreaTrigger_at_last_rites();
|
||||
new AreaTrigger_at_sholazar_waygate();
|
||||
new AreaTrigger_at_nats_landing();
|
||||
new AreaTrigger_at_brewfest();
|
||||
|
||||
Reference in New Issue
Block a user