From 7be13b6fda29daf825e24bffe6095d0a987afce1 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 17 Dec 2012 11:44:41 +0100 Subject: Core/Scripts: Fixed crash on shutdown --- src/server/game/Scripting/ScriptMgr.cpp | 9 +++++---- src/server/game/Scripting/ScriptMgr.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index c7eebb0919e..3be9557e61e 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::AddScript(this); } -UnitScript::UnitScript(const char* name) +UnitScript::UnitScript(const char* name, bool addToScripts) : ScriptObject(name) { - ScriptRegistry::AddScript(this); + if (addToScripts) + ScriptRegistry::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::AddScript(this); } @@ -1497,7 +1498,7 @@ AchievementCriteriaScript::AchievementCriteriaScript(const char* name) } PlayerScript::PlayerScript(const char* name) - : UnitScript(name) + : UnitScript(name, false) { ScriptRegistry::AddScript(this); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index f603c76c8d3..785e5662156 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -396,7 +396,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 -- cgit v1.2.3 From 1297a93d90ecbbb1a8743462aed2370bd3b0b397 Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 17 Dec 2012 15:01:20 +0100 Subject: Core/Scipts: Missed changes from 7be13b6fda29daf825e24bffe6095d0a987afce1 --- src/server/game/Scripting/ScriptMgr.cpp | 2 +- src/server/game/Scripting/ScriptMgr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index 3be9557e61e..401b0e1728b 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -1474,7 +1474,7 @@ ConditionScript::ConditionScript(const char* name) } VehicleScript::VehicleScript(const char* name) - : UnitScript(name) + : ScriptObject(name) { ScriptRegistry::AddScript(this); } diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 785e5662156..0f6fd5d018b 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -600,7 +600,7 @@ class ConditionScript : public ScriptObject virtual bool OnConditionCheck(Condition* /*condition*/, ConditionSourceInfo& /*sourceInfo*/) { return true; } }; -class VehicleScript : public UnitScript +class VehicleScript : public ScriptObject { protected: -- cgit v1.2.3 From e90ec5608e8524f1c2dffac72c348b0cea406bfc Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 00:22:35 +0100 Subject: DB/Scripts: Implemented creature_text for Infinite Corruptor --- sql/updates/world/2012_12_18_00_world_creature_text.sql | 5 +++++ .../CavernsOfTime/CullingOfStratholme/boss_infinite.cpp | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 sql/updates/world/2012_12_18_00_world_creature_text.sql (limited to 'src/server') 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/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); } -- cgit v1.2.3 From 323989cc473ecda001ef2de528f69dca3da9bdf2 Mon Sep 17 00:00:00 2001 From: Trista Date: Tue, 18 Dec 2012 01:54:17 +0200 Subject: Core/Spells: Fix a typo in Bombing Run quests * no idea how this number left like this for so long unseen, good it filters 1 target --- src/server/scripts/Spells/spell_quest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') 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 playerList; - Trinity::AnyPlayerInObjectRangeCheck checker(caster, 765.0f); + Trinity::AnyPlayerInObjectRangeCheck checker(caster, 65.0f); Trinity::PlayerListSearcher searcher(caster, playerList, checker); caster->VisitNearbyWorldObject(65.0f, searcher); for (std::list::const_iterator itr = playerList.begin(); itr != playerList.end(); ++itr) -- cgit v1.2.3 From 8c286f2b61ffd5237d9f60fa9c0d8c493e4279bd Mon Sep 17 00:00:00 2001 From: Trista Date: Tue, 18 Dec 2012 02:01:49 +0200 Subject: Server/Quest: Convert quest_end_script and drop of some c++ * drop off c++ script of Clintan Dreamwalker ID: 22834 * convert quest_end_script of 10964 to SAI * rewrite and add bigger event support * add a checker to his summon so the spirit script can trigger event alone (I didn't try to rewrite next quest...) Closes: #8689 --- .../2012_12_18_00_world_waking_the_sleeper.sql | 47 +++++++++++++++++++++ src/server/scripts/Kalimdor/moonglade.cpp | 49 ++++++++++------------ 2 files changed, 70 insertions(+), 26 deletions(-) create mode 100644 sql/updates/world/2012_12_18_00_world_waking_the_sleeper.sql (limited to 'src/server') 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/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 9485048da8c..1296163178e 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -319,6 +319,28 @@ public: } } + void IsSummonedBy(Unit* /*summoner*/) + { + std::list playerOnQuestList; + Trinity::AnyPlayerInObjectRangeCheck checker(me, 5.0f); + Trinity::PlayerListSearcher searcher(me, playerOnQuestList, checker); + me->VisitNearbyWorldObject(5.0f, searcher); + for (std::list::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) @@ -358,7 +380,7 @@ public: return; } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { npc_escortAI::UpdateAI(diff); @@ -532,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 ####*/ @@ -707,7 +705,6 @@ void AddSC_moonglade() new npc_bunthen_plainswind(); new npc_great_bear_spirit(); new npc_silva_filnaveth(); - new npc_clintar_dreamwalker(); new npc_clintar_spirit(); new npc_omen(); new npc_giant_spotlight(); -- cgit v1.2.3 From 3f82ac9ea7e2367eeb52d5cbc6471f8d0d0f77ee Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 01:49:08 +0100 Subject: Core: Fix non pch build --- src/server/scripts/Kalimdor/moonglade.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/server') diff --git a/src/server/scripts/Kalimdor/moonglade.cpp b/src/server/scripts/Kalimdor/moonglade.cpp index 1296163178e..f438275b82a 100644 --- a/src/server/scripts/Kalimdor/moonglade.cpp +++ b/src/server/scripts/Kalimdor/moonglade.cpp @@ -37,6 +37,9 @@ EndContentData */ #include "ScriptedGossip.h" #include "Player.h" #include "SpellInfo.h" +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" /*###### ## npc_bunthen_plainswind -- cgit v1.2.3 From 5d77b10c3535a48d3bfd29e02242fa76f8281d21 Mon Sep 17 00:00:00 2001 From: Aokromes Name Date: Tue, 18 Dec 2012 01:57:04 +0100 Subject: Core/Account: Add logs for password change and fail change password --- src/server/scripts/Commands/cs_account.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server') 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); -- cgit v1.2.3 From bb93eb0f7e2dccafb2dd0510d1326828f94ce5ef Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 14:13:09 +0100 Subject: Core/Character: Fix logic fail with world state in b2928e59fa8334e91dfa1a5951fade5b574b5842 --- sql/updates/characters/2012_12_18_00_character_worldstates.sql | 4 ++++ src/server/game/Tools/CharacterDatabaseCleaner.cpp | 4 ++-- src/server/game/World/World.h | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 sql/updates/characters/2012_12_18_00_character_worldstates.sql (limited to 'src/server') 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..98fabde6776 --- /dev/null +++ b/sql/updates/characters/2012_12_18_00_character_worldstates.sql @@ -0,0 +1,4 @@ +DELETE FROM `worldstates` WHERE `entry` IN (20004,20007); +INSERT INTO `worldstates` (`entry`, `value`, `comment`) VALUES +(20004,0,'CleaningFlags'), +(20007,0,'NextMonthlyQuestResetTime'); diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index a342388f583..eaa5f814867 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -35,7 +35,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 = %u", WS_CLEANING_FLAGS); if (!result) return; @@ -60,7 +60,7 @@ 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 = %u", flags, WS_CLEANING_FLAGS); sWorld->SetCleaningFlags(flags); diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 1ac9b153dfd..c541945a1e4 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -471,8 +471,9 @@ 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_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 }; /// Storage class for commands issued for delayed execution -- cgit v1.2.3 From c75d274362ccba7071ddd32d78b678b70ebb0888 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 14:46:06 +0100 Subject: Core: Fix typos --- src/server/game/Globals/ObjectMgr.cpp | 5 ++--- src/server/game/Movement/MotionMaster.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 74423e2b362..70ac4aec4aa 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -1658,7 +1658,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; } @@ -1710,7 +1710,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; } @@ -1736,7 +1736,6 @@ void ObjectMgr::LoadGameobjects() if (!result) { 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; } -- cgit v1.2.3 From 9991f4ae2d1a2a10db6b6fb189cd33d777d5951d Mon Sep 17 00:00:00 2001 From: Mislav Blažević Date: Mon, 19 Nov 2012 17:22:22 +0100 Subject: Implement Viscidus AQ40 Signed-off-by: Nay --- src/server/game/Scripting/ScriptLoader.cpp | 2 + .../Kalimdor/TempleOfAhnQiraj/boss_cthun.cpp | 20 -- .../Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp | 278 ++++++++++++++++++++- .../instance_temple_of_ahnqiraj.cpp | 141 ++++++----- .../Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h | 55 +++- 5 files changed, 390 insertions(+), 106 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index b794d45423b..08b1495eb33 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -320,6 +320,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(); @@ -954,6 +955,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/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..4e6c1600ebd 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 - * Copyright (C) 2006-2009 ScriptDev2 * * 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,275 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Boss_Viscidus -SD%Complete: 0 -SDComment: place holder -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - #include "ScriptMgr.h" #include "ScriptedCreature.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) + { + Reset(); + } + + uint8 Hitcounter; + uint8 Phase; + + 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; + for (uint8 i = 0; i < NumGlobes; ++i) + { + float Angle = i * 2 * PI / NumGlobes; + float X = ViscidusCoord.GetPositionX() + std::cos(Angle) * RoomRadius; + float Y = ViscidusCoord.GetPositionY() + std::sin(Angle) * RoomRadius; + float Z = -35; + + TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z); + Glob->UpdateAllowedPositionZ(X, Y, Z); + Glob->NearTeleportTo(X, Y, Z, 0); + 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) + { + ++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(const uint32 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(); + } + }; + + 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(Viscidus->GetAI())) + ViscidusAI->SummonedCreatureDespawn(me); + + if (Viscidus->isAlive() && Viscidus->GetHealthPct() < 5) + { + 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..8eaa64ca81f 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) { + 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) { + 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..98895ee09d4 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -19,19 +19,48 @@ #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 +}; + +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 +}; + +#define PI 3.14 -#define DATA_CTHUN_PHASE 20 #endif -- cgit v1.2.3 From 40292d9a1997918c6fc7417daae8c3e57b93a0e9 Mon Sep 17 00:00:00 2001 From: Gacko Date: Tue, 18 Dec 2012 15:18:31 +0100 Subject: Core/DB: Assign texts to correct creatures Also convert some never used script texts to creature text for future use. Some scripts or Talk() calls need to be implemented first. Solves #8659 --- .../world/2012_12_18_01_world_creature_text.sql | 75 ++++++++++++++++++++++ .../EasternKingdoms/Karazhan/boss_midnight.cpp | 9 +-- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp | 2 +- .../scripts/Kalimdor/RuinsOfAhnQiraj/boss_moam.cpp | 4 +- .../Kalimdor/RuinsOfAhnQiraj/boss_rajaxx.cpp | 32 ++++----- .../HellfireRamparts/boss_vazruden_the_herald.cpp | 14 ++-- 6 files changed, 107 insertions(+), 29 deletions(-) create mode 100644 sql/updates/world/2012_12_18_01_world_creature_text.sql (limited to 'src/server') 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/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/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/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}; -- cgit v1.2.3 From 3e318686b0e954c44c5625fdc2bbda3fb6f82aec Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 15:33:15 +0100 Subject: Core: Fix non pch build --- src/server/game/Tools/CharacterDatabaseCleaner.cpp | 5 ++--- src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Tools/CharacterDatabaseCleaner.cpp b/src/server/game/Tools/CharacterDatabaseCleaner.cpp index eaa5f814867..0ec56dd17fd 100644 --- a/src/server/game/Tools/CharacterDatabaseCleaner.cpp +++ b/src/server/game/Tools/CharacterDatabaseCleaner.cpp @@ -35,7 +35,7 @@ void CharacterDatabaseCleaner::CleanDatabase() uint32 oldMSTime = getMSTime(); // check flags which clean ups are necessary - QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE entry = %u", WS_CLEANING_FLAGS); + QueryResult result = CharacterDatabase.PQuery("SELECT value FROM worldstates WHERE entry = %d", WS_CLEANING_FLAGS); if (!result) return; @@ -60,12 +60,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 = %u", flags, WS_CLEANING_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/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index 4e6c1600ebd..e86ea8daaee 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -17,6 +17,7 @@ #include "ScriptMgr.h" #include "ScriptedCreature.h" +#include "SpellInfo.h" #include "temple_of_ahnqiraj.h" enum Spells -- cgit v1.2.3 From c364c367b1682f8f587fe2ca48dc9affb26cbfa0 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 19:16:00 +0100 Subject: Core/Script: Fix some codestyle and warnings --- .../Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp | 144 ++++++++++----------- .../Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h | 7 +- 2 files changed, 73 insertions(+), 78 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index e86ea8daaee..0f575043da6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -31,7 +31,7 @@ enum Spells 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 @@ -41,7 +41,7 @@ enum Spells }; enum Events -{ +{ EVENT_POISONBOLT_VOLLEY = 1, EVENT_POISON_SHOCK = 2, EVENT_RESET_PHASE = 3 @@ -56,14 +56,14 @@ enum Phases enum HitCounter { - HITCOUNTER_SLOW = 100, // "Viscidus begins to slow." - HITCOUNTER_SLOW_MORE = 150, // "Viscidus begins to freeze." - HITCOUNTER_FREEZE = 200, // "Viscidus is frozen solid." + 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." + 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 @@ -84,72 +84,68 @@ class boss_viscidus : public CreatureScript struct boss_viscidusAI : public BossAI { - boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) - { - Reset(); - } - - uint8 Hitcounter; - uint8 Phase; + boss_viscidusAI(Creature* creature) : BossAI(creature, DATA_VISCIDUS) { } void Reset() { _Reset(); - Hitcounter = 0; - Phase = PHASE_FROST; + _hitcounter = 0; + _phase = PHASE_FROST; } - void DamageTaken(Unit* attacker, uint32& damage) - { - if (Phase != PHASE_MELEE) + void DamageTaken(Unit* attacker, uint32& /*damage*/) + { + if (_phase != PHASE_MELEE) return; - - ++Hitcounter; - - if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && Hitcounter >= HITCOUNTER_EXPLODE) + + ++_hitcounter; + + if (attacker->HasUnitState(UNIT_STATE_MELEE_ATTACKING) && _hitcounter >= HITCOUNTER_EXPLODE) { events.Reset(); - Phase = PHASE_GLOB; + _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; + uint8 NumGlobes = me->GetHealthPct() / 5.0f; for (uint8 i = 0; i < NumGlobes; ++i) { - float Angle = i * 2 * PI / NumGlobes; + 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; + float Z = -35.0f; - TempSummon* Glob = me->SummonCreature(NPC_GLOB_OF_VISCIDUS, X, Y, Z); - Glob->UpdateAllowedPositionZ(X, Y, Z); - Glob->NearTeleportTo(X, Y, Z, 0); - Glob->GetMotionMaster()->MovePoint(ROOM_CENTER, ViscidusCoord); + 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) + if ((spell->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) && _phase == PHASE_FROST && me->GetHealthPct() > 5.0f) { - ++Hitcounter; + ++_hitcounter; - if (Hitcounter >= HITCOUNTER_FREEZE) + if (_hitcounter >= HITCOUNTER_FREEZE) { - Phase = PHASE_MELEE; + _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) + else if (_hitcounter >= HITCOUNTER_SLOW_MORE) { me->RemoveAura(SPELL_VISCIDUS_SLOWED); DoCast(me, SPELL_VISCIDUS_SLOWED_MORE); } - else if (Hitcounter >= HITCOUNTER_SLOW) + else if (_hitcounter >= HITCOUNTER_SLOW) DoCast(me, SPELL_VISCIDUS_SLOWED); } } @@ -160,7 +156,7 @@ class boss_viscidus : public CreatureScript events.Reset(); InitSpells(); } - + void InitSpells() { DoCast(me, SPELL_TOXIN); @@ -173,61 +169,66 @@ class boss_viscidus : public CreatureScript summons.DespawnAll(); ScriptedAI::EnterEvadeMode(); } - + void JustDied(Unit* /*killer*/) { DoCast(me, SPELL_VISCIDUS_SUICIDE); summons.DespawnAll(); } - void UpdateAI(const uint32 diff) + void UpdateAI(uint32 const diff) { if (!UpdateVictim()) return; - - if (Phase == PHASE_GLOB && summons.empty()) + + if (_phase == PHASE_GLOB && summons.empty()) { me->NearTeleportTo(ViscidusCoord.GetPositionX(), - ViscidusCoord.GetPositionY(), - ViscidusCoord.GetPositionZ(), - ViscidusCoord.GetOrientation()); - Hitcounter = 0; - Phase = PHASE_FROST; + 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; + 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) + if (_phase != PHASE_GLOB) DoMeleeAttackIfReady(); } + + private: + uint8 _hitcounter; + Phases _phase; }; CreatureAI* GetAI(Creature* creature) const { - return new boss_viscidusAI (creature); + return new boss_viscidusAI(creature); } }; @@ -238,23 +239,20 @@ class npc_glob_of_viscidus : public CreatureScript struct npc_glob_of_viscidusAI : public ScriptedAI { - npc_glob_of_viscidusAI(Creature* creature) : ScriptedAI(creature) - { - } + 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(Viscidus->GetAI())) ViscidusAI->SummonedCreatureDespawn(me); - - if (Viscidus->isAlive() && Viscidus->GetHealthPct() < 5) + + if (Viscidus->isAlive() && Viscidus->GetHealthPct() < 5.0f) { Viscidus->SetVisible(true); Viscidus->getVictim()->Kill(Viscidus); @@ -279,7 +277,7 @@ class npc_glob_of_viscidus : public CreatureScript CreatureAI* GetAI(Creature* creature) const { - return new npc_glob_of_viscidusAI (creature); + return new npc_glob_of_viscidusAI(creature); } }; diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h index 98895ee09d4..f154ccf2c5d 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/temple_of_ahnqiraj.h @@ -49,18 +49,15 @@ enum Creatures 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 }; - -#define PI 3.14 - #endif -- cgit v1.2.3 From bcff526d28abbaf7344696304bbb27bc420ed85a Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 19:31:41 +0100 Subject: Core/Script: Add missing changes in c364c367b1682f8f587fe2ca48dc9affb26cbfa0 --- .../scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') 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 8eaa64ca81f..3efdcd0dcf6 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/instance_temple_of_ahnqiraj.cpp @@ -105,7 +105,7 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript return false; } - uint32 GetData(uint32 type) + uint32 GetData(uint32 type) const { switch (type) { @@ -133,7 +133,7 @@ class instance_temple_of_ahnqiraj : public InstanceMapScript return 0; } - uint64 GetData64(uint32 identifier) + uint64 GetData64(uint32 identifier) const { switch (identifier) { -- cgit v1.2.3 From 3cf260068809c504c1c5921f27d1f55cc9a75231 Mon Sep 17 00:00:00 2001 From: MrSmite Date: Tue, 18 Dec 2012 21:34:02 +0100 Subject: Core/AuctionHouse: Fix a possible auctionhouse crash --- src/server/game/AI/CoreAI/PetAI.cpp | 5 ++++- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 8 ++++---- src/server/game/AuctionHouse/AuctionHouseMgr.h | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 6 ++---- 4 files changed, 11 insertions(+), 10 deletions(-) (limited to 'src/server') diff --git a/src/server/game/AI/CoreAI/PetAI.cpp b/src/server/game/AI/CoreAI/PetAI.cpp index 6f7338e0e6f..78c22e74f44 100644 --- a/src/server/game/AI/CoreAI/PetAI.cpp +++ b/src/server/game/AI/CoreAI/PetAI.cpp @@ -182,8 +182,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) { @@ -267,6 +269,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 4738d8f6f27..206e4e4bb04 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -411,7 +411,7 @@ void AuctionHouseObject::AddAuction(AuctionEntry* auction) sScriptMgr->OnAuctionAdd(this, auction); } -bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*itemEntry*/) +bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction) { bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false; @@ -419,6 +419,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; } @@ -465,14 +467,12 @@ void AuctionHouseObject::Update() sScriptMgr->OnAuctionSuccessful(this, auction); } - uint32 itemEntry = auction->itemEntry; - ///- In any case clear the auction auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); - RemoveAuction(auction, itemEntry); sAuctionMgr->RemoveAItem(auction->itemGUIDLow); + RemoveAuction(auction); } while (result->NextRow()); } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index e13b4665b7b..0aa97210271 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -118,7 +118,7 @@ class AuctionHouseObject void AddAuction(AuctionEntry* auction); - bool RemoveAuction(AuctionEntry* auction, uint32 itemEntry); + bool RemoveAuction(AuctionEntry* auction); void Update(); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 3c38ff8460e..26e19a3ad87 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -473,9 +473,8 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) auction->DeleteFromDB(trans); - uint32 itemEntry = auction->itemEntry; sAuctionMgr->RemoveAItem(auction->itemGUIDLow); - auctionHouse->RemoveAuction(auction, itemEntry); + auctionHouse->RemoveAuction(auction); } player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); @@ -553,9 +552,8 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData) auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); - uint32 itemEntry = auction->itemEntry; sAuctionMgr->RemoveAItem(auction->itemGUIDLow); - auctionHouse->RemoveAuction(auction, itemEntry); + auctionHouse->RemoveAuction(auction); } //called when player lists his bids -- cgit v1.2.3 From 7dd019e7bbfc10d125ceaf232c3ead8c1ac99f6f Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 18 Dec 2012 22:27:48 +0100 Subject: Misc/Script: Convert winter veil mistletoe event in sai --- sql/updates/world/2012_12_18_02_world_misc.sql | 14 ++++++ src/server/scripts/Spells/spell_holiday.cpp | 65 ++++++++++++++++++++++++++ src/server/scripts/World/npcs_special.cpp | 44 ----------------- 3 files changed, 79 insertions(+), 44 deletions(-) create mode 100644 sql/updates/world/2012_12_18_02_world_misc.sql (limited to 'src/server') 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/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/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 59ab9cd61e7..36657dc76c3 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(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(); -- cgit v1.2.3 From 28dffbee11024c1abc82a29a3fef655d9262904b Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 18 Dec 2012 23:24:54 +0000 Subject: Core/AuctionHouse: Partially revert 3cf260068809 to keep compatibility with the "AHBot patch" Note: Trinity needs/wants an auction house bot in the core but for that to happen AHBot needs to be rewritten (possibly using Mango's implementation as a base) --- src/server/game/AuctionHouse/AuctionHouseMgr.cpp | 6 ++++-- src/server/game/AuctionHouse/AuctionHouseMgr.h | 2 +- src/server/game/Handlers/AuctionHouseHandler.cpp | 6 ++++-- 3 files changed, 9 insertions(+), 5 deletions(-) (limited to 'src/server') diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index 206e4e4bb04..161c4a578ce 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -411,7 +411,7 @@ void AuctionHouseObject::AddAuction(AuctionEntry* auction) sScriptMgr->OnAuctionAdd(this, auction); } -bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction) +bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*itemEntry*/) { bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false; @@ -467,12 +467,14 @@ void AuctionHouseObject::Update() sScriptMgr->OnAuctionSuccessful(this, auction); } + uint32 itemEntry = auction->itemEntry; + ///- In any case clear the auction auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); sAuctionMgr->RemoveAItem(auction->itemGUIDLow); - RemoveAuction(auction); + RemoveAuction(auction, itemEntry); } while (result->NextRow()); } diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.h b/src/server/game/AuctionHouse/AuctionHouseMgr.h index 0aa97210271..e13b4665b7b 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.h +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.h @@ -118,7 +118,7 @@ class AuctionHouseObject void AddAuction(AuctionEntry* auction); - bool RemoveAuction(AuctionEntry* auction); + bool RemoveAuction(AuctionEntry* auction, uint32 itemEntry); void Update(); diff --git a/src/server/game/Handlers/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 26e19a3ad87..3c38ff8460e 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -473,8 +473,9 @@ void WorldSession::HandleAuctionPlaceBid(WorldPacket& recvData) auction->DeleteFromDB(trans); + uint32 itemEntry = auction->itemEntry; sAuctionMgr->RemoveAItem(auction->itemGUIDLow); - auctionHouse->RemoveAuction(auction); + auctionHouse->RemoveAuction(auction, itemEntry); } player->SaveInventoryAndGoldToDB(trans); CharacterDatabase.CommitTransaction(trans); @@ -552,8 +553,9 @@ void WorldSession::HandleAuctionRemoveItem(WorldPacket& recvData) auction->DeleteFromDB(trans); CharacterDatabase.CommitTransaction(trans); + uint32 itemEntry = auction->itemEntry; sAuctionMgr->RemoveAItem(auction->itemGUIDLow); - auctionHouse->RemoveAuction(auction); + auctionHouse->RemoveAuction(auction, itemEntry); } //called when player lists his bids -- cgit v1.2.3