From 88568e78fb6c9c96cd95532a303449a5ff967039 Mon Sep 17 00:00:00 2001 From: Blaymoira Date: Sun, 18 Jan 2009 11:40:20 +0100 Subject: [PATCH] *More fixes on escort quests --HG-- branch : trunk --- sql/updates/822_world_scripts.sql | 3 ++- .../scripts/scripts/zone/ashenvale_forest/ashenvale.cpp | 5 ++++- .../scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sql/updates/822_world_scripts.sql b/sql/updates/822_world_scripts.sql index 0102336e31..f7a7016dcf 100644 --- a/sql/updates/822_world_scripts.sql +++ b/sql/updates/822_world_scripts.sql @@ -1,2 +1,3 @@ update creature_template set scriptname='npc_kayra_longmane' where entry=17969; -delete from creature_template_addon where entry=17969; \ No newline at end of file +delete from creature_template_addon where entry=17969; +update quest_template set specialflags=2 where entry=9752; \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp index 9ef0ca6a15..85ce5ea0be 100644 --- a/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp +++ b/src/bindings/scripts/scripts/zone/ashenvale_forest/ashenvale.cpp @@ -55,6 +55,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI uint32 Rend_Timer; uint32 Thunderclap_Timer; + bool Completed; void WaypointReached(uint32 i) { @@ -79,6 +80,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI break; case 20: DoScriptText(SAY_WIN, m_creature, player); + Completed = true; if (player && player->GetTypeId() == TYPEID_PLAYER) ((Player*)player)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); break; @@ -92,6 +94,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI { Rend_Timer = 5000; Thunderclap_Timer = 8000; + Completed = false; } void Aggro(Unit* who) @@ -105,7 +108,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) + if (PlayerGUID && !Completed) { if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) ((Player*)player)->FailQuest(QUEST_TOREK_ASSULT); diff --git a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp index 6fb19c15a6..72c283f9f3 100644 --- a/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/zone/zangarmarsh/zangarmarsh.cpp @@ -305,6 +305,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI case 19: m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); DoSay(SAY_PROGRESS_5, LANG_UNIVERSAL, player); break; case 26: DoSay(SAY_PROGRESS_6, LANG_UNIVERSAL, player); + Completed = true; if(player) ((Player*)player)->GroupEventHappens(QUEST_EFU, m_creature); break; @@ -313,7 +314,7 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) + if (PlayerGUID && !Completed) { Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); if (player && !Completed)