diff options
860 files changed, 13406 insertions, 6957 deletions
@@ -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/dep/g3dlite/G3D-v9.0 hotfix7.diff b/dep/g3dlite/G3D-v9.0 hotfix7.diff new file mode 100644 index 00000000000..1df0cff8ca1 --- /dev/null +++ b/dep/g3dlite/G3D-v9.0 hotfix7.diff @@ -0,0 +1,16 @@ + dep/g3dlite/include/G3D/g3dmath.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dep/g3dlite/include/G3D/g3dmath.h b/dep/g3dlite/include/G3D/g3dmath.h +index a32fdaf..54cc6ed 100644 +--- a/dep/g3dlite/include/G3D/g3dmath.h ++++ b/dep/g3dlite/include/G3D/g3dmath.h +@@ -934,7 +934,7 @@ inline double signedPow(double b, double e) { + + namespace std { + inline int pow(int a, int b) { +- return (int)pow(double(a), double(b)); ++ return (int)::pow(double(a), double(b)); + } + + } diff --git a/dep/g3dlite/Readme.txt b/dep/g3dlite/Readme.txt index d4e3fa5d06b..e94dbaabd7e 100644 --- a/dep/g3dlite/Readme.txt +++ b/dep/g3dlite/Readme.txt @@ -16,3 +16,4 @@ G3D-v9.0 hotfix3.diff - 2015-06-28 - fix some warnings G3D-v9.0 hotfix4.diff - 2015-07-02 - backport G3D10 fix G3D-v9.0 hotfix5.diff - 2015-07-31 - fix MSVC 2015 warning: dep/g3dlite/include/G3D/Quat.h(352): warning C4458: declaration of 'x' hides class member G3D-v9.0 hotfix6.diff - 2015-11-04 - fix adding std::shared_ptr, std::weak_ptr, std::dynamic_pointer_cast, std::static_pointer_cast and std::enable_shared_from_this to global namespace +G3D-v9.0 hotfix7.diff - 2016-10-10 - fix warning on clang 3.8 backported from G3D 10 diff --git a/dep/g3dlite/include/G3D/g3dmath.h b/dep/g3dlite/include/G3D/g3dmath.h index a32fdaf604d..54cc6ed3704 100644 --- a/dep/g3dlite/include/G3D/g3dmath.h +++ b/dep/g3dlite/include/G3D/g3dmath.h @@ -934,7 +934,7 @@ inline double signedPow(double b, double e) { namespace std { inline int pow(int a, int b) { - return (int)pow(double(a), double(b)); + return (int)::pow(double(a), double(b)); } } 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/auth_database.sql b/sql/base/auth_database.sql index 9d659382ed4..58d6d13f66a 100644 --- a/sql/base/auth_database.sql +++ b/sql/base/auth_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64) +-- MySQL dump 10.16 Distrib 10.1.6-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: auth -- ------------------------------------------------------ --- Server version 5.6.26-log +-- Server version 5.7.14-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -399,7 +399,7 @@ CREATE TABLE `rbac_permissions` ( LOCK TABLES `rbac_permissions` WRITE; /*!40000 ALTER TABLE `rbac_permissions` DISABLE KEYS */; -INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(51,'Allow trading between factions'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(294,'Command: cheat explore'),(295,'Command: cheat god'),(296,'Command: cheat power'),(297,'Command: cheat status'),(298,'Command: cheat taxi'),(299,'Command: cheat waterwalk'),(300,'Command: debug'),(301,'Command: debug anim'),(302,'Command: debug areatriggers'),(303,'Command: debug arena'),(304,'Command: debug bg'),(305,'Command: debug entervehicle'),(306,'Command: debug getitemstate'),(307,'Command: debug getitemvalue'),(308,'Command: debug getvalue'),(309,'Command: debug hostil'),(310,'Command: debug itemexpire'),(311,'Command: debug lootrecipient'),(312,'Command: debug los'),(313,'Command: debug mod32value'),(314,'Command: debug moveflags'),(315,'Command: debug play'),(316,'Command: debug play cinematics'),(317,'Command: debug play movie'),(318,'Command: debug play sound'),(319,'Command: debug send'),(320,'Command: debug send buyerror'),(321,'Command: debug send channelnotify'),(322,'Command: debug send chatmessage'),(323,'Command: debug send equiperror'),(324,'Command: debug send largepacket'),(325,'Command: debug send opcode'),(326,'Command: debug send qinvalidmsg'),(327,'Command: debug send qpartymsg'),(328,'Command: debug send sellerror'),(329,'Command: debug send setphaseshift'),(330,'Command: debug send spellfail'),(331,'Command: debug setaurastate'),(332,'Command: debug setbit'),(333,'Command: debug setitemvalue'),(334,'Command: debug setvalue'),(335,'Command: debug setvid'),(336,'Command: debug spawnvehicle'),(337,'Command: debug threat'),(338,'Command: debug update'),(339,'Command: debug uws'),(340,'Command: wpgps'),(341,'Command: deserter'),(342,'Command: deserter bg'),(343,'Command: deserter bg add'),(344,'Command: deserter bg remove'),(345,'Command: deserter instance'),(346,'Command: deserter instance add'),(347,'Command: deserter instance remove'),(348,'Command: disable'),(349,'Command: disable add'),(350,'Command: disable add achievement_criteria'),(351,'Command: disable add battleground'),(352,'Command: disable add map'),(353,'Command: disable add mmap'),(354,'Command: disable add outdoorpvp'),(355,'Command: disable add quest'),(356,'Command: disable add spell'),(357,'Command: disable add vmap'),(358,'Command: disable remove'),(359,'Command: disable remove achievement_criteria'),(360,'Command: disable remove battleground'),(361,'Command: disable remove map'),(362,'Command: disable remove mmap'),(363,'Command: disable remove outdoorpvp'),(364,'Command: disable remove quest'),(365,'Command: disable remove spell'),(366,'Command: disable remove vmap'),(367,'Command: event'),(368,'Command: event activelist'),(369,'Command: event start'),(370,'Command: event stop'),(371,'Command: gm'),(372,'Command: gm chat'),(373,'Command: gm fly'),(374,'Command: gm ingame'),(375,'Command: gm list'),(376,'Command: gm visible'),(377,'Command: go'),(378,'Command: go creature'),(379,'Command: go graveyard'),(380,'Command: go grid'),(381,'Command: go object'),(382,'Command: go taxinode'),(383,'Command: go ticket'),(384,'Command: go trigger'),(385,'Command: go xyz'),(386,'Command: go zonexy'),(387,'Command: gobject'),(388,'Command: gobject activate'),(389,'Command: gobject add'),(390,'Command: gobject add temp'),(391,'Command: gobject delete'),(392,'Command: gobject info'),(393,'Command: gobject move'),(394,'Command: gobject near'),(395,'Command: gobject set'),(396,'Command: gobject set phase'),(397,'Command: gobject set state'),(398,'Command: gobject target'),(399,'Command: gobject turn'),(400,'debug transport'),(401,'Command: guild'),(402,'Command: guild create'),(403,'Command: guild delete'),(404,'Command: guild invite'),(405,'Command: guild uninvite'),(406,'Command: guild rank'),(407,'Command: guild rename'),(408,'Command: honor'),(409,'Command: honor add'),(410,'Command: honor add kill'),(411,'Command: honor update'),(412,'Command: instance'),(413,'Command: instance listbinds'),(414,'Command: instance unbind'),(415,'Command: instance stats'),(416,'Command: instance savedata'),(417,'Command: learn'),(418,'Command: learn all'),(419,'Command: learn all my'),(420,'Command: learn all my class'),(421,'Command: learn all my pettalents'),(422,'Command: learn all my spells'),(423,'Command: learn all my talents'),(424,'Command: learn all gm'),(425,'Command: learn all crafts'),(426,'Command: learn all default'),(427,'Command: learn all lang'),(428,'Command: learn all recipes'),(429,'Command: unlearn'),(430,'Command: lfg'),(431,'Command: lfg player'),(432,'Command: lfg group'),(433,'Command: lfg queue'),(434,'Command: lfg clean'),(435,'Command: lfg options'),(436,'Command: list'),(437,'Command: list creature'),(438,'Command: list item'),(439,'Command: list object'),(440,'Command: list auras'),(441,'Command: list mail'),(442,'Command: lookup'),(443,'Command: lookup area'),(444,'Command: lookup creature'),(445,'Command: lookup event'),(446,'Command: lookup faction'),(447,'Command: lookup item'),(448,'Command: lookup itemset'),(449,'Command: lookup object'),(450,'Command: lookup quest'),(451,'Command: lookup player'),(452,'Command: lookup player ip'),(453,'Command: lookup player account'),(454,'Command: lookup player email'),(455,'Command: lookup skill'),(456,'Command: lookup spell'),(457,'Command: lookup spell id'),(458,'Command: lookup taxinode'),(459,'Command: lookup tele'),(460,'Command: lookup title'),(461,'Command: lookup map'),(462,'Command: announce'),(463,'Command: channel'),(464,'Command: channel set'),(465,'Command: channel set ownership'),(466,'Command: gmannounce'),(467,'Command: gmnameannounce'),(468,'Command: gmnotify'),(469,'Command: nameannounce'),(470,'Command: notify'),(471,'Command: whispers'),(472,'Command: group'),(473,'Command: group leader'),(474,'Command: group disband'),(475,'Command: group remove'),(476,'Command: group join'),(477,'Command: group list'),(478,'Command: group summon'),(479,'Command: pet'),(480,'Command: pet create'),(481,'Command: pet learn'),(482,'Command: pet unlearn'),(483,'Command: send'),(484,'Command: send items'),(485,'Command: send mail'),(486,'Command: send message'),(487,'Command: send money'),(488,'Command: additem'),(489,'Command: additemset'),(490,'Command: appear'),(491,'Command: aura'),(492,'Command: bank'),(493,'Command: bindsight'),(494,'Command: combatstop'),(495,'Command: cometome'),(496,'Command: commands'),(497,'Command: cooldown'),(498,'Command: damage'),(499,'Command: dev'),(500,'Command: die'),(501,'Command: dismount'),(502,'Command: distance'),(503,'Command: flusharenapoints'),(504,'Command: freeze'),(505,'Command: gps'),(506,'Command: guid'),(507,'Command: help'),(508,'Command: hidearea'),(509,'Command: itemmove'),(510,'Command: kick'),(511,'Command: linkgrave'),(512,'Command: listfreeze'),(513,'Command: maxskill'),(514,'Command: movegens'),(515,'Command: mute'),(516,'Command: neargrave'),(517,'Command: pinfo'),(518,'Command: playall'),(519,'Command: possess'),(520,'Command: recall'),(521,'Command: repairitems'),(522,'Command: respawn'),(523,'Command: revive'),(524,'Command: saveall'),(525,'Command: save'),(526,'Command: setskill'),(527,'Command: showarea'),(528,'Command: summon'),(529,'Command: unaura'),(530,'Command: unbindsight'),(531,'Command: unfreeze'),(532,'Command: unmute'),(533,'Command: unpossess'),(534,'Command: unstuck'),(535,'Command: wchange'),(536,'Command: mmap'),(537,'Command: mmap loadedtiles'),(538,'Command: mmap loc'),(539,'Command: mmap path'),(540,'Command: mmap stats'),(541,'Command: mmap testarea'),(542,'Command: morph'),(543,'Command: demorph'),(544,'Command: modify'),(545,'Command: modify arenapoints'),(546,'Command: modify bit'),(547,'Command: modify drunk'),(548,'Command: modify energy'),(549,'Command: modify faction'),(550,'Command: modify gender'),(551,'Command: modify honor'),(552,'Command: modify hp'),(553,'Command: modify mana'),(554,'Command: modify money'),(555,'Command: modify mount'),(556,'Command: modify phase'),(557,'Command: modify rage'),(558,'Command: modify reputation'),(559,'Command: modify runicpower'),(560,'Command: modify scale'),(561,'Command: modify speed'),(562,'Command: modify speed all'),(563,'Command: modify speed backwalk'),(564,'Command: modify speed fly'),(565,'Command: modify speed walk'),(566,'Command: modify speed swim'),(567,'Command: modify spell'),(568,'Command: modify standstate'),(569,'Command: modify talentpoints'),(570,'Command: npc'),(571,'Command: npc add'),(572,'Command: npc add formation'),(573,'Command: npc add item'),(574,'Command: npc add move'),(575,'Command: npc add temp'),(576,'Command: npc add delete'),(577,'Command: npc add delete item'),(578,'Command: npc add follow'),(579,'Command: npc add follow stop'),(580,'Command: npc set'),(581,'Command: npc set allowmove'),(582,'Command: npc set entry'),(583,'Command: npc set factionid'),(584,'Command: npc set flag'),(585,'Command: npc set level'),(586,'Command: npc set link'),(587,'Command: npc set model'),(588,'Command: npc set movetype'),(589,'Command: npc set phase'),(590,'Command: npc set spawndist'),(591,'Command: npc set spawntime'),(592,'Command: npc set data'),(593,'Command: npc info'),(594,'Command: npc near'),(595,'Command: npc move'),(596,'Command: npc playemote'),(597,'Command: npc say'),(598,'Command: npc textemote'),(599,'Command: npc whisper'),(600,'Command: npc yell'),(601,'Command: npc tame'),(602,'Command: quest'),(603,'Command: quest add'),(604,'Command: quest complete'),(605,'Command: quest remove'),(606,'Command: quest reward'),(607,'Command: reload'),(608,'Command: reload access_requirement'),(609,'Command: reload achievement_criteria_data'),(610,'Command: reload achievement_reward'),(611,'Command: reload all'),(612,'Command: reload all achievement'),(613,'Command: reload all area'),(614,'Command: broadcast_text'),(615,'Command: reload all gossips'),(616,'Command: reload all item'),(617,'Command: reload all locales'),(618,'Command: reload all loot'),(619,'Command: reload all npc'),(620,'Command: reload all quest'),(621,'Command: reload all scripts'),(622,'Command: reload all spell'),(623,'Command: reload areatrigger_involvedrelation'),(624,'Command: reload areatrigger_tavern'),(625,'Command: reload areatrigger_teleport'),(626,'Command: reload auctions'),(627,'Command: reload autobroadcast'),(628,'Command: reload command'),(629,'Command: reload conditions'),(630,'Command: reload config'),(631,'Command: reload battleground_template'),(632,'Command: .mutehistory'),(633,'Command: reload creature_linked_respawn'),(634,'Command: reload creature_loot_template'),(635,'Command: reload creature_onkill_reputation'),(636,'Command: reload creature_questender'),(637,'Command: reload creature_queststarter'),(638,'Command: reload creature_summon_groups'),(639,'Command: reload creature_template'),(640,'Command: reload creature_text'),(641,'Command: reload disables'),(642,'Command: reload disenchant_loot_template'),(643,'Command: reload event_scripts'),(644,'Command: reload fishing_loot_template'),(645,'Command: reload game_graveyard_zone'),(646,'Command: reload game_tele'),(647,'Command: reload gameobject_questender'),(648,'Command: reload gameobject_loot_template'),(649,'Command: reload gameobject_queststarter'),(650,'Command: reload gm_tickets'),(651,'Command: reload gossip_menu'),(652,'Command: reload gossip_menu_option'),(653,'Command: reload item_enchantment_template'),(654,'Command: reload item_loot_template'),(655,'Command: reload item_set_names'),(656,'Command: reload lfg_dungeon_rewards'),(657,'Command: reload locales_achievement_reward'),(658,'Command: reload locales_creature'),(659,'Command: reload locales_creature_text'),(660,'Command: reload locales_gameobject'),(661,'Command: reload locales_gossip_menu_option'),(662,'Command: reload locales_item'),(663,'Command: reload locales_item_set_name'),(664,'Command: reload locales_npc_text'),(665,'Command: reload locales_page_text'),(666,'Command: reload locales_points_of_interest'),(667,'Command: reload locales_quest'),(668,'Command: reload mail_level_reward'),(669,'Command: reload mail_loot_template'),(670,'Command: reload milling_loot_template'),(671,'Command: reload npc_spellclick_spells'),(672,'Command: reload npc_trainer'),(673,'Command: reload npc_vendor'),(674,'Command: reload page_text'),(675,'Command: reload pickpocketing_loot_template'),(676,'Command: reload points_of_interest'),(677,'Command: reload prospecting_loot_template'),(678,'Command: reload quest_poi'),(679,'Command: reload quest_template'),(680,'Command: reload rbac'),(681,'Command: reload reference_loot_template'),(682,'Command: reload reserved_name'),(683,'Command: reload reputation_reward_rate'),(684,'Command: reload reputation_spillover_template'),(685,'Command: reload skill_discovery_template'),(686,'Command: reload skill_extra_item_template'),(687,'Command: reload skill_fishing_base_level'),(688,'Command: reload skinning_loot_template'),(689,'Command: reload smart_scripts'),(690,'Command: reload spell_required'),(691,'Command: reload spell_area'),(692,'Command: reload spell_bonus_data'),(693,'Command: reload spell_group'),(694,'Command: reload spell_learn_spell'),(695,'Command: reload spell_loot_template'),(696,'Command: reload spell_linked_spell'),(697,'Command: reload spell_pet_auras'),(698,'Command: reload spell_proc_event'),(699,'Command: reload spell_proc'),(700,'Command: reload spell_scripts'),(701,'Command: reload spell_target_position'),(702,'Command: reload spell_threats'),(703,'Command: reload spell_group_stack_rules'),(704,'Command: reload trinity_string'),(705,'Command: reload warden_action'),(706,'Command: reload waypoint_scripts'),(707,'Command: reload waypoint_data'),(708,'Command: reload vehicle_accessory'),(709,'Command: reload vehicle_template_accessory'),(710,'Command: reset'),(711,'Command: reset achievements'),(712,'Command: reset honor'),(713,'Command: reset level'),(714,'Command: reset spells'),(715,'Command: reset stats'),(716,'Command: reset talents'),(717,'Command: reset all'),(718,'Command: server'),(719,'Command: server corpses'),(720,'Command: server exit'),(721,'Command: server idlerestart'),(722,'Command: server idlerestart cancel'),(723,'Command: server idleshutdown'),(724,'Command: server idleshutdown cancel'),(725,'Command: server info'),(726,'Command: server plimit'),(727,'Command: server restart'),(728,'Command: server restart cancel'),(729,'Command: server set'),(730,'Command: server set closed'),(731,'Command: server set difftime'),(732,'Command: server set loglevel'),(733,'Command: server set motd'),(734,'Command: server shutdown'),(735,'Command: server shutdown cancel'),(736,'Command: server motd'),(737,'Command: tele'),(738,'Command: tele add'),(739,'Command: tele del'),(740,'Command: tele name'),(741,'Command: tele group'),(742,'Command: ticket'),(743,'Command: ticket assign'),(744,'Command: ticket close'),(745,'Command: ticket closedlist'),(746,'Command: ticket comment'),(747,'Command: ticket complete'),(748,'Command: ticket delete'),(749,'Command: ticket escalate'),(750,'Command: ticket escalatedlist'),(751,'Command: ticket list'),(752,'Command: ticket onlinelist'),(753,'Command: ticket reset'),(754,'Command: ticket response'),(755,'Command: ticket response append'),(756,'Command: ticket response appendln'),(757,'Command: ticket togglesystem'),(758,'Command: ticket unassign'),(759,'Command: ticket viewid'),(760,'Command: ticket viewname'),(761,'Command: titles'),(762,'Command: titles add'),(763,'Command: titles current'),(764,'Command: titles remove'),(765,'Command: titles set'),(766,'Command: titles set mask'),(767,'Command: wp'),(768,'Command: wp add'),(769,'Command: wp event'),(770,'Command: wp load'),(771,'Command: wp modify'),(772,'Command: wp unload'),(773,'Command: wp reload'),(774,'Command: wp show'),(777,'Command: mailbox'),(778,'Command: ahbot'),(779,'Command: ahbot items'),(780,'Command: ahbot items gray'),(781,'Command: ahbot items white'),(782,'Command: ahbot items green'),(783,'Command: ahbot items blue'),(784,'Command: ahbot items purple'),(785,'Command: ahbot items orange'),(786,'Command: ahbot items yellow'),(787,'Command: ahbot ratio'),(788,'Command: ahbot ratio alliance'),(789,'Command: ahbot ratio horde'),(790,'Command: ahbot ratio neutral'),(791,'Command: ahbot rebuild'),(792,'Command: ahbot reload'),(793,'Command: ahbot status'),(794,'Command: .guild info'),(795,'Command: .instance setbossstate'),(796,'Command: instance getbossstate'),(797,'Command: pvpstats'),(798,'Command: .mod xp'),(835,'Command: debug loadcells'),(836,'Command: .debug boundary'),(837,'Command: .npc evade'),(838,'Command: .pet level'),(839,'Command: .server shutdown force'),(840,'Command: .server restart force'),(841,'Command: .neargraveyard'); +INSERT INTO `rbac_permissions` VALUES (1,'Instant logout'),(2,'Skip Queue'),(3,'Join Normal Battleground'),(4,'Join Random Battleground'),(5,'Join Arenas'),(6,'Join Dungeon Finder'),(11,'Log GM trades'),(13,'Skip Instance required bosses check'),(14,'Skip character creation team mask check'),(15,'Skip character creation class mask check'),(16,'Skip character creation race mask check'),(17,'Skip character creation reserved name check'),(18,'Skip character creation heroic min level check'),(19,'Skip needed requirements to use channel check'),(20,'Skip disable map check'),(21,'Skip reset talents when used more than allowed check'),(22,'Skip spam chat check'),(23,'Skip over-speed ping check'),(24,'Two side faction characters on the same account'),(25,'Allow say chat between factions'),(26,'Allow channel chat between factions'),(27,'Two side mail interaction'),(28,'See two side who list'),(29,'Add friends of other faction'),(30,'Save character without delay with .save command'),(31,'Use params with .unstuck command'),(32,'Can be assigned tickets with .assign ticket command'),(33,'Notify if a command was not found'),(34,'Check if should appear in list using .gm ingame command'),(35,'See all security levels with who command'),(36,'Filter whispers'),(37,'Use staff badge in chat'),(38,'Resurrect with full Health Points'),(39,'Restore saved gm setting states'),(40,'Allows to add a gm to friend list'),(41,'Use Config option START_GM_LEVEL to assign new character level'),(42,'Allows to use CMSG_WORLD_TELEPORT opcode'),(43,'Allows to use CMSG_WHOIS opcode'),(44,'Receive global GM messages/texts'),(45,'Join channels without announce'),(46,'Change channel settings without being channel moderator'),(47,'Enables lower security than target check'),(48,'Enable IP, Last Login and EMail output in pinfo'),(49,'Forces to enter the email for confirmation on password change'),(50,'Allow user to check his own email with .account'),(51,'Allow trading between factions'),(192,'Role: Sec Level Administrator'),(193,'Role: Sec Level Gamemaster'),(194,'Role: Sec Level Moderator'),(195,'Role: Sec Level Player'),(196,'Role: Administrator Commands'),(197,'Role: Gamemaster Commands'),(198,'Role: Moderator Commands'),(199,'Role: Player Commands'),(200,'Command: rbac'),(201,'Command: rbac account'),(202,'Command: rbac account list'),(203,'Command: rbac account grant'),(204,'Command: rbac account deny'),(205,'Command: rbac account revoke'),(206,'Command: rbac list'),(217,'Command: account'),(218,'Command: account addon'),(219,'Command: account create'),(220,'Command: account delete'),(221,'Command: account lock'),(222,'Command: account lock country'),(223,'Command: account lock ip'),(224,'Command: account onlinelist'),(225,'Command: account password'),(226,'Command: account set'),(227,'Command: account set addon'),(228,'Command: account set gmlevel'),(229,'Command: account set password'),(230,'Command: achievement'),(231,'Command: achievement add'),(232,'Command: arena'),(233,'Command: arena captain'),(234,'Command: arena create'),(235,'Command: arena disband'),(236,'Command: arena info'),(237,'Command: arena lookup'),(238,'Command: arena rename'),(239,'Command: ban'),(240,'Command: ban account'),(241,'Command: ban character'),(242,'Command: ban ip'),(243,'Command: ban playeraccount'),(244,'Command: baninfo'),(245,'Command: baninfo account'),(246,'Command: baninfo character'),(247,'Command: baninfo ip'),(248,'Command: banlist'),(249,'Command: banlist account'),(250,'Command: banlist character'),(251,'Command: banlist ip'),(252,'Command: unban'),(253,'Command: unban account'),(254,'Command: unban character'),(255,'Command: unban ip'),(256,'Command: unban playeraccount'),(257,'Command: bf'),(258,'Command: bf start'),(259,'Command: bf stop'),(260,'Command: bf switch'),(261,'Command: bf timer'),(262,'Command: bf enable'),(263,'Command: account email'),(264,'Command: account set sec'),(265,'Command: account set sec email'),(266,'Command: account set sec regmail'),(267,'Command: cast'),(268,'Command: cast back'),(269,'Command: cast dist'),(270,'Command: cast self'),(271,'Command: cast target'),(272,'Command: cast dest'),(273,'Command: character'),(274,'Command: character customize'),(275,'Command: character changefaction'),(276,'Command: character changerace'),(277,'Command: character deleted'),(279,'Command: character deleted list'),(280,'Command: character deleted restore'),(283,'Command: character level'),(284,'Command: character rename'),(285,'Command: character reputation'),(286,'Command: character titles'),(287,'Command: levelup'),(288,'Command: pdump'),(289,'Command: pdump load'),(290,'Command: pdump write'),(291,'Command: cheat'),(292,'Command: cheat casttime'),(293,'Command: cheat cooldown'),(294,'Command: cheat explore'),(295,'Command: cheat god'),(296,'Command: cheat power'),(297,'Command: cheat status'),(298,'Command: cheat taxi'),(299,'Command: cheat waterwalk'),(300,'Command: debug'),(301,'Command: debug anim'),(302,'Command: debug areatriggers'),(303,'Command: debug arena'),(304,'Command: debug bg'),(305,'Command: debug entervehicle'),(306,'Command: debug getitemstate'),(307,'Command: debug getitemvalue'),(308,'Command: debug getvalue'),(309,'Command: debug hostil'),(310,'Command: debug itemexpire'),(311,'Command: debug lootrecipient'),(312,'Command: debug los'),(313,'Command: debug mod32value'),(314,'Command: debug moveflags'),(315,'Command: debug play'),(316,'Command: debug play cinematics'),(317,'Command: debug play movie'),(318,'Command: debug play sound'),(319,'Command: debug send'),(320,'Command: debug send buyerror'),(321,'Command: debug send channelnotify'),(322,'Command: debug send chatmessage'),(323,'Command: debug send equiperror'),(324,'Command: debug send largepacket'),(325,'Command: debug send opcode'),(326,'Command: debug send qinvalidmsg'),(327,'Command: debug send qpartymsg'),(328,'Command: debug send sellerror'),(329,'Command: debug send setphaseshift'),(330,'Command: debug send spellfail'),(331,'Command: debug setaurastate'),(332,'Command: debug setbit'),(333,'Command: debug setitemvalue'),(334,'Command: debug setvalue'),(335,'Command: debug setvid'),(336,'Command: debug spawnvehicle'),(337,'Command: debug threat'),(338,'Command: debug update'),(339,'Command: debug uws'),(340,'Command: wpgps'),(341,'Command: deserter'),(342,'Command: deserter bg'),(343,'Command: deserter bg add'),(344,'Command: deserter bg remove'),(345,'Command: deserter instance'),(346,'Command: deserter instance add'),(347,'Command: deserter instance remove'),(348,'Command: disable'),(349,'Command: disable add'),(350,'Command: disable add achievement_criteria'),(351,'Command: disable add battleground'),(352,'Command: disable add map'),(353,'Command: disable add mmap'),(354,'Command: disable add outdoorpvp'),(355,'Command: disable add quest'),(356,'Command: disable add spell'),(357,'Command: disable add vmap'),(358,'Command: disable remove'),(359,'Command: disable remove achievement_criteria'),(360,'Command: disable remove battleground'),(361,'Command: disable remove map'),(362,'Command: disable remove mmap'),(363,'Command: disable remove outdoorpvp'),(364,'Command: disable remove quest'),(365,'Command: disable remove spell'),(366,'Command: disable remove vmap'),(367,'Command: event'),(368,'Command: event activelist'),(369,'Command: event start'),(370,'Command: event stop'),(371,'Command: gm'),(372,'Command: gm chat'),(373,'Command: gm fly'),(374,'Command: gm ingame'),(375,'Command: gm list'),(376,'Command: gm visible'),(377,'Command: go'),(378,'Command: go creature'),(379,'Command: go graveyard'),(380,'Command: go grid'),(381,'Command: go object'),(382,'Command: go taxinode'),(383,'Command: go ticket'),(384,'Command: go trigger'),(385,'Command: go xyz'),(386,'Command: go zonexy'),(387,'Command: gobject'),(388,'Command: gobject activate'),(389,'Command: gobject add'),(390,'Command: gobject add temp'),(391,'Command: gobject delete'),(392,'Command: gobject info'),(393,'Command: gobject move'),(394,'Command: gobject near'),(395,'Command: gobject set'),(396,'Command: gobject set phase'),(397,'Command: gobject set state'),(398,'Command: gobject target'),(399,'Command: gobject turn'),(400,'debug transport'),(401,'Command: guild'),(402,'Command: guild create'),(403,'Command: guild delete'),(404,'Command: guild invite'),(405,'Command: guild uninvite'),(406,'Command: guild rank'),(407,'Command: guild rename'),(408,'Command: honor'),(409,'Command: honor add'),(410,'Command: honor add kill'),(411,'Command: honor update'),(412,'Command: instance'),(413,'Command: instance listbinds'),(414,'Command: instance unbind'),(415,'Command: instance stats'),(416,'Command: instance savedata'),(417,'Command: learn'),(418,'Command: learn all'),(419,'Command: learn all my'),(420,'Command: learn all my class'),(421,'Command: learn all my pettalents'),(422,'Command: learn all my spells'),(423,'Command: learn all my talents'),(424,'Command: learn all gm'),(425,'Command: learn all crafts'),(426,'Command: learn all default'),(427,'Command: learn all lang'),(428,'Command: learn all recipes'),(429,'Command: unlearn'),(430,'Command: lfg'),(431,'Command: lfg player'),(432,'Command: lfg group'),(433,'Command: lfg queue'),(434,'Command: lfg clean'),(435,'Command: lfg options'),(436,'Command: list'),(437,'Command: list creature'),(438,'Command: list item'),(439,'Command: list object'),(440,'Command: list auras'),(441,'Command: list mail'),(442,'Command: lookup'),(443,'Command: lookup area'),(444,'Command: lookup creature'),(445,'Command: lookup event'),(446,'Command: lookup faction'),(447,'Command: lookup item'),(448,'Command: lookup itemset'),(449,'Command: lookup object'),(450,'Command: lookup quest'),(451,'Command: lookup player'),(452,'Command: lookup player ip'),(453,'Command: lookup player account'),(454,'Command: lookup player email'),(455,'Command: lookup skill'),(456,'Command: lookup spell'),(457,'Command: lookup spell id'),(458,'Command: lookup taxinode'),(459,'Command: lookup tele'),(460,'Command: lookup title'),(461,'Command: lookup map'),(462,'Command: announce'),(463,'Command: channel'),(464,'Command: channel set'),(465,'Command: channel set ownership'),(466,'Command: gmannounce'),(467,'Command: gmnameannounce'),(468,'Command: gmnotify'),(469,'Command: nameannounce'),(470,'Command: notify'),(471,'Command: whispers'),(472,'Command: group'),(473,'Command: group leader'),(474,'Command: group disband'),(475,'Command: group remove'),(476,'Command: group join'),(477,'Command: group list'),(478,'Command: group summon'),(479,'Command: pet'),(480,'Command: pet create'),(481,'Command: pet learn'),(482,'Command: pet unlearn'),(483,'Command: send'),(484,'Command: send items'),(485,'Command: send mail'),(486,'Command: send message'),(487,'Command: send money'),(488,'Command: additem'),(489,'Command: additemset'),(490,'Command: appear'),(491,'Command: aura'),(492,'Command: bank'),(493,'Command: bindsight'),(494,'Command: combatstop'),(495,'Command: cometome'),(496,'Command: commands'),(497,'Command: cooldown'),(498,'Command: damage'),(499,'Command: dev'),(500,'Command: die'),(501,'Command: dismount'),(502,'Command: distance'),(503,'Command: flusharenapoints'),(504,'Command: freeze'),(505,'Command: gps'),(506,'Command: guid'),(507,'Command: help'),(508,'Command: hidearea'),(509,'Command: itemmove'),(510,'Command: kick'),(511,'Command: linkgrave'),(512,'Command: listfreeze'),(513,'Command: maxskill'),(514,'Command: movegens'),(515,'Command: mute'),(516,'Command: neargrave'),(517,'Command: pinfo'),(518,'Command: playall'),(519,'Command: possess'),(520,'Command: recall'),(521,'Command: repairitems'),(522,'Command: respawn'),(523,'Command: revive'),(524,'Command: saveall'),(525,'Command: save'),(526,'Command: setskill'),(527,'Command: showarea'),(528,'Command: summon'),(529,'Command: unaura'),(530,'Command: unbindsight'),(531,'Command: unfreeze'),(532,'Command: unmute'),(533,'Command: unpossess'),(534,'Command: unstuck'),(535,'Command: wchange'),(536,'Command: mmap'),(537,'Command: mmap loadedtiles'),(538,'Command: mmap loc'),(539,'Command: mmap path'),(540,'Command: mmap stats'),(541,'Command: mmap testarea'),(542,'Command: morph'),(543,'Command: demorph'),(544,'Command: modify'),(545,'Command: modify arenapoints'),(546,'Command: modify bit'),(547,'Command: modify drunk'),(548,'Command: modify energy'),(549,'Command: modify faction'),(550,'Command: modify gender'),(551,'Command: modify honor'),(552,'Command: modify hp'),(553,'Command: modify mana'),(554,'Command: modify money'),(555,'Command: modify mount'),(556,'Command: modify phase'),(557,'Command: modify rage'),(558,'Command: modify reputation'),(559,'Command: modify runicpower'),(560,'Command: modify scale'),(561,'Command: modify speed'),(562,'Command: modify speed all'),(563,'Command: modify speed backwalk'),(564,'Command: modify speed fly'),(565,'Command: modify speed walk'),(566,'Command: modify speed swim'),(567,'Command: modify spell'),(568,'Command: modify standstate'),(569,'Command: modify talentpoints'),(570,'Command: npc'),(571,'Command: npc add'),(572,'Command: npc add formation'),(573,'Command: npc add item'),(574,'Command: npc add move'),(575,'Command: npc add temp'),(576,'Command: npc add delete'),(577,'Command: npc add delete item'),(578,'Command: npc add follow'),(579,'Command: npc add follow stop'),(580,'Command: npc set'),(581,'Command: npc set allowmove'),(582,'Command: npc set entry'),(583,'Command: npc set factionid'),(584,'Command: npc set flag'),(585,'Command: npc set level'),(586,'Command: npc set link'),(587,'Command: npc set model'),(588,'Command: npc set movetype'),(589,'Command: npc set phase'),(590,'Command: npc set spawndist'),(591,'Command: npc set spawntime'),(592,'Command: npc set data'),(593,'Command: npc info'),(594,'Command: npc near'),(595,'Command: npc move'),(596,'Command: npc playemote'),(597,'Command: npc say'),(598,'Command: npc textemote'),(599,'Command: npc whisper'),(600,'Command: npc yell'),(601,'Command: npc tame'),(602,'Command: quest'),(603,'Command: quest add'),(604,'Command: quest complete'),(605,'Command: quest remove'),(606,'Command: quest reward'),(607,'Command: reload'),(608,'Command: reload access_requirement'),(609,'Command: reload achievement_criteria_data'),(610,'Command: reload achievement_reward'),(611,'Command: reload all'),(612,'Command: reload all achievement'),(613,'Command: reload all area'),(614,'Command: broadcast_text'),(615,'Command: reload all gossips'),(616,'Command: reload all item'),(617,'Command: reload all locales'),(618,'Command: reload all loot'),(619,'Command: reload all npc'),(620,'Command: reload all quest'),(621,'Command: reload all scripts'),(622,'Command: reload all spell'),(623,'Command: reload areatrigger_involvedrelation'),(624,'Command: reload areatrigger_tavern'),(625,'Command: reload areatrigger_teleport'),(626,'Command: reload auctions'),(627,'Command: reload autobroadcast'),(628,'Command: reload command'),(629,'Command: reload conditions'),(630,'Command: reload config'),(631,'Command: reload battleground_template'),(632,'Command: .mutehistory'),(633,'Command: reload creature_linked_respawn'),(634,'Command: reload creature_loot_template'),(635,'Command: reload creature_onkill_reputation'),(636,'Command: reload creature_questender'),(637,'Command: reload creature_queststarter'),(638,'Command: reload creature_summon_groups'),(639,'Command: reload creature_template'),(640,'Command: reload creature_text'),(641,'Command: reload disables'),(642,'Command: reload disenchant_loot_template'),(643,'Command: reload event_scripts'),(644,'Command: reload fishing_loot_template'),(645,'Command: reload game_graveyard_zone'),(646,'Command: reload game_tele'),(647,'Command: reload gameobject_questender'),(648,'Command: reload gameobject_loot_template'),(649,'Command: reload gameobject_queststarter'),(650,'Command: reload gm_tickets'),(651,'Command: reload gossip_menu'),(652,'Command: reload gossip_menu_option'),(653,'Command: reload item_enchantment_template'),(654,'Command: reload item_loot_template'),(655,'Command: reload item_set_names'),(656,'Command: reload lfg_dungeon_rewards'),(657,'Command: reload locales_achievement_reward'),(658,'Command: reload locales_creature'),(659,'Command: reload locales_creature_text'),(660,'Command: reload locales_gameobject'),(661,'Command: reload locales_gossip_menu_option'),(662,'Command: reload locales_item'),(663,'Command: reload locales_item_set_name'),(664,'Command: reload locales_npc_text'),(665,'Command: reload locales_page_text'),(666,'Command: reload locales_points_of_interest'),(667,'Command: reload locales_quest'),(668,'Command: reload mail_level_reward'),(669,'Command: reload mail_loot_template'),(670,'Command: reload milling_loot_template'),(671,'Command: reload npc_spellclick_spells'),(672,'Command: reload npc_trainer'),(673,'Command: reload npc_vendor'),(674,'Command: reload page_text'),(675,'Command: reload pickpocketing_loot_template'),(676,'Command: reload points_of_interest'),(677,'Command: reload prospecting_loot_template'),(678,'Command: reload quest_poi'),(679,'Command: reload quest_template'),(680,'Command: reload rbac'),(681,'Command: reload reference_loot_template'),(682,'Command: reload reserved_name'),(683,'Command: reload reputation_reward_rate'),(684,'Command: reload reputation_spillover_template'),(685,'Command: reload skill_discovery_template'),(686,'Command: reload skill_extra_item_template'),(687,'Command: reload skill_fishing_base_level'),(688,'Command: reload skinning_loot_template'),(689,'Command: reload smart_scripts'),(690,'Command: reload spell_required'),(691,'Command: reload spell_area'),(692,'Command: reload spell_bonus_data'),(693,'Command: reload spell_group'),(694,'Command: reload spell_learn_spell'),(695,'Command: reload spell_loot_template'),(696,'Command: reload spell_linked_spell'),(697,'Command: reload spell_pet_auras'),(698,'Command: reload spell_proc_event'),(699,'Command: reload spell_proc'),(700,'Command: reload spell_scripts'),(701,'Command: reload spell_target_position'),(702,'Command: reload spell_threats'),(703,'Command: reload spell_group_stack_rules'),(704,'Command: reload trinity_string'),(705,'Command: reload warden_action'),(706,'Command: reload waypoint_scripts'),(707,'Command: reload waypoint_data'),(708,'Command: reload vehicle_accessory'),(709,'Command: reload vehicle_template_accessory'),(710,'Command: reset'),(711,'Command: reset achievements'),(712,'Command: reset honor'),(713,'Command: reset level'),(714,'Command: reset spells'),(715,'Command: reset stats'),(716,'Command: reset talents'),(717,'Command: reset all'),(718,'Command: server'),(719,'Command: server corpses'),(720,'Command: server exit'),(721,'Command: server idlerestart'),(722,'Command: server idlerestart cancel'),(723,'Command: server idleshutdown'),(724,'Command: server idleshutdown cancel'),(725,'Command: server info'),(726,'Command: server plimit'),(727,'Command: server restart'),(728,'Command: server restart cancel'),(729,'Command: server set'),(730,'Command: server set closed'),(731,'Command: server set difftime'),(732,'Command: server set loglevel'),(733,'Command: server set motd'),(734,'Command: server shutdown'),(735,'Command: server shutdown cancel'),(736,'Command: server motd'),(737,'Command: tele'),(738,'Command: tele add'),(739,'Command: tele del'),(740,'Command: tele name'),(741,'Command: tele group'),(742,'Command: ticket'),(743,'Command: ticket assign'),(744,'Command: ticket close'),(745,'Command: ticket closedlist'),(746,'Command: ticket comment'),(747,'Command: ticket complete'),(748,'Command: ticket delete'),(749,'Command: ticket escalate'),(750,'Command: ticket escalatedlist'),(751,'Command: ticket list'),(752,'Command: ticket onlinelist'),(753,'Command: ticket reset'),(754,'Command: ticket response'),(755,'Command: ticket response append'),(756,'Command: ticket response appendln'),(757,'Command: ticket togglesystem'),(758,'Command: ticket unassign'),(759,'Command: ticket viewid'),(760,'Command: ticket viewname'),(761,'Command: titles'),(762,'Command: titles add'),(763,'Command: titles current'),(764,'Command: titles remove'),(765,'Command: titles set'),(766,'Command: titles set mask'),(767,'Command: wp'),(768,'Command: wp add'),(769,'Command: wp event'),(770,'Command: wp load'),(771,'Command: wp modify'),(772,'Command: wp unload'),(773,'Command: wp reload'),(774,'Command: wp show'),(777,'Command: mailbox'),(778,'Command: ahbot'),(779,'Command: ahbot items'),(780,'Command: ahbot items gray'),(781,'Command: ahbot items white'),(782,'Command: ahbot items green'),(783,'Command: ahbot items blue'),(784,'Command: ahbot items purple'),(785,'Command: ahbot items orange'),(786,'Command: ahbot items yellow'),(787,'Command: ahbot ratio'),(788,'Command: ahbot ratio alliance'),(789,'Command: ahbot ratio horde'),(790,'Command: ahbot ratio neutral'),(791,'Command: ahbot rebuild'),(792,'Command: ahbot reload'),(793,'Command: ahbot status'),(794,'Command: .guild info'),(795,'Command: .instance setbossstate'),(796,'Command: instance getbossstate'),(797,'Command: pvpstats'),(798,'Command: .mod xp'),(835,'Command: debug loadcells'),(836,'Command: .debug boundary'),(837,'Command: .npc evade'),(838,'Command: .pet level'),(839,'Command: .server shutdown force'),(840,'Command: .server restart force'),(841,'Command: .debug neargraveyard'); /*!40000 ALTER TABLE `rbac_permissions` ENABLE KEYS */; UNLOCK TABLES; @@ -486,7 +486,7 @@ CREATE TABLE `updates` ( LOCK TABLES `updates` WRITE; /*!40000 ALTER TABLE `updates` DISABLE KEYS */; -INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2015_08_21_00_auth.sql','C31A9E1D28E11B60BE8F8198637DD51F6D75123F','ARCHIVED','2015-10-05 23:16:19',0),('2015_11_07_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',92),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-13 00:00:00',0),('2016_04_11_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-04-11 03:18:17',0),('2016_05_11_00_auth.sql','95B66235B8D67BF1CA216EB09F313C1F8F393B47','RELEASED','2016-04-16 13:17:11',0),('2016_06_06_00_auth.sql','57603BB68C340A8C919FB424452C282C47A193F7','RELEASED','2016-06-06 18:20',0),('2016_09_22_00_auth.sql','70047954E3556BFA430ADD5680EF8797F74A4B9E','RELEASED','2016-09-22 00:00:00',0); +INSERT INTO `updates` VALUES ('2014_11_10_00_auth.sql','0E3CB119442D09DD88E967015319BBC8DAFBBFE0','ARCHIVED','2015-03-21 21:44:12',0),('2014_11_10_01_auth.sql','327E77A1DA3546D5275AB249915DD57EDD6FDD3D','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_10_00_auth.sql','821703A96D80F9080074852B5A46E2909C9562EA','ARCHIVED','2015-03-21 21:44:12',0),('2014_12_21_00_auth.sql','CE2E5D2CD82E79C25294539ADED27A1429105B43','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_00_auth.sql','E8C5B74BB45F0F35DEC182C72BACF435C7066FB0','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_01_auth.sql','862961815354DA2746F5F71FBC8155F57CBE75AB','ARCHIVED','2015-03-21 21:44:12',0),('2015_03_20_02_auth.sql','33E4F94086590768EF5D4855DD43D7DE7C06ADA4','ARCHIVED','2015-03-21 21:44:51',0),('2015_08_21_00_auth.sql','C31A9E1D28E11B60BE8F8198637DD51F6D75123F','ARCHIVED','2015-10-05 23:16:19',0),('2015_11_07_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 00:42:36',92),('2016_01_13_00_auth.sql','24615CC69B3CD7BB4699874647C35BA86E8A93FD','ARCHIVED','2016-01-13 00:00:00',0),('2016_04_11_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','ARCHIVED','2016-04-11 03:18:17',0),('2016_05_11_00_auth.sql','95B66235B8D67BF1CA216EB09F313C1F8F393B47','ARCHIVED','2016-04-16 13:17:11',0),('2016_06_06_00_auth.sql','A0A8D73A952D0618833416513D53F73A70E7EA25','ARCHIVED','2016-10-16 13:42:31',45),('2016_09_22_00_auth.sql','70047954E3556BFA430ADD5680EF8797F74A4B9E','ARCHIVED','2016-09-22 00:00:00',0),('2016_10_16_00_auth.sql','0ACDD35EC9745231BCFA701B78056DEF94D0CC53','RELEASED','2016-10-16 14:02:49',31); /*!40000 ALTER TABLE `updates` ENABLE KEYS */; UNLOCK TABLES; @@ -549,4 +549,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2016-04-11 2:32:16 +-- Dump completed on 2016-10-16 15:05:25 diff --git a/sql/base/characters_database.sql b/sql/base/characters_database.sql index 309f897a8f1..033cfe1b6c2 100644 --- a/sql/base/characters_database.sql +++ b/sql/base/characters_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64) +-- MySQL dump 10.16 Distrib 10.1.6-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: characters -- ------------------------------------------------------ --- Server version 5.6.26-log +-- Server version 5.7.14-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -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 */; @@ -698,10 +697,10 @@ DROP TABLE IF EXISTS `character_fishingsteps`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `character_fishingsteps` ( - `guid` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', - `fishingSteps` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0', + `guid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Global Unique Identifier', + `fishingSteps` tinyint(3) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guid`) -) ENGINE=INNODB DEFAULT CHARSET=utf8; +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!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','RELEASED','2016-04-11 03:18:17',0),('2016_09_13_00_characters.sql','27A04615B11B2CFC3A26778F52F74C071E4F9C54','RELEASED','2016-07-06 18:55:18',0); +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; @@ -2640,7 +2639,7 @@ CREATE TABLE `worldstates` ( LOCK TABLES `worldstates` WRITE; /*!40000 ALTER TABLE `worldstates` DISABLE KEYS */; -INSERT INTO `worldstates` VALUES (20001,0,'NextArenaPointDistributionTime'),(20002,0,'NextWeeklyQuestResetTime'),(20003,0,'NextBGRandomDailyResetTime'),(20004,0,'cleaning_flags'); +INSERT INTO `worldstates` VALUES (1,0,NULL),(2,0,NULL),(3,0,NULL),(4,0,NULL),(5,0,NULL),(6,0,NULL),(7,0,NULL),(8,0,NULL),(9,0,NULL),(10,0,NULL),(11,0,NULL),(12,0,NULL),(13,0,NULL),(14,1476626581,NULL),(15,1476626581,NULL),(16,0,NULL),(17,0,NULL),(18,1476626581,NULL),(19,0,NULL),(20,0,NULL),(21,0,NULL),(22,0,NULL),(23,0,NULL),(24,0,NULL),(25,0,NULL),(26,0,NULL),(27,1476626581,NULL),(28,0,NULL),(29,0,NULL),(30,0,NULL),(31,0,NULL),(32,0,NULL),(33,0,NULL),(34,1476626581,NULL),(35,0,NULL),(36,0,NULL),(37,0,NULL),(38,0,NULL),(39,0,NULL),(40,0,NULL),(41,0,NULL),(42,0,NULL),(43,0,NULL),(44,0,NULL),(45,0,NULL),(46,0,NULL),(47,0,NULL),(48,0,NULL),(49,0,NULL),(50,0,NULL),(51,0,NULL),(52,0,NULL),(53,0,NULL),(54,0,NULL),(55,0,NULL),(56,0,NULL),(57,0,NULL),(58,0,NULL),(59,0,NULL),(60,1476626581,NULL),(61,0,NULL),(62,1476626581,NULL),(63,0,NULL),(64,0,NULL),(65,0,NULL),(66,0,NULL),(67,0,NULL),(68,0,NULL),(69,0,NULL),(3781,9000000,NULL),(3801,0,NULL),(3802,1,NULL),(20001,0,'NextArenaPointDistributionTime'),(20002,1477230266,'NextWeeklyQuestResetTime'),(20003,1476680400,'NextBGRandomDailyResetTime'),(20004,0,'cleaning_flags'),(20006,1476680400,NULL),(20007,1477954800,NULL); /*!40000 ALTER TABLE `worldstates` ENABLE KEYS */; UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; @@ -2653,4 +2652,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2016-04-11 2:32:17 +-- Dump completed on 2016-10-16 15:05:25 diff --git a/sql/base/dev/world_database.sql b/sql/base/dev/world_database.sql index 85e7c2391da..67439898760 100644 --- a/sql/base/dev/world_database.sql +++ b/sql/base/dev/world_database.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64) +-- MySQL dump 10.16 Distrib 10.1.6-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: world -- ------------------------------------------------------ --- Server version 5.6.26-log +-- Server version 5.7.14-log /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -992,21 +992,6 @@ CREATE TABLE `game_event_seasonal_questrelation` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `game_graveyard_zone` --- - -DROP TABLE IF EXISTS `game_graveyard_zone`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `game_graveyard_zone` ( - `id` mediumint(8) unsigned NOT NULL DEFAULT '0', - `ghost_zone` mediumint(8) unsigned NOT NULL DEFAULT '0', - `faction` smallint(5) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`id`,`ghost_zone`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- -- Table structure for table `game_tele` -- @@ -1091,6 +1076,10 @@ DROP TABLE IF EXISTS `gameobject_addon`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `gameobject_addon` ( `guid` int(10) unsigned NOT NULL DEFAULT '0', + `parent_rotation0` float NOT NULL DEFAULT '0', + `parent_rotation1` float NOT NULL DEFAULT '0', + `parent_rotation2` float NOT NULL DEFAULT '0', + `parent_rotation3` float NOT NULL DEFAULT '1', `invisibilityType` tinyint(3) unsigned NOT NULL DEFAULT '0', `invisibilityValue` int(10) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`guid`) @@ -1178,8 +1167,6 @@ CREATE TABLE `gameobject_template` ( `IconName` varchar(100) NOT NULL DEFAULT '', `castBarCaption` varchar(100) NOT NULL DEFAULT '', `unk1` varchar(100) NOT NULL DEFAULT '', - `faction` smallint(5) unsigned NOT NULL DEFAULT '0', - `flags` int(10) unsigned NOT NULL DEFAULT '0', `size` float NOT NULL DEFAULT '1', `Data0` int(10) unsigned NOT NULL DEFAULT '0', `Data1` int(11) NOT NULL DEFAULT '0', @@ -1214,6 +1201,23 @@ CREATE TABLE `gameobject_template` ( /*!40101 SET character_set_client = @saved_cs_client */; -- +-- Table structure for table `gameobject_template_addon` +-- + +DROP TABLE IF EXISTS `gameobject_template_addon`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `gameobject_template_addon` ( + `entry` mediumint(8) unsigned NOT NULL DEFAULT '0', + `faction` smallint(5) unsigned NOT NULL DEFAULT '0', + `flags` int(10) unsigned NOT NULL DEFAULT '0', + `mingold` mediumint(8) unsigned NOT NULL DEFAULT '0', + `maxgold` mediumint(8) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- -- Table structure for table `gameobject_template_locale` -- @@ -1240,6 +1244,7 @@ DROP TABLE IF EXISTS `gossip_menu`; CREATE TABLE `gossip_menu` ( `entry` smallint(5) unsigned NOT NULL DEFAULT '0', `text_id` mediumint(8) unsigned NOT NULL DEFAULT '0', + `VerifiedBuild` smallint(5) NOT NULL DEFAULT '0', PRIMARY KEY (`entry`,`text_id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -1265,11 +1270,28 @@ CREATE TABLE `gossip_menu_option` ( `box_money` int(10) unsigned NOT NULL DEFAULT '0', `box_text` text, `BoxBroadcastTextID` mediumint(6) NOT NULL DEFAULT '0', + `VerifiedBuild` smallint(5) NOT NULL DEFAULT '0', PRIMARY KEY (`menu_id`,`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- +-- Table structure for table `graveyard_zone` +-- + +DROP TABLE IF EXISTS `graveyard_zone`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `graveyard_zone` ( + `ID` mediumint(8) unsigned NOT NULL DEFAULT '0', + `GhostZone` mediumint(8) unsigned NOT NULL DEFAULT '0', + `Faction` smallint(5) unsigned NOT NULL DEFAULT '0', + `Comment` text, + PRIMARY KEY (`ID`,`GhostZone`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Trigger System'; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- -- Table structure for table `instance_encounters` -- @@ -2493,6 +2515,21 @@ CREATE TABLE `playercreateinfo_action` ( /*!40101 SET character_set_client = @saved_cs_client */; -- +-- Table structure for table `playercreateinfo_cast_spell` +-- + +DROP TABLE IF EXISTS `playercreateinfo_cast_spell`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `playercreateinfo_cast_spell` ( + `raceMask` int(10) unsigned NOT NULL DEFAULT '0', + `classMask` int(10) unsigned NOT NULL DEFAULT '0', + `spell` mediumint(8) unsigned NOT NULL DEFAULT '0', + `note` varchar(255) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- -- Table structure for table `playercreateinfo_item` -- @@ -2688,6 +2725,20 @@ CREATE TABLE `quest_details` ( /*!40101 SET character_set_client = @saved_cs_client */; -- +-- Table structure for table `quest_mail_sender` +-- + +DROP TABLE IF EXISTS `quest_mail_sender`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `quest_mail_sender` ( + `QuestId` int(5) unsigned NOT NULL DEFAULT '0', + `RewardMailSenderEntry` int(5) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`QuestId`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- -- Table structure for table `quest_offer_reward` -- @@ -2982,6 +3033,42 @@ CREATE TABLE `reputation_spillover_template` ( /*!40101 SET character_set_client = @saved_cs_client */; -- +-- Table structure for table `script_spline_chain_meta` +-- + +DROP TABLE IF EXISTS `script_spline_chain_meta`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `script_spline_chain_meta` ( + `entry` int(10) unsigned NOT NULL, + `chainId` smallint(5) unsigned NOT NULL, + `splineId` tinyint(3) unsigned NOT NULL, + `expectedDuration` int(10) unsigned NOT NULL, + `msUntilNext` int(10) unsigned NOT NULL, + PRIMARY KEY (`entry`,`chainId`,`splineId`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `script_spline_chain_waypoints` +-- + +DROP TABLE IF EXISTS `script_spline_chain_waypoints`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `script_spline_chain_waypoints` ( + `entry` int(10) unsigned NOT NULL, + `chainId` smallint(5) unsigned NOT NULL, + `splineId` tinyint(3) unsigned NOT NULL, + `wpId` tinyint(3) unsigned NOT NULL, + `x` float NOT NULL, + `y` float NOT NULL, + `z` float NOT NULL, + PRIMARY KEY (`entry`,`chainId`,`splineId`,`wpId`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- -- Table structure for table `script_waypoint` -- @@ -3099,7 +3186,7 @@ CREATE TABLE `smart_scripts` ( `event_type` tinyint(3) unsigned NOT NULL DEFAULT '0', `event_phase_mask` tinyint(3) unsigned NOT NULL DEFAULT '0', `event_chance` tinyint(3) unsigned NOT NULL DEFAULT '100', - `event_flags` tinyint(3) unsigned NOT NULL DEFAULT '0', + `event_flags` smallint(3) unsigned NOT NULL DEFAULT '0', `event_param1` int(10) unsigned NOT NULL DEFAULT '0', `event_param2` int(10) unsigned NOT NULL DEFAULT '0', `event_param3` int(10) unsigned NOT NULL DEFAULT '0', @@ -3407,45 +3494,22 @@ DROP TABLE IF EXISTS `spell_proc`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `spell_proc` ( - `spellId` mediumint(8) NOT NULL DEFAULT '0', - `schoolMask` tinyint(4) NOT NULL DEFAULT '0', - `spellFamilyName` smallint(5) unsigned NOT NULL DEFAULT '0', - `spellFamilyMask0` int(10) unsigned NOT NULL DEFAULT '0', - `spellFamilyMask1` int(10) unsigned NOT NULL DEFAULT '0', - `spellFamilyMask2` int(10) unsigned NOT NULL DEFAULT '0', - `typeMask` int(10) unsigned NOT NULL DEFAULT '0', - `spellTypeMask` int(10) unsigned NOT NULL DEFAULT '0', - `spellPhaseMask` int(11) NOT NULL DEFAULT '0', - `hitMask` int(11) NOT NULL DEFAULT '0', - `attributesMask` int(10) unsigned NOT NULL DEFAULT '0', - `ratePerMinute` float NOT NULL DEFAULT '0', - `chance` float NOT NULL DEFAULT '0', - `cooldown` float unsigned NOT NULL DEFAULT '0', - `charges` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`spellId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Table structure for table `spell_proc_event` --- - -DROP TABLE IF EXISTS `spell_proc_event`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8 */; -CREATE TABLE `spell_proc_event` ( - `entry` mediumint(8) NOT NULL DEFAULT '0', - `SchoolMask` tinyint(4) NOT NULL DEFAULT '0', + `SpellId` int(11) NOT NULL DEFAULT '0', + `SchoolMask` tinyint(3) unsigned NOT NULL DEFAULT '0', `SpellFamilyName` smallint(5) unsigned NOT NULL DEFAULT '0', `SpellFamilyMask0` int(10) unsigned NOT NULL DEFAULT '0', `SpellFamilyMask1` int(10) unsigned NOT NULL DEFAULT '0', `SpellFamilyMask2` int(10) unsigned NOT NULL DEFAULT '0', - `procFlags` int(10) unsigned NOT NULL DEFAULT '0', - `procEx` int(10) unsigned NOT NULL DEFAULT '0', - `ppmRate` float NOT NULL DEFAULT '0', - `CustomChance` float NOT NULL DEFAULT '0', + `ProcFlags` int(10) unsigned NOT NULL DEFAULT '0', + `SpellTypeMask` int(10) unsigned NOT NULL DEFAULT '0', + `SpellPhaseMask` int(10) unsigned NOT NULL DEFAULT '0', + `HitMask` int(10) unsigned NOT NULL DEFAULT '0', + `AttributesMask` int(10) unsigned NOT NULL DEFAULT '0', + `ProcsPerMinute` float NOT NULL DEFAULT '0', + `Chance` float NOT NULL DEFAULT '0', `Cooldown` int(10) unsigned NOT NULL DEFAULT '0', - PRIMARY KEY (`entry`) + `Charges` tinyint(3) unsigned NOT NULL DEFAULT '0', + PRIMARY KEY (`SpellId`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; @@ -3677,7 +3741,7 @@ CREATE TABLE `vehicle_template_accessory` ( /*!40101 SET character_set_client = @saved_cs_client */; -- --- Table structure for table `version` +-- Temporary table structure for view `version` -- DROP TABLE IF EXISTS `version`; @@ -3785,4 +3849,4 @@ CREATE TABLE `waypoints` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2016-04-11 2:32:19 +-- Dump completed on 2016-10-16 15:05:26 diff --git a/sql/updates/auth/3.3.5/2016_04_11_00_auth.sql b/sql/old/3.3.5a/auth/61_2016_10_17/2016_04_11_00_auth.sql index be8a4d21b66..be8a4d21b66 100644 --- a/sql/updates/auth/3.3.5/2016_04_11_00_auth.sql +++ b/sql/old/3.3.5a/auth/61_2016_10_17/2016_04_11_00_auth.sql diff --git a/sql/updates/auth/3.3.5/2016_05_11_00_auth.sql b/sql/old/3.3.5a/auth/61_2016_10_17/2016_05_11_00_auth.sql index 254f3d801d6..254f3d801d6 100644 --- a/sql/updates/auth/3.3.5/2016_05_11_00_auth.sql +++ b/sql/old/3.3.5a/auth/61_2016_10_17/2016_05_11_00_auth.sql diff --git a/sql/updates/auth/3.3.5/2016_06_06_00_auth.sql b/sql/old/3.3.5a/auth/61_2016_10_17/2016_06_06_00_auth.sql index 0e203d847ae..0e203d847ae 100644 --- a/sql/updates/auth/3.3.5/2016_06_06_00_auth.sql +++ b/sql/old/3.3.5a/auth/61_2016_10_17/2016_06_06_00_auth.sql diff --git a/sql/updates/auth/3.3.5/2016_09_22_00_auth.sql b/sql/old/3.3.5a/auth/61_2016_10_17/2016_09_22_00_auth.sql index 324bd800ad2..324bd800ad2 100644 --- a/sql/updates/auth/3.3.5/2016_09_22_00_auth.sql +++ b/sql/old/3.3.5a/auth/61_2016_10_17/2016_09_22_00_auth.sql diff --git a/sql/updates/characters/3.3.5/2016_04_11_00_characters.sql b/sql/old/3.3.5a/characters/61_2016_10_17/2016_04_11_00_characters.sql index be8a4d21b66..be8a4d21b66 100644 --- a/sql/updates/characters/3.3.5/2016_04_11_00_characters.sql +++ b/sql/old/3.3.5a/characters/61_2016_10_17/2016_04_11_00_characters.sql diff --git a/sql/updates/characters/3.3.5/2016_09_13_00_characters.sql b/sql/old/3.3.5a/characters/61_2016_10_17/2016_09_13_00_characters.sql index 9fa61d633ce..9fa61d633ce 100644 --- a/sql/updates/characters/3.3.5/2016_09_13_00_characters.sql +++ b/sql/old/3.3.5a/characters/61_2016_10_17/2016_09_13_00_characters.sql diff --git a/sql/updates/world/3.3.5/2016_04_11_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_11_00_world.sql index 2f8d539fe43..2f8d539fe43 100644 --- a/sql/updates/world/3.3.5/2016_04_11_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_11_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_11_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_11_01_world_335.sql index a432307d0b1..a432307d0b1 100644 --- a/sql/updates/world/3.3.5/2016_04_11_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_11_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_04_11_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_11_02_world_335.sql index 93b6000554c..93b6000554c 100644 --- a/sql/updates/world/3.3.5/2016_04_11_02_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_11_02_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_04_15_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_15_03_world_335.sql index afbe3b3ab63..afbe3b3ab63 100644 --- a/sql/updates/world/3.3.5/2016_04_15_03_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_15_03_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_04_16_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_00_world.sql index 9219a4ef316..9219a4ef316 100644 --- a/sql/updates/world/3.3.5/2016_04_16_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_16_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_01_world.sql index 95a8f0934ad..95a8f0934ad 100644 --- a/sql/updates/world/3.3.5/2016_04_16_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_16_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_02_world.sql index 82982753067..82982753067 100644 --- a/sql/updates/world/3.3.5/2016_04_16_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_16_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_03_world.sql index c6a6e1b07de..c6a6e1b07de 100644 --- a/sql/updates/world/3.3.5/2016_04_16_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_16_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_04_world.sql index 75d241b62f4..75d241b62f4 100644 --- a/sql/updates/world/3.3.5/2016_04_16_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_16_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_17_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_00_world.sql index ebfbdb1d008..ebfbdb1d008 100644 --- a/sql/updates/world/3.3.5/2016_04_17_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_17_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_01_world.sql index f57f73c925d..f57f73c925d 100644 --- a/sql/updates/world/3.3.5/2016_04_17_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_17_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_02_world.sql index e63928925df..e63928925df 100644 --- a/sql/updates/world/3.3.5/2016_04_17_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_17_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_03_world.sql index 3dc63f55637..3dc63f55637 100644 --- a/sql/updates/world/3.3.5/2016_04_17_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_17_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_04_world.sql index b284dca323e..b284dca323e 100644 --- a/sql/updates/world/3.3.5/2016_04_17_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_17_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_20_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_00_world.sql index 776254b8fb9..776254b8fb9 100644 --- a/sql/updates/world/3.3.5/2016_04_20_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_20_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_01_world.sql index 19bd02a91f5..19bd02a91f5 100644 --- a/sql/updates/world/3.3.5/2016_04_20_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_20_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_02_world.sql index 743f1fdab50..743f1fdab50 100644 --- a/sql/updates/world/3.3.5/2016_04_20_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_20_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_03_world.sql index 11fc8de7329..11fc8de7329 100644 --- a/sql/updates/world/3.3.5/2016_04_20_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_20_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_22_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_22_00_world.sql index e98ef9cf7e6..e98ef9cf7e6 100644 --- a/sql/updates/world/3.3.5/2016_04_22_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_23_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_23_00_world.sql index fe5d5c7ccb6..fe5d5c7ccb6 100644 --- a/sql/updates/world/3.3.5/2016_04_23_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_23_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_23_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_23_01_world.sql index d1be7adacfc..d1be7adacfc 100644 --- a/sql/updates/world/3.3.5/2016_04_23_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_23_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_23_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_23_02_world.sql index e3806947c9c..e3806947c9c 100644 --- a/sql/updates/world/3.3.5/2016_04_23_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_23_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_24_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_24_00_world_335.sql index b6b42fb0846..b6b42fb0846 100644 --- a/sql/updates/world/3.3.5/2016_04_24_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_24_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_04_24_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_24_01_world.sql index 0d9f3aa6bd7..0d9f3aa6bd7 100644 --- a/sql/updates/world/3.3.5/2016_04_24_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_24_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_25_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_00_world.sql index 2c603dc5d64..2c603dc5d64 100644 --- a/sql/updates/world/3.3.5/2016_04_25_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_25_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_01_world.sql index f83b99f1710..f83b99f1710 100644 --- a/sql/updates/world/3.3.5/2016_04_25_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_25_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_02_world.sql index 31d98dd616c..31d98dd616c 100644 --- a/sql/updates/world/3.3.5/2016_04_25_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_25_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_03_world.sql index 7bbd279e943..7bbd279e943 100644 --- a/sql/updates/world/3.3.5/2016_04_25_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_25_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_26_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_00_world.sql index 72201221944..72201221944 100644 --- a/sql/updates/world/3.3.5/2016_04_26_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_26_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_01_world.sql index 2021a40a9e7..2021a40a9e7 100644 --- a/sql/updates/world/3.3.5/2016_04_26_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_26_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_02_world.sql index 4df837e0d8f..4df837e0d8f 100644 --- a/sql/updates/world/3.3.5/2016_04_26_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_26_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_03_world.sql index 659006afcef..659006afcef 100644 --- a/sql/updates/world/3.3.5/2016_04_26_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_26_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_28_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_28_00_world.sql index 377f019f899..377f019f899 100644 --- a/sql/updates/world/3.3.5/2016_04_28_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_28_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_29_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_29_00_world.sql index 14c700c0795..14c700c0795 100644 --- a/sql/updates/world/3.3.5/2016_04_29_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_29_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_04_29_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_29_01_world.sql index c5b0311e1bc..c5b0311e1bc 100644 --- a/sql/updates/world/3.3.5/2016_04_29_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_04_29_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_01_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_01_00_world.sql index 5a4d6c3197e..5a4d6c3197e 100644 --- a/sql/updates/world/3.3.5/2016_05_01_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_01_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_01_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_01_01_world.sql index 30096e55335..30096e55335 100644 --- a/sql/updates/world/3.3.5/2016_05_01_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_01_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_02_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_02_00_world.sql index 2063baf1ad7..2063baf1ad7 100644 --- a/sql/updates/world/3.3.5/2016_05_02_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_02_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_02_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_02_01_world.sql index 1671abee38f..1671abee38f 100644 --- a/sql/updates/world/3.3.5/2016_05_02_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_02_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_04_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_04_00_world.sql index e4043768774..e4043768774 100644 --- a/sql/updates/world/3.3.5/2016_05_04_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_04_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_04_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_04_01_world.sql index 8a40bd66b2a..8a40bd66b2a 100644 --- a/sql/updates/world/3.3.5/2016_05_04_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_04_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_04_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_04_02_world.sql index 4bb7870a4ea..4bb7870a4ea 100644 --- a/sql/updates/world/3.3.5/2016_05_04_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_04_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_05_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_05_00_world.sql index ba99f5df1a6..ba99f5df1a6 100644 --- a/sql/updates/world/3.3.5/2016_05_05_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_05_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_05_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_05_01_world.sql index d1e0ebcadb0..d1e0ebcadb0 100644 --- a/sql/updates/world/3.3.5/2016_05_05_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_05_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_07_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_07_00_world.sql index 41a35083921..41a35083921 100644 --- a/sql/updates/world/3.3.5/2016_05_07_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_07_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_07_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_07_01_world.sql index 1479c1bfba2..1479c1bfba2 100644 --- a/sql/updates/world/3.3.5/2016_05_07_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_07_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_08_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_08_00_world.sql index cfbe1f6b9ad..cfbe1f6b9ad 100644 --- a/sql/updates/world/3.3.5/2016_05_08_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_08_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_09_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_00_world.sql index 3c21ed52350..3c21ed52350 100644 --- a/sql/updates/world/3.3.5/2016_05_09_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_09_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_01_world.sql index b75eb63dd2b..b75eb63dd2b 100644 --- a/sql/updates/world/3.3.5/2016_05_09_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_09_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_02_world.sql index 968ac92561e..968ac92561e 100644 --- a/sql/updates/world/3.3.5/2016_05_09_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_09_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_03_world.sql index 149d829c9f7..149d829c9f7 100644 --- a/sql/updates/world/3.3.5/2016_05_09_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_09_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_04_world.sql index 111b000efeb..111b000efeb 100644 --- a/sql/updates/world/3.3.5/2016_05_09_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_09_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_11_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_11_00_world.sql index 9be7c8d3a0d..9be7c8d3a0d 100644 --- a/sql/updates/world/3.3.5/2016_05_11_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_11_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_11_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_11_01_world.sql index 95fa08ab742..95fa08ab742 100644 --- a/sql/updates/world/3.3.5/2016_05_11_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_11_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_20_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_20_00_world.sql index 67fc3e7a5d7..67fc3e7a5d7 100644 --- a/sql/updates/world/3.3.5/2016_05_20_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_20_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_23_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_23_00_world.sql index b2b9b9b0b34..b2b9b9b0b34 100644 --- a/sql/updates/world/3.3.5/2016_05_23_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_23_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_24_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_24_00_world.sql index b07a3288642..b07a3288642 100644 --- a/sql/updates/world/3.3.5/2016_05_24_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_24_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_24_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_24_01_world.sql index 58ac4b0a40e..58ac4b0a40e 100644 --- a/sql/updates/world/3.3.5/2016_05_24_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_24_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_25_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_25_00_world.sql index 401f374d81a..401f374d81a 100644 --- a/sql/updates/world/3.3.5/2016_05_25_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_25_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_25_01_world_335.sql index 603e8921a69..603e8921a69 100644 --- a/sql/updates/world/3.3.5/2016_05_25_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_25_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_00_world.sql index 39e16aba39e..39e16aba39e 100644 --- a/sql/updates/world/3.3.5/2016_05_26_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_01_world.sql index 343bc6f0a17..343bc6f0a17 100644 --- a/sql/updates/world/3.3.5/2016_05_26_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_02_world.sql index 4cacdc73a47..4cacdc73a47 100644 --- a/sql/updates/world/3.3.5/2016_05_26_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_03_world.sql index f3a419e9bd0..f3a419e9bd0 100644 --- a/sql/updates/world/3.3.5/2016_05_26_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_04_world.sql index 00ae15af434..00ae15af434 100644 --- a/sql/updates/world/3.3.5/2016_05_26_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_05_world.sql index 192ea0893d3..192ea0893d3 100644 --- a/sql/updates/world/3.3.5/2016_05_26_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_06_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_06_world_335.sql index 0b8903f527d..0b8903f527d 100644 --- a/sql/updates/world/3.3.5/2016_05_26_06_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_06_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_07_world.sql index 0749f080581..0749f080581 100644 --- a/sql/updates/world/3.3.5/2016_05_26_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_08_world.sql index af1d7a3d515..af1d7a3d515 100644 --- a/sql/updates/world/3.3.5/2016_05_26_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_26_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_09_world.sql index 0ad751a01d4..0ad751a01d4 100644 --- a/sql/updates/world/3.3.5/2016_05_26_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_26_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_28_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_00_world.sql index 602f7834cd8..602f7834cd8 100644 --- a/sql/updates/world/3.3.5/2016_05_28_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_28_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_01_world.sql index 0ce802fd363..0ce802fd363 100644 --- a/sql/updates/world/3.3.5/2016_05_28_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_28_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_02_world_335.sql index b0db2e7c4e9..b0db2e7c4e9 100644 --- a/sql/updates/world/3.3.5/2016_05_28_02_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_02_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_05_28_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_03_world.sql index 69ee8803260..69ee8803260 100644 --- a/sql/updates/world/3.3.5/2016_05_28_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_28_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_00_world.sql index b6fdc5f3b89..b6fdc5f3b89 100644 --- a/sql/updates/world/3.3.5/2016_05_30_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_01_world.sql index a18ffe23ed5..a18ffe23ed5 100644 --- a/sql/updates/world/3.3.5/2016_05_30_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_02_world.sql index 2742f9c8ca9..2742f9c8ca9 100644 --- a/sql/updates/world/3.3.5/2016_05_30_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_03_world.sql index eeaa7bf6d7b..eeaa7bf6d7b 100644 --- a/sql/updates/world/3.3.5/2016_05_30_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_04_world.sql index 0fc9244c100..0fc9244c100 100644 --- a/sql/updates/world/3.3.5/2016_05_30_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_05_world.sql index 7209b3d8745..7209b3d8745 100644 --- a/sql/updates/world/3.3.5/2016_05_30_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_06_world.sql index 5c81fcd5419..5c81fcd5419 100644 --- a/sql/updates/world/3.3.5/2016_05_30_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_07_world.sql index c8130b023af..c8130b023af 100644 --- a/sql/updates/world/3.3.5/2016_05_30_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_08_world.sql index 134617b0380..134617b0380 100644 --- a/sql/updates/world/3.3.5/2016_05_30_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_09_world.sql index 3ec588d0982..3ec588d0982 100644 --- a/sql/updates/world/3.3.5/2016_05_30_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_30_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_10_world.sql index b8dbe0b94a6..b8dbe0b94a6 100644 --- a/sql/updates/world/3.3.5/2016_05_30_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_30_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_00_world.sql index 29a29413167..29a29413167 100644 --- a/sql/updates/world/3.3.5/2016_05_31_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_01_world_335.sql index 2d92a9fc537..2d92a9fc537 100644 --- a/sql/updates/world/3.3.5/2016_05_31_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_02_world.sql index 09674385ab4..09674385ab4 100644 --- a/sql/updates/world/3.3.5/2016_05_31_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_03_world.sql index 60c07d15735..60c07d15735 100644 --- a/sql/updates/world/3.3.5/2016_05_31_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_04_world.sql index d3ddfcfa05c..d3ddfcfa05c 100644 --- a/sql/updates/world/3.3.5/2016_05_31_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_05_world.sql index 18bbf61baa4..18bbf61baa4 100644 --- a/sql/updates/world/3.3.5/2016_05_31_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_06_world.sql index 46d8b875c82..46d8b875c82 100644 --- a/sql/updates/world/3.3.5/2016_05_31_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_07_world.sql index 7ed017ff1cd..7ed017ff1cd 100644 --- a/sql/updates/world/3.3.5/2016_05_31_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_08_world.sql index 2cf3fbcdfc4..2cf3fbcdfc4 100644 --- a/sql/updates/world/3.3.5/2016_05_31_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_09_world.sql index 73d62a92772..73d62a92772 100644 --- a/sql/updates/world/3.3.5/2016_05_31_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_10_world.sql index e7536b3a51a..e7536b3a51a 100644 --- a/sql/updates/world/3.3.5/2016_05_31_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_11_world.sql index e5d35f5eb42..e5d35f5eb42 100644 --- a/sql/updates/world/3.3.5/2016_05_31_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_12_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_12_world_335.sql index b20c38b36ba..b20c38b36ba 100644 --- a/sql/updates/world/3.3.5/2016_05_31_12_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_12_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_13_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_13_world.sql index 6dd3d984c1c..6dd3d984c1c 100644 --- a/sql/updates/world/3.3.5/2016_05_31_13_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_13_world.sql diff --git a/sql/updates/world/3.3.5/2016_05_31_14_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_14_world_335.sql index 496a9645bda..496a9645bda 100644 --- a/sql/updates/world/3.3.5/2016_05_31_14_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_05_31_14_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_00_world.sql index 5f4e7dbb01c..5f4e7dbb01c 100644 --- a/sql/updates/world/3.3.5/2016_06_01_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_01_world.sql index 80ecabe34aa..80ecabe34aa 100644 --- a/sql/updates/world/3.3.5/2016_06_01_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_02_world.sql index e2c27b15339..e2c27b15339 100644 --- a/sql/updates/world/3.3.5/2016_06_01_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_03_world.sql index 54beb26b15c..54beb26b15c 100644 --- a/sql/updates/world/3.3.5/2016_06_01_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_04_world.sql index 1de1716102b..1de1716102b 100644 --- a/sql/updates/world/3.3.5/2016_06_01_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_05_world.sql index 3d7a32ac308..3d7a32ac308 100644 --- a/sql/updates/world/3.3.5/2016_06_01_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_06_world.sql index 9344147e067..9344147e067 100644 --- a/sql/updates/world/3.3.5/2016_06_01_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_07_world.sql index 9c159c54cb6..9c159c54cb6 100644 --- a/sql/updates/world/3.3.5/2016_06_01_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_08_world.sql index 356c0561bf2..356c0561bf2 100644 --- a/sql/updates/world/3.3.5/2016_06_01_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_09_world.sql index 5cf06521a19..5cf06521a19 100644 --- a/sql/updates/world/3.3.5/2016_06_01_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_10_world.sql index abc358431e3..abc358431e3 100644 --- a/sql/updates/world/3.3.5/2016_06_01_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_11_world.sql index dc0b7b05a33..dc0b7b05a33 100644 --- a/sql/updates/world/3.3.5/2016_06_01_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_01_12_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_12_world.sql index f6fb906bb70..f6fb906bb70 100644 --- a/sql/updates/world/3.3.5/2016_06_01_12_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_01_12_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_02_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_02_00_world.sql index b192efa6814..b192efa6814 100644 --- a/sql/updates/world/3.3.5/2016_06_02_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_02_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_02_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_02_01_world.sql index 792f221e344..792f221e344 100644 --- a/sql/updates/world/3.3.5/2016_06_02_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_02_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_04_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_04_00_world.sql index e44fe54de55..e44fe54de55 100644 --- a/sql/updates/world/3.3.5/2016_06_04_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_04_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_04_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_04_01_world.sql index fb048449d40..fb048449d40 100644 --- a/sql/updates/world/3.3.5/2016_06_04_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_04_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_00_world.sql index 6da2282d424..6da2282d424 100644 --- a/sql/updates/world/3.3.5/2016_06_05_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_01_world.sql index 444a5be17ed..444a5be17ed 100644 --- a/sql/updates/world/3.3.5/2016_06_05_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_02_world.sql index cab093eb88f..cab093eb88f 100644 --- a/sql/updates/world/3.3.5/2016_06_05_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_03_world.sql index d9bd5ecab2c..d9bd5ecab2c 100644 --- a/sql/updates/world/3.3.5/2016_06_05_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_04_world.sql index fdf6b535f8d..fdf6b535f8d 100644 --- a/sql/updates/world/3.3.5/2016_06_05_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_05_world.sql index 9c69b2d7639..9c69b2d7639 100644 --- a/sql/updates/world/3.3.5/2016_06_05_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_06_world.sql index 5d63a2c7e37..5d63a2c7e37 100644 --- a/sql/updates/world/3.3.5/2016_06_05_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_07_world.sql index 71d39603080..71d39603080 100644 --- a/sql/updates/world/3.3.5/2016_06_05_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_08_world.sql index a2f5c580f92..a2f5c580f92 100644 --- a/sql/updates/world/3.3.5/2016_06_05_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_09_world.sql index 98f707aafcd..98f707aafcd 100644 --- a/sql/updates/world/3.3.5/2016_06_05_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_10_world.sql index 66c6e8dbc7c..66c6e8dbc7c 100644 --- a/sql/updates/world/3.3.5/2016_06_05_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_11_world.sql index 3a76d73f9ab..3a76d73f9ab 100644 --- a/sql/updates/world/3.3.5/2016_06_05_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_05_12_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_12_world.sql index a446260985f..a446260985f 100644 --- a/sql/updates/world/3.3.5/2016_06_05_12_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_05_12_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_06_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_06_00_world.sql index 61d93dab677..61d93dab677 100644 --- a/sql/updates/world/3.3.5/2016_06_06_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_06_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_06_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_06_01_world.sql index fc47dc4bf14..fc47dc4bf14 100644 --- a/sql/updates/world/3.3.5/2016_06_06_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_06_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_07_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_07_00_world.sql index fbe7c362718..fbe7c362718 100644 --- a/sql/updates/world/3.3.5/2016_06_07_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_07_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_07_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_07_01_world.sql index 09e86bc0396..09e86bc0396 100644 --- a/sql/updates/world/3.3.5/2016_06_07_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_07_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_00_world.sql index f3a8ec3d6e8..f3a8ec3d6e8 100644 --- a/sql/updates/world/3.3.5/2016_06_09_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_01_world.sql index b29242b6038..b29242b6038 100644 --- a/sql/updates/world/3.3.5/2016_06_09_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_02_world.sql index b2a7d985a9f..b2a7d985a9f 100644 --- a/sql/updates/world/3.3.5/2016_06_09_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_03_world_335.sql index c4be18500b9..c4be18500b9 100644 --- a/sql/updates/world/3.3.5/2016_06_09_03_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_03_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_04_world.sql index ecff9eb7ce6..ecff9eb7ce6 100644 --- a/sql/updates/world/3.3.5/2016_06_09_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_05_world.sql index 50c99117c03..50c99117c03 100644 --- a/sql/updates/world/3.3.5/2016_06_09_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_09_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_06_world.sql index 9037a2a2fe5..9037a2a2fe5 100644 --- a/sql/updates/world/3.3.5/2016_06_09_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_09_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_00_world.sql index ea81a3ce563..ea81a3ce563 100644 --- a/sql/updates/world/3.3.5/2016_06_11_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_01_world.sql index c7185f6642c..c7185f6642c 100644 --- a/sql/updates/world/3.3.5/2016_06_11_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_02_world.sql index ac5d1f6037c..ac5d1f6037c 100644 --- a/sql/updates/world/3.3.5/2016_06_11_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_03_world.sql index 47e3aefa366..47e3aefa366 100644 --- a/sql/updates/world/3.3.5/2016_06_11_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_04_world.sql index f45f868006b..f45f868006b 100644 --- a/sql/updates/world/3.3.5/2016_06_11_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_05_world.sql index 8c088c6f139..8c088c6f139 100644 --- a/sql/updates/world/3.3.5/2016_06_11_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_06_world.sql index 12def3cc386..12def3cc386 100644 --- a/sql/updates/world/3.3.5/2016_06_11_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_07_world.sql index 2e05fbac8fc..2e05fbac8fc 100644 --- a/sql/updates/world/3.3.5/2016_06_11_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_08_world.sql index be72014d0ba..be72014d0ba 100644 --- a/sql/updates/world/3.3.5/2016_06_11_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_09_world.sql index 71368bfb9c2..71368bfb9c2 100644 --- a/sql/updates/world/3.3.5/2016_06_11_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_10_world.sql index 68f5151dc87..68f5151dc87 100644 --- a/sql/updates/world/3.3.5/2016_06_11_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_11_world.sql index 86e6fa082b2..86e6fa082b2 100644 --- a/sql/updates/world/3.3.5/2016_06_11_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_11_12_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_12_world.sql index be2587e862a..be2587e862a 100644 --- a/sql/updates/world/3.3.5/2016_06_11_12_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_11_12_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_00_world_335.sql index 7e96065243c..7e96065243c 100644 --- a/sql/updates/world/3.3.5/2016_06_12_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_01_world.sql index 62e2c2cc600..62e2c2cc600 100644 --- a/sql/updates/world/3.3.5/2016_06_12_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_02_world.sql index dc1709d6d2f..dc1709d6d2f 100644 --- a/sql/updates/world/3.3.5/2016_06_12_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_03_world.sql index c1864e88bc3..c1864e88bc3 100644 --- a/sql/updates/world/3.3.5/2016_06_12_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_04_world.sql index 718394bc63b..718394bc63b 100644 --- a/sql/updates/world/3.3.5/2016_06_12_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_05_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_05_world_335.sql index 18ac159672b..18ac159672b 100644 --- a/sql/updates/world/3.3.5/2016_06_12_05_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_05_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_06_world.sql index d3522334766..d3522334766 100644 --- a/sql/updates/world/3.3.5/2016_06_12_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_07_world.sql index 259975e8f14..259975e8f14 100644 --- a/sql/updates/world/3.3.5/2016_06_12_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_08_world.sql index c39e59c7ec8..c39e59c7ec8 100644 --- a/sql/updates/world/3.3.5/2016_06_12_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_12_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_09_world.sql index 19772c101ab..19772c101ab 100644 --- a/sql/updates/world/3.3.5/2016_06_12_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_12_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_00_world.sql index 287fb53747e..287fb53747e 100644 --- a/sql/updates/world/3.3.5/2016_06_13_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_01_world.sql index 85d48c5a742..85d48c5a742 100644 --- a/sql/updates/world/3.3.5/2016_06_13_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_02_world_335.sql index ff2313c700b..ff2313c700b 100644 --- a/sql/updates/world/3.3.5/2016_06_13_02_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_02_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_03_world_335.sql index c4d80e13405..c4d80e13405 100644 --- a/sql/updates/world/3.3.5/2016_06_13_03_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_03_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_04_world.sql index d2ad9c21b39..d2ad9c21b39 100644 --- a/sql/updates/world/3.3.5/2016_06_13_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_05_world.sql index b19f167a81a..b19f167a81a 100644 --- a/sql/updates/world/3.3.5/2016_06_13_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_13_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_06_world.sql index 4ca697f1266..4ca697f1266 100644 --- a/sql/updates/world/3.3.5/2016_06_13_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_13_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_14_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_00_world.sql index 536298da2f9..536298da2f9 100644 --- a/sql/updates/world/3.3.5/2016_06_14_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_14_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_01_world.sql index 63bc2f9d00b..63bc2f9d00b 100644 --- a/sql/updates/world/3.3.5/2016_06_14_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_14_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_02_world.sql index eea9c0e6ac1..eea9c0e6ac1 100644 --- a/sql/updates/world/3.3.5/2016_06_14_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_14_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_03_world.sql index 922182468dd..922182468dd 100644 --- a/sql/updates/world/3.3.5/2016_06_14_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_14_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_05_world.sql index 2b34562e4bb..2b34562e4bb 100644 --- a/sql/updates/world/3.3.5/2016_06_14_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_14_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_00_world.sql index 286d86dd7d3..286d86dd7d3 100644 --- a/sql/updates/world/3.3.5/2016_06_15_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_01_world.sql index 74e50e55785..74e50e55785 100644 --- a/sql/updates/world/3.3.5/2016_06_15_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_02_world.sql index b94af5ec293..b94af5ec293 100644 --- a/sql/updates/world/3.3.5/2016_06_15_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_03_world.sql index edc42a33642..edc42a33642 100644 --- a/sql/updates/world/3.3.5/2016_06_15_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_04_world.sql index f976ba3093b..f976ba3093b 100644 --- a/sql/updates/world/3.3.5/2016_06_15_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_05_world.sql index 1524c2f2a5e..1524c2f2a5e 100644 --- a/sql/updates/world/3.3.5/2016_06_15_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_06_world.sql index 1f8a50b65a3..1f8a50b65a3 100644 --- a/sql/updates/world/3.3.5/2016_06_15_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_07_world.sql index a3ceba435dc..a3ceba435dc 100644 --- a/sql/updates/world/3.3.5/2016_06_15_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_08_world.sql index 49d3fbc4643..49d3fbc4643 100644 --- a/sql/updates/world/3.3.5/2016_06_15_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_09_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_09_world_335.sql index 51ab052ef56..51ab052ef56 100644 --- a/sql/updates/world/3.3.5/2016_06_15_09_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_09_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_10_world.sql index 6033ee9446c..6033ee9446c 100644 --- a/sql/updates/world/3.3.5/2016_06_15_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_11_world.sql index 5409a886b28..5409a886b28 100644 --- a/sql/updates/world/3.3.5/2016_06_15_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_12_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_12_world.sql index 16919326b48..16919326b48 100644 --- a/sql/updates/world/3.3.5/2016_06_15_12_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_12_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_13_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_13_world_335.sql index b38b0ff1cb3..b38b0ff1cb3 100644 --- a/sql/updates/world/3.3.5/2016_06_15_13_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_13_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_14_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_14_world.sql index 410ae76253d..410ae76253d 100644 --- a/sql/updates/world/3.3.5/2016_06_15_14_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_14_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_15_15_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_15_world_335.sql index 34b28152f28..34b28152f28 100644 --- a/sql/updates/world/3.3.5/2016_06_15_15_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_15_15_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_06_16_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_16_00_world.sql index f6958ad4dc7..f6958ad4dc7 100644 --- a/sql/updates/world/3.3.5/2016_06_16_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_16_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_17_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_17_00_world.sql index 33094fd818a..33094fd818a 100644 --- a/sql/updates/world/3.3.5/2016_06_17_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_17_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_18_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_18_00_world.sql index 8135c5e64b0..8135c5e64b0 100644 --- a/sql/updates/world/3.3.5/2016_06_18_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_18_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_18_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_18_01_world.sql index 1a9d8fbce85..1a9d8fbce85 100644 --- a/sql/updates/world/3.3.5/2016_06_18_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_18_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_18_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_18_02_world.sql index 7b49e7c25f3..7b49e7c25f3 100644 --- a/sql/updates/world/3.3.5/2016_06_18_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_18_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_20_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_00_world.sql index d14f0042fa7..d14f0042fa7 100644 --- a/sql/updates/world/3.3.5/2016_06_20_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_20_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_01_world.sql index eb8ebef9293..eb8ebef9293 100644 --- a/sql/updates/world/3.3.5/2016_06_20_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_20_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_02_world.sql index 9bb24fa9b60..9bb24fa9b60 100644 --- a/sql/updates/world/3.3.5/2016_06_20_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_20_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_03_world.sql index 3d94c0ace5f..3d94c0ace5f 100644 --- a/sql/updates/world/3.3.5/2016_06_20_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_20_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_04_world.sql index da0d6b05919..da0d6b05919 100644 --- a/sql/updates/world/3.3.5/2016_06_20_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_20_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_22_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_00_world.sql index fd2d4d8743b..fd2d4d8743b 100644 --- a/sql/updates/world/3.3.5/2016_06_22_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_22_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_01_world.sql index bf11bee736b..bf11bee736b 100644 --- a/sql/updates/world/3.3.5/2016_06_22_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_22_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_02_world.sql index f73b0f6a6f6..f73b0f6a6f6 100644 --- a/sql/updates/world/3.3.5/2016_06_22_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_22_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_03_world.sql index 5c7b71e479a..5c7b71e479a 100644 --- a/sql/updates/world/3.3.5/2016_06_22_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_22_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_23_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_23_00_world.sql index 49ec67454a3..49ec67454a3 100644 --- a/sql/updates/world/3.3.5/2016_06_23_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_23_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_25_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_00_world.sql index f1337038533..f1337038533 100644 --- a/sql/updates/world/3.3.5/2016_06_25_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_25_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_01_world.sql index a318c821fb9..a318c821fb9 100644 --- a/sql/updates/world/3.3.5/2016_06_25_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_25_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_02_world.sql index cf4e814d813..cf4e814d813 100644 --- a/sql/updates/world/3.3.5/2016_06_25_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_25_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_03_world.sql index d193f38a922..d193f38a922 100644 --- a/sql/updates/world/3.3.5/2016_06_25_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_25_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_26_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_26_00_world.sql index 1551f6a646e..1551f6a646e 100644 --- a/sql/updates/world/3.3.5/2016_06_26_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_26_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_26_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_26_01_world.sql index b9ab8f12a54..b9ab8f12a54 100644 --- a/sql/updates/world/3.3.5/2016_06_26_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_26_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_26_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_26_02_world.sql index 0e5064b33c1..0e5064b33c1 100644 --- a/sql/updates/world/3.3.5/2016_06_26_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_26_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_27_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_27_00_world.sql index d84c8158542..d84c8158542 100644 --- a/sql/updates/world/3.3.5/2016_06_27_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_27_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_27_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_27_01_world.sql index 6f7d3a34127..6f7d3a34127 100644 --- a/sql/updates/world/3.3.5/2016_06_27_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_27_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_27_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_27_02_world.sql index 6484f75afc4..6484f75afc4 100644 --- a/sql/updates/world/3.3.5/2016_06_27_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_27_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_29_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_29_00_world.sql index b4dcaf7c15e..b4dcaf7c15e 100644 --- a/sql/updates/world/3.3.5/2016_06_29_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_29_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_29_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_29_01_world.sql index 4ffabf4b0a8..4ffabf4b0a8 100644 --- a/sql/updates/world/3.3.5/2016_06_29_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_29_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_06_30_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_30_00_world_335.sql index a31825e40a5..a31825e40a5 100644 --- a/sql/updates/world/3.3.5/2016_06_30_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_06_30_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_00_world.sql index d5c0e5fc05d..d5c0e5fc05d 100644 --- a/sql/updates/world/3.3.5/2016_07_04_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_01_world.sql index 28f18ef6987..28f18ef6987 100644 --- a/sql/updates/world/3.3.5/2016_07_04_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_02_world.sql index 5282ae12337..5282ae12337 100644 --- a/sql/updates/world/3.3.5/2016_07_04_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_03_world.sql index 106953e74d7..106953e74d7 100644 --- a/sql/updates/world/3.3.5/2016_07_04_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_04_world.sql index 0b87d47f638..0b87d47f638 100644 --- a/sql/updates/world/3.3.5/2016_07_04_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_05_world.sql index d19e8862b45..d19e8862b45 100644 --- a/sql/updates/world/3.3.5/2016_07_04_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_06_world.sql index 6cc2a01d03c..6cc2a01d03c 100644 --- a/sql/updates/world/3.3.5/2016_07_04_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_07_world.sql index ae262760873..ae262760873 100644 --- a/sql/updates/world/3.3.5/2016_07_04_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_08_world.sql index 3af82274a98..3af82274a98 100644 --- a/sql/updates/world/3.3.5/2016_07_04_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_09_world.sql index 29cb4809078..29cb4809078 100644 --- a/sql/updates/world/3.3.5/2016_07_04_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_10_world.sql index 564f03ac93b..564f03ac93b 100644 --- a/sql/updates/world/3.3.5/2016_07_04_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_11_world.sql index e8989d28544..e8989d28544 100644 --- a/sql/updates/world/3.3.5/2016_07_04_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_12_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_12_world.sql index ea56bab8e79..ea56bab8e79 100644 --- a/sql/updates/world/3.3.5/2016_07_04_12_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_12_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_13_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_13_world.sql index cc46a42cbb0..cc46a42cbb0 100644 --- a/sql/updates/world/3.3.5/2016_07_04_13_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_13_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_04_14_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_14_world.sql index d639b5eefe7..d639b5eefe7 100644 --- a/sql/updates/world/3.3.5/2016_07_04_14_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_04_14_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_05_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_00_world.sql index c2eb2c5118c..c2eb2c5118c 100644 --- a/sql/updates/world/3.3.5/2016_07_05_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_05_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_01_world.sql index f0319889412..f0319889412 100644 --- a/sql/updates/world/3.3.5/2016_07_05_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_05_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_02_world.sql index 2921c19b0c1..2921c19b0c1 100644 --- a/sql/updates/world/3.3.5/2016_07_05_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_05_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_03_world.sql index 6a91e39c26c..6a91e39c26c 100644 --- a/sql/updates/world/3.3.5/2016_07_05_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_05_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_06_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_00_world.sql index 3875299dde0..3875299dde0 100644 --- a/sql/updates/world/3.3.5/2016_07_06_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_06_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_01_world.sql index 8275d04461c..8275d04461c 100644 --- a/sql/updates/world/3.3.5/2016_07_06_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_06_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_02_world.sql index 954a82b5a8e..954a82b5a8e 100644 --- a/sql/updates/world/3.3.5/2016_07_06_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_06_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_03_world.sql index db205700124..db205700124 100644 --- a/sql/updates/world/3.3.5/2016_07_06_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_06_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_07_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_00_world.sql index edfb3fe7c28..edfb3fe7c28 100644 --- a/sql/updates/world/3.3.5/2016_07_07_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_07_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_01_world.sql index e88a8173b9f..e88a8173b9f 100644 --- a/sql/updates/world/3.3.5/2016_07_07_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_07_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_02_world.sql index 90193d3ab45..90193d3ab45 100644 --- a/sql/updates/world/3.3.5/2016_07_07_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_07_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_03_world.sql index 3af1cdd1fb6..3af1cdd1fb6 100644 --- a/sql/updates/world/3.3.5/2016_07_07_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_07_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_04_world.sql index 0747a024a0a..0747a024a0a 100644 --- a/sql/updates/world/3.3.5/2016_07_07_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_07_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_05_world.sql index fa6a9ede9f7..fa6a9ede9f7 100644 --- a/sql/updates/world/3.3.5/2016_07_07_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_07_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_09_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_09_00_world.sql index 87b6865e8a6..87b6865e8a6 100644 --- a/sql/updates/world/3.3.5/2016_07_09_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_09_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_00_world.sql index 06f6e89de2d..06f6e89de2d 100644 --- a/sql/updates/world/3.3.5/2016_07_10_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_01_world.sql index 11a04a8af30..11a04a8af30 100644 --- a/sql/updates/world/3.3.5/2016_07_10_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_02_world.sql index 57ff1fd9cca..57ff1fd9cca 100644 --- a/sql/updates/world/3.3.5/2016_07_10_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_03_world.sql index a63b75d0e0f..a63b75d0e0f 100644 --- a/sql/updates/world/3.3.5/2016_07_10_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_04_world.sql index 343b4585da9..343b4585da9 100644 --- a/sql/updates/world/3.3.5/2016_07_10_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_05_world.sql index 46d0cd341fe..46d0cd341fe 100644 --- a/sql/updates/world/3.3.5/2016_07_10_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_06_world.sql index 7594560ce2a..7594560ce2a 100644 --- a/sql/updates/world/3.3.5/2016_07_10_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_07_world.sql index 03fb6fd6db4..03fb6fd6db4 100644 --- a/sql/updates/world/3.3.5/2016_07_10_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_10_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_09_world.sql index 67e6ce625e9..67e6ce625e9 100644 --- a/sql/updates/world/3.3.5/2016_07_10_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_10_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_12_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_12_00_world.sql index dd910e8c712..dd910e8c712 100644 --- a/sql/updates/world/3.3.5/2016_07_12_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_12_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_12_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_12_01_world.sql index b717b3ad474..b717b3ad474 100644 --- a/sql/updates/world/3.3.5/2016_07_12_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_12_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_12_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_12_02_world.sql index 81991efe3e5..81991efe3e5 100644 --- a/sql/updates/world/3.3.5/2016_07_12_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_12_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_13_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_13_00_world.sql index 4fb83eb1eb7..4fb83eb1eb7 100644 --- a/sql/updates/world/3.3.5/2016_07_13_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_13_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_13_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_13_01_world_335.sql index 9e20aa59af7..9e20aa59af7 100644 --- a/sql/updates/world/3.3.5/2016_07_13_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_13_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_07_14_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_14_00_world.sql index 5f45b70c942..5f45b70c942 100644 --- a/sql/updates/world/3.3.5/2016_07_14_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_14_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_00_world.sql index 6168cb638f3..6168cb638f3 100644 --- a/sql/updates/world/3.3.5/2016_07_15_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_01_world.sql index 2a6466dd1cc..2a6466dd1cc 100644 --- a/sql/updates/world/3.3.5/2016_07_15_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_02_world.sql index dfe56542182..dfe56542182 100644 --- a/sql/updates/world/3.3.5/2016_07_15_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_03_world.sql index b7a19638541..b7a19638541 100644 --- a/sql/updates/world/3.3.5/2016_07_15_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_04_world.sql index e45302cde89..e45302cde89 100644 --- a/sql/updates/world/3.3.5/2016_07_15_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_05_world.sql index a024b62590e..a024b62590e 100644 --- a/sql/updates/world/3.3.5/2016_07_15_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_06_world.sql index 7a5e74a50d3..7a5e74a50d3 100644 --- a/sql/updates/world/3.3.5/2016_07_15_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_07_world.sql index b44d7669386..b44d7669386 100644 --- a/sql/updates/world/3.3.5/2016_07_15_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_08_world.sql index e4ea72c2173..e4ea72c2173 100644 --- a/sql/updates/world/3.3.5/2016_07_15_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_09_world.sql index 576d5317a4c..576d5317a4c 100644 --- a/sql/updates/world/3.3.5/2016_07_15_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_10_world.sql index 3b9491a1748..3b9491a1748 100644 --- a/sql/updates/world/3.3.5/2016_07_15_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_15_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_11_world.sql index f0d5555af27..f0d5555af27 100644 --- a/sql/updates/world/3.3.5/2016_07_15_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_15_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_00_world.sql index 0dd86f346e9..0dd86f346e9 100644 --- a/sql/updates/world/3.3.5/2016_07_16_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_01_world.sql index 25b0dd9a071..25b0dd9a071 100644 --- a/sql/updates/world/3.3.5/2016_07_16_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_02_world.sql index ab625246ea7..ab625246ea7 100644 --- a/sql/updates/world/3.3.5/2016_07_16_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_03_world.sql index 986a96a6d57..986a96a6d57 100644 --- a/sql/updates/world/3.3.5/2016_07_16_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_04_world.sql index 9bdba2e4deb..9bdba2e4deb 100644 --- a/sql/updates/world/3.3.5/2016_07_16_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_05_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_05_world_335.sql index 6fd17188e7e..6fd17188e7e 100644 --- a/sql/updates/world/3.3.5/2016_07_16_05_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_05_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_06_world.sql index a8e9510c965..a8e9510c965 100644 --- a/sql/updates/world/3.3.5/2016_07_16_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_07_world.sql index 75af8add3d1..75af8add3d1 100644 --- a/sql/updates/world/3.3.5/2016_07_16_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_16_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_08_world.sql index af4db3f1567..af4db3f1567 100644 --- a/sql/updates/world/3.3.5/2016_07_16_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_16_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_18_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_18_00_world.sql index 7682fe310e3..7682fe310e3 100644 --- a/sql/updates/world/3.3.5/2016_07_18_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_18_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_18_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_18_01_world.sql index 47425de1744..47425de1744 100644 --- a/sql/updates/world/3.3.5/2016_07_18_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_18_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_00_world.sql index ae623f25db0..ae623f25db0 100644 --- a/sql/updates/world/3.3.5/2016_07_19_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_01_world.sql index 02d522f183c..02d522f183c 100644 --- a/sql/updates/world/3.3.5/2016_07_19_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_02_world.sql index 782178a66f8..782178a66f8 100644 --- a/sql/updates/world/3.3.5/2016_07_19_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_03_world.sql index 147095d7ea0..147095d7ea0 100644 --- a/sql/updates/world/3.3.5/2016_07_19_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_04_world.sql index 449999b41e1..449999b41e1 100644 --- a/sql/updates/world/3.3.5/2016_07_19_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_05_world.sql index 7363465131c..7363465131c 100644 --- a/sql/updates/world/3.3.5/2016_07_19_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_06_world.sql index 44fad2ffd2a..44fad2ffd2a 100644 --- a/sql/updates/world/3.3.5/2016_07_19_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_19_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_07_world.sql index 6fafc733431..6fafc733431 100644 --- a/sql/updates/world/3.3.5/2016_07_19_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_19_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_20_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_20_00_world_335.sql index 2bcc4f42bf2..2bcc4f42bf2 100644 --- a/sql/updates/world/3.3.5/2016_07_20_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_20_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_07_20_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_20_01_world.sql index 47274168c85..47274168c85 100644 --- a/sql/updates/world/3.3.5/2016_07_20_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_20_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_20_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_20_02_world.sql index 125fa3bd8c8..125fa3bd8c8 100644 --- a/sql/updates/world/3.3.5/2016_07_20_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_20_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_22_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_22_00_world.sql index 9f2158cb723..9f2158cb723 100644 --- a/sql/updates/world/3.3.5/2016_07_22_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_25_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_25_00_world.sql index 3006fbde68d..3006fbde68d 100644 --- a/sql/updates/world/3.3.5/2016_07_25_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_28_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_28_00_world.sql index 89d9d616efb..89d9d616efb 100644 --- a/sql/updates/world/3.3.5/2016_07_28_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_28_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_29_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_29_00_world.sql index 89b32cd993a..89b32cd993a 100644 --- a/sql/updates/world/3.3.5/2016_07_29_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_29_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_30_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_30_00_world.sql index 934f641f788..934f641f788 100644 --- a/sql/updates/world/3.3.5/2016_07_30_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_30_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_30_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_30_01_world.sql index 6eb896decc5..6eb896decc5 100644 --- a/sql/updates/world/3.3.5/2016_07_30_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_30_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_07_31_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_31_00_world_335.sql index 9a87de56977..9a87de56977 100644 --- a/sql/updates/world/3.3.5/2016_07_31_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_31_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_07_31_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_31_01_world.sql index 3fb22dfd09f..3fb22dfd09f 100644 --- a/sql/updates/world/3.3.5/2016_07_31_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_07_31_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_01_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_01_01_world.sql index 327e58bf5c9..327e58bf5c9 100644 --- a/sql/updates/world/3.3.5/2016_08_01_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_01_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_02_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_02_00_world.sql index a5fe8c29c3e..a5fe8c29c3e 100644 --- a/sql/updates/world/3.3.5/2016_08_02_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_02_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_03_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_03_00_world.sql index ee9a582d083..ee9a582d083 100644 --- a/sql/updates/world/3.3.5/2016_08_03_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_03_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_03_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_03_01_world.sql index e535f2e786f..e535f2e786f 100644 --- a/sql/updates/world/3.3.5/2016_08_03_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_03_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_03_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_03_02_world.sql index 0179449e6cc..0179449e6cc 100644 --- a/sql/updates/world/3.3.5/2016_08_03_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_03_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_00_world_335.sql index 09f5768c7a1..09f5768c7a1 100644 --- a/sql/updates/world/3.3.5/2016_08_04_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_08_04_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_01_world.sql index 4871f6de86a..4871f6de86a 100644 --- a/sql/updates/world/3.3.5/2016_08_04_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_04_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_02_world.sql index f7611942a28..f7611942a28 100644 --- a/sql/updates/world/3.3.5/2016_08_04_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_04_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_03_world.sql index f7bce378a47..f7bce378a47 100644 --- a/sql/updates/world/3.3.5/2016_08_04_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_04_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_04_world_335.sql index c675a4e2ee5..c675a4e2ee5 100644 --- a/sql/updates/world/3.3.5/2016_08_04_04_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_04_04_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_08_05_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_05_00_world.sql index 5dff6593e6d..5dff6593e6d 100644 --- a/sql/updates/world/3.3.5/2016_08_05_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_05_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_06_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_06_00_world.sql index 250ba104ae5..250ba104ae5 100644 --- a/sql/updates/world/3.3.5/2016_08_06_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_06_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_08_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_08_00_world.sql index 60e8bf27d17..60e8bf27d17 100644 --- a/sql/updates/world/3.3.5/2016_08_08_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_08_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_08_01_world335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_08_01_world335.sql index a674dff8dbe..a674dff8dbe 100644 --- a/sql/updates/world/3.3.5/2016_08_08_01_world335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_08_01_world335.sql diff --git a/sql/updates/world/3.3.5/2016_08_08_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_08_02_world.sql index e22279a640d..e22279a640d 100644 --- a/sql/updates/world/3.3.5/2016_08_08_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_08_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_11_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_11_00_world.sql index 02f0f13005e..02f0f13005e 100644 --- a/sql/updates/world/3.3.5/2016_08_11_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_11_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_14_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_14_00_world.sql index 046d50dddad..046d50dddad 100644 --- a/sql/updates/world/3.3.5/2016_08_14_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_14_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_14_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_14_01_world.sql index b40520fc672..b40520fc672 100644 --- a/sql/updates/world/3.3.5/2016_08_14_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_14_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_14_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_14_02_world.sql index e05f32dac7a..e05f32dac7a 100644 --- a/sql/updates/world/3.3.5/2016_08_14_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_14_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_15_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_15_00_world.sql index 0867d1bed0d..0867d1bed0d 100644 --- a/sql/updates/world/3.3.5/2016_08_15_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_15_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_15_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_15_01_world.sql index c98d632989d..c98d632989d 100644 --- a/sql/updates/world/3.3.5/2016_08_15_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_15_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_17_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_17_00_world_335.sql index d538a3c8ec7..d538a3c8ec7 100644 --- a/sql/updates/world/3.3.5/2016_08_17_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_17_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_08_17_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_17_01_world.sql index 631a827084f..631a827084f 100644 --- a/sql/updates/world/3.3.5/2016_08_17_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_17_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_18_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_18_00_world.sql index 5b35dd68148..5b35dd68148 100644 --- a/sql/updates/world/3.3.5/2016_08_18_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_18_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_19_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_00_world.sql index 208482f7d89..208482f7d89 100644 --- a/sql/updates/world/3.3.5/2016_08_19_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_19_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_01_world.sql index 2cdb65bdeb3..2cdb65bdeb3 100644 --- a/sql/updates/world/3.3.5/2016_08_19_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_19_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_02_world.sql index 261f3317835..261f3317835 100644 --- a/sql/updates/world/3.3.5/2016_08_19_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_19_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_03_world.sql index b10a117e6e9..b10a117e6e9 100644 --- a/sql/updates/world/3.3.5/2016_08_19_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_19_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_00_world.sql index 6a6e7a9a22c..6a6e7a9a22c 100644 --- a/sql/updates/world/3.3.5/2016_08_21_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_01_world.sql index 37ce1e9809f..37ce1e9809f 100644 --- a/sql/updates/world/3.3.5/2016_08_21_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_02_world.sql index 9ae243c4db1..9ae243c4db1 100644 --- a/sql/updates/world/3.3.5/2016_08_21_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_03_world.sql index c8b1f0f1c2e..c8b1f0f1c2e 100644 --- a/sql/updates/world/3.3.5/2016_08_21_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_04_world.sql index 7d7fbd23005..7d7fbd23005 100644 --- a/sql/updates/world/3.3.5/2016_08_21_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_05_world.sql index e7327102a1f..e7327102a1f 100644 --- a/sql/updates/world/3.3.5/2016_08_21_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_06_world.sql index 22fce10b220..22fce10b220 100644 --- a/sql/updates/world/3.3.5/2016_08_21_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_21_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_07_world.sql index 62d1963db90..62d1963db90 100644 --- a/sql/updates/world/3.3.5/2016_08_21_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_21_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_22_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_22_00_world.sql index 3b741e03565..3b741e03565 100644 --- a/sql/updates/world/3.3.5/2016_08_22_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_23_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_00_world.sql index 22a4ef95f4e..22a4ef95f4e 100644 --- a/sql/updates/world/3.3.5/2016_08_23_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_23_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_01_world.sql index 0c266a2e88f..0c266a2e88f 100644 --- a/sql/updates/world/3.3.5/2016_08_23_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_23_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_02_world.sql index 144a4aa4377..144a4aa4377 100644 --- a/sql/updates/world/3.3.5/2016_08_23_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_23_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_03_world.sql index 727544cd88c..727544cd88c 100644 --- a/sql/updates/world/3.3.5/2016_08_23_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_23_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_04_world.sql index d7697d28ad7..d7697d28ad7 100644 --- a/sql/updates/world/3.3.5/2016_08_23_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_23_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_05_world.sql index cab7e8f3a20..cab7e8f3a20 100644 --- a/sql/updates/world/3.3.5/2016_08_23_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_23_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_00_world.sql index db20add8d90..db20add8d90 100644 --- a/sql/updates/world/3.3.5/2016_08_24_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_01_world.sql index 65efdb08659..65efdb08659 100644 --- a/sql/updates/world/3.3.5/2016_08_24_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_02_world.sql index e1407e23780..e1407e23780 100644 --- a/sql/updates/world/3.3.5/2016_08_24_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_03_world.sql index 68b4d9274ec..68b4d9274ec 100644 --- a/sql/updates/world/3.3.5/2016_08_24_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_04_world.sql index 5076e7f521d..5076e7f521d 100644 --- a/sql/updates/world/3.3.5/2016_08_24_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_05_world.sql index 34b2dc925a3..34b2dc925a3 100644 --- a/sql/updates/world/3.3.5/2016_08_24_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_06_world.sql index 7df954dec3b..7df954dec3b 100644 --- a/sql/updates/world/3.3.5/2016_08_24_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_07_world.sql index 2c1c2941dc2..2c1c2941dc2 100644 --- a/sql/updates/world/3.3.5/2016_08_24_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_08_world.sql index 45b28c4d1d6..45b28c4d1d6 100644 --- a/sql/updates/world/3.3.5/2016_08_24_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_09_world.sql index 0f8055841f0..0f8055841f0 100644 --- a/sql/updates/world/3.3.5/2016_08_24_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_10_world.sql index 1df425411bf..1df425411bf 100644 --- a/sql/updates/world/3.3.5/2016_08_24_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_24_11_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_11_world.sql index e7f1e081f61..e7f1e081f61 100644 --- a/sql/updates/world/3.3.5/2016_08_24_11_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_24_11_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_00_world.sql index 5118815de6f..5118815de6f 100644 --- a/sql/updates/world/3.3.5/2016_08_25_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_01_world.sql index cc2a6e9049d..cc2a6e9049d 100644 --- a/sql/updates/world/3.3.5/2016_08_25_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_02_world.sql index f8cfc381e69..f8cfc381e69 100644 --- a/sql/updates/world/3.3.5/2016_08_25_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_03_world.sql index 531ea2621f2..531ea2621f2 100644 --- a/sql/updates/world/3.3.5/2016_08_25_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_04_world.sql index 88a899064e1..88a899064e1 100644 --- a/sql/updates/world/3.3.5/2016_08_25_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_05_world.sql index 75b89a1159f..75b89a1159f 100644 --- a/sql/updates/world/3.3.5/2016_08_25_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_06_world.sql index 46d4dc131b5..46d4dc131b5 100644 --- a/sql/updates/world/3.3.5/2016_08_25_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_07_world.sql index 2b17525560d..2b17525560d 100644 --- a/sql/updates/world/3.3.5/2016_08_25_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_08_world.sql index 1af4d154e31..1af4d154e31 100644 --- a/sql/updates/world/3.3.5/2016_08_25_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_09_world.sql index 0a74b2b1eea..0a74b2b1eea 100644 --- a/sql/updates/world/3.3.5/2016_08_25_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_25_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_10_world.sql index 05c9a250a2d..05c9a250a2d 100644 --- a/sql/updates/world/3.3.5/2016_08_25_10_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_25_10_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_28_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_28_00_world.sql index 828b70e60c3..828b70e60c3 100644 --- a/sql/updates/world/3.3.5/2016_08_28_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_28_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_29_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_29_00_world.sql index 6f948e61cf5..6f948e61cf5 100644 --- a/sql/updates/world/3.3.5/2016_08_29_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_29_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_29_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_29_01_world.sql index 732f5788318..732f5788318 100644 --- a/sql/updates/world/3.3.5/2016_08_29_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_29_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_30_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_30_00_world_335.sql index ba889fd721c..ba889fd721c 100644 --- a/sql/updates/world/3.3.5/2016_08_30_00_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_30_00_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_08_31_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_31_00_world.sql index f36064ae6f2..f36064ae6f2 100644 --- a/sql/updates/world/3.3.5/2016_08_31_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_31_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_08_31_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_31_01_world_335.sql index 54c4e162e1a..54c4e162e1a 100644 --- a/sql/updates/world/3.3.5/2016_08_31_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_08_31_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_09_01_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_01_00_world.sql index ccb48a9c87a..ccb48a9c87a 100644 --- a/sql/updates/world/3.3.5/2016_09_01_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_01_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_01_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_01_01_world.sql index 7f361c68f1e..7f361c68f1e 100644 --- a/sql/updates/world/3.3.5/2016_09_01_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_01_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_02_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_00_world.sql index 32e9f51bbaa..32e9f51bbaa 100644 --- a/sql/updates/world/3.3.5/2016_09_02_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_02_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_01_world.sql index 08571cd4ea4..08571cd4ea4 100644 --- a/sql/updates/world/3.3.5/2016_09_02_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_02_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_02_world.sql index 14076c60b5d..14076c60b5d 100644 --- a/sql/updates/world/3.3.5/2016_09_02_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_02_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_03_world.sql index 435919c5071..435919c5071 100644 --- a/sql/updates/world/3.3.5/2016_09_02_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_02_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_04_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_00_world.sql index 779bb689d16..779bb689d16 100644 --- a/sql/updates/world/3.3.5/2016_09_04_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_04_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_01_world.sql index a2836a57364..a2836a57364 100644 --- a/sql/updates/world/3.3.5/2016_09_04_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_04_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_02_world.sql index b24829f50b2..b24829f50b2 100644 --- a/sql/updates/world/3.3.5/2016_09_04_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_04_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_03_world.sql index 34cb1c0aa55..34cb1c0aa55 100644 --- a/sql/updates/world/3.3.5/2016_09_04_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_04_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_09_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_09_00_world.sql index 4224931f41b..4224931f41b 100644 --- a/sql/updates/world/3.3.5/2016_09_09_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_09_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_09_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_09_01_world.sql index addcd9c17dd..addcd9c17dd 100644 --- a/sql/updates/world/3.3.5/2016_09_09_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_09_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_09_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_09_02_world.sql index 2f0395782b4..2f0395782b4 100644 --- a/sql/updates/world/3.3.5/2016_09_09_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_09_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_00_world.sql index 5bd420007f7..5bd420007f7 100644 --- a/sql/updates/world/3.3.5/2016_09_10_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_01_world.sql index af49f044a2a..af49f044a2a 100644 --- a/sql/updates/world/3.3.5/2016_09_10_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_02_world.sql index eb95f2e9396..eb95f2e9396 100644 --- a/sql/updates/world/3.3.5/2016_09_10_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_03_world.sql index fe9b044458d..fe9b044458d 100644 --- a/sql/updates/world/3.3.5/2016_09_10_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_04_world.sql index 2ca196d5c42..2ca196d5c42 100644 --- a/sql/updates/world/3.3.5/2016_09_10_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_05_world.sql index b7601b53d94..b7601b53d94 100644 --- a/sql/updates/world/3.3.5/2016_09_10_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_06_world.sql index e9a4550993c..e9a4550993c 100644 --- a/sql/updates/world/3.3.5/2016_09_10_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_10_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_07_world.sql index 2a19f7d929d..2a19f7d929d 100644 --- a/sql/updates/world/3.3.5/2016_09_10_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_10_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_11_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_11_00_world.sql index bb3ed000b01..bb3ed000b01 100644 --- a/sql/updates/world/3.3.5/2016_09_11_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_11_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_11_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_11_01_world.sql index 9989479405f..9989479405f 100644 --- a/sql/updates/world/3.3.5/2016_09_11_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_11_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_12_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_12_00_world.sql index ddfc1d4a8d7..ddfc1d4a8d7 100644 --- a/sql/updates/world/3.3.5/2016_09_12_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_12_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_12_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_12_01_world.sql index 253b7dbe691..253b7dbe691 100644 --- a/sql/updates/world/3.3.5/2016_09_12_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_12_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_12_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_12_02_world.sql index f573d920bd1..f573d920bd1 100644 --- a/sql/updates/world/3.3.5/2016_09_12_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_12_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_00_world.sql index 75ea34d2b68..75ea34d2b68 100644 --- a/sql/updates/world/3.3.5/2016_09_13_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_01_world.sql index bf9120a1b28..bf9120a1b28 100644 --- a/sql/updates/world/3.3.5/2016_09_13_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_02_world.sql index 10eb840e8ed..10eb840e8ed 100644 --- a/sql/updates/world/3.3.5/2016_09_13_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_03_world.sql index 48dc070db73..48dc070db73 100644 --- a/sql/updates/world/3.3.5/2016_09_13_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_04_world.sql index dfe1a52f514..dfe1a52f514 100644 --- a/sql/updates/world/3.3.5/2016_09_13_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_05_world.sql index 03dc80826f9..03dc80826f9 100644 --- a/sql/updates/world/3.3.5/2016_09_13_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_13_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_06_world.sql index fc385361a66..fc385361a66 100644 --- a/sql/updates/world/3.3.5/2016_09_13_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_13_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_14_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_00_world.sql index 44e633c6467..44e633c6467 100644 --- a/sql/updates/world/3.3.5/2016_09_14_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_14_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_01_world.sql index baf64ae3ff6..baf64ae3ff6 100644 --- a/sql/updates/world/3.3.5/2016_09_14_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_14_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_02_world.sql index 9f1a2d520e9..9f1a2d520e9 100644 --- a/sql/updates/world/3.3.5/2016_09_14_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_14_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_03_world.sql index 3018e2bbe6f..3018e2bbe6f 100644 --- a/sql/updates/world/3.3.5/2016_09_14_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_14_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_04_world.sql index 85f9b4f7faa..85f9b4f7faa 100644 --- a/sql/updates/world/3.3.5/2016_09_14_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_14_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_00_world.sql index 2be88e204e1..2be88e204e1 100644 --- a/sql/updates/world/3.3.5/2016_09_15_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_01_world.sql index f58c32095e3..f58c32095e3 100644 --- a/sql/updates/world/3.3.5/2016_09_15_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_02_world.sql index 8dedfaa30e4..8dedfaa30e4 100644 --- a/sql/updates/world/3.3.5/2016_09_15_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_03_world.sql index ab31a870df2..ab31a870df2 100644 --- a/sql/updates/world/3.3.5/2016_09_15_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_04_world.sql index 14835ed2f1b..14835ed2f1b 100644 --- a/sql/updates/world/3.3.5/2016_09_15_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_05_world.sql index edafdb6aad5..edafdb6aad5 100644 --- a/sql/updates/world/3.3.5/2016_09_15_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_06_world.sql index 03a364296d8..03a364296d8 100644 --- a/sql/updates/world/3.3.5/2016_09_15_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_15_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_07_world.sql index 3180f10b34d..3180f10b34d 100644 --- a/sql/updates/world/3.3.5/2016_09_15_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_15_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_00_world.sql index 2500bcacb2f..2500bcacb2f 100644 --- a/sql/updates/world/3.3.5/2016_09_16_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_01_world.sql index c170b292cfa..c170b292cfa 100644 --- a/sql/updates/world/3.3.5/2016_09_16_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_02_world.sql index 31ffcd005e8..31ffcd005e8 100644 --- a/sql/updates/world/3.3.5/2016_09_16_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_03_world.sql index b0d106e63da..b0d106e63da 100644 --- a/sql/updates/world/3.3.5/2016_09_16_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_04_world.sql index 10c2f5b0ae1..10c2f5b0ae1 100644 --- a/sql/updates/world/3.3.5/2016_09_16_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_05_world.sql index 4957b7407be..4957b7407be 100644 --- a/sql/updates/world/3.3.5/2016_09_16_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_06_world.sql index b034f70dd2d..b034f70dd2d 100644 --- a/sql/updates/world/3.3.5/2016_09_16_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_07_world.sql index 478b693e344..478b693e344 100644 --- a/sql/updates/world/3.3.5/2016_09_16_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_16_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_08_world.sql index 2d2efb6640f..2d2efb6640f 100644 --- a/sql/updates/world/3.3.5/2016_09_16_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_16_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_17_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_00_world.sql index 105576bd492..105576bd492 100644 --- a/sql/updates/world/3.3.5/2016_09_17_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_17_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_01_world_335.sql index 86c5ce32d78..86c5ce32d78 100644 --- a/sql/updates/world/3.3.5/2016_09_17_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_09_17_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_02_world.sql index 328827c72f6..328827c72f6 100644 --- a/sql/updates/world/3.3.5/2016_09_17_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_17_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_03_world.sql index 67da0599d08..67da0599d08 100644 --- a/sql/updates/world/3.3.5/2016_09_17_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_17_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_04_world.sql index a37d600b00c..a37d600b00c 100644 --- a/sql/updates/world/3.3.5/2016_09_17_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_17_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_00_world.sql index 86e9a84a764..86e9a84a764 100644 --- a/sql/updates/world/3.3.5/2016_09_19_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_01_world.sql index 01390902e37..01390902e37 100644 --- a/sql/updates/world/3.3.5/2016_09_19_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_02_world.sql index d210aab8164..d210aab8164 100644 --- a/sql/updates/world/3.3.5/2016_09_19_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_03_world.sql index c79e50af467..c79e50af467 100644 --- a/sql/updates/world/3.3.5/2016_09_19_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_04_world.sql index e5e76063510..e5e76063510 100644 --- a/sql/updates/world/3.3.5/2016_09_19_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_05_world.sql index e72b0a84696..e72b0a84696 100644 --- a/sql/updates/world/3.3.5/2016_09_19_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_06_world.sql index a512b53cf79..a512b53cf79 100644 --- a/sql/updates/world/3.3.5/2016_09_19_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_19_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_07_world.sql index e43b6a1ee76..e43b6a1ee76 100644 --- a/sql/updates/world/3.3.5/2016_09_19_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_19_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_20_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_00_world.sql index ae2caf249f9..ae2caf249f9 100644 --- a/sql/updates/world/3.3.5/2016_09_20_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_20_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_01_world.sql index 1e9d6aa08a6..1e9d6aa08a6 100644 --- a/sql/updates/world/3.3.5/2016_09_20_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_20_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_02_world.sql index 5a4e5f7fae5..5a4e5f7fae5 100644 --- a/sql/updates/world/3.3.5/2016_09_20_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_20_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_03_world.sql index f678950d881..f678950d881 100644 --- a/sql/updates/world/3.3.5/2016_09_20_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_20_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_04_world.sql index a786a86cfba..a786a86cfba 100644 --- a/sql/updates/world/3.3.5/2016_09_20_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_20_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_21_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_00_world.sql index 425b48ee320..425b48ee320 100644 --- a/sql/updates/world/3.3.5/2016_09_21_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_21_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_01_world.sql index c8dc9b1f7ac..c8dc9b1f7ac 100644 --- a/sql/updates/world/3.3.5/2016_09_21_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_21_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_02_world.sql index 12306b80b93..12306b80b93 100644 --- a/sql/updates/world/3.3.5/2016_09_21_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_21_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_03_world.sql index bcedb4c0857..bcedb4c0857 100644 --- a/sql/updates/world/3.3.5/2016_09_21_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_21_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_04_world.sql index 0587b286081..0587b286081 100644 --- a/sql/updates/world/3.3.5/2016_09_21_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_21_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_22_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_22_00_world.sql index 92f965a1691..92f965a1691 100644 --- a/sql/updates/world/3.3.5/2016_09_22_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_22_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_00_world.sql index fcc29fa4a75..fcc29fa4a75 100644 --- a/sql/updates/world/3.3.5/2016_09_24_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_01_world_335.sql index 3a319743e41..3a319743e41 100644 --- a/sql/updates/world/3.3.5/2016_09_24_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_02_world.sql index 483cefea9a3..483cefea9a3 100644 --- a/sql/updates/world/3.3.5/2016_09_24_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_03_world.sql index 6d6de7a77cd..6d6de7a77cd 100644 --- a/sql/updates/world/3.3.5/2016_09_24_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_04_world.sql index c799ff2899f..c799ff2899f 100644 --- a/sql/updates/world/3.3.5/2016_09_24_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_05_world.sql index 8c56984c27a..8c56984c27a 100644 --- a/sql/updates/world/3.3.5/2016_09_24_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_06_world.sql index e0ed9379d4f..e0ed9379d4f 100644 --- a/sql/updates/world/3.3.5/2016_09_24_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_07_world.sql index efa839ce580..efa839ce580 100644 --- a/sql/updates/world/3.3.5/2016_09_24_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_24_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_08_world.sql index cb1a823ba43..cb1a823ba43 100644 --- a/sql/updates/world/3.3.5/2016_09_24_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_24_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_25_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_00_world.sql index c48637f4f00..c48637f4f00 100644 --- a/sql/updates/world/3.3.5/2016_09_25_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_25_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_01_world.sql index d396182bb99..d396182bb99 100644 --- a/sql/updates/world/3.3.5/2016_09_25_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_25_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_02_world.sql index 6aee1a40404..6aee1a40404 100644 --- a/sql/updates/world/3.3.5/2016_09_25_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_25_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_03_world.sql index a74b596a15f..a74b596a15f 100644 --- a/sql/updates/world/3.3.5/2016_09_25_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_25_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_04_world.sql index b38d749af4c..b38d749af4c 100644 --- a/sql/updates/world/3.3.5/2016_09_25_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_25_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_26_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_00_world.sql index 72a4f8a956b..72a4f8a956b 100644 --- a/sql/updates/world/3.3.5/2016_09_26_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_26_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_01_world.sql index 04b3804fce7..04b3804fce7 100644 --- a/sql/updates/world/3.3.5/2016_09_26_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_26_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_02_world.sql index 764b7c27aab..764b7c27aab 100644 --- a/sql/updates/world/3.3.5/2016_09_26_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_26_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_03_world.sql index 81a2584bbe0..81a2584bbe0 100644 --- a/sql/updates/world/3.3.5/2016_09_26_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_26_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_27_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_27_00_world.sql index c4458e3a9d5..c4458e3a9d5 100644 --- a/sql/updates/world/3.3.5/2016_09_27_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_27_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_28_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_28_00_world.sql index 764c81e05ed..764c81e05ed 100644 --- a/sql/updates/world/3.3.5/2016_09_28_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_28_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_28_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_28_01_world.sql index 18c2b906f1d..18c2b906f1d 100644 --- a/sql/updates/world/3.3.5/2016_09_28_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_28_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_28_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_28_02_world.sql index 08f3cc34c39..08f3cc34c39 100644 --- a/sql/updates/world/3.3.5/2016_09_28_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_28_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_29_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_29_00_world.sql index 2be21762492..2be21762492 100644 --- a/sql/updates/world/3.3.5/2016_09_29_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_29_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_29_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_29_01_world.sql index 575c3963b16..575c3963b16 100644 --- a/sql/updates/world/3.3.5/2016_09_29_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_29_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_29_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_29_02_world.sql index f2eff82a9b5..f2eff82a9b5 100644 --- a/sql/updates/world/3.3.5/2016_09_29_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_29_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_00_world.sql index eb0e81c1c6e..eb0e81c1c6e 100644 --- a/sql/updates/world/3.3.5/2016_09_30_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_01_world.sql index 830b9c17697..830b9c17697 100644 --- a/sql/updates/world/3.3.5/2016_09_30_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_02_world.sql index e5d09ebf496..e5d09ebf496 100644 --- a/sql/updates/world/3.3.5/2016_09_30_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_03_world.sql index 5f0f949ad72..5f0f949ad72 100644 --- a/sql/updates/world/3.3.5/2016_09_30_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_04_world.sql index 841f2b9cce9..841f2b9cce9 100644 --- a/sql/updates/world/3.3.5/2016_09_30_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_05_world.sql index 8f1e401c778..8f1e401c778 100644 --- a/sql/updates/world/3.3.5/2016_09_30_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_09_30_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_06_world.sql index b87a05aaa11..b87a05aaa11 100644 --- a/sql/updates/world/3.3.5/2016_09_30_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_09_30_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_01_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_00_world.sql index 37e9d4589c0..37e9d4589c0 100644 --- a/sql/updates/world/3.3.5/2016_10_01_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_01_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_01_world.sql index d1fb1cc034c..d1fb1cc034c 100644 --- a/sql/updates/world/3.3.5/2016_10_01_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_01_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_02_world.sql index 5ea5034c682..5ea5034c682 100644 --- a/sql/updates/world/3.3.5/2016_10_01_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_01_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_03_world.sql index 378e2ea918f..378e2ea918f 100644 --- a/sql/updates/world/3.3.5/2016_10_01_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_01_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_04_world.sql index 690bd9b7294..690bd9b7294 100644 --- a/sql/updates/world/3.3.5/2016_10_01_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_01_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_05_world.sql index 9b7a52b8ea0..9b7a52b8ea0 100644 --- a/sql/updates/world/3.3.5/2016_10_01_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_01_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_00_world.sql index 6ef4e4020b7..6ef4e4020b7 100644 --- a/sql/updates/world/3.3.5/2016_10_02_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_01_world.sql index 5243121dc8c..5243121dc8c 100644 --- a/sql/updates/world/3.3.5/2016_10_02_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_02_world.sql index 842f1903b9f..842f1903b9f 100644 --- a/sql/updates/world/3.3.5/2016_10_02_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_03_world.sql index acdbac960dd..acdbac960dd 100644 --- a/sql/updates/world/3.3.5/2016_10_02_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_04_world.sql index 65049b1a04f..65049b1a04f 100644 --- a/sql/updates/world/3.3.5/2016_10_02_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_05_world.sql index b6d588302d7..b6d588302d7 100644 --- a/sql/updates/world/3.3.5/2016_10_02_05_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_05_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_06_world.sql index 7489ea9119b..7489ea9119b 100644 --- a/sql/updates/world/3.3.5/2016_10_02_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_07_world.sql index a8323ca575d..a8323ca575d 100644 --- a/sql/updates/world/3.3.5/2016_10_02_07_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_07_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_02_08_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_08_world.sql index 6a7010eefc7..6a7010eefc7 100644 --- a/sql/updates/world/3.3.5/2016_10_02_08_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_02_08_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_03_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_00_world.sql index 68fd91a2096..68fd91a2096 100644 --- a/sql/updates/world/3.3.5/2016_10_03_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_03_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_01_world.sql index bef2bdc5d45..bef2bdc5d45 100644 --- a/sql/updates/world/3.3.5/2016_10_03_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_03_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_02_world_335.sql index 7762f638efa..7762f638efa 100644 --- a/sql/updates/world/3.3.5/2016_10_03_02_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_02_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_03_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_03_world.sql index c4b0ed2b301..c4b0ed2b301 100644 --- a/sql/updates/world/3.3.5/2016_10_03_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_03_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_04_world.sql index bfa5dd72b69..bfa5dd72b69 100644 --- a/sql/updates/world/3.3.5/2016_10_03_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_03_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_00_world.sql index 5558d56650c..5558d56650c 100644 --- a/sql/updates/world/3.3.5/2016_10_04_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_01_world.sql index dc22b99b4ad..dc22b99b4ad 100644 --- a/sql/updates/world/3.3.5/2016_10_04_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_02_world.sql index b8981276d96..b8981276d96 100644 --- a/sql/updates/world/3.3.5/2016_10_04_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_03_world.sql index e9e1413252e..e9e1413252e 100644 --- a/sql/updates/world/3.3.5/2016_10_04_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_04_world.sql index 7893ed3c2f1..7893ed3c2f1 100644 --- a/sql/updates/world/3.3.5/2016_10_04_04_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_04_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_05_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_05_world_335.sql index 432a3fe70e3..432a3fe70e3 100644 --- a/sql/updates/world/3.3.5/2016_10_04_05_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_05_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_04_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_06_world.sql index 6f5ff702974..6f5ff702974 100644 --- a/sql/updates/world/3.3.5/2016_10_04_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_04_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_00_world.sql index d739c1a3828..d739c1a3828 100644 --- a/sql/updates/world/3.3.5/2016_10_05_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_01_world.sql index 7fcd1510272..7fcd1510272 100644 --- a/sql/updates/world/3.3.5/2016_10_05_01_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_01_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_02_world.sql index 99a1767648f..99a1767648f 100644 --- a/sql/updates/world/3.3.5/2016_10_05_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_03_world.sql index 41f582280f8..41f582280f8 100644 --- a/sql/updates/world/3.3.5/2016_10_05_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_04_world_335.sql index fecd2e58e14..fecd2e58e14 100644 --- a/sql/updates/world/3.3.5/2016_10_05_04_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_04_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_05_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_05_world_335.sql index a01a4b9c7b8..a01a4b9c7b8 100644 --- a/sql/updates/world/3.3.5/2016_10_05_05_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_05_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_06_world.sql index fd34f7cd34b..fd34f7cd34b 100644 --- a/sql/updates/world/3.3.5/2016_10_05_06_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_06_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_07_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_07_world_335.sql index 4602d02027f..4602d02027f 100644 --- a/sql/updates/world/3.3.5/2016_10_05_07_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_07_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_08_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_08_world_335.sql index 2a56677a079..2a56677a079 100644 --- a/sql/updates/world/3.3.5/2016_10_05_08_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_08_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_09_world.sql index f963bce4012..f963bce4012 100644 --- a/sql/updates/world/3.3.5/2016_10_05_09_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_09_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_10_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_10_world_335.sql index 534e8a46145..534e8a46145 100644 --- a/sql/updates/world/3.3.5/2016_10_05_10_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_10_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_11_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_11_world_335.sql index f9f6df2a75b..f9f6df2a75b 100644 --- a/sql/updates/world/3.3.5/2016_10_05_11_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_11_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_05_12_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_12_world_335.sql index 6b2cd2799a3..6b2cd2799a3 100644 --- a/sql/updates/world/3.3.5/2016_10_05_12_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_05_12_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_00_world.sql index 11e6ccdff18..11e6ccdff18 100644 --- a/sql/updates/world/3.3.5/2016_10_06_00_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_00_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_01_world_335.sql index 58f062b27f5..58f062b27f5 100644 --- a/sql/updates/world/3.3.5/2016_10_06_01_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_01_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_02_world.sql index 85105ca2c50..85105ca2c50 100644 --- a/sql/updates/world/3.3.5/2016_10_06_02_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_02_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_03_world.sql index 2dd3e833f7f..2dd3e833f7f 100644 --- a/sql/updates/world/3.3.5/2016_10_06_03_world.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_03_world.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_04_world_335.sql index 7168b4f3d97..7168b4f3d97 100644 --- a/sql/updates/world/3.3.5/2016_10_06_04_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_04_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_05_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_05_world_335.sql index 0039967a07d..0039967a07d 100644 --- a/sql/updates/world/3.3.5/2016_10_06_05_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_05_world_335.sql diff --git a/sql/updates/world/3.3.5/2016_10_06_06_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_06_world_335.sql index 8f888c49c16..8f888c49c16 100644 --- a/sql/updates/world/3.3.5/2016_10_06_06_world_335.sql +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_06_world_335.sql diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_07_world.sql new file mode 100644 index 00000000000..765f48098c3 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_06_07_world.sql @@ -0,0 +1,11 @@ +-- Update equip for Brewfest Reveler +DELETE FROM `creature_equip_template` WHERE `CreatureID`=24484; +INSERT INTO `creature_equip_template` (`CreatureID`, `ID`, `ItemID1`, `ItemID2`, `ItemID3`) VALUES +(24484, 8, 37059, 0, 0), -- 24484 +(24484, 7, 2704, 0, 0), -- 24484 +(24484, 6, 13861, 0, 0), -- 24484 +(24484, 5, 46733, 0, 0), -- 24484 +(24484, 4, 2703, 0, 13859), -- 24484 +(24484, 3, 33963, 0, 0), -- 24484 +(24484, 2, 2705, 0, 0), -- 24484 +(24484, 1, 2703, 0, 0); -- 24484 diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_00_world.sql new file mode 100644 index 00000000000..0ecd7195b6d --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_00_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|512 WHERE `entryorguid` IN (27017); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_01_world.sql new file mode 100644 index 00000000000..5d6d553a6f2 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_01_world.sql @@ -0,0 +1,6 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_item_argent_dawn_commission','spell_warr_victorious','spell_dk_rune_strike_proc','spell_pet_charge'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(17670, 'spell_item_argent_dawn_commission'), +(32216, 'spell_warr_victorious'), +(56817, 'spell_dk_rune_strike_proc'), +(57627, 'spell_pet_charge'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_02_world.sql new file mode 100644 index 00000000000..7df71fc4e03 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_02_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject_template_addon` SET `flags`=`flags`|4 WHERE `entry` IN (SELECT `entry` FROM `gameobject_template` WHERE `type`=2 AND `data3`=0); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_03_world_335.sql new file mode 100644 index 00000000000..d45e3437937 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_07_03_world_335.sql @@ -0,0 +1,68 @@ +-- +DELETE FROM `quest_template_addon` WHERE `ID`=919; +INSERT INTO `quest_template_addon` (`ID`, `PrevQuestID`) VALUES +(919, 997); + +UPDATE quest_offer_reward SET `RewardText`="Ah, it's here! I have waited for this rare earth for quite some time. I hope it's still fresh...$b$bThank you for bringing it to me, $N. You are a $R who is generous with $Ghis:her; time." WHERE `ID`=997; + +UPDATE `smart_scripts` SET `link`=3 WHERE `entryorguid`=2080 AND `id` IN (0, 1, 2); +DELETE FROM `smart_scripts` WHERE `entryorguid`=2080 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 +(2080, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Quest Finished - Set Run Off"); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=208000; +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 +(208000, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Remove Npc Flag Questgiver"), +(208000, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 0"), +(208000, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9508.02, 715.749, 1255.89, 0, "Denalan - On Script - Move To Position"), +(208000, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9507.66, 718.009, 1255.89, 0, "Denalan - On Script - Move To Position"), +(208000, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9505.56, 719.088, 1256.2, 0, "Denalan - On Script - Move To Position"), +(208000, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 5, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Play Emote 16"), +(208000, 9, 6, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Set Orientation to Invoker"), +(208000, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 1"), +(208000, 9, 8, 0, 0, 0, 100, 0, 5000, 5000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9506.9199, 713.7660, 1255.89, 0, "Denalan - Script - Move"), +(208000, 9, 9, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Reset Orientation"), +(208000, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Add Npc Flag Questgiver"); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=208001; +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 +(208001, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Remove Npc Flag Questgiver"), +(208001, 9, 1, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 2"), +(208001, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9508.02, 715.749, 1255.89, 0, "Denalan - On Script - Move To Position"), +(208001, 9, 3, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9507.66, 718.009, 1255.89, 0, "Denalan - On Script - Move To Position"), +(208001, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9505.56, 719.088, 1256.2, 0, "Denalan - On Script - Move To Position"), +(208001, 9, 5, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 5, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Play Emote 16"), +(208001, 9, 6, 0, 0, 0, 100, 0, 3500, 3500, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 3"), +(208001, 9, 7, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9506.9199, 713.7660, 1255.89, 0, "Denalan - Script - Move"), +(208001, 9, 8, 0, 0, 0, 100, 0, 500, 500, 0, 0, 70, 60, 0, 0, 0, 0, 0, 14, 67984, 7510, 0, 0, 0, 0, 0, "Denalan - On Script - Respawn Closest Gameobject 'Sprouted Frond'"), +(208001, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 70, 60, 0, 0, 0, 0, 0, 14, 42936, 7510, 0, 0, 0, 0, 0, "Denalan - On Script - Respawn Closest Gameobject 'Sprouted Frond'"), +(208001, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 70, 60, 0, 0, 0, 0, 0, 14, 30276, 7510, 0, 0, 0, 0, 0, "Denalan - On Script - Respawn Closest Gameobject 'Sprouted Frond'"), +(208001, 9, 11, 0, 0, 0, 100, 0, 2500, 2500, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Reset Orientation"), +(208001, 9, 12, 0, 0, 0, 100, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Add Npc Flag Questgiver"); + +DELETE FROM `smart_scripts` WHERE `entryorguid`=208002; +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 +(208002, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Remove Npc Flag Questgiver"), +(208002, 9, 1, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 4"), +(208002, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 1, 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 5"), +(208002, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9508.02, 715.749, 1255.89, 0, "Denalan - On Script - Move To Position"), +(208002, 9, 4, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9507.66, 718.009, 1255.89, 0, "Denalan - On Script - Move To Position"), +(208002, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9505.56, 719.088, 1256.2, 0, "Denalan - On Script - Move To Position"), +(208002, 9, 6, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 5, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Play Emote 16"), +(208002, 9, 7, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 6, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 6"), +(208002, 9, 8, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 12, 3569, 3, 20000, 0, 0, 0, 8, 0, 0, 0, 9505.13, 722.011, 1255.94, 0.0244875, "Denalan - On Script - Summon Creature 'Bogling'"), +(208002, 9, 9, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 3569, 3, 20000, 0, 0, 0, 8, 0, 0, 0, 9504.09, 720.294, 1255.94, 1.00709, "Denalan - On Script - Summon Creature 'Bogling'"), +(208002, 9, 10, 0, 0, 0, 100, 0, 0, 0, 0, 0, 12, 3569, 3, 20000, 0, 0, 0, 8, 0, 0, 0, 9504.13, 721.459, 1255.94, 6.24727, "Denalan - On Script - Summon Creature 'Bogling'"), +(208002, 9, 11, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 19, 3569, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Say Line 1 (Bogling)"), +(208002, 9, 12, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 69, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 9506.9199, 713.7660, 1255.89, 0, "Denalan - Script - Move"), +(208002, 9, 13, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 66, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Reset Orientation"), +(208002, 9, 14, 0, 0, 0, 100, 0, 0, 0, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Denalan - On Script - Add Npc Flag Questgiver"); + +DELETE FROM `creature_text` WHERE `entry`=2080 AND `groupid`=7; +DELETE FROM `creature_text` WHERE `entry`=3569 AND `groupid`=1; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(3569, 1, 0, "%s rises from the soil!", 16, 0, 100, 1, 0, 0, 1174, 0, "Bogling"); + +UPDATE `creature_text` SET `type`=16, `emote`=0 WHERE `entry`=2080 AND `groupid` IN (2, 4, 6); + +UPDATE `smart_scripts` SET `event_chance`=100 WHERE `entryorguid`=3569; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_00_world_335.sql new file mode 100644 index 00000000000..0dd3bbef196 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_00_world_335.sql @@ -0,0 +1,38 @@ +-- +UPDATE `creature_template` SET `ScriptName`="npc_wg_guard" WHERE `entry` IN (30739, 30740); + +SET @GUID := 94920; +DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+17; +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 +(@GUID , 30739, 571, 0, 0, 1, 64, 0, 1, 5150.27, 2786.02, 409.547, 3.22886, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+1 , 30739, 571, 0, 0, 1, 64, 0, 1, 5150.66, 2777.95, 409.405, 2.94961, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+2 , 30739, 571, 0, 0, 1, 64, 0, 1, 5193.63, 2734.17, 409.273, 4.69494, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+3 , 30739, 571, 0, 0, 1, 64, 0, 1, 5200.5, 2733.89, 409.273, 4.67748, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+4 , 30739, 571, 0, 0, 1, 64, 0, 1, 5264.65, 2670.19, 409.182, 3.07178, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+5 , 30739, 571, 0, 0, 1, 64, 0, 1, 5265.31, 2663.15, 409.182, 3.12414, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+6 , 30739, 571, 0, 0, 1, 64, 0, 1, 5307.02, 2613.9, 409.172, 4.69494, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+7 , 30739, 571, 0, 0, 1, 64, 0, 1, 5311.13, 3061.04, 408.81, 1.50098, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+8 , 30739, 571, 0, 0, 1, 64, 0, 1, 5315.87, 2614.22, 408.973, 4.67748, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+9 , 30739, 571, 0, 0, 1, 64, 0, 1, 5318.09, 3060.63, 408.883, 1.62316, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+10, 30739, 571, 0, 0, 1, 64, 0, 1, 5149.4, 2897.04, 409.304, 3.03687, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+11, 30739, 571, 0, 0, 1, 64, 0, 1, 5149.52, 2904.19, 409.276, 3.07178, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+12, 30739, 571, 0, 0, 1, 64, 0, 1, 5192.79, 2948.45, 409.275, 1.50098, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+13, 30739, 571, 0, 0, 1, 64, 0, 1, 5201.65, 2948.78, 409.275, 1.62316, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+14, 30739, 571, 0, 0, 1, 64, 0, 1, 5265.28, 3010.1, 408.896, 2.82743, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+15, 30739, 571, 0, 0, 1, 64, 0, 1, 5265.48, 3017.4, 408.583, 3.07178, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+16, 30739, 571, 0, 0, 1, 64, 0, 1, 5154.23, 2833.82, 409.262, 3.12414, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0), +(@GUID+17, 30739, 571, 0, 0, 1, 64, 0, 1, 5154.12, 2847.89, 409.248, 3.07178, 180, 0, 0, 11001, 0, 0, 0, 0, 0, 0); + +UPDATE `creature` SET `curhealth`=11001, `spawntimesecs`=180 WHERE `id` IN (30739, 30740); +DELETE FROM `creature_addon` WHERE `guid` IN (SELECT `guid` FROM `creature` WHERE `id` IN (30739, 30740)); + +UPDATE `creature` SET `position_x`=5307.75, `position_y`=3008.87, `position_z`=409.193, `orientation`=4.78168 WHERE `guid`=131266; +UPDATE `creature` SET `phaseMask`=64, `modelid`=0, `spawndist`=0, `MovementType`=0 WHERE `guid` IN (131261, 131266, 131258, 131262, 131259, 131260, 131269, 131264, 131839, 131267, 131263); + +DELETE FROM `creature` WHERE `guid`=12548; +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 +(12548, 15351, 571, 0, 0, 1, 128, 15389, 0, 5467.59, 2841.06, 418.758, 1.39626, 180, 0, 0, 126000, 0, 0, 0, 0, 0, 0); +DELETE FROM `creature_addon` WHERE `guid` IN (131839, 12548); +INSERT INTO `creature_addon` (`guid`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(131839, 0, 0, 0, 257, 0, ""), +(12548, 0, 0, 0, 257, 0, ""); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_01_world_335.sql new file mode 100644 index 00000000000..5f9cd3d6654 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_01_world_335.sql @@ -0,0 +1,2 @@ +-- Update Midsummer Music Doodad script +UPDATE `gameobject_template` SET `ScriptName`='go_midsummer_music' WHERE `entry`=188174; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_02_world_335.sql new file mode 100644 index 00000000000..7cdf4474281 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_02_world_335.sql @@ -0,0 +1,2 @@ +-- Update Darkmoon Faire Music Doodad script +UPDATE `gameobject_template` SET `ScriptName`='go_darkmoon_faire_music' WHERE `entry`=180335; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_03_world_335.sql new file mode 100644 index 00000000000..a0aa0e659bc --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_03_world_335.sql @@ -0,0 +1,2 @@ +-- Update Pirate Day Music Doodad script +UPDATE `gameobject_template` SET `ScriptName`='go_pirate_day_music' WHERE `entry`=190363; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_04_world_335.sql new file mode 100644 index 00000000000..a578362a8e6 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_04_world_335.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature` SET `phaseMask`=64 WHERE `guid` IN (131265, 131268, 131271, 131270); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_05_world.sql new file mode 100644 index 00000000000..3224469d5eb --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_05_world.sql @@ -0,0 +1,11 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (19, 20) AND `SourceEntry` IN (13177, 13179, 13178, 13180); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(19, 0, 13177, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_alliance", "Alliance quest 'No Mercy for the Merciless' is available if Wintergrasp is held by Alliance"), +(20, 0, 13177, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_alliance", "Quest mark for Alliance quest 'No Mercy for the Merciless' is available if Wintergrasp is held by Alliance"), +(19, 0, 13179, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_horde", "Alliance quest 'No Mercy for the Merciless' is available if Wintergrasp is held by Horde"), +(20, 0, 13179, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_horde", "Quest mark for Alliance quest 'No Mercy for the Merciless' is available if Wintergrasp is held by Horde"), +(19, 0, 13178, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_horde", "Horde quest 'Slay Them All!' is available if Wintergrasp is held by Horde"), +(20, 0, 13178, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_horde", "Quest mark for Horde quest 'Slay Them All!' is available if Wintergrasp is held by Horde"), +(19, 0, 13180, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_alliance", "Horde quest 'Slay Them All!' is available if Wintergrasp is held by Alliance"), +(20, 0, 13180, 0, 0, 32, 0, 144, 0, 0, 0, 0, 0, "condition_is_wintergrasp_alliance", "Quest mark for Horde quest 'Slay Them All!' is available if Wintergrasp is held by Alliance"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_06_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_06_world_335.sql new file mode 100644 index 00000000000..84663326d90 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_06_world_335.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `ScriptName`="npc_wg_give_promotion_credit" WHERE `entry` IN (30739, 30740, 31036, 31051, 31052, 31053, 31054, 31091, 31101, 31102, 31106, 31107, 31151, 31153); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_07_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_07_world_335.sql new file mode 100644 index 00000000000..d2d0a865af6 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_08_07_world_335.sql @@ -0,0 +1,3 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_lock_and_load_dummy'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(56342, 'spell_hun_lock_and_load_dummy'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_00_world.sql new file mode 100644 index 00000000000..1a6371aa99a --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_00_world.sql @@ -0,0 +1,169 @@ +-- Evasive Maneuvers, proc charges on miss instead of on dodge +UPDATE `spell_proc` SET `HitMask`=0x4 WHERE `SpellId`=50240; + +UPDATE `spell_proc` SET `SpellTypeMask`=`SpellTypeMask`|0x1 WHERE `SpellId` IN ( +-58872, -- Damage Shield +-57878, -- Natural Reaction +-52127, -- Water Shield +-51634, -- Focused Attacks +-49027, -- Bloodworms +-48988, -- Bloody Vengeance +-46867, -- Wrecking Crew +-46854, -- Trauma +-45234, -- Focused Will +-41635, -- Prayer of Mending +-34950, -- Go for the Throat +-34935, -- Backlash +-34500, -- Expose Weakness +-33881, -- Natural Perfection +-33150, -- Surge of Light +-33142, -- Blessed Resilience +-30701, -- Elemental Absorption +-30299, -- Nether Protection +-30160, -- Elemental Devastation +-20049, -- Vengeance +-16958, -- Primal Fury +-16256, -- Flurry +-12319, -- Flurry +7383, -- Water Bubble +8178, -- Grounding Totem Effect +15600, -- Hand of Justice +16164, -- Elemental Focus +16620, -- Proc Self Invulnerability +17364, -- Stormstrike +20164, -- Seal of Justice +20165, -- Seal of Light +20166, -- Seal of Wisdom +20375, -- Seal of Command +20784, -- Tamed Pet Passive 07 (DND) +23552, -- Lightning Shield +23578, -- Expose Weakness +23581, -- Bloodfang +23686, -- Lightning Strike +23689, -- Heroism +24353, -- Primal Instinct +25669, -- Decapitate +26480, -- Badge of the Swarmguard +27656, -- Flame Lash +27774, -- The Furious Storm +28752, -- Adrenaline Rush +28845, -- Cheat Death +29150, -- Electric Discharge +29501, -- Frost Arrow +29624, -- Searing Arrow +29625, -- Flaming Cannonball +29626, -- Shadow Bolt +29632, -- Shadow Bolt +29633, -- Fire Blast +29634, -- Quill Shot +29635, -- Flaming Shell +29636, -- Venom Shot +29637, -- Keeper's Sting +30823, -- Shamanistic Rage +32734, -- Earth Shield +32844, -- Lesser Heroism +33297, -- Spell Haste Trinket +33510, -- Health Restore +33648, -- Reflection of Torment +34074, -- Aspect of the Viper +34320, -- Call of the Nexus +34355, -- Poison Shield +34586, -- Romulo's Poison +34598, -- Karazhan Caster Robe +34774, -- Magtheridon Melee Trinket +34827, -- Water Shield +35080, -- Band of the Eternal Champion +35083, -- Band of the Eternal Sage +35086, -- Band of the Eternal Restorer +35121, -- Nether Power +36111, -- World Breaker +37170, -- Free Finisher Chance +37213, -- Mana Cost Reduction +37600, -- Offensive Discount +37657, -- Lightning Capacitor +38026, -- Viscous Shield +38164, -- Unyielding Knights +38290, -- Santos' Blessing +38350, -- Crit Proc Heal +38857, -- Spell Ground +39027, -- Poison Shield +39442, -- Aura of Wrath +39443, -- Aura of Wrath +40475, -- Black Temple Melee Trinket +40482, -- Mage Tier 6 Trinket +41434, -- The Twin Blades of Azzinoth +41989, -- Fists of Fury +42083, -- Fury of the Crashing Waves +42135, -- Lesser Rune of Warding +42136, -- Greater Rune of Warding +45054, -- Augment Pain +45057, -- Evasive Maneuvers +45354, -- Item - Sunwell Dungeon Melee Trinket +45355, -- Item - T7 Melee Trinket Base +45481, -- Sunwell Exalted Caster Neck +45482, -- Sunwell Exalted Melee Neck +45483, -- Sunwell Exalted Tank Neck +46569, -- Sunwell Exalted Caster Neck +46662, -- Deathfrost +49222, -- Bone Shield +49592, -- Temporal Rift +52420, -- Deflection +52898, -- Spell Damping +53397, -- Invigoration +53646, -- Demonic Pact +54278, -- Empowered Imp +54646, -- Focus Magic +54695, -- Item - Death Knight's Anguish Base +54707, -- Sonic Awareness (DND) +54841, -- Thunder Capacitor +54909, -- Demonic Pact +55689, -- Glyph of Shadow +55747, -- Argent Fury +55776, -- Swordguard Embroidery +56451, -- Earth Shield +57345, -- Darkmoon Card: Greatness +58444, -- Worg Tooth Oatmeal Stout +58901, -- Tears of Anguish +59345, -- Chagrin +59630, -- Black Magic +60066, -- Rage of the Unraveller +60221, -- Essence of Gossamer +60301, -- Meteorite Whetstone +60306, -- Vestige of Haldor +60317, -- Signet of Edward the Odd +60436, -- Grim Toll +60442, -- Bandit's Insignia +60473, -- Forge Ember +60487, -- Extract of Necromatic Power [sic] +61356, -- Invigorating Earthsiege Diamond Passive +62115, -- Strength of the Titans +63251, -- Glory of the Jouster +64792, -- Blood of the Old God +65007, -- Eye of the Broodmother +67151, -- Item - Hunter T9 4P Bonus (Steady Shot) +67712, -- Item - Coliseum 25 Normal Caster Trinket +67758, -- Item - Coliseum 25 Heroic Caster Trinket +71634, -- Item - Icecrown 25 Normal Tank Trinket 1 +71640, -- Item - Icecrown 25 Heroic Tank Trinket 1 +72417, -- Item - Icecrown Reputation Ring Caster Trigger +75475, -- Item - Chamber of Aspects 25 Tank Trinket +75481 -- Item - Chamber of Aspects 25 Heroic Trinket +); + +UPDATE `spell_proc` SET `SpellTypeMask`=`SpellTypeMask`|0x2 WHERE `SpellId` IN ( +-51940, -- Earthliving Weapon (Passive) +-47509, -- Divine Aegis +-33150, -- Surge of Light +33953, -- Essence of Life +34320, -- Call of the Nexus +35086, -- Band of the Eternal Restorer +38299, -- HoTs on Heals +45484, -- Sunwell Exalted Healer Neck +57345, -- Darkmoon Card: Greatness +60473, -- Forge Ember +60529, -- Forethought Talisman +64411, -- Blessing of Ancient Kings +64415, -- Val'anyr Hammer of Ancient Kings - Equip Effect +65007, -- Eye of the Broodmother +72419 -- Item - Icecrown Reputation Ring Healer Trigger +); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_01_world_335.sql new file mode 100644 index 00000000000..54f21122326 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_01_world_335.sql @@ -0,0 +1,27 @@ +-- +SET @Shark := 50289; + +DELETE FROM `gameobject_loot_template` WHERE `Item`= @Shark; +INSERT INTO `gameobject_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES +(25662, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Glacial Salmon School - Blacktip Shark'), +(25663, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Fangtooth Herring School - Blacktip Shark'), +(25664, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Dragonfin Angelfish School - Blacktip Shark'), +(25665, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Musselback Sculpin School - Blacktip Shark'), +(25668, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Imperial Manta Ray School - Blacktip Shark'), +(25670, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Moonglow Cuttlefish School - Blacktip Shark'), +(25671, @Shark, 0, 1, 0, 1, 7, 1, 1, 'Deep Sea Monsterbelly School - Blacktip Shark'), +(25673, @Shark, 0, 1, 0, 1, 4, 1, 1, 'Nettlefish School - Blacktip Shark'), +(25674, @Shark, 0, 1, 0, 1, 3, 1, 1, 'Glassfin Minnow School - Blacktip Shark'); + +-- Blacktip Shark loot Conditions +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 4 AND `SourceGroup` IN (25662,25663,25664,25665,25668,25670,25671,25673,25674) AND `SourceEntry`= @Shark; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(4, 25662, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Glacial Salmon School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25663, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Fangtooth Herring School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25664, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Dragonfin Angelfish School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25665, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Musselback Sculpin School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25668, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Imperial Manta Ray School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25670, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Moonglow Cuttlefish School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25671, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Deep Sea Monsterbelly School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25673, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Nettlefish School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"), +(4, 25674, @Shark, 0, 0, 12, 0, 63, 0, 0, 0, 0, 0, '', "Glassfin Minnow School drops Blacktip Shark only when event 'Kalu'ak Fishing Derby' is active"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_02_world.sql new file mode 100644 index 00000000000..18b368cf9d9 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_09_02_world.sql @@ -0,0 +1,37 @@ +-- +SET @Dustbringer := 44505; + +DELETE FROM `gameobject_loot_template` WHERE `Item`= @Dustbringer; +INSERT INTO `gameobject_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES +(25662, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'), +(25663, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'), +(25664, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'), +(25665, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'), +(25668, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'), +(25670, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'), +(25671, @Dustbringer, 0, 1, 0, 1, 8, 1, 1, 'Dustbringer'), +(25673, @Dustbringer, 0, 1, 0, 1, 5, 1, 1, 'Dustbringer'), +(25674, @Dustbringer, 0, 1, 0, 1, 4, 1, 1, 'Dustbringer'); + +DELETE FROM `fishing_loot_template` WHERE `Item`= @Dustbringer; +INSERT INTO `fishing_loot_template` (`Entry`,`Item`,`Reference`,`Chance`,`QuestRequired`,`LootMode`,`GroupId`,`MinCount`,`MaxCount`,`Comment`) VALUES +(65, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(394, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(2817, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(3711, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(3980, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(3982, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(3994, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(3999, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4001, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4002, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4039, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4043, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4055, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4058, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4059, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4071, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4109, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4134, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4263, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'), +(4479, @Dustbringer, 0, 1, 0, 1, 2, 1, 1, 'Dustbringer'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_00_world.sql new file mode 100644 index 00000000000..30fb4c42246 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_00_world.sql @@ -0,0 +1,17 @@ +-- +DELETE FROM `conditions` WHERE `SourceEntry`=24539; +DELETE FROM `conditions` WHERE `SourceGroup`=9010; + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2453900, 2453901); +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 +(2453900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Say Line 1"), +(2453900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 2, 1080, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Set Faction 1080"), +(2453900, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Set Phase 1"), +(2453900, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Evade"), +(2453900, 9, 4, 0, 0, 0, 100, 0, 30000, 30000, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Set Phase 0"), +(2453901, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Close Gossip"), +(2453901, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 56, 34115, 1, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Add Item 'Silvermoon Harry's Debt'"), +(2453901, 9, 2, 0, 0, 0, 100, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "'Silvermoon' Harry - On Script - Set Phase 0"); + +UPDATE `smart_scripts` SET `event_phase_mask`=1 WHERE `entryorguid`=24539 AND `id`=5; +UPDATE `smart_scripts` SET `action_type`=49, `action_param1`=0, `target_type`=7, `comment`="'Silvermoon' Harry - On Gossip Option 0 Selected - Attack Invoker" WHERE `entryorguid`=24539 AND `id`=3; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_01_world.sql new file mode 100644 index 00000000000..a8da054d270 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_01_world.sql @@ -0,0 +1,16 @@ +-- +UPDATE `creature_template` SET `ScriptName`="" WHERE `entry` IN (27017); +DELETE FROM `creature_text` WHERE `entry`=27017; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `comment`, `broadcasttextid`) VALUES +(27017,0,0,'Initiating energy collection.',12,0,100,0,0,0,'War Golem',26153), +(27017,1,0,'Energy collection complete.',12,0,100,0,0,0,'War Golem',26154); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (2701700) AND `source_type`=9; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (27017) 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 +(27017, 0, 0, 0, 38, 0, 100, 512, 0, 1, 4000, 4000, 80, 2701700, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Depleted War Golem - On Data Set 0 1 - Actionlist"), +(2701700, 9, 0, 0, 0, 0, 100, 512, 0, 0, 0, 0, 69, 0, 0, 0, 0, 0, 0, 19, 26407, 25, 1, 0, 0, 0, 0, "Depleted War Golem - Actionlist - Move to pos"), +(2701700, 9, 1, 0, 0, 0, 100, 512, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Depleted War Golem - Actionlist - Say text 1"), +(2701700, 9, 2, 0, 0, 0, 100, 512, 3000, 3000, 0, 0, 11, 47799, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Depleted War Golem - Actionlist - cast"), +(2701700, 9, 3, 0, 0, 0, 100, 512, 5000, 5000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Depleted War Golem - Actionlist - Say text 2"), +(2701700, 9, 4, 0, 0, 0, 100, 512, 0, 0, 0, 0, 11, 47797, 0, 0, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, "Depleted War Golem - Actionlist - Cast 'War Golem Charge Credit'"), +(2701700, 9, 5, 0, 0, 0, 100, 512, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Depleted War Golem - Actionlist - evade"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_02_world_335.sql new file mode 100644 index 00000000000..58095f67c25 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_02_world_335.sql @@ -0,0 +1,11 @@ +-- +UPDATE `quest_template` SET `AllowableRaces`=8 WHERE `ID` IN (6344, 6341, 6342, 6343); + +UPDATE `quest_offer_reward` SET `RewardText`="I bid you greetings, $N. Your name rings loudly in Darnassus, for you show promise. But we shall soon see if you possess the strength of will to follow the path of the $C." WHERE `ID`=1684; + +UPDATE `creature_template` SET `faction`=189 WHERE `entry`=1986; + +UPDATE `smart_scripts` SET `action_param2`=2 WHERE `entryorguid`=16819 AND `id`=1; + +UPDATE `smart_scripts` SET `event_param2`=30000, `event_param4`=30000 WHERE `entryorguid`=2030 AND `id`=2; +UPDATE `smart_scripts` SET `event_param2`=30000, `event_param4`=30000 WHERE `entryorguid`=2009 AND `id`=0; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_03_world.sql new file mode 100644 index 00000000000..9bbc05447ca --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_03_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject` SET `spawntimesecs` = 2 WHERE `id` IN (188518,188530,190208,188461,187022,187023,187026,187027,187032,187381,186885,186886,187033,186684,176189); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_04_world_335.sql new file mode 100644 index 00000000000..d01dad033a5 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_10_04_world_335.sql @@ -0,0 +1 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_hun_lock_and_load_dummy'; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_00_world.sql new file mode 100644 index 00000000000..1804b59eb7d --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_00_world.sql @@ -0,0 +1,10 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry` IN (42166, 45072); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 42166, 0, 0, 31, 0, 3, 24198, 0, 0, 0, 0, "", "Spell 'Plagued Blood Explosion' EFFECT_0 can only hit 'Plagued Dragonflayer Runecaster' OR"), +(13, 1, 42166, 0, 1, 31, 0, 3, 24199, 0, 0, 0, 0, "", "Spell 'Plagued Blood Explosion' EFFECT_0 can only hit 'Plagued Dragonflayer Handler' OR"), +(13, 1, 42166, 0, 2, 31, 0, 3, 23564, 0, 0, 0, 0, "", "Spell 'Plagued Blood Explosion' EFFECT_0 can only hit 'Plagued Dragonflayer Tribesman'"), +(13, 1, 45072, 0, 0, 31, 0, 3, 25031, 0, 0, 0, 0, "", "Spell 'Arcane Charges' EFFECT_0 can only hit 'Pit Overlord' OR"), +(13, 1, 45072, 0, 1, 31, 0, 3, 25033, 0, 0, 0, 0, "", "Spell 'Arcane Charges' EFFECT_0 can only hit 'Eredar Sorcerer' OR"), +(13, 1, 45072, 0, 2, 31, 0, 3, 25158, 0, 0, 0, 0, "", "Spell 'Arcane Charges' EFFECT_0 can only hit 'Brutallus' OR"), +(13, 1, 45072, 0, 3, 31, 0, 3, 25030, 0, 0, 0, 0, "", "Spell 'Arcane Charges' EFFECT_0 can only hit 'Wrath Enforcer'"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_01_world.sql new file mode 100644 index 00000000000..8e5202d9d85 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_01_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gossip_menu` SET `text_id`=12178 WHERE `entry`=9025; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_02_world.sql new file mode 100644 index 00000000000..721869086ab --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_02_world.sql @@ -0,0 +1,20 @@ +-- +DELETE FROM `spell_scripts` WHERE `id`=43375; +DELETE FROM `spell_script_names` WHERE `spell_id` IN (43375, 43376, 43378, 43972); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(43972, "spell_q11306_mixing_blood"), +(43375, "spell_q11306_mixing_vrykul_blood"), +(43376, "spell_q11306_failed_mix_43376"), +(43378, "spell_q11306_failed_mix_43378"); + +DELETE FROM creature_text WHERE entry IN (24042, 24251); +INSERT INTO creature_text (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(24042, 0, 0, "$N's concoction is ruined. A new one must be created from scratch.", 16, 0, 100, 0, 0, 0, 23540, 0, "Generic Trigger LAB"), +(24042, 1, 0, "The failed concoction spills on the floor and appears to come to life!", 16, 0, 100, 0, 0, 0, 23071, 0, "Generic Trigger LAB"), +(24251, 0, 0, "The mixture! It moves!", 14, 0, 100, 0, 0, 0, 23101, 0, "Chief Plaguebringer Harris"); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=24279; +DELETE FROM `smart_scripts` WHERE `entryorguid`=24279; +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 +(24279, 0, 0, 0, 4, 0, 100, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 19, 24251, 0, 0, 0, 0, 0, 0, "Animated Plague Slime - On Aggro - Talk 0 (Chief Plaguebringer Harris) (no repeat)"), +(24279, 0, 1, 0, 0, 0, 100, 0, 0, 0, 10000, 10000, 11, 3335, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Animated Plague Slime - In Combat - Cast Dark Sludge"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_03_world.sql new file mode 100644 index 00000000000..555b5d3359e --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_03_world.sql @@ -0,0 +1,5 @@ +-- +DELETE FROM `conditions` WHERE `SourceEntry` IN (35813, 33612) AND `SourceTypeOrReferenceId`=23; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(23, 24539, 35813, 0, 0, 9, 0, 11476, 0, 0, 0, 0, 0, "", "Shiny Knife can be bought only if on quest 'A Carver and a Croaker'"), +(23, 24291, 33612, 0, 0, 9, 0, 11309, 0, 0, 0, 0, 0, "", "Fresh Pound of Flesh can be bought only if on quest 'Parts for the Job'"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_04_world.sql new file mode 100644 index 00000000000..fb939805c23 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_04_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_loot_template` SET `Chance`=100 WHERE `Item`=44663; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_05_world.sql new file mode 100644 index 00000000000..0fbf2a9812e --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_05_world.sql @@ -0,0 +1,40 @@ +-- +SET @CGUID := 12571; +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, 24900, 571, 0, 0, 1, 1, 0, 0, 529.2123, -3530.377, 12.97082, 0, 60, 0, 0, 1, 0, 2, 0, 0, 0, 0); + +DELETE FROM `creature_template_addon` WHERE `entry`=24900; +INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES +(24900, 24900, 0, 0, 0, 0, ""); + +DELETE FROM `waypoint_data` WHERE `id`=24900; +INSERT INTO `waypoint_data` (`id`, `point`, `position_x`, `position_y`, `position_z`, `orientation`, `delay`, `move_type`, `action`, `action_chance`, `wpguid`) VALUES +(24900, 1, 529.2123, -3530.377, 12.97082, 0, 0, 0, 0, 100, 0), +(24900, 2, 520.7833, -3528.544, 12.92207, 0, 0, 0, 0, 100, 0), +(24900, 3, 508.5591, -3526.409, 17.6906, 0, 0, 0, 0, 100, 0), +(24900, 4, 493.6954, -3522.943, 19.64948, 0, 0, 0, 0, 100, 0), +(24900, 5, 491.2342, -3526.773, 19.97676, 0, 0, 0, 0, 100, 0), +(24900, 6, 491.6969, -3530.882, 19.5777, 0, 0, 0, 0, 100, 0), +(24900, 7, 506.2397, -3536.302, 17.54548, 0, 0, 0, 0, 100, 0), +(24900, 8, 508.6644, -3526.426, 17.6785, 0, 0, 0, 0, 100, 0), +(24900, 9, 515.7313, -3527.45, 12.96216, 0, 0, 0, 0, 100, 0), +(24900, 10, 516.2963, -3534.765, 13.07965, 0, 0, 0, 0, 100, 0), +(24900, 11, 515.4622, -3539.267, 12.93611, 0, 0, 0, 0, 100, 0), +(24900, 12, 525.4114, -3542.12, 13.04245, 0, 0, 0, 0, 100, 0), +(24900, 13, 534.911, -3545.435, 13.23027, 0, 0, 0, 0, 100, 0), +(24900, 14, 538.83, -3540.197, 13.44585, 0, 0, 0, 0, 100, 0), +(24900, 15, 536.6614, -3533.317, 13.13511, 0, 0, 0, 0, 100, 0); + +DELETE FROM `creature_text` WHERE `entry`=24900; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(24900, 0, 0, "Its power courses through me! I AM A GOD!", 12, 0, 100, 0, 0, 0, 23977, 0, "Abdul the Insane"), +(24900, 0, 1, "ABDUL IS STRONG LIKE BULL!", 12, 0, 100, 0, 0, 0, 23978, 0, "Abdul the Insane"), +(24900, 1, 0, "The fury of the Vrykul will consume you!", 12, 0, 100, 0, 0, 0, 23976, 0, "Abdul the Insane"), +(24900, 1, 1, "ARE YOU CHALLENGING ME? I HAVE THE STRENGTH OF TEN MEN!", 12, 0, 100, 0, 0, 0, 23979, 0, "Abdul the Insane"); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=24900; +DELETE FROM `smart_scripts` WHERE entryorguid=24900; +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 +(24900, 0, 0, 0, 1, 0, 100, 0, 2000, 2000, 10000, 10000, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Abdul the Insane - Out of Combat - Talk 0"), +(24900, 0, 1, 0, 4, 0, 100, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Abdul the Insane - On Aggro - Talk 1"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_06_world.sql new file mode 100644 index 00000000000..9ee7370d91f --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_06_world.sql @@ -0,0 +1,35 @@ +-- +SET @CGUID := 97946; + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=24902; +DELETE FROM `smart_scripts` WHERE `entryorguid`=-(@CGUID+14); +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 +(-(@CGUID+14), 0, 0, 0, 1, 0, 100, 0, 1000, 1000, 5000, 5000, 11, 44886, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Abdul Relay - Out of Combat - Cast 'Storm's Fury Staff'"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=44886; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 44886, 0, 0, 31, 0, 3, 24902, 0, 0, 0, 0, "", "Spell Storm's Fury Staff hits Abdul Relay"); + +DELETE FROM `creature` WHERE `guid` BETWEEN @CGUID AND @CGUID+20; +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 , 24902, 571, 0, 0, 1, 1, 0, 0, 510.8039, -3532.589, 28.1855, 0.3141593, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+1 , 24902, 571, 0, 0, 1, 1, 0, 0, 535.8403, -3536.107, 2.473374, 0.5759587, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+2 , 24902, 571, 0, 0, 1, 1, 0, 0, 512.513, -3522.554, 40.32723, 5.72468, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+3 , 24902, 571, 0, 0, 1, 1, 0, 0, 514.409, -3533.298, 20.05545, 5.969026, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+4 , 24902, 571, 0, 0, 1, 1, 0, 0, 514.2958, -3521.107, 29.82574, 4.904375, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+5 , 24902, 571, 0, 0, 1, 1, 0, 0, 527.897, -3537.73, 14.98895, 4.101524, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+6 , 24902, 571, 0, 0, 1, 1, 0, 0, 539.5877, -3539.771, 34.46379, 4.852015, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+7 , 24902, 571, 0, 0, 1, 1, 0, 0, 547.0693, -3542.579, 6.492011, 6.265732, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+8 , 24902, 571, 0, 0, 1, 1, 0, 0, 512.8201, -3538.38, 14.82322, 3.944444, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+9 , 24902, 571, 0, 0, 1, 1, 0, 0, 507.9665, -3525.262, 9.635133, 0.2617994, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+10, 24902, 571, 0, 0, 1, 1, 0, 0, 542.0742, -3540.15, 25.22961, 1.658063, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+11, 24902, 571, 0, 0, 1, 1, 0, 0, 533.3746, -3540.956, 9.142557, 3.909538, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+12, 24902, 571, 0, 0, 1, 1, 0, 0, 544.321, -3534.353, 26.10088, 5.689773, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+13, 24902, 571, 0, 0, 1, 1, 0, 0, 503.9806, -3535.368, 15.09825, 1.413717, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+14, 24902, 571, 0, 0, 1, 1, 0, 0, 502.7896, -3529.978, 1.876146, 5.88176, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+15, 24902, 571, 0, 0, 1, 1, 0, 0, 526.3058, -3531.612, 9.310692, 3.385939, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+16, 24902, 571, 0, 0, 1, 1, 0, 0, 540.0841, -3546.888, 18.9302, 4.677482, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+17, 24902, 571, 0, 0, 1, 1, 0, 0, 507.8998, -3537.92, 37.27644, 5.462881, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+18, 24902, 571, 0, 0, 1, 1, 0, 0, 544.1791, -3536.342, 18.80007, 0.6806784, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+19, 24902, 571, 0, 0, 1, 1, 0, 0, 518.9478, -3528.174, 2.6956, 0.5061455, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340), +(@CGUID+20, 24902, 571, 0, 0, 1, 1, 0, 0, 507.2344, -3540.39, 17.92135, 1.151917, 120, 0, 0, 0, 0, 0, 0, 0, 0, 12340); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_07_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_07_world_335.sql new file mode 100644 index 00000000000..0f2e7a12379 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_07_world_335.sql @@ -0,0 +1,4 @@ +UPDATE `spell_proc` SET `Chance` = 0 WHERE `SpellId` = -51940; +DELETE FROM `spell_script_names` WHERE `ScriptName`='spell_sha_earthliving_weapon'; +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-51940, 'spell_sha_earthliving_weapon'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_08_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_08_world_335.sql new file mode 100644 index 00000000000..d377dc5ae6a --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_11_08_world_335.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `SpellFamilyMask0` = 0x00200000, `HitMask`=0x2, `AttributesMask`=0x2 WHERE `SpellId` = -53569; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_00_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_00_world_335.sql new file mode 100644 index 00000000000..7c14d28bc11 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_00_world_335.sql @@ -0,0 +1,8 @@ +UPDATE `spell_proc` SET `SpellPhaseMask`=0x2 WHERE `SpellId` IN ( +-61846, -- Aspect of the Dragonhawk +-13165, -- Aspect of the Hawk +7434, -- Fate Rune of Unsurpassed Vigor +39958, -- Skyfire Swiftness +55380, -- Skyflare Swiftness +70727 -- Item - Hunter T10 2P Bonus +); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_01_world_335.sql new file mode 100644 index 00000000000..b8553f12e7a --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_01_world_335.sql @@ -0,0 +1,22 @@ +UPDATE `spell_proc` SET `SpellPhaseMask`=0x4 WHERE `SpellId` = 63280; -- Glyph of Totem of Wrath +UPDATE `spell_proc` SET `AttributesMask`=0x2 WHERE `SpellId` IN ( +-50880, -- Icy Talons +-34753, -- Holy Concentration +-33150 -- Surge of Light +); + +UPDATE `spell_proc` SET `AttributesMask`=0x8 WHERE `SpellId` = 31834; -- Light's Grace + +UPDATE `spell_proc` SET `ProcFlags`=0x00010000 WHERE `SpellId` IN ( +71602, -- Item - Icecrown 25 Normal Caster Trinket 1 Base +71645 -- Item - Icecrown 25 Heroic Caster Trinket 1 Base +); + +DELETE FROM `spell_proc` WHERE `SpellId` IN (71571, 71573, 71865, 71868, 75490, 75495); +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(71571, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0), -- Item - Icecrown 10 Normal Caster Trinket +(71573, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x1, 0x2, 0x0, 0x2, 0, 0, 0, 0), -- Item - Icecrown 10 Heroic Caster Trinket +(71865, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0x0, 0x2, 0, 0, 0, 0), -- Item - Icecrown 25 Normal Healer Weapon Proc +(71868, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0x0, 0x2, 0, 0, 0, 0), -- Item - Icecrown 25 Heroic Healer Weapon Proc +(75490, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0x0, 0x2, 0, 0, 0, 0), -- Eyes of Twilight +(75495, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0, 0x2, 0x2, 0x0, 0x2, 0, 0, 0, 0); -- Eyes of Twilight diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_02_world.sql new file mode 100644 index 00000000000..085f3d96e5a --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_02_world.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `creature_text` WHERE `entry`=24251 AND `groupid`=0 AND `id`=1; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(24251, 0, 1, "It's alive!", 14, 0, 100, 0, 0, 0, 23099, 0, "Chief Plaguebringer Harris"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_03_world.sql new file mode 100644 index 00000000000..e1f03afc013 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_03_world.sql @@ -0,0 +1,72 @@ +-- +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=13 AND `SourceEntry`=43092; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(13, 1, 43092, 0, 0, 31, 0, 3, 24119, 0, 0, 0, 0, "", "Spell 'Stop the Ascension!: Halfdan's Soul Destruction' targets Halfdan's Soul"); + +DELETE FROM `conditions` WHERE SourceTypeOrReferenceId=17 AND SourceEntry=43089; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(17, 0, 43089, 0, 0, 29, 0, 23671, 90, 0, 1, 0, 0, "", "Spell 'Vrykul Scroll of Ascension' requires NPC Halfdan the Ice-Hearted to not be nearby AND"), +(17, 0, 43089, 0, 0, 29, 0, 24119, 90, 0, 1, 0, 0, "", "Spell 'Vrykul Scroll of Ascension' requires NPC Halfdan's Soul to not be nearby"); + +UPDATE `creature_template` SET `HoverHeight`=4, `AIName`="SmartAI" WHERE `entry`=24118; +DELETE FROM `creature_template_addon` WHERE `entry` IN (24118, 24119); +INSERT INTO `creature_template_addon` (`entry`, `bytes1`, `auras`) VALUES +(24118, 33554432, ""), +(24119, 33554432, "37119 36545"); + +UPDATE `creature_template` SET `unit_flags`=33587456, `dynamicflags`=32, `inhabittype`=4, `speed_walk`=0.6 WHERE `entry`=24119; + +SET @CGUID := 42887; +DELETE FROM `creature` WHERE `guid` IN (@CGUID, @CGUID+1); +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 , 24118, 571, 0, 0, 1, 2, 0, 0, 1676.912, -4108.803, 278.9944, 0.1675403, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0), +(@CGUID+1, 24118, 571, 0, 0, 1, 2, 0, 0, 1679.509, -4122.266, 279.408, 2.729512, 300, 0, 0, 1, 0, 0, 0, 0, 0, 0); + +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (-(@CGUID+1), 2411800); +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 +(-(@CGUID+1), 0, 0, 0, 38, 0, 100, 0, 1, 1, 0, 0, 80, 2411800, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Val'kyr Observer - On Data 1 1 Set - Call Actionlist"), +(2411800, 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, "Val'kyr Observer - On Script - Talk 0"), +(2411800, 9, 1, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Val'kyr Observer - On Script - Talk 1"), +(2411800, 9, 2, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 11, 43092, 2, 0, 0, 0, 0, 19, 24119, 0, 0, 0, 0, 0, 0, "Val'kyr Observer - On Script - Cast 'Stop the Ascension!: Halfdan's Soul Destruction'"), +(2411800, 9, 3, 0, 0, 0, 100, 0, 10000, 10000, 0, 0, 41, 0, 0, 0, 0, 0, 0, 19, 24119, 0, 0, 0, 0, 0, 0, "Val'kyr Observer - On Script - Despawn Halfdan's Soul"), +(2411800, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 19, 23671, 0, 1, 0, 0, 0, 0, "Val'kyr Observer - On Script - Despawn Halfdan the Ice-Hearted"), +(2411800, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 44, 2, 0, 0, 0, 0, 0, 9, 24118, 0, 90, 0, 0, 0, 0, "Val'kyr Observer - On Script - Set Phasemask 2 to nearby Val'kyr Observer"), +(2411800, 9, 6, 0, 0, 0, 100, 0, 0, 0, 0, 0, 44, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Val'kyr Observer - On Script - Set Phasemask 2 to Self"), +(2411800, 9, 7, 0, 0, 0, 100, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Val'kyr Observer - On Script - Interrupt Current Cast"); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=24119; +DELETE FROM `smart_scripts` WHERE `entryorguid`=24119; +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 +(24119, 0, 0, 1, 11, 0, 100, 0, 0, 0, 0, 0, 59, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan's Soul - On Spawn - Set Run Off"), +(24119, 0, 1, 0, 61, 0, 100, 0, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 0, 19, 23837, 0, 0, 0, 0, 0, 0, "Halfdan's Soul - On Spawn - Move to position"); + +UPDATE `event_scripts` SET `x`=1668.817, `y`=-4117.592, `z`=273.4088, `o`=0.2443461 WHERE `id`=15672; +DELETE FROM `smart_scripts` WHERE entryorguid=23671; +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 +(23671, 0, 0, 1, 54, 0, 100, 0, 0, 0, 0, 0, 44, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Just Summoned - Set Phasemask 3"), +(23671, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 1, 0, 5000, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Just Summoned - Talk 0"), +(23671, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 44, 1, 0, 0, 0, 0, 0, 9, 24118, 0, 90, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Just Summoned - Change Phasemask of Val'kyr Observer"), +(23671, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 18, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Just Summoned - Set Unitflag IMMUNE_TO_PC"), +(23671, 0, 4, 0, 52, 0, 100, 0, 0, 23671, 0, 0, 1, 1, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Text 0 Over - Talk 1"), +(23671, 0, 5, 6, 52, 0, 100, 0, 1, 23671, 0, 0, 19, 256, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Text 1 Over - Remove Unitflag IMMUNE_TO_PC"), +(23671, 0, 6, 0, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Text 1 Over - Attack Invoker"), +(23671, 0, 7, 8, 2, 0, 100, 1, 0, 50, 0, 0, 1, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - Between 0% and 50% Health - Talk 2 (No Repeat)"), +(23671, 0, 8, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 8599, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - Between 50% and 75% Health - Cast 'Enrage' (No Repeat)"), +(23671, 0, 9, 10, 6, 0, 100, 0, 0, 0, 0, 0, 45, 1, 1, 0, 0, 0, 0, 9, 24118, 0, 90, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Death - Set Data 1 1 to Val'kyr Observer"), +(23671, 0, 10, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 43091, 2, 0, 0, 0, 0, 19, 23837, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - On Death - Cast 'Stop the Ascension!: Summon Halfdan's Soul'"), +(23671, 0, 11, 0, 0, 0, 100, 0, 2000, 5000, 9500, 11500, 11, 35263, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - In Combat - Cast 'Frost Attack'"), +(23671, 0, 12, 0, 0, 0, 100, 0, 2500, 5000, 6000, 10000, 11, 32736, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - In Combat - Cast 'Mortal Strike'"), +(23671, 0, 13, 0, 0, 0, 100, 0, 1250, 5000, 5000, 6000, 11, 12169, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - In Combat - Cast 'Shield Block'"), +(23671, 0, 14, 0, 0, 0, 100, 0, 3000, 8000, 4000, 12000, 11, 32015, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - In Combat - Cast 'Knockdown'"), +(23671, 0, 15, 0, 9, 0, 100, 0, 8, 25, 5000, 5000, 11, 19131, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, "Halfdan the Ice-Hearted - Within 8-25 Range - Cast 'Shield Charge'"); + +DELETE FROM `creature_text` WHERE `entry`=23671; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(23671, 0, 0, "You think I do not know what you are trying to do? You think I haven't been watching you?", 14, 0, 100, 1, 0, 0, 22787, 0, "Halfdan the Ice-Hearted"), +(23671, 1, 0, "You will not stop my ascension, tiny $r. Time to die!", 14, 0, 100, 1, 0, 0, 22788, 0, "Halfdan the Ice-Hearted"), +(23671, 2, 0, "No! You will not defeat me!", 14, 0, 100, 0, 0, 0, 22789, 0, "Halfdan the Ice-Hearted"); + +DELETE FROM `creature_text` WHERE `entry`=24118; +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(24118, 0, 0, "How unfortunate, Halfdan.", 12, 0, 100, 0, 0, 0, 22791, 0, "Val'kyr Observer"), +(24118, 1, 0, "We find you unworthy of ascension, Halfdan. Let your soul know oblivion!", 12, 0, 100, 0, 0, 0, 22792, 0, "Val'kyr Observer"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_04_world_335.sql new file mode 100644 index 00000000000..d5b12d343e1 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_12_04_world_335.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `SpellPhaseMask`=0x2 WHERE `SpellId`=55440; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_00_world.sql new file mode 100644 index 00000000000..ce5756cdeb1 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_00_world.sql @@ -0,0 +1,23 @@ +-- Always for SMART_EVENT_JUST_SUMMONED (Creature can be summoned already charmed by player ie TempSummons) +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|0x200 WHERE `source_type` = 0 AND `event_type`=54; + +-- Event linked actions (Many levels of linked calls, do 8 times) +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; +UPDATE `smart_scripts` `ss` LEFT JOIN `smart_scripts` `ssl` ON `ss`.`entryorguid` = `ssl`.`entryorguid` AND `ss`.`source_type` = `ssl`.`source_type` AND `ss`.`id` = `ssl`.`link` SET `ss`.`event_flags`=`ss`.`event_flags`|0x200 WHERE `ss`.`source_type`=0 AND + `ss`.`event_type` = 61 AND (`ssl`.`event_flags` & 0x200) != 0; + +-- Vehicles +UPDATE `smart_scripts` SET `event_flags`=`event_flags`|0x200 WHERE `source_type` = 0 AND `entryorguid` IN (SELECT `entry` FROM `creature_template` WHERE `AIName` = "SmartAI" AND `VehicleId` != 0); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_01_world_335.sql new file mode 100644 index 00000000000..a1d10b8d9a8 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_01_world_335.sql @@ -0,0 +1 @@ +UPDATE `spell_proc` SET `SpellFamilyMask0`=`SpellFamilyMask0`|0x40000000, `HitMask`=0 WHERE `SpellId`=-53569; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_02_world_335.sql new file mode 100644 index 00000000000..48ed0e05e75 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_02_world_335.sql @@ -0,0 +1,79 @@ +-- +DELETE FROM `creature_text` WHERE `entry` IN (10296, 10299); +INSERT INTO `creature_text` (`entry`, `groupid`, `id`, `text`, `type`, `language`, `probability`, `emote`, `duration`, `sound`, `BroadcastTextId`, `TextRange`, `comment`) VALUES +(10296, 0, 0, "At last - one among you is worthy of my knowledge. Worry not - I have probed your thoughts, no harm will come to you.", 12, 0, 100, 1, 0, 0, 5555, 0, "Vaelan"), +(10296, 1, 0, "Listen carefully, for the lord of Blackrock will surely destroy you, should you not be prepared.", 12, 0, 100, 1, 0, 0, 5556, 0, "Vaelan"), +(10296, 2, 0, "%s is surrounded by a barrier of anti-magic.", 16, 0, 100, 0, 0, 0, 5590, 0, "Vaelan"), +(10296, 3, 0, "I have discerned the path that you must take. Are you prepared?", 12, 0, 100, 1, 0, 0, 5591, 0, "Vaelan"), +(10299, 0, 0, "Begone, mortal. You are not worthy of my knowledge.", 15, 0, 100, 0, 0, 0, 5592, 0, "Scarshield Infiltrator"); + +UPDATE `creature_template` SET `gossip_menu_id`=12039 WHERE `entry`=10296; +DELETE FROM `gossip_menu_option` WHERE `menu_id` BETWEEN 12039 AND 12048; +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 +(12039, 0, 0, "Your kind?", 5569, 1, 1, 12040, 0, 0, 0, "", 0, 0), +(12039, 1, 0, "As you wish, Vaelan.", 5589, 1, 1, 0, 0, 0, 0, "", 0, 0), +(12040, 0, 0, "Please.", 5571, 1, 1, 12041, 0, 0, 0, "", 0, 0), +(12041, 0, 0, "No, Vaelan, I do not.", 5573, 1, 1, 12042, 0, 0, 0, "", 0, 0), +(12042, 0, 0, "Demon Soul?", 5575, 1, 1, 12043, 0, 0, 0, "", 0, 0), +(12043, 0, 0, "Where he left off?", 5577, 1, 1, 12044, 0, 0, 0, "", 0, 0), +(12044, 0, 0, "Why not destroy them with the combined might of the Aspects?", 5579, 1, 1, 12045, 0, 0, 0, "", 0, 0), +(12045, 0, 0, "Unless?", 5581, 1, 1, 12046, 0, 0, 0, "", 0, 0), +(12046, 0, 0, "I am willing to try but I will require instruction.", 5583, 1, 1, 12047, 0, 0, 0, "", 0, 0), +(12047, 0, 0, "I will do my best, Vaelan.", 5585, 1, 1, 12048, 0, 0, 0, "", 0, 0), +(12048, 0, 0, "It will be done.", 5587, 1, 1, 0, 0, 0, 0, "", 0, 0); + +DELETE FROM `gossip_menu` WHERE `entry` BETWEEN 12039 AND 12048; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(12039, 3301, 0), +(12039, 3311, 0), +(12040, 3302, 0), +(12041, 3303, 0), +(12042, 3304, 0), +(12043, 3305, 0), +(12044, 3306, 0), +(12045, 3307, 0), +(12046, 3308, 0), +(12047, 3309, 0), +(12048, 3310, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14, 15) AND `SourceGroup`=12039; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 12039, 3311, 0, 0, 2, 0, 12219, 1, 0, 0, 0, 0, "", "Show gossip menu 12039 with text 3311 if player has item Unadorned Seal of Ascension in inventory OR"), +(14, 12039, 3311, 0, 1, 2, 0, 12324, 1, 0, 0, 0, 0, "", "Show gossip menu 12039 with text 3311 if player has item Forged Seal of Ascension in inventory"), +(15, 12039, 0, 0, 0, 2, 0, 12219, 1, 0, 1, 0, 0, "", "Show gossip option 0 if player does not have item Unadorned Seal of Ascension in inventory AND"), +(15, 12039, 0, 0, 0, 2, 0, 12324, 1, 0, 1, 0, 0, "", "Show gossip option 0 if player does not have item Forged Seal of Ascension in inventory"), +(15, 12039, 1, 0, 0, 2, 0, 12219, 1, 0, 0, 0, 0, "", "Show gossip option 1 if player has item Unadorned Seal of Ascension in inventory OR"), +(15, 12039, 1, 0, 1, 2, 0, 12324, 1, 0, 0, 0, 0, "", "Show gossip option 1 if player has item Forged Seal of Ascension in inventory"); + +UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry` IN (10296, 10299); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (10296, 10299, 1029900, 1029901); +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 +(10299, 0, 0, 0, 62, 0, 100, 0, 12039, 1, 0, 0, 80, 1029901, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Gossip Option 1 (menu 12039) selected - Call Actionlist"), +(10299, 0, 1, 0, 62, 0, 100, 0, 12048, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Gossip Option 0 (menu 12048) selected - Close gossip"), +(10299, 0, 2, 0, 38, 0, 100, 1, 1, 1, 1000, 1000, 80, 1029900, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Data 1 1 Set - Call Actionlist"), +(1029900, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 11, 16037, 2, 0, 0, 0, 0, 21, 90, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Cast"), +(1029900, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 91, 8, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Remove Flag Standstate Kneel"), +(1029900, 9, 2, 0, 0, 0, 100, 0, 1500, 1500, 0, 0, 36, 10296, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Change entry"), +(1029900, 9, 3, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Remove Gossip+Questgiver flag"), +(1029900, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 66, 0, 0, 0, 0, 0, 0, 21, 90, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Face nearest player"), +(1029900, 9, 5, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Talk 0"), +(1029900, 9, 6, 0, 0, 0, 100, 0, 6000, 6000, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Talk 1"), +(1029900, 9, 7, 0, 0, 0, 100, 0, 2000, 2000, 0, 0, 82, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Add Gossip flag"), +(1029901, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 72, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Close Gossip"), +(1029901, 9, 1, 0, 0, 0, 100, 0, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Remove Gossip flag"), +(1029901, 9, 2, 0, 0, 0, 100, 0, 100, 100, 0, 0, 5, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Play Emote 1"), +(1029901, 9, 3, 0, 0, 0, 100, 0, 3000, 3000, 0, 0, 11, 16051, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Cast Spell"), +(1029901, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Talk 2"), +(1029901, 9, 5, 0, 0, 0, 100, 0, 4500, 4500, 0, 0, 1, 3, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Talk 3"), +(1029901, 9, 6, 0, 0, 0, 100, 0, 4000, 4000, 0, 0, 82, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Scarshield Infiltrator - On Script - Add Questgiver Flag"); + +DELETE FROM `areatrigger_scripts` WHERE `entry`=1946; +INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES +(1946, "at_nearby_scarshield_infiltrator"); + +DELETE FROM `creature_template_addon` WHERE `entry`=10299; +INSERT INTO `creature_template_addon` (entry, bytes1) VALUES +(10299, 8); + +UPDATE `creature` SET `position_x`=56.9316, `position_y`=-399.4169, `position_z`=64.3478 WHERE `guid`=42798; +DELETE FROM `creature` WHERE `guid`=42797; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_03_world_335.sql new file mode 100644 index 00000000000..11e96b09b94 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_03_world_335.sql @@ -0,0 +1,3 @@ +-- +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=93, `RewardMailDelay`=7200 WHERE `Id`=8323; +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=94, `RewardMailDelay`=7200 WHERE `Id`=8324; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_04_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_04_world_335.sql new file mode 100644 index 00000000000..02898cc9bd4 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_04_world_335.sql @@ -0,0 +1,90 @@ +-- +-- True Believers and Still Believing +DELETE FROM `mail_loot_template` WHERE `Item`=20469; +INSERT INTO `mail_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(93, 20469, 0, 100, 0, 1, 0, 1, 1, ""), +(94, 20469, 0, 100, 0, 1, 0, 1, 1, ""); + +-- A Terrible Purpose. +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=110, `RewardMailDelay`=7200 WHERE `Id`=8287; + +DELETE FROM `mail_loot_template` WHERE `Entry`=110; +INSERT INTO `mail_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(110, 20645, 0, 100, 0, 1, 0, 1, 1, ""); + +-- Wrath of Neptulon +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=123, `RewardMailDelay`=86400 WHERE `Id`=8729; + +-- A Letter for Home (Alliance and Horde) +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=193, `RewardMailDelay`=86400 WHERE `Id`=12067; +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=194, `RewardMailDelay`=86400 WHERE `Id`=12085; + +-- Tactical Clemency +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=234 WHERE `Id`=12422; + +-- Abandoned Mail +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=236 WHERE `Id`=12711; + +DELETE FROM `mail_loot_template` WHERE `Entry`=236; +INSERT INTO `mail_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(236, 39317, 0, 100, 0, 1, 0, 1, 1, ""); + +-- Hammershout the Elder +UPDATE `quest_template_addon` SET `RewardMailTemplateId`=92 WHERE `Id`=8646; + +-- Various Lunar Festival quests +DELETE FROM `quest_template_addon` WHERE `Id` IN (13067, 13066, 13065, 13033, 13032, 13031, 13030, 13029, 13028, 13027, 13026, 13025, 13024, 13023, 13022, 13021, 13020, 13019, 13018, 13017, 13016, 13015, 13014, 13013, 13012); +INSERT INTO `quest_template_addon` (`Id`, `RewardMailTemplateId`, `RewardMailDelay`) VALUES +(13012, 237, 21600), +(13013, 238, 21600), +(13014, 239, 21600), +(13015, 240, 21600), +(13016, 241, 21600), +(13017, 242, 21600), +(13018, 243, 21600), +(13019, 244, 21600), +(13020, 245, 21600), +(13021, 246, 21600), +(13022, 247, 21600), +(13023, 248, 21600), +(13024, 249, 21600), +(13025, 250, 21600), +(13026, 251, 21600), +(13027, 252, 21600), +(13028, 253, 21600), +(13029, 254, 21600), +(13030, 255, 21600), +(13031, 256, 21600), +(13032, 257, 21600), +(13033, 258, 21600), +(13065, 259, 21600), +(13066, 260, 21600), +(13067, 261, 21600); + +DELETE FROM `mail_loot_template` WHERE `Entry` BETWEEN 237 AND 261; +INSERT INTO `mail_loot_template` (`Entry`, `Item`, `Reference`, `Chance`, `QuestRequired`, `LootMode`, `GroupId`, `MinCount`, `MaxCount`, `Comment`) VALUES +(237, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(238, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(239, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(240, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(241, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(242, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(243, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(244, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(245, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(246, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(247, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(248, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(249, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(250, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(251, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(252, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(253, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(254, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(255, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(256, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(257, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(258, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(259, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(260, 21746, 0, 100, 0, 1, 0, 1, 1, ""), +(261, 21746, 0, 100, 0, 1, 0, 1, 1, ""); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_05_world.sql new file mode 100644 index 00000000000..e42d5e46ce7 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_05_world.sql @@ -0,0 +1,15 @@ +UPDATE `creature_template` SET `unit_flags`=33554432 WHERE `entry`=38222; +UPDATE `creature_template` SET `speed_run`=0.571429 WHERE `entry`=38222; +UPDATE `spell_dbc` SET `DurationIndex`=29, `Effect1`=6, `EffectImplicitTargetA1`=1, `EffectApplyAuraName1`=61, `EffectBasePoints1`=100 WHERE `Id`=71290; + +DELETE FROM `linked_respawn`WHERE `guid`=201129 AND `linkedGuid`=201129; +DELETE FROM `creature_template_addon` WHERE `entry` IN (38009,38010,38136); +INSERT INTO `creature_template_addon` (`entry`,`path_id`,`mount`,`bytes1`,`bytes2`,`emote`,`auras`) VALUES +(38009,0,0,0,0,0,71235), +(38010,0,0,0,0,0,'71234 70768'), +(38136,0,0,0,0,0,70901); + +DELETE FROM `spell_script_names` WHERE `ScriptName` IN('spell_deathwhisper_dominated_mind', 'spell_deathwhisper_summon_spirits','spell_cultist_dark_martyrdom'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(71289,'spell_deathwhisper_dominated_mind'), +(72478,'spell_deathwhisper_summon_spirits'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_06_world.sql new file mode 100644 index 00000000000..f42a57a5a5c --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_06_world.sql @@ -0,0 +1,20 @@ +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_gormok_ride_player','spell_gormok_jump_to_hand','spell_gormok_snobolled'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(66245,'spell_gormok_ride_player'), +(66342,'spell_gormok_jump_to_hand'), +(66406,'spell_gormok_snobolled'); + +DELETE FROM `disables` WHERE `sourceType`=0 AND `entry`=66636; +INSERT INTO `disables` (`sourceType`, `entry`, `flags`, `params_0`, `params_1`, `comment`) VALUES +(0, 66636, 64, 0, 0, 'Disable LoS for Spell Rising Anger'); + +DELETE FROM `npc_spellclick_spells` WHERE `npc_entry`=34796; +INSERT INTO `npc_spellclick_spells` (`npc_entry`, `spell_id`, `cast_flags`, `user_type`) VALUES +(34796, 46598, 0, 0); + +DELETE FROM `vehicle_template_accessory` WHERE `entry`=34796 AND `accessory_entry`=34800; +INSERT INTO `vehicle_template_accessory` (`entry`, `accessory_entry`, `seat_id`, `minion`, `description`, `summontype`, `summontimer`) VALUES +(34796,34800,0,0,'Snobold Vassal', 5,0), +(34796,34800,1,0,'Snobold Vassal', 5,0), +(34796,34800,2,0,'Snobold Vassal', 5,0), +(34796,34800,3,0,'Snobold Vassal', 5,0); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_07_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_07_world.sql new file mode 100644 index 00000000000..8b9364acf80 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_14_07_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `creature_template` SET `AIName`="PassiveAI" WHERE `entry` IN (32933,32934); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_00_world.sql new file mode 100644 index 00000000000..2a2b1ae3e8e --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_00_world.sql @@ -0,0 +1,7 @@ +-- Gnomish Mind Control Cap and Mind Amplification Dish script +DELETE FROM `spell_script_names` WHERE ScriptName IN ('spell_item_mind_control_cap','spell_item_universal_remote'); +INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES +(67799, 'spell_item_mind_control_cap'), +(13180, 'spell_item_mind_control_cap'), +-- Gnomish Universal Remote script +(8344, 'spell_item_universal_remote'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_01_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_01_world.sql new file mode 100644 index 00000000000..376e19e19a1 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_01_world.sql @@ -0,0 +1,34 @@ +SET @Saat := 20201; +SET @Menu := 8088; + +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`= '' WHERE `entry` = @Saat; + +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = @Saat); +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 +(@Saat,0, 0,1, 62, 0,100,0,@Menu, 0, 0, 0, 72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Sa'at - On gossip menu 8088 option id 0 selected - Close gossip"), +(@Saat,0, 1,0, 61, 0,100,0, 0, 0, 0, 0, 11,34975, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Sa'at - On gossip menu 8088 option id 0 selected - Cast 'Conjure Chrono-Beacon'"), +(@Saat,0, 2,3, 62, 0,100,0,@Menu, 1, 0, 0, 72, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Sa'at - On gossip menu 8088 option id 1 selected - Close gossip"), +(@Saat,0, 3,0, 61, 0,100,0, 0, 0, 0, 0, 11,34975, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Sa'at - On gossip menu 8088 option id 1 selected - Cast 'Conjure Chrono-Beacon'"), +(@Saat,0, 4,0, 10, 0,100,1, 1,16,1000,1000, 1, 0, 0,0,0,0,0,7,0,0,0,0,0,0,0,"Sa'at - Out Of Combat, in Line Of Sight - Say text 1"); + +DELETE FROM `gossip_menu_option` WHERE `menu_id`= @Menu AND `id`= 1; +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 +(@Menu, 1, 0, "I require a chrono-beacon, Sa'at.", 17881, 1, 1, 0, 0, 0, 0, '', 0, 0); + +DELETE FROM `gossip_menu` WHERE `entry`= @Menu AND `text_id` IN (10000,10001,10002); +INSERT INTO `gossip_menu` (`entry`,`text_id`,`VerifiedBuild`) VALUES +(@Menu, 10000, 0), +(@Menu, 10001, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`= @Menu; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14, @Menu, 10001, 0, 0, 8, 0, 10297, 0, 0, 0, 0, 0, '', 'Show gossip menu 8088 text id 10001 if quest The Opening of the Dark Portal has been rewarded.'), +(14, @Menu, 10000, 0, 0, 8, 0, 10297, 0, 0, 1, 0, 0, '', 'Show gossip menu 8088 text id 10000 if quest The Opening of the Dark Portal is not rewarded.'), +(15, @Menu, 1, 0, 2, 8, 0, 10297, 0, 0, 0, 0, 0, '', 'Show gossip menu 8088 option id 1 if quest The Opening of the Dark Portal has been rewarded'), +(15, @Menu, 1, 0, 2, 2, 0, 24289, 1, 0, 1, 0, 0, '', 'Show gossip menu 8088 option id 1 if player has 0 of Chrono-Beacon. Item cannot be in bank. -AND 2-'), +(15, @Menu, 0, 0, 3, 9, 0, 10297, 0, 0, 0, 0, 0, '', 'Show gossip menu 8088 option id 0 if quest The Opening of the Dark Portal has not been taken. -AND 3-'), +(15, @Menu, 0, 0, 3, 2, 0, 24289, 1, 0, 1, 0, 0, '', 'Show gossip menu 8088 option id 0 if player has 0 of Chrono-Beacon. Item cannot be in bank. -AND 3-'); + +DELETE FROM `creature_text` WHERE `entry`= @Saat; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@Saat, 0,0,'Stop! Do not go any further, mortal. You are ill-prepared to face the forces of the Infinite Dragonflight. Come, let me help you.', 12,0,100,1,0,0,17814,0, 'Saat'); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_02_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_02_world.sql new file mode 100644 index 00000000000..59d1bff9635 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_02_world.sql @@ -0,0 +1,49 @@ +-- NPC ID 4489 Braug Dimspirit, Test of Lore +SET @Braug := 4489; +SET @menu := 4763; +SET @quest := 6627; +SET @Script := 448900; + +UPDATE `creature_template` SET `AIName`= 'SmartAI', `ScriptName`= '' WHERE `entry`= @Braug; + +DELETE FROM `creature_text` WHERE `entry`= @Braug; +INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`BroadcastTextId`,`TextRange`,`comment`) VALUES +(@Braug, 0,0,'Ah, Ysera the Dreamer.', 12,0,100,1,3000,0,8382,0, 'Braug Dimspirit - Test of Lore'), +(@Braug, 1,0,'Neltharion, hmm? As good an answer as any, yes?', 12,0,100,1,3000,0,8386,0, 'Braug Dimspirit - Test of Lore'), +(@Braug, 2,0,'Alexstrazsa, the Life-Binder. A magnificent creature.', 12,0,100,1,3000,0,8387,0, 'Braug Dimspirit - Test of Lore'), +(@Braug, 3,0,'Malygos, is it?', 12,0,100,1,3000,0,8388,0, 'Braug Dimspirit - Test of Lore'), +(@Braug, 4,0,'That is the wrong answer, $n. Be off with you.', 12,0,100,1,3000,0,8393,0, 'Braug Dimspirit - Test of Lore'); + +DELETE FROM `gossip_menu_option` WHERE `menu_id` = @menu; +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 +(@menu, 0, 0, 'Ysera is my answer.', 8381, 1, 1, 0, 0, 0, 0, '', 0, 0), +(@menu, 1, 0, 'Neltharion is my answer.', 8383, 1, 1, 0, 0, 0, 0, '', 0, 0), +(@menu, 2, 0, 'Alexstrasza is my answer.', 8384, 1, 1, 0, 0, 0, 0, '', 0, 0), +(@menu, 3, 0, 'Malygos is my answer.', 8385, 1, 1, 0, 0, 0, 0, '', 0, 0); + +DELETE FROM `smart_scripts` WHERE `entryorguid` = @Braug AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` = @Script AND `source_type` = 9; +INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@Braug, 0, 0,0, 31,0,100,0, 6766,0,0,0, 82, 3,0,0,0,0,0, 1,0,0,0,0,0,0,0,"Braug Dimspirit - on Target Spellhit 'Test of Lore' - Add npcflag Gossip & Questgiver"), +(@Braug, 0, 1,0, 62,0,100,0,@menu,0,0,0, 80,@Script,0,0,0,0,0, 1,0,0,0,0,0,0,0,'Braug Dimspirit - on Gossip Option 0 selected - Run Script'), +(@Braug, 0, 2,0, 62,0,100,0,@menu,2,0,0, 80,@Script,0,0,0,0,0, 1,0,0,0,0,0,0,0,'Braug Dimspirit - on Gossip Option 2 selected - Run Script'), +(@Braug, 0, 3,0, 62,0,100,0,@menu,3,0,0, 80,@Script,0,0,0,0,0, 1,0,0,0,0,0,0,0,'Braug Dimspirit - on Gossip Option 3 selected - Run Script'), +(@Braug, 0, 4,5, 62,0,100,0,@menu,1,0,0, 72, 0,0,0,0,0,0, 7,0,0,0,0,0,0,0,'Braug Dimspirit - on Gossip Option 1 selected - Close Gossip'), +(@Braug, 0, 5,6, 61,0,100,0, 0,0,0,0, 15, @quest,0,0,0,0,0, 7,0,0,0,0,0,0,0,"Braug Dimspirit - on Gossip Option 1 selected - Credit quest 'Test of Lore (3)'"), +(@Braug, 0, 6,7, 61,0,100,0, 0,0,0,0, 5, 4,0,0,0,0,0, 1,0,0,0,0,0,0,0,'Braug Dimspirit - on Gossip Option 1 selected - Play Emote 4 (ONESHOT_CHEER)'), +(@Braug, 0, 7,0, 61,0,100,0, 0,0,0,0, 5, 21,0,0,0,0,0, 1,0,0,0,0,0,0,0,'Braug Dimspirit - on Gossip Option 1 selected - Play Emote 21 (ONESHOT_APPLAUD)'), +(@Script,9, 0,0, 0,0,100,0, 0,0,0,0, 72, 0, 0,0,0,0,0, 7,0,0,0,0,0,0,0,'Braug Dimspirit - on Script - Close Gossip'), +(@Script,9, 1,0, 0,0,100,0, 0,0,0,0, 83, 3, 0,0,0,0,0, 1,0,0,0,0,0,0,0,'Braug Dimspirit - on Script - Remove npcflag Gossip & Questgiver'), +(@Script,9, 2,0, 0,0,100,0, 0,0,0,0, 1, 4, 0,0,0,0,0, 7,0,0,0,0,0,0,0,'Braug Dimspirit - on Script - Say Line 4'), +(@Script,9, 3,0, 0,0,100,0, 0,0,0,0, 11, 6766,64,0,0,0,0, 7,0,0,0,0,0,0,0,"Braug Dimspirit - on Script - Cast 'Test of Lore' (Prevent combat movement on cast, allow on fail range, mana, LOS)"); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup`= @menu; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14, @menu, 5819,0, 1, 9,0, @quest,0,0,1,0,0,'', "Show gossip menu 4763 text id 5819 if quest 'Test of Lore (3)' has not been taken. -OR-"), +(14, @menu, 5819,0, 2, 8,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 text id 5819 if quest 'Test of Lore (3)' has been rewarded. -OR-"), +(14, @menu, 5819,0, 3,28,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 text id 5819 if quest 'Test of Lore (3)' has been completed. -OR-"), +(14, @menu, 5820,0, 4, 9,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 text id 5820 if quest 'Test of Lore (3)' has been taken. -AND-"), +(15, @menu, 0,0, 4, 9,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 option id 0 if quest 'Test of Lore (3)' has been taken. -AND-"), +(15, @menu, 1,0, 4, 9,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 option id 1 if quest 'Test of Lore (3)' has been taken. -AND-"), +(15, @menu, 2,0, 4, 9,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 option id 2 if quest 'Test of Lore (3)' has been taken. -AND-"), +(15, @menu, 3,0, 4, 9,0, @quest,0,0,0,0,0,'', "Show gossip menu 4763 option id 3 if quest 'Test of Lore (3)' has been taken. -AND-"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_03_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_03_world.sql new file mode 100644 index 00000000000..89c39eda004 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_03_world.sql @@ -0,0 +1,8 @@ +-- +DELETE FROM `gossip_menu` WHERE `entry`=4519 AND `text_id`=12696; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(4519, 12696, 0); + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=4519 AND `SourceEntry`=12696; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 4519, 12696, 0, 0, 8, 0, 12085, 0, 0, 0, 0, 0, "", "Show gossip text if quest A Letter for Home is not rewarded"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_04_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_04_world.sql new file mode 100644 index 00000000000..134462cd68f --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_04_world.sql @@ -0,0 +1,4 @@ +-- +UPDATE `quest_template_addon` SET `PrevQuestID`=13239 WHERE `ID`=13261; + +UPDATE `conditions` SET `Comment`="Show gossip text if quest A Letter for Home is rewarded" WHERE `SourceTypeOrReferenceId`=14 AND `SourceGroup`=4519 AND `SourceEntry`=12696; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_05_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_05_world.sql new file mode 100644 index 00000000000..dfbf7235623 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_05_world.sql @@ -0,0 +1,9 @@ +-- +DELETE FROM `conditions` WHERE `SourceEntry`=53349; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(13, 1, 53349, 0, 0, 31, 0, 3, 29106, 0, 0, 0, 0, "", "Arrow Assault targets Death Knight Champion"), +(13, 1, 53349, 0, 1, 31, 0, 3, 29115, 0, 0, 0, 0, "", "Arrow Assault targets Rampaging Abomination"), +(13, 1, 53349, 0, 2, 31, 0, 3, 29136, 0, 0, 0, 0, "", "Arrow Assault targets Volatile Ghoul"), +(13, 1, 53349, 0, 3, 31, 0, 3, 28670, 0, 0, 0, 0, "", "Arrow Assault targets Frostbrood Vanquisher"); + +DELETE FROM `creature_text` WHERE `entry` IN (28609, 28611) AND `id`=6; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_06_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_06_world.sql new file mode 100644 index 00000000000..b43b5c0bfa1 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_06_world.sql @@ -0,0 +1,4 @@ +-- +DELETE FROM `conditions` WHERE `SourceEntry`=25063; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(22, 1, 25063, 0, 0, 31, 0, 4, 0, 0, 1, 0, 0, "", "Dawnblade Hawkrider's SAI id 1 does not execute if invoker is a player"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_07_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_07_world_335.sql new file mode 100644 index 00000000000..39c09cc0185 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_07_world_335.sql @@ -0,0 +1,2 @@ +-- +UPDATE `quest_template` SET `AllowableRaces`=1 WHERE `ID` IN (6181, 6281, 6261, 6285); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_09_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_09_world.sql new file mode 100644 index 00000000000..7d0242d1179 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_09_world.sql @@ -0,0 +1,2 @@ +-- +UPDATE `gameobject` SET `phaseMask`=1 WHERE `map` IN (649); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_10_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_10_world.sql new file mode 100644 index 00000000000..cdf9683b3d9 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_15_10_world.sql @@ -0,0 +1,5 @@ +-- +UPDATE `conditions` SET `ConditionTypeOrReference`=28, `Comment`="Show gossip option 0 if player has quest Arelion's Secret completed OR" WHERE `SourceGroup`=8081 AND `ElseGroup`=0; +DELETE FROM `conditions` WHERE `SourceGroup`=8081 AND `ElseGroup`=1; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(15, 8081, 0, 0, 1, 8, 0, 10286, 0, 0, 0, 0, 0, "", "Show gossip option 0 if player has quest Arelion's Secret rewarded"); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_00_world.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_00_world.sql new file mode 100644 index 00000000000..8be18c8f043 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_00_world.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `conditions` WHERE `SourceGroup`=9754; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 9754, 13397, 0, 0, 8, 0, 12716, 0, 0, 0, 0, 0, "", "Show gossip text 13397 for Noth the Plaguebringer if quest The Plaguebringer's Request is rewarded"); + +DELETE FROM `creature_questender` WHERE `quest`=12717; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_01_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_01_world_335.sql new file mode 100644 index 00000000000..66b8e680ef8 --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_01_world_335.sql @@ -0,0 +1,6 @@ +-- +DELETE FROM `conditions` WHERE `SourceGroup`=6685; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES +(14, 6685, 13062, 0, 0, 12, 0, 50, 0, 0, 0, 0, 0, "", "Show gossip text 13062 for Baron Revilgaz if event Pirates' Day is running"); + +UPDATE `npc_text` SET `text0_0`="Welcome to Booty Bay, partner. Don't mind DeMeza and her crew... we let the hellion run riot one day a year, Pirates' Day, and then she leaves us in peace to go plunder the South Seas again.$B$BNow then... what can this humble servant of the Steamwheedle Cartel do for you? Better still - what can you do for me, eh?" WHERE `ID`=13062; diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_02_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_02_world_335.sql new file mode 100644 index 00000000000..6c7a0c65caf --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_02_world_335.sql @@ -0,0 +1,5 @@ +-- +UPDATE `creature_template` SET `gossip_menu_id`=10941 WHERE `entry`=10941; +DELETE FROM `gossip_menu` WHERE `entry`=10941; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(10941, 10299, 0); diff --git a/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_03_world_335.sql b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_03_world_335.sql new file mode 100644 index 00000000000..9eedd8dfc1b --- /dev/null +++ b/sql/old/3.3.5a/world/61_2016_10_17/2016_10_16_03_world_335.sql @@ -0,0 +1,45 @@ +-- +DELETE FROM npc_text WHERE ID=773; +INSERT INTO npc_text (ID, text0_0) VALUES +(773, "$C, eh? I am Krazek, Baron Revilgaz's secretary. I know everything about the goings on in this jungle and beyond. Perhaps you'd be interested in knowing the going price on oil in Ratchet? No? Looking for work, maybe? I can help you there."); + +UPDATE `creature_template` SET `gossip_menu_id`=773 WHERE `entry`=773; +DELETE FROM `gossip_menu` WHERE `entry`=773; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(773, 773, 0); + +DELETE FROM npc_text WHERE ID=737; +INSERT INTO npc_text (ID, text0_0) VALUES +(737, "Well, hello there. You seem like you wouldn't be opposed to making some coin, hm? I can tell from the look in your eyes. I am Mogul Kebok, overseer of operations in Azeroth, and if it is riches you seek, perhaps I can make arrangements."); + +UPDATE `creature_template` SET `gossip_menu_id`=737 WHERE `entry`=737; +DELETE FROM `gossip_menu` WHERE `entry`=737; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(737, 737, 0); + +DELETE FROM npc_text WHERE ID=2505; +INSERT INTO npc_text (ID, text0_0) VALUES +(2505, "Oy! You here for a game of knuckles?"); + +UPDATE `creature_template` SET `gossip_menu_id`=2502 WHERE `entry`=2501; +DELETE FROM `gossip_menu` WHERE `entry`=2502; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(2502, 2505, 0); + +DELETE FROM npc_text WHERE ID=733; +INSERT INTO npc_text (ID, text0_0) VALUES +(733, "You watch where you step around here, $Glad:lass;. You might not be a part of our outfit, but that doesn't mean I won't take a cane to you if you fall out of line!"); + +UPDATE `creature_template` SET `gossip_menu_id`=733 WHERE `entry`=733; +DELETE FROM `gossip_menu` WHERE `entry`=733; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(733, 733, 0); + +DELETE FROM npc_text WHERE ID=2498; +INSERT INTO npc_text (ID, text0_0) VALUES +(2498, "What what?!? We all have profit to make... and we won't do it by standing idle."); + +UPDATE `creature_template` SET `gossip_menu_id`=2498 WHERE `entry`=2498; +DELETE FROM `gossip_menu` WHERE `entry`=2498; +INSERT INTO `gossip_menu` (`entry`, `text_id`, `VerifiedBuild`) VALUES +(2498, 2498, 0); diff --git a/sql/updates/auth/3.3.5/2016_10_16_00_auth.sql b/sql/updates/auth/3.3.5/2016_10_16_00_auth.sql new file mode 100644 index 00000000000..be8a4d21b66 --- /dev/null +++ b/sql/updates/auth/3.3.5/2016_10_16_00_auth.sql @@ -0,0 +1 @@ +UPDATE `updates` SET `state`='ARCHIVED'; diff --git a/sql/updates/auth/3.3.5/dummy b/sql/updates/auth/3.3.5/dummy deleted file mode 100644 index e69de29bb2d..00000000000 --- a/sql/updates/auth/3.3.5/dummy +++ /dev/null diff --git a/sql/updates/characters/3.3.5/2016_10_16_00_characters.sql b/sql/updates/characters/3.3.5/2016_10_16_00_characters.sql new file mode 100644 index 00000000000..be8a4d21b66 --- /dev/null +++ b/sql/updates/characters/3.3.5/2016_10_16_00_characters.sql @@ -0,0 +1 @@ +UPDATE `updates` SET `state`='ARCHIVED'; 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/characters/3.3.5/dummy b/sql/updates/characters/3.3.5/dummy deleted file mode 100644 index e69de29bb2d..00000000000 --- a/sql/updates/characters/3.3.5/dummy +++ /dev/null diff --git a/sql/updates/world/3.3.5/2016_10_17_00_world.sql b/sql/updates/world/3.3.5/2016_10_17_00_world.sql new file mode 100644 index 00000000000..0e710195729 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_17_00_world.sql @@ -0,0 +1,3 @@ +UPDATE `version` SET `db_version`='TDB 335.62', `cache_id`=62 LIMIT 1; + +UPDATE `updates` SET `state`='ARCHIVED'; diff --git a/sql/updates/world/3.3.5/2016_10_17_01_world.sql b/sql/updates/world/3.3.5/2016_10_17_01_world.sql new file mode 100644 index 00000000000..995e9ad75ba --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_17_01_world.sql @@ -0,0 +1,9 @@ +-- +DELETE FROM `smart_scripts` WHERE `entryorguid`=1722601; +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 +(1722601, 9, 0, 0, 0, 0, 100, 0, 0, 0, 0, 0, 33, 17226, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, "Viera Sunwhisper - On Script - Quest Credit 'Arelion's Mistress'"), +(1722601, 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, "Viera Sunwhisper - On Script - Say Line 2"), +(1722601, 9, 2, 0, 0, 0, 100, 0, 1000, 1000, 0, 0, 1, 0, 0, 0, 0, 0, 0, 9, 17230, 0, 25, 0, 0, 0, 0, "Viera Sunwhisper - On Script - Say Line 0"), +(1722601, 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, "Viera Sunwhisper - On Script - Say Line 3"), +(1722601, 9, 4, 0, 0, 0, 100, 0, 0, 0, 0, 0, 45, 1, 2, 0, 0, 0, 0, 10, 61963, 17230, 0, 0, 0, 0, 0, "Viera Sunwhisper - On Script - Set Data 1 2"), +(1722601, 9, 5, 0, 0, 0, 100, 0, 0, 0, 0, 0, 53, 1, 172260, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, "Viera Sunwhisper - On Script - Start Waypoint"); diff --git a/sql/updates/world/3.3.5/2016_10_17_02_world_335.sql b/sql/updates/world/3.3.5/2016_10_17_02_world_335.sql new file mode 100644 index 00000000000..fb3d504ba26 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_17_02_world_335.sql @@ -0,0 +1,4 @@ +-- +UPDATE `creature_template` SET `gossip_menu_id`=0, `npcflag`=2 WHERE `entry`=4984; +DELETE FROM `gossip_menu` WHERE `entry`=12093; +DELETE FROM `npc_text` WHERE `id`=16981; diff --git a/sql/updates/world/3.3.5/2016_10_17_03_world_335.sql b/sql/updates/world/3.3.5/2016_10_17_03_world_335.sql new file mode 100644 index 00000000000..2965f05aa72 --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_17_03_world_335.sql @@ -0,0 +1,4 @@ +UPDATE `spell_proc` SET `AttributesMask`=`AttributesMask`|0x2 WHERE `SpellId` IN (63280, -51625); +DELETE FROM `spell_proc` WHERE `SpellId`=53651; +INSERT INTO `spell_proc` (`SpellId`, `SchoolMask`, `SpellFamilyName`, `SpellFamilyMask0`, `SpellFamilyMask1`, `SpellFamilyMask2`, `ProcFlags`, `SpellTypeMask`, `SpellPhaseMask`, `HitMask`, `AttributesMask`, `ProcsPerMinute`, `Chance`, `Cooldown`, `Charges`) VALUES +(53651, 0, 0, 0x00000000, 0x00000000, 0x00000000, 0x0, 0x2, 0x0, 0x0, 0x2, 0, 0, 0, 0); -- Light's Beacon diff --git a/sql/updates/world/3.3.5/2016_10_17_04_world_335.sql b/sql/updates/world/3.3.5/2016_10_17_04_world_335.sql new file mode 100644 index 00000000000..0e6b0c4717f --- /dev/null +++ b/sql/updates/world/3.3.5/2016_10_17_04_world_335.sql @@ -0,0 +1,4 @@ +DELETE FROM `spell_proc` WHERE `SpellId`=-18213; +DELETE FROM `spell_script_names` WHERE `ScriptName` IN ('spell_warl_drain_soul','spell_warl_improved_drain_soul'); +INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES +(-1120, 'spell_warl_drain_soul'); 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/sql/updates/world/3.3.5/dummy b/sql/updates/world/3.3.5/dummy deleted file mode 100644 index e69de29bb2d..00000000000 --- a/sql/updates/world/3.3.5/dummy +++ /dev/null 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 658827662ec..6122e5aca7b 100644 --- a/src/server/database/Database/Implementation/CharacterDatabase.cpp +++ b/src/server/database/Database/Implementation/CharacterDatabase.cpp @@ -226,7 +226,7 @@ void CharacterDatabaseConnection::DoPrepareStatements() PrepareStatement(CHAR_SEL_CHAR_DATA_FOR_GUILD, "SELECT name, level, class, zone, account FROM characters WHERE guid = ?", CONNECTION_SYNCH); // Chat channel handling - PrepareStatement(CHAR_SEL_CHANNEL, "SELECT announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH); + PrepareStatement(CHAR_SEL_CHANNEL, "SELECT name, announce, ownership, password, bannedList FROM channels WHERE name = ? AND team = ?", CONNECTION_SYNCH); PrepareStatement(CHAR_INS_CHANNEL, "INSERT INTO channels(name, team, lastUsed) VALUES (?, ?, UNIX_TIMESTAMP())", CONNECTION_ASYNC); PrepareStatement(CHAR_UPD_CHANNEL, "UPDATE channels SET announce = ?, ownership = ?, password = ?, bannedList = ?, lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC); PrepareStatement(CHAR_UPD_CHANNEL_USAGE, "UPDATE channels SET lastUsed = UNIX_TIMESTAMP() WHERE name = ? AND team = ?", CONNECTION_ASYNC); @@ -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/CoreAI/UnitAI.cpp b/src/server/game/AI/CoreAI/UnitAI.cpp index fbb79426bb8..a2967dc7391 100644 --- a/src/server/game/AI/CoreAI/UnitAI.cpp +++ b/src/server/game/AI/CoreAI/UnitAI.cpp @@ -56,16 +56,25 @@ void UnitAI::DoMeleeAttackIfReady() if (!me->IsWithinMeleeRange(victim)) return; + bool sparAttack = me->GetFactionTemplateEntry()->ShouldSparAttack() && victim->GetFactionTemplateEntry()->ShouldSparAttack(); //Make sure our attack is ready and we aren't currently casting before checking distance if (me->isAttackReady()) { - me->AttackerStateUpdate(victim); + if (sparAttack) + me->FakeAttackerStateUpdate(victim); + else + me->AttackerStateUpdate(victim); + me->resetAttackTimer(); } if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK)) { - me->AttackerStateUpdate(victim, OFF_ATTACK); + if (sparAttack) + me->FakeAttackerStateUpdate(victim, OFF_ATTACK); + else + me->AttackerStateUpdate(victim, OFF_ATTACK); + me->resetAttackTimer(OFF_ATTACK); } } diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp index 241441db958..b6635db5daf 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.cpp @@ -569,7 +569,7 @@ void BossAI::_DespawnAtEvade(uint32 delayToRespawn, Creature* who) return; } - me->DespawnOrUnsummon(0, Seconds(delayToRespawn)); + who->DespawnOrUnsummon(0, Seconds(delayToRespawn)); if (instance && who == me) instance->SetBossState(_bossId, FAIL); @@ -635,29 +635,3 @@ void WorldBossAI::UpdateAI(uint32 diff) DoMeleeAttackIfReady(); } - -// SD2 grid searchers. -Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive /*= true*/) -{ - return source->FindNearestCreature(entry, maxSearchRange, alive); -} - -GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange) -{ - return source->FindNearestGameObject(entry, maxSearchRange); -} - -void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange) -{ - source->GetCreatureListWithEntryInGrid(list, entry, maxSearchRange); -} - -void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange) -{ - source->GetGameObjectListWithEntryInGrid(list, entry, maxSearchRange); -} - -void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange) -{ - source->GetPlayerListInGrid(list, maxSearchRange); -} diff --git a/src/server/game/AI/ScriptedAI/ScriptedCreature.h b/src/server/game/AI/ScriptedAI/ScriptedCreature.h index 08cc4fa3960..37a7020752b 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedCreature.h +++ b/src/server/game/AI/ScriptedAI/ScriptedCreature.h @@ -417,10 +417,32 @@ class TC_GAME_API WorldBossAI : public ScriptedAI }; // SD2 grid searchers. -TC_GAME_API Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true); -TC_GAME_API GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange); -TC_GAME_API void GetCreatureListWithEntryInGrid(std::list<Creature*>& list, WorldObject* source, uint32 entry, float maxSearchRange); -TC_GAME_API void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& list, WorldObject* source, uint32 entry, float maxSearchRange); -TC_GAME_API void GetPlayerListInGrid(std::list<Player*>& list, WorldObject* source, float maxSearchRange); +inline Creature* GetClosestCreatureWithEntry(WorldObject* source, uint32 entry, float maxSearchRange, bool alive = true) +{ + return source->FindNearestCreature(entry, maxSearchRange, alive); +} + +inline GameObject* GetClosestGameObjectWithEntry(WorldObject* source, uint32 entry, float maxSearchRange) +{ + return source->FindNearestGameObject(entry, maxSearchRange); +} + +template <typename Container> +inline void GetCreatureListWithEntryInGrid(Container& container, WorldObject* source, uint32 entry, float maxSearchRange) +{ + source->GetCreatureListWithEntryInGrid(container, entry, maxSearchRange); +} + +template <typename Container> +inline void GetGameObjectListWithEntryInGrid(Container& container, WorldObject* source, uint32 entry, float maxSearchRange) +{ + source->GetGameObjectListWithEntryInGrid(container, entry, maxSearchRange); +} + +template <typename Container> +inline void GetPlayerListInGrid(Container& container, WorldObject* source, float maxSearchRange) +{ + source->GetPlayerListInGrid(container, maxSearchRange); +} #endif // SCRIPTEDCREATURE_H_ diff --git a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp index 89ad726b253..9e55b9d8187 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedEscortAI.cpp @@ -150,14 +150,10 @@ void npc_escortAI::JustDied(Unit* /*killer*/) { for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) if (Player* member = groupRef->GetSource()) - if (member->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) - member->FailQuest(m_pQuestForEscort->GetQuestId()); + member->FailQuest(m_pQuestForEscort->GetQuestId()); } else - { - if (player->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(m_pQuestForEscort->GetQuestId()); - } + player->FailQuest(m_pQuestForEscort->GetQuestId()); } } diff --git a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp index 24de7344f99..9730370a77c 100644 --- a/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp +++ b/src/server/game/AI/ScriptedAI/ScriptedFollowerAI.cpp @@ -147,19 +147,11 @@ void FollowerAI::JustDied(Unit* /*killer*/) if (Group* group = player->GetGroup()) { for (GroupReference* groupRef = group->GetFirstMember(); groupRef != NULL; groupRef = groupRef->next()) - { if (Player* member = groupRef->GetSource()) - { - if (member->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE) - member->FailQuest(m_pQuestForFollow->GetQuestId()); - } - } + member->FailQuest(m_pQuestForFollow->GetQuestId()); } else - { - if (player->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE) - player->FailQuest(m_pQuestForFollow->GetQuestId()); - } + player->FailQuest(m_pQuestForFollow->GetQuestId()); } } diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp index b57717fa53d..97bbbfe2b72 100644 --- a/src/server/game/AI/SmartScripts/SmartAI.cpp +++ b/src/server/game/AI/SmartScripts/SmartAI.cpp @@ -73,11 +73,7 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c) bool SmartAI::IsAIControlled() const { - if (me->IsControlledByPlayer()) - return false; - if (mIsCharmed) - return false; - return true; + return !mIsCharmed; } void SmartAI::UpdateDespawn(const uint32 diff) @@ -225,7 +221,7 @@ void SmartAI::EndPath(bool fail) if (!fail && player->IsAtGroupRewardDistance(me) && !player->HasCorpse()) player->GroupEventHappens(mEscortQuestID, me); - if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE) + if (fail) player->FailQuest(mEscortQuestID); if (Group* group = player->GetGroup()) @@ -236,7 +232,7 @@ void SmartAI::EndPath(bool fail) if (!fail && groupGuy->IsAtGroupRewardDistance(me) && !groupGuy->HasCorpse()) groupGuy->AreaExploredOrEventHappens(mEscortQuestID); - if (fail && groupGuy->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE) + else if (fail) groupGuy->FailQuest(mEscortQuestID); } } @@ -250,7 +246,7 @@ void SmartAI::EndPath(bool fail) Player* player = (*iter)->ToPlayer(); if (!fail && player->IsAtGroupRewardDistance(me) && !player->HasCorpse()) player->AreaExploredOrEventHappens(mEscortQuestID); - if (fail && player->GetQuestStatus(mEscortQuestID) == QUEST_STATUS_INCOMPLETE) + else if (fail) player->FailQuest(mEscortQuestID); } } diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 56e943a64c9..48315eb44ed 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -65,7 +65,6 @@ SmartScript::~SmartScript() void SmartScript::OnReset() { - SetPhase(0); ResetBaseObject(); for (SmartAIEventList::iterator i = mEvents.begin(); i != mEvents.end(); ++i) { @@ -99,8 +98,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u //calc random if (e.GetEventType() != SMART_EVENT_LINK && e.event.event_chance < 100 && e.event.event_chance) { - uint32 rnd = urand(1, 100); - if (e.event.event_chance <= rnd) + if (!roll_chance_i(e.event.event_chance)) return; } e.runOnce = true;//used for repeat check @@ -1069,20 +1067,10 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u break; for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) - { if (Creature* target = (*itr)->ToCreature()) - { - if (target->IsAlive() && IsSmart(target)) - { - ENSURE_AI(SmartAI, target->AI())->SetDespawnTime(e.action.forceDespawn.delay + 1); // Next tick - ENSURE_AI(SmartAI, target->AI())->StartDespawn(); - } - else - target->DespawnOrUnsummon(e.action.forceDespawn.delay); - } + target->DespawnOrUnsummon(e.action.forceDespawn.delay); else if (GameObject* goTarget = (*itr)->ToGameObject()) goTarget->SetRespawnTime(e.action.forceDespawn.delay + 1); - } delete targets; break; @@ -1176,7 +1164,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u if (!IsCreature(*itr)) continue; - if (!(e.event.event_flags & SMART_EVENT_FLAG_WHILE_CHARMED) && !IsCreatureInControlOfSelf(*itr)) + if (!(e.event.event_flags & SMART_EVENT_FLAG_WHILE_CHARMED) && IsCharmedCreature(*itr)) continue; Position pos = (*itr)->GetPosition(); @@ -1683,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: @@ -2854,7 +2843,7 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui if ((e.event.event_phase_mask && !IsInPhase(e.event.event_phase_mask)) || ((e.event.event_flags & SMART_EVENT_FLAG_NOT_REPEATABLE) && e.runOnce)) return; - if (!(e.event.event_flags & SMART_EVENT_FLAG_WHILE_CHARMED) && IsCreature(me) && !IsCreatureInControlOfSelf(me)) + if (!(e.event.event_flags & SMART_EVENT_FLAG_WHILE_CHARMED) && IsCharmedCreature(me)) return; switch (e.GetEventType()) @@ -3599,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/AI/SmartScripts/SmartScript.h b/src/server/game/AI/SmartScripts/SmartScript.h index 8ac5b494911..3cb66faa033 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.h +++ b/src/server/game/AI/SmartScripts/SmartScript.h @@ -78,12 +78,15 @@ class TC_GAME_API SmartScript return obj && obj->GetTypeId() == TYPEID_UNIT; } - static bool IsCreatureInControlOfSelf(WorldObject* obj) + static bool IsCharmedCreature(WorldObject* obj) { - if (Creature* creatureObj = obj ? obj->ToCreature() : nullptr) - return !creatureObj->IsCharmed() && !creatureObj->IsControlledByPlayer(); - else + if (!obj) return false; + + if (Creature* creatureObj = obj->ToCreature()) + return creatureObj->IsCharmed(); + + return false; } static bool IsGameObject(WorldObject* obj) diff --git a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp index d9f5388e3ce..43bd28c7863 100644 --- a/src/server/game/AuctionHouse/AuctionHouseMgr.cpp +++ b/src/server/game/AuctionHouse/AuctionHouseMgr.cpp @@ -27,6 +27,7 @@ #include "ScriptMgr.h" #include "AccountMgr.h" #include "AuctionHouseMgr.h" +#include "AuctionHouseBot.h" #include "Item.h" #include "Language.h" #include "Log.h" @@ -156,7 +157,7 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction& } // receiver exist - if (bidder || bidderAccId) + if ((bidder || bidderAccId) && !sAuctionBotConfig->IsBotChar(auction->bidder)) { // set owner to bidder (to prevent delete item with sender char deleting) // owner in `data` will set at mail receive and item extracting @@ -189,7 +190,7 @@ void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTrans Player* owner = ObjectAccessor::FindConnectedPlayer(owner_guid); uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist (online or offline) - if (owner || owner_accId) + if ((owner || owner_accId) && !sAuctionBotConfig->IsBotChar(auction->owner)) MailDraft(auction->BuildAuctionMailSubject(AUCTION_SALE_PENDING), AuctionEntry::BuildAuctionMailBody(auction->bidder, auction->bid, auction->buyout, auction->deposit, auction->GetAuctionCut())) .SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED); } @@ -201,7 +202,7 @@ void AuctionHouseMgr::SendAuctionSuccessfulMail(AuctionEntry* auction, SQLTransa Player* owner = ObjectAccessor::FindConnectedPlayer(owner_guid); uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist - if (owner || owner_accId) + if ((owner || owner_accId) && !sAuctionBotConfig->IsBotChar(auction->owner)) { uint32 profit = auction->bid + auction->deposit - auction->GetAuctionCut(); @@ -232,7 +233,7 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti Player* owner = ObjectAccessor::FindConnectedPlayer(owner_guid); uint32 owner_accId = sObjectMgr->GetPlayerAccountIdByGUID(owner_guid); // owner exist - if (owner || owner_accId) + if ((owner || owner_accId) && !sAuctionBotConfig->IsBotChar(auction->owner)) { if (owner) owner->GetSession()->SendAuctionOwnerNotification(auction); @@ -259,7 +260,7 @@ void AuctionHouseMgr::SendAuctionOutbiddedMail(AuctionEntry* auction, uint32 new oldBidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(oldBidder_guid); // old bidder exist - if (oldBidder || oldBidder_accId) + if ((oldBidder || oldBidder_accId) && !sAuctionBotConfig->IsBotChar(auction->bidder)) { if (oldBidder && newBidder) oldBidder->GetSession()->SendAuctionBidderNotification(auction->GetHouseId(), auction->Id, newBidder->GetGUID(), newPrice, auction->GetAuctionOutBid(), auction->itemEntry); @@ -281,7 +282,7 @@ void AuctionHouseMgr::SendAuctionCancelledToBidderMail(AuctionEntry* auction, SQ bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid); // bidder exist - if (bidder || bidder_accId) + if ((bidder || bidder_accId) && !sAuctionBotConfig->IsBotChar(auction->bidder)) MailDraft(auction->BuildAuctionMailSubject(AUCTION_CANCELLED_TO_BIDDER), AuctionEntry::BuildAuctionMailBody(auction->owner, auction->bid, auction->buyout, auction->deposit, 0)) .AddMoney(auction->bid) .SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED); diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp index 74f0aaf428a..4601495a70b 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.cpp @@ -15,10 +15,12 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "Containers.h" #include "Log.h" #include "Item.h" #include "World.h" #include "Config.h" +#include "AccountMgr.h" #include "AuctionHouseMgr.h" #include "AuctionHouseBot.h" #include "AuctionHouseBotBuyer.h" @@ -56,6 +58,31 @@ bool AuctionBotConfig::Initialize() _itemsPerCycleBoost = GetConfig(CONFIG_AHBOT_ITEMS_PER_CYCLE_BOOST); _itemsPerCycleNormal = GetConfig(CONFIG_AHBOT_ITEMS_PER_CYCLE_NORMAL); + if (uint32 ahBotAccId = GetConfig(CONFIG_AHBOT_ACCOUNT_ID)) + { + // check character count + if (AccountMgr::GetCharactersCount(GetConfig(CONFIG_AHBOT_ACCOUNT_ID))) + { + // find account guids associated with ahbot account + uint32 count = 0; + PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARS_BY_ACCOUNT_ID); + stmt->setUInt32(0, ahBotAccId); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) + { + do + { + Field* fields = result->Fetch(); + _AHBotCharacters.push_back(fields[0].GetUInt32()); + ++count; + } while (result->NextRow()); + } + + TC_LOG_DEBUG("ahbot", "AuctionHouseBot found %u characters", count); + } + else + TC_LOG_WARN("ahbot", "AuctionHouseBot Account ID %u has no associated characters.", ahBotAccId); + } + return true; } @@ -111,6 +138,8 @@ void AuctionBotConfig::SetConfig(AuctionBotConfigFloatValues index, char const* //Get AuctionHousebot configuration file void AuctionBotConfig::GetConfigFromFile() { + SetConfig(CONFIG_AHBOT_ACCOUNT_ID, "AuctionHouseBot.Account", 0); + SetConfigMax(CONFIG_AHBOT_ALLIANCE_ITEM_AMOUNT_RATIO, "AuctionHouseBot.Alliance.Items.Amount.Ratio", 100, 10000); SetConfigMax(CONFIG_AHBOT_HORDE_ITEM_AMOUNT_RATIO, "AuctionHouseBot.Horde.Items.Amount.Ratio", 100, 10000); SetConfigMax(CONFIG_AHBOT_NEUTRAL_ITEM_AMOUNT_RATIO, "AuctionHouseBot.Neutral.Items.Amount.Ratio", 100, 10000); @@ -272,6 +301,40 @@ char const* AuctionBotConfig::GetHouseTypeName(AuctionHouseType houseType) return names[houseType]; } +// Picks a random character from the list of AHBot chars +uint32 AuctionBotConfig::GetRandChar() const +{ + if (_AHBotCharacters.empty()) + return 0; + + return Trinity::Containers::SelectRandomContainerElement(_AHBotCharacters); +} + +// Picks a random AHBot character, but excludes a specific one. This is used +// to have another character than the auction owner place bids +uint32 AuctionBotConfig::GetRandCharExclude(uint32 exclude) const +{ + if (_AHBotCharacters.empty()) + return 0; + + std::vector<uint32> filteredCharacters; + filteredCharacters.reserve(_AHBotCharacters.size() - 1); + + for (uint32 charId : _AHBotCharacters) + if (charId != exclude) + filteredCharacters.push_back(charId); + + if (filteredCharacters.empty()) + return 0; + + return Trinity::Containers::SelectRandomContainerElement(filteredCharacters); +} + +bool AuctionBotConfig::IsBotChar(uint32 characterID) const +{ + return !characterID || std::find(_AHBotCharacters.begin(), _AHBotCharacters.end(), characterID) != _AHBotCharacters.end(); +} + uint32 AuctionBotConfig::GetConfigItemAmountRatio(AuctionHouseType houseType) const { switch (houseType) @@ -408,7 +471,7 @@ void AuctionHouseBot::PrepareStatusInfos(AuctionHouseBotStatusInfo& statusInfo) if (Item* item = sAuctionMgr->GetAItem(auctionEntry->itemGUIDLow)) { ItemTemplate const* prototype = item->GetTemplate(); - if (!auctionEntry->owner) // Add only ahbot items + if (!auctionEntry->owner || sAuctionBotConfig->IsBotChar(auctionEntry->owner)) // Add only ahbot items { if (prototype->Quality < MAX_AUCTION_QUALITY) ++statusInfo[i].QualityInfo[prototype->Quality]; @@ -426,7 +489,7 @@ void AuctionHouseBot::Rebuild(bool all) { AuctionHouseObject* auctionHouse = sAuctionMgr->GetAuctionsMap(AuctionHouseType(i)); for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = auctionHouse->GetAuctionsBegin(); itr != auctionHouse->GetAuctionsEnd(); ++itr) - if (!itr->second->owner) // ahbot auction + if (!itr->second->owner || sAuctionBotConfig->IsBotChar(itr->second->owner)) // ahbot auction if (all || itr->second->bid == 0) // expire now auction if no bid or forced itr->second->expire_time = sWorld->GetGameTime(); } diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBot.h b/src/server/game/AuctionHouseBot/AuctionHouseBot.h index 1a438e01cdb..4f68a172255 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBot.h +++ b/src/server/game/AuctionHouseBot/AuctionHouseBot.h @@ -152,6 +152,7 @@ enum AuctionBotConfigUInt32Values CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_KEY, CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_MISC, CONFIG_AHBOT_CLASS_RANDOMSTACKRATIO_GLYPH, + CONFIG_AHBOT_ACCOUNT_ID, CONFIG_UINT32_AHBOT_UINT32_COUNT }; @@ -224,6 +225,9 @@ public: uint32 GetItemPerCycleBoost() const { return _itemsPerCycleBoost; } uint32 GetItemPerCycleNormal() const { return _itemsPerCycleNormal; } + uint32 GetRandChar() const; + uint32 GetRandCharExclude(uint32 exclude) const; + bool IsBotChar(uint32 characterID) const; void Reload() { GetConfigFromFile(); } static char const* GetHouseTypeName(AuctionHouseType houseType); @@ -231,6 +235,7 @@ public: private: std::string _AHBotIncludes; std::string _AHBotExcludes; + std::vector<uint32> _AHBotCharacters; uint32 _itemsPerCycleBoost; uint32 _itemsPerCycleNormal; diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp index 6b1dcb85bec..0e6b3402db0 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotBuyer.cpp @@ -103,7 +103,7 @@ uint32 AuctionBotBuyer::GetItemInformation(BuyerConfiguration& config) { AuctionEntry* entry = itr->second; - if (!entry->owner) + if (!entry->owner || sAuctionBotConfig->IsBotChar(entry->owner)) continue; // Skip auctions owned by AHBot Item* item = sAuctionMgr->GetAItem(entry->itemGUIDLow); @@ -218,7 +218,7 @@ bool AuctionBotBuyer::RollBidChance(const BuyerItemInfo* ahInfo, const Item* ite } // If a player has bidded on item, have fifth of normal chance - if (auction->bidder) + if (auction->bidder && !sAuctionBotConfig->IsBotChar(auction->bidder)) chance = chance / 5.f; // Add config weigh in for quality @@ -391,11 +391,11 @@ void AuctionBotBuyer::BuyEntry(AuctionEntry* auction, AuctionHouseObject* auctio SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Send mail to previous bidder if any - if (auction->bidder) + if (auction->bidder && !sAuctionBotConfig->IsBotChar(auction->bidder)) sAuctionMgr->SendAuctionOutbiddedMail(auction, auction->buyout, NULL, trans); // Set bot as bidder and set new bid amount - auction->bidder = 0; + auction->bidder = sAuctionBotConfig->GetRandCharExclude(auction->owner); auction->bid = auction->buyout; // Mails must be under transaction control too to prevent data loss @@ -422,11 +422,11 @@ void AuctionBotBuyer::PlaceBidToEntry(AuctionEntry* auction, uint32 bidPrice) SQLTransaction trans = CharacterDatabase.BeginTransaction(); // Send mail to previous bidder if any - if (auction->bidder) + if (auction->bidder && !sAuctionBotConfig->IsBotChar(auction->bidder)) sAuctionMgr->SendAuctionOutbiddedMail(auction, bidPrice, NULL, trans); // Set bot as bidder and set new bid amount - auction->bidder = 0; + auction->bidder = sAuctionBotConfig->GetRandCharExclude(auction->owner); auction->bid = bidPrice; // Update auction to DB diff --git a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp index 17b104eb388..34127f0c59f 100644 --- a/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp +++ b/src/server/game/AuctionHouseBot/AuctionHouseBotSeller.cpp @@ -320,7 +320,7 @@ bool AuctionBotSeller::Initialize() continue; } - if (prototype->Flags & ITEM_FLAG_UNLOCKED) + if (prototype->Flags & ITEM_FLAG_HAS_LOOT) { // skip any not locked lootable items (mostly quest specific or reward cases) if (!prototype->LockID) @@ -640,7 +640,7 @@ uint32 AuctionBotSeller::SetStat(SellerConfiguration& config) { ItemTemplate const* prototype = item->GetTemplate(); if (prototype) - if (!auctionEntry->owner) // Add only ahbot items + if (!auctionEntry->owner || sAuctionBotConfig->IsBotChar(auctionEntry->owner)) // Add only ahbot items ++itemsSaved[prototype->Quality][prototype->Class]; } } @@ -1019,7 +1019,7 @@ void AuctionBotSeller::AddNewAuctions(SellerConfiguration& config) AuctionEntry* auctionEntry = new AuctionEntry(); auctionEntry->Id = sObjectMgr->GenerateAuctionID(); - auctionEntry->owner = 0; + auctionEntry->owner = sAuctionBotConfig->GetRandChar(); auctionEntry->itemGUIDLow = item->GetGUID().GetCounter(); auctionEntry->itemEntry = item->GetEntry(); auctionEntry->startbid = bidPrice; diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp index b82d5ed5837..8df95619ae5 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.cpp +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.cpp @@ -61,9 +61,6 @@ G3D::Quat const WintergraspRelicRot = { 0.f, 0.f, -0.7933531f, 0.6087617f }; uint8 const WG_MAX_OBJ = 32; uint8 const WG_MAX_TURRET = 15; -uint8 const WG_MAX_KEEP_NPC = 39; -uint8 const WG_MAX_OUTSIDE_NPC = 14; -uint8 const WG_OUTSIDE_ALLIANCE_NPC = 7; uint8 const WG_MAX_TELEPORTER = 12; uint8 const WG_MAX_WORKSHOP = 6; uint8 const WG_MAX_TOWER = 7; @@ -177,76 +174,6 @@ struct WintergraspObjectPositionData uint32 AllianceEntry; }; -// Here there is all npc keeper spawn point -WintergraspObjectPositionData const WGKeepNPC[WG_MAX_KEEP_NPC] = -{ - // X Y Z O horde alliance - // North East - { { 5326.203125f, 2660.026367f, 409.100891f, 2.543383f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Roaming Guard - { { 5298.430176f, 2738.760010f, 409.316010f, 3.971740f }, BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER, BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH }, // Vieron Blazefeather - { { 5335.310059f, 2764.110107f, 409.274994f, 4.834560f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5349.810059f, 2763.629883f, 409.333008f, 4.660030f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - // North - { { 5373.470215f, 2789.060059f, 409.322998f, 2.600540f }, BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR, BATTLEFIELD_WG_NPC_KNIGHT_DAMERON }, // Stone Guard Mukar - { { 5296.560059f, 2789.870117f, 409.274994f, 0.733038f }, BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN, BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA }, // Voodoo Master Fu'jin - { { 5372.670000f, 2786.740000f, 409.442000f, 2.809980f }, BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI, BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER }, // Wintergrasp Quartermaster - { { 5368.709961f, 2856.360107f, 409.322998f, 2.949610f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5367.910156f, 2826.520020f, 409.322998f, 3.333580f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5389.270020f, 2847.370117f, 418.759003f, 3.106690f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5388.560059f, 2834.770020f, 418.759003f, 3.071780f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5359.129883f, 2837.989990f, 409.364014f, 4.698930f }, BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH, BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH }, // Commander Dardosh - { { 5366.129883f, 2833.399902f, 409.322998f, 3.141590f }, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS }, // Tactical Officer Kilrath - // X Y Z O horde alliance - // North West - { { 5350.680176f, 2917.010010f, 409.274994f, 1.466080f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5335.120117f, 2916.800049f, 409.444000f, 1.500980f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5295.560059f, 2926.669922f, 409.274994f, 0.872665f }, BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF, BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE }, // Stronghoof - { { 5371.399902f, 3026.510010f, 409.205994f, 3.250030f }, BATTLEFIELD_WG_NPC_PRIMALIST_MULFORT, BATTLEFIELD_WG_NPC_ANCHORITE_TESSA }, // Primalist Mulfort - { { 5392.123535f, 3031.110352f, 409.187683f, 3.677212f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Roaming Guard - // South - { { 5270.060059f, 2847.550049f, 409.274994f, 3.071780f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5270.160156f, 2833.479980f, 409.274994f, 3.124140f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5179.109863f, 2837.129883f, 409.274994f, 3.211410f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5179.669922f, 2846.600098f, 409.274994f, 3.089230f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5234.970215f, 2883.399902f, 409.274994f, 4.293510f }, BATTLEFIELD_WG_NPC_LIEUTENANT_MURP, BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO }, // Lieutenant Murp - // X Y Z O horde alliance - // Portal guards (from around the fortress) - { { 5319.209473f, 3055.947754f, 409.176636f, 1.020201f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5311.612305f, 3061.207275f, 408.734161f, 0.965223f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5264.713379f, 3017.283447f, 408.479706f, 3.482424f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5269.096191f, 3008.315918f, 408.826294f, 3.843706f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5201.414551f, 2945.096924f, 409.190735f, 0.945592f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5193.386230f, 2949.617188f, 409.190735f, 1.145859f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5148.116211f, 2904.761963f, 409.193756f, 3.368532f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5153.355957f, 2895.501465f, 409.199310f, 3.549174f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5154.353027f, 2787.349365f, 409.250183f, 2.555644f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5150.066406f, 2777.876953f, 409.343903f, 2.708797f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5193.706543f, 2732.882812f, 409.189514f, 4.845073f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5202.126953f, 2737.570557f, 409.189514f, 5.375215f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5269.181152f, 2671.174072f, 409.098999f, 2.457459f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5264.960938f, 2662.332520f, 409.098999f, 2.598828f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5307.111816f, 2616.006836f, 409.095734f, 5.355575f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A }, // Standing Guard - { { 5316.770996f, 2619.430176f, 409.027740f, 5.363431f }, BATTLEFIELD_WG_NPC_GUARD_H, BATTLEFIELD_WG_NPC_GUARD_A } // Standing Guard -}; - -WintergraspObjectPositionData const WGOutsideNPC[WG_MAX_OUTSIDE_NPC] = -{ - { { 5032.04f, 3681.79f, 362.980f, 4.210f }, BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER, 0 }, - { { 5020.71f, 3626.19f, 360.150f, 4.640f }, BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN, 0 }, - { { 4994.85f, 3660.51f, 359.150f, 2.260f }, BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH, 0 }, - { { 5015.46f, 3677.11f, 362.970f, 6.009f }, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH, 0 }, - { { 5031.12f, 3663.77f, 363.500f, 3.110f }, BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF, 0 }, - { { 5042.74f, 3675.82f, 363.060f, 3.358f }, BATTLEFIELD_WG_NPC_PRIMALIST_MULFORT, 0 }, - { { 5014.45f, 3640.87f, 361.390f, 3.280f }, BATTLEFIELD_WG_NPC_LIEUTENANT_MURP, 0 }, - { { 5100.07f, 2168.89f, 365.779f, 1.972f }, 0, BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH }, - { { 5081.70f, 2173.73f, 365.878f, 0.855f }, 0, BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA }, - { { 5078.28f, 2183.70f, 365.029f, 1.466f }, 0, BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH }, - { { 5088.49f, 2188.18f, 365.647f, 5.253f }, 0, BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS }, - { { 5095.67f, 2193.28f, 365.924f, 4.939f }, 0, BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE }, - { { 5088.61f, 2167.66f, 365.689f, 0.680f }, 0, BATTLEFIELD_WG_NPC_ANCHORITE_TESSA }, - { { 5080.40f, 2199.00f, 359.489f, 2.967f }, 0, BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO }, -}; - struct WintergraspGameObjectData { Position Pos; @@ -492,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); @@ -550,7 +478,7 @@ bool BattlefieldWG::SetupBattlefield() for (uint8 i = 0; i < WG_MAX_WORKSHOP; i++) { WintergraspWorkshop* workshop = new WintergraspWorkshop(this, i); - if (i < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST) + if (i < BATTLEFIELD_WG_WORKSHOP_NE) workshop->GiveControlTo(GetAttackerTeam(), true); else workshop->GiveControlTo(GetDefenderTeam(), true); @@ -559,38 +487,6 @@ bool BattlefieldWG::SetupBattlefield() Workshops[i] = workshop; } - // Spawn NPCs in the defender's keep, both Horde and Alliance - for (uint8 i = 0; i < WG_MAX_KEEP_NPC; ++i) - { - // Horde npc - if (Creature* creature = SpawnCreature(WGKeepNPC[i].HordeEntry, WGKeepNPC[i].Pos)) - KeepCreature[TEAM_HORDE].push_back(creature->GetGUID()); - - // Alliance npc - if (Creature* creature = SpawnCreature(WGKeepNPC[i].AllianceEntry, WGKeepNPC[i].Pos)) - KeepCreature[TEAM_ALLIANCE].push_back(creature->GetGUID()); - } - - // Hide NPCs from the Attacker's team in the keep - for (auto itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr) - if (Creature* creature = GetCreature(*itr)) - HideNpc(creature); - - // Spawn Horde NPCs outside the keep - for (uint8 i = 0; i < WG_OUTSIDE_ALLIANCE_NPC; ++i) - if (Creature* creature = SpawnCreature(WGOutsideNPC[i].HordeEntry, WGOutsideNPC[i].Pos)) - OutsideCreature[TEAM_HORDE].push_back(creature->GetGUID()); - - // Spawn Alliance NPCs outside the keep - for (uint8 i = WG_OUTSIDE_ALLIANCE_NPC; i < WG_MAX_OUTSIDE_NPC; ++i) - if (Creature* creature = SpawnCreature(WGOutsideNPC[i].AllianceEntry, WGOutsideNPC[i].Pos)) - OutsideCreature[TEAM_ALLIANCE].push_back(creature->GetGUID()); - - // Hide units outside the keep that are defenders - for (auto itr = OutsideCreature[GetDefenderTeam()].begin(); itr != OutsideCreature[GetDefenderTeam()].end(); ++itr) - if (Creature* creature = GetCreature(*itr)) - HideNpc(creature); - // Spawn turrets and hide them per default for (uint8 i = 0; i < WG_MAX_TURRET; i++) { @@ -768,27 +664,6 @@ void BattlefieldWG::OnBattleEnd(bool endByTimer) } } - if (!endByTimer) // One player triggered the relic - { - // Change all npc in keep - for (auto itr = KeepCreature[GetAttackerTeam()].begin(); itr != KeepCreature[GetAttackerTeam()].end(); ++itr) - if (Creature* creature = GetCreature(*itr)) - HideNpc(creature); - - for (auto itr = KeepCreature[GetDefenderTeam()].begin(); itr != KeepCreature[GetDefenderTeam()].end(); ++itr) - if (Creature* creature = GetCreature(*itr)) - ShowNpc(creature, true); - - // Change all npc out of keep - for (auto itr = OutsideCreature[GetDefenderTeam()].begin(); itr != OutsideCreature[GetDefenderTeam()].end(); ++itr) - if (Creature* creature = GetCreature(*itr)) - HideNpc(creature); - - for (auto itr = OutsideCreature[GetAttackerTeam()].begin(); itr != OutsideCreature[GetAttackerTeam()].end(); ++itr) - if (Creature* creature = GetCreature(*itr)) - ShowNpc(creature, true); - } - // Update all graveyard, control is to defender when no wartime for (uint8 i = 0; i < BATTLEFIELD_WG_GY_HORDE; i++) if (BfGraveyard* graveyard = GetGraveyardById(i)) @@ -1073,33 +948,9 @@ void BattlefieldWG::HandleKill(Player* killer, Unit* victim) if (killer == victim) return; - bool again = false; - TeamId killerTeam = killer->GetTeamId(); - if (victim->GetTypeId() == TYPEID_PLAYER) - { - for (auto itr = m_PlayersInWar[killerTeam].begin(); itr != m_PlayersInWar[killerTeam].end(); ++itr) - if (Player* player = ObjectAccessor::FindPlayer(*itr)) - if (player->GetDistance2d(killer) < 40) - PromotePlayer(player); - return; - } + HandlePromotion(killer, victim); - for (auto itr = KeepCreature[GetOtherTeam(killerTeam)].begin(); - itr != KeepCreature[GetOtherTeam(killerTeam)].end(); ++itr) - { - if (Creature* creature = GetCreature(*itr)) - { - if (victim->GetEntry() == creature->GetEntry() && !again) - { - again = true; - for (auto iter = m_PlayersInWar[killerTeam].begin(); iter != m_PlayersInWar[killerTeam].end(); ++iter) - if (Player* player = ObjectAccessor::FindPlayer(*iter)) - if (player->GetDistance2d(killer) < 40.0f) - PromotePlayer(player); - } - } - } /// @todoRecent PvP activity worldstate } @@ -1131,6 +982,16 @@ void BattlefieldWG::OnUnitDeath(Unit* unit) UpdateVehicleCountWG(); } +void BattlefieldWG::HandlePromotion(Player* playerKiller, Unit* unitKilled) +{ + uint32 teamId = playerKiller->GetTeamId(); + + for (auto iter = m_PlayersInWar[teamId].begin(); iter != m_PlayersInWar[teamId].end(); ++iter) + if (Player* player = ObjectAccessor::FindPlayer(*iter)) + if (player->GetDistance2d(unitKilled) < 40.0f) + PromotePlayer(player); +} + // Update rank for player void BattlefieldWG::PromotePlayer(Player* killer) { @@ -1224,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) @@ -1317,25 +1179,17 @@ void BattlefieldWG::SendInitWorldStatesToAll() SendInitWorldStatesTo(player); } -void BattlefieldWG::BrokenWallOrTower(TeamId /*team*/) -{ -/* -uint32 const WGQuest[2][6] = +void BattlefieldWG::BrokenWallOrTower(TeamId team, BfWGGameObjectBuilding* building) { - { 13186, 13181, 13222, 13538, 13177, 13179 }, - { 13185, 13183, 13223, 13539, 13178, 13180 }, -}; -*/ - -// might be some use for this in the future. old code commented out below. KL -/* if (team == GetDefenderTeam()) + if (team == GetDefenderTeam()) { - for (GuidSet::const_iterator itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr) + for (auto itr = m_PlayersInWar[GetAttackerTeam()].begin(); itr != m_PlayersInWar[GetAttackerTeam()].end(); ++itr) { if (Player* player = ObjectAccessor::FindPlayer(*itr)) - IncrementQuest(player, WGQuest[player->GetTeamId()][2], true); + if (player->GetDistance2d(GetGameObject(building->GetGUID())) < 50.0f) + player->KilledMonsterCredit(QUEST_CREDIT_DEFEND_SIEGE); } - }*/ + } } // Called when a tower is broke @@ -1437,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; @@ -1453,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); } @@ -1475,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; @@ -1490,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) @@ -1634,7 +1484,7 @@ void BfWGGameObjectBuilding::Destroyed() break; } - _wg->BrokenWallOrTower(_teamControl); + _wg->BrokenWallOrTower(_teamControl, this); } void BfWGGameObjectBuilding::Init(GameObject* go) @@ -1958,8 +1808,8 @@ void WintergraspWorkshop::GiveControlTo(TeamId teamId, bool init /*= false*/) void WintergraspWorkshop::UpdateGraveyardAndWorkshop() { - if (_staticInfo->WorkshopId < BATTLEFIELD_WG_WORKSHOP_KEEP_WEST) - _wg->GetGraveyardById(_staticInfo->WorkshopId)->GiveControlTo(_teamControl); + if (_staticInfo->WorkshopId < BATTLEFIELD_WG_WORKSHOP_NE) + GiveControlTo(_wg->GetAttackerTeam(), true); else GiveControlTo(_wg->GetDefenderTeam(), true); } diff --git a/src/server/game/Battlefield/Zones/BattlefieldWG.h b/src/server/game/Battlefield/Zones/BattlefieldWG.h index 8fa72bea8fd..3bd719c1a60 100644 --- a/src/server/game/Battlefield/Zones/BattlefieldWG.h +++ b/src/server/game/Battlefield/Zones/BattlefieldWG.h @@ -154,7 +154,8 @@ enum WintergraspQuests { QUEST_VICTORY_WINTERGRASP_A = 13181, QUEST_VICTORY_WINTERGRASP_H = 13183, - QUEST_CREDIT_TOWERS_DESTROYED = 35074 + QUEST_CREDIT_TOWERS_DESTROYED = 35074, + QUEST_CREDIT_DEFEND_SIEGE = 31284 }; /*######################### @@ -202,26 +203,6 @@ enum WintergraspNpcs BATTLEFIELD_WG_NPC_GUARD_A = 30740, BATTLEFIELD_WG_NPC_STALKER = 15214, - BATTLEFIELD_WG_NPC_VIERON_BLAZEFEATHER = 31102, - BATTLEFIELD_WG_NPC_STONE_GUARD_MUKAR = 32296, // <WINTERGRASP QUARTERMASTER> - BATTLEFIELD_WG_NPC_HOODOO_MASTER_FU_JIN = 31101, // <MASTER HEXXER> - BATTLEFIELD_WG_NPC_CHAMPION_ROS_SLAI = 39173, // <WINTERGRASP QUARTERMASTER> - BATTLEFIELD_WG_NPC_COMMANDER_DARDOSH = 31091, - BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_KILRATH = 31151, - BATTLEFIELD_WG_NPC_SIEGESMITH_STRONGHOOF = 31106, - BATTLEFIELD_WG_NPC_PRIMALIST_MULFORT = 31053, - BATTLEFIELD_WG_NPC_LIEUTENANT_MURP = 31107, - - BATTLEFIELD_WG_NPC_BOWYER_RANDOLPH = 31052, - BATTLEFIELD_WG_NPC_KNIGHT_DAMERON = 32294, // <WINTERGRASP QUARTERMASTER> - BATTLEFIELD_WG_NPC_SORCERESS_KAYLANA = 31051, // <ENCHANTRESS> - BATTLEFIELD_WG_NPC_MARSHAL_MAGRUDER = 39172, // <WINTERGRASP QUARTERMASTER> - BATTLEFIELD_WG_NPC_COMMANDER_ZANNETH = 31036, - BATTLEFIELD_WG_NPC_TACTICAL_OFFICER_AHBRAMIS = 31153, - BATTLEFIELD_WG_NPC_SIEGE_MASTER_STOUTHANDLE = 31108, - BATTLEFIELD_WG_NPC_ANCHORITE_TESSA = 31054, - BATTLEFIELD_WG_NPC_SENIOR_DEMOLITIONIST_LEGOSO = 31109, - NPC_TAUNKA_SPIRIT_GUIDE = 31841, // Horde spirit guide for Wintergrasp NPC_DWARVEN_SPIRIT_GUIDE = 31842, // Alliance spirit guide for Wintergrasp @@ -343,7 +324,7 @@ class TC_GAME_API BattlefieldWG : public Battlefield * \brief Called when a wall/tower is broken * - Update quest */ - void BrokenWallOrTower(TeamId team); + void BrokenWallOrTower(TeamId team, BfWGGameObjectBuilding* building); /** * \brief Called when a tower is damaged @@ -388,6 +369,7 @@ class TC_GAME_API BattlefieldWG : public Battlefield void HandleKill(Player* killer, Unit* victim) override; void OnUnitDeath(Unit* unit) override; + void HandlePromotion(Player* killer, Unit* killed); void PromotePlayer(Player* killer); void UpdateTenacity(); @@ -410,9 +392,8 @@ class TC_GAME_API BattlefieldWG : public Battlefield GuidUnorderedSet m_vehicles[BG_TEAMS_COUNT]; GuidVector CanonList; - GuidVector KeepCreature[BG_TEAMS_COUNT]; - GuidVector OutsideCreature[BG_TEAMS_COUNT]; + TeamId m_tenacityTeam; uint32 m_tenacityStack; uint32 m_saveTimer; @@ -456,10 +437,10 @@ enum WintergraspTowerIds enum WintergraspWorkshopIds { - BATTLEFIELD_WG_WORKSHOP_NE, - BATTLEFIELD_WG_WORKSHOP_NW, BATTLEFIELD_WG_WORKSHOP_SE, BATTLEFIELD_WG_WORKSHOP_SW, + BATTLEFIELD_WG_WORKSHOP_NE, + BATTLEFIELD_WG_WORKSHOP_NW, BATTLEFIELD_WG_WORKSHOP_KEEP_WEST, BATTLEFIELD_WG_WORKSHOP_KEEP_EAST }; 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 22601b711d1..afaa0063a45 100644 --- a/src/server/game/Chat/Channels/Channel.cpp +++ b/src/server/game/Chat/Channels/Channel.cpp @@ -17,93 +17,124 @@ */ #include "Channel.h" +#include "ChannelAppenders.h" #include "Chat.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" #include "ObjectMgr.h" +#include "Language.h" #include "SocialMgr.h" #include "World.h" #include "DatabaseEnv.h" #include "AccountMgr.h" #include "Player.h" -Channel::Channel(std::string const& name, uint32 channelId, uint32 team /*= 0*/): - _announceEnabled(true), - _ownershipEnabled(true), +Channel::Channel(uint32 channelId, uint32 team /*= 0*/, AreaTableEntry const* zoneEntry /*= nullptr*/) : + _announceEnabled(false), // no join/leave announces + _ownershipEnabled(false), // no ownership handout _persistentChannel(false), _isOwnerInvisible(false), - _channelFlags(0), + _channelFlags(CHANNEL_FLAG_GENERAL), // for all built-in channels _channelId(channelId), _channelTeam(team), _ownerGuid(), - _channelName(name), - _channelPassword() + _channelName(), + _channelPassword(), + _zoneEntry(zoneEntry) { - // set special flags if built-in channel - if (ChatChannelsEntry const* ch = sChatChannelsStore.LookupEntry(channelId)) // check whether it's a built-in channel - { - _announceEnabled = false; // no join/leave announces - _ownershipEnabled = false; // no ownership handout + ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); + if (channelEntry->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel + _channelFlags |= CHANNEL_FLAG_TRADE; - _channelFlags |= CHANNEL_FLAG_GENERAL; // for all built-in channels + if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels + _channelFlags |= CHANNEL_FLAG_CITY; - if (ch->flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel - _channelFlags |= CHANNEL_FLAG_TRADE; - - if (ch->flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels - _channelFlags |= CHANNEL_FLAG_CITY; + if (channelEntry->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel + _channelFlags |= CHANNEL_FLAG_LFG; + else // for all other channels + _channelFlags |= CHANNEL_FLAG_NOT_LFG; +} - if (ch->flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel - _channelFlags |= CHANNEL_FLAG_LFG; - else // for all other channels - _channelFlags |= CHANNEL_FLAG_NOT_LFG; - } - else // it's custom channel +Channel::Channel(std::string const& name, uint32 team /*= 0*/) : + _announceEnabled(true), + _ownershipEnabled(true), + _persistentChannel(false), + _isOwnerInvisible(false), + _channelFlags(CHANNEL_FLAG_CUSTOM), + _channelId(0), + _channelTeam(team), + _ownerGuid(), + _channelName(name), + _channelPassword(), + _zoneEntry(nullptr) +{ + // If storing custom channels in the db is enabled either load or save the channel + if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) { - _channelFlags |= CHANNEL_FLAG_CUSTOM; - - // If storing custom channels in the db is enabled either load or save the channel - if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS)) + PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL); + stmt->setString(0, name); + stmt->setUInt32(1, _channelTeam); + if (PreparedQueryResult result = CharacterDatabase.Query(stmt)) // load { - PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHANNEL); - stmt->setString(0, name); - stmt->setUInt32(1, _channelTeam); - PreparedQueryResult result = CharacterDatabase.Query(stmt); - - if (result) //load + Field* fields = result->Fetch(); + _channelName = fields[0].GetString(); // re-get channel name. MySQL table collation is case insensitive + _announceEnabled = fields[1].GetBool(); + _ownershipEnabled = fields[2].GetBool(); + _channelPassword = fields[3].GetString(); + std::string db_BannedList = fields[4].GetString(); + + if (!db_BannedList.empty()) { - Field* fields = result->Fetch(); - _announceEnabled = fields[0].GetBool(); - _ownershipEnabled = fields[1].GetBool(); - _channelPassword = fields[2].GetString(); - char const* db_BannedList = fields[3].GetCString(); - - if (db_BannedList) + Tokenizer tokens(db_BannedList, ' '); + for (auto const& token : tokens) { - Tokenizer tokens(db_BannedList, ' '); - for (Tokenizer::const_iterator i = tokens.begin(); i != tokens.end(); ++i) + ObjectGuid banned_guid(uint64(atoull(token))); + if (banned_guid) { - ObjectGuid banned_guid(uint64(atoull(*i))); - if (banned_guid) - { - TC_LOG_DEBUG("chat.system", "Channel(%s) loaded bannedStore %s", name.c_str(), banned_guid.ToString().c_str()); - _bannedStore.insert(banned_guid); - } + TC_LOG_DEBUG("chat.system", "Channel(%s) loaded player %s into bannedStore", name.c_str(), banned_guid.ToString().c_str()); + _bannedStore.insert(banned_guid); } } } - else // save - { - stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHANNEL); - stmt->setString(0, name); - stmt->setUInt32(1, _channelTeam); - CharacterDatabase.Execute(stmt); - TC_LOG_DEBUG("chat.system", "Channel(%s) saved in database", name.c_str()); - } + } + else // save + { + stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHANNEL); + stmt->setString(0, name); + stmt->setUInt32(1, _channelTeam); + CharacterDatabase.Execute(stmt); + TC_LOG_DEBUG("chat.system", "Channel(%s) saved in database", name.c_str()); + } - _persistentChannel = true; + _persistentChannel = true; + } +} + +void Channel::GetChannelName(std::string& channelName, uint32 channelId, LocaleConstant locale, AreaTableEntry const* zoneEntry) +{ + if (channelId) + { + ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); + if (!(channelEntry->flags & CHANNEL_DBC_FLAG_GLOBAL)) + { + if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY) + channelName = Trinity::StringFormat(channelEntry->pattern[locale], sObjectMgr->GetTrinityString(LANG_CHANNEL_CITY, locale)); + else + channelName = Trinity::StringFormat(channelEntry->pattern[locale], ASSERT_NOTNULL(zoneEntry)->area_name[locale]); } + else + channelName = channelEntry->pattern[locale]; } } +std::string Channel::GetName(LocaleConstant locale /*= DEFAULT_LOCALE*/) const +{ + std::string result = _channelName; + Channel::GetChannelName(result, _channelId, locale, _zoneEntry); + + return result; +} + void Channel::UpdateChannelInDB() const { if (_persistentChannel) @@ -155,26 +186,26 @@ void Channel::JoinChannel(Player* player, std::string const& pass) // Do not send error message for built-in channels if (!IsConstant()) { - WorldPacket data; - MakePlayerAlreadyMember(&data, guid); - SendToOne(&data, guid); + PlayerAlreadyMemberAppend appender(guid); + ChannelNameBuilder<PlayerAlreadyMemberAppend> builder(this, appender); + SendToOne(builder, guid); } return; } if (IsBanned(guid)) { - WorldPacket data; - MakeBanned(&data); - SendToOne(&data, guid); + BannedAppend appender; + ChannelNameBuilder<BannedAppend> builder(this, appender); + SendToOne(builder, guid); return; } if (!_channelPassword.empty() && pass != _channelPassword) { - WorldPacket data; - MakeWrongPassword(&data); - SendToOne(&data, guid); + WrongPasswordAppend appender; + ChannelNameBuilder<WrongPasswordAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -183,9 +214,9 @@ void Channel::JoinChannel(Player* player, std::string const& pass) AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && //FIXME: Move to RBAC player->GetGroup()) { - WorldPacket data; - MakeNotInLfg(&data); - SendToOne(&data, guid); + NotInLFGAppend appender; + ChannelNameBuilder<NotInLFGAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -193,9 +224,9 @@ void Channel::JoinChannel(Player* player, std::string const& pass) if (_announceEnabled && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { - WorldPacket data; - MakeJoined(&data, guid); - SendToAll(&data); + JoinedAppend appender(guid); + ChannelNameBuilder<JoinedAppend> builder(this, appender); + SendToAll(builder); } bool newChannel = _playersStore.empty(); @@ -204,9 +235,9 @@ void Channel::JoinChannel(Player* player, std::string const& pass) pinfo.flags = MEMBER_FLAG_NONE; pinfo.invisible = !player->isGMVisible(); - WorldPacket data; - MakeYouJoined(&data); - SendToOne(&data, guid); + YouJoinedAppend appender(this); + ChannelNameBuilder<YouJoinedAppend> builder(this, appender); + SendToOne(builder, guid); JoinNotify(guid); @@ -236,20 +267,20 @@ void Channel::LeaveChannel(Player* player, bool send) { if (send) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); } return; } if (send) { - WorldPacket data; - MakeYouLeft(&data); - SendToOne(&data, guid); + YouLeftAppend appender(this); + ChannelNameBuilder<YouLeftAppend> builder(this, appender); + SendToOne(builder, guid); + player->LeftChannel(this); - data.clear(); } PlayerInfo& info = _playersStore.at(guid); @@ -258,9 +289,9 @@ void Channel::LeaveChannel(Player* player, bool send) if (_announceEnabled && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { - WorldPacket data; - MakeLeft(&data, guid); - SendToAll(&data); + LeftAppend appender(guid); + ChannelNameBuilder<LeftAppend> builder(this, appender); + SendToAll(builder); } LeaveNotify(guid); @@ -302,18 +333,18 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b if (!IsOn(good)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, good); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, good); return; } PlayerInfo& info = _playersStore.at(good); if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR)) { - WorldPacket data; - MakeNotModerator(&data); - SendToOne(&data, good); + NotModeratorAppend appender; + ChannelNameBuilder<NotModeratorAppend> builder(this, appender); + SendToOne(builder, good); return; } @@ -321,9 +352,9 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty; if (!victim || !IsOn(victim)) { - WorldPacket data; - MakePlayerNotFound(&data, badname); - SendToOne(&data, good); + PlayerNotFoundAppend appender(badname); + ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender); + SendToOne(builder, good); return; } @@ -331,9 +362,9 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && changeowner && good != _ownerGuid) { - WorldPacket data; - MakeNotOwner(&data); - SendToOne(&data, good); + NotOwnerAppend appender; + ChannelNameBuilder<NotOwnerAppend> builder(this, appender); + SendToOne(builder, good); return; } @@ -344,16 +375,16 @@ void Channel::KickOrBan(Player const* player, std::string const& badname, bool b if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { - WorldPacket data; - MakePlayerBanned(&data, victim, good); - SendToAll(&data); + PlayerBannedAppend appender(good, victim); + ChannelNameBuilder<PlayerBannedAppend> builder(this, appender); + SendToAll(builder); } } else if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL)) { - WorldPacket data; - MakePlayerKicked(&data, victim, good); - SendToAll(&data); + PlayerKickedAppend appender(good, victim); + ChannelNameBuilder<PlayerKickedAppend> builder(this, appender); + SendToAll(builder); } _playersStore.erase(victim); @@ -373,18 +404,18 @@ void Channel::UnBan(Player const* player, std::string const& badname) if (!IsOn(good)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, good); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, good); return; } PlayerInfo& info = _playersStore.at(good); if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR)) { - WorldPacket data; - MakeNotModerator(&data); - SendToOne(&data, good); + NotModeratorAppend appender; + ChannelNameBuilder<NotModeratorAppend> builder(this, appender); + SendToOne(builder, good); return; } @@ -393,17 +424,17 @@ void Channel::UnBan(Player const* player, std::string const& badname) if (!victim || !IsBanned(victim)) { - WorldPacket data; - MakePlayerNotFound(&data, badname); - SendToOne(&data, good); + PlayerNotFoundAppend appender(badname); + ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender); + SendToOne(builder, good); return; } _bannedStore.erase(victim); - WorldPacket data; - MakePlayerUnbanned(&data, victim, good); - SendToAll(&data); + PlayerUnbannedAppend appender(good, victim); + ChannelNameBuilder<PlayerUnbannedAppend> builder(this, appender); + SendToAll(builder); UpdateChannelInDB(); } @@ -415,26 +446,26 @@ void Channel::Password(Player const* player, std::string const& pass) ChatHandler chat(player->GetSession()); if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } PlayerInfo& info = _playersStore.at(guid); if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR)) { - WorldPacket data; - MakeNotModerator(&data); - SendToOne(&data, guid); + NotModeratorAppend appender; + ChannelNameBuilder<NotModeratorAppend> builder(this, appender); + SendToOne(builder, guid); return; } _channelPassword = pass; - WorldPacket data; - MakePasswordChanged(&data, guid); - SendToAll(&data); + PasswordChangedAppend appender(guid); + ChannelNameBuilder<PasswordChangedAppend> builder(this, appender); + SendToAll(builder); UpdateChannelInDB(); } @@ -445,18 +476,18 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } PlayerInfo& info = _playersStore.at(guid); if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR)) { - WorldPacket data; - MakeNotModerator(&data); - SendToOne(&data, guid); + NotModeratorAppend appender; + ChannelNameBuilder<NotModeratorAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -471,17 +502,17 @@ void Channel::SetMode(Player const* player, std::string const& p2n, bool mod, bo (!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || !newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL)))) { - WorldPacket data; - MakePlayerNotFound(&data, p2n); - SendToOne(&data, guid); + PlayerNotFoundAppend appender(p2n); + ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender); + SendToOne(builder, guid); return; } if (_ownerGuid == victim && _ownerGuid != guid) { - WorldPacket data; - MakeNotOwner(&data); - SendToOne(&data, guid); + NotOwnerAppend appender; + ChannelNameBuilder<NotOwnerAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -504,23 +535,57 @@ void Channel::SetInvisible(Player const* player, bool on) _isOwnerInvisible = on; } +void Channel::SetModerator(ObjectGuid guid, bool set) +{ + if (!IsOn(guid)) + return; + + PlayerInfo& playerInfo = _playersStore.at(guid); + if (playerInfo.IsModerator() != set) + { + uint8 oldFlag = GetPlayerFlags(guid); + playerInfo.SetModerator(set); + + ModeChangeAppend appender(guid, oldFlag, GetPlayerFlags(guid)); + ChannelNameBuilder<ModeChangeAppend> builder(this, appender); + SendToAll(builder); + } +} + +void Channel::SetMute(ObjectGuid guid, bool set) +{ + if (!IsOn(guid)) + return; + + PlayerInfo& playerInfo = _playersStore.at(guid); + if (playerInfo.IsMuted() != set) + { + uint8 oldFlag = GetPlayerFlags(guid); + playerInfo.SetMuted(set); + + ModeChangeAppend appender(guid, oldFlag, GetPlayerFlags(guid)); + ChannelNameBuilder<ModeChangeAppend> builder(this, appender); + SendToAll(builder); + } +} + void Channel::SetOwner(Player const* player, std::string const& newname) { ObjectGuid guid = player->GetGUID(); if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && guid != _ownerGuid) { - WorldPacket data; - MakeNotOwner(&data); - SendToOne(&data, guid); + NotOwnerAppend appender; + ChannelNameBuilder<NotOwnerAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -532,9 +597,9 @@ void Channel::SetOwner(Player const* player, std::string const& newname) (!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || !newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL)))) { - WorldPacket data; - MakePlayerNotFound(&data, newname); - SendToOne(&data, guid); + PlayerNotFoundAppend appender(newname); + ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -545,12 +610,18 @@ void Channel::SetOwner(Player const* player, std::string const& newname) void Channel::SendWhoOwner(ObjectGuid guid) { - WorldPacket data; if (IsOn(guid)) - MakeChannelOwner(&data); + { + ChannelOwnerAppend appender(this, _ownerGuid); + ChannelNameBuilder<ChannelOwnerAppend> builder(this, appender); + SendToOne(builder, guid); + } else - MakeNotMember(&data); - SendToOne(&data, guid); + { + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); + } } void Channel::List(Player const* player) const @@ -559,18 +630,19 @@ void Channel::List(Player const* player) const if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } + std::string channelName = GetName(player->GetSession()->GetSessionDbcLocale()); TC_LOG_DEBUG("chat.system", "SMSG_CHANNEL_LIST %s Channel: %s", - player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str()); + player->GetSession()->GetPlayerInfo().c_str(), channelName.c_str()); - WorldPacket data(SMSG_CHANNEL_LIST, 1+(GetName().size()+1)+1+4+_playersStore.size()*(8+1)); + WorldPacket data(SMSG_CHANNEL_LIST, 1 + (channelName.size() + 1) + 1 + 4 + _playersStore.size() * (8 + 1)); data << uint8(1); // channel type? - data << GetName(); // channel name + data << channelName; // channel name data << uint8(GetFlags()); // channel flags? size_t pos = data.wpos(); @@ -597,8 +669,7 @@ void Channel::List(Player const* player) const } data.put<uint32>(pos, count); - - SendToOne(&data, guid); + player->SendDirectMessage(&data); } void Channel::Announce(Player const* player) @@ -607,29 +678,35 @@ void Channel::Announce(Player const* player) if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } PlayerInfo& info = _playersStore.at(guid); if (!info.IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR)) { - WorldPacket data; - MakeNotModerator(&data); - SendToOne(&data, guid); + NotModeratorAppend appender; + ChannelNameBuilder<NotModeratorAppend> builder(this, appender); + SendToOne(builder, guid); return; } _announceEnabled = !_announceEnabled; - WorldPacket data; if (_announceEnabled) - MakeAnnouncementsOn(&data, guid); + { + AnnouncementsOnAppend appender(guid); + ChannelNameBuilder<AnnouncementsOnAppend> builder(this, appender); + SendToAll(builder); + } else - MakeAnnouncementsOff(&data, guid); - SendToAll(&data); + { + AnnouncementsOffAppend appender(guid); + ChannelNameBuilder<AnnouncementsOffAppend> builder(this, appender); + SendToAll(builder); + } UpdateChannelInDB(); } @@ -645,28 +722,32 @@ void Channel::Say(ObjectGuid guid, std::string const& what, uint32 lang) const if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } PlayerInfo const& info = _playersStore.at(guid); if (info.IsMuted()) { - WorldPacket data; - MakeMuted(&data); - SendToOne(&data, guid); + MutedAppend appender; + ChannelNameBuilder<MutedAppend> builder(this, appender); + SendToOne(builder, guid); return; } - WorldPacket data; - if (Player* player = ObjectAccessor::FindConnectedPlayer(guid)) - ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _channelName); - else - ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, _channelName); + auto builder = [&](WorldPacket& data, LocaleConstant locale) + { + LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); + + if (Player* player = ObjectAccessor::FindConnectedPlayer(guid)) + ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, GetName(localeIdx)); + else + ChatHandler::BuildChatPacket(data, CHAT_MSG_CHANNEL, Language(lang), guid, guid, what, 0, "", "", 0, false, GetName(localeIdx)); + }; - SendToAll(&data, !info.IsModerator() ? guid : ObjectGuid::Empty); + SendToAll(builder, !info.IsModerator() ? guid : ObjectGuid::Empty); } void Channel::Invite(Player const* player, std::string const& newname) @@ -675,26 +756,26 @@ void Channel::Invite(Player const* player, std::string const& newname) if (!IsOn(guid)) { - WorldPacket data; - MakeNotMember(&data); - SendToOne(&data, guid); + NotMemberAppend appender; + ChannelNameBuilder<NotMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } Player* newp = ObjectAccessor::FindConnectedPlayerByName(newname); if (!newp || !newp->isGMVisible()) { - WorldPacket data; - MakePlayerNotFound(&data, newname); - SendToOne(&data, guid); + PlayerNotFoundAppend appender(newname); + ChannelNameBuilder<PlayerNotFoundAppend> builder(this, appender); + SendToOne(builder, guid); return; } if (IsBanned(newp->GetGUID())) { - WorldPacket data; - MakePlayerInviteBanned(&data, newname); - SendToOne(&data, guid); + PlayerInviteBannedAppend appender(newname); + ChannelNameBuilder<PlayerInviteBannedAppend> builder(this, appender); + SendToOne(builder, guid); return; } @@ -702,31 +783,30 @@ void Channel::Invite(Player const* player, std::string const& newname) (!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) || !newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL))) { - WorldPacket data; - MakeInviteWrongFaction(&data); - SendToOne(&data, guid); + InviteWrongFactionAppend appender; + ChannelNameBuilder<InviteWrongFactionAppend> builder(this, appender); + SendToOne(builder, guid); return; } if (IsOn(newp->GetGUID())) { - WorldPacket data; - MakePlayerAlreadyMember(&data, newp->GetGUID()); - SendToOne(&data, guid); + PlayerAlreadyMemberAppend appender(newp->GetGUID()); + ChannelNameBuilder<PlayerAlreadyMemberAppend> builder(this, appender); + SendToOne(builder, guid); return; } if (!newp->GetSocial()->HasIgnore(guid.GetCounter())) { - WorldPacket data; - MakeInvite(&data, guid); - SendToOne(&data, newp->GetGUID()); - data.clear(); + InviteAppend appender(guid); + ChannelNameBuilder<InviteAppend> builder(this, appender); + SendToOne(builder, newp->GetGUID()); } - WorldPacket data; - MakePlayerInvited(&data, newp->GetName()); - SendToOne(&data, guid); + PlayerInvitedAppend appender(newp->GetName()); + ChannelNameBuilder<PlayerInvitedAppend> builder(this, appender); + SendToOne(builder, guid); } void Channel::SetOwner(ObjectGuid guid, bool exclaim) @@ -749,42 +829,21 @@ void Channel::SetOwner(ObjectGuid guid, bool exclaim) itr->second.SetModerator(true); itr->second.SetOwner(true); - WorldPacket data; - MakeModeChange(&data, _ownerGuid, oldFlag); - SendToAll(&data); + ModeChangeAppend appender(_ownerGuid, oldFlag, GetPlayerFlags(_ownerGuid)); + ChannelNameBuilder<ModeChangeAppend> builder(this, appender); + SendToAll(builder); if (exclaim) { - MakeOwnerChanged(&data, _ownerGuid); - SendToAll(&data); + OwnerChangedAppend appender(_ownerGuid); + ChannelNameBuilder<OwnerChangedAppend> builder(this, appender); + SendToAll(builder); } UpdateChannelInDB(); } } -void Channel::SendToAll(WorldPacket* data, ObjectGuid guid) const -{ - for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i) - if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first)) - if (!guid || !player->GetSocial()->HasIgnore(guid.GetCounter())) - player->GetSession()->SendPacket(data); -} - -void Channel::SendToAllButOne(WorldPacket* data, ObjectGuid who) const -{ - for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i) - if (i->first != who) - if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first)) - player->GetSession()->SendPacket(data); -} - -void Channel::SendToOne(WorldPacket* data, ObjectGuid who) const -{ - if (Player* player = ObjectAccessor::FindConnectedPlayer(who)) - player->GetSession()->SendPacket(data); -} - void Channel::Voice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) const { @@ -795,245 +854,72 @@ void Channel::DeVoice(ObjectGuid /*guid1*/, ObjectGuid /*guid2*/) const } -void Channel::MakeNotifyPacket(WorldPacket* data, uint8 notify_type) const -{ - data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + _channelName.size()); - *data << uint8(notify_type); - *data << _channelName; -} - -void Channel::MakeJoined(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_JOINED_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeLeft(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_LEFT_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeYouJoined(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_YOU_JOINED_NOTICE); - *data << uint8(GetFlags()); - *data << uint32(GetChannelId()); - *data << uint32(0); -} - -void Channel::MakeYouLeft(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_YOU_LEFT_NOTICE); - *data << uint32(GetChannelId()); - *data << uint8(IsConstant()); -} - -void Channel::MakeWrongPassword(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_WRONG_PASSWORD_NOTICE); -} - -void Channel::MakeNotMember(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_NOT_MEMBER_NOTICE); -} - -void Channel::MakeNotModerator(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_NOT_MODERATOR_NOTICE); -} - -void Channel::MakePasswordChanged(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_PASSWORD_CHANGED_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeOwnerChanged(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_OWNER_CHANGED_NOTICE); - *data << uint64(guid); -} - -void Channel::MakePlayerNotFound(WorldPacket* data, std::string const& name) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_NOT_FOUND_NOTICE); - *data << name; -} - -void Channel::MakeNotOwner(WorldPacket* data) const +void Channel::JoinNotify(ObjectGuid guid) const { - MakeNotifyPacket(data, CHAT_NOT_OWNER_NOTICE); -} + auto builder = [&](WorldPacket& data, LocaleConstant locale) + { + LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); -void Channel::MakeChannelOwner(WorldPacket* data) const -{ - std::string name; + data.Initialize(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + 30 /*channelName buffer*/); + data << uint64(guid); + data << uint8(GetPlayerFlags(guid)); + data << uint8(GetFlags()); + data << uint32(GetNumPlayers()); + data << GetName(localeIdx); + }; - CharacterInfo const* cInfo = sWorld->GetCharacterInfo(_ownerGuid); - if (!cInfo || cInfo->Name.empty()) - name = "PLAYER_NOT_FOUND"; + if (IsConstant()) + SendToAllButOne(builder, guid); else - name = cInfo->Name; - - MakeNotifyPacket(data, CHAT_CHANNEL_OWNER_NOTICE); - *data << ((IsConstant() || !_ownerGuid) ? "Nobody" : name); -} - -void Channel::MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags) const -{ - MakeNotifyPacket(data, CHAT_MODE_CHANGE_NOTICE); - *data << uint64(guid); - *data << uint8(oldflags); - *data << uint8(GetPlayerFlags(guid)); -} - -void Channel::MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_ON_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_ANNOUNCEMENTS_OFF_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeMuted(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_MUTED_NOTICE); -} - -void Channel::MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_KICKED_NOTICE); - *data << uint64(bad); - *data << uint64(good); -} - -void Channel::MakeBanned(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_BANNED_NOTICE); -} - -void Channel::MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_BANNED_NOTICE); - *data << uint64(bad); - *data << uint64(good); -} - -void Channel::MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_UNBANNED_NOTICE); - *data << uint64(bad); - *data << uint64(good); -} - -void Channel::MakePlayerNotBanned(WorldPacket* data, const std::string &name) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_NOT_BANNED_NOTICE); - *data << name; + SendToAll(builder); } -void Channel::MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_ALREADY_MEMBER_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeInvite(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_INVITE_NOTICE); - *data << uint64(guid); -} - -void Channel::MakeInviteWrongFaction(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_INVITE_WRONG_FACTION_NOTICE); -} - -void Channel::MakeWrongFaction(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_WRONG_FACTION_NOTICE); -} - -void Channel::MakeInvalidName(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_INVALID_NAME_NOTICE); -} - -void Channel::MakeNotModerated(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_NOT_MODERATED_NOTICE); -} - -void Channel::MakePlayerInvited(WorldPacket* data, std::string const& name) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_INVITED_NOTICE); - *data << name; -} - -void Channel::MakePlayerInviteBanned(WorldPacket* data, std::string const& name) const -{ - MakeNotifyPacket(data, CHAT_PLAYER_INVITE_BANNED_NOTICE); - *data << name; -} - -void Channel::MakeThrottled(WorldPacket* data) const +void Channel::LeaveNotify(ObjectGuid guid) const { - MakeNotifyPacket(data, CHAT_THROTTLED_NOTICE); -} + auto builder = [&](WorldPacket& data, LocaleConstant locale) + { + LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); -void Channel::MakeNotInArea(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_NOT_IN_AREA_NOTICE); -} + data.Initialize(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + 30 /*channelName buffer*/); + data << uint64(guid); + data << uint8(GetFlags()); + data << uint32(GetNumPlayers()); + data << GetName(localeIdx); + }; -void Channel::MakeNotInLfg(WorldPacket* data) const -{ - MakeNotifyPacket(data, CHAT_NOT_IN_LFG_NOTICE); + if (IsConstant()) + SendToAllButOne(builder, guid); + else + SendToAll(builder); } -void Channel::MakeVoiceOn(WorldPacket* data, ObjectGuid guid) const +template<class Builder> +void Channel::SendToAll(Builder& builder, ObjectGuid guid /*= ObjectGuid::Empty*/) const { - MakeNotifyPacket(data, CHAT_VOICE_ON_NOTICE); - *data << uint64(guid); -} + Trinity::LocalizedPacketDo<Builder> localizer(builder); -void Channel::MakeVoiceOff(WorldPacket* data, ObjectGuid guid) const -{ - MakeNotifyPacket(data, CHAT_VOICE_OFF_NOTICE); - *data << uint64(guid); + for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i) + if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first)) + if (!guid || !player->GetSocial()->HasIgnore(guid.GetCounter())) + localizer(player); } -void Channel::JoinNotify(ObjectGuid guid) const +template<class Builder> +void Channel::SendToAllButOne(Builder& builder, ObjectGuid who) const { - WorldPacket data(IsConstant() ? SMSG_USERLIST_ADD : SMSG_USERLIST_UPDATE, 8 + 1 + 1 + 4 + GetName().size()); - data << uint64(guid); - data << uint8(GetPlayerFlags(guid)); - data << uint8(GetFlags()); - data << uint32(GetNumPlayers()); - data << GetName(); + Trinity::LocalizedPacketDo<Builder> localizer(builder); - if (IsConstant()) - SendToAllButOne(&data, guid); - else - SendToAll(&data); + for (PlayerContainer::const_iterator i = _playersStore.begin(); i != _playersStore.end(); ++i) + if (i->first != who) + if (Player* player = ObjectAccessor::FindConnectedPlayer(i->first)) + localizer(player); } -void Channel::LeaveNotify(ObjectGuid guid) const +template<class Builder> +void Channel::SendToOne(Builder& builder, ObjectGuid who) const { - WorldPacket data(SMSG_USERLIST_REMOVE, 8 + 1 + 4 + GetName().size()); - data << uint64(guid); - data << uint8(GetFlags()); - data << uint32(GetNumPlayers()); - data << GetName(); + Trinity::LocalizedPacketDo<Builder> localizer(builder); - if (IsConstant()) - SendToAllButOne(&data, guid); - else - SendToAll(&data); + if (Player* player = ObjectAccessor::FindConnectedPlayer(who)) + localizer(player); } diff --git a/src/server/game/Chat/Channels/Channel.h b/src/server/game/Chat/Channels/Channel.h index 4859a984967..8c01a474854 100644 --- a/src/server/game/Chat/Channels/Channel.h +++ b/src/server/game/Chat/Channels/Channel.h @@ -150,9 +150,11 @@ class TC_GAME_API Channel }; public: - Channel(std::string const& name, uint32 channel_id, uint32 team = 0); + Channel(uint32 channelId, uint32 team = 0, AreaTableEntry const* zoneEntry = nullptr); // built-in channel ctor + Channel(std::string const& name, uint32 team = 0); // custom player channel ctor - std::string const& GetName() const { return _channelName; } + static void GetChannelName(std::string& channelName, uint32 channelId, LocaleConstant locale, AreaTableEntry const* zoneEntry); + std::string GetName(LocaleConstant locale = DEFAULT_LOCALE) const; uint32 GetChannelId() const { return _channelId; } bool IsConstant() const { return _channelId != 0; } @@ -169,6 +171,8 @@ class TC_GAME_API Channel uint8 GetFlags() const { return _channelFlags; } bool HasFlag(uint8 flag) const { return (_channelFlags & flag) != 0; } + AreaTableEntry const* GetZoneEntry() const { return _zoneEntry; } + void JoinChannel(Player* player, std::string const& pass); void LeaveChannel(Player* player, bool send = true); @@ -203,47 +207,15 @@ class TC_GAME_API Channel static void CleanOldChannelsInDB(); private: - // initial packet data (notify type and channel name) - void MakeNotifyPacket(WorldPacket* data, uint8 notify_type) const; - // type specific packet data - void MakeJoined(WorldPacket* data, ObjectGuid guid) const; //+ 0x00 - void MakeLeft(WorldPacket* data, ObjectGuid guid) const; //+ 0x01 - void MakeYouJoined(WorldPacket* data) const; //+ 0x02 - void MakeYouLeft(WorldPacket* data) const; //+ 0x03 - void MakeWrongPassword(WorldPacket* data) const; //? 0x04 - void MakeNotMember(WorldPacket* data) const; //? 0x05 - void MakeNotModerator(WorldPacket* data) const; //? 0x06 - void MakePasswordChanged(WorldPacket* data, ObjectGuid guid) const; //+ 0x07 - void MakeOwnerChanged(WorldPacket* data, ObjectGuid guid) const; //? 0x08 - void MakePlayerNotFound(WorldPacket* data, std::string const& name) const; //+ 0x09 - void MakeNotOwner(WorldPacket* data) const; //? 0x0A - void MakeChannelOwner(WorldPacket* data) const; //? 0x0B - void MakeModeChange(WorldPacket* data, ObjectGuid guid, uint8 oldflags) const; //+ 0x0C - void MakeAnnouncementsOn(WorldPacket* data, ObjectGuid guid) const; //+ 0x0D - void MakeAnnouncementsOff(WorldPacket* data, ObjectGuid guid) const; //+ 0x0E - void MakeMuted(WorldPacket* data) const; //? 0x11 - void MakePlayerKicked(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const; //? 0x12 - void MakeBanned(WorldPacket* data) const; //? 0x13 - void MakePlayerBanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const; //? 0x14 - void MakePlayerUnbanned(WorldPacket* data, ObjectGuid bad, ObjectGuid good) const; //? 0x15 - void MakePlayerNotBanned(WorldPacket* data, std::string const& name) const; //? 0x16 - void MakePlayerAlreadyMember(WorldPacket* data, ObjectGuid guid) const; //+ 0x17 - void MakeInvite(WorldPacket* data, ObjectGuid guid) const; //? 0x18 - void MakeInviteWrongFaction(WorldPacket* data) const; //? 0x19 - void MakeWrongFaction(WorldPacket* data) const; //? 0x1A - void MakeInvalidName(WorldPacket* data) const; //? 0x1B - void MakeNotModerated(WorldPacket* data) const; //? 0x1C - void MakePlayerInvited(WorldPacket* data, std::string const& name) const; //+ 0x1D - void MakePlayerInviteBanned(WorldPacket* data, std::string const& name) const; //? 0x1E - void MakeThrottled(WorldPacket* data) const; //? 0x1F - void MakeNotInArea(WorldPacket* data) const; //? 0x20 - void MakeNotInLfg(WorldPacket* data) const; //? 0x21 - void MakeVoiceOn(WorldPacket* data, ObjectGuid guid) const; //+ 0x22 - void MakeVoiceOff(WorldPacket* data, ObjectGuid guid) const; //+ 0x23 - - void SendToAll(WorldPacket* data, ObjectGuid guid = ObjectGuid::Empty) const; - void SendToAllButOne(WorldPacket* data, ObjectGuid who) const; - void SendToOne(WorldPacket* data, ObjectGuid who) const; + + template<class Builder> + void SendToAll(Builder&, ObjectGuid guid = ObjectGuid::Empty) const; + + template<class Builder> + void SendToAllButOne(Builder& builder, ObjectGuid who) const; + + template<class Builder> + void SendToOne(Builder& builder, ObjectGuid who) const; bool IsOn(ObjectGuid who) const { return _playersStore.count(who) != 0; } bool IsBanned(ObjectGuid guid) const { return _bannedStore.count(guid) != 0; } @@ -257,39 +229,8 @@ class TC_GAME_API Channel return itr != _playersStore.end() ? itr->second.flags : 0; } - void SetModerator(ObjectGuid guid, bool set) - { - if (!IsOn(guid)) - return; - - PlayerInfo& playerInfo = _playersStore.at(guid); - if (playerInfo.IsModerator() != set) - { - uint8 oldFlag = GetPlayerFlags(guid); - playerInfo.SetModerator(set); - - WorldPacket data; - MakeModeChange(&data, guid, oldFlag); - SendToAll(&data); - } - } - - void SetMute(ObjectGuid guid, bool set) - { - if (!IsOn(guid)) - return; - - PlayerInfo& playerInfo = _playersStore.at(guid); - if (playerInfo.IsMuted() != set) - { - uint8 oldFlag = GetPlayerFlags(guid); - playerInfo.SetMuted(set); - - WorldPacket data; - MakeModeChange(&data, guid, oldFlag); - SendToAll(&data); - } - } + void SetModerator(ObjectGuid guid, bool set); + void SetMute(ObjectGuid guid, bool set); typedef std::map<ObjectGuid, PlayerInfo> PlayerContainer; typedef GuidUnorderedSet BannedContainer; @@ -307,6 +248,8 @@ class TC_GAME_API Channel std::string _channelPassword; PlayerContainer _playersStore; BannedContainer _bannedStore; + + AreaTableEntry const* _zoneEntry; }; #endif diff --git a/src/server/game/Chat/Channels/ChannelAppenders.h b/src/server/game/Chat/Channels/ChannelAppenders.h new file mode 100644 index 00000000000..3dfdc3f32cf --- /dev/null +++ b/src/server/game/Chat/Channels/ChannelAppenders.h @@ -0,0 +1,476 @@ +/* + * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> + * + * 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/>. + */ + +#ifndef _CHANNELAPPENDERS_H +#define _CHANNELAPPENDERS_H + +#include "Channel.h" + +// initial packet data (notify type and channel name) +template<class PacketModifier> +class ChannelNameBuilder +{ + public: + ChannelNameBuilder(Channel const* source, PacketModifier const& modifier) + : _source(source), _modifier(modifier){ } + + void operator()(WorldPacket& data, LocaleConstant locale) const + { + // LocalizedPacketDo sends client DBC locale, we need to get available to server locale + LocaleConstant localeIdx = sWorld->GetAvailableDbcLocale(locale); + + data.Initialize(SMSG_CHANNEL_NOTIFY, 60); // guess size + data << uint8(_modifier.NotificationType); + data << _source->GetName(localeIdx); + _modifier.Append(data); + } + + private: + Channel const* _source; + PacketModifier _modifier; +}; + +struct JoinedAppend +{ + explicit JoinedAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_JOINED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct LeftAppend +{ + explicit LeftAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_LEFT_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct YouJoinedAppend +{ + explicit YouJoinedAppend(Channel const* channel) : _channel(channel) { } + + static uint8 const NotificationType = CHAT_YOU_JOINED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint8(_channel->GetFlags()); + data << uint32(_channel->GetChannelId()); + data << uint32(0); + } + +private: + Channel const* _channel; +}; + +struct YouLeftAppend +{ + explicit YouLeftAppend(Channel const* channel) : _channel(channel) { } + + static uint8 const NotificationType = CHAT_YOU_LEFT_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint32(_channel->GetChannelId()); + data << uint8(_channel->IsConstant()); + } + +private: + Channel const* _channel; +}; + +struct WrongPasswordAppend +{ + static uint8 const NotificationType = CHAT_WRONG_PASSWORD_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct NotMemberAppend +{ + static uint8 const NotificationType = CHAT_NOT_MEMBER_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct NotModeratorAppend +{ + static uint8 const NotificationType = CHAT_NOT_MODERATOR_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct PasswordChangedAppend +{ + explicit PasswordChangedAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_PASSWORD_CHANGED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct OwnerChangedAppend +{ + explicit OwnerChangedAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_OWNER_CHANGED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct PlayerNotFoundAppend +{ + explicit PlayerNotFoundAppend(std::string const& playerName) : _playerName(playerName) { } + + static uint8 const NotificationType = CHAT_PLAYER_NOT_FOUND_NOTICE; + + void Append(WorldPacket& data) const + { + data << _playerName; + } + +private: + std::string _playerName; +}; + +struct NotOwnerAppend +{ + static uint8 const NotificationType = CHAT_NOT_OWNER_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct ChannelOwnerAppend +{ + explicit ChannelOwnerAppend(Channel const* channel, ObjectGuid const& ownerGuid) : _channel(channel), _ownerGuid(ownerGuid) + { + CharacterInfo const* cInfo = sWorld->GetCharacterInfo(_ownerGuid); + if (!cInfo || cInfo->Name.empty()) + _ownerName = "PLAYER_NOT_FOUND"; + else + _ownerName = cInfo->Name; + } + + static uint8 const NotificationType = CHAT_CHANNEL_OWNER_NOTICE; + + void Append(WorldPacket& data) const + { + data << ((_channel->IsConstant() || !_ownerGuid) ? "Nobody" : _ownerName); + } + +private: + Channel const* _channel; + ObjectGuid _ownerGuid; + + std::string _ownerName; +}; + +struct ModeChangeAppend +{ + explicit ModeChangeAppend(ObjectGuid const& guid, uint8 oldFlags, uint8 newFlags) : _guid(guid), _oldFlags(oldFlags), _newFlags(newFlags) { } + + static uint8 const NotificationType = CHAT_MODE_CHANGE_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + data << uint8(_oldFlags); + data << uint8(_newFlags); + } + +private: + ObjectGuid _guid; + uint8 _oldFlags; + uint8 _newFlags; +}; + +struct AnnouncementsOnAppend +{ + explicit AnnouncementsOnAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_ANNOUNCEMENTS_ON_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct AnnouncementsOffAppend +{ + explicit AnnouncementsOffAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_ANNOUNCEMENTS_OFF_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct MutedAppend +{ + static uint8 const NotificationType = CHAT_MUTED_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct PlayerKickedAppend +{ + explicit PlayerKickedAppend(ObjectGuid const& kicker, ObjectGuid const& kickee) : _kicker(kicker), _kickee(kickee) { } + + static uint8 const NotificationType = CHAT_PLAYER_KICKED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_kickee); + data << uint64(_kicker); + } + +private: + ObjectGuid _kicker; + ObjectGuid _kickee; +}; + +struct BannedAppend +{ + static uint8 const NotificationType = CHAT_BANNED_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct PlayerBannedAppend +{ + explicit PlayerBannedAppend(ObjectGuid const& moderator, ObjectGuid const& banned) : _moderator(moderator), _banned(banned) { } + + static uint8 const NotificationType = CHAT_PLAYER_BANNED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_banned); + data << uint64(_moderator); + } + +private: + ObjectGuid _moderator; + ObjectGuid _banned; +}; + +struct PlayerUnbannedAppend +{ + explicit PlayerUnbannedAppend(ObjectGuid const& moderator, ObjectGuid const& unbanned) : _moderator(moderator), _unbanned(unbanned) { } + + static uint8 const NotificationType = CHAT_PLAYER_UNBANNED_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_unbanned); + data << uint64(_moderator); + } + +private: + ObjectGuid _moderator; + ObjectGuid _unbanned; +}; + +struct PlayerNotBannedAppend +{ + explicit PlayerNotBannedAppend(std::string const& playerName) : _playerName(playerName) { } + + static uint8 const NotificationType = CHAT_PLAYER_NOT_BANNED_NOTICE; + + void Append(WorldPacket& data) const + { + data << _playerName; + } + +private: + std::string _playerName; +}; + +struct PlayerAlreadyMemberAppend +{ + explicit PlayerAlreadyMemberAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_PLAYER_ALREADY_MEMBER_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct InviteAppend +{ + explicit InviteAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_INVITE_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct InviteWrongFactionAppend +{ + static uint8 const NotificationType = CHAT_INVITE_WRONG_FACTION_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct WrongFactionAppend +{ + static uint8 const NotificationType = CHAT_WRONG_FACTION_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct InvalidNameAppend +{ + static uint8 const NotificationType = CHAT_INVALID_NAME_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct NotModeratedAppend +{ + static uint8 const NotificationType = CHAT_NOT_MODERATED_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct PlayerInvitedAppend +{ + explicit PlayerInvitedAppend(std::string const& playerName) : _playerName(playerName) { } + + static uint8 const NotificationType = CHAT_PLAYER_INVITED_NOTICE; + + void Append(WorldPacket& data) const + { + data << _playerName; + } + +private: + std::string _playerName; +}; + +struct PlayerInviteBannedAppend +{ + explicit PlayerInviteBannedAppend(std::string const& playerName) : _playerName(playerName) { } + + static uint8 const NotificationType = CHAT_PLAYER_INVITE_BANNED_NOTICE; + + void Append(WorldPacket& data) const + { + data << _playerName; + } + +private: + std::string _playerName; +}; + +struct ThrottledAppend +{ + static uint8 const NotificationType = CHAT_THROTTLED_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct NotInAreaAppend +{ + static uint8 const NotificationType = CHAT_NOT_IN_AREA_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct NotInLFGAppend +{ + static uint8 const NotificationType = CHAT_NOT_IN_LFG_NOTICE; + + void Append(WorldPacket& /*data*/) const { } +}; + +struct VoiceOnAppend +{ + explicit VoiceOnAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_VOICE_ON_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +struct VoiceOffAppend +{ + explicit VoiceOffAppend(ObjectGuid const& guid) : _guid(guid) { } + + static uint8 const NotificationType = CHAT_VOICE_OFF_NOTICE; + + void Append(WorldPacket& data) const + { + data << uint64(_guid); + } + +private: + ObjectGuid _guid; +}; + +#endif // _CHANNELAPPENDERS_H diff --git a/src/server/game/Chat/Channels/ChannelMgr.cpp b/src/server/game/Chat/Channels/ChannelMgr.cpp index 043d4bdc2bc..ee1f463aae2 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.cpp +++ b/src/server/game/Chat/Channels/ChannelMgr.cpp @@ -16,20 +16,25 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ +#include "Channel.h" #include "ChannelMgr.h" #include "Player.h" #include "World.h" ChannelMgr::~ChannelMgr() { - for (ChannelMap::iterator itr = channels.begin(); itr != channels.end(); ++itr) + for (auto itr = _channels.begin(); itr != _channels.end(); ++itr) + delete itr->second; + + for (auto itr = _customChannels.begin(); itr != _customChannels.end(); ++itr) delete itr->second; } ChannelMgr* ChannelMgr::forTeam(uint32 team) { - static ChannelMgr allianceChannelMgr; - static ChannelMgr hordeChannelMgr; + static ChannelMgr allianceChannelMgr(ALLIANCE); + static ChannelMgr hordeChannelMgr(HORDE); + if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL)) return &allianceChannelMgr; // cross-faction @@ -42,69 +47,148 @@ ChannelMgr* ChannelMgr::forTeam(uint32 team) return nullptr; } -Channel* ChannelMgr::GetJoinChannel(std::string const& name, uint32 channelId) +Channel* ChannelMgr::GetChannelForPlayerByNamePart(std::string const& namePart, Player* playerSearcher) { - std::wstring wname; - if (!Utf8toWStr(name, wname)) + std::wstring channelNamePart; + if (!Utf8toWStr(namePart, channelNamePart)) return nullptr; - wstrToLower(wname); + wstrToLower(channelNamePart); + for (Channel* channel : playerSearcher->GetJoinedChannels()) + { + std::string chanName = channel->GetName(playerSearcher->GetSession()->GetSessionDbcLocale()); - ChannelMap::const_iterator i = channels.find(wname); + std::wstring channelNameW; + if (!Utf8toWStr(chanName, channelNameW)) + continue; - if (i == channels.end()) - { - Channel* nchan = new Channel(name, channelId, team); - channels[wname] = nchan; - return nchan; + wstrToLower(channelNameW); + if (!channelNameW.compare(0, channelNamePart.size(), channelNamePart)) + return channel; } - return i->second; + return nullptr; } -Channel* ChannelMgr::GetChannel(std::string const& name, Player* player, bool pkt) +Channel* ChannelMgr::GetJoinChannel(uint32 channelId, std::string const& name, AreaTableEntry const* zoneEntry /*= nullptr*/) { - std::wstring wname; - if (!Utf8toWStr(name, wname)) - return nullptr; + if (channelId) // builtin + { + ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); + uint32 zoneId = zoneEntry ? zoneEntry->ID : 0; + if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) + zoneId = 0; - wstrToLower(wname); + std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId); - ChannelMap::const_iterator i = channels.find(wname); + auto itr = _channels.find(key); + if (itr != _channels.end()) + return itr->second; - if (i == channels.end()) + Channel* newChannel = new Channel(channelId, _team, zoneEntry); + _channels[key] = newChannel; + return newChannel; + } + else // custom { - if (pkt) - { - WorldPacket data; - MakeNotOnPacket(&data, name); - player->GetSession()->SendPacket(&data); - } + std::wstring channelName; + if (!Utf8toWStr(name, channelName)) + return nullptr; + + wstrToLower(channelName); + auto itr = _customChannels.find(channelName); + if (itr != _customChannels.end()) + return itr->second; + + Channel* newChannel = new Channel(name, _team); + _customChannels[channelName] = newChannel; + return newChannel; + } +} - return nullptr; +Channel* ChannelMgr::GetChannel(uint32 channelId, std::string const& name, Player* player, bool pkt /*= true*/, AreaTableEntry const* zoneEntry /*= nullptr*/) const +{ + Channel* ret = nullptr; + bool send = false; + + if (channelId) // builtin + { + ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); + uint32 zoneId = zoneEntry ? zoneEntry->ID : 0; + if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) + zoneId = 0; + + std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId); + + auto itr = _channels.find(key); + if (itr != _channels.end()) + ret = itr->second; + else + send = true; } + else // custom + { + std::wstring channelName; + if (!Utf8toWStr(name, channelName)) + return nullptr; + + wstrToLower(channelName); + auto itr = _customChannels.find(channelName); + if (itr != _customChannels.end()) + ret = itr->second; + else + send = true; + } + + if (send && pkt) + { + std::string channelName = name; + Channel::GetChannelName(channelName, channelId, player->GetSession()->GetSessionDbcLocale(), zoneEntry); - return i->second; + WorldPacket data; + ChannelMgr::MakeNotOnPacket(&data, channelName); + player->SendDirectMessage(&data); + } + + return ret; } void ChannelMgr::LeftChannel(std::string const& name) { - std::wstring wname; - if (!Utf8toWStr(name, wname)) + std::wstring channelName; + if (!Utf8toWStr(name, channelName)) return; - wstrToLower(wname); + wstrToLower(channelName); + auto itr = _customChannels.find(channelName); + if (itr == _customChannels.end()) + return; - ChannelMap::const_iterator i = channels.find(wname); + Channel* channel = itr->second; + if (!channel->GetNumPlayers()) + { + _customChannels.erase(itr); + delete channel; + } +} - if (i == channels.end()) - return; +void ChannelMgr::LeftChannel(uint32 channelId, AreaTableEntry const* zoneEntry) +{ + ChatChannelsEntry const* channelEntry = sChatChannelsStore.AssertEntry(channelId); + uint32 zoneId = zoneEntry ? zoneEntry->ID : 0; + if (channelEntry->flags & (CHANNEL_DBC_FLAG_GLOBAL | CHANNEL_DBC_FLAG_CITY_ONLY)) + zoneId = 0; + + std::pair<uint32, uint32> key = std::make_pair(channelId, zoneId); - Channel* channel = i->second; + auto itr = _channels.find(key); + if (itr == _channels.end()) + return; - if (!channel->GetNumPlayers() && !channel->IsConstant()) + Channel* channel = itr->second; + if (!channel->GetNumPlayers()) { - channels.erase(wname); + _channels.erase(itr); delete channel; } } @@ -112,5 +196,5 @@ void ChannelMgr::LeftChannel(std::string const& name) void ChannelMgr::MakeNotOnPacket(WorldPacket* data, std::string const& name) { data->Initialize(SMSG_CHANNEL_NOTIFY, 1 + name.size()); - (*data) << uint8(5) << name; + (*data) << uint8(CHAT_NOT_MEMBER_NOTICE) << name; } diff --git a/src/server/game/Chat/Channels/ChannelMgr.h b/src/server/game/Chat/Channels/ChannelMgr.h index abe45690997..5f6fa55516a 100644 --- a/src/server/game/Chat/Channels/ChannelMgr.h +++ b/src/server/game/Chat/Channels/ChannelMgr.h @@ -19,36 +19,33 @@ #define __TRINITY_CHANNELMGR_H #include "Common.h" -#include "Channel.h" -#include <map> -#include <string> - -#include "World.h" - -#define MAX_CHANNEL_PASS_STR 31 +class Channel; class TC_GAME_API ChannelMgr { - typedef std::map<std::wstring, Channel*> ChannelMap; + typedef std::unordered_map<std::wstring, Channel*> CustomChannelContainer; // custom channels only differ in name + typedef std::unordered_map<std::pair<uint32 /*channelId*/, uint32 /*zoneId*/>, Channel*> BuiltinChannelContainer; //identify builtin (DBC) channels by zoneId instead, since name changes by client locale protected: - ChannelMgr() : team(0) { } + explicit ChannelMgr(uint32 team) : _team(team) { } ~ChannelMgr(); public: static ChannelMgr* forTeam(uint32 team); - void setTeam(uint32 newTeam) { team = newTeam; } + static Channel* GetChannelForPlayerByNamePart(std::string const& namePart, Player* playerSearcher); - Channel* GetJoinChannel(std::string const& name, uint32 channel_id); - Channel* GetChannel(std::string const& name, Player* p, bool pkt = true); + Channel* GetJoinChannel(uint32 channelId, std::string const& name, AreaTableEntry const* zoneEntry = nullptr); + Channel* GetChannel(uint32 channelId, std::string const& name, Player* player, bool pkt = true, AreaTableEntry const* zoneEntry = nullptr) const; void LeftChannel(std::string const& name); + void LeftChannel(uint32 channelId, AreaTableEntry const* zoneEntry); private: - ChannelMap channels; - uint32 team; + CustomChannelContainer _customChannels; + BuiltinChannelContainer _channels; + uint32 const _team; - void MakeNotOnPacket(WorldPacket* data, std::string const& name); + static void MakeNotOnPacket(WorldPacket* data, std::string const& name); }; #endif diff --git a/src/server/game/Combat/HostileRefManager.cpp b/src/server/game/Combat/HostileRefManager.cpp index 397fd59b7d1..965b910c3f4 100644 --- a/src/server/game/Combat/HostileRefManager.cpp +++ b/src/server/game/Combat/HostileRefManager.cpp @@ -28,8 +28,8 @@ HostileRefManager::~HostileRefManager() } //================================================= -// send threat to all my hateres for the victim -// The victim is hated than by them as well +// send threat to all my haters for the victim +// The victim is then hated by them as well // use for buffs and healing threat functionality void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell) @@ -37,9 +37,10 @@ void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo c if (getSize() == 0) return; - HostileReference* ref = getFirst(); float threat = ThreatCalcHelper::calcThreat(victim, iOwner, baseThreat, (threatSpell ? threatSpell->GetSchoolMask() : SPELL_SCHOOL_MASK_NORMAL), threatSpell); threat /= getSize(); + + HostileReference* ref = getFirst(); while (ref) { if (ThreatCalcHelper::isValidProcess(victim, ref->GetSource()->GetOwner(), threatSpell)) @@ -54,7 +55,6 @@ void HostileRefManager::threatAssist(Unit* victim, float baseThreat, SpellInfo c void HostileRefManager::addTempThreat(float threat, bool apply) { HostileReference* ref = getFirst(); - while (ref) { if (apply) diff --git a/src/server/game/Combat/HostileRefManager.h b/src/server/game/Combat/HostileRefManager.h index 855f9e3d272..859bee3caf7 100644 --- a/src/server/game/Combat/HostileRefManager.h +++ b/src/server/game/Combat/HostileRefManager.h @@ -31,18 +31,16 @@ class SpellInfo; class TC_GAME_API HostileRefManager : public RefManager<Unit, ThreatManager> { - private: - Unit* iOwner; public: - explicit HostileRefManager(Unit* owner) { iOwner = owner; } + explicit HostileRefManager(Unit* owner) : iOwner(owner) { } ~HostileRefManager(); - Unit* GetOwner() { return iOwner; } + Unit* GetOwner() const { return iOwner; } // send threat to all my hateres for the victim // The victim is hated than by them as well // use for buffs and healing threat functionality - void threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell = NULL); + void threatAssist(Unit* victim, float baseThreat, SpellInfo const* threatSpell = nullptr); void addTempThreat(float threat, bool apply); @@ -68,6 +66,9 @@ class TC_GAME_API HostileRefManager : public RefManager<Unit, ThreatManager> void deleteReference(Unit* creature); void UpdateVisibility(); + + private: + Unit* iOwner; }; //================================================= #endif diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index e04e1485d64..fec4ec300cc 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -30,7 +30,7 @@ //============================================================== // The hatingUnit is not used yet -float ThreatCalcHelper::calcThreat(Unit* hatedUnit, Unit* /*hatingUnit*/, float threat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell) +float ThreatCalcHelper::calcThreat(Unit* hatedUnit, Unit* /*hatingUnit*/, float threat, SpellSchoolMask schoolMask, SpellInfo const* threatSpell /*= nullptr*/) { if (threatSpell) { @@ -39,7 +39,7 @@ float ThreatCalcHelper::calcThreat(Unit* hatedUnit, Unit* /*hatingUnit*/, float threat *= threatEntry->pctMod; // Energize is not affected by Mods - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; i++) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (threatSpell->Effects[i].Effect == SPELL_EFFECT_ENERGIZE || threatSpell->Effects[i].ApplyAuraName == SPELL_AURA_PERIODIC_ENERGIZE) return threat; @@ -50,7 +50,7 @@ float ThreatCalcHelper::calcThreat(Unit* hatedUnit, Unit* /*hatingUnit*/, float return hatedUnit->ApplyTotalThreatModifier(threat, schoolMask); } -bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell) +bool ThreatCalcHelper::isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell /*= nullptr*/) { //function deals with adding threat and adding players and pets into ThreatList //mobs, NPCs, guards have ThreatList and HateOfflineList @@ -134,18 +134,20 @@ void HostileReference::fireStatusChanged(ThreatRefStatusChangeEvent& threatRefSt void HostileReference::addThreat(float modThreat) { + if (!modThreat) + return; + iThreat += modThreat; + // the threat is changed. Source and target unit have to be available // if the link was cut before relink it again if (!isOnline()) updateOnlineStatus(); - if (modThreat != 0.0f) - { - ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, modThreat); - fireStatusChanged(event); - } - if (isValid() && modThreat >= 0.0f) + ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, modThreat); + fireStatusChanged(event); + + if (isValid() && modThreat > 0.0f) { Unit* victimOwner = getTarget()->GetCharmerOrOwner(); if (victimOwner && victimOwner->IsAlive()) @@ -155,9 +157,7 @@ void HostileReference::addThreat(float modThreat) void HostileReference::addThreatPercent(int32 percent) { - float tmpThreat = iThreat; - AddPct(tmpThreat, percent); - addThreat(tmpThreat - iThreat); + addThreat(CalculatePct(iThreat, percent)); } //============================================================ @@ -193,6 +193,7 @@ void HostileReference::updateOnlineStatus() else accessible = true; } + setAccessibleState(accessible); setOnlineOfflineState(online); } @@ -221,7 +222,7 @@ void HostileReference::setAccessibleState(bool isAccessible) { iAccessible = isAccessible; - ThreatRefStatusChangeEvent event(UEV_THREAT_REF_ASSECCIBLE_STATUS, this); + ThreatRefStatusChangeEvent event(UEV_THREAT_REF_ACCESSIBLE_STATUS, this); fireStatusChanged(event); } } diff --git a/src/server/game/Combat/ThreatManager.h b/src/server/game/Combat/ThreatManager.h index a68d803304d..cad62659317 100644 --- a/src/server/game/Combat/ThreatManager.h +++ b/src/server/game/Combat/ThreatManager.h @@ -41,8 +41,8 @@ class SpellInfo; struct TC_GAME_API ThreatCalcHelper { - static float calcThreat(Unit* hatedUnit, Unit* hatingUnit, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = NULL); - static bool isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell = NULL); + static float calcThreat(Unit* hatedUnit, Unit* hatingUnit, float threat, SpellSchoolMask schoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* threatSpell = nullptr); + static bool isValidProcess(Unit* hatedUnit, Unit* hatingUnit, SpellInfo const* threatSpell = nullptr); }; //============================================================== @@ -54,11 +54,11 @@ class TC_GAME_API HostileReference : public Reference<Unit, ThreatManager> //================================================= void addThreat(float modThreat); - void setThreat(float threat) { addThreat(threat - getThreat()); } + void setThreat(float threat) { addThreat(threat - iThreat); } void addThreatPercent(int32 percent); - float getThreat() const { return iThreat; } + float getThreat() const { return iThreat + iTempThreatModifier; } bool isOnline() const { return iOnline; } @@ -66,27 +66,27 @@ class TC_GAME_API HostileReference : public Reference<Unit, ThreatManager> // in this case online = true, but accessible = false bool isAccessible() const { return iAccessible; } - // used for temporary setting a threat and reducting it later again. + // used for temporary setting a threat and reducing it later again. // the threat modification is stored void setTempThreat(float threat) { - addTempThreat(threat - getThreat()); + addTempThreat(threat - iTempThreatModifier); } void addTempThreat(float threat) { - iTempThreatModifier = threat; - if (iTempThreatModifier != 0.0f) - addThreat(iTempThreatModifier); + if (!threat) + return; + + iTempThreatModifier += threat; + + ThreatRefStatusChangeEvent event(UEV_THREAT_REF_THREAT_CHANGE, this, threat); + fireStatusChanged(event); } void resetTempThreat() { - if (iTempThreatModifier != 0.0f) - { - addThreat(-iTempThreatModifier); - iTempThreatModifier = 0.0f; - } + addTempThreat(-iTempThreatModifier); } float getTempThreatModifier() { return iTempThreatModifier; } @@ -100,7 +100,7 @@ class TC_GAME_API HostileReference : public Reference<Unit, ThreatManager> void setAccessibleState(bool isAccessible); //================================================= - bool operator == (const HostileReference& hostileRef) const { return hostileRef.getUnitGuid() == getUnitGuid(); } + bool operator==(HostileReference const& hostileRef) const { return hostileRef.getUnitGuid() == getUnitGuid(); } //================================================= @@ -113,7 +113,7 @@ class TC_GAME_API HostileReference : public Reference<Unit, ThreatManager> //================================================= - HostileReference* next() { return ((HostileReference*) Reference<Unit, ThreatManager>::next()); } + HostileReference* next() { return static_cast<HostileReference*>(Reference<Unit, ThreatManager>::next()); } //================================================= @@ -125,14 +125,17 @@ class TC_GAME_API HostileReference : public Reference<Unit, ThreatManager> // Tell our refFrom (source) object, that the link is cut (Target destroyed) void sourceObjectDestroyLink() override; + private: // Inform the source, that the status of that reference was changed void fireStatusChanged(ThreatRefStatusChangeEvent& threatRefStatusChangeEvent); Unit* GetSourceUnit(); + private: float iThreat; - float iTempThreatModifier; // used for taunt + float iTempThreatModifier; // used for SPELL_AURA_MOD_TOTAL_THREAT + ObjectGuid iUnitGuid; bool iOnline; bool iAccessible; diff --git a/src/server/game/Combat/UnitEvents.h b/src/server/game/Combat/UnitEvents.h index f50edcf3c7d..ee1a960c524 100644 --- a/src/server/game/Combat/UnitEvents.h +++ b/src/server/game/Combat/UnitEvents.h @@ -40,7 +40,7 @@ enum UNIT_EVENT_TYPE UEV_THREAT_REF_REMOVE_FROM_LIST = 1<<2, // Player/Pet entered/left water or some other place where it is/was not accessible for the creature - UEV_THREAT_REF_ASSECCIBLE_STATUS = 1<<3, + UEV_THREAT_REF_ACCESSIBLE_STATUS = 1<<3, // Threat list is going to be sorted (if dirty flag is set) UEV_THREAT_SORT_LIST = 1<<4, @@ -58,7 +58,7 @@ enum UNIT_EVENT_TYPE //UEV_UNIT_HEALTH_CHANGE = 1<<8, }; -#define UEV_THREAT_REF_EVENT_MASK (UEV_THREAT_REF_ONLINE_STATUS | UEV_THREAT_REF_THREAT_CHANGE | UEV_THREAT_REF_REMOVE_FROM_LIST | UEV_THREAT_REF_ASSECCIBLE_STATUS) +#define UEV_THREAT_REF_EVENT_MASK (UEV_THREAT_REF_ONLINE_STATUS | UEV_THREAT_REF_THREAT_CHANGE | UEV_THREAT_REF_REMOVE_FROM_LIST | UEV_THREAT_REF_ACCESSIBLE_STATUS) #define UEV_THREAT_MANAGER_EVENT_MASK (UEV_THREAT_SORT_LIST | UEV_THREAT_SET_NEXT_TARGET | UEV_THREAT_VICTIM_CHANGED) #define UEV_ALL_EVENT_MASK (0xffffffff) @@ -69,14 +69,16 @@ enum UNIT_EVENT_TYPE class UnitBaseEvent { - private: - uint32 iType; public: - UnitBaseEvent(uint32 pType) { iType = pType; } + explicit UnitBaseEvent(uint32 pType) { iType = pType; } uint32 getType() const { return iType; } bool matchesTypeMask(uint32 pMask) const { return (iType & pMask) != 0; } - void setType(uint32 pType) { iType = pType; } + private: + uint32 iType; + + protected: + ~UnitBaseEvent() { } }; //============================================================== @@ -92,14 +94,15 @@ class TC_GAME_API ThreatRefStatusChangeEvent : public UnitBaseEvent bool iBValue; }; ThreatManager* iThreatManager; + public: - ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = NULL; } + explicit ThreatRefStatusChangeEvent(uint32 pType) : UnitBaseEvent(pType), iHostileReference(nullptr), iThreatManager(nullptr) { } - ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; } + ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference) : UnitBaseEvent(pType), iHostileReference(pHostileReference), iThreatManager(nullptr) { } - ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iFValue = pValue; } + ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, float pValue) : UnitBaseEvent(pType), iHostileReference(pHostileReference), iFValue(pValue), iThreatManager(nullptr) { } - ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iThreatManager(NULL) { iHostileReference = pHostileReference; iBValue = pValue; } + ThreatRefStatusChangeEvent(uint32 pType, HostileReference* pHostileReference, bool pValue) : UnitBaseEvent(pType), iHostileReference(pHostileReference), iBValue(pValue), iThreatManager(nullptr) { } int32 getIValue() const { return iIValue; } @@ -116,20 +119,4 @@ class TC_GAME_API ThreatRefStatusChangeEvent : public UnitBaseEvent ThreatManager* getThreatManager() const { return iThreatManager; } }; -//============================================================== - -class ThreatManagerEvent : public ThreatRefStatusChangeEvent -{ - private: - ThreatContainer* iThreatContainer; - public: - ThreatManagerEvent(uint32 pType) : ThreatRefStatusChangeEvent(pType), iThreatContainer(NULL) { } - ThreatManagerEvent(uint32 pType, HostileReference* pHostileReference) : ThreatRefStatusChangeEvent(pType, pHostileReference), iThreatContainer(NULL) { } - - void setThreatContainer(ThreatContainer* pThreatContainer) { iThreatContainer = pThreatContainer; } - - ThreatContainer* getThreatContainer() const { return iThreatContainer; } -}; - -//============================================================== #endif 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/DBCEnums.h b/src/server/game/DataStores/DBCEnums.h index cb2f26e567f..99d7b49f82f 100644 --- a/src/server/game/DataStores/DBCEnums.h +++ b/src/server/game/DataStores/DBCEnums.h @@ -312,6 +312,7 @@ enum SpawnMask enum FactionTemplateFlags { + FACTION_TEMPLATE_ENEMY_SPAR = 0x00000020, // guessed, sparring with enemies? FACTION_TEMPLATE_FLAG_PVP = 0x00000800, // flagged for PvP FACTION_TEMPLATE_FLAG_CONTESTED_GUARD = 0x00001000, // faction will attack players that were involved in PvP combats FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT= 0x00002000 diff --git a/src/server/game/DataStores/DBCStructure.h b/src/server/game/DataStores/DBCStructure.h index c85344b9bd1..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 @@ -673,6 +684,7 @@ struct FactionTemplateEntry return hostileMask == 0 && friendlyMask == 0; } bool IsContestedGuardFaction() const { return (factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD) != 0; } + bool ShouldSparAttack() const { return (factionFlags & FACTION_TEMPLATE_ENEMY_SPAR) != 0; } }; struct GameObjectDisplayInfoEntry diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index fa603b9509e..9df9d2ad53c 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1450,23 +1450,21 @@ void Creature::LoadEquipment(int8 id, bool force /*= true*/) void Creature::SetSpawnHealth() { + if (!m_creatureData) + return; + uint32 curhealth; if (!m_regenHealth) { - if (m_creatureData) + curhealth = m_creatureData->curhealth; + if (curhealth) { - curhealth = m_creatureData->curhealth; - if (curhealth) - { - curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank)); - if (curhealth < 1) - curhealth = 1; - } - SetPower(POWER_MANA, m_creatureData->curmana); + curhealth = uint32(curhealth*_GetHealthMod(GetCreatureTemplate()->rank)); + if (curhealth < 1) + curhealth = 1; } - else - curhealth = GetHealth(); + SetPower(POWER_MANA, m_creatureData->curmana); } else { @@ -1663,6 +1661,7 @@ void Creature::setDeathState(DeathState s) SaveRespawnTime(); ReleaseFocus(nullptr, false); // remove spellcast focus + DoNotReacquireTarget(); // cancel delayed re-target SetTarget(ObjectGuid::Empty); // drop target - dead mobs shouldn't ever target things SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); @@ -1696,6 +1695,7 @@ void Creature::setDeathState(DeathState s) SetLootRecipient(nullptr); ResetPlayerDamageReq(); + SetCannotReachTarget(false); UpdateMovementFlags(); ClearUnitState(uint32(UNIT_STATE_ALL_STATE & ~UNIT_STATE_IGNORE_PATHFINDING)); @@ -1767,6 +1767,8 @@ void Creature::Respawn(bool force) } GetMotionMaster()->InitDefault(); + //Re-initialize reactstate that could be altered by movementgenerators + InitializeReactState(); //Call AI respawn virtual function if (IsAIEnabled) @@ -1779,9 +1781,6 @@ void Creature::Respawn(bool force) uint32 poolid = GetSpawnId() ? sPoolMgr->IsPartOfAPool<Creature>(GetSpawnId()) : 0; if (poolid) sPoolMgr->UpdatePool<Creature>(poolid, GetSpawnId()); - - //Re-initialize reactstate that could be altered by movementgenerators - InitializeReactState(); } UpdateObjectVisibility(); diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index bb85fa9fc5b..d79e55b623e 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -339,7 +339,7 @@ struct VendorItem uint32 ExtendedCost; //helpers - bool IsGoldRequired(ItemTemplate const* pProto) const { return pProto->Flags2 & ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD || !ExtendedCost; } + bool IsGoldRequired(ItemTemplate const* pProto) const { return (pProto->Flags2 & ITEM_FLAG2_DONT_IGNORE_BUY_PRICE) || !ExtendedCost; } }; typedef std::vector<VendorItem*> VendorItemList; @@ -691,6 +691,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma // Handling caster facing during spellcast void SetTarget(ObjectGuid guid) override; void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next ::Update call + void DoNotReacquireTarget() { m_shouldReacquireTarget = false; m_suppressedTarget = ObjectGuid::Empty; m_suppressedOrientation = 0.0f; } void FocusTarget(Spell const* focusSpell, WorldObject const* target); bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false); void ReleaseFocus(Spell const* focusSpell = nullptr, bool withDelay = true); 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 a8dad0b2fbc..1173831be0b 100644 --- a/src/server/game/Entities/Item/Item.cpp +++ b/src/server/game/Entities/Item/Item.cpp @@ -256,11 +256,11 @@ Item::Item() m_paidExtendedCost = 0; } -bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owner) +bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemId, Player const* owner) { Object::_Create(guidlow, 0, HighGuid::Item); - SetEntry(itemid); + SetEntry(itemId); SetObjectScale(1.0f); if (owner) @@ -269,7 +269,7 @@ bool Item::Create(ObjectGuid::LowType guidlow, uint32 itemid, Player const* owne SetGuidValue(ITEM_FIELD_CONTAINED, owner->GetGUID()); } - ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemid); + ItemTemplate const* itemProto = sObjectMgr->GetItemTemplate(itemId); if (!itemProto) return false; @@ -357,7 +357,7 @@ void Item::SaveToDB(SQLTransaction& trans) trans->Append(stmt); - if ((uState == ITEM_CHANGED) && HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if ((uState == ITEM_CHANGED) && HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_GIFT_OWNER); stmt->setUInt32(0, GetOwnerGUID().GetCounter()); @@ -372,7 +372,7 @@ void Item::SaveToDB(SQLTransaction& trans) stmt->setUInt32(0, guid); trans->Append(stmt); - if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); stmt->setUInt32(0, guid); @@ -443,7 +443,7 @@ bool Item::LoadFromDB(ObjectGuid::LowType guid, ObjectGuid owner_guid, Field* fi // Remove bind flag for items vs NO_BIND set if (IsSoulBound() && proto->Bonding == NO_BIND) { - ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_SOULBOUND, false); + ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND, false); need_save = true; } @@ -746,7 +746,7 @@ bool Item::CanBeTraded(bool mail, bool trade) const if (m_lootGenerated) return false; - if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE) || !trade))) + if ((!mail || !IsBoundAccountWide()) && (IsSoulBound() && (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE) || !trade))) return false; if (IsBag() && (Player::IsBagPos(GetPos()) || !((Bag const*)this)->IsEmpty())) @@ -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 && @@ -1017,10 +1017,10 @@ void Item::SendTimeUpdate(Player* owner) owner->GetSession()->SendPacket(&data); } -Item* Item::CreateItem(uint32 itemEntry, uint32 count, Player const* player) +Item* Item::CreateItem(uint32 itemEntry, uint32 count, Player const* player /*= nullptr*/) { if (count < 1) - return NULL; //don't create item at zero count + return nullptr; //don't create item at zero count ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemEntry); if (proto) @@ -1041,18 +1041,18 @@ Item* Item::CreateItem(uint32 itemEntry, uint32 count, Player const* player) } else ABORT(); - return NULL; + return nullptr; } -Item* Item::CloneItem(uint32 count, Player const* player) const +Item* Item::CloneItem(uint32 count, Player const* player /*= nullptr*/) const { Item* newItem = CreateItem(GetEntry(), count, player); if (!newItem) - return NULL; + return nullptr; newItem->SetGuidValue(ITEM_FIELD_CREATOR, GetGuidValue(ITEM_FIELD_CREATOR)); newItem->SetGuidValue(ITEM_FIELD_GIFTCREATOR, GetGuidValue(ITEM_FIELD_GIFTCREATOR)); - newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FLAG_REFUNDABLE | ITEM_FLAG_BOP_TRADEABLE)); + newItem->SetUInt32Value(ITEM_FIELD_FLAGS, GetUInt32Value(ITEM_FIELD_FLAGS) & ~(ITEM_FIELD_FLAG_REFUNDABLE | ITEM_FIELD_FLAG_BOP_TRADEABLE)); newItem->SetUInt32Value(ITEM_FIELD_DURATION, GetUInt32Value(ITEM_FIELD_DURATION)); // player CAN be NULL in which case we must not update random properties because that accesses player's item update queue if (player) @@ -1070,7 +1070,7 @@ bool Item::IsBindedNotWith(Player const* player) const if (GetOwnerGUID() == player->GetGUID()) return false; - if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) + if (HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE)) if (allowedGUIDs.find(player->GetGUID().GetCounter()) != allowedGUIDs.end()) return false; @@ -1131,10 +1131,10 @@ void Item::DeleteRefundDataFromDB(SQLTransaction* trans) void Item::SetNotRefundable(Player* owner, bool changestate /*=true*/, SQLTransaction* trans /*=NULL*/) { - if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (!HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE)) return; - RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); + RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE); // Following is not applicable in the trading procedure if (changestate) SetState(ITEM_CHANGED, owner); @@ -1189,13 +1189,13 @@ bool Item::IsRefundExpired() void Item::SetSoulboundTradeable(AllowedLooterSet const& allowedLooters) { - SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); + SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE); allowedGUIDs = allowedLooters; } void Item::ClearSoulboundTradeable(Player* currentOwner) { - RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); + RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE); if (allowedGUIDs.empty()) return; @@ -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/Item/Item.h b/src/server/game/Entities/Item/Item.h index 5e00a816cab..edc7001e1c4 100644 --- a/src/server/game/Entities/Item/Item.h +++ b/src/server/game/Entities/Item/Item.h @@ -206,12 +206,12 @@ bool ItemCanGoIntoBag(ItemTemplate const* proto, ItemTemplate const* pBagProto); class TC_GAME_API Item : public Object { public: - static Item* CreateItem(uint32 itemEntry, uint32 count, Player const* player = NULL); - Item* CloneItem(uint32 count, Player const* player = NULL) const; + static Item* CreateItem(uint32 itemEntry, uint32 count, Player const* player = nullptr); + Item* CloneItem(uint32 count, Player const* player = nullptr) const; Item(); - virtual bool Create(ObjectGuid::LowType guidlow, ObjectGuid::LowType itemid, Player const* owner); + virtual bool Create(ObjectGuid::LowType guidlow, uint32 itemId, Player const* owner); ItemTemplate const* GetTemplate() const; @@ -219,9 +219,9 @@ class TC_GAME_API Item : public Object void SetOwnerGUID(ObjectGuid guid) { SetGuidValue(ITEM_FIELD_OWNER, guid); } Player* GetOwner()const; - void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_SOULBOUND, val); } - bool IsSoulBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_SOULBOUND); } - bool IsBoundAccountWide() const { return (GetTemplate()->Flags & ITEM_PROTO_FLAG_BIND_TO_ACCOUNT) != 0; } + void SetBinding(bool val) { ApplyModFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND, val); } + bool IsSoulBound() const { return HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_SOULBOUND); } + bool IsBoundAccountWide() const { return (GetTemplate()->Flags & ITEM_FLAG_IS_BOUND_TO_ACCOUNT) != 0; } bool IsBindedNotWith(Player const* player) const; bool IsBoundByEnchant() const; virtual void SaveToDB(SQLTransaction& trans); @@ -245,7 +245,7 @@ class TC_GAME_API Item : public Object Bag* ToBag() { if (IsBag()) return reinterpret_cast<Bag*>(this); else return NULL; } const Bag* ToBag() const { if (IsBag()) return reinterpret_cast<const Bag*>(this); else return NULL; } - bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); } + bool IsLocked() const { return !HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_UNLOCKED); } bool IsBag() const { return GetTemplate()->InventoryType == INVTYPE_BAG; } bool IsCurrencyToken() const { return GetTemplate()->IsCurrencyToken(); } bool IsNotEmptyBag() const; diff --git a/src/server/game/Entities/Item/ItemTemplate.h b/src/server/game/Entities/Item/ItemTemplate.h index 0ff3f00a08b..8cc408b47fb 100644 --- a/src/server/game/Entities/Item/ItemTemplate.h +++ b/src/server/game/Entities/Item/ItemTemplate.h @@ -103,88 +103,117 @@ enum ItemBondingType #define MAX_BIND_TYPE 6 /* /// @todo: Requiring actual cases in which using (an) item isn't allowed while shapeshifted. Else, this flag would need an implementation. - ITEM_PROTO_FLAG_USABLE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms */ - -enum ItemProtoFlags -{ - ITEM_PROTO_FLAG_NO_PICKUP = 0x00000001, // ? - ITEM_PROTO_FLAG_CONJURED = 0x00000002, // Conjured item - ITEM_PROTO_FLAG_HAS_LOOT = 0x00000004, // Item can be right clicked to open for loot - ITEM_PROTO_FLAG_HEROIC = 0x00000008, // Makes green "Heroic" text appear on item - ITEM_PROTO_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use - ITEM_PROTO_FLAG_INDESTRUCTIBLE = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell) - ITEM_PROTO_FLAG_PLAYER_CAST = 0x00000040, // Item's spells are castable by players - ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped - ITEM_PROTO_FLAG_INT_BONUS_INSTEAD = 0x00000100, // ? - ITEM_PROTO_FLAG_IS_WRAPPER = 0x00000200, // Item can wrap other items - ITEM_PROTO_FLAG_USES_RESOURCES = 0x00000400, // ? - ITEM_PROTO_FLAG_MULTI_DROP = 0x00000800, // Looting this item does not remove it from available loot - ITEM_PROTO_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost) - ITEM_PROTO_FLAG_PETITION = 0x00002000, // Item is guild or arena charter - ITEM_PROTO_FLAG_UNK5 = 0x00004000, // Only readable items have this (but not all) - ITEM_PROTO_FLAG_UNK6 = 0x00008000, // ? - ITEM_PROTO_FLAG_UNK7 = 0x00010000, // ? - ITEM_PROTO_FLAG_UNK8 = 0x00020000, // ? - ITEM_PROTO_FLAG_PROSPECTABLE = 0x00040000, // Item can be prospected - ITEM_PROTO_FLAG_UNIQUE_EQUIPPED = 0x00080000, // You can only equip one of these - ITEM_PROTO_FLAG_UNK9 = 0x00100000, // ? - ITEM_PROTO_FLAG_USEABLE_IN_ARENA = 0x00200000, // Item can be used during arena match - ITEM_PROTO_FLAG_THROWABLE = 0x00400000, // Some Thrown weapons have it (and only Thrown) but not all - ITEM_PROTO_FLAG_USABLE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms - ITEM_PROTO_FLAG_UNK10 = 0x01000000, // ? - ITEM_PROTO_FLAG_SMART_LOOT = 0x02000000, // Profession recipes: can only be looted if you meet requirements and don't already know it - ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA = 0x04000000, // Item cannot be used in arena - ITEM_PROTO_FLAG_BIND_TO_ACCOUNT = 0x08000000, // Item binds to account and can be sent only to your own characters - ITEM_PROTO_FLAG_TRIGGERED_CAST = 0x10000000, // Spell is cast with triggered flag - ITEM_PROTO_FLAG_MILLABLE = 0x20000000, // Item can be milled - ITEM_PROTO_FLAG_UNK11 = 0x40000000, // ? - ITEM_PROTO_FLAG_UNK12 = 0x80000000 // ? -}; - -enum ItemFieldFlags -{ - ITEM_FLAG_SOULBOUND = 0x00000001, // Item is soulbound and cannot be traded <<-- - ITEM_FLAG_UNK1 = 0x00000002, // ? - ITEM_FLAG_UNLOCKED = 0x00000004, // Item had lock but can be opened now - ITEM_FLAG_WRAPPED = 0x00000008, // Item is wrapped and contains another item - ITEM_FLAG_UNK2 = 0x00000010, // ? - ITEM_FLAG_UNK3 = 0x00000020, // ? - ITEM_FLAG_UNK4 = 0x00000040, // ? - ITEM_FLAG_UNK5 = 0x00000080, // ? - ITEM_FLAG_BOP_TRADEABLE = 0x00000100, // Allows trading soulbound items - ITEM_FLAG_READABLE = 0x00000200, // Opens text page when right clicked - ITEM_FLAG_UNK6 = 0x00000400, // ? - ITEM_FLAG_UNK7 = 0x00000800, // ? - ITEM_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost) - ITEM_FLAG_UNK8 = 0x00002000, // ? - ITEM_FLAG_UNK9 = 0x00004000, // ? - ITEM_FLAG_UNK10 = 0x00008000, // ? - ITEM_FLAG_UNK11 = 0x00010000, // ? - ITEM_FLAG_UNK12 = 0x00020000, // ? - ITEM_FLAG_UNK13 = 0x00040000, // ? - ITEM_FLAG_UNK14 = 0x00080000, // ? - ITEM_FLAG_UNK15 = 0x00100000, // ? - ITEM_FLAG_UNK16 = 0x00200000, // ? - ITEM_FLAG_UNK17 = 0x00400000, // ? - ITEM_FLAG_UNK18 = 0x00800000, // ? - ITEM_FLAG_UNK19 = 0x01000000, // ? - ITEM_FLAG_UNK20 = 0x02000000, // ? - ITEM_FLAG_UNK21 = 0x04000000, // ? - ITEM_FLAG_UNK22 = 0x08000000, // ? - ITEM_FLAG_UNK23 = 0x10000000, // ? - ITEM_FLAG_UNK24 = 0x20000000, // ? - ITEM_FLAG_UNK25 = 0x40000000, // ? - ITEM_FLAG_UNK26 = 0x80000000, // ? - - ITEM_FLAG_MAIL_TEXT_MASK = ITEM_FLAG_READABLE | ITEM_FLAG_UNK13 | ITEM_FLAG_UNK14 -}; - -enum ItemFlagsExtra -{ - ITEM_FLAGS_EXTRA_HORDE_ONLY = 0x00000001, - ITEM_FLAGS_EXTRA_ALLIANCE_ONLY = 0x00000002, - ITEM_FLAGS_EXTRA_EXT_COST_REQUIRES_GOLD = 0x00000004, // when item uses extended cost, gold is also required - ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED = 0x00000100 + ITEM_FLAG_USE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms */ + +// ITEM_FIELD_FLAGS +enum ItemFieldFlags : uint32 +{ + ITEM_FIELD_FLAG_SOULBOUND = 0x00000001, // Item is soulbound and cannot be traded <<-- + ITEM_FIELD_FLAG_UNK1 = 0x00000002, // ? + ITEM_FIELD_FLAG_UNLOCKED = 0x00000004, // Item had lock but can be opened now + ITEM_FIELD_FLAG_WRAPPED = 0x00000008, // Item is wrapped and contains another item + ITEM_FIELD_FLAG_UNK2 = 0x00000010, // ? + ITEM_FIELD_FLAG_UNK3 = 0x00000020, // ? + ITEM_FIELD_FLAG_UNK4 = 0x00000040, // ? + ITEM_FIELD_FLAG_UNK5 = 0x00000080, // ? + ITEM_FIELD_FLAG_BOP_TRADEABLE = 0x00000100, // Allows trading soulbound items + ITEM_FIELD_FLAG_READABLE = 0x00000200, // Opens text page when right clicked + ITEM_FIELD_FLAG_UNK6 = 0x00000400, // ? + ITEM_FIELD_FLAG_UNK7 = 0x00000800, // ? + ITEM_FIELD_FLAG_REFUNDABLE = 0x00001000, // Item can be returned to vendor for its original cost (extended cost) + ITEM_FIELD_FLAG_UNK8 = 0x00002000, // ? + ITEM_FIELD_FLAG_UNK9 = 0x00004000, // ? + ITEM_FIELD_FLAG_UNK10 = 0x00008000, // ? + ITEM_FIELD_FLAG_UNK11 = 0x00010000, // ? + ITEM_FIELD_FLAG_UNK12 = 0x00020000, // ? + ITEM_FIELD_FLAG_UNK13 = 0x00040000, // ? + ITEM_FIELD_FLAG_UNK14 = 0x00080000, // ? + ITEM_FIELD_FLAG_UNK15 = 0x00100000, // ? + ITEM_FIELD_FLAG_UNK16 = 0x00200000, // ? + ITEM_FIELD_FLAG_UNK17 = 0x00400000, // ? + ITEM_FIELD_FLAG_UNK18 = 0x00800000, // ? + ITEM_FIELD_FLAG_UNK19 = 0x01000000, // ? + ITEM_FIELD_FLAG_UNK20 = 0x02000000, // ? + ITEM_FIELD_FLAG_UNK21 = 0x04000000, // ? + ITEM_FIELD_FLAG_UNK22 = 0x08000000, // ? + ITEM_FIELD_FLAG_UNK23 = 0x10000000, // ? + ITEM_FIELD_FLAG_UNK24 = 0x20000000, // ? + ITEM_FIELD_FLAG_UNK25 = 0x40000000, // ? + ITEM_FIELD_FLAG_UNK26 = 0x80000000, // ? + + ITEM_FLAG_MAIL_TEXT_MASK = ITEM_FIELD_FLAG_READABLE | ITEM_FIELD_FLAG_UNK13 | ITEM_FIELD_FLAG_UNK14 +}; + +enum ItemFlags : uint32 +{ + ITEM_FLAG_NO_PICKUP = 0x00000001, + ITEM_FLAG_CONJURED = 0x00000002, // Conjured item + ITEM_FLAG_HAS_LOOT = 0x00000004, // Item can be right clicked to open for loot + ITEM_FLAG_HEROIC_TOOLTIP = 0x00000008, // Makes green "Heroic" text appear on item + ITEM_FLAG_DEPRECATED = 0x00000010, // Cannot equip or use + ITEM_FLAG_NO_USER_DESTROY = 0x00000020, // Item can not be destroyed, except by using spell (item can be reagent for spell) + ITEM_FLAG_PLAYERCAST = 0x00000040, // Item's spells are castable by players + ITEM_FLAG_NO_EQUIP_COOLDOWN = 0x00000080, // No default 30 seconds cooldown when equipped + ITEM_FLAG_MULTI_LOOT_QUEST = 0x00000100, + ITEM_FLAG_IS_WRAPPER = 0x00000200, // Item can wrap other items + ITEM_FLAG_USES_RESOURCES = 0x00000400, + ITEM_FLAG_MULTI_DROP = 0x00000800, // Looting this item does not remove it from available loot + ITEM_FLAG_ITEM_PURCHASE_RECORD = 0x00001000, // Item can be returned to vendor for its original cost (extended cost) + ITEM_FLAG_PETITION = 0x00002000, // Item is guild or arena charter + ITEM_FLAG_HAS_TEXT = 0x00004000, // Only readable items have this (but not all) + ITEM_FLAG_NO_DISENCHANT = 0x00008000, + ITEM_FLAG_REAL_DURATION = 0x00010000, + ITEM_FLAG_NO_CREATOR = 0x00020000, + ITEM_FLAG_IS_PROSPECTABLE = 0x00040000, // Item can be prospected + ITEM_FLAG_UNIQUE_EQUIPPABLE = 0x00080000, // You can only equip one of these + ITEM_FLAG_IGNORE_FOR_AURAS = 0x00100000, + ITEM_FLAG_IGNORE_DEFAULT_ARENA_RESTRICTIONS = 0x00200000, // Item can be used during arena match + ITEM_FLAG_NO_DURABILITY_LOSS = 0x00400000, // Some Thrown weapons have it (and only Thrown) but not all + ITEM_FLAG_USE_WHEN_SHAPESHIFTED = 0x00800000, // Item can be used in shapeshift forms + ITEM_FLAG_HAS_QUEST_GLOW = 0x01000000, + ITEM_FLAG_HIDE_UNUSABLE_RECIPE = 0x02000000, // Profession recipes: can only be looted if you meet requirements and don't already know it + ITEM_FLAG_NOT_USEABLE_IN_ARENA = 0x04000000, // Item cannot be used in arena + ITEM_FLAG_IS_BOUND_TO_ACCOUNT = 0x08000000, // Item binds to account and can be sent only to your own characters + ITEM_FLAG_NO_REAGENT_COST = 0x10000000, // Spell is cast ignoring reagents + ITEM_FLAG_IS_MILLABLE = 0x20000000, // Item can be milled + ITEM_FLAG_REPORT_TO_GUILD_CHAT = 0x40000000, + ITEM_FLAG_NO_PROGRESSIVE_LOOT = 0x80000000 +}; + +enum ItemFlags2 : uint32 +{ + ITEM_FLAG2_FACTION_HORDE = 0x00000001, + ITEM_FLAG2_FACTION_ALLIANCE = 0x00000002, + ITEM_FLAG2_DONT_IGNORE_BUY_PRICE = 0x00000004, // when item uses extended cost, gold is also required + ITEM_FLAG2_CLASSIFY_AS_CASTER = 0x00000008, + ITEM_FLAG2_CLASSIFY_AS_PHYSICAL = 0x00000010, + ITEM_FLAG2_EVERYONE_CAN_ROLL_NEED = 0x00000020, + ITEM_FLAG2_NO_TRADE_BIND_ON_ACQUIRE = 0x00000040, + ITEM_FLAG2_CAN_TRADE_BIND_ON_ACQUIRE = 0x00000080, + ITEM_FLAG2_CAN_ONLY_ROLL_GREED = 0x00000100, + ITEM_FLAG2_CASTER_WEAPON = 0x00000200, + ITEM_FLAG2_DELETE_ON_LOGIN = 0x00000400, + ITEM_FLAG2_INTERNAL_ITEM = 0x00000800, + ITEM_FLAG2_NO_VENDOR_VALUE = 0x00001000, + ITEM_FLAG2_SHOW_BEFORE_DISCOVERED = 0x00002000, + ITEM_FLAG2_OVERRIDE_GOLD_COST = 0x00004000, + ITEM_FLAG2_IGNORE_DEFAULT_RATED_BG_RESTRICTIONS = 0x00008000, + ITEM_FLAG2_NOT_USABLE_IN_RATED_BG = 0x00010000, + ITEM_FLAG2_BNET_ACCOUNT_TRADE_OK = 0x00020000, + ITEM_FLAG2_CONFIRM_BEFORE_USE = 0x00040000, + ITEM_FLAG2_REEVALUATE_BONDING_ON_TRANSFORM = 0x00080000, + ITEM_FLAG2_NO_TRANSFORM_ON_CHARGE_DEPLETION = 0x00100000, + ITEM_FLAG2_NO_ALTER_ITEM_VISUAL = 0x00200000, + ITEM_FLAG2_NO_SOURCE_FOR_ITEM_VISUAL = 0x00400000, + ITEM_FLAG2_IGNORE_QUALITY_FOR_ITEM_VISUAL_SOURCE = 0x00800000, + ITEM_FLAG2_NO_DURABILITY = 0x01000000, + ITEM_FLAG2_ROLE_TANK = 0x02000000, + ITEM_FLAG2_ROLE_HEALER = 0x04000000, + ITEM_FLAG2_ROLE_DAMAGE = 0x08000000, + ITEM_FLAG2_CAN_DROP_IN_CHALLENGE_MODE = 0x10000000, + ITEM_FLAG2_NEVER_STACK_IN_LOOT_UI = 0x20000000, + ITEM_FLAG2_DISENCHANT_TO_LOOT_TABLE = 0x40000000, + ITEM_FLAG2_USED_IN_A_TRADESKILL = 0x80000000 }; enum ItemFlagsCustom @@ -674,7 +703,7 @@ struct ItemTemplate bool IsPotion() const { return Class == ITEM_CLASS_CONSUMABLE && SubClass == ITEM_SUBCLASS_POTION; } bool IsWeaponVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_WEAPON_ENCHANTMENT; } bool IsArmorVellum() const { return Class == ITEM_CLASS_TRADE_GOODS && SubClass == ITEM_SUBCLASS_ARMOR_ENCHANTMENT; } - bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_PROTO_FLAG_CONJURED); } + bool IsConjuredConsumable() const { return Class == ITEM_CLASS_CONSUMABLE && (Flags & ITEM_FLAG_CONJURED); } }; // Benchmarked: Faster than std::map (insert/find) diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index aea923f6eac..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... @@ -2116,114 +2116,42 @@ GameObject* WorldObject::FindNearestGameObjectOfType(GameobjectTypes type, float return go; } -void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>& gameobjectList, uint32 entry, float maxSearchRange) const +template <typename Container> +void WorldObject::GetGameObjectListWithEntryInGrid(Container& gameObjectContainer, uint32 entry, float maxSearchRange /*= 250.0f*/) const { - CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY())); + CellCoord pair(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY())); Cell cell(pair); cell.SetNoCreate(); Trinity::AllGameObjectsWithEntryInRange check(this, entry, maxSearchRange); - Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange> searcher(this, gameobjectList, check); + Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange> searcher(this, gameObjectContainer, check); TypeContainerVisitor<Trinity::GameObjectListSearcher<Trinity::AllGameObjectsWithEntryInRange>, GridTypeMapContainer> visitor(searcher); - cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange); + cell.Visit(pair, visitor, *GetMap(), *this, maxSearchRange); } -void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>& creatureList, uint32 entry, float maxSearchRange) const +template <typename Container> +void WorldObject::GetCreatureListWithEntryInGrid(Container& creatureContainer, uint32 entry, float maxSearchRange /*= 250.0f*/) const { - CellCoord pair(Trinity::ComputeCellCoord(this->GetPositionX(), this->GetPositionY())); + CellCoord pair(Trinity::ComputeCellCoord(GetPositionX(), GetPositionY())); Cell cell(pair); cell.SetNoCreate(); Trinity::AllCreaturesOfEntryInRange check(this, entry, maxSearchRange); - Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, creatureList, check); + Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange> searcher(this, creatureContainer, check); TypeContainerVisitor<Trinity::CreatureListSearcher<Trinity::AllCreaturesOfEntryInRange>, GridTypeMapContainer> visitor(searcher); - cell.Visit(pair, visitor, *(this->GetMap()), *this, maxSearchRange); + cell.Visit(pair, visitor, *GetMap(), *this, maxSearchRange); } -void WorldObject::GetPlayerListInGrid(std::list<Player*>& playerList, float maxSearchRange) const +template <typename Container> +void WorldObject::GetPlayerListInGrid(Container& playerContainer, float maxSearchRange) const { Trinity::AnyPlayerInObjectRangeCheck checker(this, maxSearchRange); - Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, playerList, checker); - this->VisitNearbyWorldObject(maxSearchRange, searcher); + Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(this, playerContainer, checker); + VisitNearbyWorldObject(maxSearchRange, searcher); } -/* -namespace Trinity -{ - class NearUsedPosDo - { - public: - NearUsedPosDo(WorldObject const& obj, WorldObject const* searcher, float angle, ObjectPosSelector& selector) - : i_object(obj), i_searcher(searcher), i_angle(angle), i_selector(selector) { } - - void operator()(Corpse*) const { } - void operator()(DynamicObject*) const { } - - void operator()(Creature* c) const - { - // skip self or target - if (c == i_searcher || c == &i_object) - return; - - float x, y, z; - - if (!c->IsAlive() || c->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED | UNIT_STATE_DISTRACTED) || - !c->GetMotionMaster()->GetDestination(x, y, z)) - { - x = c->GetPositionX(); - y = c->GetPositionY(); - } - - add(c, x, y); - } - - template<class T> - void operator()(T* u) const - { - // skip self or target - if (u == i_searcher || u == &i_object) - return; - - float x, y; - - x = u->GetPositionX(); - y = u->GetPositionY(); - - add(u, x, y); - } - - // we must add used pos that can fill places around center - void add(WorldObject* u, float x, float y) const - { - // u is too nearest/far away to i_object - if (!i_object.IsInRange2d(x, y, i_selector.m_dist - i_selector.m_size, i_selector.m_dist + i_selector.m_size)) - return; - - float angle = i_object.GetAngle(u)-i_angle; - - // move angle to range -pi ... +pi - while (angle > M_PI) - angle -= 2.0f * M_PI; - while (angle < -M_PI) - angle += 2.0f * M_PI; - - // dist include size of u - float dist2d = i_object.GetDistance2d(x, y); - i_selector.AddUsedPos(u->GetObjectSize(), angle, dist2d + i_object.GetObjectSize()); - } - private: - WorldObject const& i_object; - WorldObject const* i_searcher; - float i_angle; - ObjectPosSelector& i_selector; - }; -} // namespace Trinity -*/ - -//=================================================================================================== - void WorldObject::GetNearPoint2D(float &x, float &y, float distance2d, float absAngle) const { x = GetPositionX() + (GetObjectSize() + distance2d) * std::cos(absAngle); @@ -2623,3 +2551,15 @@ ObjectGuid WorldObject::GetTransGUID() const return GetTransport()->GetGUID(); return ObjectGuid::Empty; } + +template TC_GAME_API void WorldObject::GetGameObjectListWithEntryInGrid(std::list<GameObject*>&, uint32, float) const; +template TC_GAME_API void WorldObject::GetGameObjectListWithEntryInGrid(std::deque<GameObject*>&, uint32, float) const; +template TC_GAME_API void WorldObject::GetGameObjectListWithEntryInGrid(std::vector<GameObject*>&, uint32, float) const; + +template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::list<Creature*>&, uint32, float) const; +template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::deque<Creature*>&, uint32, float) const; +template TC_GAME_API void WorldObject::GetCreatureListWithEntryInGrid(std::vector<Creature*>&, uint32, float) const; + +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::list<Player*>&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::deque<Player*>&, float) const; +template TC_GAME_API void WorldObject::GetPlayerListInGrid(std::vector<Player*>&, float) const; diff --git a/src/server/game/Entities/Object/Object.h b/src/server/game/Entities/Object/Object.h index 2fdb9433356..e107a5f6bfd 100644 --- a/src/server/game/Entities/Object/Object.h +++ b/src/server/game/Entities/Object/Object.h @@ -558,9 +558,14 @@ class TC_GAME_API WorldObject : public Object, public WorldLocation GameObject* FindNearestGameObject(uint32 entry, float range) const; GameObject* FindNearestGameObjectOfType(GameobjectTypes type, float range) const; - void GetGameObjectListWithEntryInGrid(std::list<GameObject*>& lList, uint32 uiEntry = 0, float fMaxSearchRange = 250.0f) const; - void GetCreatureListWithEntryInGrid(std::list<Creature*>& lList, uint32 uiEntry = 0, float fMaxSearchRange = 250.0f) const; - void GetPlayerListInGrid(std::list<Player*>& lList, float fMaxSearchRange) const; + template <typename Container> + void GetGameObjectListWithEntryInGrid(Container& gameObjectContainer, uint32 entry, float maxSearchRange = 250.0f) const; + + template <typename Container> + void GetCreatureListWithEntryInGrid(Container& creatureContainer, uint32 entry, float maxSearchRange = 250.0f) const; + + template <typename Container> + void GetPlayerListInGrid(Container& playerContainer, float maxSearchRange) const; void DestroyForNearbyPlayers(); virtual void UpdateObjectVisibility(bool forced = true); diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index dff6f8c0478..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); @@ -5172,8 +5190,15 @@ void Player::CleanupChannels() Channel* ch = *m_channels.begin(); m_channels.erase(m_channels.begin()); // remove from player's channel list ch->LeaveChannel(this, false); // not send to client, not remove from player's channel list + + // delete channel if empty if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetTeam())) - cMgr->LeftChannel(ch->GetName()); // deleted channel if empty + { + if (ch->IsConstant()) + cMgr->LeftChannel(ch->GetChannelId(), ch->GetZoneEntry()); + else + cMgr->LeftChannel(ch->GetName()); + } } TC_LOG_DEBUG("chat.system", "Player::CleanupChannels: Channels of player '%s' (%s) cleaned up.", GetName().c_str(), GetGUID().ToString().c_str()); } @@ -5191,7 +5216,6 @@ void Player::UpdateLocalChannels(uint32 newZone) if (!cMgr) return; - std::string current_zone_name = current_zone->area_name[GetSession()->GetSessionDbcLocale()]; for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i) { ChatChannelsEntry const* channelEntry = sChatChannelsStore.LookupEntry(i); @@ -5219,14 +5243,7 @@ void Player::UpdateLocalChannels(uint32 newZone) if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY && usedChannel) continue; // Already on the channel, as city channel names are not changing - std::string currentNameExt; - if (channelEntry->flags & CHANNEL_DBC_FLAG_CITY_ONLY) - currentNameExt = sObjectMgr->GetTrinityStringForDBCLocale(LANG_CHANNEL_CITY); - else - currentNameExt = current_zone_name; - - std::string newChannelName = Trinity::StringFormat(channelEntry->pattern[m_session->GetSessionDbcLocale()], currentNameExt.c_str()); - joinChannel = cMgr->GetJoinChannel(newChannelName, channelEntry->ChannelID); + joinChannel = cMgr->GetJoinChannel(channelEntry->ChannelID, std::string(), current_zone); if (usedChannel) { if (joinChannel != usedChannel) @@ -5239,7 +5256,7 @@ void Player::UpdateLocalChannels(uint32 newZone) } } else - joinChannel = cMgr->GetJoinChannel(channelEntry->pattern[m_session->GetSessionDbcLocale()], channelEntry->ChannelID); + joinChannel = cMgr->GetJoinChannel(channelEntry->ChannelID, std::string()); } else removeChannel = usedChannel; @@ -5249,10 +5266,10 @@ void Player::UpdateLocalChannels(uint32 newZone) if (removeChannel) { - removeChannel->LeaveChannel(this, sendRemove); // Leave old channel - std::string name = removeChannel->GetName(); // Store name, (*i)erase in LeftChannel - LeftChannel(removeChannel); // Remove from player's channel list - cMgr->LeftChannel(name); // Delete if empty + removeChannel->LeaveChannel(this, sendRemove); // Leave old channel + + LeftChannel(removeChannel); // Remove from player's channel list + cMgr->LeftChannel(removeChannel->GetChannelId(), removeChannel->GetZoneEntry()); // Delete if empty } } } @@ -7378,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"); @@ -7745,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) +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; - - // 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) -{ - // 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) @@ -8002,7 +7955,7 @@ void Player::CastItemCombatSpell(DamageInfo const& damageInfo, Item* item, ItemT } // not allow proc extra attack spell at extra attack - if (HasExtraAttacksPending() && spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) + if (m_extraAttacks && spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) return; float chance = (float)spellInfo->ProcChance; @@ -8199,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) @@ -8228,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) @@ -9387,7 +9334,7 @@ void Player::SendBattlefieldWorldStates() const /// Send misc stuff that needs to be sent on every login, like the battle timers. if (sWorld->getBoolConfig(CONFIG_WINTERGRASP_ENABLE)) { - if (BattlefieldWG* wg = (BattlefieldWG*)sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) + if (BattlefieldWG* wg = static_cast<BattlefieldWG*>(sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))) { SendUpdateWorldState(BATTLEFIELD_WG_WORLD_STATE_ACTIVE, wg->IsWarTime() ? 0 : 1); uint32 timer = wg->IsWarTime() ? 0 : (wg->GetTimer() / 1000); // 0 - Time to next battle @@ -10141,7 +10088,7 @@ bool Player::HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_ return false; } -bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot) const +bool Player::HasItemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot) const { uint32 tempcount = 0; for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) @@ -10163,6 +10110,26 @@ bool Player::HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 if (tempcount >= count) return true; } + } + + return false; +} + +bool Player::HasGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot) const +{ + uint32 tempcount = 0; + for (uint8 i = EQUIPMENT_SLOT_START; i < EQUIPMENT_SLOT_END; ++i) + { + if (i == except_slot) + continue; + + Item* pItem = GetItemByPos(INVENTORY_SLOT_BAG_0, i); + if (!pItem) + continue; + + ItemTemplate const* pProto = pItem->GetTemplate(); + if (!pProto) + continue; if (pProto->Socket[0].Color || pItem->GetEnchantmentId(PRISMATIC_ENCHANTMENT_SLOT)) { @@ -11628,10 +11595,8 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const if (!proto) return EQUIP_ERR_ITEM_NOT_FOUND; - if ((proto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && GetTeam() != HORDE) - return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; - - if ((proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && GetTeam() != ALLIANCE) + if (((proto->Flags2 & ITEM_FLAG2_FACTION_HORDE) && GetTeam() != HORDE) || + (((proto->Flags2 & ITEM_FLAG2_FACTION_ALLIANCE) && GetTeam() != ALLIANCE))) return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM; if ((proto->AllowableClass & getClassMask()) == 0 || (proto->AllowableRace & getRaceMask()) == 0) @@ -12204,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) { @@ -12297,7 +12259,7 @@ void Player::MoveItemToInventory(ItemPosCountVec const& dest, Item* pItem, bool // in case trade we already have item in other player inventory pLastItem->SetState(in_characterInventoryDB ? ITEM_CHANGED : ITEM_NEW, this); - if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) + if (pLastItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE)) AddTradeableItem(pLastItem); } } @@ -12315,7 +12277,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) for (uint8 i = 0; i < MAX_BAG_SIZE; ++i) DestroyItem(slot, i, update); - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)) { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GIFT); @@ -12357,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) { @@ -12388,7 +12347,7 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update) // Delete rolled money / loot from db. // MUST be done before RemoveFromWorld() or GetTemplate() fails if (ItemTemplate const* pTmp = pItem->GetTemplate()) - if (pTmp->Flags & ITEM_PROTO_FLAG_HAS_LOOT) + if (pTmp->Flags & ITEM_FLAG_HAS_LOOT) pItem->ItemContainerDeleteLootMoneyAndLootItemsFromDB(); if (IsInWorld() && update) @@ -14826,7 +14785,9 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg) InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardChoiceItemId[reward], quest->RewardChoiceItemCount[reward]); if (res != EQUIP_ERR_OK) { - SendEquipError(res, nullptr, nullptr, quest->RewardChoiceItemId[reward]); + if (msg) + SendQuestFailed(quest->GetQuestId(), res); + return false; } } @@ -14841,7 +14802,9 @@ bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg) InventoryResult res = CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, quest->RewardItemId[i], quest->RewardItemIdCount[i]); if (res != EQUIP_ERR_OK) { - SendEquipError(res, nullptr, nullptr, quest->RewardItemId[i]); + if (msg) + SendQuestFailed(quest->GetQuestId(), res); + return false; } } @@ -14990,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); } } @@ -15188,13 +15151,16 @@ void Player::SetRewardedQuest(uint32 quest_id) void Player::FailQuest(uint32 questId) { - if (Quest const* quest = sObjectMgr->GetQuestTemplate(questId)) { // Already complete quests shouldn't turn failed. if (GetQuestStatus(questId) == QUEST_STATUS_COMPLETE && !quest->HasSpecialFlag(QUEST_SPECIAL_FLAGS_TIMED)) return; + // You can't fail a quest if you don't have it, or if it's already rewarded. + if (GetQuestStatus(questId) == QUEST_STATUS_NONE || GetQuestStatus(questId) == QUEST_STATUS_REWARDED) + return; + SetQuestStatus(questId, QUEST_STATUS_FAILED); uint16 log_slot = FindQuestSlot(questId); @@ -15220,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); } } @@ -15237,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); } } @@ -15947,21 +15913,18 @@ 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); - if ((status == QUEST_STATUS_COMPLETE && !GetQuestRewardStatus(questId)) || - (quest->IsAutoComplete() && CanTakeQuest(quest, false))) - { - if (quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) - result2 = DIALOG_STATUS_REWARD_REP; - else - result2 = DIALOG_STATUS_REWARD; - } + if (status == QUEST_STATUS_COMPLETE && !GetQuestRewardStatus(questId)) + result2 = DIALOG_STATUS_REWARD; else if (status == QUEST_STATUS_INCOMPLETE) result2 = DIALOG_STATUS_INCOMPLETE; + if (quest->IsAutoComplete() && CanTakeQuest(quest, false) && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) + result2 = DIALOG_STATUS_REWARD_REP; + if (result2 > result) result = result2; } @@ -15974,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); @@ -15984,9 +15947,7 @@ QuestGiverStatus Player::GetQuestDialogStatus(Object* questgiver) { if (SatisfyQuestLevel(quest, false)) { - if (quest->IsAutoComplete()) - result2 = DIALOG_STATUS_REWARD_REP; - else if (getLevel() <= (GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) + if (getLevel() <= (GetQuestLevel(quest) + sWorld->getIntConfig(CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF))) { if (quest->IsDaily()) result2 = DIALOG_STATUS_AVAILABLE_REP; @@ -16547,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); @@ -16561,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) @@ -16576,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 @@ -16586,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; } } @@ -18080,13 +18041,13 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F remove = true; } // "Conjured items disappear if you are logged out for more than 15 minutes" - else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_PROTO_FLAG_CONJURED) + else if (timeDiff > 15 * MINUTE && proto->Flags & ITEM_FLAG_CONJURED) { TC_LOG_DEBUG("entities.player.loading", "Player::_LoadInventory: player (GUID: %u, name: '%s', diff: %u) has conjured item (GUID: %u, entry: %u) with expired lifetime (15 minutes). Deleting item.", GetGUID().GetCounter(), GetName().c_str(), timeDiff, item->GetGUID().GetCounter(), item->GetEntry()); remove = true; } - else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE)) { if (item->GetPlayedTime() > (2 * HOUR)) { @@ -18097,7 +18058,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F stmt->setUInt32(0, item->GetGUID().GetCounter()); trans->Append(stmt); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE); } else { @@ -18115,11 +18076,11 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { TC_LOG_DEBUG("entities.player.loading", "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with refundable flags, but without data in item_refund_instance. Removing flag.", GetGUID().GetCounter(), GetName().c_str(), item->GetGUID().GetCounter(), item->GetEntry()); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE); } } } - else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) + else if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ITEM_BOP_TRADE); stmt->setUInt32(0, item->GetGUID().GetCounter()); @@ -18143,7 +18104,7 @@ Item* Player::_LoadItem(SQLTransaction& trans, uint32 zoneId, uint32 timeDiff, F { TC_LOG_DEBUG("entities.player.loading", "Player::_LoadInventory: player (GUID: %u, name: '%s') has item (GUID: %u, entry: %u) with ITEM_FLAG_BOP_TRADEABLE flag, but without data in item_soulbound_trade_data. Removing flag.", GetGUID().GetCounter(), GetName().c_str(), item->GetGUID().GetCounter(), item->GetEntry()); - item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE); + item->RemoveFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE); } } else if (proto->HolidayId) @@ -19539,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); @@ -20854,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) @@ -21483,9 +21444,9 @@ inline bool Player::_StoreOrEquipNewItem(uint32 vendorslot, uint32 item, uint8 c if (!bStore) AutoUnequipOffhandIfNeed(); - if (pProto->Flags & ITEM_PROTO_FLAG_REFUNDABLE && crItem->ExtendedCost && pProto->GetMaxStackSize() == 1) + if (pProto->Flags & ITEM_FLAG_ITEM_PURCHASE_RECORD && crItem->ExtendedCost && pProto->GetMaxStackSize() == 1) { - it->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE); + it->SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE); it->SetRefundRecipient(GetGUID().GetCounter()); it->SetPaidMoney(price); it->SetPaidExtendedCost(crItem->ExtendedCost); @@ -21522,7 +21483,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin return false; } - if (!IsGameMaster() && ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && GetTeam() == ALLIANCE) || (pProto->Flags2 == ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && GetTeam() == HORDE))) + if (!IsGameMaster() && ((pProto->Flags2 & ITEM_FLAG2_FACTION_HORDE && GetTeam() == ALLIANCE) || (pProto->Flags2 == ITEM_FLAG2_FACTION_ALLIANCE && GetTeam() == HORDE))) return false; Creature* creature = GetNPCIfCanInteractWith(vendorguid, UNIT_NPC_FLAG_VENDOR); @@ -22710,7 +22671,7 @@ void Player::SendInstanceResetWarning(uint32 mapid, Difficulty difficulty, uint3 void Player::ApplyEquipCooldown(Item* pItem) { - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_PROTO_FLAG_NO_EQUIP_COOLDOWN)) + if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_EQUIP_COOLDOWN) return; std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); @@ -23563,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; @@ -24610,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); @@ -24878,7 +24839,7 @@ InventoryResult Player::CanEquipUniqueItem(Item* pItem, uint8 eslot, uint32 limi InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 except_slot, uint32 limit_count) const { // check unique-equipped on item - if (itemProto->Flags & ITEM_PROTO_FLAG_UNIQUE_EQUIPPED) + if (itemProto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE) { // there is an equip limit on this item if (HasItemOrGemWithIdEquipped(itemProto->ItemId, 1, except_slot)) @@ -24898,7 +24859,9 @@ InventoryResult Player::CanEquipUniqueItem(ItemTemplate const* itemProto, uint8 return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED; // there is an equip limit on this item - if (HasItemOrGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) + if (HasItemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) + return EQUIP_ERR_ITEM_MAX_LIMIT_CATEGORY_EQUIPPED_EXCEEDED; + else if (HasGemWithLimitCategoryEquipped(itemProto->ItemLimitCategory, limitEntry->maxCount - limit_count + 1, except_slot)) return EQUIP_ERR_ITEM_MAX_COUNT_EQUIPPED_SOCKETED; } @@ -25862,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();*/ @@ -25979,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() @@ -26038,7 +26022,7 @@ void Player::SendRefundInfo(Item* item) // This function call unsets ITEM_FLAGS_REFUNDABLE if played time is over 2 hours. item->UpdatePlayedTime(this); - if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE)) { TC_LOG_DEBUG("entities.player.items", "Item refund: item not refundable!"); return; @@ -26098,7 +26082,7 @@ bool Player::AddItem(uint32 itemId, uint32 count) void Player::RefundItem(Item* item) { - if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (!item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE)) { TC_LOG_DEBUG("entities.player.items", "Item refund: item not refundable!"); return; diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h index 2f580908e2b..ed5dc7e954f 100644 --- a/src/server/game/Entities/Player/Player.h +++ b/src/server/game/Entities/Player/Player.h @@ -1199,7 +1199,8 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> bool HasItemFitToSpellRequirements(SpellInfo const* spellInfo, Item const* ignoreItem = nullptr) const; bool CanNoReagentCast(SpellInfo const* spellInfo) const; bool HasItemOrGemWithIdEquipped(uint32 item, uint32 count, uint8 except_slot = NULL_SLOT) const; - bool HasItemOrGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; + bool HasItemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; + bool HasGemWithLimitCategoryEquipped(uint32 limitCategory, uint32 count, uint8 except_slot = NULL_SLOT) const; InventoryResult CanTakeMoreSimilarItems(Item* pItem, uint32* itemLimitCategory = NULL) const { return CanTakeMoreSimilarItems(pItem->GetEntry(), pItem->GetCount(), pItem, NULL, itemLimitCategory); } InventoryResult CanTakeMoreSimilarItems(uint32 entry, uint32 count, uint32* itemLimitCategory = NULL) const { return CanTakeMoreSimilarItems(entry, count, NULL, NULL, itemLimitCategory); } InventoryResult CanStoreNewItem(uint8 bag, uint8 slot, ItemPosCountVec& dest, uint32 item, uint32 count, uint32* no_space_count = nullptr) const; @@ -1405,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; @@ -1847,6 +1848,9 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> void UpdateLocalChannels(uint32 newZone); void LeaveLFGChannel(); + typedef std::list<Channel*> JoinedChannelsList; + JoinedChannelsList const& GetJoinedChannels() const { return m_channels; } + void UpdateDefense(); void UpdateWeaponSkill (WeaponAttackType attType); void UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool defense); @@ -1954,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(); @@ -2454,7 +2456,6 @@ class TC_GAME_API Player : public Unit, public GridObject<Player> WorldSession* m_session; - typedef std::list<Channel*> JoinedChannelsList; JoinedChannelsList m_channels; uint8 m_cinematic; 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 4dcb9a505ea..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; @@ -2086,15 +2091,56 @@ void Unit::AttackerStateUpdate(Unit* victim, WeaponAttackType attType, bool extr } } +void Unit::FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType /*= BASE_ATTACK*/) +{ + if (HasUnitState(UNIT_STATE_CANNOT_AUTOATTACK) || HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED)) + return; + + if (!victim->IsAlive()) + return; + + if ((attType == BASE_ATTACK || attType == OFF_ATTACK) && !IsWithinLOSInMap(victim)) + return; + + CombatStart(victim); + RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_MELEE_ATTACK); + + if (attType != BASE_ATTACK && attType != OFF_ATTACK) + return; // ignore ranged case + + if (GetTypeId() == TYPEID_UNIT && !HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PLAYER_CONTROLLED)) + SetFacingToObject(victim); // update client side facing to face the target (prevents visual glitches when casting untargeted spells) + + CalcDamageInfo damageInfo; + damageInfo.attacker = this; + damageInfo.target = victim; + damageInfo.damageSchoolMask = GetMeleeDamageSchoolMask(); + damageInfo.attackType = attType; + damageInfo.damage = 0; + damageInfo.cleanDamage = 0; + damageInfo.absorb = 0; + damageInfo.resist = 0; + damageInfo.blocked_amount = 0; + + damageInfo.TargetState = VICTIMSTATE_HIT; + damageInfo.HitInfo = HITINFO_AFFECTS_VICTIM | HITINFO_NORMALSWING | HITINFO_FAKE_DAMAGE; + if (attType == OFF_ATTACK) + damageInfo.HitInfo |= HITINFO_OFFHAND; + + damageInfo.procAttacker = PROC_FLAG_NONE; + damageInfo.procVictim = PROC_FLAG_NONE; + damageInfo.hitOutCome = MELEE_HIT_NORMAL; + + SendAttackStateUpdate(&damageInfo); +} + void Unit::HandleProcExtraAttackFor(Unit* victim) { - while (m_extraAttacks > 0) + while (m_extraAttacks) { AttackerStateUpdate(victim, BASE_ATTACK, true); --m_extraAttacks; } - - m_extraAttacks = 0; } MeleeHitOutcome Unit::RollMeleeOutcomeAgainst(Unit const* victim, WeaponAttackType attType) const @@ -2323,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 @@ -2332,13 +2378,8 @@ bool Unit::isSpellBlocked(Unit* victim, SpellInfo const* spellProto, WeaponAttac if (victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION) || victim->HasInArc(float(M_PI), this)) { - // Check creatures flags_extra for disable block - if (victim->GetTypeId() == TYPEID_UNIT && - victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_BLOCK) - return false; - float blockChance = GetUnitBlockChance(attackType, victim); - if (roll_chance_f(blockChance)) + if (blockChance && roll_chance_f(blockChance)) return true; } @@ -2393,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 @@ -2451,7 +2487,7 @@ SpellMissInfo Unit::MeleeSpellHitResult(Unit* victim, SpellInfo const* spellInfo canDodge = false; // only if in front - if (victim->HasInArc(float(M_PI), this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION)) + if (!victim->HasUnitState(UNIT_STATE_CONTROLLED) && (victim->HasInArc(float(M_PI), this) || victim->HasAuraType(SPELL_AURA_IGNORE_HIT_DIRECTION))) { int32 deflect_chance = victim->GetTotalAuraModifier(SPELL_AURA_DEFLECT_SPELLS) * 100; tmp += deflect_chance; @@ -2545,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(); @@ -2588,8 +2624,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo int32 tmp = 10000 - HitChance; - int32 rand = irand(0, 10000); - + int32 rand = irand(0, 9999); if (rand < tmp) return SPELL_MISS_MISS; @@ -2611,10 +2646,7 @@ SpellMissInfo Unit::MagicSpellHitResult(Unit* victim, SpellInfo const* spellInfo } if (hasAura) - { - tmp += victim->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spellInfo->Dispel)) * 100; - tmp += victim->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(spellInfo->Dispel)) * 100; - } + tmp += victim->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, static_cast<int32>(spellInfo->Dispel)) * 100; } // Roll chance @@ -2643,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; @@ -2789,9 +2825,9 @@ float Unit::GetUnitParryChance(WeaponAttackType attType, Unit const* victim) con skillBonus = 0.04f * skillDiff; } } - else if (victim->GetTypeId() == TYPEID_UNIT && !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY)) + else { - if (victim->GetCreatureType() == CREATURE_TYPE_HUMANOID) + if (!victim->IsTotem() && !(victim->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_NO_PARRY)) { chance = 5.0f; chance += victim->GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT); @@ -2869,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; @@ -3264,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 @@ -5210,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); @@ -5303,8 +5342,8 @@ void Unit::SendAttackStateUpdate(CalcDamageInfo* damageInfo) { TC_LOG_DEBUG("entities.unit", "WORLD: Sending SMSG_ATTACKERSTATEUPDATE"); - uint32 count = 1; - size_t maxsize = 4+5+5+4+4+1+4+4+4+4+4+1+4+4+4+4+4*12; + uint32 const count = 1; + size_t const maxsize = 4+5+5+4+4+1+4+4+4+4+4+1+4+4+4+4+4*12; WorldPacket data(SMSG_ATTACKERSTATEUPDATE, maxsize); // we guess size data << uint32(damageInfo->HitInfo); data << damageInfo->attacker->GetPackGUID(); @@ -5439,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; } @@ -5494,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) @@ -5873,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; } } } @@ -6558,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()); @@ -6648,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: @@ -6661,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; } } @@ -6677,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) { @@ -6721,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); } @@ -6755,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(); @@ -7151,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) { @@ -7166,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; } @@ -7502,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) @@ -7523,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()); @@ -7536,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 @@ -7590,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); } @@ -7825,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; @@ -7844,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; @@ -7872,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; @@ -7902,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; @@ -7914,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; @@ -7933,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; } @@ -7943,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; } @@ -7960,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; @@ -8037,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 @@ -8053,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) @@ -8292,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) + auto bounds = m_spellImmune[op].equal_range(type); + for (auto itr = bounds.first; itr != bounds.second;) { - 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();) - { - 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; } @@ -8655,14 +8668,26 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo || (target->GetTypeId() == TYPEID_PLAYER && target->ToPlayer()->IsGameMaster())) return false; - // can't attack own vehicle or passenger - if (m_vehicle) - if (IsOnVehicle(target) || m_vehicle->GetBase()->IsOnVehicle(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)); - // 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; + if (!CanSeeOrDetect(target, ignoreStealthCheck)) + return false; + } + } + } // can't attack dead if ((!bySpell || !bySpell->IsAllowingDeadTarget()) && !target->IsAlive()) @@ -8693,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; @@ -8701,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; @@ -8738,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; } @@ -9729,63 +9751,53 @@ void Unit::ModSpellDurationTime(SpellInfo const* spellInfo, int32 & duration, Sp DiminishingLevels Unit::GetDiminishing(DiminishingGroup group) { - for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) - { - if (i->DRGroup != group) - continue; - - if (!i->hitCount) - return DIMINISHING_LEVEL_1; - - if (!i->hitTime) - return DIMINISHING_LEVEL_1; + DiminishingReturn& diminish = m_Diminishing[group]; + if (!diminish.hitCount) + return DIMINISHING_LEVEL_1; - // If last spell was cast more than 15 seconds ago - reset the count. - if (i->stack == 0 && getMSTimeDiff(i->hitTime, getMSTime()) > 15000) - { - i->hitCount = DIMINISHING_LEVEL_1; - return DIMINISHING_LEVEL_1; - } - // or else increase the count. - else - return DiminishingLevels(i->hitCount); + // If last spell was cast more than 15 seconds ago - reset the count. + if (!diminish.stack && GetMSTimeDiffToNow(diminish.hitTime) > 15000) + { + diminish.hitCount = DIMINISHING_LEVEL_1; + return DIMINISHING_LEVEL_1; } - return DIMINISHING_LEVEL_1; + + return DiminishingLevels(diminish.hitCount); } -void Unit::IncrDiminishing(DiminishingGroup group) +void Unit::IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered) { + DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); + DiminishingLevels const maxLevel = auraSpellInfo->GetDiminishingReturnsMaxLevel(triggered); + // Checking for existing in the table - for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) - { - if (i->DRGroup != group) - continue; - if (int32(i->hitCount) < GetDiminishingReturnsMaxLevel(group)) - i->hitCount += 1; - return; - } - m_Diminishing.push_back(DiminishingReturn(group, getMSTime(), DIMINISHING_LEVEL_2)); + DiminishingReturn& diminish = m_Diminishing[group]; + if (static_cast<int32>(diminish.hitCount) < maxLevel) + ++diminish.hitCount; } -float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration) +float Unit::ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel) { + DiminishingGroup const group = auraSpellInfo->GetDiminishingReturnsGroupForSpell(triggered); if (duration == -1 || group == DIMINISHING_NONE) return 1.0f; + int32 const limitDuration = auraSpellInfo->GetDiminishingReturnsLimitDuration(triggered); + // test pet/charm masters instead pets/charmeds - Unit const* tarGetOwner = GetCharmerOrOwner(); + Unit const* targetOwner = GetCharmerOrOwner(); Unit const* casterOwner = caster->GetCharmerOrOwner(); // Duration of crowd control abilities on pvp target is limited by 10 sec. (2.2.0) - if (limitduration > 0 && duration > limitduration) + if (limitDuration > 0 && duration > limitDuration) { - Unit const* target = tarGetOwner ? tarGetOwner : this; + Unit const* target = targetOwner ? targetOwner : this; Unit const* source = casterOwner ? casterOwner : caster; if ((target->GetTypeId() == TYPEID_PLAYER || target->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH) && source->GetTypeId() == TYPEID_PLAYER) - duration = limitduration; + duration = limitDuration; } float mod = 1.0f; @@ -9794,7 +9806,7 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, { if (GetTypeId() == TYPEID_UNIT && (ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_TAUNT_DIMINISH)) { - DiminishingLevels diminish = Level; + DiminishingLevels diminish = previousLevel; switch (diminish) { case DIMINISHING_LEVEL_1: break; @@ -9807,12 +9819,12 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, } } // Some diminishings applies to mobs too (for example, Stun) - else if ((GetDiminishingReturnsGroupType(group) == DRTYPE_PLAYER - && ((tarGetOwner ? (tarGetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) + else if ((auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_PLAYER + && ((targetOwner ? (targetOwner->GetTypeId() == TYPEID_PLAYER) : (GetTypeId() == TYPEID_PLAYER)) || (GetTypeId() == TYPEID_UNIT && ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) - || GetDiminishingReturnsGroupType(group) == DRTYPE_ALL) + || auraSpellInfo->GetDiminishingReturnsGroupType(triggered) == DRTYPE_ALL) { - DiminishingLevels diminish = Level; + DiminishingLevels diminish = previousLevel; switch (diminish) { case DIMINISHING_LEVEL_1: break; @@ -9830,24 +9842,26 @@ float Unit::ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, void Unit::ApplyDiminishingAura(DiminishingGroup group, bool apply) { // Checking for existing in the table - for (Diminishing::iterator i = m_Diminishing.begin(); i != m_Diminishing.end(); ++i) + DiminishingReturn& diminish = m_Diminishing[group]; + + if (apply) + ++diminish.stack; + else if (diminish.stack) { - if (i->DRGroup != group) - continue; + --diminish.stack; - if (apply) - i->stack += 1; - else if (i->stack) - { - i->stack -= 1; - // Remember time after last aura from group removed - if (i->stack == 0) - i->hitTime = getMSTime(); - } - break; + // Remember time after last aura from group removed + if (!diminish.stack) + diminish.hitTime = getMSTime(); } } +void Unit::ClearDiminishings() +{ + for (uint32 i = 0; i < DIMINISHING_MAX; ++i) + m_Diminishing[i].Clear(); +} + float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const { if (!spellInfo->RangeEntry) @@ -10777,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; @@ -10797,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; } @@ -10805,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; @@ -10902,10 +10930,10 @@ 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(std::make_pair(procEffectMask, aurApp)); + aurasTriggeringProc.emplace_back(procEffectMask, aurApp); } } } @@ -10914,10 +10942,10 @@ 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(std::make_pair(procEffectMask, itr->second)); + aurasTriggeringProc.emplace_back(procEffectMask, itr->second); } } } @@ -10933,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); @@ -10952,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; @@ -10970,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 @@ -11419,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; } } @@ -12466,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 @@ -12485,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 aee3d783868..917e5d24c79 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -324,20 +324,21 @@ enum HitInfo HITINFO_FULL_RESIST = 0x00000080, HITINFO_PARTIAL_RESIST = 0x00000100, HITINFO_CRITICALHIT = 0x00000200, // critical hit - // 0x00000400 - // 0x00000800 - // 0x00001000 + HITINFO_UNK10 = 0x00000400, + HITINFO_UNK11 = 0x00000800, + HITINFO_UNK12 = 0x00001000, HITINFO_BLOCK = 0x00002000, // blocked damage - // 0x00004000 // Hides worldtext for 0 damage - // 0x00008000 // Related to blood visual + HITINFO_UNK14 = 0x00004000, // set only if meleespellid is present// no world text when victim is hit for 0 dmg(HideWorldTextForNoDamage?) + HITINFO_UNK15 = 0x00008000, // player victim?// something related to blod sprut visual (BloodSpurtInBack?) HITINFO_GLANCING = 0x00010000, HITINFO_CRUSHING = 0x00020000, HITINFO_NO_ANIMATION = 0x00040000, - // 0x00080000 - // 0x00100000 + HITINFO_UNK19 = 0x00080000, + HITINFO_UNK20 = 0x00100000, HITINFO_SWINGNOHITSOUND = 0x00200000, // unused? - // 0x00400000 - HITINFO_RAGE_GAIN = 0x00800000 + HITINFO_UNK22 = 0x00400000, + HITINFO_RAGE_GAIN = 0x00800000, + HITINFO_FAKE_DAMAGE = 0x01000000 // enables damage animation even if no damage done, set only if no damage }; //i would like to remove this: (it is defined in item.h @@ -376,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 { @@ -424,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 @@ -801,11 +802,15 @@ namespace Movement{ struct DiminishingReturn { - DiminishingReturn(DiminishingGroup group, uint32 t, uint32 count) - : DRGroup(group), stack(0), hitTime(t), hitCount(count) - { } + DiminishingReturn() : stack(0), hitTime(0), hitCount(DIMINISHING_LEVEL_1) { } + + void Clear() + { + stack = 0; + hitTime = 0; + hitCount = DIMINISHING_LEVEL_1; + } - DiminishingGroup DRGroup; uint16 stack; uint32 hitTime; uint32 hitCount; @@ -978,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; @@ -995,6 +1000,7 @@ struct TC_GAME_API SpellNonMeleeDamage uint32 HitInfo; // Used for help uint32 cleanDamage; + bool fullBlock; }; struct SpellPeriodicAuraLogInfo @@ -1255,9 +1261,9 @@ class TC_GAME_API Unit : public WorldObject typedef std::list<AuraEffect*> AuraEffectList; typedef std::list<Aura*> AuraList; typedef std::list<AuraApplication *> AuraApplicationList; - typedef std::list<DiminishingReturn> Diminishing; + typedef std::array<DiminishingReturn, DIMINISHING_MAX> Diminishing; - typedef std::deque<std::pair<uint8 /*procEffectMask*/, AuraApplication*>> AuraApplicationProcContainer; + typedef std::vector<std::pair<uint8 /*procEffectMask*/, AuraApplication*>> AuraApplicationProcContainer; typedef std::map<uint8, AuraApplication*> VisibleAuraMap; @@ -1272,11 +1278,11 @@ class TC_GAME_API Unit : public WorldObject void CleanupBeforeRemoveFromMap(bool finalCleanup); void CleanupsBeforeDelete(bool finalCleanup = true) override; // used in ~Creature/~Player (or before mass creature delete to remove cross-references to already deleted units) - DiminishingLevels GetDiminishing(DiminishingGroup group); - void IncrDiminishing(DiminishingGroup group); - float ApplyDiminishingToDuration(DiminishingGroup group, int32 &duration, Unit* caster, DiminishingLevels Level, int32 limitduration); - void ApplyDiminishingAura(DiminishingGroup group, bool apply); - void ClearDiminishings() { m_Diminishing.clear(); } + DiminishingLevels GetDiminishing(DiminishingGroup group); + void IncrDiminishing(SpellInfo const* auraSpellInfo, bool triggered); + float ApplyDiminishingToDuration(SpellInfo const* auraSpellInfo, bool triggered, int32& duration, Unit* caster, DiminishingLevels previousLevel); + void ApplyDiminishingAura(DiminishingGroup group, bool apply); + void ClearDiminishings(); // target dependent range checks float GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spellInfo) const; @@ -1296,10 +1302,7 @@ class TC_GAME_API Unit : public WorldObject bool IsWithinMeleeRange(Unit const* obj) const; float GetMeleeRange(Unit const* target) const; void GetRandomContactPoint(const Unit* target, float &x, float &y, float &z, float distance2dMin, float distance2dMax) const; - - bool HasExtraAttacksPending() const { return m_extraAttacks > 0; } - void SetExtraAttacks(uint32 val) { m_extraAttacks = static_cast<int32>(val); } - + uint32 m_extraAttacks; bool m_canDualWield; void _addAttacker(Unit* pAttacker); // must be called only from Unit::Attack(Unit*) @@ -1431,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); } @@ -1450,6 +1453,7 @@ class TC_GAME_API Unit : public WorldObject void HandleEmoteCommand(uint32 anim_id); void AttackerStateUpdate (Unit* victim, WeaponAttackType attType = BASE_ATTACK, bool extra = false); + void FakeAttackerStateUpdate(Unit* victim, WeaponAttackType attType = BASE_ATTACK); void CalculateMeleeDamage(Unit* victim, uint32 damage, CalcDamageInfo* damageInfo, WeaponAttackType attackType = BASE_ATTACK); void DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss); @@ -1557,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); @@ -1933,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 @@ -2018,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; @@ -2030,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; @@ -2288,8 +2291,6 @@ class TC_GAME_API Unit : public WorldObject uint32 m_lastManaUse; // msecs TimeTrackerSmall m_movesplineTimer; - int32 m_extraAttacks; - Diminishing m_Diminishing; // Manage all Units that are threatened by us HostileRefManager m_HostileRefManager; diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp index 781d30f148d..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; @@ -2545,23 +2548,23 @@ void ObjectMgr::LoadItemTemplates() itemTemplate.Quality = ITEM_QUALITY_NORMAL; } - if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) + if (itemTemplate.Flags2 & ITEM_FLAG2_FACTION_HORDE) { if (FactionEntry const* faction = sFactionStore.LookupEntry(HORDE)) if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", - entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_HORDE_ONLY); + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAG2_FACTION_HORDE (%u) in Flags field, item cannot be equipped or used by these races.", + entry, itemTemplate.AllowableRace, ITEM_FLAG2_FACTION_HORDE); - if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) and ITEM_FLAGS_EXTRA_HORDE_ONLY (%u) in Flags field, this is a wrong combination.", - entry, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY, ITEM_FLAGS_EXTRA_HORDE_ONLY); + if (itemTemplate.Flags2 & ITEM_FLAG2_FACTION_ALLIANCE) + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `Flags2` flags (ITEM_FLAG2_FACTION_ALLIANCE) and ITEM_FLAG2_FACTION_HORDE (%u) in Flags field, this is a wrong combination.", + entry, ITEM_FLAG2_FACTION_ALLIANCE, ITEM_FLAG2_FACTION_HORDE); } - else if (itemTemplate.Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) + else if (itemTemplate.Flags2 & ITEM_FLAG2_FACTION_ALLIANCE) { if (FactionEntry const* faction = sFactionStore.LookupEntry(ALLIANCE)) if ((itemTemplate.AllowableRace & faction->BaseRepRaceMask[0]) == 0) - TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAGS_EXTRA_ALLIANCE_ONLY (%u) in Flags field, item cannot be equipped or used by these races.", - entry, itemTemplate.AllowableRace, ITEM_FLAGS_EXTRA_ALLIANCE_ONLY); + TC_LOG_ERROR("sql.sql", "Item (Entry: %u) has value (%u) in `AllowableRace` races, not compatible with ITEM_FLAG2_FACTION_ALLIANCE (%u) in Flags field, item cannot be equipped or used by these races.", + entry, itemTemplate.AllowableRace, ITEM_FLAG2_FACTION_ALLIANCE); } if (itemTemplate.BuyCount <= 0) diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index ea0a4da8d62..a30d92ad68a 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -428,7 +428,7 @@ struct BroadcastText std::string const& GetText(LocaleConstant locale = DEFAULT_LOCALE, uint8 gender = GENDER_MALE, bool forceGender = false) const { - if (gender == GENDER_FEMALE && (forceGender || !FemaleText[DEFAULT_LOCALE].empty())) + if ((gender == GENDER_FEMALE || gender == GENDER_NONE) && (forceGender || !FemaleText[DEFAULT_LOCALE].empty())) { if (FemaleText.size() > size_t(locale) && !FemaleText[locale].empty()) return FemaleText[locale]; diff --git a/src/server/game/Grids/GridRefManager.h b/src/server/game/Grids/GridRefManager.h index 755417d873d..ceaf632aa63 100644 --- a/src/server/game/Grids/GridRefManager.h +++ b/src/server/game/Grids/GridRefManager.h @@ -35,8 +35,6 @@ class GridRefManager : public RefManager<GridRefManager<OBJECT>, OBJECT> iterator begin() { return iterator(getFirst()); } iterator end() { return iterator(NULL); } - iterator rbegin() { return iterator(getLast()); } - iterator rend() { return iterator(NULL); } }; #endif diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h index 8304054c663..ac153f31b8e 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiers.h +++ b/src/server/game/Grids/Notifiers/GridNotifiers.h @@ -170,6 +170,31 @@ namespace Trinity // WorldObject searchers & workers + // Generic base class to insert elements into arbitrary containers using push_back + template<typename Type> + class ContainerInserter { + using InserterType = void(*)(void*, Type&&); + + void* ref; + InserterType inserter; + + // MSVC workaround + template<typename T> + static void InserterOf(void* ref, Type&& type) + { + static_cast<T*>(ref)->push_back(std::move(type)); + } + + protected: + template<typename T> + ContainerInserter(T& ref_) : ref(&ref_), inserter(&InserterOf<T>) { } + + void Insert(Type type) + { + inserter(ref, std::move(type)); + } + }; + template<class Check> struct WorldObjectSearcher { @@ -211,15 +236,16 @@ namespace Trinity }; template<class Check> - struct WorldObjectListSearcher + struct WorldObjectListSearcher : ContainerInserter<WorldObject*> { uint32 i_mapTypeMask; uint32 i_phaseMask; - std::list<WorldObject*> &i_objects; Check& i_check; - WorldObjectListSearcher(WorldObject const* searcher, std::list<WorldObject*> &objects, Check & check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL) - : i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) { } + template<typename Container> + WorldObjectListSearcher(WorldObject const* searcher, Container& container, Check & check, uint32 mapTypeMask = GRID_MAP_TYPE_MASK_ALL) + : ContainerInserter<WorldObject*>(container), + i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_check(check) { } void Visit(PlayerMapType &m); void Visit(CreatureMapType &m); @@ -321,14 +347,15 @@ namespace Trinity }; template<class Check> - struct GameObjectListSearcher + struct GameObjectListSearcher : ContainerInserter<GameObject*> { uint32 i_phaseMask; - std::list<GameObject*> &i_objects; Check& i_check; - GameObjectListSearcher(WorldObject const* searcher, std::list<GameObject*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) { } + template<typename Container> + GameObjectListSearcher(WorldObject const* searcher, Container& container, Check & check) + : ContainerInserter<GameObject*>(container), + i_phaseMask(searcher->GetPhaseMask()), i_check(check) { } void Visit(GameObjectMapType &m); @@ -393,14 +420,15 @@ namespace Trinity // All accepted by Check units if any template<class Check> - struct UnitListSearcher + struct UnitListSearcher : ContainerInserter<Unit*> { uint32 i_phaseMask; - std::list<Unit*> &i_objects; Check& i_check; - UnitListSearcher(WorldObject const* searcher, std::list<Unit*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) { } + template<typename Container> + UnitListSearcher(WorldObject const* searcher, Container& container, Check& check) + : ContainerInserter<Unit*>(container), + i_phaseMask(searcher->GetPhaseMask()), i_check(check) { } void Visit(PlayerMapType &m); void Visit(CreatureMapType &m); @@ -442,14 +470,15 @@ namespace Trinity }; template<class Check> - struct CreatureListSearcher + struct CreatureListSearcher : ContainerInserter<Creature*> { uint32 i_phaseMask; - std::list<Creature*> &i_objects; Check& i_check; - CreatureListSearcher(WorldObject const* searcher, std::list<Creature*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) { } + template<typename Container> + CreatureListSearcher(WorldObject const* searcher, Container& container, Check & check) + : ContainerInserter<Creature*>(container), + i_phaseMask(searcher->GetPhaseMask()), i_check(check) { } void Visit(CreatureMapType &m); @@ -493,14 +522,15 @@ namespace Trinity }; template<class Check> - struct PlayerListSearcher + struct PlayerListSearcher : ContainerInserter<Player*> { uint32 i_phaseMask; - std::list<Player*> &i_objects; Check& i_check; - PlayerListSearcher(WorldObject const* searcher, std::list<Player*> &objects, Check & check) - : i_phaseMask(searcher->GetPhaseMask()), i_objects(objects), i_check(check) { } + template<typename Container> + PlayerListSearcher(WorldObject const* searcher, Container& container, Check & check) + : ContainerInserter<Player*>(container), + i_phaseMask(searcher->GetPhaseMask()), i_check(check) { } void Visit(PlayerMapType &m); @@ -612,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) @@ -627,6 +658,7 @@ namespace Trinity return go->IsWithinDistInMap(i_unit, dist); } + private: Unit const* i_unit; uint32 i_focusId; @@ -637,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)) @@ -646,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)) @@ -668,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) @@ -682,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)) @@ -691,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 @@ -731,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) @@ -740,6 +777,7 @@ namespace Trinity } return false; } + private: Unit const* i_obj; float i_range; @@ -750,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))) @@ -759,6 +798,7 @@ namespace Trinity } return false; } + private: Unit const* i_obj; float i_range; @@ -768,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; @@ -787,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()) @@ -812,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; @@ -830,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; @@ -847,10 +897,14 @@ namespace Trinity class AnyGroupedUnitInObjectRangeCheck { public: - AnyGroupedUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range, bool raid) : _source(obj), _refUnit(funit), _range(range), _raid(raid) { } - bool operator()(Unit* u) + 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) const { - if (G3D::fuzzyEq(_range, 0)) + if (G3D::fuzzyEq(_range, 0.0f)) + return false; + + if (_playerOnly && u->GetTypeId() != TYPEID_PLAYER) return false; if (_raid) @@ -869,19 +923,22 @@ namespace Trinity Unit const* _refUnit; float _range; bool _raid; + bool _playerOnly; }; class AnyUnitInObjectRangeCheck { 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; @@ -892,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) && @@ -903,42 +961,40 @@ 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 { public: - AnyAoETargetUnitInObjectRangeCheck(WorldObject const* obj, Unit const* funit, float range) - : i_obj(obj), i_funit(funit), _spellInfo(NULL), i_range(range) + 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 (DynamicObject const* dynObj = i_obj->ToDynObject()) - _spellInfo = sSpellMgr->GetSpellInfo(dynObj->GetSpellId()); + 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()) return false; - if (i_funit->_IsValidAttackTarget(u, _spellInfo, i_obj->GetTypeId() == TYPEID_DYNAMICOBJECT ? i_obj : NULL) && i_obj->IsWithinDistInMap(u, i_range)) - return true; + if (_spellInfo && _spellInfo->HasAttribute(SPELL_ATTR3_ONLY_TARGET_PLAYERS) && u->GetTypeId() != TYPEID_PLAYER) + return false; - return false; + 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; @@ -950,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; @@ -977,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)) @@ -1013,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)) @@ -1047,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; @@ -1078,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; @@ -1109,6 +1153,7 @@ namespace Trinity return true; } + private: Unit* const i_funit; Unit* const i_enemy; @@ -1137,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) @@ -1163,7 +1208,7 @@ namespace Trinity } return false; } - float GetLastRange() const { return i_range; } + private: WorldObject const& i_obj; uint32 i_entry; @@ -1171,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; @@ -1198,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) { @@ -1216,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; @@ -1264,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; } @@ -1334,7 +1389,8 @@ namespace Trinity { public: ObjectGUIDCheck(ObjectGuid GUID) : _GUID(GUID) { } - bool operator()(WorldObject* object) + + bool operator()(WorldObject* object) const { return object->GetGUID() == _GUID; } @@ -1347,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; @@ -1377,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/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h index 340531c5883..5a3f41e5351 100644 --- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h +++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h @@ -246,7 +246,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m) for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> @@ -257,7 +257,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m) for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> @@ -268,7 +268,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m) for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> @@ -279,7 +279,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m) for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> @@ -290,7 +290,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m) for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } // Gameobject searchers @@ -334,7 +334,7 @@ void Trinity::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m) for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->GetSource()->InSamePhase(i_phaseMask)) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } // Unit searchers @@ -411,7 +411,7 @@ void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m) for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->GetSource()->InSamePhase(i_phaseMask)) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> @@ -420,7 +420,7 @@ void Trinity::UnitListSearcher<Check>::Visit(CreatureMapType &m) for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->GetSource()->InSamePhase(i_phaseMask)) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } // Creature searchers @@ -464,7 +464,7 @@ void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m) for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->GetSource()->InSamePhase(i_phaseMask)) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> @@ -473,7 +473,7 @@ void Trinity::PlayerListSearcher<Check>::Visit(PlayerMapType &m) for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr) if (itr->GetSource()->InSamePhase(i_phaseMask)) if (i_check(itr->GetSource())) - i_objects.push_back(itr->GetSource()); + Insert(itr->GetSource()); } template<class Check> diff --git a/src/server/game/Groups/Group.cpp b/src/server/game/Groups/Group.cpp index ccfd4845dc3..e99ee78991d 100644 --- a/src/server/game/Groups/Group.cpp +++ b/src/server/game/Groups/Group.cpp @@ -1154,7 +1154,7 @@ void Group::NeedBeforeGreed(Loot* loot, WorldObject* lootedObject) if (item->DisenchantID && m_maxEnchantingLevel >= item->RequiredDisenchantSkill) r->rollVoteMask |= ROLL_FLAG_TYPE_DISENCHANT; - if (item->Flags2 & ITEM_FLAGS_EXTRA_NEED_ROLL_DISABLED) + if (item->Flags2 & ITEM_FLAG2_CAN_ONLY_ROLL_GREED) r->rollVoteMask &= ~ROLL_FLAG_TYPE_NEED; loot->items[itemSlot].is_blocked = true; 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/AuctionHouseHandler.cpp b/src/server/game/Handlers/AuctionHouseHandler.cpp index 71242d57f33..2c5eddcefdc 100644 --- a/src/server/game/Handlers/AuctionHouseHandler.cpp +++ b/src/server/game/Handlers/AuctionHouseHandler.cpp @@ -202,7 +202,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket& recvData) itemEntry = item->GetTemplate()->ItemId; if (sAuctionMgr->GetAItem(item->GetGUID().GetCounter()) || !item->CanBeTraded() || item->IsNotEmptyBag() || - item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION) || + (item->GetTemplate()->Flags & ITEM_FLAG_CONJURED) || item->GetUInt32Value(ITEM_FIELD_DURATION) || item->GetCount() < count[i] || itemEntry != item->GetTemplate()->ItemId) { SendAuctionCommandResult(0, AUCTION_SELL_ITEM, ERR_AUCTION_DATABASE_ERROR); diff --git a/src/server/game/Handlers/ChannelHandler.cpp b/src/server/game/Handlers/ChannelHandler.cpp index 9285f4247b2..71cdddcebf5 100644 --- a/src/server/game/Handlers/ChannelHandler.cpp +++ b/src/server/game/Handlers/ChannelHandler.cpp @@ -17,11 +17,15 @@ */ #include "ObjectMgr.h" // for normalizePlayerName +#include "Channel.h" #include "ChannelMgr.h" #include "Player.h" +#include "WorldSession.h" #include <cctype> +static size_t const MAX_CHANNEL_PASS_STR = 31; + void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) { uint32 channelId; @@ -33,13 +37,13 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) TC_LOG_DEBUG("chat.system", "CMSG_JOIN_CHANNEL %s Channel: %u, unk1: %u, unk2: %u, channel: %s, password: %s", GetPlayerInfo().c_str(), channelId, unknown1, unknown2, channelName.c_str(), password.c_str()); + AreaTableEntry const* zone = sAreaTableStore.LookupEntry(GetPlayer()->GetZoneId()); if (channelId) { ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channelId); if (!channel) return; - AreaTableEntry const* zone = sAreaTableStore.LookupEntry(GetPlayer()->GetZoneId()); if (!zone || !GetPlayer()->CanJoinConstantChannelInZone(channel, zone)) return; } @@ -51,30 +55,42 @@ void WorldSession::HandleJoinChannel(WorldPacket& recvPacket) return; if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - { - cMgr->setTeam(GetPlayer()->GetTeam()); - if (Channel* channel = cMgr->GetJoinChannel(channelName, channelId)) + if (Channel* channel = cMgr->GetJoinChannel(channelId, channelName, zone)) channel->JoinChannel(GetPlayer(), password); - } } void WorldSession::HandleLeaveChannel(WorldPacket& recvPacket) { - uint32 unk; + uint32 channelId; std::string channelName; - recvPacket >> unk >> channelName; + recvPacket >> channelId >> channelName; - TC_LOG_DEBUG("chat.system", "CMSG_LEAVE_CHANNEL %s Channel: %s, unk1: %u", - GetPlayerInfo().c_str(), channelName.c_str(), unk); + TC_LOG_DEBUG("chat.system", "CMSG_LEAVE_CHANNEL %s Channel: %s, channelId: %u", + GetPlayerInfo().c_str(), channelName.c_str(), channelId); - if (channelName.empty()) + if (channelName.empty() && !channelId) return; + AreaTableEntry const* zone = sAreaTableStore.LookupEntry(GetPlayer()->GetZoneId()); + if (channelId) + { + ChatChannelsEntry const* channel = sChatChannelsStore.LookupEntry(channelId); + if (!channel) + return; + + if (!zone || !GetPlayer()->CanJoinConstantChannelInZone(channel, zone)) + return; + } + if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) { - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) + if (Channel* channel = cMgr->GetChannel(channelId, channelName, GetPlayer(), true, zone)) channel->LeaveChannel(GetPlayer(), true); - cMgr->LeftChannel(channelName); + + if (channelId) + cMgr->LeftChannel(channelId, zone); + else + cMgr->LeftChannel(channelName); } } @@ -87,9 +103,8 @@ void WorldSession::HandleChannelList(WorldPacket& recvPacket) recvPacket.GetOpcode() == CMSG_CHANNEL_DISPLAY_LIST ? "CMSG_CHANNEL_DISPLAY_LIST" : "CMSG_CHANNEL_LIST", GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->List(GetPlayer()); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->List(GetPlayer()); } void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) @@ -103,9 +118,8 @@ void WorldSession::HandleChannelPassword(WorldPacket& recvPacket) if (password.length() > MAX_CHANNEL_PASS_STR) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->Password(GetPlayer(), password); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->Password(GetPlayer(), password); } void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) @@ -119,9 +133,8 @@ void WorldSession::HandleChannelSetOwner(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->SetOwner(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->SetOwner(GetPlayer(), targetName); } void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) @@ -132,9 +145,8 @@ void WorldSession::HandleChannelOwner(WorldPacket& recvPacket) TC_LOG_DEBUG("chat.system", "CMSG_CHANNEL_OWNER %s Channel: %s", GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->SendWhoOwner(GetPlayer()->GetGUID()); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->SendWhoOwner(GetPlayer()->GetGUID()); } void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) @@ -148,9 +160,8 @@ void WorldSession::HandleChannelModerator(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->SetModerator(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->SetModerator(GetPlayer(), targetName); } void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) @@ -164,9 +175,8 @@ void WorldSession::HandleChannelUnmoderator(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->UnsetModerator(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->UnsetModerator(GetPlayer(), targetName); } void WorldSession::HandleChannelMute(WorldPacket& recvPacket) @@ -180,9 +190,8 @@ void WorldSession::HandleChannelMute(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->SetMute(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->SetMute(GetPlayer(), targetName); } void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) @@ -196,9 +205,8 @@ void WorldSession::HandleChannelUnmute(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->UnsetMute(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->UnsetMute(GetPlayer(), targetName); } void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) @@ -212,9 +220,8 @@ void WorldSession::HandleChannelInvite(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->Invite(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->Invite(GetPlayer(), targetName); } void WorldSession::HandleChannelKick(WorldPacket& recvPacket) @@ -228,9 +235,8 @@ void WorldSession::HandleChannelKick(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->Kick(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->Kick(GetPlayer(), targetName); } void WorldSession::HandleChannelBan(WorldPacket& recvPacket) @@ -244,9 +250,8 @@ void WorldSession::HandleChannelBan(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->Ban(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->Ban(GetPlayer(), targetName); } void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) @@ -260,9 +265,8 @@ void WorldSession::HandleChannelUnban(WorldPacket& recvPacket) if (!normalizePlayerName(targetName)) return; - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->UnBan(GetPlayer(), targetName); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->UnBan(GetPlayer(), targetName); } void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) @@ -273,9 +277,8 @@ void WorldSession::HandleChannelAnnouncements(WorldPacket& recvPacket) TC_LOG_DEBUG("chat.system", "CMSG_CHANNEL_ANNOUNCEMENTS %s Channel: %s", GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->Announce(GetPlayer()); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->Announce(GetPlayer()); } void WorldSession::HandleChannelDisplayListQuery(WorldPacket &recvPacket) @@ -292,19 +295,17 @@ void WorldSession::HandleGetChannelMemberCount(WorldPacket &recvPacket) TC_LOG_DEBUG("chat.system", "CMSG_GET_CHANNEL_MEMBER_COUNT %s Channel: %s", GetPlayerInfo().c_str(), channelName.c_str()); - if (ChannelMgr* cMgr = ChannelMgr::forTeam(GetPlayer()->GetTeam())) + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) { - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - { - TC_LOG_DEBUG("chat.system", "SMSG_CHANNEL_MEMBER_COUNT %s Channel: %s Count: %u", - GetPlayerInfo().c_str(), channelName.c_str(), channel->GetNumPlayers()); - - WorldPacket data(SMSG_CHANNEL_MEMBER_COUNT, channel->GetName().size() + 1 + 4); - data << channel->GetName(); - data << uint8(channel->GetFlags()); - data << uint32(channel->GetNumPlayers()); - SendPacket(&data); - } + TC_LOG_DEBUG("chat.system", "SMSG_CHANNEL_MEMBER_COUNT %s Channel: %s Count: %u", + GetPlayerInfo().c_str(), channelName.c_str(), channel->GetNumPlayers()); + + std::string name = channel->GetName(GetSessionDbcLocale()); + WorldPacket data(SMSG_CHANNEL_MEMBER_COUNT, name.size() + 1 + 4); + data << name; + data << uint8(channel->GetFlags()); + data << uint32(channel->GetNumPlayers()); + SendPacket(&data); } } @@ -317,8 +318,7 @@ void WorldSession::HandleSetChannelWatch(WorldPacket &recvPacket) GetPlayerInfo().c_str(), channelName.c_str()); /* - if (ChannelMgr* cMgr = channelMgr(GetPlayer()->GetTeam())) - if (Channel* channel = cMgr->GetChannel(channelName, GetPlayer())) - channel->JoinNotify(GetPlayer()); + if (Channel* channel = ChannelMgr::GetChannelForPlayerByNamePart(channelName, GetPlayer())) + channel->JoinNotify(GetPlayer()); */ } 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/ChatHandler.cpp b/src/server/game/Handlers/ChatHandler.cpp index 2b1660fef2b..ba5164f9be5 100644 --- a/src/server/game/Handlers/ChatHandler.cpp +++ b/src/server/game/Handlers/ChatHandler.cpp @@ -26,6 +26,7 @@ #include "DatabaseEnv.h" #include "CellImpl.h" #include "Chat.h" +#include "Channel.h" #include "ChannelMgr.h" #include "GridNotifiersImpl.h" #include "Group.h" @@ -461,13 +462,10 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData) } } - if (ChannelMgr* cMgr = ChannelMgr::forTeam(sender->GetTeam())) + if (Channel* chn = ChannelMgr::GetChannelForPlayerByNamePart(channel, sender)) { - if (Channel* chn = cMgr->GetChannel(channel, sender)) - { - sScriptMgr->OnPlayerChat(sender, type, lang, msg, chn); - chn->Say(sender->GetGUID(), msg.c_str(), lang); - } + sScriptMgr->OnPlayerChat(sender, type, lang, msg, chn); + chn->Say(sender->GetGUID(), msg.c_str(), lang); } break; } diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index bb188b08fbc..8f9a3ba6ffc 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -284,7 +284,7 @@ void WorldSession::HandleDestroyItemOpcode(WorldPacket& recvData) return; } - if (pItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_INDESTRUCTIBLE) + if (pItem->GetTemplate()->Flags & ITEM_FLAG_NO_USER_DESTROY) { _player->SendEquipError(EQUIP_ERR_CANT_DROP_SOULBOUND, NULL, NULL); return; @@ -542,7 +542,7 @@ void WorldSession::HandleSellItemOpcode(WorldPacket& recvData) // prevent selling item for sellprice when the item is still refundable // this probably happens when right clicking a refundable item, the client sends both // CMSG_SELL_ITEM and CMSG_REFUND_ITEM (unverified) - if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_REFUNDABLE)) + if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_REFUNDABLE)) return; // Therefore, no feedback to client // special case at auto sell (sell all) @@ -776,7 +776,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid) continue; // Only display items in vendor lists for the team the // player is on. If GM on, display all items. - if (!_player->IsGameMaster() && ((itemTemplate->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && _player->GetTeam() == ALLIANCE) || (itemTemplate->Flags2 == ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && _player->GetTeam() == HORDE))) + if (!_player->IsGameMaster() && ((itemTemplate->Flags2 & ITEM_FLAG2_FACTION_HORDE && _player->GetTeam() == ALLIANCE) || (itemTemplate->Flags2 == ITEM_FLAG2_FACTION_ALLIANCE && _player->GetTeam() == HORDE))) continue; // Items sold out are not displayed in list @@ -1093,7 +1093,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) return; } - if (!(gift->GetTemplate()->Flags & ITEM_PROTO_FLAG_IS_WRAPPER)) // cheating: non-wrapper wrapper + if (!(gift->GetTemplate()->Flags & ITEM_FLAG_IS_WRAPPER)) // cheating: non-wrapper wrapper { _player->SendEquipError(EQUIP_ERR_ITEM_NOT_FOUND, gift, NULL); return; @@ -1171,7 +1171,7 @@ void WorldSession::HandleWrapItemOpcode(WorldPacket& recvData) case 21830: item->SetEntry(21831); break; } item->SetGuidValue(ITEM_FIELD_GIFTCREATOR, _player->GetGUID()); - item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED); + item->SetUInt32Value(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED); item->SetState(ITEM_CHANGED, _player); if (item->GetState() == ITEM_NEW) // save new item, to have alway for `character_gifts` record in `item_instance` @@ -1272,7 +1272,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recvData) ItemTemplate const* iGemProto = Gems[i]->GetTemplate(); // unique item (for new and already placed bit removed enchantments - if (iGemProto->Flags & ITEM_PROTO_FLAG_UNIQUE_EQUIPPED) + if (iGemProto->Flags & ITEM_FLAG_UNIQUE_EQUIPPABLE) { for (int j = 0; j < MAX_GEM_SOCKETS; ++j) { diff --git a/src/server/game/Handlers/LootHandler.cpp b/src/server/game/Handlers/LootHandler.cpp index d91dd6f495f..94e271465cd 100644 --- a/src/server/game/Handlers/LootHandler.cpp +++ b/src/server/game/Handlers/LootHandler.cpp @@ -322,7 +322,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid) ItemTemplate const* proto = pItem->GetTemplate(); // destroy only 5 items from stack in case prospecting and milling - if (proto->Flags & (ITEM_PROTO_FLAG_PROSPECTABLE | ITEM_PROTO_FLAG_MILLABLE)) + if (proto->Flags & (ITEM_FLAG_IS_PROSPECTABLE | ITEM_FLAG_IS_MILLABLE)) { pItem->m_lootGenerated = false; pItem->loot.clear(); @@ -338,7 +338,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid) else { // Only delete item if no loot or money (unlooted loot is saved to db) or if it isn't an openable item - if (pItem->loot.isLooted() || !(proto->Flags & ITEM_PROTO_FLAG_HAS_LOOT)) + if (pItem->loot.isLooted() || !(proto->Flags & ITEM_FLAG_HAS_LOOT)) player->DestroyItem(pItem->GetBagSlot(), pItem->GetSlot(), true); } return; // item can be looted only single player diff --git a/src/server/game/Handlers/MailHandler.cpp b/src/server/game/Handlers/MailHandler.cpp index 36df5b64f1b..a4dcd22c1f2 100644 --- a/src/server/game/Handlers/MailHandler.cpp +++ b/src/server/game/Handlers/MailHandler.cpp @@ -199,7 +199,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) if (Item* item = player->GetItemByGuid(itemGUIDs[i])) { ItemTemplate const* itemProto = item->GetTemplate(); - if (!itemProto || !(itemProto->Flags & ITEM_PROTO_FLAG_BIND_TO_ACCOUNT)) + if (!itemProto || !(itemProto->Flags & ITEM_FLAG_IS_BOUND_TO_ACCOUNT)) { accountBound = false; break; @@ -250,13 +250,13 @@ void WorldSession::HandleSendMail(WorldPacket& recvData) return; } - if (item->GetTemplate()->Flags & ITEM_PROTO_FLAG_CONJURED || item->GetUInt32Value(ITEM_FIELD_DURATION)) + if ((item->GetTemplate()->Flags & ITEM_FLAG_CONJURED) || item->GetUInt32Value(ITEM_FIELD_DURATION)) { player->SendMailResult(0, MAIL_SEND, MAIL_ERR_EQUIP_ERROR, EQUIP_ERR_MAIL_BOUND_ITEM); return; } - if (COD && item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (COD && item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)) { player->SendMailResult(0, MAIL_SEND, MAIL_ERR_CANT_SEND_WRAPPED_COD); return; 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/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index cbc9be3b140..728fda8d184 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -115,14 +115,14 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) } // only allow conjured consumable, bandage, poisons (all should have the 2^21 item flag set in DB) - if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_PROTO_FLAG_USEABLE_IN_ARENA) && pUser->InArena()) + if (proto->Class == ITEM_CLASS_CONSUMABLE && !(proto->Flags & ITEM_FLAG_IGNORE_DEFAULT_ARENA_RESTRICTIONS) && pUser->InArena()) { pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); return; } // don't allow items banned in arena - if (proto->Flags & ITEM_PROTO_FLAG_NOT_USEABLE_IN_ARENA && pUser->InArena()) + if ((proto->Flags & ITEM_FLAG_NOT_USEABLE_IN_ARENA) && pUser->InArena()) { pUser->SendEquipError(EQUIP_ERR_NOT_DURING_ARENA_MATCH, pItem, NULL); return; @@ -196,7 +196,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) } // Verify that the bag is an actual bag or wrapped item that can be used "normally" - if (!(proto->Flags & ITEM_PROTO_FLAG_HAS_LOOT) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED)) + if (!(proto->Flags & ITEM_FLAG_HAS_LOOT) && !item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED)) { pUser->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL); TC_LOG_ERROR("entities.player.cheat", "Possible hacking attempt: Player %s [guid: %u] tried to open item [guid: %u, entry: %u] which is not openable!", @@ -225,7 +225,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) } } - if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED))// wrapped? + if (item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED))// wrapped? { PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_CHARACTER_GIFT_BY_ITEM); diff --git a/src/server/game/Handlers/TradeHandler.cpp b/src/server/game/Handlers/TradeHandler.cpp index e2743f8f456..6b4d16111ed 100644 --- a/src/server/game/Handlers/TradeHandler.cpp +++ b/src/server/game/Handlers/TradeHandler.cpp @@ -93,7 +93,7 @@ void WorldSession::SendUpdateTrade(bool trader_data /*= true*/) data << uint32(item->GetTemplate()->DisplayInfoID);// display id data << uint32(item->GetCount()); // stack count // wrapped: hide stats but show giftcreator name - data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_WRAPPED) ? 1 : 0); + data << uint32(item->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_WRAPPED) ? 1 : 0); data << uint64(item->GetGuidValue(ITEM_FIELD_GIFTCREATOR)); // perm. enchantment and gems data << uint32(item->GetEnchantmentId(PERM_ENCHANTMENT_SLOT)); @@ -152,7 +152,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) } // adjust time (depends on /played) - if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) + if (myItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE)) myItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, trader->GetTotalPlayedTime()-(_player->GetTotalPlayedTime()-myItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME))); // store trader->MoveItemToInventory(traderDst, myItems[i], true, true); @@ -170,7 +170,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[]) } // adjust time (depends on /played) - if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_BOP_TRADEABLE)) + if (hisItems[i]->HasFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_BOP_TRADEABLE)) hisItems[i]->SetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME, _player->GetTotalPlayedTime()-(trader->GetTotalPlayedTime()-hisItems[i]->GetUInt32Value(ITEM_FIELD_CREATE_PLAYED_TIME))); // store _player->MoveItemToInventory(playerDst, hisItems[i], true, true); diff --git a/src/server/game/Loot/LootMgr.cpp b/src/server/game/Loot/LootMgr.cpp index da50b818341..b69bb41d3ad 100644 --- a/src/server/game/Loot/LootMgr.cpp +++ b/src/server/game/Loot/LootMgr.cpp @@ -353,7 +353,7 @@ LootItem::LootItem(LootStoreItem const& li) conditions = li.conditions; ItemTemplate const* proto = sObjectMgr->GetItemTemplate(itemid); - freeforall = proto && (proto->Flags & ITEM_PROTO_FLAG_MULTI_DROP); + freeforall = proto && (proto->Flags & ITEM_FLAG_MULTI_DROP); follow_loot_rules = proto && (proto->FlagsCu & ITEM_FLAGS_CU_FOLLOW_LOOT_RULES); needs_quest = li.needs_quest; @@ -380,24 +380,20 @@ bool LootItem::AllowedForPlayer(Player const* player) const return false; // not show loot for players without profession or those who already know the recipe - if ((pProto->Flags & ITEM_PROTO_FLAG_SMART_LOOT) && (!player->HasSkill(pProto->RequiredSkill) || player->HasSpell(pProto->Spells[1].SpellId))) + if ((pProto->Flags & ITEM_FLAG_HIDE_UNUSABLE_RECIPE) && (!player->HasSkill(pProto->RequiredSkill) || player->HasSpell(pProto->Spells[1].SpellId))) return false; // not show loot for not own team - if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeam() != HORDE) + if ((pProto->Flags2 & ITEM_FLAG2_FACTION_HORDE) && player->GetTeam() != HORDE) return false; - if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeam() != ALLIANCE) + if ((pProto->Flags2 & ITEM_FLAG2_FACTION_ALLIANCE) && player->GetTeam() != ALLIANCE) return false; // check quest requirements if (!(pProto->FlagsCu & ITEM_FLAGS_CU_IGNORE_QUEST_STATUS) && ((needs_quest || (pProto->StartQuest && player->GetQuestStatus(pProto->StartQuest) != QUEST_STATUS_NONE)) && !player->HasQuestForItem(itemid))) return false; - // Don't show bind-when-picked-up unique items if player already has the maximum allowed quantity. - if (pProto->Bonding == BIND_WHEN_PICKED_UP && pProto->MaxCount && int32(player->GetItemCount(itemid, true)) >= pProto->MaxCount) - return false; - return true; } @@ -433,7 +429,7 @@ void Loot::AddItem(LootStoreItem const& item) // non-conditional one-player only items are counted here, // free for all items are counted in FillFFALoot(), // non-ffa conditionals are counted in FillNonQuestNonFFAConditionalLoot() - if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_PROTO_FLAG_MULTI_DROP)) + if (!item.needs_quest && item.conditions.empty() && !(proto->Flags & ITEM_FLAG_MULTI_DROP)) ++unlootedCount; } } @@ -487,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); @@ -521,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; } } @@ -544,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) { @@ -557,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 @@ -582,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; @@ -661,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) @@ -721,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]; @@ -744,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; @@ -760,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; @@ -786,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); } @@ -806,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) @@ -819,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) @@ -832,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) @@ -980,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) @@ -1021,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) @@ -1039,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; } } @@ -1657,7 +1648,7 @@ void LoadLootTemplates_Item() // remove real entries and check existence loot ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) - if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_PROTO_FLAG_HAS_LOOT) + if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end() && itr->second.Flags & ITEM_FLAG_HAS_LOOT) lootIdSet.erase(itr->second.ItemId); // output error for any still listed (not referenced from appropriate table) ids @@ -1682,7 +1673,7 @@ void LoadLootTemplates_Milling() ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) { - if (!(itr->second.Flags & ITEM_PROTO_FLAG_MILLABLE)) + if (!(itr->second.Flags & ITEM_FLAG_IS_MILLABLE)) continue; if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end()) @@ -1745,7 +1736,7 @@ void LoadLootTemplates_Prospecting() ItemTemplateContainer const* its = sObjectMgr->GetItemTemplateStore(); for (ItemTemplateContainer::const_iterator itr = its->begin(); itr != its->end(); ++itr) { - if (!(itr->second.Flags & ITEM_PROTO_FLAG_PROSPECTABLE)) + if (!(itr->second.Flags & ITEM_FLAG_IS_PROSPECTABLE)) continue; if (lootIdSet.find(itr->second.ItemId) != lootIdSet.end()) diff --git a/src/server/game/Loot/LootMgr.h b/src/server/game/Loot/LootMgr.h index a66b8f0b4c5..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; @@ -271,13 +271,13 @@ class TC_GAME_API LootTemplate LootGroups Groups; // groups have own (optimised) processing, grouped entries go there // Objects of this class must never be copied, we are storing pointers in container - LootTemplate(LootTemplate const&); - LootTemplate& operator=(LootTemplate const&); + LootTemplate(LootTemplate const&) = delete; + LootTemplate& operator=(LootTemplate const&) = delete; }; //===================================================== -class LootValidatorRef : public Reference<Loot, LootValidatorRef> +class LootValidatorRef : public Reference<Loot, LootValidatorRef> { public: LootValidatorRef() { } @@ -293,12 +293,9 @@ class LootValidatorRefManager : public RefManager<Loot, LootValidatorRef> typedef LinkedListHead::Iterator< LootValidatorRef > iterator; LootValidatorRef* getFirst() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getFirst(); } - LootValidatorRef* getLast() { return (LootValidatorRef*)RefManager<Loot, LootValidatorRef>::getLast(); } iterator begin() { return iterator(getFirst()); } - iterator end() { return iterator(NULL); } - iterator rbegin() { return iterator(getLast()); } - iterator rend() { return iterator(NULL); } + iterator end() { return iterator(nullptr); } }; //===================================================== @@ -311,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; @@ -343,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(); @@ -380,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; @@ -388,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/Maps/MapRefManager.h b/src/server/game/Maps/MapRefManager.h index 09aa67d43eb..14d1d59bd36 100644 --- a/src/server/game/Maps/MapRefManager.h +++ b/src/server/game/Maps/MapRefManager.h @@ -26,20 +26,17 @@ class MapReference; class MapRefManager : public RefManager<Map, Player> { public: - typedef LinkedListHead::Iterator< MapReference > iterator; - typedef LinkedListHead::Iterator< MapReference const > const_iterator; + typedef LinkedListHead::Iterator<MapReference> iterator; + typedef LinkedListHead::Iterator<MapReference const> const_iterator; - MapReference* getFirst() { return (MapReference*)RefManager<Map, Player>::getFirst(); } + MapReference* getFirst() { return (MapReference*)RefManager<Map, Player>::getFirst(); } MapReference const* getFirst() const { return (MapReference const*)RefManager<Map, Player>::getFirst(); } - MapReference* getLast() { return (MapReference*)RefManager<Map, Player>::getLast(); } - MapReference const* getLast() const { return (MapReference const*)RefManager<Map, Player>::getLast(); } iterator begin() { return iterator(getFirst()); } - iterator end() { return iterator(NULL); } - iterator rbegin() { return iterator(getLast()); } - iterator rend() { return iterator(NULL); } + iterator end() { return iterator(nullptr); } + const_iterator begin() const { return const_iterator(getFirst()); } - const_iterator end() const { return const_iterator(NULL); } + const_iterator end() const { return const_iterator(nullptr); } }; #endif diff --git a/src/server/game/Miscellaneous/SharedDefines.h b/src/server/game/Miscellaneous/SharedDefines.h index f7c440ce8bc..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.] @@ -3136,7 +3137,9 @@ enum DiminishingGroup : uint16 DIMINISHING_SLEEP = 17, DIMINISHING_TAUNT = 18, DIMINISHING_LIMITONLY = 19, - DIMINISHING_DRAGONS_BREATH = 20 + DIMINISHING_DRAGONS_BREATH = 20, + + DIMINISHING_MAX }; enum SummonCategory diff --git a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp index bae8e541ddc..61916504758 100644 --- a/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp +++ b/src/server/game/Movement/MovementGenerators/HomeMovementGenerator.cpp @@ -34,8 +34,8 @@ void HomeMovementGenerator<Creature>::DoFinalize(Creature* owner) owner->ClearUnitState(UNIT_STATE_EVADE); owner->SetWalk(true); owner->LoadCreaturesAddon(); - owner->SetSpawnHealth(); owner->AI()->JustReachedHome(); + owner->SetSpawnHealth(); } } 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 28b26d42395..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 @@ -965,34 +963,64 @@ bool AuraEffect::CheckEffectProc(AuraApplication* aurApp, ProcEventInfo& eventIn SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); switch (GetAuraType()) { + case SPELL_AURA_MOD_CONFUSE: + case SPELL_AURA_MOD_FEAR: + case SPELL_AURA_MOD_STUN: + case SPELL_AURA_MOD_ROOT: + case SPELL_AURA_TRANSFORM: + { + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + // Spell own damage at apply won't break CC + if (spellInfo && spellInfo == GetSpellInfo()) + { + Aura* aura = GetBase(); + // called from spellcast, should not have ticked yet + if (aura->GetDuration() == aura->GetMaxDuration()) + return false; + } + break; + } case SPELL_AURA_MECHANIC_IMMUNITY: case SPELL_AURA_MOD_MECHANIC_RESISTANCE: // compare mechanic if (!spellInfo || static_cast<int32>(spellInfo->Mechanic) != GetMiscValue()) - result = false; + return false; break; case SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK: // skip melee hits and instant cast spells if (!spellInfo || !spellInfo->CalcCastTime()) - result = false; + return false; break; case SPELL_AURA_MOD_DAMAGE_FROM_CASTER: // Compare casters if (GetCasterGUID() != eventInfo.GetActor()->GetGUID()) - result = false; + return false; break; case SPELL_AURA_MOD_POWER_COST_SCHOOL: case SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT: // Skip melee hits and spells with wrong school or zero cost if (!spellInfo || (!spellInfo->ManaCost && !spellInfo->ManaCostPercentage) || // Cost Check !(spellInfo->GetSchoolMask() & GetMiscValue())) // School Check - result = false; + return false; break; case SPELL_AURA_REFLECT_SPELLS_SCHOOL: // Skip melee hits and spells with wrong school if (!spellInfo || !(spellInfo->GetSchoolMask() & GetMiscValue())) - result = false; + return false; + break; + case SPELL_AURA_PROC_TRIGGER_SPELL: + case SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE: + { + // Don't proc extra attacks while already processing extra attack spell + uint32 triggerSpellId = GetSpellInfo()->Effects[GetEffIndex()].TriggerSpell; + if (SpellInfo const* triggeredSpellInfo = sSpellMgr->GetSpellInfo(triggerSpellId)) + if (aurApp->GetTarget()->m_extraAttacks && triggeredSpellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) + return false; break; + } default: break; } @@ -1143,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; @@ -1164,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 @@ -1179,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); } } } @@ -1189,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)) @@ -1202,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; } } @@ -1233,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: @@ -1248,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: @@ -1262,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 @@ -1270,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; } @@ -1284,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)) { @@ -1293,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; @@ -1746,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()); @@ -1818,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(); @@ -2274,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); - } } } @@ -3036,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 @@ -3287,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 @@ -3341,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(); @@ -3364,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 @@ -3377,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) { @@ -3388,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); } @@ -3406,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 @@ -3431,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 @@ -3441,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); } /*********************************************************/ @@ -4038,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 @@ -4361,6 +4074,7 @@ void AuraEffect::HandleAuraModAttackPowerOfArmor(AuraApplication const* aurApp, if (target->GetTypeId() == TYPEID_PLAYER) target->ToPlayer()->UpdateAttackPowerAndDamage(false); } + /********************************/ /*** DAMAGE BONUS ***/ /********************************/ @@ -4371,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(); } @@ -4459,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) { @@ -4474,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 @@ -5413,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; @@ -5816,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. @@ -5912,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); @@ -5927,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) @@ -5939,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); @@ -5960,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); @@ -5976,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 @@ -5987,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; @@ -6004,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()) @@ -6399,23 +6059,12 @@ void AuraEffect::HandlePeriodicPowerBurnAuraTick(Unit* target, Unit* caster) con void AuraEffect::HandleBreakableCCAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) { - DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) - return; - - // aura own damage at apply won't break CC - if (eventInfo.GetSpellPhaseMask() & PROC_SPELL_PHASE_CAST) - { - if (SpellInfo const* spellInfo = eventInfo.GetSpellInfo()) - if (spellInfo == GetSpellInfo()) - return; - } + int32 const damageLeft = GetAmount() - static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()); - int32 damageLeft = GetAmount(); - if (damageLeft < int32(damageInfo->GetDamage())) + if (damageLeft <= 0) aurApp->GetTarget()->RemoveAura(aurApp); else - SetAmount(damageLeft - damageInfo->GetDamage()); + SetAmount(damageLeft); } void AuraEffect::HandleProcTriggerSpellAuraProc(AuraApplication* aurApp, ProcEventInfo& eventInfo) @@ -6456,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 2a6545520ae..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 @@ -490,37 +488,36 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply) m_updateTargetMapInterval = UPDATE_TARGET_MAP_INTERVAL; // fill up to date target list - // target, effMask - std::map<Unit*, uint8> targets; - + // target, effMask + std::unordered_map<Unit*, uint8> targets; FillTargetMap(targets, caster); - UnitList targetsToRemove; + std::deque<Unit*> targetsToRemove; // mark all auras as ready to remove for (ApplicationMap::iterator appIter = m_applications.begin(); appIter != m_applications.end();++appIter) { - std::map<Unit*, uint8>::iterator existing = targets.find(appIter->second->GetTarget()); + auto itr = targets.find(appIter->second->GetTarget()); // not found in current area - remove the aura - if (existing == targets.end()) + if (itr == targets.end()) targetsToRemove.push_back(appIter->second->GetTarget()); else { // needs readding - remove now, will be applied in next update cycle // (dbcs do not have auras which apply on same type of targets but have different radius, so this is not really needed) - if (appIter->second->GetEffectMask() != existing->second || !CanBeAppliedOn(existing->first)) + if (appIter->second->GetEffectMask() != itr->second || !CanBeAppliedOn(itr->first)) targetsToRemove.push_back(appIter->second->GetTarget()); // nothing todo - aura already applied // remove from auras to register list - targets.erase(existing); + targets.erase(itr); } } // register auras for units - for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr!= targets.end();) + for (auto itr = targets.begin(); itr!= targets.end();) { // aura mustn't be already applied on target - if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID())) + if (AuraApplication* aurApp = GetApplicationOfTarget(itr->first->GetGUID())) { // the core created 2 different units with same guid // this is a major failue, which i can't fix right now @@ -530,7 +527,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply) if (aurApp->GetTarget() != itr->first) { // remove from auras to register list - targets.erase(itr++); + itr = targets.erase(itr); continue; } else @@ -584,7 +581,7 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply) } } if (!addUnit) - targets.erase(itr++); + itr = targets.erase(itr); else { // owner has to be in world, or effect has to be applied to self @@ -602,17 +599,17 @@ void Aura::UpdateTargetMap(Unit* caster, bool apply) } // remove auras from units no longer needing them - for (UnitList::iterator itr = targetsToRemove.begin(); itr != targetsToRemove.end();++itr) - if (AuraApplication * aurApp = GetApplicationOfTarget((*itr)->GetGUID())) - (*itr)->_UnapplyAura(aurApp, AURA_REMOVE_BY_DEFAULT); + for (Unit* unit : targetsToRemove) + if (AuraApplication* aurApp = GetApplicationOfTarget(unit->GetGUID())) + unit->_UnapplyAura(aurApp, AURA_REMOVE_BY_DEFAULT); if (!apply) return; // apply aura effects for units - for (std::map<Unit*, uint8>::iterator itr = targets.begin(); itr!= targets.end();++itr) + for (auto itr = targets.begin(); itr!= targets.end(); ++itr) { - if (AuraApplication * aurApp = GetApplicationOfTarget(itr->first->GetGUID())) + if (AuraApplication* aurApp = GetApplicationOfTarget(itr->first->GetGUID())) { // owner has to be in world, or effect has to be applied to self ASSERT((!GetOwner()->IsInWorld() && GetOwner() == itr->first) || GetOwner()->IsInMap(itr->first)); @@ -988,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; } @@ -1292,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 @@ -1592,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); } @@ -1602,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; } @@ -1866,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()) { @@ -1890,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 - if (!(procEntry->AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC)) - 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; @@ -1910,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; @@ -2025,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); @@ -2059,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); @@ -2072,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); @@ -2086,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); @@ -2106,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); @@ -2124,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); @@ -2138,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); @@ -2153,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); @@ -2172,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); @@ -2186,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); @@ -2200,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); @@ -2214,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); @@ -2228,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())) @@ -2246,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); @@ -2260,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); @@ -2274,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); @@ -2288,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); @@ -2303,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); @@ -2319,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); @@ -2338,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); @@ -2354,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); @@ -2368,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); @@ -2385,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); @@ -2403,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); @@ -2449,18 +2470,17 @@ void UnitAura::Remove(AuraRemoveMode removeMode) GetUnitOwner()->RemoveOwnedAura(this, removeMode); } -void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) +void UnitAura::FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* caster) { for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex) { if (!HasEffect(effIndex)) continue; - UnitList targetList; + + std::deque<Unit*> units; // non-area aura if (GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AURA) - { - targetList.push_back(GetUnitOwner()); - } + units.push_back(GetUnitOwner()); else { float radius = GetSpellInfo()->Effects[effIndex].CalcRadius(caster); @@ -2472,48 +2492,48 @@ void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) case SPELL_EFFECT_APPLY_AREA_AURA_PARTY: case SPELL_EFFECT_APPLY_AREA_AURA_RAID: { - targetList.push_back(GetUnitOwner()); - Trinity::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, GetSpellInfo()->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID); - Trinity::UnitListSearcher<Trinity::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check); + units.push_back(GetUnitOwner()); + Trinity::AnyGroupedUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_APPLY_AREA_AURA_RAID, m_spellInfo->HasAttribute(SPELL_ATTR3_ONLY_TARGET_PLAYERS)); + Trinity::UnitListSearcher<Trinity::AnyGroupedUnitInObjectRangeCheck> searcher(GetUnitOwner(), units, u_check); GetUnitOwner()->VisitNearbyObject(radius, searcher); break; } case SPELL_EFFECT_APPLY_AREA_AURA_FRIEND: { - targetList.push_back(GetUnitOwner()); - Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); - Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check); + units.push_back(GetUnitOwner()); + Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, m_spellInfo->HasAttribute(SPELL_ATTR3_ONLY_TARGET_PLAYERS)); + Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(GetUnitOwner(), units, u_check); GetUnitOwner()->VisitNearbyObject(radius, searcher); break; } case SPELL_EFFECT_APPLY_AREA_AURA_ENEMY: { - Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius); // No GetCharmer in searcher - Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), targetList, u_check); + Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetUnitOwner(), GetUnitOwner(), radius, m_spellInfo); // No GetCharmer in searcher + Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetUnitOwner(), units, u_check); GetUnitOwner()->VisitNearbyObject(radius, searcher); break; } case SPELL_EFFECT_APPLY_AREA_AURA_PET: - targetList.push_back(GetUnitOwner()); + units.push_back(GetUnitOwner()); // no break case SPELL_EFFECT_APPLY_AREA_AURA_OWNER: { if (Unit* owner = GetUnitOwner()->GetCharmerOrOwner()) if (GetUnitOwner()->IsWithinDistInMap(owner, radius)) - targetList.push_back(owner); + units.push_back(owner); break; } } } } - for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr) + for (Unit* unit : units) { - std::map<Unit*, uint8>::iterator existing = targets.find(*itr); - if (existing != targets.end()) - existing->second |= 1<<effIndex; + auto itr = targets.find(unit); + if (itr != targets.end()) + itr->second |= 1 << effIndex; else - targets[*itr] = 1<<effIndex; + targets[unit] = 1 << effIndex; } } } @@ -2536,7 +2556,7 @@ void DynObjAura::Remove(AuraRemoveMode removeMode) _Remove(removeMode); } -void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster*/) +void DynObjAura::FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* /*caster*/) { Unit* dynObjOwnerCaster = GetDynobjOwner()->GetCaster(); float radius = GetDynobjOwner()->GetRadius(); @@ -2545,28 +2565,29 @@ void DynObjAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* /*caster* { if (!HasEffect(effIndex)) continue; - UnitList targetList; + + std::deque<Unit*> units; if (GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_DEST_DYNOBJ_ALLY || GetSpellInfo()->Effects[effIndex].TargetB.GetTarget() == TARGET_UNIT_DEST_AREA_ALLY) { - Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); - Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check); + Trinity::AnyFriendlyUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius, m_spellInfo->HasAttribute(SPELL_ATTR3_ONLY_TARGET_PLAYERS)); + Trinity::UnitListSearcher<Trinity::AnyFriendlyUnitInObjectRangeCheck> searcher(GetDynobjOwner(), units, u_check); GetDynobjOwner()->VisitNearbyObject(radius, searcher); } else { Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(GetDynobjOwner(), dynObjOwnerCaster, radius); - Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), targetList, u_check); + Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(GetDynobjOwner(), units, u_check); GetDynobjOwner()->VisitNearbyObject(radius, searcher); } - for (UnitList::iterator itr = targetList.begin(); itr!= targetList.end();++itr) + for (Unit* unit : units) { - std::map<Unit*, uint8>::iterator existing = targets.find(*itr); - if (existing != targets.end()) - existing->second |= 1<<effIndex; + auto itr = targets.find(unit); + if (itr != targets.end()) + itr->second |= 1 << effIndex; else - targets[*itr] = 1<<effIndex; + targets[unit] = 1 << effIndex; } } } diff --git a/src/server/game/Spells/Auras/SpellAuras.h b/src/server/game/Spells/Auras/SpellAuras.h index ff7070cea15..1533746893a 100644 --- a/src/server/game/Spells/Auras/SpellAuras.h +++ b/src/server/game/Spells/Auras/SpellAuras.h @@ -113,7 +113,7 @@ class TC_GAME_API Aura void _Remove(AuraRemoveMode removeMode); virtual void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) = 0; - virtual void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) = 0; + virtual void FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* caster) = 0; void UpdateTargetMap(Unit* caster, bool apply = true); void _RegisterForTargets() {Unit* caster = GetCaster(); UpdateTargetMap(caster, false);} @@ -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; @@ -283,14 +285,14 @@ class TC_GAME_API UnitAura : public Aura void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) override; - void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) override; + void FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* caster) override; // Allow Apply Aura Handler to modify and access m_AuraDRGroup void SetDiminishGroup(DiminishingGroup group) { m_AuraDRGroup = group; } DiminishingGroup GetDiminishGroup() const { return m_AuraDRGroup; } private: - DiminishingGroup m_AuraDRGroup:8; // Diminishing + DiminishingGroup m_AuraDRGroup; // Diminishing }; class TC_GAME_API DynObjAura : public Aura @@ -301,7 +303,7 @@ class TC_GAME_API DynObjAura : public Aura public: void Remove(AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT) override; - void FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster) override; + void FillTargetMap(std::unordered_map<Unit*, uint8>& targets, Unit* caster) override; }; class TC_GAME_API ChargeDropEvent : public BasicEvent diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 9b21ea4c5fb..c082c0a7584 100644 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -586,8 +586,6 @@ m_caster((info->HasAttribute(SPELL_ATTR6_CAST_BY_CHARMER) && caster->GetCharmerO destTarget = NULL; damage = 0; effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH; - m_diminishLevel = DIMINISHING_LEVEL_1; - m_diminishGroup = DIMINISHING_NONE; m_damage = 0; m_healing = 0; m_procAttacker = 0; @@ -628,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) @@ -649,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) @@ -1121,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)) { @@ -1208,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); @@ -1994,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) { @@ -2052,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 @@ -2310,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 @@ -2354,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) { @@ -2415,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) @@ -2435,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 @@ -2504,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 @@ -2517,15 +2554,12 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA effectMask &= ~(1 << effectNumber); else if (m_spellInfo->Effects[effectNumber].IsAura() && !m_spellInfo->IsPositiveEffect(effectNumber)) { - int32 debuff_resist_chance = unit->GetMaxPositiveAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); - debuff_resist_chance += unit->GetMaxNegativeAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, int32(m_spellInfo->Dispel)); - - if (debuff_resist_chance > 0) - if (irand(0, 10000) <= (debuff_resist_chance * 100)) - { - effectMask &= ~(1 << effectNumber); - returnVal = SPELL_MISS_RESIST; - } + int32 debuff_resist_chance = unit->GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_DEBUFF_RESISTANCE, static_cast<int32>(m_spellInfo->Dispel)); + if (debuff_resist_chance > 0 && roll_chance_i(debuff_resist_chance)) + { + effectMask &= ~(1 << effectNumber); + returnVal = SPELL_MISS_RESIST; + } } } } @@ -2556,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 @@ -2591,16 +2620,19 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA aura_effmask |= 1 << i; // Get Data Needed for Diminishing Returns, some effects may have multiple auras, so this must be done on spell hit, not aura add - m_diminishGroup = GetDiminishingReturnsGroupForSpell(m_spellInfo, m_triggeredByAuraSpell != nullptr); - if (m_diminishGroup && aura_effmask) + bool const triggered = m_triggeredByAuraSpell != nullptr; + DiminishingGroup const diminishGroup = m_spellInfo->GetDiminishingReturnsGroupForSpell(triggered); + + DiminishingLevels diminishLevel = DIMINISHING_LEVEL_1; + if (diminishGroup && aura_effmask) { - m_diminishLevel = unit->GetDiminishing(m_diminishGroup); - DiminishingReturnsType type = GetDiminishingReturnsGroupType(m_diminishGroup); + diminishLevel = unit->GetDiminishing(diminishGroup); + DiminishingReturnsType type = m_spellInfo->GetDiminishingReturnsGroupType(triggered); // Increase Diminishing on unit, current informations for actually casts will use values above if ((type == DRTYPE_PLAYER && (unit->GetCharmerOrOwnerPlayerOrPlayerItself() || (unit->GetTypeId() == TYPEID_UNIT && unit->ToCreature()->GetCreatureTemplate()->flags_extra & CREATURE_FLAG_EXTRA_ALL_DIMINISH))) || type == DRTYPE_ALL) - unit->IncrDiminishing(m_diminishGroup); + unit->IncrDiminishing(m_spellInfo, triggered); } if (aura_effmask) @@ -2643,8 +2675,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA // Now Reduce spell duration using data received at spell hit int32 duration = m_spellAura->GetMaxDuration(); - int32 limitduration = GetDiminishingReturnsLimitDuration(m_diminishGroup, aurSpellInfo); - float diminishMod = unit->ApplyDiminishingToDuration(m_diminishGroup, duration, m_originalCaster, m_diminishLevel, limitduration); + float diminishMod = unit->ApplyDiminishingToDuration(aurSpellInfo, triggered, duration, m_originalCaster, diminishLevel); // unit is immune to aura if it was diminished to 0 duration if (diminishMod == 0.0f) @@ -2659,7 +2690,7 @@ SpellMissInfo Spell::DoSpellHitOnUnit(Unit* unit, uint32 effectMask, bool scaleA } else { - ((UnitAura*)m_spellAura)->SetDiminishGroup(m_diminishGroup); + ((UnitAura*)m_spellAura)->SetDiminishGroup(diminishGroup); bool positive = m_spellAura->GetSpellInfo()->IsPositive(); if (AuraApplication* aurApp = m_spellAura->GetApplicationOfTarget(m_originalCaster->GetGUID())) @@ -2723,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)) { @@ -2936,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, ¶m1, ¶m2); 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 @@ -2957,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, ¶m1, ¶m2); + else + SendCastResult(result); finish(false); return; @@ -2982,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()); @@ -2995,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); @@ -3144,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, ¶m1, ¶m2); if (castResult != SPELL_CAST_OK) { - SendCastResult(castResult); + SendCastResult(castResult, ¶m1, ¶m2); SendInterrupted(0); //restore spell mods if (m_caster->GetTypeId() == TYPEID_PLAYER) @@ -3460,9 +3496,6 @@ uint64 Spell::handle_delayed(uint64 t_offset) void Spell::_handle_immediate_phase() { m_spellAura = NULL; - // initialize Diminishing Returns Data - m_diminishLevel = DIMINISHING_LEVEL_1; - m_diminishGroup = DIMINISHING_NONE; // handle some immediate features of the spell here HandleThreatSpells(); @@ -3498,12 +3531,12 @@ void Spell::_handle_finish_phase() m_caster->m_playerMovingMe->GainSpellComboPoints(m_comboPointGain); } - if (m_caster->HasExtraAttacksPending() && m_spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) + if (m_caster->m_extraAttacks && m_spellInfo->HasEffect(SPELL_EFFECT_ADD_EXTRA_ATTACKS)) { if (Unit* victim = ObjectAccessor::GetUnit(*m_caster, m_targets.GetOrigUnitTargetGUID())) m_caster->HandleProcExtraAttackFor(victim); else - m_caster->SetExtraAttacks(0); + m_caster->m_extraAttacks = 0; } // Handle procs on finish @@ -3554,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 @@ -3576,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; @@ -3589,8 +3622,12 @@ void Spell::update(uint32 difftime) if (!UpdateChanneledTargetList()) { TC_LOG_DEBUG("spells", "Channeled spell %d is removed due to lack of targets", m_spellInfo->Id); - SendChannelUpdate(0); - finish(); + m_timer = 0; + + // Also remove applied auras + for (TargetInfo const& target : m_UniqueTargetInfo) + if (Unit* unit = m_caster->GetGUID() == target.targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target.targetGUID)) + unit->RemoveOwnedAura(m_spellInfo->Id, m_originalCasterGUID, 0, AURA_REMOVE_BY_CANCEL); } if (m_timer > 0) @@ -3692,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); @@ -3700,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; @@ -3816,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) @@ -4471,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; @@ -4496,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 @@ -4616,7 +4723,7 @@ void Spell::TakeReagents() ItemTemplate const* castItemTemplate = m_CastItem ? m_CastItem->GetTemplate() : NULL; // do not take reagents for these item casts - if (castItemTemplate && castItemTemplate->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST) + if (castItemTemplate && castItemTemplate->Flags & ITEM_FLAG_NO_REAGENT_COST) return; Player* p_caster = m_caster->ToPlayer(); @@ -4695,7 +4802,7 @@ void Spell::HandleThreatSpells() continue; // positive spells distribute threat among all units that are in combat with target, like healing - if (m_spellInfo->_IsPositiveSpell()) + if (m_spellInfo->IsPositive()) target->getHostileRefManager().threatAssist(m_caster, threatToAdd, m_spellInfo); // for negative spells threat gets distributed among affected targets else @@ -4706,7 +4813,7 @@ void Spell::HandleThreatSpells() target->AddThreat(m_caster, threatToAdd, m_spellInfo->GetSchoolMask(), m_spellInfo); } } - TC_LOG_DEBUG("spells", "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->_IsPositiveSpell() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); + TC_LOG_DEBUG("spells", "Spell %u, added an additional %f threat for %s %u target(s)", m_spellInfo->Id, threat, m_spellInfo->IsPositive() ? "assisting" : "harming", uint32(m_UniqueTargetInfo.size())); } void Spell::HandleEffects(Unit* pUnitTarget, Item* pItemTarget, GameObject* pGOTarget, uint32 i, SpellEffectHandleMode mode) @@ -4732,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))) @@ -4795,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 @@ -4897,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; @@ -5005,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; } @@ -5025,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; } @@ -5039,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)) @@ -5054,6 +5168,7 @@ SpellCastResult Spell::CheckCast(bool strict) hasNonDispelEffect = true; break; } + } if (!hasNonDispelEffect && !hasDispellableAura && dispelMask && !IsTriggered()) { @@ -5168,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()) @@ -5637,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) @@ -5828,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) @@ -5858,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); @@ -5913,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) @@ -5956,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) @@ -6037,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 @@ -6052,7 +6146,7 @@ SpellCastResult Spell::CheckItems() } // do not take reagents for these item casts - if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)) + if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_FLAG_NO_REAGENT_COST)) { bool checkReagents = !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST) && !player->CanNoReagentCast(m_spellInfo); // Not own traded item (in trader trade slot) requires reagents even if triggered spell @@ -6090,7 +6184,11 @@ SpellCastResult Spell::CheckItems() } } if (!player->HasItemCount(itemid, itemcount)) + { + if (param1) + *param1 = itemid; return SPELL_FAILED_REAGENTS; + } } } @@ -6174,7 +6272,7 @@ SpellCastResult Spell::CheckItems() if (m_targets.GetItemTarget()->GetOwner() != m_caster) return SPELL_FAILED_NOT_TRADEABLE; // do not allow to enchant vellum from scroll made by vellum-prevent exploit - if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST) + if (m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_FLAG_NO_REAGENT_COST) return SPELL_FAILED_TOTEM_CATEGORY; ItemPosCountVec dest; InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, m_spellInfo->Effects[i].ItemType, 1); @@ -6294,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_PROTO_FLAG_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; @@ -6317,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_PROTO_FLAG_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; @@ -6603,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 @@ -6689,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? @@ -7071,7 +7180,7 @@ void Spell::SetSpellValue(SpellValueMod mod, int32 value) void Spell::PrepareTargetProcessing() { - CheckEffectExecuteData(); + AssertEffectExecuteData(); } void Spell::FinishTargetProcessing() @@ -7096,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]); @@ -7104,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); @@ -7136,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); @@ -7149,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); @@ -7163,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); @@ -7181,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(); } @@ -7189,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) { @@ -7235,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); @@ -7248,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); @@ -7261,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); @@ -7274,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); @@ -7287,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); @@ -7301,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); @@ -7315,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); @@ -7333,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))) @@ -7391,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 5823ea72dbd..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; @@ -561,10 +571,6 @@ class TC_GAME_API Spell // used in effects handlers Aura* m_spellAura; - // this is set in Spell Hit, but used in Apply Aura handler - DiminishingLevels m_diminishLevel; - DiminishingGroup m_diminishGroup; - // ------------------------------------------- GameObject* focusObject; @@ -640,7 +646,7 @@ class TC_GAME_API Spell // spell execution log void InitEffectExecuteData(uint8 effIndex); - void CheckEffectExecuteData(); + void AssertEffectExecuteData() const; // Scripting system void LoadScripts(); @@ -658,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 @@ -670,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 9867b25259b..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 @@ -2023,7 +2037,7 @@ void Spell::EffectOpenLock(SpellEffIndex effIndex) if (gameObjTarget) SendLoot(guid, LOOT_SKINNING); else if (itemTarget) - itemTarget->SetFlag(ITEM_FIELD_FLAGS, ITEM_FLAG_UNLOCKED); + itemTarget->SetFlag(ITEM_FIELD_FLAGS, ITEM_FIELD_FLAG_UNLOCKED); // not allow use skill grow at item base open if (!m_CastItem && skillId != SKILL_NONE) @@ -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; } } @@ -2686,7 +2704,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex) else { // do not increase skill if vellum used - if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_PROTO_FLAG_TRIGGERED_CAST)) + if (!(m_CastItem && m_CastItem->GetTemplate()->Flags & ITEM_FLAG_NO_REAGENT_COST)) player->UpdateCraftSkill(m_spellInfo->Id); uint32 enchant_id = m_spellInfo->Effects[effIndex].MiscValue; @@ -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); } } @@ -4495,10 +4500,10 @@ void Spell::EffectAddExtraAttacks(SpellEffIndex effIndex) if (!unitTarget || !unitTarget->IsAlive()) return; - if (unitTarget->HasExtraAttacksPending()) + if (unitTarget->m_extraAttacks) return; - unitTarget->SetExtraAttacks(damage); + unitTarget->m_extraAttacks = damage; ExecuteLogEffectExtraAttacks(effIndex, unitTarget, damage); } @@ -4579,8 +4584,8 @@ void Spell::EffectQuestComplete(SpellEffIndex effIndex) uint16 logSlot = player->FindQuestSlot(questId); if (logSlot < MAX_QUEST_LOG_SIZE) player->AreaExploredOrEventHappens(questId); - else if (player->CanTakeQuest(quest, false)) // Check if the quest has already been turned in. - player->SetRewardedQuest(questId); // If not, set status to rewarded without broadcasting it to client. + else if (quest->HasFlag(QUEST_FLAGS_TRACKING)) // Check if the quest is used as a serverside flag. + player->SetRewardedQuest(questId); // If so, set status to rewarded without broadcasting it to client. } } @@ -4757,7 +4762,7 @@ void Spell::EffectLeapBack(SpellEffIndex effIndex) float speedxy = m_spellInfo->Effects[effIndex].MiscValue / 10.f; float speedz = damage/ 10.f; //1891: Disengage - m_caster->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891); + unitTarget->JumpTo(speedxy, speedz, m_spellInfo->SpellIconID != 1891); } void Spell::EffectQuestClear(SpellEffIndex effIndex) @@ -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); } } @@ -5169,7 +5162,7 @@ void Spell::EffectProspecting(SpellEffIndex /*effIndex*/) if (!player) return; - if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_PROSPECTABLE)) + if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_FLAG_IS_PROSPECTABLE)) return; if (itemTarget->GetCount() < 5) @@ -5194,7 +5187,7 @@ void Spell::EffectMilling(SpellEffIndex /*effIndex*/) if (!player) return; - if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_PROTO_FLAG_MILLABLE)) + if (!itemTarget || !(itemTarget->GetTemplate()->Flags & ITEM_FLAG_IS_MILLABLE)) return; if (itemTarget->GetCount() < 5) diff --git a/src/server/game/Spells/SpellInfo.cpp b/src/server/game/Spells/SpellInfo.cpp index f69f49eb509..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" @@ -855,6 +856,9 @@ SpellInfo::SpellInfo(SpellEntry const* spellEntry) ChainEntry = NULL; ExplicitTargetMask = 0; + + _spellSpecific = SPELL_SPECIFIC_NORMAL; + _auraState = AURA_STATE_NONE; } SpellInfo::~SpellInfo() @@ -891,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 @@ -1178,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 @@ -1207,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); @@ -1218,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; @@ -1408,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; } @@ -1854,239 +1908,1037 @@ uint32 SpellInfo::GetExplicitTargetMask() const AuraStateType SpellInfo::GetAuraState() const { - // Seals - if (GetSpellSpecific() == SPELL_SPECIFIC_SEAL) - return AURA_STATE_JUDGEMENT; - - // Conflagrate aura state on Immolate and Shadowflame - if (SpellFamilyName == SPELLFAMILY_WARLOCK && - // Immolate - ((SpellFamilyFlags[0] & 4) || - // Shadowflame - (SpellFamilyFlags[2] & 2))) - return AURA_STATE_CONFLAGRATE; - - // Faerie Fire (druid versions) - if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x400) - return AURA_STATE_FAERIE_FIRE; - - // Sting (hunter's pet ability) - if (GetCategory() == 1133) - return AURA_STATE_FAERIE_FIRE; - - // Victorious - if (SpellFamilyName == SPELLFAMILY_WARRIOR && SpellFamilyFlags[1] & 0x00040000) - return AURA_STATE_WARRIOR_VICTORY_RUSH; - - // Swiftmend state on Regrowth & Rejuvenation - if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x50) - return AURA_STATE_SWIFTMEND; - - // Deadly poison aura state - if (SpellFamilyName == SPELLFAMILY_ROGUE && SpellFamilyFlags[0] & 0x10000) - return AURA_STATE_DEADLY_POISON; - - // Enrage aura state - if (Dispel == DISPEL_ENRAGE) - return AURA_STATE_ENRAGE; - - // Bleeding aura state - if (GetAllEffectsMechanicMask() & 1<<MECHANIC_BLEED) - return AURA_STATE_BLEEDING; - - if (GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - if (Effects[i].IsAura() && (Effects[i].ApplyAuraName == SPELL_AURA_MOD_STUN - || Effects[i].ApplyAuraName == SPELL_AURA_MOD_ROOT)) - return AURA_STATE_FROZEN; + return _auraState; +} - switch (Id) +void SpellInfo::_LoadAuraState() +{ + _auraState = [this]() -> AuraStateType { - case 71465: // Divine Surge - case 50241: // Evasive Charges - return AURA_STATE_UNKNOWN22; - default: - break; - } + // Seals + if (GetSpellSpecific() == SPELL_SPECIFIC_SEAL) + return AURA_STATE_JUDGEMENT; + + // Conflagrate aura state on Immolate and Shadowflame + if (SpellFamilyName == SPELLFAMILY_WARLOCK && + // Immolate + ((SpellFamilyFlags[0] & 4) || + // Shadowflame + (SpellFamilyFlags[2] & 2))) + return AURA_STATE_CONFLAGRATE; + + // Faerie Fire (druid versions) + if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x400) + return AURA_STATE_FAERIE_FIRE; + + // Sting (hunter's pet ability) + if (GetCategory() == 1133) + return AURA_STATE_FAERIE_FIRE; + + // Victorious + if (SpellFamilyName == SPELLFAMILY_WARRIOR && SpellFamilyFlags[1] & 0x00040000) + return AURA_STATE_WARRIOR_VICTORY_RUSH; + + // Swiftmend state on Regrowth & Rejuvenation + if (SpellFamilyName == SPELLFAMILY_DRUID && SpellFamilyFlags[0] & 0x50) + return AURA_STATE_SWIFTMEND; + + // Deadly poison aura state + if (SpellFamilyName == SPELLFAMILY_ROGUE && SpellFamilyFlags[0] & 0x10000) + return AURA_STATE_DEADLY_POISON; + + // Enrage aura state + if (Dispel == DISPEL_ENRAGE) + return AURA_STATE_ENRAGE; + + // Bleeding aura state + if (GetAllEffectsMechanicMask() & 1 << MECHANIC_BLEED) + return AURA_STATE_BLEEDING; + + if (GetSchoolMask() & SPELL_SCHOOL_MASK_FROST) + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + if (Effects[i].IsAura() && (Effects[i].ApplyAuraName == SPELL_AURA_MOD_STUN + || Effects[i].ApplyAuraName == SPELL_AURA_MOD_ROOT)) + return AURA_STATE_FROZEN; + + switch (Id) + { + case 71465: // Divine Surge + case 50241: // Evasive Charges + return AURA_STATE_UNKNOWN22; + default: + break; + } - return AURA_STATE_NONE; + return AURA_STATE_NONE; + }(); } SpellSpecificType SpellInfo::GetSpellSpecific() const { - switch (SpellFamilyName) + return _spellSpecific; +} + +void SpellInfo::_LoadSpellSpecific() +{ + _spellSpecific = [this]() -> SpellSpecificType { - case SPELLFAMILY_GENERIC: + switch (SpellFamilyName) { - // Food / Drinks (mostly) - if (AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) + case SPELLFAMILY_GENERIC: { - bool food = false; - bool drink = false; - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + // Food / Drinks (mostly) + if (AuraInterruptFlags & AURA_INTERRUPT_FLAG_NOT_SEATED) { - if (!Effects[i].IsAura()) - continue; - switch (Effects[i].ApplyAuraName) + bool food = false; + bool drink = false; + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - // Food - case SPELL_AURA_MOD_REGEN: - case SPELL_AURA_OBS_MOD_HEALTH: - food = true; - break; - // Drink - case SPELL_AURA_MOD_POWER_REGEN: - case SPELL_AURA_OBS_MOD_POWER: - drink = true; + if (!Effects[i].IsAura()) + continue; + switch (Effects[i].ApplyAuraName) + { + // Food + case SPELL_AURA_MOD_REGEN: + case SPELL_AURA_OBS_MOD_HEALTH: + food = true; + break; + // Drink + case SPELL_AURA_MOD_POWER_REGEN: + case SPELL_AURA_OBS_MOD_POWER: + drink = true; + break; + default: + break; + } + } + + if (food && drink) + return SPELL_SPECIFIC_FOOD_AND_DRINK; + else if (food) + return SPELL_SPECIFIC_FOOD; + else if (drink) + return SPELL_SPECIFIC_DRINK; + } + // scrolls effects + else + { + SpellInfo const* firstRankSpellInfo = GetFirstRankSpell(); + switch (firstRankSpellInfo->Id) + { + case 8118: // Strength + case 8099: // Stamina + case 8112: // Spirit + case 8096: // Intellect + 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; + } + case SPELLFAMILY_MAGE: + { + // family flags 18(Molten), 25(Frost/Ice), 28(Mage) + if (SpellFamilyFlags[0] & 0x12040000) + return SPELL_SPECIFIC_MAGE_ARMOR; + + // Arcane brillance and Arcane intelect (normal check fails because of flags difference) + if (SpellFamilyFlags[0] & 0x400) + return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE; + + if ((SpellFamilyFlags[0] & 0x1000000) && Effects[0].ApplyAuraName == SPELL_AURA_MOD_CONFUSE) + return SPELL_SPECIFIC_MAGE_POLYMORPH; - if (food && drink) - return SPELL_SPECIFIC_FOOD_AND_DRINK; - else if (food) - return SPELL_SPECIFIC_FOOD; - else if (drink) - return SPELL_SPECIFIC_DRINK; + break; } - // scrolls effects - else + case SPELLFAMILY_WARRIOR: + { + if (Id == 12292) // Death Wish + return SPELL_SPECIFIC_WARRIOR_ENRAGE; + + break; + } + case SPELLFAMILY_WARLOCK: + { + // only warlock curses have this + if (Dispel == DISPEL_CURSE) + return SPELL_SPECIFIC_CURSE; + + // Warlock (Demon Armor | Demon Skin | Fel Armor) + if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010) + return SPELL_SPECIFIC_WARLOCK_ARMOR; + + //seed of corruption and corruption + if (SpellFamilyFlags[1] & 0x10 || SpellFamilyFlags[0] & 0x2) + return SPELL_SPECIFIC_WARLOCK_CORRUPTION; + break; + } + case SPELLFAMILY_PRIEST: + { + // Divine Spirit and Prayer of Spirit + if (SpellFamilyFlags[0] & 0x20) + return SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT; + + break; + } + case SPELLFAMILY_HUNTER: + { + // only hunter stings have this + if (Dispel == DISPEL_POISON) + return SPELL_SPECIFIC_STING; + + // only hunter aspects have this (but not all aspects in hunter family) + if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010)) + return SPELL_SPECIFIC_ASPECT; + + break; + } + case SPELLFAMILY_PALADIN: + { + // Collection of all the seal family flags. No other paladin spell has any of those. + if (SpellFamilyFlags[1] & 0x26000C00 + || SpellFamilyFlags[0] & 0x0A000000) + return SPELL_SPECIFIC_SEAL; + + if (SpellFamilyFlags[0] & 0x00002190) + return SPELL_SPECIFIC_HAND; + + // Judgement of Wisdom, Judgement of Light, Judgement of Justice + if (Id == 20184 || Id == 20185 || Id == 20186) + return SPELL_SPECIFIC_JUDGEMENT; + + // only paladin auras have this (for palaldin class family) + if (SpellFamilyFlags[2] & 0x00000020) + return SPELL_SPECIFIC_AURA; + + break; + } + case SPELLFAMILY_SHAMAN: + { + // family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus + if (SpellFamilyFlags[1] & 0x420 + || SpellFamilyFlags[0] & 0x00000400 + || Id == 23552) + return SPELL_SPECIFIC_ELEMENTAL_SHIELD; + + break; + } + case SPELLFAMILY_DEATHKNIGHT: + if (Id == 48266 || Id == 48263 || Id == 48265) + return SPELL_SPECIFIC_PRESENCE; + break; + } + + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) + { + if (Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) { - SpellInfo const* firstRankSpellInfo = GetFirstRankSpell(); - switch (firstRankSpellInfo->Id) + switch (Effects[i].ApplyAuraName) { - case 8118: // Strength - case 8099: // Stamina - case 8112: // Spirit - case 8096: // Intellect - case 8115: // Agility - case 8091: // Armor - return SPELL_SPECIFIC_SCROLL; - case 12880: // Enrage (Enrage) - case 57518: // Enrage (Wrecking Crew) - return SPELL_SPECIFIC_WARRIOR_ENRAGE; + case SPELL_AURA_MOD_CHARM: + case SPELL_AURA_MOD_POSSESS_PET: + case SPELL_AURA_MOD_POSSESS: + case SPELL_AURA_AOE_CHARM: + return SPELL_SPECIFIC_CHARM; + case SPELL_AURA_TRACK_CREATURES: + /// @workaround For non-stacking tracking spells (We need generic solution) + if (Id == 30645) // Gas Cloud Tracking + return SPELL_SPECIFIC_NORMAL; + case SPELL_AURA_TRACK_RESOURCES: + case SPELL_AURA_TRACK_STEALTHED: + return SPELL_SPECIFIC_TRACKER; } } - break; } - case SPELLFAMILY_MAGE: - { - // family flags 18(Molten), 25(Frost/Ice), 28(Mage) - if (SpellFamilyFlags[0] & 0x12040000) - return SPELL_SPECIFIC_MAGE_ARMOR; - // Arcane brillance and Arcane intelect (normal check fails because of flags difference) - if (SpellFamilyFlags[0] & 0x400) - return SPELL_SPECIFIC_MAGE_ARCANE_BRILLANCE; + return SPELL_SPECIFIC_NORMAL; + }(); +} - if ((SpellFamilyFlags[0] & 0x1000000) && Effects[0].ApplyAuraName == SPELL_AURA_MOD_CONFUSE) - return SPELL_SPECIFIC_MAGE_POLYMORPH; +void SpellInfo::_LoadSpellDiminishInfo() +{ + auto diminishingGroupCompute = [this](bool triggered) -> DiminishingGroup + { + if (IsPositive()) + return DIMINISHING_NONE; - break; - } - case SPELLFAMILY_WARRIOR: + for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) { - if (Id == 12292) // Death Wish - return SPELL_SPECIFIC_WARRIOR_ENRAGE; - - break; + if (Effects[i].ApplyAuraName == SPELL_AURA_MOD_TAUNT) + return DIMINISHING_TAUNT; } - case SPELLFAMILY_WARLOCK: + + // Explicit Diminishing Groups + switch (SpellFamilyName) { - // only warlock curses have this - if (Dispel == DISPEL_CURSE) - return SPELL_SPECIFIC_CURSE; + case SPELLFAMILY_GENERIC: + { + // Pet charge effects (Infernal Awakening, Demon Charge) + if (SpellVisual[0] == 2816 && SpellIconID == 15) + return DIMINISHING_CONTROLLED_STUN; + // Frost Tomb + else if (Id == 48400) + return DIMINISHING_NONE; + // Gnaw + else if (Id == 47481) + return DIMINISHING_CONTROLLED_STUN; + // ToC Icehowl Arctic Breath + else if (SpellVisual[0] == 14153) + return DIMINISHING_NONE; + // Black Plague + else if (Id == 64155) + return DIMINISHING_NONE; + // Screams of the Dead (King Ymiron) + else if (Id == 51750) + return DIMINISHING_NONE; + break; + } + // Event spells + case SPELLFAMILY_UNK1: + return DIMINISHING_NONE; + case SPELLFAMILY_MAGE: + { + // Frostbite + if (SpellFamilyFlags[1] & 0x80000000) + return DIMINISHING_ROOT; + // Shattered Barrier + else if (SpellVisual[0] == 12297) + return DIMINISHING_ROOT; + // Deep Freeze + else if (SpellIconID == 2939 && SpellVisual[0] == 9963) + return DIMINISHING_CONTROLLED_STUN; + // Frost Nova / Freeze (Water Elemental) + else if (SpellIconID == 193) + return DIMINISHING_CONTROLLED_ROOT; + // Dragon's Breath + else if (SpellFamilyFlags[0] & 0x800000) + return DIMINISHING_DRAGONS_BREATH; + break; + } + case SPELLFAMILY_WARRIOR: + { + // Hamstring - limit duration to 10s in PvP + if (SpellFamilyFlags[0] & 0x2) + return DIMINISHING_LIMITONLY; + // Charge Stun (own diminishing) + else if (SpellFamilyFlags[0] & 0x01000000) + return DIMINISHING_CHARGE; + break; + } + case SPELLFAMILY_WARLOCK: + { + // Curses/etc + if ((SpellFamilyFlags[0] & 0x80000000) || (SpellFamilyFlags[1] & 0x200)) + return DIMINISHING_LIMITONLY; + // Seduction + else if (SpellFamilyFlags[1] & 0x10000000) + return DIMINISHING_FEAR; + break; + } + case SPELLFAMILY_DRUID: + { + // Pounce + if (SpellFamilyFlags[0] & 0x20000) + return DIMINISHING_OPENING_STUN; + // Cyclone + else if (SpellFamilyFlags[1] & 0x20) + return DIMINISHING_CYCLONE; + // Entangling Roots + // Nature's Grasp + else if (SpellFamilyFlags[0] & 0x00000200) + return DIMINISHING_CONTROLLED_ROOT; + // Faerie Fire + else if (SpellFamilyFlags[0] & 0x400) + return DIMINISHING_LIMITONLY; + break; + } + case SPELLFAMILY_ROGUE: + { + // Gouge + if (SpellFamilyFlags[0] & 0x8) + return DIMINISHING_DISORIENT; + // Blind + else if (SpellFamilyFlags[0] & 0x1000000) + return DIMINISHING_FEAR; + // Cheap Shot + else if (SpellFamilyFlags[0] & 0x400) + return DIMINISHING_OPENING_STUN; + // Crippling poison - Limit to 10 seconds in PvP (No SpellFamilyFlags) + else if (SpellIconID == 163) + return DIMINISHING_LIMITONLY; + break; + } + case SPELLFAMILY_HUNTER: + { + // Hunter's Mark + if ((SpellFamilyFlags[0] & 0x400) && SpellIconID == 538) + return DIMINISHING_LIMITONLY; + // Scatter Shot (own diminishing) + else if ((SpellFamilyFlags[0] & 0x40000) && SpellIconID == 132) + return DIMINISHING_SCATTER_SHOT; + // Entrapment (own diminishing) + else if (SpellVisual[0] == 7484 && SpellIconID == 20) + return DIMINISHING_ENTRAPMENT; + // Wyvern Sting mechanic is MECHANIC_SLEEP but the diminishing is DIMINISHING_DISORIENT + else if ((SpellFamilyFlags[1] & 0x1000) && SpellIconID == 1721) + return DIMINISHING_DISORIENT; + // Freezing Arrow + else if (SpellFamilyFlags[0] & 0x8) + return DIMINISHING_DISORIENT; + break; + } + case SPELLFAMILY_PALADIN: + { + // Judgement of Justice - limit duration to 10s in PvP + if (SpellFamilyFlags[0] & 0x100000) + return DIMINISHING_LIMITONLY; + // Turn Evil + else if ((SpellFamilyFlags[1] & 0x804000) && SpellIconID == 309) + return DIMINISHING_FEAR; + break; + } + case SPELLFAMILY_SHAMAN: + { + // Storm, Earth and Fire - Earthgrab + if (SpellFamilyFlags[2] & 0x4000) + return DIMINISHING_NONE; + break; + } + case SPELLFAMILY_DEATHKNIGHT: + { + // Hungering Cold (no flags) + if (SpellIconID == 2797) + return DIMINISHING_DISORIENT; + // Mark of Blood + else if ((SpellFamilyFlags[0] & 0x10000000) && SpellIconID == 2285) + return DIMINISHING_LIMITONLY; + break; + } + default: + break; + } - // Warlock (Demon Armor | Demon Skin | Fel Armor) - if (SpellFamilyFlags[1] & 0x20000020 || SpellFamilyFlags[2] & 0x00000010) - return SPELL_SPECIFIC_WARLOCK_ARMOR; + // Lastly - Set diminishing depending on mechanic + uint32 mechanic = GetAllEffectsMechanicMask(); + if (mechanic & (1 << MECHANIC_CHARM)) + return DIMINISHING_MIND_CONTROL; + if (mechanic & (1 << MECHANIC_SILENCE)) + return DIMINISHING_SILENCE; + if (mechanic & (1 << MECHANIC_SLEEP)) + return DIMINISHING_SLEEP; + if (mechanic & ((1 << MECHANIC_SAPPED) | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_SHACKLE))) + return DIMINISHING_DISORIENT; + // Mechanic Knockout, except Blast Wave + if (mechanic & (1 << MECHANIC_KNOCKOUT) && SpellIconID != 292) + return DIMINISHING_DISORIENT; + if (mechanic & (1 << MECHANIC_DISARM)) + return DIMINISHING_DISARM; + if (mechanic & (1 << MECHANIC_FEAR)) + return DIMINISHING_FEAR; + if (mechanic & (1 << MECHANIC_STUN)) + return triggered ? DIMINISHING_STUN : DIMINISHING_CONTROLLED_STUN; + if (mechanic & (1 << MECHANIC_BANISH)) + return DIMINISHING_BANISH; + if (mechanic & (1 << MECHANIC_ROOT)) + return triggered ? DIMINISHING_ROOT : DIMINISHING_CONTROLLED_ROOT; + if (mechanic & (1 << MECHANIC_HORROR)) + return DIMINISHING_HORROR; + + return DIMINISHING_NONE; + }; + + auto diminishingTypeCompute = [](DiminishingGroup group) -> DiminishingReturnsType + { + switch (group) + { + case DIMINISHING_TAUNT: + case DIMINISHING_CONTROLLED_STUN: + case DIMINISHING_STUN: + case DIMINISHING_OPENING_STUN: + case DIMINISHING_CYCLONE: + case DIMINISHING_CHARGE: + return DRTYPE_ALL; + case DIMINISHING_LIMITONLY: + case DIMINISHING_NONE: + return DRTYPE_NONE; + default: + return DRTYPE_PLAYER; + } + }; - //seed of corruption and corruption - if (SpellFamilyFlags[1] & 0x10 || SpellFamilyFlags[0] & 0x2) - return SPELL_SPECIFIC_WARLOCK_CORRUPTION; - break; + auto diminishingMaxLevelCompute = [](DiminishingGroup group) -> DiminishingLevels + { + switch (group) + { + case DIMINISHING_TAUNT: + return DIMINISHING_LEVEL_TAUNT_IMMUNE; + default: + return DIMINISHING_LEVEL_IMMUNE; } - case SPELLFAMILY_PRIEST: + }; + + auto diminishingLimitDurationCompute = [this](DiminishingGroup group) -> int32 + { + auto isGroupDurationLimited = [group]() -> bool { - // Divine Spirit and Prayer of Spirit - if (SpellFamilyFlags[0] & 0x20) - return SPELL_SPECIFIC_PRIEST_DIVINE_SPIRIT; + switch (group) + { + case DIMINISHING_BANISH: + case DIMINISHING_CONTROLLED_STUN: + case DIMINISHING_CONTROLLED_ROOT: + case DIMINISHING_CYCLONE: + case DIMINISHING_DISORIENT: + case DIMINISHING_ENTRAPMENT: + case DIMINISHING_FEAR: + case DIMINISHING_HORROR: + case DIMINISHING_MIND_CONTROL: + case DIMINISHING_OPENING_STUN: + case DIMINISHING_ROOT: + case DIMINISHING_STUN: + case DIMINISHING_SLEEP: + case DIMINISHING_LIMITONLY: + return true; + default: + return false; + } + }; - break; + if (!isGroupDurationLimited()) + return 0; + + // Explicit diminishing duration + switch (SpellFamilyName) + { + case SPELLFAMILY_DRUID: + { + // Faerie Fire - limit to 40 seconds in PvP (3.1) + if (SpellFamilyFlags[0] & 0x400) + return 40 * IN_MILLISECONDS; + break; + } + case SPELLFAMILY_HUNTER: + { + // Wyvern Sting + if (SpellFamilyFlags[1] & 0x1000) + return 6 * IN_MILLISECONDS; + // Hunter's Mark + if (SpellFamilyFlags[0] & 0x400) + return 120 * IN_MILLISECONDS; + break; + } + case SPELLFAMILY_PALADIN: + { + // Repentance - limit to 6 seconds in PvP + if (SpellFamilyFlags[0] & 0x4) + return 6 * IN_MILLISECONDS; + break; + } + case SPELLFAMILY_WARLOCK: + { + // Banish - limit to 6 seconds in PvP + if (SpellFamilyFlags[1] & 0x8000000) + return 6 * IN_MILLISECONDS; + // Curse of Tongues - limit to 12 seconds in PvP + else if (SpellFamilyFlags[2] & 0x800) + return 12 * IN_MILLISECONDS; + // Curse of Elements - limit to 120 seconds in PvP + else if (SpellFamilyFlags[1] & 0x200) + return 120 * IN_MILLISECONDS; + break; + } + default: + break; } - case SPELLFAMILY_HUNTER: + + return 10 * IN_MILLISECONDS; + }; + + SpellDiminishInfo triggeredInfo, normalInfo; + triggeredInfo.DiminishGroup = diminishingGroupCompute(true); + triggeredInfo.DiminishReturnType = diminishingTypeCompute(triggeredInfo.DiminishGroup); + triggeredInfo.DiminishMaxLevel = diminishingMaxLevelCompute(triggeredInfo.DiminishGroup); + triggeredInfo.DiminishDurationLimit = diminishingLimitDurationCompute(triggeredInfo.DiminishGroup); + + normalInfo.DiminishGroup = diminishingGroupCompute(false); + normalInfo.DiminishReturnType = diminishingTypeCompute(normalInfo.DiminishGroup); + normalInfo.DiminishMaxLevel = diminishingMaxLevelCompute(normalInfo.DiminishGroup); + normalInfo.DiminishDurationLimit = diminishingLimitDurationCompute(normalInfo.DiminishGroup); + + _diminishInfoTriggered = triggeredInfo; + _diminishInfoNonTriggered = normalInfo; +} + +DiminishingGroup SpellInfo::GetDiminishingReturnsGroupForSpell(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishGroup : _diminishInfoNonTriggered.DiminishGroup; +} + +DiminishingReturnsType SpellInfo::GetDiminishingReturnsGroupType(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishReturnType : _diminishInfoNonTriggered.DiminishReturnType; +} + +DiminishingLevels SpellInfo::GetDiminishingReturnsMaxLevel(bool triggered) const +{ + return triggered ? _diminishInfoTriggered.DiminishMaxLevel : _diminishInfoNonTriggered.DiminishMaxLevel; +} + +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) { - // only hunter stings have this - if (Dispel == DISPEL_POISON) - return SPELL_SPECIFIC_STING; + 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; - // only hunter aspects have this (but not all aspects in hunter family) - if (SpellFamilyFlags.HasFlag(0x00380000, 0x00440000, 0x00001010)) - return SPELL_SPECIFIC_ASPECT; + 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; - break; + 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; } - case SPELLFAMILY_PALADIN: - { - // Collection of all the seal family flags. No other paladin spell has any of those. - if (SpellFamilyFlags[1] & 0x26000C00 - || SpellFamilyFlags[0] & 0x0A000000) - return SPELL_SPECIFIC_SEAL; - if (SpellFamilyFlags[0] & 0x00002190) - return SPELL_SPECIFIC_HAND; + 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(); + } +} - // Judgement of Wisdom, Judgement of Light, Judgement of Justice - if (Id == 20184 || Id == 20185 || Id == 20186) - return SPELL_SPECIFIC_JUDGEMENT; +void SpellInfo::ApplyAllSpellImmunitiesTo(Unit* target, uint8 effIndex, bool apply) const +{ + ImmunityInfo const* immuneInfo = _immunityInfo + effIndex; - // only paladin auras have this (for palaldin class family) - if (SpellFamilyFlags[2] & 0x00000020) - return SPELL_SPECIFIC_AURA; + if (uint32 schoolImmunity = immuneInfo->SchoolImmuneMask) + { + target->ApplySpellImmune(Id, IMMUNITY_SCHOOL, schoolImmunity, apply); - break; + 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 + }); } - case SPELLFAMILY_SHAMAN: + } + + 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)) { - // family flags 10 (Lightning), 42 (Earth), 37 (Water), proc shield from T2 8 pieces bonus - if (SpellFamilyFlags[1] & 0x420 - || SpellFamilyFlags[0] & 0x00000400 - || Id == 23552) - return SPELL_SPECIFIC_ELEMENTAL_SHIELD; + target->RemoveAppliedAuras([dispelImmunity](AuraApplication const* aurApp) -> bool + { + SpellInfo const* spellInfo = aurApp->GetBase()->GetSpellInfo(); + if (spellInfo->Dispel == dispelImmunity) + return true; - break; + return false; + }); } - case SPELLFAMILY_DEATHKNIGHT: - if (Id == 48266 || Id == 48263 || Id == 48265) - return SPELL_SPECIFIC_PRESENCE; - break; } + 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) { - if (Effects[i].Effect == SPELL_EFFECT_APPLY_AURA) + ImmunityInfo const* immuneInfo = _immunityInfo + i; + + if (!auraSpellInfo->HasAttribute(SPELL_ATTR1_UNAFFECTED_BY_SCHOOL_IMMUNE) && !auraSpellInfo->HasAttribute(SPELL_ATTR2_UNAFFECTED_BY_AURA_SCHOOL_IMMUNE)) { - switch (Effects[i].ApplyAuraName) + 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()) { - case SPELL_AURA_MOD_CHARM: - case SPELL_AURA_MOD_POSSESS_PET: - case SPELL_AURA_MOD_POSSESS: - case SPELL_AURA_AOE_CHARM: - return SPELL_SPECIFIC_CHARM; - case SPELL_AURA_TRACK_CREATURES: - /// @workaround For non-stacking tracking spells (We need generic solution) - if (Id == 30645) // Gas Cloud Tracking - return SPELL_SPECIFIC_NORMAL; - case SPELL_AURA_TRACK_RESOURCES: - case SPELL_AURA_TRACK_STEALTHED: - return SPELL_SPECIFIC_TRACKER; + 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 SPELL_SPECIFIC_NORMAL; + return false; } float SpellInfo::GetMinRange(bool positive) const @@ -2436,6 +3288,9 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const // Impact if (SpellIconID == 45) return true; + // Arcane Missiles + if (SpellFamilyFlags[0] == 0x00000800) + return false; break; case SPELLFAMILY_PRIEST: switch (Id) @@ -2465,6 +3320,9 @@ bool SpellInfo::_IsPositiveEffect(uint8 effIndex, bool deep) const case 32684: // Envenom (Rank 2) case 57992: // Envenom (Rank 3) case 57993: // Envenom (Rank 4) + // Slice and Dice. Prevents breaking Stealth + case 5171: // Slice and Dice (Rank 1) + case 6774: // Slice and Dice (Rank 2) return true; default: break; @@ -2485,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 589ed16e409..d7b48ddb4d2 100644 --- a/src/server/game/Spells/SpellInfo.h +++ b/src/server/game/Spells/SpellInfo.h @@ -24,10 +24,13 @@ #include "Object.h" #include "SpellAuraDefines.h" +#include <boost/container/flat_set.hpp> + class Unit; class Player; class Item; class Spell; +class SpellMgr; class SpellInfo; struct SpellChainNode; struct SpellTargetPosition; @@ -291,201 +294,252 @@ private: static StaticData _data[TOTAL_SPELL_EFFECTS]; }; +struct TC_GAME_API SpellDiminishInfo +{ + DiminishingGroup DiminishGroup = DIMINISHING_NONE; + DiminishingReturnsType DiminishReturnType = DRTYPE_NONE; + DiminishingLevels DiminishMaxLevel = DIMINISHING_LEVEL_IMMUNE; + 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 { -public: - uint32 Id; - SpellCategoryEntry const* CategoryEntry; - uint32 Dispel; - uint32 Mechanic; - uint32 Attributes; - uint32 AttributesEx; - uint32 AttributesEx2; - uint32 AttributesEx3; - uint32 AttributesEx4; - uint32 AttributesEx5; - uint32 AttributesEx6; - uint32 AttributesEx7; - uint32 AttributesCu; - uint64 Stances; - uint64 StancesNot; - uint32 Targets; - uint32 TargetCreatureType; - uint32 RequiresSpellFocus; - uint32 FacingCasterFlags; - uint32 CasterAuraState; - uint32 TargetAuraState; - uint32 CasterAuraStateNot; - uint32 TargetAuraStateNot; - uint32 CasterAuraSpell; - uint32 TargetAuraSpell; - uint32 ExcludeCasterAuraSpell; - uint32 ExcludeTargetAuraSpell; - SpellCastTimesEntry const* CastTimeEntry; - uint32 RecoveryTime; - uint32 CategoryRecoveryTime; - uint32 StartRecoveryCategory; - uint32 StartRecoveryTime; - uint32 InterruptFlags; - uint32 AuraInterruptFlags; - uint32 ChannelInterruptFlags; - uint32 ProcFlags; - uint32 ProcChance; - uint32 ProcCharges; - uint32 MaxLevel; - uint32 BaseLevel; - uint32 SpellLevel; - SpellDurationEntry const* DurationEntry; - uint32 PowerType; - uint32 ManaCost; - uint32 ManaCostPerlevel; - uint32 ManaPerSecond; - uint32 ManaPerSecondPerLevel; - uint32 ManaCostPercentage; - uint32 RuneCostID; - SpellRangeEntry const* RangeEntry; - float Speed; - uint32 StackAmount; - uint32 Totem[2]; - int32 Reagent[MAX_SPELL_REAGENTS]; - uint32 ReagentCount[MAX_SPELL_REAGENTS]; - int32 EquippedItemClass; - int32 EquippedItemSubClassMask; - int32 EquippedItemInventoryTypeMask; - uint32 TotemCategory[2]; - uint32 SpellVisual[2]; - uint32 SpellIconID; - uint32 ActiveIconID; - char* SpellName[16]; - char* Rank[16]; - uint32 MaxTargetLevel; - uint32 MaxAffectedTargets; - uint32 SpellFamilyName; - flag96 SpellFamilyFlags; - uint32 DmgClass; - uint32 PreventionType; - int32 AreaGroupId; - uint32 SchoolMask; - SpellEffectInfo Effects[MAX_SPELL_EFFECTS]; - uint32 ExplicitTargetMask; - SpellChainNode const* ChainEntry; - - SpellInfo(SpellEntry const* spellEntry); - ~SpellInfo(); - - uint32 GetCategory() const; - bool HasEffect(SpellEffects effect) const; - bool HasAura(AuraType aura) const; - bool HasAreaAuraEffect() const; - - inline bool HasAttribute(SpellAttr0 attribute) const { return !!(Attributes & attribute); } - inline bool HasAttribute(SpellAttr1 attribute) const { return !!(AttributesEx & attribute); } - inline bool HasAttribute(SpellAttr2 attribute) const { return !!(AttributesEx2 & attribute); } - inline bool HasAttribute(SpellAttr3 attribute) const { return !!(AttributesEx3 & attribute); } - inline bool HasAttribute(SpellAttr4 attribute) const { return !!(AttributesEx4 & attribute); } - inline bool HasAttribute(SpellAttr5 attribute) const { return !!(AttributesEx5 & attribute); } - inline bool HasAttribute(SpellAttr6 attribute) const { return !!(AttributesEx6 & attribute); } - inline bool HasAttribute(SpellAttr7 attribute) const { return !!(AttributesEx7 & attribute); } - inline bool HasAttribute(SpellCustomAttributes customAttribute) const { return !!(AttributesCu & customAttribute); } - - bool IsExplicitDiscovery() const; - bool IsLootCrafting() const; - bool IsQuestTame() const; - bool IsProfessionOrRiding() const; - bool IsProfession() const; - bool IsPrimaryProfession() const; - bool IsPrimaryProfessionFirstRank() const; - bool IsAbilityLearnedWithProfession() const; - bool IsAbilityOfSkillType(uint32 skillType) const; - - bool IsAffectingArea() const; - bool IsTargetingArea() const; - bool NeedsExplicitUnitTarget() const; - bool NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) const; - - bool IsPassive() const; - bool IsAutocastable() const; - bool IsStackableWithRanks() const; - bool IsPassiveStackableWithRanks() const; - bool IsMultiSlotAura() const; - bool IsStackableOnOneSlotWithDifferentCasters() const; - bool IsCooldownStartedOnEvent() const; - bool IsDeathPersistent() const; - bool IsRequiringDeadTarget() const; - bool IsAllowingDeadTarget() const; - bool IsGroupBuff() const; - bool CanBeUsedInCombat() const; - bool IsPositive() const; - bool IsPositiveEffect(uint8 effIndex) const; - bool IsChanneled() const; - bool NeedsComboPoints() const; - bool IsBreakingStealth() const; - bool IsRangedWeaponSpell() const; - bool IsAutoRepeatRangedSpell() const; - bool HasInitialAggro() const; - - bool IsAffectedBySpellMods() const; - bool IsAffectedBySpellMod(SpellModifier const* mod) const; - - bool CanPierceImmuneAura(SpellInfo const* aura) const; - bool CanDispelAura(SpellInfo const* aura) const; - - bool IsSingleTarget() const; - bool IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const; - bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const* spellInfo) const; - - SpellCastResult CheckShapeshift(uint32 form) const; - SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const; - SpellCastResult CheckTarget(Unit const* caster, WorldObject const* target, bool implicit = true) const; - SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const; - SpellCastResult CheckVehicle(Unit const* caster) const; - bool CheckTargetCreatureType(Unit const* target) const; - - SpellSchoolMask GetSchoolMask() const; - uint32 GetAllEffectsMechanicMask() const; - uint32 GetEffectMechanicMask(uint8 effIndex) const; - uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const; - Mechanics GetEffectMechanic(uint8 effIndex) const; - bool HasAnyEffectMechanic() const; - uint32 GetDispelMask() const; - static uint32 GetDispelMask(DispelType type); - uint32 GetExplicitTargetMask() const; - - AuraStateType GetAuraState() const; - SpellSpecificType GetSpellSpecific() const; - - float GetMinRange(bool positive = false) const; - float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const; - - int32 GetDuration() const; - int32 GetMaxDuration() const; - - uint32 GetMaxTicks() const; - - uint32 CalcCastTime(Spell* spell = NULL) const; - uint32 GetRecoveryTime() const; - - int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; - - bool IsRanked() const; - uint8 GetRank() const; - SpellInfo const* GetFirstRankSpell() const; - SpellInfo const* GetLastRankSpell() const; - SpellInfo const* GetNextRankSpell() const; - SpellInfo const* GetPrevRankSpell() const; - SpellInfo const* GetAuraRankForLevel(uint8 level) const; - bool IsRankOf(SpellInfo const* spellInfo) const; - bool IsDifferentRankOf(SpellInfo const* spellInfo) const; - bool IsHighRankOf(SpellInfo const* spellInfo) const; - - // loading helpers - void _InitializeExplicitTargetMask(); - bool _IsPositiveEffect(uint8 effIndex, bool deep) const; - bool _IsPositiveSpell() const; - static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); - - // unloading helpers - void _UnloadImplicitTargetConditionLists(); + friend class SpellMgr; + + public: + uint32 Id; + SpellCategoryEntry const* CategoryEntry; + uint32 Dispel; + uint32 Mechanic; + uint32 Attributes; + uint32 AttributesEx; + uint32 AttributesEx2; + uint32 AttributesEx3; + uint32 AttributesEx4; + uint32 AttributesEx5; + uint32 AttributesEx6; + uint32 AttributesEx7; + uint32 AttributesCu; + uint64 Stances; + uint64 StancesNot; + uint32 Targets; + uint32 TargetCreatureType; + uint32 RequiresSpellFocus; + uint32 FacingCasterFlags; + uint32 CasterAuraState; + uint32 TargetAuraState; + uint32 CasterAuraStateNot; + uint32 TargetAuraStateNot; + uint32 CasterAuraSpell; + uint32 TargetAuraSpell; + uint32 ExcludeCasterAuraSpell; + uint32 ExcludeTargetAuraSpell; + SpellCastTimesEntry const* CastTimeEntry; + uint32 RecoveryTime; + uint32 CategoryRecoveryTime; + uint32 StartRecoveryCategory; + uint32 StartRecoveryTime; + uint32 InterruptFlags; + uint32 AuraInterruptFlags; + uint32 ChannelInterruptFlags; + uint32 ProcFlags; + uint32 ProcChance; + uint32 ProcCharges; + uint32 MaxLevel; + uint32 BaseLevel; + uint32 SpellLevel; + SpellDurationEntry const* DurationEntry; + uint32 PowerType; + uint32 ManaCost; + uint32 ManaCostPerlevel; + uint32 ManaPerSecond; + uint32 ManaPerSecondPerLevel; + uint32 ManaCostPercentage; + uint32 RuneCostID; + SpellRangeEntry const* RangeEntry; + float Speed; + uint32 StackAmount; + uint32 Totem[2]; + int32 Reagent[MAX_SPELL_REAGENTS]; + uint32 ReagentCount[MAX_SPELL_REAGENTS]; + int32 EquippedItemClass; + int32 EquippedItemSubClassMask; + int32 EquippedItemInventoryTypeMask; + uint32 TotemCategory[2]; + uint32 SpellVisual[2]; + uint32 SpellIconID; + uint32 ActiveIconID; + char* SpellName[16]; + char* Rank[16]; + uint32 MaxTargetLevel; + uint32 MaxAffectedTargets; + uint32 SpellFamilyName; + flag96 SpellFamilyFlags; + uint32 DmgClass; + uint32 PreventionType; + int32 AreaGroupId; + uint32 SchoolMask; + SpellEffectInfo Effects[MAX_SPELL_EFFECTS]; + uint32 ExplicitTargetMask; + SpellChainNode const* ChainEntry; + + SpellInfo(SpellEntry const* spellEntry); + ~SpellInfo(); + + uint32 GetCategory() const; + 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); } + inline bool HasAttribute(SpellAttr2 attribute) const { return !!(AttributesEx2 & attribute); } + inline bool HasAttribute(SpellAttr3 attribute) const { return !!(AttributesEx3 & attribute); } + inline bool HasAttribute(SpellAttr4 attribute) const { return !!(AttributesEx4 & attribute); } + inline bool HasAttribute(SpellAttr5 attribute) const { return !!(AttributesEx5 & attribute); } + inline bool HasAttribute(SpellAttr6 attribute) const { return !!(AttributesEx6 & attribute); } + inline bool HasAttribute(SpellAttr7 attribute) const { return !!(AttributesEx7 & attribute); } + inline bool HasAttribute(SpellCustomAttributes customAttribute) const { return !!(AttributesCu & customAttribute); } + + bool IsExplicitDiscovery() const; + bool IsLootCrafting() const; + bool IsQuestTame() const; + bool IsProfessionOrRiding() const; + bool IsProfession() const; + bool IsPrimaryProfession() const; + bool IsPrimaryProfessionFirstRank() const; + bool IsAbilityLearnedWithProfession() const; + bool IsAbilityOfSkillType(uint32 skillType) const; + + bool IsAffectingArea() const; + bool IsTargetingArea() const; + bool NeedsExplicitUnitTarget() const; + bool NeedsToBeTriggeredByCaster(SpellInfo const* triggeringSpell) const; + + bool IsPassive() const; + bool IsAutocastable() const; + bool IsStackableWithRanks() const; + bool IsPassiveStackableWithRanks() const; + bool IsMultiSlotAura() const; + bool IsStackableOnOneSlotWithDifferentCasters() const; + bool IsCooldownStartedOnEvent() const; + bool IsDeathPersistent() const; + bool IsRequiringDeadTarget() const; + bool IsAllowingDeadTarget() const; + bool IsGroupBuff() const; + bool CanBeUsedInCombat() const; + 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* auraSpellInfo) const; + bool CanDispelAura(SpellInfo const* auraSpellInfo) const; + + bool IsSingleTarget() const; + bool IsAuraExclusiveBySpecificWith(SpellInfo const* spellInfo) const; + bool IsAuraExclusiveBySpecificPerCasterWith(SpellInfo const* spellInfo) const; + + SpellCastResult CheckShapeshift(uint32 form) const; + SpellCastResult CheckLocation(uint32 map_id, uint32 zone_id, uint32 area_id, Player const* player = NULL) const; + SpellCastResult CheckTarget(Unit const* caster, WorldObject const* target, bool implicit = true) const; + SpellCastResult CheckExplicitTarget(Unit const* caster, WorldObject const* target, Item const* itemTarget = NULL) const; + SpellCastResult CheckVehicle(Unit const* caster) const; + bool CheckTargetCreatureType(Unit const* target) const; + + SpellSchoolMask GetSchoolMask() const; + uint32 GetAllEffectsMechanicMask() const; + uint32 GetEffectMechanicMask(uint8 effIndex) const; + uint32 GetSpellMechanicMaskByEffectMask(uint32 effectMask) const; + Mechanics GetEffectMechanic(uint8 effIndex) const; + bool HasAnyEffectMechanic() const; + uint32 GetDispelMask() const; + static uint32 GetDispelMask(DispelType type); + uint32 GetExplicitTargetMask() const; + + AuraStateType GetAuraState() const; + SpellSpecificType GetSpellSpecific() const; + + float GetMinRange(bool positive = false) const; + float GetMaxRange(bool positive = false, Unit* caster = NULL, Spell* spell = NULL) const; + + int32 GetDuration() const; + int32 GetMaxDuration() const; + + uint32 GetMaxTicks() const; + + uint32 CalcCastTime(Spell* spell = NULL) const; + uint32 GetRecoveryTime() const; + + int32 CalcPowerCost(Unit const* caster, SpellSchoolMask schoolMask) const; + + bool IsRanked() const; + uint8 GetRank() const; + SpellInfo const* GetFirstRankSpell() const; + SpellInfo const* GetLastRankSpell() const; + SpellInfo const* GetNextRankSpell() const; + SpellInfo const* GetPrevRankSpell() const; + SpellInfo const* GetAuraRankForLevel(uint8 level) const; + bool IsRankOf(SpellInfo const* spellInfo) const; + bool IsDifferentRankOf(SpellInfo const* spellInfo) const; + bool IsHighRankOf(SpellInfo const* spellInfo) const; + + // spell diminishing returns + DiminishingGroup GetDiminishingReturnsGroupForSpell(bool triggered) const; + DiminishingReturnsType GetDiminishingReturnsGroupType(bool triggered) const; + 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(); + bool _IsPositiveEffect(uint8 effIndex, bool deep) const; + bool _IsPositiveSpell() const; + static bool _IsPositiveTarget(uint32 targetA, uint32 targetB); + void _LoadSpellSpecific(); + void _LoadAuraState(); + void _LoadSpellDiminishInfo(); + void _LoadImmunityInfo(); + + // unloading helpers + void _UnloadImplicitTargetConditionLists(); + + SpellSpecificType _spellSpecific; + AuraStateType _auraState; + + 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 bab1a34c038..bd13f1b2c7b 100644 --- a/src/server/game/Spells/SpellMgr.cpp +++ b/src/server/game/Spells/SpellMgr.cpp @@ -51,302 +51,6 @@ bool IsPartOfSkillLine(uint32 skillId, uint32 spellId) return false; } -DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, bool triggered) -{ - if (spellproto->IsPositive()) - return DIMINISHING_NONE; - - for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i) - { - if (spellproto->Effects[i].ApplyAuraName == SPELL_AURA_MOD_TAUNT) - return DIMINISHING_TAUNT; - } - - // Explicit Diminishing Groups - switch (spellproto->SpellFamilyName) - { - case SPELLFAMILY_GENERIC: - { - // Pet charge effects (Infernal Awakening, Demon Charge) - if (spellproto->SpellVisual[0] == 2816 && spellproto->SpellIconID == 15) - return DIMINISHING_CONTROLLED_STUN; - // Frost Tomb - else if (spellproto->Id == 48400) - return DIMINISHING_NONE; - // Gnaw - else if (spellproto->Id == 47481) - return DIMINISHING_CONTROLLED_STUN; - // ToC Icehowl Arctic Breath - else if (spellproto->SpellVisual[0] == 14153) - return DIMINISHING_NONE; - // Black Plague - else if (spellproto->Id == 64155) - return DIMINISHING_NONE; - // Screams of the Dead (King Ymiron) - else if (spellproto->Id == 51750) - return DIMINISHING_NONE; - break; - } - // Event spells - case SPELLFAMILY_UNK1: - return DIMINISHING_NONE; - case SPELLFAMILY_MAGE: - { - // Frostbite - if (spellproto->SpellFamilyFlags[1] & 0x80000000) - return DIMINISHING_ROOT; - // Shattered Barrier - else if (spellproto->SpellVisual[0] == 12297) - return DIMINISHING_ROOT; - // Deep Freeze - else if (spellproto->SpellIconID == 2939 && spellproto->SpellVisual[0] == 9963) - return DIMINISHING_CONTROLLED_STUN; - // Frost Nova / Freeze (Water Elemental) - else if (spellproto->SpellIconID == 193) - return DIMINISHING_CONTROLLED_ROOT; - // Dragon's Breath - else if (spellproto->SpellFamilyFlags[0] & 0x800000) - return DIMINISHING_DRAGONS_BREATH; - break; - } - case SPELLFAMILY_WARRIOR: - { - // Hamstring - limit duration to 10s in PvP - if (spellproto->SpellFamilyFlags[0] & 0x2) - return DIMINISHING_LIMITONLY; - // Charge Stun (own diminishing) - else if (spellproto->SpellFamilyFlags[0] & 0x01000000) - return DIMINISHING_CHARGE; - break; - } - case SPELLFAMILY_WARLOCK: - { - // Curses/etc - if ((spellproto->SpellFamilyFlags[0] & 0x80000000) || (spellproto->SpellFamilyFlags[1] & 0x200)) - return DIMINISHING_LIMITONLY; - // Seduction - else if (spellproto->SpellFamilyFlags[1] & 0x10000000) - return DIMINISHING_FEAR; - break; - } - case SPELLFAMILY_DRUID: - { - // Pounce - if (spellproto->SpellFamilyFlags[0] & 0x20000) - return DIMINISHING_OPENING_STUN; - // Cyclone - else if (spellproto->SpellFamilyFlags[1] & 0x20) - return DIMINISHING_CYCLONE; - // Entangling Roots - // Nature's Grasp - else if (spellproto->SpellFamilyFlags[0] & 0x00000200) - return DIMINISHING_CONTROLLED_ROOT; - // Faerie Fire - else if (spellproto->SpellFamilyFlags[0] & 0x400) - return DIMINISHING_LIMITONLY; - break; - } - case SPELLFAMILY_ROGUE: - { - // Gouge - if (spellproto->SpellFamilyFlags[0] & 0x8) - return DIMINISHING_DISORIENT; - // Blind - else if (spellproto->SpellFamilyFlags[0] & 0x1000000) - return DIMINISHING_FEAR; - // Cheap Shot - else if (spellproto->SpellFamilyFlags[0] & 0x400) - return DIMINISHING_OPENING_STUN; - // Crippling poison - Limit to 10 seconds in PvP (No SpellFamilyFlags) - else if (spellproto->SpellIconID == 163) - return DIMINISHING_LIMITONLY; - break; - } - case SPELLFAMILY_HUNTER: - { - // Hunter's Mark - if ((spellproto->SpellFamilyFlags[0] & 0x400) && spellproto->SpellIconID == 538) - return DIMINISHING_LIMITONLY; - // Scatter Shot (own diminishing) - else if ((spellproto->SpellFamilyFlags[0] & 0x40000) && spellproto->SpellIconID == 132) - return DIMINISHING_SCATTER_SHOT; - // Entrapment (own diminishing) - else if (spellproto->SpellVisual[0] == 7484 && spellproto->SpellIconID == 20) - return DIMINISHING_ENTRAPMENT; - // Wyvern Sting mechanic is MECHANIC_SLEEP but the diminishing is DIMINISHING_DISORIENT - else if ((spellproto->SpellFamilyFlags[1] & 0x1000) && spellproto->SpellIconID == 1721) - return DIMINISHING_DISORIENT; - // Freezing Arrow - else if (spellproto->SpellFamilyFlags[0] & 0x8) - return DIMINISHING_DISORIENT; - break; - } - case SPELLFAMILY_PALADIN: - { - // Judgement of Justice - limit duration to 10s in PvP - if (spellproto->SpellFamilyFlags[0] & 0x100000) - return DIMINISHING_LIMITONLY; - // Turn Evil - else if ((spellproto->SpellFamilyFlags[1] & 0x804000) && spellproto->SpellIconID == 309) - return DIMINISHING_FEAR; - break; - } - case SPELLFAMILY_SHAMAN: - { - // Storm, Earth and Fire - Earthgrab - if (spellproto->SpellFamilyFlags[2] & 0x4000) - return DIMINISHING_NONE; - break; - } - case SPELLFAMILY_DEATHKNIGHT: - { - // Hungering Cold (no flags) - if (spellproto->SpellIconID == 2797) - return DIMINISHING_DISORIENT; - // Mark of Blood - else if ((spellproto->SpellFamilyFlags[0] & 0x10000000) && spellproto->SpellIconID == 2285) - return DIMINISHING_LIMITONLY; - break; - } - default: - break; - } - - // Lastly - Set diminishing depending on mechanic - uint32 mechanic = spellproto->GetAllEffectsMechanicMask(); - if (mechanic & (1 << MECHANIC_CHARM)) - return DIMINISHING_MIND_CONTROL; - if (mechanic & (1 << MECHANIC_SILENCE)) - return DIMINISHING_SILENCE; - if (mechanic & (1 << MECHANIC_SLEEP)) - return DIMINISHING_SLEEP; - if (mechanic & ((1 << MECHANIC_SAPPED) | (1 << MECHANIC_POLYMORPH) | (1 << MECHANIC_SHACKLE))) - return DIMINISHING_DISORIENT; - // Mechanic Knockout, except Blast Wave - if (mechanic & (1 << MECHANIC_KNOCKOUT) && spellproto->SpellIconID != 292) - return DIMINISHING_DISORIENT; - if (mechanic & (1 << MECHANIC_DISARM)) - return DIMINISHING_DISARM; - if (mechanic & (1 << MECHANIC_FEAR)) - return DIMINISHING_FEAR; - if (mechanic & (1 << MECHANIC_STUN)) - return triggered ? DIMINISHING_STUN : DIMINISHING_CONTROLLED_STUN; - if (mechanic & (1 << MECHANIC_BANISH)) - return DIMINISHING_BANISH; - if (mechanic & (1 << MECHANIC_ROOT)) - return triggered ? DIMINISHING_ROOT : DIMINISHING_CONTROLLED_ROOT; - if (mechanic & (1 << MECHANIC_HORROR)) - return DIMINISHING_HORROR; - - return DIMINISHING_NONE; -} - -DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group) -{ - switch (group) - { - case DIMINISHING_TAUNT: - case DIMINISHING_CONTROLLED_STUN: - case DIMINISHING_STUN: - case DIMINISHING_OPENING_STUN: - case DIMINISHING_CYCLONE: - case DIMINISHING_CHARGE: - return DRTYPE_ALL; - case DIMINISHING_LIMITONLY: - case DIMINISHING_NONE: - return DRTYPE_NONE; - default: - return DRTYPE_PLAYER; - } -} - -DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group) -{ - switch (group) - { - case DIMINISHING_TAUNT: - return DIMINISHING_LEVEL_TAUNT_IMMUNE; - default: - return DIMINISHING_LEVEL_IMMUNE; - } -} - -int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const* spellproto) -{ - if (!IsDiminishingReturnsGroupDurationLimited(group)) - return 0; - - // Explicit diminishing duration - switch (spellproto->SpellFamilyName) - { - case SPELLFAMILY_DRUID: - { - // Faerie Fire - limit to 40 seconds in PvP (3.1) - if (spellproto->SpellFamilyFlags[0] & 0x400) - return 40 * IN_MILLISECONDS; - break; - } - case SPELLFAMILY_HUNTER: - { - // Wyvern Sting - if (spellproto->SpellFamilyFlags[1] & 0x1000) - return 6 * IN_MILLISECONDS; - // Hunter's Mark - if (spellproto->SpellFamilyFlags[0] & 0x400) - return 120 * IN_MILLISECONDS; - break; - } - case SPELLFAMILY_PALADIN: - { - // Repentance - limit to 6 seconds in PvP - if (spellproto->SpellFamilyFlags[0] & 0x4) - return 6 * IN_MILLISECONDS; - break; - } - case SPELLFAMILY_WARLOCK: - { - // Banish - limit to 6 seconds in PvP - if (spellproto->SpellFamilyFlags[1] & 0x8000000) - return 6 * IN_MILLISECONDS; - // Curse of Tongues - limit to 12 seconds in PvP - else if (spellproto->SpellFamilyFlags[2] & 0x800) - return 12 * IN_MILLISECONDS; - // Curse of Elements - limit to 120 seconds in PvP - else if (spellproto->SpellFamilyFlags[1] & 0x200) - return 120 * IN_MILLISECONDS; - break; - } - default: - break; - } - - return 10 * IN_MILLISECONDS; -} - -bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group) -{ - switch (group) - { - case DIMINISHING_BANISH: - case DIMINISHING_CONTROLLED_STUN: - case DIMINISHING_CONTROLLED_ROOT: - case DIMINISHING_CYCLONE: - case DIMINISHING_DISORIENT: - case DIMINISHING_ENTRAPMENT: - case DIMINISHING_FEAR: - case DIMINISHING_HORROR: - case DIMINISHING_MIND_CONTROL: - case DIMINISHING_OPENING_STUN: - case DIMINISHING_ROOT: - case DIMINISHING_STUN: - case DIMINISHING_SLEEP: - case DIMINISHING_LIMITONLY: - return true; - default: - return false; - } -} - SpellMgr::SpellMgr() { } SpellMgr::~SpellMgr() @@ -788,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)) @@ -811,7 +515,8 @@ bool SpellMgr::CanSpellTriggerProcOnEvent(SpellProcEntry const& procEntry, ProcE return true; // do triggered cast checks - if (!(procEntry.AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC)) + // Do not consider autoattacks as triggered spells + if (!(procEntry.AttributesMask & PROC_ATTR_TRIGGERED_CAN_PROC) && !(eventInfo.GetTypeMask() & AUTO_ATTACK_PROC_FLAG_MASK)) { if (Spell const* spell = eventInfo.GetProcSpell()) { @@ -830,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; } @@ -1707,71 +1405,6 @@ void SpellMgr::LoadSpellGroupStackRules() TC_LOG_INFO("server.loading", ">> Loaded %u spell group stack rules in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); } -// Used for prepare can/can't triggr aura -static bool InitTriggerAuraData(); -// Define can trigger auras -static bool isTriggerAura[TOTAL_AURAS]; -// Triggered always, even from triggered spells -static bool isAlwaysTriggeredAura[TOTAL_AURAS]; -// Prepare lists -static bool procPrepared = InitTriggerAuraData(); - -// List of auras that CAN be trigger but may not exist in spell_proc_event -// in most case need for drop charges -// in some types of aura need do additional check -// for example SPELL_AURA_MECHANIC_IMMUNITY - need check for mechanic -bool InitTriggerAuraData() -{ - for (uint16 i = 0; i < TOTAL_AURAS; ++i) - { - isTriggerAura[i] = false; - isAlwaysTriggeredAura[i] = false; - } - isTriggerAura[SPELL_AURA_DUMMY] = true; // Most dummy auras should require scripting. Remove? - isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; // "Any direct damaging attack will revive targets" - isTriggerAura[SPELL_AURA_MOD_THREAT] = true; // Only one spell: 28762 part of Mage T3 8p bonus - isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger - isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true; - isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true; - isTriggerAura[SPELL_AURA_MOD_STEALTH] = true; - isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger - isTriggerAura[SPELL_AURA_MOD_ROOT] = true; - isTriggerAura[SPELL_AURA_TRANSFORM] = true; - isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true; - isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true; - isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true; - isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true; - isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true; - isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true; - isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN] = true; - isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER] = true; - isTriggerAura[SPELL_AURA_ADD_CASTER_HIT_TRIGGER] = true; - isTriggerAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; - isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; - isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; - isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; - isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; - isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; - isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; - isTriggerAura[SPELL_AURA_ADD_FLAT_MODIFIER] = true; - isTriggerAura[SPELL_AURA_ADD_PCT_MODIFIER] = true; - isTriggerAura[SPELL_AURA_ABILITY_IGNORE_AURASTATE] = true; - - isAlwaysTriggeredAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_FEAR] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_ROOT] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_STUN] = true; - isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; - isAlwaysTriggeredAura[SPELL_AURA_SPELL_MAGNET] = true; - isAlwaysTriggeredAura[SPELL_AURA_SCHOOL_ABSORB] = true; - isAlwaysTriggeredAura[SPELL_AURA_MOD_STEALTH] = true; - - return true; -} - void SpellMgr::LoadSpellProcs() { uint32 oldMSTime = getMSTime(); @@ -1884,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; @@ -1900,6 +1536,73 @@ void SpellMgr::LoadSpellProcs() TC_LOG_INFO("server.loading", ">> Loaded %u spell proc conditions and data in %u ms", count, GetMSTimeDiffToNow(oldMSTime)); + // Define can trigger auras + bool isTriggerAura[TOTAL_AURAS]; + // Triggered always, even from triggered spells + bool isAlwaysTriggeredAura[TOTAL_AURAS]; + // SpellTypeMask to add to the proc + uint32 spellTypeMask[TOTAL_AURAS]; + + // List of auras that CAN trigger but may not exist in spell_proc + // in most cases needed to drop charges + + // some aura types need additional checks (eg SPELL_AURA_MECHANIC_IMMUNITY needs mechanic check) + // see AuraEffect::CheckEffectProc + for (uint16 i = 0; i < TOTAL_AURAS; ++i) + { + isTriggerAura[i] = false; + isAlwaysTriggeredAura[i] = false; + spellTypeMask[i] = PROC_SPELL_TYPE_MASK_ALL; + } + + isTriggerAura[SPELL_AURA_DUMMY] = true; // Most dummy auras should require scripting, but there are some exceptions (ie 12311) + isTriggerAura[SPELL_AURA_MOD_CONFUSE] = true; // "Any direct damaging attack will revive targets" + isTriggerAura[SPELL_AURA_MOD_THREAT] = true; // Only one spell: 28762 part of Mage T3 8p bonus + isTriggerAura[SPELL_AURA_MOD_STUN] = true; // Aura does not have charges but needs to be removed on trigger + isTriggerAura[SPELL_AURA_MOD_DAMAGE_DONE] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_TAKEN] = true; + isTriggerAura[SPELL_AURA_MOD_RESISTANCE] = true; + isTriggerAura[SPELL_AURA_MOD_STEALTH] = true; + isTriggerAura[SPELL_AURA_MOD_FEAR] = true; // Aura does not have charges but needs to be removed on trigger + isTriggerAura[SPELL_AURA_MOD_ROOT] = true; + isTriggerAura[SPELL_AURA_TRANSFORM] = true; + isTriggerAura[SPELL_AURA_REFLECT_SPELLS] = true; + isTriggerAura[SPELL_AURA_DAMAGE_IMMUNITY] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_DAMAGE] = true; + isTriggerAura[SPELL_AURA_MOD_CASTING_SPEED_NOT_STACK] = true; + isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL_PCT] = true; + isTriggerAura[SPELL_AURA_MOD_POWER_COST_SCHOOL] = true; + isTriggerAura[SPELL_AURA_REFLECT_SPELLS_SCHOOL] = true; + isTriggerAura[SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACK_POWER] = true; + isTriggerAura[SPELL_AURA_ADD_CASTER_HIT_TRIGGER] = true; + isTriggerAura[SPELL_AURA_OVERRIDE_CLASS_SCRIPTS] = true; + isTriggerAura[SPELL_AURA_MOD_MELEE_HASTE] = true; + isTriggerAura[SPELL_AURA_MOD_ATTACKER_MELEE_HIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE] = true; + isTriggerAura[SPELL_AURA_RAID_PROC_FROM_CHARGE_WITH_VALUE] = true; + isTriggerAura[SPELL_AURA_PROC_TRIGGER_SPELL_WITH_VALUE] = true; + isTriggerAura[SPELL_AURA_MOD_SPELL_CRIT_CHANCE] = true; + isTriggerAura[SPELL_AURA_ADD_FLAT_MODIFIER] = true; + isTriggerAura[SPELL_AURA_ADD_PCT_MODIFIER] = true; + 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; + isAlwaysTriggeredAura[SPELL_AURA_TRANSFORM] = true; + + spellTypeMask[SPELL_AURA_MOD_STEALTH] = PROC_SPELL_TYPE_DAMAGE | PROC_SPELL_TYPE_NO_DMG_HEAL; + spellTypeMask[SPELL_AURA_MOD_CONFUSE] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_FEAR] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_ROOT] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_MOD_STUN] = PROC_SPELL_TYPE_DAMAGE; + spellTypeMask[SPELL_AURA_TRANSFORM] = PROC_SPELL_TYPE_DAMAGE; + // This generates default procs to retain compatibility with previous proc system TC_LOG_INFO("server.loading", "Generating spell proc data from SpellMap..."); count = 0; @@ -1910,10 +1613,16 @@ void SpellMgr::LoadSpellProcs() if (!spellInfo) continue; + // Data already present in DB, overwrites default proc if (mSpellProcMap.find(spellInfo->Id) != mSpellProcMap.end()) continue; - bool found = false, addTriggerFlag = false; + // 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) { if (!spellInfo->Effects[i].IsEffect()) @@ -1926,28 +1635,42 @@ void SpellMgr::LoadSpellProcs() if (!isTriggerAura[auraName]) continue; - found = true; - - if (!addTriggerFlag && isAlwaysTriggeredAura[auraName]) + 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 (!found) - continue; - - if (!spellInfo->ProcFlags) + if (!procSpellTypeMask) continue; SpellProcEntry procEntry; procEntry.SchoolMask = 0; - procEntry.SpellFamilyName = spellInfo->SpellFamilyName; procEntry.ProcFlags = spellInfo->ProcFlags; + procEntry.SpellFamilyName = 0; for (uint32 i = 0; i < MAX_SPELL_EFFECTS; ++i) if (spellInfo->Effects[i].IsEffect() && isTriggerAura[spellInfo->Effects[i].ApplyAuraName]) procEntry.SpellFamilyMask |= spellInfo->Effects[i].SpellClassMask; - procEntry.SpellTypeMask = PROC_SPELL_TYPE_MASK_ALL; + if (procEntry.SpellFamilyMask) + procEntry.SpellFamilyName = spellInfo->SpellFamilyName; + + procEntry.SpellTypeMask = procSpellTypeMask; procEntry.SpellPhaseMask = PROC_SPELL_PHASE_HIT; procEntry.HitMask = PROC_HIT_NONE; // uses default proc @see SpellMgr::CanSpellTriggerProcOnEvent @@ -2895,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; @@ -2922,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: @@ -3004,6 +2738,12 @@ void SpellMgr::LoadSpellInfoCorrections() case 53385: // Divine Storm (Damage) spellInfo->MaxAffectedTargets = 4; break; + case 56342: // Lock and Load (Rank 1) + // @workaround: Delete dummy effect from rank 1, + // effect apply aura has TargetA == TargetB == 0 but core still applies it to caster + // core bug? + spellInfo->Effects[EFFECT_2].Effect = 0; + break; case 53480: // Roar of Sacrifice // missing spell effect 2 data, taken from 4.3.4 spellInfo->Effects[EFFECT_1].Effect = SPELL_EFFECT_APPLY_AURA; @@ -3041,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; @@ -3129,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 @@ -3236,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 @@ -3277,8 +3026,23 @@ void SpellMgr::LoadSpellInfoCorrections() spellInfo->InterruptFlags &= ~AURA_INTERRUPT_FLAG_CAST; break; case 42767: // Sic'em + case 43092: // Stop the Ascension!: Halfdan's Soul Destruction spellInfo->Effects[EFFECT_0].TargetA = SpellImplicitTargetInfo(TARGET_UNIT_NEARBY_ENTRY); break; + case 14621: // Polymorph (Six Demon Bag) + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(4); // Medium Range + break; + case 35101: // Concussive Barrage + spellInfo->RangeEntry = sSpellRangeStore.LookupEntry(155); // Hunter Range (Long) + break; + case 55741: // Desecration (Rank 1) + 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) @@ -3731,3 +3495,50 @@ void SpellMgr::LoadSpellInfoCorrections() TC_LOG_INFO("server.loading", ">> Loaded SpellInfo corrections in %u ms", GetMSTimeDiffToNow(oldMSTime)); } + +void SpellMgr::LoadSpellInfoSpellSpecificAndAuraState() +{ + uint32 oldMSTime = getMSTime(); + + for (SpellInfo* spellInfo : mSpellInfoMap) + { + if (!spellInfo) + continue; + + // AuraState depends on SpellSpecific + spellInfo->_LoadSpellSpecific(); + spellInfo->_LoadAuraState(); + } + + TC_LOG_INFO("server.loading", ">> Loaded SpellInfo SpellSpecific and AuraState in %u ms", GetMSTimeDiffToNow(oldMSTime)); +} + +void SpellMgr::LoadSpellInfoDiminishing() +{ + uint32 oldMSTime = getMSTime(); + + for (SpellInfo* spellInfo : mSpellInfoMap) + { + if (!spellInfo) + continue; + + spellInfo->_LoadSpellDiminishInfo(); + } + + 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 ff328a2ac1f..a08ff921a2e 100644 --- a/src/server/game/Spells/SpellMgr.h +++ b/src/server/game/Spells/SpellMgr.h @@ -160,13 +160,13 @@ enum ProcFlags | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS, SPELL_PROC_FLAG_MASK = PROC_FLAG_DONE_SPELL_MELEE_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_MELEE_DMG_CLASS + | PROC_FLAG_DONE_RANGED_AUTO_ATTACK | PROC_FLAG_TAKEN_RANGED_AUTO_ATTACK | PROC_FLAG_DONE_SPELL_RANGED_DMG_CLASS | PROC_FLAG_TAKEN_SPELL_RANGED_DMG_CLASS | 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 | RANGED_PROC_FLAG_MASK, + | 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, @@ -174,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 @@ -237,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 @@ -546,13 +551,6 @@ inline bool IsProfessionOrRidingSkill(uint32 skill) bool IsPartOfSkillLine(uint32 skillId, uint32 spellId); -// spell diminishing returns -TC_GAME_API DiminishingGroup GetDiminishingReturnsGroupForSpell(SpellInfo const* spellproto, bool triggered); -TC_GAME_API DiminishingReturnsType GetDiminishingReturnsGroupType(DiminishingGroup group); -TC_GAME_API DiminishingLevels GetDiminishingReturnsMaxLevel(DiminishingGroup group); -TC_GAME_API int32 GetDiminishingReturnsLimitDuration(DiminishingGroup group, SpellInfo const* spellproto); -TC_GAME_API bool IsDiminishingReturnsGroupDurationLimited(DiminishingGroup group); - class TC_GAME_API SpellMgr { // Constructors @@ -612,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; @@ -684,6 +682,9 @@ class TC_GAME_API SpellMgr void UnloadSpellInfoImplicitTargetConditionLists(); void LoadSpellInfoCustomAttributes(); 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 934b33333f2..7bbf73d028d 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -1449,6 +1449,12 @@ void World::SetInitialWorldSettings() TC_LOG_INFO("server.loading", "Loading SpellInfo custom attributes..."); sSpellMgr->LoadSpellInfoCustomAttributes(); + 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); @@ -1508,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_message.cpp b/src/server/scripts/Commands/cs_message.cpp index 69ff04ffb46..4b3caae686b 100644 --- a/src/server/scripts/Commands/cs_message.cpp +++ b/src/server/scripts/Commands/cs_message.cpp @@ -24,6 +24,7 @@ EndScriptData */ #include "ScriptMgr.h" #include "Chat.h" +#include "Channel.h" #include "ChannelMgr.h" #include "Language.h" #include "Player.h" @@ -63,21 +64,49 @@ public: if (!*args) return false; char const* channelStr = strtok((char*)args, " "); - char const* argStr = strtok(NULL, ""); + char const* argStr = strtok(nullptr, ""); if (!channelStr || !argStr) return false; + uint32 channelId = 0; + for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i) + { + ChatChannelsEntry const* entry = sChatChannelsStore.LookupEntry(i); + if (!entry) + continue; + + if (strstr(entry->pattern[handler->GetSessionDbcLocale()], channelStr)) + { + channelId = i; + break; + } + } + + AreaTableEntry const* zoneEntry = nullptr; + for (uint32 i = 0; i < sAreaTableStore.GetNumRows(); ++i) + { + AreaTableEntry const* entry = sAreaTableStore.LookupEntry(i); + if (!entry) + continue; + + if (strstr(entry->area_name[handler->GetSessionDbcLocale()], channelStr)) + { + zoneEntry = entry; + break; + } + } + Player* player = handler->GetSession()->GetPlayer(); - Channel* channcel = NULL; + Channel* channel = nullptr; if (ChannelMgr* cMgr = ChannelMgr::forTeam(player->GetTeam())) - channcel = cMgr->GetChannel(channelStr, player); + channel = cMgr->GetChannel(channelId, channelStr, player, false, zoneEntry); if (strcmp(argStr, "on") == 0) { - if (channcel) - channcel->SetOwnership(true); + if (channel) + channel->SetOwnership(true); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP); stmt->setUInt8 (0, 1); stmt->setString(1, channelStr); @@ -86,8 +115,8 @@ public: } else if (strcmp(argStr, "off") == 0) { - if (channcel) - channcel->SetOwnership(false); + if (channel) + channel->SetOwnership(false); PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHANNEL_OWNERSHIP); stmt->setUInt8 (0, 0); stmt->setString(1, channelStr); 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/blackrock_spire.h b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h index 446cc48d2f7..2c0f16c4ff2 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/blackrock_spire.h @@ -48,7 +48,8 @@ enum DataTypes DATA_HALL_RUNE_4 = 19, DATA_HALL_RUNE_5 = 20, DATA_HALL_RUNE_6 = 21, - DATA_HALL_RUNE_7 = 22 + DATA_HALL_RUNE_7 = 22, + DATA_SCARSHIELD_INFILTRATOR = 23 }; enum CreaturesIds @@ -71,7 +72,8 @@ enum CreaturesIds NPC_BLACKHAND_SUMMONER = 9818, NPC_BLACKHAND_VETERAN = 9819, NPC_BLACKHAND_INCARCERATOR = 10316, - NPC_LORD_VICTOR_NEFARIUS = 10162 + NPC_LORD_VICTOR_NEFARIUS = 10162, + NPC_SCARSHIELD_INFILTRATOR = 10299 }; enum AdditionalData 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 bbe8fda37eb..89617a9f4ef 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackrockSpire/instance_blackrock_spire.cpp @@ -109,6 +109,9 @@ public: if (GetBossState(DATA_GYTH) == DONE) creature->DisappearAndDie(); break; + case NPC_SCARSHIELD_INFILTRATOR: + ScarshieldInfiltrator = creature->GetGUID(); + break; } } @@ -318,6 +321,8 @@ public: return TheBeast; case DATA_GENERAL_DRAKKISATH: return GeneralDrakkisath; + case DATA_SCARSHIELD_INFILTRATOR: + return ScarshieldInfiltrator; case GO_EMBERSEER_IN: return go_emberseerin; case GO_DOORS: @@ -496,6 +501,7 @@ public: ObjectGuid LordVictorNefarius; ObjectGuid TheBeast; ObjectGuid GeneralDrakkisath; + ObjectGuid ScarshieldInfiltrator; ObjectGuid go_emberseerin; ObjectGuid go_doors; ObjectGuid go_emberseerout; @@ -565,9 +571,33 @@ public: } }; +class at_nearby_scarshield_infiltrator : public AreaTriggerScript +{ +public: + at_nearby_scarshield_infiltrator() : AreaTriggerScript("at_nearby_scarshield_infiltrator") { } + + bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/) override + { + if (player->IsAlive()) + if (InstanceScript* instance = player->GetInstanceScript()) + if (Creature* infiltrator = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SCARSHIELD_INFILTRATOR))) + { + if (player->getLevel() >= 57) + infiltrator->AI()->SetData(1, 1); + else if (infiltrator->GetEntry() == NPC_SCARSHIELD_INFILTRATOR) + infiltrator->AI()->Talk(0, player); + + return true; + } + + return false; + } +}; + void AddSC_instance_blackrock_spire() { new instance_blackrock_spire(); new at_dragonspire_hall(); new at_blackrock_stadium(); + new at_nearby_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/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp index 137da1002af..34a456ae502 100644 --- a/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp +++ b/src/server/scripts/Kalimdor/CavernsOfTime/TheBlackMorass/the_black_morass.cpp @@ -16,19 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* -Name: The_Black_Morass -%Complete: 30 -Comment: Misc NPC's and mobs for instance. Most here far from complete. -Category: Caverns of Time, The Black Morass -*/ - -/* ContentData -npc_medivh_bm -npc_time_rift -npc_saat -EndContentData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" @@ -365,57 +352,8 @@ public: }; -enum Saat -{ - SPELL_CHRONO_BEACON = 34975, - ITEM_CHRONO_BEACON = 24289 -}; - -#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" - -class npc_saat : public CreatureScript -{ -public: - npc_saat() : CreatureScript("npc_saat") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - ClearGossipMenuFor(player); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - CloseGossipMenuFor(player); - creature->CastSpell(player, SPELL_CHRONO_BEACON, false); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON)) - { - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_OBTAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - SendGossipMenuFor(player, 10000, creature->GetGUID()); - return true; - } - else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON)) - { - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_OBTAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - SendGossipMenuFor(player, 10001, creature->GetGUID()); - return true; - } - - SendGossipMenuFor(player, 10002, creature->GetGUID()); - return true; - } - -}; - void AddSC_the_black_morass() { new npc_medivh_bm(); new npc_time_rift(); - new npc_saat(); } diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp index b7f88200077..7a7c104bdba 100644 --- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp +++ b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp @@ -16,18 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -/* ScriptData -SDName: Stonetalon_Mountains -SD%Complete: 95 -SDComment: Quest support: 6627, 6523 -SDCategory: Stonetalon Mountains -EndScriptData */ - -/* ContentData -npc_braug_dimspirit -npc_kaya_flathoof -EndContentData */ - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "ScriptedGossip.h" @@ -35,61 +23,6 @@ EndContentData */ #include "Player.h" /*###### -## npc_braug_dimspirit -######*/ - -#define GOSSIP_HBD1 "Ysera" -#define GOSSIP_HBD2 "Neltharion" -#define GOSSIP_HBD3 "Nozdormu" -#define GOSSIP_HBD4 "Alexstrasza" -#define GOSSIP_HBD5 "Malygos" - -class npc_braug_dimspirit : public CreatureScript -{ -public: - npc_braug_dimspirit() : CreatureScript("npc_braug_dimspirit") { } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - ClearGossipMenuFor(player); - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - CloseGossipMenuFor(player); - creature->CastSpell(player, 6766, false); - - } - if (action == GOSSIP_ACTION_INFO_DEF+2) - { - CloseGossipMenuFor(player); - player->AreaExploredOrEventHappens(6627); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) - { - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HBD5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - SendGossipMenuFor(player, 5820, creature->GetGUID()); - } - else - SendGossipMenuFor(player, 5819, creature->GetGUID()); - - return true; - } - -}; - -/*###### ## npc_kaya_flathoof ######*/ @@ -174,6 +107,5 @@ public: void AddSC_stonetalon_mountains() { - new npc_braug_dimspirit(); new npc_kaya_flathoof(); } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h index 685d0f51edd..2eda9509bb8 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/azjol_nerub.h @@ -33,7 +33,8 @@ enum DataTypes DATA_WATCHER_NARJIL, DATA_WATCHER_GASHRA, DATA_WATCHER_SILTHIK, - DATA_ANUBARAK_WALL + DATA_ANUBARAK_WALL, + DATA_ANUBARAK_WALL_2 }; enum CreatureIds diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp index 06a91d58705..2860698a8b2 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_anubarak.cpp @@ -121,12 +121,16 @@ public: _petCount = 0; } + bool CanAIAttack(Unit const* /*who*/) const override { return true; } // do not check boundary here + void EnterCombat(Unit* who) override { BossAI::EnterCombat(who); if (GameObject* door = instance->GetGameObject(DATA_ANUBARAK_WALL)) door->SetGoState(GO_STATE_ACTIVE); // open door for now + if (GameObject* door2 = instance->GetGameObject(DATA_ANUBARAK_WALL_2)) + door2->SetGoState(GO_STATE_ACTIVE); Talk(SAY_AGGRO); instance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEV_GOTTA_GO_START_EVENT); @@ -179,6 +183,8 @@ public: case EVENT_CLOSE_DOOR: if (GameObject* door = instance->GetGameObject(DATA_ANUBARAK_WALL)) door->SetGoState(GO_STATE_READY); + if (GameObject* door2 = instance->GetGameObject(DATA_ANUBARAK_WALL_2)) + door2->SetGoState(GO_STATE_READY); break; case EVENT_POUND: DoCastVictim(SPELL_POUND); diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp index 7338774c21e..c41ec1c488d 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_hadronox.cpp @@ -789,7 +789,7 @@ struct npc_hadronox_foeAI : public ScriptedAI me->GetMotionMaster()->MovePoint(MOVE_HADRONOX, hadronoxStep[2]); break; } - me->GetMotionMaster()->MoveChase(hadronox); + AttackStart(hadronox); } break; } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp index a86b02a2d6c..0d52a09bbdc 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/boss_krikthir_the_gatewatcher.cpp @@ -138,10 +138,10 @@ class boss_krik_thir : public CreatureScript for (uint8 i = 1; i <= 3; ++i) { - std::list<TempSummon*> summons; - me->SummonCreatureGroup(i, &summons); - for (TempSummon* summon : summons) - summon->AI()->SetData(DATA_PET_GROUP, i); + std::list<TempSummon*> adds; + me->SummonCreatureGroup(i, &adds); + for (TempSummon* add : adds) + add->AI()->SetData(DATA_PET_GROUP, i); } } @@ -416,11 +416,7 @@ class npc_watcher_gashra : public CreatureScript struct npc_watcher_gashraAI : public npc_gatewatcher_petAI { - npc_watcher_gashraAI(Creature* creature) : npc_gatewatcher_petAI(creature, true) - { - _instance = creature->GetInstanceScript(); - me->SetReactState(REACT_PASSIVE); - } + npc_watcher_gashraAI(Creature* creature) : npc_gatewatcher_petAI(creature, true) { } void Reset() override { @@ -481,7 +477,6 @@ class npc_watcher_gashra : public CreatureScript private: EventMap _events; - InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const override @@ -499,7 +494,6 @@ class npc_watcher_narjil : public CreatureScript { npc_watcher_narjilAI(Creature* creature) : npc_gatewatcher_petAI(creature, true) { - _instance = creature->GetInstanceScript(); } void Reset() override @@ -561,7 +555,6 @@ class npc_watcher_narjil : public CreatureScript private: EventMap _events; - InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const override @@ -579,7 +572,6 @@ class npc_watcher_silthik : public CreatureScript { npc_watcher_silthikAI(Creature* creature) : npc_gatewatcher_petAI(creature, true) { - _instance = creature->GetInstanceScript(); } void Reset() override @@ -641,7 +633,6 @@ class npc_watcher_silthik : public CreatureScript private: EventMap _events; - InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const override @@ -934,11 +925,15 @@ class spell_gatewatcher_subboss_trigger : public SpellScriptLoader void HandleTargets(std::list<WorldObject*>& targetList) { // Remove any Watchers that are already in combat - for (std::list<WorldObject*>::iterator it = targetList.begin(); it != targetList.end(); ++it) + auto it = targetList.begin(); + while (it != targetList.end()) { if (Creature* creature = (*it)->ToCreature()) if (creature->IsAlive() && !creature->IsInCombat()) + { + ++it; continue; + } it = targetList.erase(it); } diff --git a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp index 8af4f6cecc4..7f0ce5c369e 100644 --- a/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp +++ b/src/server/scripts/Northrend/AzjolNerub/AzjolNerub/instance_azjol_nerub.cpp @@ -41,7 +41,8 @@ ObjectData const creatureData[] = ObjectData const gameobjectData[] = { - { GO_ANUBARAK_DOOR_3, DATA_ANUBARAK_WALL }, + { GO_ANUBARAK_DOOR_1, DATA_ANUBARAK_WALL }, + { GO_ANUBARAK_DOOR_3, DATA_ANUBARAK_WALL_2 }, { 0, 0 } // END }; @@ -77,6 +78,17 @@ class instance_azjol_nerub : public InstanceMapScript if (Creature* gatewatcher = GetCreature(DATA_KRIKTHIR)) gatewatcher->AI()->DoAction(-ACTION_GATEWATCHER_GREET); } + + bool CheckRequiredBosses(uint32 bossId, Player const* player) const override + { + if (_SkipCheckRequiredBosses(player)) + return true; + + if (bossId > DATA_KRIKTHIR && GetBossState(DATA_KRIKTHIR) != DONE) + return false; + + return true; + } }; InstanceScript* GetInstanceScript(InstanceMap* map) const 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 1041d250cc7..976ef3e34db 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp @@ -16,9 +16,6 @@ * with this program. If not, see <http://www.gnu.org/licenses/>. */ -// Known bugs: -// Gormok - Snobolled (creature at back) - #include "ScriptMgr.h" #include "ScriptedCreature.h" #include "trial_of_the_crusader.h" @@ -71,14 +68,16 @@ enum BossSpells //Gormok SPELL_IMPALE = 66331, SPELL_STAGGERING_STOMP = 67648, - SPELL_RISING_ANGER = 66636, //Snobold + SPELL_RISING_ANGER = 66636, SPELL_SNOBOLLED = 66406, SPELL_BATTER = 66408, SPELL_FIRE_BOMB = 66313, SPELL_FIRE_BOMB_1 = 66317, SPELL_FIRE_BOMB_DOT = 66318, SPELL_HEAD_CRACK = 66407, + SPELL_JUMP_TO_HAND = 66342, + SPELL_RIDE_PLAYER = 66245, //Acidmaw & Dreadscale Generic SPELL_SWEEP = 66794, @@ -117,38 +116,41 @@ enum BossSpells enum MyActions { ACTION_ENABLE_FIRE_BOMB = 1, - ACTION_DISABLE_FIRE_BOMB = 2 + ACTION_DISABLE_FIRE_BOMB = 2, + ACTION_ACTIVE_SNOBOLD = 3 }; enum Events { // Gormok EVENT_IMPALE = 1, - EVENT_STAGGERING_STOMP = 2, - EVENT_THROW = 3, + EVENT_STAGGERING_STOMP, + EVENT_THROW, // Snobold - EVENT_FIRE_BOMB = 4, - EVENT_BATTER = 5, - EVENT_HEAD_CRACK = 6, + EVENT_FIRE_BOMB, + EVENT_BATTER, + EVENT_HEAD_CRACK, + EVENT_SNOBOLLED, + EVENT_CHECK_MOUNT, // Acidmaw & Dreadscale - EVENT_BITE = 7, - EVENT_SPEW = 8, - EVENT_SLIME_POOL = 9, - EVENT_SPIT = 10, - EVENT_SPRAY = 11, - EVENT_SWEEP = 12, - EVENT_SUBMERGE = 13, - EVENT_EMERGE = 14, - EVENT_SUMMON_ACIDMAW = 15, + EVENT_BITE, + EVENT_SPEW, + EVENT_SLIME_POOL, + EVENT_SPIT, + EVENT_SPRAY, + EVENT_SWEEP, + EVENT_SUBMERGE, + EVENT_EMERGE, + EVENT_SUMMON_ACIDMAW, // Icehowl - EVENT_FEROCIOUS_BUTT = 16, - EVENT_MASSIVE_CRASH = 17, - EVENT_WHIRL = 18, - EVENT_ARCTIC_BREATH = 19, - EVENT_TRAMPLE = 20 + EVENT_FEROCIOUS_BUTT, + EVENT_MASSIVE_CRASH, + EVENT_WHIRL, + EVENT_ARCTIC_BREATH, + EVENT_TRAMPLE }; enum Phases @@ -158,6 +160,13 @@ enum Phases PHASE_SUBMERGED = 3 }; +enum GormokMisc +{ + DATA_NEW_TARGET = 1, + GORMOK_HAND_SEAT = 4, + PLAYER_VEHICLE_ID = 444, +}; + class boss_gormok : public CreatureScript { public: @@ -169,9 +178,9 @@ class boss_gormok : public CreatureScript void Reset() override { - events.ScheduleEvent(EVENT_IMPALE, urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS)); - events.ScheduleEvent(EVENT_STAGGERING_STOMP, 15*IN_MILLISECONDS); - events.ScheduleEvent(EVENT_THROW, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); + events.ScheduleEvent(EVENT_IMPALE, Seconds(8), Seconds(10)); + events.ScheduleEvent(EVENT_STAGGERING_STOMP, Seconds(15)); + events.ScheduleEvent(EVENT_THROW, Seconds(15), Seconds(30)); summons.DespawnAll(); } @@ -216,18 +225,7 @@ class boss_gormok : public CreatureScript void EnterCombat(Unit* /*who*/) override { _EnterCombat(); - me->SetInCombatWithZone(); instance->SetData(TYPE_NORTHREND_BEASTS, GORMOK_IN_PROGRESS); - - for (uint8 i = 0; i < MAX_SNOBOLDS; i++) - { - if (Creature* pSnobold = DoSpawnCreature(NPC_SNOBOLD_VASSAL, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0)) - { - pSnobold->EnterVehicle(me, i); - pSnobold->SetInCombatWithZone(); - pSnobold->AI()->DoAction(ACTION_ENABLE_FIRE_BOMB); - } - } } void DamageTaken(Unit* /*who*/, uint32& damage) override @@ -235,8 +233,14 @@ class boss_gormok : public CreatureScript // despawn the remaining passengers on death if (damage >= me->GetHealth()) for (uint8 i = 0; i < MAX_SNOBOLDS; ++i) - if (Unit* pSnobold = me->GetVehicleKit()->GetPassenger(i)) - pSnobold->ToCreature()->DespawnOrUnsummon(); + if (Unit* snobold = me->GetVehicleKit()->GetPassenger(i)) + snobold->ToCreature()->DespawnOrUnsummon(); + } + + void PassengerBoarded(Unit* who, int8 seatId, bool apply) override + { + if (apply && seatId == GORMOK_HAND_SEAT) + who->CastSpell(me, SPELL_RISING_ANGER, true); } void UpdateAI(uint32 diff) override @@ -255,30 +259,28 @@ class boss_gormok : public CreatureScript { case EVENT_IMPALE: DoCastVictim(SPELL_IMPALE); - events.ScheduleEvent(EVENT_IMPALE, urand(8*IN_MILLISECONDS, 10*IN_MILLISECONDS)); - return; + events.Repeat(Seconds(8), Seconds(10)); + break; case EVENT_STAGGERING_STOMP: DoCastVictim(SPELL_STAGGERING_STOMP); - events.ScheduleEvent(EVENT_STAGGERING_STOMP, 15*IN_MILLISECONDS); - return; + events.Repeat(Seconds(15)); + break; case EVENT_THROW: for (uint8 i = 0; i < MAX_SNOBOLDS; ++i) { - if (Unit* pSnobold = me->GetVehicleKit()->GetPassenger(i)) + if (Unit* snobold = me->GetVehicleKit()->GetPassenger(i)) { - pSnobold->ExitVehicle(); - pSnobold->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - pSnobold->ToCreature()->SetReactState(REACT_AGGRESSIVE); - pSnobold->ToCreature()->AI()->DoAction(ACTION_DISABLE_FIRE_BOMB); - pSnobold->CastSpell(me, SPELL_RISING_ANGER, true); - Talk(EMOTE_SNOBOLLED); + snobold->ExitVehicle(); + snobold->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); + snobold->GetAI()->DoAction(ACTION_DISABLE_FIRE_BOMB); + snobold->CastSpell(me, SPELL_JUMP_TO_HAND, true); break; } } - events.ScheduleEvent(EVENT_THROW, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS)); - return; + events.Repeat(Seconds(15), Seconds(30)); + break; default: - return; + break; } } @@ -292,6 +294,23 @@ class boss_gormok : public CreatureScript } }; +class SnobolledTargetSelector : public std::unary_function<Unit*, bool> +{ +public: + SnobolledTargetSelector(Unit const* /*unit*/) { } + + bool operator()(Unit* unit) const + { + if (unit->GetTypeId() != TYPEID_PLAYER) + return false; + + if (unit->HasAura(SPELL_RIDE_PLAYER) || unit->HasAura(SPELL_SNOBOLLED)) + return false; + + return true; + } +}; + class npc_snobold_vassal : public CreatureScript { public: @@ -299,59 +318,24 @@ class npc_snobold_vassal : public CreatureScript struct npc_snobold_vassalAI : public ScriptedAI { - npc_snobold_vassalAI(Creature* creature) : ScriptedAI(creature) + npc_snobold_vassalAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()), _isActive(false) { - _targetDied = false; - _instance = creature->GetInstanceScript(); _instance->SetData(DATA_SNOBOLD_COUNT, INCREASE); + SetCombatMovement(false); } void Reset() override { - _events.ScheduleEvent(EVENT_BATTER, 5*IN_MILLISECONDS); - _events.ScheduleEvent(EVENT_HEAD_CRACK, 25*IN_MILLISECONDS); - - _targetGUID.Clear(); - _targetDied = false; - - //Workaround for Snobold me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* who) override - { - _targetGUID = who->GetGUID(); - me->TauntApply(who); - DoCast(who, SPELL_SNOBOLLED); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) override - { - if (pDoneBy->GetGUID() == _targetGUID) - uiDamage = 0; - } - - void MovementInform(uint32 type, uint32 pointId) override - { - if (type != POINT_MOTION_TYPE) - return; - - switch (pointId) - { - case 0: - if (_targetDied) - me->DespawnOrUnsummon(); - break; - default: - break; - } + me->SetInCombatWithZone(); + _events.ScheduleEvent(EVENT_CHECK_MOUNT, Seconds(1)); + _events.ScheduleEvent(EVENT_FIRE_BOMB, Seconds(5), Seconds(30)); } void JustDied(Unit* /*killer*/) override { if (Unit* target = ObjectAccessor::GetPlayer(*me, _targetGUID)) - if (target->IsAlive()) - target->RemoveAurasDueToSpell(SPELL_SNOBOLLED); + target->RemoveAurasDueToSpell(SPELL_SNOBOLLED); _instance->SetData(DATA_SNOBOLD_COUNT, DECREASE); } @@ -360,50 +344,69 @@ class npc_snobold_vassal : public CreatureScript switch (action) { case ACTION_ENABLE_FIRE_BOMB: - _events.ScheduleEvent(EVENT_FIRE_BOMB, urand(5*IN_MILLISECONDS, 30*IN_MILLISECONDS)); + _events.ScheduleEvent(EVENT_FIRE_BOMB, Seconds(5), Seconds(30)); break; case ACTION_DISABLE_FIRE_BOMB: _events.CancelEvent(EVENT_FIRE_BOMB); break; + case ACTION_ACTIVE_SNOBOLD: + _isActive = true; + break; default: break; } } - void UpdateAI(uint32 diff) override + void SetGUID(ObjectGuid guid, int32 id) override { - if (!UpdateVictim() || _targetDied) + if (id == DATA_NEW_TARGET) + if (Unit* target = ObjectAccessor::GetPlayer(*me, guid)) + { + _targetGUID = guid; + AttackStart(target); + _events.ScheduleEvent(EVENT_BATTER, Seconds(5)); + _events.ScheduleEvent(EVENT_HEAD_CRACK, Seconds(25)); + _events.ScheduleEvent(EVENT_SNOBOLLED, Milliseconds(500)); + } + } + + void AttackStart(Unit* who) override + { + //Snobold only melee attack players that is your vehicle + if (!_isActive || who->GetGUID() != _targetGUID) return; - if (Unit* target = ObjectAccessor::GetPlayer(*me, _targetGUID)) + ScriptedAI::AttackStart(who); + } + + void MountOnBoss() + { + Unit* gormok = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_GORMOK)); + if (gormok && gormok->IsAlive()) { - if (!target->IsAlive()) - { - Unit* gormok = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(NPC_GORMOK)); - if (gormok && gormok->IsAlive()) - { - SetCombatMovement(false); - _targetDied = true; + me->AttackStop(); + _targetGUID.Clear(); + _isActive = false; + _events.CancelEvent(EVENT_BATTER); + _events.CancelEvent(EVENT_HEAD_CRACK); - // looping through Gormoks seats - for (uint8 i = 0; i < MAX_SNOBOLDS; i++) - { - if (!gormok->GetVehicleKit()->GetPassenger(i)) - { - me->EnterVehicle(gormok, i); - DoAction(ACTION_ENABLE_FIRE_BOMB); - break; - } - } - } - else if (Unit* target2 = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true)) + for (uint8 i = 0; i < MAX_SNOBOLDS; i++) + { + if (!gormok->GetVehicleKit()->GetPassenger(i)) { - _targetGUID = target2->GetGUID(); - me->GetMotionMaster()->MoveJump(*target2, 15.0f, 15.0f); + me->EnterVehicle(gormok, i); + DoAction(ACTION_ENABLE_FIRE_BOMB); + break; } } } + //Without Boss, snobolds should jump in another players + else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, SnobolledTargetSelector(me))) + me->CastSpell(target, SPELL_RIDE_PLAYER, true); + } + void UpdateAI(uint32 diff) override + { _events.Update(diff); if (me->HasUnitState(UNIT_STATE_CASTING)) @@ -416,35 +419,46 @@ class npc_snobold_vassal : public CreatureScript case EVENT_FIRE_BOMB: if (me->GetVehicleBase()) if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, -me->GetVehicleBase()->GetCombatReach(), true)) - me->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_FIRE_BOMB, true); - _events.ScheduleEvent(EVENT_FIRE_BOMB, 20*IN_MILLISECONDS); - return; + me->CastSpell(target, SPELL_FIRE_BOMB); + _events.Repeat(Seconds(20)); + break; case EVENT_HEAD_CRACK: - // commented out while SPELL_SNOBOLLED gets fixed - //if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID)) - DoCastVictim(SPELL_HEAD_CRACK); - _events.ScheduleEvent(EVENT_HEAD_CRACK, 30*IN_MILLISECONDS); - return; + DoCast(me->GetVehicleBase(), SPELL_HEAD_CRACK); + _events.Repeat(Seconds(30)); + break; case EVENT_BATTER: - // commented out while SPELL_SNOBOLLED gets fixed - //if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID)) - DoCastVictim(SPELL_BATTER); - _events.ScheduleEvent(EVENT_BATTER, 10*IN_MILLISECONDS); - return; + DoCast(me->GetVehicleBase(), SPELL_BATTER); + _events.Repeat(Seconds(10)); + break; + case EVENT_SNOBOLLED: + DoCastAOE(SPELL_SNOBOLLED); + break; + case EVENT_CHECK_MOUNT: + if (!me->GetVehicleBase()) + MountOnBoss(); + _events.Repeat(Seconds(1)); + break; default: - return; + break; } + + if (me->HasUnitState(UNIT_STATE_CASTING)) + return; } - // do melee attack only when not on Gormoks back - if (!me->GetVehicleBase()) + if (!UpdateVictim()) + return; + + // do melee attack only if is in player back. + if (_isActive) DoMeleeAttackIfReady(); } + private: EventMap _events; InstanceScript* _instance; ObjectGuid _targetGUID; - bool _targetDied; + bool _isActive; }; CreatureAI* GetAI(Creature* creature) const override @@ -1145,6 +1159,138 @@ class boss_icehowl : public CreatureScript } }; +class spell_gormok_jump_to_hand : public SpellScriptLoader +{ +public: + spell_gormok_jump_to_hand() : SpellScriptLoader("spell_gormok_jump_to_hand") { } + + class spell_gormok_jump_to_hand_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gormok_jump_to_hand_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_RIDE_PLAYER)) + return false; + return true; + } + + bool Load() override + { + if (GetCaster() && GetCaster()->GetEntry() == NPC_SNOBOLD_VASSAL) + return true; + return false; + } + + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + if (Unit* caster = GetCaster()) + { + if (CreatureAI* gormokAI = GetTarget()->ToCreature()->AI()) + { + if (Unit* target = gormokAI->SelectTarget(SELECT_TARGET_RANDOM, 0, SnobolledTargetSelector(GetTarget()))) + { + gormokAI->Talk(EMOTE_SNOBOLLED); + caster->GetAI()->DoAction(ACTION_ACTIVE_SNOBOLD); + caster->CastSpell(target, SPELL_RIDE_PLAYER, true); + } + } + } + } + + void Register() override + { + AfterEffectRemove += AuraEffectRemoveFn(spell_gormok_jump_to_hand_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gormok_jump_to_hand_AuraScript(); + } +}; + +class spell_gormok_ride_player : public SpellScriptLoader +{ +public: + spell_gormok_ride_player() : SpellScriptLoader("spell_gormok_ride_player") { } + + class spell_gormok_ride_player_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gormok_ride_player_AuraScript); + + bool Load() override + { + if (GetCaster() && GetCaster()->GetEntry() == NPC_SNOBOLD_VASSAL) + return true; + return false; + } + + void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + if (target->GetTypeId() != TYPEID_PLAYER || !target->IsInWorld()) + return; + + if (!target->CreateVehicleKit(PLAYER_VEHICLE_ID, 0)) + return; + + if (Unit *caster = GetCaster()) + caster->GetAI()->SetGUID(target->GetGUID(), DATA_NEW_TARGET); + } + + void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + GetTarget()->RemoveVehicleKit(); + } + + void Register() override + { + OnEffectApply += AuraEffectApplyFn(spell_gormok_ride_player_AuraScript::OnApply, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL); + AfterEffectRemove += AuraEffectRemoveFn(spell_gormok_ride_player_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_CONTROL_VEHICLE, AURA_EFFECT_HANDLE_REAL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gormok_ride_player_AuraScript(); + } +}; + +class spell_gormok_snobolled : public SpellScriptLoader +{ +public: + spell_gormok_snobolled() : SpellScriptLoader("spell_gormok_snobolled") { } + + class spell_gormok_snobolled_AuraScript : public AuraScript + { + PrepareAuraScript(spell_gormok_snobolled_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_RIDE_PLAYER)) + return false; + return true; + } + + void OnPeriodic(AuraEffect const* /*aurEff*/) + { + if (!GetTarget()->HasAura(SPELL_RIDE_PLAYER)) + Remove(); + } + + void Register() override + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_gormok_snobolled_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_gormok_snobolled_AuraScript(); + } +}; + class spell_jormungars_paralytic_toxin : public SpellScriptLoader { public: @@ -1293,6 +1439,9 @@ void AddSC_boss_northrend_beasts() new npc_snobold_vassal(); new npc_firebomb(); new spell_gormok_fire_bomb(); + new spell_gormok_jump_to_hand(); + new spell_gormok_ride_player(); + new spell_gormok_snobolled(); new boss_acidmaw(); new boss_dreadscale(); diff --git a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp index 8998b77d8b5..25e2c045af9 100644 --- a/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/ForgeOfSouls/boss_devourer_of_souls.cpp @@ -406,7 +406,11 @@ class spell_devourer_of_souls_mirrored_soul_proc : public SpellScriptLoader void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), 45)); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 45); GetTarget()->CastCustomSpell(SPELL_MIRRORED_SOUL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, GetCaster(), true); } diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index a5d6d27724c..dd34f501e61 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -729,8 +729,12 @@ class spell_blood_queen_essence_of_the_blood_queen : public SpellScriptLoader void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 heal = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ESSENCE_OF_THE_BLOOD_QUEEN_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), TRIGGERED_FULL_MASK, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp index 5f884ccee9e..85126b35cdb 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lady_deathwhisper.cpp @@ -56,21 +56,26 @@ enum Spells SPELL_MANA_BARRIER = 70842, SPELL_SHADOW_BOLT = 71254, SPELL_DEATH_AND_DECAY = 71001, - SPELL_DOMINATE_MIND_H = 71289, + SPELL_DOMINATE_MIND = 71289, + SPELL_DOMINATE_MIND_SCALE = 71290, SPELL_FROSTBOLT = 71420, SPELL_FROSTBOLT_VOLLEY = 72905, SPELL_TOUCH_OF_INSIGNIFICANCE = 71204, SPELL_SUMMON_SHADE = 71363, - SPELL_SHADOW_CHANNELING = 43897, // Prefight, during intro + SPELL_SHADOW_CHANNELING = 43897, SPELL_DARK_TRANSFORMATION_T = 70895, SPELL_DARK_EMPOWERMENT_T = 70896, SPELL_DARK_MARTYRDOM_T = 70897, + SPELL_SUMMON_SPIRITS = 72478, // Achievement SPELL_FULL_HOUSE = 72827, // does not exist in dbc but still can be used for criteria check // Both Adds SPELL_TELEPORT_VISUAL = 41236, + SPELL_CLEAR_ALL_DEBUFFS = 34098, + SPELL_FULL_HEAL = 17683, + SPELL_PERMANENT_FEIGN_DEATH = 70628, // Fanatics SPELL_DARK_TRANSFORMATION = 70900, @@ -86,7 +91,7 @@ enum Spells SPELL_DEATHCHILL_BOLT = 70594, SPELL_DEATHCHILL_BLAST = 70906, SPELL_CURSE_OF_TORPOR = 71237, - SPELL_SHORUD_OF_THE_OCCULT = 70768, + SPELL_SHROUD_OF_THE_OCCULT = 70768, SPELL_ADHERENT_S_DETERMINATION = 71234, SPELL_DARK_MARTYRDOM_ADHERENT = 70903, @@ -108,44 +113,6 @@ enum Spells enum EventTypes { - // Lady Deathwhisper - EVENT_INTRO_2 = 1, - EVENT_INTRO_3 = 2, - EVENT_INTRO_4 = 3, - EVENT_INTRO_5 = 4, - EVENT_INTRO_6 = 5, - EVENT_INTRO_7 = 6, - EVENT_BERSERK = 7, - EVENT_DEATH_AND_DECAY = 8, - EVENT_DOMINATE_MIND_H = 9, - - // Phase 1 only - EVENT_P1_SUMMON_WAVE = 10, - EVENT_P1_SHADOW_BOLT = 11, - EVENT_P1_EMPOWER_CULTIST = 12, - EVENT_P1_REANIMATE_CULTIST = 13, - - // Phase 2 only - EVENT_P2_SUMMON_WAVE = 14, - EVENT_P2_FROSTBOLT = 15, - EVENT_P2_FROSTBOLT_VOLLEY = 16, - EVENT_P2_TOUCH_OF_INSIGNIFICANCE = 17, - EVENT_P2_SUMMON_SHADE = 18, - - // Shared adds events - EVENT_CULTIST_DARK_MARTYRDOM = 19, - - // Cult Fanatic - EVENT_FANATIC_NECROTIC_STRIKE = 20, - EVENT_FANATIC_SHADOW_CLEAVE = 21, - EVENT_FANATIC_VAMPIRIC_MIGHT = 22, - - // Cult Adherent - EVENT_ADHERENT_FROST_FEVER = 23, - EVENT_ADHERENT_DEATHCHILL = 24, - EVENT_ADHERENT_CURSE_OF_TORPOR = 25, - EVENT_ADHERENT_SHORUD_OF_THE_OCCULT = 26, - // Darnavan EVENT_DARNAVAN_BLADESTORM = 27, EVENT_DARNAVAN_CHARGE = 28, @@ -163,6 +130,13 @@ enum Phases PHASE_TWO = 3 }; +enum Groups +{ + GROUP_INTRO = 0, + GROUP_ONE = 1, + GROUP_TWO = 2 +}; + enum DeprogrammingData { NPC_DARNAVAN_10 = 38472, @@ -185,8 +159,6 @@ enum Actions uint32 const SummonEntries[2] = {NPC_CULT_FANATIC, NPC_CULT_ADHERENT}; -#define GUID_CULTIST 1 - Position const SummonPositions[7] = { {-578.7066f, 2154.167f, 51.01529f, 1.692969f}, // 1 Left Door 1 (Cult Fanatic) @@ -229,43 +201,67 @@ class boss_lady_deathwhisper : public CreatureScript void Initialize() { _waveCounter = 0; - _nextVengefulShadeTargetGUID.Clear(); + _nextVengefulShadeTargetGUID.clear(); + _cultistQueue.clear(); _darnavanGUID.Clear(); + _phase = PHASE_ALL; + scheduler.SetValidator([this] + { + return !(me->HasUnitState(UNIT_STATE_CASTING) && _phase != PHASE_INTRO); + }); } void Reset() override { - _Reset(); - me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)); - events.SetPhase(PHASE_ONE); Initialize(); - DoCast(me, SPELL_SHADOW_CHANNELING); - me->RemoveAurasDueToSpell(SPELL_BERSERK); - me->RemoveAurasDueToSpell(SPELL_MANA_BARRIER); + _phase = PHASE_ONE; + DoCastSelf(SPELL_SHADOW_CHANNELING); + me->SetPower(POWER_MANA, me->GetMaxPower(POWER_MANA)); me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false); } void DoAction(int32 action) override { - switch (action) + if (action != ACTION_START_INTRO) + return; + + if (!_introDone) { - case ACTION_START_INTRO: - if (!_introDone) + _introDone = true; + Talk(SAY_INTRO_1); + _phase = PHASE_INTRO; + scheduler.Schedule(Seconds(10), GROUP_INTRO, [this](TaskContext context) + { + switch (context.GetRepeatCounter()) { - _introDone = true; - Talk(SAY_INTRO_1); - events.SetPhase(PHASE_INTRO); - events.ScheduleEvent(EVENT_INTRO_2, 11000, 0, PHASE_INTRO); - events.ScheduleEvent(EVENT_INTRO_3, 21000, 0, PHASE_INTRO); - events.ScheduleEvent(EVENT_INTRO_4, 31500, 0, PHASE_INTRO); - events.ScheduleEvent(EVENT_INTRO_5, 39500, 0, PHASE_INTRO); - events.ScheduleEvent(EVENT_INTRO_6, 48500, 0, PHASE_INTRO); - events.ScheduleEvent(EVENT_INTRO_7, 58000, 0, PHASE_INTRO); + case 0: + Talk(SAY_INTRO_2); + context.Repeat(Seconds(21)); + break; + case 1: + Talk(SAY_INTRO_3); + context.Repeat(Seconds(11)); + break; + case 2: + Talk(SAY_INTRO_4); + context.Repeat(Seconds(9)); + break; + case 3: + Talk(SAY_INTRO_5); + context.Repeat(Seconds(21)); + break; + case 4: + Talk(SAY_INTRO_6); + context.Repeat(Seconds(10)); + break; + case 5: + Talk(SAY_INTRO_7); + return; + default: + break; } - break; - default: - break; + }); } } @@ -274,7 +270,7 @@ class boss_lady_deathwhisper : public CreatureScript if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) return; - if (victim && me->Attack(victim, true) && !events.IsInPhase(PHASE_ONE)) + if (victim && me->Attack(victim, true) && _phase != PHASE_ONE) me->GetMotionMaster()->MoveChase(victim); } @@ -282,31 +278,61 @@ class boss_lady_deathwhisper : public CreatureScript { if (!instance->CheckRequiredBosses(DATA_LADY_DEATHWHISPER, who->ToPlayer())) { - EnterEvadeMode(); + EnterEvadeMode(EVADE_REASON_SEQUENCE_BREAK); instance->DoCastSpellOnPlayers(LIGHT_S_HAMMER_TELEPORT); return; } + me->SetCombatPulseDelay(5); me->setActive(true); DoZoneInCombat(); - - events.Reset(); - events.SetPhase(PHASE_ONE); + _phase = PHASE_ONE; + scheduler.CancelGroup(GROUP_INTRO); // phase-independent events - events.ScheduleEvent(EVENT_BERSERK, 600000); - events.ScheduleEvent(EVENT_DEATH_AND_DECAY, 10000); + scheduler + .Schedule(Minutes(10), [this](TaskContext /*context*/) + { + DoCastSelf(SPELL_BERSERK); + Talk(SAY_BERSERK); + }) + .Schedule(Seconds(17), [this](TaskContext death_and_decay) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(target, SPELL_DEATH_AND_DECAY); + death_and_decay.Repeat(Seconds(22), Seconds(30)); + }); + if (GetDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL) + scheduler.Schedule(Seconds(27), [this](TaskContext dominate_mind) + { + Talk(SAY_DOMINATE_MIND); + for (uint8 i = 0; i < _dominateMindCount; i++) + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_DOMINATE_MIND)) + DoCast(target, SPELL_DOMINATE_MIND); + dominate_mind.Repeat(Seconds(40), Seconds(45)); + }); // phase one only - events.ScheduleEvent(EVENT_P1_SUMMON_WAVE, 5000, 0, PHASE_ONE); - events.ScheduleEvent(EVENT_P1_SHADOW_BOLT, urand(5500, 6000), 0, PHASE_ONE); - events.ScheduleEvent(EVENT_P1_EMPOWER_CULTIST, urand(20000, 30000), 0, PHASE_ONE); - if (GetDifficulty() != RAID_DIFFICULTY_10MAN_NORMAL) - events.ScheduleEvent(EVENT_DOMINATE_MIND_H, 27000); + scheduler + .Schedule(Seconds(5), GROUP_ONE, [this](TaskContext wave) + { + SummonWaveP1(); + wave.Repeat(Seconds(IsHeroic() ? 45 : 60)); + }) + .Schedule(Seconds(2), GROUP_ONE, [this](TaskContext shadow_bolt) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) + DoCast(target, SPELL_SHADOW_BOLT); + shadow_bolt.Repeat(Milliseconds(2450), Milliseconds(3600)); + }) + .Schedule(Seconds(15), GROUP_ONE, [this](TaskContext context) + { + DoImproveCultist(); + context.Repeat(Seconds(25)); + }); Talk(SAY_AGGRO); DoStartNoMovement(who); me->RemoveAurasDueToSpell(SPELL_SHADOW_CHANNELING); - DoCast(me, SPELL_MANA_BARRIER, true); - + DoCastSelf(SPELL_MANA_BARRIER, true); instance->SetBossState(DATA_LADY_DEATHWHISPER, IN_PROGRESS); } @@ -338,7 +364,7 @@ class boss_lady_deathwhisper : public CreatureScript { if (Group* group = owner->GetGroup()) { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) if (Player* member = itr->GetSource()) member->KilledMonsterCredit(NPC_DARNAVAN_CREDIT); } @@ -351,17 +377,14 @@ class boss_lady_deathwhisper : public CreatureScript _JustDied(); } - void JustReachedHome() override + void EnterEvadeMode(EvadeReason /*why*/) override { - _JustReachedHome(); - instance->SetBossState(DATA_LADY_DEATHWHISPER, FAIL); - + scheduler.CancelAll(); summons.DespawnAll(); if (Creature* darnavan = ObjectAccessor::GetCreature(*me, _darnavanGUID)) - { darnavan->DespawnOrUnsummon(); - _darnavanGUID.Clear(); - } + + _DespawnAtEvade(); } void KilledUnit(Unit* victim) override @@ -373,151 +396,98 @@ class boss_lady_deathwhisper : public CreatureScript void DamageTaken(Unit* /*damageDealer*/, uint32& damage) override { // phase transition - if (events.IsInPhase(PHASE_ONE) && damage > me->GetPower(POWER_MANA)) + if (_phase == PHASE_ONE && damage > me->GetPower(POWER_MANA)) { + _phase = PHASE_TWO; Talk(SAY_PHASE_2); Talk(EMOTE_PHASE_2); DoStartMovement(me->GetVictim()); + DoResetThreat(); damage -= me->GetPower(POWER_MANA); me->SetPower(POWER_MANA, 0); me->RemoveAurasDueToSpell(SPELL_MANA_BARRIER); - events.SetPhase(PHASE_TWO); - events.ScheduleEvent(EVENT_P2_FROSTBOLT, urand(10000, 12000), 0, PHASE_TWO); - events.ScheduleEvent(EVENT_P2_FROSTBOLT_VOLLEY, urand(19000, 21000), 0, PHASE_TWO); - events.ScheduleEvent(EVENT_P2_TOUCH_OF_INSIGNIFICANCE, urand(6000, 9000), 0, PHASE_TWO); - events.ScheduleEvent(EVENT_P2_SUMMON_SHADE, urand(12000, 15000), 0, PHASE_TWO); + scheduler.CancelGroup(GROUP_ONE); + + scheduler + .Schedule(Seconds(12), GROUP_TWO, [this](TaskContext frostbolt) + { + DoCastVictim(SPELL_FROSTBOLT); + frostbolt.Repeat(); + }) + .Schedule(Seconds(20), GROUP_TWO, [this](TaskContext frostboldVolley) + { + DoCastAOE(SPELL_FROSTBOLT_VOLLEY); + frostboldVolley.Repeat(); + }) + .Schedule(Seconds(6), Seconds(9), GROUP_TWO, [this](TaskContext touch) + { + if (me->GetVictim()) + me->AddAura(SPELL_TOUCH_OF_INSIGNIFICANCE, me->EnsureVictim()); + touch.Repeat(); + }) + .Schedule(Seconds(12), GROUP_TWO, [this](TaskContext summonShade) + { + me->CastCustomSpell(SPELL_SUMMON_SPIRITS, SPELLVALUE_MAX_TARGETS, Is25ManRaid() ? 2 : 1); + summonShade.Repeat(); + }); + // on heroic mode Lady Deathwhisper is immune to taunt effects in phase 2 and continues summoning adds if (IsHeroic()) { me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true); - events.ScheduleEvent(EVENT_P2_SUMMON_WAVE, 45000, 0, PHASE_TWO); + scheduler.Schedule(Seconds(), GROUP_TWO, [this](TaskContext context) + { + SummonWaveP2(); + context.Repeat(Seconds(45)); + }); } } } - void JustSummoned(Creature* summon) override + void SpellHitTarget(Unit* target, const SpellInfo* spell) override { - if (summon->GetEntry() == NPC_DARNAVAN) - _darnavanGUID = summon->GetGUID(); - else - summons.Summon(summon); + if (spell->Id == SPELL_SUMMON_SPIRITS) + _nextVengefulShadeTargetGUID.push_back(target->GetGUID()); + } - Unit* target = NULL; - if (summon->GetEntry() == NPC_VENGEFUL_SHADE) + void JustSummoned(Creature* summon) override + { + switch (summon->GetEntry()) { - target = ObjectAccessor::GetUnit(*me, _nextVengefulShadeTargetGUID); // Vengeful Shade - _nextVengefulShadeTargetGUID.Clear(); + case NPC_DARNAVAN_10: + case NPC_DARNAVAN_25: + _darnavanGUID = summon->GetGUID(); + summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM)); + return; + case NPC_VENGEFUL_SHADE: + if (_nextVengefulShadeTargetGUID.empty()) + break; + summon->AI()->SetGUID(_nextVengefulShadeTargetGUID.front()); + _nextVengefulShadeTargetGUID.pop_front(); + break; + case NPC_CULT_ADHERENT: + case NPC_CULT_FANATIC: + _cultistQueue.push_back(summon->GetGUID()); + summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM)); + break; + default: + break; } - else - target = SelectTarget(SELECT_TARGET_RANDOM); // Wave adds - - summon->AI()->AttackStart(target); // CAN be NULL - if (summon->GetEntry() == NPC_REANIMATED_FANATIC) - summon->CastSpell(summon, SPELL_FANATIC_S_DETERMINATION, true); - else if (summon->GetEntry() == NPC_REANIMATED_ADHERENT) - summon->CastSpell(summon, SPELL_ADHERENT_S_DETERMINATION, true); + summons.Summon(summon); } void UpdateAI(uint32 diff) override { - if (!UpdateVictim() && !events.IsInPhase(PHASE_INTRO)) + if (!UpdateVictim() && _phase != PHASE_INTRO) return; - events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING) && !events.IsInPhase(PHASE_INTRO)) - return; - - while (uint32 eventId = events.ExecuteEvent()) + scheduler.Update(diff, [this] { - switch (eventId) - { - case EVENT_INTRO_2: - Talk(SAY_INTRO_2); - break; - case EVENT_INTRO_3: - Talk(SAY_INTRO_3); - break; - case EVENT_INTRO_4: - Talk(SAY_INTRO_4); - break; - case EVENT_INTRO_5: - Talk(SAY_INTRO_5); - break; - case EVENT_INTRO_6: - Talk(SAY_INTRO_6); - break; - case EVENT_INTRO_7: - Talk(SAY_INTRO_7); - break; - case EVENT_DEATH_AND_DECAY: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_DEATH_AND_DECAY); - events.ScheduleEvent(EVENT_DEATH_AND_DECAY, urand(22000, 30000)); - break; - case EVENT_DOMINATE_MIND_H: - Talk(SAY_DOMINATE_MIND); - for (uint8 i = 0; i < _dominateMindCount; i++) - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_DOMINATE_MIND_H)) - DoCast(target, SPELL_DOMINATE_MIND_H); - events.ScheduleEvent(EVENT_DOMINATE_MIND_H, urand(40000, 45000)); - break; - case EVENT_P1_SUMMON_WAVE: - SummonWaveP1(); - events.ScheduleEvent(EVENT_P1_SUMMON_WAVE, IsHeroic() ? 45000 : 60000, 0, PHASE_ONE); - break; - case EVENT_P1_SHADOW_BOLT: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM)) - DoCast(target, SPELL_SHADOW_BOLT); - events.ScheduleEvent(EVENT_P1_SHADOW_BOLT, urand(5000, 8000), 0, PHASE_ONE); - break; - case EVENT_P1_REANIMATE_CULTIST: - ReanimateCultist(); - break; - case EVENT_P1_EMPOWER_CULTIST: - EmpowerCultist(); - events.ScheduleEvent(EVENT_P1_EMPOWER_CULTIST, urand(18000, 25000)); - break; - case EVENT_P2_FROSTBOLT: - DoCastVictim(SPELL_FROSTBOLT); - events.ScheduleEvent(EVENT_P2_FROSTBOLT, urand(10000, 11000), 0, PHASE_TWO); - break; - case EVENT_P2_FROSTBOLT_VOLLEY: - DoCastAOE(SPELL_FROSTBOLT_VOLLEY); - events.ScheduleEvent(EVENT_P2_FROSTBOLT_VOLLEY, urand(13000, 15000), 0, PHASE_TWO); - break; - case EVENT_P2_TOUCH_OF_INSIGNIFICANCE: - DoCastVictim(SPELL_TOUCH_OF_INSIGNIFICANCE); - events.ScheduleEvent(EVENT_P2_TOUCH_OF_INSIGNIFICANCE, urand(9000, 13000), 0, PHASE_TWO); - break; - case EVENT_P2_SUMMON_SHADE: - if (Unit* shadeTarget = SelectTarget(SELECT_TARGET_RANDOM, 1)) - { - _nextVengefulShadeTargetGUID = shadeTarget->GetGUID(); - DoCast(shadeTarget, SPELL_SUMMON_SHADE); - } - events.ScheduleEvent(EVENT_P2_SUMMON_SHADE, urand(18000, 23000), 0, PHASE_TWO); - break; - case EVENT_P2_SUMMON_WAVE: - SummonWaveP2(); - events.ScheduleEvent(EVENT_P2_SUMMON_WAVE, 45000, 0, PHASE_TWO); - break; - case EVENT_BERSERK: - DoCast(me, SPELL_BERSERK); - Talk(SAY_BERSERK); - break; - } - - if (me->HasUnitState(UNIT_STATE_CASTING) && !events.IsInPhase(PHASE_INTRO)) - return; - } - - // We should not melee attack when barrier is up - if (me->HasAura(SPELL_MANA_BARRIER)) - return; - - DoMeleeAttackIfReady(); + // We should not melee attack when barrier is up + if (!me->HasAura(SPELL_MANA_BARRIER)) + DoMeleeAttackIfReady(); + }); } // summoning function for first phase @@ -568,72 +538,40 @@ class boss_lady_deathwhisper : public CreatureScript summon->CastSpell(summon, SPELL_TELEPORT_VISUAL); } - void SetGUID(ObjectGuid guid, int32 id/* = 0*/) override + void SummonedCreatureDies(Creature* summon, Unit* /*killer*/) override { - if (id != GUID_CULTIST) - return; - - _reanimationQueue.push_back(guid); - events.ScheduleEvent(EVENT_P1_REANIMATE_CULTIST, 3000, 0, PHASE_ONE); + if (summon->GetEntry() == NPC_CULT_ADHERENT || summon->GetEntry() == NPC_CULT_FANATIC) + _cultistQueue.remove(summon->GetGUID()); } - void ReanimateCultist() + void DoImproveCultist() { - if (_reanimationQueue.empty()) + if (_cultistQueue.empty()) return; - ObjectGuid cultistGUID = _reanimationQueue.front(); - Creature* cultist = ObjectAccessor::GetCreature(*me, cultistGUID); - _reanimationQueue.pop_front(); + _cultistGUID = Trinity::Containers::SelectRandomContainerElement(_cultistQueue); + _cultistQueue.remove(_cultistGUID); + Creature* cultist = ObjectAccessor::GetCreature(*me, _cultistGUID); if (!cultist) return; - Talk(SAY_ANIMATE_DEAD); - DoCast(cultist, SPELL_DARK_MARTYRDOM_T); - } - - void SpellHitTarget(Unit* target, SpellInfo const* spell) override - { - if (spell->Id == SPELL_DARK_MARTYRDOM_T) + if (RAND(0,1)) + me->CastSpell(cultist, SPELL_DARK_MARTYRDOM_T); + else { - Position pos = target->GetPosition(); - if (target->GetEntry() == NPC_CULT_FANATIC) - me->SummonCreature(NPC_REANIMATED_FANATIC, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - else - me->SummonCreature(NPC_REANIMATED_ADHERENT, pos, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); - - if (TempSummon* summon = target->ToTempSummon()) - summon->UnSummon(); + me->CastSpell(cultist, cultist->GetEntry() == NPC_CULT_FANATIC ? SPELL_DARK_TRANSFORMATION_T : SPELL_DARK_EMPOWERMENT_T, true); + Talk(uint8(cultist->GetEntry() == NPC_CULT_FANATIC ? SAY_DARK_TRANSFORMATION : SAY_DARK_EMPOWERMENT)); } } - void EmpowerCultist() - { - if (summons.empty()) - return; - - std::list<Creature*> temp; - for (SummonList::iterator itr = summons.begin(); itr != summons.end(); ++itr) - if (Creature* cre = ObjectAccessor::GetCreature(*me, *itr)) - if (cre->IsAlive() && (cre->GetEntry() == NPC_CULT_FANATIC || cre->GetEntry() == NPC_CULT_ADHERENT)) - temp.push_back(cre); - - // noone to empower - if (temp.empty()) - return; - - // select random cultist - Creature* cultist = Trinity::Containers::SelectRandomContainerElement(temp); - DoCast(cultist, cultist->GetEntry() == NPC_CULT_FANATIC ? SPELL_DARK_TRANSFORMATION_T : SPELL_DARK_EMPOWERMENT_T, true); - Talk(uint8(cultist->GetEntry() == NPC_CULT_FANATIC ? SAY_DARK_TRANSFORMATION : SAY_DARK_EMPOWERMENT)); - } - private: - ObjectGuid _nextVengefulShadeTargetGUID; ObjectGuid _darnavanGUID; - GuidDeque _reanimationQueue; + ObjectGuid _cultistGUID; + GuidList _cultistQueue; + GuidList _nextVengefulShadeTargetGUID; uint32 _waveCounter; uint8 const _dominateMindCount; + uint8 _phase; bool _introDone; }; @@ -643,8 +581,6 @@ class boss_lady_deathwhisper : public CreatureScript } }; -typedef boss_lady_deathwhisper::boss_lady_deathwhisperAI DeathwisperAI; - class npc_cult_fanatic : public CreatureScript { public: @@ -652,71 +588,91 @@ class npc_cult_fanatic : public CreatureScript struct npc_cult_fanaticAI : public ScriptedAI { - npc_cult_fanaticAI(Creature* creature) : ScriptedAI(creature) { } + npc_cult_fanaticAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } void Reset() override { - Events.Reset(); - Events.ScheduleEvent(EVENT_FANATIC_NECROTIC_STRIKE, urand(10000, 12000)); - Events.ScheduleEvent(EVENT_FANATIC_SHADOW_CLEAVE, urand(14000, 16000)); - Events.ScheduleEvent(EVENT_FANATIC_VAMPIRIC_MIGHT, urand(20000, 27000)); - if (me->GetEntry() == NPC_CULT_FANATIC) - Events.ScheduleEvent(EVENT_CULTIST_DARK_MARTYRDOM, urand(18000, 32000)); + _scheduler.CancelAll(); + _scheduler + .SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }) + .Schedule(Seconds(17), [this](TaskContext vampiric_might) + { + DoCastSelf(SPELL_VAMPIRIC_MIGHT); + vampiric_might.Repeat(Seconds(25)); + }) + .Schedule(Seconds(12), [this](TaskContext shadow_cleave) + { + DoCastVictim(SPELL_SHADOW_CLEAVE); + shadow_cleave.Repeat(Seconds(14)); + }) + .Schedule(Seconds(10), [this](TaskContext necrotic_strike) + { + DoCastVictim(SPELL_NECROTIC_STRIKE); + necrotic_strike.Repeat(Seconds(17)); + }); } void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override { - if (spell->Id == SPELL_DARK_TRANSFORMATION) - me->UpdateEntry(NPC_DEFORMED_FANATIC); - else if (spell->Id == SPELL_DARK_TRANSFORMATION_T) + switch (spell->Id) { - Events.CancelEvent(EVENT_CULTIST_DARK_MARTYRDOM); - me->InterruptNonMeleeSpells(true); - DoCast(me, SPELL_DARK_TRANSFORMATION); + case SPELL_DARK_TRANSFORMATION_T: + me->InterruptNonMeleeSpells(true); + DoCastSelf(SPELL_DARK_TRANSFORMATION); + break; + case SPELL_DARK_TRANSFORMATION: + DoCastSelf(SPELL_FULL_HEAL); + me->UpdateEntry(NPC_DEFORMED_FANATIC); + break; + case SPELL_DARK_MARTYRDOM_T: + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(true); + me->AttackStop(); + DoCastSelf(SPELL_DARK_MARTYRDOM_FANATIC); + break; + case SPELL_DARK_MARTYRDOM_FANATIC: + _scheduler + .Schedule(Seconds(2), [this](TaskContext /*context*/) + { + me->UpdateEntry(NPC_REANIMATED_FANATIC); + DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH); + DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS); + DoCastSelf(SPELL_FULL_HEAL, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + }) + .Schedule(Seconds(6), [this](TaskContext /*context*/) + { + me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + DoZoneInCombat(me); + + if (Creature* ladyDeathwhisper = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_LADY_DEATHWHISPER))) + ladyDeathwhisper->AI()->Talk(SAY_ANIMATE_DEAD); + }); + break; + default: + break; } } void UpdateAI(uint32 diff) override { - if (!UpdateVictim()) - return; - - Events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) + if (!UpdateVictim() && !me->HasAura(SPELL_PERMANENT_FEIGN_DEATH)) return; - while (uint32 eventId = Events.ExecuteEvent()) + _scheduler.Update(diff, [this] { - switch (eventId) - { - case EVENT_FANATIC_NECROTIC_STRIKE: - DoCastVictim(SPELL_NECROTIC_STRIKE); - Events.ScheduleEvent(EVENT_FANATIC_NECROTIC_STRIKE, urand(11000, 13000)); - break; - case EVENT_FANATIC_SHADOW_CLEAVE: - DoCastVictim(SPELL_SHADOW_CLEAVE); - Events.ScheduleEvent(EVENT_FANATIC_SHADOW_CLEAVE, urand(9500, 11000)); - break; - case EVENT_FANATIC_VAMPIRIC_MIGHT: - DoCast(me, SPELL_VAMPIRIC_MIGHT); - Events.ScheduleEvent(EVENT_FANATIC_VAMPIRIC_MIGHT, urand(20000, 27000)); - break; - case EVENT_CULTIST_DARK_MARTYRDOM: - DoCast(me, SPELL_DARK_MARTYRDOM_FANATIC); - Events.ScheduleEvent(EVENT_CULTIST_DARK_MARTYRDOM, urand(16000, 21000)); - break; - } - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - } - - DoMeleeAttackIfReady(); + DoMeleeAttackIfReady(); + }); } protected: - EventMap Events; + TaskScheduler _scheduler; + InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const override @@ -732,80 +688,88 @@ class npc_cult_adherent : public CreatureScript struct npc_cult_adherentAI : public ScriptedAI { - npc_cult_adherentAI(Creature* creature) : ScriptedAI(creature) { } + npc_cult_adherentAI(Creature* creature) : ScriptedAI(creature), _instance(creature->GetInstanceScript()) { } void Reset() override { - Events.Reset(); - Events.ScheduleEvent(EVENT_ADHERENT_FROST_FEVER, urand(10000, 12000)); - Events.ScheduleEvent(EVENT_ADHERENT_DEATHCHILL, urand(14000, 16000)); - Events.ScheduleEvent(EVENT_ADHERENT_CURSE_OF_TORPOR, urand(14000, 16000)); - Events.ScheduleEvent(EVENT_ADHERENT_SHORUD_OF_THE_OCCULT, urand(32000, 39000)); - if (me->GetEntry() == NPC_CULT_ADHERENT) - Events.ScheduleEvent(EVENT_CULTIST_DARK_MARTYRDOM, urand(18000, 32000)); + _scheduler.CancelAll(); + _scheduler + .SetValidator([this] + { + return !me->HasUnitState(UNIT_STATE_CASTING); + }) + .Schedule(Seconds(5), [this](TaskContext deathchill) + { + if (me->GetEntry() == NPC_EMPOWERED_ADHERENT) + DoCastVictim(SPELL_DEATHCHILL_BLAST); + else + DoCastVictim(SPELL_DEATHCHILL_BOLT); + deathchill.Repeat(Milliseconds(2500)); + }) + .Schedule(Seconds(15), [this](TaskContext shroud_of_the_occult) + { + DoCastSelf(SPELL_SHROUD_OF_THE_OCCULT); + shroud_of_the_occult.Repeat(Seconds(10)); + }) + .Schedule(Seconds(15), [this](TaskContext curse_of_torpor) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) + DoCast(target, SPELL_CURSE_OF_TORPOR); + curse_of_torpor.Repeat(Seconds(18)); + }); } void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override { - if (spell->Id == SPELL_DARK_EMPOWERMENT) - me->UpdateEntry(NPC_EMPOWERED_ADHERENT); - else if (spell->Id == SPELL_DARK_EMPOWERMENT_T) + switch (spell->Id) { - Events.CancelEvent(EVENT_CULTIST_DARK_MARTYRDOM); - me->InterruptNonMeleeSpells(true); - DoCast(me, SPELL_DARK_EMPOWERMENT); + case SPELL_DARK_EMPOWERMENT_T: + me->UpdateEntry(NPC_EMPOWERED_ADHERENT); + break; + case SPELL_DARK_MARTYRDOM_T: + me->SetReactState(REACT_PASSIVE); + me->InterruptNonMeleeSpells(true); + me->AttackStop(); + DoCastSelf(SPELL_DARK_MARTYRDOM_ADHERENT); + break; + case SPELL_DARK_MARTYRDOM_ADHERENT: + _scheduler + .Schedule(Seconds(2), [this](TaskContext /*context*/) + { + me->UpdateEntry(NPC_REANIMATED_ADHERENT); + DoCastSelf(SPELL_PERMANENT_FEIGN_DEATH); + DoCastSelf(SPELL_CLEAR_ALL_DEBUFFS); + DoCastSelf(SPELL_FULL_HEAL, true); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + }) + .Schedule(Seconds(6), [this](TaskContext /*context*/) + { + me->RemoveAurasDueToSpell(SPELL_PERMANENT_FEIGN_DEATH); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED | UNIT_FLAG_UNK_29 | UNIT_FLAG_NOT_SELECTABLE); + me->SetReactState(REACT_AGGRESSIVE); + DoCastSelf(SPELL_SHROUD_OF_THE_OCCULT); + DoZoneInCombat(me); + + if (Creature* ladyDeathwhisper = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_LADY_DEATHWHISPER))) + ladyDeathwhisper->AI()->Talk(SAY_ANIMATE_DEAD); + }); + break; + default: + break; } } void UpdateAI(uint32 diff) override { - if (!UpdateVictim()) + if (!UpdateVictim() && !me->HasAura(SPELL_PERMANENT_FEIGN_DEATH)) return; - Events.Update(diff); - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - - while (uint32 eventId = Events.ExecuteEvent()) - { - switch (eventId) - { - case EVENT_ADHERENT_FROST_FEVER: - DoCastVictim(SPELL_FROST_FEVER); - Events.ScheduleEvent(EVENT_ADHERENT_FROST_FEVER, urand(9000, 13000)); - break; - case EVENT_ADHERENT_DEATHCHILL: - if (me->GetEntry() == NPC_EMPOWERED_ADHERENT) - DoCastVictim(SPELL_DEATHCHILL_BLAST); - else - DoCastVictim(SPELL_DEATHCHILL_BOLT); - Events.ScheduleEvent(EVENT_ADHERENT_DEATHCHILL, urand(9000, 13000)); - break; - case EVENT_ADHERENT_CURSE_OF_TORPOR: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1)) - DoCast(target, SPELL_CURSE_OF_TORPOR); - Events.ScheduleEvent(EVENT_ADHERENT_CURSE_OF_TORPOR, urand(9000, 13000)); - break; - case EVENT_ADHERENT_SHORUD_OF_THE_OCCULT: - DoCast(me, SPELL_SHORUD_OF_THE_OCCULT); - Events.ScheduleEvent(EVENT_ADHERENT_SHORUD_OF_THE_OCCULT, urand(27000, 32000)); - break; - case EVENT_CULTIST_DARK_MARTYRDOM: - DoCast(me, SPELL_DARK_MARTYRDOM_ADHERENT); - Events.ScheduleEvent(EVENT_CULTIST_DARK_MARTYRDOM, urand(16000, 21000)); - break; - } - - if (me->HasUnitState(UNIT_STATE_CASTING)) - return; - } - - DoMeleeAttackIfReady(); + _scheduler.Update(diff); } protected: - EventMap Events; + TaskScheduler _scheduler; + InstanceScript* _instance; }; CreatureAI* GetAI(Creature* creature) const override @@ -821,15 +785,28 @@ class npc_vengeful_shade : public CreatureScript struct npc_vengeful_shadeAI : public ScriptedAI { - npc_vengeful_shadeAI(Creature* creature) : ScriptedAI(creature) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } + npc_vengeful_shadeAI(Creature* creature) : ScriptedAI(creature) { } void Reset() override { + me->SetReactState(REACT_PASSIVE); me->AddAura(SPELL_VENGEFUL_BLAST_PASSIVE, me); + + _scheduler + .Schedule(Seconds(2), [this](TaskContext /*context*/) + { + me->SetReactState(REACT_AGGRESSIVE); + me->AI()->AttackStart(ObjectAccessor::GetUnit(*me, _targetGUID)); + }) + .Schedule(Seconds(7), [this](TaskContext /*context*/) + { + me->KillSelf(); + }); + } + + void SetGUID(ObjectGuid guid, int32 /*type*/) override + { + _targetGUID = guid; } void SpellHitTarget(Unit* /*target*/, SpellInfo const* spell) override @@ -846,6 +823,18 @@ class npc_vengeful_shade : public CreatureScript break; } } + + void UpdateAI(uint32 diff) override + { + _scheduler.Update(diff, [this] + { + DoMeleeAttackIfReady(); + }); + } + + private: + TaskScheduler _scheduler; + ObjectGuid _targetGUID; }; CreatureAI* GetAI(Creature* creature) const override @@ -875,10 +864,10 @@ class npc_darnavan : public CreatureScript void Reset() override { _events.Reset(); - _events.ScheduleEvent(EVENT_DARNAVAN_BLADESTORM, 10000); - _events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, urand(20000, 25000)); - _events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, urand(25000, 30000)); - _events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, urand(5000, 8000)); + _events.ScheduleEvent(EVENT_DARNAVAN_BLADESTORM, Seconds(10)); + _events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, Seconds(20), Seconds(25)); + _events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, Seconds(25), Seconds(30)); + _events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, Seconds(5), Seconds(8)); Initialize(); } @@ -889,7 +878,7 @@ class npc_darnavan : public CreatureScript { if (Group* group = owner->GetGroup()) { - for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next()) + for (GroupReference* itr = group->GetFirstMember(); itr != nullptr; itr = itr->next()) if (Player* member = itr->GetSource()) member->FailQuest(QUEST_DEPROGRAMMING); } @@ -925,7 +914,7 @@ class npc_darnavan : public CreatureScript { DoCastVictim(SPELL_SHATTERING_THROW); _canShatter = false; - _events.ScheduleEvent(EVENT_DARNAVAN_SHATTERING_THROW, 30000); + _events.ScheduleEvent(EVENT_DARNAVAN_SHATTERING_THROW, Seconds(30)); return; } @@ -933,7 +922,7 @@ class npc_darnavan : public CreatureScript { DoCastVictim(SPELL_CHARGE); _canCharge = false; - _events.ScheduleEvent(EVENT_DARNAVAN_CHARGE, 20000); + _events.ScheduleEvent(EVENT_DARNAVAN_CHARGE, Seconds(20)); return; } @@ -943,25 +932,25 @@ class npc_darnavan : public CreatureScript { case EVENT_DARNAVAN_BLADESTORM: DoCast(SPELL_BLADESTORM); - _events.ScheduleEvent(EVENT_DARNAVAN_BLADESTORM, urand(90000, 100000)); + _events.ScheduleEvent(EVENT_DARNAVAN_BLADESTORM, Seconds(90), Seconds(100)); break; case EVENT_DARNAVAN_CHARGE: _canCharge = true; break; case EVENT_DARNAVAN_INTIMIDATING_SHOUT: DoCast(SPELL_INTIMIDATING_SHOUT); - _events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, urand(90000, 120000)); + _events.ScheduleEvent(EVENT_DARNAVAN_INTIMIDATING_SHOUT, Seconds(90), Minutes(2)); break; case EVENT_DARNAVAN_MORTAL_STRIKE: DoCastVictim(SPELL_MORTAL_STRIKE); - _events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, urand(15000, 30000)); + _events.ScheduleEvent(EVENT_DARNAVAN_MORTAL_STRIKE, Seconds(15), Seconds(30)); break; case EVENT_DARNAVAN_SHATTERING_THROW: _canShatter = true; break; case EVENT_DARNAVAN_SUNDER_ARMOR: DoCastVictim(SPELL_SUNDER_ARMOR); - _events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, urand(3000, 7000)); + _events.ScheduleEvent(EVENT_DARNAVAN_SUNDER_ARMOR, Seconds(3), Seconds(7)); break; } } @@ -1013,50 +1002,86 @@ class spell_deathwhisper_mana_barrier : public SpellScriptLoader } }; -class spell_cultist_dark_martyrdom : public SpellScriptLoader +class at_lady_deathwhisper_entrance : public AreaTriggerScript { public: - spell_cultist_dark_martyrdom() : SpellScriptLoader("spell_cultist_dark_martyrdom") { } + at_lady_deathwhisper_entrance() : AreaTriggerScript("at_lady_deathwhisper_entrance") { } - class spell_cultist_dark_martyrdom_SpellScript : public SpellScript + bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override { - PrepareSpellScript(spell_cultist_dark_martyrdom_SpellScript); + if (InstanceScript* instance = player->GetInstanceScript()) + if (instance->GetBossState(DATA_LADY_DEATHWHISPER) != DONE) + if (Creature* ladyDeathwhisper = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_LADY_DEATHWHISPER))) + ladyDeathwhisper->AI()->DoAction(ACTION_START_INTRO); + + return true; + } +}; + +class spell_deathwhisper_dominated_mind : public SpellScriptLoader +{ + public: + spell_deathwhisper_dominated_mind() : SpellScriptLoader("spell_deathwhisper_dominated_mind") { } - void HandleEffect(SpellEffIndex /*effIndex*/) + class spell_deathwhisper_dominated_mind_AuraScript : public AuraScript + { + PrepareAuraScript(spell_deathwhisper_dominated_mind_AuraScript); + + bool Validate(SpellInfo const* /*spell*/) override { - if (GetCaster()->IsSummon()) - if (Unit* owner = GetCaster()->ToTempSummon()->GetSummoner()) - owner->GetAI()->SetGUID(GetCaster()->GetGUID(), GUID_CULTIST); + if (!sSpellMgr->GetSpellInfo(SPELL_DOMINATE_MIND_SCALE)) + return false; + return true; + } - GetCaster()->KillSelf(); - GetCaster()->SetDisplayId(uint32(GetCaster()->GetEntry() == NPC_CULT_FANATIC ? 38009 : 38010)); + void HandleApply(AuraEffect const* /*eff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->CastSpell(target, SPELL_DOMINATE_MIND_SCALE, true); } void Register() override { - OnEffectHitTarget += SpellEffectFn(spell_cultist_dark_martyrdom_SpellScript::HandleEffect, EFFECT_2, SPELL_EFFECT_FORCE_DESELECT); + AfterEffectApply += AuraEffectApplyFn(spell_deathwhisper_dominated_mind_AuraScript::HandleApply, EFFECT_0, SPELL_AURA_AOE_CHARM, AURA_EFFECT_HANDLE_REAL); } }; - SpellScript* GetSpellScript() const override + AuraScript* GetAuraScript() const override { - return new spell_cultist_dark_martyrdom_SpellScript(); + return new spell_deathwhisper_dominated_mind_AuraScript(); } }; -class at_lady_deathwhisper_entrance : public AreaTriggerScript +class spell_deathwhisper_summon_spirits : public SpellScriptLoader { public: - at_lady_deathwhisper_entrance() : AreaTriggerScript("at_lady_deathwhisper_entrance") { } + spell_deathwhisper_summon_spirits() : SpellScriptLoader("spell_deathwhisper_summon_spirits") { } - bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/) override + class spell_deathwhisper_summon_spirits_SpellScript : public SpellScript { - if (InstanceScript* instance = player->GetInstanceScript()) - if (instance->GetBossState(DATA_LADY_DEATHWHISPER) != DONE) - if (Creature* ladyDeathwhisper = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_LADY_DEATHWHISPER))) - ladyDeathwhisper->AI()->DoAction(ACTION_START_INTRO); + PrepareSpellScript(spell_deathwhisper_summon_spirits_SpellScript); - return true; + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SUMMON_SHADE)) + return false; + return true; + } + + void HandleScriptEffect(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetHitUnit(), SPELL_SUMMON_SHADE, true); + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_deathwhisper_summon_spirits_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_deathwhisper_summon_spirits_SpellScript(); } }; @@ -1068,6 +1093,7 @@ void AddSC_boss_lady_deathwhisper() new npc_vengeful_shade(); new npc_darnavan(); new spell_deathwhisper_mana_barrier(); - new spell_cultist_dark_martyrdom(); + new spell_deathwhisper_dominated_mind(); + new spell_deathwhisper_summon_spirits(); new at_lady_deathwhisper_entrance(); } 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/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index b618cb9ce2d..44f300e1efa 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -2991,8 +2991,12 @@ class spell_the_lich_king_dark_hunger : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = int32(eventInfo.GetDamageInfo()->GetDamage() / 2); - GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 heal = static_cast<int32>(damageInfo->GetDamage()) / 2; + GetTarget()->CastCustomSpell(SPELL_DARK_HUNGER_HEAL, SPELLVALUE_BASE_POINT0, heal, GetTarget(), true, nullptr, aurEff); } void Register() override diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp index 3d9ea97b136..b06bc9e872f 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp @@ -604,8 +604,11 @@ class spell_oculus_temporal_rift : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 amount = aurEff->GetAmount() + eventInfo.GetDamageInfo()->GetDamage(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + int32 amount = aurEff->GetAmount() + damageInfo->GetDamage(); if (amount >= 15000) { if (Unit* caster = GetCaster()) diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp index 6c27aaef25d..70d9fc90cb9 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yogg_saron.cpp @@ -2751,8 +2751,12 @@ class spell_yogg_saron_grim_reprisal : public SpellScriptLoader // 63305 void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 damage = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), 60); - GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetDamageInfo()->GetAttacker(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 damage = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), 60); + GetTarget()->CastCustomSpell(SPELL_GRIM_REPRISAL_DAMAGE, SPELLVALUE_BASE_POINT0, damage, damageInfo->GetAttacker(), true, nullptr, aurEff); } void Register() override 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/Northrend/zone_wintergrasp.cpp b/src/server/scripts/Northrend/zone_wintergrasp.cpp index 0519f964fd6..e45b1f42fa1 100644 --- a/src/server/scripts/Northrend/zone_wintergrasp.cpp +++ b/src/server/scripts/Northrend/zone_wintergrasp.cpp @@ -247,39 +247,39 @@ class npc_wg_queue : public CreatureScript public: npc_wg_queue() : CreatureScript("npc_wg_queue") { } - struct npc_wg_queueAI : public ScriptedAI - { - npc_wg_queueAI(Creature* creature) : ScriptedAI(creature) + struct npc_wg_queueAI : public ScriptedAI { - FrostArmor_Timer = 0; - } + npc_wg_queueAI(Creature* creature) : ScriptedAI(creature) + { + FrostArmor_Timer = 0; + } - uint32 FrostArmor_Timer; + uint32 FrostArmor_Timer; - void Reset() override - { - FrostArmor_Timer = 0; - } + void Reset() override + { + FrostArmor_Timer = 0; + } - void EnterCombat(Unit* /*who*/) override { } + void EnterCombat(Unit* /*who*/) override { } - void UpdateAI(uint32 diff) override - { - if (FrostArmor_Timer <= diff) + void UpdateAI(uint32 diff) override { - DoCast(me, SPELL_FROST_ARMOR); - FrostArmor_Timer = 180000; + if (FrostArmor_Timer <= diff) + { + DoCast(me, SPELL_FROST_ARMOR); + FrostArmor_Timer = 180000; + } + else FrostArmor_Timer -= diff; + + DoMeleeAttackIfReady(); } - else FrostArmor_Timer -= diff; + }; - DoMeleeAttackIfReady(); + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_wg_queueAI(creature); } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_wg_queueAI(creature); - } bool OnGossipHello(Player* player, Creature* creature) override { @@ -380,111 +380,31 @@ class go_wg_vehicle_teleporter : public GameObjectScript } }; -class npc_wg_quest_giver : public CreatureScript +class npc_wg_give_promotion_credit : public CreatureScript { public: - npc_wg_quest_giver() : CreatureScript("npc_wg_quest_giver") { } + npc_wg_give_promotion_credit() : CreatureScript("npc_wg_give_promotion_credit") { } - bool OnGossipHello(Player* player, Creature* creature) override + struct npc_wg_give_promotion_creditAI : public ScriptedAI { - Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); - if (!wintergrasp) - return true; - - if (creature->IsVendor()) - { - AddGossipItemFor(player, Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR); - player->PlayerTalkClass->GetGossipMenu().AddGossipMenuItemData(0, 0, 0); - } - - /// @todo: move this to conditions or something else + npc_wg_give_promotion_creditAI(Creature* creature) : ScriptedAI(creature) { } - // Player::PrepareQuestMenu(guid) - if (creature->IsQuestGiver()) + void JustDied(Unit* killer) override { - QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry()); - QuestRelationBounds objectQIR = sObjectMgr->GetCreatureQuestInvolvedRelationBounds(creature->GetEntry()); + if (killer->GetTypeId() != TYPEID_PLAYER) + return; - QuestMenu& qm = player->PlayerTalkClass->GetQuestMenu(); - qm.ClearMenu(); - - for (QuestRelations::const_iterator i = objectQIR.first; i != objectQIR.second; ++i) - { - uint32 questId = i->second; - QuestStatus status = player->GetQuestStatus(questId); - if (status == QUEST_STATUS_COMPLETE) - qm.AddMenuItem(questId, 4); - else if (status == QUEST_STATUS_INCOMPLETE) - qm.AddMenuItem(questId, 4); - //else if (status == QUEST_STATUS_AVAILABLE) - // qm.AddMenuItem(quest_id, 2); - } + BattlefieldWG* wintergrasp = static_cast<BattlefieldWG*>(sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)); + if (!wintergrasp) + return; - for (QuestRelations::const_iterator i = objectQR.first; i != objectQR.second; ++i) - { - uint32 questId = i->second; - Quest const* quest = sObjectMgr->GetQuestTemplate(questId); - if (!quest) - continue; - - if (!player->CanTakeQuest(quest, false)) - continue; - - switch (questId) - { - // Horde attacker - case QUEST_BONES_AND_ARROWS_HORDE_ATT: - case QUEST_JINXING_THE_WALLS_HORDE_ATT: - case QUEST_SLAY_THEM_ALL_HORDE_ATT: - case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT: - case QUEST_HEALING_WITH_ROSES_HORDE_ATT: - case QUEST_DEFEND_THE_SIEGE_HORDE_ATT: - if (wintergrasp->GetAttackerTeam() != TEAM_HORDE) - continue; - break; - // Horde defender - case QUEST_BONES_AND_ARROWS_HORDE_DEF: - case QUEST_WARDING_THE_WALLS_HORDE_DEF: - case QUEST_SLAY_THEM_ALL_HORDE_DEF: - case QUEST_FUELING_THE_DEMOLISHERS_HORDE_DEF: - case QUEST_HEALING_WITH_ROSES_HORDE_DEF: - case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF: - case QUEST_STOP_THE_SIEGE_HORDE_DEF: - if (wintergrasp->GetDefenderTeam() != TEAM_HORDE) - continue; - break; - // Alliance attacker - case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT: - case QUEST_WARDING_THE_WARRIORS_ALLIANCE_ATT: - case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT: - case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT: - case QUEST_A_RARE_HERB_ALLIANCE_ATT: - if (wintergrasp->GetAttackerTeam() != TEAM_ALLIANCE) - continue; - break; - // Alliance defender - case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF: - case QUEST_WARDING_THE_WARRIORS_ALLIANCE_DEF: - case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_DEF: - case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF: - case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF: - case QUEST_A_RARE_HERB_ALLIANCE_DEF: - if (wintergrasp->GetDefenderTeam() != TEAM_ALLIANCE) - continue; - break; - default: - break; - } - - if (quest->IsAutoComplete()) - qm.AddMenuItem(questId, 4); - else if (player->GetQuestStatus(questId) == QUEST_STATUS_NONE) - qm.AddMenuItem(questId, 2); - } + wintergrasp->HandlePromotion(killer->ToPlayer(), me); } + }; - SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); - return true; + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_wg_give_promotion_creditAI(creature); } }; @@ -554,26 +474,26 @@ class spell_wintergrasp_grab_passenger : public SpellScriptLoader class achievement_wg_didnt_stand_a_chance : public AchievementCriteriaScript { -public: - achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { } - - bool OnCheck(Player* source, Unit* target) override - { - if (!target) - return false; + public: + achievement_wg_didnt_stand_a_chance() : AchievementCriteriaScript("achievement_wg_didnt_stand_a_chance") { } - if (Player* victim = target->ToPlayer()) + bool OnCheck(Player* source, Unit* target) override { - if (!victim->IsMounted()) + if (!target) return false; - if (Vehicle* vehicle = source->GetVehicle()) - if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon - return true; - } + if (Player* victim = target->ToPlayer()) + { + if (!victim->IsMounted()) + return false; + + if (Vehicle* vehicle = source->GetVehicle()) + if (vehicle->GetVehicleInfo()->m_ID == 244) // Wintergrasp Tower Cannon + return true; + } - return false; - } + return false; + } }; enum WgTeleport @@ -583,91 +503,91 @@ enum WgTeleport class spell_wintergrasp_defender_teleport : public SpellScriptLoader { -public: - spell_wintergrasp_defender_teleport() : SpellScriptLoader("spell_wintergrasp_defender_teleport") { } - - class spell_wintergrasp_defender_teleport_SpellScript : public SpellScript - { - PrepareSpellScript(spell_wintergrasp_defender_teleport_SpellScript); + public: + spell_wintergrasp_defender_teleport() : SpellScriptLoader("spell_wintergrasp_defender_teleport") { } - SpellCastResult CheckCast() + class spell_wintergrasp_defender_teleport_SpellScript : public SpellScript { - if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) - if (Player* target = GetExplTargetUnit()->ToPlayer()) - // check if we are in Wintergrasp at all, SotA uses same teleport spells - if ((target->GetZoneId() == 4197 && target->GetTeamId() != wg->GetDefenderTeam()) || target->HasAura(SPELL_WINTERGRASP_TELEPORT_TRIGGER)) - return SPELL_FAILED_BAD_TARGETS; - return SPELL_CAST_OK; - } + PrepareSpellScript(spell_wintergrasp_defender_teleport_SpellScript); - void Register() override + SpellCastResult CheckCast() + { + if (Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG)) + if (Player* target = GetExplTargetUnit()->ToPlayer()) + // check if we are in Wintergrasp at all, SotA uses same teleport spells + if ((target->GetZoneId() == 4197 && target->GetTeamId() != wg->GetDefenderTeam()) || target->HasAura(SPELL_WINTERGRASP_TELEPORT_TRIGGER)) + return SPELL_FAILED_BAD_TARGETS; + return SPELL_CAST_OK; + } + + void Register() override + { + OnCheckCast += SpellCheckCastFn(spell_wintergrasp_defender_teleport_SpellScript::CheckCast); + } + }; + + SpellScript* GetSpellScript() const override { - OnCheckCast += SpellCheckCastFn(spell_wintergrasp_defender_teleport_SpellScript::CheckCast); + return new spell_wintergrasp_defender_teleport_SpellScript(); } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_wintergrasp_defender_teleport_SpellScript(); - } }; class spell_wintergrasp_defender_teleport_trigger : public SpellScriptLoader { -public: - spell_wintergrasp_defender_teleport_trigger() : SpellScriptLoader("spell_wintergrasp_defender_teleport_trigger") { } - - class spell_wintergrasp_defender_teleport_trigger_SpellScript : public SpellScript - { - PrepareSpellScript(spell_wintergrasp_defender_teleport_trigger_SpellScript); + public: + spell_wintergrasp_defender_teleport_trigger() : SpellScriptLoader("spell_wintergrasp_defender_teleport_trigger") { } - void HandleDummy(SpellEffIndex /*effindex*/) + class spell_wintergrasp_defender_teleport_trigger_SpellScript : public SpellScript { - if (Unit* target = GetHitUnit()) + PrepareSpellScript(spell_wintergrasp_defender_teleport_trigger_SpellScript); + + void HandleDummy(SpellEffIndex /*effindex*/) { - WorldLocation loc = target->GetWorldLocation(); - SetExplTargetDest(loc); + if (Unit* target = GetHitUnit()) + { + WorldLocation loc = target->GetWorldLocation(); + SetExplTargetDest(loc); + } } - } - void Register() override + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_defender_teleport_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override { - OnEffectHitTarget += SpellEffectFn(spell_wintergrasp_defender_teleport_trigger_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + return new spell_wintergrasp_defender_teleport_trigger_SpellScript(); } - }; - - SpellScript* GetSpellScript() const override - { - return new spell_wintergrasp_defender_teleport_trigger_SpellScript(); - } }; class condition_is_wintergrasp_horde : public ConditionScript { -public: - condition_is_wintergrasp_horde() : ConditionScript("condition_is_wintergrasp_horde") { } + public: + condition_is_wintergrasp_horde() : ConditionScript("condition_is_wintergrasp_horde") { } - bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */) - { - Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); - if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_HORDE) - return true; - return false; - } + bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */) + { + Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (wintergrasp && wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_HORDE) + return true; + return false; + } }; class condition_is_wintergrasp_alliance : public ConditionScript { -public: - condition_is_wintergrasp_alliance() : ConditionScript("condition_is_wintergrasp_alliance") { } + public: + condition_is_wintergrasp_alliance() : ConditionScript("condition_is_wintergrasp_alliance") { } - bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */) - { - Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); - if (wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE) - return true; - return false; - } + bool OnConditionCheck(Condition const* /* condition */, ConditionSourceInfo& /* sourceInfo */) + { + Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG); + if (wintergrasp && wintergrasp->IsEnabled() && wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE) + return true; + return false; + } }; void AddSC_wintergrasp() @@ -676,7 +596,7 @@ void AddSC_wintergrasp() new npc_wg_spirit_guide(); new npc_wg_demolisher_engineer(); new go_wg_vehicle_teleporter(); - new npc_wg_quest_giver(); + new npc_wg_give_promotion_credit(); new spell_wintergrasp_force_building(); new spell_wintergrasp_grab_passenger(); new achievement_wg_didnt_stand_a_chance(); 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 90bf8bb1948..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; }; @@ -892,6 +923,122 @@ public: } }; +enum Aledis +{ + SAY_CHALLENGE = 0, + SAY_DEFEATED = 1, + EVENT_TALK = 1, + EVENT_ATTACK = 2, + EVENT_EVADE = 3, + EVENT_FIREBALL = 4, + EVENT_FROSTNOVA = 5, + SPELL_FIREBALL = 20823, + SPELL_FROSTNOVA = 11831 +}; + +class npc_magister_aledis : public CreatureScript +{ +public: + npc_magister_aledis() : CreatureScript("npc_magister_aledis") { } + + bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 /*action*/) override + { + CloseGossipMenuFor(player); + creature->StopMoving(); + ENSURE_AI(npc_magister_aledis::npc_magister_aledisAI, creature->AI())->StartFight(player); + return true; + } + + struct npc_magister_aledisAI : public ScriptedAI + { + npc_magister_aledisAI(Creature* creature) : ScriptedAI(creature) { } + + void StartFight(Player* player) + { + me->Dismount(); + me->SetFacingToObject(player, true); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + _playerGUID = player->GetGUID(); + _events.ScheduleEvent(EVENT_TALK, Seconds(2)); + } + + void Reset() override + { + me->RestoreFaction(); + me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + } + + void DamageTaken(Unit* /*attacker*/, uint32 &damage) override + { + if (damage > me->GetHealth() || me->HealthBelowPctDamaged(20, damage)) + { + damage = 0; + + _events.Reset(); + me->RestoreFaction(); + me->RemoveAllAuras(); + me->DeleteThreatList(); + me->CombatStop(true); + me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + Talk(SAY_DEFEATED); + + _events.ScheduleEvent(EVENT_EVADE, Minutes(1)); + } + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_TALK: + Talk(SAY_CHALLENGE); + _events.ScheduleEvent(EVENT_ATTACK, Seconds(2)); + break; + case EVENT_ATTACK: + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC); + me->setFaction(FACTION_HOSTILE); + me->CombatStart(ObjectAccessor::GetPlayer(*me, _playerGUID)); + _events.ScheduleEvent(EVENT_FIREBALL, 1); + _events.ScheduleEvent(EVENT_FROSTNOVA, Seconds(5)); + break; + case EVENT_FIREBALL: + DoCast(SPELL_FIREBALL); + _events.ScheduleEvent(EVENT_FIREBALL, Seconds(10)); + break; + case EVENT_FROSTNOVA: + DoCastAOE(SPELL_FROSTNOVA); + _events.ScheduleEvent(EVENT_FROSTNOVA, Seconds(20)); + break; + case EVENT_EVADE: + EnterEvadeMode(); + break; + } + } + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + private: + EventMap _events; + ObjectGuid _playerGUID; + }; + + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_magister_aledisAI(creature); + } +}; + void AddSC_hellfire_peninsula() { new npc_aeranas(); @@ -900,4 +1047,5 @@ void AddSC_hellfire_peninsula() new npc_fel_guard_hound(); new npc_colonel_jules(); new npc_barada(); + new npc_magister_aledis(); } diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 7f6654bd6dd..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, @@ -152,6 +156,53 @@ class npc_pet_hunter_snake_trap : public CreatureScript } }; +// 57627 - Charge +class spell_pet_charge : public SpellScriptLoader +{ + public: + spell_pet_charge() : SpellScriptLoader("spell_pet_charge") { } + + class spell_pet_charge_AuraScript : public AuraScript + { + PrepareAuraScript(spell_pet_charge_AuraScript); + + 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 + { + OnEffectProc += AuraEffectProcFn(spell_pet_charge_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_pet_charge_AuraScript(); + } +}; + // -53178 - Guard Dog class spell_pet_guard_dog : public SpellScriptLoader { @@ -185,9 +236,9 @@ 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(eventInfo.GetSpellInfo()->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); + float addThreat = CalculatePct(ASSERT_NOTNULL(eventInfo.GetSpellInfo())->Effects[EFFECT_0].CalcValue(caster), aurEff->GetAmount()); eventInfo.GetProcTarget()->AddThreat(caster, addThreat); } @@ -232,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 @@ -301,6 +352,7 @@ class spell_pet_culling_the_herd : public SpellScriptLoader void AddSC_hunter_pet_scripts() { new npc_pet_hunter_snake_trap(); + new spell_pet_charge(); new spell_pet_guard_dog(); new spell_pet_silverback(); new spell_pet_culling_the_herd(); diff --git a/src/server/scripts/Spells/spell_dk.cpp b/src/server/scripts/Spells/spell_dk.cpp index b3612ec6428..13eec799493 100644 --- a/src/server/scripts/Spells/spell_dk.cpp +++ b/src/server/scripts/Spells/spell_dk.cpp @@ -129,9 +129,9 @@ public: bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()) + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) { - switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask())) + switch (GetFirstSchoolInMask(damageInfo->GetSchoolMask())) { case SPELL_SCHOOL_HOLY: case SPELL_SCHOOL_FIRE: @@ -529,8 +529,12 @@ class spell_dk_blood_gorged : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 bp = int32(eventInfo.GetDamageInfo()->GetDamage() * 1.5f); - GetTarget()->CastCustomSpell(SPELL_DK_BLOOD_GORGED_HEAL, SPELLVALUE_BASE_POINT0, bp, _procTarget, true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 bp = static_cast<int32>(damageInfo->GetDamage() * 1.5f); + GetTarget()->CastCustomSpell(SPELL_DK_BLOOD_GORGED_HEAL, SPELLVALUE_BASE_POINT0, bp, _procTarget, true, nullptr, aurEff); } void Register() override @@ -596,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 @@ -1245,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 @@ -1436,7 +1440,7 @@ public: { PreventDefaultAction(); if (DamageInfo* dmgInfo = eventInfo.GetDamageInfo()) - eventInfo.GetActor()->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL, SPELLVALUE_BASE_POINT0, CalculatePct(int32(dmgInfo->GetDamage()), aurEff->GetAmount()), + eventInfo.GetActor()->CastCustomSpell(SPELL_DK_IMPROVED_BLOOD_PRESENCE_HEAL, SPELLVALUE_BASE_POINT0, CalculatePct(static_cast<int32>(dmgInfo->GetDamage()), aurEff->GetAmount()), eventInfo.GetActor(), true, nullptr, aurEff); } @@ -1584,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 @@ -1620,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 @@ -1664,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 @@ -2068,6 +2072,34 @@ class spell_dk_rime : public SpellScriptLoader } }; +// 56817 - Rune strike proc (Serverside spell) +class spell_dk_rune_strike_proc : public SpellScriptLoader +{ + public: + spell_dk_rune_strike_proc() : SpellScriptLoader("spell_dk_rune_strike_proc") { } + + class spell_dk_rune_strike_proc_AuraScript : public AuraScript + { + PrepareAuraScript(spell_dk_rune_strike_proc_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_dk_rune_strike_proc_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dk_rune_strike_proc_AuraScript(); + } +}; + // 59754 Rune Tap - Party class spell_dk_rune_tap_party : public SpellScriptLoader { @@ -2295,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(); @@ -2315,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 @@ -2392,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 @@ -2446,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 @@ -2509,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 @@ -2554,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 @@ -2769,17 +2801,25 @@ public: class player_ghoulAI : public PlayerAI { public: - player_ghoulAI(Player* player, ObjectGuid ghoulGUID) : PlayerAI(player), _ghoulGUID(ghoulGUID) { } + player_ghoulAI(Player* player, ObjectGuid ghoulGUID) : PlayerAI(player), _ghoulGUID(ghoulGUID), _ghoulCheckTimer(1000){ } - void UpdateAI(uint32 /*diff*/) override + void UpdateAI(uint32 diff) override { - Creature* ghoul = ObjectAccessor::GetCreature(*me, _ghoulGUID); - if (!ghoul || !ghoul->IsAlive()) - me->RemoveAura(SPELL_DK_RAISE_ALLY); + if (_ghoulCheckTimer <= diff) + { + _ghoulCheckTimer = 1000; + + Creature* ghoul = ObjectAccessor::GetCreature(*me, _ghoulGUID); + if (!ghoul || !ghoul->IsAlive()) + me->RemoveAura(SPELL_DK_RAISE_ALLY); + } + else + _ghoulCheckTimer -= diff; } private: ObjectGuid _ghoulGUID; + uint32 _ghoulCheckTimer; }; // 46619 - Raise Ally @@ -2801,7 +2841,7 @@ public: void SendText() { if (Unit* original = GetOriginalCaster()) - original->Whisper(TEXT_RISE_ALLY, GetCaster()->ToPlayer(), true); + original->Unit::Whisper(TEXT_RISE_ALLY, GetCaster()->ToPlayer(), true); } void HandleSummon(SpellEffIndex effIndex) @@ -3028,6 +3068,7 @@ void AddSC_deathknight_spell_scripts() new spell_dk_presence(); new spell_dk_raise_dead(); new spell_dk_rime(); + new spell_dk_rune_strike_proc(); new spell_dk_rune_tap_party(); new spell_dk_scent_of_blood(); new spell_dk_scent_of_blood_trigger(); diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp index 3e03316d9e4..56624346772 100644 --- a/src/server/scripts/Spells/spell_druid.cpp +++ b/src/server/scripts/Spells/spell_druid.cpp @@ -201,68 +201,90 @@ class spell_dru_dash : public SpellScriptLoader } }; +// -48516 - Eclipse class spell_dru_eclipse : public SpellScriptLoader { -public: - spell_dru_eclipse() : SpellScriptLoader("spell_dru_eclipse") { } - - class spell_dru_eclipse_AuraScript : public AuraScript - { - PrepareAuraScript(spell_dru_eclipse_AuraScript); + public: + spell_dru_eclipse() : SpellScriptLoader("spell_dru_eclipse") { } - bool Validate(SpellInfo const* /*spellInfo*/) override + class spell_dru_eclipse_AuraScript : public AuraScript { - if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_LUNAR_PROC)) - return false; - if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) - return false; - return true; - } + PrepareAuraScript(spell_dru_eclipse_AuraScript); - bool CheckProc(ProcEventInfo& eventInfo) - { - if (!eventInfo.GetSpellInfo()) - return false; + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_LUNAR_PROC)) + return false; + if (!sSpellMgr->GetSpellInfo(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) + return false; + return true; + } - if (eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_LUNAR_PROC) || eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) - return false; + bool CheckProc(ProcEventInfo& eventInfo) + { + if (eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_LUNAR_PROC) || eventInfo.GetActor()->HasAura(SPELL_DRUID_ECLIPSE_SOLAR_PROC)) + return false; - // Triggered by Wrath? - if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 1) - return roll_chance_f(GetSpellInfo()->ProcChance * 0.6f) && _lunarProcCooldownEnd <= std::chrono::steady_clock::now(); + return true; + } - return _solarProcCooldownEnd <= std::chrono::steady_clock::now(); - } + bool CheckSolar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) + { + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 4)) // Starfire + return false; - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) - { - PreventDefaultAction(); - if (eventInfo.GetSpellInfo()->SpellFamilyFlags[0] & 1) + return _solarProcCooldownEnd <= std::chrono::steady_clock::now(); + } + + bool CheckLunar(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo) { - _lunarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(aurEff->GetAmount()); - eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); + SpellInfo const* spellInfo = eventInfo.GetSpellInfo(); + if (!spellInfo || !(spellInfo->SpellFamilyFlags[0] & 1)) // Wrath + return false; + + // Reduced lunar proc chance (60% of normal) + if (!roll_chance_i(60)) + return false; + + return _lunarProcCooldownEnd <= std::chrono::steady_clock::now(); } - else + + void ProcSolar(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - _solarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(aurEff->GetAmount()); + PreventDefaultAction(); + + _solarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(30); eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_SOLAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); } - } - void Register() override - { - DoCheckProc += AuraCheckProcFn(spell_dru_eclipse_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } + void ProcLunar(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); - std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); - std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); - }; + _lunarProcCooldownEnd = std::chrono::steady_clock::now() + Seconds(30); + eventInfo.GetActor()->CastSpell(eventInfo.GetActor(), SPELL_DRUID_ECLIPSE_LUNAR_PROC, TRIGGERED_FULL_MASK, nullptr, aurEff); + } - AuraScript* GetAuraScript() const override - { - return new spell_dru_eclipse_AuraScript(); - } + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_dru_eclipse_AuraScript::CheckProc); + + DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_eclipse_AuraScript::CheckSolar, EFFECT_0, SPELL_AURA_DUMMY); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_dru_eclipse_AuraScript::CheckLunar, EFFECT_1, SPELL_AURA_DUMMY); + + OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::ProcSolar, EFFECT_0, SPELL_AURA_DUMMY); + OnEffectProc += AuraEffectProcFn(spell_dru_eclipse_AuraScript::ProcLunar, EFFECT_1, SPELL_AURA_DUMMY); + } + + std::chrono::steady_clock::time_point _lunarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); + std::chrono::steady_clock::time_point _solarProcCooldownEnd = std::chrono::steady_clock::time_point::min(); + }; + + AuraScript* GetAuraScript() const override + { + return new spell_dru_eclipse_AuraScript(); + } }; // 5229 - Enrage @@ -464,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 @@ -508,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 @@ -545,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 @@ -594,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 @@ -740,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 @@ -883,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 @@ -893,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 @@ -1021,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 @@ -1140,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 @@ -1313,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 @@ -1398,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 @@ -1591,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*/) @@ -1632,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)) @@ -1734,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(); @@ -1755,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 @@ -1788,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 @@ -1832,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 @@ -1865,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 @@ -1902,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(); @@ -1934,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 @@ -2054,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 @@ -2158,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 a8d71d57297..d0fcd1080bb 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -113,7 +113,8 @@ class spell_gen_adaptive_warding : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetSpellInfo()) return false; // find Mage Armor @@ -156,7 +157,7 @@ class spell_gen_adaptive_warding : public SpellScriptLoader default: return; } - GetTarget()->CastSpell(GetTarget(), spellId, true, NULL, aurEff); + GetTarget()->CastSpell(GetTarget(), spellId, true, nullptr, aurEff); } void Register() override @@ -1099,9 +1100,17 @@ class spell_gen_creature_permanent_feign_death : public SpellScriptLoader target->ToCreature()->SetReactState(REACT_PASSIVE); } + void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/) + { + Unit* target = GetTarget(); + target->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + target->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH); + } + void Register() override { OnEffectApply += AuraEffectApplyFn(spell_gen_creature_permanent_feign_death_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); + OnEffectRemove += AuraEffectRemoveFn(spell_gen_creature_permanent_feign_death_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL); } }; @@ -2312,7 +2321,8 @@ class spell_gen_obsidian_armor : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()->GetSpellInfo()) // eventInfo.GetSpellInfo() + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetSpellInfo()) return false; if (GetFirstSchoolInMask(eventInfo.GetSchoolMask()) == SPELL_SCHOOL_NORMAL) @@ -3560,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(); @@ -3569,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 a6f9008955d..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 @@ -237,20 +237,15 @@ class spell_hun_chimera_shot : public SpellScriptLoader { spellId = SPELL_HUNTER_CHIMERA_SHOT_VIPER; - // Amount of one aura tick (C&P from AuraEffect::HandlePeriodicManaLeechAuraTick) - basePoint = aurEff->GetAmount(); - // max value - int32 maxmana = CalculatePct(caster->GetMaxPower(POWER_MANA), basePoint * 2.0f); - ApplyPct(basePoint, caster->GetMaxPower(POWER_MANA)); - if (basePoint > maxmana) - basePoint = maxmana; + // % of mana drained in max duration + basePoint = aurEff->GetAmount() * aurEff->GetTotalTicks(); - basePoint = int32(CalculatePct(unitTarget->GetMaxPower(POWER_MANA), aurEff->GetAmount())); - int32 casterBasePoint = CalculatePct(caster->GetMaxPower(POWER_MANA), aurEff->GetAmount() * 2.0f); - if (basePoint > casterBasePoint) - basePoint = casterBasePoint; + // max value + int32 maxManaReturn = CalculatePct(static_cast<int32>(caster->GetMaxPower(POWER_MANA)), basePoint * 2); + ApplyPct(basePoint, unitTarget->GetMaxPower(POWER_MANA)); + if (basePoint > maxManaReturn) + basePoint = maxManaReturn; - basePoint *= aurEff->GetTotalTicks(); ApplyPct(basePoint, 60); } // Scorpid Sting - Attempts to Disarm the target for 10 sec. This effect cannot occur more than once per 1 minute. @@ -265,8 +260,6 @@ class spell_hun_chimera_shot : public SpellScriptLoader if (spellId) caster->CastCustomSpell(spellId, SPELLVALUE_BASE_POINT0, basePoint, unitTarget, TriggerCastFlags(TRIGGERED_FULL_MASK & ~TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD)); - if (spellId == SPELL_HUNTER_CHIMERA_SHOT_SCORPID && caster->ToPlayer()) // Scorpid Sting - Add 1 minute cooldown - caster->GetSpellHistory()->AddCooldown(spellId, 0, std::chrono::minutes(1)); } } @@ -282,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 { @@ -392,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 @@ -427,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 @@ -621,26 +678,33 @@ class spell_hun_lock_and_load : public SpellScriptLoader { if (eventInfo.GetActor()->HasAura(SPELL_HUNTER_LOCK_AND_LOAD_MARKER)) return false; - return true; } - template <uint32 mask> - void HandleProcs(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + bool CheckTrapProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - PreventDefaultAction(); + if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_TRAP_ACTIVATION)) + return false; - if (!(eventInfo.GetTypeMask() & mask)) - return; + // Do not proc on traps for immolation/explosive trap + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !(damageInfo->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST)) + return false; - // Additional check: do not proc on traps for immolation/explosive trap - // (But still do it for the periodic damage part) - if (mask == PROC_FLAG_DONE_TRAP_ACTIVATION) - if (!(eventInfo.GetDamageInfo()->GetSchoolMask() & SPELL_SCHOOL_MASK_FROST)) - return; + return roll_chance_i(aurEff->GetAmount()); + } - if (!roll_chance_i(aurEff->GetAmount())) - return; + bool CheckPeriodicProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + if (!(eventInfo.GetTypeMask() & PROC_FLAG_DONE_PERIODIC)) + return false; + + return roll_chance_i(aurEff->GetAmount()); + } + + void HandleProc(ProcEventInfo& eventInfo) + { + PreventDefaultAction(); Unit* caster = eventInfo.GetActor(); caster->CastSpell(caster, SPELL_HUNTER_LOCK_AND_LOAD_TRIGGER, true); @@ -651,8 +715,10 @@ class spell_hun_lock_and_load : public SpellScriptLoader { DoCheckProc += AuraCheckProcFn(spell_hun_lock_and_load_AuraScript::CheckProc); - OnEffectProc += AuraEffectProcFn(spell_hun_lock_and_load_AuraScript::HandleProcs<PROC_FLAG_DONE_TRAP_ACTIVATION>, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); - OnEffectProc += AuraEffectProcFn(spell_hun_lock_and_load_AuraScript::HandleProcs<PROC_FLAG_DONE_PERIODIC>, EFFECT_1, SPELL_AURA_DUMMY); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_lock_and_load_AuraScript::CheckTrapProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_lock_and_load_AuraScript::CheckPeriodicProc, EFFECT_1, SPELL_AURA_DUMMY); + + OnProc += AuraProcFn(spell_hun_lock_and_load_AuraScript::HandleProc); } }; @@ -679,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); } @@ -1020,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 }; @@ -1033,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 @@ -1111,9 +1205,16 @@ class spell_hun_roar_of_sacrifice : public SpellScriptLoader return true; } - bool CheckProc(ProcEventInfo& eventInfo) + bool CheckProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { - return GetCaster() && (eventInfo.GetDamageInfo()->GetSchoolMask() & GetEffect(EFFECT_1)->GetMiscValue()) != 0; + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !(damageInfo->GetSchoolMask() & aurEff->GetMiscValue())) + return false; + + if (!GetCaster()) + return false; + + return true; } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) @@ -1126,7 +1227,7 @@ class spell_hun_roar_of_sacrifice : public SpellScriptLoader void Register() override { - DoCheckProc += AuraCheckProcFn(spell_hun_roar_of_sacrifice_AuraScript::CheckProc); + DoCheckEffectProc += AuraCheckEffectProcFn(spell_hun_roar_of_sacrifice_AuraScript::CheckProc, EFFECT_1, SPELL_AURA_DUMMY); OnEffectProc += AuraEffectProcFn(spell_hun_roar_of_sacrifice_AuraScript::HandleProc, EFFECT_1, SPELL_AURA_DUMMY); } }; @@ -1359,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 @@ -1440,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*/) @@ -1467,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 0db0be0ef9c..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 @@ -281,6 +281,38 @@ class spell_item_arcane_shroud : public SpellScriptLoader } }; +// Item - 12846: Argent Dawn Commission +// Item - 13209: Seal of the Dawn +// Item - 19812: Rune of the Dawn + +// 17670 - Argent Dawn Commission +class spell_item_argent_dawn_commission : public SpellScriptLoader +{ + public: + spell_item_argent_dawn_commission() : SpellScriptLoader("spell_item_argent_dawn_commission") { } + + class spell_item_argent_dawn_commission_AuraScript : public AuraScript + { + PrepareAuraScript(spell_item_argent_dawn_commission_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_item_argent_dawn_commission_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_item_argent_dawn_commission_AuraScript(); + } +}; + enum AuraOfMadness { SPELL_SOCIOPATH = 39511, // Sociopath: +35 strength(Paladin, Rogue, Druid, Warrior) @@ -326,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] = { @@ -359,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); @@ -395,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 @@ -458,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 @@ -584,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] = { @@ -616,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 @@ -1051,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 @@ -1096,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); } } @@ -1137,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 @@ -1194,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(); @@ -1211,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; @@ -1218,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 @@ -1348,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); } } @@ -1457,8 +1490,12 @@ class spell_item_necrotic_touch : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 bp = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, NULL, aurEff); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + + int32 bp = CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_ITEM_NECROTIC_TOUCH_PROC, SPELLVALUE_BASE_POINT0, bp, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override @@ -1510,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); } } @@ -1566,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 @@ -1698,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 @@ -1925,6 +1962,8 @@ class spell_item_shadows_fate : public SpellScriptLoader void HandleProc(ProcEventInfo& procInfo) { + PreventDefaultAction(); + Unit* caster = procInfo.GetActor(); Unit* target = GetCaster(); if (!caster || !target) @@ -2168,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 @@ -2206,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 @@ -3703,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 @@ -3849,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(); @@ -3857,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 @@ -4307,6 +4346,119 @@ class spell_item_taunt_flag_targeting : public SpellScriptLoader } }; +// 13180 - Gnomish Mind Control Cap +enum MindControlCap +{ + ROLL_CHANCE_DULLARD = 32, + ROLL_CHANCE_NO_BACKFIRE = 95, + SPELL_GNOMISH_MIND_CONTROL_CAP = 13181, + SPELL_DULLARD = 67809 +}; + +class spell_item_mind_control_cap : public SpellScriptLoader +{ + public: + spell_item_mind_control_cap() : SpellScriptLoader("spell_item_mind_control_cap") { } + + class spell_item_mind_control_cap_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_mind_control_cap_SpellScript); + + bool Load() override + { + if (!GetCastItem()) + return false; + return true; + } + + bool Validate(SpellInfo const* /*spell*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_GNOMISH_MIND_CONTROL_CAP) || !sSpellMgr->GetSpellInfo(SPELL_DULLARD)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /* effIndex */) + { + Unit* caster = GetCaster(); + if (Unit* target = GetHitUnit()) + { + if (roll_chance_i(ROLL_CHANCE_NO_BACKFIRE)) + caster->CastSpell(target, roll_chance_i(ROLL_CHANCE_DULLARD) ? SPELL_DULLARD : SPELL_GNOMISH_MIND_CONTROL_CAP, true, GetCastItem()); + else + target->CastSpell(caster, SPELL_GNOMISH_MIND_CONTROL_CAP, true); // backfire - 5% chance + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_item_mind_control_cap_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_item_mind_control_cap_SpellScript(); + } +}; + +// 8344 - Universal Remote (Gnomish Universal Remote) +enum UniversalRemote +{ + SPELL_CONTROL_MACHINE = 8345, + SPELL_MOBILITY_MALFUNCTION = 8346, + SPELL_TARGET_LOCK = 8347 +}; + +class spell_item_universal_remote : public SpellScriptLoader +{ + public: + spell_item_universal_remote() : SpellScriptLoader("spell_item_universal_remote") { } + + class spell_item_universal_remote_SpellScript : public SpellScript + { + PrepareSpellScript(spell_item_universal_remote_SpellScript); + + bool Load() override + { + if (!GetCastItem()) + return false; + return true; + } + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_CONTROL_MACHINE) || !sSpellMgr->GetSpellInfo(SPELL_MOBILITY_MALFUNCTION) || !sSpellMgr->GetSpellInfo(SPELL_TARGET_LOCK)) + return false; + return true; + } + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* target = GetHitUnit()) + { + uint8 chance = urand(0, 99); + if (chance < 15) + GetCaster()->CastSpell(target, SPELL_TARGET_LOCK, true, GetCastItem()); + else if (chance < 25) + GetCaster()->CastSpell(target, SPELL_MOBILITY_MALFUNCTION, true, GetCastItem()); + else + GetCaster()->CastSpell(target, SPELL_CONTROL_MACHINE, true, GetCastItem()); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_item_universal_remote_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_item_universal_remote_SpellScript(); + } +}; + enum ZandalarianCharms { SPELL_UNSTABLE_POWER_AURA_STACK = 24659, @@ -4386,6 +4538,7 @@ void AddSC_item_spell_scripts() new spell_item_alchemists_stone(); new spell_item_anger_capacitor<8>("spell_item_tiny_abomination_in_a_jar"); new spell_item_anger_capacitor<7>("spell_item_tiny_abomination_in_a_jar_hero"); + new spell_item_argent_dawn_commission(); new spell_item_aura_of_madness(); new spell_item_dementia(); new spell_item_blessing_of_ancient_kings(); @@ -4478,6 +4631,8 @@ void AddSC_item_spell_scripts() new spell_item_charm_witch_doctor(); new spell_item_mana_drain(); new spell_item_taunt_flag_targeting(); + new spell_item_mind_control_cap(); + new spell_item_universal_remote(); new spell_item_zandalarian_charm("spell_item_unstable_power", SPELL_UNSTABLE_POWER_AURA_STACK); new spell_item_zandalarian_charm("spell_item_restless_strength", SPELL_RESTLESS_STRENGTH_AURA_STACK); diff --git a/src/server/scripts/Spells/spell_mage.cpp b/src/server/scripts/Spells/spell_mage.cpp index f60c1f81601..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 @@ -258,17 +258,21 @@ class spell_mage_burnout : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetDamageInfo()->GetSpellInfo() != nullptr; + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetSpellInfo()) + return false; + + return true; } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 mana = int32(eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask())); + int32 mana = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask()); mana = CalculatePct(mana, aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_MAGE_BURNOUT, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_MAGE_BURNOUT, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, nullptr, aurEff); } void Register() override @@ -379,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 @@ -416,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 @@ -832,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 @@ -939,7 +943,7 @@ class spell_mage_ignite : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetProcTarget() != nullptr; + return eventInfo.GetDamageInfo() && eventInfo.GetProcTarget(); } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) @@ -951,7 +955,7 @@ class spell_mage_ignite : public SpellScriptLoader int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), pct) / igniteDot->GetMaxTicks()); amount += eventInfo.GetProcTarget()->GetRemainingPeriodicAmount(eventInfo.GetActor()->GetGUID(), SPELL_MAGE_IGNITE, SPELL_AURA_PERIODIC_DAMAGE); - GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_MAGE_IGNITE, SPELLVALUE_BASE_POINT0, amount, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override @@ -1028,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 @@ -1076,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 @@ -1116,18 +1120,22 @@ class spell_mage_master_of_elements : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetDamageInfo()->GetSpellInfo() != nullptr; + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetSpellInfo()) + return false; + + return true; } void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 mana = int32(eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask())); + int32 mana = eventInfo.GetDamageInfo()->GetSpellInfo()->CalcPowerCost(GetTarget(), eventInfo.GetDamageInfo()->GetSchoolMask()); mana = CalculatePct(mana, aurEff->GetAmount()); if (mana > 0) - GetTarget()->CastCustomSpell(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_MAGE_MASTER_OF_ELEMENTS_ENERGIZE, SPELLVALUE_BASE_POINT0, mana, GetTarget(), 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 a289226f934..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)) @@ -698,9 +705,13 @@ class spell_pal_eye_for_an_eye : public SpellScriptLoader void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return; + // return damage % to attacker but < 50% own total health - int32 damage = int32(std::min(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount()), GetTarget()->GetMaxHealth() / 2)); - GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, NULL, aurEff); + int32 damage = std::min(CalculatePct(static_cast<int32>(damageInfo->GetDamage()), aurEff->GetAmount()), static_cast<int32>(GetTarget()->GetMaxHealth()) / 2); + GetTarget()->CastCustomSpell(SPELL_PALADIN_EYE_FOR_AN_EYE_DAMAGE, SPELLVALUE_BASE_POINT0, damage, eventInfo.GetProcTarget(), true, nullptr, aurEff); } void Register() override @@ -820,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 @@ -972,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 @@ -1299,6 +1310,8 @@ class spell_pal_infusion_of_light : public SpellScriptLoader Unit* target = GetTarget(); int32 duration = sSpellMgr->AssertSpellInfo(SPELL_PALADIN_FLASH_OF_LIGHT_PROC)->GetMaxDuration() / 1000; int32 pct = GetSpellInfo()->Effects[EFFECT_2].CalcValue(); + ASSERT(duration > 0); + int32 bp0 = CalculatePct(healInfo->GetHeal() / duration, pct); // Item - Paladin T9 Holy 4P Bonus @@ -1379,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(); @@ -1405,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 @@ -1536,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 @@ -1580,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 @@ -1649,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 @@ -1776,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 @@ -1890,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 @@ -1984,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 @@ -2086,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(); @@ -2094,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; @@ -2119,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 @@ -2203,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 @@ -2250,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 @@ -2288,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(); @@ -2319,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 @@ -2365,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 d1b8ab2e8df..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 @@ -332,7 +332,7 @@ class spell_pri_divine_aegis : public SpellScriptLoader absorb = std::min(absorb, eventInfo.GetProcTarget()->getLevel() * 125); - GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_PRIEST_DIVINE_AEGIS, SPELLVALUE_BASE_POINT0, absorb, eventInfo.GetProcTarget(), 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 @@ -454,7 +454,7 @@ class spell_pri_glyph_of_prayer_of_healing : public SpellScriptLoader SpellInfo const* triggeredSpellInfo = sSpellMgr->AssertSpellInfo(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL); int32 heal = int32(CalculatePct(healInfo->GetHeal(), aurEff->GetAmount()) / triggeredSpellInfo->GetMaxTicks()); - GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_PRIEST_GLYPH_OF_PRAYER_OF_HEALING_HEAL, SPELLVALUE_BASE_POINT0, heal, eventInfo.GetProcTarget(), 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_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 2eca20199b4..fd99888f8d9 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2565,6 +2565,146 @@ public: } }; +enum ApplyHeatAndStir +{ + SPELL_SPURTS_AND_SMOKE = 38594, + SPELL_FAILED_MIX_1 = 43376, + SPELL_FAILED_MIX_2 = 43378, + SPELL_FAILED_MIX_3 = 43970, + SPELL_SUCCESSFUL_MIX = 43377, + + CREATURE_GENERIC_TRIGGER_LAB = 24042, + + TALK_0 = 0, + TALK_1 = 1 +}; + +class spell_q11306_mixing_blood : public SpellScriptLoader +{ +public: + spell_q11306_mixing_blood() : SpellScriptLoader("spell_q11306_mixing_blood") { } + + class spell_q11306_mixing_blood_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_mixing_blood_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->DoCastSelf(SPELL_SPURTS_AND_SMOKE); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11306_mixing_blood_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_mixing_blood_SpellScript(); + } +}; + +class spell_q11306_mixing_vrykul_blood : public SpellScriptLoader +{ + public: + spell_q11306_mixing_vrykul_blood() : SpellScriptLoader("spell_q11306_mixing_vrykul_blood") { } + + class spell_q11306_mixing_vrykul_blood_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_mixing_vrykul_blood_SpellScript); + + void HandleDummy(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + { + uint8 chance = urand(0, 99); + uint32 spellId = 0; + + // 90% chance of getting one out of three failure effects + if (chance < 30) + spellId = SPELL_FAILED_MIX_1; + else if (chance < 60) + spellId = SPELL_FAILED_MIX_2; + else if (chance < 90) + spellId = SPELL_FAILED_MIX_3; + else // 10% chance of successful cast + spellId = SPELL_SUCCESSFUL_MIX; + + caster->CastSpell(caster, spellId, true); + } + } + + void Register() override + { + OnEffectHitTarget += SpellEffectFn(spell_q11306_mixing_vrykul_blood_SpellScript::HandleDummy, EFFECT_1, SPELL_EFFECT_DUMMY); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_mixing_vrykul_blood_SpellScript(); + } +}; + +class spell_q11306_failed_mix_43376 : public SpellScriptLoader +{ +public: + spell_q11306_failed_mix_43376() : SpellScriptLoader("spell_q11306_failed_mix_43376") { } + + class spell_q11306_failed_mix_43376_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_failed_mix_43376_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->Talk(TALK_0, caster); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43376_SpellScript::HandleEffect, EFFECT_1, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_failed_mix_43376_SpellScript(); + } +}; + +class spell_q11306_failed_mix_43378 : public SpellScriptLoader +{ +public: + spell_q11306_failed_mix_43378() : SpellScriptLoader("spell_q11306_failed_mix_43378") { } + + class spell_q11306_failed_mix_43378_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q11306_failed_mix_43378_SpellScript); + + void HandleEffect(SpellEffIndex /*effIndex*/) + { + if (Unit* caster = GetCaster()) + if (Creature* trigger = caster->FindNearestCreature(CREATURE_GENERIC_TRIGGER_LAB, 100.0f)) + trigger->AI()->Talk(TALK_1, caster); + } + + void Register() override + { + OnEffectHit += SpellEffectFn(spell_q11306_failed_mix_43378_SpellScript::HandleEffect, EFFECT_2, SPELL_EFFECT_SEND_EVENT); + } + }; + + SpellScript* GetSpellScript() const override + { + return new spell_q11306_failed_mix_43378_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2628,4 +2768,8 @@ void AddSC_quest_spell_scripts() new spell_q12414_hand_over_reins(); new spell_q13665_q13790_bested_trigger(); new spell_59064_59439_portals(); + new spell_q11306_mixing_blood(); + new spell_q11306_mixing_vrykul_blood(); + new spell_q11306_failed_mix_43376(); + new spell_q11306_failed_mix_43378(); } diff --git a/src/server/scripts/Spells/spell_rogue.cpp b/src/server/scripts/Spells/spell_rogue.cpp index bd74e9b2e73..f3d30af1f84 100644 --- a/src/server/scripts/Spells/spell_rogue.cpp +++ b/src/server/scripts/Spells/spell_rogue.cpp @@ -83,10 +83,10 @@ class spell_rog_blade_flurry : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - if (eventInfo.GetDamageInfo()) + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) { - int32 damage = eventInfo.GetDamageInfo()->GetDamage(); - GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, NULL, aurEff); + int32 damage = damageInfo->GetDamage(); + GetTarget()->CastCustomSpell(SPELL_ROGUE_BLADE_FLURRY_EXTRA_ATTACK, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, nullptr, aurEff); } } @@ -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 2a568316ad4..37b08aee7ca 100644 --- a/src/server/scripts/Spells/spell_shaman.cpp +++ b/src/server/scripts/Spells/spell_shaman.cpp @@ -83,7 +83,8 @@ enum ShamanSpells SPELL_SHAMAN_LIGHTNING_SHIELD_DAMAGE_R1 = 26364, SPELL_SHAMAN_SHAMANISTIC_RAGE_PROC = 30824, SPELL_SHAMAN_MAELSTROM_POWER = 70831, - SPELL_SHAMAN_T10_ENHANCEMENT_4P_BONUS = 70832 + SPELL_SHAMAN_T10_ENHANCEMENT_4P_BONUS = 70832, + SPELL_SHAMAN_BLESSING_OF_THE_ETERNALS_R1 = 51554 }; enum ShamanSpellIcons @@ -118,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 @@ -422,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 @@ -537,6 +538,46 @@ class spell_sha_earthen_power : public SpellScriptLoader } }; +// -51940 - Earthliving Weapon (Passive) +class spell_sha_earthliving_weapon : public SpellScriptLoader +{ + public: + spell_sha_earthliving_weapon() : SpellScriptLoader("spell_sha_earthliving_weapon") { } + + class spell_sha_earthliving_weapon_AuraScript : public AuraScript + { + PrepareAuraScript(spell_sha_earthliving_weapon_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_SHAMAN_BLESSING_OF_THE_ETERNALS_R1)) + return false; + return true; + } + + bool CheckProc(ProcEventInfo& eventInfo) + { + int32 chance = 20; + Unit* caster = eventInfo.GetActor(); + if (AuraEffect const* aurEff = caster->GetAuraEffectOfRankedSpell(SPELL_SHAMAN_BLESSING_OF_THE_ETERNALS_R1, EFFECT_1, caster->GetGUID())) + if (eventInfo.GetProcTarget()->HasAuraState(AURA_STATE_HEALTHLESS_35_PERCENT)) + chance += aurEff->GetAmount(); + + return roll_chance_i(chance); + } + + void Register() override + { + DoCheckProc += AuraCheckProcFn(spell_sha_earthliving_weapon_AuraScript::CheckProc); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_sha_earthliving_weapon_AuraScript(); + } +}; + // -1535 - Fire Nova class spell_sha_fire_nova : public SpellScriptLoader { @@ -691,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 @@ -757,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 @@ -840,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 @@ -900,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 @@ -956,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()); } } } @@ -1003,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); } }; @@ -1050,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 @@ -1094,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(); @@ -1120,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 @@ -1155,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 @@ -1190,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 @@ -1222,11 +1263,6 @@ class spell_sha_item_mana_surge : public SpellScriptLoader return true; } - bool CheckProc(ProcEventInfo& eventInfo) - { - return eventInfo.GetDamageInfo()->GetSpellInfo() != nullptr; - } - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); @@ -1237,12 +1273,11 @@ class spell_sha_item_mana_surge : public SpellScriptLoader int32 mana = spellInfo->CalcPowerCost(GetTarget(), eventInfo.GetSchoolMask()); int32 damage = CalculatePct(mana, 35); - GetTarget()->CastCustomSpell(SPELL_SHAMAN_ITEM_MANA_SURGE, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_SHAMAN_ITEM_MANA_SURGE, SPELLVALUE_BASE_POINT0, damage, GetTarget(), true, nullptr, aurEff); } void Register() override { - DoCheckProc += AuraCheckProcFn(spell_sha_item_mana_surge_AuraScript::CheckProc); OnEffectProc += AuraEffectProcFn(spell_sha_item_mana_surge_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL); } }; @@ -1271,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(); @@ -1303,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 @@ -1472,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 @@ -1558,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()); } } } @@ -1597,7 +1632,7 @@ public: { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) + if (!damageInfo || !damageInfo->GetDamage()) return; int32 healthpct = aurEff->GetSpellInfo()->Effects[EFFECT_1].CalcValue(); // %s2 - the 30% threshold for health @@ -1606,7 +1641,6 @@ public: { if (target->HealthBelowPctDamaged(healthpct, damageInfo->GetDamage())) { - uint32 bp = CalculatePct(target->GetMaxHealth(), aurEff->GetAmount()); target->CastCustomSpell(SPELL_SHAMAN_NATURE_GUARDIAN, SPELLVALUE_BASE_POINT0, bp, target, true, nullptr, aurEff); @@ -1743,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 @@ -1776,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 @@ -1885,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(); } @@ -1928,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(); @@ -1959,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 @@ -2003,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 @@ -2052,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 @@ -2151,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 @@ -2187,7 +2221,6 @@ class spell_sha_windfury_weapon : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - Player* player = eventInfo.GetActor()->ToPlayer(); if (!player) return false; @@ -2207,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(); @@ -2247,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 @@ -2275,6 +2308,7 @@ void AddSC_shaman_spell_scripts() new spell_sha_earth_shield(); new spell_sha_earthbind_totem(); new spell_sha_earthen_power(); + new spell_sha_earthliving_weapon(); new spell_sha_fire_nova(); new spell_sha_flame_shock(); new spell_sha_flametongue_weapon(); diff --git a/src/server/scripts/Spells/spell_warlock.cpp b/src/server/scripts/Spells/spell_warlock.cpp index 0c1d6647f34..1a8252ad7ec 100644 --- a/src/server/scripts/Spells/spell_warlock.cpp +++ b/src/server/scripts/Spells/spell_warlock.cpp @@ -74,6 +74,7 @@ enum WarlockSpells SPELL_WARLOCK_SHADOWFLAME = 37378, SPELL_WARLOCK_FLAMESHADOW = 37379, SPELL_WARLOCK_GLYPH_OF_SUCCUBUS = 56250, + SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_R1 = 18213, SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC = 18371 }; @@ -449,6 +450,50 @@ class spell_warl_demonic_empowerment : public SpellScriptLoader } }; +// -1120 - Drain Soul +class spell_warl_drain_soul : public SpellScriptLoader +{ + public: + spell_warl_drain_soul() : SpellScriptLoader("spell_warl_drain_soul") { } + + class spell_warl_drain_soul_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warl_drain_soul_AuraScript); + + bool Validate(SpellInfo const* /*spellInfo*/) override + { + if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_R1) || + !sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC)) + return false; + return true; + } + + void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) + { + PreventDefaultAction(); + + Unit* caster = eventInfo.GetActor(); + // Improved Drain Soul + Aura const* impDrainSoul = caster->GetAuraOfRankedSpell(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_R1, caster->GetGUID()); + if (!impDrainSoul) + return; + + int32 amount = CalculatePct(caster->GetMaxPower(POWER_MANA), impDrainSoul->GetSpellInfo()->Effects[EFFECT_2].CalcValue()); + caster->CastCustomSpell(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC, SPELLVALUE_BASE_POINT0, amount, (Unit*)nullptr, true, nullptr, aurEff); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warl_drain_soul_AuraScript::HandleProc, EFFECT_2, SPELL_AURA_PROC_TRIGGER_SPELL); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warl_drain_soul_AuraScript(); + } +}; + // 47422 - Everlasting Affliction class spell_warl_everlasting_affliction : public SpellScriptLoader { @@ -505,15 +550,19 @@ class spell_warl_fel_synergy : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return GetTarget()->GetGuardianPet() && eventInfo.GetDamageInfo()->GetDamage(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + return GetTarget()->GetGuardianPet() != nullptr; } void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 heal = CalculatePct(int32(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)NULL, true, NULL, aurEff); // TARGET_UNIT_PET + int32 heal = CalculatePct(static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); + GetTarget()->CastCustomSpell(SPELL_WARLOCK_FEL_SYNERGY_HEAL, SPELLVALUE_BASE_POINT0, heal, (Unit*)nullptr, true, nullptr, aurEff); // TARGET_UNIT_PET } void Register() override @@ -547,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 @@ -583,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 @@ -740,44 +789,6 @@ class spell_warl_health_funnel : public SpellScriptLoader } }; -// -18213 - Improved Drain Soul -class spell_warl_improved_drain_soul : public SpellScriptLoader -{ - public: - spell_warl_improved_drain_soul() : SpellScriptLoader("spell_warl_improved_drain_soul") { } - - class spell_warl_improved_drain_soul_AuraScript : public AuraScript - { - PrepareAuraScript(spell_warl_improved_drain_soul_AuraScript); - - bool Validate(SpellInfo const* /*spellInfo*/) override - { - if (!sSpellMgr->GetSpellInfo(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC)) - return false; - return true; - } - - void HandleProc(AuraEffect const* aurEff, ProcEventInfo& /*eventInfo*/) - { - PreventDefaultAction(); - - Unit* target = GetTarget(); - int32 bp0 = CalculatePct(target->GetMaxPower(POWER_MANA), GetSpellInfo()->Effects[EFFECT_2].BasePoints); - target->CastCustomSpell(SPELL_WARLOCK_IMPROVED_DRAIN_SOUL_PROC, SPELLVALUE_BASE_POINT0, bp0, target, true, nullptr, aurEff); - } - - void Register() override - { - OnEffectProc += AuraEffectProcFn(spell_warl_improved_drain_soul_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_DUMMY); - } - }; - - AuraScript* GetAuraScript() const override - { - return new spell_warl_improved_drain_soul_AuraScript(); - } -}; - // -1454 - Life Tap class spell_warl_life_tap : public SpellScriptLoader { @@ -874,9 +885,9 @@ public: bool CheckProc(ProcEventInfo& eventInfo) { - if (eventInfo.GetDamageInfo()) + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) { - switch (GetFirstSchoolInMask(eventInfo.GetDamageInfo()->GetSchoolMask())) + switch (GetFirstSchoolInMask(damageInfo->GetSchoolMask())) { case SPELL_SCHOOL_HOLY: case SPELL_SCHOOL_FIRE: @@ -1106,7 +1117,7 @@ class spell_warl_seed_of_corruption_dummy : public SpellScriptLoader { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) + if (!damageInfo || !damageInfo->GetDamage()) return; int32 amount = aurEff->GetAmount() - damageInfo->GetDamage(); @@ -1124,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 @@ -1166,7 +1177,7 @@ class spell_warl_seed_of_corruption_generic : public SpellScriptLoader { PreventDefaultAction(); DamageInfo* damageInfo = eventInfo.GetDamageInfo(); - if (!damageInfo) + if (!damageInfo || !damageInfo->GetDamage()) return; int32 amount = aurEff->GetAmount() - damageInfo->GetDamage(); @@ -1182,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 @@ -1255,19 +1266,23 @@ class spell_warl_siphon_life : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetDamageInfo()->GetDamage() && GetTarget()->IsAlive(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo || !damageInfo->GetDamage()) + return false; + + return GetTarget()->IsAlive(); } void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - int32 amount = int32(CalculatePct(eventInfo.GetDamageInfo()->GetDamage(), aurEff->GetAmount())); + int32 amount = CalculatePct(static_cast<int32>(eventInfo.GetDamageInfo()->GetDamage()), aurEff->GetAmount()); // Glyph of Siphon Life if (AuraEffect const* glyph = GetTarget()->GetAuraEffect(SPELL_WARLOCK_GLYPH_OF_SIPHON_LIFE, EFFECT_0)) AddPct(amount, glyph->GetAmount()); - GetTarget()->CastCustomSpell(SPELL_WARLOCK_SIPHON_LIFE_HEAL, SPELLVALUE_BASE_POINT0, amount, GetTarget(), true, NULL, aurEff); + GetTarget()->CastCustomSpell(SPELL_WARLOCK_SIPHON_LIFE_HEAL, SPELLVALUE_BASE_POINT0, amount, GetTarget(), true, nullptr, aurEff); } void Register() override @@ -1329,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 @@ -1407,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 @@ -1476,6 +1491,7 @@ void AddSC_warlock_spell_scripts() new spell_warl_demonic_circle_teleport(); new spell_warl_demonic_empowerment(); new spell_warl_demonic_pact(); + new spell_warl_drain_soul(); new spell_warl_everlasting_affliction(); new spell_warl_fel_synergy(); new spell_warl_glyph_of_life_tap(); @@ -1483,7 +1499,6 @@ void AddSC_warlock_spell_scripts() new spell_warl_haunt(); new spell_warl_health_funnel(); new spell_warl_glyph_of_corruption_nightfall(); - new spell_warl_improved_drain_soul(); new spell_warl_life_tap(); new spell_warl_nether_protection(); new spell_warl_ritual_of_doom_effect(); diff --git a/src/server/scripts/Spells/spell_warrior.cpp b/src/server/scripts/Spells/spell_warrior.cpp index 2b6b6facc33..81fb4ec2457 100644 --- a/src/server/scripts/Spells/spell_warrior.cpp +++ b/src/server/scripts/Spells/spell_warrior.cpp @@ -326,7 +326,11 @@ class spell_warr_deep_wounds_aura : public SpellScriptLoader bool CheckProc(ProcEventInfo& eventInfo) { - return eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER && eventInfo.GetDamageInfo(); + DamageInfo* damageInfo = eventInfo.GetDamageInfo(); + if (!damageInfo) + return false; + + return eventInfo.GetActor()->GetTypeId() == TYPEID_PLAYER; } void OnProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) @@ -482,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 @@ -558,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 @@ -828,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 @@ -950,18 +954,18 @@ class spell_warr_sweeping_strikes : public SpellScriptLoader void HandleProc(AuraEffect const* aurEff, ProcEventInfo& eventInfo) { PreventDefaultAction(); - if (eventInfo.GetDamageInfo()) + if (DamageInfo* damageInfo = eventInfo.GetDamageInfo()) { - SpellInfo const* spellInfo = eventInfo.GetDamageInfo()->GetSpellInfo(); + SpellInfo const* spellInfo = damageInfo->GetSpellInfo(); if (spellInfo && (spellInfo->Id == SPELL_WARRIOR_BLADESTORM_PERIODIC_WHIRLWIND || (spellInfo->Id == SPELL_WARRIOR_EXECUTE && !_procTarget->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT)))) { // If triggered by Execute (while target is not under 20% hp) or Bladestorm deals normalized weapon damage - GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2, true, NULL, aurEff); + GetTarget()->CastSpell(_procTarget, SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_2, true, nullptr, aurEff); } else { - int32 damage = eventInfo.GetDamageInfo()->GetDamage(); - GetTarget()->CastCustomSpell(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, NULL, aurEff); + int32 damage = damageInfo->GetDamage(); + GetTarget()->CastCustomSpell(SPELL_WARRIOR_SWEEPING_STRIKES_EXTRA_ATTACK_1, SPELLVALUE_BASE_POINT0, damage, _procTarget, true, nullptr, aurEff); } } } @@ -1049,6 +1053,34 @@ class spell_warr_t3_prot_8p_bonus : public SpellScriptLoader } }; +// 32216 - Victorious +class spell_warr_victorious : public SpellScriptLoader +{ + public: + spell_warr_victorious() : SpellScriptLoader("spell_warr_victorious") { } + + class spell_warr_victorious_AuraScript : public AuraScript + { + PrepareAuraScript(spell_warr_victorious_AuraScript); + + void HandleDummy(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/) + { + // Prevent console log + PreventDefaultAction(); + } + + void Register() override + { + OnEffectProc += AuraEffectProcFn(spell_warr_victorious_AuraScript::HandleDummy, EFFECT_0, SPELL_AURA_DUMMY); + } + }; + + AuraScript* GetAuraScript() const override + { + return new spell_warr_victorious_AuraScript(); + } +}; + // 50720 - Vigilance class spell_warr_vigilance : public SpellScriptLoader { @@ -1201,6 +1233,7 @@ void AddSC_warrior_spell_scripts() new spell_warr_sweeping_strikes(); new spell_warr_sword_and_board(); new spell_warr_t3_prot_8p_bonus(); + new spell_warr_victorious(); new spell_warr_vigilance(); new spell_warr_vigilance_trigger(); } diff --git a/src/server/scripts/World/go_scripts.cpp b/src/server/scripts/World/go_scripts.cpp index 75e5e63c2c0..91166294355 100644 --- a/src/server/scripts/World/go_scripts.cpp +++ b/src/server/scripts/World/go_scripts.cpp @@ -1316,6 +1316,9 @@ public: struct go_brewfest_musicAI : public GameObjectAI { + uint32 rnd = 0; + uint32 musicTime = 1000; + go_brewfest_musicAI(GameObject* go) : GameObjectAI(go) { _events.ScheduleEvent(EVENT_BM_SELECT_MUSIC, 1000); @@ -1325,8 +1328,6 @@ public: void UpdateAI(uint32 diff) override { _events.Update(diff); - uint32 rnd; - uint32 musicTime = 1000; while (uint32 eventId = _events.ExecuteEvent()) { switch (eventId) @@ -1394,6 +1395,180 @@ public: } }; +/*#### +## go_midsummer_music +####*/ + +enum MidsummerMusic +{ + EVENTMIDSUMMERFIREFESTIVAL_A = 12319, // 1.08 min + EVENTMIDSUMMERFIREFESTIVAL_H = 12325, // 1.12 min +}; + +enum MidsummerMusicEvents +{ + EVENT_MM_START_MUSIC = 1 +}; + +class go_midsummer_music : public GameObjectScript +{ +public: + go_midsummer_music() : GameObjectScript("go_midsummer_music") { } + + struct go_midsummer_musicAI : public GameObjectAI + { + go_midsummer_musicAI(GameObject* go) : GameObjectAI(go) + { + _events.ScheduleEvent(EVENT_MM_START_MUSIC, 1000); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_MM_START_MUSIC: + { + if (!IsHolidayActive(HOLIDAY_FIRE_FESTIVAL)) + break; + + std::vector<Player*> playersNearby; + go->GetPlayerListInGrid(playersNearby, go->GetMap()->GetVisibilityRange()); + for (Player* player : playersNearby) + { + if (player->GetTeamId() == TEAM_HORDE) + go->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_H, player); + else + go->PlayDirectMusic(EVENTMIDSUMMERFIREFESTIVAL_A, player); + } + _events.ScheduleEvent(EVENT_MM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value) + break; + } + default: + break; + } + } + } + private: + EventMap _events; + }; + + GameObjectAI* GetAI(GameObject* go) const override + { + return new go_midsummer_musicAI(go); + } +}; + +/*#### +## go_darkmoon_faire_music +####*/ + +enum DarkmoonFaireMusic +{ + MUSIC_DARKMOON_FAIRE_MUSIC = 8440 +}; + +enum DarkmoonFaireMusicEvents +{ + EVENT_DFM_START_MUSIC = 1 +}; + +class go_darkmoon_faire_music : public GameObjectScript +{ +public: + go_darkmoon_faire_music() : GameObjectScript("go_darkmoon_faire_music") { } + + struct go_darkmoon_faire_musicAI : public GameObjectAI + { + go_darkmoon_faire_musicAI(GameObject* go) : GameObjectAI(go) + { + _events.ScheduleEvent(EVENT_DFM_START_MUSIC, 1000); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_DFM_START_MUSIC: + if (!IsHolidayActive(HOLIDAY_DARKMOON_FAIRE_ELWYNN) || !IsHolidayActive(HOLIDAY_DARKMOON_FAIRE_THUNDER) || !IsHolidayActive(HOLIDAY_DARKMOON_FAIRE_SHATTRATH)) + break; + go->PlayDirectMusic(MUSIC_DARKMOON_FAIRE_MUSIC); + _events.ScheduleEvent(EVENT_DFM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value) + break; + default: + break; + } + } + } + private: + EventMap _events; + }; + + GameObjectAI* GetAI(GameObject* go) const override + { + return new go_darkmoon_faire_musicAI(go); + } +}; + +/*#### +## go_pirate_day_music +####*/ + +enum PirateDayMusic +{ + MUSIC_PIRATE_DAY_MUSIC = 12845 +}; + +enum PirateDayMusicEvents +{ + EVENT_PDM_START_MUSIC = 1 +}; + +class go_pirate_day_music : public GameObjectScript +{ +public: + go_pirate_day_music() : GameObjectScript("go_pirate_day_music") { } + + struct go_pirate_day_musicAI : public GameObjectAI + { + go_pirate_day_musicAI(GameObject* go) : GameObjectAI(go) + { + _events.ScheduleEvent(EVENT_PDM_START_MUSIC, 1000); + } + + void UpdateAI(uint32 diff) override + { + _events.Update(diff); + while (uint32 eventId = _events.ExecuteEvent()) + { + switch (eventId) + { + case EVENT_PDM_START_MUSIC: + if (!IsHolidayActive(HOLIDAY_PIRATES_DAY)) + break; + go->PlayDirectMusic(MUSIC_PIRATE_DAY_MUSIC); + _events.ScheduleEvent(EVENT_PDM_START_MUSIC, 5000); // Every 5 second's SMSG_PLAY_MUSIC packet (PlayDirectMusic) is pushed to the client (sniffed value) + break; + default: + break; + } + } + } + private: + EventMap _events; + }; + + GameObjectAI* GetAI(GameObject* go) const override + { + return new go_pirate_day_musicAI(go); + } +}; + void AddSC_go_scripts() { new go_cat_figurine(); @@ -1432,4 +1607,7 @@ void AddSC_go_scripts() new go_midsummer_ribbon_pole(); new go_toy_train_set(); new go_brewfest_music(); + new go_midsummer_music(); + new go_darkmoon_faire_music(); + new go_pirate_day_music(); } diff --git a/src/server/shared/Dynamic/LinkedList.h b/src/server/shared/Dynamic/LinkedList.h index 94f67cac909..1c99144db0e 100644 --- a/src/server/shared/Dynamic/LinkedList.h +++ b/src/server/shared/Dynamic/LinkedList.h @@ -32,18 +32,18 @@ class LinkedListElement LinkedListElement* iNext; LinkedListElement* iPrev; + public: - LinkedListElement() : iNext(NULL), iPrev(NULL) { } - virtual ~LinkedListElement() { delink(); } + LinkedListElement() : iNext(nullptr), iPrev(nullptr) { } - bool hasNext() const { return(iNext && iNext->iNext != NULL); } - bool hasPrev() const { return(iPrev && iPrev->iPrev != NULL); } - bool isInList() const { return(iNext != NULL && iPrev != NULL); } + bool hasNext() const { return (iNext && iNext->iNext != nullptr); } + bool hasPrev() const { return (iPrev && iPrev->iPrev != nullptr); } + bool isInList() const { return (iNext != nullptr && iPrev != nullptr); } - LinkedListElement * next() { return hasNext() ? iNext : NULL; } - LinkedListElement const* next() const { return hasNext() ? iNext : NULL; } - LinkedListElement * prev() { return hasPrev() ? iPrev : NULL; } - LinkedListElement const* prev() const { return hasPrev() ? iPrev : NULL; } + LinkedListElement * next() { return hasNext() ? iNext : nullptr; } + LinkedListElement const* next() const { return hasNext() ? iNext : nullptr; } + LinkedListElement * prev() { return hasPrev() ? iPrev : nullptr; } + LinkedListElement const* prev() const { return hasPrev() ? iPrev : nullptr; } LinkedListElement * nocheck_next() { return iNext; } LinkedListElement const* nocheck_next() const { return iNext; } @@ -52,10 +52,13 @@ class LinkedListElement void delink() { - if (isInList()) - { - iNext->iPrev = iPrev; iPrev->iNext = iNext; iNext = NULL; iPrev = NULL; - } + if (!isInList()) + return; + + iNext->iPrev = iPrev; + iPrev->iNext = iNext; + iNext = nullptr; + iPrev = nullptr; } void insertBefore(LinkedListElement* pElem) @@ -75,8 +78,14 @@ class LinkedListElement } private: - LinkedListElement(LinkedListElement const&); - LinkedListElement& operator=(LinkedListElement const&); + LinkedListElement(LinkedListElement const&) = delete; + LinkedListElement& operator=(LinkedListElement const&) = delete; + + protected: + ~LinkedListElement() + { + delink(); + } }; //============================================ @@ -97,15 +106,13 @@ class LinkedListHead iLast.iPrev = &iFirst; } - virtual ~LinkedListHead() { } - bool isEmpty() const { return(!iFirst.iNext->isInList()); } - LinkedListElement * getFirst() { return(isEmpty() ? NULL : iFirst.iNext); } - LinkedListElement const* getFirst() const { return(isEmpty() ? NULL : iFirst.iNext); } + LinkedListElement * getFirst() { return (isEmpty() ? nullptr : iFirst.iNext); } + LinkedListElement const* getFirst() const { return (isEmpty() ? nullptr : iFirst.iNext); } - LinkedListElement * getLast() { return(isEmpty() ? NULL : iLast.iPrev); } - LinkedListElement const* getLast() const { return(isEmpty() ? NULL : iLast.iPrev); } + LinkedListElement * getLast() { return(isEmpty() ? nullptr : iLast.iPrev); } + LinkedListElement const* getLast() const { return(isEmpty() ? nullptr : iLast.iPrev); } void insertFirst(LinkedListElement* pElem) { @@ -248,8 +255,11 @@ class LinkedListHead typedef Iterator<LinkedListElement> iterator; private: - LinkedListHead(LinkedListHead const&); - LinkedListHead& operator=(LinkedListHead const&); + LinkedListHead(LinkedListHead const&) = delete; + LinkedListHead& operator=(LinkedListHead const&) = delete; + + protected: + ~LinkedListHead() { } }; //============================================ diff --git a/src/server/shared/Dynamic/LinkedReference/RefManager.h b/src/server/shared/Dynamic/LinkedReference/RefManager.h index 9dbab4f338e..3c716e3c6b7 100644 --- a/src/server/shared/Dynamic/LinkedReference/RefManager.h +++ b/src/server/shared/Dynamic/LinkedReference/RefManager.h @@ -23,31 +23,29 @@ #include "Dynamic/LinkedList.h" #include "Dynamic/LinkedReference/Reference.h" -template <class TO, class FROM> class RefManager : public LinkedListHead +template <class TO, class FROM> +class RefManager : public LinkedListHead { public: - typedef LinkedListHead::Iterator< Reference<TO, FROM> > iterator; + typedef LinkedListHead::Iterator<Reference<TO, FROM>> iterator; RefManager() { } - virtual ~RefManager() { clearReferences(); } - Reference<TO, FROM>* getFirst() { return ((Reference<TO, FROM>*) LinkedListHead::getFirst()); } - Reference<TO, FROM> const* getFirst() const { return ((Reference<TO, FROM> const*) LinkedListHead::getFirst()); } - Reference<TO, FROM>* getLast() { return ((Reference<TO, FROM>*) LinkedListHead::getLast()); } - Reference<TO, FROM> const* getLast() const { return ((Reference<TO, FROM> const*) LinkedListHead::getLast()); } + Reference<TO, FROM>* getFirst() { return static_cast<Reference<TO, FROM>*>(LinkedListHead::getFirst()); } + + Reference<TO, FROM> const* getFirst() const { return static_cast<Reference<TO, FROM> const*>(LinkedListHead::getFirst()); } iterator begin() { return iterator(getFirst()); } - iterator end() { return iterator(NULL); } - iterator rbegin() { return iterator(getLast()); } - iterator rend() { return iterator(NULL); } + iterator end() { return iterator(nullptr); } + + virtual ~RefManager() + { + clearReferences(); + } void clearReferences() { - LinkedListElement* ref; - while ((ref = getFirst()) != NULL) - { - ((Reference<TO, FROM>*) ref)->invalidate(); - ref->delink(); // the delink might be already done by invalidate(), but doing it here again does not hurt and insures an empty list - } + while (Reference<TO, FROM>* ref = getFirst()) + ref->invalidate(); } }; diff --git a/src/server/shared/Dynamic/LinkedReference/Reference.h b/src/server/shared/Dynamic/LinkedReference/Reference.h index 4a473b0f2ac..0dcf91fb052 100644 --- a/src/server/shared/Dynamic/LinkedReference/Reference.h +++ b/src/server/shared/Dynamic/LinkedReference/Reference.h @@ -29,6 +29,7 @@ template <class TO, class FROM> class Reference : public LinkedListElement private: TO* iRefTo; FROM* iRefFrom; + protected: // Tell our refTo (target) object that we have a link virtual void targetObjectBuildLink() = 0; @@ -90,14 +91,14 @@ template <class TO, class FROM> class Reference : public LinkedListElement Reference<TO, FROM> * nocheck_prev() { return((Reference<TO, FROM> *) LinkedListElement::nocheck_prev()); } Reference<TO, FROM> const* nocheck_prev() const { return((Reference<TO, FROM> const*) LinkedListElement::nocheck_prev()); } - TO* operator ->() const { return iRefTo; } + TO* operator->() const { return iRefTo; } TO* getTarget() const { return iRefTo; } FROM* GetSource() const { return iRefFrom; } private: - Reference(Reference const&); - Reference& operator=(Reference const&); + Reference(Reference const&) = delete; + Reference& operator=(Reference const&) = delete; }; //===================================================== diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist index fab4cf54a9a..1d173057e6f 100644 --- a/src/server/worldserver/worldserver.conf.dist +++ b/src/server/worldserver/worldserver.conf.dist @@ -3070,6 +3070,15 @@ PreventRenameCharacterOnCustomization = 0 ################################################################################################### # AUCTION HOUSE BOT SETTINGS # +# AuctionHouseBot.Account +# Description: Account ID for AHBot characters. If non-zero, all auctions and bids associated +# with the AHBot will randomly be assigned one of this account's characters. +# Default: 0 +# + +AuctionHouseBot.Account = 0 + +# # AuctionHouseBot.Update.Interval # Description: Interval in seconds for AHBot to get updated # Default: 20 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 |
