From 8f9dad3d7637a18a5e3cc96dfe32826c810f17b3 Mon Sep 17 00:00:00 2001 From: thesensei Date: Tue, 28 Aug 2012 20:58:03 +0300 Subject: Core/Spells: Destabilize Azure Dragonshrine *Spell script support for spell 49370 --- sql/updates/world/2012_08_28_00_world_spell_script_name.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2012_08_28_00_world_spell_script_name.sql (limited to 'sql') diff --git a/sql/updates/world/2012_08_28_00_world_spell_script_name.sql b/sql/updates/world/2012_08_28_00_world_spell_script_name.sql new file mode 100644 index 00000000000..9cc18a4fa5a --- /dev/null +++ b/sql/updates/world/2012_08_28_00_world_spell_script_name.sql @@ -0,0 +1,4 @@ +-- Spell script name linking for Defending Wyrmrest Temple: Destabilize Azure Dragonshrine Effect +DELETE FROM `spell_script_names` WHERE `spell_id`=49370 ; +INSERT INTO `spell_script_names` VALUES +(49370,'spell_q12372_destabilize_azure_dragonshrine_dummy'); \ No newline at end of file -- cgit v1.2.3 From d6221fc4f7a08fe09e7c8bb9226b0168db358450 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 28 Aug 2012 19:31:15 +0100 Subject: Scripts: Fix code style after PR --- .../world/2012_08_28_00_world_spell_script_name.sql | 2 +- src/server/scripts/Spells/spell_quest.cpp | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2012_08_28_00_world_spell_script_name.sql b/sql/updates/world/2012_08_28_00_world_spell_script_name.sql index 9cc18a4fa5a..01cfeb35f1f 100644 --- a/sql/updates/world/2012_08_28_00_world_spell_script_name.sql +++ b/sql/updates/world/2012_08_28_00_world_spell_script_name.sql @@ -1,4 +1,4 @@ -- Spell script name linking for Defending Wyrmrest Temple: Destabilize Azure Dragonshrine Effect DELETE FROM `spell_script_names` WHERE `spell_id`=49370 ; INSERT INTO `spell_script_names` VALUES -(49370,'spell_q12372_destabilize_azure_dragonshrine_dummy'); \ No newline at end of file +(49370,'spell_q12372_destabilize_azure_dragonshrine_dummy'); diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 759dbfe802d..3cb2300cadf 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1278,7 +1278,7 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader // http://www.wowhead.com/quest=12372 Defending Wyrmrest Temple // 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect -enum eQuest12372Data +enum Quest12372Data { NPC_WYRMREST_TEMPLE_CREDIT = 27698, }; @@ -1294,16 +1294,14 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad void HandleDummy(SpellEffIndex /*effIndex*/) { - if (GetHitCreature()) - { - if (Unit* caster = GetOriginalCaster()) - if (Vehicle* vehicle = caster->GetVehicleKit()) - if (Unit* passenger = vehicle->GetPassenger(0)) - if (Player* player = passenger->ToPlayer()) - player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT, 0); - } - } - + if (GetHitCreature()) + if (Unit* caster = GetOriginalCaster()) + if (Vehicle* vehicle = caster->GetVehicleKit()) + if (Unit* passenger = vehicle->GetPassenger(0)) + if (Player* player = passenger->ToPlayer()) + player->KilledMonsterCredit(NPC_WYRMREST_TEMPLE_CREDIT, 0); + } + void Register() { OnEffectHitTarget += SpellEffectFn(spell_q12372_destabilize_azure_dragonshrine_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); -- cgit v1.2.3 From 4225803587171b76ada439c5e27e3c410aa4fe02 Mon Sep 17 00:00:00 2001 From: Vincent-Michael Date: Tue, 28 Aug 2012 21:13:37 +0200 Subject: DB/Achievements: Fix achievements 'Koralon the Flame Watcher' / 'Toravon the Ice Watcher' --- sql/updates/world/2012_08_28_01_world_achievement_criteria_data.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2012_08_28_01_world_achievement_criteria_data.sql (limited to 'sql') diff --git a/sql/updates/world/2012_08_28_01_world_achievement_criteria_data.sql b/sql/updates/world/2012_08_28_01_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..bf247399553 --- /dev/null +++ b/sql/updates/world/2012_08_28_01_world_achievement_criteria_data.sql @@ -0,0 +1,6 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (11478,11479,12827,12828); +INSERT INTO `achievement_criteria_data` (`criteria_id`, `type`, `value1`, `value2`, `ScriptName`) VALUES +(11478, 12, 0, 0, ''), -- Koralon the Flame Watcher (10 player) +(11479, 12, 1, 0, ''), -- Koralon the Flame Watcher (25 player) +(12827, 12, 0, 0, ''), -- Toravon the Ice Watcher (10 player) +(12828, 12, 1, 0, ''); -- Toravon the Ice Watcher (25 player) -- cgit v1.2.3 From db7b750e0c33bf75ef6943a9da149cfbb8f6f2d1 Mon Sep 17 00:00:00 2001 From: Myran2 Date: Fri, 31 Aug 2012 01:26:21 +0100 Subject: Scripts/Commands: Create a new group of commands, .cheat, and add new and move old commands to it: Changes: - .explorecheat is now .cheat explore - .waterwalk is now .cheat waterwalk - .taxicheat is now .cheat taxi New commands: - .cheat god - .cheat casttime - .cheat cooldown - .cheat power (Descriptions available in the SQL file / in-game) Inspiration on ArcEmu commands Closes #7569 --- sql/updates/world/2012_8_29_00_world_command.sql | 14 ++ src/server/game/Entities/Player/Player.cpp | 2 + src/server/game/Entities/Player/Player.h | 17 ++ src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Spells/Spell.cpp | 23 ++ src/server/scripts/Commands/CMakeLists.txt | 1 + src/server/scripts/Commands/cs_cheat.cpp | 281 +++++++++++++++++++++++ src/server/scripts/Commands/cs_misc.cpp | 118 ---------- 8 files changed, 340 insertions(+), 118 deletions(-) create mode 100644 sql/updates/world/2012_8_29_00_world_command.sql create mode 100644 src/server/scripts/Commands/cs_cheat.cpp (limited to 'sql') diff --git a/sql/updates/world/2012_8_29_00_world_command.sql b/sql/updates/world/2012_8_29_00_world_command.sql new file mode 100644 index 00000000000..c0686d6d907 --- /dev/null +++ b/sql/updates/world/2012_8_29_00_world_command.sql @@ -0,0 +1,14 @@ +DELETE FROM `command` WHERE `name`='explorecheat'; +DELETE FROM `command` WHERE `name`='taxicheat'; +DELETE FROM `command` WHERE `name`='waterwalk'; + +DELETE FROM `command` WHERE `name`='cheat' OR `name` LIKE 'cheat%'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('cheat', 2, 'Syntax: .cheat $subcommand\r\nType .cheat to see the list of possible subcommands or .help cheat $subcommand to see info on subcommands'), +('cheat god', 2, 'Syntax: .cheat god [on/off]\r\nEnables or disables your character''s ability to take damage.'), +('cheat casttime', 2, 'Syntax: .cheat casttime [on/off]\r\nEnables or disables your character''s spell cast times.'), +('cheat cooldown', 2, 'Syntax: .cheat cooldown [on/off]\r\nEnables or disables your character''s spell cooldowns.'), +('cheat power', 2, 'Syntax: .cheat power [on/off]\r\nEnables or disables your character''s spell cost (e.g mana).'), +('cheat waterwalk', 2, 'Syntax: .cheat waterwalk on/off\r\nSet on/off waterwalk state for selected player or self if no player selected.'), +('cheat explore', 2, 'Syntax: .cheat explore #flag\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'), +('cheat taxi', 2, 'Syntax: .cheat taxi on/off\r\nTemporary grant access or remove to all taxi routes for the selected character.\r\n If no character is selected, hide or reveal all routes to you.Visited taxi nodes sill accessible after removing access.'); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 936788f484e..65f6588f80e 100755 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -861,6 +861,8 @@ Player::Player(WorldSession* session): Unit(true), m_achievementMgr(this), m_rep m_SeasonalQuestChanged = false; SetPendingBind(0, 0); + + _activeCheats = CHEAT_NONE; } Player::~Player() diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 1758b915ebf..71915f42784 100755 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -896,6 +896,16 @@ enum PlayerRestState REST_STATE_RAF_LINKED = 0x06 }; +enum PlayerCommandStates +{ + CHEAT_NONE = 0x00, + CHEAT_GOD = 0x01, + CHEAT_CASTTIME = 0x02, + CHEAT_COOLDOWN = 0x04, + CHEAT_POWER = 0x08, + CHEAT_WATERWALK = 0x10 +}; + class PlayerTaxi { public: @@ -1148,6 +1158,11 @@ class Player : public Unit, public GridObject void InitStatsForLevel(bool reapplyMods = false); + // .cheat command related + bool GetCommandStatus(uint32 command) const { return _activeCheats & command; } + void SetCommandStatusOn(uint32 command) { _activeCheats |= command; } + void SetCommandStatusOff(uint32 command) { _activeCheats &= ~command; } + // Played Time Stuff time_t m_logintime; time_t m_Last_tick; @@ -2854,6 +2869,8 @@ class Player : public Unit, public GridObject InstanceTimeMap _instanceResetTimes; uint32 _pendingBindId; uint32 _pendingBindTimer; + + uint32 _activeCheats; }; void AddItemsSetItem(Player*player, Item* item); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 9d983542fea..1848250ec8e 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -50,6 +50,7 @@ void AddSC_ban_commandscript(); void AddSC_bf_commandscript(); void AddSC_cast_commandscript(); void AddSC_character_commandscript(); +void AddSC_cheat_commandscript(); void AddSC_debug_commandscript(); void AddSC_disable_commandscript(); void AddSC_event_commandscript(); @@ -666,6 +667,7 @@ void AddCommandScripts() AddSC_bf_commandscript(); AddSC_cast_commandscript(); AddSC_character_commandscript(); + AddSC_cheat_commandscript(); AddSC_debug_commandscript(); AddSC_disable_commandscript(); AddSC_event_commandscript(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 19741ea7854..95345ed8b93 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -3023,7 +3023,13 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered // calculate cast time (calculated after first CheckCast check to prevent charge counting for first CheckCast fail) m_casttime = m_spellInfo->CalcCastTime(m_caster, this); if (m_caster->GetTypeId() == TYPEID_PLAYER) + { m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + + // Set casttime to 0 if .cheat casttime is enabled. + if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_CASTTIME)) + m_casttime = 0; + } // don't allow channeled spells / spells with cast time to be casted while moving // (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in) @@ -3315,7 +3321,13 @@ void Spell::cast(bool skipCheck) } if (m_caster->GetTypeId() == TYPEID_PLAYER) + { m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); + + //Clear spell cooldowns after every spell is cast if .cheat cooldown is enabled. + if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN)) + m_caster->ToPlayer()->RemoveSpellCooldown(m_spellInfo->Id, true); + } SetExecutedCurrently(false); } @@ -4358,6 +4370,13 @@ void Spell::TakePower() if (m_CastItem || m_triggeredByAuraSpell) return; + //Don't take power if the spell is cast while .cheat power is enabled. + if (m_caster->GetTypeId() == TYPEID_PLAYER) + { + if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_POWER)) + return; + } + Powers powerType = Powers(m_spellInfo->PowerType); bool hit = true; if (m_caster->GetTypeId() == TYPEID_PLAYER) @@ -7193,6 +7212,10 @@ void Spell::TriggerGlobalCooldown() if (!gcd) return; + if (m_caster->GetTypeId() == TYPEID_PLAYER) + if (m_caster->ToPlayer()->GetCommandStatus(CHEAT_COOLDOWN)) + return; + // Global cooldown can't leave range 1..1.5 secs // There are some spells (mostly not casted directly by player) that have < 1 sec and > 1.5 sec global cooldowns // but as tests show are not affected by any spell mods. diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index d5ebeab3b8a..177b3a479f5 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -16,6 +16,7 @@ set(scripts_STAT_SRCS Commands/cs_bf.cpp Commands/cs_cast.cpp Commands/cs_character.cpp + Commands/cs_cheat.cpp Commands/cs_debug.cpp Commands/cs_disable.cpp Commands/cs_event.cpp diff --git a/src/server/scripts/Commands/cs_cheat.cpp b/src/server/scripts/Commands/cs_cheat.cpp new file mode 100644 index 00000000000..ade1b9fae02 --- /dev/null +++ b/src/server/scripts/Commands/cs_cheat.cpp @@ -0,0 +1,281 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: cheat_commandscript +%Complete: 100 +Comment: All cheat related commands +Category: commandscripts +EndScriptData */ + +#include "ScriptMgr.h" +#include "ObjectMgr.h" +#include "Chat.h" + +class cheat_commandscript : public CommandScript +{ +public: + cheat_commandscript() : CommandScript("cheat_commandscript") { } + + ChatCommand* GetCommands() const + { + + static ChatCommand cheatCommandTable[] = + { + { "god", SEC_GAMEMASTER, false, &HandleGodModeCheatCommand, "", NULL }, + { "casttime", SEC_GAMEMASTER, false, &HandleCasttimeCheatCommand, "", NULL }, + { "cooldown", SEC_GAMEMASTER, false, &HandleCoolDownCheatCommand, "", NULL }, + { "power", SEC_GAMEMASTER, false, &HandlePowerCheatCommand, "", NULL }, + { "waterwalk", SEC_GAMEMASTER, false, &HandleWaterWalkCheatCommand, "", NULL }, + { "taxi", SEC_GAMEMASTER, false, &HandleTaxiCheatCommand, "", NULL }, + { "explore", SEC_GAMEMASTER, false, &HandleExploreCheatCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + + }; + + static ChatCommand commandTable[] = + { + { "cheat", SEC_GAMEMASTER, false, NULL, "", cheatCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleGodModeCheatCommand(ChatHandler* handler, const char* args) + { + if (!handler->GetSession() && !handler->GetSession()->GetPlayer()) + return false; + + std::string argstr = (char*)args; + + if (!*args) + argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_GOD)) ? "off" : "on"; + + if (argstr == "off") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_GOD); + handler->SendSysMessage("Godmode is OFF. You can take damage."); + return true; + } + else if (argstr == "on") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_GOD); + handler->SendSysMessage("Godmode is ON. You won't take damage."); + return true; + } + + return false; + } + + static bool HandleCasttimeCheatCommand(ChatHandler* handler, const char* args) + { + if (!handler->GetSession() && !handler->GetSession()->GetPlayer()) + return false; + + std::string argstr = (char*)args; + + if (!*args) + argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_CASTTIME)) ? "off" : "on"; + + if (argstr == "off") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_CASTTIME); + handler->SendSysMessage("CastTime Cheat is OFF. Your spells will have a casttime."); + return true; + } + else if (argstr == "on") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_CASTTIME); + handler->SendSysMessage("CastTime Cheat is ON. Your spells won't have a casttime."); + return true; + } + + return false; + } + + static bool HandleCoolDownCheatCommand(ChatHandler* handler, const char* args) + { + if (!handler->GetSession() && !handler->GetSession()->GetPlayer()) + return false; + + std::string argstr = (char*)args; + + if (!*args) + argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_COOLDOWN)) ? "off" : "on"; + + if (argstr == "off") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_COOLDOWN); + handler->SendSysMessage("Cooldown Cheat is OFF. You are on the global cooldown."); + return true; + } + else if (argstr == "on") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_COOLDOWN); + handler->SendSysMessage("Cooldown Cheat is ON. You are not on the global cooldown."); + return true; + } + + return false; + } + + static bool HandlePowerCheatCommand(ChatHandler* handler, const char* args) + { + if (!handler->GetSession() && !handler->GetSession()->GetPlayer()) + return false; + + std::string argstr = (char*)args; + + if (!*args) + argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_POWER)) ? "off" : "on"; + + if (argstr == "off") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_POWER); + handler->SendSysMessage("Power Cheat is OFF. You need mana/rage/energy to use spells."); + return true; + } + else if (argstr == "on") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_POWER); + handler->SendSysMessage("Power Cheat is ON. You don't need mana/rage/energy to use spells."); + return true; + } + + return false; + } + + static bool HandleWaterWalkCheatCommand(ChatHandler* handler, const char* args) + { + if (!handler->GetSession() && !handler->GetSession()->GetPlayer()) + return false; + + std::string argstr = (char*)args; + + if (!*args) + { + argstr = (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK)) ? "off" : "on"; + if (handler->GetSession()->GetPlayer()->GetCommandStatus(CHEAT_WATERWALK)) + argstr = "off"; + else + argstr = "on"; + } + + if (argstr == "off") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOff(CHEAT_WATERWALK); + handler->GetSession()->GetPlayer()->SetMovement(MOVE_LAND_WALK); // OFF + handler->SendSysMessage("Waterwalking is OFF. You can't walk on water."); + return true; + } + else if (argstr == "on") + { + handler->GetSession()->GetPlayer()->SetCommandStatusOn(CHEAT_WATERWALK); + handler->GetSession()->GetPlayer()->SetMovement(MOVE_WATER_WALK); // ON + handler->SendSysMessage("Waterwalking is ON. You can walk on water."); + return true; + } + + return false; + } + + static bool HandleTaxiCheatCommand(ChatHandler* handler, const char* args) + { + if (!*args) + { + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + return false; + } + + std::string argstr = (char*)args; + + Player* chr = handler->getSelectedPlayer(); + + if (!chr) + chr = handler->GetSession()->GetPlayer(); + else if (handler->HasLowerSecurity(chr, 0)) // check online security + return false; + + if (argstr == "on") + { + chr->SetTaxiCheater(true); + handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str()); + if (handler->needReportToTarget(chr)) + ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str()); + return true; + } + + if (argstr == "off") + { + chr->SetTaxiCheater(false); + handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str()); + if (handler->needReportToTarget(chr)) + ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str()); + + return true; + } + + handler->SendSysMessage(LANG_USE_BOL); + handler->SetSentErrorMessage(true); + return false; + } + + static bool HandleExploreCheatCommand(ChatHandler* handler, const char *args) + { + if (!*args) + return false; + + int flag = atoi((char*)args); + + Player* chr = handler->getSelectedPlayer(); + if (chr == NULL) + { + handler->SendSysMessage(LANG_NO_CHAR_SELECTED); + handler->SetSentErrorMessage(true); + return false; + } + + if (flag != 0) + { + handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(chr).c_str()); + if (handler->needReportToTarget(chr)) + ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str()); + } + else + { + handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(chr).c_str()); + if (handler->needReportToTarget(chr)) + ChatHandler(chr).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str()); + } + + for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) + { + if (flag != 0) + handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); + else + handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); + } + + return true; + } +}; + +void AddSC_cheat_commandscript() +{ + new cheat_commandscript(); +} diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 1edaaf5bcbf..fa4b0ce3957 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -82,10 +82,8 @@ public: { "saveall", SEC_MODERATOR, true, &HandleSaveAllCommand, "", NULL }, { "kick", SEC_GAMEMASTER, true, &HandleKickPlayerCommand, "", NULL }, { "start", SEC_PLAYER, false, &HandleStartCommand, "", NULL }, - { "taxicheat", SEC_MODERATOR, false, &HandleTaxiCheatCommand, "", NULL }, { "linkgrave", SEC_ADMINISTRATOR, false, &HandleLinkGraveCommand, "", NULL }, { "neargrave", SEC_ADMINISTRATOR, false, &HandleNearGraveCommand, "", NULL }, - { "explorecheat", SEC_ADMINISTRATOR, false, &HandleExploreCheatCommand, "", NULL }, { "showarea", SEC_ADMINISTRATOR, false, &HandleShowAreaCommand, "", NULL }, { "hidearea", SEC_ADMINISTRATOR, false, &HandleHideAreaCommand, "", NULL }, { "additem", SEC_ADMINISTRATOR, false, &HandleAddItemCommand, "", NULL }, @@ -106,7 +104,6 @@ public: { "combatstop", SEC_GAMEMASTER, true, &HandleCombatStopCommand, "", NULL }, { "flusharenapoints", SEC_ADMINISTRATOR, false, &HandleFlushArenaPointsCommand, "", NULL }, { "repairitems", SEC_GAMEMASTER, true, &HandleRepairitemsCommand, "", NULL }, - { "waterwalk", SEC_GAMEMASTER, false, &HandleWaterwalkCommand, "", NULL }, { "freeze", SEC_MODERATOR, false, &HandleFreezeCommand, "", NULL }, { "unfreeze", SEC_MODERATOR, false, &HandleUnFreezeCommand, "", NULL }, { "listfreeze", SEC_MODERATOR, false, &HandleListFreezeCommand, "", NULL }, @@ -960,49 +957,6 @@ public: player->CastSpell(player, 7355, false); return true; } - // Enable on\off all taxi paths - static bool HandleTaxiCheatCommand(ChatHandler* handler, char const* args) - { - if (!*args) - { - handler->SendSysMessage(LANG_USE_BOL); - handler->SetSentErrorMessage(true); - return false; - } - - std::string argStr = (char*)args; - - Player* chr = handler->getSelectedPlayer(); - - if (!chr) - chr = handler->GetSession()->GetPlayer(); - else if (handler->HasLowerSecurity(chr, 0)) // check online security - return false; - - if (argStr == "on") - { - chr->SetTaxiCheater(true); - handler->PSendSysMessage(LANG_YOU_GIVE_TAXIS, handler->GetNameLink(chr).c_str()); - if (handler->needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_ADDED, handler->GetNameLink().c_str()); - return true; - } - - if (argStr == "off") - { - chr->SetTaxiCheater(false); - handler->PSendSysMessage(LANG_YOU_REMOVE_TAXIS, handler->GetNameLink(chr).c_str()); - if (handler->needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_TAXIS_REMOVED, handler->GetNameLink().c_str()); - - return true; - } - - handler->SendSysMessage(LANG_USE_BOL); - handler->SetSentErrorMessage(true); - - return false; - } static bool HandleLinkGraveCommand(ChatHandler* handler, char const* args) { @@ -1123,45 +1077,6 @@ public: return true; } - static bool HandleExploreCheatCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - int32 flag = int32(atoi((char*)args)); - - Player* playerTarget = handler->getSelectedPlayer(); - if (!playerTarget) - { - handler->SendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - if (flag != 0) - { - handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_ALL, handler->GetNameLink(playerTarget).c_str()); - if (handler->needReportToTarget(playerTarget)) - ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_ALL, handler->GetNameLink().c_str()); - } - else - { - handler->PSendSysMessage(LANG_YOU_SET_EXPLORE_NOTHING, handler->GetNameLink(playerTarget).c_str()); - if (handler->needReportToTarget(playerTarget)) - ChatHandler(playerTarget).PSendSysMessage(LANG_YOURS_EXPLORE_SET_NOTHING, handler->GetNameLink().c_str()); - } - - for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i) - { - if (flag != 0) - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0xFFFFFFFF); - else - handler->GetSession()->GetPlayer()->SetFlag(PLAYER_EXPLORED_ZONES_1+i, 0); - } - - return true; - } - static bool HandleShowAreaCommand(ChatHandler* handler, char const* args) { if (!*args) @@ -2194,39 +2109,6 @@ public: return true; } - static bool HandleWaterwalkCommand(ChatHandler* handler, char const* args) - { - if (!*args) - return false; - - Player* player = handler->getSelectedPlayer(); - if (!player) - { - handler->PSendSysMessage(LANG_NO_CHAR_SELECTED); - handler->SetSentErrorMessage(true); - return false; - } - - // check online security - if (handler->HasLowerSecurity(player, 0)) - return false; - - if (strncmp(args, "on", 3) == 0) - player->SetMovement(MOVE_WATER_WALK); // ON - else if (strncmp(args, "off", 4) == 0) - player->SetMovement(MOVE_LAND_WALK); // OFF - else - { - handler->SendSysMessage(LANG_USE_BOL); - return false; - } - - handler->PSendSysMessage(LANG_YOU_SET_WATERWALK, args, handler->GetNameLink(player).c_str()); - if (handler->needReportToTarget(player)) - ChatHandler(player).PSendSysMessage(LANG_YOUR_WATERWALK_SET, args, handler->GetNameLink().c_str()); - return true; - } - // Send mail by command static bool HandleSendMailCommand(ChatHandler* handler, char const* args) { -- cgit v1.2.3 From 147c698a303438d3804781745da7d954965958e4 Mon Sep 17 00:00:00 2001 From: Nay Date: Fri, 31 Aug 2012 01:29:18 +0100 Subject: SQL: Rename SQL --- sql/updates/world/2012_08_31_00_world_command.sql | 14 ++++++++++++++ sql/updates/world/2012_8_29_00_world_command.sql | 14 -------------- 2 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 sql/updates/world/2012_08_31_00_world_command.sql delete mode 100644 sql/updates/world/2012_8_29_00_world_command.sql (limited to 'sql') diff --git a/sql/updates/world/2012_08_31_00_world_command.sql b/sql/updates/world/2012_08_31_00_world_command.sql new file mode 100644 index 00000000000..c0686d6d907 --- /dev/null +++ b/sql/updates/world/2012_08_31_00_world_command.sql @@ -0,0 +1,14 @@ +DELETE FROM `command` WHERE `name`='explorecheat'; +DELETE FROM `command` WHERE `name`='taxicheat'; +DELETE FROM `command` WHERE `name`='waterwalk'; + +DELETE FROM `command` WHERE `name`='cheat' OR `name` LIKE 'cheat%'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('cheat', 2, 'Syntax: .cheat $subcommand\r\nType .cheat to see the list of possible subcommands or .help cheat $subcommand to see info on subcommands'), +('cheat god', 2, 'Syntax: .cheat god [on/off]\r\nEnables or disables your character''s ability to take damage.'), +('cheat casttime', 2, 'Syntax: .cheat casttime [on/off]\r\nEnables or disables your character''s spell cast times.'), +('cheat cooldown', 2, 'Syntax: .cheat cooldown [on/off]\r\nEnables or disables your character''s spell cooldowns.'), +('cheat power', 2, 'Syntax: .cheat power [on/off]\r\nEnables or disables your character''s spell cost (e.g mana).'), +('cheat waterwalk', 2, 'Syntax: .cheat waterwalk on/off\r\nSet on/off waterwalk state for selected player or self if no player selected.'), +('cheat explore', 2, 'Syntax: .cheat explore #flag\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'), +('cheat taxi', 2, 'Syntax: .cheat taxi on/off\r\nTemporary grant access or remove to all taxi routes for the selected character.\r\n If no character is selected, hide or reveal all routes to you.Visited taxi nodes sill accessible after removing access.'); diff --git a/sql/updates/world/2012_8_29_00_world_command.sql b/sql/updates/world/2012_8_29_00_world_command.sql deleted file mode 100644 index c0686d6d907..00000000000 --- a/sql/updates/world/2012_8_29_00_world_command.sql +++ /dev/null @@ -1,14 +0,0 @@ -DELETE FROM `command` WHERE `name`='explorecheat'; -DELETE FROM `command` WHERE `name`='taxicheat'; -DELETE FROM `command` WHERE `name`='waterwalk'; - -DELETE FROM `command` WHERE `name`='cheat' OR `name` LIKE 'cheat%'; -INSERT INTO `command` (`name`, `security`, `help`) VALUES -('cheat', 2, 'Syntax: .cheat $subcommand\r\nType .cheat to see the list of possible subcommands or .help cheat $subcommand to see info on subcommands'), -('cheat god', 2, 'Syntax: .cheat god [on/off]\r\nEnables or disables your character''s ability to take damage.'), -('cheat casttime', 2, 'Syntax: .cheat casttime [on/off]\r\nEnables or disables your character''s spell cast times.'), -('cheat cooldown', 2, 'Syntax: .cheat cooldown [on/off]\r\nEnables or disables your character''s spell cooldowns.'), -('cheat power', 2, 'Syntax: .cheat power [on/off]\r\nEnables or disables your character''s spell cost (e.g mana).'), -('cheat waterwalk', 2, 'Syntax: .cheat waterwalk on/off\r\nSet on/off waterwalk state for selected player or self if no player selected.'), -('cheat explore', 2, 'Syntax: .cheat explore #flag\r\nReveal or hide all maps for the selected player. If no player is selected, hide or reveal maps to you.\r\nUse a #flag of value 1 to reveal, use a #flag value of 0 to hide all maps.'), -('cheat taxi', 2, 'Syntax: .cheat taxi on/off\r\nTemporary grant access or remove to all taxi routes for the selected character.\r\n If no character is selected, hide or reveal all routes to you.Visited taxi nodes sill accessible after removing access.'); -- cgit v1.2.3 From 6fbe3a11ecc92a9a3acd4e2b05a784a57051f425 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Fri, 31 Aug 2012 04:15:04 +0300 Subject: DB/SAI: Taking on All Challengers & Defending Your Title --- sql/updates/world/2012_08_31_00_world_sai.sql | 50 ++++++++++++++ src/server/scripts/Northrend/storm_peaks.cpp | 98 --------------------------- 2 files changed, 50 insertions(+), 98 deletions(-) create mode 100644 sql/updates/world/2012_08_31_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2012_08_31_00_world_sai.sql b/sql/updates/world/2012_08_31_00_world_sai.sql new file mode 100644 index 00000000000..fd7e0d7810f --- /dev/null +++ b/sql/updates/world/2012_08_31_00_world_sai.sql @@ -0,0 +1,50 @@ +-- Defending Your Title (13423) +-- Taking on All Challengers (12971) + +SET @NPC_CHALLENGER := 30012; -- Victorious Challenger +SET @QUEST1 := 12971; +SET @QUEST2 := 13423; +SET @GOSSIP_MENUID := 9865; +SET @SPELL_SUNDER := 11971; -- Sunder Armor +SET @SPELL_REND := 11977; -- Rend + +UPDATE `creature_template` SET `faction_A`=2109,`faction_H`=2109,`unit_flags`=0x8000,`npcflag`=0x1,`gossip_menu_id`=@GOSSIP_MENUID,`AIName`='SmartAI',`ScriptName`='' WHERE `entry`=@NPC_CHALLENGER; + +DELETE FROM `creature_template_addon` WHERE `entry`=@NPC_CHALLENGER; +INSERT INTO `creature_template_addon` (`entry`,`mount`,`bytes1`,`bytes2`,`auras`) VALUES +(@NPC_CHALLENGER,0,0x0,0x1,''); + +DELETE FROM `creature_text` WHERE `entry`=@NPC_CHALLENGER; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@NPC_CHALLENGER,0,0,'You will not defeat me!',12,0,100,0,0,0,'Victorious Challenger'), +(@NPC_CHALLENGER,0,1,'You''re not worthy of Thorim!',12,0,100,0,0,0,'Victorious Challenger'), +(@NPC_CHALLENGER,0,2,'Good luck... You''ll need it!',12,0,100,0,0,0,'Victorious Challenger'), +(@NPC_CHALLENGER,0,3,'May the best win!',12,0,100,0,0,0,'Victorious Challenger'); + +DELETE FROM `gossip_menu` WHERE `entry`=@GOSSIP_MENUID; +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@GOSSIP_MENUID,13660); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP_MENUID; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP_MENUID,0,0,'Let''s do this, sister.',1,1,0,0,0,0,''); + +DELETE FROM `creature_equip_template` WHERE `entry`=@NPC_CHALLENGER; +INSERT INTO `creature_equip_template` (`entry`,`itemEntry1`,`itemEntry2`,`itemEntry3`) VALUES +(@NPC_CHALLENGER,40542,39288,0); + +DELETE FROM `smart_scripts` WHERE (`source_type`=0 AND `entryorguid`=@NPC_CHALLENGER) OR (`source_type`=9 AND `entryorguid`=@NPC_CHALLENGER*100); +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_CHALLENGER,0,0,0,25,0,100,0,0,0,0,0,2,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - On Reset - Set Default Faction'), +(@NPC_CHALLENGER,0,1,2,62,0,100,0,@GOSSIP_MENUID,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Victorious Challenger - On Gossip - Close Gossip'), +(@NPC_CHALLENGER,0,2,0,61,0,100,0,0,0,0,0,80,@NPC_CHALLENGER*100,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - On Gossip - Run Timed Script'), +(@NPC_CHALLENGER,0,3,0,9,0,100,0,0,5,5000,10000,11,@SPELL_SUNDER,0,0,0,0,0,2,0,0,0,0,0,0,0,'Victorious Challenger - On Range - Cast Sunder Armor'), +(@NPC_CHALLENGER,0,4,0,0,0,100,0,10000,15000,15000,20000,11,@SPELL_REND,0,0,0,0,0,2,0,0,0,0,0,0,0,'Victorious Challenger - IC - Cast Rend'), +(@NPC_CHALLENGER*100,9,0,0,0,0,100,0,1000,1000,1000,1000,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - Timed - Talk'), +(@NPC_CHALLENGER*100,9,1,0,0,0,100,0,3000,3000,3000,3000,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0,'Victorious Challenger - Timed - Set Faction Hostile'), +(@NPC_CHALLENGER*100,9,2,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Victorious Challenger - Timed - Attack Invoker'); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@GOSSIP_MENUID; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP_MENUID,0,0,0,9,0,@QUEST1,0,0,0,0,'','Show gossip option 0 if player has quest Taking on All Challengers'), +(15,@GOSSIP_MENUID,0,0,1,9,0,@QUEST2,0,0,0,0,'','Show gossip option 0 if player has quest Defending Your Title'); diff --git a/src/server/scripts/Northrend/storm_peaks.cpp b/src/server/scripts/Northrend/storm_peaks.cpp index 6bf342e4643..60c289dc8de 100644 --- a/src/server/scripts/Northrend/storm_peaks.cpp +++ b/src/server/scripts/Northrend/storm_peaks.cpp @@ -194,103 +194,6 @@ public: } }; -/*###### -## npc_victorious_challenger -######*/ - -#define GOSSIP_CHALLENGER "Let's do this, sister." - -enum eVictoriousChallenger -{ - QUEST_TAKING_ALL_CHALLENGERS = 12971, - QUEST_DEFENDING_YOUR_TITLE = 13423, - - SPELL_SUNDER_ARMOR = 11971, - SPELL_REND_VC = 11977 -}; - -class npc_victorious_challenger : public CreatureScript -{ -public: - npc_victorious_challenger() : CreatureScript("npc_victorious_challenger") { } - - struct npc_victorious_challengerAI : public ScriptedAI - { - npc_victorious_challengerAI(Creature* creature) : ScriptedAI(creature) {} - - uint32 SunderArmorTimer; - uint32 RendTimer; - - void Reset() - { - me->RestoreFaction(); - - SunderArmorTimer = 10000; - RendTimer = 15000; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (RendTimer < diff) - { - DoCast(me->getVictim(), SPELL_REND_VC, true); - RendTimer = 15000; - }else RendTimer -= diff; - - if (SunderArmorTimer < diff) - { - DoCast(me->getVictim(), SPELL_SUNDER_ARMOR, true); - SunderArmorTimer = 10000; - }else SunderArmorTimer -= diff; - - DoMeleeAttackIfReady(); - } - - void KilledUnit(Unit* /*victim*/) - { - me->RestoreFaction(); - } - - }; - - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->isQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_TAKING_ALL_CHALLENGERS) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_DEFENDING_YOUR_TITLE) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CHALLENGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - return false; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - creature->setFaction(14); - creature->AI()->AttackStart(player); - } - - return true; - } - - CreatureAI* GetAI(Creature* creature) const - { - return new npc_victorious_challengerAI(creature); - } -}; - /*###### ## npc_loklira_crone ######*/ @@ -753,7 +656,6 @@ void AddSC_storm_peaks() new npc_agnetta_tyrsdottar(); new npc_frostborn_scout(); new npc_thorim(); - new npc_victorious_challenger(); new npc_loklira_crone(); new npc_injured_goblin(); new npc_roxi_ramrocket(); -- cgit v1.2.3 From c9eb42f2465e607c5e13425cc913b792a15e937e Mon Sep 17 00:00:00 2001 From: Venugh Date: Thu, 6 Sep 2012 00:36:24 +0200 Subject: Core/Commands: Implemented mmaps commands. --- sql/updates/world/2012_09_06_00_world_command.sql | 9 + src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/scripts/Commands/CMakeLists.txt | 1 + src/server/scripts/Commands/cs_mmaps.cpp | 293 ++++++++++++++++++++++ 4 files changed, 305 insertions(+) create mode 100644 sql/updates/world/2012_09_06_00_world_command.sql create mode 100644 src/server/scripts/Commands/cs_mmaps.cpp (limited to 'sql') diff --git a/sql/updates/world/2012_09_06_00_world_command.sql b/sql/updates/world/2012_09_06_00_world_command.sql new file mode 100644 index 00000000000..e60c1644e05 --- /dev/null +++ b/sql/updates/world/2012_09_06_00_world_command.sql @@ -0,0 +1,9 @@ +DELETE FROM `command` WHERE `name`='mmap' OR `name` LIKE 'mmap%'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('mmap', 3, 'Syntax: Syntax: .mmaps $subcommand Type .mmaps to see the list of possible subcommands or .help mmaps $subcommand to see info on subcommands'), +('mmap path', 3, 'Syntax: .mmap path to calculate and show a path to current select unit'), +('mmap loc', 3, 'Syntax: .mmap loc to print on which tile one is'), +('mmap loadedtiles', 3, 'Syntax: .mmap loadedtiles to show which tiles are currently loaded'), +('mmap stats', 3, 'Syntax: .mmap stats to show information about current state of mmaps'), +('mmap testarea', 3, 'Syntax: .mmap testarea to calculate paths for all nearby npcs to player'); + diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index fc56106ab6f..6442a35f0c3 100755 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -75,6 +75,7 @@ void AddSC_tele_commandscript(); void AddSC_ticket_commandscript(); void AddSC_titles_commandscript(); void AddSC_wp_commandscript(); +void AddSC_mmaps_commandscript(); #ifdef SCRIPTS //world @@ -693,6 +694,7 @@ void AddCommandScripts() AddSC_ticket_commandscript(); AddSC_titles_commandscript(); AddSC_wp_commandscript(); + AddSC_mmaps_commandscript(); } void AddWorldScripts() diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 177b3a479f5..e799cf20633 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -41,6 +41,7 @@ set(scripts_STAT_SRCS Commands/cs_server.cpp Commands/cs_titles.cpp Commands/cs_wp.cpp + Commands/cs_mmaps.cpp # Commands/cs_pdump.cpp # Commands/cs_channel.cpp # Commands/cs_pet.cpp diff --git a/src/server/scripts/Commands/cs_mmaps.cpp b/src/server/scripts/Commands/cs_mmaps.cpp new file mode 100644 index 00000000000..c1fc4d1a5e9 --- /dev/null +++ b/src/server/scripts/Commands/cs_mmaps.cpp @@ -0,0 +1,293 @@ +/* + * Copyright (C) 2008-2012 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/** +* @file cs_mmaps.cpp +* @brief .mmap related commands +* +* This file contains the CommandScripts for all +* mmap sub-commands +*/ + +#include "ScriptMgr.h" +#include "Chat.h" +#include "ObjectMgr.h" +#include "Player.h" +#include "PointMovementGenerator.h" +#include "PathGenerator.h" +#include "MMapFactory.h" +#include "Map.h" +#include "TargetedMovementGenerator.h" + +class mmaps_commandscript : public CommandScript +{ +public: + mmaps_commandscript() : CommandScript("mmaps_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand mmapCommandTable[] = + { + { "path", SEC_ADMINISTRATOR, false, &HandleMmapPathCommand, "", NULL }, + { "loc", SEC_ADMINISTRATOR, false, &HandleMmapLocCommand, "", NULL }, + { "loadedtiles", SEC_ADMINISTRATOR, false, &HandleMmapLoadedTilesCommand, "", NULL }, + { "stats", SEC_ADMINISTRATOR, false, &HandleMmapStatsCommand, "", NULL }, + { "testarea", SEC_ADMINISTRATOR, false, &HandleMmapTestArea, "", NULL }, + { NULL, 0, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "mmap", SEC_ADMINISTRATOR, true, NULL, "", mmapCommandTable }, + { NULL, 0, false, NULL, "", NULL } + }; + return commandTable; + } + + static bool HandleMmapPathCommand(ChatHandler* handler, char const* args) + { + if (!MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId())) + { + handler->PSendSysMessage("NavMesh not loaded for current map."); + return true; + } + + handler->PSendSysMessage("mmap path:"); + + // units + Player* player = handler->GetSession()->GetPlayer(); + Unit* target = handler->getSelectedUnit(); + if (!player || !target) + { + handler->PSendSysMessage("Invalid target/source selection."); + return true; + } + + char* para = strtok((char*)args, " "); + + bool useStraightPath = false; + if (para && strcmp(para, "true") == 0) + useStraightPath = true; + + // unit locations + float x, y, z; + player->GetPosition(x, y, z); + + // path + PathGenerator path(target); + path.SetUseStraightPath(useStraightPath); + path.CalculatePath(x, y, z); + + PointsArray pointPath = path.GetPath(); + handler->PSendSysMessage("%s's path to %s:", target->GetName(), player->GetName()); + handler->PSendSysMessage("Building %s", useStraightPath ? "StraightPath" : "SmoothPath"); + handler->PSendSysMessage("length %i type %u", pointPath.size(), path.GetPathType()); + + Vector3 start = path.GetStartPosition(); + Vector3 end = path.GetEndPosition(); + Vector3 actualEnd = path.GetActualEndPosition(); + + handler->PSendSysMessage("start (%.3f, %.3f, %.3f)", start.x, start.y, start.z); + handler->PSendSysMessage("end (%.3f, %.3f, %.3f)", end.x, end.y, end.z); + handler->PSendSysMessage("actual end (%.3f, %.3f, %.3f)", actualEnd.x, actualEnd.y, actualEnd.z); + + if (!player->isGameMaster()) + handler->PSendSysMessage("Enable GM mode to see the path points."); + + // this entry visible only to GM's with "gm on" + static const uint32 WAYPOINT_NPC_ENTRY = 1; + for (uint32 i = 0; i < pointPath.size(); ++i) + player->SummonCreature(WAYPOINT_NPC_ENTRY, pointPath[i].x, pointPath[i].y, pointPath[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + + return true; + } + + static bool HandleMmapLocCommand(ChatHandler* handler, const char* args) + { + handler->PSendSysMessage("mmap tileloc:"); + + // grid tile location + Player* player = handler->GetSession()->GetPlayer(); + + int32 gx = 32 - player->GetPositionX() / SIZE_OF_GRIDS; + int32 gy = 32 - player->GetPositionY() / SIZE_OF_GRIDS; + + handler->PSendSysMessage("%03u%02i%02i.mmtile", player->GetMapId(), gy, gx); + handler->PSendSysMessage("gridloc [%i,%i]", gx, gy); + + // calculate navmesh tile location + dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()); + dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(handler->GetSession()->GetPlayer()->GetMapId(), player->GetInstanceId()); + if (!navmesh || !navmeshquery) + { + handler->PSendSysMessage("NavMesh not loaded for current map."); + return true; + } + + float const* min = navmesh->getParams()->orig; + float x, y, z; + player->GetPosition(x, y, z); + float location[VERTEX_SIZE] = {y, z, x}; + float extents[VERTEX_SIZE] = {3.0f, 5.0f, 3.0f}; + + int32 tilex = int32((y - min[0]) / SIZE_OF_GRIDS); + int32 tiley = int32((x - min[2]) / SIZE_OF_GRIDS); + + handler->PSendSysMessage("Calc [%02i,%02i]", tilex, tiley); + + // navmesh poly -> navmesh tile location + dtQueryFilter filter = dtQueryFilter(); + dtPolyRef polyRef = INVALID_POLYREF; + navmeshquery->findNearestPoly(location, extents, &filter, &polyRef, NULL); + + if (polyRef == INVALID_POLYREF) + handler->PSendSysMessage("Dt [??,??] (invalid poly, probably no tile loaded)"); + else + { + dtMeshTile const* tile; + dtPoly const* poly; + navmesh->getTileAndPolyByRef(polyRef, &tile, &poly); + if (tile) + handler->PSendSysMessage("Dt [%02i,%02i]", tile->header->x, tile->header->y); + else + handler->PSendSysMessage("Dt [??,??] (no tile loaded)"); + } + + return true; + } + + static bool HandleMmapLoadedTilesCommand(ChatHandler* handler, const char* args) + { + uint32 mapid = handler->GetSession()->GetPlayer()->GetMapId(); + dtNavMesh const* navmesh = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMesh(mapid); + dtNavMeshQuery const* navmeshquery = MMAP::MMapFactory::createOrGetMMapManager()->GetNavMeshQuery(mapid, handler->GetSession()->GetPlayer()->GetInstanceId()); + if (!navmesh || !navmeshquery) + { + handler->PSendSysMessage("NavMesh not loaded for current map."); + return true; + } + + handler->PSendSysMessage("mmap loadedtiles:"); + + for (int32 i = 0; i < navmesh->getMaxTiles(); ++i) + { + dtMeshTile const* tile = navmesh->getTile(i); + if (!tile || !tile->header) + continue; + + handler->PSendSysMessage("[%02i,%02i]", tile->header->x, tile->header->y); + } + + return true; + } + + static bool HandleMmapStatsCommand(ChatHandler* handler, const char* args) + { + uint32 mapId = handler->GetSession()->GetPlayer()->GetMapId(); + handler->PSendSysMessage("mmap stats:"); + handler->PSendSysMessage(" global mmap pathfinding is %sabled", MMAP::MMapFactory::IsPathfindingEnabled(mapId) ? "en" : "dis"); + + MMAP::MMapManager* manager = MMAP::MMapFactory::createOrGetMMapManager(); + handler->PSendSysMessage(" %u maps loaded with %u tiles overall", manager->getLoadedMapsCount(), manager->getLoadedTilesCount()); + + dtNavMesh const* navmesh = manager->GetNavMesh(handler->GetSession()->GetPlayer()->GetMapId()); + if (!navmesh) + { + handler->PSendSysMessage("NavMesh not loaded for current map."); + return true; + } + + uint32 tileCount = 0; + uint32 nodeCount = 0; + uint32 polyCount = 0; + uint32 vertCount = 0; + uint32 triCount = 0; + uint32 triVertCount = 0; + uint32 dataSize = 0; + for (int32 i = 0; i < navmesh->getMaxTiles(); ++i) + { + dtMeshTile const* tile = navmesh->getTile(i); + if (!tile || !tile->header) + continue; + + tileCount++; + nodeCount += tile->header->bvNodeCount; + polyCount += tile->header->polyCount; + vertCount += tile->header->vertCount; + triCount += tile->header->detailTriCount; + triVertCount += tile->header->detailVertCount; + dataSize += tile->dataSize; + } + + handler->PSendSysMessage("Navmesh stats:"); + handler->PSendSysMessage(" %u tiles loaded", tileCount); + handler->PSendSysMessage(" %u BVTree nodes", nodeCount); + handler->PSendSysMessage(" %u polygons (%u vertices)", polyCount, vertCount); + handler->PSendSysMessage(" %u triangles (%u vertices)", triCount, triVertCount); + handler->PSendSysMessage(" %.2f MB of data (not including pointers)", ((float)dataSize / sizeof(unsigned char)) / 1048576); + + return true; + } + + static bool HandleMmapTestArea(ChatHandler* handler, const char* args) + { + float radius = 40.0f; + WorldObject* object = handler->GetSession()->GetPlayer(); + + CellCoord pair(Trinity::ComputeCellCoord(object->GetPositionX(), object->GetPositionY()) ); + Cell cell(pair); + cell.SetNoCreate(); + + std::list creatureList; + + Trinity::AnyUnitInObjectRangeCheck go_check(object, radius); + Trinity::CreatureListSearcher go_search(object, creatureList, go_check); + TypeContainerVisitor, GridTypeMapContainer> go_visit(go_search); + + // Get Creatures + cell.Visit(pair, go_visit, *(object->GetMap()), *object, radius); + + if (!creatureList.empty()) + { + handler->PSendSysMessage("Found %i Creatures.", creatureList.size()); + + uint32 paths = 0; + uint32 uStartTime = getMSTime(); + + float gx, gy, gz; + object->GetPosition(gx, gy, gz); + for (std::list::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr) + { + PathGenerator path(*itr); + path.CalculatePath(gx, gy, gz); + ++paths; + } + + uint32 uPathLoadTime = getMSTimeDiff(uStartTime, getMSTime()); + handler->PSendSysMessage("Generated %i paths in %i ms", paths, uPathLoadTime); + } + else + handler->PSendSysMessage("No creatures in %f yard range.", radius); + + return true; + } +}; + +void AddSC_mmaps_commandscript() +{ + new mmaps_commandscript(); +} \ No newline at end of file -- cgit v1.2.3 From 08f62d8313e05ed6eb1767eed07a7e31533e9bb6 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 30 Dec 2012 21:09:21 +0100 Subject: Core/MMaps: use DisableMgr to disable pathfinding on a specific map --- sql/updates/world/2012_12_30_00_world_commands.sql | 4 +++ src/server/collision/Management/MMapFactory.cpp | 32 ++-------------------- src/server/collision/Management/MMapFactory.h | 1 - src/server/game/Conditions/DisableMgr.cpp | 31 ++++++++++++++++++++- src/server/game/Conditions/DisableMgr.h | 8 +++++- src/server/game/World/World.cpp | 1 - src/server/scripts/Commands/cs_disable.cpp | 32 ++++++++++++++++++++++ src/server/worldserver/worldserver.conf.dist | 7 ----- 8 files changed, 75 insertions(+), 41 deletions(-) create mode 100644 sql/updates/world/2012_12_30_00_world_commands.sql (limited to 'sql') diff --git a/sql/updates/world/2012_12_30_00_world_commands.sql b/sql/updates/world/2012_12_30_00_world_commands.sql new file mode 100644 index 00000000000..fffd1a95cb5 --- /dev/null +++ b/sql/updates/world/2012_12_30_00_world_commands.sql @@ -0,0 +1,4 @@ +DELETE FROM `command` WHERE `name` LIKE 'disable add mmap' OR `name` LIKE 'disable remove mmap'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('disable add mmap', '3', 'Syntax: .disable add mmap $entry $flag $comment'), +('disable remove mmap', '3', 'Syntax: .disable remove mmap $entry'); diff --git a/src/server/collision/Management/MMapFactory.cpp b/src/server/collision/Management/MMapFactory.cpp index f4b2f3d47e4..0b292b56dca 100644 --- a/src/server/collision/Management/MMapFactory.cpp +++ b/src/server/collision/Management/MMapFactory.cpp @@ -19,7 +19,7 @@ #include "MMapFactory.h" #include "World.h" #include "Config.h" -#include +#include "DisableMgr.h" namespace MMAP { @@ -27,9 +27,6 @@ namespace MMAP // our global singleton copy MMapManager *g_MMapManager = NULL; - // stores list of mapids which do not use pathfinding - std::set* g_mmapDisabledIds = NULL; - MMapManager* MMapFactory::createOrGetMMapManager() { if (g_MMapManager == NULL) @@ -38,39 +35,14 @@ namespace MMAP return g_MMapManager; } - void MMapFactory::preventPathfindingOnMaps(const char* ignoreMapIds) - { - if (!g_mmapDisabledIds) - g_mmapDisabledIds = new std::set(); - - uint32 strLenght = strlen(ignoreMapIds)+1; - char* mapList = new char[strLenght]; - memcpy(mapList, ignoreMapIds, sizeof(char)*strLenght); - - char* idstr = strtok(mapList, ","); - while (idstr) - { - g_mmapDisabledIds->insert(uint32(atoi(idstr))); - idstr = strtok(NULL, ","); - } - - delete[] mapList; - } - bool MMapFactory::IsPathfindingEnabled(uint32 mapId) { return sWorld->getBoolConfig(CONFIG_ENABLE_MMAPS) - && g_mmapDisabledIds->find(mapId) == g_mmapDisabledIds->end(); + && !DisableMgr::IsDisabledFor(DISABLE_TYPE_MMAP, mapId, NULL, MMAP_DISABLE_PATHFINDING); } void MMapFactory::clear() { - if (g_mmapDisabledIds) - { - delete g_mmapDisabledIds; - g_mmapDisabledIds = NULL; - } - if (g_MMapManager) { delete g_MMapManager; diff --git a/src/server/collision/Management/MMapFactory.h b/src/server/collision/Management/MMapFactory.h index ab047333a19..a006aedfa6d 100644 --- a/src/server/collision/Management/MMapFactory.h +++ b/src/server/collision/Management/MMapFactory.h @@ -42,7 +42,6 @@ namespace MMAP public: static MMapManager* createOrGetMMapManager(); static void clear(); - static void preventPathfindingOnMaps(const char* ignoreMapIds); static bool IsPathfindingEnabled(uint32 mapId); }; } diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index b544e966084..c9cef63907e 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -42,7 +42,7 @@ namespace DisableMap m_DisableMap; - uint8 MAX_DISABLE_TYPES = 7; + uint8 MAX_DISABLE_TYPES = 8; } void LoadDisables() @@ -222,6 +222,34 @@ void LoadDisables() } break; } + case DISABLE_TYPE_MMAP: + { + MapEntry const* mapEntry = sMapStore.LookupEntry(entry); + if (!mapEntry) + { + sLog->outError(LOG_FILTER_SQL, "Map entry %u from `disables` doesn't exist in dbc, skipped.", entry); + continue; + } + switch (mapEntry->map_type) + { + case MAP_COMMON: + sLog->outInfo(LOG_FILTER_GENERAL, "Pathfinding disabled for world map %u.", entry); + break; + case MAP_INSTANCE: + case MAP_RAID: + sLog->outInfo(LOG_FILTER_GENERAL, "Pathfinding disabled for instance map %u.", entry); + break; + case MAP_BATTLEGROUND: + sLog->outInfo(LOG_FILTER_GENERAL, "Pathfinding disabled for battleground map %u.", entry); + break; + case MAP_ARENA: + sLog->outInfo(LOG_FILTER_GENERAL, "Pathfinding disabled for arena map %u.", entry); + break; + default: + break; + } + break; + } default: break; } @@ -348,6 +376,7 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags case DISABLE_TYPE_BATTLEGROUND: case DISABLE_TYPE_OUTDOORPVP: case DISABLE_TYPE_ACHIEVEMENT_CRITERIA: + case DISABLE_TYPE_MMAP: return true; case DISABLE_TYPE_VMAP: return flags & itr->second.flags; diff --git a/src/server/game/Conditions/DisableMgr.h b/src/server/game/Conditions/DisableMgr.h index b1bb43315bd..379f0ac967b 100644 --- a/src/server/game/Conditions/DisableMgr.h +++ b/src/server/game/Conditions/DisableMgr.h @@ -31,7 +31,8 @@ enum DisableType DISABLE_TYPE_BATTLEGROUND = 3, DISABLE_TYPE_ACHIEVEMENT_CRITERIA = 4, DISABLE_TYPE_OUTDOORPVP = 5, - DISABLE_TYPE_VMAP = 6 + DISABLE_TYPE_VMAP = 6, + DISABLE_TYPE_MMAP = 7 }; enum SpellDisableTypes @@ -54,6 +55,11 @@ enum VmapDisableTypes VMAP_DISABLE_LIQUIDSTATUS = 0x8 }; +enum MMapDisableTypes +{ + MMAP_DISABLE_PATHFINDING = 0x0 +}; + namespace DisableMgr { void LoadDisables(); diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 81261138957..d09bea8b9a6 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1134,7 +1134,6 @@ void World::LoadConfigSettings(bool reload) m_bool_configs[CONFIG_ENABLE_MMAPS] = ConfigMgr::GetBoolDefault("mmap.enablePathFinding", true); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "WORLD: MMap data directory is: %smmaps", m_dataPath.c_str()); - MMAP::MMapFactory::preventPathfindingOnMaps(ConfigMgr::GetStringDefault("mmap.ignoreMapIds", "").c_str()); m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", 0); bool enableIndoor = ConfigMgr::GetBoolDefault("vmap.enableIndoorCheck", true); diff --git a/src/server/scripts/Commands/cs_disable.cpp b/src/server/scripts/Commands/cs_disable.cpp index cf0b1f08e53..e17cd35b329 100644 --- a/src/server/scripts/Commands/cs_disable.cpp +++ b/src/server/scripts/Commands/cs_disable.cpp @@ -48,6 +48,7 @@ public: { "achievement_criteria", SEC_ADMINISTRATOR, true, &HandleRemoveDisableAchievementCriteriaCommand, "", NULL }, { "outdoorpvp", SEC_ADMINISTRATOR, true, &HandleRemoveDisableOutdoorPvPCommand, "", NULL }, { "vmap", SEC_ADMINISTRATOR, true, &HandleRemoveDisableVmapCommand, "", NULL }, + { "mmap", SEC_ADMINISTRATOR, true, &HandleRemoveDisableMMapCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand addDisableCommandTable[] = @@ -59,6 +60,7 @@ public: { "achievement_criteria", SEC_ADMINISTRATOR, true, &HandleAddDisableAchievementCriteriaCommand, "", NULL }, { "outdoorpvp", SEC_ADMINISTRATOR, true, &HandleAddDisableOutdoorPvPCommand, "", NULL }, { "vmap", SEC_ADMINISTRATOR, true, &HandleAddDisableVmapCommand, "", NULL }, + { "mmap", SEC_ADMINISTRATOR, true, &HandleAddDisableMMapCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand disableCommandTable[] = @@ -172,6 +174,17 @@ public: disableTypeStr = "vmap"; break; } + case DISABLE_TYPE_MMAP: + { + if (!sMapStore.LookupEntry(entry)) + { + handler->PSendSysMessage(LANG_COMMAND_NOMAPFOUND); + handler->SetSentErrorMessage(true); + return false; + } + disableTypeStr = "mmap"; + break; + } default: break; } @@ -256,6 +269,14 @@ public: return HandleAddDisables(handler, args, DISABLE_TYPE_VMAP); } + static bool HandleAddDisableMMapCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + return HandleAddDisables(handler, args, DISABLE_TYPE_MMAP); + } + static bool HandleRemoveDisables(ChatHandler* handler, char const* args, uint8 disableType) { char* entryStr = strtok((char*)args, " "); @@ -289,6 +310,9 @@ public: case DISABLE_TYPE_VMAP: disableTypeStr = "vmap"; break; + case DISABLE_TYPE_MMAP: + disableTypeStr = "mmap"; + break; } PreparedStatement* stmt = NULL; @@ -367,6 +391,14 @@ public: return HandleRemoveDisables(handler, args, DISABLE_TYPE_VMAP); } + + static bool HandleRemoveDisableMMapCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + return HandleRemoveDisables(handler, args, DISABLE_TYPE_MMAP); + } }; void AddSC_disable_commandscript() diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 426d4ab2d55..81b4dad8b06 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -276,13 +276,6 @@ PlayerSave.Stats.SaveOnlyOnLogout = 1 mmap.enablePathFinding = 1 -# -# mmap.ignoreMapIds -# Disable mmap pathfinding on the listed maps. -# List of map ids with delimiter ',' - -mmap.ignoreMapIds = "" - # # vmap.enableLOS # vmap.enableHeight -- cgit v1.2.3 From e524539d90f7c1b3393754641729fa844119b881 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sat, 19 Jan 2013 19:17:31 +0100 Subject: Core/CS: More npcflag info in .npc info --- .../world/2013_01_19_06_world_trinity_string.sql | 28 ++++++++++++++ src/server/game/Miscellaneous/Language.h | 27 ++++++++++++- src/server/scripts/Commands/cs_npc.cpp | 44 +++++++++++++++++++--- 3 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 sql/updates/world/2013_01_19_06_world_trinity_string.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_19_06_world_trinity_string.sql b/sql/updates/world/2013_01_19_06_world_trinity_string.sql new file mode 100644 index 00000000000..322d43a7720 --- /dev/null +++ b/sql/updates/world/2013_01_19_06_world_trinity_string.sql @@ -0,0 +1,28 @@ +DELETE FROM `trinity_string` WHERE `entry` BETWEEN 820 AND 842; +INSERT INTO `trinity_string`(`entry`,`content_default`) VALUES +(820,'* has gossip (%u)'), +(821,'* is quest giver (%u)'), +(822,'* is class trainer (%u)'), +(823,'* is profession trainer(%u)'), +(824,'* is ammo vendor (%u)'), +(825,'* is food vendor(%u)'), +(826,'* is poison vendor (%u)'), +(827,'* is reagent vendor (%u)'), +(828,'* can repair (%u)'), +(829,'* is flight master (%u)'), +(830,'* is spirit healer (%u)'), +(831,'* is spirit guide (%u)'), +(832,'* is innkeeper (%u)'), +(833,'* is banker (%u)'), +(834,'* is petitioner (%u)'), +(835,'* is tabard designer (%u)'), +(836,'* is battle master (%u)'), +(837,'* is auctioneer (%u)'), +(838,'* is stable master (%u)'), +(839,'* is guild banker (%u)'), +(840,'* has spell click (%u)'), +(841,'* is mailbox (%u)'), +(842,'* is player vehicle (%u)'); + +UPDATE `trinity_string` SET `content_default`='* is vendor (%u)' WHERE `entry`=545; +UPDATE `trinity_string` SET `content_default`='* is trainer (%u)' WHERE `entry`=546; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 292833c3955..35b0a6f8569 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -742,7 +742,32 @@ enum TrinityStrings LANG_COMMAND_CREATURESTORAGE_NOTFOUND = 818, LANG_CHANNEL_CITY = 819, - // Room for in-game strings 820-999 not used + + LANG_NPCINFO_GOSSIP = 820, + LANG_NPCINFO_QUESTGIVER = 821, + LANG_NPCINFO_TRAINER_CLASS = 822, + LANG_NPCINFO_TRAINER_PROFESSION = 823, + LANG_NPCINFO_VENDOR_AMMO = 824, + LANG_NPCINFO_VENDOR_FOOD = 825, + LANG_NPCINFO_VENDOR_POISON = 826, + LANG_NPCINFO_VENDOR_REAGENT = 827, + LANG_NPCINFO_REPAIR = 828, + LANG_NPCINFO_FLIGHTMASTER = 829, + LANG_NPCINFO_SPIRITHEALER = 830, + LANG_NPCINFO_SPIRITGUIDE = 831, + LANG_NPCINFO_INNKEEPER = 832, + LANG_NPCINFO_BANKER = 833, + LANG_NPCINFO_PETITIONER = 834, + LANG_NPCINFO_TABARDDESIGNER = 835, + LANG_NPCINFO_BATTLEMASTER = 836, + LANG_NPCINFO_AUCTIONEER = 837, + LANG_NPCINFO_STABLEMASTER = 838, + LANG_NPCINFO_GUILD_BANKER = 839, + LANG_NPCINFO_SPELLCLICK = 840, + LANG_NPCINFO_MAILBOX = 841, + LANG_NPCINFO_PLAYER_VEHICLE = 842, + + // Room for in-game strings 843-999 not used // Level 4 (CLI only commands) LANG_COMMAND_EXIT = 1000, diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp index 8679e288282..7ccd5ed1177 100644 --- a/src/server/scripts/Commands/cs_npc.cpp +++ b/src/server/scripts/Commands/cs_npc.cpp @@ -33,6 +33,42 @@ EndScriptData */ #include "Player.h" #include "Pet.h" +struct NpcFlagText +{ + uint32 flag; + int32 text; +}; + +#define NPCFLAG_COUNT 24 + +const NpcFlagText npcFlagTexts[NPCFLAG_COUNT] = +{ + { UNIT_NPC_FLAG_AUCTIONEER, LANG_NPCINFO_AUCTIONEER }, + { UNIT_NPC_FLAG_BANKER, LANG_NPCINFO_BANKER }, + { UNIT_NPC_FLAG_BATTLEMASTER, LANG_NPCINFO_BATTLEMASTER }, + { UNIT_NPC_FLAG_FLIGHTMASTER, LANG_NPCINFO_FLIGHTMASTER }, + { UNIT_NPC_FLAG_GOSSIP, LANG_NPCINFO_GOSSIP }, + { UNIT_NPC_FLAG_GUILD_BANKER, LANG_NPCINFO_GUILD_BANKER }, + { UNIT_NPC_FLAG_INNKEEPER, LANG_NPCINFO_INNKEEPER }, + { UNIT_NPC_FLAG_PETITIONER, LANG_NPCINFO_PETITIONER }, + { UNIT_NPC_FLAG_PLAYER_VEHICLE, LANG_NPCINFO_PLAYER_VEHICLE }, + { UNIT_NPC_FLAG_QUESTGIVER, LANG_NPCINFO_QUESTGIVER }, + { UNIT_NPC_FLAG_REPAIR, LANG_NPCINFO_REPAIR }, + { UNIT_NPC_FLAG_SPELLCLICK, LANG_NPCINFO_SPELLCLICK }, + { UNIT_NPC_FLAG_SPIRITGUIDE, LANG_NPCINFO_SPIRITGUIDE }, + { UNIT_NPC_FLAG_SPIRITHEALER, LANG_NPCINFO_SPIRITHEALER }, + { UNIT_NPC_FLAG_STABLEMASTER, LANG_NPCINFO_STABLEMASTER }, + { UNIT_NPC_FLAG_TABARDDESIGNER, LANG_NPCINFO_TABARDDESIGNER }, + { UNIT_NPC_FLAG_TRAINER, LANG_NPCINFO_TRAINER }, + { UNIT_NPC_FLAG_TRAINER_CLASS, LANG_NPCINFO_TRAINER_CLASS }, + { UNIT_NPC_FLAG_TRAINER_PROFESSION, LANG_NPCINFO_TRAINER_PROFESSION }, + { UNIT_NPC_FLAG_VENDOR, LANG_NPCINFO_VENDOR }, + { UNIT_NPC_FLAG_VENDOR_AMMO, LANG_NPCINFO_VENDOR_AMMO }, + { UNIT_NPC_FLAG_VENDOR_FOOD, LANG_NPCINFO_VENDOR_FOOD }, + { UNIT_NPC_FLAG_VENDOR_POISON, LANG_NPCINFO_VENDOR_POISON }, + { UNIT_NPC_FLAG_VENDOR_REAGENT, LANG_NPCINFO_VENDOR_REAGENT } +}; + class npc_commandscript : public CommandScript { public: @@ -619,11 +655,9 @@ public: handler->PSendSysMessage(LANG_NPCINFO_POSITION, float(target->GetPositionX()), float(target->GetPositionY()), float(target->GetPositionZ())); handler->PSendSysMessage(LANG_NPCINFO_AIINFO, target->GetAIName().c_str(), target->GetScriptName().c_str()); - if (npcflags & UNIT_NPC_FLAG_VENDOR) - handler->SendSysMessage(LANG_NPCINFO_VENDOR); - - if (npcflags & UNIT_NPC_FLAG_TRAINER) - handler->SendSysMessage(LANG_NPCINFO_TRAINER); + for (uint8 i = 0; i < NPCFLAG_COUNT; i++) + if (npcflags & npcFlagTexts[i].flag) + handler->PSendSysMessage(npcFlagTexts[i].text, npcFlagTexts[i].flag); return true; } -- cgit v1.2.3 From 383e1a13f4230c222dcc11cec92d5b6b1d39a2e0 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 20 Jan 2013 01:19:37 +0100 Subject: DB/SAI: Fix "Sludge Belcher" event spamming with aura --- sql/updates/world/2013_01_20_00_world_sai.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_01_20_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_00_world_sai.sql b/sql/updates/world/2013_01_20_00_world_sai.sql new file mode 100644 index 00000000000..d4e4bb81c41 --- /dev/null +++ b/sql/updates/world/2013_01_20_00_world_sai.sql @@ -0,0 +1 @@ +UPDATE `smart_scripts` SET `event_type`=25,`event_flags`=0,`event_param1`=0,`event_param2`=0 WHERE `entryorguid`=16029 AND `source_type`=0 AND `id`=0; -- Sludge Belcher -- cgit v1.2.3 From e768f31fcde87d24bda4fb71a737b62acae006a3 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sat, 19 Jan 2013 19:32:54 -0500 Subject: DB/Creature Text: Updated / Added some sounds & texts for Jedoga Shadowseeker --- sql/updates/world/2013_01_20_01_world_creature_text.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2013_01_20_01_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_01_world_creature_text.sql b/sql/updates/world/2013_01_20_01_world_creature_text.sql new file mode 100644 index 00000000000..d543b02d9fc --- /dev/null +++ b/sql/updates/world/2013_01_20_01_world_creature_text.sql @@ -0,0 +1,10 @@ +UPDATE `creature_text` SET `sound`=14344 WHERE `entry`=29310 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `sound`=14345 WHERE `entry`=29310 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='Yogg-Saron! Grant me your power!', `sound`=14346 WHERE `entry`=29310 AND `groupid`=2 AND `id`=0; +UPDATE `creature_text` SET `sound`=14347 WHERE `entry`=29310 AND `groupid`=2 AND `id`=1; +UPDATE `creature_text` SET `sound`=14348 WHERE `entry`=29310 AND `groupid`=3 AND `id`=0; +UPDATE `creature_text` SET `sound`=14349 WHERE `entry`=29310 AND `groupid`=3 AND `id`=1; +UPDATE `creature_text` SET `sound`=14351 WHERE `entry`=29310 AND `groupid`=4; +UPDATE `creature_text` SET `sound`=14354 WHERE `entry`=29310 AND `groupid`=5 AND `id`=2; +UPDATE `creature_text` SET `sound`=14355 WHERE `entry`=29310 AND `groupid`=5 AND `id`=3; +UPDATE `creature_text` SET `text`='The faithful shall be exalted, but there is more work to be done. We will press on until all of Azeroth lies beneath his shadow!', `sound`=14356 WHERE `entry`=29310 AND `groupid`=5 AND `id`=4; -- cgit v1.2.3 From e05135c0622845e3594f5fbcc048f0d1df8c28ec Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sat, 19 Jan 2013 21:45:49 -0500 Subject: DB/Creature Text: Added sounds & corrected type value for Gal'darah --- sql/updates/world/2013_01_20_02_world_creature_text.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2013_01_20_02_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_02_world_creature_text.sql b/sql/updates/world/2013_01_20_02_world_creature_text.sql new file mode 100644 index 00000000000..25c8c046dfc --- /dev/null +++ b/sql/updates/world/2013_01_20_02_world_creature_text.sql @@ -0,0 +1,10 @@ +UPDATE `creature_text` SET `sound`=14430, `type`=14 WHERE `entry`=29306 AND `groupid`=0; +UPDATE `creature_text` SET `sound`=14431, `type`=14 WHERE `entry`=29306 AND `groupid`=4; +UPDATE `creature_text` SET `sound`=14432, `type`=14 WHERE `entry`=29306 AND `groupid`=5; +UPDATE `creature_text` SET `sound`=14433, `type`=14 WHERE `entry`=29306 AND `groupid`=3 AND `id`=0; +UPDATE `creature_text` SET `sound`=14434, `type`=14 WHERE `entry`=29306 AND `groupid`=3 AND `id`=1; +UPDATE `creature_text` SET `sound`=14435, `type`=14 WHERE `entry`=29306 AND `groupid`=3 AND `id`=2; +UPDATE `creature_text` SET `sound`=14436, `type`=14 WHERE `entry`=29306 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `sound`=14437, `type`=14, `text`='Who needs gods when we ARE gods?' WHERE `entry`=29306 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `sound`=14438, `type`=14 WHERE `entry`=29306 AND `groupid`=1 AND `id`=2; +UPDATE `creature_text` SET `sound`=14439, `type`=14 WHERE `entry`=29306 AND `groupid`=2; -- cgit v1.2.3 From c38d95ac33e44ea30908b5d8e8707848094dd5f0 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Sun, 20 Jan 2013 04:30:17 +0100 Subject: Core/Spells: convert some spells to SpellScripts --- .../2013_01_20_03_world_spell_script_names.sql | 81 ++++++ src/server/game/Spells/Auras/SpellAuraEffects.cpp | 284 +-------------------- src/server/game/Spells/Spell.cpp | 5 - src/server/game/Spells/SpellEffects.cpp | 191 +------------- src/server/scripts/Spells/spell_dk.cpp | 107 ++++++++ src/server/scripts/Spells/spell_druid.cpp | 205 +++++++++++++++ src/server/scripts/Spells/spell_generic.cpp | 155 +++++++++++ src/server/scripts/Spells/spell_holiday.cpp | 87 +++++-- src/server/scripts/Spells/spell_item.cpp | 225 ++++++++++++++++ src/server/scripts/Spells/spell_mage.cpp | 178 ++++++++----- src/server/scripts/Spells/spell_paladin.cpp | 111 ++++++++ src/server/scripts/Spells/spell_priest.cpp | 148 ++++++++--- src/server/scripts/Spells/spell_rogue.cpp | 53 ++++ src/server/scripts/Spells/spell_shaman.cpp | 31 +++ src/server/scripts/Spells/spell_warlock.cpp | 38 +++ src/server/scripts/Spells/spell_warrior.cpp | 141 ++++++++++ 16 files changed, 1447 insertions(+), 593 deletions(-) create mode 100644 sql/updates/world/2013_01_20_03_world_spell_script_names.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_03_world_spell_script_names.sql b/sql/updates/world/2013_01_20_03_world_spell_script_names.sql new file mode 100644 index 00000000000..0cd28de0472 --- /dev/null +++ b/sql/updates/world/2013_01_20_03_world_spell_script_names.sql @@ -0,0 +1,81 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +48792, -- spell_dk_icebound_fortitude +59754, -- spell_dk_rune_tap_party +55233, -- spell_dk_vampiric_blood +-1850, -- spell_dru_dash +48391, -- spell_dru_owlkin_frenzy +29166, -- spell_dru_innervate +34246, -- spell_dru_idol_lifebloom +60779, -- spell_dru_idol_lifebloom +-1079, -- spell_dru_rip +-61391,-- spell_dru_typhoon +63845, -- spell_gen_create_lance +28702, -- spell_gen_netherbloom +28720, -- spell_gen_nightmare_vine +26400, -- spell_item_arcane_shroud +8342, -- spell_item_goblin_jumper_cables +22999, -- spell_item_goblin_jumper_cables_xl +54732, -- spell_item_gnomish_army_knife +17512, -- spell_item_piccolo_of_the_flaming_fire +48129, -- spell_item_scroll_of_recall +60320, -- spell_item_scroll_of_recall +60321, -- spell_item_scroll_of_recall +28862, -- spell_item_the_eye_of_diminution +-543, -- spell_mage_fire_frost_ward +-6143, -- spell_mage_fire_frost_ward +-11426,-- spell_mage_ice_barrier +-1463, -- spell_mage_mana_shield +1038, -- spell_pal_hand_of_salvation +58597, -- spell_pal_sacred_shield +-7001, -- spell_pri_lightwell_renew +-17, -- spell_pri_power_word_shield +-1943, -- spell_rog_rupture +-51490,-- spell_sha_thunderstorm +-7235, -- spell_warl_shadow_ward +5246, -- spell_warr_intimidating_shout +-772, -- spell_warr_rend +64380, -- spell_warr_shattering_throw +65941, -- spell_warr_shattering_throw +50725, -- spell_warr_vigilance_trigger +26275 -- spell_winter_veil_px_238_winter_wondervolt +); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(48792, 'spell_dk_icebound_fortitude'), +(59754, 'spell_dk_rune_tap_party'), +(55233, 'spell_dk_vampiric_blood'), +(-1850, 'spell_dru_dash'), +(48391, 'spell_dru_owlkin_frenzy'), +(29166, 'spell_dru_innervate'), +(34246, 'spell_dru_idol_lifebloom'), +(60779, 'spell_dru_idol_lifebloom'), +(-1079, 'spell_dru_rip'), +(-61391,'spell_dru_typhoon'), +(63845, 'spell_gen_create_lance'), +(28702, 'spell_gen_netherbloom'), +(28720, 'spell_gen_nightmare_vine'), +(26400, 'spell_item_arcane_shroud'), +(8342, 'spell_item_goblin_jumper_cables'), +(22999, 'spell_item_goblin_jumper_cables_xl'), +(54732, 'spell_item_gnomish_army_knife'), +(17512, 'spell_item_piccolo_of_the_flaming_fire'), +(48129, 'spell_item_scroll_of_recall'), +(60320, 'spell_item_scroll_of_recall'), +(60321, 'spell_item_scroll_of_recall'), +(28862, 'spell_item_the_eye_of_diminution'), +(-543, 'spell_mage_fire_frost_ward'), +(-6143, 'spell_mage_fire_frost_ward'), +(-11426,'spell_mage_ice_barrier'), +(-1463, 'spell_mage_mana_shield'), +(1038, 'spell_pal_hand_of_salvation'), +(58597, 'spell_pal_sacred_shield'), +(-7001, 'spell_pri_lightwell_renew'), +(-17, 'spell_pri_power_word_shield'), +(-1943, 'spell_rog_rupture'), +(-51490,'spell_sha_thunderstorm'), +(-7235, 'spell_warl_shadow_ward'), +(5246, 'spell_warr_intimidating_shout'), +(-772, 'spell_warr_rend'), +(64380, 'spell_warr_shattering_throw'), +(65941, 'spell_warr_shattering_throw'), +(50725, 'spell_warr_vigilance_trigger'), +(26275, 'spell_winter_veil_px_238_winter_wondervolt'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 3b5c6131c5a..05da36d2ccc 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -483,112 +483,8 @@ int32 AuraEffect::CalculateAmount(Unit* caster) } break; case SPELL_AURA_SCHOOL_ABSORB: - m_canBeRecalculated = false; - if (!caster) - break; - switch (GetSpellInfo()->SpellFamilyName) - { - case SPELLFAMILY_MAGE: - // Ice Barrier - if (GetSpellInfo()->SpellFamilyFlags[1] & 0x1 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) - { - // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; - // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) - // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage - DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); - } - // Fire Ward - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x8 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) - { - // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; - } - // Frost Ward - else if (GetSpellInfo()->SpellFamilyFlags[0] & 0x100 && GetSpellInfo()->SpellFamilyFlags[2] & 0x8) - { - // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; - } - break; - case SPELLFAMILY_WARLOCK: - // Shadow Ward - if (m_spellInfo->SpellFamilyFlags[2] & 0x40) - { - // +80.68% from sp bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8068f; - } - break; - case SPELLFAMILY_PRIEST: - // Power Word: Shield - if (GetSpellInfo()->SpellFamilyFlags[0] & 0x1 && GetSpellInfo()->SpellFamilyFlags[2] & 0x400) - { - // +80.68% from sp bonus - float bonus = 0.8068f; - - // Borrowed Time - if (AuraEffect const* pAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 2899, 1)) - bonus += CalculatePct(1.0f, pAurEff->GetAmount()); - - DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; - // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) - // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage - DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); - DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); - - amount += int32(DoneActualBenefit); - - // Twin Disciplines - if (AuraEffect const* pAurEff = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, caster->GetGUID())) - AddPct(amount, pAurEff->GetAmount()); - - // Focused Power - // Reuse variable, not sure if this code below can be moved before Twin Disciplines - DoneActualBenefit = float(amount); - DoneActualBenefit *= caster->GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT); - amount = int32(DoneActualBenefit); - - return amount; - } - break; - case SPELLFAMILY_PALADIN: - // Sacred Shield - if (m_spellInfo->SpellFamilyFlags[1] & 0x80000) - { - //+75.00% from sp bonus - float bonus = 0.75f; - - DoneActualBenefit += caster->SpellBaseHealingBonusDone(m_spellInfo->GetSchoolMask()) * bonus; - // Divine Guardian is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage - DoneActualBenefit = caster->ApplyEffectModifiers(GetSpellInfo(), m_effIndex, DoneActualBenefit); - DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); - - amount += (int32)DoneActualBenefit; - - // Arena - Dampening - AuraEffect const* pAurEff = caster->GetAuraEffect(74410, 0); - if (!pAurEff) - pAurEff = caster->GetAuraEffect(74411, 0); // Battleground - Dampening - if (pAurEff) - AddPct(amount, pAurEff->GetAmount()); - - return amount; - } - break; - default: - break; - } - break; case SPELL_AURA_MANA_SHIELD: m_canBeRecalculated = false; - if (!caster) - break; - // Mana Shield - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_MAGE && GetSpellInfo()->SpellFamilyFlags[0] & 0x8000 && m_spellInfo->SpellFamilyFlags[2] & 0x8) - { - // +80.53% from +spd bonus - DoneActualBenefit += caster->SpellBaseDamageBonusDone(m_spellInfo->GetSchoolMask()) * 0.8053f; - } break; case SPELL_AURA_DUMMY: if (!caster) @@ -600,161 +496,9 @@ int32 AuraEffect::CalculateAmount(Unit* caster) amount = GetBase()->GetUnitOwner()->SpellHealingBonusTaken(caster, GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); } break; - case SPELL_AURA_PERIODIC_DAMAGE: - if (!caster) - break; - // Rupture - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_ROGUE && m_spellInfo->SpellFamilyFlags[0] & 0x100000) - { - m_canBeRecalculated = false; - if (caster->GetTypeId() != TYPEID_PLAYER) - break; - //1 point : ${($m1+$b1*1+0.015*$AP)*4} damage over 8 secs - //2 points: ${($m1+$b1*2+0.024*$AP)*5} damage over 10 secs - //3 points: ${($m1+$b1*3+0.03*$AP)*6} damage over 12 secs - //4 points: ${($m1+$b1*4+0.03428571*$AP)*7} damage over 14 secs - //5 points: ${($m1+$b1*5+0.0375*$AP)*8} damage over 16 secs - float AP_per_combo[6] = {0.0f, 0.015f, 0.024f, 0.03f, 0.03428571f, 0.0375f}; - uint8 cp = caster->ToPlayer()->GetComboPoints(); - if (cp > 5) cp = 5; - amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * AP_per_combo[cp]); - } - // Rip - else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[0] & 0x00800000 && GetAuraType() == SPELL_AURA_PERIODIC_DAMAGE) - { - m_canBeRecalculated = false; - // 0.01*$AP*cp - if (caster->GetTypeId() != TYPEID_PLAYER) - break; - - uint8 cp = caster->ToPlayer()->GetComboPoints(); - - // Idol of Feral Shadows. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs - if (AuraEffect const* aurEff = caster->GetAuraEffect(34241, EFFECT_0)) - amount += cp * aurEff->GetAmount(); - // Idol of Worship. Cant be handled as SpellMod in SpellAura:Dummy due its dependency from CPs - else if (AuraEffect const* aurEff = caster->GetAuraEffect(60774, EFFECT_0)) - amount += cp * aurEff->GetAmount(); - - amount += uint32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp)); - } - // Rend - else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_WARRIOR && GetSpellInfo()->SpellFamilyFlags[0] & 0x20) - { - m_canBeRecalculated = false; - // $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick - float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); - int32 mws = caster->GetAttackTime(BASE_ATTACK); - float mwb_min = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE); - float mwb_max = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE); - float mwb = ((mwb_min + mwb_max) / 2 + ap * mws / 14000) * 0.2f; - amount += int32(caster->ApplyEffectModifiers(m_spellInfo, m_effIndex, mwb)); - // "If used while your target is above 75% health, Rend does 35% more damage." - // as for 3.1.3 only ranks above 9 (wrong tooltip?) - if (m_spellInfo->GetRank() >= 9) - { - if (GetBase()->GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, m_spellInfo, caster)) - AddPct(amount, m_spellInfo->Effects[EFFECT_2].CalcValue(caster)); - } - } - break; - case SPELL_AURA_PERIODIC_ENERGIZE: - switch (m_spellInfo->Id) - { - case 29166: // Innervate - ApplyPct(amount, float(GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)) / GetTotalTicks()); - break; - case 48391: // Owlkin Frenzy - ApplyPct(amount, GetBase()->GetUnitOwner()->GetCreatePowers(POWER_MANA)); - break; - default: - break; - } - break; - case SPELL_AURA_PERIODIC_HEAL: - if (!caster) - break; - // Lightwell Renew - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PRIEST && m_spellInfo->SpellFamilyFlags[2] & 0x4000) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - // Bonus from Glyph of Lightwell - if (AuraEffect* modHealing = caster->GetAuraEffect(55673, 0)) - AddPct(amount, modHealing->GetAmount()); - } - break; - case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - if (!caster) - break; - // Icebound Fortitude - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DEATHKNIGHT && m_spellInfo->SpellFamilyFlags[0] & 0x00100000) - { - if (caster->GetTypeId() == TYPEID_PLAYER) - { - int32 value = (-1 * amount) - 10; - uint32 defva = uint32(caster->ToPlayer()->GetSkillValue(SKILL_DEFENSE) + caster->ToPlayer()->GetRatingBonusValue(CR_DEFENSE_SKILL)); - - if (defva > 400) - value += int32((defva - 400) * 0.15); - - // Glyph of Icebound Fortitude - if (AuraEffect const* aurEff = caster->GetAuraEffect(58625, 0)) - { - int32 valMax = aurEff->GetAmount(); - if (value < valMax) - value = valMax; - } - amount = -value; - } - } - // Hand of Salvation - else if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_PALADIN && GetSpellInfo()->SpellFamilyFlags[0] & 0x00000100) - { - //Glyph of Salvation - if (caster->GetGUID() == GetBase()->GetUnitOwner()->GetGUID()) - if (AuraEffect const* aurEff = caster->GetAuraEffect(63225, 0)) - amount = -aurEff->GetAmount(); - } - break; - case SPELL_AURA_MOD_THREAT: - { - uint8 level_diff = 0; - float multiplier = 0.0f; - switch (GetId()) - { - // Arcane Shroud - case 26400: - level_diff = GetBase()->GetUnitOwner()->getLevel() - 60; - multiplier = 2; - break; - // The Eye of Diminution - case 28862: - level_diff = GetBase()->GetUnitOwner()->getLevel() - 60; - multiplier = 1; - break; - } - if (level_diff > 0) - amount += int32(multiplier * level_diff); - break; - } - case SPELL_AURA_MOD_INCREASE_HEALTH: - // Vampiric Blood - if (GetId() == 55233) - amount = GetBase()->GetUnitOwner()->CountPctFromMaxHealth(amount); - break; - case SPELL_AURA_MOD_INCREASE_SPEED: - // Dash - do not set speed if not in cat form - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_DRUID && GetSpellInfo()->SpellFamilyFlags[2] & 0x00000008) - amount = GetBase()->GetUnitOwner()->GetShapeshiftForm() == FORM_CAT ? amount : 0; - break; default: break; } - if (DoneActualBenefit != 0.0f) - { - DoneActualBenefit *= caster->CalculateLevelPenalty(GetSpellInfo()); - amount += (int32)DoneActualBenefit; - } GetBase()->CallScriptEffectCalcAmountHandlers(const_cast(this), amount, m_canBeRecalculated); amount *= GetBase()->GetStackAmount(); @@ -848,32 +592,6 @@ void AuraEffect::CalculateSpellMod() { switch (GetAuraType()) { - case SPELL_AURA_DUMMY: - switch (GetSpellInfo()->SpellFamilyName) - { - case SPELLFAMILY_DRUID: - switch (GetId()) - { - case 34246: // Idol of the Emerald Queen - case 60779: // Idol of Lush Moss - { - if (!m_spellmod) - { - m_spellmod = new SpellModifier(GetBase()); - m_spellmod->op = SPELLMOD_DOT; - m_spellmod->type = SPELLMOD_FLAT; - m_spellmod->spellId = GetId(); - m_spellmod->mask[1] = 0x0010; - } - m_spellmod->value = GetAmount()/7; - } - break; - } - break; - default: - break; - } - break; case SPELL_AURA_ADD_FLAT_MODIFIER: case SPELL_AURA_ADD_PCT_MODIFIER: if (!m_spellmod) @@ -882,7 +600,7 @@ void AuraEffect::CalculateSpellMod() m_spellmod->op = SpellModOp(GetMiscValue()); ASSERT(m_spellmod->op < MAX_SPELLMOD); - m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types + m_spellmod->type = SpellModType(GetAuraType()); // SpellModType value == spell aura types m_spellmod->spellId = GetId(); m_spellmod->mask = GetSpellInfo()->Effects[GetEffIndex()].SpellClassMask; m_spellmod->charges = GetBase()->GetCharges(); diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9bb3eaa31f1..054f6a109db 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -1345,11 +1345,6 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge } } - // todo: move to scripts, but we must call it before resize list by MaxAffectedTargets - // Intimidating Shout - if (m_spellInfo->Id == 5246 && effIndex != EFFECT_0) - unitTargets.remove(m_targets.GetUnitTarget()); - // Other special target selection goes here if (uint32 maxTargets = m_spellValue->MaxAffectedTargets) { diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 1dddb08be0b..4fdf6654cba 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -883,12 +883,6 @@ void Spell::EffectTriggerSpell(SpellEffIndex effIndex) m_caster->CastSpell(unitTarget, spell->Id, true); return; } - // Righteous Defense - case 31980: - { - m_caster->CastSpell(unitTarget, 31790, true); - return; - } // Cloak of Shadows case 35729: { @@ -1139,32 +1133,8 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) return; // Pre effects - uint8 uiMaxSafeLevel = 0; switch (m_spellInfo->Id) { - case 48129: // Scroll of Recall - uiMaxSafeLevel = 40; - case 60320: // Scroll of Recall II - if (!uiMaxSafeLevel) - uiMaxSafeLevel = 70; - case 60321: // Scroll of Recal III - if (!uiMaxSafeLevel) - uiMaxSafeLevel = 80; - - if (unitTarget->getLevel() > uiMaxSafeLevel) - { - unitTarget->AddAura(60444, unitTarget); //Apply Lost! Aura - - // ALLIANCE from 60323 to 60330 - HORDE from 60328 to 60335 - uint32 spellId = 60323; - if (m_caster->ToPlayer()->GetTeam() == HORDE) - spellId += 5; - - spellId += urand(0, 7); - m_caster->CastSpell(m_caster, spellId, true); - return; - } - break; case 66550: // teleports outside (Isle of Conquest) if (Player* target = unitTarget->ToPlayer()) { @@ -1188,7 +1158,7 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/) // If not exist data for dest location - return if (!m_targets.HasDst()) { - sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - does not have destination for spell ID %u\n", m_spellInfo->Id); + sLog->outError(LOG_FILTER_SPELLS_AURAS, "Spell::EffectTeleportUnits - does not have destination for spellId %u.", m_spellInfo->Id); return; } @@ -1585,10 +1555,6 @@ void Spell::EffectHealPct(SpellEffIndex /*effIndex*/) if (!m_originalCaster) return; - // Rune Tap - Party - if (m_spellInfo->Id == 59754 && unitTarget == m_caster) - return; - uint32 heal = m_originalCaster->SpellHealingBonusDone(unitTarget, m_spellInfo, unitTarget->CountPctFromMaxHealth(damage), HEAL); heal = unitTarget->SpellHealingBonusTaken(m_originalCaster, m_spellInfo, heal, HEAL); @@ -3732,23 +3698,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) return; unitTarget->RemoveAurasDueToSpell(m_spellInfo->Effects[effIndex].CalcValue()); break; - // PX-238 Winter Wondervolt TRAP - case 26275: - { - uint32 spells[4] = { 26272, 26157, 26273, 26274 }; - - // check presence - for (uint8 j = 0; j < 4; ++j) - if (unitTarget->HasAuraEffect(spells[j], 0)) - return; - - // select spell - uint32 iTmpSpellId = spells[urand(0, 3)]; - - // cast - unitTarget->CastSpell(unitTarget, iTmpSpellId, true); - return; - } // Bending Shinbone case 8856: { @@ -3794,14 +3743,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) m_caster->CastSpell(unitTarget, 22682, true); return; } - // Piccolo of the Flaming Fire - case 17512: - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - unitTarget->HandleEmoteCommand(EMOTE_STATE_DANCE); - return; - } // Decimate case 28374: case 54426: @@ -3944,17 +3885,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) m_caster->MonsterTextEmote(buf, 0); break; } - // Vigilance - case 50725: - { - if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) - return; - - // Remove Taunt cooldown - unitTarget->ToPlayer()->RemoveSpellCooldown(355, true); - - return; - } // Death Knight Initiate Visual case 51519: { @@ -4113,17 +4043,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } return; } - case 63845: // Create Lance - { - if (m_caster->GetTypeId() != TYPEID_PLAYER) - return; - - if (m_caster->ToPlayer()->GetTeam() == ALLIANCE) - m_caster->CastSpell(m_caster, 63914, true); - else - m_caster->CastSpell(m_caster, 63919, true); - return; - } case 59317: // Teleporting { @@ -4317,46 +4236,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) return; } } - case SPELLFAMILY_POTION: - { - switch (m_spellInfo->Id) - { - // Netherbloom - case 28702: - { - if (!unitTarget) - return; - // 25% chance of casting a random buff - if (roll_chance_i(75)) - return; - - // triggered spells are 28703 to 28707 - // Note: some sources say, that there was the possibility of - // receiving a debuff. However, this seems to be removed by a patch. - const uint32 spellid = 28703; - - // don't overwrite an existing aura - for (uint8 i = 0; i < 5; ++i) - if (unitTarget->HasAura(spellid + i)) - return; - unitTarget->CastSpell(unitTarget, spellid+urand(0, 4), true); - break; - } - - // Nightmare Vine - case 28720: - { - if (!unitTarget) - return; - // 25% chance of casting Nightmare Pollen - if (roll_chance_i(75)) - return; - unitTarget->CastSpell(unitTarget, 28721, true); - break; - } - } - break; - } case SPELLFAMILY_DEATHKNIGHT: { // Pestilence @@ -4377,19 +4256,6 @@ void Spell::EffectScriptEffect(SpellEffIndex effIndex) } break; } - case SPELLFAMILY_WARRIOR: - { - // Shattering Throw - if (m_spellInfo->SpellFamilyFlags[1] & 0x00400000) - { - if (!unitTarget) - return; - // remove shields, will still display immune to damage part - unitTarget->RemoveAurasWithMechanic(1<GetTypeId() != TYPEID_PLAYER) + if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) return; - if (unitTarget->isAlive()) + if (unitTarget->isAlive() || !unitTarget->IsInWorld()) return; - if (!unitTarget->IsInWorld()) - return; - - switch (m_spellInfo->Id) - { - // Defibrillate (Goblin Jumper Cables) have 33% chance on success - case 8342: - if (roll_chance_i(67)) - { - m_caster->CastSpell(m_caster, 8338, true, m_CastItem); - return; - } - break; - // Defibrillate (Goblin Jumper Cables XL) have 50% chance on success - case 22999: - if (roll_chance_i(50)) - { - m_caster->CastSpell(m_caster, 23055, true, m_CastItem); - return; - } - break; - // Defibrillate (Gnomish Army Knife) have 67% chance on success_list - case 54732: - if (roll_chance_i(33)) - { - return; - } - break; - default: - break; - } Player* target = unitTarget->ToPlayer(); @@ -5151,26 +4984,10 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex) if (creatureTarget->isWorldBoss() || creatureTarget->IsDungeonBoss()) return; - // Spells with SPELL_EFFECT_KNOCK_BACK(like Thunderstorm) can't knoback target if target has ROOT/STUN + // Spells with SPELL_EFFECT_KNOCK_BACK (like Thunderstorm) can't knockback target if target has ROOT/STUN if (unitTarget->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) return; - // Typhoon - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_DRUID && m_spellInfo->SpellFamilyFlags[1] & 0x01000000) - { - // Glyph of Typhoon - if (m_caster->HasAura(62135)) - return; - } - - // Thunderstorm - if (m_spellInfo->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[1] & 0x00002000) - { - // Glyph of Thunderstorm - if (m_caster->HasAura(62132)) - return; - } - // Instantly interrupt non melee spells being casted if (unitTarget->IsNonMeleeSpellCasted(true)) unitTarget->InterruptNonMeleeSpells(true); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 060db02d53c..62a0599dab1 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -37,6 +37,7 @@ enum DeathKnightSpells SPELL_DK_DEATH_COIL_HEAL = 47633, SPELL_DK_DEATH_STRIKE_HEAL = 45470, SPELL_DK_GHOUL_EXPLODE = 47496, + SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE = 58625, SPELL_DK_RUNIC_POWER_ENERGIZE = 49088, SPELL_DK_SCOURGE_STRIKE_TRIGGERED = 70890, SPELL_DK_WILL_OF_THE_NECROPOLIS_TALENT_R1 = 49189, @@ -584,6 +585,55 @@ class spell_dk_ghoul_explode : public SpellScriptLoader } }; +// 48792 - Icebound Fortitude +class spell_dk_icebound_fortitude : public SpellScriptLoader +{ + public: + spell_dk_icebound_fortitude() : SpellScriptLoader("spell_dk_icebound_fortitude") { } + + class spell_dk_icebound_fortitude_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_icebound_fortitude_AuraScript); + + bool Load() + { + Unit* caster = GetCaster(); + return caster && caster->GetTypeId() == TYPEID_PLAYER; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* caster = GetCaster()) + { + int32 value = amount; + uint32 defValue = uint32(caster->ToPlayer()->GetSkillValue(SKILL_DEFENSE) + caster->ToPlayer()->GetRatingBonusValue(CR_DEFENSE_SKILL)); + + if (defValue > 400) + value -= int32((defValue - 400) * 0.15); + + // Glyph of Icebound Fortitude + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_DK_GLYPH_OF_ICEBOUND_FORTITUDE, EFFECT_0)) + { + int32 valMax = -aurEff->GetAmount(); + if (value > valMax) + value = valMax; + } + amount = value; + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_icebound_fortitude_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_icebound_fortitude_AuraScript(); + } +}; + // 50365, 50371 - Improved Blood Presence class spell_dk_improved_blood_presence : public SpellScriptLoader { @@ -677,6 +727,33 @@ class spell_dk_improved_unholy_presence : public SpellScriptLoader } }; +// 59754 Rune Tap - Party +class spell_dk_rune_tap_party : public SpellScriptLoader +{ + public: + spell_dk_rune_tap_party() : SpellScriptLoader("spell_dk_rune_tap_party") { } + + class spell_dk_rune_tap_party_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dk_rune_tap_party_SpellScript); + + void CheckTargets(std::list& targets) + { + targets.remove(GetCaster()); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dk_rune_tap_party_SpellScript::CheckTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_PARTY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dk_rune_tap_party_SpellScript(); + } +}; + // 55090 - Scourge Strike (55265, 55270, 55271) class spell_dk_scourge_strike : public SpellScriptLoader { @@ -784,6 +861,33 @@ class spell_dk_spell_deflection : public SpellScriptLoader } }; +// 55233 - Vampiric Blood +class spell_dk_vampiric_blood : public SpellScriptLoader +{ + public: + spell_dk_vampiric_blood() : SpellScriptLoader("spell_dk_vampiric_blood") { } + + class spell_dk_vampiric_blood_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_vampiric_blood_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + amount = GetUnitOwner()->CountPctFromMaxHealth(amount); + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dk_vampiric_blood_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_HEALTH); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_vampiric_blood_AuraScript(); + } +}; + // 52284 - Will of the Necropolis class spell_dk_will_of_the_necropolis : public SpellScriptLoader { @@ -861,9 +965,12 @@ void AddSC_deathknight_spell_scripts() new spell_dk_death_pact(); new spell_dk_death_strike(); new spell_dk_ghoul_explode(); + new spell_dk_icebound_fortitude(); new spell_dk_improved_blood_presence(); new spell_dk_improved_unholy_presence(); + new spell_dk_rune_tap_party(); new spell_dk_scourge_strike(); new spell_dk_spell_deflection(); + new spell_dk_vampiric_blood(); new spell_dk_will_of_the_necropolis(); } diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 6dd453597de..e2b918e1c7f 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -30,6 +30,9 @@ enum DruidSpells { SPELL_DRUID_ENRAGE_MOD_DAMAGE = 51185, + SPELL_DRUID_GLYPH_OF_TYPHOON = 62135, + SPELL_DRUID_IDOL_OF_FERAL_SHADOWS = 34241, + SPELL_DRUID_IDOL_OF_WORSHIP = 60774, SPELL_DRUID_INCREASED_MOONFIRE_DURATION = 38414, SPELL_DRUID_KING_OF_THE_JUNGLE = 48492, SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372, @@ -41,6 +44,35 @@ enum DruidSpells SPELL_DRUID_ITEM_T8_BALANCE_RELIC = 64950, }; +// -1850 - Dash +class spell_dru_dash : public SpellScriptLoader +{ + public: + spell_dru_dash() : SpellScriptLoader("spell_dru_dash") { } + + class spell_dru_dash_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_dash_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + // do not set speed if not in cat form + if (GetUnitOwner()->GetShapeshiftForm() != FORM_CAT) + amount = 0; + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_dash_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_INCREASE_SPEED); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_dash_AuraScript(); + } +}; + // -5229 - Enrage class spell_dru_enrage : public SpellScriptLoader { @@ -121,6 +153,69 @@ class spell_dru_glyph_of_starfire : public SpellScriptLoader } }; +// 34246 - Idol of the Emerald Queen +// 60779 - Idol of Lush Moss +class spell_dru_idol_lifebloom : public SpellScriptLoader +{ + public: + spell_dru_idol_lifebloom() : SpellScriptLoader("spell_dru_idol_lifebloom") { } + + class spell_dru_idol_lifebloom_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_idol_lifebloom_AuraScript); + + void HandleEffectCalcSpellMod(AuraEffect const* aurEff, SpellModifier*& spellMod) + { + if (!spellMod) + { + spellMod = new SpellModifier(GetAura()); + spellMod->op = SPELLMOD_DOT; + spellMod->type = SPELLMOD_FLAT; + spellMod->spellId = GetId(); + spellMod->mask = GetSpellInfo()->Effects[aurEff->GetEffIndex()].SpellClassMask; + } + spellMod->value = aurEff->GetAmount() / 7; + } + + void Register() + { + DoEffectCalcSpellMod += AuraEffectCalcSpellModFn(spell_dru_idol_lifebloom_AuraScript::HandleEffectCalcSpellMod, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_idol_lifebloom_AuraScript(); + } +}; + +// 29166 - Innervate +class spell_dru_innervate : public SpellScriptLoader +{ + public: + spell_dru_innervate() : SpellScriptLoader("spell_dru_innervate") { } + + class spell_dru_innervate_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_innervate_AuraScript); + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + amount = CalculatePct(int32(GetUnitOwner()->GetCreatePowers(POWER_MANA) / aurEff->GetTotalTicks()), amount); + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_innervate_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_ENERGIZE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_innervate_AuraScript(); + } +}; + // -5570 - Insect Swarm class spell_dru_insect_swarm : public SpellScriptLoader { @@ -276,6 +371,33 @@ class spell_dru_moonkin_form_passive : public SpellScriptLoader } }; +// 48391 - Owlkin Frenzy +class spell_dru_owlkin_frenzy : public SpellScriptLoader +{ + public: + spell_dru_owlkin_frenzy() : SpellScriptLoader("spell_dru_owlkin_frenzy") { } + + class spell_dru_owlkin_frenzy_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_owlkin_frenzy_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + amount = CalculatePct(GetUnitOwner()->GetCreatePowers(POWER_MANA), amount); + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_owlkin_frenzy_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_PERIODIC_ENERGIZE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_owlkin_frenzy_AuraScript(); + } +}; + // -16972 - Predatory Strikes class spell_dru_predatory_strikes : public SpellScriptLoader { @@ -349,6 +471,54 @@ class spell_dru_primal_tenacity : public SpellScriptLoader } }; +// -1079 - Rip +class spell_dru_rip : public SpellScriptLoader +{ + public: + spell_dru_rip() : SpellScriptLoader("spell_dru_rip") { } + + class spell_dru_rip_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_rip_AuraScript); + + bool Load() + { + Unit* caster = GetCaster(); + return caster && caster->GetTypeId() == TYPEID_PLAYER; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = false; + + if (Unit* caster = GetCaster()) + { + // 0.01 * $AP * cp + uint8 cp = caster->ToPlayer()->GetComboPoints(); + + // Idol of Feral Shadows. Can't be handled as SpellMod due its dependency from CPs + if (AuraEffect const* idol = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_FERAL_SHADOWS, EFFECT_0)) + amount += cp * idol->GetAmount(); + // Idol of Worship. Can't be handled as SpellMod due its dependency from CPs + else if (AuraEffect const* idol = caster->GetAuraEffect(SPELL_DRUID_IDOL_OF_WORSHIP, EFFECT_0)) + amount += cp * idol->GetAmount(); + + amount += int32(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), cp)); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_dru_rip_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_rip_AuraScript(); + } +}; + // 62606 - Savage Defense class spell_dru_savage_defense : public SpellScriptLoader { @@ -658,6 +828,35 @@ class spell_dru_tiger_s_fury : public SpellScriptLoader } }; +// -61391 - Typhoon +class spell_dru_typhoon : public SpellScriptLoader +{ + public: + spell_dru_typhoon() : SpellScriptLoader("spell_dru_typhoon") { } + + class spell_dru_typhoon_SpellScript : public SpellScript + { + PrepareSpellScript(spell_dru_typhoon_SpellScript); + + void HandleKnockBack(SpellEffIndex effIndex) + { + // Glyph of Typhoon + if (GetCaster()->HasAura(SPELL_DRUID_GLYPH_OF_TYPHOON)) + PreventHitDefaultEffect(effIndex); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_dru_typhoon_SpellScript::HandleKnockBack, EFFECT_0, SPELL_EFFECT_KNOCK_BACK); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_dru_typhoon_SpellScript(); + } +}; + // 70691 - Item T10 Restoration 4P Bonus class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader { @@ -715,13 +914,18 @@ class spell_dru_t10_restoration_4p_bonus : public SpellScriptLoader void AddSC_druid_spell_scripts() { + new spell_dru_dash(); new spell_dru_enrage(); new spell_dru_glyph_of_starfire(); + new spell_dru_idol_lifebloom(); + new spell_dru_innervate(); new spell_dru_insect_swarm(); new spell_dru_lifebloom(); new spell_dru_moonkin_form_passive(); + new spell_dru_owlkin_frenzy(); new spell_dru_predatory_strikes(); new spell_dru_primal_tenacity(); + new spell_dru_rip(); new spell_dru_savage_defense(); new spell_dru_savage_roar(); new spell_dru_starfall_aoe(); @@ -729,5 +933,6 @@ void AddSC_druid_spell_scripts() new spell_dru_survival_instincts(); new spell_dru_swift_flight_passive(); new spell_dru_tiger_s_fury(); + new spell_dru_typhoon(); new spell_dru_t10_restoration_4p_bonus(); } diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index b5f4312bae5..6004ec6cf89 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -226,6 +226,158 @@ class spell_gen_cannibalize : public SpellScriptLoader } }; +// 63845 - Create Lance +enum CreateLanceSpells +{ + SPELL_CREATE_LANCE_ALLIANCE = 63914, + SPELL_CREATE_LANCE_HORDE = 63919 +}; + +class spell_gen_create_lance : public SpellScriptLoader +{ + public: + spell_gen_create_lance() : SpellScriptLoader("spell_gen_create_lance") { } + + class spell_gen_create_lance_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_create_lance_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_ALLIANCE) || !sSpellMgr->GetSpellInfo(SPELL_CREATE_LANCE_HORDE)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Player* target = GetHitPlayer()) + { + if (target->GetTeam() == ALLIANCE) + GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_ALLIANCE, true); + else + GetCaster()->CastSpell(target, SPELL_CREATE_LANCE_HORDE, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_create_lance_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_create_lance_SpellScript(); + } +}; + +// 28702 - Netherbloom +enum Netherbloom +{ + SPELL_NETHERBLOOM_POLLEN_1 = 28703 +}; + +class spell_gen_netherbloom : public SpellScriptLoader +{ + public: + spell_gen_netherbloom() : SpellScriptLoader("spell_gen_netherbloom") { } + + class spell_gen_netherbloom_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_netherbloom_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + for (uint8 i = 0; i < 5; ++i) + if (!sSpellMgr->GetSpellInfo(SPELL_NETHERBLOOM_POLLEN_1 + i)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Unit* target = GetHitUnit()) + { + // 25% chance of casting a random buff + if (roll_chance_i(75)) + return; + + // triggered spells are 28703 to 28707 + // Note: some sources say, that there was the possibility of + // receiving a debuff. However, this seems to be removed by a patch. + + // don't overwrite an existing aura + for (uint8 i = 0; i < 5; ++i) + if (target->HasAura(SPELL_NETHERBLOOM_POLLEN_1 + i)) + return; + + target->CastSpell(target, SPELL_NETHERBLOOM_POLLEN_1 + urand(0, 4), true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_netherbloom_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_netherbloom_SpellScript(); + } +}; + +// 28720 - Nightmare Vine +enum NightmareVine +{ + SPELL_NIGHTMARE_POLLEN = 28721 +}; + +class spell_gen_nightmare_vine : public SpellScriptLoader +{ + public: + spell_gen_nightmare_vine() : SpellScriptLoader("spell_gen_nightmare_vine") { } + + class spell_gen_nightmare_vine_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_nightmare_vine_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_NIGHTMARE_POLLEN)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + if (Unit* target = GetHitUnit()) + { + // 25% chance of casting Nightmare Pollen + if (roll_chance_i(25)) + target->CastSpell(target, SPELL_NIGHTMARE_POLLEN, true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_gen_nightmare_vine_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_nightmare_vine_SpellScript(); + } +}; + // 45472 Parachute enum ParachuteSpells { @@ -3195,6 +3347,9 @@ void AddSC_generic_spell_scripts() new spell_gen_av_drekthar_presence(); new spell_gen_burn_brutallus(); new spell_gen_cannibalize(); + new spell_gen_create_lance(); + new spell_gen_netherbloom(); + new spell_gen_nightmare_vine(); new spell_gen_parachute(); new spell_gen_pet_summoned(); new spell_gen_remove_flight_auras(); diff --git a/src/server/scripts/Spells/spell_holiday.cpp b/src/server/scripts/Spells/spell_holiday.cpp index d883b4d7da7..dbfc2b44501 100644 --- a/src/server/scripts/Spells/spell_holiday.cpp +++ b/src/server/scripts/Spells/spell_holiday.cpp @@ -303,27 +303,10 @@ class spell_winter_veil_mistletoe : public SpellScriptLoader 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); + uint32 spellId = RAND(SPELL_CREATE_HOLLY, SPELL_CREATE_MISTLETOE, SPELL_CREATE_SNOWFLAKES); + GetCaster()->CastSpell(target, spellId, true); } } @@ -339,6 +322,71 @@ class spell_winter_veil_mistletoe : public SpellScriptLoader } }; +// 26275 - PX-238 Winter Wondervolt TRAP +enum PX238WinterWondervolt +{ + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1 = 26157, + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2 = 26272, + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3 = 26273, + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4 = 26274 +}; + +class spell_winter_veil_px_238_winter_wondervolt : public SpellScriptLoader +{ + public: + spell_winter_veil_px_238_winter_wondervolt() : SpellScriptLoader("spell_winter_veil_px_238_winter_wondervolt") { } + + class spell_winter_veil_px_238_winter_wondervolt_SpellScript : public SpellScript + { + PrepareSpellScript(spell_winter_veil_px_238_winter_wondervolt_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1) || + !sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2) || + !sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3) || + !sSpellMgr->GetSpellInfo(SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + uint32 const spells[4] = + { + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_1, + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_2, + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_3, + SPELL_PX_238_WINTER_WONDERVOLT_TRANSFORM_4 + }; + + if (Unit* target = GetHitUnit()) + { + for (uint8 i = 0; i < 4; ++i) + if (target->HasAura(spells[i])) + return; + + GetCaster()->CastSpell(target, spells[urand(0, 3)], true); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_winter_veil_px_238_winter_wondervolt_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + + private: + + }; + + SpellScript* GetSpellScript() const + { + return new spell_winter_veil_px_238_winter_wondervolt_SpellScript(); + } +}; + void AddSC_holiday_spell_scripts() { // Love is in the Air @@ -349,4 +397,5 @@ void AddSC_holiday_spell_scripts() new spell_hallow_end_tricky_treat(); // Winter Veil new spell_winter_veil_mistletoe(); + new spell_winter_veil_px_238_winter_wondervolt(); } diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index b4e06cb6b48..c38d05bc02a 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -73,6 +73,93 @@ class spell_item_trigger_spell : public SpellScriptLoader } }; +// 26400 - Arcane Shroud +class spell_item_arcane_shroud : public SpellScriptLoader +{ + public: + spell_item_arcane_shroud() : SpellScriptLoader("spell_item_arcane_shroud") { } + + class spell_item_arcane_shroud_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_arcane_shroud_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + int32 diff = GetUnitOwner()->getLevel() - 60; + if (diff > 0) + amount += 2 * diff; + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_item_arcane_shroud_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_THREAT); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_arcane_shroud_AuraScript(); + } +}; + +// 8342 - Defibrillate (Goblin Jumper Cables) have 33% chance on success +// 22999 - Defibrillate (Goblin Jumper Cables XL) have 50% chance on success +// 54732 - Defibrillate (Gnomish Army Knife) have 67% chance on success +enum Defibrillate +{ + SPELL_GOBLIN_JUMPER_CABLES_FAIL = 8338, + SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL = 23055 +}; + +class spell_item_defibrillate : public SpellScriptLoader +{ + public: + spell_item_defibrillate(char const* name, uint8 chance, uint32 failSpell = 0) : SpellScriptLoader(name), _chance(chance), _failSpell(failSpell) { } + + class spell_item_defibrillate_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_defibrillate_SpellScript); + + public: + spell_item_defibrillate_SpellScript(uint8 chance, uint32 failSpell) : SpellScript(), _chance(chance), _failSpell(failSpell) { } + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (_failSpell && !sSpellMgr->GetSpellInfo(_failSpell)) + return false; + return true; + } + + void HandleScript(SpellEffIndex effIndex) + { + if (roll_chance_i(_chance)) + { + PreventHitDefaultEffect(effIndex); + if (_failSpell) + GetCaster()->CastSpell(GetCaster(), _failSpell, true, GetCastItem()); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_defibrillate_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_RESURRECT); + } + + private: + uint8 _chance; + uint32 _failSpell; + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_defibrillate_SpellScript(_chance, _failSpell); + } + + private: + uint8 _chance; + uint32 _failSpell; +}; + // http://www.wowhead.com/item=6522 Deviate Fish // 8063 Deviate Fish enum DeviateFishSpells @@ -464,6 +551,35 @@ class spell_item_noggenfogger_elixir : public SpellScriptLoader } }; +// 17512 - Piccolo of the Flaming Fire +class spell_item_piccolo_of_the_flaming_fire : public SpellScriptLoader +{ + public: + spell_item_piccolo_of_the_flaming_fire() : SpellScriptLoader("spell_item_piccolo_of_the_flaming_fire") { } + + class spell_item_piccolo_of_the_flaming_fire_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_piccolo_of_the_flaming_fire_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (Player* target = GetHitPlayer()) + target->HandleEmoteCommand(EMOTE_STATE_DANCE); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_piccolo_of_the_flaming_fire_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_piccolo_of_the_flaming_fire_SpellScript(); + } +}; + // http://www.wowhead.com/item=6657 Savory Deviate Delight // 8213 Savory Deviate Delight enum SavoryDeviateDelight @@ -522,6 +638,79 @@ class spell_item_savory_deviate_delight : public SpellScriptLoader } }; +// 48129 - Scroll of Recall +// 60320 - Scroll of Recall II +// 60321 - Scroll of Recall III +enum ScrollOfRecall +{ + SPELL_SCROLL_OF_RECALL_I = 48129, + SPELL_SCROLL_OF_RECALL_II = 60320, + SPELL_SCROLL_OF_RECALL_III = 60321, + SPELL_LOST = 60444, + SPELL_SCROLL_OF_RECALL_FAIL_ALLIANCE_1 = 60323, + SPELL_SCROLL_OF_RECALL_FAIL_HORDE_1 = 60328, +}; + +class spell_item_scroll_of_recall : public SpellScriptLoader +{ + public: + spell_item_scroll_of_recall() : SpellScriptLoader("spell_item_scroll_of_recall") { } + + class spell_item_scroll_of_recall_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_scroll_of_recall_SpellScript); + + bool Load() + { + return GetCaster()->GetTypeId() == TYPEID_PLAYER; + } + + void HandleScript(SpellEffIndex effIndex) + { + Unit* caster = GetCaster(); + uint8 maxSafeLevel = 0; + switch (GetSpellInfo()->Id) + { + case SPELL_SCROLL_OF_RECALL_I: // Scroll of Recall + maxSafeLevel = 40; + break; + case SPELL_SCROLL_OF_RECALL_II: // Scroll of Recall II + maxSafeLevel = 70; + break; + case SPELL_SCROLL_OF_RECALL_III: // Scroll of Recal III + maxSafeLevel = 80; + break; + default: + break; + } + + if (caster->getLevel() > maxSafeLevel) + { + caster->CastSpell(caster, SPELL_LOST, true); + + // ALLIANCE from 60323 to 60330 - HORDE from 60328 to 60335 + uint32 spellId = SPELL_SCROLL_OF_RECALL_FAIL_ALLIANCE_1; + if (GetCaster()->ToPlayer()->GetTeam() == HORDE) + spellId = SPELL_SCROLL_OF_RECALL_FAIL_HORDE_1; + + GetCaster()->CastSpell(GetCaster(), spellId + urand(0, 7), true); + + PreventHitDefaultEffect(effIndex); + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_item_scroll_of_recall_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_TELEPORT_UNITS); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_item_scroll_of_recall_SpellScript(); + } +}; + // http://www.wowhead.com/item=7734 Six Demon Bag // 14537 Six Demon Bag enum SixDemonBagSpells @@ -593,6 +782,35 @@ class spell_item_six_demon_bag : public SpellScriptLoader } }; +// 28862 - The Eye of Diminution +class spell_item_the_eye_of_diminution : public SpellScriptLoader +{ + public: + spell_item_the_eye_of_diminution() : SpellScriptLoader("spell_item_the_eye_of_diminution") { } + + class spell_item_the_eye_of_diminution_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_the_eye_of_diminution_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + int32 diff = GetUnitOwner()->getLevel() - 60; + if (diff > 0) + amount += diff; + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_item_the_eye_of_diminution_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MOD_THREAT); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_the_eye_of_diminution_AuraScript(); + } +}; + // http://www.wowhead.com/item=44012 Underbelly Elixir // 59640 Underbelly Elixir enum UnderbellyElixirSpells @@ -2030,6 +2248,10 @@ void AddSC_item_spell_scripts() // 23075 Mithril Mechanical Dragonling new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING); + new spell_item_arcane_shroud(); + new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL); + new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL); + new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); new spell_item_deviate_fish(); new spell_item_flask_of_the_north(); new spell_item_gnomish_death_ray(); @@ -2037,8 +2259,11 @@ void AddSC_item_spell_scripts() new spell_item_mingos_fortune_generator(); new spell_item_net_o_matic(); new spell_item_noggenfogger_elixir(); + new spell_item_piccolo_of_the_flaming_fire(); new spell_item_savory_deviate_delight(); + new spell_item_scroll_of_recall(); new spell_item_six_demon_bag(); + new spell_item_the_eye_of_diminution(); new spell_item_underbelly_elixir(); new spell_item_shadowmourne(); new spell_item_red_rider_air_rifle(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index 61f0579190f..a673759a49e 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -29,7 +29,7 @@ enum MageSpells { SPELL_MAGE_COLD_SNAP = 11958, - SPELL_MAGE_FROST_WARDING_R1 = 28332, + SPELL_MAGE_FROST_WARDING_R1 = 11189, SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, @@ -45,6 +45,31 @@ enum MageSpells SPELL_MAGE_GLYPH_OF_BLAST_WAVE = 62126, }; +// Incanter's Absorbtion +class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript +{ + public: + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1)) + return false; + return true; + } + + void Trigger(AuraEffect* aurEff, DamageInfo& /*dmgInfo*/, uint32& absorbAmount) + { + Unit* target = GetTarget(); + + if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0)) + { + int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + } + } +}; + // -11113 - Blast Wave class spell_mage_blast_wave : public SpellScriptLoader { @@ -127,29 +152,47 @@ class spell_mage_cold_snap : public SpellScriptLoader } }; -// -543, -6143 - Frost Warding -class spell_mage_frost_warding_trigger : public SpellScriptLoader +// -543 - Fire Ward +// -6143 - Frost Ward +class spell_mage_fire_frost_ward : public SpellScriptLoader { public: - spell_mage_frost_warding_trigger() : SpellScriptLoader("spell_mage_frost_warding_trigger") { } + spell_mage_fire_frost_ward() : SpellScriptLoader("spell_mage_fire_frost_ward") { } - class spell_mage_frost_warding_trigger_AuraScript : public AuraScript + class spell_mage_fire_frost_ward_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript { - PrepareAuraScript(spell_mage_frost_warding_trigger_AuraScript); + PrepareAuraScript(spell_mage_fire_frost_ward_AuraScript); bool Validate(SpellInfo const* /*spellInfo*/) { - if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1)) + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_TRIGGERED)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FROST_WARDING_R1)) return false; return true; } - void Absorb(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = false; + if (Unit* caster = GetCaster()) + { + // +80.68% from sp bonus + float bonus = 0.8068f; + + bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); + bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); + + amount += int32(bonus); + } + } + + void Absorb(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) { Unit* target = GetTarget(); if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_FROST_WARDING_R1, EFFECT_0)) { - int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); + int32 chance = talentAurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); // SPELL_EFFECT_DUMMY with NO_TARGET if (roll_chance_i(chance)) { @@ -164,79 +207,58 @@ class spell_mage_frost_warding_trigger : public SpellScriptLoader void Register() { - OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_frost_warding_trigger_AuraScript::Absorb, EFFECT_0); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_fire_frost_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + OnEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward_AuraScript::Absorb, EFFECT_0); + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_fire_frost_ward_AuraScript::Trigger, EFFECT_0); } }; AuraScript* GetAuraScript() const { - return new spell_mage_frost_warding_trigger_AuraScript(); + return new spell_mage_fire_frost_ward_AuraScript(); } }; -class spell_mage_incanters_absorbtion_base_AuraScript : public AuraScript +// -11426 - Ice Barrier +class spell_mage_ice_barrier : public SpellScriptLoader { public: + spell_mage_ice_barrier() : SpellScriptLoader("spell_mage_ice_barrier") { } - bool Validate(SpellInfo const* /*spellInfo*/) - { - return sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED) - && sSpellMgr->GetSpellInfo(SPELL_MAGE_INCANTERS_ABSORBTION_R1); - } - - void Trigger(AuraEffect* aurEff, DamageInfo & /*dmgInfo*/, uint32 & absorbAmount) + class spell_mage_ice_barrier_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript { - Unit* target = GetTarget(); + PrepareAuraScript(spell_mage_ice_barrier_AuraScript); - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_MAGE_INCANTERS_ABSORBTION_R1, EFFECT_0)) + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) { - int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(target, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); - } - } -}; - -// -543, -6143, -11426 - Incanter's Absorption -class spell_mage_incanters_absorbtion_absorb : public SpellScriptLoader -{ - public: - spell_mage_incanters_absorbtion_absorb() : SpellScriptLoader("spell_mage_incanters_absorbtion_absorb") { } + canBeRecalculated = false; + if (Unit* caster = GetCaster()) + { + // +80.68% from sp bonus + float bonus = 0.8068f; - class spell_mage_incanters_absorbtion_absorb_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript - { - PrepareAuraScript(spell_mage_incanters_absorbtion_absorb_AuraScript); + bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); - void Register() - { - AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_incanters_absorbtion_absorb_AuraScript::Trigger, EFFECT_0); - } - }; + // Glyph of Ice Barrier: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) + // Glyph of Ice Barrier is only applied at the spell damage bonus because it was already applied to the base value in CalculateSpellDamage + bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus); - AuraScript* GetAuraScript() const - { - return new spell_mage_incanters_absorbtion_absorb_AuraScript(); - } -}; + bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); -// -1463 - Incanter's Absorption -class spell_mage_incanters_absorbtion_manashield : public SpellScriptLoader -{ - public: - spell_mage_incanters_absorbtion_manashield() : SpellScriptLoader("spell_mage_incanters_absorbtion_manashield") { } - - class spell_mage_incanters_absorbtion_manashield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript - { - PrepareAuraScript(spell_mage_incanters_absorbtion_manashield_AuraScript); + amount += int32(bonus); + } + } void Register() { - AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_incanters_absorbtion_manashield_AuraScript::Trigger, EFFECT_0); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_ice_barrier_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_mage_ice_barrier_AuraScript::Trigger, EFFECT_0); } }; AuraScript* GetAuraScript() const { - return new spell_mage_incanters_absorbtion_manashield_AuraScript(); + return new spell_mage_ice_barrier_AuraScript(); } }; @@ -279,6 +301,44 @@ class spell_mage_living_bomb : public SpellScriptLoader } }; +// -1463 - Mana Shield +class spell_mage_mana_shield : public SpellScriptLoader +{ + public: + spell_mage_mana_shield() : SpellScriptLoader("spell_mage_mana_shield") { } + + class spell_mage_mana_shield_AuraScript : public spell_mage_incanters_absorbtion_base_AuraScript + { + PrepareAuraScript(spell_mage_mana_shield_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = false; + if (Unit* caster = GetCaster()) + { + // +80.53% from sp bonus + float bonus = 0.8053f; + + bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); + bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); + + amount += int32(bonus); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mage_mana_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_MANA_SHIELD); + AfterEffectManaShield += AuraEffectManaShieldFn(spell_mage_mana_shield_AuraScript::Trigger, EFFECT_0); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_mana_shield_AuraScript(); + } +}; + enum SilvermoonPolymorph { NPC_AUROSALIA = 18744, @@ -378,10 +438,10 @@ void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); new spell_mage_cold_snap(); - new spell_mage_frost_warding_trigger(); - new spell_mage_incanters_absorbtion_absorb(); - new spell_mage_incanters_absorbtion_manashield(); + new spell_mage_fire_frost_ward(); + new spell_mage_ice_barrier(); new spell_mage_living_bomb(); + new spell_mage_mana_shield(); new spell_mage_polymorph_cast_visual(); new spell_mage_summon_water_elemental(); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index d3fc86302e1..2f22de97d77 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -51,6 +51,13 @@ enum PaladinSpells SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, SPELL_PALADIN_DIVINE_SACRIFICE = 64205, + + SPELL_PALADIN_GLYPH_OF_SALVATION = 63225, + + SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790, + + SPELL_GENERIC_ARENA_DAMPENING = 74410, + SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411 }; // 31850 - Ardent Defender @@ -490,6 +497,39 @@ class spell_pal_hand_of_sacrifice : public SpellScriptLoader } }; +// 1038 - Hand of Salvation +class spell_pal_hand_of_salvation : public SpellScriptLoader +{ + public: + spell_pal_hand_of_salvation() : SpellScriptLoader("spell_pal_hand_of_salvation") { } + + class spell_pal_hand_of_salvation_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_hand_of_salvation_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* caster = GetCaster()) + { + // Glyph of Salvation + if (caster->GetGUID() == GetUnitOwner()->GetGUID()) + if (AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_PALADIN_GLYPH_OF_SALVATION, EFFECT_0)) + amount -= aurEff->GetAmount(); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_hand_of_salvation_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_hand_of_salvation_AuraScript(); + } +}; + // -20473 - Holy Shock class spell_pal_holy_shock : public SpellScriptLoader { @@ -656,6 +696,13 @@ class spell_pal_righteous_defense : public SpellScriptLoader { PrepareSpellScript(spell_pal_righteous_defense_SpellScript); + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT)) + return false; + return true; + } + SpellCastResult CheckCast() { Unit* caster = GetCaster(); @@ -673,9 +720,27 @@ class spell_pal_righteous_defense : public SpellScriptLoader return SPELL_CAST_OK; } + void HandleTriggerSpellLaunch(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + } + + void HandleTriggerSpellHit(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + if (Unit* target = GetHitUnit()) + GetCaster()->CastSpell(target, SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT, true); + } + void Register() { OnCheckCast += SpellCheckCastFn(spell_pal_righteous_defense_SpellScript::CheckCast); + //! WORKAROUND + //! target select will be executed in hitphase of effect 0 + //! so we must handle trigger spell also in hit phase (default execution in launch phase) + //! see issue #3718 + OnEffectLaunchTarget += SpellEffectFn(spell_pal_righteous_defense_SpellScript::HandleTriggerSpellLaunch, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL); + OnEffectHitTarget += SpellEffectFn(spell_pal_righteous_defense_SpellScript::HandleTriggerSpellHit, EFFECT_1, SPELL_EFFECT_TRIGGER_SPELL); } }; @@ -685,6 +750,50 @@ class spell_pal_righteous_defense : public SpellScriptLoader } }; +// 58597 - Sacred Shield +class spell_pal_sacred_shield : public SpellScriptLoader +{ + public: + spell_pal_sacred_shield() : SpellScriptLoader("spell_pal_sacred_shield") { } + + class spell_pal_sacred_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_sacred_shield_AuraScript); + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* caster = GetCaster()) + { + // +75.00% from sp bonus + float bonus = CalculatePct(caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()), 75.0f); + + // Divine Guardian is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage + bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus); + bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); + + amount += int32(bonus); + + // Arena - Dampening + if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_ARENA_DAMPENING, EFFECT_0)) + AddPct(amount, dampening->GetAmount()); + // Battleground - Dampening + else if (AuraEffect const* dampening = caster->GetAuraEffect(SPELL_GENERIC_BATTLEGROUND_DAMPENING, EFFECT_0)) + AddPct(amount, dampening->GetAmount()); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pal_sacred_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_sacred_shield_AuraScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -696,8 +805,10 @@ void AddSC_paladin_spell_scripts() new spell_pal_exorcism_and_holy_wrath_damage(); new spell_pal_guarded_by_the_light(); new spell_pal_hand_of_sacrifice(); + new spell_pal_hand_of_salvation(); new spell_pal_holy_shock(); new spell_pal_judgement_of_command(); new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); + new spell_pal_sacred_shield(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 1c416a0d28a..23a39819aa2 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -30,6 +30,7 @@ enum PriestSpells { SPELL_PRIEST_EMPOWERED_RENEW = 63544, + SPELL_PRIEST_GLYPHE_OF_LIGHTWELL = 55673, SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL = 48153, SPELL_PRIEST_PENANCE_R1 = 47540, SPELL_PRIEST_PENANCE_R1_DAMAGE = 47758, @@ -43,6 +44,7 @@ enum PriestSpells enum PriestSpellIcons { + PRIEST_ICON_ID_BORROWED_TIME = 2899, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, }; @@ -104,6 +106,38 @@ class spell_pri_guardian_spirit : public SpellScriptLoader } }; +// -7001 - Lightwell Renew +class spell_pri_lightwell_renew : public SpellScriptLoader +{ + public: + spell_pri_lightwell_renew() : SpellScriptLoader("spell_pri_lightwell_renew") { } + + class spell_pri_lightwell_renew_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_lightwell_renew_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/) + { + if (Unit* caster = GetCaster()) + { + // Bonus from Glyph of Lightwell + if (AuraEffect* modHealing = caster->GetAuraEffect(SPELL_PRIEST_GLYPHE_OF_LIGHTWELL, EFFECT_0)) + AddPct(amount, modHealing->GetAmount()); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_lightwell_renew_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_lightwell_renew_AuraScript(); + } +}; + // -8129 - Mana Burn class spell_pri_mana_burn : public SpellScriptLoader { @@ -260,81 +294,114 @@ class spell_pri_penance : public SpellScriptLoader } }; -// 33110 - Prayer of Mending Heal -class spell_pri_prayer_of_mending_heal : public SpellScriptLoader +// -17 - Power Word: Shield +class spell_pri_power_word_shield : public SpellScriptLoader { public: - spell_pri_prayer_of_mending_heal() : SpellScriptLoader("spell_pri_prayer_of_mending_heal") { } + spell_pri_power_word_shield() : SpellScriptLoader("spell_pri_power_word_shield") { } - class spell_pri_prayer_of_mending_heal_SpellScript : public SpellScript + class spell_pri_power_word_shield_AuraScript : public AuraScript { - PrepareSpellScript(spell_pri_prayer_of_mending_heal_SpellScript); + PrepareAuraScript(spell_pri_power_word_shield_AuraScript); - void HandleHeal(SpellEffIndex /*effIndex*/) + bool Validate(SpellInfo const* /*spellInfo*/) { - if (Unit* caster = GetOriginalCaster()) + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_R1)) + return false; + return true; + } + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = false; + if (Unit* caster = GetCaster()) { - if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_PRIEST_T9_HEALING_2P, EFFECT_0)) + // +80.68% from sp bonus + float bonus = 0.8068f; + + // Borrowed Time + if (AuraEffect const* borrowedTime = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_BORROWED_TIME, EFFECT_1)) + bonus += CalculatePct(1.0f, borrowedTime->GetAmount()); + + bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); + + // Improved PW: Shield: its weird having a SPELLMOD_ALL_EFFECTS here but its blizzards doing :) + // Improved PW: Shield is only applied at the spell healing bonus because it was already applied to the base value in CalculateSpellDamage + bonus = caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), bonus); + bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); + + amount += int32(bonus); + + // Twin Disciplines + if (AuraEffect const* twinDisciplines = caster->GetAuraEffect(SPELL_AURA_ADD_PCT_MODIFIER, SPELLFAMILY_PRIEST, 0x400000, 0, 0, GetCasterGUID())) + AddPct(amount, twinDisciplines->GetAmount()); + + // Focused Power + amount *= caster->GetTotalAuraMultiplier(SPELL_AURA_MOD_HEALING_DONE_PERCENT); + } + } + + void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount) + { + Unit* target = GetTarget(); + if (dmgInfo.GetAttacker() == target) + return; + + if (Unit* caster = GetCaster()) + if (AuraEffect* talentAurEff = caster->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) { - int32 heal = GetHitHeal(); - AddPct(heal, aurEff->GetAmount()); - SetHitHeal(heal); + int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); + target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); } - } } void Register() { - OnEffectHitTarget += SpellEffectFn(spell_pri_prayer_of_mending_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_pri_power_word_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + AfterEffectAbsorb += AuraEffectAbsorbFn(spell_pri_power_word_shield_AuraScript::ReflectDamage, EFFECT_0); } }; - SpellScript* GetSpellScript() const + AuraScript* GetAuraScript() const { - return new spell_pri_prayer_of_mending_heal_SpellScript(); + return new spell_pri_power_word_shield_AuraScript(); } }; -// -17 - Reflective Shield -class spell_pri_reflective_shield_trigger : public SpellScriptLoader +// 33110 - Prayer of Mending Heal +class spell_pri_prayer_of_mending_heal : public SpellScriptLoader { public: - spell_pri_reflective_shield_trigger() : SpellScriptLoader("spell_pri_reflective_shield_trigger") { } + spell_pri_prayer_of_mending_heal() : SpellScriptLoader("spell_pri_prayer_of_mending_heal") { } - class spell_pri_reflective_shield_trigger_AuraScript : public AuraScript + class spell_pri_prayer_of_mending_heal_SpellScript : public SpellScript { - PrepareAuraScript(spell_pri_reflective_shield_trigger_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED) || !sSpellMgr->GetSpellInfo(SPELL_PRIEST_REFLECTIVE_SHIELD_R1)) - return false; - return true; - } + PrepareSpellScript(spell_pri_prayer_of_mending_heal_SpellScript); - void Trigger(AuraEffect* aurEff, DamageInfo & dmgInfo, uint32 & absorbAmount) + void HandleHeal(SpellEffIndex /*effIndex*/) { - Unit* target = GetTarget(); - if (dmgInfo.GetAttacker() == target) - return; - - if (GetCaster()) - if (AuraEffect* talentAurEff = target->GetAuraEffectOfRankedSpell(SPELL_PRIEST_REFLECTIVE_SHIELD_R1, EFFECT_0)) + if (Unit* caster = GetOriginalCaster()) + { + if (AuraEffect* aurEff = caster->GetAuraEffect(SPELL_PRIEST_T9_HEALING_2P, EFFECT_0)) { - int32 bp = CalculatePct(absorbAmount, talentAurEff->GetAmount()); - target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED, &bp, NULL, NULL, true, NULL, aurEff); + int32 heal = GetHitHeal(); + AddPct(heal, aurEff->GetAmount()); + SetHitHeal(heal); } + } } void Register() { - AfterEffectAbsorb += AuraEffectAbsorbFn(spell_pri_reflective_shield_trigger_AuraScript::Trigger, EFFECT_0); + OnEffectHitTarget += SpellEffectFn(spell_pri_prayer_of_mending_heal_SpellScript::HandleHeal, EFFECT_0, SPELL_EFFECT_HEAL); } }; - AuraScript* GetAuraScript() const + SpellScript* GetSpellScript() const { - return new spell_pri_reflective_shield_trigger_AuraScript(); + return new spell_pri_prayer_of_mending_heal_SpellScript(); } }; @@ -458,12 +525,13 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void AddSC_priest_spell_scripts() { new spell_pri_guardian_spirit(); + new spell_pri_lightwell_renew(); new spell_pri_mana_burn(); new spell_pri_mind_sear(); new spell_pri_pain_and_suffering_proc(); new spell_pri_penance(); + new spell_pri_power_word_shield(); new spell_pri_prayer_of_mending_heal(); - new spell_pri_reflective_shield_trigger(); new spell_pri_renew(); new spell_pri_shadow_word_death(); new spell_pri_vampiric_touch(); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 70b677f5aaa..156158b4e36 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -347,6 +347,58 @@ class spell_rog_prey_on_the_weak : public SpellScriptLoader } }; +// -1943 - Rupture +class spell_rog_rupture : public SpellScriptLoader +{ + public: + spell_rog_rupture() : SpellScriptLoader("spell_rog_rupture") { } + + class spell_rog_rupture_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_rupture_AuraScript); + + bool Load() + { + Unit* caster = GetCaster(); + return caster && caster->GetTypeId() == TYPEID_PLAYER; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + if (Unit* caster = GetCaster()) + { + canBeRecalculated = false; + + float const attackpowerPerCombo[6] = + { + 0.0f, + 0.015f, // 1 point: ${($m1 + $b1*1 + 0.015 * $AP) * 4} damage over 8 secs + 0.024f, // 2 points: ${($m1 + $b1*2 + 0.024 * $AP) * 5} damage over 10 secs + 0.03f, // 3 points: ${($m1 + $b1*3 + 0.03 * $AP) * 6} damage over 12 secs + 0.03428571f, // 4 points: ${($m1 + $b1*4 + 0.03428571 * $AP) * 7} damage over 14 secs + 0.0375f // 5 points: ${($m1 + $b1*5 + 0.0375 * $AP) * 8} damage over 16 secs + }; + + uint8 cp = caster->ToPlayer()->GetComboPoints(); + if (cp > 5) + cp = 5; + + amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * attackpowerPerCombo[cp]); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_rog_rupture_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_rog_rupture_AuraScript(); + } +}; + // 5938 - Shiv class spell_rog_shiv : public SpellScriptLoader { @@ -395,5 +447,6 @@ void AddSC_rogue_spell_scripts() new spell_rog_nerves_of_steel(); new spell_rog_preparation(); new spell_rog_prey_on_the_weak(); + new spell_rog_rupture(); new spell_rog_shiv(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 0d249953421..2994761be6f 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -38,6 +38,7 @@ enum ShamanSpells SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349, SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, SPELL_SHAMAN_GLYPH_OF_MANA_TIDE = 55441, + SPELL_SHAMAN_GLYPH_OF_THUNDERSTORM = 62132, SPELL_SHAMAN_LAVA_FLOWS_R1 = 51480, SPELL_SHAMAN_LAVA_FLOWS_TRIGGERED_R1 = 64694, SPELL_SHAMAN_MANA_SPRING_TOTEM_ENERGIZE = 52032, @@ -743,6 +744,35 @@ class spell_sha_sentry_totem : public SpellScriptLoader } }; +// -51490 - Thunderstorm +class spell_sha_thunderstorm : public SpellScriptLoader +{ + public: + spell_sha_thunderstorm() : SpellScriptLoader("spell_sha_thunderstorm") { } + + class spell_sha_thunderstorm_SpellScript : public SpellScript + { + PrepareSpellScript(spell_sha_thunderstorm_SpellScript); + + void HandleKnockBack(SpellEffIndex effIndex) + { + // Glyph of Thunderstorm + if (GetCaster()->HasAura(SPELL_SHAMAN_GLYPH_OF_THUNDERSTORM)) + PreventHitDefaultEffect(effIndex); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_sha_thunderstorm_SpellScript::HandleKnockBack, EFFECT_2, SPELL_EFFECT_KNOCK_BACK); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_sha_thunderstorm_SpellScript(); + } +}; + void AddSC_shaman_spell_scripts() { new spell_sha_ancestral_awakening_proc(); @@ -760,4 +790,5 @@ void AddSC_shaman_spell_scripts() new spell_sha_mana_spring_totem(); new spell_sha_mana_tide_totem(); new spell_sha_sentry_totem(); + new spell_sha_thunderstorm(); } diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 89c69733daf..68ad1315dce 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -649,6 +649,43 @@ class spell_warl_seed_of_corruption : public SpellScriptLoader } }; +// -7235 - Shadow Ward +class spell_warl_shadow_ward : public SpellScriptLoader +{ + public: + spell_warl_shadow_ward() : SpellScriptLoader("spell_warl_shadow_ward") { } + + class spell_warl_shadow_ward_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_shadow_ward_AuraScript); + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& canBeRecalculated) + { + canBeRecalculated = false; + if (Unit* caster = GetCaster()) + { + // +80.68% from sp bonus + float bonus = 0.8068f; + + bonus *= caster->SpellBaseHealingBonusDone(GetSpellInfo()->GetSchoolMask()); + bonus *= caster->CalculateLevelPenalty(GetSpellInfo()); + + amount += int32(bonus); + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warl_shadow_ward_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_shadow_ward_AuraScript(); + } +}; + // 29858 - Soulshatter class spell_warl_soulshatter : public SpellScriptLoader { @@ -742,6 +779,7 @@ void AddSC_warlock_spell_scripts() new spell_warl_life_tap(); new spell_warl_ritual_of_doom_effect(); new spell_warl_seed_of_corruption(); + new spell_warl_shadow_ward(); new spell_warl_soulshatter(); new spell_warl_unstable_affliction(); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index f84265b89de..822d4b17992 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -41,6 +41,7 @@ enum WarriorSpells SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976, SPELL_WARRIOR_SLAM = 50783, + SPELL_WARRIOR_TAUNT = 355, SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859, SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2 = 46860, SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, @@ -333,6 +334,34 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader } }; +// 5246 - Intimidating Shout +class spell_warr_intimidating_shout : public SpellScriptLoader +{ + public: + spell_warr_intimidating_shout() : SpellScriptLoader("spell_warr_intimidating_shout") { } + + class spell_warr_intimidating_shout_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_intimidating_shout_SpellScript); + + void FilterTargets(std::list& unitList) + { + unitList.remove(GetExplTargetWorldObject()); + } + + void Register() + { + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_intimidating_shout_SpellScript::FilterTargets, EFFECT_1, TARGET_UNIT_SRC_AREA_ENEMY); + OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_warr_intimidating_shout_SpellScript::FilterTargets, EFFECT_2, TARGET_UNIT_SRC_AREA_ENEMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_intimidating_shout_SpellScript(); + } +}; + // 12975 - Last Stand class spell_warr_last_stand : public SpellScriptLoader { @@ -409,6 +438,83 @@ class spell_warr_overpower : public SpellScriptLoader } }; +// -772 - Rend +class spell_warr_rend : public SpellScriptLoader +{ + public: + spell_warr_rend() : SpellScriptLoader("spell_warr_rend") { } + + class spell_warr_rend_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_rend_AuraScript); + + void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& canBeRecalculated) + { + if (Unit* caster = GetCaster()) + { + canBeRecalculated = false; + + // $0.2 * (($MWB + $mwb) / 2 + $AP / 14 * $MWS) bonus per tick + float ap = caster->GetTotalAttackPowerValue(BASE_ATTACK); + int32 mws = caster->GetAttackTime(BASE_ATTACK); + float mwbMin = caster->GetWeaponDamageRange(BASE_ATTACK, MINDAMAGE); + float mwbMax = caster->GetWeaponDamageRange(BASE_ATTACK, MAXDAMAGE); + float mwb = ((mwbMin + mwbMax) / 2 + ap * mws / 14000) * 0.2f; + amount += int32(caster->ApplyEffectModifiers(GetSpellInfo(), aurEff->GetEffIndex(), mwb)); + + // "If used while your target is above 75% health, Rend does 35% more damage." + // as for 3.1.3 only ranks above 9 (wrong tooltip?) + if (GetSpellInfo()->GetRank() >= 9) + { + if (GetUnitOwner()->HasAuraState(AURA_STATE_HEALTH_ABOVE_75_PERCENT, GetSpellInfo(), caster)) + AddPct(amount, GetSpellInfo()->Effects[EFFECT_2].CalcValue(caster)); + } + } + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_warr_rend_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warr_rend_AuraScript(); + } +}; + +// 64380, 65941 - Shattering Throw +class spell_warr_shattering_throw : public SpellScriptLoader +{ + public: + spell_warr_shattering_throw() : SpellScriptLoader("spell_warr_shattering_throw") { } + + class spell_warr_shattering_throw_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_shattering_throw_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + // remove shields, will still display immune to damage part + if (Unit* target = GetHitUnit()) + target->RemoveAurasWithMechanic(1 << MECHANIC_IMMUNE_SHIELD, AURA_REMOVE_BY_ENEMY_SPELL); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_shattering_throw_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_shattering_throw_SpellScript(); + } +}; + // -1464 - Slam class spell_warr_slam : public SpellScriptLoader { @@ -493,6 +599,37 @@ class spell_warr_vigilance : public SpellScriptLoader } }; +// 50725 Vigilance +class spell_warr_vigilance_trigger : public SpellScriptLoader +{ + public: + spell_warr_vigilance_trigger() : SpellScriptLoader("spell_warr_vigilance_trigger") { } + + class spell_warr_vigilance_trigger_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warr_vigilance_trigger_SpellScript); + + void HandleScript(SpellEffIndex effIndex) + { + PreventHitDefaultEffect(effIndex); + + // Remove Taunt cooldown + if (Player* target = GetHitPlayer()) + target->RemoveSpellCooldown(SPELL_WARRIOR_TAUNT, true); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warr_vigilance_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warr_vigilance_trigger_SpellScript(); + } +}; + void AddSC_warrior_spell_scripts() { new spell_warr_bloodthirst(); @@ -502,8 +639,12 @@ void AddSC_warrior_spell_scripts() new spell_warr_deep_wounds(); new spell_warr_execute(); new spell_warr_improved_spell_reflection(); + new spell_warr_intimidating_shout(); new spell_warr_last_stand(); new spell_warr_overpower(); + new spell_warr_rend(); + new spell_warr_shattering_throw(); new spell_warr_slam(); new spell_warr_vigilance(); + new spell_warr_vigilance_trigger(); } -- cgit v1.2.3 From d7ace2e5bf47860af2414bade612e54a948bdf2f Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sat, 19 Jan 2013 22:51:47 -0500 Subject: DB/Creature Text: Misc texts / type and sounds updates for Slad'ran & Moorabi --- sql/updates/world/2013_01_20_03_world_creature_text.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sql/updates/world/2013_01_20_03_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_03_world_creature_text.sql b/sql/updates/world/2013_01_20_03_world_creature_text.sql new file mode 100644 index 00000000000..1ea2c121e1e --- /dev/null +++ b/sql/updates/world/2013_01_20_03_world_creature_text.sql @@ -0,0 +1,15 @@ +-- Moorabi +UPDATE `creature_text` SET `sound`=14721, `text`='We fought back da Scourge. What chance joo thinkin'' JOO got?' WHERE `entry`=29305 AND `groupid`=0; +UPDATE `creature_text` SET `sound`=14722 WHERE `entry`=29305 AND `groupid`=3; +UPDATE `creature_text` SET `sound`=14723, `text`='Da ground gonna swallow you up!' WHERE `entry`=29305 AND `groupid`=4; +UPDATE `creature_text` SET `sound`=14726, `text`='Who gonna stop me? You?' WHERE `entry`=29305 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `sound`=14727, `text`='Not so tough now!!' WHERE `entry`=29305 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `sound`=14728, `text`='If our gods can die... den so can we....' WHERE `entry`=29305 AND `groupid`=2; + +-- Slad'ran +UPDATE `creature_text` SET `sound`=14444, `type`=14 WHERE `entry`=29304 AND `groupid`=3; +UPDATE `creature_text` SET `sound`=14445, `type`=14, `text`='A thousssand fangsss gonna rend your flesh!' WHERE `entry`=29304 AND `groupid`=4; +UPDATE `creature_text` SET `sound`=14446, `type`=14, `text`='You not breathin''? Good.' WHERE `entry`=29304 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `sound`=14447, `type`=14 WHERE `entry`=29304 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `sound`=14448, `type`=14, `text`='I eat you next, mon.' WHERE `entry`=29304 AND `groupid`=1 AND `id`=2; +UPDATE `creature_text` SET `sound`=14449, `type`=14, `text`='I sssee now... Ssscourge wasss not... our greatessst enemy....' WHERE `entry`=29304 AND `groupid`=2; -- cgit v1.2.3 From 2535aeacd7136460b165a94d0194f58d973e65df Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 20 Jan 2013 09:56:34 -0330 Subject: DB/Creature_text: Add missing creature text and a few SAI fixes. --- sql/updates/world/2013_01_20_04_world_creature_text.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/updates/world/2013_01_20_04_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_04_world_creature_text.sql b/sql/updates/world/2013_01_20_04_world_creature_text.sql new file mode 100644 index 00000000000..5c457530f92 --- /dev/null +++ b/sql/updates/world/2013_01_20_04_world_creature_text.sql @@ -0,0 +1,12 @@ +-- Text for Crushridge Warmonger +SET @ENTRY := 2287; +DELETE FROM `creature_text` WHERE `entry`=@ENTRY AND `groupid`=1; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,1,0,'%s goes into a frenzy!',16,0,100,0,0,0,'Crushridge Warmonger'); + +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid` = 12236 AND `id`=9; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid` = 2428 AND `id`=10; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid` = 2287 AND `id`=1; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid` = 2287 AND `id`=3; +UPDATE `smart_scripts` SET `action_param1`=1 WHERE `entryorguid` = 2287 AND `id`=4; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid` = 8561 AND `id`=11; -- cgit v1.2.3 From 96580a484e244a19cc19b64b8cd296a7163e7da8 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 20 Jan 2013 15:21:39 +0100 Subject: DB/SAI: Fix some db errors --- sql/updates/world/2013_01_20_05_world_sai.sql | 41 +++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sql/updates/world/2013_01_20_05_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_05_world_sai.sql b/sql/updates/world/2013_01_20_05_world_sai.sql new file mode 100644 index 00000000000..9539bc546b1 --- /dev/null +++ b/sql/updates/world/2013_01_20_05_world_sai.sql @@ -0,0 +1,41 @@ +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=14390 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=2587 AND `source_type`=0 AND `id`=8; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=4064 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `link`=3 WHERE `entryorguid`=29181 AND `source_type`=0 AND `id`=2; +UPDATE `smart_scripts` SET `link`=0,`event_type`=61,`event_param2`=0,`event_param3`=0 WHERE `entryorguid`=29181 AND `source_type`=0 AND `id`=3; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29186 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29199 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29199 AND `source_type`=0 AND `id`=2; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29204 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29204 AND `source_type`=0 AND `id`=2; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29200 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29200 AND `source_type`=0 AND `id`=2; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29176 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=500 AND `source_type`=0 AND `id`=10; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=4462 AND `source_type`=0 AND `id`=10; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=14467 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=2719 AND `source_type`=0 AND `id`=3; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=6004 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=23580 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=17270 AND `source_type`=0 AND `id`=13; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=29836 AND `source_type`=0 AND `id`=13; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=578 AND `source_type`=0 AND `id`=8; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=1397 AND `source_type`=0 AND `id`=14; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=1123 AND `source_type`=0 AND `id`=10; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=1123 AND `source_type`=0 AND `id`=16; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=3142 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=15641 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=424 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=19507 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=3643 AND `source_type`=1 AND `id`=0; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=1162 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=1162 AND `source_type`=0 AND `id`=10; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=3987 AND `source_type`=0 AND `id`=1; + +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=6066 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=8477 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=29206 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=29182 AND `source_type`=0 AND `id` IN (0,1); +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=29177 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=29684 AND `source_type`=0 AND `id` IN (0,1); +UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=15631 AND `source_type`=0 AND `id`=0; -- cgit v1.2.3 From 2df2d6896b8cdbf6012eecddfd3483d4d5d354a3 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sun, 20 Jan 2013 16:26:44 +0100 Subject: DB: Image of Commander Ameer Thanks @nelegalno --- sql/updates/world/2013_01_20_06_world_creature.sql | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 sql/updates/world/2013_01_20_06_world_creature.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_06_world_creature.sql b/sql/updates/world/2013_01_20_06_world_creature.sql new file mode 100644 index 00000000000..c00ff11ea4a --- /dev/null +++ b/sql/updates/world/2013_01_20_06_world_creature.sql @@ -0,0 +1,24 @@ +-- Image of Commander Ameer (22919) +SET @GUID := 43492; + +UPDATE `creature_template` SET `npcflag`=`npcflag`|2,`unit_flags`=`unit_flags`&~33554432 WHERE `entry`=22919; + +DELETE FROM `creature` WHERE `guid`=@GUID; +INSERT INTO `creature` (`guid`,`id`,`map`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`curhealth`) VALUES +(@GUID,22919,530,3866.55,5978.68,291.792,4.10061,300,6986); + +DELETE FROM `creature_questrelation` WHERE `id`=22919; +INSERT INTO `creature_questrelation` (`id`,`quest`) VALUES +(22919,10981), -- Nexus-Prince Shaffar's Personal Chamber +(22919,10975), -- Purging the Chambers of Bash'ir +(22919,10977), -- Stasis Chambers of the Mana-Tombs +(22919,10976); -- The Mark of the Nexus-King + +DELETE FROM `creature_involvedrelation` WHERE `id`=22919; +INSERT INTO `creature_involvedrelation` (`id`,`quest`) VALUES +(22919,10981), -- Nexus-Prince Shaffar's Personal Chamber +(22919,10975), -- Purging the Chambers of Bash'ir +(22919,10974), -- Stasis Chambers of Bash'ir +(22919,10977), -- Stasis Chambers of the Mana-Tombs +(22919,10982), -- The Eye of Haramad +(22919,10976); -- The Mark of the Nexus-King -- cgit v1.2.3 From b9f901a645f6af17fc9316e68220cda76f83bea3 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 20 Jan 2013 17:34:15 +0100 Subject: DB/SAI: Fix more some db errors --- sql/updates/world/2013_01_20_07_world_sai.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2013_01_20_07_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_07_world_sai.sql b/sql/updates/world/2013_01_20_07_world_sai.sql new file mode 100644 index 00000000000..f8d001e73db --- /dev/null +++ b/sql/updates/world/2013_01_20_07_world_sai.sql @@ -0,0 +1,5 @@ +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=234 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=2554 AND `source_type`=0 AND `id`=9; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=12265 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=12265 AND `source_type`=0 AND `id`=3; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=16704 AND `source_type`=0 AND `id`=13; -- cgit v1.2.3 From 52d0e9f055b3dccf2b8ddec2680321e197932b4a Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sun, 20 Jan 2013 22:00:15 +0100 Subject: DB/SAI: Fix more some db errors no.2 --- sql/updates/world/2013_01_20_08_world_sai.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2013_01_20_08_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_08_world_sai.sql b/sql/updates/world/2013_01_20_08_world_sai.sql new file mode 100644 index 00000000000..411d69e08d2 --- /dev/null +++ b/sql/updates/world/2013_01_20_08_world_sai.sql @@ -0,0 +1,4 @@ +UPDATE `smart_scripts` SET `link`=0,`event_type`=61 WHERE `entryorguid`=13601 AND `source_type`=0 AND `id`=4; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=13601 AND `source_type`=0 AND `id`=10; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=17670 AND `source_type`=0 AND `id`=13; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=11878 AND `source_type`=0 AND `id`=13; -- cgit v1.2.3 From b7dbc8d746ed583ff5b4b529ce4441aa3c1149ba Mon Sep 17 00:00:00 2001 From: Malcrom Date: Sun, 20 Jan 2013 18:04:06 -0330 Subject: Scripting/Zulgrub: Updated Boss Arlokk Script. --- .../world/2013_01_20_09_world_spell_dbc.sql | 18 + .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 396 ++++++++++++++++----- .../EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 77 ++-- .../scripts/EasternKingdoms/ZulGurub/zulgurub.h | 22 +- 4 files changed, 396 insertions(+), 117 deletions(-) create mode 100644 sql/updates/world/2013_01_20_09_world_spell_dbc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_09_world_spell_dbc.sql b/sql/updates/world/2013_01_20_09_world_spell_dbc.sql new file mode 100644 index 00000000000..bdd57e940b5 --- /dev/null +++ b/sql/updates/world/2013_01_20_09_world_spell_dbc.sql @@ -0,0 +1,18 @@ +-- Add missing spells to spell_dbc +DELETE FROM `spell_dbc` WHERE `Id` IN (24211,24246,24235,7939); +INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`AttributesEx`,`AttributesEx2`,`AttributesEx3`,`AttributesEx4`,`Stances`,`StancesNot`,`Targets`,`CastingTimeIndex`,`AuraInterruptFlags`,`ProcFlags`,`ProcChance`,`ProcCharges`,`MaxLevel`,`BaseLevel`,`SpellLevel`,`DurationIndex`,`RangeIndex`,`StackAmount`,`EquippedItemClass`,`EquippedItemSubClassMask`,`EquippedItemInventoryTypeMask`,`Effect1`,`Effect2`,`Effect3`,`EffectDieSides1`,`EffectDieSides2`,`EffectDieSides3`,`EffectRealPointsPerLevel1`,`EffectRealPointsPerLevel2`,`EffectRealPointsPerLevel3`,`EffectBasePoints1`,`EffectBasePoints2`,`EffectBasePoints3`,`EffectMechanic1`,`EffectMechanic2`,`EffectMechanic3`,`EffectImplicitTargetA1`,`EffectImplicitTargetA2`,`EffectImplicitTargetA3`,`EffectImplicitTargetB1`,`EffectImplicitTargetB2`,`EffectImplicitTargetB3`,`EffectRadiusIndex1`,`EffectRadiusIndex2`,`EffectRadiusIndex3`,`EffectApplyAuraName1`,`EffectApplyAuraName2`,`EffectApplyAuraName3`,`EffectAmplitude1`,`EffectAmplitude2`,`EffectAmplitude3`,`EffectMultipleValue1`,`EffectMultipleValue2`,`EffectMultipleValue3`,`EffectMiscValue1`,`EffectMiscValue2`,`EffectMiscValue3`,`EffectTriggerSpell1`,`EffectTriggerSpell2`,`EffectTriggerSpell3`,`Comment`,`MaxTargetLevel`,`SpellFamilyName`,`SpellFamilyFlags1`,`SpellFamilyFlags2`,`MaxAffectedTargets`,`DmgClass`,`PreventionType`,`DmgMultiplier1`,`DmgMultiplier2`,`DmgMultiplier3`,`EffectMiscValueB1`) VALUES +(24211,0,0,0,256,0,4,0,0,0,0,0,1,0,0,101,0,0,0,0,0,0,0,-1,0,0,63,0,0,1,0,0,0,0,0,4999,0,0,0,0,0,22,0,0,0,0,0,7,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Mark of Arlokk',0,0,0,0,0,0,0,1,0,0,0), +(24246,0,0,0,256,0,0,0,0,0,0,0,1,0,0,101,0,0,0,0,6,0,0,-1,0,0,28,0,0,1,0,0,0,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,15101,0,0,0,0,0,'Summon Zulian Prowler',0,0,0,0,0,0,0,1,0,0,64), +(24235,0,0,0,272,268435456,0,0,0,0,0,0,1,0,0,101,0,0,0,0,1,0,0,-1,0,0,6,0,0,0,0,0,0,0,0,9999,0,0,0,0,0,1,0,0,0,0,0,0,0,0,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,'Super Invis',0,0,0,0,0,0,0,1,1,1,0), +(7939,0,5,0,402915728,268435456,0,0,0,0,0,0,1,6147,0,101,0,0,1,1,21,1,0,-1,-1,0,6,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 'Sneak Rank 1',0,0,0,0,0,0,0,-1,1,1,0); + +-- Add script name to Zulian Prowler +UPDATE `creature_template` SET `AIName` = '', `ScriptName`='npc_zulian_prowler' WHERE `entry`=15101; + +-- Remove SmartAI +DELETE FROM smart_scripts WHERE entryorguid = 15101; + +-- Add condition for Mark of Arlokk +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=24211; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13,1,24211,0,0,0,31,3,15101,0,0,0,0, '', 'Mark of Arlokk - Targets Zulian Prowler'); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 51aab7c20d0..9d6aaf71665 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 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 @@ -17,10 +16,12 @@ */ /* ScriptData -SDName: Boss_Arlokk -SD%Complete: 95 -SDComment: Wrong cleave and red aura is missing. -SDCategory: Zul'Gurub +TCName: Boss_Arlokk +TC%Complete: 95 +TCComment: Wrong cleave and red aura is missing not yet added. +TCComment: Prowlers moving through wall hopefully mmaps will fix. +TCComment: Can't test LOS until mmaps. +TCCategory: Zul'Gurub EndScriptData */ #include "ScriptMgr.h" @@ -30,47 +31,58 @@ EndScriptData */ enum Says { SAY_AGGRO = 0, - SAY_FEAST_PANTHER = 1, + SAY_FEAST_PROWLER = 1, SAY_DEATH = 2 }; enum Spells { - SPELL_SHADOW_WORD_PAIN = 23952, - SPELL_GOUGE = 24698, - SPELL_MARK = 24210, - SPELL_CLEAVE = 26350, // Perhaps not right. Not a red aura... - SPELL_PANTHER_TRANSFORM = 24190 + SPELL_SHADOW_WORD_PAIN = 24212, // corrected + SPELL_GOUGE = 12540, // corrected + SPELL_MARK_OF_ARLOKK = 24210, // This is correct triggers 24211 Added to Spell_dbc + SPELL_RAVAGE = 24213, // corrected + SPELL_CLEAVE = 25174, // Searching for right spell + SPELL_PANTHER_TRANSFORM = 24190, // Transform to panther now used + SPELL_SUMMON_PROWLER = 24246, // Added to Spell_dbc + SPELL_VANISH_VISUAL = 24222, // Added + SPELL_VANISH = 24223, // Added + SPELL_SUPER_INVIS = 24235 // Added }; enum Events { - EVENT_SHADOW_WORD_PAIN = 0, - EVENT_GOUGE = 1, - EVENT_MARK = 2, - EVENT_CLEAVE = 3, - EVENT_VANISH = 4, - EVENT_VISIBLE = 5, - EVENT_SUMMON = 6 + EVENT_SHADOW_WORD_PAIN = 1, + EVENT_GOUGE = 2, + EVENT_MARK_OF_ARLOKK = 3, + EVENT_RAVAGE = 4, + EVENT_TRANSFORM = 5, + EVENT_VANISH = 6, + EVENT_VANISH_2 = 7, + EVENT_TRANSFORM_BACK = 8, + EVENT_VISIBLE = 9, + EVENT_SUMMON_PROWLERS = 10 }; enum Phases { - PHASE_ONE = 1, - PHASE_TWO = 2 + PHASE_ALL = 0, + PHASE_ONE = 1, + PHASE_TWO = 2 }; -enum ModelIds +enum Weapon { - MODEL_ID_NORMAL = 15218, - MODEL_ID_PANTHER = 15215, - MODEL_ID_BLANK = 11686 + WEAPON_DAGGER = 10616 }; -Position const PosSummonProwlers[2] = +enum Misc { - { -11532.7998f, -1649.6734f, 41.4800f, 0.0f }, - { -11532.9970f, -1606.4840f, 41.2979f, 0.0f } + MAX_PROWLERS_PER_SIDE = 15 +}; + +Position const PosMoveOnSpawn[1] = +{ + { -11561.9f, -1627.868f, 41.29941f } }; class boss_arlokk : public CreatureScript @@ -83,52 +95,88 @@ class boss_arlokk : public CreatureScript void Reset() { - summonCount = 0; - markedTargetGUID = 0; - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summonCountA = 0; + summonCountB = 0; + me->RemoveAllAuras(); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER)); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER)); + if (instance) + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) + gate->SetGoState(GO_STATE_READY); + me->SetWalk(false); + me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0].m_positionX,PosMoveOnSpawn[0].m_positionY,PosMoveOnSpawn[0].m_positionZ); + } } void JustDied(Unit* /*killer*/) { - _JustDied(); Talk(SAY_DEATH); - me->SetDisplayId(MODEL_ID_NORMAL); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->RemoveAllAuras(); + if (instance) + { + if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) + gate->SetGoState(GO_STATE_ACTIVE); + instance->SetBossState(DATA_ARLOKK, DONE); + } } void EnterCombat(Unit* /*who*/) { _EnterCombat(); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 8000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_MARK, 35000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_SUMMON, 5000); - events.ScheduleEvent(EVENT_VANISH, 60000); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(7000, 9000), 0, PHASE_ONE); + events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); + if (instance) + events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL); + events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(9000, 11000), 0, PHASE_ALL); + events.ScheduleEvent(EVENT_TRANSFORM, urand(15000, 20000), 0, PHASE_ONE); Talk(SAY_AGGRO); - } - void JustReachedHome() - { - instance->SetBossState(DATA_ARLOKK, NOT_STARTED); - me->DespawnOrUnsummon(); + // Sets up list of Panther spawners to cast on + std::list triggerList; + GetCreatureListWithEntryInGrid(triggerList, me, NPC_PANTHER_TRIGGER, 100.0f); + if (!triggerList.empty()) + { + uint8 sideA = 0; + uint8 sideB = 0; + for (std::list::const_iterator itr = triggerList.begin(); itr != triggerList.end(); ++itr) + { + if (Creature* trigger = *itr) + { + if (trigger->GetPositionY() < -1625.0f) + { + triggersSideAGUID[sideA] = trigger->GetGUID(); + ++sideA; + } + else + { + triggersSideBGUID[sideB] = trigger->GetGUID(); + ++sideB; + } + } + } + } } - void DoSummonPhanters() + void EnterEvadeMode() { - if (summonCount > 30) - return; - - if (markedTargetGUID) - Talk(SAY_FEAST_PANTHER, markedTargetGUID); - me->SummonCreature(NPC_ZULIAN_PROWLER, PosSummonProwlers[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - me->SummonCreature(NPC_ZULIAN_PROWLER, PosSummonProwlers[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (instance) + { + if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) + object->SetGoState(GO_STATE_ACTIVE); + if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_GONG_OF_BETHEKK))) + object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + instance->SetBossState(DATA_ARLOKK, NOT_STARTED); + } + me->DespawnOrUnsummon(4000); } - void JustSummoned(Creature* summoned) + void SetData(uint32 uiId, uint32 uiValue) { - if (Unit* markedTarget = Unit::GetUnit(*me, markedTargetGUID)) - summoned->AI()->AttackStart(markedTarget); - ++summonCount; + if (uiId == 1) + --summonCountA; + if (uiId == 2) + --summonCountB; } void UpdateAI(uint32 const diff) @@ -147,47 +195,99 @@ class boss_arlokk : public CreatureScript { case EVENT_SHADOW_WORD_PAIN: DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, 15000, 0, PHASE_ONE); - break; - case EVENT_MARK: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)) - DoCast(target, SPELL_MARK); - events.ScheduleEvent(EVENT_MARK, 15000, 0, PHASE_ONE); - break; - case EVENT_CLEAVE: - DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); - events.ScheduleEvent(EVENT_CLEAVE, 16000, 0, PHASE_TWO); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(5000, 7000), 0, PHASE_ONE); break; case EVENT_GOUGE: - DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); - events.ScheduleEvent(EVENT_GOUGE, urand(17000, 27000), 0, PHASE_TWO); + DoCastVictim(SPELL_GOUGE, true); break; - case EVENT_SUMMON: - DoSummonPhanters(); - events.ScheduleEvent(EVENT_SUMMON, 5000); + case EVENT_SUMMON_PROWLERS: + if (summonCountA < MAX_PROWLERS_PER_SIDE) + if (Unit* trigger = me->GetUnit(*me, triggersSideAGUID[urand(0, 4)])) + { + trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER); + ++summonCountA; + } + if (summonCountB < MAX_PROWLERS_PER_SIDE) + if (Unit* trigger = me->GetUnit(*me, triggersSideBGUID[urand(0, 4)])) + { + trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER); + ++summonCountB; + } + events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL); break; - case EVENT_VANISH: - me->SetDisplayId(MODEL_ID_BLANK); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AttackStop(); - DoResetThreat(); - events.ScheduleEvent(EVENT_VISIBLE, 6000); + case EVENT_MARK_OF_ARLOKK: + { + Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, urand(1,3), 0.0f, false, -SPELL_MARK_OF_ARLOKK); + if (!target) + target = me->getVictim(); + if (target) + { + DoCast(target, SPELL_MARK_OF_ARLOKK, true); + Talk(SAY_FEAST_PROWLER, target->GetGUID()); + } break; - case EVENT_VISIBLE: + events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(120000, 130000)); + } + case EVENT_TRANSFORM: { - me->SetDisplayId(MODEL_ID_PANTHER); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_PANTHER_TRANSFORM); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(EQUIP_UNEQUIP)); const CreatureTemplate* cinfo = me->GetCreatureTemplate(); me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); me->UpdateDamagePhysical(BASE_ATTACK); + me->AttackStop(); + DoResetThreat(); + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); + DoCast(me, SPELL_VANISH_VISUAL); + DoCast(me, SPELL_VANISH); + events.ScheduleEvent(EVENT_VANISH, 1000, 0, PHASE_ONE); + break; + } + case EVENT_VANISH: + DoCast(me, SPELL_SUPER_INVIS); + me->SetWalk(false); + if (instance) + me->GetMotionMaster()->MovePoint(0, frand(-11551.0f, -11508.0f), frand(-1638.0f, -1617.0f), me->GetPositionZ()); + events.ScheduleEvent(EVENT_VANISH_2, 9000, 0, PHASE_ONE); + break; + case EVENT_VANISH_2: + DoCast(me, SPELL_VANISH); + DoCast(me, SPELL_SUPER_INVIS); + events.ScheduleEvent(EVENT_VISIBLE, urand(7000, 10000), 0, PHASE_ONE); + break; + case EVENT_VISIBLE: + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) AttackStart(target); - events.ScheduleEvent(EVENT_VANISH, 39000); - events.ScheduleEvent(EVENT_CLEAVE, 0, PHASE_TWO); - events.ScheduleEvent(EVENT_GOUGE, 14000, 0, PHASE_TWO); + me->RemoveAura(SPELL_SUPER_INVIS); + me->RemoveAura(SPELL_VANISH); + events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); + events.ScheduleEvent(EVENT_TRANSFORM_BACK, urand(15000, 18000), 0, PHASE_TWO); events.SetPhase(PHASE_TWO); break; + case EVENT_RAVAGE: + DoCastVictim(SPELL_RAVAGE, true); + events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); + break; + case EVENT_TRANSFORM_BACK: + { + me->RemoveAura(SPELL_PANTHER_TRANSFORM); + DoCast(me, SPELL_VANISH_VISUAL); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER)); + me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER)); + const CreatureTemplate* cinfo = me->GetCreatureTemplate(); + me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg)); + me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg)); + me->UpdateDamagePhysical(BASE_ATTACK); + events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(4000, 7000), 0, PHASE_ONE); + events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); + events.ScheduleEvent(EVENT_TRANSFORM, urand(16000, 20000), 0, PHASE_ONE); + events.SetPhase(PHASE_ONE); + break; } default: break; @@ -198,8 +298,10 @@ class boss_arlokk : public CreatureScript } private: - uint32 summonCount; - uint64 markedTargetGUID; + uint8 summonCountA; + uint8 summonCountB; + uint64 triggersSideAGUID[5]; + uint64 triggersSideBGUID[5]; }; CreatureAI* GetAI(Creature* creature) const @@ -208,6 +310,123 @@ class boss_arlokk : public CreatureScript } }; +/*###### +## npc_zulian_prowler +######*/ + +enum ZulianProwlerSpells +{ + SPELL_SNEAK_RANK_1_1 = 22766, + SPELL_SNEAK_RANK_1_2 = 7939, + SPELL_MARK_OF_ARLOKK_TRIGGER = 24211 +}; + +enum ZulianProwlerEvents +{ + EVENT_ATTACK = 1 +}; + +Position const PosProwlerCenter[1] = +{ + { -11556.7f, -1631.344f, 41.2994f } +}; + +class npc_zulian_prowler : public CreatureScript +{ + public: npc_zulian_prowler() : CreatureScript("npc_zulian_prowler") {} + + struct npc_zulian_prowlerAI : public ScriptedAI + { + npc_zulian_prowlerAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } + + void Reset() + { + if (me->GetPositionY() < -1625.0f) + sideData = 1; + else + sideData = 2; + + DoCast(me, SPELL_SNEAK_RANK_1_1); + DoCast(me, SPELL_SNEAK_RANK_1_2); + // me->SetReactState(REACT_PASSIVE); + + if (instance) + if (Unit* arlokk = me->GetUnit(*me, instance->GetData64(NPC_ARLOKK))) + me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ()); + events.ScheduleEvent(EVENT_ATTACK, 6000); + } + + void EnterCombat(Unit* /*who*/) + { + me->GetMotionMaster()->Clear(false); + me->RemoveAura(SPELL_SNEAK_RANK_1_1); + me->RemoveAura(SPELL_SNEAK_RANK_1_2); + } + + void SpellHit(Unit* caster, SpellInfo const* spell) + { + if (spell->Id == SPELL_MARK_OF_ARLOKK_TRIGGER) // Should only hit if line of sight + { + me->Attack(caster, true); + } + } + + void JustDied(Unit* /*killer*/) + { + + if (instance) + if (Unit* arlokk = me->GetUnit(*me, instance->GetData64(NPC_ARLOKK))) + if (arlokk->isAlive()) + arlokk->GetAI()->SetData(sideData, 0); + me->DespawnOrUnsummon(4000); + } + + void UpdateAI(const uint32 diff) + { + + if (UpdateVictim()) + { + DoMeleeAttackIfReady(); + return; + } + + events.Update(diff); + + while (uint32 eventId = events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_ATTACK: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0.0f, 100, false)) + me->Attack(target, true); + break; + default: + break; + } + } + } + + private: + int32 sideData; + EventMap events; + InstanceScript* instance; + }; + + CreatureAI* GetAI(Creature* creature) const + { + return GetZulGurubAI(creature); + } +}; + +/*###### +## go_gong_of_bethekk +######*/ + +Position const PosSummonArlokk[1] = +{ + { -11507.22f, -1628.062f, 41.38264f, 3.159046f } +}; + class go_gong_of_bethekk : public GameObjectScript { public: go_gong_of_bethekk() : GameObjectScript("go_gong_of_bethekk") {} @@ -216,12 +435,11 @@ class go_gong_of_bethekk : public GameObjectScript { if (InstanceScript* instance = go->GetInstanceScript()) { - if (instance->GetBossState(DATA_ARLOKK) == DONE || instance->GetBossState(DATA_ARLOKK) == IN_PROGRESS) - return true; + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + go->SendCustomAnim(0); + go->SummonCreature(NPC_ARLOKK, PosSummonArlokk[0], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 600000); instance->SetBossState(DATA_ARLOKK, IN_PROGRESS); - return true; } - return true; } }; @@ -229,6 +447,6 @@ class go_gong_of_bethekk : public GameObjectScript void AddSC_boss_arlokk() { new boss_arlokk(); + new npc_zulian_prowler(); new go_gong_of_bethekk(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index 19a2ba39578..d922e2db3f3 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -40,11 +40,14 @@ class instance_zulgurub : public InstanceMapScript void Initialize() { - ZealotLorkhanGUID = 0; - ZealotZathGUID = 0; - HighPriestTekalGUID = 0; - JindoTheHexxerGUID = 0; - VilebranchSpeakerGUID = 0; + zealotLorkhanGUID = 0; + zealotZathGUID = 0; + highPriestTekalGUID = 0; + jindoTheHexxerGUID = 0; + vilebranchSpeakerGUID = 0; + arlokkGUID = 0; + go_ForcefieldGUID = 0; + go_GongOfBethekkGUID = 0; } bool IsEncounterInProgress() const @@ -58,23 +61,41 @@ class instance_zulgurub : public InstanceMapScript switch (creature->GetEntry()) { case NPC_ZEALOT_LORKHAN: - ZealotLorkhanGUID = creature->GetGUID(); + zealotLorkhanGUID = creature->GetGUID(); break; case NPC_ZEALOT_ZATH: - ZealotZathGUID = creature->GetGUID(); + zealotZathGUID = creature->GetGUID(); break; case NPC_HIGH_PRIEST_THEKAL: - HighPriestTekalGUID = creature->GetGUID(); + highPriestTekalGUID = creature->GetGUID(); break; case NPC_JINDO_THE_HEXXER: - JindoTheHexxerGUID = creature->GetGUID(); + jindoTheHexxerGUID = creature->GetGUID(); break; case NPC_VILEBRANCH_SPEAKER: - VilebranchSpeakerGUID = creature->GetGUID(); + vilebranchSpeakerGUID = creature->GetGUID(); break; - case NPC_MANDOKIR: - if (GetBossState(DATA_MANDOKIR) == DONE) - creature->DespawnOrUnsummon(); + case NPC_ARLOKK: + arlokkGUID = creature->GetGUID(); + break; + } + } + + void OnGameObjectCreate(GameObject* go) + { + switch (go->GetEntry()) + { + case GO_FORCEFIELD: + go_ForcefieldGUID = go->GetGUID(); + break; + case GO_GONG_OF_BETHEKK: + go_GongOfBethekkGUID = go->GetGUID(); + if (GetBossState(DATA_ARLOKK) == DONE) + go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + else + go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); + break; + default: break; } } @@ -84,16 +105,25 @@ class instance_zulgurub : public InstanceMapScript switch (uiData) { case DATA_LORKHAN: - return ZealotLorkhanGUID; + return zealotLorkhanGUID; break; case DATA_ZATH: - return ZealotZathGUID; + return zealotZathGUID; break; case DATA_THEKAL: - return HighPriestTekalGUID; + return highPriestTekalGUID; break; case DATA_JINDO: - return JindoTheHexxerGUID; + return jindoTheHexxerGUID; + break; + case NPC_ARLOKK: + return arlokkGUID; + break; + case GO_FORCEFIELD: + return go_ForcefieldGUID; + break; + case GO_GONG_OF_BETHEKK: + return go_GongOfBethekkGUID; break; } return 0; @@ -145,11 +175,14 @@ class instance_zulgurub : public InstanceMapScript //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too. - uint64 ZealotLorkhanGUID; - uint64 ZealotZathGUID; - uint64 HighPriestTekalGUID; - uint64 JindoTheHexxerGUID; - uint64 VilebranchSpeakerGUID; + uint64 zealotLorkhanGUID; + uint64 zealotZathGUID; + uint64 highPriestTekalGUID; + uint64 jindoTheHexxerGUID; + uint64 vilebranchSpeakerGUID; + uint64 arlokkGUID; + uint64 go_ForcefieldGUID; + uint64 go_GongOfBethekkGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h index 34680447cd7..77767153a96 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h +++ b/src/server/scripts/EasternKingdoms/ZulGurub/zulgurub.h @@ -36,23 +36,33 @@ enum DataTypes DATA_EDGE_OF_MADNESS = 9, // Optional Event Edge of Madness - one of: Gri'lek, Renataki, Hazza'rah, or Wushoolay DATA_LORKHAN = 10, // Zealot Lor'Khan add to High priest Thekal! DATA_ZATH = 11, // Zealot Zath add to High priest Thekal! - DATA_OHGAN = 12 // Bloodlord Mandokir's raptor mount + DATA_OHGAN = 12, // Bloodlord Mandokir's raptor mount + TYPE_EDGE_OF_MADNESS = 13 // Boss storage }; enum CreatureIds { + NPC_ARLOKK = 14515, // Arlokk Event + NPC_PANTHER_TRIGGER = 15091, // Arlokk Event + NPC_ZULIAN_PROWLER = 15101, // Arlokk Event NPC_ZEALOT_LORKHAN = 11347, NPC_ZEALOT_ZATH = 11348, NPC_HIGH_PRIEST_THEKAL = 14509, NPC_JINDO_THE_HEXXER = 11380, NPC_NIGHTMARE_ILLUSION = 15163, - NPC_ZULIAN_PROWLER = 15101, - NPC_VILEBRANCH_SPEAKER = 11391, NPC_SHADE_OF_JINDO = 14986, NPC_SACRIFICED_TROLL = 14826, - NPC_OHGAN = 14988, - NPC_CHAINED_SPIRT = 15117, - NPC_MANDOKIR = 11382 + NPC_MANDOKIR = 11382, // Mandokir Event + NPC_OHGAN = 14988, // Mandokir Event + NPC_VILEBRANCH_SPEAKER = 11391, // Mandokir Event + NPC_CHAINED_SPIRT = 15117 // Mandokir Event + +}; + +enum GameobjectIds +{ + GO_FORCEFIELD = 180497, // Arlokk Event + GO_GONG_OF_BETHEKK = 180526 // Arlokk Event }; template -- cgit v1.2.3 From c6c23d67b8692936fe9e7d5920bfb997df516323 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 21 Jan 2013 02:10:01 +0000 Subject: Scripts/ZG: Fix some code style issues and logic errors --- .../world/2013_01_20_09_world_spell_dbc.sql | 2 +- src/server/game/Miscellaneous/Language.h | 4 +- .../EasternKingdoms/ZulGurub/boss_arlokk.cpp | 146 +++++++++++---------- .../EasternKingdoms/ZulGurub/boss_gahzranka.cpp | 1 - .../EasternKingdoms/ZulGurub/boss_hazzarah.cpp | 1 - .../EasternKingdoms/ZulGurub/instance_zulgurub.cpp | 64 ++++----- 6 files changed, 110 insertions(+), 108 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_20_09_world_spell_dbc.sql b/sql/updates/world/2013_01_20_09_world_spell_dbc.sql index bdd57e940b5..d8f466173f3 100644 --- a/sql/updates/world/2013_01_20_09_world_spell_dbc.sql +++ b/sql/updates/world/2013_01_20_09_world_spell_dbc.sql @@ -10,7 +10,7 @@ INSERT INTO `spell_dbc` (`Id`,`SchoolMask`,`Dispel`,`Mechanic`,`Attributes`,`Att UPDATE `creature_template` SET `AIName` = '', `ScriptName`='npc_zulian_prowler' WHERE `entry`=15101; -- Remove SmartAI -DELETE FROM smart_scripts WHERE entryorguid = 15101; +DELETE FROM `smart_scripts` WHERE `entryorguid`=15101; -- Add condition for Mark of Arlokk DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=24211; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 35b0a6f8569..039e8b816b3 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -742,7 +742,7 @@ enum TrinityStrings LANG_COMMAND_CREATURESTORAGE_NOTFOUND = 818, LANG_CHANNEL_CITY = 819, - + LANG_NPCINFO_GOSSIP = 820, LANG_NPCINFO_QUESTGIVER = 821, LANG_NPCINFO_TRAINER_CLASS = 822, @@ -766,7 +766,7 @@ enum TrinityStrings LANG_NPCINFO_SPELLCLICK = 840, LANG_NPCINFO_MAILBOX = 841, LANG_NPCINFO_PLAYER_VEHICLE = 842, - + // Room for in-game strings 843-999 not used // Level 4 (CLI only commands) diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp index 3682b265cbc..4b4186c7684 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_arlokk.cpp @@ -96,14 +96,14 @@ class boss_arlokk : public CreatureScript void Reset() { - summonCountA = 0; - summonCountB = 0; + _summonCountA = 0; + _summonCountB = 0; me->RemoveAllAuras(); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(WEAPON_DAGGER)); me->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(WEAPON_DAGGER)); - if (instance) + if (_instance) { - if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) + if (GameObject* gate = me->GetMap()->GetGameObject(_instance->GetData64(GO_FORCEFIELD))) gate->SetGoState(GO_STATE_READY); me->SetWalk(false); me->GetMotionMaster()->MovePoint(0, PosMoveOnSpawn[0]); @@ -114,23 +114,23 @@ class boss_arlokk : public CreatureScript { Talk(SAY_DEATH); me->RemoveAllAuras(); - if (instance) + if (_instance) { - if (GameObject* gate = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) + if (GameObject* gate = me->GetMap()->GetGameObject(_instance->GetData64(GO_FORCEFIELD))) gate->SetGoState(GO_STATE_ACTIVE); - instance->SetBossState(DATA_ARLOKK, DONE); + _instance->SetBossState(DATA_ARLOKK, DONE); } } void EnterCombat(Unit* /*who*/) { _EnterCombat(); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(7000, 9000), 0, PHASE_ONE); - events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); - if (instance) - events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL); - events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(9000, 11000), 0, PHASE_ALL); - events.ScheduleEvent(EVENT_TRANSFORM, urand(15000, 20000), 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(7000, 9000), 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); + if (_instance) + _events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL); + _events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(9000, 11000), 0, PHASE_ALL); + _events.ScheduleEvent(EVENT_TRANSFORM, urand(15000, 20000), 0, PHASE_ONE); Talk(SAY_AGGRO); // Sets up list of Panther spawners to cast on @@ -146,12 +146,12 @@ class boss_arlokk : public CreatureScript { if (trigger->GetPositionY() < -1625.0f) { - triggersSideAGUID[sideA] = trigger->GetGUID(); + _triggersSideAGUID[sideA] = trigger->GetGUID(); ++sideA; } else { - triggersSideBGUID[sideB] = trigger->GetGUID(); + _triggersSideBGUID[sideB] = trigger->GetGUID(); ++sideB; } } @@ -161,23 +161,23 @@ class boss_arlokk : public CreatureScript void EnterEvadeMode() { - if (instance) + if (_instance) { - if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_FORCEFIELD))) + if (GameObject* object = me->GetMap()->GetGameObject(_instance->GetData64(GO_FORCEFIELD))) object->SetGoState(GO_STATE_ACTIVE); - if (GameObject* object = me->GetMap()->GetGameObject(instance->GetData64(GO_GONG_OF_BETHEKK))) + if (GameObject* object = me->GetMap()->GetGameObject(_instance->GetData64(GO_GONG_OF_BETHEKK))) object->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - instance->SetBossState(DATA_ARLOKK, NOT_STARTED); + _instance->SetBossState(DATA_ARLOKK, NOT_STARTED); } me->DespawnOrUnsummon(4000); } - void SetData(uint32 uiId, uint32 /*uiValue*/) + void SetData(uint32 id, uint32 /*value*/) { - if (uiId == 1) - --summonCountA; - if (uiId == 2) - --summonCountB; + if (id == 1) + --_summonCountA; + else if (id == 2) + --_summonCountB; } void UpdateAI(uint32 const diff) @@ -185,36 +185,40 @@ class boss_arlokk : public CreatureScript if (!UpdateVictim()) return; - events.Update(diff); + _events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) return; - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { case EVENT_SHADOW_WORD_PAIN: DoCastVictim(SPELL_SHADOW_WORD_PAIN, true); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(5000, 7000), 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(5000, 7000), 0, PHASE_ONE); break; case EVENT_GOUGE: DoCastVictim(SPELL_GOUGE, true); break; case EVENT_SUMMON_PROWLERS: - if (summonCountA < MAX_PROWLERS_PER_SIDE) - if (Unit* trigger = me->GetUnit(*me, triggersSideAGUID[urand(0, 4)])) + if (_summonCountA < MAX_PROWLERS_PER_SIDE) + { + if (Unit* trigger = me->GetUnit(*me, _triggersSideAGUID[urand(0, 4)])) { trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER); - ++summonCountA; + ++_summonCountA; } - if (summonCountB < MAX_PROWLERS_PER_SIDE) - if (Unit* trigger = me->GetUnit(*me, triggersSideBGUID[urand(0, 4)])) + } + if (_summonCountB < MAX_PROWLERS_PER_SIDE) + { + if (Unit* trigger = me->GetUnit(*me, _triggersSideBGUID[urand(0, 4)])) { trigger->CastSpell(trigger, SPELL_SUMMON_PROWLER); - ++summonCountB; + ++_summonCountB; } - events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL); + } + _events.ScheduleEvent(EVENT_SUMMON_PROWLERS, 6000, 0, PHASE_ALL); break; case EVENT_MARK_OF_ARLOKK: { @@ -226,8 +230,8 @@ class boss_arlokk : public CreatureScript DoCast(target, SPELL_MARK_OF_ARLOKK, true); Talk(SAY_FEAST_PROWLER, target->GetGUID()); } + _events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(120000, 130000)); break; - events.ScheduleEvent(EVENT_MARK_OF_ARLOKK, urand(120000, 130000)); } case EVENT_TRANSFORM: { @@ -244,20 +248,20 @@ class boss_arlokk : public CreatureScript me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_SELECTABLE); DoCast(me, SPELL_VANISH_VISUAL); DoCast(me, SPELL_VANISH); - events.ScheduleEvent(EVENT_VANISH, 1000, 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_VANISH, 1000, 0, PHASE_ONE); break; } case EVENT_VANISH: DoCast(me, SPELL_SUPER_INVIS); me->SetWalk(false); - if (instance) + if (_instance) me->GetMotionMaster()->MovePoint(0, frand(-11551.0f, -11508.0f), frand(-1638.0f, -1617.0f), me->GetPositionZ()); - events.ScheduleEvent(EVENT_VANISH_2, 9000, 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_VANISH_2, 9000, 0, PHASE_ONE); break; case EVENT_VANISH_2: DoCast(me, SPELL_VANISH); DoCast(me, SPELL_SUPER_INVIS); - events.ScheduleEvent(EVENT_VISIBLE, urand(7000, 10000), 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_VISIBLE, urand(7000, 10000), 0, PHASE_ONE); break; case EVENT_VISIBLE: me->SetReactState(REACT_AGGRESSIVE); @@ -266,13 +270,13 @@ class boss_arlokk : public CreatureScript AttackStart(target); me->RemoveAura(SPELL_SUPER_INVIS); me->RemoveAura(SPELL_VANISH); - events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); - events.ScheduleEvent(EVENT_TRANSFORM_BACK, urand(15000, 18000), 0, PHASE_TWO); - events.SetPhase(PHASE_TWO); + _events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); + _events.ScheduleEvent(EVENT_TRANSFORM_BACK, urand(15000, 18000), 0, PHASE_TWO); + _events.SetPhase(PHASE_TWO); break; case EVENT_RAVAGE: DoCastVictim(SPELL_RAVAGE, true); - events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); + _events.ScheduleEvent(EVENT_RAVAGE, urand(10000, 14000), 0, PHASE_TWO); break; case EVENT_TRANSFORM_BACK: { @@ -284,10 +288,10 @@ class boss_arlokk : public CreatureScript me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg)); me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg)); me->UpdateDamagePhysical(BASE_ATTACK); - events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(4000, 7000), 0, PHASE_ONE); - events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); - events.ScheduleEvent(EVENT_TRANSFORM, urand(16000, 20000), 0, PHASE_ONE); - events.SetPhase(PHASE_ONE); + _events.ScheduleEvent(EVENT_SHADOW_WORD_PAIN, urand(4000, 7000), 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_GOUGE, urand(12000, 15000), 0, PHASE_ONE); + _events.ScheduleEvent(EVENT_TRANSFORM, urand(16000, 20000), 0, PHASE_ONE); + _events.SetPhase(PHASE_ONE); break; } default: @@ -299,10 +303,10 @@ class boss_arlokk : public CreatureScript } private: - uint8 summonCountA; - uint8 summonCountB; - uint64 triggersSideAGUID[5]; - uint64 triggersSideBGUID[5]; + uint8 _summonCountA; + uint8 _summonCountB; + uint64 _triggersSideAGUID[5]; + uint64 _triggersSideBGUID[5]; }; CreatureAI* GetAI(Creature* creature) const @@ -338,22 +342,22 @@ class npc_zulian_prowler : public CreatureScript struct npc_zulian_prowlerAI : public ScriptedAI { - npc_zulian_prowlerAI(Creature* creature) : ScriptedAI(creature), instance(creature->GetInstanceScript()) { } + npc_zulian_prowlerAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } void Reset() { if (me->GetPositionY() < -1625.0f) - sideData = 1; + _sideData = 1; else - sideData = 2; + _sideData = 2; DoCast(me, SPELL_SNEAK_RANK_1_1); DoCast(me, SPELL_SNEAK_RANK_1_2); - if (instance) - if (Unit* arlokk = me->GetUnit(*me, instance->GetData64(NPC_ARLOKK))) + if (_instance) + if (Unit* arlokk = me->GetUnit(*me, _instance->GetData64(NPC_ARLOKK))) me->GetMotionMaster()->MovePoint(0, arlokk->GetPositionX(), arlokk->GetPositionY(), arlokk->GetPositionZ()); - events.ScheduleEvent(EVENT_ATTACK, 6000); + _events.ScheduleEvent(EVENT_ATTACK, 6000); } void EnterCombat(Unit* /*who*/) @@ -366,33 +370,33 @@ class npc_zulian_prowler : public CreatureScript void SpellHit(Unit* caster, SpellInfo const* spell) { if (spell->Id == SPELL_MARK_OF_ARLOKK_TRIGGER) // Should only hit if line of sight - { me->Attack(caster, true); - } } void JustDied(Unit* /*killer*/) { - - if (instance) - if (Unit* arlokk = me->GetUnit(*me, instance->GetData64(NPC_ARLOKK))) - if (arlokk->isAlive()) - arlokk->GetAI()->SetData(sideData, 0); + if (_instance) + { + if (Unit* arlokk = me->GetUnit(*me, instance->GetData64(NPC_ARLOKK))) + { + if (arlokk->isAlive()) + arlokk->GetAI()->SetData(_sideData, 0); + } + } me->DespawnOrUnsummon(4000); } void UpdateAI(const uint32 diff) { - if (UpdateVictim()) { DoMeleeAttackIfReady(); return; } - events.Update(diff); + _events.Update(diff); - while (uint32 eventId = events.ExecuteEvent()) + while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) { @@ -407,9 +411,9 @@ class npc_zulian_prowler : public CreatureScript } private: - int32 sideData; - EventMap events; - InstanceScript* instance; + int32 _sideData; + EventMap _events; + InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const @@ -433,7 +437,7 @@ class go_gong_of_bethekk : public GameObjectScript bool OnGossipHello(Player* /*player*/, GameObject* go) { - if (InstanceScript* instance = go->GetInstanceScript()) + if (go->GetInstanceScript()) { go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); go->SendCustomAnim(0); diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp index 70399b6934c..f3f12bc35c5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_gahzranka.cpp @@ -112,4 +112,3 @@ void AddSC_boss_gahzranka() { new boss_gahzranka(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp index 15228815d69..809403bb325 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/boss_hazzarah.cpp @@ -121,4 +121,3 @@ void AddSC_boss_hazzarah() { new boss_hazzarah(); } - diff --git a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp index d922e2db3f3..01c5ef998f5 100644 --- a/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp +++ b/src/server/scripts/EasternKingdoms/ZulGurub/instance_zulgurub.cpp @@ -40,14 +40,14 @@ class instance_zulgurub : public InstanceMapScript void Initialize() { - zealotLorkhanGUID = 0; - zealotZathGUID = 0; - highPriestTekalGUID = 0; - jindoTheHexxerGUID = 0; - vilebranchSpeakerGUID = 0; - arlokkGUID = 0; - go_ForcefieldGUID = 0; - go_GongOfBethekkGUID = 0; + _zealotLorkhanGUID = 0; + _zealotZathGUID = 0; + _highPriestTekalGUID = 0; + _jindoTheHexxerGUID = 0; + _vilebranchSpeakerGUID = 0; + _arlokkGUID = 0; + _goForcefieldGUID = 0; + _goGongOfBethekkGUID = 0; } bool IsEncounterInProgress() const @@ -61,22 +61,22 @@ class instance_zulgurub : public InstanceMapScript switch (creature->GetEntry()) { case NPC_ZEALOT_LORKHAN: - zealotLorkhanGUID = creature->GetGUID(); + _zealotLorkhanGUID = creature->GetGUID(); break; case NPC_ZEALOT_ZATH: - zealotZathGUID = creature->GetGUID(); + _zealotZathGUID = creature->GetGUID(); break; case NPC_HIGH_PRIEST_THEKAL: - highPriestTekalGUID = creature->GetGUID(); + _highPriestTekalGUID = creature->GetGUID(); break; case NPC_JINDO_THE_HEXXER: - jindoTheHexxerGUID = creature->GetGUID(); + _jindoTheHexxerGUID = creature->GetGUID(); break; case NPC_VILEBRANCH_SPEAKER: - vilebranchSpeakerGUID = creature->GetGUID(); + _vilebranchSpeakerGUID = creature->GetGUID(); break; case NPC_ARLOKK: - arlokkGUID = creature->GetGUID(); + _arlokkGUID = creature->GetGUID(); break; } } @@ -86,13 +86,13 @@ class instance_zulgurub : public InstanceMapScript switch (go->GetEntry()) { case GO_FORCEFIELD: - go_ForcefieldGUID = go->GetGUID(); + _goForcefieldGUID = go->GetGUID(); break; case GO_GONG_OF_BETHEKK: - go_GongOfBethekkGUID = go->GetGUID(); + _goGongOfBethekkGUID = go->GetGUID(); if (GetBossState(DATA_ARLOKK) == DONE) go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); - else + else go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE); break; default: @@ -105,25 +105,25 @@ class instance_zulgurub : public InstanceMapScript switch (uiData) { case DATA_LORKHAN: - return zealotLorkhanGUID; + return _zealotLorkhanGUID; break; case DATA_ZATH: - return zealotZathGUID; + return _zealotZathGUID; break; case DATA_THEKAL: - return highPriestTekalGUID; + return _highPriestTekalGUID; break; case DATA_JINDO: - return jindoTheHexxerGUID; + return _jindoTheHexxerGUID; break; case NPC_ARLOKK: - return arlokkGUID; + return _arlokkGUID; break; case GO_FORCEFIELD: - return go_ForcefieldGUID; + return _goForcefieldGUID; break; case GO_GONG_OF_BETHEKK: - return go_GongOfBethekkGUID; + return _goGongOfBethekkGUID; break; } return 0; @@ -175,14 +175,14 @@ class instance_zulgurub : public InstanceMapScript //If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. //Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for healfunction too. - uint64 zealotLorkhanGUID; - uint64 zealotZathGUID; - uint64 highPriestTekalGUID; - uint64 jindoTheHexxerGUID; - uint64 vilebranchSpeakerGUID; - uint64 arlokkGUID; - uint64 go_ForcefieldGUID; - uint64 go_GongOfBethekkGUID; + uint64 _zealotLorkhanGUID; + uint64 _zealotZathGUID; + uint64 _highPriestTekalGUID; + uint64 _jindoTheHexxerGUID; + uint64 _vilebranchSpeakerGUID; + uint64 _arlokkGUID; + uint64 _goForcefieldGUID; + uint64 _goGongOfBethekkGUID; }; InstanceScript* GetInstanceScript(InstanceMap* map) const -- cgit v1.2.3 From 53c2340a53673c2dc607ba8a634a4babc5e43fb0 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 21 Jan 2013 09:46:08 +0100 Subject: DB/Misc: Fix db errors --- sql/updates/world/2013_01_21_00_world_misc.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2013_01_21_00_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_21_00_world_misc.sql b/sql/updates/world/2013_01_21_00_world_misc.sql new file mode 100644 index 00000000000..c023003783e --- /dev/null +++ b/sql/updates/world/2013_01_21_00_world_misc.sql @@ -0,0 +1,2 @@ +UPDATE `spell_dbc` SET `EffectImplicitTargetB1`=7,`EffectRadiusIndex1`=18 WHERE `Id`=24211; +UPDATE `conditions` SET `ConditionTypeOrReference`=31,`ConditionTarget`=0 WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=24211; -- cgit v1.2.3 From 77889806916bb001fbf25c3472474977b2925831 Mon Sep 17 00:00:00 2001 From: Gacko Date: Mon, 21 Jan 2013 18:00:19 +0100 Subject: DB: Thuk the Defiant Set hostile to make Stasis Chambers of Bash'ir (10974) solvable. Solves #6422 --- sql/updates/world/2013_01_21_01_world_creature_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_01_21_01_world_creature_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_21_01_world_creature_template.sql b/sql/updates/world/2013_01_21_01_world_creature_template.sql new file mode 100644 index 00000000000..d5bf4525ff6 --- /dev/null +++ b/sql/updates/world/2013_01_21_01_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `faction_A`=14,`faction_H`=14 WHERE `entry`=22920; -- cgit v1.2.3 From 017ff298dd55511c2577e3ec7a6c7fb07ec27070 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 21 Jan 2013 22:53:22 +0100 Subject: DB/SAI: Fix more some db errors no.3 --- sql/updates/world/2013_01_21_02_world_sai.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2013_01_21_02_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_21_02_world_sai.sql b/sql/updates/world/2013_01_21_02_world_sai.sql new file mode 100644 index 00000000000..31070c48718 --- /dev/null +++ b/sql/updates/world/2013_01_21_02_world_sai.sql @@ -0,0 +1,7 @@ +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=16459 AND `source_type`=0 AND `id`=2; +UPDATE `smart_scripts` SET `event_flags`=0 WHERE `entryorguid`=5263 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=19255 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=5888 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=10828 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=29181 AND `source_type`=0 AND `id`=1; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=16403 AND `source_type`=0 AND `id`=9; -- cgit v1.2.3 From 864a85b8fc6d086bc7af7fddd22f510f1b662e10 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 22 Jan 2013 15:03:26 +0000 Subject: DB/mmaps: Rename mmap commands related sql --- sql/updates/world/2012_09_06_00_world_command.sql | 9 --------- sql/updates/world/2012_12_30_00_world_commands.sql | 4 ---- sql/updates/world/2013_01_22_00_world_command.sql | 11 +++++++++++ 3 files changed, 11 insertions(+), 13 deletions(-) delete mode 100644 sql/updates/world/2012_09_06_00_world_command.sql delete mode 100644 sql/updates/world/2012_12_30_00_world_commands.sql create mode 100644 sql/updates/world/2013_01_22_00_world_command.sql (limited to 'sql') diff --git a/sql/updates/world/2012_09_06_00_world_command.sql b/sql/updates/world/2012_09_06_00_world_command.sql deleted file mode 100644 index e60c1644e05..00000000000 --- a/sql/updates/world/2012_09_06_00_world_command.sql +++ /dev/null @@ -1,9 +0,0 @@ -DELETE FROM `command` WHERE `name`='mmap' OR `name` LIKE 'mmap%'; -INSERT INTO `command` (`name`, `security`, `help`) VALUES -('mmap', 3, 'Syntax: Syntax: .mmaps $subcommand Type .mmaps to see the list of possible subcommands or .help mmaps $subcommand to see info on subcommands'), -('mmap path', 3, 'Syntax: .mmap path to calculate and show a path to current select unit'), -('mmap loc', 3, 'Syntax: .mmap loc to print on which tile one is'), -('mmap loadedtiles', 3, 'Syntax: .mmap loadedtiles to show which tiles are currently loaded'), -('mmap stats', 3, 'Syntax: .mmap stats to show information about current state of mmaps'), -('mmap testarea', 3, 'Syntax: .mmap testarea to calculate paths for all nearby npcs to player'); - diff --git a/sql/updates/world/2012_12_30_00_world_commands.sql b/sql/updates/world/2012_12_30_00_world_commands.sql deleted file mode 100644 index fffd1a95cb5..00000000000 --- a/sql/updates/world/2012_12_30_00_world_commands.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM `command` WHERE `name` LIKE 'disable add mmap' OR `name` LIKE 'disable remove mmap'; -INSERT INTO `command` (`name`, `security`, `help`) VALUES -('disable add mmap', '3', 'Syntax: .disable add mmap $entry $flag $comment'), -('disable remove mmap', '3', 'Syntax: .disable remove mmap $entry'); diff --git a/sql/updates/world/2013_01_22_00_world_command.sql b/sql/updates/world/2013_01_22_00_world_command.sql new file mode 100644 index 00000000000..6c89951d036 --- /dev/null +++ b/sql/updates/world/2013_01_22_00_world_command.sql @@ -0,0 +1,11 @@ +DELETE FROM `command` WHERE `name`='mmap' OR `name` LIKE 'mmap%'; +DELETE FROM `command` WHERE `name` LIKE 'disable add mmap' OR `name` LIKE 'disable remove mmap'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('mmap', 3, 'Syntax: Syntax: .mmaps $subcommand Type .mmaps to see the list of possible subcommands or .help mmaps $subcommand to see info on subcommands'), +('mmap path', 3, 'Syntax: .mmap path to calculate and show a path to current select unit'), +('mmap loc', 3, 'Syntax: .mmap loc to print on which tile one is'), +('mmap loadedtiles', 3, 'Syntax: .mmap loadedtiles to show which tiles are currently loaded'), +('mmap stats', 3, 'Syntax: .mmap stats to show information about current state of mmaps'), +('mmap testarea', 3, 'Syntax: .mmap testarea to calculate paths for all nearby npcs to player'), +('disable add mmap', '3', 'Syntax: .disable add mmap $entry $flag $comment'), +('disable remove mmap', '3', 'Syntax: .disable remove mmap $entry'); -- cgit v1.2.3 From db5d06afa979f1ab487cc0ec18349bd6af634edb Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 22 Jan 2013 20:16:56 +0100 Subject: DB/SAI: Fix more some db errors no.4 --- sql/updates/world/2013_01_22_01_world_sai.sql | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 sql/updates/world/2013_01_22_01_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_22_01_world_sai.sql b/sql/updates/world/2013_01_22_01_world_sai.sql new file mode 100644 index 00000000000..b41fb25110d --- /dev/null +++ b/sql/updates/world/2013_01_22_01_world_sai.sql @@ -0,0 +1,22 @@ +UPDATE `smart_scripts` SET `event_flags`=1 WHERE `entryorguid`=20882 AND `source_type`=0 AND `id`=0; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=20896 AND `source_type`=0 AND `id`=3; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=20900 AND `source_type`=0 AND `id`=3; +UPDATE `smart_scripts` SET `link`=0,`event_type`=61 WHERE `entryorguid`=4063 AND `source_type`=0 AND `id`=3; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=2245 AND `source_type`=0 AND `id`=8; +UPDATE `smart_scripts` SET `link`=0 WHERE `entryorguid`=7038 AND `source_type`=0 AND `id`=17; +UPDATE `smart_scripts` SET `event_type`=61 WHERE `entryorguid`=2345 AND `source_type`=0 AND `id`=11; + +DELETE FROM `smart_scripts` WHERE `entryorguid`=314 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 +(314, 0, 1, 0, 11, 0, 100, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 0 - On spawn - Prevent combat movement'), +(314, 0, 2, 3, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 0 - On aggro - Say'), +(314, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 0 - On aggro - Set phase 1'), +(314, 0, 4, 0, 9, 1, 100, 0, 0, 40, 0, 0, 11, 20819, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - In combat - Cast Frostbolt'), +(314, 0, 5, 0, 9, 1, 100, 0, 0, 5, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - 0 to 5 yards - Activate combat movement'), +(314, 0, 6, 0, 9, 1, 100, 0, 5, 35, 0, 0, 21, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - 5 to 35 yards - Deactivate combat movement'), +(314, 0, 7, 0, 9, 1, 100, 0, 35, 80, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - 35 to 80 yards - Activate combat movement'), +(314, 0, 8, 0, 0, 1, 100, 0, 4100, 6400, 72300, 72300, 11, 3107, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - In combat - Summon Elizas Guard'), +(314, 0, 9, 0, 0, 1, 100, 0, 2100, 2900, 12500, 36300, 11, 11831, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - In combat - Cast Frost Nova'), +(314, 0, 10, 12, 3, 1, 100, 0, 0, 7, 0, 0, 21, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - At 7% mana - Start combat movement'), +(314, 0, 11, 0, 61, 1, 100, 0, 0, 0, 0, 0, 22, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 1 - At 7% mana - Set phase 2'), +(314, 0, 12, 0, 3, 2, 100, 0, 15, 100, 100, 100, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Eliza - Phase 2 - At 15% mana - Set phase 1'); -- cgit v1.2.3 From e360f8747002e858c0a85945ff1b1c1e3cba1fc3 Mon Sep 17 00:00:00 2001 From: Xanvial Date: Wed, 23 Jan 2013 05:26:51 +0700 Subject: Scripts/Paladin: Templar's Verdict --- .../2013_01_22_01_world_spell_script_names_434.sql | 4 ++ src/server/scripts/Spells/spell_paladin.cpp | 73 +++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql b/sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql new file mode 100644 index 00000000000..cc74d504e94 --- /dev/null +++ b/sql/updates/world/2013_01_22_01_world_spell_script_names_434.sql @@ -0,0 +1,4 @@ +-- 85256 - Templar's Verdict +DELETE FROM `spell_script_names` WHERE `spell_id`=85256; +INSERT INTO `spell_script_names` VALUES +(85256,'spell_pal_templar_s_verdict'); diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 47592630a11..7625ed548ac 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -50,7 +50,9 @@ enum PaladinSpells SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988, SPELL_PALADIN_HAND_OF_SACRIFICE = 6940, - SPELL_PALADIN_DIVINE_SACRIFICE = 64205 + SPELL_PALADIN_DIVINE_SACRIFICE = 64205, + + SPELL_PALADIN_DIVINE_PURPOSE_PROC = 90174 }; // 31850 - Ardent Defender @@ -719,6 +721,74 @@ class spell_pal_sacred_shield : public SpellScriptLoader } }; +// 85256 - Templar's Verdict +/// Updated 4.3.4 +class spell_pal_templar_s_verdict : public SpellScriptLoader +{ + public: + spell_pal_templar_s_verdict() : SpellScriptLoader("spell_pal_templar_s_verdict") { } + + class spell_pal_templar_s_verdict_SpellScript : public SpellScript + { + PrepareSpellScript(spell_pal_templar_s_verdict_SpellScript); + + bool Validate (SpellInfo const* /*spellEntry*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_DIVINE_PURPOSE_PROC)) + return false; + + return true; + } + + bool Load() + { + if (GetCaster()->GetTypeId() != TYPEID_PLAYER) + return false; + + if (GetCaster()->ToPlayer()->getClass() != CLASS_PALADIN) + return false; + + return true; + } + + void ChangeDamage(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + int32 damage = GetHitDamage(); + + if (caster->HasAura(SPELL_PALADIN_DIVINE_PURPOSE_PROC)) + damage *= 7.5; // 7.5*30% = 225% + else + { + switch (caster->GetPower(POWER_HOLY_POWER)) + { + case 0: // 1 Holy Power + damage = damage; + break; + case 1: // 2 Holy Power + damage *= 3; // 3*30 = 90% + break; + case 2: // 3 Holy Power + damage *= 7.5; // 7.5*30% = 225% + break; + } + } + + SetHitDamage(damage); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_pal_templar_s_verdict_SpellScript::ChangeDamage, EFFECT_0, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_pal_templar_s_verdict_SpellScript(); + } +}; + void AddSC_paladin_spell_scripts() { //new spell_pal_ardent_defender(); @@ -733,4 +803,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); new spell_pal_sacred_shield(); + new spell_pal_templar_s_verdict(); } -- cgit v1.2.3 From af50ce6223ded9aa91a087556f2332b9c1f13df8 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Tue, 22 Jan 2013 00:20:16 +0100 Subject: Core/Spell: convert more spells to SpellScripts --- .../2013_01_23_00_world_spell_script_names.sql | 77 +++ src/server/game/Combat/ThreatManager.cpp | 19 +- src/server/game/Entities/Unit/Unit.cpp | 647 +-------------------- src/server/game/Entities/Unit/Unit.h | 42 +- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 28 - src/server/game/Spells/Auras/SpellAuras.cpp | 11 - src/server/game/Spells/SpellEffects.cpp | 2 +- .../IcecrownCitadel/boss_blood_queen_lana_thel.cpp | 38 ++ .../IcecrownCitadel/boss_the_lich_king.cpp | 37 ++ src/server/scripts/Spells/spell_dk.cpp | 54 ++ src/server/scripts/Spells/spell_druid.cpp | 75 +++ src/server/scripts/Spells/spell_generic.cpp | 180 ++++++ src/server/scripts/Spells/spell_hunter.cpp | 78 ++- src/server/scripts/Spells/spell_item.cpp | 351 ++++++++--- src/server/scripts/Spells/spell_mage.cpp | 197 +++++++ src/server/scripts/Spells/spell_paladin.cpp | 109 +++- src/server/scripts/Spells/spell_priest.cpp | 173 +++++- src/server/scripts/Spells/spell_rogue.cpp | 152 +++++ src/server/scripts/Spells/spell_shaman.cpp | 65 +++ src/server/scripts/Spells/spell_warlock.cpp | 97 +++ src/server/scripts/Spells/spell_warrior.cpp | 164 +++++- 21 files changed, 1795 insertions(+), 801 deletions(-) create mode 100644 sql/updates/world/2013_01_23_00_world_spell_script_names.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_23_00_world_spell_script_names.sql b/sql/updates/world/2013_01_23_00_world_spell_script_names.sql new file mode 100644 index 00000000000..dd8b35ae420 --- /dev/null +++ b/sql/updates/world/2013_01_23_00_world_spell_script_names.sql @@ -0,0 +1,77 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +70871, -- spell_blood_queen_essence_of_the_blood_queen +69383, -- spell_the_lich_king_dark_hunger +50453, -- spell_dk_blood_gorged +-48496, -- spell_dru_living_seed +48504, -- spell_dru_living_seed_proc +28764, -- spell_gen_adaptive_warding +27539, -- spell_gen_obsidian_armor +34074, -- spell_hun_ascpect_of_the_viper +64411, -- spell_item_blessing_of_ancient_kings +71875, -- spell_item_necrotic_touch +71877, -- spell_item_necrotic_touch +71169, -- spell_item_shadows_fate +71903, -- spell_item_shadowmourne +71905, -- spell_item_shadowmourne_soul_fragment +-44449, -- spell_mage_burnout +54646, -- spell_mage_focus_magic +-11119, -- spell_mage_ignite +-29074, -- spell_mage_master_of_elements +-9799, -- spell_pal_eye_for_an_eye +20154, -- spell_pal_seal_of_righteousness +21084 -- spell_pal_seal_of_righteousness +-47509, -- spell_pri_divine_aegis +55680, -- spell_pri_glyph_of_prayer_of_healing +28305, -- spell_pri_mana_leech +13877, -- spell_rog_blade_flurry +33735, -- spell_rog_blade_flurry +51211, -- spell_rog_blade_flurry +65956, -- spell_rog_blade_flurry +57934, -- spell_rog_tricks_of_the_trade +59628, -- spell_rog_tricks_of_the_trade_proc +-974, -- spell_sha_earth_shield +-47230, -- spell_warl_fel_synergy +63108, -- spell_warl_siphon_life +-58872, -- spell_warr_damage_shield +12328, -- spell_warr_sweeping_strikes +18765, -- spell_warr_sweeping_strikes +35429 -- spell_warr_sweeping_strikes +); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(70871, 'spell_blood_queen_essence_of_the_blood_queen'), +(69383, 'spell_the_lich_king_dark_hunger'), +(50453, 'spell_dk_blood_gorged'), +(-48496, 'spell_dru_living_seed'), +(48504, 'spell_dru_living_seed_proc'), +(28764, 'spell_gen_adaptive_warding'), +(27539, 'spell_gen_obsidian_armor'), +(34074, 'spell_hun_ascpect_of_the_viper'), +(64411, 'spell_item_blessing_of_ancient_kings'), +(71875, 'spell_item_necrotic_touch'), +(71877, 'spell_item_necrotic_touch'), +(71169, 'spell_item_shadows_fate'), +(71903, 'spell_item_shadowmourne'), +(71905, 'spell_item_shadowmourne_soul_fragment'), +(-44449, 'spell_mage_burnout'), +(54646, 'spell_mage_focus_magic'), +(-11119, 'spell_mage_ignite'), +(-29074, 'spell_mage_master_of_elements'), +(-9799, 'spell_pal_eye_for_an_eye'), +(20154, 'spell_pal_seal_of_righteousness'), +(21084, 'spell_pal_seal_of_righteousness'), +(-47509, 'spell_pri_divine_aegis'), +(55680, 'spell_pri_glyph_of_prayer_of_healing'), +(28305, 'spell_pri_mana_leech'), +(13877, 'spell_rog_blade_flurry'), +(33735, 'spell_rog_blade_flurry'), +(51211, 'spell_rog_blade_flurry'), +(65956, 'spell_rog_blade_flurry'), +(57934, 'spell_rog_tricks_of_the_trade'), +(59628, 'spell_rog_tricks_of_the_trade_proc'), +(-974, 'spell_sha_earth_shield'), +(-47230, 'spell_warl_fel_synergy'), +(63108, 'spell_warl_siphon_life'), +(-58872, 'spell_warr_damage_shield'), +(12328, 'spell_warr_sweeping_strikes'), +(18765, 'spell_warr_sweeping_strikes'), +(35429, 'spell_warr_sweeping_strikes'); diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 6d291ca301f..249c1696348 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -416,20 +416,17 @@ void ThreatManager::addThreat(Unit* victim, float threat, SpellSchoolMask school void ThreatManager::doAddThreat(Unit* victim, float threat) { - uint32 reducedThreadPercent = victim->GetReducedThreatPercent(); + uint32 redirectThreadPct = victim->GetRedirectThreatPercent(); // must check > 0.0f, otherwise dead loop - if (threat > 0.0f && reducedThreadPercent) + if (threat > 0.0f && redirectThreadPct) { - Unit* redirectTarget = victim->GetMisdirectionTarget(); - if (redirectTarget) - if (Aura* glyphAura = redirectTarget->GetAura(63326)) // Glyph of Vigilance - reducedThreadPercent += glyphAura->GetSpellInfo()->Effects[0].CalcValue(); - - float reducedThreat = threat * reducedThreadPercent / 100.0f; - threat -= reducedThreat; - if (redirectTarget) - _addThreat(redirectTarget, reducedThreat); + if (Unit* redirectTarget = victim->GetRedirectThreatTarget()) + { + float redirectThreat = CalculatePct(threat, redirectThreadPct); + threat -= redirectThreat; + _addThreat(redirectTarget, redirectThreat); + } } _addThreat(victim, threat); diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 49b86cff864..e7136a5c26f 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -256,8 +256,8 @@ Unit::Unit(bool isWorldObject): WorldObject(isWorldObject) m_speed_rate[i] = 1.0f; m_charmInfo = NULL; - m_reducedThreatPercent = 0; - m_misdirectionTargetGUID = 0; + + _redirectThreadInfo = RedirectThreatInfo(); // remove aurastates allowing special moves for (uint8 i = 0; i < MAX_REACTIVE; ++i) @@ -4984,127 +4984,6 @@ void Unit::SendAttackStateUpdate(uint32 HitInfo, Unit* target, uint8 /*SwingType SendAttackStateUpdate(&dmgInfo); } -bool Unit::HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) -{ - SpellInfo const* hasteSpell = triggeredByAura->GetSpellInfo(); - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - uint32 triggered_spell_id = 0; - Unit* target = victim; - int32 basepoints0 = 0; - - switch (hasteSpell->SpellFamilyName) - { - case SPELLFAMILY_ROGUE: - { - switch (hasteSpell->Id) - { - // Blade Flurry - case 13877: - case 33735: - { - target = SelectNearbyTarget(victim); - if (!target) - return false; - basepoints0 = damage; - triggered_spell_id = 22482; - break; - } - } - break; - } - } - - // processed charge only counting case - if (!triggered_spell_id) - return true; - - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id); - - if (!triggerEntry) - { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", hasteSpell->Id, triggered_spell_id); - return false; - } - - if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(triggered_spell_id)) - return false; - - if (basepoints0) - CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - else - CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); - - return true; -} - -bool Unit::HandleSpellCritChanceAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) -{ - SpellInfo const* triggeredByAuraSpell = triggeredByAura->GetSpellInfo(); - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - uint32 triggered_spell_id = 0; - Unit* target = victim; - int32 basepoints0 = 0; - - switch (triggeredByAuraSpell->SpellFamilyName) - { - case SPELLFAMILY_MAGE: - { - switch (triggeredByAuraSpell->Id) - { - // Focus Magic - case 54646: - { - Unit* caster = triggeredByAura->GetCaster(); - if (!caster) - return false; - - triggered_spell_id = 54648; - target = caster; - break; - } - } - } - } - - // processed charge only counting case - if (!triggered_spell_id) - return true; - - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id); - - if (!triggerEntry) - { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleHasteAuraProc: Spell %u has non-existing triggered spell %u", triggeredByAuraSpell->Id, triggered_spell_id); - return false; - } - - // default case - if (!target || (target != this && !target->isAlive())) - return false; - - if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(triggered_spell_id)) - return false; - - if (basepoints0) - CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - else - CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); - - return true; -} - //victim may be NULL bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown) { @@ -5128,38 +5007,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { switch (dummySpell->Id) { - // Bloodworms Health Leech - case 50453: - { - if (Unit* owner = GetOwner()) - { - basepoints0 = int32(damage * 1.50f); - target = owner; - triggered_spell_id = 50454; - break; - } - return false; - } - // Eye for an Eye - case 9799: - case 25988: - { - // return damage % to attacker but < 50% own total health - basepoints0 = int32(std::min(CalculatePct(damage, triggerAmount), CountPctFromMaxHealth(50))); - triggered_spell_id = 25997; - break; - } - // Sweeping Strikes - case 18765: - case 35429: - { - target = SelectNearbyTarget(victim); - if (!target) - return false; - - triggered_spell_id = 26654; - break; - } // Unstable Power case 24658: { @@ -5176,67 +5023,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere RemoveAuraFromStack(24662); return true; } - // Adaptive Warding (Frostfire Regalia set) - case 28764: - { - if (!procSpell) - return false; - - // find Mage Armor - if (!GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, 0x10000000, 0, 0)) - return false; - - switch (GetFirstSchoolInMask(procSpell->GetSchoolMask())) - { - case SPELL_SCHOOL_NORMAL: - case SPELL_SCHOOL_HOLY: - return false; // ignored - case SPELL_SCHOOL_FIRE: triggered_spell_id = 28765; break; - case SPELL_SCHOOL_NATURE: triggered_spell_id = 28768; break; - case SPELL_SCHOOL_FROST: triggered_spell_id = 28766; break; - case SPELL_SCHOOL_SHADOW: triggered_spell_id = 28769; break; - case SPELL_SCHOOL_ARCANE: triggered_spell_id = 28770; break; - default: - return false; - } - - target = this; - break; - } - // Obsidian Armor (Justice Bearer`s Pauldrons shoulder) - case 27539: - { - if (!procSpell) - return false; - - switch (GetFirstSchoolInMask(procSpell->GetSchoolMask())) - { - case SPELL_SCHOOL_NORMAL: - return false; // ignore - case SPELL_SCHOOL_HOLY: triggered_spell_id = 27536; break; - case SPELL_SCHOOL_FIRE: triggered_spell_id = 27533; break; - case SPELL_SCHOOL_NATURE: triggered_spell_id = 27538; break; - case SPELL_SCHOOL_FROST: triggered_spell_id = 27534; break; - case SPELL_SCHOOL_SHADOW: triggered_spell_id = 27535; break; - case SPELL_SCHOOL_ARCANE: triggered_spell_id = 27540; break; - default: - return false; - } - - target = this; - break; - } - // Mana Leech (Passive) (Priest Pet Aura) - case 28305: - { - // Cast on owner - target = GetOwner(); - if (!target) - return false; - - triggered_spell_id = 34650; - break; - } // Mark of Malice case 33493: { @@ -5427,14 +5213,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } return false; } - // Living Seed - case 48504: - { - triggered_spell_id = 48503; - basepoints0 = triggerAmount; - target = this; - break; - } // Kill command case 58914: { @@ -5594,50 +5372,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - case 71875: // Item - Black Bruise: Necrotic Touch Proc - case 71877: - { - basepoints0 = CalculatePct(int32(damage), triggerAmount); - triggered_spell_id = 71879; - break; - } - // Item - Shadowmourne Legendary - case 71903: - { - if (!victim || !victim->isAlive() || HasAura(73422)) // cant collect shards while under effect of Chaos Bane buff - return false; - - CastSpell(this, 71905, true, NULL, triggeredByAura); - - // this can't be handled in AuraScript because we need to know victim - Aura const* dummy = GetAura(71905); - if (!dummy || dummy->GetStackAmount() < 10) - return false; - - RemoveAurasDueToSpell(71905); - triggered_spell_id = 71904; - target = victim; - break; - } - // Shadow's Fate (Shadowmourne questline) - case 71169: - { - Unit* caster = triggeredByAura->GetCaster(); - if (caster && caster->GetTypeId() == TYPEID_PLAYER && caster->ToPlayer()->GetQuestStatus(24547) == QUEST_STATUS_INCOMPLETE) - { - CastSpell(caster, 71203, true); - return true; - } - else - return false; - } - // Essence of the Blood Queen - case 70871: - { - basepoints0 = CalculatePct(int32(damage), triggerAmount); - CastCustomSpell(70872, SPELLVALUE_BASE_POINT0, basepoints0, this); - return true; - } case 65032: // Boom aura (321 Boombot) { if (victim->GetEntry() != 33343) // Scrapbot @@ -5650,13 +5384,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere instance->DoCastSpellOnPlayers(65037); // Achievement criteria marker break; } - // Dark Hunger (The Lich King encounter) - case 69383: - { - basepoints0 = CalculatePct(int32(damage), 50); - triggered_spell_id = 69384; - break; - } } break; } @@ -5674,22 +5401,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 29442; break; } - // Master of Elements - if (dummySpell->SpellIconID == 1920) - { - if (!procSpell) - return false; - - // mana cost save - int32 cost = int32(procSpell->ManaCost + CalculatePct(GetCreateMana(), procSpell->ManaCostPercentage)); - basepoints0 = CalculatePct(cost, triggerAmount); - if (basepoints0 <= 0) - return false; - - target = this; - triggered_spell_id = 29077; - break; - } // Arcane Potency if (dummySpell->SpellIconID == 2120) { @@ -5707,7 +5418,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - // Hot Streak if (dummySpell->SpellIconID == 2999) { @@ -5730,20 +5440,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere counter->SetAmount(25); return true; } - // Burnout - if (dummySpell->SpellIconID == 2998) - { - if (!procSpell) - return false; - - int32 cost = int32(procSpell->ManaCost + CalculatePct(GetCreateMana(), procSpell->ManaCostPercentage)); - basepoints0 = CalculatePct(cost, triggerAmount); - if (basepoints0 <= 0) - return false; - triggered_spell_id = 44450; - target = this; - break; - } // Incanter's Regalia set (add trigger chance to Mana Shield) if (dummySpell->SpellFamilyFlags[0] & 0x8000) { @@ -5773,29 +5469,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere RemoveAurasByType(SPELL_AURA_MOD_DECREASE_SPEED); return true; } - // Ignite - case 11119: - case 11120: - case 12846: - case 12847: - case 12848: - { - switch (dummySpell->Id) - { - case 11119: basepoints0 = int32(0.04f * damage); break; - case 11120: basepoints0 = int32(0.08f * damage); break; - case 12846: basepoints0 = int32(0.12f * damage); break; - case 12847: basepoints0 = int32(0.16f * damage); break; - case 12848: basepoints0 = int32(0.20f * damage); break; - default: - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleDummyAuraProc: non handled spell id: %u (IG)", dummySpell->Id); - return false; - } - - triggered_spell_id = 12654; - basepoints0 += victim->GetRemainingPeriodicAmount(GetGUID(), triggered_spell_id, SPELL_AURA_PERIODIC_DAMAGE); - break; - } // Glyph of Ice Block case 56372: { @@ -5815,25 +5488,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - // Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) - case 64411: - { - if (!victim) - return false; - basepoints0 = int32(CalculatePct(damage, 15)); - if (AuraEffect* aurEff = victim->GetAuraEffect(64413, 0, GetGUID())) - { - // The shield can grow to a maximum size of 20, 000 damage absorbtion - aurEff->SetAmount(std::min(aurEff->GetAmount() + basepoints0, 20000)); - - // Refresh and return to prevent replacing the aura - aurEff->GetBase()->RefreshDuration(); - return true; - } - target = victim; - triggered_spell_id = 64413; - break; - } case 47020: // Enter vehicle XT-002 (Scrapbot) { if (GetTypeId() != TYPEID_UNIT) @@ -5854,16 +5508,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere { switch (dummySpell->Id) { - // Sweeping Strikes - case 12328: - { - target = SelectNearbyTarget(victim); - if (!target) - return false; - - triggered_spell_id = 26654; - break; - } // Victorious case 32216: { @@ -5913,14 +5557,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Damage Shield - if (dummySpell->SpellIconID == 3214) - { - triggered_spell_id = 59653; - // % of amount blocked - basepoints0 = CalculatePct(int32(GetShieldBlockValue()), triggerAmount); - break; - } // Glyph of Blocking if (dummySpell->Id == 58375) { @@ -5991,31 +5627,8 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggeredByAura->SetAmount(triggeredByAura->GetAmount() - damage); return true; } - // Fel Synergy - if (dummySpell->SpellIconID == 3222) - { - target = GetGuardianPet(); - if (!target) - return false; - basepoints0 = CalculatePct(int32(damage), triggerAmount); - triggered_spell_id = 54181; - break; - } switch (dummySpell->Id) { - // Siphon Life - case 63108: - { - if (!damage) - break; - // Glyph of Siphon Life - if (HasAura(56216)) - triggerAmount += triggerAmount / 4; - triggered_spell_id = 63106; - target = this; - basepoints0 = CalculatePct(int32(damage), triggerAmount); - break; - } // Glyph of Shadowflame case 63310: { @@ -6126,24 +5739,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere victim->CastSpell(victim, 57669, true, castItem, triggeredByAura); return true; // no hidden cooldown } - // Divine Aegis - if (dummySpell->SpellIconID == 2820) - { - if (!target) - return false; - - // Multiple effects stack, so let's try to find this aura. - int32 bonus = 0; - if (AuraEffect const* aurEff = target->GetAuraEffect(47753, 0)) - bonus = aurEff->GetAmount(); - - basepoints0 = CalculatePct(int32(damage), triggerAmount) + bonus; - if (basepoints0 > target->getLevel() * 125) - basepoints0 = target->getLevel() * 125; - - triggered_spell_id = 47753; - break; - } // Body and Soul if (dummySpell->SpellIconID == 2218) { @@ -6184,31 +5779,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Glyph of Prayer of Healing - case 55680: - { - triggered_spell_id = 56161; - - SpellInfo const* GoPoH = sSpellMgr->GetSpellInfo(triggered_spell_id); - if (!GoPoH) - return false; - - int EffIndex = 0; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; i++) - { - if (GoPoH->Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) - { - EffIndex = i; - break; - } - } - int32 tickcount = GoPoH->GetMaxDuration() / GoPoH->Effects[EffIndex].Amplitude; - if (!tickcount) - return false; - - basepoints0 = CalculatePct(int32(damage), triggerAmount) / tickcount; - break; - } // Improved Shadowform case 47570: case 47569: @@ -6481,13 +6051,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = isWrathSpell ? 48518 : 48517; break; } - // Living Seed - else if (dummySpell->SpellIconID == 2860) - { - triggered_spell_id = 48504; - basepoints0 = CalculatePct(int32(damage), triggerAmount); - break; - } break; } case SPELLFAMILY_ROGUE: @@ -6508,16 +6071,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere triggered_spell_id = 32747; break; } - case 57934: // Tricks of the Trade - { - Unit* redirectTarget = GetMisdirectionTarget(); - RemoveAura(57934); - if (!redirectTarget) - break; - CastSpell(this, 59628, true); - CastSpell(redirectTarget, 57933, true); - break; - } } switch (dummySpell->SpellIconID) @@ -6636,14 +6189,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere switch (dummySpell->Id) { - case 34477: // Misdirection - { - if (!GetMisdirectionTarget()) - return false; - triggered_spell_id = 35079; // 4 sec buff on self - target = this; - break; - } case 57870: // Glyph of Mend Pet { victim->CastSpell(victim, 57894, true, NULL, NULL, GetGUID()); @@ -6654,18 +6199,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } case SPELLFAMILY_PALADIN: { - // Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage) - if (dummySpell->SpellFamilyFlags[0] & 0x8000000) - { - if (effIndex != 0) - return false; - triggered_spell_id = 25742; - float ap = GetTotalAttackPowerValue(BASE_ATTACK); - int32 holy = SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY) + - victim->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); - basepoints0 = (int32)GetAttackTime(BASE_ATTACK) * int32(ap * 0.022f + 0.044f * holy) / 1000; - break; - } // Light's Beacon - Beacon of Light if (dummySpell->Id == 53651) { @@ -6832,20 +6365,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere } break; } - case 25899: // Greater Blessing of Sanctuary - case 20911: // Blessing of Sanctuary - { - target = this; - switch (target->getPowerType()) - { - case POWER_MANA: - triggered_spell_id = 57319; - break; - default: - return false; - } - break; - } // Seal of Vengeance (damage calc on apply aura) case 31801: { @@ -7348,20 +6867,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere target = this; break; } - // Earth Shield - if (dummySpell->SpellFamilyFlags[1] & 0x00000400) - { - // 3.0.8: Now correctly uses the Shaman's own spell critical strike chance to determine the chance of a critical heal. - originalCaster = triggeredByAura->GetCasterGUID(); - target = this; - basepoints0 = triggerAmount; - - // Glyph of Earth Shield - if (AuraEffect* aur = GetAuraEffect(63279, 0)) - AddPct(basepoints0, aur->GetAmount()); - triggered_spell_id = 379; - break; - } // Flametongue Weapon (Passive) if (dummySpell->SpellFamilyFlags[0] & 0x200000) { @@ -7813,114 +7318,6 @@ bool Unit::HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggere return true; } -bool Unit::HandleObsModEnergyAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) -{ - SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); - //uint32 effIndex = triggeredByAura->GetEffIndex(); - //int32 triggerAmount = triggeredByAura->GetAmount(); - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - uint32 triggered_spell_id = 0; - Unit* target = victim; - int32 basepoints0 = 0; - - switch (dummySpell->SpellFamilyName) - { - case SPELLFAMILY_HUNTER: - { - // Aspect of the Viper - if (dummySpell->SpellFamilyFlags[1] & 0x40000) - { - uint32 maxmana = GetMaxPower(POWER_MANA); - basepoints0 = CalculatePct(maxmana, GetAttackTime(RANGED_ATTACK) / 1000.0f); - target = this; - triggered_spell_id = 34075; - break; - } - break; - } - } - // processed charge only counting case - if (!triggered_spell_id) - return true; - - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id); - - // Try handle unknown trigger spells - if (!triggerEntry) - { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleObsModEnergyAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id); - return false; - } - - if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(triggered_spell_id)) - return false; - if (basepoints0) - CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - else - CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); - return true; -} -bool Unit::HandleModDamagePctTakenAuraProc(Unit* victim, uint32 /*damage*/, AuraEffect* triggeredByAura, SpellInfo const* /*procSpell*/, uint32 /*procFlag*/, uint32 /*procEx*/, uint32 cooldown) -{ - SpellInfo const* dummySpell = triggeredByAura->GetSpellInfo(); - //uint32 effIndex = triggeredByAura->GetEffIndex(); - //int32 triggerAmount = triggeredByAura->GetAmount(); - - Item* castItem = triggeredByAura->GetBase()->GetCastItemGUID() && GetTypeId() == TYPEID_PLAYER - ? ToPlayer()->GetItemByGuid(triggeredByAura->GetBase()->GetCastItemGUID()) : NULL; - - uint32 triggered_spell_id = 0; - Unit* target = victim; - int32 basepoints0 = 0; - - switch (dummySpell->SpellFamilyName) - { - case SPELLFAMILY_PALADIN: - { - // Blessing of Sanctuary - if (dummySpell->SpellFamilyFlags[0] & 0x10000000) - { - switch (getPowerType()) - { - case POWER_MANA: triggered_spell_id = 57319; break; - default: - return false; - } - } - break; - } - } - // processed charge only counting case - if (!triggered_spell_id) - return true; - - SpellInfo const* triggerEntry = sSpellMgr->GetSpellInfo(triggered_spell_id); - - if (!triggerEntry) - { - sLog->outError(LOG_FILTER_UNITS, "Unit::HandleModDamagePctTakenAuraProc: Spell %u has non-existing triggered spell %u", dummySpell->Id, triggered_spell_id); - return false; - } - - if (cooldown && GetTypeId() == TYPEID_PLAYER && ToPlayer()->HasSpellCooldown(triggered_spell_id)) - return false; - - if (basepoints0) - CastCustomSpell(target, triggered_spell_id, &basepoints0, NULL, NULL, true, castItem, triggeredByAura); - else - CastSpell(target, triggered_spell_id, true, castItem, triggeredByAura); - - if (cooldown && GetTypeId() == TYPEID_PLAYER) - ToPlayer()->AddSpellCooldown(triggered_spell_id, 0, time(NULL) + cooldown); - - return true; -} // Used in case when access to whole aura is needed // All procs should be handled like this... @@ -8303,12 +7700,6 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg RemoveAuraFromStack(auraSpellInfo->Id); return false; } - if (auraSpellInfo->Id == 50720) - { - target = triggeredByAura->GetCaster(); - if (!target) - return false; - } break; case SPELLFAMILY_WARLOCK: { @@ -14536,7 +13927,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u SpellInfo const* spellInfo = i->aura->GetSpellInfo(); uint32 Id = i->aura->GetId(); - AuraApplication const* aurApp = i->aura->GetApplicationOfTarget(GetGUID()); + AuraApplication* aurApp = i->aura->GetApplicationOfTarget(GetGUID()); bool prepare = i->aura->CallScriptPrepareProcHandlers(aurApp, eventInfo); @@ -14589,17 +13980,10 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u case SPELL_AURA_PROC_TRIGGER_DAMAGE: { // target has to be valid - if (!target) + if (!eventInfo.GetProcTarget()) break; - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: doing %u damage from spell id %u (triggered by %s aura of spell %u)", triggeredByAura->GetAmount(), spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - SpellNonMeleeDamage damageInfo(this, target, spellInfo->Id, spellInfo->SchoolMask); - uint32 newDamage = SpellDamageBonusDone(target, spellInfo, triggeredByAura->GetAmount(), SPELL_DIRECT_DAMAGE); - newDamage = target->SpellDamageBonusTaken(this, spellInfo, newDamage, SPELL_DIRECT_DAMAGE); - CalculateSpellDamageTaken(&damageInfo, newDamage, spellInfo); - DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb); - SendSpellNonMeleeDamageLog(&damageInfo); - DealSpellDamage(&damageInfo, true); + triggeredByAura->HandleProcTriggerDamageAuraProc(aurApp, eventInfo); // this function is part of the new proc system takeCharges = true; break; } @@ -14612,22 +13996,12 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u break; } case SPELL_AURA_OBS_MOD_POWER: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (HandleObsModEnergyAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) - takeCharges = true; - break; + case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: case SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (HandleModDamagePctTakenAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) - takeCharges = true; - break; case SPELL_AURA_MOD_MELEE_HASTE: - { - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s haste aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (HandleHasteAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) - takeCharges = true; + sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, isVictim ? "a victim's" : "an attacker's", triggeredByAura->GetId()); + takeCharges = true; break; - } case SPELL_AURA_OVERRIDE_CLASS_SCRIPTS: { sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); @@ -14699,11 +14073,6 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* target, uint32 procFlag, u if (triggeredByAura->GetCasterGUID() == target->GetGUID()) takeCharges = true; break; - case SPELL_AURA_MOD_SPELL_CRIT_CHANCE: - sLog->outDebug(LOG_FILTER_SPELLS_AURAS, "ProcDamageAndSpell: casting spell id %u (triggered by %s spell crit chance aura of spell %u)", spellInfo->Id, (isVictim?"a victim's":"an attacker's"), triggeredByAura->GetId()); - if (procSpell && HandleSpellCritChanceAuraProc(target, damage, triggeredByAura, procSpell, procFlag, procExtra, cooldown)) - takeCharges = true; - break; // CC Auras which use their amount amount to drop // Are there any more auras which need this? case SPELL_AURA_MOD_CONFUSE: diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 4bcc9c4b823..9b353d4cc02 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -965,6 +965,28 @@ struct SpellPeriodicAuraLogInfo uint32 createProcExtendMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCondition); +struct RedirectThreatInfo +{ + RedirectThreatInfo() : _targetGUID(0), _threatPct(0) { } + uint64 _targetGUID; + uint32 _threatPct; + + uint64 GetTargetGUID() { return _targetGUID; } + uint32 GetThreatPct() { return _threatPct; } + + void Set(uint64 guid, uint32 pct) + { + _targetGUID = guid; + _threatPct = pct; + } + + void ModifyThreatPct(int32 amount) + { + amount += _threatPct; + _threatPct = uint32(std::max(0, amount)); + } +}; + #define MAX_DECLINED_NAME_CASES 5 struct DeclinedName @@ -2153,13 +2175,12 @@ class Unit : public WorldObject uint32 GetModelForForm(ShapeshiftForm form) const; uint32 GetModelForTotem(PlayerTotemType totemType); - void SetReducedThreatPercent(uint32 pct, uint64 guid) - { - m_reducedThreatPercent = pct; - m_misdirectionTargetGUID = guid; - } - uint32 GetReducedThreatPercent() { return m_reducedThreatPercent; } - Unit* GetMisdirectionTarget() { return m_misdirectionTargetGUID ? GetUnit(*this, m_misdirectionTargetGUID) : NULL; } + // Redirect Threat + void SetRedirectThreat(uint64 guid, uint32 pct) { _redirectThreadInfo.Set(guid, pct); } + void ResetRedirectThreat() { SetRedirectThreat(0, 0); } + void ModifyRedirectThreat(int32 amount) { _redirectThreadInfo.ModifyThreatPct(amount); } + uint32 GetRedirectThreatPercent() { return _redirectThreadInfo.GetThreatPct(); } + Unit* GetRedirectThreatTarget() { return _redirectThreadInfo.GetTargetGUID() ? GetUnit(*this, _redirectThreadInfo.GetTargetGUID()) : NULL; } bool IsAIEnabled, NeedChangeAI; bool CreateVehicleKit(uint32 id, uint32 creatureEntry); @@ -2305,10 +2326,6 @@ class Unit : public WorldObject private: bool IsTriggeredAtSpellProcEvent(Unit* victim, Aura* aura, SpellInfo const* procSpell, uint32 procFlag, uint32 procExtra, WeaponAttackType attType, bool isVictim, bool active, SpellProcEventEntry const* & spellProcEvent); bool HandleDummyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleHasteAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleSpellCritChanceAuraProc(Unit* victim, uint32 damage, AuraEffect* triggredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleObsModEnergyAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); - bool HandleModDamagePctTakenAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleAuraProc(Unit* victim, uint32 damage, Aura* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown, bool * handled); bool HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 procFlag, uint32 procEx, uint32 cooldown); bool HandleOverrideClassScriptAuraProc(Unit* victim, uint32 damage, AuraEffect* triggeredByAura, SpellInfo const* procSpell, uint32 cooldown); @@ -2341,8 +2358,7 @@ class Unit : public WorldObject ComboPointHolderSet m_ComboPointHolders; - uint32 m_reducedThreatPercent; - uint64 m_misdirectionTargetGUID; + RedirectThreatInfo _redirectThreadInfo; bool m_cleanupDone; // lock made to not add stuff after cleanup before delete bool m_duringRemoveFromWorld; // lock made to not add stuff after begining removing from world diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index d029d2884c9..9230c46db15 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -484,16 +484,6 @@ int32 AuraEffect::CalculateAmount(Unit* caster) case SPELL_AURA_MANA_SHIELD: m_canBeRecalculated = false; break; - case SPELL_AURA_DUMMY: - if (!caster) - break; - // Earth Shield - if (GetSpellInfo()->SpellFamilyName == SPELLFAMILY_SHAMAN && m_spellInfo->SpellFamilyFlags[1] & 0x400) - { - amount = caster->SpellHealingBonusDone(GetBase()->GetUnitOwner(), GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); - amount = GetBase()->GetUnitOwner()->SpellHealingBonusTaken(caster, GetSpellInfo(), amount, SPELL_DIRECT_DAMAGE); - } - break; default: break; } @@ -4694,10 +4684,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (Aura* newAura = target->AddAura(71564, target)) newAura->SetStackAmount(newAura->GetSpellInfo()->StackAmount); break; - case 59628: // Tricks of the Trade - if (caster && caster->GetMisdirectionTarget()) - target->SetReducedThreatPercent(100, caster->GetMisdirectionTarget()->GetGUID()); - break; } } // AT REMOVE @@ -4793,20 +4779,6 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool if (GetId() == 61777) target->CastSpell(target, GetAmount(), true); break; - case SPELLFAMILY_ROGUE: - // Tricks of the trade - switch (GetId()) - { - case 59628: //Tricks of the trade buff on rogue (6sec duration) - target->SetReducedThreatPercent(0, 0); - break; - case 57934: //Tricks of the trade buff on rogue (30sec duration) - if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE || !caster->GetMisdirectionTarget()) - target->SetReducedThreatPercent(0, 0); - else - target->SetReducedThreatPercent(0, caster->GetMisdirectionTarget()->GetGUID()); - break; - } default: break; } diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index a41d25eae09..795908ce4b5 100644 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -1537,17 +1537,6 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b // mods at aura apply or remove switch (GetSpellInfo()->SpellFamilyName) { - case SPELLFAMILY_GENERIC: - switch (GetId()) - { - case 50720: // Vigilance - if (apply) - target->CastSpell(caster, 59665, true, 0, 0, caster->GetGUID()); - else - target->SetReducedThreatPercent(0, 0); - break; - } - break; case SPELLFAMILY_DRUID: // Enrage if ((GetSpellInfo()->SpellFamilyFlags[0] & 0x80000) && GetSpellInfo()->SpellIconID == 961) diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index 4fdf6654cba..bee770df748 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -5791,7 +5791,7 @@ void Spell::EffectRedirectThreat(SpellEffIndex /*effIndex*/) return; if (unitTarget) - m_caster->SetReducedThreatPercent((uint32)damage, unitTarget->GetGUID()); + m_caster->SetRedirectThreat(unitTarget->GetGUID(), uint32(damage)); } void Spell::EffectGameObjectDamage(SpellEffIndex /*effIndex*/) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index c8caa3976e4..5643d0ab732 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -46,6 +46,7 @@ enum Spells SPELL_FRENZIED_BLOODTHIRST_VISUAL = 71949, SPELL_VAMPIRIC_BITE = 71726, SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_PLR = 70879, + SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL = 70872, SPELL_FRENZIED_BLOODTHIRST = 70877, SPELL_UNCONTROLLABLE_FRENZY = 70923, SPELL_PRESENCE_OF_THE_DARKFALLEN = 71952, @@ -698,6 +699,42 @@ class spell_blood_queen_bloodbolt : public SpellScriptLoader } }; +// 70871 - Essence of the Blood Queen +class spell_blood_queen_essence_of_the_blood_queen : public SpellScriptLoader +{ + public: + spell_blood_queen_essence_of_the_blood_queen() : SpellScriptLoader("spell_blood_queen_essence_of_the_blood_queen") { } + + class spell_blood_queen_essence_of_the_blood_queen_AuraScript : public AuraScript + { + PrepareAuraScript(spell_blood_queen_essence_of_the_blood_queen_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL)) + return false; + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget()); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_blood_queen_essence_of_the_blood_queen_AuraScript::OnProc, EFFECT_1, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_blood_queen_essence_of_the_blood_queen_AuraScript(); + } +}; + class spell_blood_queen_pact_of_the_darkfallen : public SpellScriptLoader { public: @@ -849,6 +886,7 @@ void AddSC_boss_blood_queen_lana_thel() new spell_blood_queen_vampiric_bite(); new spell_blood_queen_frenzied_bloodthirst(); new spell_blood_queen_bloodbolt(); + new spell_blood_queen_essence_of_the_blood_queen(); new spell_blood_queen_pact_of_the_darkfallen(); new spell_blood_queen_pact_of_the_darkfallen_dmg(); new spell_blood_queen_pact_of_the_darkfallen_dmg_target(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index 452d09cf65f..3bd313fa148 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -145,6 +145,7 @@ enum Spells SPELL_RESTORE_SOUL = 72595, SPELL_RESTORE_SOULS = 73650, // Heroic SPELL_DARK_HUNGER = 69383, // Passive proc healing + SPELL_DARK_HUNGER_HEAL = 69384, SPELL_DESTROY_SOUL = 74086, // Used when Terenas Menethil dies SPELL_SOUL_RIP = 69397, // Deals increasing damage SPELL_SOUL_RIP_DAMAGE = 69398, @@ -3008,6 +3009,41 @@ class spell_the_lich_king_restore_soul : public SpellScriptLoader } }; +class spell_the_lich_king_dark_hunger : public SpellScriptLoader +{ + public: + spell_the_lich_king_dark_hunger() : SpellScriptLoader("spell_the_lich_king_dark_hunger") { } + + class spell_the_lich_king_dark_hunger_AuraScript : public AuraScript + { + PrepareAuraScript(spell_the_lich_king_dark_hunger_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DARK_HUNGER_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 heal = int32(eventInfo.GetDamageInfo()->GetDamage() / 2); + GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_the_lich_king_dark_hunger_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_the_lich_king_dark_hunger_AuraScript(); + } +}; + class spell_the_lich_king_in_frostmourne_room : public SpellScriptLoader { public: @@ -3253,6 +3289,7 @@ void AddSC_boss_the_lich_king() new spell_the_lich_king_lights_favor(); new spell_the_lich_king_soul_rip(); new spell_the_lich_king_restore_soul(); + new spell_the_lich_king_dark_hunger(); new spell_the_lich_king_in_frostmourne_room(); new spell_the_lich_king_summon_spirit_bomb(); new spell_the_lich_king_trigger_vile_spirit(); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index 62a0599dab1..73c34d42538 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -31,6 +31,7 @@ enum DeathKnightSpells SPELL_DK_ANTI_MAGIC_SHELL_TALENT = 51052, SPELL_DK_BLACK_ICE_R1 = 49140, SPELL_DK_BLOOD_BOIL_TRIGGERED = 65658, + SPELL_DK_BLOOD_GORGED_HEAL = 50454, SPELL_DK_CORPSE_EXPLOSION_TRIGGERED = 43999, SPELL_DK_CORPSE_EXPLOSION_VISUAL = 51270, SPELL_DK_DEATH_COIL_DAMAGE = 47632, @@ -252,6 +253,58 @@ class spell_dk_blood_boil : public SpellScriptLoader } }; +// 50453 - Bloodworms Health Leech +class spell_dk_blood_gorged : public SpellScriptLoader +{ + public: + spell_dk_blood_gorged() : SpellScriptLoader("spell_dk_blood_gorged") { } + + class spell_dk_blood_gorged_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_blood_gorged_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DK_BLOOD_GORGED_HEAL)) + return false; + return true; + } + + bool Load() + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _procTarget = GetTarget()->GetOwner(); + return _procTarget; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 1.5f); + GetTarget()->CastCustomSpell(SPELL_DK_BLOOD_GORGED_HEAL, SPELLVALUE_BASE_POINT0, bp, _procTarget, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_dk_blood_gorged_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_dk_blood_gorged_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_dk_blood_gorged_AuraScript(); + } +}; + // 49158 - Corpse Explosion (51325, 51326, 51327, 51328) class spell_dk_corpse_explosion : public SpellScriptLoader { @@ -958,6 +1011,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_anti_magic_shell_self(); new spell_dk_anti_magic_zone(); new spell_dk_blood_boil(); + new spell_dk_blood_gorged(); new spell_dk_corpse_explosion(); new spell_dk_death_coil(); new spell_dk_death_gate(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index e2b918e1c7f..160f14ff670 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -37,6 +37,8 @@ enum DruidSpells SPELL_DRUID_KING_OF_THE_JUNGLE = 48492, SPELL_DRUID_LIFEBLOOM_ENERGIZE = 64372, SPELL_DRUID_LIFEBLOOM_FINAL_HEAL = 33778, + SPELL_DRUID_LIVING_SEED_HEAL = 48503, + SPELL_DRUID_LIVING_SEED_PROC = 48504, SPELL_DRUID_NATURES_SPLENDOR = 57865, SPELL_DRUID_SURVIVAL_INSTINCTS = 50322, SPELL_DRUID_SAVAGE_ROAR = 62071, @@ -327,6 +329,77 @@ class spell_dru_lifebloom : public SpellScriptLoader } }; +// -48496 - Living Seed +class spell_dru_living_seed : public SpellScriptLoader +{ + public: + spell_dru_living_seed() : SpellScriptLoader("spell_dru_living_seed") { } + + class spell_dru_living_seed_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_living_seed_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIVING_SEED_PROC)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 amount = CalculatePct(eventInfo.GetHealInfo()->GetHeal(), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_PROC, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_dru_living_seed_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_living_seed_AuraScript(); + } +}; + +// 48504 - Living Seed (Proc) +class spell_dru_living_seed_proc : public SpellScriptLoader +{ + public: + spell_dru_living_seed_proc() : SpellScriptLoader("spell_dru_living_seed_proc") { } + + class spell_dru_living_seed_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dru_living_seed_proc_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_LIVING_SEED_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_dru_living_seed_proc_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_dru_living_seed_proc_AuraScript(); + } +}; + // 69366 - Moonkin Form passive class spell_dru_moonkin_form_passive : public SpellScriptLoader { @@ -921,6 +994,8 @@ void AddSC_druid_spell_scripts() new spell_dru_innervate(); new spell_dru_insect_swarm(); new spell_dru_lifebloom(); + new spell_dru_living_seed(); + new spell_dru_living_seed_proc(); new spell_dru_moonkin_form_passive(); new spell_dru_owlkin_frenzy(); new spell_dru_predatory_strikes(); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 6004ec6cf89..05fad623114 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -72,6 +72,97 @@ class spell_gen_absorb0_hitlimit1 : public SpellScriptLoader } }; +// 28764 - Adaptive Warding (Frostfire Regalia Set) +enum AdaptiveWarding +{ + SPELL_GEN_ADAPTIVE_WARDING_FIRE = 28765, + SPELL_GEN_ADAPTIVE_WARDING_NATURE = 28768, + SPELL_GEN_ADAPTIVE_WARDING_FROST = 28766, + SPELL_GEN_ADAPTIVE_WARDING_SHADOW = 28769, + SPELL_GEN_ADAPTIVE_WARDING_ARCANE = 28770 +}; + +class spell_gen_adaptive_warding : public SpellScriptLoader +{ + public: + spell_gen_adaptive_warding() : SpellScriptLoader("spell_gen_adaptive_warding") { } + + class spell_gen_adaptive_warding_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_adaptive_warding_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_FIRE) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_NATURE) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_FROST) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_SHADOW) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_ADAPTIVE_WARDING_ARCANE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + return false; + + // find Mage Armor + if (!GetTarget()->GetAuraEffect(SPELL_AURA_MOD_MANA_REGEN_INTERRUPT, SPELLFAMILY_MAGE, 0x10000000, 0x0, 0x0)) + return false; + + switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask())) + { + case SPELL_SCHOOL_NORMAL: + case SPELL_SCHOOL_HOLY: + return false; + default: + break; + } + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId = 0; + switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask())) + { + case SPELL_SCHOOL_FIRE: + spellId = SPELL_GEN_ADAPTIVE_WARDING_FIRE; + break; + case SPELL_SCHOOL_NATURE: + spellId = SPELL_GEN_ADAPTIVE_WARDING_NATURE; + break; + case SPELL_SCHOOL_FROST: + spellId = SPELL_GEN_ADAPTIVE_WARDING_FROST; + break; + case SPELL_SCHOOL_SHADOW: + spellId = SPELL_GEN_ADAPTIVE_WARDING_SHADOW; + break; + case SPELL_SCHOOL_ARCANE: + spellId = SPELL_GEN_ADAPTIVE_WARDING_ARCANE; + break; + default: + return; + } + GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_gen_adaptive_warding_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_gen_adaptive_warding_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_adaptive_warding_AuraScript(); + } +}; + // 41337 Aura of Anger class spell_gen_aura_of_anger : public SpellScriptLoader { @@ -378,6 +469,93 @@ class spell_gen_nightmare_vine : public SpellScriptLoader } }; +// 27539 - Obsidian Armor +enum ObsidianArmor +{ + SPELL_GEN_OBSIDIAN_ARMOR_HOLY = 27536, + SPELL_GEN_OBSIDIAN_ARMOR_FIRE = 27533, + SPELL_GEN_OBSIDIAN_ARMOR_NATURE = 27538, + SPELL_GEN_OBSIDIAN_ARMOR_FROST = 27534, + SPELL_GEN_OBSIDIAN_ARMOR_SHADOW = 27535, + SPELL_GEN_OBSIDIAN_ARMOR_ARCANE = 27540 +}; + +class spell_gen_obsidian_armor : public SpellScriptLoader +{ + public: + spell_gen_obsidian_armor() : SpellScriptLoader("spell_gen_obsidian_armor") { } + + class spell_gen_obsidian_armor_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_obsidian_armor_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_HOLY) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FIRE) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_NATURE) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_FROST) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_SHADOW) || + !sSpellMgr->GetSpellInfo(SPELL_GEN_OBSIDIAN_ARMOR_ARCANE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + return false; + + if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL) + return false; + + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + uint32 spellId = 0; + switch (GetFirstSchoolInMask(eventInfo.GetSchoolMask())) + { + case SPELL_SCHOOL_HOLY: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_HOLY; + break; + case SPELL_SCHOOL_FIRE: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_FIRE; + break; + case SPELL_SCHOOL_NATURE: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_NATURE; + break; + case SPELL_SCHOOL_FROST: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_FROST; + break; + case SPELL_SCHOOL_SHADOW: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_SHADOW; + break; + case SPELL_SCHOOL_ARCANE: + spellId = SPELL_GEN_OBSIDIAN_ARMOR_ARCANE; + break; + default: + return; + } + GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_gen_obsidian_armor_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_gen_obsidian_armor_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_obsidian_armor_AuraScript(); + } +}; + // 45472 Parachute enum ParachuteSpells { @@ -3343,6 +3521,7 @@ class spell_gen_replenishment : public SpellScriptLoader void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); + new spell_gen_adaptive_warding(); new spell_gen_aura_of_anger(); new spell_gen_av_drekthar_presence(); new spell_gen_burn_brutallus(); @@ -3350,6 +3529,7 @@ void AddSC_generic_spell_scripts() new spell_gen_create_lance(); new spell_gen_netherbloom(); new spell_gen_nightmare_vine(); + new spell_gen_obsidian_armor(); new spell_gen_parachute(); new spell_gen_pet_summoned(); new spell_gen_remove_flight_auras(); diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp index a9b21807899..877248cf1a8 100644 --- a/src/server/scripts/Spells/spell_hunter.cpp +++ b/src/server/scripts/Spells/spell_hunter.cpp @@ -33,12 +33,15 @@ enum HunterSpells { SPELL_HUNTER_ASPECT_OF_THE_BEAST_PET = 61669, + SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE = 34075, SPELL_HUNTER_BESTIAL_WRATH = 19574, SPELL_HUNTER_CHIMERA_SHOT_SERPENT = 53353, SPELL_HUNTER_CHIMERA_SHOT_VIPER = 53358, SPELL_HUNTER_CHIMERA_SHOT_SCORPID = 53359, + SPELL_HUNTER_GLYPHE_OF_ASPECT_OF_THE_VIPER = 56851, SPELL_HUNTER_INVIGORATION_TRIGGERED = 53398, SPELL_HUNTER_MASTERS_CALL_TRIGGERED = 62305, + SPELL_HUNTER_MISDIRECTION_PROC = 35079, SPELL_HUNTER_PET_LAST_STAND_TRIGGERED = 53479, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX = 55709, SPELL_HUNTER_PET_HEART_OF_THE_PHOENIX_TRIGGERED = 54114, @@ -99,6 +102,50 @@ class spell_hun_aspect_of_the_beast : public SpellScriptLoader } }; +// 34074 - Aspect of the Viper +class spell_hun_ascpect_of_the_viper : public SpellScriptLoader +{ + public: + spell_hun_ascpect_of_the_viper() : SpellScriptLoader("spell_hun_ascpect_of_the_viper") { } + + class spell_hun_ascpect_of_the_viper_AuraScript : public AuraScript + { + PrepareAuraScript(spell_hun_ascpect_of_the_viper_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_GLYPHE_OF_ASPECT_OF_THE_VIPER)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + + uint32 maxMana = GetTarget()->GetMaxPower(POWER_MANA); + int32 mana = CalculatePct(maxMana, GetTarget()->GetAttackTime(RANGED_ATTACK) / 1000.0f); + + if (AuraEffect const* glyphe = GetTarget()->GetAuraEffect(SPELL_HUNTER_GLYPHE_OF_ASPECT_OF_THE_VIPER, EFFECT_0)) + AddPct(mana, glyphe->GetAmount()); + + GetTarget()->CastCustomSpell(SPELL_HUNTER_ASPECT_OF_THE_VIPER_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_hun_ascpect_of_the_viper_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_OBS_MOD_POWER); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_hun_ascpect_of_the_viper_AuraScript(); + } +}; + // 53209 - Chimera Shot class spell_hun_chimera_shot : public SpellScriptLoader { @@ -358,16 +405,35 @@ class spell_hun_misdirection : public SpellScriptLoader { PrepareAuraScript(spell_hun_misdirection_AuraScript); + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_HUNTER_MISDIRECTION_PROC)) + return false; + return true; + } + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* caster = GetCaster()) - if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) - caster->SetReducedThreatPercent(0, 0); + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) + GetTarget()->ResetRedirectThreat(); + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return GetTarget()->GetRedirectThreatTarget(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_MISDIRECTION_PROC, true, NULL, aurEff); } void Register() { AfterEffectRemove += AuraEffectRemoveFn(spell_hun_misdirection_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + DoCheckProc += AuraCheckProcFn(spell_hun_misdirection_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_hun_misdirection_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); } }; @@ -377,7 +443,7 @@ class spell_hun_misdirection : public SpellScriptLoader } }; -// 35079 - Misdirection proc +// 35079 - Misdirection (Proc) class spell_hun_misdirection_proc : public SpellScriptLoader { public: @@ -389,8 +455,7 @@ class spell_hun_misdirection_proc : public SpellScriptLoader void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (GetCaster()) - GetCaster()->SetReducedThreatPercent(0, 0); + GetTarget()->ResetRedirectThreat(); } void Register() @@ -740,6 +805,7 @@ class spell_hun_target_only_pet_and_owner : public SpellScriptLoader void AddSC_hunter_spell_scripts() { new spell_hun_aspect_of_the_beast(); + new spell_hun_ascpect_of_the_viper(); new spell_hun_chimera_shot(); new spell_hun_disengage(); new spell_hun_invigoration(); diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index c38d05bc02a..b8e17f4ecca 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -102,6 +102,63 @@ class spell_item_arcane_shroud : public SpellScriptLoader } }; +// 64411 - Blessing of Ancient Kings (Val'anyr, Hammer of Ancient Kings) +enum BlessingOfAncientKings +{ + SPELL_PROTECTION_OF_ANCIENT_KINGS = 64413 +}; + +class spell_item_blessing_of_ancient_kings : public SpellScriptLoader +{ + public: + spell_item_blessing_of_ancient_kings() : SpellScriptLoader("spell_item_blessing_of_ancient_kings") { } + + class spell_item_blessing_of_ancient_kings_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_blessing_of_ancient_kings_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PROTECTION_OF_ANCIENT_KINGS)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetProcTarget(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 absorb = int32(CalculatePct(eventInfo.GetHealInfo()->GetHeal(), 15.0f)); + if (AuraEffect* protEff = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_PROTECTION_OF_ANCIENT_KINGS, 0, eventInfo.GetActor()->GetGUID())) + { + // The shield can grow to a maximum size of 20,000 damage absorbtion + protEff->SetAmount(std::min(protEff->GetAmount() + absorb, 20000)); + + // Refresh and return to prevent replacing the aura + aurEff->GetBase()->RefreshDuration(); + } + else + GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_item_blessing_of_ancient_kings_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_blessing_of_ancient_kings_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_blessing_of_ancient_kings_AuraScript(); + } +}; + // 8342 - Defibrillate (Goblin Jumper Cables) have 33% chance on success // 22999 - Defibrillate (Goblin Jumper Cables XL) have 50% chance on success // 54732 - Defibrillate (Gnomish Army Knife) have 67% chance on success @@ -444,6 +501,47 @@ class spell_item_mingos_fortune_generator : public SpellScriptLoader } }; +// 71875, 71877 - Item - Black Bruise: Necrotic Touch Proc +enum NecroticTouch +{ + SPELL_ITEM_NECROTIC_TOUCH_PROC = 71879 +}; + +class spell_item_necrotic_touch : public SpellScriptLoader +{ + public: + spell_item_necrotic_touch() : SpellScriptLoader("spell_item_necrotic_touch") { } + + class spell_item_necrotic_touch_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_necrotic_touch_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ITEM_NECROTIC_TOUCH_PROC)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, GetTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_item_necrotic_touch_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_necrotic_touch_AuraScript(); + } +}; + // http://www.wowhead.com/item=10720 Gnomish Net-o-Matic Projector // 13120 Net-o-Matic enum NetOMaticSpells @@ -711,6 +809,189 @@ class spell_item_scroll_of_recall : public SpellScriptLoader } }; +// 71169 - Shadow's Fate (Shadowmourne questline) +enum ShadowsFate +{ + SPELL_SOUL_FEAST = 71203, + QUEST_A_FEAST_OF_SOULS = 24547 +}; + +class spell_item_shadows_fate : public SpellScriptLoader +{ + public: + spell_item_shadows_fate() : SpellScriptLoader("spell_item_shadows_fate") { } + + class spell_item_shadows_fate_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_shadows_fate_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SOUL_FEAST)) + return false; + if (!sObjectMgr->GetQuestTemplate(QUEST_A_FEAST_OF_SOULS)) + return false; + return true; + } + + bool Load() + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _procTarget = GetCaster(); + return _procTarget && _procTarget->GetTypeId() == TYPEID_PLAYER && _procTarget->ToPlayer()->GetQuestStatus(QUEST_A_FEAST_OF_SOULS) == QUEST_STATUS_INCOMPLETE; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(_procTarget, SPELL_SOUL_FEAST, true); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_item_shadows_fate_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_shadows_fate_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_shadows_fate_AuraScript(); + } +}; + +enum Shadowmourne +{ + SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE = 71904, + SPELL_SHADOWMOURNE_SOUL_FRAGMENT = 71905, + SPELL_SHADOWMOURNE_VISUAL_LOW = 72521, + SPELL_SHADOWMOURNE_VISUAL_HIGH = 72523, + SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF = 73422, +}; + +// 71903 - Item - Shadowmourne Legendary +class spell_item_shadowmourne : public SpellScriptLoader +{ + public: + spell_item_shadowmourne() : SpellScriptLoader("spell_item_shadowmourne") { } + + class spell_item_shadowmourne_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_shadowmourne_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_SOUL_FRAGMENT)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + if (GetTarget()->HasAura(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) // cant collect shards while under effect of Chaos Bane buff + return false; + return eventInfo.GetProcTarget() && eventInfo.GetProcTarget()->isAlive(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_SHADOWMOURNE_SOUL_FRAGMENT, true, NULL, aurEff); + + // this can't be handled in AuraScript of SoulFragments because we need to know victim + if (Aura* soulFragments = GetTarget()->GetAura(SPELL_SHADOWMOURNE_SOUL_FRAGMENT)) + { + if (soulFragments->GetStackAmount() >= 10) + { + GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHADOWMOURNE_CHAOS_BANE_DAMAGE, true, NULL, aurEff); + soulFragments->Remove(); + } + } + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_item_shadowmourne_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_item_shadowmourne_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_shadowmourne_AuraScript(); + } +}; + +// 71905 - Soul Fragment +class spell_item_shadowmourne_soul_fragment : public SpellScriptLoader +{ + public: + spell_item_shadowmourne_soul_fragment() : SpellScriptLoader("spell_item_shadowmourne_soul_fragment") { } + + class spell_item_shadowmourne_soul_fragment_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_shadowmourne_soul_fragment_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) + return false; + return true; + } + + void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + switch (GetStackAmount()) + { + case 1: + target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_LOW, true); + break; + case 6: + target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW); + target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_HIGH, true); + break; + case 10: + target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH); + target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true); + break; + default: + break; + } + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW); + target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH); + } + + void Register() + { + AfterEffectApply += AuraEffectApplyFn(spell_item_shadowmourne_soul_fragment_AuraScript::OnStackChange, EFFECT_0, SPELL_AURA_MOD_STAT, AuraEffectHandleModes(AURA_EFFECT_HANDLE_REAL | AURA_EFFECT_HANDLE_REAPPLY)); + AfterEffectRemove += AuraEffectRemoveFn(spell_item_shadowmourne_soul_fragment_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_item_shadowmourne_soul_fragment_AuraScript(); + } +}; + // http://www.wowhead.com/item=7734 Six Demon Bag // 14537 Six Demon Bag enum SixDemonBagSpells @@ -864,70 +1145,6 @@ class spell_item_underbelly_elixir : public SpellScriptLoader } }; -enum eShadowmourneVisuals -{ - SPELL_SHADOWMOURNE_VISUAL_LOW = 72521, - SPELL_SHADOWMOURNE_VISUAL_HIGH = 72523, - SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF = 73422, -}; - -class spell_item_shadowmourne : public SpellScriptLoader -{ -public: - spell_item_shadowmourne() : SpellScriptLoader("spell_item_shadowmourne") { } - - class spell_item_shadowmourne_AuraScript : public AuraScript - { - PrepareAuraScript(spell_item_shadowmourne_AuraScript); - - bool Validate(SpellInfo const* /*spellEntry*/) - { - if (!sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_LOW) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_VISUAL_HIGH) || !sSpellMgr->GetSpellInfo(SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF)) - return false; - return true; - } - - void OnStackChange(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - switch (GetStackAmount()) - { - case 1: - target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_LOW, true); - break; - case 6: - target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW); - target->CastSpell(target, SPELL_SHADOWMOURNE_VISUAL_HIGH, true); - break; - case 10: - target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH); - target->CastSpell(target, SPELL_SHADOWMOURNE_CHAOS_BANE_BUFF, true); - break; - default: - break; - } - } - - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) - { - Unit* target = GetTarget(); - target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_LOW); - target->RemoveAurasDueToSpell(SPELL_SHADOWMOURNE_VISUAL_HIGH); - } - - void Register() - { - AfterEffectApply += AuraEffectApplyFn(spell_item_shadowmourne_AuraScript::OnStackChange, EFFECT_0, SPELL_AURA_MOD_STAT, AuraEffectHandleModes(AURA_EFFECT_HANDLE_REAL | AURA_EFFECT_HANDLE_REAPPLY)); - AfterEffectRemove += AuraEffectRemoveFn(spell_item_shadowmourne_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_MOD_STAT, AURA_EFFECT_HANDLE_REAL); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_item_shadowmourne_AuraScript(); - } -}; - enum AirRifleSpells { SPELL_AIR_RIFLE_HOLD_VISUAL = 65582, @@ -2249,6 +2466,7 @@ void AddSC_item_spell_scripts() new spell_item_trigger_spell("spell_item_mithril_mechanical_dragonling", SPELL_MITHRIL_MECHANICAL_DRAGONLING); new spell_item_arcane_shroud(); + new spell_item_blessing_of_ancient_kings(); new spell_item_defibrillate("spell_item_goblin_jumper_cables", 67, SPELL_GOBLIN_JUMPER_CABLES_FAIL); new spell_item_defibrillate("spell_item_goblin_jumper_cables_xl", 50, SPELL_GOBLIN_JUMPER_CABLES_XL_FAIL); new spell_item_defibrillate("spell_item_gnomish_army_knife", 33); @@ -2257,15 +2475,18 @@ void AddSC_item_spell_scripts() new spell_item_gnomish_death_ray(); new spell_item_make_a_wish(); new spell_item_mingos_fortune_generator(); + new spell_item_necrotic_touch(); new spell_item_net_o_matic(); new spell_item_noggenfogger_elixir(); new spell_item_piccolo_of_the_flaming_fire(); new spell_item_savory_deviate_delight(); new spell_item_scroll_of_recall(); + new spell_item_shadows_fate(); + new spell_item_shadowmourne(); + new spell_item_shadowmourne_soul_fragment(); new spell_item_six_demon_bag(); new spell_item_the_eye_of_diminution(); new spell_item_underbelly_elixir(); - new spell_item_shadowmourne(); new spell_item_red_rider_air_rifle(); new spell_item_create_heart_candy(); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index a673759a49e..ca835c61a3a 100644 --- a/src/server/scripts/Spells/spell_mage.cpp +++ b/src/server/scripts/Spells/spell_mage.cpp @@ -28,11 +28,15 @@ enum MageSpells { + SPELL_MAGE_BURNOUT = 29077, SPELL_MAGE_COLD_SNAP = 11958, + SPELL_MAGE_FOCUS_MAGIC_PROC = 54648, SPELL_MAGE_FROST_WARDING_R1 = 11189, SPELL_MAGE_FROST_WARDING_TRIGGERED = 57776, SPELL_MAGE_INCANTERS_ABSORBTION_R1 = 44394, SPELL_MAGE_INCANTERS_ABSORBTION_TRIGGERED = 44413, + SPELL_MAGE_IGNITE = 12654, + SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE = 29077, SPELL_MAGE_SQUIRREL_FORM = 32813, SPELL_MAGE_GIRAFFE_FORM = 32816, SPELL_MAGE_SERPENT_FORM = 32817, @@ -105,6 +109,51 @@ class spell_mage_blast_wave : public SpellScriptLoader } }; +// -44449 - Burnout +class spell_mage_burnout : public SpellScriptLoader +{ + public: + spell_mage_burnout() : SpellScriptLoader("spell_mage_burnout") { } + + class spell_mage_burnout_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_burnout_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_BURNOUT)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo()->GetSpellInfo(); // eventInfo.GetSpellInfo() + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 mana = int32(eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask())); + mana = CalculatePct(mana, aurEff->GetAmount()); + + GetTarget()->CastCustomSpell(SPELL_MAGE_BURNOUT, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_mage_burnout_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_mage_burnout_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_burnout_AuraScript(); + } +}; + // 11958 - Cold Snap class spell_mage_cold_snap : public SpellScriptLoader { @@ -219,6 +268,57 @@ class spell_mage_fire_frost_ward : public SpellScriptLoader } }; +// 54646 - Focus Magic +class spell_mage_focus_magic : public SpellScriptLoader +{ + public: + spell_mage_focus_magic() : SpellScriptLoader("spell_mage_focus_magic") { } + + class spell_mage_focus_magic_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_focus_magic_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_FOCUS_MAGIC_PROC)) + return false; + return true; + } + + bool Load() + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _procTarget = GetCaster(); + return _procTarget && _procTarget->isAlive(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(_procTarget, SPELL_MAGE_FOCUS_MAGIC_PROC, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_mage_focus_magic_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_mage_focus_magic_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_SPELL_CRIT_CHANCE); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_focus_magic_AuraScript(); + } +}; + // -11426 - Ice Barrier class spell_mage_ice_barrier : public SpellScriptLoader { @@ -262,6 +362,53 @@ class spell_mage_ice_barrier : public SpellScriptLoader } }; +// -11119 - Ignite +class spell_mage_ignite : public SpellScriptLoader +{ + public: + spell_mage_ignite() : SpellScriptLoader("spell_mage_ignite") { } + + class spell_mage_ignite_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_ignite_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_IGNITE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetProcTarget(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + SpellInfo const* igniteDot = sSpellMgr->GetSpellInfo(SPELL_MAGE_IGNITE); + int32 pct = 8 * GetSpellInfo()->GetRank(); + + int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); + amount += eventInfo.GetProcTarget()->GetRemainingPeriodicAmount(eventInfo.GetActor()->GetGUID(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE); + GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_mage_ignite_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_mage_ignite_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_ignite_AuraScript(); + } +}; + // -44457 - Living Bomb class spell_mage_living_bomb : public SpellScriptLoader { @@ -339,6 +486,52 @@ class spell_mage_mana_shield : public SpellScriptLoader } }; +// -29074 - Master of Elements +class spell_mage_master_of_elements : public SpellScriptLoader +{ + public: + spell_mage_master_of_elements() : SpellScriptLoader("spell_mage_master_of_elements") { } + + class spell_mage_master_of_elements_AuraScript : public AuraScript + { + PrepareAuraScript(spell_mage_master_of_elements_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo()->GetSpellInfo(); // eventInfo.GetSpellInfo() + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 mana = int32(eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask())); + mana = CalculatePct(mana, aurEff->GetAmount()); + + if (mana > 0) + GetTarget()->CastCustomSpell(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_mage_master_of_elements_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_mage_master_of_elements_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_mage_master_of_elements_AuraScript(); + } +}; + enum SilvermoonPolymorph { NPC_AUROSALIA = 18744, @@ -437,11 +630,15 @@ class spell_mage_summon_water_elemental : public SpellScriptLoader void AddSC_mage_spell_scripts() { new spell_mage_blast_wave(); + new spell_mage_burnout(); new spell_mage_cold_snap(); new spell_mage_fire_frost_ward(); + new spell_mage_focus_magic(); new spell_mage_ice_barrier(); + new spell_mage_ignite(); new spell_mage_living_bomb(); new spell_mage_mana_shield(); + new spell_mage_master_of_elements(); new spell_mage_polymorph_cast_visual(); new spell_mage_summon_water_elemental(); } diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp index 2f22de97d77..6be2453affb 100644 --- a/src/server/scripts/Spells/spell_paladin.cpp +++ b/src/server/scripts/Spells/spell_paladin.cpp @@ -31,6 +31,7 @@ enum PaladinSpells { SPELL_PALADIN_DIVINE_PLEA = 54428, SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF = 67480, + SPELL_PALADIN_BLESSING_OF_SANCTUARY_ENERGIZE = 57319, SPELL_PALADIN_HOLY_SHOCK_R1 = 20473, SPELL_PALADIN_HOLY_SHOCK_R1_DAMAGE = 25912, @@ -45,6 +46,8 @@ enum PaladinSpells SPELL_PALADIN_DIVINE_STORM_DUMMY = 54171, SPELL_PALADIN_DIVINE_STORM_HEAL = 54172, + SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE = 25997, + SPELL_PALADIN_FORBEARANCE = 25771, SPELL_PALADIN_AVENGING_WRATH_MARKER = 61987, SPELL_PALADIN_IMMUNE_SHIELD_MARKER = 61988, @@ -56,6 +59,8 @@ enum PaladinSpells SPELL_PALADIN_RIGHTEOUS_DEFENSE_TAUNT = 31790, + SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS = 25742, + SPELL_GENERIC_ARENA_DAMPENING = 74410, SPELL_GENERIC_BATTLEGROUND_DAMPENING = 74411 }; @@ -192,8 +197,8 @@ class spell_pal_blessing_of_faith : public SpellScriptLoader } }; -// 20911 Blessing of Sanctuary -// 25899 Greater Blessing of Sanctuary +// 20911 - Blessing of Sanctuary +// 25899 - Greater Blessing of Sanctuary class spell_pal_blessing_of_sanctuary : public SpellScriptLoader { public: @@ -207,6 +212,8 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader { if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF)) return false; + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_BLESSING_OF_SANCTUARY_ENERGIZE)) + return false; return true; } @@ -223,10 +230,23 @@ class spell_pal_blessing_of_sanctuary : public SpellScriptLoader target->RemoveAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY_BUFF, GetCasterGUID()); } + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + return GetTarget()->getPowerType() == POWER_MANA; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(GetTarget(), SPELL_PALADIN_BLESSING_OF_SANCTUARY_ENERGIZE, true, NULL, aurEff); + } + void Register() { AfterEffectApply += AuraEffectApplyFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); AfterEffectRemove += AuraEffectRemoveFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + DoCheckProc += AuraCheckProcFn(spell_pal_blessing_of_sanctuary_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pal_blessing_of_sanctuary_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); } }; @@ -417,6 +437,43 @@ class spell_pal_exorcism_and_holy_wrath_damage : public SpellScriptLoader } }; +// -9799 - Eye for an Eye +class spell_pal_eye_for_an_eye : public SpellScriptLoader +{ + public: + spell_pal_eye_for_an_eye() : SpellScriptLoader("spell_pal_eye_for_an_eye") { } + + class spell_pal_eye_for_an_eye_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_eye_for_an_eye_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE)) + return false; + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + // return damage % to attacker but < 50% own total health + int32 damage = int32(std::min(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()), GetTarget()->GetMaxHealth() / 2)); + GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_pal_eye_for_an_eye_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_eye_for_an_eye_AuraScript(); + } +}; + // 63521 - Guarded by The Light class spell_pal_guarded_by_the_light : public SpellScriptLoader { @@ -794,6 +851,52 @@ class spell_pal_sacred_shield : public SpellScriptLoader } }; +// 20154, 21084 - Seal of Righteousness - melee proc dummy (addition ${$MWS*(0.022*$AP+0.044*$SPH)} damage) +class spell_pal_seal_of_righteousness : public SpellScriptLoader +{ + public: + spell_pal_seal_of_righteousness() : SpellScriptLoader("spell_pal_seal_of_righteousness") { } + + class spell_pal_seal_of_righteousness_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pal_seal_of_righteousness_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetProcTarget(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + float ap = GetTarget()->GetTotalAttackPowerValue(BASE_ATTACK); + int32 holy = GetTarget()->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_HOLY); + holy += eventInfo.GetProcTarget()->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_HOLY); + int32 bp = int32((ap * 0.022f + 0.044f * holy) * GetTarget()->GetAttackTime(BASE_ATTACK) / 1000); + GetTarget()->CastCustomSpell(SPELL_PALADIN_SEAL_OF_RIGHTEOUSNESS, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_pal_seal_of_righteousness_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pal_seal_of_righteousness_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pal_seal_of_righteousness_AuraScript(); + } +}; + void AddSC_paladin_spell_scripts() { new spell_pal_ardent_defender(); @@ -803,6 +906,7 @@ void AddSC_paladin_spell_scripts() new spell_pal_divine_storm(); new spell_pal_divine_storm_dummy(); new spell_pal_exorcism_and_holy_wrath_damage(); + new spell_pal_eye_for_an_eye(); new spell_pal_guarded_by_the_light(); new spell_pal_hand_of_sacrifice(); new spell_pal_hand_of_salvation(); @@ -811,4 +915,5 @@ void AddSC_paladin_spell_scripts() new spell_pal_lay_on_hands(); new spell_pal_righteous_defense(); new spell_pal_sacred_shield(); + new spell_pal_seal_of_righteousness(); } diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp index 23a39819aa2..e19110d0f62 100644 --- a/src/server/scripts/Spells/spell_priest.cpp +++ b/src/server/scripts/Spells/spell_priest.cpp @@ -29,24 +29,115 @@ enum PriestSpells { - SPELL_PRIEST_EMPOWERED_RENEW = 63544, - SPELL_PRIEST_GLYPHE_OF_LIGHTWELL = 55673, - SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL = 48153, - SPELL_PRIEST_PENANCE_R1 = 47540, - SPELL_PRIEST_PENANCE_R1_DAMAGE = 47758, - SPELL_PRIEST_PENANCE_R1_HEAL = 47757, - SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED = 33619, - SPELL_PRIEST_REFLECTIVE_SHIELD_R1 = 33201, - SPELL_PRIEST_SHADOW_WORD_DEATH = 32409, - SPELL_PRIEST_T9_HEALING_2P = 67201, - SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL = 64085, + SPELL_PRIEST_DIVINE_AEGIS = 47753, + SPELL_PRIEST_EMPOWERED_RENEW = 63544, + SPELL_PRIEST_GLYPHE_OF_LIGHTWELL = 55673, + SPELL_PRIEST_GLYPHE_OF_PRAYER_OF_HEALING_HEAL = 56161, + SPELL_PRIEST_GUARDIAN_SPIRIT_HEAL = 48153, + SPELL_PRIEST_MANA_LEECH_PROC = 34650, + SPELL_PRIEST_PENANCE_R1 = 47540, + SPELL_PRIEST_PENANCE_R1_DAMAGE = 47758, + SPELL_PRIEST_PENANCE_R1_HEAL = 47757, + SPELL_PRIEST_REFLECTIVE_SHIELD_TRIGGERED = 33619, + SPELL_PRIEST_REFLECTIVE_SHIELD_R1 = 33201, + SPELL_PRIEST_SHADOW_WORD_DEATH = 32409, + SPELL_PRIEST_T9_HEALING_2P = 67201, + SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL = 64085, }; enum PriestSpellIcons { - PRIEST_ICON_ID_BORROWED_TIME = 2899, - PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, - PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, + PRIEST_ICON_ID_BORROWED_TIME = 2899, + PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT = 3021, + PRIEST_ICON_ID_PAIN_AND_SUFFERING = 2874, +}; + +// -47509 - Divine Aegis +class spell_pri_divine_aegis : public SpellScriptLoader +{ + public: + spell_pri_divine_aegis() : SpellScriptLoader("spell_pri_divine_aegis") { } + + class spell_pri_divine_aegis_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_divine_aegis_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_DIVINE_AEGIS)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetProcTarget(); + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 absorb = CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()); + + // Multiple effects stack, so let's try to find this aura. + if (AuraEffect const* aegis = eventInfo.GetProcTarget()->GetAuraEffect(SPELL_PRIEST_DIVINE_AEGIS, EFFECT_0)) + absorb += aegis->GetAmount(); + + absorb = std::min(absorb, eventInfo.GetProcTarget()->getLevel() * 125); + + GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_pri_divine_aegis_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pri_divine_aegis_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_divine_aegis_AuraScript(); + } +}; + +// 55680 - Glyph of Prayer of Healing +class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader +{ + public: + spell_pri_glyph_of_prayer_of_healing() : SpellScriptLoader("spell_pri_glyph_of_prayer_of_healing") { } + + class spell_pri_glyph_of_prayer_of_healing_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_glyph_of_prayer_of_healing_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPHE_OF_PRAYER_OF_HEALING_HEAL)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(SPELL_PRIEST_GLYPHE_OF_PRAYER_OF_HEALING_HEAL); + int32 heal = int32(CalculatePct(int32(eventInfo.GetHealInfo()->GetHeal()), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks()); + GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPHE_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_pri_glyph_of_prayer_of_healing_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_glyph_of_prayer_of_healing_AuraScript(); + } }; // -47788 - Guardian Spirit @@ -166,6 +257,57 @@ class spell_pri_mana_burn : public SpellScriptLoader } }; +// 28305 - Mana Leech (Passive) (Priest Pet Aura) +class spell_pri_mana_leech : public SpellScriptLoader +{ + public: + spell_pri_mana_leech() : SpellScriptLoader("spell_pri_mana_leech") { } + + class spell_pri_mana_leech_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pri_mana_leech_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_PRIEST_MANA_LEECH_PROC)) + return false; + return true; + } + + bool Load() + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _procTarget = GetTarget()->GetOwner(); + return _procTarget; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(_procTarget, SPELL_PRIEST_MANA_LEECH_PROC, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_pri_mana_leech_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_pri_mana_leech_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_pri_mana_leech_AuraScript(); + } +}; + // -49821 - Mind Sear class spell_pri_mind_sear : public SpellScriptLoader { @@ -524,9 +666,12 @@ class spell_pri_vampiric_touch : public SpellScriptLoader void AddSC_priest_spell_scripts() { + new spell_pri_divine_aegis(); + new spell_pri_glyph_of_prayer_of_healing(); new spell_pri_guardian_spirit(); new spell_pri_lightwell_renew(); new spell_pri_mana_burn(); + new spell_pri_mana_leech(); new spell_pri_mind_sear(); new spell_pri_pain_and_suffering_proc(); new spell_pri_penance(); diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index 156158b4e36..f6391c80d63 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -28,10 +28,68 @@ enum RogueSpells { + SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK = 22482, SPELL_ROGUE_CHEAT_DEATH_COOLDOWN = 31231, SPELL_ROGUE_GLYPH_OF_PREPARATION = 56819, SPELL_ROGUE_PREY_ON_THE_WEAK = 58670, SPELL_ROGUE_SHIV_TRIGGERED = 5940, + SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST = 57933, + SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC = 59628, +}; + +// 13877, 33735, (check 51211, 65956) - Blade Flurry +class spell_rog_blade_flurry : public SpellScriptLoader +{ + public: + spell_rog_blade_flurry() : SpellScriptLoader("spell_rog_blade_flurry") { } + + class spell_rog_blade_flurry_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_blade_flurry_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK)) + return false; + return true; + } + + bool Load() + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + _procTarget = eventInfo.GetActor()->SelectNearbyTarget(eventInfo.GetProcTarget()); + return _procTarget; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + if (eventInfo.GetDamageInfo()) + { + int32 damage = eventInfo.GetDamageInfo()->GetDamage(); + GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, NULL, aurEff); + } + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_rog_blade_flurry_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_rog_blade_flurry_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_MELEE_HASTE); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_rog_blade_flurry_AuraScript(); + } }; // -31228 - Cheat Death @@ -440,8 +498,100 @@ class spell_rog_shiv : public SpellScriptLoader } }; +// 57934 - Tricks of the Trade +class spell_rog_tricks_of_the_trade : public SpellScriptLoader +{ + public: + spell_rog_tricks_of_the_trade() : SpellScriptLoader("spell_rog_tricks_of_the_trade") { } + + class spell_rog_tricks_of_the_trade_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_tricks_of_the_trade_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC)) + return false; + return true; + } + + bool Load() + { + _redirectTarget = NULL; + return true; + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT) + GetTarget()->ResetRedirectThreat(); + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _redirectTarget = GetTarget()->GetRedirectThreatTarget(); + return _redirectTarget; + } + + void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + + Unit* target = GetTarget(); + target->CastSpell(_redirectTarget, SPELL_ROGUE_TRICKS_OF_THE_TRADE_DMG_BOOST, true); + target->CastSpell(target, SPELL_ROGUE_TRICKS_OF_THE_TRADE_PROC, true); + Remove(AURA_REMOVE_BY_DEFAULT); // maybe handle by proc charges + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_rog_tricks_of_the_trade_AuraScript::OnRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + DoCheckProc += AuraCheckProcFn(spell_rog_tricks_of_the_trade_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_rog_tricks_of_the_trade_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); + } + + private: + Unit* _redirectTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_rog_tricks_of_the_trade_AuraScript(); + } +}; + +// 59628 - Tricks of the Trade (Proc) +class spell_rog_tricks_of_the_trade_proc : public SpellScriptLoader +{ + public: + spell_rog_tricks_of_the_trade_proc() : SpellScriptLoader("spell_rog_tricks_of_the_trade_proc") { } + + class spell_rog_tricks_of_the_trade_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_rog_tricks_of_the_trade_proc_AuraScript); + + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->ResetRedirectThreat(); + } + + void Register() + { + AfterEffectRemove += AuraEffectRemoveFn(spell_rog_tricks_of_the_trade_proc_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_rog_tricks_of_the_trade_proc_AuraScript(); + } +}; + void AddSC_rogue_spell_scripts() { + new spell_rog_blade_flurry(); new spell_rog_cheat_death(); new spell_rog_deadly_poison(); new spell_rog_nerves_of_steel(); @@ -449,4 +599,6 @@ void AddSC_rogue_spell_scripts() new spell_rog_prey_on_the_weak(); new spell_rog_rupture(); new spell_rog_shiv(); + new spell_rog_tricks_of_the_trade(); + new spell_rog_tricks_of_the_trade_proc(); } diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp index 2994761be6f..b69295150c2 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -33,9 +33,11 @@ enum ShamanSpells SPELL_SHAMAN_ANCESTRAL_AWAKENING_PROC = 52752, SPELL_SHAMAN_BIND_SIGHT = 6277, SPELL_SHAMAN_CLEANSING_TOTEM_EFFECT = 52025, + SPELL_SHAMAN_EARTH_SHIELD_HEAL = 379, SPELL_SHAMAN_EXHAUSTION = 57723, SPELL_SHAMAN_FIRE_NOVA_R1 = 1535, SPELL_SHAMAN_FIRE_NOVA_TRIGGERED_R1 = 8349, + SPELL_SHAMAN_GLYPH_OF_EARTH_SHIELD = 63279, SPELL_SHAMAN_GLYPH_OF_HEALING_STREAM_TOTEM = 55456, SPELL_SHAMAN_GLYPH_OF_MANA_TIDE = 55441, SPELL_SHAMAN_GLYPH_OF_THUNDERSTORM = 62132, @@ -266,6 +268,68 @@ class spell_sha_cleansing_totem_pulse : public SpellScriptLoader } }; +// -974 - Earth Shield +class spell_sha_earth_shield : public SpellScriptLoader +{ + public: + spell_sha_earth_shield() : SpellScriptLoader("spell_sha_earth_shield") { } + + class spell_sha_earth_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_earth_shield_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_EARTH_SHIELD_HEAL)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_GLYPH_OF_EARTH_SHIELD)) + return false; + return true; + } + + void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool & /*canBeRecalculated*/) + { + if (Unit* caster = GetCaster()) + { + amount = caster->SpellHealingBonusDone(GetUnitOwner(), GetSpellInfo(), amount, HEAL); + amount = GetUnitOwner()->SpellHealingBonusTaken(caster, GetSpellInfo(), amount, HEAL); + + // Glyph of Earth Shield + //! WORKAROUND + //! this glyphe is a proc + if (AuraEffect* glyphe = caster->GetAuraEffect(SPELL_SHAMAN_GLYPH_OF_EARTH_SHIELD, EFFECT_0)) + AddPct(amount, glyphe->GetAmount()); + } + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + + //! HACK due to currenct proc system implementation + if (Player* player = GetTarget()->ToPlayer()) + if (player->HasSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL)) + return; + + GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID()); + + if (Player* player = GetTarget()->ToPlayer()) + player->AddSpellCooldown(SPELL_SHAMAN_EARTH_SHIELD_HEAL, 0, time(NULL) + 3); + } + + void Register() + { + DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_sha_earth_shield_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_sha_earth_shield_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_sha_earth_shield_AuraScript(); + } +}; + // 6474 - Earthbind Totem - Fix Talent: Earthen Power class spell_sha_earthbind_totem : public SpellScriptLoader { @@ -780,6 +844,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_bloodlust(); new spell_sha_chain_heal(); new spell_sha_cleansing_totem_pulse(); + new spell_sha_earth_shield(); new spell_sha_earthbind_totem(); new spell_sha_earthen_power(); new spell_sha_fire_nova(); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 68ad1315dce..78bfcbab6a0 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -37,6 +37,8 @@ enum WarlockSpells SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELGUARD = 54508, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_FELHUNTER = 54509, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, + SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181, + SPELL_WARLOCK_GLYPHE_OF_SIPHON_LIFE = 63106, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_R1 = 18703, @@ -48,6 +50,7 @@ enum WarlockSpells SPELL_WARLOCK_LIFE_TAP_ENERGIZE = 31818, SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, SPELL_WARLOCK_SOULSHATTER = 32835, + SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117 }; @@ -418,6 +421,49 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; +// -47230 - Fel Synergy +class spell_warl_fel_synergy : public SpellScriptLoader +{ + public: + spell_warl_fel_synergy() : SpellScriptLoader("spell_warl_fel_synergy") { } + + class spell_warl_fel_synergy_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_fel_synergy_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_FEL_SYNERGY_HEAL)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return GetTarget()->GetGuardianPet() && eventInfo.GetDamageInfo()->GetDamage(); + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff); // TARGET_UNIT_PET + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_warl_fel_synergy_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_warl_fel_synergy_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_fel_synergy_AuraScript(); + } +}; + // -48181 - Haunt class spell_warl_haunt : public SpellScriptLoader { @@ -686,6 +732,55 @@ class spell_warl_shadow_ward : public SpellScriptLoader } }; +// 63108 - Siphon Life +class spell_warl_siphon_life : public SpellScriptLoader +{ + public: + spell_warl_siphon_life() : SpellScriptLoader("spell_warl_siphon_life") { } + + class spell_warl_siphon_life_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_siphon_life_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_SIPHON_LIFE_HEAL)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_GLYPHE_OF_SIPHON_LIFE)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + return eventInfo.GetDamageInfo()->GetDamage(); + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount())); + // Glyph of Siphon Life + if (AuraEffect const* glyphe = GetTarget()->GetAuraEffect(SPELL_WARLOCK_GLYPHE_OF_SIPHON_LIFE, EFFECT_0)) + AddPct(amount, glyphe->GetAmount()); + + GetTarget()->CastCustomSpell(SPELL_WARLOCK_SIPHON_LIFE_HEAL, SPELLVALUE_BASE_POINT0, amount, GetTarget(), true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_warl_siphon_life_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_warl_siphon_life_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warl_siphon_life_AuraScript(); + } +}; + // 29858 - Soulshatter class spell_warl_soulshatter : public SpellScriptLoader { @@ -774,12 +869,14 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_circle_teleport(); new spell_warl_demonic_empowerment(); new spell_warl_everlasting_affliction(); + new spell_warl_fel_synergy(); new spell_warl_haunt(); new spell_warl_health_funnel(); new spell_warl_life_tap(); new spell_warl_ritual_of_doom_effect(); new spell_warl_seed_of_corruption(); new spell_warl_shadow_ward(); + new spell_warl_siphon_life(); new spell_warl_soulshatter(); new spell_warl_unstable_affliction(); } diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 822d4b17992..7136f046873 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -31,21 +31,26 @@ enum WarriorSpells SPELL_WARRIOR_BLOODTHIRST = 23885, SPELL_WARRIOR_BLOODTHIRST_DAMAGE = 23881, SPELL_WARRIOR_CHARGE = 34846, + SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE = 59653, SPELL_WARRIOR_DEEP_WOUNDS_RANK_1 = 12162, SPELL_WARRIOR_DEEP_WOUNDS_RANK_2 = 12850, SPELL_WARRIOR_DEEP_WOUNDS_RANK_3 = 12868, SPELL_WARRIOR_DEEP_WOUNDS_RANK_PERIODIC = 12721, SPELL_WARRIOR_EXECUTE = 20647, SPELL_WARRIOR_GLYPH_OF_EXECUTION = 58367, + SPELL_WARRIOR_GLYPH_OF_VIGILANCE = 63326, SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_BUFF = 65156, SPELL_WARRIOR_JUGGERNAUT_CRIT_BONUS_TALENT = 64976, SPELL_WARRIOR_LAST_STAND_TRIGGERED = 12976, SPELL_WARRIOR_SLAM = 50783, + SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK = 26654, SPELL_WARRIOR_TAUNT = 355, SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_1 = 46859, SPELL_WARRIOR_UNRELENTING_ASSAULT_RANK_2 = 46860, SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_1 = 64849, SPELL_WARRIOR_UNRELENTING_ASSAULT_TRIGGER_2 = 64850, + SPELL_WARRIOR_VIGILANCE_PROC = 50725, + SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT = 59665, SPELL_PALADIN_BLESSING_OF_SANCTUARY = 20911, SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY = 25899, @@ -195,6 +200,44 @@ class spell_warr_concussion_blow : public SpellScriptLoader } }; +// -58872 - Damage Shield +class spell_warr_damage_shield : public SpellScriptLoader +{ + public: + spell_warr_damage_shield() : SpellScriptLoader("spell_warr_damage_shield") { } + + class spell_warr_damage_shield_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_damage_shield_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE)) + return false; + return true; + } + + void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + // % of amount blocked + int32 damage = CalculatePct(int32(GetTarget()->GetShieldBlockValue()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_WARRIOR_DAMAGE_SHIELD_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff); + } + + void Register() + { + OnEffectProc += AuraEffectProcFn(spell_warr_damage_shield_AuraScript::OnProc, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_warr_damage_shield_AuraScript(); + } +}; + // -12162 - Deep Wounds class spell_warr_deep_wounds : public SpellScriptLoader { @@ -551,6 +594,57 @@ class spell_warr_slam : public SpellScriptLoader } }; +// 12328, 18765, 35429 - Sweeping Strikes +class spell_warr_sweeping_strikes : public SpellScriptLoader +{ + public: + spell_warr_sweeping_strikes() : SpellScriptLoader("spell_warr_sweeping_strikes") { } + + class spell_warr_sweeping_strikes_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_sweeping_strikes_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK)) + return false; + return true; + } + + bool Load() + { + _procTarget = NULL; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + _procTarget = eventInfo.GetActor()->SelectNearbyTarget(eventInfo.GetProcTarget()); + return _procTarget; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK, true, NULL, aurEff); + } + + void Register() + { + DoCheckProc += AuraCheckProcFn(spell_warr_sweeping_strikes_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_warr_sweeping_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); + } + + private: + Unit* _procTarget; + }; + + AuraScript* GetAuraScript() const + { + return new spell_warr_sweeping_strikes_AuraScript(); + } +}; + // 50720 - Vigilance class spell_warr_vigilance : public SpellScriptLoader { @@ -563,34 +657,80 @@ class spell_warr_vigilance : public SpellScriptLoader bool Validate(SpellInfo const* /*spellInfo*/) { + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_GLYPH_OF_VIGILANCE)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_VIGILANCE_PROC)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT)) + return false; if (!sSpellMgr->GetSpellInfo(SPELL_GEN_DAMAGE_REDUCTION_AURA)) return false; return true; } - void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + bool Load() { - if (Unit* target = GetTarget()) - target->CastSpell(target, SPELL_GEN_DAMAGE_REDUCTION_AURA, true); + _procTarget = NULL; + return true; + } + + void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_GEN_DAMAGE_REDUCTION_AURA, true); + + if (Unit* caster = GetCaster()) + target->CastSpell(caster, SPELL_WARRIOR_VIGILANCE_REDIRECT_THREAT, true); } - void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + void HandleAfterApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) { - if (Unit* target = GetTarget()) + //! WORKAROUND + //! this glyph is a proc + if (Unit* caster = GetCaster()) { - if (target->HasAura(SPELL_GEN_DAMAGE_REDUCTION_AURA) && !(target->HasAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY) || - target->HasAura(SPELL_PRIEST_RENEWED_HOPE))) - target->RemoveAurasDueToSpell(SPELL_GEN_DAMAGE_REDUCTION_AURA); + if (AuraEffect const* glyph = caster->GetAuraEffect(SPELL_WARRIOR_GLYPH_OF_VIGILANCE, EFFECT_0)) + GetTarget()->ModifyRedirectThreat(glyph->GetAmount()); } } + void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->HasAura(SPELL_GEN_DAMAGE_REDUCTION_AURA) && + !(target->HasAura(SPELL_PALADIN_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_PALADIN_GREATER_BLESSING_OF_SANCTUARY) || + target->HasAura(SPELL_PRIEST_RENEWED_HOPE))) + { + target->RemoveAurasDueToSpell(SPELL_GEN_DAMAGE_REDUCTION_AURA); + } + + target->ResetRedirectThreat(); + } + + bool CheckProc(ProcEventInfo& /*eventInfo*/) + { + _procTarget = GetCaster(); + return _procTarget; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) + { + PreventDefaultAction(); + GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_VIGILANCE_PROC, true, NULL, aurEff); + } + void Register() { - OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::OnApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); - OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + AfterEffectApply += AuraEffectApplyFn(spell_warr_vigilance_AuraScript::HandleAfterApply, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + OnEffectRemove += AuraEffectRemoveFn(spell_warr_vigilance_AuraScript::HandleRemove, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL_OR_REAPPLY_MASK); + DoCheckProc += AuraCheckProcFn(spell_warr_vigilance_AuraScript::CheckProc); + OnEffectProc += AuraEffectProcFn(spell_warr_vigilance_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } + private: + Unit* _procTarget; }; AuraScript* GetAuraScript() const @@ -636,6 +776,7 @@ void AddSC_warrior_spell_scripts() new spell_warr_bloodthirst_heal(); new spell_warr_charge(); new spell_warr_concussion_blow(); + new spell_warr_damage_shield(); new spell_warr_deep_wounds(); new spell_warr_execute(); new spell_warr_improved_spell_reflection(); @@ -645,6 +786,7 @@ void AddSC_warrior_spell_scripts() new spell_warr_rend(); new spell_warr_shattering_throw(); new spell_warr_slam(); + new spell_warr_sweeping_strikes(); new spell_warr_vigilance(); new spell_warr_vigilance_trigger(); } -- cgit v1.2.3 From 5e367c910a0bdcad9dbb4881c9bb00be05181292 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Wed, 23 Jan 2013 13:21:31 +0200 Subject: DB/Misc: Add back flight aura on Wyrmrest Defender.(probably deleted on last template_addon cleanup) Correct a SAI line for Nerub'ar Broodkeeper. --- sql/updates/world/2013_01_23_00_world_misc.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2013_01_23_00_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_23_00_world_misc.sql b/sql/updates/world/2013_01_23_00_world_misc.sql new file mode 100644 index 00000000000..fb55d90f69b --- /dev/null +++ b/sql/updates/world/2013_01_23_00_world_misc.sql @@ -0,0 +1,5 @@ +-- readd flight aura on Wyrmrest Defender npcs +UPDATE `creature_template_addon` SET `auras`='50069' WHERE `entry`=27629; + +-- correct SAI on Nerub'ar Broodkeeper +UPDATE `smart_scripts` SET `event_param1`=0 WHERE `entryorguid`=36725 AND `source_type`=0 AND `id`=1; -- cgit v1.2.3 From 70490c8238d21ff56be48d6b8444344451f8f255 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Wed, 23 Jan 2013 20:58:01 +0200 Subject: Script/Commands: Add command to join an existing group/party. --- sql/updates/world/2013_01_23_01_world_misc.sql | 10 +++++ src/server/game/Miscellaneous/Language.h | 4 ++ src/server/scripts/Commands/cs_misc.cpp | 56 ++++++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 sql/updates/world/2013_01_23_01_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_23_01_world_misc.sql b/sql/updates/world/2013_01_23_01_world_misc.sql new file mode 100644 index 00000000000..25042e241dd --- /dev/null +++ b/sql/updates/world/2013_01_23_01_world_misc.sql @@ -0,0 +1,10 @@ +DELETE FROM `trinity_string` WHERE `entry` BETWEEN 1145 AND 1148; +INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES +(1145,'%s is already in a group!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1146,'%s joined %s''s group.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1147,'%s is not in a group!',NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1148,'Group is full!',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + +DELETE FROM `command` WHERE `name`='group join'; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('group join',3,'Syntax: .group join $AnyCharacterNameFromGroup [$CharacterName] \r\nAdds to group of player $AnyCharacterNameFromGroup player $CharacterName (or selected).'); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 039e8b816b3..093622467f8 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -847,6 +847,10 @@ enum TrinityStrings LANG_MOVEGENS_EFFECT = 1142, LANG_MOVEFLAGS_GET = 1143, LANG_MOVEFLAGS_SET = 1144, + LANG_GROUP_ALREADY_IN_GROUP = 1145, + LANG_GROUP_PLAYER_JOINED = 1146, + LANG_GROUP_NOT_IN_GROUP = 1147, + LANG_GROUP_FULL = 1148, // Room for more level 3 1144-1199 not used // Debug commands diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 54fe41a8a4d..e2b5ac9487d 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -46,6 +46,7 @@ public: { "leader", SEC_ADMINISTRATOR, false, &HandleGroupLeaderCommand, "", NULL }, { "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL }, + { "join", SEC_ADMINISTRATOR, false, &HandleGroupJoinCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand petCommandTable[] = @@ -2725,6 +2726,61 @@ public: return true; } + static bool HandleGroupJoinCommand(ChatHandler* handler, char const* args) + { + if (!*args) + return false; + + Player* playerSource = NULL; + Player* playerTarget = NULL; + Group* groupSource = NULL; + Group* groupTarget = NULL; + uint64 guidSource = 0; + uint64 guidTarget = 0; + char* nameplgrStr = strtok((char*)args, " "); + char* nameplStr = strtok(NULL, " "); + + if (handler->GetPlayerGroupAndGUIDByName(nameplgrStr, playerSource, groupSource, guidSource, true)) + { + if (groupSource) + { + if (handler->GetPlayerGroupAndGUIDByName(nameplStr, playerTarget, groupTarget, guidTarget, true)) + { + if (!groupTarget && playerTarget->GetGroup() != groupSource) + { + if (!groupSource->IsFull()) + { + groupSource->AddMember(playerTarget); + groupSource->BroadcastGroupUpdate(); + handler->PSendSysMessage(LANG_GROUP_PLAYER_JOINED, playerTarget->GetName().c_str(), playerSource->GetName().c_str()); + return true; + } + else + { + // group is full + handler->PSendSysMessage(LANG_GROUP_FULL); + return true; + } + } + else + { + // group is full or target player already in a group + handler->PSendSysMessage(LANG_GROUP_ALREADY_IN_GROUP, playerTarget->GetName().c_str()); + return true; + } + } + } + else + { + // specified source player is not in a group + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, playerSource->GetName().c_str()); + return true; + } + } + + return true; + } + static bool HandlePlayAllCommand(ChatHandler* handler, char const* args) { if (!*args) -- cgit v1.2.3 From f4de181db00bf323793e2121aac496588c3b9b33 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Wed, 23 Jan 2013 20:29:40 +0100 Subject: SQL: Rename SQL merged in PR --- dep/SFMT/SFMT.h | 2 +- dep/SFMT/randomc.h | 2 +- .../2013_01_23_00_world_spell_script_names.sql | 77 ---------------------- .../2013_01_23_02_world_spell_script_names.sql | 77 ++++++++++++++++++++++ src/tools/mesh_extractor/Chunk.cpp | 2 +- src/tools/mesh_extractor/ContinentBuilder.cpp | 2 +- src/tools/mesh_extractor/DoodadHandler.h | 2 +- src/tools/mesh_extractor/Utils.cpp | 12 ++-- 8 files changed, 88 insertions(+), 88 deletions(-) delete mode 100644 sql/updates/world/2013_01_23_00_world_spell_script_names.sql create mode 100644 sql/updates/world/2013_01_23_02_world_spell_script_names.sql (limited to 'sql') diff --git a/dep/SFMT/SFMT.h b/dep/SFMT/SFMT.h index 08966e1831c..4004ae1db6e 100644 --- a/dep/SFMT/SFMT.h +++ b/dep/SFMT/SFMT.h @@ -7,7 +7,7 @@ * in effect in addition to the GNU General Public License. * Copyright (c) 2006, 2007 by Mutsuo Saito, Makoto Matsumoto and Hiroshima University. * Copyright (c) 2008 by Agner Fog. - * Copyright (c) 2012 Trinity Core + * Copyright (c) 2008-2013 Trinity Core * * BSD License: * Redistribution and use in source and binary forms, with or without diff --git a/dep/SFMT/randomc.h b/dep/SFMT/randomc.h index ee5ad9aa43b..eed2c81a205 100644 --- a/dep/SFMT/randomc.h +++ b/dep/SFMT/randomc.h @@ -7,7 +7,7 @@ * in effect in addition to the GNU General Public License. * Copyright (c) 2006, 2007 by Mutsuo Saito, Makoto Matsumoto and Hiroshima University. * Copyright (c) 2008 by Agner Fog. - * Copyright (c) 2012 Trinity Core + * Copyright (c) 2008-2013 Trinity Core * * BSD License: * Redistribution and use in source and binary forms, with or without diff --git a/sql/updates/world/2013_01_23_00_world_spell_script_names.sql b/sql/updates/world/2013_01_23_00_world_spell_script_names.sql deleted file mode 100644 index dd8b35ae420..00000000000 --- a/sql/updates/world/2013_01_23_00_world_spell_script_names.sql +++ /dev/null @@ -1,77 +0,0 @@ -DELETE FROM `spell_script_names` WHERE `spell_id` IN ( -70871, -- spell_blood_queen_essence_of_the_blood_queen -69383, -- spell_the_lich_king_dark_hunger -50453, -- spell_dk_blood_gorged --48496, -- spell_dru_living_seed -48504, -- spell_dru_living_seed_proc -28764, -- spell_gen_adaptive_warding -27539, -- spell_gen_obsidian_armor -34074, -- spell_hun_ascpect_of_the_viper -64411, -- spell_item_blessing_of_ancient_kings -71875, -- spell_item_necrotic_touch -71877, -- spell_item_necrotic_touch -71169, -- spell_item_shadows_fate -71903, -- spell_item_shadowmourne -71905, -- spell_item_shadowmourne_soul_fragment --44449, -- spell_mage_burnout -54646, -- spell_mage_focus_magic --11119, -- spell_mage_ignite --29074, -- spell_mage_master_of_elements --9799, -- spell_pal_eye_for_an_eye -20154, -- spell_pal_seal_of_righteousness -21084 -- spell_pal_seal_of_righteousness --47509, -- spell_pri_divine_aegis -55680, -- spell_pri_glyph_of_prayer_of_healing -28305, -- spell_pri_mana_leech -13877, -- spell_rog_blade_flurry -33735, -- spell_rog_blade_flurry -51211, -- spell_rog_blade_flurry -65956, -- spell_rog_blade_flurry -57934, -- spell_rog_tricks_of_the_trade -59628, -- spell_rog_tricks_of_the_trade_proc --974, -- spell_sha_earth_shield --47230, -- spell_warl_fel_synergy -63108, -- spell_warl_siphon_life --58872, -- spell_warr_damage_shield -12328, -- spell_warr_sweeping_strikes -18765, -- spell_warr_sweeping_strikes -35429 -- spell_warr_sweeping_strikes -); -INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES -(70871, 'spell_blood_queen_essence_of_the_blood_queen'), -(69383, 'spell_the_lich_king_dark_hunger'), -(50453, 'spell_dk_blood_gorged'), -(-48496, 'spell_dru_living_seed'), -(48504, 'spell_dru_living_seed_proc'), -(28764, 'spell_gen_adaptive_warding'), -(27539, 'spell_gen_obsidian_armor'), -(34074, 'spell_hun_ascpect_of_the_viper'), -(64411, 'spell_item_blessing_of_ancient_kings'), -(71875, 'spell_item_necrotic_touch'), -(71877, 'spell_item_necrotic_touch'), -(71169, 'spell_item_shadows_fate'), -(71903, 'spell_item_shadowmourne'), -(71905, 'spell_item_shadowmourne_soul_fragment'), -(-44449, 'spell_mage_burnout'), -(54646, 'spell_mage_focus_magic'), -(-11119, 'spell_mage_ignite'), -(-29074, 'spell_mage_master_of_elements'), -(-9799, 'spell_pal_eye_for_an_eye'), -(20154, 'spell_pal_seal_of_righteousness'), -(21084, 'spell_pal_seal_of_righteousness'), -(-47509, 'spell_pri_divine_aegis'), -(55680, 'spell_pri_glyph_of_prayer_of_healing'), -(28305, 'spell_pri_mana_leech'), -(13877, 'spell_rog_blade_flurry'), -(33735, 'spell_rog_blade_flurry'), -(51211, 'spell_rog_blade_flurry'), -(65956, 'spell_rog_blade_flurry'), -(57934, 'spell_rog_tricks_of_the_trade'), -(59628, 'spell_rog_tricks_of_the_trade_proc'), -(-974, 'spell_sha_earth_shield'), -(-47230, 'spell_warl_fel_synergy'), -(63108, 'spell_warl_siphon_life'), -(-58872, 'spell_warr_damage_shield'), -(12328, 'spell_warr_sweeping_strikes'), -(18765, 'spell_warr_sweeping_strikes'), -(35429, 'spell_warr_sweeping_strikes'); diff --git a/sql/updates/world/2013_01_23_02_world_spell_script_names.sql b/sql/updates/world/2013_01_23_02_world_spell_script_names.sql new file mode 100644 index 00000000000..dd8b35ae420 --- /dev/null +++ b/sql/updates/world/2013_01_23_02_world_spell_script_names.sql @@ -0,0 +1,77 @@ +DELETE FROM `spell_script_names` WHERE `spell_id` IN ( +70871, -- spell_blood_queen_essence_of_the_blood_queen +69383, -- spell_the_lich_king_dark_hunger +50453, -- spell_dk_blood_gorged +-48496, -- spell_dru_living_seed +48504, -- spell_dru_living_seed_proc +28764, -- spell_gen_adaptive_warding +27539, -- spell_gen_obsidian_armor +34074, -- spell_hun_ascpect_of_the_viper +64411, -- spell_item_blessing_of_ancient_kings +71875, -- spell_item_necrotic_touch +71877, -- spell_item_necrotic_touch +71169, -- spell_item_shadows_fate +71903, -- spell_item_shadowmourne +71905, -- spell_item_shadowmourne_soul_fragment +-44449, -- spell_mage_burnout +54646, -- spell_mage_focus_magic +-11119, -- spell_mage_ignite +-29074, -- spell_mage_master_of_elements +-9799, -- spell_pal_eye_for_an_eye +20154, -- spell_pal_seal_of_righteousness +21084 -- spell_pal_seal_of_righteousness +-47509, -- spell_pri_divine_aegis +55680, -- spell_pri_glyph_of_prayer_of_healing +28305, -- spell_pri_mana_leech +13877, -- spell_rog_blade_flurry +33735, -- spell_rog_blade_flurry +51211, -- spell_rog_blade_flurry +65956, -- spell_rog_blade_flurry +57934, -- spell_rog_tricks_of_the_trade +59628, -- spell_rog_tricks_of_the_trade_proc +-974, -- spell_sha_earth_shield +-47230, -- spell_warl_fel_synergy +63108, -- spell_warl_siphon_life +-58872, -- spell_warr_damage_shield +12328, -- spell_warr_sweeping_strikes +18765, -- spell_warr_sweeping_strikes +35429 -- spell_warr_sweeping_strikes +); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(70871, 'spell_blood_queen_essence_of_the_blood_queen'), +(69383, 'spell_the_lich_king_dark_hunger'), +(50453, 'spell_dk_blood_gorged'), +(-48496, 'spell_dru_living_seed'), +(48504, 'spell_dru_living_seed_proc'), +(28764, 'spell_gen_adaptive_warding'), +(27539, 'spell_gen_obsidian_armor'), +(34074, 'spell_hun_ascpect_of_the_viper'), +(64411, 'spell_item_blessing_of_ancient_kings'), +(71875, 'spell_item_necrotic_touch'), +(71877, 'spell_item_necrotic_touch'), +(71169, 'spell_item_shadows_fate'), +(71903, 'spell_item_shadowmourne'), +(71905, 'spell_item_shadowmourne_soul_fragment'), +(-44449, 'spell_mage_burnout'), +(54646, 'spell_mage_focus_magic'), +(-11119, 'spell_mage_ignite'), +(-29074, 'spell_mage_master_of_elements'), +(-9799, 'spell_pal_eye_for_an_eye'), +(20154, 'spell_pal_seal_of_righteousness'), +(21084, 'spell_pal_seal_of_righteousness'), +(-47509, 'spell_pri_divine_aegis'), +(55680, 'spell_pri_glyph_of_prayer_of_healing'), +(28305, 'spell_pri_mana_leech'), +(13877, 'spell_rog_blade_flurry'), +(33735, 'spell_rog_blade_flurry'), +(51211, 'spell_rog_blade_flurry'), +(65956, 'spell_rog_blade_flurry'), +(57934, 'spell_rog_tricks_of_the_trade'), +(59628, 'spell_rog_tricks_of_the_trade_proc'), +(-974, 'spell_sha_earth_shield'), +(-47230, 'spell_warl_fel_synergy'), +(63108, 'spell_warl_siphon_life'), +(-58872, 'spell_warr_damage_shield'), +(12328, 'spell_warr_sweeping_strikes'), +(18765, 'spell_warr_sweeping_strikes'), +(35429, 'spell_warr_sweeping_strikes'); diff --git a/src/tools/mesh_extractor/Chunk.cpp b/src/tools/mesh_extractor/Chunk.cpp index 9f2898a46e0..4605ae0f0dd 100644 --- a/src/tools/mesh_extractor/Chunk.cpp +++ b/src/tools/mesh_extractor/Chunk.cpp @@ -17,7 +17,7 @@ int32 Chunk::FindSubChunkOffset(std::string name) matched = 0; else ++matched; - + if (matched == 4) return ftell(stream) - 4; } diff --git a/src/tools/mesh_extractor/ContinentBuilder.cpp b/src/tools/mesh_extractor/ContinentBuilder.cpp index 9b5c9f9c77b..d6125bdd8e2 100644 --- a/src/tools/mesh_extractor/ContinentBuilder.cpp +++ b/src/tools/mesh_extractor/ContinentBuilder.cpp @@ -101,7 +101,7 @@ void ContinentBuilder::Build(bool debug) } CalculateTileBounds(); - + dtNavMeshParams params; params.maxPolys = 1 << STATIC_POLY_BITS; params.maxTiles = TileMap->TileTable.size(); diff --git a/src/tools/mesh_extractor/DoodadHandler.h b/src/tools/mesh_extractor/DoodadHandler.h index 981834ec7ac..96aecbcce27 100644 --- a/src/tools/mesh_extractor/DoodadHandler.h +++ b/src/tools/mesh_extractor/DoodadHandler.h @@ -20,7 +20,7 @@ public: void Read(FILE* stream) { int count = 0; - + count += fread(&MmidIndex, sizeof(uint32), 1, stream); count += fread(&UniqueId, sizeof(uint32), 1, stream); Position = Vector3::Read(stream); diff --git a/src/tools/mesh_extractor/Utils.cpp b/src/tools/mesh_extractor/Utils.cpp index 119ac94f94f..acb1ed38e27 100644 --- a/src/tools/mesh_extractor/Utils.cpp +++ b/src/tools/mesh_extractor/Utils.cpp @@ -218,7 +218,7 @@ void Utils::SaveToDisk( FILE* stream, std::string path ) if (fread(data, 1, size, stream) != 1) { printf("SaveToDisk: Error reading from Stream while trying to save file %s to disck.\n", path.c_str()); - return; + return; } // And write it in the file fwrite(data, 1, size, disk); @@ -274,7 +274,7 @@ void MapChunkHeader::Read(FILE* stream) count += fread(&SizeMCLQ, sizeof(uint32), 1, stream); Position = Vector3::Read(stream); count += fread(&OffsetMCCV, sizeof(uint32), 1, stream); - + if (count != 27) printf("MapChunkHeader::Read: Failed to read some data expected 27, read %d\n", count); } @@ -295,7 +295,7 @@ void MHDR::Read(FILE* stream) count += fread(&OffsetMFBO, sizeof(uint32), 1, stream); count += fread(&OffsetMH2O, sizeof(uint32), 1, stream); count += fread(&OffsetMTFX, sizeof(uint32), 1, stream); - + if (count != 12) printf("MHDR::Read: Failed to read some data expected 12, read %d\n", count); } @@ -357,7 +357,7 @@ void ModelHeader::Read(FILE* stream) count += fread(&OffsetBoundingVertices, sizeof(uint32), 1, stream); count += fread(&CountBoundingNormals, sizeof(uint32), 1, stream); count += fread(&OffsetBoundingNormals, sizeof(uint32), 1, stream); - + if (count != 51) printf("ModelHeader::Read: Failed to read some data expected 51, read %d\n", count); @@ -380,7 +380,7 @@ WorldModelHeader WorldModelHeader::Read(FILE* stream) ret.BoundingBox[0] = Vector3::Read(stream); ret.BoundingBox[1] = Vector3::Read(stream); count += fread(&ret.LiquidTypeRelated, sizeof(uint32), 1, stream); - + if (count != 10) printf("WorldModelHeader::Read: Failed to read some data expected 10, read %d\n", count); @@ -400,7 +400,7 @@ DoodadInstance DoodadInstance::Read(FILE* stream) count += fread(&ret.QuatZ, sizeof(float), 1, stream); count += fread(&ret.Scale, sizeof(float), 1, stream); count += fread(&ret.LightColor, sizeof(uint32), 1, stream); - + if (count != 7) printf("DoodadInstance::Read: Failed to read some data expected 7, read %d\n", count); -- cgit v1.2.3 From b64ad98b0dda247d7e3ff7a288b378212bf54323 Mon Sep 17 00:00:00 2001 From: Kirkhammett Date: Thu, 24 Jan 2013 16:53:28 +0000 Subject: DB/SAI: Fix quest Wrangle Some Aether Rays! Closes #6176 Closes #8968 --- sql/updates/world/2013_01_24_00_world_sai.sql | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 sql/updates/world/2013_01_24_00_world_sai.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_24_00_world_sai.sql b/sql/updates/world/2013_01_24_00_world_sai.sql new file mode 100644 index 00000000000..516af5a1504 --- /dev/null +++ b/sql/updates/world/2013_01_24_00_world_sai.sql @@ -0,0 +1,32 @@ +SET @AETHER_RAY := 22181; +SET @WRANGLED_RAY := 23343; +SET @WRANGLE_SPELL := 40856; +SET @WRANGLED_FORCE_CAST := 40917; +SET @WRANGLED_AURA := 40926; +SET @QUEST_GIVER := 23335; + +DELETE FROM `creature_text` WHERE `entry`=@AETHER_RAY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@AETHER_RAY,1,0,'The Aether Ray appears ready to be wrangled.',16,0,100,0,0,0,'Aether Ray'); + +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@AETHER_RAY; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@AETHER_RAY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@AETHER_RAY; +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 +(@AETHER_RAY, 0, 0, 0, 0, 0, 100, 0, 5000, 6000, 8000, 9000, 11, 35333, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Aether Ray - IC - Cast Tail Swipe'), +(@AETHER_RAY, 0, 1, 0, 2, 0, 100, 1, 0, 40, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Aether Ray - On 40 % HP - Say emote'), +(@AETHER_RAY, 0, 2, 3, 8, 0, 100, 0, @WRANGLE_SPELL, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Aether Ray - On spellcast - Despawn'), +(@AETHER_RAY, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, @WRANGLED_FORCE_CAST, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Aether Ray - Link with 2 - Summon Wrangled Aether Ray'); + +DELETE FROM `creature_ai_scripts` WHERE `creature_id`=@WRANGLED_RAY; +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@WRANGLED_RAY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@WRANGLED_RAY; +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 +(@WRANGLED_RAY, 0, 0, 1, 54, 0, 100, 1, 0, 0, 0, 0, 85, @WRANGLED_AURA, 3, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'On spawn - Cast Wrangled Aura - Action Invoker'), +(@WRANGLED_RAY, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 29, 0, 0, @QUEST_GIVER, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wrangled Ray - Link with 0 - Follow Player'), +(@WRANGLED_RAY, 0, 2, 0, 65, 0, 100, 0, 0, 0, 0, 0, 41, 1000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrangled Ray - On follow complete - Despawn'); + +DELETE FROM `conditions` WHERE `SourceEntry`=@WRANGLE_SPELL; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(17, 0, @WRANGLE_SPELL, 0, 0, 31, 1, 3, 22181, 0, 0, 0, 0, '', 'Spell only hits Aether Rey'), +(17, 0, @WRANGLE_SPELL, 0, 0, 38, 1, 40, 4, 0, 0, 0, 0, '', 'Spell only hits if at or below 40%'); -- cgit v1.2.3 From 9ad8ac73a96e1ee4046c6ae6471b59d0151d2bce Mon Sep 17 00:00:00 2001 From: nelegalno Date: Fri, 25 Jan 2013 11:57:31 +0000 Subject: DB/Texts: Ensure that correct types are used in `creature_text` (42 texts should be corrected) Closes #9055 --- sql/updates/world/2013_01_25_00_world_creature_text.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2013_01_25_00_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_25_00_world_creature_text.sql b/sql/updates/world/2013_01_25_00_world_creature_text.sql new file mode 100644 index 00000000000..25354a70390 --- /dev/null +++ b/sql/updates/world/2013_01_25_00_world_creature_text.sql @@ -0,0 +1,8 @@ +-- Update text's with creature_text.type old format values - some missing texts should be fixed. +-- based on http://collab.kpsn.org/display/tc/Creature+text+tc2#Creaturetexttc2-type +UPDATE `creature_text` SET `type`=12 WHERE `type`=0; -- Say +UPDATE `creature_text` SET `type`=14 WHERE `type`=1; -- Yell +UPDATE `creature_text` SET `type`=16 WHERE `type`=2; -- Emote +UPDATE `creature_text` SET `type`=41 WHERE `type`=3; -- Boss Emote +UPDATE `creature_text` SET `type`=15 WHERE `type`=4; -- Whisper +UPDATE `creature_text` SET `type`=42 WHERE `type`=5; -- Boss Whisper -- cgit v1.2.3 From c9b9c69f97db040e190fee6f077f57c66f06b5ea Mon Sep 17 00:00:00 2001 From: Phantons Date: Fri, 25 Jan 2013 13:16:30 +0000 Subject: DB/Spells: Fix trap launcher for Imolation and Snake Trap Closes #9052 --- sql/updates/world/2013_01_25_00_world_spell_linked_spell_434.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_01_25_00_world_spell_linked_spell_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_25_00_world_spell_linked_spell_434.sql b/sql/updates/world/2013_01_25_00_world_spell_linked_spell_434.sql new file mode 100644 index 00000000000..5eb29aa4de1 --- /dev/null +++ b/sql/updates/world/2013_01_25_00_world_spell_linked_spell_434.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (77769, -77769); +INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES +(77769, 82946, 2, 'Trap Launcher - Add/Remove'); -- cgit v1.2.3 From dbb25deb5fd88b393d97a3c99d5c5e37c59fcb53 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Fri, 25 Jan 2013 14:54:56 +0000 Subject: DB/Stats: Correct a few creature_classlevelstats Research done for 4.3.4 but still valid in 3.3.5 --- .../world/2013_01_25_01_world_creature_classlevelstats.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 sql/updates/world/2013_01_25_01_world_creature_classlevelstats.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_25_01_world_creature_classlevelstats.sql b/sql/updates/world/2013_01_25_01_world_creature_classlevelstats.sql new file mode 100644 index 00000000000..5d0a916dfb8 --- /dev/null +++ b/sql/updates/world/2013_01_25_01_world_creature_classlevelstats.sql @@ -0,0 +1,14 @@ +UPDATE `creature_classlevelstats` SET `basehp1`=9741 WHERE `level`=82 AND `class`=1; +UPDATE `creature_classlevelstats` SET `basehp0`=5971, `basehp1`=10300 WHERE `level`=84 AND `class`=1; +UPDATE `creature_classlevelstats` SET `basehp0`=6141 WHERE `level`=85 AND `class`=1; + +UPDATE `creature_classlevelstats` SET `basehp1`=1006 WHERE `level`=31 AND `class`=2; +UPDATE `creature_classlevelstats` SET `basemana`=4081 WHERE `level`=81 AND `class`=2; +UPDATE `creature_classlevelstats` SET `basemana`=4363 WHERE `level`=84 AND `class`=2; +UPDATE `creature_classlevelstats` SET `basehp2`=15498, `basemana`=4454 WHERE `level`=85 AND `class`=2; +UPDATE `creature_classlevelstats` SET `basehp2`=16515, `basemana`=4735 WHERE `level`=88 AND `class`=2; + +UPDATE `creature_classlevelstats` SET `basemana`=9328 WHERE `level`=83 AND `class`=8; +UPDATE `creature_classlevelstats` SET `basemana`=9512 WHERE `level`=84 AND `class`=8; +UPDATE `creature_classlevelstats` SET `basehp0`=4299, `basemana`=9697 WHERE `level`=85 AND `class`=8; +UPDATE `creature_classlevelstats` SET `basemana`=10232 WHERE `level`=88 AND `class`=8; -- cgit v1.2.3 From f3d0ea66be2ae4696393ecdd5b714f1ed21cc073 Mon Sep 17 00:00:00 2001 From: Gacko Date: Fri, 25 Jan 2013 22:28:49 +0100 Subject: DB: Fix SAI broke by quest_end_script conversion Closes #8995 --- .../world/2013_01_25_02_world_smart_scripts.sql | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 sql/updates/world/2013_01_25_02_world_smart_scripts.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_25_02_world_smart_scripts.sql b/sql/updates/world/2013_01_25_02_world_smart_scripts.sql new file mode 100644 index 00000000000..69d48686429 --- /dev/null +++ b/sql/updates/world/2013_01_25_02_world_smart_scripts.sql @@ -0,0 +1,41 @@ +-- Kalaran Windblade: SAI +DELETE FROM `smart_scripts` WHERE `entryorguid`=8479 AND `source_type`=0; +INSERT INTO `smart_scripts`(`entryorguid`,`id`,`link`,`event_type`,`event_param1`,`event_param2`,`action_type`,`action_param1`,`target_type`,`comment`) VALUES +(8479,0,1,62,1321,0,26,3441,7,'Kalaran Windblade - On gossip select - Quest credit'), +(8479,1,0,61,0,0,72,0,7,'Kalaran Windblade - On gossip select - Close gossip'), +(8479,2,3,62,1323,2,11,19797,7,'Kalaran Windblade - On gossip select - Cast 19797'), +(8479,3,0,61,0,0,72,0,7,'Kalaran Windblade - On gossip select - Close gossip'), +(8479,4,0,62,1323,3,80,847900,1,'Kalaran Windblade - On gossip select - Run script'); + +-- Kalaran Windblade: SAI action list +DELETE FROM `smart_scripts` WHERE `entryorguid`=847900 AND `source_type`=9; +INSERT INTO `smart_scripts`(`entryorguid`,`source_type`,`id`,`event_param1`,`event_param2`,`action_type`,`action_param1`,`target_type`,`comment`) VALUES +(847900,9,0,0,0,72,0,7,'Kalaran Windblade - Action 0 - Close gossip'), +(847900,9,1,0,0,83,3,1,'Kalaran Windblade - Action 1 - Remove NPC flags'), +(847900,9,2,1000,1000,1,0,1,'Kalaran Windblade - Action 2 - Say 0'), +(847900,9,3,1000,1000,17,69,1,'Kalaran Windblade - Action 3 - Emote state use standing'), +(847900,9,4,60000,60000,17,0,1,'Kalaran Windblade - Action 4 - Emote state none'), +(847900,9,5,1000,1000,15,3453,7,'Kalaran Windblade - Action 5 - Give quest credit'), +(847900,9,6,1000,1000,82,3,1,'Kalaran Windblade - Action 6 - Add NPC flags'); + +-- Kalaran Windblade: Creature text +DELETE FROM `creature_text` WHERE `entry`=8479; +INSERT INTO `creature_text`(`entry`,`groupid`,`id`,`text`,`type`,`probability`,`comment`) VALUE +(8479,0,0,'Be patient, $N. The torch is almost complete.',12,100,'Kalaran Windblade - Smart AI'); + +-- Captured Mountaineer: SAI +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=2211; +DELETE FROM `smart_scripts` WHERE `entryorguid`=2211 AND `source_type`=0; +INSERT INTO `smart_scripts`(`entryorguid`,`id`,`event_type`,`event_param1`,`action_type`,`action_param1`,`action_param2`,`target_type`,`comment`) VALUE +(2211,0,20,492,80,221100,2,1,'Captured Mountaineer - On quest reward - Start timed action list'); + +-- Captured Mountaineer: SAI action list +DELETE FROM `smart_scripts` WHERE `entryorguid`=221100 AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`event_param1`,`event_param2`,`action_type`,`action_param1`,`target_type`,`comment`) VALUES +(221100,9,0,1000,1000,1,0,1,'Captured Mountaineer - Action 0 - Say 0'), +(221100,9,1,4000,4000,37,0,1,'Captured Mountaineer - Action 2 - Suicide'); + +-- Captured Mountaineer: Creature text +DELETE FROM `creature_text` WHERE `entry`=2211; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`probability`,`emote`,`comment`) VALUE +(2211,0,0,'I raise my brew and hope to be rid of the likes of you! Cheers, you no good scoundrel, $N!',12,100,7,'Captured Mountaineer - Reward quest 492'); -- cgit v1.2.3 From 6acfa490659875af8ea546aa223d07b3c9ad21cc Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Sat, 26 Jan 2013 00:41:46 +0200 Subject: Script/Commands: Implement command to list the members of a group/party. --- sql/updates/world/2013_01_26_00_world_misc.sql | 8 +++ src/server/game/Miscellaneous/Language.h | 4 +- src/server/scripts/Commands/cs_misc.cpp | 75 ++++++++++++++++++++++++++ 3 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_01_26_00_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_00_world_misc.sql b/sql/updates/world/2013_01_26_00_world_misc.sql new file mode 100644 index 00000000000..429d900d765 --- /dev/null +++ b/sql/updates/world/2013_01_26_00_world_misc.sql @@ -0,0 +1,8 @@ +DELETE FROM `trinity_string` WHERE `entry` IN (1149,1150); +INSERT INTO `trinity_string` (`entry`,`content_default`,`content_loc1`,`content_loc2`,`content_loc3`,`content_loc4`,`content_loc5`,`content_loc6`,`content_loc7`,`content_loc8`) VALUES +(1149,'Group type: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +(1150,'Name: %s (%s), GUID: %u, Flags: %s, Roles: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); + +DELETE FROM `command` WHERE `name`='group list'; +INSERT INTO `command` (`name`,`security`,`help`) VALUES +('group list',3,'Syntax: .group list [$CharacterName] \r\nLists all the members of the group/party the player is in.'); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 1aeb16e9c7e..8b416339bc7 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -851,7 +851,9 @@ enum TrinityStrings LANG_GROUP_PLAYER_JOINED = 1146, LANG_GROUP_NOT_IN_GROUP = 1147, LANG_GROUP_FULL = 1148, - // Room for more level 3 1149-1199 not used + LANG_GROUP_TYPE = 1149, + LANG_GROUP_PLAYER_NAME_GUID = 1150, + // Room for more level 3 1151-1199 not used // Debug commands LANG_CINEMATIC_NOT_EXIST = 1200, diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index e2b5ac9487d..3721f221178 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -33,6 +33,8 @@ #include "ace/INET_Addr.h" #include "Player.h" #include "Pet.h" +#include "LFG.h" +#include "GroupMGR.h" class misc_commandscript : public CommandScript { @@ -47,6 +49,7 @@ public: { "disband", SEC_ADMINISTRATOR, false, &HandleGroupDisbandCommand, "", NULL }, { "remove", SEC_ADMINISTRATOR, false, &HandleGroupRemoveCommand, "", NULL }, { "join", SEC_ADMINISTRATOR, false, &HandleGroupJoinCommand, "", NULL }, + { "list", SEC_ADMINISTRATOR, false, &HandleGroupListCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; static ChatCommand petCommandTable[] = @@ -2781,6 +2784,78 @@ public: return true; } + static bool HandleGroupListCommand(ChatHandler* handler, char const* args) + { + Player* playerTarget; + uint64 guidTarget; + std::string nameTarget; + + uint32 parseGUID = MAKE_NEW_GUID(atol((char*)args), 0, HIGHGUID_PLAYER); + + if (sObjectMgr->GetPlayerNameByGUID(parseGUID, nameTarget)) + { + playerTarget = sObjectMgr->GetPlayerByLowGUID(parseGUID); + guidTarget = parseGUID; + } + else if (!handler->extractPlayerTarget((char*)args, &playerTarget, &guidTarget, &nameTarget)) + return false; + + Group* groupTarget = NULL; + if (playerTarget) + groupTarget = playerTarget->GetGroup(); + + if (!groupTarget) + { + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GROUP_MEMBER); + stmt->setUInt32(0, guidTarget); + PreparedQueryResult resultGroup = CharacterDatabase.Query(stmt); + if (resultGroup) + groupTarget = sGroupMgr->GetGroupByDbStoreId((*resultGroup)[0].GetUInt32()); + } + + if (groupTarget) + { + handler->PSendSysMessage(LANG_GROUP_TYPE, (groupTarget->isRaidGroup() ? "raid" : "party")); + Group::MemberSlotList const& members = groupTarget->GetMemberSlots(); + Group::MemberSlotList::const_iterator itr; + for (itr = members.begin(); itr != members.end(); ++itr) + { + std::ostringstream flags, roles; + if ((*itr).flags & MEMBER_FLAG_ASSISTANT) + flags << "Assistant "; + if ((*itr).flags & MEMBER_FLAG_MAINTANK) + flags << "MainTank "; + if ((*itr).flags & MEMBER_FLAG_MAINASSIST) + flags << "MainAssist "; + + if ((*itr).roles & PLAYER_ROLE_LEADER) + roles << "Leader "; + if ((*itr).roles & PLAYER_ROLE_TANK) + roles << "Tank "; + if ((*itr).roles & PLAYER_ROLE_HEALER) + roles << "Healer "; + if ((*itr).roles & PLAYER_ROLE_DAMAGE) + roles << "Damage "; + + Player* p = ObjectAccessor::FindPlayer((*itr).guid); + const char* onlineState = (p && p->IsInWorld()) ? "online" : "offline"; + + std::string flagsStr = (flags.str().empty()) ? "None" : flags.str(); + std::string rolesStr = (roles.str().empty()) ? "None" : roles.str(); + + handler->PSendSysMessage(LANG_GROUP_PLAYER_NAME_GUID, (*itr).name.c_str(), onlineState, GUID_LOPART((*itr).guid), flagsStr.c_str(), rolesStr.c_str()); + } + return true; + } + else + { + handler->PSendSysMessage(LANG_GROUP_NOT_IN_GROUP, nameTarget.c_str()); + return true; + } + + return true; + } + static bool HandlePlayAllCommand(ChatHandler* handler, char const* args) { if (!*args) -- cgit v1.2.3 From a3d07b5e6ac45c23ec4116028c4bccae9307083b Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 26 Jan 2013 13:25:06 +0100 Subject: Core/Spells: Fixed Darkflight, Two Forms and Running Wild for worgens. Closes #8905 --- .../2013_01_26_00_world_spell_script_names_434.sql | 7 + src/server/game/Spells/Auras/SpellAuraEffects.cpp | 34 ++--- src/server/scripts/Spells/spell_generic.cpp | 157 +++++++++++++++++++++ 3 files changed, 181 insertions(+), 17 deletions(-) create mode 100644 sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql b/sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..d0c4a61c422 --- /dev/null +++ b/sql/updates/world/2013_01_26_00_world_spell_script_names_434.sql @@ -0,0 +1,7 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_running_wild'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_two_forms'; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_darkflight'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(87840,'spell_gen_running_wild'), +(68996,'spell_gen_two_forms'), +(68992,'spell_gen_darkflight'); diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 186cdb8c552..18128660436 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -2774,6 +2774,8 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo if (apply) { uint32 creatureEntry = GetMiscValue(); + uint32 displayId = 0; + uint32 vehicleId = 0; // Festive Holiday Mount if (target->HasAura(62061)) @@ -2784,30 +2786,28 @@ void AuraEffect::HandleAuraMounted(AuraApplication const* aurApp, uint8 mode, bo creatureEntry = 15665; } - CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry); - if (!ci) + if (CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(creatureEntry)) { - sLog->outError(LOG_FILTER_SQL, "AuraMounted: `creature_template`='%u' not found in database (only need its modelid)", GetMiscValue()); - return; - } + uint32 team = 0; + if (target->GetTypeId() == TYPEID_PLAYER) + team = target->ToPlayer()->GetTeam(); - uint32 team = 0; - if (target->GetTypeId() == TYPEID_PLAYER) - team = target->ToPlayer()->GetTeam(); + displayId = ObjectMgr::ChooseDisplayId(team, ci); + sObjectMgr->GetCreatureModelRandomGender(&displayId); - uint32 displayID = ObjectMgr::ChooseDisplayId(team, ci); - sObjectMgr->GetCreatureModelRandomGender(&displayID); + vehicleId = ci->VehicleId; - //some spell has one aura of mount and one of vehicle - for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON - && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue()) - displayID = 0; + //some spell has one aura of mount and one of vehicle + for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (GetSpellInfo()->Effects[i].Effect == SPELL_EFFECT_SUMMON + && GetSpellInfo()->Effects[i].MiscValue == GetMiscValue()) + displayId = 0; + } - target->Mount(displayID, ci->VehicleId, GetMiscValue()); + target->Mount(displayId, vehicleId, creatureEntry); // cast speed aura - if (MountCapabilityEntry const* mountCapability = target->GetMountCapability(uint32(GetMiscValueB()))) + if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(GetAmount())) target->CastSpell(target, mountCapability->SpeedModSpell, true); } else diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 54cb346a033..d1d4f660172 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3163,6 +3163,160 @@ class spell_gen_replenishment : public SpellScriptLoader } }; +enum RunningWildMountIds +{ + RUNNING_WILD_MODEL_MALE = 29422, + RUNNING_WILD_MODEL_FEMALE = 29423, + SPELL_ALTERED_FORM = 97709, +}; + +class spell_gen_running_wild : public SpellScriptLoader +{ + public: + spell_gen_running_wild() : SpellScriptLoader("spell_gen_running_wild") { } + + class spell_gen_running_wild_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_running_wild_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sCreatureDisplayInfoStore.LookupEntry(RUNNING_WILD_MODEL_MALE)) + return false; + if (!sCreatureDisplayInfoStore.LookupEntry(RUNNING_WILD_MODEL_FEMALE)) + return false; + return true; + } + + void HandleMount(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + PreventDefaultAction(); + + target->Mount(target->getGender() == GENDER_FEMALE ? RUNNING_WILD_MODEL_FEMALE : RUNNING_WILD_MODEL_MALE, 0, 0); + + // cast speed aura + if (MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(aurEff->GetAmount())) + target->CastSpell(target, mountCapability->SpeedModSpell, TRIGGERED_FULL_MASK); + } + + void Register() + { + OnEffectApply += AuraEffectApplyFn(spell_gen_running_wild_AuraScript::HandleMount, EFFECT_1, SPELL_AURA_MOUNTED, AURA_EFFECT_HANDLE_REAL); + } + }; + + class spell_gen_running_wild_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_running_wild_SpellScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_ALTERED_FORM)) + return false; + return true; + } + + bool Load() + { + // Definitely not a good thing, but currently the only way to do something at cast start + // Should be replaced as soon as possible with a new hook: BeforeCastStart + GetCaster()->CastSpell(GetCaster(), SPELL_ALTERED_FORM, TRIGGERED_FULL_MASK); + return false; + } + + void Register() + { + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_running_wild_AuraScript(); + } + + SpellScript* GetSpellScript() const + { + return new spell_gen_running_wild_SpellScript(); + } +}; + +class spell_gen_two_forms : public SpellScriptLoader +{ + public: + spell_gen_two_forms() : SpellScriptLoader("spell_gen_two_forms") { } + + class spell_gen_two_forms_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_two_forms_SpellScript); + + SpellCastResult CheckCast() + { + if (GetCaster()->isInCombat()) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TRANSFORM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + // Player cannot transform to human form if he is forced to be worgen for some reason (Darkflight) + if (GetCaster()->GetAuraEffectsByType(SPELL_AURA_WORGEN_ALTERED_FORM).size() > 1) + { + SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_CANT_TRANSFORM); + return SPELL_FAILED_CUSTOM_ERROR; + } + + return SPELL_CAST_OK; + } + + void HandleTransform(SpellEffIndex effIndex) + { + Unit* target = GetHitUnit(); + PreventHitDefaultEffect(effIndex); + if (target->HasAuraType(SPELL_AURA_WORGEN_ALTERED_FORM)) + target->RemoveAurasByType(SPELL_AURA_WORGEN_ALTERED_FORM); + else // Basepoints 1 for this aura control whether to trigger transform transition animation or not. + target->CastCustomSpell(SPELL_ALTERED_FORM, SPELLVALUE_BASE_POINT0, 1, target, TRIGGERED_FULL_MASK); + } + + void Register() + { + OnCheckCast += SpellCheckCastFn(spell_gen_two_forms_SpellScript::CheckCast); + OnEffectHitTarget += SpellEffectFn(spell_gen_two_forms_SpellScript::HandleTransform, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_two_forms_SpellScript(); + } +}; + +class spell_gen_darkflight : public SpellScriptLoader +{ + public: + spell_gen_darkflight() : SpellScriptLoader("spell_gen_darkflight") { } + + class spell_gen_darkflight_SpellScript : public SpellScript + { + PrepareSpellScript(spell_gen_darkflight_SpellScript); + + void TriggerTransform() + { + GetCaster()->CastSpell(GetCaster(), SPELL_ALTERED_FORM, TRIGGERED_FULL_MASK); + } + + void Register() + { + AfterCast += SpellCastFn(spell_gen_darkflight_SpellScript::TriggerTransform); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_gen_darkflight_SpellScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3243,4 +3397,7 @@ void AddSC_generic_spell_scripts() new spell_gen_increase_stats_buff("spell_mage_arcane_brilliance"); new spell_gen_increase_stats_buff("spell_mage_dalaran_brilliance"); new spell_gen_replenishment(); + new spell_gen_running_wild(); + new spell_gen_two_forms(); + new spell_gen_darkflight(); } -- cgit v1.2.3 From 9ae8a1e7cb1c212af1f57b0715ea6bd4efd64959 Mon Sep 17 00:00:00 2001 From: dele Date: Sat, 26 Jan 2013 18:58:15 +0100 Subject: DB/Loot: add missing items to Coren Direbrew Closes #7297 --- sql/updates/world/2013_01_26_01_world_creature_loot_template.sql | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 sql/updates/world/2013_01_26_01_world_creature_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_01_world_creature_loot_template.sql b/sql/updates/world/2013_01_26_01_world_creature_loot_template.sql new file mode 100644 index 00000000000..5d667b99cb5 --- /dev/null +++ b/sql/updates/world/2013_01_26_01_world_creature_loot_template.sql @@ -0,0 +1,5 @@ +-- Coren Direbrew ( http://old.wowhead.com/npc=23872 ) loot fix by dele +DELETE FROM `creature_loot_template` WHERE `entry`=23872 AND `item` IN (38280,38281); +INSERT INTO `creature_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(23872,38280,100,1,0,1,1), -- Direbrew's Dire Brew Alliance version +(23872,38281,100,1,0,1,1); -- Direbrew's Dire Brew Horde version -- cgit v1.2.3 From 1682a72d1aed1401e010fdf97f7d45b39846ee37 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 26 Jan 2013 19:20:15 +0100 Subject: DB/Loot: add loot for Protectorate Treasure Cache and make sure you always get sometime out of it... Closes #8589 --- ...2013_01_26_01_world_reference_loot_template.sql | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 sql/updates/world/2013_01_26_01_world_reference_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_01_world_reference_loot_template.sql b/sql/updates/world/2013_01_26_01_world_reference_loot_template.sql new file mode 100644 index 00000000000..d4e5a9fa622 --- /dev/null +++ b/sql/updates/world/2013_01_26_01_world_reference_loot_template.sql @@ -0,0 +1,26 @@ +-- Add reference for Zone Drop Netherstorm Blues +DELETE FROM `reference_loot_template` WHERE `entry`=14501; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(14501,31940,0,1,1,1,1), -- Ethereum Torque +(14501,31936,0,1,1,1,1), -- Fiery Cloak +(14501,31565,0,1,1,1,1), -- Skystalker's Boots +(14501,31573,0,1,1,1,1), -- Mistshroud Boots +(14501,31557,0,1,1,1,1), -- Windchanneller's Boots +(14501,31937,0,1,1,1,1), -- Living Cloak +(14501,31928,0,1,1,1,1), -- Dark Band +(14501,31581,0,1,1,1,1), -- Slatesteel Boots +(14501,31929,0,1,1,1,1), -- Enigmatic Band +(14501,31938,0,1,1,1,1), -- Enigmatic Cloak +(14501,31943,0,1,1,1,1), -- Ethereum Band +(14501,31939,0,1,1,1,1), -- Dark Cloak +(14501,31925,0,1,1,1,1), -- Fiery Band +(14501,31926,0,1,1,1,1), -- Frigid Band +(14501,31927,0,1,1,1,1), -- Living Band +(14501,32520,0,1,1,1,1), -- Manaforged Sphere +(14501,31935,0,1,1,1,1); -- Frigid Cloak +-- Add loot for Protectorate Treasure Cache +UPDATE `item_template` SET `minMoneyLoot`=10000,`maxMoneyLoot`=10000 WHERE `entry`=32064; +DELETE FROM `item_loot_template` WHERE `entry`=32064; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(32064,1,80,1,1,-24013,1), -- one from greens +(32064,2,20,1,1,-14501,1); -- one from blue items -- cgit v1.2.3 From 66e9b0c633fe5a32e5971c994703ff9c58a37392 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Sat, 26 Jan 2013 19:20:00 +0100 Subject: DB/Conditions: Add conditions for Bellowing Roar / Eruption --- ...2013_01_26_01_world_reference_loot_template.sql | 26 ----- ...2013_01_26_02_world_reference_loot_template.sql | 26 +++++ .../world/2013_01_26_03_world_conditions.sql | 108 +++++++++++++++++++++ 3 files changed, 134 insertions(+), 26 deletions(-) delete mode 100644 sql/updates/world/2013_01_26_01_world_reference_loot_template.sql create mode 100644 sql/updates/world/2013_01_26_02_world_reference_loot_template.sql create mode 100644 sql/updates/world/2013_01_26_03_world_conditions.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_01_world_reference_loot_template.sql b/sql/updates/world/2013_01_26_01_world_reference_loot_template.sql deleted file mode 100644 index d4e5a9fa622..00000000000 --- a/sql/updates/world/2013_01_26_01_world_reference_loot_template.sql +++ /dev/null @@ -1,26 +0,0 @@ --- Add reference for Zone Drop Netherstorm Blues -DELETE FROM `reference_loot_template` WHERE `entry`=14501; -INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES -(14501,31940,0,1,1,1,1), -- Ethereum Torque -(14501,31936,0,1,1,1,1), -- Fiery Cloak -(14501,31565,0,1,1,1,1), -- Skystalker's Boots -(14501,31573,0,1,1,1,1), -- Mistshroud Boots -(14501,31557,0,1,1,1,1), -- Windchanneller's Boots -(14501,31937,0,1,1,1,1), -- Living Cloak -(14501,31928,0,1,1,1,1), -- Dark Band -(14501,31581,0,1,1,1,1), -- Slatesteel Boots -(14501,31929,0,1,1,1,1), -- Enigmatic Band -(14501,31938,0,1,1,1,1), -- Enigmatic Cloak -(14501,31943,0,1,1,1,1), -- Ethereum Band -(14501,31939,0,1,1,1,1), -- Dark Cloak -(14501,31925,0,1,1,1,1), -- Fiery Band -(14501,31926,0,1,1,1,1), -- Frigid Band -(14501,31927,0,1,1,1,1), -- Living Band -(14501,32520,0,1,1,1,1), -- Manaforged Sphere -(14501,31935,0,1,1,1,1); -- Frigid Cloak --- Add loot for Protectorate Treasure Cache -UPDATE `item_template` SET `minMoneyLoot`=10000,`maxMoneyLoot`=10000 WHERE `entry`=32064; -DELETE FROM `item_loot_template` WHERE `entry`=32064; -INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES -(32064,1,80,1,1,-24013,1), -- one from greens -(32064,2,20,1,1,-14501,1); -- one from blue items diff --git a/sql/updates/world/2013_01_26_02_world_reference_loot_template.sql b/sql/updates/world/2013_01_26_02_world_reference_loot_template.sql new file mode 100644 index 00000000000..d4e5a9fa622 --- /dev/null +++ b/sql/updates/world/2013_01_26_02_world_reference_loot_template.sql @@ -0,0 +1,26 @@ +-- Add reference for Zone Drop Netherstorm Blues +DELETE FROM `reference_loot_template` WHERE `entry`=14501; +INSERT INTO `reference_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(14501,31940,0,1,1,1,1), -- Ethereum Torque +(14501,31936,0,1,1,1,1), -- Fiery Cloak +(14501,31565,0,1,1,1,1), -- Skystalker's Boots +(14501,31573,0,1,1,1,1), -- Mistshroud Boots +(14501,31557,0,1,1,1,1), -- Windchanneller's Boots +(14501,31937,0,1,1,1,1), -- Living Cloak +(14501,31928,0,1,1,1,1), -- Dark Band +(14501,31581,0,1,1,1,1), -- Slatesteel Boots +(14501,31929,0,1,1,1,1), -- Enigmatic Band +(14501,31938,0,1,1,1,1), -- Enigmatic Cloak +(14501,31943,0,1,1,1,1), -- Ethereum Band +(14501,31939,0,1,1,1,1), -- Dark Cloak +(14501,31925,0,1,1,1,1), -- Fiery Band +(14501,31926,0,1,1,1,1), -- Frigid Band +(14501,31927,0,1,1,1,1), -- Living Band +(14501,32520,0,1,1,1,1), -- Manaforged Sphere +(14501,31935,0,1,1,1,1); -- Frigid Cloak +-- Add loot for Protectorate Treasure Cache +UPDATE `item_template` SET `minMoneyLoot`=10000,`maxMoneyLoot`=10000 WHERE `entry`=32064; +DELETE FROM `item_loot_template` WHERE `entry`=32064; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(32064,1,80,1,1,-24013,1), -- one from greens +(32064,2,20,1,1,-14501,1); -- one from blue items diff --git a/sql/updates/world/2013_01_26_03_world_conditions.sql b/sql/updates/world/2013_01_26_03_world_conditions.sql new file mode 100644 index 00000000000..cc7ab333f4a --- /dev/null +++ b/sql/updates/world/2013_01_26_03_world_conditions.sql @@ -0,0 +1,108 @@ +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (18431,17731); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +-- Bellowing Roar +(13, 2, 18431, 0, 0, 31, 0, 5, 176838, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176837, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176835, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176834, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176832, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176831, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176833, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176825, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176824, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176823, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176819, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176813, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176812, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176809, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176515, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176514, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176513, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176911, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176910, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176909, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176908, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176842, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176841, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176840, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176839, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176836, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176826, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176811, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176810, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176922, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176921, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176920, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176919, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176915, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176914, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176913, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176912, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176830, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176829, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176828, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176827, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176822, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176821, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176820, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176818, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176817, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176816, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176815, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176814, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176918, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176917, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +(13, 2, 18431, 0, 0, 31, 0, 5, 176916, 0, 0, 0, 0, '', 'Bellowing Roar - Lava Fissure'), +-- Eruption +(13, 2, 17731, 0, 0, 31, 0, 5, 176838, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176837, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176835, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176834, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176832, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176831, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176833, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176825, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176824, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176823, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176819, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176813, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176812, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176809, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176515, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176514, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176513, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176911, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176910, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176909, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176908, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176842, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176841, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176840, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176839, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176836, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176826, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176811, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176810, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176922, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176921, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176920, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176919, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176915, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176914, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176913, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176912, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176830, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176829, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176828, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176827, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176822, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176821, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176820, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176818, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176817, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176816, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176815, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176814, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176918, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176917, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'), +(13, 2, 17731, 0, 0, 31, 0, 5, 176916, 0, 0, 0, 0, '', 'Eruption - Lava Fissure'); -- cgit v1.2.3 From 1c95762849ac9db5e077df567de487648567530c Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 26 Jan 2013 19:46:14 +0100 Subject: DB/Loot: some modifications to Mithrill Bound Trunk Closes #3801 --- .../2013_01_26_04_world_item_loot_template.sql | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 sql/updates/world/2013_01_26_04_world_item_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_04_world_item_loot_template.sql b/sql/updates/world/2013_01_26_04_world_item_loot_template.sql new file mode 100644 index 00000000000..32cf116167e --- /dev/null +++ b/sql/updates/world/2013_01_26_04_world_item_loot_template.sql @@ -0,0 +1,29 @@ +-- Change loot in Mithril Bound Trunk to always give an item +DELETE FROM `item_loot_template` WHERE `entry`=21228; +INSERT INTO `item_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +-- Group1: Leather @ 70% +(21228,4304,40,1,1,2,4), -- Thick Leather +(21228,8170,30,1,1,1,2), -- Rugged Leather +-- Group2: Cloth @ 70% +(21228, 4339,40,1,2,1,3), -- Bolt of Mageweave +(21228,14048,30,1,2,1,2), -- Bolt of Runecloth +-- Ungrouped: +(21228,6149,20,1,0,1,2), -- Greater Mana Potion +(21228,3928,20,1,0,1,2), -- Superior Healing Potion +(21228,34109,50,1,0,1,1), -- Weather-Beaten Journal +(21228, 3914, 1,1,0,1,1), -- Journeyman's Backpack +(21228,7976,0.05,1,0,1,1), -- Plans: Mithril Shield Spike +(21228,7909,0.4,1,0,1,1), -- Aquamarine +(21228,7910,0.3,1,0,1,1), -- Star Ruby +(21228,1613,0.3,1,0,1,1), -- Spiritchaser Staff +(21228,9295,0.3,1,0,1,1), -- Recipe: Invisibility Potion +(21228,7468,0.2,1,0,1,1), -- Regal Robe +(21228,9291,0.2,1,0,1,1), -- Field Plate Leggings +(21228,9910,0.2,1,0,1,1), -- Royal Gloves +(21228,10320,0.2,1,0,1,1), -- Pattern: Red Mageweave Headband +(21228,15245,0.2,1,0,1,1), -- Vorpal Dagger +(21228,8281,0.2,1,0,1,1), -- Valorous Pauldrons +(21228,1685,0.2,1,0,1,1), -- Troll-hide Bag +(21228,8163,0.2,1,0,1,1), -- Jouster's Pauldrons +(21228,8141,0.2,1,0,1,1), -- Chromite Greaves +(21228,8121,0.2,1,0,1,1); -- Heraldic Gloves -- cgit v1.2.3 From e591f886ff4646adca822c11503c3b783b30d36e Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sat, 26 Jan 2013 22:12:04 +0100 Subject: DB/Misc: Add Rare Bosses to Dire Maul Closes #5882 Add SAI for Quest: No Mercy for the Captured Closes #568 Add Spawn for Sand Shark Closes #5925 (thx Mogale) Fix underground Centaurs Closes #8498 (thx baric) --- sql/updates/world/2013_01_26_05_world_misc.sql | 116 +++++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sql/updates/world/2013_01_26_05_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_05_world_misc.sql b/sql/updates/world/2013_01_26_05_world_misc.sql new file mode 100644 index 00000000000..ff8cf4d1e77 --- /dev/null +++ b/sql/updates/world/2013_01_26_05_world_misc.sql @@ -0,0 +1,116 @@ +-- Issue 5882: Dire Maul Arena Rare Bosses +-- Spawnlocations are from YTDB need to be checked! +SET @GUID := 45758; -- set the guid for spawning +SET @POOL := 358; -- set the poolid for the spawn +DELETE FROM `creature` WHERE `id` IN (11447,11497,11498); +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID ,11447,1,1,1,0,0,-3799.62,1063.83,132.806,1.20424,21600,0,0,60000, 0,0,0,0,0), +(@GUID+1,11497,1,1,1,0,0,-3731.22,1061.32,132.345,1.78150,21600,0,0,73000,24340,0,0,0,0), +(@GUID+2,11498,1,1,1,0,0,-3690.96,1077.14,131.969,2.65172,21600,0,0,57000, 0,0,0,0,0); +DELETE FROM `pool_template` WHERE `entry`=@POOL; +INSERT INTO `pool_template` (`entry`,`max_limit`,`description`) VALUES +(@POOL,1,'Max 1 Rare in Dire Maul Arena'); +DELETE FROM `pool_creature` WHERE `pool_entry`=@POOL; +INSERT INTO `pool_creature` (`guid`,`pool_entry`,`chance`,`description`) VALUES +(@GUID ,@POOL,0, 'Rare Spawn Dire Maul Arena'), +(@GUID+1,@POOL,0, 'Rare Spawn Dire Maul Arena'), +(@GUID+2,@POOL,0, 'Rare Spawn Dire Maul Arena'); +-- Issue 5925: Missing Sand Shark from Durotar +-- Thx Mogale for sniffing +DELETE FROM `creature` WHERE `id`=5435; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(43494,5435,1,1,1,0,0,-1144.251,-4336.333,-8.457234,4.602825,900,4,0,741,0,1,0,0,0); +-- Issue 8498: Fix 2 centaurs stuck in the ground (by Baric) +UPDATE creature SET position_z=93.67 WHERE guid IN (14007, 20588); +-- Issue 568: No Mercy for the Captured +-- Gossip Menu Options +DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (9510,9509,9508,9507); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES +-- Chancellor +(9510,0,0, 'No, chancellor.. I wouldn''t say that I''m here to ''rescue'' you, per se.',1,1,0,0,0,0,NULL), +(9510,1,0, 'Where is Senior Scrivener Barriga being held?' ,1,1,50424,0,0,0,NULL), +(9510,2,0, 'Did you see where they took Sanitation Engineer Burke?',1,1,50426,0,0,0,NULL), +(9510,3,0, 'Any idea where they''re keeping Deathguard Schneider?' ,1,1,50425,0,0,0,NULL), +-- Engineer +(9509,0,0, 'Affraid not. Your days as a sanitation engineer are coming to an end', 1,1, 0,0,0,0,NULL), +(9509,1,0, 'Can you tell me where they have Chancellor Amai caged?',1,1,50423,0,0,0,NULL), +(9509,2,0, 'Where is Senior Scrivener Barriga being held?' ,1,1,50424,0,0,0,NULL), +(9509,3,0, 'Any idea where they''re keeping Deathguard Schneider?' ,1,1,50425,0,0,0,NULL), +-- Scrivener +(9508,0,0, 'Not today, senior scrivener!' ,1,1, 0,0,0,0,NULL), +(9508,1,0, 'Can you tell me where they have Chancellor Amai caged?',1,1,50423,0,0,0,NULL), +(9508,2,0, 'Did you see where they took Sanitation Engineer Burke?',1,1,50426,0,0,0,NULL), +(9508,3,0, 'Any idea where they''re keeping Deathguard Schneider?' ,1,1,50425,0,0,0,NULL), +-- Schneider +(9507,0,0, 'I''m affraid not. Schneider. Your time has come!' ,1,1, 0,0,0,0,NULL), +(9507,1,0, 'Can you tell me where they have Chancellor Amai caged?',1,1,50423,0,0,0,NULL), +(9507,2,0, 'Where is Senior Scrivener Barriga being held?' ,1,1,50424,0,0,0,NULL), +(9507,3,0, 'Did you see where they took Sanitation Engineer Burke?',1,1,50426,0,0,0,NULL); +-- Gossip Menu +DELETE FROM `gossip_menu` WHERE `entry` IN (50423,50424,50425,50426); +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(50423,12833), -- I think I saw them take him over by the north side of the abbey, near the archery targets. +(50424,12827), -- I think they put him in a cage over near the lumbermill. +(50425,12832), -- I think they have her down near the gallows. +(50426,12830); -- I think he's on the south side of the abbey. +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27376,27378,27379,27381) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2737600,2737800,2737900,2738100) 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 +-- Deathguard Schneider +(27376 ,0,0,0,62,0,100,0,9507,0,0,0,80,2737600,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - On Gossip Option Select - Start Script"), +(27376 ,0,1,0,10,0,100,0,0,10,180000,300000,1,1,0,0,0,0,0,17,0,10,0,0.0,0.0,0.0,0.0,"Deathguard Schneider - On LoS with Player Near - Say Line 1"), +(2737600,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Close Gossip"), +(2737600,9,1,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Say line 0"), +(2737600,9,2,0,0,0,100,0,5000,5000,0,0,2,14,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Set facton 14 (Hostile)"), +(2737600,9,3,0,0,0,100,0,2500,2500,0,0,46,1,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Move"), +-- Senior Scrivener Barriga +(27378 ,0,0,0,62,0,100,0,9508,0,0,0,80,2737800,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Senior Scrivener Barriga - On Gossip Option Select - Start Script"), +(27378 ,0,1,0,10,0,100,0,0,10,180000,300000,1,1,0,0,0,0,0,17,0,10,0,0.0,0.0,0.0,0.0,"Senior Scrivener Barriga - On LoS with Player Near - Say Line 1"), +(2737800,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Close Gossip"), +(2737800,9,1,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Senior Scrivener Barriga - Say line 0"), +(2737800,9,2,0,0,0,100,0,5000,5000,0,0,2,14,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Senior Scrivener Barriga - Set facton 14"), +(2737800,9,3,0,0,0,100,0,2500,2500,0,0,46,1,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Senior Scrivener Barriga - Move"), +-- Engineer Burke +(27379 ,0,0,0,62,0,100,0,9509,0,0,0,80,2737900,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Engineer Burke - On Gossip Option Select - Start Script"), +(27379 ,0,1,0,10,0,100,0,0,10,180000,300000,1,1,0,0,0,0,0,17,0,10,0,0.0,0.0,0.0,0.0,"Engineer Burke - On LoS with Player Near - Say Line 1"), +(2737900,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Close Gossip"), +(2737900,9,1,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Engineer Burke - Script - Say line 0"), +(2737900,9,2,0,0,0,100,0,5000,5000,0,0,2,14,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Engineer Burke - Script - Set facton 14"), +(2737900,9,3,0,0,0,100,0,2500,2500,0,0,46,1,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Engineer Burke - Script - Move"), +-- Chancellor Amai +(27381 ,0,0,0,62,0,100,0,9510,0,0,0,80,2738100,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Chancellor Amai - On Gossip Option Select - Start Script"), +(27381 ,0,1,0,10,0,100,0,0,10,180000,300000,1,1,0,0,0,0,0,17,0,10,0,0.0,0.0,0.0,0.0,"Chancellor Amai - On LoS with Player Near - Say Line 1"), +(2738100,9,0,0,0,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0.0,0.0,0.0,0.0, "Deathguard Schneider - Script - Close Gossip"), +(2738100,9,1,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Chancellor Amai - Script - Say line 0"), +(2738100,9,2,0,0,0,100,0,5000,5000,0,0,2,14,0,0,0,0,0,1,0,0,0,0.0,0.0,0.0,0.0,"Chancellor Amai - Script - Set facton 14"), +(2738100,9,3,0,0,0,100,0,2500,2500,0,0,46,1,0,0,0,0,0,0,0,0,0,0.0,0.0,0.0,0.0,"Chancellor Amai - Script - Move"); +-- Creature Texts +DELETE FROM `creature_text` WHERE `entry` IN (27376,27378,27379,27381); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(27376,0,0, 'What do you mean my time has come? I''ll kill you where you stand!',12,0,100,0,0,0, 'Deathguard Schneider before going hostile'), +(27376,1,0, 'Hey, over here!',12,0,100,0,0,0, 'Deathguard Schneider upon LoS'), +(27378,0,0, 'You can''t possibly mean to.... I''ll write you up for this, $C!',12,0,100,0,0,0, 'Senior Scrivener Barriga before going hostile'), +(27378,1,0, 'If you''d be so kind, please let me out of here!',12,0,100,0,0,0, 'Senior Scrivener Barriga upon LoS'), +(27379,0,0, 'No! I beg you! Please don''t kill me!',12,0,100,0,0,0, 'Engineer Burke before going hostile'), +(27379,1,0, 'Can Someone let me out of here? I need to get back to Venomspite and finish my shift.',12,0,100,0,0,0, 'Engineer Burke upon LoS'), +(27381,0,0, 'What is the meaning of this? Stop! I''ll double whatever they''re paying you!',12,0,100,0,0,0, 'Chancellor Amai before going hostile'), +(27381,1,0, 'I just arrived in Venomspite. How could i have possibly wronged you?',12,0,100,0,0,0, 'Chancellor Amai upon Los'); +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (9507,9508,9509,9510); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15,9507,0,0,9,12245,0,0,0, '', 'Deathguard Schneider: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9507,1,0,9,12245,0,0,0, '', 'Deathguard Schneider: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9507,2,0,9,12245,0,0,0, '', 'Deathguard Schneider: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9507,3,0,9,12245,0,0,0, '', 'Deathguard Schneider: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9508,0,0,9,12245,0,0,0, '', 'Senior Scivener Barriga: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9508,1,0,9,12245,0,0,0, '', 'Senior Scivener Barriga: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9508,2,0,9,12245,0,0,0, '', 'Senior Scivener Barriga: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9508,3,0,9,12245,0,0,0, '', 'Senior Scivener Barriga: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9509,0,0,9,12245,0,0,0, '', 'Engineer Burke: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9509,1,0,9,12245,0,0,0, '', 'Engineer Burke: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9509,2,0,9,12245,0,0,0, '', 'Engineer Burke: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9509,3,0,9,12245,0,0,0, '', 'Engineer Burke: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9510,0,0,9,12245,0,0,0, '', 'Chancellor Amai: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9510,1,0,9,12245,0,0,0, '', 'Chancellor Amai: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9510,2,0,9,12245,0,0,0, '', 'Chancellor Amai: Show Gossip only if on quest "No Mercy for the Captured" '), +(15,9510,3,0,9,12245,0,0,0, '', 'Chancellor Amai: Show Gossip only if on quest "No Mercy for the Captured" '); -- cgit v1.2.3 From 1b551cc157a3324e0523abca55138fd7af10b2ca Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 26 Jan 2013 21:31:48 +0000 Subject: Scripts/Commands: Add guild info to .pinfo Original patch by @secharles, modified Closes #8946 --- .../world/2013_01_26_05_world_misc_pinfo.sql | 5 +++++ src/server/game/Miscellaneous/Language.h | 1 + src/server/scripts/Commands/cs_misc.cpp | 23 ++++++++++++++++++++++ .../Database/Implementation/CharacterDatabase.cpp | 1 + .../Database/Implementation/CharacterDatabase.h | 1 + 5 files changed, 31 insertions(+) create mode 100644 sql/updates/world/2013_01_26_05_world_misc_pinfo.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_05_world_misc_pinfo.sql b/sql/updates/world/2013_01_26_05_world_misc_pinfo.sql new file mode 100644 index 00000000000..2c0a28066d4 --- /dev/null +++ b/sql/updates/world/2013_01_26_05_world_misc_pinfo.sql @@ -0,0 +1,5 @@ +DELETE FROM `trinity_string` WHERE `entry`=749; +INSERT INTO `trinity_string` (`entry`, `content_default`) VALUES +(749, 'Guild: %s (%u) Rank: %s Note: %s OffNote: %s'); + +UPDATE `command` SET `help`='Syntax: .pinfo [$player_name/#GUID]\r\n\r\nOutput account information and guild information for selected player or player find by $player_name or #GUID.' WHERE `name`='pinfo'; diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index 8b416339bc7..e13cc86747c 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -522,6 +522,7 @@ enum TrinityStrings LANG_PINFO_BAN = 453, LANG_PINFO_MAP_ONLINE = 714, LANG_PINFO_MAP_OFFLINE = 716, + LANG_PINFO_GUILD_INFO = 749, LANG_YOU_SET_EXPLORE_ALL = 551, LANG_YOU_SET_EXPLORE_NOTHING = 552, diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 3196e81a951..367591080d2 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1734,6 +1734,29 @@ public: else handler->PSendSysMessage(LANG_PINFO_MAP_OFFLINE, map->name[locale], areaName.c_str()); + stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED); + stmt->setUInt32(0, GUID_LOPART(targetGuid)); + + result = CharacterDatabase.Query(stmt); + if (result) + { + uint32 guildId = 0; + std::string guildName = ""; + std::string guildRank = ""; + std::string note = ""; + std::string officeNote = ""; + + Field* fields = result->Fetch(); + guildId = fields[0].GetUInt32(); + guildName = fields[1].GetString(); + //rankId = fields[2].GetUInt8(); + guildRank = fields[3].GetString(); + note = fields[4].GetString(); + officeNote = fields[5].GetString(); + + handler->PSendSysMessage(LANG_PINFO_GUILD_INFO, guildName.c_str(), guildId, guildRank.c_str(), note.c_str(), officeNote.c_str()); + } + return true; } diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.cpp b/src/server/shared/Database/Implementation/CharacterDatabase.cpp index 1c2410b8b53..b3d818c7565 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/shared/Database/Implementation/CharacterDatabase.cpp @@ -101,6 +101,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, "SELECT spell, item, time FROM character_spell_cooldown WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_DECLINEDNAMES, "SELECT genitive, dative, accusative, instrumental, prepositional FROM character_declinedname WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_GUILD_MEMBER, "SELECT guildid, rank FROM guild_member WHERE guid = ?", CONNECTION_BOTH); + PrepareStatement(CHAR_SEL_GUILD_MEMBER_EXTENDED, "SELECT g.guildid, g.name, gm.rank, gr.rname, gm.pnote, gm.offnote FROM guild g JOIN guild_member gm ON g.guildid = gm.guildid JOIN guild_rank gr ON g.guildid = gr.guildid WHERE gm.guid = ?", CONNECTION_BOTH); PrepareStatement(CHAR_SEL_CHARACTER_ACHIEVEMENTS, "SELECT achievement, date FROM character_achievement WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, " diff --git a/src/server/shared/Database/Implementation/CharacterDatabase.h b/src/server/shared/Database/Implementation/CharacterDatabase.h index e4728e19934..7c064a98e17 100644 --- a/src/server/shared/Database/Implementation/CharacterDatabase.h +++ b/src/server/shared/Database/Implementation/CharacterDatabase.h @@ -105,6 +105,7 @@ enum CharacterDatabaseStatements CHAR_SEL_CHARACTER_SPELLCOOLDOWNS, CHAR_SEL_CHARACTER_DECLINEDNAMES, CHAR_SEL_GUILD_MEMBER, + CHAR_SEL_GUILD_MEMBER_EXTENDED, CHAR_SEL_CHARACTER_ARENAINFO, CHAR_SEL_CHARACTER_ACHIEVEMENTS, CHAR_SEL_CHARACTER_CRITERIAPROGRESS, -- cgit v1.2.3 From 3a07f4e17d72ea578e59fff5b87b047103f60362 Mon Sep 17 00:00:00 2001 From: Gacko Date: Sun, 27 Jan 2013 01:51:44 +0100 Subject: DB: Fix import --- sql/updates/world/2013_01_23_02_world_spell_script_names.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_23_02_world_spell_script_names.sql b/sql/updates/world/2013_01_23_02_world_spell_script_names.sql index dd8b35ae420..d56c6ad1c59 100644 --- a/sql/updates/world/2013_01_23_02_world_spell_script_names.sql +++ b/sql/updates/world/2013_01_23_02_world_spell_script_names.sql @@ -19,7 +19,7 @@ DELETE FROM `spell_script_names` WHERE `spell_id` IN ( -29074, -- spell_mage_master_of_elements -9799, -- spell_pal_eye_for_an_eye 20154, -- spell_pal_seal_of_righteousness -21084 -- spell_pal_seal_of_righteousness +21084, -- spell_pal_seal_of_righteousness -47509, -- spell_pri_divine_aegis 55680, -- spell_pri_glyph_of_prayer_of_healing 28305, -- spell_pri_mana_leech -- cgit v1.2.3 From 10bd0adca16d3a021dd46d2139824752270d292e Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sat, 26 Jan 2013 21:41:28 -0500 Subject: DB/Creature: Fixed equipment of Elder Razormaw, he should no longer have a sword as arms --- sql/updates/world/2013_01_26_06_world_creature_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_01_26_06_world_creature_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_06_world_creature_template.sql b/sql/updates/world/2013_01_26_06_world_creature_template.sql new file mode 100644 index 00000000000..e54949744f6 --- /dev/null +++ b/sql/updates/world/2013_01_26_06_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `equipment_id`=0 WHERE `entry`=1019; -- cgit v1.2.3 From 3de933bcb5ffb18a454a1c43ffc3fda4ecfa6ce9 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sat, 26 Jan 2013 22:09:09 -0500 Subject: DB/Gameobject: Added a missing gameobject template --- sql/updates/world/2013_01_26_07_world_gameobject_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_01_26_07_world_gameobject_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_07_world_gameobject_template.sql b/sql/updates/world/2013_01_26_07_world_gameobject_template.sql new file mode 100644 index 00000000000..c85ea1f3128 --- /dev/null +++ b/sql/updates/world/2013_01_26_07_world_gameobject_template.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject_template` WHERE `entry`=175984; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `unkInt32`, `WDBVerified`) VALUES +(175984, 8, 216, 'Cauldron', '', '', '', 4, 10, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15354); -- cgit v1.2.3 From 3a6a02547ceb2a6006b30025f78b58ebe051dc95 Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 27 Jan 2013 04:06:12 +0000 Subject: Update sql/updates/world/2013_01_26_07_world_gameobject_template.sql --- sql/updates/world/2013_01_26_07_world_gameobject_template.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_26_07_world_gameobject_template.sql b/sql/updates/world/2013_01_26_07_world_gameobject_template.sql index c85ea1f3128..c68e48754dc 100644 --- a/sql/updates/world/2013_01_26_07_world_gameobject_template.sql +++ b/sql/updates/world/2013_01_26_07_world_gameobject_template.sql @@ -1,3 +1,3 @@ DELETE FROM `gameobject_template` WHERE `entry`=175984; -INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `unkInt32`, `WDBVerified`) VALUES -(175984, 8, 216, 'Cauldron', '', '', '', 4, 10, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15354); +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `WDBVerified`) VALUES +(175984, 8, 216, 'Cauldron', '', '', '', 4, 10, 2061, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 15354); -- cgit v1.2.3 From 6e80357f8e8b4e820bab8bd05fb8457c3cb46d11 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 27 Jan 2013 17:33:01 +0100 Subject: Core/Authserver: Added possibility to allow realm connections both from "world" and local networks. --- sql/base/auth_database.sql | 2 ++ sql/updates/auth/2013_01_27_00_auth_realmlist.sql | 3 ++ src/server/authserver/Realms/RealmList.cpp | 42 ++++++++++++---------- src/server/authserver/Realms/RealmList.h | 6 ++-- src/server/authserver/Server/AuthSocket.cpp | 30 +++++++++++++++- src/server/authserver/Server/AuthSocket.h | 5 +++ .../Database/Implementation/LoginDatabase.cpp | 2 +- src/server/shared/Utilities/Util.cpp | 16 ++++++++- src/server/shared/Utilities/Util.h | 8 +++++ 9 files changed, 91 insertions(+), 23 deletions(-) create mode 100644 sql/updates/auth/2013_01_27_00_auth_realmlist.sql (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index a052a74c837..5050906b008 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -193,6 +193,8 @@ CREATE TABLE `realmlist` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(32) NOT NULL DEFAULT '', `address` varchar(255) NOT NULL DEFAULT '127.0.0.1', + `localAddress` varchar(255) NOT NULL DEFAULT '127.0.0.1', + `localSubnetMask` varchar(255) NOT NULL DEFAULT '255.255.255.0', `port` smallint(5) unsigned NOT NULL DEFAULT '8085', `icon` tinyint(3) unsigned NOT NULL DEFAULT '0', `flag` tinyint(3) unsigned NOT NULL DEFAULT '2', diff --git a/sql/updates/auth/2013_01_27_00_auth_realmlist.sql b/sql/updates/auth/2013_01_27_00_auth_realmlist.sql new file mode 100644 index 00000000000..0c3b18448e6 --- /dev/null +++ b/sql/updates/auth/2013_01_27_00_auth_realmlist.sql @@ -0,0 +1,3 @@ +ALTER TABLE `realmlist` + ADD `localAddress` varchar(255) NOT NULL DEFAULT '127.0.0.1' AFTER `address`, + ADD `localSubnetMask` varchar(255) NOT NULL DEFAULT '255.255.255.0' AFTER `localAddress`; diff --git a/src/server/authserver/Realms/RealmList.cpp b/src/server/authserver/Realms/RealmList.cpp index 72873e40ce5..b4becc96451 100644 --- a/src/server/authserver/Realms/RealmList.cpp +++ b/src/server/authserver/Realms/RealmList.cpp @@ -31,12 +31,12 @@ void RealmList::Initialize(uint32 updateInterval) UpdateRealms(true); } -void RealmList::UpdateRealm(uint32 ID, const std::string& name, ACE_INET_Addr const& address, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) +void RealmList::UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build) { // Create new if not exist or update existed Realm& realm = m_realms[name]; - realm.m_ID = ID; + realm.m_ID = id; realm.name = name; realm.icon = icon; realm.flag = flag; @@ -45,7 +45,9 @@ void RealmList::UpdateRealm(uint32 ID, const std::string& name, ACE_INET_Addr co realm.populationLevel = popu; // Append port to IP address. - address.addr_to_string(realm.address, ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16); + realm.ExternalAddress = address; + realm.LocalAddress = localAddr; + realm.LocalSubnetMask = localSubmask; realm.gamebuild = build; } @@ -77,23 +79,27 @@ void RealmList::UpdateRealms(bool init) do { Field* fields = result->Fetch(); - uint32 realmId = fields[0].GetUInt32(); - std::string name = fields[1].GetString(); - std::string address = fields[2].GetString(); - uint16 port = fields[3].GetUInt16(); - uint8 icon = fields[4].GetUInt8(); - RealmFlags flag = RealmFlags(fields[5].GetUInt8()); - uint8 timezone = fields[6].GetUInt8(); - uint8 allowedSecurityLevel = fields[7].GetUInt8(); - float pop = fields[8].GetFloat(); - uint32 build = fields[9].GetUInt32(); - - ACE_INET_Addr addr(port, address.c_str(), AF_INET); - - UpdateRealm(realmId, name, addr, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); + uint32 realmId = fields[0].GetUInt32(); + std::string name = fields[1].GetString(); + std::string externalAddress = fields[2].GetString(); + std::string localAddress = fields[3].GetString(); + std::string localSubmask = fields[4].GetString(); + uint16 port = fields[5].GetUInt16(); + uint8 icon = fields[6].GetUInt8(); + RealmFlags flag = RealmFlags(fields[7].GetUInt8()); + uint8 timezone = fields[8].GetUInt8(); + uint8 allowedSecurityLevel = fields[9].GetUInt8(); + float pop = fields[10].GetFloat(); + uint32 build = fields[11].GetUInt32(); + + ACE_INET_Addr externalAddr(port, externalAddress.c_str(), AF_INET); + ACE_INET_Addr localAddr(port, localAddress.c_str(), AF_INET); + ACE_INET_Addr submask(0, localSubmask.c_str(), AF_INET); + + UpdateRealm(realmId, name, externalAddr, localAddr, submask, icon, flag, timezone, (allowedSecurityLevel <= SEC_ADMINISTRATOR ? AccountTypes(allowedSecurityLevel) : SEC_ADMINISTRATOR), pop, build); if (init) - sLog->outInfo(LOG_FILTER_AUTHSERVER, "Added realm \"%s\" at %s.", name.c_str(), m_realms[name].address); + sLog->outInfo(LOG_FILTER_AUTHSERVER, "Added realm \"%s\" at %s:%u.", name.c_str(), m_realms[name].ExternalAddress.get_host_addr(), port); } while (result->NextRow()); } diff --git a/src/server/authserver/Realms/RealmList.h b/src/server/authserver/Realms/RealmList.h index 1949c34df9a..68e6524c334 100644 --- a/src/server/authserver/Realms/RealmList.h +++ b/src/server/authserver/Realms/RealmList.h @@ -40,7 +40,9 @@ enum RealmFlags // Storage object for a realm struct Realm { - char address[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16]; + ACE_INET_Addr ExternalAddress; + ACE_INET_Addr LocalAddress; + ACE_INET_Addr LocalSubnetMask; std::string name; uint8 icon; RealmFlags flag; @@ -72,7 +74,7 @@ public: private: void UpdateRealms(bool init=false); - void UpdateRealm(uint32 ID, const std::string& name, ACE_INET_Addr const& address, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); + void UpdateRealm(uint32 id, const std::string& name, ACE_INET_Addr const& address, ACE_INET_Addr const& localAddr, ACE_INET_Addr const& localSubmask, uint8 icon, RealmFlags flag, uint8 timezone, AccountTypes allowedSecurityLevel, float popu, uint32 build); RealmMap m_realms; uint32 m_UpdateInterval; diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index 8ab4ab8a1a2..b0bce520d4f 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -818,6 +818,28 @@ bool AuthSocket::_HandleReconnectProof() } } +ACE_INET_Addr const& AuthSocket::GetAddressForClient(Realm const& realm, ACE_INET_Addr const& clientAddr) +{ + // Attempt to send best address for client + if (clientAddr.is_loopback()) + { + // Try guessing if realm is also connected locally + if (realm.LocalAddress.is_loopback() || realm.ExternalAddress.is_loopback()) + return clientAddr; + + // Assume that user connecting from the machine that authserver is located on + // has all realms available in his local network + return realm.LocalAddress; + } + + // Check if connecting client is in the same network + if (IsIPAddrInNetwork(realm.LocalAddress, clientAddr, realm.LocalSubnetMask)) + return realm.LocalAddress; + + // Return external IP + return realm.ExternalAddress; +} + // Realm List command handler bool AuthSocket::_HandleRealmList() { @@ -845,6 +867,9 @@ bool AuthSocket::_HandleRealmList() // Update realm list if need sRealmList->UpdateIfNeed(); + ACE_INET_Addr clientAddr; + socket().peer().get_remote_addr(clientAddr); + // Circle through realms in the RealmList and construct the return packet (including # of user characters in each realm) ByteBuffer pkt; @@ -876,6 +901,9 @@ bool AuthSocket::_HandleRealmList() name = ss.str(); } + // We don't need the port number from which client connects with but the realm's port + clientAddr.set_port_number(i->second.ExternalAddress.get_port_number()); + uint8 lock = (i->second.allowedSecurityLevel > _accountSecurityLevel) ? 1 : 0; uint8 AmountOfCharacters = 0; @@ -891,7 +919,7 @@ bool AuthSocket::_HandleRealmList() pkt << lock; // if 1, then realm locked pkt << uint8(flag); // RealmFlags pkt << name; - pkt << i->second.address; + pkt << GetAddressString(GetAddressForClient(i->second, clientAddr)); pkt << i->second.populationLevel; pkt << AmountOfCharacters; pkt << i->second.timezone; // realm category diff --git a/src/server/authserver/Server/AuthSocket.h b/src/server/authserver/Server/AuthSocket.h index 87fd092381e..6c13f85a022 100644 --- a/src/server/authserver/Server/AuthSocket.h +++ b/src/server/authserver/Server/AuthSocket.h @@ -23,6 +23,9 @@ #include "BigNumber.h" #include "RealmSocket.h" +class ACE_INET_Addr; +struct Realm; + // Handle login commands class AuthSocket: public RealmSocket::Session { @@ -36,6 +39,8 @@ public: virtual void OnAccept(void); virtual void OnClose(void); + static ACE_INET_Addr const& GetAddressForClient(Realm const& realm, ACE_INET_Addr const& clientAddr); + bool _HandleLogonChallenge(); bool _HandleLogonProof(); bool _HandleReconnectChallenge(); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 70d509af6fe..3fc6649bd4d 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -22,7 +22,7 @@ void LoginDatabaseConnection::DoPrepareStatements() if (!m_reconnecting) m_stmts.resize(MAX_LOGINDATABASE_STATEMENTS); - PrepareStatement(LOGIN_SEL_REALMLIST, "SELECT id, name, address, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_REALMLIST, "SELECT id, name, address, localAddress, localSubnetMask, port, icon, flag, timezone, allowedSecurityLevel, population, gamebuild FROM realmlist WHERE flag <> 3 ORDER BY name", CONNECTION_SYNCH); PrepareStatement(LOGIN_DEL_EXPIRED_IP_BANS, "DELETE FROM ip_banned WHERE unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_EXPIRED_ACCOUNT_BANS, "UPDATE account_banned SET active = 0 WHERE active = 1 AND unbandate<>bandate AND unbandate<=UNIX_TIMESTAMP()", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_IP_BANNED, "SELECT * FROM ip_banned WHERE ip = ?", CONNECTION_SYNCH); diff --git a/src/server/shared/Utilities/Util.cpp b/src/server/shared/Utilities/Util.cpp index 0d9314c48a3..1bba3c2db09 100644 --- a/src/server/shared/Utilities/Util.cpp +++ b/src/server/shared/Utilities/Util.cpp @@ -22,7 +22,6 @@ #include "SFMT.h" #include "Errors.h" // for ASSERT #include -#include typedef ACE_TSS SFMTRandTSS; static SFMTRandTSS sfmtRand; @@ -239,6 +238,21 @@ bool IsIPAddress(char const* ipaddress) return inet_addr(ipaddress) != INADDR_NONE; } +std::string GetAddressString(ACE_INET_Addr const& addr) +{ + char buf[ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16]; + addr.addr_to_string(buf, ACE_MAX_FULLY_QUALIFIED_NAME_LEN + 16); + return buf; +} + +bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask) +{ + uint32 mask = subnetMask.get_ip_address(); + if ((net.get_ip_address() & mask) == (addr.get_ip_address() & mask)) + return true; + return false; +} + /// create PID file uint32 CreatePIDFile(const std::string& filename) { diff --git a/src/server/shared/Utilities/Util.h b/src/server/shared/Utilities/Util.h index e7218d7ba72..a379bfd32fc 100644 --- a/src/server/shared/Utilities/Util.h +++ b/src/server/shared/Utilities/Util.h @@ -25,6 +25,7 @@ #include #include #include +#include // Searcher for map of structs template struct Finder @@ -343,6 +344,13 @@ void utf8printf(FILE* out, const char *str, ...); void vutf8printf(FILE* out, const char *str, va_list* ap); bool IsIPAddress(char const* ipaddress); + +/// Checks if address belongs to the a network with specified submask +bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask); + +/// Transforms ACE_INET_Addr address into string format "dotted_ip:port" +std::string GetAddressString(ACE_INET_Addr const& addr); + uint32 CreatePIDFile(const std::string& filename); std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false); -- cgit v1.2.3 From eba983c3a05b9e1e4ac58aa199fa424afe3b519d Mon Sep 17 00:00:00 2001 From: Expecto Date: Sun, 27 Jan 2013 17:37:20 +0100 Subject: DB/Creature: Add spawns for Unseen in Duskwood (thanks Expecto for that) DB/SAI: Add SAI for the Unseen's Aura (thx ZxBiohazardZx) --- sql/updates/world/2013_01_27_00_world_creature.sql | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 sql/updates/world/2013_01_27_00_world_creature.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_27_00_world_creature.sql b/sql/updates/world/2013_01_27_00_world_creature.sql new file mode 100644 index 00000000000..11b1863b1e0 --- /dev/null +++ b/sql/updates/world/2013_01_27_00_world_creature.sql @@ -0,0 +1,34 @@ +DELETE FROM `smart_scripts` WHERE `entryorguid`=3094 AND sourcetype=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 +(3094,0,0,0,11,0,100,0,0,0,0,0,11,4986,2,0,0,0,0,1,0,0,0,0,0,0,0,'Unseen - On Respawn - Cast Unseen'); +-- Spawns for Unseen from Sniffs +DELETE FROM `creature` WHERE `id`=3094; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID ,3094,0,1,1,0,0,-10694.8,345.662,44.4895,2.09338,300,0,0,2215,0,0,0,0,0), +(@GUID+01,3094,0,1,1,0,0,-10702.9,360.152,39.7227,4.04982,300,0,0,2215,0,0,0,0,0), +(@GUID+02,3094,0,1,1,0,0,-10707.4,314.112,40.1481,4.46221,300,0,0,2215,0,0,0,0,0), +(@GUID+03,3094,0,1,1,0,0,-11096.8,-960.518,65.3837,0.650136,300,0,0,2292,0,0,0,0,0), +(@GUID+04,3094,0,1,1,0,0,-10800.4,-655.44,41.3178,0.206699,300,0,0,2292,0,0,0,0,0), +(@GUID+05,3094,0,1,1,0,0,-10782.8,-635.116,42.1594,2.53933,300,0,0,2138,0,0,0,0,0), +(@GUID+06,3094,0,1,1,0,0,-10806.6,-616.345,40.0752,4.601,300,0,0,2138,0,0,0,0,0), +(@GUID+07,3094,0,1,1,0,0,-10837.1,-573.623,36.5976,6.13188,300,0,0,2292,0,0,0,0,0), +(@GUID+08,3094,0,1,1,0,0,-10823,-564.998,37.4107,1.71623,300,0,0,2138,0,0,0,0,0), +(@GUID+10,3094,0,1,1,0,0,-10924,446.213,46.2609,5.96992,300,0,0,2138,0,0,0,0,0), +(@GUID+11,3094,0,1,1,0,0,-10747.1,257.103,42.0292,1.18606,300,0,0,2215,0,0,0,0,0), +(@GUID+12,3094,0,1,1,0,0,-10759.6,343.884,38.3282,5.24523,300,0,0,2138,0,0,0,0,0), +(@GUID+13,3094,0,1,1,0,0,-10731.5,364.135,37.2459,4.06321,300,0,0,2138,0,0,0,0,0), +(@GUID+14,3094,0,1,1,0,0,-10701.5,347.995,39.7227,3.22043,300,0,0,2215,0,0,0,0,0), +(@GUID+15,3094,0,1,1,0,0,-10694.8,344.219,39.7097,2.706,300,0,0,2292,0,0,0,0,0), +(@GUID+16,3094,0,1,1,0,0,-10715.6,263.155,43.9056,2.1562,300,0,0,2292,0,0,0,0,0), +(@GUID+17,3094,0,1,1,0,0,-11091.8,-954.163,65.348,1.59261,300,0,0,2215,0,0,0,0,0), +(@GUID+18,3094,0,1,1,0,0,-10937.8,-936.044,76.878,1.18113,300,0,0,2292,0,0,0,0,0), +(@GUID+19,3094,0,1,1,0,0,-10964.1,-949.174,71.1917,2.08064,300,0,0,2292,0,0,0,0,0), +(@GUID+20,3094,0,1,1,0,0,-10934.9,-928.656,72.1262,3.08437,300,0,0,2215,0,0,0,0,0), +(@GUID+21,3094,0,1,1,0,0,-10929.6,-936.748,72.126,2.29741,300,0,0,2292,0,0,0,0,0), +(@GUID+22,3094,0,1,1,0,0,-10798.5,-635.655,41.1281,1.31804,300,0,0,2292,0,0,0,0,0), +(@GUID+23,3094,0,1,1,0,0,-10830.1,-616.585,38.7076,3.76848,300,0,0,2292,0,0,0,0,0), +(@GUID+24,3094,0,1,1,0,0,-10677.6,314.27,33.6022,1.28606,300,0,0,2292,0,0,0,0,0), +(@GUID+25,3094,0,1,1,0,0,-10684.3,314.55,40.7586,3.14353,300,0,0,2138,0,0,0,0,0), +(@GUID+26,3094,0,1,1,0,0,-10368.7,-1258.33,35.9096,0.448286,300,0,0,2138,0,0,0,0,0), +(@GUID+27,3094,0,1,1,0,0,-10347.4,-1287.13,35.3003,1.44967,300,0,0,2138,0,0,0,0,0), +(@GUID+28,3094,0,1,1,0,0,-10368.6,-1290.02,35.303,0.263719,300,0,0,2292,0,0,0,0,0); -- cgit v1.2.3 From b9cb92cc88c54fd93df403fef055fc53a58bd343 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sun, 27 Jan 2013 17:41:26 +0100 Subject: Fix/Commit: push final file, not the workingcopy --- sql/updates/world/2013_01_27_00_world_creature.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_27_00_world_creature.sql b/sql/updates/world/2013_01_27_00_world_creature.sql index 11b1863b1e0..b61ca3250e4 100644 --- a/sql/updates/world/2013_01_27_00_world_creature.sql +++ b/sql/updates/world/2013_01_27_00_world_creature.sql @@ -1,7 +1,8 @@ -DELETE FROM `smart_scripts` WHERE `entryorguid`=3094 AND sourcetype=0 +DELETE FROM `smart_scripts` WHERE `entryorguid`=3094 AND sourcetype=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 (3094,0,0,0,11,0,100,0,0,0,0,0,11,4986,2,0,0,0,0,1,0,0,0,0,0,0,0,'Unseen - On Respawn - Cast Unseen'); -- Spawns for Unseen from Sniffs +SET @GUID:=100173; DELETE FROM `creature` WHERE `id`=3094; INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES (@GUID ,3094,0,1,1,0,0,-10694.8,345.662,44.4895,2.09338,300,0,0,2215,0,0,0,0,0), -- cgit v1.2.3 From 2aa554db34ac58a892059b0994a4b77f2b524c86 Mon Sep 17 00:00:00 2001 From: ZxBiohazardZx Date: Sun, 27 Jan 2013 17:42:44 +0100 Subject: Typo: i will now go hang myself..... _ typo --- sql/updates/world/2013_01_27_00_world_creature.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_27_00_world_creature.sql b/sql/updates/world/2013_01_27_00_world_creature.sql index b61ca3250e4..b60f8f60eba 100644 --- a/sql/updates/world/2013_01_27_00_world_creature.sql +++ b/sql/updates/world/2013_01_27_00_world_creature.sql @@ -1,4 +1,4 @@ -DELETE FROM `smart_scripts` WHERE `entryorguid`=3094 AND sourcetype=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=3094 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 (3094,0,0,0,11,0,100,0,0,0,0,0,11,4986,2,0,0,0,0,1,0,0,0,0,0,0,0,'Unseen - On Respawn - Cast Unseen'); -- Spawns for Unseen from Sniffs -- cgit v1.2.3 From da080ac4e796be6039a239b7e035ead02e73b333 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sun, 27 Jan 2013 13:10:14 -0500 Subject: DB/Gameobjects: Added an another missing Gameobject --- sql/updates/world/2013_01_27_01_world_gameobject_template.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_01_27_01_world_gameobject_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_27_01_world_gameobject_template.sql b/sql/updates/world/2013_01_27_01_world_gameobject_template.sql new file mode 100644 index 00000000000..49bbf3be56a --- /dev/null +++ b/sql/updates/world/2013_01_27_01_world_gameobject_template.sql @@ -0,0 +1,3 @@ +DELETE FROM `gameobject_template` WHERE `entry`=181073; +INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `data0`, `data1`, `data2`, `data3`, `data4`, `data5`, `data6`, `data7`, `data8`, `data9`, `data10`, `data11`, `data12`, `data13`, `data14`, `data15`, `data16`, `data17`, `data18`, `data19`, `data20`, `data21`, `data22`, `data23`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `WDBVerified`) VALUES +(181073, 2, 216, 'Fragrant Cauldron', '', '', '', 93, 7244, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 15211); -- cgit v1.2.3 From 1b180e683e99078322a6f7a604a637cd6afe5b81 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 29 Jan 2013 02:25:24 +0000 Subject: Core&DB/Trainers: Remove `trainer_spell` from `creature_template` since it is not longer necessary on Cata --- .../2013_01_29_00_world_creature_template_434.sql | 1 + src/server/game/Entities/Creature/Creature.cpp | 10 +-- src/server/game/Entities/Creature/Creature.h | 1 - src/server/game/Globals/ObjectMgr.cpp | 87 ++++++++++----------- src/server/scripts/Commands/cs_reload.cpp | 91 +++++++++++----------- .../Database/Implementation/WorldDatabase.cpp | 2 +- 6 files changed, 88 insertions(+), 104 deletions(-) create mode 100644 sql/updates/world/2013_01_29_00_world_creature_template_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_29_00_world_creature_template_434.sql b/sql/updates/world/2013_01_29_00_world_creature_template_434.sql new file mode 100644 index 00000000000..52954b2b9f5 --- /dev/null +++ b/sql/updates/world/2013_01_29_00_world_creature_template_434.sql @@ -0,0 +1 @@ +ALTER TABLE `creature_template` DROP `trainer_spell`; diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index a2bed013640..0157cdf9130 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -925,15 +925,7 @@ bool Creature::isCanTrainingOf(Player* player, bool msg) const } break; case TRAINER_TYPE_TRADESKILLS: - if (GetCreatureTemplate()->trainer_spell && !player->HasSpell(GetCreatureTemplate()->trainer_spell)) - { - if (msg) - { - player->PlayerTalkClass->ClearMenus(); - player->PlayerTalkClass->SendGossipMenu(11031, GetGUID()); - } - return false; - } + // There's no Blacksmith specialization on Cataclysm, conditions are not required for tradeskills break; default: return false; // checked and error output at creature_template loading diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 9ac5deb56f5..255014a7bbf 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -109,7 +109,6 @@ struct CreatureTemplate uint32 dynamicflags; uint32 family; // enum CreatureFamily values (optional) uint32 trainer_type; - uint32 trainer_spell; uint32 trainer_class; uint32 trainer_race; float minrangedmg; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 05d986e3f92..c4721f3cc09 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -390,15 +390,15 @@ void ObjectMgr::LoadCreatureTemplates() "modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, exp_unk, faction_A, faction_H, npcflag, speed_walk, " // 22 23 24 25 26 27 28 29 30 31 32 33 34 "speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, " - // 35 36 37 38 39 40 41 42 43 44 - "dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " - // 45 46 47 48 49 50 51 52 53 54 55 + // 35 36 37 38 39 40 41 42 43 + "dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, " + // 44 45 46 47 48 49 50 51 52 53 54 "type_flags, type_flags2, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, " - // 56 57 58 59 60 61 62 63 64 65 66 67 68 69 + // 55 56 59 60 61 62 63 64 65 66 67 68 69 70 "spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, " - // 70 71 72 73 74 75 76 77 78 79 80 81 + // 71 72 73 74 75 76 77 78 79 80 81 82 "InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, " - // 82 83 84 85 86 87 88 + // 83 84 85 86 87 88 89 " questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName " "FROM creature_template;"); @@ -459,48 +459,47 @@ void ObjectMgr::LoadCreatureTemplates() creatureTemplate.dynamicflags = fields[35].GetUInt32(); creatureTemplate.family = uint32(fields[36].GetUInt8()); creatureTemplate.trainer_type = uint32(fields[37].GetUInt8()); - creatureTemplate.trainer_spell = fields[38].GetUInt32(); - creatureTemplate.trainer_class = uint32(fields[39].GetUInt8()); - creatureTemplate.trainer_race = uint32(fields[40].GetUInt8()); - creatureTemplate.minrangedmg = fields[41].GetFloat(); - creatureTemplate.maxrangedmg = fields[42].GetFloat(); - creatureTemplate.rangedattackpower = uint32(fields[43].GetUInt16()); - creatureTemplate.type = uint32(fields[44].GetUInt8()); - creatureTemplate.type_flags = fields[45].GetUInt32(); - creatureTemplate.type_flags2 = fields[46].GetUInt32(); - creatureTemplate.lootid = fields[47].GetUInt32(); - creatureTemplate.pickpocketLootId = fields[48].GetUInt32(); - creatureTemplate.SkinLootId = fields[49].GetUInt32(); + creatureTemplate.trainer_class = uint32(fields[38].GetUInt8()); + creatureTemplate.trainer_race = uint32(fields[39].GetUInt8()); + creatureTemplate.minrangedmg = fields[40].GetFloat(); + creatureTemplate.maxrangedmg = fields[41].GetFloat(); + creatureTemplate.rangedattackpower = uint32(fields[42].GetUInt16()); + creatureTemplate.type = uint32(fields[43].GetUInt8()); + creatureTemplate.type_flags = fields[44].GetUInt32(); + creatureTemplate.type_flags2 = fields[45].GetUInt32(); + creatureTemplate.lootid = fields[46].GetUInt32(); + creatureTemplate.pickpocketLootId = fields[47].GetUInt32(); + creatureTemplate.SkinLootId = fields[48].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - creatureTemplate.resistance[i] = fields[50 + i - 1].GetInt16(); + creatureTemplate.resistance[i] = fields[49 + i - 1].GetInt16(); for (uint8 i = 0; i < CREATURE_MAX_SPELLS; ++i) - creatureTemplate.spells[i] = fields[56 + i].GetUInt32(); - - creatureTemplate.PetSpellDataId = fields[64].GetUInt32(); - creatureTemplate.VehicleId = fields[65].GetUInt32(); - creatureTemplate.mingold = fields[66].GetUInt32(); - creatureTemplate.maxgold = fields[67].GetUInt32(); - creatureTemplate.AIName = fields[68].GetString(); - creatureTemplate.MovementType = uint32(fields[69].GetUInt8()); - creatureTemplate.InhabitType = uint32(fields[70].GetUInt8()); - creatureTemplate.HoverHeight = fields[71].GetFloat(); - creatureTemplate.ModHealth = fields[72].GetFloat(); - creatureTemplate.ModMana = fields[73].GetFloat(); - creatureTemplate.ModManaExtra = fields[74].GetFloat(); - creatureTemplate.ModArmor = fields[75].GetFloat(); - creatureTemplate.RacialLeader = fields[76].GetBool(); + creatureTemplate.spells[i] = fields[55 + i].GetUInt32(); + + creatureTemplate.PetSpellDataId = fields[63].GetUInt32(); + creatureTemplate.VehicleId = fields[64].GetUInt32(); + creatureTemplate.mingold = fields[65].GetUInt32(); + creatureTemplate.maxgold = fields[66].GetUInt32(); + creatureTemplate.AIName = fields[67].GetString(); + creatureTemplate.MovementType = uint32(fields[68].GetUInt8()); + creatureTemplate.InhabitType = uint32(fields[69].GetUInt8()); + creatureTemplate.HoverHeight = fields[70].GetFloat(); + creatureTemplate.ModHealth = fields[71].GetFloat(); + creatureTemplate.ModMana = fields[72].GetFloat(); + creatureTemplate.ModManaExtra = fields[73].GetFloat(); + creatureTemplate.ModArmor = fields[74].GetFloat(); + creatureTemplate.RacialLeader = fields[75].GetBool(); for (uint8 i = 0; i < MAX_CREATURE_QUEST_ITEMS; ++i) - creatureTemplate.questItems[i] = fields[77 + i].GetUInt32(); + creatureTemplate.questItems[i] = fields[76 + i].GetUInt32(); - creatureTemplate.movementId = fields[83].GetUInt32(); - creatureTemplate.RegenHealth = fields[84].GetBool(); - creatureTemplate.equipmentId = fields[85].GetUInt32(); - creatureTemplate.MechanicImmuneMask = fields[86].GetUInt32(); - creatureTemplate.flags_extra = fields[87].GetUInt32(); - creatureTemplate.ScriptID = GetScriptId(fields[88].GetCString()); + creatureTemplate.movementId = fields[82].GetUInt32(); + creatureTemplate.RegenHealth = fields[83].GetBool(); + creatureTemplate.equipmentId = fields[84].GetUInt32(); + creatureTemplate.MechanicImmuneMask = fields[85].GetUInt32(); + creatureTemplate.flags_extra = fields[86].GetUInt32(); + creatureTemplate.ScriptID = GetScriptId(fields[87].GetCString()); ++count; } @@ -662,12 +661,6 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo) continue; } - if (cInfo->trainer_spell != difficultyInfo->trainer_spell) - { - sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) has different `trainer_spell` in difficulty %u mode (Entry: %u).", cInfo->Entry, diff + 1, cInfo->DifficultyEntry[diff]); - continue; - } - if (!difficultyInfo->AIName.empty()) { sLog->outError(LOG_FILTER_SQL, "Creature (Entry: %u) lists difficulty %u mode entry %u with `AIName` filled in. `AIName` of difficulty 0 mode creature is always used instead.", diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index f5f998bbf0d..52721f9866d 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -452,54 +452,53 @@ public: cInfo->dynamicflags = fields[33].GetUInt32(); cInfo->family = fields[34].GetUInt8(); cInfo->trainer_type = fields[35].GetUInt8(); - cInfo->trainer_spell = fields[36].GetUInt32(); - cInfo->trainer_class = fields[37].GetUInt8(); - cInfo->trainer_race = fields[38].GetUInt8(); - cInfo->minrangedmg = fields[39].GetFloat(); - cInfo->maxrangedmg = fields[40].GetFloat(); - cInfo->rangedattackpower = fields[41].GetUInt16(); - cInfo->type = fields[42].GetUInt8(); - cInfo->type_flags = fields[43].GetUInt32(); - cInfo->lootid = fields[44].GetUInt32(); - cInfo->pickpocketLootId = fields[45].GetUInt32(); - cInfo->SkinLootId = fields[46].GetUInt32(); + cInfo->trainer_class = fields[36].GetUInt8(); + cInfo->trainer_race = fields[37].GetUInt8(); + cInfo->minrangedmg = fields[38].GetFloat(); + cInfo->maxrangedmg = fields[39].GetFloat(); + cInfo->rangedattackpower = fields[40].GetUInt16(); + cInfo->type = fields[41].GetUInt8(); + cInfo->type_flags = fields[42].GetUInt32(); + cInfo->lootid = fields[43].GetUInt32(); + cInfo->pickpocketLootId = fields[44].GetUInt32(); + cInfo->SkinLootId = fields[45].GetUInt32(); for (uint8 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i) - cInfo->resistance[i] = fields[47 + i -1].GetUInt16(); - - cInfo->spells[0] = fields[53].GetUInt32(); - cInfo->spells[1] = fields[54].GetUInt32(); - cInfo->spells[2] = fields[55].GetUInt32(); - cInfo->spells[3] = fields[56].GetUInt32(); - cInfo->spells[4] = fields[57].GetUInt32(); - cInfo->spells[5] = fields[58].GetUInt32(); - cInfo->spells[6] = fields[59].GetUInt32(); - cInfo->spells[7] = fields[60].GetUInt32(); - cInfo->PetSpellDataId = fields[61].GetUInt32(); - cInfo->VehicleId = fields[62].GetUInt32(); - cInfo->mingold = fields[63].GetUInt32(); - cInfo->maxgold = fields[64].GetUInt32(); - cInfo->AIName = fields[65].GetString(); - cInfo->MovementType = fields[66].GetUInt8(); - cInfo->InhabitType = fields[67].GetUInt8(); - cInfo->HoverHeight = fields[68].GetFloat(); - cInfo->ModHealth = fields[69].GetFloat(); - cInfo->ModMana = fields[70].GetFloat(); - cInfo->ModManaExtra = fields[71].GetFloat(); - cInfo->ModArmor = fields[72].GetFloat(); - cInfo->RacialLeader = fields[73].GetBool(); - cInfo->questItems[0] = fields[74].GetUInt32(); - cInfo->questItems[1] = fields[75].GetUInt32(); - cInfo->questItems[2] = fields[76].GetUInt32(); - cInfo->questItems[3] = fields[77].GetUInt32(); - cInfo->questItems[4] = fields[78].GetUInt32(); - cInfo->questItems[5] = fields[79].GetUInt32(); - cInfo->movementId = fields[80].GetUInt32(); - cInfo->RegenHealth = fields[81].GetBool(); - cInfo->equipmentId = fields[82].GetUInt32(); - cInfo->MechanicImmuneMask = fields[83].GetUInt32(); - cInfo->flags_extra = fields[84].GetUInt32(); - cInfo->ScriptID = sObjectMgr->GetScriptId(fields[85].GetCString()); + cInfo->resistance[i] = fields[46 + i -1].GetUInt16(); + + cInfo->spells[0] = fields[52].GetUInt32(); + cInfo->spells[1] = fields[53].GetUInt32(); + cInfo->spells[2] = fields[54].GetUInt32(); + cInfo->spells[3] = fields[55].GetUInt32(); + cInfo->spells[4] = fields[56].GetUInt32(); + cInfo->spells[5] = fields[57].GetUInt32(); + cInfo->spells[6] = fields[58].GetUInt32(); + cInfo->spells[7] = fields[59].GetUInt32(); + cInfo->PetSpellDataId = fields[60].GetUInt32(); + cInfo->VehicleId = fields[61].GetUInt32(); + cInfo->mingold = fields[62].GetUInt32(); + cInfo->maxgold = fields[63].GetUInt32(); + cInfo->AIName = fields[64].GetString(); + cInfo->MovementType = fields[65].GetUInt8(); + cInfo->InhabitType = fields[66].GetUInt8(); + cInfo->HoverHeight = fields[67].GetFloat(); + cInfo->ModHealth = fields[68].GetFloat(); + cInfo->ModMana = fields[69].GetFloat(); + cInfo->ModManaExtra = fields[70].GetFloat(); + cInfo->ModArmor = fields[71].GetFloat(); + cInfo->RacialLeader = fields[72].GetBool(); + cInfo->questItems[0] = fields[73].GetUInt32(); + cInfo->questItems[1] = fields[74].GetUInt32(); + cInfo->questItems[2] = fields[75].GetUInt32(); + cInfo->questItems[3] = fields[76].GetUInt32(); + cInfo->questItems[4] = fields[77].GetUInt32(); + cInfo->questItems[5] = fields[78].GetUInt32(); + cInfo->movementId = fields[79].GetUInt32(); + cInfo->RegenHealth = fields[80].GetBool(); + cInfo->equipmentId = fields[81].GetUInt32(); + cInfo->MechanicImmuneMask = fields[82].GetUInt32(); + cInfo->flags_extra = fields[83].GetUInt32(); + cInfo->ScriptID = sObjectMgr->GetScriptId(fields[84].GetCString()); sObjectMgr->CheckCreatureTemplate(cInfo); } diff --git a/src/server/shared/Database/Implementation/WorldDatabase.cpp b/src/server/shared/Database/Implementation/WorldDatabase.cpp index 899ed51da0d..185ac647e33 100644 --- a/src/server/shared/Database/Implementation/WorldDatabase.cpp +++ b/src/server/shared/Database/Implementation/WorldDatabase.cpp @@ -78,7 +78,7 @@ void WorldDatabaseConnection::DoPrepareStatements() PrepareStatement(WORLD_INS_CREATURE_TRANSPORT, "INSERT INTO creature_transport (guid, npc_entry, transport_entry, TransOffsetX, TransOffsetY, TransOffsetZ, TransOffsetO) values (?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(WORLD_UPD_CREATURE_TRANSPORT_EMOTE, "UPDATE creature_transport SET emote = ? WHERE transport_entry = ? AND guid = ?", CONNECTION_ASYNC); PrepareStatement(WORLD_SEL_COMMANDS, "SELECT name, security, help FROM command", CONNECTION_SYNCH); - PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_spell, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); + PrepareStatement(WORLD_SEL_CREATURE_TEMPLATE, "SELECT difficulty_entry_1, difficulty_entry_2, difficulty_entry_3, KillCredit1, KillCredit2, modelid1, modelid2, modelid3, modelid4, name, subname, IconName, gossip_menu_id, minlevel, maxlevel, exp, faction_A, faction_H, npcflag, speed_walk, speed_run, scale, rank, mindmg, maxdmg, dmgschool, attackpower, dmg_multiplier, baseattacktime, rangeattacktime, unit_class, unit_flags, unit_flags2, dynamicflags, family, trainer_type, trainer_class, trainer_race, minrangedmg, maxrangedmg, rangedattackpower, type, type_flags, lootid, pickpocketloot, skinloot, resistance1, resistance2, resistance3, resistance4, resistance5, resistance6, spell1, spell2, spell3, spell4, spell5, spell6, spell7, spell8, PetSpellDataId, VehicleId, mingold, maxgold, AIName, MovementType, InhabitType, HoverHeight, Health_mod, Mana_mod, Mana_mod_extra, Armor_mod, RacialLeader, questItem1, questItem2, questItem3, questItem4, questItem5, questItem6, movementId, RegenHealth, equipment_id, mechanic_immune_mask, flags_extra, ScriptName FROM creature_template WHERE entry = ?", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_WAYPOINT_SCRIPT_BY_ID, "SELECT guid, delay, command, datalong, datalong2, dataint, x, y, z, o FROM waypoint_scripts WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_IP2NATION_COUNTRY, "SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < ? AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1", CONNECTION_SYNCH); PrepareStatement(WORLD_SEL_ITEM_TEMPLATE_BY_NAME, "SELECT entry FROM item_template WHERE name = ?", CONNECTION_SYNCH); -- cgit v1.2.3 From 5040fd2558aa259d7280ae40af54b698a17c482b Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Mon, 28 Jan 2013 21:59:12 -0500 Subject: DB/Gameobjects: Set proper state for ToCr doors and fixed looting of Venomhide Egg & Discarded Soul Crystal --- sql/updates/world/2013_01_28_00_world_gameobject.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2013_01_28_00_world_gameobject.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_28_00_world_gameobject.sql b/sql/updates/world/2013_01_28_00_world_gameobject.sql new file mode 100644 index 00000000000..3f49d799c62 --- /dev/null +++ b/sql/updates/world/2013_01_28_00_world_gameobject.sql @@ -0,0 +1,8 @@ +-- Doors should be closed +UPDATE `gameobject` SET `state`=1 WHERE `guid` IN (150074, 150073, 150077); + +-- Duplicated Gameobject +DELETE FROM `gameobject` WHERE `guid`=150081; + +-- Fix loots +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry` IN (27310, 27239); -- cgit v1.2.3 From 8183f70ae0635862c460fb63e88e930076947843 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Tue, 29 Jan 2013 05:14:02 +0200 Subject: DB/Loot: Add Cache of the Ley-Guardian to heroic Oculus loot when RDF aura is present. Closes #6927 --- sql/updates/world/2013_01_29_00_world_gameobject_loot_template.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 sql/updates/world/2013_01_29_00_world_gameobject_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_29_00_world_gameobject_loot_template.sql b/sql/updates/world/2013_01_29_00_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..32146fb9ef8 --- /dev/null +++ b/sql/updates/world/2013_01_29_00_world_gameobject_loot_template.sql @@ -0,0 +1,7 @@ +DELETE FROM `gameobject_loot_template` WHERE `entry`=24524 AND `item`=52676; +INSERT INTO `gameobject_loot_template` (`entry`,`item`,`ChanceOrQuestChance`,`lootmode`,`groupid`,`mincountOrRef`,`maxcount`) VALUES +(24524,52676,100,1,0,1,1); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=4 AND `SourceGroup`=24524 AND `SourceEntry`=52676; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(4,24524,52676,0,0,1,0,72221,0,0,0,0,0,'','Loot Cache of the Ley-Guardian only when aura Luck of the Draw applied'); -- cgit v1.2.3 From 76910472d824a409adefc774604653e78c7d1041 Mon Sep 17 00:00:00 2001 From: FH3095 Date: Tue, 29 Jan 2013 15:02:54 +0000 Subject: DB/Achievements: Fix Portal Jockey Current Status: Portal Jockey(10) is rewarded from 10nh and 25nh, Portal Jockey(25) is rewarded from 10hc and 25hc. Reason: Achievement-criteria 12971 is required for Portal Jockey(25), but checks for map-difficulty 2=10hc. On the other side achievment-criteria 12979 is required for Portal Jockey(10), but checks for map-difficulty 1=25nh. Closes #9081 Ref #6810 --- sql/updates/world/2013_01_29_01_world_achievement_criteria_data.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2013_01_29_01_world_achievement_criteria_data.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_29_01_world_achievement_criteria_data.sql b/sql/updates/world/2013_01_29_01_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..39627a943cc --- /dev/null +++ b/sql/updates/world/2013_01_29_01_world_achievement_criteria_data.sql @@ -0,0 +1,2 @@ +UPDATE `achievement_criteria_data` SET `value1`=2 WHERE `criteria_id`=12979 AND `type`=12; +UPDATE `achievement_criteria_data` SET `value1`=1 WHERE `criteria_id`=12971 AND `type`=12; -- cgit v1.2.3 From 02814975732f8e919d33ff8f2cbaf98f13e04f91 Mon Sep 17 00:00:00 2001 From: Nay Date: Tue, 29 Jan 2013 23:48:39 +0000 Subject: DB/Loot: Fix 9 drop chance in gameobject_template (7 quests should be fixed by this) If a GO with flags 4 drops a quest item, ChanceOrQuestChance for that items needs to be negative Query used to find the issue: ``` SELECT * FROM `gameobject_loot_template` WHERE (`item` IN (SELECT `questItem1` FROM `gameobject_template` WHERE (`flags` & 4) != 0) OR `item` IN (SELECT `questItem2` FROM `gameobject_template` WHERE (`flags` & 4) != 0) OR `item` IN (SELECT `questItem3` FROM `gameobject_template` WHERE (`flags` & 4) != 0) OR `item` IN (SELECT `questItem4` FROM `gameobject_template` WHERE (`flags` & 4) != 0) OR `item` IN (SELECT `questItem5` FROM `gameobject_template` WHERE (`flags` & 4) != 0) OR `item` IN (SELECT `questItem6` FROM `gameobject_template` WHERE (`flags` & 4) != 0)) AND `ChanceOrQuestChance` > 0; ``` --- .../world/2013_01_29_02_world_gameobject_loot_template.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 sql/updates/world/2013_01_29_02_world_gameobject_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_29_02_world_gameobject_loot_template.sql b/sql/updates/world/2013_01_29_02_world_gameobject_loot_template.sql new file mode 100644 index 00000000000..c3f2d0f0fb9 --- /dev/null +++ b/sql/updates/world/2013_01_29_02_world_gameobject_loot_template.sql @@ -0,0 +1,9 @@ +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=27310 AND `item`=47035; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=27239 AND `item`=46364; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=24589 AND `item`=43697; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=26666 AND `item`=44319; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=26667 AND `item`=44320; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=26668 AND `item`=44321; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=26878 AND `item`=45062; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=27725 AND `item`=49648; +UPDATE `gameobject_loot_template` SET `ChanceOrQuestChance`=-100 WHERE `entry`=27723 AND `item`=49678; -- cgit v1.2.3 From b427068c39188474879c848ba44070ef8a1e246b Mon Sep 17 00:00:00 2001 From: Shocker Date: Wed, 30 Jan 2013 07:05:19 +0200 Subject: Core/Titles: There are now 4 title fields (only 2 titles for now, Ruthless and Cataclysmic Gladiator). Also remove some unused outdated defines WARNING! Run the SQL query before you start your emulator because it will reset all titles on login otherwise --- .../2013_01_30_00_characters_characters.sql | 2 + src/server/game/Entities/Player/Player.h | 49 +--------------------- 2 files changed, 4 insertions(+), 47 deletions(-) create mode 100644 sql/updates/characters/2013_01_30_00_characters_characters.sql (limited to 'sql') diff --git a/sql/updates/characters/2013_01_30_00_characters_characters.sql b/sql/updates/characters/2013_01_30_00_characters_characters.sql new file mode 100644 index 00000000000..1ddb4c8900d --- /dev/null +++ b/sql/updates/characters/2013_01_30_00_characters_characters.sql @@ -0,0 +1,2 @@ +-- Add missing fields for new titles field +UPDATE `characters` SET knownTitles = CONCAT(knownTitles, '0 0 ') WHERE (LENGTH(knownTitles) - LENGTH(REPLACE(knownTitles, ' ', ''))) = 6; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 511c3356b15..979dfc42040 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -531,53 +531,8 @@ enum PlayerFlags PLAYER_FLAGS_UNK31 = 0x80000000 }; -// used for PLAYER__FIELD_KNOWN_TITLES field (uint64), (1< Date: Wed, 30 Jan 2013 13:09:41 +0200 Subject: Add Mute reason and mute by to the db so you can get this info from the db with the pinfo command when player get muted. old LOGIN_UPD_MUTE_TIME change to LOGIN_UPD_MUTE_TIME_LOGIN due the use of it when character login to world. --- sql/base/auth_database.sql | 2 ++ sql/updates/auth/2013_xx_xx_00_auth_account.sql | 3 +++ .../world/2013_xx_xx_00_world_trinity_string.sql | 4 ++++ src/server/game/Server/WorldSocket.cpp | 2 +- src/server/scripts/Commands/cs_misc.cpp | 21 +++++++++++++++++---- .../Database/Implementation/LoginDatabase.cpp | 5 +++-- .../shared/Database/Implementation/LoginDatabase.h | 1 + 7 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 sql/updates/auth/2013_xx_xx_00_auth_account.sql create mode 100644 sql/updates/world/2013_xx_xx_00_world_trinity_string.sql (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 5050906b008..e5ba6356da9 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -38,6 +38,8 @@ CREATE TABLE `account` ( `online` tinyint(3) unsigned NOT NULL DEFAULT '0', `expansion` tinyint(3) unsigned NOT NULL DEFAULT '2', `mutetime` bigint(20) NOT NULL DEFAULT '0', + `mutereason` VARCHAR(255) NOT NULL DEFAULT '', + `muteby` VARCHAR(50) NOT NULL DEFAULT '', `locale` tinyint(3) unsigned NOT NULL DEFAULT '0', `os` varchar(3) NOT NULL DEFAULT '', `recruiter` int(10) unsigned NOT NULL DEFAULT '0', diff --git a/sql/updates/auth/2013_xx_xx_00_auth_account.sql b/sql/updates/auth/2013_xx_xx_00_auth_account.sql new file mode 100644 index 00000000000..fa893915716 --- /dev/null +++ b/sql/updates/auth/2013_xx_xx_00_auth_account.sql @@ -0,0 +1,3 @@ +ALTER TABLE `account` + ADD COLUMN `mutereason` VARCHAR(255) NOT NULL DEFAULT '' AFTER `mutetime`, + ADD COLUMN `muteby` VARCHAR(50) NOT NULL DEFAULT '' AFTER `mutereason`; \ No newline at end of file diff --git a/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql b/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql new file mode 100644 index 00000000000..5c531a0895d --- /dev/null +++ b/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql @@ -0,0 +1,4 @@ +DELETE FROM `trinity_string` WHERE entry IN (300,550); +INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES +('300','Your chat has been disabled for %u minutes. By: %s ,Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('550','Mute time remaining: %s, By: %s, Reason: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index c80d25be139..74c2dceadf0 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -837,7 +837,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) { mutetime = time(NULL) + llabs(mutetime); - PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME_LOGIN); stmt->setInt64(0, mutetime); stmt->setUInt32(1, id); diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 367591080d2..973d466bab5 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -1550,6 +1550,8 @@ public: std::string userName = handler->GetTrinityString(LANG_ERROR); std::string eMail = handler->GetTrinityString(LANG_ERROR); + std::string muteReason = ""; + std::string muteBy = ""; std::string lastIp = handler->GetTrinityString(LANG_ERROR); uint32 security = 0; std::string lastLogin = handler->GetTrinityString(LANG_ERROR); @@ -1566,6 +1568,8 @@ public: security = fields[1].GetUInt8(); eMail = fields[2].GetString(); muteTime = fields[5].GetUInt64(); + muteReason = fields[6].GetString(); + muteBy = fields[7].GetString(); if (eMail.empty()) eMail = "-"; @@ -1627,7 +1631,7 @@ public: } if (muteTime > 0) - handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str()); + handler->PSendSysMessage(LANG_PINFO_MUTE, secsToTimeString(muteTime - time(NULL), true).c_str(), muteBy.c_str(), muteReason.c_str()); if (banTime >= 0) handler->PSendSysMessage(LANG_PINFO_BAN, banTime > 0 ? secsToTimeString(banTime - time(NULL), true).c_str() : "permanently", bannedby.c_str(), banreason.c_str()); @@ -1826,6 +1830,11 @@ public: return false; PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); + std::string muteBy = ""; + if (handler->GetSession()) + muteBy = handler->GetSession()->GetPlayerName(); + else + muteBy = "Console"; if (target) { @@ -1833,7 +1842,7 @@ public: int64 muteTime = time(NULL) + notSpeakTime * MINUTE; target->GetSession()->m_muteTime = muteTime; stmt->setInt64(0, muteTime); - ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteReasonStr.c_str()); + ChatHandler(target->GetSession()).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notSpeakTime, muteBy.c_str(), muteReasonStr.c_str()); } else { @@ -1842,7 +1851,9 @@ public: stmt->setInt64(0, muteTime); } - stmt->setUInt32(1, accountId); + stmt->setString(1, muteReasonStr.c_str()); + stmt->setString(2, muteBy.c_str()); + stmt->setUInt32(3, accountId); LoginDatabase.Execute(stmt); std::string nameLink = handler->playerLink(targetName); @@ -1885,7 +1896,9 @@ public: PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_MUTE_TIME); stmt->setInt64(0, 0); - stmt->setUInt32(1, accountId); + stmt->setString(1, ""); + stmt->setString(2, ""); + stmt->setUInt32(3, accountId); LoginDatabase.Execute(stmt); if (target) diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 227680b2d6b..4e1d448a21f 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -62,7 +62,8 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_INS_LOG, "INSERT INTO logs (time, realm, type, level, string) VALUES (?, ?, ?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_USERNAME, "UPDATE account SET v = 0, s = 0, username = ?, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_PASSWORD, "UPDATE account SET v = 0, s = 0, sha_pass_hash = ? WHERE id = ?", CONNECTION_ASYNC); - PrepareStatement(LOGIN_UPD_MUTE_TIME, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_MUTE_TIME, "UPDATE account SET mutetime = ? , mutereason = ? , muteby = ? WHERE id = ?", CONNECTION_ASYNC); + PrepareStatement(LOGIN_UPD_MUTE_TIME_LOGIN, "UPDATE account SET mutetime = ? WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_LAST_IP, "UPDATE account SET last_ip = ? WHERE username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_ACCOUNT_ONLINE, "UPDATE account SET online = 1 WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_UPTIME_PLAYERS, "UPDATE uptime SET uptime = ?, maxplayers = ? WHERE realmid = ? AND starttime = ?", CONNECTION_ASYNC); @@ -76,7 +77,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_GET_USERNAME_BY_ID, "SELECT username FROM account WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_CHECK_PASSWORD, "SELECT 1 FROM account WHERE id = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME, "SELECT 1 FROM account WHERE username = ? AND sha_pass_hash = ?", CONNECTION_SYNCH); - PrepareStatement(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_PINFO, "SELECT a.username, aa.gmlevel, a.email, a.last_ip, DATE_FORMAT(a.last_login, '%Y-%m-%d %T'), a.mutetime, a.mutereason, a.muteby FROM account a LEFT JOIN account_access aa ON (a.id = aa.id AND (aa.RealmID = ? OR aa.RealmID = -1)) WHERE a.id = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_PINFO_BANS, "SELECT unbandate, bandate = unbandate, bannedby, banreason FROM account_banned WHERE id = ? AND active ORDER BY bandate ASC LIMIT 1", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_GM_ACCOUNTS, "SELECT a.username, aa.gmlevel FROM account a, account_access aa WHERE a.id=aa.id AND aa.gmlevel >= ? AND (aa.realmid = -1 OR aa.realmid = ?)", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_INFO, "SELECT a.username, a.last_ip, aa.gmlevel, a.expansion FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.id = ?", CONNECTION_SYNCH); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 798016d553d..4199bd5556a 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -83,6 +83,7 @@ enum LoginDatabaseStatements LOGIN_UPD_USERNAME, LOGIN_UPD_PASSWORD, LOGIN_UPD_MUTE_TIME, + LOGIN_UPD_MUTE_TIME_LOGIN, LOGIN_UPD_LAST_IP, LOGIN_UPD_ACCOUNT_ONLINE, LOGIN_UPD_UPTIME_PLAYERS, -- cgit v1.2.3 From 2ffeaec443003d84a9787563fc8bed29276c8778 Mon Sep 17 00:00:00 2001 From: Emo Date: Wed, 30 Jan 2013 14:51:40 +0100 Subject: DB/Auth: Fix typo in sql/base/auth_database.sql ERROR 1136 (21S01) at line 216: Column count doesn't match value count at row 1 --- sql/base/auth_database.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 5050906b008..75626cb2097 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -213,7 +213,7 @@ CREATE TABLE `realmlist` ( LOCK TABLES `realmlist` WRITE; /*!40000 ALTER TABLE `realmlist` DISABLE KEYS */; -INSERT INTO `realmlist` VALUES (1,'Trinity','127.0.0.1',8085,1,0,1,0,0,12340); +INSERT INTO `realmlist` VALUES (1,'Trinity','127.0.0.1','127.0.0.1','255.255.255.0',8085,1,0,1,0,0,12340); /*!40000 ALTER TABLE `realmlist` ENABLE KEYS */; UNLOCK TABLES; -- cgit v1.2.3 From 83e3bf6d6d76156f36f3eaec28ef2244f9826fdf Mon Sep 17 00:00:00 2001 From: Bezo Date: Thu, 31 Jan 2013 00:30:29 +0200 Subject: Remove \ No newline at end of file --- sql/updates/auth/2013_xx_xx_00_auth_account.sql | 2 +- sql/updates/world/2013_xx_xx_00_world_trinity_string.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/updates/auth/2013_xx_xx_00_auth_account.sql b/sql/updates/auth/2013_xx_xx_00_auth_account.sql index fa893915716..9af73d41ee3 100644 --- a/sql/updates/auth/2013_xx_xx_00_auth_account.sql +++ b/sql/updates/auth/2013_xx_xx_00_auth_account.sql @@ -1,3 +1,3 @@ ALTER TABLE `account` ADD COLUMN `mutereason` VARCHAR(255) NOT NULL DEFAULT '' AFTER `mutetime`, - ADD COLUMN `muteby` VARCHAR(50) NOT NULL DEFAULT '' AFTER `mutereason`; \ No newline at end of file + ADD COLUMN `muteby` VARCHAR(50) NOT NULL DEFAULT '' AFTER `mutereason`; diff --git a/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql b/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql index 5c531a0895d..0a4ec437b28 100644 --- a/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql +++ b/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql @@ -1,4 +1,4 @@ DELETE FROM `trinity_string` WHERE entry IN (300,550); INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES ('300','Your chat has been disabled for %u minutes. By: %s ,Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -('550','Mute time remaining: %s, By: %s, Reason: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); \ No newline at end of file +('550','Mute time remaining: %s, By: %s, Reason: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -- cgit v1.2.3 From a4b1f1c45fc8a1e28b76ffbbd0e73e6452c0785b Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 31 Jan 2013 00:20:54 +0100 Subject: Spells/Warlock: Fixed Conflagrate, Demon Soul and Immolate. --- .../2013_01_31_00_world_spell_script_names_434.sql | 6 + src/server/scripts/Spells/spell_warlock.cpp | 150 +++++++++++++++++++++ 2 files changed, 156 insertions(+) create mode 100644 sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql new file mode 100644 index 00000000000..14bf9f1832a --- /dev/null +++ b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_demon_soul', 'spell_warl_conflagrate', 'spell_warl_fel_flame'); +DELETE FROM `spell_script_names` WHERE `spell_id`=77799 OR ScriptName="spell_warlock_fel_flame"; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(17962, 'spell_warl_conflagrate'); +(77799, 'spell_warl_fel_flame'); +(77801, 'spell_warl_demon_soul'); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index df415a7bb08..92d8e940a22 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -25,6 +25,7 @@ #include "ScriptMgr.h" #include "SpellScript.h" #include "SpellAuraEffects.h" +#include "SpellAuras.h" enum WarlockSpells { @@ -38,10 +39,16 @@ enum WarlockSpells SPELL_WARLOCK_DEMONIC_EMPOWERMENT_IMP = 54444, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_SUCCUBUS = 54435, SPELL_WARLOCK_DEMONIC_EMPOWERMENT_VOIDWALKER = 54443, + SPELL_WARLOCK_DEMON_SOUL_IMP = 79459, + SPELL_WARLOCK_DEMON_SOUL_FELHUNTER = 79460, + SPELL_WARLOCK_DEMON_SOUL_FELGUARD = 79452, + SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS = 79453, + SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER = 79454, SPELL_WARLOCK_FEL_SYNERGY_HEAL = 54181, SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE = 63106, SPELL_WARLOCK_HAUNT = 48181, SPELL_WARLOCK_HAUNT_HEAL = 48210, + SPELL_WARLOCK_IMMOLATE = 348, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R1 = 18692, SPELL_WARLOCK_IMPROVED_HEALTHSTONE_R2 = 18693, SPELL_WARLOCK_IMPROVED_HEALTH_FUNNEL_BUFF_R1 = 60955, @@ -52,6 +59,7 @@ enum WarlockSpells SPELL_WARLOCK_LIFE_TAP_ENERGIZE_2 = 32553, SPELL_WARLOCK_SIPHON_LIFE_HEAL = 63106, SPELL_WARLOCK_SOULSHATTER = 32835, + SPELL_WARLOCK_UNSTABLE_AFFLICTION = 30108, SPELL_WARLOCK_UNSTABLE_AFFLICTION_DISPEL = 31117 }; @@ -116,6 +124,41 @@ class spell_warl_banish : public SpellScriptLoader } }; +// 17962 - Conflagrate - Updated to 4.3.4 +class spell_warl_conflagrate : public SpellScriptLoader +{ + public: + spell_warl_conflagrate() : SpellScriptLoader("spell_warl_conflagrate") { } + + class spell_warl_conflagrate_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_conflagrate_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMMOLATE)) + return false; + return true; + } + + void HandleHit(SpellEffIndex /*effIndex*/) + { + if (AuraEffect const* aurEff = GetHitUnit()->GetAuraEffect(SPELL_WARLOCK_IMMOLATE, EFFECT_2, GetCaster()->GetGUID())) + SetHitDamage(CalculatePct(aurEff->GetAmount(), GetSpellInfo()->Effects[EFFECT_1].CalcValue(GetCaster()))); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_conflagrate_SpellScript::HandleHit, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_conflagrate_SpellScript(); + } +}; + // 6201 - Create Healthstone class spell_warl_create_healthstone : public SpellScriptLoader { @@ -336,6 +379,73 @@ class spell_warl_demonic_circle_teleport : public SpellScriptLoader } }; +// 77801 - Demon Soul - Updated to 4.3.4 +class spell_warl_demon_soul : public SpellScriptLoader +{ + public: + spell_warl_demon_soul() : SpellScriptLoader("spell_warl_demon_soul") { } + + class spell_warl_demon_soul_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_demon_soul_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_IMP)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_FELHUNTER)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_FELGUARD)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER)) + return false; + return true; + } + + void OnHitTarget(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + if (Creature* targetCreature = GetHitCreature()) + { + if (targetCreature->isPet()) + { + CreatureTemplate const* ci = sObjectMgr->GetCreatureTemplate(targetCreature->GetEntry()); + switch (ci->family) + { + case CREATURE_FAMILY_SUCCUBUS: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_SUCCUBUS); + break; + case CREATURE_FAMILY_VOIDWALKER: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_VOIDWALKER); + break; + case CREATURE_FAMILY_FELGUARD: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_FELGUARD); + break; + case CREATURE_FAMILY_FELHUNTER: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_FELHUNTER); + break; + case CREATURE_FAMILY_IMP: + caster->CastSpell(caster, SPELL_WARLOCK_DEMON_SOUL_IMP); + break; + } + } + } + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_demon_soul_SpellScript::OnHitTarget, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_demon_soul_SpellScript; + } +}; + // 47193 - Demonic Empowerment /// Updated 4.3.4 class spell_warl_demonic_empowerment : public SpellScriptLoader @@ -430,6 +540,43 @@ class spell_warl_everlasting_affliction : public SpellScriptLoader } }; +// 77799 - Fel Flame - Updated to 4.3.4 +class spell_warl_fel_flame : public SpellScriptLoader +{ + public: + spell_warl_fel_flame() : SpellScriptLoader("spell_warl_fel_flame") { } + + class spell_warl_fel_flame_SpellScript : public SpellScript + { + PrepareSpellScript(spell_warl_fel_flame_SpellScript); + + void OnHitTarget(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + Unit* target = GetHitUnit(); + Aura* aura = target->GetAura(SPELL_WARLOCK_UNSTABLE_AFFLICTION, caster->GetGUID()); + if (!aura) + aura = target->GetAura(SPELL_WARLOCK_IMMOLATE, caster->GetGUID()); + + if (!aura) + return; + + int32 newDuration = aura->GetDuration() + GetSpellInfo()->Effects[EFFECT_1].CalcValue() * 1000; + aura->SetDuration(std::min(newDuration, aura->GetMaxDuration())); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_warl_fel_flame_SpellScript::OnHitTarget, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_warl_fel_flame_SpellScript; + } +}; + // -47230 - Fel Synergy class spell_warl_fel_synergy : public SpellScriptLoader { @@ -874,11 +1021,14 @@ void AddSC_warlock_spell_scripts() { new spell_warl_bane_of_doom(); new spell_warl_banish(); + new spell_warl_conflagrate(); new spell_warl_create_healthstone(); new spell_warl_demonic_circle_summon(); new spell_warl_demonic_circle_teleport(); new spell_warl_demonic_empowerment(); + new spell_warl_demon_soul(); new spell_warl_everlasting_affliction(); + new spell_warl_fel_flame(); new spell_warl_fel_synergy(); new spell_warl_haunt(); new spell_warl_health_funnel(); -- cgit v1.2.3 From 900f3e8d6a990695b522c2e4342c93ce4cae1298 Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 31 Jan 2013 00:24:52 +0100 Subject: Spells/Warlock: Fixed a small mistake in my previous commit's SQL. --- sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql index 14bf9f1832a..67463a5bdec 100644 --- a/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql +++ b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql @@ -1,5 +1,5 @@ DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_demon_soul', 'spell_warl_conflagrate', 'spell_warl_fel_flame'); -DELETE FROM `spell_script_names` WHERE `spell_id`=77799 OR ScriptName="spell_warlock_fel_flame"; +DELETE FROM `spell_script_names` WHERE `spell_id` IN (17962, 77799, 77801); INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES (17962, 'spell_warl_conflagrate'); (77799, 'spell_warl_fel_flame'); -- cgit v1.2.3 From 454ee822ae2972d86592462e0b1bcd1558c66273 Mon Sep 17 00:00:00 2001 From: Warpten Date: Thu, 31 Jan 2013 00:26:53 +0100 Subject: Dang, one more typo. --- sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql index 67463a5bdec..a615525b626 100644 --- a/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql +++ b/sql/updates/world/2013_01_31_00_world_spell_script_names_434.sql @@ -1,6 +1,6 @@ DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_demon_soul', 'spell_warl_conflagrate', 'spell_warl_fel_flame'); DELETE FROM `spell_script_names` WHERE `spell_id` IN (17962, 77799, 77801); INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES -(17962, 'spell_warl_conflagrate'); -(77799, 'spell_warl_fel_flame'); +(17962, 'spell_warl_conflagrate'), +(77799, 'spell_warl_fel_flame'), (77801, 'spell_warl_demon_soul'); -- cgit v1.2.3 From b539a9717b46f622e42b93fcd67a90bdc3018981 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Fri, 1 Feb 2013 00:46:04 +0100 Subject: DB/Gameobject: Removed gameobject with bad wdb data --- sql/updates/world/2013_02_01_00_world_gameobject.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_02_01_00_world_gameobject.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_01_00_world_gameobject.sql b/sql/updates/world/2013_02_01_00_world_gameobject.sql new file mode 100644 index 00000000000..2476d623c5a --- /dev/null +++ b/sql/updates/world/2013_02_01_00_world_gameobject.sql @@ -0,0 +1 @@ +DELETE FROM `gameobject` WHERE `id`=180184; -- cgit v1.2.3 From dc5e9c80fca8a7e17c8d54dd9e7a150c71a7c810 Mon Sep 17 00:00:00 2001 From: Zaphod Date: Fri, 1 Feb 2013 05:08:11 +0000 Subject: DB/Loot: Fix Prismatic Black Diamond --- .../world/2013_02_01_01_world_spell_loot_template.sql | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 sql/updates/world/2013_02_01_01_world_spell_loot_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_01_01_world_spell_loot_template.sql b/sql/updates/world/2013_02_01_01_world_spell_loot_template.sql new file mode 100644 index 00000000000..0185f464412 --- /dev/null +++ b/sql/updates/world/2013_02_01_01_world_spell_loot_template.sql @@ -0,0 +1,12 @@ +-- loot for Prismatic Black Diamond +DELETE FROM `spell_loot_template` WHERE `entry`=62941; +INSERT INTO `spell_loot_template` (`entry`, `item`, `ChanceOrQuestChance`, `lootmode`, `groupid`, `mincountOrRef`, `maxcount`) VALUES +(62941, 23094, 0, 1, 1, 1, 1), +(62941, 23095, 0, 1, 1, 1, 1), +(62941, 28595, 0, 1, 1, 1, 1), +(62941, 23116, 0, 1, 1, 1, 1), +(62941, 23118, 0, 1, 1, 1, 1), +(62941, 23119, 0, 1, 1, 1, 1), +(62941, 23120, 0, 1, 1, 1, 1), +(62941, 23114, 0, 1, 1, 1, 1), +(62941, 23115, 0, 1, 1, 1, 1); -- cgit v1.2.3 From 817f5b36483a6e8fe895ec8c2dc68179b8b450da Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 1 Feb 2013 18:06:51 +0100 Subject: Scripts/Icecrown Citadel: * Fixed Coldflame dealing double damage * Targets hit by Bone Slice will now be immune to Bone Spike Graveyard * Fixed healing players on Bone Spike Closes #1091 Closes #4473 Closes #5854 Closes #7060 --- .../2013_02_01_02_world_spell_script_names.sql | 4 + src/server/game/Spells/SpellEffects.cpp | 18 -- src/server/game/Spells/SpellMgr.cpp | 6 +- .../IcecrownCitadel/boss_lord_marrowgar.cpp | 204 ++++++++++++++++++--- 4 files changed, 182 insertions(+), 50 deletions(-) create mode 100644 sql/updates/world/2013_02_01_02_world_spell_script_names.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_01_02_world_spell_script_names.sql b/sql/updates/world/2013_02_01_02_world_spell_script_names.sql new file mode 100644 index 00000000000..33b7b1fab6e --- /dev/null +++ b/sql/updates/world/2013_02_01_02_world_spell_script_names.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_marrowgar_bone_slice'; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(69055,'spell_marrowgar_bone_slice'), +(70814,'spell_marrowgar_bone_slice'); diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index ba7c87ba10a..8b440b665ad 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -3212,24 +3212,6 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex) switch (m_spellInfo->SpellFamilyName) { - case SPELLFAMILY_GENERIC: - { - switch (m_spellInfo->Id) - { - case 69055: // Saber Lash - case 70814: // Saber Lash - { - uint32 count = 0; - for (std::list::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit) - if (ihit->effectMask & (1 << effIndex)) - ++count; - - totalDamagePercentMod /= count; - break; - } - } - break; - } case SPELLFAMILY_WARRIOR: { // Devastate (player ones) diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index b258f01ccd5..dbd4e3904ea 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -3397,9 +3397,9 @@ void SpellMgr::LoadDbcDataCorrections() case 70861: // Sindragosa's Lair Teleport spellInfo->EffectImplicitTargetA[0] = TARGET_DEST_DB; break; - case 69055: // Saber Lash (Lord Marrowgar) - case 70814: // Saber Lash (Lord Marrowgar) - spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_5_YARDS; // 5yd + case 69055: // Bone Slice (Lord Marrowgar) + case 70814: // Bone Slice (Lord Marrowgar) + spellInfo->EffectRadiusIndex[0] = EFFECT_RADIUS_8_YARDS; // 5yd break; case 69075: // Bone Storm (Lord Marrowgar) case 70834: // Bone Storm (Lord Marrowgar) diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp index 4763896cf72..5a669bc2a0b 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp @@ -20,8 +20,9 @@ #include "ScriptedCreature.h" #include "SpellAuras.h" #include "MapManager.h" -#include "icecrown_citadel.h" +#include "MoveSplineInit.h" #include "Player.h" +#include "icecrown_citadel.h" enum ScriptTexts { @@ -78,7 +79,46 @@ enum MovementPoints POINT_TARGET_COLDFLAME = 36672631, }; -#define DATA_COLDFLAME_GUID 0 +enum MiscInfo +{ + DATA_COLDFLAME_GUID = 0, + + // Manual marking for targets hit by Bone Slice as no aura exists for this purpose + // These units are the tanks in this encounter + // and should be immune to Bone Spike Graveyard + DATA_SPIKE_IMMUNE = 1, + //DATA_SPIKE_IMMUNE_1, = 2, // Reserved & used + //DATA_SPIKE_IMMUNE_2, = 3, // Reserved & used + + ACTION_CLEAR_SPIKE_IMMUNITIES = 1, + + MAX_BONE_SPIKE_IMMUNE = 3, +}; + +class BoneSpikeTargetSelector : public std::unary_function +{ + public: + BoneSpikeTargetSelector(UnitAI* ai) : _ai(ai) { } + + bool operator()(Unit* unit) const + { + if (unit->GetTypeId() != TYPEID_PLAYER) + return false; + + if (unit->HasAura(SPELL_IMPALED)) + return false; + + // Check if it is one of the tanks soaking Bone Slice + for (uint32 i = 0; i < MAX_BONE_SPIKE_IMMUNE; ++i) + if (unit->GetGUID() == _ai->GetGUID(DATA_SPIKE_IMMUNE + i)) + return false; + + return true; + } + + private: + UnitAI* _ai; +}; class boss_lord_marrowgar : public CreatureScript { @@ -108,6 +148,7 @@ class boss_lord_marrowgar : public CreatureScript events.ScheduleEvent(EVENT_WARN_BONE_STORM, urand(45000, 50000)); events.ScheduleEvent(EVENT_ENRAGE, 600000); _boneSlice = false; + _boneSpikeImmune.clear(); } void EnterCombat(Unit* /*who*/) @@ -205,7 +246,7 @@ class boss_lord_marrowgar : public CreatureScript case EVENT_BONE_STORM_END: if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) me->GetMotionMaster()->MovementExpired(); - DoStartMovement(me->getVictim()); + me->GetMotionMaster()->MoveChase(me->getVictim()); me->SetSpeed(MOVE_RUN, _baseSpeed, true); events.CancelEvent(EVENT_BONE_STORM_MOVE); events.ScheduleEvent(EVENT_ENABLE_BONE_SLICE, 10000); @@ -239,7 +280,7 @@ class boss_lord_marrowgar : public CreatureScript return; // lock movement - DoStartNoMovement(me->getVictim()); + me->GetMotionMaster()->MoveIdle(); } Position const* GetLastColdflamePosition() const @@ -247,23 +288,51 @@ class boss_lord_marrowgar : public CreatureScript return &_coldflameLastPos; } - uint64 GetGUID(int32 type/* = 0 */) const + uint64 GetGUID(int32 type /*= 0 */) const { - if (type == DATA_COLDFLAME_GUID) - return _coldflameTarget; + switch (type) + { + case DATA_COLDFLAME_GUID: + return _coldflameTarget; + case DATA_SPIKE_IMMUNE + 0: + case DATA_SPIKE_IMMUNE + 1: + case DATA_SPIKE_IMMUNE + 2: + { + int32 index = type - DATA_SPIKE_IMMUNE; + if (index < _boneSpikeImmune.size()) + return _boneSpikeImmune[index]; + + break; + } + } + return 0LL; } - void SetGUID(uint64 guid, int32 type/* = 0 */) + void SetGUID(uint64 guid, int32 type /*= 0 */) + { + switch (type) + { + case DATA_COLDFLAME_GUID: + _coldflameTarget = guid; + break; + case DATA_SPIKE_IMMUNE: + _boneSpikeImmune.push_back(guid); + break; + } + } + + void DoAction(int32 const action) { - if (type != DATA_COLDFLAME_GUID) + if (action != ACTION_CLEAR_SPIKE_IMMUNITIES) return; - _coldflameTarget = guid; + _boneSpikeImmune.clear(); } private: Position _coldflameLastPos; + std::vector _boneSpikeImmune; uint64 _coldflameTarget; uint32 _boneStormDuration; float _baseSpeed; @@ -323,7 +392,7 @@ class npc_coldflame : public CreatureScript } me->NearTeleportTo(pos.GetPositionX(), pos.GetPositionY(), me->GetPositionZ(), me->GetOrientation()); - _events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 450); + _events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 500); } void UpdateAI(uint32 const diff) @@ -333,10 +402,10 @@ class npc_coldflame : public CreatureScript if (_events.ExecuteEvent() == EVENT_COLDFLAME_TRIGGER) { Position newPos; - me->GetNearPosition(newPos, 5.5f, 0.0f); + me->GetNearPosition(newPos, 5.0f, 0.0f); me->NearTeleportTo(newPos.GetPositionX(), newPos.GetPositionY(), me->GetPositionZ(), me->GetOrientation()); DoCast(SPELL_COLDFLAME_SUMMON); - _events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 450); + _events.ScheduleEvent(EVENT_COLDFLAME_TRIGGER, 500); } } @@ -385,6 +454,24 @@ class npc_bone_spike : public CreatureScript _hasTrappedUnit = true; } + void PassengerBoarded(Unit* passenger, int8 /*seat*/, bool apply) + { + if (!apply) + return; + + /// @HACK - Change passenger offset to the one taken directly from sniffs + /// Remove this when proper calculations are implemented. + /// This fixes healing spiked people + Movement::MoveSplineInit init(passenger); + init.DisableTransportPathTransformations(); + init.MoveTo(-0.02206125f, -0.02132235f, 5.514783f, false); + init.Launch(); + + /// @WORKAROUND - Clear ON VEHICLE state to allow healing (Invalid target errors) + /// Current rule for applying this state is questionable (seatFlags & VEHICLE_SEAT_FLAG_ALLOW_TURNING ???) + passenger->ClearUnitState(UNIT_STATE_ONVEHICLE); + } + void UpdateAI(uint32 const diff) { if (!_hasTrappedUnit) @@ -487,16 +574,24 @@ class spell_marrowgar_coldflame_damage : public SpellScriptLoader { PrepareAuraScript(spell_marrowgar_coldflame_damage_AuraScript); - void OnPeriodic(AuraEffect const* /*aurEff*/) + bool CanBeAppliedOn(Unit* target) { - if (DynamicObject* owner = GetDynobjOwner()) - if (GetTarget()->GetExactDist2d(owner) >= owner->GetRadius() || GetTarget()->HasAura(SPELL_IMPALED)) - PreventDefaultAction(); + if (target->HasAura(SPELL_IMPALED)) + return false; + + if (target->GetExactDist2d(GetOwner()) > GetSpellInfo()->Effects[EFFECT_0].CalcRadius()) + return false; + + if (Aura* aur = target->GetAura(GetId())) + if (aur->GetOwner() != GetOwner()) + return false; + + return true; } void Register() { - OnEffectPeriodic += AuraEffectPeriodicFn(spell_marrowgar_coldflame_damage_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE); + DoCheckAreaTarget += AuraCheckAreaTargetFn(spell_marrowgar_coldflame_damage_AuraScript::CanBeAppliedOn); } }; @@ -531,7 +626,7 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader SpellCastResult CheckCast() { - return GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 0.0f, true, -SPELL_IMPALED) ? SPELL_CAST_OK : SPELL_FAILED_NO_VALID_TARGETS; + return GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, BoneSpikeTargetSelector(GetCaster()->GetAI())) ? SPELL_CAST_OK : SPELL_FAILED_NO_VALID_TARGETS; } void HandleSpikes(SpellEffIndex effIndex) @@ -539,22 +634,22 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader PreventHitDefaultEffect(effIndex); if (Creature* marrowgar = GetCaster()->ToCreature()) { - bool didHit = false; CreatureAI* marrowgarAI = marrowgar->AI(); uint8 boneSpikeCount = uint8(GetCaster()->GetMap()->GetSpawnMode() & 1 ? 3 : 1); - for (uint8 i = 0; i < boneSpikeCount; ++i) - { - // select any unit but not the tank - Unit* target = marrowgarAI->SelectTarget(SELECT_TARGET_RANDOM, 1, 150.0f, true, -SPELL_IMPALED); - if (!target) - break; - didHit = true; + std::list targets; + marrowgarAI->SelectTargetList(targets, BoneSpikeTargetSelector(marrowgarAI), boneSpikeCount, SELECT_TARGET_RANDOM); + if (targets.empty()) + return; + + uint32 i = 0; + for (std::list::const_iterator itr = targets.begin(); itr != targets.end(); ++itr, ++i) + { + Unit* target = *itr; target->CastCustomSpell(BoneSpikeSummonId[i], SPELLVALUE_BASE_POINT0, 0, target, true); } - if (didHit) - marrowgarAI->Talk(SAY_BONESPIKE); + marrowgarAI->Talk(SAY_BONESPIKE); } } @@ -597,6 +692,56 @@ class spell_marrowgar_bone_storm : public SpellScriptLoader } }; +class spell_marrowgar_bone_slice : public SpellScriptLoader +{ + public: + spell_marrowgar_bone_slice() : SpellScriptLoader("spell_marrowgar_bone_slice") { } + + class spell_marrowgar_bone_slice_SpellScript : public SpellScript + { + PrepareSpellScript(spell_marrowgar_bone_slice_SpellScript); + + bool Load() + { + _targetCount = 0; + return true; + } + + void ClearSpikeImmunities() + { + GetCaster()->GetAI()->DoAction(ACTION_CLEAR_SPIKE_IMMUNITIES); + } + + void CountTarget(SpellEffIndex /*effIndex*/) + { + ++_targetCount; + GetCaster()->GetAI()->SetGUID(GetHitUnit()->GetGUID(), DATA_SPIKE_IMMUNE); + } + + void SplitDamage() + { + if (!_targetCount) + return; // why would there be an unit not hit by effect hook and hit by this? + + SetHitDamage(GetHitDamage() / _targetCount); + } + + void Register() + { + BeforeCast += SpellCastFn(spell_marrowgar_bone_slice_SpellScript::ClearSpikeImmunities); + OnEffectLaunchTarget += SpellEffectFn(spell_marrowgar_bone_slice_SpellScript::CountTarget, EFFECT_0, SPELL_EFFECT_WEAPON_PERCENT_DAMAGE); + OnHit += SpellHitFn(spell_marrowgar_bone_slice_SpellScript::SplitDamage); + } + + uint32 _targetCount; + }; + + SpellScript* GetSpellScript() const + { + return new spell_marrowgar_bone_slice_SpellScript(); + } +}; + void AddSC_boss_lord_marrowgar() { new boss_lord_marrowgar(); @@ -607,4 +752,5 @@ void AddSC_boss_lord_marrowgar() new spell_marrowgar_coldflame_damage(); new spell_marrowgar_bone_spike_graveyard(); new spell_marrowgar_bone_storm(); + new spell_marrowgar_bone_slice(); } -- cgit v1.2.3 From 2976f940037dc1f87deeab4f388388147356c55e Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Fri, 1 Feb 2013 21:35:37 -0500 Subject: DB/WDB: Fixed some wrong WDBVerified; those templates IDs are way too high to have been took from retail --- sql/updates/world/2013_02_01_03_world_wdbverified.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 sql/updates/world/2013_02_01_03_world_wdbverified.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_01_03_world_wdbverified.sql b/sql/updates/world/2013_02_01_03_world_wdbverified.sql new file mode 100644 index 00000000000..1f47ff75825 --- /dev/null +++ b/sql/updates/world/2013_02_01_03_world_wdbverified.sql @@ -0,0 +1,2 @@ +UPDATE `npc_text` SET `WDBVerified`=1 WHERE `ID` IN (16777215, 31023); +UPDATE `gameobject_template` SET `WDBVerified`=1 WHERE `entry` IN (401003, 300238, 300212, 300209, 300208, 300207, 300204, 300203, 300200, 300199, 300190, 300188, 300187, 300185, 300182, 300175, 300170, 300033); -- cgit v1.2.3 From 55fc0c58af02f1ae4fa69976a9d351824ffde56e Mon Sep 17 00:00:00 2001 From: Nay Date: Sun, 3 Feb 2013 01:37:23 +0000 Subject: DB/Schema: Change engine and collation of `world`.`lfg_entrances` latin1 -> utf8_general_ci InnoDB -> MyISAM (defaults for all `world` DB tables) --- sql/updates/world/2013_02_03_world_lfg_entrances.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_02_03_world_lfg_entrances.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_03_world_lfg_entrances.sql b/sql/updates/world/2013_02_03_world_lfg_entrances.sql new file mode 100644 index 00000000000..e308c001d29 --- /dev/null +++ b/sql/updates/world/2013_02_03_world_lfg_entrances.sql @@ -0,0 +1 @@ +ALTER TABLE `lfg_entrances` CHARACTER SET utf8 COLLATE utf8_general_ci, ENGINE MyISAM; -- cgit v1.2.3 From 0fbfe675ec659ee51e3514948e80d40c18a1746e Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Mon, 4 Feb 2013 01:26:45 +0200 Subject: DB/Misc: Add full script for Something Stinks (A:24655 H:24536) Rename an sql file. --- .../world/2013_02_03_00_world_lfg_entrances.sql | 1 + .../world/2013_02_03_world_lfg_entrances.sql | 1 - sql/updates/world/2013_02_04_00_world_misc.sql | 60 ++++++++++++++++++++++ 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2013_02_03_00_world_lfg_entrances.sql delete mode 100644 sql/updates/world/2013_02_03_world_lfg_entrances.sql create mode 100644 sql/updates/world/2013_02_04_00_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_03_00_world_lfg_entrances.sql b/sql/updates/world/2013_02_03_00_world_lfg_entrances.sql new file mode 100644 index 00000000000..e308c001d29 --- /dev/null +++ b/sql/updates/world/2013_02_03_00_world_lfg_entrances.sql @@ -0,0 +1 @@ +ALTER TABLE `lfg_entrances` CHARACTER SET utf8 COLLATE utf8_general_ci, ENGINE MyISAM; diff --git a/sql/updates/world/2013_02_03_world_lfg_entrances.sql b/sql/updates/world/2013_02_03_world_lfg_entrances.sql deleted file mode 100644 index e308c001d29..00000000000 --- a/sql/updates/world/2013_02_03_world_lfg_entrances.sql +++ /dev/null @@ -1 +0,0 @@ -ALTER TABLE `lfg_entrances` CHARACTER SET utf8 COLLATE utf8_general_ci, ENGINE MyISAM; diff --git a/sql/updates/world/2013_02_04_00_world_misc.sql b/sql/updates/world/2013_02_04_00_world_misc.sql new file mode 100644 index 00000000000..ff8021653ab --- /dev/null +++ b/sql/updates/world/2013_02_04_00_world_misc.sql @@ -0,0 +1,60 @@ +-- Something Stinks (A:24655 H:24536) +SET @GUID := 85637; -- set by TDB (need 10)(85637,85638,85639,85640,85641,85642,85643,85644,85645,85646,43498,43502,45075,45099) +SET @EVENT := 8; -- Love is in the Air + +SET @BUNNY := 38288; -- Love Guard Perfume Bunny +SET @GUARD_SW := 68; -- Stormwind City Guard +SET @PATROOLER_SW := 1976; -- Stormwind City Patroller +SET @GUARD_ORG := 3296; -- Orgrimmar Grunt +SET @ELITE_ORG := 14304; -- Kor'kron Elite + +SET @SPELL_PULSE := 71520; -- Heavily Perfumed Pulse +SET @SPELL_BUFF := 71507; -- Heavily Perfumed +SET @SPELL_ANALYSIS := 70192; -- Fragrant Air Analysis + + +DELETE FROM `creature` WHERE `id`=@BUNNY; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID+0,@BUNNY,0,1,1,0,0,-8825.604,629.3108,94.1137,0,300,0,0,1,0,0,0,0,0), -- sw trade district +(@GUID+1,@BUNNY,0,1,1,0,0,-8988.889,849.4149,105.9425,0,300,0,0,1,0,0,0,0,0), -- sw mage quarter +(@GUID+2,@BUNNY,0,1,1,0,0,-8737.654,1051.887,90.8816,0,300,0,0,1,0,0,0,0,0), -- sw the park +(@GUID+3,@BUNNY,0,1,1,0,0,-8625.038,780.0799,96.73399,0,300,0,0,1,0,0,0,0,0), -- sw cathedral square +(@GUID+4,@BUNNY,0,1,1,0,0,-8433.189,607.2205,95.13025,0,300,0,0,1,0,0,0,0,0), -- sw dwarven district +(@GUID+5,@BUNNY,0,1,1,0,0,-8486.955,390.5139,108.4689,0,300,0,0,1,0,0,0,0,0), -- sw stormwind keep +(@GUID+6,@BUNNY,0,1,1,0,0,-8676.724,444.5052,99.73087,0,300,0,0,1,0,0,0,0,0), -- sw old town +-- +(@GUID+7,@BUNNY,1,1,1,0,0,1573.92,-4397.11,16.00813,0,300,0,0,1,0,0,0,0,0), -- org valley of strength +(@GUID+8,@BUNNY,1,1,1,0,0,1893.24,-4507.31,24.94853,0,300,0,0,1,0,0,0,0,0), -- org the drag +(@GUID+9,@BUNNY,1,1,1,0,0,2015.27,-4687.4,28.61023,0,300,0,0,1,0,0,0,0,0); -- org valley of honor + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=@SPELL_PULSE; +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry`=@SPELL_BUFF; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13,1,@SPELL_PULSE,0,0,31,0,3,@GUARD_SW,0,0,0,0,'',"Heavily Perfumed Pulse target Stormwind City Guard"), +(13,1,@SPELL_PULSE,0,1,31,0,3,@PATROOLER_SW,0,0,0,0,'',"Heavily Perfumed Pulse target Stormwind City Patroller"), +(13,1,@SPELL_PULSE,0,2,31,0,3,@GUARD_ORG,0,0,0,0,'',"Heavily Perfumed Pulse target Orgrimmar Grunt"), +(13,1,@SPELL_PULSE,0,3,31,0,3,@ELITE_ORG,0,0,0,0,'',"Heavily Perfumed Pulse target Kor'kron Elite"), +(17,0,@SPELL_BUFF,0,0,1,0,@SPELL_BUFF,0,0,1,0,0,'',"Apply Heavily Perfumed only when missing"); + +UPDATE `creature_template` SET `AIName`='SmartAI',`InhabitType`=4,`flags_extra`=`flags_extra`|128 WHERE `entry`=@BUNNY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@BUNNY 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 +(@BUNNY,0,0,0,60,0,100,0,0,0,600000,600000,11,@SPELL_PULSE,0,0,0,0,0,1,0,0,0,0,0,0,0,"On update(each 10 min) - Cast - Self"); + +-- ussing this because dummy effect #1 of spell 70192 is to remove the buff +DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=@SPELL_ANALYSIS; +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(@SPELL_ANALYSIS,-@SPELL_BUFF,1,'Remove Heavily Perfumed on Fragrant Air Analysis hit'); + +DELETE FROM `game_event_creature` WHERE `eventEntry`=@EVENT AND `guid` BETWEEN @GUID+0 AND @GUID+9; +INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES +(@EVENT,@GUID+0), +(@EVENT,@GUID+1), +(@EVENT,@GUID+2), +(@EVENT,@GUID+3), +(@EVENT,@GUID+4), +(@EVENT,@GUID+5), +(@EVENT,@GUID+6), +(@EVENT,@GUID+7), +(@EVENT,@GUID+8), +(@EVENT,@GUID+9); -- cgit v1.2.3 From e0fca3454e55f1689b669f0ecf385a2556a898a8 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sun, 3 Feb 2013 18:50:42 -0500 Subject: DB/Creature Text: Corrected some texts & type fails -- more to come; Soon (TM) --- .../world/2013_02_04_01_world_creature_text.sql | 165 +++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 sql/updates/world/2013_02_04_01_world_creature_text.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_01_world_creature_text.sql b/sql/updates/world/2013_02_04_01_world_creature_text.sql new file mode 100644 index 00000000000..c52aa380c49 --- /dev/null +++ b/sql/updates/world/2013_02_04_01_world_creature_text.sql @@ -0,0 +1,165 @@ +-- Ragnaros +UPDATE `creature_text` SET `text`='TOO SOON! YOU HAVE AWAKENED ME TOO SOON, EXECUTUS! WHAT IS THE MEANING OF THIS INTRUSION???' WHERE `entry`=11502 AND `groupid`=1; +UPDATE `creature_text` SET `text`='FOOL! YOU ALLOWED THESE INSECTS TO RUN RAMPANT THROUGH THE HALLOWED CORE? AND NOW YOU LEAD THEM TO MY VERY LAIR? YOU HAVE FAILED ME, EXECUTUS! JUSTICE SHALL BE MET, INDEED!' WHERE `entry`=11502 AND `groupid`=3; +UPDATE `creature_text` SET `text`='NOW FOR YOU, INSECTS! BOLDLY, YOU SOUGHT THE POWER OF RAGNAROS. NOW YOU SHALL SEE IT FIRSTHAND!' WHERE `entry`=11502 AND `groupid`=4; +UPDATE `creature_text` SET `text`='DIE, INSECT!' WHERE `entry`=11502 AND `groupid`=9; + +-- Core Rager +UPDATE `creature_text` SET `text`='%s refuses to die while its master is endangered!' WHERE `entry`=11672 AND `groupid`=0; + +-- Morridune +UPDATE `creature_text` SET `text`='Aku''mai is dead! At last, I can leave this wretched place.' WHERE `entry`=6729 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Speak with me to hear my tale.' WHERE `entry`=6729 AND `groupid`=1; + +-- Amnennar the Coldbringer +UPDATE `creature_text` SET `text`='You''ll never leave this place alive.' WHERE `entry`=7358 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Come, spirits - attend your master!' WHERE `entry`=7358 AND `groupid`=2; +UPDATE `creature_text` SET `text`='Too easy.', `type`=12 WHERE `entry`=7358 AND `groupid`=4; + +-- Weegli Blastfuse +UPDATE `creature_text` SET `text`='Oh no! Here they come!' WHERE `entry`=7607 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Ok, here I go!' WHERE `entry`=7607 AND `groupid`=1; + +-- The Prophet Skeram +UPDATE `creature_text` SET `text`='Are you so eager to die? I will be happy to accommodate you...' WHERE `entry`=15263 AND `groupid`=0 AND `id`=0; +UPDATE `creature_text` SET `text`='You only delay the inevitable!' WHERE `entry`=15263 AND `groupid`=3; + +-- Ossirian the Unscarred +UPDATE `creature_text` SET `text`='Sands of the desert, rise and block out the sun!' WHERE `entry`=15339 AND `groupid`=2; + +-- General Rajaxx +UPDATE `creature_text` SET `text`='Warriors, Captains, continue the fight! ' WHERE `entry`=15341 AND `groupid`=9; +UPDATE `creature_text` SET `text`='Breathe your last!' WHERE `entry`=15341 AND `groupid`=11; + +-- Buru the Gorger +UPDATE `creature_text` SET `text`='%s sets eyes on $n!' WHERE `entry`=15370 AND `groupid`=0; + +-- Spectral Stable Hand +UPDATE `creature_text` SET `type`=12 WHERE `entry`=15551 AND `groupid`=0 AND `id`=0; +UPDATE `creature_text` SET `text`='What will become of--' WHERE `entry`=15551 AND `groupid`=0 AND `id`=1; + +-- Medivh +UPDATE `creature_text` SET `text`='The time has come! Gul''dan, order your warlocks to double their efforts! Moments from now the gateway will open and your Horde will be released upon this ripe, unsuspecting world!' WHERE `entry`=15608 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Champions! My shield grows weak!' WHERE `entry`=15608 AND `groupid`=2; +UPDATE `creature_text` SET `text`='No! Damn this feeble, mortal coil!' WHERE `entry`=15608 AND `groupid`=5; +UPDATE `creature_text` SET `text`='I am grateful for your aid, champions. Now, Gul''dan''s Horde will sweep across this world like a locust swarm, and all my designs, all my carefully-laid plans will at last fall into place.' WHERE `entry`=15608 AND `groupid`=6; +UPDATE `creature_text` SET `text`='Orcs of the Horde! This portal is the gateway to your new destiny! Azeroth lies before you, ripe for the taking!' WHERE `entry`=15608 AND `groupid`=7; + +-- Moroes +UPDATE `creature_text` SET `text`='Hm, unannounced visitors. Preparations must be made...' WHERE `entry`=15687 AND `groupid`=0; +UPDATE `creature_text` SET `text`='How terribly clumsy of me.' WHERE `entry`=15687 AND `groupid`=3; + +-- Terestian Illhoof +UPDATE `creature_text` SET `text`='Your blood will anoint my circle!' WHERE `entry`=15688 AND `groupid`=0 AND `id`=0; +UPDATE `creature_text` SET `text`='My life is yours, oh great one...' WHERE `entry`=15688 AND `groupid`=1; +UPDATE `creature_text` SET `text`='Ah, you''re just in time. The rituals are about to begin!' WHERE `entry`=15688 AND `groupid`=2; +UPDATE `creature_text` SET `text`='Please accept this humble offering, oh great one...' WHERE `entry`=15688 AND `groupid`=3 AND `id`=0; +UPDATE `creature_text` SET `text`='Let this sacrifice serve as testament to my fealty.' WHERE `entry`=15688 AND `groupid`=3 AND `id`=1; +UPDATE `creature_text` SET `text`='Come, you dwellers in the dark! Rally to my call!' WHERE `entry`=15688 AND `groupid`=4 AND `id`=0; +UPDATE `creature_text` SET `text`='Gather, my pets... there is plenty for all!' WHERE `entry`=15688 AND `groupid`=4 AND `id`=1; + +-- Prince Malchezaar +UPDATE `creature_text` SET `text`='How can you hope to stand against such overwhelming power?' WHERE `entry`=15690 AND `groupid`=5; +UPDATE `creature_text` SET `text`='I refuse to concede defeat! I am a prince of the Eredar! I... am...' WHERE `entry`=15690 AND `groupid`=8; + +-- The Curator +UPDATE `creature_text` SET `text`='This Curator is equipped for gallery protection.' WHERE `entry`=15691 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='Curator is no longer operation-a-l.' WHERE `entry`=15691 AND `groupid`=5; + +-- Thaddius +UPDATE `creature_text` SET `text`='You are too late!! I... must... obey!!' WHERE `entry`=15928 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Kill...' WHERE `entry`=15928 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `text`='Eat... your... bones...' WHERE `entry`=15928 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='Break... you!!' WHERE `entry`=15928 AND `groupid`=1 AND `id`=2; +UPDATE `creature_text` SET `text`='You... die now!!' WHERE `entry`=15928 AND `groupid`=2; +UPDATE `creature_text` SET `text`='Now you feel pain...' WHERE `entry`=15928 AND `groupid`=3; + +-- Feugen +UPDATE `creature_text` SET `text`='Feugen make master happy.' WHERE `entry`=15930 AND `groupid`=1; + +-- Grand Widow Faerlina +UPDATE `creature_text` SET `text`='Your old lives, your mortal desires mean nothing... you are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master''s service!' WHERE `entry`=15953 AND `groupid`=0; +UPDATE `creature_text` SET `text`='The master will avenge me!!' WHERE `entry`=15953 AND `groupid`=3; + +-- Anub'Rekhan +UPDATE `creature_text` SET `text`='Yes, run! It makes the blood pump faster!' WHERE `entry`=15956 AND `groupid`=0 AND `id`=2; +UPDATE `creature_text` SET `text`='I hear little hearts beating. Yes... beating faster now... soon the beating will stop.' WHERE `entry`=15956 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='Which one shall I eat first? So difficult to choose. They all smell so delicious...' WHERE `entry`=15956 AND `groupid`=1 AND `id`=3; +UPDATE `creature_text` SET `text`='Closer now. Tasty morsels. I''ve been too long without food, without blood to drink.' WHERE `entry`=15956 AND `groupid`=1 AND `id`=4; +UPDATE `creature_text` SET `text`='Shhh... it will all be over soon.' WHERE `entry`=15956 AND `groupid`=2; + +-- Kel'Thuzad +UPDATE `creature_text` SET `text`='Your forces are nearly marshaled to strike back against your enemies, my liege.' WHERE `entry`=15990 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Yes, master. The time of their ultimate demise draws close.... What is this?' WHERE `entry`=15990 AND `groupid`=2; +UPDATE `creature_text` SET `text`='As you command, master!' WHERE `entry`=15990 AND `groupid`=4; +UPDATE `creature_text` SET `text`='Fools! You think yourselves triumphant? You have only taken one step closer to the abyss!' WHERE `entry`=15990 AND `groupid`=6 AND `id`=1; +UPDATE `creature_text` SET `text`='%s cackles maniacally.', `type`=16 WHERE `entry`=15990 AND `groupid`=8 AND `id`=1; +UPDATE `creature_text` SET `text`='Agghhhh! Do... not... rejoice! Your victory is a hollow one, for I shall return with powers beyond your imagining!' WHERE `entry`=15990 AND `groupid`=9; +UPDATE `creature_text` SET `text`='Your soul is bound to me, now!' WHERE `entry`=15990 AND `groupid`=10 AND `id`=0; +UPDATE `creature_text` SET `text`='Master, I require aid!' WHERE `entry`=15990 AND `groupid`=12; +UPDATE `creature_text` SET `text`='Minions, servants, soldiers of the cold dark! Obey the call of Kel''Thuzad!' WHERE `entry`=15990 AND `groupid`=14; + +-- Patchwerk +UPDATE `creature_text` SET `text`='Kel''thuzad make Patchwerk his avatar of war!' WHERE `entry`=16028 AND `groupid`=0 AND `id`=1; +UPDATE `creature_text` SET `text`='What... happen to-' WHERE `entry`=16028 AND `groupid`=2; +UPDATE `creature_text` SET `text`='%s goes into a frenzy!', `type`=41 WHERE `entry`=16028 AND `groupid`=4; + +-- Spectral Servant +UPDATE `creature_text` SET `type`=12 WHERE `entry`=16407 AND `groupid`=0 AND `id`=0; + +-- Maiden of Virtue +UPDATE `creature_text` SET `text`='Your behavior will not be tolerated.' WHERE `entry`=16457 AND `groupid`=0; + +-- Shade of Aran +UPDATE `creature_text` SET `text`='Please, no more! My son... he''s gone mad!' WHERE `entry`=16524 AND `groupid`=0 AND `id`=0; +UPDATE `creature_text` SET `text`='I''ll show you: this beaten dog still has some teeth!' WHERE `entry`=16524 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `text`='Burn, you hellish fiends!' WHERE `entry`=16524 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='Yes, yes my son is quite powerful... but I have powers of my own!' WHERE `entry`=16524 AND `groupid`=3 AND `id`=0; +UPDATE `creature_text` SET `text`='I''m not finished yet! No, I have a few more tricks up my sleeve...', `type`=12 WHERE `entry`=16524 AND `groupid`=5; +UPDATE `creature_text` SET `text`='At last the nightmare is over...' WHERE `entry`=16524 AND `groupid`=8; + +-- Martik Tor'seldori +UPDATE `creature_text` SET `text`='Brothers and sisters, I have been to the promised land. I have tasted in the sublime energy. I have felt bliss - bliss so engrossing and all encompassing that I was left wondering if I had stumbled upon the dreams of gods.' WHERE `entry`=16577 AND `groupid`=0; + +-- Grand Warlock Nethekurse +UPDATE `creature_text` SET `text`='You can have that one, I no longer need him!' WHERE `entry`=16807 AND `groupid`=1 AND `id`=0; +UPDATE `creature_text` SET `text`='Yes, beat him mercilessly! His skull is as thick as an ogre''s!' WHERE `entry`=16807 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='Don''t waste your time on that one, he''s weak!' WHERE `entry`=16807 AND `groupid`=1 AND `id`=2; +UPDATE `creature_text` SET `text`='One pitiful wretch down. Go on, take another one!' WHERE `entry`=16807 AND `groupid`=2 AND `id`=0; +UPDATE `creature_text` SET `text`='Ah, what a waste... next!' WHERE `entry`=16807 AND `groupid`=2 AND `id`=1; +UPDATE `creature_text` SET `text`='Thank you for saving me the trouble. Now it''s my turn to have some fun!' WHERE `entry`=16807 AND `groupid`=2 AND `id`=3; +UPDATE `creature_text` SET `text`='Beg for your pitiful life!' WHERE `entry`=16807 AND `groupid`=3 AND `id`=0; +UPDATE `creature_text` SET `text`='Run, coward, run! ' WHERE `entry`=16807 AND `groupid`=3 AND `id`=1; -- Blizz fail. +UPDATE `creature_text` SET `text`='Your pain amuses me!' WHERE `entry`=16807 AND `groupid`=3 AND `id`=2; +UPDATE `creature_text` SET `text`='I''m already bored!' WHERE `entry`=16807 AND `groupid`=4 AND `id`=0; +UPDATE `creature_text` SET `text`='Come on, show me a real fight!' WHERE `entry`=16807 AND `groupid`=4 AND `id`=1; +UPDATE `creature_text` SET `text`='I had more fun torturing the peons!' WHERE `entry`=16807 AND `groupid`=4 AND `id`=2; +UPDATE `creature_text` SET `text`='You lose.' WHERE `entry`=16807 AND `groupid`=5 AND `id`=0; +UPDATE `creature_text` SET `text`='Oh, just die!' WHERE `entry`=16807 AND `groupid`=5 AND `id`=1; +UPDATE `creature_text` SET `text`='What... a shame.' WHERE `entry`=16807 AND `groupid`=6; + +-- Warchief Kargath Bladefist +UPDATE `creature_text` SET `text`='Ours is the TRUE Horde! The only Horde!' WHERE `entry`=16808 AND `groupid`=0 AND `id`=0; +UPDATE `creature_text` SET `text`='I am called Bladefist for a reason. As you will see.' WHERE `entry`=16808 AND `groupid`=0 AND `id`=2; +UPDATE `creature_text` SET `text`='I am the ONLY warchief!' WHERE `entry`=16808 AND `groupid`=1 AND `id`=1; +UPDATE `creature_text` SET `text`='The true Horde... will prevail.' WHERE `entry`=16808 AND `groupid`=2; + +-- Barnes +UPDATE `creature_text` SET `text`='Welcome ladies and gentlemen, to this evening''s presentation!' WHERE `entry`=16812 AND `groupid`=0; +UPDATE `creature_text` SET `text`='Tonight we plumb the depths of the human soul as we join a lost, lonely girl trying desperately--with the help of her loyal companions--to find her way home!' WHERE `entry`=16812 AND `groupid`=1; +UPDATE `creature_text` SET `text`='But she is pursued... by a wicked, malevolent crone!' WHERE `entry`=16812 AND `groupid`=2; +UPDATE `creature_text` SET `text`='Will she survive? Will she prevail? Only time will tell. And now... on with the show!' WHERE `entry`=16812 AND `groupid`=3; +UPDATE `creature_text` SET `text`='Good evening ladies and gentlemen, welcome to this evening''s presentation!' WHERE `entry`=16812 AND `groupid`=4; +UPDATE `creature_text` SET `text`='Tonight, things are not what they seem... for tonight your eyes may not be trusted!' WHERE `entry`=16812 AND `groupid`=5; +UPDATE `creature_text` SET `text`='Take for instance this quiet elderly woman waiting for a visit from her granddaughter... surely there is nothing to fear from this sweet, gray-haired old lady!' WHERE `entry`=16812 AND `groupid`=6; +UPDATE `creature_text` SET `text`='But don''t let me pull the wool over your eyes! See for yourself what lies beneath those covers! And now... on with the show!' WHERE `entry`=16812 AND `groupid`=7; +UPDATE `creature_text` SET `text`='Welcome ladies and gentlemen, to this evening''s presentation!' WHERE `entry`=16812 AND `groupid`=8; +UPDATE `creature_text` SET `text`='Tonight... we explore a tale of forbidden love!' WHERE `entry`=16812 AND `groupid`=9; +UPDATE `creature_text` SET `text`='But beware, for not all love stories end happily, as you may find out. Sometimes, love pricks like a thorn!' WHERE `entry`=16812 AND `groupid`=10; +UPDATE `creature_text` SET `text`='But don''t take it from me; see for yourself what tragedy lies ahead when the paths of star crossed lovers meet! And now... on with the show!' WHERE `entry`=16812 AND `groupid`=11; + +-- Shadow Council Enforcer +UPDATE `creature_text` SET `text`='Gul''dan speaks the truth! We should return at once to tell our brothers of the news! Retreat back through the portal!', `type`=14 WHERE `entry`=17023 AND `groupid`=0; + +-- Nightbane +UPDATE `creature_text` SET `text`='%s takes a deep breath.', `type`=41 WHERE `entry`=17225 AND `groupid`=4; -- cgit v1.2.3 From ffb4c63fe303111c1694e89dcb19419226974fcd Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Mon, 4 Feb 2013 05:22:09 +0200 Subject: DB/Misc: Add full script for Pilfering Perfume (A:24656 H:24541) Closes #5205 --- sql/updates/world/2013_02_04_02_world_misc.sql | 119 +++++++++++++++++++++++++ src/server/scripts/Spells/spell_generic.cpp | 58 ++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 sql/updates/world/2013_02_04_02_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_02_world_misc.sql b/sql/updates/world/2013_02_04_02_world_misc.sql new file mode 100644 index 00000000000..300d0e31bcb --- /dev/null +++ b/sql/updates/world/2013_02_04_02_world_misc.sql @@ -0,0 +1,119 @@ +-- Pilfering Perfume (A:24656 H:24541) + +SET @QUEST_A := 24656; +SET @QUEST_H := 24541; + +SET @SNIP := 38066; -- Inspector Snip Snagglebolt +SET @SNAP := 37172; -- Detective Snap Snagglebolt +SET @MENUID := 10976; + +SET @TRIGGER_SW_OUT := 5703; -- outside +SET @TRIGGER_SW_IN := 5704; -- inside +SET @TRIGGER_ORG_OUT := 5705; -- outside +SET @TRIGGER_ORG_IN := 5706; -- inside + +SET @SPELL_UNIFORM := 71450; -- Crown Parcel Service Uniform +SET @SPELL_CONTRABAND := 71459; -- Crown Chemical Co. Contraband + +SET @SPELL_CREDIT_A := 71522; -- Crown Chemical Co. Supplies +SET @SPELL_CREDIT_H := 71539; -- Crown Chemical Co. Supplies + +SET @GUID := 48571; -- set by TDB,need 3 (48571,48572,48573) +SET @EVENT := 8; -- Love is in the Air +SET @NPC_GUARD := 37671; -- Crown Supply Guard + +-- missing npcs on horde side +DELETE FROM `creature` WHERE `id`=@NPC_GUARD; +INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`) VALUES +(@GUID+0,@NPC_GUARD,1,1,1,0,0,1391.2,-4486.23,31.4544,3.3355,300,0,0,42,0,0,0,0,0), +(@GUID+1,@NPC_GUARD,1,1,1,0,0,1392.66,-4481.87,31.3782,1.97284,300,0,0,42,0,0,0,0,0), +(@GUID+2,@NPC_GUARD,1,1,1,0,0,1393.92,-4489.57,31.4737,4.93701,300,0,0,42,0,0,0,0,0); + +DELETE FROM `game_event_creature` WHERE `eventEntry`=@EVENT AND `guid` BETWEEN @GUID+0 AND @GUID+2; +INSERT INTO `game_event_creature` (`eventEntry`,`guid`) VALUES +(@EVENT,@GUID+0), +(@EVENT,@GUID+1), +(@EVENT,@GUID+2); + +-- removing a wrong spawn +DELETE FROM `creature` WHERE `guid`=40507; +DELETE FROM `game_event_creature` WHERE `guid`=40507; + +-- deleting wrong previous spawns and reusing some guids to spawn proper ones +DELETE FROM `gameobject` WHERE `guid` IN (24416,24417,24418,24419,24420,24421,24422,24423,24433,24434,24435,24436,24437,24438,24439,24440,24441); +INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`) VALUES +(24416,181015,1,1,1,1392.938,-4485.202,31.41421,0,0,0,0,1,120,255,1), +(24417,201778,1,1,1,1393.677,-4486.033,32.67227,0,0,0,0,1,120,255,1), +(24418,201752,1,1,1,1394.184,-4484.108,31.24833,4.32842,0,0,0,1,120,255,1), +(24419,201778,1,1,1,1394.26,-4484.368,32.50796,5.148723,0,0,0,1,120,255,1), +(24420,201752,1,1,1,1393.319,-4486.797,31.42903,4.101525,0,0,0,1,120,255,1), +(24421,201752,1,1,1,1394.401,-4485.688,31.35416,5.916668,0,0,0,1,120,255,1), +(24422,201752,1,1,1,1394.042,-4488.397,31.4775,4.32842,0,0,0,1,120,255,1), +(24423,201752,1,1,1,1396.476,-4482.715,32.14788,4.32842,0,0,0,1,120,255,1), +(24433,181015,1,1,1,1395.002,-4487.113,31.37537,3.874631,0,0,0,1,120,255,1), +(24434,181015,1,1,1,1396.632,-4482.505,30.87226,5.166176,0,0,0,1,120,255,1), +(24435,201752,1,1,1,1395.813,-4486.439,32.56021,1.710422,0,0,0,1,120,255,1), +(24436,201752,1,1,1,1396.595,-4486.056,31.15484,4.32842,0,0,0,1,120,255,1), +(24437,201752,1,1,1,1397.377,-4488.021,33.71862,0.157079,0,0,0,1,120,255,1), +(24438,181015,1,1,1,1397.51,-4487.901,32.46279,3.68265,0,0,0,1,120,255,1), +(24439,201752,1,1,1,1397.571,-4487.939,31.21067,3.33359,0,0,0,1,120,255,1); +-- these guids will remain free +DELETE FROM `game_event_gameobject` WHERE `eventEntry`=@EVENT AND `guid` IN (24440,24441); + +-- Snip & Snap sai +UPDATE `creature_template` SET `npcflag`=`npcflag`|1|2,`gossip_menu_id`=@MENUID,`AIName`='SmartAI' WHERE `entry` IN (@SNIP,@SNAP); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@SNIP,@SNAP) 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 +(@SNIP,0,0,0,19,0,100,0,@QUEST_A,0,0,0,11,@SPELL_UNIFORM,0,0,0,0,0,7,0,0,0,0,0,0,0,'Snip - On quest accept - Spellcast'), +(@SNIP,0,1,2,62,0,100,0,@MENUID,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Snip - On gossip option select - Close gossip'), +(@SNIP,0,2,0,61,0,100,0,0,0,0,0,11,@SPELL_UNIFORM,0,0,0,0,0,7,0,0,0,0,0,0,0,'Snip - On gossip option accept - Spellcast'), +-- +(@SNAP,0,0,0,19,0,100,0,@QUEST_H,0,0,0,11,@SPELL_UNIFORM,0,0,0,0,0,7,0,0,0,0,0,0,0,'Snap - On quest accept - Spellcast'), +(@SNAP,0,1,2,62,0,100,0,@MENUID,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Snap - On gossip option select - Close gossip'), +(@SNAP,0,2,0,61,0,100,0,0,0,0,0,11,@SPELL_UNIFORM,0,0,0,0,0,7,0,0,0,0,0,0,0,'Snap - On gossip option accept - Spellcast'); + +DELETE FROM `areatrigger_involvedrelation` WHERE `id` IN (@TRIGGER_SW_OUT,@TRIGGER_SW_IN,@TRIGGER_ORG_OUT,@TRIGGER_ORG_IN); +INSERT INTO `areatrigger_involvedrelation` (`id`,`quest`) VALUES +(@TRIGGER_SW_OUT,@QUEST_A), +(@TRIGGER_SW_IN,@QUEST_A), +-- +(@TRIGGER_ORG_OUT,@QUEST_H), +(@TRIGGER_ORG_IN,@QUEST_H); + +DELETE FROM `areatrigger_scripts` WHERE `entry` IN (@TRIGGER_SW_OUT,@TRIGGER_SW_IN,@TRIGGER_ORG_OUT,@TRIGGER_ORG_IN); +INSERT INTO `areatrigger_scripts` (`entry`,`ScriptName`) VALUES +(@TRIGGER_SW_OUT,'SmartTrigger'), +(@TRIGGER_SW_IN,'SmartTrigger'), +-- +(@TRIGGER_ORG_OUT,'SmartTrigger'), +(@TRIGGER_ORG_IN,'SmartTrigger'); + +-- usig invoker cast because normal cast doesn't want to work(LoS issue,i think) +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@TRIGGER_SW_OUT,@TRIGGER_SW_IN,@TRIGGER_ORG_OUT,@TRIGGER_ORG_IN) AND `source_type`=2; +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 +(@TRIGGER_SW_OUT,2,0,0,46,0,100,0,@TRIGGER_SW_OUT,0,0,0,85,@SPELL_CONTRABAND,0,0,0,0,0,7,0,0,0,0,0,0,0,"On Trigger - Cast - Invoker"), +(@TRIGGER_SW_IN,2,0,0,46,0,100,0,@TRIGGER_SW_IN,0,0,0,85,@SPELL_CREDIT_A,0,0,0,0,0,7,0,0,0,0,0,0,0,"On Trigger - Cast - Invoker"), +-- +(@TRIGGER_ORG_OUT,2,0,0,46,0,100,0,@TRIGGER_ORG_OUT,0,0,0,85,@SPELL_CONTRABAND,0,0,0,0,0,7,0,0,0,0,0,0,0,"On Trigger - Cast - Invoker"), +(@TRIGGER_ORG_IN,2,0,0,46,0,100,0,@TRIGGER_ORG_IN,0,0,0,85,@SPELL_CREDIT_H,0,0,0,0,0,7,0,0,0,0,0,0,0,"On Trigger - Cast - Invoker"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (@TRIGGER_SW_OUT,@TRIGGER_SW_IN,@TRIGGER_ORG_OUT,@TRIGGER_ORG_IN); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=@MENUID; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(22,1,@TRIGGER_SW_OUT,2,0,1,0,@SPELL_UNIFORM,0,0,0,0,0,'','execute sai only if player has aura'), +(22,1,@TRIGGER_SW_IN,2,0,1,0,@SPELL_CONTRABAND,0,0,0,0,0,'','execute sai only if player has aura'), +(15,@MENUID,0,0,0,9,0,@QUEST_A,0,0,0,0,0,'','show gossip option only if player has quest taken'), +-- +(22,1,@TRIGGER_ORG_OUT,2,0,1,0,@SPELL_UNIFORM,0,0,0,0,0,'','execute sai only if player has aura'), +(22,1,@TRIGGER_ORG_IN,2,0,1,0,@SPELL_CONTRABAND,0,0,0,0,0,'','execute sai only if player has aura'), +(15,@MENUID,0,0,1,9,0,@QUEST_H,0,0,0,0,0,'','show gossip option only if player has quest taken'); + +DELETE FROM `spell_linked_spell` WHERE `spell_trigger` IN (@SPELL_CREDIT_A,@SPELL_CREDIT_H,-@SPELL_UNIFORM); +INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES +(@SPELL_CREDIT_A,-@SPELL_UNIFORM,1,'Remove Crown Parcel Service Uniform on Crown Chemical Co. Supplies hit'), +(@SPELL_CREDIT_H,-@SPELL_UNIFORM,1,'Remove Crown Parcel Service Uniform on Crown Chemical Co. Supplies hit'), +(-@SPELL_UNIFORM,-@SPELL_CONTRABAND,0,'Remove Crown Chemical Co. Contraband when Crown Parcel Service Uniform is removed'); + +DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_UNIFORM; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(@SPELL_UNIFORM,'spell_gen_aura_service_uniform'); diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 05fad623114..e7befff87a3 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -3518,6 +3518,63 @@ class spell_gen_replenishment : public SpellScriptLoader } }; +enum ServiceUniform +{ + SPELL_SERVICE_UNIFORM = 71450, + + MODEL_GOBLIN_MALE = 31002, + MODEL_GOBLIN_FEMALE = 31003, +}; + +class spell_gen_aura_service_uniform : public SpellScriptLoader +{ + public: + spell_gen_aura_service_uniform() : SpellScriptLoader("spell_gen_aura_service_uniform") { } + + class spell_gen_aura_service_uniform_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gen_aura_service_uniform_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) + { + if (!sSpellMgr->GetSpellInfo(SPELL_SERVICE_UNIFORM)) + return false; + return true; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + // Apply model goblin + Unit* target = GetTarget(); + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (target->getGender() == GENDER_MALE) + target->SetDisplayId(MODEL_GOBLIN_MALE); + else + target->SetDisplayId(MODEL_GOBLIN_FEMALE); + } + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->GetTypeId() == TYPEID_PLAYER) + target->RestoreDisplayId(); + } + + void Register() + { + AfterEffectApply += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gen_aura_service_uniform_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const + { + return new spell_gen_aura_service_uniform_AuraScript(); + } +}; + void AddSC_generic_spell_scripts() { new spell_gen_absorb0_hitlimit1(); @@ -3597,4 +3654,5 @@ void AddSC_generic_spell_scripts() new spell_gen_bonked(); new spell_gen_gift_of_naaru(); new spell_gen_replenishment(); + new spell_gen_aura_service_uniform(); } -- cgit v1.2.3 From 1a92b11ae3b3ad7d3db883f7fc6fbaa9a31d8379 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sun, 3 Feb 2013 23:02:47 -0500 Subject: Created table for a future (soon) use of graveyards orientations -- work based on WorldSafeLocs.dbc --- ..._04_00_world_game_graveyard_orientation_434.sql | 1025 ++++++++++++++++++++ 1 file changed, 1025 insertions(+) create mode 100644 sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql b/sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql new file mode 100644 index 00000000000..6b6b2ee7ed0 --- /dev/null +++ b/sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql @@ -0,0 +1,1025 @@ +DROP TABLE IF EXISTS `game_graveyard_orientation`; +CREATE TABLE IF NOT EXISTS `game_graveyard_orientation` ( + `Id` int(10) unsigned NOT NULL DEFAULT '0', + `Orientation` float NOT NULL DEFAULT '0', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Orientations used by graveyards'; + + +INSERT INTO `game_graveyard_orientation` (`Id`, `Orientation`) VALUES +(1, 0), +(2, 0.898845), +(3, 3.84632), +(4, 4.016), +(5, 0), +(6, 4.77915), +(7, 2.52685), +(8, 2.79253), +(10, 1.22702), +(31, 3.00197), +(32, 0.212689), +(33, 0), +(34, 1.88888), +(35, 4.86949), +(36, 3.15402), +(39, 4.74773), +(49, 0), +(70, 0.212059), +(89, 1.86139), +(90, 2.41417), +(91, 2.71748), +(92, 1.83612), +(93, 1.11527), +(94, 4.63856), +(96, 0), +(97, 3.14552), +(98, 1.68075), +(99, 2.25147), +(100, 2.05774), +(101, 2.54862), +(102, 0), +(103, 1.5708), +(104, 1.01969), +(105, 2.79406), +(106, 4.4964), +(107, 0), +(108, 3.12588), +(109, 1.31467), +(129, 3.31613), +(149, 0.212058), +(169, 4.4855), +(189, 3.00807), +(209, 1.57738), +(229, 1.3409), +(249, 0.0921225), +(269, 0), +(289, 4.8891), +(309, 6.0672), +(310, 3.10232), +(329, 0.0100359), +(349, 2.58867), +(369, 2.25408), +(370, 5.99322), +(389, 3.07483), +(409, 0.180635), +(429, 0.911064), +(449, 0.746765), +(450, 5.81195), +(469, 5.80018), +(489, 4.93017), +(509, 4.98335), +(510, 3.6137), +(511, 0.0353394), +(512, 0.0454096), +(529, 0), +(549, 0), +(569, 3.38114), +(609, 3.58927), +(610, 0.898759), +(611, 3.92699), +(629, 0), +(630, 0.153151), +(631, 5.67057), +(633, 3.8059), +(634, 6.24615), +(635, 0.195065), +(636, 6.22035), +(649, 4.91659), +(669, 0), +(670, 0), +(671, 0), +(689, 2.00713), +(690, 4.71239), +(709, 4.27606), +(729, 1.53589), +(749, 2.35619), +(750, 0.261799), +(751, 4.79878), +(769, 3.14159), +(770, 0), +(771, 3.5541), +(772, 5.88176), +(789, 5.55591), +(809, 1.5708), +(810, 0.261799), +(829, 4.7822), +(830, 3.35103), +(849, 0), +(850, 0.915903), +(851, 6.28305), +(852, 0.78761), +(853, 0), +(854, 1.76699), +(869, 2.43866), +(889, 0.805031), +(890, 3.8406), +(891, 2.91208), +(892, 3.11803), +(893, 1.70431), +(894, 1.68861), +(895, 1.86139), +(896, 2.53684), +(897, 5.05011), +(898, 2.74104), +(899, 1.72003), +(909, 6.05544), +(910, 2.89725), +(911, 0), +(912, 5.49779), +(913, 0), +(914, 5.49779), +(915, 0), +(916, 4.71239), +(917, 1.5708), +(918, 5.49779), +(919, 0.785398), +(920, 2.44346), +(921, 5.70723), +(922, 3.14159), +(923, 3.66519), +(924, 4.71239), +(925, 4.88692), +(926, 2.35619), +(927, 4.35582), +(928, 0.174533), +(929, 5.23599), +(930, 4.45059), +(931, 0), +(932, 0), +(933, 3.05433), +(934, 2.96706), +(935, 5.03124), +(936, 2.0944), +(937, 0.118475), +(938, 4.7822), +(939, 3.92699), +(940, 0.785398), +(941, 5.03124), +(942, 5.03124), +(943, 5.03124), +(944, 5.03124), +(945, 5.03124), +(946, 5.03124), +(947, 5.03124), +(948, 5.03124), +(949, 5.03124), +(950, 5.03124), +(951, 5.03124), +(952, 5.03124), +(953, 5.03124), +(954, 5.03124), +(955, 5.03124), +(956, 5.03124), +(957, 5.03124), +(958, 5.03124), +(959, 5.03124), +(960, 5.03124), +(961, 5.03124), +(962, 5.03124), +(963, 5.03124), +(964, 5.03124), +(965, 5.03124), +(966, 5.03124), +(967, 5.03124), +(968, 5.03124), +(969, 3.14159), +(970, 0), +(971, 0), +(972, 0), +(973, 1.5708), +(974, 0), +(975, 0), +(976, 0), +(977, 0), +(978, 0), +(979, 0), +(980, 0), +(981, 0), +(982, 0), +(983, 0), +(984, 0), +(985, 0), +(986, 0), +(987, 0), +(988, 0), +(989, 0), +(990, 0), +(991, 0), +(992, 3.14159), +(993, 3.31613), +(994, 0.261799), +(995, 0), +(996, 5.03124), +(997, 0.493387), +(998, 0), +(999, 0), +(1000, 0), +(1001, 0), +(1002, 0), +(1003, 0), +(1004, 0), +(1005, 0), +(1006, 0), +(1007, 0), +(1008, 0), +(1009, 0), +(1010, 0), +(1011, 0), +(1012, 0), +(1013, 0), +(1014, 0), +(1015, 0), +(1016, 0), +(1017, 0), +(1018, 0), +(1019, 0), +(1020, 0), +(1021, 0), +(1022, 0), +(1023, 0), +(1024, 0), +(1025, 0), +(1026, 0), +(1027, 0), +(1028, 0), +(1029, 0), +(1030, 0), +(1031, 0), +(1032, 0), +(1033, 0), +(1034, 0), +(1035, 0), +(1036, 0), +(1037, 0.523599), +(1038, 2.35619), +(1039, 0.785398), +(1040, 2.0944), +(1041, 4.71239), +(1042, 1.48353), +(1043, 0), +(1044, 3.14159), +(1045, 0.785398), +(1046, 3.05433), +(1047, 1.5708), +(1048, 0.523599), +(1049, 4.36332), +(1050, 2.61799), +(1051, 0), +(1052, 0), +(1053, 0), +(1054, 0), +(1055, 0), +(1056, 0), +(1057, 0), +(1058, 0), +(1059, 0), +(1060, 0), +(1061, 0), +(1062, 0), +(1063, 0), +(1064, 0), +(1065, 0), +(1066, 0), +(1067, 0), +(1068, 0), +(1069, 0), +(1070, 0), +(1071, 0), +(1072, 0), +(1073, 0), +(1074, 0), +(1075, 0), +(1076, 0), +(1077, 0), +(1078, 0), +(1079, 0), +(1080, 0), +(1081, 0), +(1082, 0), +(1083, 0), +(1084, 0), +(1085, 0), +(1086, 0), +(1087, 0), +(1088, 0), +(1089, 0), +(1090, 0), +(1091, 0), +(1092, 0), +(1093, 0), +(1094, 0), +(1095, 0), +(1096, 0), +(1097, 0), +(1098, 0), +(1099, 0), +(1100, 0), +(1101, 0), +(1102, 0), +(1103, 3.14159), +(1104, 0), +(1105, 5.93412), +(1106, 1.13446), +(1107, 4.71239), +(1108, 3.92699), +(1109, 3.14159), +(1110, 3.14159), +(1111, 3.14159), +(1112, 3.14159), +(1113, 3.14159), +(1114, 3.14159), +(1115, 3.14159), +(1116, 3.14159), +(1117, 3.14159), +(1118, 3.14159), +(1119, 3.14159), +(1120, 3.14159), +(1121, 3.14159), +(1122, 3.14159), +(1123, 3.14159), +(1124, 3.14159), +(1125, 3.14159), +(1126, 3.14159), +(1127, 3.14159), +(1128, 3.14159), +(1129, 3.14159), +(1130, 3.14159), +(1131, 3.14159), +(1132, 3.14159), +(1133, 3.14159), +(1134, 0), +(1135, 0), +(1136, 0), +(1137, 0), +(1138, 0), +(1139, 0), +(1140, 0), +(1141, 0), +(1142, 0), +(1143, 0), +(1144, 0), +(1145, 0), +(1146, 0), +(1147, 0), +(1148, 0), +(1149, 0), +(1150, 0), +(1151, 0), +(1152, 0), +(1153, 0), +(1154, 0), +(1155, 0), +(1156, 0), +(1157, 0), +(1158, 0), +(1159, 0), +(1160, 0), +(1161, 0), +(1162, 0), +(1163, 0), +(1164, 0), +(1165, 0), +(1166, 0), +(1167, 0), +(1168, 0), +(1169, 0), +(1170, 0), +(1171, 0), +(1172, 0), +(1173, 0), +(1174, 0), +(1175, 0), +(1176, 0), +(1177, 0), +(1178, 0), +(1179, 0), +(1180, 0), +(1181, 0), +(1182, 0), +(1183, 0), +(1184, 0), +(1185, 0), +(1186, 0), +(1187, 0), +(1188, 0), +(1189, 0), +(1190, 0), +(1191, 0), +(1192, 0), +(1193, 0), +(1194, 0), +(1195, 0), +(1196, 0), +(1197, 0), +(1198, 0), +(1199, 0), +(1200, 0), +(1201, 0), +(1202, 0), +(1203, 0), +(1204, 0), +(1205, 0), +(1206, 0), +(1207, 0), +(1208, 0), +(1209, 0), +(1210, 0), +(1211, 0), +(1212, 0), +(1213, 0), +(1214, 0), +(1215, 0), +(1216, 0), +(1217, 0), +(1218, 0), +(1219, 0), +(1220, 0), +(1221, 0), +(1222, 0), +(1223, 0), +(1224, 0), +(1225, 0), +(1226, 0), +(1227, 0), +(1228, 0), +(1229, 0), +(1230, 0), +(1231, 0), +(1232, 0), +(1233, 0), +(1234, 0), +(1235, 0), +(1236, 0), +(1237, 0), +(1238, 0), +(1239, 0), +(1240, 3.28122), +(1241, 2.35619), +(1242, 0), +(1243, 3.92699), +(1244, 3.14159), +(1245, 3.14159), +(1246, 4.7822), +(1247, 5.49779), +(1248, 0.785398), +(1249, 0.804483), +(1250, 1.0472), +(1251, 2.61799), +(1252, 2.70526), +(1253, 4.71239), +(1254, 1.91986), +(1255, 3.92699), +(1256, 1.74533), +(1257, 0), +(1258, 4.88692), +(1259, 1.74533), +(1260, 0), +(1261, 3.14159), +(1262, 0), +(1263, 0), +(1264, 4.71239), +(1265, 4.71239), +(1266, 0), +(1267, 0.785398), +(1268, 3.14159), +(1269, 0), +(1270, 3.14159), +(1271, 1.5708), +(1272, 1.309), +(1273, 0), +(1274, 0), +(1275, 3.92699), +(1276, 5.23599), +(1277, 3.14159), +(1278, 0), +(1279, 2.87979), +(1280, 0.785398), +(1281, 1.5708), +(1282, 5.06145), +(1283, 1.5708), +(1284, 1.5708), +(1285, 0.785398), +(1286, 4.71239), +(1287, 6.10865), +(1288, 3.14159), +(1289, 0.785398), +(1290, 0), +(1291, 5.13127), +(1292, 2.7057), +(1293, 2.7057), +(1294, 2.7057), +(1295, 0.785398), +(1296, 0.785398), +(1297, 0.785398), +(1298, 0.785398), +(1299, 0), +(1300, 0.785398), +(1301, 0.785398), +(1302, 0.785398), +(1303, 0.785398), +(1304, 0.785398), +(1305, 0.785398), +(1306, 0.785398), +(1307, 0.785398), +(1308, 0.785398), +(1309, 0.785398), +(1310, 0.785398), +(1311, 0.785398), +(1312, 0.785398), +(1313, 0.785398), +(1314, 0.785398), +(1315, 0.785398), +(1316, 0.785398), +(1317, 3.33358), +(1318, 2.79253), +(1319, 2.93215), +(1320, 2.3911), +(1321, 2.70526), +(1322, 3.15905), +(1323, 1.50098), +(1324, 0.785398), +(1325, 1.5708), +(1326, 6.16101), +(1327, 0.785398), +(1328, 0.785398), +(1329, 0.785398), +(1330, 3.94444), +(1331, 3.57792), +(1332, 1.5708), +(1333, 0.785398), +(1334, 0.785398), +(1336, 3.17063), +(1337, 0), +(1341, 0.95581), +(1342, 0.515984), +(1343, 1.76085), +(1344, 4.79639), +(1345, 4.61184), +(1346, 0.785398), +(1347, 0.785398), +(1348, 0.785398), +(1349, 0.785398), +(1350, 0), +(1351, 0.785398), +(1352, 6.27788), +(1353, 1.78305), +(1354, 3.29495), +(1355, 0.958894), +(1356, 3.83293), +(1357, 3.37739), +(1358, 4.07248), +(1359, 1.59829), +(1360, 0.785398), +(1361, 4.86949), +(1362, 0.17455), +(1363, 3.31614), +(1364, 2.63545), +(1365, 5.81195), +(1366, 0.785398), +(1367, 0.785398), +(1368, 0.785398), +(1369, 0.785398), +(1370, 1.62316), +(1371, 0), +(1372, 0.785398), +(1373, 4.7822), +(1375, 4.7822), +(1376, 0), +(1377, 0.785398), +(1378, 4.7822), +(1379, 3.17063), +(1380, 1.59829), +(1381, 0.212059), +(1383, 0.212059), +(1384, 0.212059), +(1385, 0.212059), +(1387, 0.212059), +(1388, 0.212059), +(1391, 1.59829), +(1392, 1.59829), +(1393, 0.785398), +(1394, 0.785398), +(1395, 0.491507), +(1396, 2.33719), +(1397, 1.16937), +(1398, 0.785398), +(1399, 0.785398), +(1400, 0.212059), +(1401, 0.212059), +(1402, 0.212059), +(1403, 0.212059), +(1404, 3.17063), +(1405, 0.551332), +(1407, 2.33719), +(1408, 0.212059), +(1409, 0.785398), +(1410, 0.785398), +(1411, 2.35619), +(1416, 3.71755), +(1417, 3.97935), +(1418, 1.81514), +(1419, 6.23212), +(1420, 1.62577), +(1421, 0.283921), +(1422, 6.02139), +(1423, 1.72788), +(1424, 2.90967), +(1425, 0.699179), +(1426, 3.09276), +(1427, 0.0733387), +(1428, 0), +(1429, 2.0944), +(1430, 4.31096), +(1431, 0.162371), +(1432, 4.06662), +(1433, 3.12414), +(1434, 5.93412), +(1435, 3.15905), +(1436, 4.5204), +(1437, 1.18682), +(1438, 4.71239), +(1439, 3.92699), +(1440, 5.53269), +(1441, 2.19911), +(1442, 3.71755), +(1443, 1.43117), +(1444, 2.51327), +(1445, 3.57792), +(1446, 2.94961), +(1447, 4.17134), +(1448, 0.80333), +(1449, 0.349066), +(1450, 5.74213), +(1451, 2.96706), +(1452, 5.75959), +(1453, 3.05433), +(1454, 3.10669), +(1455, 1.72788), +(1456, 5.69962), +(1457, 1.88496), +(1458, 1.5708), +(1459, 0.436332), +(1460, 0.174533), +(1461, 4.86947), +(1462, 4.67748), +(1463, 6.16101), +(1464, 2.37365), +(1465, 1.74533), +(1466, 6.16101), +(1467, 3.31613), +(1468, 0.837758), +(1469, 6.24828), +(1470, 1.69297), +(1471, 0.785398), +(1472, 1.11701), +(1473, 0.15708), +(1474, 0), +(1475, 5.80018), +(1476, 2.87979), +(1477, 0.785398), +(1478, 0.212059), +(1480, 4.71239), +(1481, 1.5708), +(1482, 4.57276), +(1483, 5.23599), +(1484, 1.88496), +(1485, 0), +(1486, 3.14159), +(1488, 5.33195), +(1489, 0.139626), +(1491, 3.22886), +(1492, 3.22624), +(1493, 1.3409), +(1494, 0.785398), +(1495, 0.785398), +(1496, 1.13446), +(1497, 4.24115), +(1681, 0.688792), +(1682, 6.28163), +(1683, 3.14159), +(1689, 2.7646), +(1690, 0.125664), +(1691, 0.139626), +(1692, 0), +(1693, 2.61799), +(1694, 0), +(1695, 3.49066), +(1696, 3.14159), +(1697, 1.91986), +(1698, 3.49066), +(1699, 3.83972), +(1700, 0), +(1701, 0), +(1702, 0.872665), +(1703, 2.87979), +(1704, 3.71755), +(1705, 0.174533), +(1706, 0), +(1707, 0.872665), +(1708, 3.26377), +(1709, 3.83972), +(1710, 4.45059), +(1711, 5.75959), +(1712, 1.51844), +(1713, 0.453786), +(1714, 5.41052), +(1715, 1.0472), +(1716, 0.715585), +(1720, 0.698132), +(1721, 4.66528), +(1722, 1.23702), +(1723, 5.57242), +(1724, 1.0446), +(1725, 6.21056), +(1726, 2.61799), +(1727, 0), +(1728, 0), +(1729, 3.14159), +(1730, 5.15089), +(1731, 2.6396), +(1732, 4.07465), +(1733, 5.67134), +(1734, 0.16178), +(1735, 1.5708), +(1736, 4.53786), +(1738, 0.523599), +(1739, 3.14159), +(1740, 5.93412), +(1741, 3.93223), +(1742, 3.66519), +(1743, 0.698132), +(1744, 3.50811), +(1745, 3.07092), +(1746, 5.52924), +(1747, 0.718672), +(1748, 2.21657), +(1749, 4.18879), +(1750, 1.0472), +(1751, 6.26552), +(1752, 5.48208), +(1753, 0), +(1754, 1.01316), +(1755, 2.0944), +(1756, 5.41052), +(1757, 2.44346), +(1758, 4.71239), +(1759, 2.00713), +(1761, 3.93052), +(1762, 1.76952), +(1763, 3.78736), +(1764, 0.872665), +(1765, 1.39626), +(1766, 5.58505), +(1767, 4.53786), +(1768, 2.61799), +(1769, 5.75959), +(1770, 1.71042), +(1771, 0), +(1772, 1.0472), +(1773, 0), +(1774, 0.261799), +(1775, 2.37365), +(1777, 5.44675), +(1778, 4.69494), +(1779, 0), +(1780, 0), +(1781, 0), +(1782, 0), +(1783, 2.79253), +(1784, 1.5708), +(1785, 3.14159), +(1786, 3.92699), +(1787, 5.06145), +(1788, 5.58505), +(1789, 3.14159), +(1790, 1.57864), +(1791, 1.55116), +(1792, 6.10008), +(1793, 2.60113), +(1794, 0.735801), +(1795, 5.10263), +(1796, 4.10519), +(1797, 0.785398), +(1798, 5.93412), +(1799, 1.5708), +(1800, 5.51597), +(1801, 1.65965), +(1802, 5.55915), +(1803, 2.28795), +(1804, 6.23062), +(1805, 0.819221), +(1806, 0), +(1807, 0.959931), +(1808, 0), +(1809, 0.0872665), +(1810, 5.58505), +(1811, 3.90954), +(1812, 4.71239), +(1813, 3.40339), +(1814, 2.44346), +(1815, 3.40339), +(1816, 0.715585), +(1817, 6.10865), +(1818, 0), +(1819, 0), +(1820, 0), +(1821, 0), +(1822, 1.02974), +(1823, 1.55334), +(1824, 3.12414), +(1825, 0), +(1826, 0), +(1827, 5.23599), +(1828, 5.41052), +(1829, 4.18879), +(1830, 4.18879), +(1831, 2.79253), +(1832, 2.0944), +(1833, 2.44346), +(1834, 2.26893), +(1835, 5.49779), +(1836, 0), +(1837, 5.23599), +(1838, 0), +(1839, 2.61799), +(1840, 1.91986), +(1841, 0.523599), +(1842, 3.14159), +(1843, 3.14159), +(1844, 1.69297), +(1845, 4.36332), +(1846, 2.40855), +(1847, 4.18879), +(1848, 2.44346), +(1849, 4.06662), +(1850, 4.71239), +(1851, 2.18166), +(1852, 1.0472), +(1853, 2.23402), +(1854, 3.80482), +(1855, 0), +(1856, 4.53786), +(1857, 2.74017), +(1858, 1.0472), +(1859, 1.51844), +(1860, 1.5708), +(1861, 5.23599), +(1862, 2.59225), +(1863, 5.31016), +(1866, 0), +(1868, 1.39626), +(1869, 3.4383), +(1870, 1.3439), +(1871, 3.26377), +(1872, 6.10865), +(1873, 3.87463), +(1874, 2.00713), +(1875, 0.0698132), +(1876, 4.53786), +(1877, 4.88692), +(1878, 0.261799), +(1880, 2.0944), +(1881, 2.26893), +(1886, 1.9166), +(1889, 2.44346), +(1961, 0.610865), +(1962, 4.10152), +(1966, 0), +(1967, 0), +(1969, 2.32129), +(2807, 2.53073), +(2808, 3.9619), +(2809, 5.49779), +(2815, 5.74213), +(2816, 1.65806), +(2841, 0), +(2843, 3.14159), +(2847, 1.13446), +(2849, 4.71239), +(2851, 5.93412), +(2853, 3.92699), +(2855, 3.14159), +(2857, 3.14159), +(2859, 3.14159), +(2861, 3.14159), +(2863, 3.14159), +(2865, 3.14159), +(2867, 3.14159), +(2869, 3.14159), +(2871, 3.14159), +(2873, 3.14159), +(2875, 3.14159), +(2877, 3.14159), +(2879, 3.14159), +(2881, 3.14159), +(2883, 3.14159), +(2885, 3.14159), +(2887, 3.14159), +(2889, 3.14159), +(2891, 3.14159), +(2893, 3.14159), +(2895, 3.14159), +(2897, 3.14159), +(2899, 3.14159), +(2901, 3.14159), +(2903, 3.14159), +(2906, 0), +(2908, 0), +(2910, 0), +(2912, 0), +(2914, 0), +(2916, 0), +(2918, 0), +(2920, 0), +(2922, 0), +(2924, 0), +(2926, 0), +(2928, 0), +(2930, 0), +(2932, 0), +(2934, 0), +(2936, 0), +(2938, 0), +(2940, 0), +(2942, 0), +(2944, 0), +(2946, 0), +(2948, 0), +(2950, 0), +(2952, 0), +(2956, 0), +(2958, 0), +(2960, 0), +(2962, 0), +(2964, 0), +(2966, 0), +(2968, 0), +(2970, 0), +(2972, 0), +(2974, 0), +(2976, 0), +(2978, 0), +(3026, 0), +(3028, 0), +(3030, 0), +(3032, 0), +(3034, 0), +(3036, 0), +(3038, 0), +(3040, 0), +(3042, 0), +(3044, 0), +(3046, 0), +(3048, 0), +(3050, 0), +(3052, 0), +(3054, 0), +(3056, 0), +(3058, 0), +(3060, 0), +(3062, 0), +(3064, 0), +(3066, 0), +(3068, 0), +(3070, 0), +(3072, 0), +(3074, 0), +(3076, 0), +(3078, 0), +(3080, 0), +(3082, 0), +(3084, 0), +(3086, 0), +(3088, 0), +(3090, 0), +(3092, 0), +(3094, 0), +(3096, 0), +(3098, 0), +(3100, 0), +(3102, 0), +(3104, 0), +(3106, 0), +(3108, 0), +(3110, 0), +(3112, 0), +(3114, 0), +(3116, 0), +(3118, 0), +(3120, 0), +(3122, 0), +(3124, 0), +(3126, 0), +(3128, 0), +(3130, 0), +(3132, 0), +(3134, 0), +(3136, 0), +(3138, 0), +(3212, 1.65806), +(3236, 6.26367), +(3238, 3.14159), +(3240, 1.51844), +(3244, 3.86386), +(3403, 0), +(3404, 0); -- cgit v1.2.3 From 1537de5b39d032b0d560db23fc4330f313dda67d Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Sun, 3 Feb 2013 23:11:52 -0500 Subject: Renamed `game_graveyard_orientation` to `graveyard_orientation` --- ..._04_00_world_game_graveyard_orientation_434.sql | 1025 -------------------- ...13_02_04_00_world_graveyard_orientation_434.sql | 1025 ++++++++++++++++++++ 2 files changed, 1025 insertions(+), 1025 deletions(-) delete mode 100644 sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql create mode 100644 sql/updates/world/2013_02_04_00_world_graveyard_orientation_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql b/sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql deleted file mode 100644 index 6b6b2ee7ed0..00000000000 --- a/sql/updates/world/2013_02_04_00_world_game_graveyard_orientation_434.sql +++ /dev/null @@ -1,1025 +0,0 @@ -DROP TABLE IF EXISTS `game_graveyard_orientation`; -CREATE TABLE IF NOT EXISTS `game_graveyard_orientation` ( - `Id` int(10) unsigned NOT NULL DEFAULT '0', - `Orientation` float NOT NULL DEFAULT '0', - PRIMARY KEY (`Id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Orientations used by graveyards'; - - -INSERT INTO `game_graveyard_orientation` (`Id`, `Orientation`) VALUES -(1, 0), -(2, 0.898845), -(3, 3.84632), -(4, 4.016), -(5, 0), -(6, 4.77915), -(7, 2.52685), -(8, 2.79253), -(10, 1.22702), -(31, 3.00197), -(32, 0.212689), -(33, 0), -(34, 1.88888), -(35, 4.86949), -(36, 3.15402), -(39, 4.74773), -(49, 0), -(70, 0.212059), -(89, 1.86139), -(90, 2.41417), -(91, 2.71748), -(92, 1.83612), -(93, 1.11527), -(94, 4.63856), -(96, 0), -(97, 3.14552), -(98, 1.68075), -(99, 2.25147), -(100, 2.05774), -(101, 2.54862), -(102, 0), -(103, 1.5708), -(104, 1.01969), -(105, 2.79406), -(106, 4.4964), -(107, 0), -(108, 3.12588), -(109, 1.31467), -(129, 3.31613), -(149, 0.212058), -(169, 4.4855), -(189, 3.00807), -(209, 1.57738), -(229, 1.3409), -(249, 0.0921225), -(269, 0), -(289, 4.8891), -(309, 6.0672), -(310, 3.10232), -(329, 0.0100359), -(349, 2.58867), -(369, 2.25408), -(370, 5.99322), -(389, 3.07483), -(409, 0.180635), -(429, 0.911064), -(449, 0.746765), -(450, 5.81195), -(469, 5.80018), -(489, 4.93017), -(509, 4.98335), -(510, 3.6137), -(511, 0.0353394), -(512, 0.0454096), -(529, 0), -(549, 0), -(569, 3.38114), -(609, 3.58927), -(610, 0.898759), -(611, 3.92699), -(629, 0), -(630, 0.153151), -(631, 5.67057), -(633, 3.8059), -(634, 6.24615), -(635, 0.195065), -(636, 6.22035), -(649, 4.91659), -(669, 0), -(670, 0), -(671, 0), -(689, 2.00713), -(690, 4.71239), -(709, 4.27606), -(729, 1.53589), -(749, 2.35619), -(750, 0.261799), -(751, 4.79878), -(769, 3.14159), -(770, 0), -(771, 3.5541), -(772, 5.88176), -(789, 5.55591), -(809, 1.5708), -(810, 0.261799), -(829, 4.7822), -(830, 3.35103), -(849, 0), -(850, 0.915903), -(851, 6.28305), -(852, 0.78761), -(853, 0), -(854, 1.76699), -(869, 2.43866), -(889, 0.805031), -(890, 3.8406), -(891, 2.91208), -(892, 3.11803), -(893, 1.70431), -(894, 1.68861), -(895, 1.86139), -(896, 2.53684), -(897, 5.05011), -(898, 2.74104), -(899, 1.72003), -(909, 6.05544), -(910, 2.89725), -(911, 0), -(912, 5.49779), -(913, 0), -(914, 5.49779), -(915, 0), -(916, 4.71239), -(917, 1.5708), -(918, 5.49779), -(919, 0.785398), -(920, 2.44346), -(921, 5.70723), -(922, 3.14159), -(923, 3.66519), -(924, 4.71239), -(925, 4.88692), -(926, 2.35619), -(927, 4.35582), -(928, 0.174533), -(929, 5.23599), -(930, 4.45059), -(931, 0), -(932, 0), -(933, 3.05433), -(934, 2.96706), -(935, 5.03124), -(936, 2.0944), -(937, 0.118475), -(938, 4.7822), -(939, 3.92699), -(940, 0.785398), -(941, 5.03124), -(942, 5.03124), -(943, 5.03124), -(944, 5.03124), -(945, 5.03124), -(946, 5.03124), -(947, 5.03124), -(948, 5.03124), -(949, 5.03124), -(950, 5.03124), -(951, 5.03124), -(952, 5.03124), -(953, 5.03124), -(954, 5.03124), -(955, 5.03124), -(956, 5.03124), -(957, 5.03124), -(958, 5.03124), -(959, 5.03124), -(960, 5.03124), -(961, 5.03124), -(962, 5.03124), -(963, 5.03124), -(964, 5.03124), -(965, 5.03124), -(966, 5.03124), -(967, 5.03124), -(968, 5.03124), -(969, 3.14159), -(970, 0), -(971, 0), -(972, 0), -(973, 1.5708), -(974, 0), -(975, 0), -(976, 0), -(977, 0), -(978, 0), -(979, 0), -(980, 0), -(981, 0), -(982, 0), -(983, 0), -(984, 0), -(985, 0), -(986, 0), -(987, 0), -(988, 0), -(989, 0), -(990, 0), -(991, 0), -(992, 3.14159), -(993, 3.31613), -(994, 0.261799), -(995, 0), -(996, 5.03124), -(997, 0.493387), -(998, 0), -(999, 0), -(1000, 0), -(1001, 0), -(1002, 0), -(1003, 0), -(1004, 0), -(1005, 0), -(1006, 0), -(1007, 0), -(1008, 0), -(1009, 0), -(1010, 0), -(1011, 0), -(1012, 0), -(1013, 0), -(1014, 0), -(1015, 0), -(1016, 0), -(1017, 0), -(1018, 0), -(1019, 0), -(1020, 0), -(1021, 0), -(1022, 0), -(1023, 0), -(1024, 0), -(1025, 0), -(1026, 0), -(1027, 0), -(1028, 0), -(1029, 0), -(1030, 0), -(1031, 0), -(1032, 0), -(1033, 0), -(1034, 0), -(1035, 0), -(1036, 0), -(1037, 0.523599), -(1038, 2.35619), -(1039, 0.785398), -(1040, 2.0944), -(1041, 4.71239), -(1042, 1.48353), -(1043, 0), -(1044, 3.14159), -(1045, 0.785398), -(1046, 3.05433), -(1047, 1.5708), -(1048, 0.523599), -(1049, 4.36332), -(1050, 2.61799), -(1051, 0), -(1052, 0), -(1053, 0), -(1054, 0), -(1055, 0), -(1056, 0), -(1057, 0), -(1058, 0), -(1059, 0), -(1060, 0), -(1061, 0), -(1062, 0), -(1063, 0), -(1064, 0), -(1065, 0), -(1066, 0), -(1067, 0), -(1068, 0), -(1069, 0), -(1070, 0), -(1071, 0), -(1072, 0), -(1073, 0), -(1074, 0), -(1075, 0), -(1076, 0), -(1077, 0), -(1078, 0), -(1079, 0), -(1080, 0), -(1081, 0), -(1082, 0), -(1083, 0), -(1084, 0), -(1085, 0), -(1086, 0), -(1087, 0), -(1088, 0), -(1089, 0), -(1090, 0), -(1091, 0), -(1092, 0), -(1093, 0), -(1094, 0), -(1095, 0), -(1096, 0), -(1097, 0), -(1098, 0), -(1099, 0), -(1100, 0), -(1101, 0), -(1102, 0), -(1103, 3.14159), -(1104, 0), -(1105, 5.93412), -(1106, 1.13446), -(1107, 4.71239), -(1108, 3.92699), -(1109, 3.14159), -(1110, 3.14159), -(1111, 3.14159), -(1112, 3.14159), -(1113, 3.14159), -(1114, 3.14159), -(1115, 3.14159), -(1116, 3.14159), -(1117, 3.14159), -(1118, 3.14159), -(1119, 3.14159), -(1120, 3.14159), -(1121, 3.14159), -(1122, 3.14159), -(1123, 3.14159), -(1124, 3.14159), -(1125, 3.14159), -(1126, 3.14159), -(1127, 3.14159), -(1128, 3.14159), -(1129, 3.14159), -(1130, 3.14159), -(1131, 3.14159), -(1132, 3.14159), -(1133, 3.14159), -(1134, 0), -(1135, 0), -(1136, 0), -(1137, 0), -(1138, 0), -(1139, 0), -(1140, 0), -(1141, 0), -(1142, 0), -(1143, 0), -(1144, 0), -(1145, 0), -(1146, 0), -(1147, 0), -(1148, 0), -(1149, 0), -(1150, 0), -(1151, 0), -(1152, 0), -(1153, 0), -(1154, 0), -(1155, 0), -(1156, 0), -(1157, 0), -(1158, 0), -(1159, 0), -(1160, 0), -(1161, 0), -(1162, 0), -(1163, 0), -(1164, 0), -(1165, 0), -(1166, 0), -(1167, 0), -(1168, 0), -(1169, 0), -(1170, 0), -(1171, 0), -(1172, 0), -(1173, 0), -(1174, 0), -(1175, 0), -(1176, 0), -(1177, 0), -(1178, 0), -(1179, 0), -(1180, 0), -(1181, 0), -(1182, 0), -(1183, 0), -(1184, 0), -(1185, 0), -(1186, 0), -(1187, 0), -(1188, 0), -(1189, 0), -(1190, 0), -(1191, 0), -(1192, 0), -(1193, 0), -(1194, 0), -(1195, 0), -(1196, 0), -(1197, 0), -(1198, 0), -(1199, 0), -(1200, 0), -(1201, 0), -(1202, 0), -(1203, 0), -(1204, 0), -(1205, 0), -(1206, 0), -(1207, 0), -(1208, 0), -(1209, 0), -(1210, 0), -(1211, 0), -(1212, 0), -(1213, 0), -(1214, 0), -(1215, 0), -(1216, 0), -(1217, 0), -(1218, 0), -(1219, 0), -(1220, 0), -(1221, 0), -(1222, 0), -(1223, 0), -(1224, 0), -(1225, 0), -(1226, 0), -(1227, 0), -(1228, 0), -(1229, 0), -(1230, 0), -(1231, 0), -(1232, 0), -(1233, 0), -(1234, 0), -(1235, 0), -(1236, 0), -(1237, 0), -(1238, 0), -(1239, 0), -(1240, 3.28122), -(1241, 2.35619), -(1242, 0), -(1243, 3.92699), -(1244, 3.14159), -(1245, 3.14159), -(1246, 4.7822), -(1247, 5.49779), -(1248, 0.785398), -(1249, 0.804483), -(1250, 1.0472), -(1251, 2.61799), -(1252, 2.70526), -(1253, 4.71239), -(1254, 1.91986), -(1255, 3.92699), -(1256, 1.74533), -(1257, 0), -(1258, 4.88692), -(1259, 1.74533), -(1260, 0), -(1261, 3.14159), -(1262, 0), -(1263, 0), -(1264, 4.71239), -(1265, 4.71239), -(1266, 0), -(1267, 0.785398), -(1268, 3.14159), -(1269, 0), -(1270, 3.14159), -(1271, 1.5708), -(1272, 1.309), -(1273, 0), -(1274, 0), -(1275, 3.92699), -(1276, 5.23599), -(1277, 3.14159), -(1278, 0), -(1279, 2.87979), -(1280, 0.785398), -(1281, 1.5708), -(1282, 5.06145), -(1283, 1.5708), -(1284, 1.5708), -(1285, 0.785398), -(1286, 4.71239), -(1287, 6.10865), -(1288, 3.14159), -(1289, 0.785398), -(1290, 0), -(1291, 5.13127), -(1292, 2.7057), -(1293, 2.7057), -(1294, 2.7057), -(1295, 0.785398), -(1296, 0.785398), -(1297, 0.785398), -(1298, 0.785398), -(1299, 0), -(1300, 0.785398), -(1301, 0.785398), -(1302, 0.785398), -(1303, 0.785398), -(1304, 0.785398), -(1305, 0.785398), -(1306, 0.785398), -(1307, 0.785398), -(1308, 0.785398), -(1309, 0.785398), -(1310, 0.785398), -(1311, 0.785398), -(1312, 0.785398), -(1313, 0.785398), -(1314, 0.785398), -(1315, 0.785398), -(1316, 0.785398), -(1317, 3.33358), -(1318, 2.79253), -(1319, 2.93215), -(1320, 2.3911), -(1321, 2.70526), -(1322, 3.15905), -(1323, 1.50098), -(1324, 0.785398), -(1325, 1.5708), -(1326, 6.16101), -(1327, 0.785398), -(1328, 0.785398), -(1329, 0.785398), -(1330, 3.94444), -(1331, 3.57792), -(1332, 1.5708), -(1333, 0.785398), -(1334, 0.785398), -(1336, 3.17063), -(1337, 0), -(1341, 0.95581), -(1342, 0.515984), -(1343, 1.76085), -(1344, 4.79639), -(1345, 4.61184), -(1346, 0.785398), -(1347, 0.785398), -(1348, 0.785398), -(1349, 0.785398), -(1350, 0), -(1351, 0.785398), -(1352, 6.27788), -(1353, 1.78305), -(1354, 3.29495), -(1355, 0.958894), -(1356, 3.83293), -(1357, 3.37739), -(1358, 4.07248), -(1359, 1.59829), -(1360, 0.785398), -(1361, 4.86949), -(1362, 0.17455), -(1363, 3.31614), -(1364, 2.63545), -(1365, 5.81195), -(1366, 0.785398), -(1367, 0.785398), -(1368, 0.785398), -(1369, 0.785398), -(1370, 1.62316), -(1371, 0), -(1372, 0.785398), -(1373, 4.7822), -(1375, 4.7822), -(1376, 0), -(1377, 0.785398), -(1378, 4.7822), -(1379, 3.17063), -(1380, 1.59829), -(1381, 0.212059), -(1383, 0.212059), -(1384, 0.212059), -(1385, 0.212059), -(1387, 0.212059), -(1388, 0.212059), -(1391, 1.59829), -(1392, 1.59829), -(1393, 0.785398), -(1394, 0.785398), -(1395, 0.491507), -(1396, 2.33719), -(1397, 1.16937), -(1398, 0.785398), -(1399, 0.785398), -(1400, 0.212059), -(1401, 0.212059), -(1402, 0.212059), -(1403, 0.212059), -(1404, 3.17063), -(1405, 0.551332), -(1407, 2.33719), -(1408, 0.212059), -(1409, 0.785398), -(1410, 0.785398), -(1411, 2.35619), -(1416, 3.71755), -(1417, 3.97935), -(1418, 1.81514), -(1419, 6.23212), -(1420, 1.62577), -(1421, 0.283921), -(1422, 6.02139), -(1423, 1.72788), -(1424, 2.90967), -(1425, 0.699179), -(1426, 3.09276), -(1427, 0.0733387), -(1428, 0), -(1429, 2.0944), -(1430, 4.31096), -(1431, 0.162371), -(1432, 4.06662), -(1433, 3.12414), -(1434, 5.93412), -(1435, 3.15905), -(1436, 4.5204), -(1437, 1.18682), -(1438, 4.71239), -(1439, 3.92699), -(1440, 5.53269), -(1441, 2.19911), -(1442, 3.71755), -(1443, 1.43117), -(1444, 2.51327), -(1445, 3.57792), -(1446, 2.94961), -(1447, 4.17134), -(1448, 0.80333), -(1449, 0.349066), -(1450, 5.74213), -(1451, 2.96706), -(1452, 5.75959), -(1453, 3.05433), -(1454, 3.10669), -(1455, 1.72788), -(1456, 5.69962), -(1457, 1.88496), -(1458, 1.5708), -(1459, 0.436332), -(1460, 0.174533), -(1461, 4.86947), -(1462, 4.67748), -(1463, 6.16101), -(1464, 2.37365), -(1465, 1.74533), -(1466, 6.16101), -(1467, 3.31613), -(1468, 0.837758), -(1469, 6.24828), -(1470, 1.69297), -(1471, 0.785398), -(1472, 1.11701), -(1473, 0.15708), -(1474, 0), -(1475, 5.80018), -(1476, 2.87979), -(1477, 0.785398), -(1478, 0.212059), -(1480, 4.71239), -(1481, 1.5708), -(1482, 4.57276), -(1483, 5.23599), -(1484, 1.88496), -(1485, 0), -(1486, 3.14159), -(1488, 5.33195), -(1489, 0.139626), -(1491, 3.22886), -(1492, 3.22624), -(1493, 1.3409), -(1494, 0.785398), -(1495, 0.785398), -(1496, 1.13446), -(1497, 4.24115), -(1681, 0.688792), -(1682, 6.28163), -(1683, 3.14159), -(1689, 2.7646), -(1690, 0.125664), -(1691, 0.139626), -(1692, 0), -(1693, 2.61799), -(1694, 0), -(1695, 3.49066), -(1696, 3.14159), -(1697, 1.91986), -(1698, 3.49066), -(1699, 3.83972), -(1700, 0), -(1701, 0), -(1702, 0.872665), -(1703, 2.87979), -(1704, 3.71755), -(1705, 0.174533), -(1706, 0), -(1707, 0.872665), -(1708, 3.26377), -(1709, 3.83972), -(1710, 4.45059), -(1711, 5.75959), -(1712, 1.51844), -(1713, 0.453786), -(1714, 5.41052), -(1715, 1.0472), -(1716, 0.715585), -(1720, 0.698132), -(1721, 4.66528), -(1722, 1.23702), -(1723, 5.57242), -(1724, 1.0446), -(1725, 6.21056), -(1726, 2.61799), -(1727, 0), -(1728, 0), -(1729, 3.14159), -(1730, 5.15089), -(1731, 2.6396), -(1732, 4.07465), -(1733, 5.67134), -(1734, 0.16178), -(1735, 1.5708), -(1736, 4.53786), -(1738, 0.523599), -(1739, 3.14159), -(1740, 5.93412), -(1741, 3.93223), -(1742, 3.66519), -(1743, 0.698132), -(1744, 3.50811), -(1745, 3.07092), -(1746, 5.52924), -(1747, 0.718672), -(1748, 2.21657), -(1749, 4.18879), -(1750, 1.0472), -(1751, 6.26552), -(1752, 5.48208), -(1753, 0), -(1754, 1.01316), -(1755, 2.0944), -(1756, 5.41052), -(1757, 2.44346), -(1758, 4.71239), -(1759, 2.00713), -(1761, 3.93052), -(1762, 1.76952), -(1763, 3.78736), -(1764, 0.872665), -(1765, 1.39626), -(1766, 5.58505), -(1767, 4.53786), -(1768, 2.61799), -(1769, 5.75959), -(1770, 1.71042), -(1771, 0), -(1772, 1.0472), -(1773, 0), -(1774, 0.261799), -(1775, 2.37365), -(1777, 5.44675), -(1778, 4.69494), -(1779, 0), -(1780, 0), -(1781, 0), -(1782, 0), -(1783, 2.79253), -(1784, 1.5708), -(1785, 3.14159), -(1786, 3.92699), -(1787, 5.06145), -(1788, 5.58505), -(1789, 3.14159), -(1790, 1.57864), -(1791, 1.55116), -(1792, 6.10008), -(1793, 2.60113), -(1794, 0.735801), -(1795, 5.10263), -(1796, 4.10519), -(1797, 0.785398), -(1798, 5.93412), -(1799, 1.5708), -(1800, 5.51597), -(1801, 1.65965), -(1802, 5.55915), -(1803, 2.28795), -(1804, 6.23062), -(1805, 0.819221), -(1806, 0), -(1807, 0.959931), -(1808, 0), -(1809, 0.0872665), -(1810, 5.58505), -(1811, 3.90954), -(1812, 4.71239), -(1813, 3.40339), -(1814, 2.44346), -(1815, 3.40339), -(1816, 0.715585), -(1817, 6.10865), -(1818, 0), -(1819, 0), -(1820, 0), -(1821, 0), -(1822, 1.02974), -(1823, 1.55334), -(1824, 3.12414), -(1825, 0), -(1826, 0), -(1827, 5.23599), -(1828, 5.41052), -(1829, 4.18879), -(1830, 4.18879), -(1831, 2.79253), -(1832, 2.0944), -(1833, 2.44346), -(1834, 2.26893), -(1835, 5.49779), -(1836, 0), -(1837, 5.23599), -(1838, 0), -(1839, 2.61799), -(1840, 1.91986), -(1841, 0.523599), -(1842, 3.14159), -(1843, 3.14159), -(1844, 1.69297), -(1845, 4.36332), -(1846, 2.40855), -(1847, 4.18879), -(1848, 2.44346), -(1849, 4.06662), -(1850, 4.71239), -(1851, 2.18166), -(1852, 1.0472), -(1853, 2.23402), -(1854, 3.80482), -(1855, 0), -(1856, 4.53786), -(1857, 2.74017), -(1858, 1.0472), -(1859, 1.51844), -(1860, 1.5708), -(1861, 5.23599), -(1862, 2.59225), -(1863, 5.31016), -(1866, 0), -(1868, 1.39626), -(1869, 3.4383), -(1870, 1.3439), -(1871, 3.26377), -(1872, 6.10865), -(1873, 3.87463), -(1874, 2.00713), -(1875, 0.0698132), -(1876, 4.53786), -(1877, 4.88692), -(1878, 0.261799), -(1880, 2.0944), -(1881, 2.26893), -(1886, 1.9166), -(1889, 2.44346), -(1961, 0.610865), -(1962, 4.10152), -(1966, 0), -(1967, 0), -(1969, 2.32129), -(2807, 2.53073), -(2808, 3.9619), -(2809, 5.49779), -(2815, 5.74213), -(2816, 1.65806), -(2841, 0), -(2843, 3.14159), -(2847, 1.13446), -(2849, 4.71239), -(2851, 5.93412), -(2853, 3.92699), -(2855, 3.14159), -(2857, 3.14159), -(2859, 3.14159), -(2861, 3.14159), -(2863, 3.14159), -(2865, 3.14159), -(2867, 3.14159), -(2869, 3.14159), -(2871, 3.14159), -(2873, 3.14159), -(2875, 3.14159), -(2877, 3.14159), -(2879, 3.14159), -(2881, 3.14159), -(2883, 3.14159), -(2885, 3.14159), -(2887, 3.14159), -(2889, 3.14159), -(2891, 3.14159), -(2893, 3.14159), -(2895, 3.14159), -(2897, 3.14159), -(2899, 3.14159), -(2901, 3.14159), -(2903, 3.14159), -(2906, 0), -(2908, 0), -(2910, 0), -(2912, 0), -(2914, 0), -(2916, 0), -(2918, 0), -(2920, 0), -(2922, 0), -(2924, 0), -(2926, 0), -(2928, 0), -(2930, 0), -(2932, 0), -(2934, 0), -(2936, 0), -(2938, 0), -(2940, 0), -(2942, 0), -(2944, 0), -(2946, 0), -(2948, 0), -(2950, 0), -(2952, 0), -(2956, 0), -(2958, 0), -(2960, 0), -(2962, 0), -(2964, 0), -(2966, 0), -(2968, 0), -(2970, 0), -(2972, 0), -(2974, 0), -(2976, 0), -(2978, 0), -(3026, 0), -(3028, 0), -(3030, 0), -(3032, 0), -(3034, 0), -(3036, 0), -(3038, 0), -(3040, 0), -(3042, 0), -(3044, 0), -(3046, 0), -(3048, 0), -(3050, 0), -(3052, 0), -(3054, 0), -(3056, 0), -(3058, 0), -(3060, 0), -(3062, 0), -(3064, 0), -(3066, 0), -(3068, 0), -(3070, 0), -(3072, 0), -(3074, 0), -(3076, 0), -(3078, 0), -(3080, 0), -(3082, 0), -(3084, 0), -(3086, 0), -(3088, 0), -(3090, 0), -(3092, 0), -(3094, 0), -(3096, 0), -(3098, 0), -(3100, 0), -(3102, 0), -(3104, 0), -(3106, 0), -(3108, 0), -(3110, 0), -(3112, 0), -(3114, 0), -(3116, 0), -(3118, 0), -(3120, 0), -(3122, 0), -(3124, 0), -(3126, 0), -(3128, 0), -(3130, 0), -(3132, 0), -(3134, 0), -(3136, 0), -(3138, 0), -(3212, 1.65806), -(3236, 6.26367), -(3238, 3.14159), -(3240, 1.51844), -(3244, 3.86386), -(3403, 0), -(3404, 0); diff --git a/sql/updates/world/2013_02_04_00_world_graveyard_orientation_434.sql b/sql/updates/world/2013_02_04_00_world_graveyard_orientation_434.sql new file mode 100644 index 00000000000..e140bbd3c4c --- /dev/null +++ b/sql/updates/world/2013_02_04_00_world_graveyard_orientation_434.sql @@ -0,0 +1,1025 @@ +DROP TABLE IF EXISTS `graveyard_orientation`; +CREATE TABLE IF NOT EXISTS `graveyard_orientation` ( + `Id` int(10) unsigned NOT NULL DEFAULT '0', + `Orientation` float NOT NULL DEFAULT '0', + PRIMARY KEY (`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Orientations used by graveyards'; + + +INSERT INTO `graveyard_orientation` (`Id`, `Orientation`) VALUES +(1, 0), +(2, 0.898845), +(3, 3.84632), +(4, 4.016), +(5, 0), +(6, 4.77915), +(7, 2.52685), +(8, 2.79253), +(10, 1.22702), +(31, 3.00197), +(32, 0.212689), +(33, 0), +(34, 1.88888), +(35, 4.86949), +(36, 3.15402), +(39, 4.74773), +(49, 0), +(70, 0.212059), +(89, 1.86139), +(90, 2.41417), +(91, 2.71748), +(92, 1.83612), +(93, 1.11527), +(94, 4.63856), +(96, 0), +(97, 3.14552), +(98, 1.68075), +(99, 2.25147), +(100, 2.05774), +(101, 2.54862), +(102, 0), +(103, 1.5708), +(104, 1.01969), +(105, 2.79406), +(106, 4.4964), +(107, 0), +(108, 3.12588), +(109, 1.31467), +(129, 3.31613), +(149, 0.212058), +(169, 4.4855), +(189, 3.00807), +(209, 1.57738), +(229, 1.3409), +(249, 0.0921225), +(269, 0), +(289, 4.8891), +(309, 6.0672), +(310, 3.10232), +(329, 0.0100359), +(349, 2.58867), +(369, 2.25408), +(370, 5.99322), +(389, 3.07483), +(409, 0.180635), +(429, 0.911064), +(449, 0.746765), +(450, 5.81195), +(469, 5.80018), +(489, 4.93017), +(509, 4.98335), +(510, 3.6137), +(511, 0.0353394), +(512, 0.0454096), +(529, 0), +(549, 0), +(569, 3.38114), +(609, 3.58927), +(610, 0.898759), +(611, 3.92699), +(629, 0), +(630, 0.153151), +(631, 5.67057), +(633, 3.8059), +(634, 6.24615), +(635, 0.195065), +(636, 6.22035), +(649, 4.91659), +(669, 0), +(670, 0), +(671, 0), +(689, 2.00713), +(690, 4.71239), +(709, 4.27606), +(729, 1.53589), +(749, 2.35619), +(750, 0.261799), +(751, 4.79878), +(769, 3.14159), +(770, 0), +(771, 3.5541), +(772, 5.88176), +(789, 5.55591), +(809, 1.5708), +(810, 0.261799), +(829, 4.7822), +(830, 3.35103), +(849, 0), +(850, 0.915903), +(851, 6.28305), +(852, 0.78761), +(853, 0), +(854, 1.76699), +(869, 2.43866), +(889, 0.805031), +(890, 3.8406), +(891, 2.91208), +(892, 3.11803), +(893, 1.70431), +(894, 1.68861), +(895, 1.86139), +(896, 2.53684), +(897, 5.05011), +(898, 2.74104), +(899, 1.72003), +(909, 6.05544), +(910, 2.89725), +(911, 0), +(912, 5.49779), +(913, 0), +(914, 5.49779), +(915, 0), +(916, 4.71239), +(917, 1.5708), +(918, 5.49779), +(919, 0.785398), +(920, 2.44346), +(921, 5.70723), +(922, 3.14159), +(923, 3.66519), +(924, 4.71239), +(925, 4.88692), +(926, 2.35619), +(927, 4.35582), +(928, 0.174533), +(929, 5.23599), +(930, 4.45059), +(931, 0), +(932, 0), +(933, 3.05433), +(934, 2.96706), +(935, 5.03124), +(936, 2.0944), +(937, 0.118475), +(938, 4.7822), +(939, 3.92699), +(940, 0.785398), +(941, 5.03124), +(942, 5.03124), +(943, 5.03124), +(944, 5.03124), +(945, 5.03124), +(946, 5.03124), +(947, 5.03124), +(948, 5.03124), +(949, 5.03124), +(950, 5.03124), +(951, 5.03124), +(952, 5.03124), +(953, 5.03124), +(954, 5.03124), +(955, 5.03124), +(956, 5.03124), +(957, 5.03124), +(958, 5.03124), +(959, 5.03124), +(960, 5.03124), +(961, 5.03124), +(962, 5.03124), +(963, 5.03124), +(964, 5.03124), +(965, 5.03124), +(966, 5.03124), +(967, 5.03124), +(968, 5.03124), +(969, 3.14159), +(970, 0), +(971, 0), +(972, 0), +(973, 1.5708), +(974, 0), +(975, 0), +(976, 0), +(977, 0), +(978, 0), +(979, 0), +(980, 0), +(981, 0), +(982, 0), +(983, 0), +(984, 0), +(985, 0), +(986, 0), +(987, 0), +(988, 0), +(989, 0), +(990, 0), +(991, 0), +(992, 3.14159), +(993, 3.31613), +(994, 0.261799), +(995, 0), +(996, 5.03124), +(997, 0.493387), +(998, 0), +(999, 0), +(1000, 0), +(1001, 0), +(1002, 0), +(1003, 0), +(1004, 0), +(1005, 0), +(1006, 0), +(1007, 0), +(1008, 0), +(1009, 0), +(1010, 0), +(1011, 0), +(1012, 0), +(1013, 0), +(1014, 0), +(1015, 0), +(1016, 0), +(1017, 0), +(1018, 0), +(1019, 0), +(1020, 0), +(1021, 0), +(1022, 0), +(1023, 0), +(1024, 0), +(1025, 0), +(1026, 0), +(1027, 0), +(1028, 0), +(1029, 0), +(1030, 0), +(1031, 0), +(1032, 0), +(1033, 0), +(1034, 0), +(1035, 0), +(1036, 0), +(1037, 0.523599), +(1038, 2.35619), +(1039, 0.785398), +(1040, 2.0944), +(1041, 4.71239), +(1042, 1.48353), +(1043, 0), +(1044, 3.14159), +(1045, 0.785398), +(1046, 3.05433), +(1047, 1.5708), +(1048, 0.523599), +(1049, 4.36332), +(1050, 2.61799), +(1051, 0), +(1052, 0), +(1053, 0), +(1054, 0), +(1055, 0), +(1056, 0), +(1057, 0), +(1058, 0), +(1059, 0), +(1060, 0), +(1061, 0), +(1062, 0), +(1063, 0), +(1064, 0), +(1065, 0), +(1066, 0), +(1067, 0), +(1068, 0), +(1069, 0), +(1070, 0), +(1071, 0), +(1072, 0), +(1073, 0), +(1074, 0), +(1075, 0), +(1076, 0), +(1077, 0), +(1078, 0), +(1079, 0), +(1080, 0), +(1081, 0), +(1082, 0), +(1083, 0), +(1084, 0), +(1085, 0), +(1086, 0), +(1087, 0), +(1088, 0), +(1089, 0), +(1090, 0), +(1091, 0), +(1092, 0), +(1093, 0), +(1094, 0), +(1095, 0), +(1096, 0), +(1097, 0), +(1098, 0), +(1099, 0), +(1100, 0), +(1101, 0), +(1102, 0), +(1103, 3.14159), +(1104, 0), +(1105, 5.93412), +(1106, 1.13446), +(1107, 4.71239), +(1108, 3.92699), +(1109, 3.14159), +(1110, 3.14159), +(1111, 3.14159), +(1112, 3.14159), +(1113, 3.14159), +(1114, 3.14159), +(1115, 3.14159), +(1116, 3.14159), +(1117, 3.14159), +(1118, 3.14159), +(1119, 3.14159), +(1120, 3.14159), +(1121, 3.14159), +(1122, 3.14159), +(1123, 3.14159), +(1124, 3.14159), +(1125, 3.14159), +(1126, 3.14159), +(1127, 3.14159), +(1128, 3.14159), +(1129, 3.14159), +(1130, 3.14159), +(1131, 3.14159), +(1132, 3.14159), +(1133, 3.14159), +(1134, 0), +(1135, 0), +(1136, 0), +(1137, 0), +(1138, 0), +(1139, 0), +(1140, 0), +(1141, 0), +(1142, 0), +(1143, 0), +(1144, 0), +(1145, 0), +(1146, 0), +(1147, 0), +(1148, 0), +(1149, 0), +(1150, 0), +(1151, 0), +(1152, 0), +(1153, 0), +(1154, 0), +(1155, 0), +(1156, 0), +(1157, 0), +(1158, 0), +(1159, 0), +(1160, 0), +(1161, 0), +(1162, 0), +(1163, 0), +(1164, 0), +(1165, 0), +(1166, 0), +(1167, 0), +(1168, 0), +(1169, 0), +(1170, 0), +(1171, 0), +(1172, 0), +(1173, 0), +(1174, 0), +(1175, 0), +(1176, 0), +(1177, 0), +(1178, 0), +(1179, 0), +(1180, 0), +(1181, 0), +(1182, 0), +(1183, 0), +(1184, 0), +(1185, 0), +(1186, 0), +(1187, 0), +(1188, 0), +(1189, 0), +(1190, 0), +(1191, 0), +(1192, 0), +(1193, 0), +(1194, 0), +(1195, 0), +(1196, 0), +(1197, 0), +(1198, 0), +(1199, 0), +(1200, 0), +(1201, 0), +(1202, 0), +(1203, 0), +(1204, 0), +(1205, 0), +(1206, 0), +(1207, 0), +(1208, 0), +(1209, 0), +(1210, 0), +(1211, 0), +(1212, 0), +(1213, 0), +(1214, 0), +(1215, 0), +(1216, 0), +(1217, 0), +(1218, 0), +(1219, 0), +(1220, 0), +(1221, 0), +(1222, 0), +(1223, 0), +(1224, 0), +(1225, 0), +(1226, 0), +(1227, 0), +(1228, 0), +(1229, 0), +(1230, 0), +(1231, 0), +(1232, 0), +(1233, 0), +(1234, 0), +(1235, 0), +(1236, 0), +(1237, 0), +(1238, 0), +(1239, 0), +(1240, 3.28122), +(1241, 2.35619), +(1242, 0), +(1243, 3.92699), +(1244, 3.14159), +(1245, 3.14159), +(1246, 4.7822), +(1247, 5.49779), +(1248, 0.785398), +(1249, 0.804483), +(1250, 1.0472), +(1251, 2.61799), +(1252, 2.70526), +(1253, 4.71239), +(1254, 1.91986), +(1255, 3.92699), +(1256, 1.74533), +(1257, 0), +(1258, 4.88692), +(1259, 1.74533), +(1260, 0), +(1261, 3.14159), +(1262, 0), +(1263, 0), +(1264, 4.71239), +(1265, 4.71239), +(1266, 0), +(1267, 0.785398), +(1268, 3.14159), +(1269, 0), +(1270, 3.14159), +(1271, 1.5708), +(1272, 1.309), +(1273, 0), +(1274, 0), +(1275, 3.92699), +(1276, 5.23599), +(1277, 3.14159), +(1278, 0), +(1279, 2.87979), +(1280, 0.785398), +(1281, 1.5708), +(1282, 5.06145), +(1283, 1.5708), +(1284, 1.5708), +(1285, 0.785398), +(1286, 4.71239), +(1287, 6.10865), +(1288, 3.14159), +(1289, 0.785398), +(1290, 0), +(1291, 5.13127), +(1292, 2.7057), +(1293, 2.7057), +(1294, 2.7057), +(1295, 0.785398), +(1296, 0.785398), +(1297, 0.785398), +(1298, 0.785398), +(1299, 0), +(1300, 0.785398), +(1301, 0.785398), +(1302, 0.785398), +(1303, 0.785398), +(1304, 0.785398), +(1305, 0.785398), +(1306, 0.785398), +(1307, 0.785398), +(1308, 0.785398), +(1309, 0.785398), +(1310, 0.785398), +(1311, 0.785398), +(1312, 0.785398), +(1313, 0.785398), +(1314, 0.785398), +(1315, 0.785398), +(1316, 0.785398), +(1317, 3.33358), +(1318, 2.79253), +(1319, 2.93215), +(1320, 2.3911), +(1321, 2.70526), +(1322, 3.15905), +(1323, 1.50098), +(1324, 0.785398), +(1325, 1.5708), +(1326, 6.16101), +(1327, 0.785398), +(1328, 0.785398), +(1329, 0.785398), +(1330, 3.94444), +(1331, 3.57792), +(1332, 1.5708), +(1333, 0.785398), +(1334, 0.785398), +(1336, 3.17063), +(1337, 0), +(1341, 0.95581), +(1342, 0.515984), +(1343, 1.76085), +(1344, 4.79639), +(1345, 4.61184), +(1346, 0.785398), +(1347, 0.785398), +(1348, 0.785398), +(1349, 0.785398), +(1350, 0), +(1351, 0.785398), +(1352, 6.27788), +(1353, 1.78305), +(1354, 3.29495), +(1355, 0.958894), +(1356, 3.83293), +(1357, 3.37739), +(1358, 4.07248), +(1359, 1.59829), +(1360, 0.785398), +(1361, 4.86949), +(1362, 0.17455), +(1363, 3.31614), +(1364, 2.63545), +(1365, 5.81195), +(1366, 0.785398), +(1367, 0.785398), +(1368, 0.785398), +(1369, 0.785398), +(1370, 1.62316), +(1371, 0), +(1372, 0.785398), +(1373, 4.7822), +(1375, 4.7822), +(1376, 0), +(1377, 0.785398), +(1378, 4.7822), +(1379, 3.17063), +(1380, 1.59829), +(1381, 0.212059), +(1383, 0.212059), +(1384, 0.212059), +(1385, 0.212059), +(1387, 0.212059), +(1388, 0.212059), +(1391, 1.59829), +(1392, 1.59829), +(1393, 0.785398), +(1394, 0.785398), +(1395, 0.491507), +(1396, 2.33719), +(1397, 1.16937), +(1398, 0.785398), +(1399, 0.785398), +(1400, 0.212059), +(1401, 0.212059), +(1402, 0.212059), +(1403, 0.212059), +(1404, 3.17063), +(1405, 0.551332), +(1407, 2.33719), +(1408, 0.212059), +(1409, 0.785398), +(1410, 0.785398), +(1411, 2.35619), +(1416, 3.71755), +(1417, 3.97935), +(1418, 1.81514), +(1419, 6.23212), +(1420, 1.62577), +(1421, 0.283921), +(1422, 6.02139), +(1423, 1.72788), +(1424, 2.90967), +(1425, 0.699179), +(1426, 3.09276), +(1427, 0.0733387), +(1428, 0), +(1429, 2.0944), +(1430, 4.31096), +(1431, 0.162371), +(1432, 4.06662), +(1433, 3.12414), +(1434, 5.93412), +(1435, 3.15905), +(1436, 4.5204), +(1437, 1.18682), +(1438, 4.71239), +(1439, 3.92699), +(1440, 5.53269), +(1441, 2.19911), +(1442, 3.71755), +(1443, 1.43117), +(1444, 2.51327), +(1445, 3.57792), +(1446, 2.94961), +(1447, 4.17134), +(1448, 0.80333), +(1449, 0.349066), +(1450, 5.74213), +(1451, 2.96706), +(1452, 5.75959), +(1453, 3.05433), +(1454, 3.10669), +(1455, 1.72788), +(1456, 5.69962), +(1457, 1.88496), +(1458, 1.5708), +(1459, 0.436332), +(1460, 0.174533), +(1461, 4.86947), +(1462, 4.67748), +(1463, 6.16101), +(1464, 2.37365), +(1465, 1.74533), +(1466, 6.16101), +(1467, 3.31613), +(1468, 0.837758), +(1469, 6.24828), +(1470, 1.69297), +(1471, 0.785398), +(1472, 1.11701), +(1473, 0.15708), +(1474, 0), +(1475, 5.80018), +(1476, 2.87979), +(1477, 0.785398), +(1478, 0.212059), +(1480, 4.71239), +(1481, 1.5708), +(1482, 4.57276), +(1483, 5.23599), +(1484, 1.88496), +(1485, 0), +(1486, 3.14159), +(1488, 5.33195), +(1489, 0.139626), +(1491, 3.22886), +(1492, 3.22624), +(1493, 1.3409), +(1494, 0.785398), +(1495, 0.785398), +(1496, 1.13446), +(1497, 4.24115), +(1681, 0.688792), +(1682, 6.28163), +(1683, 3.14159), +(1689, 2.7646), +(1690, 0.125664), +(1691, 0.139626), +(1692, 0), +(1693, 2.61799), +(1694, 0), +(1695, 3.49066), +(1696, 3.14159), +(1697, 1.91986), +(1698, 3.49066), +(1699, 3.83972), +(1700, 0), +(1701, 0), +(1702, 0.872665), +(1703, 2.87979), +(1704, 3.71755), +(1705, 0.174533), +(1706, 0), +(1707, 0.872665), +(1708, 3.26377), +(1709, 3.83972), +(1710, 4.45059), +(1711, 5.75959), +(1712, 1.51844), +(1713, 0.453786), +(1714, 5.41052), +(1715, 1.0472), +(1716, 0.715585), +(1720, 0.698132), +(1721, 4.66528), +(1722, 1.23702), +(1723, 5.57242), +(1724, 1.0446), +(1725, 6.21056), +(1726, 2.61799), +(1727, 0), +(1728, 0), +(1729, 3.14159), +(1730, 5.15089), +(1731, 2.6396), +(1732, 4.07465), +(1733, 5.67134), +(1734, 0.16178), +(1735, 1.5708), +(1736, 4.53786), +(1738, 0.523599), +(1739, 3.14159), +(1740, 5.93412), +(1741, 3.93223), +(1742, 3.66519), +(1743, 0.698132), +(1744, 3.50811), +(1745, 3.07092), +(1746, 5.52924), +(1747, 0.718672), +(1748, 2.21657), +(1749, 4.18879), +(1750, 1.0472), +(1751, 6.26552), +(1752, 5.48208), +(1753, 0), +(1754, 1.01316), +(1755, 2.0944), +(1756, 5.41052), +(1757, 2.44346), +(1758, 4.71239), +(1759, 2.00713), +(1761, 3.93052), +(1762, 1.76952), +(1763, 3.78736), +(1764, 0.872665), +(1765, 1.39626), +(1766, 5.58505), +(1767, 4.53786), +(1768, 2.61799), +(1769, 5.75959), +(1770, 1.71042), +(1771, 0), +(1772, 1.0472), +(1773, 0), +(1774, 0.261799), +(1775, 2.37365), +(1777, 5.44675), +(1778, 4.69494), +(1779, 0), +(1780, 0), +(1781, 0), +(1782, 0), +(1783, 2.79253), +(1784, 1.5708), +(1785, 3.14159), +(1786, 3.92699), +(1787, 5.06145), +(1788, 5.58505), +(1789, 3.14159), +(1790, 1.57864), +(1791, 1.55116), +(1792, 6.10008), +(1793, 2.60113), +(1794, 0.735801), +(1795, 5.10263), +(1796, 4.10519), +(1797, 0.785398), +(1798, 5.93412), +(1799, 1.5708), +(1800, 5.51597), +(1801, 1.65965), +(1802, 5.55915), +(1803, 2.28795), +(1804, 6.23062), +(1805, 0.819221), +(1806, 0), +(1807, 0.959931), +(1808, 0), +(1809, 0.0872665), +(1810, 5.58505), +(1811, 3.90954), +(1812, 4.71239), +(1813, 3.40339), +(1814, 2.44346), +(1815, 3.40339), +(1816, 0.715585), +(1817, 6.10865), +(1818, 0), +(1819, 0), +(1820, 0), +(1821, 0), +(1822, 1.02974), +(1823, 1.55334), +(1824, 3.12414), +(1825, 0), +(1826, 0), +(1827, 5.23599), +(1828, 5.41052), +(1829, 4.18879), +(1830, 4.18879), +(1831, 2.79253), +(1832, 2.0944), +(1833, 2.44346), +(1834, 2.26893), +(1835, 5.49779), +(1836, 0), +(1837, 5.23599), +(1838, 0), +(1839, 2.61799), +(1840, 1.91986), +(1841, 0.523599), +(1842, 3.14159), +(1843, 3.14159), +(1844, 1.69297), +(1845, 4.36332), +(1846, 2.40855), +(1847, 4.18879), +(1848, 2.44346), +(1849, 4.06662), +(1850, 4.71239), +(1851, 2.18166), +(1852, 1.0472), +(1853, 2.23402), +(1854, 3.80482), +(1855, 0), +(1856, 4.53786), +(1857, 2.74017), +(1858, 1.0472), +(1859, 1.51844), +(1860, 1.5708), +(1861, 5.23599), +(1862, 2.59225), +(1863, 5.31016), +(1866, 0), +(1868, 1.39626), +(1869, 3.4383), +(1870, 1.3439), +(1871, 3.26377), +(1872, 6.10865), +(1873, 3.87463), +(1874, 2.00713), +(1875, 0.0698132), +(1876, 4.53786), +(1877, 4.88692), +(1878, 0.261799), +(1880, 2.0944), +(1881, 2.26893), +(1886, 1.9166), +(1889, 2.44346), +(1961, 0.610865), +(1962, 4.10152), +(1966, 0), +(1967, 0), +(1969, 2.32129), +(2807, 2.53073), +(2808, 3.9619), +(2809, 5.49779), +(2815, 5.74213), +(2816, 1.65806), +(2841, 0), +(2843, 3.14159), +(2847, 1.13446), +(2849, 4.71239), +(2851, 5.93412), +(2853, 3.92699), +(2855, 3.14159), +(2857, 3.14159), +(2859, 3.14159), +(2861, 3.14159), +(2863, 3.14159), +(2865, 3.14159), +(2867, 3.14159), +(2869, 3.14159), +(2871, 3.14159), +(2873, 3.14159), +(2875, 3.14159), +(2877, 3.14159), +(2879, 3.14159), +(2881, 3.14159), +(2883, 3.14159), +(2885, 3.14159), +(2887, 3.14159), +(2889, 3.14159), +(2891, 3.14159), +(2893, 3.14159), +(2895, 3.14159), +(2897, 3.14159), +(2899, 3.14159), +(2901, 3.14159), +(2903, 3.14159), +(2906, 0), +(2908, 0), +(2910, 0), +(2912, 0), +(2914, 0), +(2916, 0), +(2918, 0), +(2920, 0), +(2922, 0), +(2924, 0), +(2926, 0), +(2928, 0), +(2930, 0), +(2932, 0), +(2934, 0), +(2936, 0), +(2938, 0), +(2940, 0), +(2942, 0), +(2944, 0), +(2946, 0), +(2948, 0), +(2950, 0), +(2952, 0), +(2956, 0), +(2958, 0), +(2960, 0), +(2962, 0), +(2964, 0), +(2966, 0), +(2968, 0), +(2970, 0), +(2972, 0), +(2974, 0), +(2976, 0), +(2978, 0), +(3026, 0), +(3028, 0), +(3030, 0), +(3032, 0), +(3034, 0), +(3036, 0), +(3038, 0), +(3040, 0), +(3042, 0), +(3044, 0), +(3046, 0), +(3048, 0), +(3050, 0), +(3052, 0), +(3054, 0), +(3056, 0), +(3058, 0), +(3060, 0), +(3062, 0), +(3064, 0), +(3066, 0), +(3068, 0), +(3070, 0), +(3072, 0), +(3074, 0), +(3076, 0), +(3078, 0), +(3080, 0), +(3082, 0), +(3084, 0), +(3086, 0), +(3088, 0), +(3090, 0), +(3092, 0), +(3094, 0), +(3096, 0), +(3098, 0), +(3100, 0), +(3102, 0), +(3104, 0), +(3106, 0), +(3108, 0), +(3110, 0), +(3112, 0), +(3114, 0), +(3116, 0), +(3118, 0), +(3120, 0), +(3122, 0), +(3124, 0), +(3126, 0), +(3128, 0), +(3130, 0), +(3132, 0), +(3134, 0), +(3136, 0), +(3138, 0), +(3212, 1.65806), +(3236, 6.26367), +(3238, 3.14159), +(3240, 1.51844), +(3244, 3.86386), +(3403, 0), +(3404, 0); -- cgit v1.2.3 From b980aff83e214bab60f141c879c2a392789a4d16 Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 4 Feb 2013 08:21:25 +0100 Subject: Core: Implement Role based Access Control - This system will give more control of actions an account can perform. System defines: - Permissions to perform some action - Roles: a set of permissions that have some relation - Groups: a set of roles that have some relation Operations: - Grant: Assign and allow - Deny: Assign and do not allow - Revoke: Remove Precedence to know if something can be done: Grant, Deny. That means, if you are granted some action by a role but you have denied the permission, the action can not be done. Some Rules: - Groups can only have roles - Roles can only have permissions - An account can be assigned granted and denied roles. Permissions inherited from roles are granted if roles is granted and denied if roles is denied - An account can be assigned granted and denied permissions - An account can have multiple groups, roles and permissions - An account can not have same role granted and denied at same time - An acconnt can not have same permission granted and denied at same time - Id 0 can not be used to define a group, role or permission Added some permissions as a sample of use (Instant Logout, Skip Queue, Join BGs, Join DF) and some permissions as a workaround to commands till command system is modified to use RBAC --- sql/updates/auth/2013_02_04_00_auth_misc.sql | 173 ++++++++++++++++ sql/updates/world/2013_02_04_03_world_misc.sql | 53 +++++ src/server/game/AI/CreatureAIImpl.h | 30 +-- src/server/game/Accounts/AccountMgr.cpp | 217 ++++++++++++++++++++- src/server/game/Accounts/AccountMgr.h | 27 ++- src/server/game/Chat/Chat.cpp | 25 ++- src/server/game/DungeonFinding/LFGMgr.cpp | 11 +- src/server/game/DungeonFinding/LFGMgr.h | 2 +- src/server/game/Entities/Player/Player.cpp | 11 +- src/server/game/Handlers/MiscHandler.cpp | 2 +- src/server/game/Miscellaneous/Language.h | 35 +++- src/server/game/Scripting/ScriptLoader.cpp | 2 + src/server/game/Server/WorldSession.cpp | 29 ++- src/server/game/Server/WorldSession.h | 6 + src/server/game/Server/WorldSocket.cpp | 1 + src/server/game/World/World.cpp | 7 +- src/server/scripts/Commands/CMakeLists.txt | 1 + src/server/scripts/Commands/cs_account.cpp | 34 +--- .../Database/Implementation/LoginDatabase.cpp | 16 +- .../shared/Database/Implementation/LoginDatabase.h | 10 + src/server/worldserver/worldserver.conf.dist | 20 -- 21 files changed, 625 insertions(+), 87 deletions(-) create mode 100644 sql/updates/auth/2013_02_04_00_auth_misc.sql create mode 100644 sql/updates/world/2013_02_04_03_world_misc.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_02_04_00_auth_misc.sql b/sql/updates/auth/2013_02_04_00_auth_misc.sql new file mode 100644 index 00000000000..573b58ac156 --- /dev/null +++ b/sql/updates/auth/2013_02_04_00_auth_misc.sql @@ -0,0 +1,173 @@ +-- Need them first in case of re-execute due to foreign keys +DROP TABLE IF EXISTS `rbac_account_permissions`; +DROP TABLE IF EXISTS `rbac_account_roles`; +DROP TABLE IF EXISTS `rbac_account_groups`; +DROP TABLE IF EXISTS `rbac_role_permissions`; +DROP TABLE IF EXISTS `rbac_group_roles`; +DROP TABLE IF EXISTS `rbac_permissions`; +DROP TABLE IF EXISTS `rbac_roles`; +DROP TABLE IF EXISTS `rbac_groups`; +DROP TABLE IF EXISTS `rbac_security_level_groups`; + +CREATE TABLE IF NOT EXISTS `rbac_groups` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Group id', + `name` varchar(50) NOT NULL COMMENT 'Group name', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Group List'; + +CREATE TABLE IF NOT EXISTS `rbac_roles` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Role id', + `name` varchar(50) NOT NULL COMMENT 'Role name', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Roles List'; + +CREATE TABLE IF NOT EXISTS `rbac_permissions` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Permission id', + `name` varchar(100) NOT NULL COMMENT 'Permission name', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Permission List'; + +CREATE TABLE IF NOT EXISTS `rbac_group_roles` ( + `groupId` int(10) unsigned NOT NULL COMMENT 'group id', + `roleId` int(10) unsigned NOT NULL COMMENT 'Role id', + PRIMARY KEY (`groupId`, `roleId`), + CONSTRAINT `fk__rbac_group_roles__rbac_roles` + FOREIGN KEY (`roleId`) REFERENCES `rbac_roles`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT, + CONSTRAINT `fk__rbac_group_roles__rbac_groups` + FOREIGN KEY (`groupId`) REFERENCES `rbac_groups`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Group Role relation'; + +CREATE TABLE IF NOT EXISTS `rbac_role_permissions` ( + `roleId` int(10) unsigned NOT NULL COMMENT 'Role id', + `permissionId` int(10) unsigned NOT NULL COMMENT 'Permission id', + PRIMARY KEY (`roleId`, `permissionId`), + CONSTRAINT `fk__role_permissions__rbac_roles` + FOREIGN KEY (`roleId`) REFERENCES `rbac_roles`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT, + CONSTRAINT `fk__role_permissions__rbac_permissions` + FOREIGN KEY (`permissionId`) REFERENCES `rbac_permissions`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Role Permission relation'; + +CREATE TABLE IF NOT EXISTS `rbac_security_level_groups` ( + `secId` int(10) unsigned NOT NULL COMMENT 'Security Level id', + `groupId` int(10) unsigned NOT NULL COMMENT 'group id', + PRIMARY KEY (`secId`, `groupId`), + CONSTRAINT `fk__rbac_security_level_groups__rbac_groups` + FOREIGN KEY (`groupId`) REFERENCES `rbac_groups`(`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Default groups to assign when an account is set gm level'; + +CREATE TABLE IF NOT EXISTS `rbac_account_groups` ( + `accountId` int(10) unsigned NOT NULL COMMENT 'Account id', + `groupId` int(10) unsigned NOT NULL COMMENT 'Group id', + `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all', + PRIMARY KEY (`accountId`, `groupId`, `realmId`), + CONSTRAINT `fk__rbac_account_groups__account` + FOREIGN KEY (`accountId`) REFERENCES `account`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT, + CONSTRAINT `fk__rbac_account_groups__rbac_groups` + FOREIGN KEY (`groupId`) REFERENCES `rbac_groups`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account-Group relation'; + +CREATE TABLE IF NOT EXISTS `rbac_account_roles` ( + `accountId` int(10) unsigned NOT NULL COMMENT 'Account id', + `roleId` int(10) unsigned NOT NULL COMMENT 'Role id', + `granted` tinyint(1) NOT NULL default 1 COMMENT 'Granted = 1, Denied = 0', + `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all', + PRIMARY KEY (`accountId`, `roleId`, `realmId`), + CONSTRAINT `fk__rbac_account_roles__account` + FOREIGN KEY (`accountId`) REFERENCES `account`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT, + CONSTRAINT `fk__rbac_account_roles__rbac_roles` + FOREIGN KEY (`roleId`) REFERENCES `rbac_roles`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account-Role relation'; + +CREATE TABLE IF NOT EXISTS `rbac_account_permissions` ( + `accountId` int(10) unsigned NOT NULL COMMENT 'Account id', + `permissionId` int(10) unsigned NOT NULL COMMENT 'Permission id', + `granted` tinyint(1) NOT NULL default 1 COMMENT 'Granted = 1, Denied = 0', + `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all', + PRIMARY KEY (`accountId`, `permissionId`, `realmId`), + CONSTRAINT `fk__rbac_account_permissions__account` + FOREIGN KEY (`accountId`) REFERENCES `account`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT, + CONSTRAINT `fk__rbac_account_roles__rbac_permissions` + FOREIGN KEY (`permissionId`) REFERENCES `rbac_permissions`(`id`) + ON DELETE CASCADE ON UPDATE RESTRICT +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account-Permission relation'; + +DELETE FROM `rbac_permissions` WHERE `id` BETWEEN 1 AND 10; +INSERT INTO `rbac_permissions` (`id`, `name`) VALUES +(1, 'Instant logout'), +(2, 'Skip Queue'), +(3, 'Join Normal Battleground'), +(4, 'Join Random Battleground'), +(5, 'Join Arenas'), +(6, 'Join Dungeon Finder'), +(7, 'Player Commands (Temporal till commands moved to rbac)'), +(8, 'Moderator Commands (Temporal till commands moved to rbac)'), +(9, 'GameMaster Commands (Temporal till commands moved to rbac)'), +(10, 'Administrator Commands (Temporal till commands moved to rbac)'); + +DELETE FROM `rbac_roles` WHERE `id` BETWEEN 1 AND 7; +INSERT INTO `rbac_roles` (`id`, `name`) VALUES +(1, 'Player Commands'), +(2, 'Moderator Commands'), +(3, 'GameMaster Commands'), +(4, 'Administrator Commands'), +(5, 'Quick Login/Logout'), +(6, 'Use Battleground/Arenas'), +(7, 'Use Dungeon Finder'); + +DELETE FROM `rbac_groups` WHERE `id` BETWEEN 1 AND 4; +INSERT INTO `rbac_groups` (`id`, `name`) VALUES +(1, 'Player'), +(2, 'Moderator'), +(3, 'GameMaster'), +(4, 'Administrator'); + +DELETE FROM `rbac_role_permissions` WHERE `roleId` BETWEEN 1 AND 7; +INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES +(5, 1), +(5, 2), +(6, 3), +(6, 4), +(6, 5), +(7, 6), +(1, 7), +(2, 8), +(3, 9), +(4, 10); + +DELETE FROM `rbac_group_roles` WHERE `groupId` BETWEEN 1 AND 4; +INSERT INTO `rbac_group_roles` (`groupId`, `roleId`) VALUES +(1, 1), +(1, 6), +(1, 7), +(2, 2), +(2, 5), +(3, 3), +(4, 4); + +TRUNCATE `rbac_account_groups`; +INSERT INTO `rbac_account_groups` (`accountId`, `groupId`, `realmId`) SELECT `id`, 1, -1 FROM `account`; -- Add Player group to all accounts +INSERT INTO `rbac_account_groups` (`accountId`, `groupId`, `realmId`) SELECT `id`, 2, `RealmID` FROM `account_access` WHERE `gmlevel` > 0; -- Add Moderator group to all Moderator or higher GM level +INSERT INTO `rbac_account_groups` (`accountId`, `groupId`, `realmId`) SELECT `id`, 3, `RealmID` FROM `account_access` WHERE `gmlevel` > 1; -- Add GameMaster group to all GameMasters or higher GM level +INSERT INTO `rbac_account_groups` (`accountId`, `groupId`, `realmId`) SELECT `id`, 4, `RealmID` FROM `account_access` WHERE `gmlevel` > 2; -- Add Administrator group to all Administrators + +TRUNCATE `rbac_security_level_groups`; +INSERT INTO `rbac_security_level_groups` (`secId`, `groupId`) VALUES +(0, 1), +(1, 1), +(1, 2), +(2, 1), +(2, 2), +(2, 3), +(3, 1), +(3, 2), +(3, 3), +(3, 4); diff --git a/sql/updates/world/2013_02_04_03_world_misc.sql b/sql/updates/world/2013_02_04_03_world_misc.sql new file mode 100644 index 00000000000..a609d411b6e --- /dev/null +++ b/sql/updates/world/2013_02_04_03_world_misc.sql @@ -0,0 +1,53 @@ +DELETE FROM `trinity_string` WHERE `entry` BETWEEN 63 AND 95; +INSERT INTO trinity_string (entry, content_default) VALUES +(63, "Wrong parameter id: %u, does not exist"), +(64, "Wrong parameter realmId: %d"), +(65, "Couldn't add group %u (%s) realmId %d. Account %u (%s) already has that group"), +(66, "Couldn't remove group %u (%s) realmId %d. Account %u (%s) does not have that group"), +(67, "Added group %u (%s) realmId %d to account %u (%s)"), +(68, "Removed group %u (%s) realmId %d from account %u (%s)"), +(69, "Account %u (%s) groups:"), +(70, "Empty List"), +(71, "- %u (%s)"), +(72, "Couldn't grant role %u (%s) realmId %d. Account %u (%s) already has that role"), +(73, "Couldn't grant role %u (%s) realmId %d. Account %u (%s) has that role in deny list"), +(74, "Granted role %u (%s) realmId %d to account %u (%s)"), +(75, "Couldn't deny role %u (%s) realmId %d. Account %u (%s) already has that role"), +(76, "Couldn't deny role %u (%s) realmId %d. Account %u (%s) has that role in deny list"), +(77, "Denied role %u (%s) realmId %d to account %u (%s)"), +(78, "Denied role %u (%s) realmId %d to account %u (%s)"), +(79, "Couldn't revoke role %u (%s) realmId %d. Account %u (%s) does not have that role"), +(80, "Account %u (%s) granted roles:"), +(81, "Account %u (%s) denied roles:"), +(82, "Couldn't grant permission %u (%s) realmId %d. Account %u (%s) already has that permission"), +(83, "Couldn't grant permission %u (%s) realmId %d. Account %u (%s) has that permission in deny list"), +(84, "Granted permission %u (%s) realmId %d to account %u (%s)"), +(85, "Couldn't deny permission %u (%s) realmId %d. Account %u (%s) already has that permission"), +(86, "Couldn't deny permission %u (%s) realmId %d. Account %u (%s) has that permission in deny list"), +(87, "Denied permission %u (%s) realmId %d to account %u (%s)"), +(88, "Revoked permission %u (%s) realmId %d to account %u (%s)"), +(89, "Couldn't revoke permission %u (%s) realmId %d. Account %u (%s) does not have that permission"), +(90, "Account %u (%s) granted permissions:"), +(91, "Account %u (%s) denied permissions:"), +(92, "Account %u (%s) global permissions:"), +(93, "Groups:"), +(94, "Roles:"), +(95, "Permissions:"); + +DELETE FROM `command` WHERE `name` LIKE '.rbac%'; +INSERT INTO `command` (`name`, `security`, `help`) VALUES +('.rbac account', 3, 'Syntax: .rbac account [$account]\n\nView permissions of selected player or given account\nNote: Only those that affect current realm\n\nNote: Shows real permissions after checking group and roles'), +('.rbac account group', 3, 'Syntax: .rbac account group [$account]\n\nView groups of selected player or given account\nNote: Only those that affect current realm'), +('.rbac account group add', 3, 'Syntax: .rbac account group add [$account] #id [#realmId]\n\nAdd a group to selected player or given account.\n\n#reamID may be -1 for all realms.'), +('.rbac account group remove', 3, 'Syntax: .rbac account group remove [$account] #id\n\nRemove a group from selected player or given account.'), +('.rbac account role', 3, 'Syntax: .rbac account role [$account]\n\nView roles of selected player or given account\nNote: Only those that affect current realm\nNote: Only those directly granted or denied, does not include inherited roles from groups'), +('.rbac account role grant', 3, 'Syntax: .rbac account role grant [$account] #id [#realmId]\n\nGrant a role to selected player or given account.\n\n#reamID may be -1 for all realms.'), +('.rbac account role deny', 3, 'Syntax: .rbac account role deny [$account] #id [#realmId]\n\nDeny a role to selected player or given account.\n\n#reamID may be -1 for all realms.'), +('.rbac account role revoke', 3, 'Syntax: .rbac account role revoke [$account] #id\n\nRemove a role from an account\n\nNote: Removes the role from granted or denied roles'), +('.rbac account permission', 3, 'Syntax: .rbac account permission [$account]\n\nView permissions of selected player or given account\nNote: Only those that affect current realm\nNote: Only those directly granted or denied, does not include inherited permissions from roles'), +('.rbac account permission grant', 3, 'Syntax: .rbac account permission grant [$account] #id [#realmId]\n\nGrant a permission to selected player or given account.\n\n#reamID may be -1 for all realms.'), +('.rbac account permission deny', 3, 'Syntax: .rbac account permission deny [$account] #id [#realmId]\n\nDeny a permission to selected player or given account.\n\n#reamID may be -1 for all realms.'), +('.rbac account permission revoke', 3, 'Syntax: .rbac account permission revoke [$account] #id\n\nRemove a permission from an account\n\nNote: Removes the permission from granted or denied permissions'), +('.rbac list groups', 3, 'Syntax: .rbac list groups [$id]\n\nView list of all groups. If $id is given will show group info and his inherited roles.'), +('.rbac list roles', 3, 'Syntax: .rbac list roles [$id]\n\nView list of all roles. If $id is given will show role info and his inherited permissions.'), +('.rbac list permissions', 3, 'Syntax: .rbac list permissions [$id]\n\nView list of all permissions. If $id is given will show only info for that permission.'); diff --git a/src/server/game/AI/CreatureAIImpl.h b/src/server/game/AI/CreatureAIImpl.h index 7121a031ec2..6c5cb5622b3 100644 --- a/src/server/game/AI/CreatureAIImpl.h +++ b/src/server/game/AI/CreatureAIImpl.h @@ -314,10 +314,10 @@ const T& RAND(const T& v1, const T& v2, const T& v3, const T& v4, const T& v5, c class EventMap { /** - * Internal storage type. + * Internal storage type. * Key: Time as uint32 when the event should occur. - * Value: The event data as uint32. - * + * Value: The event data as uint32. + * * Structure of event data: * - Bit 0 - 15: Event Id. * - Bit 16 - 23: Group @@ -454,7 +454,7 @@ class EventMap { if (Empty()) return; - + uint32 eventId = _eventMap.begin()->second; _eventMap.erase(_eventMap.begin()); ScheduleEvent(eventId, time); @@ -480,7 +480,7 @@ class EventMap while (!Empty()) { EventStore::iterator itr = _eventMap.begin(); - + if (itr->first > _time) return 0; else if (_phase && (itr->second & 0xFF000000) && !((itr->second >> 24) & _phase)) @@ -492,7 +492,7 @@ class EventMap return eventId; } } - + return 0; } @@ -506,7 +506,7 @@ class EventMap while (!Empty()) { EventStore::iterator itr = _eventMap.begin(); - + if (itr->first > _time) return 0; else if (_phase && (itr->second & 0xFF000000) && !(itr->second & (_phase << 24))) @@ -514,7 +514,7 @@ class EventMap else return (itr->second & 0x0000FFFF); } - + return 0; } @@ -538,7 +538,7 @@ class EventMap { if (!group || group > 8 || Empty()) return; - + EventStore delayed; for (EventStore::iterator itr = _eventMap.begin(); itr != _eventMap.end();) @@ -551,7 +551,7 @@ class EventMap else ++itr; } - + _eventMap.insert(delayed.begin(), delayed.end()); } @@ -578,7 +578,7 @@ class EventMap * @name CancelEventGroup * @brief Cancel events belonging to specified group. * @param group Group to cancel. - */ + */ void CancelEventGroup(uint32 group) { if (!group || group > 8 || Empty()) @@ -610,7 +610,7 @@ class EventMap return 0; } - + /** * @name GetNextEventTime * @return Time of next event. @@ -636,14 +636,14 @@ class EventMap * @name _time * @brief Internal timer. * - * This does not represent the real date/time value. + * This does not represent the real date/time value. * It's more like a stopwatch: It can run, it can be stopped, * it can be resetted and so on. Events occur when this timer * has reached their time value. Its value is changed in the * Update method. */ uint32 _time; - + /** * @name _phase * @brief Phase mask of the event map. @@ -653,7 +653,7 @@ class EventMap * AddPhase. RemovePhase deactives a phase. */ uint8 _phase; - + /** * @name _eventMap * @brief Internal event storage map. Contains the scheduled events. diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index 3c3eded1f68..ce382342de8 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -17,6 +17,7 @@ */ #include "AccountMgr.h" +#include "Config.h" #include "DatabaseEnv.h" #include "ObjectAccessor.h" #include "Player.h" @@ -26,6 +27,7 @@ AccountMgr::AccountMgr() { + } AccountOpResult AccountMgr::CreateAccount(std::string username, std::string password) @@ -44,12 +46,22 @@ AccountOpResult AccountMgr::CreateAccount(std::string username, std::string pass stmt->setString(0, username); stmt->setString(1, CalculateShaPassHash(username, password)); - LoginDatabase.Execute(stmt); + LoginDatabase.DirectExecute(stmt); // Enforce saving, otherwise AddGroup can fail stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_REALM_CHARACTERS_INIT); LoginDatabase.Execute(stmt); + // Add default rbac groups for that security level + RBACData* rbac = new RBACData(GetId(username), username, -1); + // No need to Load From DB, as it's new data + + RBACGroupContainer const& groupsToAdd = _defaultGroups[0]; // 0: Default sec level + for (RBACGroupContainer::const_iterator it = groupsToAdd.begin(); it != groupsToAdd.end(); ++it) + rbac->AddGroup(*it, -1); + + delete rbac; + return AOR_OK; // everything's fine } @@ -303,3 +315,206 @@ bool AccountMgr::IsConsoleAccount(uint32 gmlevel) { return gmlevel == SEC_CONSOLE; } + +void AccountMgr::LoadRBAC() +{ + uint32 oldMSTime = getMSTime(); + uint32 count1 = 0; + uint32 count2 = 0; + uint32 count3 = 0; + + QueryResult result = LoginDatabase.Query("SELECT id, name FROM rbac_permissions"); + if (!result) + { + sLog->outInfo(LOG_FILTER_SQL, ">> Loaded 0 account permission definitions. DB table `rbac_permissions` is empty."); + return; + } + + do + { + Field* field = result->Fetch(); + uint32 id = field[0].GetUInt32(); + _permissions[id] = new RBACPermission(id, field[1].GetString()); + ++count1; + } + while (result->NextRow()); + + result = LoginDatabase.Query("SELECT id, name FROM rbac_roles"); + if (!result) + { + sLog->outInfo(LOG_FILTER_SQL, ">> Loaded 0 account role definitions. DB table `rbac_roles` is empty."); + return; + } + + do + { + Field* field = result->Fetch(); + uint32 id = field[0].GetUInt32(); + _roles[id] = new RBACRole(id, field[1].GetString()); + ++count2; + } + while (result->NextRow()); + + result = LoginDatabase.Query("SELECT roleId, permissionId FROM rbac_role_permissions"); + if (!result) + { + sLog->outInfo(LOG_FILTER_SQL, ">> Loaded 0 account role-permission definitions. DB table `rbac_role_permissions` is empty."); + return; + } + + do + { + Field* field = result->Fetch(); + uint32 id = field[0].GetUInt32(); + RBACRole* role = _roles[id]; + role->GrantPermission(field[1].GetUInt32()); + } + while (result->NextRow()); + + result = LoginDatabase.Query("SELECT id, name FROM rbac_groups"); + if (!result) + { + sLog->outInfo(LOG_FILTER_SQL, ">> Loaded 0 account group definitions. DB table `rbac_groups` is empty."); + return; + } + + do + { + Field* field = result->Fetch(); + uint32 id = field[0].GetUInt32(); + _groups[id] = new RBACGroup(id, field[1].GetString()); + ++count3; + } + while (result->NextRow()); + + result = LoginDatabase.Query("SELECT groupId, roleId FROM rbac_group_roles"); + if (!result) + { + sLog->outInfo(LOG_FILTER_SQL, ">> Loaded 0 account group-role definitions. DB table `rbac_group_roles` is empty."); + return; + } + + do + { + Field* field = result->Fetch(); + uint32 id = field[0].GetUInt32(); + RBACGroup* group = _groups[id]; + group->GrantRole(field[1].GetUInt32()); + } + while (result->NextRow()); + + result = LoginDatabase.Query("SELECT secId, groupId FROM rbac_security_level_groups ORDER by secId ASC"); + if (!result) + { + sLog->outInfo(LOG_FILTER_SQL, ">> Loaded 0 account default groups for security levels definitions. DB table `rbac_security_level_groups` is empty."); + return; + } + + uint8 lastSecId = 255; + RBACGroupContainer* groups = NULL; + do + { + Field* field = result->Fetch(); + uint8 secId = field[0].GetUInt8(); + + if (lastSecId != secId) + groups = &_defaultGroups[secId]; + + groups->insert(field[1].GetUInt32()); + } + while (result->NextRow()); + + sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u permission definitions, %u role definitions and %u group definitions in %u ms", count1, count2, count3, GetMSTimeDiffToNow(oldMSTime)); +} + +void AccountMgr::UpdateAccountAccess(RBACData* rbac, uint32 accountId, uint8 securityLevel, int32 realmId) +{ + int32 serverRealmId = realmId != -1 ? realmId : ConfigMgr::GetIntDefault("RealmID", 0); + bool needDelete = false; + if (!rbac) + { + needDelete = true; + rbac = new RBACData(accountId, "", serverRealmId); + rbac->LoadFromDB(); + } + + // Get max security level and realm (checking current realm and -1) + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS_BY_ID); + stmt->setUInt32(0, accountId); + stmt->setInt32(1, serverRealmId); + PreparedQueryResult result = LoginDatabase.Query(stmt); + if (result) + { + do + { + Field* field = result->Fetch(); + uint8 secLevel = field[0].GetUInt8(); + int32 realmId = field[1].GetUInt32(); + + RBACGroupContainer const& groupsToRemove = _defaultGroups[secLevel]; + for (RBACGroupContainer::const_iterator it = groupsToRemove.begin(); it != groupsToRemove.end(); ++it) + rbac->RemoveGroup(*it, realmId); + } + while (result->NextRow()); + } + + // Add new groups depending on the new security Level + RBACGroupContainer const& groupsToAdd = _defaultGroups[securityLevel]; + for (RBACGroupContainer::const_iterator it = groupsToAdd.begin(); it != groupsToAdd.end(); ++it) + rbac->AddGroup(*it, realmId); + + if (needDelete) + delete rbac; + + // Delete old security level from DB + if (realmId == -1) + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS); + stmt->setUInt32(0, accountId); + LoginDatabase.Execute(stmt); + } + else + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM); + stmt->setUInt32(0, accountId); + stmt->setUInt32(1, realmId); + LoginDatabase.Execute(stmt); + } + + // Add new security level + if (securityLevel) + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS); + stmt->setUInt32(0, accountId); + stmt->setUInt8(1, securityLevel); + stmt->setInt32(2, realmId); + LoginDatabase.Execute(stmt); + } +} + +RBACGroup const* AccountMgr::GetRBACGroup(uint32 group) const +{ + RBACGroupsContainer::const_iterator it = _groups.find(group); + if (it != _groups.end()) + return it->second; + + return NULL; +} + +RBACRole const* AccountMgr::GetRBACRole(uint32 role) const +{ + RBACRolesContainer::const_iterator it = _roles.find(role); + if (it != _roles.end()) + return it->second; + + return NULL; +} + +RBACPermission const* AccountMgr::GetRBACPermission(uint32 permission) const +{ + RBACPermissionsContainer::const_iterator it = _permissions.find(permission); + if (it != _permissions.end()) + return it->second; + + return NULL; +} diff --git a/src/server/game/Accounts/AccountMgr.h b/src/server/game/Accounts/AccountMgr.h index c8de5688e73..90c533ca5fa 100644 --- a/src/server/game/Accounts/AccountMgr.h +++ b/src/server/game/Accounts/AccountMgr.h @@ -19,8 +19,7 @@ #ifndef _ACCMGR_H #define _ACCMGR_H -#include "Define.h" -#include +#include "RBAC.h" #include enum AccountOpResult @@ -35,6 +34,11 @@ enum AccountOpResult #define MAX_ACCOUNT_STR 16 +typedef std::map RBACPermissionsContainer; +typedef std::map RBACRolesContainer; +typedef std::map RBACGroupsContainer; +typedef std::map RBACDefaultSecurityGroupContainer; + class AccountMgr { friend class ACE_Singleton; @@ -43,7 +47,7 @@ class AccountMgr AccountMgr(); public: - static AccountOpResult CreateAccount(std::string username, std::string password); + AccountOpResult CreateAccount(std::string username, std::string password); static AccountOpResult DeleteAccount(uint32 accountId); static AccountOpResult ChangeUsername(uint32 accountId, std::string newUsername, std::string newPassword); static AccountOpResult ChangePassword(uint32 accountId, std::string newPassword); @@ -62,6 +66,23 @@ class AccountMgr static bool IsGMAccount(uint32 gmlevel); static bool IsAdminAccount(uint32 gmlevel); static bool IsConsoleAccount(uint32 gmlevel); + + void UpdateAccountAccess(RBACData* rbac, uint32 accountId, uint8 securityLevel, int32 realmId); + + void LoadRBAC(); + RBACGroup const* GetRBACGroup(uint32 group) const; + RBACRole const* GetRBACRole(uint32 role) const; + RBACPermission const* GetRBACPermission(uint32 permission) const; + + RBACGroupsContainer const& GetRBACGroupList() const { return _groups; } + RBACRolesContainer const& GetRBACRoleList() const { return _roles; } + RBACPermissionsContainer const& GetRBACPermissionList() const { return _permissions; } + + private: + RBACPermissionsContainer _permissions; + RBACRolesContainer _roles; + RBACGroupsContainer _groups; + RBACDefaultSecurityGroupContainer _defaultGroups; }; #define sAccountMgr ACE_Singleton::instance() diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 0bf7c8591e3..b8f80fb36ac 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -122,8 +122,27 @@ const char *ChatHandler::GetTrinityString(int32 entry) const bool ChatHandler::isAvailable(ChatCommand const& cmd) const { - // check security level only for simple command (without child commands) - return m_session->GetSecurity() >= AccountTypes(cmd.SecurityLevel); + uint32 permission = 0; + + ///@Workaround:: Fast adaptation to RBAC system till all commands are moved to permissions + switch (AccountTypes(cmd.SecurityLevel)) + { + case SEC_ADMINISTRATOR: + permission = RBAC_PERM_ADMINISTRATOR_COMMANDS; + break; + case SEC_GAMEMASTER: + permission = RBAC_PERM_GAMEMASTER_COMMANDS; + break; + case SEC_MODERATOR: + permission = RBAC_PERM_MODERATOR_COMMANDS; + break; + case SEC_PLAYER: + default: + permission = RBAC_PERM_PLAYER_COMMANDS; + break; + } + + return m_session->HasPermission(permission); } bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong) @@ -431,7 +450,7 @@ bool ChatHandler::ParseCommands(char const* text) std::string fullcmd = text; - if (m_session && AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !sWorld->getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS)) + if (m_session && !m_session->HasPermission(RBAC_PERM_PLAYER_COMMANDS)) return false; /// chat case (.command or !command format) diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index d9d4a897eed..e18a103e21c 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -379,6 +379,7 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */) uint8 expansion = player->GetSession()->Expansion(); LfgDungeonSet const& dungeons = GetDungeonsByRandom(0); LfgLockMap lock; + bool denyJoin = !player->GetSession()->HasPermission(RBAC_PERM_JOIN_DUNGEON_FINDER); for (LfgDungeonSet::const_iterator it = dungeons.begin(); it != dungeons.end(); ++it) { @@ -387,7 +388,9 @@ void LFGMgr::InitializeLockedDungeons(Player* player, uint8 level /* = 0 */) continue; uint32 lockData = 0; - if (dungeon->expansion > expansion) + if (denyJoin) + lockData = LFG_LOCKSTATUS_RAID_LOCKED; + else if (dungeon->expansion > expansion) lockData = LFG_LOCKSTATUS_INSUFFICIENT_EXPANSION; else if (DisableMgr::IsDisabledFor(DISABLE_TYPE_MAP, dungeon->map, player)) lockData = LFG_LOCKSTATUS_RAID_LOCKED; @@ -469,7 +472,9 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const } // Check player or group member restrictions - if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue()) + if (!player->GetSession()->HasPermission(RBAC_PERM_JOIN_DUNGEON_FINDER)) + joinData.result = LFG_JOIN_NOT_MEET_REQS; + else if (player->InBattleground() || player->InArena() || player->InBattlegroundQueue()) joinData.result = LFG_JOIN_USING_BG_SYSTEM; else if (player->HasAura(LFG_SPELL_DUNGEON_DESERTER)) joinData.result = LFG_JOIN_DESERTER; @@ -488,6 +493,8 @@ void LFGMgr::JoinLfg(Player* player, uint8 roles, LfgDungeonSet& dungeons, const { if (Player* plrg = itr->getSource()) { + if (!plrg->GetSession()->HasPermission(RBAC_PERM_JOIN_DUNGEON_FINDER)) + joinData.result = LFG_JOIN_PARTY_NOT_MEET_REQS; if (plrg->HasAura(LFG_SPELL_DUNGEON_DESERTER)) joinData.result = LFG_JOIN_PARTY_DESERTER; else if (plrg->HasAura(LFG_SPELL_DUNGEON_COOLDOWN)) diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index da7980647bb..07c4281f86f 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -343,7 +343,7 @@ class LFGMgr uint32 GetOptions(); // cs_lfg /// Sets new lfg options void SetOptions(uint32 options); - /// Checks if given lfg option is enabled + /// Checks if given lfg option is enabled bool isOptionEnabled(uint32 option); /// Clears queue - Only for internal testing void Clean(); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index a4356f55340..dc98facc5ab 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -21757,12 +21757,21 @@ void Player::LeaveBattleground(bool teleportToEntryPoint) } } -bool Player::CanJoinToBattleground(Battleground const* /*bg*/) const +bool Player::CanJoinToBattleground(Battleground const* bg) const { // check Deserter debuff if (HasAura(26013)) return false; + if (bg->isArena() && !GetSession()->HasPermission(RBAC_PERM_JOIN_ARENAS)) + return false; + + if (bg->IsRandom() && !GetSession()->HasPermission(RBAC_PERM_JOIN_RANDOM_BG)) + return false; + + if (!GetSession()->HasPermission(RBAC_PERM_JOIN_NORMAL_BG)) + return false; + return true; } diff --git a/src/server/game/Handlers/MiscHandler.cpp b/src/server/game/Handlers/MiscHandler.cpp index aa4c9f35085..6272f42ec8c 100644 --- a/src/server/game/Handlers/MiscHandler.cpp +++ b/src/server/game/Handlers/MiscHandler.cpp @@ -396,7 +396,7 @@ void WorldSession::HandleLogoutRequestOpcode(WorldPacket& /*recvData*/) //instant logout in taverns/cities or on taxi or for admins, gm's, mod's if its enabled in worldserver.conf if (GetPlayer()->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_RESTING) || GetPlayer()->isInFlight() || - GetSecurity() >= AccountTypes(sWorld->getIntConfig(CONFIG_INSTANT_LOGOUT))) + HasPermission(RBAC_PERM_INSTANT_LOGOUT)) { WorldPacket data(SMSG_LOGOUT_RESPONSE, 1+4); data << uint8(0); diff --git a/src/server/game/Miscellaneous/Language.h b/src/server/game/Miscellaneous/Language.h index e13cc86747c..5868b60b722 100644 --- a/src/server/game/Miscellaneous/Language.h +++ b/src/server/game/Miscellaneous/Language.h @@ -86,7 +86,40 @@ enum TrinityStrings LANG_CONNECTED_PLAYERS = 60, LANG_ACCOUNT_ADDON = 61, LANG_IMPROPER_VALUE = 62, - // Room for more level 0 63-99 not used + LANG_RBAC_WRONG_PARAMETER_ID = 63, + LANG_RBAC_WRONG_PARAMETER_REALM = 64, + LANG_RBAC_GROUP_IN_LIST = 65, + LANG_RBAC_GROUP_NOT_IN_LIST = 66, + LANG_RBAC_GROUP_ADDED = 67, + LANG_RBAC_GROUP_REMOVED = 68, + LANG_RBAC_GROUP_LIST_HEADER = 69, + LANG_RBAC_LIST_EMPTY = 70, + LANG_RBAC_LIST_ELEMENT = 71, + LANG_RBAC_ROLE_GRANTED_IN_LIST = 72, + LANG_RBAC_ROLE_GRANTED_IN_DENIED_LIST = 73, + LANG_RBAC_ROLE_GRANTED = 74, + LANG_RBAC_ROLE_DENIED_IN_LIST = 75, + LANG_RBAC_ROLE_DENIED_IN_GRANTED_LIST = 76, + LANG_RBAC_ROLE_DENIED = 77, + LANG_RBAC_ROLE_REVOKED = 78, + LANG_RBAC_ROLE_REVOKED_NOT_IN_LIST = 79, + LANG_RBAC_ROLE_LIST_HEADER_GRANTED = 80, + LANG_RBAC_ROLE_LIST_HEADER_DENIED = 81, + LANG_RBAC_PERM_GRANTED_IN_LIST = 82, + LANG_RBAC_PERM_GRANTED_IN_DENIED_LIST = 83, + LANG_RBAC_PERM_GRANTED = 84, + LANG_RBAC_PERM_DENIED_IN_LIST = 85, + LANG_RBAC_PERM_DENIED_IN_GRANTED_LIST = 86, + LANG_RBAC_PERM_DENIED = 87, + LANG_RBAC_PERM_REVOKED = 88, + LANG_RBAC_PERM_REVOKED_NOT_IN_LIST = 89, + LANG_RBAC_PERM_LIST_HEADER_GRANTED = 90, + LANG_RBAC_PERM_LIST_HEADER_DENIED = 91, + LANG_RBAC_PERM_LIST_GLOBAL = 92, + LANG_RBAC_LIST_GROUPS_HEADER = 93, + LANG_RBAC_LIST_ROLES_HEADER = 94, + LANG_RBAC_LIST_PERMISSIONS_HEADER = 95, + // Room for more level 0 96-99 not used // level 1 chat LANG_GLOBAL_NOTIFY = 100, diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index efd45188d42..afc153a5000 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -70,6 +70,7 @@ void AddSC_mmaps_commandscript(); void AddSC_modify_commandscript(); void AddSC_npc_commandscript(); void AddSC_quest_commandscript(); +void AddSC_rbac_commandscript(); void AddSC_reload_commandscript(); void AddSC_reset_commandscript(); void AddSC_server_commandscript(); @@ -700,6 +701,7 @@ void AddCommandScripts() AddSC_modify_commandscript(); AddSC_npc_commandscript(); AddSC_quest_commandscript(); + AddSC_rbac_commandscript(); AddSC_reload_commandscript(); AddSC_reset_commandscript(); AddSC_server_commandscript(); diff --git a/src/server/game/Server/WorldSession.cpp b/src/server/game/Server/WorldSession.cpp index 6c689319bc7..522dc95105d 100644 --- a/src/server/game/Server/WorldSession.cpp +++ b/src/server/game/Server/WorldSession.cpp @@ -21,6 +21,7 @@ */ #include "WorldSocket.h" // must be first to make ACE happy with ACE includes in it +#include "Config.h" #include "Common.h" #include "DatabaseEnv.h" #include "Log.h" @@ -115,7 +116,8 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8 m_TutorialsChanged(false), recruiterId(recruiter), isRecruiter(isARecruiter), - timeLastWhoCommand(0) + timeLastWhoCommand(0), + _RBACData(NULL) { if (sock) { @@ -143,8 +145,8 @@ WorldSession::~WorldSession() m_Socket = NULL; } - if (_warden) - delete _warden; + delete _warden; + delete _RBACData; ///- empty incoming packet queue WorldPacket* packet = NULL; @@ -1200,3 +1202,24 @@ void WorldSession::InitWarden(BigNumber* k, std::string const& os) // _warden->Init(this, k); } } + +void WorldSession::LoadPermissions() +{ + uint32 id = GetAccountId(); + std::string name; + int32 realmId = ConfigMgr::GetIntDefault("RealmID", 0); + AccountMgr::GetName(id, name); + + _RBACData = new RBACData(id, name, realmId); + _RBACData->LoadFromDB(); +} + +RBACData* WorldSession::GetRBACData() +{ + return _RBACData; +} + +bool WorldSession::HasPermission(uint32 permission) +{ + return _RBACData->HasPermission(permission); +} diff --git a/src/server/game/Server/WorldSession.h b/src/server/game/Server/WorldSession.h index 11bb7a36f5a..d6877b8a18a 100644 --- a/src/server/game/Server/WorldSession.h +++ b/src/server/game/Server/WorldSession.h @@ -24,6 +24,7 @@ #define __WORLDSESSION_H #include "Common.h" +#include "AccountMgr.h" #include "SharedDefines.h" #include "AddonMgr.h" #include "DatabaseEnv.h" @@ -216,6 +217,10 @@ class WorldSession void SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos = 0); void SendClientCacheVersion(uint32 version); + RBACData* GetRBACData(); + bool HasPermission(uint32 permissionId); + void LoadPermissions(); + AccountTypes GetSecurity() const { return _security; } uint32 GetAccountId() const { return _accountId; } Player* GetPlayer() const { return _player; } @@ -954,6 +959,7 @@ class WorldSession bool isRecruiter; ACE_Based::LockedQueue _recvQueue; time_t timeLastWhoCommand; + RBACData* _RBACData; }; #endif /// @} diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index c80d25be139..c77cad70186 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -953,6 +953,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) m_Session->LoadGlobalAccountData(); m_Session->LoadTutorialsData(); m_Session->ReadAddonsInfo(recvPacket); + m_Session->LoadPermissions(); // Initialize Warden system only if it is enabled by config if (sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED)) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index f28b9548e5f..d02ba402c53 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -267,7 +267,7 @@ void World::AddSession_(WorldSession* s) if (decrease_session) --Sessions; - if (pLimit > 0 && Sessions >= pLimit && AccountMgr::IsPlayerAccount(s->GetSecurity()) && !HasRecentlyDisconnected(s)) + if (pLimit > 0 && Sessions >= pLimit && !s->HasPermission(RBAC_PERM_SKIP_QUEUE) && !HasRecentlyDisconnected(s)) { AddQueuedPlayer(s); UpdateMaxSessionCounters(); @@ -585,7 +585,6 @@ void World::LoadConfigSettings(bool reload) m_int_configs[CONFIG_TICKET_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Ticket", 1); m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Auction", 1); m_int_configs[CONFIG_MAIL_LEVEL_REQ] = ConfigMgr::GetIntDefault("LevelReq.Mail", 1); - m_bool_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = ConfigMgr::GetBoolDefault("AllowPlayerCommands", 1); m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = ConfigMgr::GetBoolDefault("PreserveCustomChannels", false); m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = ConfigMgr::GetIntDefault("PreserveCustomChannelDuration", 14); m_bool_configs[CONFIG_GRID_UNLOAD] = ConfigMgr::GetBoolDefault("GridUnload", true); @@ -1059,8 +1058,6 @@ void World::LoadConfigSettings(bool reload) sLog->outError(LOG_FILTER_SERVER_LOADING, "ClientCacheVersion can't be negative %d, ignored.", clientCacheId); } - m_int_configs[CONFIG_INSTANT_LOGOUT] = ConfigMgr::GetIntDefault("InstantLogout", SEC_MODERATOR); - m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = ConfigMgr::GetIntDefault("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); if (m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] > GUILD_EVENTLOG_MAX_RECORDS) m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = GUILD_EVENTLOG_MAX_RECORDS; @@ -1348,6 +1345,8 @@ void World::SetInitialWorldSettings() sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Localization strings loaded in %u ms", GetMSTimeDiffToNow(oldMSTime)); + sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Account Roles and Permissions..."); + sAccountMgr->LoadRBAC(); sLog->outInfo(LOG_FILTER_SERVER_LOADING, "Loading Page Texts..."); sObjectMgr->LoadPageTexts(); diff --git a/src/server/scripts/Commands/CMakeLists.txt b/src/server/scripts/Commands/CMakeLists.txt index 7b9e2444952..83e97b2c80d 100644 --- a/src/server/scripts/Commands/CMakeLists.txt +++ b/src/server/scripts/Commands/CMakeLists.txt @@ -35,6 +35,7 @@ set(scripts_STAT_SRCS Commands/cs_modify.cpp Commands/cs_npc.cpp Commands/cs_quest.cpp + Commands/cs_rbac.cpp Commands/cs_reload.cpp Commands/cs_reset.cpp Commands/cs_tele.cpp diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index 3a20a03bb4a..4dc44bbfc58 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -106,7 +106,7 @@ public: if (!accountName || !password) return false; - AccountOpResult result = AccountMgr::CreateAccount(std::string(accountName), std::string(password)); + AccountOpResult result = sAccountMgr->CreateAccount(std::string(accountName), std::string(password)); switch (result) { case AOR_OK: @@ -503,36 +503,8 @@ public: return false; } - // If gmRealmID is -1, delete all values for the account id, else, insert values for the specific realmID - PreparedStatement* stmt; - - if (gmRealmID == -1) - { - stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS); - - stmt->setUInt32(0, targetAccountId); - } - else - { - stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_ACCOUNT_ACCESS_BY_REALM); - - stmt->setUInt32(0, targetAccountId); - stmt->setUInt32(1, realmID); - } - - LoginDatabase.Execute(stmt); - - if (gm != 0) - { - stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_ACCOUNT_ACCESS); - - stmt->setUInt32(0, targetAccountId); - stmt->setUInt8(1, uint8(gm)); - stmt->setInt32(2, gmRealmID); - - LoginDatabase.Execute(stmt); - } - + RBACData* rbac = isAccountNameGiven ? NULL : handler->getSelectedPlayer()->GetSession()->GetRBACData(); + sAccountMgr->UpdateAccountAccess(rbac, targetAccountId, uint8(gm), gmRealmID); handler->PSendSysMessage(LANG_YOU_CHANGE_SECURITY, targetAccountName.c_str(), gm); return true; diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 227680b2d6b..210e2b3ac60 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -55,7 +55,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_DEL_REALM_CHARACTERS, "DELETE FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_INS_REALM_CHARACTERS, "INSERT INTO realmcharacters (numchars, acctid, realmid) VALUES (?, ?, ?)", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_SUM_REALM_CHARACTERS, "SELECT SUM(numchars) FROM realmcharacters WHERE acctid = ?", CONNECTION_ASYNC); - PrepareStatement(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_ASYNC); + PrepareStatement(LOGIN_INS_ACCOUNT, "INSERT INTO account(username, sha_pass_hash, joindate) VALUES(?, ?, NOW())", CONNECTION_SYNCH); PrepareStatement(LOGIN_INS_REALM_CHARACTERS_INIT, "INSERT INTO realmcharacters (realmid, acctid, numchars) SELECT realmlist.id, account.id, 0 FROM realmlist, account LEFT JOIN realmcharacters ON acctid=account.id WHERE acctid IS NULL", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_EXPANSION, "UPDATE account SET expansion = ? WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_ACCOUNT_LOCK, "UPDATE account SET locked = ? WHERE id = ?", CONNECTION_ASYNC); @@ -87,4 +87,18 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_SEL_ACCOUNT_WHOIS, "SELECT username, email, last_ip FROM account WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_REALMLIST_SECURITY_LEVEL, "SELECT allowedSecurityLevel from realmlist WHERE id = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_DEL_ACCOUNT, "DELETE FROM account WHERE id = ?", CONNECTION_ASYNC); + + PrepareStatement(LOGIN_SEL_ACCOUNT_ACCESS_BY_ID, "SELECT gmlevel, RealmID FROM account_access WHERE id = ? and (RealmID = ? OR RealmID = -1) ORDER BY gmlevel desc", CONNECTION_SYNCH); + + PrepareStatement(LOGIN_SEL_RBAC_ACCOUNT_GROUPS, "SELECT groupId FROM rbac_account_groups WHERE accountId = ? AND (realmId = ? OR realmId = -1) GROUP BY groupId", CONNECTION_SYNCH); + PrepareStatement(LOGIN_INS_RBAC_ACCOUNT_GROUP, "INSERT INTO rbac_account_groups (accountId, groupId, realmId) VALUES (?, ?, ?)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_RBAC_ACCOUNT_GROUP, "DELETE FROM rbac_account_groups WHERE accountId = ? AND groupId = ? AND (realmId = ? OR realmId = -1)", CONNECTION_ASYNC); + + PrepareStatement(LOGIN_SEL_RBAC_ACCOUNT_ROLES, "SELECT roleId, granted FROM rbac_account_roles WHERE accountId = ? AND (realmId = ? OR realmId = -1) ORDER BY roleId, realmId", CONNECTION_SYNCH); + PrepareStatement(LOGIN_INS_RBAC_ACCOUNT_ROLE, "INSERT INTO rbac_account_roles (accountId, roleId, granted, realmId) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE granted = VALUES(granted)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_RBAC_ACCOUNT_ROLE, "DELETE FROM rbac_account_roles WHERE accountId = ? AND roleId = ? AND (realmId = ? OR realmId = -1)", CONNECTION_ASYNC); + + PrepareStatement(LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS, "SELECT permissionId, granted FROM rbac_account_permissions WHERE accountId = ? AND (realmId = ? OR realmId = -1) ORDER BY permissionId, realmId", CONNECTION_SYNCH); + PrepareStatement(LOGIN_INS_RBAC_ACCOUNT_PERMISSION, "INSERT INTO rbac_account_permissions (accountId, permissionId, granted, realmId) VALUES (?, ?, ?, ?) ON DUPLICATE KEY UPDATE granted = VALUES(granted)", CONNECTION_ASYNC); + PrepareStatement(LOGIN_DEL_RBAC_ACCOUNT_PERMISSION, "DELETE FROM rbac_account_permissions WHERE accountId = ? AND permissionId = ? AND (realmId = ? OR realmId = -1)", CONNECTION_ASYNC); } diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 798016d553d..211706b26b8 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -108,6 +108,16 @@ enum LoginDatabaseStatements LOGIN_SEL_REALMLIST_SECURITY_LEVEL, LOGIN_DEL_ACCOUNT, + LOGIN_SEL_ACCOUNT_ACCESS_BY_ID, + LOGIN_SEL_RBAC_ACCOUNT_GROUPS, + LOGIN_INS_RBAC_ACCOUNT_GROUP, + LOGIN_DEL_RBAC_ACCOUNT_GROUP, + LOGIN_SEL_RBAC_ACCOUNT_ROLES, + LOGIN_INS_RBAC_ACCOUNT_ROLE, + LOGIN_DEL_RBAC_ACCOUNT_ROLE, + LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS, + LOGIN_INS_RBAC_ACCOUNT_PERMISSION, + LOGIN_DEL_RBAC_ACCOUNT_PERMISSION, MAX_LOGINDATABASE_STATEMENTS }; diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index 641fe1ebb62..f6a09667dda 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -813,18 +813,6 @@ RecruitAFriend.MaxLevel = 60 RecruitAFriend.MaxDifference = 4 -# -# InstantLogout -# Description: Required security level for instantly logging out everywhere. -# Does not work while in combat, dueling or falling. -# Default: 1 - (Enabled, Mods/GMs/Admins) -# 0 - (Enabled, Everyone) -# 2 - (Enabled, GMs/Admins) -# 3 - (Enabled, Admins) -# 4 - (Disabled) - -InstantLogout = 1 - # # DisableWaterBreath # Description: Required security level for water breathing. @@ -1567,14 +1555,6 @@ ChatLevelReq.Whisper = 1 ChatLevelReq.Say = 1 -# -# AllowPlayerCommands -# Description: Allow players to use commands. -# Default: 1 - (Enabled) -# 0 - (Disabled) - -AllowPlayerCommands = 1 - # # PreserveCustomChannels # Description: Store custom chat channel settings like password, automatic ownership handout -- cgit v1.2.3 From 683de1d62484d1c9c5396a7c41507f03116509aa Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 4 Feb 2013 09:39:01 +0100 Subject: Core/RBAC: Add SQL to remove bad data from account_access, otherwise other sqls will fail due to use of FOREIGN KEYS - Also add missing files from previous commit --- sql/updates/auth/2013_02_04_00_auth_misc.sql | 5 +- src/server/game/Accounts/RBAC.cpp | 334 ++++++++++++ src/server/game/Accounts/RBAC.h | 410 ++++++++++++++ src/server/scripts/Commands/cs_rbac.cpp | 780 +++++++++++++++++++++++++++ 4 files changed, 1528 insertions(+), 1 deletion(-) create mode 100644 src/server/game/Accounts/RBAC.cpp create mode 100644 src/server/game/Accounts/RBAC.h create mode 100644 src/server/scripts/Commands/cs_rbac.cpp (limited to 'sql') diff --git a/sql/updates/auth/2013_02_04_00_auth_misc.sql b/sql/updates/auth/2013_02_04_00_auth_misc.sql index 573b58ac156..815df637be0 100644 --- a/sql/updates/auth/2013_02_04_00_auth_misc.sql +++ b/sql/updates/auth/2013_02_04_00_auth_misc.sql @@ -1,13 +1,16 @@ +-- Delete bad data from the DB before adding foreign keys +DELETE FROM `account_access` WHERE `id` NOT IN (SELECT `id` FROM `account`); + -- Need them first in case of re-execute due to foreign keys DROP TABLE IF EXISTS `rbac_account_permissions`; DROP TABLE IF EXISTS `rbac_account_roles`; DROP TABLE IF EXISTS `rbac_account_groups`; DROP TABLE IF EXISTS `rbac_role_permissions`; DROP TABLE IF EXISTS `rbac_group_roles`; +DROP TABLE IF EXISTS `rbac_security_level_groups`; DROP TABLE IF EXISTS `rbac_permissions`; DROP TABLE IF EXISTS `rbac_roles`; DROP TABLE IF EXISTS `rbac_groups`; -DROP TABLE IF EXISTS `rbac_security_level_groups`; CREATE TABLE IF NOT EXISTS `rbac_groups` ( `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Group id', diff --git a/src/server/game/Accounts/RBAC.cpp b/src/server/game/Accounts/RBAC.cpp new file mode 100644 index 00000000000..0b08e277fb2 --- /dev/null +++ b/src/server/game/Accounts/RBAC.cpp @@ -0,0 +1,334 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "RBAC.h" + +RBACCommandResult RBACData::AddGroup(uint32 groupId, int32 realmId /* = 0 */) +{ + // Check if group Id exists + RBACGroup const* group = sAccountMgr->GetRBACGroup(groupId); + if (!group) + return RBAC_ID_DOES_NOT_EXISTS; + + // Already added? + std::pair::iterator, bool> ret = _groups.insert(groupId); + if (!ret.second) + return RBAC_CANT_ADD_ALREADY_ADDED; + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_RBAC_ACCOUNT_GROUP); + stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, groupId); + stmt->setInt32(2, realmId); + LoginDatabase.Execute(stmt); + + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +RBACCommandResult RBACData::RemoveGroup(uint32 groupId, int32 realmId /* = 0 */) +{ + // could remove it? + if (!_groups.erase(groupId)) + return RBAC_CANT_REVOKE_NOT_IN_LIST; + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_RBAC_ACCOUNT_GROUP); + stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, groupId); + stmt->setInt32(2, realmId); + LoginDatabase.Execute(stmt); + + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +RBACCommandResult RBACData::GrantRole(uint32 roleId, int32 realmId /* = 0*/) +{ + // Check if role Id exists + RBACRole const* role = sAccountMgr->GetRBACRole(roleId); + if (!role) + return RBAC_ID_DOES_NOT_EXISTS; + + // Check if already added in denied list + if (_deniedRoles.find(roleId) != _deniedRoles.end()) + return RBAC_IN_DENIED_LIST; + + // Already added? + std::pair::iterator, bool> ret = _grantedRoles.insert(roleId); + if (!ret.second) + return RBAC_CANT_ADD_ALREADY_ADDED; + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + SaveRole(roleId, true, realmId); + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +RBACCommandResult RBACData::DenyRole(uint32 roleId, int32 realmId /* = 0*/) +{ + // Check if role Id exists + RBACRole const* role = sAccountMgr->GetRBACRole(roleId); + if (!role) + return RBAC_ID_DOES_NOT_EXISTS; + + // Check if already added in granted list + if (_grantedRoles.find(roleId) != _grantedRoles.end()) + return RBAC_IN_GRANTED_LIST; + + // Already added? + std::pair::iterator, bool> ret = _deniedRoles.insert(roleId); + if (!ret.second) + return RBAC_CANT_ADD_ALREADY_ADDED; + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + SaveRole(roleId, false, realmId); + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +void RBACData::SaveRole(uint32 roleId, bool granted, int32 realmId) +{ + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_RBAC_ACCOUNT_ROLE); + stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, roleId); + stmt->setBool(2, granted); + stmt->setInt32(3, realmId); + LoginDatabase.Execute(stmt); +} + +RBACCommandResult RBACData::RevokeRole(uint32 roleId, int32 realmId /* = 0*/) +{ + uint8 revoked = _grantedRoles.erase(roleId) + _deniedRoles.erase(roleId); + + // could remove it? + if (!revoked) + return RBAC_CANT_REVOKE_NOT_IN_LIST; + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_RBAC_ACCOUNT_ROLE); + stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, roleId); + stmt->setInt32(2, realmId); + LoginDatabase.Execute(stmt); + + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +RBACCommandResult RBACData::GrantPermission(uint32 permissionId, int32 realmId /* = 0*/) +{ + // Check if permission Id exists + RBACPermission const* perm = sAccountMgr->GetRBACPermission(permissionId); + if (!perm) + return RBAC_ID_DOES_NOT_EXISTS; + + // Check if already added in denied list + if (_deniedPerms.test(permissionId)) + return RBAC_IN_DENIED_LIST; + + // Already added? + if (_grantedPerms.test(permissionId)) + return RBAC_CANT_ADD_ALREADY_ADDED; + + _grantedPerms.set(permissionId); + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + SavePermission(permissionId, true, realmId); + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +RBACCommandResult RBACData::DenyPermission(uint32 permissionId, int32 realmId /* = 0*/) +{ + // Check if permission Id exists + RBACPermission const* perm = sAccountMgr->GetRBACPermission(permissionId); + if (!perm) + return RBAC_ID_DOES_NOT_EXISTS; + + // Check if already added in granted list + if (_grantedPerms.test(permissionId)) + return RBAC_IN_GRANTED_LIST; + + // Already added? + if (_deniedPerms.test(permissionId)) + return RBAC_CANT_ADD_ALREADY_ADDED; + + _deniedPerms.set(permissionId); + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + SavePermission(permissionId, false, realmId); + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +void RBACData::SavePermission(uint32 permission, bool granted, int32 realmId) +{ + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_INS_RBAC_ACCOUNT_PERMISSION); + stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, permission); + stmt->setBool(2, granted); + stmt->setInt32(3, realmId); + LoginDatabase.Execute(stmt); +} + +RBACCommandResult RBACData::RevokePermission(uint32 permission, int32 realmId /* = 0*/) +{ + // Check if it's present in any list + if (!_grantedPerms.test(permission) && !_deniedPerms.test(permission)) + return RBAC_CANT_REVOKE_NOT_IN_LIST; + + _grantedPerms.reset(permission); + _deniedPerms.reset(permission); + + // Do not save to db when loading data from DB (realmId = 0) + if (realmId) + { + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_RBAC_ACCOUNT_PERMISSION); + stmt->setUInt32(0, GetId()); + stmt->setUInt32(1, permission); + stmt->setInt32(2, realmId); + LoginDatabase.Execute(stmt); + + CalculateNewPermissions(); + } + + return RBAC_OK; +} + +void RBACData::LoadFromDB() +{ + // Load account group that affect current realm + PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_GROUPS); + stmt->setUInt32(0, GetId()); + stmt->setInt32(1, GetRealmId()); + PreparedQueryResult result = LoginDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + AddGroup(fields[0].GetUInt32()); + } + while (result->NextRow()); + } + + // Load account roles (granted and denied) that affect current realm + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_ROLES); + stmt->setUInt32(0, GetId()); + stmt->setInt32(1, GetRealmId()); + result = LoginDatabase.Query(stmt); + + if (result) + { + do + { + Field* fields = result->Fetch(); + if (fields[1].GetBool()) + GrantRole(fields[0].GetUInt32()); + else + DenyRole(fields[0].GetUInt32()); + } + while (result->NextRow()); + } + + // Load account permissions (granted and denied) that affect current realm + stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_RBAC_ACCOUNT_PERMISSIONS); + stmt->setUInt32(0, GetId()); + stmt->setInt32(1, GetRealmId()); + + result = LoginDatabase.Query(stmt); + if (result) + { + do + { + Field* fields = result->Fetch(); + if (fields[1].GetBool()) + GrantPermission(fields[0].GetUInt32()); + else + DenyPermission(fields[0].GetUInt32()); + } + while (result->NextRow()); + } + + // Force calculation of permissions, it wasn't performed at load time + // while adding groups, roles and permissions + CalculateNewPermissions(); +} + +void RBACData::CalculateNewPermissions() +{ + // Get the list of directly granted roles + RBACRoleContainer tempGrantedRoles = GetGrantedRoles(); + + // Add those roles inherited from groups + for (RBACGroupContainer::const_iterator itGroup = _groups.begin(); itGroup != _groups.end(); ++itGroup) + { + RBACGroup const* group = sAccountMgr->GetRBACGroup(*itGroup); + if (!group) // Should never happen due to foreign keys in DB + continue; + + RBACRoleContainer const& roles = group->GetRoles(); + for (RBACRoleContainer::const_iterator it = roles.begin(); it != roles.end(); ++it) + tempGrantedRoles.insert(*it); + } + + // Get the list of granted permissions + _globalPerms = GetGrantedPermissions(); + + // Add those permissions inherited from roles granted + for (RBACRoleContainer::const_iterator it = tempGrantedRoles.begin(); it != tempGrantedRoles.end(); ++it) + if (RBACRole const* role = sAccountMgr->GetRBACRole(*it)) + _globalPerms |= role->GetPermissions(); + + // Remove denied permissions from the list + _globalPerms &= ~GetDeniedPermissions(); + + // Remove those permissions inherited from denied roles + for (RBACRoleContainer::const_iterator it = _deniedRoles.begin(); it != _deniedRoles.end(); ++it) + if (RBACRole const* role = sAccountMgr->GetRBACRole(*it)) + _globalPerms &= ~role->GetPermissions(); +} diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h new file mode 100644 index 00000000000..5420df29d17 --- /dev/null +++ b/src/server/game/Accounts/RBAC.h @@ -0,0 +1,410 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/** +* @file RBAC.h +* @brief Role Based Access Control related classes definition +* +* This file contains all the classes and enums used to implement +* Role Based Access Control +* +* RBAC Rules: +* - Pemission: Defines an autorization to perform certain operation. +* - Role: Set of permissions. +* - Group: Set of roles. +* - An Account can have multiple groups, roles and permissions. +* - Account Groups can only be granted or revoked +* - Account Roles and Permissions can be granted, denied or revoked +* - Grant: Assignment of the object (role/permission) and allow it +* - Deny: Assignment of the object (role/permission) and deny it +* - Revoke: Removal of the object (role/permission) no matter if it was granted or denied +* - Global Permissions are computed as: +* Group Grants + Role Grants + User Grans - Role Grants - User Grants +* - Groups, Roles and Permissions can be assigned by realm +*/ + +#ifndef _RBAC_H +#define _RBAC_H + +#include "Define.h" +#include +#include +#include +#include + +enum RBACPermissions +{ + RBAC_PERM_INSTANT_LOGOUT = 1, + RBAC_PERM_SKIP_QUEUE, + RBAC_PERM_JOIN_NORMAL_BG, + RBAC_PERM_JOIN_RANDOM_BG, + RBAC_PERM_JOIN_ARENAS, + RBAC_PERM_JOIN_DUNGEON_FINDER, + RBAC_PERM_PLAYER_COMMANDS, + RBAC_PERM_MODERATOR_COMMANDS, + RBAC_PERM_GAMEMASTER_COMMANDS, + RBAC_PERM_ADMINISTRATOR_COMMANDS, + RBAC_PERM_MAX +}; + +enum RBACCommandResult +{ + RBAC_OK, + RBAC_CANT_ADD_ALREADY_ADDED, + RBAC_CANT_REVOKE_NOT_IN_LIST, + RBAC_IN_GRANTED_LIST, + RBAC_IN_DENIED_LIST, + RBAC_ID_DOES_NOT_EXISTS +}; + +typedef std::bitset RBACPermissionContainer; +typedef std::set RBACRoleContainer; +typedef std::set RBACGroupContainer; + +class RBACObject +{ + public: + RBACObject(uint32 id = 0, std::string const& name = ""): + _id(id), _name(name) { } + + /// Gets the Name of the Object + std::string const& GetName() const { return _name; } + /// Gets the Id of the Object + uint32 GetId() const { return _id; } + + private: + uint32 _id; ///> id of the object + std::string _name; ///> name of the object +}; + +/// Permission: Defines an autorization to perform certain operation +class RBACPermission: public RBACObject +{ + public: + RBACPermission(uint32 id = 0, std::string const& name = ""): + RBACObject(id, name) { } +}; + +/// Set of Permissions +class RBACRole: public RBACObject +{ + public: + RBACRole(uint32 id = 0, std::string const& name = ""): + RBACObject(id, name) { } + + /// Gets the Permissions assigned to this role + RBACPermissionContainer const& GetPermissions() const { return _perms; } + /// Grants a Permission (Adds) + void GrantPermission(uint32 id) { _perms.set(id); } + /// Revokes a Permission (Removes) + void RevokePermission(uint32 id) { _perms.reset(id); } + + private: + RBACPermissionContainer _perms; ///> Set of permissions +}; + +/// Set of Roles +class RBACGroup: public RBACObject +{ + public: + RBACGroup(uint32 id = 0, std::string const& name = ""): + RBACObject(id, name) { } + + /// Gets the Roles assigned to this group + RBACRoleContainer const& GetRoles() const { return _roles; } + /// Grants a Role (Adds) + void GrantRole(uint32 role) { _roles.insert(role); } + /// Revokes a Role (Removes) + void RevokeRole(uint32 role) { _roles.erase(role); } + + private: + RBACRoleContainer _roles; ///> Set of Roles +}; + +/* + * @name RBACData + * @brief Contains all needed information about the acccount + * + * This class contains all the data needed to calculate the account permissions. + * RBACDAta is formed by group permissions and user permissions through: + * - Granted Groups, which contains roles, which contains permissions: Set of granted permissions + * - Granted Roles, which contains permissions: Set of granted permissions + * - Denied Roles, which contains permissions: Set of denied permissions + * - Granted Permissions + * - Denied Permissions + * + * Calculation of current Permissions: Granted permissions - Denied permissions + * - Granted permissions: through groups, through roles and directly assigned + * - Denied permissions: through roles and directly assigned + */ +class RBACData: public RBACObject +{ + public: + RBACData(uint32 id, std::string const& name, int32 realmId): + RBACObject(id, name), _realmId(realmId) { } + + /** + * @name HasPermission + * @brief Checks if certain action is allowed + * + * Checks if certain action can be performed. + * + * @return grant or deny action + * + * Example Usage: + * @code + * bool Player::CanJoinArena(Battleground* bg) + * { + * return bg->isArena() && HasPermission(RBAC_PERM_JOIN_ARENA); + * } + * @endcode + */ + bool HasPermission(uint32 permission) { return _globalPerms.test(permission); } + + // Functions enabled to be used by command system + /// Returns all the granted permissions (after computation) + RBACPermissionContainer const& GetPermissions() const { return _globalPerms; } + /// Returns all the granted permissions + RBACPermissionContainer const& GetGrantedPermissions() const { return _grantedPerms; } + /// Returns all the denied permissions + RBACPermissionContainer const& GetDeniedPermissions() const { return _deniedPerms; } + /// Returns all the granted roles + RBACRoleContainer const& GetGrantedRoles() const { return _grantedRoles; } + /// Returns all the denied roles + RBACRoleContainer const& GetDeniedRoles() const { return _deniedRoles; } + /// Returns all the granted groups + RBACGroupContainer const& GetGroups() const { return _groups; } + + /** + * @name AddGroup + * @brief Adds new group + * + * Add a new group to the account. If realm is 0 or the group can not be added + * No save to db action will be performed. + * + * Fails if group Id does not exists or group already present + * + * @param groupId group to be added + * @param realmId realm affected + * + * @return Success or failure (with reason) to add the group + * + * Example Usage: + * @code + * // previously defined "RBACData* rbac" with proper initialization + * uint32 groupId = 2; + * if (rbac->AddGroup(groupId) == RBAC_OK) + * sLog->outDebug(LOG_FILTER_PLAYER, "Group %u succesfully added", groupId); + * @endcode + */ + RBACCommandResult AddGroup(uint32 groupId, int32 realmId = 0); + + /** + * @name RemoveGroup + * @brief Removes a group + * + * Removes a group from the account. If realm is 0 or the group can not be removed + * No save to db action will be performed. Any delete operation will always affect + * "all realms (-1)" in addition to the realm specified + * + * Fails if group not present + * + * @param groupId group to be removed + * @param realmId realm affected + * + * @return Success or failure (with reason) to remove the group + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 groupId = 2; + * if (rbac->RemoveGroup(groupId) == RBAC_OK) + * sLog->outDebug(LOG_FILTER_PLAYER, "Group %u succesfully removed", groupId); + * @endcode + */ + RBACCommandResult RemoveGroup(uint32 groupId, int32 realmId = 0); + + /** + * @name GrantRole + * @brief Grants a role + * + * Grants a role to the account. If realm is 0 or the role can not be added + * No save to db action will be performed. + * + * Fails if role Id does not exists or role already granted or denied + * + * @param roleId role to be granted + * @param realmId realm affected + * + * @return Success or failure (with reason) to grant the role + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 roleId = 2; + * if (rbac->GrantRole(roleId) == RBAC_IN_DENIED_LIST) + * sLog->outDebug(LOG_FILTER_PLAYER, "Failed to grant role %u, already denied", roleId); + * @endcode + */ + RBACCommandResult GrantRole(uint32 roleId, int32 realmId = 0); + + /** + * @name DenyRole + * @brief Denies a role + * + * Denied a role to the account. If realm is 0 or the role can not be added + * No save to db action will be performed. + * + * Fails if role Id does not exists or role already granted or denied + * + * @param roleId role to be denied + * @param realmId realm affected + * + * @return Success or failure (with reason) to deny the role + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 roleId = 2; + * if (rbac->DenyRole(roleId) == RBAC_ID_DOES_NOT_EXISTS) + * sLog->outDebug(LOG_FILTER_PLAYER, "Role Id %u does not exists", roleId); + * @endcode + */ + RBACCommandResult DenyRole(uint32 roleId, int32 realmId = 0); + + /** + * @name RevokeRole + * @brief Removes a role + * + * Removes a role from the account. If realm is 0 or the role can not be removed + * No save to db action will be performed. Any delete operation will always affect + * "all realms (-1)" in addition to the realm specified + * + * Fails if role not present + * + * @param roleId role to be removed + * @param realmId realm affected + * + * @return Success or failure (with reason) to remove the role + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 roleId = 2; + * if (rbac->RevokeRole(roleId) == RBAC_OK) + * sLog->outDebug(LOG_FILTER_PLAYER, "Role %u succesfully removed", roleId); + * @endcode + */ + RBACCommandResult RevokeRole(uint32 roleId, int32 realmId = 0); + + /** + * @name GrantRole + * @brief Grants a permission + * + * Grants a permission to the account. If realm is 0 or the permission can not be added + * No save to db action will be performed. + * + * Fails if permission Id does not exists or permission already granted or denied + * + * @param permissionId permission to be granted + * @param realmId realm affected + * + * @return Success or failure (with reason) to grant the permission + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 permissionId = 2; + * if (rbac->GrantRole(permissionId) == RBAC_IN_DENIED_LIST) + * sLog->outDebug(LOG_FILTER_PLAYER, "Failed to grant permission %u, already denied", permissionId); + * @endcode + */ + RBACCommandResult GrantPermission(uint32 permissionId, int32 realmId = 0); + + /** + * @name DenyPermission + * @brief Denies a permission + * + * Denied a permission to the account. If realm is 0 or the permission can not be added + * No save to db action will be performed. + * + * Fails if permission Id does not exists or permission already granted or denied + * + * @param permissionId permission to be denied + * @param realmId realm affected + * + * @return Success or failure (with reason) to deny the permission + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 permissionId = 2; + * if (rbac->DenyRole(permissionId) == RBAC_ID_DOES_NOT_EXISTS) + * sLog->outDebug(LOG_FILTER_PLAYER, "Role Id %u does not exists", permissionId); + * @endcode + */ + RBACCommandResult DenyPermission(uint32 permissionId, int32 realmId = 0); + + /** + * @name RevokePermission + * @brief Removes a permission + * + * Removes a permission from the account. If realm is 0 or the permission can not be removed + * No save to db action will be performed. Any delete operation will always affect + * "all realms (-1)" in addition to the realm specified + * + * Fails if permission not present + * + * @param permissionId permission to be removed + * @param realmId realm affected + * + * @return Success or failure (with reason) to remove the permission + * + * Example Usage: + * // previously defined "RBACData* rbac" with proper initialization + * uint32 permissionId = 2; + * if (rbac->RevokeRole(permissionId) == RBAC_OK) + * sLog->outDebug(LOG_FILTER_PLAYER, "Permission %u succesfully removed", permissionId); + * @endcode + */ + RBACCommandResult RevokePermission(uint32 permissionId, int32 realmId = 0); + + /// Loads all permissions, groups and roles assigned to current account + void LoadFromDB(); + private: + /// Saves a role to DB, Granted or Denied + void SaveRole(uint32 role, bool granted, int32 realm); + /// Saves a permission to DB, Granted or Denied + void SavePermission(uint32 role, bool granted, int32 realm); + + /** + * @name CalculateNewPermissions + * @brief Calculates new permissions + * + * Calculates new permissions after some change in groups, roles or permissions. + * The calculation is done Granted - Denied: + * - Granted permissions: through groups, through roles and directly assigned + * - Denied permissions: through roles and directly assigned + */ + void CalculateNewPermissions(); + + int32 GetRealmId() { return _realmId; } + + int32 _realmId; ///> RealmId Affected + RBACGroupContainer _groups; ///> Granted groups + RBACRoleContainer _grantedRoles; ///> Granted roles + RBACRoleContainer _deniedRoles; ///> Denied roles + RBACPermissionContainer _grantedPerms; ///> Granted permissions + RBACPermissionContainer _deniedPerms; ///> Denied permissions + RBACPermissionContainer _globalPerms; ///> Calculated permissions +}; + +#endif diff --git a/src/server/scripts/Commands/cs_rbac.cpp b/src/server/scripts/Commands/cs_rbac.cpp new file mode 100644 index 00000000000..fb21def4c02 --- /dev/null +++ b/src/server/scripts/Commands/cs_rbac.cpp @@ -0,0 +1,780 @@ +/* + * Copyright (C) 2008-2013 TrinityCore + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +/* ScriptData +Name: rbac_commandscript +%Complete: 100 +Comment: All role based access control related commands (including account related) +Category: commandscripts +EndScriptData */ + +#include "RBAC.h" +#include "Config.h" +#include "Chat.h" +#include "Language.h" +#include "Player.h" +#include "ScriptMgr.h" + +struct RBACCommandData +{ + RBACCommandData(): id(0), realmId(0), rbac(NULL), needDelete(false) { } + uint32 id; + int32 realmId; + RBACData* rbac; + bool needDelete; +}; + +class rbac_commandscript : public CommandScript +{ +public: + rbac_commandscript() : CommandScript("rbac_commandscript") { } + + ChatCommand* GetCommands() const + { + static ChatCommand rbacGroupsCommandTable[] = + { + { "add", SEC_ADMINISTRATOR, true, &HandleRBACGroupAddCommand, "", NULL }, + { "remove", SEC_ADMINISTRATOR, true, &HandleRBACGroupRemoveCommand, "", NULL }, + { "", SEC_ADMINISTRATOR, true, &HandleRBACGroupListCommand, "", NULL }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + static ChatCommand rbacRolesCommandTable[] = + { + { "grant", SEC_ADMINISTRATOR, true, &HandleRBACRoleGrantCommand, "", NULL }, + { "deny", SEC_ADMINISTRATOR, true, &HandleRBACRoleDenyCommand, "", NULL }, + { "revoke", SEC_ADMINISTRATOR, true, &HandleRBACRoleRevokeCommand, "", NULL }, + { "", SEC_ADMINISTRATOR, true, &HandleRBACRoleListCommand, "", NULL }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + static ChatCommand rbacPermsCommandTable[] = + { + { "grant", SEC_ADMINISTRATOR, true, &HandleRBACPermGrantCommand, "", NULL }, + { "deny", SEC_ADMINISTRATOR, true, &HandleRBACPermDenyCommand, "", NULL }, + { "revoke", SEC_ADMINISTRATOR, true, &HandleRBACPermRevokeCommand, "", NULL }, + { "", SEC_ADMINISTRATOR, true, &HandleRBACPermListCommand, "", NULL }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + static ChatCommand rbacListCommandTable[] = + { + { "groups", SEC_ADMINISTRATOR, true, &HandleRBACListGroupsCommand, "", NULL }, + { "roles", SEC_ADMINISTRATOR, true, &HandleRBACListRolesCommand, "", NULL }, + { "permissions", SEC_ADMINISTRATOR, true, &HandleRBACListPermissionsCommand, "", NULL }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + static ChatCommand rbacAccountCommandTable[] = + { + { "group", SEC_ADMINISTRATOR, true, NULL, "", rbacGroupsCommandTable }, + { "role", SEC_ADMINISTRATOR, true, NULL, "", rbacRolesCommandTable }, + { "permission", SEC_ADMINISTRATOR, true, NULL, "", rbacPermsCommandTable }, + { "", SEC_ADMINISTRATOR, true, &HandleRBACAccountPermissionCommand, "", NULL }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + static ChatCommand rbacCommandTable[] = + { + { "account", SEC_ADMINISTRATOR, true, NULL, "", rbacAccountCommandTable }, + { "list", SEC_ADMINISTRATOR, true, NULL, "", rbacListCommandTable }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + static ChatCommand commandTable[] = + { + { "rbac", SEC_ADMINISTRATOR, true, NULL, "", rbacCommandTable }, + { NULL, SEC_ADMINISTRATOR, false, NULL, "", NULL } + }; + + return commandTable; + } + + static RBACCommandData* ReadParams(ChatHandler* handler, char const* args, bool checkParams = true) + { + if (!args) + return NULL; + + char* param1 = strtok((char*)args, " "); + char* param2 = strtok(NULL, " "); + char* param3 = strtok(NULL, " "); + + int32 realmId = -1; + uint32 accountId = 0; + std::string accountName; + uint32 id = 0; + RBACCommandData* data = NULL; + RBACData* rdata = NULL; + bool useSelectedPlayer = false; + + if (checkParams) + { + if (!param3) + { + if (param2) + realmId = atoi(param2); + + if (param1) + id = atoi(param1); + + useSelectedPlayer = true; + } + else + { + id = atoi(param2); + realmId = atoi(param3); + } + + if (!id) + { + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, id); + handler->SetSentErrorMessage(true); + return NULL; + } + + if (realmId < -1 || !realmId) + { + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_REALM, realmId); + handler->SetSentErrorMessage(true); + return NULL; + } + } + else if (!param1) + useSelectedPlayer = true; + + if (useSelectedPlayer) + { + Player* player = handler->getSelectedPlayer(); + if (!player) + return NULL; + + rdata = player->GetSession()->GetRBACData(); + accountId = rdata->GetId(); + AccountMgr::GetName(accountId, accountName); + } + else + { + accountName = param1; + + if (AccountMgr::normalizeString(accountName)) + accountId = AccountMgr::GetId(accountName); + + if (!accountId) + { + handler->PSendSysMessage(LANG_ACCOUNT_NOT_EXIST, accountName.c_str()); + handler->SetSentErrorMessage(true); + return NULL; + } + } + + if (checkParams && handler->HasLowerSecurityAccount(NULL, accountId, true)) + return NULL; + + data = new RBACCommandData(); + + if (!rdata) + { + data->rbac = new RBACData(accountId, accountName, ConfigMgr::GetIntDefault("RealmID", 0)); + data->rbac->LoadFromDB(); + data->needDelete = true; + } + else + data->rbac = rdata; + + data->id = id; + data->realmId = realmId; + return data; + } + + static bool HandleRBACGroupAddCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->AddGroup(command->id, command->realmId); + RBACGroup const* group = sAccountMgr->GetRBACGroup(command->id); + + switch (result) + { + case RBAC_CANT_ADD_ALREADY_ADDED: + handler->PSendSysMessage(LANG_RBAC_GROUP_IN_LIST, command->id, group->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_GROUP_ADDED, command->id, group->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACGroupRemoveCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->RemoveGroup(command->id, command->realmId); + RBACGroup const* group = sAccountMgr->GetRBACGroup(command->id); + + switch (result) + { + case RBAC_CANT_REVOKE_NOT_IN_LIST: + handler->PSendSysMessage(LANG_RBAC_GROUP_NOT_IN_LIST, command->id, group->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_GROUP_REMOVED, command->id, group->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACGroupListCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args, false); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_RBAC_GROUP_LIST_HEADER, command->rbac->GetId(), command->rbac->GetName().c_str()); + RBACGroupContainer const& groups = command->rbac->GetGroups(); + if (groups.empty()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (RBACGroupContainer::const_iterator it = groups.begin(); it != groups.end(); ++it) + { + RBACGroup const* group = sAccountMgr->GetRBACGroup(*it); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, group->GetId(), group->GetName().c_str()); + } + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACRoleGrantCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->GrantRole(command->id, command->realmId); + RBACRole const* role = sAccountMgr->GetRBACRole(command->id); + + switch (result) + { + case RBAC_CANT_ADD_ALREADY_ADDED: + handler->PSendSysMessage(LANG_RBAC_ROLE_GRANTED_IN_LIST, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_IN_DENIED_LIST: + handler->PSendSysMessage(LANG_RBAC_ROLE_GRANTED_IN_DENIED_LIST, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_ROLE_GRANTED, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACRoleDenyCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->DenyRole(command->id, command->realmId); + RBACRole const* role = sAccountMgr->GetRBACRole(command->id); + + switch (result) + { + case RBAC_CANT_ADD_ALREADY_ADDED: + handler->PSendSysMessage(LANG_RBAC_ROLE_DENIED_IN_LIST, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_IN_GRANTED_LIST: + handler->PSendSysMessage(LANG_RBAC_ROLE_DENIED_IN_GRANTED_LIST, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_ROLE_DENIED, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACRoleRevokeCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->RevokeRole(command->id, command->realmId); + RBACRole const* role = sAccountMgr->GetRBACRole(command->id); + + switch (result) + { + case RBAC_CANT_REVOKE_NOT_IN_LIST: + handler->PSendSysMessage(LANG_RBAC_ROLE_REVOKED_NOT_IN_LIST, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_ROLE_REVOKED, command->id, role->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACRoleListCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args, false); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_RBAC_ROLE_LIST_HEADER_GRANTED, command->rbac->GetId(), command->rbac->GetName().c_str()); + RBACGroupContainer const& granted = command->rbac->GetGrantedRoles(); + if (granted.empty()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (RBACRoleContainer::const_iterator it = granted.begin(); it != granted.end(); ++it) + { + RBACRole const* role = sAccountMgr->GetRBACRole(*it); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, role->GetId(), role->GetName().c_str()); + } + } + + handler->PSendSysMessage(LANG_RBAC_ROLE_LIST_HEADER_DENIED, command->rbac->GetId(), command->rbac->GetName().c_str()); + RBACGroupContainer const& denied = command->rbac->GetDeniedRoles(); + if (denied.empty()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (RBACRoleContainer::const_iterator it = denied.begin(); it != denied.end(); ++it) + { + RBACRole const* role = sAccountMgr->GetRBACRole(*it); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, role->GetId(), role->GetName().c_str()); + } + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACPermGrantCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->GrantPermission(command->id, command->realmId); + RBACPermission const* permission = sAccountMgr->GetRBACPermission(command->id); + + switch (result) + { + case RBAC_CANT_ADD_ALREADY_ADDED: + handler->PSendSysMessage(LANG_RBAC_PERM_GRANTED_IN_LIST, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_IN_DENIED_LIST: + handler->PSendSysMessage(LANG_RBAC_PERM_GRANTED_IN_DENIED_LIST, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_PERM_GRANTED, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACPermDenyCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->DenyPermission(command->id, command->realmId); + RBACPermission const* permission = sAccountMgr->GetRBACPermission(command->id); + + switch (result) + { + case RBAC_CANT_ADD_ALREADY_ADDED: + handler->PSendSysMessage(LANG_RBAC_PERM_DENIED_IN_LIST, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_IN_GRANTED_LIST: + handler->PSendSysMessage(LANG_RBAC_PERM_DENIED_IN_GRANTED_LIST, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_PERM_DENIED, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACPermRevokeCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + RBACCommandResult result = command->rbac->RevokePermission(command->id, command->realmId); + RBACPermission const* permission = sAccountMgr->GetRBACPermission(command->id); + + switch (result) + { + case RBAC_CANT_REVOKE_NOT_IN_LIST: + handler->PSendSysMessage(LANG_RBAC_PERM_REVOKED_NOT_IN_LIST, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_OK: + handler->PSendSysMessage(LANG_RBAC_PERM_REVOKED, command->id, permission->GetName().c_str(), + command->realmId, command->rbac->GetId(), command->rbac->GetName().c_str()); + break; + case RBAC_ID_DOES_NOT_EXISTS: + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, command->id); + break; + default: + break; + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACPermListCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args, false); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_RBAC_PERM_LIST_HEADER_GRANTED, command->rbac->GetId(), command->rbac->GetName().c_str()); + RBACPermissionContainer const& granted = command->rbac->GetGrantedPermissions(); + if (!granted.any()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (uint32 i = 0; i < RBAC_PERM_MAX; ++i) + if (granted.test(i)) + { + RBACPermission const* permission = sAccountMgr->GetRBACPermission(i); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); + } + } + + handler->PSendSysMessage(LANG_RBAC_PERM_LIST_HEADER_DENIED, command->rbac->GetId(), command->rbac->GetName().c_str()); + RBACPermissionContainer const& denied = command->rbac->GetDeniedPermissions(); + if (!denied.any()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (uint32 i = 0; i < RBAC_PERM_MAX; ++i) + if (denied.test(i)) + { + RBACPermission const* permission = sAccountMgr->GetRBACPermission(i); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); + } + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACAccountPermissionCommand(ChatHandler* handler, char const* args) + { + RBACCommandData* command = ReadParams(handler, args, false); + + if (!command) + { + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage(LANG_RBAC_PERM_LIST_GLOBAL, command->rbac->GetId(), command->rbac->GetName().c_str()); + RBACPermissionContainer const& permissions = command->rbac->GetPermissions(); + if (!permissions.any()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (uint32 i = 0; i < RBAC_PERM_MAX; ++i) + if (permissions.test(i)) + { + RBACPermission const* permission = sAccountMgr->GetRBACPermission(i); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); + } + } + + if (command->needDelete) + delete command; + + return true; + } + + static bool HandleRBACListGroupsCommand(ChatHandler* handler, char const* args) + { + uint32 id = 0; + if (char* param1 = strtok((char*)args, " ")) + id = atoi(param1); + + if (!id) + { + RBACGroupsContainer const& groups = sAccountMgr->GetRBACGroupList(); + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_GROUPS_HEADER)); + for (RBACGroupsContainer::const_iterator it = groups.begin(); it != groups.end(); ++it) + { + RBACGroup const* group = it->second; + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, group->GetId(), group->GetName().c_str()); + } + } + else + { + RBACGroup const* group = sAccountMgr->GetRBACGroup(id); + if (!group) + { + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, id); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_GROUPS_HEADER)); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, group->GetId(), group->GetName().c_str()); + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_ROLES_HEADER)); + RBACRoleContainer const& roles = group->GetRoles(); + if (roles.empty()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (RBACRoleContainer::const_iterator it = roles.begin(); it != roles.end(); ++it) + { + RBACRole const* role = sAccountMgr->GetRBACRole(*it); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, role->GetId(), role->GetName().c_str()); + } + } + } + + return true; + } + + static bool HandleRBACListRolesCommand(ChatHandler* handler, char const* args) + { + uint32 id = 0; + if (char* param1 = strtok((char*)args, " ")) + id = atoi(param1); + + if (!id) + { + RBACRolesContainer const& roles = sAccountMgr->GetRBACRoleList(); + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_ROLES_HEADER)); + for (RBACRolesContainer::const_iterator it = roles.begin(); it != roles.end(); ++it) + { + RBACRole const* role = it->second; + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, role->GetId(), role->GetName().c_str()); + } + } + else + { + RBACRole const* role = sAccountMgr->GetRBACRole(id); + if (!role) + { + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, id); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_ROLES_HEADER)); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, role->GetId(), role->GetName().c_str()); + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_PERMISSIONS_HEADER)); + RBACPermissionContainer const& permissions = role->GetPermissions(); + if (!permissions.any()) + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_EMPTY)); + else + { + for (uint32 i = 0; i < RBAC_PERM_MAX; ++i) + if (permissions.test(i)) + { + RBACPermission const* permission = sAccountMgr->GetRBACPermission(i); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); + } + } + } + + return true; + } + + static bool HandleRBACListPermissionsCommand(ChatHandler* handler, char const* args) + { + uint32 id = 0; + if (char* param1 = strtok((char*)args, " ")) + id = atoi(param1); + + if (!id) + { + RBACPermissionsContainer const& permissions = sAccountMgr->GetRBACPermissionList(); + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_PERMISSIONS_HEADER)); + for (RBACPermissionsContainer::const_iterator it = permissions.begin(); it != permissions.end(); ++it) + { + RBACPermission const* permission = it->second; + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); + } + } + else + { + RBACPermission const* permission = sAccountMgr->GetRBACPermission(id); + if (!permission) + { + handler->PSendSysMessage(LANG_RBAC_WRONG_PARAMETER_ID, id); + handler->SetSentErrorMessage(true); + return false; + } + + handler->PSendSysMessage("%s", handler->GetTrinityString(LANG_RBAC_LIST_PERMISSIONS_HEADER)); + handler->PSendSysMessage(LANG_RBAC_LIST_ELEMENT, permission->GetId(), permission->GetName().c_str()); + } + + return true; + } +}; + +void AddSC_rbac_commandscript() +{ + new rbac_commandscript(); +} -- cgit v1.2.3 From 30e1516387809e2ce255c36c182dc4774997acf5 Mon Sep 17 00:00:00 2001 From: Gacko Date: Mon, 4 Feb 2013 16:43:12 +0100 Subject: Rename sql files of 760d62e934f8289cdd9950c04a4dbf588eddd742 --- sql/updates/auth/2013_02_04_01_auth_account.sql | 3 +++ sql/updates/auth/2013_xx_xx_00_auth_account.sql | 3 --- sql/updates/world/2013_02_04_04_world_trinity_string.sql | 4 ++++ sql/updates/world/2013_xx_xx_00_world_trinity_string.sql | 4 ---- 4 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 sql/updates/auth/2013_02_04_01_auth_account.sql delete mode 100644 sql/updates/auth/2013_xx_xx_00_auth_account.sql create mode 100644 sql/updates/world/2013_02_04_04_world_trinity_string.sql delete mode 100644 sql/updates/world/2013_xx_xx_00_world_trinity_string.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_02_04_01_auth_account.sql b/sql/updates/auth/2013_02_04_01_auth_account.sql new file mode 100644 index 00000000000..9af73d41ee3 --- /dev/null +++ b/sql/updates/auth/2013_02_04_01_auth_account.sql @@ -0,0 +1,3 @@ +ALTER TABLE `account` + ADD COLUMN `mutereason` VARCHAR(255) NOT NULL DEFAULT '' AFTER `mutetime`, + ADD COLUMN `muteby` VARCHAR(50) NOT NULL DEFAULT '' AFTER `mutereason`; diff --git a/sql/updates/auth/2013_xx_xx_00_auth_account.sql b/sql/updates/auth/2013_xx_xx_00_auth_account.sql deleted file mode 100644 index 9af73d41ee3..00000000000 --- a/sql/updates/auth/2013_xx_xx_00_auth_account.sql +++ /dev/null @@ -1,3 +0,0 @@ -ALTER TABLE `account` - ADD COLUMN `mutereason` VARCHAR(255) NOT NULL DEFAULT '' AFTER `mutetime`, - ADD COLUMN `muteby` VARCHAR(50) NOT NULL DEFAULT '' AFTER `mutereason`; diff --git a/sql/updates/world/2013_02_04_04_world_trinity_string.sql b/sql/updates/world/2013_02_04_04_world_trinity_string.sql new file mode 100644 index 00000000000..0a4ec437b28 --- /dev/null +++ b/sql/updates/world/2013_02_04_04_world_trinity_string.sql @@ -0,0 +1,4 @@ +DELETE FROM `trinity_string` WHERE entry IN (300,550); +INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES +('300','Your chat has been disabled for %u minutes. By: %s ,Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), +('550','Mute time remaining: %s, By: %s, Reason: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); diff --git a/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql b/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql deleted file mode 100644 index 0a4ec437b28..00000000000 --- a/sql/updates/world/2013_xx_xx_00_world_trinity_string.sql +++ /dev/null @@ -1,4 +0,0 @@ -DELETE FROM `trinity_string` WHERE entry IN (300,550); -INSERT INTO `trinity_string` (`entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`) VALUES -('300','Your chat has been disabled for %u minutes. By: %s ,Reason: %s.',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), -('550','Mute time remaining: %s, By: %s, Reason: %s',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); -- cgit v1.2.3 From 61979f85918ed7acda19075d3a3201ad15bbcaea Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 4 Feb 2013 16:52:43 +0100 Subject: Scripts/Player: Add OnMapChanged to PlayerScripts (after map changed) Core/Dungeon Finder: Use OnMapChanged script to cast/remove Luck of the draw - Also move code to force party update to LfgPlayerScript - Remove some obsolete Lfg code after recent commits --- .../2013_02_04_05_world_spell_script_names.sql | 1 + src/server/game/DungeonFinding/LFGMgr.cpp | 14 ----- src/server/game/DungeonFinding/LFGMgr.h | 9 ++-- src/server/game/DungeonFinding/LFGScripts.cpp | 18 +++++++ src/server/game/DungeonFinding/LFGScripts.h | 1 + src/server/game/Entities/Player/Player.cpp | 19 +------ src/server/game/Maps/Map.cpp | 4 -- src/server/game/Scripting/ScriptMgr.cpp | 2 + src/server/game/Scripting/ScriptMgr.h | 3 ++ src/server/scripts/Spells/spell_generic.cpp | 61 ---------------------- 10 files changed, 29 insertions(+), 103 deletions(-) create mode 100644 sql/updates/world/2013_02_04_05_world_spell_script_names.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_05_world_spell_script_names.sql b/sql/updates/world/2013_02_04_05_world_spell_script_names.sql new file mode 100644 index 00000000000..055e4b1d77d --- /dev/null +++ b/sql/updates/world/2013_02_04_05_world_spell_script_names.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `spell_id`=72221; diff --git a/src/server/game/DungeonFinding/LFGMgr.cpp b/src/server/game/DungeonFinding/LFGMgr.cpp index e18a103e21c..9bb65b63557 100644 --- a/src/server/game/DungeonFinding/LFGMgr.cpp +++ b/src/server/game/DungeonFinding/LFGMgr.cpp @@ -1085,7 +1085,6 @@ void LFGMgr::UpdateProposal(uint32 proposalId, uint64 guid, bool accept) break; } - teleportStore.push_back(pguid); SetState(pguid, LFG_STATE_DUNGEON); } @@ -1320,10 +1319,7 @@ void LFGMgr::TeleportPlayer(Player* player, bool out, bool fromOpcode /*= false* sLog->outDebug(LOG_FILTER_LFG, "TeleportPlayer: Player %s is being teleported out. Current Map %u - Expected Map %u", player->GetName().c_str(), player->GetMapId(), uint32(dungeon->map)); if (player->GetMapId() == uint32(dungeon->map)) - { - player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); player->TeleportToBGEntryPoint(); - } return; } @@ -1597,16 +1593,6 @@ const std::string& LFGMgr::GetComment(uint64 guid) return PlayersStore[guid].GetComment(); } -bool LFGMgr::hasPendingTeleport(uint64 pguid) -{ - if (std::find(teleportStore.begin(), teleportStore.end(), pguid) != teleportStore.end()) - { - teleportStore.remove(pguid); - return true; - } - return false; -} - LfgDungeonSet const& LFGMgr::GetSelectedDungeons(uint64 guid) { sLog->outTrace(LOG_FILTER_LFG, "LFGMgr::GetSelectedDungeons: [" UI64FMTD "]", guid); diff --git a/src/server/game/DungeonFinding/LFGMgr.h b/src/server/game/DungeonFinding/LFGMgr.h index 07c4281f86f..96fedb65547 100644 --- a/src/server/game/DungeonFinding/LFGMgr.h +++ b/src/server/game/DungeonFinding/LFGMgr.h @@ -329,8 +329,6 @@ class LFGMgr void _LoadFromDB(Field* fields, uint64 guid); /// Initializes player data after loading group data from DB void SetupGroupMember(uint64 guid, uint64 gguid); - /// Player has pending teleport action - bool hasPendingTeleport(uint64 guid); /// Return Lfg dungeon entry for given dungeon id uint32 GetLFGDungeonEntry(uint32 id); @@ -340,7 +338,7 @@ class LFGMgr /// Get current player comment (used for LFR) std::string const& GetComment(uint64 gguid); /// Gets current lfg options - uint32 GetOptions(); // cs_lfg + uint32 GetOptions(); /// Sets new lfg options void SetOptions(uint32 options); /// Checks if given lfg option is enabled @@ -355,8 +353,6 @@ class LFGMgr uint64 GetLeader(uint64 guid); /// Initializes locked dungeons for given player (called at login or level change) void InitializeLockedDungeons(Player* player, uint8 level = 0); - /// Inits new proposal to boot a player - void InitBoot(uint64 gguid, uint64 kguid, uint64 vguid, std::string const& reason); /// Sets player team void SetTeam(uint64 guid, uint8 team); /// Sets player group @@ -385,6 +381,8 @@ class LFGMgr LfgDungeonSet GetRandomAndSeasonalDungeons(uint8 level, uint8 expansion); /// Teleport a player to/from selected dungeon void TeleportPlayer(Player* player, bool out, bool fromOpcode = false); + /// Inits new proposal to boot a player + void InitBoot(uint64 gguid, uint64 kguid, uint64 vguid, std::string const& reason); /// Updates player boot proposal with new player answer void UpdateBoot(uint64 guid, bool accept); /// Updates proposal to join dungeon with player answer @@ -467,7 +465,6 @@ class LFGMgr LfgPlayerBootContainer BootsStore; ///< Current player kicks LfgPlayerDataContainer PlayersStore; ///< Player data LfgGroupDataContainer GroupsStore; ///< Group data - LfgGuidList teleportStore; ///< Players being teleported }; } // namespace lfg diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index ac95d289397..46a4ed4a134 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -88,6 +88,24 @@ void LFGPlayerScript::OnBindToInstance(Player* player, Difficulty difficulty, ui sLFGMgr->InitializeLockedDungeons(player); } +void LFGPlayerScript::OnMapChanged(Player* player) +{ + Map const* map = player->GetMap(); + + if (sLFGMgr->inLfgDungeonMap(player->GetGUID(), map->GetId(), map->GetDifficulty())) + { + Group* group = player->GetGroup(); + for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + if (Player* member = itr->getSource()) + player->GetSession()->SendNameQueryOpcode(member->GetGUID()); + + if (sLFGMgr->selectedRandomLfgDungeon(player->GetGUID())) + player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); + } + else // if (player->HasAura(lfg:LFG_SPELL_LUCK_OF_THE_DRAW)) + player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); +} + LFGGroupScript::LFGGroupScript() : GroupScript("LFGGroupScript") { } diff --git a/src/server/game/DungeonFinding/LFGScripts.h b/src/server/game/DungeonFinding/LFGScripts.h index e9c6b1499d1..bb1900cad93 100644 --- a/src/server/game/DungeonFinding/LFGScripts.h +++ b/src/server/game/DungeonFinding/LFGScripts.h @@ -39,6 +39,7 @@ class LFGPlayerScript : public PlayerScript void OnLogout(Player* player); void OnLogin(Player* player); void OnBindToInstance(Player* player, Difficulty difficulty, uint32 mapId, bool permanent); + void OnMapChanged(Player* player); }; class LFGGroupScript : public GroupScript diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index dc98facc5ab..18b2a837b5a 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7444,17 +7444,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea) // group update if (Group* group = GetGroup()) - { SetGroupUpdateFlag(GROUP_UPDATE_FULL); - if (GetSession() && group->isLFGGroup() && sLFGMgr->hasPendingTeleport(GetGUID())) - { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) - { - if (Player* member = itr->getSource()) - GetSession()->SendNameQueryOpcode(member->GetGUID()); - } - } - } m_zoneUpdateId = newZone; m_zoneUpdateTimer = ZONE_UPDATE_INTERVAL; @@ -11913,19 +11903,12 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObject const* lootedObject) const { - lfg::LfgDungeonSet const& dungeons = sLFGMgr->GetSelectedDungeons(GetGUID()); - if (dungeons.empty()) - return EQUIP_ERR_OK; // not using LFG - if (!GetGroup() || !GetGroup()->isLFGGroup()) return EQUIP_ERR_OK; // not in LFG group // check if looted object is inside the lfg dungeon - bool lootedObjectInDungeon = false; Map const* map = lootedObject->GetMap(); - lootedObjectInDungeon = sLFGMgr->inLfgDungeonMap(GetGroup()->GetGUID(), map->GetId(), map->GetDifficulty()); - - if (!lootedObjectInDungeon) + if (!sLFGMgr->inLfgDungeonMap(GetGroup()->GetGUID(), map->GetId(), map->GetDifficulty())) return EQUIP_ERR_OK; if (!proto) diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp index 288592d1029..7fe516a1eb4 100644 --- a/src/server/game/Maps/Map.cpp +++ b/src/server/game/Maps/Map.cpp @@ -26,7 +26,6 @@ #include "GridStates.h" #include "Group.h" #include "InstanceScript.h" -#include "LFGMgr.h" #include "MapInstanced.h" #include "MapManager.h" #include "ObjectAccessor.h" @@ -2484,9 +2483,6 @@ bool InstanceMap::AddPlayerToMap(Player* player) ASSERT(playerBind->save == mapSave); } } - - if (group && group->isLFGGroup()) - player->CastSpell(player, lfg::LFG_SPELL_LUCK_OF_THE_DRAW, true); } // for normal instances cancel the reset schedule when the diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp index cae8ea9d2d5..8321b88962f 100644 --- a/src/server/game/Scripting/ScriptMgr.cpp +++ b/src/server/game/Scripting/ScriptMgr.cpp @@ -580,6 +580,8 @@ void ScriptMgr::OnPlayerEnterMap(Map* map, Player* player) ASSERT(map); ASSERT(player); + FOREACH_SCRIPT(PlayerScript)->OnMapChanged(player); + SCR_MAP_BGN(WorldMapScript, map, itr, end, entry, IsWorldMap); itr->second->OnPlayerEnter(map, player); SCR_MAP_END; diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h index 7f140cfffe0..b13c2da7f6c 100644 --- a/src/server/game/Scripting/ScriptMgr.h +++ b/src/server/game/Scripting/ScriptMgr.h @@ -754,6 +754,9 @@ class PlayerScript : public UnitScript // Called when a player switches to a new zone virtual void OnUpdateZone(Player* /*player*/, uint32 /*newZone*/, uint32 /*newArea*/) { } + + // Called when a player changes to a new map (after moving to new map) + virtual void OnMapChanged(Player* /*player*/) { } }; class GuildScript : public ScriptObject diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 39992e94c21..edda9750709 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -1707,66 +1707,6 @@ class spell_gen_damage_reduction_aura : public SpellScriptLoader } }; -class spell_gen_luck_of_the_draw : public SpellScriptLoader -{ - public: - spell_gen_luck_of_the_draw() : SpellScriptLoader("spell_gen_luck_of_the_draw") { } - - class spell_gen_luck_of_the_draw_AuraScript : public AuraScript - { - PrepareAuraScript(spell_gen_luck_of_the_draw_AuraScript); - Map const* map; - Difficulty difficulty; - - bool Load() - { - Player* owner = GetUnitOwner()->ToPlayer(); - if (!owner) - return false; - - Group* group = owner->GetGroup(); - if (!group || !group->isLFGGroup()) - return false; - - if (!sLFGMgr->selectedRandomLfgDungeon(owner->GetGUID())) - return false; - - map = owner->GetMap(); - difficulty = owner->GetMap()->GetDifficulty(); - - if (!sLFGMgr->inLfgDungeonMap(owner->GetGUID(), map->GetId(), difficulty)) - return false; - - return true; - } - - // cheap hax to make it have update calls - void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude) - { - isPeriodic = true; - amplitude = 5 * IN_MILLISECONDS; - } - - void Update(AuraEffect* /*effect*/) - { - Map const* currentMap = GetUnitOwner()->ToPlayer()->GetMap(); - if (currentMap != map || currentMap->GetDifficulty() != difficulty) - Remove(AURA_REMOVE_BY_DEFAULT); - } - - void Register() - { - DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_gen_luck_of_the_draw_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_luck_of_the_draw_AuraScript::Update, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE); - } - }; - - AuraScript* GetAuraScript() const - { - return new spell_gen_luck_of_the_draw_AuraScript(); - } -}; - enum DummyTrigger { SPELL_PERSISTANT_SHIELD_TRIGGERED = 26470, @@ -3608,7 +3548,6 @@ void AddSC_generic_spell_scripts() new spell_gen_vehicle_scaling(); new spell_gen_oracle_wolvar_reputation(); new spell_gen_damage_reduction_aura(); - new spell_gen_luck_of_the_draw(); new spell_gen_dummy_trigger(); new spell_gen_spirit_healer_res(); new spell_gen_gadgetzan_transporter_backfire(); -- cgit v1.2.3 From fb7a544d842c1c3dcdf24c1f82b192d8ca20d18c Mon Sep 17 00:00:00 2001 From: Spp Date: Mon, 4 Feb 2013 17:04:40 +0100 Subject: Correction to previous commit (Use proper way to delete from spell_script_names) --- sql/updates/world/2013_02_04_05_world_spell_script_names.sql | 2 +- src/server/game/DungeonFinding/LFGScripts.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_05_world_spell_script_names.sql b/sql/updates/world/2013_02_04_05_world_spell_script_names.sql index 055e4b1d77d..4dd5ee52583 100644 --- a/sql/updates/world/2013_02_04_05_world_spell_script_names.sql +++ b/sql/updates/world/2013_02_04_05_world_spell_script_names.sql @@ -1 +1 @@ -DELETE FROM `spell_script_names` WHERE `spell_id`=72221; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_gen_luck_of_the_draw'; diff --git a/src/server/game/DungeonFinding/LFGScripts.cpp b/src/server/game/DungeonFinding/LFGScripts.cpp index 46a4ed4a134..a4716de9524 100644 --- a/src/server/game/DungeonFinding/LFGScripts.cpp +++ b/src/server/game/DungeonFinding/LFGScripts.cpp @@ -102,7 +102,7 @@ void LFGPlayerScript::OnMapChanged(Player* player) if (sLFGMgr->selectedRandomLfgDungeon(player->GetGUID())) player->CastSpell(player, LFG_SPELL_LUCK_OF_THE_DRAW, true); } - else // if (player->HasAura(lfg:LFG_SPELL_LUCK_OF_THE_DRAW)) + else player->RemoveAurasDueToSpell(LFG_SPELL_LUCK_OF_THE_DRAW); } -- cgit v1.2.3 From 735419965c1defba92726f7a5244009be46c8886 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 4 Feb 2013 16:08:07 +0000 Subject: DB/Auth: Update sql/base/auth_database.sql --- sql/base/auth_database.sql | 245 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 240 insertions(+), 5 deletions(-) (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 24e15893461..9aaadcb55d5 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.22, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.6.9-rc, for Win64 (x86_64) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.5.22 +-- Server version 5.6.9-rc /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -38,8 +38,8 @@ CREATE TABLE `account` ( `online` tinyint(3) unsigned NOT NULL DEFAULT '0', `expansion` tinyint(3) unsigned NOT NULL DEFAULT '2', `mutetime` bigint(20) NOT NULL DEFAULT '0', - `mutereason` VARCHAR(255) NOT NULL DEFAULT '', - `muteby` VARCHAR(50) NOT NULL DEFAULT '', + `mutereason` varchar(255) NOT NULL DEFAULT '', + `muteby` varchar(50) NOT NULL DEFAULT '', `locale` tinyint(3) unsigned NOT NULL DEFAULT '0', `os` varchar(3) NOT NULL DEFAULT '', `recruiter` int(10) unsigned NOT NULL DEFAULT '0', @@ -159,6 +159,241 @@ LOCK TABLES `logs` WRITE; /*!40000 ALTER TABLE `logs` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `rbac_account_groups` +-- + +DROP TABLE IF EXISTS `rbac_account_groups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_account_groups` ( + `accountId` int(10) unsigned NOT NULL COMMENT 'Account id', + `groupId` int(10) unsigned NOT NULL COMMENT 'Group id', + `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all', + PRIMARY KEY (`accountId`,`groupId`,`realmId`), + KEY `fk__rbac_account_groups__rbac_groups` (`groupId`), + CONSTRAINT `fk__rbac_account_groups__account` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk__rbac_account_groups__rbac_groups` FOREIGN KEY (`groupId`) REFERENCES `rbac_groups` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account-Group relation'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_account_groups` +-- + +LOCK TABLES `rbac_account_groups` WRITE; +/*!40000 ALTER TABLE `rbac_account_groups` DISABLE KEYS */; +/*!40000 ALTER TABLE `rbac_account_groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_account_permissions` +-- + +DROP TABLE IF EXISTS `rbac_account_permissions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_account_permissions` ( + `accountId` int(10) unsigned NOT NULL COMMENT 'Account id', + `permissionId` int(10) unsigned NOT NULL COMMENT 'Permission id', + `granted` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Granted = 1, Denied = 0', + `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all', + PRIMARY KEY (`accountId`,`permissionId`,`realmId`), + KEY `fk__rbac_account_roles__rbac_permissions` (`permissionId`), + CONSTRAINT `fk__rbac_account_permissions__account` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk__rbac_account_roles__rbac_permissions` FOREIGN KEY (`permissionId`) REFERENCES `rbac_permissions` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account-Permission relation'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_account_permissions` +-- + +LOCK TABLES `rbac_account_permissions` WRITE; +/*!40000 ALTER TABLE `rbac_account_permissions` DISABLE KEYS */; +/*!40000 ALTER TABLE `rbac_account_permissions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_account_roles` +-- + +DROP TABLE IF EXISTS `rbac_account_roles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_account_roles` ( + `accountId` int(10) unsigned NOT NULL COMMENT 'Account id', + `roleId` int(10) unsigned NOT NULL COMMENT 'Role id', + `granted` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Granted = 1, Denied = 0', + `realmId` int(11) NOT NULL DEFAULT '-1' COMMENT 'Realm Id, -1 means all', + PRIMARY KEY (`accountId`,`roleId`,`realmId`), + KEY `fk__rbac_account_roles__rbac_roles` (`roleId`), + CONSTRAINT `fk__rbac_account_roles__account` FOREIGN KEY (`accountId`) REFERENCES `account` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk__rbac_account_roles__rbac_roles` FOREIGN KEY (`roleId`) REFERENCES `rbac_roles` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Account-Role relation'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_account_roles` +-- + +LOCK TABLES `rbac_account_roles` WRITE; +/*!40000 ALTER TABLE `rbac_account_roles` DISABLE KEYS */; +/*!40000 ALTER TABLE `rbac_account_roles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_group_roles` +-- + +DROP TABLE IF EXISTS `rbac_group_roles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_group_roles` ( + `groupId` int(10) unsigned NOT NULL COMMENT 'group id', + `roleId` int(10) unsigned NOT NULL COMMENT 'Role id', + PRIMARY KEY (`groupId`,`roleId`), + KEY `fk__rbac_group_roles__rbac_roles` (`roleId`), + CONSTRAINT `fk__rbac_group_roles__rbac_roles` FOREIGN KEY (`roleId`) REFERENCES `rbac_roles` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk__rbac_group_roles__rbac_groups` FOREIGN KEY (`groupId`) REFERENCES `rbac_groups` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Group Role relation'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_group_roles` +-- + +LOCK TABLES `rbac_group_roles` WRITE; +/*!40000 ALTER TABLE `rbac_group_roles` DISABLE KEYS */; +INSERT INTO `rbac_group_roles` VALUES (1,1),(2,2),(3,3),(4,4),(2,5),(1,6),(1,7); +/*!40000 ALTER TABLE `rbac_group_roles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_groups` +-- + +DROP TABLE IF EXISTS `rbac_groups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_groups` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Group id', + `name` varchar(50) NOT NULL COMMENT 'Group name', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Group List'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_groups` +-- + +LOCK TABLES `rbac_groups` WRITE; +/*!40000 ALTER TABLE `rbac_groups` DISABLE KEYS */; +INSERT INTO `rbac_groups` VALUES (1,'Player'),(2,'Moderator'),(3,'GameMaster'),(4,'Administrator'); +/*!40000 ALTER TABLE `rbac_groups` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_permissions` +-- + +DROP TABLE IF EXISTS `rbac_permissions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_permissions` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Permission id', + `name` varchar(100) NOT NULL COMMENT 'Permission name', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Permission List'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_permissions` +-- + +LOCK TABLES `rbac_permissions` WRITE; +/*!40000 ALTER TABLE `rbac_permissions` DISABLE KEYS */; +INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(7,'Player Commands (Temporal till commands moved to rbac)'),(8,'Moderator Commands (Temporal till commands moved to rbac)'),(9,'GameMaster Commands (Temporal till commands moved to rbac)'),(10,'Administrator Commands (Temporal till commands moved to rbac)'); +/*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_role_permissions` +-- + +DROP TABLE IF EXISTS `rbac_role_permissions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_role_permissions` ( + `roleId` int(10) unsigned NOT NULL COMMENT 'Role id', + `permissionId` int(10) unsigned NOT NULL COMMENT 'Permission id', + PRIMARY KEY (`roleId`,`permissionId`), + KEY `fk__role_permissions__rbac_permissions` (`permissionId`), + CONSTRAINT `fk__role_permissions__rbac_roles` FOREIGN KEY (`roleId`) REFERENCES `rbac_roles` (`id`) ON DELETE CASCADE, + CONSTRAINT `fk__role_permissions__rbac_permissions` FOREIGN KEY (`permissionId`) REFERENCES `rbac_permissions` (`id`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Role Permission relation'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_role_permissions` +-- + +LOCK TABLES `rbac_role_permissions` WRITE; +/*!40000 ALTER TABLE `rbac_role_permissions` DISABLE KEYS */; +INSERT INTO `rbac_role_permissions` VALUES (5,1),(5,2),(6,3),(6,4),(6,5),(7,6),(1,7),(2,8),(3,9),(4,10); +/*!40000 ALTER TABLE `rbac_role_permissions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_roles` +-- + +DROP TABLE IF EXISTS `rbac_roles`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_roles` ( + `id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Role id', + `name` varchar(50) NOT NULL COMMENT 'Role name', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Roles List'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_roles` +-- + +LOCK TABLES `rbac_roles` WRITE; +/*!40000 ALTER TABLE `rbac_roles` DISABLE KEYS */; +INSERT INTO `rbac_roles` VALUES (1,'Player Commands'),(2,'Moderator Commands'),(3,'GameMaster Commands'),(4,'Administrator Commands'),(5,'Quick Login/Logout'),(6,'Use Battleground/Arenas'),(7,'Use Dungeon Finder'); +/*!40000 ALTER TABLE `rbac_roles` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `rbac_security_level_groups` +-- + +DROP TABLE IF EXISTS `rbac_security_level_groups`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `rbac_security_level_groups` ( + `secId` int(10) unsigned NOT NULL COMMENT 'Security Level id', + `groupId` int(10) unsigned NOT NULL COMMENT 'group id', + PRIMARY KEY (`secId`,`groupId`), + KEY `fk__rbac_security_level_groups__rbac_groups` (`groupId`), + CONSTRAINT `fk__rbac_security_level_groups__rbac_groups` FOREIGN KEY (`groupId`) REFERENCES `rbac_groups` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Default groups to assign when an account is set gm level'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `rbac_security_level_groups` +-- + +LOCK TABLES `rbac_security_level_groups` WRITE; +/*!40000 ALTER TABLE `rbac_security_level_groups` DISABLE KEYS */; +INSERT INTO `rbac_security_level_groups` VALUES (0,1),(1,1),(2,1),(3,1),(1,2),(2,2),(3,2),(2,3),(3,3),(3,4); +/*!40000 ALTER TABLE `rbac_security_level_groups` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `realmcharacters` -- @@ -254,4 +489,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-03-28 18:26:06 +-- Dump completed on 2013-02-04 16:07:23 -- cgit v1.2.3 From 2a69143cec66f12bd781dd7ec7d9a9be56fb5e09 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 4 Feb 2013 16:22:43 +0000 Subject: DB/Characters: Update sql/base/characters_database.sql --- sql/base/characters_database.sql | 96 +++++++++++++++++++++++++++------------- 1 file changed, 66 insertions(+), 30 deletions(-) (limited to 'sql') diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 9e16db1f381..423883a77f4 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.5.21, for Win64 (x86) +-- MySQL dump 10.13 Distrib 5.6.9-rc, for Win64 (x86_64) -- -- Host: localhost Database: characters -- ------------------------------------------------------ --- Server version 5.5.21 +-- Server version 5.6.9-rc /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -244,7 +244,7 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `calendar_events`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE IF NOT EXISTS `calendar_events` ( +CREATE TABLE `calendar_events` ( `id` bigint(20) unsigned NOT NULL DEFAULT '0', `creator` int(10) unsigned NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', @@ -258,6 +258,15 @@ CREATE TABLE IF NOT EXISTS `calendar_events` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `calendar_events` +-- + +LOCK TABLES `calendar_events` WRITE; +/*!40000 ALTER TABLE `calendar_events` DISABLE KEYS */; +/*!40000 ALTER TABLE `calendar_events` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `calendar_invites` -- @@ -265,7 +274,7 @@ CREATE TABLE IF NOT EXISTS `calendar_events` ( DROP TABLE IF EXISTS `calendar_invites`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE IF NOT EXISTS `calendar_invites` ( +CREATE TABLE `calendar_invites` ( `id` bigint(20) unsigned NOT NULL DEFAULT '0', `event` bigint(20) unsigned NOT NULL DEFAULT '0', `invitee` int(10) unsigned NOT NULL DEFAULT '0', @@ -278,6 +287,15 @@ CREATE TABLE IF NOT EXISTS `calendar_invites` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `calendar_invites` +-- + +LOCK TABLES `calendar_invites` WRITE; +/*!40000 ALTER TABLE `calendar_invites` DISABLE KEYS */; +/*!40000 ALTER TABLE `calendar_invites` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `channels` -- @@ -886,6 +904,30 @@ LOCK TABLES `character_queststatus_daily` WRITE; /*!40000 ALTER TABLE `character_queststatus_daily` ENABLE KEYS */; UNLOCK TABLES; +-- +-- Table structure for table `character_queststatus_monthly` +-- + +DROP TABLE IF EXISTS `character_queststatus_monthly`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `character_queststatus_monthly` ( + `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', + PRIMARY KEY (`guid`,`quest`), + KEY `idx_guid` (`guid`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `character_queststatus_monthly` +-- + +LOCK TABLES `character_queststatus_monthly` WRITE; +/*!40000 ALTER TABLE `character_queststatus_monthly` DISABLE KEYS */; +/*!40000 ALTER TABLE `character_queststatus_monthly` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `character_queststatus_rewarded` -- @@ -934,30 +976,6 @@ LOCK TABLES `character_queststatus_seasonal` WRITE; /*!40000 ALTER TABLE `character_queststatus_seasonal` ENABLE KEYS */; UNLOCK TABLES; --- --- Table structure for table `character_queststatus_monthly` --- - -DROP TABLE IF EXISTS `character_queststatus_monthly`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `character_queststatus_monthly` ( - `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', - `quest` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quest Identifier', - PRIMARY KEY (`guid`,`quest`), - KEY `idx_guid` (`guid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `character_queststatus_monthly` --- - -LOCK TABLES `character_queststatus_monthly` WRITE; -/*!40000 ALTER TABLE `character_queststatus_monthly` DISABLE KEYS */; -/*!40000 ALTER TABLE `character_queststatus_monthly` ENABLE KEYS */; -UNLOCK TABLES; - -- -- Table structure for table `character_queststatus_weekly` -- @@ -1814,7 +1832,7 @@ UNLOCK TABLES; DROP TABLE IF EXISTS `guild_member_withdraw`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE IF NOT EXISTS `guild_member_withdraw` ( +CREATE TABLE `guild_member_withdraw` ( `guid` int(10) unsigned NOT NULL, `tab0` int(10) unsigned NOT NULL DEFAULT '0', `tab1` int(10) unsigned NOT NULL DEFAULT '0', @@ -1976,6 +1994,15 @@ CREATE TABLE `item_loot_items` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `item_loot_items` +-- + +LOCK TABLES `item_loot_items` WRITE; +/*!40000 ALTER TABLE `item_loot_items` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_loot_items` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `item_loot_money` -- @@ -1989,6 +2016,15 @@ CREATE TABLE `item_loot_money` ( ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Dumping data for table `item_loot_money` +-- + +LOCK TABLES `item_loot_money` WRITE; +/*!40000 ALTER TABLE `item_loot_money` DISABLE KEYS */; +/*!40000 ALTER TABLE `item_loot_money` ENABLE KEYS */; +UNLOCK TABLES; + -- -- Table structure for table `item_refund_instance` -- @@ -2393,4 +2429,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2012-09-08 15:27:29 +-- Dump completed on 2013-02-04 16:22:06 -- cgit v1.2.3 From 8f6e9dc85ccda388bc5ced1921cd4e30cb5fe2e0 Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 4 Feb 2013 20:25:18 +0000 Subject: DB/Commands: Fix RBAC commands (remove an extra dot) --- sql/updates/world/2013_02_04_06_world_command.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sql/updates/world/2013_02_04_06_world_command.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_06_world_command.sql b/sql/updates/world/2013_02_04_06_world_command.sql new file mode 100644 index 00000000000..fb36c512c4a --- /dev/null +++ b/sql/updates/world/2013_02_04_06_world_command.sql @@ -0,0 +1,15 @@ +UPDATE `command` SET `name` = 'rbac account' WHERE `name` LIKE '.rbac account'; +UPDATE `command` SET `name` = 'rbac account group' WHERE `name` LIKE '.rbac account group'; +UPDATE `command` SET `name` = 'rbac account group add' WHERE `name` LIKE '.rbac account group add'; +UPDATE `command` SET `name` = 'rbac account group remove' WHERE `name` LIKE '.rbac account group remove'; +UPDATE `command` SET `name` = 'rbac account permission' WHERE `name` LIKE '.rbac account permission'; +UPDATE `command` SET `name` = 'rbac account permission deny' WHERE `name` LIKE '.rbac account permission deny'; +UPDATE `command` SET `name` = 'rbac account permission grant' WHERE `name` LIKE '.rbac account permission grant'; +UPDATE `command` SET `name` = 'rbac account permission revoke' WHERE `name` LIKE '.rbac account permission revoke'; +UPDATE `command` SET `name` = 'rbac account role' WHERE `name` LIKE '.rbac account role'; +UPDATE `command` SET `name` = 'rbac account role deny' WHERE `name` LIKE '.rbac account role deny'; +UPDATE `command` SET `name` = 'rbac account role grant' WHERE `name` LIKE '.rbac account role grant'; +UPDATE `command` SET `name` = 'rbac account role revoke' WHERE `name` LIKE '.rbac account role revoke'; +UPDATE `command` SET `name` = 'rbac list groups' WHERE `name` LIKE '.rbac list groups'; +UPDATE `command` SET `name` = 'rbac list permissions' WHERE `name` LIKE '.rbac list permissions'; +UPDATE `command` SET `name` = 'rbac list roles' WHERE `name` LIKE '.rbac list roles'; -- cgit v1.2.3 From 7f2a1ece62f7d75502f3ade7618e0f6377c6ac51 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Mon, 4 Feb 2013 22:17:23 +0100 Subject: Fix merge fail (fucking saving button -.-) --- sql/base/auth_database.sql | 4 ---- 1 file changed, 4 deletions(-) (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 14c5d2e8a92..f72d66a2fec 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -489,8 +489,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -<<<<<<< HEAD --- Dump completed on 2012-08-08 19:01:34 -======= -- Dump completed on 2013-02-04 16:07:23 ->>>>>>> 8f6e9dc85ccda388bc5ced1921cd4e30cb5fe2e0 -- cgit v1.2.3 From 1e8bf1aad18088c0e5cde8918d653bc00b0187a4 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Mon, 4 Feb 2013 23:39:04 +0200 Subject: DB/Misc: Fix achievement Flirt With Disaster. --- ...13_02_04_07_world_achievement_criteria_data.sql | 20 +++++++++++++++++ src/server/scripts/World/achievement_scripts.cpp | 25 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 sql/updates/world/2013_02_04_07_world_achievement_criteria_data.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_07_world_achievement_criteria_data.sql b/sql/updates/world/2013_02_04_07_world_achievement_criteria_data.sql new file mode 100644 index 00000000000..dc873a02dfd --- /dev/null +++ b/sql/updates/world/2013_02_04_07_world_achievement_criteria_data.sql @@ -0,0 +1,20 @@ +DELETE FROM `achievement_criteria_data` WHERE `criteria_id` IN (3931,12859,4227,3929); +INSERT INTO `achievement_criteria_data` (`criteria_id`,`type`,`value1`,`value2`,`ScriptName`) VALUES +-- aliance +-- Kissed Sraaz +(3931,1,9099,0,''), +(3931,11,0,0,'achievement_flirt_with_disaster_perf_check'), +(3931,15,3,0,''), +-- Handful of Rose Petals on Sraaz +(12859,1,9099,0,''), +(12859,11,0,0,'achievement_flirt_with_disaster_perf_check'), +(12859,15,3,0,''), +-- horde +-- Kissed Jeremiah Payson +(3929,1,8403,0,''), +(3929,11,0,0,'achievement_flirt_with_disaster_perf_check'), +(3929,15,3,0,''), +-- Handful of Rose Petals on Jeremiah Payson +(4227,1,8403,0,''), +(4227,11,0,0,'achievement_flirt_with_disaster_perf_check'), +(4227,15,3,0,''); diff --git a/src/server/scripts/World/achievement_scripts.cpp b/src/server/scripts/World/achievement_scripts.cpp index 41a32185620..d0ffe5214db 100644 --- a/src/server/scripts/World/achievement_scripts.cpp +++ b/src/server/scripts/World/achievement_scripts.cpp @@ -315,6 +315,30 @@ class achievement_not_even_a_scratch : public AchievementCriteriaScript } }; +enum FlirtWithDisaster +{ + AURA_PERFUME_FOREVER = 70235, + AURA_PERFUME_ENCHANTRESS = 70234, + AURA_PERFUME_VICTORY = 70233, +}; + +class achievement_flirt_with_disaster_perf_check : public AchievementCriteriaScript +{ + public: + achievement_flirt_with_disaster_perf_check() : AchievementCriteriaScript("achievement_flirt_with_disaster_perf_check") { } + + bool OnCheck(Player* player, Unit* /*target*/) + { + if (!player) + return false; + + if (player->HasAura(AURA_PERFUME_FOREVER) || player->HasAura(AURA_PERFUME_ENCHANTRESS) || player->HasAura(AURA_PERFUME_VICTORY)) + return true; + + return false; + } +}; + void AddSC_achievement_scripts() { new achievement_resilient_victory(); @@ -333,4 +357,5 @@ void AddSC_achievement_scripts() new achievement_bg_sa_defense_of_ancients(); new achievement_tilted(); new achievement_not_even_a_scratch(); + new achievement_flirt_with_disaster_perf_check(); } -- cgit v1.2.3 From 630ad4b0b58c329b0b1e72da8a804a505c7927d1 Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Mon, 4 Feb 2013 20:03:04 -0500 Subject: DB/Creature: Updated Unseen template --- sql/updates/world/2013_02_04_08_world_creature_template.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_02_04_08_world_creature_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_04_08_world_creature_template.sql b/sql/updates/world/2013_02_04_08_world_creature_template.sql new file mode 100644 index 00000000000..3dd365366b6 --- /dev/null +++ b/sql/updates/world/2013_02_04_08_world_creature_template.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `faction_A`=15, `faction_H`=15, `speed_walk`=1.111112, `baseattacktime`=2000, `rangeattacktime`=2000, `dynamicflags`=0 WHERE `entry`=3094; -- Unseen -- cgit v1.2.3 From f205613eb5a47c390d0403e3b01a021304406617 Mon Sep 17 00:00:00 2001 From: Gacko Date: Tue, 5 Feb 2013 19:40:20 +0100 Subject: DB/Disable: Ignore LOS for Krakles Thermometer Closes #5560 --- sql/updates/world/2013_02_05_00_world_disables.sql | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 sql/updates/world/2013_02_05_00_world_disables.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_05_00_world_disables.sql b/sql/updates/world/2013_02_05_00_world_disables.sql new file mode 100644 index 00000000000..b7e9be4e3c7 --- /dev/null +++ b/sql/updates/world/2013_02_05_00_world_disables.sql @@ -0,0 +1,3 @@ +DELETE FROM `disables` WHERE `sourceType`=0 AND `entry`=16378; +INSERT INTO `disables`(`sourceType`,`entry`,`flags`) VALUE +(0,16378,64); -- cgit v1.2.3 From 00d299f12f406020abbd705476677d0a2f17486c Mon Sep 17 00:00:00 2001 From: click Date: Tue, 5 Feb 2013 22:20:55 +0100 Subject: Core/SQL: Explicitly set the auth.account-table to use the INNODB-engine (to allow foreign keys and transactions) If you have an OLD database (auth), and RBAC SQL-alterations, make SURE that it's InnoDB, otherwise run this (it can be run multiple times anyway) (The only change added is to alter the table to explicitly be an InnoDB-table) --- sql/updates/auth/2013_02_04_00_auth_misc.sql | 3 +++ sql/updates/auth/2013_02_05_00_auth_account.sql | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 sql/updates/auth/2013_02_05_00_auth_account.sql (limited to 'sql') diff --git a/sql/updates/auth/2013_02_04_00_auth_misc.sql b/sql/updates/auth/2013_02_04_00_auth_misc.sql index 815df637be0..d8a508e4e7b 100644 --- a/sql/updates/auth/2013_02_04_00_auth_misc.sql +++ b/sql/updates/auth/2013_02_04_00_auth_misc.sql @@ -1,3 +1,6 @@ +-- Explicitly set the account-table to use INNODB-engine (to allow foreign keys and transactions) +ALTER TABLE account ENGINE=InnoDB; + -- Delete bad data from the DB before adding foreign keys DELETE FROM `account_access` WHERE `id` NOT IN (SELECT `id` FROM `account`); diff --git a/sql/updates/auth/2013_02_05_00_auth_account.sql b/sql/updates/auth/2013_02_05_00_auth_account.sql new file mode 100644 index 00000000000..2f32c5e3e3e --- /dev/null +++ b/sql/updates/auth/2013_02_05_00_auth_account.sql @@ -0,0 +1,2 @@ +-- Explicitly set the account-table to use INNODB-engine (to allow foreign keys and transactions) +ALTER TABLE account ENGINE=InnoDB; -- cgit v1.2.3 From 6a0b7950a7966ee212d728b16ef197a88ebe8bb6 Mon Sep 17 00:00:00 2001 From: Warpten Date: Wed, 6 Feb 2013 00:30:40 +0100 Subject: Core/Spells: Fixed Molten Core's proc. --- sql/updates/world/2013_02_06_00_world_spell_proc_event_434.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/updates/world/2013_02_06_00_world_spell_proc_event_434.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_06_00_world_spell_proc_event_434.sql b/sql/updates/world/2013_02_06_00_world_spell_proc_event_434.sql new file mode 100644 index 00000000000..1363a2f7491 --- /dev/null +++ b/sql/updates/world/2013_02_06_00_world_spell_proc_event_434.sql @@ -0,0 +1,6 @@ +-- Molten core +DELETE FROM `spell_proc_event` WHERE `entry` IN (47245, 47246, 47247); +INSERT INTO `spell_proc_event` (`entry`,`SchoolMask`,`SpellFamilyName`,`SpellFamilyMask0`,`SpellFamilyMask1`,`SpellFamilyMask2`,`procFlags`,`procEx`,`ppmRate`,`CustomChance`,`Cooldown`) VALUES +(47245, 0, 5, 4, 0, 0, 0, 1, 0, 0, 0), +(47246, 0, 5, 4, 0, 0, 0, 1, 0, 0, 0), +(47247, 0, 5, 4, 0, 0, 0, 1, 0, 0, 0); -- cgit v1.2.3 From 2fa8d06b25e3cd65ab0e6f8bc5db87cf4570408b Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Tue, 5 Feb 2013 22:30:34 -0500 Subject: DB/Items: Added Heart-Shaped Box, missing for Love in the Air event Closes: #9130 --- sql/updates/world/2013_02_05_01_world_item_template.sql | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 sql/updates/world/2013_02_05_01_world_item_template.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_05_01_world_item_template.sql b/sql/updates/world/2013_02_05_01_world_item_template.sql new file mode 100644 index 00000000000..aea09e60e58 --- /dev/null +++ b/sql/updates/world/2013_02_05_01_world_item_template.sql @@ -0,0 +1,4 @@ +DELETE FROM `item_template` WHERE `entry` IN (54516, 54537); +INSERT INTO `item_template` (`entry`, `class`, `subclass`, `SoundOverrideSubclass`, `name`, `displayid`, `Quality`, `Flags`, `FlagsExtra`, `BuyCount`, `BuyPrice`, `SellPrice`, `InventoryType`, `AllowableClass`, `AllowableRace`, `ItemLevel`, `RequiredLevel`, `RequiredSkill`, `RequiredSkillRank`, `requiredspell`, `requiredhonorrank`, `RequiredCityRank`, `RequiredReputationFaction`, `RequiredReputationRank`, `maxcount`, `stackable`, `ContainerSlots`, `StatsCount`, `stat_type1`, `stat_value1`, `stat_type2`, `stat_value2`, `stat_type3`, `stat_value3`, `stat_type4`, `stat_value4`, `stat_type5`, `stat_value5`, `stat_type6`, `stat_value6`, `stat_type7`, `stat_value7`, `stat_type8`, `stat_value8`, `stat_type9`, `stat_value9`, `stat_type10`, `stat_value10`, `ScalingStatDistribution`, `ScalingStatValue`, `dmg_min1`, `dmg_max1`, `dmg_type1`, `dmg_min2`, `dmg_max2`, `dmg_type2`, `armor`, `holy_res`, `fire_res`, `nature_res`, `frost_res`, `shadow_res`, `arcane_res`, `delay`, `ammo_type`, `RangedModRange`, `spellid_1`, `spelltrigger_1`, `spellcharges_1`, `spellppmRate_1`, `spellcooldown_1`, `spellcategory_1`, `spellcategorycooldown_1`, `spellid_2`, `spelltrigger_2`, `spellcharges_2`, `spellppmRate_2`, `spellcooldown_2`, `spellcategory_2`, `spellcategorycooldown_2`, `spellid_3`, `spelltrigger_3`, `spellcharges_3`, `spellppmRate_3`, `spellcooldown_3`, `spellcategory_3`, `spellcategorycooldown_3`, `spellid_4`, `spelltrigger_4`, `spellcharges_4`, `spellppmRate_4`, `spellcooldown_4`, `spellcategory_4`, `spellcategorycooldown_4`, `spellid_5`, `spelltrigger_5`, `spellcharges_5`, `spellppmRate_5`, `spellcooldown_5`, `spellcategory_5`, `spellcategorycooldown_5`, `bonding`, `description`, `PageText`, `LanguageID`, `PageMaterial`, `startquest`, `lockid`, `Material`, `sheath`, `RandomProperty`, `RandomSuffix`, `block`, `itemset`, `MaxDurability`, `area`, `Map`, `BagFamily`, `TotemCategory`, `socketColor_1`, `socketContent_1`, `socketColor_2`, `socketContent_2`, `socketColor_3`, `socketContent_3`, `socketBonus`, `GemProperties`, `RequiredDisenchantSkill`, `ArmorDamageModifier`, `duration`, `ItemLimitCategory`, `HolidayId`, `ScriptName`, `DisenchantID`, `FoodType`, `minMoneyLoot`, `maxMoneyLoot`, `flagsCustom`, `WDBVerified`) VALUES +(54516, 15, 0, -1, 'Loot-Filled Pumpkin', 67153, 3, 4, 8192, 1, 0, 0, 0, -1, -1, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 1, '', 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 324, '', 0, 0, 0, 0, 0, 15595), +(54537, 15, 0, -1, 'Heart-Shaped Box', 40293, 3, 4, 8192, 1, 0, 0, 0, -1, -1, 80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 0, 0, 0, 0, -1, 0, -1, 1, '', 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 423, '', 0, 0, 0, 0, 0, 15595); -- cgit v1.2.3 From 32546a64c9e42f3ad86fa54150209fe19fa2e487 Mon Sep 17 00:00:00 2001 From: Gacko Date: Wed, 6 Feb 2013 09:00:16 +0100 Subject: Add comment to f205613eb5a47c390d0403e3b01a021304406617 --- sql/updates/world/2013_02_06_00_world_disables.sql | 1 + 1 file changed, 1 insertion(+) create mode 100644 sql/updates/world/2013_02_06_00_world_disables.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_06_00_world_disables.sql b/sql/updates/world/2013_02_06_00_world_disables.sql new file mode 100644 index 00000000000..0785330d7fd --- /dev/null +++ b/sql/updates/world/2013_02_06_00_world_disables.sql @@ -0,0 +1 @@ +UPDATE `disables` SET `comment`='Ignore LOS for Krakles Thermometer' WHERE `sourceType`=0 AND `entry`=16378; -- cgit v1.2.3 From d42dac4cee2477ae77474f20ce03f14c1b779951 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Wed, 6 Feb 2013 18:32:28 +0200 Subject: DB/Misc: Fixup quest Hot On The Trail (A:24849 H:24851) --- sql/updates/world/2013_02_06_01_world_misc.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2013_02_06_01_world_misc.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_06_01_world_misc.sql b/sql/updates/world/2013_02_06_01_world_misc.sql new file mode 100644 index 00000000000..825ed8281bf --- /dev/null +++ b/sql/updates/world/2013_02_06_01_world_misc.sql @@ -0,0 +1,8 @@ +DELETE FROM `areatrigger_involvedrelation` WHERE `id` IN (5710,5711,5712,5714,5715,5716); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=5710; +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 +(5710,2,0,1,46,0,100,0,5710,0,0,0,86,71713,0,10,208836,38340,0,7,0,0,0,0,0,0,0,"On Trigger - Crosscast - Invoker"), +(5710,2,1,0,61,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,208836,38340,0,0,0,0,0,"Link - Kill - Bunny"); + +UPDATE `quest_template` SET `SpecialFlags`=0 WHERE `Id` IN (24849,24851); -- cgit v1.2.3 From f27a83e98feca1df207b6e0084763f6be7d90af9 Mon Sep 17 00:00:00 2001 From: w1sht0l1v3 Date: Wed, 6 Feb 2013 18:39:09 +0200 Subject: Fix up previous commit. --- sql/updates/world/2013_02_06_01_world_misc.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sql') diff --git a/sql/updates/world/2013_02_06_01_world_misc.sql b/sql/updates/world/2013_02_06_01_world_misc.sql index 825ed8281bf..1a59c75ff1b 100644 --- a/sql/updates/world/2013_02_06_01_world_misc.sql +++ b/sql/updates/world/2013_02_06_01_world_misc.sql @@ -1,6 +1,6 @@ DELETE FROM `areatrigger_involvedrelation` WHERE `id` IN (5710,5711,5712,5714,5715,5716); -DELETE FROM `smart_scripts` WHERE `entryorguid`=5710; +DELETE FROM `smart_scripts` WHERE `entryorguid`=5710 AND `source_type`=2; 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 (5710,2,0,1,46,0,100,0,5710,0,0,0,86,71713,0,10,208836,38340,0,7,0,0,0,0,0,0,0,"On Trigger - Crosscast - Invoker"), (5710,2,1,0,61,0,100,0,0,0,0,0,51,0,0,0,0,0,0,10,208836,38340,0,0,0,0,0,"Link - Kill - Bunny"); -- cgit v1.2.3 From fb43a92cc2aaffab42efebf025b6a12c01af8fde Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 7 Feb 2013 16:15:23 +0100 Subject: Core/Accounts: sessionkey field in account table is only a temporary storage to pass data from authserver to worldserver and should only be used as such. Clearing sessionkey from database after a successful login to prevent possible exploits. --- sql/base/auth_database.sql | 2 +- sql/updates/auth/2013_02_07_00_auth_account.sql | 3 ++ src/server/game/Accounts/AccountMgr.cpp | 8 +++++ src/server/game/Server/WorldSocket.cpp | 35 ++++++++-------------- .../Database/Implementation/LoginDatabase.cpp | 3 +- .../shared/Database/Implementation/LoginDatabase.h | 1 + 6 files changed, 28 insertions(+), 24 deletions(-) create mode 100644 sql/updates/auth/2013_02_07_00_auth_account.sql (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index 9aaadcb55d5..cdff87c245a 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -26,7 +26,7 @@ CREATE TABLE `account` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', `username` varchar(32) NOT NULL DEFAULT '', `sha_pass_hash` varchar(40) NOT NULL DEFAULT '', - `sessionkey` varchar(80) NOT NULL DEFAULT '', + `sessionkey` varchar(80) NOT NULL DEFAULT '' COMMENT 'Temporary storage of session key used to pass data from authserver to worldserver', `v` varchar(64) NOT NULL DEFAULT '', `s` varchar(64) NOT NULL DEFAULT '', `email` varchar(254) NOT NULL DEFAULT '', diff --git a/sql/updates/auth/2013_02_07_00_auth_account.sql b/sql/updates/auth/2013_02_07_00_auth_account.sql new file mode 100644 index 00000000000..03bdf8cdcd5 --- /dev/null +++ b/sql/updates/auth/2013_02_07_00_auth_account.sql @@ -0,0 +1,3 @@ +UPDATE `account` SET `sessionkey`=''; +ALTER TABLE `account` +CHANGE `sessionkey` `sessionkey` varchar(80) NOT NULL DEFAULT '' COMMENT 'Temporary storage of session key used to pass data from authserver to worldserver' AFTER `sha_pass_hash`; diff --git a/src/server/game/Accounts/AccountMgr.cpp b/src/server/game/Accounts/AccountMgr.cpp index ce382342de8..b1d0087c32c 100644 --- a/src/server/game/Accounts/AccountMgr.cpp +++ b/src/server/game/Accounts/AccountMgr.cpp @@ -187,6 +187,14 @@ AccountOpResult AccountMgr::ChangePassword(uint32 accountId, std::string newPass LoginDatabase.Execute(stmt); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_VS); + + stmt->setString(0, ""); + stmt->setString(1, ""); + stmt->setString(2, username); + + LoginDatabase.Execute(stmt); + return AOR_OK; } diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 8b102518e84..5260b5f77a9 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -750,7 +750,6 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) uint32 clientBuild; uint32 unk2, unk3, unk5, unk6, unk7; uint64 unk4; - BigNumber v, s, g, N; WorldPacket packet, SendAddonPacked; BigNumber k; @@ -779,6 +778,8 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) clientSeed); // Get the account information from the realmd database + // 0 1 2 3 4 5 6 7 8 + // SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ? PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME); stmt->setString(0, account); @@ -795,27 +796,11 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) Field* fields = result->Fetch(); - uint8 expansion = fields[6].GetUInt8(); + uint8 expansion = fields[4].GetUInt8(); uint32 world_expansion = sWorld->getIntConfig(CONFIG_EXPANSION); if (expansion > world_expansion) expansion = world_expansion; - N.SetHexStr ("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7"); - g.SetDword (7); - - v.SetHexStr(fields[4].GetCString()); - s.SetHexStr (fields[5].GetCString()); - - const char* sStr = s.AsHexStr(); // Must be freed by OPENSSL_free() - const char* vStr = v.AsHexStr(); // Must be freed by OPENSSL_free() - - sLog->outDebug(LOG_FILTER_NETWORKIO, "WorldSocket::HandleAuthSession: (s, v) check s: %s v: %s", - sStr, - vStr); - - OPENSSL_free((void*)sStr); - OPENSSL_free((void*)vStr); - ///- Re-check ip locking (same check as in realmd). if (fields[3].GetUInt8() == 1) // if ip is locked { @@ -831,7 +816,7 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) k.SetHexStr(fields[1].GetCString()); - int64 mutetime = fields[7].GetInt64(); + int64 mutetime = fields[5].GetInt64(); //! Negative mutetime indicates amount of seconds to be muted effective on next login - which is now. if (mutetime < 0) { @@ -845,12 +830,12 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) LoginDatabase.Execute(stmt); } - locale = LocaleConstant (fields[8].GetUInt8()); + locale = LocaleConstant (fields[6].GetUInt8()); if (locale >= TOTAL_LOCALES) locale = LOCALE_enUS; - uint32 recruiter = fields[9].GetUInt32(); - std::string os = fields[10].GetString(); + uint32 recruiter = fields[7].GetUInt32(); + std::string os = fields[8].GetString(); // Must be done before WorldSession is created if (sWorld->getBoolConfig(CONFIG_WARDEN_ENABLED) && os != "Win" && os != "OSX") @@ -948,6 +933,12 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // NOTE ATM the socket is single-threaded, have this in mind ... ACE_NEW_RETURN(m_Session, WorldSession(id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1); + stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_CLEAR_SESSIONKEY); + + stmt->setUInt32(0, id); + + LoginDatabase.Execute(stmt); + m_Crypt.Init(&k); m_Session->LoadGlobalAccountData(); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index bbb51cfbde6..747f3ef1dc6 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -35,6 +35,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC); PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_UPD_CLEAR_SESSIONKEY, "UPDATE account SET sessionkey = '' WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); @@ -42,7 +43,7 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_SEL_FAILEDLOGINS, "SELECT id, failed_logins FROM account WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_ID_BY_NAME, "SELECT id FROM account WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_NAME, "SELECT id, username FROM account WHERE username = ?", CONNECTION_SYNCH); - PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, v, s, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH); + PrepareStatement(LOGIN_SEL_ACCOUNT_INFO_BY_NAME, "SELECT id, sessionkey, last_ip, locked, expansion, mutetime, locale, recruiter, os FROM account WHERE username = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_LIST_BY_EMAIL, "SELECT id, username FROM account WHERE email = ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_NUM_CHARS_ON_REALM, "SELECT numchars FROM realmcharacters WHERE realmid = ? AND acctid= ?", CONNECTION_SYNCH); PrepareStatement(LOGIN_SEL_ACCOUNT_BY_IP, "SELECT id, username FROM account WHERE last_ip = ?", CONNECTION_SYNCH); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 939cc4b4790..6cd4ec99b79 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -53,6 +53,7 @@ enum LoginDatabaseStatements LOGIN_INS_ACCOUNT_AUTO_BANNED, LOGIN_DEL_ACCOUNT_BANNED, LOGIN_SEL_SESSIONKEY, + LOGIN_UPD_CLEAR_SESSIONKEY, LOGIN_UPD_VS, LOGIN_UPD_LOGONPROOF, LOGIN_SEL_LOGONCHALLENGE, -- cgit v1.2.3 From b6e56e42eaebbe509cb0574829afafdf31ba9d2c Mon Sep 17 00:00:00 2001 From: Shauren Date: Fri, 8 Feb 2013 01:03:56 +0100 Subject: Core/Auth: Reverted part of fb43a92cc2aaffab42efebf025b6a12c01af8fde - session key is still needed after logging in to be able to switch realms --- sql/base/auth_database.sql | 2 +- sql/updates/auth/2013_02_08_00_auth_account.sql | 1 + src/server/authserver/Server/AuthSocket.cpp | 2 +- src/server/game/Server/WorldSocket.cpp | 6 ------ src/server/shared/Database/Implementation/LoginDatabase.cpp | 1 - src/server/shared/Database/Implementation/LoginDatabase.h | 1 - 6 files changed, 3 insertions(+), 10 deletions(-) create mode 100644 sql/updates/auth/2013_02_08_00_auth_account.sql (limited to 'sql') diff --git a/sql/base/auth_database.sql b/sql/base/auth_database.sql index cdff87c245a..9aaadcb55d5 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -26,7 +26,7 @@ CREATE TABLE `account` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identifier', `username` varchar(32) NOT NULL DEFAULT '', `sha_pass_hash` varchar(40) NOT NULL DEFAULT '', - `sessionkey` varchar(80) NOT NULL DEFAULT '' COMMENT 'Temporary storage of session key used to pass data from authserver to worldserver', + `sessionkey` varchar(80) NOT NULL DEFAULT '', `v` varchar(64) NOT NULL DEFAULT '', `s` varchar(64) NOT NULL DEFAULT '', `email` varchar(254) NOT NULL DEFAULT '', diff --git a/sql/updates/auth/2013_02_08_00_auth_account.sql b/sql/updates/auth/2013_02_08_00_auth_account.sql new file mode 100644 index 00000000000..49948781444 --- /dev/null +++ b/sql/updates/auth/2013_02_08_00_auth_account.sql @@ -0,0 +1 @@ +ALTER TABLE `account` CHANGE `sessionkey` `sessionkey` varchar(80) NOT NULL DEFAULT '' AFTER `sha_pass_hash`; diff --git a/src/server/authserver/Server/AuthSocket.cpp b/src/server/authserver/Server/AuthSocket.cpp index b0bce520d4f..32ddf029f1c 100644 --- a/src/server/authserver/Server/AuthSocket.cpp +++ b/src/server/authserver/Server/AuthSocket.cpp @@ -207,7 +207,7 @@ AuthSocket::AuthSocket(RealmSocket& socket) : pPatch(NULL), socket_(socket) // Close patch file descriptor before leaving AuthSocket::~AuthSocket(void) {} -// Accept the connection and set the s random value for SRP6 +// Accept the connection void AuthSocket::OnAccept(void) { sLog->outDebug(LOG_FILTER_AUTHSERVER, "'%s:%d' Accepting connection", socket().getRemoteAddress().c_str(), socket().getRemotePort()); diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp index 5260b5f77a9..b2534bfbb0c 100644 --- a/src/server/game/Server/WorldSocket.cpp +++ b/src/server/game/Server/WorldSocket.cpp @@ -933,12 +933,6 @@ int WorldSocket::HandleAuthSession(WorldPacket& recvPacket) // NOTE ATM the socket is single-threaded, have this in mind ... ACE_NEW_RETURN(m_Session, WorldSession(id, this, AccountTypes(security), expansion, mutetime, locale, recruiter, isRecruiter), -1); - stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_CLEAR_SESSIONKEY); - - stmt->setUInt32(0, id); - - LoginDatabase.Execute(stmt); - m_Crypt.Init(&k); m_Session->LoadGlobalAccountData(); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.cpp b/src/server/shared/Database/Implementation/LoginDatabase.cpp index 747f3ef1dc6..a23294a038c 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.cpp +++ b/src/server/shared/Database/Implementation/LoginDatabase.cpp @@ -35,7 +35,6 @@ void LoginDatabaseConnection::DoPrepareStatements() PrepareStatement(LOGIN_INS_ACCOUNT_AUTO_BANNED, "INSERT INTO account_banned VALUES (?, UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+?, 'Trinity realmd', 'Failed login autoban', 1)", CONNECTION_ASYNC); PrepareStatement(LOGIN_DEL_ACCOUNT_BANNED, "DELETE FROM account_banned WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_SESSIONKEY, "SELECT a.sessionkey, a.id, aa.gmlevel FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE username = ?", CONNECTION_SYNCH); - PrepareStatement(LOGIN_UPD_CLEAR_SESSIONKEY, "UPDATE account SET sessionkey = '' WHERE id = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_VS, "UPDATE account SET v = ?, s = ? WHERE username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_UPD_LOGONPROOF, "UPDATE account SET sessionkey = ?, last_ip = ?, last_login = NOW(), locale = ?, failed_logins = 0, os = ? WHERE username = ?", CONNECTION_ASYNC); PrepareStatement(LOGIN_SEL_LOGONCHALLENGE, "SELECT a.sha_pass_hash, a.id, a.locked, a.last_ip, aa.gmlevel, a.v, a.s FROM account a LEFT JOIN account_access aa ON (a.id = aa.id) WHERE a.username = ?", CONNECTION_SYNCH); diff --git a/src/server/shared/Database/Implementation/LoginDatabase.h b/src/server/shared/Database/Implementation/LoginDatabase.h index 6cd4ec99b79..939cc4b4790 100644 --- a/src/server/shared/Database/Implementation/LoginDatabase.h +++ b/src/server/shared/Database/Implementation/LoginDatabase.h @@ -53,7 +53,6 @@ enum LoginDatabaseStatements LOGIN_INS_ACCOUNT_AUTO_BANNED, LOGIN_DEL_ACCOUNT_BANNED, LOGIN_SEL_SESSIONKEY, - LOGIN_UPD_CLEAR_SESSIONKEY, LOGIN_UPD_VS, LOGIN_UPD_LOGONPROOF, LOGIN_SEL_LOGONCHALLENGE, -- cgit v1.2.3 From 8066e43dd8a51a314b6ace8cf0b0282c36bdeadd Mon Sep 17 00:00:00 2001 From: Kinzcool Date: Fri, 8 Feb 2013 17:51:55 -0500 Subject: DB/Triggers: Added areatriggers in Shadowfang - when you'll try to jump out of the dungeon walls, you will be teleported --- sql/updates/world/2013_02_07_00_world_areatrigger_teleport.sql | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 sql/updates/world/2013_02_07_00_world_areatrigger_teleport.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_07_00_world_areatrigger_teleport.sql b/sql/updates/world/2013_02_07_00_world_areatrigger_teleport.sql new file mode 100644 index 00000000000..0b6f3e576b4 --- /dev/null +++ b/sql/updates/world/2013_02_07_00_world_areatrigger_teleport.sql @@ -0,0 +1,8 @@ +DELETE FROM `areatrigger_teleport` WHERE `id` IN (2406, 2407, 2408, 2409, 2410, 2411); +INSERT INTO `areatrigger_teleport` (`id`, `target_map`, `target_position_x`, `target_position_y`, `target_position_z`, `target_orientation`, `name`) VALUES +(2406, 0, -276.241, 1652.68, 77.5589, 3.14159, 'Shadowfang - South Fall Target'), +(2407, 0, -276.241, 1652.68, 77.5589, 3.14159, 'Shadowfang - South Fall Target'), +(2408, 0, -225.34, 1556.53, 93.0454, 4.71239, 'Shadowfang Front Fall Exit Target'), +(2409, 0, -225.34, 1556.53, 93.0454, 4.71239, 'Shadowfang Front Fall Exit Target'), +(2410, 0, -181.26, 1580.65, 97.4466, 6.28319, 'Shadowfang - North Fall Target'), +(2411, 0, -181.26, 1580.65, 97.4466, 6.28319, 'Shadowfang - North Fall Target'); -- cgit v1.2.3 From e33f70c002531ac048d154c16c1e5a57a9fefd49 Mon Sep 17 00:00:00 2001 From: Nay Date: Sat, 9 Feb 2013 15:13:49 +0000 Subject: DB/Quests: Fix quest The Collapse and Deploy the Shake-n-Quake Ref #1005 Ref #2034 Ref ae307048475ff14863d5a Closes #3595 --- sql/updates/world/2013_02_09_00_world_gameobject.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 sql/updates/world/2013_02_09_00_world_gameobject.sql (limited to 'sql') diff --git a/sql/updates/world/2013_02_09_00_world_gameobject.sql b/sql/updates/world/2013_02_09_00_world_gameobject.sql new file mode 100644 index 00000000000..386ca974e99 --- /dev/null +++ b/sql/updates/world/2013_02_09_00_world_gameobject.sql @@ -0,0 +1,10 @@ +SET @GUID = 4522; +SET @SINK = 300177; + +-- spawn TEMP South Sinkhole +DELETE FROM `gameobject` WHERE `guid`=@GUID AND `id`=@SINK; +INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`) VALUES +(@GUID, @SINK, 571, 1, 1, 3488.48, 4515.98, -20.7394, 5.34436, 0, 0, 0.452361, -0.891835, 300, 0, 1); + +-- increase TEMP South Sinkhole spellfocus radius +UPDATE `gameobject_template` SET `data1`=20 WHERE `entry`=@SINK; -- cgit v1.2.3