From 4f53c4ee284a9efc38b2fadf99da76e606b5f56d Mon Sep 17 00:00:00 2001 From: XTZGZoReX Date: Fri, 17 Jul 2009 19:25:26 +0400 Subject: [PATCH 01/34] [8193] Use constant instead explicit value in title index checks. Signed-off-by: VladimirMangos --- src/game/MiscHandler.cpp | 2 +- src/game/Player.cpp | 2 +- src/game/Player.h | 2 ++ src/shared/revision_nr.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 427f5d65c..b0fc08da2 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1426,7 +1426,7 @@ void WorldSession::HandleSetTitleOpcode( WorldPacket & recv_data ) recv_data >> title; // -1 at none - if(title > 0 && title < 192) + if(title > 0 && title < MAX_TITLE_INDEX) { if(!GetPlayer()->HasTitle(title)) return; diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 041d9def2..5ab16b0a8 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19504,7 +19504,7 @@ bool Player::isTotalImmune() bool Player::HasTitle(uint32 bitIndex) { - if (bitIndex > 192) + if (bitIndex > MAX_TITLE_INDEX) return false; uint32 fieldIndexOffset = bitIndex / 32; diff --git a/src/game/Player.h b/src/game/Player.h index 364e9ab78..0716cd554 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -473,6 +473,8 @@ enum PlayerFlags #define PLAYER_TITLE_HAND_OF_ADAL UI64LIT(0x0000008000000000) // 39 #define PLAYER_TITLE_VENGEFUL_GLADIATOR UI64LIT(0x0000010000000000) // 40 +#define MAX_TITLE_INDEX (3*64) // 3 uint64 fields + // used in PLAYER_FIELD_BYTES values enum PlayerFieldByteFlags { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 18f784a7b..47b1af20f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8192" + #define REVISION_NR "8193" #endif // __REVISION_NR_H__ From c8fa4b59f54e57340623bf061c75a2f4567063cb Mon Sep 17 00:00:00 2001 From: Ambal Date: Sat, 18 Jul 2009 03:47:59 +0400 Subject: [PATCH 02/34] [8194] Use _SECURE_SCL=0 for speedup iterators work at Windows platform in release mode. Change added for VC80/VC90, but not added for VC10. --- src/shared/revision_nr.h | 2 +- win/VC80/framework.vcproj | 4 ++-- win/VC80/g3dlite.vcproj | 4 ++-- win/VC80/game.vcproj | 4 ++-- win/VC80/genrevision.vcproj | 4 ++-- win/VC80/mangosd.vcproj | 4 ++-- win/VC80/realmd.vcproj | 4 ++-- win/VC80/script.vcproj | 4 ++-- win/VC80/shared.vcproj | 4 ++-- win/VC80/sockets.vcproj | 4 ++-- win/VC90/framework.vcproj | 5 +++-- win/VC90/g3dlite.vcproj | 5 +++-- win/VC90/game.vcproj | 5 +++-- win/VC90/genrevision.vcproj | 5 +++-- win/VC90/mangosd.vcproj | 4 ++-- win/VC90/realmd.vcproj | 5 +++-- win/VC90/script.vcproj | 4 ++-- win/VC90/shared.vcproj | 5 +++-- win/VC90/sockets.vcproj | 5 +++-- 19 files changed, 44 insertions(+), 37 deletions(-) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 47b1af20f..25f3a756f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8193" + #define REVISION_NR "8194" #endif // __REVISION_NR_H__ diff --git a/win/VC80/framework.vcproj b/win/VC80/framework.vcproj index 4b127d313..833262ea8 100644 --- a/win/VC80/framework.vcproj +++ b/win/VC80/framework.vcproj @@ -345,7 +345,7 @@ AdditionalOptions="/Zl /MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\src\framework;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" StringPooling="true" MinimalRebuild="false" RuntimeLibrary="2" @@ -421,7 +421,7 @@ AdditionalOptions="/Zl /MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\src\framework;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" StringPooling="true" MinimalRebuild="false" RuntimeLibrary="2" diff --git a/win/VC80/g3dlite.vcproj b/win/VC80/g3dlite.vcproj index 90a76ee44..5b76b6fb9 100644 --- a/win/VC80/g3dlite.vcproj +++ b/win/VC80/g3dlite.vcproj @@ -186,7 +186,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" AdditionalIncludeDirectories="..\..\dep\include\g3dlite" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SECURE_SCL=0" RuntimeLibrary="2" EnableEnhancedInstructionSet="1" UsePrecompiledHeader="0" @@ -399,7 +399,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" AdditionalIncludeDirectories="..\..\dep\include\g3dlite" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SECURE_SCL=0" RuntimeLibrary="2" EnableEnhancedInstructionSet="0" UsePrecompiledHeader="0" diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index e4b1c4567..7be6d53b9 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -130,7 +130,7 @@ AdditionalOptions="/MP /Zm200" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -377,7 +377,7 @@ AdditionalOptions="/MP /bigobj /Zm200" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" diff --git a/win/VC80/genrevision.vcproj b/win/VC80/genrevision.vcproj index a9ea44b72..2faca2dd6 100644 --- a/win/VC80/genrevision.vcproj +++ b/win/VC80/genrevision.vcproj @@ -187,7 +187,7 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SECURE_SCL=0" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" @@ -406,7 +406,7 @@ Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" - PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" + PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_SECURE_SCL=0" RuntimeLibrary="2" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" diff --git a/win/VC80/mangosd.vcproj b/win/VC80/mangosd.vcproj index 9b49a8969..be3c37288 100644 --- a/win/VC80/mangosd.vcproj +++ b/win/VC80/mangosd.vcproj @@ -48,7 +48,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="VERSION="0.14.0-DEV";WIN32;NDEBUG;_CONSOLE;ENABLE_CLI" + PreprocessorDefinitions="VERSION="0.14.0-DEV";WIN32;NDEBUG;_CONSOLE;ENABLE_CLI;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -352,7 +352,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include,..\..\src\framework,..\..\src\shared,..\..\src\game,..\..\src\mangosd;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="VERSION="0.14.0-DEV";WIN32;NDEBUG;_CONSOLE;ENABLE_CLI" + PreprocessorDefinitions="VERSION="0.14.0-DEV";WIN32;NDEBUG;_CONSOLE;ENABLE_CLI;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" diff --git a/win/VC80/realmd.vcproj b/win/VC80/realmd.vcproj index 435fe0914..a2222e4e7 100644 --- a/win/VC80/realmd.vcproj +++ b/win/VC80/realmd.vcproj @@ -48,7 +48,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="VERSION="0.14.0-DEV",WIN32,NDEBUG,_CONSOLE" + PreprocessorDefinitions="VERSION="0.14.0-DEV",WIN32,NDEBUG,_CONSOLE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -147,7 +147,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="VERSION="0.14.0-DEV",WIN32,NDEBUG,_CONSOLE" + PreprocessorDefinitions="VERSION="0.14.0-DEV",WIN32,NDEBUG,_CONSOLE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" diff --git a/win/VC80/script.vcproj b/win/VC80/script.vcproj index 661cae4ed..811740ae6 100644 --- a/win/VC80/script.vcproj +++ b/win/VC80/script.vcproj @@ -375,7 +375,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" AdditionalIncludeDirectories="..\..\src\shared;..\..\src\framework;..\..\dep\include;..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT;_SECURE_SCL=0" RuntimeLibrary="2" EnableEnhancedInstructionSet="1" UsePrecompiledHeader="0" @@ -458,7 +458,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/MP" AdditionalIncludeDirectories="..\..\src\shared;..\..\src\framework;..\..\dep\include;..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\realmd;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT" + PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT;_SECURE_SCL=0" RuntimeLibrary="2" EnableEnhancedInstructionSet="0" UsePrecompiledHeader="0" diff --git a/win/VC80/shared.vcproj b/win/VC80/shared.vcproj index 6b4bc4e07..c0991b3bd 100644 --- a/win/VC80/shared.vcproj +++ b/win/VC80/shared.vcproj @@ -47,7 +47,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\dep\include\g3dlite;..\..\src\framework;..\..\src\shared;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -130,7 +130,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\dep\include\g3dlite;..\..\src\framework;..\..\src\shared;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" diff --git a/win/VC80/sockets.vcproj b/win/VC80/sockets.vcproj index 8d8f5fd6c..9d057f5dd 100644 --- a/win/VC80/sockets.vcproj +++ b/win/VC80/sockets.vcproj @@ -46,7 +46,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include\sockets" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -280,7 +280,7 @@ AdditionalOptions="/MP" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include\sockets" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" diff --git a/win/VC90/framework.vcproj b/win/VC90/framework.vcproj index 0244fa688..1d4ef0f81 100644 --- a/win/VC90/framework.vcproj +++ b/win/VC90/framework.vcproj @@ -6,6 +6,7 @@ ProjectGUID="{BF6F5D0E-33A5-4E23-9E7D-DD481B7B5B9E}" RootNamespace="framework" Keyword="Win32Proj" + TargetFrameworkVersion="0" > Date: Sat, 18 Jul 2009 06:16:05 +0400 Subject: [PATCH 03/34] [8195] Add spell check data for dummy effect tail... --- sql/mangos_spell_check.sql | 65 ++++++++++++++++++++++++++++++++++++-- src/game/SpellEffects.cpp | 11 +++---- src/shared/revision_nr.h | 2 +- 3 files changed, 69 insertions(+), 9 deletions(-) diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql index 60d2d8dcd..d8c9c33ec 100644 --- a/sql/mangos_spell_check.sql +++ b/sql/mangos_spell_check.sql @@ -16,7 +16,7 @@ /* re-adding before command use. So need just adding new line to file. */ /* Current table fill progress state: */ -/* SpellEffect.cpp from start until end of SPELLFAMILY_DRUID case of Spell::EffectDummy */ +/* SpellEffect.cpp from start until end of Spell::EffectDummy */ DROP TABLE IF EXISTS spell_check; CREATE TABLE `spell_check` ( @@ -42,6 +42,11 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (1455, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (1456, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (4073, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Mechanical Dragonling', 'Spell::EffectDummy'), +(5938, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Shiv', 'Spell::EffectDummy'), +(5940, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Shiv', 'Spell::EffectDummy'), +(8017, 11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), +(8018, 11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), +(8019, 11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), (8063, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Deviate Fish', 'Spell::EffectDummy'), (8064, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Sleepy', 'Spell::EffectDummy'), (8065, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Invigorate', 'Spell::EffectDummy'), @@ -54,6 +59,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (8221, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Yaaarrrr', 'Spell::EffectDummy'), (8222, -1, -1, -1, -1, -1, -1, -1, -1,-1,'Yaaarrrr', 'Spell::EffectDummy'), (8593, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Symbol of life', 'Spell::EffectDummy'), +(10399,11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), (11687, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (11688, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (11689, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), @@ -70,6 +76,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (13120, 0, -1, -1, -1, -1, -1, 3, -1,-1,'net-o-matic', 'Spell::EffectDummy'), (13166,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Gnomish Battle Chicken', 'Spell::EffectDummy'), (13567, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Dummy Trigger', 'Spell::EffectDummy'), +(14185, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Preparation', 'Spell::EffectDummy'), (15998, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Capture Worg Pup', 'Spell::EffectDummy'), (16566,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Net-o-Matic', 'Spell::EffectDummy'), (16589, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Noggenfogger Elixir', 'Spell::EffectDummy'), @@ -86,10 +93,14 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (18791,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'), (18792,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectInstaKill'), (19804,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Arcanite Dragonling', 'Spell::EffectDummy'), +(20187,10, -1, -1, -1, -1, -1, 3, -1,-1,'Judgement of Righteousness', 'Spell::EffectDummy'), (20253, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'), +(20473,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (20577, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Cannibalize', 'Spell::EffectDummy'), (20578,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cannibalize', 'Spell::EffectDummy'), (20647,-1, -1, -1, -1, -1, -1, 2, -1, 0,'Execute', 'Spell::EffectDummy'), +(20929,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(20930,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (21887,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Warrior\'s Wrath', 'Spell::EffectDummy'), (21977, 4, -1, -1, -1, -1, -1, 3, -1,-1,'Warrior\'s Wrath', 'Spell::EffectDummy'), (23019, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Crystal Prison Dummy DND', 'Spell::EffectDummy'), @@ -110,11 +121,18 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (23783,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Gift of Life', 'Spell::EffectDummy'), (23881, 4, -1, -1, -1, -1, -1, 3, -1,-1,'Bloodthirst', 'Spell::EffectDummy'), (23885,-1, -1, -1, -1, -1, -1, 6, 42, 0,'Bloodthirst', 'Spell::EffectDummy'), +(23989, 9, -1, -1, -1, -1, -1, 3, -1,-1,'Readiness', 'Spell::EffectDummy'), (24340, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), (25599, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Thundercrash', 'Spell::EffectSchoolDMG'), (25858,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Reindeer', 'Spell::EffectDummy'), (25859,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Reindeer', 'Spell::EffectDummy'), (25860, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Reindeer Transformation', 'Spell::EffectDummy'), +(25902,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(25903,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(25911,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(25912,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(25913,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(25914,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (26074, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Holiday Cheer', 'Spell::EffectDummy'), (26467,-1, -1, -1, -1, -1, -1, 6, 42, 0,'Persistent Shield', 'Spell::EffectDummy'), (26558, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), @@ -122,6 +140,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (26635,-1, -1, -1, -1, -1, -1, 6, -1, 1,'Berserking', 'Spell::EffectDummy'), (26635,-1, -1, -1, -1, -1, -1, 6, -1, 2,'Berserking', 'Spell::EffectDummy'), (26789, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Shard of the Fallen Star', 'Spell::EffectSchoolDMG'), +(27174,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(27175,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(27176,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (27222, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (28006, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Arcane Cloaking', 'Spell::EffectDummy'), (28884, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), @@ -139,7 +160,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (30504,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Poultryized!', 'Spell::EffectDummy'), (30507, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Poultryizer', 'Spell::EffectDummy'), (31225, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Shimmering Vessel', 'Spell::EffectDummy'), +(31231, 8, -1, -1, -1, -1, -1, 3, -1,-1,'Cheat Death', 'Spell::EffectDummy'), (31436, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Malevolent Cleave', 'Spell::EffectSchoolDMG'), +(31789,10, -1, -1, -1, -1, -1, 3, -1, 0,'Righteous Defense', 'Spell::EffectDummy'), (31803,-1, -1, -1, -1, -1, -1, 6, 3,-1,'Holy Vengeance', 'Spell::EffectSchoolDMG'), (31818,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Life Tap', 'Spell::EffectDummy'), (32409,-1, -1, -1, -1, -1, -1, 6, 3,-1,'Shadow Word: Death', 'Spell::EffectSchoolDMG'), @@ -158,6 +181,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (33060, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Make a Wish', 'Spell::EffectDummy'), (33062,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Tiny Magical Crawdad', 'Spell::EffectDummy'), (33064,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Mr. Pinchy\'s Gift', 'Spell::EffectDummy'), +(33072,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(33073,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(33074,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (34665, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Administer Antidote', 'Spell::EffectDummy'), (34846,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Charge', 'Spell::EffectDummy'), (35181, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Dive Bomb', 'Spell::EffectSchoolDMG'), @@ -166,13 +192,25 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (35744,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Socrethar Portal', 'Spell::EffectDummy'), (35745, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Socrethar\'s Stone', 'Spell::EffectDummy'), (36032,-1, -1, -1, -1, -1, -1, -1, -1,-1,'', 'Spell::EffectSchoolDMG'), +(36494,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), +(36750,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), +(36755,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), +(36759,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), (36837, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), (36902,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Transporter Malfunction', 'Spell::EffectDummy'), (37169,-1, -1, -1, -1, -1, -1, 6, 4,-1,'Eviscerate and Envenom Bonus Damage','Spell::EffectSchoolDMG'), +(37506, 9, -1, -1, -1, -1, -1, 3, -1,-1,'Scatter Shot', 'Spell::EffectDummy'), (37674, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Chaos Blast', 'Spell::EffectDummy'), (37675,-1, -1, -1, -1, -1, -1, 2, -1, 0,'Chaos Blast', 'Spell::EffectDummy'), +(37877,10, -1, -1, -1, -1, -1, 3, -1,-1,'Blessing of Faith', 'Spell::EffectDummy'), +(37878,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Blessing of Lower City', 'Spell::EffectDummy'), +(37879,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Blessing of Lower City', 'Spell::EffectDummy'), +(37880,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Blessing of Lower City', 'Spell::EffectDummy'), +(37881,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Blessing of Lower City', 'Spell::EffectDummy'), (38441, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Cataclysmic Bolt', 'Spell::EffectSchoolDMG'), (38903, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), +(39609,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Mana Tide Totem', 'Spell::EffectDummy'), +(39610,11, -1, -1, -1, -1, -1, 3, -1,-1,'Mana Tide Totem effect', 'Spell::EffectDummy'), (40810, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Saber Lash', 'Spell::EffectSchoolDMG'), (41276, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor', 'Spell::EffectSchoolDMG'), (42384, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Brutal Swipe', 'Spell::EffectSchoolDMG'), @@ -191,10 +229,19 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (45030, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Impale Emissary', 'Spell::EffectDummy'), (45088,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Emissary of Hate Credit', 'Spell::EffectDummy'), (45150, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Meteor Slash', 'Spell::EffectSchoolDMG'), +(45182,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cheat Death', 'Spell::EffectDummy'), (46014,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Knocked Up', 'Spell::EffectDummy'), (47540, 6,0x0080000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Penance', 'Spell::EffectDummy'), +(47632,-1, -1, -1, -1, -1, -1, 2, -1, 0,'Death Coil', 'Spell::EffectDummy'), +(47633,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Death Coil', 'Spell::EffectDummy'), (47757,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'), (47758,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'), +(48820,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(48821,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(48822,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(48823,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(48824,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +(48825,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (50242,-1, -1, -1, -1, -1, -1, -1, -1,-1,'1000001', 'Spell::EffectDummy'), (50243, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Teach Language', 'Spell::EffectDummy'), (50246,-1, -1, -1, -1, -1, -1, -1, -1,-1,'01001000', 'Spell::EffectDummy'), @@ -202,6 +249,9 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (50288,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Starfall', 'Spell::EffectDummy'), (51582, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Rocket Boots Engaged', 'Spell::EffectDummy'), (51592, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Pickup Primordial Hatchling', 'Spell::EffectDummy'), +(52025,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Cleansing Totem Effect', 'Spell::EffectDummy'), +(52032,-1, -1, -1, -1, -1, -1, 30, -1, 0,'Mana Spring Totem', 'Spell::EffectDummy'), +(52042,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Healing Stream Totem', 'Spell::EffectDummy'), (52308, 0, -1, -1, -1, -1, -1, 3, -1, 0,'Take Sputum Sample', 'Spell::EffectDummy'), (52308, 0, -1, -1, -1, -1, -1, 3, -1, 1,'Take Sputum Sample', 'Spell::EffectDummy'), (52752,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Ancestral Awakening', 'Spell::EffectDummy'), @@ -226,6 +276,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (54586,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Runeforging Credit', 'Spell::EffectDummy'), (54861,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'), (55004, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'), +(55441,11, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Mana Tide', 'Spell::EffectDummy'), (57946, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'), (58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'), @@ -239,34 +290,44 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 0, -1, -1,1661, -1, -1, 3, -1,-1,'Berserking', 'Spell::EffectDummy'), ( 0, 4,0x0000040000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Bloodthirst', 'Spell::EffectSchoolDMG'), (0, 4,0x0000000000000001,0x00000000, -1, 867, -1, 3, -1,-1,'Charge', 'Spell::EffectDummy'), +( 0,11,0x0000000004000000,0x00000000,1673, -1, -1, 3, -1,-1,'Cleansing Totem', 'Spell::EffectDummy'), (0, 4,0x0000000004000000,0x00000000, -1, -1, -1, 3, -1,-1,'Concussion Blow', 'Spell::EffectDummy'), ( 0, 9,0x0008000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Counterattack', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000010000,0x00000000, -1, -1, -1, -1, 3,-1,'Deadly poison', 'Spell::EffectSchoolDMG'), +( 0,15,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Death Coil', 'Spell::EffectDummy'), ( 0, 8,0x0000000800000000,0x00000000, -1, -1, -1, 2, -1,-1,'Envenom', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000020000,0x00000000, -1, -1, -1, 2, -1,-1,'Eviscerate', 'Spell::EffectSchoolDMG'), (0, 4,0x0000000020000000,0x00000000, -1, -1, -1, 3, -1,-1,'Execute', 'Spell::EffectDummy'), ( 0, 9,0x0000000000000004,0x00000000, -1, -1, -1, 2, -1,-1,'Explosive Trap Effect', 'Spell::EffectSchoolDMG'), ( 0, 7,0x0000000000800000,0x00000000, -1,6587, -1, 2, -1,-1,'Ferocious Bite', 'Spell::EffectSchoolDMG'), +( 0,11,0x0000000000200000,0x00000000, -1, -1, -1, -1, -1,-1,'Flametongue', 'Spell::EffectDummy'), ( 0, 9, -1, -1,1578, -1, -1, 2, -1,-1,'Gore', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000000008,0x00000000, -1, -1, -1, 2, -1,-1,'Gouge', 'Spell::EffectSchoolDMG'), ( 0,10,0x0000008000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Hammer of Wrath', 'Spell::EffectSchoolDMG'), ( 0,10,0x0004000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Hammer of the Righteous', 'Spell::EffectSchoolDMG'), +( 0,11,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Healing Stream Totem', 'Spell::EffectDummy'), ( 0, 4,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Heroic Throw', 'Spell::EffectSchoolDMG'), +( 0,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (0, 5, -1, -1, 208, -1, -1, -1, 4,-1,'Improved Life Tap', 'Spell::EffectDummy'), ( 0, 5,0x0000004000000000,0x00000000,2128, -1, -1, 2, -1,-1,'Incinerate', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000002000,0x00000000, -1, -1, -1, 2, -1,-1,'Instant Poison', 'Spell::EffectSchoolDMG'), +( 0,10, -1, -1, 561, -1, -1, 3, -1,-1,'Judgement of command', 'Spell::EffectDummy'), ( 0,10,0x0000000800000000,0x00000000,2292, -1, -1, 2, -1,-1,'Judgement of Vengeance', 'Spell::EffectSchoolDMG'), ( 0, 7,0x0000010000000000,0x00000000,2246, -1, -1, 2, -1,-1,'Lacerate', 'Spell::EffectSchoolDMG'), +( 0,11,0x0000000000000000,0x00000004, -1, -1, -1, 3, -1,-1,'Lava Lash', 'Spell::EffectDummy'), (0, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (0, 5, -1, -1,1982, -1, -1, -1,107,-1,'Mana Feed', 'Spell::EffectDummy'), +( 0,11,0x0000000000004000,0x00000000, -1, -1, -1, 3, -1,-1,'Mana Spring Totem', 'Spell::EffectDummy'), ( 0, 7,0x0000044000000000,0x00000000, -1, -1, -1, -1, -1,-1,'Mangle (Cat) and Mangle (Bear)', 'Unit::HandleDummyAuraProc'), ( 0, 9,0x0000000000000002,0x00000000, -1, 342, -1, 2, -1,-1,'Mongoose Bite', 'Spell::EffectSchoolDMG'), (0, 6,0x0080000000000000,0x00000000, -1, -1, -1, 3, -1,-1,'Penance', 'Spell::EffectDummy'), +( 0, 8,0x0000024000000860,0x00000000, -1, -1, -1, -1, -1,-1,'Preparation (affected spells)', 'Spell::EffectDummy'), ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 2, -1,-1,'Rake', 'Spell::EffectSchoolDMG'), /* used in */ ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 80, -1, 2,'Rake', 'Spell::EffectSchoolDMG'), /* exactly selected */ ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, -1, 3,-1,'Rake', 'Aura::HandlePeriodicDamage'), /* used in */ ( 0, 7,0x0000000000001000,0x00000000, -1, -1, -1, 80, -1, 2,'Rake', 'Aura::HandlePeriodicDamage'), /* exactly selected */ ( 0, 4,0x0000000000000400,0x00000000, -1, -1, -1, 2, -1,-1,'Revenge', 'Spell::EffectSchoolDMG'), +( 0,11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), ( 0, 6,0x0000000200000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Word: Death', 'Spell::EffectSchoolDMG'), ( 0,10,0x0010000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shield of Righteousness', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000020000000000,0x00000000, -1, -1,1209, 2, -1,-1,'Shield Slam', 'Spell::EffectSchoolDMG'), @@ -275,8 +336,8 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (0, 4,0x0000000000200000,0x00000000, -1, -1, -1, 3, -1,-1,'Slam', 'Spell::EffectDummy'), (0, 7,0x0000000000000000,0x00000100, -1, -1, -1, 3, -1,-1,'Starfall', 'Spell::EffectDummy'), ( 0, 9,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Steady Shot', 'Spell::EffectSchoolDMG'), +( 0, 9,0x0000000100000000,0x00000000, -1, -1, -1, 3, -1,-1,'Steady Shot', 'Spell::EffectDummy'), ( 0, 7,0x0010000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Swipe', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000000000000080,0x00000000, -1, -1, -1, 2, -1,-1,'Thunder Clap', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000010000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Victory Rush', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000010000000,0x00000000, -1, -1, -1, 2, -1,-1,'Wound Poison', 'Spell::EffectSchoolDMG'); - diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 8014220e3..6551d586f 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1435,7 +1435,7 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(unitTarget, 5940, true); return; } - case 14185: // Preparation Rogue + case 14185: // Preparation { if(m_caster->GetTypeId()!=TYPEID_PLAYER) return; @@ -1487,7 +1487,7 @@ void Spell::EffectDummy(uint32 i) switch(m_spellInfo->Id) { - case 23989: //Readiness talent + case 23989: // Readiness talent { if(m_caster->GetTypeId()!=TYPEID_PLAYER) return; @@ -1649,8 +1649,8 @@ void Spell::EffectDummy(uint32 i) } break; case SPELLFAMILY_SHAMAN: - //Shaman Rockbiter Weapon - if (m_spellInfo->SpellFamilyFlags == 0x400000) + // Rockbiter Weapon + if (m_spellInfo->SpellFamilyFlags & 0x400000) { // TODO: use expect spell for enchant (if exist talent) // In 3.0.3 no mods present for rockbiter @@ -1723,8 +1723,7 @@ void Spell::EffectDummy(uint32 i) if(!unitTarget || unitTarget->getPowerType() != POWER_MANA) return; // Glyph of Mana Tide - Unit *owner = m_caster->GetOwner(); - if (owner) + if(Unit *owner = m_caster->GetOwner()) if (Aura *dummy = owner->GetDummyAura(55441)) damage+=dummy->GetModifier()->m_amount; // Regenerate 6% of Total Mana Every 3 secs diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 25f3a756f..6475d7c19 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8194" + #define REVISION_NR "8195" #endif // __REVISION_NR_H__ From 49b201e22b3742e9733964b4f30e83af1a737b30 Mon Sep 17 00:00:00 2001 From: evilstar Date: Sat, 18 Jul 2009 19:36:51 +0400 Subject: [PATCH 04/34] [8196] Implement item 44012 spell effects. Signed-off-by: VladimirMangos --- sql/mangos_spell_check.sql | 4 ++++ src/game/SpellEffects.cpp | 15 +++++++++++++++ src/mangosd/mangosd.conf.dist.in | 4 ++-- src/shared/revision_nr.h | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql index d8c9c33ec..3a2078fc1 100644 --- a/sql/mangos_spell_check.sql +++ b/sql/mangos_spell_check.sql @@ -281,6 +281,10 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'), (58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'), (58420, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Stormwind', 'Spell::EffectDummy'), +(59640, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), +(59645,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), +(59831,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), +(59843,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), (61491, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'), /* sorted by spell names */ /*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */ diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6551d586f..e96862ae8 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -1151,6 +1151,21 @@ void Spell::EffectDummy(uint32 i) case 58418: // Portal to Orgrimmar case 58420: // Portal to Stormwind return; // implemented in EffectScript[0] + case 59640: // Underbelly Elixir + { + if(m_caster->GetTypeId() != TYPEID_PLAYER) + return; + + uint32 spell_id = 0; + switch(urand(1,3)) + { + case 1: spell_id = 59645; break; + case 2: spell_id = 59831; break; + case 3: spell_id = 59843; break; + } + m_caster->CastSpell(m_caster,spell_id,true,NULL); + return; + } } //All IconID Check in there diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index daeb787aa..ae0ac39ca 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -488,8 +488,8 @@ LogColors = "" # # AllFlightPaths # Players will start with all flight paths (Note: ALL flight paths, not only player's team) -# Default: 0 (true) -# 1 (false) +# Default: 0 (false) +# 1 (true) # # AlwaysMaxSkillForLevel # Players will automatically gain max level dependent (weapon/defense) skill when logging in, leveling up etc. diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 6475d7c19..b54cb1df0 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8195" + #define REVISION_NR "8196" #endif // __REVISION_NR_H__ From 9c917964439aaab0f49b361bc950409e78c48596 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 18 Jul 2009 21:20:33 +0400 Subject: [PATCH 05/34] [8197] Use more similar code for triggered and precast spells. Also better error reporting at not existed spells. Clear use in comments for this 2 dependent cast ways. --- src/game/Spell.cpp | 49 +++++++++++++++++++++++++++++++-------- src/game/Spell.h | 16 +++++++------ src/game/SpellEffects.cpp | 2 +- src/shared/revision_nr.h | 2 +- 4 files changed, 50 insertions(+), 19 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index dd4f60c6e..9eac70ea7 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -1238,12 +1238,7 @@ void Spell::DoSpellHitOnUnit(Unit *unit, const uint32 effectMask) unit->IncrDiminishing(m_diminishGroup); // Apply additional spell effects to target - while (!m_preCastSpells.empty()) - { - uint32 spellId = *m_preCastSpells.begin(); - m_caster->CastSpell(unit, spellId, true, m_CastItem); - m_preCastSpells.erase(m_preCastSpells.begin()); - } + CastPreCastSpells(unit); for(uint32 effectNumber = 0; effectNumber < 3; ++effectNumber) { @@ -2283,6 +2278,7 @@ void Spell::cast(bool skipCheck) } } + // different triggred (for caster) and precast (casted before apply effect to target) cases switch(m_spellInfo->SpellFamilyName) { case SPELLFAMILY_GENERIC: @@ -2765,7 +2761,7 @@ void Spell::finish(bool ok) // call triggered spell only at successful cast (after clear combo points -> for add some if need) if(!m_TriggerSpells.empty()) - TriggerSpell(); + CastTriggerSpells(); // Stop Attack for some spells if( m_spellInfo->Attributes & SPELL_ATTR_STOP_ATTACK_TARGET ) @@ -3604,15 +3600,48 @@ void Spell::HandleEffects(Unit *pUnitTarget,Item *pItemTarget,GameObject *pGOTar */ } -void Spell::TriggerSpell() + +void Spell::AddTriggeredSpell( uint32 spellId ) { - for(TriggerSpells::const_iterator si=m_TriggerSpells.begin(); si!=m_TriggerSpells.end(); ++si) + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); + + if(!spellInfo) + { + sLog.outError("Spell::AddTriggeredSpell: unknown spell id %u used as triggred spell for spell %u)", spellId, m_spellInfo->Id); + return; + } + + m_TriggerSpells.push_back(spellInfo); +} + +void Spell::AddPrecastSpell( uint32 spellId ) +{ + SpellEntry const *spellInfo = sSpellStore.LookupEntry(spellId ); + + if(!spellInfo) + { + sLog.outError("Spell::AddPrecastSpell: unknown spell id %u used as pre-cast spell for spell %u)", spellId, m_spellInfo->Id); + return; + } + + m_preCastSpells.push_back(spellInfo); +} + +void Spell::CastTriggerSpells() +{ + for(SpellInfoList::const_iterator si=m_TriggerSpells.begin(); si!=m_TriggerSpells.end(); ++si) { Spell* spell = new Spell(m_caster, (*si), true, m_originalCasterGUID, m_selfContainer); spell->prepare(&m_targets); // use original spell original targets } } +void Spell::CastPreCastSpells(Unit* target) +{ + for(SpellInfoList::const_iterator si=m_preCastSpells.begin(); si!=m_preCastSpells.end(); ++si) + m_caster->CastSpell(target, (*si), true, m_CastItem); +} + SpellCastResult Spell::CheckCast(bool strict) { // check cooldowns to prevent cheating @@ -5802,4 +5831,4 @@ void Spell::FillRaidOrPartyHealthPriorityTargets( UnitList &TagUnitMap, Unit* ta TagUnitMap.push_back(healthQueue.top().getUnit()); healthQueue.pop(); } -} +} \ No newline at end of file diff --git a/src/game/Spell.h b/src/game/Spell.h index d3b587e95..ea1304644 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -333,7 +333,6 @@ class Spell void TakeRunePower(); void TakeReagents(); void TakeCastItem(); - void TriggerSpell(); SpellCastResult CheckCast(bool strict); SpellCastResult CheckPetCast(Unit* target); @@ -438,8 +437,12 @@ class Spell bool CheckTargetCreatureType(Unit* target) const; - void AddTriggeredSpell(SpellEntry const* spell) { m_TriggerSpells.push_back(spell); } - void AddPrecastSpell(uint32 spellId) { m_preCastSpells.push_back(spellId); } + void AddTriggeredSpell(SpellEntry const* spellInfo) { m_TriggerSpells.push_back(spellInfo); } + void AddPrecastSpell(SpellEntry const* spellInfo) { m_preCastSpells.push_back(spellInfo); } + void AddTriggeredSpell(uint32 spellId); + void AddPrecastSpell(uint32 spellId); + void CastPreCastSpells(Unit* target); + void CastTriggerSpells(); void CleanupTargetList(); protected: @@ -558,10 +561,9 @@ class Spell // ------------------------------------------- //List For Triggered Spells - typedef std::list TriggerSpells; - typedef std::list SpellPrecasts; - TriggerSpells m_TriggerSpells; - SpellPrecasts m_preCastSpells; + typedef std::list SpellInfoList; + SpellInfoList m_TriggerSpells; // casted by caster to same targets settings in m_targets at success finish of current spell + SpellInfoList m_preCastSpells; // casted by caster to each target at spell hit before spell effects apply uint32 m_spellState; uint32 m_timer; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index e96862ae8..db7ddaa3b 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2034,7 +2034,7 @@ void Spell::EffectTriggerSpell(uint32 i) m_caster->CastSpell(unitTarget,spellInfo,true,m_CastItem,NULL,m_originalCasterGUID); } else - m_TriggerSpells.push_back(spellInfo); + AddTriggeredSpell(spellInfo); } void Spell::EffectTriggerMissileSpell(uint32 effect_idx) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b54cb1df0..e44e4e4fd 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8196" + #define REVISION_NR "8197" #endif // __REVISION_NR_H__ From 7ace4b2cd7ed826472ae829b02a519eadf2ca608 Mon Sep 17 00:00:00 2001 From: Ungaminga Date: Sat, 18 Jul 2009 21:24:31 +0400 Subject: [PATCH 06/34] [8198] Implemented heal part of spell 15237 and ranks. Signed-off-by: VladimirMangos --- src/game/Spell.cpp | 18 +++++++++++++++--- src/shared/revision_nr.h | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9eac70ea7..2e5351cd2 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2303,9 +2303,21 @@ void Spell::cast(bool skipCheck) if (m_spellInfo->Mechanic == MECHANIC_SHIELD && (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0000000000000001))) AddPrecastSpell(6788); // Weakened Soul - // Dispersion (transform) - if (m_spellInfo->Id == 47585) - AddPrecastSpell(60069); // Dispersion (mana regen) + + switch(m_spellInfo->Id) + { + case 47585: AddPrecastSpell(60069); break; // Dispersion (transform) + case 15237: AddTriggeredSpell(23455); break;// Holy Nova, rank 1 + case 15430: AddTriggeredSpell(23458); break;// Holy Nova, rank 2 + case 15431: AddTriggeredSpell(23459); break;// Holy Nova, rank 3 + case 27799: AddTriggeredSpell(27803); break;// Holy Nova, rank 4 + case 27800: AddTriggeredSpell(27804); break;// Holy Nova, rank 5 + case 27801: AddTriggeredSpell(27805); break;// Holy Nova, rank 6 + case 25331: AddTriggeredSpell(25329); break;// Holy Nova, rank 7 + case 48077: AddTriggeredSpell(48075); break;// Holy Nova, rank 8 + case 48078: AddTriggeredSpell(48076); break;// Holy Nova, rank 9 + default:break; + } break; } case SPELLFAMILY_PALADIN: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e44e4e4fd..3d8bac33a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8197" + #define REVISION_NR "8198" #endif // __REVISION_NR_H__ From edf9cefc7276084873112ba2ef7a23f621399cab Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sat, 18 Jul 2009 23:47:22 +0400 Subject: [PATCH 07/34] Small code cleanup in Guild::Roster --- src/game/Guild.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/game/Guild.cpp b/src/game/Guild.cpp index 504962e4c..022f31d4f 100644 --- a/src/game/Guild.cpp +++ b/src/game/Guild.cpp @@ -695,40 +695,40 @@ void Guild::Roster(WorldSession *session) data << (uint32)m_ranks.size(); for (RankList::const_iterator ritr = m_ranks.begin(); ritr != m_ranks.end(); ++ritr) { - data << (uint32)ritr->rights; - data << (uint32)ritr->BankMoneyPerDay; // count of: withdraw gold(gold/day) Note: in game set gold, in packet set bronze. + data << uint32(ritr->rights); + data << uint32(ritr->BankMoneyPerDay); // count of: withdraw gold(gold/day) Note: in game set gold, in packet set bronze. for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i) { - data << (uint32)ritr->TabRight[i]; // for TAB_i rights: view tabs = 0x01, deposit items =0x02 - data << (uint32)ritr->TabSlotPerDay[i]; // for TAB_i count of: withdraw items(stack/day) + data << uint32(ritr->TabRight[i]); // for TAB_i rights: view tabs = 0x01, deposit items =0x02 + data << uint32(ritr->TabSlotPerDay[i]); // for TAB_i count of: withdraw items(stack/day) } } for (MemberList::const_iterator itr = members.begin(); itr != members.end(); ++itr) { if (Player *pl = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER))) { - data << (uint64)pl->GetGUID(); - data << (uint8)1; - data << (std::string)pl->GetName(); - data << (uint32)itr->second.RankId; - data << (uint8)pl->getLevel(); - data << (uint8)pl->getClass(); - data << (uint8)0; // new 2.4.0 - data << (uint32)pl->GetZoneId(); + data << uint64(pl->GetGUID()); + data << uint8(1); + data << pl->GetName(); + data << uint32(itr->second.RankId); + data << uint8(pl->getLevel()); + data << uint8(pl->getClass()); + data << uint8(0); // new 2.4.0 + data << uint32(pl->GetZoneId()); data << itr->second.Pnote; data << itr->second.OFFnote; } else { data << uint64(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)); - data << (uint8)0; + data << uint8(0); data << itr->second.name; - data << (uint32)itr->second.RankId; - data << (uint8)itr->second.level; - data << (uint8)itr->second.Class; - data << (uint8)0; // new 2.4.0 - data << (uint32)itr->second.zoneId; - data << (float(time(NULL)-itr->second.logout_time) / DAY); + data << uint32(itr->second.RankId); + data << uint8(itr->second.level); + data << uint8(itr->second.Class); + data << uint8(0); // new 2.4.0 + data << uint32(itr->second.zoneId); + data << float(float(time(NULL)-itr->second.logout_time) / DAY); data << itr->second.Pnote; data << itr->second.OFFnote; } From 8a279eda4b187d8214d65549dc7008a983dbae44 Mon Sep 17 00:00:00 2001 From: Astellar Date: Sun, 19 Jul 2009 01:51:34 +0400 Subject: [PATCH 08/34] [8199] Allow stack auras from different spells triggred at talent 59672 use. Signed-off-by: VladimirMangos --- src/game/SpellMgr.cpp | 4 ++++ src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index d5fe01e07..77464b817 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -1176,6 +1176,10 @@ bool SpellMgr::IsNoStackSpellDueToSpell(uint32 spellId_1, uint32 spellId_2) cons if( (spellInfo_1->SpellIconID == 313 || spellInfo_1->SpellIconID == 2039) && (spellInfo_2->SpellIconID == 544 || spellInfo_2->SpellIconID == 91) || (spellInfo_2->SpellIconID == 313 || spellInfo_2->SpellIconID == 2039) && (spellInfo_1->SpellIconID == 544 || spellInfo_1->SpellIconID == 91) ) return false; + + // Metamorphosis, diff effects + if (spellInfo_1->SpellIconID == 3314 && spellInfo_2->SpellIconID == 3314) + return false; } // Detect Invisibility and Mana Shield (multi-family check) if( spellInfo_1->Id == 132 && spellInfo_2->SpellIconID == 209 && spellInfo_2->SpellVisual[0] == 968 ) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3d8bac33a..94e2d5ed7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8198" + #define REVISION_NR "8199" #endif // __REVISION_NR_H__ From 8ebcabdc23b3e71261de08bafb4fef646be6b50d Mon Sep 17 00:00:00 2001 From: Ambal Date: Sun, 19 Jul 2009 02:39:11 +0400 Subject: [PATCH 09/34] [8200] Use FASTBUILD precompiled mode for debug case also. So in fact remove this define and use related includes unconditionally. Signed-off-by: VladimirMangos --- src/game/pchdef.h | 4 ---- src/shared/revision_nr.h | 2 +- win/VC100/game.vcxproj | 4 ++-- win/VC80/game.vcproj | 4 ++-- win/VC90/game.vcproj | 4 ++-- 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/game/pchdef.h b/src/game/pchdef.h index 4b5b9dfbe..7252e980e 100644 --- a/src/game/pchdef.h +++ b/src/game/pchdef.h @@ -9,8 +9,4 @@ #include "Database/SQLStorage.h" #include "Opcodes.h" #include "SharedDefines.h" - -#ifdef FASTBUILD -//add additional headers here to speed up compilation in release builds even more #include "ObjectMgr.h" -#endif \ No newline at end of file diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 94e2d5ed7..4bbb5cfd8 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8199" + #define REVISION_NR "8200" #endif // __REVISION_NR_H__ diff --git a/win/VC100/game.vcxproj b/win/VC100/game.vcxproj index c35c9ab4c..fbadcde11 100644 --- a/win/VC100/game.vcxproj +++ b/win/VC100/game.vcxproj @@ -212,7 +212,7 @@ /MP /Zm200 %(AdditionalOptions) OnlyExplicitInline ..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;FASTBUILD;%(PreprocessorDefinitions) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true MultiThreadedDLL true @@ -247,7 +247,7 @@ /MP /bigobj /Zm200 %(AdditionalOptions) OnlyExplicitInline ..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_LIB;FASTBUILD;%(PreprocessorDefinitions) + WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) true MultiThreadedDLL true diff --git a/win/VC80/game.vcproj b/win/VC80/game.vcproj index 7be6d53b9..5b8fbca71 100644 --- a/win/VC80/game.vcproj +++ b/win/VC80/game.vcproj @@ -130,7 +130,7 @@ AdditionalOptions="/MP /Zm200" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD;_SECURE_SCL=0" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -377,7 +377,7 @@ AdditionalOptions="/MP /bigobj /Zm200" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD;_SECURE_SCL=0" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index eeb7aeb1e..96b6fefc4 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -214,7 +214,7 @@ AdditionalOptions="/MP /Zm200" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD;_SECURE_SCL=0" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" @@ -296,7 +296,7 @@ AdditionalOptions="/MP /bigobj /Zm200" InlineFunctionExpansion="1" AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\vmap;..\..\dep\ACE_wrappers" - PreprocessorDefinitions="WIN32;NDEBUG;_LIB;FASTBUILD;_SECURE_SCL=0" + PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" StringPooling="true" RuntimeLibrary="2" EnableFunctionLevelLinking="true" From ce387187c1572d2d819218390071b431d47e55e0 Mon Sep 17 00:00:00 2001 From: Alez Date: Sun, 19 Jul 2009 03:22:07 +0400 Subject: [PATCH 10/34] [8201] Apply PvP duration limit to spell 15286 Signed-off-by: VladimirMangos --- src/game/SpellMgr.cpp | 14 ++++++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 77464b817..7596e1a9b 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2911,6 +2911,13 @@ DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellEntry const* spellproto return DIMINISHING_LIMITONLY; break; } + case SPELLFAMILY_PRIEST: + { + // Vampiric Embrace + if ((spellproto->SpellFamilyFlags & UI64LIT(0x00000000004)) && spellproto->SpellIconID == 150) + return DIMINISHING_LIMITONLY; + break; + } case SPELLFAMILY_DEATHKNIGHT: { // Hungering Cold (no flags) @@ -2974,6 +2981,13 @@ int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellEntry cons return 40000; break; } + case SPELLFAMILY_PRIEST: + { + // Vampiric Embrace - limit to 60 seconds in PvP (3.1) + if ((spellproto->SpellFamilyFlags & UI64LIT(0x00000000004)) && spellproto->SpellIconID == 150) + return 60000; + break; + } default: break; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4bbb5cfd8..56675625d 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8200" + #define REVISION_NR "8201" #endif // __REVISION_NR_H__ From e793f0eeab82a7b86efe71f3f981362af80e5ccd Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 19 Jul 2009 04:01:34 +0400 Subject: [PATCH 11/34] [8202] Replace raw array index values by enums. --- src/game/Player.cpp | 22 +++++++++++----------- src/game/Player.h | 14 +++++++++++--- src/shared/revision_nr.h | 2 +- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5ab16b0a8..cd5b94506 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -611,8 +611,8 @@ bool Player::Create( uint32 guidlow, const std::string& name, uint8 race, uint8 // Played time m_Last_tick = time(NULL); - m_Played_time[0] = 0; - m_Played_time[1] = 0; + m_Played_time[PLAYED_TIME_TOTAL] = 0; + m_Played_time[PLAYED_TIME_LEVEL] = 0; // base stats and related field values InitStatsForLevel(); @@ -1285,8 +1285,8 @@ void Player::Update( uint32 p_time ) if (now > m_Last_tick) { uint32 elapsed = uint32(now - m_Last_tick); - m_Played_time[0] += elapsed; // Total played time - m_Played_time[1] += elapsed; // Level played time + m_Played_time[PLAYED_TIME_TOTAL] += elapsed; // Total played time + m_Played_time[PLAYED_TIME_LEVEL] += elapsed; // Level played time m_Last_tick = now; } @@ -2377,7 +2377,7 @@ void Player::GiveLevel(uint32 level) //update level, max level of skills if(getLevel()!= level) - m_Played_time[1] = 0; // Level Played Time reset + m_Played_time[PLAYED_TIME_LEVEL] = 0; // Level Played Time reset SetLevel(level); UpdateSkillsForLevel (); @@ -13849,8 +13849,8 @@ bool Player::MinimalLoadFromDB( QueryResult *result, uint32 guid ) // the instance id is not needed at character enum - m_Played_time[0] = fields[7].GetUInt32(); - m_Played_time[1] = fields[8].GetUInt32(); + m_Played_time[PLAYED_TIME_TOTAL] = fields[7].GetUInt32(); + m_Played_time[PLAYED_TIME_LEVEL] = fields[8].GetUInt32(); m_atLoginFlags = fields[9].GetUInt32(); @@ -14346,8 +14346,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder ) } m_cinematic = fields[19].GetUInt32(); - m_Played_time[0]= fields[20].GetUInt32(); - m_Played_time[1]= fields[21].GetUInt32(); + m_Played_time[PLAYED_TIME_TOTAL]= fields[20].GetUInt32(); + m_Played_time[PLAYED_TIME_LEVEL]= fields[21].GetUInt32(); m_resetTalentsCost = fields[25].GetUInt32(); m_resetTalentsTime = time_t(fields[26].GetUInt64()); @@ -15606,9 +15606,9 @@ void Player::SaveToDB() ss << m_cinematic; ss << ", "; - ss << m_Played_time[0]; + ss << m_Played_time[PLAYED_TIME_TOTAL]; ss << ", "; - ss << m_Played_time[1]; + ss << m_Played_time[PLAYED_TIME_LEVEL]; ss << ", "; ss << finiteAlways(m_rest_bonus); diff --git a/src/game/Player.h b/src/game/Player.h index 0716cd554..132b2b16f 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -833,6 +833,14 @@ enum EnviromentalDamage DAMAGE_FALL_TO_VOID = 6 // custom case for fall without durability loss }; +enum PlayedTimeIndex +{ + PLAYED_TIME_TOTAL = 0, + PLAYED_TIME_LEVEL = 1 +}; + +#define MAX_PLAYED_TIME_INDEX 2 + // used at player loading query list preparing, and later result selection enum PlayerLoginQueryIndex { @@ -1028,9 +1036,9 @@ class MANGOS_DLL_SPEC Player : public Unit // Played Time Stuff time_t m_logintime; time_t m_Last_tick; - uint32 m_Played_time[2]; - uint32 GetTotalPlayedTime() { return m_Played_time[0]; }; - uint32 GetLevelPlayedTime() { return m_Played_time[1]; }; + uint32 m_Played_time[MAX_PLAYED_TIME_INDEX]; + uint32 GetTotalPlayedTime() { return m_Played_time[PLAYED_TIME_TOTAL]; }; + uint32 GetLevelPlayedTime() { return m_Played_time[PLAYED_TIME_LEVEL]; }; void setDeathState(DeathState s); // overwrite Unit::setDeathState diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 56675625d..5d63960a1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8201" + #define REVISION_NR "8202" #endif // __REVISION_NR_H__ From 22ed15a76eba52e1429495ddc5256be8897199dd Mon Sep 17 00:00:00 2001 From: Trogvar Date: Sun, 19 Jul 2009 05:13:22 +0400 Subject: [PATCH 12/34] [8203] Correcttly re-apply level scaled item stat mods at player level change. Signed-off-by: VladimirMangos --- src/game/Level3.cpp | 4 ++++ src/game/Player.cpp | 36 +++++++++++++++++++++++++++++++----- src/game/Player.h | 3 ++- src/shared/revision_nr.h | 2 +- 4 files changed, 38 insertions(+), 7 deletions(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index df4cce2f1..2526652f5 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4362,6 +4362,8 @@ bool ChatHandler::HandleResetLevelCommand(const char * args) ? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL) : sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL); + target->_ApplyAllLevelScaleItemMods(false); + target->SetLevel(start_level); target->InitRunes(); target->InitStatsForLevel(true); @@ -4370,6 +4372,8 @@ bool ChatHandler::HandleResetLevelCommand(const char * args) target->InitTalentForLevel(); target->SetUInt32Value(PLAYER_XP,0); + target->_ApplyAllLevelScaleItemMods(true); + // reset level for pet if(Pet* pet = target->GetPet()) pet->SynchronizeLevelWithOwner(); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index cd5b94506..1429ec489 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -2376,9 +2376,12 @@ void Player::GiveLevel(uint32 level) SetUInt32Value(PLAYER_NEXT_LEVEL_XP, objmgr.GetXPForLevel(level)); //update level, max level of skills - if(getLevel()!= level) - m_Played_time[PLAYED_TIME_LEVEL] = 0; // Level Played Time reset + m_Played_time[PLAYED_TIME_LEVEL] = 0; // Level Played Time reset + + _ApplyAllLevelScaleItemMods(false); + SetLevel(level); + UpdateSkillsForLevel (); // save base values (bonuses already included in stored stats @@ -2403,6 +2406,8 @@ void Player::GiveLevel(uint32 level) SetPower(POWER_FOCUS, 0); SetPower(POWER_HAPPINESS, 0); + _ApplyAllLevelScaleItemMods(true); + // update level to hunter/summon pet if (Pet* pet = GetPet()) pet->SynchronizeLevelWithOwner(); @@ -6485,13 +6490,16 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply) sLog.outDebug("_ApplyItemMods complete."); } -void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool apply) +void Player::_ApplyItemBonuses(ItemPrototype const *proto, uint8 slot, bool apply, bool only_level_scale /*= false*/) { if(slot >= INVENTORY_SLOT_BAG_END || !proto) return; - ScalingStatDistributionEntry const *ssd = proto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(proto->ScalingStatDistribution) : 0; - ScalingStatValuesEntry const *ssv = proto->ScalingStatValue ? sScalingStatValuesStore.LookupEntry(getLevel()) : 0; + ScalingStatDistributionEntry const *ssd = proto->ScalingStatDistribution ? sScalingStatDistributionStore.LookupEntry(proto->ScalingStatDistribution) : NULL; + ScalingStatValuesEntry const *ssv = proto->ScalingStatValue ? sScalingStatValuesStore.LookupEntry(getLevel()) : NULL; + + if(only_level_scale && !(ssd && ssv)) + return; for (int i = 0; i < MAX_ITEM_PROTO_STATS; ++i) { @@ -7214,6 +7222,24 @@ void Player::_ApplyAllItemMods() sLog.outDebug("_ApplyAllItemMods complete."); } +void Player::_ApplyAllLevelScaleItemMods(bool apply) +{ + for (int i = 0; i < INVENTORY_SLOT_BAG_END; ++i) + { + if(m_items[i]) + { + if(m_items[i]->IsBroken()) + continue; + + ItemPrototype const *proto = m_items[i]->GetProto(); + if(!proto) + continue; + + _ApplyItemBonuses(proto,i, apply, true); + } + } +} + void Player::_ApplyAmmoBonuses() { // check ammo diff --git a/src/game/Player.h b/src/game/Player.h index 132b2b16f..626751143 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1857,7 +1857,8 @@ class MANGOS_DLL_SPEC Player : public Unit void _ApplyItemMods(Item *item,uint8 slot,bool apply); void _RemoveAllItemMods(); void _ApplyAllItemMods(); - void _ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply); + void _ApplyAllLevelScaleItemMods(bool apply); + void _ApplyItemBonuses(ItemPrototype const *proto,uint8 slot,bool apply, bool only_level_scale = false); void _ApplyAmmoBonuses(); bool EnchantmentFitsRequirements(uint32 enchantmentcondition, int8 slot); void ToggleMetaGemsActive(uint8 exceptslot, bool apply); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 5d63960a1..79db01fe1 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8202" + #define REVISION_NR "8203" #endif // __REVISION_NR_H__ From 349216d5d7b8d4a2430343b2839d9b1643943b4b Mon Sep 17 00:00:00 2001 From: GriffonHeart Date: Sun, 19 Jul 2009 05:36:59 +0400 Subject: [PATCH 13/34] [8204] Avoid call assistance from non-combatants. Signed-off-by: VladimirMangos --- src/game/Creature.cpp | 4 ++++ src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index a49fe41ee..775caeb74 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1819,6 +1819,10 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction / if (!isAlive()) return false; + // we don't need help from non-combatant ;) + if (isCivilian()) + return false; + // skip fighting creature if (isInCombat()) return false; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 79db01fe1..9f38504d6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8203" + #define REVISION_NR "8204" #endif // __REVISION_NR_H__ From 39833b006911a3e5b85eaa36c2b6c12c7c3bd6a4 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Sun, 19 Jul 2009 07:34:18 +0400 Subject: [PATCH 14/34] [8205] Really use trap GO charges and avoid casting in despawned state. * Drop horribale hack with stored charges amount, use instead GO info charges data as expected. * Count trap activations as charge uses if it have limited charges. * Check trap reactions only in ready spawned state. --- src/game/GameObject.cpp | 165 ++++++++++++++++++++------------------- src/game/GameObject.h | 12 ++- src/shared/revision_nr.h | 2 +- 3 files changed, 96 insertions(+), 83 deletions(-) diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp index 37e5b55d3..2e1e08b4d 100644 --- a/src/game/GameObject.cpp +++ b/src/game/GameObject.cpp @@ -50,7 +50,6 @@ GameObject::GameObject() : WorldObject() m_spawnedByDefault = true; m_usetimes = 0; m_spellId = 0; - m_charges = 5; m_cooldownTime = 0; m_goInfo = NULL; @@ -156,10 +155,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map *map, uint32 phaseMa SetGoAnimProgress(animprogress); - // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22) - if (goinfo->type == GAMEOBJECT_TYPE_SPELLCASTER) - m_charges = goinfo->spellcaster.charges; - //Notify the map's instance data. //Only works if you create the object in it, not if it is moves to that map. //Normally non-players do not teleport to other maps. @@ -282,99 +277,107 @@ void GameObject::Update(uint32 /*p_time*/) } } - // traps can have time and can not have - GameObjectInfo const* goInfo = GetGOInfo(); - if(goInfo->type == GAMEOBJECT_TYPE_TRAP) + if(isSpawned()) { - // traps - Unit* owner = GetOwner(); - Unit* ok = NULL; // pointer to appropriate target if found any - - if(m_cooldownTime >= time(NULL)) - return; - - bool IsBattleGroundTrap = false; - //FIXME: this is activation radius (in different casting radius that must be selected from spell data) - //TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state - float radius = goInfo->trap.radius; - if(!radius) + // traps can have time and can not have + GameObjectInfo const* goInfo = GetGOInfo(); + if(goInfo->type == GAMEOBJECT_TYPE_TRAP) { - if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call) + if(m_cooldownTime >= time(NULL)) return; - else - { - if(m_respawnTime > 0) - break; - radius = goInfo->trap.cooldown; // battlegrounds gameobjects has data2 == 0 && data5 == 3 - IsBattleGroundTrap = true; + // traps + Unit* owner = GetOwner(); + Unit* ok = NULL; // pointer to appropriate target if found any + + bool IsBattleGroundTrap = false; + //FIXME: this is activation radius (in different casting radius that must be selected from spell data) + //TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state + float radius = goInfo->trap.radius; + if(!radius) + { + if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call) + return; + else + { + if(m_respawnTime > 0) + break; + + radius = goInfo->trap.cooldown; // battlegrounds gameobjects has data2 == 0 && data5 == 3 + IsBattleGroundTrap = true; + } } - } - bool NeedDespawn = (goInfo->trap.charges != 0); + CellPair p(MaNGOS::ComputeCellPair(GetPositionX(),GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; - CellPair p(MaNGOS::ComputeCellPair(GetPositionX(),GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - - // Note: this hack with search required until GO casting not implemented - // search unfriendly creature - if(owner && NeedDespawn) // hunter trap - { - MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius); - MaNGOS::UnitSearcher checker(this,ok, u_check); - - CellLock cell_lock(cell, p); - - TypeContainerVisitor, GridTypeMapContainer > grid_object_checker(checker); - cell_lock->Visit(cell_lock, grid_object_checker, *GetMap()); - - // or unfriendly player/pet - if(!ok) + // Note: this hack with search required until GO casting not implemented + // search unfriendly creature + if(owner && goInfo->trap.charges > 0) // hunter trap { - TypeContainerVisitor, WorldTypeMapContainer > world_object_checker(checker); + MaNGOS::AnyUnfriendlyUnitInObjectRangeCheck u_check(this, owner, radius); + MaNGOS::UnitSearcher checker(this,ok, u_check); + + CellLock cell_lock(cell, p); + + TypeContainerVisitor, GridTypeMapContainer > grid_object_checker(checker); + cell_lock->Visit(cell_lock, grid_object_checker, *GetMap()); + + // or unfriendly player/pet + if(!ok) + { + TypeContainerVisitor, WorldTypeMapContainer > world_object_checker(checker); + cell_lock->Visit(cell_lock, world_object_checker, *GetMap()); + } + } + else // environmental trap + { + // environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support + + // affect only players + Player* p_ok = NULL; + MaNGOS::AnyPlayerInObjectRangeCheck p_check(this, radius); + MaNGOS::PlayerSearcher checker(this,p_ok, p_check); + + CellLock cell_lock(cell, p); + + TypeContainerVisitor, WorldTypeMapContainer > world_object_checker(checker); cell_lock->Visit(cell_lock, world_object_checker, *GetMap()); + ok = p_ok; + } + + if (ok) + { + Unit *caster = owner ? owner : ok; + + caster->CastSpell(ok, goInfo->trap.spellId, true, 0, 0, GetGUID()); + m_cooldownTime = time(NULL) + 4; // 4 seconds + + // count charges + if(goInfo->trap.charges > 0) + AddUse(); + + if(IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) + { + //BattleGround gameobjects case + if(((Player*)ok)->InBattleGround()) + if(BattleGround *bg = ((Player*)ok)->GetBattleGround()) + bg->HandleTriggerBuff(GetGUID()); + } } } - else // environmental trap + + if(uint32 max_charges = goInfo->GetCharges()) { - // environmental damage spells already have around enemies targeting but this not help in case not existed GO casting support - - // affect only players - Player* p_ok = NULL; - MaNGOS::AnyPlayerInObjectRangeCheck p_check(this, radius); - MaNGOS::PlayerSearcher checker(this,p_ok, p_check); - - CellLock cell_lock(cell, p); - - TypeContainerVisitor, WorldTypeMapContainer > world_object_checker(checker); - cell_lock->Visit(cell_lock, world_object_checker, *GetMap()); - ok = p_ok; - } - - if (ok) - { - Unit *caster = owner ? owner : ok; - - caster->CastSpell(ok, goInfo->trap.spellId, true, 0, 0, GetGUID()); - m_cooldownTime = time(NULL) + 4; // 4 seconds - - if(NeedDespawn) - SetLootState(GO_JUST_DEACTIVATED); // can be despawned or destroyed - - if(IsBattleGroundTrap && ok->GetTypeId() == TYPEID_PLAYER) + if (m_usetimes >= max_charges) { - //BattleGround gameobjects case - if(((Player*)ok)->InBattleGround()) - if(BattleGround *bg = ((Player*)ok)->GetBattleGround()) - bg->HandleTriggerBuff(GetGUID()); + m_usetimes = 0; + SetLootState(GO_JUST_DEACTIVATED); // can be despawned or destroyed } } } - if (m_charges && m_usetimes >= m_charges) - SetLootState(GO_JUST_DEACTIVATED); // can be despawned or destroyed - break; } case GO_ACTIVATED: diff --git a/src/game/GameObject.h b/src/game/GameObject.h index cbada5206..cb45da544 100644 --- a/src/game/GameObject.h +++ b/src/game/GameObject.h @@ -442,6 +442,17 @@ struct GameObjectInfo } } + uint32 GetCharges() const // despawn at uses amount + { + switch(type) + { + case GAMEOBJECT_TYPE_TRAP: return trap.charges; + case GAMEOBJECT_TYPE_GUARDPOST: return guardpost.charges; + case GAMEOBJECT_TYPE_SPELLCASTER: return spellcaster.charges; + default: return 0; + } + } + uint32 GetLinkedGameObjectEntry() const { switch(type) @@ -663,7 +674,6 @@ class MANGOS_DLL_SPEC GameObject : public WorldObject bool isActiveObject() const { return false; } uint64 GetRotation() const { return m_rotation; } protected: - uint32 m_charges; // Spell charges for GAMEOBJECT_TYPE_SPELLCASTER (22) uint32 m_spellId; time_t m_respawnTime; // (secs) time of next respawn (or despawn if GO have owner()), uint32 m_respawnDelayTime; // (secs) if 0 then current GO state no dependent from timer diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9f38504d6..e3724a76f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8204" + #define REVISION_NR "8205" #endif // __REVISION_NR_H__ From 9b2b2b09eceb84ee2a6934714acb191e7a7c17fa Mon Sep 17 00:00:00 2001 From: nos4r2zod Date: Sun, 19 Jul 2009 07:49:16 +0400 Subject: [PATCH 15/34] [8206] Partly revert [8173] in part per tick bonus coefficient. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 4 ++-- src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 5ae984aec..fe7f8a006 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -4296,8 +4296,8 @@ void Aura::HandlePeriodicDamage(bool apply, bool Real) // Rake if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000001000) && m_spellProto->Effect[2]==SPELL_EFFECT_ADD_COMBO_POINTS) { - // $AP*0.18 bonus per tick - m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 18 / 100); + // $AP*0.18/3 bonus per tick + m_modifier.m_amount += int32(caster->GetTotalAttackPowerValue(BASE_ATTACK) * 6 / 100); return; } // Lacerate diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e3724a76f..763d6c8f9 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8205" + #define REVISION_NR "8206" #endif // __REVISION_NR_H__ From 454b9a06a8c0ce10699cf903cd48a676d79051be Mon Sep 17 00:00:00 2001 From: Itch Date: Thu, 16 Jul 2009 17:08:26 +0600 Subject: [PATCH 16/34] [8207] Allow show combat log for healing done by totems. (cherry picked from commit 62436f324461648b3b0c3a1a9dee896fc1220343) Signed-off-by: VladimirMangos --- src/game/Unit.cpp | 17 +++++++++++------ src/shared/revision_nr.h | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 1831edbae..d5da2a954 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7640,19 +7640,24 @@ int32 Unit::DealHeal(Unit *pVictim, uint32 addhealth, SpellEntry const *spellPro { int32 gain = pVictim->ModifyHealth(int32(addhealth)); - if (GetTypeId()==TYPEID_PLAYER) + Unit* unit = this; + + if( GetTypeId()==TYPEID_UNIT && ((Creature*)this)->isTotem() && ((Totem*)this)->GetTotemType()!=TOTEM_STATUE) + unit = GetOwner(); + + if (unit->GetTypeId()==TYPEID_PLAYER) { // overheal = addhealth - gain - SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, critical); + unit->SendHealSpellLog(pVictim, spellProto->Id, addhealth, addhealth - gain, critical); - if (BattleGround *bg = ((Player*)this)->GetBattleGround()) - bg->UpdatePlayerScore((Player*)this, SCORE_HEALING_DONE, gain); + if (BattleGround *bg = ((Player*)unit)->GetBattleGround()) + bg->UpdatePlayerScore((Player*)unit, SCORE_HEALING_DONE, gain); // use the actual gain, as the overheal shall not be counted, skip gain 0 (it ignored anyway in to criteria) if (gain) - ((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, pVictim); + ((Player*)unit)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HEALING_DONE, gain, 0, pVictim); - ((Player*)this)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); + ((Player*)unit)->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_HEAL_CASTED, addhealth); } if (pVictim->GetTypeId()==TYPEID_PLAYER) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 763d6c8f9..bf9ac6deb 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8206" + #define REVISION_NR "8207" #endif // __REVISION_NR_H__ From c59dac48ff39e1427f6ca06917f2f2695d05ee21 Mon Sep 17 00:00:00 2001 From: NoFantasy Date: Sun, 19 Jul 2009 11:16:21 +0200 Subject: [PATCH 17/34] [8208] Add part support for spell 33525. Also let spell 33652 trigger when aura from 33572 reach full effect. Signed-off-by: NoFantasy --- src/game/SpellAuras.cpp | 16 +++++++++++++++- src/shared/revision_nr.h | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index fe7f8a006..b5b48d305 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1992,6 +1992,10 @@ void Aura::TriggerSpell() caster->CastCustomSpell(target, trigger_spell_id, &m_modifier.m_amount, NULL, NULL, true, NULL, this); return; } + // Ground Slam + case 33525: + target->CastSpell(target, trigger_spell_id, true); + return; } } @@ -3915,12 +3919,22 @@ void Aura::HandleAuraModIncreaseSwimSpeed(bool /*apply*/, bool Real) m_target->UpdateSpeed(MOVE_SWIM, true); } -void Aura::HandleAuraModDecreaseSpeed(bool /*apply*/, bool Real) +void Aura::HandleAuraModDecreaseSpeed(bool apply, bool Real) { // all applied/removed only at real aura add/remove if(!Real) return; + if (apply) + { + // Gronn Lord's Grasp, becomes stoned + if (GetId() == 33572) + { + if (GetStackAmount() >= 5 && !m_target->HasAura(33652)) + m_target->CastSpell(m_target, 33652, true); + } + } + m_target->UpdateSpeed(MOVE_RUN, true); m_target->UpdateSpeed(MOVE_SWIM, true); m_target->UpdateSpeed(MOVE_FLIGHT, true); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index bf9ac6deb..cc2adcea6 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8207" + #define REVISION_NR "8208" #endif // __REVISION_NR_H__ From 45a0d3c8c22b2d004602c3f56e4d8c582240c99e Mon Sep 17 00:00:00 2001 From: ApoC Date: Sun, 19 Jul 2009 17:40:53 +0200 Subject: [PATCH 18/34] [8209] Comment fix. Signed-off-by: ApoC --- src/game/ObjectMgr.h | 2 +- src/shared/revision_nr.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/ObjectMgr.h b/src/game/ObjectMgr.h index b8995b89c..b36394cb1 100644 --- a/src/game/ObjectMgr.h +++ b/src/game/ObjectMgr.h @@ -236,7 +236,7 @@ enum ConditionType CONDITION_SKILL = 7, // skill_id skill_value CONDITION_QUESTREWARDED = 8, // quest_id 0 CONDITION_QUESTTAKEN = 9, // quest_id 0, for condition true while quest active. - CONDITION_AD_COMMISSION_AURA = 10, // 0 0, for condition true while one from AD ñommission aura active + CONDITION_AD_COMMISSION_AURA = 10, // 0 0, for condition true while one from AD commission aura active CONDITION_NO_AURA = 11, // spell_id effindex CONDITION_ACTIVE_EVENT = 12, // event_id }; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index cc2adcea6..9b26b3774 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8208" + #define REVISION_NR "8209" #endif // __REVISION_NR_H__ From e2d40fecc1949f9b990c6d1e8efd099a60ebb5af Mon Sep 17 00:00:00 2001 From: Astellar Date: Mon, 20 Jul 2009 03:22:27 +0400 Subject: [PATCH 19/34] [8210] Implement talent 53302 and ranks. Signed-off-by: VladimirMangos --- src/game/SpellAuras.cpp | 43 ++++++++++++++++++++++++++++++++++++++++ src/shared/revision_nr.h | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b5b48d305..e71bfb964 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1829,6 +1829,49 @@ void Aura::TriggerSpell() // } // break; // } + case SPELLFAMILY_HUNTER: + { + switch (auraId) + { + // Sniper training + case 53302: + case 53303: + case 53304: + if (target->GetTypeId() != TYPEID_PLAYER) + return; + + // Reset reapply counter at move + if (((Player*)target)->isMoving()) + { + m_modifier.m_amount = 6; + return; + } + + // We are standing at the moment + if (m_modifier.m_amount > 0) + { + --m_modifier.m_amount; + return; + } + + // select rank of buff + switch(auraId) + { + case 53302: trigger_spell_id = 64418; break; + case 53303: trigger_spell_id = 64419; break; + case 53304: trigger_spell_id = 64420; break; + } + + // If aura is active - no need to continue + if (target->HasAura(trigger_spell_id)) + return; + + break; + default: + break; + } + break; + } case SPELLFAMILY_DRUID: { switch(auraId) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 9b26b3774..4b92c0f78 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8209" + #define REVISION_NR "8210" #endif // __REVISION_NR_H__ From 8dd96ce52d69fc7ff8cd9b7e338ebef647bb01a5 Mon Sep 17 00:00:00 2001 From: Splinter Date: Mon, 20 Jul 2009 04:00:57 +0400 Subject: [PATCH 20/34] [8211] Correct proc event and internal cooldown for item 42990. Signed-off-by: VladimirMangos --- sql/mangos.sql | 3 ++- sql/updates/8211_01_mangos_spell_proc_event.sql | 5 +++++ sql/updates/Makefile.am | 2 ++ src/shared/revision_nr.h | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 sql/updates/8211_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 0f050d7b6..c15595758 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_8191_01_mangos_spell_affect` bit(1) default NULL + `required_8211_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17618,6 +17618,7 @@ INSERT INTO `spell_proc_event` VALUES (56822, 0x00000000, 15, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (56834, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (56835, 0x00000000, 15, 0x00440000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(57352, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00010154, 0x00000003, 0.000000, 0.000000, 45), (57878, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), (57880, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), (57881, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), diff --git a/sql/updates/8211_01_mangos_spell_proc_event.sql b/sql/updates/8211_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..9846bb0fc --- /dev/null +++ b/sql/updates/8211_01_mangos_spell_proc_event.sql @@ -0,0 +1,5 @@ +ALTER TABLE db_version CHANGE COLUMN required_8191_01_mangos_spell_affect required_8211_01_mangos_spell_proc_event bit; + +DELETE FROM `spell_proc_event` WHERE `entry` = 57352; +INSERT INTO `spell_proc_event` VALUES +(57352, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00010154, 0x00000003, 0.000000, 0.000000, 45); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 4c96a5fbd..ab186f1f8 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -246,6 +246,7 @@ pkgdata_DATA = \ 8158_01_mangos_playercreateinfo_action.sql \ 8190_01_mangos_creature_template.sql \ 8191_01_mangos_spell_affect.sql \ + 8211_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -472,4 +473,5 @@ EXTRA_DIST = \ 8158_01_mangos_playercreateinfo_action.sql \ 8190_01_mangos_creature_template.sql \ 8191_01_mangos_spell_affect.sql \ + 8211_01_mangos_spell_proc_event.sql \ README diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 4b92c0f78..125d26317 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8210" + #define REVISION_NR "8211" #endif // __REVISION_NR_H__ From b047a6225951849b9f9ed2672150226c53271e2d Mon Sep 17 00:00:00 2001 From: Astellar Date: Mon, 20 Jul 2009 04:56:28 +0400 Subject: [PATCH 21/34] [8212] spell_proc_event data fixes for spell 18096, 18119, 30293 and ranks. Signed-off-by: VladimirMangos --- sql/mangos.sql | 19 +++++++++-------- .../8212_01_mangos_spell_proc_event.sql | 21 +++++++++++++++++++ sql/updates/Makefile.am | 2 ++ src/shared/revision_nr.h | 2 +- 4 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 sql/updates/8212_01_mangos_spell_proc_event.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index c15595758..20c28ec27 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_8211_01_mangos_spell_proc_event` bit(1) default NULL + `required_8212_01_mangos_spell_proc_event` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17016,12 +17016,12 @@ INSERT INTO `spell_proc_event` VALUES (17801, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (17802, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (17803, 0x00000000, 5, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(18073, 0x00000000, 5, 0x00000060, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(18073, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (18094, 0x00000000, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (18095, 0x00000000, 5, 0x0000000A, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(18096, 0x00000000, 5, 0x00000060, 0x00000080, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(18119, 0x00000000, 5, 0x000003E5, 0x000010C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(18120, 0x00000000, 5, 0x000003E5, 0x000010C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(18096, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(18119, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(18120, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (18820, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0.000000, 0.000000, 0), (19184, 0x00000000, 9, 0x00000014, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (19387, 0x00000000, 9, 0x00000014, 0x00002000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), @@ -17147,9 +17147,9 @@ INSERT INTO `spell_proc_event` VALUES (29977, 0x00000000, 3, 0x00C00017, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (30003, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000800, 0.000000, 0.000000, 0), (30160, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), -(30293, 0x00000000, 5, 0x00000381, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(30295, 0x00000000, 5, 0x00000381, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(30296, 0x00000000, 5, 0x00000381, 0x000000C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(30293, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(30295, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(30296, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (30299, 0x0000007E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (30301, 0x0000007E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (30302, 0x0000007E, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), @@ -17675,7 +17675,8 @@ INSERT INTO `spell_proc_event` VALUES (61847, 0x00000000, 0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000010, 0.000000, 0.000000, 0), (63108, 0x00000000, 5, 0x00000002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), (63156, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), -(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); +(63158, 0x00000000, 0, 0x00000001, 0x00000040, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); /*!40000 ALTER TABLE `spell_proc_event` ENABLE KEYS */; UNLOCK TABLES; diff --git a/sql/updates/8212_01_mangos_spell_proc_event.sql b/sql/updates/8212_01_mangos_spell_proc_event.sql new file mode 100644 index 000000000..6bad7d129 --- /dev/null +++ b/sql/updates/8212_01_mangos_spell_proc_event.sql @@ -0,0 +1,21 @@ +ALTER TABLE db_version CHANGE COLUMN required_8211_01_mangos_spell_proc_event required_8212_01_mangos_spell_proc_event bit; + +/* Aftermath */ +DELETE FROM `spell_proc_event` WHERE `entry` IN(18119,18120); +INSERT INTO `spell_proc_event` VALUES +(18119, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(18120, 0x00000000, 5, 0x00000000, 0x00800000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); + +/* Pyroclasm */ +DELETE FROM `spell_proc_event` WHERE entry IN(18073,18096,63245); +INSERT INTO `spell_proc_event` VALUES +(18073, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(18096, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), +(63245, 0x00000000, 5, 0x00000100, 0x00800000, 0x00000000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); + +/* Soul Leech */ +DELETE FROM `spell_proc_event` WHERE entry IN(30293,30295,30296); +INSERT INTO `spell_proc_event` VALUES +(30293, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(30295, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0), +(30296, 0x00000000, 5, 0x00000181, 0x008200C0, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index ab186f1f8..07b736709 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -247,6 +247,7 @@ pkgdata_DATA = \ 8190_01_mangos_creature_template.sql \ 8191_01_mangos_spell_affect.sql \ 8211_01_mangos_spell_proc_event.sql \ + 8212_01_mangos_spell_proc_event.sql \ README ## Additional files to include when running 'make dist' @@ -474,4 +475,5 @@ EXTRA_DIST = \ 8190_01_mangos_creature_template.sql \ 8191_01_mangos_spell_affect.sql \ 8211_01_mangos_spell_proc_event.sql \ + 8212_01_mangos_spell_proc_event.sql \ README diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 125d26317..b240b14da 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8211" + #define REVISION_NR "8212" #endif // __REVISION_NR_H__ From eba34304ea03a8a8aa4e15b3ed1474cafaed6369 Mon Sep 17 00:00:00 2001 From: Ungaminga Date: Mon, 20 Jul 2009 06:11:16 +0400 Subject: [PATCH 22/34] [8213] Update code for talent 17962. * Fixed place, basic dependent from 2 auras type at target and damage calculation. * Avoid double apply spell bonus from original effect and talent self. Signed-off-by: VladimirMangos This is first patch in series for resolve all problem suggested by different authors. Signed-off-by: VladimirMangos --- sql/mangos.sql | 4 ++-- .../8213_01_mangos_spell_bonus_data.sql | 4 ++++ sql/updates/Makefile.am | 2 ++ src/game/Spell.cpp | 16 --------------- src/game/SpellEffects.cpp | 20 +++++++++++++++++++ src/shared/revision_nr.h | 2 +- 6 files changed, 29 insertions(+), 19 deletions(-) create mode 100644 sql/updates/8213_01_mangos_spell_bonus_data.sql diff --git a/sql/mangos.sql b/sql/mangos.sql index 20c28ec27..5d622f20d 100644 --- a/sql/mangos.sql +++ b/sql/mangos.sql @@ -23,7 +23,7 @@ DROP TABLE IF EXISTS `db_version`; CREATE TABLE `db_version` ( `version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL, - `required_8212_01_mangos_spell_proc_event` bit(1) default NULL + `required_8213_01_mangos_spell_bonus_data` bit(1) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; -- @@ -17891,7 +17891,7 @@ INSERT INTO `spell_bonus_data` VALUES ('27243', '0.22', '0.25', '0', 'Warlock - Seed of Corruption'), ('30108', '0', '0.24', '0', 'Warlock - Unstable Affliction'), ('31117', '1.8', '0', '0', 'Warlock - Unstable Affliction Dispell'), -('17962', '0.4286', '0', '0', 'Warlock - Conflagrate'), +('17962', '0', '0', '0', 'Warlock - Conflagrate'), ('6789', '0.22', '0', '0', 'Warlock - Death Coil'), ('28176', '0', '0', '0', 'Warlock - Fel Armor'), ('48181', '0.4729', '0', '0', 'Warlock - Haunt'), diff --git a/sql/updates/8213_01_mangos_spell_bonus_data.sql b/sql/updates/8213_01_mangos_spell_bonus_data.sql new file mode 100644 index 000000000..9ccc350ba --- /dev/null +++ b/sql/updates/8213_01_mangos_spell_bonus_data.sql @@ -0,0 +1,4 @@ +ALTER TABLE db_version CHANGE COLUMN required_8212_01_mangos_spell_proc_event required_8213_01_mangos_spell_bonus_data bit; + +DELETE FROM `spell_bonus_data` where entry='17962'; +INSERT INTO `spell_bonus_data` (`entry`) VALUES ('17962'); \ No newline at end of file diff --git a/sql/updates/Makefile.am b/sql/updates/Makefile.am index 07b736709..02768cc0b 100644 --- a/sql/updates/Makefile.am +++ b/sql/updates/Makefile.am @@ -248,6 +248,7 @@ pkgdata_DATA = \ 8191_01_mangos_spell_affect.sql \ 8211_01_mangos_spell_proc_event.sql \ 8212_01_mangos_spell_proc_event.sql \ + 8213_01_mangos_spell_bonus_data.sql \ README ## Additional files to include when running 'make dist' @@ -476,4 +477,5 @@ EXTRA_DIST = \ 8191_01_mangos_spell_affect.sql \ 8211_01_mangos_spell_proc_event.sql \ 8212_01_mangos_spell_proc_event.sql \ + 8213_01_mangos_spell_bonus_data.sql \ README diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2e5351cd2..2680522f4 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2346,22 +2346,6 @@ void Spell::cast(bool skipCheck) break; } - // Conflagrate - consumes immolate - if ((m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE) && m_targets.getUnitTarget()) - { - // for caster applied auras only - Unit::AuraList const &mPeriodic = m_targets.getUnitTarget()->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i) - { - if( (*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && ((*i)->GetSpellProto()->SpellFamilyFlags & 4) && - (*i)->GetCasterGUID()==m_caster->GetGUID() ) - { - m_targets.getUnitTarget()->RemoveAura((*i)->GetId(), (*i)->GetEffIndex()); - break; - } - } - } - // traded items have trade slot instead of guid in m_itemTargetGUID // set to real guid to be sent later to the client m_targets.updateTradeSlotItem(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index db7ddaa3b..6fb123c84 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -408,6 +408,26 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE)) damage += int32(damage*0.25f); } + // Conflagrate - consumes immolate or Shadowflame + if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE) + { + // for caster applied auras only + Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i) + { + if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && + (*i)->GetCasterGUID()==m_caster->GetGUID() && + // Immolate + ((*i)->GetSpellProto()->SpellFamilyFlags & 0x0000000000000004 || + // Shadowflame + (*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)) + { + int32 damagetick = m_caster->SpellDamageBonus(unitTarget, (*i)->GetSpellProto(), (*i)->GetModifier()->m_amount, DOT); + damage += damagetick * 4; + break; + } + } + } break; } case SPELLFAMILY_PRIEST: diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index b240b14da..dfc0f9bd9 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8212" + #define REVISION_NR "8213" #endif // __REVISION_NR_H__ From f1b11860f69087f17732c2a840500dac5f81b26a Mon Sep 17 00:00:00 2001 From: tlexii Date: Mon, 20 Jul 2009 06:16:56 +0400 Subject: [PATCH 23/34] [8214] Implement apply glyph 42454 to talent 17962. Signed-off-by: VladimirMangos --- src/game/SpellEffects.cpp | 4 ++++ src/shared/revision_nr.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 6fb123c84..05d8c0bfd 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -424,6 +424,10 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) { int32 damagetick = m_caster->SpellDamageBonus(unitTarget, (*i)->GetSpellProto(), (*i)->GetModifier()->m_amount, DOT); damage += damagetick * 4; + + // Glyph of Conflagrate + if (!m_caster->HasAura(56235)) + unitTarget->RemoveAurasByCasterSpell((*i)->GetId(), m_caster->GetGUID()); break; } } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index dfc0f9bd9..3072b9123 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8213" + #define REVISION_NR "8214" #endif // __REVISION_NR_H__ From febdda5babdb258116b836f96b37b5f3e515b6bf Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 20 Jul 2009 06:34:06 +0400 Subject: [PATCH 24/34] [8215] Update sql/mangos_spell_check.sql. --- sql/mangos_spell_check.sql | 2 ++ src/shared/revision_nr.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql index 3a2078fc1..019424beb 100644 --- a/sql/mangos_spell_check.sql +++ b/sql/mangos_spell_check.sql @@ -312,6 +312,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0,11,0x0000000000002000,0x00000000, -1, -1, -1, 3, -1,-1,'Healing Stream Totem', 'Spell::EffectDummy'), ( 0, 4,0x0000000100000000,0x00000000, -1, -1, -1, 2, -1,-1,'Heroic Throw', 'Spell::EffectSchoolDMG'), ( 0,10, -1, -1, 156, -1, -1, 3, -1,-1,'Holy Shock', 'Spell::EffectDummy'), +( 0, 5,0x0000000000000004,0x00000000, -1, -1, -1, -1, 3,-1,'Immolate', 'Spell::EffectSchoolDMG'), (0, 5, -1, -1, 208, -1, -1, -1, 4,-1,'Improved Life Tap', 'Spell::EffectDummy'), ( 0, 5,0x0000004000000000,0x00000000,2128, -1, -1, 2, -1,-1,'Incinerate', 'Spell::EffectSchoolDMG'), ( 0, 8,0x0000000000002000,0x00000000, -1, -1, -1, 2, -1,-1,'Instant Poison', 'Spell::EffectSchoolDMG'), @@ -333,6 +334,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 4,0x0000000000000400,0x00000000, -1, -1, -1, 2, -1,-1,'Revenge', 'Spell::EffectSchoolDMG'), ( 0,11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), ( 0, 6,0x0000000200000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Word: Death', 'Spell::EffectSchoolDMG'), +( 0, 5,0x0000000000000000,0x00000002, -1, -1, -1, -1, 3,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), ( 0,10,0x0010000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shield of Righteousness', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000020000000000,0x00000000, -1, -1,1209, 2, -1,-1,'Shield Slam', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000800000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shockwave', 'Spell::EffectSchoolDMG'), diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3072b9123..8a85eac1c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8214" + #define REVISION_NR "8215" #endif // __REVISION_NR_H__ From 680ab810e0010fb2509644eed7ec66c8cf48895d Mon Sep 17 00:00:00 2001 From: rechapa79 Date: Mon, 20 Jul 2009 07:22:23 +0400 Subject: [PATCH 25/34] [8216] More fixes in spell 47897 and talent 17962 and ranks work. * Implement DoT apply for 47897 and ranks. * Implement propertly aura state update at add/remove 47897/348 and ranks * Update checks for 29722 and ranks for bonus damage Signed-off-by: VladimirMangos --- sql/mangos_spell_check.sql | 9 ++++++- src/game/SharedDefines.h | 2 +- src/game/SpellAuras.cpp | 49 ++++++++++++++++++++++++++++++++++---- src/game/SpellEffects.cpp | 38 ++++++++++++++++++++++++----- src/shared/revision_nr.h | 2 +- 5 files changed, 86 insertions(+), 14 deletions(-) diff --git a/sql/mangos_spell_check.sql b/sql/mangos_spell_check.sql index 019424beb..73c84ee67 100644 --- a/sql/mangos_spell_check.sql +++ b/sql/mangos_spell_check.sql @@ -236,6 +236,8 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (47633,-1, -1, -1, -1, -1, -1, 10, -1, 0,'Death Coil', 'Spell::EffectDummy'), (47757,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'), (47758,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Penance', 'Spell::EffectDummy'), +(47897, 5,0x0001000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), +(47960,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), (48820,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (48821,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), (48822,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Holy Shock', 'Spell::EffectDummy'), @@ -277,6 +279,7 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (54861,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'), (55004, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Nitro Boosts', 'Spell::EffectDummy'), (55441,11, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Mana Tide', 'Spell::EffectDummy'), +(56235,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Glyph of Conflagrate', 'Spell::EffectSchoolDMG'), (57946, 5,0x0000000000040000,0x00000000, -1, -1, -1, 3, -1,-1,'Life Tap', 'Spell::EffectDummy'), (58367,-1, -1, -1, -1, -1, -1, -1, 4,-1,'Glyph of Execution', 'Spell::EffectDummy'), (58418, 0, -1, -1, -1, -1, -1, 3, -1,-1,'Portal to Orgrimmar', 'Spell::EffectDummy'), @@ -285,7 +288,10 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas (59645,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), (59831,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), (59843,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Underbelly Elixir', 'Spell::EffectDummy'), +(61290, 5,0x0001000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), +(61291,-1, -1, -1, -1, -1, -1, -1, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), (61491, 0, -1, -1, -1, -1, -1, 2, -1,-1,'Intercept', 'Spell::EffectSchoolDMG'), + /* sorted by spell names */ /*id fm familyMaskA fmMaskB icon vis cat eff aur ef name code */ ( 0, 3,0x0000000020000000,0x00000000, -1, -1, -1, 2, -1,-1,'Arcane Blast', 'Spell::EffectSchoolDMG'), @@ -334,7 +340,8 @@ INSERT INTO spell_check (spellid,SpellFamilyName,SpellFamilyMaskA,SpellFamilyMas ( 0, 4,0x0000000000000400,0x00000000, -1, -1, -1, 2, -1,-1,'Revenge', 'Spell::EffectSchoolDMG'), ( 0,11,0x0000000000400000,0x00000000, -1, -1, -1, 3, -1,-1,'Rockbiter Weapon', 'Spell::EffectDummy'), ( 0, 6,0x0000000200000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadow Word: Death', 'Spell::EffectSchoolDMG'), -( 0, 5,0x0000000000000000,0x00000002, -1, -1, -1, -1, 3,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), +( 0, 5,0x0000000000000000,0x00000002, -1, -1, -1, -1, 3,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), /* dot */ +( 0, 5,0x0001000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shadowflame', 'Spell::EffectSchoolDMG'), /* explcit damage */ ( 0,10,0x0010000000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shield of Righteousness', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000020000000000,0x00000000, -1, -1,1209, 2, -1,-1,'Shield Slam', 'Spell::EffectSchoolDMG'), ( 0, 4,0x0000800000000000,0x00000000, -1, -1, -1, 2, -1,-1,'Shockwave', 'Spell::EffectSchoolDMG'), diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index d98938cf2..845d92c43 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -893,7 +893,7 @@ enum AuraState //AURA_STATE_UNKNOWN11 = 11, // t| AURA_STATE_FAERIE_FIRE = 12, // c t| AURA_STATE_HEALTHLESS_35_PERCENT = 13, // C T | - AURA_STATE_IMMOLATE = 14, // T | + AURA_STATE_CONFLAGRATE = 14, // T | AURA_STATE_SWIFTMEND = 15, // T | AURA_STATE_DEADLY_POISON = 16, // T | AURA_STATE_ENRAGE = 17, // C | diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index e71bfb964..155fa9d58 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -984,9 +984,13 @@ void Aura::_AddAura() if (IsSealSpell(m_spellProto)) m_target->ModifyAuraState(AURA_STATE_JUDGEMENT, true); - // Conflagrate aura state on Immolate - if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellProto->SpellFamilyFlags & 4) - m_target->ModifyAuraState(AURA_STATE_IMMOLATE, true); + // Conflagrate aura state on Immolate and Shadowflame + if (m_spellProto->SpellFamilyName == SPELLFAMILY_WARLOCK && + // Immolate + ((m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || + // Shadowflame + (m_spellProto->SpellFamilyFlags2 & 0x00000002))) + m_target->ModifyAuraState(AURA_STATE_CONFLAGRATE, true); // Faerie Fire (druid versions) if (m_spellProto->SpellFamilyName == SPELLFAMILY_DRUID && (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400))) @@ -1089,8 +1093,43 @@ void Aura::_RemoveAura() removeState = AURA_STATE_JUDGEMENT; // Update Seals information break; case SPELLFAMILY_WARLOCK: - if(m_spellProto->SpellFamilyFlags & UI64LIT(0x4)) - removeState = AURA_STATE_IMMOLATE; // Conflagrate aura state + // Conflagrate aura state on Immolate and Shadowflame + // Check Immolate case + if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) + { + //check if there is a Shadowflame DOT present, if not, remove AURA_STATE_CONFLAGRATE + bool removeAuraState=true; + Unit::AuraList const& SFDOT = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = SFDOT.begin(); i != SFDOT.end(); ++i) + { + if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && + ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)) + { + removeAuraState=false; + break; + } + } + if(removeAuraState) + removeState = AURA_STATE_CONFLAGRATE; + } + // Check Shadowflame case + else if (m_spellProto->SpellFamilyFlags2 & 0x00000002) + { + //check if there is a Immolate DOT present, if not, remove AURA_STATE_CONFLAGRATE + bool removeAuraState=true; + Unit::AuraList const& IMDOT = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = IMDOT.begin(); i != IMDOT.end(); ++i) + { + if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && + ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004))) + { + removeAuraState=false; + break; + } + } + if(removeAuraState) + removeState = AURA_STATE_CONFLAGRATE; + } break; case SPELLFAMILY_DRUID: if(m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000400)) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 05d8c0bfd..f3916d9d9 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -404,12 +404,38 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) // Incinerate Rank 1 & 2 if ((m_spellInfo->SpellFamilyFlags & UI64LIT(0x00004000000000)) && m_spellInfo->SpellIconID==2128) { - // Incinerate does more dmg (dmg*0.25) if the target is Immolated. - if(unitTarget->HasAuraState(AURA_STATE_IMMOLATE)) - damage += int32(damage*0.25f); + // Incinerate does more dmg (dmg*0.25) if the target have Immolate debuff. + // Check aura state for speed but aura state set not only for Immolate spell + if(unitTarget->HasAuraState(AURA_STATE_CONFLAGRATE)) + { + Unit::AuraList const& RejorRegr = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = RejorRegr.begin(); i != RejorRegr.end(); ++i) + { + // Immolate + if((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && + ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x00000000000004))) + { + damage += damage/4; + break; + } + } + } } - // Conflagrate - consumes immolate or Shadowflame - if (m_spellInfo->TargetAuraState == AURA_STATE_IMMOLATE) + // Shadowflame + else if (m_spellInfo->SpellFamilyFlags & UI64LIT(0x0001000000000000)) + { + // Apply DOT part + switch(m_spellInfo->Id) + { + case 47897: m_caster->CastSpell(unitTarget, 47960, true); break; + case 61290: m_caster->CastSpell(unitTarget, 61291, true); break; + default: + sLog.outError("Spell::EffectDummy: Unhandeled Shadowflame spell rank %u",m_spellInfo->Id); + break; + } + } + // Conflagrate - consumes Immolate or Shadowflame + else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE) { // for caster applied auras only Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); @@ -418,7 +444,7 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && (*i)->GetCasterGUID()==m_caster->GetGUID() && // Immolate - ((*i)->GetSpellProto()->SpellFamilyFlags & 0x0000000000000004 || + ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004) || // Shadowflame (*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)) { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 8a85eac1c..7d2e1d5a8 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8215" + #define REVISION_NR "8216" #endif // __REVISION_NR_H__ From d2dadbcb991f95fe22e6d9f2ac2f07b802743572 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 20 Jul 2009 08:15:26 +0400 Subject: [PATCH 26/34] [8217] Implement proper priority in effect selection at talent 17962 cast. --- src/game/SpellAuras.h | 7 ++++--- src/game/SpellEffects.cpp | 39 ++++++++++++++++++++++++++------------- src/shared/revision_nr.h | 2 +- 3 files changed, 31 insertions(+), 17 deletions(-) diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index f0767e299..760145b8d 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -215,9 +215,10 @@ class MANGOS_DLL_SPEC Aura virtual ~Aura(); void SetModifier(AuraType t, int32 a, uint32 pt, int32 miscValue); - Modifier* GetModifier() {return &m_modifier;} - int32 GetMiscValue() {return m_spellProto->EffectMiscValue[m_effIndex];} - int32 GetMiscBValue() {return m_spellProto->EffectMiscValueB[m_effIndex];} + Modifier* GetModifier() { return &m_modifier; } + Modifier const* GetModifier() const { return &m_modifier; } + int32 GetMiscValue() const { return m_spellProto->EffectMiscValue[m_effIndex]; } + int32 GetMiscBValue() const { return m_spellProto->EffectMiscValueB[m_effIndex]; } SpellEntry const* GetSpellProto() const { return m_spellProto; } uint32 GetId() const{ return m_spellProto->Id; } diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index f3916d9d9..366978200 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -437,25 +437,38 @@ void Spell::EffectSchoolDMG(uint32 effect_idx) // Conflagrate - consumes Immolate or Shadowflame else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE) { - // for caster applied auras only + Aura const* aura = NULL; // found req. aura for damage calculation + Unit::AuraList const &mPeriodic = unitTarget->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); for(Unit::AuraList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i) { - if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && - (*i)->GetCasterGUID()==m_caster->GetGUID() && - // Immolate - ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004) || - // Shadowflame - (*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)) - { - int32 damagetick = m_caster->SpellDamageBonus(unitTarget, (*i)->GetSpellProto(), (*i)->GetModifier()->m_amount, DOT); - damage += damagetick * 4; + // for caster applied auras only + if ((*i)->GetSpellProto()->SpellFamilyName != SPELLFAMILY_WARLOCK || + (*i)->GetCasterGUID()!=m_caster->GetGUID()) + continue; - // Glyph of Conflagrate - if (!m_caster->HasAura(56235)) - unitTarget->RemoveAurasByCasterSpell((*i)->GetId(), m_caster->GetGUID()); + // Immolate + if ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004)) + { + aura = *i; // it selected always if exist break; } + + // Shadowflame + if ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002) + aura = *i; // remember but wait possible Immolate as primary priority + } + + // found Immolate or Shadowflame + if (aura) + { + int32 damagetick = m_caster->SpellDamageBonus(unitTarget, aura->GetSpellProto(), aura->GetModifier()->m_amount, DOT); + damage += damagetick * 4; + + // Glyph of Conflagrate + if (!m_caster->HasAura(56235)) + unitTarget->RemoveAurasByCasterSpell(aura->GetId(), m_caster->GetGUID()); + break; } } break; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 7d2e1d5a8..c8280c349 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8216" + #define REVISION_NR "8217" #endif // __REVISION_NR_H__ From 36605805b406181f3cac01626de57e173ab1d47c Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Mon, 20 Jul 2009 11:43:33 +0400 Subject: [PATCH 27/34] [8218] Final part of talent 17962 and ranks fixes. * Support correct aura state at server set for different casters effects * Correctly check this telent (per caster) aura state at cast * Correctly show per-caster aura state for cleitns. --- src/game/Object.cpp | 30 ++++++++++++++++++++++++++++++ src/game/SharedDefines.h | 2 +- src/game/Spell.cpp | 2 +- src/game/SpellAuras.cpp | 35 ++++++++++------------------------- src/game/Unit.cpp | 29 ++++++++++++++++++++++++++++- src/game/Unit.h | 1 + src/shared/revision_nr.h | 2 +- 7 files changed, 72 insertions(+), 29 deletions(-) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index 9ee40cc2c..f966e025c 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -579,6 +579,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask return; bool IsActivateToQuest = false; + bool IsPerCasterAuraState = false; if (updatetype == UPDATETYPE_CREATE_OBJECT || updatetype == UPDATETYPE_CREATE_OBJECT2) { if (isType(TYPEMASK_GAMEOBJECT) && !((GameObject*)this)->IsTransport()) @@ -589,6 +590,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask updateMask->SetBit(GAMEOBJECT_DYNAMIC); } } + else if (isType(TYPEMASK_UNIT)) + { + if( ((Unit*)this)->HasAuraState(AURA_STATE_CONFLAGRATE)) + { + IsPerCasterAuraState = true; + updateMask->SetBit(UNIT_FIELD_AURASTATE); + } + } } else // case UPDATETYPE_VALUES { @@ -601,6 +610,14 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask updateMask->SetBit(GAMEOBJECT_DYNAMIC); updateMask->SetBit(GAMEOBJECT_BYTES_1); } + else if (isType(TYPEMASK_UNIT)) + { + if( ((Unit*)this)->HasAuraState(AURA_STATE_CONFLAGRATE)) + { + IsPerCasterAuraState = true; + updateMask->SetBit(UNIT_FIELD_AURASTATE); + } + } } WPAssert(updateMask && updateMask->GetCount() == m_valuesCount); @@ -625,6 +642,19 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask *data << uint32(appendValue); } + else if (index == UNIT_FIELD_AURASTATE) + { + if(IsPerCasterAuraState) + { + // IsPerCasterAuraState set if related pet caster aura state set already + if (((Unit*)this)->HasAuraStateForCaster(AURA_STATE_CONFLAGRATE,target->GetGUID())) + *data << m_uint32Values[ index ]; + else + *data << (m_uint32Values[ index ] & ~(1 << (AURA_STATE_CONFLAGRATE-1))); + } + else + *data << m_uint32Values[ index ]; + } // FIXME: Some values at server stored in float format but must be sent to client in uint32 format else if(index >= UNIT_FIELD_BASEATTACKTIME && index <= UNIT_FIELD_RANGEDATTACKTIME) { diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index 845d92c43..c87c05eb5 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -893,7 +893,7 @@ enum AuraState //AURA_STATE_UNKNOWN11 = 11, // t| AURA_STATE_FAERIE_FIRE = 12, // c t| AURA_STATE_HEALTHLESS_35_PERCENT = 13, // C T | - AURA_STATE_CONFLAGRATE = 14, // T | + AURA_STATE_CONFLAGRATE = 14, // T | per-caster AURA_STATE_SWIFTMEND = 15, // T | AURA_STATE_DEADLY_POISON = 16, // T | AURA_STATE_ENRAGE = 17, // C | diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 2680522f4..69985e9b3 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -3739,7 +3739,7 @@ SpellCastResult Spell::CheckCast(bool strict) if(target != m_caster) { // target state requirements (apply to non-self only), to allow cast affects to self like Dirty Deeds - if(m_spellInfo->TargetAuraState && !target->HasAuraState(AuraState(m_spellInfo->TargetAuraState))) + if(m_spellInfo->TargetAuraState && !target->HasAuraStateForCaster(AuraState(m_spellInfo->TargetAuraState),m_caster->GetGUID())) return SPELL_FAILED_TARGET_AURASTATE; // Not allow casting on flying player diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 155fa9d58..b791240c6 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1093,35 +1093,20 @@ void Aura::_RemoveAura() removeState = AURA_STATE_JUDGEMENT; // Update Seals information break; case SPELLFAMILY_WARLOCK: - // Conflagrate aura state on Immolate and Shadowflame - // Check Immolate case - if (m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) + // Conflagrate aura state on Immolate and Shadowflame, + if ((m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || + (m_spellProto->SpellFamilyFlags2 & 0x00000002)) { - //check if there is a Shadowflame DOT present, if not, remove AURA_STATE_CONFLAGRATE + // it can have both from same caster or same effect from different casters bool removeAuraState=true; - Unit::AuraList const& SFDOT = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - for(Unit::AuraList::const_iterator i = SFDOT.begin(); i != SFDOT.end(); ++i) + Unit::AuraList const& dotList = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = dotList.begin(); i != dotList.end(); ++i) { if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && - ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002)) - { - removeAuraState=false; - break; - } - } - if(removeAuraState) - removeState = AURA_STATE_CONFLAGRATE; - } - // Check Shadowflame case - else if (m_spellProto->SpellFamilyFlags2 & 0x00000002) - { - //check if there is a Immolate DOT present, if not, remove AURA_STATE_CONFLAGRATE - bool removeAuraState=true; - Unit::AuraList const& IMDOT = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - for(Unit::AuraList::const_iterator i = IMDOT.begin(); i != IMDOT.end(); ++i) - { - if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && - ((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004))) + // Immolate + (((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || + // Shadowflame + ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002))) { removeAuraState=false; break; diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index d5da2a954..ea5dda4bc 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -7456,6 +7456,34 @@ void Unit::RemoveAllAttackers() } } +bool Unit::HasAuraStateForCaster(AuraState flag, uint64 caster) const +{ + if(!HasAuraState(flag)) + return false; + + // single per-caster aura state + if(flag == AURA_STATE_CONFLAGRATE) + { + Unit::AuraList const& dotList = GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); + for(Unit::AuraList::const_iterator i = dotList.begin(); i != dotList.end(); ++i) + { + if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && + (*i)->GetCasterGUID() == caster && + // Immolate + (((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || + // Shadowflame + ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002))) + { + return true; + } + } + + return false; + } + + return true; +} + void Unit::ModifyAuraState(AuraState flag, bool apply) { if (apply) @@ -7508,7 +7536,6 @@ void Unit::ModifyAuraState(AuraState flag, bool apply) } } } - Unit *Unit::GetOwner() const { if(uint64 ownerid = GetOwnerGUID()) diff --git a/src/game/Unit.h b/src/game/Unit.h index 8762723a7..14dfb82e0 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1406,6 +1406,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject float GetAPMultiplier(WeaponAttackType attType, bool normalized); void ModifyAuraState(AuraState flag, bool apply); bool HasAuraState(AuraState flag) const { return HasFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1)); } + bool HasAuraStateForCaster(AuraState flag, uint64 caster) const; void UnsummonAllTotems(); Unit* SelectMagnetTarget(Unit *victim, SpellEntry const *spellInfo = NULL); int32 SpellBaseDamageBonus(SpellSchoolMask schoolMask); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c8280c349..ef4d395cd 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8217" + #define REVISION_NR "8218" #endif // __REVISION_NR_H__ From a6b1334ba1e946efb1e8e82b602937cd1a900927 Mon Sep 17 00:00:00 2001 From: nos4r2zod Date: Mon, 20 Jul 2009 12:34:54 +0400 Subject: [PATCH 28/34] [8219] Avoid hunter traps proccing when deleted at replace by another trap. Signed-off-by: VladimirMangos --- src/game/SpellEffects.cpp | 10 +++------- src/shared/revision_nr.h | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 366978200..5c36d8db0 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -5749,14 +5749,10 @@ void Spell::EffectSummonObject(uint32 i) default: return; } - uint64 guid = m_caster->m_ObjectSlot[slot]; - if(guid != 0) + if(uint64 guid = m_caster->m_ObjectSlot[slot]) { - GameObject* obj = NULL; - if( m_caster ) - obj = m_caster->GetMap()->GetGameObject(guid); - - if(obj) obj->Delete(); + if(GameObject* obj = m_caster ? m_caster->GetMap()->GetGameObject(guid) : NULL) + obj->SetLootState(GO_JUST_DEACTIVATED); m_caster->m_ObjectSlot[slot] = 0; } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index ef4d395cd..1b2589e17 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8218" + #define REVISION_NR "8219" #endif // __REVISION_NR_H__ From 0a7f878eb8b717e7e31c1865b230d02d6321c289 Mon Sep 17 00:00:00 2001 From: evilstar Date: Mon, 20 Jul 2009 13:11:59 +0400 Subject: [PATCH 29/34] [8220] Implement SPELL_EFFECT_PLAY_MUSIC(132) Thanks to GriffonHeart for help in reseach. Signed-off-by: VladimirMangos --- src/game/SharedDefines.h | 4 ++-- src/game/Spell.h | 1 + src/game/SpellEffects.cpp | 20 +++++++++++++++++++- src/shared/revision_nr.h | 2 +- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/src/game/SharedDefines.h b/src/game/SharedDefines.h index c87c05eb5..a1879af85 100644 --- a/src/game/SharedDefines.h +++ b/src/game/SharedDefines.h @@ -652,10 +652,10 @@ enum SpellEffects SPELL_EFFECT_APPLY_AREA_AURA_ENEMY = 129, SPELL_EFFECT_REDIRECT_THREAT = 130, SPELL_EFFECT_131 = 131, - SPELL_EFFECT_132 = 132, + SPELL_EFFECT_PLAY_MUSIC = 132, SPELL_EFFECT_UNLEARN_SPECIALIZATION = 133, SPELL_EFFECT_KILL_CREDIT2 = 134, - SPELL_EFFECT_135 = 135, + SPELL_EFFECT_CALL_PET = 135, SPELL_EFFECT_HEAL_PCT = 136, SPELL_EFFECT_ENERGIZE_PCT = 137, SPELL_EFFECT_138 = 138, diff --git a/src/game/Spell.h b/src/game/Spell.h index ea1304644..f9ce64c64 100644 --- a/src/game/Spell.h +++ b/src/game/Spell.h @@ -320,6 +320,7 @@ class Spell void EffectActivateRune(uint32 i); void EffectTitanGrip(uint32 i); void EffectEnchantItemPrismatic(uint32 i); + void EffectPlayMusic(uint32 i); Spell( Unit* Caster, SpellEntry const *info, bool triggered, uint64 originalCasterGUID = 0, Spell** triggeringContainer = NULL ); ~Spell(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 5c36d8db0..7a58ff929 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -189,7 +189,7 @@ pEffect SpellEffects[TOTAL_SPELL_EFFECTS]= &Spell::EffectApplyAreaAura, //129 SPELL_EFFECT_APPLY_AREA_AURA_ENEMY &Spell::EffectNULL, //130 SPELL_EFFECT_REDIRECT_THREAT &Spell::EffectUnused, //131 SPELL_EFFECT_131 used in some test spells - &Spell::EffectNULL, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc) + &Spell::EffectPlayMusic, //132 SPELL_EFFECT_PLAY_MUSIC sound id in misc value (SoundEntries.dbc) &Spell::EffectUnlearnSpecialization, //133 SPELL_EFFECT_UNLEARN_SPECIALIZATION unlearn profession specialization &Spell::EffectKillCredit, //134 SPELL_EFFECT_KILL_CREDIT misc value is creature entry &Spell::EffectNULL, //135 SPELL_EFFECT_CALL_PET @@ -6696,3 +6696,21 @@ void Spell::EffectRenamePet(uint32 /*eff_idx*/) unitTarget->SetByteValue(UNIT_FIELD_BYTES_2, 2, UNIT_RENAME_ALLOWED); } + +void Spell::EffectPlayMusic(uint32 i) +{ + if(!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER) + return; + + uint32 soundid = m_spellInfo->EffectMiscValue[i]; + + if (!sSoundEntriesStore.LookupEntry(soundid)) + { + sLog.outError("EffectPlayMusic: Sound (Id: %u) not exist in spell %u.",soundid,m_spellInfo->Id); + return; + } + + WorldPacket data(SMSG_PLAY_MUSIC, 4); + data << uint32(soundid); + ((Player*)unitTarget)->GetSession()->SendPacket(&data); +} diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 1b2589e17..feea934a5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8219" + #define REVISION_NR "8220" #endif // __REVISION_NR_H__ From cd17ada2e5286555f780f8eb5b0e1ceac497e561 Mon Sep 17 00:00:00 2001 From: freghar Date: Mon, 20 Jul 2009 17:48:42 +0200 Subject: [PATCH 30/34] [8221] Removed trailing whitespaces With excluded dep/ - as usual. Signed-off-by: freghar --- contrib/mysql_to_pgsql/cmake/FindMySQL.cmake | 4 +- .../mysql_to_pgsql/cmake/FindPostgreSQL.cmake | 8 +- contrib/mysql_to_pgsql/src/defines.h | 4 +- doc/EventAI.txt | 160 +++++++++--------- src/game/AchievementMgr.cpp | 4 +- src/game/CreatureAI.h | 2 +- src/game/DBCStructure.h | 2 +- src/game/ObjectMgr.cpp | 4 +- src/game/Pet.cpp | 2 +- src/game/PlayerDump.cpp | 2 +- src/game/SpellEffects.cpp | 16 +- src/game/SpellHandler.cpp | 4 +- src/shared/revision_nr.h | 2 +- src/shared/vmap/TileAssembler.cpp | 2 +- 14 files changed, 108 insertions(+), 108 deletions(-) diff --git a/contrib/mysql_to_pgsql/cmake/FindMySQL.cmake b/contrib/mysql_to_pgsql/cmake/FindMySQL.cmake index e7d158de2..3d13c6f4d 100644 --- a/contrib/mysql_to_pgsql/cmake/FindMySQL.cmake +++ b/contrib/mysql_to_pgsql/cmake/FindMySQL.cmake @@ -30,7 +30,7 @@ IF(MSVC) ELSE(MSVC) SET(MYSQL_NAMES mysqlclient mysqlclient_r) ENDIF(MSVC) -SET(MYSQL_SEARCH_LIB_PATHS +SET(MYSQL_SEARCH_LIB_PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 6.0;Location]/lib/opt" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.1;Location]/lib/opt" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MySQL AB\\MySQL Server 5.0;Location]/lib/opt" @@ -71,4 +71,4 @@ MARK_AS_ADVANCED( MYSQL_INCLUDE_DIR ) -ENDMACRO(FIND_MYSQL) \ No newline at end of file +ENDMACRO(FIND_MYSQL) diff --git a/contrib/mysql_to_pgsql/cmake/FindPostgreSQL.cmake b/contrib/mysql_to_pgsql/cmake/FindPostgreSQL.cmake index 06a1adc9e..6cfabd2a2 100644 --- a/contrib/mysql_to_pgsql/cmake/FindPostgreSQL.cmake +++ b/contrib/mysql_to_pgsql/cmake/FindPostgreSQL.cmake @@ -14,7 +14,7 @@ ENDIF (PGSQL_INCLUDE_DIR) # the registry settings checked are in order: # - for pgInstaller 8.2.x postgresql version # - for pgInstaller 8.3.x postgresql version -SET(PGSQL_WIN_BASE +SET(PGSQL_WIN_BASE "[HKEY_LOCAL_MACHINE\\SOFTWARE\\PostgreSQL\\Installations\\{B823632F-3B72-4514-8861-B961CE263224};Base Directory]" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\PostgreSQL\\Installations\\{1F701DBD-1660-4108-B10A-FB435EA63BF0};Base Directory]") @@ -42,12 +42,12 @@ FIND_PATH(PGSQL_INCLUDE_DIR libpq-fe.h ) SET(PGSQL_NAMES pq libpq) -SET(PGSQL_SEARCH_LIB_PATHS +SET(PGSQL_SEARCH_LIB_PATHS ${PGSQL_SEARCH_LIB_PATHS} "[HKEY_LOCAL_MACHINE\\SOFTWARE\\PostgreSQL\\Installations\\{1F701DBD-1660-4108-B10A-FB435EA63BF0};Base Directory]/lib" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\PostgreSQL\\Installations\\{B823632F-3B72-4514-8861-B961CE263224};Base Directory]/lib" - /usr/local/pgsql/lib - /usr/local/lib + /usr/local/pgsql/lib + /usr/local/lib /usr/lib ) FIND_LIBRARY(PGSQL_LIBRARY diff --git a/contrib/mysql_to_pgsql/src/defines.h b/contrib/mysql_to_pgsql/src/defines.h index ed151bf5f..3ffaf9923 100644 --- a/contrib/mysql_to_pgsql/src/defines.h +++ b/contrib/mysql_to_pgsql/src/defines.h @@ -15,7 +15,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ - + #ifndef _DEFINES_ #define _DEFINES_ @@ -59,7 +59,7 @@ typedef vector T_Table; typedef vector T_TableList; typedef map< string, T_Table > TDataBase; -static +static void pg_notice(void *arg, const char *message) { /// Do nothing diff --git a/doc/EventAI.txt b/doc/EventAI.txt index 2557bada9..07d90feff 100644 --- a/doc/EventAI.txt +++ b/doc/EventAI.txt @@ -46,7 +46,7 @@ All params are signed 32 bit values (+/- 2147483647). If param specifies time th If param specifies percentage then percentages are value/100 (ex: if param = 500 then that means 500%, -50 = -50%) *Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) -would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase). +would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase). ========================================= Event Types @@ -61,17 +61,17 @@ Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_E ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only in combat. 1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only out of combat. -2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). -4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat). +2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat). 5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between every (Param1) and (Param2). -6 EVENT_T_DEATH NONE Expires upon Death of the Creature. +6 EVENT_T_DEATH NONE Expires upon Death of the Creature. 7 EVENT_T_EVADE NONE Expires upon creature EnterEvadeMode(). 8 EVENT_T_SPELLHIT SpellID, Schoolmask, RepeatMin, RepeatMax Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of the selected schools (-1 for all). Will repeat every (Param3) and (Param4) . 9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) . 10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a Unit moves within distance(MaxAllowedRange) to creature. If Param1=0 it will expire if Unit are Hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction). Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat. 11 EVENT_T_SPAWNED NONE Expires at initial spawn and at creature respawn (useful for setting ranged movement type) -12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) . +12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) . 13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) . 14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (param1) hp missing. Will repeat every (Param3) and (Param4) . 15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) . @@ -103,7 +103,7 @@ Params are always read from Param1, then Param2, then Param3. 9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays random sound between 3 params* 10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes random emote between 3 params 11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (param1) on target type (param2). Uses Cast Flags (specified below target types) -12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature. +12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature. 13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies threat by (param1) on target type (param2) 14 ACTION_T_THREAT_ALL_PCT Threat% Modifies threat by (param1) on all targets (using -100% on all will result in full aggro dump) 15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (param1) for target type (Param2) @@ -123,7 +123,7 @@ Params are always read from Param1, then Param2, then Param3. 29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator type to a ranged type. Note: Default melee type can still be done with this. Specify 0 angle and 0 distance. 30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets the phase to the id between 3 params* 31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin. -32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). +32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). 33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (param1) for target of type (param2) 34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (param1) and data (param2) 35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID. @@ -147,7 +147,7 @@ BOTH - This event can trigger both in and out of combat. Events that do not have lables on them are events that are directly involved with the in and out of combat state. ------------------ -0 = EVENT_T_TIMER: +0 = EVENT_T_TIMER: ------------------ Parameter 1: InitialMin - Minumum Time used to calculate Random Initial Expire Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire @@ -165,7 +165,7 @@ Parameter 2: InitialMax - Maximum Time used to calculate Random Initial Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on. +OUT OF COMBAT ONLY! - Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4) from then on. This is commonly used for events that occur and repeat outside of combat. --------------- @@ -176,7 +176,7 @@ Parameter 2: HPMin% - Minimum HP% That this Event will Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +BOTH - Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). This is commonly used for events that trigger at a specific HP% (Such as Heal/Enrage Spells or NPC's that Flee). ----------------- @@ -187,7 +187,7 @@ Parameter 2: ManaMin% - Minimum Mana% That this Event will Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +BOTH - Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). This is commonly used for events where an NPC low on Mana will do something (Such as stop casting spells and switch to melee). ------------------ @@ -201,7 +201,7 @@ This Event Expires upon initial aggro (does not repeat). Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2). +COMBAT ONLY! - Expires upon killing a player. Will repeat every (Param1) and (Param2). This Event Expires upon killing a player. It is commonly used for NPC's who yell or do something after killing a player. ------------------ @@ -213,7 +213,7 @@ This is commonly used for NPC's who have a yell on death or cast some kind if su ------------------ 7 = EVENT_T_EVADE: ------------------ -This Event Expires upon the creature EnterEvadeMode(). +This Event Expires upon the creature EnterEvadeMode(). This is commonly used for NPC's who use phases, allows you to reset their phase to 0 upon evade to prevent possible strange behavior. --------------------- @@ -246,7 +246,7 @@ Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire COMBAT ONLY! - Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4). -This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance. +This Event is commonly used for NPC's who have Ranged Combat and will Throw/Shoot between a certian distance. --------------------- 10 = EVENT_T_OOC_LOS: @@ -275,7 +275,7 @@ Parameter 2: HPMin% - Minimum HP% That this Event will Expire Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +COMBAT ONLY! - Expires when Current NPC's Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). This Event is commonly used for NPC's who have a special ability (Like Execute) that only casts when a Player HP is low. ---------------------------- @@ -284,7 +284,7 @@ This Event is commonly used for NPC's who have a special ability (Like Execute) Parameter 1: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 2: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). +COMBAT ONLY! - Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). This event is commonly used for NPC's who will cast a counter spell when their target starts to cast a spell. ------------------------- @@ -306,7 +306,7 @@ Parameter 2: Radius - This is the Range in Yards the NPC will scan for nearby Fr Parameter 3: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 4: RepeatMax - Maximum Time used to calculate Random Repeat Expire -COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4). +COMBAT ONLY! - Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4). This is commonly used for NPC's who can come to the resule of other Friendly NPC's if being Crowd Controlled -------------------------- @@ -327,7 +327,7 @@ Parameter 1: CreatureId - The CreatureID that the NPC is watching to spawn to tr Parameter 2: RepeatMin - Minimum Time used to calculate Random Repeat Expire Parameter 3: RepeatMax - Maximum Time used to calculate Random Repeat Expire -BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) . +BOTH - Expires after creature with entry(Param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3) . This is commonly used for NPC's who will do something special once another NPC is summoned. Usually used is Complex Scripts or Special Events. --------------------------- @@ -438,16 +438,16 @@ UNUSED Can be reused to create new action type -------------------------- Parameter 1: The Sound ID to be played as Random Choice #1. Parameter 2: The Sound ID to be played as Random Choice #2. -Parameter 3: The Sound ID to be played as Random Choice #3. +Parameter 3: The Sound ID to be played as Random Choice #3. -Similar to the ACTION_T_SOUND action, it will choose at random a sound to play. +Similar to the ACTION_T_SOUND action, it will choose at random a sound to play. --------------------------- 10 = ACTION_T_RANDOM_EMOTE: --------------------------- Parameter 1: The Emote ID to be played as Random Choice #1. Parameter 2: The Emote ID to be played as Random Choice #2. -Parameter 3: The Emote ID to be played as Random Choice #3. +Parameter 3: The Emote ID to be played as Random Choice #3. Similar to the ACTION_T_EMOTE action, it will choose at random an Emote to Visually Perform. @@ -458,26 +458,26 @@ Parameter 1: SpellId - The Spell ID to use for the NPC to cast. The value used i Parameter 2: Target - The Target Type defining who the creature should cast the spell at. The value in this field needs to be a valid Target Type as specified in the reference tables below. Parameter 3: CastFlags - See Table Below for Cast Flag Bitmask Values. If you are unsure what to set this value at leave it at 0. -The creature will cast a spell specified by a spell ID on a target specified by the target type. +The creature will cast a spell specified by a spell ID on a target specified by the target type. This is commonly used for NPC's who cast spells. --------------------- 12 = ACTION_T_SUMMON: --------------------- Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID. -Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below. -Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0. +Parameter 2: Target - The Target Type defining who the Summoned creature will attack once spawned. The value in this field needs to be a valid Target Type as specified in the reference tables below. +Parameter 3: Duration - The duration until the summoned creature should be unsummoned AFTER Combat ends. The value in this field is in milliseconds or 0. -The NPC will Summon another creature at the same spot as itself that will attack the specified target. +The NPC will Summon another creature at the same spot as itself that will attack the specified target. NOTE: Almost all Creature Summons have proper Summon Spells that should be used when possible. This Action is a powerful last resort option only to be used if nothing else works. NOTE: Using Target Type 0 will cause the Summoned creature to not attack anyone. -NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died. +NOTE: If Duration is set at 0, then the summoned creature will not despawn until it has died. This is used as a manual way to force an NPC to Summon. -------------------------------- 13 = ACTION_T_THREAT_SINGLE_PCT: -------------------------------- Parameter 1: Threat% - Threat percent that should be modified. The value in this field can range from -100 to +100. If it is negative, threat will be taken away and if positive, threat will be added. -Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The Target Type defining on whom the threat change should occur. The value in this field needs to be a valid target type as specified in the reference tables below. This action will modify the threat of a target in the creature's threat list by the specified percent. This is commonly used to allow an NPC to adjust the Threat to a single player. @@ -485,7 +485,7 @@ This is commonly used to allow an NPC to adjust the Threat to a single player. ----------------------------- 14 = ACTION_T_THREAT_ALL_PCT: ----------------------------- -Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100. +Parameter 1: Threat% - The percent that should be used in modifying everyone's threat in the creature's threat list. The value here can range from -100 to +100. This action will modify the threat for everyone in the creature's threat list by the specified percent. NOTE: Using -100 will cause the creature to reset everyone's threat to 0 so that everyone has the same amount of threat. It will NOT remove anyone from the threat list. @@ -495,10 +495,10 @@ This is commonly used to allow an NPC to drop threat for all players to zero. 15 = ACTION_T_QUEST_EVENT: -------------------------- Parameter 1: QuestID - The Quest Template ID. The value here must be a valid quest template ID. Furthermore, the quest should have SpecialFlags | 2 as it would need to be completed by an external event which is the activation of this action. -Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The Target Type defining whom the quest should be completed for. The value in this field needs to be a valid target type as specified in the reference tables below. -This action will satisfy the external completion requirement for the quest for the specified target defined by the target type. -NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player. +This action will satisfy the external completion requirement for the quest for the specified target defined by the target type. +NOTE: This action can only be used with player targets so it must be ensured that the target type will point to a player. This is commonly used for Quests where only ONE player will gain credit for the quest. ----------------------------- @@ -506,9 +506,9 @@ This is commonly used for Quests where only ONE player will gain credit for the ----------------------------- Parameter 1: CreatureID - The Creature Template ID to be Summoned. The value here needs to be a valid Creature Template ID. Parameter 2: SpellId - The Spell ID to use to simulate the cast. The value used in this field needs to be a valid Spell ID. -Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 3: Target - The Target Type defining whom the quest credit should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. -This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature. +This action will call CastedCreatureOrGO() function for the player. It can be used to give quest credit for casting a spell on the creature. This is commonly used for NPC's who have a special requirement to have a Spell cast on them to complete a quest. ----------------------------- @@ -516,7 +516,7 @@ This is commonly used for NPC's who have a special requirement to have a Spell c ----------------------------- Parameter 1: Field_Number - The index of the Field Number to be changed. Use (http://wiki.udbforums.org/index.php/Character_data) for a list of indeces and what they control. Creatures only contain the OBJECT_FIELD_* and UNIT_FIELD_* fields. They do not contain the PLAYER_FIELD_* fields. Parameter 2: Value - The new value to be put in the field. -Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 3: Target - The Target Type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. When activated, this action can change the target's unit field values. More information on the field value indeces can be found at (http://wiki.udbforums.org/index.php/Character_data) @@ -524,32 +524,32 @@ When activated, this action can change the target's unit field values. More info 18 = ACTION_T_SET_UNIT_FLAG: ---------------------------- Parameter 1: Flags - The flag(s) to be set. Multiple flags can be set by using bitwise-OR on them (adding them together). -Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. +Parameter 2: Target - The Target Type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. -When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used. +When activated, this action changes the target's flags by adding (turning on) more flags. For example, this action can make the creature unattackable/unselectable if the right flags are used. ------------------------------- 19 = ACTION_T_REMOVE_UNIT_FLAG: ------------------------------- Parameter 1: Flags - The flag(s) to be removed. Multiple flags can be set by using bitwise-OR on them (adding them together). -Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. +Parameter 2: Target - The target type defining for whom the flags should be changed. The value in this field needs to be a valid Target Type as specified in the reference tables below. -When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used. +When activated, this action changes the target's flags by removing (turning off) flags. For example, this action can make the creature normal after it was unattackable/unselectable if the right flags are used. -------------------------- 20 = ACTION_T_AUTO_ATTACK: -------------------------- -Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped. +Parameter 1: AllowAutoAttack - If zero, then the creature will stop its melee attacks. If non-zero, then the creature will either continue its melee attacks (the action would then have no effect) or it will start its melee attacks on the target with the top threat if its melee attacks were previously stopped. -This action controls whether or not the creature should stop or start the auto melee attack. +This action controls whether or not the creature should stop or start the auto melee attack. NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values (0 = Stop Melee, 1 = Start Melee). This is commonly used in combination with EVENT_T_RANGE and ACTION_T_COMBAT_MOVEMENT for Ranged Combat for Mages and Spell Casters. ------------------------------ 21 = ACTION_T_COMBAT_MOVEMENT: ------------------------------ -Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before. -Parameter 2: If non-zero, then stop melee combat state (if param1=0) or start melee combat state (if param1!=0) and creature in combat with selected target. +Parameter 1: If zero, then the creature will stop moving towards its victim (if its victim gets out of melee range) and will be stationary. If non-zero, then the creature will either continue to follow its victim (the action would have no effect) or it will start to follow the target with the top threat if its movement was disabled before. +Parameter 2: If non-zero, then stop melee combat state (if param1=0) or start melee combat state (if param1!=0) and creature in combat with selected target. This action controls whether or not the creature will always move towards its target. NOTE: The ACID Dev Team has conformed to using either 0 or 1 for the Param values. (0 = Stop Movement, 1 = Start Movement) @@ -559,7 +559,7 @@ Parameter 2 specialy used for ranged combat proper client side visual show range ------------------------ 22 = ACTION_T_SET_PHASE: ------------------------ -Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error. +Parameter 1: The new phase to set the creature in. This number must be an integer between 0 and 31. Numbers outside of that range will result in an error. When activated, this action sets the creature's event to the specified value. NOTE: The creature's current Phase is NOT reset at creature evade. You must manually set the phase back to 0 at EVENT_T_RESET. @@ -569,20 +569,20 @@ This is commonly used for complex scripts with several phases and you need to sw ------------------------ 23 = ACTION_T_INC_PHASE: ------------------------ -Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase. +Parameter 1: Value - The number of phases to increase or decrease. Use negative values to decrease the current phase. -When activated, this action will increase (or decrease) the current creature's phase. -NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31. +When activated, this action will increase (or decrease) the current creature's phase. +NOTE: After increasing or decreasing the phase by this action, the current phase must NOT be lower than 0 or exceed 31. This can be used instead of ACTION_T_SET_PHASE to change phases in scripts. Just a user friendly option for changing phases. -------------------- 24 = ACTION_T_EVADE: -------------------- -When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter. +When activated, the creature will immediately exit out of combat, clear its threat list, and move back to its spawn point. Basically, this action will reset the whole encounter. NOTE: All Param Values Are 0 for this Action. ------------------- -25 = ACTION_T_FLEE: +25 = ACTION_T_FLEE: ------------------- When activated, the creature will try to flee from combat. Currently this is done by it casting a fear-like spell on itself called "Run Away". A Better Flee system is in Development. @@ -591,47 +591,47 @@ NOTE: All Param Values Are 0 for this Action. ------------------------------ 26 = ACTION_T_QUEST_EVENT_ALL: ------------------------------ -Parameter 1: QuestId - The quest ID to finish for everyone. +Parameter 1: QuestId - The quest ID to finish for everyone. -This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list. -NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed. +This action does the same thing as the ACTION_T_QUEST_EVENT does but it does it for all players in the creature's threat list. +NOTE: If a player is not in the NPC's threat list for whatever reason, he/she won't get the quest completed. --------------------------------- 27 = ACTION_T_CASTCREATUREGO_ALL: --------------------------------- Parameter 1: QuestId - The quest template ID. -Parameter 2: SpellId - The spell ID used to simulate the cast. +Parameter 2: SpellId - The spell ID used to simulate the cast. -This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list. -NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation. +This action does the same thing as the ACTION_T_CASTCREATUREGO does but it does it for all players in the creature's threat list. +NOTE: If a player is not in its threat list for whatever reason, he/she won't receive the cast emulation. ----------------------------------- 28 = ACTION_T_REMOVEAURASFROMSPELL: ----------------------------------- Parameter 1: Target - The target type defining for whom the unit field should be changed. The value in this field needs to be a valid target type as specified in the reference tables below. -Parameter 2: SpellId - The spell ID whose auras will be removed. +Parameter 2: SpellId - The spell ID whose auras will be removed. -This action will remove all auras from a specific spell from the target. +This action will remove all auras from a specific spell from the target. This is commonly used for NPC's who have an OOC Aura that is removed at combat start or a similar idea (Like Stealth or Shape Shift) ------------------------------ 29 = ACTION_T_RANGED_MOVEMENT: ------------------------------ Parameter 1: Distance - The distance the mob should keep between it and its target. -Parameter 2: Angle - The angle the mob should use. +Parameter 2: Angle - The angle the mob should use. -This action changes the movement type generator to ranged type using the specified values for angle and distance. -NOTE: Specifying zero angle and distance will make it just melee instead. -This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target. +This action changes the movement type generator to ranged type using the specified values for angle and distance. +NOTE: Specifying zero angle and distance will make it just melee instead. +This is commonly used for NPC's who always attack at range and you can specify the distance they will maintain from the target. --------------------------- 30 = ACTION_T_RANDOM_PHASE: --------------------------- Parameter 1: PhaseId1 - A possible random phase choice. Parameter 2: PhaseId2 - A possible random phase choice. -Parameter 3: PhaseId3 - A possible random phase choice. +Parameter 3: PhaseId3 - A possible random phase choice. -Randomly sets the phase to one from the three parameter choices. +Randomly sets the phase to one from the three parameter choices. NOTE: Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2) NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE. This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have up to 3 phases used, otherwise use Action 31 for more then 3 phases. @@ -640,9 +640,9 @@ This is commonly used for Spellcasting NPC's who on Aggro may select at random a 31 = ACTION_T_RANDOM_PHASE_RANGE: --------------------------------- Parameter 1: PhaseMin - The minimum of the phase range. -Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin. +Parameter 2: PhaseMax - The maximum of the phase range. The number here must be greater than PhaseMin. -Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). +Randomly sets the phase between a range of phases controlled by the parameters. Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). NOTE: PhaseMax must be greater than PhaseMin. NOTE 2: PLEASE NOTE THAT EACH OF THE PARAM VALUES ARE ACTUAL PHASE NUMBERS NOT THE INVERSE PHASE MASK VALUE. This is commonly used for Spellcasting NPC's who on Aggro may select at random a school of spells to use for the fight. Use this if you have MORE then 3 phases used, otherwise use Action 30. @@ -652,9 +652,9 @@ This is commonly used for Spellcasting NPC's who on Aggro may select at random a --------------------- Parameter 1: CreatureID - The creature template ID to be summoned. The value here needs to be a valid creature template ID. Parameter 2: Target - The target type defining who the summoned creature will attack. The value in this field needs to be a valid target type as specified in the reference tables below. NOTE: Using target type 0 will cause the summoned creature to not attack anyone. -Parameter 3: SummonID - The summon ID from the creature_ai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at. +Parameter 3: SummonID - The summon ID from the creature_ai_summons table controlling the position (and spawntime) where the summoned mob should be spawned at. -Summons creature (param1) to attack target (param2) at location specified by creature_ai_summons (param3). +Summons creature (param1) to attack target (param2) at location specified by creature_ai_summons (param3). NOTE: Param3 Value is the ID Value used for the entry used in creature_ai_summons for this action. You MUST have an creature_ai_summons entry to use this action. This is commonly used for NPC's who need to Summon a creature at a specific location. (Normally used for complex events) @@ -662,9 +662,9 @@ This is commonly used for NPC's who need to Summon a creature at a specific loca 33 = ACTION_T_KILLED_MONSTER: ----------------------------- Parameter 1: CreatureID - The creature template ID. The value here must be a valid creature template ID. -Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The target type defining whom the quest kill count should be given to. The value in this field needs to be a valid target type as specified in the reference tables below. -When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates). +When activated, this action will call KilledMonster() function for the player. It can be used to give creature credit for killing a creature. In general if the quest is set to be accompished on different creatures (e.g. "Credit" templates). NOTE: It can be ANY creature including certain quest specific triggers This is commonly used for giving the player Quest Credits for NPC kills (Many NPC's may use the same CreatureID for the Kill Credit) @@ -674,37 +674,37 @@ This is commonly used for giving the player Quest Credits for NPC kills (Many NP Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script. Parameter 2: Data - The value to put at that field index. -Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. +Sets data for the instance. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. This is commonly used to link an EventAI script with a existing Script Library C++ Script. You make make things happen like opening doors on specific events that happen. ------------------------------ 35 = ACTION_T_SET_INST_DATA64: ------------------------------ Parameter 1: Field - The field to change in the instance script. Again, this field needs to be a valid field that has been already defined in the instance's script. -Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below. +Parameter 2: Target - The target type to use to get the GUID that will be stored at the field index. The value in this field needs to be a valid target type as specified in the reference tables below. -Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. +Sets GUID (64 bits) data for the instance based on the target. Note that this will only work when the creature is inside an instantiable zone that has a valid script (ScriptedInstance) assigned. Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID. ------------------------------ 36 = ACTION_T_UPDATE_TEMPLATE: ------------------------------ Parameter 1: TemplateId - The creature template ID. The value here must be a valid creature template ID. -Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1). +Parameter 2: Team - Use model_id from team : Alliance(0) or Horde (1). -This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry. +This function temporarily changes creature entry to new entry, display is changed, loot is changed, but AI is not changed. At respawn creature will be reverted to original entry. Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true ------------------ 37 = ACTION_T_DIE: ------------------ Kills the creature -This is commonly used if you need to Instakill the creature for one reason or another. +This is commonly used if you need to Instakill the creature for one reason or another. -------------------------------- 38 = ACTION_T_ZONE_COMBAT_PULSE: -------------------------------- -Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. +Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. ---------------------------- 39 = ACTION_T_CALL_FOR_HELP: @@ -763,7 +763,7 @@ Another example: the number "5" (101 in Binary, selecting first and third option 4 16 CAST_FORCE_TARGET_SELF Forces the target to cast this spell on itself 5 32 CAST_AURA_NOT_PRESENT Only casts the spell on the target if the target does not have the aura from that spell on itself already. -NOTE: You can add the numbers in the decimal column to combine flags. +NOTE: You can add the numbers in the decimal column to combine flags. For example if you wanted to use CAST_NO_MELEE_IF_OOM(8) and CAST_TRIGGERED(2) you would simply use 10 in the cast flags field (8 + 2 = 10). ========================================= @@ -820,8 +820,8 @@ Below is the list of current Text types that texts tables can handle. These were ----------------------------------------------------------- 0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble). 1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID. -2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log. -3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses). +2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log. +3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses). 4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log. 5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses). 6 CHAT_TYPE_ZONE_YELL Same as CHAT_TYPE_YELL but will display to all players in current zone. @@ -833,7 +833,7 @@ Below is the list of current Language types that are allowed. This is the Race Language that the text is native to (So it will display properly) # Internal Name Description ------------------------------------------------------------ +----------------------------------------------------------- 0 UNIVERSAL Text in this language is understood by ALL Races. 1 ORCISH Text in this language is understood ONLY by Horde Races. 2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race. diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index 5e0bd5344..e2cb439b9 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -1297,7 +1297,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui if(IsCompletedCriteria(achievementCriteria,achievement)) CompletedCriteriaFor(achievement); - // check again the completeness for SUMM and REQ COUNT achievements, + // check again the completeness for SUMM and REQ COUNT achievements, // as they don't depend on the completed criteria but on the sum of the progress of each individual criteria if (achievement->flags & ACHIEVEMENT_FLAG_SUMM) { @@ -1513,7 +1513,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry) return false; } - // Default case - need complete all or + // Default case - need complete all or bool completed_all = true; for(AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr) { diff --git a/src/game/CreatureAI.h b/src/game/CreatureAI.h index ef2612399..778c2c6d1 100644 --- a/src/game/CreatureAI.h +++ b/src/game/CreatureAI.h @@ -92,7 +92,7 @@ class MANGOS_DLL_SPEC CreatureAI // Called at waypoint reached or point movement finished virtual void MovementInform(uint32 /*MovementType*/, uint32 /*Data*/) {} - // Called at text emote receive from player + // Called at text emote receive from player virtual void ReceiveEmote(Player* /*pPlayer*/, uint32 /*text_emote*/) {} ///== Triggered Actions Requested ================== diff --git a/src/game/DBCStructure.h b/src/game/DBCStructure.h index 2fa8f2267..6b2407911 100644 --- a/src/game/DBCStructure.h +++ b/src/game/DBCStructure.h @@ -661,7 +661,7 @@ struct CinematicCameraEntry float start_x; // 3 float start_y; // 4 float start_z; // 5 - float unk6; // 6 speed? + float unk6; // 6 speed? }; */ diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index ff46463ac..60d8fef78 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -572,7 +572,7 @@ void ObjectMgr::LoadCreatureTemplates() // used later for scale CreatureDisplayInfoEntry const* displayScaleEntry = NULL; - + if (cInfo->DisplayID_A[0]) { CreatureDisplayInfoEntry const* displayEntry = sCreatureDisplayInfoStore.LookupEntry(cInfo->DisplayID_A[0]); @@ -6685,7 +6685,7 @@ uint8 ObjectMgr::CheckPlayerName( const std::string& name, bool create ) uint32 strictMask = sWorld.getConfig(CONFIG_STRICT_PLAYER_NAMES); if(!isValidString(wname,strictMask,false,create)) return CHAR_NAME_MIXED_LANGUAGES; - + return CHAR_NAME_SUCCESS; } diff --git a/src/game/Pet.cpp b/src/game/Pet.cpp index 6f6958d37..722cef4f7 100644 --- a/src/game/Pet.cpp +++ b/src/game/Pet.cpp @@ -146,7 +146,7 @@ bool Pet::LoadPetFromDB( Player* owner, uint32 petentry, uint32 petnumber, bool } uint32 pet_number = fields[0].GetUInt32(); - + if (current && owner->IsPetNeedBeTemporaryUnsummoned()) { owner->SetTemporaryUnsummonedPetNumber(pet_number); diff --git a/src/game/PlayerDump.cpp b/src/game/PlayerDump.cpp index 1ea056260..79201503b 100644 --- a/src/game/PlayerDump.cpp +++ b/src/game/PlayerDump.cpp @@ -330,7 +330,7 @@ void PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl std::string PlayerDumpWriter::GetDump(uint32 guid) { std::string dump; - + dump += "IMPORTANT NOTE: This sql queries not created for apply directly, use '.pdump load' command in console or client chat instead.\n"; dump += "IMPORTANT NOTE: NOT APPLY ITS DIRECTLY to character DB or you will DAMAGE and CORRUPT character DB\n\n"; diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 7a58ff929..3a3106562 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -906,7 +906,7 @@ void Spell::EffectDummy(uint32 i) case 23448: // Transporter Arrival - Ultrasafe Transporter: Gadgetzan - backfires { int32 r = irand(0, 119); - if ( r < 20 ) // Transporter Malfunction - 1/6 polymorph + if ( r < 20 ) // Transporter Malfunction - 1/6 polymorph m_caster->CastSpell(m_caster, 23444, true); else if ( r < 100 ) // Evil Twin - 4/6 evil twin m_caster->CastSpell(m_caster, 23445, true); @@ -1131,13 +1131,13 @@ void Spell::EffectDummy(uint32 i) m_caster->CastSpell(m_caster, 45088, true); return; } - case 55004: // Nitro Boosts - if(!m_CastItem) return; - if(roll_chance_i(95)) // Nitro Boosts - success - m_caster->CastSpell(m_caster, 54861, true, m_CastItem); - else // Knocked Up - backfire 5% - m_caster->CastSpell(m_caster, 46014, true, m_CastItem); - return; + case 55004: // Nitro Boosts + if(!m_CastItem) return; + if(roll_chance_i(95)) // Nitro Boosts - success + m_caster->CastSpell(m_caster, 54861, true, m_CastItem); + else // Knocked Up - backfire 5% + m_caster->CastSpell(m_caster, 46014, true, m_CastItem); + return; case 50243: // Teach Language { if(m_caster->GetTypeId() != TYPEID_PLAYER) diff --git a/src/game/SpellHandler.cpp b/src/game/SpellHandler.cpp index 373f76489..0f1c1c3ce 100644 --- a/src/game/SpellHandler.cpp +++ b/src/game/SpellHandler.cpp @@ -133,11 +133,11 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) // send spell error if (SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellid)) { - // for implicit area/coord target spells + // for implicit area/coord target spells if (IsPointEffectTarget(Targets(spellInfo->EffectImplicitTargetA[0])) || IsAreaEffectTarget(Targets(spellInfo->EffectImplicitTargetA[0]))) Spell::SendCastResult(_player,spellInfo,cast_count,SPELL_FAILED_NO_VALID_TARGETS); - // for explicit target spells + // for explicit target spells else Spell::SendCastResult(_player,spellInfo,cast_count,SPELL_FAILED_BAD_TARGETS); } diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index feea934a5..af32a2756 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8220" + #define REVISION_NR "8221" #endif // __REVISION_NR_H__ diff --git a/src/shared/vmap/TileAssembler.cpp b/src/shared/vmap/TileAssembler.cpp index 89afe2df7..99bb2a4cd 100644 --- a/src/shared/vmap/TileAssembler.cpp +++ b/src/shared/vmap/TileAssembler.cpp @@ -241,7 +241,7 @@ namespace VMAP char destnamebuffer[500]; char fullnamedestnamebuffer[500]; - + if(nameCollection.iMainFiles.size() >0) { sprintf(destnamebuffer,"%03u_%i_%i.vmap",pMapId, pYPos, pXPos); // flip it here too From e612d0778afc5f492fb8750b52993d36258f71e0 Mon Sep 17 00:00:00 2001 From: freghar Date: Mon, 20 Jul 2009 19:33:14 +0200 Subject: [PATCH 31/34] [8222] Partial EventAI.txt rewrite, typo and language fixes Signed-off-by: freghar --- doc/EventAI.txt | 179 ++++++++++++++++++++------------------- src/shared/revision_nr.h | 2 +- 2 files changed, 93 insertions(+), 88 deletions(-) diff --git a/doc/EventAI.txt b/doc/EventAI.txt index 07d90feff..7434a7adf 100644 --- a/doc/EventAI.txt +++ b/doc/EventAI.txt @@ -1,140 +1,145 @@ ============================================= -EventAI documentation: (Updated May 19, 2009) +EventAI documentation: (updated May 19, 2009) ============================================= EventAI allows users to create new creature scripts entierly within the database. For the AI to be used, you must first make sure to set AIname for each creature that should use this AI. - UPDATE creature_template SET AIName = 'EventAI' WHERE entry IN (...); + ========================================= -Basic Structure of EventAI +Basic structure of EventAI ========================================= + EventAI follows a basic if (Event) then do (Action) format. -Below is a the list of current fields within the creature_ai_scripts table. +Below is the list of current fields of the creature_ai_scripts table. -(Field_Name Discription) -id This value is mearly an incrementing counter of the current Event number. Required for sql queries. -creature_id Creature id which this event should occur on. +(Field_Name) (Description) +id This value is merely an incrementing counter of the current Event number. Required for sql queries. +creature_id Creature id which should trigger this event. -event_type Type of event (See Event Types below) -event_inverse_phase_mask Mask which phases this event should NOT trigger in* -event_chance Percent chance of this event occuring (1 - 100) -event_flags Event flags such as if the event is repeatable (see below) -event_param1 Variable for event (dependant on Event type) +event_type The type of event (see "Event types" below) +event_inverse_phase_mask Mask with phases this event should NOT trigger in* +event_chance Percentage chance of triggering the event (1 - 100) +event_flags Event flags (repeatable, ... (see below)) +event_param1 Variables for the event (depends on event_type) event_param2 event_param3 event_param4 -action1_type First Type of Action to take when event occurs (See Action Types below) -action1_param1 Variables used for Action1 (dependant on Action type) +action1_type An action to take when the event occurs (see "Action types" below) +action1_param1 Variables used by Action1 (depends on action_type) action1_param2 action1_param3 -action2_type Second Type of Action to take when event occurs (See Action Types below) -action2_param1 Variables used for Action2 (dependant on Action type) +action2_type +action2_param1 action2_param2 action2_param3 -action3_type Third Type of Action to take when event occurs (See Action Types below) -action3_param1 Variables used for Action3 (dependant on Action type) +action3_type +action3_param1 action3_param2 action3_param3 -All params are signed 32 bit values (+/- 2147483647). If param specifies time then time is in milliseconds. -If param specifies percentage then percentages are value/100 (ex: if param = 500 then that means 500%, -50 = -50%) +All params are signed 32-bit values (+/- 2147483647). Time values are always in milliseconds. +In case of a percentage value, use value/100 (ie. param = 500 then that means 500%, -50 = -50%) + +[*] Phase mask is a bitmask of phases which shouldn't trigger this event. (ie. Phase mask of value 12 (binary 1100) results in triggering this event in phases 0, 1 and all others with exception for phases 2 and 3 (counting from 0). -*Phase mask is a bit mask of which phases this event should not trigger in. Example: Phase mask value of 12 (1100) -would mean that this event would trigger 0, 1 and all other phases except for 2 and 3 (0 counts as the first phase). ========================================= -Event Types +Event types ========================================= -Below is the list of current Event types that EventAI can handle. + +A list of event types EventAI is able to handle. Each event type has its own specific interpretation of the params that accompany it. -Params are always read from Param1, then Param2, then Param3. -Events will not repeat until the creature exits combat unless EFLAG_REPEATABLE is set. +Params are always read in the ascending order (from Param1 to Param3). +Events will not repeat until the creature exits combat or unless EFLAG_REPEATABLE is set. Some events such as EVENT_T_AGGRO, EVENT_T_DEATH, EVENT_T_SPAWNED, and EVENT_T_EVADE cannot repeat. -# Internal Name Pamarm usage Description +# Internal name Param usage Description ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only in combat. -1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires first between (Param1) and (Param2) and then between every (Param3) and (Param4). but only out of combat. +0 EVENT_T_TIMER InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then between every (Param3) and (Param4), but only in combat. +1 EVENT_T_TIMER_OOC InitialMin, InitialMax, RepeatMin, RepeatMax Expires at first between (Param1) and (Param2) and then between every (Param3) and (Param4), but only out of combat. 2 EVENT_T_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). 3 EVENT_T_MANA ManaMax%,ManaMin% RepeatMin, RepeatMax Expires once Mana% is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). 4 EVENT_T_AGGRO NONE Expires upon initial aggro (does not repeat). -5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between every (Param1) and (Param2). -6 EVENT_T_DEATH NONE Expires upon Death of the Creature. +5 EVENT_T_KILL RepeatMin, RepeatMax Expires upon killing a player. Will repeat between (Param1) and (Param2). +6 EVENT_T_DEATH NONE Expires upon creature death. 7 EVENT_T_EVADE NONE Expires upon creature EnterEvadeMode(). -8 EVENT_T_SPELLHIT SpellID, Schoolmask, RepeatMin, RepeatMax Expires upon Spell hit. If (param1) is set will only expire on that spell. If (param2) will only expire on spells of the selected schools (-1 for all). Will repeat every (Param3) and (Param4) . -9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4) . -10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a Unit moves within distance(MaxAllowedRange) to creature. If Param1=0 it will expire if Unit are Hostile. If Param1=1 it will only expire if Unit are not Hostile(generally determined by faction). Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat. -11 EVENT_T_SPAWNED NONE Expires at initial spawn and at creature respawn (useful for setting ranged movement type) -12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when Current Target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4) . -13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2) . -14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (param1) hp missing. Will repeat every (Param3) and (Param4) . -15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is Crowd controlled within the given radius (param2). Will repeat every (Param3) and (Param4) . -16 EVENT_T_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax Expires when a friendly unit is missing aura's given by spell (param1) within radius (param2). Will repeat every (Param3) and (Param4) . -17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (param1) is spawned or for all spawns if param1 = 0. Will repeat every (Param2) and (Param3). +8 EVENT_T_SPELLHIT SpellID, Schoolmask, RepeatMin, RepeatMax Expires upon a spell hit. When (param1) is set, it will be used as a trigger. With (param2) specified, the expiration is limited to specific spell schools (-1 for all). Will repeat every (Param3) and (Param4). +9 EVENT_T_RANGE MinDist, MaxDist, RepeatMin, RepeatMax Expires when the highest threat target distance is greater than (Param1) and less than (Param2). Will repeat every (Param3) and (Param4). +10 EVENT_T_OOC_LOS Hostile-or-Not, MaxAllowedRange, RepeatMin, RepeatMax Expires when a unit moves within distance (MaxAllowedRange) of a creature. If (Param1) is zero it will expire only when unit is hostile, friendly otherwise (Param1 = 1), depends generally on faction. Will repeat every (Param3) and (Param4). Does not expire when the creature is in combat. +11 EVENT_T_SPAWNED NONE Expires on initial spawn and on creature respawn (useful for setting ranged movement type). +12 EVENT_T_TARGET_HP HPMax%, HPMin%, RepeatMin, RepeatMax Expires when current target's HP is between (Param1) and (Param2). Will repeat every (Param3) and (Param4). +13 EVENT_T_TARGET_CASTING RepeatMin, RepeatatMax Expires when the current target is casting a spell. Will repeat every (Param1) and (Param2). +14 EVENT_T_FRIENDLY_HP HPDeficit, Radius, RepeatMin, RepeatMax Expires when a friendly unit in radius has at least (Param1) HP missing. Will repeat every (Param3) and (Param4). +15 EVENT_T_FRIENDLY_IS_CC DispelType, Radius, RepeatMin, RepeatMax Expires when a friendly unit is crowd controlled within the given radius (Param2). Will repeat every (Param3) and (Param4). +16 EVENT_T_MISSING_BUFF SpellId, Radius, RepeatMin, RepeatMax Expires when a friendly unit is missing aura(s) given by a spell (Param1) within radius (Param2). Will repeat every (Param3) and (Param4). +17 EVENT_T_SUMMONED_UNIT CreatureId, RepeatMin, RepeatMax Expires after creature with entry = (Param1) is spawned (Param1 = 0 means all spawns). Will repeat every (Param2) and (Param3). 18 EVENT_T_TARGET_MANA ManaMax%, ManaMin%, RepeatMin, RepeatMax -21 EVENT_T_REACHED_HOME NONE Expires when creature reach it's home(spawn) location after Evade. -22 EVENT_T_RECEIVE_EMOTE EmoteId, Condition, CondValue1, CondValue2 Expires when creature receive emote with text emote id(enum TextEmotes). Condition can be defined. If set, then most conditions has additional value (see enum ConditionType) -23 EVENT_T_BUFFED SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when creature have spell (Param1) auras applied stack greater or equal provided in Param2 amount. Will repeat every (Param3) and (Param4). -24 EVENT_T_TARGET_BUFFED SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when target unit have spell (Param1) auras applied stack greater or equal provided in Param2 amount. Will repeat every (Param3) and (Param4). +21 EVENT_T_REACHED_HOME NONE Expires when a creature reach it's home(spawn) location after evade. +22 EVENT_T_RECEIVE_EMOTE EmoteId, Condition, CondValue1, CondValue2 Expires when a creature receives an emote with emote text id (enum TextEmotes) in (Param1). Conditions can be defined (Param2) with optional values (Param3,Param4), see enum ConditionType. +23 EVENT_T_BUFFED SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a creature has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4). +24 EVENT_T_TARGET_BUFFED SpellID, AmmountInStack, RepeatMin, RepeatMax Expires when a target unit has spell (Param1) auras applied in a stack greater or equal to value provided in (Param2). Will repeat every (Param3) and (Param4). + ========================================= Action Types ========================================= -Below is the list of current Action types that EventAI can handle. -Each event type has its own specific interpretation of the params that accompany it. -Params are always read from Param1, then Param2, then Param3. -(# Internal Name Param usage Discription) -0 ACTION_T_NONE No Action Does Nothing -1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Displays the -TextId as defined. In case -TextId2 and optionally -TextId3, the output will be randomized. Type text are defined in the text table itself(say, yell, whisper, etc) along with other options for the text. All values are required to be negative. -2 ACTION_T_SET_FACTION FactionId Change faction for creature. If param1==0, creature will revert to default faction. -3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set model from creature_template.entry(param1) OR set explicit modelId(param2). If param1 AND param2 both 0, demorph and revert to default model for creature. -4 ACTION_T_SOUND SoundId Plays Sound -5 ACTION_T_EMOTE EmoteId Does emote +A list of action types that EventAI can handle. +Each event type has its own specific interpretation of it's params, like every event type. + +# Internal name Param usage Description +------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +0 ACTION_T_NONE No Action Does nothing. +1 ACTION_T_TEXT -TextId1, -TextId2, -TextId3 Simply displays the specified -TextId. When -TextId2 and -TextId3 are specified, the selection will be randomized. Text types are defined, along with other options for the text, in a table below. All values needs to be negative. +2 ACTION_T_SET_FACTION FactionId Changes faction for a creature. When param1 is zero, creature will revert to it's default faction. +3 ACTION_T_MORPH_TO_ENTRY_OR_MODEL CreatureEntry, ModelId Set either model from creature_template.entry (Param1) OR explicit modelId (Param2). If (Param1) AND (Param2) are both 0, demorph and revert to the default model. +4 ACTION_T_SOUND SoundId Plays a sound +5 ACTION_T_EMOTE EmoteId Does an emote 6 ACTION_T_RANDOM_SAY UNUSED 7 ACTION_T_RANDOM_YELL UNUSED 8 ACTION_T_RANDOM_TEXTEMOTE UNUSED -9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays random sound between 3 params* -10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes random emote between 3 params -11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (param1) on target type (param2). Uses Cast Flags (specified below target types) -12 ACTION_T_SUMMON CreatureID, Target, Duration Summons creature (param1) to attack target (param2) for (param3) duration. Spawns on top of current creature. -13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies threat by (param1) on target type (param2) -14 ACTION_T_THREAT_ALL_PCT Threat% Modifies threat by (param1) on all targets (using -100% on all will result in full aggro dump) -15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (param1) for target type (Param2) -16 ACTION_T_QUEST_CASTCREATUREGO CreatureID, SpellId, Target Sends CastCreatureOrGo for CreatureId (param1) with SpellId (param2) for target (param3) -17 ACTION_T_SET_UNIT_FIELD Field_Number, Value, Target Sets Unit Field (param1) to Value (param2) on target type (param3) -18 ACTION_T_SET_UNIT_FLAG Flags, Target Sets flag (flags can be binary OR together to modify multiple flags at once) on for Target type (param2) -19 ACTION_T_REMOVE_UNIT_FLAG Flags, Target Removes flag (flags can be binary OR together to modify multiple flags at once) on for Target type (param2) -20 ACTION_T_AUTO_ATTACK AllowAutoAttack 0 = stop melee attack, anything else means continue attacking/allow melee attacking -21 ACTION_T_COMBAT_MOVEMENT AllowCombatMovement 0 = stop combat based movement, anything else continue/allow combat based movement (targeted movement generator) -22 ACTION_T_SET_PHASE Phase Sets the current phase to (param1) -23 ACTION_T_INC_PHASE Value Increments the phase by (param1). May be negative to decrement phase but should not be 0. -24 ACTION_T_EVADE No Params Forces the creature to evade. Wiping all threat and dropping combat. -25 ACTION_T_FLEE_FOR_ASSIST No Params Causes the creature to flee for assistence (at low helth mostly). -26 ACTION_T_QUEST_EVENT_ALL QuestId Calls GroupEventHappens with (param1). Only used if it's _expected_ event should complete for all players in current party -27 ACTION_T_CASTCREATUREGO_ALL QuestId, SpellId Calls CastedCreatureOrGo for all players on the threat list with QuestID(Param1) and SpellId(Param2) -28 ACTION_T_REMOVEAURASFROMSPELL Target, Spellid Removes all auras on Target caused by Spellid -29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator type to a ranged type. Note: Default melee type can still be done with this. Specify 0 angle and 0 distance. -30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets the phase to the id between 3 params* -31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets the phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin. -32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons creature (param1) to attack target (param2) at location specified by EventAI_Summons (param3). -33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (param1) for target of type (param2) -34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (param1) and data (param2) -35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (param1) and data (param2) target's GUID. -36 ACTION_T_UPDATE_TEMPLATE TemplateId, Team Changes the creature to a new creature template of (param1) with team = Alliance if (param2) = false or Horde if (param2) = true +9 ACTION_T_RANDOM_SOUND SoundId1, SoundId2, SoundId3 Plays a random sound * +10 ACTION_T_RANDOM_EMOTE EmoteId1, EmoteId2, EmoteId3 Emotes a random emote +11 ACTION_T_CAST SpellId, Target, CastFlags Casts spell (Param1) on a target (Param2) using cast flags (specified below). +12 ACTION_T_SUMMON CreatureID, Target, Duration Summons a creature (Param1) for (Param3) duration and orders it to attach (Param2) target. Spawns on top of current creature. +13 ACTION_T_THREAT_SINGLE_PCT Threat%, Target Modifies a threat by (Param1) percent on a target (Param2). +14 ACTION_T_THREAT_ALL_PCT Threat% Modifies a threat by (Param1) on all targets in the threat list (using -100% here will result in full aggro dump). +15 ACTION_T_QUEST_EVENT QuestID, Target Calls AreaExploredOrEventHappens with (Param1) for a target in (Param2). +16 ACTION_T_QUEST_CASTCREATUREGO CreatureID, SpellId, Target Sends CastCreatureOrGo for a creature specified by CreatureId (Param1) with provided spell id (Param2) for a target in (Param3). +17 ACTION_T_SET_UNIT_FIELD Field_Number, Value, Target Sets a unit field (Param1) to provided value (Param2) on a target in (Param3). +18 ACTION_T_SET_UNIT_FLAG Flags, Target Sets flag (flags can be used together to modify multiple flags at once) on a target (Param2). +19 ACTION_T_REMOVE_UNIT_FLAG Flags, Target Removes flag on a target (Param2). +20 ACTION_T_AUTO_ATTACK AllowAutoAttack Stop melee attack when (Param1) is zero, otherwise continue attacking / allow melee attack. +21 ACTION_T_COMBAT_MOVEMENT AllowCombatMovement Stop combat based movement when (Param1) is zero, otherwise continue/allow combat based movement (targeted movement generator). +22 ACTION_T_SET_PHASE Phase Sets the current phase to (Param1). +23 ACTION_T_INC_PHASE Value Increments the phase by (Param1). May be negative to decrement, but should not be zero. +24 ACTION_T_EVADE No Params Forces the creature to evade, wiping all threat and dropping combat. +25 ACTION_T_FLEE_FOR_ASSIST No Params Causes the creature to flee for assistence (often at low health). +26 ACTION_T_QUEST_EVENT_ALL QuestId Calls GroupEventHappens with (Param1). Only used if it's _expected_ event should call quest completion for all players in a current party. +27 ACTION_T_CASTCREATUREGO_ALL QuestId, SpellId Calls CastedCreatureOrGo for all players on the threat list with quest id specified in (Param1) and spell id in (Param2). +28 ACTION_T_REMOVEAURASFROMSPELL Target, Spellid Removes all auras on a target (Param1) caused by a spell (Param2). +29 ACTION_T_RANGED_MOVEMENT Distance, Angle Changes the movement generator to a ranged type. (note: default melee type can still be set by using 0 as angle and 0 as distance). +30 ACTION_T_RANDOM_PHASE PhaseId1, PhaseId2, PhaseId3 Sets a phase to a specified id(s)* +31 ACTION_T_RANDOM_PHASE_RANGE PhaseMin, PhaseMax Sets a phase to a random id (Phase = PhaseMin + rnd % PhaseMin-PhaseMax). PhaseMax must be greater than PhaseMin. +32 ACTION_T_SUMMON CreatureID, Target, SummonID Summons a creature (Param1) to attack target (Param2) at location specified by EventAI_Summons (Param3). +33 ACTION_T_KILLED_MONSTER CreatureID, Target Calls KilledMonster (Param1) for a target (Param2). +34 ACTION_T_SET_INST_DATA Field, Data Calls ScriptedInstance::SetData with field (Param1) and data (Param2). +35 ACTION_T_SET_INST_DATA64 Field, Target Calls ScriptedInstance::SetData64 with field (Param1) and target's GUID (Param2). +36 ACTION_T_UPDATE_TEMPLATE TemplateId, Team Changes a creature's template to (Param1) with team = Alliance or Horde when (Param2) is either false or true respectively. 37 ACTION_T_DIE No Params Kills the creature -38 ACTION_T_ZONE_COMBAT_PULSE No Params Places all players within the instance into combat with the creature. Only works in combat and only works inside of instances. -39 ACTION_T_CALL_FOR_HELP Radius Call any friendly creatures (if its not in combat/etc) in radius attack creature target. -40 ACTION_T_SET_SHEATH Sheath Let set sheath state for creature (0-no weapon show (not used mostly by creatures), 1-melee weapon show, 2-ranged weapon show) +38 ACTION_T_ZONE_COMBAT_PULSE No Params Puts all players within an instance into combat with the creature. Only works when a creature is already in combat. Doesn't work outside instances. +39 ACTION_T_CALL_FOR_HELP Radius Call any friendly out-of-combat creatures in a radius (Param1) to attack current creature's target. +40 ACTION_T_SET_SHEATH Sheath Sets sheath state for a creature (0 = no weapon, 1 = melee weapon, 2 = ranged weapon). 41 ACTION_T_FORCE_DESPAWN No Params Despawns the creature -* = Use -1 to specify that if this param is picked to do nothing. Random is constant between actions within an event. So if you have a random Yell and a random Sound they will match up (ex: param2 with param2) +* = Use -1 where the param is expected to do nothing. Random constant is generated for each event, so if you have a random yell and a random sound, they will be linked up with each other (ie. param2 with param2). + ========================================= Event Types diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index af32a2756..cfee92a2f 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8221" + #define REVISION_NR "8222" #endif // __REVISION_NR_H__ From e16a784ae8dab83f2acd502f937a5da362610dfc Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 21 Jul 2009 01:22:51 +0400 Subject: [PATCH 32/34] [8223] Simplify code for AURA_STATE_CONFLAGRATE remove at aura remove. --- src/game/SpellAuras.cpp | 23 +++++------------------ src/shared/revision_nr.h | 2 +- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index b791240c6..21a6b3098 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1086,6 +1086,7 @@ void Aura::_RemoveAura() uint32 removeState = 0; uint64 removeFamilyFlag = m_spellProto->SpellFamilyFlags; + uint32 removeFamilyFlag2 = m_spellProto->SpellFamilyFlags2; switch(m_spellProto->SpellFamilyName) { case SPELLFAMILY_PALADIN: @@ -1097,23 +1098,9 @@ void Aura::_RemoveAura() if ((m_spellProto->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || (m_spellProto->SpellFamilyFlags2 & 0x00000002)) { - // it can have both from same caster or same effect from different casters - bool removeAuraState=true; - Unit::AuraList const& dotList = m_target->GetAurasByType(SPELL_AURA_PERIODIC_DAMAGE); - for(Unit::AuraList::const_iterator i = dotList.begin(); i != dotList.end(); ++i) - { - if ((*i)->GetSpellProto()->SpellFamilyName == SPELLFAMILY_WARLOCK && - // Immolate - (((*i)->GetSpellProto()->SpellFamilyFlags & UI64LIT(0x0000000000000004)) || - // Shadowflame - ((*i)->GetSpellProto()->SpellFamilyFlags2 & 0x00000002))) - { - removeAuraState=false; - break; - } - } - if(removeAuraState) - removeState = AURA_STATE_CONFLAGRATE; + removeFamilyFlag = UI64LIT(0x0000000000000004); + removeFamilyFlag2 = 0x00000002; + removeState = AURA_STATE_CONFLAGRATE; } break; case SPELLFAMILY_DRUID: @@ -1147,7 +1134,7 @@ void Aura::_RemoveAura() { SpellEntry const *auraSpellInfo = (*i).second->GetSpellProto(); if(auraSpellInfo->SpellFamilyName == m_spellProto->SpellFamilyName && - auraSpellInfo->SpellFamilyFlags & removeFamilyFlag) + (auraSpellInfo->SpellFamilyFlags & removeFamilyFlag || auraSpellInfo->SpellFamilyFlags2 & removeFamilyFlag2)) { found = true; break; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index cfee92a2f..c3eb74a96 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8222" + #define REVISION_NR "8223" #endif // __REVISION_NR_H__ From b7389d2a20fc9ebecd058f0eac0f3d181e814366 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 21 Jul 2009 01:36:53 +0400 Subject: [PATCH 33/34] [8224] Small uint64 defines cleanup. --- src/game/SpellMgr.h | 15 ++++++++------- src/shared/revision_nr.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/game/SpellMgr.h b/src/game/SpellMgr.h index caeb8b8cd..d167d9988 100644 --- a/src/game/SpellMgr.h +++ b/src/game/SpellMgr.h @@ -68,15 +68,16 @@ enum SpellFamilyNames }; //Some SpellFamilyFlags -#define SPELLFAMILYFLAG_ROGUE_VANISH UI64LIT(0x000000800) -#define SPELLFAMILYFLAG_ROGUE_STEALTH UI64LIT(0x000400000) -#define SPELLFAMILYFLAG_ROGUE_BACKSTAB UI64LIT(0x000800004) -#define SPELLFAMILYFLAG_ROGUE_SAP UI64LIT(0x000000080) -#define SPELLFAMILYFLAG_ROGUE_FEINT UI64LIT(0x008000000) -#define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT UI64LIT(0x000200000) -#define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE UI64LIT(0x9003E0000) +#define SPELLFAMILYFLAG_ROGUE_VANISH UI64LIT(0x0000000000000800) +#define SPELLFAMILYFLAG_ROGUE_STEALTH UI64LIT(0x0000000000400000) +#define SPELLFAMILYFLAG_ROGUE_BACKSTAB UI64LIT(0x0000000000800004) +#define SPELLFAMILYFLAG_ROGUE_SAP UI64LIT(0x0000000000000080) +#define SPELLFAMILYFLAG_ROGUE_FEINT UI64LIT(0x0000000008000000) +#define SPELLFAMILYFLAG_ROGUE_KIDNEYSHOT UI64LIT(0x0000000000200000) +#define SPELLFAMILYFLAG_ROGUE__FINISHING_MOVE UI64LIT(0x00000009003E0000) #define SPELLFAMILYFLAG_PALADIN_SEALS UI64LIT(0x26000C000A000000) + // Spell clasification enum SpellSpecific { diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c3eb74a96..857f9a9b5 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8223" + #define REVISION_NR "8224" #endif // __REVISION_NR_H__ From a0efd034cada5e70276c4ee87306399b517b2094 Mon Sep 17 00:00:00 2001 From: tomrus88 Date: Tue, 21 Jul 2009 04:11:45 +0400 Subject: [PATCH 34/34] [8225] Some fixes from 320 branch. (backported from commit 4bdcf42) Signed-off-by: VladimirMangos --- src/game/Object.cpp | 37 ++++++++++++++++++++++--------------- src/game/Object.h | 2 +- src/game/Opcodes.cpp | 2 +- src/game/Opcodes.h | 6 +++--- src/game/Player.cpp | 36 +++++++++++++++++++++++++++--------- src/game/Player.h | 19 ++++++++++--------- src/game/SpellEffects.cpp | 10 ++++------ src/game/Totem.cpp | 26 ++++++++++++++------------ src/game/Unit.cpp | 4 ++-- src/shared/revision_nr.h | 2 +- 10 files changed, 85 insertions(+), 59 deletions(-) diff --git a/src/game/Object.cpp b/src/game/Object.cpp index f966e025c..e370e4be7 100644 --- a/src/game/Object.cpp +++ b/src/game/Object.cpp @@ -240,13 +240,13 @@ void Object::BuildOutOfRangeUpdateBlock(UpdateData * data) const data->AddOutOfRangeGUID(GetGUID()); } -void Object::DestroyForPlayer(Player *target) const +void Object::DestroyForPlayer( Player *target, bool anim ) const { ASSERT(target); WorldPacket data(SMSG_DESTROY_OBJECT, 8); data << uint64(GetGUID()); - data << uint8(0); // WotLK (bool) + data << uint8(anim ? 1 : 0); // WotLK (bool), may be despawn animation target->GetSession()->SendPacket( &data ); } @@ -314,7 +314,14 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags, uint32 flags2 *data << (uint32)((Player*)this)->GetTransTime(); *data << (int8)((Player*)this)->GetTransSeat(); } - //MaNGOS currently not have support for other than player on transport + else + { + //MaNGOS currently not have support for other than player on transport + *data << uint8(0); + *data << float(0) << float(0) << float(0) << float(0); + *data << uint32(0); + *data << uint8(-1); + } } // 0x02200000 @@ -803,7 +810,7 @@ void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const void Object::SetInt32Value( uint16 index, int32 value ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(m_int32Values[ index ] != value) { @@ -822,7 +829,7 @@ void Object::SetInt32Value( uint16 index, int32 value ) void Object::SetUInt32Value( uint16 index, uint32 value ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(m_uint32Values[ index ] != value) { @@ -841,7 +848,7 @@ void Object::SetUInt32Value( uint16 index, uint32 value ) void Object::SetUInt64Value( uint16 index, const uint64 &value ) { - ASSERT( index + 1 < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index + 1 < m_valuesCount || PrintIndexError( index, true ) ); if(*((uint64*)&(m_uint32Values[ index ])) != value) { m_uint32Values[ index ] = *((uint32*)&value); @@ -860,7 +867,7 @@ void Object::SetUInt64Value( uint16 index, const uint64 &value ) void Object::SetFloatValue( uint16 index, float value ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(m_floatValues[ index ] != value) { @@ -879,7 +886,7 @@ void Object::SetFloatValue( uint16 index, float value ) void Object::SetByteValue( uint16 index, uint8 offset, uint8 value ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(offset > 4) { @@ -905,7 +912,7 @@ void Object::SetByteValue( uint16 index, uint8 offset, uint8 value ) void Object::SetUInt16Value( uint16 index, uint8 offset, uint16 value ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(offset > 2) { @@ -979,7 +986,7 @@ void Object::ApplyModPositiveFloatValue(uint16 index, float val, bool apply) void Object::SetFlag( uint16 index, uint32 newFlag ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); uint32 oldval = m_uint32Values[ index ]; uint32 newval = oldval | newFlag; @@ -1000,7 +1007,7 @@ void Object::SetFlag( uint16 index, uint32 newFlag ) void Object::RemoveFlag( uint16 index, uint32 oldFlag ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); uint32 oldval = m_uint32Values[ index ]; uint32 newval = oldval & ~oldFlag; @@ -1021,7 +1028,7 @@ void Object::RemoveFlag( uint16 index, uint32 oldFlag ) void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(offset > 4) { @@ -1046,7 +1053,7 @@ void Object::SetByteFlag( uint16 index, uint8 offset, uint8 newFlag ) void Object::RemoveByteFlag( uint16 index, uint8 offset, uint8 oldFlag ) { - ASSERT( index < m_valuesCount || PrintIndexError( index , true ) ); + ASSERT( index < m_valuesCount || PrintIndexError( index, true ) ); if(offset > 4) { @@ -1354,7 +1361,7 @@ bool WorldObject::HasInArc(const float arcangle, const WorldObject* obj) const void WorldObject::GetRandomPoint( float x, float y, float z, float distance, float &rand_x, float &rand_y, float &rand_z) const { - if(distance==0) + if(distance == 0) { rand_x = x; rand_y = y; @@ -1558,7 +1565,7 @@ void WorldObject::SendMessageToSetInRange(WorldPacket *data, float dist, bool /* void WorldObject::SendObjectDeSpawnAnim(uint64 guid) { WorldPacket data(SMSG_GAMEOBJECT_DESPAWN_ANIM, 8); - data << guid; + data << uint64(guid); SendMessageToSet(&data, true); } diff --git a/src/game/Object.h b/src/game/Object.h index 8cb44e0c1..1a697fe1d 100644 --- a/src/game/Object.h +++ b/src/game/Object.h @@ -151,7 +151,7 @@ class MANGOS_DLL_SPEC Object void BuildMovementUpdateBlock( UpdateData * data, uint32 flags = 0 ) const; void BuildUpdate(UpdateDataMapType &); - virtual void DestroyForPlayer( Player *target ) const; + virtual void DestroyForPlayer( Player *target, bool anim = false ) const; const int32& GetInt32Value( uint16 index ) const { diff --git a/src/game/Opcodes.cpp b/src/game/Opcodes.cpp index 51eb509d0..b19c5fea5 100644 --- a/src/game/Opcodes.cpp +++ b/src/game/Opcodes.cpp @@ -1023,7 +1023,7 @@ OpcodeHandler opcodeTable[NUM_MSG_TYPES] = /*0x3E2*/ { "SMSG_COMSAT_CONNECT_FAIL", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x3E3*/ { "SMSG_VOICE_CHAT_STATUS", STATUS_NEVER, &WorldSession::Handle_ServerSide }, /*0x3E4*/ { "CMSG_REPORT_PVP_AFK", STATUS_LOGGEDIN, &WorldSession::HandleReportPvPAFK }, - /*0x3E5*/ { "CMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL }, + /*0x3E5*/ { "SMSG_REPORT_PVP_AFK_RESULT", STATUS_NEVER, &WorldSession::Handle_NULL }, /*0x3E6*/ { "CMSG_GUILD_BANKER_ACTIVATE", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankerActivate }, /*0x3E7*/ { "CMSG_GUILD_BANK_QUERY_TAB", STATUS_LOGGEDIN, &WorldSession::HandleGuildBankQueryTab }, /*0x3E8*/ { "SMSG_GUILD_BANK_LIST", STATUS_NEVER, &WorldSession::Handle_ServerSide }, diff --git a/src/game/Opcodes.h b/src/game/Opcodes.h index bc6c8ea59..df6a88fa9 100644 --- a/src/game/Opcodes.h +++ b/src/game/Opcodes.h @@ -692,8 +692,8 @@ enum Opcodes CMSG_GROUP_ASSISTANT_LEADER = 0x28F, CMSG_BUYBACK_ITEM = 0x290, SMSG_SERVER_MESSAGE = 0x291, - CMSG_MEETINGSTONE_JOIN = 0x292, - CMSG_MEETINGSTONE_LEAVE = 0x293, // SMSG? + CMSG_MEETINGSTONE_JOIN = 0x292, // lua: SetSavedInstanceExtend + SMSG_MEETINGSTONE_LEAVE = 0x293, CMSG_MEETINGSTONE_CHEAT = 0x294, SMSG_MEETINGSTONE_SETQUEUE = 0x295, CMSG_MEETINGSTONE_INFO = 0x296, @@ -1031,7 +1031,7 @@ enum Opcodes SMSG_COMSAT_CONNECT_FAIL = 0x3E2, SMSG_VOICE_CHAT_STATUS = 0x3E3, CMSG_REPORT_PVP_AFK = 0x3E4, - CMSG_REPORT_PVP_AFK_RESULT = 0x3E5, + SMSG_REPORT_PVP_AFK_RESULT = 0x3E5, // SMSG? CMSG_GUILD_BANKER_ACTIVATE = 0x3E6, CMSG_GUILD_BANK_QUERY_TAB = 0x3E7, SMSG_GUILD_BANK_LIST = 0x3E8, diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 1429ec489..9673a226e 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -3760,9 +3760,9 @@ void Player::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) Unit::BuildCreateUpdateBlockForPlayer( data, target ); } -void Player::DestroyForPlayer( Player *target ) const +void Player::DestroyForPlayer( Player *target, bool anim ) const { - Unit::DestroyForPlayer( target ); + Unit::DestroyForPlayer( target, anim ); for(int i = 0; i < INVENTORY_SLOT_BAG_END; ++i) { @@ -10367,7 +10367,6 @@ Item* Player::EquipNewItem( uint16 pos, uint32 item, bool update ) Item* Player::EquipItem( uint16 pos, Item *pItem, bool update ) { - AddEnchantmentDurations(pItem); AddItemDurations(pItem); @@ -16193,10 +16192,10 @@ void Player::SendAttackSwingBadFacingAttack() GetSession()->SendPacket( &data ); } -void Player::SendAutoRepeatCancel() +void Player::SendAutoRepeatCancel(Unit *target) { - WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, GetPackGUID().size()); - data.append(GetPackGUID()); // may be it's target guid + WorldPacket data(SMSG_CANCEL_AUTO_REPEAT, target->GetPackGUID().size()); + data.append(target->GetPackGUID()); // may be it's target guid GetSession()->SendPacket( &data ); } @@ -17926,7 +17925,7 @@ void Player::UpdateVisibilityOf(WorldObject* target) { if(HaveAtClient(target)) { - if(!target->isVisibleForInState(this,true)) + if(!target->isVisibleForInState(this, true)) { target->DestroyForPlayer(this); m_clientGUIDs.erase(target->GetGUID()); @@ -19538,11 +19537,30 @@ bool Player::HasTitle(uint32 bitIndex) return HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag); } -void Player::SetTitle(CharTitlesEntry const* title) +void Player::SetTitle(CharTitlesEntry const* title, bool lost) { uint32 fieldIndexOffset = title->bit_index / 32; uint32 flag = 1 << (title->bit_index % 32); - SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag); + + if(lost) + { + if(!HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag)) + return; + + RemoveFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag); + } + else + { + if(HasFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag)) + return; + + SetFlag(PLAYER__FIELD_KNOWN_TITLES + fieldIndexOffset, flag); + } + + WorldPacket data(SMSG_TITLE_EARNED, 4 + 4); + data << uint32(title->bit_index); + data << uint32(lost ? 0 : 1); // 1 - earned, 0 - lost + GetSession()->SendPacket(&data); } void Player::ConvertRune(uint8 index, uint8 newType) diff --git a/src/game/Player.h b/src/game/Player.h index 626751143..96a08f202 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -135,11 +135,12 @@ enum ActionButtonUpdateState enum ActionButtonType { - ACTION_BUTTON_SPELL = 0, - ACTION_BUTTON_EQSET = 32, - ACTION_BUTTON_MACRO = 64, - ACTION_BUTTON_CMACRO= 65, - ACTION_BUTTON_ITEM = 128 + ACTION_BUTTON_SPELL = 0x00, + ACTION_BUTTON_C = 0x01, // click? + ACTION_BUTTON_EQSET = 0x20, + ACTION_BUTTON_MACRO = 0x40, + ACTION_BUTTON_CMACRO = ACTION_BUTTON_C | ACTION_BUTTON_MACRO, + ACTION_BUTTON_ITEM = 0x80 }; #define ACTION_BUTTON_ACTION(X) (uint32(X) & 0x00FFFFFF) @@ -1698,7 +1699,7 @@ class MANGOS_DLL_SPEC Player : public Unit void SetSession(WorldSession *s) { m_session = s; } void BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) const; - void DestroyForPlayer( Player *target ) const; + void DestroyForPlayer( Player *target, bool anim = false ) const; void SendDelayResponse(const uint32); void SendLogXPGain(uint32 GivenXP,Unit* victim,uint32 RestXP); @@ -1708,7 +1709,7 @@ class MANGOS_DLL_SPEC Player : public Unit void SendAttackSwingDeadTarget(); void SendAttackSwingNotInRange(); void SendAttackSwingBadFacingAttack(); - void SendAutoRepeatCancel(); + void SendAutoRepeatCancel(Unit *target); void SendExplorationExperience(uint32 Area, uint32 Experience); void SendDungeonDifficulty(bool IsInGroup); @@ -2188,7 +2189,7 @@ class MANGOS_DLL_SPEC Player : public Unit void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1=0, uint32 miscvalue2=0, Unit *unit=NULL, uint32 time=0); bool HasTitle(uint32 bitIndex); bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); } - void SetTitle(CharTitlesEntry const* title); + void SetTitle(CharTitlesEntry const* title, bool lost = false); bool isActiveObject() const { return true; } bool canSeeSpellClickOn(Creature const* creature) const; @@ -2511,4 +2512,4 @@ template T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas basevalue = T((float)basevalue + diff); return T(diff); } -#endif +#endif \ No newline at end of file diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 3a3106562..9ebb317f6 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -6399,16 +6399,14 @@ void Spell::EffectTransmitted(uint32 effIndex) case GAMEOBJECT_TYPE_FISHINGHOLE: case GAMEOBJECT_TYPE_CHEST: default: - { break; - } } pGameObj->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); - pGameObj->SetOwnerGUID(m_caster->GetGUID() ); + pGameObj->SetOwnerGUID(m_caster->GetGUID()); - pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() ); + pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); pGameObj->SetSpellId(m_spellInfo->Id); DEBUG_LOG("AddObject at SpellEfects.cpp EffectTransmitted"); @@ -6428,9 +6426,9 @@ void Spell::EffectTransmitted(uint32 effIndex) m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY)) { linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0); - linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() ); + linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel()); linkedGO->SetSpellId(m_spellInfo->Id); - linkedGO->SetOwnerGUID(m_caster->GetGUID() ); + linkedGO->SetOwnerGUID(m_caster->GetGUID()); linkedGO->GetMap()->Add(linkedGO); } diff --git a/src/game/Totem.cpp b/src/game/Totem.cpp index fdb2f6003..4b15b26c0 100644 --- a/src/game/Totem.cpp +++ b/src/game/Totem.cpp @@ -58,9 +58,9 @@ void Totem::Summon(Unit* owner) // select totem model in dependent from owner team CreatureInfo const *cinfo = GetCreatureInfo(); - if(owner->GetTypeId()==TYPEID_PLAYER && cinfo) + if(owner->GetTypeId() == TYPEID_PLAYER && cinfo) { - uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(),cinfo); + uint32 display_id = objmgr.ChooseDisplayId(((Player*)owner)->GetTeam(), cinfo); CreatureModelInfo const *minfo = objmgr.GetCreatureModelRandomGender(display_id); if (minfo) display_id = minfo->modelid; @@ -75,8 +75,12 @@ void Totem::Summon(Unit* owner) switch(m_type) { - case TOTEM_PASSIVE: CastSpell(this, GetSpell(), true); break; - case TOTEM_STATUE: CastSpell(GetOwner(), GetSpell(), true); break; + case TOTEM_PASSIVE: + CastSpell(this, GetSpell(), true); + break; + case TOTEM_STATUE: + CastSpell(GetOwner(), GetSpell(), true); + break; default: break; } } @@ -90,10 +94,10 @@ void Totem::UnSummon() Unit *owner = GetOwner(); if (owner) { - // clear owenr's totem slot + // clear owner's totem slot for(int i = 0; i < MAX_TOTEM; ++i) { - if(owner->m_TotemSlot[i]==GetGUID()) + if(owner->m_TotemSlot[i] == GetGUID()) { owner->m_TotemSlot[i] = 0; break; @@ -103,12 +107,10 @@ void Totem::UnSummon() owner->RemoveAurasDueToSpell(GetSpell()); //remove aura all party members too - Group *pGroup = NULL; if (owner->GetTypeId() == TYPEID_PLAYER) { // Not only the player can summon the totem (scripted AI) - pGroup = ((Player*)owner)->GetGroup(); - if (pGroup) + if(Group *pGroup = ((Player*)owner)->GetGroup()) { for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) { @@ -152,13 +154,13 @@ void Totem::SetTypeBySummonSpell(SpellEntry const * spellProto) if (GetSpellCastTime(totemSpell)) m_type = TOTEM_ACTIVE; } - if(spellProto->SpellIconID==2056) + if(spellProto->SpellIconID == 2056) m_type = TOTEM_STATUE; //Jewelery statue } bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) const { - // TODO: possibly all negative auras immuned? + // TODO: possibly all negative auras immune? switch(spellInfo->EffectApplyAuraName[index]) { case SPELL_AURA_PERIODIC_DAMAGE: @@ -170,4 +172,4 @@ bool Totem::IsImmunedToSpellEffect(SpellEntry const* spellInfo, uint32 index) co break; } return Creature::IsImmunedToSpellEffect(spellInfo, index); -} +} \ No newline at end of file diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index ea5dda4bc..c41542438 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -3138,8 +3138,8 @@ void Unit::InterruptSpell(uint32 spellType, bool withDelayed) // send autorepeat cancel message for autorepeat spells if (spellType == CURRENT_AUTOREPEAT_SPELL) { - if(GetTypeId()==TYPEID_PLAYER) - ((Player*)this)->SendAutoRepeatCancel(); + if(GetTypeId() == TYPEID_PLAYER) + ((Player*)this)->SendAutoRepeatCancel(this); } if (m_currentSpells[spellType]->getState() != SPELL_STATE_FINISHED) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 857f9a9b5..12cd8f72c 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8224" + #define REVISION_NR "8225" #endif // __REVISION_NR_H__