10
10
#include " Defines\TimelineMaker.h"
11
11
#include " Defines\ScriptCommands.h"
12
12
#include " Defines\Helpers.h"
13
+ #include " Defines\WorldDatabase.h"
13
14
#include " Database\Database.h"
14
15
15
16
extern Database GameDb;
@@ -634,7 +635,7 @@ std::string GetListOfPointsWithSamePosition(float posX, float posY, float posZ,
634
635
std::string points;
635
636
for (const auto & itr : TimelineMaker::m_eventsMap)
636
637
{
637
- if (auto ptr = std::dynamic_pointer_cast<SniffedEvent_VmangosWaypoints >(itr.second ))
638
+ if (auto ptr = std::dynamic_pointer_cast<SniffedEvent_mangosWaypoints >(itr.second ))
638
639
{
639
640
if (ptr->m_position_x == posX && ptr->m_position_y == posY && ptr->m_position_z == posZ && (ptr->m_point != point - 1 ))
640
641
{
@@ -690,7 +691,7 @@ void TimelineMaker::CreateWaypoints(uint32 guid, bool useStartPosition)
690
691
if (std::shared_ptr<QueryResult> result = GameDb.Query (" SELECT `guid`, `point`, `move_time`, `spline_flags`, `spline_count`, `start_position_x`, `start_position_y`, `start_position_z`, `end_position_x`, `end_position_y`, `end_position_z`, `orientation`, `unixtime` FROM `%s`.`creature_movement_server` WHERE `guid`=%u" , SniffDatabase::m_databaseName.c_str (), guid))
691
692
{
692
693
uint32 pointCounter = 1 ;
693
- std::shared_ptr<SniffedEvent_VmangosWaypoints > lastPoint = nullptr ;
694
+ std::shared_ptr<SniffedEvent_mangosWaypoints > lastPoint = nullptr ;
694
695
uint32 lastMoveTime = 0 ;
695
696
uint32 lastUnixTime = 0 ;
696
697
float lastOrientation = 100 .0f ;
@@ -746,7 +747,7 @@ void TimelineMaker::CreateWaypoints(uint32 guid, bool useStartPosition)
746
747
std::string comment = GetListOfPointsWithSamePosition (start_position_x, start_position_y, start_position_z, point);
747
748
if (!comment.empty ())
748
749
comment = " position seen before in points: " + comment;
749
- std::shared_ptr<SniffedEvent_VmangosWaypoints > newEvent = std::make_shared<SniffedEvent_VmangosWaypoints >(id, pointCounter, start_position_x, start_position_y, start_position_z, orientation, waittime, 0 .0f , 0 , comment);
750
+ std::shared_ptr<SniffedEvent_mangosWaypoints > newEvent = std::make_shared<SniffedEvent_mangosWaypoints >(id, pointCounter, start_position_x, start_position_y, start_position_z, orientation, waittime, 0 .0f , 0 , comment);
750
751
m_eventsMap.insert (std::make_pair (uint64 (unixtime) * 1000 , newEvent));
751
752
752
753
lastPoint = newEvent;
@@ -763,7 +764,7 @@ void TimelineMaker::CreateWaypoints(uint32 guid, bool useStartPosition)
763
764
uint32 splinesCount = (splines.size () - 1 );
764
765
float orientation = (i == splinesCount) ? final_orientation : 100 .0f ;
765
766
std::string comment = " spline " + std::to_string (i) + " /" + std::to_string (splinesCount);
766
- std::shared_ptr<SniffedEvent_VmangosWaypoints > newEvent = std::make_shared<SniffedEvent_VmangosWaypoints >(id, pointCounter, spline.position_x , spline.position_y , spline.position_z , orientation, 0 , 0 .0f , 0 , comment);
767
+ std::shared_ptr<SniffedEvent_mangosWaypoints > newEvent = std::make_shared<SniffedEvent_mangosWaypoints >(id, pointCounter, spline.position_x , spline.position_y , spline.position_z , orientation, 0 , 0 .0f , 0 , comment);
767
768
m_eventsMap.insert (std::make_pair (uint64 (unixtime) * 1000 , newEvent));
768
769
769
770
lastPoint = newEvent;
@@ -788,7 +789,7 @@ void TimelineMaker::CreateWaypoints(uint32 guid, bool useStartPosition)
788
789
comment = " position seen before in points: " + samePointsList;
789
790
}
790
791
791
- std::shared_ptr<SniffedEvent_VmangosWaypoints > newEvent = std::make_shared<SniffedEvent_VmangosWaypoints >(id, pointCounter, posX, posY, posZ, final_orientation, 0 , 0 .0f , 0 , comment);
792
+ std::shared_ptr<SniffedEvent_mangosWaypoints > newEvent = std::make_shared<SniffedEvent_mangosWaypoints >(id, pointCounter, posX, posY, posZ, final_orientation, 0 , 0 .0f , 0 , comment);
792
793
m_eventsMap.insert (std::make_pair (uint64 (unixtime) * 1000 , newEvent));
793
794
794
795
lastPoint = newEvent;
@@ -905,7 +906,7 @@ uint32 TimelineMaker::SaveWaypointsToFile()
905
906
if (!log .is_open ())
906
907
return 0 ;
907
908
908
- log << " INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`, `wander_distance`, `script_id`) VALUES\n " ;
909
+ log << (CURRENT_BUILD >= TBC_START_BUILD ? " INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`, `script_id`) VALUES \n " : " INSERT INTO `creature_movement` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `waittime`, ` wander_distance`, `script_id`) VALUES\n " ) ;
909
910
910
911
uint32 totalWaypointRows = 0 ;
911
912
for (const auto & itr : m_eventsMap)
@@ -918,7 +919,7 @@ uint32 TimelineMaker::SaveWaypointsToFile()
918
919
uint32 waypointRows = 0 ;
919
920
for (const auto & itr : m_eventsMap)
920
921
{
921
- if (auto ptr = std::dynamic_pointer_cast<SniffedEvent_VmangosWaypoints >(itr.second ))
922
+ if (auto ptr = std::dynamic_pointer_cast<SniffedEvent_mangosWaypoints >(itr.second ))
922
923
{
923
924
log << ptr->ToString (true );
924
925
waypointRows++;
@@ -1434,14 +1435,14 @@ void TimelineMaker::SaveScriptToFile(std::ofstream& log, uint32 scriptId, std::s
1434
1435
{
1435
1436
uint32 count = 0 ;
1436
1437
log << " DELETE FROM `" << tableName << " ` WHERE `id`=" << scriptId << " ;\n " ;
1437
- log << " INSERT INTO `" << tableName << " ` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES\n " ;
1438
+ log << " INSERT INTO `" << tableName << (CURRENT_BUILD >= TBC_START_BUILD) ? " ` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `buddy_entry`, `search_radius`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES \n " : " ` (`id`, `delay`, `command`, `datalong`, `datalong2`, `datalong3`, `datalong4`, `target_param1`, `target_param2`, `target_type`, `data_flags`, `dataint`, `dataint2`, `dataint3`, `dataint4`, `x`, `y`, `z`, `o`, `condition_id`, `comments`) VALUES\n " ;
1438
1439
for (const auto & script : vScripts)
1439
1440
{
1440
1441
if (count > 0 )
1441
1442
log << " ,\n " ;
1442
1443
log << " (" << script.id << " , " << script.delay - delayOffset << " , " << script.command << " , "
1443
- << script.raw .data [0 ] << " , " << script.raw .data [1 ] << " , " << script.raw .data [2 ] << " , " << script.raw .data [3 ] << " , "
1444
- << script.target_param1 << " , " << script.target_param2 << " , " << script.target_type << " , "
1444
+ << script.raw .data [0 ] << " , " << script.raw .data [1 ] << " , " << script.raw .data [2 ] << " , " << (CURRENT_BUILD >= TBC_START_BUILD ? " " : script.raw .data [3 ] + " , " )
1445
+ << script.target_param1 << " , " << script.target_param2 << " , " << (CURRENT_BUILD >= TBC_START_BUILD ? " " : script.target_type + " , " )
1445
1446
<< script.raw .data [4 ] << " , " << script.raw .data [5 ] << " , " << script.raw .data [6 ] << " , " << script.raw .data [7 ] << " , "
1446
1447
<< script.raw .data [8 ] << " , " << script.x << " , " << script.y << " , " << script.z << " , " << script.o << " , "
1447
1448
<< script.condition << " , '" << script.comment << " ')" ;
0 commit comments