From 08fa019253895c97515a6324a19b9183d5a39ce5 Mon Sep 17 00:00:00 2001 From: TrullyONE Date: Wed, 24 Dec 2008 12:06:25 +0200 Subject: *Additional movement checks added. --HG-- branch : trunk --- src/game/Creature.cpp | 3 ++- src/game/WaypointManager.cpp | 3 +-- src/game/WaypointMovementGenerator.cpp | 17 +++++++---------- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index c0065212207..c57b8a27fb9 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -219,7 +219,8 @@ void Creature::RemoveCorpse() float x,y,z,o; GetRespawnCoord(x, y, z, &o); - GetMap()->CreatureRelocation(this,x,y,z,o); + SetHomePosition(x,y,z,o); + GetMap()->CreatureRelocation(this,x,y,z,o); } /** diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp index c18c09bcc17..fc0ca9e8007 100644 --- a/src/game/WaypointManager.cpp +++ b/src/game/WaypointManager.cpp @@ -34,7 +34,7 @@ void WaypointStore::Free() void WaypointStore::Load() { - QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data"); + QueryResult *result = WorldDatabase.PQuery("SELECT MAX(`id`) FROM `waypoint_data`"); if(!result) { sLog.outError(" an error occured while loading the table `waypoint_data` ( maybe it doesn't exist ?)\n"); @@ -44,7 +44,6 @@ void WaypointStore::Load() records = (*result)[0].GetUInt32(); delete result; - result = WorldDatabase.PQuery("SELECT `id`,`point`,`position_x`,`position_y`,`position_z`,`move_flag`,`delay`,`action`,`action_chance` FROM `waypoint_data` ORDER BY `id`, `point`"); if(!result) { diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp index 71d05d073d2..85ef44b51be 100644 --- a/src/game/WaypointMovementGenerator.cpp +++ b/src/game/WaypointMovementGenerator.cpp @@ -15,24 +15,17 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - -//Basic header -#include - +//Basic headers #include "WaypointMovementGenerator.h" #include "DestinationHolderImp.h" -//Accessors -#include "Database/DatabaseEnv.h" +//Extended headers #include "ObjectMgr.h" #include "World.h" //Creature-specific headers #include "Creature.h" #include "CreatureAI.h" -//Player-Specific +//Player-specific #include "Player.h" -//Visual -#include "ProgressBar.h" -#include "MapManager.h" template void @@ -42,6 +35,8 @@ template<> void WaypointMovementGenerator::Initialize(Creature &u) { + u.StopMoving(); + i_nextMoveTime.Reset(0); i_currentNode = -1; if(!path_id) path_id = u.GetWaypointPath(); @@ -160,6 +155,7 @@ WaypointMovementGenerator::Update(Creature &unit, const uint32 &diff) i_currentNode = 0; //Start moving all over again else { + unit.SetHomePosition(node.x, node.y, node.z, unit.GetOrientation()); unit.GetMotionMaster()->Initialize(); return false; //Clear the waypoint movement } @@ -184,6 +180,7 @@ WaypointMovementGenerator::Update(Creature &unit, const uint32 &diff) MovementInform(unit); unit.UpdateWaypointID(i_currentNode); unit.clearUnitState(UNIT_STAT_MOVING); + unit.Relocate(node.x, node.y, node.z); } } else -- cgit v1.2.3 From 12a52d2fbb3aef60f7eff73d1a10e0dbe9de5edf Mon Sep 17 00:00:00 2001 From: runningnak3d Date: Wed, 24 Dec 2008 09:03:40 +0000 Subject: * fixed typo for Electrical Storm spell * removed Wyvern Sting rank 5 and rank 6 from spell_linked_spell since they * are not available till wotlk :P * Ok, who was on crack? --HG-- branch : trunk --- sql/updates/389_world.sql | 6 ++++-- sql/updates/455_world.sql | 4 ++-- sql/updates/615_world.sql | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 sql/updates/615_world.sql diff --git a/sql/updates/389_world.sql b/sql/updates/389_world.sql index bbe7fb6fcc6..89094143f64 100644 --- a/sql/updates/389_world.sql +++ b/sql/updates/389_world.sql @@ -3,5 +3,7 @@ INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `commen INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-24132, 24134, 0, 'Wyvern Sting'); INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-24133, 24135, 0, 'Wyvern Sting'); INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-27068, 27069, 0, 'Wyvern Sting'); -INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49011, 49009, 0, 'Wyvern Sting'); -INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49012, 49010, 0, 'Wyvern Sting'); +-- Rank 5 (not available till wotlk) +-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49011, 49009, 0, 'Wyvern Sting'); +-- Rank 6 (not available till wotlk) +-- INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (-49012, 49010, 0, 'Wyvern Sting'); diff --git a/sql/updates/455_world.sql b/sql/updates/455_world.sql index a40de1b77f3..a5a23c5f5d6 100644 --- a/sql/updates/455_world.sql +++ b/sql/updates/455_world.sql @@ -5,8 +5,8 @@ UPDATE `creature_template` SET spell1 = 43218, flags_extra = 128, ScriptName = ' -- Broggok Poison Cloud UPDATE `creature_template` SET spell1 = 30914, flags_extra = 128, ScriptName = '' WHERE entry = 17662; - -INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43468, 44007, 1, 'Storm Eye Safe Zone'); +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (43468, 43648, 43658, 43658, 43658, 43658, 43658); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43648, 44007, 1, 'Storm Eye Safe Zone'); INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43653, 0, 'Electrical Arc Visual'); INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43654, 0, 'Electrical Arc Visual'); INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43658, 43655, 0, 'Electrical Arc Visual'); diff --git a/sql/updates/615_world.sql b/sql/updates/615_world.sql new file mode 100644 index 00000000000..28512e8511e --- /dev/null +++ b/sql/updates/615_world.sql @@ -0,0 +1,7 @@ +-- Wyvern Sting rank 5 and 6 not avail. till wotlk +DELETE FROM spell_linked_spell WHERE `spell_trigger` IN (-49011, -49012); + +-- typo +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (43468, 43648); +INSERT INTO spell_linked_spell (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES (43648, 44007, 1, 'Storm Eye Safe Zone'); + -- cgit v1.2.3