aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/762_world.sql6
-rw-r--r--sql/updates/764_world_scripts.sql123
-rw-r--r--sql/updates/765_world_scripts.sql19
-rw-r--r--src/bindings/scripts/include/sc_creature.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp3
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp388
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h2
-rw-r--r--src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp2
-rw-r--r--src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp35
-rw-r--r--src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp120
-rw-r--r--src/game/GridNotifiers.h13
-rw-r--r--src/game/ObjectMgr.cpp36
-rw-r--r--src/game/ObjectMgr.h8
-rw-r--r--src/game/Transports.cpp29
-rw-r--r--src/game/Transports.h9
-rw-r--r--src/game/World.cpp96
-rw-r--r--src/game/World.h3
17 files changed, 596 insertions, 298 deletions
diff --git a/sql/updates/762_world.sql b/sql/updates/762_world.sql
new file mode 100644
index 00000000000..4f32617b0ee
--- /dev/null
+++ b/sql/updates/762_world.sql
@@ -0,0 +1,6 @@
+DROP TABLE IF EXISTS `transport_events`;
+CREATE TABLE `transport_events` (
+ `entry` int(11) unsigned NOT NULL default '0',
+ `waypoint_id` int(11) unsigned NOT NULL default '0',
+ `event_id` int(11) unsigned NOT NULL default '0'
+) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file
diff --git a/sql/updates/764_world_scripts.sql b/sql/updates/764_world_scripts.sql
new file mode 100644
index 00000000000..d071d870233
--- /dev/null
+++ b/sql/updates/764_world_scripts.sql
@@ -0,0 +1,123 @@
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533039 AND -1533000;
+INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+(-1533000,'Ahh... welcome to my parlor.',8788,1,0,'anubrekhan SAY_GREET'),
+ (-1533001,'Just a little taste...',8785,1,0,'anubrekhan SAY_AGGRO1'),
+ (-1533002,'There is no way out.',8786,1,0,'anubrekhan SAY_AGGRO2'),
+ (-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,'anubrekhan SAY_AGGRO3'),
+ (-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,'anubrekhan SAY_TAUNT1'),
+ (-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,'anubrekhan SAY_TAUNT2'),
+ (-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,'anubrekhan SAY_TAUNT3'),
+ (-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,'anubrekhan SAY_TAUNT4'),
+ (-1533008,'Shh... it will all be over soon.',8789,1,0,'anubrekhan SAY_SLAY'),
+ (-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,'faerlina SAY_GREET'),
+ (-1533010,'Slay them in the master\'s name!',8794,1,0,'faerlina SAY_AGGRO1'),
+ (-1533011,'You cannot hide from me!',8795,1,0,'faerlina SAY_AGGRO2'),
+ (-1533012,'Kneel before me, worm!',8796,1,0,'faerlina SAY_AGGRO3'),
+ (-1533013,'Run while you still can!',8797,1,0,'faerlina SAY_AGGRO4'),
+ (-1533014,'You have failed!',8800,1,0,'faerlina SAY_SLAY1'),
+ (-1533015,'Pathetic wretch!',8801,1,0,'faerlina SAY_SLAY2'),
+ (-1533016,'The master... will avenge me!',8798,1,0,'faerlina SAY_DEATH'),
+ (-1533017,'Patchwerk want to play!',8909,1,0,'patchwerk SAY_AGGRO1'),
+ (-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,'patchwerk SAY_AGGRO2'),
+ (-1533019,'No more play?',8912,1,0,'patchwerk SAY_SLAY'),
+ (-1533020,'What happened to... Patch...',8911,1,0,'patchwerk SAY_DEATH'),
+ (-1533021,'goes into a berserker rage!',0,2,0,'patchwerk EMOTE_BERSERK'),
+ (-1533022,'becomes enraged!',0,2,0,'patchwerk EMOTE_ENRAGE'),
+ (-1533023,'Stalagg crush you!',8864,1,0,'stalagg SAY_STAL_AGGRO'),
+ (-1533024,'Stalagg kill!',8866,1,0,'stalagg SAY_STAL_SLAY'),
+ (-1533025,'Master save me...',8865,1,0,'stalagg SAY_STAL_DEATH'),
+ (-1533026,'Feed you to master!',8802,1,0,'feugen SAY_FEUG_AGGRO'),
+ (-1533027,'Feugen make master happy!',8804,1,0,'feugen SAY_FEUG_SLAY'),
+ (-1533028,'No... more... Feugen...',8803,1,0,'feugen SAY_FEUG_DEATH'),
+ (-1533029,'You are too late... I... must... OBEY!',8872,1,0,'thaddius SAY_GREET'),
+ (-1533030,'KILL!',8867,1,0,'thaddius SAY_AGGRO1'),
+ (-1533031,'EAT YOUR BONES!',8868,1,0,'thaddius SAY_AGGRO2'),
+ (-1533032,'BREAK YOU!',8869,1,0,'thaddius SAY_AGGRO3'),
+ (-1533033,'You die now!',8877,1,0,'thaddius SAY_SLAY'),
+ (-1533034,'Now YOU feel pain!',8871,1,0,'thaddius SAY_ELECT'),
+ (-1533035,'Thank... you...',8870,1,0,'thaddius SAY_DEATH'),
+ (-1533036,'Pleeease!',8873,1,0,'thaddius SAY_SCREAM1'),
+ (-1533037,'Stop, make it stop!',8874,1,0,'thaddius SAY_SCREAM2'),
+ (-1533038,'Help me! Save me!',8875,1,0,'thaddius SAY_SCREAM3'),
+ (-1533039,'Please, nooo!',8876,1,0,'thaddius SAY_SCREAM4');
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533074 AND -1533040;
+ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+ (-1533040,'Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.',8807,1,0,'gothik SAY_SPEECH'),
+ (-1533041,'Death is the only escape.',8806,1,0,'gothik SAY_KILL'),
+ (-1533042,'I... am... undone!',8805,1,0,'gothik SAY_DEATH'),
+ (-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,'gothik SAY_TELEPORT'),
+ (-1533044,'Defend youself!',8892,1,0,'blaumeux SAY_BLAU_AGGRO'),
+ (-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,'blaumeux SAY_BLAU_TAUNT1'),
+ (-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,'blaumeux SAY_BLAU_TAUNT2'),
+ (-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,'blaumeux SAY_BLAU_TAUNT3'),
+ (-1533048,'Your life is mine!',8895,1,0,'blaumeux SAY_BLAU_SPECIAL'),
+ (-1533049,'Who\'s next?',8894,1,0,'blaumeux SAY_BLAU_SLAY'),
+ (-1533050,'Tou... che!',8893,1,0,'blaumeux SAY_BLAU_DEATH'),
+ (-1533051,'Come out and fight, ye wee ninny!',8899,1,0,'korthazz SAY_KORT_AGGRO'),
+ (-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,'korthazz SAY_KORT_TAUNT1'),
+ (-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,'korthazz SAY_KORT_TAUNT2'),
+ (-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,'korthazz SAY_KORT_TAUNT3'),
+ (-1533055,'I like my meat extra crispy!',8901,1,0,'korthazz SAY_KORT_SPECIAl'),
+ (-1533056,'Next time, bring more friends!',8902,1,0,'korthazz SAY_KORT_SLAY'),
+ (-1533057,'What a bloody waste this is!',8900,1,0,'korthazz SAY_KORT_DEATH'),
+ (-1533058,'Flee, before it\'s too late!',8913,1,0,'zeliek SAY_ZELI_AGGRO'),
+ (-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,'zeliek SAY_ZELI_TAUNT1'),
+ (-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,'zeliek SAY_ZELI_TAUNT2'),
+ (-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,'zeliek SAY_ZELI_TAUNT3'),
+ (-1533062,'I- I have no choice but to obey!',8916,1,0,'zeliek SAY_ZELI_SPECIAL'),
+ (-1533063,'Forgive me!',8915,1,0,'zeliek SAY_ZELI_SLAY'),
+ (-1533064,'It is... as it should be.',8914,1,0,'zeliek SAY_ZELI_DEATH'),
+ (-1533065,'You seek death?',14571,1,0,'rivendare_naxx SAY_RIVE_AGGRO1'),
+ (-1533066,'None shall pass!',14572,1,0,'rivendare_naxx SAY_RIVE_AGGRO2'),
+ (-1533067,'Be still!',14573,1,0,'rivendare_naxx SAY_RIVE_AGGRO3'),
+ (-1533068,'You will find no peace in death.',14574,1,0,'rivendare_naxx SAY_RIVE_SLAY1'),
+ (-1533069,'The master\'s will is done.',14575,1,0,'rivendare_naxx SAY_RIVE_SLAY2'),
+ (-1533070,'Bow to the might of the scourge!',14576,1,0,'rivendare_naxx SAY_RIVE_SPECIAL'),
+ (-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,'rivendare_naxx SAY_RIVE_TAUNT1'),
+ (-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,'rivendare_naxx SAY_RIVE_TAUNT2'),
+ (-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,'rivendare_naxx SAY_RIVE_TAUNT3'),
+ (-1533074,'Death... will not stop me...',14580,1,0,'rivendare_naxx SAY_RIVE_DEATH');
+
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16062;
+UPDATE `creature_template` SET `ScriptName`='boss_rivendare_naxx' WHERE `entry`=30549;
+
+DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533108 AND -1533075;
+ INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
+ (-1533075,'Glory to the master!',8845,1,0,'noth SAY_AGGRO1'),
+ (-1533076,'Your life is forfeit!',8846,1,0,'noth SAY_AGGRO2'),
+ (-1533077,'Die, trespasser!',8847,1,0,'noth SAY_AGGRO3'),
+ (-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,'noth SAY_SUMMON'),
+ (-1533079,'My task is done!',8849,1,0,'noth SAY_SLAY1'),
+ (-1533080,'Breathe no more!',8850,1,0,'noth SAY_SLAY2'),
+ (-1533081,'I will serve the master... in... death!',8848,1,0,'noth SAY_DEATH'),
+ (-1533082,'takes in a deep breath...',0,2,0,'sapphiron EMOTE_BREATH'),
+ (-1533083,'enrages!',0,2,0,'sapphiron EMOTE_ENRAGE'),
+ (-1533084,'Our preparations continue as planned, master.',14467,1,0,'kelthuzad SAY_SAPP_DIALOG1'),
+ (-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'),
+ (-1533086,'I see no complications... Wait... What is this?',14468,1,0,'kelthuzad SAY_SAPP_DIALOG3'),
+ (-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'),
+ (-1533088,'Yes, master!',14469,1,0,'kelthuzad SAY_SAPP_DIALOG5'),
+ (-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,'kelthuzad SAY_CAT_DIED'),
+ (-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,1,0,'kelthuzad SAY_TAUNT1'),
+ (-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,1,0,'kelthuzad SAY_TAUNT2'),
+ (-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,1,0,'kelthuzad SAY_TAUNT3'),
+ (-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,1,0,'kelthuzad SAY_TAUNT4'),
+ (-1533094,'Pray for mercy!',14475,1,0,'kelthuzad SAY_AGGRO1'),
+ (-1533095,'Scream your dying breath!',14476,1,0,'kelthuzad SAY_AGGRO2'),
+ (-1533096,'The end is upon you!',14477,1,0,'kelthuzad SAY_AGGRO3'),
+ (-1533097,'The dark void awaits you!',14478,1,0,'kelthuzad SAY_SLAY1'),
+ (-1533098,'<Kel\'Thuzad cackles maniacally!>',14479,1,0,'kelthuzad SAY_SLAY2'),
+ (-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,'kelthuzad SAY_DEATH'),
+ (-1533100,'Your soul, is bound to me now!',14472,1,0,'kelthuzad SAY_CHAIN1'),
+ (-1533101,'There will be no escape!',14473,1,0,'kelthuzad SAY_CHAIN2'),
+ (-1533102,'I will freeze the blood in your veins!',14474,1,0,'kelthuzad SAY_FROST_BLAST'),
+ (-1533103,'Master! I require aid! ',14470,1,0,'kelthuzad SAY_REQUEST_AID'),
+ (-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,'kelthuzad SAY_ANSWER_REQUEST'),
+ (-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,'kelthuzad SAY_SUMMON_MINIONS'),
+ (-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,'kelthuzad SAY_SPECIAL1_MANA_DET'),
+ (-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,'kelthuzad SAY_SPECIAL3_MANA_DET'),
+ (-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,'kelthuzad SAY_SPECIAL2_DISPELL');
+
+ UPDATE `script_texts` SET `sound`=8902 WHERE `entry`=-1533055;
+ UPDATE `script_texts` SET `sound`=8901 WHERE `entry`=-1533056; \ No newline at end of file
diff --git a/sql/updates/765_world_scripts.sql b/sql/updates/765_world_scripts.sql
new file mode 100644
index 00000000000..908a31d404f
--- /dev/null
+++ b/sql/updates/765_world_scripts.sql
@@ -0,0 +1,19 @@
+UPDATE `creature_template` SET `flags_extra` = 0 WHERE `entry` = 20129;
+
+-- Insert English and French dialogs in database
+DELETE FROM `script_texts` WHERE entry BETWEEN -1000150 and -1000163;
+INSERT INTO `script_texts` (`entry`, `content_default`, `content_loc2`, `type`, `language`, `comment`) VALUES
+(-1000150, 'Greetings, $N. I will guide you through the cavern. Please try and keep up.', 'Salutations, $N. Je vais vous guider à travers cette grotte. Veuillez me suivre.', 4, 0, 'WHISPER_CUSTODIAN_1'),
+(-1000151, 'We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place.', 'Nous ne savons pas si les Grottes du Temps ont toujours été accessibles aux mortels. Vraiment, c\'est impossible à dire étant donné que l\'Intemporel est en mouvement perpétuel, changeant nos spirales temporelles comme bon lui semble. Ce que vous voyez aujourd\'hui peut très bien ne plus exister demain. Vous pourriez vous réveiller sans aucun souvenir de cet endroit.', 4, 0, 'WHISPER_CUSTODIAN_2'),
+(-1000152, 'It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality.', 'C\'est étrange, je sais... La plupart des mortels ne peuvent pas réellement comprendre ce qu\ils voient ici, comme souvent, ce qu\'ils voient n\'est pas ancré dans leur propre perception de la réalité.', 4, 0, 'WHISPER_CUSTODIAN_3'),
+(-1000153, 'Follow me, please.', 'Veuillez me suivre.', 4, 0, 'WHISPER_CUSTODIAN_4'),
+(-1000154, 'There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality.', 'Il n\'y a que deux vérités qui peuvent être trouvées ici : premièrement, ce temps est chaotique, toujours en mouvement, et complètement malléable, et ensuite, la perception ne détermine pas la réalité.', 4, 0, 'WHISPER_CUSTODIAN_5'),
+(-1000155, 'As custodians of time, we watch over and care for Nozdormu\'s realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard.', 'En tant que protecteurs du temps, nous observons et veillons sur le royaume de Nozdormu. Le maître est absent en ce moment, ce qui signifie que des tentatives sont faites pour altérer fortement le temps. Le maître ne se mêle jamais des affaires des mortels mais il corrige les altérations faites au temps par d\'autres. Il est réactionnaire à cet égard.', 4, 0, 'WHISPER_CUSTODIAN_6'),
+(-1000156, 'For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present.', 'Pour le maintien normal du temps, les Gardiens du temps suffisent à la tâche. Nous sommes capables de gérer les perturbations les plus ordinaires. Je parle de petites choses, comme des mages voleurs qui changent quelque chose dans le passé pour élever leur statut ou leur richesse dans le présent.', 4, 0, 'WHISPER_CUSTODIAN_7'),
+(-1000157, 'These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as \'trouble spots.\' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one...', 'Ces tunnels que vous voyez sont appelés Voies Temporelles. Leur nombre est infini. Ceux qui existent actuellement dans votre réalité sont ceux que le maître a considérés comme \'points sensibles\'. Ces points sensibles peuvent différer complètement de part leur thème, mais partagent toujours une cause. C\'est-à-dire, leur existence est le résultat des mêmes perturbations temporelles. Rappelez-vous en si vous osez vous aventurer dans l\'un d\'eux...', 4, 0, 'WHISPER_CUSTODIAN_8'),
+(-1000158, 'This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall\'s freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost.', 'Cette voie temporelle est en grand désarroi ! Nous avons actuellement des agents à l\intérieur qui tentent de restaurer l\'ordre. Les informations que j\'ai indiquent que la liberté de Thrall est en péril. Une organisation malveillante connue sous le nom de Vol du Dragon Infini essaye d\'empêcher son évasion. J\'ai peur que sans assistance extérieure, tout soit perdu.', 4, 0, 'WHISPER_CUSTODIAN_9'),
+(-1000159, 'We have very little information on this timeway. Sa\'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not...', 'Nous avons très peu d\'informations sur cette voie. Sa\'at a été envoyé et est actuellement sur place. Les données que nous avons recueillies de sa correspondance est que le Vol du Dragon Infini tente une fois de plus d\'altérer le temps. Se pourrait-il que l\'ouverture de la Porte des Ténèbres soit la cible d\'un sabotage. Espérons que non...', 4, 0, 'WHISPER_CUSTODIAN_10'),
+(-1000160, 'This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown...', 'Cette voie est en train de s\'effondrer. Ce qu\'elle peut avoir contenu dans le passé, le présent et le futur nous est actuellement inconnu...', 4, 0, 'WHISPER_CUSTODIAN_11'),
+(-1000161, 'The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities.', 'Les voies sont pour le moment classées de la moins catastrophique à la plus catastrophique, ce qui veut dire que la moindre de celles-ci qui s\'effondre signifierait la fin de votre monde. Nous les classons seulement de cette façon pour que les héros et aventuriers qui y sont envoyés sachent quelle voie est la plus adaptée à leurs compétences.', 4, 0, 'WHISPER_CUSTODIAN_12'),
+(-1000162, 'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway\'s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.', 'Tout ce que nous savons sur cette voie temporelle est qu\'elle mène au Mont Hyjal. Le Vol du Dragon Infini s\'est donné beaucoup de peine pour empêcher notre participation. Soridormi est actuellement en train de tenter de briser les défenses de cette voie, mais ses efforts ont été vain jusqu\'ici. Vous pourriez être notre seul espoir de les briser et de résoudre le conflit.', 4, 0, 'WHISPER_CUSTODIAN_13'),
+(-1000163, 'Our time is at an end $N. I would wish you luck, if such a thing existed.', 'Notre entretien touche à sa fin, $N. Je vous souhaite bonne chance, si tant est qu\'une telle chose a jamais existé.', 4, 0, 'WHISPER_CUSTODIAN_14'); \ No newline at end of file
diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp
index d46d5b68716..b54f91a113d 100644
--- a/src/bindings/scripts/include/sc_creature.cpp
+++ b/src/bindings/scripts/include/sc_creature.cpp
@@ -736,7 +736,7 @@ void ScriptedAI::DoTeleportAll(float x, float y, float z, float o)
Map::PlayerList const &PlayerList = map->GetPlayers();
for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
if (Player* i_pl = i->getSource())
- if (!i_pl->isAlive())
+ if (i_pl->isAlive())
i_pl->TeleportTo(m_creature->GetMapId(), x, y, z, o, TELE_TO_NOT_LEAVE_COMBAT);
}
diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
index a797be68b06..06947376619 100644
--- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
+++ b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp
@@ -183,9 +183,6 @@ struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI
float attackRadius = m_creature->GetAttackDistance(who);
if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who))
{
- //if(who->HasStealthAura())
- // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH);
-
AttackStart(who);
}
}
diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
index 17fec0d2e75..ab2f4807551 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp
@@ -16,8 +16,8 @@
/* ScriptData
SDName: Boss_Nightbane
-SD%Complete: 50
-SDComment: skelleton adds, optimice some "if"s, timers, rain of bones applied self(!?)
+SD%Complete: 80
+SDComment: SDComment: skelleton adds need 2 more, timers,
SDCategory: Karazhan
EndScriptData */
@@ -26,7 +26,7 @@ EndScriptData */
//phase 1
#define SPELL_BELLOWING_ROAR 39427
-#define SPELL_CHARRED_EARTH 30129 //Also 30209 (Target Charred Earth) triggers this
+#define SPELL_CHARRED_EARTH 30129
#define SPELL_DISTRACTING_ASH 30130
#define SPELL_SMOLDERING_BREATH 30210
#define SPELL_TAIL_SWEEP 25653
@@ -35,6 +35,14 @@ EndScriptData */
#define SPELL_SMOKING_BLAST 37057
#define SPELL_FIREBALL_BARRAGE 30282
#define SPELL_SEARING_CINDERS 30127
+#define SPELL_SUMMON_SKELETON 30170
+
+#define EMOTE_SUMMON "An ancient being awakens in the distance..."
+#define YELL_AGGRO "What fools! I shall bring a quick end to your suffering!"
+#define YELL_FLY_PHASE "Miserable vermin. I shall exterminate you from the air!"
+#define YELL_LAND_PHASE_1 "Enough! I shall land and crush you myself!"
+#define YELL_LAND_PHASE_2 "Insects! Let me show you my strength up close!"
+#define EMOTE_BREATH "takes a deep breath."
float IntroWay[8][3] =
{
@@ -62,76 +70,96 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
boss_nightbaneAI(Creature* c) : ScriptedAI(c)
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
- intro = true;
+ Intro = true;
Reset();
}
ScriptedInstance* pInstance;
- uint32 phase;
+ uint32 Phase;
+
+ bool RainBones;
+ bool Skeletons;
- bool rainbones;
+ uint32 BellowingRoarTimer;
+ uint32 CharredEarthTimer;
+ uint32 DistractingAshTimer;
+ uint32 SmolderingBreathTimer;
+ uint32 TailSweepTimer;
+ uint32 RainofBonesTimer;
+ uint32 SmokingBlastTimer;
+ uint32 FireballBarrageTimer;
+ uint32 SearingCindersTimer;
- uint32 bellowingroar_timer;
- uint32 charredearth_timer;
- uint32 distractingash_timer;
- uint32 smolderingbreath_timer;
- uint32 tailsweep_timer;
- uint32 rainofbones_timer;
- uint32 smokingblast_timer;
- uint32 fireballbarrage_timer;
- uint32 searingcinders_timer;
+ uint32 FlyCount;
+ uint32 FlyTimer;
- uint32 fly_count;
- uint32 fly_timer;
+ bool Intro;
+ bool Flying;
+ bool Movement;
- bool intro;
- bool flying;
- uint32 wait_timer;
+ uint32 WaitTimer;
uint32 MovePhase;
void Reset()
{
- phase =1;
- bellowingroar_timer = 30000;
- charredearth_timer = 15000;
- distractingash_timer = 20000;
- smolderingbreath_timer = 10000;
- tailsweep_timer = 12000;
- rainofbones_timer = 10000;
- smokingblast_timer = 20000;
- fireballbarrage_timer = 13000;
- searingcinders_timer = 14000;
-
- fly_count = 0;
+ BellowingRoarTimer = 30000;
+ CharredEarthTimer = 15000;
+ DistractingAshTimer = 20000;
+ SmolderingBreathTimer = 10000;
+ TailSweepTimer = 12000;
+ RainofBonesTimer = 10000;
+ SmokingBlastTimer = 20000;
+ FireballBarrageTimer = 13000;
+ SearingCindersTimer = 14000;
+ WaitTimer = 1000;
+
+ Phase =1;
+ FlyCount = 0;
+ MovePhase = 0;
- m_creature->SetSpeed(MOVE_RUN,2);
+ m_creature->SetSpeed(MOVE_RUN, 2.0f);
m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
m_creature->setActive(true);
- wait_timer = 1000;
- MovePhase = 0;
- if(pInstance)
+ if(pInstance->GetData(DATA_NIGHTBANE_EVENT) == DONE)
+ m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
+ else
pInstance->SetData(DATA_NIGHTBANE_EVENT, NOT_STARTED);
- flying = false;
+ HandleTerraceDoors(true);
+
+ Flying = false;
+ Movement = false;
- if(!intro)
+ if(!Intro)
{
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
m_creature->GetMotionMaster()->MoveTargetedHome();
}
}
+ void HandleTerraceDoors(bool open)
+ {
+ if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_1)))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_MASTERS_TERRACE_DOOR_2)))
+ Door->SetUInt32Value(GAMEOBJECT_STATE, open ? 0 : 1);
+ }
+
void Aggro(Unit *who)
{
if(pInstance)
pInstance->SetData(DATA_NIGHTBANE_EVENT, IN_PROGRESS);
+
+ HandleTerraceDoors(false);
+ DoYell(YELL_AGGRO, LANG_UNIVERSAL, NULL);
}
+
void AttackStart(Unit* who)
{
- if(!intro && !flying)
+ if(!Intro && !Flying)
ScriptedAI::AttackStart(who);
}
@@ -139,10 +167,13 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
{
if(pInstance)
pInstance->SetData(DATA_NIGHTBANE_EVENT, DONE);
+
+ HandleTerraceDoors(true);
}
+
void MoveInLineOfSight(Unit *who)
{
- if(!intro && !flying)
+ if(!Intro && !Flying)
{
if(!m_creature->getVictim() && m_creature->canStartAttack(who))
ScriptedAI::AttackStart(who);
@@ -154,49 +185,78 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
if(type != POINT_MOTION_TYPE)
return;
- if(intro)
+ if(Intro)
{
if(id >= 8)
{
- intro = false;
+ Intro = false;
m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0);
return;
}
- wait_timer = 1;
+ WaitTimer = 1;
}
- if(flying)
+ if(Flying)
{
if(id == 0)
{
- flying = false;
- phase = 2;
+ DoTextEmote(EMOTE_BREATH, NULL, true);
+ Flying = false;
+ Phase = 2;
return;
}
+
if(id == 3)
{
MovePhase = 4;
- wait_timer = 1;
+ WaitTimer = 1;
return;
}
+
if(id == 8)
{
- flying = false;
- phase = 1;
+ Flying = false;
+ Phase = 1;
+ Movement = true;
return;
}
- wait_timer = 1;
+ WaitTimer = 1;
}
}
+ void JustSummoned(Creature *summoned)
+ {
+ summoned->AI()->AttackStart(m_creature->getVictim());
+ }
+
+ void TakeOff()
+ {
+ DoYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL);
+
+ m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
+ m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
+ m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
+ (*m_creature).GetMotionMaster()->Clear(false);
+ (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
+
+ Flying = true;
+
+ FlyTimer = 45000+rand()%15000; //timer wrong between 45 and 60 seconds
+ ++FlyCount;
+
+ RainofBonesTimer = 5000; //timer wrong (maybe)
+ RainBones = false;
+ Skeletons = false;
+ }
+
void UpdateAI(const uint32 diff)
{
- if(wait_timer)
- if(wait_timer < diff)
+ if(WaitTimer)
+ if(WaitTimer < diff)
{
- if(intro)
+ if(Intro)
{
if(MovePhase >= 7)
{
@@ -207,12 +267,11 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
else
{
m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
- MovePhase++;
+ ++MovePhase;
}
}
-
- if(flying)
+ if(Flying)
{
if(MovePhase >= 7)
{
@@ -223,168 +282,133 @@ struct TRINITY_DLL_DECL boss_nightbaneAI : public ScriptedAI
else
{
m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]);
- MovePhase++;
+ ++MovePhase;
}
}
- wait_timer = 0;
- }else wait_timer -= diff;
+ WaitTimer = 0;
+ }else WaitTimer -= diff;
if(!m_creature->SelectHostilTarget())
return;
- if(flying)
+ if(Flying)
return;
// Phase 1 "GROUND FIGHT"
- if(phase == 1)
+ if(Phase == 1)
{
- m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim());
- if (bellowingroar_timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR);
- bellowingroar_timer = 30000+rand()%10000 ; //Timer
- }else bellowingroar_timer -= diff;
-
- if (smolderingbreath_timer < diff)
- {
- DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH);
- smolderingbreath_timer = 20000;//timer
-
- }else smolderingbreath_timer -= diff;
-
- if (charredearth_timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
- DoCast(target,SPELL_CHARRED_EARTH);
- charredearth_timer = 20000; //timer
- }else charredearth_timer -= diff;
-
- if (tailsweep_timer < diff)
- {
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- if (!m_creature->HasInArc( M_PI, target))
- DoCast(target,SPELL_TAIL_SWEEP);
- tailsweep_timer = 15000;//timer
- }else tailsweep_timer -= diff;
-
- if (searingcinders_timer < diff)
+ if(Movement)
+ {
+ DoStartMovement(m_creature->getVictim());
+ Movement = false;
+ }
+
+ if (BellowingRoarTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR);
+ BellowingRoarTimer = 30000+rand()%10000 ; //Timer
+ }else BellowingRoarTimer -= diff;
+
+ if (SmolderingBreathTimer < diff)
+ {
+ DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH);
+ SmolderingBreathTimer = 20000;//timer
+ }else SmolderingBreathTimer -= diff;
+
+ if (CharredEarthTimer < diff)
+ {
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ DoCast(target,SPELL_CHARRED_EARTH);
+ CharredEarthTimer = 20000; //timer
+ }else CharredEarthTimer -= diff;
+
+ if (TailSweepTimer < diff)
+ {
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ if (!m_creature->HasInArc( M_PI, target))
+ DoCast(target,SPELL_TAIL_SWEEP);
+ TailSweepTimer = 15000;//timer
+ }else TailSweepTimer -= diff;
+
+ if (SearingCindersTimer < diff)
{
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_SEARING_CINDERS);
- searingcinders_timer = 10000; //timer
- }else searingcinders_timer -= diff;
-
- uint32 prozent;
- prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
-
- if (prozent < 75 && fly_count == 0) // first take off 75%
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
- flying = true;
-
- fly_timer = 45000+rand()%15000;
- fly_count++;
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ DoCast(target,SPELL_SEARING_CINDERS);
+ SearingCindersTimer = 10000; //timer
+ }else SearingCindersTimer -= diff;
- rainofbones_timer = 5000;
- rainbones = false;
- }
+ uint32 Prozent;
+ Prozent = (m_creature->GetHealth()*100) / m_creature->GetMaxHealth();
- if (prozent < 50 && fly_count == 1) // secound take off 50%
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
-
- flying = true;
- fly_timer = 45000+rand()%15000;
- fly_count++;
-
- rainofbones_timer = 5000;
- rainbones = false;
- }
+ if (Prozent < 75 && FlyCount == 0) // first take off 75%
+ TakeOff();
- if (prozent < 25 && fly_count == 2) // third take off 25%
- {
- m_creature->InterruptSpell(CURRENT_GENERIC_SPELL);
- m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF);
- m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING);
- (*m_creature).GetMotionMaster()->Clear(false);
- (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]);
-
- flying = true;
- //phase = 2;
- fly_timer = 45000+rand()%15000;
- fly_count++;
-
- rainofbones_timer = 5000;
- rainbones = false;
- }
+ if (Prozent < 50 && FlyCount == 1) // secound take off 50%
+ TakeOff();
+ if (Prozent < 25 && FlyCount == 2) // third take off 25%
+ TakeOff();
+
DoMeleeAttackIfReady();
}
//Phase 2 "FLYING FIGHT"
- if (phase == 2)
+ if (Phase == 2)
{
- if (!rainbones)
+ if (!RainBones)
{
- if (rainofbones_timer < diff && !rainbones) // only once at the beginning of phase 2
+ if (!Skeletons)
+ {
+ DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON);
+ DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON);
+ DoCast(m_creature->getVictim(), SPELL_SUMMON_SKELETON);
+ Skeletons = true;
+ }
+
+ if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2
{
- DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES);
- rainbones = true;
- smokingblast_timer = 20000;
- }else rainofbones_timer -= diff;
+ DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES);
+ RainBones = true;
+ SmokingBlastTimer = 20000;
+ }else RainofBonesTimer -= diff;
- if (distractingash_timer < diff)
+ if (DistractingAshTimer < diff)
{
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_RANDOM,0);
-
- DoCast(target,SPELL_DISTRACTING_ASH);
- distractingash_timer = 2000;//timer wrong
- }else distractingash_timer -= diff;
+ if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0))
+ DoCast(target,SPELL_DISTRACTING_ASH);
+ DistractingAshTimer = 2000;//timer wrong
+ }else DistractingAshTimer -= diff;
}
- if (rainbones)
+ if (RainBones)
{
- if (smokingblast_timer < diff)
+ if (SmokingBlastTimer < diff)
{
DoCast(m_creature->getVictim(),SPELL_SMOKING_BLAST);
- smokingblast_timer = 1500 ; //timer wrong
- }else smokingblast_timer -= diff;
+ SmokingBlastTimer = 1500 ; //timer wrong
+ }else SmokingBlastTimer -= diff;
}
- if (fireballbarrage_timer < diff)
+ if (FireballBarrageTimer < diff)
{
- Unit* target = NULL;
- target = SelectUnit(SELECT_TARGET_FARTHEST,0);
+ if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0))
+ DoCast(target,SPELL_FIREBALL_BARRAGE);
+ FireballBarrageTimer = 20000; //Timer
+ }else FireballBarrageTimer -= diff;
- DoCast(target,SPELL_FIREBALL_BARRAGE);
- fireballbarrage_timer = 20000; //Timer
- }else fireballbarrage_timer -= diff;
-
- if (fly_timer < diff) //landing
+ if (FlyTimer < diff) //landing
{
- //m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND);
- //m_creature->SetHover(false);
+ if(rand()%2 == 0)
+ DoYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL);
+ else
+ DoYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL);
+
(*m_creature).GetMotionMaster()->Clear(false);
m_creature->GetMotionMaster()->MovePoint(3,IntroWay[3][0],IntroWay[3][1],IntroWay[3][2]);
- flying = true;
- //wait_timer = 1;
- //phase = 1;
- }else fly_timer -= diff;
+
+ Flying = true;
+ }else FlyTimer -= diff;
}
}
};
@@ -399,6 +423,6 @@ void AddSC_boss_nightbane()
Script *newscript;
newscript = new Script;
newscript->Name="boss_nightbane";
- newscript->GetAI = GetAI_boss_nightbane;
+ newscript->GetAI = &GetAI_boss_nightbane;
newscript->RegisterSelf();
} \ No newline at end of file
diff --git a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
index 78c1c488637..29660dd6426 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
+++ b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h
@@ -31,6 +31,8 @@
#define DATA_GAMEOBJECT_GAME_DOOR 24
#define DATA_GAMEOBJECT_GAME_EXIT_DOOR 25
#define DATA_IMAGE_OF_MEDIVH 26
+#define DATA_MASTERS_TERRACE_DOOR_1 27
+#define DATA_MASTERS_TERRACE_DOOR_2 28
// Opera Performances
#define EVENT_OZ 1
diff --git a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
index 9fea30e1c93..1d2760be73c 100644
--- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
+++ b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp
@@ -149,6 +149,8 @@ struct TRINITY_DLL_DECL instance_karazhan : public ScriptedInstance
case DATA_GAMEOBJECT_GAME_DOOR: return GamesmansDoor;
case DATA_GAMEOBJECT_GAME_EXIT_DOOR: return GamesmansExitDoor;
case DATA_GAMEOBJECT_NETHER_DOOR: return NetherspaceDoor;
+ case DATA_MASTERS_TERRACE_DOOR_1: return MastersTerraceDoor[0];
+ case DATA_MASTERS_TERRACE_DOOR_2: return MastersTerraceDoor[1];
}
return 0;
diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp
deleted file mode 100644
index b5b2c357597..00000000000
--- a/src/bindings/scripts/scripts/zone/naxxramas/boss_stalagg.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2006 - 2008 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-/* ScriptData
-SDName: Boss_Stalagg
-SD%Complete: 0
-SDComment: Merge with Thaddius
-SDCategory: Naxxramas
-EndScriptData */
-
-#include "precompiled.h"
-
-//Stalagg
-//8864 aggro - Stalagg crush you!
-//8866 slay - Stalagg Kill!
-//8865 death - Master save me...
-
-#define SPELL_WARSTOMP 28125
-#define SPELL_POWERSURGE 28134
-#define SPELL_CHAIN_LIGHTNING 28900
-
-//Not sure how to "force" crushing blows or to knock tank to the opposite platform
diff --git a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
index c5297963c71..90f680cf82a 100644
--- a/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
+++ b/src/bindings/scripts/scripts/zone/tanaris/tanaris.cpp
@@ -130,20 +130,20 @@ CreatureAI* GetAI_mob_aquementas(Creature *_Creature)
## npc_custodian_of_time
######*/
-#define WHISPER_CUSTODIAN_1 "Greetings, $N. I will guide you through the cavern. Please try and keep up."
-#define WHISPER_CUSTODIAN_2 "We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place."
-#define WHISPER_CUSTODIAN_3 "It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality."
-#define WHISPER_CUSTODIAN_4 "Follow me, please."
-#define WHISPER_CUSTODIAN_5 "There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality."
-#define WHISPER_CUSTODIAN_6 "As custodians of time, we watch over and care for Nozdormu's realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard."
-#define WHISPER_CUSTODIAN_7 "For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present."
-#define WHISPER_CUSTODIAN_8 "These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as 'trouble spots.' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one..."
-#define WHISPER_CUSTODIAN_9 "This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall's freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost."
-#define WHISPER_CUSTODIAN_10 "We have very little information on this timeway. Sa'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not..."
-#define WHISPER_CUSTODIAN_11 "This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown..."
-#define WHISPER_CUSTODIAN_12 "The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities."
-#define WHISPER_CUSTODIAN_13 "All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway's defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict."
-#define WHISPER_CUSTODIAN_14 "Our time is at an end $N. I would wish you luck, if such a thing existed."
+#define WHISPER_CUSTODIAN_1 -1000150
+#define WHISPER_CUSTODIAN_2 -1000151
+#define WHISPER_CUSTODIAN_3 -1000152
+#define WHISPER_CUSTODIAN_4 -1000153
+#define WHISPER_CUSTODIAN_5 -1000154
+#define WHISPER_CUSTODIAN_6 -1000155
+#define WHISPER_CUSTODIAN_7 -1000156
+#define WHISPER_CUSTODIAN_8 -1000157
+#define WHISPER_CUSTODIAN_9 -1000158
+#define WHISPER_CUSTODIAN_10 -1000159
+#define WHISPER_CUSTODIAN_11 -1000160
+#define WHISPER_CUSTODIAN_12 -1000161
+#define WHISPER_CUSTODIAN_13 -1000162
+#define WHISPER_CUSTODIAN_14 -1000163
struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
{
@@ -157,25 +157,25 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI
switch( i )
{
- case 0: DoWhisper(WHISPER_CUSTODIAN_1, pTemp); break;
- case 1: DoWhisper(WHISPER_CUSTODIAN_2, pTemp); break;
- case 2: DoWhisper(WHISPER_CUSTODIAN_3, pTemp); break;
- case 3: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 5: DoWhisper(WHISPER_CUSTODIAN_5, pTemp); break;
- case 6: DoWhisper(WHISPER_CUSTODIAN_6, pTemp); break;
- case 7: DoWhisper(WHISPER_CUSTODIAN_7, pTemp); break;
- case 8: DoWhisper(WHISPER_CUSTODIAN_8, pTemp); break;
- case 9: DoWhisper(WHISPER_CUSTODIAN_9, pTemp); break;
- case 10: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 13: DoWhisper(WHISPER_CUSTODIAN_10, pTemp); break;
- case 14: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 16: DoWhisper(WHISPER_CUSTODIAN_11, pTemp); break;
- case 17: DoWhisper(WHISPER_CUSTODIAN_12, pTemp); break;
- case 18: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 22: DoWhisper(WHISPER_CUSTODIAN_13, pTemp); break;
- case 23: DoWhisper(WHISPER_CUSTODIAN_4, pTemp); break;
- case 24:
- DoWhisper(WHISPER_CUSTODIAN_14, pTemp);
+ case 2: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pTemp); break;
+ case 3: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pTemp); break;
+ case 4: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pTemp); break;
+ case 5: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pTemp); break;
+ case 7: DoScriptText(WHISPER_CUSTODIAN_5, m_creature, pTemp); break;
+ case 8: DoScriptText(WHISPER_CUSTODIAN_6, m_creature, pTemp); break;
+ case 9: DoScriptText(WHISPER_CUSTODIAN_7, m_creature, pTemp); break;
+ case 10: DoScriptText(WHISPER_CUSTODIAN_8, m_creature, pTemp); break;
+ case 11: DoScriptText(WHISPER_CUSTODIAN_9, m_creature, pTemp); break;
+ case 12: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pTemp); break;
+ case 15: DoScriptText(WHISPER_CUSTODIAN_10, m_creature, pTemp); break;
+ case 16: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pTemp); break;
+ case 18: DoScriptText(WHISPER_CUSTODIAN_11, m_creature, pTemp); break;
+ case 19: DoScriptText(WHISPER_CUSTODIAN_12, m_creature, pTemp); break;
+ case 20: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pTemp); break;
+ case 24: DoScriptText(WHISPER_CUSTODIAN_13, m_creature, pTemp); break;
+ case 25: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pTemp); break;
+ case 26:
+ DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pTemp);
DoCast(pTemp,34883);
//below here is temporary workaround, to be removed when spell works properly
((Player*)pTemp)->AreaExploredOrEventHappens(10277);
@@ -214,32 +214,34 @@ CreatureAI* GetAI_npc_custodian_of_time(Creature *_Creature)
{
npc_custodian_of_timeAI* custodian_of_timeAI = new npc_custodian_of_timeAI(_Creature);
- custodian_of_timeAI->AddWaypoint(0, -8374.93,-4250.21, -204.38,5000);
- custodian_of_timeAI->AddWaypoint(1, -8374.93,-4250.21, -204.38,16000);
- custodian_of_timeAI->AddWaypoint(2, -8374.93,-4250.21, -204.38,10000);
- custodian_of_timeAI->AddWaypoint(3, -8374.93,-4250.21, -204.38,2000);
- custodian_of_timeAI->AddWaypoint(4, -8439.40,-4180.05, -209.25);
- custodian_of_timeAI->AddWaypoint(5, -8437.82,-4120.84, -208.59,10000);
- custodian_of_timeAI->AddWaypoint(6, -8437.82,-4120.84, -208.59,16000);
- custodian_of_timeAI->AddWaypoint(7, -8437.82,-4120.84, -208.59,13000);
- custodian_of_timeAI->AddWaypoint(8, -8437.82,-4120.84, -208.59,18000);
- custodian_of_timeAI->AddWaypoint(9, -8437.82,-4120.84, -208.59,15000);
- custodian_of_timeAI->AddWaypoint(10, -8437.82,-4120.84, -208.59,2000);
- custodian_of_timeAI->AddWaypoint(11, -8467.26,-4198.63, -214.21);
- custodian_of_timeAI->AddWaypoint(12, -8667.76,-4252.13, -209.56);
- custodian_of_timeAI->AddWaypoint(13, -8703.71,-4234.58, -209.5,14000);
- custodian_of_timeAI->AddWaypoint(14, -8703.71,-4234.58, -209.5,2000);
- custodian_of_timeAI->AddWaypoint(15, -8642.81,-4304.37, -209.57);
- custodian_of_timeAI->AddWaypoint(16, -8649.06,-4394.36, -208.46,6000);
- custodian_of_timeAI->AddWaypoint(17, -8649.06,-4394.36, -208.46,18000);
- custodian_of_timeAI->AddWaypoint(18, -8649.06,-4394.36, -208.46,2000);
- custodian_of_timeAI->AddWaypoint(19, -8468.72,-4437.67, -215.45);
- custodian_of_timeAI->AddWaypoint(20, -8427.54,-4426, -211.13);
- custodian_of_timeAI->AddWaypoint(21, -8364.83,-4393.32, -205.91);
- custodian_of_timeAI->AddWaypoint(22, -8304.54,-4357.2, -208.2,18000);
- custodian_of_timeAI->AddWaypoint(23, -8304.54,-4357.2, -208.2,2000);
- custodian_of_timeAI->AddWaypoint(24, -8375.42,-4250.41, -205.14,5000);
- custodian_of_timeAI->AddWaypoint(25, -8375.42,-4250.41, -205.14,5000);
+ custodian_of_timeAI->AddWaypoint(0, -8535.57,-4212.61, -212.04);
+ custodian_of_timeAI->AddWaypoint(1, -8456.48,-4211.77, -213.30);
+ custodian_of_timeAI->AddWaypoint(2, -8374.93,-4250.21, -205.05,5000);
+ custodian_of_timeAI->AddWaypoint(3, -8374.93,-4250.21, -204.38,16000);
+ custodian_of_timeAI->AddWaypoint(4, -8374.93,-4250.21, -204.38,10000);
+ custodian_of_timeAI->AddWaypoint(5, -8374.93,-4250.21, -204.38,2000);
+ custodian_of_timeAI->AddWaypoint(6, -8439.40,-4180.05, -209.25);
+ custodian_of_timeAI->AddWaypoint(7, -8437.82,-4120.84, -208.59,10000);
+ custodian_of_timeAI->AddWaypoint(8, -8437.82,-4120.84, -208.59,16000);
+ custodian_of_timeAI->AddWaypoint(9, -8437.82,-4120.84, -208.59,13000);
+ custodian_of_timeAI->AddWaypoint(10, -8437.82,-4120.84, -208.59,18000);
+ custodian_of_timeAI->AddWaypoint(11, -8437.82,-4120.84, -208.59,15000);
+ custodian_of_timeAI->AddWaypoint(12, -8437.82,-4120.84, -208.59,2000);
+ custodian_of_timeAI->AddWaypoint(13, -8467.26,-4198.63, -214.21);
+ custodian_of_timeAI->AddWaypoint(14, -8667.76,-4252.13, -209.56);
+ custodian_of_timeAI->AddWaypoint(15, -8703.71,-4234.58, -209.5,14000);
+ custodian_of_timeAI->AddWaypoint(16, -8703.71,-4234.58, -209.5,2000);
+ custodian_of_timeAI->AddWaypoint(17, -8642.81,-4304.37, -209.57);
+ custodian_of_timeAI->AddWaypoint(18, -8649.06,-4394.36, -208.46,6000);
+ custodian_of_timeAI->AddWaypoint(19, -8649.06,-4394.36, -208.46,18000);
+ custodian_of_timeAI->AddWaypoint(20, -8649.06,-4394.36, -208.46,2000);
+ custodian_of_timeAI->AddWaypoint(21, -8468.72,-4437.67, -215.45);
+ custodian_of_timeAI->AddWaypoint(22, -8427.54,-4426, -211.13);
+ custodian_of_timeAI->AddWaypoint(23, -8364.83,-4393.32, -205.91);
+ custodian_of_timeAI->AddWaypoint(24, -8304.54,-4357.2, -208.2,18000);
+ custodian_of_timeAI->AddWaypoint(25, -8304.54,-4357.2, -208.2,2000);
+ custodian_of_timeAI->AddWaypoint(26, -8375.42,-4250.41, -205.14,5000);
+ custodian_of_timeAI->AddWaypoint(27, -8375.42,-4250.41, -205.14,5000);
return (CreatureAI*)custodian_of_timeAI;
}
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index 5dd863493a8..b00bd33bd24 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -595,6 +595,19 @@ namespace Trinity
Unit const* i_funit;
float i_range;
};
+
+ class CreatureWithDbGUIDCheck
+ {
+ public:
+ CreatureWithDbGUIDCheck(WorldObject const* obj, uint32 lowguid) : i_obj(obj), i_lowguid(lowguid) {}
+ bool operator()(Creature* u)
+ {
+ return u->GetDBTableGUIDLow() == i_lowguid;
+ }
+ private:
+ WorldObject const* i_obj;
+ uint32 i_lowguid;
+ };
class AnyFriendlyUnitInObjectRangeCheck
{
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 3ec944f7f22..a2445a3e1cb 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -7655,3 +7655,39 @@ ObjectMgr::ScriptNameMap & GetScriptNames()
{
return objmgr.GetScriptNames();
}
+
+void ObjectMgr::LoadTransportEvents()
+{
+
+ QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events");
+
+ if( !result )
+ {
+ barGoLink bar1( 1 );
+ bar1.step();
+ sLog.outString( "\n>> Transport events table is empty \n" );
+ return;
+ }
+
+ barGoLink bar1( result->GetRowCount() );
+
+ do
+ {
+ bar1.step();
+
+ Field *fields = result->Fetch();
+
+ //Load event values
+ uint32 entry = fields[0].GetUInt32();
+ uint32 waypoint_id = fields[1].GetUInt32();
+ uint32 event_id = fields[2].GetUInt32();
+
+ uint32 event_count = (entry*100)+waypoint_id;
+ TransportEventMap[event_count] = event_id;
+ }
+ while(result->NextRow());
+
+ sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() );
+
+ delete result;
+} \ No newline at end of file
diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h
index d7851275b84..4216792743c 100644
--- a/src/game/ObjectMgr.h
+++ b/src/game/ObjectMgr.h
@@ -323,7 +323,9 @@ class ObjectMgr
typedef std::vector<std::string> ScriptNameMap;
- Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);}
+ UNORDERED_MAP<uint32, uint32> TransportEventMap;
+
+ Player* GetPlayer(const char* name) const { return ObjectAccessor::Instance().FindPlayerByName(name);}
Player* GetPlayer(uint64 guid) const { return ObjectAccessor::FindPlayer(guid); }
static GameObjectInfo const *GetGameObjectInfo(uint32 id) { return sGOStorage.LookupEntry<GameObjectInfo>(id); }
@@ -536,6 +538,8 @@ class ObjectMgr
void LoadEventScripts();
void LoadSpellScripts();
void LoadWaypointScripts();
+
+ void LoadTransportEvents();
bool LoadTrinityStrings(DatabaseType& db, char const* table, int32 min_value, int32 max_value);
bool LoadTrinityStrings() { return LoadTrinityStrings(WorldDatabase,"trinity_string",MIN_TRINITY_STRING_ID,MAX_TRINITY_STRING_ID); }
@@ -592,7 +596,7 @@ class ObjectMgr
void LoadVendors();
void LoadTrainerSpell();
void LoadCompletedAchievements();
-
+
std::string GeneratePetName(uint32 entry);
uint32 GetBaseXP(uint32 level);
diff --git a/src/game/Transports.cpp b/src/game/Transports.cpp
index be71fcc3f98..c04218ca157 100644
--- a/src/game/Transports.cpp
+++ b/src/game/Transports.cpp
@@ -29,6 +29,8 @@
#include "Database/DBCStores.h"
#include "ProgressBar.h"
+#include "World.h"
+
void MapManager::LoadTransports()
{
QueryResult *result = WorldDatabase.Query("SELECT entry, name, period FROM transports");
@@ -317,7 +319,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
if (keyFrames[keyFrames.size() - 1].mapid != keyFrames[0].mapid)
teleport = true;
- WayPoint pos(keyFrames[0].mapid, keyFrames[0].x, keyFrames[0].y, keyFrames[0].z, teleport);
+ WayPoint pos(keyFrames[0].mapid, keyFrames[0].x, keyFrames[0].y, keyFrames[0].z, teleport, 0);
m_WayPoints[0] = pos;
t += keyFrames[0].delay * 1000;
@@ -351,7 +353,7 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
}
// sLog.outString("T: %d, D: %f, x: %f, y: %f, z: %f", t, d, newX, newY, newZ);
- WayPoint pos(keyFrames[i].mapid, newX, newY, newZ, teleport);
+ WayPoint pos(keyFrames[i].mapid, newX, newY, newZ, teleport, i);
if (teleport)
m_WayPoints[t] = pos;
}
@@ -397,13 +399,13 @@ bool Transport::GenerateWaypoints(uint32 pathid, std::set<uint32> &mapids)
cM = keyFrames[i + 1].mapid;
}
- WayPoint pos(keyFrames[i + 1].mapid, keyFrames[i + 1].x, keyFrames[i + 1].y, keyFrames[i + 1].z, teleport);
+ WayPoint pos(keyFrames[i + 1].mapid, keyFrames[i + 1].x, keyFrames[i + 1].y, keyFrames[i + 1].z, teleport, i);
// sLog.outString("T: %d, x: %f, y: %f, z: %f, t:%d", t, pos.x, pos.y, pos.z, teleport);
-
+/*
if(keyFrames[i+1].delay > 5)
pos.delayed = true;
-
+*/
//if (teleport)
m_WayPoints[t] = pos;
@@ -486,6 +488,13 @@ bool Transport::RemovePassenger(Player* passenger)
return true;
}
+void Transport::CheckForEvent(uint32 entry, uint32 wp_id)
+{
+ uint32 key = entry*100+wp_id;
+ if(objmgr.TransportEventMap.find(key) != objmgr.TransportEventMap.end())
+ sWorld.ScriptsStart(sEventScripts, objmgr.TransportEventMap[key], this, NULL);
+}
+
void Transport::Update(uint32 /*p_time*/)
{
if (m_WayPoints.size() <= 1)
@@ -507,7 +516,7 @@ void Transport::Update(uint32 /*p_time*/)
//MapManager::Instance().GetMap(m_curr->second.mapid)->GameobjectRelocation((GameObject *)this, m_curr->second.x, m_curr->second.y, m_curr->second.z, this->m_orientation);
Relocate(m_curr->second.x, m_curr->second.y, m_curr->second.z);
}
-
+/*
if(m_curr->second.delayed)
{
switch (GetEntry())
@@ -527,7 +536,7 @@ void Transport::Update(uint32 /*p_time*/)
SendPlaySound(5154, false); break; // ShipDocked
}
}
-
+*/
/*
for(PlayerSet::iterator itr = m_passengers.begin(); itr != m_passengers.end();)
{
@@ -548,5 +557,9 @@ void Transport::Update(uint32 /*p_time*/)
if ((sLog.getLogFilter() & LOG_FILTER_TRANSPORT_MOVES)==0)
sLog.outDetail("%s moved to %f %f %f %d", this->m_name.c_str(), m_curr->second.x, m_curr->second.y, m_curr->second.z, m_curr->second.mapid);
- }
+
+ //Transport Event System
+ CheckForEvent(this->GetEntry(), m_curr->second.id);
+ sLog.outDetail("%s is at wp id: %u", this->m_name.c_str(), m_curr->second.id);
+ }
}
diff --git a/src/game/Transports.h b/src/game/Transports.h
index 0e39d57c089..5fb15dbe98f 100644
--- a/src/game/Transports.h
+++ b/src/game/Transports.h
@@ -78,6 +78,7 @@ class Transport : private GameObject
void Update(uint32 p_time);
bool AddPassenger(Player* passenger);
bool RemovePassenger(Player* passenger);
+ void CheckForEvent(uint32 entry, uint32 wp_id);
typedef std::set<Player*> PlayerSet;
PlayerSet const& GetPassengers() const { return m_passengers; }
@@ -86,15 +87,15 @@ class Transport : private GameObject
private:
struct WayPoint
{
- WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false) {}
- WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport) :
- mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), delayed(false) {}
+ WayPoint() : mapid(0), x(0), y(0), z(0), teleport(false), id(0) {}
+ WayPoint(uint32 _mapid, float _x, float _y, float _z, bool _teleport, uint32 _id) :
+ mapid(_mapid), x(_x), y(_y), z(_z), teleport(_teleport), id(_id) {}
uint32 mapid;
float x;
float y;
float z;
bool teleport;
- bool delayed;
+ uint32 id;
};
typedef std::map<uint32, WayPoint> WayPointMap;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 028ec804ab4..9bb936be6af 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -63,6 +63,7 @@
#include "Util.h"
#include "Language.h"
#include "CreatureGroups.h"
+#include "Transports.h"
INSTANTIATE_SINGLETON_1( World );
@@ -1398,6 +1399,9 @@ void World::SetInitialWorldSettings()
//Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
sLog.outString( "Loading Transports..." );
MapManager::Instance().LoadTransports();
+
+ sLog.outString( "Loading Transports Events..." );
+ objmgr.LoadTransportEvents();
sLog.outString("Deleting expired bans..." );
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
@@ -1656,7 +1660,7 @@ void World::ScriptsStart(ScriptMapMap const& scripts, uint32 id, Object* source,
return;
// prepare static data
- uint64 sourceGUID = source->GetGUID();
+ uint64 sourceGUID = source ? source->GetGUID() : (uint64)0; //some script commands doesn't have source
uint64 targetGUID = target ? target->GetGUID() : (uint64)0;
uint64 ownerGUID = (source->GetTypeId()==TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
@@ -1685,7 +1689,7 @@ void World::ScriptCommandStart(ScriptInfo const& script, uint32 delay, Object* s
// NOTE: script record _must_ exist until command executed
// prepare static data
- uint64 sourceGUID = source->GetGUID();
+ uint64 sourceGUID = source ? source->GetGUID() : (uint64)0;
uint64 targetGUID = target ? target->GetGUID() : (uint64)0;
uint64 ownerGUID = (source->GetTypeId()==TYPEID_ITEM) ? ((Item*)source)->GetOwnerGUID() : (uint64)0;
@@ -1742,12 +1746,22 @@ void World::ScriptsProcess()
source = HashMapHolder<Player>::Find(step.sourceGUID);
break;
case HIGHGUID_GAMEOBJECT:
- source = HashMapHolder<GameObject>::Find(step.sourceGUID);
+ source = HashMapHolder<GameObject>::Find(step.sourceGUID);
break;
case HIGHGUID_CORPSE:
source = HashMapHolder<Corpse>::Find(step.sourceGUID);
break;
- default:
+ case HIGHGUID_MO_TRANSPORT:
+ for (MapManager::TransportSet::iterator iter = MapManager::Instance().m_Transports.begin(); iter != MapManager::Instance().m_Transports.end(); ++iter)
+ {
+ if((*iter)->GetGUID() == step.sourceGUID)
+ {
+ source = reinterpret_cast<Object*>(*iter);
+ break;
+ }
+ }
+ break;
+ default:
sLog.outError("*_script source with unsupported high guid value %u",GUID_HIPART(step.sourceGUID));
break;
}
@@ -2316,6 +2330,80 @@ void World::ScriptsProcess()
break;
}
+ case SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT:
+ {
+ if(!step.script->datalong || !step.script->datalong2)
+ {
+ sLog.outError("SCRIPT_COMMAND_CALLSCRIPT calls invallid db_script_id or lowguid not present: skipping.");
+ break;
+ }
+ Creature* target = NULL;
+
+ if(source) //using grid searcher
+ {
+ CellPair p(Trinity::ComputeCellPair(((Unit*)source)->GetPositionX(), ((Unit*)source)->GetPositionY()));
+ Cell cell(p);
+ cell.data.Part.reserved = ALL_DISTRICT;
+
+ //sLog.outDebug("Attempting to find Creature: Db GUID: %i", step.script->datalong);
+ Trinity::CreatureWithDbGUIDCheck target_check(((Unit*)source), step.script->datalong);
+ Trinity::CreatureSearcher<Trinity::CreatureWithDbGUIDCheck> checker(target,target_check);
+
+ TypeContainerVisitor<Trinity::CreatureSearcher <Trinity::CreatureWithDbGUIDCheck>, GridTypeMapContainer > unit_checker(checker);
+ CellLock<GridReadGuard> cell_lock(cell, p);
+ cell_lock->Visit(cell_lock, unit_checker, *(((Unit*)source)->GetMap()));
+ }
+ else //check hashmap holders
+ {
+ if(CreatureData const* data = objmgr.GetCreatureData(step.script->datalong))
+ target = ObjectAccessor::GetObjectInWorld<Creature>(data->mapid, data->posX, data->posY, MAKE_NEW_GUID(step.script->datalong, data->id, HIGHGUID_UNIT), target);
+ }
+
+ if(!target)
+ break;
+
+ //Lets choose our ScriptMap map
+ ScriptMapMap datamap;
+ switch(step.script->dataint)
+ {
+ case 1:
+ datamap = sQuestEndScripts;
+ break;
+ case 2:
+ datamap = sQuestStartScripts;
+ break;
+ case 3:
+ datamap = sSpellScripts;
+ break;
+ case 4:
+ datamap = sGameObjectScripts;
+ break;
+ case 5:
+ datamap = sEventScripts;
+ break;
+ case 6:
+ datamap = sWaypointScripts;
+ break;
+ default:
+ sLog.outError("SCRIPT_COMMAND_CALLSCRIPT ERROR: no scriptmap present... ignoring");
+ m_scriptSchedule.erase(iter);
+ return;
+ }
+ uint32 script_id = step.script->datalong2;
+ m_scriptSchedule.erase(iter);
+ ScriptsStart(datamap, script_id, target, NULL);
+ return;
+ }
+
+ case SCRIPT_COMMAND_PLAYSOUND:
+ {
+ if(!source)
+ break;
+ //datalong sound_id, datalong2 onlyself
+ ((WorldObject*)source)->SendPlaySound(step.script->datalong, step.script->datalong2);
+ break;
+ }
+
default:
sLog.outError("Unknown script command %u called.",step.script->command);
break;
diff --git a/src/game/World.h b/src/game/World.h
index 977e0aef173..66ea7791ec0 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -333,6 +333,9 @@ enum RealmZone
#define SCRIPT_COMMAND_REMOVE_AURA 14 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id
#define SCRIPT_COMMAND_CAST_SPELL 15 // source (datalong2!=0) or target (datalong==0) unit, datalong = spell_id
#define SCRIPT_COMMAND_LOAD_PATH 16 // source = unit, path = datalong, repeatable datalong2
+#define SCRIPT_COMMAND_CALLSCRIPT_TO_UNIT 17 // datalong scriptid, lowguid datalong2, dataint table
+#define SCRIPT_COMMAND_PLAYSOUND 18 // datalong soundid, datalong2 play only self
+
/// Storage class for commands issued for delayed execution
struct CliCommandHolder