aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_script_texts.sql3
-rw-r--r--sql/FULL/world_script_waypoints.sql54
-rw-r--r--sql/FULL/world_scripts_full.sql1
-rw-r--r--sql/FULL/world_spell_full.sql1
-rw-r--r--sql/updates/5696_world.sql91
-rw-r--r--src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp25
-rw-r--r--src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp14
-rw-r--r--src/game/Creature.cpp27
-rw-r--r--src/game/Creature.h9
-rw-r--r--src/game/Level2.cpp55
-rw-r--r--src/game/Unit.cpp8
-rw-r--r--src/game/WaypointManager.cpp20
-rw-r--r--src/game/WaypointManager.h11
-rw-r--r--src/game/WaypointMovementGenerator.cpp6
-rw-r--r--src/game/WaypointMovementGenerator.h4
-rw-r--r--src/game/Wintergrasp.cpp17
-rw-r--r--src/shared/Database/SQLStorage.cpp4
17 files changed, 248 insertions, 102 deletions
diff --git a/sql/FULL/world_script_texts.sql b/sql/FULL/world_script_texts.sql
index b833a6abe91..2d0c0269266 100644
--- a/sql/FULL/world_script_texts.sql
+++ b/sql/FULL/world_script_texts.sql
@@ -395,6 +395,9 @@ INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`content_loc1`
(18210,-1000486,'Ride the lightning, filth!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'maghar captive SAY_MAG_LIGHTNING'),
(18210,-1000487,'FROST SHOCK!!!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'maghar captive SAY_MAG_SHOCK'),
(18210,-1000488,'It is best that we split up now, in case they send more after us. Hopefully one of us will make it back to Garrosh. Farewell stranger.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,0,0,'maghar captive SAY_MAG_COMPLETE'),
+ (17077,-1000496,'%s lifts its head into the air, as if listening for something.',0,2,0,0,'ancestral wolf EMOTE_WOLF_LIFT_HEAD'),
+ (17077,-1000497,'%s lets out a howl that rings across the mountains to the north and motions for you to follow.',0,2,0,0,'ancestral wolf EMOTE_WOLF_HOWL'),
+ (17077,-1000498,'Welcome, kind spirit. What has brought you to us?',0,0,0,0,'ancestral wolf SAY_WOLF_WELCOME'),
-- -1 033 000 SHADOWFANG KEEP
(0,-1033000,'Follow me and I''ll open the courtyard door for you.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,7,1,'prisoner ashcrombe SAY_FREE_AS'),
diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql
index 9028d6067a5..db5fa818df7 100644
--- a/sql/FULL/world_script_waypoints.sql
+++ b/sql/FULL/world_script_waypoints.sql
@@ -1534,6 +1534,60 @@ INSERT INTO `script_waypoint` VALUES
(18210, 18, -1324.803589, 8510.688477, 13.050, 0, ''),
(18210, 19, -1312.075439, 8492.709961, 14.235, 0, '');
+DELETE FROM `script_waypoint` WHERE `entry`=17077;
+INSERT INTO `script_waypoint` VALUES
+ (17077, 0, -16.950142, 3801.409424, 95.064, 5000, 'EMOTE_WOLF_LIFT_HEAD'),
+ (17077, 1, -15.577404, 3805.170898, 94.833, 2500, ''),
+ (17077, 2, -20.011766, 3806.609863, 92.476, 5000, 'EMOTE_WOLF_HOWL'),
+ (17077, 3, -18.594666, 3816.207764, 91.482, 0, ''),
+ (17077, 4, -19.293468, 3838.218750, 85.012, 0, ''),
+ (17077, 5, -16.504408, 3871.034668, 82.327, 0, ''),
+ (17077, 6, 2.064510, 3898.678711, 85.623, 0, ''),
+ (17077, 7, 16.403864, 3921.174072, 86.024, 0, ''),
+ (17077, 8, 47.307926, 3932.001465, 83.302, 0, ''),
+ (17077, 9, 90.067230, 3942.906250, 77.000, 0, ''),
+ (17077, 10, 106.886024, 3944.388428, 76.502, 0, ''),
+ (17077, 11, 139.085480, 3941.897217, 80.617, 0, ''),
+ (17077, 12, 150.092346, 3942.782959, 80.399, 0, ''),
+ (17077, 13, 193.511475, 3950.396484, 74.366, 0, ''),
+ (17077, 14, 226.274948, 3958.003418, 73.257, 0, ''),
+ (17077, 15, 246.686981, 3963.309326, 76.376, 0, ''),
+ (17077, 16, 264.206177, 3977.726563, 83.704, 0, ''),
+ (17077, 17, 279.857422, 3986.417236, 88.245, 0, ''),
+ (17077, 18, 304.039642, 3998.354004, 95.649, 0, ''),
+ (17077, 19, 328.071503, 3995.832764, 104.434, 0, ''),
+ (17077, 20, 347.485229, 3990.817627, 113.608, 0, ''),
+ (17077, 21, 351.257202, 3954.260254, 125.747, 0, ''),
+ (17077, 22, 345.625977, 3932.016113, 132.358, 0, ''),
+ (17077, 23, 347.971893, 3908.549561, 135.520, 0, ''),
+ (17077, 24, 351.887878, 3891.062744, 139.957, 0, ''),
+ (17077, 25, 346.116852, 3864.634277, 146.647, 0, ''),
+ (17077, 26, 330.012360, 3839.859375, 154.148, 0, ''),
+ (17077, 27, 297.250610, 3811.855225, 166.893, 0, ''),
+ (17077, 28, 290.783112, 3800.188477, 172.130, 0, ''),
+ (17077, 29, 288.125427, 3782.474365, 180.825, 0, ''),
+ (17077, 30, 296.817841, 3771.629639, 184.961, 0, ''),
+ (17077, 31, 305.256256, 3765.380615, 185.360, 0, ''),
+ (17077, 32, 311.447906, 3757.902100, 184.312, 0, ''),
+ (17077, 33, 325.258026, 3730.282227, 184.076, 0, ''),
+ (17077, 34, 341.158630, 3717.757080, 183.904, 0, ''),
+ (17077, 35, 365.589020, 3717.200684, 183.902, 0, ''),
+ (17077, 36, 387.395081, 3731.750732, 183.645, 0, ''),
+ (17077, 37, 396.574127, 3732.604248, 179.831, 0, ''),
+ (17077, 38, 404.303192, 3737.313232, 180.151, 0, ''),
+ (17077, 39, 410.995972, 3742.286865, 183.364, 0, ''),
+ (17077, 40, 434.904541, 3761.058838, 186.219, 0, ''),
+ (17077, 41, 460.128815, 3774.436768, 186.348, 0, ''),
+ (17077, 42, 467.643951, 3788.506104, 186.446, 0, ''),
+ (17077, 43, 491.551666, 3815.446777, 189.848, 0, ''),
+ (17077, 44, 496.957855, 3836.875244, 193.078, 0, ''),
+ (17077, 45, 502.889191, 3855.458740, 194.834, 0, ''),
+ (17077, 46, 508.208466, 3863.689453, 194.024, 0, ''),
+ (17077, 47, 528.907593, 3887.348633, 189.762, 0, ''),
+ (17077, 48, 527.722229, 3890.686523, 189.240, 0, ''),
+ (17077, 49, 524.637329, 3891.768066, 189.149, 0, ''),
+ (17077, 50, 519.146057, 3886.701660, 190.128, 60000, 'SAY_WOLF_WELCOME');
+
/* EOF */
DELETE FROM `script_waypoint` WHERE `entry`=28912;
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index 1e5c0586ca5..1fcb2b6326f 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -569,6 +569,7 @@ UPDATE `gameobject_template` SET `ScriptName`='go_haaleshi_altar' WHERE `entry`=
UPDATE `creature_template` SET `ScriptName`='npc_naladu' WHERE `entry`=19361;
UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`=18266;
UPDATE `creature_template` SET `ScriptName`='npc_trollbane' WHERE `entry`=16819;
+UPDATE `creature_template` SET `ScriptName`='npc_ancestral_wolf' WHERE `entry`=17077;
/* HILLSBRAD FOOTHILLS */
diff --git a/sql/FULL/world_spell_full.sql b/sql/FULL/world_spell_full.sql
index 1a054600fb1..7a98e59c3cf 100644
--- a/sql/FULL/world_spell_full.sql
+++ b/sql/FULL/world_spell_full.sql
@@ -720,6 +720,7 @@ INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `Spell
( 20180, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 4)
( 20181, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 3)
( 20182, 0x00, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000043, 0, 0, 0), -- Reckoning (Rank 5)
+( 20185, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 15, 0, 0), -- Judgement of Light
( 20210, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 1)
( 20212, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 2)
( 20213, 0x00, 10, 0xC0000000, 0x00010000, 0x00000000, 0x00000000, 0x00000002, 0, 0, 0), -- Illumination (Rank 3)
diff --git a/sql/updates/5696_world.sql b/sql/updates/5696_world.sql
new file mode 100644
index 00000000000..eae696fa348
--- /dev/null
+++ b/sql/updates/5696_world.sql
@@ -0,0 +1,91 @@
+
+-- *Zum'Rah Area Trigger Script, Zum'Rah should become hostile when approached. By totoro.
+DELETE FROM `areatrigger_scripts` WHERE `entry`=962;
+INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES('962','at_zumrah');
+
+-- *Judgement of Light PPM based, not 100%. By Drevi.
+DELETE FROM `spell_proc_event` WHERE `entry`=20185;
+INSERT INTO `spell_proc_event` (`entry`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `procFlags`, `procEx`, `ppmRate`, `CustomChance`, `Cooldown`) VALUES
+( 20185, 0x01, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 15, 0, 0); -- Judgement of Light
+
+-- *A Spirit Guide Escort Quest, code from SD2, patch by manuel.
+UPDATE `creature_template` SET `ScriptName`='npc_ancestral_wolf' WHERE `entry`=17077;
+
+-- This should be sent to TDB
+-- INSERT INTO `gameobject` VALUES (NULL, 300070, 530, 1,1,-20.236, 3803.41, 93.1402, 5.24994, 0, 0, 0.493946, -0.869492, 25, 0, 1);
+
+DELETE FROM `script_texts` WHERE `entry`=17077;
+INSERT INTO `script_texts` (`npc_entry`,`entry`,`content_default`,`sound`,`type`,`language`,`emote`,`comment`) VALUES
+ (17077,-1000496,'%s lifts its head into the air, as if listening for something.',0,2,0,0,'ancestral wolf EMOTE_WOLF_LIFT_HEAD'),
+ (17077,-1000497,'%s lets out a howl that rings across the mountains to the north and motions for you to follow.',0,2,0,0,'ancestral wolf EMOTE_WOLF_HOWL'),
+ (17077,-1000498,'Welcome, kind spirit. What has brought you to us?',0,0,0,0,'ancestral wolf SAY_WOLF_WELCOME');
+
+DELETE FROM `script_waypoint` WHERE `entry`=17077;
+INSERT INTO `script_waypoint` VALUES
+ (17077, 0, -16.950142, 3801.409424, 95.064, 5000, 'EMOTE_WOLF_LIFT_HEAD'),
+ (17077, 1, -15.577404, 3805.170898, 94.833, 2500, ''),
+ (17077, 2, -20.011766, 3806.609863, 92.476, 5000, 'EMOTE_WOLF_HOWL'),
+ (17077, 3, -18.594666, 3816.207764, 91.482, 0, ''),
+ (17077, 4, -19.293468, 3838.218750, 85.012, 0, ''),
+ (17077, 5, -16.504408, 3871.034668, 82.327, 0, ''),
+ (17077, 6, 2.064510, 3898.678711, 85.623, 0, ''),
+ (17077, 7, 16.403864, 3921.174072, 86.024, 0, ''),
+ (17077, 8, 47.307926, 3932.001465, 83.302, 0, ''),
+ (17077, 9, 90.067230, 3942.906250, 77.000, 0, ''),
+ (17077, 10, 106.886024, 3944.388428, 76.502, 0, ''),
+ (17077, 11, 139.085480, 3941.897217, 80.617, 0, ''),
+ (17077, 12, 150.092346, 3942.782959, 80.399, 0, ''),
+ (17077, 13, 193.511475, 3950.396484, 74.366, 0, ''),
+ (17077, 14, 226.274948, 3958.003418, 73.257, 0, ''),
+ (17077, 15, 246.686981, 3963.309326, 76.376, 0, ''),
+ (17077, 16, 264.206177, 3977.726563, 83.704, 0, ''),
+ (17077, 17, 279.857422, 3986.417236, 88.245, 0, ''),
+ (17077, 18, 304.039642, 3998.354004, 95.649, 0, ''),
+ (17077, 19, 328.071503, 3995.832764, 104.434, 0, ''),
+ (17077, 20, 347.485229, 3990.817627, 113.608, 0, ''),
+ (17077, 21, 351.257202, 3954.260254, 125.747, 0, ''),
+ (17077, 22, 345.625977, 3932.016113, 132.358, 0, ''),
+ (17077, 23, 347.971893, 3908.549561, 135.520, 0, ''),
+ (17077, 24, 351.887878, 3891.062744, 139.957, 0, ''),
+ (17077, 25, 346.116852, 3864.634277, 146.647, 0, ''),
+ (17077, 26, 330.012360, 3839.859375, 154.148, 0, ''),
+ (17077, 27, 297.250610, 3811.855225, 166.893, 0, ''),
+ (17077, 28, 290.783112, 3800.188477, 172.130, 0, ''),
+ (17077, 29, 288.125427, 3782.474365, 180.825, 0, ''),
+ (17077, 30, 296.817841, 3771.629639, 184.961, 0, ''),
+ (17077, 31, 305.256256, 3765.380615, 185.360, 0, ''),
+ (17077, 32, 311.447906, 3757.902100, 184.312, 0, ''),
+ (17077, 33, 325.258026, 3730.282227, 184.076, 0, ''),
+ (17077, 34, 341.158630, 3717.757080, 183.904, 0, ''),
+ (17077, 35, 365.589020, 3717.200684, 183.902, 0, ''),
+ (17077, 36, 387.395081, 3731.750732, 183.645, 0, ''),
+ (17077, 37, 396.574127, 3732.604248, 179.831, 0, ''),
+ (17077, 38, 404.303192, 3737.313232, 180.151, 0, ''),
+ (17077, 39, 410.995972, 3742.286865, 183.364, 0, ''),
+ (17077, 40, 434.904541, 3761.058838, 186.219, 0, ''),
+ (17077, 41, 460.128815, 3774.436768, 186.348, 0, ''),
+ (17077, 42, 467.643951, 3788.506104, 186.446, 0, ''),
+ (17077, 43, 491.551666, 3815.446777, 189.848, 0, ''),
+ (17077, 44, 496.957855, 3836.875244, 193.078, 0, ''),
+ (17077, 45, 502.889191, 3855.458740, 194.834, 0, ''),
+ (17077, 46, 508.208466, 3863.689453, 194.024, 0, ''),
+ (17077, 47, 528.907593, 3887.348633, 189.762, 0, ''),
+ (17077, 48, 527.722229, 3890.686523, 189.240, 0, ''),
+ (17077, 49, 524.637329, 3891.768066, 189.149, 0, ''),
+ (17077, 50, 519.146057, 3886.701660, 190.128, 60000, 'SAY_WOLF_WELCOME');
+
+-- *TrullyOne/MeanMachine Waypoint System Restored. Patch by XTElite1.
+-- This should be applied to world_script_waypoints.sql ASAP
+ALTER TABLE `creature_addon`
+ ADD `path_id` int(11) unsigned NOT NULL default '0' AFTER `guid`;
+ALTER TABLE `creature_template_addon`
+ ADD `path_id` int(11) unsigned NOT NULL default '0' AFTER `entry`;
+
+ALTER TABLE `waypoint_data` ADD COLUMN `id_old` int(10) unsigned NOT NULL default '0' COMMENT 'Creature GUID' AFTER `wpguid`;
+UPDATE `waypoint_data` SET `id_old`=`id`*0.1;
+
+REPLACE INTO `creature_addon` ( `guid` ) SELECT `id_old` FROM `waypoint_data`;
+
+UPDATE `creature_addon`,`waypoint_data` SET `creature_addon`.`path_id` = `waypoint_data`.`id` WHERE `creature_addon`.`guid`=`waypoint_data`.`id_old`;
+
+ALTER TABLE `waypoint_data` DROP COLUMN `id_old`;
diff --git a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp
index 8c6442ade4f..2ac360faa09 100644
--- a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp
+++ b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp
@@ -228,6 +228,25 @@ bool GOHello_go_shallow_grave(Player* pPlayer, GameObject* pGo)
return false;
}
+/*######
+## at_zumrah
+######*/
+
+enum {
+ ZUMRAH_ID = 7271,
+ ZUMRAH_HOSTILE_FACTION = 37
+};
+
+bool AreaTrigger_at_zumrah(Player* pPlayer, AreaTriggerEntry *at)
+{
+ Creature* Zumrah = pPlayer->FindNearestCreature(ZUMRAH_ID, 30.0f);
+
+ if (!Zumrah)
+ return false;
+
+ Zumrah->setFaction(ZUMRAH_HOSTILE_FACTION);
+}
+
void AddSC_zulfarrak()
{
Script *newscript;
@@ -250,4 +269,10 @@ void AddSC_zulfarrak()
newscript->Name="go_shallow_grave";
newscript->pGOHello = &GOHello_go_shallow_grave;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "at_zumrah";
+ newscript->pAreaTrigger = &AreaTrigger_at_zumrah;
+ newscript->RegisterSelf();
+
}
diff --git a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp
index c5cae7e7412..30e835711a4 100644
--- a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp
+++ b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp
@@ -17,12 +17,13 @@
/* ScriptData
SDName: Hellfire_Peninsula
SD%Complete: 100
- SDComment: Quest support: 9375, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths)
+SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths)
SDCategory: Hellfire Peninsula
EndScriptData */
/* ContentData
npc_aeranas
+npc_ancestral_wolf
go_haaleshi_altar
npc_naladu
npc_tracy_proudwell
@@ -337,20 +338,21 @@ bool QuestAccept_npc_wounded_blood_elf(Player* pPlayer, Creature* pCreature, Que
return true;
}
-/*######
-##
-######*/
-
void AddSC_hellfire_peninsula()
{
Script *newscript;
newscript = new Script;
- newscript->Name = "npc_aeranas";
+ newscript->Name = "npc_aeranas";
newscript->GetAI = &GetAI_npc_aeranas;
newscript->RegisterSelf();
newscript = new Script;
+ newscript->Name = "npc_ancestral_wolf";
+ newscript->GetAI = &GetAI_npc_ancestral_wolf;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
newscript->Name = "go_haaleshi_altar";
newscript->pGOHello = &GOHello_go_haaleshi_altar;
newscript->RegisterSelf();
diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index e04a552c335..3812ce7865a 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -182,7 +182,7 @@ void Creature::AddToWorld()
m_zoneScript->OnCreatureCreate(this, true);
ObjectAccessor::Instance().AddObject(this);
Unit::AddToWorld();
- SearchFormationAndPath();
+ SearchFormation();
AIM_Initialize();
if(IsVehicle())
GetVehicleKit()->Install();
@@ -212,7 +212,7 @@ void Creature::DisappearAndDie()
RemoveCorpse();
}
-void Creature::SearchFormationAndPath()
+void Creature::SearchFormation()
{
if(isSummon())
return;
@@ -221,28 +221,9 @@ void Creature::SearchFormationAndPath()
if(!lowguid)
return;
- bool usePath = (GetDefaultMovementType() == WAYPOINT_MOTION_TYPE);
CreatureGroupInfoType::iterator frmdata = CreatureGroupMap.find(lowguid);
if(frmdata != CreatureGroupMap.end())
- {
- if(usePath && lowguid != frmdata->second->leaderGUID)
- {
- SetDefaultMovementType(IDLE_MOTION_TYPE);
- usePath = false;
- }
formation_mgr.AddCreatureToGroup(frmdata->second->leaderGUID, this);
- }
-
- if(usePath)
- {
- if(WaypointMgr.GetPath(lowguid * 10))
- SetWaypointPathId(lowguid * 10);
- else
- {
- sLog.outErrorDb("Creature DBGUID %u has waypoint motion type, but it does not have a waypoint path!", lowguid);
- SetDefaultMovementType(IDLE_MOTION_TYPE);
- }
- }
}
void Creature::RemoveCorpse()
@@ -2271,6 +2252,10 @@ bool Creature::LoadCreaturesAddon(bool reload)
if (cainfo->move_flags != 0)
SetUnitMovementFlags(cainfo->move_flags);
+ //Load Path
+ if (cainfo->path_id != 0)
+ m_path_id = cainfo->path_id;
+
if(cainfo->auras)
{
for (CreatureDataAddonAura const* cAura = cainfo->auras; cAura->spell_id; ++cAura)
diff --git a/src/game/Creature.h b/src/game/Creature.h
index 63baee1799b..d7c09c35548 100644
--- a/src/game/Creature.h
+++ b/src/game/Creature.h
@@ -317,6 +317,7 @@ struct CreatureDataAddonAura
struct CreatureDataAddon
{
uint32 guidOrEntry;
+ uint32 path_id;
uint32 mount;
uint32 bytes1;
uint32 bytes2;
@@ -696,13 +697,13 @@ class TRINITY_DLL_SPEC Creature : public Unit
uint32 GetGlobalCooldown() const { return m_GlobalCooldown; }
- uint32 GetWaypointPathId() const { return m_pathId; }
- void SetWaypointPathId(uint32 pathid) { m_pathId = pathid; }
+ uint32 GetWaypointPath(){return m_path_id;}
+ void LoadPath(uint32 pathid) { m_path_id = pathid; }
uint32 GetCurrentWaypointID(){return m_waypointID;}
void UpdateWaypointID(uint32 wpID){m_waypointID = wpID;}
- void SearchFormationAndPath();
+ void SearchFormation();
CreatureGroup *GetFormation() {return m_formation;}
void SetFormation(CreatureGroup *formation) {m_formation = formation;}
@@ -777,7 +778,7 @@ class TRINITY_DLL_SPEC Creature : public Unit
private:
//WaypointMovementGenerator vars
uint32 m_waypointID;
- uint32 m_pathId;
+ uint32 m_path_id;
//Formation var
CreatureGroup *m_formation;
diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp
index 2524e829a38..b6cf14402c6 100644
--- a/src/game/Level2.cpp
+++ b/src/game/Level2.cpp
@@ -1162,7 +1162,7 @@ bool ChatHandler::HandleNpcAddMoveCommand(const char* args)
// update movement type
WorldDatabase.PExecuteLog("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE,lowguid);
- if(pCreature && pCreature->GetWaypointPathId())
+ if(pCreature && pCreature->GetWaypointPath())
{
pCreature->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
pCreature->GetMotionMaster()->Initialize();
@@ -1487,7 +1487,7 @@ bool ChatHandler::HandleNpcSetMoveTypeCommand(const char* args)
{
// update movement type
if(doNotDelete == false)
- pCreature->SetWaypointPathId(0);
+ pCreature->LoadPath(0);
pCreature->SetDefaultMovementType(move_type);
pCreature->GetMotionMaster()->Initialize();
@@ -2300,7 +2300,7 @@ bool ChatHandler::HandleWpAddCommand(const char* args)
if (!path_number)
{
if(target)
- pathid = target->GetWaypointPathId();
+ pathid = target->GetWaypointPath();
else
{
QueryResult *result = WorldDatabase.PQuery( "SELECT MAX(id) FROM waypoint_data");
@@ -2384,7 +2384,6 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
return true;
}
- /*
guidlow = target->GetDBTableGUIDLow();
QueryResult *result = WorldDatabase.PQuery( "SELECT guid FROM creature_addon WHERE guid = '%u'",guidlow);
@@ -2395,11 +2394,10 @@ bool ChatHandler::HandleWpLoadPathCommand(const char *args)
}
else
WorldDatabase.PExecute("INSERT INTO creature_addon(guid,path_id) VALUES ('%u','%u')", guidlow, pathid);
- */
WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", WAYPOINT_MOTION_TYPE, guidlow);
- target->SetWaypointPathId(pathid);
+ target->LoadPath(pathid);
target->SetDefaultMovementType(WAYPOINT_MOTION_TYPE);
target->GetMotionMaster()->Initialize();
target->MonsterSay("Path loaded.",0,0);
@@ -2433,39 +2431,22 @@ bool ChatHandler::HandleWpUnLoadPathCommand(const char *args)
return true;
}
- if(target->GetWaypointPathId())
+ if(target->GetCreatureAddon())
{
- uint32 pathId = target->GetDBTableGUIDLow() * 10;
- if(target->GetWaypointPathId() == pathId)
+ if(target->GetCreatureAddon()->path_id != 0)
{
- for(uint32 i = 1; i < 11; ++i)
- {
- if(i == 10)
- {
- PSendSysMessage("%s%s|r", "|cffff33ff", "Target cannot have more than 9 script paths. Unloading failed.");
- break;
- }
-
- if(WaypointMgr.GetPath(++pathId))
- continue;
-
- WorldDatabase.PExecute("UPDATE waypoint_data SET id = %u WHERE id = %u", pathId, target->GetDBTableGUIDLow() * 10);
- WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow);
- target->SetWaypointPathId(0);
- target->UpdateWaypointID(0);
- target->SetDefaultMovementType(IDLE_MOTION_TYPE);
- target->GetMotionMaster()->Initialize();
- target->GetMotionMaster()->MoveTargetedHome();
- PSendSysMessage("Path unloaded.");
- break;
- }
+ WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", target->GetGUIDLow());
+ target->UpdateWaypointID(0);
+ WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow);
+ target->LoadPath(0);
+ target->SetDefaultMovementType(IDLE_MOTION_TYPE);
+ target->GetMotionMaster()->MoveTargetedHome();
+ target->GetMotionMaster()->Initialize();
+ target->MonsterSay("Path unloaded.",0,0);
+ return true;
}
- else
- PSendSysMessage("%s%s|r", "|cffff33ff", "Target has path but that path is not its default path. Unloading failed.");
+ PSendSysMessage("%s%s|r", "|cffff33ff", "Target have no loaded path.");
}
- else
- PSendSysMessage("%s%s|r", "|cffff33ff", "Target has no loaded path.");
-
return true;
}
@@ -2926,7 +2907,7 @@ bool ChatHandler::HandleWpShowCommand(const char* args)
return false;
}
- pathid = target->GetWaypointPathId();
+ pathid = target->GetWaypointPath();
}
else
{
@@ -4221,7 +4202,7 @@ bool ChatHandler::HandleNpcAddFormationCommand(const char* args)
group_member->groupAI = 0;
CreatureGroupMap[lowguid] = group_member;
- pCreature->SearchFormationAndPath();
+ pCreature->SearchFormation();
WorldDatabase.PExecuteLog("INSERT INTO creature_formations (leaderGUID, memberGUID, dist, angle, groupAI) VALUES ('%u','%u','%f', '%f', '%u')",
leaderGUID, lowguid, group_member->follow_dist, group_member->follow_angle, group_member->groupAI);
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index a49c78bf918..8b77f5a4036 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7533,6 +7533,14 @@ bool Unit::HandleProcTriggerSpell(Unit *pVictim, uint32 damage, AuraEffect* trig
trigger_spell_id = 26470;
break;
}
+ // Deflection
+ case 52420:
+ {
+ if(GetHealth()*100 / GetMaxHealth() >= 35)
+ return false;
+ break;
+ }
+
// Cheat Death
case 28845:
{
diff --git a/src/game/WaypointManager.cpp b/src/game/WaypointManager.cpp
index a779641c1c1..b9fb027d9c5 100644
--- a/src/game/WaypointManager.cpp
+++ b/src/game/WaypointManager.cpp
@@ -24,12 +24,12 @@
#include "ProgressBar.h"
#include "MapManager.h"
-WaypointPathMap WaypointPathHolder;
+UNORDERED_MAP<uint32, WaypointPath*> waypoint_map;
WaypointStore WaypointMgr;
void WaypointStore::Free()
{
- WaypointPathHolder.clear();
+ waypoint_map.clear();
}
void WaypointStore::Load()
@@ -88,7 +88,7 @@ void WaypointStore::Load()
path_data->push_back(wp);
if(id != last_id)
- WaypointPathHolder[id] = path_data;
+ waypoint_map[id] = path_data;
last_id = id;
@@ -99,16 +99,8 @@ void WaypointStore::Load()
void WaypointStore::UpdatePath(uint32 id)
{
- // Prevent memory leak, deallocate allocated memory instead of just clearing from object holder
- WaypointPathMap::iterator itr = WaypointPathHolder.find(id);
- if(itr != WaypointPathHolder.end())
- {
- for(WaypointPath::iterator jtr = WaypointPathHolder[id]->begin(); jtr != WaypointPathHolder[id]->end(); ++jtr)
- {
- delete (*jtr);
- }
- delete itr->second;
- }
+ if(waypoint_map.find(id)!= waypoint_map.end())
+ waypoint_map[id]->clear();
QueryResult *result;
@@ -150,7 +142,7 @@ void WaypointStore::UpdatePath(uint32 id)
}
while (result->NextRow());
- WaypointPathHolder[id] = path_data;
+ waypoint_map[id] = path_data;
delete result;
}
diff --git a/src/game/WaypointManager.h b/src/game/WaypointManager.h
index a8f2d5746e9..85f8b765d45 100644
--- a/src/game/WaypointManager.h
+++ b/src/game/WaypointManager.h
@@ -34,9 +34,7 @@ struct WaypointData
};
typedef std::vector<WaypointData*> WaypointPath;
-typedef UNORDERED_MAP<uint32, WaypointPath*> WaypointPathMap;
-
-extern WaypointPathMap WaypointPathHolder;
+extern UNORDERED_MAP<uint32, WaypointPath*> waypoint_map;
class WaypointStore
{
@@ -50,10 +48,9 @@ class WaypointStore
WaypointPath* GetPath(uint32 id)
{
- WaypointPathMap::iterator itr = WaypointPathHolder.find(id);
- if(itr != WaypointPathHolder.end())
- return itr->second;
- return NULL;
+ if(waypoint_map.find(id) != waypoint_map.end())
+ return waypoint_map[id];
+ else return 0;
}
inline uint32 GetRecordsCount() { return records; }
diff --git a/src/game/WaypointMovementGenerator.cpp b/src/game/WaypointMovementGenerator.cpp
index 0a11acab88a..0bfd007011b 100644
--- a/src/game/WaypointMovementGenerator.cpp
+++ b/src/game/WaypointMovementGenerator.cpp
@@ -97,7 +97,7 @@ WaypointMovementGenerator<Creature>::Initialize(Creature &u)
//i_nextMoveTime.Reset(0);
StopedByPlayer = false;
if(!path_id)
- path_id = u.GetWaypointPathId();
+ path_id = u.GetWaypointPath();
waypoints = WaypointMgr.GetPath(path_id);
i_currentNode = 0;
if(waypoints && waypoints->size())
@@ -223,7 +223,7 @@ template bool WaypointMovementGenerator<Player>::Update(Player &, const uint32 &
template void WaypointMovementGenerator<Player>::MovementInform(Player &);
//----------------------------------------------------//
-void FlightPathMovementGenerator::SetWaypointPathId(Player &)
+void FlightPathMovementGenerator::LoadPath(Player &)
{
objmgr.GetTaxiPathNodes(i_pathId, i_path,i_mapIds);
}
@@ -248,7 +248,7 @@ void FlightPathMovementGenerator::Initialize(Player &player)
player.getHostilRefManager().setOnlineOfflineState(false);
player.addUnitState(UNIT_STAT_IN_FLIGHT);
player.SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
- SetWaypointPathId(player);
+ LoadPath(player);
Traveller<Player> traveller(player);
// do not send movement, it was sent already
i_destinationHolder.SetDestination(traveller, i_path[i_currentNode].x, i_path[i_currentNode].y, i_path[i_currentNode].z, false);
diff --git a/src/game/WaypointMovementGenerator.h b/src/game/WaypointMovementGenerator.h
index 9c93486a675..9804c150d63 100644
--- a/src/game/WaypointMovementGenerator.h
+++ b/src/game/WaypointMovementGenerator.h
@@ -50,7 +50,7 @@ class TRINITY_DLL_SPEC PathMovementBase
bool MovementInProgress(void) const { return i_currentNode < i_path.Size(); }
- void SetWaypointPathId(T &);
+ void LoadPath(T &);
void ReloadPath(T &);
uint32 GetCurrentNode() const { return i_currentNode; }
@@ -104,7 +104,7 @@ public PathMovementBase<Player>
bool Update(Player &, const uint32 &);
MovementGeneratorType GetMovementGeneratorType() { return FLIGHT_MOTION_TYPE; }
- void SetWaypointPathId(Player &);
+ void LoadPath(Player &);
void ReloadPath(Player &) { /* don't reload flight path */ }
Path& GetPath() { return i_path; }
diff --git a/src/game/Wintergrasp.cpp b/src/game/Wintergrasp.cpp
index fcd624eb606..e56bd36fc19 100644
--- a/src/game/Wintergrasp.cpp
+++ b/src/game/Wintergrasp.cpp
@@ -634,6 +634,10 @@ bool OPvPWintergrasp::UpdateGameObjectInfo(GameObject *go) const
case 190763:
go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[m_defender]);
return true;
+ // Titan relic
+ case 192829:
+ go->SetUInt32Value(GAMEOBJECT_FACTION, WintergraspFaction[OTHER_TEAM(m_defender)]);
+ return true;
}
// Note: this is only for test, still need db support
@@ -742,9 +746,9 @@ void OPvPWintergrasp::UpdateTenacityStack()
if(allianceNum && hordeNum)
{
if(allianceNum < hordeNum)
- newStack = hordeNum / allianceNum - 1; // positive, should cast on alliance
+ newStack = (hordeNum / allianceNum - 1)*4; // positive, should cast on alliance
else if(allianceNum > hordeNum)
- newStack = 1 - int32(allianceNum / hordeNum); // negative, should cast on horde
+ newStack = (1 - int32(allianceNum / hordeNum))*4; // negative, should cast on horde
}
if(newStack == m_tenacityStack)
@@ -774,11 +778,12 @@ void OPvPWintergrasp::UpdateTenacityStack()
{
TeamId team = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE;
if(newStack < 0) newStack = -newStack;
+ int32 auraStack = newStack > 20 ? 20 : newStack; //Dont let it be higher than 20
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
if((*itr)->getLevel() > 69)
- (*itr)->SetAuraStack(SPELL_TENACITY, *itr, newStack);
+ (*itr)->SetAuraStack(SPELL_TENACITY, *itr, auraStack);
for(CreatureSet::iterator itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
- (*itr)->SetAuraStack(SPELL_TENACITY_VEHICLE, *itr, newStack);
+ (*itr)->SetAuraStack(SPELL_TENACITY_VEHICLE, *itr, auraStack);
}
}
@@ -942,13 +947,13 @@ void OPvPWintergrasp::EndBattle()
}
}
- TeamId loser = OTHER_TEAM(m_defender);
+ /*TeamId loser = OTHER_TEAM(m_defender);
for(PlayerSet::iterator itr = m_players[loser].begin(); itr != m_players[loser].end();)
{
Player *plr = *itr;
++itr;
plr->CastSpell(plr, SPELL_TELEPORT_DALARAN, true);
- }
+ }*/
// remove auras from players who are not online
CharacterDatabase.PExecute("DELETE FROM character_aura WHERE spell IN (%u,%u,%u)", SPELL_RECRUIT, SPELL_CORPORAL, SPELL_LIEUTENANT);
diff --git a/src/shared/Database/SQLStorage.cpp b/src/shared/Database/SQLStorage.cpp
index 4113d35236d..372baafe278 100644
--- a/src/shared/Database/SQLStorage.cpp
+++ b/src/shared/Database/SQLStorage.cpp
@@ -29,9 +29,9 @@ extern DatabaseMysql WorldDatabase;
const char CreatureInfosrcfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiiffliiiiiliiis";
const char CreatureInfodstfmt[]="iiiiiiiisssiiiiiiiiiiffiffiifiiiiiiiiiiffiiiiiiiiiiiiiiiiiiiiiiiisiiffliiiiiliiii";
-const char CreatureDataAddonInfofmt[]="iiiiiis";
+const char CreatureDataAddonInfofmt[]="iiiiiiis";
const char CreatureModelfmt[]="iffbi";
-const char CreatureInfoAddonInfofmt[]="iiiiiis";
+const char CreatureInfoAddonInfofmt[]="iiiiiiis";
const char EquipmentInfofmt[]="iiii";
const char GameObjectInfosrcfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiis";
const char GameObjectInfodstfmt[]="iiissssiifiiiiiiiiiiiiiiiiiiiiiiiiiiiii";