Scripts/Howling Fjord: Fix horde version of Of Keys and Cages

This commit is contained in:
kaelima
2011-10-29 14:12:36 +01:00
parent 8ca09a2061
commit e1111886dd
+24 -21
View File
@@ -1192,9 +1192,10 @@ class go_massive_seaforium_charge : public GameObjectScript
enum OfKeysAndCages enum OfKeysAndCages
{ {
QUEST_OF_KEYS_AND_CAGES = 11231, QUEST_ALLIANCE_OF_KEYS_AND_CAGES = 11231,
NPC_GJALERBRON_PRISONER = 24035, QUEST_HORDE_OF_KEYS_AND_CAGES = 11265,
SAY_FREE = 0, NPC_GJALERBRON_PRISONER = 24035,
SAY_FREE = 0,
}; };
class go_gjalerbron_cage : public GameObjectScript class go_gjalerbron_cage : public GameObjectScript
@@ -1204,7 +1205,8 @@ class go_gjalerbron_cage : public GameObjectScript
bool OnGossipHello(Player* player, GameObject* go) bool OnGossipHello(Player* player, GameObject* go)
{ {
if (player->GetQuestStatus(QUEST_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) ||
(player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE))
{ {
if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f)) if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f))
{ {
@@ -1228,24 +1230,25 @@ class go_gjalerbron_cage : public GameObjectScript
class go_large_gjalerbron_cage : public GameObjectScript class go_large_gjalerbron_cage : public GameObjectScript
{ {
public: public:
go_large_gjalerbron_cage() : GameObjectScript("go_large_gjalerbron_cage") { } go_large_gjalerbron_cage() : GameObjectScript("go_large_gjalerbron_cage") { }
bool OnGossipHello(Player* player, GameObject* go) bool OnGossipHello(Player* player, GameObject* go)
{ {
if (player->GetQuestStatus(QUEST_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE) ||
{ (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE))
std::list<Creature*> prisonerList; {
GetCreatureListWithEntryInGrid(prisonerList, go, NPC_GJALERBRON_PRISONER, INTERACTION_DISTANCE); std::list<Creature*> prisonerList;
for (std::list<Creature*>::const_iterator itr = prisonerList.begin(); itr != prisonerList.end(); ++itr) GetCreatureListWithEntryInGrid(prisonerList, go, NPC_GJALERBRON_PRISONER, INTERACTION_DISTANCE);
{ for (std::list<Creature*>::const_iterator itr = prisonerList.begin(); itr != prisonerList.end(); ++itr)
go->UseDoorOrButton(); {
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID()); go->UseDoorOrButton();
(*itr)->ForcedDespawn(6000); player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, (*itr)->GetGUID());
(*itr)->AI()->Talk(SAY_FREE); (*itr)->ForcedDespawn(6000);
} (*itr)->AI()->Talk(SAY_FREE);
} }
return false; }
} return false;
}
}; };
void AddSC_go_scripts() void AddSC_go_scripts()