From 006cc1797a749d810b0a73c8a6b53bd1f5f6178e Mon Sep 17 00:00:00 2001 From: Gacko Date: Sun, 23 Dec 2012 18:04:42 +0100 Subject: Core: Fix warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit boss_sindragosa.cpp:235: warning: unused parameter ‘killer’ --- src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp index 8bdef30a711..ee915fb6ee8 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp @@ -232,7 +232,7 @@ class boss_sindragosa : public CreatureScript } } - void JustDied(Unit* killer) + void JustDied(Unit* /* killer */) { _JustDied(); Talk(SAY_DEATH); -- cgit v1.2.3 From a0ad8f7a467319fabad2cbf5e937ed1734143262 Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 12:39:51 -0500 Subject: Core/Entities: Also send MSG_MOVE_TELEPORT to the player --- src/server/game/Entities/Unit/Unit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index d44dc6ff235..86b0e60e294 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17340,7 +17340,7 @@ void Unit::SendTeleportPacket(Position& oldPos) if (GetTypeId() == TYPEID_PLAYER) Relocate(&oldPos); - SendMessageToSet(&data2, false); + SendMessageToSet(&data2, true); } bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport) -- cgit v1.2.3 From 01ef119703ed9ce8276e9a899d3260ec05495d0a Mon Sep 17 00:00:00 2001 From: stfx Date: Sat, 24 Nov 2012 14:37:01 +0100 Subject: Fix receiving whispers while being dnd Signed-off-by: Nay --- src/server/game/Entities/Player/Player.cpp | 33 +++++++++--------------------- 1 file changed, 10 insertions(+), 23 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index bca94517ef4..7dab5e15788 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -20089,42 +20089,29 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) std::string _text(text); sScriptMgr->OnPlayerChat(this, CHAT_MSG_WHISPER, language, _text, rPlayer); - // when player you are whispering to is dnd, he cannot receive your message, unless you are in gm mode - if (!rPlayer->isDND() || isGameMaster()) - { - WorldPacket data(SMSG_MESSAGECHAT, 200); - BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, language); - rPlayer->GetSession()->SendPacket(&data); - - // not send confirmation for addon messages - if (!isAddonMessage) - { - data.Initialize(SMSG_MESSAGECHAT, 200); - rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language); - GetSession()->SendPacket(&data); - } - } - else if (!isAddonMessage) - // announce to player that player he is whispering to is dnd and cannot receive his message - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->dndMsg.c_str()); + WorldPacket data(SMSG_MESSAGECHAT, 200); + BuildPlayerChat(&data, CHAT_MSG_WHISPER, _text, language); + rPlayer->GetSession()->SendPacket(&data); // rest stuff shouldn't happen in case of addon message if (isAddonMessage) return; + data.Initialize(SMSG_MESSAGECHAT, 200); + rPlayer->BuildPlayerChat(&data, CHAT_MSG_WHISPER_INFORM, _text, language); + GetSession()->SendPacket(&data); + if (!isAcceptWhispers() && !isGameMaster() && !rPlayer->isGameMaster()) { SetAcceptWhispers(true); ChatHandler(GetSession()).SendSysMessage(LANG_COMMAND_WHISPERON); } - // announce to player that player he is whispering to is afk + // announce afk or dnd message if (rPlayer->isAFK()) ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->afkMsg.c_str()); - - // if player whisper someone, auto turn of dnd to be able to receive an answer - if (isDND() && !rPlayer->isGameMaster()) - ToggleDND(); + else if (rPlayer->isDND()) + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->dndMsg.c_str()); } void Player::PetSpellInitialize() -- cgit v1.2.3 From 51fadb57e0f0071064599509caab34c6b883b17b Mon Sep 17 00:00:00 2001 From: stfx Date: Sat, 24 Nov 2012 14:54:52 +0100 Subject: Allow setting afk/dnd message in afk/dnd state Also use the same variable to store the message for AFK and DND Signed-off-by: Nay --- src/server/game/Entities/Player/Player.cpp | 16 +++------- src/server/game/Entities/Player/Player.h | 7 ++-- src/server/game/Handlers/ChatHandler.cpp | 51 ++++++++++++++++++------------ 3 files changed, 39 insertions(+), 35 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 7dab5e15788..87a7b2e6277 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -2031,24 +2031,18 @@ bool Player::BuildEnumData(PreparedQueryResult result, WorldPacket* data) return true; } -bool Player::ToggleAFK() +void Player::ToggleAFK() { ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); - bool state = HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); - // afk player not allowed in battleground - if (state && InBattleground() && !InArena()) + if (isAFK() && InBattleground() && !InArena()) LeaveBattleground(); - - return state; } -bool Player::ToggleDND() +void Player::ToggleDND() { ToggleFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); - - return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); } uint8 Player::GetChatTag() const @@ -20109,9 +20103,9 @@ void Player::Whisper(const std::string& text, uint32 language, uint64 receiver) // announce afk or dnd message if (rPlayer->isAFK()) - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->afkMsg.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_AFK, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str()); else if (rPlayer->isDND()) - ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->dndMsg.c_str()); + ChatHandler(GetSession()).PSendSysMessage(LANG_PLAYER_DND, rPlayer->GetName().c_str(), rPlayer->autoReplyMsg.c_str()); } void Player::PetSpellInitialize() diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 1e8b6aedb3e..8fc13e1dda9 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1108,13 +1108,12 @@ class Player : public Unit, public GridObject Creature* GetNPCIfCanInteractWith(uint64 guid, uint32 npcflagmask); GameObject* GetGameObjectIfCanInteractWith(uint64 guid, GameobjectTypes type) const; - bool ToggleAFK(); - bool ToggleDND(); + void ToggleAFK(); + void ToggleDND(); bool isAFK() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_AFK); } bool isDND() const { return HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_DND); } uint8 GetChatTag() const; - std::string afkMsg; - std::string dndMsg; + std::string autoReplyMsg; uint32 GetBarberShopCost(uint8 newhairstyle, uint8 newhaircolor, uint8 newfacialhair, BarberShopStyleEntry const* newSkin=NULL); diff --git a/src/server/game/Handlers/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index e4989816998..560cc904974 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -440,40 +440,51 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } break; case CHAT_MSG_AFK: { - if ((msg.empty() || !_player->isAFK()) && !_player->isInCombat()) + if (!_player->isInCombat()) { - if (!_player->isAFK()) + if (_player->isAFK()) // Already AFK { if (msg.empty()) - msg = GetTrinityString(LANG_PLAYER_AFK_DEFAULT); - _player->afkMsg = msg; + _player->ToggleAFK(); // Remove AFK + else + _player->autoReplyMsg = msg; // Update message } + else // New AFK mode + { + _player->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_AFK_DEFAULT) : msg; - sScriptMgr->OnPlayerChat(_player, type, lang, msg); + if (_player->isDND()) + _player->ToggleDND(); + + _player->ToggleAFK(); + } - _player->ToggleAFK(); - if (_player->isAFK() && _player->isDND()) - _player->ToggleDND(); + sScriptMgr->OnPlayerChat(_player, type, lang, msg); } - } break; + break; + } case CHAT_MSG_DND: { - if (msg.empty() || !_player->isDND()) + if (_player->isDND()) // Already DND { - if (!_player->isDND()) - { - if (msg.empty()) - msg = GetTrinityString(LANG_PLAYER_DND_DEFAULT); - _player->dndMsg = msg; - } + if (msg.empty()) + _player->ToggleDND(); // Remove DND + else + _player->autoReplyMsg = msg; // Update message + } + else // New DND mode + { + _player->autoReplyMsg = msg.empty() ? GetTrinityString(LANG_PLAYER_DND_DEFAULT) : msg; - sScriptMgr->OnPlayerChat(_player, type, lang, msg); + if (_player->isAFK()) + _player->ToggleAFK(); _player->ToggleDND(); - if (_player->isDND() && _player->isAFK()) - _player->ToggleAFK(); } - } break; + + sScriptMgr->OnPlayerChat(_player, type, lang, msg); + break; + } default: sLog->outError(LOG_FILTER_NETWORKIO, "CHAT: unknown message type %u, lang: %u", type, lang); break; -- cgit v1.2.3 From c33a1724ae96de3759d299038b1eabd7b93a631f Mon Sep 17 00:00:00 2001 From: Subv Date: Sun, 23 Dec 2012 13:21:00 -0500 Subject: Core/Spells: Spells that are usable while stunned should no longer have problems with stun auras that don't apply any mechanic. --- src/server/game/Spells/Spell.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index bb51d9d0e34..3cee51949bc 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -5615,7 +5615,7 @@ SpellCastResult Spell::CheckCasterAuras() const Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN); for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i) { - if (!((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1<GetSpellInfo()->GetAllEffectsMechanicMask() && !((*i)->GetSpellInfo()->GetAllEffectsMechanicMask() & (1< Date: Mon, 24 Dec 2012 00:48:41 +0200 Subject: Scripts/Quest: Defending Wyrmrest Temple * insert complete db sniff support, appart from missing spawns * remove achievement from disables (supported by core - timed one) * insert core support for spells and the defender itself, since SAI makes it act weird (maybe in future when SAI get integrated someone will convert it) Closes #1861 on 90% (except spawns (there are enough, but a lot more needed and minnor stuff that are core side connected with vehicles spellcastresults) --- .../2012_12_24_00_defending_wyrmrest_temple.sql | 77 ++++++++++++++++++ src/server/scripts/Northrend/dragonblight.cpp | 92 ++++++++++++++++++++-- src/server/scripts/Spells/spell_quest.cpp | 32 ++++++++ 3 files changed, 196 insertions(+), 5 deletions(-) create mode 100644 sql/updates/world/2012_12_24_00_defending_wyrmrest_temple.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_12_24_00_defending_wyrmrest_temple.sql b/sql/updates/world/2012_12_24_00_defending_wyrmrest_temple.sql new file mode 100644 index 00000000000..edf1f887d1c --- /dev/null +++ b/sql/updates/world/2012_12_24_00_defending_wyrmrest_temple.sql @@ -0,0 +1,77 @@ +-- Add support for quest Defending Wyrmrest Temple ID: 12372 and support for achievement Rapid Defence +-- Based on nelegalno and Nay updates +-- Indexes +-- NPCs +SET @Defender := 27629; +SET @AzureDrake := 27682; +SET @AzureDragon := 27608; +-- Spells +SET @SPELL_AZURE_ON_DEATH_FORCE_WHISPER := 50287; + +-- Update Defender template from sniffs +UPDATE `creature_template` SET `HoverHeight`=4,`npcflag`=1,`unit_flags`=unit_flags|0x00000200|0x00000300,`spell1`=49161,`spell2`=49243,`spell3`=49263,`spell4`=49264,`spell5`=49367,`InhabitType`=4 WHERE `entry`=@Defender; + +-- Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (49367,49370); +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=17 AND `SourceEntry` IN (49161,49243,49367); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ScriptName`,`Comment`) VALUES +(13,1,49367,0,0,31,0,3,27698,0,0,0,'','Spell can hit only Defending Wyrmrest Temple Kill Credit Bunny'), +(13,1,49370,0,0,31,0,3,27698,0,0,0,'','Spell can hit only Defending Wyrmrest Temple Kill Credit Bunny'), +(17,0,49367,0,0,29,0,27698,80,0,0,0,'','Temple Kill Credit Bunny must be in 80 yards to be able to cast Destibilize and less for smth to happen'), +(17,0,49161,0,0,31,1,3,27608,0,0,0,'','Spell Flame Breath target Azure Dragon'), +(17,0,49161,0,1,31,1,3,27682,0,0,0,'','Spell Flame Breath target Azure Drake'), +(17,0,49161,0,2,31,1,3,27629,0,0,0,'','Spell Flame Breath can target mounted by enemey faction player Defender'), +(17,0,49243,0,0,31,1,3,27608,0,0,0,'','Spell Immolation can target Azure Dragon'), +(17,0,49243,0,1,31,1,3,27682,0,0,0,'','Spell Immolation can target Azure Drake'), +(17,0,49243,0,1,31,1,3,27629,0,0,0,'','Spell Immolation can target mounted by enemey faction player Defender'); + +-- Remove unblizzlike npc_spell_sclick that is handled by spell now +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=27629; + +-- Addon data +DELETE FROM `creature_template_addon` WHERE `entry`=27629; +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(27629,0,0,33554432,1,0,50069); + +-- Convert EAI to SAI and fix some timings +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (@AzureDragon,@AzureDrake); +DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (@AzureDragon,@AzureDrake); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@AzureDragon,@AzureDrake) 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 +(@AzureDragon,0,0,0,0,0,100,0,500,4000,3700,4500,11,49111,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Azure Dragon - IC - Cast Frost Breath'), +(@AzureDragon,0,1,0,6,0,100,0,0,0,0,0,11,@SPELL_AZURE_ON_DEATH_FORCE_WHISPER,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Azure Dragon - On death - Cast force whisper spell on invoker (hack need to be replaced by 11'), +(@AzureDrake,0,0,0,0,0,100,0,500,4000,3700,4500,11,49317,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Azure Drake - IC - Cast Frost Breath'), +(@AzureDrake,0,1,0,6,0,100,0,0,0,0,0,11,@SPELL_AZURE_ON_DEATH_FORCE_WHISPER,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Azure Drake - On death - Cast force whisper spell on invoker'); +-- No need to condition them, stuff will happen only if send to drake otherwise would be plain result + +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@Defender; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +-- On player mounted or creature hit by mounting spell +(@Defender,0,0,'Are you ready for battle, $c?',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,1,'Take us into battle, $n!',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,2,'Shall we destabilize the shrine first or disable the enemy?',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,3,'We''ve been expecting you, $n. Now we have the upper hand.',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,4,'I can''t believe the blues would attack us. Let''s give some of it back!',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,5,'Let''s defend the temple!',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,6,'Where to first?',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,0,7,'Your reputation precedes you, $n. This should be interesting.',15,0,100,0,0,0, 'Wyrmrest Defender'), +-- On Azure Drake/Dragon kill +(@Defender,1,0,'I never thought that I''d be riding into battle with a $r on my back.',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,1,'Another blue down. We make a great team!',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,2,'With you and I working together, this battle will be over in no time.',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,3,'Malygos has clearly gone insane.',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,4,'Nice one, kid.',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,5,'I''ve never seen anything like this before. I''m glad that you''re here.',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,6,'I''m glad you saw that one!',15,0,100,0,0,0, 'Wyrmrest Defender'), +(@Defender,1,7,'Just hang on. We''ll get through this.',15,0,100,0,0,0, 'Wyrmrest Defender'), +-- Below 30% HP +(@Defender,2,0,'We should get out of here. I need to heal!',42,0,100,0,3000,0, 'Wyrmrest Defender'); + +-- Remove achievement "Rapid Defence" out of disables +DELETE FROM `disables` WHERE `sourceType`=4 AND `entry`=3924; + +-- Insert spell_script_name +DELETE FROM `spell_script_names` WHERE `spell_id`=@SPELL_AZURE_ON_DEATH_FORCE_WHISPER; +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(@SPELL_AZURE_ON_DEATH_FORCE_WHISPER, 'spell_q12372_azure_on_death_force_whisper'); diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 13a8370690e..71836a81687 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -33,6 +33,8 @@ EndContentData */ #include "SpellScript.h" #include "SpellAuraEffects.h" #include "ScriptedEscortAI.h" +#include "Vehicle.h" +#include "CombatAI.h" #include "Player.h" enum eEnums @@ -172,15 +174,27 @@ public: }; /*###### -## wyrmrest_defender +## Quest: Defending Wyrmrest Temple ID: 12372 ######*/ enum WyrmDefenderEnum { - QUEST_DEFENDING_WYRMREST_TEMPLE = 12372, - GOSSIP_TEXTID_DEF1 = 12899, - GOSSIP_TEXTID_DEF2 = 12900, - SPELL_CHARACTER_SCRIPT = 49213 + // Quest data + QUEST_DEFENDING_WYRMREST_TEMPLE = 12372, + GOSSIP_TEXTID_DEF1 = 12899, + + // Gossip data + GOSSIP_TEXTID_DEF2 = 12900, + + // Spells data + SPELL_CHARACTER_SCRIPT = 49213, + SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/ + SPELL_RENEW = 49263, // casted to heal drakes + SPELL_WYRMREST_DEFENDER_MOUNT = 49256, + + // Texts data + WHISPER_MOUNTED = 0, + BOSS_EMOTE_ON_LOW_HEALTH = 2 }; #define GOSSIP_ITEM_1 "We need to get into the fight. Are you ready?" @@ -211,10 +225,78 @@ class npc_wyrmrest_defender : public CreatureScript player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF2, creature->GetGUID()); // Makes player cast trigger spell for 49207 on self player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true); + // The gossip should not auto close } return true; } + + struct npc_wyrmrest_defenderAI : public VehicleAI + { + npc_wyrmrest_defenderAI(Creature* creature) : VehicleAI(creature) { } + + bool hpWarningReady; + bool renewRecoveryCanCheck; + + uint32 RenewRecoveryChecker; + + void Reset() + { + hpWarningReady = true; + renewRecoveryCanCheck = false; + + RenewRecoveryChecker = 0; + } + + void UpdateAI(uint32 const diff) + { + // Check system for Health Warning should happen first time whenever get under 30%, + // after it should be able to happen only after recovery of last renew is fully done (20 sec), + // next one used won't interfere + if (hpWarningReady && me->GetHealthPct() <= 30.0f) + { + me->CastSpell(me, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE); + hpWarningReady = false; + } + + if (renewRecoveryCanCheck) + { + if (RenewRecoveryChecker <= diff) + { + renewRecoveryCanCheck = false; + hpWarningReady = true; + } + else RenewRecoveryChecker -= diff; + } + } + + void SpellHit(Unit* /*caster*/, SpellInfo const* spell) + { + switch (spell->Id) + { + // This is what happens on retail + case SPELL_WYRMREST_DEFENDER_MOUNT: + Talk(WHISPER_MOUNTED, me->GetCharmerOrOwnerGUID()); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + break; + // Both below are for checking low hp warning + case SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE: + Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwnerGUID()); + break; + case SPELL_RENEW: + if (!hpWarningReady && RenewRecoveryChecker <= 100) + RenewRecoveryChecker = 20000; + renewRecoveryCanCheck = true; + break; + } + } + }; + + CreatureAI* GetAI(Creature* creature) const + { + return new npc_wyrmrest_defenderAI(creature); + } }; void AddSC_dragonblight() diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 58b6fca8a81..b6497c048c8 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1284,7 +1284,10 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader // 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect enum Quest12372Data { + // NPCs NPC_WYRMREST_TEMPLE_CREDIT = 27698, + // Spells + WHISPER_ON_HIT_BY_FORCE_WHISPER = 1 }; class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoader @@ -1318,6 +1321,34 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad } }; +// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (casted from Azure Dragons and Azure Drakes on death) +class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader +{ + public: + spell_q12372_azure_on_death_force_whisper() : SpellScriptLoader("spell_q12372_azure_on_death_force_whisper") { } + + class spell_q12372_azure_on_death_force_whisper_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12372_azure_on_death_force_whisper_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + if (Creature* defender = GetHitCreature()) + defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwnerGUID()); + } + + void Register() + { + OnEffectHitTarget += SpellEffectFn(spell_q12372_azure_on_death_force_whisper_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const + { + return new spell_q12372_azure_on_death_force_whisper_SpellScript(); + } +}; + // "Bombing Run" and "Bomb Them Again!" enum Quest11010_11102_11023Data { @@ -1522,4 +1553,5 @@ void AddSC_quest_spell_scripts() new spell_q11010_q11102_q11023_aggro_burst(); new spell_q11010_q11102_q11023_choose_loc(); new spell_q11010_q11102_q11023_q11008_check_fly_mount(); + new spell_q12372_azure_on_death_force_whisper(); } -- cgit v1.2.3 From fb3245d12533cde3fb0765b114a6132dde836119 Mon Sep 17 00:00:00 2001 From: Trista Date: Mon, 24 Dec 2012 01:35:55 +0200 Subject: Scripts/Quest: Gambling Debt and Words of Power * Quest support for Gambling Debt. Closes: #3122 * Fix bugging script for Words of Power: Closes: #7349 * Fix codestyle that vs broke from: 8c82c075cc32451d62d32bd0cfb51d60168ea8c5 --- sql/updates/world/2012_12_24_01_sai.sql | 42 ++++++++++++++++++ sql/updates/world/2012_12_24_02_sai.sql | 64 +++++++++++++++++++++++++++ src/server/scripts/Northrend/dragonblight.cpp | 27 +++++------ 3 files changed, 120 insertions(+), 13 deletions(-) create mode 100644 sql/updates/world/2012_12_24_01_sai.sql create mode 100644 sql/updates/world/2012_12_24_02_sai.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_12_24_01_sai.sql b/sql/updates/world/2012_12_24_01_sai.sql new file mode 100644 index 00000000000..d151ee4aa2c --- /dev/null +++ b/sql/updates/world/2012_12_24_01_sai.sql @@ -0,0 +1,42 @@ +-- Fix quest: "Words of Power" - http://www.wowhead.com/item=35354 +-- Indexes +SET @TALETKHA := 26073; +SET @SCRIPT := @TALETKHA * 100; + +-- Fix the previous SAIs for High Priest Talet-Kha +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@TALETKHA,-85118,-85098,-85176,-85175) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@SCRIPT AND `source_type`=9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@TALETKHA,0,0,1,1,0,100,1,0,0,0,0,70,0,0,0,0,0,0,10,85098,25422,0,0,0,0,0, 'High Priest Talet-Kha - On OOC (1 time per reset/respawn) - Respawn Mystical Webbing'), +(@TALETKHA,0,1,2,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85098,25422,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Set data 0 1 to Mystical Webbing'), +(@TALETKHA,0,2,3,61,0,100,0,0,0,0,0,70,0,0,0,0,0,0,10,85118,25422,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Respawn Mystical Webbing'), +(@TALETKHA,0,3,4,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85118,25422,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Set data 0 1 to Mystical Webbing'), +(@TALETKHA,0,4,5,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85175,23033,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Set data 0 1 to Invisible Stalker'), +(@TALETKHA,0,5,6,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,10,85176,23033,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Set data 0 1 to Invisible Stalker'), +(@TALETKHA,0,6,0,61,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Set phase 1'), +(@TALETKHA,0,7,0,38,0,100,0,0,1,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - On data set 0 1 - Increment phase by 1'), +(@TALETKHA,0,8,0,23,4,100,1,45497,0,0,0,80,@SCRIPT,2,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - On Aura missing - Run Script'), +(@TALETKHA,0,9,0,2,8,100,0,1,45,0,0,11,11640,1,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - Health 45% - Cast Renew on self'), +(@TALETKHA,0,10,0,0,8,100,0,4000,6000,5000,8000,11,15587,0,0,0,0,0,2,0,0,0,0,0,0,0, 'High Priest Talet-Kha - IC - Cast Mind Blast on victim'), +(@TALETKHA,0,11,12,25,8,100,0,0,0,0,0,18,33555200,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - On reset - Restore unit flags'), +(@TALETKHA,0,12,0,61,8,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - Linked with previous event - Set phase back to 0'), +(@SCRIPT,9,0,0,0,0,100,0,3000,3000,0,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Text 0'), +(@SCRIPT,9,1,0,0,0,100,0,500,500,0,0,69,0,0,0,0,0,0,8,0,0,0,3788.44,3418.25,85.0562,0, 'High Priest Talet-Kha - script - Move to point'), +(@SCRIPT,9,2,0,0,0,100,0,500,500,0,0,66,0,0,0,0,0,0,8,0,0,0,0,0,0,1.1672, 'High Priest Talet-Kha - script - Set Orientation'), +(@SCRIPT,9,3,0,0,0,100,0,1500,1500,0,0,91,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Bytes1 set to 0'), +(@SCRIPT,9,4,0,0,0,100,0,100,100,0,0,19,33555200,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Remove unitflags'), +(@SCRIPT,9,5,0,0,0,100,0,100,100,0,0,11,45492,1,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Aura self'), +(@SCRIPT,9,6,0,0,0,100,0,0,0,0,0,22,4,0,0,0,0,0,1,0,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Set phase 4'), +(@SCRIPT,9,7,0,0,0,100,0,0,0,0,0,49,0,0,0,0,0,0,21,40,0,0,0,0,0,0, 'High Priest Talet-Kha - script - Start attack on closest player in 40 yards'), +(-85118,0,0,1,38,0,100,0,0,1,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mystical Webbing - On data set 0 1 - Set React State passive'), +(-85118,0,1,0,61,0,100,0,0,0,0,0,11,45497,2,0,0,0,0,11,26073,40,0,0,0,0,0,'Mystical Webbing - Linked with previous event - Web Beam'), +(-85118,0,2,3,6,0,100,0,0,0,0,0,45,0,2,0,0,0,0,10,85175,23033,0,0,0,0,0,'Mystical Webbing - On death - set data 0 2 Invisible Stalker'), +(-85118,0,3,0,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,11,26073,40,0,0,0,0,0,'Mystical Webbing - Linked with previous event - Set data 0 1 on Talet-Kha'), +(-85098,0,0,1,38,0,100,0,0,1,0,0,8,0,0,0,0,0,0,1,0,0,0,0,0,0,0,'Mystical Webbing - On data set 0 1 - Set React State passive'), +(-85098,0,1,0,61,0,100,0,0,0,0,0,11,45497,2,0,0,0,0,11,26073,40,0,0,0,0,0,'Mystical Webbing - Linked with previous event - Web Beam'), +(-85098,0,2,3,6,0,100,0,0,0,0,0,45,0,2,0,0,0,0,10,85176,23033,0,0,0,0,0,'Mystical Webbing - On death - set data 0 2 Invisible Stalker'), +(-85098,0,3,0,61,0,100,0,0,0,0,0,45,0,1,0,0,0,0,11,26073,40,0,0,0,0,0,'Mystical Webbing - Linked with previous event - Set data 0 1 on Talet-Kha'), +(-85175,0,0,0,38,0,100,0,0,1,0,0,11,45497,2,0,0,0,0,11,26073,40,0,0,0,0,0, 'Invisible Stalker (Floating) - On data set 0 1 - Cast Web Beam on target'), +(-85175,0,1,0,38,0,100,0,0,2,0,0,92,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On data set 0 2 - Stop casting'), +(-85176,0,0,0,38,0,100,0,0,1,0,0,11,45497,2,0,0,0,0,11,26073,40,0,0,0,0,0, 'Invisible Stalker (Floating) - On data set 0 1 - Cast Web Beam on target'), +(-85176,0,1,0,38,0,100,0,0,2,0,0,92,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Invisible Stalker (Floating) - On data set 0 2 - Stop casting'); diff --git a/sql/updates/world/2012_12_24_02_sai.sql b/sql/updates/world/2012_12_24_02_sai.sql new file mode 100644 index 00000000000..03d0a9ef5c6 --- /dev/null +++ b/sql/updates/world/2012_12_24_02_sai.sql @@ -0,0 +1,64 @@ +-- [Q] Gambling Debt - http://www.wowhead.com/quest=11464 +-- Discover's work, thanks to Vincent-Michael for helping with gossips and Pitcrawler for advices +-- Indexes +SET @ENTRY := 24539; +SET @SCRIPT := @ENTRY * 100; +SET @SCRIPT1 := (@ENTRY * 100) + 1; +SET @GOSSIP_1 := 9010; +SET @GOSSIP_2 := 9011; +SET @QUEST := 11464; +SET @SPELL_SCORCH := 50183; +SET @SPELL_BLAST_WAVE := 15091; + +-- SAI support - "Silvermoon" Harry +UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=@ENTRY; +DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (@SCRIPT,@SCRIPT1) 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 +(@ENTRY,0,0,1,62,0,100,0,@GOSSIP_1,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary - On Gossip Select option 2 - Set Faction Aggressive'), +(@ENTRY,0,1,2,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Silvermoon Hary - On Gossip Select - Close Gossip'), +(@ENTRY,0,2,3,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,7,0,0,0,0,0,0,0, 'Silvermoon Hary - Linked with previous event - Say Line 0'), +(@ENTRY,0,3,0,61,0,100,0,0,0,0,0,2,14,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary - Linked with previous event - Set faction aggressive'), +(@ENTRY,0,4,0,2,0,100,1,1,50,60000,60000,80,@SCRIPT,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary - On hp % between 1/50 - Start acitonlist'), +(@ENTRY,0,5,0,64,1,100,0,0,0,0,0,98,@GOSSIP_2,12175,0,0,0,0,7,0,0,0,0,0,0,0, 'Silvermoon Hary - On gossip hello in phase 1 - Send gossip menu 2'), +(@ENTRY,0,6,0,62,1,100,0,@GOSSIP_2,0,0,0,80,@SCRIPT1,2,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary - On gossip select - Start actionlist 1'), +(@ENTRY,0,7,0,0,0,100,0,3000,6000,15000,22000,11,@SPELL_BLAST_WAVE,1,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary - IC - Cast Blast Wave'), +(@ENTRY,0,8,0,0,0,100,0,2500,4000,4000,5000,11,@SPELL_SCORCH,0,0,0,0,0,2,0,0,0,0,0,0,0, 'Silvermoon Hary - IC - Cast Scorch'), +(@SCRIPT,9,0,0,0,0,100,0,0,0,0,0,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 0) - Action 0 - Say line 1'), +(@SCRIPT,9,1,0,0,0,100,0,0,0,0,0,102,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 0) - Action 1 - Set hp reg disabled'), +(@SCRIPT,9,2,0,0,0,100,0,0,0,0,0,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 0) - Action 2 - Set home position'), +(@SCRIPT,9,3,0,0,0,100,0,0,0,0,0,2,1080,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 0) - Action 3 - Change faction to friendly'), +(@SCRIPT,9,4,0,0,0,100,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 0) - Action 4 - Evade (to stop attack)'), +(@SCRIPT,9,5,0,0,0,100,0,0,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 0) - Action 6 - Set event phase 1'), +(@SCRIPT1,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, 'Silvermoon Hary (script 1) - Action 0 - Close gossip window'), +(@SCRIPT1,9,1,0,0,0,100,0,0,0,0,0,56,34115,1,0,0,0,0,7,0,0,0,0,0,0,0, 'Silvermoon Hary (script 1) - Action 1 - Give item to invoker'), +(@SCRIPT1,9,2,0,0,0,100,0,0,0,0,0,102,1,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 1) - Action 2 - Set hp reg enabled'), +(@SCRIPT1,9,3,0,0,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 1) - Action 3 - Despawn in 10 sec'), +(@SCRIPT1,9,4,0,0,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0, 'Silvermoon Hary (script 1) - Action 4 - Set event phase 0'); + +-- Texts +DELETE FROM `creature_text` WHERE `entry`=@ENTRY; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(@ENTRY,0,0,'Do not test me, scurvy dog! I''m trained in the way of Blood Knights!',12,0,100,0,0,0, 'Silvermoon Hary - start to fight'), +(@ENTRY,1,0,"I'll pay! I'll pay! Eeeek! Please don't hurt me!",12,0,100,0,0,0, 'Silvermoon Hary - second gossip'); + +-- Gossip menu +DELETE FROM `gossip_menu` WHERE `entry` IN (@GOSSIP_1,@GOSSIP_2); +INSERT INTO `gossip_menu` (`entry`,`text_id`) VALUES +(@GOSSIP_1,12174), +(@GOSSIP_2,12175); + +-- Gossip option menu +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP_1; +DELETE FROM `gossip_menu_option` WHERE `menu_id`=@GOSSIP_2; +INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_id`,`npc_option_npcflag`,`option_icon`,`option_text`,`box_coded`,`box_money`,`box_text`) VALUES +(@GOSSIP_1,0,1,1,0, 'Taruk sent me to collect what you owe.',0,0, ''), +(@GOSSIP_1,1,3,128,1, 'Do you sell any of this stuff?',0,0, ''), +(@GOSSIP_2,0,1,1,0, 'Pay up, Harry!',0,0, ''), +(@GOSSIP_2,1,3,128,1, 'Do you sell any of this stuff?',0,0, ''); + +-- Condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (@GOSSIP_1,@GOSSIP_2); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,@GOSSIP_1,0,0,9,0,@QUEST,0,0,0,'','Only show first gossip (option 0) if player is on quest Gambling Debt'), +(15,@GOSSIP_2,0,0,9,0,@QUEST,0,0,0,'','Only show second gossip (option 0) if player is on quest Gambling Debt'); diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 71836a81687..698daba99e3 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -274,21 +274,22 @@ class npc_wyrmrest_defender : public CreatureScript { switch (spell->Id) { - // This is what happens on retail - case SPELL_WYRMREST_DEFENDER_MOUNT: - Talk(WHISPER_MOUNTED, me->GetCharmerOrOwnerGUID()); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); - break; + case SPELL_WYRMREST_DEFENDER_MOUNT: + Talk(WHISPER_MOUNTED, me->GetCharmerOrOwnerGUID()); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + break; // Both below are for checking low hp warning - case SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE: - Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwnerGUID()); - break; - case SPELL_RENEW: - if (!hpWarningReady && RenewRecoveryChecker <= 100) - RenewRecoveryChecker = 20000; + case SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE: + Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwnerGUID()); + break; + case SPELL_RENEW: + if (!hpWarningReady && RenewRecoveryChecker <= 100) + { + RenewRecoveryChecker = 20000; + } renewRecoveryCanCheck = true; - break; + break; } } }; -- cgit v1.2.3 From f6f368099521dd6c5fee86b54e0bbafb056438fd Mon Sep 17 00:00:00 2001 From: Subv Date: Mon, 24 Dec 2012 10:34:36 -0500 Subject: Core/BuildSystem: Added some more headers to the collisions project PCH --- src/server/collision/PrecompiledHeaders/collisionPCH.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/server') diff --git a/src/server/collision/PrecompiledHeaders/collisionPCH.h b/src/server/collision/PrecompiledHeaders/collisionPCH.h index 636eaa1bef8..ece2ef1b8ef 100644 --- a/src/server/collision/PrecompiledHeaders/collisionPCH.h +++ b/src/server/collision/PrecompiledHeaders/collisionPCH.h @@ -4,3 +4,6 @@ #include "WorldModel.h" #include "ModelInstance.h" #include "BoundingIntervalHierarchy.h" +#include "RegularGrid.h" +#include "BoundingIntervalHierarchyWrapper.h" +#include "GameObjectModel.h" -- cgit v1.2.3 From 7092e9350bbb8123de688be0bf5dd87d8196d34f Mon Sep 17 00:00:00 2001 From: Trista Date: Mon, 24 Dec 2012 18:04:58 +0200 Subject: Core/Movement: Final fix for MSG_MOVE_TELEPORT * Creator Subv, (thx to Shauren also who stated that this packed should be used when researchs were started) - You all should'be thankful, that bug was a real bitch * Fix creatures using NearTeleportTo (example Urom in Oculus, Skeram/Viscidus in AQ and Heigan in Naxxramas) --- src/server/game/Entities/Unit/Unit.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 86b0e60e294..2b956f028c7 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17324,22 +17324,30 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas ToPlayer()->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0)); else { - UpdatePosition(x, y, z, orientation, true); - Position pos; // dummy, not used for creatures. + Position pos = {x, y, z, orientation}; + SendTeleportPacket(pos); + UpdatePosition(x, y, z, orientation, true); UpdateObjectVisibility(); } } -void Unit::SendTeleportPacket(Position& oldPos) +void Unit::SendTeleportPacket(Position& pos) { + Position oldPos = {GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation()}; + if (GetTypeId() == TYPEID_UNIT) + { + Relocate(&pos); + } WorldPacket data2(MSG_MOVE_TELEPORT, 38); data2.append(GetPackGUID()); BuildMovementPacket(&data2); - + + if (GetTypeId() == TYPEID_UNIT) + Relocate(&oldPos); if (GetTypeId() == TYPEID_PLAYER) - Relocate(&oldPos); - + Relocate(&pos); + SendMessageToSet(&data2, true); } -- cgit v1.2.3 From 75e7cf7eb5ba0218eb5d29d8f961a619347df78d Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 24 Dec 2012 19:53:28 +0100 Subject: Core/Quests: Added support for 10/25 man only raid quests --- src/server/game/Entities/Player/Player.cpp | 8 ++++---- src/server/game/Handlers/QuestHandler.cpp | 12 ++---------- src/server/game/Quests/QuestDef.cpp | 21 +++++++++++++++++++-- src/server/game/Quests/QuestDef.h | 4 ++-- 4 files changed, 27 insertions(+), 18 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 87a7b2e6277..f85a251f010 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16036,7 +16036,7 @@ void Player::KilledMonsterCredit(uint32 entry, uint64 guid) continue; // just if !ingroup || !noraidgroup || raidgroup QuestStatusData& q_status = m_QuestStatus[questid]; - if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) + if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) { if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_KILL_OR_CAST)) { @@ -16091,7 +16091,7 @@ void Player::KilledPlayerCredit() continue; // just if !ingroup || !noraidgroup || raidgroup QuestStatusData& q_status = m_QuestStatus[questid]; - if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid())) + if (q_status.Status == QUEST_STATUS_INCOMPLETE && (!GetGroup() || !GetGroup()->isRaidGroup() || qInfo->IsAllowedInRaid(GetMap()->GetDifficulty()))) { if (qInfo->HasFlag(QUEST_TRINITY_FLAGS_PLAYER_KILL)) { @@ -16359,7 +16359,7 @@ bool Player::HasQuestForItem(uint32 itemid) const continue; // hide quest if player is in raid-group and quest is no raid quest - if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid()) + if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid(GetMap()->GetDifficulty())) if (!InBattleground()) //there are two ways.. we can make every bg-quest a raidquest, or add this code here.. i don't know if this can be exploited by other quests, but i think all other quests depend on a specific area.. but keep this in mind, if something strange happens later continue; @@ -22767,7 +22767,7 @@ bool Player::HasQuestForGO(int32 GOId) const if (!qinfo) continue; - if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid()) + if (GetGroup() && GetGroup()->isRaidGroup() && !qinfo->IsAllowedInRaid(GetMap()->GetDifficulty())) continue; for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j) diff --git a/src/server/game/Handlers/QuestHandler.cpp b/src/server/game/Handlers/QuestHandler.cpp index 8b230ae05c9..8181bdd6b6e 100644 --- a/src/server/game/Handlers/QuestHandler.cpp +++ b/src/server/game/Handlers/QuestHandler.cpp @@ -461,16 +461,8 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData) if (!pOriginalPlayer) return; - if (quest->IsRaidQuest()) - { - if (!_player->IsInSameRaidWith(pOriginalPlayer)) - return; - } - else - { - if (!_player->IsInSameGroupWith(pOriginalPlayer)) - return; - } + if (!_player->IsInSameRaidWith(pOriginalPlayer)) + return; if (_player->CanAddQuest(quest, true)) _player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 1238afe2ee1..a918a19334f 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -219,9 +219,26 @@ bool Quest::IsAutoComplete() const return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_AUTO_COMPLETE) ? false : (Method == 0 || HasFlag(QUEST_FLAGS_AUTOCOMPLETE)); } -bool Quest::IsAllowedInRaid() const +bool Quest::IsRaidQuest(Difficulty difficulty) const { - if (IsRaidQuest()) + switch (Type) + { + case QUEST_TYPE_RAID: + return true; + case QUEST_TYPE_RAID_10: + return !(difficulty & RAID_DIFFICULTY_MASK_25MAN); + case QUEST_TYPE_RAID_25: + return difficulty & RAID_DIFFICULTY_MASK_25MAN; + default: + break; + } + + return false; +} + +bool Quest::IsAllowedInRaid(Difficulty difficulty) const +{ + if (IsRaidQuest(difficulty)) return true; return sWorld->getBoolConfig(CONFIG_QUEST_IGNORE_RAID); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 61b3de5f327..8b18872b016 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -254,8 +254,8 @@ class Quest bool IsMonthly() const { return Flags & QUEST_TRINITY_FLAGS_MONTHLY; } bool IsSeasonal() const { return (ZoneOrSort == -QUEST_SORT_SEASONAL || ZoneOrSort == -QUEST_SORT_SPECIAL || ZoneOrSort == -QUEST_SORT_LUNAR_FESTIVAL || ZoneOrSort == -QUEST_SORT_MIDSUMMER || ZoneOrSort == -QUEST_SORT_BREWFEST || ZoneOrSort == -QUEST_SORT_LOVE_IS_IN_THE_AIR || ZoneOrSort == -QUEST_SORT_NOBLEGARDEN) && !IsRepeatable(); } bool IsDailyOrWeekly() const { return Flags & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY); } - bool IsRaidQuest() const { return Type == QUEST_TYPE_RAID || Type == QUEST_TYPE_RAID_10 || Type == QUEST_TYPE_RAID_25; } - bool IsAllowedInRaid() const; + bool IsRaidQuest(Difficulty difficulty) const; + bool IsAllowedInRaid(Difficulty difficulty) const; bool IsDFQuest() const { return Flags & QUEST_TRINITY_FLAGS_DF_QUEST; } uint32 CalculateHonorGain(uint8 level) const; -- cgit v1.2.3 From 6189eeb8e639aeff6e722c28174a041a1048c7d4 Mon Sep 17 00:00:00 2001 From: Trista Date: Mon, 24 Dec 2012 23:59:25 +0200 Subject: Core/Movement: Fix codestyle -7092e9350bbb8123de688be0bf5dd87d8196d34f --- src/server/game/Entities/Unit/Unit.cpp | 5 +---- src/server/game/Entities/Unit/Unit.h | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 2b956f028c7..320204ed892 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17325,7 +17325,6 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas else { Position pos = {x, y, z, orientation}; - SendTeleportPacket(pos); UpdatePosition(x, y, z, orientation, true); UpdateObjectVisibility(); @@ -17342,12 +17341,10 @@ void Unit::SendTeleportPacket(Position& pos) WorldPacket data2(MSG_MOVE_TELEPORT, 38); data2.append(GetPackGUID()); BuildMovementPacket(&data2); - if (GetTypeId() == TYPEID_UNIT) - Relocate(&oldPos); + Relocate(&oldPos); if (GetTypeId() == TYPEID_PLAYER) Relocate(&pos); - SendMessageToSet(&data2, true); } diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index e46fbb99a8c..f83a5409f6e 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1592,7 +1592,7 @@ class Unit : public WorldObject void SendSpellDamageImmune(Unit* target, uint32 spellId); void NearTeleportTo(float x, float y, float z, float orientation, bool casting = false); - void SendTeleportPacket(Position& oldPos); + void SendTeleportPacket(Position& pos); virtual bool UpdatePosition(float x, float y, float z, float ang, bool teleport = false); // returns true if unit's position really changed bool UpdatePosition(const Position &pos, bool teleport = false) { return UpdatePosition(pos.GetPositionX(), pos.GetPositionY(), pos.GetPositionZ(), pos.GetOrientation(), teleport); } -- cgit v1.2.3 From fa5f2b4c60a80bdf4b0eec09f44ca27f84b4590c Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 25 Dec 2012 02:51:40 +0100 Subject: Core: Fix non pch build --- src/server/game/Quests/QuestDef.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/server') diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 8b18872b016..7af2e079971 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -22,6 +22,7 @@ #include "Define.h" #include "DatabaseEnv.h" #include "SharedDefines.h" +#include "DBCEnums.h" #include #include -- cgit v1.2.3 From 6e921feebdecafc2e5855fbe63d1525f262a7daa Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Tue, 25 Dec 2012 02:56:19 +0100 Subject: Core: Fix some codestyle --- src/server/game/Entities/Unit/Unit.cpp | 5 ++--- src/server/game/Quests/QuestDef.h | 2 +- src/server/game/Spells/SpellInfo.cpp | 2 +- src/server/scripts/Northrend/dragonblight.cpp | 6 +++--- 4 files changed, 7 insertions(+), 8 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 320204ed892..1c2f03ec5b9 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17333,11 +17333,10 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas void Unit::SendTeleportPacket(Position& pos) { - Position oldPos = {GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation()}; + Position oldPos = { GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation() }; if (GetTypeId() == TYPEID_UNIT) - { Relocate(&pos); - } + WorldPacket data2(MSG_MOVE_TELEPORT, 38); data2.append(GetPackGUID()); BuildMovementPacket(&data2); diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 7af2e079971..3e8e91c9b6e 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -22,7 +22,7 @@ #include "Define.h" #include "DatabaseEnv.h" #include "SharedDefines.h" -#include "DBCEnums.h" +#include "DBCEnums.h" #include #include diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index 61b92ce6f81..dd367212f67 100644 --- a/src/server/game/Spells/SpellInfo.cpp +++ b/src/server/game/Spells/SpellInfo.cpp @@ -1546,7 +1546,7 @@ SpellCastResult SpellInfo::CheckTarget(Unit const* caster, WorldObject const* ta if (unitTarget->HasUnitState(UNIT_STATE_IN_FLIGHT)) return SPELL_FAILED_BAD_TARGETS; - /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to + /* TARGET_UNIT_MASTER gets blocked here for passengers, because the whole idea of this check is to not allow passengers to be implicitly hit by spells, however this target type should be an exception, if this is left it kills spells that award kill credit from vehicle to master (few spells), the use of these 2 covers passenger target check, logically, if vehicle cast this to master it should always hit diff --git a/src/server/scripts/Northrend/dragonblight.cpp b/src/server/scripts/Northrend/dragonblight.cpp index 698daba99e3..695a942721d 100644 --- a/src/server/scripts/Northrend/dragonblight.cpp +++ b/src/server/scripts/Northrend/dragonblight.cpp @@ -182,12 +182,12 @@ enum WyrmDefenderEnum // Quest data QUEST_DEFENDING_WYRMREST_TEMPLE = 12372, GOSSIP_TEXTID_DEF1 = 12899, - + // Gossip data GOSSIP_TEXTID_DEF2 = 12900, // Spells data - SPELL_CHARACTER_SCRIPT = 49213, + SPELL_CHARACTER_SCRIPT = 49213, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/ SPELL_RENEW = 49263, // casted to heal drakes SPELL_WYRMREST_DEFENDER_MOUNT = 49256, @@ -258,7 +258,7 @@ class npc_wyrmrest_defender : public CreatureScript me->CastSpell(me, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE); hpWarningReady = false; } - + if (renewRecoveryCanCheck) { if (RenewRecoveryChecker <= diff) -- cgit v1.2.3 From a8cd34c4a4613c968aa783f65a45af45965433e3 Mon Sep 17 00:00:00 2001 From: kaelima Date: Wed, 26 Dec 2012 04:02:42 +0100 Subject: Core/Battleground: Rename and correct usage of opcode 1223 and increase the timer before arena/bg invitation window is removed to its proper value. Closes #6725 --- src/server/game/Battlegrounds/Battleground.cpp | 6 +----- src/server/game/Battlegrounds/Battleground.h | 2 +- src/server/game/Entities/Object/Object.cpp | 13 +++++++++++++ src/server/game/Server/Protocol/Opcodes.cpp | 2 +- src/server/game/Server/Protocol/Opcodes.h | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Battlegrounds/Battleground.cpp b/src/server/game/Battlegrounds/Battleground.cpp index 22f960ceaef..1c426be3b4e 100644 --- a/src/server/game/Battlegrounds/Battleground.cpp +++ b/src/server/game/Battlegrounds/Battleground.cpp @@ -1183,10 +1183,6 @@ void Battleground::AddPlayer(Player* player) player->CastSpell(player, SPELL_ARENA_PREPARATION, true); player->ResetAllPowers(); } - - WorldPacket data(SMSG_ARENA_OPPONENT_UPDATE, 8); - data << uint64(player->GetGUID()); - SendPacketToTeam(team, &data, player, false); } else { @@ -1884,7 +1880,7 @@ int32 Battleground::GetObjectType(uint64 guid) return -1; } -void Battleground::HandleKillUnit(Creature* /*creature*/, Player* /*killer*/) +void Battleground::HandleKillUnit(Creature* /*victim*/, Player* /*killer*/) { } diff --git a/src/server/game/Battlegrounds/Battleground.h b/src/server/game/Battlegrounds/Battleground.h index 0a837f9f3c3..b58f321fe55 100644 --- a/src/server/game/Battlegrounds/Battleground.h +++ b/src/server/game/Battlegrounds/Battleground.h @@ -108,7 +108,7 @@ enum BattlegroundTimeIntervals RESURRECTION_INTERVAL = 30000, // ms //REMIND_INTERVAL = 10000, // ms INVITATION_REMIND_TIME = 20000, // ms - INVITE_ACCEPT_WAIT_TIME = 40000, // ms + INVITE_ACCEPT_WAIT_TIME = 60000, // ms TIME_TO_AUTOREMOVE = 120000, // ms MAX_OFFLINE_TIME = 300, // secs RESPAWN_ONE_DAY = 86400, // secs diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index d96cf58db52..313c6942902 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -302,6 +302,19 @@ void Object::DestroyForPlayer(Player* target, bool onDeath) const { ASSERT(target); + if (isType(TYPEMASK_UNIT) || isType(TYPEMASK_PLAYER)) + { + if (Battleground* bg = target->GetBattleground()) + { + if (bg->isArena()) + { + WorldPacket data(SMSG_ARENA_UNIT_DESTROYED, 8); + data << uint64(GetGUID()); + target->GetSession()->SendPacket(&data); + } + } + } + WorldPacket data(SMSG_DESTROY_OBJECT, 8 + 1); data << uint64(GetGUID()); //! If the following bool is true, the client will call "void CGUnit_C::OnDeath()" for this object. diff --git a/src/server/game/Server/Protocol/Opcodes.cpp b/src/server/game/Server/Protocol/Opcodes.cpp index 0821be2abb9..6492f3ee1f8 100644 --- a/src/server/game/Server/Protocol/Opcodes.cpp +++ b/src/server/game/Server/Protocol/Opcodes.cpp @@ -1249,7 +1249,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x4C4*/ { "CMSG_GM_GRANT_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x4C5*/ { "CMSG_GM_REMOVE_ACHIEVEMENT", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x4C6*/ { "CMSG_GM_SET_CRITERIA_FOR_PLAYER", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, - /*0x4C7*/ { "SMSG_ARENA_OPPONENT_UPDATE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, + /*0x4C7*/ { "SMSG_ARENA_UNIT_DESTROYED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4C8*/ { "SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, /*0x4C9*/ { "CMSG_PROFILEDATA_REQUEST", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_NULL }, /*0x4CA*/ { "SMSG_PROFILEDATA_RESPONSE", STATUS_NEVER, PROCESS_INPLACE, &WorldSession::Handle_ServerSide }, diff --git a/src/server/game/Server/Protocol/Opcodes.h b/src/server/game/Server/Protocol/Opcodes.h index 625ee88a853..f7a73a20d6e 100644 --- a/src/server/game/Server/Protocol/Opcodes.h +++ b/src/server/game/Server/Protocol/Opcodes.h @@ -1257,7 +1257,7 @@ enum Opcodes CMSG_GM_GRANT_ACHIEVEMENT = 0x4C4, CMSG_GM_REMOVE_ACHIEVEMENT = 0x4C5, CMSG_GM_SET_CRITERIA_FOR_PLAYER = 0x4C6, - SMSG_ARENA_OPPONENT_UPDATE = 0x4C7, // uint64 + SMSG_ARENA_UNIT_DESTROYED = 0x4C7, SMSG_ARENA_TEAM_CHANGE_FAILED_QUEUED = 0x4C8, // uint32 "Can't modify arena team while queued or in a match." CMSG_PROFILEDATA_REQUEST = 0x4C9, SMSG_PROFILEDATA_RESPONSE = 0x4CA, -- cgit v1.2.3 From 30936fd1c49fd72d9d9e4180cd610864c14ab01a Mon Sep 17 00:00:00 2001 From: MidnaAT Date: Wed, 26 Dec 2012 04:34:40 +0100 Subject: Core/Totem: Have Lightwell use Totem logic ref www.trinitycore.org/f/topic/7599-propper-lightwell-handling/ --- src/server/game/DataStores/DBCEnums.h | 18 ------------------ src/server/game/Entities/Object/Object.cpp | 1 + src/server/game/Miscellaneous/SharedDefines.h | 7 ++++--- src/server/game/Spells/SpellEffects.cpp | 1 + 4 files changed, 6 insertions(+), 21 deletions(-) (limited to 'src/server') diff --git a/src/server/game/DataStores/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index fa6b5f0695f..cdc1c790844 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -365,24 +365,6 @@ enum SummonPropGroup SUMMON_PROP_GROUP_UNKNOWN3 = 4 // 86 spells in 3.0.3, taxi/mounts }; -// SummonProperties.dbc, col 3 -enum SummonPropType -{ - SUMMON_PROP_TYPE_UNKNOWN = 0, // different summons, 1330 spells in 3.0.3 - SUMMON_PROP_TYPE_SUMMON = 1, // generic summons, 49 spells in 3.0.3 - SUMMON_PROP_TYPE_GUARDIAN = 2, // summon guardian, 393 spells in 3.0.3 - SUMMON_PROP_TYPE_ARMY = 3, // summon army, 5 spells in 3.0.3 - SUMMON_PROP_TYPE_TOTEM = 4, // summon totem, 169 spells in 3.0.3 - SUMMON_PROP_TYPE_CRITTER = 5, // critter/minipet, 195 spells in 3.0.3 - SUMMON_PROP_TYPE_DK = 6, // summon DRW/Ghoul, 2 spells in 3.0.3 - SUMMON_PROP_TYPE_BOMB = 7, // summon bot/bomb, 4 spells in 3.0.3 - SUMMON_PROP_TYPE_PHASING = 8, // something todo with DK prequest line, 2 spells in 3.0.3 - SUMMON_PROP_TYPE_SIEGE_VEH = 9, // summon different vehicles, 14 spells in 3.0.3 - SUMMON_PROP_TYPE_DRAKE_VEH = 10, // summon drake (vehicle), 3 spells - SUMMON_PROP_TYPE_LIGHTWELL = 11, // summon lightwell, 6 spells in 3.0.3 - SUMMON_PROP_TYPE_JEEVES = 12 // summon Jeeves, 1 spell in 3.3.5a -}; - // SummonProperties.dbc, col 5 enum SummonPropFlags { diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index 313c6942902..705360ec32a 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -2267,6 +2267,7 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonPropert mask = UNIT_MASK_GUARDIAN; break; case SUMMON_TYPE_TOTEM: + case SUMMON_TYPE_LIGHTWELL: mask = UNIT_MASK_TOTEM; break; case SUMMON_TYPE_VEHICLE: diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index e3cf975e92f..0113e8b4f1f 100644 --- a/src/server/game/Miscellaneous/SharedDefines.h +++ b/src/server/game/Miscellaneous/SharedDefines.h @@ -3146,10 +3146,11 @@ enum SummonType SUMMON_TYPE_MINIPET = 5, SUMMON_TYPE_GUARDIAN2 = 6, SUMMON_TYPE_WILD2 = 7, - SUMMON_TYPE_WILD3 = 8, + SUMMON_TYPE_WILD3 = 8, // Related to phases and DK prequest line (3.3.5a) SUMMON_TYPE_VEHICLE = 9, - SUMMON_TYPE_VEHICLE2 = 10, - SUMMON_TYPE_OBJECT = 11 + SUMMON_TYPE_VEHICLE2 = 10, // Oculus and Argent Tournament vehicles (3.3.5a) + SUMMON_TYPE_LIGHTWELL = 11, + SUMMON_TYPE_JEEVES = 12 }; enum EventId diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp index a642d40c24d..6ac8f9b5f7d 100644 --- a/src/server/game/Spells/SpellEffects.cpp +++ b/src/server/game/Spells/SpellEffects.cpp @@ -2354,6 +2354,7 @@ void Spell::EffectSummonType(SpellEffIndex effIndex) case SUMMON_TYPE_VEHICLE2: summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); break; + case SUMMON_TYPE_LIGHTWELL: case SUMMON_TYPE_TOTEM: { summon = m_caster->GetMap()->SummonCreature(entry, *destTarget, properties, duration, m_originalCaster, m_spellInfo->Id); -- cgit v1.2.3 From 30e2ab8e0faac96548fc681b608a0f96f77985a1 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Wed, 26 Dec 2012 11:52:05 -0330 Subject: DB/SCRIPTS: Fix text for High Botanist Freywinn and remove creature_ai_texts. --- sql/updates/world/2012_12_26_01_world_creature_text.sql | 14 ++++++++++++++ .../TempestKeep/botanica/boss_high_botanist_freywinn.cpp | 4 +++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_12_26_01_world_creature_text.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_12_26_01_world_creature_text.sql b/sql/updates/world/2012_12_26_01_world_creature_text.sql new file mode 100644 index 00000000000..ae4170ae5a8 --- /dev/null +++ b/sql/updates/world/2012_12_26_01_world_creature_text.sql @@ -0,0 +1,14 @@ +-- NPC talk text convert from creature_ai_text +DELETE FROM `creature_ai_texts` WHERE entry BETWEEN -21 AND -17; +DELETE FROM `creature_text` WHERE `entry` IN (17975); +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES +(17975,0,0, 'What are you doing? These specimens are very delicate!',14,0,100,0,0,11144, 'High Botanist Freywinn - Aggro Say'), +(17975,1,0, 'Your lifecycle is now concluded!',14,0,100,0,0,11145, 'High Botanist Freywinn - Kill Plant as Bloodelf Say'), +(17975,1,1, 'You will feed the worms.',14,0,100,0,0,11146, 'High Botanist Freywinn - Shapeshifting Say'), +(17975,2,0, 'Endorel aluminor!',14,0,100,0,0,11147, 'High Botanist Freywinn - Shapeshifting Say'), +(17975,3,0, 'Nature bends to my will!',14,0,100,0,0,11148, 'High Botanist Freywinn - Summoning Plants Say'), +(17975,4,0, 'The specimens... must be... preserved.',14,0,100,0,0,11149, 'High Botanist Freywinn - Death Say'), +(17975,5,0, '...thorny vines...mumble...ouch!',12,0,100,0,0,0, 'High Botanist Freywinn - OOC Random Say'), +(17975,5,1, '...mumble mumble...',12,0,100,0,0,0, 'High Botanist Freywinn - OOC Random Say'), +(17975,5,2, '...mumble...Petals of Fire...mumble...',12,0,100,0,0,0, 'High Botanist Freywinn - OOC Random Say'), +(17975,5,3, '...with the right mixture, perhaps...',12,0,100,0,0,0, 'High Botanist Freywinn - OOC Random Say'); diff --git a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp index 4288061860e..53277afdc54 100644 --- a/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp +++ b/src/server/scripts/Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp @@ -31,7 +31,9 @@ enum eSays SAY_AGGRO = 0, SAY_KILL = 1, SAY_TREE = 2, - SAY_DEATH = 3 + SAY_SUMMON = 3, + SAY_DEATH = 4, + SAY_OOC_RANDOM = 5, }; enum eSpells -- cgit v1.2.3 From 81d53f8a87167427abc4e1645d9dac2fea3a834b Mon Sep 17 00:00:00 2001 From: Subv Date: Wed, 26 Dec 2012 13:36:07 -0500 Subject: Scripts/Ick&Krick: Krick should only say his KilledUnit text when the victim is a player. --- .../scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/server') diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index ed196d2cd0c..abb633cee5c 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -322,7 +322,7 @@ class boss_krick : public CreatureScript void KilledUnit(Unit* victim) { - if (victim == me) + if (victim->GetTypeId() != TYPEID_PLAYER) return; Talk(SAY_KRICK_SLAY); -- cgit v1.2.3 From 7b9b67a3b3bb88566b15abab4d47c2c64717f548 Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Wed, 26 Dec 2012 23:19:37 +0100 Subject: Core/Quest: Drop table quest_end_scripts --- .../2012_12_26_12_world_quest_end_scripts.sql | 4 ++++ src/server/game/Entities/Player/Player.cpp | 3 --- src/server/game/Globals/ObjectMgr.cpp | 20 ++------------------ src/server/game/Globals/ObjectMgr.h | 2 -- src/server/game/Quests/QuestDef.cpp | 4 +--- src/server/game/Quests/QuestDef.h | 2 -- src/server/game/World/World.cpp | 1 - src/server/scripts/Commands/cs_reload.cpp | 22 ---------------------- 8 files changed, 7 insertions(+), 51 deletions(-) create mode 100644 sql/updates/world/2012_12_26_12_world_quest_end_scripts.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_12_26_12_world_quest_end_scripts.sql b/sql/updates/world/2012_12_26_12_world_quest_end_scripts.sql new file mode 100644 index 00000000000..501bb796557 --- /dev/null +++ b/sql/updates/world/2012_12_26_12_world_quest_end_scripts.sql @@ -0,0 +1,4 @@ +ALTER TABLE `quest_template` DROP `CompleteScript`; +DROP TABLE quest_end_scripts; + +DELETE FROM `command` WHERE `name`='reload quest_end_scripts'; diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index f85a251f010..3b20d5664a1 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -16430,9 +16430,6 @@ void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) data << uint32(quest->GetBonusTalents()); // bonus talents data << uint32(quest->GetRewArenaPoints()); GetSession()->SendPacket(&data); - - if (quest->GetQuestCompleteScript() != 0) - GetMap()->ScriptsStart(sQuestEndScripts, quest->GetQuestCompleteScript(), questGiver, this); } void Player::SendQuestFailed(uint32 questId, InventoryResult reason) diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 70ac4aec4aa..fcde96079e1 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -49,7 +49,6 @@ #include "WaypointManager.h" #include "World.h" -ScriptMapMap sQuestEndScripts; ScriptMapMap sSpellScripts; ScriptMapMap sGameObjectScripts; ScriptMapMap sEventScripts; @@ -60,7 +59,6 @@ std::string GetScriptsTableNameByType(ScriptsType type) std::string res = ""; switch (type) { - case SCRIPTS_QUEST_END: res = "quest_end_scripts"; break; case SCRIPTS_SPELL: res = "spell_scripts"; break; case SCRIPTS_GAMEOBJECT: res = "gameobject_scripts"; break; case SCRIPTS_EVENT: res = "event_scripts"; break; @@ -75,7 +73,6 @@ ScriptMapMap* GetScriptsMapByType(ScriptsType type) ScriptMapMap* res = NULL; switch (type) { - case SCRIPTS_QUEST_END: res = &sQuestEndScripts; break; case SCRIPTS_SPELL: res = &sSpellScripts; break; case SCRIPTS_GAMEOBJECT: res = &sGameObjectScripts; break; case SCRIPTS_EVENT: res = &sEventScripts; break; @@ -3658,13 +3655,12 @@ void ObjectMgr::LoadQuests() "DetailsEmote1, DetailsEmote2, DetailsEmote3, DetailsEmote4, DetailsEmoteDelay1, DetailsEmoteDelay2, DetailsEmoteDelay3, DetailsEmoteDelay4, EmoteOnIncomplete, EmoteOnComplete, " // 136 137 138 139 140 141 142 143 "OfferRewardEmote1, OfferRewardEmote2, OfferRewardEmote3, OfferRewardEmote4, OfferRewardEmoteDelay1, OfferRewardEmoteDelay2, OfferRewardEmoteDelay3, OfferRewardEmoteDelay4, " - // 144 145 - "CompleteScript, WDBVerified" + // 144 + "WDBVerified" " FROM quest_template"); if (!result) { sLog->outError(LOG_FILTER_SQL, ">> Loaded 0 quests definitions. DB table `quest_template` is empty."); - return; } @@ -4683,18 +4679,6 @@ void ObjectMgr::LoadGameObjectScripts() } } -void ObjectMgr::LoadQuestEndScripts() -{ - LoadScripts(SCRIPTS_QUEST_END); - - // check ids - for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr) - { - if (!GetQuestTemplate(itr->first)) - sLog->outError(LOG_FILTER_SQL, "Table `quest_end_scripts` has not existing quest (Id: %u) as script id", itr->first); - } -} - void ObjectMgr::LoadSpellScripts() { LoadScripts(SCRIPTS_SPELL); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index e1df03b97b0..9419fd2b7ba 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -361,7 +361,6 @@ typedef std::multimap ScriptMap; typedef std::map ScriptMapMap; typedef std::multimap SpellScriptsContainer; typedef std::pair SpellScriptsBounds; -extern ScriptMapMap sQuestEndScripts; extern ScriptMapMap sSpellScripts; extern ScriptMapMap sGameObjectScripts; extern ScriptMapMap sEventScripts; @@ -864,7 +863,6 @@ class ObjectMgr } void LoadGameObjectScripts(); - void LoadQuestEndScripts(); void LoadEventScripts(); void LoadSpellScripts(); void LoadWaypointScripts(); diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index a918a19334f..9e9bcffd871 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -140,9 +140,7 @@ Quest::Quest(Field* questRecord) for (int i = 0; i < QUEST_EMOTE_COUNT; ++i) OfferRewardEmoteDelay[i] = questRecord[140+i].GetInt32(); - CompleteScript = questRecord[144].GetUInt32(); - - // int32 WDBVerified = questRecord[145].GetInt32(); + //int32 WDBVerified = questRecord[144].GetInt32(); Flags |= SpecialFlags << 20; if (Flags & QUEST_TRINITY_FLAGS_AUTO_ACCEPT) diff --git a/src/server/game/Quests/QuestDef.h b/src/server/game/Quests/QuestDef.h index 3e8e91c9b6e..d02e4c511b1 100644 --- a/src/server/game/Quests/QuestDef.h +++ b/src/server/game/Quests/QuestDef.h @@ -245,7 +245,6 @@ class Quest uint32 GetPointOpt() const { return PointOption; } uint32 GetIncompleteEmote() const { return EmoteOnIncomplete; } uint32 GetCompleteEmote() const { return EmoteOnComplete; } - uint32 GetQuestCompleteScript() const { return CompleteScript; } bool IsRepeatable() const { return Flags & QUEST_TRINITY_FLAGS_REPEATABLE; } bool IsAutoAccept() const; bool IsAutoComplete() const; @@ -355,7 +354,6 @@ class Quest uint32 PointOption; uint32 EmoteOnIncomplete; uint32 EmoteOnComplete; - uint32 CompleteScript; }; struct QuestStatusData diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 7824a72c4d3..3a38ad6b383 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1647,7 +1647,6 @@ void World::SetInitialWorldSettings() LoadAutobroadcasts(); ///- Load and initialize scripts - sObjectMgr->LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr->LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data) sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data) diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 5b5608f9a26..f62a6f059b7 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -126,7 +126,6 @@ public: { "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL}, { "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL }, { "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL }, - { "quest_end_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestEndScriptsCommand, "", NULL }, { "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL }, { "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL }, { "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL }, @@ -263,7 +262,6 @@ public: sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts..."); HandleReloadGameObjectScriptsCommand(handler, "a"); HandleReloadEventScriptsCommand(handler, "a"); - HandleReloadQuestEndScriptsCommand(handler, "a"); HandleReloadSpellScriptsCommand(handler, "a"); handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded."); HandleReloadDbScriptStringCommand(handler, "a"); @@ -1043,26 +1041,6 @@ public: return true; } - static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args) - { - if (sScriptMgr->IsScriptScheduled()) - { - handler->SendSysMessage("DB scripts used currently, please attempt reload later."); - handler->SetSentErrorMessage(true); - return false; - } - - if (*args != 'a') - sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `quest_end_scripts`..."); - - sObjectMgr->LoadQuestEndScripts(); - - if (*args != 'a') - handler->SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded."); - - return true; - } - static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args) { if (sScriptMgr->IsScriptScheduled()) -- cgit v1.2.3 From ece2f7c7ab30fbdbe52be7ce510e09437e2643ee Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Wed, 26 Dec 2012 23:23:49 +0100 Subject: Add missing changes in 7b9b67a3b3bb88566b15abab4d47c2c64717f548 (fucking save button) --- src/server/game/Globals/ObjectMgr.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index 9419fd2b7ba..84597d37722 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -127,8 +127,7 @@ enum ScriptsType { SCRIPTS_FIRST = 1, - SCRIPTS_QUEST_END = SCRIPTS_FIRST, - SCRIPTS_SPELL, + SCRIPTS_SPELL = SCRIPTS_FIRST, SCRIPTS_GAMEOBJECT, SCRIPTS_EVENT, SCRIPTS_WAYPOINT, -- cgit v1.2.3 From 452e585f7b4b2bc349d7386b0c42cf296f0ab4c2 Mon Sep 17 00:00:00 2001 From: Trista Date: Thu, 27 Dec 2012 01:28:23 +0200 Subject: Core/Vehicles: Fixed seat id for auras with SPELL_AURA_CONTROL_VEHICLE. Also always allow npc passengers to cast spells and remove TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE hacks. * Author: Horn. Please give feedback, I tested a lot stuff, but it will be appreciated. * One of the fixes allow all creatures to cast when being passangers, researched, this doesn't involve players. * This basically rewrittes vehicle seat formula calculated, so it fix quite stuff that will not be visible and some eye candies: #3831 and #1984 Heart part ;) (which magically fix a lot more of it and some quests), also Yog-Sarron mechanics --- src/server/game/Entities/Unit/Unit.cpp | 4 ++-- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 3 ++- src/server/game/Spells/Spell.cpp | 3 ++- .../scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 1c2f03ec5b9..62df8c2049c 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -17064,7 +17064,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) } if (IsInMap(caster)) - caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId+1, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID); + caster->CastCustomSpell(itr->second.spellId, SpellValueMod(SPELLVALUE_BASE_POINT0+i), seatId, target, GetVehicleKit() ? TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE : TRIGGERED_NONE, NULL, NULL, origCasterGUID); else // This can happen during Player::_LoadAuras { int32 bp0 = seatId; @@ -17094,7 +17094,7 @@ bool Unit::HandleSpellClick(Unit* clicker, int8 seatId) void Unit::EnterVehicle(Unit* base, int8 seatId) { - CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId+1, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + CastCustomSpell(VEHICLE_SPELL_RIDE_HARDCODED, SPELLVALUE_BASE_POINT0, seatId, base, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); } void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* aurApp) diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 260091c9ed7..745a7baab8f 100644 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3199,7 +3199,8 @@ void AuraEffect::HandleAuraControlVehicle(AuraApplication const* aurApp, uint8 m if (apply) { - caster->_EnterVehicle(target->GetVehicleKit(), m_amount - 1, aurApp); + // correct amount is already calculated adding one more -1 meant calculated amount - 1 + caster->_EnterVehicle(target->GetVehicleKit(), m_amount, aurApp); } else { diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 3cee51949bc..1ca04747101 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -4853,9 +4853,10 @@ SpellCastResult Spell::CheckCast(bool strict) if (!checkMask) checkMask = VEHICLE_SEAT_FLAG_CAN_ATTACK; + // All creatures should be able to cast as passengers freely, restriction and attribute are only for players VehicleSeatEntry const* vehicleSeat = vehicle->GetSeatForPassenger(m_caster); if (!(m_spellInfo->AttributesEx6 & SPELL_ATTR6_CASTABLE_WHILE_ON_VEHICLE) && !(m_spellInfo->Attributes & SPELL_ATTR0_CASTABLE_WHILE_MOUNTED) - && (vehicleSeat->m_flags & checkMask) != checkMask) + && (vehicleSeat->m_flags & checkMask) != checkMask && m_caster->GetTypeId() == TYPEID_PLAYER) return SPELL_FAILED_DONT_REPORT; } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index abb633cee5c..f94b028bfaf 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -226,13 +226,13 @@ class boss_ick : public CreatureScript case EVENT_TOXIC_WASTE: if (Creature* krick = GetKrick()) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0)) - krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + krick->CastSpell(target, SPELL_TOXIC_WASTE); events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000)); break; case EVENT_SHADOW_BOLT: if (Creature* krick = GetKrick()) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) - krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE); + krick->CastSpell(target, SPELL_SHADOW_BOLT); events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000); return; case EVENT_MIGHTY_KICK: -- cgit v1.2.3 From e48bbac93fa8cb0740218261646d9421ec6ce69c Mon Sep 17 00:00:00 2001 From: Vincent_Michael Date: Thu, 27 Dec 2012 01:42:25 +0100 Subject: Core: Fix warning in 7b9b67a3b3bb88566b15abab4d47c2c64717f548 --- src/server/game/Entities/Player/Player.cpp | 4 ++-- src/server/game/Entities/Player/Player.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 3b20d5664a1..3607e8a9ec3 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -15226,7 +15226,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver, _SaveQuestStatus(trans); if (announce) - SendQuestReward(quest, XP, questGiver); + SendQuestReward(quest, XP); // cast spells after mark quest complete (some spells have quest completed state requirements in spell_area data) if (quest->GetRewSpellCast() > 0) @@ -16407,7 +16407,7 @@ void Player::SendQuestComplete(uint32 quest_id) } } -void Player::SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver) +void Player::SendQuestReward(Quest const* quest, uint32 XP) { uint32 questid = quest->GetQuestId(); sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Sent SMSG_QUESTGIVER_QUEST_COMPLETE quest = %u", questid); diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 8fc13e1dda9..522fe529b41 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1479,7 +1479,7 @@ class Player : public Unit, public GridObject bool CanShareQuest(uint32 quest_id) const; void SendQuestComplete(uint32 quest_id); - void SendQuestReward(Quest const* quest, uint32 XP, Object* questGiver); + void SendQuestReward(Quest const* quest, uint32 XP); void SendQuestFailed(uint32 questId, InventoryResult reason = EQUIP_ERR_OK); void SendQuestTimerFailed(uint32 quest_id); void SendCanTakeQuestResponse(uint32 msg) const; -- cgit v1.2.3 From 3288d7024a3ddd604d80322ba87f6f6bdf6b30d4 Mon Sep 17 00:00:00 2001 From: joschiwald Date: Thu, 27 Dec 2012 06:04:45 +0100 Subject: Core/Spells: fix possible crash when loading `spell_proc` table --- src/server/game/Spells/SpellMgr.cpp | 64 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 33 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp index d166c6f9ebf..9714e2bc09b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -1836,14 +1836,14 @@ void SpellMgr::LoadSpellProcs() int32 spellId = fields[0].GetInt32(); bool allRanks = false; - if (spellId <=0) + if (spellId < 0) { allRanks = true; spellId = -spellId; } - SpellInfo const* spellEntry = GetSpellInfo(spellId); - if (!spellEntry) + SpellInfo const* spellInfo = GetSpellInfo(spellId); + if (!spellInfo) { sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` does not exist", spellId); continue; @@ -1851,9 +1851,9 @@ void SpellMgr::LoadSpellProcs() if (allRanks) { - if (GetFirstSpellInChain(spellId) != uint32(spellId)) + if (spellInfo->GetFirstRankSpell()->Id != uint32(spellId)) { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", fields[0].GetInt32()); + sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` is not first rank of spell.", spellId); continue; } } @@ -1876,79 +1876,77 @@ void SpellMgr::LoadSpellProcs() baseProcEntry.cooldown = uint32(cooldown); baseProcEntry.charges = fields[14].GetUInt32(); - while (true) + while (spellInfo) { - if (mSpellProcMap.find(spellId) != mSpellProcMap.end()) + if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) { - sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellId); + sLog->outError(LOG_FILTER_SQL, "Spell %u listed in `spell_proc` has duplicate entry in the table", spellInfo->Id); break; } SpellProcEntry procEntry = SpellProcEntry(baseProcEntry); // take defaults from dbcs if (!procEntry.typeMask) - procEntry.typeMask = spellEntry->ProcFlags; + procEntry.typeMask = spellInfo->ProcFlags; if (!procEntry.charges) - procEntry.charges = spellEntry->ProcCharges; + procEntry.charges = spellInfo->ProcCharges; if (!procEntry.chance && !procEntry.ratePerMinute) - procEntry.chance = float(spellEntry->ProcChance); + procEntry.chance = float(spellInfo->ProcChance); // validate data if (procEntry.schoolMask & ~SPELL_SCHOOL_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellId, procEntry.schoolMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `schoolMask` set: %u", spellInfo->Id, procEntry.schoolMask); if (procEntry.spellFamilyName && (procEntry.spellFamilyName < 3 || procEntry.spellFamilyName > 17 || procEntry.spellFamilyName == 14 || procEntry.spellFamilyName == 16)) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellId, procEntry.spellFamilyName); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellFamilyName` set: %u", spellInfo->Id, procEntry.spellFamilyName); if (procEntry.chance < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `chance` field", spellInfo->Id); procEntry.chance = 0; } if (procEntry.ratePerMinute < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `ratePerMinute` field", spellInfo->Id); procEntry.ratePerMinute = 0; } if (cooldown < 0) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has negative value in `cooldown` field", spellInfo->Id); procEntry.cooldown = 0; } if (procEntry.chance == 0 && procEntry.ratePerMinute == 0) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `chance` and `ratePerMinute` values defined, proc will not be triggered", spellInfo->Id); if (procEntry.charges > 99) { - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has too big value in `charges` field", spellInfo->Id); procEntry.charges = 99; } if (!procEntry.typeMask) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellId); - if (procEntry.spellTypeMask & ~PROC_SPELL_PHASE_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellId, procEntry.spellTypeMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `typeMask` value defined, proc will not be triggered", spellInfo->Id); + if (procEntry.spellTypeMask & ~PROC_SPELL_TYPE_MASK_ALL) + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellTypeMask` set: %u", spellInfo->Id, procEntry.spellTypeMask); if (procEntry.spellTypeMask && !(procEntry.typeMask & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellTypeMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id); if (!procEntry.spellPhaseMask && procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u doesn't have `spellPhaseMask` value defined, but it's required for defined `typeMask` value, proc will not be triggered", spellInfo->Id); if (procEntry.spellPhaseMask & ~PROC_SPELL_PHASE_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellId, procEntry.spellPhaseMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `spellPhaseMask` set: %u", spellInfo->Id, procEntry.spellPhaseMask); if (procEntry.spellPhaseMask && !(procEntry.typeMask & REQ_SPELL_PHASE_PROC_FLAG_MASK)) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `spellPhaseMask` value defined, but it won't be used for defined `typeMask` value", spellInfo->Id); if (procEntry.hitMask & ~PROC_HIT_MASK_ALL) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellId, procEntry.hitMask); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has wrong `hitMask` set: %u", spellInfo->Id, procEntry.hitMask); if (procEntry.hitMask && !(procEntry.typeMask & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.typeMask & DONE_HIT_PROC_FLAG_MASK && (!procEntry.spellPhaseMask || procEntry.spellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH))))) - sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellId); + sLog->outError(LOG_FILTER_SQL, "`spell_proc` table entry for spellId %u has `hitMask` value defined, but it won't be used for defined `typeMask` and `spellPhaseMask` values", spellInfo->Id); - mSpellProcMap[spellId] = procEntry; + mSpellProcMap[spellInfo->Id] = procEntry; if (allRanks) - { - spellId = GetNextSpellInChain(spellId); - spellEntry = GetSpellInfo(spellId); - } + spellInfo = spellInfo->GetNextRankSpell(); else break; } ++count; - } while (result->NextRow()); + } + while (result->NextRow()); sLog->outInfo(LOG_FILTER_SERVER_LOADING, ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -- cgit v1.2.3 From b19563fb6af74d7b9f915bdcf2fa5ec15e87e327 Mon Sep 17 00:00:00 2001 From: AliveShiro Date: Thu, 27 Dec 2012 12:12:27 +0100 Subject: Scripts/Trial of the Crusader: Fix Icehowl Script closes #8539 --- .../CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/server') diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp index 2d09feef089..b0edbf214e8 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -1006,7 +1006,7 @@ class boss_icehowl : public CreatureScript events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); return; case EVENT_MASSIVE_CRASH: - me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f); // 1: Middle of the room + me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f, 0); // 1: Middle of the room SetCombatMovement(false); me->AttackStop(); _stage = 7; //Invalid (Do nothing more than move) @@ -1059,7 +1059,7 @@ class boss_icehowl : public CreatureScript _trampleTargetY = target->GetPositionY(); _trampleTargetZ = target->GetPositionZ(); // 2: Hop Backwards - me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f); + me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f, 0); _stage = 7; //Invalid (Do nothing more than move) } else -- cgit v1.2.3 From b530602b96974c2a536f9e757739e207bf034fd7 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 27 Dec 2012 14:29:05 +0000 Subject: DB/Schema: Rename locales_quest.entry to locales_quest.Id for consistency with quest_template table --- sql/updates/world/2012_12_27_01_world_locales_quest.sql | 1 + src/server/game/Globals/ObjectMgr.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 sql/updates/world/2012_12_27_01_world_locales_quest.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_12_27_01_world_locales_quest.sql b/sql/updates/world/2012_12_27_01_world_locales_quest.sql new file mode 100644 index 00000000000..047f8bb499f --- /dev/null +++ b/sql/updates/world/2012_12_27_01_world_locales_quest.sql @@ -0,0 +1 @@ +ALTER TABLE `locales_quest` CHANGE `entry` `Id` mediumint(8) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index fcde96079e1..5865ef67a78 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -4306,7 +4306,7 @@ void ObjectMgr::LoadQuestLocales() _questLocaleStore.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, " + QueryResult result = WorldDatabase.Query("SELECT Id, " "Title_loc1, Details_loc1, Objectives_loc1, OfferRewardText_loc1, RequestItemsText_loc1, EndText_loc1, CompletedText_loc1, ObjectiveText1_loc1, ObjectiveText2_loc1, ObjectiveText3_loc1, ObjectiveText4_loc1, " "Title_loc2, Details_loc2, Objectives_loc2, OfferRewardText_loc2, RequestItemsText_loc2, EndText_loc2, CompletedText_loc2, ObjectiveText1_loc2, ObjectiveText2_loc2, ObjectiveText3_loc2, ObjectiveText4_loc2, " "Title_loc3, Details_loc3, Objectives_loc3, OfferRewardText_loc3, RequestItemsText_loc3, EndText_loc3, CompletedText_loc3, ObjectiveText1_loc3, ObjectiveText2_loc3, ObjectiveText3_loc3, ObjectiveText4_loc3, " -- cgit v1.2.3 From 7fe2d7309ae3b850f3a7c75fc9bb6ec18bea00a1 Mon Sep 17 00:00:00 2001 From: Nay Date: Thu, 27 Dec 2012 16:42:05 +0000 Subject: DB/Schema: Rename and change types of a few fields in locales_creature_text and locales_npc_text locales_creature_text.textGroup -> locales_creature_text.groupid locales_npc_text.entry -> locales_npc_text.ID --- sql/updates/world/2012_12_27_02_world_locales.sql | 4 ++++ src/server/game/Globals/ObjectMgr.cpp | 2 +- src/server/game/Texts/CreatureTextMgr.cpp | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 sql/updates/world/2012_12_27_02_world_locales.sql (limited to 'src/server') diff --git a/sql/updates/world/2012_12_27_02_world_locales.sql b/sql/updates/world/2012_12_27_02_world_locales.sql new file mode 100644 index 00000000000..5caeb009447 --- /dev/null +++ b/sql/updates/world/2012_12_27_02_world_locales.sql @@ -0,0 +1,4 @@ +ALTER TABLE `locales_creature_text` CHANGE `entry` `entry` mediumint(8) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `locales_creature_text` CHANGE `textGroup` `groupid` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `locales_creature_text` CHANGE `id` `id` tinyint(3) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE `locales_npc_text` CHANGE `entry` `ID` mediumint(8) unsigned NOT NULL DEFAULT '0'; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 5865ef67a78..be365202cdc 100644 --- a/src/server/game/Globals/ObjectMgr.cpp +++ b/src/server/game/Globals/ObjectMgr.cpp @@ -5161,7 +5161,7 @@ void ObjectMgr::LoadNpcTextLocales() _npcTextLocaleStore.clear(); // need for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, " + QueryResult result = WorldDatabase.Query("SELECT ID, " "Text0_0_loc1, Text0_1_loc1, Text1_0_loc1, Text1_1_loc1, Text2_0_loc1, Text2_1_loc1, Text3_0_loc1, Text3_1_loc1, Text4_0_loc1, Text4_1_loc1, Text5_0_loc1, Text5_1_loc1, Text6_0_loc1, Text6_1_loc1, Text7_0_loc1, Text7_1_loc1, " "Text0_0_loc2, Text0_1_loc2, Text1_0_loc2, Text1_1_loc2, Text2_0_loc2, Text2_1_loc2, Text3_0_loc2, Text3_1_loc1, Text4_0_loc2, Text4_1_loc2, Text5_0_loc2, Text5_1_loc2, Text6_0_loc2, Text6_1_loc2, Text7_0_loc2, Text7_1_loc2, " "Text0_0_loc3, Text0_1_loc3, Text1_0_loc3, Text1_1_loc3, Text2_0_loc3, Text2_1_loc3, Text3_0_loc3, Text3_1_loc1, Text4_0_loc3, Text4_1_loc3, Text5_0_loc3, Text5_1_loc3, Text6_0_loc3, Text6_1_loc3, Text7_0_loc3, Text7_1_loc3, " diff --git a/src/server/game/Texts/CreatureTextMgr.cpp b/src/server/game/Texts/CreatureTextMgr.cpp index 89b75fd1695..fac64455b9d 100644 --- a/src/server/game/Texts/CreatureTextMgr.cpp +++ b/src/server/game/Texts/CreatureTextMgr.cpp @@ -187,7 +187,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() mLocaleTextMap.clear(); // for reload case - QueryResult result = WorldDatabase.Query("SELECT entry, textGroup, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text"); + QueryResult result = WorldDatabase.Query("SELECT entry, groupid, id, text_loc1, text_loc2, text_loc3, text_loc4, text_loc5, text_loc6, text_loc7, text_loc8 FROM locales_creature_text"); if (!result) return; @@ -197,7 +197,7 @@ void CreatureTextMgr::LoadCreatureTextLocales() do { Field* fields = result->Fetch(); - CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), fields[2].GetUInt32())]; + CreatureTextLocale& loc = mLocaleTextMap[CreatureTextId(fields[0].GetUInt32(), uint32(fields[1].GetUInt8()), uint32(fields[2].GetUInt8()))]; for (uint8 i = 1; i < TOTAL_LOCALES; ++i) { LocaleConstant locale = LocaleConstant(i); -- cgit v1.2.3