diff options
| -rw-r--r-- | INSTALL.linux | 95 | ||||
| -rw-r--r-- | README | 9 | ||||
| -rw-r--r-- | contrib/vmap_extractor_v2/vmapextract/wmo.h | 118 | ||||
| -rw-r--r-- | sql/updates/54_world.sql | 5 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp | 192 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp | 82 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp | 644 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp | 2 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp | 282 | ||||
| -rw-r--r-- | src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h | 4 | ||||
| -rw-r--r-- | src/game/ObjectMgr.cpp | 24 | ||||
| -rw-r--r-- | src/game/Spell.cpp | 2 | ||||
| -rw-r--r-- | src/game/SpellAuras.cpp | 15 | ||||
| -rw-r--r-- | src/game/SpellMgr.cpp | 2 |
14 files changed, 745 insertions, 731 deletions
diff --git a/INSTALL.linux b/INSTALL.linux index 0dfd2596d04..143121af043 100644 --- a/INSTALL.linux +++ b/INSTALL.linux @@ -2,60 +2,61 @@ Copyright (C) Trinity Core (http://www.trinitycore.org) +CHECK http://www.trinitycore.info/w/Linux_Build_HOWTO FOR FURTHER HELP + Installing Trinity Core is fairly simple on a Linux machine, assuming you have all required applications The most important ones are: - * make - * automake - * autoconf - * gcc - -After that, you can simply run these commands: - - * autoreconf --install --force - * ./configure - -The configure script will tell you if you miss any libraries, and -if so, which ones. You can then download them from your preferred -package provider (apt-get, emerge, yum, and the alikes). - -When you have all required packages, be sure to properly configure -your build of Trinity Core: - - * ./configure --help - -That command will tell you which config options are available. For -the most part, the following should be used: - - * --enable-cli - * --enable-ra - * --with-mysql - * --prefix=/home/trinitycore - * --datadir=/home/trinitycore/dat - * --sysconfdir=/home/trinitycore/etc - -Of course, replace the paths in prefix, datadir, and sysconfdir -with the directories you wish to install Trinity Core to. The -datadir is where maps, DBCs, and SQLs are stored. The sysconfdir + g++ + gcc + make + cmake version 2.6.x or greater + libmysql++-dev + subversion (for checking out Trinity Database) + mercurial (for checking out the core) + openssl + libssl-dev + zlib1g-dev + libtool + libmysqlclient15-dev + patch + build-essential + mysql-client + +Most of these are included on common Linux distros, others you may have to install by your self. +Please check your distro's repos. + +Make a directory to build in, you can call it anything you want like build or bin etc, then go into +the directory and cmake and make. E.G. you created a dir named build ad want to have your final + compiled product installed in /home/trinity/server, an example sequence of commands can be : + + cmake ../ -DPREFIX=/home/trinity/server + make + make install + +Thats just about all thats needed. You can however tweak more settings than where to install using flags built into our cmake files. Just open up CMakeLists.txt in the main folder and take a look at some of the flags like + + DO_MYSQL --mysql database support (enabled or disabled by a 1 or 0, enabled by default) + DO_POSTGRESQL --postgresql database support (enabled or disabled by a 1 or 0) + DO_SCRIPTS --enable or disable trinity script (enabled or disabled by a 1 or 0, enabled by default) + DO_RA --remote administration (enabled or disabled by a 1 or 0) + DO_DEBUG --enable debugging (enabled or disabled by a 1 or 0) + DO_CLI --enable command line support (enabled or disabled by a 1 or 0, enabled by default) + LARGE_CELL --enable large cells (enabled or disabled by a 1 or 0, disabled by default, enabling can cause CPU spikes) + SHORT_SLEEP --changes sleep time from 100ms to 50ms + PREFIX --prefix directory for install (see example for use) + CONF_DIR --location for your trinity config files + CMAKE_C_FLAGS --advanced users only + CMAKE_CXX_FLAGS --advanced users only + + +Of course, replace the paths in prefix, conf_dir with the directories you wish to install +Trinity Core to. The datadir is where maps, DBCs, and SQLs are stored. The sysconfdir is where configuration files are stored. -When you're ready to execute your configuration, do: - - * mkdir build - * cd build - * ../configure --options --go --here - -When you've configured your build, simply run: - - * make - -And finally, to install Trinity Core: - - * make install - -Done! Trinity Core should now be installed. Now you will need to +Once Trinity Core is installed you will need to apply database updates where necessary. Furthermore, you must configure your installation by editing the config files in the sysconfdir. @@ -40,11 +40,4 @@ SQL files to create the database can be found in the sql directory. Files to update your database from an older revision/version can be found in the sql/updates directory. -See the INSTALL file for installation instructions under Linux. - -If you are using the SVN (unstable) version of Trinity Core, run this -command prior to building: - -autoreconf --install --force - -You can then continue to build the source.
\ No newline at end of file +See the INSTALL.Linux file for installation instructions under Linux.
\ No newline at end of file diff --git a/contrib/vmap_extractor_v2/vmapextract/wmo.h b/contrib/vmap_extractor_v2/vmapextract/wmo.h index c3bb4ce3ae5..c59ef552a07 100644 --- a/contrib/vmap_extractor_v2/vmapextract/wmo.h +++ b/contrib/vmap_extractor_v2/vmapextract/wmo.h @@ -22,86 +22,86 @@ typedef unsigned int uint32; class WMORoot { public: - int nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootID; - unsigned int col; - int bbcorn1[3]; - int bbcorn2[3]; - - WMORoot(std::string &filename); - ~WMORoot(); - - bool open(); - bool ConvertToVMAPRootWmo(FILE *output); + int nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootID; + unsigned int col; + int bbcorn1[3]; + int bbcorn2[3]; + + WMORoot(std::string &filename); + ~WMORoot(); + + bool open(); + bool ConvertToVMAPRootWmo(FILE *output); private: - std::string filename; - char outfilename; + std::string filename; + char outfilename; }; class WMOGroup { public: - - int offsize,flag,flag1,Xid,Xid2,Xid3,zero1,Xflag,nTexture,GroupID; - int mopy_size,moba_size,hlq_xverts,hlq_yverts; - int MopyEx_size,IndexExTr_size,LiquEx_size; - unsigned int nVertices; // number when loaded - int nTriangles; // number when loaded - int bbcorn1[3]; - int bbcorn2[3]; - int * IndexExTr; - char* MOPY; - char* MopyEx; - uint16* MOVI; - uint16* MoviEx; - uint16* MoviExSort; - float* MOVT; - float* MovtEx; - uint16* MovtExSort; - float* MONR; - float* MonrEx; - uint16* MOBA; - int* MobaEx; - float* LiquEx; - uint32 liquflags; - - WMOGroup(std::string &filename); - ~WMOGroup(); - - bool open(); - int ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData); + + int offsize,flag,flag1,Xid,Xid2,Xid3,zero1,Xflag,nTexture,GroupID; + int mopy_size,moba_size,hlq_xverts,hlq_yverts; + int MopyEx_size,IndexExTr_size,LiquEx_size; + unsigned int nVertices; // number when loaded + int nTriangles; // number when loaded + int bbcorn1[3]; + int bbcorn2[3]; + int * IndexExTr; + char* MOPY; + char* MopyEx; + uint16* MOVI; + uint16* MoviEx; + uint16* MoviExSort; + float* MOVT; + float* MovtEx; + uint16* MovtExSort; + float* MONR; + float* MonrEx; + uint16* MOBA; + int* MobaEx; + float* LiquEx; + uint32 liquflags; + + WMOGroup(std::string &filename); + ~WMOGroup(); + + bool open(); + int ConvertToVMAPGroupWmo(FILE *output, bool pPreciseVectorData); private: - std::string filename; - char outfilename; + std::string filename; + char outfilename; }; -struct WMOLiquidHeader +struct WMOLiquidHeader { - int xverts, yverts, xtiles, ytiles; - float pos_x; - float pos_y; - float pos_z; - short type; + int xverts, yverts, xtiles, ytiles; + float pos_x; + float pos_y; + float pos_z; + short type; }; -class WMOInstance +class WMOInstance { - static std::set<int> ids; + static std::set<int> ids; public: string MapName; int currx; - int curry; - WMOGroup *wmo; - Vec3D pos; - Vec3D pos2, pos3, rot; - int indx,id, d2, d3; - int doodadset; + int curry; + WMOGroup *wmo; + Vec3D pos; + Vec3D pos2, pos3, rot; + int indx,id, d2, d3; + int doodadset; - WMOInstance(MPQFile &f,const char* WmoInstName,const char*MapName, FILE *pDirfile); + WMOInstance(MPQFile &f,const char* WmoInstName,const char*MapName, FILE *pDirfile); - static void reset(); + static void reset(); }; #endif diff --git a/sql/updates/54_world.sql b/sql/updates/54_world.sql new file mode 100644 index 00000000000..2d5e984d9e7 --- /dev/null +++ b/sql/updates/54_world.sql @@ -0,0 +1,5 @@ +CREATE TABLE `game_event_battleground_holiday` ( + `event` int(10) unsigned NOT NULL, + `bgflag` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`event`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp index 529f9dbecdc..86f4ab7a06a 100644 --- a/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/zone/arathi_highlands/arathi_highlands.cpp @@ -32,133 +32,133 @@ EndContentData */ ## npc_professor_phizzlethorpe ######*/ -#define SAY_PROGRESS_1 -1000235 -#define SAY_PROGRESS_2 -1000236 -#define SAY_PROGRESS_3 -1000237 -#define EMOTE_PROGRESS_4 -1000238 -#define SAY_AGGRO -1000239 -#define SAY_PROGRESS_5 -1000240 -#define SAY_PROGRESS_6 -1000241 -#define SAY_PROGRESS_7 -1000242 -#define EMOTE_PROGRESS_8 -1000243 -#define SAY_PROGRESS_9 -1000244 - -#define QUEST_SUNKEN_TREASURE 665 -#define MOB_VENGEFUL_SURGE 2776 +#define SAY_PROGRESS_1 -1000235 +#define SAY_PROGRESS_2 -1000236 +#define SAY_PROGRESS_3 -1000237 +#define EMOTE_PROGRESS_4 -1000238 +#define SAY_AGGRO -1000239 +#define SAY_PROGRESS_5 -1000240 +#define SAY_PROGRESS_6 -1000241 +#define SAY_PROGRESS_7 -1000242 +#define EMOTE_PROGRESS_8 -1000243 +#define SAY_PROGRESS_9 -1000244 + +#define QUEST_SUNKEN_TREASURE 665 +#define MOB_VENGEFUL_SURGE 2776 struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI { - npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();} + npc_professor_phizzlethorpeAI(Creature *c) : npc_escortAI(c) {Reset();} bool Completed; - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - switch(i) - { - case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break; - case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break; - case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break; - case 9: - { - m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - break; - } - case 10:DoScriptText(SAY_PROGRESS_5, m_creature, player);break; - case 11:DoScriptText(SAY_PROGRESS_6, m_creature, player);break; - case 19:DoScriptText(SAY_PROGRESS_7, m_creature, player); break; - case 20: - DoScriptText(EMOTE_PROGRESS_8, m_creature); - DoScriptText(SAY_PROGRESS_9, m_creature, player); + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + switch(i) + { + case 4:DoScriptText(SAY_PROGRESS_2, m_creature, player);break; + case 5:DoScriptText(SAY_PROGRESS_3, m_creature, player);break; + case 8:DoScriptText(EMOTE_PROGRESS_4, m_creature);break; + case 9: + { + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96, -2142.49, 20.15, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + break; + } + case 10:DoScriptText(SAY_PROGRESS_5, m_creature, player);break; + case 11:DoScriptText(SAY_PROGRESS_6, m_creature, player);break; + case 19:DoScriptText(SAY_PROGRESS_7, m_creature, player); break; + case 20: + DoScriptText(EMOTE_PROGRESS_8, m_creature); + DoScriptText(SAY_PROGRESS_9, m_creature, player); Completed = true; - if(player) + if(player) ((Player*)player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); - break; - } - } + break; + } + } - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature); - } + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature); + } - void Reset() + void Reset() { Completed = true; m_creature->setFaction(35); } - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature, NULL); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID && !Completed ) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - if (player) - ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature, NULL); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID && !Completed ) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + if (player) + ((Player*)player)->FailQuest(QUEST_SUNKEN_TREASURE); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_professor_phizzlethorpe(Player* player, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE) { - DoScriptText(SAY_PROGRESS_1, creature, player); + DoScriptText(SAY_PROGRESS_1, creature, player); ((npc_escortAI*)(creature->AI()))->Start(false, false, false, player->GetGUID()); - creature->setFaction(113); + creature->setFaction(113); } return true; } CreatureAI* GetAI_npc_professor_phizzlethorpeAI(Creature *_Creature) { - npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature); - - professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08); - professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24); - professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24); - professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67); - professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000); - professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000); - professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56); - professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31); - professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000); - professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000); - professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000); - professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000); - professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31); - professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56); - professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42); - professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67); - professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24); - professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24); - professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08); - professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000); - professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000); - - return (CreatureAI*)professor_phizzlethorpeAI; + npc_professor_phizzlethorpeAI* professor_phizzlethorpeAI = new npc_professor_phizzlethorpeAI(_Creature); + + professor_phizzlethorpeAI->AddWaypoint(0, -2066.45, -2085.96, 9.08); + professor_phizzlethorpeAI->AddWaypoint(1, -2077.99, -2105.33, 13.24); + professor_phizzlethorpeAI->AddWaypoint(2, -2074.60, -2109.67, 14.24); + professor_phizzlethorpeAI->AddWaypoint(3, -2076.60, -2117.46, 16.67); + professor_phizzlethorpeAI->AddWaypoint(4, -2073.51, -2123.46, 18.42, 2000); + professor_phizzlethorpeAI->AddWaypoint(5, -2073.51, -2123.46, 18.42, 4000); + professor_phizzlethorpeAI->AddWaypoint(6, -2066.60, -2131.85, 21.56); + professor_phizzlethorpeAI->AddWaypoint(7, -2053.85, -2143.19, 20.31); + professor_phizzlethorpeAI->AddWaypoint(8, -2043.49, -2153.73, 20.20, 12000); + professor_phizzlethorpeAI->AddWaypoint(9, -2043.49, -2153.73, 20.20, 14000); + professor_phizzlethorpeAI->AddWaypoint(10, -2043.49, -2153.73, 20.20, 10000); + professor_phizzlethorpeAI->AddWaypoint(11, -2043.49, -2153.73, 20.20, 2000); + professor_phizzlethorpeAI->AddWaypoint(12, -2053.85, -2143.19, 20.31); + professor_phizzlethorpeAI->AddWaypoint(13, -2066.60, -2131.85, 21.56); + professor_phizzlethorpeAI->AddWaypoint(14, -2073.51, -2123.46, 18.42); + professor_phizzlethorpeAI->AddWaypoint(15, -2076.60, -2117.46, 16.67); + professor_phizzlethorpeAI->AddWaypoint(16, -2074.60, -2109.67, 14.24); + professor_phizzlethorpeAI->AddWaypoint(17, -2077.99, -2105.33, 13.24); + professor_phizzlethorpeAI->AddWaypoint(18, -2066.45, -2085.96, 9.08); + professor_phizzlethorpeAI->AddWaypoint(19, -2066.41, -2086.21, 8.97, 6000); + professor_phizzlethorpeAI->AddWaypoint(20, -2066.41, -2086.21, 8.97, 2000); + + return (CreatureAI*)professor_phizzlethorpeAI; } void AddSC_arathi_highlands() { - Script * newscript; + Script * newscript; - newscript = new Script; - newscript->Name = "npc_professor_phizzlethorpe"; - newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; - newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_professor_phizzlethorpe"; + newscript->GetAI = &GetAI_npc_professor_phizzlethorpeAI; + newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp index 2ffc6f33497..9c408475503 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -353,53 +353,53 @@ CreatureAI* GetAI_npc_time_rift(Creature *_Creature) bool GossipHello_npc_saat(Player *player, Creature *_Creature) { - if (_Creature->isQuestGiver()) - player->PrepareQuestMenu(_Creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID()); - return true; - } - else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID()); - return true; - } - - player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID()); - return true; + if (_Creature->isQuestGiver()) + player->PrepareQuestMenu(_Creature->GetGUID()); + + if (player->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(10000,_Creature->GetGUID()); + return true; + } + else if (player->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !player->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + player->ADD_GOSSIP_ITEM(0,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + player->SEND_GOSSIP_MENU(10001,_Creature->GetGUID()); + return true; + } + + player->SEND_GOSSIP_MENU(10002,_Creature->GetGUID()); + return true; } bool GossipSelect_npc_saat(Player *player, Creature *_Creature, uint32 sender, uint32 action) { - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - player->CLOSE_GOSSIP_MENU(); - _Creature->CastSpell(player,SPELL_CHRONO_BEACON,false); - } - return true; + if (action == GOSSIP_ACTION_INFO_DEF+1) + { + player->CLOSE_GOSSIP_MENU(); + _Creature->CastSpell(player,SPELL_CHRONO_BEACON,false); + } + return true; } void AddSC_dark_portal() { - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_medivh_bm"; - newscript->GetAI = &GetAI_npc_medivh_bm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_time_rift"; - newscript->GetAI = &GetAI_npc_time_rift; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_saat"; - newscript->pGossipHello = &GossipHello_npc_saat; - newscript->pGossipSelect = &GossipSelect_npc_saat; - newscript->RegisterSelf(); + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_medivh_bm"; + newscript->GetAI = &GetAI_npc_medivh_bm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_time_rift"; + newscript->GetAI = &GetAI_npc_time_rift; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_saat"; + newscript->pGossipHello = &GossipHello_npc_saat; + newscript->pGossipSelect = &GossipSelect_npc_saat; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp index 290c7e86470..36740b0ed34 100644 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -36,347 +36,347 @@ inline uint32 RandRiftBoss() { return rand()%2 ? C_RKEEP : C_RLORD; } float PortalLocation[4][4]= { - {-2041.06, 7042.08, 29.99, 1.30}, - {-1968.18, 7042.11, 21.93, 2.12}, - {-1885.82, 7107.36, 22.32, 3.07}, - {-1928.11, 7175.95, 22.11, 3.44} + {-2041.06, 7042.08, 29.99, 1.30}, + {-1968.18, 7042.11, 21.93, 2.12}, + {-1885.82, 7107.36, 22.32, 3.07}, + {-1928.11, 7175.95, 22.11, 3.44} }; struct Wave { - uint32 PortalBoss; //protector of current portal - uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed + uint32 PortalBoss; //protector of current portal + uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed }; static Wave RiftWaves[]= { - {RIFT_BOSS, 0}, - {C_DEJA, 0}, - {RIFT_BOSS, 120000}, - {C_TEMPO, 140000}, - {RIFT_BOSS, 120000}, - {C_AEONUS, 0} + {RIFT_BOSS, 0}, + {C_DEJA, 0}, + {RIFT_BOSS, 120000}, + {C_TEMPO, 140000}, + {RIFT_BOSS, 120000}, + {C_AEONUS, 0} }; struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance { - instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();}; - - uint32 Encounter[ENCOUNTERS]; - - uint32 mRiftPortalCount; - uint32 mShieldPercent; - uint8 mRiftWaveCount; - uint8 mRiftWaveId; - - uint32 NextPortal_Timer; - - uint64 MedivhGUID; - uint8 CurrentRiftId; - - void Initialize() - { - MedivhGUID = 0; - Clear(); - } - - void Clear() - { - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounter[i] = NOT_STARTED; - - mRiftPortalCount = 0; - mShieldPercent = 100; - mRiftWaveCount = 0; - mRiftWaveId = 0; - - CurrentRiftId = 0; - - NextPortal_Timer = 0; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void UpdateBMWorldState(uint32 id, uint32 state) - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* player = itr->getSource()) - player->SendUpdateWorldState(id,state); - } - }else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!"); - } - - void InitWorldState(bool Enable = true) - { - UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0); - UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100); - UpdateBMWorldState(WORLD_STATE_BM_RIFT,0); - } - - bool IsEncounterInProgress() - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return true; - - return false; - } - - void OnPlayerEnter(Player *player) - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return; - - player->SendUpdateWorldState(WORLD_STATE_BM,0); - } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) - { - if (creature->GetEntry() == C_MEDIVH) - MedivhGUID = creature->GetGUID(); - } - - //what other conditions to check? - bool CanProgressEvent() - { - if (!GetPlayerInMap()) - return false; - - return true; - } - - uint8 GetRiftWaveId() - { - switch(mRiftPortalCount) - { - case 6: - mRiftWaveId = 2; - return 1; - case 12: - mRiftWaveId = 4; - return 3; - case 18: - return 5; - default: - return mRiftWaveId; - } - } - - void SetData(uint32 type, uint32 data) - { - Player *player = GetPlayerInMap(); - - if (!player) - { - debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } - - switch(type) - { - case TYPE_MEDIVH: - if (data == SPECIAL && Encounter[0] == IN_PROGRESS) - { - --mShieldPercent; - UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent); - - if (!mShieldPercent) - { - if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) - { - if (medivh->isAlive()) - { - medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Encounter[0] = FAIL; - Encounter[1] = NOT_STARTED; - } - } - } - } - else - { - if (data == IN_PROGRESS) - { - debug_log("SD2: Instance Dark Portal: Starting event."); - InitWorldState(); - Encounter[1] = IN_PROGRESS; - NextPortal_Timer = 15000; - } - - if (data == DONE) - { - //this may be completed further out in the post-event - if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) - { - player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh); - player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh); - } - } - - Encounter[0] = data; - } - break; - case TYPE_RIFT: - if (data == SPECIAL) - { - if (mRiftPortalCount < 7) - NextPortal_Timer = 5000; - } - else - Encounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_MEDIVH: - return Encounter[0]; - case TYPE_RIFT: - return Encounter[1]; - case DATA_PORTAL_COUNT: - return mRiftPortalCount; - case DATA_SHIELD: - return mShieldPercent; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - if (data == DATA_MEDIVH) - return MedivhGUID; - - return 0; - } - - Unit* SummonedPortalBoss(Unit* source) - { - uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; - if (entry == RIFT_BOSS) - entry = RandRiftBoss(); - - float x,y,z; - source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z); - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); - - debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry); - - Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(), - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - - if (Summon) - return Summon; - - debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); - return NULL; - } - - void DoSpawnPortal() - { - Player *player = GetPlayerInMap(); - if (!player) - return; - - if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) - { - for(uint8 i = 0; i < 4; i++) - { - int tmp = rand()%4; - if (tmp != CurrentRiftId) - { - debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); - - CurrentRiftId = tmp; - - Unit *temp = medivh->SummonCreature(C_TIME_RIFT, - PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], - TEMPSUMMON_CORPSE_DESPAWN,0); - if (temp) - { - - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - - if (Unit* boss = SummonedPortalBoss(temp)) - { - if (boss->GetEntry() == C_AEONUS) - { - boss->AddThreat(medivh,0.0f); - } - else - { - boss->AddThreat(temp,0.0f); - temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false); - } - } - } - break; - } - } - } - } - - void Update(uint32 diff) - { - if (Encounter[1] != IN_PROGRESS) - return; - - //add delay timer? - if (!CanProgressEvent()) - { - Clear(); - return; - } - - if (NextPortal_Timer) - { - if (NextPortal_Timer < diff) - { - ++mRiftPortalCount; - UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount); - - DoSpawnPortal(); - NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; - }else NextPortal_Timer -= diff; - } - } + instance_dark_portal(Map *map) : ScriptedInstance(map) {Initialize();}; + + uint32 Encounter[ENCOUNTERS]; + + uint32 mRiftPortalCount; + uint32 mShieldPercent; + uint8 mRiftWaveCount; + uint8 mRiftWaveId; + + uint32 NextPortal_Timer; + + uint64 MedivhGUID; + uint8 CurrentRiftId; + + void Initialize() + { + MedivhGUID = 0; + Clear(); + } + + void Clear() + { + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounter[i] = NOT_STARTED; + + mRiftPortalCount = 0; + mShieldPercent = 100; + mRiftWaveCount = 0; + mRiftWaveId = 0; + + CurrentRiftId = 0; + + NextPortal_Timer = 0; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("SD2: Instance Black Portal: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void UpdateBMWorldState(uint32 id, uint32 state) + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* player = itr->getSource()) + player->SendUpdateWorldState(id,state); + } + }else debug_log("SD2: Instance Black Portal: UpdateBMWorldState, but PlayerList is empty!"); + } + + void InitWorldState(bool Enable = true) + { + UpdateBMWorldState(WORLD_STATE_BM,Enable ? 1 : 0); + UpdateBMWorldState(WORLD_STATE_BM_SHIELD,100); + UpdateBMWorldState(WORLD_STATE_BM_RIFT,0); + } + + bool IsEncounterInProgress() + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return true; + + return false; + } + + void OnPlayerEnter(Player *player) + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return; + + player->SendUpdateWorldState(WORLD_STATE_BM,0); + } + + void OnCreatureCreate(Creature *creature, uint32 creature_entry) + { + if (creature->GetEntry() == C_MEDIVH) + MedivhGUID = creature->GetGUID(); + } + + //what other conditions to check? + bool CanProgressEvent() + { + if (!GetPlayerInMap()) + return false; + + return true; + } + + uint8 GetRiftWaveId() + { + switch(mRiftPortalCount) + { + case 6: + mRiftWaveId = 2; + return 1; + case 12: + mRiftWaveId = 4; + return 3; + case 18: + return 5; + default: + return mRiftWaveId; + } + } + + void SetData(uint32 type, uint32 data) + { + Player *player = GetPlayerInMap(); + + if (!player) + { + debug_log("SD2: Instance Black Portal: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } + + switch(type) + { + case TYPE_MEDIVH: + if (data == SPECIAL && Encounter[0] == IN_PROGRESS) + { + --mShieldPercent; + UpdateBMWorldState(WORLD_STATE_BM_SHIELD,mShieldPercent); + + if (!mShieldPercent) + { + if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) + { + if (medivh->isAlive()) + { + medivh->DealDamage(medivh, medivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Encounter[0] = FAIL; + Encounter[1] = NOT_STARTED; + } + } + } + } + else + { + if (data == IN_PROGRESS) + { + debug_log("SD2: Instance Dark Portal: Starting event."); + InitWorldState(); + Encounter[1] = IN_PROGRESS; + NextPortal_Timer = 15000; + } + + if (data == DONE) + { + //this may be completed further out in the post-event + if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) + { + player->GroupEventHappens(QUEST_OPENING_PORTAL,medivh); + player->GroupEventHappens(QUEST_MASTER_TOUCH,medivh); + } + } + + Encounter[0] = data; + } + break; + case TYPE_RIFT: + if (data == SPECIAL) + { + if (mRiftPortalCount < 7) + NextPortal_Timer = 5000; + } + else + Encounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_MEDIVH: + return Encounter[0]; + case TYPE_RIFT: + return Encounter[1]; + case DATA_PORTAL_COUNT: + return mRiftPortalCount; + case DATA_SHIELD: + return mShieldPercent; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + if (data == DATA_MEDIVH) + return MedivhGUID; + + return 0; + } + + Unit* SummonedPortalBoss(Unit* source) + { + uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; + if (entry == RIFT_BOSS) + entry = RandRiftBoss(); + + float x,y,z; + source->GetRandomPoint(source->GetPositionX(),source->GetPositionY(),source->GetPositionZ(),10.0f,x,y,z); + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); + + debug_log("SD2: Instance Dark Portal: Summoning rift boss entry %u.",entry); + + Unit *Summon = source->SummonCreature(entry,x,y,z,source->GetOrientation(), + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + + if (Summon) + return Summon; + + debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); + return NULL; + } + + void DoSpawnPortal() + { + Player *player = GetPlayerInMap(); + if (!player) + return; + + if (Unit *medivh = Unit::GetUnit(*player,MedivhGUID)) + { + for(uint8 i = 0; i < 4; i++) + { + int tmp = rand()%4; + if (tmp != CurrentRiftId) + { + debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + + CurrentRiftId = tmp; + + Unit *temp = medivh->SummonCreature(C_TIME_RIFT, + PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], + TEMPSUMMON_CORPSE_DESPAWN,0); + if (temp) + { + + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + + if (Unit* boss = SummonedPortalBoss(temp)) + { + if (boss->GetEntry() == C_AEONUS) + { + boss->AddThreat(medivh,0.0f); + } + else + { + boss->AddThreat(temp,0.0f); + temp->CastSpell(boss,SPELL_RIFT_CHANNEL,false); + } + } + } + break; + } + } + } + } + + void Update(uint32 diff) + { + if (Encounter[1] != IN_PROGRESS) + return; + + //add delay timer? + if (!CanProgressEvent()) + { + Clear(); + return; + } + + if (NextPortal_Timer) + { + if (NextPortal_Timer < diff) + { + ++mRiftPortalCount; + UpdateBMWorldState(WORLD_STATE_BM_RIFT,mRiftPortalCount); + + DoSpawnPortal(); + NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; + }else NextPortal_Timer -= diff; + } + } }; InstanceData* GetInstanceData_instance_dark_portal(Map* map) { - return new instance_dark_portal(map); + return new instance_dark_portal(map); } void AddSC_instance_dark_portal() { - Script *newscript; + Script *newscript; - newscript = new Script; - newscript->Name = "instance_dark_portal"; - newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "instance_dark_portal"; + newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp index 9d975a2ff02..caf40a50dce 100644 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp @@ -306,5 +306,5 @@ void AddSC_boss_onyxia() newscript = new Script; newscript->Name="boss_onyxia"; newscript->GetAI = &GetAI_boss_onyxiaAI; - newscript->RegisterSelf(); + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp index 0a230e4e262..e7391a51a4d 100644 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp @@ -47,158 +47,158 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI { npc_willixAI(Creature *c) : npc_escortAI(c) {Reset();} - void WaypointReached(uint32 i) - { - Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); - - if (!player) - return; - - switch (i) - { - case 3: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - DoScriptText(SAY_POINT, m_creature, player); - break; - case 4: - m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 8: - DoScriptText(SAY_BLUELEAF, m_creature, player); - break; - case 9: - DoScriptText(SAY_DANGER, m_creature, player); - break; - case 13: - DoScriptText(SAY_BAD, m_creature, player); - break; - case 14: - m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 25: - DoScriptText(SAY_THINK, m_creature, player); - break; - case 31: - DoScriptText(SAY_SOON, m_creature, player); - break; - case 42: - DoScriptText(SAY_FINALY, m_creature, player); - break; - case 43: - m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 45: - DoScriptText(SAY_WIN, m_creature, player); - if (player && player->GetTypeId() == TYPEID_PLAYER) - ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); - break; - case 46: - DoScriptText(SAY_END, m_creature, player); - break; - } - } - - void Reset() {} - - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO1, m_creature, NULL); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) - ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } + void WaypointReached(uint32 i) + { + Unit* player = Unit::GetUnit((*m_creature), PlayerGUID); + + if (!player) + return; + + switch (i) + { + case 3: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, m_creature, player); + break; + case 4: + m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, m_creature, player); + break; + case 9: + DoScriptText(SAY_DANGER, m_creature, player); + break; + case 13: + DoScriptText(SAY_BAD, m_creature, player); + break; + case 14: + m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, m_creature, player); + break; + case 31: + DoScriptText(SAY_SOON, m_creature, player); + break; + case 42: + DoScriptText(SAY_FINALY, m_creature, player); + break; + case 43: + m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, m_creature, player); + if (player && player->GetTypeId() == TYPEID_PLAYER) + ((Player*)player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); + break; + case 46: + DoScriptText(SAY_END, m_creature, player); + break; + } + } + + void Reset() {} + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO1, m_creature, NULL); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Unit* player = Unit::GetUnit((*m_creature), PlayerGUID)) + ((Player*)player)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } }; bool QuestAccept_npc_willix(Player* player, Creature* creature, Quest const* quest) { - if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) - { - ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); - DoScriptText(SAY_READY, creature, player); - creature->setFaction(113); - } - - return true; + if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) + { + ((npc_escortAI*)(creature->AI()))->Start(true, true, false, player->GetGUID()); + DoScriptText(SAY_READY, creature, player); + creature->setFaction(113); + } + + return true; } CreatureAI* GetAI_npc_willix(Creature *_Creature) { - npc_willixAI* thisAI = new npc_willixAI(_Creature); - - thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); - thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); - thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); - thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); - thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); - thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); - thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); - thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); - thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); - thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); - thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); - thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); - thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); - thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); - thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); - thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); - thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); - thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); - thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); - thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); - thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); - thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); - thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); - thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); - thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); - thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); - thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); - thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); - thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); - thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); - thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); - thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); - thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); - thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); - thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); - thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); - thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); - thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); - thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); - thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); - thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); - thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); - thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); - thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); - thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); - thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); - thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - - return (CreatureAI*)thisAI; + npc_willixAI* thisAI = new npc_willixAI(_Creature); + + thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); + thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); + thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); + thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); + thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); + thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); + thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); + thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); + thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); + thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); + thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); + thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); + thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); + thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); + thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); + thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); + thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); + thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); + thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); + thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); + thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); + thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); + thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); + thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); + thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); + thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); + thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); + thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); + thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); + thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); + thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); + thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); + thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); + thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); + thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); + thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); + thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); + thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); + thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); + thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); + thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); + thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); + thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); + thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); + thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); + thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); + thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); + + return (CreatureAI*)thisAI; } void AddSC_razorfen_kraul() { - Script *newscript; + Script *newscript; - newscript = new Script; - newscript->Name = "npc_willix"; - newscript->GetAI = &GetAI_npc_willix; - newscript->pQuestAccept = &QuestAccept_npc_willix; - newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_willix"; + newscript->GetAI = &GetAI_npc_willix; + newscript->pQuestAccept = &QuestAccept_npc_willix; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h index 3c5532baf21..aa0dfa8b925 100644 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h +++ b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h @@ -10,6 +10,6 @@ #define DATA_WHITEMANE 3 #define DATA_DOOR_WHITEMANE 4 -#define DATA_HORSEMAN_EVENT 5 -#define GAMEOBJECT_PUMPKIN_SHRINE 6 +#define DATA_HORSEMAN_EVENT 5 +#define GAMEOBJECT_PUMPKIN_SHRINE 6 #endif diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index 97eed337799..7c27864bc31 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -7906,35 +7906,35 @@ CreatureInfo const *GetCreatureInfo(uint32 id) void ObjectMgr::LoadTransportEvents() { - QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events"); + QueryResult *result = WorldDatabase.Query("SELECT entry, waypoint_id, event_id FROM transport_events"); if( !result ) { barGoLink bar1( 1 ); bar1.step(); - sLog.outString( "\n>> Transport events table is empty \n" ); + sLog.outString( "\n>> Transport events table is empty \n" ); return; } - barGoLink bar1( result->GetRowCount() ); + barGoLink bar1( result->GetRowCount() ); do { bar1.step(); - Field *fields = result->Fetch(); + Field *fields = result->Fetch(); - //Load event values + //Load event values uint32 entry = fields[0].GetUInt32(); uint32 waypoint_id = fields[1].GetUInt32(); - uint32 event_id = fields[2].GetUInt32(); + uint32 event_id = fields[2].GetUInt32(); - uint32 event_count = (entry*100)+waypoint_id; - TransportEventMap[event_count] = event_id; - } - while(result->NextRow()); + uint32 event_count = (entry*100)+waypoint_id; + TransportEventMap[event_count] = event_id; + } + while(result->NextRow()); - sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() ); + sLog.outString( "\n>> Loaded %u transport events \n", result->GetRowCount() ); - delete result; + delete result; } diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 8d8f47f6379..9e195538e5f 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -2229,7 +2229,7 @@ void Spell::cast(bool skipCheck) SpellEntry const *auraSpellInfo = (*i)->GetSpellProto(); uint32 auraSpellIdx = (*i)->GetEffIndex(); if(SpellEntry const *spellInfo = sSpellStore.LookupEntry(auraSpellInfo->EffectTriggerSpell[auraSpellIdx])) - { + { // Calculate chance at that moment (can be depend for example from combo points) int32 chance = m_caster->CalculateSpellDamage(auraSpellInfo, auraSpellIdx, (*i)->GetBasePoints(), NULL); m_ChanceTriggerSpells.push_back(std::make_pair(spellInfo, chance * (*i)->GetStackAmount())); diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index bc5af583625..7dd6ae246cd 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -5752,6 +5752,7 @@ void Aura::PeriodicTick() int32 gain = pCaster->ModifyPower(power,gain_amount); m_target->AddThreat(pCaster, float(gain) * 0.5f, GetSpellSchoolMask(GetSpellProto()), GetSpellProto()); } + // Mark of Kaz'rogal if(GetId() == 31447 && m_target->GetPower(power) == 0) { @@ -5759,6 +5760,20 @@ void Aura::PeriodicTick() // Remove aura SetAuraDuration(0); } + + // Mark of Kazzak + if(GetId() == 32960) + { + int32 modifier = (m_target->GetPower(power) * 0.05f); + m_target->ModifyPower(power, -modifier); + + if(m_target->GetPower(power) == 0) + { + m_target->CastSpell(m_target, 32961, true, 0, this); + // Remove aura + SetAuraDuration(0); + } + } break; } case SPELL_AURA_PERIODIC_ENERGIZE: diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 847f90ed0c9..37f627222fc 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -2259,7 +2259,7 @@ void SpellMgr::LoadSpellCustomAttr() case 41635: // Prayer of Mending case 44869: // Spectral Blast case 45027: // Revitalize - case 45976: // Muru Portal Channel + case 45976: // Muru Portal Channel spellInfo->MaxAffectedTargets = 1; break; case 41376: // Spite |
