Scripts/Howling Fjord: Fix quest Of Keys and Cages

Closes #3540
This commit is contained in:
Discover-
2011-10-26 00:11:06 +01:00
committed by kaelima
parent 80720358f0
commit a620a763a9
2 changed files with 93 additions and 7 deletions
+71 -7
View File
@@ -1176,14 +1176,76 @@ public:
class go_massive_seaforium_charge : public GameObjectScript
{
public:
go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
public:
go_massive_seaforium_charge() : GameObjectScript("go_massive_seaforium_charge") { }
bool OnGossipHello(Player* /*player*/, GameObject* go)
{
go->SetLootState(GO_JUST_DEACTIVATED);
return true;
}
bool OnGossipHello(Player* /*player*/, GameObject* go)
{
go->SetLootState(GO_JUST_DEACTIVATED);
return true;
}
};
/*######
## go_gjalerbron_cage
######*/
enum OfKeysAndCages
{
QUEST_OF_KEYS_AND_CAGES = 11231,
NPC_GJALERBRON_PRISONER = 24035,
SAY_FREE = 0,
};
class go_gjalerbron_cage : public GameObjectScript
{
public:
go_gjalerbron_cage() : GameObjectScript("go_gjalerbron_cage") { }
bool OnGossipHello(Player* player, GameObject* go)
{
if (player->GetQuestStatus(QUEST_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE)
{
if (Creature* prisoner = go->FindNearestCreature(NPC_GJALERBRON_PRISONER, 5.0f))
{
go->UseDoorOrButton();
if (player)
player->KilledMonsterCredit(NPC_GJALERBRON_PRISONER, 0);
prisoner->AI()->Talk(SAY_FREE);
prisoner->ForcedDespawn(6000);
}
}
return true;
}
};
/*########
## go_large_gjalerbron_cage
#####*/
class go_large_gjalerbron_cage : public GameObjectScript
{
public:
go_large_gjalerbron_cage() : GameObjectScript("go_large_gjalerbron_cage") { }
bool OnGossipHello(Player* player, GameObject* go)
{
if (player->GetQuestStatus(QUEST_OF_KEYS_AND_CAGES) == QUEST_STATUS_INCOMPLETE)
{
std::list<Creature*> prisonerList;
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());
(*itr)->ForcedDespawn(6000);
(*itr)->AI()->Talk(SAY_FREE);
}
}
return false;
}
};
void AddSC_go_scripts()
@@ -1224,4 +1286,6 @@ void AddSC_go_scripts()
new go_amberpine_outhouse;
new go_hive_pod;
new go_massive_seaforium_charge;
new go_gjalerbron_cage;
new go_large_gjalerbron_cage;
}