From 8f9ee58e633e0d886a9751f28cf788e17f00fb85 Mon Sep 17 00:00:00 2001 From: ille Date: Fri, 30 Nov 2012 18:53:13 +0100 Subject: scripts/gameobject: correct reset of gameobjects (cages/prisons), move command out of if statement --- src/server/scripts/Outland/nagrand.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/server/scripts/Outland/nagrand.cpp') diff --git a/src/server/scripts/Outland/nagrand.cpp b/src/server/scripts/Outland/nagrand.cpp index 0c9a60603f5..e2fbb457f35 100644 --- a/src/server/scripts/Outland/nagrand.cpp +++ b/src/server/scripts/Outland/nagrand.cpp @@ -388,11 +388,11 @@ public: bool OnGossipHello(Player* player, GameObject* go) { + go->SetGoState(GO_STATE_READY); if (go->GetEntry() == GO_CORKIS_PRISON) { if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true)) { - go->SetGoState(GO_STATE_READY); corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ()); if (player) player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0); @@ -403,7 +403,6 @@ public: { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true)) { - go->SetGoState(GO_STATE_READY); corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()-5, go->GetPositionY(), go->GetPositionZ()); if (player) player->KilledMonsterCredit(NPC_CORKI_2, 0); @@ -414,7 +413,6 @@ public: { if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true)) { - go->SetGoState(GO_STATE_READY); corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+4, go->GetPositionY(), go->GetPositionZ()); if (player) player->KilledMonsterCredit(NPC_CORKI_CREDIT_3, 0); @@ -683,12 +681,12 @@ class go_warmaul_prison : public GameObjectScript bool OnGossipHello(Player* player, GameObject* go) { + go->UseDoorOrButton(); if (player->GetQuestStatus(QUEST_FINDING_THE_SURVIVORS) != QUEST_STATUS_INCOMPLETE) return false; if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f)) { - go->UseDoorOrButton(); player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0); prisoner->AI()->Talk(SAY_FREE, player->GetGUID()); -- cgit v1.2.3