aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--THANKS128
-rw-r--r--revision_data.h.in.cmake2
-rw-r--r--sql/base/characters_database.sql5
-rw-r--r--sql/updates/characters/3.3.5/2016_10_30_00_characters.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_17_05_world_335.sql25
-rw-r--r--sql/updates/world/3.3.5/2016_10_17_06_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_17_07_world_335.sql761
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_01_world_335.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_02_world.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_03_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_04_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_05_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_06_world_335.sql49
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_07_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_10_18_08_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_10_19_00_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_20_00_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_10_21_00_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_10_21_01_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_10_21_02_world.sql28
-rw-r--r--sql/updates/world/3.3.5/2016_10_22_00_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_10_23_00_world_335.sql23
-rw-r--r--sql/updates/world/3.3.5/2016_10_25_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_26_00_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_10_26_01_world.sql44
-rw-r--r--sql/updates/world/3.3.5/2016_10_26_02_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_00_world_335.sql96
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_01_world_335.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_02_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_03_world.sql10
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_04_world.sql30
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_05_world.sql29
-rw-r--r--sql/updates/world/3.3.5/2016_10_27_06_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_28_00_world.sql13
-rw-r--r--sql/updates/world/3.3.5/2016_10_28_01_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_10_28_02_world_335.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_10_28_03_world_335.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_00_world.sql43
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_01_world_335.sql25
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_02_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_03_world.sql16
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_04_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_05_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_06_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_29_07_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_00_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_01_world_335.sql11
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_02_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_03_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_04_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_05_world_335.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_06_world_335.sql76
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_07_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_10_30_08_world.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_10_31_00_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_11_01_00_world.sql15
-rw-r--r--sql/updates/world/3.3.5/2016_11_01_01_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_11_01_02_world.sql16
-rw-r--r--sql/updates/world/3.3.5/2016_11_01_03_world.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_11_01_04_world_335.sql92
-rw-r--r--sql/updates/world/3.3.5/2016_11_02_00_world_335.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_11_02_01_world.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_11_02_02_world.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_11_02_03_world_335.sql6
-rw-r--r--sql/updates/world/3.3.5/2016_11_03_00_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_11_03_01_world_335.sql12
-rw-r--r--sql/updates/world/3.3.5/2016_11_03_02_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_11_03_03_world.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_04_00_world_335.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_11_04_01_world.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_11_04_02_world.sql8
-rw-r--r--sql/updates/world/3.3.5/2016_11_07_00_world_335.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_11_08_00_world_335.sql9
-rw-r--r--sql/updates/world/3.3.5/2016_11_08_01_world_335.sql4
-rw-r--r--sql/updates/world/3.3.5/2016_11_09_00_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_09_01_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_10_00_world_335.sql5
-rw-r--r--sql/updates/world/3.3.5/2016_11_10_01_world_335.sql14
-rw-r--r--sql/updates/world/3.3.5/2016_11_12_00_world_335.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_11_12_01_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_13_00_world.sql664
-rw-r--r--sql/updates/world/3.3.5/2016_11_14_00_world_335.sql3
-rw-r--r--sql/updates/world/3.3.5/2016_11_15_00_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_15_01_world.sql108
-rw-r--r--sql/updates/world/3.3.5/2016_11_18_00_world_335.sql10
-rw-r--r--sql/updates/world/3.3.5/2016_11_19_00_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_19_01_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_19_02_world_335.sql1
-rw-r--r--sql/updates/world/3.3.5/2016_11_20_00_world.sql2
-rw-r--r--sql/updates/world/3.3.5/2016_11_20_01_world.sql7
-rw-r--r--sql/updates/world/3.3.5/2016_11_20_02_world.sql899
-rw-r--r--src/common/Common.h1
-rw-r--r--src/common/Metric/Metric.cpp2
-rw-r--r--src/common/Metric/Metric.h8
-rw-r--r--src/common/Utilities/Util.h32
-rw-r--r--src/server/authserver/Server/AuthSession.cpp73
-rw-r--r--src/server/authserver/Server/AuthSession.h10
-rw-r--r--src/server/database/Database/Implementation/CharacterDatabase.cpp4
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp5
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.cpp26
-rw-r--r--src/server/game/Battlefield/Zones/BattlefieldWG.h1
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.cpp12
-rw-r--r--src/server/game/Battlegrounds/ArenaTeam.h2
-rw-r--r--src/server/game/Battlegrounds/ArenaTeamMgr.cpp5
-rw-r--r--src/server/game/Battlegrounds/BattlegroundMgr.cpp2
-rw-r--r--src/server/game/Chat/Channels/Channel.cpp2
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp1
-rw-r--r--src/server/game/Conditions/ConditionMgr.h2
-rw-r--r--src/server/game/DataStores/DBCStructure.h11
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp1
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp61
-rw-r--r--src/server/game/Entities/GameObject/GameObject.h7
-rw-r--r--src/server/game/Entities/Item/Item.cpp12
-rw-r--r--src/server/game/Entities/Object/Object.cpp2
-rw-r--r--src/server/game/Entities/Player/Player.cpp275
-rw-r--r--src/server/game/Entities/Player/Player.h6
-rw-r--r--src/server/game/Entities/Transport/Transport.cpp6
-rw-r--r--src/server/game/Entities/Unit/StatSystem.cpp25
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp834
-rw-r--r--src/server/game/Entities/Unit/Unit.h54
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp5
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h324
-rw-r--r--src/server/game/Guilds/Guild.cpp285
-rw-r--r--src/server/game/Guilds/Guild.h1138
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp7
-rw-r--r--src/server/game/Handlers/PetitionsHandler.cpp16
-rw-r--r--src/server/game/Loot/LootMgr.cpp133
-rw-r--r--src/server/game/Loot/LootMgr.h38
-rw-r--r--src/server/game/Miscellaneous/SharedDefines.h13
-rw-r--r--src/server/game/Movement/MotionMaster.cpp471
-rw-r--r--src/server/game/Movement/MotionMaster.h165
-rw-r--r--src/server/game/Scripting/ScriptMgr.cpp21
-rw-r--r--src/server/game/Scripting/ScriptMgr.h5
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.cpp605
-rw-r--r--src/server/game/Spells/Auras/SpellAuraEffects.h2
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.cpp188
-rw-r--r--src/server/game/Spells/Auras/SpellAuras.h6
-rw-r--r--src/server/game/Spells/Spell.cpp721
-rw-r--r--src/server/game/Spells/Spell.h41
-rw-r--r--src/server/game/Spells/SpellEffects.cpp119
-rw-r--r--src/server/game/Spells/SpellInfo.cpp558
-rw-r--r--src/server/game/Spells/SpellInfo.h31
-rw-r--r--src/server/game/Spells/SpellMgr.cpp100
-rw-r--r--src/server/game/Spells/SpellMgr.h17
-rw-r--r--src/server/game/Spells/SpellScript.cpp68
-rw-r--r--src/server/game/Spells/SpellScript.h8
-rw-r--r--src/server/game/World/World.cpp9
-rw-r--r--src/server/scripts/Commands/cs_cast.cpp15
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp9
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp35
-rw-r--r--src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp2
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp119
-rw-r--r--src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h4
-rw-r--r--src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp4
-rw-r--r--src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp140
-rw-r--r--src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp4
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp5
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp6
-rw-r--r--src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp4
-rw-r--r--src/server/scripts/Northrend/zone_dragonblight.cpp26
-rw-r--r--src/server/scripts/Northrend/zone_storm_peaks.cpp1
-rw-r--r--src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp2
-rw-r--r--src/server/scripts/Outland/BlackTemple/black_temple.h18
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_illidan.cpp24
-rw-r--r--src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp93
-rw-r--r--src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp189
-rw-r--r--src/server/scripts/Outland/boss_doomlord_kazzak.cpp4
-rw-r--r--src/server/scripts/Outland/zone_hellfire_peninsula.cpp67
-rw-r--r--src/server/scripts/Pet/pet_hunter.cpp31
-rw-r--r--src/server/scripts/Spells/spell_dk.cpp28
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp65
-rw-r--r--src/server/scripts/Spells/spell_generic.cpp4
-rw-r--r--src/server/scripts/Spells/spell_hunter.cpp140
-rw-r--r--src/server/scripts/Spells/spell_item.cpp67
-rw-r--r--src/server/scripts/Spells/spell_mage.cpp20
-rw-r--r--src/server/scripts/Spells/spell_paladin.cpp68
-rw-r--r--src/server/scripts/Spells/spell_priest.cpp55
-rw-r--r--src/server/scripts/Spells/spell_rogue.cpp10
-rw-r--r--src/server/scripts/Spells/spell_shaman.cpp91
-rw-r--r--src/server/scripts/Spells/spell_warlock.cpp22
-rw-r--r--src/server/scripts/Spells/spell_warrior.cpp10
-rw-r--r--src/tools/vmap4_extractor/mpq_libmpq.cpp6
-rw-r--r--src/tools/vmap4_extractor/mpq_libmpq04.h12
185 files changed, 7699 insertions, 3788 deletions
diff --git a/THANKS b/THANKS
index 765d0ebfe87..ca7d469651b 100644
--- a/THANKS
+++ b/THANKS
@@ -22,6 +22,9 @@ were extracted from old commits):
- 2010phenix
- 3kids
- 4m1g0
+- [M]axx
+- _manuel_
+- `win
- A Metaphysical Drama
- Aaron126
- Abdollah Hasan
@@ -35,12 +38,12 @@ were extracted from old commits):
- aletuna
- Alex
- Alex Bolotsin
+- alex_1983
- Alexander
- alexbolotsin
- AlexDereka
- Alexei_Nech
- alexsot
-- alex_1983
- Alez
- AliveShiro
- alpharius
@@ -53,6 +56,8 @@ were extracted from old commits):
- amnell
- Amok
- amsjunior123
+- Andrew Letson
+- Andy@conmuc-l03
- AniRB
- Ankso
- announce
@@ -83,11 +88,12 @@ were extracted from old commits):
- Asael
- Ascathor
- Astellar
+- Asterc
- Athor
- Authorius
- aven_coda
- Aviram
-- Azazel
+- azazel
- Azrael
- Azuritus
- b4nan1
@@ -100,6 +106,7 @@ were extracted from old commits):
- Barlok
- Beaste
- bele
+- Bernd Lörwald
- betagan
- Bezo
- Big
@@ -128,11 +135,11 @@ were extracted from old commits):
- Bonny1992
- Boogie
- boom
+- Boomper
- Bootz
- Brats
- breakerfly
- Brecky
-- Brian
- BroodWyrm
- Brueggus
- BudIcePenguin
@@ -155,6 +162,7 @@ were extracted from old commits):
- Ceris
- Cha0S2
- chadryx
+- chaodhib
- Chaplain
- Charlie
- Charlie2025
@@ -176,6 +184,7 @@ were extracted from old commits):
- cookta2012
- corbi
- Corfen
+- Cosmo Orzechovsky
- cr4st
- crackm
- Craker
@@ -192,6 +201,7 @@ were extracted from old commits):
- d-sat
- D3VIL
- D4R4
+- D_Skywalk
- Daejiv
- DaGNU
- Dakeyras
@@ -209,6 +219,7 @@ were extracted from old commits):
- DarkXuan
- DasBlub
- daveh
+- David Carlos Manuelda
- David Klepáček
- DDuarte
- Deafboy
@@ -224,8 +235,9 @@ were extracted from old commits):
- DemiDroL
- Demonx
- Den
-- denyde
- DEN_North
+- Denis
+- denyde
- DerDyddye
- dereka
- Derex
@@ -237,7 +249,7 @@ were extracted from old commits):
- Dimitro
- disassebler
- Disassembler
-- Discover
+- Discover-
- Discovered
- DiSlord
- DJScias
@@ -260,7 +272,6 @@ were extracted from old commits):
- durotar
- Dyddye
- dythzer
-- D_Skywalk
- E. van Harten
- e000
- e@cacaw.net
@@ -274,10 +285,12 @@ were extracted from old commits):
- eL
- elecyb
- EleGoS
+- Elimination
- Ellie
- Elminster
- Elron
-- elron103
+- Elron103
+- elseif
- Emo
- Emo Norfik
- emsy
@@ -302,7 +315,7 @@ were extracted from old commits):
- F636y623
- Fabi
- False
-- faq
+- Faq
- Farah
- faramir118
- fatalaim
@@ -324,11 +337,12 @@ were extracted from old commits):
- Foldor
- Foldy
- footman
+- ForesterDev
- Forgiven
- Francesco Borzì
- Frankir
- Frca
-- fredi
+- Fredi
- Fredi Machado
- freeganja
- fregh
@@ -339,19 +353,20 @@ were extracted from old commits):
- FrozenSoul
- Frytiks
- fukifat
+- funjoker
- furion
- Furion89
+- Gabriele Gelardi
- Gacko
- gadge
- gaut
- ge0rg
-- gecko32
+- Gecko32
- Geekotron
- Genars
- Gendalph
- Geodar
- gerripeach
-- ghost
- Gigatotem
- Gigi1237
- gildor
@@ -376,7 +391,6 @@ were extracted from old commits):
- Guillaume Belz
- gvcoman
- GWRde
-- gwrde
- Gyullo
- Gyx
- hacknowledge
@@ -388,6 +402,7 @@ were extracted from old commits):
- Heihachi
- Heisenberg
- Helias
+- Henry
- HenryG
- hexa-
- Hexit
@@ -398,7 +413,7 @@ were extracted from old commits):
- hoshie
- HP1
- Hristo Bogdanov
-- Hunteee
+- hunteee
- HUNTERok
- hunuza
- huri
@@ -406,11 +421,13 @@ were extracted from old commits):
- iadus3
- iDenyDeX
- idostyle
-- Ille
+- ille
- illusion
+- imbavirus
- imbecile
- Imprtat
- IncoGnito
+- Incorrect
- Infinity
- Insider
- insider42
@@ -420,7 +437,8 @@ were extracted from old commits):
- Iskander
- Itch
- j4r0d
-- Jackpoz
+- jackpoz
+- Jameyboor
- Jared Jones
- Jeniczek
- Jens Bäckman
@@ -448,16 +466,21 @@ were extracted from old commits):
- Ka0z
- Kaelima
- kaell
+- Kaev
- Kaldorei
- kamir86
- kancaras
- Kandera
- KAPATEJIb
- Kapoeira
+- Karel Pokorný
- karn
- kaxap
- kb_z
+- Keader
- keke222
+- Keldo
+- Kelno
- kelsarhu
- kenjiro
- kennylive
@@ -470,11 +493,12 @@ were extracted from old commits):
- Killyana
- KingPin
- Kinzcool
-- Kiper
+- kiper
- Kiperr
- Kiritoo
- KiriX
- Kirkhammett
+- Kito
- Kittnz
- Klaimmore
- Koani
@@ -498,8 +522,8 @@ were extracted from old commits):
- LaserJet
- laviniu
- Lazzalf
-- Leak
-- leguybrush
+- leak
+- LeGuybrush
- Leonid Logvinov
- Liberate
- Lightguard
@@ -510,22 +534,26 @@ were extracted from old commits):
- liszt
- lobuz
- loop69
+- Lopfest
- Lopin
- Lorac
- LordJZ
- Lordron
- LordUsagi
+- Lorenzo J. Gonzalez Cabrera
- lost-illusion
- Lucas
- Lucy
- Luhzinha
-- Lukaasm
+- lukaasm
- Luniz2k1
+- LuqJensen
- Lutik
- Luzifix
- Lynx3d
- m.ax
- m7nu3l
+- m_pan
- maanuel
- Machiavelli
- MacWarrior
@@ -534,18 +562,18 @@ were extracted from old commits):
- maikash
- make_the_king
- Malcrom
-- manuel
-- Manuel Carrasco
- ManuFe
- marc0303
+- Marco Ebert
- Marius Ungureanu
- Mark07
- Marosa
- Martin Weinelt
- MaS0n
+- Mateus Demboski
- Matthew Goff
- maxdestroyer
-- MaXiMiUS
+- maximius
- Maxxie
- maxxx
- McBitter
@@ -563,18 +591,19 @@ were extracted from old commits):
- miebaik
- Miha Penger
- Mihapro
-- mik1893
+- Mik1893
- Mik43l
- mike753
- miranda.conrado
- Miroslav1993
-- Mislav Blažević
+- Mislav Blazevic
- MitchesD
- mknjc
- mns
- Moandor
- mobel
- Mogadischu
+- moJIto-ice
- Molius
- MorganaOP
- Morgoporc
@@ -591,7 +620,7 @@ were extracted from old commits):
- multiplexer
- Multivitamin
- mweinelt
-- Myran2
+- myran2
- n0n4m3
- n4ndo
- n4rk0
@@ -602,10 +631,10 @@ were extracted from old commits):
- nanouniko
- Nate
- natepizzle
+- NathanHandley
- Naturamen
- Natureknight
- Nawuko
-- Nay
- Nayre
- Ne3x
- NeatElves
@@ -621,8 +650,8 @@ were extracted from old commits):
- nesocip
- netoya
- NetSky
-- neurorulez
- neuro_999
+- neurorulez
- Nevadas
- Nevan
- new001
@@ -646,14 +675,15 @@ were extracted from old commits):
- Numielle
- NuRRi
- Nyeriah
-- Oculus
- oc_redfox
+- Oculus
- Odyssey
- ogeraisi
- oiler2112
- oMadMano
- onkelz28
- Opterman
+- Orion
- Orphus
- Ottowayne
- Ouden
@@ -678,16 +708,18 @@ were extracted from old commits):
- Phacops
- Phantons
- phoenixfight
+- Pirricli
- Pitcrawler
- pjasicek
- PKX
- Polkic
+- Portgas
- Portgas D. Ace
- Praetonus
- Prince
- PrinceCreed
- profPlum
-- projectcoredevs
+- ProjectCoreDevs
- Proofzor
- PSZ
- PuniCZ
@@ -697,6 +729,7 @@ were extracted from old commits):
- QT
- QuaLiT1
- qubix
+- r00ty-tc
- raczman
- raelik
- raftom
@@ -713,8 +746,9 @@ were extracted from old commits):
- redcore
- RedSonja
- Regigicas
+- RelevantJesse
- reno
-- retriman
+- Retriman
- Reve
- RezolveX
- Rhyme
@@ -725,9 +759,10 @@ were extracted from old commits):
- rilex
- rj686
- robinsch
-- roc13x
+- Roc13x
- Rochet2
- rocky517
+- rockz1152
- rockzOr
- rocverde
- Rognar
@@ -740,11 +775,12 @@ were extracted from old commits):
- Saeba
- Santiago
- Sar777
-- Sarjuuk
+- sarjuuk
- Sawiner
- scarymovie87
- Scazzato88
- Schmoozerd
+- Sean Rhone
- seaofgreen
- Sebastián Orellana
- secharles
@@ -757,6 +793,7 @@ were extracted from old commits):
- Sethoso
- SeTM
- SgT-Fatality
+- shadowu@mail.bg
- Shauren
- shax
- Shendor
@@ -766,17 +803,17 @@ were extracted from old commits):
- SignFinder
- Silinoron
- silver1ce
-- SilverIce
- simak
- simon
- SimonDMII
- sirikfoll
- Sisif
- Skystar
-- SLG
+- slg
- Smakapotatis
- smellbee
- SnakeIce
+- Snapper
- Socolin
- sohrab
- sombre88
@@ -797,6 +834,7 @@ were extracted from old commits):
- srounet
- Stalker-Riddick
- StarJoker
+- Stefan@Vistax64-Stefan
- Stefo
- stfx
- Stokrotka
@@ -808,9 +846,9 @@ were extracted from old commits):
- Subv
- Sundark
- sunwell
-- SupaBad
+- Supabad
- suranex
-- svannon
+- Svannon
- svetilo12
- Syntec
- SyRiOCoP
@@ -832,13 +870,13 @@ were extracted from old commits):
- tharaca
- The Game
- The-Legend
+- The_Game_Master
- thebillkidy
- Them
- Themris
- thenecromancer
- therzok
- thesensei
-- The_Game_Master
- thmarth
- thomas33
- Thraxx
@@ -855,16 +893,17 @@ were extracted from old commits):
- tlexii
- tobmaps
- toilet1
+- TOM_RUS
- Tomas
- Tomatoes
- Tome
- Tommassino
-- TOM_RUS
- toshik
- totoro
- Trazom
- Trazom62
-- tREAk
+- treak
+- Treeston
- trickerer
- Triply
- Trisjdc
@@ -875,8 +914,8 @@ were extracted from old commits):
- TrullyONE
- Turk3y
- Turok
-- Tuxity
- Tux`Volant
+- Tuxity
- tvaroh
- Typhoon
- tyraela
@@ -884,6 +923,7 @@ were extracted from old commits):
- unholy
- Unholychick
- unknown
+- unknown-8H3D
- untaught
- Uruviel
- Vadim
@@ -897,6 +937,7 @@ were extracted from old commits):
- Venugh
- Veras
- Vicos
+- Vincent-Core
- Vincent-Michael
- Vinolentus
- Visagalis
@@ -953,6 +994,7 @@ were extracted from old commits):
- yad02
- Yaki Khadafi
- yavi
+- Yehonal
- Yelvann
- yesitsme
- z0ldrax
@@ -972,8 +1014,6 @@ were extracted from old commits):
- zorix
- zthoreen
- zwerg
-- zxbiohazardzx
-- [M]axx
-- _manuel_
-- `win
+- ZxBiohazardZx
- Дмитрий
+- 4m1g0
diff --git a/revision_data.h.in.cmake b/revision_data.h.in.cmake
index 14faa04a0bc..f73dd0cf0f3 100644
--- a/revision_data.h.in.cmake
+++ b/revision_data.h.in.cmake
@@ -7,7 +7,7 @@
#define _SOURCE_DIRECTORY R"(@CMAKE_SOURCE_DIR@)"
#define _BUILD_DIRECTORY R"(@BUILDDIR@)"
#define _MYSQL_EXECUTABLE R"(@MYSQL_EXECUTABLE@)"
- #define _FULL_DATABASE "TDB_full_world_335.61_2016_04_11.sql"
+ #define _FULL_DATABASE "TDB_full_world_335.62_2016_10_17.sql"
#define VER_COMPANYNAME_STR "TrinityCore Developers"
#define VER_LEGALCOPYRIGHT_STR "(c)2008-2016 TrinityCore"
#define VER_FILEVERSION 0,0,0
diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql
index c71f9e808bf..033cfe1b6c2 100644
--- a/sql/base/characters_database.sql
+++ b/sql/base/characters_database.sql
@@ -507,7 +507,6 @@ DROP TABLE IF EXISTS `character_aura`;
CREATE TABLE `character_aura` (
`guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier',
`casterGuid` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Full Global Unique Identifier',
- `itemGuid` bigint(20) unsigned NOT NULL DEFAULT '0',
`spell` mediumint(8) unsigned NOT NULL DEFAULT '0',
`effectMask` tinyint(3) unsigned NOT NULL DEFAULT '0',
`recalculateMask` tinyint(3) unsigned NOT NULL DEFAULT '0',
@@ -521,7 +520,7 @@ CREATE TABLE `character_aura` (
`maxDuration` int(11) NOT NULL DEFAULT '0',
`remainTime` int(11) NOT NULL DEFAULT '0',
`remainCharges` tinyint(3) unsigned NOT NULL DEFAULT '0',
- PRIMARY KEY (`guid`,`casterGuid`,`itemGuid`,`spell`,`effectMask`)
+ PRIMARY KEY (`guid`,`casterGuid`,`spell`,`effectMask`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Player System';
/*!40101 SET character_set_client = @saved_cs_client */;
@@ -2568,7 +2567,7 @@ CREATE TABLE `updates` (
LOCK TABLES `updates` WRITE;
/*!40000 ALTER TABLE `updates` DISABLE KEYS */;
-INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0),('2015_06_26_00_characters_335.sql','C2CC6E50AFA1ACCBEBF77CC519AAEB09F3BBAEBC','ARCHIVED','2015-07-13 23:49:22',0),('2015_09_28_00_characters_335.sql','F8682A431D50E54BDC4AC0E7DBED21AE8AAB6AD4','ARCHIVED','2015-09-28 21:00:00',0),('2015_08_26_00_characters_335.sql','C7D6A3A00FECA3EBFF1E71744CA40D3076582374','ARCHIVED','2015-08-26 21:00:00',0),('2015_10_06_00_characters.sql','16842FDD7E8547F2260D3312F53EFF8761EFAB35','ARCHIVED','2015-10-06 16:06:38',0),('2015_10_07_00_characters.sql','E15AB463CEBE321001D7BFDEA4B662FF618728FD','ARCHIVED','2015-10-07 23:32:00',0),('2015_10_12_00_characters.sql','D6F9927BDED72AD0A81D6EC2C6500CBC34A39FA2','ARCHIVED','2015-10-12 15:35:47',0),('2015_10_28_00_characters.sql','622A9CA8FCE690429EBE23BA071A37C7A007BF8B','ARCHIVED','2015-10-19 14:32:22',0),('2015_10_29_00_characters_335.sql','4555A7F35C107E54C13D74D20F141039ED42943E','ARCHIVED','2015-10-29 17:05:43',0),('2015_11_03_00_characters.sql','CC045717B8FDD9733351E52A5302560CD08AAD57','ARCHIVED','2015-10-12 15:23:33',0),('2015_11_07_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',94),('2016_02_10_00_characters.sql','F1B4DA202819CABC7319A4470A2D224A34609E97','ARCHIVED','2016-02-10 00:00:00',0),('2016_03_13_2016_01_05_00_characters.sql','0EAD24977F40DE2476B4567DA2B477867CC0DA1A','ARCHIVED','2016-03-13 20:03:56',0),('2016_04_11_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 03:18:17',0),('2016_09_13_00_characters.sql','27A04615B11B2CFC3A26778F52F74C071E4F9C54','ARCHIVED','2016-07-06 18:55:18',0),('2016_10_16_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-10-16 14:02:49',35);
+INSERT INTO `updates` VALUES ('2015_03_20_00_characters.sql','B761760804EA73BD297F296C5C1919687DF7191C','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_01_characters.sql','894F08B70449A5481FFAF394EE5571D7FC4D8A3A','ARCHIVED','2015-03-21 21:44:15',0),('2015_03_20_02_characters.sql','97D7BE0CAADC79F3F11B9FD296B8C6CD40FE593B','ARCHIVED','2015-03-21 21:44:51',0),('2015_06_26_00_characters_335.sql','C2CC6E50AFA1ACCBEBF77CC519AAEB09F3BBAEBC','ARCHIVED','2015-07-13 23:49:22',0),('2015_09_28_00_characters_335.sql','F8682A431D50E54BDC4AC0E7DBED21AE8AAB6AD4','ARCHIVED','2015-09-28 21:00:00',0),('2015_08_26_00_characters_335.sql','C7D6A3A00FECA3EBFF1E71744CA40D3076582374','ARCHIVED','2015-08-26 21:00:00',0),('2015_10_06_00_characters.sql','16842FDD7E8547F2260D3312F53EFF8761EFAB35','ARCHIVED','2015-10-06 16:06:38',0),('2015_10_07_00_characters.sql','E15AB463CEBE321001D7BFDEA4B662FF618728FD','ARCHIVED','2015-10-07 23:32:00',0),('2015_10_12_00_characters.sql','D6F9927BDED72AD0A81D6EC2C6500CBC34A39FA2','ARCHIVED','2015-10-12 15:35:47',0),('2015_10_28_00_characters.sql','622A9CA8FCE690429EBE23BA071A37C7A007BF8B','ARCHIVED','2015-10-19 14:32:22',0),('2015_10_29_00_characters_335.sql','4555A7F35C107E54C13D74D20F141039ED42943E','ARCHIVED','2015-10-29 17:05:43',0),('2015_11_03_00_characters.sql','CC045717B8FDD9733351E52A5302560CD08AAD57','ARCHIVED','2015-10-12 15:23:33',0),('2015_11_07_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',94),('2016_02_10_00_characters.sql','F1B4DA202819CABC7319A4470A2D224A34609E97','ARCHIVED','2016-02-10 00:00:00',0),('2016_03_13_2016_01_05_00_characters.sql','0EAD24977F40DE2476B4567DA2B477867CC0DA1A','ARCHIVED','2016-03-13 20:03:56',0),('2016_04_11_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 03:18:17',0),('2016_09_13_00_characters.sql','27A04615B11B2CFC3A26778F52F74C071E4F9C54','ARCHIVED','2016-07-06 18:55:18',0),('2016_10_16_00_characters.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-10-16 14:02:49',35),('2016_10_30_00_characters.sql','7E2D5B226907B5A9AF320797F46E86DC27B7EC90','RELEASED','2016-10-30 00:00:00',0);
/*!40000 ALTER TABLE `updates` ENABLE KEYS */;
UNLOCK TABLES;
diff --git a/sql/updates/characters/3.3.5/2016_10_30_00_characters.sql b/sql/updates/characters/3.3.5/2016_10_30_00_characters.sql
new file mode 100644
index 00000000000..f72e8c32e22
--- /dev/null
+++ b/sql/updates/characters/3.3.5/2016_10_30_00_characters.sql
@@ -0,0 +1,2 @@
+DELETE FROM `character_aura` WHERE `itemGuid` != 0;
+ALTER TABLE `character_aura` DROP COLUMN `itemGuid`;
diff --git a/sql/updates/world/3.3.5/2016_10_17_05_world_335.sql b/sql/updates/world/3.3.5/2016_10_17_05_world_335.sql
new file mode 100644
index 00000000000..f5ec0202d2d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_17_05_world_335.sql
@@ -0,0 +1,25 @@
+DELETE FROM `game_event` WHERE `eventEntry`=70;
+INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `description`, `world_event`, `announce`) VALUES
+(70, '2016-09-20 01:01:00', '2020-12-31 06:00:00', 525600, 4320, 0, 'Brewfest Building (Iron Forge)', 0, 2);
+
+SET @OGUID:=66860;
+SET @Event:=70;
+
+-- Add missing objects
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+11;
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(@OGUID+0, 186737, 0, 1, 1, -5188.76, -594.4157, 397.1762, -1.186823, 0, 0, -0.5591927, 0.8290377, 120, 255, 1, 12340), -- 186737 (Area: 0)
+(@OGUID+1, 186737, 0, 1, 1, -5140.782, -578.3196, 397.1762, -2.35619, 0, 0, -0.9238787, 0.3826855, 120, 255, 1, 12340), -- 186737 (Area: 0)
+(@OGUID+2, 186737, 0, 1, 1, -5155.752, -635.502, 397.1766, 1.797689, 0, 0, 0.782608, 0.6225148, 120, 255, 1, 12340), -- 186737 (Area: 0)
+(@OGUID+3, 186717, 0, 1, 1, -5209.837, -459.3629, 386.537, 2.565632, 0, 0, 0.9588194, 0.2840165, 120, 255, 1, 12340), -- 186717 (Area: 0)
+(@OGUID+4, 186717, 0, 1, 1, -5226.539, -479.0257, 386.5343, 2.234018, 0, 0, 0.8987932, 0.4383728, 120, 255, 1, 12340), -- 186717 (Area: 0)
+(@OGUID+5, 186717, 0, 1, 1, -5233.375, -482.2638, 386.337, 1.919862, 0, 0, 0.8191519, 0.5735767, 120, 255, 1, 12340), -- 186717 (Area: 0)
+(@OGUID+6, 186717, 0, 1, 1, -5206.924, -452.2431, 386.8079, 3.019413, 0, 0, 0.9981346, 0.06105176, 120, 255, 1, 12340), -- 186717 (Area: 0)
+(@OGUID+7, 180052, 0, 1, 1, -5175.3, -625.1653, 397.1762, 2.91469, 0, 0, 0.9935713, 0.1132084, 120, 255, 1, 12340), -- 180052 (Area: 0)
+(@OGUID+8, 186217, 0, 1, 1, -5208.209, -456.0722, 386.7465, 2.705255, 0, 0, 0.9762955, 0.2164421, 120, 255, 1, 12340), -- 186217 (Area: 0)
+(@OGUID+9, 186217, 0, 1, 1, -5230.03, -480.2934, 386.3998, 2.129301, 0, 0, 0.8746195, 0.4848101, 120, 255, 1, 12340), -- 186217 (Area: 0)
+(@OGUID+10, 180026, 0, 1, 1, -5208.103, -455.9601, 386.5149, -2.984498, 0, 0, -0.9969168, 0.07846643, 120, 255, 1, 12340), -- 180026 (Area: 0)
+(@OGUID+11, 180026, 0, 1, 1, -5229.858, -480.2882, 386.3633, 2.687807, 0, 0, 0.97437, 0.2249513, 120, 255, 1, 12340); -- 180026 (Area: 0)
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+11 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+11;
diff --git a/sql/updates/world/3.3.5/2016_10_17_06_world.sql b/sql/updates/world/3.3.5/2016_10_17_06_world.sql
new file mode 100644
index 00000000000..b6df3a1991b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_17_06_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `creature` WHERE `id` IN (2870);
diff --git a/sql/updates/world/3.3.5/2016_10_17_07_world_335.sql b/sql/updates/world/3.3.5/2016_10_17_07_world_335.sql
new file mode 100644
index 00000000000..00ed0d1d413
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_17_07_world_335.sql
@@ -0,0 +1,761 @@
+-- Update position_z value of creatures in Orgrimmar
+UPDATE `creature` SET `position_z`=51.9636 WHERE `guid`=3420;
+UPDATE `creature` SET `position_z`=27.2991 WHERE `guid`=10352;
+UPDATE `creature` SET `position_z`=40.3172 WHERE `guid`=4662;
+UPDATE `creature` SET `position_z`=43.2693 WHERE `guid`=3616;
+UPDATE `creature` SET `position_z`=9.8843 WHERE `guid`=703;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=706;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=707;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=708;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=709;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=710;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=711;
+UPDATE `creature` SET `position_z`=53.3907 WHERE `guid`=1722;
+UPDATE `creature` SET `position_z`=43.6316 WHERE `guid`=3349;
+UPDATE `creature` SET `position_z`=41.2321 WHERE `guid`=3371;
+UPDATE `creature` SET `position_z`=42.2972 WHERE `guid`=3372;
+UPDATE `creature` SET `position_z`=42.2433 WHERE `guid`=3373;
+UPDATE `creature` SET `position_z`=43.3439 WHERE `guid`=3374;
+UPDATE `creature` SET `position_z`=43.7904 WHERE `guid`=3375;
+UPDATE `creature` SET `position_z`=43.7727 WHERE `guid`=3376;
+UPDATE `creature` SET `position_z`=41.1618 WHERE `guid`=3377;
+UPDATE `creature` SET `position_z`=43.7754 WHERE `guid`=3378;
+UPDATE `creature` SET `position_z`=41.2145 WHERE `guid`=3379;
+UPDATE `creature` SET `position_z`=43.7534 WHERE `guid`=3380;
+UPDATE `creature` SET `position_z`=38.0216 WHERE `guid`=3382;
+UPDATE `creature` SET `position_z`=51.8605 WHERE `guid`=3384;
+UPDATE `creature` SET `position_z`=25.5456 WHERE `guid`=3387;
+UPDATE `creature` SET `position_z`=34.2032 WHERE `guid`=3388;
+UPDATE `creature` SET `position_z`=41.2219 WHERE `guid`=3394;
+UPDATE `creature` SET `position_z`=42.4058 WHERE `guid`=3395;
+UPDATE `creature` SET `position_z`=42.4051 WHERE `guid`=3418;
+UPDATE `creature` SET `position_z`=23.0896 WHERE `guid`=3421;
+UPDATE `creature` SET `position_z`=43.872 WHERE `guid`=3422;
+UPDATE `creature` SET `position_z`=29.47 WHERE `guid`=3426;
+UPDATE `creature` SET `position_z`=22.6931 WHERE `guid`=3428;
+UPDATE `creature` SET `position_z`=23.123 WHERE `guid`=3429;
+UPDATE `creature` SET `position_z`=23.4942 WHERE `guid`=3430;
+UPDATE `creature` SET `position_z`=47.7468 WHERE `guid`=3467;
+UPDATE `creature` SET `position_z`=23.1965 WHERE `guid`=3468;
+UPDATE `creature` SET `position_z`=23.1545 WHERE `guid`=3469;
+UPDATE `creature` SET `position_z`=22.6708 WHERE `guid`=3470;
+UPDATE `creature` SET `position_z`=43.2693 WHERE `guid`=3471;
+UPDATE `creature` SET `position_z`=44.3602 WHERE `guid`=3472;
+UPDATE `creature` SET `position_z`=61.644 WHERE `guid`=3473;
+UPDATE `creature` SET `position_z`=43.2693 WHERE `guid`=3474;
+UPDATE `creature` SET `position_z`=36.5514 WHERE `guid`=3475;
+UPDATE `creature` SET `position_z`=40.8604 WHERE `guid`=3476;
+UPDATE `creature` SET `position_z`=40.8604 WHERE `guid`=3477;
+UPDATE `creature` SET `position_z`=40.8604 WHERE `guid`=3560;
+UPDATE `creature` SET `position_z`=40.8604 WHERE `guid`=3571;
+UPDATE `creature` SET `position_z`=426.817 WHERE `guid`=3613;
+UPDATE `creature` SET `position_z`=61.644 WHERE `guid`=3615;
+UPDATE `creature` SET `position_z`=59.304 WHERE `guid`=3646;
+UPDATE `creature` SET `position_z`=43.2693 WHERE `guid`=3648;
+UPDATE `creature` SET `position_z`=8.03965 WHERE `guid`=4652;
+UPDATE `creature` SET `position_z`=12.0272 WHERE `guid`=4653;
+UPDATE `creature` SET `position_z`=19.1316 WHERE `guid`=4654;
+UPDATE `creature` SET `position_z`=12.0368 WHERE `guid`=4655;
+UPDATE `creature` SET `position_z`=20.3744 WHERE `guid`=4656;
+UPDATE `creature` SET `position_z`=21.9288 WHERE `guid`=4657;
+UPDATE `creature` SET `position_z`=3.41723 WHERE `guid`=4658;
+UPDATE `creature` SET `position_z`=20.3745 WHERE `guid`=4659;
+UPDATE `creature` SET `position_z`=26.3315 WHERE `guid`=4660;
+UPDATE `creature` SET `position_z`=15.7436 WHERE `guid`=4661;
+UPDATE `creature` SET `position_z`=42.4051 WHERE `guid`=4663;
+UPDATE `creature` SET `position_z`=42.405 WHERE `guid`=4664;
+UPDATE `creature` SET `position_z`=42.4051 WHERE `guid`=4665;
+UPDATE `creature` SET `position_z`=23.4799 WHERE `guid`=4666;
+UPDATE `creature` SET `position_z`=23.4799 WHERE `guid`=4667;
+UPDATE `creature` SET `position_z`=27.1134 WHERE `guid`=4668;
+UPDATE `creature` SET `position_z`=22.7244 WHERE `guid`=4669;
+UPDATE `creature` SET `position_z`=24.6611 WHERE `guid`=4670;
+UPDATE `creature` SET `position_z`=27.1134 WHERE `guid`=4671;
+UPDATE `creature` SET `position_z`=29.47 WHERE `guid`=4672;
+UPDATE `creature` SET `position_z`=26.7223 WHERE `guid`=4673;
+UPDATE `creature` SET `position_z`=24.4207 WHERE `guid`=4675;
+UPDATE `creature` SET `position_z`=29.47 WHERE `guid`=4676;
+UPDATE `creature` SET `position_z`=47.7517 WHERE `guid`=4678;
+UPDATE `creature` SET `position_z`=24.8571 WHERE `guid`=4679;
+UPDATE `creature` SET `position_z`=23.0896 WHERE `guid`=4680;
+UPDATE `creature` SET `position_z`=26.0083 WHERE `guid`=4681;
+UPDATE `creature` SET `position_z`=25.0703 WHERE `guid`=4682;
+UPDATE `creature` SET `position_z`=45.7307 WHERE `guid`=4684;
+UPDATE `creature` SET `position_z`=45.7307 WHERE `guid`=4685;
+UPDATE `creature` SET `position_z`=25.0703 WHERE `guid`=4686;
+UPDATE `creature` SET `position_z`=26.0185 WHERE `guid`=4687;
+UPDATE `creature` SET `position_z`=48.7374 WHERE `guid`=4728;
+UPDATE `creature` SET `position_z`=57.076 WHERE `guid`=4762;
+UPDATE `creature` SET `position_z`=29.3695 WHERE `guid`=4766;
+UPDATE `creature` SET `position_z`=29.3695 WHERE `guid`=4767;
+UPDATE `creature` SET `position_z`=9.92688 WHERE `guid`=4769;
+UPDATE `creature` SET `position_z`=43.6002 WHERE `guid`=4770;
+UPDATE `creature` SET `position_z`=41.2304 WHERE `guid`=4771;
+UPDATE `creature` SET `position_z`=5.62244 WHERE `guid`=4785;
+UPDATE `creature` SET `position_z`=41.233 WHERE `guid`=6491;
+UPDATE `creature` SET `position_z`=27.3634 WHERE `guid`=6492;
+UPDATE `creature` SET `position_z`=27.2905 WHERE `guid`=6493;
+UPDATE `creature` SET `position_z`=27.7554 WHERE `guid`=6497;
+UPDATE `creature` SET `position_z`=8.36065 WHERE `guid`=6500;
+UPDATE `creature` SET `position_z`=41.2202 WHERE `guid`=6501;
+UPDATE `creature` SET `position_z`=41.2319 WHERE `guid`=6502;
+UPDATE `creature` SET `position_z`=41.2277 WHERE `guid`=6503;
+UPDATE `creature` SET `position_z`=29.4843 WHERE `guid`=6504;
+UPDATE `creature` SET `position_z`=43.3036 WHERE `guid`=6506;
+UPDATE `creature` SET `position_z`=25.3805 WHERE `guid`=6512;
+UPDATE `creature` SET `position_z`=25.7761 WHERE `guid`=6516;
+UPDATE `creature` SET `position_z`=42.2414 WHERE `guid`=6548;
+UPDATE `creature` SET `position_z`=40.7127 WHERE `guid`=6549;
+UPDATE `creature` SET `position_z`=42.2766 WHERE `guid`=6550;
+UPDATE `creature` SET `position_z`=43.7714 WHERE `guid`=6551;
+UPDATE `creature` SET `position_z`=41.2367 WHERE `guid`=6552;
+UPDATE `creature` SET `position_z`=41.2353 WHERE `guid`=6553;
+UPDATE `creature` SET `position_z`=41.9137 WHERE `guid`=6554;
+UPDATE `creature` SET `position_z`=41.2319 WHERE `guid`=6555;
+UPDATE `creature` SET `position_z`=41.1849 WHERE `guid`=6556;
+UPDATE `creature` SET `position_z`=42.1479 WHERE `guid`=6557;
+UPDATE `creature` SET `position_z`=49.1877 WHERE `guid`=6558;
+UPDATE `creature` SET `position_z`=22.8859 WHERE `guid`=6560;
+UPDATE `creature` SET `position_z`=52.1034 WHERE `guid`=6561;
+UPDATE `creature` SET `position_z`=22.7963 WHERE `guid`=6563;
+UPDATE `creature` SET `position_z`=22.7993 WHERE `guid`=6564;
+UPDATE `creature` SET `position_z`=27.3252 WHERE `guid`=6565;
+UPDATE `creature` SET `position_z`=21.5372 WHERE `guid`=6566;
+UPDATE `creature` SET `position_z`=6.78199 WHERE `guid`=6567;
+UPDATE `creature` SET `position_z`=44.104 WHERE `guid`=6597;
+UPDATE `creature` SET `position_z`=12.0409 WHERE `guid`=6598;
+UPDATE `creature` SET `position_z`=7.97797 WHERE `guid`=6599;
+UPDATE `creature` SET `position_z`=61.9445 WHERE `guid`=6600;
+UPDATE `creature` SET `position_z`=20.3744 WHERE `guid`=6601;
+UPDATE `creature` SET `position_z`=26.266 WHERE `guid`=6602;
+UPDATE `creature` SET `position_z`=4.60654 WHERE `guid`=6603;
+UPDATE `creature` SET `position_z`=19.0778 WHERE `guid`=6604;
+UPDATE `creature` SET `position_z`=7.97558 WHERE `guid`=6605;
+UPDATE `creature` SET `position_z`=54.6134 WHERE `guid`=6606;
+UPDATE `creature` SET `position_z`=46.7391 WHERE `guid`=6608;
+UPDATE `creature` SET `position_z`=57.0749 WHERE `guid`=6610;
+UPDATE `creature` SET `position_z`=39.5779 WHERE `guid`=6611;
+UPDATE `creature` SET `position_z`=24.3311 WHERE `guid`=6612;
+UPDATE `creature` SET `position_z`=24.3134 WHERE `guid`=6613;
+UPDATE `creature` SET `position_z`=58.964 WHERE `guid`=6620;
+UPDATE `creature` SET `position_z`=53.5045 WHERE `guid`=6621;
+UPDATE `creature` SET `position_z`=25.0703 WHERE `guid`=6622;
+UPDATE `creature` SET `position_z`=23.0896 WHERE `guid`=6623;
+UPDATE `creature` SET `position_z`=26.0065 WHERE `guid`=6624;
+UPDATE `creature` SET `position_z`=53.5045 WHERE `guid`=6625;
+UPDATE `creature` SET `position_z`=24.8823 WHERE `guid`=6626;
+UPDATE `creature` SET `position_z`=27.8288 WHERE `guid`=6628;
+UPDATE `creature` SET `position_z`=23.0896 WHERE `guid`=6629;
+UPDATE `creature` SET `position_z`=25.0703 WHERE `guid`=6630;
+UPDATE `creature` SET `position_z`=45.7307 WHERE `guid`=6631;
+UPDATE `creature` SET `position_z`=40.7184 WHERE `guid`=7393;
+UPDATE `creature` SET `position_z`=43.2758 WHERE `guid`=7394;
+UPDATE `creature` SET `position_z`=42.1677 WHERE `guid`=7395;
+UPDATE `creature` SET `position_z`=43.7699 WHERE `guid`=7396;
+UPDATE `creature` SET `position_z`=24.3124 WHERE `guid`=7398;
+UPDATE `creature` SET `position_z`=51.8605 WHERE `guid`=7399;
+UPDATE `creature` SET `position_z`=23.9774 WHERE `guid`=7415;
+UPDATE `creature` SET `position_z`=34.2027 WHERE `guid`=7416;
+UPDATE `creature` SET `position_z`=1.30665 WHERE `guid`=7417;
+UPDATE `creature` SET `position_z`=33.6204 WHERE `guid`=7442;
+UPDATE `creature` SET `position_z`=57.0749 WHERE `guid`=7443;
+UPDATE `creature` SET `position_z`=24.3465 WHERE `guid`=7444;
+UPDATE `creature` SET `position_z`=24.4324 WHERE `guid`=7446;
+UPDATE `creature` SET `position_z`=49.9681 WHERE `guid`=7447;
+UPDATE `creature` SET `position_z`=24.6611 WHERE `guid`=7448;
+UPDATE `creature` SET `position_z`=59.0132 WHERE `guid`=7449;
+UPDATE `creature` SET `position_z`=36.565 WHERE `guid`=7451;
+UPDATE `creature` SET `position_z`=24.3856 WHERE `guid`=7453;
+UPDATE `creature` SET `position_z`=22.6464 WHERE `guid`=7463;
+UPDATE `creature` SET `position_z`=25.0703 WHERE `guid`=7478;
+UPDATE `creature` SET `position_z`=24.8746 WHERE `guid`=7479;
+UPDATE `creature` SET `position_z`=23.0896 WHERE `guid`=7481;
+UPDATE `creature` SET `position_z`=61.5564 WHERE `guid`=7943;
+UPDATE `creature` SET `position_z`=26.5265 WHERE `guid`=7946;
+UPDATE `creature` SET `position_z`=22.0298 WHERE `guid`=7948;
+UPDATE `creature` SET `position_z`=20.3806 WHERE `guid`=7949;
+UPDATE `creature` SET `position_z`=39.5637 WHERE `guid`=7950;
+UPDATE `creature` SET `position_z`=29.47 WHERE `guid`=7968;
+UPDATE `creature` SET `position_z`=29.47 WHERE `guid`=7969;
+UPDATE `creature` SET `position_z`=23.1332 WHERE `guid`=7970;
+UPDATE `creature` SET `position_z`=56.1082 WHERE `guid`=7971;
+UPDATE `creature` SET `position_z`=58.903 WHERE `guid`=7972;
+UPDATE `creature` SET `position_z`=24.6611 WHERE `guid`=7973;
+UPDATE `creature` SET `position_z`=32.0256 WHERE `guid`=8521;
+UPDATE `creature` SET `position_z`=22.2699 WHERE `guid`=8522;
+UPDATE `creature` SET `position_z`=42.9595 WHERE `guid`=8524;
+UPDATE `creature` SET `position_z`=34.2028 WHERE `guid`=8525;
+UPDATE `creature` SET `position_z`=19.0255 WHERE `guid`=8526;
+UPDATE `creature` SET `position_z`=1.42149 WHERE `guid`=8528;
+UPDATE `creature` SET `position_z`=21.6833 WHERE `guid`=8529;
+UPDATE `creature` SET `position_z`=20.3806 WHERE `guid`=8530;
+UPDATE `creature` SET `position_z`=50.676 WHERE `guid`=10297;
+UPDATE `creature` SET `position_z`=51.8605 WHERE `guid`=10298;
+UPDATE `creature` SET `position_z`=89.1006 WHERE `guid`=10299;
+UPDATE `creature` SET `position_z`=38.3247 WHERE `guid`=10347;
+UPDATE `creature` SET `position_z`=12.6287 WHERE `guid`=10348;
+UPDATE `creature` SET `position_z`=8.34344 WHERE `guid`=10350;
+UPDATE `creature` SET `position_z`=27.3252 WHERE `guid`=10351;
+UPDATE `creature` SET `position_z`=50.6571 WHERE `guid`=10353;
+UPDATE `creature` SET `position_z`=16.9618 WHERE `guid`=10450;
+UPDATE `creature` SET `position_z`=28.7417 WHERE `guid`=10462;
+UPDATE `creature` SET `position_z`=42.8978 WHERE `guid`=10463;
+UPDATE `creature` SET `position_z`=25.3738 WHERE `guid`=10464;
+UPDATE `creature` SET `position_z`=10.2102 WHERE `guid`=10466;
+UPDATE `creature` SET `position_z`=34.2031 WHERE `guid`=10468;
+UPDATE `creature` SET `position_z`=51.8605 WHERE `guid`=10469;
+UPDATE `creature` SET `position_z`=48.1737 WHERE `guid`=11789;
+UPDATE `creature` SET `position_z`=41.2554 WHERE `guid`=11790;
+UPDATE `creature` SET `position_z`=32.3573 WHERE `guid`=11791;
+UPDATE `creature` SET `position_z`=23.0309 WHERE `guid`=11792;
+UPDATE `creature` SET `position_z`=20.8657 WHERE `guid`=11793;
+UPDATE `creature` SET `position_z`=20.3791 WHERE `guid`=11796;
+UPDATE `creature` SET `position_z`=15.7167 WHERE `guid`=12325;
+UPDATE `creature` SET `position_z`=47.7062 WHERE `guid`=34033;
+UPDATE `creature` SET `position_z`=47.7279 WHERE `guid`=34045;
+UPDATE `creature` SET `position_z`=16.1422 WHERE `guid`=54395;
+UPDATE `creature` SET `position_z`=41.4601 WHERE `guid`=88227;
+UPDATE `creature` SET `position_z`=56.375 WHERE `guid`=125681;
+UPDATE `creature` SET `position_z`=56.3812 WHERE `guid`=125682;
+UPDATE `creature` SET `position_z`=55.4386 WHERE `guid`=125683;
+UPDATE `creature` SET `position_z`=55.4386 WHERE `guid`=125685;
+UPDATE `creature` SET `position_z`=55.4383 WHERE `guid`=125686;
+UPDATE `creature` SET `position_z`=55.4259 WHERE `guid`=125687;
+UPDATE `creature` SET `position_z`=56.3299 WHERE `guid`=202481;
+UPDATE `creature` SET `position_z`=49.696 WHERE `guid`=208201;
+UPDATE `creature` SET `position_z`=50.3115 WHERE `guid`=208202;
+UPDATE `creature` SET `position_z`=8.17793 WHERE `guid`=3370;
+UPDATE `creature` SET `position_z`=51.2651 WHERE `guid`=3383;
+UPDATE `creature` SET `position_z`=-7.65161 WHERE `guid`=3389;
+UPDATE `creature` SET `position_z`=25.5456 WHERE `guid`=3390;
+UPDATE `creature` SET `position_z`=-17.1206 WHERE `guid`=3415;
+UPDATE `creature` SET `position_z`=-15.2075 WHERE `guid`=3419;
+UPDATE `creature` SET `position_z`=6.22131 WHERE `guid`=3451;
+UPDATE `creature` SET `position_z`=-14.5556 WHERE `guid`=3452;
+UPDATE `creature` SET `position_z`=7.56427 WHERE `guid`=3454;
+UPDATE `creature` SET `position_z`=-12.0871 WHERE `guid`=3455;
+UPDATE `creature` SET `position_z`=-14.5352 WHERE `guid`=3456;
+UPDATE `creature` SET `position_z`=-15.3924 WHERE `guid`=3457;
+UPDATE `creature` SET `position_z`=7.39614 WHERE `guid`=3458;
+UPDATE `creature` SET `position_z`=-15.7114 WHERE `guid`=3459;
+UPDATE `creature` SET `position_z`=-12.0871 WHERE `guid`=3460;
+UPDATE `creature` SET `position_z`=-14.5713 WHERE `guid`=3461;
+UPDATE `creature` SET `position_z`=27.1175 WHERE `guid`=4674;
+UPDATE `creature` SET `position_z`=-7.58884 WHERE `guid`=6458;
+UPDATE `creature` SET `position_z`=5.41958 WHERE `guid`=6559;
+UPDATE `creature` SET `position_z`=7.7578 WHERE `guid`=6593;
+UPDATE `creature` SET `position_z`=8.06748 WHERE `guid`=6594;
+UPDATE `creature` SET `position_z`=7.8189 WHERE `guid`=6595;
+UPDATE `creature` SET `position_z`=-14.5713 WHERE `guid`=6596;
+UPDATE `creature` SET `position_z`=54.5496 WHERE `guid`=6607;
+UPDATE `creature` SET `position_z`=11.9426 WHERE `guid`=7420;
+UPDATE `creature` SET `position_z`=7.24308 WHERE `guid`=7942;
+UPDATE `creature` SET `position_z`=-9.58947 WHERE `guid`=11794;
+UPDATE `creature` SET `position_z`=-7.75491 WHERE `guid`=34037;
+
+-- Update position_z of creatures of waypoint_data in Orgrimmar
+UPDATE `waypoint_data` SET `position_z`=42.2898 WHERE `id`=33490 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=44.439 WHERE `id`=33490 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=45.2569 WHERE `id`=33490 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=46.8662 WHERE `id`=33490 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=47.6712 WHERE `id`=33490 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=50.5004 WHERE `id`=33490 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=51.4941 WHERE `id`=33490 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=51.5071 WHERE `id`=33490 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=50.1122 WHERE `id`=33490 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=47.0227 WHERE `id`=33490 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=43.8508 WHERE `id`=33490 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=41.5341 WHERE `id`=33490 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=39.8967 WHERE `id`=33490 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=39.7975 WHERE `id`=33490 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=41.0009 WHERE `id`=33490 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=42.0826 WHERE `id`=33490 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=39.8494 WHERE `id`=33490 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=34.1431 WHERE `id`=33490 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=30.5475 WHERE `id`=33490 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=30.4135 WHERE `id`=33490 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=25.6735 WHERE `id`=33490 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=20.3812 WHERE `id`=33490 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=20.4222 WHERE `id`=33490 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=21.7897 WHERE `id`=33490 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=20.5883 WHERE `id`=33490 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=21.6026 WHERE `id`=33490 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=23.1956 WHERE `id`=33490 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=23.052 WHERE `id`=33490 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=25.2749 WHERE `id`=33490 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=27.8914 WHERE `id`=33490 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=24.9502 WHERE `id`=33490 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=20.5259 WHERE `id`=33490 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=20.6638 WHERE `id`=33490 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=24.4734 WHERE `id`=33490 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=26.717 WHERE `id`=33490 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=28.5543 WHERE `id`=33490 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=33.1554 WHERE `id`=33490 AND `point`=37;
+UPDATE `waypoint_data` SET `position_z`=36.8258 WHERE `id`=33490 AND `point`=38;
+UPDATE `waypoint_data` SET `position_z`=37.7082 WHERE `id`=33490 AND `point`=39;
+UPDATE `waypoint_data` SET `position_z`=36.0572 WHERE `id`=33490 AND `point`=40;
+UPDATE `waypoint_data` SET `position_z`=36.8508 WHERE `id`=33490 AND `point`=41;
+UPDATE `waypoint_data` SET `position_z`=34.5294 WHERE `id`=33490 AND `point`=42;
+UPDATE `waypoint_data` SET `position_z`=30.6648 WHERE `id`=33490 AND `point`=43;
+UPDATE `waypoint_data` SET `position_z`=25.4816 WHERE `id`=33490 AND `point`=44;
+UPDATE `waypoint_data` SET `position_z`=23.4161 WHERE `id`=33490 AND `point`=45;
+UPDATE `waypoint_data` SET `position_z`=20.0109 WHERE `id`=33490 AND `point`=46;
+UPDATE `waypoint_data` SET `position_z`=16.7241 WHERE `id`=33490 AND `point`=47;
+UPDATE `waypoint_data` SET `position_z`=15.265 WHERE `id`=33490 AND `point`=48;
+UPDATE `waypoint_data` SET `position_z`=16.6205 WHERE `id`=33490 AND `point`=49;
+UPDATE `waypoint_data` SET `position_z`=17.2988 WHERE `id`=33490 AND `point`=50;
+UPDATE `waypoint_data` SET `position_z`=19.3613 WHERE `id`=33490 AND `point`=51;
+UPDATE `waypoint_data` SET `position_z`=22.073 WHERE `id`=33490 AND `point`=52;
+UPDATE `waypoint_data` SET `position_z`=24.6485 WHERE `id`=33490 AND `point`=53;
+UPDATE `waypoint_data` SET `position_z`=28.5751 WHERE `id`=33490 AND `point`=54;
+UPDATE `waypoint_data` SET `position_z`=34.0448 WHERE `id`=33490 AND `point`=55;
+UPDATE `waypoint_data` SET `position_z`=37.1057 WHERE `id`=33490 AND `point`=56;
+UPDATE `waypoint_data` SET `position_z`=36.5887 WHERE `id`=33490 AND `point`=57;
+UPDATE `waypoint_data` SET `position_z`=37.7412 WHERE `id`=33490 AND `point`=58;
+UPDATE `waypoint_data` SET `position_z`=36.8886 WHERE `id`=33490 AND `point`=59;
+UPDATE `waypoint_data` SET `position_z`=33.3849 WHERE `id`=33490 AND `point`=60;
+UPDATE `waypoint_data` SET `position_z`=28.5538 WHERE `id`=33490 AND `point`=61;
+UPDATE `waypoint_data` SET `position_z`=26.7331 WHERE `id`=33490 AND `point`=62;
+UPDATE `waypoint_data` SET `position_z`=24.6248 WHERE `id`=33490 AND `point`=63;
+UPDATE `waypoint_data` SET `position_z`=21.0204 WHERE `id`=33490 AND `point`=64;
+UPDATE `waypoint_data` SET `position_z`=21.0847 WHERE `id`=33490 AND `point`=65;
+UPDATE `waypoint_data` SET `position_z`=20.4857 WHERE `id`=33490 AND `point`=66;
+UPDATE `waypoint_data` SET `position_z`=20.018 WHERE `id`=33490 AND `point`=67;
+UPDATE `waypoint_data` SET `position_z`=19.9965 WHERE `id`=33490 AND `point`=68;
+UPDATE `waypoint_data` SET `position_z`=19.2219 WHERE `id`=33490 AND `point`=69;
+UPDATE `waypoint_data` SET `position_z`=18.0342 WHERE `id`=33490 AND `point`=70;
+UPDATE `waypoint_data` SET `position_z`=15.1705 WHERE `id`=33490 AND `point`=71;
+UPDATE `waypoint_data` SET `position_z`=12.0664 WHERE `id`=33490 AND `point`=72;
+UPDATE `waypoint_data` SET `position_z`=9.32028 WHERE `id`=33490 AND `point`=73;
+UPDATE `waypoint_data` SET `position_z`=5.44031 WHERE `id`=33490 AND `point`=74;
+UPDATE `waypoint_data` SET `position_z`=4.33596 WHERE `id`=33490 AND `point`=75;
+UPDATE `waypoint_data` SET `position_z`=3.97975 WHERE `id`=33490 AND `point`=76;
+UPDATE `waypoint_data` SET `position_z`=-1.17807 WHERE `id`=33490 AND `point`=77;
+UPDATE `waypoint_data` SET `position_z`=-7.75411 WHERE `id`=33490 AND `point`=78;
+UPDATE `waypoint_data` SET `position_z`=-10.3963 WHERE `id`=33490 AND `point`=79;
+UPDATE `waypoint_data` SET `position_z`=-11.2084 WHERE `id`=33490 AND `point`=80;
+UPDATE `waypoint_data` SET `position_z`=-9.98536 WHERE `id`=33490 AND `point`=81;
+UPDATE `waypoint_data` SET `position_z`=-2.54618 WHERE `id`=33490 AND `point`=82;
+UPDATE `waypoint_data` SET `position_z`=6.40101 WHERE `id`=33490 AND `point`=83;
+UPDATE `waypoint_data` SET `position_z`=7.2535 WHERE `id`=33490 AND `point`=84;
+UPDATE `waypoint_data` SET `position_z`=6.88502 WHERE `id`=33490 AND `point`=85;
+UPDATE `waypoint_data` SET `position_z`=6.52519 WHERE `id`=33490 AND `point`=86;
+UPDATE `waypoint_data` SET `position_z`=13.0254 WHERE `id`=33490 AND `point`=87;
+UPDATE `waypoint_data` SET `position_z`=15.0117 WHERE `id`=33490 AND `point`=88;
+UPDATE `waypoint_data` SET `position_z`=15.8436 WHERE `id`=33490 AND `point`=89;
+UPDATE `waypoint_data` SET `position_z`=18.8028 WHERE `id`=33490 AND `point`=90;
+UPDATE `waypoint_data` SET `position_z`=22.0627 WHERE `id`=33490 AND `point`=91;
+UPDATE `waypoint_data` SET `position_z`=27.8752 WHERE `id`=33490 AND `point`=92;
+UPDATE `waypoint_data` SET `position_z`=32.2749 WHERE `id`=33490 AND `point`=93;
+UPDATE `waypoint_data` SET `position_z`=38.0564 WHERE `id`=33490 AND `point`=94;
+UPDATE `waypoint_data` SET `position_z`=39.8355 WHERE `id`=33490 AND `point`=95;
+UPDATE `waypoint_data` SET `position_z`=40.4588 WHERE `id`=33490 AND `point`=96;
+UPDATE `waypoint_data` SET `position_z`=42.2085 WHERE `id`=33490 AND `point`=97;
+UPDATE `waypoint_data` SET `position_z`=44.2294 WHERE `id`=33490 AND `point`=98;
+UPDATE `waypoint_data` SET `position_z`=45.8303 WHERE `id`=33490 AND `point`=99;
+UPDATE `waypoint_data` SET `position_z`=47.9793 WHERE `id`=33490 AND `point`=100;
+UPDATE `waypoint_data` SET `position_z`=49.8508 WHERE `id`=33490 AND `point`=101;
+UPDATE `waypoint_data` SET `position_z`=51.2731 WHERE `id`=33490 AND `point`=102;
+UPDATE `waypoint_data` SET `position_z`=51.7483 WHERE `id`=33490 AND `point`=103;
+UPDATE `waypoint_data` SET `position_z`=49.5632 WHERE `id`=33490 AND `point`=104;
+UPDATE `waypoint_data` SET `position_z`=48.0689 WHERE `id`=33490 AND `point`=105;
+UPDATE `waypoint_data` SET `position_z`=46.344 WHERE `id`=33490 AND `point`=106;
+UPDATE `waypoint_data` SET `position_z`=44.7636 WHERE `id`=33490 AND `point`=107;
+UPDATE `waypoint_data` SET `position_z`=43.4472 WHERE `id`=33490 AND `point`=108;
+UPDATE `waypoint_data` SET `position_z`=21.0479 WHERE `id`=33860 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=20.8231 WHERE `id`=33860 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=22.3325 WHERE `id`=33860 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=20.3126 WHERE `id`=33860 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=19.9785 WHERE `id`=33860 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=20.6929 WHERE `id`=33860 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=24.8578 WHERE `id`=33860 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=29.285 WHERE `id`=33860 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=30.7964 WHERE `id`=33860 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=38.1295 WHERE `id`=33860 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=30.5289 WHERE `id`=33860 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=30.2389 WHERE `id`=33860 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=25.2523 WHERE `id`=33860 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=21.553 WHERE `id`=33860 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=19.7621 WHERE `id`=33860 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=20.6987 WHERE `id`=33860 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=22.0059 WHERE `id`=33860 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=20.676 WHERE `id`=33860 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=21.4187 WHERE `id`=33860 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=22.8002 WHERE `id`=33860 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=23.7383 WHERE `id`=33860 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=23.2931 WHERE `id`=33860 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=24.3394 WHERE `id`=33860 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=28.2498 WHERE `id`=33860 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=26.0558 WHERE `id`=33860 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=22.694 WHERE `id`=33860 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=20.5885 WHERE `id`=33860 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=21.0235 WHERE `id`=33860 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=20.347 WHERE `id`=33860 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=20.131 WHERE `id`=33860 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=19.8671 WHERE `id`=33860 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=21.6847 WHERE `id`=33860 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=22.9029 WHERE `id`=33860 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=23.3003 WHERE `id`=33860 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=22.6343 WHERE `id`=33860 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=21.4686 WHERE `id`=33860 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=29.6181 WHERE `id`=34660 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=28.0923 WHERE `id`=34660 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=26.9266 WHERE `id`=34660 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=25.0408 WHERE `id`=34660 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=24.9073 WHERE `id`=34660 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=24.7236 WHERE `id`=34660 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=24.8179 WHERE `id`=34660 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=24.6478 WHERE `id`=34660 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=24.9631 WHERE `id`=34660 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=25.4097 WHERE `id`=34660 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=25.7316 WHERE `id`=34660 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=25.3839 WHERE `id`=34660 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=24.7333 WHERE `id`=34660 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=23.0695 WHERE `id`=34660 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=21.4347 WHERE `id`=34660 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=22.224 WHERE `id`=34660 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=21.5793 WHERE `id`=34660 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=22.7929 WHERE `id`=34660 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=24.3145 WHERE `id`=34660 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=25.4316 WHERE `id`=34660 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=25.5293 WHERE `id`=34660 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=25.4822 WHERE `id`=34660 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=24.4446 WHERE `id`=34660 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=24.6899 WHERE `id`=34660 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=24.5601 WHERE `id`=34660 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=25.1421 WHERE `id`=34660 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=28.4951 WHERE `id`=34660 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=34.5688 WHERE `id`=34660 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=42.1812 WHERE `id`=34660 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=47.822 WHERE `id`=34660 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=47.822 WHERE `id`=34660 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=54.6076 WHERE `id`=34660 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=54.4325 WHERE `id`=34660 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=47.5498 WHERE `id`=34660 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=42.43 WHERE `id`=34660 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=35.5604 WHERE `id`=34660 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=30.874 WHERE `id`=34660 AND `point`=37;
+UPDATE `waypoint_data` SET `position_z`=25.8945 WHERE `id`=34660 AND `point`=38;
+UPDATE `waypoint_data` SET `position_z`=25.0962 WHERE `id`=34660 AND `point`=39;
+UPDATE `waypoint_data` SET `position_z`=26.8797 WHERE `id`=34660 AND `point`=40;
+UPDATE `waypoint_data` SET `position_z`=28.7492 WHERE `id`=34660 AND `point`=41;
+UPDATE `waypoint_data` SET `position_z`=25.4492 WHERE `id`=47600 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=25.5889 WHERE `id`=47600 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=25.4113 WHERE `id`=47600 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=25.1665 WHERE `id`=47600 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=24.7394 WHERE `id`=47600 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=24.9107 WHERE `id`=47600 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=25.0114 WHERE `id`=47600 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=24.817 WHERE `id`=47600 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=25.3755 WHERE `id`=47600 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=31.1412 WHERE `id`=47600 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=35.6721 WHERE `id`=47600 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=37.9305 WHERE `id`=47600 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=39.5232 WHERE `id`=47600 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=40.3475 WHERE `id`=47600 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=43.1951 WHERE `id`=47600 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=47.4393 WHERE `id`=47600 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=44.2058 WHERE `id`=47600 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=42.4488 WHERE `id`=47600 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=39.4409 WHERE `id`=47600 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=38.7041 WHERE `id`=47600 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=35.5763 WHERE `id`=47600 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=30.8645 WHERE `id`=47600 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=25.4036 WHERE `id`=47600 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=24.9454 WHERE `id`=47600 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=24.8881 WHERE `id`=47600 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=24.8754 WHERE `id`=47600 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=24.5968 WHERE `id`=47600 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=24.922 WHERE `id`=47600 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=25.415 WHERE `id`=47600 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=25.6732 WHERE `id`=47600 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=25.6205 WHERE `id`=47600 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=16.5534 WHERE `id`=64940 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=17.0422 WHERE `id`=64940 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=19.6699 WHERE `id`=64940 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=19.6699 WHERE `id`=64940 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=21.718 WHERE `id`=64940 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=25.1657 WHERE `id`=64940 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=29.3144 WHERE `id`=64940 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=35.2116 WHERE `id`=64940 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=36.2948 WHERE `id`=64940 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=36.749 WHERE `id`=64940 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=37.6437 WHERE `id`=64940 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=37.0728 WHERE `id`=64940 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=33.297 WHERE `id`=64940 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=28.4823 WHERE `id`=64940 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=26.586 WHERE `id`=64940 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=24.9827 WHERE `id`=64940 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=20.8561 WHERE `id`=64940 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=20.5049 WHERE `id`=64940 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=22.3589 WHERE `id`=64940 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=24.8879 WHERE `id`=64940 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=27.8843 WHERE `id`=64940 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=28.4024 WHERE `id`=64940 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=32.3983 WHERE `id`=64940 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=34.1209 WHERE `id`=64940 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=34.1209 WHERE `id`=64940 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=34.1209 WHERE `id`=64940 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=34.1209 WHERE `id`=64940 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=34.0518 WHERE `id`=64940 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=32.5751 WHERE `id`=64940 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=30.0143 WHERE `id`=64940 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=27.2741 WHERE `id`=64940 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=25.0239 WHERE `id`=64940 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=24.9744 WHERE `id`=64940 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=24.563 WHERE `id`=64940 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=24.7089 WHERE `id`=64940 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=25.0859 WHERE `id`=64940 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=25.14 WHERE `id`=64940 AND `point`=37;
+UPDATE `waypoint_data` SET `position_z`=24.8114 WHERE `id`=64940 AND `point`=38;
+UPDATE `waypoint_data` SET `position_z`=25.3842 WHERE `id`=64940 AND `point`=39;
+UPDATE `waypoint_data` SET `position_z`=26.0684 WHERE `id`=64940 AND `point`=40;
+UPDATE `waypoint_data` SET `position_z`=25.8326 WHERE `id`=64940 AND `point`=41;
+UPDATE `waypoint_data` SET `position_z`=26.0436 WHERE `id`=64940 AND `point`=42;
+UPDATE `waypoint_data` SET `position_z`=25.3543 WHERE `id`=64940 AND `point`=43;
+UPDATE `waypoint_data` SET `position_z`=24.9932 WHERE `id`=64940 AND `point`=44;
+UPDATE `waypoint_data` SET `position_z`=25.1768 WHERE `id`=64940 AND `point`=45;
+UPDATE `waypoint_data` SET `position_z`=24.6655 WHERE `id`=64940 AND `point`=46;
+UPDATE `waypoint_data` SET `position_z`=24.6691 WHERE `id`=64940 AND `point`=47;
+UPDATE `waypoint_data` SET `position_z`=24.7183 WHERE `id`=64940 AND `point`=48;
+UPDATE `waypoint_data` SET `position_z`=24.9872 WHERE `id`=64940 AND `point`=49;
+UPDATE `waypoint_data` SET `position_z`=26.3284 WHERE `id`=64940 AND `point`=50;
+UPDATE `waypoint_data` SET `position_z`=27.1575 WHERE `id`=64940 AND `point`=51;
+UPDATE `waypoint_data` SET `position_z`=29.2673 WHERE `id`=64940 AND `point`=52;
+UPDATE `waypoint_data` SET `position_z`=30.8212 WHERE `id`=64940 AND `point`=53;
+UPDATE `waypoint_data` SET `position_z`=34.1192 WHERE `id`=64940 AND `point`=54;
+UPDATE `waypoint_data` SET `position_z`=34.1216 WHERE `id`=64940 AND `point`=55;
+UPDATE `waypoint_data` SET `position_z`=34.1216 WHERE `id`=64940 AND `point`=56;
+UPDATE `waypoint_data` SET `position_z`=34.1207 WHERE `id`=64940 AND `point`=57;
+UPDATE `waypoint_data` SET `position_z`=28.687 WHERE `id`=64940 AND `point`=58;
+UPDATE `waypoint_data` SET `position_z`=28.1204 WHERE `id`=64940 AND `point`=59;
+UPDATE `waypoint_data` SET `position_z`=27.6289 WHERE `id`=64940 AND `point`=60;
+UPDATE `waypoint_data` SET `position_z`=24.9777 WHERE `id`=64940 AND `point`=61;
+UPDATE `waypoint_data` SET `position_z`=23.9049 WHERE `id`=64940 AND `point`=62;
+UPDATE `waypoint_data` SET `position_z`=20.6127 WHERE `id`=64940 AND `point`=63;
+UPDATE `waypoint_data` SET `position_z`=21.0365 WHERE `id`=64940 AND `point`=64;
+UPDATE `waypoint_data` SET `position_z`=24.6568 WHERE `id`=64940 AND `point`=65;
+UPDATE `waypoint_data` SET `position_z`=26.2348 WHERE `id`=64940 AND `point`=66;
+UPDATE `waypoint_data` SET `position_z`=28.1394 WHERE `id`=64940 AND `point`=67;
+UPDATE `waypoint_data` SET `position_z`=33.2643 WHERE `id`=64940 AND `point`=68;
+UPDATE `waypoint_data` SET `position_z`=35.8824 WHERE `id`=64940 AND `point`=69;
+UPDATE `waypoint_data` SET `position_z`=37.8291 WHERE `id`=64940 AND `point`=70;
+UPDATE `waypoint_data` SET `position_z`=36.214 WHERE `id`=64940 AND `point`=71;
+UPDATE `waypoint_data` SET `position_z`=37.2203 WHERE `id`=64940 AND `point`=72;
+UPDATE `waypoint_data` SET `position_z`=34.4861 WHERE `id`=64940 AND `point`=73;
+UPDATE `waypoint_data` SET `position_z`=32.6852 WHERE `id`=64940 AND `point`=74;
+UPDATE `waypoint_data` SET `position_z`=25.9567 WHERE `id`=64940 AND `point`=75;
+UPDATE `waypoint_data` SET `position_z`=24.3578 WHERE `id`=64940 AND `point`=76;
+UPDATE `waypoint_data` SET `position_z`=22.8797 WHERE `id`=64940 AND `point`=77;
+UPDATE `waypoint_data` SET `position_z`=22.8797 WHERE `id`=64940 AND `point`=78;
+UPDATE `waypoint_data` SET `position_z`=18.6409 WHERE `id`=64940 AND `point`=79;
+UPDATE `waypoint_data` SET `position_z`=16.2803 WHERE `id`=64940 AND `point`=80;
+UPDATE `waypoint_data` SET `position_z`=10.1957 WHERE `id`=64960 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=10.5208 WHERE `id`=64960 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=13.1127 WHERE `id`=64960 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=16.4746 WHERE `id`=64960 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=16.7967 WHERE `id`=64960 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=20.2681 WHERE `id`=64960 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=22.7772 WHERE `id`=64960 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=24.4373 WHERE `id`=64960 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=24.2964 WHERE `id`=64960 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=31.1549 WHERE `id`=64960 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=32.5471 WHERE `id`=64960 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=32.5471 WHERE `id`=64960 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=34.1886 WHERE `id`=64960 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=36.2424 WHERE `id`=64960 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=38.9411 WHERE `id`=64960 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=41.0289 WHERE `id`=64960 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=43.878 WHERE `id`=64960 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=46.2966 WHERE `id`=64960 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=48.3344 WHERE `id`=64960 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=50.4388 WHERE `id`=64960 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=52.2957 WHERE `id`=64960 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=54.135 WHERE `id`=64960 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=56.9023 WHERE `id`=64960 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=58.8767 WHERE `id`=64960 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=60.2256 WHERE `id`=64960 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=61.3911 WHERE `id`=64960 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=61.473 WHERE `id`=64960 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=61.473 WHERE `id`=64960 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=61.473 WHERE `id`=64960 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=61.473 WHERE `id`=64960 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=61.473 WHERE `id`=64960 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=61.473 WHERE `id`=64960 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=61.1574 WHERE `id`=64960 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=59.6476 WHERE `id`=64960 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=57.3989 WHERE `id`=64960 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=55.5328 WHERE `id`=64960 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=53.5884 WHERE `id`=64960 AND `point`=37;
+UPDATE `waypoint_data` SET `position_z`=51.9071 WHERE `id`=64960 AND `point`=38;
+UPDATE `waypoint_data` SET `position_z`=49.8894 WHERE `id`=64960 AND `point`=39;
+UPDATE `waypoint_data` SET `position_z`=47.6075 WHERE `id`=64960 AND `point`=40;
+UPDATE `waypoint_data` SET `position_z`=45.7773 WHERE `id`=64960 AND `point`=41;
+UPDATE `waypoint_data` SET `position_z`=44.0518 WHERE `id`=64960 AND `point`=42;
+UPDATE `waypoint_data` SET `position_z`=41.8583 WHERE `id`=64960 AND `point`=43;
+UPDATE `waypoint_data` SET `position_z`=39.5528 WHERE `id`=64960 AND `point`=44;
+UPDATE `waypoint_data` SET `position_z`=36.6035 WHERE `id`=64960 AND `point`=45;
+UPDATE `waypoint_data` SET `position_z`=34.5862 WHERE `id`=64960 AND `point`=46;
+UPDATE `waypoint_data` SET `position_z`=32.8839 WHERE `id`=64960 AND `point`=47;
+UPDATE `waypoint_data` SET `position_z`=32.5469 WHERE `id`=64960 AND `point`=48;
+UPDATE `waypoint_data` SET `position_z`=31.8804 WHERE `id`=64960 AND `point`=49;
+UPDATE `waypoint_data` SET `position_z`=24.1762 WHERE `id`=64960 AND `point`=50;
+UPDATE `waypoint_data` SET `position_z`=24.1984 WHERE `id`=64960 AND `point`=51;
+UPDATE `waypoint_data` SET `position_z`=24.3252 WHERE `id`=64960 AND `point`=52;
+UPDATE `waypoint_data` SET `position_z`=20.6713 WHERE `id`=64960 AND `point`=53;
+UPDATE `waypoint_data` SET `position_z`=17.9308 WHERE `id`=64960 AND `point`=54;
+UPDATE `waypoint_data` SET `position_z`=16.5906 WHERE `id`=64960 AND `point`=55;
+UPDATE `waypoint_data` SET `position_z`=14.5807 WHERE `id`=64960 AND `point`=56;
+UPDATE `waypoint_data` SET `position_z`=9.84656 WHERE `id`=64960 AND `point`=57;
+UPDATE `waypoint_data` SET `position_z`=6.24555 WHERE `id`=64960 AND `point`=58;
+UPDATE `waypoint_data` SET `position_z`=5.41888 WHERE `id`=64960 AND `point`=59;
+UPDATE `waypoint_data` SET `position_z`=9.52929 WHERE `id`=64960 AND `point`=60;
+UPDATE `waypoint_data` SET `position_z`=13.7988 WHERE `id`=64960 AND `point`=61;
+UPDATE `waypoint_data` SET `position_z`=19.2445 WHERE `id`=64960 AND `point`=62;
+UPDATE `waypoint_data` SET `position_z`=22.6877 WHERE `id`=64960 AND `point`=63;
+UPDATE `waypoint_data` SET `position_z`=24.5636 WHERE `id`=64960 AND `point`=64;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=64960 AND `point`=65;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=64960 AND `point`=66;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=64960 AND `point`=67;
+UPDATE `waypoint_data` SET `position_z`=23.9141 WHERE `id`=64960 AND `point`=68;
+UPDATE `waypoint_data` SET `position_z`=21.5414 WHERE `id`=64960 AND `point`=69;
+UPDATE `waypoint_data` SET `position_z`=10.799 WHERE `id`=64960 AND `point`=70;
+UPDATE `waypoint_data` SET `position_z`=7.44002 WHERE `id`=64960 AND `point`=71;
+UPDATE `waypoint_data` SET `position_z`=5.9969 WHERE `id`=64960 AND `point`=72;
+UPDATE `waypoint_data` SET `position_z`=5.82737 WHERE `id`=64960 AND `point`=73;
+UPDATE `waypoint_data` SET `position_z`=9.09967 WHERE `id`=64960 AND `point`=74;
+UPDATE `waypoint_data` SET `position_z`=33.2136 WHERE `id`=65620 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=29.4396 WHERE `id`=65620 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=25.1061 WHERE `id`=65620 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=24.2403 WHERE `id`=65620 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=20.408 WHERE `id`=65620 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=23.1078 WHERE `id`=65620 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=24.7183 WHERE `id`=65620 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=24.1141 WHERE `id`=65620 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=31.4118 WHERE `id`=65620 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=23.6516 WHERE `id`=65620 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=24.2486 WHERE `id`=65620 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=24.3847 WHERE `id`=65620 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=20.5103 WHERE `id`=65620 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=17.1567 WHERE `id`=65620 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=17.6448 WHERE `id`=65620 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=19.5593 WHERE `id`=65620 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=19.2262 WHERE `id`=65620 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=19.612 WHERE `id`=65620 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=17.8197 WHERE `id`=65620 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=17.7317 WHERE `id`=65620 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=16.9771 WHERE `id`=65620 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=16.4859 WHERE `id`=65620 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=12.9136 WHERE `id`=65620 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=8.00582 WHERE `id`=65620 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=5.17322 WHERE `id`=65620 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=7.40619 WHERE `id`=65620 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=5.55577 WHERE `id`=65620 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=9.21356 WHERE `id`=65620 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=10.5345 WHERE `id`=65620 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=13.4558 WHERE `id`=65620 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=16.63 WHERE `id`=65620 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=17.4295 WHERE `id`=65620 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=20.9284 WHERE `id`=65620 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=24.2458 WHERE `id`=65620 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=26.9719 WHERE `id`=65620 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=32.6664 WHERE `id`=65620 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=33.3772 WHERE `id`=74210 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=33.3218 WHERE `id`=74210 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=35.4199 WHERE `id`=74210 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=35.4983 WHERE `id`=74210 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=35.2273 WHERE `id`=74210 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=34.0587 WHERE `id`=74210 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=33.7049 WHERE `id`=74210 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=29.5351 WHERE `id`=74210 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=26.0822 WHERE `id`=74210 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=24.8848 WHERE `id`=74210 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=24.981 WHERE `id`=74210 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=24.7428 WHERE `id`=74210 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=24.6681 WHERE `id`=74210 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=24.5031 WHERE `id`=74210 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=25.1782 WHERE `id`=74210 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=25.6446 WHERE `id`=74210 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=25.4251 WHERE `id`=74210 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=24.7558 WHERE `id`=74210 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=23.4433 WHERE `id`=74210 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=21.8056 WHERE `id`=74210 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=22.8366 WHERE `id`=74210 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=22.484 WHERE `id`=74210 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=21.3471 WHERE `id`=74210 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=21.7112 WHERE `id`=74210 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=23.6798 WHERE `id`=74210 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=24.9615 WHERE `id`=74210 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=25.5688 WHERE `id`=74210 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=25.2362 WHERE `id`=74210 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=25.2314 WHERE `id`=74210 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=24.5529 WHERE `id`=74210 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=24.6942 WHERE `id`=74210 AND `point`=31;
+UPDATE `waypoint_data` SET `position_z`=25.0224 WHERE `id`=74210 AND `point`=32;
+UPDATE `waypoint_data` SET `position_z`=25.016 WHERE `id`=74210 AND `point`=33;
+UPDATE `waypoint_data` SET `position_z`=27.3217 WHERE `id`=74210 AND `point`=34;
+UPDATE `waypoint_data` SET `position_z`=29.7266 WHERE `id`=74210 AND `point`=35;
+UPDATE `waypoint_data` SET `position_z`=33.3232 WHERE `id`=74210 AND `point`=36;
+UPDATE `waypoint_data` SET `position_z`=35.2087 WHERE `id`=74210 AND `point`=37;
+UPDATE `waypoint_data` SET `position_z`=35.6738 WHERE `id`=74210 AND `point`=38;
+UPDATE `waypoint_data` SET `position_z`=33.4597 WHERE `id`=74210 AND `point`=39;
+UPDATE `waypoint_data` SET `position_z`=25.4623 WHERE `id`=85270 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=27.1503 WHERE `id`=85270 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=27.2424 WHERE `id`=85270 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=27.2424 WHERE `id`=85270 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=25.4628 WHERE `id`=85270 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=25.4628 WHERE `id`=85270 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=25.4622 WHERE `id`=85270 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=24.9042 WHERE `id`=85270 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=20.9907 WHERE `id`=85270 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=10.78 WHERE `id`=85270 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=7.17907 WHERE `id`=85270 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=5.61174 WHERE `id`=85270 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=6.62944 WHERE `id`=85270 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=10.2071 WHERE `id`=85270 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=10.735 WHERE `id`=85270 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=14.1398 WHERE `id`=85270 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=16.5963 WHERE `id`=85270 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=16.7235 WHERE `id`=85270 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=14.8528 WHERE `id`=85270 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=10.9639 WHERE `id`=85270 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=7.72788 WHERE `id`=85270 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=4.99562 WHERE `id`=85270 AND `point`=22;
+UPDATE `waypoint_data` SET `position_z`=7.91381 WHERE `id`=85270 AND `point`=23;
+UPDATE `waypoint_data` SET `position_z`=13.2664 WHERE `id`=85270 AND `point`=24;
+UPDATE `waypoint_data` SET `position_z`=21.7764 WHERE `id`=85270 AND `point`=25;
+UPDATE `waypoint_data` SET `position_z`=24.3245 WHERE `id`=85270 AND `point`=26;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=85270 AND `point`=27;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=85270 AND `point`=28;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=85270 AND `point`=29;
+UPDATE `waypoint_data` SET `position_z`=25.4625 WHERE `id`=85270 AND `point`=30;
+UPDATE `waypoint_data` SET `position_z`=27.3598 WHERE `id`=104670 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=25.0241 WHERE `id`=104670 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=20.3054 WHERE `id`=104670 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=12.7549 WHERE `id`=104670 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=6.51173 WHERE `id`=104670 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=3.20279 WHERE `id`=104670 AND `point`=6;
+UPDATE `waypoint_data` SET `position_z`=0.895286 WHERE `id`=104670 AND `point`=7;
+UPDATE `waypoint_data` SET `position_z`=0.974935 WHERE `id`=104670 AND `point`=8;
+UPDATE `waypoint_data` SET `position_z`=1.99729 WHERE `id`=104670 AND `point`=9;
+UPDATE `waypoint_data` SET `position_z`=1.61127 WHERE `id`=104670 AND `point`=10;
+UPDATE `waypoint_data` SET `position_z`=0.971711 WHERE `id`=104670 AND `point`=11;
+UPDATE `waypoint_data` SET `position_z`=2.63885 WHERE `id`=104670 AND `point`=12;
+UPDATE `waypoint_data` SET `position_z`=8.65645 WHERE `id`=104670 AND `point`=13;
+UPDATE `waypoint_data` SET `position_z`=9.85718 WHERE `id`=104670 AND `point`=14;
+UPDATE `waypoint_data` SET `position_z`=10.4431 WHERE `id`=104670 AND `point`=15;
+UPDATE `waypoint_data` SET `position_z`=12.4374 WHERE `id`=104670 AND `point`=16;
+UPDATE `waypoint_data` SET `position_z`=16.4966 WHERE `id`=104670 AND `point`=17;
+UPDATE `waypoint_data` SET `position_z`=16.8066 WHERE `id`=104670 AND `point`=18;
+UPDATE `waypoint_data` SET `position_z`=20.8983 WHERE `id`=104670 AND `point`=19;
+UPDATE `waypoint_data` SET `position_z`=24.2568 WHERE `id`=104670 AND `point`=20;
+UPDATE `waypoint_data` SET `position_z`=27.1251 WHERE `id`=104670 AND `point`=21;
+UPDATE `waypoint_data` SET `position_z`=34.1192 WHERE `id`=104700 AND `point`=1;
+UPDATE `waypoint_data` SET `position_z`=34.1206 WHERE `id`=104700 AND `point`=2;
+UPDATE `waypoint_data` SET `position_z`=34.1206 WHERE `id`=104700 AND `point`=3;
+UPDATE `waypoint_data` SET `position_z`=33.9944 WHERE `id`=104700 AND `point`=4;
+UPDATE `waypoint_data` SET `position_z`=34.121 WHERE `id`=104700 AND `point`=5;
+UPDATE `waypoint_data` SET `position_z`=34.121 WHERE `id`=104700 AND `point`=6;
+
+-- Delete bad grunt spawn
+DELETE FROM `creature` WHERE `guid` IN (10299);
diff --git a/sql/updates/world/3.3.5/2016_10_18_00_world.sql b/sql/updates/world/3.3.5/2016_10_18_00_world.sql
new file mode 100644
index 00000000000..711ca05eb0c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `ScriptName`="npc_magister_aledis" WHERE `entry`=20159;
diff --git a/sql/updates/world/3.3.5/2016_10_18_01_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_01_world_335.sql
new file mode 100644
index 00000000000..067350cb3ef
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_01_world_335.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `gameobject` WHERE `guid` IN (43078, 81120, 43079, 43067, 81129, 43046, 43045, 43053, 43054, 82876, 43052);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (43078, 81120, 43079, 43067, 81129, 43046, 43045, 43053, 43054, 82876, 43052);
diff --git a/sql/updates/world/3.3.5/2016_10_18_02_world.sql b/sql/updates/world/3.3.5/2016_10_18_02_world.sql
new file mode 100644
index 00000000000..f0a9902846c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_02_world.sql
@@ -0,0 +1,5 @@
+--
+DELETE FROM `quest_template_addon` WHERE `ID`=8312;
+DELETE FROM `conditions` WHERE `SourceGroup`=15354 AND `SourceEntry`=20557;
+INSERT INTO `conditions` VALUES
+(23, 15354, 20557, 0, 0, 8, 0, 8312, 0, 0, 0, 0, 0, "", "Item Hallow's End Pumpkin Treat sold by Rachelle Gothena requires quest Hallow's End Treats for Spoops! rewarded");
diff --git a/sql/updates/world/3.3.5/2016_10_18_03_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_03_world_335.sql
new file mode 100644
index 00000000000..2655317d4b8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_03_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `position_z`=10.3933 WHERE `guid`=134982;
diff --git a/sql/updates/world/3.3.5/2016_10_18_04_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_04_world_335.sql
new file mode 100644
index 00000000000..3eba72886f2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_04_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `position_x`=1655.578, `position_y`=-4435.211 WHERE `guid`=86234;
diff --git a/sql/updates/world/3.3.5/2016_10_18_05_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_05_world_335.sql
new file mode 100644
index 00000000000..895253f421d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_05_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature` SET `position_Z`=17.873 WHERE `guid`=86234;
diff --git a/sql/updates/world/3.3.5/2016_10_18_06_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_06_world_335.sql
new file mode 100644
index 00000000000..e9e7968df08
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_06_world_335.sql
@@ -0,0 +1,49 @@
+--
+SET @CGUID := 86582;
+SET @OGUID := 66913;
+SET @Event := 12;
+
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+8;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 23537, 530, 1, 1, 9229.309570, -6780.560059, 27.053900, 1.082100, 120, 0, 0),
+(@CGUID+1, 23537, 530, 1, 1, 9224.150391, -6777.709961, 28.385300, 0.663223, 120, 0, 0),
+(@CGUID+2, 23537, 530, 1, 1, 9224.700195, -6771.000000, 27.259501, 0.069812, 120, 0, 0),
+(@CGUID+3, 23537, 530, 1, 1, 9225.459961, -6765.229980, 26.058001, 5.794490, 120, 0, 0),
+(@CGUID+4, 23537, 530, 1, 1, -4210.676758, -12291.706055, 1.587878, 0.044762, 120, 0, 0),
+(@CGUID+5, 23537, 1, 1, 1, 284.369965, -4571.27002, 35.80556, 3.033128, 120, 0, 0),
+(@CGUID+6, 23537, 1, 1, 1, 292.79895, -4544.667969, 38.915844, 3.640020, 120, 0, 0),
+(@CGUID+7, 23537, 0, 1, 1, 2229.418945, 473.572235, 39.926392, 6.121745, 120, 0, 0),
+(@CGUID+8, 23537, 0, 1, 1, -9304.201172, 29.874376, 71.198364, 2.833013, 120, 0, 0);
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID AND @OGUID+16;
+INSERT INTO `gameobject` (`guid`, `id`, `map`,`zoneId`,`areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`,`VerifiedBuild`) VALUES
+(@OGUID+0,186720,530,0,0,1,1,-4210.676758, -12291.706055, 1.587878, 0.044762,0,0,0,0,180,100,1,0),
+(@OGUID+1,186234,530,0,0,1,1,-4164.268066, -12279.269531, -0.751072, 2.769312,0,0,0,0,180,100,1,0),
+(@OGUID+2,186615,530,0,0,1,1,-4166.730957, -12277.448242, -0.415201, 5.697277,0,0,0,0,180,100,1,0),
+(@OGUID+3,186614,530,0,0,1,1,-4166.223633, -12280.923828, -0.506239, 0.554489,0,0,0,0,180,100,1,0),
+(@OGUID+4,186615,0,0,0,1,1,-5750.119629, -485.775787, 396.965454, 2.553856,0,0,0,0,180,100,1,0),
+(@OGUID+5,186720,1,0,0,1,1,284.369965, -4571.27002, 35.80556, 3.033128,0,0,0.936673,0.350206,180,100,1,0),
+(@OGUID+6,186720,1,0,0,1,1,292.79895, -4544.667969, 38.915844, 3.640020,0,0,0.936673,0.350206,180,100,1,0),
+(@OGUID+7,186615,1,0,0,1,1,241.153595, -4563.961426, 14.254396, 0.721713,0,0,0,0,180,100,1,0),
+(@OGUID+8,186615,530,0,0,1,1,9236.260742, -6772.439453, 24.756542, 2.243101,0,0,0,0,180,100,1,0),
+(@OGUID+9,186720,0,0,0,1,1,2229.418945, 473.572235, 39.926392, 6.121745,0,0,0,0,180,100,1,0),
+(@OGUID+10,186234,0,0,0,1,1,2275.884766, 503.988312, 35.200726, 3.272932,0,0,0,0,180,100,1,0),
+(@OGUID+11,186615,0,0,0,1,1,2275.95459, 501.79629, 34.74936, 1.721770,0,0,0,0,180,100,1,0),
+(@OGUID+12,186720,0,0,0,1,1, -9304.201172, 29.874376, 71.198364, 2.833013,0,0,0.994522,0.104528,180,100,1,0),
+(@OGUID+13,186615,0,0,0,1,1, -9376.37109, 54.368896, 60.69603, 5.279530,0,0,0,0,180,100,1,0),
+(@OGUID+14,186234,0,0,0,1,1,-9433.50488, 60.31855, 56.57888, 5.952971,0,0,0,0,180,100,1,0),
+(@OGUID+15,186615,0,0,0,1,1,-9436.19238, 60.993786, 56.47847, 6.132042,0,0,0,0,180,100,1,0),
+(@OGUID+16,186615,530,0,0,1,1,9509.071289, -6810.86084, 16.49318, 5.904098,0,0,0,0,180,100,1,0);
+
+DELETE FROM `creature_addon` WHERE `guid`=10299;
+DELETE FROM `gameobject_addon` WHERE `guid` IN (@OGUID+5, @OGUID+6, @OGUID+12, 43067, 43078, 43079, 43045, 43046, 43052, 43053, 43054);
+INSERT INTO `gameobject_addon` (`guid`, `parent_rotation2`, `parent_rotation3`) VALUES
+(@OGUID+5, 0.936672, 0.350207),
+(@OGUID+6, 0.936672, 0.350207),
+(@OGUID+12, 0.994522, 0.104528);
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+8 AND `eventEntry`=@Event;
+INSERT INTO `game_event_creature` SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+8;
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+16 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+16;
diff --git a/sql/updates/world/3.3.5/2016_10_18_07_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_07_world_335.sql
new file mode 100644
index 00000000000..07391ab5034
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_07_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `AttributesMask`=0x8 WHERE `SpellId`=17941;
diff --git a/sql/updates/world/3.3.5/2016_10_18_08_world_335.sql b/sql/updates/world/3.3.5/2016_10_18_08_world_335.sql
new file mode 100644
index 00000000000..d0fb050aa62
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_18_08_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId`=-47516;
diff --git a/sql/updates/world/3.3.5/2016_10_19_00_world_335.sql b/sql/updates/world/3.3.5/2016_10_19_00_world_335.sql
new file mode 100644
index 00000000000..ef769535f36
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_19_00_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=0 WHERE `ID`=1657;
diff --git a/sql/updates/world/3.3.5/2016_10_20_00_world.sql b/sql/updates/world/3.3.5/2016_10_20_00_world.sql
new file mode 100644
index 00000000000..d2db94033ab
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_20_00_world.sql
@@ -0,0 +1 @@
+UPDATE `gameobject` SET `position_x`=4514.365, `position_y`=5703.074, `position_z`=81.5672, `orientation`=3.717554, `rotation2`=-0.9588194, `rotation3`=0.2840165 WHERE `guid`=87601;
diff --git a/sql/updates/world/3.3.5/2016_10_21_00_world.sql b/sql/updates/world/3.3.5/2016_10_21_00_world.sql
new file mode 100644
index 00000000000..00c773e398e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_21_00_world.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=43244;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(13, 1, 43244, 0, 0, 31, 0, 5, 186234, 0, 0, 0, 0, "", "Spell Headless Horseman - Create Water Bucket, Barrel Splash's EFFECT_0 targets gameobject Water Barrel");
+
+DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=42144;
+INSERT INTO `spell_linked_spell` (`spell_trigger`, `spell_effect`, `type`, `comment`) VALUES
+(42144, 42229, 1, "Spell Headless Horseman - Create Water Bucket triggers cast of Headless Horseman - Create Water Bucket (Cosmetic)");
diff --git a/sql/updates/world/3.3.5/2016_10_21_01_world.sql b/sql/updates/world/3.3.5/2016_10_21_01_world.sql
new file mode 100644
index 00000000000..3753e8fd9c7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_21_01_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `spell_script_names` WHERE `spell_id`=42336;
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(42336, "spell_hallows_end_has_water_bucket");
diff --git a/sql/updates/world/3.3.5/2016_10_21_02_world.sql b/sql/updates/world/3.3.5/2016_10_21_02_world.sql
new file mode 100644
index 00000000000..ce000dacadd
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_21_02_world.sql
@@ -0,0 +1,28 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`= 1081700 AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`= 10817 AND `source_type`=0 AND `id`>2;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(10817, 0, 3, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 9, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - On aggro - Say \'Line 9\''),
+(10817, 0, 4, 0, 1, 0, 100, 0, 5000, 5000, 60000, 60000, 80, 1081700, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Update OOC - Action list'),
+(1081700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 0\''),
+(1081700, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 1\''),
+(1081700, 9, 2, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 2\''),
+(1081700, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 3\''),
+(1081700, 9, 4, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 4\''),
+(1081700, 9, 5, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 5\''),
+(1081700, 9, 6, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 6\''),
+(1081700, 9, 7, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 7, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 7\''),
+(1081700, 9, 8, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Duggan Wildhammer - Action list - Say \'Line 8\'');
+
+DELETE FROM `creature_text` WHERE `entry`= 10817;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(10817, 0, 0, 'Ooooooooh...', 12, 0, 100, 15, 0, 0, 50906, 0, 'Duggan Wildhammer - Line 0'),
+(10817, 1, 0, 'To the plaguelands went old Duggan, ta\' send them Scourge back inta\' th\' groun\'.', 12, 0, 100, 1, 0, 0, 50907, 0, 'Duggan Wildhammer - Line 1'),
+(10817, 2, 0, 'Where th\' scent of death is on th\' wind and everythin\' is mostly brown.', 12, 0, 100, 6, 0, 0, 50908, 0, 'Duggan Wildhammer - Line 2'),
+(10817, 3, 0, 'An\' when he did arrive there, what\'d his dwarf eyes see?', 12, 0, 100, 25, 0, 0, 50909, 0, 'Duggan Wildhammer - Line 3'),
+(10817, 4, 0, 'A hundred crates of barley there ta\' be makin\' inta\' mead!', 12, 0, 100, 5, 0, 0, 50910, 0, 'Duggan Wildhammer - Line 4'),
+(10817, 5, 0, 'But tha\' mead was cursed with th\' plague o\' death, and now old Duggan, too.', 12, 0, 100, 18, 0, 0, 50911, 0, 'Duggan Wildhammer - Line 5'),
+(10817, 6, 0, 'An\' surrounded by the Lich King\'s beasts, what could old Duggan do?', 12, 0, 100, 430, 0, 0, 50912, 0, 'Duggan Wildhammer - Line 6'),
+(10817, 7, 0, 'But though I feel the plague within, my hopes \'ave not yet sunk.', 12, 0, 100, 274, 0, 0, 50913, 0, 'Duggan Wildhammer - Line 7'),
+(10817, 8, 0, 'If\'n I\'m gonna be Scourge anyway, I might as well be drunk!', 12, 0, 100, 11, 0, 0, 50914, 0, 'Duggan Wildhammer - Line 8'),
+(10817, 9, 0, 'Ah ken see very well through this haze, but I\'d know tha\' smell anywhere! Die ye foul ogre!', 12, 0, 100, 0, 0, 0, 50905, 0, 'Duggan Wildhammer - Line 9');
diff --git a/sql/updates/world/3.3.5/2016_10_22_00_world_335.sql b/sql/updates/world/3.3.5/2016_10_22_00_world_335.sql
new file mode 100644
index 00000000000..4b78ebc65bd
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_22_00_world_335.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `gameobject_template` WHERE `entry`=103575;
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `size`, `data0`, `data1`, `data2`, `data3`, `data6`, `VerifiedBuild`) VALUES
+(103575, 6, 327, "Containment Coffer TRAP", 1, 0, 0, 0, 9012, -1, -18019);
diff --git a/sql/updates/world/3.3.5/2016_10_23_00_world_335.sql b/sql/updates/world/3.3.5/2016_10_23_00_world_335.sql
new file mode 100644
index 00000000000..2d4ba2f10be
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_23_00_world_335.sql
@@ -0,0 +1,23 @@
+DELETE FROM `game_event` WHERE `eventEntry`=71;
+INSERT INTO `game_event` (`eventEntry`, `start_time`, `end_time`, `occurence`, `length`, `holiday`, `description`, `world_event`, `announce`) VALUES
+(71, '2013-01-06 01:01:00', '2020-12-31 06:00:00', 131040, 8639, 0, 'Darkmoon Faire Building (Mulgore)', 0, 2);
+
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31878 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31874 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31875 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31877 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31879 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31876 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31918 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31919 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31872 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31915 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31916 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31913 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31912 AND `eventEntry`=24;
+UPDATE `game_event_gameobject` SET `eventEntry`=71 WHERE `guid`=31914 AND `eventEntry`=24;
+
+-- Add 14849 to full darkmoon molgure event
+DELETE FROM `game_event_creature` WHERE `guid`=137686;
+INSERT INTO `game_event_creature` (`eventEntry`, `guid`) VALUES
+(5, 137686);
diff --git a/sql/updates/world/3.3.5/2016_10_25_00_world.sql b/sql/updates/world/3.3.5/2016_10_25_00_world.sql
new file mode 100644
index 00000000000..5acfd2bdcd0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_25_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `quest_template_addon` SET `SpecialFlags`=`SpecialFlags`&~1 WHERE `ID` IN (908, 909, 1288, 3629, 3911, 5058, 7164, 7166, 7167, 7181, 7202, 7509, 7604, 7651, 8222, 8314, 8763, 9386);
diff --git a/sql/updates/world/3.3.5/2016_10_26_00_world.sql b/sql/updates/world/3.3.5/2016_10_26_00_world.sql
new file mode 100644
index 00000000000..15a1c9ccead
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_26_00_world.sql
@@ -0,0 +1 @@
+UPDATE `creature_template` SET `RegenHealth`=1 WHERE `entry` IN (37970,38401,38784,38785);
diff --git a/sql/updates/world/3.3.5/2016_10_26_01_world.sql b/sql/updates/world/3.3.5/2016_10_26_01_world.sql
new file mode 100644
index 00000000000..b2782f6c395
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_26_01_world.sql
@@ -0,0 +1,44 @@
+--
+DELETE FROM `creature_text` WHERE `entry` IN (6929, 11814, 6746, 6741, 6740, 5111, 6826, 6735);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(6929, 0, 0, "Ooo, so strong! Happy Hallow's End, $n!", 12, 0, 100, 23, 0, 0, 10789, 0, "Innkeeper Gryshka"),
+(11814, 0, 0, "Chugga-chugga, woo-woo! Happy Hallow's End, $n!", 12, 0, 100, 275, 0, 0, 10788, 0, "Kali Remik"),
+(6746, 0, 0, "I may have ninety-nine problems, but dancin' ain't one of them! Happy Hallow's End, $n!", 12, 0, 100, 94, 0, 0, 10787, 0, "Innkeeper Pala"),
+(6741, 0, 0, "Bawk, bawk, bawk! Happy Hallow's End, $n!", 12, 0, 100, 19, 0, 0, 10786, 0, "Innkeeper Norman"),
+(6740, 0, 0, "Ooo, so strong! Happy Hallow's End, $n!", 12, 0, 100, 23, 0, 0, 10797, 0, "Innkeeper Allison"),
+(5111, 0, 0, "Bawk, bawk, bawk! Happy Hallow's End, $n!", 12, 0, 100, 19, 0, 0, 10798, 0, "Innkeeper Firebrew"),
+(6826, 0, 0, "Chugga-chugga, woo-woo! Happy Hallow's End, $n!", 12, 0, 100, 275, 0, 0, 10799, 0, "Talvash del Kissel"),
+(6735, 0, 0, "I may have ninety-nine problems, but dancin' ain't one of them! Happy Hallow's End, $n!", 12, 0, 100, 94, 0, 0, 10800, 0, "Innkeeper Saelienne");
+
+UPDATE `smart_scripts` SET `link`=3 WHERE `entryorguid` IN (6746, 6929, 6740, 5111, 6735) AND `id`=2;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (6746, 6929, 6740, 5111, 6735) AND `id`=3;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(6929, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Innkeeper Gryshka - Received Emote 41 - Talk 0"),
+(6746, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Innkeeper Pala - Received Emote 34 - Talk 0"),
+(6740, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Innkeeper Allison - Received Emote 41 - Talk 0"),
+(5111, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Innkeeper Firebrew - Received Emote 22 - Talk 0"),
+(6735, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Innkeeper Saelienne - Received Emote 34 - Talk 0");
+
+UPDATE `smart_scripts` SET `link`=1 WHERE `entryorguid` IN (11814, 6826) AND `id`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (11814, 6826) AND `id`=1;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(11814, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Kali Remik - Received Emote 264 - Talk 0"),
+(6826, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Talvash del Kissel - Received Emote 264 - Talk 0");
+
+UPDATE `smart_scripts` SET `link`=4 WHERE `entryorguid`=6741 AND `id`=3;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=6741 AND `id`=4;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(6741, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Innkeeper Norman - Received Emote 22 - Talk 0");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry` IN (6929, 11814, 6746, 6741, 6740, 5111, 6826, 6735);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(22, 3, 6929, 0, 0, 9, 0, 8359, 0, 0, 0, 0, 0, "", "SAI id 2 for NPC Innkeeper Gryshka can only run if player has quest Flexing for Nougat"),
+(22, 1, 11814, 0, 0, 9, 0, 8358, 0, 0, 0, 0, 0, "", "SAI id 0 for NPC Kali Remik can only run if player has quest Incoming Gumdrop"),
+(22, 3, 6746, 0, 0, 9, 0, 8360, 0, 0, 0, 0, 0, "", "SAI id 2 for NPC Innkeeper Pala can only run if player has quest Dancing for Marzipan"),
+(22, 3, 6741, 0, 0, 9, 0, 8354, 0, 0, 0, 0, 0, "", "SAI id 2 for NPC Innkeeper Norman can only run if player has quest Chicken Clucking for a Mint"),
+(22, 3, 6740, 0, 0, 9, 0, 8356, 0, 0, 0, 0, 0, "", "SAI id 2 for NPC Innkeeper Allison can only run if player has quest Flexing for Nougat"),
+(22, 3, 5111, 0, 0, 9, 0, 8353, 0, 0, 0, 0, 0, "", "SAI id 2 for NPC Innkeeper Firebrew can only run if player has quest Chicken Clucking for a Mint"),
+(22, 1, 6826, 0, 0, 9, 0, 8355, 0, 0, 0, 0, 0, "", "SAI id 0 for NPC Talvash del Kissel can only run if player has quest Incoming Gumdrop"),
+(22, 3, 6735, 0, 0, 9, 0, 8357, 0, 0, 0, 0, 0, "", "SAI id 2 for NPC Innkeeper Saelienne can only run if player has quest Dancing for Marzipan");
+
+UPDATE `quest_template_addon` SET `SpecialFlags`=`SpecialFlags`|1 WHERE `ID` IN (8359, 8358, 8360, 8354, 8356, 8353, 8355, 8357);
diff --git a/sql/updates/world/3.3.5/2016_10_26_02_world.sql b/sql/updates/world/3.3.5/2016_10_26_02_world.sql
new file mode 100644
index 00000000000..399d01b8db0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_26_02_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `smart_scripts` SET `event_type`=4, `comment`="Plague Walker - On Aggro - Cast 'Aura of Lost Hope' (Dungeon)" WHERE `entryorguid`=30283 AND `id` IN (0, 1);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=30283 AND `id` IN (3, 4);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(30283, 0, 3, 0, 25, 0, 100, 2, 0, 0, 0, 0, 28, 56709, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Plague Walker - On Reset - Remove auras from spell 'Aura of Lost Hope' (Dungeon)"),
+(30283, 0, 4, 0, 25, 0, 100, 4, 0, 0, 0, 0, 28, 61459, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Plague Walker - On Reset - Remove auras from spell 'Aura of Lost Hope' (Dungeon)");
diff --git a/sql/updates/world/3.3.5/2016_10_27_00_world_335.sql b/sql/updates/world/3.3.5/2016_10_27_00_world_335.sql
new file mode 100644
index 00000000000..e68c77975f5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_00_world_335.sql
@@ -0,0 +1,96 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=20 AND `SourceEntry` IN (247, 6146, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8870, 8871, 8872, 8873, 8874, 8875, 11360, 11361, 11439, 11440, 11449, 11450, 11585, 11586, 12896, 12897, 13146, 13147, 13160, 13164, 13408, 13409, 24819, 24820, 24821, 24822, 24823, 24825, 24826, 24827, 24828, 24829, 24830, 24831, 24832, 24833, 24834, 24835, 24836, 24837, 24838, 24839, 24840, 24841, 24842, 24843, 24844, 24845, 24846, 24847, 25239, 25240, 25242, 25246, 25247, 25248, 25249);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(20, 0, 247, 0, 1, 8, 0, 2, 0, 0, 0, 0, 0, "", "Show quest only if Sharptalon's Claw (2) quest is rewarded AND"),
+(20, 0, 247, 0, 1, 8, 0, 23, 0, 0, 0, 0, 0, "", "Show quest only if Ursangous's Paw (23) quest is rewarded AND"),
+(20, 0, 247, 0, 1, 8, 0, 24, 0, 0, 0, 0, 0, "", "Show quest only if Shadumbra's Head (24) quest is rewarded AND"),
+(20, 0, 6146, 0, 1, 8, 0, 6145, 0, 0, 0, 0, 0, "", "Nathanos' Ruse requires quest The Crimson Courier (6145)"),
+(20, 0, 6146, 0, 2, 8, 0, 14350, 0, 0, 0, 0, 0, "", "Nathanos' Ruse requires quest The Crimson Courier (14350)"),
+(20, 0, 8353, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8354, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", "Quest avialable only during Hallow's End event"),
+(20, 0, 8355, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8356, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8357, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8358, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8359, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8360, 0, 0, 12, 0, 12, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 8870, 0, 0, 4, 0, 1537, 0, 0, 0, 0, 0, "", "The Lunar Festival: Ironforge"),
+(20, 0, 8871, 0, 0, 4, 0, 1519, 0, 0, 0, 0, 0, "", "The Lunar Festival: Stormwind"),
+(20, 0, 8872, 0, 0, 4, 0, 1657, 0, 0, 0, 0, 0, "", "The Lunar Festival: Darnassus"),
+(20, 0, 8873, 0, 0, 4, 0, 1637, 0, 0, 0, 0, 0, "", "The Lunar Festival: Orgrimmar"),
+(20, 0, 8874, 0, 0, 4, 0, 1497, 0, 0, 0, 0, 0, "", "The Lunar Festival: Undercity"),
+(20, 0, 8875, 0, 0, 4, 0, 1638, 0, 0, 0, 0, 0, "", "The Lunar Festival: Thunder Bluff"),
+(20, 0, 11360, 0, 0, 23, 0, 87, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 11361, 0, 0, 23, 0, 362, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 11439, 0, 0, 23, 0, 131, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 11440, 0, 0, 23, 0, 3576, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 11449, 0, 0, 23, 0, 159, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 11450, 0, 0, 23, 0, 3665, 0, 0, 0, 0, 0, "", ""),
+(20, 0, 11585, 0, 0, 14, 0, 10172, 0, 0, 0, 0, 0, "", "Accept quest 11585 - Quest 10172 needs to be incomplete"),
+(20, 0, 11586, 0, 0, 8, 0, 10172, 0, 0, 0, 0, 0, "", "Accept quest 11586 - Quest 10172 needs to be rewarded"),
+(20, 0, 12896, 0, 0, 8, 0, 12893, 0, 0, 0, 0, 0, "", "If he cannot be turned - alliance"),
+(20, 0, 12897, 0, 0, 8, 0, 12893, 0, 0, 0, 0, 0, "", "If he cannot be turned - horde"),
+(20, 0, 13146, 0, 0, 8, 0, 13145, 0, 0, 0, 0, 0, "", "Generosity Abounds"),
+(20, 0, 13147, 0, 0, 8, 0, 13145, 0, 0, 0, 0, 0, "", "Matchmaker"),
+(20, 0, 13160, 0, 0, 8, 0, 13145, 0, 0, 0, 0, 0, "", "Stunning View"),
+(20, 0, 13164, 0, 0, 8, 0, 13161, 0, 0, 0, 0, 0, "", "The Fate of Bloodbane"),
+(20, 0, 13164, 0, 0, 8, 0, 13162, 0, 0, 0, 0, 0, "", "The Fate of Bloodbane"),
+(20, 0, 13164, 0, 0, 8, 0, 13163, 0, 0, 0, 0, 0, "", "The Fate of Bloodbane"),
+(20, 0, 13408, 0, 0, 15, 0, 1503, 0, 0, 0, 0, 0, "", "Hellfire Fortifications - Alliance -All classes other than dk"),
+(20, 0, 13409, 0, 0, 15, 0, 1503, 0, 0, 0, 0, 0, "", "Hellfire Fortifications - Horde -All classes other than dk"),
+(20, 0, 24819, 0, 0, 2, 0, 50377, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24820, 0, 0, 2, 0, 50376, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24821, 0, 0, 2, 0, 50375, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24822, 0, 0, 2, 0, 50378, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24823, 0, 0, 2, 0, 50384, 1, 0, 0, 0, 0, "", "Path of Destruction 1"),
+(20, 0, 24825, 0, 0, 2, 0, 50378, 1, 0, 0, 0, 0, "", "Path of Wisdom 1"),
+(20, 0, 24826, 0, 0, 2, 0, 50376, 1, 0, 0, 0, 0, "", "Path of Vengeance 1"),
+(20, 0, 24827, 0, 0, 2, 0, 50375, 1, 0, 0, 0, 0, "", "Path of Courage 1"),
+(20, 0, 24828, 0, 0, 2, 0, 50377, 1, 0, 0, 0, 0, "", "Path of Destruction 2"),
+(20, 0, 24829, 0, 0, 2, 0, 50397, 1, 0, 0, 0, 0, "", "Path of Destruction 3"),
+(20, 0, 24830, 0, 0, 2, 0, 50386, 1, 0, 0, 0, 0, "", "Path of Wisdom 2"),
+(20, 0, 24831, 0, 0, 2, 0, 50399, 1, 0, 0, 0, 0, "", "Path of Wisdom 3"),
+(20, 0, 24832, 0, 0, 2, 0, 50387, 1, 0, 0, 0, 0, "", "Path of Vengeance 2"),
+(20, 0, 24833, 0, 0, 2, 0, 50401, 1, 0, 0, 0, 0, "", "Path of Vengeance 3"),
+(20, 0, 24834, 0, 0, 2, 0, 50388, 1, 0, 0, 0, 0, "", "Path of Courage 2"),
+(20, 0, 24835, 0, 0, 2, 0, 50403, 1, 0, 0, 0, 0, "", "Path of Courage 3"),
+(20, 0, 24836, 0, 0, 2, 0, 50384, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24837, 0, 0, 2, 0, 50386, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24838, 0, 0, 2, 0, 50387, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24839, 0, 0, 2, 0, 50388, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24840, 0, 0, 2, 0, 50397, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24841, 0, 0, 2, 0, 50399, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24842, 0, 0, 2, 0, 50401, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24843, 0, 0, 2, 0, 50403, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24844, 0, 0, 2, 0, 50398, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24845, 0, 0, 2, 0, 50400, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24846, 0, 0, 2, 0, 50402, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 24847, 0, 0, 2, 0, 50404, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 25239, 0, 0, 2, 0, 52569, 1, 0, 0, 0, 0, "", "Path of Might 1"),
+(20, 0, 25240, 0, 0, 2, 0, 52570, 1, 0, 0, 0, 0, "", "Path of Might 2"),
+(20, 0, 25242, 0, 0, 2, 0, 52571, 1, 0, 0, 0, 0, "", "Path of Might 3"),
+(20, 0, 25246, 0, 0, 2, 0, 52572, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 25247, 0, 0, 2, 0, 52569, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 25248, 0, 0, 2, 0, 52570, 1, 0, 0, 0, 0, "", "A Change of Heart"),
+(20, 0, 25249, 0, 0, 2, 0, 52571, 1, 0, 0, 0, 0, "", "A Change of Heart");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=19 AND `SourceEntry` IN (13044, 13068, 13086, 13104, 13105, 13120, 13139, 13224, 13225, 13604, 13817);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(19, 0, 13044, 0, 0, 8, 0, 13008, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13044, 0, 0, 8, 0, 13039, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13044, 0, 0, 8, 0, 13040, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13068, 0, 0, 8, 0, 13139, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13086, 0, 0, 8, 0, 13070, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13104, 0, 0, 8, 0, 13086, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13104, 0, 1, 15, 0, 1503, 0, 0, 0, 0, 0, "", "Show quest 13104 if player is not a Death Knight"),
+(19, 0, 13105, 0, 0, 8, 0, 13086, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13105, 0, 1, 15, 0, 32, 0, 0, 0, 0, 0, "", "Show quest 13105 if player is a Death Knight"),
+(19, 0, 13120, 0, 0, 8, 0, 13105, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13120, 0, 1, 8, 0, 13104, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13139, 0, 0, 8, 0, 13125, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13139, 0, 0, 8, 0, 13130, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13139, 0, 0, 8, 0, 13135, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13224, 0, 0, 8, 0, 13157, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13225, 0, 0, 8, 0, 13157, 0, 0, 0, 0, 0, "", ""),
+(19, 0, 13604, 0, 0, 19, 0, 1, 0, 0, 0, 0, 0, "", "Archivum Data Disc quest mark only shown in 10 man"),
+(19, 0, 13817, 0, 0, 19, 0, 2, 0, 0, 0, 0, 0, "", "Heroic: Archivum Data Disc quest mark only shown in 25 man");
diff --git a/sql/updates/world/3.3.5/2016_10_27_01_world_335.sql b/sql/updates/world/3.3.5/2016_10_27_01_world_335.sql
new file mode 100644
index 00000000000..2814e5606e2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_01_world_335.sql
@@ -0,0 +1,7 @@
+-- Fel Synergy
+DELETE FROM `spell_proc` WHERE `SpellId`=-47230;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(-47230, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0);
+
+-- Entrapment
+UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId`=-19184;
diff --git a/sql/updates/world/3.3.5/2016_10_27_02_world.sql b/sql/updates/world/3.3.5/2016_10_27_02_world.sql
new file mode 100644
index 00000000000..636fc78d01b
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_02_world.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `SchoolMask`=0x4, `AttributesMask` = 0x2 WHERE `SpellId` IN (71756, 72782, 72783, 72784);
diff --git a/sql/updates/world/3.3.5/2016_10_27_03_world.sql b/sql/updates/world/3.3.5/2016_10_27_03_world.sql
new file mode 100644
index 00000000000..9f793145936
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_03_world.sql
@@ -0,0 +1,10 @@
+--
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=18810;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=18810;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(18810, 0, 0, 0, 1, 0, 100, 0, 120000, 240000, 300000, 420000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Otonambusi - Out of Combat - Talk 0");
+
+DELETE FROM `creature_text` WHERE `entry`=18810;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(18810, 0, 0, "How can you have any pudding if you don't eat your fish?", 12, 7, 100, 5, 0, 0, 15941, 0, "Otonambusi"),
+(18810, 0, 1, "If you don't eat your fish, you can't have any pudding!", 12, 7, 100, 5, 0, 0, 15942, 0, "Otonambusi");
diff --git a/sql/updates/world/3.3.5/2016_10_27_04_world.sql b/sql/updates/world/3.3.5/2016_10_27_04_world.sql
new file mode 100644
index 00000000000..033680f233f
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_04_world.sql
@@ -0,0 +1,30 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27056, 2705600, 2705601, 2705602);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(27056, 0, 0, 0, 1, 0, 100, 0, 10000, 20000, 3600000, 3600000, 87, 2705600, 2705601, 2705602, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - Out of Combat - Call random script"),
+(2705600, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 0"),
+(2705600, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 27055, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 0 (Sentinel Amberline)"),
+(2705601, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 1"),
+(2705601, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 2"),
+(2705601, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 27052, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 0 (Naohain)"),
+(2705602, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 1"),
+(2705602, 9, 1, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 3"),
+(2705602, 9, 2, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 27054, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 0 (Modoru)"),
+(2705602, 9, 3, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 27054, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 1 (Modoru)"),
+(2705602, 9, 4, 0, 0, 0, 100, 0, 7000, 7000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 4"),
+(2705602, 9, 5, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 5"),
+(2705602, 9, 6, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 27119, 0, 0, 0, 0, 0, 0, "Sentinel Sweetspring - On Script - Talk 0 (Snowpaw)");
+
+DELETE FROM `creature_text` WHERE `entry` IN (27056, 27055, 27052, 27054, 27119);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(27056, 0, 0, "%s grins at Sentinel Amberline across the camp, waggling her long eyebrows suggestively.", 16, 0, 100, 0, 0, 0, 29555, 0, "Sentinel Sweetspring"),
+(27056, 1, 0, "%s peers at Modoru's Draenic robes.", 16, 0, 100, 0, 0, 0, 27085, 0, "Sentinel Sweetspring"),
+(27056, 2, 0, "Pssst. Naohain. Why does Modoru still wear those ridiculous robes? He looks like some interdimensional bumpkin who stumbled out of Ammen Vale not six hours past.", 12, 2, 100, 0, 0, 0, 27086, 0, "Sentinel Sweetspring"),
+(27056, 3, 0, "Say, Modoru. Where did you get those... ah... \"wonderful\" robes of yours, hmmm?", 12, 7, 100, 0, 0, 0, 29546, 0, "Sentinel Sweetspring"),
+(27056, 4, 0, "Oh. Oh... I see. How nice!", 12, 7, 100, 0, 0, 0, 29547, 0, "Sentinel Sweetspring"),
+(27056, 5, 0, "%s bites back a laugh.", 16, 0, 100, 0, 0, 0, 29548, 0, "Sentinel Sweetspring"),
+(27055, 0, 0, "%s huffs with annoyance, glaring briefly at Sentinel Sweetspring before turning away with her nose in the air.", 16, 0, 100, 0, 0, 0, 29557, 0, "Sentinel Amberline"),
+(27052, 0, 0, "I... I do not know.", 12, 2, 100, 0, 0, 0, 29544, 0, "Naohain"),
+(27054, 0, 0, "%s beams, unaware that she is teasing him, answering in his thickly-accented Common.", 16, 0, 100, 0, 0, 0, 29550, 0, "Modoru"),
+(27054, 1, 0, "Well! You see, was gift from Grandmother Oluba. She hand-weave from finest silk on Draenor! Am quite proud of, yes.", 12, 7, 100, 0, 0, 0, 29552, 0, "Modoru"),
+(27119, 0, 0, "%s snickers, nuzzling into Sentinel Sweetspring's ankles.", 16, 0, 100, 0, 0, 0, 29553, 0, "Snowpaw");
diff --git a/sql/updates/world/3.3.5/2016_10_27_05_world.sql b/sql/updates/world/3.3.5/2016_10_27_05_world.sql
new file mode 100644
index 00000000000..1f61abb5658
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_05_world.sql
@@ -0,0 +1,29 @@
+--
+UPDATE `creature_template` SET `AIName`="SmartAI", `ScriptName`="" WHERE `entry`=27056;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=26568;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (26568, 2656800, 2656801, 2656802, 2656803);
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(26568, 0, 0, 0, 1, 0, 100, 0, 10000, 20000, 600000, 600000, 87, 2656800, 2656801, 2656802, 2656803, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Zebu'tan - Out of Combat - Call random script"),
+(2656800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 0"),
+(2656800, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 26569, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 0 (Alys Vol'tyr)"),
+(2656801, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 1"),
+(2656801, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 26569, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 1 (Alys Vol'tyr)"),
+(2656801, 9, 2, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 2"),
+(2656802, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 3"),
+(2656802, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 19, 26569, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 2 (Alys Vol'tyr)"),
+(2656803, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 4"),
+(2656803, 9, 1, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 1, 3, 0, 0, 0, 0, 0, 19, 26569, 0, 0, 0, 0, 0, 0, "Zebu'tan - On Script - Talk 3 (Alys Vol'tyr)");
+
+DELETE FROM `creature_text` WHERE `entry` IN (26568, 26569);
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(26568, 0, 0, "Don't be shy, elfy. Don't you feel dis burnin' love formin' between us?", 12, 1, 100, 0, 0, 0, 25790, 0, "Zebu'tan"),
+(26568, 1, 0, "Lookie what Zebu'tan got for you! Roses for da rose!", 12, 1, 100, 0, 0, 0, 25782, 0, "Zebu'tan"),
+(26568, 2, 0, "%s grumbles.", 16, 0, 100, 0, 0, 0, 25783, 0, "Zebu'tan"),
+(26568, 3, 0, "Hey pretty lady, Zebu'tan got two rugs over here! Why don't you come on over and keep he warm, eh?", 12, 1, 100, 0, 0, 0, 25781, 0, "Zebu'tan"),
+(26568, 4, 0, "Dis troll tink you got a crush on he! Come on over!", 12, 1, 100, 0, 0, 0, 25789, 0, "Zebu'tan"),
+(26569, 0, 0, "Get lost, creep!", 12, 1, 100, 0, 0, 0, 25787, 0, "Alys Vol'tyr"),
+(26569, 1, 0, "Ewwww!", 12, 1, 100, 0, 0, 0, 25785, 0, "Alys Vol'tyr"),
+(26569, 2, 0, "Not if you were the last troll on Azeroth!", 12, 1, 100, 0, 0, 0, 25784, 0, "Alys Vol'tyr"),
+(26569, 2, 1, "I've got a man! Now take a hike!", 12, 1, 100, 0, 0, 0, 25788, 0, "Alys Vol'tyr"),
+(26569, 3, 0, "Never!", 12, 1, 100, 0, 0, 0, 25786, 0, "Alys Vol'tyr");
diff --git a/sql/updates/world/3.3.5/2016_10_27_06_world.sql b/sql/updates/world/3.3.5/2016_10_27_06_world.sql
new file mode 100644
index 00000000000..69cecfcad8a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_27_06_world.sql
@@ -0,0 +1,2 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=20;
diff --git a/sql/updates/world/3.3.5/2016_10_28_00_world.sql b/sql/updates/world/3.3.5/2016_10_28_00_world.sql
new file mode 100644
index 00000000000..64a7d3d6887
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_28_00_world.sql
@@ -0,0 +1,13 @@
+--
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=26564;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26564;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(26564, 0, 0, 0, 1, 0, 100, 0, 300000, 300000, 600000, 600000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Borus Ironbender - Out of Combat - Talk 0");
+
+DELETE FROM `creature_text` WHERE `entry`=26564;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(26564, 0, 0, "Faster! Faster! These armaments must be delivered to the Kor'kron Vanguard TODAY!", 12, 1, 100, 0, 0, 0, 25775, 0, "Borus Ironbender"),
+(26564, 0, 1, "I will happily replace you all with goblins! Do not fail me!", 12, 1, 100, 0, 0, 0, 25776, 0, "Borus Ironbender"),
+(26564, 0, 2, "Overlord Agmar demands more of us! We must not disappoint!", 12, 1, 100, 0, 0, 0, 25777, 0, "Borus Ironbender"),
+(26564, 0, 3, "Don't make me jump off of this crate! I will beat your head in, orc.", 12, 1, 100, 0, 0, 0, 25778, 0, "Borus Ironbender");
diff --git a/sql/updates/world/3.3.5/2016_10_28_01_world.sql b/sql/updates/world/3.3.5/2016_10_28_01_world.sql
new file mode 100644
index 00000000000..bd5991062ca
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_28_01_world.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `creature_text` WHERE `entry`=26649;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(26649, 0, 0, "Pssst... Over here, by the mailbox. Come quickly and make sure you aren't followed.", 15, 0, 100, 0, 0, 0, 25823, 0, "Borus Ironbender");
+
+DELETE FROM `areatrigger_scripts` WHERE `entry`=4960;
+INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES
+(4960, "at_nearby_messenger_torvus");
diff --git a/sql/updates/world/3.3.5/2016_10_28_02_world_335.sql b/sql/updates/world/3.3.5/2016_10_28_02_world_335.sql
new file mode 100644
index 00000000000..190f5c33a28
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_28_02_world_335.sql
@@ -0,0 +1,8 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_hun_cobra_strikes', 'spell_hun_cobra_strikes_triggered');
+INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
+(-53256, 'spell_hun_cobra_strikes'),
+(53257, 'spell_hun_cobra_strikes_triggered');
+
+DELETE FROM `spell_proc` WHERE `SpellId`=53257;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(53257, 0, 9, 0x00000000, 0x10000000, 0x00000000, 16, 0x1, 0x2, 0x2, 0x8, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_10_28_03_world_335.sql b/sql/updates/world/3.3.5/2016_10_28_03_world_335.sql
new file mode 100644
index 00000000000..df414f4fe11
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_28_03_world_335.sql
@@ -0,0 +1,8 @@
+-- Lock and Load
+UPDATE `spell_proc` SET `SpellPhaseMask`=0x2 WHERE `SpellId`=-56342;
+
+-- Entrapment
+UPDATE `spell_proc` SET `SpellPhaseMask`=0x4 WHERE `SpellId`=-19184;
+
+-- Pet Healing
+UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId`=37381;
diff --git a/sql/updates/world/3.3.5/2016_10_29_00_world.sql b/sql/updates/world/3.3.5/2016_10_29_00_world.sql
new file mode 100644
index 00000000000..16f6b661ea4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_00_world.sql
@@ -0,0 +1,43 @@
+--
+UPDATE `game_event` SET `start_time`="2017-06-21 00:01:00" WHERE `eventEntry`=1;
+UPDATE `game_event` SET `start_time`="2016-12-16 06:00:00" WHERE `eventEntry`=2;
+UPDATE `game_event` SET `start_time`="2016-11-06 00:01:00" WHERE `eventEntry`=3;
+UPDATE `game_event` SET `start_time`="2016-12-04 00:01:00" WHERE `eventEntry`=4;
+UPDATE `game_event` SET `start_time`="2017-01-01 00:01:00" WHERE `eventEntry`=5;
+UPDATE `game_event` SET `start_time`="2016-12-31 06:00:00", `length`=1440 WHERE `eventEntry`=6;
+UPDATE `game_event` SET `start_time`="2017-01-21 00:01:00" WHERE `eventEntry`=7;
+UPDATE `game_event` SET `start_time`="2017-02-07 00:01:00" WHERE `eventEntry`=8;
+UPDATE `game_event` SET `start_time`="2017-03-17 00:01:00" WHERE `eventEntry`=9;
+UPDATE `game_event` SET `start_time`="2017-05-01 00:01:00" WHERE `eventEntry`=10;
+UPDATE `game_event` SET `start_time`="2017-09-29 00:01:00" WHERE `eventEntry`=11;
+UPDATE `game_event` SET `start_time`="2017-10-18 01:00:00" WHERE `eventEntry`=12;
+UPDATE `game_event` SET `start_time`="2016-10-29 00:00:00" WHERE `eventEntry`=14;
+UPDATE `game_event` SET `start_time`="2016-10-30 14:00:00" WHERE `eventEntry`=15;
+UPDATE `game_event` SET `start_time`="2016-10-29 03:00:00" WHERE `eventEntry`=16;
+UPDATE `game_event` SET `start_time`="2016-11-25 00:01:00", `length`=5760 WHERE `eventEntry`=18;
+UPDATE `game_event` SET `start_time`="2016-12-02 00:01:00", `length`=5760 WHERE `eventEntry`=19;
+UPDATE `game_event` SET `start_time`="2016-11-11 00:01:00", `length`=5760 WHERE `eventEntry`=20;
+UPDATE `game_event` SET `start_time`="2016-11-18 00:01:00", `length`=5760 WHERE `eventEntry`=21;
+UPDATE `game_event` SET `start_time`="2016-12-01 00:01:00" WHERE `eventEntry`=23;
+UPDATE `game_event` SET `start_time`="2017-09-20 00:01:00" WHERE `eventEntry`=24;
+UPDATE `game_event` SET `start_time`="2016-10-28 21:00:00" WHERE `eventEntry`=25;
+UPDATE `game_event` SET `start_time`="2017-11-21 00:01:00" WHERE `eventEntry`=26;
+UPDATE `game_event` SET `start_time`="2016-10-01 00:01:00" WHERE `eventEntry`=34;
+UPDATE `game_event` SET `start_time`="2016-11-01 00:01:00" WHERE `eventEntry`=35;
+UPDATE `game_event` SET `start_time`="2016-12-01 00:01:00" WHERE `eventEntry`=36;
+UPDATE `game_event` SET `start_time`="2017-01-01 00:01:00" WHERE `eventEntry`=37;
+UPDATE `game_event` SET `start_time`="2017-02-01 00:01:00" WHERE `eventEntry`=38;
+UPDATE `game_event` SET `start_time`="2017-03-01 00:01:00" WHERE `eventEntry`=39;
+UPDATE `game_event` SET `start_time`="2017-04-01 00:01:00" WHERE `eventEntry`=40;
+UPDATE `game_event` SET `start_time`="2017-05-01 00:01:00" WHERE `eventEntry`=41;
+UPDATE `game_event` SET `start_time`="2017-06-01 00:01:00" WHERE `eventEntry`=42;
+UPDATE `game_event` SET `start_time`="2017-07-01 00:01:00" WHERE `eventEntry`=43;
+UPDATE `game_event` SET `start_time`="2017-08-01 00:01:00" WHERE `eventEntry`=44;
+UPDATE `game_event` SET `start_time`="2017-09-01 00:01:00" WHERE `eventEntry`=45;
+UPDATE `game_event` SET `start_time`="2017-09-19 00:01:00" WHERE `eventEntry`=50;
+UPDATE `game_event` SET `start_time`="2016-11-01 00:01:00" WHERE `eventEntry`=51;
+UPDATE `game_event` SET `start_time`="2016-10-28 00:01:00" WHERE `eventEntry`=53;
+UPDATE `game_event` SET `start_time`="2016-11-04 00:01:00" WHERE `eventEntry`=54;
+UPDATE `game_event` SET `start_time`="2016-10-30 14:00:00" WHERE `eventEntry`=62;
+UPDATE `game_event` SET `start_time`="2016-10-29 13:00:00" WHERE `eventEntry`=63;
+UPDATE `game_event` SET `start_time`="2016-10-29 14:00:00" WHERE `eventEntry`=64;
diff --git a/sql/updates/world/3.3.5/2016_10_29_01_world_335.sql b/sql/updates/world/3.3.5/2016_10_29_01_world_335.sql
new file mode 100644
index 00000000000..07b49a3d3f7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_01_world_335.sql
@@ -0,0 +1,25 @@
+--
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (2181, 2182,12347, 2236, 2235, 15184);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2181, 2182, 12347, 2236, 2235, 15184) AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(2181, 0, 0, 0, 0, 0, 100, 0, 4000, 7000, 8000, 13000, 11, 5164, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Stormscale Myrmidon - Update In Combat - Cast \'Knockdown\''),
+(2182,0,0,0,0,0,100,0,1000,2000,3000,3400,11,20792,64,0,0,0,0,2,0,0,0,0,0,0,0,'Stormscale Sorceress - ic -Cast bolt'),
+(2182,0,1,0,2,0,100,1,0,15,0,0,25,1,0,0,0,0,0,1,0,0,0,0,0,0,0,'Stormscale Sorceress - Flee at 15% HP'),
+(2182,0,2,0,23,0,100,0,12544,0,1000,1000,11,12544,1,0,0,0,0,1,0,0,0,0,0,0,0,'Stormscale Sorceress - Cast Frost Armor on Spawn'),
+(12347, 0, 0, 0, 2, 0, 100, 1, 0, 20, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Enraged Reef Crawler - On Low (20%) Health - Cast \'Enraged\''),
+(2236,0,0,0,4,0,100,1,0,0,0,0,75,12787,0,0,0,0,0,1,0,0,0,0,0,0,0,'Raging Reef Crawler - Cast Thrash - on Aggro'),
+(2235,0,0,0,0,0,100,0,3000,5000,5000,8000,11,12166,0,0,0,0,0,2,0,0,0,0,0,0,0,'Reef Crawler- Update In Combat - Cast \'Muscle Tear\''),
+(15184, 0, 0, 0, 25, 0, 100, 0, 0, 0, 0, 0, 11, 18950, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cenarion Hold Infantry - On Reset - Cast Invisibility and Stealth Detection'),
+(15184, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Cenarion Hold Infantry - On Aggro - Say Line 0'),
+(15184, 0, 2, 0, 0, 0, 100, 0, 3000, 7000, 6000, 12000, 11, 30223, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cenarion Hold Infantry - In Combat - Cast Cleave'),
+(15184, 0, 3, 0, 13, 0, 100, 0, 10000, 10000, 0, 0, 11, 27620, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Cenarion Hold Infantry - Victim Casting - Cast Snap Kick');
+
+DELETE FROM `creature_text` WHERE `entry`=15184;
+INSERT INTO `creature_text` VALUES (15184, 0, 0, 'Taste blade, mongrel!', 12, 0, 100, 0, 0, 0, 10950, 0, 'SAY_GUARD_SIL_AGGRO1'),
+(15184, 0, 1, 'Please tell me that you didn''t just do what I think you just did. Please tell me that I''m not going to have to hurt you...', 12, 0, 100, 0, 0, 0, 10951, 0, 'SAY_GUARD_SIL_AGGRO2'),
+(15184, 0, 2, 'As if we don''t have enough problems, you go and create more!', 12, 0, 100, 0, 0, 0, 10953, 0, 'SAY_GUARD_SIL_AGGRO3'),
+(15184, 0, 3, 'You dare spill blood on neutral ground? OUT! OUT, I SAY!', 12, 0, 100, 0, 0, 0, 10948, 0, 'Cenarion Hold Infantry - On Aggro'),
+(15184, 0, 4, 'We don''t take kindly to miscreants, $r.', 12, 0, 100, 0, 0, 0, 10949, 0, 'Cenarion Hold Infantry - On Aggro'),
+(15184, 0, 5, 'Get a rope!', 12, 0, 100, 0, 0, 0, 10952, 0, 'Cenarion Hold Infantry - On Aggro'),
+(15184, 0, 6, 'Believe me when I tell you this: You''re gonna wish you weren''t born, sissy!', 12, 0, 100, 0, 0, 0, 10954, 0, 'Cenarion Hold Infantry - On Aggro'),
+(15184, 0, 7, 'Your actions shame us all, $c. I hurt inside as I beat you senseless.', 12, 0, 100, 0, 0, 0, 10955, 0, 'Cenarion Hold Infantry - On Aggro');
diff --git a/sql/updates/world/3.3.5/2016_10_29_02_world.sql b/sql/updates/world/3.3.5/2016_10_29_02_world.sql
new file mode 100644
index 00000000000..cab9bc5a167
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_02_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (11680) AND `source_type`=0 AND `id`=0;
+DELETE FROM `creature_text` WHERE `entry`=11680;
diff --git a/sql/updates/world/3.3.5/2016_10_29_03_world.sql b/sql/updates/world/3.3.5/2016_10_29_03_world.sql
new file mode 100644
index 00000000000..7c21609205d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_03_world.sql
@@ -0,0 +1,16 @@
+--
+DELETE FROM `gossip_menu` WHERE `entry` IN (6476, 6513) AND `text_id` IN (7676, 7711);
+INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES
+(6476, 7676, 0),
+(6513, 7711, 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup` IN (6476, 6513);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(14, 6476, 7676, 0, 0, 27, 0, 35, 2, 0, 0, 0, 0, "", "Gossip text 7676 for NPC Grinkle requires level to be lower than 35"),
+(14, 6476, 7677, 0, 0, 27, 0, 35, 3, 0, 0, 0, 0, "", "Gossip text 7677 for NPC Grinkle requires level to be 35 or higher"),
+(14, 6513, 7711, 0, 0, 27, 0, 35, 2, 0, 0, 0, 0, "", "Gossip text 7676 for NPC Barrus requires level to be lower than 35"),
+(14, 6513, 7712, 0, 0, 27, 0, 35, 3, 0, 0, 0, 0, "", "Gossip text 7677 for NPC Barrus requires level to be 35 or higher");
+
+DELETE FROM `npc_text` WHERE `ID`=7711;
+INSERT INTO `npc_text` (`ID`, `text0_0`, `BroadcastTextID0`) VALUES
+(7711, "Greetings! I am here to promote a tournament to test your fishing skill in Stranglethorn. To participate you need enough might to survive there and have enough skill in fishing to coax the fish from the water.$B$B Come back later when you are more qualified!", 10596);
diff --git a/sql/updates/world/3.3.5/2016_10_29_04_world.sql b/sql/updates/world/3.3.5/2016_10_29_04_world.sql
new file mode 100644
index 00000000000..5bea6f0f8b2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_04_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `game_event` SET `start_time`="2016-12-15 06:00:00" WHERE `eventEntry`=2;
diff --git a/sql/updates/world/3.3.5/2016_10_29_05_world.sql b/sql/updates/world/3.3.5/2016_10_29_05_world.sql
new file mode 100644
index 00000000000..1f923592dda
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_05_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `game_event` SET `start_time`="2016-10-18 01:00:00" WHERE `eventEntry`=12;
diff --git a/sql/updates/world/3.3.5/2016_10_29_06_world.sql b/sql/updates/world/3.3.5/2016_10_29_06_world.sql
new file mode 100644
index 00000000000..06c9251574c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_06_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `ScriptName`="npc_stable_master" WHERE `entry`=27056;
diff --git a/sql/updates/world/3.3.5/2016_10_29_07_world.sql b/sql/updates/world/3.3.5/2016_10_29_07_world.sql
new file mode 100644
index 00000000000..8c020dc8fd8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_29_07_world.sql
@@ -0,0 +1,6 @@
+--
+UPDATE `gameobject_template` SET `AIName`="SmartGameObjectAI" WHERE `entry`=184980;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=184980;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(184980, 1, 0, 0, 70, 0, 100, 0, 2, 0, 0, 0, 11, 37695, 2, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Felhound Poo - On Gameobject State 2 - Cast 'Stanky'");
+UPDATE `gameobject_loot_template` SET `Chance`=0, `GroupId`=1 WHERE `Entry`=21311;
diff --git a/sql/updates/world/3.3.5/2016_10_30_00_world.sql b/sql/updates/world/3.3.5/2016_10_30_00_world.sql
new file mode 100644
index 00000000000..1a9e0188f38
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_00_world.sql
@@ -0,0 +1,3 @@
+--
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=7579 AND `SourceEntry`=9221;
+DELETE FROM `gossip_menu` WHERE `entry`=7579 AND `text_id`=9221;
diff --git a/sql/updates/world/3.3.5/2016_10_30_01_world_335.sql b/sql/updates/world/3.3.5/2016_10_30_01_world_335.sql
new file mode 100644
index 00000000000..45b2e08d52a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_01_world_335.sql
@@ -0,0 +1,11 @@
+DELETE FROM `spell_dbc` WHERE `Id`=45176;
+INSERT INTO `spell_dbc` (`Id`, `Dispel`, `Mechanic`, `Attributes`, `AttributesEx`, `AttributesEx2`, `AttributesEx3`, `AttributesEx4`, `AttributesEx5`, `AttributesEx6`, `AttributesEx7`, `Stances`, `StancesNot`, `Targets`, `CastingTimeIndex`, `AuraInterruptFlags`, `ProcFlags`, `ProcChance`, `ProcCharges`, `MaxLevel`, `BaseLevel`, `SpellLevel`, `DurationIndex`, `RangeIndex`, `StackAmount`, `EquippedItemClass`, `EquippedItemSubClassMask`, `EquippedItemInventoryTypeMask`, `Effect1`, `Effect2`, `Effect3`, `EffectDieSides1`, `EffectDieSides2`, `EffectDieSides3`, `EffectRealPointsPerLevel1`, `EffectRealPointsPerLevel2`, `EffectRealPointsPerLevel3`, `EffectBasePoints1`, `EffectBasePoints2`, `EffectBasePoints3`, `EffectMechanic1`, `EffectMechanic2`, `EffectMechanic3`, `EffectImplicitTargetA1`, `EffectImplicitTargetA2`, `EffectImplicitTargetA3`, `EffectImplicitTargetB1`, `EffectImplicitTargetB2`, `EffectImplicitTargetB3`, `EffectRadiusIndex1`, `EffectRadiusIndex2`, `EffectRadiusIndex3`, `EffectApplyAuraName1`, `EffectApplyAuraName2`, `EffectApplyAuraName3`, `EffectAmplitude1`, `EffectAmplitude2`, `EffectAmplitude3`, `EffectMultipleValue1`, `EffectMultipleValue2`, `EffectMultipleValue3`, `EffectItemType1`, `EffectItemType2`, `EffectItemType3`, `EffectMiscValue1`, `EffectMiscValue2`, `EffectMiscValue3`, `EffectMiscValueB1`, `EffectMiscValueB2`, `EffectMiscValueB3`, `EffectTriggerSpell1`, `EffectTriggerSpell2`, `EffectTriggerSpell3`, `EffectSpellClassMaskA1`, `EffectSpellClassMaskA2`, `EffectSpellClassMaskA3`, `EffectSpellClassMaskB1`, `EffectSpellClassMaskB2`, `EffectSpellClassMaskB3`, `EffectSpellClassMaskC1`, `EffectSpellClassMaskC2`, `EffectSpellClassMaskC3`, `MaxTargetLevel`, `SpellFamilyName`, `SpellFamilyFlags1`, `SpellFamilyFlags2`, `SpellFamilyFlags3`, `MaxAffectedTargets`, `DmgClass`, `PreventionType`, `DmgMultiplier1`, `DmgMultiplier2`, `DmgMultiplier3`, `AreaGroupId`, `SchoolMask`, `Comment`) VALUES
+(45176, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 29, 6, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 197, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 'Master Poisoner Trigger');
+
+-- Master Poisoner
+DELETE FROM `spell_proc` WHERE `SpellId`=-31226;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(-31226, 0, 8, 0x00000000, 0x00080000, 0x00000000, 0, 0x5, 0x2, 0x0, 0x2, 0, 0, 0, 0);
+
+-- Seal Fate
+UPDATE `spell_proc` SET `SpellFamilyMask0`=0x4200020E, `SpellFamilyMask1`=0x00000002, `AttributesMask`=0x2 WHERE `SpellId`=-14186;
diff --git a/sql/updates/world/3.3.5/2016_10_30_02_world.sql b/sql/updates/world/3.3.5/2016_10_30_02_world.sql
new file mode 100644
index 00000000000..0d39b8eb6f9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_02_world.sql
@@ -0,0 +1 @@
+DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hallows_end_has_water_bucket';
diff --git a/sql/updates/world/3.3.5/2016_10_30_03_world.sql b/sql/updates/world/3.3.5/2016_10_30_03_world.sql
new file mode 100644
index 00000000000..7994cccdbd0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_03_world.sql
@@ -0,0 +1,7 @@
+--
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry`=25803;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=25803 AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(25803, 0, 0, 0, 0, 0, 100, 0, 8000, 10000, 10000, 15000, 11, 42724, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Karen "I Don''t Caribou" the Culler - In Combat - Cast Cleave'),
+(25803, 0, 1, 0, 0, 0, 100, 0, 4000, 4000, 15000, 21000, 11, 48280, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Karen "I Don''t Caribou" the Culler - In Combat - Cast Whirlwind'),
+(25803, 0, 2, 0, 9, 0, 100, 0, 8, 25, 10000, 10000, 11, 27577, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Karen "I Don''t Caribou" the Culler - Within Range 8-25yd - Cast Intercept');
diff --git a/sql/updates/world/3.3.5/2016_10_30_04_world.sql b/sql/updates/world/3.3.5/2016_10_30_04_world.sql
new file mode 100644
index 00000000000..6c18ce15dde
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_04_world.sql
@@ -0,0 +1,8 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid`=26349 AND `source_type`=0 AND `id`=4;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(26349, 0, 4, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Goramosh - On Aggro - Say Line 0');
+
+DELETE FROM `creature_text` WHERE `entry`=26349;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(26349, 0, 0, 'You''re too late! The accord has been negotiated. Only the details remain. Small details... like you!', 12, 0, 100, 0, 0, 0, 25716, 0, 'Goramosh');
diff --git a/sql/updates/world/3.3.5/2016_10_30_05_world_335.sql b/sql/updates/world/3.3.5/2016_10_30_05_world_335.sql
new file mode 100644
index 00000000000..9583fac21be
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_05_world_335.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `gameobject` SET `position_y`=-2148.561035 WHERE `guid`=39881;
diff --git a/sql/updates/world/3.3.5/2016_10_30_06_world_335.sql b/sql/updates/world/3.3.5/2016_10_30_06_world_335.sql
new file mode 100644
index 00000000000..ee3a62f15e1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_06_world_335.sql
@@ -0,0 +1,76 @@
+--
+DELETE FROM `gameobject_template` WHERE `entry` IN (209282, 208046, 202361, 208815, 208596, 208543, 208426, 205581, 204968, 12653, 128972, 160462, 160842, 175328, 175590, 176750, 177493, 177529, 178124, 178248, 178644, 178673, 178963, 179527, 179530, 179531, 180525, 181214, 181375, 181604, 181831, 181838, 181840, 181842, 181844, 184910, 184958, 184981, 185297, 185305, 185862, 186471, 190721, 194645, 195061, 195089, 195641, 196829, 202208, 203044, 203971, 204289, 204385, 204434, 205100, 205547, 206322, 207418, 215404, 215419, 209833, 209898, 210857, 210946, 212348, 213351, 244605);
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `size`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `Data8`, `Data9`, `Data10`, `Data11`, `Data12`, `Data13`, `Data14`, `Data15`, `Data16`, `Data17`, `Data18`, `Data19`, `Data20`, `Data21`, `Data22`, `Data23`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES
+(209282, 6, 9749, "Paper Pile Trap", "", "", "", 0.7, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 22566),
+(208046, 6, 10406, "Fel Cone", "", "", "", 4, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 16309),
+(202361, 6, 9315, "Rockin' Powder Visual", "", "", "", 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(208815, 6, 49, "Buried Jar", "", "", "", 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 22522),
+(208596, 6, 8083, "Flame Druid Idol Trap", "", "", "", 0.05, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 22522),
+(208543, 6, 9145, "Magmolia", "", "", "", 0.1, 0, 0, 0, 98191, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 19342),
+(208426, 6, 9145, "Cinderweb Egg Sac - Spiderling Trap", "", "", "", 0.4, 0, 0, 0, 97369, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(205581, 6, 9932, "Suspended Starlight - TRAP", "", "", "", 5, 0, 0, 0, 85688, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(204968, 6, 1310, "Glow Trap", "", "", "", 3, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 19342),
+(12653, 6, 327, "Ghost Saber Trap", "", "", "", 1, 0, 20, 0, 5968, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(128972, 6, 327, "Shallow Grave TRAP", "", "", "", 1, 0, 0, 0, 10247, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(160462, 6, 2770, "Mystical Portal", "", "", "", 1, 0, 1, 20, 13461, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(160842, 6, 2770, "Gor'tesh's Lopped Off Head", "", "", "", 1, 0, 0, 50, 13488, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(175328, 6, 2770, "Vaelan Spawn Node", "", "", "", 0.5, 0, 50, 50, 10387, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(175590, 6, 0, "Spire Spider Egg Trap", "", "", "", 1, 0, 0, 0, 16453, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(176750, 6, 327, "Kodo Bones", "", "", "", 1, 0, 0, 0, 17960, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(177493, 6, 327, "Fire of Elune (Trap", "", "", "", 1, 0, 0, 0, 18955, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(177529, 6, 327, "Altar of Elune (Trap", "", "", "", 1, 0, 0, 0, 18993, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(178124, 6, 327, "Resonite Crystal (Trap", "", "", "", 1, 0, 0, 5, 20492, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(178248, 6, 327, "Naga Brazier (trap", "", "", "", 1, 0, 0, 0, 20863, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(178644, 6, 0, "Ryson's All Seeing Eye Trap", "", "", "", 1, 95, 200, 0, 21546, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(178673, 6, 5752, "Consuming Flames Trap", "", "", "", 1.2, 95, 60, 20, 21650, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(178963, 6, 2770, "Incantion of Celebras Trap", "", "", "", 1, 0, 0, 0, 21917, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(179527, 6, 391, "Warpwood Pod - Root", "", "", "", 0.75, 0, 0, 10, 22800, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(179530, 6, 391, "Warpwood Pod - Spore", "", "", "", 0.75, 0, 0, 10, 22821, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(179531, 6, 391, "Warpwood Pod - Summon", "", "", "", 0.75, 0, 0, 10, 22803, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(180525, 6, 6424, "Tonk Control Console Trap", "", "", "", 1, 0, 0, 0, 24935, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181214, 6, 327, "Necropolis critter spawner", "", "", "", 1, 0, 0, 0, 27866, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181375, 6, 0, "Midsummer Bonfire Spawn Trap 2", "", "", "", 1, 0, 0, 0, 29114, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181604, 6, 6771, "TEST Ribbon Pole TRAP", "", "", "", 1, 0, 0, 0, 29708, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181831, 6, 2770, "Sealed Tome", "", "", "", 1.01, 0, 0, 0, 30765, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181838, 6, 2770, "Sealed Tome", "", "", "", 1.01, 0, 0, 0, 30762, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181840, 6, 2770, "Sealed Tome", "", "", "", 1.01, 0, 0, 0, 30764, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181842, 6, 2770, "Sealed Tome", "", "", "", 1.01, 0, 0, 0, 30763, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(181844, 6, 2770, "Sealed Tome", "", "", "", 1.01, 0, 0, 0, 30766, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(184910, 6, 2373, "Power Converter", "", "", "", 0.5, 0, 0, 0, 37278, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(184958, 6, 7247, "Nether Drake Egg", "", "", "", 1.5, 0, 0, 0, 37574, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(184981, 6, 7244, "Poodad Trap", "", "", "", 0.5, 1716, 0, 0, 37695, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(185297, 6, 1310, "Lianthe's Strongbox", "", "", "", 2, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(185305, 6, 7298, "Fumper Trap", "", "", "", 1, 0, 0, 0, 39217, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(185862, 6, 0, "Fel Cannonball Stack Trap", "", "", "", 1, 0, 0, 0, 40181, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(186471, 6, 2770, "Holiday - Brewfest - Dark Iron - Mug Trap", "", "", "", 1, 0, 0, 3, 42696, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(190721, 6, 0, "Harvested Blight Crystal", "", "", "", 0.5, 0, 0, 0, 52261, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(194645, 6, 5932, "Stone Block Trap", "", "", "", 1, 0, 0, 0, 64055, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(195061, 6, 261, "Glittering Shell Trap", "", "", "", 0.45, 0, 0, 0, 65364, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(195089, 6, 0, "Spirit Candle", "", "", "", 1, 0, 0, 10, 65459, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(195641, 6, 0, "Brazier", "", "", "", 1, 0, 1, 1, 7897, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(196829, 6, 2971, "Living Ire Thyme Linked Trap", "", "", "", 1, 0, 0, 0, 67887, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(202208, 6, 0, "Discarded Supplies (Trap", "", "", "", 1, 0, 0, 0, 72248, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(203044, 6, 0, "Steamwheedle Supplies - Pirate Trap", "", "", "", 1, 0, 0, 0, 76115, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(203971, 6, 0, "Prickly Pear Fruit Trap", "", "", "", 1, 0, 0, 0, 79324, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(204289, 6, 0, "Rock Lobster Trap Activator", "", "", "", 1, 0, 0, 0, 80580, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(204385, 6, 0, "Monstrous Clam Trap Activator", "", "", "", 1, 0, 0, 0, 80911, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(204434, 6, 0, "Lime Crate Trap", "", "", "", 1, 0, 0, 0, 81445, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(205100, 6, 0, "Ferocious Doomweed", "", "", "", 1, 0, 0, 0, 83523, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(205547, 6, 0, "Stray Land Mine (Armed", "", "", "", 1, 0, 50, 5, 85452, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(206322, 6, 0, "Wild Black Dragon Egg Trap", "", "", "", 1, 0, 0, 0, 87009, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(207418, 6, 0, "Chillwind Egg Trap", "", "", "", 1, 0, 0, 0, 93296, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(215404, 6, 9941, "Shroud of Mist", "", "", "", 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 22566),
+(215419, 6, 0, "Luck of the Lotus", "", "", "", 1, 0, 0, 0, 130653, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(209833, 6, 378, "Silk Patch", "", "", "", 1, 0, 0, 13, 105434, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "", "", 17658),
+(209898, 6, 10985, "Watermelon Boat Flag", "", "", "", 1.6, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 19342),
+(210857, 6, 11174, "Dry Fire Wood", "", "", "", 1, 0, 0, 0, 113649, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "", "", 22522),
+(210946, 6, 9145, "Mite Trap", "", "", "", 0.4, 0, 0, 0, 114418, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 22522),
+(212348, 6, 2971, "Ancient Haunt Trigger", "", "", "", 1, 0, 0, 0, 122173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(213351, 6, 2971, "Lushroom Linked Trap", "", "", "", 1, 0, 0, 0, 124427, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019),
+(244605, 6, 9958, "Underbelly Hoard Trap", "", "", "", 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 22566);
+
+DELETE FROM `gameobject_template_addon` WHERE `entry` IN (202361, 208596, 208426);
+INSERT INTO `gameobject_template_addon` (`entry`, `faction`, `flags`, `mingold`, `maxgold`) VALUES
+(202361, 114, 0, 0, 0),
+(208596, 114, 32, 0, 0),
+(208426, 1924, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_10_30_07_world_335.sql b/sql/updates/world/3.3.5/2016_10_30_07_world_335.sql
new file mode 100644
index 00000000000..048613fc6b6
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_07_world_335.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `gameobject_template` WHERE `entry`=176592;
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `size`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `Data8`, `Data9`, `Data10`, `Data11`, `Data12`, `Data13`, `Data14`, `Data15`, `Data16`, `Data17`, `Data18`, `Data19`, `Data20`, `Data21`, `Data22`, `Data23`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES
+(176592, 6, 327, "Shellfish Trap", "", "", "", 1, 0, 0, 0, 17679, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", -18019);
diff --git a/sql/updates/world/3.3.5/2016_10_30_08_world.sql b/sql/updates/world/3.3.5/2016_10_30_08_world.sql
new file mode 100644
index 00000000000..0fd201e6cc8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_30_08_world.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `gameobject_template` SET `AIName`="" WHERE `entry`=184980;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=184980;
diff --git a/sql/updates/world/3.3.5/2016_10_31_00_world.sql b/sql/updates/world/3.3.5/2016_10_31_00_world.sql
new file mode 100644
index 00000000000..4b610eab05a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_10_31_00_world.sql
@@ -0,0 +1,9 @@
+--
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=18927 AND `groupid`=6 AND `id`=4;
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=19171 AND `groupid`=6 AND `id`=2;
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=19173 AND `groupid`=6 AND `id`=3;
+
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=19178 AND `groupid`=6 AND `id`=2;
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=19175 AND `groupid`=6 AND `id`=6;
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=19169 AND `groupid`=6 AND `id`=7;
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=19176 AND `groupid`=6 AND `id`=2;
diff --git a/sql/updates/world/3.3.5/2016_11_01_00_world.sql b/sql/updates/world/3.3.5/2016_11_01_00_world.sql
new file mode 100644
index 00000000000..8b1fd16d5fe
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_01_00_world.sql
@@ -0,0 +1,15 @@
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`IN(8530,8531,8532,11064);
+UPDATE `spell_dbc` SET `Effect1`=28,`EffectMiscValueB1`=64 WHERE `Id`IN(17310);
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(8530,8531,8532,11064);
+
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(8530, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 17310, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Cannibal Ghoul - On Death - Cast Summon Darrowshire Spirit'),
+(8531, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 17310, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Gibbering Ghoul - On Death - Cast Summon Darrowshire Spirit'),
+(8532, 0, 0, 0, 6, 0, 100, 0, 0, 0, 0, 0, 11, 17310, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Diseased Flayer - On Death - Cast Summon Darrowshire Spirit'),
+(11064, 0, 0, 0, 1, 0, 100, 0, 60000, 60000, 60000, 60000, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darrowshire Spirit - OOC - Despawn'),
+(11064, 0, 1, 2, 11, 0, 100, 0, 0, 0, 0, 0, 11, 17321, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darrowshire Spirit - On Reset - Cast Spirit Spawn-in'),
+(11064, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 19, 33554432, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darrowshire Spirit - On Reset - Remove Unit Flag Not selectable'),
+(11064, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 17327, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darrowshire Spirit - On Reset - Cast Spirit Particles'),
+(11064, 0, 4, 5, 64, 0, 100, 1, 0, 0, 0, 0, 33, 11064, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Darrowshire Spirit - On Gossip Hello - Kill Credit'),
+(11064, 0, 5, 0, 61, 0, 100, 1, 0, 0, 0, 0, 41, 10000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darrowshire Spirit - On Gossip Hello - Despawn after 10 seconds');
diff --git a/sql/updates/world/3.3.5/2016_11_01_01_world.sql b/sql/updates/world/3.3.5/2016_11_01_01_world.sql
new file mode 100644
index 00000000000..d503bbf09cc
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_01_01_world.sql
@@ -0,0 +1,9 @@
+--
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=18927 AND `groupid`=6 AND `id`=4;
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=19171 AND `groupid`=6 AND `id`=2;
+UPDATE `creature_text` SET `text`="For the Horde!", `BroadcastTextId`=23357 WHERE `entry`=19173 AND `groupid`=6 AND `id`=3;
+
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=19178 AND `groupid`=6 AND `id`=2;
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=19175 AND `groupid`=6 AND `id`=6;
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=19169 AND `groupid`=6 AND `id`=7;
+UPDATE `creature_text` SET `text`="For the Alliance!", `BroadcastTextId`=23351 WHERE `entry`=19176 AND `groupid`=6 AND `id`=2;
diff --git a/sql/updates/world/3.3.5/2016_11_01_02_world.sql b/sql/updates/world/3.3.5/2016_11_01_02_world.sql
new file mode 100644
index 00000000000..bf37b2b41c7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_01_02_world.sql
@@ -0,0 +1,16 @@
+DELETE FROM `gossip_menu_option` WHERE `menu_id`=4085;
+INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES
+(4085, 0, 1, 'Yes, Augustus. I would like to do business.', 7623, 3, 128, 0, 0, 0, 0, '', 0, 0);
+
+DELETE FROM `gossip_menu` WHERE `entry`=4085;
+INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES
+(4085, 4979, 0),
+(4085, 4980, 0);
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`IN(14,15) AND `SourceGroup`=4085;
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
+(14, 4085, 4979, 0, 0, 8, 0, 6164, 0, 0, 1, 0, 0, '', 'Augustus - Show Gossip Menu text 4979 if Quest 6164 is not rewarded'),
+(14, 4085, 4980, 0, 0, 8, 0, 6164, 0, 0, 0, 0, 0, '', 'Augustus - Show Gossip Menu text 4980 if Quest 6164 is rewarded'),
+(15, 4085, 0, 0, 0, 8, 0, 6164, 0, 0, 0, 0, 0, '', 'Augustus - Only allow players who have completed Augustus Receipt Book to access vendor');
+
+UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=12384;
diff --git a/sql/updates/world/3.3.5/2016_11_01_03_world.sql b/sql/updates/world/3.3.5/2016_11_01_03_world.sql
new file mode 100644
index 00000000000..da4a7cd1fa9
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_01_03_world.sql
@@ -0,0 +1,4 @@
+--
+DELETE FROM `gameobject` WHERE `guid` IN (5, 15, 20, 24, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 55, 57, 59, 62, 69, 71, 73, 76, 80, 84, 85, 87, 89, 91, 93, 97, 99, 101, 103, 105, 107, 111, 113, 115, 388, 390, 392, 394, 396, 400, 402, 403, 405, 407, 409, 412, 414, 420, 424, 426, 432, 492, 509, 513, 601, 610, 612, 617, 646, 660, 665, 669, 672, 718, 750, 763, 787, 791, 796, 802, 813, 828, 833, 836, 853, 859, 970, 1009, 1043, 1060, 1069, 1076, 1083, 1111, 1145, 1174, 1204, 1211, 1215, 1244, 1245, 1348, 1351, 1364, 1379, 1388, 1405, 1409, 1424, 1427, 1430, 1484, 1493, 1498, 1508, 1532, 1562, 1569, 1571, 1577, 1578, 1589, 1599, 1602, 1626, 1636, 1647, 1672, 1673, 1679, 1681, 1682, 1684, 1687, 1694, 1703, 1706, 1708, 1716, 1719, 1725, 1739, 1774, 1778, 1785, 1794, 1829, 1862, 1870, 1909, 1956, 1969, 2025, 2111, 2148, 2164, 2218, 2307, 2374, 2485, 2510, 2550, 2721, 2964, 3218, 4228, 4393, 4545, 4552, 4554, 4556, 4559, 4563, 4566, 4569, 4572, 4574, 4576, 4578, 4580, 4584, 4586, 4588, 4590, 4592, 4614, 4620, 4622, 4644, 4686, 4699, 4707, 4709, 4721, 4731, 4739, 4751, 4753, 4777, 4790, 4793, 4798, 4814, 4819, 4821, 4827, 4833, 4835, 4838, 4840, 4849, 4859, 4923, 4947, 4996, 5004, 5009, 5014, 5017, 5050, 5056, 5060, 5086, 5117, 5122, 5126, 5140, 5144, 5160, 5165, 5224, 5234, 5315, 5404, 5419, 5427, 5429, 5431, 5882, 6007, 6119, 6228, 6338, 6417, 6547, 6559, 6613, 6774, 6775, 6780, 6787, 6789, 6791, 6795, 6798, 6799, 6801, 6806, 6807, 6814, 6822, 6834, 6839, 6840, 6861, 6863, 6874, 6876, 6878, 6879, 6884, 6886, 6894, 6895, 6897, 6899, 6901, 6905, 6907, 6912, 6914, 6918, 6919, 6922, 6924, 6926, 6931, 6934, 6939, 6949, 6953, 6958, 6961, 6968, 6972, 6977, 6980, 6984, 6986, 6996, 6998, 7000, 7007, 7008, 7025, 7028, 7029, 7035, 7038, 7042, 7400, 7568, 7622, 7634, 7698, 7703, 7709, 7736, 7762, 7795, 8343, 8827, 8858, 8875, 9218, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 9908, 9911, 9913, 9915, 9919, 9922, 9924, 9927, 9930, 9931, 9934, 9935, 9941, 9942, 9944, 9949, 9952, 9954, 9956, 9958, 9962, 9965, 9971, 9974, 9975, 9978, 9982, 9987, 9992, 9996, 9997, 10001, 10006, 10009, 10016, 10021, 10024, 10026, 10029, 10032, 10034, 10036, 10040, 10042, 10045, 10047, 10051, 10055, 10059, 10061, 10065, 10071, 10076, 10077, 10081, 10085, 10088, 10091, 10095, 10098, 10109, 10113, 10116, 10117, 10123, 10126, 10129, 10133, 10138, 10141, 10144, 10147, 10149, 10151, 10155, 10159, 10161, 10162, 10170, 10179, 10183, 10186, 10188, 10194, 10200, 10206, 10210, 10211, 10219, 10220, 10225, 10226, 10229, 10230, 10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 10647, 10649, 10651, 10653, 10657, 10662, 10683, 10688, 10691, 10709, 10723, 10725, 10732, 10738, 10740, 10749, 10752, 10773, 10778, 10825, 10834, 10842, 10873, 10875, 10877, 10879, 10884, 10929, 10931, 10934, 10953, 10955, 10957, 10959, 10961, 10965, 10971, 10973, 10976, 10978, 10980, 10988, 10994, 10996, 11003, 11011, 11021, 11023, 11070, 11073, 11088, 11095, 11125, 11135, 11137, 11161, 11197, 11199, 11201, 11209, 11226, 11228, 11233, 11236, 11240, 11241, 11248, 11253, 11256, 11258, 11263, 11266, 11269, 11271, 11282, 11284, 11286, 11289, 11316, 11319, 11330, 11332, 11336, 11345, 11352, 11364, 11387, 11392, 11396, 11399, 11435, 11437, 11459, 11462, 11519, 11521, 11523, 11530, 11532, 11534, 11536, 11542, 11544, 11547, 11549, 11552, 11554, 11556, 11558, 11563, 11567, 11569, 11575, 11577, 11579, 11583, 11587, 11589, 11592, 11596, 11603, 11605, 11608, 11610, 11613, 11615, 11617, 11619, 11625, 11629, 11631, 11634, 11636, 11723, 11734, 11738, 11770, 11774, 11776, 11778, 11782, 11784, 11786, 11789, 11791, 11793, 11795, 11800, 11803, 11821, 11823, 11828, 11831, 11853, 11860, 11865, 11867, 11912, 11915, 11917, 11919, 11923, 11928, 11942, 11944, 11946, 11951, 11960, 11975, 11979, 11981, 11984, 11987, 12009, 12037, 12039, 12041, 12063, 12066, 12071, 12080, 12092, 12112, 12114, 12116, 12118, 12124, 12127, 12128, 12131, 12135, 12138, 12144, 12149, 12167, 12174, 12176, 12178, 12180, 12186, 12188, 12192, 12195, 12196, 12201, 12205, 12210, 12211, 12337, 12338, 12342, 12348, 12419, 12447, 12449, 12451, 12453, 12455, 12564, 12576, 12624, 12632, 12649, 12653, 12662, 12673, 12675, 12697, 12710, 12711, 12712, 12715, 12716, 12718, 12722, 12723, 12724, 12725, 12726, 12727, 12728, 12729, 12730, 12731, 12732, 12733, 12734, 12735, 12736, 12738, 12739, 12740, 12741, 12742, 12743, 12744, 12745, 12746, 12747, 12748, 12749, 12750, 12751, 12752, 12753, 12754, 12763, 12776, 12779, 12781, 12788, 12790, 12792, 12797, 12798, 12800, 12803, 12804, 12805, 12807, 12808, 12811, 12812, 12814, 12817, 12818, 12820, 12821, 12822, 12823, 12825, 12829, 12832, 12833, 12834, 12835, 12836, 12838, 12839, 12840, 12847, 12849, 12850, 12852, 12853, 12854, 12855, 12857, 12928, 12930, 12931, 12933, 12934, 12935, 12936, 12937, 12938, 12939, 12940, 12941, 12942, 12943, 12944, 12946, 12947, 12948, 12949, 12950, 12952, 12953, 12954, 12955, 12956, 12957, 12958, 12959, 12960, 12961, 12962, 12963, 12982, 12983, 13001, 13020, 13025, 13070, 13128, 13138, 13184, 13190, 13211, 13278, 13279, 13280, 13281, 13282, 13283, 13284, 13316, 13328, 13329, 13330, 13331, 13332, 13333, 13334, 13335, 13336, 13337, 13340, 13341, 13342, 13343, 13344, 13433, 13523, 13612, 13614, 13616, 13618, 13623, 13636, 13650, 13679, 13703, 13707, 13709, 13711, 13713, 13715, 13717, 13719, 13722, 13725, 13727, 13729, 13731, 13733, 13735, 13737, 13739, 13741, 13745, 13747, 13749, 13753, 13755, 13759, 13769, 13773, 13775, 13777, 13782, 13784, 13786, 13806, 13808, 13811, 13816, 13865, 13966, 13973, 13975, 13977, 13982, 13984, 13988, 13990, 13992, 14056, 14058, 14064, 14066, 14070, 14072, 14075, 14117, 14126, 14162, 14165, 14168, 14171, 14183, 14188, 14189, 14190, 14191, 14192, 14193, 14228, 14229, 14237, 14239, 14250, 14252, 14254, 14256, 14258, 14263, 14266, 14268, 14270, 14277, 14293, 14299, 14300, 14304, 14306, 14308, 14328, 14330, 14347, 14356, 14365, 14367, 14369, 14377, 14379, 14381, 14386, 14392, 14405, 14418, 14424, 14429, 14432, 14435, 14445, 14461, 14520, 14543, 14545, 14549, 14553, 14575, 14580, 14582, 14588, 14633, 14669, 14686, 14723, 14746, 14748, 14750, 14806, 14809, 14916, 14921, 15195, 15219, 15221, 15223, 15234, 15401, 15403, 15478, 15479, 15481, 15500, 15513, 15705, 15747, 15773, 15778, 15786, 15787, 16546, 16549, 16550, 16551, 16552, 16553, 16554, 16555, 16556, 16561, 16562, 16564, 16571, 16581, 16584, 16585, 16587, 16591, 16592, 16594, 16595, 16596, 16597, 16600, 16601, 16602, 16603, 16604, 16613, 16614, 16619, 16620, 16649, 16650, 16651, 16653, 16654, 16655, 16656, 16657, 16658, 16659, 16660, 16661, 16662, 16663, 16996, 17231, 17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17254, 17255, 17256, 17257, 17460, 17759, 18008, 18009, 18010, 18017, 18018, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 18061, 18068, 18072, 18073, 18074, 18075, 18076, 18077, 18079, 18080, 18081, 18087, 18088, 18089, 18090, 18091, 18092, 18093, 18094, 18095, 18096, 18112, 18113, 18114, 18174, 18285, 18499, 18589, 18606, 18607, 18639, 18641, 18647, 18656, 18832, 18839, 18841, 18843, 18859, 18911, 20329, 20330, 20331, 20363, 20366, 20372, 20374, 20376, 20401, 20444, 20453, 20466, 20474, 20475, 20476, 20477, 20497, 20511, 20577, 20653, 20724, 20751, 20820, 20847, 20863, 20865, 20869, 20893, 20894, 20895, 20896, 20897, 20898, 20899, 20900, 20901, 20902, 20903, 20904, 20905, 20906, 20935, 20937, 20941, 20943, 20946, 20948, 20950, 20954, 21551, 21552, 21602, 21603, 21604, 21605, 21941, 21942, 21943, 21944, 21945, 21946, 21947, 21948, 21949, 21950, 21951, 21952, 21953, 21954, 21955, 21956, 21957, 21958, 21959, 21960, 21961, 21962, 21963, 21964, 21965, 21966, 21967, 21968, 21969, 21970, 21971, 21972, 21973, 21974, 21975, 21976, 21977, 21978, 21979, 21980, 21981, 21982, 21983, 21984, 21985, 21986, 21987, 21988, 21989, 22417, 22418, 22419, 22420, 22421, 22422, 22423, 22424, 22425, 22426, 22427, 22428, 23205, 23206, 23207, 23208, 23209, 23210, 23211, 23212, 23213, 23214, 23273, 23274, 23275, 23276, 23277, 23278, 23279, 23280, 23281, 23282, 23283, 23284, 23285, 23286, 23287, 23288, 23289, 23290, 23291, 23292, 23293, 23294, 23295, 23296, 23297, 23298, 23299, 23300, 23301, 23302, 23303, 23304, 23305, 23306, 23307, 23308, 23309, 23310, 23311, 23312, 23313, 23314, 23315, 23316, 23317, 23318, 23319, 23320, 23321, 23322, 24613, 24614, 24615, 24616, 24617, 24618, 24619, 24620, 24621, 24622, 24623, 24624, 24625, 24626, 24627, 24628, 24629, 24630, 24631, 24632, 24633, 24967, 24968, 24969, 24970, 24971, 24972, 24973, 24974, 24975, 24976, 24977, 24978, 24979, 24980, 24981, 24982, 24983, 24984, 24985, 24986, 24987, 24988, 24989, 24990, 24991, 24992, 24993, 24994, 24995, 24996, 24997, 24998, 24999, 25000, 25001, 25002, 25003, 25030, 25031, 25032, 25566, 25597, 25622, 25627, 25628, 25629, 25697, 25738, 25758, 25794, 25795, 25796, 25797, 25798, 25799, 25800, 25801, 25802, 25803, 25804, 25816, 26098, 26099, 26100, 26101, 26102, 26230, 26232, 26245, 26248, 26254, 26258, 26513, 26708, 26719, 26746, 26748, 26751, 26766, 26775, 26809, 26811, 26818, 26855, 26857, 26859, 26861, 26864, 26868, 26872, 26892, 26897, 26909, 26971, 26989, 26992, 26997, 27010, 27019, 27043, 27070, 27081, 27088, 27096, 27125, 27146, 27151, 27153, 27155, 27157, 27159, 27161, 27163, 27165, 27171, 27173, 27175, 27180, 27182, 27184, 27186, 27188, 27190, 27192, 27194, 27196, 27198, 27200, 27202, 27204, 27206, 27208, 27211, 27213, 27215, 27217, 27219, 27225, 27227, 27229, 27232, 27252, 27259, 27262, 27264, 27267, 27277, 27280, 27292, 27296, 27367, 27382, 27384, 27392, 27394, 27396, 27398, 27400, 27402, 27404, 27406, 27408, 27410, 27412, 27414, 27418, 27420, 27443, 27445, 27448, 27453, 27455, 27470, 27472, 27474, 27476, 27478, 27480, 27482, 27484, 27486, 27488, 27490, 27501, 27504, 27506, 27508, 27510, 27512, 27517, 27519, 27557, 27560, 27569, 27571, 27574, 27581, 27583, 27585, 27595, 27597, 27599, 27601, 27603, 27605, 27607, 27609, 27612, 27614, 27615, 28042, 28107, 28128, 28205, 28251, 28264, 28269, 28276, 28278, 28280, 28290, 28293, 28320, 28333, 28423, 28439, 28441, 28444, 28455, 28457, 28459, 28461, 28474, 28478, 28602, 28634, 28636, 28638, 28640, 28642, 28644, 28647, 28649, 28651, 28653, 28655, 28657, 28663, 28674, 28676, 28678, 28680, 28682, 28685, 28687, 28689, 28691, 28693, 28732, 28734, 28736, 28738, 28740, 28742, 28744, 29189, 29208, 29209, 29212, 29213, 29214, 29215, 29216, 29262, 29265, 29270, 29357, 29359, 29364, 29548, 29560, 29567, 29645, 29662, 29715, 29717, 29783, 29785, 30040, 30049, 30051, 30059, 30062, 30085, 30089, 30092, 30094, 30096, 30102, 30119, 30142, 30216, 30218, 30220, 30222, 30406, 30414, 30416, 30426, 30428, 30764, 30891, 30960, 31049, 31058, 31060, 31064, 31066, 31070, 31072, 31074, 31081, 31083, 31087, 31092, 31095, 31097, 31134, 31137, 31140, 31303, 31312, 31315, 31320, 31327, 31332, 31942, 31961, 31991, 31994, 31996, 31998, 32002, 32004, 32006, 32026, 32034, 32036, 32038, 32040, 32042, 32044, 32047, 32049, 32057, 32059, 32062, 32064, 32072, 32083, 32098, 32110, 32130, 32288, 32296, 32300, 32310, 32312, 32319, 32322, 32324, 32327, 32330, 32333, 32335, 32341, 32345, 32348, 32371, 32449, 32451, 32453, 32458, 32473, 32491, 32496, 32611, 32623, 32631, 32633, 32642, 32713, 32715, 32722, 32726, 32728, 32730, 32732, 32734, 32736, 32739, 32766, 32768, 32771, 32782, 32786, 32789, 32791, 32793, 32795, 32797, 32799, 32801, 32803, 32805, 32807, 32812, 32814, 32827, 32829, 32831, 32836, 32867, 32869, 32871, 32883, 33225, 33230, 33235, 33243, 33245, 33247, 33249, 33252, 33255, 33269, 33271, 33273, 33276, 33313, 33317, 33319, 33321, 33334, 33363, 33365, 33367, 33373, 33386, 33416, 33460, 33464, 33480, 33487, 33489, 33497, 33499, 33501, 33542, 33544, 33555, 33556, 33559, 33732, 33867, 33869, 33873, 33877, 33879, 33895, 33903, 33911, 34024, 34040, 34050, 34052, 34056, 34077, 34085, 34090, 34092, 34115, 34142, 34150, 34152, 34158, 34160, 34161, 34162, 34163, 34164, 34166, 34171, 34172, 34173, 34174, 34175, 34227, 34230, 34236, 34249, 34255, 34260, 34271, 34276, 34286, 34828, 34833, 34839, 34845, 34857, 34865, 34921, 34933, 34938, 34975, 34978, 34980, 35310, 35313, 35321, 35322, 35326, 35328, 35330, 35332, 35335, 35337, 35339, 35360, 35364, 35377, 35409, 35591, 35594, 35598, 35601, 35603, 35605, 35607, 35609, 35611, 35613, 35615, 35617, 35619, 35623, 35625, 35628, 35630, 35635, 35638, 35641, 35644, 35646, 35649, 35654, 35656, 35658, 35660, 35662, 35664, 35666, 35668, 35671, 35673, 35675, 35677, 35679, 35681, 35684, 35686, 35688, 35690, 35692, 35697, 35700, 35704, 35708, 35710, 35712, 35714, 35716, 35718, 35720, 35723, 35725, 35727, 35730, 35732, 35734, 35736, 35741, 35745, 35747, 35750, 35800, 39972, 39974, 39987, 40676, 40678, 40681, 40683, 40685, 40687, 40761, 40763, 40765, 40767, 40795, 40799, 40801, 40803, 40805, 40808, 40812, 40815, 40817, 42096, 42447, 42448, 42451, 42456, 42488, 42490, 42493, 42499, 42501, 42503, 42505, 42509, 42512, 42514, 42518, 42541, 42550, 42552, 42555, 42558, 42560, 42565, 42647, 42678, 42984, 43176, 43181, 43183, 43194, 44664, 44685, 44686, 44687, 44688, 44689, 44690, 44691, 44692, 44693, 44694, 44695, 44696, 44697, 44698, 44699, 44700, 44701, 44702, 44703, 44704, 44736, 44744, 44768, 44770, 44772, 44774, 44779, 44781, 44788, 44796, 44803, 44847, 44852, 44854, 44860, 44865, 44870, 44877, 44879, 44881, 44925, 45296, 45298, 45300, 45302, 45304, 45307, 45321, 45323, 45329, 45331, 45509, 45511, 45513, 45515, 45563, 45566, 45568, 45571, 45573, 45584, 45586, 45591, 45593, 45595, 45597, 45600, 45602, 45605, 45609, 45611, 45614, 45617, 45619, 45622, 45854, 45864, 45869, 45876, 45935, 45937, 45955, 45972, 45974, 45976, 45978, 45983, 45985, 45998, 46000, 46002, 46004, 46006, 46010, 46012, 46014, 46016, 46018, 46020, 46022, 46024, 46026, 46028, 46030, 46032, 46034, 46036, 46038, 46045, 46051, 46056, 46058, 46061, 46063, 46069, 46071, 46073, 46075, 46078, 46080, 46084, 46086, 46111, 46124, 46137, 46177, 47190, 47713, 47714, 47715, 47716, 47717, 47718, 47719, 47720, 47721, 47722, 47723, 47724, 47725, 47726, 47727, 47728, 47729, 47730, 47731, 47732, 47733, 47734, 47735, 47736, 47737, 47738, 47739, 47740, 47741, 47742, 47743, 47744, 47745, 47746, 47747, 47748, 47749, 47750, 47751, 47752, 47753, 47754, 47755, 47756, 47757, 47758, 47759, 47760, 47761, 47762, 47763, 47764, 47765, 47766, 47767, 47768, 47769, 47770, 47771, 47772, 47773, 47774, 47775, 47776, 47777, 47778, 47779, 47780, 47781, 47782, 47783, 47784, 47785, 47786, 47787, 47788, 47789, 47790, 47791, 47792, 47793, 47794, 48019, 48141, 48142, 48195, 48196, 48197, 48198, 48199, 48200, 48201, 48202, 48203, 48204, 48205, 48206, 48207, 48208, 48209, 48210, 48211, 48212, 48213, 48214, 48215, 48216, 48217, 48218, 48219, 48220, 48221, 48222, 48223, 48224, 48225, 48226, 48227, 48228, 48229, 48439, 48491, 48496, 48504, 48507, 48516, 48536, 48559, 48599, 48607, 48609, 48611, 48613, 48615, 48622, 48700, 48702, 48706, 48739, 48741, 48744, 48792, 48799, 48801, 48803, 48805, 48809, 48820, 48822, 48825, 48830, 48835, 48837, 48983, 48984, 48986, 48987, 48988, 48989, 48990, 48991, 48992, 48994, 49209, 49211, 49213, 49215, 49272, 49273, 49274, 49275, 49276, 49277, 49278, 49279, 49280, 49281, 49282, 49283, 49284, 49353, 49354, 49355, 49356, 49357, 49358, 49359, 49360, 49361, 49362, 49363, 49364, 49365, 49366, 49367, 49368, 49369, 49370, 49371, 49501, 49502, 49503, 49504, 49505, 49506, 49507, 49508, 49509, 49510, 49511, 49512, 49513, 49514, 49515, 49516, 49517, 49518, 49519, 49520, 49839, 49853, 49854, 49855, 49856, 49857, 49858, 49859, 49860, 49861, 49863, 49864, 49865, 49866, 49867, 49868, 49869, 49870, 49871, 49872, 49873, 49874, 49875, 49876, 49877, 49878, 49879, 49880, 49881, 49882, 49883, 49884, 49885, 49886, 49887, 49888, 49890, 49891, 49892, 49893, 49894, 49895, 49896, 49897, 49898, 49899, 49917, 49918, 49920, 49921, 49922, 49923, 49924, 49925, 49926, 49927, 49928, 49929, 49930, 49931, 49932, 49933, 49934, 49935, 49936, 49937, 49938, 49939, 49940, 49941, 49963, 49964, 49965, 49966, 49968, 50426, 50427, 50428, 50429, 50430, 50431, 50432, 50433, 50434, 52329, 52524, 52525, 52528, 52529, 52530, 52531, 52532, 52533, 52534, 52535, 52536, 52537, 52538, 52539, 52540, 52543, 52544, 52545, 52546, 52547, 52548, 52549, 52550, 52551, 52552, 52553, 52554, 52555, 52556, 52557, 52558, 52559, 52561, 52562, 52563, 52564, 52565, 52566, 52567, 52568, 52569, 52570, 52571, 52572, 52573, 52574, 52575, 52576, 52577, 52578, 52579, 55259, 55260, 55261, 55262, 55263, 55264, 55265, 55266, 55267, 55268, 55269, 55270, 55271, 55272, 55273, 55274, 55275, 55276, 55277, 55278, 55279, 55280, 55281, 55282, 55283, 55284, 55285, 55286, 55287, 55288, 55289, 55290, 55291, 55292, 55293, 55294, 55295, 55296, 55297, 55298, 55299, 55300, 55301, 55302, 55303, 55304, 55305, 55306, 55307, 55308, 55309, 55310, 55311, 55312, 55313, 55314, 55315, 55316, 55317, 55318, 55319, 55320, 55321, 55322, 55323, 55324, 55325, 55326, 55327, 55328, 55330, 55331, 55332, 55333, 55334, 55335, 55336, 55337, 55338, 55339, 55340, 55341, 55342, 55344, 55346, 55347, 55349, 55350, 55351, 55352, 55353, 55354, 55355, 55356, 55357, 55358, 55359, 55360, 55361, 55362, 55363, 55364, 55365, 55366, 55367, 55368, 55369, 55370, 55371, 55372, 55373, 55374, 55375, 55377, 55378, 55379, 55380, 55381, 55382, 55383, 55384, 55385, 55386, 55387, 55388, 55389, 55390, 55392, 55393, 55394, 55395, 55396, 55397, 55398, 55399, 55400, 55401, 55402, 55403, 55404, 55405, 55407, 55715, 55716, 55717, 55718, 55719, 55720, 55721, 55722, 55723, 55724, 55725, 55726, 55727, 55728, 55729, 55730, 55731, 55732, 55733, 55735, 55736, 55737, 55738, 55739, 55740, 55741, 55742, 55743, 55744, 55745, 55746, 55747, 55748, 55749, 55750, 55751, 55752, 55753, 55754, 55755, 55756, 55757, 55758, 55759, 55760, 55761, 55762, 55763, 55764, 55765, 55766, 55767, 55768, 55769, 55770, 55771, 55772, 55773, 55774, 55775, 55776, 55777, 55778, 55779, 55780, 55781, 55782, 55783, 55784, 55785, 55786, 55787, 55788, 55789, 55790, 55791, 55792, 55793, 55794, 55795, 55796, 55797, 55798, 55799, 55800, 55801, 55802, 55803, 55804, 55805, 55806, 55807, 55808, 55809, 55810, 55811, 55812, 55813, 55814, 55815, 55816, 55817, 55818, 55819, 55820, 55821, 55822, 55823, 55824, 55825, 55826, 55827, 55828, 55829, 55830, 55831, 55832, 55833, 55834, 55835, 55836, 55837, 55838, 55839, 55840, 55841, 55842, 55843, 55844, 55845, 55846, 55847, 55848, 55849, 55850, 55852, 55853, 55854, 55855, 55856, 55857, 55858, 55859, 55860, 55861, 55863, 55864, 55865, 55866, 55867, 55868, 55869, 55870, 55871, 55872, 55873, 55874, 55875, 55876, 55877, 55878, 55879, 55880, 55881, 55882, 55883, 55884, 55885, 55886, 55887, 55888, 55889, 55890, 55891, 55892, 55893, 55894, 55895, 55896, 55897, 55898, 55899, 55900, 55901, 55902, 55903, 55904, 55905, 55906, 55907, 55908, 55909, 55910, 55911, 55912, 55913, 56288, 56289, 56290, 56291, 56292, 56293, 56294, 56817, 57545, 57546, 57547, 57548, 57549, 57550, 57551, 57552, 57553, 57554, 57555, 57556, 57557, 57558, 57559, 57560, 57561, 57562, 57563, 57758, 57759, 57760, 57761, 57762, 57763, 57764, 57765, 57766, 57767, 58007, 58008, 58009, 58834, 58836, 58838, 58839, 58840, 58844, 58846, 58847, 58848, 58849, 58850, 58851, 58852, 58853, 58854, 58857, 58858, 58859, 58860, 58861, 58862, 58863, 58864, 58865, 58866, 58867, 58868, 58869, 58870, 58871, 58872, 58873, 58877, 58878, 58879, 58880, 58881, 58882, 58883, 58884, 58885, 58886, 58888, 58889, 58890, 58891, 58892, 58893, 59359, 59360, 59361, 59362, 59363, 59364, 59365, 59366, 59367, 59368, 59369, 59370, 59371, 59372, 59373, 59374, 59375, 59376, 59377, 59378, 59379, 59380, 59381, 59382, 59383, 59384, 59393, 59395, 59400, 59405, 59410, 59411, 60208, 60209, 60210, 60211, 60212, 60213, 60215, 60216, 60217, 60218, 60219, 60220, 60221, 60222, 60223, 60224, 60225, 60228, 60229, 60230, 60231, 60232, 60233, 60234, 60235, 60236, 60360, 60361, 60362, 60363, 60364, 60365, 60366, 60367, 60368, 60369, 60370, 60371, 60372, 60373, 60374, 60375, 60376, 60377, 60378, 60379, 60380, 60381, 60382, 60383, 60384, 60385, 60386, 60387, 60388, 60389, 60390, 60674, 60675, 60710, 60802, 60803, 60805, 60806, 60807, 60809, 60814, 60817, 61025, 61387, 61389, 61390, 61391, 61392, 61394, 61397, 61398, 61406, 61410, 61473, 61557, 61558, 61560, 61561, 61562, 61563, 61564, 61565, 61566, 61567, 61568, 61569, 61570, 61571, 61572, 61573, 61574, 61575, 61576, 61577, 61578, 61579, 61580, 61581, 61582, 61583, 61704, 61705, 61706, 61707, 61708, 61709, 61710, 61711, 61712, 61713, 61714, 61715, 61716, 61717, 61718, 61719, 61720, 61721, 61722, 61723, 61724, 61725, 61726, 61727, 61728, 62031, 62033, 62050, 62051, 62052, 62053, 62054, 62055, 62056, 62057, 62058, 62059, 62060, 62061, 62062, 62064, 62065, 62066, 62067, 62068, 62705, 62707, 62708, 62709, 62710, 62711, 62712, 62713, 62714, 62715, 62716, 62717, 62718, 62719, 62720, 62721, 62722, 62723, 62724, 62725, 62726, 62727, 62728, 62729, 62730, 62731, 62732, 62820, 62890, 62891, 62892, 62893, 62894, 62895, 65167, 65872, 65873, 65874, 65875, 65876, 65877, 65878, 65879, 65880, 65903, 65904, 66256, 66257, 66433, 66434, 66636, 66680, 67225, 67226, 67227, 67228, 67229, 67230, 67231, 67232, 67233, 67234, 67235, 67236, 67237, 67238, 67239, 67282, 67283, 67284, 67285, 67286, 67287, 67288, 67289, 67622, 67623, 67624, 67625, 67627, 67629, 67630, 67631, 67633, 67634, 67648, 67738, 67739, 67740, 67741, 67742, 67743, 67744, 67761, 76733, 76735, 76737, 76739, 76741, 76743, 76745, 76747, 76749, 76751, 76753, 76755, 76757, 76759, 76761, 76763, 76765, 76767, 76769, 76771, 76774, 76776, 76778, 76780, 76782, 76784, 76786, 76788, 76789, 76792, 76793, 76796, 76798, 76800, 76802, 81187, 85992, 85993, 85994, 85995, 85996, 85997, 86155, 86156, 86157, 86158, 87011, 87155, 87156, 150128, 150196, 150200, 150204, 150209, 150212, 150214, 150217, 150218, 150223, 150227, 150230, 150233, 150237, 150245, 150249, 150253, 150258, 150263, 150269, 150277, 150285, 150289, 150296, 150298, 150300, 150711, 164473, 164519, 164534, 164584, 164615, 164638, 164723, 164735, 164775, 164854, 164904, 164984, 165047, 165055, 165071, 165115, 165146, 165180, 165205, 165209, 165222, 165233, 165259, 165358, 165359, 165509, 165583);
+DELETE FROM `gameobject_addon` WHERE `guid` IN (5, 15, 20, 24, 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 55, 57, 59, 62, 69, 71, 73, 76, 80, 84, 85, 87, 89, 91, 93, 97, 99, 101, 103, 105, 107, 111, 113, 115, 388, 390, 392, 394, 396, 400, 402, 403, 405, 407, 409, 412, 414, 420, 424, 426, 432, 492, 509, 513, 601, 610, 612, 617, 646, 660, 665, 669, 672, 718, 750, 763, 787, 791, 796, 802, 813, 828, 833, 836, 853, 859, 970, 1009, 1043, 1060, 1069, 1076, 1083, 1111, 1145, 1174, 1204, 1211, 1215, 1244, 1245, 1348, 1351, 1364, 1379, 1388, 1405, 1409, 1424, 1427, 1430, 1484, 1493, 1498, 1508, 1532, 1562, 1569, 1571, 1577, 1578, 1589, 1599, 1602, 1626, 1636, 1647, 1672, 1673, 1679, 1681, 1682, 1684, 1687, 1694, 1703, 1706, 1708, 1716, 1719, 1725, 1739, 1774, 1778, 1785, 1794, 1829, 1862, 1870, 1909, 1956, 1969, 2025, 2111, 2148, 2164, 2218, 2307, 2374, 2485, 2510, 2550, 2721, 2964, 3218, 4228, 4393, 4545, 4552, 4554, 4556, 4559, 4563, 4566, 4569, 4572, 4574, 4576, 4578, 4580, 4584, 4586, 4588, 4590, 4592, 4614, 4620, 4622, 4644, 4686, 4699, 4707, 4709, 4721, 4731, 4739, 4751, 4753, 4777, 4790, 4793, 4798, 4814, 4819, 4821, 4827, 4833, 4835, 4838, 4840, 4849, 4859, 4923, 4947, 4996, 5004, 5009, 5014, 5017, 5050, 5056, 5060, 5086, 5117, 5122, 5126, 5140, 5144, 5160, 5165, 5224, 5234, 5315, 5404, 5419, 5427, 5429, 5431, 5882, 6007, 6119, 6228, 6338, 6417, 6547, 6559, 6613, 6774, 6775, 6780, 6787, 6789, 6791, 6795, 6798, 6799, 6801, 6806, 6807, 6814, 6822, 6834, 6839, 6840, 6861, 6863, 6874, 6876, 6878, 6879, 6884, 6886, 6894, 6895, 6897, 6899, 6901, 6905, 6907, 6912, 6914, 6918, 6919, 6922, 6924, 6926, 6931, 6934, 6939, 6949, 6953, 6958, 6961, 6968, 6972, 6977, 6980, 6984, 6986, 6996, 6998, 7000, 7007, 7008, 7025, 7028, 7029, 7035, 7038, 7042, 7400, 7568, 7622, 7634, 7698, 7703, 7709, 7736, 7762, 7795, 8343, 8827, 8858, 8875, 9218, 9666, 9667, 9668, 9669, 9670, 9671, 9672, 9673, 9674, 9675, 9676, 9677, 9678, 9679, 9680, 9681, 9682, 9683, 9684, 9685, 9686, 9687, 9688, 9689, 9690, 9691, 9692, 9693, 9694, 9695, 9696, 9697, 9698, 9699, 9700, 9701, 9702, 9703, 9704, 9705, 9706, 9707, 9708, 9709, 9710, 9711, 9712, 9713, 9714, 9715, 9716, 9717, 9718, 9719, 9720, 9721, 9722, 9723, 9724, 9725, 9726, 9727, 9728, 9729, 9730, 9731, 9732, 9733, 9734, 9735, 9736, 9737, 9738, 9739, 9740, 9741, 9742, 9743, 9744, 9745, 9746, 9747, 9748, 9749, 9750, 9751, 9752, 9753, 9754, 9755, 9756, 9757, 9758, 9759, 9760, 9761, 9762, 9763, 9764, 9765, 9766, 9767, 9768, 9769, 9770, 9771, 9772, 9773, 9774, 9775, 9776, 9777, 9778, 9779, 9780, 9781, 9782, 9783, 9784, 9785, 9786, 9787, 9788, 9789, 9790, 9791, 9792, 9793, 9794, 9795, 9796, 9797, 9798, 9799, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9812, 9813, 9814, 9815, 9816, 9817, 9818, 9819, 9820, 9821, 9822, 9823, 9824, 9825, 9826, 9827, 9828, 9829, 9830, 9831, 9832, 9833, 9834, 9835, 9836, 9837, 9838, 9839, 9840, 9841, 9842, 9843, 9844, 9845, 9846, 9847, 9848, 9849, 9850, 9851, 9852, 9853, 9854, 9855, 9856, 9857, 9858, 9859, 9860, 9861, 9862, 9863, 9864, 9865, 9866, 9867, 9868, 9869, 9870, 9871, 9872, 9873, 9874, 9875, 9876, 9877, 9878, 9879, 9880, 9881, 9882, 9883, 9884, 9885, 9886, 9887, 9888, 9889, 9890, 9891, 9892, 9893, 9894, 9895, 9896, 9897, 9898, 9899, 9900, 9901, 9902, 9903, 9904, 9905, 9906, 9908, 9911, 9913, 9915, 9919, 9922, 9924, 9927, 9930, 9931, 9934, 9935, 9941, 9942, 9944, 9949, 9952, 9954, 9956, 9958, 9962, 9965, 9971, 9974, 9975, 9978, 9982, 9987, 9992, 9996, 9997, 10001, 10006, 10009, 10016, 10021, 10024, 10026, 10029, 10032, 10034, 10036, 10040, 10042, 10045, 10047, 10051, 10055, 10059, 10061, 10065, 10071, 10076, 10077, 10081, 10085, 10088, 10091, 10095, 10098, 10109, 10113, 10116, 10117, 10123, 10126, 10129, 10133, 10138, 10141, 10144, 10147, 10149, 10151, 10155, 10159, 10161, 10162, 10170, 10179, 10183, 10186, 10188, 10194, 10200, 10206, 10210, 10211, 10219, 10220, 10225, 10226, 10229, 10230, 10231, 10232, 10233, 10234, 10235, 10236, 10237, 10238, 10239, 10240, 10241, 10242, 10243, 10244, 10245, 10246, 10247, 10248, 10249, 10250, 10251, 10252, 10253, 10254, 10255, 10256, 10257, 10258, 10259, 10260, 10261, 10262, 10263, 10264, 10265, 10266, 10267, 10268, 10269, 10270, 10271, 10272, 10273, 10274, 10275, 10276, 10277, 10278, 10279, 10280, 10281, 10282, 10283, 10284, 10285, 10286, 10287, 10288, 10289, 10290, 10291, 10292, 10293, 10294, 10295, 10296, 10297, 10298, 10299, 10300, 10301, 10302, 10303, 10304, 10305, 10306, 10307, 10308, 10309, 10310, 10311, 10312, 10313, 10314, 10315, 10316, 10317, 10318, 10319, 10320, 10321, 10322, 10323, 10324, 10325, 10326, 10327, 10328, 10329, 10330, 10331, 10332, 10333, 10334, 10335, 10336, 10337, 10338, 10339, 10340, 10341, 10342, 10343, 10344, 10345, 10346, 10347, 10348, 10349, 10350, 10351, 10352, 10353, 10354, 10355, 10356, 10357, 10358, 10359, 10360, 10361, 10362, 10363, 10364, 10365, 10366, 10367, 10368, 10369, 10370, 10371, 10372, 10373, 10374, 10375, 10376, 10377, 10378, 10379, 10380, 10381, 10382, 10383, 10384, 10385, 10386, 10387, 10388, 10389, 10390, 10391, 10392, 10393, 10394, 10395, 10396, 10397, 10398, 10399, 10400, 10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 10410, 10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 10420, 10421, 10422, 10423, 10424, 10425, 10426, 10427, 10428, 10429, 10430, 10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 10440, 10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 10450, 10451, 10452, 10453, 10454, 10455, 10456, 10457, 10458, 10459, 10460, 10461, 10462, 10463, 10464, 10465, 10466, 10467, 10468, 10469, 10470, 10471, 10472, 10473, 10474, 10475, 10476, 10477, 10478, 10479, 10480, 10481, 10482, 10483, 10484, 10485, 10486, 10487, 10488, 10489, 10490, 10491, 10492, 10493, 10494, 10495, 10496, 10497, 10498, 10499, 10500, 10501, 10502, 10503, 10504, 10505, 10506, 10507, 10508, 10509, 10510, 10511, 10512, 10513, 10514, 10515, 10516, 10517, 10518, 10519, 10520, 10521, 10522, 10523, 10524, 10525, 10526, 10527, 10528, 10529, 10530, 10531, 10532, 10533, 10534, 10535, 10536, 10537, 10538, 10539, 10540, 10541, 10542, 10543, 10544, 10545, 10546, 10547, 10548, 10549, 10550, 10551, 10552, 10553, 10554, 10555, 10556, 10557, 10558, 10559, 10560, 10561, 10562, 10563, 10564, 10565, 10566, 10567, 10568, 10569, 10570, 10571, 10572, 10573, 10574, 10575, 10576, 10577, 10578, 10579, 10580, 10581, 10582, 10583, 10584, 10585, 10586, 10587, 10588, 10589, 10590, 10591, 10592, 10593, 10594, 10595, 10596, 10597, 10598, 10599, 10600, 10601, 10602, 10603, 10604, 10605, 10606, 10607, 10608, 10609, 10610, 10611, 10612, 10613, 10614, 10615, 10616, 10617, 10618, 10619, 10620, 10621, 10622, 10623, 10624, 10625, 10626, 10627, 10628, 10629, 10630, 10631, 10632, 10633, 10634, 10635, 10636, 10637, 10638, 10639, 10640, 10647, 10649, 10651, 10653, 10657, 10662, 10683, 10688, 10691, 10709, 10723, 10725, 10732, 10738, 10740, 10749, 10752, 10773, 10778, 10825, 10834, 10842, 10873, 10875, 10877, 10879, 10884, 10929, 10931, 10934, 10953, 10955, 10957, 10959, 10961, 10965, 10971, 10973, 10976, 10978, 10980, 10988, 10994, 10996, 11003, 11011, 11021, 11023, 11070, 11073, 11088, 11095, 11125, 11135, 11137, 11161, 11197, 11199, 11201, 11209, 11226, 11228, 11233, 11236, 11240, 11241, 11248, 11253, 11256, 11258, 11263, 11266, 11269, 11271, 11282, 11284, 11286, 11289, 11316, 11319, 11330, 11332, 11336, 11345, 11352, 11364, 11387, 11392, 11396, 11399, 11435, 11437, 11459, 11462, 11519, 11521, 11523, 11530, 11532, 11534, 11536, 11542, 11544, 11547, 11549, 11552, 11554, 11556, 11558, 11563, 11567, 11569, 11575, 11577, 11579, 11583, 11587, 11589, 11592, 11596, 11603, 11605, 11608, 11610, 11613, 11615, 11617, 11619, 11625, 11629, 11631, 11634, 11636, 11723, 11734, 11738, 11770, 11774, 11776, 11778, 11782, 11784, 11786, 11789, 11791, 11793, 11795, 11800, 11803, 11821, 11823, 11828, 11831, 11853, 11860, 11865, 11867, 11912, 11915, 11917, 11919, 11923, 11928, 11942, 11944, 11946, 11951, 11960, 11975, 11979, 11981, 11984, 11987, 12009, 12037, 12039, 12041, 12063, 12066, 12071, 12080, 12092, 12112, 12114, 12116, 12118, 12124, 12127, 12128, 12131, 12135, 12138, 12144, 12149, 12167, 12174, 12176, 12178, 12180, 12186, 12188, 12192, 12195, 12196, 12201, 12205, 12210, 12211, 12337, 12338, 12342, 12348, 12419, 12447, 12449, 12451, 12453, 12455, 12564, 12576, 12624, 12632, 12649, 12653, 12662, 12673, 12675, 12697, 12710, 12711, 12712, 12715, 12716, 12718, 12722, 12723, 12724, 12725, 12726, 12727, 12728, 12729, 12730, 12731, 12732, 12733, 12734, 12735, 12736, 12738, 12739, 12740, 12741, 12742, 12743, 12744, 12745, 12746, 12747, 12748, 12749, 12750, 12751, 12752, 12753, 12754, 12763, 12776, 12779, 12781, 12788, 12790, 12792, 12797, 12798, 12800, 12803, 12804, 12805, 12807, 12808, 12811, 12812, 12814, 12817, 12818, 12820, 12821, 12822, 12823, 12825, 12829, 12832, 12833, 12834, 12835, 12836, 12838, 12839, 12840, 12847, 12849, 12850, 12852, 12853, 12854, 12855, 12857, 12928, 12930, 12931, 12933, 12934, 12935, 12936, 12937, 12938, 12939, 12940, 12941, 12942, 12943, 12944, 12946, 12947, 12948, 12949, 12950, 12952, 12953, 12954, 12955, 12956, 12957, 12958, 12959, 12960, 12961, 12962, 12963, 12982, 12983, 13001, 13020, 13025, 13070, 13128, 13138, 13184, 13190, 13211, 13278, 13279, 13280, 13281, 13282, 13283, 13284, 13316, 13328, 13329, 13330, 13331, 13332, 13333, 13334, 13335, 13336, 13337, 13340, 13341, 13342, 13343, 13344, 13433, 13523, 13612, 13614, 13616, 13618, 13623, 13636, 13650, 13679, 13703, 13707, 13709, 13711, 13713, 13715, 13717, 13719, 13722, 13725, 13727, 13729, 13731, 13733, 13735, 13737, 13739, 13741, 13745, 13747, 13749, 13753, 13755, 13759, 13769, 13773, 13775, 13777, 13782, 13784, 13786, 13806, 13808, 13811, 13816, 13865, 13966, 13973, 13975, 13977, 13982, 13984, 13988, 13990, 13992, 14056, 14058, 14064, 14066, 14070, 14072, 14075, 14117, 14126, 14162, 14165, 14168, 14171, 14183, 14188, 14189, 14190, 14191, 14192, 14193, 14228, 14229, 14237, 14239, 14250, 14252, 14254, 14256, 14258, 14263, 14266, 14268, 14270, 14277, 14293, 14299, 14300, 14304, 14306, 14308, 14328, 14330, 14347, 14356, 14365, 14367, 14369, 14377, 14379, 14381, 14386, 14392, 14405, 14418, 14424, 14429, 14432, 14435, 14445, 14461, 14520, 14543, 14545, 14549, 14553, 14575, 14580, 14582, 14588, 14633, 14669, 14686, 14723, 14746, 14748, 14750, 14806, 14809, 14916, 14921, 15195, 15219, 15221, 15223, 15234, 15401, 15403, 15478, 15479, 15481, 15500, 15513, 15705, 15747, 15773, 15778, 15786, 15787, 16546, 16549, 16550, 16551, 16552, 16553, 16554, 16555, 16556, 16561, 16562, 16564, 16571, 16581, 16584, 16585, 16587, 16591, 16592, 16594, 16595, 16596, 16597, 16600, 16601, 16602, 16603, 16604, 16613, 16614, 16619, 16620, 16649, 16650, 16651, 16653, 16654, 16655, 16656, 16657, 16658, 16659, 16660, 16661, 16662, 16663, 16996, 17231, 17232, 17233, 17234, 17235, 17236, 17237, 17238, 17239, 17254, 17255, 17256, 17257, 17460, 17759, 18008, 18009, 18010, 18017, 18018, 18019, 18020, 18021, 18022, 18023, 18024, 18025, 18026, 18027, 18028, 18029, 18030, 18031, 18032, 18033, 18034, 18035, 18036, 18037, 18038, 18039, 18040, 18041, 18042, 18043, 18044, 18045, 18046, 18047, 18048, 18049, 18050, 18051, 18052, 18053, 18054, 18055, 18056, 18057, 18058, 18059, 18060, 18061, 18068, 18072, 18073, 18074, 18075, 18076, 18077, 18079, 18080, 18081, 18087, 18088, 18089, 18090, 18091, 18092, 18093, 18094, 18095, 18096, 18112, 18113, 18114, 18174, 18285, 18499, 18589, 18606, 18607, 18639, 18641, 18647, 18656, 18832, 18839, 18841, 18843, 18859, 18911, 20329, 20330, 20331, 20363, 20366, 20372, 20374, 20376, 20401, 20444, 20453, 20466, 20474, 20475, 20476, 20477, 20497, 20511, 20577, 20653, 20724, 20751, 20820, 20847, 20863, 20865, 20869, 20893, 20894, 20895, 20896, 20897, 20898, 20899, 20900, 20901, 20902, 20903, 20904, 20905, 20906, 20935, 20937, 20941, 20943, 20946, 20948, 20950, 20954, 21551, 21552, 21602, 21603, 21604, 21605, 21941, 21942, 21943, 21944, 21945, 21946, 21947, 21948, 21949, 21950, 21951, 21952, 21953, 21954, 21955, 21956, 21957, 21958, 21959, 21960, 21961, 21962, 21963, 21964, 21965, 21966, 21967, 21968, 21969, 21970, 21971, 21972, 21973, 21974, 21975, 21976, 21977, 21978, 21979, 21980, 21981, 21982, 21983, 21984, 21985, 21986, 21987, 21988, 21989, 22417, 22418, 22419, 22420, 22421, 22422, 22423, 22424, 22425, 22426, 22427, 22428, 23205, 23206, 23207, 23208, 23209, 23210, 23211, 23212, 23213, 23214, 23273, 23274, 23275, 23276, 23277, 23278, 23279, 23280, 23281, 23282, 23283, 23284, 23285, 23286, 23287, 23288, 23289, 23290, 23291, 23292, 23293, 23294, 23295, 23296, 23297, 23298, 23299, 23300, 23301, 23302, 23303, 23304, 23305, 23306, 23307, 23308, 23309, 23310, 23311, 23312, 23313, 23314, 23315, 23316, 23317, 23318, 23319, 23320, 23321, 23322, 24613, 24614, 24615, 24616, 24617, 24618, 24619, 24620, 24621, 24622, 24623, 24624, 24625, 24626, 24627, 24628, 24629, 24630, 24631, 24632, 24633, 24967, 24968, 24969, 24970, 24971, 24972, 24973, 24974, 24975, 24976, 24977, 24978, 24979, 24980, 24981, 24982, 24983, 24984, 24985, 24986, 24987, 24988, 24989, 24990, 24991, 24992, 24993, 24994, 24995, 24996, 24997, 24998, 24999, 25000, 25001, 25002, 25003, 25030, 25031, 25032, 25566, 25597, 25622, 25627, 25628, 25629, 25697, 25738, 25758, 25794, 25795, 25796, 25797, 25798, 25799, 25800, 25801, 25802, 25803, 25804, 25816, 26098, 26099, 26100, 26101, 26102, 26230, 26232, 26245, 26248, 26254, 26258, 26513, 26708, 26719, 26746, 26748, 26751, 26766, 26775, 26809, 26811, 26818, 26855, 26857, 26859, 26861, 26864, 26868, 26872, 26892, 26897, 26909, 26971, 26989, 26992, 26997, 27010, 27019, 27043, 27070, 27081, 27088, 27096, 27125, 27146, 27151, 27153, 27155, 27157, 27159, 27161, 27163, 27165, 27171, 27173, 27175, 27180, 27182, 27184, 27186, 27188, 27190, 27192, 27194, 27196, 27198, 27200, 27202, 27204, 27206, 27208, 27211, 27213, 27215, 27217, 27219, 27225, 27227, 27229, 27232, 27252, 27259, 27262, 27264, 27267, 27277, 27280, 27292, 27296, 27367, 27382, 27384, 27392, 27394, 27396, 27398, 27400, 27402, 27404, 27406, 27408, 27410, 27412, 27414, 27418, 27420, 27443, 27445, 27448, 27453, 27455, 27470, 27472, 27474, 27476, 27478, 27480, 27482, 27484, 27486, 27488, 27490, 27501, 27504, 27506, 27508, 27510, 27512, 27517, 27519, 27557, 27560, 27569, 27571, 27574, 27581, 27583, 27585, 27595, 27597, 27599, 27601, 27603, 27605, 27607, 27609, 27612, 27614, 27615, 28042, 28107, 28128, 28205, 28251, 28264, 28269, 28276, 28278, 28280, 28290, 28293, 28320, 28333, 28423, 28439, 28441, 28444, 28455, 28457, 28459, 28461, 28474, 28478, 28602, 28634, 28636, 28638, 28640, 28642, 28644, 28647, 28649, 28651, 28653, 28655, 28657, 28663, 28674, 28676, 28678, 28680, 28682, 28685, 28687, 28689, 28691, 28693, 28732, 28734, 28736, 28738, 28740, 28742, 28744, 29189, 29208, 29209, 29212, 29213, 29214, 29215, 29216, 29262, 29265, 29270, 29357, 29359, 29364, 29548, 29560, 29567, 29645, 29662, 29715, 29717, 29783, 29785, 30040, 30049, 30051, 30059, 30062, 30085, 30089, 30092, 30094, 30096, 30102, 30119, 30142, 30216, 30218, 30220, 30222, 30406, 30414, 30416, 30426, 30428, 30764, 30891, 30960, 31049, 31058, 31060, 31064, 31066, 31070, 31072, 31074, 31081, 31083, 31087, 31092, 31095, 31097, 31134, 31137, 31140, 31303, 31312, 31315, 31320, 31327, 31332, 31942, 31961, 31991, 31994, 31996, 31998, 32002, 32004, 32006, 32026, 32034, 32036, 32038, 32040, 32042, 32044, 32047, 32049, 32057, 32059, 32062, 32064, 32072, 32083, 32098, 32110, 32130, 32288, 32296, 32300, 32310, 32312, 32319, 32322, 32324, 32327, 32330, 32333, 32335, 32341, 32345, 32348, 32371, 32449, 32451, 32453, 32458, 32473, 32491, 32496, 32611, 32623, 32631, 32633, 32642, 32713, 32715, 32722, 32726, 32728, 32730, 32732, 32734, 32736, 32739, 32766, 32768, 32771, 32782, 32786, 32789, 32791, 32793, 32795, 32797, 32799, 32801, 32803, 32805, 32807, 32812, 32814, 32827, 32829, 32831, 32836, 32867, 32869, 32871, 32883, 33225, 33230, 33235, 33243, 33245, 33247, 33249, 33252, 33255, 33269, 33271, 33273, 33276, 33313, 33317, 33319, 33321, 33334, 33363, 33365, 33367, 33373, 33386, 33416, 33460, 33464, 33480, 33487, 33489, 33497, 33499, 33501, 33542, 33544, 33555, 33556, 33559, 33732, 33867, 33869, 33873, 33877, 33879, 33895, 33903, 33911, 34024, 34040, 34050, 34052, 34056, 34077, 34085, 34090, 34092, 34115, 34142, 34150, 34152, 34158, 34160, 34161, 34162, 34163, 34164, 34166, 34171, 34172, 34173, 34174, 34175, 34227, 34230, 34236, 34249, 34255, 34260, 34271, 34276, 34286, 34828, 34833, 34839, 34845, 34857, 34865, 34921, 34933, 34938, 34975, 34978, 34980, 35310, 35313, 35321, 35322, 35326, 35328, 35330, 35332, 35335, 35337, 35339, 35360, 35364, 35377, 35409, 35591, 35594, 35598, 35601, 35603, 35605, 35607, 35609, 35611, 35613, 35615, 35617, 35619, 35623, 35625, 35628, 35630, 35635, 35638, 35641, 35644, 35646, 35649, 35654, 35656, 35658, 35660, 35662, 35664, 35666, 35668, 35671, 35673, 35675, 35677, 35679, 35681, 35684, 35686, 35688, 35690, 35692, 35697, 35700, 35704, 35708, 35710, 35712, 35714, 35716, 35718, 35720, 35723, 35725, 35727, 35730, 35732, 35734, 35736, 35741, 35745, 35747, 35750, 35800, 39972, 39974, 39987, 40676, 40678, 40681, 40683, 40685, 40687, 40761, 40763, 40765, 40767, 40795, 40799, 40801, 40803, 40805, 40808, 40812, 40815, 40817, 42096, 42447, 42448, 42451, 42456, 42488, 42490, 42493, 42499, 42501, 42503, 42505, 42509, 42512, 42514, 42518, 42541, 42550, 42552, 42555, 42558, 42560, 42565, 42647, 42678, 42984, 43176, 43181, 43183, 43194, 44664, 44685, 44686, 44687, 44688, 44689, 44690, 44691, 44692, 44693, 44694, 44695, 44696, 44697, 44698, 44699, 44700, 44701, 44702, 44703, 44704, 44736, 44744, 44768, 44770, 44772, 44774, 44779, 44781, 44788, 44796, 44803, 44847, 44852, 44854, 44860, 44865, 44870, 44877, 44879, 44881, 44925, 45296, 45298, 45300, 45302, 45304, 45307, 45321, 45323, 45329, 45331, 45509, 45511, 45513, 45515, 45563, 45566, 45568, 45571, 45573, 45584, 45586, 45591, 45593, 45595, 45597, 45600, 45602, 45605, 45609, 45611, 45614, 45617, 45619, 45622, 45854, 45864, 45869, 45876, 45935, 45937, 45955, 45972, 45974, 45976, 45978, 45983, 45985, 45998, 46000, 46002, 46004, 46006, 46010, 46012, 46014, 46016, 46018, 46020, 46022, 46024, 46026, 46028, 46030, 46032, 46034, 46036, 46038, 46045, 46051, 46056, 46058, 46061, 46063, 46069, 46071, 46073, 46075, 46078, 46080, 46084, 46086, 46111, 46124, 46137, 46177, 47190, 47713, 47714, 47715, 47716, 47717, 47718, 47719, 47720, 47721, 47722, 47723, 47724, 47725, 47726, 47727, 47728, 47729, 47730, 47731, 47732, 47733, 47734, 47735, 47736, 47737, 47738, 47739, 47740, 47741, 47742, 47743, 47744, 47745, 47746, 47747, 47748, 47749, 47750, 47751, 47752, 47753, 47754, 47755, 47756, 47757, 47758, 47759, 47760, 47761, 47762, 47763, 47764, 47765, 47766, 47767, 47768, 47769, 47770, 47771, 47772, 47773, 47774, 47775, 47776, 47777, 47778, 47779, 47780, 47781, 47782, 47783, 47784, 47785, 47786, 47787, 47788, 47789, 47790, 47791, 47792, 47793, 47794, 48019, 48141, 48142, 48195, 48196, 48197, 48198, 48199, 48200, 48201, 48202, 48203, 48204, 48205, 48206, 48207, 48208, 48209, 48210, 48211, 48212, 48213, 48214, 48215, 48216, 48217, 48218, 48219, 48220, 48221, 48222, 48223, 48224, 48225, 48226, 48227, 48228, 48229, 48439, 48491, 48496, 48504, 48507, 48516, 48536, 48559, 48599, 48607, 48609, 48611, 48613, 48615, 48622, 48700, 48702, 48706, 48739, 48741, 48744, 48792, 48799, 48801, 48803, 48805, 48809, 48820, 48822, 48825, 48830, 48835, 48837, 48983, 48984, 48986, 48987, 48988, 48989, 48990, 48991, 48992, 48994, 49209, 49211, 49213, 49215, 49272, 49273, 49274, 49275, 49276, 49277, 49278, 49279, 49280, 49281, 49282, 49283, 49284, 49353, 49354, 49355, 49356, 49357, 49358, 49359, 49360, 49361, 49362, 49363, 49364, 49365, 49366, 49367, 49368, 49369, 49370, 49371, 49501, 49502, 49503, 49504, 49505, 49506, 49507, 49508, 49509, 49510, 49511, 49512, 49513, 49514, 49515, 49516, 49517, 49518, 49519, 49520, 49839, 49853, 49854, 49855, 49856, 49857, 49858, 49859, 49860, 49861, 49863, 49864, 49865, 49866, 49867, 49868, 49869, 49870, 49871, 49872, 49873, 49874, 49875, 49876, 49877, 49878, 49879, 49880, 49881, 49882, 49883, 49884, 49885, 49886, 49887, 49888, 49890, 49891, 49892, 49893, 49894, 49895, 49896, 49897, 49898, 49899, 49917, 49918, 49920, 49921, 49922, 49923, 49924, 49925, 49926, 49927, 49928, 49929, 49930, 49931, 49932, 49933, 49934, 49935, 49936, 49937, 49938, 49939, 49940, 49941, 49963, 49964, 49965, 49966, 49968, 50426, 50427, 50428, 50429, 50430, 50431, 50432, 50433, 50434, 52329, 52524, 52525, 52528, 52529, 52530, 52531, 52532, 52533, 52534, 52535, 52536, 52537, 52538, 52539, 52540, 52543, 52544, 52545, 52546, 52547, 52548, 52549, 52550, 52551, 52552, 52553, 52554, 52555, 52556, 52557, 52558, 52559, 52561, 52562, 52563, 52564, 52565, 52566, 52567, 52568, 52569, 52570, 52571, 52572, 52573, 52574, 52575, 52576, 52577, 52578, 52579, 55259, 55260, 55261, 55262, 55263, 55264, 55265, 55266, 55267, 55268, 55269, 55270, 55271, 55272, 55273, 55274, 55275, 55276, 55277, 55278, 55279, 55280, 55281, 55282, 55283, 55284, 55285, 55286, 55287, 55288, 55289, 55290, 55291, 55292, 55293, 55294, 55295, 55296, 55297, 55298, 55299, 55300, 55301, 55302, 55303, 55304, 55305, 55306, 55307, 55308, 55309, 55310, 55311, 55312, 55313, 55314, 55315, 55316, 55317, 55318, 55319, 55320, 55321, 55322, 55323, 55324, 55325, 55326, 55327, 55328, 55330, 55331, 55332, 55333, 55334, 55335, 55336, 55337, 55338, 55339, 55340, 55341, 55342, 55344, 55346, 55347, 55349, 55350, 55351, 55352, 55353, 55354, 55355, 55356, 55357, 55358, 55359, 55360, 55361, 55362, 55363, 55364, 55365, 55366, 55367, 55368, 55369, 55370, 55371, 55372, 55373, 55374, 55375, 55377, 55378, 55379, 55380, 55381, 55382, 55383, 55384, 55385, 55386, 55387, 55388, 55389, 55390, 55392, 55393, 55394, 55395, 55396, 55397, 55398, 55399, 55400, 55401, 55402, 55403, 55404, 55405, 55407, 55715, 55716, 55717, 55718, 55719, 55720, 55721, 55722, 55723, 55724, 55725, 55726, 55727, 55728, 55729, 55730, 55731, 55732, 55733, 55735, 55736, 55737, 55738, 55739, 55740, 55741, 55742, 55743, 55744, 55745, 55746, 55747, 55748, 55749, 55750, 55751, 55752, 55753, 55754, 55755, 55756, 55757, 55758, 55759, 55760, 55761, 55762, 55763, 55764, 55765, 55766, 55767, 55768, 55769, 55770, 55771, 55772, 55773, 55774, 55775, 55776, 55777, 55778, 55779, 55780, 55781, 55782, 55783, 55784, 55785, 55786, 55787, 55788, 55789, 55790, 55791, 55792, 55793, 55794, 55795, 55796, 55797, 55798, 55799, 55800, 55801, 55802, 55803, 55804, 55805, 55806, 55807, 55808, 55809, 55810, 55811, 55812, 55813, 55814, 55815, 55816, 55817, 55818, 55819, 55820, 55821, 55822, 55823, 55824, 55825, 55826, 55827, 55828, 55829, 55830, 55831, 55832, 55833, 55834, 55835, 55836, 55837, 55838, 55839, 55840, 55841, 55842, 55843, 55844, 55845, 55846, 55847, 55848, 55849, 55850, 55852, 55853, 55854, 55855, 55856, 55857, 55858, 55859, 55860, 55861, 55863, 55864, 55865, 55866, 55867, 55868, 55869, 55870, 55871, 55872, 55873, 55874, 55875, 55876, 55877, 55878, 55879, 55880, 55881, 55882, 55883, 55884, 55885, 55886, 55887, 55888, 55889, 55890, 55891, 55892, 55893, 55894, 55895, 55896, 55897, 55898, 55899, 55900, 55901, 55902, 55903, 55904, 55905, 55906, 55907, 55908, 55909, 55910, 55911, 55912, 55913, 56288, 56289, 56290, 56291, 56292, 56293, 56294, 56817, 57545, 57546, 57547, 57548, 57549, 57550, 57551, 57552, 57553, 57554, 57555, 57556, 57557, 57558, 57559, 57560, 57561, 57562, 57563, 57758, 57759, 57760, 57761, 57762, 57763, 57764, 57765, 57766, 57767, 58007, 58008, 58009, 58834, 58836, 58838, 58839, 58840, 58844, 58846, 58847, 58848, 58849, 58850, 58851, 58852, 58853, 58854, 58857, 58858, 58859, 58860, 58861, 58862, 58863, 58864, 58865, 58866, 58867, 58868, 58869, 58870, 58871, 58872, 58873, 58877, 58878, 58879, 58880, 58881, 58882, 58883, 58884, 58885, 58886, 58888, 58889, 58890, 58891, 58892, 58893, 59359, 59360, 59361, 59362, 59363, 59364, 59365, 59366, 59367, 59368, 59369, 59370, 59371, 59372, 59373, 59374, 59375, 59376, 59377, 59378, 59379, 59380, 59381, 59382, 59383, 59384, 59393, 59395, 59400, 59405, 59410, 59411, 60208, 60209, 60210, 60211, 60212, 60213, 60215, 60216, 60217, 60218, 60219, 60220, 60221, 60222, 60223, 60224, 60225, 60228, 60229, 60230, 60231, 60232, 60233, 60234, 60235, 60236, 60360, 60361, 60362, 60363, 60364, 60365, 60366, 60367, 60368, 60369, 60370, 60371, 60372, 60373, 60374, 60375, 60376, 60377, 60378, 60379, 60380, 60381, 60382, 60383, 60384, 60385, 60386, 60387, 60388, 60389, 60390, 60674, 60675, 60710, 60802, 60803, 60805, 60806, 60807, 60809, 60814, 60817, 61025, 61387, 61389, 61390, 61391, 61392, 61394, 61397, 61398, 61406, 61410, 61473, 61557, 61558, 61560, 61561, 61562, 61563, 61564, 61565, 61566, 61567, 61568, 61569, 61570, 61571, 61572, 61573, 61574, 61575, 61576, 61577, 61578, 61579, 61580, 61581, 61582, 61583, 61704, 61705, 61706, 61707, 61708, 61709, 61710, 61711, 61712, 61713, 61714, 61715, 61716, 61717, 61718, 61719, 61720, 61721, 61722, 61723, 61724, 61725, 61726, 61727, 61728, 62031, 62033, 62050, 62051, 62052, 62053, 62054, 62055, 62056, 62057, 62058, 62059, 62060, 62061, 62062, 62064, 62065, 62066, 62067, 62068, 62705, 62707, 62708, 62709, 62710, 62711, 62712, 62713, 62714, 62715, 62716, 62717, 62718, 62719, 62720, 62721, 62722, 62723, 62724, 62725, 62726, 62727, 62728, 62729, 62730, 62731, 62732, 62820, 62890, 62891, 62892, 62893, 62894, 62895, 65167, 65872, 65873, 65874, 65875, 65876, 65877, 65878, 65879, 65880, 65903, 65904, 66256, 66257, 66433, 66434, 66636, 66680, 67225, 67226, 67227, 67228, 67229, 67230, 67231, 67232, 67233, 67234, 67235, 67236, 67237, 67238, 67239, 67282, 67283, 67284, 67285, 67286, 67287, 67288, 67289, 67622, 67623, 67624, 67625, 67627, 67629, 67630, 67631, 67633, 67634, 67648, 67738, 67739, 67740, 67741, 67742, 67743, 67744, 67761, 76733, 76735, 76737, 76739, 76741, 76743, 76745, 76747, 76749, 76751, 76753, 76755, 76757, 76759, 76761, 76763, 76765, 76767, 76769, 76771, 76774, 76776, 76778, 76780, 76782, 76784, 76786, 76788, 76789, 76792, 76793, 76796, 76798, 76800, 76802, 81187, 85992, 85993, 85994, 85995, 85996, 85997, 86155, 86156, 86157, 86158, 87011, 87155, 87156, 150128, 150196, 150200, 150204, 150209, 150212, 150214, 150217, 150218, 150223, 150227, 150230, 150233, 150237, 150245, 150249, 150253, 150258, 150263, 150269, 150277, 150285, 150289, 150296, 150298, 150300, 150711, 164473, 164519, 164534, 164584, 164615, 164638, 164723, 164735, 164775, 164854, 164904, 164984, 165047, 165055, 165071, 165115, 165146, 165180, 165205, 165209, 165222, 165233, 165259, 165358, 165359, 165509, 165583);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (28602, 52329, 52524, 52525, 52528, 52529, 52530, 52531, 52532, 52533, 52534, 52535, 52536, 52537, 52538, 52539, 52540, 52543, 52544, 52545, 52546, 52547, 52548, 52549, 52550, 52551, 52552, 52553, 52554, 52555, 52556, 52557, 52558, 52559, 52561, 52562, 52563, 52564, 52565, 52566, 52567, 52568, 52569, 52570, 52571, 52572, 52573, 52574, 52575, 52576, 52577, 52578, 52579, 65167, 150711, 164473, 164519, 164534, 164584, 164615, 164638, 164723, 164735, 164775, 164854, 164904, 164984, 165047, 165055, 165071, 165115, 165146, 165180, 165205, 165209, 165222, 165233, 165259, 165358, 165359, 165509, 165583);
diff --git a/sql/updates/world/3.3.5/2016_11_01_04_world_335.sql b/sql/updates/world/3.3.5/2016_11_01_04_world_335.sql
new file mode 100644
index 00000000000..68c2840a74d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_01_04_world_335.sql
@@ -0,0 +1,92 @@
+--
+SET @Event:=51;
+SET @OGUID:=85097;
+SET @CGUID = 87999;
+
+DELETE FROM `gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+49;
+INSERT INTO `gameobject` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`position_x`,`position_y`,`position_z`,`orientation`,`rotation0`,`rotation1`,`rotation2`,`rotation3`,`spawntimesecs`,`animprogress`,`state`, `VerifiedBuild`) VALUES
+(@OGUID+0, 195063, 0, 1, 1, -9331.52, 182.493, 61.6, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+1, 195063, 0, 1, 1, -9323.89, 179.863, 64.6421, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+2, 182807, 0, 1, 1, -9326.85, 170.807, 62.8254, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+3, 182807, 0, 1, 1, -9335.46, 175.405, 61.6072, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+4, 195087, 0, 1, 1, -9333.99, 181.712, 61.5651, 4.14018, 0, 0, 0.87792, -0.478807, 300, 0, 1, 0),
+(@OGUID+5, 195067, 0, 1, 1, -9352.43, 172.927, 61.5748, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+6, 195067, 0, 1, 1, -9325.85, 176.738, 61.6842, 4.03415, 0, 0, 0.902059, -0.431613, 300, 0, 1, 0),
+(@OGUID+7, 195067, 0, 1, 1, -9339.4, 177.75, 61.5578, 2.84035, 0, 0, 0.988678, 0.150053, 300, 0, 1, 0),
+(@OGUID+8, 195067, 0, 1, 1, -9341.6, 186.007, 61.5588, 0.590182, 0, 0, 0.290827, 0.956776, 300, 0, 1, 0),
+(@OGUID+9, 195067, 0, 1, 1, -9349.4, 172.027, 61.5583, 3.72, 0, 0, 0.958472, -0.285187, 300, 0, 1, 0),
+(@OGUID+10, 195067, 0, 1, 1, -9333.49, 166.771, 61.5731, 4.50147, 0, 0, 0.777611, -0.628745, 300, 0, 1, 0),
+(@OGUID+11, 195063, 0, 1, 1, -9340.66, 187.524, 61.5517, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+12, 195063, 0, 1, 1, -9330.93, 172.332, 61.6442, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+13, 195307, 0, 1, 1, -9328.34, 171.941, 62.8343, 3.00195, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+14, 195307, 0, 1, 1, -9351.13, 177.262, 62.7149, -2.30383, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+15, 195068, 0, 1, 1, -9328.37, 170.188, 61.6268, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+16, 195068, 0, 1, 1, -9327.13, 181.863, 61.6551, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+17, 195090, 0, 1, 1, -9319.35, 175.184, 61.6322, 5.94267, 0, 0, 0.169436, -0.985541, 300, 0, 1, 0),
+(@OGUID+18, 195090, 0, 1, 1, -9321.89, 177.068, 61.6465, 5.64422, 0, 0, 0.314075, -0.949398, 300, 0, 1, 0),
+(@OGUID+19, 195090, 0, 1, 1, -9324.42, 178.952, 61.9249, 5.64422, 0, 0, 0.314075, -0.949398, 300, 0, 1, 0),
+(@OGUID+20, 195090, 0, 1, 1, -9327.35, 181.579, 61.6579, 5.76203, 0, 0, 0.257639, -0.966241, 300, 0, 1, 0),
+(@OGUID+21, 195090, 0, 1, 1, -9329.68, 183.137, 61.6151, 5.69527, 0, 0, 0.289742, -0.957105, 300, 0, 1, 0),
+(@OGUID+22, 195090, 0, 1, 1, -9332.5, 185.014, 61.5442, 5.69527, 0, 0, 0.289742, -0.957105, 300, 0, 1, 0),
+(@OGUID+23, 195090, 0, 1, 1, -9336.77, 184.723, 61.5328, 1.08891, 0, 0, 0.517952, 0.85541, 300, 0, 1, 0),
+(@OGUID+24, 195090, 0, 1, 1, -9340.96, 187.22, 61.5554, 0.865071, 0, 0, 0.419174, 0.907906, 300, 0, 1, 0),
+(@OGUID+25, 195090, 0, 1, 1, -9347.4, 178.086, 61.558, 4.29726, 0, 0, 0.837647, -0.546212, 300, 0, 1, 0),
+(@OGUID+26, 195090, 0, 1, 1, -9349.37, 175.371, 61.7816, 4.06557, 0, 0, 0.895168, -0.445729, 300, 0, 1, 0),
+(@OGUID+27, 195090, 0, 1, 1, -9351.22, 172.514, 61.5657, 4.2737, 0, 0, 0.844024, -0.536305, 300, 0, 1, 0),
+(@OGUID+28, 195090, 0, 1, 1, -9352.79, 169.484, 61.5833, 4.19909, 0, 0, 0.86344, -0.504452, 300, 0, 1, 0),
+(@OGUID+29, 195090, 0, 1, 1, -9328.38, 163.069, 62.1162, 5.656, 0, 0, 0.308476, -0.951232, 300, 0, 1, 0),
+(@OGUID+30, 195090, 0, 1, 1, -9324.64, 167.678, 61.5815, 2.66756, 0, 0, 0.972043, 0.234801, 300, 0, 1, 0),
+(@OGUID+31, 195090, 0, 1, 1, -9327.99, 170.234, 61.6257, 2.49478, 0, 0, 0.948158, 0.317799, 300, 0, 1, 0),
+(@OGUID+32, 195090, 0, 1, 1, -9330.76, 172.21, 61.6444, 2.42016, 0, 0, 0.935645, 0.352943, 300, 0, 1, 0),
+(@OGUID+33, 195090, 0, 1, 1, -9333.31, 174.06, 61.6475, 2.60866, 0, 0, 0.964707, 0.263324, 300, 0, 1, 0),
+(@OGUID+34, 195090, 0, 1, 1, -9335.44, 175.283, 61.6076, 2.62044, 0, 0, 0.966242, 0.257637, 300, 0, 1, 0),
+(@OGUID+35, 195090, 0, 1, 1, -9329.47, 179.114, 61.7075, 1.27741, 0, 0, 0.596156, 0.802868, 300, 0, 1, 0),
+(@OGUID+36, 195063, 0, 1, 1, -9334.96, 176.014, 63.3874, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+37, 195069, 0, 1, 1, -9330.98, 181.918, 62.7222, 2.54818, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+38, 195066, 0, 1, 1, -9328.34, 170.201, 61.6675, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+39, 195069, 0, 1, 1, -9331.48, 181.45, 62.7343, -0.890117, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+40, 195069, 0, 1, 1, -9332.01, 182.043, 62.6892, -0.157079, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+41, 195066, 0, 1, 1, -9327.13, 181.875, 61.6549, 0, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+42, 180885, 0, 1, 1, 1805.89, 217.134, 60.4, 1.51844, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+43, 180885, 1, 1, 1, 10050.3, 2118.06, 1329.64, 0.750491, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+44, 180885, 0, 1, 1, -5149.52, -854.931, 508.332, 0.750491, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+45, 180885, 0, 1, 1, -9331.44, 181.991, 61.63, 0.750491, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+46, 180885, 1, 1, 1, 1176.85, -4464.09, 21.3468, 0.750491, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+47, 180885, 1, 1, 1, -980.33, -71.8455, 19.5878, 0.750491, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+48, 180885, 530, 1, 1, 9411.2988, -6838.457, 16.25, 3.745755, 0, 0, 0, 1, 180, 100, 1, 0),
+(@OGUID+49, 180885, 571, 1, 1, 5848.6821, 767.841, 640.5, 1.223739, 0, 0, 0, 1, 180, 100, 1, 0);
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN @OGUID+0 AND @OGUID+49 AND `eventEntry`=@Event;
+INSERT INTO `game_event_gameobject` SELECT @Event, gameobject.guid FROM `gameobject` WHERE gameobject.guid BETWEEN @OGUID+0 AND @OGUID+49;
+
+DELETE FROM `creature` WHERE `id` IN (35249);
+DELETE FROM `creature` WHERE `guid` IN (145038, 144985);
+DELETE FROM `game_event_creature` WHERE `guid` IN(145038, 144985);
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN 144951 AND 145000;
+DELETE FROM `creature_addon` WHERE `guid` BETWEEN 144951 AND 145000;
+DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+13;
+INSERT INTO `creature` (`guid`, `id`, `map`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `MovementType`) VALUES
+(@CGUID+0, 34382, 0, 1, 1, -9327.6, 178.975, 61.6973, 4.10484, 600, 0, 0),
+(@CGUID+1, 35249, 0, 1, 1, -9346.44, 171.041, 61.5582, 2.74061, 300, 0, 0),
+(@CGUID+2, 35249, 0, 1, 1, -9340.16, 183.339, 61.5512, 0.349854, 300, 0, 0),
+(@CGUID+3, 34435, 0, 1, 1, -9354.72, 167.942, 61.665, 0.27367, 300, 0, 0),
+(@CGUID+4, 35249, 0, 1, 1, -9342.2, 187.984, 61.5586, 5.25467, 300, 0, 0),
+(@CGUID+5, 35249, 0, 1, 1, -9344.05, 175.877, 61.5584, 3.59669, 300, 0, 0),
+(@CGUID+6, 35249, 0, 1, 1, -9318.67, 173.348, 61.613, 2.83957, 300, 0, 0),
+(@CGUID+7, 35249, 0, 1, 1, -9329.31, 166.352, 61.5815, 1.76357, 300, 0, 0),
+(@CGUID+8, 35249, 0, 1, 1, -9322.06, 168.47, 61.6066, 2.40367, 300, 0, 0),
+(@CGUID+9, 35249, 0, 1, 1, -9349.19, 176.153, 61.726, 5.18634, 300, 0, 0),
+(@CGUID+10, 35249, 0, 1, 1, -9350.81, 171.018, 61.7532, 1.0198, 300, 0, 00),
+(@CGUID+11, 35249, 0, 1, 1, -9337.56, 188.283, 61.5117, 3.72314, 300, 0, 0),
+(@CGUID+12, 34383, 0, 1, 1, -9330.46, 180.936, 61.6792, 4.1716, 300, 0, 0),
+(@CGUID+13, 35249, 0, 1, 1, -9327.92, 185.507, 62.7096, 4.07265, 300, 0, 0);
+UPDATE `creature` SET `equipment_id`=1 WHERE `id` IN (34382, 34383);
+
+DELETE FROM `game_event_creature` WHERE `guid` BETWEEN @CGUID+0 AND @CGUID+13 AND `eventEntry`=@Event;
+INSERT INTO game_event_creature SELECT @Event, creature.guid FROM `creature` WHERE creature.guid BETWEEN @CGUID+0 AND @CGUID+13;
+
+DELETE FROM `game_event_gameobject` WHERE `guid` BETWEEN 76237 AND 76550 AND eventEntry=51;
+-- select * FROM `game_event_gameobject` WHERE `guid` IN (SELECT `guid` FROM `game_event_gameobject` WHERE `guid` IN (SELECT `guid` FROM `gameobject` WHERE `id` IN (195199, 195198, 195164, 195212, 195303, 195200, 195196, 179968, 195195, 195192, 195215, 195194, 195197, 195191))) AND `eventEntry`=51;
+DELETE FROM `gameobject` WHERE `guid` IN (78695, 78713, 78756, 78582, 78693, 78479, 78690, 78711, 78691, 78694, 78478, 78692, 78696, 78635, 78703, 78592, 78583, 78697, 78669, 78670, 78712, 78710, 78702, 78584, 78715, 78757, 78594, 78593, 78585, 78597, 78595, 78596, 78668, 78698, 78700, 78701, 78714, 78755, 78709, 78704, 78480, 78699);
+DELETE FROM `gameobject_addon` WHERE `guid` IN (78695, 78713, 78756, 78582, 78693, 78479, 78690, 78711, 78691, 78694, 78478, 78692, 78696, 78635, 78703, 78592, 78583, 78697, 78669, 78670, 78712, 78710, 78702, 78584, 78715, 78757, 78594, 78593, 78585, 78597, 78595, 78596, 78668, 78698, 78700, 78701, 78714, 78755, 78709, 78704, 78480, 78699);
+DELETE FROM `game_event_gameobject` WHERE `guid` IN (78695, 78713, 78756, 78582, 78693, 78479, 78690, 78711, 78691, 78694, 78478, 78692, 78696, 78635, 78703, 78592, 78583, 78697, 78669, 78670, 78712, 78710, 78702, 78584, 78715, 78757, 78594, 78593, 78585, 78597, 78595, 78596, 78668, 78698, 78700, 78701, 78714, 78755, 78709, 78704, 78480, 78699);
diff --git a/sql/updates/world/3.3.5/2016_11_02_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_02_00_world_335.sql
new file mode 100644
index 00000000000..86c433ef209
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_02_00_world_335.sql
@@ -0,0 +1,14 @@
+--
+DELETE FROM `creature` WHERE `id` IN (698, 756);
+UPDATE `creature_template` SET `AIName`='SmartAI' WHERE `entry` IN (669,784,699);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (669,784,699) AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
+(669, 0, 0, 0, 60, 0, 100, 0, 1000, 4000, 10000, 10000, 11, 3621, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Skullsplitter Hunter - On Update - Cast Skullsplitter Pet'),
+(669, 0, 1, 0, 0, 0, 100, 0, 4000, 6000, 8000, 10000, 11, 3148, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Skullsplitter Hunter - IC Update - Cast Head Crack'),
+(669, 0, 2, 0, 25, 0, 100, 0, 0, 0, 0, 0, 11, 3417, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Skullsplitter Hunter - On reset - Cast Thrash '),
+(784, 0, 0, 0, 60, 0, 100, 0, 1000, 4000, 10000, 10000, 11, 3621, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Skullsplitter Beastmaster - On Update - Cast Skullsplitter Pet'),
+(784, 0, 1, 0, 0, 0, 100, 0, 500, 1000, 1661, 2000, 11, 6660, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Skullsplinter Beastmaster - IC - Cast \'Shoot\''),
+(699,0, 0,0, 25, 0,100,0, 0, 0, 0, 0, 11, 3612, 0, 0,0,0,0,1,0,0,0,0,0,0,0,'Bloodscalp Beastmaster - On reset - Cast Bloodscalp Pet'),
+(699,0, 1,0, 0, 0,100,0, 500, 1000,2000,2000, 11, 6660, 64, 0,0,0,0,2,0,0,0,0,0,0,0,'Bloodscalp Beastmaster - IC - Cast \'Shoot\''),
+(699,0, 2,3, 2, 0,100,1, 1, 20, 0, 0, 11, 8599, 0, 0,0,0,0,1,0,0,0,0,0,0,0,'Bloodscalp Beastmaster - On 20% Health - Cast Enrage (No Repeat)'),
+(699,0, 3,0, 61, 0,100,0, 0, 0, 0, 0, 1, 0, 0, 0,0,0,0,1,0,0,0,0,0,0,0,'Bloodscalp Beastmaster - On 20% Health - Say Line 0 (No Repeat)');
diff --git a/sql/updates/world/3.3.5/2016_11_02_01_world.sql b/sql/updates/world/3.3.5/2016_11_02_01_world.sql
new file mode 100644
index 00000000000..d0d4b78c0c3
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_02_01_world.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (6066,18176) AND `source_type`= 0;
+UPDATE `creature_template` SET `AIName`="", `InhabitType`=`InhabitType`|8 WHERE `entry` IN (6066,18176);
+DELETE FROM `creature_template_addon` WHERE `entry`=6066;
+INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES (6066,'31982');
+UPDATE `creature_template_addon` SET `auras`='31982' WHERE `entry` IN (18176);
diff --git a/sql/updates/world/3.3.5/2016_11_02_02_world.sql b/sql/updates/world/3.3.5/2016_11_02_02_world.sql
new file mode 100644
index 00000000000..7002536a162
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_02_02_world.sql
@@ -0,0 +1,9 @@
+--
+DELETE FROM `gameobject_template` WHERE `entry` IN (4,129);
+INSERT INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `size`, `Data0`, `Data1`, `Data2`, `Data3`, `Data4`, `Data5`, `Data6`, `Data7`, `Data8`, `Data9`, `Data10`, `Data11`, `Data12`, `Data13`, `Data14`, `Data15`, `Data16`, `Data17`, `Data18`, `Data19`, `Data20`, `Data21`, `Data22`, `Data23`, `AIName`, `ScriptName`, `VerifiedBuild`) VALUES
+(4, 6, 0, "Bonfire Damage", "", "", "", 1, 0, 1, 3, 7902, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0),
+(129, 6, 0, "Naxx Teleporter trap", "", "", "", 1, 0, 1, 0, 64446, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "", "", 0);
+
+DELETE FROM `gameobject_template_addon` WHERE `entry` IN (4);
+INSERT INTO `gameobject_template_addon` (`entry`, `faction`, `flags`, `mingold`, `maxgold`) VALUES
+(4, 14, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_11_02_03_world_335.sql b/sql/updates/world/3.3.5/2016_11_02_03_world_335.sql
new file mode 100644
index 00000000000..35867518087
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_02_03_world_335.sql
@@ -0,0 +1,6 @@
+--
+DELETE FROM `spell_dbc` WHERE `id`=8378;
+INSERT INTO spell_dbc (Id, Dispel, Mechanic, Attributes, AttributesEx, AttributesEx2, AttributesEx3, AttributesEx4, AttributesEx5, AttributesEx6, AttributesEx7, Stances, StancesNot, Targets, CastingTimeIndex, AuraInterruptFlags, ProcFlags, ProcChance, ProcCharges, MaxLevel, BaseLevel, SpellLevel, DurationIndex, RangeIndex, StackAmount, EquippedItemClass, EquippedItemSubClassMask, EquippedItemInventoryTypeMask, Effect1, Effect2, Effect3, EffectDieSides1, EffectDieSides2, EffectDieSides3, EffectRealPointsPerLevel1, EffectRealPointsPerLevel2, EffectRealPointsPerLevel3, EffectBasePoints1, EffectBasePoints2, EffectBasePoints3, EffectMechanic1, EffectMechanic2, EffectMechanic3, EffectImplicitTargetA1, EffectImplicitTargetA2, EffectImplicitTargetA3, EffectImplicitTargetB1, EffectImplicitTargetB2, EffectImplicitTargetB3, EffectRadiusIndex1, EffectRadiusIndex2, EffectRadiusIndex3, EffectApplyAuraName1, EffectApplyAuraName2, EffectApplyAuraName3, EffectAmplitude1, EffectAmplitude2, EffectAmplitude3, EffectMultipleValue1, EffectMultipleValue2, EffectMultipleValue3, EffectItemType1, EffectItemType2, EffectItemType3, EffectMiscValue1, EffectMiscValue2, EffectMiscValue3, EffectMiscValueB1, EffectMiscValueB2, EffectMiscValueB3, EffectTriggerSpell1, EffectTriggerSpell2, EffectTriggerSpell3, EffectSpellClassMaskA1, EffectSpellClassMaskA2, EffectSpellClassMaskA3, EffectSpellClassMaskB1, EffectSpellClassMaskB2, EffectSpellClassMaskB3, EffectSpellClassMaskC1, EffectSpellClassMaskC2, EffectSpellClassMaskC3, MaxTargetLevel, SpellFamilyName, SpellFamilyFlags1, SpellFamilyFlags2, SpellFamilyFlags3, MaxAffectedTargets, DmgClass, PreventionType, DmgMultiplier1, DmgMultiplier2, DmgMultiplier3, AreaGroupId, SchoolMask, COMMENT) VALUES
+(8378, 0, 0, 464, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 29, 29, 21, 1, 0, -1, -1, 0, 6, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 23, 0, 0, 5000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8377, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, "Earthgrab Totem");
+
+UPDATE `creature_template_addon` SET `auras`='8378' WHERE `entry` IN (6066);
diff --git a/sql/updates/world/3.3.5/2016_11_03_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_03_00_world_335.sql
new file mode 100644
index 00000000000..7e8ca72633d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_03_00_world_335.sql
@@ -0,0 +1,4 @@
+-- Savage Combat
+DELETE FROM `spell_proc` WHERE `SpellId`=-51682;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(-51682, 0, 8, 0x00000000, 0x00080000, 0x00000000, 0, 0x4, 0x2, 0x0, 0x2, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_11_03_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_03_01_world_335.sql
new file mode 100644
index 00000000000..da07ba6f52c
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_03_01_world_335.sql
@@ -0,0 +1,12 @@
+-- Archmage Arugal, NPC entry 4275
+SET @Arugal := 4275;
+
+UPDATE `creature_template` SET `ScriptName` = 'boss_archmage_arugal' WHERE `entry`= @Arugal;
+
+UPDATE `creature_text` SET `comment`= 'Archmage Arugal - Fenrus the Devourer dies' WHERE `entry`= @Arugal AND `groupid`= 0;
+
+DELETE FROM `creature_text` WHERE `entry` = @Arugal AND `groupid` IN (1,2,3);
+INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`, `comment`) VALUES
+(@Arugal,1,0,'You, too, shall serve!', 14,0,100,0,0,0,6115,0,'Archmage Arugal - Aggro'),
+(@Arugal,2,0,'Release your rage!', 14,0,100,0,0,0,6535,0,'Archmage Arugal - Transforms player into a Worgen'),
+(@Arugal,3,0,'Another falls!', 14,0,100,0,0,0,6116,0,'Archmage Arugal - Killing a player');
diff --git a/sql/updates/world/3.3.5/2016_11_03_02_world_335.sql b/sql/updates/world/3.3.5/2016_11_03_02_world_335.sql
new file mode 100644
index 00000000000..0ce05e4dea4
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_03_02_world_335.sql
@@ -0,0 +1,4 @@
+-- Maelstrom Weapon
+DELETE FROM `spell_proc` WHERE `SpellId`=53817;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(53817, 0, 11, 0x000001C3, 0x00008000, 0x00000000, 0, 0x0, 0x1, 0x0, 0x8, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_11_03_03_world.sql b/sql/updates/world/3.3.5/2016_11_03_03_world.sql
new file mode 100644
index 00000000000..8a241142ce5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_03_03_world.sql
@@ -0,0 +1 @@
+UPDATE `spell_dbc` SET `Effect1`=28,`EffectMiscValueB1`=64 WHERE `Id`IN(12694,12949,14801,14802,16369,16370,16619,16630,16631,17408,19826,19827,19828,20172,20734,21110,21111,21112,21113,21114,21115,21116,21117,21287,22803,22821,23118,23119,23121,23209,23253,24081,24215,24250,24349,25151,25708,26140,26144,26145,26146,26147,26148,26149,26150,26151,26191,26216,26396,26477,26538,26539,26577,26617,26768,26837,27178,27643,27644,27690,27691,27692,27693,27884,27921,27932,27939,28008,28010,28175,28177,28179,28217,28227,28289,28290,28291,28421,28422,28423,28454,28561,28627,29141,29218,29329,29434,29508,29857,30076,30083,30236,30239,30240,30241,30630,30737,30785,30786,30792,30825,30826,30827,30828,30954,30955,30956,30957,30958,30959,30960,30961,30962,30963,30976,31010,31318,31321,31374,31391,31392,31393,31421,31528,31529,31530,31544,31545,31593,31995,32114,32151,32283,32360,32579,32632,33121,33229,33242,33362,33363,33364,33367,33495,33514,33515,33516,33517,33518,33519,33520,33567,33636,33677,33680,33681,33682,33683,33901,33927,34064,34125,34175,34810,34817,34818,34819,35127,35128,35130,35136,35142,35145,35146,35153,35256,35430,35687,35688,35737,35861,35862,35863,35864,35904,35905,35906,35937,36026,36036,36042,36043,36044,36045,36046,36047,36048,36049,36050,36112,36168,36180,36221,36229,36231,36232,36233,36234,36235,36236,36379,36521,36579,36584,36585,36595,36596,36597,36724,36818,36865,37177,37178,37394,37457,37545,37606,37735,37758,37766,37772,37773,37774,37911,37912,37914,37916,37923,37925,37926,37927,37928,37929,37931,37932,37947,37948,37949,38019,38111,38114,38118,38124,38137,38179,38180,38181,38188,38189,38190,38191,38198,38199,38200,38201,38242,38244,38247,38261,38266,38268,38270,38271,38278,38283,38286,38287,38288,38291,38402,38403,38489,38490,38492,38493,38512,38587,38651,38854,38865,38874,38888,38889,38890,39080,39081,39110,39111,39186,39191,39302,39305);
diff --git a/sql/updates/world/3.3.5/2016_11_04_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_04_00_world_335.sql
new file mode 100644
index 00000000000..3bea6eef633
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_04_00_world_335.sql
@@ -0,0 +1,7 @@
+-- Recklessness
+UPDATE `spell_proc` SET `SpellTypeMask`=0x1, `SpellPhaseMask`=0x2, `AttributesMask`=0x8 WHERE `SpellId`=1719;
+
+-- Sweeping Strikes
+DELETE FROM `spell_proc` WHERE `SpellId`=12328;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(12328, 0, 4, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_11_04_01_world.sql b/sql/updates/world/3.3.5/2016_11_04_01_world.sql
new file mode 100644
index 00000000000..6013ea85556
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_04_01_world.sql
@@ -0,0 +1,14 @@
+--
+DELETE FROM `creature` WHERE `guid` IN (1070, 1115, 1158,121595,1162);
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(1070, 31787, 571, 0, 0, 1, 1, 0, 0, 6016.53, 2052.48, 636.058, 5.23599, 300, 0, 0, 12175, 3893, 0, 0, 0, 0, 0),
+(1115, 31787, 571, 0, 0, 1, 1, 0, 0, 6110.05, 2330.27, 636.336, 0.575959, 300, 0, 0, 12175, 3893, 0, 0, 0, 0, 0),
+(1158, 31787, 571, 0, 0, 1, 1, 0, 0, 6121.4, 2309.11, 636.225, 0.575959, 300, 0, 0, 12175, 3893, 0, 0, 0, 0, 0),
+(121595, 31787, 571, 0, 0, 1, 1, 0, 0, 5952.47, 2197.624, 636.041, 5.23587, 300, 0, 0, 12175, 3893, 0, 0, 0, 0, 0),
+(1162, 31787, 571, 0, 0, 1, 1, 0, 0, 5990.604, 2116.24, 636.041, 1.876254, 300, 0, 0, 12175, 3893, 0, 0, 0, 0, 0);
+
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry` IN (31787);
+DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id`=31787);
+
+DELETE FROM `creature_template_addon` WHERE `entry` = 31787;
+INSERT INTO `creature_template_addon` (`entry`,`bytes1`,`bytes2`,`emote`) VALUES (31787,50331648,1,429);
diff --git a/sql/updates/world/3.3.5/2016_11_04_02_world.sql b/sql/updates/world/3.3.5/2016_11_04_02_world.sql
new file mode 100644
index 00000000000..8dd6cf4e1f1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_04_02_world.sql
@@ -0,0 +1,8 @@
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=29857, `action_param2`=2, `action_param3`=0, `comment`='Arcane Protector - In Combat - Cast Summon Astral Spark' WHERE `entryorguid`=16504 AND `source_type`=0 AND `id`=1 AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=34064, `action_param2`=2, `action_param3`=0, `comment`='Voidwraith - On Just Died - Cast Soul Split' WHERE `entryorguid`=18659 AND `source_type`=0 AND `id`=0 AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=36595, `action_param2`=2, `action_param3`=0, `comment`='Apex - Between 0-75% Health - Cast Summon Apex Crumbler (Phase 1) (No Repeat)' WHERE `entryorguid`=19940 AND `source_type`=0 AND `id`=1 AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=36596, `action_param2`=2, `action_param3`=0, `comment`='Apex - Between 0-50% Health - Cast Summon Apex Crumbler (Phase 1) (No Repeat)' WHERE `entryorguid`=19940 AND `source_type`=0 AND `id`=2 AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=36597, `action_param2`=2, `action_param3`=0, `comment`='Apex - Between 0-25% Health - Cast Summon Apex Crumbler (Phase 1) (No Repeat)' WHERE `entryorguid`=19940 AND `source_type`=0 AND `id`=3 AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=31995, `action_param2`=2, `action_param3`=0, `comment`='Shattered Rumbler - On Script - Cast Shattered Rumbler' WHERE `entryorguid`=1715700 AND `source_type`=9 AND `id`IN(0,1,2) AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=38854, `action_param2`=2, `action_param3`=0, `comment`='Cursed egg - Action list - Cast Hatch Arakkoa' WHERE `entryorguid`=18521100 AND `source_type`=9 AND `id`=0 AND `link`=0;
+UPDATE `smart_scripts` SET `action_type`=11, `action_param1`=38865, `action_param2`=2, `action_param3`=0, `comment`='Cursed egg - Action list - Cast Hatch Bad Arakkoa' WHERE `entryorguid`=18521101 AND `source_type`=9 AND `id`=0 AND `link`=0;
diff --git a/sql/updates/world/3.3.5/2016_11_07_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_07_00_world_335.sql
new file mode 100644
index 00000000000..26a8e003a93
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_07_00_world_335.sql
@@ -0,0 +1,3 @@
+DELETE FROM `disables` WHERE `sourceType`=0 AND `entry`=52212;
+INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES
+(0, 52212, 64, '', '', 'Disable LoS for Spell Death and Decay');
diff --git a/sql/updates/world/3.3.5/2016_11_08_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_08_00_world_335.sql
new file mode 100644
index 00000000000..50aece5916d
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_08_00_world_335.sql
@@ -0,0 +1,9 @@
+UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId` IN (
+-324, -- Lightning Shield
+-52127 -- Water Shield
+);
+
+-- Seal of Righteousness
+DELETE FROM `spell_proc` WHERE `SpellId` =21084;
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(21084, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0);
diff --git a/sql/updates/world/3.3.5/2016_11_08_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_08_01_world_335.sql
new file mode 100644
index 00000000000..ed1f09a4f2e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_08_01_world_335.sql
@@ -0,0 +1,4 @@
+DELETE FROM `spell_proc` WHERE `SpellId` IN (5118, 13159);
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(5118, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0), -- Aspect of the Cheetah
+(13159, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0); -- Aspect of the Pack
diff --git a/sql/updates/world/3.3.5/2016_11_09_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_09_00_world_335.sql
new file mode 100644
index 00000000000..dd7a82dfae2
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_09_00_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `SpellPhaseMask`=0 WHERE `SpellId` IN (5118, 13159);
diff --git a/sql/updates/world/3.3.5/2016_11_09_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_09_01_world_335.sql
new file mode 100644
index 00000000000..8e1ef6113de
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_09_01_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `SpellPhaseMask`=0x4 WHERE `SpellId` IN (49796, 51124);
diff --git a/sql/updates/world/3.3.5/2016_11_10_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_10_00_world_335.sql
new file mode 100644
index 00000000000..430bae95863
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_10_00_world_335.sql
@@ -0,0 +1,5 @@
+DELETE FROM `spell_proc` WHERE `SpellId` IN (-168, -7302, -30482);
+INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES
+(-168, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0x0, 0x2, 0, 0, 0, 0), -- Frost Armor
+(-7302, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0x0, 0x2, 0, 0, 0, 0), -- Ice Armor
+(-30482, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x0, 0x0, 0x2, 0, 0, 0, 0); -- Molten Armor
diff --git a/sql/updates/world/3.3.5/2016_11_10_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_10_01_world_335.sql
new file mode 100644
index 00000000000..b5fb32b9ceb
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_10_01_world_335.sql
@@ -0,0 +1,14 @@
+DELETE FROM `spell_custom_attr` WHERE `entry` IN (5729,6393,6394,6395,10423,10424,23790,25512,58586,58587,58588,58639);
+INSERT INTO `spell_custom_attr` (`entry`, `attributes`) VALUES
+(5729, 64),
+(6393, 64),
+(6394, 64),
+(6395, 64),
+(10423, 64),
+(10424, 64),
+(23790, 64),
+(25512, 64),
+(58586, 64),
+(58587, 64),
+(58588, 64),
+(58639, 64);
diff --git a/sql/updates/world/3.3.5/2016_11_12_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_12_00_world_335.sql
new file mode 100644
index 00000000000..865683c3c68
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_12_00_world_335.sql
@@ -0,0 +1,3 @@
+--
+UPDATE `gameobject` SET `spawntimesecs`= 180 WHERE `id`= 176088;
+UPDATE `gameobject` SET `spawntimesecs`= 150 WHERE `id`= 180659;
diff --git a/sql/updates/world/3.3.5/2016_11_12_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_12_01_world_335.sql
new file mode 100644
index 00000000000..bc920b5e16e
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_12_01_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x8 WHERE `SpellId` IN (12536,16246,16870);
diff --git a/sql/updates/world/3.3.5/2016_11_13_00_world.sql b/sql/updates/world/3.3.5/2016_11_13_00_world.sql
new file mode 100644
index 00000000000..7a19b8c13ce
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_13_00_world.sql
@@ -0,0 +1,664 @@
+-- Creature Entry''s
+SET @PIT_COMMANDER_ENTRY := 18945;
+SET @PIT_COMMANDER_GUID := 68001;
+SET @DARNASSIAN_ARCHER_ENTRY := 18965;
+SET @DARKSPEAR_AXE_THROWER_ENTRY := 18970;
+SET @STORMWIND_SOLDIER_ENTRY := 18948;
+SET @ORGRIMMAR_GRUNT_ENTRY := 18950;
+SET @ORGRIMMAR_SHAMAN_ENTRY := 18972;
+SET @JUSTINIUS_THE_HARBINGER_ENTRY := 18966;
+SET @MELGROMM_HIGHMOUNTAIN_ENTRY := 18969;
+SET @IRONFORGE_PALADIN_ENTRY := 18986;
+SET @UNDERCITY_MAGE_ENTRY := 18971;
+SET @STORMWIND_MAGE_ENTRY := 18949;
+SET @GNOMEREGAN_CONJUROR_ENTRY := 19007;
+SET @SILVERMOON_MAGISTER_ENTRY := 19006;
+SET @THRALLMAR_GRUNT_ENTRY := 16580;
+SET @THRALLMAR_MARKSMAN_ENTRY := 16582;
+SET @NETHERGARDE_INFANTRY_ENTRY := 16831;
+SET @STORMWIND_INFANTRY_ENTRY := 16864;
+SET @WRATH_MASTER_ENTRY := 19005;
+SET @INFERNAL_TARGET_HYJAL_ENTRY := 21075;
+SET @INFERNAL_RELAY_HELLFIRE_ENTRY := 19215;
+
+-- Pit Commander SAI
+UPDATE `creature_template` SET `AIName`="SmartAI", `mechanic_immune_mask`=650854271 WHERE `entry`=@PIT_COMMANDER_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@PIT_COMMANDER_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@PIT_COMMANDER_ENTRY,0,0,2,11,0,100,0,0,0,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On Respawn - Set Active"),
+(@PIT_COMMANDER_ENTRY,0,1,0,36,0,100,0,0,0,0,0,48,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On Corpse Removed - Set Active"),
+(@PIT_COMMANDER_ENTRY,0,2,3,61,0,100,0,0,0,0,0,22,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On Respawn - Set Event Phase 0"),
+(@PIT_COMMANDER_ENTRY,0,3,4,61,0,100,0,0,0,0,0,11,51347,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On Respawn - Cast Teleport Visual Only"),
+(@PIT_COMMANDER_ENTRY,0,4,0,61,0,100,0,0,0,0,0,67,1,4000,4000,0,0,100,1,0,0,0,0,0,0,0,"Pit Commander - On Respawn - Create Timed Event"),
+(@PIT_COMMANDER_ENTRY,0,5,0,59,0,100,0,1,0,0,0,53,0,@PIT_COMMANDER_ENTRY,0,0,0,2,1,0,0,0,0,0,0,0,"Pit Commander - On Timed Event - Start WP"),
+(@PIT_COMMANDER_ENTRY,0,6,7,40,0,100,0,43,0,0,0,22,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On WP Reached - Set Event Phase"),
+(@PIT_COMMANDER_ENTRY,0,7,0,61,0,100,0,0,0,0,0,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On WP Reached - Set Home pos"),
+(@PIT_COMMANDER_ENTRY,0,8,0,6,0,100,0,0,0,0,0,41,10000,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - On Death - Despawn"),
+(@PIT_COMMANDER_ENTRY,0,9,0,0,0,100,0,3000,7000,7000,11000,11,16044,0,0,0,0,0,2,0,0,0,0,0,0,0,"Pit Commander - In Combat - Cast Cleave"),
+(@PIT_COMMANDER_ENTRY,0,10,0,0,0,100,0,12000,19000,21000,31000,11,33627,0,0,0,0,0,5,0,0,0,0,0,0,0,"Pit Commander - In Combat - Cast Rain of Fire"),
+(@PIT_COMMANDER_ENTRY,0,11,0,1,1,100,0,6000,6000,60000,60000,11,33393,0,0,0,0,0,1,0,0,0,0,0,0,0,"Pit Commander - Out of Combat - Cast Summon Infernals"),
+(@PIT_COMMANDER_ENTRY,0,12,0,1,1,100,0,6000,6000,60000,60000,45,1,0,0,0,0,0,10,74081,21075,0,0,0,0,0,"Pit Commander - Out of Combat - Set Data"),
+(@PIT_COMMANDER_ENTRY,0,13,0,1,1,100,0,7000,7000,60000,60000,45,1,0,0,0,0,0,10,74082,21075,0,0,0,0,0,"Pit Commander - Out of Combat - Set Data");
+
+-- Waypoints
+DELETE FROM `waypoints` WHERE `entry`=@PIT_COMMANDER_ENTRY;
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(@PIT_COMMANDER_ENTRY, 1, -404.629, 1820.85, 73.209, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 2, -382.802, 1816.85, 74.3855, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 3, -359.458, 1815.56, 76.3872, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 4, -335.046, 1814.74, 78.3202, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 5, -315.229, 1821.68, 83.0968, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 6, -293.231, 1829.2, 87.2354, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 7, -275.158, 1833.68, 89.3406, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 8, -258.02, 1837.22, 92.2399, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 9, -246.41, 1838.59, 93.0124, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 10, -240.571, 1837.9, 92.4368, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 11, -236.971, 1839.41, 89.9613, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 12, -224.306, 1833.44, 88.3981, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 13, -220.364, 1826.26, 87.3495, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 14, -216.424, 1810.36, 84.5744, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 15, -211.085, 1788.83, 78.924, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 16, -206.033, 1768.44, 73.1322, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 17, -203.105, 1741.79, 65.4756, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 18, -202.015, 1718.44, 58.8484, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 19, -200.981, 1696.27, 52.4718, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 20, -199.729, 1669.42, 46.1631, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 21, -199.282, 1646.05, 41.2679, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 22, -200.769, 1619.28, 36.301, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 23, -204.386, 1598.59, 32.4132, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 24, -210.568, 1577.36, 29.1862, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 25, -217.415, 1553.83, 26.4816, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 26, -223.967, 1530.23, 24.0484, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 27, -229.802, 1505.21, 21.1095, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 28, -234.836, 1481.24, 17.8893, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 29, -239.664, 1458.43, 15.1325, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 30, -245.217, 1432.2, 14.0314, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 31, -250.046, 1409.4, 12.3827, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 32, -251.786, 1388.47, 11.215, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 33, -250.26, 1364.02, 10.9601, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 34, -248.735, 1339.58, 13.2148, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 35, -247.056, 1317.58, 16.6388, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 36, -244.276, 1302.65, 19.114, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 37, -240.016, 1279.77, 23.1148, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 38, -239.095, 1260.01, 26.6083, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 39, -239.616, 1241.4, 29.732, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 40, -241.521, 1220.49, 33.8372, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 41, -242.736, 1206.55, 39.2003, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 42, -244.53, 1197.24, 42.3959, 'Pit Commander'),
+(@PIT_COMMANDER_ENTRY, 43, -246.588, 1175.04, 41.621, 'Pit Commander');
+
+-- Infernal Target (Hyjal)
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=@INFERNAL_TARGET_HYJAL_ENTRY;
+
+-- Infernal Target (Hyjal) SAI
+SET @GUID := -74081;
+UPDATE `creature_template` SET `unit_flags`=`unit_flags`|512, `AIName`="SmartAI" WHERE `entry`=@INFERNAL_TARGET_HYJAL_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,0,38,0,100,0,1,0,0,0,11,33240,0,0,0,0,0,10,68745,@INFERNAL_RELAY_HELLFIRE_ENTRY,0,0,0,0,0,"Infernal Target (Hyjal) - On Data Set - Cast Infernal"),
+(@GUID,0,1,0,25,0,100,0,0,0,0,0,42,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Infernal Target (Hyjal) - On Data Set - Cast Infernal");
+-- Infernal Target (Hyjal) SAI
+SET @GUID := -74082;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@INFERNAL_TARGET_HYJAL_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@GUID AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@GUID,0,0,0,38,0,100,0,1,0,0,0,11,33240,0,0,0,0,0,10,68744,@INFERNAL_RELAY_HELLFIRE_ENTRY,0,0,0,0,0,"Infernal Target (Hyjal) - On Data Set - Cast Infernal"),
+(@GUID,0,2,0,25,0,100,0,0,0,0,0,42,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Infernal Target (Hyjal) - On Data Set - Cast Infernal");
+
+-- Infernal Relay (Hellfire)
+UPDATE `creature` SET `spawndist`=0, `MovementType`=0 WHERE `id`=@INFERNAL_RELAY_HELLFIRE_ENTRY;
+UPDATE `creature_template` SET `InhabitType`=4 WHERE entry=@INFERNAL_RELAY_HELLFIRE_ENTRY;
+UPDATE `creature_template` SET `AIName`="" WHERE `entry`=@INFERNAL_RELAY_HELLFIRE_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@INFERNAL_RELAY_HELLFIRE_ENTRY AND `source_type`=0;
+
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x40, `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@WRATH_MASTER_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(@WRATH_MASTER_ENTRY, -68311, -68312, -68313, -68314) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN(@WRATH_MASTER_ENTRY*100+0, @WRATH_MASTER_ENTRY*100+1, @WRATH_MASTER_ENTRY*100+2, @WRATH_MASTER_ENTRY*100+3) AND `source_type`=9;
+INSERT INTO `smart_scripts` VALUES
+(@WRATH_MASTER_ENTRY*100+0, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -278.63, 1534.43, 32.62, 0.0, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -280.33, 1541.21, 33.74, 0.0, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -277.73, 1523.79, 31.30, 0.0, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -279.23, 1518.37, 30.84, 0.0, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+0, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 4, 4, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -170.70, 1508.39, 27.5, 3.14, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -169.63, 1503.79, 27.3, 3.14, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -169.62, 1519.02, 28.6, 3.14, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -166.86, 1524.43, 29.4, 3.14, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+1, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 4, 4, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -100.15, 1888.80, 77.4, 2.54, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -100.48, 1885.22, 77.35, 2.54, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -95.23, 1895.04, 76.5, 2.54, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -91.67, 1896.62, 75.8, 2.54, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+2, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 4, 4, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -415.50, 1829.44, 74.8, 4.53, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -412.43, 1830.42, 75.4, 4.53, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 2, 2, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -423.48, 1831.24, 74.5, 4.53, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 3, 3, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 18944, 8, 0, 0, 0, 0, 8, 0, 0, 0, -427.70, 1833.82, 75.0, 4.53, 'Wrath Master - On Script - Summon Fel Soldier'),
+(@WRATH_MASTER_ENTRY*100+3, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 4, 4, 0, 0, 0, 0, 12, 1, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Script - Set Data'),
+(-68311, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Set Active'),
+(-68311, 0, 1, 0, 36, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Corpse Removed - Set Active'),
+(-68311, 0, 2, 3, 11, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Cast Teleport Visual Only'),
+(-68311, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 67, 1, 6000, 6000, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Create Timed Event'),
+(-68311, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, @WRATH_MASTER_ENTRY*100+0, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Run Script'),
+(-68311, 0, 5, 0, 59, 0, 100, 0, 1, 0, 0, 0, 53, 0, 68311, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Timed Event - Start WP'),
+(-68311, 0, 6, 0, 17, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - Just Summoned - Store Target'),
+(-68311, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Death - Despawn'),
+(-68311, 0, 8, 0, 4, 0, 100, 0, 0, 0, 0, 0, 39, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Aggro - Call For Help'),
+(-68311, 0, 10, 0, 0, 0, 100, 0, 3000, 13000, 15000, 31000, 11, 29574, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Rend'),
+(-68311, 0, 11, 0, 0, 0, 100, 0, 6000, 19000, 21000, 36000, 11, 35871, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Spellbreaker'),
+(-68312, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Set Active'),
+(-68312, 0, 1, 0, 36, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Corpse Removed - Set Active'),
+(-68312, 0, 2, 3, 11, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Cast Teleport Visual Only'),
+(-68312, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 67, 1, 1500, 1500, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Create Timed Event'),
+(-68312, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, @WRATH_MASTER_ENTRY*100+1, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Run Script'),
+(-68312, 0, 5, 0, 59, 0, 100, 0, 1, 0, 0, 0, 53, 0, 68312, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Timed Event - Start WP'),
+(-68312, 0, 6, 0, 17, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - Just Summoned - Store Target'),
+(-68312, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Death - Despawn'),
+(-68312, 0, 8, 0, 4, 0, 100, 0, 0, 0, 0, 0, 39, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Aggro - Call For Help'),
+(-68312, 0, 10, 0, 0, 0, 100, 0, 3000, 13000, 15000, 31000, 11, 29574, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Rend'),
+(-68312, 0, 11, 0, 0, 0, 100, 0, 6000, 19000, 21000, 36000, 11, 35871, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Spellbreaker'),
+(-68313, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Set Active'),
+(-68313, 0, 1, 0, 36, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Corpse Removed - Set Active'),
+(-68313, 0, 2, 3, 11, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Cast Teleport Visual Only'),
+(-68313, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 67, 1, 4000, 4000, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Create Timed Event'),
+(-68313, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, @WRATH_MASTER_ENTRY*100+2, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Run Script'),
+(-68313, 0, 5, 0, 59, 0, 100, 0, 1, 0, 0, 0, 53, 0, 68313, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Timed Event - Start WP'),
+(-68313, 0, 6, 0, 17, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - Just Summoned - Store Target'),
+(-68313, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Death - Despawn'),
+(-68313, 0, 8, 0, 4, 0, 100, 0, 0, 0, 0, 0, 39, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Aggro - Call For Help'),
+(-68313, 0, 10, 0, 0, 0, 100, 0, 3000, 13000, 15000, 31000, 11, 29574, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Rend'),
+(-68313, 0, 11, 0, 0, 0, 100, 0, 6000, 19000, 21000, 36000, 11, 35871, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Spellbreaker'),
+(-68314, 0, 0, 0, 11, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Set Active'),
+(-68314, 0, 1, 0, 36, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Corpse Removed - Set Active'),
+(-68314, 0, 2, 3, 11, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Cast Teleport Visual Only'),
+(-68314, 0, 3, 4, 61, 0, 100, 0, 0, 0, 0, 0, 67, 1, 4000, 4000, 0, 0, 100, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Create Timed Event'),
+(-68314, 0, 4, 0, 61, 0, 100, 0, 0, 0, 0, 0, 80, @WRATH_MASTER_ENTRY*100+3, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Respawn - Run Script'),
+(-68314, 0, 5, 0, 59, 0, 100, 0, 1, 0, 0, 0, 53, 0, 68314, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Timed Event - Start WP'),
+(-68314, 0, 6, 0, 17, 0, 100, 0, 0, 0, 0, 0, 64, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - Just Summoned - Store Target'),
+(-68314, 0, 7, 0, 6, 0, 100, 0, 0, 0, 0, 0, 41, 15000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Death - Despawn'),
+(-68314, 0, 8, 0, 4, 0, 100, 0, 0, 0, 0, 0, 39, 15, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - On Aggro - Call For Help'),
+(-68314, 0, 10, 0, 0, 0, 100, 0, 3000, 13000, 15000, 31000, 11, 29574, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Rend'),
+(-68314, 0, 11, 0, 0, 0, 100, 0, 6000, 19000, 21000, 36000, 11, 35871, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Wrath Master - In Combat - Cast Spellbreaker');
+
+DELETE FROM `waypoints` WHERE `entry` IN(68311, 68312, 68313, 68314);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(68311, 1, -270.735, 1527.63, 31.1836, 'Wrath Master'),
+(68311, 2, -260.567, 1525.02, 29.8034, 'Wrath Master'),
+(68311, 3, -253.926, 1522.59, 28.1088, 'Wrath Master'),
+(68311, 4, -249.349, 1521.57, 25.0041, 'Wrath Master'),
+(68311, 5, -240.034, 1516.72, 22.8203, 'Wrath Master'),
+(68311, 6, -232.184, 1508.16, 21.5413, 'Wrath Master'),
+(68311, 7, -230.872, 1501.28, 20.6535, 'Wrath Master'),
+(68311, 8, -233.41, 1485.1, 18.4649, 'Wrath Master'),
+(68311, 9, -236.188, 1467.82, 16.1683, 'Wrath Master'),
+(68311, 10, -242.961, 1443.11, 14.2698, 'Wrath Master'),
+(68311, 11, -248.129, 1419.16, 13.0837, 'Wrath Master'),
+(68311, 12, -251.718, 1398.48, 11.6931, 'Wrath Master'),
+(68311, 13, -251.572, 1377.49, 10.8303, 'Wrath Master'),
+(68311, 14, -250.61, 1350.7, 11.892, 'Wrath Master'),
+(68311, 15, -249.213, 1325.08, 15.3074, 'Wrath Master'),
+(68311, 16, -246.101, 1309.06, 18.0727, 'Wrath Master'),
+(68311, 17, -241.369, 1288.6, 21.4746, 'Wrath Master'),
+(68311, 18, -237.172, 1270.45, 24.8971, 'Wrath Master'),
+(68311, 19, -237.027, 1250.64, 28.2199, 'Wrath Master'),
+(68311, 20, -238.517, 1229.74, 31.7736, 'Wrath Master'),
+(68311, 21, -241.342, 1213.6, 35.8261, 'Wrath Master'),
+(68311, 22, -242.892, 1198.11, 42.0217, 'Wrath Master'),
+(68311, 23, -243.448, 1186.46, 42.3938, 'Wrath Master'),
+(68311, 24, -244.052, 1171.28, 41.5405, 'Wrath Master'),
+(68311, 25, -244.678, 1153.82, 41.6494, 'Wrath Master'),
+(68311, 26, -251.905, 1139.83, 41.6667, 'Wrath Master'),
+(68311, 27, -251.17, 1123.45, 42.1819, 'Wrath Master'),
+(68311, 28, -251.454, 1105.95, 41.6667, 'Wrath Master'),
+(68311, 29, -251.642, 1094.33, 41.6667, 'Wrath Master'),
+(68311, 30, -251.786, 1085.48, 47.0111, 'Wrath Master'),
+(68311, 31, -245.954, 1075.11, 53.9023, 'Wrath Master'),
+(68311, 32, -246.144, 1063.42, 54.3107, 'Wrath Master'),
+(68311, 33, -246.447, 1044.73, 54.3162, 'Wrath Master'),
+(68312, 1, -180.01, 1516.58, 27.6035, 'Wrath Master'),
+(68312, 2, -188.161, 1515.78, 27.4855, 'Wrath Master'),
+(68312, 3, -194.709, 1514.48, 27.2184, 'Wrath Master'),
+(68312, 4, -203.528, 1512.33, 23.5807, 'Wrath Master'),
+(68312, 5, -209.201, 1510.78, 22.2023, 'Wrath Master'),
+(68312, 6, -213.606, 1506.99, 21.42, 'Wrath Master'),
+(68312, 7, -222.386, 1499.38, 20.397, 'Wrath Master'),
+(68312, 8, -228.273, 1486.68, 18.8159, 'Wrath Master'),
+(68312, 9, -232.004, 1474.43, 17.1083, 'Wrath Master'),
+(68312, 10, -232.004, 1474.43, 17.1083, 'Wrath Master'),
+(68312, 11, -240.088, 1440.38, 14.1734, 'Wrath Master'),
+(68312, 12, -247.414, 1410.98, 12.5468, 'Wrath Master'),
+(68312, 13, -248.588, 1400.56, 11.8825, 'Wrath Master'),
+(68312, 14, -248.808, 1369.07, 10.8148, 'Wrath Master'),
+(68312, 15, -248.808, 1369.07, 10.8148, 'Wrath Master'),
+(68312, 16, -245.535, 1334.29, 14.0067, 'Wrath Master'),
+(68312, 17, -245.535, 1334.29, 14.0067, 'Wrath Master'),
+(68312, 18, -241.99, 1299.51, 19.6667, 'Wrath Master'),
+(68312, 19, -241.99, 1299.51, 19.6667, 'Wrath Master'),
+(68312, 20, -238.526, 1264.69, 25.8431, 'Wrath Master'),
+(68312, 21, -238.904, 1239.16, 30.0995, 'Wrath Master'),
+(68312, 22, -238.904, 1239.16, 30.0995, 'Wrath Master'),
+(68312, 23, -243.629, 1211.67, 36.8028, 'Wrath Master'),
+(68312, 24, -245.399, 1197.78, 42.3701, 'Wrath Master'),
+(68312, 25, -245.493, 1176.78, 41.6676, 'Wrath Master'),
+(68312, 26, -245.586, 1155.78, 41.6338, 'Wrath Master'),
+(68312, 27, -245.69, 1132.47, 41.6998, 'Wrath Master'),
+(68312, 28, -251.551, 1115.07, 41.6792, 'Wrath Master'),
+(68312, 29, -251.829, 1094.35, 41.6669, 'Wrath Master'),
+(68312, 30, -251.929, 1086.16, 46.5319, 'Wrath Master'),
+(68312, 31, -251.935, 1075.06, 53.8996, 'Wrath Master'),
+(68312, 32, -248.941, 1063.44, 54.3106, 'Wrath Master'),
+(68312, 33, -248.95, 1045.94, 54.3171, 'Wrath Master'),
+(68313, 1, -112.343, 1891.33, 80.0147, 'Wrath Master'),
+(68313, 2, -129.092, 1880.62, 83.4569, 'Wrath Master'),
+(68313, 3, -145.72, 1872.24, 86.5619, 'Wrath Master'),
+(68313, 4, -159.512, 1869.84, 89.052, 'Wrath Master'),
+(68313, 5, -177.777, 1865.91, 93.1582, 'Wrath Master'),
+(68313, 6, -189.585, 1861.14, 94.292, 'Wrath Master'),
+(68313, 7, -194.196, 1859.96, 92.3105, 'Wrath Master'),
+(68313, 8, -198.484, 1858.43, 91.6116, 'Wrath Master'),
+(68313, 9, -200.727, 1857.64, 90.8248, 'Wrath Master'),
+(68313, 10, -207.861, 1851.66, 90.1464, 'Wrath Master'),
+(68313, 11, -215.437, 1841.33, 88.974, 'Wrath Master'),
+(68313, 12, -215.021, 1829.64, 87.6314, 'Wrath Master'),
+(68313, 13, -214.322, 1813.28, 85.0578, 'Wrath Master'),
+(68313, 14, -212.8, 1800.56, 82.2836, 'Wrath Master'),
+(68313, 15, -210.241, 1780.85, 76.6338, 'Wrath Master'),
+(68313, 16, -207.241, 1757.73, 70.0961, 'Wrath Master'),
+(68313, 17, -204.692, 1738.08, 64.4382, 'Wrath Master'),
+(68313, 18, -204.353, 1720.59, 59.5464, 'Wrath Master'),
+(68313, 19, -203.371, 1699.54, 53.4667, 'Wrath Master'),
+(68313, 20, -202.608, 1683.18, 49.4984, 'Wrath Master'),
+(68313, 21, -201.737, 1664.51, 45.1893, 'Wrath Master'),
+(68313, 22, -200.81, 1644.72, 41.0282, 'Wrath Master'),
+(68313, 23, -199.93, 1627.31, 37.7967, 'Wrath Master'),
+(68313, 24, -199.93, 1627.31, 37.7967, 'Wrath Master'),
+(68313, 25, -203.923, 1601.96, 33.021, 'Wrath Master'),
+(68313, 26, -207.465, 1588.42, 30.7292, 'Wrath Master'),
+(68313, 27, -211.591, 1572.64, 28.6103, 'Wrath Master'),
+(68313, 28, -216.32, 1554.56, 26.5615, 'Wrath Master'),
+(68313, 29, -220.446, 1538.78, 24.9218, 'Wrath Master'),
+(68313, 30, -224.874, 1521.85, 23.0684, 'Wrath Master'),
+(68313, 31, -230.789, 1499.23, 20.3917, 'Wrath Master'),
+(68313, 32, -235.517, 1481.15, 17.8653, 'Wrath Master'),
+(68313, 33, -240.529, 1461.98, 15.4422, 'Wrath Master'),
+(68313, 34, -244.372, 1447.29, 14.5134, 'Wrath Master'),
+(68313, 35, -248.8, 1430.35, 13.8539, 'Wrath Master'),
+(68313, 36, -252.625, 1415.73, 12.7361, 'Wrath Master'),
+(68313, 37, -253.861, 1404.17, 11.9207, 'Wrath Master'),
+(68313, 38, -252.777, 1387.83, 11.1616, 'Wrath Master'),
+(68313, 39, -251.771, 1372.67, 10.7793, 'Wrath Master'),
+(68313, 40, -250.459, 1352.89, 11.6834, 'Wrath Master'),
+(68313, 41, -249.305, 1335.49, 13.7715, 'Wrath Master'),
+(68313, 42, -248.147, 1318.03, 16.5355, 'Wrath Master'),
+(68313, 43, -246.234, 1306.5, 18.4776, 'Wrath Master'),
+(68313, 44, -243.565, 1290.41, 21.1146, 'Wrath Master'),
+(68313, 45, -239.75, 1267.41, 25.3402, 'Wrath Master'),
+(68313, 46, -236.313, 1246.7, 28.9015, 'Wrath Master'),
+(68313, 47, -239.597, 1224.71, 32.8632, 'Wrath Master'),
+(68313, 48, -240.818, 1210.69, 37.0075, 'Wrath Master'),
+(68313, 49, -242.052, 1196.54, 42.1932, 'Wrath Master'),
+(68313, 50, -242.537, 1181.36, 41.8351, 'Wrath Master'),
+(68313, 51, -243.318, 1156.93, 41.6182, 'Wrath Master'),
+(68313, 52, -243.987, 1135.98, 41.6667, 'Wrath Master'),
+(68313, 53, -251.546, 1118.49, 42.0075, 'Wrath Master'),
+(68313, 54, -251.067, 1102.19, 41.6667, 'Wrath Master'),
+(68313, 55, -251.326, 1094.07, 41.6667, 'Wrath Master'),
+(68313, 56, -251.59, 1083.3, 48.4641, 'Wrath Master'),
+(68313, 57, -251.594, 1074.58, 54.2525, 'Wrath Master'),
+(68313, 58, -245.603, 1058.27, 54.3126, 'Wrath Master'),
+(68313, 59, -245.614, 1037.27, 54.3191, 'Wrath Master'),
+(68314, 1, -404.061, 1818.73, 72.6499, 'Wrath Master'),
+(68314, 2, -389.501, 1814.49, 72.7857, 'Wrath Master'),
+(68314, 3, -370.481, 1808.96, 73.5055, 'Wrath Master'),
+(68314, 4, -352.539, 1803.73, 73.6972, 'Wrath Master'),
+(68314, 5, -338.685, 1805.75, 75.216, 'Wrath Master'),
+(68314, 6, -320.381, 1809.53, 79.0509, 'Wrath Master'),
+(68314, 7, -301.382, 1815.28, 82.8135, 'Wrath Master'),
+(68314, 8, -285.97, 1820.62, 85.9315, 'Wrath Master'),
+(68314, 9, -272.466, 1827.48, 88.2899, 'Wrath Master'),
+(68314, 10, -265.201, 1831.11, 89.7627, 'Wrath Master'),
+(68314, 11, -253.62, 1832.71, 91.8272, 'Wrath Master'),
+(68314, 12, -241.178, 1841.39, 92.7873, 'Wrath Master'),
+(68314, 13, -236.851, 1842.14, 90.2615, 'Wrath Master'),
+(68314, 14, -227.443, 1837.47, 89.0557, 'Wrath Master'),
+(68314, 15, -219.36, 1827.54, 87.4862, 'Wrath Master'),
+(68314, 16, -216.983, 1813.74, 85.215, 'Wrath Master'),
+(68314, 17, -213.051, 1795.54, 80.9159, 'Wrath Master'),
+(68314, 18, -208.664, 1776.22, 75.3269, 'Wrath Master'),
+(68314, 19, -203.564, 1753.41, 68.8117, 'Wrath Master'),
+(68314, 20, -201.937, 1733.59, 63.0754, 'Wrath Master'),
+(68314, 21, -200.196, 1709.16, 56.0166, 'Wrath Master'),
+(68314, 22, -199.037, 1689.31, 50.7389, 'Wrath Master'),
+(68314, 23, -199.125, 1669.5, 46.1424, 'Wrath Master'),
+(68314, 24, -199.234, 1645, 41.067, 'Wrath Master'),
+(68314, 25, -199.968, 1621.71, 36.7692, 'Wrath Master'),
+(68314, 26, -201.72, 1601.97, 33.0508, 'Wrath Master'),
+(68314, 27, -208.383, 1578.4, 29.3313, 'Wrath Master'),
+(68314, 28, -214.934, 1551.17, 26.2096, 'Wrath Master'),
+(68314, 29, -223.08, 1519.51, 22.738, 'Wrath Master'),
+(68314, 30, -230.058, 1492.4, 19.5117, 'Wrath Master'),
+(68314, 31, -236.163, 1468.67, 16.2668, 'Wrath Master'),
+(68314, 32, -242.269, 1444.94, 14.2877, 'Wrath Master'),
+(68314, 33, -247.799, 1423.45, 13.3939, 'Wrath Master'),
+(68314, 34, -251.61, 1399.26, 11.7349, 'Wrath Master'),
+(68314, 35, -252.834, 1369.07, 10.8068, 'Wrath Master'),
+(68314, 36, -251.446, 1349.31, 12.034, 'Wrath Master'),
+(68314, 37, -248.328, 1326.21, 15.1602, 'Wrath Master'),
+(68314, 38, -245.147, 1303.12, 19.0204, 'Wrath Master'),
+(68314, 39, -241.558, 1277.81, 23.4223, 'Wrath Master'),
+(68314, 40, -241.404, 1256.81, 27.0886, 'Wrath Master'),
+(68314, 41, -240.981, 1234.62, 30.8882, 'Wrath Master'),
+(68314, 42, -242.084, 1214.77, 35.4648, 'Wrath Master'),
+(68314, 43, -243.058, 1197.23, 42.2163, 'Wrath Master'),
+(68314, 44, -243.323, 1180.92, 41.8092, 'Wrath Master'),
+(68314, 45, -243.721, 1156.42, 41.6234, 'Wrath Master'),
+(68314, 46, -245.046, 1137.85, 41.668, 'Wrath Master'),
+(68314, 47, -252.701, 1115.96, 41.6755, 'Wrath Master'),
+(68314, 48, -252.761, 1094.48, 41.6669, 'Wrath Master'),
+(68314, 49, -252.516, 1085.41, 47.012, 'Wrath Master'),
+(68314, 50, -252.234, 1074.91, 53.9873, 'Wrath Master'),
+(68314, 51, -252.106, 1057.41, 54.3128, 'Wrath Master'),
+(68314, 52, -249.986, 1041.03, 54.318, 'Wrath Master');
+
+-- Delete current creatures Infernal Siegebreaker (18946)
+DELETE FROM `creature_addon` WHERE `guid` IN(SELECT `guid` FROM `creature` WHERE id=18946);
+DELETE FROM `creature` WHERE `id`=18946;
+
+-- Update extra flags
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x40 WHERE `entry`=18946;
+
+-- Infernal Siegebreaker SAI
+DELETE FROM `creature_template_addon` WHERE `entry` = 18946;
+INSERT INTO `creature_template_addon` (`entry`,`auras`) VALUES (18946, '33650');
+
+DELETE FROM `creature_addon` WHERE `guid` IN(SELECT `guid` FROM `creature` WHERE `id`=18944);
+DELETE FROM `creature` WHERE id=18944;
+UPDATE `creature_template` SET `flags_extra`=`flags_extra`|0x40 WHERE `entry`=18944;
+
+-- Fel Soldier SAI
+SET @ENTRY := 18944;
+UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
+(@ENTRY,0,0,0,38,0,100,0,1,1,0,0,29,1,120,0,0,0,0,23,0,0,0,0,0,0,0,"Fel Soldier - On Data Set - Follow"),
+(@ENTRY,0,1,0,38,0,100,0,2,2,0,0,29,6,120,0,0,0,0,23,0,0,0,0,0,0,0,"Fel Soldier - On Data Set - Follow"),
+(@ENTRY,0,2,0,38,0,100,0,3,3,0,0,29,1,240,0,0,0,0,23,0,0,0,0,0,0,0,"Fel Soldier - On Data Set - Follow"),
+(@ENTRY,0,3,0,38,0,100,0,4,4,0,0,29,6,240,0,0,0,0,23,0,0,0,0,0,0,0,"Fel Soldier - On Data Set - Follow"),
+(@ENTRY,0,4,5,54,0,100,0,0,0,0,0,11,51347,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Soldier - On Reset - Cast Teleport Visual Only"),
+(@ENTRY,0,5,0,61,0,100,0,0,0,0,0,59,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Soldier - On Respawn - Set Run False"),
+(@ENTRY,0,6,0,0,0,100,0,3000,12000,9000,15000,11,15496,0,0,0,0,0,2,0,0,0,0,0,0,0,"Fel Soldier - In Combat - Cast Cleave"),
+(@ENTRY,0,7,0,0,0,100,0,6000,20000,16000,33000,11,32009,0,0,0,0,0,2,0,0,0,0,0,0,0,"Fel Soldier - In Combat - Cast Cutdown"),
+(@ENTRY,0,8,0,4,0,100,0,0,0,0,0,39,15,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Soldier - On Aggro - Call For Help"),
+(@ENTRY,0,9,0,60,0,100,0,5000,5000,5000,5000,101,0,0,0,0,0,0,1,0,0,0,0,0,0,0,"Fel Soldier - On Update - Set Home Position");
+
+DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=18944;
+
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (19006, 19007) AND `source_type`=0 AND `id`=1;
+INSERT INTO `smart_scripts` VALUES
+(19006, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Gnomeregan Conjuror - On Reset - Set active"),
+(19007, 0, 1, 0, 25, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Gnomeregan Conjuror - On Reset - Set active");
+
+-- Darkspear Axe Thrower
+UPDATE `creature_template` SET AIName='SmartAI', `ScriptName`='' WHERE `entry`=@DARKSPEAR_AXE_THROWER_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@DARKSPEAR_AXE_THROWER_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - On JUST SUMMONED - Cast visual teleport'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 1, 2, 61, 0, 100, 0, 1, 0, 0, 0, 53, 1, @DARKSPEAR_AXE_THROWER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - On Timed Event - Start WP'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - On JUST SUMMONED - Set active'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 3, 0, 0, 0, 100, 0, 0, 2000, 2300, 3900, 11, 10277, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - In Combat - Cast Throw'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 4, 5, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - On WP Reached - Set Home pos'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - On WP Reached - Random mov'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 0, 6, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 30, 0, 0, 0, 0, 0, 0, 'Darkspear Axe Thrower - Ooc - Start attack');
+
+-- Orgrimmar Grunt
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ORGRIMMAR_GRUNT_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ORGRIMMAR_GRUNT_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - On JUST SUMMONED - Cast visual teleport'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 1, 2, 61, 0, 100, 0, 1, 0, 0, 0, 53, 1, @DARKSPEAR_AXE_THROWER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - On Timed Event - Start WP'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - On JUST SUMMONED - Set active'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 3, 0, 0, 0, 100, 0, 3000, 9000, 8000, 13000, 11, 33626, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - In Combat - Cast Strike'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 4, 0, 0, 0, 40, 0, 3000, 29000, 28000, 53000, 11, 23511, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - In Combat - Cast Demoralizing Shout'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 5, 6, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - On WP Reached - Set Home pos'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - On WP Reached - Random mov'),
+(@ORGRIMMAR_GRUNT_ENTRY, 0, 7, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 10, 0, 0, 0, 0, 0, 0, 'Orgrimmar Grunt - Ooc - Start attack');
+
+-- Orgrimmar Shaman
+DELETE FROM `creature_template_addon` WHERE `entry` = @ORGRIMMAR_SHAMAN_ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`, `emote`) VALUES (@ORGRIMMAR_SHAMAN_ENTRY, 4097, 333);
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@ORGRIMMAR_SHAMAN_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@ORGRIMMAR_SHAMAN_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - On JUST SUMMONED - Cast visual teleport'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 1, 2, 61, 0, 100, 0, 1, 0, 0, 0, 53, 1, @DARKSPEAR_AXE_THROWER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - On Timed Event - Start WP'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - On JUST SUMMONED - Set active'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 3, 0, 0, 0, 100, 0, 3000, 12000, 12000, 18000, 11, 15616, 0, 0, 0, 0, 0, 5, 20, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - In Combat - Cast Flame Shock'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 4, 0, 0, 0, 100, 0, 0, 5000, 60000, 60000, 11, 20545, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - In Combat - Cast Lightning Shield'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 5, 6, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - On WP Reached - Set Home pos'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - On WP Reached - Random mov'),
+(@ORGRIMMAR_SHAMAN_ENTRY, 0, 7, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 10, 0, 0, 0, 0, 0, 0, 'Orgrimmar Shaman - Ooc - Start attack');
+
+-- Undercity Mage
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@UNDERCITY_MAGE_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@UNDERCITY_MAGE_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@UNDERCITY_MAGE_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - On JUST SUMMONED - Cast visual teleport'),
+(@UNDERCITY_MAGE_ENTRY, 0, 1, 2, 61, 0, 100, 0, 1, 0, 0, 0, 53, 1, @DARKSPEAR_AXE_THROWER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - On Timed Event - Start WP'),
+(@UNDERCITY_MAGE_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - On JUST SUMMONED - Set active'),
+(@UNDERCITY_MAGE_ENTRY, 0, 3, 0, 0, 0, 100, 0, 1000, 2000, 3000, 5000, 11, 33417, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - In Combat - Cast Fireball'),
+(@UNDERCITY_MAGE_ENTRY, 0, 4, 0, 0, 0, 100, 0, 3000, 17000, 20000, 40000, 11, 33419, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - In Combat - Cast Arcane Missiles'),
+(@UNDERCITY_MAGE_ENTRY, 0, 5, 0, 0, 0, 100, 0, 3000, 27000, 30000, 50000, 11, 33624, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - In Combat - Cast Blizzard'),
+(@UNDERCITY_MAGE_ENTRY, 0, 6, 7, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - On WP Reached - Set Home pos'),
+(@UNDERCITY_MAGE_ENTRY, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Undercity Mage - On WP Reached - Random mov'),
+(@UNDERCITY_MAGE_ENTRY, 0, 8, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 30, 0, 0, 0, 0, 0, 0, 'Undercity Mage - Ooc - Start attack');
+
+-- Darnassian Archer
+UPDATE `creature_template` SET `AIName`='SmartAI', ScriptName='' WHERE `entry`=@DARNASSIAN_ARCHER_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@DARNASSIAN_ARCHER_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@DARNASSIAN_ARCHER_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Archer - On JUST SUMMONED - Cast visual teleport'),
+(@DARNASSIAN_ARCHER_ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, @DARNASSIAN_ARCHER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Archer - On JUST SUMMONED - start WP'),
+(@DARNASSIAN_ARCHER_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Archer - On JUST SUMMONED - Set active'),
+(@DARNASSIAN_ARCHER_ENTRY, 0, 3, 0, 0, 0, 100, 0, 0, 2000, 2000, 3000, 11, 15620, 64, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Archer - In Combat - Cast Shoot'),
+(@DARNASSIAN_ARCHER_ENTRY, 0, 4, 5, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Darnassian Archer - On WP Reached - Set Home pos'),
+(@DARNASSIAN_ARCHER_ENTRY, 0, 5, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Archer - On WP Reached - Random mov'),
+(@DARNASSIAN_ARCHER_ENTRY, 0, 6, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 30, 0, 0, 0, 0, 0, 0, 'Darnassian Archer - Ooc - Start attack');
+
+-- Ironforge Paladin
+DELETE FROM `creature_template_addon` WHERE `entry` = @IRONFORGE_PALADIN_ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`, `emote`) VALUES (@IRONFORGE_PALADIN_ENTRY, 4097, 333);
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@IRONFORGE_PALADIN_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@IRONFORGE_PALADIN_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@IRONFORGE_PALADIN_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - On JUST SUMMONED - Cast visual teleport'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, @DARNASSIAN_ARCHER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - On JUST SUMMONED - start WP'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - On JUST SUMMONED - Set active'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 3, 0, 0, 0, 100, 0, 3000, 9000, 8000, 13000, 11, 20696, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - In Combat - Cast Holy Smite'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 4, 0, 0, 0, 40, 0, 3000, 12000, 15000, 28000, 11, 33632, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - In Combat - Cast Exorcism'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 5, 6, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - On WP Reached - Set Home pos'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - On WP Reached - Random mov'),
+(@IRONFORGE_PALADIN_ENTRY, 0, 7, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 10, 0, 0, 0, 0, 0, 0, 'Ironforge Paladin - Ooc - Start attack');
+
+-- Stormwind Soldier
+DELETE FROM `creature_template_addon` WHERE `entry` = @STORMWIND_SOLDIER_ENTRY;
+INSERT INTO `creature_template_addon` (`entry`,`bytes2`, `emote`) VALUES (@STORMWIND_SOLDIER_ENTRY, 4097, 333);
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@STORMWIND_SOLDIER_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@STORMWIND_SOLDIER_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@STORMWIND_SOLDIER_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - On JUST SUMMONED - Cast visual teleport'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, @DARNASSIAN_ARCHER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - On JUST SUMMONED - start WP'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - On JUST SUMMONED - Set active'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 3, 0, 0, 0, 100, 0, 3000, 9000, 8000, 13000, 11, 33626, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - In Combat - Cast Strike'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 4, 0, 0, 0, 40, 0, 3000, 29000, 28000, 53000, 11, 23511, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - In Combat - Cast Demoralizing Shout'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 5, 6, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - On WP Reached - Set Home pos'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - On WP Reached - Random mov'),
+(@STORMWIND_SOLDIER_ENTRY, 0, 7, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 10, 0, 0, 0, 0, 0, 0, 'Stormwind Soldier - Ooc - Start attack');
+
+-- Stormwind Mage
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@STORMWIND_MAGE_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@STORMWIND_MAGE_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@STORMWIND_MAGE_ENTRY, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 11, 51347, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - On JUST SUMMONED - Cast visual teleport'),
+(@STORMWIND_MAGE_ENTRY, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 53, 1, @DARNASSIAN_ARCHER_ENTRY, 0, 0, 0, 2, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - On JUST SUMMONED - start WP'),
+(@STORMWIND_MAGE_ENTRY, 0, 2, 0, 61, 0, 100, 0, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - On JUST SUMMONED - Set active'),
+(@STORMWIND_MAGE_ENTRY, 0, 3, 0, 0, 0, 100, 0, 1000, 2000, 3000, 5000, 11, 33417, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - In Combat - Cast Fireball'),
+(@STORMWIND_MAGE_ENTRY, 0, 4, 0, 0, 0, 100, 0, 3000, 17000, 20000, 40000, 11, 33419, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - In Combat - Cast Arcane Missiles'),
+(@STORMWIND_MAGE_ENTRY, 0, 5, 0, 0, 0, 100, 0, 3000, 27000, 30000, 50000, 11, 33624, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - In Combat - Cast Blizzard'),
+(@STORMWIND_MAGE_ENTRY, 0, 6, 7, 40, 0, 100, 0, 12, 0, 0, 0, 101, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - On WP Reached - Set Home pos'),
+(@STORMWIND_MAGE_ENTRY, 0, 7, 0, 61, 0, 100, 0, 0, 0, 0, 0, 89, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - On WP Reached - Random mov'),
+(@STORMWIND_MAGE_ENTRY, 0, 8, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 30, 0, 0, 0, 0, 0, 0, 'Stormwind Mage - Ooc - Start attack');
+
+-- Justinius the Harbinger
+DELETE FROM `creature_text` WHERE `entry`=@JUSTINIUS_THE_HARBINGER_ENTRY;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 0,"Soldiers of Azeroth, you now fight against the vile Burning Crusade. And the hopes and prayers of all Light-loving people march with you. In the company of our brave allies and brothers -in-arms you will hold your ground and break the demonic charge. You will stem the destructive tyranny that rages across so many worlds.", 14, 0, 100, 0, 0, 0, 16625, 0, 'Justinius the Harbinger Aggro'),
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 1,"With each passing moment, I see the people of Azeroth prove again the reasons we have come. It is with solemn pride that I fight with you, and if I die this day, then I die among friends.", 14, 0, 100, 0, 0, 0, 16633, 0, 'Justinius the Harbinger Aggro'),
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 2,"The demons should be in no doubt that we are their nemesis and, though they wish our destruction, it is we who bring about their ruin. Kazzak and his forces will be diminished and defeated by this coalition. And to do this, we must throw at them our bodies and hearts, for they seek no less than the obliteration of this world.", 14, 0, 100, 0, 0, 0, 16627, 0, 'Justinius the Harbinger Aggro'),
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 3,"Fight on, good people of Azeroth. And take heart! Your brethren rush to this hellish portal and will soon throw themselves at these demons as you have so bravely done. May the Light keep you!", 14, 0, 100, 0, 0, 0, 16933, 0, 'Justinius the Harbinger Aggro'),
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 4,"Behold the power of the Light! Grace and glory to the Alliance!" , 14, 0, 100, 0, 0, 0, 16286, 0, 'Justinius the Harbinger Aggro');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@JUSTINIUS_THE_HARBINGER_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@JUSTINIUS_THE_HARBINGER_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 0, 0, 0, 0, 100, 0, 1000, 20000, 20000, 40000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Justinius the Harbinger - IC - Say Line 0'),
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 1, 0, 0, 0, 100, 0, 5000, 10000, 10000, 20000, 11, 33554, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Justinius the Harbinger - In Combat - Cast Judgement of Command'),
+(@JUSTINIUS_THE_HARBINGER_ENTRY, 0, 2, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 50, 0, 0, 0, 0, 0, 0, 'Justinius the Harbinger - Ooc - Start attack');
+
+DELETE FROM `creature_text` WHERE `entry`=@MELGROMM_HIGHMOUNTAIN_ENTRY;
+INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 0,"Hunters, to me! Let us show these demons what it is to fight and die in Azeroth!" , 14, 0, 100, 0, 0, 0, 16616, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 1,"The spirits sing to us! They sing the song of battle!", 14, 0, 100, 0, 0, 0, 16617, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 2,"Strike true, brothers and sisters! Today our quarry is demons!", 14, 0, 100, 0, 0, 0, 16618, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 3,"Once again, we will show this Burning Legion that our world is not for the taking!", 14, 0, 100, 0, 0, 0, 16620, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 4,"These fiends will fail! For Azeroth!", 14, 0, 100, 0, 0, 0, 16621, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 5,"If it is our fate to die this day, then we will not go easy! Mark me, these demons will fall like wheat!", 14, 0, 100, 0, 0, 0, 16622, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 6,"Though your sinews tire and your blood flows from cuts and wounds to this sodden ground, you fight for the spirits of your world. No evil force can stand against us!", 14, 0, 100, 0, 0, 0, 16624, 0, 'MELGROMM_HIGHMOUNTAIN'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 7,"My brethern, my commands-in-arms! I must go to seek the forces of the Horde and direct them here! Keep your spirits strong, brave hunters! Do not fall to the portal-spawned fiends!", 14, 0, 100, 0, 0, 0, 16935, 0, 'MELGROMM_HIGHMOUNTAIN');
+
+-- Melgromm Highmountain
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry`=@MELGROMM_HIGHMOUNTAIN_ENTRY;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@MELGROMM_HIGHMOUNTAIN_ENTRY AND `source_type`=0;
+INSERT INTO `smart_scripts` VALUES
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 0, 0, 0, 0, 100, 0, 5000, 10000, 10000, 20000, 11, 33643, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Melgromm Highmountain - In Combat - Cast Chain Lightning'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 1, 0, 0, 0, 100, 0, 5000, 10000, 10000, 20000, 11, 22885, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 'Melgromm Highmountain - In Combat - Cast Earth Shock'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 2, 0, 0, 0, 100, 0, 1000, 20000, 20000, 40000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Melgromm Highmountain - IC - Say Line 0'),
+(@MELGROMM_HIGHMOUNTAIN_ENTRY, 0, 3, 0, 1, 0, 100, 0, 5000, 5000, 5000, 5000, 49, 0, 0, 0, 0, 0, 0, 25, 50, 0, 0, 0, 0, 0, 0, 'Melgromm Highmountain - Ooc - Start attack');
+
+-- Remake stairs spawns
+DELETE FROM `creature_addon` WHERE `guid` IN(SELECT `guid` FROM `creature` WHERE `id` IN(@DARKSPEAR_AXE_THROWER_ENTRY, @ORGRIMMAR_GRUNT_ENTRY, @ORGRIMMAR_SHAMAN_ENTRY, @DARNASSIAN_ARCHER_ENTRY, @IRONFORGE_PALADIN_ENTRY, @STORMWIND_SOLDIER_ENTRY, @UNDERCITY_MAGE_ENTRY, @STORMWIND_MAGE_ENTRY, @JUSTINIUS_THE_HARBINGER_ENTRY, @MELGROMM_HIGHMOUNTAIN_ENTRY));
+
+DELETE FROM `creature` WHERE `id` IN(@DARKSPEAR_AXE_THROWER_ENTRY, @ORGRIMMAR_GRUNT_ENTRY, @ORGRIMMAR_SHAMAN_ENTRY, @DARNASSIAN_ARCHER_ENTRY, @IRONFORGE_PALADIN_ENTRY, @STORMWIND_SOLDIER_ENTRY, @UNDERCITY_MAGE_ENTRY, @STORMWIND_MAGE_ENTRY, @JUSTINIUS_THE_HARBINGER_ENTRY, @MELGROMM_HIGHMOUNTAIN_ENTRY, @PIT_COMMANDER_ENTRY, @WRATH_MASTER_ENTRY);
+INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `modelid`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `spawndist`, `currentwaypoint`, `curhealth`, `curmana`, `MovementType`, `npcflag`, `unit_flags`, `dynamicflags`, `VerifiedBuild`) VALUES
+(@PIT_COMMANDER_GUID, @PIT_COMMANDER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -420.58, 1832.27, 75.1, 4.60, 10, 0, 0, 236000, 330900, 0, 0, 0, 0, 0),
+(68311, @WRATH_MASTER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -276.43, 1529.10, 31.8, 0.0, 35, 0, 0, 143620, 0, 0, 0, 0, 0, 0),
+(68312, @WRATH_MASTER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -172.35, 1513.68, 27.8, 3.14, 25, 0, 0, 143620, 0, 0, 0, 0, 0, 0),
+(68313, @WRATH_MASTER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -99.78, 1892.91, 77.35, 2.54, 25, 0, 0, 143620, 0, 0, 0, 0, 0, 0),
+(68314, @WRATH_MASTER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -418.51, 1828.48, 74.2, 4.53, 25, 0, 0, 143620, 0, 0, 0, 0, 0, 0),
+(68010, @STORMWIND_SOLDIER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -267.365, 1098.02, 41.7141, 1.5708, 30, 0, 0, 12652 , 0, 0, 0, 0, 0, 0),
+(68011, @STORMWIND_SOLDIER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -272.049, 1097.78, 41.936, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68012, @STORMWIND_SOLDIER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -259.395, 1098.42, 41.6679, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68013, @STORMWIND_SOLDIER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -264.079, 1098.18, 41.6716, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68021, @STORMWIND_SOLDIER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -254.498, 1098.19, 41.6667, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68017, @ORGRIMMAR_GRUNT_ENTRY, 530, 0, 0, 1, 1, 0, 1, -229.442, 1098.11, 41.6667, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68018, @ORGRIMMAR_GRUNT_ENTRY, 530, 0, 0, 1, 1, 0, 1, -237.898, 1098.01, 41.6667, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68020, @ORGRIMMAR_GRUNT_ENTRY, 530, 0, 0, 1, 1, 0, 1, -246.297, 1097.92, 41.6667, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68022, @ORGRIMMAR_GRUNT_ENTRY, 530, 0, 0, 1, 1, 0, 1, -251.015, 1097.87, 41.7916, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68024, @ORGRIMMAR_GRUNT_ENTRY, 530, 0, 0, 1, 1, 0, 1, -233.684, 1098.06, 41.6667, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68025, @ORGRIMMAR_GRUNT_ENTRY, 530, 0, 0, 1, 1, 0, 1, -242.321, 1097.96, 41.6667, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68111, @DARNASSIAN_ARCHER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -269.663, 1086.26, 46.2537, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68112, @DARNASSIAN_ARCHER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -269.932, 1083.3, 48.2155, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68113, @DARNASSIAN_ARCHER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -260.548, 1086.05, 46.4834, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68114, @DARNASSIAN_ARCHER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -260.593, 1083.48, 48.1924, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68115, @DARNASSIAN_ARCHER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -265.322, 1083.37, 48.2152, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68116, @DARNASSIAN_ARCHER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -265.187, 1086.36, 46.23, 1.5708, 30 , 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68118, @JUSTINIUS_THE_HARBINGER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -269.544, 1071.83, 54.3084, 1.5708, 30, 0, 0, 111780, 47325, 0, 0, 0, 0, 0),
+(68121, @MELGROMM_HIGHMOUNTAIN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -230.449, 1071.93, 54.3084, 1.5708, 30, 0, 0, 111780, 47325, 0, 0, 0, 0, 0),
+(68023, @DARKSPEAR_AXE_THROWER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -231.948, 1088.23, 45.3315, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68122, @DARKSPEAR_AXE_THROWER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -232.25, 1085.21, 47.3327, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68123, @DARKSPEAR_AXE_THROWER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -235.748, 1085.1, 47.3696, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68124, @DARKSPEAR_AXE_THROWER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -238.932, 1088.06, 45.3673, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68125, @DARKSPEAR_AXE_THROWER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -235.209, 1088.15, 45.3476, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(68126, @DARKSPEAR_AXE_THROWER_ENTRY, 530, 0, 0, 1, 1, 0, 1, -239.247, 1084.99, 47.4066, 1.5708, 30, 0, 0, 12652, 0, 0, 0, 0, 0, 0),
+(86066, @ORGRIMMAR_SHAMAN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -249.345, 1094.04, 41.6667, 1.5708, 30, 0, 0, 7590, 29330, 0, 0, 0, 0, 0),
+(86068, @ORGRIMMAR_SHAMAN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -240.736, 1094.17, 41.6667, 1.5708, 30, 0, 0, 7590, 29330, 0, 0, 0, 0, 0),
+(86069, @ORGRIMMAR_SHAMAN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -245.398, 1094.1, 41.6667, 1.5708, 30, 0, 0, 7590, 29330, 0, 0, 0, 0, 0),
+(86070, @ORGRIMMAR_SHAMAN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -231.307, 1094.23, 41.6667, 1.5708, 30, 0, 0, 7590, 29330, 0, 0, 0, 0, 0),
+(86071, @ORGRIMMAR_SHAMAN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -236.089, 1094.24, 41.6667, 1.5708, 30, 0, 0, 7590, 29330, 0, 0, 0, 0, 0),
+(68262, @IRONFORGE_PALADIN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -265.912, 1092.97, 41.8355, 1.5708, 30, 0, 0, 12650, 29330, 0, 0, 0, 0, 0),
+(68263, @IRONFORGE_PALADIN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -257.407, 1092.94, 41.9379, 1.5708, 30, 0, 0, 12650, 29330, 0, 0, 0, 0, 0),
+(68264, @IRONFORGE_PALADIN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -253.246, 1093.04, 41.9172, 1.5708, 30, 0, 0, 12650, 29330, 0, 0, 0, 0, 0),
+(68265, @IRONFORGE_PALADIN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -261.812, 1092.96, 41.8783, 1.5708, 30, 0, 0, 12650, 29330, 0, 0, 0, 0, 0),
+(68266, @IRONFORGE_PALADIN_ENTRY, 530, 0, 0, 1, 1, 0, 1, -270.575, 1093.28, 41.923, 1.5708, 30, 0, 0, 12650, 29330, 0, 0, 0, 0, 0),
+(68127, @UNDERCITY_MAGE_ENTRY, 530, 0, 0, 1, 1, 0, 1, -225.987, 1083.23, 54.3374, 2.71726, 30, 0, 0, 9160, 68820, 0, 0, 0, 0, 0),
+(68128, @UNDERCITY_MAGE_ENTRY, 530, 0, 0, 1, 1, 0, 1, -228.478, 1074.47, 54.3336, 2.51033, 30, 0, 0, 9160, 68820, 0, 0, 0, 0, 0),
+(68015, @STORMWIND_MAGE_ENTRY, 530, 0, 0, 1, 1, 0, 1, -272.632, 1075, 54.3557, 1.5708, 30, 0, 0, 9160, 68820, 0, 0, 0, 0, 0),
+(68016, @STORMWIND_MAGE_ENTRY, 530, 0, 0, 1, 1, 0, 1, -275.911, 1083.75, 54.3343, 1.5708, 30, 0, 0, 9160, 68820, 0, 0, 0, 0, 0);
+
+-- Update addon
+DELETE FROM `creature_addon` WHERE `guid` IN(@PIT_COMMANDER_GUID, 68311, 68312, 68313, 68314);
+INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
+(@PIT_COMMANDER_GUID, 0, 0, 0, 4097, 0, ''),
+(68311, 0, 0, 0, 4097, 0, ''),
+(68312, 0, 0, 0, 4097, 0, ''),
+(68313, 0, 0, 0, 4097, 0, ''),
+(68314, 0, 0, 0, 4097, 0, '');
+
+-- Waypoints
+DELETE FROM `waypoints` WHERE `entry` IN(@DARNASSIAN_ARCHER_ENTRY, @DARKSPEAR_AXE_THROWER_ENTRY);
+INSERT INTO `waypoints` (`entry`, `pointid`, `position_x`, `position_y`, `position_z`, `point_comment`) VALUES
+(@DARNASSIAN_ARCHER_ENTRY, 1, -334.99, 968.724, 54.284, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 2, -332.945, 976.655, 54.2957, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 3, -329.261, 988.924, 54.3038, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 4, -322.755, 1002.57, 54.2993, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 5, -316.731, 1015.21, 54.2947, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 6, -308.524, 1019.75, 54.2763, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 7, -296.914, 1021.11, 54.3091, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 8, -283.465, 1025.01, 54.3014, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 9, -273.568, 1036.39, 54.3263, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 10, -264.833, 1054.17, 54.3152, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 11, -263.071, 1071.34, 54.3081, 'Alliance - Stair of Destiny'),
+(@DARNASSIAN_ARCHER_ENTRY, 12, -262.876, 1108.63, 41.666, 'Alliance - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 1, -163.282, 972.931, 54.2865, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 2, -167.265, 987.781, 54.3042, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 3, -170.451, 998.956, 54.2921, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 4, -177.333, 1012.5, 54.2872, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 5, -189.116, 1020.06, 54.2777, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 6, -206.5, 1022.07, 54.3103, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 7, -220.28, 1024.54, 54.3101, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 8, -228.761, 1035.68, 54.326, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 9, -233.435, 1046.39, 54.3183, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 10, -236.363, 1058.87, 54.3133, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 11, -236.71, 1072.11, 54.3082, 'Horde - Stair of Destiny'),
+(@DARKSPEAR_AXE_THROWER_ENTRY, 12, -236.72, 1106.10, 41.6667, 'Horde - Stair of Destiny');
+
+UPDATE `creature_template` SET `AIName`='SmartAI', `ScriptName`='' WHERE `entry` IN (18968, 18967);
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18968, 18967) AND `source_type`=0;
+DELETE FROM `smart_scripts` WHERE `entryorguid` IN (1896800,1896801,1896802,1896803, 1896700, 1896701, 1896702, 1896703) AND `source_type`=9;
+INSERT INTO `smart_scripts` VALUES
+(18968, 0, 0, 0, 1, 0, 100, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Horde Portal Invisible Stalker - Ooc - Set active'),
+(18968, 0, 1, 0, 1, 0, 100, 0, 150000, 150000, 25000, 25000, 87, 1896800, 1896801, 1896802, 1896803, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Horde Portal Invisible Stalker - Ooc - Random action list'),
+(1896800, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @UNDERCITY_MAGE_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Horde Portal Invisible Stalker - Action list - Summon'),
+(1896801, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @ORGRIMMAR_SHAMAN_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Horde Portal Invisible Stalker - Action list - Summon'),
+(1896802, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @ORGRIMMAR_GRUNT_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Horde Portal Invisible Stalker - Action list - Summon'),
+(1896803, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @DARKSPEAR_AXE_THROWER_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Horde Portal Invisible Stalker - Action list - Summon'),
+(18967, 0, 0, 0, 1, 0, 100, 1, 0, 0, 0, 0, 48, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Alliance Portal Invisible Stalker - Ooc - Set active'),
+(18967, 0, 1, 0, 1, 0, 100, 0, 150000, 150000, 25000, 25000, 87, 1896700, 1896701, 1896702, 1896703, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Alliance Portal Invisible Stalker - Ooc - Random action list'),
+(1896700, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @STORMWIND_MAGE_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Alliance Portal Invisible Stalker - Action list - Summon'),
+(1896701, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @STORMWIND_SOLDIER_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Alliance Portal Invisible Stalker - Action list - Summon'),
+(1896702, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @IRONFORGE_PALADIN_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Alliance Portal Invisible Stalker - Action list - Summon'),
+(1896703, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, @DARNASSIAN_ARCHER_ENTRY, 3, 180000, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Dark Assault Alliance Portal Invisible Stalker - Action list - Summon');
diff --git a/sql/updates/world/3.3.5/2016_11_14_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_14_00_world_335.sql
new file mode 100644
index 00000000000..95112247b84
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_14_00_world_335.sql
@@ -0,0 +1,3 @@
+-- Stillpine Ancestor Akida & Stillpine Ancestor Coo
+UPDATE `creature_template` SET `speed_walk`= 0.6666666, `speed_run` = 0.9285714 WHERE `entry` = 17379;
+UPDATE `creature_template` SET `speed_walk` = 0.6666666, `speed_run` = 0.8571428 WHERE `entry` = 17391;
diff --git a/sql/updates/world/3.3.5/2016_11_15_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_15_00_world_335.sql
new file mode 100644
index 00000000000..a3baf21d63a
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_15_00_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId`=15286;
diff --git a/sql/updates/world/3.3.5/2016_11_15_01_world.sql b/sql/updates/world/3.3.5/2016_11_15_01_world.sql
new file mode 100644
index 00000000000..5e35b61e237
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_15_01_world.sql
@@ -0,0 +1,108 @@
+--
+UPDATE `creature` SET `MovementType`=0, `spawndist`=0 WHERE `id`=22340;
+UPDATE `creature_template` SET `InhabitType`=4 WHERE `entry`=22340;
+
+SET @Egg :=185211;
+UPDATE `gameobject_template` SET `AIName`='' WHERE `entry` IN (@Egg);
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Egg*100 AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Egg*100+1 AND `source_type`=9;
+DELETE FROM `smart_scripts` WHERE `entryorguid`=@Egg AND `source_type`=1;
+
+DELETE FROM `pool_template` WHERE `entry` BETWEEN 11639 AND 11656;
+INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES
+(11639,1,"Cursed Egg#1"),
+(11640,1,"Cursed Egg#2"),
+(11641,1,"Cursed Egg#3"),
+(11642,1,"Cursed Egg#4"),
+(11643,1,"Cursed Egg#5"),
+(11644,1,"Cursed Egg#6"),
+(11645,1,"Cursed Egg#7"),
+(11646,1,"Cursed Egg#8"),
+(11647,1,"Cursed Egg#9"),
+(11648,1,"Cursed Egg#10"),
+(11649,1,"Cursed Egg#11"),
+(11650,1,"Cursed Egg#12"),
+(11651,1,"Cursed Egg#13"),
+(11652,1,"Cursed Egg#14"),
+(11653,1,"Cursed Egg#15"),
+(11654,1,"Cursed Egg#16"),
+(11655,1,"Cursed Egg#17"),
+(11656,1,"Cursed Egg#18");
+
+DELETE FROM `pool_gameobject` WHERE `guid` IN (26093,9683,26094,9681, 26095,9674, 26096,9676,26097,9672,165990,9671,9666, 9673,9667,9677,9668, 9678,9669,9680,9670,9679,9675,9682,9684,9685,9686,9687,9688,9689,9690,9691,9692,9693,9694,9695);
+INSERT INTO `pool_gameobject` (`guid`, `pool_entry`, `description`) VALUES
+(26093, 11639, "Cursed Egg #1"),
+(9683, 11639, "Cursed Egg #1"),
+(26094, 11640, "Cursed Egg #2"),
+(9681, 11640, "Cursed Egg #2"),
+(26095, 11641, "Cursed Egg #3"),
+(9674, 11641, "Cursed Egg #3"),
+(26096, 11642, "Cursed Egg #4"),
+(9676, 11642, "Cursed Egg #4"),
+(26097, 11643, "Cursed Egg #5"),
+(9672, 11643, "Cursed Egg #5"),
+(165990, 11644, "Cursed Egg #6"),
+(9671, 11644, "Cursed Egg #6"),
+(9666, 11645, "Cursed Egg #7"),
+(9673, 11645, "Cursed Egg #7"),
+(9667, 11646, "Cursed Egg #8"),
+(9677, 11646, "Cursed Egg #8"),
+(9668, 11647, "Cursed Egg #9"),
+(9678, 11647, "Cursed Egg #9"),
+(9669, 11648, "Cursed Egg #10"),
+(9680, 11648, "Cursed Egg #10"),
+(9670, 11649, "Cursed Egg #11"),
+(9679, 11649, "Cursed Egg #11"),
+(9675, 11650, "Cursed Egg #12"),
+(9682, 11650, "Cursed Egg #12"),
+(9684, 11651, "Cursed Egg #13"),
+(9685, 11651, "Cursed Egg #13"),
+(9686, 11652, "Cursed Egg #14"),
+(9687, 11652, "Cursed Egg #14"),
+(9688, 11653, "Cursed Egg #15"),
+(9689, 11653, "Cursed Egg #15"),
+(9690, 11654, "Cursed Egg #16"),
+(9691, 11654, "Cursed Egg #16"),
+(9692, 11655, "Cursed Egg #17"),
+(9693, 11655, "Cursed Egg #17"),
+(9694, 11656, "Cursed Egg #18"),
+(9695, 11656, "Cursed Egg #18");
+
+DELETE FROM `gameobject` WHERE `id` IN (185210,185211);
+INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `VerifiedBuild`) VALUES
+(26093, 185210, 530, 0, 0, 1, 1, -3550.77, 5709.02, 0.0407527, 1.12387, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9683, 185211, 530, 0, 0, 1, 1, -3550.77, 5709.02, 0.0407527, 1.12387, 0, 0, 0.532825, 0.846226, 180, 100, 1, 0),
+(26094, 185210, 530, 0, 0, 1, 1, -3568.11, 5772.55, -3.02607, 3.46437, 0, 0, 0.987005, -0.160689, 180, 100, 1, 0),
+(9681, 185211, 530, 0, 0, 1, 1, -3568.11, 5772.55, -3.02607, 3.46437, 0, 0, 0.987005, -0.160689, 180, 100, 1, 0),
+(26095, 185210, 530, 0, 0, 1, 1, -3674.04, 5709.53, -0.753326, 0.0958021, 0, 0, 0.0478827, 0.998853, 180, 100, 1, 0),
+(9674, 185211, 530, 0, 0, 1, 1, -3674.04, 5709.53, -0.753326, 0.0958021, 0, 0, 0.0478827, 0.998853, 180, 100, 1, 0),
+(26096, 185210, 530, 0, 0, 1, 1, -3669.77, 5715.84, -1.06872, 1.11918, 0, 0, 0.530837, 0.847474, 180, 100, 1, 0),
+(9676, 185211, 530, 0, 0, 1, 1, -3669.77, 5715.84, -1.06872, 1.11918, 0, 0, 0.530839, 0.847473, 180, 100, 1, 0),
+(26097, 185210, 530, 0, 0, 1, 1, -3692.92, 5728.49, -1.08262, 6.04755, 0, 0, 0.117545, -0.993068, 180, 100, 1, 0),
+(9672, 185211, 530, 0, 0, 1, 1, -3692.92, 5728.49, -1.08262, 6.04755, 0, 0, 0.117545, -0.993068, 180, 100, 1, 0),
+(165990, 185210, 530, 0, 0, 1, 1, -3687.32, 5732.72, -0.901197, 0.455512, 0, 0, 0.225792, 0.974176, 180, 100, 1, 0),
+(9671, 185211, 530, 0, 0, 1, 1, -3687.32, 5732.72, -0.901197, 0.455512, 0, 0, 0.225792, 0.974176, 180, 100, 1, 0),
+(9666, 185210, 530, 0, 0, 1, 1, -3678.76, 5733.7, -1.00135, 0.73039, 0, 0, 0.357131, 0.934054, 180, 100, 1, 0),
+(9673, 185211, 530, 0, 0, 1, 1, -3678.76, 5733.7, -1.00135, 0.73039, 0, 0, 0.357131, 0.934054, 180, 100, 1, 0),
+(9667, 185210, 530, 0, 0, 1, 1, -3660.27, 5810.96, 0.0255844, 5.41215, 0, 0, 0.421881, -0.906651, 180, 100, 1, 0),
+(9677, 185211, 530, 0, 0, 1, 1, -3660.27, 5810.96, 0.0255844, 5.41215, 0, 0, 0.42188, -0.906652, 180, 100, 1, 0),
+(9668, 185210, 530, 0, 0, 1, 1, -3639.24, 5831.28, 0.0740742, 0.067508, 0, 0, 0.0337476, 0.99943, 180, 100, 1, 0),
+(9678, 185211, 530, 0, 0, 1, 1, -3639.24, 5831.28, 0.0740742, 0.067508, 0, 0, 0.0337476, 0.99943, 180, 100, 1, 0),
+(9669, 185210, 530, 0, 0, 1, 1, -3568.88, 5808.19, -3.25185, 3.96701, 0, 0, 0.916037, -0.401094, 180, 100, 1, 0),
+(9680, 185211, 530, 0, 0, 1, 1, -3568.88, 5808.19, -3.25185, 3.96701, 0, 0, 0.916038, -0.401092, 180, 100, 1, 0),
+(9670, 185210, 530, 0, 0, 1, 1, -3579.48, 5817.77, -3.262, 2.74573, 0, 0, 0.980476, 0.19664, 180, 100, 1, 0),
+(9679, 185211, 530, 0, 0, 1, 1, -3579.48, 5817.77, -3.262, 2.74573, 0, 0, 0.980475, 0.196642, 180, 100, 1, 0),
+(9675, 185210, 530, 0, 0, 1, 1, -3560.05, 5771.58, -3.12615, -0.506145, 0, 0, 0.25038, -0.968148, 180, 100, 1, 0),
+(9682, 185211, 530, 0, 0, 1, 1, -3560.05, 5771.58, -3.12615, -0.506145, 0, 0, -0.25038, 0.968148, 180, 100, 1, 0),
+(9684, 185210, 530, 0, 0, 1, 1, -3624.428467, 5782.358, 1.242, 0.590728, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9685, 185211, 530, 0, 0, 1, 1, -3624.428467, 5782.358, 1.242, 0.590728, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9686, 185210, 530, 0, 0, 1, 1, -3620.726318, 5759.633, 1.737, 5.295265, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9687, 185211, 530, 0, 0, 1, 1, -3620.726318, 5759.633, 1.737, 5.295265, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9688, 185210, 530, 0, 0, 1, 1, -3625.974121, 5752.484, 1.734, 5.118557, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9689, 185211, 530, 0, 0, 1, 1, -3625.974121, 5752.484, 1.734, 5.118557, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9690, 185210, 530, 0, 0, 1, 1, -3663.873779, 5836.516, 0.083, 5.197107, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9691, 185211, 530, 0, 0, 1, 1, -3663.873779, 5836.516, 0.083, 5.197107, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9692, 185210, 530, 0, 0, 1, 1, -3680.917725, 5833.584, 0.515, 5.452358, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9693, 185211, 530, 0, 0, 1, 1, -3680.917725, 5833.584, 0.515, 5.452358, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9694, 185210, 530, 0, 0, 1, 1,-3538.941, 5702.7041, 1.0183, 0.629442, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0),
+(9695, 185211, 530, 0, 0, 1, 1,-3538.941, 5702.7041, 1.0183, 0.629442, 0, 0, 0.532824, 0.846226, 180, 100, 1, 0);
diff --git a/sql/updates/world/3.3.5/2016_11_18_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_18_00_world_335.sql
new file mode 100644
index 00000000000..f37ce0b4df5
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_18_00_world_335.sql
@@ -0,0 +1,10 @@
+DELETE FROM `spell_proc` WHERE `SpellId` IN (17670,50908,58501,-1120);
+INSERT INTO `spell_proc` (`SpellId`, `AttributesMask`) VALUES
+(17670, 0x10), -- Argent Dawn Commission
+(50908, 0x20), -- Seal of Onslaught
+(58501, 0x40), -- Iron Boot Flask
+(-1120, 0x01|0x40); -- Drain Soul
+
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x10 WHERE `SpellId`= 34827; -- Water Shield
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x20 WHERE `SpellId`=-52795; -- Borrowed Time
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x20 WHERE `SpellId`=-63156; -- Decimation
diff --git a/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql b/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql
new file mode 100644
index 00000000000..ae32a91d4d1
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_19_00_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId` IN (71406,71545); -- Anger Capacitor
diff --git a/sql/updates/world/3.3.5/2016_11_19_01_world_335.sql b/sql/updates/world/3.3.5/2016_11_19_01_world_335.sql
new file mode 100644
index 00000000000..2666b0984d8
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_19_01_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId`=-53486; -- Art of War
diff --git a/sql/updates/world/3.3.5/2016_11_19_02_world_335.sql b/sql/updates/world/3.3.5/2016_11_19_02_world_335.sql
new file mode 100644
index 00000000000..dcf5398dfea
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_19_02_world_335.sql
@@ -0,0 +1 @@
+UPDATE `spell_proc` SET `SpellFamilyMask0`=0x0280A010, `SpellFamilyMask1`=0x00002402, `SpellFamilyMask2`=0x00000008 WHERE `SpellId`=15286;
diff --git a/sql/updates/world/3.3.5/2016_11_20_00_world.sql b/sql/updates/world/3.3.5/2016_11_20_00_world.sql
new file mode 100644
index 00000000000..2326ec439a0
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_20_00_world.sql
@@ -0,0 +1,2 @@
+--
+UPDATE `creature_template` SET `InhabitType`=8 WHERE `entry`=27714;
diff --git a/sql/updates/world/3.3.5/2016_11_20_01_world.sql b/sql/updates/world/3.3.5/2016_11_20_01_world.sql
new file mode 100644
index 00000000000..e93887bedc7
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_20_01_world.sql
@@ -0,0 +1,7 @@
+--
+DELETE FROM `conditions` WHERE (`SourceTypeOrReferenceId`=16 AND `SourceEntry`=29709);
+INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
+(16,0,29709,0,0,23,0,4422,0,0,0,0,'','Dismount player when not in intended zone'),
+(16,0,29709,0,1,23,0,4535,0,0,0,0,'','Dismount player when not in intended zone'),
+(16,0,29709,0,2,23,0,4437,0,0,0,0,'','Dismount player when not in intended zone'),
+(16,0,29709,0,3,23,0,4438,0,0,0,0,'','Dismount player when not in intended zone');
diff --git a/sql/updates/world/3.3.5/2016_11_20_02_world.sql b/sql/updates/world/3.3.5/2016_11_20_02_world.sql
new file mode 100644
index 00000000000..e0f92357706
--- /dev/null
+++ b/sql/updates/world/3.3.5/2016_11_20_02_world.sql
@@ -0,0 +1,899 @@
+-- Dragonmaw Sky Stalker (NPC ID 23030) GUID 53827-53916 + 54254-54262
+-- Dragonmaw Wind Reaver (NPC ID 23330) GUID 12737-12740
+
+-- recycling GUIDs for current creatures:
+SET @CGUID := 53827;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=748.5817,`position_y`=926.8765,`position_z`=169.7075 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,748.5817,926.8765,169.7075,0,0,0,0,100,0),
+(@PATH,2,754.8384,949.9673,169.7075,0,0,0,0,100,0),
+(@PATH,3,743.052,964.9089,169.7075,0,0,0,0,100,0),
+(@PATH,4,709.5197,973.5267,169.7075,0,0,0,0,100,0),
+(@PATH,5,687.2907,969.5494,169.7075,0,0,0,0,100,0),
+(@PATH,6,653.5486,953.9686,169.7075,0,0,0,0,100,0),
+(@PATH,7,641.8157,913.1547,169.7075,0,0,0,0,100,0),
+(@PATH,8,636.5085,871.3954,169.7075,0,0,0,0,100,0),
+(@PATH,9,630.541,836.1695,169.7075,0,0,0,0,100,0),
+(@PATH,10,627.7165,804.2263,169.7075,0,0,0,0,100,0),
+(@PATH,11,625.0752,770.7723,169.7075,0,0,0,0,100,0),
+(@PATH,12,624.6312,725.1182,169.7075,0,0,0,0,100,0),
+(@PATH,13,643.8918,687.4643,169.7075,0,0,0,0,100,0),
+(@PATH,14,675.7663,683.7708,169.7075,0,0,0,0,100,0),
+(@PATH,15,712.8825,695.7303,169.7075,0,0,0,0,100,0),
+(@PATH,16,747.5607,704.7095,169.7075,0,0,0,0,100,0),
+(@PATH,17,762.9872,733.2521,169.7075,0,0,0,0,100,0),
+(@PATH,18,768.9691,762.2154,169.7075,0,0,0,0,100,0),
+(@PATH,19,763.5071,809.0665,169.7075,0,0,0,0,100,0),
+(@PATH,20,760.3749,843.4251,169.7075,0,0,0,0,100,0),
+(@PATH,21,751.462,892.9752,169.7075,0,0,0,0,100,0),
+(@PATH,22,748.5466,920.3238,169.7075,0,0,0,0,100,0),
+(@PATH,23,748.5817,926.8765,169.7075,0,0,0,0,100,0),
+(@PATH,24,754.8384,949.9673,169.7075,0,0,0,0,100,0);
+
+SET @CGUID := 53828;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=721.9486,`position_y`=665.284,`position_z`=171.9325 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,721.9486,665.284,171.9325,0,0,0,0,100,0),
+(@PATH,2,764.4177,663.7574,171.9325,0,0,0,0,100,0),
+(@PATH,3,791.3472,677.6638,171.9325,0,0,0,0,100,0),
+(@PATH,4,797.7083,699.2236,171.9325,0,0,0,0,100,0),
+(@PATH,5,792.8513,723.0785,171.9325,0,0,0,0,100,0),
+(@PATH,6,776.4136,740.0793,171.9325,0,0,0,0,100,0),
+(@PATH,7,766.1145,768.3846,171.9325,0,0,0,0,100,0),
+(@PATH,8,782.2069,796.3889,171.9325,0,0,0,0,100,0),
+(@PATH,9,787.843,820.4999,171.9325,0,0,0,0,100,0),
+(@PATH,10,797.8959,851.5565,171.9325,0,0,0,0,100,0),
+(@PATH,11,777.1003,864.2474,171.9325,0,0,0,0,100,0),
+(@PATH,12,748.3235,868.2767,171.9325,0,0,0,0,100,0),
+(@PATH,13,727.6926,872.5922,171.9325,0,0,0,0,100,0),
+(@PATH,14,692.7877,878.8469,171.9325,0,0,0,0,100,0),
+(@PATH,15,676.4932,879.4951,171.9325,0,0,0,0,100,0),
+(@PATH,16,656.9288,879.4467,171.9325,0,0,0,0,100,0),
+(@PATH,17,643.9807,862.0121,171.9325,0,0,0,0,100,0),
+(@PATH,18,642.1204,827.2074,171.9325,0,0,0,0,100,0),
+(@PATH,19,634.3268,781.412,171.9325,0,0,0,0,100,0),
+(@PATH,20,637.8225,745.1819,171.9325,0,0,0,0,100,0),
+(@PATH,21,661.7581,705.3063,171.9325,0,0,0,0,100,0),
+(@PATH,22,684.738,681.9153,171.9325,0,0,0,0,100,0),
+(@PATH,23,716.7581,667.9764,171.9325,0,0,0,0,100,0);
+
+SET @CGUID := 53829;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=639.2408,`position_y`=817.2838,`position_z`=96.00954 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,639.2408,817.2838,96.00954,0,0,0,0,100,0),
+(@PATH,2,637.0174,831.9658,94.81514,0,0,0,0,100,0),
+(@PATH,3,630.5756,845.7454,91.42623,0,0,0,0,100,0),
+(@PATH,4,617.9464,853.2907,88.20402,0,0,0,0,100,0),
+(@PATH,5,598.8134,854.8987,92.45403,0,0,0,0,100,0),
+(@PATH,6,586.3024,847.9394,90.48181,0,0,0,0,100,0),
+(@PATH,7,581.6896,830.243,90.87068,0,0,0,0,100,0),
+(@PATH,8,582.2021,803.4702,93.59291,0,0,0,0,100,0),
+(@PATH,9,582.4189,778.6371,92.33733,0,0,0,0,100,0),
+(@PATH,10,588.5067,762.3616,95.83994,0,0,0,0,100,0),
+(@PATH,11,591.8719,745.3989,101.1524,0,0,0,0,100,0),
+(@PATH,12,592.076,730.4387,102.1415,0,0,0,0,100,0),
+(@PATH,13,604.0575,721.923,106.0203,0,0,0,0,100,0),
+(@PATH,14,619.384,726.6072,103.7703,0,0,0,0,100,0),
+(@PATH,15,631.0529,741.9111,101.1036,0,0,0,0,100,0),
+(@PATH,16,633.0304,762.1757,96.46471,0,0,0,0,100,0),
+(@PATH,17,630.8676,783.9254,95.29805,0,0,0,0,100,0),
+(@PATH,18,635.1721,806.4858,96.52027,0,0,0,0,100,0),
+(@PATH,19,639.1043,815.7457,96.02027,0,0,0,0,100,0);
+
+SET @CGUID := 53830;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=648.7271,`position_y`=732.1752,`position_z`=170.7075 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,648.7271,732.1752,170.7075,0,0,0,0,100,0),
+(@PATH,2,652.2249,720.286,170.7075,0,0,0,0,100,0),
+(@PATH,3,652.2249,720.286,170.7075,0,0,0,0,100,0),
+(@PATH,4,657.8307,709.1823,170.7075,0,0,0,0,100,0),
+(@PATH,5,658.5453,707.557,170.7075,0,0,0,0,100,0),
+(@PATH,6,663.7322,707.6018,170.7075,0,0,0,0,100,0),
+(@PATH,7,676.2772,709.3177,170.7075,0,0,0,0,100,0),
+(@PATH,8,690.5971,714.3631,170.7075,0,0,0,0,100,0),
+(@PATH,9,710.9605,721.0316,170.7075,0,0,0,0,100,0),
+(@PATH,10,729.6195,724.2315,170.7075,0,0,0,0,100,0),
+(@PATH,11,732.2808,724.4777,170.7075,0,0,0,0,100,0),
+(@PATH,12,735.2756,730.3159,170.7075,0,0,0,0,100,0),
+(@PATH,13,740.9436,745.7593,170.7075,0,0,0,0,100,0),
+(@PATH,14,743.6251,756.2307,170.7075,0,0,0,0,100,0),
+(@PATH,15,743.6556,768.592,170.7075,0,0,0,0,100,0),
+(@PATH,16,741.5312,785.4241,170.7075,0,0,0,0,100,0),
+(@PATH,17,738.9528,803.7255,170.7075,0,0,0,0,100,0),
+(@PATH,18,737.3602,822.2095,170.7075,0,0,0,0,100,0),
+(@PATH,19,735.9527,837.5167,170.7075,0,0,0,0,100,0),
+(@PATH,20,733.3319,853.4462,170.7075,0,0,0,0,100,0),
+(@PATH,21,729.8102,871.9895,170.7075,0,0,0,0,100,0),
+(@PATH,22,730.9515,865.6296,170.7075,0,0,0,0,100,0),
+(@PATH,23,734.9578,869.7712,170.5201,0,0,0,0,100,0),
+(@PATH,24,739.7133,883.8173,170.246,0,0,0,0,100,0),
+(@PATH,25,742.371,898.1652,170.0699,0,0,0,0,100,0),
+(@PATH,26,730.4334,945.2024,170.7075,0,0,0,0,100,0),
+(@PATH,27,731.9338,942.5042,170.7075,0,0,0,0,100,0),
+(@PATH,28,724.611,945.1463,170.7075,0,0,0,0,100,0),
+(@PATH,29,712.3275,947.9523,170.7075,0,0,0,0,100,0),
+(@PATH,30,704.4079,948.7064,170.7075,0,0,0,0,100,0),
+(@PATH,31,698.0605,946.8328,170.7075,0,0,0,0,100,0),
+(@PATH,32,683.9213,942.4026,170.7075,0,0,0,0,100,0),
+(@PATH,33,674.265,938.8467,170.7075,0,0,0,0,100,0),
+(@PATH,34,673.0928,938.3848,170.7075,0,0,0,0,100,0),
+(@PATH,35,671.2271,933.4547,170.7075,0,0,0,0,100,0),
+(@PATH,36,668.699,921.3985,170.7075,0,0,0,0,100,0),
+(@PATH,37,666.0173,906.6799,170.7075,0,0,0,0,100,0),
+(@PATH,38,664.2043,894.2822,170.7075,0,0,0,0,100,0),
+(@PATH,39,662.7593,880.3667,170.7075,0,0,0,0,100,0),
+(@PATH,40,663.3392,885.2729,170.7075,0,0,0,0,100,0),
+(@PATH,41,659.9514,883.8571,170.5794,0,0,0,0,100,0),
+(@PATH,42,655.9943,837.4919,170.7075,0,0,0,0,100,0),
+(@PATH,43,654.4485,825.1205,170.7075,0,0,0,0,100,0),
+(@PATH,44,653.3726,811.8262,170.7075,0,0,0,0,100,0),
+(@PATH,45,652.2186,797.4872,170.7075,0,0,0,0,100,0),
+(@PATH,46,650.9856,784.2934,170.7075,0,0,0,0,100,0),
+(@PATH,47,650.086,770.5377,170.7075,0,0,0,0,100,0),
+(@PATH,48,649.1042,756.0231,170.7075,0,0,0,0,100,0),
+(@PATH,49,648.2772,742.78,170.7075,0,0,0,0,100,0);
+
+SET @CGUID := 53831;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=728.1078,`position_y`=846.9943,`position_z`=172.9326 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,728.1078,846.9943,172.9326,0,0,0,0,100,0),
+(@PATH,2,710.9005,850.3428,172.9325,0,0,0,0,100,0),
+(@PATH,3,693.0854,853.5267,172.9326,0,0,0,0,100,0),
+(@PATH,4,680.7529,854.5162,172.9326,0,0,0,0,100,0),
+(@PATH,5,663.3484,855.7787,172.9326,0,0,0,0,100,0),
+(@PATH,6,669.0896,857.5624,172.9326,0,0,0,0,100,0),
+(@PATH,7,667.8973,854.1387,172.9325,0,0,0,0,100,0),
+(@PATH,8,667.7648,838.8507,172.9325,0,0,0,0,100,0),
+(@PATH,9,665.7653,816.3873,172.9326,0,0,0,0,100,0),
+(@PATH,10,662.0288,797.6625,172.9325,0,0,0,0,100,0),
+(@PATH,11,659.4796,782.4767,172.9325,0,0,0,0,100,0),
+(@PATH,12,658.9075,767.8063,172.9325,0,0,0,0,100,0),
+(@PATH,13,660.2582,757.0905,172.9325,0,0,0,0,100,0),
+(@PATH,14,664.7323,746.3156,172.9325,0,0,0,0,100,0),
+(@PATH,15,673.1578,732.4761,172.9325,0,0,0,0,100,0),
+(@PATH,16,682.3874,719.4611,172.9326,0,0,0,0,100,0),
+(@PATH,17,691.6407,708.4307,172.9326,0,0,0,0,100,0),
+(@PATH,18,699.9095,701.9017,172.9325,0,0,0,0,100,0),
+(@PATH,19,714.087,695.7488,172.9325,0,0,0,0,100,0),
+(@PATH,20,731.1124,644.1501,172.9325,0,0,0,0,100,0),
+(@PATH,21,718.0795,676.7922,172.9325,0,0,0,0,100,0),
+(@PATH,22,745.0221,688.3293,172.9325,0,0,0,0,100,0),
+(@PATH,23,756.8813,688.0884,172.9325,0,0,0,0,100,0),
+(@PATH,24,763.3431,689.1867,172.9325,0,0,0,0,100,0),
+(@PATH,25,769.7626,692.1405,172.9326,0,0,0,0,100,0),
+(@PATH,26,772.9557,694.5918,172.9325,0,0,0,0,100,0),
+(@PATH,27,772.2848,694.0916,172.9325,0,0,0,0,100,0),
+(@PATH,28,772.718,701.7488,172.9325,0,0,0,0,100,0),
+(@PATH,29,771.6613,708.838,172.9325,0,0,0,0,100,0),
+(@PATH,30,771.9302,709.6787,172.9325,0,0,0,0,100,0),
+(@PATH,31,763.6402,716.6005,172.9325,0,0,0,0,100,0),
+(@PATH,32,751.5613,733.0993,172.9325,0,0,0,0,100,0),
+(@PATH,33,743.9901,749.5864,172.9326,0,0,0,0,100,0),
+(@PATH,34,741.8796,774.9808,172.9325,0,0,0,0,100,0),
+(@PATH,35,751.6147,795.4948,172.9325,0,0,0,0,100,0),
+(@PATH,36,758.7626,805.4193,172.9325,0,0,0,0,100,0),
+(@PATH,37,760.1722,809.3333,172.9325,0,0,0,0,100,0),
+(@PATH,38,762.2374,820.9478,172.9325,0,0,0,0,100,0),
+(@PATH,39,767.947,838.4155,172.9325,0,0,0,0,100,0),
+(@PATH,40,772.8404,849.8958,172.9326,0,0,0,0,100,0),
+(@PATH,41,774.2027,843.7081,172.9326,0,0,0,0,100,0),
+(@PATH,42,778.589,837.2932,172.9326,0,0,0,0,100,0),
+(@PATH,43,768.8502,840.6385,172.9325,0,0,0,0,100,0),
+(@PATH,44,760.4444,841.8875,172.9325,0,0,0,0,100,0),
+(@PATH,45,746.5559,843.2591,172.9326,0,0,0,0,100,0),
+(@PATH,46,732.4482,846.0096,172.9325,0,0,0,0,100,0);
+
+SET @CGUID := 53841;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=666.3989,`position_y`=973.1008,`position_z`=170.7075 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,666.3989,973.1008,170.7075,0,0,0,0,100,0),
+(@PATH,2,652.1188,961.1961,170.7075,0,0,0,0,100,0),
+(@PATH,3,647.2161,943.3284,170.7076,0,0,0,0,100,0),
+(@PATH,4,643.0891,926.0452,170.7075,0,0,0,0,100,0),
+(@PATH,5,640.5149,908.6226,170.7075,0,0,0,0,100,0),
+(@PATH,6,639.8064,891.3257,170.7075,0,0,0,0,100,0),
+(@PATH,7,637.1084,873.8254,170.7075,0,0,0,0,100,0),
+(@PATH,8,632.9307,857.2454,170.7075,0,0,0,0,100,0),
+(@PATH,9,630.3768,840.064,170.7075,0,0,0,0,100,0),
+(@PATH,10,629.5081,822.9091,170.7075,0,0,0,0,100,0),
+(@PATH,11,627.5027,806.3528,170.7075,0,0,0,0,100,0),
+(@PATH,12,626.5479,788.7383,170.7075,0,0,0,0,100,0),
+(@PATH,13,624.4636,771.0414,170.7075,0,0,0,0,100,0),
+(@PATH,14,620.2076,753.0712,170.7075,0,0,0,0,100,0),
+(@PATH,15,619.8459,734.4846,170.7075,0,0,0,0,100,0),
+(@PATH,16,623.0982,715.7894,170.7075,0,0,0,0,100,0),
+(@PATH,17,625.6698,694.5493,170.7075,0,0,0,0,100,0),
+(@PATH,18,640.6373,680.832,170.7075,0,0,0,0,100,0),
+(@PATH,19,658.5715,678.7152,170.7075,0,0,0,0,100,0),
+(@PATH,20,676.2325,682.0574,170.7075,0,0,0,0,100,0),
+(@PATH,21,692.0359,691.1675,170.7075,0,0,0,0,100,0),
+(@PATH,22,709.9055,694.8826,170.7075,0,0,0,0,100,0),
+(@PATH,23,730.8896,689.1498,170.7075,0,0,0,0,100,0),
+(@PATH,24,748.9811,697.7251,170.7075,0,0,0,0,100,0),
+(@PATH,25,756.1241,713.8288,170.7075,0,0,0,0,100,0),
+(@PATH,26,765.5197,728.4705,170.7075,0,0,0,0,100,0),
+(@PATH,27,770.7372,745.8633,170.7075,0,0,0,0,100,0),
+(@PATH,28,769.8888,764.3091,170.7075,0,0,0,0,100,0),
+(@PATH,29,766.7514,781.8798,170.7075,0,0,0,0,100,0),
+(@PATH,30,763.96,798.9189,170.7075,0,0,0,0,100,0),
+(@PATH,31,763.9962,815.9862,170.7075,0,0,0,0,100,0),
+(@PATH,32,762.4482,833.3903,170.7075,0,0,0,0,100,0),
+(@PATH,33,759.0405,852.1,170.7075,0,0,0,0,100,0),
+(@PATH,34,755.2859,868.189,170.7075,0,0,0,0,100,0),
+(@PATH,35,756.4008,863.0829,170.6751,0,0,0,0,100,0),
+(@PATH,36,753.4927,882.025,170.2552,0,0,0,0,100,0),
+(@PATH,37,751.556,897.6622,170.067,0,0,0,0,100,0),
+(@PATH,38,762.7798,930.9296,170.7075,0,0,0,0,100,0),
+(@PATH,39,765.9858,952.0153,170.7075,0,0,0,0,100,0),
+(@PATH,40,755.5459,962.2645,170.7075,0,0,0,0,100,0),
+(@PATH,41,741.1741,968.3941,170.7075,0,0,0,0,100,0),
+(@PATH,42,727.6735,975.328,170.7075,0,0,0,0,100,0),
+(@PATH,43,713.403,978.6857,170.7075,0,0,0,0,100,0),
+(@PATH,44,700.6663,973.5411,170.7075,0,0,0,0,100,0),
+(@PATH,45,685.0948,972.5025,170.7075,0,0,0,0,100,0);
+
+SET @CGUID := 53842;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=821.8317,`position_y`=858.8041,`position_z`=172.9325 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,821.8317,858.8041,172.9325,0,0,0,0,100,0),
+(@PATH,2,770.4988,891.0805,172.9325,0,0,0,0,100,0),
+(@PATH,3,770.4988,891.0805,172.9325,0,0,0,0,100,0),
+(@PATH,4,753.2192,892.814,172.9325,0,0,0,0,100,0),
+(@PATH,5,738.7772,895.8427,172.9326,0,0,0,0,100,0),
+(@PATH,6,720.1701,899.476,172.9325,0,0,0,0,100,0),
+(@PATH,7,700.9869,902.8984,172.9326,0,0,0,0,100,0),
+(@PATH,8,679.7096,904.5053,172.9326,0,0,0,0,100,0),
+(@PATH,9,661.8425,905.756,172.9326,0,0,0,0,100,0),
+(@PATH,10,629.1461,887.6377,172.9326,0,0,0,0,100,0),
+(@PATH,11,618.1265,858.9202,172.9325,0,0,0,0,100,0),
+(@PATH,12,617.7658,839.1631,172.9325,0,0,0,0,100,0),
+(@PATH,13,616.5134,825.0038,172.9326,0,0,0,0,100,0),
+(@PATH,14,613.0281,807.6089,172.9325,0,0,0,0,100,0),
+(@PATH,15,609.7328,787.5037,172.9325,0,0,0,0,100,0),
+(@PATH,16,608.9132,767.0515,172.9325,0,0,0,0,100,0),
+(@PATH,17,611.9686,744.125,172.9325,0,0,0,0,100,0),
+(@PATH,18,620.601,722.812,172.9325,0,0,0,0,100,0),
+(@PATH,19,631.5937,704.6835,172.9325,0,0,0,0,100,0),
+(@PATH,20,642.3316,689.5355,172.9326,0,0,0,0,100,0),
+(@PATH,21,656.503,672.859,172.9326,0,0,0,0,100,0),
+(@PATH,22,674.9702,658.5654,172.9325,0,0,0,0,100,0),
+(@PATH,23,696.5784,648.9145,172.9325,0,0,0,0,100,0),
+(@PATH,24,706.4659,687.6536,172.9325,0,0,0,0,100,0),
+(@PATH,25,699.3428,673.4842,172.9325,0,0,0,0,100,0),
+(@PATH,26,741.9863,638.4216,172.9325,0,0,0,0,100,0),
+(@PATH,27,759.079,638.1368,172.9325,0,0,0,0,100,0),
+(@PATH,28,778.3642,641.4964,172.9325,0,0,0,0,100,0),
+(@PATH,29,796.3674,649.8063,172.9326,0,0,0,0,100,0),
+(@PATH,30,810.8141,661.9307,172.9325,0,0,0,0,100,0),
+(@PATH,31,821.5836,685.7474,172.9325,0,0,0,0,100,0),
+(@PATH,32,822.6885,703.4628,172.9325,0,0,0,0,100,0),
+(@PATH,33,819.8553,722.1548,172.9325,0,0,0,0,100,0),
+(@PATH,34,808.7045,743.5558,172.9325,0,0,0,0,100,0),
+(@PATH,35,797.7748,753.1358,172.9325,0,0,0,0,100,0),
+(@PATH,36,795.1656,757.567,172.9325,0,0,0,0,100,0),
+(@PATH,37,791.3923,765.4935,172.9326,0,0,0,0,100,0),
+(@PATH,38,790.8031,764.6614,172.9325,0,0,0,0,100,0),
+(@PATH,39,792.4973,766.709,172.9325,0,0,0,0,100,0),
+(@PATH,40,801.1123,778.8392,172.9325,0,0,0,0,100,0),
+(@PATH,41,808.95,798.3457,172.9325,0,0,0,0,100,0),
+(@PATH,42,811.208,810.8542,172.9325,0,0,0,0,100,0),
+(@PATH,43,813.7809,818.4341,172.9325,0,0,0,0,100,0),
+(@PATH,44,820.0312,833.3722,172.9326,0,0,0,0,100,0);
+
+SET @CGUID := 53843;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=706.2591,`position_y`=879.9013,`position_z`=85.68813 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,706.2591,879.9013,85.68813,0,0,0,0,100,0),
+(@PATH,2,687.0418,872.5399,81.68005,0,0,0,0,100,0),
+(@PATH,3,672.4034,852.6266,80.60835,0,0,0,0,100,0),
+(@PATH,4,664.3254,823.0761,90.13865,0,0,0,0,100,0),
+(@PATH,5,675.2798,803.8729,91.80936,0,0,0,0,100,0),
+(@PATH,6,683.4824,782.0359,90.15625,0,0,0,0,100,0),
+(@PATH,7,680.5452,754.212,91.47352,0,0,0,0,100,0),
+(@PATH,8,687.6937,739.1242,94.63132,0,0,0,0,100,0),
+(@PATH,9,709.887,737.9406,97.90912,0,0,0,0,100,0),
+(@PATH,10,722.275,749.9312,99.65911,0,0,0,0,100,0),
+(@PATH,11,720.2606,768.6862,92.71466,0,0,0,0,100,0),
+(@PATH,12,720.647,783.9854,88.32578,0,0,0,0,100,0),
+(@PATH,13,720.858,796.5645,87.04801,0,0,0,0,100,0),
+(@PATH,14,731.3468,814.0711,81.68689,0,0,0,0,100,0),
+(@PATH,15,731.7731,831.5212,90.96468,0,0,0,0,100,0),
+(@PATH,16,734.43,855.3979,87.65915,0,0,0,0,100,0),
+(@PATH,17,717.5137,875.2517,88.3258,0,0,0,0,100,0),
+(@PATH,18,708.2299,879.131,86.40916,0,0,0,0,100,0);
+
+SET @CGUID := 53907;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=714.4265,`position_y`=888.9312,`position_z`=84.42062 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,714.4265,888.9312,84.42062,0,0,0,0,100,0),
+(@PATH,2,694.9776,884.7676,81.40375,0,0,0,0,100,0),
+(@PATH,3,680.8666,872.6392,82.26455,0,0,0,0,100,0),
+(@PATH,4,671.0353,857.2063,88.03369,0,0,0,0,100,0),
+(@PATH,5,654.3708,839.1426,92.26675,0,0,0,0,100,0),
+(@PATH,6,665.0302,825.1126,92.79195,0,0,0,0,100,0),
+(@PATH,7,676.2831,811.0319,91.35089,0,0,0,0,100,0),
+(@PATH,8,686.8073,793.7155,91.44858,0,0,0,0,100,0),
+(@PATH,9,677.3999,776.6302,92.74747,0,0,0,0,100,0),
+(@PATH,10,665.7012,748.0738,95.86366,0,0,0,0,100,0),
+(@PATH,11,681.8578,733.5118,98.44994,0,0,0,0,100,0),
+(@PATH,12,707.1171,725.1872,100.8751,0,0,0,0,100,0),
+(@PATH,13,726.8154,737.6722,96.31778,0,0,0,0,100,0),
+(@PATH,14,719.0989,754.0613,90.51482,0,0,0,0,100,0),
+(@PATH,15,713.662,771.6096,88.23598,0,0,0,0,100,0),
+(@PATH,16,716.9744,788.59,82.94994,0,0,0,0,100,0),
+(@PATH,17,733.7443,799.838,88.94534,0,0,0,0,100,0),
+(@PATH,18,727.9385,816.7637,91.30215,0,0,0,0,100,0),
+(@PATH,19,745.0323,835.8409,88.57227,0,0,0,0,100,0),
+(@PATH,20,739.6656,855.0559,89.27127,0,0,0,0,100,0),
+(@PATH,21,704.845,854.928,87.21674,0,0,0,0,100,0),
+(@PATH,22,684.8253,829.2227,61.5013,0,0,0,0,100,0),
+(@PATH,23,698.3776,886.3561,81.77051,0,0,0,0,100,0),
+(@PATH,24,684.1354,876.6398,81.37528,0,0,0,0,100,0),
+(@PATH,25,675.1725,863.7006,85.42295,0,0,0,0,100,0),
+(@PATH,26,665.3327,850.2184,90.57676,0,0,0,0,100,0),
+(@PATH,27,654.0191,831.2237,92.7365,0,0,0,0,100,0),
+(@PATH,28,666.6762,821.2208,92.56613,0,0,0,0,100,0),
+(@PATH,29,678.6386,808.9705,91.21234,0,0,0,0,100,0),
+(@PATH,30,686.7315,792.9811,91.48143,0,0,0,0,100,0),
+(@PATH,31,677.869,778.1553,92.57193,0,0,0,0,100,0),
+(@PATH,32,666.2241,754.3832,95.36311,0,0,0,0,100,0),
+(@PATH,33,676.5839,736.2492,97.78069,0,0,0,0,100,0),
+(@PATH,34,696.7589,725.5475,100.1104,0,0,0,0,100,0),
+(@PATH,35,723.6034,728.8466,99.61018,0,0,0,0,100,0),
+(@PATH,36,721.4728,743.7043,93.71843,0,0,0,0,100,0),
+(@PATH,37,720.0228,758.7482,89.37604,0,0,0,0,100,0),
+(@PATH,38,709.994,776.279,87.52052,0,0,0,0,100,0),
+(@PATH,39,718.8264,789.2113,82.73032,0,0,0,0,100,0),
+(@PATH,40,733.8046,799.5186,88.7188,0,0,0,0,100,0),
+(@PATH,41,727.3571,814.8444,91.64865,0,0,0,0,100,0),
+(@PATH,42,740.9789,830.5164,88.71099,0,0,0,0,100,0),
+(@PATH,43,743.0773,850.1363,88.99787,0,0,0,0,100,0),
+(@PATH,44,736.563,869.9094,88.69666,0,0,0,0,100,0),
+(@PATH,45,730.1244,887.3021,86.68524,0,0,0,0,100,0);
+
+SET @CGUID := 53908;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=803.3759,`position_y`=932.4915,`position_z`=184.5064 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,803.3759,932.4915,184.5064,0,0,0,0,100,0),
+(@PATH,2,811.2745,897.108,184.5064,0,0,0,0,100,0),
+(@PATH,3,791.5839,875.892,184.5064,0,0,0,0,100,0),
+(@PATH,4,752.4867,868.6232,184.5064,0,0,0,0,100,0),
+(@PATH,5,705.05,866.4859,184.5064,0,0,0,0,100,0),
+(@PATH,6,678.0823,863.4022,184.5064,0,0,0,0,100,0),
+(@PATH,7,647.4654,864.0757,184.5064,0,0,0,0,100,0),
+(@PATH,8,602.3146,860.2814,184.5064,0,0,0,0,100,0),
+(@PATH,9,586.8052,872.5957,184.5064,0,0,0,0,100,0),
+(@PATH,10,591.912,911.7775,184.5064,0,0,0,0,100,0),
+(@PATH,11,596.0889,931.6774,184.5064,0,0,0,0,100,0),
+(@PATH,12,598.1668,951.7502,184.5064,0,0,0,0,100,0),
+(@PATH,13,615.1454,963.025,184.5064,0,0,0,0,100,0),
+(@PATH,14,644.2123,963.4846,184.5064,0,0,0,0,100,0),
+(@PATH,15,685.0579,963.9983,184.5064,0,0,0,0,100,0),
+(@PATH,16,729.4773,963.7037,184.5064,0,0,0,0,100,0),
+(@PATH,17,768.8865,959.6003,184.5064,0,0,0,0,100,0),
+(@PATH,18,796.7049,938.6107,184.5064,0,0,0,0,100,0);
+
+SET @CGUID := 53909;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=770.2032,`position_y`=872.5198,`position_z`=181.6921 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,770.2032,872.5198,181.6921,0,0,0,0,100,0),
+(@PATH,2,682.4137,853.6569,185.5064,0,0,0,0,100,0),
+(@PATH,3,682.4137,853.6569,185.5064,0,0,0,0,100,0),
+(@PATH,4,664.475,853.7332,185.5064,0,0,0,0,100,0),
+(@PATH,5,647.0729,854.0455,185.5064,0,0,0,0,100,0),
+(@PATH,6,629.7476,852.1154,185.5064,0,0,0,0,100,0),
+(@PATH,7,610.3143,850.0992,185.5064,0,0,0,0,100,0),
+(@PATH,8,588.9752,853.5811,185.5064,0,0,0,0,100,0),
+(@PATH,9,576.4883,875.2385,185.5064,0,0,0,0,100,0),
+(@PATH,10,578.6465,895.5093,185.5064,0,0,0,0,100,0),
+(@PATH,11,594.9009,880.1083,185.1333,0,0,0,0,100,0),
+(@PATH,12,585.7604,930.7364,185.5064,0,0,0,0,100,0),
+(@PATH,13,586.5743,947.4635,185.5064,0,0,0,0,100,0),
+(@PATH,14,600.4178,967.5743,185.5064,0,0,0,0,100,0),
+(@PATH,15,621.386,973.9167,185.5064,0,0,0,0,100,0),
+(@PATH,16,640.011,973.4988,185.5064,0,0,0,0,100,0),
+(@PATH,17,656.649,973.6802,185.5064,0,0,0,0,100,0),
+(@PATH,18,674.64,973.9294,185.5064,0,0,0,0,100,0),
+(@PATH,19,692.6371,974.0429,185.5064,0,0,0,0,100,0),
+(@PATH,20,710.7041,974.1387,185.5064,0,0,0,0,100,0),
+(@PATH,21,728.5746,973.7606,185.5064,0,0,0,0,100,0),
+(@PATH,22,746.7885,973.1296,185.5064,0,0,0,0,100,0),
+(@PATH,23,765.8525,970.9223,185.5064,0,0,0,0,100,0),
+(@PATH,24,785.5649,961.4802,185.5064,0,0,0,0,100,0),
+(@PATH,25,800.0919,948.899,185.5064,0,0,0,0,100,0),
+(@PATH,26,794.3766,952.9479,185.5064,0,0,0,0,100,0),
+(@PATH,27,797.5428,945.5775,185.0609,0,0,0,0,100,0),
+(@PATH,28,821.4426,904.1882,185.5064,0,0,0,0,100,0),
+(@PATH,29,817.6825,885.9722,185.5064,0,0,0,0,100,0),
+(@PATH,30,805.4868,872.5649,185.5064,0,0,0,0,100,0),
+(@PATH,31,808.1692,885.2568,185.473,0,0,0,0,100,0),
+(@PATH,32,800.1074,880.7119,185.0081,0,0,0,0,100,0),
+(@PATH,33,788.5491,876.0101,184.7572,0,0,0,0,100,0);
+
+SET @CGUID := 53912;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=567.1851,`position_y`=905.5403,`position_z`=92.5407 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,567.1851,905.5403,92.5407,0,0,0,0,100,0),
+(@PATH,2,569.4642,936.606,94.2935,0,0,0,0,100,0),
+(@PATH,3,588.3549,952.4572,96.14284,0,0,0,0,100,0),
+(@PATH,4,608.7227,957.9083,95.80928,0,0,0,0,100,0),
+(@PATH,5,629.7247,959.9195,89.01039,0,0,0,0,100,0),
+(@PATH,6,656.1213,954.9207,91.62944,0,0,0,0,100,0),
+(@PATH,7,676.3627,937.7902,92.79279,0,0,0,0,100,0),
+(@PATH,8,681.174,916.6946,94.05388,0,0,0,0,100,0),
+(@PATH,9,681.3068,894.736,95.48655,0,0,0,0,100,0),
+(@PATH,10,679.3223,866.0062,97.40996,0,0,0,0,100,0),
+(@PATH,11,679.02,882.4532,96.32095,0,0,0,0,100,0),
+(@PATH,12,637.7219,843.2443,99.51648,0,0,0,0,100,0),
+(@PATH,13,580.8655,859.8029,65.21204,0,0,0,0,100,0),
+(@PATH,14,575.8312,854.2884,97.52151,0,0,0,0,100,0),
+(@PATH,15,566.8652,874.942,94.03391,0,0,0,0,100,0),
+(@PATH,16,568.5764,889.6505,91.69823,0,0,0,0,100,0);
+
+SET @CGUID := 53913;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=691.5392,`position_y`=864.4608,`position_z`=185.5064 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,691.5392,864.4608,185.5064,0,0,0,0,100,0),
+(@PATH,2,675.0435,863.1305,185.5064,0,0,0,0,100,0),
+(@PATH,3,656.5109,864.5776,185.5064,0,0,0,0,100,0),
+(@PATH,4,638.3679,863.3265,185.5064,0,0,0,0,100,0),
+(@PATH,5,619.8484,860.5443,185.5064,0,0,0,0,100,0),
+(@PATH,6,602.3466,858.1862,185.5064,0,0,0,0,100,0),
+(@PATH,7,586.8511,865.615,185.5064,0,0,0,0,100,0),
+(@PATH,8,586.6971,883.8823,185.5064,0,0,0,0,100,0),
+(@PATH,9,593.5745,878.8385,185.3436,0,0,0,0,100,0),
+(@PATH,10,593.557,918.9376,185.5064,0,0,0,0,100,0),
+(@PATH,11,595.3918,936.4067,185.5064,0,0,0,0,100,0),
+(@PATH,12,597.2048,953.8021,185.5064,0,0,0,0,100,0),
+(@PATH,13,611.8467,963.4763,185.5064,0,0,0,0,100,0),
+(@PATH,14,629.8196,963.694,185.5064,0,0,0,0,100,0),
+(@PATH,15,646.8113,963.5204,185.5064,0,0,0,0,100,0),
+(@PATH,16,664.7418,963.8286,185.5064,0,0,0,0,100,0),
+(@PATH,17,682.7177,963.963,185.5064,0,0,0,0,100,0),
+(@PATH,18,700.6793,964.1635,185.5064,0,0,0,0,100,0),
+(@PATH,19,718.1179,964.2392,185.5064,0,0,0,0,100,0),
+(@PATH,20,736.3901,963.5446,185.5064,0,0,0,0,100,0),
+(@PATH,21,753.8398,963.4592,185.5064,0,0,0,0,100,0),
+(@PATH,22,771.5734,959.4213,185.5064,0,0,0,0,100,0),
+(@PATH,23,785.9648,948.2468,185.5064,0,0,0,0,100,0),
+(@PATH,24,780.8196,951.2471,185.4631,0,0,0,0,100,0),
+(@PATH,25,793.3677,942.2335,184.8822,0,0,0,0,100,0),
+(@PATH,26,810.6142,913.2847,185.5064,0,0,0,0,100,0),
+(@PATH,27,813.7405,899.5538,185.5064,0,0,0,0,100,0),
+(@PATH,28,807.6729,886.5371,185.5064,0,0,0,0,100,0),
+(@PATH,29,808.4722,891.8398,185.4929,0,0,0,0,100,0),
+(@PATH,30,798.6889,882.6483,184.9273,0,0,0,0,100,0),
+(@PATH,31,787.9625,877.1612,184.7302,0,0,0,0,100,0),
+(@PATH,32,774.4854,873.2689,184.6191,0,0,0,0,100,0),
+(@PATH,33,740.3132,867.6484,185.5064,0,0,0,0,100,0),
+(@PATH,34,725.5665,867.2691,185.5064,0,0,0,0,100,0),
+(@PATH,35,711.9835,867.1437,185.5064,0,0,0,0,100,0);
+
+SET @CGUID := 53914;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=772.7885,`position_y`=654.1609,`position_z`=181.0927 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,772.7885,654.1609,181.0927,0,0,0,0,100,0),
+(@PATH,2,741.7479,664.2408,181.0927,0,0,0,0,100,0),
+(@PATH,3,706.3735,660.1111,181.0927,0,0,0,0,100,0),
+(@PATH,4,687.1923,657.1448,181.0927,0,0,0,0,100,0),
+(@PATH,5,664.6516,660.413,181.0927,0,0,0,0,100,0),
+(@PATH,6,645.1816,670.5711,181.0927,0,0,0,0,100,0),
+(@PATH,7,622.322,689.5355,181.0927,0,0,0,0,100,0),
+(@PATH,8,610.5265,710.7983,181.0927,0,0,0,0,100,0),
+(@PATH,9,618.5477,735.175,181.0927,0,0,0,0,100,0),
+(@PATH,10,638.978,750.4484,181.0927,0,0,0,0,100,0),
+(@PATH,11,662.0802,750.7849,181.0927,0,0,0,0,100,0),
+(@PATH,12,686.8675,756.3293,181.0927,0,0,0,0,100,0),
+(@PATH,13,717.1716,755.1641,181.0927,0,0,0,0,100,0),
+(@PATH,14,751.1226,745.5831,181.0927,0,0,0,0,100,0),
+(@PATH,15,793.9115,741.4536,181.0927,0,0,0,0,100,0),
+(@PATH,16,808.7234,721.0219,181.0927,0,0,0,0,100,0),
+(@PATH,17,813.506,690.8309,181.0927,0,0,0,0,100,0),
+(@PATH,18,807.697,660.5173,181.0927,0,0,0,0,100,0),
+(@PATH,19,795.8221,652.5587,181.0927,0,0,0,0,100,0),
+(@PATH,20,778.0756,652.9412,181.0927,0,0,0,0,100,0);
+
+SET @CGUID := 53915;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=611.2323,`position_y`=772.1125,`position_z`=100.3375 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,611.2323,772.1125,100.3375,0,0,0,0,100,0),
+(@PATH,2,610.3099,773.2811,101.0543,0,0,0,0,100,0),
+(@PATH,3,593.9789,761.1765,100.2642,0,0,0,0,100,0),
+(@PATH,4,596.4754,741.2283,102.9648,0,0,0,0,100,0),
+(@PATH,5,602.8006,723.6838,102.6062,0,0,0,0,100,0),
+(@PATH,6,597.0957,699.6459,103.9118,0,0,0,0,100,0),
+(@PATH,7,610.3877,682.6296,101.8653,0,0,0,0,100,0),
+(@PATH,8,633.4901,681.085,98.25417,0,0,0,0,100,0),
+(@PATH,9,645.6487,698.6017,100.1986,0,0,0,0,100,0),
+(@PATH,10,647.328,728.833,103.0319,0,0,0,0,100,0),
+(@PATH,11,642.2083,757.2476,103.1986,0,0,0,0,100,0),
+(@PATH,12,624.1133,771.72,100.3653,0,0,0,0,100,0);
+
+SET @CGUID := 53916;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=720.1983,`position_y`=773.6754,`position_z`=182.0927 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,720.1983,773.6754,182.0927,0,0,0,0,100,0),
+(@PATH,2,734.9511,767.1181,182.0927,0,0,0,0,100,0),
+(@PATH,3,749.4861,762.5421,182.0927,0,0,0,0,100,0),
+(@PATH,4,770.0009,763.1467,182.0927,0,0,0,0,100,0),
+(@PATH,5,800.0214,762.2766,182.0927,0,0,0,0,100,0),
+(@PATH,6,818.5339,745.1193,182.0927,0,0,0,0,100,0),
+(@PATH,7,827.5038,725.6721,182.0927,0,0,0,0,100,0),
+(@PATH,8,832.0837,704.4107,182.0927,0,0,0,0,100,0),
+(@PATH,9,831.9136,681.903,182.0927,0,0,0,0,100,0),
+(@PATH,10,826.7904,647.8798,182.0927,0,0,0,0,100,0),
+(@PATH,11,801.674,633.2579,182.0927,0,0,0,0,100,0),
+(@PATH,12,814.5579,649.2947,182.0923,0,0,0,0,100,0),
+(@PATH,13,801.0446,650.5958,181.7404,0,0,0,0,100,0),
+(@PATH,14,760.7453,641.9697,182.0927,0,0,0,0,100,0),
+(@PATH,15,753.7795,647.4783,182.0927,0,0,0,0,100,0),
+(@PATH,16,742.7457,648.2622,182.0927,0,0,0,0,100,0),
+(@PATH,17,730.8102,646.2585,182.0927,0,0,0,0,100,0),
+(@PATH,18,719.2238,645.16,182.0927,0,0,0,0,100,0),
+(@PATH,19,704.7307,639.3378,182.0927,0,0,0,0,100,0),
+(@PATH,20,690.13,638.024,182.0927,0,0,0,0,100,0),
+(@PATH,21,674.1525,638.3937,182.0927,0,0,0,0,100,0),
+(@PATH,22,659.0974,641.6127,182.0927,0,0,0,0,100,0),
+(@PATH,23,646.5961,647.8795,182.0927,0,0,0,0,100,0),
+(@PATH,24,634.9307,655.1992,182.0927,0,0,0,0,100,0),
+(@PATH,25,622.3271,663.3989,182.0927,0,0,0,0,100,0),
+(@PATH,26,610.6317,673.7043,182.0927,0,0,0,0,100,0),
+(@PATH,27,596.7717,688.1019,182.0927,0,0,0,0,100,0),
+(@PATH,28,589.9683,707.7562,182.0927,0,0,0,0,100,0),
+(@PATH,29,592.2947,725.6345,182.0927,0,0,0,0,100,0),
+(@PATH,30,599.0037,742.375,182.0927,0,0,0,0,100,0),
+(@PATH,31,610.2929,755.7358,182.0927,0,0,0,0,100,0),
+(@PATH,32,627.2651,768.8852,182.0927,0,0,0,0,100,0),
+(@PATH,33,640.3808,768.9335,182.0927,0,0,0,0,100,0),
+(@PATH,34,647.518,764.7024,182.0927,0,0,0,0,100,0),
+(@PATH,35,659.9943,769.0815,182.0927,0,0,0,0,100,0),
+(@PATH,36,674.6238,773.7285,182.0927,0,0,0,0,100,0),
+(@PATH,37,688.2984,775.2261,182.0927,0,0,0,0,100,0),
+(@PATH,38,703.0669,775.5544,182.0927,0,0,0,0,100,0),
+(@PATH,39,717.2137,774.4837,182.0927,0,0,0,0,100,0);
+
+SET @CGUID := 12740;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=618.1697,`position_y`=757.3074,`position_z`=102.0629 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21548,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,618.1697,757.3074,102.0629,0,0,0,0,100,0),
+(@PATH,2,620.636,747.589,104.0602,0,0,0,0,100,0),
+(@PATH,3,627.2382,717.0773,103.6958,0,0,0,0,100,0),
+(@PATH,4,621.8175,699.6788,104.8484,0,0,0,0,100,0),
+(@PATH,5,621.6443,705.135,104.0194,0,0,0,0,100,0),
+(@PATH,6,622.424,704.8251,101.5694,0,0,0,0,100,0),
+(@PATH,7,622.1757,703.3439,99.21982,0,0,0,0,100,0),
+(@PATH,8,621.1312,703.9969,100.855,0,0,0,0,100,0),
+(@PATH,9,622.5646,713.457,102.6567,0,0,0,0,100,0),
+(@PATH,10,622.2819,728.8792,104.1066,0,0,0,0,100,0),
+(@PATH,11,620.7601,743.2843,104.4669,0,0,0,0,100,0),
+(@PATH,12,620.4224,744.8631,103.4185,0,0,0,0,100,0),
+(@PATH,13,615.5464,748.3319,101.2297,0,0,0,0,100,0),
+(@PATH,14,634.5025,757.4967,72.38888,0,0,0,0,100,0),
+(@PATH,15,634.5104,757.5007,72.37598,0,0,0,0,100,0),
+(@PATH,16,618.5453,755.4985,102.9158,0,0,0,0,100,0),
+(@PATH,17,621.3293,746.1893,103.9798,0,0,0,0,100,0),
+(@PATH,18,626.788,714.7961,103.75,0,0,0,0,100,0),
+(@PATH,19,621.7899,699.5308,104.8121,0,0,0,0,100,0),
+(@PATH,20,621.3626,705.4813,104.3223,0,0,0,0,100,0),
+(@PATH,21,621.3121,705.1012,102.4415,0,0,0,0,100,0),
+(@PATH,22,625.4631,704.6119,99.74145,0,0,0,0,100,0),
+(@PATH,23,620.0256,701.603,99.70113,0,0,0,0,100,0),
+(@PATH,24,621.8276,706.3629,101.4815,0,0,0,0,100,0),
+(@PATH,25,622.6558,717.0432,103.1024,0,0,0,0,100,0),
+(@PATH,26,622.1406,731.1638,104.2091,0,0,0,0,100,0),
+(@PATH,27,620.7473,743.3433,104.4659,0,0,0,0,100,0),
+(@PATH,28,620.6885,744.6069,103.6851,0,0,0,0,100,0),
+(@PATH,29,614.7051,748.4863,101.5833,0,0,0,0,100,0),
+(@PATH,30,609.936,747.1412,101.3292,0,0,0,0,100,0),
+(@PATH,31,623.5999,752.106,102.0542,0,0,0,0,100,0),
+(@PATH,32,618.179,757.1844,101.909,0,0,0,0,100,0);
+
+SET @CGUID := 12739;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=607.7617,`position_y`=829.9091,`position_z`=90.44696 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21548,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,607.7617,829.9091,90.44696,0,0,0,0,100,0),
+(@PATH,2,602.4633,830.1422,93.41113,0,0,0,0,100,0),
+(@PATH,3,607.6243,835.0496,91.36709,0,0,0,0,100,0),
+(@PATH,4,606.5493,827.5132,91.94758,0,0,0,0,100,0),
+(@PATH,5,606.7817,814.8796,93.77133,0,0,0,0,100,0),
+(@PATH,6,607.1453,796.8506,94.47835,0,0,0,0,100,0),
+(@PATH,7,607.0215,783.4634,93.29945,0,0,0,0,100,0),
+(@PATH,8,609.2629,777.7833,95.4697,0,0,0,0,100,0),
+(@PATH,9,615.3491,757.2604,100.0487,0,0,0,0,100,0),
+(@PATH,10,616.2725,734.5289,102.7384,0,0,0,0,100,0),
+(@PATH,11,611.5767,745.3478,105.5129,0,0,0,0,100,0),
+(@PATH,12,604.3624,746.663,106.2547,0,0,0,0,100,0),
+(@PATH,13,605.7682,747.9605,103.8478,0,0,0,0,100,0),
+(@PATH,14,607.6742,750.7892,101.3251,0,0,0,0,100,0),
+(@PATH,15,608.0389,760.6672,97.6655,0,0,0,0,100,0),
+(@PATH,16,606.491,773.1877,96.38459,0,0,0,0,100,0),
+(@PATH,17,607.378,797.1143,96.63741,0,0,0,0,100,0),
+(@PATH,18,611.7768,815.5746,97.53774,0,0,0,0,100,0),
+(@PATH,19,614.4452,814.0935,97.00954,0,0,0,0,100,0),
+(@PATH,20,614.4432,814.1082,97.00902,0,0,0,0,100,0),
+(@PATH,21,612.2132,828.8321,90.99244,0,0,0,0,100,0),
+(@PATH,22,608.5633,829.7872,90.09452,0,0,0,0,100,0);
+
+SET @CGUID := 12738;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=808.744,`position_y`=752.8126,`position_z`=93.69208 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21548,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,808.744,752.8126,93.69208,0,0,0,0,100,0),
+(@PATH,2,810.0982,728.1007,95.92642,0,0,0,0,100,0),
+(@PATH,3,809.3226,709.2455,101.5179,0,0,0,0,100,0),
+(@PATH,4,804.869,691.9334,103.6763,0,0,0,0,100,0),
+(@PATH,5,789.4135,679.9703,102.1762,0,0,0,0,100,0),
+(@PATH,6,772.5522,683.7802,99.09293,0,0,0,0,100,0),
+(@PATH,7,759.5066,697.9881,100.3707,0,0,0,0,100,0),
+(@PATH,8,752.4968,727.6615,106.1207,0,0,0,0,100,0),
+(@PATH,9,747.4766,760.6776,114.7874,0,0,0,0,100,0),
+(@PATH,10,751.5941,805.2043,104.7318,0,0,0,0,100,0),
+(@PATH,11,751.1071,831.5707,90.48182,0,0,0,0,100,0),
+(@PATH,12,768.2726,846.9728,96.42626,0,0,0,0,100,0),
+(@PATH,13,795.4689,850.97,102.3151,0,0,0,0,100,0),
+(@PATH,14,815.1022,836.6889,95.98182,0,0,0,0,100,0),
+(@PATH,15,812.1649,811.0369,99.09293,0,0,0,0,100,0),
+(@PATH,16,810.7905,781.4119,100.1485,0,0,0,0,100,0);
+
+SET @CGUID := 12737;
+SET @PATH := @CGUID * 10;
+
+UPDATE `creature` SET `spawndist`=0,`MovementType`=2,`position_x`=790.1919,`position_y`=890.4173,`position_z`=96.21225 WHERE `guid`=@CGUID;
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21548,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,790.1919,890.4173,96.21225,0,0,0,0,100,0),
+(@PATH,2,803.1602,893.1978,90.55112,0,0,0,0,100,0),
+(@PATH,3,799.688,889.9006,90.20824,0,0,0,0,100,0),
+(@PATH,4,802.6058,890.4018,89.90356,0,0,0,0,100,0),
+(@PATH,5,802.9925,926.767,88.62688,0,0,0,0,100,0),
+(@PATH,6,797.1304,940.8237,89.18675,0,0,0,0,100,0),
+(@PATH,7,798.6385,941.869,88.60009,0,0,0,0,100,0),
+(@PATH,8,789.894,942.1028,87.77906,0,0,0,0,100,0),
+(@PATH,9,773.556,943.2788,89.22779,0,0,0,0,100,0),
+(@PATH,10,765.2734,942.9044,91.67089,0,0,0,0,100,0),
+(@PATH,11,764.4266,941.9615,96.66107,0,0,0,0,100,0),
+(@PATH,12,762.1209,936.9633,102.0497,0,0,0,0,100,0),
+(@PATH,13,761.3636,923.9997,107.3103,0,0,0,0,100,0),
+(@PATH,14,761.5854,908.6809,109.3919,0,0,0,0,100,0),
+(@PATH,15,763.943,900.4043,106.9297,0,0,0,0,100,0),
+(@PATH,16,766.2017,896.2592,100.4964,0,0,0,0,100,0),
+(@PATH,17,772.8622,893.9176,97.49315,0,0,0,0,100,0),
+(@PATH,18,790.2458,889.8303,96.01199,0,0,0,0,100,0);
+
+-- **************************************** MISSING SPAWNS ****************************************
+SET @CGUID := 54254;
+SET @PATH := @CGUID * 10;
+
+DELETE FROM `creature` WHERE `guid`=@CGUID;
+INSERT INTO `creature` (`guid`,`id`,`map`,`zoneId`,`areaId`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`,`VerifiedBuild`) VALUES
+(@CGUID, 23030, 564, 0, 0, 1, 1, 21544, 1, 695.0379, 740.5878, 740.5878, 0, 3600, 0, 0, 140728, 32310, 2, 0, 0, 0, 0);
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21545,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,695.0379,740.5878,182.0927,0,0,0,0,100,0),
+(@PATH,2,708.8729,740.1831,182.0927,0,0,0,0,100,0),
+(@PATH,3,727.4776,732.5617,182.0927,0,0,0,0,100,0),
+(@PATH,4,748.5054,727.2003,182.0927,0,0,0,0,100,0),
+(@PATH,5,765.7083,728.0529,182.0927,0,0,0,0,100,0),
+(@PATH,6,775.2858,737.015,182.0927,0,0,0,0,100,0),
+(@PATH,7,785.4459,732.6622,182.0927,0,0,0,0,100,0),
+(@PATH,8,792.5123,720.6128,182.0927,0,0,0,0,100,0),
+(@PATH,9,796.7908,706.5093,182.0927,0,0,0,0,100,0),
+(@PATH,10,797.6062,690.4472,182.0927,0,0,0,0,100,0),
+(@PATH,11,809.627,678.7896,182.0927,0,0,0,0,100,0),
+(@PATH,12,804.4231,668.5062,182.0927,0,0,0,0,100,0),
+(@PATH,13,804.934,672.4259,182.0927,0,0,0,0,100,0),
+(@PATH,14,796.8747,666.9809,181.8125,0,0,0,0,100,0),
+(@PATH,15,768.8938,676.3732,182.0927,0,0,0,0,100,0),
+(@PATH,16,752.1782,682.7973,182.0927,0,0,0,0,100,0),
+(@PATH,17,737.0302,683.1525,182.0927,0,0,0,0,100,0),
+(@PATH,18,724.8998,681.1164,182.0927,0,0,0,0,100,0),
+(@PATH,19,711.6598,679.6968,182.0927,0,0,0,0,100,0),
+(@PATH,20,704.9904,674.6921,182.0927,0,0,0,0,100,0),
+(@PATH,21,695.2261,673.0101,182.0927,0,0,0,0,100,0),
+(@PATH,22,685.7263,671.801,182.0927,0,0,0,0,100,0),
+(@PATH,23,676.828,672.2006,182.0927,0,0,0,0,100,0),
+(@PATH,24,667.0285,676.7328,182.0927,0,0,0,0,100,0),
+(@PATH,25,657.2637,682.6079,182.0927,0,0,0,0,100,0),
+(@PATH,26,648.3331,687.3507,182.0927,0,0,0,0,100,0),
+(@PATH,27,640.038,693.3326,182.0927,0,0,0,0,100,0),
+(@PATH,28,631.494,694.7631,182.0927,0,0,0,0,100,0),
+(@PATH,29,624.1406,698.6867,182.0927,0,0,0,0,100,0),
+(@PATH,30,622.8167,707.7905,182.0927,0,0,0,0,100,0),
+(@PATH,31,622.7652,716.195,182.0927,0,0,0,0,100,0),
+(@PATH,32,626.7378,724.4378,182.0927,0,0,0,0,100,0),
+(@PATH,33,627.8054,733.534,182.0927,0,0,0,0,100,0),
+(@PATH,34,639.0854,733.6019,182.0927,0,0,0,0,100,0),
+(@PATH,35,656.7821,730.5823,182.0927,0,0,0,0,100,0),
+(@PATH,36,667.3138,734.4921,182.0927,0,0,0,0,100,0),
+(@PATH,37,675.8494,738.3944,182.0927,0,0,0,0,100,0),
+(@PATH,38,686.2126,739.9324,182.0927,0,0,0,0,100,0);
+
+-- 7 static
+SET @CGUID := 54255;
+
+DELETE FROM `creature` WHERE `guid` IN(@CGUID+0,@CGUID+1,@CGUID+2,@CGUID+3,@CGUID+4,@CGUID+5,@CGUID+6);
+INSERT INTO `creature` (`guid`,`id`,`map`,`zoneId`,`areaId`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`,`VerifiedBuild`) VALUES
+(@CGUID+0, 23030, 564, 0,0,1,1, 21544, 1, 679.4788, 739.0269, 182.0927, 3.597085, 3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0),
+(@CGUID+1, 23030, 564, 0,0,1,1, 21544, 1, 746.1173, 843.321, 172.9325, 2.720434, 3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0),
+(@CGUID+2, 23030, 564, 0,0,1,1, 21544, 1, 655.0826, 730.4282, 182.0927, 6.161078, 3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0),
+(@CGUID+3, 23030, 564, 0,0,1,1, 21544, 1, 727.1025, 735.5541, 97.19754, 5.598838, 3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0),
+(@CGUID+4, 23030, 564, 0,0,1,1, 21544, 1, 809.3963, 660.3644, 172.9325, 0.4250514,3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0),
+(@CGUID+5, 23030, 564, 0,0,1,1, 21544, 1, 773.0972, 694.7501, 172.9325, 0.5313485,3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0),
+(@CGUID+6, 23030, 564, 0,0,1,1, 21544, 1, 700.8214, 725.056, 100.516, 3.203588, 3600, 0, 0, 140728, 32310, 0, 0, 0, 0, 0);
+
+-- single spawn
+SET @CGUID := 54262;
+SET @PATH := @CGUID * 10;
+
+DELETE FROM `creature` WHERE `guid`=@CGUID;
+INSERT INTO `creature` (`guid`,`id`,`map`,`zoneId`,`areaId`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`,`npcflag`,`unit_flags`,`dynamicflags`,`VerifiedBuild`) VALUES
+(@CGUID, 23030, 564, 0, 0, 1, 1, 21544, 1, 810.1124, 748.2065, 98.09019, 0, 3600, 0, 0, 140728, 32310, 2, 0, 0, 0, 0);
+
+DELETE FROM `creature_addon` WHERE `guid`=@CGUID;
+INSERT INTO `creature_addon` (`guid`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES (@CGUID,@PATH,21548,0,4097,0, '');
+
+DELETE FROM `waypoint_data` WHERE `id`=@PATH;
+INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_type`,`action`,`action_chance`,`wpguid`) VALUES
+(@PATH,1,810.1124,748.2065,98.09019,0,0,0,0,100,0),
+(@PATH,2,812.1799,731.7729,102.9764,0,0,0,0,100,0),
+(@PATH,3,819.2544,710.6747,104.6852,0,0,0,0,100,0),
+(@PATH,4,814.0609,688.1116,103.3055,0,0,0,0,100,0),
+(@PATH,5,796.0499,671.1177,100.224,0,0,0,0,100,0),
+(@PATH,6,775.2276,672.8571,100.746,0,0,0,0,100,0),
+(@PATH,7,761.4761,684.9821,103.3551,0,0,0,0,100,0),
+(@PATH,8,757.2691,702.5233,106.9886,0,0,0,0,100,0),
+(@PATH,9,754.0154,718.1474,112.2537,0,0,0,0,100,0),
+(@PATH,10,747.9337,735.1084,115.7933,0,0,0,0,100,0),
+(@PATH,11,745.829,752.0821,113.6542,0,0,0,0,100,0),
+(@PATH,12,747.8068,770.1235,109.0152,0,0,0,0,100,0),
+(@PATH,13,753.1844,786.4976,103.0236,0,0,0,0,100,0),
+(@PATH,14,749.2501,801.4901,93.55122,0,0,0,0,100,0),
+(@PATH,15,738.5554,821.9026,92.52246,0,0,0,0,100,0),
+(@PATH,16,747.3125,839.3755,98.11914,0,0,0,0,100,0),
+(@PATH,17,763.0296,850.4688,102.5345,0,0,0,0,100,0),
+(@PATH,18,781.9125,859.7533,101.6105,0,0,0,0,100,0),
+(@PATH,19,806.5648,859.7701,96.95612,0,0,0,0,100,0),
+(@PATH,20,819.6655,844.2811,98.91273,0,0,0,0,100,0),
+(@PATH,21,812.7062,827.3618,100.7621,0,0,0,0,100,0),
+(@PATH,22,812.3382,809.6904,101.333,0,0,0,0,100,0);
+-- ************************************************************************************************
diff --git a/src/common/Common.h b/src/common/Common.h
index aa04abacd30..af9b9b17321 100644
--- a/src/common/Common.h
+++ b/src/common/Common.h
@@ -35,6 +35,7 @@
#include <unordered_map>
#include <unordered_set>
#include <vector>
+#include <numeric>
#include <cmath>
#include <cstdio>
diff --git a/src/common/Metric/Metric.cpp b/src/common/Metric/Metric.cpp
index 9484cebcc72..cb6b3b1217b 100644
--- a/src/common/Metric/Metric.cpp
+++ b/src/common/Metric/Metric.cpp
@@ -22,7 +22,7 @@
void Metric::Initialize(std::string const& realmName, boost::asio::io_service& ioService, std::function<void()> overallStatusLogger)
{
- _realmName = realmName;
+ _realmName = FormatInfluxDBTagValue(realmName);
_batchTimer = Trinity::make_unique<boost::asio::deadline_timer>(ioService);
_overallStatusTimer = Trinity::make_unique<boost::asio::deadline_timer>(ioService);
_overallStatusLogger = overallStatusLogger;
diff --git a/src/common/Metric/Metric.h b/src/common/Metric/Metric.h
index 1855e1d0098..9230983da4d 100644
--- a/src/common/Metric/Metric.h
+++ b/src/common/Metric/Metric.h
@@ -79,6 +79,14 @@ private:
static std::string FormatInfluxDBValue(double value) { return std::to_string(value); }
static std::string FormatInfluxDBValue(float value) { return FormatInfluxDBValue(double(value)); }
+ static std::string FormatInfluxDBTagValue(std::string const& value)
+ {
+ // ToDo: should handle '=' and ',' characters too
+ return boost::replace_all_copy(value, " ", "\\ ");
+ }
+
+ // ToDo: should format TagKey and FieldKey too in the same way as TagValue
+
public:
static Metric* instance();
diff --git a/src/common/Utilities/Util.h b/src/common/Utilities/Util.h
index fc322a89583..88708a79cd6 100644
--- a/src/common/Utilities/Util.h
+++ b/src/common/Utilities/Util.h
@@ -327,33 +327,35 @@ TC_COMMON_API bool StringToBool(std::string const& str);
// simple class for not-modifyable list
template <typename T>
-class HookList
+class HookList final
{
- typedef typename std::list<T>::iterator ListIterator;
private:
- typename std::list<T> m_list;
+ typedef std::vector<T> ContainerType;
+
+ ContainerType _container;
+
public:
- HookList<T> & operator+=(T t)
- {
- m_list.push_back(t);
- return *this;
- }
- HookList<T> & operator-=(T t)
+ typedef typename ContainerType::iterator iterator;
+
+ HookList<T>& operator+=(T t)
{
- m_list.remove(t);
+ _container.push_back(t);
return *this;
}
+
size_t size()
{
- return m_list.size();
+ return _container.size();
}
- ListIterator begin()
+
+ iterator begin()
{
- return m_list.begin();
+ return _container.begin();
}
- ListIterator end()
+
+ iterator end()
{
- return m_list.end();
+ return _container.end();
}
};
diff --git a/src/server/authserver/Server/AuthSession.cpp b/src/server/authserver/Server/AuthSession.cpp
index 45c2b61436f..b139d50ef8a 100644
--- a/src/server/authserver/Server/AuthSession.cpp
+++ b/src/server/authserver/Server/AuthSession.cpp
@@ -118,10 +118,10 @@ std::unordered_map<uint8, AuthHandler> AuthSession::InitHandlers()
{
std::unordered_map<uint8, AuthHandler> handlers;
- handlers[AUTH_LOGON_CHALLENGE] = { STATUS_CONNECTED, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleLogonChallenge };
- handlers[AUTH_LOGON_PROOF] = { STATUS_CONNECTED, sizeof(AUTH_LOGON_PROOF_C), &AuthSession::HandleLogonProof };
- handlers[AUTH_RECONNECT_CHALLENGE] = { STATUS_CONNECTED, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleReconnectChallenge };
- handlers[AUTH_RECONNECT_PROOF] = { STATUS_CONNECTED, sizeof(AUTH_RECONNECT_PROOF_C), &AuthSession::HandleReconnectProof };
+ handlers[AUTH_LOGON_CHALLENGE] = { STATUS_CHALLENGE, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleLogonChallenge };
+ handlers[AUTH_LOGON_PROOF] = { STATUS_LOGON_PROOF, sizeof(AUTH_LOGON_PROOF_C), &AuthSession::HandleLogonProof };
+ handlers[AUTH_RECONNECT_CHALLENGE] = { STATUS_CHALLENGE, AUTH_LOGON_CHALLENGE_INITIAL_SIZE, &AuthSession::HandleReconnectChallenge };
+ handlers[AUTH_RECONNECT_PROOF] = { STATUS_RECONNECT_PROOF, sizeof(AUTH_RECONNECT_PROOF_C), &AuthSession::HandleReconnectProof };
handlers[REALM_LIST] = { STATUS_AUTHED, REALM_LIST_PACKET_SIZE, &AuthSession::HandleRealmList };
return handlers;
@@ -154,8 +154,7 @@ void AccountInfo::LoadResult(Field* fields)
}
AuthSession::AuthSession(tcp::socket&& socket) : Socket(std::move(socket)),
-_sentChallenge(false), _sentProof(false),
-_status(STATUS_CONNECTED), _build(0), _expversion(0)
+_status(STATUS_CHALLENGE), _build(0), _expversion(0)
{
N.SetHexStr("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7");
g.SetDword(7);
@@ -285,10 +284,7 @@ void AuthSession::SendPacket(ByteBuffer& packet)
bool AuthSession::HandleLogonChallenge()
{
- if (_sentChallenge)
- return false;
-
- _sentChallenge = true;
+ _status = STATUS_CLOSED;
sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
if (challenge->size - (sizeof(sAuthLogonChallenge_C) - AUTH_LOGON_CHALLENGE_INITIAL_SIZE - 1) != challenge->I_len)
@@ -428,7 +424,10 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result)
// Fill the response packet with the result
if (AuthHelper::IsAcceptedClientBuild(_build))
+ {
pkt << uint8(WOW_SUCCESS);
+ _status = STATUS_LOGON_PROOF;
+ }
else
pkt << uint8(WOW_FAIL_VERSION_INVALID);
@@ -477,10 +476,7 @@ void AuthSession::LogonChallengeCallback(PreparedQueryResult result)
bool AuthSession::HandleLogonProof()
{
TC_LOG_DEBUG("server.authserver", "Entering _HandleLogonProof");
- if (_sentProof)
- return false;
-
- _sentProof = true;
+ _status = STATUS_CLOSED;
// Read the packet
sAuthLogonProof_C *logonProof = reinterpret_cast<sAuthLogonProof_C*>(GetReadBuffer().GetReadPointer());
@@ -500,9 +496,7 @@ bool AuthSession::HandleLogonProof()
// SRP safeguard: abort if A == 0
if (A.IsZero())
- {
return false;
- }
SHA1Hash sha;
sha.UpdateBigNumbers(&A, &B, NULL);
@@ -571,24 +565,6 @@ bool AuthSession::HandleLogonProof()
// Check if SRP6 results match (password is correct), else send an error
if (!memcmp(M.AsByteArray(sha.GetLength()).get(), logonProof->M1, 20))
{
- TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str());
-
- // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account
- // No SQL injection (escaped user name) and IP address as received by socket
-
- PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
- stmt->setString(0, K.AsHexStr());
- stmt->setString(1, GetRemoteIpAddress().to_string().c_str());
- stmt->setUInt32(2, GetLocaleByName(_localizationName));
- stmt->setString(3, _os);
- stmt->setString(4, _accountInfo.Login);
- LoginDatabase.DirectExecute(stmt);
-
- // Finish SRP6 and send the final result to the client
- sha.Initialize();
- sha.UpdateBigNumbers(&A, &M, &K, NULL);
- sha.Finalize();
-
// Check auth token
if ((logonProof->securityFlags & 0x04) || !_tokenKey.empty())
{
@@ -610,6 +586,24 @@ bool AuthSession::HandleLogonProof()
}
}
+ TC_LOG_DEBUG("server.authserver", "'%s:%d' User '%s' successfully authenticated", GetRemoteIpAddress().to_string().c_str(), GetRemotePort(), _accountInfo.Login.c_str());
+
+ // Update the sessionkey, last_ip, last login time and reset number of failed logins in the account table for this account
+ // No SQL injection (escaped user name) and IP address as received by socket
+
+ PreparedStatement *stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGONPROOF);
+ stmt->setString(0, K.AsHexStr());
+ stmt->setString(1, GetRemoteIpAddress().to_string().c_str());
+ stmt->setUInt32(2, GetLocaleByName(_localizationName));
+ stmt->setString(3, _os);
+ stmt->setString(4, _accountInfo.Login);
+ LoginDatabase.DirectExecute(stmt);
+
+ // Finish SRP6 and send the final result to the client
+ sha.Initialize();
+ sha.UpdateBigNumbers(&A, &M, &K, NULL);
+ sha.Finalize();
+
ByteBuffer packet;
if (_expversion & POST_BC_EXP_FLAG) // 2.x and 3.x clients
{
@@ -705,10 +699,7 @@ bool AuthSession::HandleLogonProof()
bool AuthSession::HandleReconnectChallenge()
{
- if (_sentChallenge)
- return false;
-
- _sentChallenge = true;
+ _status = STATUS_CLOSED;
sAuthLogonChallenge_C* challenge = reinterpret_cast<sAuthLogonChallenge_C*>(GetReadBuffer().GetReadPointer());
if (challenge->size - (sizeof(sAuthLogonChallenge_C) - AUTH_LOGON_CHALLENGE_INITIAL_SIZE - 1) != challenge->I_len)
@@ -768,6 +759,7 @@ void AuthSession::ReconnectChallengeCallback(PreparedQueryResult result)
_accountInfo.LoadResult(fields);
K.SetHexStr(fields[9].GetCString());
_reconnectProof.SetRand(16 * 8);
+ _status = STATUS_RECONNECT_PROOF;
pkt << uint8(WOW_SUCCESS);
pkt.append(_reconnectProof.AsByteArray(16).get(), 16); // 16 bytes random
@@ -779,10 +771,7 @@ void AuthSession::ReconnectChallengeCallback(PreparedQueryResult result)
bool AuthSession::HandleReconnectProof()
{
TC_LOG_DEBUG("server.authserver", "Entering _HandleReconnectProof");
- if (_sentProof)
- return false;
-
- _sentProof = true;
+ _status = STATUS_CLOSED;
sAuthReconnectProof_C *reconnectProof = reinterpret_cast<sAuthReconnectProof_C*>(GetReadBuffer().GetReadPointer());
diff --git a/src/server/authserver/Server/AuthSession.h b/src/server/authserver/Server/AuthSession.h
index 027011629eb..98d2cb9fcdb 100644
--- a/src/server/authserver/Server/AuthSession.h
+++ b/src/server/authserver/Server/AuthSession.h
@@ -34,8 +34,11 @@ struct AuthHandler;
enum AuthStatus
{
- STATUS_CONNECTED = 0,
- STATUS_AUTHED
+ STATUS_CHALLENGE = 0,
+ STATUS_LOGON_PROOF,
+ STATUS_RECONNECT_PROOF,
+ STATUS_AUTHED,
+ STATUS_CLOSED
};
struct AccountInfo
@@ -90,9 +93,6 @@ private:
BigNumber K;
BigNumber _reconnectProof;
- bool _sentChallenge;
- bool _sentProof;
-
AuthStatus _status;
AccountInfo _accountInfo;
std::string _tokenKey;
diff --git a/src/server/database/Database/Implementation/CharacterDatabase.cpp b/src/server/database/Database/Implementation/CharacterDatabase.cpp
index bbf03248ec2..6122e5aca7b 100644
--- a/src/server/database/Database/Implementation/CharacterDatabase.cpp
+++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp
@@ -243,8 +243,8 @@ void CharacterDatabaseConnection::DoPrepareStatements()
PrepareStatement(CHAR_DEL_EQUIP_SET, "DELETE FROM character_equipmentsets WHERE setguid=?", CONNECTION_ASYNC);
// Auras
- PrepareStatement(CHAR_INS_AURA, "INSERT INTO character_aura (guid, casterGuid, itemGuid, spell, effectMask, recalculateMask, stackCount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxDuration, remainTime, remainCharges) "
- "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
+ PrepareStatement(CHAR_INS_AURA, "INSERT INTO character_aura (guid, casterGuid, spell, effectMask, recalculateMask, stackCount, amount0, amount1, amount2, base_amount0, base_amount1, base_amount2, maxDuration, remainTime, remainCharges) "
+ "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
// Account data
PrepareStatement(CHAR_SEL_ACCOUNT_DATA, "SELECT type, time, data FROM account_data WHERE accountId = ?", CONNECTION_ASYNC);
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index d3d2be4aed5..48315eb44ed 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1671,6 +1671,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
ResetBaseObject();
break;
case SMART_ACTION_CALL_SCRIPT_RESET:
+ SetPhase(0);
OnReset();
break;
case SMART_ACTION_SET_RANGED_MOVEMENT:
@@ -3587,10 +3588,6 @@ void SmartScript::FillScript(SmartAIEventList e, WorldObject* obj, AreaTriggerEn
}
mEvents.push_back((*i));//NOTE: 'world(0)' events still get processed in ANY instance mode
}
- if (mEvents.empty() && obj)
- TC_LOG_ERROR("sql.sql", "SmartScript: Entry %u has events but no events added to list because of instance flags.", obj->GetEntry());
- if (mEvents.empty() && at)
- TC_LOG_ERROR("sql.sql", "SmartScript: AreaTrigger %u has events but no events added to list because of instance flags. NOTE: triggers can not handle any instance flags.", at->id);
}
void SmartScript::GetScript()
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
index 7016494de0e..8df95619ae5 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp
@@ -419,6 +419,7 @@ bool BattlefieldWG::SetupBattlefield()
m_StartGroupingTimer = 15 * MINUTE * IN_MILLISECONDS;
m_StartGrouping = false;
+ m_tenacityTeam = TEAM_NEUTRAL;
m_tenacityStack = 0;
KickPosition.Relocate(5728.117f, 2714.346f, 697.733f, 0);
@@ -1084,6 +1085,7 @@ void BattlefieldWG::OnPlayerLeaveWar(Player* player)
player->RemoveAurasDueToSpell(SPELL_ALLIANCE_CONTROLS_FACTORY_PHASE_SHIFT);
player->RemoveAurasDueToSpell(SPELL_HORDE_CONTROL_PHASE_SHIFT);
player->RemoveAurasDueToSpell(SPELL_ALLIANCE_CONTROL_PHASE_SHIFT);
+ UpdateTenacity();
}
void BattlefieldWG::OnPlayerLeaveZone(Player* player)
@@ -1289,7 +1291,6 @@ void BattlefieldWG::UpdateVehicleCountWG()
void BattlefieldWG::UpdateTenacity()
{
- TeamId team = TEAM_NEUTRAL;
uint32 alliancePlayers = m_PlayersInWar[TEAM_ALLIANCE].size();
uint32 hordePlayers = m_PlayersInWar[TEAM_HORDE].size();
int32 newStack = 0;
@@ -1305,21 +1306,16 @@ void BattlefieldWG::UpdateTenacity()
if (newStack == int32(m_tenacityStack))
return;
- if (m_tenacityStack > 0 && newStack <= 0) // old buff was on alliance
- team = TEAM_ALLIANCE;
- else if (newStack >= 0) // old buff was on horde
- team = TEAM_HORDE;
-
m_tenacityStack = newStack;
// Remove old buff
- if (team != TEAM_NEUTRAL)
+ if (m_tenacityTeam != TEAM_NEUTRAL)
{
- for (auto itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
+ for (auto itr = m_players[m_tenacityTeam].begin(); itr != m_players[m_tenacityTeam].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
if (player->getLevel() >= m_MinLevel)
player->RemoveAurasDueToSpell(SPELL_TENACITY);
- for (auto itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ for (auto itr = m_vehicles[m_tenacityTeam].begin(); itr != m_vehicles[m_tenacityTeam].end(); ++itr)
if (Creature* creature = GetCreature(*itr))
creature->RemoveAurasDueToSpell(SPELL_TENACITY_VEHICLE);
}
@@ -1327,7 +1323,7 @@ void BattlefieldWG::UpdateTenacity()
// Apply new buff
if (newStack)
{
- team = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE;
+ m_tenacityTeam = newStack > 0 ? TEAM_ALLIANCE : TEAM_HORDE;
if (newStack < 0)
newStack = -newStack;
@@ -1342,25 +1338,27 @@ void BattlefieldWG::UpdateTenacity()
if (newStack < 5)
buff_honor = 0;
- for (auto itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ for (auto itr = m_PlayersInWar[m_tenacityTeam].begin(); itr != m_PlayersInWar[m_tenacityTeam].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->SetAuraStack(SPELL_TENACITY, player, newStack);
- for (auto itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ for (auto itr = m_vehicles[m_tenacityTeam].begin(); itr != m_vehicles[m_tenacityTeam].end(); ++itr)
if (Creature* creature = GetCreature(*itr))
creature->SetAuraStack(SPELL_TENACITY_VEHICLE, creature, newStack);
if (buff_honor != 0)
{
- for (auto itr = m_PlayersInWar[team].begin(); itr != m_PlayersInWar[team].end(); ++itr)
+ for (auto itr = m_PlayersInWar[m_tenacityTeam].begin(); itr != m_PlayersInWar[m_tenacityTeam].end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(*itr))
player->CastSpell(player, buff_honor, true);
- for (auto itr = m_vehicles[team].begin(); itr != m_vehicles[team].end(); ++itr)
+ for (auto itr = m_vehicles[m_tenacityTeam].begin(); itr != m_vehicles[m_tenacityTeam].end(); ++itr)
if (Creature* creature = GetCreature(*itr))
creature->CastSpell(creature, buff_honor, true);
}
}
+ else
+ m_tenacityTeam = TEAM_NEUTRAL;
}
WintergraspCapturePoint::WintergraspCapturePoint(BattlefieldWG* battlefield, TeamId teamInControl) : BfCapturePoint(battlefield)
diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h
index 7769a9b4b6d..3bd719c1a60 100644
--- a/src/server/game/Battlefield/Zones/BattlefieldWG.h
+++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h
@@ -393,6 +393,7 @@ class TC_GAME_API BattlefieldWG : public Battlefield
GuidUnorderedSet m_vehicles[BG_TEAMS_COUNT];
GuidVector CanonList;
+ TeamId m_tenacityTeam;
uint32 m_tenacityStack;
uint32 m_saveTimer;
diff --git a/src/server/game/Battlegrounds/ArenaTeam.cpp b/src/server/game/Battlegrounds/ArenaTeam.cpp
index ec007df6b6c..f1747bc0d00 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeam.cpp
@@ -899,6 +899,10 @@ void ArenaTeam::SaveToDB()
for (MemberList::const_iterator itr = Members.begin(); itr != Members.end(); ++itr)
{
+ // Save the effort and go
+ if (itr->WeekGames == 0)
+ continue;
+
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ARENA_TEAM_MEMBER);
stmt->setUInt16(0, itr->PersonalRating);
stmt->setUInt16(1, itr->WeekGames);
@@ -919,8 +923,12 @@ void ArenaTeam::SaveToDB()
CharacterDatabase.CommitTransaction(trans);
}
-void ArenaTeam::FinishWeek()
+bool ArenaTeam::FinishWeek()
{
+ // No need to go further than this
+ if (Stats.WeekGames == 0)
+ return false;
+
// Reset team stats
Stats.WeekGames = 0;
Stats.WeekWins = 0;
@@ -931,6 +939,8 @@ void ArenaTeam::FinishWeek()
itr->WeekGames = 0;
itr->WeekWins = 0;
}
+
+ return true;
}
bool ArenaTeam::IsFighting() const
diff --git a/src/server/game/Battlegrounds/ArenaTeam.h b/src/server/game/Battlegrounds/ArenaTeam.h
index 7e9f490bff9..e283197346c 100644
--- a/src/server/game/Battlegrounds/ArenaTeam.h
+++ b/src/server/game/Battlegrounds/ArenaTeam.h
@@ -180,7 +180,7 @@ class TC_GAME_API ArenaTeam
void UpdateArenaPointsHelper(std::map<uint32, uint32> & PlayerPoints);
- void FinishWeek();
+ bool FinishWeek(); // returns true if arena team played this week
void FinishGame(int32 mod);
protected:
diff --git a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
index 37e26d7e448..6fe11e3bd8c 100644
--- a/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
+++ b/src/server/game/Battlegrounds/ArenaTeamMgr.cpp
@@ -186,8 +186,9 @@ void ArenaTeamMgr::DistributeArenaPoints()
{
if (ArenaTeam* at = titr->second)
{
- at->FinishWeek();
- at->SaveToDB();
+ if (at->FinishWeek())
+ at->SaveToDB();
+
at->NotifyStatsChanged();
}
}
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
index 753d0f92ef3..1ae610ecf68 100644
--- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp
+++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp
@@ -843,7 +843,7 @@ void BattlegroundMgr::ScheduleQueueUpdate(uint32 arenaMatchmakerRating, uint8 ar
{
//This method must be atomic, @todo add mutex
//we will use only 1 number created of bgTypeId and bracket_id
- uint64 const scheduleId = ((uint64)arenaMatchmakerRating << 32) | (uint32(arenaType) << 24) | (bgQueueTypeId << 16) | (bgTypeId << 8) | bracket_id;
+ uint64 const scheduleId = ((uint64)arenaMatchmakerRating << 32) | ((uint64)arenaType << 24) | ((uint64)bgQueueTypeId << 16) | ((uint64)bgTypeId << 8) | (uint64)bracket_id;
if (std::find(m_QueueUpdateScheduler.begin(), m_QueueUpdateScheduler.end(), scheduleId) == m_QueueUpdateScheduler.end())
m_QueueUpdateScheduler.push_back(scheduleId);
}
diff --git a/src/server/game/Chat/Channels/Channel.cpp b/src/server/game/Chat/Channels/Channel.cpp
index 85d03ef6b1f..afaa0063a45 100644
--- a/src/server/game/Chat/Channels/Channel.cpp
+++ b/src/server/game/Chat/Channels/Channel.cpp
@@ -55,7 +55,6 @@ Channel::Channel(uint32 channelId, uint32 team /*= 0*/, AreaTableEntry const* zo
_channelFlags |= CHANNEL_FLAG_NOT_LFG;
}
-
Channel::Channel(std::string const& name, uint32 team /*= 0*/) :
_announceEnabled(true),
_ownershipEnabled(true),
@@ -749,7 +748,6 @@ void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang) const
};
SendToAll(builder, !info.IsModerator() ? guid : ObjectGuid::Empty);
-
}
void Channel::Invite(Player const* player, std::string const& newname)
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp
index c859031b573..7ee775ec676 100644
--- a/src/server/game/Conditions/ConditionMgr.cpp
+++ b/src/server/game/Conditions/ConditionMgr.cpp
@@ -1671,7 +1671,6 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond) const
break;
}
case CONDITION_SOURCE_TYPE_QUEST_ACCEPT:
- case CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK:
if (!sObjectMgr->GetQuestTemplate(cond->SourceEntry))
{
TC_LOG_ERROR("sql.sql", "%s SourceEntry specifies non-existing quest, skipped.", cond->ToString().c_str());
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index 7bda1376a0d..4d32c3f36dc 100644
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -130,7 +130,7 @@ enum ConditionSourceType
CONDITION_SOURCE_TYPE_SPELL = 17,
CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT = 18,
CONDITION_SOURCE_TYPE_QUEST_ACCEPT = 19,
- CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK = 20,
+ // Condition source type 20 unused
CONDITION_SOURCE_TYPE_VEHICLE_SPELL = 21,
CONDITION_SOURCE_TYPE_SMART_EVENT = 22,
CONDITION_SOURCE_TYPE_NPC_VENDOR = 23,
diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h
index a6445b27a44..8431f369b69 100644
--- a/src/server/game/DataStores/DBCStructure.h
+++ b/src/server/game/DataStores/DBCStructure.h
@@ -192,6 +192,17 @@ struct AreaTableEntry
return true;
return (flags & AREA_FLAG_SANCTUARY) != 0;
}
+
+ bool IsFlyable() const
+ {
+ if (flags & AREA_FLAG_OUTLAND)
+ {
+ if (!(flags & AREA_FLAG_NO_FLY_ZONE))
+ return true;
+ }
+
+ return false;
+ }
};
#define MAX_GROUP_AREA_IDS 6
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index bed9123ac4c..9df9d2ad53c 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -1695,6 +1695,7 @@ void Creature::setDeathState(DeathState s)
SetLootRecipient(nullptr);
ResetPlayerDamageReq();
+ SetCannotReachTarget(false);
UpdateMovementFlags();
ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_IGNORE_PATHFINDING));
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 8c43d287c91..f1365ac3150 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -310,6 +310,18 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
if (map->Is25ManRaid())
loot.maxDuplicates = 3;
+ if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry())
+ {
+ GameObject* linkedGO = new GameObject();
+ if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map, phaseMask, pos, rotation, 255, GO_STATE_READY))
+ {
+ SetLinkedTrap(linkedGO);
+ map->AddToMap(linkedGO);
+ }
+ else
+ delete linkedGO;
+ }
+
return true;
}
@@ -428,6 +440,10 @@ void GameObject::Update(uint32 diff)
m_SkillupList.clear();
m_usetimes = 0;
+ // If nearby linked trap exists, respawn it
+ if (GameObject* linkedTrap = GetLinkedTrap())
+ linkedTrap->SetLootState(GO_READY);
+
switch (GetGoType())
{
case GAMEOBJECT_TYPE_FISHINGNODE: // can't fish now
@@ -511,11 +527,9 @@ void GameObject::Update(uint32 diff)
if (Unit* owner = GetOwner())
{
// Hunter trap: Search units which are unfriendly to the trap's owner
- Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
- Trinity::UnitSearcher<Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
- VisitNearbyGridObject(radius, searcher);
- if (!target)
- VisitNearbyWorldObject(radius, searcher);
+ Trinity::NearestAttackableNoTotemUnitInObjectRangeCheck checker(this, owner, radius);
+ Trinity::UnitLastSearcher<Trinity::NearestAttackableNoTotemUnitInObjectRangeCheck> searcher(this, target, checker);
+ VisitNearbyObject(radius, searcher);
}
else
{
@@ -613,6 +627,10 @@ void GameObject::Update(uint32 diff)
}
case GO_JUST_DEACTIVATED:
{
+ // If nearby linked trap exists, despawn it
+ if (GameObject* linkedTrap = GetLinkedTrap())
+ linkedTrap->SetLootState(GO_JUST_DEACTIVATED);
+
//if Gameobject should cast spell, then this, but some GOs (type = 10) should be destroyed
if (GetGoType() == GAMEOBJECT_TYPE_GOOBER)
{
@@ -1092,25 +1110,8 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
if (!trapSpell) // checked at load already
return;
- float range = float(target->GetSpellMaxRangeForTarget(GetOwner(), trapSpell));
-
- // search nearest linked GO
- GameObject* trapGO = nullptr;
- {
- // using original GO distance
- CellCoord p(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY()));
- Cell cell(p);
-
- Trinity::NearestGameObjectEntryInObjectRangeCheck go_check(*target, trapEntry, range);
- Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck> checker(this, trapGO, go_check);
-
- TypeContainerVisitor<Trinity::GameObjectLastSearcher<Trinity::NearestGameObjectEntryInObjectRangeCheck>, GridTypeMapContainer > object_checker(checker);
- cell.Visit(p, object_checker, *GetMap(), *target, range);
- }
-
- // found correct GO
- if (trapGO)
- trapGO->CastSpell(target, trapInfo->trap.spellId);
+ if (GameObject* trapGO = GetLinkedTrap())
+ trapGO->CastSpell(target, trapSpell->Id);
}
GameObject* GameObject::LookupFishingHoleAround(float range)
@@ -1828,18 +1829,23 @@ void GameObject::CastSpell(Unit* target, uint32 spellId, TriggerCastFlags trigge
if (!trigger)
return;
+ // remove immunity flags, to allow spell to target anything
+ trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_IMMUNE_TO_PC);
+
if (Unit* owner = GetOwner())
{
trigger->setFaction(owner->getFaction());
if (owner->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE))
trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
+ // copy pvp state flags from owner
+ trigger->SetByteValue(UNIT_FIELD_BYTES_2, 1, owner->GetByteValue(UNIT_FIELD_BYTES_2, 1));
// needed for GO casts for proper target validation checks
trigger->SetOwnerGUID(owner->GetGUID());
trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, owner->GetGUID());
}
else
{
- trigger->setFaction(14);
+ trigger->setFaction(spellInfo->IsPositive() ? 35 : 14);
// Set owner guid for target if no owner available - needed by trigger auras
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
trigger->CastSpell(target ? target : trigger, spellInfo, triggered, nullptr, nullptr, target ? target->GetGUID() : ObjectGuid::Empty);
@@ -2231,6 +2237,11 @@ bool GameObject::IsLootAllowedFor(Player const* player) const
return true;
}
+GameObject* GameObject::GetLinkedTrap()
+{
+ return ObjectAccessor::GetGameObject(*this, m_linkedTrap);
+}
+
void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* target) const
{
if (!target)
diff --git a/src/server/game/Entities/GameObject/GameObject.h b/src/server/game/Entities/GameObject/GameObject.h
index 85b37abaf3c..dc7d99bb622 100644
--- a/src/server/game/Entities/GameObject/GameObject.h
+++ b/src/server/game/Entities/GameObject/GameObject.h
@@ -495,6 +495,7 @@ struct GameObjectTemplate
{
switch (type)
{
+ case GAMEOBJECT_TYPE_BUTTON: return button.linkedTrap;
case GAMEOBJECT_TYPE_CHEST: return chest.linkedTrapId;
case GAMEOBJECT_TYPE_SPELL_FOCUS: return spellFocus.linkedTrapId;
case GAMEOBJECT_TYPE_GOOBER: return goober.linkedTrapId;
@@ -818,6 +819,9 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
uint32 m_groupLootTimer; // (msecs)timer used for group loot
ObjectGuid::LowType lootingGroupLowGUID; // used to find group which is looting
+ GameObject* GetLinkedTrap();
+ void SetLinkedTrap(GameObject* linkedTrap) { m_linkedTrap = linkedTrap->GetGUID(); }
+
bool hasQuest(uint32 quest_id) const override;
bool hasInvolvedQuest(uint32 quest_id) const override;
bool ActivateToQuest(Player* target) const;
@@ -925,6 +929,9 @@ class TC_GAME_API GameObject : public WorldObject, public GridObject<GameObject>
ObjectGuid m_lootRecipient;
uint32 m_lootRecipientGroup;
uint16 m_LootMode; // bitmask, default LOOT_MODE_DEFAULT, determines what loot will be lootable
+
+ ObjectGuid m_linkedTrap;
+
private:
void RemoveFromOwner();
void SwitchDoorOrButton(bool activate, bool alternative = false);
diff --git a/src/server/game/Entities/Item/Item.cpp b/src/server/game/Entities/Item/Item.cpp
index 3946e110c26..1173831be0b 100644
--- a/src/server/game/Entities/Item/Item.cpp
+++ b/src/server/game/Entities/Item/Item.cpp
@@ -824,13 +824,13 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
{
ItemTemplate const* proto = GetTemplate();
+ bool const isEnchantSpell = spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM) || spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM_TEMPORARY) || spellInfo->HasEffect(SPELL_EFFECT_ENCHANT_ITEM_PRISMATIC);
if (spellInfo->EquippedItemClass != -1) // -1 == any item class
{
// Special case - accept vellum for armor/weapon requirements
- if ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum())
- ||(spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum()))
- if (spellInfo->IsAbilityOfSkillType(SKILL_ENCHANTING)) // only for enchanting spells
- return true;
+ if (isEnchantSpell && ((spellInfo->EquippedItemClass == ITEM_CLASS_ARMOR && proto->IsArmorVellum())
+ || (spellInfo->EquippedItemClass == ITEM_CLASS_WEAPON && proto->IsWeaponVellum())))
+ return true;
if (spellInfo->EquippedItemClass != int32(proto->Class))
return false; // wrong item class
@@ -842,7 +842,7 @@ bool Item::IsFitToSpellRequirements(SpellInfo const* spellInfo) const
}
}
- if (spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
+ if (isEnchantSpell && spellInfo->EquippedItemInventoryTypeMask != 0) // 0 == any inventory type
{
// Special case - accept weapon type for main and offhand requirements
if (proto->InventoryType == INVTYPE_WEAPON &&
@@ -1346,7 +1346,7 @@ bool Item::ItemContainerLoadLootFromDB()
// If container item is in a bag, add that player as an allowed looter
if (GetBagSlot())
- loot_item.allowedGUIDs.insert(GetOwner()->GetGUID().GetCounter());
+ loot_item.AddAllowedLooter(GetOwner());
// Finally add the LootItem to the container
loot.items.push_back(loot_item);
diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp
index f7d4fb38cee..a5f5aa18b1d 100644
--- a/src/server/game/Entities/Object/Object.cpp
+++ b/src/server/game/Entities/Object/Object.cpp
@@ -173,7 +173,7 @@ void Object::BuildCreateUpdateBlockForPlayer(UpdateData* data, Player* target) c
if (flags & UPDATEFLAG_STATIONARY_POSITION)
{
// UPDATETYPE_CREATE_OBJECT2 dynamic objects, corpses...
- if (isType(TYPEMASK_DYNAMICOBJECT) || isType(TYPEMASK_CORPSE) || isType(TYPEMASK_PLAYER))
+ if (isType(TYPEMASK_DYNAMICOBJECT | TYPEMASK_CORPSE | TYPEMASK_PLAYER))
updateType = UPDATETYPE_CREATE_OBJECT2;
// UPDATETYPE_CREATE_OBJECT2 for pets...
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index 59b109ab754..3e0f9078c2c 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -939,12 +939,21 @@ uint32 Player::EnvironmentalDamage(EnviromentalDamage type, uint32 damage)
// Absorb, resist some environmental damage type
uint32 absorb = 0;
uint32 resist = 0;
- if (type == DAMAGE_LAVA)
- CalcAbsorbResist(this, SPELL_SCHOOL_MASK_FIRE, DIRECT_DAMAGE, damage, &absorb, &resist);
- else if (type == DAMAGE_SLIME)
- CalcAbsorbResist(this, SPELL_SCHOOL_MASK_NATURE, DIRECT_DAMAGE, damage, &absorb, &resist);
-
- damage -= absorb + resist;
+ switch (type)
+ {
+ case DAMAGE_LAVA:
+ case DAMAGE_SLIME:
+ {
+ DamageInfo dmgInfo(this, this, damage, nullptr, type == DAMAGE_LAVA ? SPELL_SCHOOL_MASK_FIRE : SPELL_SCHOOL_MASK_NATURE, DIRECT_DAMAGE, BASE_ATTACK);
+ CalcAbsorbResist(dmgInfo);
+ absorb = dmgInfo.GetAbsorb();
+ resist = dmgInfo.GetResist();
+ damage = dmgInfo.GetDamage();
+ break;
+ }
+ default:
+ break;
+ }
DealDamageMods(this, damage, &absorb);
@@ -3314,7 +3323,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
if (active)
{
if (spellInfo->IsPassive() && IsNeedCastPassiveSpellAtLearn(spellInfo))
- CastSpell (this, spellId, true);
+ CastSpell(this, spellId, true);
}
else if (IsInWorld())
{
@@ -3588,6 +3597,15 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
bool need_cast = (!spellInfo->Stances || (form && (spellInfo->Stances & (UI64LIT(1) << (form - 1)))) ||
(!form && spellInfo->HasAttribute(SPELL_ATTR2_NOT_NEED_SHAPESHIFT)));
+ // Check EquippedItemClass
+ // passive spells which apply aura and have an item requirement are to be added in Player::ApplyItemDependentAuras
+ if (spellInfo->IsPassive() && spellInfo->EquippedItemClass >= 0)
+ {
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if (spellInfo->Effects[i].IsAura())
+ return false;
+ }
+
//Check CasterAuraStates
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraStateType(spellInfo->CasterAuraState)));
}
@@ -4216,9 +4234,10 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
charDelete_method = CHAR_DELETE_REMOVE;
}
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
if (ObjectGuid::LowType guildId = GetGuildIdFromDB(playerguid))
if (Guild* guild = sGuildMgr->GetGuildById(guildId))
- guild->DeleteMember(playerguid, false, false, true);
+ guild->DeleteMember(trans, playerguid, false, false, true);
// close player ticket if any
GmTicket* ticket = sTicketMgr->GetTicketByPlayer(playerguid);
@@ -4245,8 +4264,6 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
// Completely remove from the database
case CHAR_DELETE_REMOVE:
{
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
-
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHAR_COD_ITEM_MAIL);
stmt->setUInt32(0, guid);
PreparedQueryResult resultMail = CharacterDatabase.Query(stmt);
@@ -4535,26 +4552,27 @@ void Player::DeleteFromDB(ObjectGuid playerguid, uint32 accountId, bool updateRe
trans->Append(stmt);
Corpse::DeleteFromDB(playerguid, trans);
-
- CharacterDatabase.CommitTransaction(trans);
break;
}
// The character gets unlinked from the account, the name gets freed up and appears as deleted ingame
case CHAR_DELETE_UNLINK:
{
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_DELETE_INFO);
-
stmt->setUInt32(0, guid);
-
- CharacterDatabase.Execute(stmt);
+ trans->Append(stmt);
break;
}
default:
TC_LOG_ERROR("entities.player.cheat", "Player::DeleteFromDB: Tried to delete player (%s) with unsupported delete method (%u).",
playerguid.ToString().c_str(), charDelete_method);
+
+ if (trans->GetSize() > 0)
+ CharacterDatabase.CommitTransaction(trans);
return;
}
+ CharacterDatabase.CommitTransaction(trans);
+
if (updateRealmChars)
sWorld->UpdateRealmCharCount(accountId);
@@ -7377,20 +7395,16 @@ void Player::_ApplyItemMods(Item* item, uint8 slot, bool apply)
TC_LOG_DEBUG("entities.player.items", "Player::_ApplyItemMods: Applying mods for item %s", item->GetGUID().ToString().c_str());
- uint8 attacktype = Player::GetAttackBySlot(slot);
-
if (proto->Socket[0].Color) //only (un)equipping of items with sockets can influence metagems, so no need to waste time with normal items
CorrectMetaGemEnchants(slot, apply);
- if (attacktype < MAX_ATTACK)
- _ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), apply);
-
_ApplyItemBonuses(proto, slot, apply);
if (slot == EQUIPMENT_SLOT_RANGED)
_ApplyAmmoBonuses();
ApplyItemEquipSpell(item, apply);
+ ApplyItemDependentAuras(item, apply);
ApplyEnchantment(item, apply);
TC_LOG_DEBUG("entities.player.items", "Player::_ApplyItemMods: completed");
@@ -7744,86 +7758,26 @@ void Player::_ApplyWeaponDamage(uint8 slot, ItemTemplate const* proto, ScalingSt
UpdateDamagePhysical(attType);
}
-void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackType, bool apply)
-{
- AuraEffectList const& auraCritList = GetAuraEffectsByType(SPELL_AURA_MOD_WEAPON_CRIT_PERCENT);
- for (AuraEffectList::const_iterator itr = auraCritList.begin(); itr != auraCritList.end(); ++itr)
- _ApplyWeaponDependentAuraCritMod(item, attackType, *itr, apply);
-
- AuraEffectList const& auraDamageFlatList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE);
- for (AuraEffectList::const_iterator itr = auraDamageFlatList.begin(); itr != auraDamageFlatList.end(); ++itr)
- _ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
-
- AuraEffectList const& auraDamagePctList = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
- for (AuraEffectList::const_iterator itr = auraDamagePctList.begin(); itr != auraDamagePctList.end(); ++itr)
- _ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
-}
-
-void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply)
-{
- // don't apply mod if item is broken or cannot be used
- if (item->IsBroken() || !CanUseAttackType(attackType))
- return;
-
- // generic not weapon specific case processes in aura code
- if (aura->GetSpellInfo()->EquippedItemClass == -1)
- return;
-
- BaseModGroup mod;
- switch (attackType)
- {
- case BASE_ATTACK: mod = CRIT_PERCENTAGE; break;
- case OFF_ATTACK: mod = OFFHAND_CRIT_PERCENTAGE;break;
- case RANGED_ATTACK: mod = RANGED_CRIT_PERCENTAGE; break;
- default: return;
- }
-
- if (item->IsFitToSpellRequirements(aura->GetSpellInfo()))
- HandleBaseModValue(mod, FLAT_MOD, float (aura->GetAmount()), apply);
-}
-
-void Player::_ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply)
+void Player::ApplyItemDependentAuras(Item* item, bool apply)
{
- // don't apply mod if item is broken or cannot be used
- if (item->IsBroken() || !CanUseAttackType(attackType))
- return;
-
- // ignore spell mods for not wands
- if ((aura->GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) == 0 && (getClassMask() & CLASSMASK_WAND_USERS) == 0)
- return;
-
- // generic not weapon specific case processes in aura code
- if (aura->GetSpellInfo()->EquippedItemClass == -1)
- return;
-
- UnitMods unitMod;
- switch (attackType)
+ if (apply)
{
- case BASE_ATTACK: unitMod = UNIT_MOD_DAMAGE_MAINHAND; break;
- case OFF_ATTACK: unitMod = UNIT_MOD_DAMAGE_OFFHAND; break;
- case RANGED_ATTACK: unitMod = UNIT_MOD_DAMAGE_RANGED; break;
- default: return;
- }
+ PlayerSpellMap const& spells = GetSpellMap();
+ for (auto itr = spells.begin(); itr != spells.end(); ++itr)
+ {
+ if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled)
+ continue;
- UnitModifierType unitModType;
- switch (aura->GetAuraType())
- {
- case SPELL_AURA_MOD_DAMAGE_DONE: unitModType = TOTAL_VALUE; break;
- case SPELL_AURA_MOD_DAMAGE_PERCENT_DONE: unitModType = TOTAL_PCT; break;
- default: return;
- }
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
+ if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0)
+ continue;
- if (item->IsFitToSpellRequirements(aura->GetSpellInfo()))
- {
- HandleStatModifier(unitMod, unitModType, float(aura->GetAmount()), apply);
- if (unitModType == TOTAL_VALUE)
- {
- if (aura->GetAmount() > 0)
- ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, aura->GetAmount(), apply);
- else
- ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, aura->GetAmount(), apply);
+ if (!HasAura(itr->first) && HasItemFitToSpellRequirements(spellInfo))
+ AddAura(itr->first, this); // no SMSG_SPELL_GO in sniff found
}
}
+ else
+ RemoveItemDependentAurasAndCasts(item);
}
void Player::ApplyItemEquipSpell(Item* item, bool apply, bool form_change)
@@ -8198,10 +8152,7 @@ void Player::_RemoveAllItemMods()
if (!proto)
continue;
- uint32 attacktype = Player::GetAttackBySlot(i);
- if (attacktype < MAX_ATTACK)
- _ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), false);
-
+ ApplyItemDependentAuras(m_items[i], false);
_ApplyItemBonuses(proto, i, false);
if (i == EQUIPMENT_SLOT_RANGED)
@@ -8227,10 +8178,7 @@ void Player::_ApplyAllItemMods()
if (!proto)
continue;
- uint32 attacktype = Player::GetAttackBySlot(i);
- if (attacktype < MAX_ATTACK)
- _ApplyWeaponDependentAuraMods(m_items[i], WeaponAttackType(attacktype), true);
-
+ ApplyItemDependentAuras(m_items[i], true);
_ApplyItemBonuses(proto, i, true);
if (i == EQUIPMENT_SLOT_RANGED)
@@ -12221,9 +12169,6 @@ void Player::RemoveItem(uint8 bag, uint8 slot, bool update)
// remove item dependent auras and casts (only weapon and armor slots)
if (slot < EQUIPMENT_SLOT_END)
{
- if (update)
- RemoveItemDependentAurasAndCasts(pItem);
-
// remove held enchantments, update expertise
if (slot == EQUIPMENT_SLOT_MAINHAND)
{
@@ -12374,9 +12319,6 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
if (slot < EQUIPMENT_SLOT_END)
{
- // remove item dependent auras and casts (only weapon and armor slots)
- RemoveItemDependentAurasAndCasts(pItem);
-
// update expertise and armor penetration - passive auras may need it
switch (slot)
{
@@ -15011,20 +14953,20 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
{
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
{
- if (quest->RequiredItemCount[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
- DestroyItemCount(quest->RequiredItemId[i], 9999, true, true);
+ if (quest->RequiredItemCount[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM && !quest->IsRepeatable() && !HasQuestForItem(quest->RequiredItemId[i], quest_id, true))
+ DestroyItemCount(quest->RequiredItemId[i], 9999, true);
else
- DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true, true);
+ DestroyItemCount(quest->RequiredItemId[i], quest->RequiredItemCount[i], true);
}
}
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
{
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
{
- if (quest->ItemDropQuantity[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
- DestroyItemCount(quest->ItemDrop[i], 9999, true, true);
+ if (quest->ItemDropQuantity[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM && !quest->IsRepeatable() && !HasQuestForItem(quest->ItemDrop[i], quest_id))
+ DestroyItemCount(quest->ItemDrop[i], 9999, true);
else
- DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true, true);
+ DestroyItemCount(quest->ItemDrop[i], quest->ItemDropQuantity[i], true);
}
}
@@ -15244,13 +15186,13 @@ void Player::FailQuest(uint32 questId)
// Destroy quest items on quest failure.
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
- if (quest->RequiredItemCount[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
- DestroyItemCount(quest->RequiredItemId[i], 9999, true, true);
+ if (quest->RequiredItemCount[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
+ DestroyItemCount(quest->RequiredItemId[i], 9999, true);
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
- if (quest->ItemDropQuantity[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
- DestroyItemCount(quest->ItemDrop[i], 9999, true, true);
+ if (quest->ItemDropQuantity[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
+ DestroyItemCount(quest->ItemDrop[i], 9999, true);
}
}
@@ -15261,13 +15203,13 @@ void Player::AbandonQuest(uint32 questId)
// Destroy quest items on quest abandon.
for (uint8 i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->RequiredItemId[i]))
- if (quest->RequiredItemCount[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
- DestroyItemCount(quest->RequiredItemId[i], 9999, true, true);
+ if (quest->RequiredItemCount[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
+ DestroyItemCount(quest->RequiredItemId[i], 9999, true);
for (uint8 i = 0; i < QUEST_SOURCE_ITEM_IDS_COUNT; ++i)
if (ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(quest->ItemDrop[i]))
- if (quest->ItemDropQuantity[i] > 0 && (itemTemplate->Bonding == BIND_QUEST_ITEM || itemTemplate->Bonding == BIND_QUEST_ITEM1))
- DestroyItemCount(quest->ItemDrop[i], 9999, true, true);
+ if (quest->ItemDropQuantity[i] > 0 && itemTemplate->Bonding == BIND_QUEST_ITEM)
+ DestroyItemCount(quest->ItemDrop[i], 9999, true);
}
}
@@ -15971,7 +15913,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
if (!quest)
continue;
- if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId(), this))
+ if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_QUEST_ACCEPT, quest->GetQuestId(), this))
continue;
QuestStatus status = GetQuestStatus(questId);
@@ -15995,7 +15937,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver)
if (!quest)
continue;
- if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_QUEST_SHOW_MARK, quest->GetQuestId(), this))
+ if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_QUEST_ACCEPT, quest->GetQuestId(), this))
continue;
QuestStatus status = GetQuestStatus(questId);
@@ -16566,12 +16508,12 @@ void Player::ReputationChanged2(FactionEntry const* factionEntry)
}
}
-bool Player::HasQuestForItem(uint32 itemid) const
+bool Player::HasQuestForItem(uint32 itemid, uint32 excludeQuestId /* 0 */, bool turnIn /* false */) const
{
for (uint8 i = 0; i < MAX_QUEST_LOG_SIZE; ++i)
{
uint32 questid = GetQuestSlotQuestId(i);
- if (questid == 0)
+ if (questid == 0 || questid == excludeQuestId)
continue;
QuestStatusMap::const_iterator qs_itr = m_QuestStatus.find(questid);
@@ -16580,7 +16522,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
QuestStatusData const& q_status = qs_itr->second;
- if (q_status.Status == QUEST_STATUS_INCOMPLETE)
+ if ((q_status.Status == QUEST_STATUS_INCOMPLETE) || (turnIn && q_status.Status == QUEST_STATUS_COMPLETE))
{
Quest const* qinfo = sObjectMgr->GetQuestTemplate(questid);
if (!qinfo)
@@ -16595,7 +16537,7 @@ bool Player::HasQuestForItem(uint32 itemid) const
// This part for ReqItem drop
for (uint8 j = 0; j < QUEST_ITEM_OBJECTIVES_COUNT; ++j)
{
- if (itemid == qinfo->RequiredItemId[j] && q_status.ItemCount[j] < qinfo->RequiredItemCount[j])
+ if ((itemid == qinfo->RequiredItemId[j] && q_status.ItemCount[j] < qinfo->RequiredItemCount[j]) || (turnIn && q_status.ItemCount[j] >= qinfo->RequiredItemCount[j]))
return true;
}
// This part - for ReqSource
@@ -16605,17 +16547,17 @@ bool Player::HasQuestForItem(uint32 itemid) const
if (qinfo->ItemDrop[j] == itemid)
{
ItemTemplate const* pProto = sObjectMgr->GetItemTemplate(itemid);
-
+ uint32 ownedCount = GetItemCount(itemid, true);
// 'unique' item
- if (pProto->MaxCount && int32(GetItemCount(itemid, true)) < pProto->MaxCount)
+ if ((pProto->MaxCount && int32(ownedCount) < pProto->MaxCount) || (turnIn && int32(ownedCount) >= pProto->MaxCount))
return true;
// allows custom amount drop when not 0
if (qinfo->ItemDropQuantity[j])
{
- if (GetItemCount(itemid, true) < qinfo->ItemDropQuantity[j])
+ if ((ownedCount < qinfo->ItemDropQuantity[j]) || (turnIn && ownedCount >= qinfo->ItemDropQuantity[j]))
return true;
- } else if (GetItemCount(itemid, true) < pProto->GetMaxStackSize())
+ } else if (ownedCount < pProto->GetMaxStackSize())
return true;
}
}
@@ -19558,7 +19500,6 @@ void Player::_SaveAuras(SQLTransaction& trans)
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_AURA);
stmt->setUInt32(index++, GetGUID().GetCounter());
stmt->setUInt64(index++, itr->second->GetCasterGUID().GetRawValue());
- stmt->setUInt64(index++, itr->second->GetCastItemGUID().GetRawValue());
stmt->setUInt32(index++, itr->second->GetId());
stmt->setUInt8(index++, effMask);
stmt->setUInt8(index++, recalculateMask);
@@ -20873,29 +20814,30 @@ void Player::AddSpellMod(SpellModifier* mod, bool apply)
TC_LOG_DEBUG("spells", "Player::AddSpellMod: Player '%s' (%s), SpellID: %d", GetName().c_str(), GetGUID().ToString().c_str(), mod->spellId);
uint16 Opcode = (mod->type == SPELLMOD_FLAT) ? SMSG_SET_FLAT_SPELL_MODIFIER : SMSG_SET_PCT_SPELL_MODIFIER;
- int i = 0;
- flag96 _mask = 0;
- for (int32 eff = 0; eff < 96; ++eff)
+ flag96 modMask;
+ for (uint8 i = 0; i < 3; ++i)
{
- if (eff != 0 && eff % 32 == 0)
- _mask[i++] = 0;
-
- _mask[i] = uint32(1) << (eff - (32 * i));
- if ((mod->mask & _mask))
+ for (uint32 eff = 0; eff < 32; ++eff)
{
- int32 val = 0;
- for (SpellModifier* spellMod : m_spellMods[mod->op])
+ modMask[i] = uint32(1) << eff;
+ if ((mod->mask & modMask))
{
- if (spellMod->type == mod->type && (spellMod->mask & _mask))
- val += spellMod->value;
+ int32 val = 0;
+ for (SpellModifier* spellMod : m_spellMods[mod->op])
+ {
+ if (spellMod->type == mod->type && (spellMod->mask & modMask))
+ val += spellMod->value;
+ }
+ val += apply ? mod->value : -(mod->value);
+ WorldPacket data(Opcode, (1 + 1 + 4));
+ data << uint8(eff + 32 * i);
+ data << uint8(mod->op);
+ data << int32(val);
+ SendDirectMessage(&data);
}
- val += apply ? mod->value : -(mod->value);
- WorldPacket data(Opcode, (1 + 1 + 4));
- data << uint8(eff);
- data << uint8(mod->op);
- data << int32(val);
- SendDirectMessage(&data);
}
+
+ modMask[i] = 0;
}
if (apply)
@@ -23582,9 +23524,9 @@ void Player::RemoveItemDependentAurasAndCasts(Item* pItem)
{
Aura* aura = itr->second;
- // skip passive (passive item dependent spells work in another way) and not self applied auras
+ // skip not self applied auras
SpellInfo const* spellInfo = aura->GetSpellInfo();
- if (aura->IsPassive() || aura->GetCasterGUID() != GetGUID())
+ if (aura->GetCasterGUID() != GetGUID())
{
++itr;
continue;
@@ -24629,9 +24571,9 @@ void Player::AutoStoreLoot(uint8 bag, uint8 slot, uint32 loot_id, LootStore cons
void Player::StoreLootItem(uint8 lootSlot, Loot* loot)
{
- QuestItem* qitem = nullptr;
- QuestItem* ffaitem = nullptr;
- QuestItem* conditem = nullptr;
+ NotNormalLootItem* qitem = nullptr;
+ NotNormalLootItem* ffaitem = nullptr;
+ NotNormalLootItem* conditem = nullptr;
LootItem* item = loot->LootItemInSlot(lootSlot, this, &qitem, &ffaitem, &conditem);
@@ -25883,6 +25825,20 @@ void Player::ActivateSpec(uint8 spec)
UnsummonAllTotems();
ExitVehicle();
RemoveAllControlled();
+
+ // remove single target auras at other targets
+ AuraList& scAuras = GetSingleCastAuras();
+ for (AuraList::iterator iter = scAuras.begin(); iter != scAuras.end();)
+ {
+ Aura* aura = *iter;
+ if (aura->GetUnitOwner() != this)
+ {
+ aura->Remove();
+ iter = scAuras.begin();
+ }
+ else
+ ++iter;
+ }
/*RemoveAllAurasOnDeath();
if (GetPet())
GetPet()->RemoveAllAurasOnDeath();*/
@@ -26000,6 +25956,13 @@ void Player::ActivateSpec(uint8 spec)
SetPower(POWER_MANA, 0); // Mana must be 0 even if it isn't the active power type.
SetPower(pw, 0);
+
+ Unit::AuraEffectList const& shapeshiftAuras = GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT);
+ for (AuraEffect* aurEff : shapeshiftAuras)
+ {
+ aurEff->HandleShapeshiftBoosts(this, false);
+ aurEff->HandleShapeshiftBoosts(this, true);
+ }
}
void Player::ResetTimeSync()
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index 4ecdad742e9..ed5dc7e954f 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1406,7 +1406,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void MoneyChanged(uint32 value);
void ReputationChanged(FactionEntry const* factionEntry);
void ReputationChanged2(FactionEntry const* factionEntry);
- bool HasQuestForItem(uint32 itemId) const;
+ bool HasQuestForItem(uint32 itemId, uint32 excludeQuestId = 0, bool turnIn = false) const;
bool HasQuestForGO(int32 goId) const;
void UpdateForQuestWorldObjects();
bool CanShareQuest(uint32 questId) const;
@@ -1958,9 +1958,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
void ResetAllPowers();
- void _ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackType, bool apply);
- void _ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
- void _ApplyWeaponDependentAuraDamageMod(Item* item, WeaponAttackType attackType, AuraEffect const* aura, bool apply);
+ void ApplyItemDependentAuras(Item* item, bool apply);
void _ApplyItemMods(Item* item, uint8 slot, bool apply);
void _RemoveAllItemMods();
diff --git a/src/server/game/Entities/Transport/Transport.cpp b/src/server/game/Entities/Transport/Transport.cpp
index fad197949a8..cdb4b931a07 100644
--- a/src/server/game/Entities/Transport/Transport.cpp
+++ b/src/server/game/Entities/Transport/Transport.cpp
@@ -131,6 +131,7 @@ void Transport::Update(uint32 diff)
m_goValue.Transport.PathProgress += diff;
uint32 timer = m_goValue.Transport.PathProgress % GetTransportPeriod();
+ bool justStopped = false;
// Set current waypoint
// Desired outcome: _currentFrame->DepartureTime < timer < _nextFrame->ArriveTime
@@ -149,6 +150,7 @@ void Transport::Update(uint32 diff)
if (timer < _currentFrame->DepartureTime)
{
SetMoving(false);
+ justStopped = true;
if (_pendingStop && GetGoState() != GO_STATE_READY)
{
SetGoState(GO_STATE_READY);
@@ -203,12 +205,14 @@ void Transport::Update(uint32 diff)
_positionChangeTimer.Reset(positionUpdateDelay);
if (IsMoving())
{
- float t = CalculateSegmentPos(float(timer) * 0.001f);
+ float t = !justStopped ? CalculateSegmentPos(float(timer) * 0.001f) : 1.0f;
G3D::Vector3 pos, dir;
_currentFrame->Spline->evaluate_percent(_currentFrame->Index, t, pos);
_currentFrame->Spline->evaluate_derivative(_currentFrame->Index, t, dir);
UpdatePosition(pos.x, pos.y, pos.z, std::atan2(dir.y, dir.x) + float(M_PI));
}
+ else if (justStopped)
+ UpdatePosition(_currentFrame->Node->LocX, _currentFrame->Node->LocY, _currentFrame->Node->LocZ, _currentFrame->InitialOrientation);
else
{
/* There are four possible scenarios that trigger loading/unloading passengers:
diff --git a/src/server/game/Entities/Unit/StatSystem.cpp b/src/server/game/Entities/Unit/StatSystem.cpp
index 699709fabb1..0cad0b2cb05 100644
--- a/src/server/game/Entities/Unit/StatSystem.cpp
+++ b/src/server/game/Entities/Unit/StatSystem.cpp
@@ -184,8 +184,17 @@ void Player::UpdateSpellDamageAndHealingBonus()
// Get healing bonus for all schools
SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
// Get damage bonus for all schools
- for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
- SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)));
+ Unit::AuraEffectList const& modDamageAuras = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE);
+ for (uint16 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ {
+ SetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i, std::accumulate(modDamageAuras.begin(), modDamageAuras.end(), 0, [i](int32 negativeMod, AuraEffect const* aurEff)
+ {
+ if (aurEff->GetAmount() < 0 && aurEff->GetMiscValue() & (1 << i))
+ negativeMod += aurEff->GetAmount();
+ return negativeMod;
+ }));
+ SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)) - GetInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG + i));
+ }
}
bool Player::UpdateAllStats()
@@ -530,9 +539,9 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
break;
}
- float attackSpeedMod = GetAPMultiplier(attType, normalized);
+ float const attackPowerMod = std::max(GetAPMultiplier(attType, normalized), 0.25f);
- float baseValue = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) / 14.0f * attackSpeedMod;
+ float baseValue = GetModifierValue(unitMod, BASE_VALUE) + GetTotalAttackPowerValue(attType) / 14.0f * attackPowerMod;
float basePct = GetModifierValue(unitMod, BASE_PCT);
float totalValue = GetModifierValue(unitMod, TOTAL_VALUE);
float totalPct = addTotalPct ? GetModifierValue(unitMod, TOTAL_PCT) : 1.0f;
@@ -546,8 +555,8 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
if (lvl > 60)
lvl = 60;
- weaponMinDamage = lvl * 0.85f * attackSpeedMod;
- weaponMaxDamage = lvl * 1.25f * attackSpeedMod;
+ weaponMinDamage = lvl * 0.85f * attackPowerMod;
+ weaponMaxDamage = lvl * 1.25f * attackPowerMod;
}
else if (!CanUseAttackType(attType)) // check if player not in form but still can't use (disarm case)
{
@@ -563,8 +572,8 @@ void Player::CalculateMinMaxDamage(WeaponAttackType attType, bool normalized, bo
}
else if (attType == RANGED_ATTACK) // add ammo DPS to ranged damage
{
- weaponMinDamage += GetAmmoDPS() * attackSpeedMod;
- weaponMaxDamage += GetAmmoDPS() * attackSpeedMod;
+ weaponMinDamage += GetAmmoDPS() * attackPowerMod;
+ weaponMaxDamage += GetAmmoDPS() * attackPowerMod;
}
minDamage = ((weaponMinDamage + baseValue) * basePct + totalValue) * totalPct;
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index cecec8660c7..7ff01efa363 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -112,7 +112,7 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
break;
}
- if (m_absorb)
+ if (dmgInfo.HitInfo & (HITINFO_PARTIAL_ABSORB | HITINFO_FULL_ABSORB))
m_hitMask |= PROC_HIT_ABSORB;
if (dmgInfo.HitInfo & HITINFO_FULL_RESIST)
@@ -121,6 +121,8 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
if (m_block)
m_hitMask |= PROC_HIT_BLOCK;
+ bool const damageNullified = (dmgInfo.HitInfo & (HITINFO_FULL_ABSORB | HITINFO_FULL_RESIST)) != 0 ||
+ (m_hitMask & (PROC_HIT_IMMUNE | PROC_HIT_FULL_BLOCK)) != 0;
switch (dmgInfo.hitOutCome)
{
case MELEE_HIT_MISS:
@@ -138,10 +140,12 @@ DamageInfo::DamageInfo(CalcDamageInfo const& dmgInfo)
case MELEE_HIT_CRUSHING:
case MELEE_HIT_GLANCING:
case MELEE_HIT_NORMAL:
- m_hitMask |= PROC_HIT_NORMAL;
+ if (!damageNullified)
+ m_hitMask |= PROC_HIT_NORMAL;
break;
case MELEE_HIT_CRIT:
- m_hitMask |= PROC_HIT_CRITICAL;
+ if (!damageNullified)
+ m_hitMask |= PROC_HIT_CRITICAL;
break;
default:
break;
@@ -161,7 +165,7 @@ DamageInfo::DamageInfo(SpellNonMeleeDamage const& spellNonMeleeDamage, DamageEff
void DamageInfo::ModifyDamage(int32 amount)
{
- amount = std::min(amount, int32(GetDamage()));
+ amount = std::max(amount, -static_cast<int32>(GetDamage()));
m_damage += amount;
}
@@ -179,7 +183,10 @@ void DamageInfo::ResistDamage(uint32 amount)
m_resist += amount;
m_damage -= amount;
if (!m_damage)
+ {
m_hitMask |= PROC_HIT_FULL_RESIST;
+ m_hitMask &= ~(PROC_HIT_NORMAL | PROC_HIT_CRITICAL);
+ }
}
void DamageInfo::BlockDamage(uint32 amount)
@@ -189,7 +196,10 @@ void DamageInfo::BlockDamage(uint32 amount)
m_damage -= amount;
m_hitMask |= PROC_HIT_BLOCK;
if (!m_damage)
+ {
m_hitMask |= PROC_HIT_FULL_BLOCK;
+ m_hitMask &= ~(PROC_HIT_NORMAL | PROC_HIT_CRITICAL);
+ }
}
uint32 DamageInfo::GetHitMask() const
@@ -294,9 +304,6 @@ Unit::Unit(bool isWorldObject) :
m_transform = 0;
m_canModifyStats = false;
- for (uint8 i = 0; i < MAX_SPELL_IMMUNITY; ++i)
- m_spellImmune[i].clear();
-
for (uint8 i = 0; i < UNIT_MOD_END; ++i)
{
m_auraModifiersGroup[i][BASE_VALUE] = 0.0f;
@@ -646,7 +653,7 @@ bool Unit::HasBreakableByDamageCrowdControlAura(Unit* excludeCasterChannel) cons
|| HasBreakableByDamageAuraType(SPELL_AURA_TRANSFORM, excludeAura));
}
-void Unit::DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb)
+void Unit::DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb) const
{
if (!victim || !victim->IsAlive() || victim->HasUnitState(UNIT_STATE_IN_FLIGHT) || (victim->GetTypeId() == TYPEID_UNIT && victim->ToCreature()->IsEvadingAttacks()))
{
@@ -967,7 +974,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castIte
CastSpell(victim, spellId, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
-void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags /*= TRIGGER_NONE*/, Item* castItem /*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/)
+void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags /*= TRIGGER_NONE*/, Item* castItem /*= nullptr*/, AuraEffect const* triggeredByAura /*= nullptr*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
@@ -979,7 +986,7 @@ void Unit::CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags
CastSpell(victim, spellInfo, triggerFlags, castItem, triggeredByAura, originalCaster);
}
-void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem/*= NULL*/, AuraEffect const* triggeredByAura /*= NULL*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/)
+void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem/*= nullptr*/, AuraEffect const* triggeredByAura /*= nullptr*/, ObjectGuid originalCaster /*= ObjectGuid::Empty*/)
{
CastSpell(victim, spellInfo, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
@@ -988,7 +995,7 @@ void Unit::CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags
{
SpellCastTargets targets;
targets.SetUnitTarget(victim);
- CastSpell(targets, spellInfo, NULL, triggerFlags, castItem, triggeredByAura, originalCaster);
+ CastSpell(targets, spellInfo, nullptr, triggerFlags, castItem, triggeredByAura, originalCaster);
}
void Unit::CastCustomSpell(Unit* target, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
@@ -1042,10 +1049,10 @@ void Unit::CastSpell(float x, float y, float z, uint32 spellId, bool triggered,
SpellCastTargets targets;
targets.SetDst(x, y, z, GetOrientation());
- CastSpell(targets, spellInfo, NULL, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
+ CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
-void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem, AuraEffect* triggeredByAura, ObjectGuid originalCaster)
+void Unit::CastSpell(float x, float y, float z, uint32 spellId, TriggerCastFlags triggerFlags, Item* castItem, AuraEffect const* triggeredByAura, ObjectGuid originalCaster)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
@@ -1054,26 +1061,23 @@ void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castI
return;
}
SpellCastTargets targets;
- targets.SetGOTarget(go);
+ targets.SetDst(x, y, z, GetOrientation());
- CastSpell(targets, spellInfo, NULL, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
+ CastSpell(targets, spellInfo, nullptr, triggerFlags, castItem, triggeredByAura, originalCaster);
}
-// Obsolete func need remove, here only for comotability vs another patches
-uint32 Unit::SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage)
+void Unit::CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem, AuraEffect* triggeredByAura, ObjectGuid originalCaster)
{
- SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
if (!spellInfo)
- return 0;
- SpellNonMeleeDamage damageInfo(this, victim, spellInfo->Id, spellInfo->SchoolMask);
- damage = SpellDamageBonusDone(victim, spellInfo, damage, SPELL_DIRECT_DAMAGE);
- damage = victim->SpellDamageBonusTaken(this, spellInfo, damage, SPELL_DIRECT_DAMAGE);
+ {
+ TC_LOG_ERROR("entities.unit", "CastSpell: unknown spell id %u by caster: %s %u)", spellId, (GetTypeId() == TYPEID_PLAYER ? "player (GUID:" : "creature (Entry:"), (GetTypeId() == TYPEID_PLAYER ? GetGUID().GetCounter() : GetEntry()));
+ return;
+ }
+ SpellCastTargets targets;
+ targets.SetGOTarget(go);
- CalculateSpellDamageTaken(&damageInfo, damage, spellInfo);
- DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
- SendSpellNonMeleeDamageLog(&damageInfo);
- DealSpellDamage(&damageInfo, true);
- return damageInfo.damage;
+ CastSpell(targets, spellInfo, nullptr, triggered ? TRIGGERED_FULL_MASK : TRIGGERED_NONE, castItem, triggeredByAura, originalCaster);
}
void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType, bool crit)
@@ -1144,8 +1148,11 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
// double blocked amount if block is critical
if (victim->isBlockCritical())
damageInfo->blocked += damageInfo->blocked;
- if (damage < int32(damageInfo->blocked))
+ if (damage <= int32(damageInfo->blocked))
+ {
damageInfo->blocked = uint32(damage);
+ damageInfo->fullBlock = true;
+ }
damage -= damageInfo->blocked;
}
@@ -1155,7 +1162,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
ApplyResilience(victim, nullptr, &damage, crit, CR_CRIT_TAKEN_RANGED);
break;
}
- // Magical Attacks
+ // Magical Attacks
case SPELL_DAMAGE_CLASS_NONE:
case SPELL_DAMAGE_CLASS_MAGIC:
{
@@ -1178,24 +1185,30 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
sScriptMgr->ModifySpellDamageTaken(damageInfo->target, damageInfo->attacker, damage);
// Calculate absorb resist
- if (damage > 0)
- {
- CalcAbsorbResist(victim, damageSchoolMask, SPELL_DIRECT_DAMAGE, damage, &damageInfo->absorb, &damageInfo->resist, spellInfo);
- damage -= damageInfo->absorb + damageInfo->resist;
- }
- else
+ if (damage < 0)
damage = 0;
damageInfo->damage = damage;
+ DamageInfo dmgInfo(*damageInfo, SPELL_DIRECT_DAMAGE, BASE_ATTACK, PROC_HIT_NONE);
+ CalcAbsorbResist(dmgInfo);
+ damageInfo->absorb = dmgInfo.GetAbsorb();
+ damageInfo->resist = dmgInfo.GetResist();
+
+ if (damageInfo->absorb)
+ damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB);
+
+ if (damageInfo->resist)
+ damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST);
+
+ damageInfo->damage = dmgInfo.GetDamage();
}
void Unit::DealSpellDamage(SpellNonMeleeDamage* damageInfo, bool durabilityLoss)
{
- if (damageInfo == 0)
+ if (!damageInfo)
return;
Unit* victim = damageInfo->target;
-
if (!victim)
return;
@@ -1396,7 +1409,10 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
{
damageInfo->procVictim |= PROC_FLAG_TAKEN_DAMAGE;
// Calculate absorb & resists
- CalcAbsorbResist(damageInfo->target, SpellSchoolMask(damageInfo->damageSchoolMask), DIRECT_DAMAGE, damageInfo->damage, &damageInfo->absorb, &damageInfo->resist);
+ DamageInfo dmgInfo(*damageInfo);
+ CalcAbsorbResist(dmgInfo);
+ damageInfo->absorb = dmgInfo.GetAbsorb();
+ damageInfo->resist = dmgInfo.GetResist();
if (damageInfo->absorb)
damageInfo->HitInfo |= (damageInfo->damage - damageInfo->absorb == 0 ? HITINFO_FULL_ABSORB : HITINFO_PARTIAL_ABSORB);
@@ -1404,7 +1420,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* dam
if (damageInfo->resist)
damageInfo->HitInfo |= (damageInfo->damage - damageInfo->resist == 0 ? HITINFO_FULL_RESIST : HITINFO_PARTIAL_RESIST);
- damageInfo->damage -= damageInfo->absorb + damageInfo->resist;
+ damageInfo->damage = dmgInfo.GetDamage();
}
else // Impossible get negative result but....
damageInfo->damage = 0;
@@ -1500,46 +1516,47 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
AuraEffectList vDamageShieldsCopy(victim->GetAuraEffectsByType(SPELL_AURA_DAMAGE_SHIELD));
- for (AuraEffectList::const_iterator dmgShieldItr = vDamageShieldsCopy.begin(); dmgShieldItr != vDamageShieldsCopy.end(); ++dmgShieldItr)
+ for (AuraEffect const* aurEff : vDamageShieldsCopy)
{
- SpellInfo const* i_spellProto = (*dmgShieldItr)->GetSpellInfo();
+ SpellInfo const* spellInfo = aurEff->GetSpellInfo();
+
// Damage shield can be resisted...
- if (SpellMissInfo missInfo = victim->SpellHitResult(this, i_spellProto, false))
+ SpellMissInfo missInfo = victim->SpellHitResult(this, spellInfo, false);
+ if (missInfo != SPELL_MISS_NONE)
{
- victim->SendSpellMiss(this, i_spellProto->Id, missInfo);
+ victim->SendSpellMiss(this, spellInfo->Id, missInfo);
continue;
}
// ...or immuned
- if (IsImmunedToDamage(i_spellProto))
+ if (IsImmunedToDamage(spellInfo))
{
- victim->SendSpellDamageImmune(this, i_spellProto->Id);
+ victim->SendSpellDamageImmune(this, spellInfo->Id);
continue;
}
- uint32 damage = (*dmgShieldItr)->GetAmount();
-
- if (Unit* caster = (*dmgShieldItr)->GetCaster())
+ uint32 damage = aurEff->GetAmount();
+ if (Unit* caster = aurEff->GetCaster())
{
- damage = caster->SpellDamageBonusDone(this, i_spellProto, damage, SPELL_DIRECT_DAMAGE);
- damage = this->SpellDamageBonusTaken(caster, i_spellProto, damage, SPELL_DIRECT_DAMAGE);
+ damage = caster->SpellDamageBonusDone(this, spellInfo, damage, SPELL_DIRECT_DAMAGE);
+ damage = SpellDamageBonusTaken(caster, spellInfo, damage, SPELL_DIRECT_DAMAGE);
}
// No Unit::CalcAbsorbResist here - opcode doesn't send that data - this damage is probably not affected by that
- victim->DealDamageMods(this, damage, NULL);
+ victim->DealDamageMods(this, damage, nullptr);
/// @todo Move this to a packet handler
WorldPacket data(SMSG_SPELLDAMAGESHIELD, 8 + 8 + 4 + 4 + 4 + 4 + 4);
data << uint64(victim->GetGUID());
data << uint64(GetGUID());
- data << uint32(i_spellProto->Id);
+ data << uint32(spellInfo->Id);
data << uint32(damage); // Damage
- int32 overkill = int32(damage) - int32(GetHealth());
- data << uint32(overkill > 0 ? overkill : 0); // Overkill
- data << uint32(i_spellProto->SchoolMask);
+ int32 const overkill = int32(damage) - int32(GetHealth());
+ data << uint32(std::max(overkill, 0)); // Overkill
+ data << uint32(spellInfo->SchoolMask);
victim->SendMessageToSet(&data, true);
- victim->DealDamage(this, damage, 0, SPELL_DIRECT_DAMAGE, i_spellProto->GetSchoolMask(), i_spellProto, true);
+ victim->DealDamage(this, damage, nullptr, SPELL_DIRECT_DAMAGE, spellInfo->GetSchoolMask(), spellInfo, true);
}
}
}
@@ -1731,57 +1748,49 @@ uint32 Unit::CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, Spell
return resistance * 10;
}
-void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo /*= NULL*/)
+void Unit::CalcAbsorbResist(DamageInfo& damageInfo)
{
- if (!victim || !victim->IsAlive() || !damage)
+ if (!damageInfo.GetVictim() || !damageInfo.GetVictim()->IsAlive() || !damageInfo.GetDamage())
return;
- DamageInfo dmgInfo = DamageInfo(this, victim, damage, spellInfo, schoolMask, damagetype, BASE_ATTACK);
-
- uint32 spellResistance = CalcSpellResistance(victim, schoolMask, spellInfo);
- dmgInfo.ResistDamage(CalculatePct(damage, spellResistance));
+ uint32 spellResistance = CalcSpellResistance(damageInfo.GetVictim(), damageInfo.GetSchoolMask(), damageInfo.GetSpellInfo());
+ damageInfo.ResistDamage(CalculatePct(damageInfo.GetDamage(), spellResistance));
// Ignore Absorption Auras
- float auraAbsorbMod = 0;
- AuraEffectList const& AbsIgnoreAurasA = GetAuraEffectsByType(SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL);
- for (AuraEffectList::const_iterator itr = AbsIgnoreAurasA.begin(); itr != AbsIgnoreAurasA.end(); ++itr)
+ float auraAbsorbMod(GetMaxPositiveAuraModifierByMiscMask(SPELL_AURA_MOD_TARGET_ABSORB_SCHOOL, damageInfo.GetSchoolMask()));
+
+ AuraEffectList const& abilityAbsorbAuras = GetAuraEffectsByType(SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL);
+ for (AuraEffect const* aurEff : abilityAbsorbAuras)
{
- if (!((*itr)->GetMiscValue() & schoolMask))
+ if (!(aurEff->GetMiscValue() & damageInfo.GetSchoolMask()))
continue;
- if ((*itr)->GetAmount() > auraAbsorbMod)
- auraAbsorbMod = float((*itr)->GetAmount());
- }
-
- AuraEffectList const& AbsIgnoreAurasB = GetAuraEffectsByType(SPELL_AURA_MOD_TARGET_ABILITY_ABSORB_SCHOOL);
- for (AuraEffectList::const_iterator itr = AbsIgnoreAurasB.begin(); itr != AbsIgnoreAurasB.end(); ++itr)
- {
- if (!((*itr)->GetMiscValue() & schoolMask))
+ if (!aurEff->IsAffectedOnSpell(damageInfo.GetSpellInfo()))
continue;
- if (((*itr)->GetAmount() > auraAbsorbMod) && (*itr)->IsAffectedOnSpell(spellInfo))
- auraAbsorbMod = float((*itr)->GetAmount());
+ if ((aurEff->GetAmount() > auraAbsorbMod))
+ auraAbsorbMod = float(aurEff->GetAmount());
}
RoundToInterval(auraAbsorbMod, 0.0f, 100.0f);
- int32 absorbIgnoringDamage = CalculatePct(dmgInfo.GetDamage(), auraAbsorbMod);
- dmgInfo.ModifyDamage(-absorbIgnoringDamage);
+ int32 absorbIgnoringDamage = CalculatePct(damageInfo.GetDamage(), auraAbsorbMod);
+ damageInfo.ModifyDamage(-absorbIgnoringDamage);
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
- AuraEffectList vSchoolAbsorbCopy(victim->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
+ AuraEffectList vSchoolAbsorbCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_SCHOOL_ABSORB));
vSchoolAbsorbCopy.sort(Trinity::AbsorbAuraOrderPred());
// absorb without mana cost
- for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
+ for (AuraEffectList::iterator itr = vSchoolAbsorbCopy.begin(); (itr != vSchoolAbsorbCopy.end()) && (damageInfo.GetDamage() > 0); ++itr)
{
AuraEffect* absorbAurEff = *itr;
// Check if aura was removed during iteration - we don't need to work on such auras
- AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(victim->GetGUID());
+ AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(damageInfo.GetVictim()->GetGUID());
if (!aurApp)
continue;
- if (!(absorbAurEff->GetMiscValue() & schoolMask))
+ if (!(absorbAurEff->GetMiscValue() & damageInfo.GetSchoolMask()))
continue;
// get amount which can be still absorbed by the aura
@@ -1794,19 +1803,19 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
bool defaultPrevented = false;
- absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented);
+ absorbAurEff->GetBase()->CallScriptEffectAbsorbHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb, defaultPrevented);
currentAbsorb = tempAbsorb;
if (defaultPrevented)
continue;
// absorb must be smaller than the damage itself
- currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(dmgInfo.GetDamage()));
+ currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(damageInfo.GetDamage()));
- dmgInfo.AbsorbDamage(currentAbsorb);
+ damageInfo.AbsorbDamage(currentAbsorb);
tempAbsorb = currentAbsorb;
- absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb);
+ absorbAurEff->GetBase()->CallScriptEffectAfterAbsorbHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb);
// Check if our aura is using amount to count damage
if (absorbAurEff->GetAmount() >= 0)
@@ -1820,16 +1829,16 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
}
// absorb by mana cost
- AuraEffectList vManaShieldCopy(victim->GetAuraEffectsByType(SPELL_AURA_MANA_SHIELD));
- for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
+ AuraEffectList vManaShieldCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_MANA_SHIELD));
+ for (AuraEffectList::const_iterator itr = vManaShieldCopy.begin(); (itr != vManaShieldCopy.end()) && (damageInfo.GetDamage() > 0); ++itr)
{
AuraEffect* absorbAurEff = *itr;
// Check if aura was removed during iteration - we don't need to work on such auras
- AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(victim->GetGUID());
+ AuraApplication const* aurApp = absorbAurEff->GetBase()->GetApplicationOfTarget(damageInfo.GetVictim()->GetGUID());
if (!aurApp)
continue;
// check damage school mask
- if (!(absorbAurEff->GetMiscValue() & schoolMask))
+ if (!(absorbAurEff->GetMiscValue() & damageInfo.GetSchoolMask()))
continue;
// get amount which can be still absorbed by the aura
@@ -1842,14 +1851,14 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
bool defaultPrevented = false;
- absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb, defaultPrevented);
+ absorbAurEff->GetBase()->CallScriptEffectManaShieldHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb, defaultPrevented);
currentAbsorb = tempAbsorb;
if (defaultPrevented)
continue;
// absorb must be smaller than the damage itself
- currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(dmgInfo.GetDamage()));
+ currentAbsorb = RoundToInterval(currentAbsorb, 0, int32(damageInfo.GetDamage()));
int32 manaReduction = currentAbsorb;
@@ -1857,15 +1866,15 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
if (float manaMultiplier = absorbAurEff->GetSpellInfo()->Effects[absorbAurEff->GetEffIndex()].CalcValueMultiplier(absorbAurEff->GetCaster()))
manaReduction = int32(float(manaReduction) * manaMultiplier);
- int32 manaTaken = -victim->ModifyPower(POWER_MANA, -manaReduction);
+ int32 manaTaken = -damageInfo.GetVictim()->ModifyPower(POWER_MANA, -manaReduction);
// take case when mana has ended up into account
currentAbsorb = currentAbsorb ? int32(float(currentAbsorb) * (float(manaTaken) / float(manaReduction))) : 0;
- dmgInfo.AbsorbDamage(currentAbsorb);
+ damageInfo.AbsorbDamage(currentAbsorb);
tempAbsorb = currentAbsorb;
- absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, dmgInfo, tempAbsorb);
+ absorbAurEff->GetBase()->CallScriptEffectAfterManaShieldHandlers(absorbAurEff, aurApp, damageInfo, tempAbsorb);
// Check if our aura is using amount to count damage
if (absorbAurEff->GetAmount() >= 0)
@@ -1876,39 +1885,39 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
}
}
- dmgInfo.ModifyDamage(absorbIgnoringDamage);
+ damageInfo.ModifyDamage(absorbIgnoringDamage);
// split damage auras - only when not damaging self
- if (victim != this)
+ if (damageInfo.GetVictim() != this)
{
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
- AuraEffectList vSplitDamageFlatCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_FLAT));
- for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (dmgInfo.GetDamage() > 0); ++itr)
+ AuraEffectList vSplitDamageFlatCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_FLAT));
+ for (AuraEffectList::iterator itr = vSplitDamageFlatCopy.begin(); (itr != vSplitDamageFlatCopy.end()) && (damageInfo.GetDamage() > 0); ++itr)
{
// Check if aura was removed during iteration - we don't need to work on such auras
- if (!((*itr)->GetBase()->IsAppliedOnTarget(victim->GetGUID())))
+ if (!((*itr)->GetBase()->IsAppliedOnTarget(damageInfo.GetVictim()->GetGUID())))
continue;
// check damage school mask
- if (!((*itr)->GetMiscValue() & schoolMask))
+ if (!((*itr)->GetMiscValue() & damageInfo.GetSchoolMask()))
continue;
// Damage can be splitted only if aura has an alive caster
Unit* caster = (*itr)->GetCaster();
- if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->IsAlive())
+ if (!caster || (caster == damageInfo.GetVictim()) || !caster->IsInWorld() || !caster->IsAlive())
continue;
int32 splitDamage = (*itr)->GetAmount();
// absorb must be smaller than the damage itself
- splitDamage = RoundToInterval(splitDamage, 0, int32(dmgInfo.GetDamage()));
+ splitDamage = RoundToInterval(splitDamage, 0, int32(damageInfo.GetDamage()));
- dmgInfo.AbsorbDamage(splitDamage);
+ damageInfo.AbsorbDamage(splitDamage);
// check if caster is immune to damage
- if (caster->IsImmunedToDamage(schoolMask))
+ if (caster->IsImmunedToDamage(damageInfo.GetSchoolMask()))
{
- victim->SendSpellMiss(caster, (*itr)->GetSpellInfo()->Id, SPELL_MISS_IMMUNE);
+ damageInfo.GetVictim()->SendSpellMiss(caster, (*itr)->GetSpellInfo()->Id, SPELL_MISS_IMMUNE);
continue;
}
@@ -1916,66 +1925,62 @@ void Unit::CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffe
uint32 splitted_absorb = 0;
DealDamageMods(caster, splitted, &splitted_absorb);
- SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitted, schoolMask, splitted_absorb, 0, false, 0, false);
+ SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitted, damageInfo.GetSchoolMask(), splitted_absorb, 0, false, 0, false);
CleanDamage cleanDamage = CleanDamage(splitted, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
- DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*itr)->GetSpellInfo(), false);
+ DealDamage(caster, splitted, &cleanDamage, DIRECT_DAMAGE, damageInfo.GetSchoolMask(), (*itr)->GetSpellInfo(), false);
}
// We're going to call functions which can modify content of the list during iteration over it's elements
// Let's copy the list so we can prevent iterator invalidation
- AuraEffectList vSplitDamagePctCopy(victim->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_PCT));
- for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && dmgInfo.GetDamage() > 0; ++itr)
+ AuraEffectList vSplitDamagePctCopy(damageInfo.GetVictim()->GetAuraEffectsByType(SPELL_AURA_SPLIT_DAMAGE_PCT));
+ for (AuraEffectList::iterator itr = vSplitDamagePctCopy.begin(); itr != vSplitDamagePctCopy.end() && damageInfo.GetDamage() > 0; ++itr)
{
// Check if aura was removed during iteration - we don't need to work on such auras
- AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(victim->GetGUID());
+ AuraApplication const* aurApp = (*itr)->GetBase()->GetApplicationOfTarget(damageInfo.GetVictim()->GetGUID());
if (!aurApp)
continue;
// check damage school mask
- if (!((*itr)->GetMiscValue() & schoolMask))
+ if (!((*itr)->GetMiscValue() & damageInfo.GetSchoolMask()))
continue;
// Damage can be splitted only if aura has an alive caster
Unit* caster = (*itr)->GetCaster();
- if (!caster || (caster == victim) || !caster->IsInWorld() || !caster->IsAlive())
+ if (!caster || (caster == damageInfo.GetVictim()) || !caster->IsInWorld() || !caster->IsAlive())
continue;
- uint32 splitDamage = CalculatePct(dmgInfo.GetDamage(), (*itr)->GetAmount());
+ uint32 splitDamage = CalculatePct(damageInfo.GetDamage(), (*itr)->GetAmount());
- (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, dmgInfo, splitDamage);
+ (*itr)->GetBase()->CallScriptEffectSplitHandlers((*itr), aurApp, damageInfo, splitDamage);
// absorb must be smaller than the damage itself
- splitDamage = RoundToInterval(splitDamage, uint32(0), uint32(dmgInfo.GetDamage()));
+ splitDamage = RoundToInterval(splitDamage, uint32(0), uint32(damageInfo.GetDamage()));
- dmgInfo.AbsorbDamage(splitDamage);
+ damageInfo.AbsorbDamage(splitDamage);
// check if caster is immune to damage
- if (caster->IsImmunedToDamage(schoolMask))
+ if (caster->IsImmunedToDamage(damageInfo.GetSchoolMask()))
{
- victim->SendSpellMiss(caster, (*itr)->GetSpellInfo()->Id, SPELL_MISS_IMMUNE);
+ damageInfo.GetVictim()->SendSpellMiss(caster, (*itr)->GetSpellInfo()->Id, SPELL_MISS_IMMUNE);
continue;
}
uint32 split_absorb = 0;
DealDamageMods(caster, splitDamage, &split_absorb);
- SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitDamage, schoolMask, split_absorb, 0, false, 0, false);
+ SendSpellNonMeleeDamageLog(caster, (*itr)->GetSpellInfo()->Id, splitDamage, damageInfo.GetSchoolMask(), split_absorb, 0, false, 0, false);
CleanDamage cleanDamage = CleanDamage(splitDamage, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
- DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, schoolMask, (*itr)->GetSpellInfo(), false);
+ DealDamage(caster, splitDamage, &cleanDamage, DIRECT_DAMAGE, damageInfo.GetSchoolMask(), (*itr)->GetSpellInfo(), false);
// break 'Fear' and similar auras
- DamageInfo damageInfo(caster, this, splitDamage, (*itr)->GetSpellInfo(), schoolMask, DIRECT_DAMAGE, BASE_ATTACK);
ProcSkillsAndAuras(caster, PROC_FLAG_NONE, PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_HIT, PROC_HIT_NONE, nullptr, &damageInfo, nullptr);
}
}
-
- *resist = dmgInfo.GetResist();
- *absorb = dmgInfo.GetAbsorb();
}
-void Unit::CalcHealAbsorb(HealInfo& healInfo)
+void Unit::CalcHealAbsorb(HealInfo& healInfo) const
{
if (!healInfo.GetHeal())
return;
@@ -2364,7 +2369,7 @@ void Unit::SendMeleeAttackStop(Unit* victim)
bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttackType attackType)
{
// These spells can't be blocked
- if (spellProto && spellProto->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK))
+ if (spellProto && (spellProto->HasAttribute(SPELL_ATTR0_IMPOSSIBLE_DODGE_PARRY_BLOCK) || spellProto->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT)))
return false;
// Can't block when casting/controlled
@@ -2429,11 +2434,6 @@ bool Unit::CanUseAttackType(uint8 attacktype) const
// Melee based spells hit result calculations
SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo) const
{
- // Spells with SPELL_ATTR3_IGNORE_HIT_RESULT will additionally fully ignore
- // resist and deflect chances
- if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
- return SPELL_MISS_NONE;
-
WeaponAttackType attType = BASE_ATTACK;
// Check damage class instead of attack type to correctly handle judgements
@@ -2581,7 +2581,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo
SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo) const
{
// Can`t miss on dead target (on skinning for example)
- if ((!victim->IsAlive() && victim->GetTypeId() != TYPEID_PLAYER) || spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ if ((!victim->IsAlive() && victim->GetTypeId() != TYPEID_PLAYER))
return SPELL_MISS_NONE;
SpellSchoolMask schoolMask = spellInfo->GetSchoolMask();
@@ -2675,19 +2675,23 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo
// Resist
SpellMissInfo Unit::SpellHitResult(Unit* victim, SpellInfo const* spellInfo, bool CanReflect)
{
+ if (spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ return SPELL_MISS_NONE;
+
// Check for immune
if (victim->IsImmunedToSpell(spellInfo))
return SPELL_MISS_IMMUNE;
+ // Damage immunity is only checked if the spell has damage effects, this immunity must not prevent aura apply
+ // returns SPELL_MISS_IMMUNE in that case, for other spells, the SMSG_SPELL_GO must show hit
+ if (spellInfo->HasOnlyDamageEffects() && victim->IsImmunedToDamage(spellInfo))
+ return SPELL_MISS_IMMUNE;
+
// All positive spells can`t miss
/// @todo client not show miss log for this spells - so need find info for this in dbc and use it!
if (spellInfo->IsPositive() && !IsHostileTo(victim)) // prevent from affecting enemy by "positive" spell
return SPELL_MISS_NONE;
- // Check for immune
- if (victim->IsImmunedToDamage(spellInfo))
- return SPELL_MISS_IMMUNE;
-
if (this == victim)
return SPELL_MISS_NONE;
@@ -2901,8 +2905,8 @@ float Unit::GetUnitBlockChance(WeaponAttackType attType, Unit const* victim) con
float Unit::GetUnitCriticalChance(WeaponAttackType attackType, Unit const* victim) const
{
int32 const attackerWeaponSkill = GetWeaponSkillValue(attackType, victim);
- int32 const victimMaxSkillValueForLevel = victim->GetMaxSkillValueForLevel(this);
- int32 const skillDiff = victimMaxSkillValueForLevel - attackerWeaponSkill;
+ int32 const victimDefenseSkill = victim->GetDefenseSkillValue(this);
+ int32 const skillDiff = victimDefenseSkill - attackerWeaponSkill;
float chance = 0.0f;
float skillBonus = 0.0f;
@@ -3296,10 +3300,13 @@ int32 Unit::GetCurrentSpellCastTime(uint32 spell_id) const
bool Unit::CanMoveDuringChannel() const
{
if (Spell* spell = m_currentSpells[CURRENT_CHANNELED_SPELL])
- if (spell->getState() != SPELL_STATE_FINISHED)
- return spell->GetSpellInfo()->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING) && spell->IsChannelActive();
+ {
+ if (spell->getState() != SPELL_STATE_FINISHED && spell->IsChannelActive())
+ if (!spell->GetSpellInfo()->IsMoveAllowedChannel())
+ return false;
+ }
- return false;
+ return true;
}
bool Unit::isInFrontInMap(Unit const* target, float distance, float arc) const
@@ -5242,10 +5249,10 @@ void Unit::SendSpellNonMeleeDamageLog(Unit* target, uint32 SpellID, uint32 Damag
void Unit::ProcSkillsAndAuras(Unit* actionTarget, uint32 typeMaskActor, uint32 typeMaskActionTarget, uint32 spellTypeMask, uint32 spellPhaseMask, uint32 hitMask, Spell* spell, DamageInfo* damageInfo, HealInfo* healInfo)
{
WeaponAttackType attType = damageInfo ? damageInfo->GetAttackType() : BASE_ATTACK;
- if (typeMaskActor && CanProc())
+ if (typeMaskActor)
ProcSkillsAndReactives(false, actionTarget, typeMaskActor, hitMask, attType);
- if (typeMaskActionTarget && actionTarget && actionTarget->CanProc())
+ if (typeMaskActionTarget && actionTarget)
actionTarget->ProcSkillsAndReactives(true, this, typeMaskActionTarget, hitMask, attType);
TriggerAurasProcOnEvent(actionTarget, typeMaskActor, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
@@ -5471,6 +5478,8 @@ FactionTemplateEntry const* Unit::GetFactionTemplateEntry() const
TC_LOG_ERROR("entities.unit", "Creature (template id: %u) has invalid faction (faction template id) #%u", creature->GetCreatureTemplate()->Entry, getFaction());
else
TC_LOG_ERROR("entities.unit", "Unit (name=%s, type=%u) has invalid faction (faction template id) #%u", GetName().c_str(), uint32(GetTypeId()), getFaction());
+
+ ABORT();
}
return entry;
}
@@ -5526,8 +5535,7 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
}
// check FFA_PVP
- if (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP
- && target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP)
+ if (IsFFAPvP() && target->IsFFAPvP())
return REP_HOSTILE;
if (selfPlayerOwner)
@@ -5905,17 +5913,14 @@ void Unit::ModifyAuraState(AuraStateType flag, bool apply)
{
RemoveFlag(UNIT_FIELD_AURASTATE, 1<<(flag-1));
- if (flag != AURA_STATE_ENRAGE) // enrage aura state triggering continues auras
+ Unit::AuraApplicationMap& tAuras = GetAppliedAuras();
+ for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
{
- Unit::AuraApplicationMap& tAuras = GetAppliedAuras();
- for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
- {
- SpellInfo const* spellProto = (*itr).second->GetBase()->GetSpellInfo();
- if (spellProto->CasterAuraState == uint32(flag))
- RemoveAura(itr);
- else
- ++itr;
- }
+ SpellInfo const* spellProto = itr->second->GetBase()->GetSpellInfo();
+ if (itr->second->GetBase()->GetCasterGUID() == GetGUID() && spellProto->CasterAuraState == uint32(flag) && (spellProto->IsPassive() || flag != AURA_STATE_ENRAGE))
+ RemoveAura(itr);
+ else
+ ++itr;
}
}
}
@@ -6590,7 +6595,7 @@ void Unit::SendHealSpellLog(HealInfo& healInfo, bool critical /*= false*/)
// we guess size
WorldPacket data(SMSG_SPELLHEALLOG, 8 + 8 + 4 + 4 + 4 + 4 + 1 + 1);
data << healInfo.GetTarget()->GetPackGUID();
- data << GetPackGUID();
+ data << healInfo.GetHealer()->GetPackGUID();
data << uint32(healInfo.GetSpellInfo()->Id);
data << uint32(healInfo.GetHeal());
data << uint32(healInfo.GetHeal() - healInfo.GetEffectiveHeal());
@@ -6680,11 +6685,12 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
// Impurity (dummy effect)
if (GetTypeId() == TYPEID_PLAYER)
{
- PlayerSpellMap playerSpells = ToPlayer()->GetSpellMap();
- for (PlayerSpellMap::const_iterator itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
+ PlayerSpellMap const& playerSpells = ToPlayer()->GetSpellMap();
+ for (auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
{
if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled)
continue;
+
switch (itr->first)
{
case 49220:
@@ -6693,7 +6699,7 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
case 49636:
case 49638:
if (SpellInfo const* proto = sSpellMgr->GetSpellInfo(itr->first))
- AddPct(ApCoeffMod, proto->Effects[0].CalcValue());
+ AddPct(ApCoeffMod, proto->Effects[EFFECT_0].CalcValue());
break;
}
}
@@ -6709,33 +6715,28 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
DoneAdvertisedBenefit += ((Guardian*)this)->GetBonusDamage();
// Check for table values
- float coeff = 0;
+ float coeff = 0.0f;
SpellBonusEntry const* bonus = sSpellMgr->GetSpellBonusData(spellProto->Id);
if (bonus)
{
+ WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
+ float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS));
+ APbonus += GetTotalAttackPowerValue(attType);
+
if (damagetype == DOT)
{
coeff = bonus->dot_damage;
if (bonus->ap_dot_bonus > 0)
- {
- WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
- float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS));
- APbonus += GetTotalAttackPowerValue(attType);
DoneTotal += int32(bonus->ap_dot_bonus * stack * ApCoeffMod * APbonus);
- }
}
else
{
coeff = bonus->direct_damage;
if (bonus->ap_bonus > 0)
- {
- WeaponAttackType attType = (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK;
- float APbonus = float(victim->GetTotalAuraModifier(attType == BASE_ATTACK ? SPELL_AURA_MELEE_ATTACK_POWER_ATTACKER_BONUS : SPELL_AURA_RANGED_ATTACK_POWER_ATTACKER_BONUS));
- APbonus += GetTotalAttackPowerValue(attType);
DoneTotal += int32(bonus->ap_bonus * stack * ApCoeffMod * APbonus);
- }
}
}
+
// Default calculation
if (DoneAdvertisedBenefit)
{
@@ -6753,14 +6754,16 @@ uint32 Unit::SpellDamageBonusDone(Unit* victim, SpellInfo const* spellProto, uin
DoneTotal += int32(DoneAdvertisedBenefit * coeff * factorMod);
}
+ float tmpDamage = (int32(pdamage) + DoneTotal);
+
+ // DOTs calculated in AuraEffect::PeriodicDamageAurasTick
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
- float tmpDamage = (int32(pdamage) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellDamagePctDone(victim, spellProto, damagetype));
- // apply spellmod to Done damage (flat and pct)
- if (Player* modOwner = GetSpellModOwner())
+ if (damagetype != DOT)
{
- if (damagetype == DOT)
- modOwner->ApplySpellMod<SPELLMOD_DOT>(spellProto->Id, tmpDamage);
- else
+ tmpDamage *= SpellDamagePctDone(victim, spellProto, damagetype);
+
+ // apply spellmod to Done damage (flat and pct)
+ if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod<SPELLMOD_DAMAGE>(spellProto->Id, tmpDamage);
}
@@ -6787,22 +6790,17 @@ float Unit::SpellDamagePctDone(Unit* victim, SpellInfo const* spellProto, Damage
if (GetTypeId() == TYPEID_UNIT && !IsPet())
DoneTotalMod *= ToCreature()->GetSpellDamageMod(ToCreature()->GetCreatureTemplate()->rank);
- AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
- for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
+ float maxModDamagePercentSchool = 0.0f;
+ if (GetTypeId() == TYPEID_PLAYER)
{
- if (spellProto->EquippedItemClass == -1 && (*i)->GetSpellInfo()->EquippedItemClass != -1) //prevent apply mods from weapon specific case to non weapon specific spells (Example: thunder clap and two-handed weapon specialization)
- continue;
-
- if ((*i)->GetMiscValue() & spellProto->GetSchoolMask())
- {
- if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
- AddPct(DoneTotalMod, (*i)->GetAmount());
- else if (!(*i)->GetSpellInfo()->HasAttribute(SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0))
- AddPct(DoneTotalMod, (*i)->GetAmount());
- else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
- AddPct(DoneTotalMod, (*i)->GetAmount());
- }
+ for (uint32 i = 0; i < MAX_SPELL_SCHOOL; ++i)
+ if (spellProto->GetSchoolMask() & (1 << i))
+ maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
}
+ else
+ maxModDamagePercentSchool = GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, spellProto->GetSchoolMask());
+
+ DoneTotalMod *= maxModDamagePercentSchool;
uint32 creatureTypeMask = victim->GetCreatureTypeMask();
@@ -7183,13 +7181,9 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
int32 DoneAdvertisedBenefit = 0;
AuraEffectList const& mDamageDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE);
- for (AuraEffectList::const_iterator i = mDamageDone.begin(); i != mDamageDone.end(); ++i)
- if (((*i)->GetMiscValue() & schoolMask) != 0 &&
- (*i)->GetSpellInfo()->EquippedItemClass == -1 &&
- // -1 == any item class (not wand then)
- (*i)->GetSpellInfo()->EquippedItemInventoryTypeMask == 0)
- // 0 == any inventory type (not wand then)
- DoneAdvertisedBenefit += (*i)->GetAmount();
+ for (AuraEffect const* aurEff : mDamageDone)
+ if (aurEff->GetMiscValue() & schoolMask)
+ DoneAdvertisedBenefit += aurEff->GetAmount();
if (GetTypeId() == TYPEID_PLAYER)
{
@@ -7198,22 +7192,20 @@ int32 Unit::SpellBaseDamageBonusDone(SpellSchoolMask schoolMask) const
// Damage bonus from stats
AuraEffectList const& mDamageDoneOfStatPercent = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_STAT_PERCENT);
- for (AuraEffectList::const_iterator i = mDamageDoneOfStatPercent.begin(); i != mDamageDoneOfStatPercent.end(); ++i)
+ for (AuraEffect const* aurEff : mDamageDoneOfStatPercent)
{
- if ((*i)->GetMiscValue() & schoolMask)
+ if ((aurEff->GetMiscValue() & schoolMask) != 0)
{
// stat used stored in miscValueB for this aura
- Stats usedStat = Stats((*i)->GetMiscValueB());
- DoneAdvertisedBenefit += int32(CalculatePct(GetStat(usedStat), (*i)->GetAmount()));
+ Stats const usedStat = static_cast<Stats>(aurEff->GetMiscValueB());
+ DoneAdvertisedBenefit += static_cast<int32>(CalculatePct(GetStat(usedStat), aurEff->GetAmount()));
}
}
- // ... and attack power
- AuraEffectList const& mDamageDonebyAP = GetAuraEffectsByType(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER);
- for (AuraEffectList::const_iterator i =mDamageDonebyAP.begin(); i != mDamageDonebyAP.end(); ++i)
- if ((*i)->GetMiscValue() & schoolMask)
- DoneAdvertisedBenefit += int32(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), (*i)->GetAmount()));
+ // ... and attack power
+ DoneAdvertisedBenefit += static_cast<int32>(CalculatePct(GetTotalAttackPowerValue(BASE_ATTACK), GetTotalAuraModifierByMiscMask(SPELL_AURA_MOD_SPELL_DAMAGE_OF_ATTACK_POWER, schoolMask)));
}
+
return DoneAdvertisedBenefit;
}
@@ -7534,6 +7526,7 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
if (spellProto->SpellFamilyName == SPELLFAMILY_POTION)
return healamount;
+ float ApCoeffMod = 1.0f;
int32 DoneTotal = 0;
// done scripted mod (take it from owner)
@@ -7555,6 +7548,35 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
}
}
+ // Custom scripted damage
+ switch (spellProto->SpellFamilyName)
+ {
+ case SPELLFAMILY_DEATHKNIGHT:
+ // Impurity (dummy effect)
+ if (GetTypeId() == TYPEID_PLAYER)
+ {
+ PlayerSpellMap const& playerSpells = ToPlayer()->GetSpellMap();
+ for (auto itr = playerSpells.begin(); itr != playerSpells.end(); ++itr)
+ {
+ if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled)
+ continue;
+
+ switch (itr->first)
+ {
+ case 49220:
+ case 49633:
+ case 49635:
+ case 49636:
+ case 49638:
+ if (SpellInfo const* proto = sSpellMgr->GetSpellInfo(itr->first))
+ AddPct(ApCoeffMod, proto->Effects[EFFECT_0].CalcValue());
+ break;
+ }
+ }
+ }
+ break;
+ }
+
// Done fixed damage bonus auras
int32 DoneAdvertisedBenefit = SpellBaseHealingBonusDone(spellProto->GetSchoolMask());
@@ -7568,15 +7590,15 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
{
coeff = bonus->dot_damage;
if (bonus->ap_dot_bonus > 0)
- DoneTotal += int32(bonus->ap_dot_bonus * stack * GetTotalAttackPowerValue(
- (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK));
+ DoneTotal += int32(bonus->ap_dot_bonus * ApCoeffMod * stack * GetTotalAttackPowerValue(
+ (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK));
}
else
{
coeff = bonus->direct_damage;
if (bonus->ap_bonus > 0)
- DoneTotal += int32(bonus->ap_bonus * stack * GetTotalAttackPowerValue(
- (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass !=SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK));
+ DoneTotal += int32(bonus->ap_bonus * ApCoeffMod * stack * GetTotalAttackPowerValue(
+ (spellProto->IsRangedWeaponSpell() && spellProto->DmgClass != SPELL_DAMAGE_CLASS_MELEE) ? RANGED_ATTACK : BASE_ATTACK));
}
}
else
@@ -7622,14 +7644,16 @@ uint32 Unit::SpellHealingBonusDone(Unit* victim, SpellInfo const* spellProto, ui
DoneTotal = 0;
}
+ float heal = float(int32(healamount) + DoneTotal);
+
+ // DOTs calculated in AuraEffect::HandlePeriodicHealAurasTick
// Done Percentage for DOT is already calculated, no need to do it again. The percentage mod is applied in Aura::HandleAuraSpecificMods.
- float heal = float(int32(healamount) + DoneTotal) * (damagetype == DOT ? 1.0f : SpellHealingPctDone(victim, spellProto));
- // apply spellmod to Done amount
- if (Player* modOwner = GetSpellModOwner())
+ if (damagetype != DOT)
{
- if (damagetype == DOT)
- modOwner->ApplySpellMod<SPELLMOD_DOT>(spellProto->Id, heal);
- else
+ heal *= SpellHealingPctDone(victim, spellProto);
+
+ // apply spellmod to Done amount
+ if (Player* modOwner = GetSpellModOwner())
modOwner->ApplySpellMod<SPELLMOD_DAMAGE>(spellProto->Id, heal);
}
@@ -7857,18 +7881,18 @@ int32 Unit::SpellBaseHealingBonusTaken(SpellSchoolMask schoolMask) const
return advertisedBenefit;
}
-bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask) const
+bool Unit::IsImmunedToDamage(SpellSchoolMask schoolMask) const
{
// If m_immuneToSchool type contain this school type, IMMUNE damage.
- SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
- for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
- if (itr->type & shoolMask)
+ SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
+ for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
+ if ((itr->first & schoolMask) != 0)
return true;
// If m_immuneToDamage type contain magic, IMMUNE damage.
- SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
- for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
- if (itr->type & shoolMask)
+ SpellImmuneContainer const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
+ for (auto itr = damageList.begin(); itr != damageList.end(); ++itr)
+ if ((itr->first & schoolMask) != 0)
return true;
return false;
@@ -7876,23 +7900,27 @@ bool Unit::IsImmunedToDamage(SpellSchoolMask shoolMask) const
bool Unit::IsImmunedToDamage(SpellInfo const* spellInfo) const
{
- if (spellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
+ if (!spellInfo)
return false;
- uint32 shoolMask = spellInfo->GetSchoolMask();
- if (spellInfo->Id != 42292 && spellInfo->Id != 59752)
- {
- // If m_immuneToSchool type contain this school type, IMMUNE damage.
- SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
- for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
- if (itr->type & shoolMask && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->spellId)))
- return true;
- }
+ // for example 40175
+ if (spellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) && spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ return false;
+
+ if (spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
+ return false;
+
+ uint32 schoolMask = spellInfo->GetSchoolMask();
+ // If m_immuneToSchool type contain this school type, IMMUNE damage.
+ SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
+ for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
+ if ((itr->first & schoolMask) && !spellInfo->CanPierceImmuneAura(sSpellMgr->GetSpellInfo(itr->second)))
+ return true;
// If m_immuneToDamage type contain magic, IMMUNE damage.
- SpellImmuneList const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
- for (SpellImmuneList::const_iterator itr = damageList.begin(); itr != damageList.end(); ++itr)
- if (itr->type & shoolMask)
+ SpellImmuneContainer const& damageList = m_spellImmune[IMMUNITY_DAMAGE];
+ for (auto itr = damageList.begin(); itr != damageList.end(); ++itr)
+ if ((itr->first & schoolMask) != 0)
return true;
return false;
@@ -7904,29 +7932,26 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
return false;
// Single spell immunity.
- SpellImmuneList const& idList = m_spellImmune[IMMUNITY_ID];
- for (SpellImmuneList::const_iterator itr = idList.begin(); itr != idList.end(); ++itr)
- if (itr->type == spellInfo->Id)
- return true;
+ SpellImmuneContainer const& idList = m_spellImmune[IMMUNITY_ID];
+ if (idList.count(spellInfo->Id) > 0)
+ return true;
if (spellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
return false;
- if (spellInfo->Dispel)
+ if (uint32 dispel = spellInfo->Dispel)
{
- SpellImmuneList const& dispelList = m_spellImmune[IMMUNITY_DISPEL];
- for (SpellImmuneList::const_iterator itr = dispelList.begin(); itr != dispelList.end(); ++itr)
- if (itr->type == spellInfo->Dispel)
- return true;
+ SpellImmuneContainer const& dispelList = m_spellImmune[IMMUNITY_DISPEL];
+ if (dispelList.count(dispel) > 0)
+ return true;
}
// Spells that don't have effectMechanics.
- if (spellInfo->Mechanic)
+ if (uint32 mechanic = spellInfo->Mechanic)
{
- SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
- for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
- if (itr->type == spellInfo->Mechanic)
- return true;
+ SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
+ if (mechanicList.count(mechanic) > 0)
+ return true;
}
bool immuneToAllEffects = true;
@@ -7934,8 +7959,6 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
{
// State/effect immunities applied by aura expect full spell immunity
// Ignore effects with mechanic, they are supposed to be checked separately
- if (!spellInfo->Effects[i].IsEffect())
- continue;
if (!IsImmunedToSpellEffect(spellInfo, i))
{
immuneToAllEffects = false;
@@ -7946,13 +7969,13 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
if (immuneToAllEffects) //Return immune only if the target is immune to all spell effects.
return true;
- if (spellInfo->Id != 42292 && spellInfo->Id != 59752)
+ if (!spellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
{
- SpellImmuneList const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
- for (SpellImmuneList::const_iterator itr = schoolList.begin(); itr != schoolList.end(); ++itr)
+ SpellImmuneContainer const& schoolList = m_spellImmune[IMMUNITY_SCHOOL];
+ for (auto itr = schoolList.begin(); itr != schoolList.end(); ++itr)
{
- SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->spellId);
- if ((itr->type & spellInfo->GetSchoolMask())
+ SpellInfo const* immuneSpellInfo = sSpellMgr->GetSpellInfo(itr->second);
+ if ((itr->first & spellInfo->GetSchoolMask())
&& !(immuneSpellInfo && immuneSpellInfo->IsPositive() && spellInfo->IsPositive())
&& !spellInfo->CanPierceImmuneAura(immuneSpellInfo))
return true;
@@ -7965,9 +7988,9 @@ bool Unit::IsImmunedToSpell(SpellInfo const* spellInfo) const
uint32 Unit::GetSchoolImmunityMask() const
{
uint32 mask = 0;
- SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL];
- for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
- mask |= itr->type;
+ SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_SCHOOL];
+ for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
+ mask |= itr->first;
return mask;
}
@@ -7975,9 +7998,9 @@ uint32 Unit::GetSchoolImmunityMask() const
uint32 Unit::GetMechanicImmunityMask() const
{
uint32 mask = 0;
- SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
- for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
- mask |= (1 << itr->type);
+ SpellImmuneContainer const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
+ for (auto itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
+ mask |= (1 << itr->first);
return mask;
}
@@ -7992,33 +8015,35 @@ bool Unit::IsImmunedToSpellEffect(SpellInfo const* spellInfo, uint32 index) cons
// If m_immuneToEffect type contain this effect type, IMMUNE effect.
uint32 effect = spellInfo->Effects[index].Effect;
- SpellImmuneList const& effectList = m_spellImmune[IMMUNITY_EFFECT];
- for (SpellImmuneList::const_iterator itr = effectList.begin(); itr != effectList.end(); ++itr)
- if (itr->type == effect)
- return true;
+ auto const& effectList = m_spellImmune[IMMUNITY_EFFECT];
+ if (effectList.count(effect) > 0)
+ return true;
if (uint32 mechanic = spellInfo->Effects[index].Mechanic)
{
- SpellImmuneList const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
- for (SpellImmuneList::const_iterator itr = mechanicList.begin(); itr != mechanicList.end(); ++itr)
- if (itr->type == mechanic)
- return true;
+ auto const& mechanicList = m_spellImmune[IMMUNITY_MECHANIC];
+ if (mechanicList.count(mechanic) > 0)
+ return true;
}
- if (uint32 aura = spellInfo->Effects[index].ApplyAuraName)
+ if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
{
- SpellImmuneList const& list = m_spellImmune[IMMUNITY_STATE];
- for (SpellImmuneList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
- if (itr->type == aura)
- if (!spellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
- return true;
-
- // Check for immune to application of harmful magical effects
- AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL);
- for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
- if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school
- !spellInfo->IsPositiveEffect(index)) // Harmful
+ if (uint32 aura = spellInfo->Effects[index].ApplyAuraName)
+ {
+ SpellImmuneContainer const& list = m_spellImmune[IMMUNITY_STATE];
+ if (list.count(aura) > 0)
return true;
+
+ if (!spellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
+ {
+ // Check for immune to application of harmful magical effects
+ AuraEffectList const& immuneAuraApply = GetAuraEffectsByType(SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL);
+ for (AuraEffectList::const_iterator iter = immuneAuraApply.begin(); iter != immuneAuraApply.end(); ++iter)
+ if (((*iter)->GetMiscValue() & spellInfo->GetSchoolMask()) && // Check school
+ !spellInfo->IsPositiveEffect(index)) // Harmful
+ return true;
+ }
+ }
}
return false;
@@ -8069,15 +8094,8 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
if (APbonus != 0) // Can be negative
{
- bool normalized = false;
- if (spellProto)
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- if (spellProto->Effects[i].Effect == SPELL_EFFECT_NORMALIZED_WEAPON_DMG)
- {
- normalized = true;
- break;
- }
- DoneFlatBenefit += int32(APbonus/14.0f * GetAPMultiplier(attType, normalized));
+ bool const normalized = spellProto && spellProto->HasEffect(SPELL_EFFECT_NORMALIZED_WEAPON_DMG);
+ DoneFlatBenefit += int32(APbonus / 14.0f * GetAPMultiplier(attType, normalized));
}
// Done total percent damage auras
@@ -8085,22 +8103,23 @@ uint32 Unit::MeleeDamageBonusDone(Unit* victim, uint32 pdamage, WeaponAttackType
// Some spells don't benefit from pct done mods
if (spellProto)
- if (!spellProto->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS))
+ {
+ // mods for SPELL_SCHOOL_MASK_NORMAL are already factored in base melee damage calculation
+ if (!spellProto->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL))
{
- AuraEffectList const& mModDamagePercentDone = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
- for (AuraEffectList::const_iterator i = mModDamagePercentDone.begin(); i != mModDamagePercentDone.end(); ++i)
+ float maxModDamagePercentSchool = 0.0f;
+ if (GetTypeId() == TYPEID_PLAYER)
{
- if ((*i)->GetMiscValue() & spellProto->GetSchoolMask() && !(spellProto->GetSchoolMask() & SPELL_SCHOOL_MASK_NORMAL))
- {
- if ((*i)->GetSpellInfo()->EquippedItemClass == -1)
- AddPct(DoneTotalMod, (*i)->GetAmount());
- else if (!(*i)->GetSpellInfo()->HasAttribute(SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK) && ((*i)->GetSpellInfo()->EquippedItemSubClassMask == 0))
- AddPct(DoneTotalMod, (*i)->GetAmount());
- else if (ToPlayer() && ToPlayer()->HasItemFitToSpellRequirements((*i)->GetSpellInfo()))
- AddPct(DoneTotalMod, (*i)->GetAmount());
- }
+ for (uint32 i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
+ if (spellProto->GetSchoolMask() & (1 << i))
+ maxModDamagePercentSchool = std::max(maxModDamagePercentSchool, GetFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i));
}
+ else
+ maxModDamagePercentSchool = GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, spellProto->GetSchoolMask());
+
+ DoneTotalMod *= maxModDamagePercentSchool;
}
+ }
AuraEffectList const& mDamageDoneVersus = GetAuraEffectsByType(SPELL_AURA_MOD_DAMAGE_DONE_VERSUS);
for (AuraEffectList::const_iterator i = mDamageDoneVersus.begin(); i != mDamageDoneVersus.end(); ++i)
@@ -8324,52 +8343,14 @@ uint32 Unit::MeleeDamageBonusTaken(Unit* attacker, uint32 pdamage, WeaponAttackT
void Unit::ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply)
{
if (apply)
- {
- for (SpellImmuneList::iterator itr = m_spellImmune[op].begin(), next; itr != m_spellImmune[op].end(); itr = next)
- {
- next = itr; ++next;
- if (itr->type == type)
- {
- m_spellImmune[op].erase(itr);
- next = m_spellImmune[op].begin();
- }
- }
- SpellImmune Immune;
- Immune.spellId = spellId;
- Immune.type = type;
- m_spellImmune[op].push_back(Immune);
- }
+ m_spellImmune[op].emplace(type, spellId);
else
{
- for (SpellImmuneList::iterator itr = m_spellImmune[op].begin(); itr != m_spellImmune[op].end(); ++itr)
- {
- if (itr->spellId == spellId && itr->type == type)
- {
- m_spellImmune[op].erase(itr);
- break;
- }
- }
- }
-}
-
-void Unit::ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply)
-{
- ApplySpellImmune(spellProto->Id, IMMUNITY_DISPEL, type, apply);
-
- if (apply && spellProto->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
- {
- // Create dispel mask by dispel type
- uint32 dispelMask = SpellInfo::GetDispelMask(type);
- // Dispel all existing auras vs current dispel type
- AuraApplicationMap& auras = GetAppliedAuras();
- for (AuraApplicationMap::iterator itr = auras.begin(); itr != auras.end();)
+ auto bounds = m_spellImmune[op].equal_range(type);
+ for (auto itr = bounds.first; itr != bounds.second;)
{
- SpellInfo const* spell = itr->second->GetBase()->GetSpellInfo();
- if (spell->GetDispelMask() & dispelMask)
- {
- // Dispel aura
- RemoveAura(itr);
- }
+ if (itr->second == spellId)
+ itr = m_spellImmune[op].erase(itr);
else
++itr;
}
@@ -8687,9 +8668,26 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|| (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster()))
return false;
- // can't attack invisible (ignore stealth for aoe spells) also if the area being looked at is from a spell use the dynamic object created instead of the casting unit. Ignore stealth if target is player and unit in combat with same player
- if ((!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE)) && (obj ? !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()) : !CanSeeOrDetect(target, (bySpell && bySpell->IsAffectingArea()) || (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target)))))
- return false;
+ // visibility checks
+ // skip visibility check for GO casts, needs removal when go cast is implemented. Also ignore for gameobject and dynauras
+ if (GetEntry() != WORLD_TRIGGER && (!obj || !obj->isType(TYPEMASK_GAMEOBJECT | TYPEMASK_DYNAMICOBJECT)))
+ {
+ // can't attack invisible
+ if (!bySpell || !bySpell->HasAttribute(SPELL_ATTR6_CAN_TARGET_INVISIBLE))
+ {
+ if (obj && !obj->CanSeeOrDetect(target, bySpell && bySpell->IsAffectingArea()))
+ return false;
+ else if (!obj)
+ {
+ // ignore stealth for aoe spells. Ignore stealth if target is player and unit in combat with same player
+ bool const ignoreStealthCheck = (bySpell && bySpell->IsAffectingArea()) ||
+ (target->GetTypeId() == TYPEID_PLAYER && target->HasStealthAura() && target->IsInCombat() && IsInCombatWith(target));
+
+ if (!CanSeeOrDetect(target, ignoreStealthCheck))
+ return false;
+ }
+ }
+ }
// can't attack dead
if ((!bySpell || !bySpell->IsAllowingDeadTarget()) && !target->IsAlive())
@@ -8720,7 +8718,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
// PvP, PvC, CvP case
// can't attack friendly targets
- if ( GetReactionTo(target) > REP_NEUTRAL
+ if (GetReactionTo(target) > REP_NEUTRAL
|| target->GetReactionTo(this) > REP_NEUTRAL)
return false;
@@ -8728,10 +8726,8 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
Player const* playerAffectingTarget = target->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE) ? target->GetAffectingPlayer() : nullptr;
// Not all neutral creatures can be attacked (even some unfriendly faction does not react aggresive to you, like Sporaggar)
- if (
- (playerAffectingAttacker && !playerAffectingTarget) ||
- (!playerAffectingAttacker && playerAffectingTarget)
- )
+ if ((playerAffectingAttacker && !playerAffectingTarget) ||
+ (!playerAffectingAttacker && playerAffectingTarget))
{
Player const* player = playerAffectingAttacker ? playerAffectingAttacker : playerAffectingTarget;
Unit const* creature = playerAffectingAttacker ? target : this;
@@ -8765,15 +8761,14 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
// additional checks - only PvP case
if (playerAffectingAttacker && playerAffectingTarget)
{
- if (target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_PVP)
+ if (target->IsPvP())
return true;
- if (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP
- && target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_FFA_PVP)
+ if (IsFFAPvP() && target->IsFFAPvP())
return true;
- return (GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_UNK1)
- || (target->GetByteValue(UNIT_FIELD_BYTES_2, 1) & UNIT_BYTE2_FLAG_UNK1);
+ return HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_UNK1)
+ || target->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_UNK1);
}
return true;
}
@@ -9760,9 +9755,6 @@ DiminishingLevels Unit::GetDiminishing(DiminishingGroup group)
if (!diminish.hitCount)
return DIMINISHING_LEVEL_1;
- if (!diminish.hitTime)
- return DIMINISHING_LEVEL_1;
-
// If last spell was cast more than 15 seconds ago - reset the count.
if (!diminish.stack && GetMSTimeDiffToNow(diminish.hitTime) > 15000)
{
@@ -10799,14 +10791,13 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond
hitMask |= PROC_HIT_PARRY;
break;
case SPELL_MISS_BLOCK:
- hitMask |= PROC_HIT_BLOCK;
+ // spells can't be partially blocked (it's damage can though)
+ hitMask |= PROC_HIT_BLOCK | PROC_HIT_FULL_BLOCK;
break;
case SPELL_MISS_EVADE:
hitMask |= PROC_HIT_EVADE;
break;
case SPELL_MISS_IMMUNE:
- hitMask |= PROC_HIT_IMMUNE;
- break;
case SPELL_MISS_IMMUNE2:
hitMask |= PROC_HIT_IMMUNE;
break;
@@ -10819,6 +10810,9 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond
case SPELL_MISS_REFLECT:
hitMask |= PROC_HIT_REFLECT;
break;
+ case SPELL_MISS_RESIST:
+ hitMask |= PROC_HIT_FULL_RESIST;
+ break;
default:
break;
}
@@ -10827,15 +10821,27 @@ uint32 createProcHitMask(SpellNonMeleeDamage* damageInfo, SpellMissInfo missCond
{
// On block
if (damageInfo->blocked)
+ {
hitMask |= PROC_HIT_BLOCK;
+ if (damageInfo->fullBlock)
+ hitMask |= PROC_HIT_FULL_BLOCK;
+ }
// On absorb
if (damageInfo->absorb)
hitMask |= PROC_HIT_ABSORB;
- // On crit
- if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT)
- hitMask |= PROC_HIT_CRITICAL;
- else
- hitMask |= PROC_HIT_NORMAL;
+
+ // Don't set hit/crit hitMask if damage is nullified
+ bool const damageNullified = (damageInfo->HitInfo & (HITINFO_FULL_ABSORB | HITINFO_FULL_RESIST)) != 0 || (hitMask & PROC_HIT_FULL_BLOCK) != 0;
+ if (!damageNullified)
+ {
+ // On crit
+ if (damageInfo->HitInfo & SPELL_HIT_TYPE_CRIT)
+ hitMask |= PROC_HIT_CRITICAL;
+ else
+ hitMask |= PROC_HIT_NORMAL;
+ }
+ else if ((damageInfo->HitInfo & HITINFO_FULL_RESIST) != 0)
+ hitMask |= PROC_HIT_FULL_RESIST;
}
return hitMask;
@@ -10924,7 +10930,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg
for (AuraApplication* aurApp : *procAuras)
{
ASSERT(aurApp->GetTarget() == this);
- if (uint8 procEffectMask = aurApp->GetBase()->IsProcTriggeredOnEvent(aurApp, eventInfo, now))
+ if (uint8 procEffectMask = aurApp->GetBase()->GetProcEffectMask(aurApp, eventInfo, now))
{
aurApp->GetBase()->PrepareProcToTrigger(aurApp, eventInfo, now);
aurasTriggeringProc.emplace_back(procEffectMask, aurApp);
@@ -10936,7 +10942,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg
{
for (AuraApplicationMap::iterator itr = GetAppliedAuras().begin(); itr != GetAppliedAuras().end(); ++itr)
{
- if (uint8 procEffectMask = itr->second->GetBase()->IsProcTriggeredOnEvent(itr->second, eventInfo, now))
+ if (uint8 procEffectMask = itr->second->GetBase()->GetProcEffectMask(itr->second, eventInfo, now))
{
itr->second->GetBase()->PrepareProcToTrigger(itr->second, eventInfo, now);
aurasTriggeringProc.emplace_back(procEffectMask, itr->second);
@@ -10955,16 +10961,31 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin
{
// prepare data for self trigger
ProcEventInfo myProcEventInfo(this, actionTarget, actionTarget, typeMaskActor, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
- if (typeMaskActor && CanProc())
+ if (typeMaskActor)
{
AuraApplicationProcContainer myAurasTriggeringProc;
GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, nullptr, myProcEventInfo);
+
+ // needed for example for Cobra Strikes, pet does the attack, but aura is on owner
+ if (Player* modOwner = GetSpellModOwner())
+ {
+ if (modOwner != this && spell)
+ {
+ AuraApplicationList modAuras;
+ for (auto itr = modOwner->GetAppliedAuras().begin(); itr != modOwner->GetAppliedAuras().end(); ++itr)
+ {
+ if (spell->m_appliedMods.count(itr->second->GetBase()) != 0)
+ modAuras.push_back(itr->second);
+ }
+ modOwner->GetProcAurasTriggeredOnEvent(myAurasTriggeringProc, &modAuras, myProcEventInfo);
+ }
+ }
TriggerAurasProcOnEvent(myProcEventInfo, myAurasTriggeringProc);
}
// prepare data for target trigger
ProcEventInfo targetProcEventInfo(this, actionTarget, this, typeMaskActionTarget, spellTypeMask, spellPhaseMask, hitMask, spell, damageInfo, healInfo);
- if (typeMaskActionTarget && actionTarget && actionTarget->CanProc())
+ if (typeMaskActionTarget && actionTarget)
{
AuraApplicationProcContainer targetAurasTriggeringProc;
actionTarget->GetProcAurasTriggeredOnEvent(targetAurasTriggeringProc, nullptr, targetProcEventInfo);
@@ -10974,6 +10995,11 @@ void Unit::TriggerAurasProcOnEvent(Unit* actionTarget, uint32 typeMaskActor, uin
void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProcContainer& aurasTriggeringProc)
{
+ Spell const* triggeringSpell = eventInfo.GetProcSpell();
+ bool const disableProcs = triggeringSpell && triggeringSpell->IsProcDisabled();
+ if (disableProcs)
+ SetCantProc(true);
+
for (auto const& aurAppProc : aurasTriggeringProc)
{
AuraApplication* aurApp;
@@ -10992,6 +11018,9 @@ void Unit::TriggerAurasProcOnEvent(ProcEventInfo& eventInfo, AuraApplicationProc
if (spellInfo->HasAttribute(SPELL_ATTR3_DISABLE_PROC))
SetCantProc(false);
}
+
+ if (disableProcs)
+ SetCantProc(false);
}
SpellSchoolMask Unit::GetMeleeDamageSchoolMask() const
@@ -11441,26 +11470,41 @@ float Unit::CalculateDefaultCoefficient(SpellInfo const* spellInfo, DamageEffect
float Unit::GetAPMultiplier(WeaponAttackType attType, bool normalized)
{
- if (!normalized || GetTypeId() != TYPEID_PLAYER)
- return float(GetAttackTime(attType)) / 1000.0f;
+ if (GetTypeId() != TYPEID_PLAYER)
+ return GetAttackTime(attType) / 1000.0f;
+
+ Item* weapon = ToPlayer()->GetWeaponForAttack(attType, true);
+ if (!weapon)
+ return BASE_ATTACK_TIME / 1000.0f;
- Item* Weapon = ToPlayer()->GetWeaponForAttack(attType, true);
- if (!Weapon)
- return 2.4f; // fist attack
+ if (!normalized)
+ return weapon->GetTemplate()->Delay / 1000.0f;
- switch (Weapon->GetTemplate()->InventoryType)
+ switch (weapon->GetTemplate()->SubClass)
{
- case INVTYPE_2HWEAPON:
+ case ITEM_SUBCLASS_WEAPON_AXE2:
+ case ITEM_SUBCLASS_WEAPON_MACE2:
+ case ITEM_SUBCLASS_WEAPON_POLEARM:
+ case ITEM_SUBCLASS_WEAPON_SWORD2:
+ case ITEM_SUBCLASS_WEAPON_STAFF:
+ case ITEM_SUBCLASS_WEAPON_FISHING_POLE:
return 3.3f;
- case INVTYPE_RANGED:
- case INVTYPE_RANGEDRIGHT:
- case INVTYPE_THROWN:
+ case ITEM_SUBCLASS_WEAPON_BOW:
+ case ITEM_SUBCLASS_WEAPON_GUN:
+ case ITEM_SUBCLASS_WEAPON_CROSSBOW:
+ case ITEM_SUBCLASS_WEAPON_THROWN:
return 2.8f;
- case INVTYPE_WEAPON:
- case INVTYPE_WEAPONMAINHAND:
- case INVTYPE_WEAPONOFFHAND:
+ case ITEM_SUBCLASS_WEAPON_AXE:
+ case ITEM_SUBCLASS_WEAPON_MACE:
+ case ITEM_SUBCLASS_WEAPON_SWORD:
+ case ITEM_SUBCLASS_WEAPON_EXOTIC:
+ case ITEM_SUBCLASS_WEAPON_EXOTIC2:
+ case ITEM_SUBCLASS_WEAPON_FIST:
+ return 2.4f;
+ case ITEM_SUBCLASS_WEAPON_DAGGER:
+ return 1.7f;
default:
- return Weapon->GetTemplate()->SubClass == ITEM_SUBCLASS_WEAPON_DAGGER ? 1.7f : 2.4f;
+ return weapon->GetTemplate()->Delay / 1000.0f;
}
}
@@ -12488,8 +12532,9 @@ bool Unit::IsInPartyWith(Unit const* unit) const
else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) ||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true;
- else
- return false;
+
+ // else u1->GetTypeId() == u2->GetTypeId() == TYPEID_UNIT
+ return u1->getFaction() == u2->getFaction();
}
bool Unit::IsInRaidWith(Unit const* unit) const
@@ -12507,8 +12552,9 @@ bool Unit::IsInRaidWith(Unit const* unit) const
else if ((u2->GetTypeId() == TYPEID_PLAYER && u1->GetTypeId() == TYPEID_UNIT && u1->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT) ||
(u1->GetTypeId() == TYPEID_PLAYER && u2->GetTypeId() == TYPEID_UNIT && u2->ToCreature()->GetCreatureTemplate()->type_flags & CREATURE_TYPE_FLAG_TREAT_AS_RAID_UNIT))
return true;
- else
- return false;
+
+ // else u1->GetTypeId() == u2->GetTypeId() == TYPEID_UNIT
+ return u1->getFaction() == u2->getFaction();
}
void Unit::GetPartyMembers(std::list<Unit*> &TagUnitMap)
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 20cdc75c001..917e5d24c79 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -377,13 +377,7 @@ class SpellCastTargets;
typedef std::list<Unit*> UnitList;
typedef std::list<std::pair<Aura*, uint8>> DispelChargesList;
-struct SpellImmune
-{
- uint32 type;
- uint32 spellId;
-};
-
-typedef std::list<SpellImmune> SpellImmuneList;
+typedef std::unordered_multimap<uint32 /*type*/, uint32 /*spellId*/> SpellImmuneContainer;
enum UnitModifierType
{
@@ -425,12 +419,18 @@ enum TriggerCastFlags
TRIGGERED_IGNORE_SET_FACING = 0x00000200, //! Will not adjust facing to target (if any)
TRIGGERED_IGNORE_SHAPESHIFT = 0x00000400, //! Will ignore shapeshift checks
TRIGGERED_IGNORE_CASTER_AURASTATE = 0x00000800, //! Will ignore caster aura states including combat requirements and death state
+ TRIGGERED_DISALLOW_PROC_EVENTS = 0x00001000, //! Disallows proc events from triggered spell (default)
TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE = 0x00002000, //! Will ignore mounted/on vehicle restrictions
+ // reuse = 0x00004000,
+ // reuse = 0x00008000,
TRIGGERED_IGNORE_CASTER_AURAS = 0x00010000, //! Will ignore caster aura restrictions or requirements
TRIGGERED_DONT_RESET_PERIODIC_TIMER = 0x00020000, //! Will allow periodic aura timers to keep ticking (instead of resetting)
TRIGGERED_DONT_REPORT_CAST_ERROR = 0x00040000, //! Will return SPELL_FAILED_DONT_REPORT in CheckCast functions
+ TRIGGERED_FULL_MASK = 0x0007FFFF, //! Used when doing CastSpell with triggered == true
+
+ // debug flags (used with .cast triggered commands)
TRIGGERED_IGNORE_EQUIPPED_ITEM_REQUIREMENT = 0x00080000, //! Will ignore equipped item requirements
- TRIGGERED_FULL_MASK = 0xFFFFFFFF
+ TRIGGERED_FULL_DEBUG_MASK = 0xFFFFFFFF
};
enum UnitMods
@@ -983,7 +983,7 @@ struct TC_GAME_API SpellNonMeleeDamage
{
SpellNonMeleeDamage(Unit* _attacker, Unit* _target, uint32 _SpellID, uint32 _schoolMask)
: target(_target), attacker(_attacker), SpellID(_SpellID), damage(0), overkill(0), schoolMask(_schoolMask),
- absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0)
+ absorb(0), resist(0), physicalLog(false), unused(false), blocked(0), HitInfo(0), cleanDamage(0), fullBlock(false)
{ }
Unit *target;
@@ -1000,6 +1000,7 @@ struct TC_GAME_API SpellNonMeleeDamage
uint32 HitInfo;
// Used for help
uint32 cleanDamage;
+ bool fullBlock;
};
struct SpellPeriodicAuraLogInfo
@@ -1433,7 +1434,7 @@ class TC_GAME_API Unit : public WorldObject
void Dismount();
uint16 GetMaxSkillValueForLevel(Unit const* target = NULL) const { return (target ? getLevelForTarget(target) : getLevel()) * 5; }
- void DealDamageMods(Unit* victim, uint32 &damage, uint32* absorb);
+ void DealDamageMods(Unit const* victim, uint32 &damage, uint32* absorb) const;
uint32 DealDamage(Unit* victim, uint32 damage, CleanDamage const* cleanDamage = NULL, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = NULL, bool durabilityLoss = true);
void Kill(Unit* victim, bool durabilityLoss = true);
void KillSelf(bool durabilityLoss = true) { Kill(this, durabilityLoss); }
@@ -1560,19 +1561,19 @@ class TC_GAME_API Unit : public WorldObject
int32 HealBySpell(HealInfo& healInfo, bool critical = false);
void SendEnergizeSpellLog(Unit* victim, uint32 spellID, int32 damage, Powers powerType);
void EnergizeBySpell(Unit* victim, uint32 SpellID, int32 Damage, Powers powertype);
- uint32 SpellNonMeleeDamageLog(Unit* victim, uint32 spellID, uint32 damage);
-
- void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = NULL, AuraEffect* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
- void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = NULL, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = NULL, AuraEffect const* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::Empty);
+
+ void CastSpell(SpellCastTargets const& targets, SpellInfo const* spellInfo, CustomSpellValues const* value, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(Unit* victim, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(Unit* victim, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(Unit* victim, SpellInfo const* spellInfo, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(Unit* victim, SpellInfo const* spellInfo, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(float x, float y, float z, uint32 spellId, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastSpell(GameObject* go, uint32 spellId, bool triggered, Item* castItem = nullptr, AuraEffect* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastCustomSpell(Unit* victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim, bool triggered, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastCustomSpell(uint32 spellId, SpellValueMod mod, int32 value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
+ void CastCustomSpell(uint32 spellId, CustomSpellValues const &value, Unit* victim = nullptr, TriggerCastFlags triggerFlags = TRIGGERED_NONE, Item* castItem = nullptr, AuraEffect const* triggeredByAura = nullptr, ObjectGuid originalCaster = ObjectGuid::Empty);
Aura* AddAura(uint32 spellId, Unit* target);
Aura* AddAura(SpellInfo const* spellInfo, uint8 effMask, Unit* target);
void SetAuraStack(uint32 spellId, Unit* target, uint32 stack);
@@ -1936,7 +1937,7 @@ class TC_GAME_API Unit : public WorldObject
void SetPhaseMask(uint32 newPhaseMask, bool update) override;// overwrite WorldObject::SetPhaseMask
void UpdateObjectVisibility(bool forced = true) override;
- SpellImmuneList m_spellImmune[MAX_SPELL_IMMUNITY];
+ SpellImmuneContainer m_spellImmune[MAX_SPELL_IMMUNITY];
uint32 m_lastSanctuaryTime;
// Threat related methods
@@ -2021,7 +2022,6 @@ class TC_GAME_API Unit : public WorldObject
uint32 GetRemainingPeriodicAmount(ObjectGuid caster, uint32 spellId, AuraType auraType, uint8 effectIndex = 0) const;
void ApplySpellImmune(uint32 spellId, uint32 op, uint32 type, bool apply);
- void ApplySpellDispelImmunity(const SpellInfo* spellProto, DispelType type, bool apply);
virtual bool IsImmunedToSpell(SpellInfo const* spellInfo) const; // redefined in Creature
uint32 GetSchoolImmunityMask() const;
uint32 GetMechanicImmunityMask() const;
@@ -2033,8 +2033,8 @@ class TC_GAME_API Unit : public WorldObject
static bool IsDamageReducedByArmor(SpellSchoolMask damageSchoolMask, SpellInfo const* spellInfo = NULL, uint8 effIndex = MAX_SPELL_EFFECTS);
uint32 CalcArmorReducedDamage(Unit* victim, const uint32 damage, SpellInfo const* spellInfo, WeaponAttackType attackType = MAX_ATTACK);
uint32 CalcSpellResistance(Unit* victim, SpellSchoolMask schoolMask, SpellInfo const* spellInfo) const;
- void CalcAbsorbResist(Unit* victim, SpellSchoolMask schoolMask, DamageEffectType damagetype, uint32 const damage, uint32* absorb, uint32* resist, SpellInfo const* spellInfo = NULL);
- void CalcHealAbsorb(HealInfo& healInfo);
+ void CalcAbsorbResist(DamageInfo& damageInfo);
+ void CalcHealAbsorb(HealInfo& healInfo) const;
void UpdateSpeed(UnitMoveType mtype);
float GetSpeed(UnitMoveType mtype) const;
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index 21bb6261971..e594cf7f289 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -804,7 +804,10 @@ void ObjectMgr::CheckCreatureTemplate(CreatureTemplate const* cInfo)
FactionTemplateEntry const* factionTemplate = sFactionTemplateStore.LookupEntry(cInfo->faction);
if (!factionTemplate)
- TC_LOG_ERROR("sql.sql", "Creature (Entry: %u) has non-existing faction template (%u).", cInfo->Entry, cInfo->faction);
+ {
+ TC_LOG_FATAL("sql.sql", "Creature (Entry: %u) has non-existing faction template (%u). This can lead to crashes, aborting.", cInfo->Entry, cInfo->faction);
+ ABORT();
+ }
// used later for scale
CreatureDisplayInfoEntry const* displayScaleEntry = nullptr;
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index df4788a0a1e..ac153f31b8e 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -642,6 +642,7 @@ namespace Trinity
{
public:
GameObjectFocusCheck(Unit const* unit, uint32 focusId) : i_unit(unit), i_focusId(focusId) { }
+
bool operator()(GameObject* go) const
{
if (go->GetGOInfo()->type != GAMEOBJECT_TYPE_SPELL_FOCUS)
@@ -657,6 +658,7 @@ namespace Trinity
return go->IsWithinDistInMap(i_unit, dist);
}
+
private:
Unit const* i_unit;
uint32 i_focusId;
@@ -667,6 +669,7 @@ namespace Trinity
{
public:
NearestGameObjectFishingHole(WorldObject const& obj, float range) : i_obj(obj), i_range(range) { }
+
bool operator()(GameObject* go)
{
if (go->GetGOInfo()->type == GAMEOBJECT_TYPE_FISHINGHOLE && go->isSpawned() && i_obj.IsWithinDistInMap(go, i_range) && i_obj.IsWithinDistInMap(go, (float)go->GetGOInfo()->fishinghole.radius))
@@ -676,19 +679,20 @@ namespace Trinity
}
return false;
}
- float GetLastRange() const { return i_range; }
+
private:
WorldObject const& i_obj;
- float i_range;
+ float i_range;
// prevent clone
- NearestGameObjectFishingHole(NearestGameObjectFishingHole const&);
+ NearestGameObjectFishingHole(NearestGameObjectFishingHole const&) = delete;
};
class NearestGameObjectCheck
{
public:
- NearestGameObjectCheck(WorldObject const& obj) : i_obj(obj), i_range(999) { }
+ NearestGameObjectCheck(WorldObject const& obj) : i_obj(obj), i_range(999.f) { }
+
bool operator()(GameObject* go)
{
if (i_obj.IsWithinDistInMap(go, i_range))
@@ -698,13 +702,13 @@ namespace Trinity
}
return false;
}
- float GetLastRange() const { return i_range; }
+
private:
WorldObject const& i_obj;
float i_range;
// prevent clone this object
- NearestGameObjectCheck(NearestGameObjectCheck const&);
+ NearestGameObjectCheck(NearestGameObjectCheck const&) = delete;
};
// Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO)
@@ -712,6 +716,7 @@ namespace Trinity
{
public:
NearestGameObjectEntryInObjectRangeCheck(WorldObject const& obj, uint32 entry, float range) : i_obj(obj), i_entry(entry), i_range(range) { }
+
bool operator()(GameObject* go)
{
if (go->GetEntry() == i_entry && i_obj.IsWithinDistInMap(go, i_range))
@@ -721,38 +726,39 @@ namespace Trinity
}
return false;
}
- float GetLastRange() const { return i_range; }
+
private:
WorldObject const& i_obj;
uint32 i_entry;
float i_range;
// prevent clone this object
- NearestGameObjectEntryInObjectRangeCheck(NearestGameObjectEntryInObjectRangeCheck const&);
+ NearestGameObjectEntryInObjectRangeCheck(NearestGameObjectEntryInObjectRangeCheck const&) = delete;
};
// Success at unit in range, range update for next check (this can be use with GameobjectLastSearcher to find nearest GO with a certain type)
class NearestGameObjectTypeInObjectRangeCheck
{
- public:
- NearestGameObjectTypeInObjectRangeCheck(WorldObject const& obj, GameobjectTypes type, float range) : i_obj(obj), i_type(type), i_range(range) { }
- bool operator()(GameObject* go)
- {
- if (go->GetGoType() == i_type && i_obj.IsWithinDistInMap(go, i_range))
+ public:
+ NearestGameObjectTypeInObjectRangeCheck(WorldObject const& obj, GameobjectTypes type, float range) : i_obj(obj), i_type(type), i_range(range) { }
+
+ bool operator()(GameObject* go)
{
- i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
- return true;
+ if (go->GetGoType() == i_type && i_obj.IsWithinDistInMap(go, i_range))
+ {
+ i_range = i_obj.GetDistance(go); // use found GO range as new range limit for next check
+ return true;
+ }
+ return false;
}
- return false;
- }
- float GetLastRange() const { return i_range; }
- private:
- WorldObject const& i_obj;
- GameobjectTypes i_type;
- float i_range;
- // prevent clone this object
- NearestGameObjectTypeInObjectRangeCheck(NearestGameObjectTypeInObjectRangeCheck const&);
+ private:
+ WorldObject const& i_obj;
+ GameobjectTypes i_type;
+ float i_range;
+
+ // prevent clone this object
+ NearestGameObjectTypeInObjectRangeCheck(NearestGameObjectTypeInObjectRangeCheck const&) = delete;
};
// Unit checks
@@ -761,6 +767,7 @@ namespace Trinity
{
public:
MostHPMissingInRange(Unit const* obj, float range, uint32 hp) : i_obj(obj), i_range(range), i_hp(hp) { }
+
bool operator()(Unit* u)
{
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
@@ -770,6 +777,7 @@ namespace Trinity
}
return false;
}
+
private:
Unit const* i_obj;
float i_range;
@@ -780,7 +788,8 @@ namespace Trinity
{
public:
FriendlyCCedInRange(Unit const* obj, float range) : i_obj(obj), i_range(range) { }
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
(u->isFeared() || u->IsCharmed() || u->isFrozen() || u->HasUnitState(UNIT_STATE_STUNNED) || u->HasUnitState(UNIT_STATE_CONFUSED)))
@@ -789,6 +798,7 @@ namespace Trinity
}
return false;
}
+
private:
Unit const* i_obj;
float i_range;
@@ -798,15 +808,15 @@ namespace Trinity
{
public:
FriendlyMissingBuffInRange(Unit const* obj, float range, uint32 spellid) : i_obj(obj), i_range(range), i_spell(spellid) { }
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
- if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) &&
- !(u->HasAura(i_spell)))
- {
+ if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && !u->HasAura(i_spell))
return true;
- }
+
return false;
}
+
private:
Unit const* i_obj;
float i_range;
@@ -817,23 +827,26 @@ namespace Trinity
{
public:
AnyUnfriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u))
return true;
- else
- return false;
+
+ return false;
}
+
private:
WorldObject const* i_obj;
Unit const* i_funit;
float i_range;
};
- class AnyUnfriendlyNoTotemUnitInObjectRangeCheck
+ class NearestAttackableNoTotemUnitInObjectRangeCheck
{
public:
- AnyUnfriendlyNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
+ NearestAttackableNoTotemUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
+
bool operator()(Unit* u)
{
if (!u->IsAlive())
@@ -842,14 +855,19 @@ namespace Trinity
if (u->GetCreatureType() == CREATURE_TYPE_NON_COMBAT_PET)
return false;
- if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
+ if (u->GetTypeId() == TYPEID_UNIT && u->ToCreature()->IsTotem())
return false;
if (!u->isTargetableForAttack(false))
return false;
- return i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u);
+ if (!i_obj->IsWithinDistInMap(u, i_range) || !i_funit->_IsValidAttackTarget(u, nullptr, i_obj))
+ return false;
+
+ i_range = i_obj->GetDistance(*u);
+ return true;
}
+
private:
WorldObject const* i_obj;
Unit const* i_funit;
@@ -860,13 +878,15 @@ namespace Trinity
{
public:
AnyFriendlyUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool playerOnly = false) : i_obj(obj), i_funit(funit), i_range(range), i_playerOnly(playerOnly) { }
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_funit->IsFriendlyTo(u) && (!i_playerOnly || u->GetTypeId() == TYPEID_PLAYER))
return true;
else
return false;
}
+
private:
WorldObject const* i_obj;
Unit const* i_funit;
@@ -878,7 +898,8 @@ namespace Trinity
{
public:
AnyGroupedUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool raid, bool playerOnly = false) : _source(obj), _refUnit(funit), _range(range), _raid(raid), _playerOnly(playerOnly) { }
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
if (G3D::fuzzyEq(_range, 0.0f))
return false;
@@ -909,13 +930,15 @@ namespace Trinity
{
public:
AnyUnitInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) { }
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
return true;
return false;
}
+
private:
WorldObject const* i_obj;
float i_range;
@@ -926,6 +949,7 @@ namespace Trinity
{
public:
NearestAttackableUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) : i_obj(obj), i_funit(funit), i_range(range) { }
+
bool operator()(Unit* u)
{
if (u->isTargetableForAttack() && i_obj->IsWithinDistInMap(u, i_range) &&
@@ -937,13 +961,14 @@ namespace Trinity
return false;
}
+
private:
WorldObject const* i_obj;
Unit const* i_funit;
float i_range;
// prevent clone this object
- NearestAttackableUnitInObjectRangeCheck(NearestAttackableUnitInObjectRangeCheck const&);
+ NearestAttackableUnitInObjectRangeCheck(NearestAttackableUnitInObjectRangeCheck const&) = delete;
};
class AnyAoETargetUnitInObjectRangeCheck
@@ -952,17 +977,12 @@ namespace Trinity
AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, SpellInfo const* spellInfo = nullptr)
: i_obj(obj), i_funit(funit), _spellInfo(spellInfo), i_range(range)
{
- Unit const* check = i_funit;
- Unit const* owner = i_funit->GetOwner();
- if (owner)
- check = owner;
- i_targetForPlayer = (check->GetTypeId() == TYPEID_PLAYER);
-
if (!_spellInfo)
if (DynamicObject const* dynObj = i_obj->ToDynObject())
_spellInfo = sSpellMgr->GetSpellInfo(dynObj->GetSpellId());
}
- bool operator()(Unit* u)
+
+ bool operator()(Unit* u) const
{
// Check contains checks for: live, non-selectable, non-attackable flags, flight check and GM check, ignore totems
if (u->GetTypeId() == TYPEID_UNIT && u->IsTotem())
@@ -973,8 +993,8 @@ namespace Trinity
return i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : nullptr) && i_obj->IsWithinDistInMap(u, i_range);
}
+
private:
- bool i_targetForPlayer;
WorldObject const* i_obj;
Unit const* i_funit;
SpellInfo const* _spellInfo;
@@ -986,9 +1006,9 @@ namespace Trinity
{
public:
CallOfHelpCreatureInRangeDo(Unit* funit, Unit* enemy, float range)
- : i_funit(funit), i_enemy(enemy), i_range(range)
- { }
- void operator()(Creature* u)
+ : i_funit(funit), i_enemy(enemy), i_range(range) { }
+
+ void operator()(Creature* u) const
{
if (u == i_funit)
return;
@@ -1013,27 +1033,16 @@ namespace Trinity
float i_range;
};
- struct AnyDeadUnitCheck
- {
- bool operator()(Unit* u) { return !u->IsAlive(); }
- };
-
- /*
- struct AnyStealthedCheck
- {
- bool operator()(Unit* u) { return u->GetVisibility() == VISIBILITY_GROUP_STEALTH; }
- };
- */
-
// Creature checks
class NearestHostileUnitCheck
{
public:
- explicit NearestHostileUnitCheck(Creature const* creature, float dist = 0, bool playerOnly = false) : me(creature), i_playerOnly(playerOnly)
+ explicit NearestHostileUnitCheck(Creature const* creature, float dist = 0.f, bool playerOnly = false) : me(creature), i_playerOnly(playerOnly)
{
- m_range = (dist == 0 ? 9999 : dist);
+ m_range = (dist == 0.f ? 9999.f : dist);
}
+
bool operator()(Unit* u)
{
if (!me->IsWithinDistInMap(u, m_range))
@@ -1049,21 +1058,22 @@ namespace Trinity
return true;
}
- private:
+ private:
Creature const* me;
float m_range;
bool i_playerOnly;
- NearestHostileUnitCheck(NearestHostileUnitCheck const&);
+ NearestHostileUnitCheck(NearestHostileUnitCheck const&) = delete;
};
class NearestHostileUnitInAttackDistanceCheck
{
public:
- explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0) : me(creature)
+ explicit NearestHostileUnitInAttackDistanceCheck(Creature const* creature, float dist = 0.f) : me(creature)
{
- m_range = (dist == 0 ? 9999 : dist);
- m_force = (dist == 0 ? false : true);
+ m_range = (dist == 0.f ? 9999.f : dist);
+ m_force = (dist == 0.f ? false : true);
}
+
bool operator()(Unit* u)
{
if (!me->IsWithinDistInMap(u, m_range))
@@ -1083,21 +1093,20 @@ namespace Trinity
m_range = me->GetDistance(u); // use found unit range as new range limit for next check
return true;
}
- float GetLastRange() const { return m_range; }
+
private:
Creature const* me;
float m_range;
bool m_force;
- NearestHostileUnitInAttackDistanceCheck(NearestHostileUnitInAttackDistanceCheck const&);
+ NearestHostileUnitInAttackDistanceCheck(NearestHostileUnitInAttackDistanceCheck const&) = delete;
};
class NearestHostileUnitInAggroRangeCheck
{
public:
- explicit NearestHostileUnitInAggroRangeCheck(Creature const* creature, bool useLOS = false) : _me(creature), _useLOS(useLOS)
- {
- }
- bool operator()(Unit* u)
+ explicit NearestHostileUnitInAggroRangeCheck(Creature const* creature, bool useLOS = false) : _me(creature), _useLOS(useLOS) { }
+
+ bool operator()(Unit* u) const
{
if (!u->IsHostileTo(_me))
return false;
@@ -1114,20 +1123,19 @@ namespace Trinity
return true;
}
- private:
+ private:
Creature const* _me;
bool _useLOS;
- NearestHostileUnitInAggroRangeCheck(NearestHostileUnitInAggroRangeCheck const&);
+ NearestHostileUnitInAggroRangeCheck(NearestHostileUnitInAggroRangeCheck const&) = delete;
};
class AnyAssistCreatureInRangeCheck
{
public:
AnyAssistCreatureInRangeCheck(Unit* funit, Unit* enemy, float range)
- : i_funit(funit), i_enemy(enemy), i_range(range)
- {
- }
- bool operator()(Creature* u)
+ : i_funit(funit), i_enemy(enemy), i_range(range) { }
+
+ bool operator()(Creature* u) const
{
if (u == i_funit)
return false;
@@ -1145,6 +1153,7 @@ namespace Trinity
return true;
}
+
private:
Unit* const i_funit;
Unit* const i_enemy;
@@ -1173,14 +1182,14 @@ namespace Trinity
i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
return true;
}
- float GetLastRange() const { return i_range; }
+
private:
Creature* const i_obj;
Unit* const i_enemy;
float i_range;
// prevent clone this object
- NearestAssistCreatureInCreatureRangeCheck(NearestAssistCreatureInCreatureRangeCheck const&);
+ NearestAssistCreatureInCreatureRangeCheck(NearestAssistCreatureInCreatureRangeCheck const&) = delete;
};
// Success at unit in range, range update for next check (this can be use with CreatureLastSearcher to find nearest creature)
@@ -1199,7 +1208,7 @@ namespace Trinity
}
return false;
}
- float GetLastRange() const { return i_range; }
+
private:
WorldObject const& i_obj;
uint32 i_entry;
@@ -1207,14 +1216,15 @@ namespace Trinity
float i_range;
// prevent clone this object
- NearestCreatureEntryWithLiveStateInObjectRangeCheck(NearestCreatureEntryWithLiveStateInObjectRangeCheck const&);
+ NearestCreatureEntryWithLiveStateInObjectRangeCheck(NearestCreatureEntryWithLiveStateInObjectRangeCheck const&) = delete;
};
class AnyPlayerInObjectRangeCheck
{
public:
AnyPlayerInObjectRangeCheck(WorldObject const* obj, float range, bool reqAlive = true) : _obj(obj), _range(range), _reqAlive(reqAlive) { }
- bool operator()(Player* u)
+
+ bool operator()(Player* u) const
{
if (_reqAlive && !u->IsAlive())
return false;
@@ -1234,9 +1244,7 @@ namespace Trinity
class NearestPlayerInObjectRangeCheck
{
public:
- NearestPlayerInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range)
- {
- }
+ NearestPlayerInObjectRangeCheck(WorldObject const* obj, float range) : i_obj(obj), i_range(range) { }
bool operator()(Player* u)
{
@@ -1252,46 +1260,51 @@ namespace Trinity
WorldObject const* i_obj;
float i_range;
- NearestPlayerInObjectRangeCheck(NearestPlayerInObjectRangeCheck const&);
+ NearestPlayerInObjectRangeCheck(NearestPlayerInObjectRangeCheck const&) = delete;
};
class AllFriendlyCreaturesInGrid
{
- public:
- AllFriendlyCreaturesInGrid(Unit const* obj) : unit(obj) { }
- bool operator() (Unit* u)
- {
- if (u->IsAlive() && u->IsVisible() && u->IsFriendlyTo(unit))
- return true;
+ public:
+ AllFriendlyCreaturesInGrid(Unit const* obj) : unit(obj) { }
- return false;
- }
- private:
- Unit const* unit;
+ bool operator()(Unit* u) const
+ {
+ if (u->IsAlive() && u->IsVisible() && u->IsFriendlyTo(unit))
+ return true;
+
+ return false;
+ }
+
+ private:
+ Unit const* unit;
};
class AllGameObjectsWithEntryInRange
{
- public:
- AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
- bool operator() (GameObject* go)
- {
- if ((!m_uiEntry || go->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(go, m_fRange, false))
- return true;
+ public:
+ AllGameObjectsWithEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
- return false;
- }
- private:
- const WorldObject* m_pObject;
- uint32 m_uiEntry;
- float m_fRange;
+ bool operator()(GameObject* go) const
+ {
+ if ((!m_uiEntry || go->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(go, m_fRange, false))
+ return true;
+
+ return false;
+ }
+
+ private:
+ WorldObject const* m_pObject;
+ uint32 m_uiEntry;
+ float m_fRange;
};
class AllCreaturesOfEntryInRange
{
public:
AllCreaturesOfEntryInRange(const WorldObject* object, uint32 entry, float maxRange) : m_pObject(object), m_uiEntry(entry), m_fRange(maxRange) { }
- bool operator() (Unit* unit)
+
+ bool operator()(Unit* unit) const
{
if ((!m_uiEntry || unit->GetEntry() == m_uiEntry) && m_pObject->IsWithinDist(unit, m_fRange, false))
return true;
@@ -1300,63 +1313,69 @@ namespace Trinity
}
private:
- const WorldObject* m_pObject;
+ WorldObject const* m_pObject;
uint32 m_uiEntry;
float m_fRange;
};
class PlayerAtMinimumRangeAway
{
- public:
- PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : unit(unit), fRange(fMinRange) { }
- bool operator() (Player* player)
- {
- //No threat list check, must be done explicit if expected to be in combat with creature
- if (!player->IsGameMaster() && player->IsAlive() && !unit->IsWithinDist(player, fRange, false))
- return true;
+ public:
+ PlayerAtMinimumRangeAway(Unit const* unit, float fMinRange) : unit(unit), fRange(fMinRange) { }
- return false;
- }
+ bool operator()(Player* player) const
+ {
+ //No threat list check, must be done explicit if expected to be in combat with creature
+ if (!player->IsGameMaster() && player->IsAlive() && !unit->IsWithinDist(player, fRange, false))
+ return true;
- private:
- Unit const* unit;
- float fRange;
+ return false;
+ }
+
+ private:
+ Unit const* unit;
+ float fRange;
};
class GameObjectInRangeCheck
{
- public:
- GameObjectInRangeCheck(float _x, float _y, float _z, float _range, uint32 _entry = 0) :
- x(_x), y(_y), z(_z), range(_range), entry(_entry) { }
- bool operator() (GameObject* go)
- {
- if (!entry || (go->GetGOInfo() && go->GetGOInfo()->entry == entry))
- return go->IsInRange(x, y, z, range);
- else return false;
- }
- private:
- float x, y, z, range;
- uint32 entry;
+ public:
+ GameObjectInRangeCheck(float _x, float _y, float _z, float _range, uint32 _entry = 0) :
+ x(_x), y(_y), z(_z), range(_range), entry(_entry) { }
+
+ bool operator()(GameObject* go) const
+ {
+ if (!entry || (go->GetGOInfo() && go->GetGOInfo()->entry == entry))
+ return go->IsInRange(x, y, z, range);
+ else return false;
+ }
+
+ private:
+ float x, y, z, range;
+ uint32 entry;
};
class AllWorldObjectsInRange
{
- public:
- AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) { }
- bool operator() (WorldObject* go)
- {
- return m_pObject->IsWithinDist(go, m_fRange, false) && m_pObject->InSamePhase(go);
- }
- private:
- const WorldObject* m_pObject;
- float m_fRange;
+ public:
+ AllWorldObjectsInRange(const WorldObject* object, float maxRange) : m_pObject(object), m_fRange(maxRange) { }
+
+ bool operator()(WorldObject* go) const
+ {
+ return m_pObject->IsWithinDist(go, m_fRange, false) && m_pObject->InSamePhase(go);
+ }
+
+ private:
+ WorldObject const* m_pObject;
+ float m_fRange;
};
class ObjectTypeIdCheck
{
public:
ObjectTypeIdCheck(TypeID typeId, bool equals) : _typeId(typeId), _equals(equals) { }
- bool operator()(WorldObject* object)
+
+ bool operator()(WorldObject* object) const
{
return (object->GetTypeId() == _typeId) == _equals;
}
@@ -1370,7 +1389,8 @@ namespace Trinity
{
public:
ObjectGUIDCheck(ObjectGuid GUID) : _GUID(GUID) { }
- bool operator()(WorldObject* object)
+
+ bool operator()(WorldObject* object) const
{
return object->GetGUID() == _GUID;
}
@@ -1383,6 +1403,7 @@ namespace Trinity
{
public:
UnitAuraCheck(bool present, uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty) : _present(present), _spellId(spellId), _casterGUID(casterGUID) { }
+
bool operator()(Unit* unit) const
{
return unit->HasAura(_spellId, _casterGUID) == _present;
@@ -1413,6 +1434,7 @@ namespace Trinity
for (size_t i = 0; i < i_data_cache.size(); ++i)
delete i_data_cache[i];
}
+
void operator()(Player* p);
private:
diff --git a/src/server/game/Guilds/Guild.cpp b/src/server/game/Guilds/Guild.cpp
index b95d2ed1981..84b2da9b2ea 100644
--- a/src/server/game/Guilds/Guild.cpp
+++ b/src/server/game/Guilds/Guild.cpp
@@ -29,10 +29,13 @@
#include "SocialMgr.h"
#include "Opcodes.h"
-#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
-#define EMBLEM_PRICE 10 * GOLD
-std::string _GetGuildEventString(GuildEvents event)
+size_t const MAX_GUILD_BANK_TAB_TEXT_LEN = 500;
+
+uint32 const EMBLEM_PRICE = 10 * GOLD;
+
+// only used in logs
+char const* GetGuildEventString(GuildEvents event)
{
switch (event)
{
@@ -82,18 +85,13 @@ std::string _GetGuildEventString(GuildEvents event)
return "<None>";
}
-inline uint32 _GetGuildBankTabPrice(uint8 tabId)
+inline uint32 GetGuildBankTabPrice(uint8 tabId)
{
- switch (tabId)
- {
- case 0: return 100;
- case 1: return 250;
- case 2: return 500;
- case 3: return 1000;
- case 4: return 2500;
- case 5: return 5000;
- default: return 0;
- }
+ // these prices are in gold units, not copper
+ static uint32 const tabPrices[GUILD_BANK_MAX_TABS] = { 100, 250, 500, 1000, 2500, 5000 };
+ ASSERT(tabId < GUILD_BANK_MAX_TABS);
+
+ return tabPrices[tabId];
}
void Guild::SendCommandResult(WorldSession* session, GuildCommandType type, GuildCommandError errCode, std::string const& param)
@@ -121,7 +119,7 @@ void Guild::SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode
Guild::LogHolder::~LogHolder()
{
// Cleanup
- for (GuildLog::iterator itr = m_log.begin(); itr != m_log.end(); ++itr)
+ for (auto itr = m_log.begin(); itr != m_log.end(); ++itr)
delete (*itr);
}
@@ -154,7 +152,7 @@ inline void Guild::LogHolder::AddEvent(SQLTransaction& trans, LogEntry* entry)
inline void Guild::LogHolder::WritePacket(WorldPacket& data) const
{
data << uint8(m_log.size());
- for (GuildLog::const_iterator itr = m_log.begin(); itr != m_log.end(); ++itr)
+ for (auto itr = m_log.begin(); itr != m_log.end(); ++itr)
(*itr)->WritePacket(data);
}
@@ -175,7 +173,7 @@ void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_EVENTLOG);
stmt->setUInt32(0, m_guildId);
stmt->setUInt32(1, m_guid);
- CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ trans->Append(stmt);
uint8 index = 0;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_EVENTLOG);
@@ -186,7 +184,7 @@ void Guild::EventLogEntry::SaveToDB(SQLTransaction& trans) const
stmt->setUInt32(++index, m_playerGuid2);
stmt->setUInt8 (++index, m_newRank);
stmt->setUInt64(++index, m_timestamp);
- CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ trans->Append(stmt);
}
void Guild::EventLogEntry::WritePacket(WorldPacket& data) const
@@ -202,7 +200,7 @@ void Guild::EventLogEntry::WritePacket(WorldPacket& data) const
if (m_eventType == GUILD_EVENT_LOG_PROMOTE_PLAYER || m_eventType == GUILD_EVENT_LOG_DEMOTE_PLAYER)
data << uint8(m_newRank);
// Event timestamp
- data << uint32(::time(NULL) - m_timestamp);
+ data << uint32(::time(nullptr) - m_timestamp);
}
// BankEventLogEntry
@@ -214,7 +212,7 @@ void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const
stmt->setUInt32( index, m_guildId);
stmt->setUInt32(++index, m_guid);
stmt->setUInt8 (++index, m_bankTabId);
- CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ trans->Append(stmt);
index = 0;
stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_GUILD_BANK_EVENTLOG);
@@ -227,7 +225,7 @@ void Guild::BankEventLogEntry::SaveToDB(SQLTransaction& trans) const
stmt->setUInt16(++index, m_itemStackCount);
stmt->setUInt8 (++index, m_destTabId);
stmt->setUInt64(++index, m_timestamp);
- CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ trans->Append(stmt);
}
void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const
@@ -252,7 +250,7 @@ void Guild::BankEventLogEntry::WritePacket(WorldPacket& data) const
data << uint32(m_itemOrMoney);
}
- data << uint32(time(NULL) - m_timestamp);
+ data << uint32(time(nullptr) - m_timestamp);
}
// RankInfo
@@ -434,14 +432,16 @@ bool Guild::BankTab::LoadItemFromDB(Field* fields)
void Guild::BankTab::Delete(SQLTransaction& trans, bool removeItemsFromDB)
{
for (uint8 slotId = 0; slotId < GUILD_BANK_MAX_SLOTS; ++slotId)
+ {
if (Item* pItem = m_items[slotId])
{
pItem->RemoveFromWorld();
if (removeItemsFromDB)
pItem->DeleteFromDB(trans);
delete pItem;
- pItem = NULL;
+ pItem = nullptr;
}
+ }
}
inline void Guild::BankTab::WritePacket(WorldPacket& data) const
@@ -491,12 +491,14 @@ bool Guild::BankTab::WriteSlotPacket(WorldPacket& data, uint8 slotId, bool ignor
data << uint8(enchCount); // Number of enchantments
for (uint32 i = PERM_ENCHANTMENT_SLOT; i < MAX_ENCHANTMENT_SLOT; ++i)
+ {
if (uint32 enchId = pItem->GetEnchantmentId(EnchantmentSlot(i)))
{
data << uint8(i);
data << uint32(enchId);
++enchCount;
}
+ }
data.put<uint8>(enchCountPos, enchCount);
}
return true;
@@ -534,7 +536,7 @@ void Guild::BankTab::SetText(std::string const& text)
}
// Sets/removes contents of specified slot.
-// If pItem == NULL contents are removed.
+// If pItem == nullptr contents are removed.
bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item)
{
if (slotId >= GUILD_BANK_MAX_SLOTS)
@@ -546,7 +548,7 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item)
stmt->setUInt32(0, m_guildId);
stmt->setUInt8 (1, m_tabId);
stmt->setUInt8 (2, slotId);
- CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ trans->Append(stmt);
if (item)
{
@@ -555,13 +557,14 @@ bool Guild::BankTab::SetItem(SQLTransaction& trans, uint8 slotId, Item* item)
stmt->setUInt8 (1, m_tabId);
stmt->setUInt8 (2, slotId);
stmt->setUInt32(3, item->GetGUID().GetCounter());
- CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ trans->Append(stmt);
item->SetGuidValue(ITEM_FIELD_CONTAINED, ObjectGuid::Empty);
item->SetGuidValue(ITEM_FIELD_OWNER, ObjectGuid::Empty);
item->FSetState(ITEM_NEW);
item->SaveToDB(trans); // Not in inventory and can be saved standalone
}
+
return true;
}
@@ -629,7 +632,7 @@ void Guild::Member::SetOfficerNote(std::string const& officerNote)
CharacterDatabase.Execute(stmt);
}
-void Guild::Member::ChangeRank(uint8 newRank)
+void Guild::Member::ChangeRank(SQLTransaction& trans, uint8 newRank)
{
m_rankId = newRank;
@@ -640,7 +643,7 @@ void Guild::Member::ChangeRank(uint8 newRank)
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_MEMBER_RANK);
stmt->setUInt8 (0, newRank);
stmt->setUInt32(1, m_guid.GetCounter());
- CharacterDatabase.Execute(stmt);
+ CharacterDatabase.ExecuteOrAppend(trans, stmt);
}
void Guild::Member::SaveToDB(SQLTransaction& trans) const
@@ -714,7 +717,7 @@ void Guild::Member::WritePacket(WorldPacket& data, bool sendOfficerNote) const
<< uint32(m_zoneId);
if (!m_flags)
- data << float(float(::time(NULL) - m_logoutTime) / DAY);
+ data << float(float(::time(nullptr) - m_logoutTime) / DAY);
data << m_publicNote;
@@ -839,7 +842,7 @@ void Guild::MoveItemData::LogAction(MoveItemData* pFrom) const
inline void Guild::MoveItemData::CopySlots(SlotIds& ids) const
{
- for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); ++itr)
+ for (auto itr = m_vec.begin(); itr != m_vec.end(); ++itr)
ids.insert(uint8(itr->pos));
}
@@ -853,16 +856,16 @@ bool Guild::PlayerMoveItemData::InitItem()
if (m_pItem->IsNotEmptyBag())
{
m_pPlayer->SendEquipError(EQUIP_ERR_CAN_ONLY_DO_WITH_EMPTY_BAGS, m_pItem);
- m_pItem = NULL;
+ m_pItem = nullptr;
}
// Bound items cannot be put into bank.
else if (!m_pItem->CanBeTraded())
{
m_pPlayer->SendEquipError(EQUIP_ERR_ITEMS_CANT_BE_SWAPPED, m_pItem);
- m_pItem = NULL;
+ m_pItem = nullptr;
}
}
- return (m_pItem != NULL);
+ return (m_pItem != nullptr);
}
void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* /*pOther*/, uint32 splitedAmount)
@@ -877,7 +880,7 @@ void Guild::PlayerMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData*
{
m_pPlayer->MoveItemFromInventory(m_container, m_slotId, true);
m_pItem->DeleteFromInventoryDB(trans);
- m_pItem = NULL;
+ m_pItem = nullptr;
}
}
@@ -906,7 +909,7 @@ inline InventoryResult Guild::PlayerMoveItemData::CanStore(Item* pItem, bool swa
bool Guild::BankMoveItemData::InitItem()
{
m_pItem = m_pGuild->_GetItem(m_container, m_slotId);
- return (m_pItem != NULL);
+ return (m_pItem != nullptr);
}
bool Guild::BankMoveItemData::HasStoreRights(MoveItemData* pOther) const
@@ -944,7 +947,7 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO
else
{
m_pGuild->_RemoveItem(trans, m_container, m_slotId);
- m_pItem = NULL;
+ m_pItem = nullptr;
}
// Decrease amount of player's remaining items (if item is moved to different tab or to player)
if (!pOther->IsBank() || pOther->GetContainer() != m_container)
@@ -954,14 +957,14 @@ void Guild::BankMoveItemData::RemoveItem(SQLTransaction& trans, MoveItemData* pO
Item* Guild::BankMoveItemData::StoreItem(SQLTransaction& trans, Item* pItem)
{
if (!pItem)
- return NULL;
+ return nullptr;
BankTab* pTab = m_pGuild->GetBankTab(m_container);
if (!pTab)
- return NULL;
+ return nullptr;
Item* pLastItem = pItem;
- for (ItemPosCountVec::const_iterator itr = m_vec.begin(); itr != m_vec.end(); )
+ for (auto itr = m_vec.begin(); itr != m_vec.end(); )
{
ItemPosCount pos(*itr);
++itr;
@@ -1025,7 +1028,7 @@ Item* Guild::BankMoveItemData::_StoreItem(SQLTransaction& trans, BankTab* pTab,
if (pItem && pTab->SetItem(trans, slotId, pItem))
return pItem;
- return NULL;
+ return nullptr;
}
// Tries to reserve space for source item.
@@ -1065,10 +1068,10 @@ void Guild::BankMoveItemData::CanStoreItemInTab(Item* pItem, uint8 skipSlotId, b
Item* pItemDest = m_pGuild->_GetItem(m_container, slotId);
if (pItemDest == pItem)
- pItemDest = NULL;
+ pItemDest = nullptr;
// If merge skip empty, if not merge skip non-empty
- if ((pItemDest != NULL) != merge)
+ if ((pItemDest != nullptr) != merge)
continue;
_ReserveSpace(slotId, pItem, pItemDest, count);
@@ -1095,7 +1098,7 @@ InventoryResult Guild::BankMoveItemData::CanStore(Item* pItem, bool swap)
Item* pItemDest = m_pGuild->_GetItem(m_container, m_slotId);
// Ignore swapped item (this slot will be empty after move)
if ((pItemDest == pItem) || swap)
- pItemDest = NULL;
+ pItemDest = nullptr;
if (!_ReserveSpace(m_slotId, pItem, pItemDest, count))
return EQUIP_ERR_ITEM_CANT_STACK;
@@ -1128,30 +1131,30 @@ Guild::Guild():
m_createdDate(0),
m_accountsNumber(0),
m_bankMoney(0),
- m_eventLog(NULL)
+ m_eventLog(nullptr)
{
memset(&m_bankEventLog, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(LogHolder*));
}
Guild::~Guild()
{
- SQLTransaction temp(NULL);
+ SQLTransaction temp(nullptr);
_DeleteBankItems(temp);
// Cleanup
delete m_eventLog;
- m_eventLog = NULL;
+ m_eventLog = nullptr;
for (uint8 tabId = 0; tabId <= GUILD_BANK_MAX_TABS; ++tabId)
{
delete m_bankEventLog[tabId];
- m_bankEventLog[tabId] = NULL;
+ m_bankEventLog[tabId] = nullptr;
}
- for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
{
delete itr->second;
- itr->second = NULL;
+ itr->second = nullptr;
}
}
@@ -1172,7 +1175,7 @@ bool Guild::Create(Player* pLeader, std::string const& name)
m_info = "";
m_motd = "No message set.";
m_bankMoney = 0;
- m_createdDate = ::time(NULL);
+ m_createdDate = ::time(nullptr);
_CreateLogHolders();
TC_LOG_DEBUG("guild", "GUILD: creating guild [%s] for leader %s (%u)",
@@ -1200,9 +1203,10 @@ bool Guild::Create(Player* pLeader, std::string const& name)
stmt->setUInt64(++index, m_bankMoney);
trans->Append(stmt);
+ _CreateDefaultGuildRanks(trans, pLeaderSession->GetSessionDbLocaleIndex()); // Create default ranks
+ bool ret = AddMember(trans, m_leaderGuid, GR_GUILDMASTER); // Add guildmaster
+
CharacterDatabase.CommitTransaction(trans);
- _CreateDefaultGuildRanks(pLeaderSession->GetSessionDbLocaleIndex()); // Create default ranks
- bool ret = AddMember(m_leaderGuid, GR_GUILDMASTER); // Add guildmaster
if (ret)
sScriptMgr->OnGuildCreate(this, pLeader, name);
@@ -1217,15 +1221,15 @@ void Guild::Disband()
sScriptMgr->OnGuildDisband(this);
_BroadcastEvent(GE_DISBANDED, ObjectGuid::Empty);
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
// Remove all members
while (!m_members.empty())
{
- Members::const_iterator itr = m_members.begin();
- DeleteMember(itr->second->GetGUID(), true);
+ auto itr = m_members.begin();
+ DeleteMember(trans, itr->second->GetGUID(), true);
}
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
-
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD);
stmt->setUInt32(0, m_id);
trans->Append(stmt);
@@ -1313,10 +1317,10 @@ void Guild::HandleRoster(WorldSession* session)
data << m_info;
data << uint32(_GetRanksSize());
- for (Ranks::const_iterator ritr = m_ranks.begin(); ritr != m_ranks.end(); ++ritr)
+ for (auto ritr = m_ranks.begin(); ritr != m_ranks.end(); ++ritr)
ritr->WritePacket(data);
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
itr->second->WritePacket(data, _HasRankRight(session->GetPlayer(), GR_RIGHT_VIEWOFFNOTE));
TC_LOG_DEBUG("guild", "SMSG_GUILD_ROSTER [%s]", session->GetPlayerInfo().c_str());
@@ -1420,7 +1424,9 @@ void Guild::HandleSetLeader(WorldSession* session, std::string const& name)
if (Member* pNewLeader = GetMember(name))
{
_SetLeaderGUID(pNewLeader);
- pOldLeader->ChangeRank(GR_OFFICER);
+
+ SQLTransaction trans(nullptr);
+ pOldLeader->ChangeRank(trans, GR_OFFICER);
_BroadcastEvent(GE_LEADER_CHANGED, ObjectGuid::Empty, player->GetName().c_str(), name.c_str());
}
}
@@ -1436,11 +1442,8 @@ void Guild::HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string
return;
}
- char aux[2];
- sprintf(aux, "%u", tabId);
-
tab->SetInfo(name, icon);
- _BroadcastEvent(GE_BANK_TAB_UPDATED, ObjectGuid::Empty, aux, name.c_str(), icon.c_str());
+ _BroadcastEvent(GE_BANK_TAB_UPDATED, ObjectGuid::Empty, std::to_string(tabId).c_str(), name.c_str(), icon.c_str());
}
void Guild::HandleSetMemberNote(WorldSession* session, std::string const& name, std::string const& note, bool officer)
@@ -1472,12 +1475,10 @@ void Guild::HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string c
rankInfo->SetRights(rights);
_SetRankBankMoneyPerDay(rankId, moneyPerDay);
- for (GuildBankRightsAndSlotsVec::const_iterator itr = rightsAndSlots.begin(); itr != rightsAndSlots.end(); ++itr)
+ for (auto itr = rightsAndSlots.begin(); itr != rightsAndSlots.end(); ++itr)
_SetRankBankTabRightsAndSlots(rankId, *itr);
- char aux[2];
- sprintf(aux, "%u", rankId);
- _BroadcastEvent(GE_RANK_UPDATED, ObjectGuid::Empty, aux, name.c_str());
+ _BroadcastEvent(GE_RANK_UPDATED, ObjectGuid::Empty, std::to_string(rankId).c_str(), name.c_str());
}
}
@@ -1497,10 +1498,10 @@ void Guild::HandleBuyBankTab(WorldSession* session, uint8 tabId)
if (tabId != _GetPurchasedTabsSize())
return;
- uint32 tabCost = _GetGuildBankTabPrice(tabId) * GOLD;
- if (!tabCost)
+ if (tabId >= GUILD_BANK_MAX_TABS)
return;
+ uint32 tabCost = GetGuildBankTabPrice(tabId) * GOLD;
if (!player->HasEnoughMoney(tabCost)) // Should not happen, this is checked by client
return;
@@ -1570,7 +1571,8 @@ void Guild::HandleAcceptMember(WorldSession* session)
player->GetTeam() != sObjectMgr->GetPlayerTeamByGUID(GetLeaderGUID()))
return;
- AddMember(player->GetGUID());
+ SQLTransaction trans(nullptr);
+ AddMember(trans, player->GetGUID());
}
void Guild::HandleLeaveMember(WorldSession* session)
@@ -1593,7 +1595,8 @@ void Guild::HandleLeaveMember(WorldSession* session)
}
else
{
- DeleteMember(player->GetGUID(), false, false);
+ SQLTransaction trans(nullptr);
+ DeleteMember(trans, player->GetGUID(), false, false);
_LogEvent(GUILD_EVENT_LOG_LEAVE_GUILD, player->GetGUID().GetCounter());
_BroadcastEvent(GE_LEFT, player->GetGUID(), player->GetName().c_str());
@@ -1627,8 +1630,10 @@ void Guild::HandleRemoveMember(WorldSession* session, std::string const& name)
else
{
ObjectGuid guid = member->GetGUID();
+
// After call to DeleteMember pointer to member becomes invalid
- DeleteMember(guid, false, true);
+ SQLTransaction trans(nullptr);
+ DeleteMember(trans, guid, false, true);
_LogEvent(GUILD_EVENT_LOG_UNINVITE_PLAYER, player->GetGUID().GetCounter(), guid.GetCounter());
_BroadcastEvent(GE_REMOVED, ObjectGuid::Empty, name.c_str(), player->GetName().c_str());
}
@@ -1682,7 +1687,8 @@ void Guild::HandleUpdateMemberRank(WorldSession* session, std::string const& nam
}
uint32 newRankId = member->GetRankId() + (demote ? 1 : -1);
- member->ChangeRank(newRankId);
+ SQLTransaction trans(nullptr);
+ member->ChangeRank(trans, newRankId);
_LogEvent(demote ? GUILD_EVENT_LOG_DEMOTE_PLAYER : GUILD_EVENT_LOG_PROMOTE_PLAYER, player->GetGUID().GetCounter(), member->GetGUID().GetCounter(), newRankId);
_BroadcastEvent(demote ? GE_DEMOTION : GE_PROMOTION, ObjectGuid::Empty, player->GetName().c_str(), name.c_str(), _GetRankName(newRankId).c_str());
}
@@ -1696,12 +1702,11 @@ void Guild::HandleAddNewRank(WorldSession* session, std::string const& name)
// Only leader can add new rank
if (_IsLeader(session->GetPlayer()))
- if (_CreateRank(name, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK))
- {
- char aux[2];
- sprintf(aux, "%u", size);
- _BroadcastEvent(GE_RANK_UPDATED, ObjectGuid::Empty, aux, name.c_str());
- }
+ {
+ SQLTransaction trans(nullptr);
+ if (_CreateRank(trans, name, GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK))
+ _BroadcastEvent(GE_RANK_UPDATED, ObjectGuid::Empty, std::to_string(size).c_str(), name.c_str());
+ }
}
void Guild::HandleRemoveLowestRank(WorldSession* session)
@@ -1973,10 +1978,11 @@ void Guild::LoadRankFromDB(Field* fields)
bool Guild::LoadMemberFromDB(Field* fields)
{
ObjectGuid::LowType lowguid = fields[1].GetUInt32();
- Member *member = new Member(m_id, ObjectGuid(HighGuid::Player, lowguid), fields[2].GetUInt8());
+ Member* member = new Member(m_id, ObjectGuid(HighGuid::Player, lowguid), fields[2].GetUInt8());
if (!member->LoadFromDB(fields))
{
- _DeleteMemberFromDB(lowguid);
+ SQLTransaction trans(nullptr);
+ _DeleteMemberFromDB(trans, lowguid);
delete member;
return false;
}
@@ -2080,6 +2086,8 @@ bool Guild::Validate()
// Min ranks count is 5 and max is 10.
bool broken_ranks = false;
uint8 ranks = _GetRanksSize();
+
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
if (ranks < GUILD_RANKS_MIN_COUNT || ranks > GUILD_RANKS_MAX_COUNT)
{
TC_LOG_ERROR("guild", "Guild %u has invalid number of ranks, creating new...", m_id);
@@ -2096,24 +2104,20 @@ bool Guild::Validate()
broken_ranks = true;
}
else
- {
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
rankInfo->CreateMissingTabsIfNeeded(_GetPurchasedTabsSize(), trans, true);
- CharacterDatabase.CommitTransaction(trans);
- }
}
}
if (broken_ranks)
{
m_ranks.clear();
- _CreateDefaultGuildRanks(DEFAULT_LOCALE);
+ _CreateDefaultGuildRanks(trans, DEFAULT_LOCALE);
}
// Validate members' data
- for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->GetRankId() > _GetRanksSize())
- itr->second->ChangeRank(_GetLowestRankId());
+ itr->second->ChangeRank(trans, _GetLowestRankId());
// Repair the structure of the guild.
// If the guildmaster doesn't exist or isn't member of the guild
@@ -2121,7 +2125,8 @@ bool Guild::Validate()
Member* pLeader = GetMember(m_leaderGuid);
if (!pLeader)
{
- DeleteMember(m_leaderGuid);
+ SQLTransaction trans(nullptr);
+ DeleteMember(trans, m_leaderGuid);
// If no more members left, disband guild
if (m_members.empty())
{
@@ -2134,10 +2139,12 @@ bool Guild::Validate()
// Check config if multiple guildmasters are allowed
if (!sConfigMgr->GetBoolDefault("Guild.AllowMultipleGuildMaster", 0))
- for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->GetRankId() == GR_GUILDMASTER && !itr->second->IsSamePlayer(m_leaderGuid))
- itr->second->ChangeRank(GR_OFFICER);
+ itr->second->ChangeRank(trans, GR_OFFICER);
+ if (trans->GetSize() > 0)
+ CharacterDatabase.CommitTransaction(trans);
_UpdateAccountsNumber();
return true;
}
@@ -2148,8 +2155,8 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
if (session && session->GetPlayer() && _HasRankRight(session->GetPlayer(), officerOnly ? GR_RIGHT_OFFCHATSPEAK : GR_RIGHT_GCHATSPEAK))
{
WorldPacket data;
- ChatHandler::BuildChatPacket(data, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, Language(language), session->GetPlayer(), NULL, msg);
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ ChatHandler::BuildChatPacket(data, officerOnly ? CHAT_MSG_OFFICER : CHAT_MSG_GUILD, Language(language), session->GetPlayer(), nullptr, msg);
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player* player = itr->second->FindConnectedPlayer())
if (player->GetSession() && _HasRankRight(player, officerOnly ? GR_RIGHT_OFFCHATLISTEN : GR_RIGHT_GCHATLISTEN) &&
!player->GetSocial()->HasIgnore(session->GetPlayer()->GetGUID().GetCounter()))
@@ -2159,7 +2166,7 @@ void Guild::BroadcastToGuild(WorldSession* session, bool officerOnly, std::strin
void Guild::BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const
{
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (itr->second->IsRank(rankId))
if (Player* player = itr->second->FindConnectedPlayer())
player->GetSession()->SendPacket(packet);
@@ -2167,7 +2174,7 @@ void Guild::BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const
void Guild::BroadcastPacket(WorldPacket* packet) const
{
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
if (Player* player = itr->second->FindPlayer())
player->GetSession()->SendPacket(packet);
}
@@ -2179,7 +2186,7 @@ void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 max
WorldPacket data(SMSG_CALENDAR_FILTER_GUILD);
data << uint32(count); // count placeholder
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
{
// not sure if needed, maybe client checks it as well
if (count >= CALENDAR_MAX_INVITES)
@@ -2206,7 +2213,7 @@ void Guild::MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 max
}
// Members handling
-bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
+bool Guild::AddMember(SQLTransaction& trans, ObjectGuid guid, uint8 rankId)
{
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
// Player cannot be in guild
@@ -2269,7 +2276,6 @@ bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
m_members[lowguid] = member;
}
- SQLTransaction trans(NULL);
member->SaveToDB(trans);
_UpdateAccountsNumber();
@@ -2282,7 +2288,7 @@ bool Guild::AddMember(ObjectGuid guid, uint8 rankId)
return true;
}
-void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool canDeleteGuild)
+void Guild::DeleteMember(SQLTransaction& trans, ObjectGuid guid, bool isDisbanding, bool isKicked, bool canDeleteGuild)
{
ObjectGuid::LowType lowguid = guid.GetCounter();
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
@@ -2291,9 +2297,9 @@ void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool
// or when he is removed from guild by gm command
if (m_leaderGuid == guid && !isDisbanding)
{
- Member* oldLeader = NULL;
- Member* newLeader = NULL;
- for (Guild::Members::iterator i = m_members.begin(); i != m_members.end(); ++i)
+ Member* oldLeader = nullptr;
+ Member* newLeader = nullptr;
+ for (auto i = m_members.begin(); i != m_members.end(); ++i)
{
if (i->first == lowguid)
oldLeader = i->second;
@@ -2336,19 +2342,22 @@ void Guild::DeleteMember(ObjectGuid guid, bool isDisbanding, bool isKicked, bool
player->SetRank(0);
}
- _DeleteMemberFromDB(lowguid);
+ _DeleteMemberFromDB(trans, lowguid);
if (!isDisbanding)
_UpdateAccountsNumber();
}
-bool Guild::ChangeMemberRank(ObjectGuid guid, uint8 newRank)
+bool Guild::ChangeMemberRank(SQLTransaction& trans, ObjectGuid guid, uint8 newRank)
{
if (newRank <= _GetLowestRankId()) // Validate rank (allow only existing ranks)
+ {
if (Member* member = GetMember(guid))
{
- member->ChangeRank(newRank);
+ member->ChangeRank(trans, newRank);
return true;
}
+ }
+
return false;
}
@@ -2386,7 +2395,7 @@ void Guild::SetBankTabText(uint8 tabId, std::string const& text)
if (BankTab* pTab = GetBankTab(tabId))
{
pTab->SetText(text);
- pTab->SendText(this, NULL);
+ pTab->SendText(this, nullptr);
}
}
@@ -2416,30 +2425,32 @@ void Guild::_CreateNewBankTab()
trans->Append(stmt);
++tabId;
- for (Ranks::iterator itr = m_ranks.begin(); itr != m_ranks.end(); ++itr)
+ for (auto itr = m_ranks.begin(); itr != m_ranks.end(); ++itr)
(*itr).CreateMissingTabsIfNeeded(tabId, trans, false);
CharacterDatabase.CommitTransaction(trans);
}
-void Guild::_CreateDefaultGuildRanks(LocaleConstant loc)
+void Guild::_CreateDefaultGuildRanks(SQLTransaction& trans, LocaleConstant loc)
{
+ ASSERT(trans);
+
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_RANKS);
stmt->setUInt32(0, m_id);
- CharacterDatabase.Execute(stmt);
+ trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_BANK_RIGHTS);
stmt->setUInt32(0, m_id);
- CharacterDatabase.Execute(stmt);
+ trans->Append(stmt);
- _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_MASTER, loc), GR_RIGHT_ALL);
- _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_OFFICER, loc), GR_RIGHT_ALL);
- _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_VETERAN, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
- _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_MEMBER, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
- _CreateRank(sObjectMgr->GetTrinityString(LANG_GUILD_INITIATE, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
+ _CreateRank(trans, sObjectMgr->GetTrinityString(LANG_GUILD_MASTER, loc), GR_RIGHT_ALL);
+ _CreateRank(trans, sObjectMgr->GetTrinityString(LANG_GUILD_OFFICER, loc), GR_RIGHT_ALL);
+ _CreateRank(trans, sObjectMgr->GetTrinityString(LANG_GUILD_VETERAN, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
+ _CreateRank(trans, sObjectMgr->GetTrinityString(LANG_GUILD_MEMBER, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
+ _CreateRank(trans, sObjectMgr->GetTrinityString(LANG_GUILD_INITIATE, loc), GR_RIGHT_GCHATLISTEN | GR_RIGHT_GCHATSPEAK);
}
-bool Guild::_CreateRank(std::string const& name, uint32 rights)
+bool Guild::_CreateRank(SQLTransaction& trans, std::string const& name, uint32 rights)
{
uint8 newRankId = _GetRanksSize();
if (newRankId >= GUILD_RANKS_MAX_COUNT)
@@ -2449,10 +2460,15 @@ bool Guild::_CreateRank(std::string const& name, uint32 rights)
RankInfo info(m_id, newRankId, name, rights, 0);
m_ranks.push_back(info);
- SQLTransaction trans = CharacterDatabase.BeginTransaction();
+ bool const isInTransaction = bool(trans);
+ if (!isInTransaction)
+ trans = CharacterDatabase.BeginTransaction();
+
info.CreateMissingTabsIfNeeded(_GetPurchasedTabsSize(), trans);
info.SaveToDB(trans);
- CharacterDatabase.CommitTransaction(trans);
+
+ if (!isInTransaction)
+ CharacterDatabase.CommitTransaction(trans);
return true;
}
@@ -2463,7 +2479,7 @@ void Guild::_UpdateAccountsNumber()
{
// We use a set to be sure each element will be unique
std::set<uint32> accountsIdSet;
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
accountsIdSet.insert(itr->second->GetAccountId());
m_accountsNumber = accountsIdSet.size();
@@ -2487,7 +2503,7 @@ void Guild::_DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB)
{
m_bankTabs[tabId]->Delete(trans, removeItemsFromDB);
delete m_bankTabs[tabId];
- m_bankTabs[tabId] = NULL;
+ m_bankTabs[tabId] = nullptr;
}
m_bankTabs.clear();
}
@@ -2516,13 +2532,16 @@ void Guild::_SetLeaderGUID(Member* pLeader)
if (!pLeader)
return;
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
m_leaderGuid = pLeader->GetGUID();
- pLeader->ChangeRank(GR_GUILDMASTER);
+ pLeader->ChangeRank(trans, GR_GUILDMASTER);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GUILD_LEADER);
stmt->setUInt32(0, m_leaderGuid.GetCounter());
stmt->setUInt32(1, m_id);
- CharacterDatabase.Execute(stmt);
+ trans->Append(stmt);
+
+ CharacterDatabase.CommitTransaction(trans);
}
void Guild::_SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay)
@@ -2670,13 +2689,13 @@ inline Item* Guild::_GetItem(uint8 tabId, uint8 slotId) const
{
if (const BankTab* tab = GetBankTab(tabId))
return tab->GetItem(slotId);
- return NULL;
+ return nullptr;
}
inline void Guild::_RemoveItem(SQLTransaction& trans, uint8 tabId, uint8 slotId)
{
if (BankTab* pTab = GetBankTab(tabId))
- pTab->SetItem(trans, slotId, NULL);
+ pTab->SetItem(trans, slotId, nullptr);
}
void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAmount)
@@ -2717,7 +2736,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
}
else // 6. No split
{
- // 6.1. Try to merge items in destination (pDest->GetItem() == NULL)
+ // 6.1. Try to merge items in destination (pDest->GetItem() == nullptr)
if (!_DoItemsMove(pSrc, pDest, false)) // Item could not be merged
{
// 6.2. Try to swap items
@@ -2732,7 +2751,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
if (!pDest->HasWithdrawRights(pSrc))
return; // Player has no rights to withdraw item from destination (opposite direction)
- // 6.2.3. Swap items (pDest->GetItem() != NULL)
+ // 6.2.3. Swap items (pDest->GetItem() != nullptr)
_DoItemsMove(pSrc, pDest, true);
}
}
@@ -2743,7 +2762,7 @@ void Guild::_MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAm
bool Guild::_DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError, uint32 splitedAmount)
{
Item* pDestItem = pDest->GetItem();
- bool swap = (pDestItem != NULL);
+ bool swap = (pDestItem != nullptr);
Item* pSrcItem = pSrc->GetItem(splitedAmount != 0);
// 1. Can store source item in destination
@@ -2832,7 +2851,7 @@ void Guild::_SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) cons
void Guild::_SendBankContentUpdate(uint8 tabId, SlotIds slots) const
{
- _SendBankList(NULL, tabId, false, &slots);
+ _SendBankList(nullptr, tabId, false, &slots);
}
void Guild::_BroadcastEvent(GuildEvents guildEvent, ObjectGuid guid, const char* param1, const char* param2, const char* param3) const
@@ -2855,10 +2874,10 @@ void Guild::_BroadcastEvent(GuildEvents guildEvent, ObjectGuid guid, const char*
BroadcastPacket(&data);
- TC_LOG_DEBUG("guild", "SMSG_GUILD_EVENT [Broadcast] Event: %s (%u)", _GetGuildEventString(guildEvent).c_str(), guildEvent);
+ TC_LOG_DEBUG("guild", "SMSG_GUILD_EVENT [Broadcast] Event: %s (%u)", GetGuildEventString(guildEvent), guildEvent);
}
-void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/, bool sendAllSlots /*= false*/, SlotIds *slots /*= NULL*/) const
+void Guild::_SendBankList(WorldSession* session /* = nullptr*/, uint8 tabId /*= 0*/, bool sendAllSlots /*= false*/, SlotIds *slots /*= nullptr*/) const
{
WorldPacket data(SMSG_GUILD_BANK_LIST, 500);
data << uint64(m_bankMoney);
@@ -2882,7 +2901,7 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/
else if (slots && !slots->empty())
{
data << uint8(slots->size());
- for (SlotIds::const_iterator itr = slots->begin(); itr != slots->end(); ++itr)
+ for (auto itr = slots->begin(); itr != slots->end(); ++itr)
tab->WriteSlotPacket(data, *itr, false);
}
else
@@ -2900,7 +2919,7 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/
}
else /// @todo - Probably this is just sent to session + those that have sent CMSG_GUILD_BANKER_ACTIVATE
{
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
{
if (!_MemberHasTabRights(itr->second->GetGUID(), tabId, GUILD_BANK_RIGHT_VIEW_TAB))
continue;
@@ -2919,7 +2938,7 @@ void Guild::_SendBankList(WorldSession* session /* = NULL*/, uint8 tabId /*= 0*/
void Guild::ResetTimes()
{
- for (Members::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
itr->second->ResetValues();
_BroadcastEvent(GE_BANK_TAB_AND_MONEY_UPDATED, ObjectGuid::Empty);
diff --git a/src/server/game/Guilds/Guild.h b/src/server/game/Guilds/Guild.h
index e25a3201957..742923f51a1 100644
--- a/src/server/game/Guilds/Guild.h
+++ b/src/server/game/Guilds/Guild.h
@@ -225,54 +225,54 @@ enum GuildMemberFlags
// Emblem info
class TC_GAME_API EmblemInfo
{
-public:
- EmblemInfo() : m_style(0), m_color(0), m_borderStyle(0), m_borderColor(0), m_backgroundColor(0) { }
-
- void LoadFromDB(Field* fields);
- void SaveToDB(ObjectGuid::LowType guildId) const;
- void ReadPacket(WorldPacket& recv);
- void WritePacket(WorldPacket& data) const;
-
- uint32 GetStyle() const { return m_style; }
- uint32 GetColor() const { return m_color; }
- uint32 GetBorderStyle() const { return m_borderStyle; }
- uint32 GetBorderColor() const { return m_borderColor; }
- uint32 GetBackgroundColor() const { return m_backgroundColor; }
-
-private:
- uint32 m_style;
- uint32 m_color;
- uint32 m_borderStyle;
- uint32 m_borderColor;
- uint32 m_backgroundColor;
+ public:
+ EmblemInfo() : m_style(0), m_color(0), m_borderStyle(0), m_borderColor(0), m_backgroundColor(0) { }
+
+ void LoadFromDB(Field* fields);
+ void SaveToDB(ObjectGuid::LowType guildId) const;
+ void ReadPacket(WorldPacket& recv);
+ void WritePacket(WorldPacket& data) const;
+
+ uint32 GetStyle() const { return m_style; }
+ uint32 GetColor() const { return m_color; }
+ uint32 GetBorderStyle() const { return m_borderStyle; }
+ uint32 GetBorderColor() const { return m_borderColor; }
+ uint32 GetBackgroundColor() const { return m_backgroundColor; }
+
+ private:
+ uint32 m_style;
+ uint32 m_color;
+ uint32 m_borderStyle;
+ uint32 m_borderColor;
+ uint32 m_backgroundColor;
};
// Structure for storing guild bank rights and remaining slots together.
class GuildBankRightsAndSlots
{
-public:
- GuildBankRightsAndSlots() : tabId(TAB_UNDEFINED), rights(0), slots(0) { }
- GuildBankRightsAndSlots(uint8 _tabId) : tabId(_tabId), rights(0), slots(0) { }
- GuildBankRightsAndSlots(uint8 _tabId, uint8 _rights, uint32 _slots) : tabId(_tabId), rights(_rights), slots(_slots) { }
-
- void SetGuildMasterValues()
- {
- rights = GUILD_BANK_RIGHT_FULL;
- slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED);
- }
-
- void SetTabId(uint8 _tabId) { tabId = _tabId; }
- void SetSlots(uint32 _slots) { slots = _slots; }
- void SetRights(uint8 _rights) { rights = _rights; }
-
- int8 GetTabId() const { return tabId; }
- int32 GetSlots() const { return slots; }
- int8 GetRights() const { return rights; }
-
-private:
- uint8 tabId;
- uint8 rights;
- uint32 slots;
+ public:
+ GuildBankRightsAndSlots() : tabId(TAB_UNDEFINED), rights(0), slots(0) { }
+ GuildBankRightsAndSlots(uint8 _tabId) : tabId(_tabId), rights(0), slots(0) { }
+ GuildBankRightsAndSlots(uint8 _tabId, uint8 _rights, uint32 _slots) : tabId(_tabId), rights(_rights), slots(_slots) { }
+
+ void SetGuildMasterValues()
+ {
+ rights = GUILD_BANK_RIGHT_FULL;
+ slots = uint32(GUILD_WITHDRAW_SLOT_UNLIMITED);
+ }
+
+ void SetTabId(uint8 _tabId) { tabId = _tabId; }
+ void SetSlots(uint32 _slots) { slots = _slots; }
+ void SetRights(uint8 _rights) { rights = _rights; }
+
+ int8 GetTabId() const { return tabId; }
+ int32 GetSlots() const { return slots; }
+ int8 GetRights() const { return rights; }
+
+ private:
+ uint8 tabId;
+ uint8 rights;
+ uint32 slots;
};
typedef std::vector <GuildBankRightsAndSlots> GuildBankRightsAndSlotsVec;
@@ -281,577 +281,577 @@ typedef std::set <uint8> SlotIds;
class TC_GAME_API Guild
{
-private:
- // Class representing guild member
- class Member
- {
- public:
- Member(ObjectGuid::LowType guildId, ObjectGuid guid, uint8 rankId) :
- m_guildId(guildId),
- m_guid(guid),
- m_zoneId(0),
- m_level(0),
- m_class(0),
- m_flags(GUILDMEMBER_STATUS_NONE),
- m_logoutTime(::time(NULL)),
- m_accountId(0),
- m_rankId(rankId)
+ private:
+ // Class representing guild member
+ class Member
{
- memset(m_bankWithdraw, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(int32));
- }
-
- void SetStats(Player* player);
- void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId);
- bool CheckStats() const;
+ public:
+ Member(ObjectGuid::LowType guildId, ObjectGuid guid, uint8 rankId) :
+ m_guildId(guildId),
+ m_guid(guid),
+ m_zoneId(0),
+ m_level(0),
+ m_class(0),
+ m_flags(GUILDMEMBER_STATUS_NONE),
+ m_logoutTime(::time(nullptr)),
+ m_accountId(0),
+ m_rankId(rankId)
+ {
+ memset(m_bankWithdraw, 0, (GUILD_BANK_MAX_TABS + 1) * sizeof(int32));
+ }
+
+ void SetStats(Player* player);
+ void SetStats(std::string const& name, uint8 level, uint8 _class, uint32 zoneId, uint32 accountId);
+ bool CheckStats() const;
+
+ void SetPublicNote(std::string const& publicNote);
+ void SetOfficerNote(std::string const& officerNote);
+ void SetZoneID(uint32 id) { m_zoneId = id; }
+ void SetLevel(uint8 var) { m_level = var; }
+
+ void AddFlag(uint8 var) { m_flags |= var; }
+ void RemFlag(uint8 var) { m_flags &= ~var; }
+ void ResetFlags() { m_flags = GUILDMEMBER_STATUS_NONE; }
+
+ bool LoadFromDB(Field* fields);
+ void SaveToDB(SQLTransaction& trans) const;
+ void WritePacket(WorldPacket& data, bool sendOfficerNote) const;
+
+ ObjectGuid GetGUID() const { return m_guid; }
+ std::string const& GetName() const { return m_name; }
+ uint32 GetAccountId() const { return m_accountId; }
+ uint8 GetRankId() const { return m_rankId; }
+ uint64 GetLogoutTime() const { return m_logoutTime; }
+ std::string GetPublicNote() const { return m_publicNote; }
+ std::string GetOfficerNote() const { return m_officerNote; }
+ uint8 GetClass() const { return m_class; }
+ uint8 GetLevel() const { return m_level; }
+ uint8 GetFlags() const { return m_flags; }
+ uint32 GetZoneId() const { return m_zoneId; }
+ bool IsOnline() const { return (m_flags & GUILDMEMBER_STATUS_ONLINE); }
+
+ void ChangeRank(SQLTransaction& trans, uint8 newRank);
+
+ inline void UpdateLogoutTime() { m_logoutTime = ::time(nullptr); }
+ inline bool IsRank(uint8 rankId) const { return m_rankId == rankId; }
+ inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
+ inline bool IsSamePlayer(ObjectGuid guid) const { return m_guid == guid; }
+
+ void UpdateBankWithdrawValue(SQLTransaction& trans, uint8 tabId, uint32 amount);
+ int32 GetBankWithdrawValue(uint8 tabId) const;
+ void ResetValues();
+
+ inline Player* FindPlayer() const { return ObjectAccessor::FindPlayer(m_guid); }
+ inline Player* FindConnectedPlayer() const { return ObjectAccessor::FindConnectedPlayer(m_guid); }
+
+ private:
+ ObjectGuid::LowType m_guildId;
+ // Fields from characters table
+ ObjectGuid m_guid;
+ std::string m_name;
+ uint32 m_zoneId;
+ uint8 m_level;
+ uint8 m_class;
+ uint8 m_flags;
+ uint64 m_logoutTime;
+ uint32 m_accountId;
+ // Fields from guild_member table
+ uint8 m_rankId;
+ std::string m_publicNote;
+ std::string m_officerNote;
+
+ int32 m_bankWithdraw[GUILD_BANK_MAX_TABS + 1];
+ };
+
+ // Base class for event entries
+ class LogEntry
+ {
+ public:
+ LogEntry(ObjectGuid::LowType guildId, uint32 guid) : m_guildId(guildId), m_guid(guid), m_timestamp(::time(nullptr)) { }
+ LogEntry(ObjectGuid::LowType guildId, uint32 guid, time_t timestamp) : m_guildId(guildId), m_guid(guid), m_timestamp(timestamp) { }
+ virtual ~LogEntry() { }
- void SetPublicNote(std::string const& publicNote);
- void SetOfficerNote(std::string const& officerNote);
- void SetZoneID(uint32 id) { m_zoneId = id; }
- void SetLevel(uint8 var) { m_level = var; }
+ uint32 GetGUID() const { return m_guid; }
+ uint64 GetTimestamp() const { return m_timestamp; }
- void AddFlag(uint8 var) { m_flags |= var; }
- void RemFlag(uint8 var) { m_flags &= ~var; }
- void ResetFlags() { m_flags = GUILDMEMBER_STATUS_NONE; }
+ virtual void SaveToDB(SQLTransaction& trans) const = 0;
+ virtual void WritePacket(WorldPacket& data) const = 0;
- bool LoadFromDB(Field* fields);
- void SaveToDB(SQLTransaction& trans) const;
- void WritePacket(WorldPacket& data, bool sendOfficerNote) const;
+ protected:
+ ObjectGuid::LowType m_guildId;
+ uint32 m_guid;
+ uint64 m_timestamp;
+ };
- ObjectGuid GetGUID() const { return m_guid; }
- std::string const& GetName() const { return m_name; }
- uint32 GetAccountId() const { return m_accountId; }
- uint8 GetRankId() const { return m_rankId; }
- uint64 GetLogoutTime() const { return m_logoutTime; }
- std::string GetPublicNote() const { return m_publicNote; }
- std::string GetOfficerNote() const { return m_officerNote; }
- uint8 GetClass() const { return m_class; }
- uint8 GetLevel() const { return m_level; }
- uint8 GetFlags() const { return m_flags; }
- uint32 GetZoneId() const { return m_zoneId; }
- bool IsOnline() const { return (m_flags & GUILDMEMBER_STATUS_ONLINE); }
-
- void ChangeRank(uint8 newRank);
-
- inline void UpdateLogoutTime() { m_logoutTime = ::time(NULL); }
- inline bool IsRank(uint8 rankId) const { return m_rankId == rankId; }
- inline bool IsRankNotLower(uint8 rankId) const { return m_rankId <= rankId; }
- inline bool IsSamePlayer(ObjectGuid guid) const { return m_guid == guid; }
-
- void UpdateBankWithdrawValue(SQLTransaction& trans, uint8 tabId, uint32 amount);
- int32 GetBankWithdrawValue(uint8 tabId) const;
- void ResetValues();
-
- inline Player* FindPlayer() const { return ObjectAccessor::FindPlayer(m_guid); }
- inline Player* FindConnectedPlayer() const { return ObjectAccessor::FindConnectedPlayer(m_guid); }
+ // Event log entry
+ class EventLogEntry : public LogEntry
+ {
+ public:
+ EventLogEntry(ObjectGuid::LowType guildId, uint32 guid, GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank) :
+ LogEntry(guildId, guid), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
- private:
- ObjectGuid::LowType m_guildId;
- // Fields from characters table
- ObjectGuid m_guid;
- std::string m_name;
- uint32 m_zoneId;
- uint8 m_level;
- uint8 m_class;
- uint8 m_flags;
- uint64 m_logoutTime;
- uint32 m_accountId;
- // Fields from guild_member table
- uint8 m_rankId;
- std::string m_publicNote;
- std::string m_officerNote;
-
- int32 m_bankWithdraw[GUILD_BANK_MAX_TABS + 1];
- };
-
- // Base class for event entries
- class LogEntry
- {
- public:
- LogEntry(ObjectGuid::LowType guildId, uint32 guid) : m_guildId(guildId), m_guid(guid), m_timestamp(::time(NULL)) { }
- LogEntry(ObjectGuid::LowType guildId, uint32 guid, time_t timestamp) : m_guildId(guildId), m_guid(guid), m_timestamp(timestamp) { }
- virtual ~LogEntry() { }
+ EventLogEntry(ObjectGuid::LowType guildId, uint32 guid, time_t timestamp, GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank) :
+ LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
- uint32 GetGUID() const { return m_guid; }
- uint64 GetTimestamp() const { return m_timestamp; }
+ ~EventLogEntry() { }
- virtual void SaveToDB(SQLTransaction& trans) const = 0;
- virtual void WritePacket(WorldPacket& data) const = 0;
+ void SaveToDB(SQLTransaction& trans) const override;
+ void WritePacket(WorldPacket& data) const override;
- protected:
- ObjectGuid::LowType m_guildId;
- uint32 m_guid;
- uint64 m_timestamp;
- };
-
- // Event log entry
- class EventLogEntry : public LogEntry
- {
- public:
- EventLogEntry(ObjectGuid::LowType guildId, uint32 guid, GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank) :
- LogEntry(guildId, guid), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
+ private:
+ GuildEventLogTypes m_eventType;
+ ObjectGuid::LowType m_playerGuid1;
+ ObjectGuid::LowType m_playerGuid2;
+ uint8 m_newRank;
+ };
- EventLogEntry(ObjectGuid::LowType guildId, uint32 guid, time_t timestamp, GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2, uint8 newRank) :
- LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_playerGuid1(playerGuid1), m_playerGuid2(playerGuid2), m_newRank(newRank) { }
+ // Bank event log entry
+ class BankEventLogEntry : public LogEntry
+ {
+ public:
+ static bool IsMoneyEvent(GuildBankEventLogTypes eventType)
+ {
+ return
+ eventType == GUILD_BANK_LOG_DEPOSIT_MONEY ||
+ eventType == GUILD_BANK_LOG_WITHDRAW_MONEY ||
+ eventType == GUILD_BANK_LOG_REPAIR_MONEY;
+ }
+
+ BankEventLogEntry(ObjectGuid::LowType guildId, uint32 guid, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid::LowType playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) :
+ LogEntry(guildId, guid), m_eventType(eventType), m_bankTabId(tabId), m_playerGuid(playerGuid),
+ m_itemOrMoney(itemOrMoney), m_itemStackCount(itemStackCount), m_destTabId(destTabId) { }
+
+ BankEventLogEntry(ObjectGuid::LowType guildId, uint32 guid, time_t timestamp, uint8 tabId, GuildBankEventLogTypes eventType, ObjectGuid::LowType playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) :
+ LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_bankTabId(tabId), m_playerGuid(playerGuid),
+ m_itemOrMoney(itemOrMoney), m_itemStackCount(itemStackCount), m_destTabId(destTabId) { }
+
+ ~BankEventLogEntry() { }
+
+ void SaveToDB(SQLTransaction& trans) const override;
+ void WritePacket(WorldPacket& data) const override;
+
+ private:
+ GuildBankEventLogTypes m_eventType;
+ uint8 m_bankTabId;
+ ObjectGuid::LowType m_playerGuid;
+ uint32 m_itemOrMoney;
+ uint16 m_itemStackCount;
+ uint8 m_destTabId;
+ };
+
+ // Class encapsulating work with events collection
+ typedef std::list<LogEntry*> GuildLog;
+
+ class LogHolder
+ {
+ public:
+ LogHolder(uint32 maxRecords) : m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { }
+ ~LogHolder();
+
+ uint8 GetSize() const { return uint8(m_log.size()); }
+ // Checks if new log entry can be added to holder when loading from DB
+ inline bool CanInsert() const { return m_log.size() < m_maxRecords; }
+ // Adds event from DB to collection
+ void LoadEvent(LogEntry* entry);
+ // Adds new event to collection and saves it to DB
+ void AddEvent(SQLTransaction& trans, LogEntry* entry);
+ // Writes information about all events to packet
+ void WritePacket(WorldPacket& data) const;
+ uint32 GetNextGUID();
+
+ private:
+ GuildLog m_log;
+ uint32 m_maxRecords;
+ uint32 m_nextGUID;
+ };
+
+ // Class encapsulating guild rank data
+ class RankInfo
+ {
+ public:
+ RankInfo(): m_guildId(0), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
+ RankInfo(ObjectGuid::LowType guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
+ RankInfo(ObjectGuid::LowType guildId, uint8 rankId, std::string const& name, uint32 rights, uint32 money) :
+ m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights),
+ m_bankMoneyPerDay(rankId != GR_GUILDMASTER ? money : GUILD_WITHDRAW_MONEY_UNLIMITED) { }
- ~EventLogEntry() { }
+ void LoadFromDB(Field* fields);
+ void SaveToDB(SQLTransaction& trans) const;
+ void WritePacket(WorldPacket& data) const;
- void SaveToDB(SQLTransaction& trans) const override;
- void WritePacket(WorldPacket& data) const override;
+ uint8 GetId() const { return m_rankId; }
- private:
- GuildEventLogTypes m_eventType;
- ObjectGuid::LowType m_playerGuid1;
- ObjectGuid::LowType m_playerGuid2;
- uint8 m_newRank;
- };
-
- // Bank event log entry
- class BankEventLogEntry : public LogEntry
- {
- public:
- static bool IsMoneyEvent(GuildBankEventLogTypes eventType)
- {
- return
- eventType == GUILD_BANK_LOG_DEPOSIT_MONEY ||
- eventType == GUILD_BANK_LOG_WITHDRAW_MONEY ||
- eventType == GUILD_BANK_LOG_REPAIR_MONEY;
- }
+ std::string const& GetName() const { return m_name; }
+ void SetName(std::string const& name);
- BankEventLogEntry(ObjectGuid::LowType guildId, uint32 guid, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid::LowType playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) :
- LogEntry(guildId, guid), m_eventType(eventType), m_bankTabId(tabId), m_playerGuid(playerGuid),
- m_itemOrMoney(itemOrMoney), m_itemStackCount(itemStackCount), m_destTabId(destTabId) { }
+ uint32 GetRights() const { return m_rights; }
+ void SetRights(uint32 rights);
- BankEventLogEntry(ObjectGuid::LowType guildId, uint32 guid, time_t timestamp, uint8 tabId, GuildBankEventLogTypes eventType, ObjectGuid::LowType playerGuid, uint32 itemOrMoney, uint16 itemStackCount, uint8 destTabId) :
- LogEntry(guildId, guid, timestamp), m_eventType(eventType), m_bankTabId(tabId), m_playerGuid(playerGuid),
- m_itemOrMoney(itemOrMoney), m_itemStackCount(itemStackCount), m_destTabId(destTabId) { }
+ int32 GetBankMoneyPerDay() const { return m_bankMoneyPerDay; }
- ~BankEventLogEntry() { }
+ void SetBankMoneyPerDay(uint32 money);
- void SaveToDB(SQLTransaction& trans) const override;
- void WritePacket(WorldPacket& data) const override;
+ inline int8 GetBankTabRights(uint8 tabId) const
+ {
+ return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].GetRights() : 0;
+ }
- private:
- GuildBankEventLogTypes m_eventType;
- uint8 m_bankTabId;
- ObjectGuid::LowType m_playerGuid;
- uint32 m_itemOrMoney;
- uint16 m_itemStackCount;
- uint8 m_destTabId;
- };
-
- // Class encapsulating work with events collection
- typedef std::list<LogEntry*> GuildLog;
-
- class LogHolder
- {
- public:
- LogHolder(uint32 maxRecords) : m_maxRecords(maxRecords), m_nextGUID(uint32(GUILD_EVENT_LOG_GUID_UNDEFINED)) { }
- ~LogHolder();
-
- uint8 GetSize() const { return uint8(m_log.size()); }
- // Checks if new log entry can be added to holder when loading from DB
- inline bool CanInsert() const { return m_log.size() < m_maxRecords; }
- // Adds event from DB to collection
- void LoadEvent(LogEntry* entry);
- // Adds new event to collection and saves it to DB
- void AddEvent(SQLTransaction& trans, LogEntry* entry);
- // Writes information about all events to packet
- void WritePacket(WorldPacket& data) const;
- uint32 GetNextGUID();
+ inline int32 GetBankTabSlotsPerDay(uint8 tabId) const
+ {
+ return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].GetSlots() : 0;
+ }
- private:
- GuildLog m_log;
- uint32 m_maxRecords;
- uint32 m_nextGUID;
- };
-
- // Class encapsulating guild rank data
- class RankInfo
- {
- public:
- RankInfo(): m_guildId(0), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
- RankInfo(ObjectGuid::LowType guildId) : m_guildId(guildId), m_rankId(GUILD_RANK_NONE), m_rights(GR_RIGHT_EMPTY), m_bankMoneyPerDay(0) { }
- RankInfo(ObjectGuid::LowType guildId, uint8 rankId, std::string const& name, uint32 rights, uint32 money) :
- m_guildId(guildId), m_rankId(rankId), m_name(name), m_rights(rights),
- m_bankMoneyPerDay(rankId != GR_GUILDMASTER ? money : GUILD_WITHDRAW_MONEY_UNLIMITED) { }
+ void SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
+ void CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans, bool logOnCreate = false);
- void LoadFromDB(Field* fields);
- void SaveToDB(SQLTransaction& trans) const;
- void WritePacket(WorldPacket& data) const;
+ private:
+ ObjectGuid::LowType m_guildId;
- uint8 GetId() const { return m_rankId; }
+ uint8 m_rankId;
+ std::string m_name;
+ uint32 m_rights;
+ uint32 m_bankMoneyPerDay;
+ GuildBankRightsAndSlots m_bankTabRightsAndSlots[GUILD_BANK_MAX_TABS];
+ };
- std::string const& GetName() const { return m_name; }
- void SetName(std::string const& name);
+ class BankTab
+ {
+ public:
+ BankTab(ObjectGuid::LowType guildId, uint8 tabId) : m_guildId(guildId), m_tabId(tabId)
+ {
+ memset(m_items, 0, GUILD_BANK_MAX_SLOTS * sizeof(Item*));
+ }
+
+ void LoadFromDB(Field* fields);
+ bool LoadItemFromDB(Field* fields);
+ void Delete(SQLTransaction& trans, bool removeItemsFromDB = false);
+
+ void WritePacket(WorldPacket& data) const;
+ bool WriteSlotPacket(WorldPacket& data, uint8 slotId, bool ignoreEmpty = true) const;
+ void WriteInfoPacket(WorldPacket& data) const
+ {
+ data << m_name;
+ data << m_icon;
+ }
+
+ void SetInfo(std::string const& name, std::string const& icon);
+ void SetText(std::string const& text);
+ void SendText(const Guild* guild, WorldSession* session) const;
+
+ inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; }
+ bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem);
+
+ private:
+ ObjectGuid::LowType m_guildId;
+ uint8 m_tabId;
+
+ Item* m_items[GUILD_BANK_MAX_SLOTS];
+ std::string m_name;
+ std::string m_icon;
+ std::string m_text;
+ };
+
+ // Movement data
+ class MoveItemData
+ {
+ public:
+ MoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) : m_pGuild(guild), m_pPlayer(player),
+ m_container(container), m_slotId(slotId), m_pItem(NULL), m_pClonedItem(NULL) { }
+ virtual ~MoveItemData() { }
+
+ virtual bool IsBank() const = 0;
+ // Initializes item pointer. Returns true, if item exists, false otherwise.
+ virtual bool InitItem() = 0;
+ // Checks splited amount against item. Splited amount cannot be more that number of items in stack.
+ virtual bool CheckItem(uint32& splitedAmount);
+ // Defines if player has rights to save item in container
+ virtual bool HasStoreRights(MoveItemData* /*pOther*/) const { return true; }
+ // Defines if player has rights to withdraw item from container
+ virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; }
+ // Checks if container can store specified item
+ bool CanStore(Item* pItem, bool swap, bool sendError);
+ // Clones stored item
+ bool CloneItem(uint32 count);
+ // Remove item from container (if splited update items fields)
+ virtual void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) = 0;
+ // Saves item to container
+ virtual Item* StoreItem(SQLTransaction& trans, Item* pItem) = 0;
+ // Log bank event
+ virtual void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const = 0;
+ // Log GM action
+ virtual void LogAction(MoveItemData* pFrom) const;
+ // Copy slots id from position vector
+ void CopySlots(SlotIds& ids) const;
+
+ Item* GetItem(bool isCloned = false) const { return isCloned ? m_pClonedItem : m_pItem; }
+ uint8 GetContainer() const { return m_container; }
+ uint8 GetSlotId() const { return m_slotId; }
+
+ protected:
+ virtual InventoryResult CanStore(Item* pItem, bool swap) = 0;
+
+ Guild* m_pGuild;
+ Player* m_pPlayer;
+ uint8 m_container;
+ uint8 m_slotId;
+ Item* m_pItem;
+ Item* m_pClonedItem;
+ ItemPosCountVec m_vec;
+ };
+
+ class PlayerMoveItemData : public MoveItemData
+ {
+ public:
+ PlayerMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
+ MoveItemData(guild, player, container, slotId) { }
+
+ bool IsBank() const override { return false; }
+ bool InitItem() override;
+ void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) override;
+ Item* StoreItem(SQLTransaction& trans, Item* pItem) override;
+ void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const override;
+ protected:
+ InventoryResult CanStore(Item* pItem, bool swap) override;
+ };
+
+ class BankMoveItemData : public MoveItemData
+ {
+ public:
+ BankMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
+ MoveItemData(guild, player, container, slotId) { }
+
+ bool IsBank() const override { return true; }
+ bool InitItem() override;
+ bool HasStoreRights(MoveItemData* pOther) const override;
+ bool HasWithdrawRights(MoveItemData* pOther) const override;
+ void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount) override;
+ Item* StoreItem(SQLTransaction& trans, Item* pItem) override;
+ void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const override;
+ void LogAction(MoveItemData* pFrom) const override;
+
+ protected:
+ InventoryResult CanStore(Item* pItem, bool swap) override;
+
+ private:
+ Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const;
+ bool _ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count);
+ void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count);
+ };
+
+ typedef std::unordered_map<uint32, Member*> Members;
+ typedef std::vector<RankInfo> Ranks;
+ typedef std::vector<BankTab*> BankTabs;
- uint32 GetRights() const { return m_rights; }
- void SetRights(uint32 rights);
+ public:
+ static void SendCommandResult(WorldSession* session, GuildCommandType type, GuildCommandError errCode, std::string const& param = "");
+ static void SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode);
- int32 GetBankMoneyPerDay() const { return m_bankMoneyPerDay; }
+ Guild();
+ ~Guild();
- void SetBankMoneyPerDay(uint32 money);
+ bool Create(Player* pLeader, std::string const& name);
+ void Disband();
- inline int8 GetBankTabRights(uint8 tabId) const
+ // Getters
+ ObjectGuid::LowType GetId() const { return m_id; }
+ ObjectGuid GetLeaderGUID() const { return m_leaderGuid; }
+ std::string const& GetName() const { return m_name; }
+ std::string const& GetMOTD() const { return m_motd; }
+ std::string const& GetInfo() const { return m_info; }
+ uint32 GetMemberCount() const { return m_members.size(); }
+ time_t GetCreatedDate() const { return m_createdDate; }
+ uint64 GetBankMoney() const { return m_bankMoney; }
+
+ bool SetName(std::string const& name);
+
+ // Handle client commands
+ void HandleRoster(WorldSession* session);
+ void HandleQuery(WorldSession* session);
+ void HandleSetMOTD(WorldSession* session, std::string const& motd);
+ void HandleSetInfo(WorldSession* session, std::string const& info);
+ void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo);
+ void HandleSetLeader(WorldSession* session, std::string const& name);
+ void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string const& name, std::string const& icon);
+ void HandleSetMemberNote(WorldSession* session, std::string const& name, std::string const& note, bool officer);
+ void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, const GuildBankRightsAndSlotsVec& rightsAndSlots);
+ void HandleBuyBankTab(WorldSession* session, uint8 tabId);
+ void HandleInviteMember(WorldSession* session, std::string const& name);
+ void HandleAcceptMember(WorldSession* session);
+ void HandleLeaveMember(WorldSession* session);
+ void HandleRemoveMember(WorldSession* session, std::string const& name);
+ void HandleUpdateMemberRank(WorldSession* session, std::string const& name, bool demote);
+ void HandleAddNewRank(WorldSession* session, std::string const& name);
+ void HandleRemoveRank(WorldSession* session, uint8 rankId);
+ void HandleRemoveLowestRank(WorldSession* session);
+ void HandleMemberDepositMoney(WorldSession* session, uint32 amount);
+ bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false);
+ void HandleMemberLogout(WorldSession* session);
+ void HandleDisband(WorldSession* session);
+
+ void UpdateMemberData(Player* player, uint8 dataid, uint32 value);
+ void OnPlayerStatusChange(Player* player, uint32 flag, bool state);
+
+ // Send info to client
+ void SendInfo(WorldSession* session) const;
+ void SendEventLog(WorldSession* session) const;
+ void SendBankLog(WorldSession* session, uint8 tabId) const;
+ void SendBankTabsInfo(WorldSession* session, bool showTabs = false) const;
+ void SendBankTabData(WorldSession* session, uint8 tabId) const;
+ void SendBankTabText(WorldSession* session, uint8 tabId) const;
+ void SendPermissions(WorldSession* session) const;
+ void SendMoneyInfo(WorldSession* session) const;
+ void SendLoginInfo(WorldSession* session);
+
+ // Load from DB
+ bool LoadFromDB(Field* fields);
+ void LoadRankFromDB(Field* fields);
+ bool LoadMemberFromDB(Field* fields);
+ bool LoadEventLogFromDB(Field* fields);
+ void LoadBankRightFromDB(Field* fields);
+ void LoadBankTabFromDB(Field* fields);
+ bool LoadBankEventLogFromDB(Field* fields);
+ bool LoadBankItemFromDB(Field* fields);
+ bool Validate();
+
+ // Broadcasts
+ void BroadcastToGuild(WorldSession* session, bool officerOnly, std::string const& msg, uint32 language = LANG_UNIVERSAL) const;
+ void BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const;
+ void BroadcastPacket(WorldPacket* packet) const;
+
+ void MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 maxLevel, uint32 minRank);
+
+ template<class Do>
+ void BroadcastWorker(Do& _do, Player* except = nullptr)
{
- return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].GetRights() : 0;
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
+ if (Player* player = itr->second->FindConnectedPlayer())
+ if (player != except)
+ _do(player);
}
- inline int32 GetBankTabSlotsPerDay(uint8 tabId) const
- {
- return tabId < GUILD_BANK_MAX_TABS ? m_bankTabRightsAndSlots[tabId].GetSlots() : 0;
- }
+ // Members
+ // Adds member to guild. If rankId == GUILD_RANK_NONE, lowest rank is assigned.
+ bool AddMember(SQLTransaction& trans, ObjectGuid guid, uint8 rankId = GUILD_RANK_NONE);
+ void DeleteMember(SQLTransaction& trans, ObjectGuid guid, bool isDisbanding = false, bool isKicked = false, bool canDeleteGuild = false);
+ bool ChangeMemberRank(SQLTransaction& trans, ObjectGuid guid, uint8 newRank);
- void SetBankTabSlotsAndRights(GuildBankRightsAndSlots rightsAndSlots, bool saveToDB);
- void CreateMissingTabsIfNeeded(uint8 ranks, SQLTransaction& trans, bool logOnCreate = false);
+ // Bank
+ void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount);
+ void SwapItemsWithInventory(Player* player, bool toChar, uint8 tabId, uint8 slotId, uint8 playerBag, uint8 playerSlotId, uint32 splitedAmount);
- private:
- ObjectGuid::LowType m_guildId;
+ // Bank tabs
+ void SetBankTabText(uint8 tabId, std::string const& text);
- uint8 m_rankId;
+ void ResetTimes();
+
+ protected:
+ ObjectGuid::LowType m_id;
std::string m_name;
- uint32 m_rights;
- uint32 m_bankMoneyPerDay;
- GuildBankRightsAndSlots m_bankTabRightsAndSlots[GUILD_BANK_MAX_TABS];
- };
+ ObjectGuid m_leaderGuid;
+ std::string m_motd;
+ std::string m_info;
+ time_t m_createdDate;
- class BankTab
- {
- public:
- BankTab(ObjectGuid::LowType guildId, uint8 tabId) : m_guildId(guildId), m_tabId(tabId)
- {
- memset(m_items, 0, GUILD_BANK_MAX_SLOTS * sizeof(Item*));
- }
+ EmblemInfo m_emblemInfo;
+ uint32 m_accountsNumber;
+ uint64 m_bankMoney;
- void LoadFromDB(Field* fields);
- bool LoadItemFromDB(Field* fields);
- void Delete(SQLTransaction& trans, bool removeItemsFromDB = false);
+ Ranks m_ranks;
+ Members m_members;
+ BankTabs m_bankTabs;
- void WritePacket(WorldPacket& data) const;
- bool WriteSlotPacket(WorldPacket& data, uint8 slotId, bool ignoreEmpty = true) const;
- void WriteInfoPacket(WorldPacket& data) const
+ // These are actually ordered lists. The first element is the oldest entry.
+ LogHolder* m_eventLog;
+ LogHolder* m_bankEventLog[GUILD_BANK_MAX_TABS + 1];
+
+ private:
+ inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); }
+ inline RankInfo const* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
+ inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : nullptr; }
+ inline bool _HasRankRight(Player* player, uint32 right) const
{
- data << m_name;
- data << m_icon;
+ if (player)
+ if (Member const* member = GetMember(player->GetGUID()))
+ return (_GetRankRights(member->GetRankId()) & right) != GR_RIGHT_EMPTY;
+ return false;
}
- void SetInfo(std::string const& name, std::string const& icon);
- void SetText(std::string const& text);
- void SendText(const Guild* guild, WorldSession* session) const;
+ inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); }
- inline Item* GetItem(uint8 slotId) const { return slotId < GUILD_BANK_MAX_SLOTS ? m_items[slotId] : NULL; }
- bool SetItem(SQLTransaction& trans, uint8 slotId, Item* pItem);
+ inline uint8 _GetPurchasedTabsSize() const { return uint8(m_bankTabs.size()); }
+ inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : nullptr; }
+ inline BankTab const* GetBankTab(uint8 tabId) const { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : nullptr; }
- private:
- ObjectGuid::LowType m_guildId;
- uint8 m_tabId;
-
- Item* m_items[GUILD_BANK_MAX_SLOTS];
- std::string m_name;
- std::string m_icon;
- std::string m_text;
- };
+ inline Member const* GetMember(ObjectGuid guid) const
+ {
+ auto itr = m_members.find(guid.GetCounter());
+ return itr != m_members.end() ? itr->second : nullptr;
+ }
- // Movement data
- class MoveItemData
- {
- public:
- MoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) : m_pGuild(guild), m_pPlayer(player),
- m_container(container), m_slotId(slotId), m_pItem(NULL), m_pClonedItem(NULL) { }
- virtual ~MoveItemData() { }
-
- virtual bool IsBank() const = 0;
- // Initializes item pointer. Returns true, if item exists, false otherwise.
- virtual bool InitItem() = 0;
- // Checks splited amount against item. Splited amount cannot be more that number of items in stack.
- virtual bool CheckItem(uint32& splitedAmount);
- // Defines if player has rights to save item in container
- virtual bool HasStoreRights(MoveItemData* /*pOther*/) const { return true; }
- // Defines if player has rights to withdraw item from container
- virtual bool HasWithdrawRights(MoveItemData* /*pOther*/) const { return true; }
- // Checks if container can store specified item
- bool CanStore(Item* pItem, bool swap, bool sendError);
- // Clones stored item
- bool CloneItem(uint32 count);
- // Remove item from container (if splited update items fields)
- virtual void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) = 0;
- // Saves item to container
- virtual Item* StoreItem(SQLTransaction& trans, Item* pItem) = 0;
- // Log bank event
- virtual void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const = 0;
- // Log GM action
- virtual void LogAction(MoveItemData* pFrom) const;
- // Copy slots id from position vector
- void CopySlots(SlotIds& ids) const;
-
- Item* GetItem(bool isCloned = false) const { return isCloned ? m_pClonedItem : m_pItem; }
- uint8 GetContainer() const { return m_container; }
- uint8 GetSlotId() const { return m_slotId; }
+ inline Member* GetMember(ObjectGuid guid)
+ {
+ auto itr = m_members.find(guid.GetCounter());
+ return itr != m_members.end() ? itr->second : nullptr;
+ }
- protected:
- virtual InventoryResult CanStore(Item* pItem, bool swap) = 0;
-
- Guild* m_pGuild;
- Player* m_pPlayer;
- uint8 m_container;
- uint8 m_slotId;
- Item* m_pItem;
- Item* m_pClonedItem;
- ItemPosCountVec m_vec;
- };
-
- class PlayerMoveItemData : public MoveItemData
- {
- public:
- PlayerMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
- MoveItemData(guild, player, container, slotId) { }
-
- bool IsBank() const override { return false; }
- bool InitItem() override;
- void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount = 0) override;
- Item* StoreItem(SQLTransaction& trans, Item* pItem) override;
- void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const override;
- protected:
- InventoryResult CanStore(Item* pItem, bool swap) override;
- };
+ inline Member* GetMember(std::string const& name)
+ {
+ for (auto itr = m_members.begin(); itr != m_members.end(); ++itr)
+ if (itr->second->GetName() == name)
+ return itr->second;
- class BankMoveItemData : public MoveItemData
- {
- public:
- BankMoveItemData(Guild* guild, Player* player, uint8 container, uint8 slotId) :
- MoveItemData(guild, player, container, slotId) { }
-
- bool IsBank() const override { return true; }
- bool InitItem() override;
- bool HasStoreRights(MoveItemData* pOther) const override;
- bool HasWithdrawRights(MoveItemData* pOther) const override;
- void RemoveItem(SQLTransaction& trans, MoveItemData* pOther, uint32 splitedAmount) override;
- Item* StoreItem(SQLTransaction& trans, Item* pItem) override;
- void LogBankEvent(SQLTransaction& trans, MoveItemData* pFrom, uint32 count) const override;
- void LogAction(MoveItemData* pFrom) const override;
+ return nullptr;
+ }
- protected:
- InventoryResult CanStore(Item* pItem, bool swap) override;
+ inline void _DeleteMemberFromDB(SQLTransaction& trans, ObjectGuid::LowType lowguid) const
+ {
+ PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
+ stmt->setUInt32(0, lowguid);
+ CharacterDatabase.ExecuteOrAppend(trans, stmt);
+ }
- private:
- Item* _StoreItem(SQLTransaction& trans, BankTab* pTab, Item* pItem, ItemPosCount& pos, bool clone) const;
- bool _ReserveSpace(uint8 slotId, Item* pItem, Item* pItemDest, uint32& count);
- void CanStoreItemInTab(Item* pItem, uint8 skipSlotId, bool merge, uint32& count);
- };
-
- typedef std::unordered_map<uint32, Member*> Members;
- typedef std::vector<RankInfo> Ranks;
- typedef std::vector<BankTab*> BankTabs;
-
-public:
- static void SendCommandResult(WorldSession* session, GuildCommandType type, GuildCommandError errCode, std::string const& param = "");
- static void SendSaveEmblemResult(WorldSession* session, GuildEmblemError errCode);
-
- Guild();
- ~Guild();
-
- bool Create(Player* pLeader, std::string const& name);
- void Disband();
-
- // Getters
- ObjectGuid::LowType GetId() const { return m_id; }
- ObjectGuid GetLeaderGUID() const { return m_leaderGuid; }
- std::string const& GetName() const { return m_name; }
- std::string const& GetMOTD() const { return m_motd; }
- std::string const& GetInfo() const { return m_info; }
- uint32 GetMemberCount() const { return m_members.size(); }
- time_t GetCreatedDate() const { return m_createdDate; }
- uint64 GetBankMoney() const { return m_bankMoney; }
-
- bool SetName(std::string const& name);
-
- // Handle client commands
- void HandleRoster(WorldSession* session);
- void HandleQuery(WorldSession* session);
- void HandleSetMOTD(WorldSession* session, std::string const& motd);
- void HandleSetInfo(WorldSession* session, std::string const& info);
- void HandleSetEmblem(WorldSession* session, const EmblemInfo& emblemInfo);
- void HandleSetLeader(WorldSession* session, std::string const& name);
- void HandleSetBankTabInfo(WorldSession* session, uint8 tabId, std::string const& name, std::string const& icon);
- void HandleSetMemberNote(WorldSession* session, std::string const& name, std::string const& note, bool officer);
- void HandleSetRankInfo(WorldSession* session, uint8 rankId, std::string const& name, uint32 rights, uint32 moneyPerDay, const GuildBankRightsAndSlotsVec& rightsAndSlots);
- void HandleBuyBankTab(WorldSession* session, uint8 tabId);
- void HandleInviteMember(WorldSession* session, std::string const& name);
- void HandleAcceptMember(WorldSession* session);
- void HandleLeaveMember(WorldSession* session);
- void HandleRemoveMember(WorldSession* session, std::string const& name);
- void HandleUpdateMemberRank(WorldSession* session, std::string const& name, bool demote);
- void HandleAddNewRank(WorldSession* session, std::string const& name);
- void HandleRemoveRank(WorldSession* session, uint8 rankId);
- void HandleRemoveLowestRank(WorldSession* session);
- void HandleMemberDepositMoney(WorldSession* session, uint32 amount);
- bool HandleMemberWithdrawMoney(WorldSession* session, uint32 amount, bool repair = false);
- void HandleMemberLogout(WorldSession* session);
- void HandleDisband(WorldSession* session);
-
- void UpdateMemberData(Player* player, uint8 dataid, uint32 value);
- void OnPlayerStatusChange(Player* player, uint32 flag, bool state);
-
- // Send info to client
- void SendInfo(WorldSession* session) const;
- void SendEventLog(WorldSession* session) const;
- void SendBankLog(WorldSession* session, uint8 tabId) const;
- void SendBankTabsInfo(WorldSession* session, bool showTabs = false) const;
- void SendBankTabData(WorldSession* session, uint8 tabId) const;
- void SendBankTabText(WorldSession* session, uint8 tabId) const;
- void SendPermissions(WorldSession* session) const;
- void SendMoneyInfo(WorldSession* session) const;
- void SendLoginInfo(WorldSession* session);
-
- // Load from DB
- bool LoadFromDB(Field* fields);
- void LoadRankFromDB(Field* fields);
- bool LoadMemberFromDB(Field* fields);
- bool LoadEventLogFromDB(Field* fields);
- void LoadBankRightFromDB(Field* fields);
- void LoadBankTabFromDB(Field* fields);
- bool LoadBankEventLogFromDB(Field* fields);
- bool LoadBankItemFromDB(Field* fields);
- bool Validate();
-
- // Broadcasts
- void BroadcastToGuild(WorldSession* session, bool officerOnly, std::string const& msg, uint32 language = LANG_UNIVERSAL) const;
- void BroadcastPacketToRank(WorldPacket* packet, uint8 rankId) const;
- void BroadcastPacket(WorldPacket* packet) const;
-
- void MassInviteToEvent(WorldSession* session, uint32 minLevel, uint32 maxLevel, uint32 minRank);
-
- template<class Do>
- void BroadcastWorker(Do& _do, Player* except = NULL)
- {
- for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
- if (Player* player = itr->second->FindConnectedPlayer())
- if (player != except)
- _do(player);
- }
-
- // Members
- // Adds member to guild. If rankId == GUILD_RANK_NONE, lowest rank is assigned.
- bool AddMember(ObjectGuid guid, uint8 rankId = GUILD_RANK_NONE);
- void DeleteMember(ObjectGuid guid, bool isDisbanding = false, bool isKicked = false, bool canDeleteGuild = false);
- bool ChangeMemberRank(ObjectGuid guid, uint8 newRank);
-
- // Bank
- void SwapItems(Player* player, uint8 tabId, uint8 slotId, uint8 destTabId, uint8 destSlotId, uint32 splitedAmount);
- void SwapItemsWithInventory(Player* player, bool toChar, uint8 tabId, uint8 slotId, uint8 playerBag, uint8 playerSlotId, uint32 splitedAmount);
-
- // Bank tabs
- void SetBankTabText(uint8 tabId, std::string const& text);
-
- void ResetTimes();
-
-protected:
- ObjectGuid::LowType m_id;
- std::string m_name;
- ObjectGuid m_leaderGuid;
- std::string m_motd;
- std::string m_info;
- time_t m_createdDate;
-
- EmblemInfo m_emblemInfo;
- uint32 m_accountsNumber;
- uint64 m_bankMoney;
-
- Ranks m_ranks;
- Members m_members;
- BankTabs m_bankTabs;
-
- // These are actually ordered lists. The first element is the oldest entry.
- LogHolder* m_eventLog;
- LogHolder* m_bankEventLog[GUILD_BANK_MAX_TABS + 1];
-
-private:
- inline uint8 _GetRanksSize() const { return uint8(m_ranks.size()); }
- inline const RankInfo* GetRankInfo(uint8 rankId) const { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; }
- inline RankInfo* GetRankInfo(uint8 rankId) { return rankId < _GetRanksSize() ? &m_ranks[rankId] : NULL; }
- inline bool _HasRankRight(Player* player, uint32 right) const
- {
- if (player)
- if (Member const* member = GetMember(player->GetGUID()))
- return (_GetRankRights(member->GetRankId()) & right) != GR_RIGHT_EMPTY;
- return false;
- }
-
- inline uint8 _GetLowestRankId() const { return uint8(m_ranks.size() - 1); }
-
- inline uint8 _GetPurchasedTabsSize() const { return uint8(m_bankTabs.size()); }
- inline BankTab* GetBankTab(uint8 tabId) { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
- inline const BankTab* GetBankTab(uint8 tabId) const { return tabId < m_bankTabs.size() ? m_bankTabs[tabId] : NULL; }
-
- inline const Member* GetMember(ObjectGuid guid) const
- {
- Members::const_iterator itr = m_members.find(guid.GetCounter());
- return itr != m_members.end() ? itr->second : NULL;
- }
-
- inline Member* GetMember(ObjectGuid guid)
- {
- Members::iterator itr = m_members.find(guid.GetCounter());
- return itr != m_members.end() ? itr->second : NULL;
- }
-
- inline Member* GetMember(std::string const& name)
- {
- for (Members::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
- if (itr->second->GetName() == name)
- return itr->second;
-
- return NULL;
- }
-
- inline void _DeleteMemberFromDB(ObjectGuid::LowType lowguid) const
- {
- PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GUILD_MEMBER);
- stmt->setUInt32(0, lowguid);
- CharacterDatabase.Execute(stmt);
- }
-
- // Creates log holders (either when loading or when creating guild)
- void _CreateLogHolders();
- // Tries to create new bank tab
- void _CreateNewBankTab();
- // Creates default guild ranks with names in given locale
- void _CreateDefaultGuildRanks(LocaleConstant loc);
- // Creates new rank
- bool _CreateRank(std::string const& name, uint32 rights);
- // Update account number when member added/removed from guild
- void _UpdateAccountsNumber();
- bool _IsLeader(Player* player) const;
- void _DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB = false);
- bool _ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add);
- void _SetLeaderGUID(Member* pLeader);
-
- void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay);
- void _SetRankBankTabRightsAndSlots(uint8 rankId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true);
- int8 _GetRankBankTabRights(uint8 rankId, uint8 tabId) const;
- uint32 _GetRankRights(uint8 rankId) const;
- int32 _GetRankBankMoneyPerDay(uint8 rankId) const;
- int32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const;
- std::string _GetRankName(uint8 rankId) const;
-
- int32 _GetMemberRemainingSlots(Member const* member, uint8 tabId) const;
- int32 _GetMemberRemainingMoney(Member const* member) const;
- void _UpdateMemberWithdrawSlots(SQLTransaction& trans, ObjectGuid guid, uint8 tabId);
- bool _MemberHasTabRights(ObjectGuid guid, uint8 tabId, uint32 rights) const;
-
- void _LogEvent(GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2 = 0, uint8 newRank = 0);
- void _LogBankEvent(SQLTransaction& trans, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid::LowType playerGuid, uint32 itemOrMoney, uint16 itemStackCount = 0, uint8 destTabId = 0);
-
- Item* _GetItem(uint8 tabId, uint8 slotId) const;
- void _RemoveItem(SQLTransaction& trans, uint8 tabId, uint8 slotId);
- void _MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAmount);
- bool _DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError, uint32 splitedAmount = 0);
-
- void _SendBankContent(WorldSession* session, uint8 tabId) const;
- void _SendBankMoneyUpdate(WorldSession* session) const;
- void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
- void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
- void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds *slots = NULL) const;
-
- void _BroadcastEvent(GuildEvents guildEvent, ObjectGuid guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
+ // Creates log holders (either when loading or when creating guild)
+ void _CreateLogHolders();
+ // Tries to create new bank tab
+ void _CreateNewBankTab();
+ // Creates default guild ranks with names in given locale
+ void _CreateDefaultGuildRanks(SQLTransaction& trans, LocaleConstant loc);
+ // Creates new rank
+ bool _CreateRank(SQLTransaction& trans, std::string const& name, uint32 rights);
+ // Update account number when member added/removed from guild
+ void _UpdateAccountsNumber();
+ bool _IsLeader(Player* player) const;
+ void _DeleteBankItems(SQLTransaction& trans, bool removeItemsFromDB = false);
+ bool _ModifyBankMoney(SQLTransaction& trans, uint64 amount, bool add);
+ void _SetLeaderGUID(Member* pLeader);
+
+ void _SetRankBankMoneyPerDay(uint8 rankId, uint32 moneyPerDay);
+ void _SetRankBankTabRightsAndSlots(uint8 rankId, GuildBankRightsAndSlots rightsAndSlots, bool saveToDB = true);
+ int8 _GetRankBankTabRights(uint8 rankId, uint8 tabId) const;
+ uint32 _GetRankRights(uint8 rankId) const;
+ int32 _GetRankBankMoneyPerDay(uint8 rankId) const;
+ int32 _GetRankBankTabSlotsPerDay(uint8 rankId, uint8 tabId) const;
+ std::string _GetRankName(uint8 rankId) const;
+
+ int32 _GetMemberRemainingSlots(Member const* member, uint8 tabId) const;
+ int32 _GetMemberRemainingMoney(Member const* member) const;
+ void _UpdateMemberWithdrawSlots(SQLTransaction& trans, ObjectGuid guid, uint8 tabId);
+ bool _MemberHasTabRights(ObjectGuid guid, uint8 tabId, uint32 rights) const;
+
+ void _LogEvent(GuildEventLogTypes eventType, ObjectGuid::LowType playerGuid1, ObjectGuid::LowType playerGuid2 = 0, uint8 newRank = 0);
+ void _LogBankEvent(SQLTransaction& trans, GuildBankEventLogTypes eventType, uint8 tabId, ObjectGuid::LowType playerGuid, uint32 itemOrMoney, uint16 itemStackCount = 0, uint8 destTabId = 0);
+
+ Item* _GetItem(uint8 tabId, uint8 slotId) const;
+ void _RemoveItem(SQLTransaction& trans, uint8 tabId, uint8 slotId);
+ void _MoveItems(MoveItemData* pSrc, MoveItemData* pDest, uint32 splitedAmount);
+ bool _DoItemsMove(MoveItemData* pSrc, MoveItemData* pDest, bool sendError, uint32 splitedAmount = 0);
+
+ void _SendBankContent(WorldSession* session, uint8 tabId) const;
+ void _SendBankMoneyUpdate(WorldSession* session) const;
+ void _SendBankContentUpdate(MoveItemData* pSrc, MoveItemData* pDest) const;
+ void _SendBankContentUpdate(uint8 tabId, SlotIds slots) const;
+ void _SendBankList(WorldSession* session = NULL, uint8 tabId = 0, bool sendFullSlots = false, SlotIds *slots = NULL) const;
+
+ void _BroadcastEvent(GuildEvents guildEvent, ObjectGuid guid, const char* param1 = NULL, const char* param2 = NULL, const char* param3 = NULL) const;
};
#endif
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index 53c62858c04..157511afd96 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -1843,13 +1843,10 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
{
// Reset guild
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER);
-
stmt->setUInt32(0, lowGuid);
-
- PreparedQueryResult result = CharacterDatabase.Query(stmt);
- if (result)
+ if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32()))
- guild->DeleteMember(factionChangeInfo.Guid, false, false, true);
+ guild->DeleteMember(trans, factionChangeInfo.Guid, false, false, true);
Player::LeaveAllArenaTeams(factionChangeInfo.Guid);
}
diff --git a/src/server/game/Handlers/PetitionsHandler.cpp b/src/server/game/Handlers/PetitionsHandler.cpp
index c0b5db65d90..a4d41bbff1f 100644
--- a/src/server/game/Handlers/PetitionsHandler.cpp
+++ b/src/server/game/Handlers/PetitionsHandler.cpp
@@ -849,12 +849,18 @@ void WorldSession::HandleTurnInPetitionOpcode(WorldPacket& recvData)
Guild::SendCommandResult(this, GUILD_COMMAND_CREATE, ERR_GUILD_COMMAND_SUCCESS, name);
- // Add members from signatures
- for (uint8 i = 0; i < signatures; ++i)
{
- Field* fields = result->Fetch();
- guild->AddMember(ObjectGuid(HighGuid::Player, fields[0].GetUInt32()));
- result->NextRow();
+ SQLTransaction trans = CharacterDatabase.BeginTransaction();
+
+ // Add members from signatures
+ for (uint8 i = 0; i < signatures; ++i)
+ {
+ Field* fields = result->Fetch();
+ guild->AddMember(trans, ObjectGuid(HighGuid::Player, fields[0].GetUInt32()));
+ result->NextRow();
+ }
+
+ CharacterDatabase.CommitTransaction(trans);
}
}
else
diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp
index 9686fb9622f..b69bb41d3ad 100644
--- a/src/server/game/Loot/LootMgr.cpp
+++ b/src/server/game/Loot/LootMgr.cpp
@@ -483,7 +483,7 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting)
{
ObjectGuid::LowType plguid = player->GetGUID().GetCounter();
- QuestItemMap::const_iterator qmapitr = PlayerQuestItems.find(plguid);
+ NotNormalLootItemMap::const_iterator qmapitr = PlayerQuestItems.find(plguid);
if (qmapitr == PlayerQuestItems.end())
FillQuestLoot(player);
@@ -517,16 +517,16 @@ void Loot::FillNotNormalLootFor(Player* player, bool presentAtLooting)
}
}
-QuestItemList* Loot::FillFFALoot(Player* player)
+NotNormalLootItemList* Loot::FillFFALoot(Player* player)
{
- QuestItemList* ql = new QuestItemList();
+ NotNormalLootItemList* ql = new NotNormalLootItemList();
for (uint8 i = 0; i < items.size(); ++i)
{
LootItem &item = items[i];
if (!item.is_looted && item.freeforall && item.AllowedForPlayer(player))
{
- ql->push_back(QuestItem(i));
+ ql->push_back(NotNormalLootItem(i));
++unlootedCount;
}
}
@@ -540,12 +540,12 @@ QuestItemList* Loot::FillFFALoot(Player* player)
return ql;
}
-QuestItemList* Loot::FillQuestLoot(Player* player)
+NotNormalLootItemList* Loot::FillQuestLoot(Player* player)
{
if (items.size() == MAX_NR_LOOT_ITEMS)
return NULL;
- QuestItemList* ql = new QuestItemList();
+ NotNormalLootItemList* ql = new NotNormalLootItemList();
for (uint8 i = 0; i < quest_items.size(); ++i)
{
@@ -553,7 +553,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
if (!item.is_looted && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT))))
{
- ql->push_back(QuestItem(i));
+ ql->push_back(NotNormalLootItem(i));
// quest items get blocked when they first appear in a
// player's quest vector
@@ -578,20 +578,20 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
return ql;
}
-QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting)
+NotNormalLootItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting)
{
- QuestItemList* ql = new QuestItemList();
+ NotNormalLootItemList* ql = new NotNormalLootItemList();
for (uint8 i = 0; i < items.size(); ++i)
{
LootItem &item = items[i];
- if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player) || (item.follow_loot_rules && player->GetGroup() && ((player->GetGroup()->GetLootMethod() == MASTER_LOOT && player->GetGroup()->GetMasterLooterGuid() == player->GetGUID()) || player->GetGroup()->GetLootMethod() != MASTER_LOOT))))
+ if (!item.is_looted && !item.freeforall && (item.AllowedForPlayer(player)))
{
if (presentAtLooting)
item.AddAllowedLooter(player);
if (!item.conditions.empty())
{
- ql->push_back(QuestItem(i));
+ ql->push_back(NotNormalLootItem(i));
if (!item.is_counted)
{
++unlootedCount;
@@ -657,11 +657,11 @@ void Loot::NotifyQuestItemRemoved(uint8 questIndex)
++i_next;
if (Player* player = ObjectAccessor::FindPlayer(*i))
{
- QuestItemMap::const_iterator pq = PlayerQuestItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap::const_iterator pq = PlayerQuestItems.find(player->GetGUID().GetCounter());
if (pq != PlayerQuestItems.end() && pq->second)
{
// find where/if the player has the given item in it's vector
- QuestItemList& pql = *pq->second;
+ NotNormalLootItemList& pql = *pq->second;
uint8 j;
for (j = 0; j < pql.size(); ++j)
@@ -717,17 +717,17 @@ void Loot::DeleteLootMoneyFromContainerItemDB()
CharacterDatabase.Execute(stmt);
}
-LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qitem, QuestItem* *ffaitem, QuestItem* *conditem)
+LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, NotNormalLootItem* *qitem, NotNormalLootItem* *ffaitem, NotNormalLootItem* *conditem)
{
LootItem* item = NULL;
bool is_looted = true;
if (lootSlot >= items.size())
{
uint32 questSlot = lootSlot - items.size();
- QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUID().GetCounter());
if (itr != PlayerQuestItems.end() && questSlot < itr->second->size())
{
- QuestItem* qitem2 = &itr->second->at(questSlot);
+ NotNormalLootItem* qitem2 = &itr->second->at(questSlot);
if (qitem)
*qitem = qitem2;
item = &quest_items[qitem2->index];
@@ -740,13 +740,13 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
is_looted = item->is_looted;
if (item->freeforall)
{
- QuestItemMap::const_iterator itr = PlayerFFAItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap::const_iterator itr = PlayerFFAItems.find(player->GetGUID().GetCounter());
if (itr != PlayerFFAItems.end())
{
- for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
+ for (NotNormalLootItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
if (iter->index == lootSlot)
{
- QuestItem* ffaitem2 = (QuestItem*)&(*iter);
+ NotNormalLootItem* ffaitem2 = (NotNormalLootItem*)&(*iter);
if (ffaitem)
*ffaitem = ffaitem2;
is_looted = ffaitem2->is_looted;
@@ -756,14 +756,14 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
}
else if (!item->conditions.empty())
{
- QuestItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.find(player->GetGUID().GetCounter());
if (itr != PlayerNonQuestNonFFAConditionalItems.end())
{
- for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
+ for (NotNormalLootItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
{
if (iter->index == lootSlot)
{
- QuestItem* conditem2 = (QuestItem*)&(*iter);
+ NotNormalLootItem* conditem2 = (NotNormalLootItem*)&(*iter);
if (conditem)
*conditem = conditem2;
is_looted = conditem2->is_looted;
@@ -782,7 +782,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem* *qite
uint32 Loot::GetMaxSlotInLootFor(Player* player) const
{
- QuestItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap::const_iterator itr = PlayerQuestItems.find(player->GetGUID().GetCounter());
return items.size() + (itr != PlayerQuestItems.end() ? itr->second->size() : 0);
}
@@ -802,12 +802,12 @@ bool Loot::hasItemForAll() const
// return true if there is any FFA, quest or conditional item for the player.
bool Loot::hasItemFor(Player* player) const
{
- QuestItemMap const& lootPlayerQuestItems = GetPlayerQuestItems();
- QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap const& lootPlayerQuestItems = GetPlayerQuestItems();
+ NotNormalLootItemMap::const_iterator q_itr = lootPlayerQuestItems.find(player->GetGUID().GetCounter());
if (q_itr != lootPlayerQuestItems.end())
{
- QuestItemList* q_list = q_itr->second;
- for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
+ NotNormalLootItemList* q_list = q_itr->second;
+ for (NotNormalLootItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
{
const LootItem &item = quest_items[qi->index];
if (!qi->is_looted && !item.is_looted)
@@ -815,12 +815,12 @@ bool Loot::hasItemFor(Player* player) const
}
}
- QuestItemMap const& lootPlayerFFAItems = GetPlayerFFAItems();
- QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap const& lootPlayerFFAItems = GetPlayerFFAItems();
+ NotNormalLootItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(player->GetGUID().GetCounter());
if (ffa_itr != lootPlayerFFAItems.end())
{
- QuestItemList* ffa_list = ffa_itr->second;
- for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
+ NotNormalLootItemList* ffa_list = ffa_itr->second;
+ for (NotNormalLootItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
{
const LootItem &item = items[fi->index];
if (!fi->is_looted && !item.is_looted)
@@ -828,12 +828,12 @@ bool Loot::hasItemFor(Player* player) const
}
}
- QuestItemMap const& lootPlayerNonQuestNonFFAConditionalItems = GetPlayerNonQuestNonFFAConditionalItems();
- QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUID().GetCounter());
+ NotNormalLootItemMap const& lootPlayerNonQuestNonFFAConditionalItems = GetPlayerNonQuestNonFFAConditionalItems();
+ NotNormalLootItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(player->GetGUID().GetCounter());
if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
- QuestItemList* conditional_list = nn_itr->second;
- for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
+ NotNormalLootItemList* conditional_list = nn_itr->second;
+ for (NotNormalLootItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
{
const LootItem &item = items[ci->index];
if (!ci->is_looted && !item.is_looted)
@@ -976,12 +976,12 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
LootSlotType slotType = lv.permission == OWNER_PERMISSION ? LOOT_SLOT_TYPE_OWNER : LOOT_SLOT_TYPE_ALLOW_LOOT;
- QuestItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems();
- QuestItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID().GetCounter());
+ NotNormalLootItemMap const& lootPlayerQuestItems = l.GetPlayerQuestItems();
+ NotNormalLootItemMap::const_iterator q_itr = lootPlayerQuestItems.find(lv.viewer->GetGUID().GetCounter());
if (q_itr != lootPlayerQuestItems.end())
{
- QuestItemList* q_list = q_itr->second;
- for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
+ NotNormalLootItemList* q_list = q_itr->second;
+ for (NotNormalLootItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
{
LootItem &item = l.quest_items[qi->index];
if (!qi->is_looted && !item.is_looted)
@@ -1017,12 +1017,12 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
}
- QuestItemMap const& lootPlayerFFAItems = l.GetPlayerFFAItems();
- QuestItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID().GetCounter());
+ NotNormalLootItemMap const& lootPlayerFFAItems = l.GetPlayerFFAItems();
+ NotNormalLootItemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(lv.viewer->GetGUID().GetCounter());
if (ffa_itr != lootPlayerFFAItems.end())
{
- QuestItemList* ffa_list = ffa_itr->second;
- for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
+ NotNormalLootItemList* ffa_list = ffa_itr->second;
+ for (NotNormalLootItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
{
LootItem &item = l.items[fi->index];
if (!fi->is_looted && !item.is_looted)
@@ -1035,42 +1035,37 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
}
}
- QuestItemMap const& lootPlayerNonQuestNonFFAConditionalItems = l.GetPlayerNonQuestNonFFAConditionalItems();
- QuestItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID().GetCounter());
+ NotNormalLootItemMap const& lootPlayerNonQuestNonFFAConditionalItems = l.GetPlayerNonQuestNonFFAConditionalItems();
+ NotNormalLootItemMap::const_iterator nn_itr = lootPlayerNonQuestNonFFAConditionalItems.find(lv.viewer->GetGUID().GetCounter());
if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
- QuestItemList* conditional_list = nn_itr->second;
- for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
+ NotNormalLootItemList* conditional_list = nn_itr->second;
+ for (NotNormalLootItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
{
LootItem &item = l.items[ci->index];
if (!ci->is_looted && !item.is_looted)
{
b << uint8(ci->index);
b << item;
- if (item.follow_loot_rules)
+ switch (lv.permission)
{
- switch (lv.permission)
- {
- case MASTER_PERMISSION:
- b << uint8(LOOT_SLOT_TYPE_MASTER);
- break;
- case RESTRICTED_PERMISSION:
- b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType));
- break;
- case GROUP_PERMISSION:
- case ROUND_ROBIN_PERMISSION:
- if (!item.is_blocked)
- b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
- else
- b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
- break;
- default:
- b << uint8(slotType);
- break;
- }
- }
- else
+ case MASTER_PERMISSION:
+ b << uint8(LOOT_SLOT_TYPE_MASTER);
+ break;
+ case RESTRICTED_PERMISSION:
+ b << (item.is_blocked ? uint8(LOOT_SLOT_TYPE_LOCKED) : uint8(slotType));
+ break;
+ case GROUP_PERMISSION:
+ case ROUND_ROBIN_PERMISSION:
+ if (!item.is_blocked)
+ b << uint8(LOOT_SLOT_TYPE_ALLOW_LOOT);
+ else
+ b << uint8(LOOT_SLOT_TYPE_ROLL_ONGOING);
+ break;
+ default:
b << uint8(slotType);
+ break;
+ }
++itemsShown;
}
}
diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h
index bca5cde1fa5..ecfb864823f 100644
--- a/src/server/game/Loot/LootMgr.h
+++ b/src/server/game/Loot/LootMgr.h
@@ -180,24 +180,24 @@ struct TC_GAME_API LootItem
const AllowedLooterSet & GetAllowedLooters() const { return allowedGUIDs; }
};
-struct QuestItem
+struct NotNormalLootItem
{
- uint8 index; // position in quest_items;
+ uint8 index; // position in quest_items or items;
bool is_looted;
- QuestItem()
+ NotNormalLootItem()
: index(0), is_looted(false) { }
- QuestItem(uint8 _index, bool _islooted = false)
+ NotNormalLootItem(uint8 _index, bool _islooted = false)
: index(_index), is_looted(_islooted) { }
};
struct Loot;
class LootTemplate;
-typedef std::vector<QuestItem> QuestItemList;
+typedef std::vector<NotNormalLootItem> NotNormalLootItemList;
typedef std::vector<LootItem> LootItemList;
-typedef std::map<uint32, QuestItemList*> QuestItemMap;
+typedef std::map<uint32, NotNormalLootItemList*> NotNormalLootItemMap;
typedef std::list<LootStoreItem*> LootStoreItemList;
typedef std::unordered_map<uint32, LootTemplate*> LootTemplateMap;
@@ -308,9 +308,9 @@ struct TC_GAME_API Loot
{
friend ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv);
- QuestItemMap const& GetPlayerQuestItems() const { return PlayerQuestItems; }
- QuestItemMap const& GetPlayerFFAItems() const { return PlayerFFAItems; }
- QuestItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
+ NotNormalLootItemMap const& GetPlayerQuestItems() const { return PlayerQuestItems; }
+ NotNormalLootItemMap const& GetPlayerFFAItems() const { return PlayerFFAItems; }
+ NotNormalLootItemMap const& GetPlayerNonQuestNonFFAConditionalItems() const { return PlayerNonQuestNonFFAConditionalItems; }
std::vector<LootItem> items;
std::vector<LootItem> quest_items;
@@ -340,15 +340,15 @@ struct TC_GAME_API Loot
// void clear();
void clear()
{
- for (QuestItemMap::const_iterator itr = PlayerQuestItems.begin(); itr != PlayerQuestItems.end(); ++itr)
+ for (NotNormalLootItemMap::const_iterator itr = PlayerQuestItems.begin(); itr != PlayerQuestItems.end(); ++itr)
delete itr->second;
PlayerQuestItems.clear();
- for (QuestItemMap::const_iterator itr = PlayerFFAItems.begin(); itr != PlayerFFAItems.end(); ++itr)
+ for (NotNormalLootItemMap::const_iterator itr = PlayerFFAItems.begin(); itr != PlayerFFAItems.end(); ++itr)
delete itr->second;
PlayerFFAItems.clear();
- for (QuestItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.begin(); itr != PlayerNonQuestNonFFAConditionalItems.end(); ++itr)
+ for (NotNormalLootItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.begin(); itr != PlayerNonQuestNonFFAConditionalItems.end(); ++itr)
delete itr->second;
PlayerNonQuestNonFFAConditionalItems.clear();
@@ -377,7 +377,7 @@ struct TC_GAME_API Loot
// Inserts the item into the loot (called by LootTemplate processors)
void AddItem(LootStoreItem const & item);
- LootItem* LootItemInSlot(uint32 lootslot, Player* player, QuestItem** qitem = NULL, QuestItem** ffaitem = NULL, QuestItem** conditem = NULL);
+ LootItem* LootItemInSlot(uint32 lootslot, Player* player, NotNormalLootItem** qitem = NULL, NotNormalLootItem** ffaitem = NULL, NotNormalLootItem** conditem = NULL);
uint32 GetMaxSlotInLootFor(Player* player) const;
bool hasItemForAll() const;
bool hasItemFor(Player* player) const;
@@ -385,14 +385,14 @@ struct TC_GAME_API Loot
private:
void FillNotNormalLootFor(Player* player, bool presentAtLooting);
- QuestItemList* FillFFALoot(Player* player);
- QuestItemList* FillQuestLoot(Player* player);
- QuestItemList* FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting);
+ NotNormalLootItemList* FillFFALoot(Player* player);
+ NotNormalLootItemList* FillQuestLoot(Player* player);
+ NotNormalLootItemList* FillNonQuestNonFFAConditionalLoot(Player* player, bool presentAtLooting);
GuidSet PlayersLooting;
- QuestItemMap PlayerQuestItems;
- QuestItemMap PlayerFFAItems;
- QuestItemMap PlayerNonQuestNonFFAConditionalItems;
+ NotNormalLootItemMap PlayerQuestItems;
+ NotNormalLootItemMap PlayerFFAItems;
+ NotNormalLootItemMap PlayerNonQuestNonFFAConditionalItems;
// All rolls are registered here. They need to know, when the loot is not valid anymore
LootValidatorRefManager i_LootValidatorRefManager;
diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h
index ce0c749c294..bf913081fef 100644
--- a/src/server/game/Miscellaneous/SharedDefines.h
+++ b/src/server/game/Miscellaneous/SharedDefines.h
@@ -374,9 +374,9 @@ enum SpellAttr2
SPELL_ATTR2_IS_ARCANE_CONCENTRATION = 0x00800000, // 23 Only mage Arcane Concentration have this flag
SPELL_ATTR2_UNK24 = 0x01000000, // 24
SPELL_ATTR2_UNK25 = 0x02000000, // 25
- SPELL_ATTR2_UNK26 = 0x04000000, // 26 unaffected by school immunity
+ SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE = 0x04000000, // 26 unaffected by school immunity
SPELL_ATTR2_UNK27 = 0x08000000, // 27
- SPELL_ATTR2_UNK28 = 0x10000000, // 28
+ SPELL_ATTR2_IGNORE_ITEM_CHECK = 0x10000000, // 28 Spell is cast without checking item requirements (charges/reagents/totem)
SPELL_ATTR2_CANT_CRIT = 0x20000000, // 29 Spell can't crit
SPELL_ATTR2_TRIGGERED_CAN_TRIGGER_PROC = 0x40000000, // 30 spell can trigger even if triggered
SPELL_ATTR2_FOOD_BUFF = 0x80000000 // 31 Food or Drink Buff (like Well Fed)
@@ -472,7 +472,7 @@ enum SpellAttr5
SPELL_ATTR5_HASTE_AFFECT_DURATION = 0x00002000, // 13 haste effects decrease duration of this
SPELL_ATTR5_UNK14 = 0x00004000, // 14
SPELL_ATTR5_UNK15 = 0x00008000, // 15 Inflits on multiple targets?
- SPELL_ATTR5_SPECIAL_ITEM_CLASS_CHECK = 0x00010000, // 16 this allows spells with EquippedItemClass to affect spells from other items if the required item is equipped
+ SPELL_ATTR5_UNK16 = 0x00010000, // 16
SPELL_ATTR5_USABLE_WHILE_FEARED = 0x00020000, // 17 usable while feared
SPELL_ATTR5_USABLE_WHILE_CONFUSED = 0x00040000, // 18 usable while confused
SPELL_ATTR5_DONT_TURN_DURING_CAST = 0x00080000, // 19 Blocks caster's turning when casting (client does not automatically turn caster's model to face UNIT_FIELD_TARGET)
@@ -548,7 +548,7 @@ enum SpellAttr7
SPELL_ATTR7_UNK17 = 0x00020000, // 17 Only 27965 (Suicide) spell.
SPELL_ATTR7_HAS_CHARGE_EFFECT = 0x00040000, // 18 Only spells that have Charge among effects.
SPELL_ATTR7_ZONE_TELEPORT = 0x00080000, // 19 Teleports to specific zones.
- SPELL_ATTR7_UNK20 = 0x00100000, // 20 Blink, Divine Shield, Ice Block
+ SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION = 0x00100000, // 20 Blink, Divine Shield, Ice Block
SPELL_ATTR7_UNK21 = 0x00200000, // 21 Not set
SPELL_ATTR7_UNK22 = 0x00400000, // 22
SPELL_ATTR7_UNK23 = 0x00800000, // 23 Motivate, Mutilate, Shattering Throw
@@ -1286,10 +1286,11 @@ enum SpellImmunity
IMMUNITY_DAMAGE = 3, // enum SpellSchoolMask
IMMUNITY_DISPEL = 4, // enum DispelType
IMMUNITY_MECHANIC = 5, // enum Mechanics
- IMMUNITY_ID = 6
+ IMMUNITY_ID = 6,
+
+ MAX_SPELL_IMMUNITY
};
-#define MAX_SPELL_IMMUNITY 7
// target enum name consist of:
// TARGET_[OBJECT_TYPE]_[REFERENCE_TYPE(skipped for caster)]_[SELECTION_TYPE(skipped for default)]_[additional specifiers(friendly, BACK_LEFT, etc.]
diff --git a/src/server/game/Movement/MotionMaster.cpp b/src/server/game/Movement/MotionMaster.cpp
index 4ad2a314111..105b4245ff3 100644
--- a/src/server/game/Movement/MotionMaster.cpp
+++ b/src/server/game/Movement/MotionMaster.cpp
@@ -20,7 +20,6 @@
#include "CreatureAISelector.h"
#include "Creature.h"
#include "ScriptSystem.h"
-
#include "ConfusedMovementGenerator.h"
#include "FleeingMovementGenerator.h"
#include "HomeMovementGenerator.h"
@@ -33,9 +32,21 @@
#include "MoveSpline.h"
#include "MoveSplineInit.h"
-inline bool isStatic(MovementGenerator *mv)
+inline bool IsStatic(MovementGenerator* movement)
+{
+ return (movement == &si_idleMovement);
+}
+
+MotionMaster::~MotionMaster()
{
- return (mv == &si_idleMovement);
+ // clear ALL movement generators (including default)
+ while (!empty())
+ {
+ MovementGenerator *curr = top();
+ pop();
+ if (curr && !IsStatic(curr))
+ delete curr; // Skip finalizing on delete, it might launch new movement
+ }
}
void MotionMaster::Initialize()
@@ -66,18 +77,6 @@ void MotionMaster::InitDefault()
}
}
-MotionMaster::~MotionMaster()
-{
- // clear ALL movement generators (including default)
- while (!empty())
- {
- MovementGenerator *curr = top();
- pop();
- if (curr && !isStatic(curr))
- delete curr; // Skip finalizing on delete, it might launch new movement
- }
-}
-
void MotionMaster::UpdateMotion(uint32 diff)
{
if (!_owner)
@@ -97,20 +96,20 @@ void MotionMaster::UpdateMotion(uint32 diff)
else
_cleanFlag &= ~MMCF_UPDATE;
- if (_expList)
+ if (_expireList)
{
- for (size_t i = 0; i < _expList->size(); ++i)
+ for (size_t i = 0; i < _expireList->size(); ++i)
{
- MovementGenerator* mg = (*_expList)[i];
+ MovementGenerator* mg = (*_expireList)[i];
DirectDelete(mg);
}
- delete _expList;
- _expList = NULL;
+ delete _expireList;
+ _expireList = nullptr;
if (empty())
Initialize();
- else if (needInitTop())
+ else if (NeedInitTop())
InitTop();
else if (_cleanFlag & MMCF_RESET)
top()->Reset(_owner);
@@ -122,84 +121,84 @@ void MotionMaster::UpdateMotion(uint32 diff)
_owner->UpdateUnderwaterState(_owner->GetMap(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ());
}
-void MotionMaster::DirectClean(bool reset)
+void MotionMaster::Clear(bool reset /*= true*/)
{
- while (size() > 1)
+ if (_cleanFlag & MMCF_UPDATE)
{
- MovementGenerator *curr = top();
- pop();
- if (curr) DirectDelete(curr);
+ if (reset)
+ _cleanFlag |= MMCF_RESET;
+ else
+ _cleanFlag &= ~MMCF_RESET;
+ DelayedClean();
}
-
- if (empty())
- return;
-
- if (needInitTop())
- InitTop();
- else if (reset)
- top()->Reset(_owner);
+ else
+ DirectClean(reset);
}
-void MotionMaster::DelayedClean()
+void MotionMaster::MovementExpired(bool reset /*= true*/)
{
- while (size() > 1)
+ if (_cleanFlag & MMCF_UPDATE)
{
- MovementGenerator *curr = top();
- pop();
- if (curr)
- DelayedDelete(curr);
+ if (reset)
+ _cleanFlag |= MMCF_RESET;
+ else
+ _cleanFlag &= ~MMCF_RESET;
+ DelayedExpire();
}
+ else
+ DirectExpire(reset);
}
-void MotionMaster::DirectExpire(bool reset)
+MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType() const
{
- if (size() > 1)
- {
- MovementGenerator *curr = top();
- pop();
- DirectDelete(curr);
- }
+ if (empty())
+ return IDLE_MOTION_TYPE;
- while (!empty() && !top())
- --_top;
+ return top()->GetMovementGeneratorType();
+}
- if (empty())
- Initialize();
- else if (needInitTop())
- InitTop();
- else if (reset)
- top()->Reset(_owner);
+MovementGeneratorType MotionMaster::GetMotionSlotType(int slot) const
+{
+ if (!_slot[slot])
+ return NULL_MOTION_TYPE;
+ else
+ return _slot[slot]->GetMovementGeneratorType();
}
-void MotionMaster::DelayedExpire()
+MovementGenerator* MotionMaster::GetMotionSlot(int slot) const
{
- if (size() > 1)
+ ASSERT(slot >= 0);
+ return _slot[slot];
+}
+
+void MotionMaster::propagateSpeedChange()
+{
+ for (int i = 0; i <= _top; ++i)
{
- MovementGenerator *curr = top();
- pop();
- DelayedDelete(curr);
+ if (_slot[i])
+ _slot[i]->unitSpeedChanged();
}
+}
- while (!empty() && !top())
- --_top;
+bool MotionMaster::GetDestination(float &x, float &y, float &z)
+{
+ if (_owner->movespline->Finalized())
+ return false;
+
+ G3D::Vector3 const& dest = _owner->movespline->FinalDestination();
+ x = dest.x;
+ y = dest.y;
+ z = dest.z;
+ return true;
}
void MotionMaster::MoveIdle()
{
//! Should be preceded by MovementExpired or Clear if there's an overlying movementgenerator active
- if (empty() || !isStatic(top()))
+ if (empty() || !IsStatic(top()))
Mutate(&si_idleMovement, MOTION_SLOT_IDLE);
}
-void MotionMaster::MoveRandom(float spawndist)
-{
- if (_owner->GetTypeId() == TYPEID_UNIT)
- {
- TC_LOG_DEBUG("misc", "Creature (GUID: %u) started random movement.", _owner->GetGUID().GetCounter());
- Mutate(new RandomMovementGenerator<Creature>(spawndist), MOTION_SLOT_IDLE);
- }
-}
-
void MotionMaster::MoveTargetedHome()
{
Clear(false);
@@ -225,18 +224,36 @@ void MotionMaster::MoveTargetedHome()
}
}
-void MotionMaster::MoveConfused()
+void MotionMaster::MoveRandom(float spawndist)
{
+ if (_owner->GetTypeId() == TYPEID_UNIT)
+ {
+ TC_LOG_DEBUG("misc", "Creature (GUID: %u) started random movement.", _owner->GetGUID().GetCounter());
+ Mutate(new RandomMovementGenerator<Creature>(spawndist), MOTION_SLOT_IDLE);
+ }
+}
+
+void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
+{
+ // ignore movement request if target not exist
+ if (!target || target == _owner)
+ return;
+
+ //_owner->AddUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) move confused", _owner->GetGUID().GetCounter());
- Mutate(new ConfusedMovementGenerator<Player>(), MOTION_SLOT_CONTROLLED);
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) follows %s (GUID: %u).", _owner->GetGUID().GetCounter(),
+ target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
+ target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : target->ToCreature()->GetSpawnId());
+ Mutate(new FollowMovementGenerator<Player>(target, dist, angle), slot);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) move confused",
- _owner->GetEntry(), _owner->GetGUID().GetCounter());
- Mutate(new ConfusedMovementGenerator<Creature>(), MOTION_SLOT_CONTROLLED);
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) follows %s (GUID: %u).",
+ _owner->GetEntry(), _owner->GetGUID().GetCounter(),
+ target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
+ target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : target->ToCreature()->GetSpawnId());
+ Mutate(new FollowMovementGenerator<Creature>(target, dist, angle), slot);
}
}
@@ -265,27 +282,44 @@ void MotionMaster::MoveChase(Unit* target, float dist, float angle)
}
}
-void MotionMaster::MoveFollow(Unit* target, float dist, float angle, MovementSlot slot)
+void MotionMaster::MoveConfused()
{
- // ignore movement request if target not exist
- if (!target || target == _owner)
+ if (_owner->GetTypeId() == TYPEID_PLAYER)
+ {
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) move confused", _owner->GetGUID().GetCounter());
+ Mutate(new ConfusedMovementGenerator<Player>(), MOTION_SLOT_CONTROLLED);
+ }
+ else
+ {
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) move confused",
+ _owner->GetEntry(), _owner->GetGUID().GetCounter());
+ Mutate(new ConfusedMovementGenerator<Creature>(), MOTION_SLOT_CONTROLLED);
+ }
+}
+
+void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
+{
+ if (!enemy)
return;
- //_owner->AddUnitState(UNIT_STATE_FOLLOW);
if (_owner->GetTypeId() == TYPEID_PLAYER)
{
- TC_LOG_DEBUG("misc", "Player (GUID: %u) follows %s (GUID: %u).", _owner->GetGUID().GetCounter(),
- target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
- target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : target->ToCreature()->GetSpawnId());
- Mutate(new FollowMovementGenerator<Player>(target, dist, angle), slot);
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) flees from %s (GUID: %u).", _owner->GetGUID().GetCounter(),
+ enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
+ enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUID().GetCounter() : enemy->ToCreature()->GetSpawnId());
+ Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
}
else
{
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) follows %s (GUID: %u).",
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) flees from %s (GUID: %u)%s.",
_owner->GetEntry(), _owner->GetGUID().GetCounter(),
- target->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
- target->GetTypeId() == TYPEID_PLAYER ? target->GetGUID().GetCounter() : target->ToCreature()->GetSpawnId());
- Mutate(new FollowMovementGenerator<Creature>(target, dist, angle), slot);
+ enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
+ enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUID().GetCounter() : enemy->ToCreature()->GetSpawnId(),
+ time ? " for a limited time" : "");
+ if (time)
+ Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time), MOTION_SLOT_CONTROLLED);
+ else
+ Mutate(new FleeingMovementGenerator<Creature>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
}
}
@@ -353,6 +387,37 @@ void MotionMaster::MoveTakeoff(uint32 id, Position const& pos)
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_ACTIVE);
}
+void MotionMaster::MoveCharge(float x, float y, float z, float speed /*= SPEED_CHARGE*/, uint32 id /*= EVENT_CHARGE*/, bool generatePath /*= false*/)
+{
+ if (_slot[MOTION_SLOT_CONTROLLED] && _slot[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE)
+ return;
+
+ if (_owner->GetTypeId() == TYPEID_PLAYER)
+ {
+ TC_LOG_DEBUG("misc", "Player (GUID: %u) charged point (X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), x, y, z);
+ Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
+ }
+ else
+ {
+ TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) charged point (X: %f Y: %f Z: %f).",
+ _owner->GetEntry(), _owner->GetGUID().GetCounter(), x, y, z);
+ Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
+ }
+}
+
+void MotionMaster::MoveCharge(PathGenerator const& path, float speed /*= SPEED_CHARGE*/)
+{
+ G3D::Vector3 dest = path.GetActualEndPosition();
+
+ MoveCharge(dest.x, dest.y, dest.z, speed, EVENT_CHARGE_PREPATH);
+
+ // Charge movement is not started when using EVENT_CHARGE_PREPATH
+ Movement::MoveSplineInit init(_owner);
+ init.MovebyPath(path.GetPath());
+ init.SetVelocity(speed);
+ init.Launch();
+}
+
void MotionMaster::MoveKnockbackFrom(float srcX, float srcY, float speedXY, float speedZ)
{
//this function may make players fall below map
@@ -531,37 +596,6 @@ void MotionMaster::MoveFall(uint32 id /*=0*/)
Mutate(new EffectMovementGenerator(id), MOTION_SLOT_CONTROLLED);
}
-void MotionMaster::MoveCharge(float x, float y, float z, float speed /*= SPEED_CHARGE*/, uint32 id /*= EVENT_CHARGE*/, bool generatePath /*= false*/)
-{
- if (Impl[MOTION_SLOT_CONTROLLED] && Impl[MOTION_SLOT_CONTROLLED]->GetMovementGeneratorType() != DISTRACT_MOTION_TYPE)
- return;
-
- if (_owner->GetTypeId() == TYPEID_PLAYER)
- {
- TC_LOG_DEBUG("misc", "Player (GUID: %u) charged point (X: %f Y: %f Z: %f).", _owner->GetGUID().GetCounter(), x, y, z);
- Mutate(new PointMovementGenerator<Player>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
- }
- else
- {
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) charged point (X: %f Y: %f Z: %f).",
- _owner->GetEntry(), _owner->GetGUID().GetCounter(), x, y, z);
- Mutate(new PointMovementGenerator<Creature>(id, x, y, z, generatePath, speed), MOTION_SLOT_CONTROLLED);
- }
-}
-
-void MotionMaster::MoveCharge(PathGenerator const& path, float speed /*= SPEED_CHARGE*/)
-{
- G3D::Vector3 dest = path.GetActualEndPosition();
-
- MoveCharge(dest.x, dest.y, dest.z, speed, EVENT_CHARGE_PREPATH);
-
- // Charge movement is not started when using EVENT_CHARGE_PREPATH
- Movement::MoveSplineInit init(_owner);
- init.MovebyPath(path.GetPath());
- init.SetVelocity(speed);
- init.Launch();
-}
-
void MotionMaster::MoveSeekAssistance(float x, float y, float z)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
@@ -593,32 +627,6 @@ void MotionMaster::MoveSeekAssistanceDistract(uint32 time)
}
}
-void MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
-{
- if (!enemy)
- return;
-
- if (_owner->GetTypeId() == TYPEID_PLAYER)
- {
- TC_LOG_DEBUG("misc", "Player (GUID: %u) flees from %s (GUID: %u).", _owner->GetGUID().GetCounter(),
- enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
- enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUID().GetCounter() : enemy->ToCreature()->GetSpawnId());
- Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
- }
- else
- {
- TC_LOG_DEBUG("misc", "Creature (Entry: %u GUID: %u) flees from %s (GUID: %u)%s.",
- _owner->GetEntry(), _owner->GetGUID().GetCounter(),
- enemy->GetTypeId() == TYPEID_PLAYER ? "player" : "creature",
- enemy->GetTypeId() == TYPEID_PLAYER ? enemy->GetGUID().GetCounter() : enemy->ToCreature()->GetSpawnId(),
- time ? " for a limited time" : "");
- if (time)
- Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time), MOTION_SLOT_CONTROLLED);
- else
- Mutate(new FleeingMovementGenerator<Creature>(enemy->GetGUID()), MOTION_SLOT_CONTROLLED);
- }
-}
-
void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
{
if (_owner->GetTypeId() == TYPEID_PLAYER)
@@ -645,7 +653,7 @@ void MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
void MotionMaster::MoveDistract(uint32 timer)
{
- if (Impl[MOTION_SLOT_CONTROLLED])
+ if (_slot[MOTION_SLOT_CONTROLLED])
return;
if (_owner->GetTypeId() == TYPEID_PLAYER)
@@ -662,11 +670,56 @@ void MotionMaster::MoveDistract(uint32 timer)
Mutate(mgen, MOTION_SLOT_CONTROLLED);
}
+void MotionMaster::MovePath(uint32 path_id, bool repeatable)
+{
+ if (!path_id)
+ return;
+
+ Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
+
+ TC_LOG_DEBUG("misc", "%s (GUID: %u) starts moving over path(Id:%u, repeatable: %s).",
+ _owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
+ _owner->GetGUID().GetCounter(), path_id, repeatable ? "YES" : "NO");
+}
+
+void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
+{
+ if (!time)
+ return;
+
+ Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE);
+}
+
+/******************** Private methods ********************/
+
+void MotionMaster::pop()
+{
+ if (empty())
+ return;
+
+ _slot[_top] = nullptr;
+ while (!empty() && !top())
+ --_top;
+}
+
+bool MotionMaster::NeedInitTop() const
+{
+ if (empty())
+ return false;
+ return _initialize[_top];
+}
+
+void MotionMaster::InitTop()
+{
+ top()->Initialize(_owner);
+ _initialize[_top] = false;
+}
+
void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot)
{
- if (MovementGenerator *curr = Impl[slot])
+ if (MovementGenerator *curr = _slot[slot])
{
- Impl[slot] = NULL; // in case a new one is generated in this slot during directdelete
+ _slot[slot] = nullptr; // in case a new one is generated in this slot during directdelete
if (_top == slot && (_cleanFlag & MMCF_UPDATE))
DelayedDelete(curr);
else
@@ -677,110 +730,92 @@ void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot)
_top = slot;
}
- Impl[slot] = m;
+ _slot[slot] = m;
if (_top > slot)
- _needInit[slot] = true;
+ _initialize[slot] = true;
else
{
- _needInit[slot] = false;
+ _initialize[slot] = false;
m->Initialize(_owner);
}
}
-void MotionMaster::MovePath(uint32 path_id, bool repeatable)
+void MotionMaster::DirectClean(bool reset)
{
- if (!path_id)
- return;
- //We set waypoint movement as new default movement generator
- // clear ALL movement generators (including default)
- /*while (!empty())
+ while (size() > 1)
{
MovementGenerator *curr = top();
- curr->Finalize(*_owner);
pop();
- if (!isStatic(curr))
- delete curr;
- }*/
-
- //_owner->GetTypeId() == TYPEID_PLAYER ?
- //Mutate(new WaypointMovementGenerator<Player>(path_id, repeatable)):
- Mutate(new WaypointMovementGenerator<Creature>(path_id, repeatable), MOTION_SLOT_IDLE);
-
- TC_LOG_DEBUG("misc", "%s (GUID: %u) starts moving over path(Id:%u, repeatable: %s).",
- _owner->GetTypeId() == TYPEID_PLAYER ? "Player" : "Creature",
- _owner->GetGUID().GetCounter(), path_id, repeatable ? "YES" : "NO");
-}
+ if (curr) DirectDelete(curr);
+ }
-void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
-{
- if (!time)
+ if (empty())
return;
- Mutate(new RotateMovementGenerator(time, direction), MOTION_SLOT_ACTIVE);
+ if (NeedInitTop())
+ InitTop();
+ else if (reset)
+ top()->Reset(_owner);
}
-void MotionMaster::propagateSpeedChange()
+void MotionMaster::DelayedClean()
{
- /*Impl::container_type::iterator it = Impl::c.begin();
- for (; it != end(); ++it)
- {
- (*it)->unitSpeedChanged();
- }*/
- for (int i = 0; i <= _top; ++i)
+ while (size() > 1)
{
- if (Impl[i])
- Impl[i]->unitSpeedChanged();
+ MovementGenerator *curr = top();
+ pop();
+ if (curr)
+ DelayedDelete(curr);
}
}
-MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType() const
+void MotionMaster::DirectExpire(bool reset)
{
- if (empty())
- return IDLE_MOTION_TYPE;
+ if (size() > 1)
+ {
+ MovementGenerator *curr = top();
+ pop();
+ DirectDelete(curr);
+ }
- return top()->GetMovementGeneratorType();
-}
+ while (!empty() && !top())
+ --_top;
-MovementGeneratorType MotionMaster::GetMotionSlotType(int slot) const
-{
- if (!Impl[slot])
- return NULL_MOTION_TYPE;
- else
- return Impl[slot]->GetMovementGeneratorType();
+ if (empty())
+ Initialize();
+ else if (NeedInitTop())
+ InitTop();
+ else if (reset)
+ top()->Reset(_owner);
}
-void MotionMaster::InitTop()
+void MotionMaster::DelayedExpire()
{
- top()->Initialize(_owner);
- _needInit[_top] = false;
+ if (size() > 1)
+ {
+ MovementGenerator *curr = top();
+ pop();
+ DelayedDelete(curr);
+ }
+
+ while (!empty() && !top())
+ --_top;
}
-void MotionMaster::DirectDelete(_Ty curr)
+void MotionMaster::DirectDelete(MovementGenerator* curr)
{
- if (isStatic(curr))
+ if (IsStatic(curr))
return;
curr->Finalize(_owner);
delete curr;
}
-void MotionMaster::DelayedDelete(_Ty curr)
+void MotionMaster::DelayedDelete(MovementGenerator* curr)
{
TC_LOG_FATAL("misc", "Unit (Entry %u) is trying to delete its updating Movement Generator (Type %u)!", _owner->GetEntry(), curr->GetMovementGeneratorType());
- if (isStatic(curr))
+ if (IsStatic(curr))
return;
- if (!_expList)
- _expList = new ExpireList();
- _expList->push_back(curr);
-}
-
-bool MotionMaster::GetDestination(float &x, float &y, float &z)
-{
- if (_owner->movespline->Finalized())
- return false;
-
- G3D::Vector3 const& dest = _owner->movespline->FinalDestination();
- x = dest.x;
- y = dest.y;
- z = dest.z;
- return true;
+ if (!_expireList)
+ _expireList = new ExpireList();
+ _expireList->push_back(curr);
}
diff --git a/src/server/game/Movement/MotionMaster.h b/src/server/game/Movement/MotionMaster.h
index d376f6aa58f..0f46f42e08e 100644
--- a/src/server/game/Movement/MotionMaster.h
+++ b/src/server/game/Movement/MotionMaster.h
@@ -16,8 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef TRINITY_MOTIONMASTER_H
-#define TRINITY_MOTIONMASTER_H
+#ifndef MOTIONMASTER_H
+#define MOTIONMASTER_H
#include "Common.h"
#include <vector>
@@ -32,31 +32,32 @@ class PathGenerator;
// Creature Entry ID used for waypoints show, visible only for GMs
#define VISUAL_WAYPOINT 1
+// assume it is 25 yard per 0.6 second
+#define SPEED_CHARGE 42.0f
-// values 0 ... MAX_DB_MOTION_TYPE-1 used in DB
enum MovementGeneratorType
{
- IDLE_MOTION_TYPE = 0, // IdleMovementGenerator.h
- RANDOM_MOTION_TYPE = 1, // RandomMovementGenerator.h
- WAYPOINT_MOTION_TYPE = 2, // WaypointMovementGenerator.h
- MAX_DB_MOTION_TYPE = 3, // *** this and below motion types can't be set in DB.
- ANIMAL_RANDOM_MOTION_TYPE = MAX_DB_MOTION_TYPE, // AnimalRandomMovementGenerator.h
- CONFUSED_MOTION_TYPE = 4, // ConfusedMovementGenerator.h
- CHASE_MOTION_TYPE = 5, // TargetedMovementGenerator.h
- HOME_MOTION_TYPE = 6, // HomeMovementGenerator.h
- FLIGHT_MOTION_TYPE = 7, // WaypointMovementGenerator.h
- POINT_MOTION_TYPE = 8, // PointMovementGenerator.h
- FLEEING_MOTION_TYPE = 9, // FleeingMovementGenerator.h
- DISTRACT_MOTION_TYPE = 10, // IdleMovementGenerator.h
- ASSISTANCE_MOTION_TYPE= 11, // PointMovementGenerator.h (first part of flee for assistance)
- ASSISTANCE_DISTRACT_MOTION_TYPE = 12, // IdleMovementGenerator.h (second part of flee for assistance)
- TIMED_FLEEING_MOTION_TYPE = 13, // FleeingMovementGenerator.h (alt.second part of flee for assistance)
- FOLLOW_MOTION_TYPE = 14,
- ROTATE_MOTION_TYPE = 15,
- EFFECT_MOTION_TYPE = 16,
- NULL_MOTION_TYPE = 17,
- SPLINE_CHAIN_MOTION_TYPE = 18, // SplineChainMovementGenerator.h
- MAX_MOTION_TYPE // limit
+ IDLE_MOTION_TYPE = 0, // IdleMovementGenerator.h
+ RANDOM_MOTION_TYPE = 1, // RandomMovementGenerator.h
+ WAYPOINT_MOTION_TYPE = 2, // WaypointMovementGenerator.h
+ MAX_DB_MOTION_TYPE = 3, // Below motion types can't be set in DB.
+ ANIMAL_RANDOM_MOTION_TYPE = MAX_DB_MOTION_TYPE, // AnimalRandomMovementGenerator.h
+ CONFUSED_MOTION_TYPE = 4, // ConfusedMovementGenerator.h
+ CHASE_MOTION_TYPE = 5, // TargetedMovementGenerator.h
+ HOME_MOTION_TYPE = 6, // HomeMovementGenerator.h
+ FLIGHT_MOTION_TYPE = 7, // WaypointMovementGenerator.h
+ POINT_MOTION_TYPE = 8, // PointMovementGenerator.h
+ FLEEING_MOTION_TYPE = 9, // FleeingMovementGenerator.h
+ DISTRACT_MOTION_TYPE = 10, // IdleMovementGenerator.h
+ ASSISTANCE_MOTION_TYPE = 11, // PointMovementGenerator.h (first part of flee for assistance)
+ ASSISTANCE_DISTRACT_MOTION_TYPE = 12, // IdleMovementGenerator.h (second part of flee for assistance)
+ TIMED_FLEEING_MOTION_TYPE = 13, // FleeingMovementGenerator.h (alt.second part of flee for assistance)
+ FOLLOW_MOTION_TYPE = 14,
+ ROTATE_MOTION_TYPE = 15,
+ EFFECT_MOTION_TYPE = 16,
+ NULL_MOTION_TYPE = 17,
+ SPLINE_CHAIN_MOTION_TYPE = 18, // SplineChainMovementGenerator.h
+ MAX_MOTION_TYPE // limit
};
enum MovementSlot
@@ -80,91 +81,41 @@ enum RotateDirection
ROTATE_DIRECTION_RIGHT
};
-// assume it is 25 yard per 0.6 second
-#define SPEED_CHARGE 42.0f
-
-class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *>
+class TC_GAME_API MotionMaster
{
private:
- //typedef std::stack<MovementGenerator *> Impl;
- typedef MovementGenerator* _Ty;
-
- void pop()
- {
- if (empty())
- return;
+ typedef std::vector<MovementGenerator*> ExpireList;
- Impl[_top] = NULL;
- while (!empty() && !top())
- --_top;
- }
- void push(_Ty _Val) { ++_top; Impl[_top] = _Val; }
-
- bool needInitTop() const
- {
- if (empty())
- return false;
- return _needInit[_top];
- }
- void InitTop();
public:
-
- explicit MotionMaster(Unit* unit) : _expList(NULL), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
+ explicit MotionMaster(Unit* unit) : _expireList(nullptr), _top(-1), _owner(unit), _cleanFlag(MMCF_NONE)
{
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
{
- Impl[i] = NULL;
- _needInit[i] = true;
+ _slot[i] = nullptr;
+ _initialize[i] = true;
}
}
~MotionMaster();
- void Initialize();
- void InitDefault();
-
bool empty() const { return (_top < 0); }
int size() const { return _top + 1; }
- _Ty top() const
- {
- ASSERT(!empty());
- return Impl[_top];
- }
- _Ty GetMotionSlot(int slot) const
- {
- ASSERT(slot >= 0);
- return Impl[slot];
- }
+ MovementGenerator* top() const { ASSERT(!empty()); return _slot[_top]; }
- void DirectDelete(_Ty curr);
- void DelayedDelete(_Ty curr);
+ void Initialize();
+ void InitDefault();
void UpdateMotion(uint32 diff);
- void Clear(bool reset = true)
- {
- if (_cleanFlag & MMCF_UPDATE)
- {
- if (reset)
- _cleanFlag |= MMCF_RESET;
- else
- _cleanFlag &= ~MMCF_RESET;
- DelayedClean();
- }
- else
- DirectClean(reset);
- }
- void MovementExpired(bool reset = true)
- {
- if (_cleanFlag & MMCF_UPDATE)
- {
- if (reset)
- _cleanFlag |= MMCF_RESET;
- else
- _cleanFlag &= ~MMCF_RESET;
- DelayedExpire();
- }
- else
- DirectExpire(reset);
- }
+
+ void Clear(bool reset = true);
+ void MovementExpired(bool reset = true);
+
+ MovementGeneratorType GetCurrentMovementGeneratorType() const;
+ MovementGeneratorType GetMotionSlotType(int slot) const;
+ MovementGenerator* GetMotionSlot(int slot) const;
+
+ void propagateSpeedChange();
+
+ bool GetDestination(float &x, float &y, float &z);
void MoveIdle();
void MoveTargetedHome();
@@ -174,7 +125,9 @@ class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *>
void MoveConfused();
void MoveFleeing(Unit* enemy, uint32 time = 0);
void MovePoint(uint32 id, Position const& pos, bool generatePath = true)
- { MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath); }
+ {
+ MovePoint(id, pos.m_positionX, pos.m_positionY, pos.m_positionZ, generatePath);
+ }
void MovePoint(uint32 id, float x, float y, float z, bool generatePath = true);
/* Makes the unit move toward the target until it is at a certain distance from it. The unit then stops.
@@ -212,27 +165,27 @@ class TC_GAME_API MotionMaster //: private std::stack<MovementGenerator *>
void MovePath(uint32 path_id, bool repeatable);
void MoveRotate(uint32 time, RotateDirection direction);
- MovementGeneratorType GetCurrentMovementGeneratorType() const;
- MovementGeneratorType GetMotionSlotType(int slot) const;
+ private:
+ void pop();
- void propagateSpeedChange();
+ bool NeedInitTop() const;
+ void InitTop();
- bool GetDestination(float &x, float &y, float &z);
- private:
- void Mutate(MovementGenerator *m, MovementSlot slot); // use Move* functions instead
+ void Mutate(MovementGenerator *m, MovementSlot slot);
void DirectClean(bool reset);
void DelayedClean();
-
void DirectExpire(bool reset);
void DelayedExpire();
+ void DirectDelete(MovementGenerator* curr);
+ void DelayedDelete(MovementGenerator* curr);
- typedef std::vector<_Ty> ExpireList;
- ExpireList* _expList;
- _Ty Impl[MAX_MOTION_SLOT];
+ ExpireList* _expireList;
+ MovementGenerator* _slot[MAX_MOTION_SLOT];
int _top;
Unit* _owner;
- bool _needInit[MAX_MOTION_SLOT];
+ bool _initialize[MAX_MOTION_SLOT];
uint8 _cleanFlag;
};
-#endif
+
+#endif // MOTIONMASTER_H
diff --git a/src/server/game/Scripting/ScriptMgr.cpp b/src/server/game/Scripting/ScriptMgr.cpp
index 2737c852d98..b9357d60967 100644
--- a/src/server/game/Scripting/ScriptMgr.cpp
+++ b/src/server/game/Scripting/ScriptMgr.cpp
@@ -1202,12 +1202,11 @@ void ScriptMgr::FillSpellSummary()
}
}
-template<typename T, typename F>
-void CreateSpellOrAuraScripts(uint32 spellId, std::list<T*>& scriptVector, F&& extractor)
+template<typename T, typename F, typename O>
+void CreateSpellOrAuraScripts(uint32 spellId, std::vector<T*>& scriptVector, F&& extractor, O* objectInvoker)
{
SpellScriptsBounds bounds = sObjectMgr->GetSpellScriptsBounds(spellId);
-
- for (SpellScriptsContainer::iterator itr = bounds.first; itr != bounds.second; ++itr)
+ for (auto itr = bounds.first; itr != bounds.second; ++itr)
{
// When the script is disabled continue with the next one
if (!itr->second.second)
@@ -1218,24 +1217,28 @@ void CreateSpellOrAuraScripts(uint32 spellId, std::list<T*>& scriptVector, F&& e
continue;
T* script = (*tmpscript.*extractor)();
-
if (!script)
continue;
script->_Init(&tmpscript->GetName(), spellId);
+ if (!script->_Load(objectInvoker))
+ {
+ delete script;
+ continue;
+ }
scriptVector.push_back(script);
}
}
-void ScriptMgr::CreateSpellScripts(uint32 spellId, std::list<SpellScript*>& scriptVector)
+void ScriptMgr::CreateSpellScripts(uint32 spellId, std::vector<SpellScript*>& scriptVector, Spell* invoker) const
{
- CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetSpellScript);
+ CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetSpellScript, invoker);
}
-void ScriptMgr::CreateAuraScripts(uint32 spellId, std::list<AuraScript*>& scriptVector)
+void ScriptMgr::CreateAuraScripts(uint32 spellId, std::vector<AuraScript*>& scriptVector, Aura* invoker) const
{
- CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetAuraScript);
+ CreateSpellOrAuraScripts(spellId, scriptVector, &SpellScriptLoader::GetAuraScript, invoker);
}
SpellScriptLoader* ScriptMgr::GetSpellScriptLoader(uint32 scriptId)
diff --git a/src/server/game/Scripting/ScriptMgr.h b/src/server/game/Scripting/ScriptMgr.h
index a6cce299645..22a84804089 100644
--- a/src/server/game/Scripting/ScriptMgr.h
+++ b/src/server/game/Scripting/ScriptMgr.h
@@ -29,6 +29,7 @@
class AccountMgr;
class AuctionHouseObject;
+class Aura;
class AuraScript;
class Battleground;
class BattlegroundMap;
@@ -896,8 +897,8 @@ class TC_GAME_API ScriptMgr
public: /* SpellScriptLoader */
- void CreateSpellScripts(uint32 spellId, std::list<SpellScript*>& scriptVector);
- void CreateAuraScripts(uint32 spellId, std::list<AuraScript*>& scriptVector);
+ void CreateSpellScripts(uint32 spellId, std::vector<SpellScript*>& scriptVector, Spell* invoker) const;
+ void CreateAuraScripts(uint32 spellId, std::vector<AuraScript*>& scriptVector, Aura* invoker) const;
SpellScriptLoader* GetSpellScriptLoader(uint32 scriptId);
public: /* ServerScript */
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 997c2904e9e..2b4e2e4177d 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -204,7 +204,7 @@ pAuraEffectHandler AuraEffectHandler[TOTAL_AURAS]=
&AuraEffect::HandleNoImmediateEffect, //144 SPELL_AURA_SAFE_FALL implemented in WorldSession::HandleMovementOpcodes
&AuraEffect::HandleAuraModPetTalentsPoints, //145 SPELL_AURA_MOD_PET_TALENT_POINTS
&AuraEffect::HandleNoImmediateEffect, //146 SPELL_AURA_ALLOW_TAME_PET_TYPE
- &AuraEffect::HandleModStateImmunityMask, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK
+ &AuraEffect::HandleModMechanicImmunityMask, //147 SPELL_AURA_MECHANIC_IMMUNITY_MASK
&AuraEffect::HandleAuraRetainComboPoints, //148 SPELL_AURA_RETAIN_COMBO_POINTS
&AuraEffect::HandleNoImmediateEffect, //149 SPELL_AURA_REDUCE_PUSHBACK
&AuraEffect::HandleShieldBlockValue, //150 SPELL_AURA_MOD_SHIELD_BLOCKVALUE_PCT
@@ -890,14 +890,12 @@ bool AuraEffect::IsAffectedOnSpell(SpellInfo const* spell) const
{
if (!spell)
return false;
- // Check family name
- if (spell->SpellFamilyName != m_spellInfo->SpellFamilyName)
+
+ // Check family name and EffectClassMask
+ if (!spell->IsAffected(m_spellInfo->SpellFamilyName, m_spellInfo->Effects[m_effIndex].SpellClassMask))
return false;
- // Check EffectClassMask
- if (m_spellInfo->Effects[m_effIndex].SpellClassMask & spell->SpellFamilyFlags)
- return true;
- return false;
+ return true;
}
void AuraEffect::SendTickImmune(Unit* target, Unit* caster) const
@@ -976,15 +974,12 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn
return false;
// Spell own damage at apply won't break CC
- if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
+ if (spellInfo && spellInfo == GetSpellInfo())
{
- if (spellInfo == GetSpellInfo())
- {
- Aura* aura = GetBase();
- // called from spellcast, should not have ticked yet
- if (aura->GetDuration() == aura->GetMaxDuration())
- return false;
- }
+ Aura* aura = GetBase();
+ // called from spellcast, should not have ticked yet
+ if (aura->GetDuration() == aura->GetMaxDuration())
+ return false;
}
break;
}
@@ -1176,15 +1171,15 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (apply)
{
if (spellId)
- target->CastSpell(target, spellId, true, NULL, this);
+ target->CastSpell(target, spellId, true, nullptr, this);
if (spellId2)
- target->CastSpell(target, spellId2, true, NULL, this);
+ target->CastSpell(target, spellId2, true, nullptr, this);
if (target->GetTypeId() == TYPEID_PLAYER)
{
- const PlayerSpellMap& sp_list = target->ToPlayer()->GetSpellMap();
- for (PlayerSpellMap::const_iterator itr = sp_list.begin(); itr != sp_list.end(); ++itr)
+ PlayerSpellMap const& sp_list = target->ToPlayer()->GetSpellMap();
+ for (auto itr = sp_list.begin(); itr != sp_list.end(); ++itr)
{
if (itr->second->state == PLAYERSPELL_REMOVED || itr->second->disabled)
continue;
@@ -1197,7 +1192,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
continue;
if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
- target->CastSpell(target, itr->first, true, NULL, this);
+ target->CastSpell(target, itr->first, true, nullptr, this);
}
// Also do it for Glyphs
@@ -1212,7 +1207,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
continue;
if (spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
- target->CastSpell(target, glyph->SpellId, true, NULL, this);
+ target->CastSpell(target, glyph->SpellId, true, nullptr, this);
}
}
}
@@ -1222,7 +1217,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(24932);
if (spellInfo && spellInfo->Stances & (UI64LIT(1) << (GetMiscValue() - 1)))
- target->CastSpell(target, 24932, true, NULL, this);
+ target->CastSpell(target, 24932, true, nullptr, this);
}
// Improved Barkskin - apply/remove armor bonus due to shapeshift
if (target->ToPlayer()->HasSpell(63410) || target->ToPlayer()->HasSpell(63411))
@@ -1235,14 +1230,14 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (HotWSpellId)
{ // hacky, but the only way as spell family is not SPELLFAMILY_DRUID
Unit::AuraEffectList const& mModTotalStatPct = target->GetAuraEffectsByType(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE);
- for (Unit::AuraEffectList::const_iterator i = mModTotalStatPct.begin(); i != mModTotalStatPct.end(); ++i)
+ for (AuraEffect const* aurEff : mModTotalStatPct)
{
// Heart of the Wild
- if ((*i)->GetSpellInfo()->SpellIconID == 240 && (*i)->GetMiscValue() == 3)
+ if (aurEff->GetSpellInfo()->SpellIconID == 240 && aurEff->GetMiscValue() == 3)
{
- int32 HotWMod = (*i)->GetAmount() / 2; // For each 2% Intelligence, you get 1% stamina and 1% attack power.
+ int32 HotWMod = aurEff->GetAmount() / 2; // For each 2% Intelligence, you get 1% stamina and 1% attack power.
- target->CastCustomSpell(target, HotWSpellId, &HotWMod, NULL, NULL, true, NULL, this);
+ target->CastCustomSpell(HotWSpellId, SPELLVALUE_BASE_POINT0, HotWMod, target, true, nullptr, this);
break;
}
}
@@ -1266,13 +1261,13 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
spellId3 = 47180;
break;
}
- target->CastSpell(target, spellId3, true, NULL, this);
+ target->CastSpell(target, spellId3, true, nullptr, this);
}
// Master Shapeshifter - Cat
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
{
int32 bp = aurEff->GetAmount();
- target->CastCustomSpell(target, 48420, &bp, NULL, NULL, true);
+ target->CastCustomSpell(48420, SPELLVALUE_BASE_POINT0, bp, target, true);
}
break;
case FORM_DIREBEAR:
@@ -1281,13 +1276,13 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
{
int32 bp = aurEff->GetAmount();
- target->CastCustomSpell(target, 48418, &bp, NULL, NULL, true);
+ target->CastCustomSpell(48418, SPELLVALUE_BASE_POINT0, bp, target, true);
}
// Survival of the Fittest
if (AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_TOTAL_STAT_PERCENTAGE, SPELLFAMILY_DRUID, 961, 0))
{
int32 bp = aurEff->GetSpellInfo()->Effects[EFFECT_2].CalcValue();
- target->CastCustomSpell(target, 62069, &bp, NULL, NULL, true, 0, this);
+ target->CastCustomSpell(62069, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, this);
}
break;
case FORM_MOONKIN:
@@ -1295,7 +1290,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
{
int32 bp = aurEff->GetAmount();
- target->CastCustomSpell(target, 48421, &bp, NULL, NULL, true);
+ target->CastCustomSpell(48421, SPELLVALUE_BASE_POINT0, bp, target, true);
}
break;
// Master Shapeshifter - Tree of Life
@@ -1303,7 +1298,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
if (AuraEffect const* aurEff = target->GetDummyAuraEffect(SPELLFAMILY_GENERIC, 2851, 0))
{
int32 bp = aurEff->GetAmount();
- target->CastCustomSpell(target, 48422, &bp, NULL, NULL, true);
+ target->CastCustomSpell(48422, SPELLVALUE_BASE_POINT0, bp, target, true);
}
break;
}
@@ -1317,7 +1312,7 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
target->RemoveOwnedAura(spellId2, target->GetGUID());
// Improved Barkskin - apply/remove armor bonus due to shapeshift
- if (Player* player=target->ToPlayer())
+ if (Player* player = target->ToPlayer())
{
if (player->HasSpell(63410) || player->HasSpell(63411))
{
@@ -1326,19 +1321,20 @@ void AuraEffect::HandleShapeshiftBoosts(Unit* target, bool apply) const
}
}
- const Unit::AuraEffectList& shapeshifts = target->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT);
- AuraEffect* newAura = NULL;
+ Unit::AuraEffectList const& shapeshifts = target->GetAuraEffectsByType(SPELL_AURA_MOD_SHAPESHIFT);
+ AuraEffect const* newAura = nullptr;
// Iterate through all the shapeshift auras that the target has, if there is another aura with SPELL_AURA_MOD_SHAPESHIFT, then this aura is being removed due to that one being applied
- for (Unit::AuraEffectList::const_iterator itr = shapeshifts.begin(); itr != shapeshifts.end(); ++itr)
+ for (AuraEffect const* aurEff : shapeshifts)
{
- if ((*itr) != this)
+ if (aurEff != this)
{
- newAura = *itr;
+ newAura = aurEff;
break;
}
}
+
Unit::AuraApplicationMap& tAuras = target->GetAppliedAuras();
- for (Unit::AuraApplicationMap::iterator itr = tAuras.begin(); itr != tAuras.end();)
+ for (auto itr = tAuras.begin(); itr != tAuras.end();)
{
// Use the new aura to see on what stance the target will be
uint64 newStance = newAura ? (UI64LIT(1) << (newAura->GetMiscValue() - 1)) : 0;
@@ -1779,7 +1775,12 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
if (aurApp->GetRemoveMode())
return;
+ ShapeshiftForm prevForm = target->GetShapeshiftForm();
target->SetShapeshiftForm(form);
+ // add the shapeshift aura's boosts
+ if (prevForm != form)
+ HandleShapeshiftBoosts(target, true);
+
if (modelid > 0)
{
SpellInfo const* transformSpellInfo = sSpellMgr->GetSpellInfo(target->getTransForm());
@@ -1851,11 +1852,10 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
default:
break;
}
- }
- // adding/removing linked auras
- // add/remove the shapeshift aura's boosts
- HandleShapeshiftBoosts(target, apply);
+ // remove the shapeshift aura's boosts
+ HandleShapeshiftBoosts(target, false);
+ }
if (target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->InitDataForForm();
@@ -2307,11 +2307,9 @@ void AuraEffect::HandleAuraModDisarm(AuraApplication const* aurApp, uint8 mode,
{
uint8 attacktype = Player::GetAttackBySlot(slot);
+ player->ApplyItemDependentAuras(item, !apply);
if (attacktype < MAX_ATTACK)
- {
player->_ApplyWeaponDamage(slot, item->GetTemplate(), NULL, !apply);
- player->_ApplyWeaponDependentAuraMods(item, WeaponAttackType(attacktype), !apply);
- }
}
}
@@ -3069,249 +3067,13 @@ void AuraEffect::HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint
/*** IMMUNITY ***/
/*********************************************************/
-void AuraEffect::HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const
+void AuraEffect::HandleModMechanicImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const
{
if (!(mode & AURA_EFFECT_HANDLE_REAL))
return;
Unit* target = aurApp->GetTarget();
- std::list <AuraType> aura_immunity_list;
- uint32 mechanic_immunity_list = 0;
- int32 miscVal = GetMiscValue();
-
- switch (miscVal)
- {
- case 27:
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SILENCE, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_SILENCE);
- break;
- case 96:
- case 1615:
- {
- if (GetAmount())
- {
- mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
- | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
- | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
- | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
- | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED)
- | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
-
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
- aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
- aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
- }
- break;
- }
- case 679:
- {
- if (GetId() == 57742)
- {
- mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
- | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
- | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
- | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
- | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED)
- | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
-
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
- aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
- aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
- }
- break;
- }
- case 1557:
- {
- if (GetId() == 64187)
- {
- mechanic_immunity_list = (1 << MECHANIC_STUN);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- }
- else
- {
- mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
- | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
- | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
- | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
- | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED)
- | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
-
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
- aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
- aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
- }
- break;
- }
- case 1614:
- case 1694:
- {
- target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
- break;
- }
- case 1630:
- {
- if (!GetAmount())
- {
- target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_TAUNT);
- }
- else
- {
- mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
- | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
- | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
- | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
- | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED)
- | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
-
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
- aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
- aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
- }
- break;
- }
- case 477:
- case 1733:
- {
- if (!GetAmount())
- {
- mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT)
- | (1 << MECHANIC_FEAR) | (1 << MECHANIC_STUN)
- | (1 << MECHANIC_SLEEP) | (1 << MECHANIC_CHARM)
- | (1 << MECHANIC_SAPPED) | (1 << MECHANIC_HORROR)
- | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_DISORIENTED)
- | (1 << MECHANIC_FREEZE) | (1 << MECHANIC_TURN);
-
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK_DEST, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
- aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
- aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
- }
- break;
- }
- case 878:
- {
- if (GetAmount() == 1)
- {
- mechanic_immunity_list = (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN)
- | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE);
-
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- }
- break;
- }
- default:
- break;
- }
-
- if (aura_immunity_list.empty())
- {
- if (miscVal & (1<<10))
- aura_immunity_list.push_back(SPELL_AURA_MOD_STUN);
- if (miscVal & (1<<1))
- aura_immunity_list.push_back(SPELL_AURA_TRANSFORM);
-
- // These flag can be recognized wrong:
- if (miscVal & (1<<6))
- aura_immunity_list.push_back(SPELL_AURA_MOD_DECREASE_SPEED);
- if (miscVal & (1<<0))
- aura_immunity_list.push_back(SPELL_AURA_MOD_ROOT);
- if (miscVal & (1<<2))
- aura_immunity_list.push_back(SPELL_AURA_MOD_CONFUSE);
- if (miscVal & (1<<9))
- aura_immunity_list.push_back(SPELL_AURA_MOD_FEAR);
- if (miscVal & (1<<7))
- aura_immunity_list.push_back(SPELL_AURA_MOD_DISARM);
- }
-
- // apply immunities
- for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
- target->ApplySpellImmune(GetId(), IMMUNITY_STATE, *iter, apply);
-
- if (apply && GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
- {
- target->RemoveAurasWithMechanic(mechanic_immunity_list, AURA_REMOVE_BY_DEFAULT, GetId());
- for (std::list <AuraType>::iterator iter = aura_immunity_list.begin(); iter != aura_immunity_list.end(); ++iter)
- target->RemoveAurasByType(*iter);
- }
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
}
void AuraEffect::HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3320,52 +3082,7 @@ void AuraEffect::HandleModMechanicImmunity(AuraApplication const* aurApp, uint8
return;
Unit* target = aurApp->GetTarget();
- uint32 mechanic;
-
- switch (GetId())
- {
- case 34471: // The Beast Within
- case 19574: // Bestial Wrath
- mechanic = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_KNOCKOUT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_BANISH, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SHACKLE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_DAZE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
- break;
- case 42292: // PvP trinket
- case 59752: // Every Man for Himself
- case 53490: // Bullheaded
- mechanic = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
- // Actually we should apply immunities here, too, but the aura has only 100 ms duration, so there is practically no point
- break;
- case 54508: // Demonic Empowerment
- mechanic = (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
- break;
- default:
- if (GetMiscValue() < 1)
- return;
- mechanic = 1 << GetMiscValue();
- target->ApplySpellImmune(GetId(), IMMUNITY_MECHANIC, GetMiscValue(), apply);
- break;
- }
-
- if (apply && GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
- target->RemoveAurasWithMechanic(mechanic, AURA_REMOVE_BY_DEFAULT, GetId());
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
}
void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3374,8 +3091,7 @@ void AuraEffect::HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint
return;
Unit* target = aurApp->GetTarget();
-
- target->ApplySpellImmune(GetId(), IMMUNITY_EFFECT, GetMiscValue(), apply);
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
// when removing flag aura, handle flag drop
Player* player = target->ToPlayer();
@@ -3397,11 +3113,7 @@ void AuraEffect::HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8
return;
Unit* target = aurApp->GetTarget();
-
- target->ApplySpellImmune(GetId(), IMMUNITY_STATE, GetMiscValue(), apply);
-
- if (apply && GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
- target->RemoveAurasByType(AuraType(GetMiscValue()), ObjectGuid::Empty, GetBase());
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
}
void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3410,8 +3122,7 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
return;
Unit* target = aurApp->GetTarget();
-
- target->ApplySpellImmune(GetId(), IMMUNITY_SCHOOL, GetMiscValue(), (apply));
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
if (GetSpellInfo()->Mechanic == MECHANIC_BANISH)
{
@@ -3421,12 +3132,15 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
{
bool banishFound = false;
Unit::AuraEffectList const& banishAuras = target->GetAuraEffectsByType(GetAuraType());
- for (Unit::AuraEffectList::const_iterator i = banishAuras.begin(); i != banishAuras.end(); ++i)
- if ((*i)->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
+ for (AuraEffect const* aurEff : banishAuras)
+ {
+ if (aurEff->GetSpellInfo()->Mechanic == MECHANIC_BANISH)
{
banishFound = true;
break;
}
+ }
+
if (!banishFound)
target->ClearUnitState(UNIT_STATE_ISOLATED);
}
@@ -3439,23 +3153,6 @@ void AuraEffect::HandleAuraModSchoolImmunity(AuraApplication const* aurApp, uint
if (GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
&& GetSpellInfo()->HasAttribute(SPELL_ATTR2_DAMAGE_REDUCED_SHIELD))
target->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_IMMUNE_OR_LOST_SELECTION);
-
- /// @todo optimalize this cycle - use RemoveAurasWithInterruptFlags call or something else
- if (apply
- && GetSpellInfo()->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY)
- && GetSpellInfo()->IsPositive()) // Only positive immunity removes auras
- {
- uint32 schoolMask = GetMiscValue();
- target->RemoveAppliedAuras([this, schoolMask](AuraApplication const* aurApp)
- {
- SpellInfo const* spell = aurApp->GetBase()->GetSpellInfo();
- return (spell->GetSchoolMask() & schoolMask) // Check for school mask
- && GetSpellInfo()->CanDispelAura(spell)
- && !aurApp->IsPositive() // Don't remove positive spells
- && !spell->IsPassive() // Don't remove passive auras
- && spell->Id != GetId(); // Don't remove self
- });
- }
}
void AuraEffect::HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3464,8 +3161,7 @@ void AuraEffect::HandleAuraModDmgImmunity(AuraApplication const* aurApp, uint8 m
return;
Unit* target = aurApp->GetTarget();
-
- target->ApplySpellImmune(GetId(), IMMUNITY_DAMAGE, GetMiscValue(), apply);
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
}
void AuraEffect::HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -3474,8 +3170,7 @@ void AuraEffect::HandleAuraModDispelImmunity(AuraApplication const* aurApp, uint
return;
Unit* target = aurApp->GetTarget();
-
- target->ApplySpellDispelImmunity(m_spellInfo, DispelType(GetMiscValue()), (apply));
+ m_spellInfo->ApplyAllSpellImmunitiesTo(target, GetEffIndex(), apply);
}
/*********************************************************/
@@ -4071,29 +3766,14 @@ void AuraEffect::HandleAuraModWeaponCritPercent(AuraApplication const* aurApp, u
if (!(mode & (AURA_EFFECT_HANDLE_CHANGE_AMOUNT_MASK | AURA_EFFECT_HANDLE_STAT)))
return;
- Unit* target = aurApp->GetTarget();
+ Player* target = aurApp->GetTarget()->ToPlayer();
- if (target->GetTypeId() != TYPEID_PLAYER)
+ if (!target)
return;
- for (int i = 0; i < MAX_ATTACK; ++i)
- if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true))
- target->ToPlayer()->_ApplyWeaponDependentAuraCritMod(pItem, WeaponAttackType(i), this, apply);
-
- // mods must be applied base at equipped weapon class and subclass comparison
- // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
- // GetMiscValue() comparison with item generated damage types
-
- if (GetSpellInfo()->EquippedItemClass == -1)
- {
- target->ToPlayer()->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
- target->ToPlayer()->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
- target->ToPlayer()->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float (GetAmount()), apply);
- }
- else
- {
- // done in Player::_ApplyWeaponDependentAuraMods
- }
+ target->HandleBaseModValue(CRIT_PERCENTAGE, FLAT_MOD, float(GetAmount()), apply);
+ target->HandleBaseModValue(OFFHAND_CRIT_PERCENTAGE, FLAT_MOD, float(GetAmount()), apply);
+ target->HandleBaseModValue(RANGED_CRIT_PERCENTAGE, FLAT_MOD, float(GetAmount()), apply);
}
void AuraEffect::HandleModHitChance(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -4394,6 +4074,7 @@ void AuraEffect::HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp,
if (target->GetTypeId() == TYPEID_PLAYER)
target->ToPlayer()->UpdateAttackPowerAndDamage(false);
}
+
/********************************/
/*** DAMAGE BONUS ***/
/********************************/
@@ -4404,79 +4085,22 @@ void AuraEffect::HandleModDamageDone(AuraApplication const* aurApp, uint8 mode,
Unit* target = aurApp->GetTarget();
- // apply item specific bonuses for already equipped weapon
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- for (int i = 0; i < MAX_ATTACK; ++i)
- if (Item* pItem = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), true))
- target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(pItem, WeaponAttackType(i), this, apply);
- }
-
- // GetMiscValue() is bitmask of spell schools
- // 1 (0-bit) - normal school damage (SPELL_SCHOOL_MASK_NORMAL)
- // 126 - full bitmask all magic damages (SPELL_SCHOOL_MASK_MAGIC) including wands
- // 127 - full bitmask any damages
- //
- // mods must be applied base at equipped weapon class and subclass comparison
- // with spell->EquippedItemClass and EquippedItemSubClassMask and EquippedItemInventoryTypeMask
- // GetMiscValue() comparison with item generated damage types
-
- if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) != 0)
- {
- // apply generic physical damage bonuses including wand case
- if (GetSpellInfo()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER)
- {
- target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(GetAmount()), apply);
- target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(GetAmount()), apply);
- target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(GetAmount()), apply);
-
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- if (GetAmount() > 0)
- target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS, GetAmount(), apply);
- else
- target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG, GetAmount(), apply);
- }
- }
- else
- {
- // done in Player::_ApplyWeaponDependentAuraMods
- }
- }
-
- // Skip non magic case for speedup
- if ((GetMiscValue() & SPELL_SCHOOL_MASK_MAGIC) == 0)
- return;
-
- if (GetSpellInfo()->EquippedItemClass != -1 || GetSpellInfo()->EquippedItemInventoryTypeMask != 0)
+ if (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
{
- // wand magic case (skip generic to all item spell bonuses)
- // done in Player::_ApplyWeaponDependentAuraMods
-
- // Skip item specific requirements for not wand magic damage
- return;
+ target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_VALUE, float(GetAmount()), apply);
+ target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_VALUE, float(GetAmount()), apply);
+ target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_VALUE, float(GetAmount()), apply);
}
- // Magic damage modifiers implemented in Unit::SpellDamageBonus
+ // Magic damage modifiers implemented in Unit::SpellBaseDamageBonusDone
// This information for client side use only
if (target->GetTypeId() == TYPEID_PLAYER)
{
- if (GetAmount() > 0)
- {
- for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
- {
- if ((GetMiscValue() & (1<<i)) != 0)
- target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS+i, GetAmount(), apply);
- }
- }
- else
- {
- for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; i++)
- {
- if ((GetMiscValue() & (1<<i)) != 0)
- target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i, GetAmount(), apply);
- }
- }
+ uint16 baseField = GetAmount() >= 0 ? PLAYER_FIELD_MOD_DAMAGE_DONE_POS : PLAYER_FIELD_MOD_DAMAGE_DONE_NEG;
+ for (uint16 i = 0; i < MAX_SPELL_SCHOOL; ++i)
+ if (GetMiscValue() & (1 << i))
+ target->ApplyModUInt32Value(baseField + i, GetAmount(), apply);
+
if (Guardian* pet = target->ToPlayer()->GetGuardianPet())
pet->UpdateAttackPowerAndDamage();
}
@@ -4492,14 +4116,7 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8
if (abs(spellGroupVal) >= abs(GetAmount()))
return;
- if (target->GetTypeId() == TYPEID_PLAYER)
- {
- for (int i = 0; i < MAX_ATTACK; ++i)
- if (Item* item = target->ToPlayer()->GetWeaponForAttack(WeaponAttackType(i), false))
- target->ToPlayer()->_ApplyWeaponDependentAuraDamageMod(item, WeaponAttackType(i), this, apply);
- }
-
- if ((GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL) && (GetSpellInfo()->EquippedItemClass == -1 || target->GetTypeId() != TYPEID_PLAYER))
+ if (GetMiscValue() & SPELL_SCHOOL_MASK_NORMAL)
{
if (spellGroupVal)
{
@@ -4507,22 +4124,25 @@ void AuraEffect::HandleModDamagePercentDone(AuraApplication const* aurApp, uint8
target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(spellGroupVal), !apply);
target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(spellGroupVal), !apply);
}
+
target->HandleStatModifier(UNIT_MOD_DAMAGE_MAINHAND, TOTAL_PCT, float(GetAmount()), apply);
target->HandleStatModifier(UNIT_MOD_DAMAGE_OFFHAND, TOTAL_PCT, float(GetAmount()), apply);
target->HandleStatModifier(UNIT_MOD_DAMAGE_RANGED, TOTAL_PCT, float(GetAmount()), apply);
+ }
- if (Player* player = target->ToPlayer())
+ if (target->GetTypeId() == TYPEID_PLAYER)
+ {
+ for (uint16 i = 0; i < MAX_SPELL_SCHOOL; ++i)
{
- if (spellGroupVal)
- player->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, float(spellGroupVal), !apply);
+ if (GetMiscValue() & (1 << i))
+ {
+ if (spellGroupVal)
+ target->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, float(spellGroupVal), !apply);
- player->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT, float(GetAmount()), apply);
+ target->ApplyPercentModFloatValue(PLAYER_FIELD_MOD_DAMAGE_DONE_PCT + i, float(GetAmount()), apply);
+ }
}
}
- else
- {
- // done in Player::_ApplyWeaponDependentAuraMods for SPELL_SCHOOL_MASK_NORMAL && EquippedItemClass != -1 and also for wand case
- }
}
void AuraEffect::HandleModOffhandDamagePercent(AuraApplication const* aurApp, uint8 mode, bool apply) const
@@ -5446,13 +5066,11 @@ void AuraEffect::HandlePeriodicDummyAuraTick(Unit* target, Unit* caster) const
{
// Master of Subtlety
case 31666:
- if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH))
- target->RemoveAurasDueToSpell(31665);
+ target->RemoveAurasDueToSpell(31665);
break;
// Overkill
case 58428:
- if (!target->HasAuraType(SPELL_AURA_MOD_STEALTH))
- target->RemoveAurasDueToSpell(58427);
+ target->RemoveAurasDueToSpell(58427);
break;
}
break;
@@ -5849,8 +5467,6 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
}
}
- uint32 absorb = 0;
- uint32 resist = 0;
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
// AOE spells are not affected by the new periodic system.
@@ -5945,13 +5561,16 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
damage = caster->SpellCriticalDamageBonus(m_spellInfo, damage, target);
int32 dmg = damage;
-
if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_FIXED_DAMAGE))
- caster->ApplyResilience(target, NULL, &dmg, crit, CR_CRIT_TAKEN_SPELL);
+ caster->ApplyResilience(target, nullptr, &dmg, crit, CR_CRIT_TAKEN_SPELL);
damage = dmg;
- caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, GetSpellInfo());
+ DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK);
+ caster->CalcAbsorbResist(damageInfo);
+ damage = damageInfo.GetDamage();
+ uint32 absorb = damageInfo.GetAbsorb();
+ uint32 resist = damageInfo.GetResist();
TC_LOG_DEBUG("spells.periodic", "PeriodicTick: %s attacked %s for %u dmg inflicted by %u absorb is %u",
GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId(), absorb);
@@ -5960,10 +5579,12 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
// Set trigger flag
uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
- uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
- damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist);
+ uint32 hitMask = damageInfo.GetHitMask();
if (damage)
+ {
+ hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
procVictim |= PROC_FLAG_TAKEN_DAMAGE;
+ }
int32 overkill = damage - target->GetHealth();
if (overkill < 0)
@@ -5972,7 +5593,6 @@ void AuraEffect::HandlePeriodicDamageAurasTick(Unit* target, Unit* caster) const
SpellPeriodicAuraLogInfo pInfo(this, damage, overkill, absorb, resist, 0.0f, crit);
target->SendPeriodicAuraLog(&pInfo);
- DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK);
caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr);
caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), true);
@@ -5993,8 +5613,6 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
caster->SpellHitResult(target, GetSpellInfo(), false) != SPELL_MISS_NONE)
return;
- uint32 absorb = 0;
- uint32 resist = 0;
CleanDamage cleanDamage = CleanDamage(0, 0, BASE_ATTACK, MELEE_HIT_NORMAL);
bool isAreaAura = m_spellInfo->Effects[m_effIndex].IsAreaAuraEffect() || m_spellInfo->Effects[m_effIndex].IsEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA);
@@ -6009,6 +5627,9 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
else
damage = std::max(int32(damage * GetDonePct()), 0);
+ if (Player* modOwner = caster->GetSpellModOwner())
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(GetSpellInfo()->Id, damage);
+
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT, GetBase()->GetStackAmount());
// Calculate armor mitigation
@@ -6020,12 +5641,14 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
}
if (!m_spellInfo->HasAttribute(SPELL_ATTR4_FIXED_DAMAGE))
+ {
if (m_spellInfo->Effects[m_effIndex].IsTargetingArea() || isAreaAura)
{
damage = uint32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
if (caster->GetTypeId() != TYPEID_PLAYER)
damage = uint32(float(damage) * target->GetTotalAuraMultiplierByMiscMask(SPELL_AURA_MOD_CREATURE_AOE_DAMAGE_AVOIDANCE, m_spellInfo->SchoolMask));
}
+ }
bool crit = false;
@@ -6037,29 +5660,33 @@ void AuraEffect::HandlePeriodicHealthLeechAuraTick(Unit* target, Unit* caster) c
int32 dmg = damage;
if (!GetSpellInfo()->HasAttribute(SPELL_ATTR4_FIXED_DAMAGE))
- caster->ApplyResilience(target, NULL, &dmg, crit, CR_CRIT_TAKEN_SPELL);
+ caster->ApplyResilience(target, nullptr, &dmg, crit, CR_CRIT_TAKEN_SPELL);
damage = dmg;
- caster->CalcAbsorbResist(target, GetSpellInfo()->GetSchoolMask(), DOT, damage, &absorb, &resist, m_spellInfo);
+ DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK);
+ caster->CalcAbsorbResist(damageInfo);
+ uint32 absorb = damageInfo.GetAbsorb();
+ uint32 resist = damageInfo.GetResist();
TC_LOG_DEBUG("spells.periodic", "PeriodicTick: %s health leech of %s for %u dmg inflicted by %u abs is %u",
GetCasterGUID().ToString().c_str(), target->GetGUID().ToString().c_str(), damage, GetId(), absorb);
+ // SendSpellNonMeleeDamageLog expects non-absorbed/non-resisted damage
caster->SendSpellNonMeleeDamageLog(target, GetId(), damage, GetSpellInfo()->GetSchoolMask(), absorb, resist, false, 0, crit);
+ damage = damageInfo.GetDamage();
// Set trigger flag
uint32 procAttacker = PROC_FLAG_DONE_PERIODIC;
uint32 procVictim = PROC_FLAG_TAKEN_PERIODIC;
- uint32 hitMask = crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
- damage = (damage <= absorb+resist) ? 0 : (damage-absorb-resist);
+ uint32 hitMask = damageInfo.GetHitMask();
if (damage)
+ {
+ hitMask |= crit ? PROC_HIT_CRITICAL : PROC_HIT_NORMAL;
procVictim |= PROC_FLAG_TAKEN_DAMAGE;
+ }
if (caster->IsAlive())
- {
- DamageInfo damageInfo(caster, target, damage, GetSpellInfo(), GetSpellInfo()->GetSchoolMask(), DOT, BASE_ATTACK);
caster->ProcSkillsAndAuras(target, procAttacker, procVictim, PROC_SPELL_TYPE_DAMAGE, PROC_SPELL_PHASE_NONE, hitMask, nullptr, &damageInfo, nullptr);
- }
int32 new_damage = caster->DealDamage(target, damage, &cleanDamage, DOT, GetSpellInfo()->GetSchoolMask(), GetSpellInfo(), false);
if (caster->IsAlive())
@@ -6478,6 +6105,12 @@ void AuraEffect::HandleProcTriggerDamageAuraProc(AuraApplication* aurApp, ProcEv
Unit* target = aurApp->GetTarget();
Unit* triggerTarget = eventInfo.GetProcTarget();
+ if (triggerTarget->HasUnitState(UNIT_STATE_ISOLATED) || triggerTarget->IsImmunedToDamage(GetSpellInfo()))
+ {
+ SendTickImmune(triggerTarget, target);
+ return;
+ }
+
SpellNonMeleeDamage damageInfo(target, triggerTarget, GetId(), GetSpellInfo()->SchoolMask);
uint32 damage = target->SpellDamageBonusDone(triggerTarget, GetSpellInfo(), GetAmount(), SPELL_DIRECT_DAMAGE);
damage = triggerTarget->SpellDamageBonusTaken(target, GetSpellInfo(), damage, SPELL_DIRECT_DAMAGE);
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.h b/src/server/game/Spells/Auras/SpellAuraEffects.h
index 2bfdde97b4b..05bfe7c0534 100644
--- a/src/server/game/Spells/Auras/SpellAuraEffects.h
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.h
@@ -198,7 +198,7 @@ class TC_GAME_API AuraEffect
void HandleAuraModDecreaseSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModUseNormalSpeed(AuraApplication const* aurApp, uint8 mode, bool apply) const;
// immunity
- void HandleModStateImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const;
+ void HandleModMechanicImmunityMask(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleModMechanicImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModEffectImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
void HandleAuraModStateImmunity(AuraApplication const* aurApp, uint8 mode, bool apply) const;
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp
index 970bb93b271..45ea44f1dfb 100644
--- a/src/server/game/Spells/Auras/SpellAuras.cpp
+++ b/src/server/game/Spells/Auras/SpellAuras.cpp
@@ -360,7 +360,7 @@ m_procCooldown(std::chrono::steady_clock::time_point::min())
AuraScript* Aura::GetScriptByName(std::string const& scriptName) const
{
- for (std::list<AuraScript*>::const_iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
+ for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
if ((*itr)->_GetScriptName()->compare(scriptName) == 0)
return *itr;
return NULL;
@@ -381,12 +381,10 @@ void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount)
Aura::~Aura()
{
// unload scripts
- while (!m_loadedScripts.empty())
+ for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
{
- std::list<AuraScript*>::iterator itr = m_loadedScripts.begin();
(*itr)->_Unload();
delete (*itr);
- m_loadedScripts.erase(itr);
}
// free effects memory
@@ -987,6 +985,10 @@ bool Aura::CanBeSaved() const
if (IsUsingCharges() && !GetCharges())
return false;
+ // don't save permanent auras triggered by items, they'll be recasted on login if necessary
+ if (GetCastItemGUID() && IsPermanent())
+ return false;
+
return true;
}
@@ -1291,20 +1293,27 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
case SPELLFAMILY_PRIEST:
if (!caster)
break;
+
// Devouring Plague
- if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000 && GetEffect(0))
+ if (GetSpellInfo()->SpellFamilyFlags[0] & 0x02000000)
{
+ AuraEffect const* devouringPlague = GetEffect(EFFECT_0);
+ if (!devouringPlague)
+ break;
+
// Improved Devouring Plague
if (AuraEffect const* aurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, 3790, 1))
{
- uint32 damage = caster->SpellDamageBonusDone(target, GetSpellInfo(), GetEffect(0)->GetAmount(), DOT);
- damage *= caster->SpellDamagePctDone(target, GetSpellInfo(), SPELL_DIRECT_DAMAGE);
+ int32 damage = (devouringPlague->GetAmount() + devouringPlague->GetBonusAmount()) * devouringPlague->GetDonePct();
+ if (Player* modOwner = caster->GetSpellModOwner())
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(GetSpellInfo()->Id, damage);
+
damage = target->SpellDamageBonusTaken(caster, GetSpellInfo(), damage, DOT);
- int32 basepoints0 = aurEff->GetAmount() * GetEffect(0)->GetTotalTicks() * int32(damage) / 100;
- int32 heal = int32(CalculatePct(basepoints0, 15));
- caster->CastCustomSpell(target, 63675, &basepoints0, NULL, NULL, true, NULL, GetEffect(0));
- caster->CastCustomSpell(caster, 75999, &heal, NULL, NULL, true, NULL, GetEffect(0));
+ int32 basepoints0 = CalculatePct(devouringPlague->GetTotalTicks() * static_cast<int32>(damage), aurEff->GetAmount());
+ int32 heal = CalculatePct(basepoints0, 15);
+ caster->CastCustomSpell(63675, SPELLVALUE_BASE_POINT0, basepoints0, target, true, nullptr, devouringPlague);
+ caster->CastCustomSpell(75999, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, devouringPlague);
}
}
// Power Word: Shield
@@ -1591,6 +1600,9 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
target->CastSpell(target, 31666, true);
else
{
+ // Remove counter aura
+ target->RemoveAurasDueToSpell(31666);
+
int32 basepoints0 = aurEff->GetAmount();
target->CastCustomSpell(target, 31665, &basepoints0, NULL, NULL, true);
}
@@ -1601,7 +1613,12 @@ void Aura::HandleAuraSpecificMods(AuraApplication const* aurApp, Unit* caster, b
if (!apply)
target->CastSpell(target, 58428, true);
else
+ {
+ // Remove counter aura
+ target->RemoveAurasDueToSpell(58428);
+
target->CastSpell(target, 58427, true);
+ }
}
break;
}
@@ -1865,13 +1882,34 @@ void Aura::PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInf
AddProcCooldown(now + procEntry->Cooldown);
}
-uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const
+uint8 Aura::GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const
{
SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(GetId());
// only auras with spell proc entry can trigger proc
if (!procEntry)
return 0;
+ // check spell triggering us
+ if (Spell const* spell = eventInfo.GetProcSpell())
+ {
+ // Do not allow auras to proc from effect triggered from itself
+ if (spell->IsTriggeredByAura(m_spellInfo))
+ return 0;
+
+ // check if aura can proc when spell is triggered (exception for hunter auto shot & wands)
+ if (spell->IsTriggered() && !(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK))
+ if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED))
+ return 0;
+ }
+
+ // check don't break stealth attr present
+ if (m_spellInfo->HasAura(SPELL_AURA_MOD_STEALTH))
+ {
+ if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo())
+ if (spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH))
+ return 0;
+ }
+
// check if we have charges to proc with
if (IsUsingCharges())
{
@@ -1889,16 +1927,9 @@ uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& event
return 0;
// do checks against db data
- if (!sSpellMgr->CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
+ if (!SpellMgr::CanSpellTriggerProcOnEvent(*procEntry, eventInfo))
return 0;
- // check if aura can proc when spell is triggered (exception for hunter auto shot & wands)
- if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK))
- if (Spell const* spell = eventInfo.GetProcSpell())
- if (spell->IsTriggered())
- if (!GetSpellInfo()->HasAttribute(SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED))
- return 0;
-
// do checks using conditions table
if (!sConditionMgr->IsObjectMeetingNotGroupedConditions(CONDITION_SOURCE_TYPE_SPELL_PROC, GetId(), eventInfo.GetActor(), eventInfo.GetActionTarget()))
return 0;
@@ -1909,11 +1940,11 @@ uint8 Aura::IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& event
return 0;
// At least one effect has to pass checks to proc aura
- uint8 procEffectMask = 0;
+ uint8 procEffectMask = aurApp->GetEffectMask();
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- if (aurApp->HasEffect(i))
- if (GetEffect(i)->CheckEffectProc(aurApp, eventInfo))
- procEffectMask |= (1 << i);
+ if (procEffectMask & (1 << i))
+ if ((procEntry->AttributesMask & (PROC_ATTR_DISABLE_EFF_0 << i)) || !GetEffect(i)->CheckEffectProc(aurApp, eventInfo))
+ procEffectMask &= ~(1 << i);
if (!procEffectMask)
return 0;
@@ -2024,30 +2055,21 @@ void Aura::_DeleteRemovedApplications()
void Aura::LoadScripts()
{
- sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts);
- for (std::list<AuraScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();)
+ sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts, this);
+ for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
{
- if (!(*itr)->_Load(this))
- {
- std::list<AuraScript*>::iterator bitr = itr;
- ++itr;
- delete (*bitr);
- m_loadedScripts.erase(bitr);
- continue;
- }
TC_LOG_DEBUG("spells", "Aura::LoadScripts: Script `%s` for aura `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id);
(*itr)->Register();
- ++itr;
}
}
bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target)
{
bool result = true;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET);
- std::list<AuraScript::CheckAreaTargetHandler>::iterator hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin();
+ auto hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin();
for (; hookItr != hookItrEnd; ++hookItr)
result &= hookItr->Call(*scritr, target);
@@ -2058,10 +2080,10 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target)
void Aura::CallScriptDispel(DispelInfo* dispelInfo)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL);
- std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
+ auto hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
for (; hookItr != hookItrEnd; ++hookItr)
hookItr->Call(*scritr, dispelInfo);
@@ -2071,10 +2093,10 @@ void Aura::CallScriptDispel(DispelInfo* dispelInfo)
void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL);
- std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
+ auto hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
for (; hookItr != hookItrEnd; ++hookItr)
hookItr->Call(*scritr, dispelInfo);
@@ -2085,10 +2107,10 @@ void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo)
bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
bool preventDefault = false;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp);
- std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin();
+ auto effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, mode);
@@ -2105,10 +2127,10 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati
bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
bool preventDefault = false;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp);
- std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin();
+ auto effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, mode);
@@ -2123,10 +2145,10 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat
void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp);
- std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin();
+ auto effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, mode);
@@ -2137,10 +2159,10 @@ void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraAppl
void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp);
- std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin();
+ auto effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, mode);
@@ -2152,10 +2174,10 @@ void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApp
bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp)
{
bool preventDefault = false;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp);
- std::list<AuraScript::EffectPeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin();
+ auto effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff);
@@ -2171,10 +2193,10 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic
void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC);
- std::list<AuraScript::EffectUpdatePeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin();
+ auto effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff);
@@ -2185,10 +2207,10 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff)
void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT);
- std::list<AuraScript::EffectCalcAmountHandler>::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin();
+ auto effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, amount, canBeRecalculated);
@@ -2199,10 +2221,10 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 &
void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC);
- std::list<AuraScript::EffectCalcPeriodicHandler>::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin();
+ auto effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, isPeriodic, amplitude);
@@ -2213,10 +2235,10 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool &
void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD);
- std::list<AuraScript::EffectCalcSpellModHandler>::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin();
+ auto effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, spellMod);
@@ -2227,10 +2249,10 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM
void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool& defaultPrevented)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp);
- std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin();
+ auto effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
@@ -2245,10 +2267,10 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co
void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp);
- std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin();
+ auto effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2259,10 +2281,10 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplicati
void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp);
- std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin();
+ auto effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2273,10 +2295,10 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplicatio
void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp);
- std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin();
+ auto effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2287,10 +2309,10 @@ void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraAppli
void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & splitAmount)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_SPLIT, aurApp);
- std::list<AuraScript::EffectSplitHandler>::iterator effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin();
+ auto effEndItr = (*scritr)->OnEffectSplit.end(), effItr = (*scritr)->OnEffectSplit.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, dmgInfo, splitAmount);
@@ -2302,10 +2324,10 @@ void Aura::CallScriptEffectSplitHandlers(AuraEffect* aurEff, AuraApplication con
bool Aura::CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
bool result = true;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_PROC, aurApp);
- std::list<AuraScript::CheckProcHandler>::iterator hookItrEnd = (*scritr)->DoCheckProc.end(), hookItr = (*scritr)->DoCheckProc.begin();
+ auto hookItrEnd = (*scritr)->DoCheckProc.end(), hookItr = (*scritr)->DoCheckProc.begin();
for (; hookItr != hookItrEnd; ++hookItr)
result &= hookItr->Call(*scritr, eventInfo);
@@ -2318,10 +2340,10 @@ bool Aura::CallScriptCheckProcHandlers(AuraApplication const* aurApp, ProcEventI
bool Aura::CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
bool prepare = true;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PREPARE_PROC, aurApp);
- std::list<AuraScript::AuraProcHandler>::iterator effEndItr = (*scritr)->DoPrepareProc.end(), effItr = (*scritr)->DoPrepareProc.begin();
+ auto effEndItr = (*scritr)->DoPrepareProc.end(), effItr = (*scritr)->DoPrepareProc.begin();
for (; effItr != effEndItr; ++effItr)
effItr->Call(*scritr, eventInfo);
@@ -2337,10 +2359,10 @@ bool Aura::CallScriptPrepareProcHandlers(AuraApplication const* aurApp, ProcEven
bool Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
bool handled = false;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_PROC, aurApp);
- std::list<AuraScript::AuraProcHandler>::iterator hookItrEnd = (*scritr)->OnProc.end(), hookItr = (*scritr)->OnProc.begin();
+ auto hookItrEnd = (*scritr)->OnProc.end(), hookItr = (*scritr)->OnProc.begin();
for (; hookItr != hookItrEnd; ++hookItr)
hookItr->Call(*scritr, eventInfo);
@@ -2353,10 +2375,10 @@ bool Aura::CallScriptProcHandlers(AuraApplication const* aurApp, ProcEventInfo&
void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_PROC, aurApp);
- std::list<AuraScript::AuraProcHandler>::iterator hookItrEnd = (*scritr)->AfterProc.end(), hookItr = (*scritr)->AfterProc.begin();
+ auto hookItrEnd = (*scritr)->AfterProc.end(), hookItr = (*scritr)->AfterProc.begin();
for (; hookItr != hookItrEnd; ++hookItr)
hookItr->Call(*scritr, eventInfo);
@@ -2367,10 +2389,10 @@ void Aura::CallScriptAfterProcHandlers(AuraApplication const* aurApp, ProcEventI
bool Aura::CallScriptCheckEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
bool result = true;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_EFFECT_PROC, aurApp);
- std::list<AuraScript::CheckEffectProcHandler>::iterator hookItrEnd = (*scritr)->DoCheckEffectProc.end(), hookItr = (*scritr)->DoCheckEffectProc.begin();
+ auto hookItrEnd = (*scritr)->DoCheckEffectProc.end(), hookItr = (*scritr)->DoCheckEffectProc.begin();
for (; hookItr != hookItrEnd; ++hookItr)
if (hookItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
result &= hookItr->Call(*scritr, aurEff, eventInfo);
@@ -2384,10 +2406,10 @@ bool Aura::CallScriptCheckEffectProcHandlers(AuraEffect const* aurEff, AuraAppli
bool Aura::CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
bool preventDefault = false;
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PROC, aurApp);
- std::list<AuraScript::EffectProcHandler>::iterator effEndItr = (*scritr)->OnEffectProc.end(), effItr = (*scritr)->OnEffectProc.begin();
+ auto effEndItr = (*scritr)->OnEffectProc.end(), effItr = (*scritr)->OnEffectProc.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, eventInfo);
@@ -2402,10 +2424,10 @@ bool Aura::CallScriptEffectProcHandlers(AuraEffect const* aurEff, AuraApplicatio
void Aura::CallScriptAfterEffectProcHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, ProcEventInfo& eventInfo)
{
- for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_PROC, aurApp);
- std::list<AuraScript::EffectProcHandler>::iterator effEndItr = (*scritr)->AfterEffectProc.end(), effItr = (*scritr)->AfterEffectProc.begin();
+ auto effEndItr = (*scritr)->AfterEffectProc.end(), effItr = (*scritr)->AfterEffectProc.begin();
for (; effItr != effEndItr; ++effItr)
if (effItr->IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
effItr->Call(*scritr, aurEff, eventInfo);
diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h
index a6dd29f11d0..1533746893a 100644
--- a/src/server/game/Spells/Auras/SpellAuras.h
+++ b/src/server/game/Spells/Auras/SpellAuras.h
@@ -204,7 +204,7 @@ class TC_GAME_API Aura
bool IsUsingCharges() const { return m_isUsingCharges; }
void SetUsingCharges(bool val) { m_isUsingCharges = val; }
void PrepareProcToTrigger(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now);
- uint8 IsProcTriggeredOnEvent(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const;
+ uint8 GetProcEffectMask(AuraApplication* aurApp, ProcEventInfo& eventInfo, std::chrono::steady_clock::time_point now) const;
float CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
void TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo);
@@ -238,9 +238,11 @@ class TC_GAME_API Aura
AuraScript* GetScriptByName(std::string const& scriptName) const;
- std::list<AuraScript*> m_loadedScripts;
+ std::vector<AuraScript*> m_loadedScripts;
+
private:
void _DeleteRemovedApplications();
+
protected:
SpellInfo const* const m_spellInfo;
ObjectGuid const m_casterGuid;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index a83a5a122ad..c082c0a7584 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -626,12 +626,10 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO
Spell::~Spell()
{
// unload scripts
- while (!m_loadedScripts.empty())
+ for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
{
- std::list<SpellScript*>::iterator itr = m_loadedScripts.begin();
(*itr)->_Unload();
delete (*itr);
- m_loadedScripts.erase(itr);
}
if (m_referencedFromCurrentSpell && m_selfContainer && *m_selfContainer == this)
@@ -647,7 +645,8 @@ Spell::~Spell()
delete m_spellValue;
- CheckEffectExecuteData();
+ // missing cleanup somewhere, mem leaks so let's crash
+ AssertEffectExecuteData();
}
void Spell::InitExplicitTargets(SpellCastTargets const& targets)
@@ -1119,8 +1118,14 @@ void Spell::SelectImplicitConeTargets(SpellEffIndex effIndex, SpellImplicitTarge
SpellTargetObjectTypes objectType = targetType.GetObjectType();
SpellTargetCheckTypes selectionType = targetType.GetCheckType();
ConditionContainer* condList = m_spellInfo->Effects[effIndex].ImplicitTargetConditions;
- float coneAngle = float(M_PI) / 2;
- float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod;
+ float coneAngle = float(M_PI) / 2.f;
+
+ float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
+ // Workaround for some spells that don't have RadiusEntry set in dbc (but SpellRange instead)
+ if (G3D::fuzzyEq(radius, 0.f))
+ radius = m_spellInfo->GetMaxRange(m_spellInfo->IsPositiveEffect(effIndex), m_caster, this);
+
+ radius *= m_spellValue->RadiusMod;
if (uint32 containerTypeMask = GetSearcherTypeMask(objectType, condList))
{
@@ -1206,7 +1211,13 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
return;
}
std::list<WorldObject*> targets;
- float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster) * m_spellValue->RadiusMod;
+ float radius = m_spellInfo->Effects[effIndex].CalcRadius(m_caster);
+ // Workaround for some spells that don't have RadiusEntry set in dbc (but SpellRange instead)
+ if (G3D::fuzzyEq(radius, 0.f))
+ radius = m_spellInfo->GetMaxRange(m_spellInfo->IsPositiveEffect(effIndex), m_caster, this);
+
+ radius *= m_spellValue->RadiusMod;
+
SearchAreaTargets(targets, radius, center, referer, targetType.GetObjectType(), targetType.GetCheckType(), m_spellInfo->Effects[effIndex].ImplicitTargetConditions);
CallScriptObjectAreaTargetSelectHandlers(targets, effIndex, targetType);
@@ -1992,11 +2003,17 @@ void Spell::prepareDataForTriggerSystem()
// Hunter trap spells - activation proc for Lock and Load, Entrapment and Misdirection
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_HUNTER &&
- (m_spellInfo->SpellFamilyFlags[0] & 0x18 || // Freezing and Frost Trap, Freezing Arrow
- m_spellInfo->Id == 57879 || // Snake Trap - done this way to avoid double proc
- m_spellInfo->SpellFamilyFlags[2] & 0x00024000)) // Explosive and Immolation Trap
+ (m_spellInfo->SpellFamilyFlags[0] & 0x18 || // Freezing and Frost Trap, Freezing Arrow
+ m_spellInfo->Id == 57879 || // Snake Trap - done this way to avoid double proc
+ m_spellInfo->SpellFamilyFlags[2] & 0x00024000)) // Explosive and Immolation Trap
+ {
m_procAttacker |= PROC_FLAG_DONE_TRAP_ACTIVATION;
+ // also fill up other flags (DoAllEffectOnTarget only fills up flag if both are not set)
+ m_procAttacker |= PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG;
+ m_procVictim |= PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG;
+ }
+
// Hellfire Effect - trigger as DOT
if (m_spellInfo->SpellFamilyName == SPELLFAMILY_WARLOCK && m_spellInfo->SpellFamilyFlags[0] & 0x00000040)
{
@@ -2050,7 +2067,7 @@ void Spell::AddUnitTarget(Unit* target, uint32 effectMask, bool checkIfValid /*=
return;
if (checkIfValid)
- if (m_spellInfo->CheckTarget(m_caster, target, implicit) != SPELL_CAST_OK)
+ if (m_spellInfo->CheckTarget(m_caster, target, implicit || m_caster->GetEntry() == WORLD_TRIGGER) != SPELL_CAST_OK) // skip stealth checks for GO casts
return;
// Check for effect immune skip if immuned
@@ -2308,7 +2325,7 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
m_spellAura = nullptr; // Set aura to null for every target-make sure that pointer is not used for unit without aura applied
// Spells with this flag cannot trigger if effect is cast on self
- bool canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE || missInfo == SPELL_MISS_IMMUNE2);
+ bool const canEffectTrigger = !m_spellInfo->HasAttribute(SPELL_ATTR3_CANT_TRIGGER_PROC) && unitTarget->CanProc() && (CanExecuteTriggersOnHit(mask) || missInfo == SPELL_MISS_IMMUNE || missInfo == SPELL_MISS_IMMUNE2);
Unit* spellHitTarget = nullptr;
if (missInfo == SPELL_MISS_NONE) // In case spell hit target, do all effect on that target
@@ -2352,7 +2369,19 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
if (m_damage > 0)
positive = false;
else if (!m_healing)
- positive = m_spellInfo->IsPositive();
+ {
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (!(target->effectMask & (1 << i)))
+ continue;
+
+ if (!m_spellInfo->IsPositiveEffect(i))
+ {
+ positive = false;
+ break;
+ }
+ }
+ }
switch (m_spellInfo->DmgClass)
{
@@ -2413,15 +2442,29 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
// Fill base damage struct (unitTarget - is real spell target)
SpellNonMeleeDamage damageInfo(caster, unitTarget, m_spellInfo->Id, m_spellSchoolMask);
- // Add bonuses and fill damageInfo struct
- caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo, m_attackType, target->crit);
- caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
+ // Check damage immunity
+ if (unitTarget->IsImmunedToDamage(m_spellInfo))
+ {
+ hitMask = PROC_HIT_IMMUNE;
+ m_damage = 0;
+
+ // no packet found in sniffs
+ }
+ else
+ {
+ // Add bonuses and fill damageInfo struct
+ caster->CalculateSpellDamageTaken(&damageInfo, m_damage, m_spellInfo, m_attackType, target->crit);
+ caster->DealDamageMods(damageInfo.target, damageInfo.damage, &damageInfo.absorb);
- // Send log damage message to client
- caster->SendSpellNonMeleeDamageLog(&damageInfo);
+ // Send log damage message to client
+ caster->SendSpellNonMeleeDamageLog(&damageInfo);
- hitMask |= createProcHitMask(&damageInfo, missInfo);
- procVictim |= PROC_FLAG_TAKEN_DAMAGE;
+ hitMask |= createProcHitMask(&damageInfo, missInfo);
+ procVictim |= PROC_FLAG_TAKEN_DAMAGE;
+
+ m_damage = damageInfo.damage;
+ caster->DealSpellDamage(&damageInfo, true);
+ }
// Do triggers for unit
if (canEffectTrigger)
@@ -2433,10 +2476,6 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
(m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_MELEE || m_spellInfo->DmgClass == SPELL_DAMAGE_CLASS_RANGED))
caster->ToPlayer()->CastItemCombatSpell(spellDamageInfo);
}
-
- m_damage = damageInfo.damage;
-
- caster->DealSpellDamage(&damageInfo, true);
}
// Passive spell hits/misses or active spells only misses (only triggers)
else
@@ -2502,7 +2541,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
return SPELL_MISS_EVADE;
// For delayed spells immunity may be applied between missile launch and hit - check immunity for that case
- if (m_spellInfo->Speed && (unit->IsImmunedToDamage(m_spellInfo) || unit->IsImmunedToSpell(m_spellInfo)))
+ if (m_spellInfo->Speed && unit->IsImmunedToSpell(m_spellInfo))
return SPELL_MISS_IMMUNE;
// disable effects to which unit is immune
@@ -2551,12 +2590,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA
return SPELL_MISS_EVADE;
if (m_caster->_IsValidAttackTarget(unit, m_spellInfo))
- {
unit->RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_HITBYSPELL);
-
- if (!m_spellInfo->HasAttribute(SPELL_ATTR0_CU_DONT_BREAK_STEALTH))
- unit->RemoveAurasByType(SPELL_AURA_MOD_STEALTH);
- }
else if (m_caster->IsFriendlyTo(unit))
{
// for delayed spells ignore negative spells (after duel end) for friendly targets
@@ -2720,8 +2754,8 @@ void Spell::DoTriggersOnSpellHit(Unit* unit, uint8 effMask)
// info confirmed with retail sniffs of permafrost and shadow weaving
if (!m_hitTriggerSpells.empty())
{
- int _duration = 0;
- for (HitTriggerSpellList::const_iterator i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i)
+ int32 _duration = 0;
+ for (auto i = m_hitTriggerSpells.begin(); i != m_hitTriggerSpells.end(); ++i)
{
if (CanExecuteTriggersOnHit(effMask, i->triggeredByAura) && roll_chance_i(i->chance))
{
@@ -2933,7 +2967,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
if ((_triggeredCastFlags & TRIGGERED_IGNORE_COMBO_POINTS) || m_CastItem || !m_caster->m_playerMovingMe)
m_needComboPoints = false;
- SpellCastResult result = CheckCast(true);
+ uint32 param1 = 0, param2 = 0;
+ SpellCastResult result = CheckCast(true, &param1, &param2);
if (result != SPELL_CAST_OK && !IsAutoRepeat()) //always cast autorepeat dummy for triggering
{
// Periodic auras should be interrupted when aura triggers a spell which can't be cast
@@ -2954,7 +2989,10 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
m_caster->ToPlayer()->SetSpellModTakingSpell(this, false);
}
- SendCastResult(result);
+ if (param1 || param2)
+ SendCastResult(result, &param1, &param2);
+ else
+ SendCastResult(result);
finish(false);
return;
@@ -2979,7 +3017,7 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
m_casttime = m_spellInfo->CalcCastTime(this);
if (m_caster->GetTypeId() == TYPEID_UNIT && !m_caster->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) // _UNIT actually means creature. for some reason.
- if (!(IsNextMeleeSwingSpell() || IsAutoRepeat() || _triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING))
+ if (!(m_spellInfo->IsNextMeleeSwingSpell() || IsAutoRepeat() || (_triggeredCastFlags & TRIGGERED_IGNORE_SET_FACING)))
{
if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget());
@@ -2992,8 +3030,8 @@ void Spell::prepare(SpellCastTargets const* targets, AuraEffect const* triggered
// (even if they are interrupted on moving, spells with almost immediate effect get to have their effect processed before movement interrupter kicks in)
if ((m_spellInfo->IsChanneled() || m_casttime) && m_caster->GetTypeId() == TYPEID_PLAYER && !(m_caster->IsCharmed() && m_caster->GetCharmerGUID().IsCreature()) && m_caster->isMoving() && (m_spellInfo->InterruptFlags & SPELL_INTERRUPT_FLAG_MOVEMENT))
{
- // 1. Is a channel spell, 2. Has no casttime, 3. And has flag to allow movement during channel
- if (!(m_spellInfo->IsChanneled() && !m_casttime && m_spellInfo->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING)))
+ // 1. Has casttime, 2. Or doesn't have flag to allow movement during channel
+ if (m_casttime || !m_spellInfo->IsMoveAllowedChannel())
{
SendCastResult(SPELL_FAILED_MOVING);
finish(false);
@@ -3141,10 +3179,11 @@ void Spell::cast(bool skipCheck)
// skip check if done already (for instant cast spells for example)
if (!skipCheck)
{
- SpellCastResult castResult = CheckCast(false);
+ uint32 param1 = 0, param2 = 0;
+ SpellCastResult castResult = CheckCast(false, &param1, &param2);
if (castResult != SPELL_CAST_OK)
{
- SendCastResult(castResult);
+ SendCastResult(castResult, &param1, &param2);
SendInterrupted(0);
//restore spell mods
if (m_caster->GetTypeId() == TYPEID_PLAYER)
@@ -3548,7 +3587,7 @@ void Spell::update(uint32 difftime)
(m_spellInfo->Effects[0].Effect != SPELL_EFFECT_STUCK || !m_caster->HasUnitMovementFlag(MOVEMENTFLAG_FALLING_FAR))))
{
// don't cancel for melee, autorepeat, triggered and instant spells
- if (!IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered() && !(IsChannelActive() && m_spellInfo->HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING)))
+ if (!m_spellInfo->IsNextMeleeSwingSpell() && !IsAutoRepeat() && !IsTriggered() && !(IsChannelActive() && m_spellInfo->IsMoveAllowedChannel()))
{
// if charmed by creature, trust the AI not to cheat and allow the cast to proceed
// @todo this is a hack, "creature" movesplines don't differentiate turning/moving right now
@@ -3570,7 +3609,7 @@ void Spell::update(uint32 difftime)
m_timer -= difftime;
}
- if (m_timer == 0 && !IsNextMeleeSwingSpell() && !IsAutoRepeat())
+ if (m_timer == 0 && !m_spellInfo->IsNextMeleeSwingSpell() && !IsAutoRepeat())
// don't CheckCast for instant spells - done in spell::prepare, skip duplicate checks, needed for range checks for example
cast(!m_casttime);
break;
@@ -3690,7 +3729,7 @@ void Spell::finish(bool ok)
m_caster->AttackStop();
}
-void Spell::WriteCastResultInfo(WorldPacket& data, Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError)
+void Spell::WriteCastResultInfo(WorldPacket& data, Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
{
data << uint8(castCount); // single cast or multi 2.3 (0/1)
data << uint32(spellInfo->Id);
@@ -3698,115 +3737,185 @@ void Spell::WriteCastResultInfo(WorldPacket& data, Player* caster, SpellInfo con
switch (result)
{
case SPELL_FAILED_REQUIRES_SPELL_FOCUS:
- data << uint32(spellInfo->RequiresSpellFocus); // SpellFocusObject.dbc id
+ if (param1)
+ data << uint32(*param1);
+ else
+ data << uint32(spellInfo->RequiresSpellFocus); // SpellFocusObject.dbc id
break;
case SPELL_FAILED_REQUIRES_AREA: // AreaTable.dbc id
- // hardcode areas limitation case
- switch (spellInfo->Id)
+ if (param1)
+ data << uint32(*param1);
+ else
{
- case 41617: // Cenarion Mana Salve
- case 41619: // Cenarion Healing Salve
- data << uint32(3905);
- break;
- case 41618: // Bottled Nethergon Energy
- case 41620: // Bottled Nethergon Vapor
- data << uint32(3842);
- break;
- case 45373: // Bloodberry Elixir
- data << uint32(4075);
- break;
- default: // default case (don't must be)
- data << uint32(0);
- break;
+ // hardcode areas limitation case
+ switch (spellInfo->Id)
+ {
+ case 41617: // Cenarion Mana Salve
+ case 41619: // Cenarion Healing Salve
+ data << uint32(3905);
+ break;
+ case 41618: // Bottled Nethergon Energy
+ case 41620: // Bottled Nethergon Vapor
+ data << uint32(3842);
+ break;
+ case 45373: // Bloodberry Elixir
+ data << uint32(4075);
+ break;
+ default: // default case (don't must be)
+ data << uint32(0);
+ break;
+ }
}
break;
case SPELL_FAILED_TOTEMS:
- if (spellInfo->Totem[0])
- data << uint32(spellInfo->Totem[0]);
- if (spellInfo->Totem[1])
- data << uint32(spellInfo->Totem[1]);
+ if (param1)
+ {
+ data << uint32(*param1);
+ if (param2)
+ data << uint32(*param2);
+ }
+ else
+ {
+ if (spellInfo->Totem[0])
+ data << uint32(spellInfo->Totem[0]);
+ if (spellInfo->Totem[1])
+ data << uint32(spellInfo->Totem[1]);
+ }
break;
case SPELL_FAILED_TOTEM_CATEGORY:
- if (spellInfo->TotemCategory[0])
- data << uint32(spellInfo->TotemCategory[0]);
- if (spellInfo->TotemCategory[1])
- data << uint32(spellInfo->TotemCategory[1]);
+ if (param1)
+ {
+ data << uint32(*param1);
+ if (param2)
+ data << uint32(*param2);
+ }
+ else
+ {
+ if (spellInfo->TotemCategory[0])
+ data << uint32(spellInfo->TotemCategory[0]);
+ if (spellInfo->TotemCategory[1])
+ data << uint32(spellInfo->TotemCategory[1]);
+ }
break;
case SPELL_FAILED_EQUIPPED_ITEM_CLASS:
case SPELL_FAILED_EQUIPPED_ITEM_CLASS_MAINHAND:
case SPELL_FAILED_EQUIPPED_ITEM_CLASS_OFFHAND:
- data << uint32(spellInfo->EquippedItemClass);
- data << uint32(spellInfo->EquippedItemSubClassMask);
+ if (param1 && param2)
+ {
+ data << uint32(*param1);
+ data << uint32(*param2);
+ }
+ else
+ {
+ data << uint32(spellInfo->EquippedItemClass);
+ data << uint32(spellInfo->EquippedItemSubClassMask);
+ }
break;
case SPELL_FAILED_TOO_MANY_OF_ITEM:
{
- uint32 item = 0;
- for (int8 eff = 0; eff < MAX_SPELL_EFFECTS; eff++)
- if (spellInfo->Effects[eff].ItemType)
- item = spellInfo->Effects[eff].ItemType;
- ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item);
- if (proto && proto->ItemLimitCategory)
- data << uint32(proto->ItemLimitCategory);
- break;
+ if (param1)
+ data << uint32(*param1);
+ else
+ {
+ uint32 item = 0;
+ for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS && !item; ++effIndex)
+ if (uint32 itemType = spellInfo->Effects[effIndex].ItemType)
+ item = itemType;
+
+ ItemTemplate const* proto = sObjectMgr->GetItemTemplate(item);
+ if (proto && proto->ItemLimitCategory)
+ data << uint32(proto->ItemLimitCategory);
+ }
+ break;
}
case SPELL_FAILED_CUSTOM_ERROR:
data << uint32(customError);
break;
case SPELL_FAILED_REAGENTS:
{
- uint32 missingItem = 0;
- for (uint32 i = 0; i < MAX_SPELL_REAGENTS; i++)
+ if (param1)
+ data << uint32(*param1);
+ else
{
- if (spellInfo->Reagent[i] <= 0)
- continue;
+ uint32 missingItem = 0;
+ for (uint32 i = 0; i < MAX_SPELL_REAGENTS; i++)
+ {
+ if (spellInfo->Reagent[i] <= 0)
+ continue;
- uint32 itemid = spellInfo->Reagent[i];
- uint32 itemcount = spellInfo->ReagentCount[i];
+ uint32 itemid = spellInfo->Reagent[i];
+ uint32 itemcount = spellInfo->ReagentCount[i];
- if (!caster->HasItemCount(itemid, itemcount))
- {
- missingItem = itemid;
- break;
+ if (!caster->HasItemCount(itemid, itemcount))
+ {
+ missingItem = itemid;
+ break;
+ }
}
- }
- data << uint32(missingItem); // first missing item
+ data << uint32(missingItem); // first missing item
+ }
break;
}
case SPELL_FAILED_PREVENTED_BY_MECHANIC:
- data << uint32(spellInfo->Mechanic);
+ if (param1)
+ data << uint32(*param1);
+ else
+ data << uint32(spellInfo->Mechanic);
break;
case SPELL_FAILED_NEED_EXOTIC_AMMO:
- data << uint32(spellInfo->EquippedItemSubClassMask);
+ if (param1)
+ data << uint32(*param1);
+ else
+ data << uint32(spellInfo->EquippedItemSubClassMask);
break;
case SPELL_FAILED_NEED_MORE_ITEMS:
- data << uint32(0); // Item entry
- data << uint32(0); // Count
+ if (param1 && param2)
+ {
+ data << uint32(*param1);
+ data << uint32(*param2);
+ }
+ else
+ {
+ data << uint32(0); // Item entry
+ data << uint32(0); // Count
+ }
break;
case SPELL_FAILED_MIN_SKILL:
- data << uint32(0); // SkillLine.dbc Id
- data << uint32(0); // Amount
+ if (param1 && param2)
+ {
+ data << uint32(*param1);
+ data << uint32(*param2);
+ }
+ else
+ {
+ data << uint32(0); // SkillLine.dbc Id
+ data << uint32(0); // Amount
+ }
break;
case SPELL_FAILED_FISHING_TOO_LOW:
- data << uint32(0); // Skill level
+ if (param1)
+ data << uint32(*param1);
+ else
+ data << uint32(0); // Skill level
break;
default:
break;
}
}
-void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/)
+void Spell::SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError /*= SPELL_CUSTOM_ERROR_NONE*/, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
{
if (result == SPELL_CAST_OK)
return;
WorldPacket data(SMSG_CAST_FAILED, 1 + 4 + 1);
- WriteCastResultInfo(data, caster, spellInfo, castCount, result, customError);
+ WriteCastResultInfo(data, caster, spellInfo, castCount, result, customError, param1, param2);
- caster->GetSession()->SendPacket(&data);
+ caster->SendDirectMessage(&data);
}
-void Spell::SendCastResult(SpellCastResult result)
+void Spell::SendCastResult(SpellCastResult result, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/) const
{
if (result == SPELL_CAST_OK)
return;
@@ -3814,13 +3923,13 @@ void Spell::SendCastResult(SpellCastResult result)
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return;
- if (m_caster->ToPlayer()->GetSession()->PlayerLoading()) // don't send cast results at loading time
+ if (m_caster->ToPlayer()->IsLoading()) // don't send cast results at loading time
return;
if (_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR)
result = SPELL_FAILED_DONT_REPORT;
- SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError);
+ SendCastResult(m_caster->ToPlayer(), m_spellInfo, m_cast_count, result, m_customError, param1, param2);
}
void Spell::SendPetCastResult(SpellCastResult result)
@@ -4469,7 +4578,7 @@ void Spell::TakeAmmo()
}
}
-SpellCastResult Spell::CheckRuneCost(uint32 runeCostID)
+SpellCastResult Spell::CheckRuneCost(uint32 runeCostID) const
{
if (m_spellInfo->PowerType != POWER_RUNE || !runeCostID)
return SPELL_CAST_OK;
@@ -4494,7 +4603,7 @@ SpellCastResult Spell::CheckRuneCost(uint32 runeCostID)
{
runeCost[i] = src->RuneCost[i];
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_COST>(m_spellInfo->Id, runeCost[i], this);
+ modOwner->ApplySpellMod<SPELLMOD_COST>(m_spellInfo->Id, runeCost[i], const_cast<Spell*>(this));
}
runeCost[RUNE_DEATH] = MAX_RUNES; // calculated later
@@ -4730,7 +4839,7 @@ void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOT
}
}
-SpellCastResult Spell::CheckCast(bool strict)
+SpellCastResult Spell::CheckCast(bool strict, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
{
// check death state
if (!m_caster->IsAlive() && !m_spellInfo->IsPassive() && !(m_spellInfo->HasAttribute(SPELL_ATTR0_CASTABLE_WHILE_DEAD) || (IsTriggered() && !m_triggeredByAuraSpell)))
@@ -4793,13 +4902,15 @@ SpellCastResult Spell::CheckCast(bool strict)
bool checkForm = true;
// Ignore form req aura
Unit::AuraEffectList const& ignore = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_IGNORE_SHAPESHIFT);
- for (Unit::AuraEffectList::const_iterator i = ignore.begin(); i != ignore.end(); ++i)
+ for (AuraEffect const* aurEff : ignore)
{
- if (!(*i)->IsAffectedOnSpell(m_spellInfo))
+ if (!aurEff->IsAffectedOnSpell(m_spellInfo))
continue;
+
checkForm = false;
break;
}
+
if (checkForm)
{
// Cannot be used in this stance/form
@@ -4895,14 +5006,18 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!(m_spellInfo->IsPassive() && (!m_targets.GetUnitTarget() || m_targets.GetUnitTarget() == m_caster)))
{
// Check explicit target for m_originalCaster - todo: get rid of such workarounds
- SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(m_originalCaster ? m_originalCaster : m_caster, m_targets.GetObjectTarget(), m_targets.GetItemTarget());
+ Unit* caster = m_caster;
+ if (m_originalCaster && m_caster->GetEntry() != WORLD_TRIGGER) // Do a simplified check for gameobject casts
+ caster = m_originalCaster;
+
+ SpellCastResult castResult = m_spellInfo->CheckExplicitTarget(caster, m_targets.GetObjectTarget(), m_targets.GetItemTarget());
if (castResult != SPELL_CAST_OK)
return castResult;
}
if (Unit* target = m_targets.GetUnitTarget())
{
- SpellCastResult castResult = m_spellInfo->CheckTarget(m_caster, target, false);
+ SpellCastResult castResult = m_spellInfo->CheckTarget(m_caster, target, m_caster->GetEntry() == WORLD_TRIGGER); // skip stealth checks for GO casts
if (castResult != SPELL_CAST_OK)
return castResult;
@@ -5003,7 +5118,7 @@ SpellCastResult Spell::CheckCast(bool strict)
// always (except passive spells) check items (only player related checks)
if (!m_spellInfo->IsPassive())
{
- castResult = CheckItems();
+ castResult = CheckItems(param1, param2);
if (castResult != SPELL_CAST_OK)
return castResult;
}
@@ -5023,7 +5138,7 @@ SpellCastResult Spell::CheckCast(bool strict)
if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURAS))
{
- castResult = CheckCasterAuras();
+ castResult = CheckCasterAuras(param1);
if (castResult != SPELL_CAST_OK)
return castResult;
}
@@ -5037,6 +5152,7 @@ SpellCastResult Spell::CheckCast(bool strict)
bool hasNonDispelEffect = false;
uint32 dispelMask = 0;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
if (m_spellInfo->Effects[i].Effect == SPELL_EFFECT_DISPEL)
{
if (m_spellInfo->Effects[i].IsTargetingArea() || m_spellInfo->HasAttribute(SPELL_ATTR1_MELEE_COMBAT_START))
@@ -5052,6 +5168,7 @@ SpellCastResult Spell::CheckCast(bool strict)
hasNonDispelEffect = true;
break;
}
+ }
if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered())
{
@@ -5166,7 +5283,7 @@ SpellCastResult Spell::CheckCast(bool strict)
m_caster->RemoveMovementImpairingAuras();
}
- if (m_caster->HasUnitState(UNIT_STATE_ROOT))
+ if (!(_triggeredCastFlags & TRIGGERED_IGNORE_CASTER_AURAS) && m_caster->HasUnitState(UNIT_STATE_ROOT))
return SPELL_FAILED_ROOTED;
if (GetSpellInfo()->NeedsExplicitUnitTarget())
@@ -5635,139 +5752,114 @@ SpellCastResult Spell::CheckPetCast(Unit* target)
return CheckCast(true);
}
-SpellCastResult Spell::CheckCasterAuras() const
+SpellCastResult Spell::CheckCasterAuras(uint32* param1) const
{
// spells totally immuned to caster auras (wsg flag drop, give marks etc)
if (m_spellInfo->HasAttribute(SPELL_ATTR6_IGNORE_CASTER_AURAS))
return SPELL_CAST_OK;
- uint8 school_immune = 0;
- uint32 mechanic_immune = 0;
- uint32 dispel_immune = 0;
-
- // Check if the spell grants school or mechanic immunity.
- // We use bitmasks so the loop is done only once and not on every aura check below.
- if (m_spellInfo->HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
+ bool usableWhileStunned = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_STUNNED);
+ bool usableWhileFeared = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_FEARED);
+ bool usableWhileConfused = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_CONFUSED);
+ if (m_spellInfo->HasAttribute(SPELL_ATTR7_USABLE_IN_STUN_FEAR_CONFUSION))
{
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- {
- if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_SCHOOL_IMMUNITY)
- school_immune |= uint32(m_spellInfo->Effects[i].MiscValue);
- else if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_MECHANIC_IMMUNITY)
- mechanic_immune |= 1 << uint32(m_spellInfo->Effects[i].MiscValue);
- else if (m_spellInfo->Effects[i].ApplyAuraName == SPELL_AURA_DISPEL_IMMUNITY)
- dispel_immune |= SpellInfo::GetDispelMask(DispelType(m_spellInfo->Effects[i].MiscValue));
- }
- // immune movement impairment and loss of control
- if (m_spellInfo->Id == 42292 || m_spellInfo->Id == 59752 || m_spellInfo->Id == 19574 || m_spellInfo->Id == 53490)
- mechanic_immune = IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+ usableWhileStunned = true;
+ usableWhileFeared = true;
+ usableWhileConfused = true;
}
- bool usableInStun = m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_STUNNED);
-
// Glyph of Pain Suppression
// there is no other way to handle it
if (m_spellInfo->Id == 33206 && !m_caster->HasAura(63248))
- usableInStun = false;
+ usableWhileStunned = false;
// Check whether the cast should be prevented by any state you might have.
- SpellCastResult prevented_reason = SPELL_CAST_OK;
- // Have to check if there is a stun aura. Otherwise will have problems with ghost aura apply while logging out
- uint32 unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS); // Get unit state
- if (unitflag & UNIT_FLAG_STUNNED)
- {
- // spell is usable while stunned, check if caster has allowed stun auras, another stun types must prevent cast spell
- if (usableInStun)
- {
- static uint32 const allowedStunMask =
- 1 << MECHANIC_STUN
- | 1 << MECHANIC_FREEZE
- | 1 << MECHANIC_SAPPED
- | 1 << MECHANIC_SLEEP;
-
- bool foundNotStun = false;
- Unit::AuraEffectList const& stunAuras = m_caster->GetAuraEffectsByType(SPELL_AURA_MOD_STUN);
- for (Unit::AuraEffectList::const_iterator i = stunAuras.begin(); i != stunAuras.end(); ++i)
- {
- uint32 mechanicMask = (*i)->GetSpellInfo()->GetAllEffectsMechanicMask();
- if (mechanicMask && !(mechanicMask & allowedStunMask))
- {
- foundNotStun = true;
- break;
- }
- }
- if (foundNotStun)
- prevented_reason = SPELL_FAILED_STUNNED;
- }
- else
- prevented_reason = SPELL_FAILED_STUNNED;
- }
- else if (unitflag & UNIT_FLAG_CONFUSED && !m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_CONFUSED))
- prevented_reason = SPELL_FAILED_CONFUSED;
- else if (unitflag & UNIT_FLAG_FLEEING && !m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_FEARED))
- prevented_reason = SPELL_FAILED_FLEEING;
- else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
- prevented_reason = SPELL_FAILED_SILENCED;
- else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY)
- prevented_reason = SPELL_FAILED_PACIFIED;
+ SpellCastResult result = SPELL_CAST_OK;
+
+ // Get unit state
+ uint32 const unitflag = m_caster->GetUInt32Value(UNIT_FIELD_FLAGS);
+ if (m_caster->GetCharmerGUID())
+ {
+ if (Unit* charmer = m_caster->GetCharmer())
+ if (charmer->GetUnitBeingMoved() != m_caster && CheckCasterNotImmunedCharmAuras(param1))
+ result = SPELL_FAILED_CHARMED;
+ }
+ else if (unitflag & UNIT_FLAG_STUNNED && !usableWhileStunned && CheckCasterNotImmunedStunAuras(param1))
+ result = SPELL_FAILED_STUNNED;
+ else if (unitflag & UNIT_FLAG_SILENCED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE && CheckCasterNotImmunedSilenceAuras(param1))
+ result = SPELL_FAILED_SILENCED;
+ else if (unitflag & UNIT_FLAG_PACIFIED && m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY && CheckCasterNotImmunedPacifyAuras(param1))
+ result = SPELL_FAILED_PACIFIED;
+ else if (unitflag & UNIT_FLAG_FLEEING && !usableWhileFeared && CheckCasterNotImmunedFearAuras(param1))
+ result = SPELL_FAILED_FLEEING;
+ else if (unitflag & UNIT_FLAG_CONFUSED && !usableWhileConfused && CheckCasterNotImmunedDisorientAuras(param1))
+ result = SPELL_FAILED_CONFUSED;
// Attr must make flag drop spell totally immune from all effects
- if (prevented_reason != SPELL_CAST_OK)
+ if (result != SPELL_CAST_OK)
+ return (param1 && *param1) ? SPELL_FAILED_PREVENTED_BY_MECHANIC : result;
+
+ return SPELL_CAST_OK;
+}
+
+// based on sub_00804430 from 12340 client
+bool Spell::CheckCasterHasNotImmunedAuraType(AuraType auraType, uint32* param1) const
+{
+ // Checking auras is needed now, because you are prevented by some state but the spell grants immunity.
+ Unit::AuraEffectList const& auraEffects = m_caster->GetAuraEffectsByType(auraType);
+ if (auraEffects.empty())
+ return false;
+
+ for (AuraEffect const* aurEff : auraEffects)
{
- if (school_immune || mechanic_immune || dispel_immune)
- {
- //Checking auras is needed now, because you are prevented by some state but the spell grants immunity.
- Unit::AuraApplicationMap const& auras = m_caster->GetAppliedAuras();
- for (Unit::AuraApplicationMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
- {
- Aura const* aura = itr->second->GetBase();
- SpellInfo const* auraInfo = aura->GetSpellInfo();
- if (auraInfo->GetAllEffectsMechanicMask() & mechanic_immune)
- continue;
- if (auraInfo->GetSchoolMask() & school_immune && !auraInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE))
- continue;
- if (auraInfo->GetDispelMask() & dispel_immune)
- continue;
+ SpellInfo const* auraInfo = aurEff->GetSpellInfo();
+ if (m_spellInfo->CanSpellCastOverrideAuraEffect(auraInfo, aurEff->GetEffIndex()))
+ continue;
- //Make a second check for spell failed so the right SPELL_FAILED message is returned.
- //That is needed when your casting is prevented by multiple states and you are only immune to some of them.
- for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
- {
- if (AuraEffect* part = aura->GetEffect(i))
- {
- switch (part->GetAuraType())
- {
- case SPELL_AURA_MOD_STUN:
- if (!usableInStun || !(auraInfo->GetAllEffectsMechanicMask() & (1<<MECHANIC_STUN)))
- return SPELL_FAILED_STUNNED;
- break;
- case SPELL_AURA_MOD_CONFUSE:
- if (!m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_CONFUSED))
- return SPELL_FAILED_CONFUSED;
- break;
- case SPELL_AURA_MOD_FEAR:
- if (!m_spellInfo->HasAttribute(SPELL_ATTR5_USABLE_WHILE_FEARED))
- return SPELL_FAILED_FLEEING;
- break;
- case SPELL_AURA_MOD_SILENCE:
- case SPELL_AURA_MOD_PACIFY:
- case SPELL_AURA_MOD_PACIFY_SILENCE:
- if (m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_PACIFY)
- return SPELL_FAILED_PACIFIED;
- else if (m_spellInfo->PreventionType == SPELL_PREVENTION_TYPE_SILENCE)
- return SPELL_FAILED_SILENCED;
- break;
- default: break;
- }
- }
- }
- }
+ if (param1)
+ {
+ *param1 = auraInfo->Effects[aurEff->GetEffIndex()].Mechanic;
+ if (!*param1)
+ *param1 = auraInfo->Mechanic;
}
- // You are prevented from casting and the spell cast does not grant immunity. Return a failed error.
- else
- return prevented_reason;
+ return true;
}
- return SPELL_CAST_OK;
+
+ return false;
+}
+
+bool Spell::CheckCasterNotImmunedCharmAuras(uint32* param1) const
+{
+ return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_CHARM, param1) ||
+ CheckCasterHasNotImmunedAuraType(SPELL_AURA_AOE_CHARM, param1) ||
+ CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_POSSESS, param1);
+}
+
+bool Spell::CheckCasterNotImmunedStunAuras(uint32* param1) const
+{
+ return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_STUN, param1);
+}
+
+bool Spell::CheckCasterNotImmunedSilenceAuras(uint32* param1) const
+{
+ return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_SILENCE, param1) ||
+ CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_PACIFY_SILENCE, param1);
+}
+
+bool Spell::CheckCasterNotImmunedPacifyAuras(uint32* param1) const
+{
+ return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_PACIFY, param1) ||
+ CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_PACIFY_SILENCE, param1);
+}
+
+bool Spell::CheckCasterNotImmunedFearAuras(uint32* param1) const
+{
+ return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_FEAR, param1);
+}
+
+bool Spell::CheckCasterNotImmunedDisorientAuras(uint32* param1) const
+{
+ return CheckCasterHasNotImmunedAuraType(SPELL_AURA_MOD_CONFUSE, param1);
}
bool Spell::CanAutoCast(Unit* target)
@@ -5826,7 +5918,7 @@ bool Spell::CanAutoCast(Unit* target)
return false;
}
-SpellCastResult Spell::CheckRange(bool strict)
+SpellCastResult Spell::CheckRange(bool strict) const
{
// Don't check for instant cast spells
if (!strict && m_casttime == 0)
@@ -5856,20 +5948,20 @@ SpellCastResult Spell::CheckRange(bool strict)
if (m_targets.HasDst() && !m_targets.HasTraj())
{
if (m_caster->GetExactDistSq(m_targets.GetDstPos()) > maxRange)
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT;
+ return SPELL_FAILED_OUT_OF_RANGE;
if (minRange > 0.0f && m_caster->GetExactDistSq(m_targets.GetDstPos()) < minRange)
- return !(_triggeredCastFlags & TRIGGERED_DONT_REPORT_CAST_ERROR) ? SPELL_FAILED_OUT_OF_RANGE : SPELL_FAILED_DONT_REPORT;
+ return SPELL_FAILED_OUT_OF_RANGE;
}
return SPELL_CAST_OK;
}
-std::pair<float, float> Spell::GetMinMaxRange(bool strict)
+std::pair<float, float> Spell::GetMinMaxRange(bool strict) const
{
float rangeMod = 0.0f;
float minRange = 0.0f;
float maxRange = 0.0f;
- if (strict && IsNextMeleeSwingSpell())
+ if (strict && m_spellInfo->IsNextMeleeSwingSpell())
{
maxRange = 100.0f;
return std::pair<float, float>(minRange, maxRange);
@@ -5911,14 +6003,14 @@ std::pair<float, float> Spell::GetMinMaxRange(bool strict)
maxRange *= ranged->GetTemplate()->RangedModRange * 0.01f;
if (Player* modOwner = m_caster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_RANGE>(m_spellInfo->Id, maxRange, this);
+ modOwner->ApplySpellMod<SPELLMOD_RANGE>(m_spellInfo->Id, maxRange, const_cast<Spell*>(this));
maxRange += rangeMod;
return std::pair<float, float>(minRange, maxRange);
}
-SpellCastResult Spell::CheckPower()
+SpellCastResult Spell::CheckPower() const
{
// item cast not used power
if (m_CastItem)
@@ -5954,12 +6046,15 @@ SpellCastResult Spell::CheckPower()
return SPELL_CAST_OK;
}
-SpellCastResult Spell::CheckItems()
+SpellCastResult Spell::CheckItems(uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/) const
{
Player* player = m_caster->ToPlayer();
if (!player)
return SPELL_CAST_OK;
+ if (m_spellInfo->HasAttribute(SPELL_ATTR2_IGNORE_ITEM_CHECK))
+ return SPELL_CAST_OK;
+
if (!m_CastItem)
{
if (m_castItemGUID)
@@ -6035,10 +6130,11 @@ SpellCastResult Spell::CheckItems()
// check target item
if (m_targets.GetItemTargetGUID())
{
- if (!m_targets.GetItemTarget())
+ Item* item = m_targets.GetItemTarget();
+ if (!item)
return SPELL_FAILED_ITEM_GONE;
- if (!m_targets.GetItemTarget()->IsFitToSpellRequirements(m_spellInfo))
+ if (!item->IsFitToSpellRequirements(m_spellInfo))
return SPELL_FAILED_EQUIPPED_ITEM_CLASS;
}
// if not item target then required item must be equipped
@@ -6088,7 +6184,11 @@ SpellCastResult Spell::CheckItems()
}
}
if (!player->HasItemCount(itemid, itemcount))
+ {
+ if (param1)
+ *param1 = itemid;
return SPELL_FAILED_REAGENTS;
+ }
}
}
@@ -6292,21 +6392,29 @@ SpellCastResult Spell::CheckItems()
}
case SPELL_EFFECT_PROSPECTING:
{
- if (!m_targets.GetItemTarget())
+ Item* item = m_targets.GetItemTarget();
+ if (!item)
return SPELL_FAILED_CANT_BE_PROSPECTED;
//ensure item is a prospectable ore
- if (!(m_targets.GetItemTarget()->GetTemplate()->Flags & ITEM_FLAG_IS_PROSPECTABLE))
+ if (!(item->GetTemplate()->Flags & ITEM_FLAG_IS_PROSPECTABLE))
return SPELL_FAILED_CANT_BE_PROSPECTED;
//prevent prospecting in trade slot
- if (m_targets.GetItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
+ if (item->GetOwnerGUID() != m_caster->GetGUID())
return SPELL_FAILED_CANT_BE_PROSPECTED;
//Check for enough skill in jewelcrafting
- uint32 item_prospectingskilllevel = m_targets.GetItemTarget()->GetTemplate()->RequiredSkillRank;
- if (item_prospectingskilllevel >player->GetSkillValue(SKILL_JEWELCRAFTING))
+ uint32 item_prospectingskilllevel = item->GetTemplate()->RequiredSkillRank;
+ if (item_prospectingskilllevel > player->GetSkillValue(SKILL_JEWELCRAFTING))
return SPELL_FAILED_LOW_CASTLEVEL;
//make sure the player has the required ores in inventory
- if (m_targets.GetItemTarget()->GetCount() < 5)
+ if (item->GetCount() < 5)
+ {
+ if (param1 && param2)
+ {
+ *param1 = item->GetEntry();
+ *param2 = 5;
+ }
return SPELL_FAILED_NEED_MORE_ITEMS;
+ }
if (!LootTemplates_Prospecting.HaveLootFor(m_targets.GetItemTargetEntry()))
return SPELL_FAILED_CANT_BE_PROSPECTED;
@@ -6315,21 +6423,29 @@ SpellCastResult Spell::CheckItems()
}
case SPELL_EFFECT_MILLING:
{
- if (!m_targets.GetItemTarget())
+ Item* item = m_targets.GetItemTarget();
+ if (!item)
return SPELL_FAILED_CANT_BE_MILLED;
//ensure item is a millable herb
- if (!(m_targets.GetItemTarget()->GetTemplate()->Flags & ITEM_FLAG_IS_MILLABLE))
+ if (!(item->GetTemplate()->Flags & ITEM_FLAG_IS_MILLABLE))
return SPELL_FAILED_CANT_BE_MILLED;
//prevent milling in trade slot
- if (m_targets.GetItemTarget()->GetOwnerGUID() != m_caster->GetGUID())
+ if (item->GetOwnerGUID() != m_caster->GetGUID())
return SPELL_FAILED_CANT_BE_MILLED;
//Check for enough skill in inscription
- uint32 item_millingskilllevel = m_targets.GetItemTarget()->GetTemplate()->RequiredSkillRank;
+ uint32 item_millingskilllevel = item->GetTemplate()->RequiredSkillRank;
if (item_millingskilllevel > player->GetSkillValue(SKILL_INSCRIPTION))
return SPELL_FAILED_LOW_CASTLEVEL;
//make sure the player has the required herbs in inventory
- if (m_targets.GetItemTarget()->GetCount() < 5)
+ if (item->GetCount() < 5)
+ {
+ if (param1 && param2)
+ {
+ *param1 = item->GetEntry();
+ *param2 = 5;
+ }
return SPELL_FAILED_NEED_MORE_ITEMS;
+ }
if (!LootTemplates_Milling.HaveLootFor(m_targets.GetItemTargetEntry()))
return SPELL_FAILED_CANT_BE_MILLED;
@@ -6601,14 +6717,14 @@ bool Spell::UpdatePointers()
CurrentSpellTypes Spell::GetCurrentContainer() const
{
- if (IsNextMeleeSwingSpell())
- return(CURRENT_MELEE_SPELL);
+ if (m_spellInfo->IsNextMeleeSwingSpell())
+ return CURRENT_MELEE_SPELL;
else if (IsAutoRepeat())
- return(CURRENT_AUTOREPEAT_SPELL);
+ return CURRENT_AUTOREPEAT_SPELL;
else if (m_spellInfo->IsChanneled())
- return(CURRENT_CHANNELED_SPELL);
- else
- return(CURRENT_GENERIC_SPELL);
+ return CURRENT_CHANNELED_SPELL;
+
+ return CURRENT_GENERIC_SPELL;
}
bool Spell::CheckEffectTarget(Unit const* target, uint32 eff, Position const* losPosition) const
@@ -6687,11 +6803,6 @@ bool Spell::CheckEffectTarget(Unit const* target, uint32 eff, Position const* lo
return true;
}
-bool Spell::IsNextMeleeSwingSpell() const
-{
- return m_spellInfo->HasAttribute(SPELL_ATTR0_ON_NEXT_SWING);
-}
-
bool Spell::IsAutoActionResetSpell() const
{
/// @todo changed SPELL_INTERRUPT_FLAG_AUTOATTACK -> SPELL_INTERRUPT_FLAG_INTERRUPT to fix compile - is this check correct at all?
@@ -7069,7 +7180,7 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value)
void Spell::PrepareTargetProcessing()
{
- CheckEffectExecuteData();
+ AssertEffectExecuteData();
}
void Spell::FinishTargetProcessing()
@@ -7094,7 +7205,7 @@ void Spell::InitEffectExecuteData(uint8 effIndex)
}
}
-void Spell::CheckEffectExecuteData()
+void Spell::AssertEffectExecuteData() const
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
ASSERT(!m_effectExecuteData[i]);
@@ -7102,29 +7213,20 @@ void Spell::CheckEffectExecuteData()
void Spell::LoadScripts()
{
- sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts);
- for (std::list<SpellScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();)
+ sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts, this);
+ for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
{
- if (!(*itr)->_Load(this))
- {
- std::list<SpellScript*>::iterator bitr = itr;
- ++itr;
- delete (*bitr);
- m_loadedScripts.erase(bitr);
- continue;
- }
TC_LOG_DEBUG("spells", "Spell::LoadScripts: Script `%s` for spell `%u` is loaded now", (*itr)->_GetScriptName()->c_str(), m_spellInfo->Id);
(*itr)->Register();
- ++itr;
}
}
void Spell::CallScriptBeforeCastHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_CAST);
- std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin();
+ auto hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin();
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
@@ -7134,10 +7236,10 @@ void Spell::CallScriptBeforeCastHandlers()
void Spell::CallScriptOnCastHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_ON_CAST);
- std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin();
+ auto hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin();
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
@@ -7147,10 +7249,10 @@ void Spell::CallScriptOnCastHandlers()
void Spell::CallScriptAfterCastHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_CAST);
- std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin();
+ auto hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin();
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
@@ -7161,10 +7263,10 @@ void Spell::CallScriptAfterCastHandlers()
SpellCastResult Spell::CallScriptCheckCastHandlers()
{
SpellCastResult retVal = SPELL_CAST_OK;
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_CHECK_CAST);
- std::list<SpellScript::CheckCastHandler>::iterator hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin();
+ auto hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin();
for (; hookItr != hookItrEnd; ++hookItr)
{
SpellCastResult tempResult = (*hookItr).Call(*scritr);
@@ -7179,7 +7281,7 @@ SpellCastResult Spell::CallScriptCheckCastHandlers()
void Spell::PrepareScriptHitHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
(*scritr)->_InitHit();
}
@@ -7187,9 +7289,9 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo
{
// execute script effect handler hooks and check if effects was prevented
bool preventDefault = false;
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
- std::list<SpellScript::EffectHandler>::iterator effItr, effEndItr;
+ HookList<SpellScript::EffectHandler>::iterator effItr, effEndItr;
SpellScriptHookType hookType;
switch (mode)
{
@@ -7233,10 +7335,10 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo
void Spell::CallScriptSuccessfulDispel(SpellEffIndex effIndex)
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_EFFECT_SUCCESSFUL_DISPEL);
- std::list<SpellScript::EffectHandler>::iterator hookItrEnd = (*scritr)->OnEffectSuccessfulDispel.end(), hookItr = (*scritr)->OnEffectSuccessfulDispel.begin();
+ auto hookItrEnd = (*scritr)->OnEffectSuccessfulDispel.end(), hookItr = (*scritr)->OnEffectSuccessfulDispel.begin();
for (; hookItr != hookItrEnd; ++hookItr)
hookItr->Call(*scritr, effIndex);
@@ -7246,10 +7348,10 @@ void Spell::CallScriptSuccessfulDispel(SpellEffIndex effIndex)
void Spell::CallScriptBeforeHitHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_HIT);
- std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
+ auto hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
@@ -7259,10 +7361,10 @@ void Spell::CallScriptBeforeHitHandlers()
void Spell::CallScriptOnHitHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_HIT);
- std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
+ auto hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
@@ -7272,10 +7374,10 @@ void Spell::CallScriptOnHitHandlers()
void Spell::CallScriptAfterHitHandlers()
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_HIT);
- std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
+ auto hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
@@ -7285,10 +7387,10 @@ void Spell::CallScriptAfterHitHandlers()
void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list<WorldObject*>& targets, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_AREA_TARGET_SELECT);
- std::list<SpellScript::ObjectAreaTargetSelectHandler>::iterator hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin();
+ auto hookItrEnd = (*scritr)->OnObjectAreaTargetSelect.end(), hookItr = (*scritr)->OnObjectAreaTargetSelect.begin();
for (; hookItr != hookItrEnd; ++hookItr)
if (hookItr->IsEffectAffected(m_spellInfo, effIndex) && targetType.GetTarget() == hookItr->GetTarget())
hookItr->Call(*scritr, targets);
@@ -7299,10 +7401,10 @@ void Spell::CallScriptObjectAreaTargetSelectHandlers(std::list<WorldObject*>& ta
void Spell::CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_OBJECT_TARGET_SELECT);
- std::list<SpellScript::ObjectTargetSelectHandler>::iterator hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin();
+ auto hookItrEnd = (*scritr)->OnObjectTargetSelect.end(), hookItr = (*scritr)->OnObjectTargetSelect.begin();
for (; hookItr != hookItrEnd; ++hookItr)
if (hookItr->IsEffectAffected(m_spellInfo, effIndex) && targetType.GetTarget() == hookItr->GetTarget())
hookItr->Call(*scritr, target);
@@ -7313,10 +7415,10 @@ void Spell::CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffI
void Spell::CallScriptDestinationTargetSelectHandlers(SpellDestination& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType)
{
- for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
+ for (auto scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_DESTINATION_TARGET_SELECT);
- std::list<SpellScript::DestinationTargetSelectHandler>::iterator hookItrEnd = (*scritr)->OnDestinationTargetSelect.end(), hookItr = (*scritr)->OnDestinationTargetSelect.begin();
+ auto hookItrEnd = (*scritr)->OnDestinationTargetSelect.end(), hookItr = (*scritr)->OnDestinationTargetSelect.begin();
for (; hookItr != hookItrEnd; ++hookItr)
if (hookItr->IsEffectAffected(m_spellInfo, effIndex) && targetType.GetTarget() == hookItr->GetTarget())
hookItr->Call(*scritr, target);
@@ -7331,15 +7433,15 @@ bool Spell::CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToC
if (m_loadedScripts.empty())
return true;
- for (std::list<SpellScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
+ for (auto itr = m_loadedScripts.begin(); itr != m_loadedScripts.end(); ++itr)
{
- std::list<SpellScript::ObjectTargetSelectHandler>::iterator targetSelectHookEnd = (*itr)->OnObjectTargetSelect.end(), targetSelectHookItr = (*itr)->OnObjectTargetSelect.begin();
+ auto targetSelectHookEnd = (*itr)->OnObjectTargetSelect.end(), targetSelectHookItr = (*itr)->OnObjectTargetSelect.begin();
for (; targetSelectHookItr != targetSelectHookEnd; ++targetSelectHookItr)
if (((*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && !(*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck)) ||
(!(*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && (*targetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck)))
return false;
- std::list<SpellScript::ObjectAreaTargetSelectHandler>::iterator areaTargetSelectHookEnd = (*itr)->OnObjectAreaTargetSelect.end(), areaTargetSelectHookItr = (*itr)->OnObjectAreaTargetSelect.begin();
+ auto areaTargetSelectHookEnd = (*itr)->OnObjectAreaTargetSelect.end(), areaTargetSelectHookItr = (*itr)->OnObjectAreaTargetSelect.begin();
for (; areaTargetSelectHookItr != areaTargetSelectHookEnd; ++areaTargetSelectHookItr)
if (((*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && !(*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck)) ||
(!(*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndex) && (*areaTargetSelectHookItr).IsEffectAffected(m_spellInfo, effIndexToCheck)))
@@ -7389,25 +7491,24 @@ void Spell::PrepareTriggersExecutedOnHit()
// save auras which were present on spell caster on cast, to prevent triggered auras from affecting caster
// and to correctly calculate proc chance when combopoints are present
Unit::AuraEffectList const& targetTriggers = m_caster->GetAuraEffectsByType(SPELL_AURA_ADD_TARGET_TRIGGER);
- for (Unit::AuraEffectList::const_iterator i = targetTriggers.begin(); i != targetTriggers.end(); ++i)
+ for (AuraEffect const* aurEff : targetTriggers)
{
- if (!(*i)->IsAffectedOnSpell(m_spellInfo))
+ if (!aurEff->IsAffectedOnSpell(m_spellInfo))
continue;
- SpellInfo const* auraSpellInfo = (*i)->GetSpellInfo();
- uint32 auraSpellIdx = (*i)->GetEffIndex();
+
+ SpellInfo const* auraSpellInfo = aurEff->GetSpellInfo();
+ uint32 auraSpellIdx = aurEff->GetEffIndex();
if (SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(auraSpellInfo->Effects[auraSpellIdx].TriggerSpell))
{
// calculate the chance using spell base amount, because aura amount is not updated on combo-points change
// this possibly needs fixing
- int32 auraBaseAmount = (*i)->GetBaseAmount();
+ int32 auraBaseAmount = aurEff->GetBaseAmount();
// proc chance is stored in effect amount
- int32 chance = m_caster->CalculateSpellDamage(NULL, auraSpellInfo, auraSpellIdx, &auraBaseAmount);
+ int32 chance = m_caster->CalculateSpellDamage(nullptr, auraSpellInfo, auraSpellIdx, &auraBaseAmount);
+ chance *= aurEff->GetBase()->GetStackAmount();
+
// build trigger and add to the list
- HitTriggerSpell spellTriggerInfo;
- spellTriggerInfo.triggeredSpell = spellInfo;
- spellTriggerInfo.triggeredByAura = auraSpellInfo;
- spellTriggerInfo.chance = chance * (*i)->GetBase()->GetStackAmount();
- m_hitTriggerSpells.push_back(spellTriggerInfo);
+ m_hitTriggerSpells.emplace_back(spellInfo, auraSpellInfo, chance);
}
}
}
diff --git a/src/server/game/Spells/Spell.h b/src/server/game/Spells/Spell.h
index 5087ececa09..aa3b6ca358a 100644
--- a/src/server/game/Spells/Spell.h
+++ b/src/server/game/Spells/Spell.h
@@ -397,7 +397,7 @@ class TC_GAME_API Spell
void TakeReagents();
void TakeCastItem();
- SpellCastResult CheckCast(bool strict);
+ SpellCastResult CheckCast(bool strict, uint32* param1 = nullptr, uint32* param2 = nullptr);
SpellCastResult CheckPetCast(Unit* target);
// handlers
@@ -407,11 +407,19 @@ class TC_GAME_API Spell
void _handle_immediate_phase();
void _handle_finish_phase();
- SpellCastResult CheckItems();
- SpellCastResult CheckRange(bool strict);
- SpellCastResult CheckPower();
- SpellCastResult CheckRuneCost(uint32 runeCostID);
- SpellCastResult CheckCasterAuras() const;
+ SpellCastResult CheckItems(uint32* param1, uint32* param2) const;
+ SpellCastResult CheckRange(bool strict) const;
+ SpellCastResult CheckPower() const;
+ SpellCastResult CheckRuneCost(uint32 runeCostID) const;
+ SpellCastResult CheckCasterAuras(uint32* param1) const;
+
+ bool CheckCasterHasNotImmunedAuraType(AuraType auraType, uint32* param1) const;
+ bool CheckCasterNotImmunedCharmAuras(uint32* param1) const;
+ bool CheckCasterNotImmunedStunAuras(uint32* param1) const;
+ bool CheckCasterNotImmunedSilenceAuras(uint32* param1) const;
+ bool CheckCasterNotImmunedPacifyAuras(uint32* param1) const;
+ bool CheckCasterNotImmunedFearAuras(uint32* param1) const;
+ bool CheckCasterNotImmunedDisorientAuras(uint32* param1) const;
int32 CalculateDamage(uint8 i, Unit const* target) const { return m_caster->CalculateSpellDamage(target, m_spellInfo, i, &m_spellValue->EffectBasePoints[i]); }
@@ -430,9 +438,9 @@ class TC_GAME_API Spell
void CheckSrc() { if (!m_targets.HasSrc()) m_targets.SetSrc(*m_caster); }
void CheckDst() { if (!m_targets.HasDst()) m_targets.SetDst(*m_caster); }
- static void WriteCastResultInfo(WorldPacket& data, Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError);
- static void SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE);
- void SendCastResult(SpellCastResult result);
+ static void WriteCastResultInfo(WorldPacket& data, Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError, uint32* param1 = nullptr, uint32* param2 = nullptr);
+ static void SendCastResult(Player* caster, SpellInfo const* spellInfo, uint8 castCount, SpellCastResult result, SpellCustomErrors customError = SPELL_CUSTOM_ERROR_NONE, uint32* param1 = nullptr, uint32* param2 = nullptr);
+ void SendCastResult(SpellCastResult result, uint32* param1 = nullptr, uint32* param2 = nullptr) const;
void SendPetCastResult(SpellCastResult result);
void SendSpellStart();
void SendSpellGo();
@@ -473,12 +481,14 @@ class TC_GAME_API Spell
bool IsAutoRepeat() const { return m_autoRepeat; }
void SetAutoRepeat(bool rep) { m_autoRepeat = rep; }
void ReSetTimer() { m_timer = m_casttime > 0 ? m_casttime : 0; }
- bool IsNextMeleeSwingSpell() const;
bool IsTriggered() const { return (_triggeredCastFlags & TRIGGERED_FULL_MASK) != 0; }
bool IsIgnoringCooldowns() const { return (_triggeredCastFlags & TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD) != 0; }
+ bool IsProcDisabled() const { return (_triggeredCastFlags & TRIGGERED_DISALLOW_PROC_EVENTS) != 0; }
bool IsChannelActive() const { return m_caster->GetUInt32Value(UNIT_CHANNEL_SPELL) != 0; }
bool IsAutoActionResetSpell() const;
+ bool IsTriggeredByAura(SpellInfo const* auraSpellInfo) const { return (auraSpellInfo == m_triggeredByAuraSpell); }
+
bool IsDeletable() const { return !m_referencedFromCurrentSpell && !m_executedCurrently; }
void SetReferencedFromCurrent(bool yes) { m_referencedFromCurrentSpell = yes; }
bool IsInterruptable() const { return !m_executedCurrently; }
@@ -507,7 +517,7 @@ class TC_GAME_API Spell
void CancelGlobalCooldown();
void SendLoot(ObjectGuid guid, LootType loottype);
- std::pair<float, float> GetMinMaxRange(bool strict);
+ std::pair<float, float> GetMinMaxRange(bool strict) const;
Unit* const m_caster;
@@ -636,7 +646,7 @@ class TC_GAME_API Spell
// spell execution log
void InitEffectExecuteData(uint8 effIndex);
- void CheckEffectExecuteData();
+ void AssertEffectExecuteData() const;
// Scripting system
void LoadScripts();
@@ -654,10 +664,13 @@ class TC_GAME_API Spell
void CallScriptObjectTargetSelectHandlers(WorldObject*& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
void CallScriptDestinationTargetSelectHandlers(SpellDestination& target, SpellEffIndex effIndex, SpellImplicitTargetInfo const& targetType);
bool CheckScriptEffectImplicitTargets(uint32 effIndex, uint32 effIndexToCheck);
- std::list<SpellScript*> m_loadedScripts;
+ std::vector<SpellScript*> m_loadedScripts;
struct HitTriggerSpell
{
+ HitTriggerSpell(SpellInfo const* spellInfo, SpellInfo const* auraSpellInfo, int32 procChance) :
+ triggeredSpell(spellInfo), triggeredByAura(auraSpellInfo), chance(procChance) { }
+
SpellInfo const* triggeredSpell;
SpellInfo const* triggeredByAura;
// uint8 triggeredByEffIdx This might be needed at a later stage - No need known for now
@@ -666,7 +679,7 @@ class TC_GAME_API Spell
bool CanExecuteTriggersOnHit(uint8 effMask, SpellInfo const* triggeredByAura = NULL) const;
void PrepareTriggersExecutedOnHit();
- typedef std::list<HitTriggerSpell> HitTriggerSpellList;
+ typedef std::vector<HitTriggerSpell> HitTriggerSpellList;
HitTriggerSpellList m_hitTriggerSpells;
// effect helpers
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index f321925aa8c..7afcf52172a 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -292,14 +292,18 @@ void Spell::EffectEnvironmentalDMG(SpellEffIndex /*effIndex*/)
if (!unitTarget || !unitTarget->IsAlive())
return;
- uint32 absorb = 0;
- uint32 resist = 0;
-
- m_caster->CalcAbsorbResist(unitTarget, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, damage, &absorb, &resist, m_spellInfo);
-
- m_caster->SendSpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_spellInfo->GetSchoolMask(), absorb, resist, false, 0, false);
+ // CalcAbsorbResist already in Player::EnvironmentalDamage
if (unitTarget->GetTypeId() == TYPEID_PLAYER)
unitTarget->ToPlayer()->EnvironmentalDamage(DAMAGE_FIRE, damage);
+ else
+ {
+ DamageInfo damageInfo(m_caster, unitTarget, damage, m_spellInfo, m_spellInfo->GetSchoolMask(), SPELL_DIRECT_DAMAGE, BASE_ATTACK);
+ m_caster->CalcAbsorbResist(damageInfo);
+
+ uint32 absorb = damageInfo.GetAbsorb();
+ uint32 resist = damageInfo.GetResist();
+ m_caster->SendSpellNonMeleeDamageLog(unitTarget, m_spellInfo->Id, damage, m_spellInfo->GetSchoolMask(), absorb, resist, false, 0, false);
+ }
}
void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
@@ -395,9 +399,9 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
// Conflagrate - consumes Immolate or Shadowflame
else if (m_spellInfo->TargetAuraState == AURA_STATE_CONFLAGRATE)
{
- AuraEffect const* aura = NULL; // found req. aura for damage calculation
+ AuraEffect const* aura = nullptr; // found req. aura for damage calculation
- Unit::AuraEffectList const &mPeriodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
+ Unit::AuraEffectList const& mPeriodic = unitTarget->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
for (Unit::AuraEffectList::const_iterator i = mPeriodic.begin(); i != mPeriodic.end(); ++i)
{
// for caster applied auras only
@@ -420,15 +424,22 @@ void Spell::EffectSchoolDMG(SpellEffIndex effIndex)
// found Immolate or Shadowflame
if (aura)
{
- uint32 pdamage = uint32(std::max(aura->GetAmount(), 0));
- pdamage = m_caster->SpellDamageBonusDone(unitTarget, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount());
- pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT, aura->GetBase()->GetStackAmount());
- uint32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 1));
- uint8 baseTotalTicks = uint8(m_caster->CalcSpellDuration(aura->GetSpellInfo()) / aura->GetSpellInfo()->Effects[EFFECT_0].Amplitude);
- damage += int32(CalculatePct(pdamage * baseTotalTicks, pct_dir));
+ // Calculate damage of Immolate/Shadowflame tick
+ int32 pdamage = (aura->GetAmount() + aura->GetBonusAmount()) * aura->GetDonePct();
+ if (Player* modOwner = m_caster->GetSpellModOwner())
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(GetSpellInfo()->Id, pdamage);
- uint32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, (effIndex + 2)) / 3;
- m_spellValue->EffectBasePoints[1] = m_spellInfo->Effects[EFFECT_1].CalcBaseValue(int32(CalculatePct(pdamage * baseTotalTicks, pct_dot)));
+ pdamage = unitTarget->SpellDamageBonusTaken(m_caster, aura->GetSpellInfo(), pdamage, DOT);
+
+ // And multiply by amount of ticks to get damage potential
+ pdamage *= aura->GetSpellInfo()->GetMaxTicks();
+
+ int32 pct_dir = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, EFFECT_1);
+ damage += CalculatePct(pdamage, pct_dir);
+
+ int32 pct_dot = m_caster->CalculateSpellDamage(unitTarget, m_spellInfo, EFFECT_2);
+ int32 const dotBasePoints = CalculatePct(pdamage, pct_dot);
+ m_spellValue->EffectBasePoints[EFFECT_1] = dotBasePoints / m_spellInfo->GetMaxTicks();
apply_direct_bonus = false;
// Glyph of Conflagrate
@@ -1393,9 +1404,12 @@ void Spell::EffectHeal(SpellEffIndex /*effIndex*/)
return;
}
- int32 tickheal = targetAura->GetAmount();
- if (Unit* auraCaster = targetAura->GetCaster())
- tickheal = auraCaster->SpellHealingBonusDone(unitTarget, targetAura->GetSpellInfo(), tickheal, DOT);
+ int32 tickheal = (targetAura->GetAmount() + targetAura->GetBonusAmount()) * targetAura->GetDonePct();
+ if (Player* modOwner = m_caster->GetSpellModOwner())
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(targetAura->GetId(), tickheal);
+
+ unitTarget->SpellHealingBonusTaken(m_caster, targetAura->GetSpellInfo(), tickheal, DOT);
+
//int32 tickheal = targetAura->GetSpellInfo()->EffectBasePoints[idx] + 1;
//It is said that talent bonus should not be included
@@ -2103,6 +2117,8 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
m_castItemEntry = 0;
player->StoreItem(dest, pNewItem, true);
+ player->SendNewItem(pNewItem, 1, true, false);
+ player->ItemAddedQuestCheck(newitemid, 1);
return;
}
}
@@ -2147,6 +2163,8 @@ void Spell::EffectSummonChangeItem(SpellEffIndex effIndex)
player->EquipItem(dest, pNewItem, true);
player->AutoUnequipOffhandIfNeed();
+ player->SendNewItem(pNewItem, 1, true, false);
+ player->ItemAddedQuestCheck(newitemid, 1);
return;
}
}
@@ -3362,8 +3380,10 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
}
}
- // apply to non-weapon bonus weapon total pct effect, weapon total flat effect included in weapon damage
- if (fixed_bonus || spell_bonus)
+ // if (addPctMods) { percent mods are added in Unit::CalculateDamage } else { percent mods are added in Unit::MeleeDamageBonusDone }
+ // this distinction is neccessary to properly inform the client about his autoattack damage values from Script_UnitDamage
+ bool addPctMods = !m_spellInfo->HasAttribute(SPELL_ATTR6_NO_DONE_PCT_DAMAGE_MODS) && (m_spellSchoolMask & SPELL_SCHOOL_MASK_NORMAL);
+ if (addPctMods)
{
UnitMods unitMod;
switch (m_attackType)
@@ -3374,17 +3394,14 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
case RANGED_ATTACK: unitMod = UNIT_MOD_DAMAGE_RANGED; break;
}
- float weapon_total_pct = 1.0f;
- if (m_spellInfo->SchoolMask & SPELL_SCHOOL_MASK_NORMAL)
- weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT);
-
+ float weapon_total_pct = m_caster->GetModifierValue(unitMod, TOTAL_PCT);
if (fixed_bonus)
fixed_bonus = int32(fixed_bonus * weapon_total_pct);
if (spell_bonus)
spell_bonus = int32(spell_bonus * weapon_total_pct);
}
- int32 weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, true);
+ int32 weaponDamage = m_caster->CalculateDamage(m_attackType, normalized, addPctMods);
// Sequence is important
for (int j = 0; j < MAX_SPELL_EFFECTS; ++j)
@@ -3399,17 +3416,14 @@ void Spell::EffectWeaponDmg(SpellEffIndex effIndex)
weaponDamage += fixed_bonus;
break;
case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
- weaponDamage = int32(weaponDamage* weaponDamagePercentMod);
+ weaponDamage = int32(weaponDamage * weaponDamagePercentMod);
default:
break; // not weapon damage effect, just skip
}
}
- if (spell_bonus)
- weaponDamage += spell_bonus;
-
- if (totalDamagePercentMod != 1.0f)
- weaponDamage = int32(weaponDamage* totalDamagePercentMod);
+ weaponDamage += spell_bonus;
+ weaponDamage = int32(weaponDamage * totalDamagePercentMod);
// prevent negative damage
uint32 eff_damage(std::max(weaponDamage, 0));
@@ -3531,21 +3545,12 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
if (Battleground* bg = player->GetBattleground())
bg->SetDroppedFlagGUID(pGameObj->GetGUID(), player->GetTeam() == ALLIANCE ? TEAM_HORDE: TEAM_ALLIANCE);
- if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
+ if (GameObject* linkedTrap = pGameObj->GetLinkedTrap())
{
- GameObject* linkedGO = new GameObject();
- if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map, m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), rot, 255, GO_STATE_READY))
- {
- linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
- linkedGO->SetSpellId(m_spellInfo->Id);
-
- ExecuteLogEffectSummonObject(effIndex, linkedGO);
+ linkedTrap->SetRespawnTime(duration > 0 ? duration / IN_MILLISECONDS : 0);
+ linkedTrap->SetSpellId(m_spellInfo->Id);
- // Wild object not have owner and check clickable by players
- map->AddToMap(linkedGO);
- }
- else
- delete linkedGO;
+ ExecuteLogEffectSummonObject(effIndex, linkedTrap);
}
}
@@ -5137,26 +5142,14 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
cMap->AddToMap(pGameObj);
- if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
+ if (GameObject* linkedTrap = pGameObj->GetLinkedTrap())
{
- GameObject* linkedGO = new GameObject;
- if (linkedGO->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, cMap, m_caster->GetPhaseMask(), pos, rot, 255, GO_STATE_READY))
- {
- linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
- //linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
- linkedGO->SetSpellId(m_spellInfo->Id);
- linkedGO->SetOwnerGUID(m_caster->GetGUID());
+ linkedTrap->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
+ //linkedTrap->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
+ linkedTrap->SetSpellId(m_spellInfo->Id);
+ linkedTrap->SetOwnerGUID(m_caster->GetGUID());
- ExecuteLogEffectSummonObject(effIndex, linkedGO);
-
- linkedGO->GetMap()->AddToMap(linkedGO);
- }
- else
- {
- delete linkedGO;
- linkedGO = NULL;
- return;
- }
+ ExecuteLogEffectSummonObject(effIndex, linkedTrap);
}
}
diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp
index 925d5ec57a3..c0fbdf51889 100644
--- a/src/server/game/Spells/SpellInfo.cpp
+++ b/src/server/game/Spells/SpellInfo.cpp
@@ -16,6 +16,7 @@
*/
#include "SpellAuraDefines.h"
+#include "SpellAuras.h"
#include "SpellInfo.h"
#include "SpellMgr.h"
#include "Spell.h"
@@ -894,6 +895,31 @@ bool SpellInfo::HasAreaAuraEffect() const
return false;
}
+bool SpellInfo::HasOnlyDamageEffects() const
+{
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (Effects[i].IsEffect())
+ {
+ switch (Effects[i].Effect)
+ {
+ case SPELL_EFFECT_WEAPON_DAMAGE:
+ case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
+ case SPELL_EFFECT_NORMALIZED_WEAPON_DMG:
+ case SPELL_EFFECT_WEAPON_PERCENT_DAMAGE:
+ case SPELL_EFFECT_SCHOOL_DAMAGE:
+ case SPELL_EFFECT_ENVIRONMENTAL_DAMAGE:
+ case SPELL_EFFECT_HEALTH_LEECH:
+ continue;
+ default:
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
bool SpellInfo::IsExplicitDiscovery() const
{
return ((Effects[0].Effect == SPELL_EFFECT_CREATE_RANDOM_ITEM
@@ -1181,12 +1207,22 @@ bool SpellInfo::IsPositiveEffect(uint8 effIndex) const
bool SpellInfo::IsChanneled() const
{
- return HasAttribute(SPELL_ATTR1_CHANNELED_1) || HasAttribute(SPELL_ATTR1_CHANNELED_2);
+ return HasAttribute(SpellAttr1(SPELL_ATTR1_CHANNELED_1 | SPELL_ATTR1_CHANNELED_2));
+}
+
+bool SpellInfo::IsMoveAllowedChannel() const
+{
+ return IsChanneled() && HasAttribute(SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING);
}
bool SpellInfo::NeedsComboPoints() const
{
- return HasAttribute(SPELL_ATTR1_REQ_COMBO_POINTS1) || HasAttribute(SPELL_ATTR1_REQ_COMBO_POINTS2);
+ return HasAttribute(SpellAttr1(SPELL_ATTR1_REQ_COMBO_POINTS1 | SPELL_ATTR1_REQ_COMBO_POINTS2));
+}
+
+bool SpellInfo::IsNextMeleeSwingSpell() const
+{
+ return HasAttribute(SpellAttr0(SPELL_ATTR0_ON_NEXT_SWING | SPELL_ATTR0_ON_NEXT_SWING_2));
}
bool SpellInfo::IsBreakingStealth() const
@@ -1210,6 +1246,20 @@ bool SpellInfo::HasInitialAggro() const
return !(HasAttribute(SPELL_ATTR1_NO_THREAT) || HasAttribute(SPELL_ATTR3_NO_INITIAL_AGGRO));
}
+bool SpellInfo::IsAffected(uint32 familyName, flag96 const& familyFlags) const
+{
+ if (!familyName)
+ return true;
+
+ if (familyName != SpellFamilyName)
+ return false;
+
+ if (familyFlags && !(familyFlags & SpellFamilyFlags))
+ return false;
+
+ return true;
+}
+
bool SpellInfo::IsAffectedBySpellMods() const
{
return !HasAttribute(SPELL_ATTR3_NO_DONE_BONUS);
@@ -1221,42 +1271,41 @@ bool SpellInfo::IsAffectedBySpellMod(SpellModifier const* mod) const
return false;
SpellInfo const* affectSpell = sSpellMgr->GetSpellInfo(mod->spellId);
- // False if affect_spell == NULL or spellFamily not equal
- if (!affectSpell || affectSpell->SpellFamilyName != SpellFamilyName)
+ if (!affectSpell)
return false;
- // true
- if (mod->mask & SpellFamilyFlags)
- return true;
-
- return false;
+ return IsAffected(affectSpell->SpellFamilyName, mod->mask);
}
-bool SpellInfo::CanPierceImmuneAura(SpellInfo const* aura) const
+bool SpellInfo::CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const
{
- // these spells pierce all avalible spells (Resurrection Sickness for example)
+ // aura can't be pierced
+ if (!auraSpellInfo || auraSpellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
+ return false;
+
+ // these spells pierce all available spells (Resurrection Sickness for example)
if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
return true;
- // these spells (Cyclone for example) can pierce all... // ...but not these (Divine shield, Ice block, Cyclone and Banish for example)
- if (HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !(aura && (aura->Mechanic == MECHANIC_IMMUNE_SHIELD || aura->Mechanic == MECHANIC_INVULNERABILITY || aura->Mechanic == MECHANIC_BANISH)))
+ // Dispels other auras on immunity, check if this spell makes the unit immune to aura
+ if (HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY) && CanSpellProvideImmunityAgainstAura(auraSpellInfo))
return true;
return false;
}
-bool SpellInfo::CanDispelAura(SpellInfo const* aura) const
+bool SpellInfo::CanDispelAura(SpellInfo const* auraSpellInfo) const
{
- // These spells (like Mass Dispel) can dispell all auras, except death persistent ones (like Dungeon and Battleground Deserter)
- if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY) && !aura->IsDeathPersistent())
- return true;
-
// These auras (like Divine Shield) can't be dispelled
- if (aura->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
+ if (auraSpellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
return false;
+ // These spells (like Mass Dispel) can dispel all auras
+ if (HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
+ return true;
+
// These auras (Cyclone for example) are not dispelable
- if (aura->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE))
+ if (auraSpellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) || auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
return false;
return true;
@@ -1411,9 +1460,11 @@ SpellCastResult SpellInfo::CheckLocation(uint32 map_id, uint32 zone_id, uint32 a
// continent limitation (virtual continent)
if (HasAttribute(SPELL_ATTR4_CAST_ONLY_IN_OUTLAND))
{
- uint32 v_map = GetVirtualMapForMapAndZone(map_id, zone_id);
- MapEntry const* mapEntry = sMapStore.LookupEntry(v_map);
- if (!mapEntry || mapEntry->addon < 1 || !mapEntry->IsContinent())
+ AreaTableEntry const* areaEntry = sAreaTableStore.LookupEntry(area_id);
+ if (!areaEntry)
+ areaEntry = sAreaTableStore.LookupEntry(zone_id);
+
+ if (!areaEntry || !areaEntry->IsFlyable() || !player->CanFlyInZone(map_id, zone_id))
return SPELL_FAILED_INCORRECT_AREA;
}
@@ -1982,9 +2033,27 @@ void SpellInfo::_LoadSpellSpecific()
case 8115: // Agility
case 8091: // Armor
return SPELL_SPECIFIC_SCROLL;
+ default:
+ break;
+ }
+
+ switch (Id)
+ {
case 12880: // Enrage (Enrage)
+ case 14201:
+ case 14202:
+ case 14203:
+ case 14204:
case 57518: // Enrage (Wrecking Crew)
+ case 57519:
+ case 57520:
+ case 57521:
+ case 57522:
+ case 57514: // Enrage (Imp. Defensive Stance)
+ case 57516:
return SPELL_SPECIFIC_WARRIOR_ENRAGE;
+ default:
+ break;
}
}
break;
@@ -2441,6 +2510,437 @@ int32 SpellInfo::GetDiminishingReturnsLimitDuration(bool triggered) const
return triggered ? _diminishInfoTriggered.DiminishDurationLimit : _diminishInfoNonTriggered.DiminishDurationLimit;
}
+void SpellInfo::_LoadImmunityInfo()
+{
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ uint32 schoolImmunityMask = 0;
+ uint32 applyHarmfulAuraImmunityMask = 0;
+ uint32 mechanicImmunityMask = 0;
+ uint32 dispelImmunity = 0;
+ uint32 damageImmunityMask = 0;
+
+ int32 miscVal = Effects[i].MiscValue;
+ int32 amount = Effects[i].CalcValue();
+
+ ImmunityInfo& immuneInfo = _immunityInfo[i];
+
+ switch (Effects[i].ApplyAuraName)
+ {
+ case SPELL_AURA_MECHANIC_IMMUNITY_MASK:
+ {
+ switch (miscVal)
+ {
+ case 96: // Free Friend, Uncontrollable Frenzy, Warlord's Presence
+ {
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ break;
+ }
+ case 1615: // Incite Rage, Wolf Spirit, Overload, Lightning Tendrils
+ {
+ switch (Id)
+ {
+ case 43292: // Incite Rage
+ case 49172: // Wolf Spirit
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ // no break intended
+ case 61869: // Overload
+ case 63481:
+ case 61887: // Lightning Tendrils
+ case 63486:
+ mechanicImmunityMask |= (1 << MECHANIC_INTERRUPT) | (1 << MECHANIC_SILENCE);
+
+ immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK);
+ immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK_DEST);
+ break;
+ default:
+ break;
+ }
+ break;
+ }
+ case 679: // Mind Control, Avenging Fury
+ {
+ if (Id == 57742) // Avenging Fury
+ {
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ }
+ break;
+ }
+ case 1557: // Startling Roar, Warlord Roar, Break Bonds, Stormshield
+ {
+ if (Id == 64187) // Stormshield
+ {
+ mechanicImmunityMask |= (1 << MECHANIC_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ }
+ else
+ {
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ }
+ break;
+ }
+ case 1614: // Fixate
+ case 1694: // Fixated, Lightning Tendrils
+ {
+ immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_ATTACK_ME);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_TAUNT);
+ break;
+ }
+ case 1630: // Fervor, Berserk
+ {
+ if (Id == 64112) // Berserk
+ {
+ immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_ATTACK_ME);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_TAUNT);
+ }
+ else
+ {
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ }
+ break;
+ }
+ case 477: // Bladestorm
+ case 1733: // Bladestorm, Killing Spree
+ {
+ if (!amount)
+ {
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+
+ immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK);
+ immuneInfo.SpellEffectImmune.insert(SPELL_EFFECT_KNOCK_BACK_DEST);
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ }
+ break;
+ }
+ case 878: // Whirlwind, Fog of Corruption, Determination
+ {
+ if (Id == 66092) // Determination
+ {
+ mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_STUN)
+ | (1 << MECHANIC_DISORIENTED) | (1 << MECHANIC_FREEZE);
+
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+
+ if (immuneInfo.AuraTypeImmune.empty())
+ {
+ if (miscVal & (1 << 10))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_STUN);
+ if (miscVal & (1 << 1))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_TRANSFORM);
+
+ // These flag can be recognized wrong:
+ if (miscVal & (1 << 6))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DECREASE_SPEED);
+ if (miscVal & (1 << 0))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_ROOT);
+ if (miscVal & (1 << 2))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_CONFUSE);
+ if (miscVal & (1 << 9))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_FEAR);
+ if (miscVal & (1 << 7))
+ immuneInfo.AuraTypeImmune.insert(SPELL_AURA_MOD_DISARM);
+ }
+ break;
+ }
+ case SPELL_AURA_MECHANIC_IMMUNITY:
+ {
+ switch (Id)
+ {
+ case 34471: // The Beast Within
+ case 19574: // Bestial Wrath
+ case 42292: // PvP trinket
+ case 59752: // Every Man for Himself
+ case 53490: // Bullheaded
+ mechanicImmunityMask |= IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
+ break;
+ case 54508: // Demonic Empowerment
+ mechanicImmunityMask |= (1 << MECHANIC_SNARE) | (1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN);
+ break;
+ default:
+ if (miscVal < 1)
+ continue;
+
+ mechanicImmunityMask |= 1 << miscVal;
+ break;
+ }
+ break;
+ }
+ case SPELL_AURA_EFFECT_IMMUNITY:
+ {
+ immuneInfo.SpellEffectImmune.insert(static_cast<SpellEffects>(miscVal));
+ break;
+ }
+ case SPELL_AURA_STATE_IMMUNITY:
+ {
+ immuneInfo.AuraTypeImmune.insert(static_cast<AuraType>(miscVal));
+ break;
+ }
+ case SPELL_AURA_SCHOOL_IMMUNITY:
+ {
+ schoolImmunityMask |= uint32(miscVal);
+ break;
+ }
+ case SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL:
+ {
+ applyHarmfulAuraImmunityMask |= uint32(miscVal);
+ break;
+ }
+ case SPELL_AURA_DAMAGE_IMMUNITY:
+ {
+ damageImmunityMask |= uint32(miscVal);
+ break;
+ }
+ case SPELL_AURA_DISPEL_IMMUNITY:
+ {
+ dispelImmunity = uint32(miscVal);
+ break;
+ }
+ default:
+ break;
+ }
+
+ immuneInfo.SchoolImmuneMask = schoolImmunityMask;
+ immuneInfo.ApplyHarmfulAuraImmuneMask = applyHarmfulAuraImmunityMask;
+ immuneInfo.MechanicImmuneMask = mechanicImmunityMask;
+ immuneInfo.DispelImmune = dispelImmunity;
+ immuneInfo.DamageSchoolMask = damageImmunityMask;
+
+ immuneInfo.AuraTypeImmune.shrink_to_fit();
+ immuneInfo.SpellEffectImmune.shrink_to_fit();
+ }
+}
+
+void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const
+{
+ ImmunityInfo const* immuneInfo = _immunityInfo + effIndex;
+
+ if (uint32 schoolImmunity = immuneInfo->SchoolImmuneMask)
+ {
+ target->ApplySpellImmune(Id, IMMUNITY_SCHOOL, schoolImmunity, apply);
+
+ if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
+ {
+ target->RemoveAppliedAuras([this, schoolImmunity](AuraApplication const* aurApp) -> bool
+ {
+ SpellInfo const* auraSpellInfo = aurApp->GetBase()->GetSpellInfo();
+ return ((auraSpellInfo->GetSchoolMask() & schoolImmunity) != 0 && // Check for school mask
+ CanDispelAura(auraSpellInfo) &&
+ (IsPositive() != aurApp->IsPositive()) && // Check spell vs aura possitivity
+ !auraSpellInfo->IsPassive() && // Don't remove passive auras
+ auraSpellInfo->Id != Id); // Don't remove self
+ });
+ }
+ }
+
+ if (uint32 mechanicImmunity = immuneInfo->MechanicImmuneMask)
+ {
+ for (uint32 i = 0; i < MAX_MECHANIC; ++i)
+ if (mechanicImmunity & (1 << i))
+ target->ApplySpellImmune(Id, IMMUNITY_MECHANIC, i, apply);
+
+ if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
+ target->RemoveAurasWithMechanic(mechanicImmunity, AURA_REMOVE_BY_DEFAULT, Id);
+ }
+
+ if (uint32 dispelImmunity = immuneInfo->DispelImmune)
+ {
+ target->ApplySpellImmune(Id, IMMUNITY_DISPEL, dispelImmunity, apply);
+
+ if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
+ {
+ target->RemoveAppliedAuras([dispelImmunity](AuraApplication const* aurApp) -> bool
+ {
+ SpellInfo const* spellInfo = aurApp->GetBase()->GetSpellInfo();
+ if (spellInfo->Dispel == dispelImmunity)
+ return true;
+
+ return false;
+ });
+ }
+ }
+
+ if (uint32 damageImmunity = immuneInfo->DamageSchoolMask)
+ target->ApplySpellImmune(Id, IMMUNITY_DAMAGE, damageImmunity, apply);
+
+ for (AuraType auraType : immuneInfo->AuraTypeImmune)
+ {
+ target->ApplySpellImmune(Id, IMMUNITY_STATE, auraType, apply);
+ if (apply && HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
+ target->RemoveAurasByType(auraType);
+ }
+
+ for (SpellEffects effectType : immuneInfo->SpellEffectImmune)
+ target->ApplySpellImmune(Id, IMMUNITY_EFFECT, effectType, apply);
+}
+
+bool SpellInfo::CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const
+{
+ if (!auraSpellInfo)
+ return false;
+
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ ImmunityInfo const* immuneInfo = _immunityInfo + i;
+
+ if (!auraSpellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
+ {
+ if (uint32 schoolImmunity = immuneInfo->SchoolImmuneMask)
+ if ((auraSpellInfo->SchoolMask & schoolImmunity) != 0)
+ return true;
+ }
+
+ if (uint32 mechanicImmunity = immuneInfo->MechanicImmuneMask)
+ if ((mechanicImmunity & (1 << auraSpellInfo->Mechanic)) != 0)
+ return true;
+
+ if (uint32 dispelImmunity = immuneInfo->DispelImmune)
+ if (auraSpellInfo->Dispel == dispelImmunity)
+ return true;
+
+ bool immuneToAllEffects = true;
+ for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
+ {
+ uint32 effectName = auraSpellInfo->Effects[effIndex].Effect;
+ if (!effectName)
+ continue;
+
+ auto spellImmuneItr = immuneInfo->SpellEffectImmune.find(static_cast<SpellEffects>(effectName));
+ if (spellImmuneItr == immuneInfo->SpellEffectImmune.cend())
+ {
+ immuneToAllEffects = false;
+ break;
+ }
+
+ if (uint32 mechanic = auraSpellInfo->Effects[effIndex].Mechanic)
+ {
+ if (!(immuneInfo->MechanicImmuneMask & (1 << mechanic)))
+ {
+ immuneToAllEffects = false;
+ break;
+ }
+ }
+
+ if (!auraSpellInfo->HasAttribute(SPELL_ATTR3_IGNORE_HIT_RESULT))
+ {
+ if (uint32 auraName = auraSpellInfo->Effects[effIndex].ApplyAuraName)
+ {
+ bool isImmuneToAuraEffectApply = false;
+ auto auraImmuneItr = immuneInfo->AuraTypeImmune.find(static_cast<AuraType>(auraName));
+ if (auraImmuneItr != immuneInfo->AuraTypeImmune.cend())
+ isImmuneToAuraEffectApply = true;
+
+ if (!isImmuneToAuraEffectApply && !auraSpellInfo->IsPositiveEffect(effIndex) && !auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE))
+ {
+ if (uint32 applyHarmfulAuraImmunityMask = immuneInfo->ApplyHarmfulAuraImmuneMask)
+ if ((auraSpellInfo->GetSchoolMask() & applyHarmfulAuraImmunityMask) != 0)
+ isImmuneToAuraEffectApply = true;
+ }
+
+ if (!isImmuneToAuraEffectApply)
+ {
+ immuneToAllEffects = false;
+ break;
+ }
+ }
+ }
+ }
+
+ if (immuneToAllEffects)
+ return true;
+ }
+
+ return false;
+}
+
+// based on client sub_007FDFA0
+bool SpellInfo::CanSpellCastOverrideAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const
+{
+ if (!HasAttribute(SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY))
+ return false;
+
+ if (auraSpellInfo->HasAttribute(SPELL_ATTR0_UNAFFECTED_BY_INVULNERABILITY))
+ return false;
+
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ {
+ if (Effects[i].Effect != SPELL_EFFECT_APPLY_AURA)
+ continue;
+
+ uint32 const miscValue = static_cast<uint32>(Effects[i].MiscValue);
+ switch (Effects[i].ApplyAuraName)
+ {
+ case SPELL_AURA_STATE_IMMUNITY:
+ if (miscValue != auraSpellInfo->Effects[auraEffIndex].ApplyAuraName)
+ continue;
+ break;
+ case SPELL_AURA_SCHOOL_IMMUNITY:
+ case SPELL_AURA_MOD_IMMUNE_AURA_APPLY_SCHOOL:
+ if (auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE) || !(auraSpellInfo->SchoolMask & miscValue))
+ continue;
+ break;
+ case SPELL_AURA_DISPEL_IMMUNITY:
+ if (miscValue != auraSpellInfo->Dispel)
+ continue;
+ break;
+ case SPELL_AURA_MECHANIC_IMMUNITY:
+ if (miscValue != auraSpellInfo->Mechanic)
+ {
+ if (miscValue != auraSpellInfo->Effects[auraEffIndex].Mechanic)
+ continue;
+ }
+ break;
+ default:
+ continue;
+ }
+
+ return true;
+ }
+
+ return false;
+}
+
float SpellInfo::GetMinRange(bool positive) const
{
if (!RangeEntry)
@@ -2843,8 +3343,16 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const
// Special case: effects which determine positivity of whole spell
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
- if (Effects[i].IsAura() && Effects[i].ApplyAuraName == SPELL_AURA_MOD_STEALTH)
- return true;
+ if (Effects[i].IsAura())
+ {
+ switch (Effects[i].ApplyAuraName)
+ {
+ case SPELL_AURA_MOD_STEALTH:
+ return true;
+ case SPELL_AURA_CHANNEL_DEATH_ITEM:
+ return false;
+ }
+ }
}
switch (Effects[effIndex].Effect)
diff --git a/src/server/game/Spells/SpellInfo.h b/src/server/game/Spells/SpellInfo.h
index b2566ecf533..d7b48ddb4d2 100644
--- a/src/server/game/Spells/SpellInfo.h
+++ b/src/server/game/Spells/SpellInfo.h
@@ -24,6 +24,8 @@
#include "Object.h"
#include "SpellAuraDefines.h"
+#include <boost/container/flat_set.hpp>
+
class Unit;
class Player;
class Item;
@@ -300,6 +302,18 @@ struct TC_GAME_API SpellDiminishInfo
int32 DiminishDurationLimit = 0;
};
+struct TC_GAME_API ImmunityInfo
+{
+ uint32 SchoolImmuneMask = 0;
+ uint32 ApplyHarmfulAuraImmuneMask = 0;
+ uint32 MechanicImmuneMask = 0;
+ uint32 DispelImmune = 0;
+ uint32 DamageSchoolMask = 0;
+
+ boost::container::flat_set<AuraType> AuraTypeImmune;
+ boost::container::flat_set<SpellEffects> SpellEffectImmune;
+};
+
class TC_GAME_API SpellInfo
{
friend class SpellMgr;
@@ -388,6 +402,7 @@ class TC_GAME_API SpellInfo
bool HasEffect(SpellEffects effect) const;
bool HasAura(AuraType aura) const;
bool HasAreaAuraEffect() const;
+ bool HasOnlyDamageEffects() const;
inline bool HasAttribute(SpellAttr0 attribute) const { return !!(Attributes & attribute); }
inline bool HasAttribute(SpellAttr1 attribute) const { return !!(AttributesEx & attribute); }
@@ -429,17 +444,21 @@ class TC_GAME_API SpellInfo
bool IsPositive() const;
bool IsPositiveEffect(uint8 effIndex) const;
bool IsChanneled() const;
+ bool IsMoveAllowedChannel() const;
bool NeedsComboPoints() const;
+ bool IsNextMeleeSwingSpell() const;
bool IsBreakingStealth() const;
bool IsRangedWeaponSpell() const;
bool IsAutoRepeatRangedSpell() const;
bool HasInitialAggro() const;
+ bool IsAffected(uint32 familyName, flag96 const& familyFlags) const;
+
bool IsAffectedBySpellMods() const;
bool IsAffectedBySpellMod(SpellModifier const* mod) const;
- bool CanPierceImmuneAura(SpellInfo const* aura) const;
- bool CanDispelAura(SpellInfo const* aura) const;
+ bool CanPierceImmuneAura(SpellInfo const* auraSpellInfo) const;
+ bool CanDispelAura(SpellInfo const* auraSpellInfo) const;
bool IsSingleTarget() const;
bool IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const;
@@ -495,6 +514,11 @@ class TC_GAME_API SpellInfo
DiminishingLevels GetDiminishingReturnsMaxLevel(bool triggered) const;
int32 GetDiminishingReturnsLimitDuration(bool triggered) const;
+ // spell immunities
+ void ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const;
+ bool CanSpellProvideImmunityAgainstAura(SpellInfo const* auraSpellInfo) const;
+ bool CanSpellCastOverrideAuraEffect(SpellInfo const* auraSpellInfo, uint8 auraEffIndex) const;
+
private:
// loading helpers
void _InitializeExplicitTargetMask();
@@ -504,6 +528,7 @@ class TC_GAME_API SpellInfo
void _LoadSpellSpecific();
void _LoadAuraState();
void _LoadSpellDiminishInfo();
+ void _LoadImmunityInfo();
// unloading helpers
void _UnloadImplicitTargetConditionLists();
@@ -513,6 +538,8 @@ class TC_GAME_API SpellInfo
SpellDiminishInfo _diminishInfoNonTriggered;
SpellDiminishInfo _diminishInfoTriggered;
+
+ ImmunityInfo _immunityInfo[MAX_SPELL_EFFECTS];
};
#endif // _SPELLINFO_H
diff --git a/src/server/game/Spells/SpellMgr.cpp b/src/server/game/Spells/SpellMgr.cpp
index 02584542676..bd13f1b2c7b 100644
--- a/src/server/game/Spells/SpellMgr.cpp
+++ b/src/server/game/Spells/SpellMgr.cpp
@@ -492,7 +492,7 @@ SpellProcEntry const* SpellMgr::GetSpellProcEntry(uint32 spellId) const
return NULL;
}
-bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const
+bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo)
{
// proc type doesn't match
if (!(eventInfo.GetTypeMask() & procEntry.ProcFlags))
@@ -535,20 +535,13 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE
return false;
// check spell family name/flags (if set) for spells
- if (eventInfo.GetTypeMask() & (PERIODIC_PROC_FLAG_MASK | SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION))
+ if (eventInfo.GetTypeMask() & (PERIODIC_PROC_FLAG_MASK | SPELL_PROC_FLAG_MASK))
{
- SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo();
-
- if (procEntry.SpellFamilyName && eventSpellInfo && (procEntry.SpellFamilyName != eventSpellInfo->SpellFamilyName))
- return false;
-
- if (procEntry.SpellFamilyMask && eventSpellInfo && !(procEntry.SpellFamilyMask & eventSpellInfo->SpellFamilyFlags))
- return false;
- }
+ if (SpellInfo const* eventSpellInfo = eventInfo.GetSpellInfo())
+ if (!eventSpellInfo->IsAffected(procEntry.SpellFamilyName, procEntry.SpellFamilyMask))
+ return false;
- // check spell type mask (if set)
- if (eventInfo.GetTypeMask() & (SPELL_PROC_FLAG_MASK | PERIODIC_PROC_FLAG_MASK))
- {
+ // check spell type mask (if set)
if (procEntry.SpellTypeMask && !(eventInfo.GetSpellTypeMask() & procEntry.SpellTypeMask))
return false;
}
@@ -1524,6 +1517,9 @@ void SpellMgr::LoadSpellProcs()
TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has wrong `HitMask` set: %u", spellInfo->Id, procEntry.HitMask);
if (procEntry.HitMask && !(procEntry.ProcFlags & TAKEN_HIT_PROC_FLAG_MASK || (procEntry.ProcFlags & DONE_HIT_PROC_FLAG_MASK && (!procEntry.SpellPhaseMask || procEntry.SpellPhaseMask & (PROC_SPELL_PHASE_HIT | PROC_SPELL_PHASE_FINISH)))))
TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has `HitMask` value defined, but it will not be used for defined `ProcFlags` and `SpellPhaseMask` values.", spellInfo->Id);
+ for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
+ if ((procEntry.AttributesMask & (PROC_ATTR_DISABLE_EFF_0 << i)) && !spellInfo->Effects[i].IsAura())
+ TC_LOG_ERROR("sql.sql", "The `spell_proc` table entry for spellId %u has Attribute PROC_ATTR_DISABLE_EFF_%u, but effect %u is not an aura effect", spellInfo->Id, static_cast<uint32>(i), static_cast<uint32>(i));
mSpellProcMap[spellInfo->Id] = procEntry;
@@ -1593,6 +1589,8 @@ void SpellMgr::LoadSpellProcs()
isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true;
isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true;
+ isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true;
+ isAlwaysTriggeredAura[SPELL_AURA_MOD_CONFUSE] = true;
isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true;
isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true;
isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true;
@@ -1615,9 +1613,14 @@ void SpellMgr::LoadSpellProcs()
if (!spellInfo)
continue;
+ // Data already present in DB, overwrites default proc
if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end())
continue;
+ // Nothing to do if no flags set
+ if (!spellInfo->ProcFlags)
+ continue;
+
bool addTriggerFlag = false;
uint32 procSpellTypeMask = PROC_SPELL_TYPE_NONE;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
@@ -1635,15 +1638,27 @@ void SpellMgr::LoadSpellProcs()
procSpellTypeMask |= spellTypeMask[auraName];
if (isAlwaysTriggeredAura[auraName])
addTriggerFlag = true;
+
+ // many proc auras with taken procFlag mask don't have attribute "can proc with triggered"
+ // they should proc nevertheless (example mage armor spells with judgement)
+ if (!addTriggerFlag && (spellInfo->ProcFlags & TAKEN_HIT_PROC_FLAG_MASK) != 0)
+ {
+ switch (auraName)
+ {
+ case SPELL_AURA_PROC_TRIGGER_SPELL:
+ case SPELL_AURA_PROC_TRIGGER_DAMAGE:
+ addTriggerFlag = true;
+ break;
+ default:
+ break;
+ }
+ }
break;
}
if (!procSpellTypeMask)
continue;
- if (!spellInfo->ProcFlags)
- continue;
-
SpellProcEntry procEntry;
procEntry.SchoolMask = 0;
procEntry.ProcFlags = spellInfo->ProcFlags;
@@ -2603,6 +2618,8 @@ void SpellMgr::LoadSpellInfoCorrections()
case 2895: // Wrath of Air Totem rank 1 (Aura)
case 68933: // Wrath of Air Totem rank 2 (Aura)
case 29200: // Purify Helboar Meat
+ case 10872: // Abolish Disease Effect
+ case 3137: // Abolish Poison Effect
spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_CASTER);
spellInfo->Effects[EFFECT_0].TargetB = SpellImplicitTargetInfo();
break;
@@ -2630,6 +2647,15 @@ void SpellMgr::LoadSpellInfoCorrections()
// because of bug in dbc
spellInfo->ProcChance = 0;
break;
+ case 51528: // Maelstrom Weapon (Rank 1)
+ case 51529: // Maelstrom Weapon (Rank 2)
+ case 51530: // Maelstrom Weapon (Rank 3)
+ case 51531: // Maelstrom Weapon (Rank 4)
+ case 51532: // Maelstrom Weapon (Rank 5)
+ // due to discrepancies between ranks
+ spellInfo->EquippedItemSubClassMask = 0x0000FC33;
+ spellInfo->AttributesEx3 |= SPELL_ATTR3_CAN_PROC_WITH_TRIGGERED;
+ break;
case 20335: // Heart of the Crusader
case 20336:
case 20337:
@@ -2755,15 +2781,14 @@ void SpellMgr::LoadSpellInfoCorrections()
case 44544: // Fingers of Frost
spellInfo->Effects[EFFECT_0].SpellClassMask = flag96(685904631, 1151048, 0);
break;
- case 53257: // Cobra Strikes
- spellInfo->ProcCharges = 2;
- spellInfo->StackAmount = 0;
- break;
case 49224: // Magic Suppression - DK
case 49610: // Magic Suppression - DK
case 49611: // Magic Suppression - DK
spellInfo->ProcCharges = 0;
break;
+ case 52212: // Death and Decay
+ spellInfo->AttributesEx6 |= SPELL_ATTR6_CAN_TARGET_INVISIBLE;
+ break;
case 37408: // Oscillation Field
spellInfo->AttributesEx3 |= SPELL_ATTR3_STACK_FOR_DIFF_CASTERS;
break;
@@ -2843,6 +2868,19 @@ void SpellMgr::LoadSpellInfoCorrections()
case 27915: // Anchor to Skulls
case 27931: // Anchor to Skulls
case 27937: // Anchor to Skulls
+ case 16177: // Ancestral Fortitude (Rank 1)
+ case 16236: // Ancestral Fortitude (Rank 2)
+ case 16237: // Ancestral Fortitude (Rank 3)
+ case 47930: // Grace
+ case 45145: // Snake Trap Effect (Rank 1)
+ case 13812: // Explosive Trap Effect (Rank 1)
+ case 14314: // Explosive Trap Effect (Rank 2)
+ case 14315: // Explosive Trap Effect (Rank 3)
+ case 27026: // Explosive Trap Effect (Rank 4)
+ case 49064: // Explosive Trap Effect (Rank 5)
+ case 49065: // Explosive Trap Effect (Rank 6)
+ case 43446: // Explosive Trap Effect (Hexlord Malacrass)
+ case 68979: // Unleashed Souls
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(13);
break;
// target allys instead of enemies, target A is src_caster, spells with effect like that have ally target
@@ -2950,9 +2988,6 @@ void SpellMgr::LoadSpellInfoCorrections()
case 71839: // Drain Life - Bryntroll Heroic
spellInfo->AttributesEx2 |= SPELL_ATTR2_CANT_CRIT;
break;
- case 34471: // The Beast Within
- spellInfo->AttributesEx5 |= SPELL_ATTR5_USABLE_WHILE_CONFUSED | SPELL_ATTR5_USABLE_WHILE_FEARED | SPELL_ATTR5_USABLE_WHILE_STUNNED;
- break;
case 56606: // Ride Jokkum
case 61791: // Ride Vehicle (Yogg-Saron)
/// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
@@ -3004,6 +3039,10 @@ void SpellMgr::LoadSpellInfoCorrections()
case 68766: // Desecration (Rank 2)
spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(2); // Melee Range
break;
+ case 46946: // Safeguard (Rank 1)
+ case 46947: // Safeguard (Rank 2)
+ spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(34); // Twenty-Five yards
+ break;
// VIOLET HOLD SPELLS
//
case 54258: // Water Globule (Ichoron)
@@ -3488,3 +3527,18 @@ void SpellMgr::LoadSpellInfoDiminishing()
TC_LOG_INFO("server.loading", ">> Loaded SpellInfo diminishing infos in %u ms", GetMSTimeDiffToNow(oldMSTime));
}
+
+void SpellMgr::LoadSpellInfoImmunities()
+{
+ uint32 oldMSTime = getMSTime();
+
+ for (SpellInfo* spellInfo : mSpellInfoMap)
+ {
+ if (!spellInfo)
+ continue;
+
+ spellInfo->_LoadImmunityInfo();
+ }
+
+ TC_LOG_INFO("server.loading", ">> Loaded SpellInfo immunity infos in %u ms", GetMSTimeDiffToNow(oldMSTime));
+}
diff --git a/src/server/game/Spells/SpellMgr.h b/src/server/game/Spells/SpellMgr.h
index f119d164789..a08ff921a2e 100644
--- a/src/server/game/Spells/SpellMgr.h
+++ b/src/server/game/Spells/SpellMgr.h
@@ -165,9 +165,8 @@ enum ProcFlags
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_POS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_POS
- | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG,
-
- SPELL_CAST_PROC_FLAG_MASK = SPELL_PROC_FLAG_MASK | PROC_FLAG_DONE_TRAP_ACTIVATION,
+ | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG | PROC_FLAG_TAKEN_SPELL_MAGIC_DMG_CLASS_NEG
+ | PROC_FLAG_DONE_TRAP_ACTIVATION,
PERIODIC_PROC_FLAG_MASK = PROC_FLAG_DONE_PERIODIC | PROC_FLAG_TAKEN_PERIODIC,
@@ -175,7 +174,8 @@ enum ProcFlags
| PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS
| PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_NONE_DMG_CLASS_NEG
| PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS | PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG
- | PROC_FLAG_DONE_PERIODIC | PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK,
+ | PROC_FLAG_DONE_PERIODIC | PROC_FLAG_DONE_TRAP_ACTIVATION
+ | PROC_FLAG_DONE_MAINHAND_ATTACK | PROC_FLAG_DONE_OFFHAND_ATTACK,
TAKEN_HIT_PROC_FLAG_MASK = PROC_FLAG_TAKEN_MELEE_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK
| PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS
@@ -238,7 +238,11 @@ enum ProcAttributes
PROC_ATTR_REQ_EXP_OR_HONOR = 0x0000001, // requires proc target to give exp or honor for aura proc
PROC_ATTR_TRIGGERED_CAN_PROC = 0x0000002, // aura can proc even with triggered spells
PROC_ATTR_REQ_MANA_COST = 0x0000004, // requires triggering spell to have a mana cost for aura proc
- PROC_ATTR_REQ_SPELLMOD = 0x0000008 // requires triggering spell to be affected by proccing aura to drop charges
+ PROC_ATTR_REQ_SPELLMOD = 0x0000008, // requires triggering spell to be affected by proccing aura to drop charges
+
+ PROC_ATTR_DISABLE_EFF_0 = 0x0000010, // explicitly disables aura proc from effects, USE ONLY IF 100% SURE AURA SHOULDN'T PROC
+ PROC_ATTR_DISABLE_EFF_1 = 0x0000020, // used to avoid a console error if the spell has invalid trigger spell and handled elsewhere
+ PROC_ATTR_DISABLE_EFF_2 = 0x0000040 // or handling not needed
};
struct SpellProcEntry
@@ -606,7 +610,7 @@ class TC_GAME_API SpellMgr
// Spell proc table
SpellProcEntry const* GetSpellProcEntry(uint32 spellId) const;
- bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo) const;
+ static bool CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcEventInfo& eventInfo);
// Spell bonus data table
SpellBonusEntry const* GetSpellBonusData(uint32 spellId) const;
@@ -680,6 +684,7 @@ class TC_GAME_API SpellMgr
void LoadSpellInfoCorrections();
void LoadSpellInfoSpellSpecificAndAuraState();
void LoadSpellInfoDiminishing();
+ void LoadSpellInfoImmunities();
private:
SpellDifficultySearcherMap mSpellDifficultySearcherMap;
diff --git a/src/server/game/Spells/SpellScript.cpp b/src/server/game/Spells/SpellScript.cpp
index 67aaa582776..950456394d8 100644
--- a/src/server/game/Spells/SpellScript.cpp
+++ b/src/server/game/Spells/SpellScript.cpp
@@ -301,35 +301,35 @@ void SpellScript::DestinationTargetSelectHandler::Call(SpellScript* spellScript,
bool SpellScript::_Validate(SpellInfo const* entry)
{
- for (std::list<EffectHandler>::iterator itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr)
+ for (auto itr = OnEffectLaunch.begin(); itr != OnEffectLaunch.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunch` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr)
+ for (auto itr = OnEffectLaunchTarget.begin(); itr != OnEffectLaunchTarget.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectLaunchTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr)
+ for (auto itr = OnEffectHit.begin(); itr != OnEffectHit.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHit` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr)
+ for (auto itr = OnEffectHitTarget.begin(); itr != OnEffectHitTarget.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectHitTarget` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectHandler>::iterator itr = OnEffectSuccessfulDispel.begin(); itr != OnEffectSuccessfulDispel.end(); ++itr)
+ for (auto itr = OnEffectSuccessfulDispel.begin(); itr != OnEffectSuccessfulDispel.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSuccessfulDispel` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<ObjectAreaTargetSelectHandler>::iterator itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr)
+ for (auto itr = OnObjectAreaTargetSelect.begin(); itr != OnObjectAreaTargetSelect.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectAreaTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<ObjectTargetSelectHandler>::iterator itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr)
+ for (auto itr = OnObjectTargetSelect.begin(); itr != OnObjectTargetSelect.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnObjectTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<DestinationTargetSelectHandler>::iterator itr = OnDestinationTargetSelect.begin(); itr != OnDestinationTargetSelect.end(); ++itr)
+ for (auto itr = OnDestinationTargetSelect.begin(); itr != OnDestinationTargetSelect.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnDestinationTargetSelect` of SpellScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
@@ -624,9 +624,9 @@ SpellInfo const* SpellScript::GetTriggeringSpell()
return m_spell->m_triggeredByAuraSpell;
}
-void SpellScript::FinishCast(SpellCastResult result)
+void SpellScript::FinishCast(SpellCastResult result, uint32* param1 /*= nullptr*/, uint32* param2 /*= nullptr*/)
{
- m_spell->SendCastResult(result);
+ m_spell->SendCastResult(result, param1, param2);
m_spell->finish(result == SPELL_CAST_OK);
}
@@ -648,99 +648,99 @@ SpellValue const* SpellScript::GetSpellValue()
bool AuraScript::_Validate(SpellInfo const* entry)
{
- for (std::list<CheckAreaTargetHandler>::iterator itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
+ for (auto itr = DoCheckAreaTarget.begin(); itr != DoCheckAreaTarget.end(); ++itr)
if (!entry->HasAreaAuraEffect() && !entry->HasEffect(SPELL_EFFECT_PERSISTENT_AREA_AURA) && !entry->HasEffect(SPELL_EFFECT_APPLY_AURA))
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoCheckAreaTarget` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<AuraDispelHandler>::iterator itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
+ for (auto itr = OnDispel.begin(); itr != OnDispel.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<AuraDispelHandler>::iterator itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr)
+ for (auto itr = AfterDispel.begin(); itr != AfterDispel.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterDispel` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<EffectApplyHandler>::iterator itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
+ for (auto itr = OnEffectApply.begin(); itr != OnEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectApplyHandler>::iterator itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr)
+ for (auto itr = OnEffectRemove.begin(); itr != OnEffectRemove.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectApplyHandler>::iterator itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr)
+ for (auto itr = AfterEffectApply.begin(); itr != AfterEffectApply.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectApply` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectApplyHandler>::iterator itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr)
+ for (auto itr = AfterEffectRemove.begin(); itr != AfterEffectRemove.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectRemove` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectPeriodicHandler>::iterator itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr)
+ for (auto itr = OnEffectPeriodic.begin(); itr != OnEffectPeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectUpdatePeriodicHandler>::iterator itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr)
+ for (auto itr = OnEffectUpdatePeriodic.begin(); itr != OnEffectUpdatePeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectUpdatePeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectCalcAmountHandler>::iterator itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr)
+ for (auto itr = DoEffectCalcAmount.begin(); itr != DoEffectCalcAmount.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcAmount` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectCalcPeriodicHandler>::iterator itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr)
+ for (auto itr = DoEffectCalcPeriodic.begin(); itr != DoEffectCalcPeriodic.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcPeriodic` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectCalcSpellModHandler>::iterator itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr)
+ for (auto itr = DoEffectCalcSpellMod.begin(); itr != DoEffectCalcSpellMod.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoEffectCalcSpellMod` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectAbsorbHandler>::iterator itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr)
+ for (auto itr = OnEffectAbsorb.begin(); itr != OnEffectAbsorb.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectAbsorbHandler>::iterator itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr)
+ for (auto itr = AfterEffectAbsorb.begin(); itr != AfterEffectAbsorb.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectAbsorb` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectManaShieldHandler>::iterator itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr)
+ for (auto itr = OnEffectManaShield.begin(); itr != OnEffectManaShield.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectManaShieldHandler>::iterator itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr)
+ for (auto itr = AfterEffectManaShield.begin(); itr != AfterEffectManaShield.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectManaShield` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectSplitHandler>::iterator itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr)
+ for (auto itr = OnEffectSplit.begin(); itr != OnEffectSplit.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectSplit` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<CheckProcHandler>::iterator itr = DoCheckProc.begin(); itr != DoCheckProc.end(); ++itr)
+ for (auto itr = DoCheckProc.begin(); itr != DoCheckProc.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoCheckProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<CheckEffectProcHandler>::iterator itr = DoCheckEffectProc.begin(); itr != DoCheckEffectProc.end(); ++itr)
+ for (auto itr = DoCheckEffectProc.begin(); itr != DoCheckEffectProc.end(); ++itr)
if (!itr->GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `DoCheckEffectProc` of AuraScript won't be executed", entry->Id, itr->ToString().c_str(), m_scriptName->c_str());
- for (std::list<AuraProcHandler>::iterator itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr)
+ for (auto itr = DoPrepareProc.begin(); itr != DoPrepareProc.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `DoPrepareProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<AuraProcHandler>::iterator itr = OnProc.begin(); itr != OnProc.end(); ++itr)
+ for (auto itr = OnProc.begin(); itr != OnProc.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `OnProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<AuraProcHandler>::iterator itr = AfterProc.begin(); itr != AfterProc.end(); ++itr)
+ for (auto itr = AfterProc.begin(); itr != AfterProc.end(); ++itr)
if (!entry->HasEffect(SPELL_EFFECT_APPLY_AURA) && !entry->HasAreaAuraEffect())
TC_LOG_ERROR("scripts", "Spell `%u` of script `%s` does not have apply aura effect - handler bound to hook `AfterProc` of AuraScript won't be executed", entry->Id, m_scriptName->c_str());
- for (std::list<EffectProcHandler>::iterator itr = OnEffectProc.begin(); itr != OnEffectProc.end(); ++itr)
+ for (auto itr = OnEffectProc.begin(); itr != OnEffectProc.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `OnEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
- for (std::list<EffectProcHandler>::iterator itr = AfterEffectProc.begin(); itr != AfterEffectProc.end(); ++itr)
+ for (auto itr = AfterEffectProc.begin(); itr != AfterEffectProc.end(); ++itr)
if (!(*itr).GetAffectedEffectsMask(entry))
TC_LOG_ERROR("scripts", "Spell `%u` Effect `%s` of script `%s` did not match dbc effect data - handler bound to hook `AfterEffectProc` of AuraScript won't be executed", entry->Id, (*itr).ToString().c_str(), m_scriptName->c_str());
diff --git a/src/server/game/Spells/SpellScript.h b/src/server/game/Spells/SpellScript.h
index 1ec10f03820..af30b6a7879 100644
--- a/src/server/game/Spells/SpellScript.h
+++ b/src/server/game/Spells/SpellScript.h
@@ -63,9 +63,9 @@ class TC_GAME_API _SpellScript
public:
_SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE), m_scriptName(NULL), m_scriptSpellId(0) {}
virtual ~_SpellScript() { }
- virtual void _Register();
- virtual void _Unload();
- virtual void _Init(std::string const* scriptname, uint32 spellId);
+ void _Register();
+ void _Unload();
+ void _Init(std::string const* scriptname, uint32 spellId);
std::string const* _GetScriptName() const;
protected:
@@ -441,7 +441,7 @@ class TC_GAME_API SpellScript : public _SpellScript
SpellInfo const* GetTriggeringSpell();
// finishes spellcast prematurely with selected error message
- void FinishCast(SpellCastResult result);
+ void FinishCast(SpellCastResult result, uint32* param1 = nullptr, uint32* param2 = nullptr);
void SetCustomCastResultMessage(SpellCustomErrors result);
};
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index 59a1e757183..7bbf73d028d 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -1449,12 +1449,12 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes...");
sSpellMgr->LoadSpellInfoCustomAttributes();
- TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState...");
- sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState();
-
TC_LOG_INFO("server.loading", "Loading SpellInfo diminishing infos...");
sSpellMgr->LoadSpellInfoDiminishing();
+ TC_LOG_INFO("server.loading", "Loading SpellInfo immunity infos...");
+ sSpellMgr->LoadSpellInfoImmunities();
+
TC_LOG_INFO("server.loading", "Loading GameObject models...");
LoadGameObjectModelList(m_dataPath);
@@ -1514,6 +1514,9 @@ void World::SetInitialWorldSettings()
TC_LOG_INFO("server.loading", "Loading Spell Learn Skills...");
sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
+ TC_LOG_INFO("server.loading", "Loading SpellInfo SpellSpecific and AuraState...");
+ sSpellMgr->LoadSpellInfoSpellSpecificAndAuraState(); // must be after LoadSpellRanks
+
TC_LOG_INFO("server.loading", "Loading Spell Learn Spells...");
sSpellMgr->LoadSpellLearnSpells();
diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp
index 44c606a360f..45e6c65cc6b 100644
--- a/src/server/scripts/Commands/cs_cast.cpp
+++ b/src/server/scripts/Commands/cs_cast.cpp
@@ -99,8 +99,7 @@ public:
return false;
}
- bool triggered = (triggeredStr != NULL);
-
+ TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
handler->GetSession()->GetPlayer()->CastSpell(target, spellId, triggered);
return true;
@@ -132,8 +131,7 @@ public:
return false;
}
- bool triggered = (triggeredStr != NULL);
-
+ TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
caster->CastSpell(handler->GetSession()->GetPlayer(), spellId, triggered);
return true;
@@ -167,8 +165,7 @@ public:
return false;
}
- bool triggered = (triggeredStr != NULL);
-
+ TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
float x, y, z;
handler->GetSession()->GetPlayer()->GetClosePoint(x, y, z, dist);
@@ -230,8 +227,7 @@ public:
return false;
}
- bool triggered = (triggeredStr != NULL);
-
+ TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
caster->CastSpell(caster->GetVictim(), spellId, triggered);
return true;
@@ -274,8 +270,7 @@ public:
return false;
}
- bool triggered = (triggeredStr != NULL);
-
+ TriggerCastFlags triggered = (triggeredStr != NULL) ? TRIGGERED_FULL_DEBUG_MASK : TRIGGERED_NONE;
caster->CastSpell(x, y, z, spellId, triggered);
return true;
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index 98fc852b573..8c4bf73395d 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -146,7 +146,8 @@ public:
return false;
// player's guild membership checked in AddMember before add
- return targetGuild->AddMember(targetGuid);
+ SQLTransaction trans(nullptr);
+ return targetGuild->AddMember(trans, targetGuid);
}
static bool HandleGuildUninviteCommand(ChatHandler* handler, char const* args)
@@ -164,7 +165,8 @@ public:
if (!targetGuild)
return false;
- targetGuild->DeleteMember(targetGuid, false, true, true);
+ SQLTransaction trans(nullptr);
+ targetGuild->DeleteMember(trans, targetGuid, false, true, true);
return true;
}
@@ -191,7 +193,8 @@ public:
return false;
uint8 newRank = uint8(atoi(rankStr));
- return targetGuild->ChangeMemberRank(targetGuid, newRank);
+ SQLTransaction trans(nullptr);
+ return targetGuild->ChangeMemberRank(trans, targetGuid, newRank);
}
static bool HandleGuildRenameCommand(ChatHandler* handler, char const* _args)
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 16217fbaea6..5487b9c7b2f 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -2268,19 +2268,20 @@ public:
// melee damage by specific school
if (!spellStr)
{
- uint32 absorb = 0;
- uint32 resist = 0;
+ Player* attacker = handler->GetSession()->GetPlayer();
+ DamageInfo dmgInfo(attacker, target, damage, nullptr, schoolmask, SPELL_DIRECT_DAMAGE, BASE_ATTACK);
+ attacker->CalcAbsorbResist(dmgInfo);
- handler->GetSession()->GetPlayer()->CalcAbsorbResist(target, schoolmask, SPELL_DIRECT_DAMAGE, damage, &absorb, &resist);
-
- if (damage <= absorb + resist)
+ if (!dmgInfo.GetDamage())
return true;
- damage -= absorb + resist;
+ damage = dmgInfo.GetDamage();
- handler->GetSession()->GetPlayer()->DealDamageMods(target, damage, &absorb);
- handler->GetSession()->GetPlayer()->DealDamage(target, damage, NULL, DIRECT_DAMAGE, schoolmask, NULL, false);
- handler->GetSession()->GetPlayer()->SendAttackStateUpdate (HITINFO_AFFECTS_VICTIM, target, 1, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
+ uint32 absorb = dmgInfo.GetAbsorb();
+ uint32 resist = dmgInfo.GetResist();
+ attacker->DealDamageMods(target, damage, &absorb);
+ attacker->DealDamage(target, damage, nullptr, DIRECT_DAMAGE, schoolmask, nullptr, false);
+ attacker->SendAttackStateUpdate(HITINFO_AFFECTS_VICTIM, target, 0, schoolmask, damage, absorb, resist, VICTIMSTATE_HIT, 0);
return true;
}
@@ -2288,10 +2289,22 @@ public:
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r or Htalent form
uint32 spellid = handler->extractSpellIdFromLink((char*)args);
- if (!spellid || !sSpellMgr->GetSpellInfo(spellid))
+ if (!spellid)
+ return false;
+
+ SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellid);
+ if (!spellInfo)
return false;
- handler->GetSession()->GetPlayer()->SpellNonMeleeDamageLog(target, spellid, damage);
+ Player* attacker = handler->GetSession()->GetPlayer();
+ SpellNonMeleeDamage dmgInfo(attacker, target, spellid, spellInfo->GetSchoolMask());
+ damage = attacker->SpellDamageBonusDone(target, spellInfo, damage, SPELL_DIRECT_DAMAGE);
+ damage = target->SpellDamageBonusTaken(attacker, spellInfo, damage, SPELL_DIRECT_DAMAGE);
+
+ attacker->CalculateSpellDamageTaken(&dmgInfo, damage, spellInfo);
+ attacker->DealDamageMods(dmgInfo.target, dmgInfo.damage, &dmgInfo.absorb);
+ attacker->SendSpellNonMeleeDamageLog(&dmgInfo);
+ attacker->DealSpellDamage(&dmgInfo, true);
return true;
}
diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
index a43e2ee37dd..89617a9f4ef 100644
--- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
+++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp
@@ -578,7 +578,7 @@ public:
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) override
{
- if (player && player->IsAlive())
+ if (player->IsAlive())
if (InstanceScript* instance = player->GetInstanceScript())
if (Creature* infiltrator = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SCARSHIELD_INFILTRATOR)))
{
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
index d0430ebb3e5..67bda699643 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.cpp
@@ -54,7 +54,6 @@ enum Yells
enum Spells
{
SPELL_UNLOCK = 6421,
-
SPELL_DARK_OFFERING = 7154
};
@@ -205,6 +204,123 @@ public:
};
+enum ArugalSpells
+{
+ SPELL_TELE_UPPER = 7587,
+ SPELL_TELE_SPAWN = 7586,
+ SPELL_TELE_STAIRS = 7136,
+ NUM_TELEPORT_SPELLS = 3,
+ SPELL_ARUGAL_CURSE = 7621,
+ SPELL_THUNDERSHOCK = 7803,
+ SPELL_VOIDBOLT = 7588
+};
+
+enum ArugalTexts
+{
+ SAY_AGGRO = 1, // You, too, shall serve!
+ SAY_TRANSFORM = 2, // Release your rage!
+ SAY_SLAY = 3 // Another falls!
+};
+
+enum ArugalEvents
+{
+ EVENT_VOID_BOLT = 1,
+ EVENT_TELEPORT,
+ EVENT_THUNDERSHOCK,
+ EVENT_CURSE
+};
+
+class boss_archmage_arugal : public CreatureScript
+{
+ public:
+ boss_archmage_arugal() : CreatureScript("boss_archmage_arugal") { }
+
+ struct boss_archmage_arugalAI : public BossAI
+ {
+ boss_archmage_arugalAI(Creature* creature) : BossAI(creature, BOSS_ARUGAL) { }
+
+ uint32 teleportSpells[NUM_TELEPORT_SPELLS] =
+ {
+ SPELL_TELE_SPAWN,
+ SPELL_TELE_UPPER,
+ SPELL_TELE_STAIRS
+ };
+
+ void KilledUnit(Unit* who) override
+ {
+ if (who->GetTypeId() == TYPEID_PLAYER)
+ Talk(SAY_SLAY);
+ }
+
+ void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override
+ {
+ if (spell->Id == SPELL_ARUGAL_CURSE)
+ Talk(SAY_TRANSFORM);
+ }
+
+ void EnterCombat(Unit* /*who*/) override
+ {
+ _EnterCombat();
+ Talk(SAY_AGGRO);
+ events.ScheduleEvent(EVENT_CURSE, Seconds(7));
+ events.ScheduleEvent(EVENT_TELEPORT, Seconds(15));
+ events.ScheduleEvent(EVENT_VOID_BOLT, Seconds(1));
+ events.ScheduleEvent(EVENT_THUNDERSHOCK, Seconds(10));
+ }
+
+ void AttackStart(Unit* who) override
+ {
+ AttackStartCaster(who, 100.0f); // void bolt range is 100.f
+ }
+
+ void UpdateAI(uint32 diff) override
+ {
+ if (!UpdateVictim())
+ return;
+
+ events.Update(diff);
+
+ if (me->HasUnitState(UNIT_STATE_CASTING))
+ return;
+
+ while (uint32 eventId = events.ExecuteEvent())
+ {
+ switch (eventId)
+ {
+ case EVENT_CURSE:
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 30.0f, true))
+ DoCast(target, SPELL_ARUGAL_CURSE);
+ events.Repeat(Seconds(15));
+ break;
+ case EVENT_TELEPORT:
+ {
+ // ensure we never cast the same teleport twice in a row
+ uint8 spellIndex = urand(1, NUM_TELEPORT_SPELLS-1);
+ std::swap(teleportSpells[0], teleportSpells[spellIndex]);
+ DoCast(teleportSpells[0]);
+ events.Repeat(Seconds(20));
+ break;
+ }
+ case EVENT_THUNDERSHOCK:
+ DoCastAOE(SPELL_THUNDERSHOCK);
+ events.Repeat(Seconds(30));
+ break;
+ case EVENT_VOID_BOLT:
+ DoCastVictim(SPELL_VOIDBOLT);
+ events.Repeat(Seconds(5));
+ break;
+ }
+ }
+ DoMeleeAttackIfReady();
+ }
+ };
+
+ CreatureAI* GetAI(Creature* creature) const override
+ {
+ return GetInstanceAI<boss_archmage_arugalAI>(creature);
+ }
+};
+
class spell_shadowfang_keep_haunting_spirits : public SpellScriptLoader
{
public:
@@ -248,5 +364,6 @@ void AddSC_shadowfang_keep()
{
new npc_shadowfang_prisoner();
new npc_arugal_voidwalker();
+ new boss_archmage_arugal();
new spell_shadowfang_keep_haunting_spirits();
}
diff --git a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
index 88edc3f1ee1..7e508191f69 100644
--- a/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
+++ b/src/server/scripts/EasternKingdoms/ShadowfangKeep/shadowfang_keep.h
@@ -26,8 +26,8 @@ enum DataTypes
TYPE_FREE_NPC = 1,
TYPE_RETHILGORE = 2,
TYPE_FENRUS = 3,
- TYPE_NANDOS = 4
+ TYPE_NANDOS = 4,
+ BOSS_ARUGAL = 5
};
#endif
-
diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
index adcb4f9fc9a..d9c929794cc 100644
--- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
@@ -175,7 +175,7 @@ void AddSC_arathi_highlands();
void AddSC_blasted_lands();
void AddSC_burning_steppes();
void AddSC_duskwood();
-void AddSC_eastern_plaguelands();
+//void AddSC_eastern_plaguelands();
void AddSC_ghostlands();
void AddSC_hinterlands();
void AddSC_isle_of_queldanas();
@@ -352,7 +352,7 @@ void AddEasternKingdomsScripts()
AddSC_blasted_lands();
AddSC_burning_steppes();
AddSC_duskwood();
- AddSC_eastern_plaguelands();
+ //AddSC_eastern_plaguelands();
AddSC_ghostlands();
AddSC_hinterlands();
AddSC_isle_of_queldanas();
diff --git a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp b/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
deleted file mode 100644
index c35c8629cef..00000000000
--- a/src/server/scripts/EasternKingdoms/zone_eastern_plaguelands.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
- * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the
- * Free Software Foundation; either version 2 of the License, or (at your
- * option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/* ScriptData
-SDName: Eastern_Plaguelands
-SD%Complete: 100
-SDComment: Quest support: 5211. Special vendor Augustus the Touched
-SDCategory: Eastern Plaguelands
-EndScriptData */
-
-/* ContentData
-npc_ghoul_flayer
-npc_augustus_the_touched
-npc_darrowshire_spirit
-EndContentData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "ScriptedGossip.h"
-#include "Player.h"
-#include "WorldSession.h"
-
-class npc_ghoul_flayer : public CreatureScript
-{
-public:
- npc_ghoul_flayer() : CreatureScript("npc_ghoul_flayer") { }
-
- struct npc_ghoul_flayerAI : public ScriptedAI
- {
- npc_ghoul_flayerAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset() override { }
-
- void EnterCombat(Unit* /*who*/) override { }
-
- void JustDied(Unit* killer) override
- {
- if (killer->GetTypeId() == TYPEID_PLAYER)
- me->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000);
- }
- };
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_ghoul_flayerAI(creature);
- }
-};
-
-/*######
-## npc_augustus_the_touched
-######*/
-
-class npc_augustus_the_touched : public CreatureScript
-{
-public:
- npc_augustus_the_touched() : CreatureScript("npc_augustus_the_touched") { }
-
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
- {
- ClearGossipMenuFor(player);
- if (action == GOSSIP_ACTION_TRADE)
- player->GetSession()->SendListInventory(creature->GetGUID());
- return true;
- }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- if (creature->IsQuestGiver())
- player->PrepareQuestMenu(creature->GetGUID());
-
- if (creature->IsVendor() && player->GetQuestRewardStatus(6164))
- AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
-
- SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
- return true;
- }
-};
-
-/*######
-## npc_darrowshire_spirit
-######*/
-
-enum DarrowshireSpirit
-{
- SPELL_SPIRIT_SPAWNIN = 17321
-};
-
-class npc_darrowshire_spirit : public CreatureScript
-{
-public:
- npc_darrowshire_spirit() : CreatureScript("npc_darrowshire_spirit") { }
-
- bool OnGossipHello(Player* player, Creature* creature) override
- {
- SendGossipMenuFor(player, 3873, creature->GetGUID());
- player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const override
- {
- return new npc_darrowshire_spiritAI(creature);
- }
-
- struct npc_darrowshire_spiritAI : public ScriptedAI
- {
- npc_darrowshire_spiritAI(Creature* creature) : ScriptedAI(creature) { }
-
- void Reset() override
- {
- DoCast(me, SPELL_SPIRIT_SPAWNIN);
- me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- }
-
- void EnterCombat(Unit* /*who*/) override { }
- };
-};
-
-void AddSC_eastern_plaguelands()
-{
- new npc_ghoul_flayer();
- new npc_augustus_the_touched();
- new npc_darrowshire_spirit();
-}
diff --git a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
index 5d41908435e..722b7768617 100644
--- a/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
+++ b/src/server/scripts/Kalimdor/CavernsOfTime/BattleForMountHyjal/boss_anetheron.cpp
@@ -279,7 +279,7 @@ class spell_anetheron_vampiric_aura : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
@@ -287,7 +287,7 @@ class spell_anetheron_vampiric_aura : public SpellScriptLoader
return;
int32 bp = damageInfo->GetDamage() * 3;
- eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true);
+ eventInfo.GetActor()->CastCustomSpell(SPELL_VAMPIRIC_AURA_HEAL, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetActor(), true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
index 3bc3ec45e5f..976ef3e34db 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp
@@ -417,8 +417,9 @@ class npc_snobold_vassal : public CreatureScript
switch (eventId)
{
case EVENT_FIRE_BOMB:
- if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, -me->GetVehicleBase()->GetCombatReach(), true))
- me->CastSpell(target, SPELL_FIRE_BOMB);
+ if (me->GetVehicleBase())
+ if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, -me->GetVehicleBase()->GetCombatReach(), true))
+ me->CastSpell(target, SPELL_FIRE_BOMB);
_events.Repeat(Seconds(20));
break;
case EVENT_HEAD_CRACK:
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
index 77805dbfcb2..15e4885d4a7 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp
@@ -1115,7 +1115,7 @@ class spell_putricide_ooze_tank_protection : public SpellScriptLoader
PreventDefaultAction();
Unit* actionTarget = eventInfo.GetActionTarget();
- actionTarget->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
+ actionTarget->CastSpell((Unit*)nullptr, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
index a2348119dff..f3021cdbab5 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_sindragosa.cpp
@@ -1099,6 +1099,12 @@ class spell_sindragosa_s_fury : public SpellScriptLoader
if (!GetHitUnit()->IsAlive() || !_targetCount)
return;
+ if (GetHitUnit()->IsImmunedToDamage(GetSpellInfo()))
+ {
+ GetCaster()->SendSpellDamageImmune(GetHitUnit(), GetSpellInfo()->Id);
+ return;
+ }
+
float resistance = float(GetHitUnit()->GetResistance(SpellSchoolMask(GetSpellInfo()->SchoolMask)));
uint32 minResistFactor = uint32((resistance / (resistance + 510.0f)) * 10.0f) * 2;
uint32 randomResist = urand(0, (9 - minResistFactor) * 100) / 100 + minResistFactor;
diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
index b25f7ed3eca..82abb2836ba 100644
--- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
+++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/utgarde_keep.cpp
@@ -222,11 +222,11 @@ class spell_uk_second_wind : public SpellScriptLoader
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget();
- caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true);
+ caster->CastSpell(caster, SPELL_SECOND_WIND_TRIGGER, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp
index c22cd2d9ad7..cb5a7462000 100644
--- a/src/server/scripts/Northrend/zone_dragonblight.cpp
+++ b/src/server/scripts/Northrend/zone_dragonblight.cpp
@@ -701,6 +701,31 @@ class npc_torturer_lecraft : public CreatureScript
}
};
+enum MessengerTorvus
+{
+ NPC_MESSENGER_TORVUS = 26649,
+ QUEST_MESSAGE_FROM_THE_WEST = 12033,
+
+ TALK_0 = 0
+};
+
+class at_nearby_messenger_torvus : public AreaTriggerScript
+{
+public:
+ at_nearby_messenger_torvus() : AreaTriggerScript("at_nearby_messenger_torvus") { }
+
+ bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) override
+ {
+ if (player->IsAlive())
+ if (Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_MESSAGE_FROM_THE_WEST))
+ if (player->CanTakeQuest(quest, false))
+ if (Creature* creature = player->FindNearestCreature(NPC_MESSENGER_TORVUS, 50.0f, true))
+ creature->AI()->Talk(TALK_0, player);
+
+ return true;
+ }
+};
+
void AddSC_dragonblight()
{
new npc_commander_eligor_dawnbringer();
@@ -708,4 +733,5 @@ void AddSC_dragonblight()
new spell_q12096_q12092_bark();
new npc_wyrmrest_defender();
new npc_torturer_lecraft();
+ new at_nearby_messenger_torvus();
}
diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp
index 2effc1d9a2a..54ae9c27aeb 100644
--- a/src/server/scripts/Northrend/zone_storm_peaks.cpp
+++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp
@@ -281,6 +281,7 @@ public:
void UpdateAI(uint32 diff) override
{
+ VehicleAI::UpdateAI(diff);
events.Update(diff);
switch (events.ExecuteEvent())
diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp
index 1b0d5c22833..bcfd40234b7 100644
--- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp
+++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.cpp
@@ -48,7 +48,7 @@ class spell_mark_of_malice : public SpellScriptLoader
if (aurEff->GetBase()->GetCharges() > 1)
return;
- GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true);
+ GetTarget()->CastSpell(GetTarget(), SPELL_MARK_OF_MALICE_TRIGGERED, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.h b/src/server/scripts/Outland/BlackTemple/black_temple.h
index 0856639f4c2..9d2c3dacb3f 100644
--- a/src/server/scripts/Outland/BlackTemple/black_temple.h
+++ b/src/server/scripts/Outland/BlackTemple/black_temple.h
@@ -47,27 +47,29 @@ enum DataTypes
DATA_BLOOD_ELF_COUNCIL_VOICE = 15,
DATA_GO_ILLIDAN_GATE = 16,
- DATA_GO_ILLIDAN_DOOR_R = 17,
- DATA_GO_ILLIDAN_DOOR_L = 18
};
enum CreatureIds
{
+ //Bosses
NPC_HIGH_WARLORD_NAJENTUS = 22887,
NPC_SUPREMUS = 22898,
NPC_SHADE_OF_AKAMA = 22841,
- NPC_AKAMA_SHADE = 23191, // This is the Akama that starts the Shade of Akama encounter.
- NPC_AKAMA = 23089, // This is the Akama that starts the Illidan encounter.
+ NPC_TERON_GOREFIEND = 22871,
+ NPC_GURTOGG_BLOODBOIL = 22948,
+ NPC_RELIQUARY_OF_SOULS = 22856,
+ NPC_MOTHER_SHAHRAZ = 22947,
+ NPC_ILLIDARI_COUNCIL = 23426,
+ NPC_ILLIDAN_STORMRAGE = 22917,
+ //Misc
NPC_GATHIOS_THE_SHATTERER = 22949,
NPC_HIGH_NETHERMANCER_ZEREVOR = 22950,
NPC_LADY_MALANDE = 22951,
NPC_VERAS_DARKSHADOW = 22952,
- NPC_ILLIDARI_COUNCIL = 23426,
NPC_BLOOD_ELF_COUNCIL_VOICE = 23499,
-
- NPC_ILLIDAN_STORMRAGE = 22917,
-
+ NPC_AKAMA = 23089, // This is the Akama that starts the Illidan encounter.
+ NPC_AKAMA_SHADE = 23191, // This is the Akama that starts the Shade of Akama encounter.
NPC_SUPREMUS_VOLCANO = 23085
};
diff --git a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
index a2215862219..07578b4c9ae 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
@@ -539,8 +539,7 @@ public:
void EnterCombat(Unit* /*who*/) override
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
- me->setActive(true);
- DoZoneInCombat();
+ _EnterCombat();
}
void AttackStart(Unit* who) override
@@ -561,9 +560,6 @@ public:
{
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
- for (uint8 i = DATA_GO_ILLIDAN_DOOR_R; i < DATA_GO_ILLIDAN_DOOR_L + 1; ++i)
- instance->HandleGameObject(instance->GetGuidData(i), true);
-
_JustDied();
}
@@ -1412,23 +1408,13 @@ public:
IllidanGUID = instance->GetGuidData(DATA_ILLIDAN_STORMRAGE);
GateGUID = instance->GetGuidData(DATA_GO_ILLIDAN_GATE);
- DoorGUID[0] = instance->GetGuidData(DATA_GO_ILLIDAN_DOOR_R);
- DoorGUID[1] = instance->GetGuidData(DATA_GO_ILLIDAN_DOOR_L);
if (JustCreated) // close all doors at create
- {
instance->HandleGameObject(GateGUID, false);
-
- for (uint8 i = 0; i < 2; ++i)
- instance->HandleGameObject(DoorGUID[i], false);
- }
else // open all doors, raid wiped
{
instance->HandleGameObject(GateGUID, true);
WalkCount = 1; // skip first wp
-
- for (uint8 i = 0; i < 2; ++i)
- instance->HandleGameObject(DoorGUID[i], true);
}
KillAllElites();
@@ -1480,9 +1466,6 @@ public:
void BeginTalk()
{
- instance->SetBossState(DATA_ILLIDAN_STORMRAGE, IN_PROGRESS);
- for (uint8 i = 0; i < 2; ++i)
- instance->HandleGameObject(DoorGUID[i], false);
if (Creature* illidan = ObjectAccessor::GetCreature(*me, IllidanGUID))
{
illidan->RemoveAurasDueToSpell(SPELL_KNEEL);
@@ -1674,10 +1657,6 @@ public:
{
switch (WalkCount)
{
- case 6:
- for (uint8 i = 0; i < 2; ++i)
- instance->HandleGameObject(DoorGUID[i], true);
- break;
case 8:
if (Phase == PHASE_WALK)
EnterPhase(PHASE_TALK);
@@ -1795,7 +1774,6 @@ public:
ObjectGuid ChannelGUID;
ObjectGuid SpiritGUID[2];
ObjectGuid GateGUID;
- ObjectGuid DoorGUID[2];
uint32 ChannelCount;
uint32 WalkCount;
uint32 TalkCount;
diff --git a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
index 347843ec7ff..d83e9f8aed9 100644
--- a/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
+++ b/src/server/scripts/Outland/BlackTemple/boss_shade_of_akama.cpp
@@ -46,7 +46,7 @@ enum Spells
SPELL_FIXATE = 40607,
SPELL_CHAIN_LIGHTNING = 39945,
SPELL_DESTRUCTIVE_POISON = 40874,
- SPELL_AKAMA_SOUL_EXPEL = 40902,
+ SPELL_AKAMA_SOUL_RETRIEVE = 40902,
// Shade
SPELL_THREAT = 41602,
SPELL_SHADE_OF_AKAMA_TRIGGER = 40955,
@@ -108,7 +108,7 @@ enum Events
EVENT_CHAIN_LIGHTNING = 4,
EVENT_DESTRUCTIVE_POISON = 5,
EVENT_START_BROKEN_FREE = 6,
- EVENT_START_SOUL_EXPEL = 7,
+ EVENT_START_SOUL_RETRIEVE = 7,
EVENT_EVADE_CHECK = 8,
EVENT_BROKEN_FREE_1 = 9,
EVENT_BROKEN_FREE_2 = 10,
@@ -246,11 +246,11 @@ public:
events.ScheduleEvent(EVENT_START_CHANNELERS_AND_SPAWNERS, Seconds(1));
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
events.ScheduleEvent(EVENT_EVADE_CHECK, Seconds(10));
- if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = instance->GetCreature(DATA_AKAMA_SHADE))
AttackStart(akama);
}
- if (spell->Id == SPELL_AKAMA_SOUL_EXPEL)
+ if (spell->Id == SPELL_AKAMA_SOUL_RETRIEVE)
DoCastSelf(SPELL_AKAMA_SOUL_EXPEL_CHANNEL);
}
@@ -273,7 +273,7 @@ public:
{
DoCastSelf(SPELL_SHADE_OF_AKAMA_TRIGGER);
- if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = instance->GetCreature(DATA_AKAMA_SHADE))
akama->AI()->DoAction(ACTION_SHADE_OF_AKAMA_DEAD);
for (ObjectGuid const& spawnerGuid : _spawners)
@@ -401,7 +401,7 @@ public:
_isInCombat = true;
me->SetWalk(false);
me->RemoveAurasDueToSpell(SPELL_AKAMA_SOUL_CHANNEL);
- if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (Creature* shade = _instance->GetCreature(DATA_SHADE_OF_AKAMA))
{
shade->RemoveAurasDueToSpell(SPELL_AKAMA_SOUL_CHANNEL);
AttackStart(shade);
@@ -445,7 +445,7 @@ public:
{
me->SetWalk(false);
me->SetFacingTo(0.08726646f, true);
- _events.ScheduleEvent(EVENT_START_SOUL_EXPEL, Seconds(1));
+ _events.ScheduleEvent(EVENT_START_SOUL_RETRIEVE, Seconds(1));
}
}
@@ -489,14 +489,14 @@ public:
break;
case EVENT_CHAIN_LIGHTNING:
DoCastVictim(SPELL_CHAIN_LIGHTNING);
- _events.Repeat(randtime(Seconds(8), Seconds(15)));
+ _events.Repeat(Seconds(8), Seconds(15));
break;
case EVENT_DESTRUCTIVE_POISON:
DoCastSelf(SPELL_DESTRUCTIVE_POISON);
- _events.Repeat(randtime(Seconds(3), Seconds(7)));
+ _events.Repeat(Seconds(3), Seconds(7));
break;
- case EVENT_START_SOUL_EXPEL:
- DoCast(SPELL_AKAMA_SOUL_EXPEL);
+ case EVENT_START_SOUL_RETRIEVE:
+ DoCast(SPELL_AKAMA_SOUL_RETRIEVE);
_events.ScheduleEvent(EVENT_START_BROKEN_FREE, Seconds(15));
break;
case EVENT_START_BROKEN_FREE:
@@ -541,7 +541,7 @@ public:
{
_summons.DespawnAll();
Talk(SAY_DEAD);
- if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (Creature* shade = _instance->GetCreature(DATA_SHADE_OF_AKAMA))
if (shade->IsAlive())
shade->AI()->EnterEvadeMode(EVADE_REASON_OTHER);
}
@@ -587,7 +587,7 @@ public:
{
_scheduler.Schedule(Seconds(2), [this](TaskContext channel)
{
- if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (Creature* shade = _instance->GetCreature(DATA_SHADE_OF_AKAMA))
{
if (shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
DoCastSelf(SPELL_SHADE_SOUL_CHANNEL);
@@ -657,12 +657,12 @@ public:
if (_leftSide)
{
_events.ScheduleEvent(EVENT_SPAWN_WAVE_B, Milliseconds(100));
- _events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, randtime(Seconds(2), Seconds(5)));
+ _events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, Seconds(2), Seconds(5));
}
else
{
_events.ScheduleEvent(EVENT_SPAWN_WAVE_B, Seconds(10));
- _events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, randtime(Seconds(2), Seconds(5)));
+ _events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, Seconds(2), Seconds(5));
}
break;
case ACTION_STOP_SPAWNING:
@@ -687,15 +687,15 @@ public:
{
case EVENT_SPAWN_WAVE_B:
DoCastSelf(SPELL_ASHTONGUE_WAVE_B);
- _events.Repeat(randtime(Seconds(50), Seconds(60)));
+ _events.Repeat(Seconds(50), Seconds(60));
break;
case EVENT_SUMMON_ASHTONGUE_SORCERER: // left
DoCastSelf(SPELL_SUMMON_ASHTONGUE_SORCERER);
- _events.Repeat(randtime(Seconds(30), Seconds(35)));
+ _events.Repeat(Seconds(30), Seconds(35));
break;
case EVENT_SUMMON_ASHTONGUE_DEFENDER: // right
DoCastSelf(SPELL_SUMMON_ASHTONGUE_DEFENDER);
- _events.Repeat(randtime(Seconds(30), Seconds(40)));
+ _events.Repeat(Seconds(30), Seconds(40));
break;
default:
break;
@@ -736,16 +736,13 @@ public:
void Reset() override
{
- if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (Creature* shade = _instance->GetCreature(DATA_SHADE_OF_AKAMA))
{
if (shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
me->GetMotionMaster()->MovePoint(0, shade->GetPosition());
- else
- {
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
- AttackStart(akama);
- }
+ else if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
+ AttackStart(akama);
}
Initialize();
}
@@ -777,7 +774,7 @@ public:
_scheduler.Schedule(Seconds(1) + Milliseconds(500), [this](TaskContext sorcer_channel)
{
- if (Creature* shade = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_SHADE_OF_AKAMA)))
+ if (Creature* shade = _instance->GetCreature(DATA_SHADE_OF_AKAMA))
{
if (shade->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
@@ -789,7 +786,7 @@ public:
{
me->InterruptSpell(CURRENT_CHANNELED_SPELL);
_switchToCombat = true;
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
AttackStart(akama);
}
}
@@ -837,7 +834,7 @@ public:
void Reset() override
{
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
AttackStart(akama);
}
@@ -849,9 +846,9 @@ public:
void EnterCombat(Unit* /*who*/) override
{
_events.ScheduleEvent(EVENT_HEROIC_STRIKE, Seconds(5));
- _events.ScheduleEvent(EVENT_SHIELD_BASH, randtime(Seconds(10), Seconds(16)));
- _events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, randtime(Seconds(10), Seconds(16)));
- _events.ScheduleEvent(EVENT_WINDFURY, randtime(Seconds(8), Seconds(12)));
+ _events.ScheduleEvent(EVENT_SHIELD_BASH, Seconds(10), Seconds(16));
+ _events.ScheduleEvent(EVENT_DEBILITATING_STRIKE, Seconds(10), Seconds(16));
+ _events.ScheduleEvent(EVENT_WINDFURY, Seconds(8), Seconds(12));
}
@@ -868,19 +865,19 @@ public:
{
case EVENT_DEBILITATING_STRIKE:
DoCastVictim(SPELL_DEBILITATING_STRIKE);
- _events.Repeat(randtime(Seconds(20), Seconds(25)));
+ _events.Repeat(Seconds(20), Seconds(25));
break;
case EVENT_HEROIC_STRIKE:
DoCastSelf(SPELL_HEROIC_STRIKE);
- _events.Repeat(randtime(Seconds(5), Seconds(15)));
+ _events.Repeat(Seconds(5), Seconds(15));
break;
case EVENT_SHIELD_BASH:
DoCastVictim(SPELL_SHIELD_BASH);
- _events.Repeat(randtime(Seconds(10), Seconds(20)));
+ _events.Repeat(Seconds(10), Seconds(20));
break;
case EVENT_WINDFURY:
DoCastVictim(SPELL_WINDFURY);
- _events.Repeat(randtime(Seconds(6), Seconds(8)));
+ _events.Repeat(Seconds(6), Seconds(8));
break;
default:
break;
@@ -915,7 +912,7 @@ public:
void Reset() override
{
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
AttackStart(akama);
}
@@ -926,8 +923,8 @@ public:
void EnterCombat(Unit* /*who*/) override
{
- _events.ScheduleEvent(EVENT_DEBILITATING_POISON, randtime(Milliseconds(500), Seconds(2)));
- _events.ScheduleEvent(EVENT_EVISCERATE, randtime(Seconds(2), Seconds(5)));
+ _events.ScheduleEvent(EVENT_DEBILITATING_POISON, Milliseconds(500), Seconds(2));
+ _events.ScheduleEvent(EVENT_EVISCERATE, Seconds(2), Seconds(5));
}
void EnterEvadeMode(EvadeReason /*why*/) override { }
@@ -945,11 +942,11 @@ public:
{
case EVENT_DEBILITATING_POISON:
DoCastVictim(SPELL_DEBILITATING_POISON);
- _events.Repeat(randtime(Seconds(15), Seconds(20)));
+ _events.Repeat(Seconds(15), Seconds(20));
break;
case EVENT_EVISCERATE:
DoCastVictim(SPELL_EVISCERATE);
- _events.Repeat(randtime(Seconds(12), Seconds(20)));
+ _events.Repeat(Seconds(12), Seconds(20));
break;
default:
break;
@@ -984,7 +981,7 @@ public:
void Reset() override
{
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
AttackStart(akama);
}
@@ -1014,11 +1011,11 @@ public:
{
case EVENT_RAIN_OF_FIRE:
DoCastVictim(SPELL_RAIN_OF_FIRE);
- _events.Repeat(randtime(Seconds(15), Seconds(20)));
+ _events.Repeat(Seconds(15), Seconds(20));
break;
case EVENT_LIGHTNING_BOLT:
DoCastVictim(SPELL_LIGHTNING_BOLT);
- _events.Repeat(randtime(Seconds(8), Seconds(15)));
+ _events.Repeat(Seconds(8), Seconds(15));
break;
default:
break;
@@ -1062,7 +1059,7 @@ public:
{
Initialize();
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
AttackStart(akama);
}
@@ -1073,7 +1070,7 @@ public:
void EnterCombat(Unit* /*who*/) override
{
- _events.ScheduleEvent(EVENT_SPIRIT_HEAL, randtime(Seconds(5), Seconds(6)));
+ _events.ScheduleEvent(EVENT_SPIRIT_HEAL, Seconds(5), Seconds(6));
}
void DamageTaken(Unit* /*who*/, uint32& /*damage*/) override
@@ -1083,7 +1080,7 @@ public:
{
DoCastSelf(SPELL_SPIRIT_MEND);
_spiritMend = true;
- _events.ScheduleEvent(EVENT_SPIRIT_MEND_RESET, randtime(Seconds(10),Seconds(15)));
+ _events.ScheduleEvent(EVENT_SPIRIT_MEND_RESET, Seconds(10),Seconds(15));
}
if (!_chainHeal)
@@ -1091,7 +1088,7 @@ public:
{
DoCastSelf(SPELL_CHAIN_HEAL);
_chainHeal = true;
- _events.ScheduleEvent(EVENT_CHAIN_HEAL_RESET, randtime(Seconds(10), Seconds(15)));
+ _events.ScheduleEvent(EVENT_CHAIN_HEAL_RESET, Seconds(10), Seconds(15));
}
}
@@ -1108,7 +1105,7 @@ public:
{
case EVENT_SPIRIT_HEAL:
DoCastSelf(SPELL_SPIRITBINDER_SPIRIT_HEAL);
- _events.Repeat(randtime(Seconds(13), Seconds(16)));
+ _events.Repeat(Seconds(13), Seconds(16));
break;
case EVENT_SPIRIT_MEND_RESET:
_spiritMend = false;
@@ -1157,7 +1154,7 @@ public:
if (motionType != POINT_MOTION_TYPE)
return;
- if (Creature* akama = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_AKAMA_SHADE)))
+ if (Creature* akama = _instance->GetCreature(DATA_AKAMA_SHADE))
me->SetFacingToObject(akama);
}
diff --git a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
index bac996918ac..2784792fe8d 100644
--- a/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
+++ b/src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
@@ -22,17 +22,20 @@
DoorData const doorData[] =
{
{ GO_NAJENTUS_GATE, DATA_HIGH_WARLORD_NAJENTUS, DOOR_TYPE_PASSAGE },
- { GO_NAJENTUS_GATE, DATA_SUPREMUS, DOOR_TYPE_ROOM },
+ { GO_NAJENTUS_GATE, DATA_SUPREMUS, DOOR_TYPE_ROOM },
{ GO_SUPREMUS_GATE, DATA_SUPREMUS, DOOR_TYPE_PASSAGE },
- { GO_SHADE_OF_AKAMA_DOOR, DATA_SHADE_OF_AKAMA, DOOR_TYPE_ROOM },
- { GO_TERON_DOOR_1, DATA_TERON_GOREFIEND, DOOR_TYPE_ROOM },
- { GO_TERON_DOOR_2, DATA_TERON_GOREFIEND, DOOR_TYPE_ROOM },
+ { GO_SHADE_OF_AKAMA_DOOR, DATA_SHADE_OF_AKAMA, DOOR_TYPE_ROOM },
+ { GO_TERON_DOOR_1, DATA_TERON_GOREFIEND, DOOR_TYPE_ROOM },
+ { GO_TERON_DOOR_2, DATA_TERON_GOREFIEND, DOOR_TYPE_ROOM },
{ GO_GURTOGG_DOOR, DATA_GURTOGG_BLOODBOIL, DOOR_TYPE_PASSAGE },
{ GO_TEMPLE_DOOR, DATA_RELIQUARY_OF_SOULS, DOOR_TYPE_PASSAGE },
{ GO_MOTHER_SHAHRAZ_DOOR, DATA_MOTHER_SHAHRAZ, DOOR_TYPE_PASSAGE },
- { GO_COUNCIL_DOOR_1, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM },
- { GO_COUNCIL_DOOR_2, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM },
- { 0, 0, DOOR_TYPE_ROOM } // END
+ { GO_COUNCIL_DOOR_1, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM },
+ { GO_COUNCIL_DOOR_2, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM },
+ //{ GO_ILLIDAN_GATE, DATA_GO_ILLIDAN_GATE, DOOR_TYPE_PASSAGE },
+ { GO_ILLIDAN_DOOR_R, DATA_ILLIDAN_STORMRAGE, DOOR_TYPE_ROOM },
+ { GO_ILLIDAN_DOOR_L, DATA_ILLIDAN_STORMRAGE, DOOR_TYPE_ROOM },
+ { 0, 0, DOOR_TYPE_ROOM } // END
};
BossBoundaryData const boundaries =
@@ -49,6 +52,27 @@ BossBoundaryData const boundaries =
{ DATA_ILLIDAN_STORMRAGE, new EllipseBoundary(Position(694.8f, 309.0f), 70.0 , 85.0) }
};
+ObjectData const creatureData[] =
+{
+ { NPC_HIGH_WARLORD_NAJENTUS, DATA_HIGH_WARLORD_NAJENTUS },
+ { NPC_SUPREMUS, DATA_SUPREMUS },
+ { NPC_SHADE_OF_AKAMA, DATA_SHADE_OF_AKAMA },
+ { NPC_TERON_GOREFIEND, DATA_TERON_GOREFIEND },
+ { NPC_GURTOGG_BLOODBOIL, DATA_GURTOGG_BLOODBOIL },
+ { NPC_RELIQUARY_OF_SOULS, DATA_RELIQUARY_OF_SOULS },
+ { NPC_MOTHER_SHAHRAZ, DATA_MOTHER_SHAHRAZ },
+ { NPC_ILLIDARI_COUNCIL, DATA_ILLIDARI_COUNCIL },
+ { NPC_ILLIDAN_STORMRAGE, DATA_ILLIDAN_STORMRAGE },
+ { NPC_AKAMA_SHADE, DATA_AKAMA_SHADE },
+ { NPC_AKAMA, DATA_AKAMA },
+ { NPC_GATHIOS_THE_SHATTERER, DATA_GATHIOS_THE_SHATTERER },
+ { NPC_HIGH_NETHERMANCER_ZEREVOR, DATA_HIGH_NETHERMANCER_ZEREVOR },
+ { NPC_LADY_MALANDE, DATA_LADY_MALANDE },
+ { NPC_VERAS_DARKSHADOW, DATA_VERAS_DARKSHADOW },
+ { NPC_BLOOD_ELF_COUNCIL_VOICE, DATA_BLOOD_ELF_COUNCIL_VOICE },
+ { 0, 0 } // end
+};
+
class instance_black_temple : public InstanceMapScript
{
public:
@@ -61,165 +85,28 @@ class instance_black_temple : public InstanceMapScript
SetHeaders(DataHeader);
SetBossNumber(EncounterCount);
LoadDoorData(doorData);
+ LoadObjectData(creatureData, nullptr);
LoadBossBoundaries(boundaries);
}
- void OnCreatureCreate(Creature* creature) override
- {
- switch (creature->GetEntry())
- {
- case NPC_HIGH_WARLORD_NAJENTUS:
- NajentusGUID = creature->GetGUID();
- break;
- case NPC_SUPREMUS:
- SupremusGUID = creature->GetGUID();
- break;
- case NPC_SHADE_OF_AKAMA:
- ShadeOfAkamaGUID = creature->GetGUID();
- break;
- case NPC_AKAMA_SHADE:
- AkamaShadeGUID = creature->GetGUID();
- break;
- case NPC_AKAMA:
- AkamaGUID = creature->GetGUID();
- break;
- case NPC_GATHIOS_THE_SHATTERER:
- GathiosTheShattererGUID = creature->GetGUID();
- break;
- case NPC_HIGH_NETHERMANCER_ZEREVOR:
- HighNethermancerZerevorGUID = creature->GetGUID();
- break;
- case NPC_LADY_MALANDE:
- LadyMalandeGUID = creature->GetGUID();
- break;
- case NPC_VERAS_DARKSHADOW:
- VerasDarkshadowGUID = creature->GetGUID();
- break;
- case NPC_ILLIDARI_COUNCIL:
- IllidariCouncilGUID = creature->GetGUID();
- break;
- case NPC_BLOOD_ELF_COUNCIL_VOICE:
- BloodElfCouncilVoiceGUID = creature->GetGUID();
- break;
- case NPC_ILLIDAN_STORMRAGE:
- IllidanStormrageGUID = creature->GetGUID();
- break;
- default:
- break;
- }
- }
-
void OnGameObjectCreate(GameObject* go) override
{
- switch (go->GetEntry())
- {
- case GO_NAJENTUS_GATE:
- case GO_SUPREMUS_GATE:
- case GO_SHADE_OF_AKAMA_DOOR:
- case GO_TERON_DOOR_1:
- case GO_TERON_DOOR_2:
- case GO_GURTOGG_DOOR:
- case GO_TEMPLE_DOOR:
- case GO_MOTHER_SHAHRAZ_DOOR:
- case GO_COUNCIL_DOOR_1:
- case GO_COUNCIL_DOOR_2:
- AddDoor(go, true);
- break;
- case GO_ILLIDAN_GATE:
- IllidanGateGUID = go->GetGUID();
- break;
- case GO_ILLIDAN_DOOR_R:
- IllidanDoorGUIDs[0] = go->GetGUID();
- break;
- case GO_ILLIDAN_DOOR_L:
- IllidanDoorGUIDs[1] = go->GetGUID();
- break;
- default:
- break;
- }
- }
+ if (go->GetEntry() == GO_ILLIDAN_GATE)
+ IllidanGateGUID = go->GetGUID();
- void OnGameObjectRemove(GameObject* go) override
- {
- switch (go->GetEntry())
- {
- case GO_NAJENTUS_GATE:
- case GO_SUPREMUS_GATE:
- case GO_SHADE_OF_AKAMA_DOOR:
- case GO_TERON_DOOR_1:
- case GO_TERON_DOOR_2:
- case GO_GURTOGG_DOOR:
- case GO_TEMPLE_DOOR:
- case GO_MOTHER_SHAHRAZ_DOOR:
- case GO_COUNCIL_DOOR_1:
- case GO_COUNCIL_DOOR_2:
- AddDoor(go, false);
- break;
- default:
- break;
- }
+ InstanceScript::OnGameObjectCreate(go);
}
ObjectGuid GetGuidData(uint32 type) const override
{
- switch (type)
- {
- case DATA_HIGH_WARLORD_NAJENTUS:
- return NajentusGUID;
- case DATA_SUPREMUS:
- return SupremusGUID;
- case DATA_SHADE_OF_AKAMA:
- return ShadeOfAkamaGUID;
- case DATA_AKAMA_SHADE:
- return AkamaShadeGUID;
- case DATA_AKAMA:
- return AkamaGUID;
- case DATA_GATHIOS_THE_SHATTERER:
- return GathiosTheShattererGUID;
- case DATA_HIGH_NETHERMANCER_ZEREVOR:
- return HighNethermancerZerevorGUID;
- case DATA_LADY_MALANDE:
- return LadyMalandeGUID;
- case DATA_VERAS_DARKSHADOW:
- return VerasDarkshadowGUID;
- case DATA_ILLIDARI_COUNCIL:
- return IllidariCouncilGUID;
- case DATA_BLOOD_ELF_COUNCIL_VOICE:
- return BloodElfCouncilVoiceGUID;
- case DATA_ILLIDAN_STORMRAGE:
- return IllidanStormrageGUID;
- case DATA_GO_ILLIDAN_GATE:
- return IllidanGateGUID;
- case DATA_GO_ILLIDAN_DOOR_R:
- return IllidanDoorGUIDs[0];
- case DATA_GO_ILLIDAN_DOOR_L:
- return IllidanDoorGUIDs[1];
- default:
- break;
- }
+ if (type == DATA_GO_ILLIDAN_GATE)
+ return IllidanGateGUID;
- return ObjectGuid::Empty;
+ return InstanceScript::GetGuidData(type);
}
protected:
- ObjectGuid NajentusGUID;
- ObjectGuid SupremusGUID;
- ObjectGuid ShadeOfAkamaGUID;
- ObjectGuid AkamaShadeGUID;
- ObjectGuid AkamaGUID;
-
- ObjectGuid GathiosTheShattererGUID;
- ObjectGuid HighNethermancerZerevorGUID;
- ObjectGuid LadyMalandeGUID;
- ObjectGuid VerasDarkshadowGUID;
-
- ObjectGuid IllidariCouncilGUID;
- ObjectGuid BloodElfCouncilVoiceGUID;
-
- ObjectGuid IllidanStormrageGUID;
-
ObjectGuid IllidanGateGUID;
- ObjectGuid IllidanDoorGUIDs[2];
};
InstanceScript* GetInstanceScript(InstanceMap* map) const override
diff --git a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
index f305c1e47be..daea6d24a4a 100644
--- a/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
+++ b/src/server/scripts/Outland/boss_doomlord_kazzak.cpp
@@ -239,14 +239,14 @@ class spell_twisted_reflection : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
if (!damageInfo || !damageInfo->GetDamage())
return;
- eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), SPELL_TWISTED_REFLECTION_HEAL, true);
+ eventInfo.GetActionTarget()->CastSpell(eventInfo.GetActor(), SPELL_TWISTED_REFLECTION_HEAL, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
index d4faeef73b9..3b364d557ed 100644
--- a/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
+++ b/src/server/scripts/Outland/zone_hellfire_peninsula.cpp
@@ -332,8 +332,14 @@ public:
enum FelGuard
{
- SPELL_SUMMON_POO = 37688,
- NPC_DERANGED_HELBOAR = 16863
+ SPELL_SUMMON_POO = 37688,
+ SPELL_FAKE_BLOOD = 37692,
+ NPC_DERANGED_HELBOAR = 16863,
+
+ EVENT_SEARCH_HELBOAR = 1,
+ EVENT_HELBOAR_FOUND = 2,
+ EVENT_SUMMON_POO = 3,
+ EVENT_FOLLOW_PLAYER = 4
};
class npc_fel_guard_hound : public CreatureScript
@@ -350,8 +356,8 @@ public:
void Initialize()
{
- checkTimer = 5000; //check for creature every 5 sec
helboarGUID.Clear();
+ _events.ScheduleEvent(EVENT_SEARCH_HELBOAR, Seconds(3));
}
void Reset() override
@@ -366,29 +372,54 @@ public:
if (Creature* helboar = ObjectAccessor::GetCreature(*me, helboarGUID))
{
- helboar->RemoveCorpse();
- DoCast(SPELL_SUMMON_POO);
-
- if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
- me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
+ _events.CancelEvent(EVENT_SEARCH_HELBOAR);
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
+ me->CastSpell(helboar, SPELL_FAKE_BLOOD);
+ _events.ScheduleEvent(EVENT_HELBOAR_FOUND, Seconds(2));
}
}
void UpdateAI(uint32 diff) override
{
- if (checkTimer <= diff)
+ _events.Update(diff);
+
+ while (uint32 eventId = _events.ExecuteEvent())
{
- if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
+ switch (eventId)
{
- if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
- {
- helboarGUID = helboar->GetGUID();
- me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
- }
+ case EVENT_SEARCH_HELBOAR:
+ if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
+ {
+ if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
+ {
+ helboarGUID = helboar->GetGUID();
+ me->SetWalk(true);
+ me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
+ helboar->DespawnOrUnsummon(Seconds(10));
+ }
+ }
+ _events.Repeat(Seconds(3));
+ break;
+ case EVENT_HELBOAR_FOUND:
+ if (Creature* helboar = ObjectAccessor::GetCreature(*me, helboarGUID))
+ {
+ me->HandleEmoteCommand(EMOTE_ONESHOT_ATTACK_UNARMED);
+ me->CastSpell(helboar, SPELL_FAKE_BLOOD);
+ _events.ScheduleEvent(EVENT_SUMMON_POO, Seconds(1));
+ }
+ break;
+ case EVENT_SUMMON_POO:
+ DoCast(SPELL_SUMMON_POO);
+ _events.ScheduleEvent(EVENT_FOLLOW_PLAYER, Seconds(2));
+ break;
+ case EVENT_FOLLOW_PLAYER:
+ me->SetWalk(false);
+ if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
+ me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
+ _events.ScheduleEvent(EVENT_SEARCH_HELBOAR, Seconds(3));
+ break;
}
- checkTimer = 5000;
}
- else checkTimer -= diff;
if (!UpdateVictim())
return;
@@ -397,7 +428,7 @@ public:
}
private:
- uint32 checkTimer;
+ EventMap _events;
ObjectGuid helboarGUID;
};
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp
index a155dbc36c4..7092300af4d 100644
--- a/src/server/scripts/Pet/pet_hunter.cpp
+++ b/src/server/scripts/Pet/pet_hunter.cpp
@@ -42,6 +42,10 @@ enum PetSpellsMisc
SPELL_PET_GUARD_DOG_HAPPINESS = 54445,
SPELL_PET_SILVERBACK_RANK_1 = 62800,
SPELL_PET_SILVERBACK_RANK_2 = 62801,
+
+ SPELL_PET_SWOOP = 52825,
+ SPELL_PET_CHARGE = 61685,
+
PET_ICON_ID_GROWL = 201,
PET_ICON_ID_CLAW = 262,
PET_ICON_ID_BITE = 1680,
@@ -162,10 +166,29 @@ class spell_pet_charge : public SpellScriptLoader
{
PrepareAuraScript(spell_pet_charge_AuraScript);
- void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(SPELL_PET_SWOOP) ||
+ !sSpellMgr->GetSpellInfo(SPELL_PET_CHARGE))
+ return false;
+ return true;
+ }
+
+ void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
{
// Prevent console log
PreventDefaultAction();
+
+ // Remove +% AP aura
+ Unit* pet = eventInfo.GetActor();
+ Aura* aura = pet->GetAura(SPELL_PET_SWOOP, pet->GetGUID());
+ if (!aura)
+ aura = pet->GetAura(SPELL_PET_CHARGE, pet->GetGUID());
+
+ if (!aura)
+ return;
+
+ aura->DropCharge(AURA_REMOVE_BY_EXPIRE);
}
void Register() override
@@ -213,7 +236,7 @@ class spell_pet_guard_dog : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true);
+ caster->CastSpell((Unit*)nullptr, SPELL_PET_GUARD_DOG_HAPPINESS, true, nullptr, aurEff);
float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount());
eventInfo.GetProcTarget()->AddThreat(caster, addThreat);
@@ -260,14 +283,14 @@ class spell_pet_silverback : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static uint32 const triggerSpell[2] = { SPELL_PET_SILVERBACK_RANK_1, SPELL_PET_SILVERBACK_RANK_2 };
PreventDefaultAction();
uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1];
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp
index 7cce7e4655e..13eec799493 100644
--- a/src/server/scripts/Spells/spell_dk.cpp
+++ b/src/server/scripts/Spells/spell_dk.cpp
@@ -600,7 +600,7 @@ class spell_dk_butchery : public SpellScriptLoader
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastCustomSpell(SPELL_DK_BUTCHERY_RUNIC_POWER, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), (Unit*)nullptr, true);
+ eventInfo.GetActor()->CastCustomSpell(SPELL_DK_BUTCHERY_RUNIC_POWER, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1249,10 +1249,10 @@ class spell_dk_glyph_of_scourge_strike : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_GLYPH_OF_SCOURGE_STRIKE_SCRIPT, true, nullptr, aurEff);
}
void Register() override
@@ -1588,10 +1588,10 @@ class spell_dk_pvp_4p_bonus : public SpellScriptLoader
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_SNARE))) != 0;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActionTarget()->CastSpell((Unit*)nullptr, SPELL_DK_RUNIC_RETURN, true);
+ eventInfo.GetActionTarget()->CastSpell((Unit*)nullptr, SPELL_DK_RUNIC_RETURN, true, nullptr, aurEff);
}
void Register() override
@@ -1624,10 +1624,10 @@ class spell_dk_mark_of_blood : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DK_MARK_OF_BLOOD_HEAL, true, nullptr, aurEff);
}
void Register() override
@@ -1668,7 +1668,7 @@ class spell_dk_necrosis : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
- eventInfo.GetActor()->CastCustomSpell(SPELL_DK_NECROSIS_DAMAGE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true);
+ eventInfo.GetActor()->CastCustomSpell(SPELL_DK_NECROSIS_DAMAGE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff);
}
void Register() override
@@ -2327,7 +2327,7 @@ class spell_dk_sudden_doom : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -2347,7 +2347,7 @@ class spell_dk_sudden_doom : public SpellScriptLoader
if (!spellId)
return;
- caster->CastSpell(eventInfo.GetProcTarget(), spellId, true);
+ caster->CastSpell(eventInfo.GetProcTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -2424,7 +2424,7 @@ class spell_dk_threat_of_thassarian : public SpellScriptLoader
return;
spellId = sSpellMgr->GetSpellWithRank(spellId, spellInfo->GetRank());
- caster->CastSpell(eventInfo.GetProcTarget(), spellId, true);
+ caster->CastSpell(eventInfo.GetProcTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -2478,7 +2478,7 @@ class spell_dk_unholy_blight : public SpellScriptLoader
// Add remaining ticks to healing done
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_DK_UNHOLY_BLIGHT_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE);
- caster->CastCustomSpell(SPELL_DK_UNHOLY_BLIGHT_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_DK_UNHOLY_BLIGHT_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2541,7 +2541,7 @@ class spell_dk_vendetta : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_DK_VENDETTA_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_DK_VENDETTA_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -2586,7 +2586,7 @@ class spell_dk_wandering_plague : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_DK_WANDERING_PLAGUE_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_DK_WANDERING_PLAGUE_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 49baab54bf0..56624346772 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -486,10 +486,10 @@ class spell_dru_glyph_of_barkskin : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_BARKSKIN_01, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_BARKSKIN_01, true, nullptr, aurEff);
}
void Register() override
@@ -530,7 +530,7 @@ class spell_dru_glyph_of_innervate : public SpellScriptLoader
int32 amount = CalculatePct(static_cast<int32>(caster->GetCreatePowers(POWER_MANA)), aurEff->GetAmount());
amount /= spellInfo->GetMaxTicks();
- caster->CastCustomSpell(SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_DRUID_GLYPH_OF_INNERVATE_REGEN, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -567,10 +567,10 @@ class spell_dru_glyph_of_rake : public SpellScriptLoader
return eventInfo.GetProcTarget()->GetTypeId() == TYPEID_UNIT;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_RAKE_TRIGGERED, true, nullptr, aurEff);
}
void Register() override
@@ -616,7 +616,7 @@ class spell_dru_glyph_of_rejuvenation : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
- eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true);
+ eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_GLYPH_OF_REJUVENATION_HEAL, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff);
}
void Register() override
@@ -762,10 +762,10 @@ class spell_dru_glyph_of_starfire_dummy : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_GLYPH_OF_STARFIRE_SCRIPT, true, nullptr, aurEff);
}
void Register() override
@@ -905,7 +905,7 @@ class spell_dru_leader_of_the_pack : public SpellScriptLoader
return;
int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_DRUID_IMP_LEADER_OF_THE_PACK_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_DRUID_IMP_LEADER_OF_THE_PACK_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
// Because of how proc system works, we can't store proc cd on db, it would be applied to entire aura
// so aura could only proc once per 6 seconds, independently of caster
@@ -915,12 +915,11 @@ class spell_dru_leader_of_the_pack : public SpellScriptLoader
if (aurEff->GetCasterGUID() != caster->GetGUID())
return;
- AuraEffect const* impLotpMana = caster->GetAuraEffectOfRankedSpell(SPELL_DRUID_IMP_LEADER_OF_THE_PACK_R1, EFFECT_1, aurEff->GetCasterGUID());
- if (!impLotpMana)
- return;
+ AuraEffect const* impLotpMana = caster->GetAuraEffectOfRankedSpell(SPELL_DRUID_IMP_LEADER_OF_THE_PACK_R1, EFFECT_0, aurEff->GetCasterGUID());
+ ASSERT(impLotpMana);
- int32 manaAmount = CalculatePct(static_cast<int32>(caster->GetMaxPower(POWER_MANA)), impLotpMana->GetAmount());
- caster->CastCustomSpell(SPELL_DRUID_IMP_LEADER_OF_THE_PACK_MANA, SPELLVALUE_BASE_POINT0, manaAmount, (Unit*)nullptr, true);
+ int32 manaAmount = CalculatePct(static_cast<int32>(caster->GetMaxPower(POWER_MANA)), impLotpMana->GetSpellInfo()->Effects[EFFECT_1].CalcValue());
+ caster->CastCustomSpell(SPELL_DRUID_IMP_LEADER_OF_THE_PACK_MANA, SPELLVALUE_BASE_POINT0, manaAmount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1043,7 +1042,7 @@ class spell_dru_living_seed : public SpellScriptLoader
return;
int32 amount = CalculatePct(healInfo->GetHeal(), aurEff->GetAmount());
- GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_PROC, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff);
+ GetTarget()->CastCustomSpell(SPELL_DRUID_LIVING_SEED_PROC, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff);
}
void Register() override
@@ -1162,11 +1161,11 @@ class spell_dru_omen_of_clarity : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
Unit* target = GetTarget();
if (target->HasAura(SPELL_DRUID_BALANCE_T10_BONUS))
- target->CastSpell((Unit*)nullptr, SPELL_DRUID_BALANCE_T10_BONUS_PROC, true, nullptr);
+ target->CastSpell((Unit*)nullptr, SPELL_DRUID_BALANCE_T10_BONUS_PROC, true, nullptr, aurEff);
}
void Register() override
@@ -1335,7 +1334,7 @@ class spell_dru_revitalize : public SpellScriptLoader
return;
}
- eventInfo.GetActor()->CastSpell(target, spellId, true);
+ eventInfo.GetActor()->CastSpell(target, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1420,7 +1419,7 @@ class spell_dru_savage_defense : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
int32 amount = static_cast<int32>(CalculatePct(caster->GetTotalAttackPowerValue(BASE_ATTACK), aurEff->GetAmount()));
- caster->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1613,7 +1612,7 @@ class spell_dru_survival_instincts : public SpellScriptLoader
{
Unit* target = GetTarget();
int32 bp0 = target->CountPctFromMaxHealth(aurEff->GetAmount());
- target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, NULL, NULL, true);
+ target->CastCustomSpell(target, SPELL_DRUID_SURVIVAL_INSTINCTS, &bp0, nullptr, nullptr, true, nullptr, aurEff);
}
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1654,7 +1653,7 @@ class spell_dru_swift_flight_passive : public SpellScriptLoader
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
}
- void CalculateAmount(AuraEffect const* /*aurEff*/, int32 & amount, bool & /*canBeRecalculated*/)
+ void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool & /*canBeRecalculated*/)
{
if (Player* caster = GetCaster()->ToPlayer())
if (caster->Has310Flyer(false))
@@ -1756,7 +1755,7 @@ class spell_dru_t3_2p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* target = eventInfo.GetProcTarget();
@@ -1777,7 +1776,7 @@ class spell_dru_t3_2p_bonus : public SpellScriptLoader
return;
}
- eventInfo.GetActor()->CastSpell(target, spellId, true);
+ eventInfo.GetActor()->CastSpell(target, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1810,10 +1809,10 @@ class spell_dru_t3_6p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_BLESSING_OF_THE_CLAW, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_DRUID_BLESSING_OF_THE_CLAW, true, nullptr, aurEff);
}
void Register() override
@@ -1854,7 +1853,7 @@ class spell_dru_t3_8p_bonus : public SpellScriptLoader
Unit* caster = eventInfo.GetActor();
int32 amount = CalculatePct(spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_DRUID_EXHILARATE, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_DRUID_EXHILARATE, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1887,10 +1886,10 @@ class spell_dru_t4_2p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_INFUSION, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_DRUID_INFUSION, true, nullptr, aurEff);
}
void Register() override
@@ -1924,7 +1923,7 @@ class spell_dru_item_t6_trinket : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
@@ -1956,7 +1955,7 @@ class spell_dru_item_t6_trinket : public SpellScriptLoader
return;
if (roll_chance_i(chance))
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -2076,7 +2075,7 @@ class spell_dru_t10_balance_4p_bonus : public SpellScriptLoader
// Add remaining ticks to damage done
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_DRUID_LANGUISH, SPELL_AURA_PERIODIC_DAMAGE);
- caster->CastCustomSpell(SPELL_DRUID_LANGUISH, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_DRUID_LANGUISH, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2180,12 +2179,12 @@ class spell_dru_t10_restoration_4p_bonus_dummy : public SpellScriptLoader
return caster->GetGroup() || caster != eventInfo.GetProcTarget();
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
int32 amount = static_cast<int32>(eventInfo.GetHealInfo()->GetHeal());
- eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_REJUVENATION_T10_PROC, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ eventInfo.GetActor()->CastCustomSpell(SPELL_DRUID_REJUVENATION_T10_PROC, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp
index f1eaf45770e..d0fcd1080bb 100644
--- a/src/server/scripts/Spells/spell_generic.cpp
+++ b/src/server/scripts/Spells/spell_generic.cpp
@@ -3570,7 +3570,7 @@ class spell_gen_vampiric_touch : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
DamageInfo* damageInfo = eventInfo.GetDamageInfo();
@@ -3579,7 +3579,7 @@ class spell_gen_vampiric_touch : public SpellScriptLoader
Unit* caster = eventInfo.GetActor();
int32 bp = damageInfo->GetDamage() / 2;
- caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true);
+ caster->CastCustomSpell(SPELL_VAMPIRIC_TOUCH_HEAL, SPELLVALUE_BASE_POINT0, bp, caster, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_hunter.cpp b/src/server/scripts/Spells/spell_hunter.cpp
index 2eba605f8b3..b341c5799ed 100644
--- a/src/server/scripts/Spells/spell_hunter.cpp
+++ b/src/server/scripts/Spells/spell_hunter.cpp
@@ -225,7 +225,7 @@ class spell_hun_chimera_shot : public SpellScriptLoader
// first, calculate damage of basic tick (C&P from AuraEffect::HandlePeriodicDamageAurasTick)
basePoint = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
if (Player* modOwner = caster->GetSpellModOwner())
- modOwner->ApplySpellMod<SPELLMOD_DOT>(aurEff->GetSpellInfo()->Id, basePoint);
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(aurEff->GetId(), basePoint);
basePoint = unitTarget->SpellDamageBonusTaken(caster, aurEff->GetSpellInfo(), basePoint, DOT, aura->GetStackAmount());
// then, multiply to get damage potential
@@ -275,6 +275,70 @@ class spell_hun_chimera_shot : public SpellScriptLoader
}
};
+// -53256 - Cobra Strikes
+class spell_hun_cobra_strikes : public SpellScriptLoader
+{
+ public:
+ spell_hun_cobra_strikes() : SpellScriptLoader("spell_hun_cobra_strikes") { }
+
+ class spell_hun_cobra_strikes_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_cobra_strikes_AuraScript);
+
+ bool Validate(SpellInfo const* spellInfo) override
+ {
+ if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
+ return false;
+ return true;
+ }
+
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
+ {
+ PreventDefaultAction();
+
+ SpellInfo const* triggeredSpellInfo = sSpellMgr->AssertSpellInfo(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell);
+ GetTarget()->CastCustomSpell(triggeredSpellInfo->Id, SPELLVALUE_AURA_STACK, triggeredSpellInfo->StackAmount, (Unit*)nullptr, true);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_hun_cobra_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hun_cobra_strikes_AuraScript();
+ }
+};
+
+// 53257 - Cobra Strikes (triggered spell)
+class spell_hun_cobra_strikes_triggered : public SpellScriptLoader
+{
+ public:
+ spell_hun_cobra_strikes_triggered() : SpellScriptLoader("spell_hun_cobra_strikes_triggered") { }
+
+ class spell_hun_cobra_strikes_triggered_AuraScript : public AuraScript
+ {
+ PrepareAuraScript(spell_hun_cobra_strikes_triggered_AuraScript);
+
+ void HandleStackDrop(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
+ {
+ ModStackAmount(-1);
+ }
+
+ void Register() override
+ {
+ OnEffectProc += AuraEffectProcFn(spell_hun_cobra_strikes_triggered_AuraScript::HandleStackDrop, EFFECT_0, SPELL_AURA_ADD_FLAT_MODIFIER);
+ }
+ };
+
+ AuraScript* GetAuraScript() const override
+ {
+ return new spell_hun_cobra_strikes_triggered_AuraScript();
+ }
+};
+
// 781 - Disengage
class spell_hun_disengage : public SpellScriptLoader
{
@@ -385,10 +449,10 @@ class spell_hun_glyph_of_mend_pet : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS, true);
+ eventInfo.GetProcTarget()->CastSpell((Unit*)nullptr, SPELL_HUNTER_GLYPH_OF_MEND_PET_HAPPINESS, true, nullptr, aurEff);
}
void Register() override
@@ -420,10 +484,10 @@ class spell_hun_hunting_party : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true, nullptr, aurEff);
}
void Register() override
@@ -681,30 +745,58 @@ class spell_hun_masters_call : public SpellScriptLoader
return true;
}
+ bool Load() override
+ {
+ return GetCaster()->GetTypeId() == TYPEID_PLAYER;
+ }
+
+ SpellCastResult DoCheckCast()
+ {
+ Pet* pet = GetCaster()->ToPlayer()->GetPet();
+ ASSERT(pet); // checked in Spell::CheckCast
+
+ if (!pet->IsAlive())
+ return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
+
+ // Do a mini Spell::CheckCasterAuras on the pet, no other way of doing this
+ SpellCastResult result = SPELL_CAST_OK;
+ uint32 const unitflag = pet->GetUInt32Value(UNIT_FIELD_FLAGS);
+ if (pet->GetCharmerGUID())
+ result = SPELL_FAILED_CHARMED;
+ else if (unitflag & UNIT_FLAG_STUNNED)
+ result = SPELL_FAILED_STUNNED;
+ else if (unitflag & UNIT_FLAG_FLEEING)
+ result = SPELL_FAILED_FLEEING;
+ else if (unitflag & UNIT_FLAG_CONFUSED)
+ result = SPELL_FAILED_CONFUSED;
+
+ if (result != SPELL_CAST_OK)
+ return result;
+
+ Unit* target = GetExplTargetUnit();
+ if (!target)
+ return SPELL_FAILED_BAD_TARGETS;
+
+ if (!pet->IsWithinLOSInMap(target))
+ return SPELL_FAILED_LINE_OF_SIGHT;
+
+ return SPELL_CAST_OK;
+ }
+
void HandleDummy(SpellEffIndex /*effIndex*/)
{
- if (Unit* ally = GetHitUnit())
- if (Player* caster = GetCaster()->ToPlayer())
- if (Pet* target = caster->GetPet())
- {
- TriggerCastFlags castMask = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_CASTER_AURASTATE);
- target->CastSpell(ally, GetEffectValue(), castMask);
- target->CastSpell(ally, GetSpellInfo()->Effects[EFFECT_0].CalcValue(), castMask);
- }
+ GetCaster()->ToPlayer()->GetPet()->CastSpell(GetHitUnit(), GetEffectValue(), true);
}
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
{
- if (Unit* target = GetHitUnit())
- {
- // Cannot be processed while pet is dead
- TriggerCastFlags castMask = TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_CASTER_AURASTATE);
- target->CastSpell(target, SPELL_HUNTER_MASTERS_CALL_TRIGGERED, castMask);
- }
+ GetHitUnit()->CastSpell((Unit*)nullptr, SPELL_HUNTER_MASTERS_CALL_TRIGGERED, true);
}
void Register() override
{
+ OnCheckCast += SpellCheckCastFn(spell_hun_masters_call_SpellScript::DoCheckCast);
+
OnEffectHitTarget += SpellEffectFn(spell_hun_masters_call_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
OnEffectHitTarget += SpellEffectFn(spell_hun_masters_call_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
@@ -1022,7 +1114,7 @@ class spell_hun_rapid_recuperation_trigger : public SpellScriptLoader
}
}
- void HandleRapidKillingProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleRapidKillingProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static uint32 const triggerSpells[2] = { SPELL_HUNTER_RAPID_RECUPERATION_MANA_R1, SPELL_HUNTER_RAPID_RECUPERATION_MANA_R2 };
@@ -1035,7 +1127,7 @@ class spell_hun_rapid_recuperation_trigger : public SpellScriptLoader
uint8 rank = GetSpellInfo()->GetRank();
uint32 spellId = triggerSpells[rank - 1];
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1368,7 +1460,7 @@ class spell_hun_thrill_of_the_hunt : public SpellScriptLoader
if (!amount)
return;
- caster->CastCustomSpell(SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_HUNTER_THRILL_OF_THE_HUNT_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1449,7 +1541,7 @@ class spell_hun_viper_attack_speed : public SpellScriptLoader
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
if (GetTarget()->HasAura(SPELL_HUNTER_ASPECT_OF_THE_VIPER))
- GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_VICIOUS_VIPER, true, NULL, aurEff);
+ GetTarget()->CastSpell(GetTarget(), SPELL_HUNTER_VICIOUS_VIPER, true, nullptr, aurEff);
}
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
@@ -1476,6 +1568,8 @@ void AddSC_hunter_spell_scripts()
new spell_hun_aspect_of_the_beast();
new spell_hun_ascpect_of_the_viper();
new spell_hun_chimera_shot();
+ new spell_hun_cobra_strikes();
+ new spell_hun_cobra_strikes_triggered();
new spell_hun_disengage();
new spell_hun_glyph_of_arcane_shot();
new spell_hun_glyph_of_mend_pet();
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp
index b45df66e0ac..9ef5c5d0b4d 100644
--- a/src/server/scripts/Spells/spell_item.cpp
+++ b/src/server/scripts/Spells/spell_item.cpp
@@ -148,7 +148,7 @@ class spell_item_alchemists_stone : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
@@ -172,7 +172,7 @@ class spell_item_alchemists_stone : public SpellScriptLoader
}
int32 amount = CalculatePct(spellInfo->Effects[i].CalcValue(caster), 40);
- caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
}
@@ -220,7 +220,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
@@ -237,7 +237,7 @@ class spell_item_anger_capacitor : public SpellScriptLoader
if (player->GetWeaponForAttack(OFF_ATTACK, true) && urand(0, 1))
spellId = SPELL_MANIFEST_ANGER_OFF_HAND;
- caster->CastSpell(target, spellId, true);
+ caster->CastSpell(target, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -358,7 +358,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static std::vector<uint32> const triggeredSpells[MAX_CLASSES] =
{
@@ -391,7 +391,7 @@ class spell_item_aura_of_madness : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]);
- caster->CastSpell(caster, spellId, true);
+ caster->CastSpell(caster, spellId, true, nullptr, aurEff);
if (roll_chance_i(10))
caster->Unit::Say(SAY_MADNESS);
@@ -427,10 +427,10 @@ class spell_item_dementia : public SpellScriptLoader
return true;
}
- void HandlePeriodicDummy(AuraEffect const* /*aurEff*/)
+ void HandlePeriodicDummy(AuraEffect const* aurEff)
{
PreventDefaultAction();
- GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true);
+ GetTarget()->CastSpell(GetTarget(), RAND(SPELL_DEMENTIA_POS, SPELL_DEMENTIA_NEG), true, nullptr, aurEff);
}
void Register() override
@@ -490,7 +490,7 @@ class spell_item_blessing_of_ancient_kings : public SpellScriptLoader
protEff->GetBase()->RefreshDuration();
}
else
- GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff);
+ GetTarget()->CastCustomSpell(SPELL_PROTECTION_OF_ANCIENT_KINGS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, nullptr, aurEff);
}
void Register() override
@@ -616,7 +616,7 @@ class spell_item_deathbringers_will : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static std::vector<uint32> const triggeredSpells[MAX_CLASSES] =
{
@@ -648,12 +648,12 @@ class spell_item_deathbringers_will : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- auto const& randomSpells = triggeredSpells[caster->getClass()];
+ std::vector<uint32> const& randomSpells = triggeredSpells[caster->getClass()];
if (randomSpells.empty())
return;
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(randomSpells);
- caster->CastSpell(caster, spellId, true);
+ caster->CastSpell(caster, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1083,7 +1083,7 @@ class spell_item_frozen_shadoweave : public SpellScriptLoader
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
Unit* caster = eventInfo.GetActor();
- caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_SHADOWMEND, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1128,9 +1128,9 @@ class spell_item_gnomish_death_ray : public SpellScriptLoader
if (Unit* target = GetHitUnit())
{
if (urand(0, 99) < 15)
- caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true, NULL); // failure
+ caster->CastSpell(caster, SPELL_GNOMISH_DEATH_RAY_SELF, true); // failure
else
- caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true, NULL);
+ caster->CastSpell(target, SPELL_GNOMISH_DEATH_RAY_TARGET, true);
}
}
@@ -1169,10 +1169,10 @@ class spell_item_healing_touch_refund : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_HEALING_TOUCH_MANA, true, nullptr, aurEff);
}
void Register() override
@@ -1226,7 +1226,7 @@ class spell_item_heartpierce : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
@@ -1243,6 +1243,7 @@ class spell_item_heartpierce : public SpellScriptLoader
case POWER_RAGE:
spellId = Rage;
break;
+ // Death Knights can't use daggers, but oh well
case POWER_RUNIC_POWER:
spellId = RunicPower;
break;
@@ -1250,7 +1251,7 @@ class spell_item_heartpierce : public SpellScriptLoader
return;
}
- caster->CastSpell((Unit*)nullptr, spellId, true);
+ caster->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1380,14 +1381,14 @@ class spell_item_mark_of_conquest : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
if (eventInfo.GetTypeMask() & (PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS))
{
// in that case, do not cast heal spell
PreventDefaultAction();
// but mana instead
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MARK_OF_CONQUEST_ENERGIZE, true, nullptr, aurEff);
}
}
@@ -1546,7 +1547,7 @@ class spell_item_net_o_matic : public SpellScriptLoader
else if (roll < 4) // 2% for 20 sec root, charge to target (off-like chance unknown)
spellId = SPELL_NET_O_MATIC_TRIGGERED2;
- GetCaster()->CastSpell(target, spellId, true, NULL);
+ GetCaster()->CastSpell(target, spellId, true, nullptr);
}
}
@@ -1602,7 +1603,7 @@ class spell_item_noggenfogger_elixir : public SpellScriptLoader
case 2: spellId = SPELL_NOGGENFOGGER_ELIXIR_TRIGGERED2; break;
}
- caster->CastSpell(caster, spellId, true, NULL);
+ caster->CastSpell(caster, spellId, true, nullptr);
}
void Register() override
@@ -1734,7 +1735,7 @@ class spell_item_pet_healing : public SpellScriptLoader
int32 bp = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
Unit* caster = eventInfo.GetActor();
- caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_HEALTH_LINK, SPELLVALUE_BASE_POINT0, bp, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -2206,7 +2207,7 @@ class spell_item_swift_hand_justice_dummy : public SpellScriptLoader
Unit* caster = eventInfo.GetActor();
int32 amount = caster->CountPctFromMaxHealth(aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_SWIFT_HAND_OF_JUSTICE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -2244,10 +2245,10 @@ class spell_item_totem_of_flowing_water : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_LESSER_HEALING_WAVE_MANA, true, nullptr, aurEff);
}
void Register() override
@@ -3741,17 +3742,17 @@ class spell_item_shard_of_the_scale : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_POS)
- caster->CastSpell(target, HealProc, true);
+ caster->CastSpell(target, HealProc, true, nullptr, aurEff);
if (eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MAGIC_DMG_CLASS_NEG)
- caster->CastSpell(target, DamageProc, true);
+ caster->CastSpell(target, DamageProc, true, nullptr, aurEff);
}
void Register() override
@@ -3887,7 +3888,7 @@ class spell_item_sunwell_neck : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Player* player = eventInfo.GetActor()->ToPlayer();
@@ -3895,10 +3896,10 @@ class spell_item_sunwell_neck : public SpellScriptLoader
// Aggression checks are in the spell system... just cast and forget
if (player->GetReputationRank(FACTION_ALDOR) == REP_EXALTED)
- player->CastSpell(target, Aldors, true);
+ player->CastSpell(target, Aldors, true, nullptr, aurEff);
if (player->GetReputationRank(FACTION_SCRYERS) == REP_EXALTED)
- player->CastSpell(target, Scryers, true);
+ player->CastSpell(target, Scryers, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp
index 8c37b3ac506..5c496024599 100644
--- a/src/server/scripts/Spells/spell_mage.cpp
+++ b/src/server/scripts/Spells/spell_mage.cpp
@@ -114,14 +114,14 @@ class spell_mage_arcane_potency : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static uint32 const triggerSpell[2] = { SPELL_MAGE_ARCANE_POTENCY_RANK_1, SPELL_MAGE_ARCANE_POTENCY_RANK_2 };
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
uint32 spellId = triggerSpell[GetSpellInfo()->GetRank() - 1];
- caster->CastSpell(caster, spellId, true);
+ caster->CastSpell(caster, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -383,11 +383,11 @@ class spell_mage_imp_blizzard : public SpellScriptLoader
return true;
}
- void HandleChill(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleChill(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 triggerSpellId = sSpellMgr->GetSpellWithRank(SPELL_MAGE_CHILLED, GetSpellInfo()->GetRank());
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), triggerSpellId, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), triggerSpellId, true, nullptr, aurEff);
}
void Register() override
@@ -420,10 +420,10 @@ class spell_mage_imp_mana_gems : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MAGE_MANA_SURGE, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_MAGE_MANA_SURGE, true, nullptr, aurEff);
}
void Register() override
@@ -836,7 +836,7 @@ class spell_mage_hot_streak : public SpellScriptLoader
return;
Unit* caster = eventInfo.GetActor();
- caster->CastSpell(caster, SPELL_MAGE_HOT_STREAK_PROC, true);
+ caster->CastSpell(caster, SPELL_MAGE_HOT_STREAK_PROC, true, nullptr, aurEff);
}
// reset counter
@@ -1032,7 +1032,7 @@ class spell_mage_magic_absorption : public SpellScriptLoader
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget();
int32 bp = CalculatePct(static_cast<int32>(caster->GetMaxPower(POWER_MANA)), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_MAGE_MAGIC_ABSORPTION_MANA, SPELLVALUE_BASE_POINT0, bp, caster, true);
+ caster->CastCustomSpell(SPELL_MAGE_MAGIC_ABSORPTION_MANA, SPELLVALUE_BASE_POINT0, bp, caster, true, nullptr, aurEff);
}
void Register() override
@@ -1080,10 +1080,10 @@ class spell_mage_mana_shield : public SpellScriptLoader
}
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
Unit* caster = eventInfo.GetActionTarget();
- caster->CastSpell(caster, SPELL_MAGE_ARCANE_SURGE, true);
+ caster->CastSpell(caster, SPELL_MAGE_ARCANE_SURGE, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_paladin.cpp b/src/server/scripts/Spells/spell_paladin.cpp
index 20665034298..693990edd0a 100644
--- a/src/server/scripts/Spells/spell_paladin.cpp
+++ b/src/server/scripts/Spells/spell_paladin.cpp
@@ -156,9 +156,16 @@ class spell_pal_ardent_defender : public SpellScriptLoader
enum Spell
{
- PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235,
+ PAL_SPELL_ARDENT_DEFENDER_HEAL = 66235
};
+ bool Validate(SpellInfo const* /*spellInfo*/) override
+ {
+ if (!sSpellMgr->GetSpellInfo(PAL_SPELL_ARDENT_DEFENDER_HEAL))
+ return false;
+ return true;
+ }
+
bool Load() override
{
healPct = GetSpellInfo()->Effects[EFFECT_1].CalcValue();
@@ -192,7 +199,7 @@ class spell_pal_ardent_defender : public SpellScriptLoader
: float(defenseSkillValue) / float(reqDefForMaxHeal);
int32 healAmount = int32(victim->CountPctFromMaxHealth(uint32(healPct * pctFromDefense)));
- victim->CastCustomSpell(victim, PAL_SPELL_ARDENT_DEFENDER_HEAL, &healAmount, NULL, NULL, true, NULL, aurEff);
+ victim->CastCustomSpell(PAL_SPELL_ARDENT_DEFENDER_HEAL, SPELLVALUE_BASE_POINT0, healAmount, victim, true, nullptr, aurEff);
victim->GetSpellHistory()->AddCooldown(PAL_SPELL_ARDENT_DEFENDER_HEAL, 0, std::chrono::minutes(2));
}
else if (remainingHealth < int32(allowedHealth))
@@ -824,7 +831,7 @@ class spell_pal_glyph_of_holy_light_dummy : public SpellScriptLoader
Unit* target = eventInfo.GetProcTarget();
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_PALADIN_GLYPH_OF_HOLY_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_PALADIN_GLYPH_OF_HOLY_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -976,12 +983,12 @@ class spell_pal_heart_of_the_crusader : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_PALADIN_HEART_OF_THE_CRUSADER_EFF_R1, GetSpellInfo()->GetRank());
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1385,7 +1392,7 @@ class spell_pal_item_t6_trinket : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
@@ -1411,7 +1418,7 @@ class spell_pal_item_t6_trinket : public SpellScriptLoader
return;
if (roll_chance_i(chance))
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1542,7 +1549,7 @@ class spell_pal_judgement_of_light_heal : public SpellScriptLoader
Unit* caster = eventInfo.GetProcTarget();
int32 amount = static_cast<int32>(caster->CountPctFromMaxHealth(aurEff->GetAmount()));
- caster->CastCustomSpell(SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_PALADIN_JUDGEMENT_OF_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff, GetCasterGUID());
}
void Register() override
@@ -1586,7 +1593,7 @@ class spell_pal_judgement_of_wisdom_mana : public SpellScriptLoader
Unit* caster = eventInfo.GetProcTarget();
int32 amount = CalculatePct(static_cast<int32>(caster->GetCreateMana()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_PALADIN_JUDGEMENT_OF_WISDOM_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff, GetCasterGUID());
}
void Register() override
@@ -1655,13 +1662,13 @@ class spell_pal_judgements_of_the_wise : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastSpell((Unit*)nullptr, SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA, true);
- caster->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
+ caster->CastSpell((Unit*)nullptr, SPELL_PALADIN_JUDGEMENTS_OF_THE_WISE_MANA, true, nullptr, aurEff);
+ caster->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true, nullptr, aurEff);
}
void Register() override
@@ -1782,7 +1789,7 @@ class spell_pal_light_s_beacon : public SpellScriptLoader
/// @todo: caster must be the healed unit to perform distance checks correctly
/// but that will break animation on clientside
/// caster in spell packets must be the healing unit
- eventInfo.GetActor()->CastCustomSpell(healSpellId, SPELLVALUE_BASE_POINT0, heal, beaconTarget, true);
+ eventInfo.GetActor()->CastCustomSpell(healSpellId, SPELLVALUE_BASE_POINT0, heal, beaconTarget, true, nullptr, aurEff);
}
void Register() override
@@ -1896,7 +1903,7 @@ class spell_pal_righteous_vengeance : public SpellScriptLoader
// Add remaining ticks to damage done
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PALADIN_RIGHTEOUS_VENGEANCE_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE);
- caster->CastCustomSpell(SPELL_PALADIN_RIGHTEOUS_VENGEANCE_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_PALADIN_RIGHTEOUS_VENGEANCE_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -1990,7 +1997,7 @@ class spell_pal_sacred_shield_dummy : public SpellScriptLoader
cooldown = Seconds(bonus->GetAmount());
_cooldownEnd = now + cooldown;
- caster->CastSpell(eventInfo.GetActionTarget(), SPELL_PALADIN_SACRED_SHIELD_TRIGGER, true);
+ caster->CastSpell(eventInfo.GetActionTarget(), SPELL_PALADIN_SACRED_SHIELD_TRIGGER, true, nullptr, aurEff);
}
void Register() override
@@ -2092,7 +2099,7 @@ class spell_pal_seal_of_vengeance : public SpellScriptLoader
5 33% 38%
*/
- void HandleApplyDoT(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleApplyDoT(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -2100,22 +2107,23 @@ class spell_pal_seal_of_vengeance : public SpellScriptLoader
return;
// don't cast triggered, spell already has SPELL_ATTR4_CAN_CAST_WHILE_CASTING attr
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), DoTSpell, false);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), DoTSpell, TRIGGERED_DONT_RESET_PERIODIC_TIMER, nullptr, aurEff);
}
- void HandleSeal(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleSeal(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
- AuraEffect const* aurEff = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, 0x00000000, 0x00000800, 0x00000000, caster->GetGUID());
- if (!aurEff)
+ // get current aura on target, if any
+ AuraEffect const* sealDot = target->GetAuraEffect(SPELL_AURA_PERIODIC_DAMAGE, SPELLFAMILY_PALADIN, 0x00000000, 0x00000800, 0x00000000, caster->GetGUID());
+ if (!sealDot)
return;
- uint8 stacks = aurEff->GetBase()->GetStackAmount();
- uint8 maxStacks = aurEff->GetSpellInfo()->StackAmount;
+ uint8 const stacks = sealDot->GetBase()->GetStackAmount();
+ uint8 const maxStacks = sealDot->GetSpellInfo()->StackAmount;
if (stacks < maxStacks && !(eventInfo.GetTypeMask() & PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS))
return;
@@ -2125,7 +2133,7 @@ class spell_pal_seal_of_vengeance : public SpellScriptLoader
amount *= stacks;
amount /= maxStacks;
- caster->CastCustomSpell(DamageSpell, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(DamageSpell, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2209,7 +2217,7 @@ class spell_pal_spiritual_attunement : public SpellScriptLoader
HealInfo* healInfo = eventInfo.GetHealInfo();
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetEffectiveHeal()), aurEff->GetAmount());
- eventInfo.GetActionTarget()->CastCustomSpell(SPELL_PALADIN_SPIRITUAL_ATTUNEMENT_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ eventInfo.GetActionTarget()->CastCustomSpell(SPELL_PALADIN_SPIRITUAL_ATTUNEMENT_MANA, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -2256,10 +2264,10 @@ class spell_pal_sheath_of_light : public SpellScriptLoader
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL);
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
amount /= spellInfo->GetMaxTicks();
- // Add remaining ticks to damage done
+ // Add remaining ticks to healing done
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL, SPELL_AURA_PERIODIC_HEAL);
- caster->CastCustomSpell(SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_PALADIN_SHEATH_OF_LIGHT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2294,7 +2302,7 @@ class spell_pal_t3_6p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -2325,7 +2333,7 @@ class spell_pal_t3_6p_bonus : public SpellScriptLoader
return;
}
- caster->CastSpell(target, spellId, true);
+ caster->CastSpell(target, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -2371,10 +2379,10 @@ class spell_pal_t8_2p_bonus : public SpellScriptLoader
SpellInfo const* spellInfo = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_HOLY_MENDING);
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
amount /= spellInfo->GetMaxTicks();
- // Add remaining ticks to damage done
+ // Add remaining ticks to healing done
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PALADIN_HOLY_MENDING, SPELL_AURA_PERIODIC_HEAL);
- caster->CastCustomSpell(SPELL_PALADIN_HOLY_MENDING, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_PALADIN_HOLY_MENDING, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_priest.cpp b/src/server/scripts/Spells/spell_priest.cpp
index 16bf769a9ae..8a4bdeedccc 100644
--- a/src/server/scripts/Spells/spell_priest.cpp
+++ b/src/server/scripts/Spells/spell_priest.cpp
@@ -120,7 +120,7 @@ class spell_pri_aq_3p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
@@ -132,7 +132,7 @@ class spell_pri_aq_3p_bonus : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), 10);
- caster->CastCustomSpell(SPELL_PRIEST_ORACULAR_HEAL, SPELLVALUE_BASE_POINT0, amount, caster, true);
+ caster->CastCustomSpell(SPELL_PRIEST_ORACULAR_HEAL, SPELLVALUE_BASE_POINT0, amount, caster, true, nullptr, aurEff);
}
void Register() override
@@ -236,7 +236,7 @@ class spell_pri_body_and_soul : public SpellScriptLoader
return;
if (roll_chance_i(aurEff->GetAmount()))
- caster->CastSpell(caster, SPELL_PRIEST_BODY_AND_SOUL_POISON_TRIGGER, true);
+ caster->CastSpell(caster, SPELL_PRIEST_BODY_AND_SOUL_POISON_TRIGGER, true, nullptr, aurEff);
}
void Register() override
@@ -412,7 +412,7 @@ class spell_pri_glyph_of_dispel_magic : public SpellScriptLoader
Unit* target = eventInfo.GetProcTarget();
int32 amount = static_cast<int32>(target->CountPctFromMaxHealth(aurEff->GetAmount()));
- caster->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_DISPEL_MAGIC_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -660,15 +660,15 @@ class spell_pri_item_t6_trinket : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_HEAL)
- caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_BLESSING, true);
+ caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_BLESSING, true, nullptr, aurEff);
if (eventInfo.GetSpellTypeMask() & PROC_SPELL_TYPE_DAMAGE)
- caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_WRATH, true);
+ caster->CastSpell((Unit*)nullptr, SPELL_PRIEST_DIVINE_WRATH, true, nullptr, aurEff);
}
void Register() override
@@ -1091,17 +1091,22 @@ class spell_pri_renew : public SpellScriptLoader
void HandleApplyEffect(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
{
- if (Unit* caster = GetCaster())
+ Unit* caster = GetCaster();
+ if (!caster)
+ return;
+
+ // Empowered Renew
+ if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1))
{
- // Empowered Renew
- if (AuraEffect const* empoweredRenewAurEff = caster->GetDummyAuraEffect(SPELLFAMILY_PRIEST, PRIEST_ICON_ID_EMPOWERED_RENEW_TALENT, EFFECT_1))
- {
- uint32 heal = caster->SpellHealingBonusDone(GetTarget(), GetSpellInfo(), GetEffect(EFFECT_0)->GetAmount(), DOT);
- heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
+ int32 heal = (aurEff->GetAmount() + aurEff->GetBonusAmount()) * aurEff->GetDonePct();
+ if (Player* modOwner = caster->GetSpellModOwner())
+ modOwner->ApplySpellMod<SPELLMOD_DOT>(GetId(), heal);
+ heal = GetTarget()->SpellHealingBonusTaken(caster, GetSpellInfo(), heal, DOT);
- int32 basepoints0 = empoweredRenewAurEff->GetAmount() * GetEffect(EFFECT_0)->GetTotalTicks() * int32(heal) / 100;
- caster->CastCustomSpell(GetTarget(), SPELL_PRIEST_EMPOWERED_RENEW, &basepoints0, NULL, NULL, true, NULL, aurEff);
- }
+ heal *= GetSpellInfo()->GetMaxTicks();
+
+ int32 basepoints0 = CalculatePct(heal, empoweredRenewAurEff->GetAmount());
+ caster->CastCustomSpell(SPELL_PRIEST_EMPOWERED_RENEW, SPELLVALUE_BASE_POINT0, basepoints0, GetTarget(), true, nullptr, aurEff);
}
}
@@ -1147,11 +1152,11 @@ class spell_pri_shadowfiend_death : public SpellScriptLoader
return shadowfiend->HealthBelowPctDamaged(1, damageInfo->GetDamage());
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget()->GetOwner();
- caster->CastSpell(caster, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true);
+ caster->CastSpell(caster, SPELL_PRIEST_GLYPH_OF_SHADOWFIEND_MANA, true, nullptr, aurEff);
}
void Register() override
@@ -1227,7 +1232,7 @@ class spell_pri_vampiric_embrace : public SpellScriptLoader
int32 selfHeal = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
int32 partyHeal = selfHeal / 5;
Unit* caster = eventInfo.GetActor();
- caster->CastCustomSpell((Unit*)nullptr, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &partyHeal, &selfHeal, nullptr, true);
+ caster->CastCustomSpell((Unit*)nullptr, SPELL_PRIEST_VAMPIRIC_EMBRACE_HEAL, &partyHeal, &selfHeal, nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -1275,16 +1280,16 @@ class spell_pri_vampiric_touch : public SpellScriptLoader
{
int32 damage = aurEff->GetAmount() * 8;
// backfire damage
- caster->CastCustomSpell(target, SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, &damage, NULL, NULL, true, NULL, aurEff);
+ caster->CastCustomSpell(SPELL_PRIEST_VAMPIRIC_TOUCH_DISPEL, SPELLVALUE_BASE_POINT0, damage, target, true, nullptr, aurEff);
}
}
}
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true, nullptr, aurEff);
}
void Register() override
@@ -1319,10 +1324,10 @@ class spell_pri_t3_4p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_ARMOR_OF_FAITH, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_PRIEST_ARMOR_OF_FAITH, true, nullptr, aurEff);
}
void Register() override
@@ -1418,7 +1423,7 @@ class spell_pri_t10_heal_2p_bonus : public SpellScriptLoader
Unit* target = eventInfo.GetProcTarget();
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_PRIEST_BLESSED_HEALING, SPELL_AURA_PERIODIC_HEAL);
- caster->CastCustomSpell(SPELL_PRIEST_BLESSED_HEALING, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_PRIEST_BLESSED_HEALING, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp
index 47c9fa56eae..f3d30af1f84 100644
--- a/src/server/scripts/Spells/spell_rogue.cpp
+++ b/src/server/scripts/Spells/spell_rogue.cpp
@@ -232,10 +232,10 @@ class spell_rog_deadly_brew : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_CRIPPLING_POISON, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_CRIPPLING_POISON, true, nullptr, aurEff);
}
void Register() override
@@ -625,7 +625,7 @@ class spell_rog_quick_recovery : public SpellScriptLoader
Unit* caster = eventInfo.GetActor();
int32 amount = CalculatePct(spellInfo->CalcPowerCost(caster, spellInfo->GetSchoolMask()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_ROGUE_QUICK_RECOVERY_ENERGY, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_ROGUE_QUICK_RECOVERY_ENERGY, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -721,10 +721,10 @@ class spell_rog_glyph_of_backstab : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), SPELL_ROGUE_GLYPH_OF_BACKSTAB_TRIGGER, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_shaman.cpp b/src/server/scripts/Spells/spell_shaman.cpp
index 397427b505f..37b08aee7ca 100644
--- a/src/server/scripts/Spells/spell_shaman.cpp
+++ b/src/server/scripts/Spells/spell_shaman.cpp
@@ -119,7 +119,7 @@ class spell_sha_ancestral_awakening : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
- eventInfo.GetActor()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING_DUMMY, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ eventInfo.GetActor()->CastCustomSpell(SPELL_SHAMAN_ANCESTRAL_AWAKENING_DUMMY, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -423,7 +423,7 @@ class spell_sha_earth_shield : public SpellScriptLoader
{
PreventDefaultAction();
- GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, NULL, aurEff, GetCasterGUID());
+ GetTarget()->CastCustomSpell(SPELL_SHAMAN_EARTH_SHIELD_HEAL, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetTarget(), true, nullptr, aurEff, GetCasterGUID());
}
void Register() override
@@ -732,25 +732,25 @@ class spell_sha_flametongue_weapon : public SpellScriptLoader
Item* item = ASSERT_NOTNULL(player->GetWeaponForAttack(attType));
- float basePoints(GetSpellInfo()->Effects[aurEff->GetEffIndex()].CalcValue());
+ float const basePoints = GetSpellInfo()->Effects[aurEff->GetEffIndex()].CalcValue();
// Flametongue max damage is normalized based on a 4.0 speed weapon
// Tooltip says max damage = BasePoints / 25, so BasePoints / 25 / 4 to get base damage per 1.0s AS
float fireDamage = basePoints / 100.0f;
- float attackSpeed = player->GetAttackTime(attType) / 1000.f;
+ float const attackSpeed = player->GetAttackTime(attType) / 1000.f;
fireDamage *= attackSpeed;
// clip value between (BasePoints / 77) and (BasePoints / 25) as the tooltip indicates
RoundToInterval(fireDamage, basePoints / 77.0f, basePoints / 25.0f);
// Calculate Spell Power scaling
- float spellPowerBonus(player->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) + target->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_FIRE));
+ float spellPowerBonus = player->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_FIRE) + target->SpellBaseDamageBonusTaken(SPELL_SCHOOL_MASK_FIRE);
float const spCoeff = 0.03811f;
spellPowerBonus *= spCoeff * attackSpeed;
// All done, now proc damage
int32 amount = static_cast<int32>(fireDamage + spellPowerBonus);
- player->CastCustomSpell(SPELL_SHAMAN_FLAMETONGUE_ATTACK, SPELLVALUE_BASE_POINT0, amount, target, true, item);
+ player->CastCustomSpell(SPELL_SHAMAN_FLAMETONGUE_ATTACK, SPELLVALUE_BASE_POINT0, amount, target, true, item, aurEff);
}
void Register() override
@@ -798,7 +798,7 @@ class spell_sha_frozen_power : public SpellScriptLoader
if (caster->GetDistance(target) < minDistance)
return;
- caster->CastSpell(target, SPELL_SHAMAN_FREEZE, true);
+ caster->CastSpell(target, SPELL_SHAMAN_FREEZE, true, nullptr, aurEff);
}
void Register() override
@@ -881,7 +881,7 @@ class spell_sha_glyph_of_healing_wave : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(healInfo->GetHeal()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true);
+ caster->CastCustomSpell(SPELL_SHAMAN_GLYPH_OF_HEALING_WAVE_HEAL, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -941,7 +941,7 @@ class spell_sha_glyph_of_totem_of_wrath : public SpellScriptLoader
int32 bp0 = CalculatePct(totemSpell->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount());
int32 bp1 = CalculatePct(totemSpell->Effects[EFFECT_1].CalcValue(caster), aurEff->GetAmount());
- caster->CastCustomSpell((Unit*)nullptr, SPELL_SHAMAN_TOTEM_OF_WRATH_SPELL_POWER, &bp0, &bp1, nullptr, true);
+ caster->CastCustomSpell((Unit*)nullptr, SPELL_SHAMAN_TOTEM_OF_WRATH_SPELL_POWER, &bp0, &bp1, nullptr, true, nullptr, aurEff);
}
void Register() override
@@ -997,7 +997,8 @@ class spell_sha_healing_stream_totem : public SpellScriptLoader
damage = int32(target->SpellHealingBonusTaken(owner, triggeringSpell, damage, HEAL));
}
- caster->CastCustomSpell(target, SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, &damage, 0, 0, true, 0, 0, GetOriginalCaster()->GetGUID());
+
+ caster->CastCustomSpell(SPELL_SHAMAN_TOTEM_HEALING_STREAM_HEAL, SPELLVALUE_BASE_POINT0, damage, target, true, nullptr, nullptr, GetOriginalCaster()->GetGUID());
}
}
}
@@ -1044,9 +1045,8 @@ class spell_sha_heroism : public SpellScriptLoader
void Register() override
{
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_0, TARGET_UNIT_CASTER_AREA_RAID);
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_1, TARGET_UNIT_CASTER_AREA_RAID);
- OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_2, TARGET_UNIT_CASTER_AREA_RAID);
+ OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_sha_heroism_SpellScript::RemoveInvalidTargets, EFFECT_ALL, TARGET_UNIT_CASTER_AREA_RAID);
+
AfterHit += SpellHitFn(spell_sha_heroism_SpellScript::ApplyDebuff);
}
};
@@ -1091,17 +1091,17 @@ class spell_sha_imp_water_shield : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
// Get Water Shield
- AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x00000000, 0x00000020, 0x00000000, caster->GetGUID());
- if (!aurEff)
+ AuraEffect const* waterShield = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x00000000, 0x00000020, 0x00000000, caster->GetGUID());
+ if (!waterShield)
return;
- uint32 spellId = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
- caster->CastSpell((Unit*)nullptr, spellId, true);
+ uint32 spellId = waterShield->GetSpellInfo()->Effects[waterShield->GetEffIndex()].TriggerSpell;
+ caster->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1135,7 +1135,7 @@ class spell_sha_lightning_overload : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -1161,7 +1161,7 @@ class spell_sha_lightning_overload : public SpellScriptLoader
spellId = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_CHAIN_LIGHTNING_OVERLOAD_R1, spellInfo->GetRank());
}
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true);
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1196,7 +1196,7 @@ class spell_sha_item_lightning_shield : public SpellScriptLoader
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
- GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD, true, NULL, aurEff);
+ GetTarget()->CastSpell(eventInfo.GetProcTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD, true, nullptr, aurEff);
}
void Register() override
@@ -1231,7 +1231,7 @@ class spell_sha_item_lightning_shield_trigger : public SpellScriptLoader
void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/)
{
PreventDefaultAction();
- GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE, true, NULL, aurEff);
+ GetTarget()->CastSpell(GetTarget(), SPELL_SHAMAN_ITEM_LIGHTNING_SHIELD_DAMAGE, true, nullptr, aurEff);
}
void Register() override
@@ -1306,7 +1306,7 @@ class spell_sha_item_t6_trinket : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
SpellInfo const* spellInfo = eventInfo.GetSpellInfo();
@@ -1338,7 +1338,7 @@ class spell_sha_item_t6_trinket : public SpellScriptLoader
return;
if (roll_chance_i(chance))
- eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true);
+ eventInfo.GetActor()->CastSpell((Unit*)nullptr, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1507,7 +1507,7 @@ class spell_sha_maelstrom_weapon : public SpellScriptLoader
if (!aurEff || !roll_chance_i(aurEff->GetAmount()))
return;
- caster->CastSpell((Unit*)nullptr, SPELL_SHAMAN_MAELSTROM_POWER, true);
+ caster->CastSpell((Unit*)nullptr, SPELL_SHAMAN_MAELSTROM_POWER, true, nullptr, aurEff);
}
void Register() override
@@ -1593,7 +1593,7 @@ class spell_sha_mana_tide_totem : public SpellScriptLoader
effValue += dummy->GetAmount();
// Regenerate 6% of Total Mana Every 3 secs
int32 effBasePoints0 = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), effValue));
- caster->CastCustomSpell(unitTarget, SPELL_SHAMAN_MANA_TIDE_TOTEM, &effBasePoints0, NULL, NULL, true, NULL, NULL, GetOriginalCaster()->GetGUID());
+ caster->CastCustomSpell(SPELL_SHAMAN_MANA_TIDE_TOTEM, SPELLVALUE_BASE_POINT0, effBasePoints0, unitTarget, true, nullptr, nullptr, GetOriginalCaster()->GetGUID());
}
}
}
@@ -1777,8 +1777,8 @@ class spell_sha_spirit_hunt : public SpellScriptLoader
return;
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
- caster->CastCustomSpell(SPELL_SHAMAN_SPIRIT_HUNT_HEAL, SPELLVALUE_BASE_POINT0, amount, caster, true);
- caster->CastCustomSpell(SPELL_SHAMAN_SPIRIT_HUNT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_SHAMAN_SPIRIT_HUNT_HEAL, SPELLVALUE_BASE_POINT0, amount, caster, true, nullptr, aurEff);
+ caster->CastCustomSpell(SPELL_SHAMAN_SPIRIT_HUNT_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -1810,20 +1810,20 @@ class spell_sha_static_shock : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
// Get Lightning Shield
- AuraEffect const* aurEff = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x00000400, 0x00000000, 0x00000000, caster->GetGUID());
- if (!aurEff)
+ AuraEffect const* lightningShield = caster->GetAuraEffect(SPELL_AURA_PROC_TRIGGER_SPELL, SPELLFAMILY_SHAMAN, 0x00000400, 0x00000000, 0x00000000, caster->GetGUID());
+ if (!lightningShield)
return;
- uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_LIGHTNING_SHIELD_DAMAGE_R1, aurEff->GetSpellInfo()->GetRank());
- eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true);
- aurEff->GetBase()->DropCharge();
+ uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_SHAMAN_LIGHTNING_SHIELD_DAMAGE_R1, lightningShield->GetSpellInfo()->GetRank());
+ eventInfo.GetActor()->CastSpell(eventInfo.GetProcTarget(), spellId, true, nullptr, aurEff);
+ lightningShield->GetBase()->DropCharge();
}
void Register() override
@@ -1919,14 +1919,14 @@ public:
return true;
}
- void HandleDummy(AuraEffect const* /*aurEff*/)
+ void HandleDummy(AuraEffect const* aurEff)
{
Unit* target = GetTarget();
for (uint8 i = SUMMON_SLOT_TOTEM; i < MAX_TOTEM_SLOT; ++i)
if (!target->m_SummonSlot[i])
return;
- target->CastSpell(target, SPELL_SHAMAN_TOTEMIC_MASTERY, true);
+ target->CastSpell(target, SPELL_SHAMAN_TOTEMIC_MASTERY, true, nullptr, aurEff);
PreventDefaultAction();
}
@@ -1962,7 +1962,7 @@ class spell_sha_t3_6p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -1993,7 +1993,7 @@ class spell_sha_t3_6p_bonus : public SpellScriptLoader
return;
}
- caster->CastSpell(target, spellId, true);
+ caster->CastSpell(target, spellId, true, nullptr, aurEff);
}
void Register() override
@@ -2037,12 +2037,12 @@ class spell_sha_t8_elemental_4p_bonus : public SpellScriptLoader
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
amount /= spellInfo->GetMaxTicks();
- // Add remaining ticks to healing done
+ // Add remaining ticks to damage done
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_ELECTRIFIED, SPELL_AURA_PERIODIC_DAMAGE);
- caster->CastCustomSpell(SPELL_SHAMAN_ELECTRIFIED, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_SHAMAN_ELECTRIFIED, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2086,12 +2086,12 @@ class spell_sha_t9_elemental_4p_bonus : public SpellScriptLoader
int32 amount = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount());
amount /= spellInfo->GetMaxTicks();
- // Add remaining ticks to healing done
+ // Add remaining ticks to damage done
Unit* caster = eventInfo.GetActor();
Unit* target = eventInfo.GetProcTarget();
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, SPELL_AURA_PERIODIC_DAMAGE);
- caster->CastCustomSpell(SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_SHAMAN_LAVA_BURST_BONUS_DAMAGE, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2185,7 +2185,7 @@ class spell_sha_t10_restoration_4p_bonus : public SpellScriptLoader
Unit* target = eventInfo.GetProcTarget();
amount += target->GetRemainingPeriodicAmount(caster->GetGUID(), SPELL_SHAMAN_CHAINED_HEAL, SPELL_AURA_PERIODIC_HEAL);
- caster->CastCustomSpell(SPELL_SHAMAN_CHAINED_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true);
+ caster->CastCustomSpell(SPELL_SHAMAN_CHAINED_HEAL, SPELLVALUE_BASE_POINT0, amount, target, true, nullptr, aurEff);
}
void Register() override
@@ -2221,7 +2221,6 @@ class spell_sha_windfury_weapon : public SpellScriptLoader
bool CheckProc(ProcEventInfo& eventInfo)
{
-
Player* player = eventInfo.GetActor()->ToPlayer();
if (!player)
return false;
@@ -2241,7 +2240,7 @@ class spell_sha_windfury_weapon : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
@@ -2281,7 +2280,7 @@ class spell_sha_windfury_weapon : public SpellScriptLoader
// Attack twice
for (uint8 i = 0; i < 2; ++i)
- player->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, item);
+ player->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, item, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp
index cccebab6259..1a8252ad7ec 100644
--- a/src/server/scripts/Spells/spell_warlock.cpp
+++ b/src/server/scripts/Spells/spell_warlock.cpp
@@ -596,11 +596,11 @@ class spell_warl_glyph_of_corruption_nightfall : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastSpell(caster, SPELL_WARLOCK_SHADOW_TRANCE, true);
+ caster->CastSpell(caster, SPELL_WARLOCK_SHADOW_TRANCE, true, nullptr, aurEff);
}
void Register() override
@@ -632,11 +632,11 @@ public:
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastSpell(caster, SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED, true);
+ caster->CastSpell(caster, SPELL_WARLOCK_GLYPH_OF_LIFE_TAP_TRIGGERED, true, nullptr, aurEff);
}
void Register() override
@@ -1135,7 +1135,7 @@ class spell_warl_seed_of_corruption_dummy : public SpellScriptLoader
return;
uint32 spellId = sSpellMgr->GetSpellWithRank(SPELL_WARLOCK_SEED_OF_CORRUPTION_DAMAGE_R1, GetSpellInfo()->GetRank());
- caster->CastSpell(eventInfo.GetActionTarget(), spellId, true);
+ caster->CastSpell(eventInfo.GetActionTarget(), spellId, true, nullptr, aurEff);
}
void Register() override
@@ -1193,7 +1193,7 @@ class spell_warl_seed_of_corruption_generic : public SpellScriptLoader
if (!caster)
return;
- caster->CastSpell(eventInfo.GetActionTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC, true);
+ caster->CastSpell(eventInfo.GetActionTarget(), SPELL_WARLOCK_SEED_OF_CORRUPTION_GENERIC, true, nullptr, aurEff);
}
void Register() override
@@ -1344,11 +1344,11 @@ class spell_warl_soul_leech : public SpellScriptLoader
uint32 selfSpellId = casterMana[impSoulLeechRank - 1];
uint32 petSpellId = petMana[impSoulLeechRank - 1];
- caster->CastSpell((Unit*)nullptr, selfSpellId, true);
- caster->CastSpell((Unit*)nullptr, petSpellId, true);
+ caster->CastSpell((Unit*)nullptr, selfSpellId, true, nullptr, aurEff);
+ caster->CastSpell((Unit*)nullptr, petSpellId, true, nullptr, aurEff);
if (roll_chance_i(impSoulLeech->GetAmount()))
- caster->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true);
+ caster->CastSpell((Unit*)nullptr, SPELL_REPLENISHMENT, true, nullptr, aurEff);
}
void Register() override
@@ -1422,11 +1422,11 @@ class spell_warl_t4_2p_bonus : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastSpell(caster, Trigger, true);
+ caster->CastSpell(caster, Trigger, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp
index 084c0441a0b..81fb4ec2457 100644
--- a/src/server/scripts/Spells/spell_warrior.cpp
+++ b/src/server/scripts/Spells/spell_warrior.cpp
@@ -486,11 +486,11 @@ class spell_warr_glyph_of_blocking : public SpellScriptLoader
return true;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastSpell(caster, SPELL_WARRIOR_GLYPH_OF_BLOCKING, true);
+ caster->CastSpell(caster, SPELL_WARRIOR_GLYPH_OF_BLOCKING, true, nullptr, aurEff);
}
void Register() override
@@ -562,7 +562,7 @@ class spell_warr_improved_spell_reflection : public SpellScriptLoader
{
PreventDefaultAction();
Unit* caster = eventInfo.GetActor();
- caster->CastCustomSpell(SPELL_WARRIOR_IMPROVED_SPELL_REFLECTION_TRIGGER, SPELLVALUE_MAX_TARGETS, aurEff->GetAmount(), caster, true);
+ caster->CastCustomSpell(SPELL_WARRIOR_IMPROVED_SPELL_REFLECTION_TRIGGER, SPELLVALUE_MAX_TARGETS, aurEff->GetAmount(), caster, true, nullptr, aurEff);
}
void Register() override
@@ -832,14 +832,14 @@ class spell_warr_second_wind : public SpellScriptLoader
return (spellInfo->GetAllEffectsMechanicMask() & ((1 << MECHANIC_ROOT) | (1 << MECHANIC_STUN))) != 0;
}
- void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
+ void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo)
{
static uint32 const triggeredSpells[2] = { SPELL_WARRIOR_SECOND_WIND_TRIGGER_1, SPELL_WARRIOR_SECOND_WIND_TRIGGER_2 };
PreventDefaultAction();
Unit* caster = eventInfo.GetActionTarget();
uint32 spellId = triggeredSpells[GetSpellInfo()->GetRank() - 1];
- caster->CastSpell(caster, spellId, true);
+ caster->CastSpell(caster, spellId, true, nullptr, aurEff);
}
void Register() override
diff --git a/src/tools/vmap4_extractor/mpq_libmpq.cpp b/src/tools/vmap4_extractor/mpq_libmpq.cpp
index 690600867d9..f106f96f5ec 100644
--- a/src/tools/vmap4_extractor/mpq_libmpq.cpp
+++ b/src/tools/vmap4_extractor/mpq_libmpq.cpp
@@ -19,6 +19,7 @@
#include "mpq_libmpq04.h"
#include <deque>
#include <cstdio>
+#include <algorithm>
ArchiveSet gOpenArchives;
@@ -52,6 +53,11 @@ MPQArchive::MPQArchive(const char* filename)
gOpenArchives.push_front(this);
}
+bool MPQArchive::isOpened() const
+{
+ return std::find(gOpenArchives.begin(), gOpenArchives.end(), this) != gOpenArchives.end();
+}
+
void MPQArchive::close()
{
//gOpenArchives.erase(erase(&mpq_a);
diff --git a/src/tools/vmap4_extractor/mpq_libmpq04.h b/src/tools/vmap4_extractor/mpq_libmpq04.h
index 97b77d4643b..f4a9d2aa596 100644
--- a/src/tools/vmap4_extractor/mpq_libmpq04.h
+++ b/src/tools/vmap4_extractor/mpq_libmpq04.h
@@ -34,7 +34,7 @@ public:
mpq_archive_s *mpq_a;
MPQArchive(const char* filename);
- ~MPQArchive() { close(); }
+ ~MPQArchive() { if (isOpened()) close(); }
void GetFileListTo(std::vector<std::string>& filelist) {
uint32_t filenum;
@@ -66,6 +66,7 @@ public:
private:
void close();
+ bool isOpened() const;
};
typedef std::deque<MPQArchive*> ArchiveSet;
@@ -95,13 +96,8 @@ public:
inline void flipcc(char *fcc)
{
- char t;
- t=fcc[0];
- fcc[0]=fcc[3];
- fcc[3]=t;
- t=fcc[1];
- fcc[1]=fcc[2];
- fcc[2]=t;
+ std::swap(fcc[0], fcc[3]);
+ std::swap(fcc[1], fcc[2]);
}
#endif