aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSnapperRy <snapperryen@gmail.com>2016-06-10 21:03:30 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-01-13 00:07:43 +0100
commit2e5550758c2754afc4bd8c98faa1462566a4c3ca (patch)
tree7193f76621135fd752be7a99c2268b2647373ade
parentf8ca5fd40e91a7a50e9f2877dd0a8b4ab0e921f4 (diff)
Core/Movement: interrupt a creature's current cast when fleeing for assistance, and (if spell is not castable while moving) when running random/fleeing movement generators. (#17271)
Also make sure the creature is alive before updating. Fixes #12823. (cherry picked from commit 2db9269ec1c06b5fccc45dc0a5b4f714f9b48804) DB/Creature: World Trigger (Not Immune NPC) InhabitType update Closes #17332 by Malcrom (cherry picked from commit 78d08834c0afe0be09e4ec071a6e6855aa18e2c8) DB/Item: Fix text in Rune-Inscribed Parchment Closes #17329 by tkrokli (cherry picked from commit 8879545f21fe13650872358741b687a524cf8cb9) DB/Quest: improve chaining for "The Ashenvale Hunt" quests Closes #17323 by SnapperRy (cherry picked from commit d034eedb811912546025d11a5e9335bcd6600464) DB/trinity_string: wrong string about character customization + minor fix Closes #17306 by lyn1337 (cherry picked from commit 0951e559ebe6b76abdfef55619244578d9917002) DB/Quest: fix some completion/offer reward quest texts Closes #17336 by SnapperRy (cherry picked from commit e9025036b9848a5a684c57e3e066687c29fde321) DB/Quest: add queststarters for "Regthar Deathgate" Closes #17337 by SnapperRy (cherry picked from commit 0b8921a0ef81fb7c4741248301b17a86fa0ffb69) DB/Quest: fix chaining for "The Real Threat" Closes #17338 by SnapperRy (cherry picked from commit c9cb86d6c53ceb7331a1a5c1ff8a69f569cca426) DB/Quest: fix repeatableness (or lack of) for some quests Closes #17339 by SnapperRy (cherry picked from commit b9f2e2a81b7f0a269da3a8f9597a4eca17899781) DB/Quest: improvements for "Fool's Stout" Closes #17340 by SnapperRy (cherry picked from commit 4ec753dc50927e358a63a49a56cef7f5a72f41eb)
-rw-r--r--sql/updates/world/master/2017_01_12_20_world_2016_06_11_00_world.sql3
-rw-r--r--sql/updates/world/master/2017_01_12_21_world_2016_06_11_01_world.sql2
-rw-r--r--sql/updates/world/master/2017_01_12_22_world_2016_06_11_03_world.sql5
-rw-r--r--src/server/game/Movement/MotionMaster.cpp1
-rw-r--r--src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp6
-rw-r--r--src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp9
6 files changed, 26 insertions, 0 deletions
diff --git a/sql/updates/world/master/2017_01_12_20_world_2016_06_11_00_world.sql b/sql/updates/world/master/2017_01_12_20_world_2016_06_11_00_world.sql
new file mode 100644
index 00000000000..ea81a3ce563
--- /dev/null
+++ b/sql/updates/world/master/2017_01_12_20_world_2016_06_11_00_world.sql
@@ -0,0 +1,3 @@
+-- Creature entry 19871 World Trigger (Not Immune NPC)
+-- set InhabitType [Flying] to enable hover mode for this creature
+UPDATE `creature_template` SET `InhabitType`= 4 WHERE `entry` = 19871;
diff --git a/sql/updates/world/master/2017_01_12_21_world_2016_06_11_01_world.sql b/sql/updates/world/master/2017_01_12_21_world_2016_06_11_01_world.sql
new file mode 100644
index 00000000000..c7185f6642c
--- /dev/null
+++ b/sql/updates/world/master/2017_01_12_21_world_2016_06_11_01_world.sql
@@ -0,0 +1,2 @@
+-- Correct page text for item 9568, Rune-Inscribed Parchment
+UPDATE `page_text` SET `Text` = "Lok'tar, $g brother:sister;. The elements beckon you closer and bid me to show you the path of the shaman. The spirits of our ancestors watch from beyond and swell with pride knowing you have joined our ranks.$B$BWhen you are ready, seek me out near the entrance to the Den. It is there that I will be training others of our kind. Until then, may the wind be at your back.$B$B-Shikrik, Shaman Trainer" WHERE `ID`= 2461;
diff --git a/sql/updates/world/master/2017_01_12_22_world_2016_06_11_03_world.sql b/sql/updates/world/master/2017_01_12_22_world_2016_06_11_03_world.sql
new file mode 100644
index 00000000000..47e3aefa366
--- /dev/null
+++ b/sql/updates/world/master/2017_01_12_22_world_2016_06_11_03_world.sql
@@ -0,0 +1,5 @@
+-- fix string in trinity_string incorrectly implying character customization is forced at login
+UPDATE `trinity_string` SET `content_default`='customization for player %s will be requested at next login.' WHERE `entry`=345;
+UPDATE `trinity_string` SET `content_default`='customization for player %s (GUID #%u) will be requested at next login.' WHERE `entry`=346;
+
+UPDATE `trinity_string` SET `content_default`='You already have a pet.' WHERE `entry`=344; -- add missing article
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 94dcd71b5d5..7c747b9fe82 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -528,6 +528,7 @@ void MotionMaster::MoveSeekAssistance(float x, float y, float z)
TC_LOG_DEBUG("misc", "Creature (Entry: %u %s) seek assistance (X: %f Y: %f Z: %f)",
_owner->GetEntry(), _owner->GetGUID().ToString().c_str(), x, y, z);
_owner->AttackStop();
+ _owner->CastStop();
_owner->ToCreature()->SetReactState(REACT_PASSIVE);
Mutate(new AssistanceMovementGenerator(x, y, z), MOTION_SLOT_ACTIVE);
}
diff --git a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
index 76b8e29ff78..23d9fac49de 100644
--- a/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/FleeingMovementGenerator.cpp
@@ -38,6 +38,12 @@ void FleeingMovementGenerator<T>::_setTargetLocation(T* owner)
if (owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED))
return;
+ if (owner->HasUnitState(UNIT_STATE_CASTING) && !owner->CanMoveDuringChannel())
+ {
+ owner->CastStop();
+ return;
+ }
+
owner->AddUnitState(UNIT_STATE_FLEEING_MOVE);
float x, y, z;
diff --git a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
index 463f9c5e4e9..caa7d513796 100644
--- a/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
+++ b/src/server/game/Movement/MovementGenerators/RandomMovementGenerator.cpp
@@ -29,6 +29,12 @@
template<>
void RandomMovementGenerator<Creature>::_setRandomLocation(Creature* creature)
{
+ if (creature->HasUnitState(UNIT_STATE_CASTING) && !creature->CanMoveDuringChannel())
+ {
+ creature->CastStop();
+ return;
+ }
+
float respX, respY, respZ, respO, destX, destY, destZ, travelDistZ;
creature->GetHomePosition(respX, respY, respZ, respO);
Map const* map = creature->GetBaseMap();
@@ -141,6 +147,9 @@ void RandomMovementGenerator<Creature>::DoFinalize(Creature* creature)
template<>
bool RandomMovementGenerator<Creature>::DoUpdate(Creature* creature, const uint32 diff)
{
+ if (!creature || !creature->IsAlive())
+ return false;
+
if (creature->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED))
{
i_nextMoveTime.Reset(0); // Expire the timer