diff options
32 files changed, 858 insertions, 232 deletions
diff --git a/sql/updates/characters/2012_12_18_00_character_worldstates.sql b/sql/updates/characters/2012_12_18_00_character_worldstates.sql new file mode 100644 index 00000000000..d781441f266 --- /dev/null +++ b/sql/updates/characters/2012_12_18_00_character_worldstates.sql @@ -0,0 +1,5 @@ +DELETE FROM `worldstates` WHERE `entry` IN (20004,20007,20050); +INSERT INTO `worldstates` (`entry`, `value`, `comment`) VALUES +(20004,0,'CleaningFlags'), +(20007,0,'NextMonthlyQuestResetTime') +(20050,0,'NextWeeklyGuildResetTime'); diff --git a/sql/updates/world/2012_12_17_00_world_spell_linked_spell.sql b/sql/updates/world/2012_12_17_00_world_spell_linked_spell.sql new file mode 100644 index 00000000000..a2cfc7073d0 --- /dev/null +++ b/sql/updates/world/2012_12_17_00_world_spell_linked_spell.sql @@ -0,0 +1,4 @@ +-- Fix Preserved Holly item triggered spell to apply reindeer transformation also so Fa-la-la-la Ogri'La can be doable with it also, based on sniffs. +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=62061; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(62061,25860,0, 'Festive Holiday Mount'); diff --git a/sql/updates/world/2012_12_18_00_world_creature_text.sql b/sql/updates/world/2012_12_18_00_world_creature_text.sql new file mode 100644 index 00000000000..1cf9211343f --- /dev/null +++ b/sql/updates/world/2012_12_18_00_world_creature_text.sql @@ -0,0 +1,5 @@ +DELETE FROM `creature_text` WHERE `entry`=32273; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`) VALUES +(32273, 0, 0, 'How dare you interfere with our work!', 14, 0, 100, 0, 0, 0, 'Infinite Corruptor - SAY_AGGRO'), +(32273, 1, 0, 'My time... has run out...', 14, 0, 100, 0, 0, 0, 'Infinite Corruptor - SAY_DEATH'), +(32273, 2, 0, 'The process is finally complete! My work here is done.', 14, 0, 100, 0, 0, 0, 'Infinite Corruptor - SAY_FAIL'); diff --git a/sql/updates/world/2012_12_18_00_world_waking_the_sleeper.sql b/sql/updates/world/2012_12_18_00_world_waking_the_sleeper.sql new file mode 100644 index 00000000000..4f8a203100d --- /dev/null +++ b/sql/updates/world/2012_12_18_00_world_waking_the_sleeper.sql @@ -0,0 +1,47 @@ +-- Convert quest_end_script "10964" to SAI, alongside dropping creature c++ script +-- Indexes: +SET @CLINTAR_DREAMWALKER := 22834; +SET @SCRIPT := @CLINTAR_DREAMWALKER * 100; +SET @SPIRIT := 22916; + +-- Remove template addon emote (all is handled by that SAI, this breaks it) +UPDATE `creature_template_addon` SET `emote`=0 WHERE `entry`=@CLINTAR_DREAMWALKER; + +-- Remove from quest_end_scripts +DELETE FROM `quest_end_scripts` WHERE `id`=10964; + +-- Add SAI support and drop c++ script +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@CLINTAR_DREAMWALKER; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@CLINTAR_DREAMWALKER AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@CLINTAR_DREAMWALKER,0,0,0,20,0,100,0,10964,0,0,0,80,@SCRIPT,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - On quest 10964 rewarded - Start action list'), +(@CLINTAR_DREAMWALKER,0,1,2,19,1,100,0,10965,0,0,0,12,@SPIRIT,2,100000,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - On quest 10965 accepted - Spawn creature (can happen only after actionlist stuff are complete)'), +(@CLINTAR_DREAMWALKER,0,2,0,61,1,100,0,0,0,0,0,69,3,0,0,0,0,0,8,0,0,0,7459.47,-3122.79,439.485,5.84588, 'Clintar Dreamwalker - Linked - Move to pos'), +(@CLINTAR_DREAMWALKER,0,3,4,34,1,100,0,8,3,0,0,90,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - On point 3 reached set - Set field byte 1 for sleeping'), +(@CLINTAR_DREAMWALKER,0,4,0,61,1,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Linked - Set phase 0'), +(@CLINTAR_DREAMWALKER,0,5,6,1,1,100,1,360000,360000,360000,360000,47,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - OOC (phase 1) - Set unseen'), +(@CLINTAR_DREAMWALKER,0,6,0,61,1,100,1,0,0,0,0,41,100,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Linked - Despawn'), +(@SCRIPT,9,0,0,0,0,100,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 0 - Remove npc flag for quest giver'), +(@SCRIPT,9,1,0,0,0,100,0,3000,3000,0,0,91,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 1 - Remove bytes for sleeping'), +(@SCRIPT,9,2,0,0,0,100,0,0,0,0,0,90,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 2 - Set bytes 1 kneel'), +(@SCRIPT,9,3,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 3 - Say line 0'), +(@SCRIPT,9,4,0,0,0,100,0,6000,6000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 4 - Say line 1 (with exclamation emote)'), +(@SCRIPT,9,5,0,0,0,100,0,7000,7000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 5 - Say line 2'), +(@SCRIPT,9,6,0,0,0,100,0,0,0,0,0,91,8,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 6 - Remove bytes 1 for kneel'), +(@SCRIPT,9,7,0,0,0,100,0,5000,5000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 7 - Say line 3'), +(@SCRIPT,9,8,0,0,0,100,0,5000,5000,0,0,69,0,0,0,0,0,0,8,0,0,0,7453.25,-3116.29,439.604,5.534, 'Clintar Dreamwalker - Action 8 - Move to pos'), +(@SCRIPT,9,9,0,0,0,100,0,5000,5000,0,0,69,0,0,0,0,0,0,8,0,0,0,7453.79,-3116.83,439.604,5.534, 'Clintar Dreamwalker - Action 9 - Move to pos'), +(@SCRIPT,9,10,0,0,0,100,0,8000,8000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 10 - Say line 4'), +(@SCRIPT,9,11,0,0,0,100,0,1500,1500,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 11 - Add npc flag for quest giver'), +(@SCRIPT,9,12,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Clintar Dreamwalker - Action 12 - Set phase 1'); + +-- Convert from db_script_string to creature_text +DELETE FROM `db_script_string` WHERE `entry` IN (2000000067,2000000068,2000000069); +DELETE FROM `creature_text` WHERE `entry`=@CLINTAR_DREAMWALKER; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@CLINTAR_DREAMWALKER,0,0, 'Clintar Dreamwalker snaps up to a kneeling position, but seems as though he''s somewhere else.',16,0,100,0,0,0, 'Clintar Dreamwalker (line 0)'), +(@CLINTAR_DREAMWALKER,1,0, 'What are you doing in Ysera''s realm, interloper? Leave us, I say! Your kind are not welcome here!',12,0,100,5,0,0, 'Clintar Dreamwalker (line 1)'), +(@CLINTAR_DREAMWALKER,2,0, 'Clintar Dreamwalker gets to his feet, beginning to recognize his surroundings.',16,0,100,0,0,0, 'Clintar Dreamwalker (line 2)'), +(@CLINTAR_DREAMWALKER,3,0, 'You - you''re not one of them! Let''s get out of sight before they find us! Hurry! ',12,0,100,1,0,0, 'Clintar Dreamwalker (line 3)'), +(@CLINTAR_DREAMWALKER,4,0, 'They''re following me, $R! Quickly, tell me why you''re here before we''re discovered! If they catch up to me, it will mean my death and yours!',12,0,100,1,0,0, 'Clintar Dreamwalker (line 4)'); diff --git a/sql/updates/world/2012_12_18_01_world_creature_text.sql b/sql/updates/world/2012_12_18_01_world_creature_text.sql new file mode 100644 index 00000000000..24779f67fc7 --- /dev/null +++ b/sql/updates/world/2012_12_18_01_world_creature_text.sql @@ -0,0 +1,75 @@ +-- Vazruden the herald +DELETE FROM `creature_text` WHERE `entry`=17307; +INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`sound`,`comment`,`text`) VALUES +(17307,0,0,14,100,10292,"vazruden the herald SAY_INTRO","You have faced many challenges, pity they were all in vain. Soon your people will kneel to my lord!"); + +-- Nazan +DELETE FROM `creature_text` WHERE `entry`=17536; +INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`comment`,`text`) VALUE +(17536,0,0,41,100,"nazan EMOTE","%s descends from the sky"); + +-- Vazruden +DELETE FROM `creature_text` WHERE `entry`=17537; +INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`sound`,`comment`,`text`) VALUES +(17537,0,0,14,100,10293,"vazruden SAY_WIPE","Is there no one left to test me?"), +(17537,1,0,14,100,10294,"vazruden SAY_AGGRO_1","Your time is running out!"), +(17537,1,1,14,100,10295,"vazruden SAY_AGGRO_2","You are nothing, I answer a higher call!"), +(17537,1,2,14,100,10296,"vazruden SAY_AGGRO_3","The Dark Lord laughs at you!"), +(17537,2,0,14,100,10297,"vazruden SAY_KILL_1","It is over. Finished!"), +(17537,2,1,14,100,10298,"vazruden SAY_KILL_2","Your days are done!"), +(17537,3,0,14,100,10299,"vazruden SAY_DIE","My lord will be the end you all..."); + +-- Talbot aka Prince Valanar (There's an UpdateEntry() call in the script which I did not see) +UPDATE `creature_text` SET `entry`=28189 WHERE `entry`=25301; + +-- Darion Mograine +UPDATE `creature_text` SET `entry`=29228 WHERE `entry`=29173 AND `groupid`=74; + +-- Core rager +UPDATE `creature_text` SET `entry`=11672 WHERE `entry`=11988; + +DELETE FROM `creature_text` WHERE `entry` IN (15550,16151); +INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`type`,`probability`,`sound`,`comment`,`text`) VALUES +-- Attumen +(15550,0,0,14,100,9169,"attumen SAY_KILL1","It was... inevitable."), +(15550,0,1,14,100,9300,"attumen SAY_KILL2","Another trophy to add to my collection!"), +(15550,1,0,14,100,9166,"attumen SAY_DISARMED","Weapons are merely a convenience for a warrior of my skill!"), +(15550,2,0,14,100,9165,"attumen SAY_DEATH","I always knew... someday I would become... the hunted."), +(15550,3,0,14,100,9170,"attumen SAY_RANDOM1","Such easy sport."), +(15550,3,1,14,100,9304,"attumen SAY_RANDOM2","Amateurs! Do not think you can best me! I kill for a living."), +-- Midnight +(16151,0,0,14,100,9173,"attumen SAY_MIDNIGHT_KILL","Well done Midnight!"), +(16151,1,0,14,100,9167,"attumen SAY_APPEAR1","Cowards! Wretches!"), +(16151,1,1,14,100,9298,"attumen SAY_APPEAR2","Who dares attack the steed of the Huntsman?"), +(16151,1,2,14,100,9299,"attumen SAY_APPEAR3","Perhaps you would rather test yourselves against a more formidable opponent?!"), +(16151,2,0,14,100,9168,"attumen SAY_MOUNT","Come, Midnight, let\'s disperse this petty rabble!"); + +-- Creature text preparation for rajaxx +DELETE FROM `creature_text` WHERE `entry` IN (15471,15341); +INSERT INTO `creature_text`(`entry`,`groupid`,`sound`,`type`,`probability`,`comment`,`text`) VALUES +(15471,0,0,14,100,"andorov SAY_ANDOROV_INTRO","They come now. Try not to get yourself killed, young blood."), +(15471,1,0,14,100,"andorov SAY_ANDOROV_ATTACK","Remember, Rajaxx, when I said I\'d kill you last? I lied..."), +(15341,0,8612,14,100,"rajaxx SAY_WAVE3","The time of our retribution is at hand! Let darkness reign in the hearts of our enemies!"), +(15341,1,8610,14,100,"rajaxx SAY_WAVE4","No longer will we wait behind barred doors and walls of stone! No longer will our vengeance be denied! The dragons themselves will tremble before our wrath!"), +(15341,2,8608,14,100,"rajaxx SAY_WAVE5","Fear is for the enemy! Fear and death!"), +(15341,3,8611,14,100,"rajaxx SAY_WAVE6","Staghelm will whimper and beg for his life, just as his whelp of a son did! One thousand years of injustice will end this day!"), +(15341,4,8607,14,100,"rajaxx SAY_WAVE7","Fandral! Your time has come! Go and hide in the Emerald Dream and pray we never find you!"), +(15341,5,8609,14,100,"rajaxx SAY_INTRO","Impudent fool! I will kill you myself!"), +(15341,6,8603,14,100,"rajaxx SAY_UNK1","Attack and make them pay dearly!"), +(15341,7,8605,14,100,"rajaxx SAY_UNK2","Crush them! Drive them out!"), +(15341,8,8606,14,100,"rajaxx SAY_UNK3","Do not hesitate! Destroy them!"), +(15341,9,8613,14,100,"rajaxx SAY_UNK4","Warriors! Captains! Continue the fight!"), +(15341,10,8614,14,100,"rajaxx SAY_DEAGGRO","You are not worth my time $N!"), +(15341,11,8604,14,100,"rajaxx SAY_KILLS_ANDOROV","Breath your last!"), +(15341,12,0,14,100,"rajaxx SAY_COMPLETE_QUEST","Soon you will know the price of your meddling, mortals... The master is nearly whole... And when he rises, your world will be cease!"); + +-- moam +DELETE FROM `creature_text` WHERE `entry`=15340; +INSERT INTO `creature_text`(`entry`,`groupid`,`type`,`probability`,`comment`,`text`) VALUES +(15340,0,16,100,"moam EMOTE_AGGRO","%s senses your fear."), +(15340,1,16,100,"moan EMOTE_MANA_FULL","%s bristles with energy!"); + +-- buru +DELETE FROM `creature_text` WHERE `entry`=15370; +INSERT INTO `creature_text`(`entry`,`groupid`,`type`,`probability`,`comment`,`text`) VALUES +(15370,0,16,100,"buru EMOTE_TARGET","%s sets eyes on $N!"); diff --git a/sql/updates/world/2012_12_18_02_world_misc.sql b/sql/updates/world/2012_12_18_02_world_misc.sql new file mode 100644 index 00000000000..5df6ef8eb95 --- /dev/null +++ b/sql/updates/world/2012_12_18_02_world_misc.sql @@ -0,0 +1,14 @@ +UPDATE `creature_template` SET `AIName`='SmartAI',`ScriptName`='' WHERE `entry`=15760; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=15760 AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(15760, 0, 0, 0, 22, 0, 100, 0, 58, 0, 0, 0, 11, 26218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 'Winter Reveler - Cast Mistletoe on /kiss'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=26218; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(26218,'spell_winter_veil_mistletoe'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=15760; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 15760, 0, 0, 1, 0, 26218, 1, 0, 1, 0, 0, '', 'execute sai only if player has not Mistletoe Debuff'), +(22, 1, 15760, 0, 0, 12, 0, 2, 0, 0, 0, 0, 0, '', 'execute sai only if Winter Veil'); diff --git a/sql/updates/world/2012_12_18_02_world_sai.sql b/sql/updates/world/2012_12_18_02_world_sai.sql new file mode 100644 index 00000000000..0843285550f --- /dev/null +++ b/sql/updates/world/2012_12_18_02_world_sai.sql @@ -0,0 +1,47 @@ +SET @NPC_WARLORD_ZOLMAZ := 28902; +SET @NPC_ENCHANTED_TIKI := 28927; +SET @GO_ZOLMAZ_GATE := 190784; +SET @GO_GATE_LEVER := 190834; + +DELETE FROM `event_scripts` WHERE `id`=18940; +INSERT INTO `event_scripts` (`id`,`delay`,`command`,`datalong`,`datalong2`,`dataint`,`x`,`y`,`z`,`o`) VALUES +(18940,6,11,57571,180,0,0,0,0,0); + +DELETE FROM `creature_text` WHERE `entry`=@NPC_WARLORD_ZOLMAZ; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_WARLORD_ZOLMAZ,0,0,'%s becomes enraged.',16,0,100,0,0,0,'Warlord Zol''Maz'), +(@NPC_WARLORD_ZOLMAZ,1,0,'You have an enchanted tiki? YOU KILLED MY FAMILY!',14,0,100,15,0,6200,'Warlord Zol''Maz'), +(@NPC_WARLORD_ZOLMAZ,2,0,'I WILL KILL YOU, $N!',14,0,100,0,0,0,'Warlord Zol''Maz'); + +UPDATE `creature_template` SET `dmg_multiplier`=2.75, `AIName`='SmartAI' WHERE `entry`=@NPC_WARLORD_ZOLMAZ; +UPDATE `creature_template` SET `minlevel`=77, `maxlevel`=77, `exp`=2, `mindmg`=371, `maxdmg`=522, `attackpower`=478, `dmg_multiplier`=1.75, `unit_flags`=32776, `unit_class`=2, `minrangedmg`=314, `maxrangedmg`=466, `rangedattackpower`=81, `AIName`='SmartAI', `equipment_id`=838 WHERE `entry`=@NPC_ENCHANTED_TIKI; +UPDATE `creature_model_info` SET `bounding_radius`=0.465, `combat_reach`=7.5 WHERE `modelid`=26286; + +DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_ENCHANTED_TIKI; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(@NPC_ENCHANTED_TIKI,0,0,0,1,0,'52614 52670'); + +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@GO_GATE_LEVER; +UPDATE `gameobject_template` SET `flags`=4 WHERE `entry` IN (190836,191766,194126); +UPDATE `gameobject` SET `position_x`=6552.984, `position_y`=-3903.916, `position_z`=490.9412 WHERE `guid`=99744; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@NPC_WARLORD_ZOLMAZ,@NPC_ENCHANTED_TIKI) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@GO_GATE_LEVER AND `source_type`=1; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@NPC_WARLORD_ZOLMAZ,0,0,0,9,0,100,0,10,25,0,0,11,32323,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On target range 10-25y - Spellcast Charge'), +(@NPC_WARLORD_ZOLMAZ,0,1,2,2,0,100,1,0,20,0,0,11,8599,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On health below 20% - Spellcast Enrage'), +(@NPC_WARLORD_ZOLMAZ,0,2,0,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On health below 20% - Say line'), +(@NPC_WARLORD_ZOLMAZ,0,3,0,0,0,100,0,12000,12000,20000,20000,11,54670,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On update IC - Spellcast Decapitate'), +(@NPC_WARLORD_ZOLMAZ,0,4,0,2,0,100,1,0,35,0,0,11,40546,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On health below 35% - Spellcast Retaliation'), +(@NPC_WARLORD_ZOLMAZ,0,5,0,38,0,100,0,0,1,0,0,1,1,7000,0,0,0,0,12,1,0,0,0,0,0,0, 'Warlord Zol''Maz - On data set 0 1 - Say line'), +(@NPC_WARLORD_ZOLMAZ,0,6,7,52,0,100,0,1,@NPC_WARLORD_ZOLMAZ,0,0,1,2,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Warlord Zol''Maz - On text over - Say line'), +(@NPC_WARLORD_ZOLMAZ,0,7,8,61,0,100,0,0,0,0,0,19,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On text over - Remove unit_flags IMMUNE_TO_PC'), +(@NPC_WARLORD_ZOLMAZ,0,8,0,61,0,100,0,0,0,0,0,49,0,0,0,0,0,0,12,1,0,0,0,0,0,0, 'Warlord Zol''Maz - On text over - Start attack'), +(@NPC_WARLORD_ZOLMAZ,0,9,10,6,0,100,0,0,0,0,0,32,0,0,0,0,0,0,14,57571,@GO_ZOLMAZ_GATE,0,0,0,0,0, 'Warlord Zol''Maz - On death - Reset gate'), +(@NPC_WARLORD_ZOLMAZ,0,10,0,61,0,100,0,0,0,0,0,18,256,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Warlord Zol''Maz - On death - Set unit_flags IMMUNE_TO_PC'), +(@NPC_WARLORD_ZOLMAZ,0,11,10,21,0,100,0,0,0,0,0,32,0,0,0,0,0,0,14,57571,@GO_ZOLMAZ_GATE,0,0,0,0,0, 'Warlord Zol''Maz - On homeposition reached - Reset gate'), +(@NPC_ENCHANTED_TIKI,0,0,1,54,0,100,0,0,0,0,0,45,0,1,0,0,0,0,19,@NPC_WARLORD_ZOLMAZ,50,0,0,0,0,0, 'Enchanted Tiki - Just summoned - Set data 0 1'), +(@NPC_ENCHANTED_TIKI,0,1,2,61,0,100,0,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Enchanted Tiki - Just summoned - Store targetlist'), +(@NPC_ENCHANTED_TIKI,0,2,3,61,0,100,0,0,0,0,0,100,1,0,0,0,0,0,19,@NPC_WARLORD_ZOLMAZ,50,0,0,0,0,0, 'Enchanted Tiki - Just summoned - Send target list'), +(@NPC_ENCHANTED_TIKI,0,3,0,61,0,100,0,0,0,0,0,3,0,25749,0,0,0,0,1,0,0,0,0,0,0,0, 'Enchanted Tiki - Just summoned - Set modelid'), +(@GO_GATE_LEVER,1,0,0,70,0,100,0,2,0,0,0,9,0,0,0,0,0,0,14,57571,@GO_ZOLMAZ_GATE,0,0,0,0,0, 'Gate lever - On activate - Activate gate'); diff --git a/sql/updates/world/2012_12_19_00_world_sai.sql b/sql/updates/world/2012_12_19_00_world_sai.sql new file mode 100644 index 00000000000..170028e8a68 --- /dev/null +++ b/sql/updates/world/2012_12_19_00_world_sai.sql @@ -0,0 +1,106 @@ +-- Remove from quest_end_scripts +DELETE FROM `quest_end_scripts` WHERE `id` IN (12657,12597,10988,10850,10447,9565); + +-- Convert quest_end_script "12657" to SAI +-- Indexes: +SET @DARION_MORGRAINE := 28444; +SET @SCRIPT := @DARION_MORGRAINE * 100; + +-- Add SAI support +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@DARION_MORGRAINE; +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@DARION_MORGRAINE; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@DARION_MORGRAINE AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@DARION_MORGRAINE,0,0,0,20,0,100,0,12657,0,0,0,80,@SCRIPT,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Highlord Darion Morgraine - On quest 12657 rewarded - Start action list'), +(@DARION_MORGRAINE,0,1,0,1,0,100,0,60000,90000,60000,90000,4,12893,1,0,0,0,0,0,0,0,0,0,0,0,0, 'Highlord Darion Morgraine - OOC - Play sound'), +(@SCRIPT,9,0,0,0,0,100,0,16000,16000,0,0,5,22,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Highlord Darion Morgraine - Action 0 - Play emote 22'), +(@SCRIPT,9,1,0,0,0,100,0,0,0,0,0,12,28487,3,46000,0,0,0,8,0,0,0,2465.47,-5567.3,372.16,1.64, 'Highlord Darion Morgraine - Action 1 - Summon'), +(@SCRIPT,9,2,0,0,0,100,0,0,0,0,0,12,28487,3,46000,0,0,0,8,0,0,0,2434.52,-5588.56,372.16,3.26, 'Highlord Darion Morgraine - Action 2 - Summon'), +(@SCRIPT,9,3,0,0,0,100,0,0,0,0,0,12,28487,3,46000,0,0,0,8,0,0,0,2455.59,-5618.32,372.16,4.59, 'Highlord Darion Morgraine - Action 3 - Summon'), +(@SCRIPT,9,4,0,0,0,100,0,0,0,0,0,12,28487,3,46000,0,0,0,8,0,0,0,2439.31,-5608.69,372.16,3.77, 'Highlord Darion Morgraine - Action 4 - Summon'), +(@SCRIPT,9,5,0,0,0,100,0,0,0,0,0,12,28487,3,46000,0,0,0,8,0,0,0,2486.72,-5598.66,372.16,6.02, 'Highlord Darion Morgraine - Action 5 - Summon'), +(@SCRIPT,9,6,0,0,0,100,0,0,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Highlord Darion Morgraine - Action 6 - Say line 0'), +(@SCRIPT,9,7,0,0,0,100,0,16000,16000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Highlord Darion Morgraine - Action 7 - Say line 1'); + +-- Convert from db_script_string to creature_text +DELETE FROM `db_script_string` WHERE `entry` IN (2000005409,2000005410); +DELETE FROM `creature_text` WHERE `entry`=@DARION_MORGRAINE; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@DARION_MORGRAINE,0,0, '%s calls upon the mighty armies of the Scourge!',42,0,100,1,0,0, 'Highlord Darion Morgraine'), +(@DARION_MORGRAINE,1,0, 'Armies of the Scourge, hear my call! The scarlet apocalypse has begun! Tear this land asunder and leave only death in your wake!',12,0,100,1,0,0, 'Highlord Darion Morgraine'); + +-- Convert quest_end_script "10988" to SAI +-- Indexes: +SET @Arthorn_Windsong := 22924; +SET @SCRIPT := @Arthorn_Windsong * 100; + +-- Add SAI support +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Arthorn_Windsong; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@Arthorn_Windsong AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Arthorn_Windsong,0,0,0,20,0,100,0,10988,0,0,0,80,@SCRIPT,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Captain Brandon - On quest 10988 rewarded - Start script'), +(@SCRIPT,9,0,0,0,0,100,0,30000,30000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 0 - Say line 0'), +(@SCRIPT,9,1,0,0,0,100,0,43000,43000,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 1 - Say line 1'), +(@SCRIPT,9,2,0,0,0,100,0,43000,43000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 2 - Play emote 1'), +(@SCRIPT,9,3,0,0,0,100,0,56000,56000,0,0,69,1,0,0,0,0,0,8,0,0,0,3024.32,5511.29,146.051,2.31064, 'Arthorn Windsong - Action 3 - Move to'), +(@SCRIPT,9,4,0,0,0,100,0,17000,17000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 4 - Play emote 1'), +(@SCRIPT,9,5,0,0,0,100,0,17000,17000,0,0,1,2,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 5 - Say line 2'), +(@SCRIPT,9,6,0,0,0,100,0,11000,11000,0,0,5,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 6 - Play emote'), +(@SCRIPT,9,7,0,0,0,100,0,11000,11000,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 7- Say line 3'), +(@SCRIPT,9,8,0,0,0,100,0,1000,1000,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 8 - Say line 4'), +(@SCRIPT,9,9,0,0,0,100,0,11000,11000,0,0,11,39679,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 9 - Cast spell'), +(@SCRIPT,9,10,0,0,0,100,0,10000,10000,0,0,69,0,0,0,0,0,0,8,0,0,0,3044.22,5510.91,146.033,4.654, 'Windsong - Action 10 - Move to pos'), +(@SCRIPT,9,11,0,0,0,100,0,56000,56000,0,0,1,5,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Arthorn Windsong - Action 11 - Say line 5'); + +-- Convert from db_script_string to creature_text +DELETE FROM `db_script_string` WHERE `entry` IN (2000000073,2000000074,2000000072,2000000071,2000000070,2000000075); +DELETE FROM `creature_text` WHERE `entry`=@Arthorn_Windsong; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@Arthorn_Windsong,0,0, 'There''s something else here, too. After a discription of a bloody battle and the downfall of the raven, there''s a prophecy. Anzu will haunt the dreams of his enemies, twisting them to affect a return to this world...',12,0,100,1,0,0, 'Arthorn Windsong'), +(@Arthorn_Windsong,1,0, 'The tablet has the confirmation we need, just as I thought. Now, we have to use this information to draw out and defeat this Anzu before he can do any more damage to the Emerald Dream!',12,0,100,1,0,0, 'Arthorn Windsong'), +(@Arthorn_Windsong,2,0, 'It''s all here... how the raven''s followers captured and subdued the sprints of rivals, trapping them forever within stone statues! The tablet even mentions the raven god''s name -- Anzu. I''d thought it was lost to history!',12,0,100,1,0,0, 'Arthorn Windsong'), +(@Arthorn_Windsong,3,0, 'This is it! This is really it -- the Book of the Raven!',12,0,100,1,0,0, 'Arthorn Windsong'), +(@Arthorn_Windsong,4,0, 'It would''ve taken years to find the Book of the Raven without you, young sparrowhawk. Return to your home in Nagrand with our gratitude.',12,0,100,1,0,0, 'Arthorn Windsong'), +(@Arthorn_Windsong,5,0, 'Since the sparrowhawks have proven such a success in hunting down the raven stones, Watcher Elaira has trained another one to relay my voice at a great distance. He can help us communicate as you investigate the bird spirits revealed in the tablet!',12,0,100,1,0,0, 'Arthorn Windsong'); + +-- Convert quest_end_script "10850" to SAI +-- Indexes: +SET @Inactive_Fel_Reaver := 22293; + +-- Add SAI support +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Inactive_Fel_Reaver; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@Inactive_Fel_Reaver AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Inactive_Fel_Reaver,0,0,0,20,0,100,0,10850,0,0,0,15,10855,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Inactive Fel Reaver - On quest 10850 rewarded - Call Quest Explored for invoker'); + +-- Convert quest_end_script "10447" to SAI +-- Indexes: +SET @Toki := 18447; + +-- Add SAI support +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@Toki; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@Toki AND `source_type`=0; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Toki,0,0,0,20,0,100,0,10447,0,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Toki - On quest 10447 rewarded - Say line 0'); + +-- Convert from db_script_string to creature_text +DELETE FROM `db_script_string` WHERE `entry`=2000000062; +DELETE FROM `creature_text` WHERE `entry`=@Toki; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@Toki,0,0, 'The threat be over! $N be savin'' us all!',12,0,100,1,0,0, 'Toki'); + +-- Convert quest_end_script "9565" to SAI +-- Indexes: +SET @Blood_Crystal := 181748; +SET @SCRIPT := @Blood_Crystal * 100; + +-- Add SAI support +UPDATE `gameobject_template` SET `AIName`='SmartGameObjectAI' WHERE `entry`=@Blood_Crystal; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@Blood_Crystal AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Blood_Crystal,1,0,0,20,0,100,0,9565,0,0,0,80,@SCRIPT,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Blood Crystal - On quest 9565 rewarded - Start actionlist'), +(@SCRIPT,9,0,0,0,0,100,0,2000,2000,0,0,12,17189,3,180000,0,0,0,8,0,0,0,-3105.36,-12549.2,-1.28,4.6, 'Blood Crystal - Action 0 - Summon'), +(@SCRIPT,9,1,0,0,0,100,0,2000,2000,0,0,12,17189,3,180000,0,0,0,8,0,0,0,-3128.49,-12540.2,-2.54,1.5, 'Blood Crystal - Action 1 - Summon'); diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 3d9e0486838..6535fe2be17 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -181,8 +181,10 @@ void PetAI::UpdateAI(const uint32 diff) spellUsed = true; } } + if (spellInfo->HasEffect(SPELL_EFFECT_JUMP_DEST)) - continue; //pets must jump only to target + continue; // Pets must only jump to target + // No enemy, check friendly if (!spellUsed) { @@ -266,6 +268,7 @@ void PetAI::UpdateAllies() //only pet and owner/not in group->ok if (m_AllySet.size() == 2 && !group) return; + //owner is in group; group members filled in already (no raid -> subgroupcount = whole count) if (group && !group->isRaidGroup() && m_AllySet.size() == (group->GetMembersCount() + 2)) return; diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 74f70f6bb4b..c31a9141e18 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -422,6 +422,8 @@ bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*itemEntry // we need to delete the entry, it is not referenced any more delete auction; + auction = NULL; + return wasInMap; } @@ -474,8 +476,8 @@ void AuctionHouseObject::Update() auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); - RemoveAuction(auction, itemEntry); sAuctionMgr->RemoveAItem(auction->itemGUIDLow); + RemoveAuction(auction, itemEntry); } while (result->NextRow()); } diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5cc304223e6..596f0ebbc28 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1661,7 +1661,7 @@ bool ObjectMgr::MoveCreData(uint32 guid, uint32 mapId, Position pos) Creature* creature = new Creature; if (!creature->LoadCreatureFromDB(guid, map)) { - sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", guid); + sLog->outError(LOG_FILTER_GENERAL, "MoveCreData: Cannot add creature guid %u to map", guid); delete creature; return false; } @@ -1713,7 +1713,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 /*team*/, uint32 mapId, float Creature* creature = new Creature; if (!creature->LoadCreatureFromDB(guid, map)) { - sLog->outError(LOG_FILTER_GENERAL, "AddCreature: cannot add creature entry %u to map", entry); + sLog->outError(LOG_FILTER_GENERAL, "AddCreature: Cannot add creature entry %u to map", entry); delete creature; return 0; } @@ -1738,8 +1738,7 @@ void ObjectMgr::LoadGameobjects() if (!result) { - sLog->outError(LOG_FILTER_SERVER_LOADING, ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); - + sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 gameobjects. DB table `gameobject` is empty."); return; } diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp index 488dbfc9159..4f45044d5f7 100644 --- a/src/server/game/Movement/MotionMaster.cpp +++ b/src/server/game/Movement/MotionMaster.cpp @@ -378,14 +378,14 @@ void MotionMaster::MoveJump(float x, float y, float z, float speedXY, float spee Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED); } -void MotionMaster::MoveFall(uint32 id/*=0*/) +void MotionMaster::MoveFall(uint32 id /*=0*/) { // use larger distance for vmap height search than in most other cases float tz = _owner->GetMap()->GetHeight(_owner->GetPhaseMask(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ(), true, MAX_FALL_DISTANCE); if (tz <= INVALID_HEIGHT) { sLog->outDebug(LOG_FILTER_GENERAL, "MotionMaster::MoveFall: unable retrive a proper height at map %u (x: %f, y: %f, z: %f).", - _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionX(), _owner->GetPositionZ()); + _owner->GetMap()->GetId(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ()); return; } diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 38da442ca5b..97ad1d5f651 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -314,6 +314,7 @@ void AddSC_boss_ayamiss(); void AddSC_boss_ossirian(); void AddSC_instance_ruins_of_ahnqiraj(); void AddSC_boss_cthun(); //Temple of ahn'qiraj +void AddSC_boss_viscidus(); void AddSC_boss_fankriss(); void AddSC_boss_huhuran(); void AddSC_bug_trio(); @@ -941,6 +942,7 @@ void AddKalimdorScripts() AddSC_boss_ossirian(); AddSC_instance_ruins_of_ahnqiraj(); AddSC_boss_cthun(); //Temple of ahn'qiraj + AddSC_boss_viscidus(); AddSC_boss_fankriss(); AddSC_boss_huhuran(); AddSC_bug_trio(); diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 51e6ced8d24..aa9477b1c42 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1379,10 +1379,11 @@ FormulaScript::FormulaScript(const char* name) ScriptRegistry<FormulaScript>::AddScript(this); } -UnitScript::UnitScript(const char* name) +UnitScript::UnitScript(const char* name, bool addToScripts) : ScriptObject(name) { - ScriptRegistry<UnitScript>::AddScript(this); + if (addToScripts) + ScriptRegistry<UnitScript>::AddScript(this); } WorldMapScript::WorldMapScript(const char* name, uint32 mapId) @@ -1419,7 +1420,7 @@ ItemScript::ItemScript(const char* name) } CreatureScript::CreatureScript(const char* name) - : UnitScript(name) + : UnitScript(name, false) { ScriptRegistry<CreatureScript>::AddScript(this); } @@ -1473,7 +1474,7 @@ ConditionScript::ConditionScript(const char* name) } VehicleScript::VehicleScript(const char* name) - : UnitScript(name) + : ScriptObject(name) { ScriptRegistry<VehicleScript>::AddScript(this); } @@ -1497,7 +1498,7 @@ AchievementCriteriaScript::AchievementCriteriaScript(const char* name) } PlayerScript::PlayerScript(const char* name) - : UnitScript(name) + : UnitScript(name, false) { ScriptRegistry<PlayerScript>::AddScript(this); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 17cc3844605..86cf321264e 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -395,7 +395,7 @@ class UnitScript : public ScriptObject { protected: - UnitScript(const char* name); + UnitScript(const char* name, bool addToScripts = true); public: // Called when DoT's Tick Damage is being Dealt @@ -599,7 +599,7 @@ class ConditionScript : public ScriptObject virtual bool OnConditionCheck(Condition* /*condition*/, ConditionSourceInfo& /*sourceInfo*/) { return true; } }; -class VehicleScript : public UnitScript +class VehicleScript : public ScriptObject { protected: diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index 198bce4a9fe..02ab1fde209 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -36,7 +36,7 @@ void CharacterDatabaseCleaner::CleanDatabase() uint32 oldMSTime = getMSTime(); // check flags which clean ups are necessary - QueryResult result = CharacterDatabase.Query("SELECT value FROM worldstates WHERE entry = 20004"); + QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE entry = %d", WS_CLEANING_FLAGS); if (!result) return; @@ -61,12 +61,11 @@ void CharacterDatabaseCleaner::CleanDatabase() // NOTE: In order to have persistentFlags be set in worldstates for the next cleanup, // you need to define them at least once in worldstates. flags &= sWorld->getIntConfig(CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS); - CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = 20004", flags); + CharacterDatabase.DirectPExecute("UPDATE worldstates SET value = %u WHERE entry = %d", flags, WS_CLEANING_FLAGS); sWorld->SetCleaningFlags(flags); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Cleaned character database in %u ms", GetMSTimeDiffToNow(oldMSTime)); - } void CharacterDatabaseCleaner::CheckUnique(const char* column, const char* table, bool (*check)(uint32)) diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 505ccd939c6..3158756cba5 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -487,11 +487,13 @@ enum RealmZone enum WorldStates { - WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time - WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time - WS_MONTHLY_QUEST_RESET_TIME = 20004, // Next monthly reset time - WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time - WS_GUILD_WEEKLY_RESET_TIME = 20007, // Next guild week reset time + WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time + WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time + WS_CLEANING_FLAGS = 20004, // Cleaning Flags + WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time + WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time + // Cata specific custom worldstates + WS_GUILD_WEEKLY_RESET_TIME = 20050, // Next guild week reset time }; /// Storage class for commands issued for delayed execution diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 9269bbb07ee..a57b06a8ab0 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -306,6 +306,9 @@ public: { handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); handler->SetSentErrorMessage(true); + sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %u (IP: %s) Character:[%s] (GUID: %u) Tried to change password.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow()); return false; } @@ -321,6 +324,9 @@ public: { case AOR_OK: handler->SendSysMessage(LANG_COMMAND_PASSWORD); + sLog->outInfo(LOG_FILTER_CHARACTER, "Account: %u (IP: %s) Character:[%s] (GUID: %u) Changed Password.", + handler->GetSession()->GetAccountId(), handler->GetSession()->GetRemoteAddress().c_str(), + handler->GetSession()->GetPlayer()->GetName().c_str(), handler->GetSession()->GetPlayer()->GetGUIDLow()); break; case AOR_PASS_TOO_LONG: handler->SendSysMessage(LANG_PASSWORD_TOO_LONG); diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 73fefe210df..4a08801c972 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -32,10 +32,11 @@ enum Midnight SAY_MIDNIGHT_KILL = 0, SAY_APPEAR = 1, SAY_MOUNT = 2, - SAY_KILL = 3, - SAY_DISARMED = 4, - SAY_DEATH = 5, - SAY_RANDOM = 6, + + SAY_KILL = 0, + SAY_DISARMED = 1, + SAY_DEATH = 2, + SAY_RANDOM = 3, SPELL_SHADOWCLEAVE = 29832, SPELL_INTANGIBLE_PRESENCE = 29833, diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp index 56d07a49dc4..2e70081fe87 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/CullingOfStratholme/boss_infinite.cpp @@ -27,9 +27,9 @@ enum Spells enum Yells { - SAY_AGGRO = -1595045, - SAY_FAIL = -1595046, - SAY_DEATH = -1595047 + SAY_AGGRO = 0, + SAY_DEATH = 1, + SAY_FAIL = 2 }; class boss_infinite_corruptor : public CreatureScript @@ -59,11 +59,12 @@ public: void EnterCombat(Unit* /*who*/) { + Talk(SAY_AGGRO); if (instance) instance->SetData(DATA_INFINITE_EVENT, IN_PROGRESS); } - void UpdateAI(const uint32 /*diff*/) + void UpdateAI(uint32 const /*diff*/) { //Return since we have no target if (!UpdateVictim()) @@ -74,6 +75,7 @@ public: void JustDied(Unit* /*killer*/) { + Talk(SAY_DEATH); if (instance) instance->SetData(DATA_INFINITE_EVENT, DONE); } diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp index 40d4d5d54b4..7dd395770db 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp @@ -29,7 +29,7 @@ EndScriptData */ enum Yells { - EMOTE_TARGET = -1509002 + EMOTE_TARGET = 0 }; class boss_buru : public CreatureScript diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp index 4abbf99d4ef..5f5b958fb9b 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp @@ -21,8 +21,8 @@ enum Texts { - EMOTE_AGGRO = -1509000, - EMOTE_MANA_FULL = -1509001 + EMOTE_AGGRO = 0, + EMOTE_MANA_FULL = 1 }; enum Spells diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp index da67f93f968..1ffd74eddf3 100644 --- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp +++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp @@ -23,22 +23,22 @@ enum Yells { // The time of our retribution is at hand! Let darkness reign in the hearts of our enemies! Sound: 8645 Emote: 35 - SAY_ANDOROV_INTRO = -1509003, // Before for the first wave - SAY_ANDOROV_ATTACK = -1509004, // Beginning the event - SAY_ANDOROV_WAVE_1 = -1509001, // When the first wave comes text: Kill first, ask questions later... Incoming! emote: 45 sound: 8653 - SAY_WAVE3 = -1509005, - SAY_WAVE4 = -1509006, - SAY_WAVE5 = -1509007, - SAY_WAVE6 = -1509008, - SAY_WAVE7 = -1509009, - SAY_INTRO = -1509010, - SAY_UNK1 = -1509011, - SAY_UNK2 = -1509012, - SAY_UNK3 = -1509013, - SAY_DEATH = -1509014, - SAY_CHANGEAGGRO = -1509015, - SAY_KILLS_ANDOROV = -1509016, - SAY_COMPLETE_QUEST = -1509017 // Yell when realm complete quest 8743 for world event + SAY_ANDOROV_INTRO = 0, // Before for the first wave + SAY_ANDOROV_ATTACK = 1, // Beginning the event + + SAY_WAVE3 = 0, + SAY_WAVE4 = 1, + SAY_WAVE5 = 2, + SAY_WAVE6 = 3, + SAY_WAVE7 = 4, + SAY_INTRO = 5, + SAY_UNK1 = 6, + SAY_UNK2 = 7, + SAY_UNK3 = 8, + SAY_DEATH = 9, + SAY_CHANGEAGGRO = 10, + SAY_KILLS_ANDOROV = 11, + SAY_COMPLETE_QUEST = 12 // Yell when realm complete quest 8743 for world event // Warriors, Captains, continue the fight! Sound: 8640 }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp index 1cb69689b67..c97f8a0495f 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp @@ -58,8 +58,6 @@ EndScriptData */ * - the current phase is stored in the instance data to be easily shared between the eye and cthun. */ -#define PI 3.14 - enum Phases { PHASE_NOT_STARTED = 0, @@ -76,24 +74,6 @@ enum Phases PHASE_CTHUN_DONE = 6, }; -enum Creatures -{ - MOB_CTHUN_PORTAL = 15896, - - // ***** Main Phase 1 ******** - BOSS_EYE_OF_CTHUN = 15589, - MOB_CLAW_TENTACLE = 15725, - MOB_EYE_TENTACLE = 15726, - MOB_SMALL_PORTAL = 15904, - - // ***** Main Phase 2 ******** - MOB_BODY_OF_CTHUN = 15809, - MOB_GIANT_CLAW_TENTACLE = 15728, - MOB_GIANT_EYE_TENTACLE = 15334, - MOB_FLESH_TENTACLE = 15802, - MOB_GIANT_PORTAL = 15910, -}; - enum Spells { // ***** Main Phase 1 ******** diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index d0e97bc36c8..0f575043da6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 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 @@ -16,18 +15,274 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Boss_Viscidus -SD%Complete: 0 -SDComment: place holder -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellInfo.h" +#include "temple_of_ahnqiraj.h" + +enum Spells +{ + SPELL_POISON_SHOCK = 25993, + SPELL_POISONBOLT_VOLLEY = 25991, + SPELL_TOXIN = 26575, + SPELL_VISCIDUS_SLOWED = 26034, + SPELL_VISCIDUS_SLOWED_MORE = 26036, + SPELL_VISCIDUS_FREEZE = 25937, + SPELL_REJOIN_VISCIDUS = 25896, + SPELL_VISCIDUS_EXPLODE = 25938, + SPELL_VISCIDUS_SUICIDE = 26003, + + SPELL_MEMBRANE_VISCIDUS = 25994, // damage reduction spell - removed from DBC + SPELL_VISCIDUS_WEAKNESS = 25926, // aura which procs at damage - should trigger the slow spells - removed from DBC + SPELL_VISCIDUS_SHRINKS = 25893, // (6) Apply Aura #61: Mod Scale Value: -4 - removed from DBC + SPELL_VISCIDUS_GROWS = 25897, // removed from DBC + SPELL_SUMMON_GLOBS = 25885, // summons npc 15667 using spells from 25865 to 25884; All spells have target coords - removed from DBC + SPELL_VISCIDUS_TELEPORT = 25904, // removed from DBC +}; + +enum Events +{ + EVENT_POISONBOLT_VOLLEY = 1, + EVENT_POISON_SHOCK = 2, + EVENT_RESET_PHASE = 3 +}; + +enum Phases +{ + PHASE_FROST = 1, + PHASE_MELEE = 2, + PHASE_GLOB = 3 +}; + +enum HitCounter +{ + HITCOUNTER_SLOW = 100, // "Viscidus begins to slow." + HITCOUNTER_SLOW_MORE = 150, // "Viscidus begins to freeze." + HITCOUNTER_FREEZE = 200, // "Viscidus is frozen solid." + + // 4.3.4 data + HITCOUNTER_CRACK = 50, // "Viscidus begins to crack." + HITCOUNTER_SHATTER = 100, // "Viscidus looks ready to shatter." + HITCOUNTER_EXPLODE = 150, // "Viscidus explodes." + + // 1.12 data + // HITCOUNTER_EXPLODE = 75 +}; + +enum MovePoints +{ + ROOM_CENTER = 1 +}; + +Position const ViscidusCoord = { -7992.36f, 908.19f, -52.62f, 1.68f }; // TODO: Visci ain't room middle +float const RoomRadius = 40.0f; // TODO: Not sure if its correct + +class boss_viscidus : public CreatureScript +{ + public: + boss_viscidus() : CreatureScript("boss_viscidus") { } + + struct boss_viscidusAI : public BossAI + { + boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { } + + void Reset() + { + _Reset(); + _hitcounter = 0; + _phase = PHASE_FROST; + } + + void DamageTaken(Unit* attacker, uint32& /*damage*/) + { + if (_phase != PHASE_MELEE) + return; + + ++_hitcounter; + + if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE) + { + events.Reset(); + _phase = PHASE_GLOB; + DoCast(me, SPELL_VISCIDUS_EXPLODE); + me->SetVisible(false); + me->RemoveAura(SPELL_TOXIN); + me->RemoveAura(SPELL_VISCIDUS_FREEZE); + + uint8 NumGlobes = me->GetHealthPct() / 5.0f; + for (uint8 i = 0; i < NumGlobes; ++i) + { + float Angle = i * 2 * M_PI / NumGlobes; + float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius; + float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius; + float Z = -35.0f; + + if (TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z)) + { + Glob->UpdateAllowedPositionZ(X, Y, Z); + Glob->NearTeleportTo(X, Y, Z, 0.0f); + Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord); + } + } + } + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f) + { + ++_hitcounter; + + if (_hitcounter >= HITCOUNTER_FREEZE) + { + _phase = PHASE_MELEE; + DoCast(me, SPELL_VISCIDUS_FREEZE); + me->RemoveAura(SPELL_VISCIDUS_SLOWED_MORE); + events.ScheduleEvent(EVENT_RESET_PHASE, 15000); + } + else if (_hitcounter >= HITCOUNTER_SLOW_MORE) + { + me->RemoveAura(SPELL_VISCIDUS_SLOWED); + DoCast(me, SPELL_VISCIDUS_SLOWED_MORE); + } + else if (_hitcounter >= HITCOUNTER_SLOW) + DoCast(me, SPELL_VISCIDUS_SLOWED); + } + } + + void EnterCombat(Unit* /*who*/) + { + _EnterCombat(); + events.Reset(); + InitSpells(); + } + + void InitSpells() + { + DoCast(me, SPELL_TOXIN); + events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000)); + events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000)); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void JustDied(Unit* /*killer*/) + { + DoCast(me, SPELL_VISCIDUS_SUICIDE); + summons.DespawnAll(); + } + + void UpdateAI(uint32 const diff) + { + if (!UpdateVictim()) + return; + + if (_phase == PHASE_GLOB && summons.empty()) + { + me->NearTeleportTo(ViscidusCoord.GetPositionX(), + ViscidusCoord.GetPositionY(), + ViscidusCoord.GetPositionZ(), + ViscidusCoord.GetOrientation()); + + _hitcounter = 0; + _phase = PHASE_FROST; + InitSpells(); + me->SetVisible(true); + } + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_POISONBOLT_VOLLEY: + DoCast(me, SPELL_POISONBOLT_VOLLEY); + events.ScheduleEvent(EVENT_POISONBOLT_VOLLEY, urand(10000, 15000)); + break; + case EVENT_POISON_SHOCK: + DoCast(me, SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_POISON_SHOCK, urand(7000, 12000)); + break; + case EVENT_RESET_PHASE: + _hitcounter = 0; + _phase = PHASE_FROST; + break; + default: + break; + } + } + + if (_phase != PHASE_GLOB) + DoMeleeAttackIfReady(); + } + + private: + uint8 _hitcounter; + Phases _phase; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new boss_viscidusAI(creature); + } +}; + +class npc_glob_of_viscidus : public CreatureScript +{ + public: + npc_glob_of_viscidus() : CreatureScript("boss_glob_of_viscidus") { } + + struct npc_glob_of_viscidusAI : public ScriptedAI + { + npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) { } + + void JustDied(Unit* /*killer*/) + { + InstanceScript* Instance = me->GetInstanceScript(); + if (!Instance) + return; + + if (Creature* Viscidus = me->GetMap()->GetCreature(Instance->GetData64(DATA_VISCIDUS))) + { + if (BossAI* ViscidusAI = dynamic_cast<BossAI*>(Viscidus->GetAI())) + ViscidusAI->SummonedCreatureDespawn(me); + + if (Viscidus->isAlive() && Viscidus->GetHealthPct() < 5.0f) + { + Viscidus->SetVisible(true); + Viscidus->getVictim()->Kill(Viscidus); + } + else + { + Viscidus->SetHealth(Viscidus->GetHealth() - Viscidus->GetMaxHealth() / 20); + Viscidus->SetObjectScale(Viscidus->GetFloatValue(OBJECT_FIELD_SCALE_X) - 0.05f); // TODO: Not sure if blizzlike + } + } + } -#define SPELL_POISON_SHOCK 25993 -#define SPELL_POISONBOLT_VOLLEY 25991 + void MovementInform(uint32 /*type*/, uint32 id) + { + if (id == ROOM_CENTER) + { + DoCast(me, SPELL_REJOIN_VISCIDUS); + ((TempSummon*)me)->UnSummon(); + } + } + }; -#define SPELL_TOXIN_CLOUD 25989 + CreatureAI* GetAI(Creature* creature) const + { + return new npc_glob_of_viscidusAI(creature); + } +}; +void AddSC_boss_viscidus() +{ + new boss_viscidus(); + new npc_glob_of_viscidus(); +} diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp index c8a1ff63925..3efdcd0dcf6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -29,71 +29,86 @@ EndScriptData */ class instance_temple_of_ahnqiraj : public InstanceMapScript { -public: - instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { } + public: + instance_temple_of_ahnqiraj() : InstanceMapScript("instance_temple_of_ahnqiraj", 531) { } - InstanceScript* GetInstanceScript(InstanceMap* map) const - { - return new instance_temple_of_ahnqiraj_InstanceMapScript(map); - } + InstanceScript* GetInstanceScript(InstanceMap* map) const + { + return new instance_temple_of_ahnqiraj_InstanceMapScript(map); + } - struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript - { - instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) {} + struct instance_temple_of_ahnqiraj_InstanceMapScript : public InstanceScript + { + instance_temple_of_ahnqiraj_InstanceMapScript(Map* map) : InstanceScript(map) {} - //If Vem is dead... - bool IsBossDied[3]; + //If Vem is dead... + bool IsBossDied[3]; - //Storing Skeram, Vem and Kri. - uint64 SkeramGUID; - uint64 VemGUID; - uint64 KriGUID; - uint64 VeklorGUID; - uint64 VeknilashGUID; + //Storing Skeram, Vem and Kri. + uint64 SkeramGUID; + uint64 VemGUID; + uint64 KriGUID; + uint64 VeklorGUID; + uint64 VeknilashGUID; + uint64 ViscidusGUID; - uint32 BugTrioDeathCount; + uint32 BugTrioDeathCount; - uint32 CthunPhase; + uint32 CthunPhase; - void Initialize() - { - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; + void Initialize() + { + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; - SkeramGUID = 0; - VemGUID = 0; - KriGUID = 0; - VeklorGUID = 0; - VeknilashGUID = 0; + SkeramGUID = 0; + VemGUID = 0; + KriGUID = 0; + VeklorGUID = 0; + VeknilashGUID = 0; + ViscidusGUID = 0; - BugTrioDeathCount = 0; + BugTrioDeathCount = 0; - CthunPhase = 0; - } + CthunPhase = 0; + } - void OnCreatureCreate(Creature* creature) - { - switch (creature->GetEntry()) + void OnCreatureCreate(Creature* creature) { - case 15263: SkeramGUID = creature->GetGUID(); break; - case 15544: VemGUID = creature->GetGUID(); break; - case 15511: KriGUID = creature->GetGUID(); break; - case 15276: VeklorGUID = creature->GetGUID(); break; - case 15275: VeknilashGUID = creature->GetGUID(); break; + switch (creature->GetEntry()) + { + case NPC_SKERAM: + SkeramGUID = creature->GetGUID(); + break; + case NPC_VEM: + VemGUID = creature->GetGUID(); + break; + case NPC_KRI: + KriGUID = creature->GetGUID(); + break; + case NPC_VEKLOR: + VeklorGUID = creature->GetGUID(); + break; + case NPC_VEKNILASH: + VeknilashGUID = creature->GetGUID(); + break; + case NPC_VISCIDUS: + ViscidusGUID = creature->GetGUID(); + break; + } } - } - bool IsEncounterInProgress() const - { - //not active in AQ40 - return false; - } + bool IsEncounterInProgress() const + { + //not active in AQ40 + return false; + } - uint32 GetData(uint32 type) const - { - switch (type) + uint32 GetData(uint32 type) const { + switch (type) + { case DATA_VEMISDEAD: if (IsBossDied[0]) return 1; @@ -114,14 +129,14 @@ public: case DATA_CTHUN_PHASE: return CthunPhase; + } + return 0; } - return 0; - } - uint64 GetData64(uint32 identifier) const - { - switch (identifier) + uint64 GetData64(uint32 identifier) const { + switch (identifier) + { case DATA_SKERAM: return SkeramGUID; case DATA_VEM: @@ -132,14 +147,16 @@ public: return VeklorGUID; case DATA_VEKNILASH: return VeknilashGUID; - } - return 0; - } // end GetData64 + case DATA_VISCIDUS: + return ViscidusGUID; + } + return 0; + } // end GetData64 - void SetData(uint32 type, uint32 data) - { - switch (type) + void SetData(uint32 type, uint32 data) { + switch (type) + { case DATA_VEM_DEATH: IsBossDied[0] = true; break; @@ -159,9 +176,9 @@ public: case DATA_CTHUN_PHASE: CthunPhase = data; break; + } } - } - }; + }; }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index 13c3d56d14c..f154ccf2c5d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -19,19 +19,45 @@ #ifndef DEF_TEMPLE_OF_AHNQIRAJ_H #define DEF_TEMPLE_OF_AHNQIRAJ_H -#define DATA_SKERAM 1 -#define DATA_KRI 2 -#define DATA_VEM 3 -#define DATA_VEMISDEAD 4 -#define DATA_VEM_DEATH 5 -#define DATA_VEKLOR 6 -#define DATA_VEKLORISDEAD 7 -#define DATA_VEKLOR_DEATH 8 -#define DATA_VEKNILASH 9 -#define DATA_VEKNILASHISDEAD 10 -#define DATA_VEKNILASH_DEATH 11 -#define DATA_BUG_TRIO_DEATH 14 +enum DataTypes +{ + DATA_SKERAM = 1, + DATA_KRI = 2, + DATA_VEM = 3, + DATA_VEMISDEAD = 4, + DATA_VEM_DEATH = 5, + DATA_VEKLOR = 6, + DATA_VEKLORISDEAD = 7, + DATA_VEKLOR_DEATH = 8, + DATA_VEKNILASH = 9, + DATA_VEKNILASHISDEAD = 10, + DATA_VEKNILASH_DEATH = 11, + DATA_BUG_TRIO_DEATH = 14, + DATA_CTHUN_PHASE = 20, + DATA_VISCIDUS = 21 +}; -#define DATA_CTHUN_PHASE 20 +enum Creatures +{ + BOSS_EYE_OF_CTHUN = 15589, + MOB_CTHUN_PORTAL = 15896, + MOB_CLAW_TENTACLE = 15725, + MOB_EYE_TENTACLE = 15726, + MOB_SMALL_PORTAL = 15904, + MOB_BODY_OF_CTHUN = 15809, + MOB_GIANT_CLAW_TENTACLE = 15728, + MOB_GIANT_EYE_TENTACLE = 15334, + MOB_FLESH_TENTACLE = 15802, + MOB_GIANT_PORTAL = 15910, + + NPC_VISCIDUS = 15299, + NPC_GLOB_OF_VISCIDUS = 15667, + + NPC_SKERAM = 15263, + NPC_VEM = 15544, + NPC_KRI = 15511, + NPC_VEKLOR = 15276, + NPC_VEKNILASH = 15275 +}; #endif diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index f0a1a61a5fd..bea556bdfa6 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -33,6 +33,9 @@ EndContentData */ #include "ScriptedGossip.h" #include "Player.h" #include "SpellInfo.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" /*###### ## npc_bunthen_plainswind @@ -315,6 +318,28 @@ public: } } + void IsSummonedBy(Unit* /*summoner*/) + { + std::list<Player*> playerOnQuestList; + Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); + Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(me, playerOnQuestList, checker); + me->VisitNearbyWorldObject(5.0f, searcher); + for (std::list<Player*>::const_iterator itr = playerOnQuestList.begin(); itr != playerOnQuestList.end(); ++itr) + { + // Check if found player target has active quest + if (Player* player = (*itr)) + { + if (player->GetQuestStatus(10965) == QUEST_STATUS_INCOMPLETE) + { + StartEvent(player); + break; + } + } + else + break; + } + } + void JustDied(Unit* /*killer*/) { if (!PlayerGUID) @@ -354,7 +379,7 @@ public: return; } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { npc_escortAI::UpdateAI(diff); @@ -529,30 +554,6 @@ public: }; /*#### -# npc_clintar_dreamwalker -####*/ - -enum Clintar -{ - CLINTAR_SPIRIT = 22916 -}; - -class npc_clintar_dreamwalker : public CreatureScript -{ -public: - npc_clintar_dreamwalker() : CreatureScript("npc_clintar_dreamwalker") { } - - bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) - { - if (quest->GetQuestId() == 10965) - if (Creature* clintar_spirit = creature->SummonCreature(CLINTAR_SPIRIT, ClintarSpiritSummon, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 100000)) - CAST_AI(npc_clintar_spirit::npc_clintar_spiritAI, clintar_spirit->AI())->StartEvent(player); - return true; - } - -}; - -/*#### # npc_omen ####*/ @@ -700,6 +701,10 @@ public: void AddSC_moonglade() { + new npc_bunthen_plainswind(); + new npc_great_bear_spirit(); + new npc_silva_filnaveth(); + new npc_clintar_spirit(); new npc_omen(); new npc_giant_spotlight(); } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 7fa476100d5..5617c69aea9 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -53,14 +53,16 @@ enum eUnits ENTRY_REINFORCED_FEL_IRON_CHEST_H = 185169 }; -enum eSays +enum Says { SAY_INTRO = 0, - SAY_WIPE = 1, - SAY_AGGRO = 2, - SAY_KILL = 3, - SAY_DIE = 4, - EMOTE = 5 + + SAY_WIPE = 0, + SAY_AGGRO = 1, + SAY_KILL = 2, + SAY_DIE = 3, + + EMOTE = 0 }; const float VazrudenMiddle[3] = {-1406.5f, 1746.5f, 81.2f}; diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index 4f48c311612..40cef99048f 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -274,6 +274,69 @@ class spell_hallow_end_tricky_treat : public SpellScriptLoader } }; +enum Mistletoe +{ + SPELL_CREATE_MISTLETOE = 26206, + SPELL_CREATE_HOLLY = 26207, + SPELL_CREATE_SNOWFLAKES = 45036 +}; + +class spell_winter_veil_mistletoe : public SpellScriptLoader +{ + public: + spell_winter_veil_mistletoe() : SpellScriptLoader("spell_winter_veil_mistletoe") { } + + class spell_winter_veil_mistletoe_SpellScript : public SpellScript + { + PrepareSpellScript(spell_winter_veil_mistletoe_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_MISTLETOE) || + !sSpellMgr->GetSpellInfo(SPELL_CREATE_HOLLY) || + !sSpellMgr->GetSpellInfo(SPELL_CREATE_SNOWFLAKES)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + if (Player* target = GetHitPlayer()) + { + uint32 spellId = 0; + switch (urand(0, 2)) + { + case 0: + spellId = SPELL_CREATE_MISTLETOE; + break; + case 1: + spellId = SPELL_CREATE_HOLLY; + break; + case 2: + spellId = SPELL_CREATE_SNOWFLAKES; + break; + default: + return; + } + + caster->CastSpell(target, spellId, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_winter_veil_mistletoe_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_winter_veil_mistletoe_SpellScript(); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -282,4 +345,6 @@ void AddSC_holiday_spell_scripts() new spell_hallow_end_trick(); new spell_hallow_end_trick_or_treat(); new spell_hallow_end_tricky_treat(); + // Winter Veil + new spell_winter_veil_mistletoe(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index da80ec8f1da..58b6fca8a81 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1432,7 +1432,7 @@ class spell_q11010_q11102_q11023_choose_loc : public SpellScriptLoader Unit* caster = GetCaster(); // Check for player that is in 65 y range std::list<Player*> playerList; - Trinity::AnyPlayerInObjectRangeCheck checker(caster, 765.0f); + Trinity::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(caster, playerList, checker); caster->VisitNearbyWorldObject(65.0f, searcher); for (std::list<Player*>::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 936052fd8ad..ebd56c2afe4 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -1586,49 +1586,6 @@ public: } }; -/*#### -## npc_winter_reveler -####*/ - -enum WinterReveler -{ - SPELL_MISTLETOE_DEBUFF = 26218, - SPELL_CREATE_MISTLETOE = 26206, - SPELL_CREATE_HOLLY = 26207, - SPELL_CREATE_SNOWFLAKES = 45036, -}; - -class npc_winter_reveler : public CreatureScript -{ - public: - npc_winter_reveler() : CreatureScript("npc_winter_reveler") { } - - struct npc_winter_revelerAI : public ScriptedAI - { - npc_winter_revelerAI(Creature* creature) : ScriptedAI(creature) {} - - void ReceiveEmote(Player* player, uint32 emote) - { - if (player->HasAura(SPELL_MISTLETOE_DEBUFF)) - return; - - if (!IsHolidayActive(HOLIDAY_FEAST_OF_WINTER_VEIL)) - return; - - if (emote == TEXT_EMOTE_KISS) - { - uint32 spellId = RAND<uint32>(SPELL_CREATE_MISTLETOE, SPELL_CREATE_HOLLY, SPELL_CREATE_SNOWFLAKES); - me->CastSpell(player, spellId, false); - me->CastSpell(player, SPELL_MISTLETOE_DEBUFF, false); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_winter_revelerAI(creature); - } -}; /*#### ## npc_snake_trap_serpents @@ -3039,7 +2996,6 @@ void AddSC_npcs_special() new npc_sayge(); new npc_steam_tonk(); new npc_tonk_mine(); - new npc_winter_reveler(); new npc_brewfest_reveler(); new npc_snake_trap(); new npc_mirror_image(); |