diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1f05b58 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..957df71 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,599 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse +SUBDIRS = sql + +BUILT_SOURCES = revision.h +CLEANFILES = revision.h +## CPP flags for includes, defines, etc. +AM_CPPFLAGS = $(MANGOS_INCLUDES) -I$(srcdir) -I$(srcdir)/../../../dep/include -I$(srcdir)/../../shared/ -I$(srcdir)/../../framework/ -I$(srcdir)/../../game/ -I$(srcdir)/include/ -I$(srcdir)/base/ -DSYSCONFDIR=\"$(sysconfdir)/\" + +## Build MaNGOS script library as shared library. +# libmangosscript shared library will later be reused by world server daemon. +lib_LTLIBRARIES = libmangosscript.la +libmangosscript_la_SOURCES = \ +ScriptMgr.cpp \ +ScriptMgr.h \ +config.h \ +base/escort_ai.cpp \ +base/escort_ai.h \ +base/follower_ai.cpp \ +base/follower_ai.h \ +base/guard_ai.cpp \ +base/guard_ai.h \ +include/precompiled.cpp \ +include/precompiled.h \ +include/sc_creature.cpp \ +include/sc_creature.h \ +include/sc_gossip.h \ +include/sc_grid_searchers.cpp \ +include/sc_grid_searchers.h \ +include/sc_instance.cpp \ +include/sc_instance.h \ +scripts/battlegrounds/battleground.cpp \ +scripts/eastern_kingdoms/alterac_mountains.cpp \ +scripts/eastern_kingdoms/arathi_highlands.cpp \ +scripts/eastern_kingdoms/blasted_lands.cpp \ +scripts/eastern_kingdoms/boss_kruul.cpp \ +scripts/eastern_kingdoms/burning_steppes.cpp \ +scripts/eastern_kingdoms/dun_morogh.cpp \ +scripts/eastern_kingdoms/eastern_plaguelands.cpp \ +scripts/eastern_kingdoms/elwynn_forest.cpp \ +scripts/eastern_kingdoms/eversong_woods.cpp \ +scripts/eastern_kingdoms/ghostlands.cpp \ +scripts/eastern_kingdoms/hinterlands.cpp \ +scripts/eastern_kingdoms/ironforge.cpp \ +scripts/eastern_kingdoms/isle_of_queldanas.cpp \ +scripts/eastern_kingdoms/loch_modan.cpp \ +scripts/eastern_kingdoms/redridge_mountains.cpp \ +scripts/eastern_kingdoms/searing_gorge.cpp \ +scripts/eastern_kingdoms/silvermoon_city.cpp \ +scripts/eastern_kingdoms/silverpine_forest.cpp \ +scripts/eastern_kingdoms/stormwind_city.cpp \ +scripts/eastern_kingdoms/stranglethorn_vale.cpp \ +scripts/eastern_kingdoms/swamp_of_sorrows.cpp \ +scripts/eastern_kingdoms/tirisfal_glades.cpp \ +scripts/eastern_kingdoms/undercity.cpp \ +scripts/eastern_kingdoms/western_plaguelands.cpp \ +scripts/eastern_kingdoms/westfall.cpp \ +scripts/eastern_kingdoms/wetlands.cpp \ +scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp \ +scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h \ +scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp \ +scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp \ +scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp \ +scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h \ +scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp \ +scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp \ +scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp \ +scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp \ +scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp \ +scripts/eastern_kingdoms/deadmines/deadmines.cpp \ +scripts/eastern_kingdoms/deadmines/deadmines.h \ +scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp \ +scripts/eastern_kingdoms/gnomeregan/boss_thermaplugg.cpp \ +scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp \ +scripts/eastern_kingdoms/gnomeregan/gnomeregan.h \ +scripts/eastern_kingdoms/gnomeregan/instance_gnomeregan.cpp \ +scripts/eastern_kingdoms/karazhan/boss_curator.cpp \ +scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp \ +scripts/eastern_kingdoms/karazhan/boss_midnight.cpp \ +scripts/eastern_kingdoms/karazhan/boss_moroes.cpp \ +scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp \ +scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp \ +scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp \ +scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp \ +scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp \ +scripts/eastern_kingdoms/karazhan/bosses_opera.cpp \ +scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp \ +scripts/eastern_kingdoms/karazhan/karazhan.cpp \ +scripts/eastern_kingdoms/karazhan/karazhan.h \ +scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp \ +scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp \ +scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp \ +scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp \ +scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp \ +scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp \ +scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.h \ +scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp \ +scripts/eastern_kingdoms/molten_core/boss_garr.cpp \ +scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp \ +scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp \ +scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp \ +scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp \ +scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp \ +scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp \ +scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp \ +scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp \ +scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp \ +scripts/eastern_kingdoms/molten_core/molten_core.cpp \ +scripts/eastern_kingdoms/molten_core/molten_core.h \ +scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp \ +scripts/eastern_kingdoms/scarlet_monastery/scarlet_monastery.h \ +scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp \ +scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp \ +scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp \ +scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp \ +scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp \ +scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp \ +scripts/eastern_kingdoms/scholomance/boss_kormok.cpp \ +scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp \ +scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp \ +scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp \ +scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp \ +scripts/eastern_kingdoms/scholomance/boss_vectus.cpp \ +scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp \ +scripts/eastern_kingdoms/scholomance/scholomance.h \ +scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp \ +scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp \ +scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.h \ +scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp \ +scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp \ +scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp \ +scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp \ +scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp \ +scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp \ +scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp \ +scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp \ +scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp \ +scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp \ +scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp \ +scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp \ +scripts/eastern_kingdoms/stratholme/stratholme.cpp \ +scripts/eastern_kingdoms/stratholme/stratholme.h \ +scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp \ +scripts/eastern_kingdoms/sunken_temple/sunken_temple.h \ +scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp \ +scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp \ +scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp \ +scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp \ +scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h \ +scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp \ +scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp \ +scripts/eastern_kingdoms/uldaman/uldaman.cpp \ +scripts/eastern_kingdoms/uldaman/uldaman.h \ +scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp \ +scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp \ +scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp \ +scripts/eastern_kingdoms/zulaman/boss_janalai.cpp \ +scripts/eastern_kingdoms/zulaman/boss_malacrass.cpp \ +scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp \ +scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp \ +scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp \ +scripts/eastern_kingdoms/zulaman/zulaman.cpp \ +scripts/eastern_kingdoms/zulaman/zulaman.h \ +scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_marli.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp \ +scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp \ +scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp \ +scripts/eastern_kingdoms/zulgurub/zulgurub.h \ +scripts/examples/example_creature.cpp \ +scripts/examples/example_escort.cpp \ +scripts/examples/example_gossip_codebox.cpp \ +scripts/examples/example_misc.cpp \ +scripts/kalimdor/ashenvale.cpp \ +scripts/kalimdor/azshara.cpp \ +scripts/kalimdor/azuremyst_isle.cpp \ +scripts/kalimdor/bloodmyst_isle.cpp \ +scripts/kalimdor/boss_azuregos.cpp \ +scripts/kalimdor/darkshore.cpp \ +scripts/kalimdor/desolace.cpp \ +scripts/kalimdor/dustwallow_marsh.cpp \ +scripts/kalimdor/felwood.cpp \ +scripts/kalimdor/feralas.cpp \ +scripts/kalimdor/moonglade.cpp \ +scripts/kalimdor/mulgore.cpp \ +scripts/kalimdor/orgrimmar.cpp \ +scripts/kalimdor/silithus.cpp \ +scripts/kalimdor/stonetalon_mountains.cpp \ +scripts/kalimdor/tanaris.cpp \ +scripts/kalimdor/teldrassil.cpp \ +scripts/kalimdor/the_barrens.cpp \ +scripts/kalimdor/thousand_needles.cpp \ +scripts/kalimdor/thunder_bluff.cpp \ +scripts/kalimdor/ungoro_crater.cpp \ +scripts/kalimdor/winterspring.cpp \ +scripts/kalimdor/blackfathom_deeps/blackfathom_deeps.h \ +scripts/kalimdor/blackfathom_deeps/instance_blackfathom_deeps.cpp \ +scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h \ +scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp \ +scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp \ +scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp \ +scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp \ +scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp \ +scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp \ +scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.h \ +scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp \ +scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp \ +scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp \ +scripts/kalimdor/caverns_of_time/hyjal/hyjal.h \ +scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp \ +scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h \ +scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp \ +scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp \ +scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp \ +scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp \ +scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp \ +scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp \ +scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.h \ +scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp \ +scripts/kalimdor/maraudon/boss_landslide.cpp \ +scripts/kalimdor/maraudon/boss_noxxion.cpp \ +scripts/kalimdor/maraudon/boss_princess_theradras.cpp \ +scripts/kalimdor/onyxias_lair/boss_onyxia.cpp \ +scripts/kalimdor/onyxias_lair/instance_onyxias_lair.cpp \ +scripts/kalimdor/onyxias_lair/onyxias_lair.h \ +scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp \ +scripts/kalimdor/razorfen_downs/razorfen_downs.cpp \ +scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp \ +scripts/kalimdor/razorfen_kraul/razorfen_kraul.h \ +scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp \ +scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h \ +scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp \ +scripts/kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.h \ +scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp \ +scripts/kalimdor/wailing_caverns/wailing_caverns.h \ +scripts/kalimdor/zulfarrak/zulfarrak.cpp \ +scripts/northrend/borean_tundra.cpp \ +scripts/northrend/dalaran.cpp \ +scripts/northrend/dragonblight.cpp \ +scripts/northrend/grizzly_hills.cpp \ +scripts/northrend/icecrown.cpp \ +scripts/northrend/sholazar_basin.cpp \ +scripts/northrend/storm_peaks.cpp \ +scripts/northrend/howling_fjord.cpp \ +scripts/northrend/zuldrak.cpp \ +scripts/northrend/azjol-nerub/ahnkahet/boss_jedoga.cpp \ +scripts/northrend/azjol-nerub/ahnkahet/boss_nadox.cpp \ +scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp \ +scripts/northrend/azjol-nerub/ahnkahet/boss_volazj.cpp \ +scripts/northrend/azjol-nerub/ahnkahet/ahnkahet.h \ +scripts/northrend/azjol-nerub/ahnkahet/instance_ahnkahet.cpp \ +scripts/northrend/azjol-nerub/azjol-nerub/azjol-nerub.h \ +scripts/northrend/azjol-nerub/azjol-nerub/boss_anubarak.cpp \ +scripts/northrend/azjol-nerub/azjol-nerub/boss_hadronox.cpp \ +scripts/northrend/azjol-nerub/azjol-nerub/boss_krikthir.cpp \ +scripts/northrend/azjol-nerub/azjol-nerub/instance_azjol-nerub.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_faction_champions.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_jaraxxus.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_northrend_beasts.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/instance_trial_of_the_crusader.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp \ +scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.h \ +scripts/northrend/draktharon_keep/boss_novos.cpp \ +scripts/northrend/draktharon_keep/boss_tharonja.cpp \ +scripts/northrend/draktharon_keep/boss_trollgore.cpp \ +scripts/northrend/gundrak/boss_colossus.cpp \ +scripts/northrend/gundrak/boss_galdarah.cpp \ +scripts/northrend/gundrak/boss_moorabi.cpp \ +scripts/northrend/gundrak/boss_sladran.cpp \ +scripts/northrend/gundrak/gundrak.h \ +scripts/northrend/gundrak/instance_gundrak.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falryn.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_forgemaster_gafrost.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_krick_and_ick.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_bronjahm.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp \ +scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_deathbringer_saurfang.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_festergut.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lady_deathwhisper.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/boss_valithria_dreamwalker.cpp \ +scripts/northrend/icecrown_citadel/icecrown_citadel/gunship_battle.cpp \ +scripts/northrend/naxxramas/boss_anubrekhan.cpp \ +scripts/northrend/naxxramas/boss_faerlina.cpp \ +scripts/northrend/naxxramas/boss_four_horsemen.cpp \ +scripts/northrend/naxxramas/boss_gluth.cpp \ +scripts/northrend/naxxramas/boss_gothik.cpp \ +scripts/northrend/naxxramas/boss_grobbulus.cpp \ +scripts/northrend/naxxramas/boss_heigan.cpp \ +scripts/northrend/naxxramas/boss_kelthuzad.cpp \ +scripts/northrend/naxxramas/boss_loatheb.cpp \ +scripts/northrend/naxxramas/boss_maexxna.cpp \ +scripts/northrend/naxxramas/boss_noth.cpp \ +scripts/northrend/naxxramas/boss_patchwerk.cpp \ +scripts/northrend/naxxramas/boss_razuvious.cpp \ +scripts/northrend/naxxramas/boss_sapphiron.cpp \ +scripts/northrend/naxxramas/boss_thaddius.cpp \ +scripts/northrend/naxxramas/naxxramas.h \ +scripts/northrend/naxxramas/instance_naxxramas.cpp \ +scripts/northrend/nexus/nexus/boss_anomalus.cpp \ +scripts/northrend/nexus/nexus/boss_keristrasza.cpp \ +scripts/northrend/nexus/nexus/boss_ormorok.cpp \ +scripts/northrend/nexus/nexus/boss_telestra.cpp \ +scripts/northrend/nexus/nexus/nexus.h \ +scripts/northrend/nexus/nexus/instance_nexus.cpp \ +scripts/northrend/obsidian_sanctum/boss_sartharion.cpp \ +scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp \ +scripts/northrend/obsidian_sanctum/obsidian_sanctum.h \ +scripts/northrend/ruby_sanctum/boss_halion.cpp \ +scripts/northrend/ruby_sanctum/boss_baltharus.cpp \ +scripts/northrend/ruby_sanctum/boss_saviana.cpp \ +scripts/northrend/ruby_sanctum/boss_zarithian.cpp \ +scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp \ +scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp \ +scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp \ +scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp \ +scripts/northrend/ulduar/halls_of_lightning/halls_of_lightning.h \ +scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp \ +scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp \ +scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp \ +scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp \ +scripts/northrend/ulduar/halls_of_stone/halls_of_stone.h \ +scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp \ +scripts/northrend/ulduar/ulduar/assembly_of_iron.cpp \ +scripts/northrend/ulduar/ulduar/boss_algalon.cpp \ +scripts/northrend/ulduar/ulduar/boss_auriaya.cpp \ +scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp \ +scripts/northrend/ulduar/ulduar/boss_freya.cpp \ +scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp \ +scripts/northrend/ulduar/ulduar/boss_hodir.cpp \ +scripts/northrend/ulduar/ulduar/boss_ignis.cpp \ +scripts/northrend/ulduar/ulduar/boss_kologarn.cpp \ +scripts/northrend/ulduar/ulduar/boss_mimiron.cpp \ +scripts/northrend/ulduar/ulduar/boss_razorscale.cpp \ +scripts/northrend/ulduar/ulduar/boss_thorim.cpp \ +scripts/northrend/ulduar/ulduar/boss_xt_002.cpp \ +scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp \ +scripts/northrend/ulduar/ulduar/instance_ulduar.cpp \ +scripts/northrend/ulduar/ulduar/ulduar.cpp \ +scripts/northrend/ulduar/ulduar/ulduar.h \ +scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar.cpp \ +scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp \ +scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_and_dalronn.cpp \ +scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp \ +scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp \ +scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.h \ +scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_gortok.cpp \ +scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp \ +scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp \ +scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp \ +scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp \ +scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h \ +scripts/northrend/violet_hold/instance_violet_hold.cpp \ +scripts/northrend/violet_hold/violet_hold.cpp \ +scripts/northrend/violet_hold/violet_hold.h \ +scripts/outland/blades_edge_mountains.cpp \ +scripts/outland/boss_doomlord_kazzak.cpp \ +scripts/outland/boss_doomwalker.cpp \ +scripts/outland/hellfire_peninsula.cpp \ +scripts/outland/nagrand.cpp \ +scripts/outland/netherstorm.cpp \ +scripts/outland/shadowmoon_valley.cpp \ +scripts/outland/shattrath_city.cpp \ +scripts/outland/terokkar_forest.cpp \ +scripts/outland/zangarmarsh.cpp \ +scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp \ +scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp \ +scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp \ +scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp \ +scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp \ +scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp \ +scripts/outland/auchindoun/sethekk_halls/sethekk_halls.h \ +scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp \ +scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp \ +scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp \ +scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp \ +scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp \ +scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h \ +scripts/outland/black_temple/black_temple.cpp \ +scripts/outland/black_temple/black_temple.h \ +scripts/outland/black_temple/boss_bloodboil.cpp \ +scripts/outland/black_temple/boss_illidan.cpp \ +scripts/outland/black_temple/boss_mother_shahraz.cpp \ +scripts/outland/black_temple/boss_reliquary_of_souls.cpp \ +scripts/outland/black_temple/boss_shade_of_akama.cpp \ +scripts/outland/black_temple/boss_supremus.cpp \ +scripts/outland/black_temple/boss_teron_gorefiend.cpp \ +scripts/outland/black_temple/boss_warlord_najentus.cpp \ +scripts/outland/black_temple/illidari_council.cpp \ +scripts/outland/black_temple/instance_black_temple.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/boss_fathomlord_karathress.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/boss_hydross_the_unstable.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/boss_lady_vashj.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/boss_leotheras_the_blind.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/boss_morogrim_tidewalker.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/instance_serpent_shrine.cpp \ +scripts/outland/coilfang_reservoir/serpent_shrine/serpent_shrine.h \ +scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp \ +scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp \ +scripts/outland/coilfang_reservoir/steam_vault/boss_warlord_kalithresh.cpp \ +scripts/outland/coilfang_reservoir/steam_vault/instance_steam_vault.cpp \ +scripts/outland/coilfang_reservoir/steam_vault/steam_vault.h \ +scripts/outland/coilfang_reservoir/underbog/boss_hungarfen.cpp \ +scripts/outland/gruuls_lair/boss_gruul.cpp \ +scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp \ +scripts/outland/gruuls_lair/gruuls_lair.h \ +scripts/outland/gruuls_lair/instance_gruuls_lair.cpp \ +scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h \ +scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp \ +scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp \ +scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp \ +scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp \ +scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp \ +scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp \ +scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp \ +scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h \ +scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp \ +scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp \ +scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp \ +scripts/outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h \ +scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp \ +scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp \ +scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp \ +scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp \ +scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h \ +scripts/outland/tempest_keep/arcatraz/arcatraz.cpp \ +scripts/outland/tempest_keep/arcatraz/arcatraz.h \ +scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp \ +scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp \ +scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp \ +scripts/outland/tempest_keep/botanica/boss_laj.cpp \ +scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp \ +scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp \ +scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp \ +scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp \ +scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp \ +scripts/outland/tempest_keep/the_eye/the_eye.cpp \ +scripts/outland/tempest_keep/the_eye/the_eye.h \ +scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp \ +scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp \ +scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp \ +scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp \ +scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp \ +scripts/outland/tempest_keep/the_mechanar/mechanar.h \ +scripts/world/areatrigger_scripts.cpp \ +scripts/world/boss_emeriss.cpp \ +scripts/world/boss_lethon.cpp \ +scripts/world/boss_taerar.cpp \ +scripts/world/boss_ysondre.cpp \ +scripts/world/go_scripts.cpp \ +scripts/world/guards.cpp \ +scripts/world/item_scripts.cpp \ +scripts/world/mob_generic_creature.cpp \ +scripts/world/npc_professions.cpp \ +scripts/world/npcs_special.cpp \ +scripts/world/spell_scripts.cpp \ +system/ScriptLoader.cpp \ +system/ScriptLoader.h \ +system/system.cpp \ +system/system.h \ +revision.h + + +## magic to include revision data in SD2 version string +revision.h: FORCE + $(top_builddir)/src/tools/genrevision/genrevision $(srcdir) + +FORCE: + +## libtool settings +# API versioning +# Link against dependencies +# How to increase version info: +# - only bug fixes implemented: +# bump the version to LTMANGOS_CURRENT:LTMANGOS_REVISION+1:LTMANGOS_AGE +# - augmented the interface: +# bump the version to LTMANGOS_CURRENT+1:0:LTMANGOS_AGE+1 +# - broken old interface: +# bump the version to LTMANGOS_CURRENT+1:0:0 +LTMANGOS_CURRENT = 0 +LTMANGOS_REVISION = 0 +LTMANGOS_AGE = 0 +libmangosscript_la_LIBFLAGS = -version-info $(LTMANGOS_CURRENT):$(LTMANGOS_REVISION):$(LTMANGOS_AGE) + +## Additional files to include when running 'make dist' +# Scripts defaults. +EXTRA_DIST = \ + Scripts/sc_default.cpp \ + Scripts/sc_defines.cpp \ + Scripts/sc_defines.h \ + scriptdev2.conf.dist + +## Additional files to install +sysconf_DATA = \ + scriptdev2.conf.dist + +install-data-hook: + @list='$(sysconf_DATA)'; for p in $$list; do \ + dest=`echo $$p | sed -e s/.dist//`; \ + if test -f $(DESTDIR)$(sysconfdir)/$$dest; then \ + echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/$$dest"; \ + else \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(sysconfdir)/$$dest; \ + fi; \ + done + +clean-local: + rm -f $(sysconf_DATA) diff --git a/ScriptMgr.cpp b/ScriptMgr.cpp new file mode 100644 index 0000000..33984b5 --- /dev/null +++ b/ScriptMgr.cpp @@ -0,0 +1,563 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" +#include "Config/Config.h" +#include "config.h" +#include "Database/DatabaseEnv.h" +#include "DBCStores.h" +#include "ObjectMgr.h" +#include "ProgressBar.h" +#include "../system/ScriptLoader.h" +#include "../system/system.h" + +int num_sc_scripts; +Script *m_scripts[MAX_SCRIPTS]; + +Config SD2Config; + +void FillSpellSummary(); + +void LoadDatabase() +{ + std::string strSD2DBinfo = SD2Config.GetStringDefault("ScriptDev2DatabaseInfo", ""); + + if (strSD2DBinfo.empty()) + { + error_log("SD2: Missing Scriptdev2 database info from configuration file. Load database aborted."); + return; + } + + //Initialize connection to DB + if (SD2Database.Initialize(strSD2DBinfo.c_str())) + { + outstring_log("SD2: ScriptDev2 database at %s initialized.", strSD2DBinfo.c_str()); + outstring_log(""); + + pSystemMgr.LoadVersion(); + pSystemMgr.LoadScriptTexts(); + pSystemMgr.LoadScriptTextsCustom(); + pSystemMgr.LoadScriptGossipTexts(); + pSystemMgr.LoadScriptWaypoints(); + } + else + { + error_log("SD2: Unable to connect to Database. Load database aborted."); + return; + } + + SD2Database.HaltDelayThread(); + +} + +struct TSpellSummary { + uint8 Targets; // set of enum SelectTarget + uint8 Effects; // set of enum SelectEffect +}extern *SpellSummary; + +MANGOS_DLL_EXPORT +void ScriptsFree() +{ + // Free Spell Summary + delete []SpellSummary; + + // Free resources before library unload + for(int i=0; i> Loaded %i C++ Scripts.", num_sc_scripts); +} + +//********************************* +//*** Functions used globally *** + +void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) +{ + if (!pSource) + { + error_log("SD2: DoScriptText entry %i, invalid Source pointer.", iTextEntry); + return; + } + + if (iTextEntry >= 0) + { + error_log("SD2: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", + pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); + + return; + } + + const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry); + + if (!pData) + { + error_log("SD2: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", + pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); + + return; + } + + debug_log("SD2: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", + iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); + + if (pData->uiSoundId) + { + if (GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) + pSource->PlayDirectSound(pData->uiSoundId); + else + error_log("SD2: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); + } + + if (pData->uiEmote) + { + if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) + ((Unit*)pSource)->HandleEmote(pData->uiEmote); + else + error_log("SD2: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId()); + } + + switch(pData->uiType) + { + case CHAT_TYPE_SAY: + pSource->MonsterSay(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); + break; + case CHAT_TYPE_YELL: + pSource->MonsterYell(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); + break; + case CHAT_TYPE_TEXT_EMOTE: + pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0); + break; + case CHAT_TYPE_BOSS_EMOTE: + pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0, true); + break; + case CHAT_TYPE_WHISPER: + { + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID()); + else + error_log("SD2: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + + break; + } + case CHAT_TYPE_BOSS_WHISPER: + { + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true); + else + error_log("SD2: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); + + break; + } + case CHAT_TYPE_ZONE_YELL: + pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); + break; + } +} + +//********************************* +//*** Functions used internally *** + +void Script::RegisterSelf(bool bReportError) +{ + int id = GetScriptId(Name.c_str()); + if (id != 0) + { + m_scripts[id] = this; + ++num_sc_scripts; + } + else + { + if (bReportError) + error_log("SD2: Script registering but ScriptName %s is not assigned in database. Script will not be used.", (this)->Name.c_str()); + + delete this; + } +} + +//******************************** +//*** Functions to be Exported *** + +MANGOS_DLL_EXPORT +char const* ScriptsVersion() +{ + if (!strSD2Version.empty()) + { + strSD2Version.append(_FULLVERSION); + return strSD2Version.c_str(); + } + + return _FULLVERSION; +} + +MANGOS_DLL_EXPORT +bool GossipHello(Player* pPlayer, Creature* pCreature) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pGossipHello) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGossipHello(pPlayer, pCreature); +} + +MANGOS_DLL_EXPORT +bool GOGossipHello(Player *pPlayer, GameObject *pGo) +{ + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGOGossipHello) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGOGossipHello(pPlayer, pGo); +} + +MANGOS_DLL_EXPORT +bool GossipSelect(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + debug_log("SD2: Gossip selection, sender: %u, action: %u", uiSender, uiAction); + + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pGossipSelect) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGossipSelect(pPlayer, pCreature, uiSender, uiAction); +} + +MANGOS_DLL_EXPORT +bool GOGossipSelect(Player *pPlayer, GameObject *pGo, uint32 sender, uint32 action) +{ + debug_log("SD2: GO Gossip selection, sender: %u, action: %u", sender, action); + + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGOGossipSelect) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGOGossipSelect(pPlayer, pGo, sender, action); +} + +MANGOS_DLL_EXPORT +bool GossipSelectWithCode(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode) +{ + debug_log("SD2: Gossip selection with code, sender: %u, action: %u", uiSender, uiAction); + + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pGossipSelectWithCode) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGossipSelectWithCode(pPlayer, pCreature, uiSender, uiAction, sCode); +} + +MANGOS_DLL_EXPORT +bool GOGossipSelectWithCode(Player *pPlayer, GameObject *pGo, uint32 sender, uint32 action, const char* sCode) +{ + debug_log("SD2: GO Gossip selection with code, sender: %u, action: %u", sender, action); + + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGOGossipSelectWithCode) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGOGossipSelectWithCode(pPlayer, pGo, sender, action, sCode); +} + +MANGOS_DLL_EXPORT +bool QuestAccept(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pQuestAccept) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pQuestAccept(pPlayer, pCreature, pQuest); +} + +MANGOS_DLL_EXPORT +bool QuestSelect(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pQuestSelect) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pQuestSelect(pPlayer, pCreature, pQuest); +} + +MANGOS_DLL_EXPORT +bool QuestComplete(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pQuestComplete) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pQuestComplete(pPlayer, pCreature, pQuest); +} + +MANGOS_DLL_EXPORT +bool ChooseReward(Player* pPlayer, Creature* pCreature, const Quest* pQuest, uint32 opt) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pChooseReward) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pChooseReward(pPlayer, pCreature, pQuest, opt); +} + +MANGOS_DLL_EXPORT +uint32 NPCDialogStatus(Player* pPlayer, Creature* pCreature) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->pNPCDialogStatus) + return 100; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pNPCDialogStatus(pPlayer, pCreature); +} + +MANGOS_DLL_EXPORT +uint32 GODialogStatus(Player* pPlayer, GameObject* pGo) +{ + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGODialogStatus) + return 100; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGODialogStatus(pPlayer, pGo); +} + +MANGOS_DLL_EXPORT +bool ItemHello(Player* pPlayer, Item *_Item, const Quest* pQuest) +{ + Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId]; + + if (!tmpscript || !tmpscript->pItemHello) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pItemHello(pPlayer,_Item, pQuest); +} + +MANGOS_DLL_EXPORT +bool ItemQuestAccept(Player* pPlayer, Item *_Item, const Quest* pQuest) +{ + Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId]; + + if (!tmpscript || !tmpscript->pItemQuestAccept) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pItemQuestAccept(pPlayer,_Item, pQuest); +} + +MANGOS_DLL_EXPORT +bool GOHello(Player* pPlayer, GameObject* pGo) +{ + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGOHello) + return false; + + return tmpscript->pGOHello(pPlayer, pGo); +} + +MANGOS_DLL_EXPORT +bool GOQuestAccept(Player* pPlayer, GameObject* pGo, const Quest* pQuest) +{ + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGOQuestAccept) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGOQuestAccept(pPlayer, pGo, pQuest); +} + +MANGOS_DLL_EXPORT +bool GOChooseReward(Player* pPlayer, GameObject* pGo, const Quest* pQuest, uint32 opt) +{ + Script *tmpscript = m_scripts[pGo->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pGOChooseReward) + return false; + + pPlayer->PlayerTalkClass->ClearMenus(); + + return tmpscript->pGOChooseReward(pPlayer, pGo, pQuest,opt); +} + +MANGOS_DLL_EXPORT +bool AreaTrigger(Player* pPlayer, AreaTriggerEntry const* atEntry) +{ + Script *tmpscript = m_scripts[GetAreaTriggerScriptId(atEntry->id)]; + + if (!tmpscript || !tmpscript->pAreaTrigger) + return false; + + return tmpscript->pAreaTrigger(pPlayer, atEntry); +} + +MANGOS_DLL_EXPORT +bool ProcessEventId(uint32 uiEventId, Object* pSource, Object* pTarget, bool bIsStart) +{ + Script *tmpscript = m_scripts[GetEventIdScriptId(uiEventId)]; + if (!tmpscript || !tmpscript->pProcessEventId) + return false; + + // bIsStart may be false, when event is from taxi node events (arrival=false, departure=true) + return tmpscript->pProcessEventId(uiEventId, pSource, pTarget, bIsStart); +} + +MANGOS_DLL_EXPORT +CreatureAI* GetAI(Creature* pCreature) +{ + Script *tmpscript = m_scripts[pCreature->GetScriptId()]; + + if (!tmpscript || !tmpscript->GetAI) + return NULL; + + return tmpscript->GetAI(pCreature); +} + +MANGOS_DLL_EXPORT +bool ItemUse(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) +{ + Script *tmpscript = m_scripts[_Item->GetProto()->ScriptId]; + + if (!tmpscript || !tmpscript->pItemUse) + return false; + + return tmpscript->pItemUse(pPlayer,_Item,targets); +} + +MANGOS_DLL_EXPORT +bool EffectDummyCreature(Unit *pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature *pCreatureTarget) +{ + Script *tmpscript = m_scripts[pCreatureTarget->GetScriptId()]; + + if (!tmpscript || !tmpscript->pEffectDummyCreature) + return false; + + return tmpscript->pEffectDummyCreature(pCaster, spellId, effIndex, pCreatureTarget); +} + +MANGOS_DLL_EXPORT +bool EffectDummyGameObj(Unit *pCaster, uint32 spellId, SpellEffectIndex effIndex, GameObject *pGameObjTarget) +{ + Script *tmpscript = m_scripts[pGameObjTarget->GetGOInfo()->ScriptId]; + + if (!tmpscript || !tmpscript->pEffectDummyGameObj) + return false; + + return tmpscript->pEffectDummyGameObj(pCaster, spellId, effIndex, pGameObjTarget); +} + +MANGOS_DLL_EXPORT +bool EffectDummyItem(Unit *pCaster, uint32 spellId, SpellEffectIndex effIndex, Item *pItemTarget) +{ + Script *tmpscript = m_scripts[pItemTarget->GetProto()->ScriptId]; + + if (!tmpscript || !tmpscript->pEffectDummyItem) + return false; + + return tmpscript->pEffectDummyItem(pCaster, spellId, effIndex, pItemTarget); +} + +MANGOS_DLL_EXPORT +bool EffectAuraDummy(const Aura* pAura, bool apply) +{ + Script *tmpscript = m_scripts[((Creature*)pAura->GetTarget())->GetScriptId()]; + + if (!tmpscript || !tmpscript->pEffectAuraDummy) + return false; + + return tmpscript->pEffectAuraDummy(pAura, apply); +} + +MANGOS_DLL_EXPORT +InstanceData* CreateInstanceData(Map *map) +{ + if (!map->IsDungeon()) + return NULL; + + Script *tmpscript = m_scripts[((InstanceMap*)map)->GetScriptId()]; + if (!tmpscript || !tmpscript->GetInstanceData) + return NULL; + + return tmpscript->GetInstanceData(map); +} diff --git a/ScriptMgr.h b/ScriptMgr.h new file mode 100644 index 0000000..66d7685 --- /dev/null +++ b/ScriptMgr.h @@ -0,0 +1,84 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_SCRIPTMGR_H +#define SC_SCRIPTMGR_H + +#include "Common.h" +#include "DBCStructure.h" + +class Player; +class Creature; +class CreatureAI; +class InstanceData; +class Quest; +class Item; +class GameObject; +class SpellCastTargets; +class Map; +class Unit; +class WorldObject; +class Aura; +class Object; + +#define MAX_SCRIPTS 5000 //72 bytes each (approx 351kb) +#define VISIBLE_RANGE (166.0f) //MAX visible range (size of grid) +#define DEFAULT_TEXT "" + +struct Script +{ + Script() : + pGossipHello(NULL), pGOGossipHello(NULL), pGossipSelect(NULL), pGOGossipSelect(NULL), + pGossipSelectWithCode(NULL), pGOGossipSelectWithCode(NULL), + pQuestSelect(NULL), pQuestComplete(NULL), pNPCDialogStatus(NULL), pGODialogStatus(NULL), + pChooseReward(NULL), pItemHello(NULL), pGOHello(NULL), pAreaTrigger(NULL), pProcessEventId(NULL), pItemQuestAccept(NULL), + pQuestAccept(NULL), pGOQuestAccept(NULL), pGOChooseReward(NULL), pItemUse(NULL), + pEffectDummyCreature(NULL), pEffectDummyGameObj(NULL), pEffectDummyItem(NULL), pEffectAuraDummy(NULL), + GetAI(NULL), GetInstanceData(NULL) + {} + + std::string Name; + + //Methods to be scripted + bool (*pGossipHello )(Player*, Creature*); + bool (*pGOGossipHello )(Player*, GameObject*); + bool (*pQuestAccept )(Player*, Creature*, const Quest*); + bool (*pGossipSelect )(Player*, Creature*, uint32, uint32); + bool (*pGOGossipSelect )(Player*, GameObject*, uint32, uint32); + bool (*pGossipSelectWithCode )(Player*, Creature*, uint32, uint32, const char*); + bool (*pGOGossipSelectWithCode )(Player*, GameObject*, uint32, uint32, const char*); + bool (*pQuestSelect )(Player*, Creature*, const Quest*); + bool (*pQuestComplete )(Player*, Creature*, const Quest*); + uint32 (*pNPCDialogStatus )(Player*, Creature*); + uint32 (*pGODialogStatus )(Player*, GameObject*); + bool (*pChooseReward )(Player*, Creature*, const Quest*, uint32); + bool (*pItemHello )(Player*, Item*, const Quest*); + bool (*pGOHello )(Player*, GameObject*); + bool (*pAreaTrigger )(Player*, AreaTriggerEntry const*); + bool (*pProcessEventId )(uint32, Object*, Object*, bool); + bool (*pItemQuestAccept )(Player*, Item*, const Quest*); + bool (*pGOQuestAccept )(Player*, GameObject*, const Quest*); + bool (*pGOChooseReward )(Player*, GameObject*, const Quest*, uint32); + bool (*pItemUse )(Player*, Item*, SpellCastTargets const&); + bool (*pEffectDummyCreature )(Unit*, uint32, SpellEffectIndex, Creature*); + bool (*pEffectDummyGameObj )(Unit*, uint32, SpellEffectIndex, GameObject*); + bool (*pEffectDummyItem )(Unit*, uint32, SpellEffectIndex, Item*); + bool (*pEffectAuraDummy )(const Aura*, bool); + + CreatureAI* (*GetAI)(Creature*); + InstanceData* (*GetInstanceData)(Map*); + + void RegisterSelf(bool bReportError = true); +}; + +//Generic scripting text function +void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget = NULL); + +#if COMPILER == COMPILER_GNU +#define FUNC_PTR(name,callconvention,returntype,parameters) typedef returntype(*name)parameters __attribute__ ((callconvention)); +#else +#define FUNC_PTR(name, callconvention, returntype, parameters) typedef returntype(callconvention *name)parameters; +#endif + +#endif diff --git a/VC100/100ScriptDev2.vcxproj b/VC100/100ScriptDev2.vcxproj new file mode 100644 index 0000000..a7eabb3 --- /dev/null +++ b/VC100/100ScriptDev2.vcxproj @@ -0,0 +1,772 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + + ScriptDev2 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96} + ScriptDev2 + Win32Proj + + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + ..\..\..\..\bin\win32_debug\ + .\ScriptDev2__$(Platform)_$(Configuration)\ + true + ..\..\..\..\bin\x64_debug\ + .\ScriptDev2__$(Platform)_$(Configuration)\ + true + ..\..\..\..\bin\win32_release\ + .\ScriptDev2__$(Platform)_$(Configuration)\ + false + ..\..\..\..\bin\x64_release\ + .\ScriptDev2__$(Platform)_$(Configuration)\ + false + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + mangosscript + mangosscript + mangosscript + mangosscript + + + + Disabled + ..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\base\;..\..\..\..\dep\ACE_wrappers\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + precompiled.h + Level3 + ProgramDatabase + true + true + true + + + mangosd.lib;ACEd.lib;framework.lib;%(AdditionalDependencies) + ..\..\..\..\win\VC100\mangosd__Win32_Debug;..\..\..\..\win\VC100\framework__Win32_Debug;..\..\..\..\dep\lib\win32_debug\;%(AdditionalLibraryDirectories) + true + Windows + false + + + $(OutDir)mangosscript.lib + MachineX86 + + + + + X64 + + + Disabled + ..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\base\;..\..\..\..\dep\ACE_wrappers\;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;MANGOS_DEBUG;_WINDOWS;_USRDLL;SCRIPT;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebugDLL + Use + precompiled.h + Level3 + ProgramDatabase + true + true + true + + + mangosd.lib;ACEd.lib;framework.lib;%(AdditionalDependencies) + ..\..\..\..\win\VC100\mangosd__x64_Debug;..\..\..\..\win\VC100\framework__x64_Debug;..\..\..\..\dep\lib\x64_Debug\;%(AdditionalLibraryDirectories) + true + Windows + false + + + $(OutDir)mangosscript.lib + MachineX64 + + + + + /MP %(AdditionalOptions) + ..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\base\;..\..\..\..\dep\ACE_wrappers\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT;_SECURE_SCL=0;%(PreprocessorDefinitions) + false + MultiThreadedDLL + Use + precompiled.h + Level3 + ProgramDatabase + true + true + true + + + mangosd.lib;ACE.lib;framework.lib;%(AdditionalDependencies) + ..\..\..\..\win\VC100\mangosd__Win32_Release;..\..\..\..\win\VC100\framework__Win32_Release;..\..\..\..\dep\lib\win32_release\;%(AdditionalLibraryDirectories) + true + Windows + true + true + false + + + $(OutDir)mangosscript.lib + + + + + X64 + + + /MP %(AdditionalOptions) + ..\..\..\..\dep\include\;..\..\..\shared\;..\..\..\framework\;..\..\..\game\;..\include\;..\base\;..\..\..\..\dep\ACE_wrappers\;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;SCRIPT;_SECURE_SCL=0;%(PreprocessorDefinitions) + MultiThreadedDLL + Use + precompiled.h + Level3 + ProgramDatabase + true + true + true + + + mangosd.lib;ACE.lib;framework.lib;%(AdditionalDependencies) + ..\..\..\..\win\VC100\mangosd__x64_Release;..\..\..\..\win\VC100\framework__x64_Release;..\..\..\..\dep\lib\x64_release\;%(AdditionalLibraryDirectories) + true + Windows + true + true + false + + + $(OutDir)mangosscript.lib + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Extracting revision + cd "$(SolutionDir)" +"$(SolutionDir)..\..\..\win\VC100\genrevision__Win32_$(Configuration)\genrevision.exe" + + .svn/entries;%(AdditionalInputs) + revision.h;%(Outputs) + Extracting revision + cd "$(SolutionDir)" +"$(SolutionDir)..\..\..\win\VC100\genrevision__Win32_$(Configuration)\genrevision.exe" + + .svn/entries;%(AdditionalInputs) + revision.h;%(Outputs) + Extracting revision + cd "$(SolutionDir)" +"$(SolutionDir)..\..\..\win\VC100\genrevision__Win32_$(Configuration)\genrevision.exe" + + .svn/entries;%(AdditionalInputs) + revision.h;%(Outputs) + Extracting revision + cd "$(SolutionDir)" +"$(SolutionDir)..\..\..\win\VC100\genrevision__Win32_$(Configuration)\genrevision.exe" + + .svn/entries;%(AdditionalInputs) + revision.h;%(Outputs) + + + + + + + \ No newline at end of file diff --git a/VC100/100ScriptDev2.vcxproj.filters b/VC100/100ScriptDev2.vcxproj.filters new file mode 100644 index 0000000..53595c0 --- /dev/null +++ b/VC100/100ScriptDev2.vcxproj.filters @@ -0,0 +1,1869 @@ + + + + + {3b1307a9-bc58-4773-9a93-0e9ceff55c82} + + + {b7b35df3-4231-4370-aed5-5859ab4c312e} + + + {ced0a1e2-6867-4f01-a762-390a3d1f01d3} + + + {af3d4b4d-a585-41c4-ba95-79669a614ea8} + + + {ca2551e0-68d0-4331-88f3-ab0cdaa2bf9a} + + + {45c59280-02fb-482f-859b-bd47cc230f0f} + + + {5631f38e-66c8-4efd-ad3a-2834fbb49a6e} + + + {31605090-12b9-4d42-a5e9-1cbfac8ab384} + + + {08fb5b22-710d-46d6-9893-f567aa75a5e6} + + + {cef5c3c5-f434-4b9f-9bad-8c106d46c755} + + + {66bc2cec-8372-4191-991c-1c23275fa13c} + + + {af465469-5a16-4908-aa08-39c77d02cd88} + + + {920d1832-b347-4afd-bd05-4c943e5555f0} + + + {6ffd42e5-ac49-4635-8087-77ad2b7b0866} + + + {dd4995a8-6d86-4f21-82bc-a18acc2c688f} + + + {2a3a25e5-51f1-4ab3-a1a0-1b9ec9c45d1a} + + + {7a028ad9-afa1-42ea-b147-20a40c5e716c} + + + {66401dac-d94c-4ed6-b912-229dda0906d6} + + + {385f26dc-dcaf-4022-921d-3a562617bf93} + + + {25be39dd-536d-450d-ac94-6372d37a4fae} + + + {1d718eaa-2a8d-4cb9-9abf-17fcf0d91f83} + + + {c929f54b-22dd-49b4-862c-92dfa9a2d1f7} + + + {60b91cfe-7dff-40de-9957-41f8d03144cc} + + + {22eca3e6-662f-4c53-9344-6e749c09c86b} + + + {070541ef-a813-43f5-a8a6-e6674fe1a47e} + + + {5cda7bda-399b-46b7-8bc2-5786f0202fa2} + + + {226d4dc8-830b-4249-b28a-313ac21080a9} + + + {404b30fd-bdaa-44d1-ab3a-384886ebb8ec} + + + {5833dbce-1fa8-49eb-b678-145a2d58a067} + + + {dc38d3fe-d1fe-49f2-bd8f-758cd270dd62} + + + {2552ab59-1f73-4778-a6db-6f03e405622d} + + + {8206776b-4d43-431d-bca5-5f6cff157ea4} + + + {02135a7c-33cc-444e-af90-48a5193e5a6f} + + + {014ada9a-13bf-4540-a0ce-5132bdc36fcf} + + + {9feb59d0-e6bd-4328-9a50-7ddb9852936e} + + + {00f03f8d-4af1-40d9-a95a-e2dc1a81ca7d} + + + {de2e959a-1ef4-41ef-9235-15a1f3f8a19d} + + + {8f8a60e0-223e-4517-918c-243e523a7892} + + + {416ccfc8-a1bb-43a5-b202-d7656981094a} + + + {ba031a13-787e-41da-bcaf-1986fdea8069} + + + {0412262e-b05b-4827-adef-97507204cb69} + + + {e775610e-fa3c-4355-9c4c-473a6a5e57d5} + + + {6c5f7fd4-671b-4cba-aa95-7758b93dc844} + + + {71e87e58-3b30-41e7-8f8a-16886508a4d9} + + + {3cf8e088-da94-4561-993f-2970908d6642} + + + {bc0156b2-6544-4ebc-9ed6-fe45ac1902a4} + + + {b59c73a8-c480-43b2-8a2e-65f5a54978eb} + + + {5eb6a84a-97e6-477e-97e3-23681f29f675} + + + {d7e0e45a-fd89-48a6-8d24-f4922058160e} + + + {71617682-fe62-4d7c-a2de-7181fb3f46f6} + + + {9c5d9a0f-8967-4cf6-a047-3b724f81dc29} + + + {42501e94-f91e-40be-a02a-472b5ca1e22c} + + + {aac6b8be-6055-4d7d-a50a-41650b8d464e} + + + {e7ee3113-f4d0-4e28-acc7-dc80f42d41df} + + + {e603d4b3-3c2f-4011-aa2b-040243163d3f} + + + {36c79ad7-420c-4909-8da3-c90d3cc83b31} + + + {d47410b0-3184-40e2-8704-cea9b97e20ed} + + + {1b2f0d99-82b0-4a96-aaac-c485830eb1b3} + + + {fd594031-4dc2-40de-b37b-93063ee6e3e9} + + + {ef27a557-e12d-4b02-9e86-c258329f201e} + + + {b7e4ad7d-8515-4981-ae27-9e542c223618} + + + {04b1d59c-38b6-4b5c-a50d-b9ff1d39bb30} + + + {ee364414-732a-4aad-820f-a5b73cb8b093} + + + {638d5426-652e-4d1f-9abe-3ed95d7e7e69} + + + {a21893a5-0f34-4a73-b0aa-49b175822834} + + + {728148f8-18a0-4606-a2ec-2c9eae4e5e7e} + + + {88c327d5-0768-465f-b954-30eca0d31f45} + + + {b20efa19-1e16-42e4-bc29-a9c8e282d17c} + + + {fec1fbfa-5119-4bb0-98bc-f8d4583521f7} + + + {1cb43523-dc33-4c49-a5b7-6e700fe0ecd6} + + + {7289cc07-6956-4b09-8dc5-753c82abe8c9} + + + {e834cf7b-88ad-4bae-9fc8-8e027136c63b} + + + {cfb08e82-63e6-49ca-bff2-533f8647797b} + + + {2be3084e-c5c0-4e2f-bbb4-2ebb22bfff19} + + + {6dc08e92-3e86-4a7f-bab9-9a8cec6a201b} + + + {01da56d1-ee04-455c-846c-4e53869314f6} + + + {5e79ca74-cd29-47ff-a08e-3fada858ddd7} + + + {32b92545-4821-4cc8-ae39-f631b0176d46} + + + {044e4dbc-e2fc-437c-b359-b6fb5a3439ff} + + + {4cbcf193-4d98-4518-a9c4-6c8b4bedbf44} + + + {5c32221e-3532-4c32-bdba-9a85213006af} + + + {2df99085-aee2-4202-b4d1-38a5cc35f3e2} + + + {0a109c31-6dd3-4030-8d6c-6c0e147481be} + + + {ddada980-2eed-4f2b-a9f7-dbb9cca7ca3d} + + + {d6843352-6425-48da-85b6-6b26f6217ba8} + + + {6a68396b-343f-4c79-938c-93741acdeb41} + + + {974fc97c-e585-442c-b35e-b21a17804619} + + + {ba709b56-d5db-4730-9591-79b8f9788ca1} + + + {1fa90250-9c5b-450c-be64-d9eee910c4a8} + + + {7b3c1c18-03e9-493e-a364-5beb1a6936eb} + + + {575420cc-581f-4d08-a9da-7814f221ab47} + + + {9c5997ee-accc-4737-815f-b031d422577b} + + + {579f2f5c-acf1-410a-bce6-d353d6912546} + + + {04e4571d-55ee-4f2e-ac4e-46fc2610341f} + + + {79a3e62b-bd96-4d16-8c23-bda17f968d19} + + + {ca7213e9-56c1-4084-a48b-19ff57dee433} + + + {2fd46769-c050-4e47-9533-461ef8695d6a} + + + {90f3df6a-a1d0-4a6e-b8d7-d1d993fc795b} + + + {e35abead-2389-4eb9-88bd-70e6fe5636b5} + + + + + base + + + base + + + base + + + scripts\battlegrounds + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackrock_spire + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\blackwing_lair + + + scripts\eastern_kingdoms\deadmines + + + scripts\eastern_kingdoms\deadmines + + + scripts\eastern_kingdoms\gnomeregan + + + scripts\eastern_kingdoms\gnomeregan + + + scripts\eastern_kingdoms\gnomeregan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\scarlet_enclave + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\shadowfang_keep + + + scripts\eastern_kingdoms\shadowfang_keep + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\sunken_temple + + + scripts\eastern_kingdoms\sunken_temple + + + scripts\eastern_kingdoms\sunwell_plateau + + + scripts\eastern_kingdoms\sunwell_plateau + + + scripts\eastern_kingdoms\sunwell_plateau + + + scripts\eastern_kingdoms\uldaman + + + scripts\eastern_kingdoms\uldaman + + + scripts\eastern_kingdoms\uldaman + + + scripts\eastern_kingdoms\uldaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\eastern_kingdoms\zulgurub + + + scripts\examples + + + scripts\examples + + + scripts\examples + + + scripts\examples + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor + + + scripts\kalimdor\blackfathom_deeps + + + scripts\kalimdor\caverns_of_time\culling_of_stratholme + + + scripts\kalimdor\caverns_of_time\culling_of_stratholme + + + scripts\kalimdor\caverns_of_time\dark_portal + + + scripts\kalimdor\caverns_of_time\dark_portal + + + scripts\kalimdor\caverns_of_time\dark_portal + + + scripts\kalimdor\caverns_of_time\dark_portal + + + scripts\kalimdor\caverns_of_time\dark_portal + + + scripts\kalimdor\caverns_of_time\hyjal + + + scripts\kalimdor\caverns_of_time\hyjal + + + scripts\kalimdor\caverns_of_time\hyjal + + + scripts\kalimdor\caverns_of_time\hyjal + + + scripts\kalimdor\caverns_of_time\old_hillsbrad + + + scripts\kalimdor\caverns_of_time\old_hillsbrad + + + scripts\kalimdor\caverns_of_time\old_hillsbrad + + + scripts\kalimdor\caverns_of_time\old_hillsbrad + + + scripts\kalimdor\caverns_of_time\old_hillsbrad + + + scripts\kalimdor\maraudon + + + scripts\kalimdor\maraudon + + + scripts\kalimdor\maraudon + + + scripts\kalimdor\maraudon + + + scripts\kalimdor\onyxias_lair + + + scripts\kalimdor\onyxias_lair + + + scripts\kalimdor\razorfen_downs + + + scripts\kalimdor\razorfen_downs + + + scripts\kalimdor\razorfen_kraul + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\wailing_caverns + + + scripts\kalimdor\zulfarrak + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend + + + scripts\northrend\azjol-nerub\ahnkahet + + + scripts\northrend\azjol-nerub\ahnkahet + + + scripts\northrend\azjol-nerub\ahnkahet + + + scripts\northrend\azjol-nerub\ahnkahet + + + scripts\northrend\azjol-nerub\ahnkahet + + + scripts\northrend\azjol-nerub\azjol-nerub + + + scripts\northrend\azjol-nerub\azjol-nerub + + + scripts\northrend\azjol-nerub\azjol-nerub + + + scripts\northrend\azjol-nerub\azjol-nerub + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\draktharon_keep + + + scripts\northrend\draktharon_keep + + + scripts\northrend\draktharon_keep + + + scripts\northrend\gundrak + + + scripts\northrend\gundrak + + + scripts\northrend\gundrak + + + scripts\northrend\gundrak + + + scripts\northrend\gundrak + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\naxxramas + + + scripts\northrend\nexus\nexus + + + scripts\northrend\nexus\nexus + + + scripts\northrend\nexus\nexus + + + scripts\northrend\nexus\nexus + + + scripts\northrend\nexus\nexus + + + scripts\northrend\obsidian_sanctum + + + scripts\northrend\obsidian_sanctum + + + scripts\northrend\ulduar\halls_of_lightning + + + scripts\northrend\ulduar\halls_of_lightning + + + scripts\northrend\ulduar\halls_of_lightning + + + scripts\northrend\ulduar\halls_of_lightning + + + scripts\northrend\ulduar\halls_of_lightning + + + scripts\northrend\ulduar\halls_of_stone + + + scripts\northrend\ulduar\halls_of_stone + + + scripts\northrend\ulduar\halls_of_stone + + + scripts\northrend\ulduar\halls_of_stone + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\utgarde_keep\utgarde_keep + + + scripts\northrend\utgarde_keep\utgarde_keep + + + scripts\northrend\utgarde_keep\utgarde_keep + + + scripts\northrend\utgarde_keep\utgarde_keep + + + scripts\northrend\utgarde_keep\utgarde_keep + + + scripts\northrend\utgarde_keep\utgarde_pinnacle + + + scripts\northrend\utgarde_keep\utgarde_pinnacle + + + scripts\northrend\utgarde_keep\utgarde_pinnacle + + + scripts\northrend\utgarde_keep\utgarde_pinnacle + + + scripts\northrend\utgarde_keep\utgarde_pinnacle + + + scripts\northrend\violet_hold + + + scripts\northrend\violet_hold + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\icecrown_citadel + + + scripts\northrend\icecrown_citadel\frozen_halls\pit_of_saron + + + scripts\northrend\icecrown_citadel\frozen_halls\pit_of_saron + + + scripts\northrend\icecrown_citadel\frozen_halls\pit_of_saron + + + scripts\northrend\icecrown_citadel\frozen_halls\halls_of_reflection + + + scripts\northrend\icecrown_citadel\frozen_halls\halls_of_reflection + + + scripts\northrend\icecrown_citadel\frozen_halls\halls_of_reflection + + + scripts\northrend\icecrown_citadel\frozen_halls\forge_of_souls + + + scripts\northrend\icecrown_citadel\frozen_halls\forge_of_souls + + + scripts\northrend\icecrown_citadel\frozen_halls\forge_of_souls + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland + + + scripts\outland\auchindoun\auchenai_crypts + + + scripts\outland\auchindoun\mana_tombs + + + scripts\outland\auchindoun\mana_tombs + + + scripts\outland\auchindoun\sethekk_halls + + + scripts\outland\auchindoun\sethekk_halls + + + scripts\outland\auchindoun\sethekk_halls + + + scripts\outland\auchindoun\shadow_labyrinth + + + scripts\outland\auchindoun\shadow_labyrinth + + + scripts\outland\auchindoun\shadow_labyrinth + + + scripts\outland\auchindoun\shadow_labyrinth + + + scripts\outland\auchindoun\shadow_labyrinth + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\black_temple + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\steam_vault + + + scripts\outland\coilfang_reservoir\steam_vault + + + scripts\outland\coilfang_reservoir\steam_vault + + + scripts\outland\coilfang_reservoir\steam_vault + + + scripts\outland\coilfang_reservoir\underbog + + + scripts\outland\gruuls_lair + + + scripts\outland\gruuls_lair + + + scripts\outland\gruuls_lair + + + scripts\outland\hellfire_citadel\blood_furnace + + + scripts\outland\hellfire_citadel\blood_furnace + + + scripts\outland\hellfire_citadel\blood_furnace + + + scripts\outland\hellfire_citadel\blood_furnace + + + scripts\outland\hellfire_citadel\hellfire_ramparts + + + scripts\outland\hellfire_citadel\hellfire_ramparts + + + scripts\outland\hellfire_citadel\hellfire_ramparts + + + scripts\outland\hellfire_citadel\hellfire_ramparts + + + scripts\outland\hellfire_citadel\magtheridons_lair + + + scripts\outland\hellfire_citadel\magtheridons_lair + + + scripts\outland\hellfire_citadel\shattered_halls + + + scripts\outland\hellfire_citadel\shattered_halls + + + scripts\outland\hellfire_citadel\shattered_halls + + + scripts\outland\hellfire_citadel\shattered_halls + + + scripts\outland\tempest_keep\arcatraz + + + scripts\outland\tempest_keep\arcatraz + + + scripts\outland\tempest_keep\arcatraz + + + scripts\outland\tempest_keep\botanica + + + scripts\outland\tempest_keep\botanica + + + scripts\outland\tempest_keep\botanica + + + scripts\outland\tempest_keep\the_eye + + + scripts\outland\tempest_keep\the_eye + + + scripts\outland\tempest_keep\the_eye + + + scripts\outland\tempest_keep\the_eye + + + scripts\outland\tempest_keep\the_eye + + + scripts\outland\tempest_keep\the_mechanar + + + scripts\outland\tempest_keep\the_mechanar + + + scripts\outland\tempest_keep\the_mechanar + + + scripts\outland\tempest_keep\the_mechanar + + + scripts\outland\tempest_keep\the_mechanar + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + scripts\world + + + include + + + include + + + include + + + include + + + system + + + system + + + + scripts\northrend\ruby_sanctum + + + scripts\northrend\ruby_sanctum + + + scripts\northrend\ruby_sanctum + + + scripts\northrend\ruby_sanctum + + + + + base + + + base + + + base + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\blackrock_depths + + + scripts\eastern_kingdoms\deadmines + + + scripts\eastern_kingdoms\gnomeregan + + + scripts\eastern_kingdoms\karazhan + + + scripts\eastern_kingdoms\magisters_terrace + + + scripts\eastern_kingdoms\molten_core + + + scripts\eastern_kingdoms\scarlet_monastery + + + scripts\eastern_kingdoms\scholomance + + + scripts\eastern_kingdoms\shadowfang_keep + + + scripts\eastern_kingdoms\stratholme + + + scripts\eastern_kingdoms\sunken_temple + + + scripts\eastern_kingdoms\sunwell_plateau + + + scripts\eastern_kingdoms\uldaman + + + scripts\eastern_kingdoms\zulaman + + + scripts\eastern_kingdoms\zulgurub + + + scripts\kalimdor\blackfathom_deeps + + + scripts\kalimdor\caverns_of_time\culling_of_stratholme + + + scripts\kalimdor\caverns_of_time\dark_portal + + + scripts\kalimdor\caverns_of_time\hyjal + + + scripts\kalimdor\caverns_of_time\hyjal + + + scripts\kalimdor\caverns_of_time\old_hillsbrad + + + scripts\kalimdor\onyxias_lair + + + scripts\kalimdor\razorfen_kraul + + + scripts\kalimdor\ruins_of_ahnqiraj + + + scripts\kalimdor\temple_of_ahnqiraj + + + scripts\kalimdor\wailing_caverns + + + scripts\northrend\azjol-nerub\ahnkahet + + + scripts\northrend\azjol-nerub\azjol-nerub + + + scripts\northrend\crusaders_coliseum\trial_of_the_crusader + + + scripts\northrend\gundrak + + + scripts\northrend\icecrown_citadel\frozen_halls\forge_of_souls + + + scripts\northrend\naxxramas + + + scripts\northrend\nexus\nexus + + + scripts\northrend\obsidian_sanctum + + + scripts\northrend\ulduar\halls_of_lightning + + + scripts\northrend\ulduar\halls_of_stone + + + scripts\northrend\ulduar\ulduar + + + scripts\northrend\utgarde_keep\utgarde_keep + + + scripts\northrend\utgarde_keep\utgarde_pinnacle + + + scripts\northrend\violet_hold + + + scripts\outland\auchindoun\sethekk_halls + + + scripts\outland\auchindoun\shadow_labyrinth + + + scripts\outland\black_temple + + + scripts\outland\coilfang_reservoir\serpent_shrine + + + scripts\outland\coilfang_reservoir\steam_vault + + + scripts\outland\gruuls_lair + + + scripts\outland\hellfire_citadel\blood_furnace + + + scripts\outland\hellfire_citadel\hellfire_ramparts + + + scripts\outland\hellfire_citadel\magtheridons_lair + + + scripts\outland\hellfire_citadel\shattered_halls + + + scripts\outland\tempest_keep\arcatraz + + + scripts\outland\tempest_keep\the_eye + + + scripts\outland\tempest_keep\the_mechanar + + + include + + + include + + + include + + + include + + + include + + + system + + + system + + + + + + + + \ No newline at end of file diff --git a/VC80/80ScriptDev2.vcproj b/VC80/80ScriptDev2.vcproj new file mode 100644 index 0000000..79f33f6 --- /dev/null +++ b/VC80/80ScriptDev2.vcproj @@ -0,0 +1,2924 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/VC90/90ScriptDev2.vcproj b/VC90/90ScriptDev2.vcproj new file mode 100644 index 0000000..d701a13 --- /dev/null +++ b/VC90/90ScriptDev2.vcproj @@ -0,0 +1,2967 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/base/escort_ai.cpp b/base/escort_ai.cpp new file mode 100644 index 0000000..ecc4a62 --- /dev/null +++ b/base/escort_ai.cpp @@ -0,0 +1,519 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +/* ScriptData +SDName: EscortAI +SD%Complete: 100 +SDComment: +SDCategory: Npc +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" + +const float MAX_PLAYER_DISTANCE = 66.0f; + +enum +{ + POINT_LAST_POINT = 0xFFFFFF, + POINT_HOME = 0xFFFFFE +}; + +npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), + m_uiPlayerGUID(0), + m_uiPlayerCheckTimer(1000), + m_uiWPWaitTimer(2500), + m_uiEscortState(STATE_ESCORT_NONE), + m_bIsRunning(false), + m_pQuestForEscort(NULL), + m_bCanInstantRespawn(false), + m_bCanReturnToStart(false) +{} + +bool npc_escortAI::IsVisible(Unit* pWho) const +{ + if (!pWho) + return false; + + return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->isVisibleForOrDetect(m_creature, m_creature, true); +} + +void npc_escortAI::AttackStart(Unit* pWho) +{ + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + if (IsCombatMovement()) + m_creature->GetMotionMaster()->MoveChase(pWho); + } +} + +void npc_escortAI::EnterCombat(Unit* pEnemy) +{ + if (!pEnemy) + return; + + Aggro(pEnemy); +} + +void npc_escortAI::Aggro(Unit* pEnemy) +{ +} + +//see followerAI +bool npc_escortAI::AssistPlayerInCombat(Unit* pWho) +{ + if (!pWho->getVictim()) + return false; + + // experimental (unknown) flag not present + if (!(m_creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_CAN_ASSIST)) + return false; + + // unit state prevents (similar check is done in CanInitiateAttack which also include checking unit_flags. We skip those here) + if (m_creature->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED)) + return false; + + // victim of pWho is not a player + if (!pWho->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) + return false; + + // never attack friendly + if (m_creature->IsFriendlyTo(pWho)) + return false; + + // too far away and no free sight? + if (m_creature->IsWithinDistInMap(pWho, MAX_PLAYER_DISTANCE) && m_creature->IsWithinLOSInMap(pWho)) + { + // already fighting someone? + if (!m_creature->getVictim()) + { + AttackStart(pWho); + return true; + } + else + { + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + return true; + } + } + + return false; +} + +void npc_escortAI::MoveInLineOfSight(Unit* pWho) +{ + if (pWho->isTargetableForAttack() && pWho->isInAccessablePlaceFor(m_creature)) + { + // AssistPlayerInCombat can start attack, so return if true + if (HasEscortState(STATE_ESCORT_ESCORTING) && AssistPlayerInCombat(pWho)) + return; + + if (!m_creature->CanInitiateAttack()) + return; + + if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + if (m_creature->IsHostileTo(pWho)) + { + float fAttackRadius = m_creature->GetAttackDistance(pWho); + if (m_creature->IsWithinDistInMap(pWho, fAttackRadius) && m_creature->IsWithinLOSInMap(pWho)) + { + if (!m_creature->getVictim()) + { + pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else if (m_creature->GetMap()->IsDungeon()) + { + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + } + } + } + } +} + +void npc_escortAI::JustDied(Unit* pKiller) +{ + if (!HasEscortState(STATE_ESCORT_ESCORTING) || !m_uiPlayerGUID || !m_pQuestForEscort) + return; + + if (Player* pPlayer = GetPlayerForEscort()) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (pMember->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pMember->FailQuest(m_pQuestForEscort->GetQuestId()); + } + } + } + else + { + if (pPlayer->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(m_pQuestForEscort->GetQuestId()); + } + } +} + +void npc_escortAI::JustRespawned() +{ + m_uiEscortState = STATE_ESCORT_NONE; + + if (!IsCombatMovement()) + SetCombatMovement(true); + + //add a small delay before going to first waypoint, normal in near all cases + m_uiWPWaitTimer = 2500; + + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + + Reset(); +} + +void npc_escortAI::EnterEvadeMode() +{ + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->SetLootRecipient(NULL); + + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + debug_log("SD2: EscortAI has left combat and is now returning to CombatStartPosition."); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + { + AddEscortState(STATE_ESCORT_RETURNING); + + float fPosX, fPosY, fPosZ; + m_creature->GetCombatStartPosition(fPosX, fPosY, fPosZ); + m_creature->GetMotionMaster()->MovePoint(POINT_LAST_POINT, fPosX, fPosY, fPosZ); + } + } + else + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + + Reset(); +} + +bool npc_escortAI::IsPlayerOrGroupInRange() +{ + if (Player* pPlayer = GetPlayerForEscort()) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) + { + return true; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, MAX_PLAYER_DISTANCE)) + return true; + } + } + return false; +} + +void npc_escortAI::UpdateAI(const uint32 uiDiff) +{ + //Waypoint Updating + if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_creature->getVictim() && m_uiWPWaitTimer && !HasEscortState(STATE_ESCORT_RETURNING)) + { + if (m_uiWPWaitTimer <= uiDiff) + { + //End of the line + if (CurrentWP == WaypointList.end()) + { + debug_log("SD2: EscortAI reached end of waypoints"); + + if (m_bCanReturnToStart) + { + float fRetX, fRetY, fRetZ; + m_creature->GetRespawnCoord(fRetX, fRetY, fRetZ); + + m_creature->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ); + + m_uiWPWaitTimer = 0; + + debug_log("SD2: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); + return; + } + + if (m_bCanInstantRespawn) + { + m_creature->SetDeathState(JUST_DIED); + m_creature->Respawn(); + } + else + m_creature->ForcedDespawn(); + + return; + } + + if (!HasEscortState(STATE_ESCORT_PAUSED)) + { + m_creature->GetMotionMaster()->MovePoint(CurrentWP->uiId, CurrentWP->fX, CurrentWP->fY, CurrentWP->fZ); + debug_log("SD2: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->uiId, CurrentWP->fX, CurrentWP->fY, CurrentWP->fZ); + + WaypointStart(CurrentWP->uiId); + + m_uiWPWaitTimer = 0; + } + } + else + m_uiWPWaitTimer -= uiDiff; + } + + //Check if player or any member of his group is within range + if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPlayerGUID && !m_creature->getVictim() && !HasEscortState(STATE_ESCORT_RETURNING)) + { + if (m_uiPlayerCheckTimer < uiDiff) + { + if (!HasEscortState(STATE_ESCORT_PAUSED) && !IsPlayerOrGroupInRange()) + { + debug_log("SD2: EscortAI failed because player/group was to far away or not found"); + + if (m_bCanInstantRespawn) + { + m_creature->SetDeathState(JUST_DIED); + m_creature->Respawn(); + } + else + m_creature->ForcedDespawn(); + + return; + } + + m_uiPlayerCheckTimer = 1000; + } + else + m_uiPlayerCheckTimer -= uiDiff; + } + + UpdateEscortAI(uiDiff); +} + +void npc_escortAI::UpdateEscortAI(const uint32 uiDiff) +{ + //Check if we have a current target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); +} + +void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) +{ + if (uiMoveType != POINT_MOTION_TYPE || !HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + //Combat start position reached, continue waypoint movement + if (uiPointId == POINT_LAST_POINT) + { + debug_log("SD2: EscortAI has returned to original position before combat"); + + if (m_bIsRunning && m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + else if (!m_bIsRunning && !m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + + RemoveEscortState(STATE_ESCORT_RETURNING); + + if (!m_uiWPWaitTimer) + m_uiWPWaitTimer = 1; + } + else if (uiPointId == POINT_HOME) + { + debug_log("SD2: EscortAI has returned to original home location and will continue from beginning of waypoint list."); + + CurrentWP = WaypointList.begin(); + m_uiWPWaitTimer = 1; + } + else + { + //Make sure that we are still on the right waypoint + if (CurrentWP->uiId != uiPointId) + { + error_log("SD2: EscortAI reached waypoint out of order %u, expected %u.", uiPointId, CurrentWP->uiId); + return; + } + + debug_log("SD2: EscortAI waypoint %u reached.", CurrentWP->uiId); + + //Call WP function + WaypointReached(CurrentWP->uiId); + + m_uiWPWaitTimer = CurrentWP->uiWaitTime + 1; + + ++CurrentWP; + } +} + +/*void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs) +{ + Escort_Waypoint t(id, x, y, z, WaitTimeMs); + + WaypointList.push_back(t); +}*/ + +void npc_escortAI::FillPointMovementListForCreature() +{ + std::vector const &pPointsEntries = pSystemMgr.GetPointMoveList(m_creature->GetEntry()); + + if (pPointsEntries.empty()) + return; + + std::vector::const_iterator itr; + + for (itr = pPointsEntries.begin(); itr != pPointsEntries.end(); ++itr) + { + Escort_Waypoint pPoint(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime); + WaypointList.push_back(pPoint); + } +} + +void npc_escortAI::SetCurrentWaypoint(uint32 uiPointId) +{ + if (!(HasEscortState(STATE_ESCORT_PAUSED))) // only when paused + return; + + if (uiPointId >= WaypointList.size()) // too high number + return; + + if (uiPointId == CurrentWP->uiId) // already here + return; + + CurrentWP = WaypointList.begin(); // set to begin (can't -- backwards in itr list) + + while(uiPointId != CurrentWP->uiId) + { + ++CurrentWP; + + if (CurrentWP == WaypointList.end()) + break; + } + + m_uiWPWaitTimer = 1; + + debug_log("SD2: EscortAI current waypoint set to id %u", CurrentWP->uiId); +} + +void npc_escortAI::SetRun(bool bRun) +{ + if (bRun) + { + if (!m_bIsRunning) + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + else + debug_log("SD2: EscortAI attempt to set run mode, but is already running."); + } + else + { + if (m_bIsRunning) + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + else + debug_log("SD2: EscortAI attempt to set walk mode, but is already walking."); + } + m_bIsRunning = bRun; +} + +//TODO: get rid of this many variables passed in function. +void npc_escortAI::Start(bool bRun, uint64 uiPlayerGUID, const Quest* pQuest, bool bInstantRespawn, bool bCanLoopPath) +{ + if (m_creature->getVictim()) + { + error_log("SD2: EscortAI attempt to Start while in combat."); + return; + } + + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + error_log("SD2: EscortAI attempt to Start while already escorting."); + return; + } + + if (!WaypointList.empty()) + WaypointList.clear(); + + FillPointMovementListForCreature(); + + if (WaypointList.empty()) + { + error_db_log("SD2: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint)."); + return; + } + + //set variables + m_bIsRunning = bRun; + + m_uiPlayerGUID = uiPlayerGUID; + m_pQuestForEscort = pQuest; + + m_bCanInstantRespawn = bInstantRespawn; + m_bCanReturnToStart = bCanLoopPath; + + if (m_bCanReturnToStart && m_bCanInstantRespawn) + debug_log("SD2: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + debug_log("SD2: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); + } + + //disable npcflags + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + debug_log("SD2: EscortAI started with " SIZEFMTD " waypoints. Run = %d, PlayerGUID = " UI64FMTD, WaypointList.size(), m_bIsRunning, m_uiPlayerGUID); + + CurrentWP = WaypointList.begin(); + + //Set initial speed + if (m_bIsRunning) + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + + AddEscortState(STATE_ESCORT_ESCORTING); + + JustStartedEscort(); +} + +void npc_escortAI::SetEscortPaused(bool bPaused) +{ + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + if (bPaused) + AddEscortState(STATE_ESCORT_PAUSED); + else + RemoveEscortState(STATE_ESCORT_PAUSED); +} diff --git a/base/escort_ai.h b/base/escort_ai.h new file mode 100644 index 0000000..0d1b6f4 --- /dev/null +++ b/base/escort_ai.h @@ -0,0 +1,107 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_ESCORTAI_H +#define SC_ESCORTAI_H + +#include "../system/system.h" + +struct Escort_Waypoint +{ + Escort_Waypoint(uint32 uiId, float fX, float fY, float fZ, uint32 uiWaitTime) : + uiId(uiId), + fX(fX), + fY(fY), + fZ(fZ), + uiWaitTime(uiWaitTime) + {} + + uint32 uiId; + float fX; + float fY; + float fZ; + uint32 uiWaitTime; +}; + +enum eEscortState +{ + STATE_ESCORT_NONE = 0x000, //nothing in progress + STATE_ESCORT_ESCORTING = 0x001, //escort are in progress + STATE_ESCORT_RETURNING = 0x002, //escort is returning after being in combat + STATE_ESCORT_PAUSED = 0x004 //will not proceed with waypoints before state is removed +}; + +struct MANGOS_DLL_DECL npc_escortAI : public ScriptedAI +{ + public: + explicit npc_escortAI(Creature* pCreature); + ~npc_escortAI() {} + + virtual void Aggro(Unit*); + + virtual void Reset() = 0; + + // CreatureAI functions + bool IsVisible(Unit*) const; + + void AttackStart(Unit*); + + void EnterCombat(Unit*); + + void MoveInLineOfSight(Unit*); + + void JustDied(Unit*); + + void JustRespawned(); + + void EnterEvadeMode(); + + void UpdateAI(const uint32); //the "internal" update, calls UpdateEscortAI() + virtual void UpdateEscortAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc) + + void MovementInform(uint32, uint32); + + // EscortAI functions + //void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + + virtual void WaypointReached(uint32 uiPointId) = 0; + virtual void WaypointStart(uint32 uiPointId) {} + + void Start(bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); + + void SetRun(bool bRun = true); + void SetEscortPaused(bool uPaused); + + bool HasEscortState(uint32 uiEscortState) { return (m_uiEscortState & uiEscortState); } + + // update current point + void SetCurrentWaypoint(uint32 uiPointId); + + protected: + Player* GetPlayerForEscort() { return m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); } + virtual void JustStartedEscort() {} + + private: + bool AssistPlayerInCombat(Unit* pWho); + bool IsPlayerOrGroupInRange(); + void FillPointMovementListForCreature(); + + void AddEscortState(uint32 uiEscortState) { m_uiEscortState |= uiEscortState; } + void RemoveEscortState(uint32 uiEscortState) { m_uiEscortState &= ~uiEscortState; } + + uint64 m_uiPlayerGUID; + uint32 m_uiWPWaitTimer; + uint32 m_uiPlayerCheckTimer; + uint32 m_uiEscortState; + + const Quest* m_pQuestForEscort; //generally passed in Start() when regular escort script. + + std::list WaypointList; + std::list::iterator CurrentWP; + + bool m_bIsRunning; //all creatures are walking by default (has flag SPLINEFLAG_WALKMODE) + bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used) + bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests. +}; +#endif diff --git a/base/follower_ai.cpp b/base/follower_ai.cpp new file mode 100644 index 0000000..f19ab72 --- /dev/null +++ b/base/follower_ai.cpp @@ -0,0 +1,387 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +/* ScriptData +SDName: FollowerAI +SD%Complete: 60 +SDComment: This AI is under development +SDCategory: Npc +EndScriptData */ + +#include "precompiled.h" +#include "follower_ai.h" + +const float MAX_PLAYER_DISTANCE = 100.0f; + +enum +{ + POINT_COMBAT_START = 0xFFFFFF +}; + +FollowerAI::FollowerAI(Creature* pCreature) : ScriptedAI(pCreature), + m_uiLeaderGUID(0), + m_pQuestForFollow(NULL), + m_uiUpdateFollowTimer(2500), + m_uiFollowState(STATE_FOLLOW_NONE) +{} + +void FollowerAI::AttackStart(Unit* pWho) +{ + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (IsCombatMovement()) + m_creature->GetMotionMaster()->MoveChase(pWho); + } +} + +//This part provides assistance to a player that are attacked by pWho, even if out of normal aggro range +//It will cause m_creature to attack pWho that are attacking _any_ player (which has been confirmed may happen also on offi) +bool FollowerAI::AssistPlayerInCombat(Unit* pWho) +{ + if (!pWho->getVictim()) + return false; + + // experimental (unknown) flag not present + if (!(m_creature->GetCreatureInfo()->type_flags & CREATURE_TYPEFLAGS_CAN_ASSIST)) + return false; + + // unit state prevents (similar check is done in CanInitiateAttack which also include checking unit_flags. We skip those here) + if (m_creature->hasUnitState(UNIT_STAT_STUNNED | UNIT_STAT_DIED)) + return false; + + // victim of pWho is not a player + if (!pWho->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()) + return false; + + // never attack friendly + if (m_creature->IsFriendlyTo(pWho)) + return false; + + // too far away and no free sight? + if (m_creature->IsWithinDistInMap(pWho, MAX_PLAYER_DISTANCE) && m_creature->IsWithinLOSInMap(pWho)) + { + // already fighting someone? + if (!m_creature->getVictim()) + { + AttackStart(pWho); + return true; + } + else + { + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + return true; + } + } + + return false; +} + +void FollowerAI::MoveInLineOfSight(Unit* pWho) +{ + if (pWho->isTargetableForAttack() && pWho->isInAccessablePlaceFor(m_creature)) + { + // AssistPlayerInCombat can start attack, so return if true + if (HasFollowState(STATE_FOLLOW_INPROGRESS) && AssistPlayerInCombat(pWho)) + return; + + if (!m_creature->CanInitiateAttack()) + return; + + if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + if (m_creature->IsHostileTo(pWho)) + { + float fAttackRadius = m_creature->GetAttackDistance(pWho); + if (m_creature->IsWithinDistInMap(pWho, fAttackRadius) && m_creature->IsWithinLOSInMap(pWho)) + { + if (!m_creature->getVictim()) + { + pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else if (m_creature->GetMap()->IsDungeon()) + { + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + } + } + } + } +} + +void FollowerAI::JustDied(Unit* pKiller) +{ + if (!HasFollowState(STATE_FOLLOW_INPROGRESS) || !m_uiLeaderGUID || !m_pQuestForFollow) + return; + + //TODO: need a better check for quests with time limit. + if (Player* pPlayer = GetLeaderForFollower()) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (pMember->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pMember->FailQuest(m_pQuestForFollow->GetQuestId()); + } + } + } + else + { + if (pPlayer->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(m_pQuestForFollow->GetQuestId()); + } + } +} + +void FollowerAI::JustRespawned() +{ + m_uiFollowState = STATE_FOLLOW_NONE; + + if (!IsCombatMovement()) + SetCombatMovement(true); + + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + + Reset(); +} + +void FollowerAI::EnterEvadeMode() +{ + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->SetLootRecipient(NULL); + + if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + { + debug_log("SD2: FollowerAI left combat, returning to CombatStartPosition."); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + { + float fPosX, fPosY, fPosZ; + m_creature->GetCombatStartPosition(fPosX, fPosY, fPosZ); + m_creature->GetMotionMaster()->MovePoint(POINT_COMBAT_START, fPosX, fPosY, fPosZ); + } + } + else + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + + Reset(); +} + +void FollowerAI::UpdateAI(const uint32 uiDiff) +{ + if (HasFollowState(STATE_FOLLOW_INPROGRESS) && !m_creature->getVictim()) + { + if (m_uiUpdateFollowTimer < uiDiff) + { + if (HasFollowState(STATE_FOLLOW_COMPLETE) && !HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + debug_log("SD2: FollowerAI is set completed, despawns."); + m_creature->ForcedDespawn(); + return; + } + + bool bIsMaxRangeExceeded = true; + + if (Player* pPlayer = GetLeaderForFollower()) + { + if (HasFollowState(STATE_FOLLOW_RETURNING)) + { + debug_log("SD2: FollowerAI is returning to leader."); + + RemoveFollowState(STATE_FOLLOW_RETURNING); + m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + return; + } + + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) + { + bIsMaxRangeExceeded = false; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, MAX_PLAYER_DISTANCE)) + bIsMaxRangeExceeded = false; + } + } + + if (bIsMaxRangeExceeded) + { + debug_log("SD2: FollowerAI failed because player/group was to far away or not found"); + m_creature->ForcedDespawn(); + return; + } + + m_uiUpdateFollowTimer = 1000; + } + else + m_uiUpdateFollowTimer -= uiDiff; + } + + UpdateFollowerAI(uiDiff); +} + +void FollowerAI::UpdateFollowerAI(const uint32 uiDiff) +{ + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); +} + +void FollowerAI::MovementInform(uint32 uiMotionType, uint32 uiPointId) +{ + if (uiMotionType != POINT_MOTION_TYPE || !HasFollowState(STATE_FOLLOW_INPROGRESS)) + return; + + if (uiPointId == POINT_COMBAT_START) + { + if (GetLeaderForFollower()) + { + if (!HasFollowState(STATE_FOLLOW_PAUSED)) + AddFollowState(STATE_FOLLOW_RETURNING); + } + else + m_creature->ForcedDespawn(); + } +} + +void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const Quest* pQuest) +{ + if (m_creature->getVictim()) + { + debug_log("SD2: FollowerAI attempt to StartFollow while in combat."); + return; + } + + if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + { + error_log("SD2: FollowerAI attempt to StartFollow while already following."); + return; + } + + //set variables + m_uiLeaderGUID = pLeader->GetGUID(); + + if (uiFactionForFollower) + m_creature->setFaction(uiFactionForFollower); + + m_pQuestForFollow = pQuest; + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + debug_log("SD2: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); + } + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + AddFollowState(STATE_FOLLOW_INPROGRESS); + + m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + + debug_log("SD2: FollowerAI start follow %s (GUID " UI64FMTD ")", pLeader->GetName(), m_uiLeaderGUID); +} + +Player* FollowerAI::GetLeaderForFollower() +{ + if (Player* pLeader = m_creature->GetMap()->GetPlayer(m_uiLeaderGUID)) + { + if (pLeader->isAlive()) + return pLeader; + else + { + if (Group* pGroup = pLeader->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && pMember->isAlive() && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) + { + debug_log("SD2: FollowerAI GetLeader changed and returned new leader."); + m_uiLeaderGUID = pMember->GetGUID(); + return pMember; + break; + } + } + } + } + } + + debug_log("SD2: FollowerAI GetLeader can not find suitable leader."); + return NULL; +} + +void FollowerAI::SetFollowComplete(bool bWithEndEvent) +{ + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == FOLLOW_MOTION_TYPE) + { + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + } + + if (bWithEndEvent) + AddFollowState(STATE_FOLLOW_POSTEVENT); + else + { + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + RemoveFollowState(STATE_FOLLOW_POSTEVENT); + } + + AddFollowState(STATE_FOLLOW_COMPLETE); +} + +void FollowerAI::SetFollowPaused(bool bPaused) +{ + if (!HasFollowState(STATE_FOLLOW_INPROGRESS) || HasFollowState(STATE_FOLLOW_COMPLETE)) + return; + + if (bPaused) + { + AddFollowState(STATE_FOLLOW_PAUSED); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == FOLLOW_MOTION_TYPE) + { + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + } + } + else + { + RemoveFollowState(STATE_FOLLOW_PAUSED); + + if (Player* pLeader = GetLeaderForFollower()) + m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + } +} diff --git a/base/follower_ai.h b/base/follower_ai.h new file mode 100644 index 0000000..7fa28cc --- /dev/null +++ b/base/follower_ai.h @@ -0,0 +1,67 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_FOLLOWERAI_H +#define SC_FOLLOWERAI_H + +#include "../system/system.h" + +enum eFollowState +{ + STATE_FOLLOW_NONE = 0x000, + STATE_FOLLOW_INPROGRESS = 0x001, //must always have this state for any follow + STATE_FOLLOW_RETURNING = 0x002, //when returning to combat start after being in combat + STATE_FOLLOW_PAUSED = 0x004, //disables following + STATE_FOLLOW_COMPLETE = 0x008, //follow is completed and may end + STATE_FOLLOW_PREEVENT = 0x010, //not implemented (allow pre event to run, before follow is initiated) + STATE_FOLLOW_POSTEVENT = 0x020 //can be set at complete and allow post event to run +}; + +class MANGOS_DLL_DECL FollowerAI : public ScriptedAI +{ + public: + explicit FollowerAI(Creature* pCreature); + ~FollowerAI() {} + + //virtual void WaypointReached(uint32 uiPointId) = 0; + + void MovementInform(uint32 uiMotionType, uint32 uiPointId); + + void AttackStart(Unit*); + + void MoveInLineOfSight(Unit*); + + void EnterEvadeMode(); + + void JustDied(Unit*); + + void JustRespawned(); + + void UpdateAI(const uint32); //the "internal" update, calls UpdateFollowerAI() + virtual void UpdateFollowerAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc) + + void StartFollow(Player* pPlayer, uint32 uiFactionForFollower = 0, const Quest* pQuest = NULL); + + void SetFollowPaused(bool bPaused); //if special event require follow mode to hold/resume during the follow + void SetFollowComplete(bool bWithEndEvent = false); + + bool HasFollowState(uint32 uiFollowState) { return (m_uiFollowState & uiFollowState); } + + protected: + Player* GetLeaderForFollower(); + + private: + void AddFollowState(uint32 uiFollowState) { m_uiFollowState |= uiFollowState; } + void RemoveFollowState(uint32 uiFollowState) { m_uiFollowState &= ~uiFollowState; } + + bool AssistPlayerInCombat(Unit* pWho); + + uint64 m_uiLeaderGUID; + uint32 m_uiUpdateFollowTimer; + uint32 m_uiFollowState; + + const Quest* m_pQuestForFollow; //normally we have a quest +}; + +#endif diff --git a/base/guard_ai.cpp b/base/guard_ai.cpp new file mode 100644 index 0000000..d531baf --- /dev/null +++ b/base/guard_ai.cpp @@ -0,0 +1,210 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Guard_AI +SD%Complete: 90 +SDComment: +SDCategory: Guards +EndScriptData */ + +#include "precompiled.h" +#include "guard_ai.h" + +// This script is for use within every single guard to save coding time + +guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature), + m_uiGlobalCooldown(0), + m_uiBuffTimer(0) +{} + +void guardAI::Reset() +{ + m_uiGlobalCooldown = 0; + m_uiBuffTimer = 0; //Rebuff as soon as we can +} + +void guardAI::Aggro(Unit *pWho) +{ + if (m_creature->GetEntry() == NPC_CENARION_INFANTRY) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_GUARD_SIL_AGGRO1, m_creature, pWho); break; + case 1: DoScriptText(SAY_GUARD_SIL_AGGRO2, m_creature, pWho); break; + case 2: DoScriptText(SAY_GUARD_SIL_AGGRO3, m_creature, pWho); break; + } + } + + if (const SpellEntry *pSpellInfo = m_creature->ReachWithSpellAttack(pWho)) + DoCastSpell(pWho, pSpellInfo); +} + +void guardAI::JustDied(Unit *pKiller) +{ + //Send Zone Under Attack message to the LocalDefense and WorldDefense Channels + if (Player* pPlayer = pKiller->GetCharmerOrOwnerPlayerOrPlayerItself()) + m_creature->SendZoneUnderAttackMessage(pPlayer); +} + +void guardAI::UpdateAI(const uint32 uiDiff) +{ + //Always decrease our global cooldown first + if (m_uiGlobalCooldown > uiDiff) + m_uiGlobalCooldown -= uiDiff; + else + m_uiGlobalCooldown = 0; + + //Buff timer (only buff when we are alive and not in combat + if (m_creature->isAlive() && !m_creature->isInCombat()) + { + if (m_uiBuffTimer < uiDiff) + { + //Find a spell that targets friendly and applies an aura (these are generally buffs) + const SpellEntry *pSpellInfo = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA); + + if (pSpellInfo && !m_uiGlobalCooldown) + { + //Cast the buff spell + DoCastSpell(m_creature, pSpellInfo); + + //Set our global cooldown + m_uiGlobalCooldown = GENERIC_CREATURE_COOLDOWN; + + //Set our timer to 10 minutes before rebuff + m_uiBuffTimer = 600000; + } //Try again in 30 seconds + else + m_uiBuffTimer = 30000; + } + else + m_uiBuffTimer -= uiDiff; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + bool bHealing = false; + const SpellEntry *pSpellInfo = NULL; + + //Select a healing spell if less than 30% hp + if (m_creature->GetHealthPercent() < 30.0f) + pSpellInfo = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); + + //No healing spell available, select a hostile spell + if (pSpellInfo) + bHealing = true; + else + pSpellInfo = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); + + //20% chance to replace our white hit with a spell + if (pSpellInfo && !urand(0, 4) && !m_uiGlobalCooldown) + { + //Cast the spell + if (bHealing) + DoCastSpell(m_creature, pSpellInfo); + else + DoCastSpell(m_creature->getVictim(), pSpellInfo); + + //Set our global cooldown + m_uiGlobalCooldown = GENERIC_CREATURE_COOLDOWN; + } + else + m_creature->AttackerStateUpdate(m_creature->getVictim()); + + m_creature->resetAttackTimer(); + } + } + else + { + //Only run this code if we arn't already casting + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + bool bHealing = false; + const SpellEntry *pSpellInfo = NULL; + + //Select a healing spell if less than 30% hp ONLY 33% of the time + if (m_creature->GetHealthPercent() < 30.0f && !urand(0, 2)) + pSpellInfo = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); + + //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE) + if (pSpellInfo) + bHealing = true; + else + pSpellInfo = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, ATTACK_DISTANCE, 0, SELECT_EFFECT_DONTCARE); + + //Found a spell, check if we arn't on cooldown + if (pSpellInfo && !m_uiGlobalCooldown) + { + //If we are currently moving stop us and set the movement generator + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != IDLE_MOTION_TYPE) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + } + + //Cast spell + if (bHealing) + DoCastSpell(m_creature, pSpellInfo); + else + DoCastSpell(m_creature->getVictim(), pSpellInfo); + + //Set our global cooldown + m_uiGlobalCooldown = GENERIC_CREATURE_COOLDOWN; + + } //If no spells available and we arn't moving run to target + else if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + { + //Cancel our current spell and then mutate new movement generator + m_creature->InterruptNonMeleeSpells(false); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } +} + +void guardAI::DoReplyToTextEmote(uint32 uiTextEmote) +{ + switch(uiTextEmote) + { + case TEXTEMOTE_KISS: m_creature->HandleEmote(EMOTE_ONESHOT_BOW); break; + case TEXTEMOTE_WAVE: m_creature->HandleEmote(EMOTE_ONESHOT_WAVE); break; + case TEXTEMOTE_SALUTE: m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE); break; + case TEXTEMOTE_SHY: m_creature->HandleEmote(EMOTE_ONESHOT_FLEX); break; + case TEXTEMOTE_RUDE: + case TEXTEMOTE_CHICKEN: m_creature->HandleEmote(EMOTE_ONESHOT_POINT); break; + } +} + +void guardAI_orgrimmar::ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) +{ + if (pPlayer->GetTeam() == HORDE) + DoReplyToTextEmote(uiTextEmote); +} + +void guardAI_stormwind::ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) +{ + if (pPlayer->GetTeam() == ALLIANCE) + DoReplyToTextEmote(uiTextEmote); +} diff --git a/base/guard_ai.h b/base/guard_ai.h new file mode 100644 index 0000000..b8077c0 --- /dev/null +++ b/base/guard_ai.h @@ -0,0 +1,63 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_GUARDAI_H +#define SC_GUARDAI_H + +enum +{ + GENERIC_CREATURE_COOLDOWN = 5000, + + SAY_GUARD_SIL_AGGRO1 = -1000198, + SAY_GUARD_SIL_AGGRO2 = -1000199, + SAY_GUARD_SIL_AGGRO3 = -1000200, + + NPC_CENARION_INFANTRY = 15184 +}; + +enum eShattrathGuard +{ + SPELL_BANISHED_SHATTRATH_A = 36642, + SPELL_BANISHED_SHATTRATH_S = 36671, + SPELL_BANISH_TELEPORT = 36643, + SPELL_EXILE = 39533 +}; + +struct MANGOS_DLL_DECL guardAI : public ScriptedAI +{ + public: + explicit guardAI(Creature* pCreature); + ~guardAI() {} + + uint32 m_uiGlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) + uint32 m_uiBuffTimer; //This variable keeps track of buffs + + void Reset(); + + void Aggro(Unit *pWho); + + void JustDied(Unit *pKiller); + + void UpdateAI(const uint32 uiDiff); + + //common used for guards in main cities + void DoReplyToTextEmote(uint32 uiTextEmote); + +}; + +struct MANGOS_DLL_DECL guardAI_orgrimmar : public guardAI +{ + guardAI_orgrimmar(Creature* pCreature) : guardAI(pCreature) {} + + void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote); +}; + +struct MANGOS_DLL_DECL guardAI_stormwind : public guardAI +{ + guardAI_stormwind(Creature* pCreature) : guardAI(pCreature) {} + + void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote); +}; + +#endif diff --git a/config.h b/config.h new file mode 100644 index 0000000..06e016e --- /dev/null +++ b/config.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2005-2009 MaNGOS + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef SC_CONFIG_H +#define SC_CONFIG_H + +#include "Platform/CompilerDefs.h" +#include "revision.h" + +// Format is YYYYMMDDRR where RR is the change in the conf file +// for that day. +#define SD2_CONF_VERSION 2010062001 + +#ifdef WIN32 + #define MANGOS_DLL_EXPORT extern "C" __declspec(dllexport) +#elif defined( __GNUC__ ) + #define MANGOS_DLL_EXPORT extern "C" +#else + #define MANGOS_DLL_EXPORT extern "C" export +#endif + +#ifndef _VERSION + #define _VERSION "Revision [" REVISION_ID "] " REVISION_DATE " " REVISION_TIME +#endif + +// The path to config files +#ifndef SYSCONFDIR + #define SYSCONFDIR "" +#endif + +#if PLATFORM == PLATFORM_WINDOWS + #ifdef _WIN64 + #define _FULLVERSION _VERSION " (Win64)" + #else + #define _FULLVERSION _VERSION " (Win32)" + #endif + #define _SCRIPTDEV2_CONFIG "scriptdev2.conf" +#else + #define _FULLVERSION _VERSION " (Unix)" + #define _SCRIPTDEV2_CONFIG SYSCONFDIR"scriptdev2.conf" +#endif + +#endif diff --git a/config.h.in b/config.h.in new file mode 100644 index 0000000..daa4279 --- /dev/null +++ b/config.h.in @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2005-2009 MaNGOS + * + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef SC_CONFIG_H +#define SC_CONFIG_H + +#include "Platform/CompilerDefs.h" +#include "revision.h" + +// Format is YYYYMMDDRR where RR is the change in the conf file +// for that day. +#define SD2_CONF_VERSION 2009040501 + +#ifdef WIN32 + #define MANGOS_DLL_EXPORT extern "C" __declspec(dllexport) +#elif defined( __GNUC__ ) + #define MANGOS_DLL_EXPORT extern "C" +#else + #define MANGOS_DLL_EXPORT extern "C" export +#endif + +#ifndef _VERSION + #define _VERSION "Revision [" REVISION_ID "] " REVISION_DATE " " REVISION_TIME +#endif + +// The path to config files +#ifndef SYSCONFDIR + #define SYSCONFDIR "" +#endif + +#if PLATFORM == PLATFORM_WINDOWS + #ifdef _WIN64 + #define _FULLVERSION _VERSION " (Win64)" + #else + #define _FULLVERSION _VERSION " (Win32)" + #endif + #define _SCRIPTDEV2_CONFIG "scriptdev2.conf" +#else + #define _FULLVERSION _VERSION " (Unix)" + #define _SCRIPTDEV2_CONFIG SYSCONFDIR"scriptdev2.conf" +#endif + +#endif diff --git a/docs/How to install.txt b/docs/How to install.txt new file mode 100644 index 0000000..dfe1251 --- /dev/null +++ b/docs/How to install.txt @@ -0,0 +1,53 @@ + +--- How to install ScriptDev2 --- + +1) Download MaNGOS (using git clone) + +2) Do the source stuff: + +MS Windows: +- Create a new folder under "src\bindings\" within the MaNGOS source called "ScriptDev2" +- Checkout the ScriptDev2 trunk from "https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2" +- Apply the Git patch to Mangos - "git am src/bindings/ScriptDev2/patches/MaNGOS-XXXX-ScriptDev2.patch" ('XXXX' is revision number for Mangos). (Note this is not required for compile, but needed to avoid deletion of untracked folders/files in GIT-directory when using certain GIT commands (example: git clean -f -d)) +- Compile MaNGOS +- Compile ScriptDev2 using the ScriptVC80 or ScriptVC90 Solution within the ScriptDev2 folder (this will overwrite the Mangoscript dll in the output directory) + +GNU/Linux: +- Checkout the ScriptDev2 to "src/bindings/ScriptDev2" - "svn co https://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2 src/bindings/ScriptDev2" +SVN: +- Apply MaNGOS-XXXX-ScriptDev2.patch to Mangos, where XXXX is the highest version to that of your MaNGOS revision. +GIT: +- Apply the Git patch to Mangos - "git am src/bindings/ScriptDev2/patches/MaNGOS-XXXX-ScriptDev2.patch" + +- Compile MaNGOS (ScriptDev2 will automatically be built when compiling Mangos from here on) + +3) Create the default ScriptDev2 database using +"sql\scriptdev2_create_database.sql", then execute +"sql\scriptdev2_create_structure.sql" on that database. + +4) Execute the following on your ScriptDev2 database. +- sql\scriptdev2_script_full.sql + +5) Execute the following file on your MaNGOS database. +- sql\mangos_scriptname_full.sql + +6) Place the included "scriptdev2.conf" file within the directory containing your "mangosd.conf" and "realmd.conf" files. You may need to change this file to match the database you created and any custom settings you wish to use. Note this file will be different created for Unix based systems. + +7) Run mangosd from your output directory + + +To update ScriptDev2: + +MS Windows: +- All you have to do is open src\bindings\ and right click on the ScriptDev2 folder and click "Update" and then follow steps 4, 6, and 7 again. You must still compile MaNGOS before ScriptDev2 when on the Windows platform. + +GNU/Linux: +- Go to the src/bindings/ScriptDev2 directory - "cd src/bindings/ScriptDev2" +- Update ScriptDev2 - "svn up" + +To update your Database with new Scriptdev2 SQL changes you can either: +a) apply only the changes that were made during that revision by looking in the sql\update folder or (files named rXXX_scriptdev2.sql should be executed on the scriptdev2 db while rXXX_mangos.sql should be executed on your mangos db) +b) reapply "mangos_scriptname_full.sql" to your MaNGOS database. + +You can view the ScriptDev2 Change Log at: +http://scriptdev2.svn.sourceforge.net/viewvc/scriptdev2/?view=log diff --git a/docs/LICENSE.txt b/docs/LICENSE.txt new file mode 100644 index 0000000..1f05b58 --- /dev/null +++ b/docs/LICENSE.txt @@ -0,0 +1,280 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/docs/Script Layout.txt b/docs/Script Layout.txt new file mode 100644 index 0000000..b519352 --- /dev/null +++ b/docs/Script Layout.txt @@ -0,0 +1,32 @@ +--- Script Layout --- +A quick explanation of the layout I hope everyone will follow for scriptdev2. + +--- Sub Folders --- + +Area - Contains scripts used solely by area triggers + +Boss - Boss scripts for bosses that are not zone specific + +Mob - Generic Creature scripts for creatures that are not zone specific + +Custom - Intentionally empty folder from SVN. If you make a custom script please put it here. + +GO - Contains scripts used solely by Game Objects (GOs) that do not have a specific zone + +Guard - Scripts for Guard NPCs + +Honor - Honor npcs (currently a blank script as these npcs do nothing special) + +Item - Item scripts + +NPC - Scripts for individual NPCs who do not have a specific zone + +Servers - Generic NPC servers script for things such as flightmasters and guildmasters. + +Zone - ALL zone specific scripts should be written within these folders. This includes creature scripts, boss scripts, go scripts, area scripts, and npc scripts. + +--- Naming Conventions --- + +Please keep file names to "type_objectname.cpp" where type is replaced by the type of object and objectname is replaced by the name of the object, creature, item, or area that this script will be used by. + +AddSC functions should follow "void AddSC_creaturename(void);" format. Do not append AI or anything else. diff --git a/docs/Text-tables.txt b/docs/Text-tables.txt new file mode 100644 index 0000000..3c02832 --- /dev/null +++ b/docs/Text-tables.txt @@ -0,0 +1,86 @@ +========================================= +Texts Documentation +========================================= + +Scriptdev2 Revision 695 introduces a new format for using texts in EventAI and SD2 Scripts. +This information relates to the *_texts tables located in the ScriptDev Database. + +Any script can at any time access and use text from any of the three text tables, as long as the entry does in fact exist. +Custom scripters are advised to store their text data in custom_texts. + +The different tables has ranges of entries allowed for that table. +Reserved EventAI in Mangos entry -1 -> -999999 +script_texts: entry -1000000 -> -1999999 +custom_texts: entry -2000000 -> -2999999 +Any entry out of range for that table will display a start-up error. + + +========================================= +Basic Structure of script_texts and custom_texts +========================================= +Below is a the list of current fields within the texts tables. + +Field_Name Description +----------------------------------------------------------- +entry This value is mearly an NEGATIVE identifier of the current text number. Required for sql queries. +content_default This is the actual text presented in the default language (English). + +content_loc1 This is the actual text presented in the Localization #1 Clients (Korean) +content_loc2 This is the actual text presented in the Localization #2 Clients (French) +content_loc3 This is the actual text presented in the Localization #3 Clients (German) +content_loc4 This is the actual text presented in the Localization #4 Clients (Chinese) +content_loc5 This is the actual text presented in the Localization #5 Clients (Taiwanese) +content_loc6 This is the actual text presented in the Localization #6 Clients (Spanish) +content_loc7 This is the actual text presented in the Localization #7 Clients (Spanish Mexico) +content_loc8 This is the actual text presented in the Localization #8 Clients (Russian) + +sound This value is the Sound ID that corresponds to the actual text used (Defined in SoundEntries.dbc). +type Variables used to define type of text (Say/Yell/Textemote/Whisper). +language This value is the Language that the text is native in (Defined in Languages.dbc). +emote Value from enum Emote (defined in Emotes.dbc). Only source of text will play this emote (not target, if target are defined in DoScriptText) +comment This is a comment regarding the text entry (For ACID, accepted format is to use Creature ID of NPC using it). + +Note: Fields `content_loc1` to `content_loc8` are NULL values by default and are handled by separate localization projects. + + +========================================= +Text Types (type) +========================================= +Below is the list of current Text types that texts tables can handle. These were previously separate Actions in ACID. + +# Internal Name Description +----------------------------------------------------------- +0 CHAT_TYPE_SAY This type sets the text to be displayed as a Say (Speech Bubble). +1 CHAT_TYPE_YELL This type sets the text to be displayed as a Yell (Red Speech Bubble) and usually has a matching Sound ID. +2 CHAT_TYPE_TEXT_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log. +3 CHAT_TYPE_BOSS_EMOTE This type sets the text to be displayed as a text emote in orange in the chat log (Used only for specific Bosses). +4 CHAT_TYPE_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log. +5 CHAT_TYPE_BOSS_WHISPER This type sets the text to be displayed as a whisper to the player in the chat log (Used only for specific Bosses). +6 CHAT_TYPE_ZONE_YELL Same as CHAT_TYPE_YELL but will display to all players in current zone. + +========================================= +Language Types (language) +========================================= +Below is the list of current Language types that are allowed. +This is the Race Language that the text is native to (So it will display properly) + +# Internal Name Description +----------------------------------------------------------- +0 UNIVERSAL Text in this language is understood by ALL Races. +1 ORCISH Text in this language is understood ONLY by Horde Races. +2 DARNASSIAN Text in this language is understood ONLY by the Night Elf Race. +3 TAURAHE Text in this language is understood ONLY by the Tauren Race. +6 DWARVISH Text in this language is understood ONLY by the Dwarf Race. +7 COMMON Text in this language is understood ONLY by Alliance Races. +8 DEMONIC Text in this language is understood ONLY by the Demon Race (Not Implemented). +9 TITAN This language was used by Sargeras to speak with other Titians (Not Implemented). +10 THALASSIAN Text in this language is understood ONLY by the Blood Elf Race. +11 DRACONIC Text in this language is understood ONLY by the Dragon Race. +12 KALIMAG Text will display as Kalimag (not readable by players, language of all elementals) +13 GNOMISH Text in this language is understood ONLY by the Gnome Race. +14 TROLL Text in this language is understood ONLY by the Troll Race. +33 GUTTERSPEAK Text in this language is understood ONLY by the Undead Race. +35 DRAENEI Text in this language is understood ONLY by the Draenai Race. +36 ZOMBIE (not currently used?) +37 GNOMISH BINARY Binary language used by Alliance when drinking Binary Brew +38 GOBLIN BINARY Binary language used by Horde when drinking Binary Brew diff --git a/docs/ToDo.txt b/docs/ToDo.txt new file mode 100644 index 0000000..f4cad66 --- /dev/null +++ b/docs/ToDo.txt @@ -0,0 +1,14 @@ +--- TO DO --- +Simple list of things we need to do. + +--- ScriptDev2 Framework --- +Move all text out of C++ code and into SD2 database. + +--- Scripting with Priorities --- +1) Boss AI and Boss Event scripts +2) Specific NPC AI, Gossip, Quest, Event scripts +3) Spell and Item scripts + +--- Core Problems --- + +- Spell scripts are only scriptable within the core. Spell scripts should be done in SD2 since they are very specialized. \ No newline at end of file diff --git a/include/precompiled.cpp b/include/precompiled.cpp new file mode 100644 index 0000000..babe1eb --- /dev/null +++ b/include/precompiled.cpp @@ -0,0 +1,5 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" diff --git a/include/precompiled.h b/include/precompiled.h new file mode 100644 index 0000000..ae85e85 --- /dev/null +++ b/include/precompiled.h @@ -0,0 +1,22 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_PRECOMPILED_H +#define SC_PRECOMPILED_H + +#include "../ScriptMgr.h" +#include "sc_creature.h" +#include "sc_gossip.h" +#include "sc_grid_searchers.h" +#include "sc_instance.h" + +#ifdef WIN32 +# include + BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) + { + return true; + } +#endif + +#endif diff --git a/include/sc_creature.cpp b/include/sc_creature.cpp new file mode 100644 index 0000000..f0526c8 --- /dev/null +++ b/include/sc_creature.cpp @@ -0,0 +1,550 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" +#include "Item.h" +#include "Spell.h" +#include "WorldPacket.h" +#include "ObjectMgr.h" + +// Spell summary for ScriptedAI::SelectSpell +struct TSpellSummary +{ + uint8 Targets; // set of enum SelectTarget + uint8 Effects; // set of enum SelectEffect +} *SpellSummary; + +ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), + m_bCombatMovement(true), + m_uiEvadeCheckCooldown(2500) +{} + +bool ScriptedAI::IsVisible(Unit* pWho) const +{ + if (!pWho) + return false; + + return m_creature->IsWithinDist(pWho, VISIBLE_RANGE) && pWho->isVisibleForOrDetect(m_creature, m_creature, true); +} + +void ScriptedAI::MoveInLineOfSight(Unit* pWho) +{ + if (m_creature->CanInitiateAttack() && pWho->isTargetableForAttack() && + m_creature->IsHostileTo(pWho) && pWho->isInAccessablePlaceFor(m_creature)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + if (m_creature->IsWithinDistInMap(pWho, m_creature->GetAttackDistance(pWho)) && m_creature->IsWithinLOSInMap(pWho)) + { + if (!m_creature->getVictim()) + { + pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else if (m_creature->GetMap()->IsDungeon()) + { + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + } + } + } +} + +void ScriptedAI::AttackStart(Unit* pWho) +{ + if (pWho && m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (IsCombatMovement()) + m_creature->GetMotionMaster()->MoveChase(pWho); + } +} + +void ScriptedAI::EnterCombat(Unit* pEnemy) +{ + if (pEnemy) + Aggro(pEnemy); +} + +void ScriptedAI::Aggro(Unit* pEnemy) +{ +} + +void ScriptedAI::UpdateAI(const uint32 uiDiff) +{ + //Check if we have a current target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->isAttackReady()) + { + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } +} + +void ScriptedAI::EnterEvadeMode() +{ + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreatureAddon(); + + if (m_creature->isAlive()) + m_creature->GetMotionMaster()->MoveTargetedHome(); + + m_creature->SetLootRecipient(NULL); + + Reset(); +} + +void ScriptedAI::JustRespawned() +{ + Reset(); +} + +void ScriptedAI::DoStartMovement(Unit* pVictim, float fDistance, float fAngle) +{ + if (pVictim) + m_creature->GetMotionMaster()->MoveChase(pVictim, fDistance, fAngle); +} + +void ScriptedAI::DoStartNoMovement(Unit* pVictim) +{ + if (!pVictim) + return; + + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); +} + +void ScriptedAI::DoMeleeAttackIfReady() +{ + //Make sure our attack is ready before checking distance + if (m_creature->isAttackReady()) + { + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } +} + +void ScriptedAI::DoStopAttack() +{ + if (m_creature->getVictim()) + m_creature->AttackStop(); +} + +void ScriptedAI::DoCast(Unit* pTarget, uint32 uiSpellId, bool bTriggered) +{ + if (m_creature->IsNonMeleeSpellCasted(false) && !bTriggered) + return; + + m_creature->CastSpell(pTarget, uiSpellId, bTriggered); +} + +void ScriptedAI::DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered) +{ + if (m_creature->IsNonMeleeSpellCasted(false) && !bTriggered) + return; + + m_creature->CastSpell(pTarget, pSpellInfo, bTriggered); +} + +void ScriptedAI::DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId) +{ + if (!pSource) + return; + + if (!GetSoundEntriesStore()->LookupEntry(uiSoundId)) + { + error_log("SD2: Invalid soundId %u used in DoPlaySoundToSet (Source: TypeId %u, GUID %u)", uiSoundId, pSource->GetTypeId(), pSource->GetGUIDLow()); + return; + } + + pSource->PlayDirectSound(uiSoundId); +} + +Creature* ScriptedAI::DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime) +{ + return m_creature->SummonCreature(uiId,m_creature->GetPositionX()+fX, m_creature->GetPositionY()+fY, m_creature->GetPositionZ()+fZ, fAngle, (TempSummonType)uiType, uiDespawntime); +} + +SpellEntry const* ScriptedAI::SelectSpell(Unit* pTarget, int32 uiSchool, int32 uiMechanic, SelectTarget selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffects) +{ + //No target so we can't cast + if (!pTarget) + return false; + + //Silenced so we can't cast + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + return false; + + //Using the extended script system we first create a list of viable spells + SpellEntry const* apSpell[4]; + memset(apSpell, 0, sizeof(SpellEntry*)*4); + + uint32 uiSpellCount = 0; + + SpellEntry const* pTempSpell; + SpellRangeEntry const* pTempRange; + + //Check if each spell is viable(set it to null if not) + for (uint8 i = 0; i < 4; ++i) + { + pTempSpell = GetSpellStore()->LookupEntry(m_creature->m_spells[i]); + + //This spell doesn't exist + if (!pTempSpell) + continue; + + // Targets and Effects checked first as most used restrictions + //Check the spell targets if specified + if (selectTargets && !(SpellSummary[m_creature->m_spells[i]].Targets & (1 << (selectTargets-1)))) + continue; + + //Check the type of spell if we are looking for a specific spell type + if (selectEffects && !(SpellSummary[m_creature->m_spells[i]].Effects & (1 << (selectEffects-1)))) + continue; + + //Check for school if specified + if (uiSchool >= 0 && pTempSpell->SchoolMask & uiSchool) + continue; + + //Check for spell mechanic if specified + if (uiMechanic >= 0 && pTempSpell->Mechanic != uiMechanic) + continue; + + //Make sure that the spell uses the requested amount of power + if (uiPowerCostMin && pTempSpell->manaCost < uiPowerCostMin) + continue; + + if (uiPowerCostMax && pTempSpell->manaCost > uiPowerCostMax) + continue; + + //Continue if we don't have the mana to actually cast this spell + if (pTempSpell->manaCost > m_creature->GetPower((Powers)pTempSpell->powerType)) + continue; + + //Get the Range + pTempRange = GetSpellRangeStore()->LookupEntry(pTempSpell->rangeIndex); + + //Spell has invalid range store so we can't use it + if (!pTempRange) + continue; + + //Check if the spell meets our range requirements + if (fRangeMin && pTempRange->maxRange < fRangeMin) + continue; + + if (fRangeMax && pTempRange->maxRange > fRangeMax) + continue; + + //Check if our target is in range + if (m_creature->IsWithinDistInMap(pTarget, pTempRange->minRange) || !m_creature->IsWithinDistInMap(pTarget, pTempRange->maxRange)) + continue; + + //All good so lets add it to the spell list + apSpell[uiSpellCount] = pTempSpell; + ++uiSpellCount; + } + + //We got our usable spells so now lets randomly pick one + if (!uiSpellCount) + return NULL; + + return apSpell[urand(0, uiSpellCount -1)]; +} + +bool ScriptedAI::CanCast(Unit* pTarget, SpellEntry const* pSpellEntry, bool bTriggered) +{ + //No target so we can't cast + if (!pTarget || !pSpellEntry) + return false; + + //Silenced so we can't cast + if (!bTriggered && m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SILENCED)) + return false; + + //Check for power + if (!bTriggered && m_creature->GetPower((Powers)pSpellEntry->powerType) < pSpellEntry->manaCost) + return false; + + SpellRangeEntry const* pTempRange = GetSpellRangeStore()->LookupEntry(pSpellEntry->rangeIndex); + + //Spell has invalid range store so we can't use it + if (!pTempRange) + return false; + + //Unit is out of range of this spell + if (!m_creature->IsInRange(pTarget, pTempRange->minRange, pTempRange->maxRange)) + return false; + + return true; +} + +void FillSpellSummary() +{ + SpellSummary = new TSpellSummary[GetSpellStore()->GetNumRows()]; + + SpellEntry const* pTempSpell; + + for (uint32 i = 0; i < GetSpellStore()->GetNumRows(); ++i) + { + SpellSummary[i].Effects = 0; + SpellSummary[i].Targets = 0; + + pTempSpell = GetSpellStore()->LookupEntry(i); + //This spell doesn't exist + if (!pTempSpell) + continue; + + for (uint8 j = 0; j < 3; ++j) + { + //Spell targets self + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_SELF) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SELF-1); + + //Spell targets a single enemy + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE || + pTempSpell->EffectImplicitTargetA[j] == TARGET_CURRENT_ENEMY_COORDINATES) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SINGLE_ENEMY-1); + + //Spell targets AoE at enemy + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA || + pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_INSTANT || + pTempSpell->EffectImplicitTargetA[j] == TARGET_CASTER_COORDINATES || + pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_CHANNELED) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_ENEMY-1); + + //Spell targets an enemy + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_CHAIN_DAMAGE || + pTempSpell->EffectImplicitTargetA[j] == TARGET_CURRENT_ENEMY_COORDINATES || + pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA || + pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_INSTANT || + pTempSpell->EffectImplicitTargetA[j] == TARGET_CASTER_COORDINATES || + pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_ENEMY_IN_AREA_CHANNELED) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_ENEMY-1); + + //Spell targets a single friend(or self) + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_SELF || + pTempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_FRIEND || + pTempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_PARTY) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_SINGLE_FRIEND-1); + + //Spell targets aoe friends + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_PARTY_AROUND_CASTER || + pTempSpell->EffectImplicitTargetA[j] == TARGET_AREAEFFECT_PARTY || + pTempSpell->EffectImplicitTargetA[j] == TARGET_CASTER_COORDINATES) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_AOE_FRIEND-1); + + //Spell targets any friend(or self) + if (pTempSpell->EffectImplicitTargetA[j] == TARGET_SELF || + pTempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_FRIEND || + pTempSpell->EffectImplicitTargetA[j] == TARGET_SINGLE_PARTY || + pTempSpell->EffectImplicitTargetA[j] == TARGET_ALL_PARTY_AROUND_CASTER || + pTempSpell->EffectImplicitTargetA[j] == TARGET_AREAEFFECT_PARTY || + pTempSpell->EffectImplicitTargetA[j] == TARGET_CASTER_COORDINATES) + SpellSummary[i].Targets |= 1 << (SELECT_TARGET_ANY_FRIEND-1); + + //Make sure that this spell includes a damage effect + if (pTempSpell->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE || + pTempSpell->Effect[j] == SPELL_EFFECT_INSTAKILL || + pTempSpell->Effect[j] == SPELL_EFFECT_ENVIRONMENTAL_DAMAGE || + pTempSpell->Effect[j] == SPELL_EFFECT_HEALTH_LEECH) + SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_DAMAGE-1); + + //Make sure that this spell includes a healing effect (or an apply aura with a periodic heal) + if (pTempSpell->Effect[j] == SPELL_EFFECT_HEAL || + pTempSpell->Effect[j] == SPELL_EFFECT_HEAL_MAX_HEALTH || + pTempSpell->Effect[j] == SPELL_EFFECT_HEAL_MECHANICAL || + (pTempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA && pTempSpell->EffectApplyAuraName[j]== 8)) + SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_HEALING-1); + + //Make sure that this spell applies an aura + if (pTempSpell->Effect[j] == SPELL_EFFECT_APPLY_AURA) + SpellSummary[i].Effects |= 1 << (SELECT_EFFECT_AURA-1); + } + } +} + +void ScriptedAI::DoResetThreat() +{ + if (!m_creature->CanHaveThreatList() || m_creature->getThreatManager().isThreatListEmpty()) + { + error_log("SD2: DoResetThreat called for creature that either cannot have threat list or has empty threat list (m_creature entry = %d)", m_creature->GetEntry()); + return; + } + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pUnit && m_creature->getThreatManager().getThreat(pUnit)) + m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); + } +} + +void ScriptedAI::DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO) +{ + if (!pUnit) + return; + + if (pUnit->GetTypeId() != TYPEID_PLAYER) + { + error_log("SD2: Creature " UI64FMTD " (Entry: %u) Tried to teleport non-player unit (Type: %u GUID: " UI64FMTD ") to x: %f y:%f z: %f o: %f. Aborted.", m_creature->GetGUID(), m_creature->GetEntry(), pUnit->GetTypeId(), pUnit->GetGUID(), fX, fY, fZ, fO); + return; + } + + ((Player*)pUnit)->TeleportTo(pUnit->GetMapId(), fX, fY, fZ, fO, TELE_TO_NOT_LEAVE_COMBAT); +} + +Unit* ScriptedAI::DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff) +{ + Unit* pUnit = NULL; + + MaNGOS::MostHPMissingInRangeCheck u_check(m_creature, fRange, uiMinHPDiff); + MaNGOS::UnitLastSearcher searcher(pUnit, u_check); + + Cell::VisitGridObjects(m_creature, searcher, fRange); + + return pUnit; +} + +std::list ScriptedAI::DoFindFriendlyCC(float fRange) +{ + std::list pList; + + MaNGOS::FriendlyCCedInRangeCheck u_check(m_creature, fRange); + MaNGOS::CreatureListSearcher searcher(pList, u_check); + + Cell::VisitGridObjects(m_creature, searcher, fRange); + + return pList; +} + +std::list ScriptedAI::DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId) +{ + std::list pList; + + MaNGOS::FriendlyMissingBuffInRangeCheck u_check(m_creature, fRange, uiSpellId); + MaNGOS::CreatureListSearcher searcher(pList, u_check); + + Cell::VisitGridObjects(m_creature, searcher, fRange); + + return pList; +} + +Player* ScriptedAI::GetPlayerAtMinimumRange(float fMinimumRange) +{ + Player* pPlayer = NULL; + + MaNGOS::AnyPlayerInObjectRangeCheck check(m_creature, fMinimumRange); + MaNGOS::PlayerSearcher searcher(pPlayer, check); + + Cell::VisitWorldObjects(m_creature, searcher, fMinimumRange); + + return pPlayer; +} + +void ScriptedAI::SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand, int32 uiOffHand, int32 uiRanged) +{ + if (bLoadDefault) + { + m_creature->LoadEquipment(m_creature->GetCreatureInfo()->equipmentId,true); + return; + } + + if (uiMainHand >= 0) + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(uiMainHand)); + + if (uiOffHand >= 0) + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, uint32(uiOffHand)); + + if (uiRanged >= 0) + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, uint32(uiRanged)); +} + +void ScriptedAI::SetCombatMovement(bool bCombatMove) +{ + m_bCombatMovement = bCombatMove; +} + +// Hacklike storage used for misc creatures that are expected to evade of outside of a certain area. +// It is assumed the information is found elswehere and can be handled by mangos. So far no luck finding such information/way to extract it. +enum +{ + NPC_BROODLORD = 12017, + NPC_VOID_REAVER = 19516, + NPC_JAN_ALAI = 23578, + NPC_SARTHARION = 28860 +}; + +bool ScriptedAI::EnterEvadeIfOutOfCombatArea(const uint32 uiDiff) +{ + if (m_uiEvadeCheckCooldown < uiDiff) + m_uiEvadeCheckCooldown = 2500; + else + { + m_uiEvadeCheckCooldown -= uiDiff; + return false; + } + + if (m_creature->IsInEvadeMode() || !m_creature->getVictim()) + return false; + + float fX = m_creature->GetPositionX(); + float fY = m_creature->GetPositionY(); + float fZ = m_creature->GetPositionZ(); + + switch(m_creature->GetEntry()) + { + case NPC_BROODLORD: // broodlord (not move down stairs) + if (fZ > 448.60f) + return false; + break; + case NPC_VOID_REAVER: // void reaver (calculate from center of room) + if (m_creature->GetDistance2d(432.59f, 371.93f) < 105.0f) + return false; + break; + case NPC_JAN_ALAI: // jan'alai (calculate by Z) + if (fZ > 12.0f) + return false; + break; + case NPC_SARTHARION: // sartharion (calculate box) + if (fX > 3218.86f && fX < 3275.69f && fY < 572.40f && fY > 484.68f) + return false; + break; + default: + error_log("SD2: EnterEvadeIfOutOfCombatArea used for creature entry %u, but does not have any definition.", m_creature->GetEntry()); + return false; + } + + EnterEvadeMode(); + return true; +} + +void Scripted_NoMovementAI::AttackStart(Unit* pWho) +{ + if (pWho && m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + DoStartNoMovement(pWho); + } +} diff --git a/include/sc_creature.h b/include/sc_creature.h new file mode 100644 index 0000000..b960506 --- /dev/null +++ b/include/sc_creature.h @@ -0,0 +1,186 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_CREATURE_H +#define SC_CREATURE_H + +#include "CreatureAI.h" +#include "Creature.h" + +//Spell targets used by SelectSpell +enum SelectTarget +{ + SELECT_TARGET_DONTCARE = 0, //All target types allowed + + SELECT_TARGET_SELF, //Only Self casting + + SELECT_TARGET_SINGLE_ENEMY, //Only Single Enemy + SELECT_TARGET_AOE_ENEMY, //Only AoE Enemy + SELECT_TARGET_ANY_ENEMY, //AoE or Single Enemy + + SELECT_TARGET_SINGLE_FRIEND, //Only Single Friend + SELECT_TARGET_AOE_FRIEND, //Only AoE Friend + SELECT_TARGET_ANY_FRIEND, //AoE or Single Friend +}; + +//Spell Effects used by SelectSpell +enum SelectEffect +{ + SELECT_EFFECT_DONTCARE = 0, //All spell effects allowed + SELECT_EFFECT_DAMAGE, //Spell does damage + SELECT_EFFECT_HEALING, //Spell does healing + SELECT_EFFECT_AURA, //Spell applies an aura +}; + +enum SCEquip +{ + EQUIP_NO_CHANGE = -1, + EQUIP_UNEQUIP = 0 +}; + +struct MANGOS_DLL_DECL ScriptedAI : public CreatureAI +{ + explicit ScriptedAI(Creature* pCreature); + ~ScriptedAI() {} + + //************* + //CreatureAI Functions + //************* + + //Called if IsVisible(Unit *who) is true at each *who move + void MoveInLineOfSight(Unit*); + + //Called at each attack of m_creature by any victim + void AttackStart(Unit*); + + // Called for reaction at enter to combat if not in combat yet (enemy can be NULL) + void EnterCombat(Unit*); + + //Called at stoping attack by any attacker + void EnterEvadeMode(); + + //Called at any heal cast/item used (call non implemented in mangos) + void HealBy(Unit* pHealer, uint32 uiAmountHealed) {} + + // Called at any Damage to any victim (before damage apply) + void DamageDeal(Unit* pDoneTo, uint32& uiDamage) {} + + // Called at any Damage from any attacker (before damage apply) + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) {} + + //Is unit visible for MoveInLineOfSight + bool IsVisible(Unit* pWho) const; + + //Called at World update tick + void UpdateAI(const uint32); + + //Called at creature death + void JustDied(Unit*) {} + + //Called at creature killing another unit + void KilledUnit(Unit*) {} + + // Called when the creature summon successfully other creature + void JustSummoned(Creature*) {} + + // Called when a summoned creature is despawned + void SummonedCreatureDespawn(Creature*) {} + + // Called when hit by a spell + void SpellHit(Unit*, const SpellEntry*) {} + + // Called when creature is spawned or respawned (for reseting variables) + void JustRespawned(); + + //Called at waypoint reached or PointMovement end + void MovementInform(uint32, uint32) {} + + //************* + // Variables + //************* + + //************* + //Pure virtual functions + //************* + + //Called at creature reset either by death or evade + virtual void Reset() = 0; + + //Called at creature EnterCombat + virtual void Aggro(Unit*); + + //************* + //AI Helper Functions + //************* + + //Start movement toward victim + void DoStartMovement(Unit* pVictim, float fDistance = 0, float fAngle = 0); + + //Start no movement on victim + void DoStartNoMovement(Unit* pVictim); + + //Do melee swing of current victim if in rnage and ready and not casting + void DoMeleeAttackIfReady(); + + //Stop attack of current victim + void DoStopAttack(); + + //Cast spell by Id + void DoCast(Unit* pTarget, uint32 uiSpellId, bool bTriggered = false); + + //Cast spell by spell info + void DoCastSpell(Unit* pTarget, SpellEntry const* pSpellInfo, bool bTriggered = false); + + //Plays a sound to all nearby players + void DoPlaySoundToSet(WorldObject* pSource, uint32 uiSoundId); + + //Drops all threat to 0%. Does not remove players from the threat list + void DoResetThreat(); + + //Teleports a player without dropping threat (only teleports to same map) + void DoTeleportPlayer(Unit* pUnit, float fX, float fY, float fZ, float fO); + + //Returns friendly unit with the most amount of hp missing from max hp + Unit* DoSelectLowestHpFriendly(float fRange, uint32 uiMinHPDiff = 1); + + //Returns a list of friendly CC'd units within range + std::list DoFindFriendlyCC(float fRange); + + //Returns a list of all friendly units missing a specific buff within range + std::list DoFindFriendlyMissingBuff(float fRange, uint32 uiSpellId); + + //Return a player with at least minimumRange from m_creature + Player* GetPlayerAtMinimumRange(float fMinimumRange); + + //Spawns a creature relative to m_creature + Creature* DoSpawnCreature(uint32 uiId, float fX, float fY, float fZ, float fAngle, uint32 uiType, uint32 uiDespawntime); + + //Returns spells that meet the specified criteria from the creatures spell list + SpellEntry const* SelectSpell(Unit* pTarget, int32 uiSchool, int32 uiMechanic, SelectTarget selectTargets, uint32 uiPowerCostMin, uint32 uiPowerCostMax, float fRangeMin, float fRangeMax, SelectEffect selectEffect); + + //Checks if you can cast the specified spell + bool CanCast(Unit* pTarget, SpellEntry const* pSpell, bool bTriggered = false); + + void SetEquipmentSlots(bool bLoadDefault, int32 uiMainHand = EQUIP_NO_CHANGE, int32 uiOffHand = EQUIP_NO_CHANGE, int32 uiRanged = EQUIP_NO_CHANGE); + + //Generally used to control if MoveChase() is to be used or not in AttackStart(). Some creatures does not chase victims + void SetCombatMovement(bool bCombatMove); + bool IsCombatMovement() { return m_bCombatMovement; } + + bool EnterEvadeIfOutOfCombatArea(const uint32 uiDiff); + + private: + bool m_bCombatMovement; + uint32 m_uiEvadeCheckCooldown; +}; + +struct MANGOS_DLL_DECL Scripted_NoMovementAI : public ScriptedAI +{ + Scripted_NoMovementAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + //Called at each attack of m_creature by any victim + void AttackStart(Unit*); +}; + +#endif diff --git a/include/sc_gossip.h b/include/sc_gossip.h new file mode 100644 index 0000000..d9916c0 --- /dev/null +++ b/include/sc_gossip.h @@ -0,0 +1,188 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_GOSSIP_H +#define SC_GOSSIP_H + +#include "Player.h" +#include "GossipDef.h" +#include "QuestDef.h" + +// Gossip Item Text +#define GOSSIP_TEXT_BROWSE_GOODS "I'd like to browse your goods." +#define GOSSIP_TEXT_TRAIN "Train me!" + +#define GOSSIP_TEXT_BANK "The bank" +#define GOSSIP_TEXT_IRONFORGE_BANK "The bank of Ironforge" +#define GOSSIP_TEXT_STORMWIND_BANK "The bank of Stormwind" +#define GOSSIP_TEXT_WINDRIDER "The wind rider master" +#define GOSSIP_TEXT_GRYPHON "The gryphon master" +#define GOSSIP_TEXT_BATHANDLER "The bat handler" +#define GOSSIP_TEXT_HIPPOGRYPH "The hippogryph master" +#define GOSSIP_TEXT_ZEPPLINMASTER "The zeppelin master" +#define GOSSIP_TEXT_DEEPRUNTRAM "The Deeprun Tram" +#define GOSSIP_TEXT_FERRY "The Rut'theran Ferry" +#define GOSSIP_TEXT_FLIGHTMASTER "The flight master" +#define GOSSIP_TEXT_AUCTIONHOUSE "The auction house" +#define GOSSIP_TEXT_GUILDMASTER "The guild master" +#define GOSSIP_TEXT_INN "The inn" +#define GOSSIP_TEXT_MAILBOX "The mailbox" +#define GOSSIP_TEXT_STABLEMASTER "The stable master" +#define GOSSIP_TEXT_WEAPONMASTER "The weapon master" +#define GOSSIP_TEXT_OFFICERS "The officers' lounge" +#define GOSSIP_TEXT_BATTLEMASTER "The battlemaster" +#define GOSSIP_TEXT_BARBER "Barber" +#define GOSSIP_TEXT_CLASSTRAINER "A class trainer" +#define GOSSIP_TEXT_PROFTRAINER "A profession trainer" +#define GOSSIP_TEXT_LEXICON "Lexicon of Power" + +#define GOSSIP_TEXT_ALTERACVALLEY "Alterac Valley" +#define GOSSIP_TEXT_ARATHIBASIN "Arathi Basin" +#define GOSSIP_TEXT_WARSONGULCH "Warsong Gulch" +#define GOSSIP_TEXT_ARENA "Arena" +#define GOSSIP_TEXT_EYEOFTHESTORM "Eye of The Storm" +#define GOSSIP_TEXT_STRANDOFANCIENT "Strand of the Ancients" + +#define GOSSIP_TEXT_DEATH_KNIGHT "Death Knight" +#define GOSSIP_TEXT_DRUID "Druid" +#define GOSSIP_TEXT_HUNTER "Hunter" +#define GOSSIP_TEXT_PRIEST "Priest" +#define GOSSIP_TEXT_ROGUE "Rogue" +#define GOSSIP_TEXT_WARRIOR "Warrior" +#define GOSSIP_TEXT_PALADIN "Paladin" +#define GOSSIP_TEXT_SHAMAN "Shaman" +#define GOSSIP_TEXT_MAGE "Mage" +#define GOSSIP_TEXT_WARLOCK "Warlock" + +#define GOSSIP_TEXT_ALCHEMY "Alchemy" +#define GOSSIP_TEXT_BLACKSMITHING "Blacksmithing" +#define GOSSIP_TEXT_COOKING "Cooking" +#define GOSSIP_TEXT_ENCHANTING "Enchanting" +#define GOSSIP_TEXT_ENGINEERING "Engineering" +#define GOSSIP_TEXT_FIRSTAID "First Aid" +#define GOSSIP_TEXT_HERBALISM "Herbalism" +#define GOSSIP_TEXT_LEATHERWORKING "Leatherworking" +#define GOSSIP_TEXT_TAILORING "Tailoring" +#define GOSSIP_TEXT_MINING "Mining" +#define GOSSIP_TEXT_FISHING "Fishing" +#define GOSSIP_TEXT_SKINNING "Skinning" +#define GOSSIP_TEXT_JEWELCRAFTING "Jewelcrafting" +#define GOSSIP_TEXT_INSCRIPTION "Inscription" + +enum +{ + // Skill defines + TRADESKILL_ALCHEMY = 1, + TRADESKILL_BLACKSMITHING = 2, + TRADESKILL_COOKING = 3, + TRADESKILL_ENCHANTING = 4, + TRADESKILL_ENGINEERING = 5, + TRADESKILL_FIRSTAID = 6, + TRADESKILL_HERBALISM = 7, + TRADESKILL_LEATHERWORKING = 8, + TRADESKILL_POISONS = 9, + TRADESKILL_TAILORING = 10, + TRADESKILL_MINING = 11, + TRADESKILL_FISHING = 12, + TRADESKILL_SKINNING = 13, + TRADESKILL_JEWLCRAFTING = 14, + TRADESKILL_INSCRIPTION = 15, + + TRADESKILL_LEVEL_NONE = 0, + TRADESKILL_LEVEL_APPRENTICE = 1, + TRADESKILL_LEVEL_JOURNEYMAN = 2, + TRADESKILL_LEVEL_EXPERT = 3, + TRADESKILL_LEVEL_ARTISAN = 4, + TRADESKILL_LEVEL_MASTER = 5, + TRADESKILL_LEVEL_GRAND_MASTER = 6, + + // Gossip defines + GOSSIP_ACTION_TRADE = 1, + GOSSIP_ACTION_TRAIN = 2, + GOSSIP_ACTION_TAXI = 3, + GOSSIP_ACTION_GUILD = 4, + GOSSIP_ACTION_BATTLE = 5, + GOSSIP_ACTION_BANK = 6, + GOSSIP_ACTION_INN = 7, + GOSSIP_ACTION_HEAL = 8, + GOSSIP_ACTION_TABARD = 9, + GOSSIP_ACTION_AUCTION = 10, + GOSSIP_ACTION_INN_INFO = 11, + GOSSIP_ACTION_UNLEARN = 12, + GOSSIP_ACTION_INFO_DEF = 1000, + + GOSSIP_SENDER_MAIN = 1, + GOSSIP_SENDER_INN_INFO = 2, + GOSSIP_SENDER_INFO = 3, + GOSSIP_SENDER_SEC_PROFTRAIN = 4, + GOSSIP_SENDER_SEC_CLASSTRAIN = 5, + GOSSIP_SENDER_SEC_BATTLEINFO = 6, + GOSSIP_SENDER_SEC_BANK = 7, + GOSSIP_SENDER_SEC_INN = 8, + GOSSIP_SENDER_SEC_MAILBOX = 9, + GOSSIP_SENDER_SEC_STABLEMASTER = 10 +}; + +extern uint32 GetSkillLevel(Player* pPlayer, uint32 uiSkill); + +// Defined fuctions to use with player. + +// This fuction add's a menu item, +// Icon Id +// Text +// Sender(this is to identify the current Menu with this item) +// Option id (identifies this Menu Item) +// Text to be displayed in pop up box +// Money value in pop up box +// Coded +#define ADD_GOSSIP_ITEM(uiIcon, chrText, uiSender, uiOptionId) PlayerTalkClass->GetGossipMenu().AddMenuItem(uiIcon, chrText, uiSender, uiOptionId, "", 0) +#define ADD_GOSSIP_ITEM_ID(uiIcon, iTextId, uiSender, uiOptionId) PlayerTalkClass->GetGossipMenu().AddMenuItem(uiIcon, iTextId, uiSender, uiOptionId, 0, 0) +#define ADD_GOSSIP_ITEM_EXTENDED(uiIcon, chrText, uiSender, uiOptionId, chrBoxMessage, uiBoxMoney, bCode) PlayerTalkClass->GetGossipMenu().AddMenuItem(uiIcon, chrText, uiSender, uiOptionId, chrBoxMessage, uiBoxMoney, bCode) + +// This fuction Sends the current menu to show to client, uiTextId - NPCTEXTID(uint32) , uiGuid - npc guid(uint64) +#define SEND_GOSSIP_MENU(uiTextId, uiGuid) PlayerTalkClass->SendGossipMenu(uiTextId, uiGuid) + +// This fuction shows POI(point of interest) to client. +// a - position X +// b - position Y +// c - Icon Id +// d - Flags +// e - Data +// f - Location Name +#define SEND_POI(a, b, c, d, e, f) PlayerTalkClass->SendPointOfInterest(a, b, c, d, e, f) + +// Closes the Menu +#define CLOSE_GOSSIP_MENU() PlayerTalkClass->CloseGossip() + +// Fuction to tell to client the details +// a - quest object +// b - npc guid(uint64) +// c - Activate accept(bool) +#define SEND_QUEST_DETAILS(a, b, c) PlayerTalkClass->SendQuestDetails(a, b, c) + +// Fuction to tell to client the requested items to complete quest +// a - quest object +// b - npc guid(uint64) +// c - Iscompletable(bool) +// d - close at cancel(bool) - in case single incomplite ques +#define SEND_REQUESTEDITEMS(a, b, c, d) PlayerTalkClass->SendRequestedItems(a, b, c, d) + +// Fuctions to send NPC lists, a - is always the npc guid(uint64) +#define SEND_VENDORLIST(a) GetSession()->SendListInventory(a) +#define SEND_TRAINERLIST(a) GetSession()->SendTrainerList(a) +#define SEND_BANKERLIST(a) GetSession()->SendShowBank(a) +#define SEND_TABARDLIST(a) GetSession()->SendTabardVendorActivate(a) +#define SEND_TAXILIST(a) GetSession()->SendTaxiStatus(a) + +// Function to send the Auction List, a - npc guid(uint64), b - pointer to npc(Creature*) +#define SEND_AUCTIONLIST(a, b) GetSession()->SendAuctionHello(a, b) + +// Ressurect's the player if is dead. +#define SEND_SPRESURRECT() GetSession()->SendSpiritResurrect() +// ----------------------------------- + +// defined fuctions to use with Creature + +#define QUEST_DIALOG_STATUS(a, b, c) GetSession()->getDialogStatus(a, b, c) +#endif diff --git a/include/sc_grid_searchers.cpp b/include/sc_grid_searchers.cpp new file mode 100644 index 0000000..535c0c4 --- /dev/null +++ b/include/sc_grid_searchers.cpp @@ -0,0 +1,47 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" + +//return closest GO in grid, with range from pSource +GameObject* GetClosestGameObjectWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange) +{ + GameObject* pGo = NULL; + + MaNGOS::NearestGameObjectEntryInObjectRangeCheck go_check(*pSource, uiEntry, fMaxSearchRange); + MaNGOS::GameObjectLastSearcher searcher(pGo, go_check); + + Cell::VisitGridObjects(pSource, searcher, fMaxSearchRange); + + return pGo; +} + +//return closest creature alive in grid, with range from pSource +Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange) +{ + Creature* pCreature = NULL; + + MaNGOS::NearestCreatureEntryWithLiveStateInObjectRangeCheck creature_check(*pSource, uiEntry, true, fMaxSearchRange); + MaNGOS::CreatureLastSearcher searcher(pCreature, creature_check); + + Cell::VisitGridObjects(pSource, searcher, fMaxSearchRange); + + return pCreature; +} + +void GetGameObjectListWithEntryInGrid(std::list& lList , WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange) +{ + AllGameObjectsWithEntryInRangeCheck check(pSource, uiEntry, fMaxSearchRange); + MaNGOS::GameObjectListSearcher searcher(lList, check); + + Cell::VisitGridObjects(pSource, searcher, fMaxSearchRange); +} + +void GetCreatureListWithEntryInGrid(std::list& lList, WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange) +{ + AllCreaturesOfEntryInRangeCheck check(pSource, uiEntry, fMaxSearchRange); + MaNGOS::CreatureListSearcher searcher(lList, check); + + Cell::VisitGridObjects(pSource, searcher, fMaxSearchRange); +} diff --git a/include/sc_grid_searchers.h b/include/sc_grid_searchers.h new file mode 100644 index 0000000..a5c635d --- /dev/null +++ b/include/sc_grid_searchers.h @@ -0,0 +1,103 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_GRIDSEARCH_H +#define SC_GRIDSEARCH_H + +#include "Unit.h" +#include "GameObject.h" + +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" + +struct ObjectDistanceOrder : public std::binary_function +{ + const Unit* m_pSource; + + ObjectDistanceOrder(const Unit* pSource) : m_pSource(pSource) {}; + + bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const + { + return m_pSource->GetDistanceOrder(pLeft, pRight); + } +}; + +struct ObjectDistanceOrderReversed : public std::binary_function +{ + const Unit* m_pSource; + + ObjectDistanceOrderReversed(const Unit* pSource) : m_pSource(pSource) {}; + + bool operator()(const WorldObject* pLeft, const WorldObject* pRight) const + { + return !m_pSource->GetDistanceOrder(pLeft, pRight); + } +}; + +GameObject* GetClosestGameObjectWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange); +Creature* GetClosestCreatureWithEntry(WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange); + +void GetGameObjectListWithEntryInGrid(std::list& lList , WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange); +void GetCreatureListWithEntryInGrid(std::list& lList, WorldObject* pSource, uint32 uiEntry, float fMaxSearchRange); + +class AllGameObjectsWithEntryInRangeCheck +{ + public: + AllGameObjectsWithEntryInRangeCheck(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + WorldObject const& GetFocusObject() const { return *m_pObject; } + bool operator() (GameObject* pGo) + { + if (pGo->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pGo,m_fRange,false)) + return true; + + return false; + } + + private: + const WorldObject* m_pObject; + uint32 m_uiEntry; + float m_fRange; +}; + +class AllCreaturesOfEntryInRangeCheck +{ + public: + AllCreaturesOfEntryInRangeCheck(const WorldObject* pObject, uint32 uiEntry, float fMaxRange) : m_pObject(pObject), m_uiEntry(uiEntry), m_fRange(fMaxRange) {} + WorldObject const& GetFocusObject() const { return *m_pObject; } + bool operator() (Unit* pUnit) + { + if (pUnit->GetEntry() == m_uiEntry && m_pObject->IsWithinDist(pUnit,m_fRange,false)) + return true; + + return false; + } + + private: + const WorldObject* m_pObject; + uint32 m_uiEntry; + float m_fRange; +}; + +//Used in: hyjalAI.cpp +/* +class AllFriendlyCreaturesInGrid +{ + public: + AllFriendlyCreaturesInGrid(Unit const* obj) : pUnit(obj) {} + bool operator() (Unit* u) + { + if (u->isAlive() && u->GetVisibility() == VISIBILITY_ON && u->IsFriendlyTo(pUnit)) + return true; + + return false; + } + + private: + Unit const* pUnit; +}; +*/ + +#endif diff --git a/include/sc_instance.cpp b/include/sc_instance.cpp new file mode 100644 index 0000000..f91b8a0 --- /dev/null +++ b/include/sc_instance.cpp @@ -0,0 +1,58 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" + +//Optional uiWithRestoreTime. If not defined, autoCloseTime will be used (if not 0 by default in *_template) +void ScriptedInstance::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState) +{ + if (!uiGuid) + return; + + if (GameObject* pGo = instance->GetGameObject(uiGuid)) + { + if (pGo->GetGoType() == GAMEOBJECT_TYPE_DOOR || pGo->GetGoType() == GAMEOBJECT_TYPE_BUTTON) + { + if (pGo->getLootState() == GO_READY) + pGo->UseDoorOrButton(uiWithRestoreTime, bUseAlternativeState); + else if (pGo->getLootState() == GO_ACTIVATED) + pGo->ResetDoorOrButton(); + } + else + error_log("SD2: Script call DoUseDoorOrButton, but gameobject entry %u is type %u.",pGo->GetEntry(),pGo->GetGoType()); + } +} + +void ScriptedInstance::DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn) +{ + if (GameObject* pGo = instance->GetGameObject(uiGuid)) + { + //not expect any of these should ever be handled + if (pGo->GetGoType()==GAMEOBJECT_TYPE_FISHINGNODE || pGo->GetGoType()==GAMEOBJECT_TYPE_DOOR || + pGo->GetGoType()==GAMEOBJECT_TYPE_BUTTON || pGo->GetGoType()==GAMEOBJECT_TYPE_TRAP) + return; + + if (pGo->isSpawned()) + return; + + pGo->SetRespawnTime(uiTimeToDespawn); + pGo->Refresh(); + } +} + +void ScriptedInstance::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData) +{ + Map::PlayerList const& lPlayers = instance->GetPlayers(); + + if (!lPlayers.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->SendUpdateWorldState(uiStateId, uiStateData); + } + } + else + debug_log("SD2: DoUpdateWorldState attempt send data but no players in map."); +} diff --git a/include/sc_instance.h b/include/sc_instance.h new file mode 100644 index 0000000..3b44167 --- /dev/null +++ b/include/sc_instance.h @@ -0,0 +1,42 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_INSTANCE_H +#define SC_INSTANCE_H + +#include "InstanceData.h" +#include "Map.h" + +enum EncounterState +{ + NOT_STARTED = 0, + IN_PROGRESS = 1, + FAIL = 2, + DONE = 3, + SPECIAL = 4 +}; + +#define OUT_SAVE_INST_DATA debug_log("SD2: Saving Instance Data for Instance %s (Map %d, Instance Id %d)", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_SAVE_INST_DATA_COMPLETE debug_log("SD2: Saving Instance Data for Instance %s (Map %d, Instance Id %d) completed.", instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_LOAD_INST_DATA(a) debug_log("SD2: Loading Instance Data for Instance %s (Map %d, Instance Id %d). Input is '%s'", instance->GetMapName(), instance->GetId(), instance->GetInstanceId(), a) +#define OUT_LOAD_INST_DATA_COMPLETE debug_log("SD2: Instance Data Load for Instance %s (Map %d, Instance Id: %d) is complete.",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) +#define OUT_LOAD_INST_DATA_FAIL error_log("SD2: Unable to load Instance Data for Instance %s (Map %d, Instance Id: %d).",instance->GetMapName(), instance->GetId(), instance->GetInstanceId()) + +class MANGOS_DLL_DECL ScriptedInstance : public InstanceData +{ + public: + + ScriptedInstance(Map* pMap) : InstanceData(pMap) {} + ~ScriptedInstance() {} + + //change active state of doors or buttons + void DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime = 0, bool bUseAlternativeState = false); + + //Respawns a GO having negative spawntimesecs in gameobject-table + void DoRespawnGameObject(uint64 uiGuid, uint32 uiTimeToDespawn = MINUTE); + + //sends world state update to all players in instance + void DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData); +}; +#endif diff --git a/patches/MaNGOS-9519-ScriptDev2.patch b/patches/MaNGOS-9519-ScriptDev2.patch new file mode 100644 index 0000000..e5e5dca --- /dev/null +++ b/patches/MaNGOS-9519-ScriptDev2.patch @@ -0,0 +1,63 @@ +From 3a3dda6636d81c33c3c9b143f64b5a518bfadb56 Mon Sep 17 00:00:00 2001 +From: Reve +Date: Fri, 5 Mar 2010 21:41:55 +0100 +Subject: [PATCH] ScriptDev2 patch. + +--- + configure.ac | 6 +++++- + src/bindings/Makefile.am | 2 +- + src/mangosd/Makefile.am | 4 ++-- + 3 files changed, 8 insertions(+), 4 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 90b332a..c31ff26 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -308,7 +308,11 @@ AC_CONFIG_FILES([ + src/mangosd/Makefile + src/mangosd/mangosd.conf.dist + src/bindings/Makefile +- src/bindings/universal/Makefile ++ src/bindings/ScriptDev2/Makefile ++ src/bindings/ScriptDev2/scriptdev2.conf.dist ++ src/bindings/ScriptDev2/config.h ++ src/bindings/ScriptDev2/sql/Makefile ++ src/bindings/ScriptDev2/sql/Updates/Makefile + ]) + + ## Configure ACE, if needed +diff --git a/src/bindings/Makefile.am b/src/bindings/Makefile.am +index d7dc654..79ea910 100644 +--- a/src/bindings/Makefile.am ++++ b/src/bindings/Makefile.am +@@ -14,4 +14,4 @@ + # along with this program; if not, write to the Free Software + # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +-SUBDIRS = universal ++SUBDIRS = ScriptDev2 +diff --git a/src/mangosd/Makefile.am b/src/mangosd/Makefile.am +index fe1ace1..40b6fdd 100644 +--- a/src/mangosd/Makefile.am ++++ b/src/mangosd/Makefile.am +@@ -40,7 +40,7 @@ mangos_worldd_SOURCES = \ + + ## Link world daemon against the shared library + mangos_worldd_LDADD = \ +- ../bindings/universal/libmangosscript.la \ ++ ../bindings/ScriptDev2/libmangosscript.la \ + ../game/libmangosgame.a \ + ../shared/Database/libmangosdatabase.a \ + ../shared/Config/libmangosconfig.a \ +@@ -51,7 +51,7 @@ mangos_worldd_LDADD = \ + ../../dep/src/g3dlite/libg3dlite.a \ + ../../dep/src/gsoap/libgsoap.a + +-mangos_worldd_LDFLAGS = -L../../dep/src/g3dlite -L../../dep/src/gsoap -L../bindings/universal/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic ++mangos_worldd_LDFLAGS = -L../../dep/src/g3dlite -L../../dep/src/gsoap -L../bindings/ScriptDev2/ -L$(libdir) $(MANGOS_LIBS) -export-dynamic + + ## Additional files to include when running 'make dist' + # Include world daemon configuration +-- +1.6.5.1.1367.gcd48 + diff --git a/patches/custom/ScriptDev2_1835_to_MaNGOS_0.12.patch b/patches/custom/ScriptDev2_1835_to_MaNGOS_0.12.patch new file mode 100644 index 0000000..9eb4462 --- /dev/null +++ b/patches/custom/ScriptDev2_1835_to_MaNGOS_0.12.patch @@ -0,0 +1,284 @@ +Index: include/precompiled.h +=================================================================== +--- include/precompiled.h (revision 1838) ++++ include/precompiled.h (working copy) +@@ -11,6 +11,11 @@ + #include "sc_grid_searchers.h" + #include "sc_instance.h" + ++enum backports ++{ ++ UNIT_VIRTUAL_ITEM_SLOT_ID = UNIT_VIRTUAL_ITEM_SLOT_DISPLAY ++}; ++ + #ifdef WIN32 + # include + BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) +Index: scripts/kalimdor/azuremyst_isle.cpp +=================================================================== +--- scripts/kalimdor/azuremyst_isle.cpp (revision 1838) ++++ scripts/kalimdor/azuremyst_isle.cpp (working copy) +@@ -103,7 +103,7 @@ + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { +- if (pSpell->SpellFamilyFlags2 & 0x080000000) ++ if (pSpell->Id == 28880) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); +Index: scripts/kalimdor/onyxias_lair/boss_onyxia.cpp +=================================================================== +--- scripts/kalimdor/onyxias_lair/boss_onyxia.cpp (revision 1838) ++++ scripts/kalimdor/onyxias_lair/boss_onyxia.cpp (working copy) +@@ -299,7 +299,7 @@ + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + + // sort of a hack, it is unclear how this really work but the values appear to be valid +- m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); ++ m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND/* | UNIT_BYTE1_FLAG_UNK_2*/); + m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + + if (m_pPointData) +Index: scripts/northrend/dragonblight.cpp +=================================================================== +--- scripts/northrend/dragonblight.cpp (revision 1838) ++++ scripts/northrend/dragonblight.cpp (working copy) +@@ -101,7 +101,7 @@ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); +- pPlayer->SendMovieStart(MOVIE_ID_GATES); ++// pPlayer->SendMovieStart(MOVIE_ID_GATES); + } + + return true; +Index: scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +=================================================================== +--- scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp (revision 1838) ++++ scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp (working copy) +@@ -107,10 +107,10 @@ + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MOONFIRE); + m_uiSpellTimer = 10000; + break; +- case CLASS_DEATH_KNIGHT: +- DoCastSpellIfCan(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); +- m_uiSpellTimer = 10000; +- break; ++// case CLASS_DEATH_KNIGHT: ++// DoCastSpellIfCan(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); ++// m_uiSpellTimer = 10000; ++// break; + } + } + else +Index: scripts/world/item_scripts.cpp +=================================================================== +--- scripts/world/item_scripts.cpp (revision 1838) ++++ scripts/world/item_scripts.cpp (working copy) +@@ -47,7 +47,7 @@ + pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + + if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_ARCANE_CHARGES)) +- Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND); ++ Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_ERROR); + + return true; + } +Index: scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp +=================================================================== +--- scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp (revision 1838) ++++ scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp (working copy) +@@ -91,10 +91,10 @@ + else + DoScriptText(EMOTE_UNLOCK_DOOR_AD, m_creature); + break; +- case 12: +- if (m_uiNpcEntry != NPC_ASH) +- m_creature->HandleEmote(EMOTE_ONESHOT_USESTANDING); +- break; ++// case 12: ++// if (m_uiNpcEntry != NPC_ASH) ++// m_creature->HandleEmote(EMOTE_ONESHOT_USESTANDING); ++// break; + case 13: + if (m_uiNpcEntry == NPC_ASH) + DoScriptText(SAY_POST_DOOR_AS, m_creature); +Index: system/ScriptLoader.cpp +=================================================================== +--- system/ScriptLoader.cpp (revision 1838) ++++ system/ScriptLoader.cpp (working copy) +@@ -263,85 +263,8 @@ + extern void AddSC_winterspring(); + + //northrend +-extern void AddSC_boss_jedoga(); //ahnkahet +-extern void AddSC_boss_nadox(); +-extern void AddSC_boss_taldaram(); +-extern void AddSC_boss_volazj(); +-extern void AddSC_instance_ahnkahet(); +-extern void AddSC_boss_anubarak(); //azjol-nerub +-extern void AddSC_boss_hadronox(); +-extern void AddSC_boss_krikthir(); +-extern void AddSC_instance_azjol_nerub(); +-extern void AddSC_boss_anubarak_trial(); //trial_of_the_crusader +-extern void AddSC_boss_jaraxxus(); +-extern void AddSC_instance_trial_of_the_crusader(); +-extern void AddSC_northrend_beasts(); +-extern void AddSC_trial_of_the_crusader(); +-extern void AddSC_twin_valkyr(); +-extern void AddSC_boss_novos(); //draktharon_keep +-extern void AddSC_boss_tharonja(); +-extern void AddSC_boss_trollgore(); +-extern void AddSC_boss_colossus(); //gundrak +-extern void AddSC_boss_galdarah(); +-extern void AddSC_boss_moorabi(); +-extern void AddSC_boss_sladran(); +-extern void AddSC_instance_gundrak(); +-extern void AddSC_boss_bronjahm(); // ICC, forge_of_souls +-extern void AddSC_boss_devourer_of_souls(); +-extern void AddSC_instance_forge_of_souls(); +-extern void AddSC_boss_anubrekhan(); //naxxramas +-extern void AddSC_boss_four_horsemen(); +-extern void AddSC_boss_faerlina(); +-extern void AddSC_boss_gluth(); +-extern void AddSC_boss_gothik(); +-extern void AddSC_boss_kelthuzad(); +-extern void AddSC_boss_loatheb(); +-extern void AddSC_boss_maexxna(); +-extern void AddSC_boss_noth(); +-extern void AddSC_boss_heigan(); +-extern void AddSC_boss_patchwerk(); +-extern void AddSC_boss_razuvious(); +-extern void AddSC_boss_sapphiron(); +-extern void AddSC_instance_naxxramas(); +-extern void AddSC_boss_anomalus(); //nexus +-extern void AddSC_boss_keristrasza(); +-extern void AddSC_boss_ormorok(); +-extern void AddSC_boss_telestra(); +-extern void AddSC_instance_nexus(); +-extern void AddSC_boss_sartharion(); //obsidian_sanctum +-extern void AddSC_instance_obsidian_sanctum(); +-extern void AddSC_boss_bjarngrim(); //Ulduar, halls_of_lightning +-extern void AddSC_boss_ionar(); +-extern void AddSC_boss_loken(); +-extern void AddSC_boss_volkhan(); +-extern void AddSC_instance_halls_of_lightning(); +-extern void AddSC_boss_maiden_of_grief(); //Ulduar, halls_of_stone +-extern void AddSC_boss_sjonnir(); +-extern void AddSC_halls_of_stone(); +-extern void AddSC_instance_halls_of_stone(); +-extern void AddSC_instance_ulduar(); //ulduar +-extern void AddSC_boss_ingvar(); //utgarde_keep +-extern void AddSC_boss_keleseth(); +-extern void AddSC_boss_skarvald_and_dalronn(); +-extern void AddSC_instance_utgarde_keep(); +-extern void AddSC_utgarde_keep(); +-extern void AddSC_boss_gortok(); //utgarde_pinnacle +-extern void AddSC_boss_skadi(); +-extern void AddSC_boss_svala(); +-extern void AddSC_boss_ymiron(); +-extern void AddSC_instance_pinnacle(); +-extern void AddSC_instance_violet_hold(); //violet_hold +-extern void AddSC_violet_hold(); ++// removed + +-extern void AddSC_borean_tundra(); +-extern void AddSC_dalaran(); +-extern void AddSC_dragonblight(); +-extern void AddSC_howling_fjord(); +-extern void AddSC_icecrown(); +-extern void AddSC_sholazar_basin(); +-extern void AddSC_storm_peaks(); +-extern void AddSC_zuldrak(); +- + //outland + extern void AddSC_boss_exarch_maladaar(); //auchindoun, auchenai_crypts + extern void AddSC_boss_nexusprince_shaffar(); //auchindoun, mana_tombs +@@ -681,85 +604,8 @@ + AddSC_winterspring(); + + //northrend +- AddSC_boss_jedoga(); //ahnkahet +- AddSC_boss_nadox(); +- AddSC_boss_taldaram(); +- AddSC_boss_volazj(); +- AddSC_instance_ahnkahet(); +- AddSC_boss_anubarak(); //azjol-nerub +- AddSC_boss_hadronox(); +- AddSC_boss_krikthir(); +- AddSC_instance_azjol_nerub(); +- AddSC_boss_anubarak_trial(); //trial_of_the_crusader +- AddSC_boss_jaraxxus(); +- AddSC_instance_trial_of_the_crusader(); +- AddSC_northrend_beasts(); +- AddSC_trial_of_the_crusader(); +- AddSC_twin_valkyr(); +- AddSC_boss_novos(); //draktharon_keep +- AddSC_boss_tharonja(); +- AddSC_boss_trollgore(); +- AddSC_boss_colossus(); //gundrak +- AddSC_boss_galdarah(); +- AddSC_boss_moorabi(); +- AddSC_boss_sladran(); +- AddSC_instance_gundrak(); +- AddSC_boss_bronjahm(); // ICC, forge_of_souls +- AddSC_boss_devourer_of_souls(); +- AddSC_instance_forge_of_souls(); +- AddSC_boss_anubrekhan(); //naxxramas +- AddSC_boss_four_horsemen(); +- AddSC_boss_faerlina(); +- AddSC_boss_gluth(); +- AddSC_boss_gothik(); +- AddSC_boss_kelthuzad(); +- AddSC_boss_loatheb(); +- AddSC_boss_maexxna(); +- AddSC_boss_noth(); +- AddSC_boss_heigan(); +- AddSC_boss_patchwerk(); +- AddSC_boss_razuvious(); +- AddSC_boss_sapphiron(); +- AddSC_instance_naxxramas(); +- AddSC_boss_anomalus(); //nexus +- AddSC_boss_keristrasza(); +- AddSC_boss_ormorok(); +- AddSC_boss_telestra(); +- AddSC_instance_nexus(); +- AddSC_boss_sartharion(); //obsidian_sanctum +- AddSC_instance_obsidian_sanctum(); +- AddSC_boss_bjarngrim(); //Ulduar, halls_of_lightning +- AddSC_boss_ionar(); +- AddSC_boss_loken(); +- AddSC_boss_volkhan(); +- AddSC_instance_halls_of_lightning(); +- AddSC_boss_maiden_of_grief(); //Ulduar, halls_of_stone +- AddSC_boss_sjonnir(); +- AddSC_halls_of_stone(); +- AddSC_instance_halls_of_stone(); +- AddSC_instance_ulduar(); //ulduar +- AddSC_boss_ingvar(); //utgarde_keep +- AddSC_boss_keleseth(); +- AddSC_boss_skarvald_and_dalronn(); +- AddSC_instance_utgarde_keep(); +- AddSC_utgarde_keep(); +- AddSC_boss_gortok(); //utgarde_pinnacle +- AddSC_boss_skadi(); +- AddSC_boss_svala(); +- AddSC_boss_ymiron(); +- AddSC_instance_pinnacle(); +- AddSC_instance_violet_hold(); //violet_hold +- AddSC_violet_hold(); ++ // removed + +- AddSC_borean_tundra(); +- AddSC_dalaran(); +- AddSC_dragonblight(); +- AddSC_howling_fjord(); +- AddSC_icecrown(); +- AddSC_sholazar_basin(); +- AddSC_storm_peaks(); +- AddSC_zuldrak(); +- + //outland + AddSC_boss_exarch_maladaar(); //auchindoun, auchenai_crypts + AddSC_boss_nexusprince_shaffar(); //auchindoun, mana_tombs diff --git a/scriptVC100.sln b/scriptVC100.sln new file mode 100644 index 0000000..3860230 --- /dev/null +++ b/scriptVC100.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptDev2", "VC100\100ScriptDev2.vcxproj", "{4295C8A9-79B7-4354-8064-F05FB9CA0C96}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|Win32.ActiveCfg = Debug|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|Win32.Build.0 = Debug|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|x64.ActiveCfg = Debug|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|x64.Build.0 = Debug|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.ActiveCfg = Release|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.Build.0 = Release|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.ActiveCfg = Release|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/scriptVC80.sln b/scriptVC80.sln new file mode 100644 index 0000000..ea245ac --- /dev/null +++ b/scriptVC80.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptDev2", "VC80\80ScriptDev2.vcproj", "{4295C8A9-79B7-4354-8064-F05FB9CA0C96}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|Win32.ActiveCfg = Debug|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|Win32.Build.0 = Debug|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|x64.ActiveCfg = Debug|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|x64.Build.0 = Debug|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.ActiveCfg = Release|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.Build.0 = Release|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.ActiveCfg = Release|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/scriptVC90.sln b/scriptVC90.sln new file mode 100644 index 0000000..05b24d7 --- /dev/null +++ b/scriptVC90.sln @@ -0,0 +1,25 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual Studio 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ScriptDev2", "VC90\90ScriptDev2.vcproj", "{4295C8A9-79B7-4354-8064-F05FB9CA0C96}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|Win32.ActiveCfg = Debug|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|Win32.Build.0 = Debug|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|x64.ActiveCfg = Debug|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Debug|x64.Build.0 = Debug|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.ActiveCfg = Release|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|Win32.Build.0 = Release|Win32 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.ActiveCfg = Release|x64 + {4295C8A9-79B7-4354-8064-F05FB9CA0C96}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/scriptdev2.conf.dist.in b/scriptdev2.conf.dist.in new file mode 100644 index 0000000..486c85c --- /dev/null +++ b/scriptdev2.conf.dist.in @@ -0,0 +1,13 @@ +# ScriptDev2 Configuration file +# This file must be placed within the directory which holds mangosd.conf and realmd.conf + +[ScriptDev2Conf] +ConfVersion=2010062001 + +# Database connection settings for the world server. +# Default: hostname;port;username;password;database +# .;somenumber;username;password;database - use named pipes at Windows +# Named pipes: mySQL required adding "enable-named-pipe" to [mysqld] section my.ini +# .;/path/to/unix_socket;username;password;database - use Unix sockets at Unix/Linux +# Unix sockets: experimental, not tested +ScriptDev2DatabaseInfo = "127.0.0.1;3306;mangos;mangos;scriptdev2" diff --git a/scripts/battlegrounds/battleground.cpp b/scripts/battlegrounds/battleground.cpp new file mode 100644 index 0000000..dcb1b21 --- /dev/null +++ b/scripts/battlegrounds/battleground.cpp @@ -0,0 +1,112 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Battleground +SD%Complete: 100 +SDComment: Spirit guides in battlegrounds will revive all players every 30 sec +SDCategory: Battlegrounds +EndScriptData */ + +#include "precompiled.h" + +// **** Script Info **** +// Spiritguides in battlegrounds resurrecting many players at once +// every 30 seconds - through a channeled spell, which gets autocasted +// the whole time +// if spiritguide despawns all players around him will get teleported +// to the next spiritguide +// here i'm not sure, if a dummyspell exist for it + +// **** Quick Info **** +// battleground spiritguides - this script handles gossipHello +// and JustDied also it let autocast the channel-spell + +enum +{ + SPELL_SPIRIT_HEAL_CHANNEL = 22011, // Spirit Heal Channel + + SPELL_SPIRIT_HEAL = 22012, // Spirit Heal + SPELL_SPIRIT_HEAL_MANA = 44535, // in battlegrounds player get this no-mana-cost-buff + + SPELL_WAITING_TO_RESURRECT = 2584 // players who cancel this aura don't want a resurrection +}; + +struct MANGOS_DLL_DECL npc_spirit_guideAI : public ScriptedAI +{ + npc_spirit_guideAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + } + + void UpdateAI(const uint32 uiDiff) + { + // auto cast the whole time this spell + if (!m_creature->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) + m_creature->CastSpell(m_creature, SPELL_SPIRIT_HEAL_CHANNEL, false); + } + + void CorpseRemoved(uint32 &) + { + // TODO: would be better to cast a dummy spell + Map* pMap = m_creature->GetMap(); + + if (!pMap || !pMap->IsBattleGround()) + return; + + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (!pPlayer || !pPlayer->IsWithinDistInMap(m_creature, 20.0f) || !pPlayer->HasAura(SPELL_WAITING_TO_RESURRECT)) + continue; + + // repop player again - now this node won't be counted and another node is searched + pPlayer->RepopAtGraveyard(); + } + } + + void SpellHitTarget (Unit* pUnit, const SpellEntry* pSpellEntry) + { + if (pSpellEntry->Id == SPELL_SPIRIT_HEAL && pUnit->GetTypeId() == TYPEID_PLAYER + && pUnit->HasAura(SPELL_WAITING_TO_RESURRECT)) + pUnit->CastSpell(pUnit, SPELL_SPIRIT_HEAL_MANA, true); + } +}; + +bool GossipHello_npc_spirit_guide(Player* pPlayer, Creature* pCreature) +{ + pPlayer->CastSpell(pPlayer, SPELL_WAITING_TO_RESURRECT, true); + return true; +} + +CreatureAI* GetAI_npc_spirit_guide(Creature* pCreature) +{ + return new npc_spirit_guideAI(pCreature); +} + +void AddSC_battleground() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_spirit_guide"; + newscript->GetAI = &GetAI_npc_spirit_guide; + newscript->pGossipHello = &GossipHello_npc_spirit_guide; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/alterac_mountains.cpp b/scripts/eastern_kingdoms/alterac_mountains.cpp new file mode 100644 index 0000000..22dbc23 --- /dev/null +++ b/scripts/eastern_kingdoms/alterac_mountains.cpp @@ -0,0 +1,32 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Alterac_Mountains +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Alterac Mountains +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" + +/*void AddSC_alterac_mountains() +{ + Script *newscript; +}*/ diff --git a/scripts/eastern_kingdoms/arathi_highlands.cpp b/scripts/eastern_kingdoms/arathi_highlands.cpp new file mode 100644 index 0000000..88122a1 --- /dev/null +++ b/scripts/eastern_kingdoms/arathi_highlands.cpp @@ -0,0 +1,126 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arathi Highlands +SD%Complete: 100 +SDComment: Quest support: 665 +SDCategory: Arathi Highlands +EndScriptData */ + +/* ContentData +npc_professor_phizzlethorpe +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_professor_phizzlethorpe +######*/ + +enum +{ + SAY_PROGRESS_1 = -1000264, + SAY_PROGRESS_2 = -1000265, + SAY_PROGRESS_3 = -1000266, + EMOTE_PROGRESS_4 = -1000267, + SAY_AGGRO = -1000268, + SAY_PROGRESS_5 = -1000269, + SAY_PROGRESS_6 = -1000270, + SAY_PROGRESS_7 = -1000271, + EMOTE_PROGRESS_8 = -1000272, + SAY_PROGRESS_9 = -1000273, + + QUEST_SUNKEN_TREASURE = 665, + ENTRY_VENGEFUL_SURGE = 2776 +}; + +struct MANGOS_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI +{ + npc_professor_phizzlethorpeAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 4: DoScriptText(SAY_PROGRESS_2, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); break; + case 8: DoScriptText(EMOTE_PROGRESS_4, m_creature); break; + case 9: + m_creature->SummonCreature(ENTRY_VENGEFUL_SURGE, -2056.41f, -2144.01f, 20.59f, 5.70f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + m_creature->SummonCreature(ENTRY_VENGEFUL_SURGE, -2050.17f, -2140.02f, 19.54f, 5.17f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + break; + case 10: DoScriptText(SAY_PROGRESS_5, m_creature, pPlayer); break; + case 11: + DoScriptText(SAY_PROGRESS_6, m_creature, pPlayer); + SetRun(); + break; + case 19: DoScriptText(SAY_PROGRESS_7, m_creature, pPlayer); break; + case 20: + DoScriptText(EMOTE_PROGRESS_8, m_creature); + DoScriptText(SAY_PROGRESS_9, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_SUNKEN_TREASURE, m_creature); + break; + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } +}; + +bool QuestAccept_npc_professor_phizzlethorpe(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_SUNKEN_TREASURE) + { + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE); + DoScriptText(SAY_PROGRESS_1, pCreature, pPlayer); + + if (npc_professor_phizzlethorpeAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest, true); + } + return true; +} + +CreatureAI* GetAI_npc_professor_phizzlethorpe(Creature* pCreature) +{ + return new npc_professor_phizzlethorpeAI(pCreature); +} + +void AddSC_arathi_highlands() +{ + Script * newscript; + + newscript = new Script; + newscript->Name = "npc_professor_phizzlethorpe"; + newscript->GetAI = &GetAI_npc_professor_phizzlethorpe; + newscript->pQuestAccept = &QuestAccept_npc_professor_phizzlethorpe; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp new file mode 100644 index 0000000..cd1d39d --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp @@ -0,0 +1,754 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Blackrock_Depths +SD%Complete: 50 +SDComment: Quest support: 4001, 4342, 7604. Vendor Lokhtos Darkbargainer. +SDCategory: Blackrock Depths +EndScriptData */ + +/* ContentData +go_shadowforge_brazier +at_ring_of_law +npc_grimstone +mob_phalanx +npc_kharan_mighthammer +npc_lokhtos_darkbargainer +EndContentData */ + +#include "precompiled.h" +#include "blackrock_depths.h" +#include "escort_ai.h" + +/*###### +## go_shadowforge_brazier +######*/ + +bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) + { + if (pInstance->GetData(TYPE_LYCEUM) == IN_PROGRESS) + pInstance->SetData(TYPE_LYCEUM, DONE); + else + pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS); + } + return false; +} + +/*###### +## npc_grimstone +######*/ + +enum +{ + SAY_START_1 = -1230004, + SAY_START_2 = -1230005, + SAY_OPEN_EAST_GATE = -1230006, + SAY_SUMMON_BOSS_1 = -1230007, + SAY_SUMMON_BOSS_2 = -1230008, + SAY_OPEN_NORTH_GATE = -1230009, + + NPC_GRIMSTONE = 10096, + NPC_THELDREN = 16059, + + //4 or 6 in total? 1+2+1 / 2+2+2 / 3+3. Depending on this, code should be changed. + MAX_MOB_AMOUNT = 4 +}; + +static uint32 RingMob[]= +{ + 8925, // Dredge Worm + 8926, // Deep Stinger + 8927, // Dark Screecher + 8928, // Burrowing Thundersnout + 8933, // Cave Creeper + 8932, // Borer Beetle +}; + +static uint32 RingBoss[]= +{ + 9027, // Gorosh + 9028, // Grizzle + 9029, // Eviscerator + 9030, // Ok'thor + 9031, // Anub'shiah + 9032, // Hedrum +}; + +bool AreaTrigger_at_ring_of_law(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData()) + { + if (pInstance->GetData(TYPE_RING_OF_LAW) == IN_PROGRESS || pInstance->GetData(TYPE_RING_OF_LAW) == DONE) + return false; + + pInstance->SetData(TYPE_RING_OF_LAW, IN_PROGRESS); + pPlayer->SummonCreature(NPC_GRIMSTONE, 625.559f, -205.618f, -52.735f, 2.609f, TEMPSUMMON_DEAD_DESPAWN, 0); + + return false; + } + return false; +} + +/*###### +## npc_grimstone +######*/ + +//TODO: implement quest part of event (different end boss) +struct MANGOS_DLL_DECL npc_grimstoneAI : public npc_escortAI +{ + npc_grimstoneAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_uiMobSpawnId = urand(0, 5); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint8 m_uiEventPhase; + uint32 m_uiEventTimer; + + uint8 m_uiMobSpawnId; + uint8 m_uiMobCount; + uint32 m_uiMobDeathTimer; + + uint64 m_auiRingMobGUID[MAX_MOB_AMOUNT]; + uint64 m_uiRingBossGUID; + + bool m_bCanWalk; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + memset(&m_auiRingMobGUID, 0, sizeof(m_auiRingMobGUID)); + + m_uiEventTimer = 1000; + m_uiEventPhase = 0; + m_uiMobCount = 0; + m_uiMobDeathTimer = 0; + m_uiRingBossGUID = 0; + + m_bCanWalk = false; + } + + void JustSummoned(Creature* pSummoned) + { + + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + + } + + void DoGate(uint32 id, uint32 state) + { + if (GameObject* pGo = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(id))) + pGo->SetGoState(GOState(state)); + + debug_log("SD2: npc_grimstone, arena gate update state."); + } + + //TODO: move them to center + void SummonRingMob() + { + if (Creature* pTmp = m_creature->SummonCreature(RingMob[m_uiMobSpawnId], 608.960f, -235.322f, -53.907f, 1.857f, TEMPSUMMON_DEAD_DESPAWN, 0)) + m_auiRingMobGUID[m_uiMobCount] = pTmp->GetGUID(); + + ++m_uiMobCount; + + if (m_uiMobCount == MAX_MOB_AMOUNT) + m_uiMobDeathTimer = 2500; + } + + //TODO: move them to center + void SummonRingBoss() + { + if (Creature* pTmp = m_creature->SummonCreature(RingBoss[urand(0, 5)], 644.300f, -175.989f, -53.739f, 3.418f, TEMPSUMMON_DEAD_DESPAWN, 0)) + m_uiRingBossGUID = pTmp->GetGUID(); + + m_uiMobDeathTimer = 2500; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: // Middle reached first time + DoScriptText(urand(0, 1) ? SAY_START_1 : SAY_START_2, m_creature); + m_bCanWalk = false; + m_uiEventTimer = 5000; + break; + case 1: // Reached wall again + DoScriptText(SAY_OPEN_EAST_GATE, m_creature); + m_bCanWalk = false; + m_uiEventTimer = 5000; + break; + case 2: // walking along the wall, while door opened + m_bCanWalk = false; + break; + case 3: // Middle reached second time + DoScriptText(urand(0, 1) ? SAY_SUMMON_BOSS_1 : SAY_SUMMON_BOSS_2, m_creature); + break; + case 4: // Reached North Gate + DoScriptText(SAY_OPEN_NORTH_GATE, m_creature);//6 + m_bCanWalk = false; + m_uiEventTimer = 5000; + break; + case 5: + if (m_pInstance) + { + m_pInstance->SetData(TYPE_RING_OF_LAW, DONE); + debug_log("SD2: npc_grimstone: event reached end and set complete."); + } + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_pInstance) + return; + + if (m_uiMobDeathTimer) + { + if (m_uiMobDeathTimer <= uiDiff) + { + m_uiMobDeathTimer = 2500; + + if (m_uiRingBossGUID) + { + Creature* pBoss = m_creature->GetMap()->GetCreature(m_uiRingBossGUID); + if (pBoss && !pBoss->isAlive() && pBoss->isDead()) + { + m_uiRingBossGUID = 0; + m_uiEventTimer = 5000; + m_uiMobDeathTimer = 0; + return; + } + return; + } + + for(uint8 i = 0; i < MAX_MOB_AMOUNT; ++i) + { + Creature* pMob = m_creature->GetMap()->GetCreature(m_auiRingMobGUID[i]); + if (pMob && !pMob->isAlive() && pMob->isDead()) + { + m_auiRingMobGUID[i] = 0; + --m_uiMobCount; + + //seems all are gone, so set timer to continue and discontinue this + if (!m_uiMobCount) + { + m_uiEventTimer = 5000; + m_uiMobDeathTimer = 0; + } + } + } + } + else + m_uiMobDeathTimer -= uiDiff; + } + + if (m_uiEventTimer) + { + if (m_uiEventTimer <= uiDiff) + { + switch(m_uiEventPhase) + { + case 0: + // Shortly after spawn, start walking + //DoScriptText(-1000000, m_creature); // no more text on spawn + DoGate(DATA_ARENA4, GO_STATE_READY); + Start(false); + m_bCanWalk = true; + m_uiEventTimer = 0; + break; + case 1: + // Start walking towards wall + m_bCanWalk = true; + m_uiEventTimer = 0; + break; + case 2: + m_uiEventTimer = 2000; + break; + case 3: + // Open East Gate + DoGate(DATA_ARENA1, GO_STATE_ACTIVE); + m_uiEventTimer = 3000; + break; + case 4: + m_bCanWalk = true; + m_creature->SetVisibility(VISIBILITY_OFF); + SummonRingMob(); + m_uiEventTimer = 8000; + break; + case 5: + SummonRingMob(); + SummonRingMob(); + m_uiEventTimer = 8000; + break; + case 6: + SummonRingMob(); + m_uiEventTimer = 0; + break; + case 7: + // Summoned Mobs are dead, continue event + m_creature->SetVisibility(VISIBILITY_ON); + DoGate(DATA_ARENA1, GO_STATE_READY); + //DoScriptText(-1000000, m_creature); // after killed the mobs, no say here + m_bCanWalk = true; + m_uiEventTimer = 0; + break; + case 8: + // Open North Gate + DoGate(DATA_ARENA2, GO_STATE_ACTIVE); + m_uiEventTimer = 5000; + break; + case 9: + // Summon Boss + m_creature->SetVisibility(VISIBILITY_OFF); + SummonRingBoss(); + m_uiEventTimer = 0; + break; + case 10: + // Boss dead + //if quest, complete + DoGate(DATA_ARENA2, GO_STATE_READY); + DoGate(DATA_ARENA3, GO_STATE_ACTIVE); + DoGate(DATA_ARENA4, GO_STATE_ACTIVE); + m_bCanWalk = true; + m_uiEventTimer = 0; + break; + } + ++m_uiEventPhase; + } + else + m_uiEventTimer -= uiDiff; + } + + if (m_bCanWalk) + npc_escortAI::UpdateAI(uiDiff); + } +}; + +CreatureAI* GetAI_npc_grimstone(Creature* pCreature) +{ + return new npc_grimstoneAI(pCreature); +} + +/*###### +## mob_phalanx +######*/ + +enum +{ + SPELL_THUNDERCLAP = 15588, + SPELL_FIREBALLVOLLEY = 15285, + SPELL_MIGHTYBLOW = 14099 +}; + +struct MANGOS_DLL_DECL mob_phalanxAI : public ScriptedAI +{ + mob_phalanxAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiThunderClapTimer; + uint32 m_uiFireballVolleyTimer; + uint32 m_uiMightyBlowTimer; + + void Reset() + { + m_uiThunderClapTimer = 12000; + m_uiFireballVolleyTimer = 0; + m_uiMightyBlowTimer = 15000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // ThunderClap + if (m_uiThunderClapTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THUNDERCLAP); + m_uiThunderClapTimer = 10000; + } + else + m_uiThunderClapTimer -= uiDiff; + + // FireballVolley + if (m_creature->GetHealthPercent() < 51.0f) + { + if (m_uiFireballVolleyTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIREBALLVOLLEY); + m_uiFireballVolleyTimer = 15000; + } + else + m_uiFireballVolleyTimer -= uiDiff; + } + + // MightyBlow + if (m_uiMightyBlowTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MIGHTYBLOW); + m_uiMightyBlowTimer = 10000; + } + else + m_uiMightyBlowTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_phalanx(Creature* pCreature) +{ + return new mob_phalanxAI(pCreature); +} + +/*###### +## npc_kharan_mighthammer +######*/ +enum +{ + QUEST_WHAT_IS_GOING_ON = 4001, + QUEST_KHARANS_TALE = 4342 +}; + +#define GOSSIP_ITEM_KHARAN_1 "I need to know where the princess are, Kharan!" +#define GOSSIP_ITEM_KHARAN_2 "All is not lost, Kharan!" + +#define GOSSIP_ITEM_KHARAN_3 "Gor'shak is my friend, you can trust me." +#define GOSSIP_ITEM_KHARAN_4 "Not enough, you need to tell me more." +#define GOSSIP_ITEM_KHARAN_5 "So what happened?" +#define GOSSIP_ITEM_KHARAN_6 "Continue..." +#define GOSSIP_ITEM_KHARAN_7 "So you suspect that someone on the inside was involved? That they were tipped off?" +#define GOSSIP_ITEM_KHARAN_8 "Continue with your story please." +#define GOSSIP_ITEM_KHARAN_9 "Indeed." +#define GOSSIP_ITEM_KHARAN_10 "The door is open, Kharan. You are a free man." + +bool GossipHello_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_WHAT_IS_GOING_ON) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (pPlayer->GetQuestStatus(QUEST_KHARANS_TALE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + + if (pPlayer->GetTeam() == HORDE) + pPlayer->SEND_GOSSIP_MENU(2473, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(2474, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_kharan_mighthammer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(2475, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(2476, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(2477, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(2478, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(2479, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_8, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(2480, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_9, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); + pPlayer->SEND_GOSSIP_MENU(2481, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KHARAN_10, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + pPlayer->SEND_GOSSIP_MENU(2482, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pPlayer->GetTeam() == HORDE) + pPlayer->AreaExploredOrEventHappens(QUEST_WHAT_IS_GOING_ON); + else + pPlayer->AreaExploredOrEventHappens(QUEST_KHARANS_TALE); + break; + } + return true; +} + +/*###### +## npc_lokhtos_darkbargainer +######*/ + +enum +{ + FACTION_THORIUM_BROTHERHOOD = 59, + + ITEM_THRORIUM_BROTHERHOOD_CONTRACT = 18628, + ITEM_SULFURON_INGOT = 17203, + + QUEST_A_BINDING_CONTRACT = 7604, + + SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT = 23059 +}; + +#define GOSSIP_ITEM_SHOW_ACCESS "Show me what I have access to, Lothos." +#define GOSSIP_ITEM_GET_CONTRACT "Get Thorium Brotherhood Contract" + +bool GossipHello_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_THORIUM_BROTHERHOOD) >= REP_FRIENDLY) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_ITEM_SHOW_ACCESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (!pPlayer->GetQuestRewardStatus(QUEST_A_BINDING_CONTRACT) && + !pPlayer->HasItemCount(ITEM_THRORIUM_BROTHERHOOD_CONTRACT, 1, true) && + pPlayer->HasItemCount(ITEM_SULFURON_INGOT, 1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GET_CONTRACT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + } + + if (pPlayer->GetReputationRank(FACTION_THORIUM_BROTHERHOOD) < REP_FRIENDLY) + pPlayer->SEND_GOSSIP_MENU(3673, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(3677, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lokhtos_darkbargainer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_CREATE_THORIUM_BROTHERHOOD_CONTRACT, false); + } + + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_rocknot +######*/ + +enum +{ + SAY_GOT_BEER = -1230000, + + SPELL_DRUNKEN_RAGE = 14872, + + QUEST_ALE = 4295 +}; + +struct MANGOS_DLL_DECL npc_rocknotAI : public npc_escortAI +{ + npc_rocknotAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiBreakKegTimer; + uint32 m_uiBreakDoorTimer; + + void Reset() + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + m_uiBreakKegTimer = 0; + m_uiBreakDoorTimer = 0; + } + + void DoGo(uint32 id, uint32 state) + { + if (GameObject* pGo = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(id))) + pGo->SetGoState(GOState(state)); + } + + void WaypointReached(uint32 uiPointId) + { + if (!m_pInstance) + return; + + switch(uiPointId) + { + case 1: + m_creature->HandleEmote(EMOTE_ONESHOT_KICK); + break; + case 2: + m_creature->HandleEmote(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 3: + m_creature->HandleEmote(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 4: + m_creature->HandleEmote(EMOTE_ONESHOT_KICK); + break; + case 5: + m_creature->HandleEmote(EMOTE_ONESHOT_KICK); + m_uiBreakKegTimer = 2000; + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_pInstance) + return; + + if (m_uiBreakKegTimer) + { + if (m_uiBreakKegTimer <= uiDiff) + { + DoGo(DATA_GO_BAR_KEG,0); + m_uiBreakKegTimer = 0; + m_uiBreakDoorTimer = 1000; + } + else + m_uiBreakKegTimer -= uiDiff; + } + + if (m_uiBreakDoorTimer) + { + if (m_uiBreakDoorTimer <= uiDiff) + { + DoGo(DATA_GO_BAR_DOOR, 2); + DoGo(DATA_GO_BAR_KEG_TRAP, 0); //doesn't work very well, leaving code here for future + //spell by trap has effect61, this indicate the bar go hostile + + if (Creature* pTmp = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_PHALANX))) + pTmp->setFaction(14); + + // for later, this event(s) has alot more to it. + // optionally, DONE can trigger bar to go hostile. + m_pInstance->SetData(TYPE_BAR, DONE); + + m_uiBreakDoorTimer = 0; + } + else + m_uiBreakDoorTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_rocknot(Creature* pCreature) +{ + return new npc_rocknotAI(pCreature); +} + +bool ChooseReward_npc_rocknot(Player* pPlayer, Creature* pCreature, const Quest* pQuest, uint32 item) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + if (!pInstance) + return true; + + if (pInstance->GetData(TYPE_BAR) == DONE || pInstance->GetData(TYPE_BAR) == SPECIAL) + return true; + + if (pQuest->GetQuestId() == QUEST_ALE) + { + if (pInstance->GetData(TYPE_BAR) != IN_PROGRESS) + pInstance->SetData(TYPE_BAR,IN_PROGRESS); + + pInstance->SetData(TYPE_BAR,SPECIAL); + + // keep track of amount in instance script, returns SPECIAL if amount ok and event in progress + if (pInstance->GetData(TYPE_BAR) == SPECIAL) + { + DoScriptText(SAY_GOT_BEER, pCreature); + pCreature->CastSpell(pCreature, SPELL_DRUNKEN_RAGE, false); + + if (npc_rocknotAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, 0, NULL, true); + } + } + + return true; +} + +void AddSC_blackrock_depths() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "go_shadowforge_brazier"; + pNewScript->pGOHello = &GOHello_go_shadowforge_brazier; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_ring_of_law"; + pNewScript->pAreaTrigger = &AreaTrigger_at_ring_of_law; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_grimstone"; + pNewScript->GetAI = &GetAI_npc_grimstone; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_phalanx"; + pNewScript->GetAI = &GetAI_mob_phalanx; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_kharan_mighthammer"; + pNewScript->pGossipHello = &GossipHello_npc_kharan_mighthammer; + pNewScript->pGossipSelect = &GossipSelect_npc_kharan_mighthammer; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_lokhtos_darkbargainer"; + pNewScript->pGossipHello = &GossipHello_npc_lokhtos_darkbargainer; + pNewScript->pGossipSelect = &GossipSelect_npc_lokhtos_darkbargainer; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_rocknot"; + pNewScript->GetAI = &GetAI_npc_rocknot; + pNewScript->pChooseReward = &ChooseReward_npc_rocknot; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h new file mode 100644 index 0000000..e17e274 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BRD_H +#define DEF_BRD_H + +enum +{ + TYPE_RING_OF_LAW = 1, + TYPE_VAULT = 2, + TYPE_BAR = 3, + TYPE_TOMB_OF_SEVEN = 4, + TYPE_LYCEUM = 5, + TYPE_IRON_HALL = 6, + + DATA_EMPEROR = 10, + DATA_PRINCESS = 11, + DATA_PHALANX = 12, + DATA_HATEREL = 13, + DATA_ANGERREL = 14, + DATA_VILEREL = 15, + DATA_GLOOMREL = 16, + DATA_SEETHREL = 17, + DATA_DOOMREL = 18, + DATA_DOPEREL = 19, + + DATA_ARENA1 = 20, + DATA_ARENA2 = 21, + DATA_ARENA3 = 22, + DATA_ARENA4 = 23, + + DATA_GO_BAR_KEG = 24, + DATA_GO_BAR_KEG_TRAP = 25, + DATA_GO_BAR_DOOR = 26, + DATA_GO_CHALICE = 27, + DATA_GO_TOMB_EXIT = 28 +}; + +#endif diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp new file mode 100644 index 0000000..ff47a96 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp @@ -0,0 +1,104 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ambassador_Flamelash +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FIREBLAST 15573 + +struct MANGOS_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI +{ + boss_ambassador_flamelashAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 FireBlast_Timer; + uint32 Spirit_Timer; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + FireBlast_Timer = 2000; + Spirit_Timer = 24000; + } + + void SummonSpirits(Unit* victim) + { + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandX -= Rand; break; + case 1: RandX += Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandY -= Rand; break; + case 1: RandY += Rand; break; + } + Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + if (Summoned) + Summoned->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //FireBlast_Timer + if (FireBlast_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FIREBLAST); + FireBlast_Timer = 7000; + }else FireBlast_Timer -= diff; + + //Spirit_Timer + if (Spirit_Timer < diff) + { + SummonSpirits(m_creature->getVictim()); + SummonSpirits(m_creature->getVictim()); + SummonSpirits(m_creature->getVictim()); + SummonSpirits(m_creature->getVictim()); + + Spirit_Timer = 30000; + }else Spirit_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ambassador_flamelash(Creature* pCreature) +{ + return new boss_ambassador_flamelashAI(pCreature); +} + +void AddSC_boss_ambassador_flamelash() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ambassador_flamelash"; + newscript->GetAI = &GetAI_boss_ambassador_flamelash; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp new file mode 100644 index 0000000..1b18a0c --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp @@ -0,0 +1,111 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Anubshiah +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWBOLT 17228 +#define SPELL_CURSEOFTONGUES 15470 +#define SPELL_CURSEOFWEAKNESS 17227 +#define SPELL_DEMONARMOR 11735 +#define SPELL_ENVELOPINGWEB 15471 + +struct MANGOS_DLL_DECL boss_anubshiahAI : public ScriptedAI +{ + boss_anubshiahAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowBolt_Timer; + uint32 CurseOfTongues_Timer; + uint32 CurseOfWeakness_Timer; + uint32 DemonArmor_Timer; + uint32 EnvelopingWeb_Timer; + + void Reset() + { + ShadowBolt_Timer = 7000; + CurseOfTongues_Timer = 24000; + CurseOfWeakness_Timer = 12000; + DemonArmor_Timer = 3000; + EnvelopingWeb_Timer = 16000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 7000; + }else ShadowBolt_Timer -= diff; + + //CurseOfTongues_Timer + if (CurseOfTongues_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_CURSEOFTONGUES); + CurseOfTongues_Timer = 18000; + }else CurseOfTongues_Timer -= diff; + + //CurseOfWeakness_Timer + if (CurseOfWeakness_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); + CurseOfWeakness_Timer = 45000; + }else CurseOfWeakness_Timer -= diff; + + //DemonArmor_Timer + if (DemonArmor_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DEMONARMOR); + DemonArmor_Timer = 300000; + }else DemonArmor_Timer -= diff; + + //EnvelopingWeb_Timer + if (EnvelopingWeb_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_ENVELOPINGWEB); + EnvelopingWeb_Timer = 12000; + }else EnvelopingWeb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_anubshiah(Creature* pCreature) +{ + return new boss_anubshiahAI(pCreature); +} + +void AddSC_boss_anubshiah() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_anubshiah"; + newscript->GetAI = &GetAI_boss_anubshiah; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp new file mode 100644 index 0000000..5ab26b8 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp @@ -0,0 +1,260 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Emperor_Dagran_Thaurissan +SD%Complete: 90 +SDComment: With script for Moria +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_depths.h" + +enum eEmperor +{ + FACTION_NEUTRAL = 734, + SAY_AGGRO = -1230001, + SAY_SLAY = -1230002, + + SPELL_HANDOFTHAURISSAN = 17492, + SPELL_AVATAROFFLAME = 15636 +}; + +struct MANGOS_DLL_DECL boss_emperor_dagran_thaurissanAI : public ScriptedAI +{ + boss_emperor_dagran_thaurissanAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiHandOfThaurissan_Timer; + uint32 m_uiAvatarOfFlame_Timer; + //uint32 m_uiCounter; + + void Reset() + { + m_uiHandOfThaurissan_Timer = 4000; + m_uiAvatarOfFlame_Timer = 25000; + //m_uiCounter = 0; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->CallForHelp(VISIBLE_RANGE); + } + + void JustDied(Unit* pVictim) + { + if (!m_pInstance) + return; + + if (Creature* pPrincess = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_PRINCESS))) + { + if (pPrincess->isAlive()) + { + pPrincess->setFaction(FACTION_NEUTRAL); + pPrincess->AI()->EnterEvadeMode(); + } + } + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiHandOfThaurissan_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget,SPELL_HANDOFTHAURISSAN); + + //3 Hands of Thaurissan will be casted + //if (m_uiCounter < 3) + //{ + // m_uiHandOfThaurissan_Timer = 1000; + // ++m_uiCounter; + //} + //else + //{ + m_uiHandOfThaurissan_Timer = 5000; + //m_uiCounter = 0; + //} + } + else + m_uiHandOfThaurissan_Timer -= uiDiff; + + //AvatarOfFlame_Timer + if (m_uiAvatarOfFlame_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_AVATAROFFLAME); + m_uiAvatarOfFlame_Timer = 18000; + } + else + m_uiAvatarOfFlame_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_emperor_dagran_thaurissan(Creature* pCreature) +{ + return new boss_emperor_dagran_thaurissanAI(pCreature); +} + +/*###### +## boss_moira_bronzebeard +######*/ + +enum ePrincess +{ + SPELL_HEAL = 15586, + SPELL_RENEW = 10929, + SPELL_SHIELD = 10901, + SPELL_MINDBLAST = 15587, + SPELL_SHADOWWORDPAIN = 15654, + SPELL_SMITE = 10934, + SPELL_SHADOW_BOLT = 15537, + SPELL_OPEN_PORTAL = 13912 +}; + +struct MANGOS_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI +{ + boss_moira_bronzebeardAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiHeal_Timer; + uint32 m_uiMindBlast_Timer; + uint32 m_uiShadowWordPain_Timer; + uint32 m_uiSmite_Timer; + + void Reset() + { + m_uiHeal_Timer = 12000; //These times are probably wrong + m_uiMindBlast_Timer = 16000; + m_uiShadowWordPain_Timer = 2000; + m_uiSmite_Timer = 8000; + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f); + } + } + + void JustReachedHome() + { + if (m_pInstance) + { + if (Creature* pEmperor = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_EMPEROR))) + { + // if evade, then check if he is alive. If not, start make portal + if (!pEmperor->isAlive()) + m_creature->CastSpell(m_creature, SPELL_OPEN_PORTAL, false); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //MindBlast_Timer + if (m_uiMindBlast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MINDBLAST); + m_uiMindBlast_Timer = 14000; + } + else + m_uiMindBlast_Timer -= uiDiff; + + //ShadowWordPain_Timer + if (m_uiShadowWordPain_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); + m_uiShadowWordPain_Timer = 18000; + } + else + m_uiShadowWordPain_Timer -= uiDiff; + + //Smite_Timer + if (m_uiSmite_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SMITE); + m_uiSmite_Timer = 10000; + } + else + m_uiSmite_Timer -= uiDiff; + + //Heal_Timer + if (m_uiHeal_Timer < uiDiff) + { + if (Creature* pEmperor = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_EMPEROR))) + { + if (pEmperor->isAlive() && pEmperor->GetHealthPercent() != 100.0f) + DoCastSpellIfCan(pEmperor, SPELL_HEAL); + } + + m_uiHeal_Timer = 10000; + } + else + m_uiHeal_Timer -= uiDiff; + + //No meele? + } +}; + +CreatureAI* GetAI_boss_moira_bronzebeard(Creature* pCreature) +{ + return new boss_moira_bronzebeardAI(pCreature); +} + +void AddSC_boss_draganthaurissan() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_emperor_dagran_thaurissan"; + newscript->GetAI = &GetAI_boss_emperor_dagran_thaurissan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_moira_bronzebeard"; + newscript->GetAI = &GetAI_boss_moira_bronzebeard; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp new file mode 100644 index 0000000..c35606f --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp @@ -0,0 +1,163 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_General_Angerforge +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_MIGHTYBLOW 14099 +#define SPELL_HAMSTRING 9080 +#define SPELL_CLEAVE 20691 + +struct MANGOS_DLL_DECL boss_general_angerforgeAI : public ScriptedAI +{ + boss_general_angerforgeAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 MightyBlow_Timer; + uint32 HamString_Timer; + uint32 Cleave_Timer; + uint32 Adds_Timer; + bool Medics; + int Rand1; + int Rand1X; + int Rand1Y; + int Rand2; + int Rand2X; + int Rand2Y; + Creature* SummonedAdds; + Creature* SummonedMedics; + + void Reset() + { + MightyBlow_Timer = 8000; + HamString_Timer = 12000; + Cleave_Timer = 16000; + Adds_Timer = 0; + Medics = false; + } + + void SummonAdds(Unit* victim) + { + Rand1 = rand()%15; + switch(urand(0, 1)) + { + case 0: Rand1X = 0 - Rand1; break; + case 1: Rand1X = 0 + Rand1; break; + } + Rand1 = 0; + Rand1 = rand()%15; + switch(urand(0, 1)) + { + case 0: Rand1Y = 0 - Rand1; break; + case 1: Rand1Y = 0 + Rand1; break; + } + Rand1 = 0; + SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedAdds) + SummonedAdds->AI()->AttackStart(victim); + } + + void SummonMedics(Unit* victim) + { + Rand2 = rand()%10; + switch(urand(0, 1)) + { + case 0: Rand2X = 0 - Rand2; break; + case 1: Rand2X = 0 + Rand2; break; + } + Rand2 = 0; + Rand2 = rand()%10; + switch(urand(0, 1)) + { + case 0: Rand2Y = 0 - Rand2; break; + case 1: Rand2Y = 0 + Rand2; break; + } + Rand2 = 0; + SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedMedics) + SummonedMedics->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MIGHTYBLOW); + MightyBlow_Timer = 18000; + }else MightyBlow_Timer -= diff; + + //HamString_Timer + if (HamString_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HAMSTRING); + HamString_Timer = 15000; + }else HamString_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 9000; + }else Cleave_Timer -= diff; + + //Adds_Timer + if (m_creature->GetHealthPercent() < 21.0f) + { + if (Adds_Timer < diff) + { + // summon 3 Adds every 25s + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + + Adds_Timer = 25000; + } else Adds_Timer -= diff; + } + + //Summon Medics + if (!Medics && m_creature->GetHealthPercent() < 21.0f) + { + SummonMedics(m_creature->getVictim()); + SummonMedics(m_creature->getVictim()); + Medics = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_general_angerforge(Creature* pCreature) +{ + return new boss_general_angerforgeAI(pCreature); +} + +void AddSC_boss_general_angerforge() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_general_angerforge"; + newscript->GetAI = &GetAI_boss_general_angerforge; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp new file mode 100644 index 0000000..b46316d --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp @@ -0,0 +1,77 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gorosh_the_Dervish +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_WHIRLWIND 15589 +#define SPELL_MORTALSTRIKE 24573 + +struct MANGOS_DLL_DECL boss_gorosh_the_dervishAI : public ScriptedAI +{ + boss_gorosh_the_dervishAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 WhirlWind_Timer; + uint32 MortalStrike_Timer; + + void Reset() + { + WhirlWind_Timer = 12000; + MortalStrike_Timer = 22000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //WhirlWind_Timer + if (WhirlWind_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_WHIRLWIND); + WhirlWind_Timer = 15000; + }else WhirlWind_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = 15000; + }else MortalStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gorosh_the_dervish(Creature* pCreature) +{ + return new boss_gorosh_the_dervishAI(pCreature); +} + +void AddSC_boss_gorosh_the_dervish() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gorosh_the_dervish"; + newscript->GetAI = &GetAI_boss_gorosh_the_dervish; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp new file mode 100644 index 0000000..a2a9d25 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp @@ -0,0 +1,85 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grizzle +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + +#define SPELL_GROUNDTREMOR 6524 +#define SPELL_FRENZY 28371 + +struct MANGOS_DLL_DECL boss_grizzleAI : public ScriptedAI +{ + boss_grizzleAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 GroundTremor_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + GroundTremor_Timer = 12000; + Frenzy_Timer =0; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //GroundTremor_Timer + if (GroundTremor_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_GROUNDTREMOR); + GroundTremor_Timer = 8000; + }else GroundTremor_Timer -= diff; + + //Frenzy_Timer + if (m_creature->GetHealthPercent() < 51.0f) + { + if (Frenzy_Timer < diff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FRENZY) == CAST_OK) + { + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + Frenzy_Timer = 15000; + } + }else Frenzy_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grizzle(Creature* pCreature) +{ + return new boss_grizzleAI(pCreature); +} + +void AddSC_boss_grizzle() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grizzle"; + newscript->GetAI = &GetAI_boss_grizzle; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp new file mode 100644 index 0000000..2cb75de --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp @@ -0,0 +1,113 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_Interrogator_Gerstahn +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_SHADOWWORDPAIN = 14032, + SPELL_MANABURN = 14033, + SPELL_PSYCHICSCREAM = 13704, + SPELL_SHADOWSHIELD = 12040 +}; + +struct MANGOS_DLL_DECL boss_high_interrogator_gerstahnAI : public ScriptedAI +{ + boss_high_interrogator_gerstahnAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiShadowWordPain_Timer; + uint32 m_uiManaBurn_Timer; + uint32 m_uiPsychicScream_Timer; + uint32 m_uiShadowShield_Timer; + + void Reset() + { + m_uiShadowWordPain_Timer = 4000; + m_uiManaBurn_Timer = 14000; + m_uiPsychicScream_Timer = 32000; + m_uiShadowShield_Timer = 8000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowWordPain_Timer + if (m_uiShadowWordPain_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_SHADOWWORDPAIN); + + m_uiShadowWordPain_Timer = 7000; + } + else + m_uiShadowWordPain_Timer -= uiDiff; + + //ManaBurn_Timer + if (m_uiManaBurn_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_MANABURN); + + m_uiManaBurn_Timer = 10000; + } + else + m_uiManaBurn_Timer -= uiDiff; + + //PsychicScream_Timer + if (m_uiPsychicScream_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PSYCHICSCREAM); + m_uiPsychicScream_Timer = 30000; + } + else + m_uiPsychicScream_Timer -= uiDiff; + + //ShadowShield_Timer + if (m_uiShadowShield_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHADOWSHIELD); + m_uiShadowShield_Timer = 25000; + } + else + m_uiShadowShield_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_interrogator_gerstahn(Creature* pCreature) +{ + return new boss_high_interrogator_gerstahnAI(pCreature); +} + +void AddSC_boss_high_interrogator_gerstahn() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_high_interrogator_gerstahn"; + newscript->GetAI = &GetAI_boss_high_interrogator_gerstahn; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp new file mode 100644 index 0000000..3fbbee9 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp @@ -0,0 +1,113 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Magmus +SD%Complete: 80 +SDComment: Missing pre-event to open doors +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_depths.h" + +enum +{ + SPELL_FIERYBURST = 13900, + SPELL_WARSTOMP = 24375 +}; + +struct MANGOS_DLL_DECL boss_magmusAI : public ScriptedAI +{ + boss_magmusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiFieryBurst_Timer; + uint32 m_uiWarStomp_Timer; + + void Reset() + { + m_uiFieryBurst_Timer = 5000; + m_uiWarStomp_Timer = 0; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_IRON_HALL, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_IRON_HALL, FAIL); + } + + void JustDied(Unit* pVictim) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_IRON_HALL, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //FieryBurst_Timer + if (m_uiFieryBurst_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FIERYBURST); + m_uiFieryBurst_Timer = 6000; + } + else + m_uiFieryBurst_Timer -= uiDiff; + + //WarStomp_Timer + if (m_creature->GetHealthPercent() < 51.0f) + { + if (m_uiWarStomp_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_WARSTOMP); + m_uiWarStomp_Timer = 8000; + } + else + m_uiWarStomp_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_magmus(Creature* pCreature) +{ + return new boss_magmusAI(pCreature); +} + +void AddSC_boss_magmus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magmus"; + newscript->GetAI = &GetAI_boss_magmus; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp b/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp new file mode 100644 index 0000000..e80efe2 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp @@ -0,0 +1,325 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Tomb_Of_Seven +SD%Complete: 90 +SDComment: Learning Smelt Dark Iron if tribute quest rewarded. Basic event implemented. Correct order and timing of event is unknown. +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_depths.h" + +enum +{ + FACTION_NEUTRAL = 734, + FACTION_HOSTILE = 754, + + SPELL_SMELT_DARK_IRON = 14891, + SPELL_LEARN_SMELT = 14894, + QUEST_SPECTRAL_CHALICE = 4083, + SKILLPOINT_MIN = 230 +}; + +#define GOSSIP_ITEM_TEACH_1 "Teach me the art of smelting dark iron" +#define GOSSIP_ITEM_TEACH_2 "Continue..." +#define GOSSIP_ITEM_TRIBUTE "I want to pay tribute" + +bool GossipHello_boss_gloomrel(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_TOMB_OF_SEVEN) == NOT_STARTED) + { + if (pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) && + pPlayer->GetSkillValue(SKILL_MINING) >= SKILLPOINT_MIN && + !pPlayer->HasSpell(SPELL_SMELT_DARK_IRON)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (!pPlayer->GetQuestRewardStatus(QUEST_SPECTRAL_CHALICE) && + pPlayer->GetSkillValue(SKILL_MINING) >= SKILLPOINT_MIN) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + } + } + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_boss_gloomrel(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEACH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(2606, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_LEARN_SMELT, false); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + pPlayer->SEND_GOSSIP_MENU(2604, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + pPlayer->CLOSE_GOSSIP_MENU(); + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + //are 5 minutes expected? go template may have data to despawn when used at quest + pInstance->DoRespawnGameObject(pInstance->GetData64(DATA_GO_CHALICE),MINUTE*5); + } + break; + } + return true; +} + +enum +{ + SPELL_SHADOWBOLTVOLLEY = 15245, + SPELL_IMMOLATE = 12742, + SPELL_CURSEOFWEAKNESS = 12493, + SPELL_DEMONARMOR = 13787, + SPELL_SUMMON_VOIDWALKERS = 15092, + + SAY_DOOMREL_START_EVENT = -1230003, + + MAX_DWARF = 7 +}; + +#define GOSSIP_ITEM_CHALLENGE "Your bondage is at an end, Doom'rel. I challenge you!" + +struct MANGOS_DLL_DECL boss_doomrelAI : public ScriptedAI +{ + boss_doomrelAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiShadowVolley_Timer; + uint32 m_uiImmolate_Timer; + uint32 m_uiCurseOfWeakness_Timer; + uint32 m_uiDemonArmor_Timer; + uint32 m_uiCallToFight_Timer; + uint8 m_uiDwarfRound; + bool m_bHasSummoned; + + void Reset() + { + m_uiShadowVolley_Timer = 10000; + m_uiImmolate_Timer = 18000; + m_uiCurseOfWeakness_Timer = 5000; + m_uiDemonArmor_Timer = 16000; + m_uiCallToFight_Timer = 0; + m_uiDwarfRound = 0; + m_bHasSummoned = false; + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_TOMB_OF_SEVEN, FAIL); + } + + void JustDied(Unit *victim) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_TOMB_OF_SEVEN, DONE); + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + pSummoned->AI()->AttackStart(pTarget); + } + + Creature* GetDwarfForPhase(uint8 uiPhase) + { + switch(uiPhase) + { + case 0: + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_ANGERREL)); + case 1: + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SEETHREL)); + case 2: + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_DOPEREL)); + case 3: + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GLOOMREL)); + case 4: + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VILEREL)); + case 5: + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_HATEREL)); + case 6: + return m_creature; + } + return NULL; + } + + void CallToFight(bool bStartFight) + { + if (Creature* pDwarf = GetDwarfForPhase(m_uiDwarfRound)) + { + if (bStartFight && pDwarf->isAlive()) + { + pDwarf->setFaction(FACTION_HOSTILE); + pDwarf->SetInCombatWithZone(); // attackstart + } + else + { + if (!pDwarf->isAlive() || pDwarf->isDead()) + pDwarf->Respawn(); + + pDwarf->setFaction(FACTION_NEUTRAL); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_TOMB_OF_SEVEN) == IN_PROGRESS) + { + if (m_uiDwarfRound < MAX_DWARF) + { + if (m_uiCallToFight_Timer < diff) + { + CallToFight(true); + ++m_uiDwarfRound; + m_uiCallToFight_Timer = 30000; + } + else + m_uiCallToFight_Timer -= diff; + } + } + else if (m_pInstance->GetData(TYPE_TOMB_OF_SEVEN) == FAIL) + { + for (m_uiDwarfRound = 0; m_uiDwarfRound < MAX_DWARF; ++m_uiDwarfRound) + CallToFight(false); + + m_uiDwarfRound = 0; + m_uiCallToFight_Timer = 0; + + if (m_pInstance) + m_pInstance->SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED); + } + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowVolley_Timer + if (m_uiShadowVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); + m_uiShadowVolley_Timer = 12000; + } + else + m_uiShadowVolley_Timer -= diff; + + //Immolate_Timer + if (m_uiImmolate_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_IMMOLATE); + + m_uiImmolate_Timer = 25000; + } + else + m_uiImmolate_Timer -= diff; + + //CurseOfWeakness_Timer + if (m_uiCurseOfWeakness_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); + m_uiCurseOfWeakness_Timer = 45000; + } + else + m_uiCurseOfWeakness_Timer -= diff; + + //DemonArmor_Timer + if (m_uiDemonArmor_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DEMONARMOR); + m_uiDemonArmor_Timer = 300000; + } + else + m_uiDemonArmor_Timer -= diff; + + //Summon Voidwalkers + if (!m_bHasSummoned && m_creature->GetHealthPercent() <= 50.0f) + { + m_creature->CastSpell(m_creature, SPELL_SUMMON_VOIDWALKERS, true); + m_bHasSummoned = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_doomrel(Creature* pCreature) +{ + return new boss_doomrelAI(pCreature); +} + +bool GossipHello_boss_doomrel(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_TOMB_OF_SEVEN) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_CHALLENGE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + } + + pPlayer->SEND_GOSSIP_MENU(2601, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_boss_doomrel(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + DoScriptText(SAY_DOOMREL_START_EVENT, pCreature, pPlayer); + // start event + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + pInstance->SetData(TYPE_TOMB_OF_SEVEN, IN_PROGRESS); + + break; + } + return true; +} + +void AddSC_boss_tomb_of_seven() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_gloomrel"; + newscript->pGossipHello = &GossipHello_boss_gloomrel; + newscript->pGossipSelect = &GossipSelect_boss_gloomrel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_doomrel"; + newscript->GetAI = &GetAI_boss_doomrel; + newscript->pGossipHello = &GossipHello_boss_doomrel; + newscript->pGossipSelect = &GossipSelect_boss_doomrel; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp b/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp new file mode 100644 index 0000000..4c5bade --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp @@ -0,0 +1,377 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blackrock_Depths +SD%Complete: 20 +SDComment: events: ring of law +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_depths.h" + +enum +{ + MAX_ENCOUNTER = 6, + + NPC_EMPEROR = 9019, + NPC_PRINCESS = 8929, + NPC_PHALANX = 9502, + NPC_HATEREL = 9034, + NPC_ANGERREL = 9035, + NPC_VILEREL = 9036, + NPC_GLOOMREL = 9037, + NPC_SEETHREL = 9038, + NPC_DOOMREL = 9039, + NPC_DOPEREL = 9040, + + GO_ARENA1 = 161525, + GO_ARENA2 = 161522, + GO_ARENA3 = 161524, + GO_ARENA4 = 161523, + GO_SHADOW_LOCK = 161460, + GO_SHADOW_MECHANISM = 161461, + GO_SHADOW_GIANT_DOOR = 157923, + GO_SHADOW_DUMMY = 161516, + GO_BAR_KEG_SHOT = 170607, + GO_BAR_KEG_TRAP = 171941, + GO_BAR_DOOR = 170571, + GO_TOMB_ENTER = 170576, + GO_TOMB_EXIT = 170577, + GO_LYCEUM = 170558, + GO_GOLEM_ROOM_N = 170573, + GO_GOLEM_ROOM_S = 170574, + GO_THRONE_ROOM = 170575, + + GO_SPECTRAL_CHALICE = 164869, + GO_CHEST_SEVEN = 169243 +}; + +struct MANGOS_DLL_DECL instance_blackrock_depths : public ScriptedInstance +{ + instance_blackrock_depths(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiEmperorGUID; + uint64 m_uiPrincessGUID; + uint64 m_uiPhalanxGUID; + uint64 m_uiHaterelGUID; + uint64 m_uiAngerrelGUID; + uint64 m_uiVilerelGUID; + uint64 m_uiGloomrelGUID; + uint64 m_uiSeethrelGUID; + uint64 m_uiDoomrelGUID; + uint64 m_uiDoperelGUID; + + uint64 m_uiGoArena1GUID; + uint64 m_uiGoArena2GUID; + uint64 m_uiGoArena3GUID; + uint64 m_uiGoArena4GUID; + uint64 m_uiGoShadowLockGUID; + uint64 m_uiGoShadowMechGUID; + uint64 m_uiGoShadowGiantGUID; + uint64 m_uiGoShadowDummyGUID; + uint64 m_uiGoBarKegGUID; + uint64 m_uiGoBarKegTrapGUID; + uint64 m_uiGoBarDoorGUID; + uint64 m_uiGoTombEnterGUID; + uint64 m_uiGoTombExitGUID; + uint64 m_uiGoLyceumGUID; + uint64 m_uiGoGolemNGUID; + uint64 m_uiGoGolemSGUID; + uint64 m_uiGoThroneGUID; + + uint64 m_uiSpectralChaliceGUID; + uint64 m_uiSevensChestGUID; + + uint32 m_uiBarAleCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiEmperorGUID = 0; + m_uiPrincessGUID = 0; + m_uiPhalanxGUID = 0; + m_uiHaterelGUID = 0; + m_uiAngerrelGUID = 0; + m_uiVilerelGUID = 0; + m_uiGloomrelGUID = 0; + m_uiSeethrelGUID = 0; + m_uiDoomrelGUID = 0; + m_uiDoperelGUID = 0; + + m_uiGoArena1GUID = 0; + m_uiGoArena2GUID = 0; + m_uiGoArena3GUID = 0; + m_uiGoArena4GUID = 0; + m_uiGoShadowLockGUID = 0; + m_uiGoShadowMechGUID = 0; + m_uiGoShadowGiantGUID = 0; + m_uiGoShadowDummyGUID = 0; + m_uiGoBarKegGUID = 0; + m_uiGoBarKegTrapGUID = 0; + m_uiGoBarDoorGUID = 0; + m_uiGoTombEnterGUID = 0; + m_uiGoTombExitGUID = 0; + m_uiGoLyceumGUID = 0; + m_uiGoGolemNGUID = 0; + m_uiGoGolemSGUID = 0; + m_uiGoThroneGUID = 0; + + m_uiSpectralChaliceGUID = 0; + m_uiSevensChestGUID = 0; + + m_uiBarAleCount = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_EMPEROR: m_uiEmperorGUID = pCreature->GetGUID(); break; + case NPC_PRINCESS: m_uiPrincessGUID = pCreature->GetGUID(); break; + case NPC_PHALANX: m_uiPhalanxGUID = pCreature->GetGUID(); break; + case NPC_HATEREL: m_uiHaterelGUID = pCreature->GetGUID(); break; + case NPC_ANGERREL: m_uiAngerrelGUID = pCreature->GetGUID(); break; + case NPC_VILEREL: m_uiVilerelGUID = pCreature->GetGUID(); break; + case NPC_GLOOMREL: m_uiGloomrelGUID = pCreature->GetGUID(); break; + case NPC_SEETHREL: m_uiSeethrelGUID = pCreature->GetGUID(); break; + case NPC_DOOMREL: m_uiDoomrelGUID = pCreature->GetGUID(); break; + case NPC_DOPEREL: m_uiDoperelGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_ARENA1: m_uiGoArena1GUID = pGo->GetGUID(); break; + case GO_ARENA2: m_uiGoArena2GUID = pGo->GetGUID(); break; + case GO_ARENA3: m_uiGoArena3GUID = pGo->GetGUID(); break; + case GO_ARENA4: m_uiGoArena4GUID = pGo->GetGUID(); break; + case GO_SHADOW_LOCK: m_uiGoShadowLockGUID = pGo->GetGUID(); break; + case GO_SHADOW_MECHANISM: m_uiGoShadowMechGUID = pGo->GetGUID(); break; + case GO_SHADOW_GIANT_DOOR: m_uiGoShadowGiantGUID = pGo->GetGUID(); break; + case GO_SHADOW_DUMMY: m_uiGoShadowDummyGUID = pGo->GetGUID(); break; + case GO_BAR_KEG_SHOT: m_uiGoBarKegGUID = pGo->GetGUID(); break; + case GO_BAR_KEG_TRAP: m_uiGoBarKegTrapGUID = pGo->GetGUID(); break; + case GO_BAR_DOOR: m_uiGoBarDoorGUID = pGo->GetGUID(); break; + case GO_TOMB_ENTER: m_uiGoTombEnterGUID = pGo->GetGUID(); break; + case GO_TOMB_EXIT: m_uiGoTombExitGUID = pGo->GetGUID(); break; + case GO_LYCEUM: m_uiGoLyceumGUID = pGo->GetGUID(); break; + case GO_GOLEM_ROOM_N: m_uiGoGolemNGUID = pGo->GetGUID(); break; + case GO_GOLEM_ROOM_S: m_uiGoGolemSGUID = pGo->GetGUID(); break; + case GO_THRONE_ROOM: m_uiGoThroneGUID = pGo->GetGUID(); break; + case GO_SPECTRAL_CHALICE: m_uiSpectralChaliceGUID = pGo->GetGUID(); break; + case GO_CHEST_SEVEN: m_uiSevensChestGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Blackrock Depths: SetData update (Type: %u Data %u)", uiType, uiData); + + switch(uiType) + { + case TYPE_RING_OF_LAW: + m_auiEncounter[0] = uiData; + break; + case TYPE_VAULT: + m_auiEncounter[1] = uiData; + break; + case TYPE_BAR: + if (uiData == SPECIAL) + ++m_uiBarAleCount; + else + m_auiEncounter[2] = uiData; + break; + case TYPE_TOMB_OF_SEVEN: + switch(uiData) + { + case IN_PROGRESS: + DoUseDoorOrButton(m_uiGoTombEnterGUID); + break; + case FAIL: + if (m_auiEncounter[3] == IN_PROGRESS)//prevent use more than one time + DoUseDoorOrButton(m_uiGoTombEnterGUID); + break; + case DONE: + DoRespawnGameObject(m_uiSevensChestGUID, HOUR*IN_MILLISECONDS); + DoUseDoorOrButton(m_uiGoTombExitGUID); + DoUseDoorOrButton(m_uiGoTombEnterGUID); + break; + } + m_auiEncounter[3] = uiData; + break; + case TYPE_LYCEUM: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiGoGolemNGUID); + DoUseDoorOrButton(m_uiGoGolemSGUID); + } + m_auiEncounter[4] = uiData; + break; + case TYPE_IRON_HALL: + switch(uiData) + { + case IN_PROGRESS: + DoUseDoorOrButton(m_uiGoGolemNGUID); + DoUseDoorOrButton(m_uiGoGolemSGUID); + break; + case FAIL: + DoUseDoorOrButton(m_uiGoGolemNGUID); + DoUseDoorOrButton(m_uiGoGolemSGUID); + break; + case DONE: + DoUseDoorOrButton(m_uiGoGolemNGUID); + DoUseDoorOrButton(m_uiGoGolemSGUID); + DoUseDoorOrButton(m_uiGoThroneGUID); + break; + } + m_auiEncounter[5] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_RING_OF_LAW: + return m_auiEncounter[0]; + case TYPE_VAULT: + return m_auiEncounter[1]; + case TYPE_BAR: + if (m_auiEncounter[2] == IN_PROGRESS && m_uiBarAleCount == 3) + return SPECIAL; + else + return m_auiEncounter[2]; + case TYPE_TOMB_OF_SEVEN: + return m_auiEncounter[3]; + case TYPE_LYCEUM: + return m_auiEncounter[4]; + case TYPE_IRON_HALL: + return m_auiEncounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_EMPEROR: + return m_uiEmperorGUID; + case DATA_PRINCESS: + return m_uiPrincessGUID; + case DATA_PHALANX: + return m_uiPhalanxGUID; + case DATA_HATEREL: + return m_uiHaterelGUID; + case DATA_ANGERREL: + return m_uiAngerrelGUID; + case DATA_VILEREL: + return m_uiVilerelGUID; + case DATA_GLOOMREL: + return m_uiGloomrelGUID; + case DATA_SEETHREL: + return m_uiSeethrelGUID; + case DATA_DOOMREL: + return m_uiDoomrelGUID; + case DATA_DOPEREL: + return m_uiDoperelGUID; + + case DATA_ARENA1: + return m_uiGoArena1GUID; + case DATA_ARENA2: + return m_uiGoArena2GUID; + case DATA_ARENA3: + return m_uiGoArena3GUID; + case DATA_ARENA4: + return m_uiGoArena4GUID; + + case DATA_GO_BAR_KEG: + return m_uiGoBarKegGUID; + case DATA_GO_BAR_KEG_TRAP: + return m_uiGoBarKegTrapGUID; + case DATA_GO_BAR_DOOR: + return m_uiGoBarDoorGUID; + case DATA_GO_CHALICE: + return m_uiSpectralChaliceGUID; + case DATA_GO_TOMB_EXIT: + return m_uiGoTombExitGUID; + } + return 0; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_blackrock_depths(Map* pMap) +{ + return new instance_blackrock_depths(pMap); +} + +void AddSC_instance_blackrock_depths() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blackrock_depths"; + newscript->GetInstanceData = &GetInstanceData_instance_blackrock_depths; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h b/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h new file mode 100644 index 0000000..40daa55 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLACKROCK_SPIRE_H +#define DEF_BLACKROCK_SPIRE_H + +enum +{ + MAX_ENCOUNTER = 5, + MAX_ROOMS = 7, + + TYPE_ROOM_EVENT = 1, + TYPE_EMBERSEER = 2, + TYPE_FLAMEWREATH = 3, // Only summon once per instance + TYPE_GYTH = 4, + TYPE_VALTHALAK = 5, // Only summon once per instance + + NPC_SCARSHIELD_INFILTRATOR = 10299, + NPC_BLACKHAND_SUMMONER = 9818, + NPC_BLACKHAND_VETERAN = 9819, + NPC_PYROGUARD_EMBERSEER = 9816, + NPC_BLACKHAND_INCANCERATOR = 10316, + NPC_LORD_VICTOR_NEFARIUS = 10162, + NPC_GYTH = 10339, + + // Doors + GO_EMBERSEER_IN = 175244, + GO_DOORS = 175705, + GO_EMBERSEER_OUT = 175153, + GO_GYTH_ENTRY_DOOR = 164726, + GO_GYTH_COMBAT_DOOR = 175185, // control in boss_script, because will auto-close after each wave + GO_GYTH_EXIT_DOOR = 175186, + + + GO_ROOM_7_RUNE = 175194, + GO_ROOM_3_RUNE = 175195, + GO_ROOM_6_RUNE = 175196, + GO_ROOM_1_RUNE = 175197, + GO_ROOM_5_RUNE = 175198, + GO_ROOM_2_RUNE = 175199, + GO_ROOM_4_RUNE = 175200, + + GO_ROOKERY_EGG = 175124, +}; + +class MANGOS_DLL_DECL instance_blackrock_spire : public ScriptedInstance +{ + public: + instance_blackrock_spire(Map* pMap); + ~instance_blackrock_spire() {} + + void Initialize(); + + void OnObjectCreate(GameObject* pGo); + void OnCreatureCreate(Creature* pCreature); + + void SetData(uint32 uiType, uint32 uiData); + void SetData64(uint32 uiType, uint64 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiType); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + void DoSortRoomEventMobs(); + void GetIncanceratorGUIDList(std::list &lList) { lList = m_lIncanceratorGUIDList; } + void GetRookeryEggGUIDList(std::list &lList) { lList = m_lRookeryEggGUIDList; } + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiEmberseerGUID; + uint64 m_uiNefariusGUID; + uint64 m_uiGythGUID; + uint64 m_uiInfiltratorGUID; + + uint64 m_uiEmberseerInDoorGUID; + uint64 m_uiEmberseerCombatDoorGUID; + uint64 m_uiEmberseerOutDoorGUID; + uint64 m_uiGythEntryDoorGUID; + uint64 m_uiGythCombatDoorGUID; + uint64 m_uiGythExitDoorGUID; + + uint64 m_auiRoomRuneGUID[MAX_ROOMS]; + std::list m_alRoomEventMobGUIDSorted[MAX_ROOMS]; + std::list m_lRoomEventMobGUIDList; + std::list m_lIncanceratorGUIDList; + std::list m_lRookeryEggGUIDList; +}; + +#endif diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp new file mode 100644 index 0000000..88a2a78 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp @@ -0,0 +1,109 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Drakkisath +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_FIRENOVA = 23462, + SPELL_CLEAVE = 20691, + SPELL_CONFLIGURATION = 16805, + SPELL_THUNDERCLAP = 15548 //Not sure if right ID. 23931 would be a harder possibility. +}; + +struct MANGOS_DLL_DECL boss_drakkisathAI : public ScriptedAI +{ + boss_drakkisathAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiFireNovaTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiConfligurationTimer; + uint32 m_uiThunderclapTimer; + + void Reset() + { + m_uiFireNovaTimer = 6000; + m_uiCleaveTimer = 8000; + m_uiConfligurationTimer = 15000; + m_uiThunderclapTimer = 17000; + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // FireNova + if (m_uiFireNovaTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FIRENOVA); + m_uiFireNovaTimer = 10000; + } + else + m_uiFireNovaTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 8000; + } + else + m_uiCleaveTimer -= uiDiff; + + // Confliguration + if (m_uiConfligurationTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONFLIGURATION, 0, m_creature->getVictim()->GetGUID()); + m_uiConfligurationTimer = 18000; + } + else + m_uiConfligurationTimer -= uiDiff; + + // Thunderclap + if (m_uiThunderclapTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_THUNDERCLAP); + m_uiThunderclapTimer = 20000; + } + else + m_uiThunderclapTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_drakkisath(Creature* pCreature) +{ + return new boss_drakkisathAI(pCreature); +} + +void AddSC_boss_drakkisath() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_drakkisath"; + newscript->GetAI = &GetAI_boss_drakkisath; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp new file mode 100644 index 0000000..ab6e364 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp @@ -0,0 +1,248 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gyth +SD%Complete: 100 +SDComment: Whole Event needs some rewrite +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_spire.h" + +enum +{ + SPELL_CORROSIVEACID = 20667, + SPELL_FREEZE = 16350, // ID was wrong! + SPELL_FLAMEBREATH = 20712, + SPELL_ROOT_SELF = 33356, + + MODEL_ID_INVISIBLE = 11686, + MODEL_ID_GYTH_MOUNTED = 9723, + MODEL_ID_GYTH = 9806, + + NPC_FIRE_TONGUE = 10372, + NPC_CHROMATIC_WHELP = 10442, + NPC_CHROMATIC_DRAGON = 10447, + NPC_BLACKHAND_ELITE = 10317, + NPC_REND_BLACKHAND = 10429 +}; + +struct MANGOS_DLL_DECL boss_gythAI : public ScriptedAI +{ + boss_gythAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_blackrock_spire*) pCreature->GetInstanceData(); + Reset(); + } + + instance_blackrock_spire* m_pInstance; + uint64 m_uiCombatDoorGUID; + uint32 uiAggroTimer; + uint32 uiDragonsTimer; + uint32 uiOrcTimer; + uint32 uiCorrosiveAcidTimer; + uint32 uiFreezeTimer; + uint32 uiFlamebreathTimer; + uint32 uiLine1Count; + uint32 uiLine2Count; + + bool m_bSummonedRend; + bool m_bAggro; + bool m_bRootSelf; + + void Reset() + { + uiDragonsTimer = 3000; + uiOrcTimer = 60000; + uiAggroTimer = 60000; + uiCorrosiveAcidTimer = 8000; + uiFreezeTimer = 11000; + uiFlamebreathTimer = 4000; + m_bSummonedRend = false; + m_bAggro = false; + m_bRootSelf = false; + + // how many times should the two lines of summoned creatures be spawned + // min 2 x 2, max 7 lines of attack in total + uiLine1Count = urand(2, 5); + uiLine2Count = urand(2, 7 - uiLine1Count); + + // Invisible for event start + m_creature->SetDisplayId(MODEL_ID_INVISIBLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + { + m_pInstance->SetData(TYPE_GYTH, IN_PROGRESS); + m_uiCombatDoorGUID = m_pInstance->GetData64(GO_GYTH_COMBAT_DOOR); + } + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GYTH, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GYTH, FAIL); + } + + void SummonCreatureWithRandomTarget(uint32 uiCreatureId) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 2*INTERACTION_DISTANCE, fX, fY, fZ); + fX = std::min(m_creature->GetPositionX(), fX); // Halfcircle - suits better the rectangular form + if (Creature* pSummoned = m_creature->SummonCreature(uiCreatureId, fX, fY, fZ, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000)) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bRootSelf) + { + DoCastSpellIfCan(m_creature, SPELL_ROOT_SELF); + m_bRootSelf = true; + } + + if (!m_bAggro && uiLine1Count == 0 && uiLine2Count == 0) + { + if (uiAggroTimer < uiDiff) + { + m_bAggro = true; + // Visible now! + m_creature->SetDisplayId(MODEL_ID_GYTH_MOUNTED); + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveAurasDueToSpell(SPELL_ROOT_SELF); + if (m_pInstance) + m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); + + } + else + uiAggroTimer -= uiDiff; + } + + // Summon Dragon pack. 2 Dragons and 3 Whelps + if (!m_bAggro && !m_bSummonedRend && uiLine1Count > 0) + { + if (uiDragonsTimer < uiDiff) + { + SummonCreatureWithRandomTarget(NPC_FIRE_TONGUE); + SummonCreatureWithRandomTarget(NPC_FIRE_TONGUE); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); + --uiLine1Count; + if (m_pInstance) + m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); + uiDragonsTimer = 60000; + } + else + uiDragonsTimer -= uiDiff; + } + + //Summon Orc pack. 1 Orc Handler 1 Elite Dragonkin and 3 Whelps + if (!m_bAggro && !m_bSummonedRend && uiLine1Count == 0 && uiLine2Count > 0) + { + if (uiOrcTimer < uiDiff) + { + SummonCreatureWithRandomTarget(NPC_CHROMATIC_DRAGON); + SummonCreatureWithRandomTarget(NPC_BLACKHAND_ELITE); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); + SummonCreatureWithRandomTarget(NPC_CHROMATIC_WHELP); + if (m_pInstance) + m_pInstance->DoUseDoorOrButton(m_uiCombatDoorGUID); + --uiLine2Count; + uiOrcTimer = 60000; + } + else + uiOrcTimer -= uiDiff; + } + + // we take part in the fight + if (m_bAggro) + { + // CorrosiveAcid_Timer + if (uiCorrosiveAcidTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_CORROSIVEACID); + uiCorrosiveAcidTimer = 7000; + } + else + uiCorrosiveAcidTimer -= uiDiff; + + // Freeze_Timer + if (uiFreezeTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FREEZE) == CAST_OK) + uiFreezeTimer = 16000; + } + else + uiFreezeTimer -= uiDiff; + + // Flamebreath_Timer + if (uiFlamebreathTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FLAMEBREATH); + uiFlamebreathTimer = 10500; + } + else + uiFlamebreathTimer -= uiDiff; + + //Summon Rend + if (!m_bSummonedRend && m_creature->GetHealthPercent() < 11.0f) + { + // summon Rend and Change model to normal Gyth + // Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + // Gyth model + m_creature->SetDisplayId(MODEL_ID_GYTH); + m_creature->SummonCreature(NPC_REND_BLACKHAND, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 900000); + m_bSummonedRend = true; + } + + DoMeleeAttackIfReady(); + } // end if Aggro + } +}; + +CreatureAI* GetAI_boss_gyth(Creature* pCreature) +{ + return new boss_gythAI(pCreature); +} + +void AddSC_boss_gyth() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "boss_gyth"; + pNewScript->GetAI = &GetAI_boss_gyth; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp new file mode 100644 index 0000000..e5c6b29 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Halycon +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_CROWDPUMMEL 10887 +#define SPELL_MIGHTYBLOW 14099 + +#define ADD_1X -169.839203f +#define ADD_1Y -324.961395f +#define ADD_1Z 64.401443f +#define ADD_1O 3.124724f + +struct MANGOS_DLL_DECL boss_halyconAI : public ScriptedAI +{ + boss_halyconAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 CrowdPummel_Timer; + uint32 MightyBlow_Timer; + bool Summoned; + + void Reset() + { + CrowdPummel_Timer = 8000; + MightyBlow_Timer = 14000; + Summoned = false; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //CrowdPummel_Timer + if (CrowdPummel_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 14000; + }else CrowdPummel_Timer -= diff; + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MIGHTYBLOW); + MightyBlow_Timer = 10000; + }else MightyBlow_Timer -= diff; + + //Summon Gizrul + if (!Summoned && m_creature->GetHealthPercent() < 25.0f) + { + m_creature->SummonCreature(10268,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); + Summoned = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_halycon(Creature* pCreature) +{ + return new boss_halyconAI(pCreature); +} + +void AddSC_boss_halycon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_halycon"; + newscript->GetAI = &GetAI_boss_halycon; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp new file mode 100644 index 0000000..7e3c7da --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp @@ -0,0 +1,133 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Highlord_Omokk +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_WARSTOMP = 24375, + SPELL_STRIKE = 18368, + SPELL_REND = 18106, + SPELL_SUNDERARMOR = 24317, + SPELL_KNOCKAWAY = 20686, + SPELL_SLOW = 22356 +}; + +struct MANGOS_DLL_DECL boss_highlordomokkAI : public ScriptedAI +{ + boss_highlordomokkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiWarStompTimer; + uint32 m_uiStrikeTimer; + uint32 m_uiRendTimer; + uint32 m_uiSunderArmorTimer; + uint32 m_uiKnockAwayTimer; + uint32 m_uiSlowTimer; + + void Reset() + { + m_uiWarStompTimer = 15000; + m_uiStrikeTimer = 10000; + m_uiRendTimer = 14000; + m_uiSunderArmorTimer = 2000; + m_uiKnockAwayTimer = 18000; + m_uiSlowTimer = 24000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // WarStomp + if (m_uiWarStompTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WARSTOMP); + m_uiWarStompTimer = 14000; + } + else + m_uiWarStompTimer -= uiDiff; + + // Strike + if (m_uiStrikeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_STRIKE); + m_uiStrikeTimer = 10000; + } + else + m_uiStrikeTimer -= uiDiff; + + // Rend + if (m_uiRendTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_REND); + m_uiRendTimer = 18000; + } + else + m_uiRendTimer -= uiDiff; + + // Sunder Armor + if (m_uiSunderArmorTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUNDERARMOR); + m_uiSunderArmorTimer = 25000; + } + else + m_uiSunderArmorTimer -= uiDiff; + + // KnockAway + if (m_uiKnockAwayTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_KNOCKAWAY); + m_uiKnockAwayTimer = 12000; + } + else + m_uiKnockAwayTimer -= uiDiff; + + // Slow + if (m_uiSlowTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SLOW); + m_uiSlowTimer = 18000; + } + else + m_uiSlowTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_highlordomokk(Creature* pCreature) +{ + return new boss_highlordomokkAI(pCreature); +} + +void AddSC_boss_highlordomokk() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_highlord_omokk"; + newscript->GetAI = &GetAI_boss_highlordomokk; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp new file mode 100644 index 0000000..5e5ac5e --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp @@ -0,0 +1,92 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mother_Smolderweb +SD%Complete: 100 +SDComment: Uncertain how often mother's milk is casted +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_CRYSTALIZE = 16104, + SPELL_MOTHERSMILK = 16468, + SPELL_SUMMON_SPIRE_SPIDERLING = 16103 +}; + +struct MANGOS_DLL_DECL boss_mothersmolderwebAI : public ScriptedAI +{ + boss_mothersmolderwebAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCrystalizeTimer; + uint32 m_uiMothersMilkTimer; + + void Reset() + { + m_uiCrystalizeTimer = 20000; + m_uiMothersMilkTimer = 10000; + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_creature->GetHealth() <= uiDamage) + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SPIRE_SPIDERLING, CAST_TRIGGERED); + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Crystalize + if (m_uiCrystalizeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_CRYSTALIZE); + m_uiCrystalizeTimer = 15000; + } + else + m_uiCrystalizeTimer -= uiDiff; + + // Mothers Milk + if (m_uiMothersMilkTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_MOTHERSMILK); + m_uiMothersMilkTimer = urand(5000, 12500); + } + else + m_uiMothersMilkTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mothersmolderweb(Creature* pCreature) +{ + return new boss_mothersmolderwebAI(pCreature); +} + +void AddSC_boss_mothersmolderweb() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_mother_smolderweb"; + newscript->GetAI = &GetAI_boss_mothersmolderweb; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp new file mode 100644 index 0000000..2eb540a --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp @@ -0,0 +1,142 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Overlord_Wyrmthalak +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_BLASTWAVE = 11130, + SPELL_SHOUT = 23511, + SPELL_CLEAVE = 20691, + SPELL_KNOCKAWAY = 20686, + + NPC_SPIRESTONE_WARLORD = 9216, + NPC_SMOLDERTHORN_BERSERKER = 9268 + +}; + +const float afLocations[2][4]= +{ + {-39.355381f, -513.456482f, 88.472046f, 4.679872f}, + {-49.875881f, -511.896942f, 88.195160f, 4.613114f} +}; + +struct MANGOS_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI +{ + boss_overlordwyrmthalakAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiBlastWaveTimer; + uint32 m_uiShoutTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiKnockawayTimer; + bool m_bSummoned; + + void Reset() + { + m_uiBlastWaveTimer = 20000; + m_uiShoutTimer = 2000; + m_uiCleaveTimer = 6000; + m_uiKnockawayTimer = 12000; + m_bSummoned = false; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() != NPC_SPIRESTONE_WARLORD && pSummoned->GetEntry() != NPC_SMOLDERTHORN_BERSERKER) + return; + + if (m_creature->getVictim()) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // BlastWave + if (m_uiBlastWaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BLASTWAVE); + m_uiBlastWaveTimer = 20000; + } + else + m_uiBlastWaveTimer -= uiDiff; + + // Shout + if (m_uiShoutTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHOUT); + m_uiShoutTimer = 10000; + } + else + m_uiShoutTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 7000; + } + else + m_uiCleaveTimer -= uiDiff; + + // Knockaway + if (m_uiKnockawayTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_KNOCKAWAY); + m_uiKnockawayTimer = 14000; + } + else + m_uiKnockawayTimer -= uiDiff; + + // Summon two Beserks + if (!m_bSummoned && m_creature->GetHealthPercent() < 51.0f) + { + m_creature->SummonCreature(NPC_SPIRESTONE_WARLORD, afLocations[0][0], afLocations[0][1], afLocations[0][2], afLocations[0][3], TEMPSUMMON_TIMED_DESPAWN, 300000); + m_creature->SummonCreature(NPC_SMOLDERTHORN_BERSERKER, afLocations[1][0], afLocations[1][1], afLocations[1][2], afLocations[1][3], TEMPSUMMON_TIMED_DESPAWN, 300000); + + m_bSummoned = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_overlordwyrmthalak(Creature* pCreature) +{ + return new boss_overlordwyrmthalakAI(pCreature); +} + +void AddSC_boss_overlordwyrmthalak() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_overlord_wyrmthalak"; + newscript->GetAI = &GetAI_boss_overlordwyrmthalak; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp new file mode 100644 index 0000000..d9ecd66 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp @@ -0,0 +1,122 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Pyroguard_Emberseer +SD%Complete: 100 +SDComment: Event to activate Emberseer NYI - 'aggro'-text missing +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_spire.h" + +enum +{ + SPELL_FIRENOVA = 23462, + SPELL_FLAMEBUFFET = 23341, + SPELL_PYROBLAST = 20228 // guesswork, but best fitting in spells-area, was 17274 (has mana cost) +}; + +struct MANGOS_DLL_DECL boss_pyroguard_emberseerAI : public ScriptedAI +{ + boss_pyroguard_emberseerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_blackrock_spire*) pCreature->GetInstanceData(); + Reset(); + } + + instance_blackrock_spire* m_pInstance; + uint32 m_uiFireNovaTimer; + uint32 m_uiFlameBuffetTimer; + uint32 m_uiPyroBlastTimer; + + void Reset() + { + m_uiFireNovaTimer = 6000; + m_uiFlameBuffetTimer = 3000; + m_uiPyroBlastTimer = 14000; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_EMBERSEER, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_EMBERSEER, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_EMBERSEER, FAIL); + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // FireNova Timer + if (m_uiFireNovaTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FIRENOVA); + m_uiFireNovaTimer = 6000; + } + else + m_uiFireNovaTimer -= uiDiff; + + // FlameBuffet Timer + if (m_uiFlameBuffetTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FLAMEBUFFET); + m_uiFlameBuffetTimer = 14000; + } + else + m_uiFlameBuffetTimer -= uiDiff; + + // PyroBlast Timer + if (m_uiPyroBlastTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_PYROBLAST); + m_uiPyroBlastTimer = 15000; + } + else + m_uiPyroBlastTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pyroguard_emberseer(Creature* pCreature) +{ + return new boss_pyroguard_emberseerAI(pCreature); +} + +void AddSC_boss_pyroguard_emberseer() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "boss_pyroguard_emberseer"; + pNewScript->GetAI = &GetAI_boss_pyroguard_emberseer; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp new file mode 100644 index 0000000..c99ce92 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp @@ -0,0 +1,89 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Quartmaster_Zigris +SD%Complete: 100 +SDComment: Needs revision +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_SHOOT = 16496, + SPELL_STUNBOMB = 16497, + SPELL_HEALING_POTION = 15504, + SPELL_HOOKEDNET = 15609 +}; + +struct MANGOS_DLL_DECL boss_quatermasterzigrisAI : public ScriptedAI +{ + boss_quatermasterzigrisAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiShootTimer; + uint32 m_uiStunBombTimer; + //uint32 HelingPotion_Timer; + + void Reset() + { + m_uiShootTimer = 1000; + m_uiStunBombTimer = 16000; + //HelingPotion_Timer = 25000; + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Shoot + if (m_uiShootTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHOOT); + m_uiShootTimer = 500; + } + else + m_uiShootTimer -= uiDiff; + + // StunBomb + if (m_uiStunBombTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_STUNBOMB); + m_uiStunBombTimer = 14000; + } + else + m_uiStunBombTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_quatermasterzigris(Creature* pCreature) +{ + return new boss_quatermasterzigrisAI(pCreature); +} + +void AddSC_boss_quatermasterzigris() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "quartermaster_zigris"; + newscript->GetAI = &GetAI_boss_quatermasterzigris; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp new file mode 100644 index 0000000..919669d --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp @@ -0,0 +1,97 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Rend_Blackhand +SD%Complete: 100 +SDComment: Intro event NYI +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_WHIRLWIND = 26038, + SPELL_CLEAVE = 20691, + SPELL_THUNDERCLAP = 23931 //Not sure if he cast this spell +}; + +struct MANGOS_DLL_DECL boss_rend_blackhandAI : public ScriptedAI +{ + boss_rend_blackhandAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiWhirlWindTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiThunderclapTimer; + + void Reset() + { + m_uiWhirlWindTimer = 20000; + m_uiCleaveTimer = 5000; + m_uiThunderclapTimer = 9000; + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // WhirlWind + if (m_uiWhirlWindTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + m_uiWhirlWindTimer = 18000; + } + else + m_uiWhirlWindTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 10000; + } + else + m_uiCleaveTimer -= uiDiff; + + // Thunderclap + if (m_uiThunderclapTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_THUNDERCLAP); + m_uiThunderclapTimer = 16000; + } + else + m_uiThunderclapTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_rend_blackhand(Creature* pCreature) +{ + return new boss_rend_blackhandAI(pCreature); +} + +void AddSC_boss_rend_blackhand() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_rend_blackhand"; + newscript->GetAI = &GetAI_boss_rend_blackhand; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp new file mode 100644 index 0000000..189d803 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp @@ -0,0 +1,100 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shadow_Hunter_Voshgajin +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_CURSEOFBLOOD = 24673, + SPELL_HEX = 16708, + SPELL_CLEAVE = 20691 +}; + +struct MANGOS_DLL_DECL boss_shadowvoshAI : public ScriptedAI +{ + boss_shadowvoshAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCurseOfBloodTimer; + uint32 m_uiHexTimer; + uint32 m_uiCleaveTimer; + + void Reset() + { + m_uiCurseOfBloodTimer = 2000; + m_uiHexTimer = 8000; + m_uiCleaveTimer = 14000; + + //m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true); + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Curse Of Blood + if (m_uiCurseOfBloodTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_CURSEOFBLOOD); + m_uiCurseOfBloodTimer = 45000; + } + else + m_uiCurseOfBloodTimer -= uiDiff; + + // Hex + if (m_uiHexTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_HEX); + m_uiHexTimer = 15000; + } + else + m_uiHexTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 7000; + } + else + m_uiCleaveTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shadowvosh(Creature* pCreature) +{ + return new boss_shadowvoshAI(pCreature); +} + +void AddSC_boss_shadowvosh() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_shadow_hunter_voshgajin"; + newscript->GetAI = &GetAI_boss_shadowvosh; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp new file mode 100644 index 0000000..74424fa --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp @@ -0,0 +1,99 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_The_Best +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_FLAMEBREAK = 16785, + SPELL_IMMOLATE = 20294, + SPELL_TERRIFYINGROAR = 14100 +}; + +struct MANGOS_DLL_DECL boss_thebeastAI : public ScriptedAI +{ + boss_thebeastAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiFlamebreakTimer; + uint32 m_uiImmolateTimer; + uint32 m_uiTerrifyingRoarTimer; + + void Reset() + { + m_uiFlamebreakTimer = 12000; + m_uiImmolateTimer = 3000; + m_uiTerrifyingRoarTimer = 23000; + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Flamebreak + if (m_uiFlamebreakTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FLAMEBREAK); + m_uiFlamebreakTimer = 10000; + } + else + m_uiFlamebreakTimer -= uiDiff; + + // Immolate + if (m_uiImmolateTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_IMMOLATE); + + m_uiImmolateTimer = 8000; + } + else + m_uiImmolateTimer -= uiDiff; + + // Terrifying Roar + if (m_uiTerrifyingRoarTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_TERRIFYINGROAR); + m_uiTerrifyingRoarTimer = 20000; + } + else + m_uiTerrifyingRoarTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thebeast(Creature* pCreature) +{ + return new boss_thebeastAI(pCreature); +} + +void AddSC_boss_thebeast() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_the_beast"; + newscript->GetAI = &GetAI_boss_thebeast; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp b/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp new file mode 100644 index 0000000..6cc7dca --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp @@ -0,0 +1,118 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warmaster_Voone +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SNAPKICK 15618 +#define SPELL_CLEAVE 15284 +#define SPELL_UPPERCUT 10966 +#define SPELL_MORTALSTRIKE 15708 +#define SPELL_PUMMEL 15615 +#define SPELL_THROWAXE 16075 + +struct MANGOS_DLL_DECL boss_warmastervooneAI : public ScriptedAI +{ + boss_warmastervooneAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Snapkick_Timer; + uint32 Cleave_Timer; + uint32 Uppercut_Timer; + uint32 MortalStrike_Timer; + uint32 Pummel_Timer; + uint32 ThrowAxe_Timer; + + void Reset() + { + Snapkick_Timer = 8000; + Cleave_Timer = 14000; + Uppercut_Timer = 20000; + MortalStrike_Timer = 12000; + Pummel_Timer = 32000; + ThrowAxe_Timer = 1000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Snapkick_Timer + if (Snapkick_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SNAPKICK); + Snapkick_Timer = 6000; + }else Snapkick_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 12000; + }else Cleave_Timer -= diff; + + //Uppercut_Timer + if (Uppercut_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 14000; + }else Uppercut_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = 10000; + }else MortalStrike_Timer -= diff; + + //Pummel_Timer + if (Pummel_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PUMMEL); + Pummel_Timer = 16000; + }else Pummel_Timer -= diff; + + //ThrowAxe_Timer + if (ThrowAxe_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_THROWAXE); + ThrowAxe_Timer = 8000; + }else ThrowAxe_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warmastervoone(Creature* pCreature) +{ + return new boss_warmastervooneAI(pCreature); +} + +void AddSC_boss_warmastervoone() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_warmaster_voone"; + newscript->GetAI = &GetAI_boss_warmastervoone; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp b/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp new file mode 100644 index 0000000..afc1399 --- /dev/null +++ b/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp @@ -0,0 +1,301 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_blackrock_spire +SD%Complete: 50 +SDComment: To really get this instance working, many encounters will need more love - and also the DB content is surely not yet perfect. +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" +#include "blackrock_spire.h" + +enum +{ + AREATRIGGER_ENTER_UBRS = 2046, + AREATRIGGER_STADIUM = 2026 +}; + +/* Areatrigger +1470 Instance Entry +1628 LBRS, between Spiders and Ogres +1946 LBRS, ubrs pre-quest giver (1) +1986 LBRS, ubrs pre-quest giver (2) +1987 LBRS, ubrs pre-quest giver (3) +2026 UBRS, stadium event trigger +2046 UBRS, way to upper +2066 UBRS, The Beast - Exit (to the dark chamber) +2067 UBRS, The Beast - Entry +2068 LBRS, fall out of map +3726 UBRS, entrance to BWL +*/ + +instance_blackrock_spire::instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap), + m_uiEmberseerGUID(0), + m_uiNefariusGUID(0), + m_uiGythGUID(0), + m_uiInfiltratorGUID(0), + + m_uiEmberseerInDoorGUID(0), + m_uiEmberseerCombatDoorGUID(0), + m_uiEmberseerOutDoorGUID(0), + + m_uiGythEntryDoorGUID(0), + m_uiGythCombatDoorGUID(0), + m_uiGythExitDoorGUID(0) +{ + Initialize(); +} + +void instance_blackrock_spire::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_auiRoomRuneGUID, 0, sizeof(m_auiRoomRuneGUID)); +} + +void instance_blackrock_spire::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_EMBERSEER_IN: + m_uiEmberseerInDoorGUID = pGo->GetGUID(); + if (GetData(TYPE_ROOM_EVENT) == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOORS: + m_uiEmberseerCombatDoorGUID = pGo->GetGUID(); + break; + case GO_EMBERSEER_OUT: + m_uiEmberseerOutDoorGUID = pGo->GetGUID(); + if (GetData(TYPE_EMBERSEER) == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_GYTH_ENTRY_DOOR: + m_uiGythEntryDoorGUID = pGo->GetGUID(); + break; + case GO_GYTH_COMBAT_DOOR: + m_uiGythCombatDoorGUID = pGo->GetGUID(); + break; + case GO_GYTH_EXIT_DOOR: + m_uiGythExitDoorGUID = pGo->GetGUID(); + if (GetData(TYPE_GYTH) == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case GO_ROOM_1_RUNE: m_auiRoomRuneGUID[0] = pGo->GetGUID(); break; + case GO_ROOM_2_RUNE: m_auiRoomRuneGUID[1] = pGo->GetGUID(); break; + case GO_ROOM_3_RUNE: m_auiRoomRuneGUID[2] = pGo->GetGUID(); break; + case GO_ROOM_4_RUNE: m_auiRoomRuneGUID[3] = pGo->GetGUID(); break; + case GO_ROOM_5_RUNE: m_auiRoomRuneGUID[4] = pGo->GetGUID(); break; + case GO_ROOM_6_RUNE: m_auiRoomRuneGUID[5] = pGo->GetGUID(); break; + case GO_ROOM_7_RUNE: m_auiRoomRuneGUID[6] = pGo->GetGUID(); break; + + case GO_ROOKERY_EGG: m_lRookeryEggGUIDList.push_back(pGo->GetGUID()); break; + } +} + +void instance_blackrock_spire::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_PYROGUARD_EMBERSEER: m_uiEmberseerGUID = pCreature->GetEntry(); break; + case NPC_LORD_VICTOR_NEFARIUS: m_uiNefariusGUID = pCreature->GetGUID(); break; + case NPC_GYTH: m_uiGythGUID = pCreature->GetGUID(); break; + case NPC_SCARSHIELD_INFILTRATOR: m_uiInfiltratorGUID = pCreature->GetGUID(); break; + + case NPC_BLACKHAND_SUMMONER: + case NPC_BLACKHAND_VETERAN: m_lRoomEventMobGUIDList.push_back(pCreature->GetGUID()); break; + case NPC_BLACKHAND_INCANCERATOR: m_lIncanceratorGUIDList.push_back(pCreature->GetGUID()); break; + } +} + +void instance_blackrock_spire::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_ROOM_EVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiEmberseerInDoorGUID); + m_auiEncounter[0] = uiData; + break; + case TYPE_EMBERSEER: + if (uiData == IN_PROGRESS || uiData == FAIL) + DoUseDoorOrButton(m_uiEmberseerCombatDoorGUID); + else if (uiData == DONE) + { + DoUseDoorOrButton(m_uiEmberseerCombatDoorGUID); + DoUseDoorOrButton(m_uiEmberseerOutDoorGUID); + } + m_auiEncounter[1] = uiData; + break; + case TYPE_FLAMEWREATH: + m_auiEncounter[2] = uiData; + break; + case TYPE_GYTH: + if (uiData == IN_PROGRESS || uiData == FAIL) + DoUseDoorOrButton(m_uiGythEntryDoorGUID); + else if (uiData == DONE) + { + DoUseDoorOrButton(m_uiGythEntryDoorGUID); + DoUseDoorOrButton(m_uiGythExitDoorGUID); + } + m_auiEncounter[3] = uiData; + break; + case TYPE_VALTHALAK: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_blackrock_spire::SetData64(uint32 uiType, uint64 uiData) +{ + if (uiType == TYPE_ROOM_EVENT && GetData(TYPE_ROOM_EVENT) == IN_PROGRESS) + { + uint8 uiNotEmptyRoomsCount = 0; + for (uint8 i = 0; i< MAX_ROOMS; i++) + { + if (m_auiRoomRuneGUID[i]) // This check is used, to ensure which runes still need processing + { + m_alRoomEventMobGUIDSorted[i].remove(uiData); + if (m_alRoomEventMobGUIDSorted[i].empty()) + { + DoUseDoorOrButton(m_auiRoomRuneGUID[i]); + m_auiRoomRuneGUID[i] = 0; + } + else + uiNotEmptyRoomsCount++; // found an not empty room + } + } + if (!uiNotEmptyRoomsCount) + SetData(TYPE_ROOM_EVENT, DONE); + } +} + +void instance_blackrock_spire::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_blackrock_spire::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_ROOM_EVENT: return m_auiEncounter[0]; + case TYPE_EMBERSEER: return m_auiEncounter[1]; + case TYPE_FLAMEWREATH: return m_auiEncounter[2]; + case TYPE_GYTH: return m_auiEncounter[3]; + case TYPE_VALTHALAK: return m_auiEncounter[4]; + } + return 0; +} + +uint64 instance_blackrock_spire::GetData64(uint32 uiType) +{ + switch (uiType) + { + case NPC_PYROGUARD_EMBERSEER: return m_uiEmberseerGUID; + case NPC_LORD_VICTOR_NEFARIUS: return m_uiNefariusGUID; + case NPC_GYTH: return m_uiGythGUID; + case NPC_SCARSHIELD_INFILTRATOR: return m_uiInfiltratorGUID; + case GO_GYTH_COMBAT_DOOR: return m_uiGythCombatDoorGUID; + } + return 0; +} + +void instance_blackrock_spire::DoSortRoomEventMobs() +{ + if (GetData(TYPE_ROOM_EVENT) != NOT_STARTED) + return; + for (uint8 i = 0; i < MAX_ROOMS; i++) + if (GameObject* pRune = instance->GetGameObject(m_auiRoomRuneGUID[i])) + for (std::list::const_iterator itr = m_lRoomEventMobGUIDList.begin(); itr != m_lRoomEventMobGUIDList.end(); itr++) + if (Creature* pCreature = instance->GetCreature(*itr)) + if (pCreature->isAlive() && pCreature->GetDistance(pRune) < 10.0f) + m_alRoomEventMobGUIDSorted[i].push_back(*itr); + + SetData(TYPE_ROOM_EVENT, IN_PROGRESS); +} + +InstanceData* GetInstanceData_instance_blackrock_spire(Map* pMap) +{ + return new instance_blackrock_spire(pMap); +} + +bool AreaTrigger_at_blackrock_spire(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (pPlayer->isDead()) + return false; + + switch (pAt->id) + { + case AREATRIGGER_ENTER_UBRS: + if (instance_blackrock_spire* pInstance = (instance_blackrock_spire*) pPlayer->GetInstanceData()) + pInstance->DoSortRoomEventMobs(); + break; + case AREATRIGGER_STADIUM: + if (instance_blackrock_spire* pInstance = (instance_blackrock_spire*) pPlayer->GetInstanceData()) + if (Creature* pGyth = pInstance->instance->GetCreature(pInstance->GetData64(NPC_GYTH))) + if (pGyth->isAlive() && !pGyth->isInCombat()) + pGyth->AI()->AttackStart(pPlayer); + break; + } + return false; +} + +void AddSC_instance_blackrock_spire() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_blackrock_spire"; + pNewScript->GetInstanceData = &GetInstanceData_instance_blackrock_spire; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_blackrock_spire"; + pNewScript->pAreaTrigger = &AreaTrigger_at_blackrock_spire; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp new file mode 100644 index 0000000..8126703 --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp @@ -0,0 +1,111 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Broodlord_Lashlayer +SD%Complete: 100 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1469000 +#define SAY_LEASH -1469001 + +#define SPELL_CLEAVE 26350 +#define SPELL_BLASTWAVE 23331 +#define SPELL_MORTALSTRIKE 24573 +#define SPELL_KNOCKBACK 25778 + +struct MANGOS_DLL_DECL boss_broodlordAI : public ScriptedAI +{ + boss_broodlordAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Cleave_Timer; + uint32 BlastWave_Timer; + uint32 MortalStrike_Timer; + uint32 KnockBack_Timer; + + void Reset() + { + Cleave_Timer = 8000; //These times are probably wrong + BlastWave_Timer = 12000; + MortalStrike_Timer = 20000; + KnockBack_Timer = 30000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + // BlastWave + if (BlastWave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLASTWAVE); + BlastWave_Timer = urand(8000, 16000); + }else BlastWave_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = urand(25000, 35000); + }else MortalStrike_Timer -= diff; + + if (KnockBack_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKBACK); + //Drop 50% aggro + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50); + + KnockBack_Timer = urand(15000, 30000); + }else KnockBack_Timer -= diff; + + DoMeleeAttackIfReady(); + + if (EnterEvadeIfOutOfCombatArea(diff)) + DoScriptText(SAY_LEASH, m_creature); + } +}; +CreatureAI* GetAI_boss_broodlord(Creature* pCreature) +{ + return new boss_broodlordAI(pCreature); +} + +void AddSC_boss_broodlord() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_broodlord"; + newscript->GetAI = &GetAI_boss_broodlord; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp new file mode 100644 index 0000000..ab58af5 --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp @@ -0,0 +1,315 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Chromaggus +SD%Complete: 95 +SDComment: Chromatic Mutation disabled due to lack of core support +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, + EMOTE_SHIMMER = -1469003, + + //These spells are actually called elemental shield + //What they do is decrease all damage by 75% then they increase + //One school of damage by 1100% + SPELL_FIRE_VURNALBILTY = 22277, + SPELL_FROST_VURNALBILTY = 22278, + SPELL_SHADOW_VURNALBILTY = 22279, + SPELL_NATURE_VURNALBILTY = 22280, + SPELL_ARCANE_VURNALBILTY = 22281, + + SPELL_INCINERATE = 23308, //Incinerate 23308,23309 + SPELL_TIMELAPSE = 23310, //Time lapse 23310, 23311(old threat mod that was removed in 2.01) + SPELL_CORROSIVEACID = 23313, //Corrosive Acid 23313, 23314 + SPELL_IGNITEFLESH = 23315, //Ignite Flesh 23315,23316 + SPELL_FROSTBURN = 23187, //Frost burn 23187, 23189 + + //Brood Affliction 23173 - Scripted Spell that cycles through all targets within 100 yards and has a chance to cast one of the afflictions on them + //Since Scripted spells arn't coded I'll just write a function that does the same thing + SPELL_BROODAF_BLUE = 23153, //Blue affliction 23153 + SPELL_BROODAF_BLACK = 23154, //Black affliction 23154 + SPELL_BROODAF_RED = 23155, //Red affliction 23155 (23168 on death) + SPELL_BROODAF_BRONZE = 23170, //Bronze Affliction 23170 + SPELL_BROODAF_GREEN = 23169, //Brood Affliction Green 23169 + + SPELL_CHROMATIC_MUT_1 = 23174, //Spell cast on player if they get all 5 debuffs + + SPELL_FRENZY = 28371, //The frenzy spell may be wrong + SPELL_ENRAGE = 28747 +}; + +struct MANGOS_DLL_DECL boss_chromaggusAI : public ScriptedAI +{ + boss_chromaggusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + //Select the 2 breaths that we are going to use until despawned + //5 possiblities for the first breath, 4 for the second, 20 total possiblites + //This way we don't end up casting 2 of the same breath + //TL TL would be stupid + srand(time(NULL)); + switch(urand(0, 19)) + { + //B1 - Incin + case 0: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 1: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 2: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + case 3: + Breath1_Spell = SPELL_INCINERATE; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - TL + case 4: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_INCINERATE; + break; + case 5: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 6: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + case 7: + Breath1_Spell = SPELL_TIMELAPSE; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - Acid + case 8: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_INCINERATE; + break; + case 9: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 10: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + case 11: + Breath1_Spell = SPELL_CORROSIVEACID; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - Ignite + case 12: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_INCINERATE; + break; + case 13: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 14: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 15: + Breath1_Spell = SPELL_IGNITEFLESH; + Breath2_Spell = SPELL_FROSTBURN; + break; + + //B1 - Frost + case 16: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_INCINERATE; + break; + case 17: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_TIMELAPSE; + break; + case 18: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_CORROSIVEACID; + break; + case 19: + Breath1_Spell = SPELL_FROSTBURN; + Breath2_Spell = SPELL_IGNITEFLESH; + break; + }; + + EnterEvadeMode(); + } + + uint32 Breath1_Spell; + uint32 Breath2_Spell; + uint32 CurrentVurln_Spell; + + uint32 Shimmer_Timer; + uint32 Breath1_Timer; + uint32 Breath2_Timer; + uint32 Affliction_Timer; + uint32 Frenzy_Timer; + bool Enraged; + + void Reset() + { + CurrentVurln_Spell = 0; //We use this to store our last vurlnability spell so we can remove it later + + Shimmer_Timer = 0; //Time till we change vurlnerabilites + Breath1_Timer = 30000; //First breath is 30 seconds + Breath2_Timer = 60000; //Second is 1 minute so that we can alternate + Affliction_Timer = 10000; //This is special - 5 seconds means that we cast this on 1 pPlayer every 5 sconds + Frenzy_Timer = 15000; + + Enraged = false; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Shimmer_Timer Timer + if (Shimmer_Timer < diff) + { + //Remove old vurlnability spell + if (CurrentVurln_Spell) + m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell); + + //Cast new random vurlnabilty on self + uint32 spell; + switch(urand(0, 4)) + { + case 0: spell = SPELL_FIRE_VURNALBILTY; break; + case 1: spell = SPELL_FROST_VURNALBILTY; break; + case 2: spell = SPELL_SHADOW_VURNALBILTY; break; + case 3: spell = SPELL_NATURE_VURNALBILTY; break; + case 4: spell = SPELL_ARCANE_VURNALBILTY; break; + } + + if (DoCastSpellIfCan(m_creature, spell) == CAST_OK) + { + CurrentVurln_Spell = spell; + + DoScriptText(EMOTE_SHIMMER, m_creature); + Shimmer_Timer = 45000; + } + }else Shimmer_Timer -= diff; + + //Breath1_Timer + if (Breath1_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),Breath1_Spell); + Breath1_Timer = 60000; + }else Breath1_Timer -= diff; + + //Breath2_Timer + if (Breath2_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),Breath2_Spell); + Breath2_Timer = 60000; + }else Breath2_Timer -= diff; + + //Affliction_Timer + if (Affliction_Timer < diff) + { + uint32 SpellAfflict = 0; + + switch(urand(0, 4)) + { + case 0: SpellAfflict = SPELL_BROODAF_BLUE; break; + case 1: SpellAfflict = SPELL_BROODAF_BLACK; break; + case 2: SpellAfflict = SPELL_BROODAF_RED; break; + case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break; + case 4: SpellAfflict = SPELL_BROODAF_GREEN; break; + } + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit) + { + //Cast affliction + DoCastSpellIfCan(pUnit, SpellAfflict, CAST_TRIGGERED); + + //Chromatic mutation if target is effected by all afflictions + if (pUnit->HasAura(SPELL_BROODAF_BLUE, EFFECT_INDEX_0) + && pUnit->HasAura(SPELL_BROODAF_BLACK, EFFECT_INDEX_0) + && pUnit->HasAura(SPELL_BROODAF_RED, EFFECT_INDEX_0) + && pUnit->HasAura(SPELL_BROODAF_BRONZE, EFFECT_INDEX_0) + && pUnit->HasAura(SPELL_BROODAF_GREEN, EFFECT_INDEX_0)) + { + //target->RemoveAllAuras(); + //DoCastSpellIfCan(target,SPELL_CHROMATIC_MUT_1); + + //Chromatic mutation is causing issues + //Assuming it is caused by a lack of core support for Charm + //So instead we instant kill our target + + //WORKAROUND + if (pUnit->GetTypeId() == TYPEID_PLAYER) + pUnit->CastSpell(pUnit, 5, false); + } + } + } + + Affliction_Timer = 10000; + }else Affliction_Timer -= diff; + + //Frenzy_Timer + if (Frenzy_Timer < diff) + { + if (DoCastSpellIfCan(m_creature,SPELL_FRENZY) == CAST_OK) + { + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + Frenzy_Timer = urand(10000, 15000); + } + }else Frenzy_Timer -= diff; + + //Enrage if not already enraged and below 20% + if (!Enraged && m_creature->GetHealthPercent() < 20.0f) + { + DoCastSpellIfCan(m_creature,SPELL_ENRAGE); + Enraged = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_chromaggus(Creature* pCreature) +{ + return new boss_chromaggusAI(pCreature); +} + +void AddSC_boss_chromaggus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_chromaggus"; + newscript->GetAI = &GetAI_boss_chromaggus; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp new file mode 100644 index 0000000..cae016c --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp @@ -0,0 +1,103 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ebonroc +SD%Complete: 50 +SDComment: Shadow of Ebonroc needs core support +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 18500 +#define SPELL_SHADOWOFEBONROC 23340 +#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow + +struct MANGOS_DLL_DECL boss_ebonrocAI : public ScriptedAI +{ + boss_ebonrocAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowFlame_Timer; + uint32 WingBuffet_Timer; + uint32 ShadowOfEbonroc_Timer; + uint32 Heal_Timer; + + void Reset() + { + ShadowFlame_Timer = 15000; //These times are probably wrong + WingBuffet_Timer = 30000; + ShadowOfEbonroc_Timer = 45000; + Heal_Timer = 1000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Shadowflame Timer + if (ShadowFlame_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = urand(12000, 15000); + }else ShadowFlame_Timer -= diff; + + //Wing Buffet Timer + if (WingBuffet_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_WINGBUFFET); + WingBuffet_Timer = 25000; + }else WingBuffet_Timer -= diff; + + //Shadow of Ebonroc Timer + if (ShadowOfEbonroc_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWOFEBONROC); + ShadowOfEbonroc_Timer = urand(25000, 35000); + }else ShadowOfEbonroc_Timer -= diff; + + if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC, EFFECT_INDEX_0)) + { + if (Heal_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_HEAL); + Heal_Timer = urand(1000, 3000); + }else Heal_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ebonroc(Creature* pCreature) +{ + return new boss_ebonrocAI(pCreature); +} + +void AddSC_boss_ebonroc() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ebonroc"; + newscript->GetAI = &GetAI_boss_ebonroc; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp new file mode 100644 index 0000000..e246b3c --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Firemaw +SD%Complete: 100 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 23339 +#define SPELL_FLAMEBUFFET 23341 + +struct MANGOS_DLL_DECL boss_firemawAI : public ScriptedAI +{ + boss_firemawAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowFlame_Timer; + uint32 WingBuffet_Timer; + uint32 FlameBuffet_Timer; + + void Reset() + { + ShadowFlame_Timer = 30000; //These times are probably wrong + WingBuffet_Timer = 24000; + FlameBuffet_Timer = 5000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = urand(15000, 18000); + }else ShadowFlame_Timer -= diff; + + //WingBuffet_Timer + if (WingBuffet_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_WINGBUFFET); + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75); + + WingBuffet_Timer = 25000; + }else WingBuffet_Timer -= diff; + + //FlameBuffet_Timer + if (FlameBuffet_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FLAMEBUFFET); + FlameBuffet_Timer = 5000; + }else FlameBuffet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_firemaw(Creature* pCreature) +{ + return new boss_firemawAI(pCreature); +} + +void AddSC_boss_firemaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_firemaw"; + newscript->GetAI = &GetAI_boss_firemaw; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp new file mode 100644 index 0000000..0c11c6d --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp @@ -0,0 +1,102 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Flamegor +SD%Complete: 100 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +enum +{ + EMOTE_GENERIC_FRENZY = -1000002, + + SPELL_SHADOWFLAME = 22539, + SPELL_WINGBUFFET = 23339, + SPELL_FRENZY = 23342 //This spell periodically triggers fire nova +}; + +struct MANGOS_DLL_DECL boss_flamegorAI : public ScriptedAI +{ + boss_flamegorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowFlame_Timer; + uint32 WingBuffet_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + ShadowFlame_Timer = 21000; //These times are probably wrong + WingBuffet_Timer = 35000; + Frenzy_Timer = 10000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = urand(15000, 22000); + }else ShadowFlame_Timer -= diff; + + //WingBuffet_Timer + if (WingBuffet_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_WINGBUFFET); + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-75); + + WingBuffet_Timer = 25000; + }else WingBuffet_Timer -= diff; + + //Frenzy_Timer + if (Frenzy_Timer < diff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FRENZY) == CAST_OK) + { + DoScriptText(EMOTE_GENERIC_FRENZY, m_creature); + Frenzy_Timer = urand(8000, 10000); + } + }else Frenzy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_flamegor(Creature* pCreature) +{ + return new boss_flamegorAI(pCreature); +} + +void AddSC_boss_flamegor() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_flamegor"; + newscript->GetAI = &GetAI_boss_flamegor; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp new file mode 100644 index 0000000..355f66c --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp @@ -0,0 +1,225 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nefarian +SD%Complete: 80 +SDComment: Some issues with class calls effecting more than one class +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1469007 +#define SAY_XHEALTH -1469008 +#define SAY_SHADOWFLAME -1469009 +#define SAY_RAISE_SKELETONS -1469010 +#define SAY_SLAY -1469011 +#define SAY_DEATH -1469012 + +#define SAY_MAGE -1469013 +#define SAY_WARRIOR -1469014 +#define SAY_DRUID -1469015 +#define SAY_PRIEST -1469016 +#define SAY_PALADIN -1469017 +#define SAY_SHAMAN -1469018 +#define SAY_WARLOCK -1469019 +#define SAY_HUNTER -1469020 +#define SAY_ROGUE -1469021 + +#define SPELL_SHADOWFLAME_INITIAL 22972 +#define SPELL_SHADOWFLAME 22539 +#define SPELL_BELLOWINGROAR 22686 +#define SPELL_VEILOFSHADOW 7068 +#define SPELL_CLEAVE 20691 +#define SPELL_TAILLASH 23364 +#define SPELL_BONECONTRUST 23363 //23362, 23361 + +#define SPELL_MAGE 23410 //wild magic +#define SPELL_WARRIOR 23397 //beserk +#define SPELL_DRUID 23398 // cat form +#define SPELL_PRIEST 23401 // corrupted healing +#define SPELL_PALADIN 23418 //syphon blessing +#define SPELL_SHAMAN 23425 //totems +#define SPELL_WARLOCK 23427 //infernals +#define SPELL_HUNTER 23436 //bow broke +#define SPELL_ROGUE 23414 //Paralise + +struct MANGOS_DLL_DECL boss_nefarianAI : public ScriptedAI +{ + boss_nefarianAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowFlame_Timer; + uint32 BellowingRoar_Timer; + uint32 VeilOfShadow_Timer; + uint32 Cleave_Timer; + uint32 TailLash_Timer; + uint32 ClassCall_Timer; + bool Phase3; + + void Reset() + { + ShadowFlame_Timer = 12000; //These times are probably wrong + BellowingRoar_Timer = 30000; + VeilOfShadow_Timer = 15000; + Cleave_Timer = 7000; + TailLash_Timer = 10000; + ClassCall_Timer = 35000; //35-40 seconds + Phase3 = false; + } + + void KilledUnit(Unit* Victim) + { + if (urand(0, 4)) + return; + + DoScriptText(SAY_SLAY, m_creature, Victim); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_XHEALTH, m_creature); break; + case 1: DoScriptText(SAY_AGGRO, m_creature); break; + case 2: DoScriptText(SAY_SHADOWFLAME, m_creature); break; + } + + DoCastSpellIfCan(pWho,SPELL_SHADOWFLAME_INITIAL); + + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = 12000; + }else ShadowFlame_Timer -= diff; + + //BellowingRoar_Timer + if (BellowingRoar_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BELLOWINGROAR); + BellowingRoar_Timer = 30000; + }else BellowingRoar_Timer -= diff; + + //VeilOfShadow_Timer + if (VeilOfShadow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_VEILOFSHADOW); + VeilOfShadow_Timer = 15000; + }else VeilOfShadow_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //TailLash_Timer + if (TailLash_Timer < diff) + { + //Cast NYI since we need a better check for behind target + //DoCastSpellIfCan(m_creature->getVictim(),SPELL_TAILLASH); + + TailLash_Timer = 10000; + }else TailLash_Timer -= diff; + + //ClassCall_Timer + if (ClassCall_Timer < diff) + { + //Cast a random class call + //On official it is based on what classes are currently on the hostil list + //but we can't do that yet so just randomly call one + + switch(urand(0, 8)) + { + case 0: + DoScriptText(SAY_MAGE, m_creature); + DoCastSpellIfCan(m_creature,SPELL_MAGE); + break; + case 1: + DoScriptText(SAY_WARRIOR, m_creature); + DoCastSpellIfCan(m_creature,SPELL_WARRIOR); + break; + case 2: + DoScriptText(SAY_DRUID, m_creature); + DoCastSpellIfCan(m_creature,SPELL_DRUID); + break; + case 3: + DoScriptText(SAY_PRIEST, m_creature); + DoCastSpellIfCan(m_creature,SPELL_PRIEST); + break; + case 4: + DoScriptText(SAY_PALADIN, m_creature); + DoCastSpellIfCan(m_creature,SPELL_PALADIN); + break; + case 5: + DoScriptText(SAY_SHAMAN, m_creature); + DoCastSpellIfCan(m_creature,SPELL_SHAMAN); + break; + case 6: + DoScriptText(SAY_WARLOCK, m_creature); + DoCastSpellIfCan(m_creature,SPELL_WARLOCK); + break; + case 7: + DoScriptText(SAY_HUNTER, m_creature); + DoCastSpellIfCan(m_creature,SPELL_HUNTER); + break; + case 8: + DoScriptText(SAY_ROGUE, m_creature); + DoCastSpellIfCan(m_creature,SPELL_ROGUE); + break; + } + + ClassCall_Timer = urand(35000, 40000); + }else ClassCall_Timer -= diff; + + //Phase3 begins when we are below X health + if (!Phase3 && m_creature->GetHealthPercent() < 20.0f) + { + Phase3 = true; + DoScriptText(SAY_RAISE_SKELETONS, m_creature); + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_nefarian(Creature* pCreature) +{ + return new boss_nefarianAI(pCreature); +} + +void AddSC_boss_nefarian() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nefarian"; + newscript->GetAI = &GetAI_boss_nefarian; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp new file mode 100644 index 0000000..e6ac0fb --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Razorgore +SD%Complete: 50 +SDComment: Needs additional review. Phase 1 NYI (Grethok the Controller) +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +//Razorgore Phase 2 Script +enum +{ + SAY_EGGS_BROKEN1 = -1469022, + SAY_EGGS_BROKEN2 = -1469023, + SAY_EGGS_BROKEN3 = -1469024, + SAY_DEATH = -1469025, + + SPELL_CLEAVE = 19632, + SPELL_WARSTOMP = 24375, + SPELL_FIREBALLVOLLEY = 22425, + SPELL_CONFLAGRATION = 23023 +}; + +struct MANGOS_DLL_DECL boss_razorgoreAI : public ScriptedAI +{ + boss_razorgoreAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCleaveTimer; + uint32 m_uiWarStompTimer; + uint32 m_uiFireballVolleyTimer; + uint32 m_uiConflagrationTimer; + + void Reset() + { + m_uiCleaveTimer = 15000; //These times are probably wrong + m_uiWarStompTimer = 35000; + m_uiConflagrationTimer = 12000; + m_uiFireballVolleyTimer = 7000; + + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = urand(7000, 10000); + } + else + m_uiCleaveTimer -= uiDiff; + + // WarStomp + if (m_uiWarStompTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WARSTOMP); + m_uiWarStompTimer = urand(15000, 25000); + } + else + m_uiWarStompTimer -= uiDiff; + + // Fireball Volley + if (m_uiFireballVolleyTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIREBALLVOLLEY); + m_uiFireballVolleyTimer = urand(12000, 15000); + } + else + m_uiFireballVolleyTimer -= uiDiff; + + // Conflagration + if (m_uiConflagrationTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONFLAGRATION); + //We will remove this threat reduction and add an aura check. + + //if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + //m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50); + + m_uiConflagrationTimer = 12000; + } + else + m_uiConflagrationTimer -= uiDiff; + + // Aura Check. If the gamer is affected by confliguration we attack a random gamer. + if (m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION, EFFECT_INDEX_0)) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + m_creature->TauntApply(pTarget); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_razorgore(Creature* pCreature) +{ + return new boss_razorgoreAI(pCreature); +} + +void AddSC_boss_razorgore() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_razorgore"; + newscript->GetAI = &GetAI_boss_razorgore; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp new file mode 100644 index 0000000..3fb679f --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp @@ -0,0 +1,259 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Vaelastrasz +SD%Complete: 75 +SDComment: Burning Adrenaline not correctly implemented in core +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +#define SAY_LINE1 -1469026 +#define SAY_LINE2 -1469027 +#define SAY_LINE3 -1469028 +#define SAY_HALFLIFE -1469029 +#define SAY_KILLTARGET -1469030 + +#define GOSSIP_ITEM "Start Event " + +#define SPELL_ESSENCEOFTHERED 23513 +#define SPELL_FLAMEBREATH 23461 +#define SPELL_FIRENOVA 23462 +#define SPELL_TAILSWIPE 15847 +#define SPELL_BURNINGADRENALINE 23620 +#define SPELL_CLEAVE 20684 //Chain cleave is most likely named something different and contains a dummy effect + +struct MANGOS_DLL_DECL boss_vaelAI : public ScriptedAI +{ + boss_vaelAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pCreature->setFaction(35); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Reset(); + } + + uint64 PlayerGUID; + uint32 SpeachTimer; + uint32 SpeachNum; + uint32 Cleave_Timer; + uint32 FlameBreath_Timer; + uint32 FireNova_Timer; + uint32 BurningAdrenalineCaster_Timer; + uint32 BurningAdrenalineTank_Timer; + uint32 TailSwipe_Timer; + bool HasYelled; + bool DoingSpeach; + + void Reset() + { + PlayerGUID = 0; + SpeachTimer = 0; + SpeachNum = 0; + Cleave_Timer = 8000; //These times are probably wrong + FlameBreath_Timer = 11000; + BurningAdrenalineCaster_Timer = 15000; + BurningAdrenalineTank_Timer = 45000; + FireNova_Timer = 5000; + TailSwipe_Timer = 20000; + HasYelled = false; + DoingSpeach = false; + } + + void BeginSpeach(Unit* target) + { + //Stand up and begin speach + PlayerGUID = target->GetGUID(); + + //10 seconds + DoScriptText(SAY_LINE1, m_creature); + + SpeachTimer = 10000; + SpeachNum = 0; + DoingSpeach = true; + } + + void KilledUnit(Unit *victim) + { + if (urand(0, 4)) + return; + + DoScriptText(SAY_KILLTARGET, m_creature, victim); + } + + void Aggro(Unit* pWho) + { + DoCastSpellIfCan(m_creature,SPELL_ESSENCEOFTHERED); + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + //Speach + if (DoingSpeach) + { + if (SpeachTimer < diff) + { + switch (SpeachNum) + { + case 0: + //16 seconds till next line + DoScriptText(SAY_LINE2, m_creature); + SpeachTimer = 16000; + ++SpeachNum; + break; + case 1: + //This one is actually 16 seconds but we only go to 10 seconds because he starts attacking after he says "I must fight this!" + DoScriptText(SAY_LINE3, m_creature); + SpeachTimer = 10000; + ++SpeachNum; + break; + case 2: + m_creature->setFaction(103); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3)); + + if (PlayerGUID) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(PlayerGUID)) + AttackStart(pPlayer); + + DoCastSpellIfCan(m_creature, SPELL_ESSENCEOFTHERED); + } + SpeachTimer = 0; + DoingSpeach = false; + break; + } + }else SpeachTimer -= diff; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Yell if hp lower than 15% + if (m_creature->GetHealthPercent() < 15.0f && !HasYelled) + { + DoScriptText(SAY_HALFLIFE, m_creature); + HasYelled = true; + } + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 15000; + }else Cleave_Timer -= diff; + + //FlameBreath_Timer + if (FlameBreath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FLAMEBREATH); + FlameBreath_Timer = urand(4000, 8000); + }else FlameBreath_Timer -= diff; + + //BurningAdrenalineCaster_Timer + if (BurningAdrenalineCaster_Timer < diff) + { + Unit* target = NULL; + + int i = 0 ; + while (i < 3) // max 3 tries to get a random target with power_mana + { + ++i; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1);//not aggro leader + if (target) + if (target->getPowerType() == POWER_MANA) + i=3; + } + if (target) // cast on self (see below) + target->CastSpell(target,SPELL_BURNINGADRENALINE,1); + + BurningAdrenalineCaster_Timer = 15000; + }else BurningAdrenalineCaster_Timer -= diff; + + //BurningAdrenalineTank_Timer + if (BurningAdrenalineTank_Timer < diff) + { + // have the victim cast the spell on himself otherwise the third effect aura will be applied + // to Vael instead of the player + m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1); + + BurningAdrenalineTank_Timer = 45000; + }else BurningAdrenalineTank_Timer -= diff; + + //FireNova_Timer + if (FireNova_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FIRENOVA); + FireNova_Timer = 5000; + }else FireNova_Timer -= diff; + + //TailSwipe_Timer + if (TailSwipe_Timer < diff) + { + //Only cast if we are behind + /*if (!m_creature->HasInArc(M_PI, m_creature->getVictim())) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_TAILSWIPE); + }*/ + + TailSwipe_Timer = 20000; + }else TailSwipe_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +bool GossipSelect_boss_vael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (boss_vaelAI* pVaelAI = dynamic_cast(pCreature->AI())) + pVaelAI->BeginSpeach((Unit*)pPlayer); + } + + return true; +} + +bool GossipHello_boss_vael(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + + return true; +} + +CreatureAI* GetAI_boss_vael(Creature* pCreature) +{ + return new boss_vaelAI(pCreature); +} + +void AddSC_boss_vael() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_vaelastrasz"; + newscript->GetAI = &GetAI_boss_vael; + newscript->pGossipHello = &GossipHello_boss_vael; + newscript->pGossipSelect = &GossipSelect_boss_vael; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp b/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp new file mode 100644 index 0000000..e47cd58 --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp @@ -0,0 +1,387 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Victor_Nefarius +SD%Complete: 75 +SDComment: Missing some text, Vael beginning event, and spawns Nef in wrong place +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" + +#define SAY_GAMESBEGIN_1 -1469004 +#define SAY_GAMESBEGIN_2 -1469005 +#define SAY_VAEL_INTRO -1469006 //when he corrupts Vaelastrasz + +#define GOSSIP_ITEM_1 "I've made no mistakes." +#define GOSSIP_ITEM_2 "You have lost your mind, Nefarius. You speak in riddles." +#define GOSSIP_ITEM_3 "Please do." + +#define CREATURE_BRONZE_DRAKANOID 14263 +#define CREATURE_BLUE_DRAKANOID 14261 +#define CREATURE_RED_DRAKANOID 14264 +#define CREATURE_GREEN_DRAKANOID 14262 +#define CREATURE_BLACK_DRAKANOID 14265 + +#define CREATURE_CHROMATIC_DRAKANOID 14302 +#define CREATURE_NEFARIAN 11583 + +#define ADD_X1 -7591.151855f +#define ADD_X2 -7514.598633f +#define ADD_Y1 -1204.051880f +#define ADD_Y2 -1150.448853f +#define ADD_Z1 476.800476f +#define ADD_Z2 476.796570f + +#define NEF_X -7445.0f +#define NEF_Y -1332.0f +#define NEF_Z 536.0f + +#define HIDE_X -7592.0f +#define HIDE_Y -1264.0f +#define HIDE_Z 481.0f + +#define SPELL_SHADOWBOLT 21077 +#define SPELL_FEAR 26070 + +//This script is complicated +//Instead of morphing Victor Nefarius we will have him control phase 1 +//And then have him spawn "Nefarian" for phase 2 +//When phase 2 starts Victor Nefarius will go into hiding and stop attacking +//If Nefarian despawns because he killed the players then this guy will EnterEvadeMode +//and allow players to start the event over +//If nefarian dies then he will kill himself then he will kill himself in his hiding place +//To prevent players from doing the event twice + +struct MANGOS_DLL_DECL boss_victor_nefariusAI : public ScriptedAI +{ + boss_victor_nefariusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + NefarianGUID = 0; + Reset(); + srand(time(NULL)); + switch(urand(0, 19)) + { + case 0: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 1: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + case 2: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 3: + DrakType1 = CREATURE_BRONZE_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 4: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 5: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + case 6: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 7: + DrakType1 = CREATURE_BLUE_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 8: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 9: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 10: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 11: + DrakType1 = CREATURE_RED_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 12: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 13: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 14: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + case 15: + DrakType1 = CREATURE_GREEN_DRAKANOID; + DrakType2 = CREATURE_BLACK_DRAKANOID; + break; + case 16: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_BRONZE_DRAKANOID; + break; + case 17: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_BLUE_DRAKANOID; + break; + case 18: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_GREEN_DRAKANOID; + break; + case 19: + DrakType1 = CREATURE_BLACK_DRAKANOID; + DrakType2 = CREATURE_RED_DRAKANOID; + break; + } + } + + uint32 SpawnedAdds; + uint32 AddSpawnTimer; + uint32 ShadowBoltTimer; + uint32 FearTimer; + uint32 MindControlTimer; + uint32 ResetTimer; + uint32 DrakType1; + uint32 DrakType2; + uint64 NefarianGUID; + uint32 NefCheckTime; + + void Reset() + { + SpawnedAdds = 0; + AddSpawnTimer = 10000; + ShadowBoltTimer = 5000; + FearTimer = 8000; + ResetTimer = 900000; //On official it takes him 15 minutes(900 seconds) to reset. We are only doing 1 minute to make testing easier + NefarianGUID = 0; + NefCheckTime = 2000; + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1); + m_creature->setFaction(35); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void BeginEvent(Player* target) + { + DoScriptText(SAY_GAMESBEGIN_2, m_creature); + + //MaNGOS::Singleton::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); + /* + list ::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); + + for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i) + { + AttackStart((*i)); + } + */ + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); + m_creature->setFaction(103); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AttackStart(target); + } + + void MoveInLineOfSight(Unit *who) + { + //We simply use this function to find players until we can use Map->GetPlayers() + + if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who)) + { + //Add them to our threat list + m_creature->AddThreat(who); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Only do this if we haven't spawned nef yet + if (SpawnedAdds < 42) + { + //ShadowBoltTimer + if (ShadowBoltTimer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + DoCastSpellIfCan(target,SPELL_SHADOWBOLT); + + ShadowBoltTimer = urand(3000, 10000); + }else ShadowBoltTimer -= diff; + + //FearTimer + if (FearTimer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + DoCastSpellIfCan(target,SPELL_FEAR); + + FearTimer = urand(10000, 20000); + }else FearTimer -= diff; + + //Add spawning mechanism + if (AddSpawnTimer < diff) + { + //Spawn 2 random types of creatures at the 2 locations + uint32 CreatureID; + Creature* Spawned = NULL; + Unit* target = NULL; + + //1 in 3 chance it will be a chromatic + if (!urand(0, 2)) + CreatureID = CREATURE_CHROMATIC_DRAKANOID; + else CreatureID = DrakType1; + + ++SpawnedAdds; + + //Spawn creature and force it to start attacking a random target + Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000f,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && Spawned) + { + Spawned->AI()->AttackStart(target); + Spawned->setFaction(103); + } + + //1 in 3 chance it will be a chromatic + if (!urand(0, 2)) + CreatureID = CREATURE_CHROMATIC_DRAKANOID; + else CreatureID = DrakType2; + + ++SpawnedAdds; + + target = NULL; + Spawned = NULL; + Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && Spawned) + { + Spawned->AI()->AttackStart(target); + Spawned->setFaction(103); + } + + //Begin phase 2 by spawning Nefarian and what not + if (SpawnedAdds >= 42) + { + //Teleport Victor Nefarius way out of the map + //MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0); + + //Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + + //Root self + DoCastSpellIfCan(m_creature,33356); + + //Make super invis + DoCastSpellIfCan(m_creature,8149); + + //Teleport self to a hiding spot + m_creature->NearTeleportTo(HIDE_X, HIDE_Y, HIDE_Z, 0.0f); + + //Spawn nef and have him attack a random target + Creature* Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + if (target && Nefarian) + { + Nefarian->AI()->AttackStart(target); + Nefarian->setFaction(103); + NefarianGUID = Nefarian->GetGUID(); + } + else error_log("SD2: Blackwing Lair: Unable to spawn nefarian properly."); + } + + AddSpawnTimer = 4000; + }else AddSpawnTimer -= diff; + } + else if (NefarianGUID) + { + if (NefCheckTime < diff) + { + Creature* pNefarian = m_creature->GetMap()->GetCreature(NefarianGUID); + + //If nef is dead then we die to so the players get out of combat + //and cannot repeat the event + if (!pNefarian || !pNefarian->isAlive()) + { + NefarianGUID = 0; + m_creature->ForcedDespawn(); + } + + NefCheckTime = 2000; + }else NefCheckTime -= diff; + } + } +}; + +CreatureAI* GetAI_boss_victor_nefarius(Creature* pCreature) +{ + return new boss_victor_nefariusAI(pCreature); +} + +bool GossipHello_boss_victor_nefarius(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1 , GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(7134, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_boss_victor_nefarius(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(7198, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(7199, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + DoScriptText(SAY_GAMESBEGIN_1, pCreature); + if (boss_victor_nefariusAI* pNefAI = dynamic_cast(pCreature->AI())) + pNefAI->BeginEvent(pPlayer); + break; + } + return true; +} + +void AddSC_boss_victor_nefarius() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_victor_nefarius"; + newscript->GetAI = &GetAI_boss_victor_nefarius; + newscript->pGossipHello = &GossipHello_boss_victor_nefarius; + newscript->pGossipSelect = &GossipSelect_boss_victor_nefarius; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp b/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp new file mode 100644 index 0000000..6a0a8bb --- /dev/null +++ b/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blackwing_Lair +SD%Complete: 0 +SDComment: +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/eastern_kingdoms/blasted_lands.cpp b/scripts/eastern_kingdoms/blasted_lands.cpp new file mode 100644 index 0000000..65a9555 --- /dev/null +++ b/scripts/eastern_kingdoms/blasted_lands.cpp @@ -0,0 +1,159 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Blasted_Lands +SD%Complete: 90 +SDComment: Quest support: 2784, 2801, 3628. Missing some texts for Fallen Hero. Teleporter to Rise of the Defiler missing group support. +SDCategory: Blasted Lands +EndScriptData */ + +/* ContentData +npc_deathly_usher +npc_fallen_hero_of_horde +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_deathly_usher +######*/ + +#define GOSSIP_ITEM_USHER "I wish to to visit the Rise of the Defiler." + +#define SPELL_TELEPORT_SINGLE 12885 +#define SPELL_TELEPORT_SINGLE_IN_GROUP 13142 +#define SPELL_TELEPORT_GROUP 27686 + +bool GossipHello_npc_deathly_usher(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(3628) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(10757, 1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_USHER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_deathly_usher(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_TELEPORT_SINGLE, true); + } + + return true; +} + +/*###### +## npc_fallen_hero_of_horde +######*/ + +#define GOSSIP_ITEM_FALLEN "Continue..." + +#define GOSSIP_ITEM_FALLEN1 "What could be worse than death?" +#define GOSSIP_ITEM_FALLEN2 "Subordinates?" +#define GOSSIP_ITEM_FALLEN3 "What are the stones of binding?" +#define GOSSIP_ITEM_FALLEN4 "You can count on me, Hero" +#define GOSSIP_ITEM_FALLEN5 "I shall" + +bool GossipHello_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == HORDE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Continue story...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + if (pPlayer->GetQuestStatus(2801) == QUEST_STATUS_INCOMPLETE && pPlayer->GetTeam() == ALLIANCE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Why are you here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_fallen_hero_of_horde(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(1392, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID()); + if (pPlayer->GetQuestStatus(2784) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(2784); + if (pPlayer->GetTeam() == ALLIANCE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1411, pCreature->GetGUID()); + } + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + pPlayer->SEND_GOSSIP_MENU(1451, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + pPlayer->SEND_GOSSIP_MENU(1452, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); + pPlayer->SEND_GOSSIP_MENU(1453, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+23: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); + pPlayer->SEND_GOSSIP_MENU(1454, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+24: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); + pPlayer->SEND_GOSSIP_MENU(1455, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+25: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FALLEN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26); + pPlayer->SEND_GOSSIP_MENU(1456, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+26: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2801); + break; + } + return true; +} + +void AddSC_blasted_lands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_deathly_usher"; + newscript->pGossipHello = &GossipHello_npc_deathly_usher; + newscript->pGossipSelect = &GossipSelect_npc_deathly_usher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_fallen_hero_of_horde"; + newscript->pGossipHello = &GossipHello_npc_fallen_hero_of_horde; + newscript->pGossipSelect = &GossipSelect_npc_fallen_hero_of_horde; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/boss_kruul.cpp b/scripts/eastern_kingdoms/boss_kruul.cpp new file mode 100644 index 0000000..fb52ed3 --- /dev/null +++ b/scripts/eastern_kingdoms/boss_kruul.cpp @@ -0,0 +1,178 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kruul +SD%Complete: 100 +SDComment: Highlord Kruul are presumably no longer in-game on regular bases, however future events could bring him back. +SDCategory: Bosses +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWVOLLEY 21341 +#define SPELL_CLEAVE 20677 +#define SPELL_THUNDERCLAP 23931 +#define SPELL_TWISTEDREFLECTION 21063 +#define SPELL_VOIDBOLT 21066 +#define SPELL_RAGE 21340 +#define SPELL_CAPTURESOUL 21054 + +struct MANGOS_DLL_DECL boss_kruulAI : public ScriptedAI +{ + boss_kruulAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowVolley_Timer; + uint32 Cleave_Timer; + uint32 ThunderClap_Timer; + uint32 TwistedReflection_Timer; + uint32 VoidBolt_Timer; + uint32 Rage_Timer; + uint32 Hound_Timer; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + ShadowVolley_Timer = 10000; + Cleave_Timer = 14000; + ThunderClap_Timer = 20000; + TwistedReflection_Timer = 25000; + VoidBolt_Timer = 30000; + Rage_Timer = 60000; //Cast rage after 1 minute + Hound_Timer = 8000; + } + + void KilledUnit() + { + // When a player, pet or totem gets killed, Lord Kazzak casts this spell to instantly regenerate 70,000 health. + DoCastSpellIfCan(m_creature,SPELL_CAPTURESOUL); + + } + + void SummonHounds(Unit* victim) + { + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(19207, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + if (Summoned) + Summoned->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer < diff) + { + if (rand()%100 < 46) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWVOLLEY); + } + + ShadowVolley_Timer = 5000; + }else ShadowVolley_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + if (rand()%100 < 50) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + } + + Cleave_Timer = 10000; + }else Cleave_Timer -= diff; + + //ThunderClap_Timer + if (ThunderClap_Timer < diff) + { + if (rand()%100 < 20) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_THUNDERCLAP); + } + + ThunderClap_Timer = 12000; + }else ThunderClap_Timer -= diff; + + //TwistedReflection_Timer + if (TwistedReflection_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_TWISTEDREFLECTION); + TwistedReflection_Timer = 30000; + }else TwistedReflection_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + if (rand()%100 < 40) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_VOIDBOLT); + } + + VoidBolt_Timer = 18000; + }else VoidBolt_Timer -= diff; + + //Rage_Timer + if (Rage_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_RAGE); + Rage_Timer = 70000; + }else Rage_Timer -= diff; + + //Hound_Timer + if (Hound_Timer < diff) + { + SummonHounds(m_creature->getVictim()); + SummonHounds(m_creature->getVictim()); + SummonHounds(m_creature->getVictim()); + + Hound_Timer = 45000; + }else Hound_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_kruul(Creature* pCreature) +{ + return new boss_kruulAI(pCreature); +} + +void AddSC_boss_kruul() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kruul"; + newscript->GetAI = &GetAI_boss_kruul; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/burning_steppes.cpp b/scripts/eastern_kingdoms/burning_steppes.cpp new file mode 100644 index 0000000..0c125ad --- /dev/null +++ b/scripts/eastern_kingdoms/burning_steppes.cpp @@ -0,0 +1,149 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Burning_Steppes +SD%Complete: 100 +SDComment: Quest support: 4224, 4866 +SDCategory: Burning Steppes +EndScriptData */ + +/* ContentData +npc_ragged_john +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_ragged_john +######*/ + +struct MANGOS_DLL_DECL npc_ragged_johnAI : public ScriptedAI +{ + npc_ragged_johnAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() {} + + void MoveInLineOfSight(Unit *who) + { + if (who->HasAura(16468, EFFECT_INDEX_0)) + { + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 15) && who->isInAccessablePlaceFor(m_creature)) + { + DoCastSpellIfCan(who,16472); + ((Player*)who)->AreaExploredOrEventHappens(4866); + } + } + + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessablePlaceFor(m_creature)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } +}; + +CreatureAI* GetAI_npc_ragged_john(Creature* pCreature) +{ + return new npc_ragged_johnAI(pCreature); +} + +bool GossipHello_npc_ragged_john(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(4224) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Official buisness, John. I need some information about Marsha Windsor. Tell me about the last time you saw him.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(2713, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_ragged_john(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "So what did you do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2714, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Start making sense, dwarf. I don't want to have anything to do with your cracker, your pappy, or any sort of 'discreditin'.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2715, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ironfoe?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2716, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Interesting... continue John.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(2717, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "So that's how Windsor died...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(2718, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "So how did he die?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(2719, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok so where the hell is he? Wait a minute! Are you drunk?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(2720, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "WHY is he in Blackrock Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + pPlayer->SEND_GOSSIP_MENU(2721, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "300? So the Dark Irons killed him and dragged him into the Depths?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + pPlayer->SEND_GOSSIP_MENU(2722, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ahh... Ironfoe", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + pPlayer->SEND_GOSSIP_MENU(2723, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thanks, Ragged John. Your story was very uplifting and informative", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(2725, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(4224); + break; + } + return true; +} + +void AddSC_burning_steppes() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_ragged_john"; + newscript->GetAI = &GetAI_npc_ragged_john; + newscript->pGossipHello = &GossipHello_npc_ragged_john; + newscript->pGossipSelect = &GossipSelect_npc_ragged_john; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.cpp b/scripts/eastern_kingdoms/deadmines/deadmines.cpp new file mode 100644 index 0000000..0a8a27c --- /dev/null +++ b/scripts/eastern_kingdoms/deadmines/deadmines.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Deadmines +SD%Complete: 90 +SDComment: Contains GO for event at end door +SDCategory: Deadmines +EndScriptData */ + +#include "precompiled.h" +#include "deadmines.h" + +bool GOHello_go_door_lever_dm(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + GameObject* pGoDoor = pInstance->instance->GetGameObject(pInstance->GetData64(DATA_DEFIAS_DOOR)); + + if (pGoDoor && pGoDoor->GetGoState() == 1) + return false; + + return true; +} + +bool GOHello_go_defias_cannon(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance->GetData(TYPE_DEFIAS_ENDDOOR) == DONE || pInstance->GetData(TYPE_DEFIAS_ENDDOOR) == IN_PROGRESS) + return false; + + pInstance->SetData(TYPE_DEFIAS_ENDDOOR, IN_PROGRESS); + return false; +} + +void AddSC_deadmines() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_door_lever_dm"; + newscript->pGOHello = &GOHello_go_door_lever_dm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_defias_cannon"; + newscript->pGOHello = &GOHello_go_defias_cannon; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/deadmines/deadmines.h b/scripts/eastern_kingdoms/deadmines/deadmines.h new file mode 100644 index 0000000..3537da6 --- /dev/null +++ b/scripts/eastern_kingdoms/deadmines/deadmines.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_DEADMINES_H +#define DEF_DEADMINES_H + +enum +{ + MAX_ENCOUNTER = 1, + + TYPE_DEFIAS_ENDDOOR = 1, + DATA_DEFIAS_DOOR = 2, + + INST_SAY_ALARM1 = -1036000, + INST_SAY_ALARM2 = -1036001, + + GO_DOOR_LEVER = 101833, + GO_IRON_CLAD = 16397, + GO_DEFIAS_CANNON = 16398, + NPC_MR_SMITE = 646, + NPC_PIRATE = 657 +}; + +#endif diff --git a/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp new file mode 100644 index 0000000..6974c2f --- /dev/null +++ b/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp @@ -0,0 +1,151 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Deadmines +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Deadmines +EndScriptData */ + +#include "precompiled.h" +#include "deadmines.h" + +struct MANGOS_DLL_DECL instance_deadmines : public ScriptedInstance +{ + instance_deadmines(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiIronCladGUID; + uint64 m_uiCannonGUID; + uint64 m_uiSmiteGUID; + + uint32 m_uiIronDoor_Timer; + uint32 m_uiDoor_Step; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiIronCladGUID = 0; + m_uiCannonGUID = 0; + m_uiSmiteGUID = 0; + + m_uiIronDoor_Timer = 0; + m_uiDoor_Step = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + if (pCreature->GetEntry() == NPC_MR_SMITE) + m_uiSmiteGUID = pCreature->GetGUID(); + } + + void OnObjectCreate(GameObject* pGo) + { + if (pGo->GetEntry() == GO_IRON_CLAD) + m_uiIronCladGUID = pGo->GetGUID(); + + if (pGo->GetEntry() == GO_DEFIAS_CANNON) + m_uiCannonGUID = pGo->GetGUID(); + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == TYPE_DEFIAS_ENDDOOR) + { + if (uiData == IN_PROGRESS) + { + if (GameObject* pGo = instance->GetGameObject(m_uiIronCladGUID)) + { + pGo->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); + m_uiIronDoor_Timer = 3000; + } + } + m_auiEncounter[0] = uiData; + } + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_DEFIAS_ENDDOOR) + return m_auiEncounter[0]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + if (uiData == DATA_DEFIAS_DOOR) + return m_uiIronCladGUID; + + return 0; + } + + void Update(uint32 uiDiff) + { + if (m_uiIronDoor_Timer) + { + if (m_uiIronDoor_Timer <= uiDiff) + { + if (Creature* pMrSmite = instance->GetCreature(m_uiSmiteGUID)) + { + switch(m_uiDoor_Step) + { + case 0: + DoScriptText(INST_SAY_ALARM1,pMrSmite); + m_uiIronDoor_Timer = 2000; + ++m_uiDoor_Step; + break; + case 1: + if (Creature* pi1 = pMrSmite->SummonCreature(NPC_PIRATE, 93.68f, -678.63f, 7.71f, 2.09f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000)) + pi1->GetMotionMaster()->MovePoint(0, 100.11f, -670.65f, 7.42f); + if (Creature* pi2 = pMrSmite->SummonCreature(NPC_PIRATE, 102.63f, -685.07f, 7.42f, 1.28f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000)) + pi2->GetMotionMaster()->MovePoint(0, 100.11f, -670.65f, 7.42f); + ++m_uiDoor_Step; + m_uiIronDoor_Timer = 10000; + break; + case 2: + DoScriptText(INST_SAY_ALARM2,pMrSmite); + m_uiDoor_Step = 0; + m_uiIronDoor_Timer = 0; + debug_log("SD2: Instance Deadmines: Iron door event reached end."); + break; + } + } + else + m_uiIronDoor_Timer = 0; + } + else + m_uiIronDoor_Timer -= uiDiff; + } + } +}; + +InstanceData* GetInstanceData_instance_deadmines(Map* pMap) +{ + return new instance_deadmines(pMap); +} + +void AddSC_instance_deadmines() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_deadmines"; + newscript->GetInstanceData = &GetInstanceData_instance_deadmines; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/dun_morogh.cpp b/scripts/eastern_kingdoms/dun_morogh.cpp new file mode 100644 index 0000000..eb75ed4 --- /dev/null +++ b/scripts/eastern_kingdoms/dun_morogh.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dun_Morogh +SD%Complete: 50 +SDComment: Quest support: 1783 +SDCategory: Dun Morogh +EndScriptData */ + +/* ContentData +npc_narm_faulk +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_narm_faulk +######*/ + +#define SAY_HEAL -1000187 + +struct MANGOS_DLL_DECL npc_narm_faulkAI : public ScriptedAI +{ + uint32 lifeTimer; + bool spellHit; + + npc_narm_faulkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + lifeTimer = 120000; + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + spellHit = false; + } + + void MoveInLineOfSight(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (m_creature->IsStandState()) + { + if (lifeTimer < diff) + m_creature->AI()->EnterEvadeMode(); + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (Spellkind->Id == 8593 && !spellHit) + { + DoCastSpellIfCan(m_creature,32343); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //m_creature->RemoveAllAuras(); + DoScriptText(SAY_HEAL, m_creature, Hitter); + spellHit = true; + } + } + +}; +CreatureAI* GetAI_npc_narm_faulk(Creature* pCreature) +{ + return new npc_narm_faulkAI(pCreature); +} + +void AddSC_dun_morogh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_narm_faulk"; + newscript->GetAI = &GetAI_npc_narm_faulk; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/eastern_plaguelands.cpp b/scripts/eastern_kingdoms/eastern_plaguelands.cpp new file mode 100644 index 0000000..9ec8c94 --- /dev/null +++ b/scripts/eastern_kingdoms/eastern_plaguelands.cpp @@ -0,0 +1,176 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Eastern_Plaguelands +SD%Complete: 100 +SDComment: Quest support: 5211, 5742. Special vendor Augustus the Touched +SDCategory: Eastern Plaguelands +EndScriptData */ + +/* ContentData +mobs_ghoul_flayer +npc_augustus_the_touched +npc_darrowshire_spirit +npc_tirion_fordring +EndContentData */ + +#include "precompiled.h" + +//id8530 - cannibal ghoul +//id8531 - gibbering ghoul +//id8532 - diseased flayer + +struct MANGOS_DLL_DECL mobs_ghoul_flayerAI : public ScriptedAI +{ + mobs_ghoul_flayerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + + void JustDied(Unit* Killer) + { + if (Killer->GetTypeId() == TYPEID_PLAYER) + m_creature->SummonCreature(11064, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); + } + +}; + +CreatureAI* GetAI_mobs_ghoul_flayer(Creature* pCreature) +{ + return new mobs_ghoul_flayerAI(pCreature); +} + +/*###### +## npc_augustus_the_touched +######*/ + +bool GossipHello_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(6164)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_augustus_the_touched(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + +/*###### +## npc_darrowshire_spirit +######*/ + +#define SPELL_SPIRIT_SPAWNIN 17321 + +struct MANGOS_DLL_DECL npc_darrowshire_spiritAI : public ScriptedAI +{ + npc_darrowshire_spiritAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + DoCastSpellIfCan(m_creature,SPELL_SPIRIT_SPAWNIN); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } +}; + +CreatureAI* GetAI_npc_darrowshire_spirit(Creature* pCreature) +{ + return new npc_darrowshire_spiritAI(pCreature); +} + +bool GossipHello_npc_darrowshire_spirit(Player* pPlayer, Creature* pCreature) +{ + pPlayer->SEND_GOSSIP_MENU(3873, pCreature->GetGUID()); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + return true; +} + +/*###### +## npc_tirion_fordring +######*/ + +bool GossipHello_npc_tirion_fordring(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(5742) == QUEST_STATUS_INCOMPLETE && pPlayer->getStandState() == UNIT_STAND_STATE_SIT) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I am ready to hear your tale, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_tirion_fordring(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thank you, Tirion. What of your identity?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(4493, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "That is terrible.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(4494, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will, Tirion.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(4495, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(5742); + break; + } + return true; +} + +void AddSC_eastern_plaguelands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mobs_ghoul_flayer"; + newscript->GetAI = &GetAI_mobs_ghoul_flayer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_augustus_the_touched"; + newscript->pGossipHello = &GossipHello_npc_augustus_the_touched; + newscript->pGossipSelect = &GossipSelect_npc_augustus_the_touched; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_darrowshire_spirit"; + newscript->GetAI = &GetAI_npc_darrowshire_spirit; + newscript->pGossipHello = &GossipHello_npc_darrowshire_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tirion_fordring"; + newscript->pGossipHello = &GossipHello_npc_tirion_fordring; + newscript->pGossipSelect = &GossipSelect_npc_tirion_fordring; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/elwynn_forest.cpp b/scripts/eastern_kingdoms/elwynn_forest.cpp new file mode 100644 index 0000000..1610552 --- /dev/null +++ b/scripts/eastern_kingdoms/elwynn_forest.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Elwynn_Forest +SD%Complete: 50 +SDComment: Quest support: 1786 +SDCategory: Elwynn Forest +EndScriptData */ + +/* ContentData +npc_henze_faulk +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_henze_faulk +######*/ + +#define SAY_HEAL -1000187 + +struct MANGOS_DLL_DECL npc_henze_faulkAI : public ScriptedAI +{ + uint32 lifeTimer; + bool spellHit; + + npc_henze_faulkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + lifeTimer = 120000; + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down + spellHit = false; + } + + void MoveInLineOfSight(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (m_creature->IsStandState()) + { + if (lifeTimer < diff) + m_creature->AI()->EnterEvadeMode(); + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (Spellkind->Id == 8593 && !spellHit) + { + DoCastSpellIfCan(m_creature,32343); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //m_creature->RemoveAllAuras(); + DoScriptText(SAY_HEAL, m_creature, Hitter); + spellHit = true; + } + } + +}; +CreatureAI* GetAI_npc_henze_faulk(Creature* pCreature) +{ + return new npc_henze_faulkAI(pCreature); +} + +void AddSC_elwynn_forest() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_henze_faulk"; + newscript->GetAI = &GetAI_npc_henze_faulk; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/eversong_woods.cpp b/scripts/eastern_kingdoms/eversong_woods.cpp new file mode 100644 index 0000000..f552cc0 --- /dev/null +++ b/scripts/eastern_kingdoms/eversong_woods.cpp @@ -0,0 +1,464 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Eversong_Woods +SD%Complete: 100 +SDComment: Quest support: 8483, 8488, 9686 +SDCategory: Eversong Woods +EndScriptData */ + +/* ContentData +npc_kelerun_bloodmourn +go_harbinger_second_trial +npc_prospector_anvilward +npc_apprentice_mirveda +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_kelerun_bloodmourn +######*/ + +enum +{ + NPC_KELERUN = 17807, + NPC_BLOODWRATH = 17809, + NPC_LIGHTREND = 17810, + NPC_SWIFTBLADE = 17811, + NPC_SUNSTRIKER = 17812, + + GO_SECOND_TRIAL = 182052, + QUEST_SECOND_TRIAL = 9686, + MAX_CHALLENGER = 4 +}; + +const uint32 uiChallengerId[4] = {NPC_BLOODWRATH, NPC_LIGHTREND, NPC_SWIFTBLADE, NPC_SUNSTRIKER}; + +const int32 uiSayId[4] = +{ + -1000319, + -1000320, + -1000321, + -1000322 +}; + +float fChallengerLoc[4][4]= +{ + {10110.667f, -6628.059f, 4.100f, 2.708f}, + {10093.919f, -6634.340f, 4.098f, 1.106f}, + {10087.565f, -6617.282f, 4.098f, 5.887f}, + {10104.807f, -6611.145f, 4.101f, 4.265f} +}; + +struct MANGOS_DLL_DECL npc_kelerun_bloodmournAI : public ScriptedAI +{ + npc_kelerun_bloodmournAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); + Reset(); + } + + uint32 m_uiNpcFlags; + uint64 m_uiPlayerGUID; + uint64 uiChallengerGUID[MAX_CHALLENGER]; + + uint8 m_uiChallengerCount; + + uint32 m_uiTimeOutTimer; + uint32 m_uiCheckAliveStateTimer; + uint32 m_uiEngageTimer; + + bool m_bIsEventInProgress; + + void Reset() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags); + + m_uiPlayerGUID = 0; + + memset(&uiChallengerGUID, 0, sizeof(uiChallengerGUID)); + + m_uiChallengerCount = 0; + + m_uiTimeOutTimer = 60000; + m_uiCheckAliveStateTimer = 2500; + m_uiEngageTimer = 0; + + m_bIsEventInProgress = false; + } + + void StartEvent() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + m_bIsEventInProgress = true; + } + + bool CanProgressEvent(uint64 uiPlayer) + { + if (m_bIsEventInProgress) + { + m_uiPlayerGUID = uiPlayer; + DoSpawnChallengers(); + m_uiEngageTimer = 15000; + + return true; + } + + return false; + } + + void DoSpawnChallengers() + { + for(uint8 i = 0; i < MAX_CHALLENGER; ++i) + { + if (Creature* pCreature = m_creature->SummonCreature(uiChallengerId[i], + fChallengerLoc[i][0], fChallengerLoc[i][1], + fChallengerLoc[i][2], fChallengerLoc[i][3], + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) + { + uiChallengerGUID[i] = pCreature->GetGUID(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bIsEventInProgress) + { + if (m_uiTimeOutTimer && m_uiTimeOutTimer < uiDiff) + { + if (!m_uiPlayerGUID) + { + //player are expected to use GO within a minute, if not, event will fail. + Reset(); + return; + } + + m_uiTimeOutTimer = 0; + } + else + m_uiTimeOutTimer -= uiDiff; + + if (m_uiCheckAliveStateTimer < uiDiff) + { + if (Creature* pChallenger = m_creature->GetMap()->GetCreature(uiChallengerGUID[m_uiChallengerCount])) + { + if (!pChallenger->isAlive()) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (pPlayer && !pPlayer->isAlive()) + { + Reset(); + return; + } + + ++m_uiChallengerCount; + + //count starts at 0 + if (m_uiChallengerCount == MAX_CHALLENGER) + { + if (pPlayer && pPlayer->isAlive()) + pPlayer->GroupEventHappens(QUEST_SECOND_TRIAL, m_creature); + + Reset(); + return; + } + else + m_uiEngageTimer = 15000; + } + } + m_uiCheckAliveStateTimer = 2500; + } + else + m_uiCheckAliveStateTimer -= uiDiff; + + if (m_uiEngageTimer && m_uiEngageTimer < uiDiff) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (pPlayer && pPlayer->isAlive()) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(uiChallengerGUID[m_uiChallengerCount])) + { + DoScriptText(uiSayId[m_uiChallengerCount], m_creature, pPlayer); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->AI()->AttackStart(pPlayer); + } + } + + m_uiEngageTimer = 0; + } + else + m_uiEngageTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_kelerun_bloodmourn(Creature* pCreature) +{ + return new npc_kelerun_bloodmournAI(pCreature); +} + +//easiest way is to expect database to respawn GO at quest accept (quest_start_script) +bool QuestAccept_npc_kelerun_bloodmourn(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_SECOND_TRIAL) + { + if (npc_kelerun_bloodmournAI* pKelrunAI = dynamic_cast(pCreature->AI())) + pKelrunAI->StartEvent(); + } + + return true; +} + +bool GOHello_go_harbinger_second_trial(Player* pPlayer, GameObject* pGO) +{ + if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + { + if (Creature* pCreature = GetClosestCreatureWithEntry(pGO, NPC_KELERUN, 30.0f)) + { + npc_kelerun_bloodmournAI* pKelrunAI = dynamic_cast(pCreature->AI()); + if (pKelrunAI && pKelrunAI->CanProgressEvent(pPlayer->GetGUID())) + return false; + } + } + + return false; +} + +/*###### +## npc_prospector_anvilward +######*/ +enum +{ + SAY_ANVIL1 = -1000209, + SAY_ANVIL2 = -1000210, + + FACTION_DEFAULT = 35, + FACTION_HOSTILE = 24, + + QUEST_THE_DWARVEN_SPY = 8483 +}; + +struct MANGOS_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI +{ + // CreatureAI functions + npc_prospector_anvilwardAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} + + // Pure Virtual Functions + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch (uiPointId) + { + case 0: + DoScriptText(SAY_ANVIL1, m_creature, pPlayer); + break; + case 5: + DoScriptText(SAY_ANVIL2, m_creature, pPlayer); + break; + case 6: + m_creature->setFaction(FACTION_HOSTILE); + break; + } + } + + void Reset() + { + //Default npc faction + m_creature->setFaction(FACTION_DEFAULT); + } + + void JustDied(Unit* pKiller) + { + //Default npc faction + m_creature->setFaction(FACTION_DEFAULT); + } +}; + +CreatureAI* GetAI_npc_prospector_anvilward(Creature* pCreature) +{ + return new npc_prospector_anvilwardAI(pCreature); +} + +#define GOSSIP_ITEM_MOMENT "I need a moment of your time, sir." +#define GOSSIP_ITEM_SHOW "Why... yes, of course. I've something to show you right inside this building, Mr. Anvilward." + +bool GossipHello_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_THE_DWARVEN_SPY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MOMENT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(8239, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_prospector_anvilward(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SHOW, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(8240, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_prospector_anvilwardAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID()); + + break; + } + return true; +} + +/*###### +## npc_apprentice_mirveda +######*/ + +enum +{ + QUEST_UNEXPECTED_RESULT = 8488, + + SPELL_FIREBALL = 20811, + + NPC_GHARSUL = 15958, + NPC_ANGERSHADE = 15656 +}; + +struct MANGOS_DLL_DECL npc_apprentice_mirvedaAI : public ScriptedAI +{ + npc_apprentice_mirvedaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint8 m_uiMobCount; + uint32 m_uiFireballTimer; + uint64 m_uiPlayerGUID; + + void Reset() + { + m_uiMobCount = 0; + m_uiPlayerGUID = 0; + m_uiFireballTimer = 0; + } + + void JustDied(Unit* pKiller) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (pPlayer && pPlayer->GetQuestStatus(QUEST_UNEXPECTED_RESULT) == QUEST_STATUS_INCOMPLETE) + pPlayer->SendQuestFailed(QUEST_UNEXPECTED_RESULT); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + ++m_uiMobCount; + } + + void SummonedCreatureJustDied(Creature* pKilled) + { + --m_uiMobCount; + + if (m_uiMobCount) + return; + + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (pPlayer && pPlayer->GetQuestStatus(QUEST_UNEXPECTED_RESULT) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_UNEXPECTED_RESULT, m_creature); + + m_uiPlayerGUID = 0; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + } + + void StartEvent(uint64 uiPlayerGUID) + { + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_uiPlayerGUID = uiPlayerGUID; + + m_creature->SummonCreature(NPC_GHARSUL, 8745.0f, -7134.32f, 35.22f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 4000); + m_creature->SummonCreature(NPC_ANGERSHADE, 8745.0f, -7134.32f, 35.22f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 4000); + m_creature->SummonCreature(NPC_ANGERSHADE, 8745.0f, -7134.32f, 35.22f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 4000); + } + + void UpdateAI (const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiFireballTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIREBALL) == CAST_OK) + m_uiFireballTimer = urand(4000, 6000); + } + else + m_uiFireballTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_unexpected_results(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_UNEXPECTED_RESULT) + if (npc_apprentice_mirvedaAI* pMirvedaAI = dynamic_cast(pCreature->AI())) + pMirvedaAI->StartEvent(pPlayer->GetGUID()); + return true; +} + +CreatureAI* GetAI_npc_apprentice_mirvedaAI(Creature* pCreature) +{ + return new npc_apprentice_mirvedaAI (pCreature); +} + +void AddSC_eversong_woods() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_kelerun_bloodmourn"; + pNewScript->GetAI = &GetAI_npc_kelerun_bloodmourn; + pNewScript->pQuestAccept = &QuestAccept_npc_kelerun_bloodmourn; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_harbinger_second_trial"; + pNewScript->pGOHello = &GOHello_go_harbinger_second_trial; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_prospector_anvilward"; + pNewScript->GetAI = &GetAI_npc_prospector_anvilward; + pNewScript->pGossipHello = &GossipHello_npc_prospector_anvilward; + pNewScript->pGossipSelect = &GossipSelect_npc_prospector_anvilward; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_apprentice_mirveda"; + pNewScript->GetAI = GetAI_npc_apprentice_mirvedaAI; + pNewScript->pQuestAccept = &QuestAccept_unexpected_results; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/ghostlands.cpp b/scripts/eastern_kingdoms/ghostlands.cpp new file mode 100644 index 0000000..cfbc26d --- /dev/null +++ b/scripts/eastern_kingdoms/ghostlands.cpp @@ -0,0 +1,274 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ghostlands +SD%Complete: 100 +SDComment: Quest support: 9212, 9692. Obtain Budd's Guise of Zul'aman. Vendor Rathis Tomber +SDCategory: Ghostlands +EndScriptData */ + +/* ContentData +npc_blood_knight_dawnstar +npc_budd_nedreck +npc_ranger_lilatha +npc_rathis_tomber +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_blood_knight_dawnstar +######*/ + +#define GOSSIP_ITEM_INSIGNIA "Take Blood Knight Insignia" + +bool GossipHello_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(9692) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(24226,1,true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_INSIGNIA,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_blood_knight_dawnstar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(24226, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + + pPlayer->CLOSE_GOSSIP_MENU(); + } + return true; +} + +/*###### +## npc_budd_nedreck +######*/ + +#define GOSSIP_ITEM_DISGUISE "You gave the crew disguises?" + +bool GossipHello_npc_budd_nedreck(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(11166) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_DISGUISE,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_budd_nedreck(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction==GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 42540, false); + } + return true; +} + +/*###### +## npc_ranger_lilatha +######*/ + +enum +{ + SAY_START = -1000140, + SAY_PROGRESS1 = -1000141, + SAY_PROGRESS2 = -1000142, + SAY_PROGRESS3 = -1000143, + SAY_END1 = -1000144, + SAY_END2 = -1000145, + CAPTAIN_ANSWER = -1000146, + + QUEST_CATACOMBS = 9212, + GO_CAGE = 181152, + NPC_CAPTAIN_HELIOS = 16220, + FACTION_SMOON_E = 1603, +}; + +struct MANGOS_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI +{ + npc_ranger_lilathaAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiGoCageGUID = 0; + m_uiHeliosGUID = 0; + Reset(); + } + + uint64 m_uiGoCageGUID; + uint64 m_uiHeliosGUID; + + void MoveInLineOfSight(Unit* pUnit) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (!m_uiHeliosGUID && pUnit->GetEntry() == NPC_CAPTAIN_HELIOS) + { + if (m_creature->IsWithinDistInMap(pUnit, 30.0f)) + m_uiHeliosGUID = pUnit->GetGUID(); + } + } + + npc_escortAI::MoveInLineOfSight(pUnit); + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + if (GameObject* pGoTemp = GetClosestGameObjectWithEntry(m_creature, GO_CAGE, 10.0f)) + { + m_uiGoCageGUID = pGoTemp->GetGUID(); + pGoTemp->SetGoState(GO_STATE_ACTIVE); + } + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoScriptText(SAY_START, m_creature, pPlayer); + break; + case 1: + if (GameObject* pGo = m_creature->GetMap()->GetGameObject(m_uiGoCageGUID)) + pGo->SetGoState(GO_STATE_READY); + break; + case 5: + DoScriptText(SAY_PROGRESS1, m_creature, pPlayer); + break; + case 11: + DoScriptText(SAY_PROGRESS2, m_creature, pPlayer); + break; + case 18: + DoScriptText(SAY_PROGRESS3, m_creature, pPlayer); + if (Creature* pSum1 = m_creature->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0)) + pSum1->AI()->AttackStart(m_creature); + if (Creature* pSum2 = m_creature->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0)) + pSum2->AI()->AttackStart(pPlayer); + break; + case 19: + SetRun(); + break; + case 25: + SetRun(false); + break; + case 30: + pPlayer->GroupEventHappens(QUEST_CATACOMBS, m_creature); + break; + case 32: + DoScriptText(SAY_END1, m_creature, pPlayer); + break; + case 33: + DoScriptText(SAY_END2, m_creature, pPlayer); + if (Creature* pHelios = m_creature->GetMap()->GetCreature(m_uiHeliosGUID)) + DoScriptText(CAPTAIN_ANSWER, pHelios, m_creature); + break; + } + } + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + m_uiGoCageGUID = 0; + m_uiHeliosGUID = 0; + } + } +}; + +CreatureAI* GetAI_npc_ranger_lilathaAI(Creature* pCreature) +{ + return new npc_ranger_lilathaAI(pCreature); +} + +bool QuestAccept_npc_ranger_lilatha(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_CATACOMBS) + { + pCreature->setFaction(FACTION_SMOON_E); + + if (npc_ranger_lilathaAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## npc_rathis_tomber +######*/ + +bool GossipHello_npc_rathis_tomber(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(9152)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(8432, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(8431, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_rathis_tomber(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +void AddSC_ghostlands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_blood_knight_dawnstar"; + newscript->pGossipHello = &GossipHello_npc_blood_knight_dawnstar; + newscript->pGossipSelect = &GossipSelect_npc_blood_knight_dawnstar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_budd_nedreck"; + newscript->pGossipHello = &GossipHello_npc_budd_nedreck; + newscript->pGossipSelect = &GossipSelect_npc_budd_nedreck; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ranger_lilatha"; + newscript->GetAI = &GetAI_npc_ranger_lilathaAI; + newscript->pQuestAccept = &QuestAccept_npc_ranger_lilatha; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_rathis_tomber"; + newscript->pGossipHello = &GossipHello_npc_rathis_tomber; + newscript->pGossipSelect = &GossipSelect_npc_rathis_tomber; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/gnomeregan/boss_thermaplugg.cpp b/scripts/eastern_kingdoms/gnomeregan/boss_thermaplugg.cpp new file mode 100644 index 0000000..9920cb1 --- /dev/null +++ b/scripts/eastern_kingdoms/gnomeregan/boss_thermaplugg.cpp @@ -0,0 +1,272 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mekgineer_Thermaplugg +SD%Complete: 90 - Timer +SDComment: Timer need improvement, especially for bomb-spawning +SDCategory: Gnomeregan +EndScriptData */ + +#include "precompiled.h" +#include "gnomeregan.h" + +enum +{ + SAY_AGGRO = -1090024, + SAY_PHASE = -1090025, + SAY_BOMB = -1090026, + SAY_SLAY = -1090027, + + SPELL_ACTIVATE_BOMB_A = 11511, // Target Dest = -530.754 670.571 -313.784 + SPELL_ACTIVATE_BOMB_B = 11795, // Target Dest = -530.754 670.571 -313.784 + SPELL_KNOCK_AWAY = 10101, + SPELL_KNOCK_AWAY_AOE = 11130, + SPELL_WALKING_BOMB_EFFECT = 11504, + + NPC_WALKING_BOMB = 7915, +}; + +static const float fBombSpawnZ = -316.2625f; + +struct MANGOS_DLL_DECL boss_thermapluggAI : public ScriptedAI +{ + boss_thermapluggAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_gnomeregan*)pCreature->GetInstanceData(); + Reset(); + } + + instance_gnomeregan* m_pInstance; + bool m_bIsPhaseTwo; + + uint32 m_uiKnockAwayTimer; + uint32 m_uiActivateBombTimer; + + sBombFace* m_asBombFaces; + float m_afSpawnPos[3]; + + std::list m_lSummonedBombGUIDs; + std::list m_lLandedBombGUIDs; + + void Reset() + { + m_uiKnockAwayTimer = urand(17000, 20000); + m_uiActivateBombTimer = urand(10000, 15000); + m_bIsPhaseTwo = false; + m_asBombFaces = NULL; + + memset(&m_afSpawnPos, 0.0f, sizeof(m_afSpawnPos)); + m_lLandedBombGUIDs.clear(); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_THERMAPLUGG, DONE); + + m_lSummonedBombGUIDs.clear(); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_THERMAPLUGG, IN_PROGRESS); + m_asBombFaces = m_pInstance->GetBombFaces(); + } + + m_afSpawnPos[0] = m_creature->GetPositionX(); + m_afSpawnPos[1] = m_creature->GetPositionY(); + m_afSpawnPos[2] = m_creature->GetPositionZ(); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_THERMAPLUGG, FAIL); + + // Remove remaining bombs + for (std::list::const_iterator itr = m_lSummonedBombGUIDs.begin(); itr != m_lSummonedBombGUIDs.end(); itr++) + { + if (Creature* pBomb = m_creature->GetMap()->GetCreature(*itr)) + pBomb->ForcedDespawn(); + } + m_lSummonedBombGUIDs.clear(); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_WALKING_BOMB) + { + m_lSummonedBombGUIDs.push_back(pSummoned->GetGUID()); + // calculate point for falling down + float fX, fY; + fX = 0.2*m_afSpawnPos[0] + 0.8*pSummoned->GetPositionX(); + fY = 0.2*m_afSpawnPos[1] + 0.8*pSummoned->GetPositionY(); + pSummoned->GetMotionMaster()->MovePoint(1, fX, fY, m_afSpawnPos[2] - 2.0f); + } + } + + void SummonedMovementInform(Creature* pSummoned, uint32 uiMotionType, uint32 uiPointId) + { + if (pSummoned->GetEntry() == NPC_WALKING_BOMB && uiMotionType == POINT_MOTION_TYPE && uiPointId == 1) + m_lLandedBombGUIDs.push_back(pSummoned->GetGUID()); + } + + void SummonedCreatureDespawn(Creature* pSummoned) + { + m_lSummonedBombGUIDs.remove(pSummoned->GetGUID()); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Movement of Summoned mobs + if (!m_lLandedBombGUIDs.empty()) + { + for (std::list::const_iterator itr = m_lLandedBombGUIDs.begin(); itr != m_lLandedBombGUIDs.end(); itr++) + { + if (Creature* pBomb = m_creature->GetMap()->GetCreature(*itr)) + pBomb->GetMotionMaster()->MoveFollow(m_creature, 0.0f, 0.0f); + } + m_lLandedBombGUIDs.clear(); + } + + if (!m_bIsPhaseTwo && m_creature->GetHealthPercent() < 50.0f) + { + DoScriptText(SAY_PHASE, m_creature); + m_bIsPhaseTwo = true; + } + + if (m_uiKnockAwayTimer < uiDiff) + { + if (m_bIsPhaseTwo) + { + if (DoCastSpellIfCan(m_creature, SPELL_KNOCK_AWAY_AOE) == CAST_OK) + m_uiKnockAwayTimer = 12000; + } + else + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_KNOCK_AWAY) == CAST_OK) + m_uiKnockAwayTimer = urand(17000, 20000); + } + } + else + m_uiKnockAwayTimer -= uiDiff; + + if (m_uiActivateBombTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsPhaseTwo ? SPELL_ACTIVATE_BOMB_B : SPELL_ACTIVATE_BOMB_A) == CAST_OK) + { + m_uiActivateBombTimer = (m_bIsPhaseTwo ? urand(6, 12) : urand(12, 17))*IN_MILLISECONDS; + if (!urand(0, 5)) // TODO, chance/ place for this correct? + DoScriptText(SAY_BOMB, m_creature); + } + } + else + m_uiActivateBombTimer -= uiDiff; + + // Spawn bombs + if (m_asBombFaces) + { + for (uint8 i = 0; i < MAX_GNOME_FACES; i++) + { + if (m_asBombFaces[i].m_bActivated) + { + if (m_asBombFaces[i].m_uiBombTimer < uiDiff) + { + // Calculate the spawning position as 90% between face and thermaplugg spawn-pos, and hight hardcoded + float fX = 0.0f, fY = 0.0f; + if (GameObject* pFace = m_creature->GetMap()->GetGameObject(m_asBombFaces[i].m_uiGnomeFaceGUID)) + { + fX = 0.35*m_afSpawnPos[0] + 0.65*pFace->GetPositionX(); + fY = 0.35*m_afSpawnPos[1] + 0.65*pFace->GetPositionY(); + } + m_creature->SummonCreature(NPC_WALKING_BOMB, fX, fY, fBombSpawnZ, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_asBombFaces[i].m_uiBombTimer = urand(10000, 25000); // TODO + } + else + m_asBombFaces[i].m_uiBombTimer -= uiDiff; + } + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thermaplugg(Creature* pCreature) +{ + return new boss_thermapluggAI(pCreature); +} + +bool EffectDummyCreature_spell_boss_thermaplugg(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + if ((uiSpellId != SPELL_ACTIVATE_BOMB_A && uiSpellId != SPELL_ACTIVATE_BOMB_B) || uiEffIndex != EFFECT_INDEX_0) + return false; + + // This spell should select a random Bomb-Face and activate it if needed + if (instance_gnomeregan* pInstance = (instance_gnomeregan*)pCreatureTarget->GetInstanceData()) + pInstance->DoActivateBombFace(urand(0, MAX_GNOME_FACES - 1)); + + return true; +} + +bool GOHello_go_gnomeface_button(Player* pPlayer, GameObject* pGo) +{ + instance_gnomeregan* pInstance = (instance_gnomeregan*)pPlayer->GetInstanceData(); + if (!pInstance) + return false; + + // If a button is used, the related face should be deactivated (if already activated) + switch (pGo->GetEntry()) + { + case GO_BUTTON_1: pInstance->DoDeactivateBombFace(0); break; + case GO_BUTTON_2: pInstance->DoDeactivateBombFace(1); break; + case GO_BUTTON_3: pInstance->DoDeactivateBombFace(2); break; + case GO_BUTTON_4: pInstance->DoDeactivateBombFace(3); break; + case GO_BUTTON_5: pInstance->DoDeactivateBombFace(4); break; + case GO_BUTTON_6: pInstance->DoDeactivateBombFace(5); break; + } + + return false; +} + +void AddSC_boss_thermaplugg() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_thermaplugg"; + pNewScript->GetAI = &GetAI_boss_thermaplugg; + pNewScript->pEffectDummyCreature = &EffectDummyCreature_spell_boss_thermaplugg; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_gnomeface_button"; + pNewScript->pGOHello = &GOHello_go_gnomeface_button; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp b/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp new file mode 100644 index 0000000..7b3286d --- /dev/null +++ b/scripts/eastern_kingdoms/gnomeregan/gnomeregan.cpp @@ -0,0 +1,80 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: gnomeregan +SD%Complete: 80 +SDComment: Grubbis Encounter +SDCategory: Gnomeregan +EndScriptData */ + +/* ContentData +npc_blastmaster_emi_shortfuse +EndContentData */ + +#include "precompiled.h" +#include "gnomeregan.h" +#include "escort_ai.h" + +/*###### +## npc_blastmaster_emi_shortfuse +######*/ + +enum +{ + SAY_START = -1090000, + SAY_INTRO_1 = -1090001, + SAY_INTRO_2 = -1090002, + SAY_INTRO_3 = -1090003, + SAY_INTRO_4 = -1090004, + SAY_LOOK_1 = -1090005, + SAY_HEAR_1 = -1090006, + SAY_AGGRO = -1090007, + SAY_CHARGE_1 = -1090008, + SAY_CHARGE_2 = -1090009, + SAY_BLOW_1_10 = -1090010, + SAY_BLOW_1_5 = -1090011, + SAY_BLOW_1 = -1090012, + SAY_FINISH_1 = -1090013, + SAY_LOOK_2 = -1090014, + SAY_HEAR_2 = -1090015, + SAY_CHARGE_3 = -1090016, + SAY_CHARGE_4 = -1090017, + SAY_BLOW_2_10 = -1090018, + SAY_BLOW_2_5 = -1090019, + SAY_BLOW_SOON = -1090020, + SAY_BLOW_2 = -1090021, + SAY_FINISH_2 = -1090022, + + SAY_GRUBBIS_SPAWN = -1090023, + + GOSSIP_ITEM_START = -3090000, + + SPELL_EXPLOSION_NORTH = 12158, + SPELL_EXPLOSION_SOUTH = 12159, + SPELL_FIREWORKS_RED = 11542, + + MAX_SUMMON_POSITIONS = 33, + + NPC_GRUBBIS = 7361, + NPC_CHOMPER = 6215, + NPC_CAVERNDEEP_BURROWER = 6206, + NPC_CAVERNDEEP_AMBUSHER = 6207 +}; + +void AddSC_gnomeregan() +{ +} diff --git a/scripts/eastern_kingdoms/gnomeregan/gnomeregan.h b/scripts/eastern_kingdoms/gnomeregan/gnomeregan.h new file mode 100644 index 0000000..bea823f --- /dev/null +++ b/scripts/eastern_kingdoms/gnomeregan/gnomeregan.h @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_GNOMEREGAN_H +#define DEF_GNOMEREGAN_H + +enum +{ + MAX_ENCOUNTER = 2, // Only Grubbis and Thermaplugg need treatment + MAX_GNOME_FACES = 6, + MAX_EXPLOSIVES_PER_SIDE = 2, + + TYPE_GRUBBIS = 1, + TYPE_THERMAPLUGG = 2, + TYPE_EXPLOSIVE_CHARGE = 3, + + DATA_EXPLOSIVE_CHARGE_1 = 1, + DATA_EXPLOSIVE_CHARGE_2 = 2, + DATA_EXPLOSIVE_CHARGE_3 = 3, + DATA_EXPLOSIVE_CHARGE_4 = 4, + DATA_EXPLOSIVE_CHARGE_USE = 5, + + NPC_BLASTMASTER_SHORTFUSE = 7998, + + GO_RED_ROCKET = 103820, + GO_CAVE_IN_NORTH = 146085, + GO_CAVE_IN_SOUTH = 146086, + GO_EXPLOSIVE_CHARGE = 144065, + GO_THE_FINAL_CHAMBER = 142207, + + GO_GNOME_FACE_1 = 142211, + GO_GNOME_FACE_2 = 142210, + GO_GNOME_FACE_3 = 142209, + GO_GNOME_FACE_4 = 142208, + GO_GNOME_FACE_5 = 142213, + GO_GNOME_FACE_6 = 142212, + + GO_BUTTON_1 = 142214, + GO_BUTTON_2 = 142215, + GO_BUTTON_3 = 142216, + GO_BUTTON_4 = 142217, + GO_BUTTON_5 = 142218, + GO_BUTTON_6 = 142219 +}; + +struct sBombFace +{ + uint64 m_uiGnomeFaceGUID; + bool m_bActivated; + uint32 m_uiBombTimer; +}; + +class MANGOS_DLL_DECL instance_gnomeregan : public ScriptedInstance +{ + public: + instance_gnomeregan(Map* pMap); + ~instance_gnomeregan() {} + + void Initialize(); + + void OnCreatureCreate(Creature* pCreature); + void OnObjectCreate(GameObject* pGo); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + sBombFace* GetBombFaces(); + void DoActivateBombFace(uint8 uiIndex); + void DoDeactivateBombFace(uint8 uiIndex); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + sBombFace m_asBombFaces[MAX_GNOME_FACES]; + uint64 m_auiExplosiveSortedGUIDs[2][MAX_EXPLOSIVES_PER_SIDE]; + + uint64 m_uiBlastmasterShortfuseGUID; + uint64 m_uiCaveInNorthGUID; + uint64 m_uiCaveInSouthGUID; + uint64 m_uiDoorFinalChamberGUID; + + std::list m_lExplosiveCharges; + std::list m_luiSpawnedExplosiveChargeGUIDs; + std::list m_lRedRocketGUIDs; +}; + +#endif diff --git a/scripts/eastern_kingdoms/gnomeregan/instance_gnomeregan.cpp b/scripts/eastern_kingdoms/gnomeregan/instance_gnomeregan.cpp new file mode 100644 index 0000000..882469e --- /dev/null +++ b/scripts/eastern_kingdoms/gnomeregan/instance_gnomeregan.cpp @@ -0,0 +1,292 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Gnomeregan +SD%Complete: 90% +SDComment: Support for Grubbis and Thermaplugg Encounters +SDCategory: Gnomeregan +EndScriptData */ + +#include "precompiled.h" +#include "gnomeregan.h" + +instance_gnomeregan::instance_gnomeregan(Map* pMap) : ScriptedInstance(pMap), + m_uiBlastmasterShortfuseGUID(0), + m_uiCaveInNorthGUID(0), + m_uiCaveInSouthGUID(0), + m_uiDoorFinalChamberGUID(0) +{ + Initialize(); +} + +void instance_gnomeregan::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_asBombFaces, 0, sizeof(m_asBombFaces)); + memset(&m_auiExplosiveSortedGUIDs, 0, sizeof(m_auiExplosiveSortedGUIDs)); +} + +void instance_gnomeregan::OnCreatureCreate(Creature* pCreature) +{ + switch (pCreature->GetEntry()) + { + case NPC_BLASTMASTER_SHORTFUSE: m_uiBlastmasterShortfuseGUID = pCreature->GetGUID(); break; + } +} + +void instance_gnomeregan::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_RED_ROCKET: m_lRedRocketGUIDs.push_back(pGo->GetGUID()); break; + case GO_CAVE_IN_NORTH: m_uiCaveInNorthGUID = pGo->GetGUID(); break; + case GO_CAVE_IN_SOUTH: m_uiCaveInSouthGUID = pGo->GetGUID(); break; + case GO_EXPLOSIVE_CHARGE: m_lExplosiveCharges.push_back(pGo); break; + case GO_THE_FINAL_CHAMBER: m_uiDoorFinalChamberGUID = pGo->GetGUID(); break; + + case GO_GNOME_FACE_1: m_asBombFaces[0].m_uiGnomeFaceGUID = pGo->GetGUID(); break; + case GO_GNOME_FACE_2: m_asBombFaces[1].m_uiGnomeFaceGUID = pGo->GetGUID(); break; + case GO_GNOME_FACE_3: m_asBombFaces[2].m_uiGnomeFaceGUID = pGo->GetGUID(); break; + case GO_GNOME_FACE_4: m_asBombFaces[3].m_uiGnomeFaceGUID = pGo->GetGUID(); break; + case GO_GNOME_FACE_5: m_asBombFaces[4].m_uiGnomeFaceGUID = pGo->GetGUID(); break; + case GO_GNOME_FACE_6: m_asBombFaces[5].m_uiGnomeFaceGUID = pGo->GetGUID(); break; + } +} + +static bool sortFromEastToWest(GameObject* pFirst, GameObject* pSecond) +{ + return pFirst && pSecond && pFirst->GetPositionY() < pSecond->GetPositionY(); +} + +void instance_gnomeregan::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_GRUBBIS: + m_auiEncounter[0] = uiData; + if (uiData == IN_PROGRESS) + { + // Sort the explosive charges if needed + if (!m_lExplosiveCharges.empty()) + { + // Sort from east to west + m_lExplosiveCharges.sort(sortFromEastToWest); + + // Sort to south and north + uint8 uiCounterSouth = 0; + uint8 uiCounterNorth = 0; + GameObject* pCaveInSouth = instance->GetGameObject(m_uiCaveInSouthGUID); + GameObject* pCaveInNorth = instance->GetGameObject(m_uiCaveInNorthGUID); + if (pCaveInSouth && pCaveInNorth) + { + for (std::list::iterator itr = m_lExplosiveCharges.begin(); itr != m_lExplosiveCharges.end(); itr++) + { + if ((*itr)->GetDistanceOrder(pCaveInSouth, pCaveInNorth) && uiCounterSouth < MAX_EXPLOSIVES_PER_SIDE) + { + m_auiExplosiveSortedGUIDs[0][uiCounterSouth] = (*itr)->GetGUID(); + uiCounterSouth++; + } + else if (uiCounterNorth < MAX_EXPLOSIVES_PER_SIDE) + { + m_auiExplosiveSortedGUIDs[1][uiCounterNorth] = (*itr)->GetGUID(); + uiCounterNorth++; + } + } + m_lExplosiveCharges.clear(); + } + } + } + if (uiData == FAIL) + { + // Despawn possible spawned explosive charges + SetData(TYPE_EXPLOSIVE_CHARGE, DATA_EXPLOSIVE_CHARGE_USE); + } + if (uiData == DONE) + { + for (std::list::const_iterator itr = m_lRedRocketGUIDs.begin(); itr != m_lRedRocketGUIDs.end(); itr++) + DoRespawnGameObject(*itr, HOUR); + } + break; + case TYPE_EXPLOSIVE_CHARGE: + switch (uiData) + { + case DATA_EXPLOSIVE_CHARGE_1: + DoRespawnGameObject(m_auiExplosiveSortedGUIDs[0][0], HOUR); + m_luiSpawnedExplosiveChargeGUIDs.push_back(m_auiExplosiveSortedGUIDs[0][0]); + break; + case DATA_EXPLOSIVE_CHARGE_2: + DoRespawnGameObject(m_auiExplosiveSortedGUIDs[0][1], HOUR); + m_luiSpawnedExplosiveChargeGUIDs.push_back(m_auiExplosiveSortedGUIDs[0][1]); + break; + case DATA_EXPLOSIVE_CHARGE_3: + DoRespawnGameObject(m_auiExplosiveSortedGUIDs[1][0], HOUR); + m_luiSpawnedExplosiveChargeGUIDs.push_back(m_auiExplosiveSortedGUIDs[1][0]); + break; + case DATA_EXPLOSIVE_CHARGE_4: + DoRespawnGameObject(m_auiExplosiveSortedGUIDs[1][1], HOUR); + m_luiSpawnedExplosiveChargeGUIDs.push_back(m_auiExplosiveSortedGUIDs[1][1]); + break; + case DATA_EXPLOSIVE_CHARGE_USE: + Creature* pBlastmaster = instance->GetCreature(m_uiBlastmasterShortfuseGUID); + if (!pBlastmaster) + break; + for (std::list::const_iterator itr = m_luiSpawnedExplosiveChargeGUIDs.begin(); itr != m_luiSpawnedExplosiveChargeGUIDs.end(); itr++) + { + if (GameObject* pExplosive = instance->GetGameObject(*itr)) + pExplosive->Use(pBlastmaster); + } + m_luiSpawnedExplosiveChargeGUIDs.clear(); + break; + } + return; + case TYPE_THERMAPLUGG: + m_auiEncounter[1] = uiData; + if (uiData == IN_PROGRESS) + { + // Make Door locked + if (GameObject* pDoor = instance->GetGameObject(m_uiDoorFinalChamberGUID)) + { + if (pDoor->getLootState() == GO_ACTIVATED) + pDoor->ResetDoorOrButton(); + + // Doesn't work here, because the flags are to be reseted on next tick in GO::Update + pDoor->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + + // Always directly activates this bomb-face + DoActivateBombFace(2); + } + else if (uiData == DONE || uiData == FAIL) + { + // Make Door unlocked again + if (GameObject* pDoor = instance->GetGameObject(m_uiDoorFinalChamberGUID)) + { + if (pDoor->getLootState() == GO_READY) + pDoor->UseDoorOrButton(); + pDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + + // Deactivate all remaining BombFaces + for (uint8 i = 0; i < MAX_GNOME_FACES; i++) + DoDeactivateBombFace(i); + } + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_gnomeregan::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_gnomeregan::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_GRUBBIS: return m_auiEncounter[0]; + case TYPE_THERMAPLUGG: return m_auiEncounter[1]; + default: + return 0; + } +} + +uint64 instance_gnomeregan::GetData64(uint32 uiData) +{ + switch(uiData) + { + case GO_CAVE_IN_NORTH: return m_uiCaveInNorthGUID; + case GO_CAVE_IN_SOUTH: return m_uiCaveInSouthGUID; + default: + return 0; + } +} + +sBombFace* instance_gnomeregan::GetBombFaces() +{ + return m_asBombFaces; +} + +void instance_gnomeregan::DoActivateBombFace(uint8 uiIndex) +{ + if (uiIndex >= MAX_GNOME_FACES) + return; + + if (!m_asBombFaces[uiIndex].m_bActivated) + { + DoUseDoorOrButton(m_asBombFaces[uiIndex].m_uiGnomeFaceGUID); + m_asBombFaces[uiIndex].m_bActivated = true; + m_asBombFaces[uiIndex].m_uiBombTimer = 3000; + } +} + +void instance_gnomeregan::DoDeactivateBombFace(uint8 uiIndex) +{ + if (uiIndex >= MAX_GNOME_FACES) + return; + + if (m_asBombFaces[uiIndex].m_bActivated) + { + DoUseDoorOrButton(m_asBombFaces[uiIndex].m_uiGnomeFaceGUID); + m_asBombFaces[uiIndex].m_bActivated = false; + m_asBombFaces[uiIndex].m_uiBombTimer = 0; + } +} + +InstanceData* GetInstanceData_instance_gnomeregan(Map* pMap) +{ + return new instance_gnomeregan(pMap); +} + +void AddSC_instance_gnomeregan() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_gnomeregan"; + pNewScript->GetInstanceData = &GetInstanceData_instance_gnomeregan; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/hinterlands.cpp b/scripts/eastern_kingdoms/hinterlands.cpp new file mode 100644 index 0000000..e9656bf --- /dev/null +++ b/scripts/eastern_kingdoms/hinterlands.cpp @@ -0,0 +1,341 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Hinterlands +SD%Complete: 100 +SDComment: Quest support: 836, 2742 +SDCategory: The Hinterlands +EndScriptData */ + +/* ContentData +npc_00x09hl +npc_rinji +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + + /*###### +## npc_00x09hl +######*/ + +enum +{ + SAY_OOX_START = -1000287, + SAY_OOX_AGGRO1 = -1000288, + SAY_OOX_AGGRO2 = -1000289, + SAY_OOX_AMBUSH = -1000290, + SAY_OOX_END = -1000292, + + QUEST_RESQUE_OOX_09 = 836, + + NPC_MARAUDING_OWL = 7808, + NPC_VILE_AMBUSHER = 7809 +}; + +struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI +{ + npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 26: + DoScriptText(SAY_OOX_AMBUSH, m_creature); + break; + case 43: + DoScriptText(SAY_OOX_AMBUSH, m_creature); + break; + case 64: + DoScriptText(SAY_OOX_END, m_creature); + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 27: + for(uint8 i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(147.927444f, -3851.513428f, 130.893f, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + case 44: + for(uint8 i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(-141.151581f, -4291.213867f, 120.130f, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER) + return; + + DoScriptText(urand(0, 1) ? SAY_OOX_AGGRO1 : SAY_OOX_AGGRO2, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } +}; + +bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + pCreature->setFaction((pPlayer->GetTeam() == ALLIANCE) ? FACTION_ESCORT_A_PASSIVE : FACTION_ESCORT_H_PASSIVE); + + DoScriptText(SAY_OOX_START, pCreature, pPlayer); + + if (npc_00x09hlAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_00x09hl(Creature* pCreature) +{ + return new npc_00x09hlAI(pCreature); +} + +/*###### +## npc_rinji +######*/ + +enum +{ + SAY_RIN_FREE = -1000403, + SAY_RIN_BY_OUTRUNNER = -1000404, + SAY_RIN_HELP_1 = -1000405, + SAY_RIN_HELP_2 = -1000406, + SAY_RIN_COMPLETE = -1000407, + SAY_RIN_PROGRESS_1 = -1000408, + SAY_RIN_PROGRESS_2 = -1000409, + + QUEST_RINJI_TRAPPED = 2742, + NPC_RANGER = 2694, + NPC_OUTRUNNER = 2691, + GO_RINJI_CAGE = 142036 +}; + +struct Location +{ + float m_fX, m_fY, m_fZ; +}; + +Location m_afAmbushSpawn[] = +{ + {191.29620f, -2839.329346f, 107.388f}, + {70.972466f, -2848.674805f, 109.459f} +}; + +Location m_afAmbushMoveTo[] = +{ + {166.63038f, -2824.780273f, 108.153f}, + {70.886589f, -2874.335449f, 116.675f} +}; + +struct MANGOS_DLL_DECL npc_rinjiAI : public npc_escortAI +{ + npc_rinjiAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bIsByOutrunner = false; + m_iSpawnId = 0; + Reset(); + } + + bool m_bIsByOutrunner; + uint32 m_uiPostEventCount; + uint32 m_uiPostEventTimer; + int m_iSpawnId; + + void Reset() + { + m_uiPostEventCount = 0; + m_uiPostEventTimer = 3000; + } + + void JustRespawned() + { + m_bIsByOutrunner = false; + m_iSpawnId = 0; + + npc_escortAI::JustRespawned(); + } + + void Aggro(Unit* pWho) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (pWho->GetEntry() == NPC_OUTRUNNER && !m_bIsByOutrunner) + { + DoScriptText(SAY_RIN_BY_OUTRUNNER, pWho); + m_bIsByOutrunner = true; + } + + if (urand(0, 3)) + return; + + //only if attacked and escorter is not in combat? + DoScriptText(urand(0, 1) ? SAY_RIN_HELP_1 : SAY_RIN_HELP_2, m_creature); + } + } + + void DoSpawnAmbush(bool bFirst) + { + if (!bFirst) + m_iSpawnId = 1; + + m_creature->SummonCreature(NPC_RANGER, + m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + + for(int i = 0; i < 2; ++i) + { + m_creature->SummonCreature(NPC_OUTRUNNER, + m_afAmbushSpawn[m_iSpawnId].m_fX, m_afAmbushSpawn[m_iSpawnId].m_fY, m_afAmbushSpawn[m_iSpawnId].m_fZ, 0.0f, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->GetMotionMaster()->MovePoint(0, m_afAmbushMoveTo[m_iSpawnId].m_fX, m_afAmbushMoveTo[m_iSpawnId].m_fY, m_afAmbushMoveTo[m_iSpawnId].m_fZ); + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 1: + DoScriptText(SAY_RIN_FREE, m_creature, pPlayer); + break; + case 7: + DoSpawnAmbush(true); + break; + case 13: + DoSpawnAmbush(false); + break; + case 17: + DoScriptText(SAY_RIN_COMPLETE, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_RINJI_TRAPPED, m_creature); + SetRun(); + m_uiPostEventCount = 1; + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + //Check if we have a current target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasEscortState(STATE_ESCORT_ESCORTING) && m_uiPostEventCount) + { + if (m_uiPostEventTimer < uiDiff) + { + m_uiPostEventTimer = 3000; + + if (Player* pPlayer = GetPlayerForEscort()) + { + switch(m_uiPostEventCount) + { + case 1: + DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); + ++m_uiPostEventCount; + break; + case 2: + DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); + m_uiPostEventCount = 0; + break; + } + } + else + { + m_creature->ForcedDespawn(); + return; + } + } + else + m_uiPostEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_rinji(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RINJI_TRAPPED) + { + if (GameObject* pGo = GetClosestGameObjectWithEntry(pCreature, GO_RINJI_CAGE, INTERACTION_DISTANCE)) + pGo->UseDoorOrButton(); + + if (npc_rinjiAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_rinji(Creature* pCreature) +{ + return new npc_rinjiAI(pCreature); +} + +void AddSC_hinterlands() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_00x09hl"; + pNewScript->GetAI = &GetAI_npc_00x09hl; + pNewScript->pQuestAccept = &QuestAccept_npc_00x09hl; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_rinji"; + pNewScript->GetAI = &GetAI_npc_rinji; + pNewScript->pQuestAccept = &QuestAccept_npc_rinji; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/ironforge.cpp b/scripts/eastern_kingdoms/ironforge.cpp new file mode 100644 index 0000000..91f7fa4 --- /dev/null +++ b/scripts/eastern_kingdoms/ironforge.cpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ironforge +SD%Complete: 100 +SDComment: Quest support: 3702 +SDCategory: Ironforge +EndScriptData */ + +/* ContentData +npc_royal_historian_archesonus +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_royal_historian_archesonus +######*/ + +#define GOSSIP_ITEM_ROYAL "I am ready to listen" +#define GOSSIP_ITEM_ROYAL_1 "That is tragic. How did this happen?" +#define GOSSIP_ITEM_ROYAL_2 "Interesting, continue please." +#define GOSSIP_ITEM_ROYAL_3 "Unbelievable! How dare they??" +#define GOSSIP_ITEM_ROYAL_4 "Of course I will help!" + +bool GossipHello_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(3702) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(2235, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_royal_historian_archesonus(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2236, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2237, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2238, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ROYAL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(2239, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3702); + break; + } + return true; +} + +void AddSC_ironforge() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_royal_historian_archesonus"; + newscript->pGossipHello = &GossipHello_npc_royal_historian_archesonus; + newscript->pGossipSelect = &GossipSelect_npc_royal_historian_archesonus; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/isle_of_queldanas.cpp b/scripts/eastern_kingdoms/isle_of_queldanas.cpp new file mode 100644 index 0000000..bb24930 --- /dev/null +++ b/scripts/eastern_kingdoms/isle_of_queldanas.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Isle_of_Queldanas +SD%Complete: 100 +SDComment: Quest support: 11524, 11525, 11533, 11543 +SDCategory: Isle Of Quel'Danas +EndScriptData */ + +/* ContentData +npc_ayren_cloudbreaker +npc_converted_sentry +npc_unrestrained_dragonhawk +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_converted_sentry +######*/ + +#define SAY_CONVERTED_1 -1000188 +#define SAY_CONVERTED_2 -1000189 + +#define SPELL_CONVERT_CREDIT 45009 + +struct MANGOS_DLL_DECL npc_converted_sentryAI : public ScriptedAI +{ + npc_converted_sentryAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool Credit; + uint32 Timer; + + void Reset() + { + Credit = false; + Timer = 2500; + } + + void MoveInLineOfSight(Unit *who) + { + return; + } + + void UpdateAI(const uint32 diff) + { + if (!Credit) + { + if (Timer <= diff) + { + uint32 i = urand(1,2); + if (i==1) + DoScriptText(SAY_CONVERTED_1, m_creature); + else + DoScriptText(SAY_CONVERTED_2, m_creature); + + DoCastSpellIfCan(m_creature,SPELL_CONVERT_CREDIT); + ((Pet*)m_creature)->SetDuration(7500); + Credit = true; + }else Timer -= diff; + } + } +}; +CreatureAI* GetAI_npc_converted_sentry(Creature* pCreature) +{ + return new npc_converted_sentryAI(pCreature); +} + +void AddSC_isle_of_queldanas() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_converted_sentry"; + newscript->GetAI = &GetAI_npc_converted_sentry; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_curator.cpp b/scripts/eastern_kingdoms/karazhan/boss_curator.cpp new file mode 100644 index 0000000..2ff7e5a --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_curator.cpp @@ -0,0 +1,211 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Curator +SD%Complete: 80% +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1532057, + SAY_SUMMON1 = -1532058, + SAY_SUMMON2 = -1532059, + SAY_EVOCATE = -1532060, + SAY_ENRAGE = -1532061, + SAY_KILL1 = -1532062, + SAY_KILL2 = -1532063, + SAY_DEATH = -1532064, + + // Flare + NPC_ASTRAL_FLARE = 17096, + SPELL_ASTRAL_FLARE_PASSIVE = 30234, + + // The Curator + SPELL_HATEFUL_BOLT = 30383, + SPELL_EVOCATION = 30254, + SPELL_ENRAGE = 30403, + SPELL_BERSERK = 26662 +}; + +struct MANGOS_DLL_DECL boss_curatorAI : public ScriptedAI +{ + boss_curatorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiFlareTimer; + uint32 m_uiHatefulBoltTimer; + uint32 m_uiBerserkTimer; + + bool m_bIsBerserk; + bool m_bIsEnraged; + + void Reset() + { + m_uiFlareTimer = 10000; + m_uiHatefulBoltTimer = 15000; // This time may be wrong + m_uiBerserkTimer = 12*MINUTE*IN_MILLISECONDS; + m_bIsBerserk = false; + m_bIsEnraged = false; + + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_ASTRAL_FLARE) + { + // Flare start with agro on it's target, should be immune to arcane + pSummoned->CastSpell(pSummoned, SPELL_ASTRAL_FLARE_PASSIVE, false); + pSummoned->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true); + + if (m_creature->getVictim()) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + pSummoned->AddThreat(pTarget ? pTarget : m_creature->getVictim(), 1000.0f); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // always decrease BerserkTimer + if (!m_bIsBerserk) + { + if (m_uiBerserkTimer < uiDiff) + { + // break evocation if we are under it's effect + if (m_creature->HasAura(SPELL_EVOCATION)) + m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION); + + if (DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + { + // ScriptText needs confirmation + DoScriptText(SAY_ENRAGE, m_creature); + + // don't know if he's supposed to do summon/evocate after hard enrage (probably not) + m_bIsBerserk = true; + } + } + else + m_uiBerserkTimer -= uiDiff; + } + + // not supposed to do anything while evocate + if (m_creature->HasAura(SPELL_EVOCATION)) + return; + + if (!m_bIsEnraged && !m_bIsBerserk) + { + if (m_uiFlareTimer < uiDiff) + { + m_uiFlareTimer = 10000; + + // summon Astral Flare + DoSpawnCreature(NPC_ASTRAL_FLARE, rand()%37, rand()%37, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + + // reduce mana by 10% of maximum + if (int32 iMana = m_creature->GetMaxPower(POWER_MANA)) + { + m_creature->ModifyPower(POWER_MANA, -(iMana/10)); + + //if this get's us below 10%, then we evocate (the 10th should be summoned now + if (m_creature->GetPower(POWER_MANA)*10 < m_creature->GetMaxPower(POWER_MANA)) + { + DoScriptText(SAY_EVOCATE, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->CastSpell(m_creature, SPELL_EVOCATION, false); + + //this small delay should make first flare appear fast after evocate, and also prevent possible spawn flood + m_uiFlareTimer = 1000; + return; + } + else + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + } + } + } + else + m_uiFlareTimer -= uiDiff; + + if (m_creature->GetHealthPercent() < 15.0f) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_bIsEnraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + } + } + } + + if (m_uiHatefulBoltTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1)) + m_creature->CastSpell(pTarget, SPELL_HATEFUL_BOLT, false); + + m_uiHatefulBoltTimer = m_bIsEnraged ? 7000 : 15000; + } + else + m_uiHatefulBoltTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_curator(Creature* pCreature) +{ + return new boss_curatorAI(pCreature); +} + +void AddSC_boss_curator() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_curator"; + newscript->GetAI = &GetAI_boss_curator; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp b/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp new file mode 100644 index 0000000..3ab3921 --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp @@ -0,0 +1,159 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Maiden_of_Virtue +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1532018, + SAY_SLAY1 = -1532019, + SAY_SLAY2 = -1532020, + SAY_SLAY3 = -1532021, + SAY_REPENTANCE1 = -1532022, + SAY_REPENTANCE2 = -1532023, + SAY_DEATH = -1532024, + + SPELL_REPENTANCE = 29511, + SPELL_HOLYFIRE = 29522, + SPELL_HOLYWRATH = 32445, + SPELL_HOLYGROUND = 29512 +}; + +struct MANGOS_DLL_DECL boss_maiden_of_virtueAI : public ScriptedAI +{ + boss_maiden_of_virtueAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiRepentance_Timer; + uint32 m_uiHolyfire_Timer; + uint32 m_uiHolywrath_Timer; + uint32 m_uiHolyground_Timer; + + void Reset() + { + m_uiRepentance_Timer = urand(25000, 40000); + m_uiHolyfire_Timer = urand(8000, 25000); + m_uiHolywrath_Timer = urand(15000, 25000); + m_uiHolyground_Timer = 3000; + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 5)) // 50% chance to say something out of 3 texts + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void Aggro(Unit *pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiHolyground_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_HOLYGROUND, CAST_TRIGGERED); //Triggered so it doesn't interrupt her at all + m_uiHolyground_Timer = 3000; + } + else + m_uiHolyground_Timer -= uiDiff; + + if (m_uiRepentance_Timer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_REPENTANCE) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_REPENTANCE1 : SAY_REPENTANCE2, m_creature); + + //A little randomness on that spell + m_uiRepentance_Timer = urand(25000, 35000); + } + } + else + m_uiRepentance_Timer -= uiDiff; + + if (m_uiHolyfire_Timer < uiDiff) + { + //Time for an omgwtfpwn code to make maiden cast holy fire only on units outside the holy ground's 18 yard range + Unit* pTarget = NULL; + std::vector target_list; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + pTarget = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pTarget && !pTarget->IsWithinDist(m_creature, 12.0f, false)) + target_list.push_back(pTarget); + + pTarget = NULL; + } + + if (target_list.size()) + { + if (pTarget = *(target_list.begin()+rand()%target_list.size())) + DoCastSpellIfCan(pTarget,SPELL_HOLYFIRE); + } + + m_uiHolyfire_Timer = urand(8000, 23000); //Anywhere from 8 to 23 seconds, good luck having several of those in a row! + } + else + m_uiHolyfire_Timer -= uiDiff; + + if (m_uiHolywrath_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_HOLYWRATH); + + m_uiHolywrath_Timer = urand(20000, 25000); //20-25 secs sounds nice + } + else + m_uiHolywrath_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_maiden_of_virtue(Creature* pCreature) +{ + return new boss_maiden_of_virtueAI(pCreature); +} + +void AddSC_boss_maiden_of_virtue() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_maiden_of_virtue"; + newscript->GetAI = &GetAI_boss_maiden_of_virtue; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp b/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp new file mode 100644 index 0000000..def618a --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp @@ -0,0 +1,351 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Midnight +SD%Complete: 90 +SDComment: Use SPELL_SUMMON_ATTUMEN and SPELL_SUMMON_ATTUMEN_MOUNTED instead of SummonCreature. +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_MIDNIGHT_KILL = -1532000, + SAY_APPEAR1 = -1532001, + SAY_APPEAR2 = -1532002, + SAY_APPEAR3 = -1532003, + SAY_MOUNT = -1532004, + SAY_KILL1 = -1532005, + SAY_KILL2 = -1532006, + SAY_DISARMED = -1532007, + SAY_DEATH = -1532008, + SAY_RANDOM1 = -1532009, + SAY_RANDOM2 = -1532010, + + SPELL_SHADOWCLEAVE = 29832, + SPELL_INTANGIBLE_PRESENCE = 29833, + SPELL_BERSERKER_CHARGE = 26561, //Only when mounted + SPELL_SUMMON_ATTUMEN = 29714, + SPELL_SUMMON_ATTUMEN_MOUNTED= 29799, + + MOUNTED_DISPLAYID = 16040, // should use creature 16152 instead of changing displayid + + //Attumen (TODO: Use the summoning spell instead of creature id. It works , but is not convenient for us) + SUMMON_ATTUMEN = 15550 +}; + +struct MANGOS_DLL_DECL boss_midnightAI : public ScriptedAI +{ + boss_midnightAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 m_uiAttumenGUID; + uint8 m_uiPhase; + uint32 m_uiMount_Timer; + + void Reset() + { + m_uiPhase = 1; + m_uiAttumenGUID = 0; + m_uiMount_Timer = 0; + + m_creature->SetVisibility(VISIBILITY_ON); + } + + void KilledUnit(Unit* pVictim) + { + if (m_uiPhase == 2) + { + if (Creature* pAttumen = m_creature->GetMap()->GetCreature(m_uiAttumenGUID)) + DoScriptText(SAY_MIDNIGHT_KILL, pAttumen); + } + } + + void Mount(Creature* pAttumen) + { + DoScriptText(SAY_MOUNT, pAttumen); + m_uiPhase = 3; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + float fAngle = m_creature->GetAngle(pAttumen); + float fDistance = m_creature->GetDistance2d(pAttumen); + + float fNewX = m_creature->GetPositionX() + cos(fAngle)*(fDistance/2) ; + float fNewY = m_creature->GetPositionY() + sin(fAngle)*(fDistance/2) ; + float fNewZ = 50.0f; + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, fNewX, fNewY, fNewZ); + + fDistance += 10.0f; + fNewX = m_creature->GetPositionX() + cos(fAngle)*(fDistance/2); + fNewY = m_creature->GetPositionY() + sin(fAngle)*(fDistance/2); + + pAttumen->GetMotionMaster()->Clear(); + pAttumen->GetMotionMaster()->MovePoint(0, fNewX, fNewY, fNewZ); + + m_uiMount_Timer = 1000; + } + + void SetMidnight(Creature *, uint64); //Below .. + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + switch(m_uiPhase) + { + case 1: + if (m_creature->GetHealthPercent() < 95.0f) + { + m_uiPhase = 2; + + if (Creature* pAttumen = m_creature->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000)) + { + m_uiAttumenGUID = pAttumen->GetGUID(); + pAttumen->AI()->AttackStart(m_creature->getVictim()); + SetMidnight(pAttumen, m_creature->GetGUID()); + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_APPEAR1, pAttumen); break; + case 1: DoScriptText(SAY_APPEAR2, pAttumen); break; + case 2: DoScriptText(SAY_APPEAR3, pAttumen); break; + } + } + } + break; + case 2: + if (m_creature->GetHealthPercent() < 25.0f) + { + if (Creature* pAttumen = m_creature->GetMap()->GetCreature(m_uiAttumenGUID)) + Mount(pAttumen); + } + break; + case 3: + if (m_uiMount_Timer) + { + if (m_uiMount_Timer <= uiDiff) + { + m_uiMount_Timer = 0; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->GetMotionMaster()->MoveIdle(); + + if (Creature *pAttumen = m_creature->GetMap()->GetCreature(m_uiAttumenGUID)) + { + pAttumen->SetDisplayId(MOUNTED_DISPLAYID); + pAttumen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (pAttumen->getVictim()) + { + pAttumen->GetMotionMaster()->MoveChase(pAttumen->getVictim()); + pAttumen->SetUInt64Value(UNIT_FIELD_TARGET, pAttumen->getVictim()->GetGUID()); + } + pAttumen->SetFloatValue(OBJECT_FIELD_SCALE_X,1); + } + } + else + m_uiMount_Timer -= uiDiff; + } + break; + } + + if (m_uiPhase != 3) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_midnight(Creature* pCreature) +{ + return new boss_midnightAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_attumenAI : public ScriptedAI +{ + boss_attumenAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + m_uiPhase = 1; + + m_uiCleaveTimer = urand(10000, 16000); + m_uiCurseTimer = 30000; + m_uiRandomYellTimer = urand(30000, 60000); //Occasionally yell + m_uiChargeTimer = 20000; + m_uiResetTimer = 0; + } + + uint64 m_uiMidnightGUID; + uint8 m_uiPhase; + uint32 m_uiCleaveTimer; + uint32 m_uiCurseTimer; + uint32 m_uiRandomYellTimer; + uint32 m_uiChargeTimer; //only when mounted + uint32 m_uiResetTimer; + + void Reset() + { + m_uiResetTimer = 2000; + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void SpellHit(Unit* pSource, const SpellEntry* pSpell) + { + if (pSpell->Mechanic == MECHANIC_DISARM) + DoScriptText(SAY_DISARMED, m_creature); + } + + void JustDied(Unit* pVictim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (Creature* pMidnight = m_creature->GetMap()->GetCreature(m_uiMidnightGUID)) + pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiResetTimer) + { + if (m_uiResetTimer <= uiDiff) + { + m_uiResetTimer = 0; + + if (Creature *pMidnight = m_creature->GetMap()->GetCreature(m_uiMidnightGUID)) + { + pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pMidnight->SetVisibility(VISIBILITY_ON); + } + m_uiMidnightGUID = 0; + + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else + m_uiResetTimer -= uiDiff; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) + return; + + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWCLEAVE); + m_uiCleaveTimer = urand(10000, 16000); + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiCurseTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE); + m_uiCurseTimer = 30000; + } + else + m_uiCurseTimer -= uiDiff; + + if (m_uiRandomYellTimer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_RANDOM1 : SAY_RANDOM2, m_creature); + m_uiRandomYellTimer = urand(30000, 60000); + } + else + m_uiRandomYellTimer -= uiDiff; + + if (m_creature->GetDisplayId() == MOUNTED_DISPLAYID) + { + if (m_uiChargeTimer < uiDiff) + { + Unit *target = NULL; + std::vector target_list; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (target && !target->IsWithinDist(m_creature, ATTACK_DISTANCE, false)) + target_list.push_back(target); + + target = NULL; + } + + if (target_list.size()) + { + if (target = *(target_list.begin()+rand()%target_list.size())) + DoCastSpellIfCan(target, SPELL_BERSERKER_CHARGE); + } + + m_uiChargeTimer = 20000; + } + else + m_uiChargeTimer -= uiDiff; + } + else + { + if (m_creature->GetHealthPercent() < 25.0f) + { + if (Creature *pMidnight = m_creature->GetMap()->GetCreature(m_uiMidnightGUID)) + { + if (boss_midnightAI* pMidnightAI = dynamic_cast(pMidnight->AI())) + pMidnightAI->Mount(m_creature); + + m_creature->SetHealth(pMidnight->GetHealth()); + DoResetThreat(); + } + } + } + + DoMeleeAttackIfReady(); + } +}; + +void boss_midnightAI::SetMidnight(Creature* pAttumen, uint64 uiValue) +{ + if (boss_attumenAI* pAttumenAI = dynamic_cast(pAttumen->AI())) + pAttumenAI->m_uiMidnightGUID = uiValue; +} + +CreatureAI* GetAI_boss_attumen(Creature* pCreature) +{ + return new boss_attumenAI(pCreature); +} + +void AddSC_boss_attumen() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_attumen"; + newscript->GetAI = &GetAI_boss_attumen; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_midnight"; + newscript->GetAI = &GetAI_boss_midnight; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp b/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp new file mode 100644 index 0000000..83653f0 --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp @@ -0,0 +1,843 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Moroes +SD%Complete: 95 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" +#include "karazhan.h" + +enum +{ + SAY_AGGRO = -1532011, + SAY_SPECIAL_1 = -1532012, + SAY_SPECIAL_2 = -1532013, + SAY_KILL_1 = -1532014, + SAY_KILL_2 = -1532015, + SAY_KILL_3 = -1532016, + SAY_DEATH = -1532017, + + SPELL_VANISH = 29448, + SPELL_GARROTE = 37066, + SPELL_BLIND = 34694, + SPELL_GOUGE = 29425, + SPELL_FRENZY = 37023 +}; + +const float afLocations[4][4]= +{ + {-10991.0f, -1884.33f, 81.73f, 0.614315f}, + {-10989.4f, -1885.88f, 81.73f, 0.904913f}, + {-10978.1f, -1887.07f, 81.73f, 2.035550f}, + {-10975.9f, -1885.81f, 81.73f, 2.253890f} +}; + +const uint32 auiAdds[6]= +{ + 17007, + 19872, + 19873, + 19874, + 19875, + 19876 +}; + +struct MANGOS_DLL_DECL boss_moroesAI : public ScriptedAI +{ + boss_moroesAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bFirstTime = true; + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 m_auiAddGUID[4]; + uint32 m_auiAddId[4]; + + uint32 m_uiVanish_Timer; + uint32 m_uiBlind_Timer; + uint32 m_uiGouge_Timer; + uint32 m_uiWait_Timer; + uint32 m_uiCheckAdds_Timer; + + bool m_bFirstTime; + bool m_bInVanish; + bool m_bEnrage; + + void Reset() + { + m_uiVanish_Timer = 30000; + m_uiBlind_Timer = 35000; + m_uiGouge_Timer = 23000; + m_uiWait_Timer = 0; + m_uiCheckAdds_Timer = 5000; + + m_bEnrage = false; + m_bInVanish = false; + + SpawnAdds(); + + m_creature->setFaction(16); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROES, NOT_STARTED); + } + + void StartEvent() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROES, IN_PROGRESS); + } + + void Aggro(Unit* pWho) + { + StartEvent(); + DoScriptText(SAY_AGGRO, m_creature); + AddsAttack(); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; + } + } + + void JustDied(Unit* pVictim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROES, DONE); + + //remove aura from spell Garrote when Moroes dies + Map* pMap = m_creature->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE, EFFECT_INDEX_0)) + i->getSource()->RemoveAurasDueToSpell(SPELL_GARROTE); + } + } + } + + void SpawnAdds() + { + if (m_bFirstTime) + { + std::vector vAddList; + + for(uint8 i = 0; i < 6; ++i) + vAddList.push_back(auiAdds[i]); + + while(vAddList.size() > 4) + vAddList.erase((vAddList.begin())+(rand()%vAddList.size())); + + uint8 i = 0; + for(std::vector::iterator itr = vAddList.begin(); itr != vAddList.end(); ++itr, ++i) + { + if (Creature* pCreature = m_creature->SummonCreature(*itr, afLocations[i][0], afLocations[i][1], afLocations[i][2], afLocations[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) + { + m_auiAddGUID[i] = pCreature->GetGUID(); + m_auiAddId[i] = *itr; + } + } + + m_bFirstTime = false; + } + else + { + for(uint8 i = 0; i < 4; ++i) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(m_auiAddGUID[i])) + { + if (!pCreature->isAlive()) // Exists but is dead + { + pCreature->Respawn(); + pCreature->AI()->EnterEvadeMode(); + } + else if (!pCreature->IsInEvadeMode()) // Exists and is alive + { + pCreature->AI()->EnterEvadeMode(); + } + } + else + { // Does not exist + if (Creature* pCreature = m_creature->SummonCreature(m_auiAddId[i], afLocations[i][0], afLocations[i][1], afLocations[i][2], afLocations[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000)) + m_auiAddGUID[i] = pCreature->GetGUID(); + } + } + } + } + + void AddsAttack() + { + for(uint8 i = 0; i < 4; ++i) + { + if (m_auiAddGUID[i]) + { + Creature* pTemp = m_creature->GetMap()->GetCreature(m_auiAddGUID[i]); + if (pTemp && pTemp->isAlive()) + pTemp->AI()->AttackStart(m_creature->getVictim()); + else + EnterEvadeMode(); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_pInstance && !m_pInstance->GetData(TYPE_MOROES)) + EnterEvadeMode(); + + if (!m_bEnrage && m_creature->GetHealthPercent() < 30.0f) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + m_bEnrage = true; + } + + if (m_uiCheckAdds_Timer < uiDiff) + { + for (uint8 i = 0; i < 4; ++i) + { + if (m_auiAddGUID[i]) + { + Creature* pTemp = m_creature->GetMap()->GetCreature(m_auiAddGUID[i]); + if (pTemp && pTemp->isAlive() && (!pTemp->SelectHostileTarget() || !pTemp->getVictim())) + pTemp->AI()->AttackStart(m_creature->getVictim()); + } + } + m_uiCheckAdds_Timer = 5000; + } + else + m_uiCheckAdds_Timer -= uiDiff; + + if (!m_bEnrage) + { + // Cast Vanish, then Garrote random victim + if (m_uiVanish_Timer < uiDiff) + { + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoCastSpellIfCan(m_creature, SPELL_VANISH); + m_bInVanish = true; + m_uiVanish_Timer = 30000; + m_uiWait_Timer = 5000; + } + else + m_uiVanish_Timer -= uiDiff; + + if (m_bInVanish) + { + if (m_uiWait_Timer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_SPECIAL_1 : SAY_SPECIAL_2, m_creature); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pTarget->CastSpell(pTarget, SPELL_GARROTE, true); + + m_creature->setFaction(16); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->AI()->AttackStart(m_creature->getVictim()); + m_bInVanish = false; + } + else + m_uiWait_Timer -= uiDiff; + } + + //Gouge highest aggro, and attack second highest + if (m_uiGouge_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GOUGE); + m_uiGouge_Timer = 40000; + } + else + m_uiGouge_Timer -= uiDiff; + + if (m_uiBlind_Timer < uiDiff) + { + Unit* pTarget = NULL; + + ThreatList const& vThreatList = m_creature->getThreatManager().getThreatList(); + if (vThreatList.empty()) + return; + + std::vector vTargetList; + + for (ThreatList::const_iterator itr = vThreatList.begin();itr != vThreatList.end(); ++itr) + { + pTarget = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pTarget && pTarget->IsWithinDist(m_creature, ATTACK_DISTANCE, false)) + vTargetList.push_back(pTarget); + } + + if (!vTargetList.empty()) + pTarget = *(vTargetList.begin()+rand()%vTargetList.size()); + + if (pTarget) + DoCastSpellIfCan(pTarget, SPELL_BLIND); + + m_uiBlind_Timer = 40000; + } + else + m_uiBlind_Timer -= uiDiff; + } + + if (!m_bInVanish) + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_moroes_guestAI : public ScriptedAI +{ + ScriptedInstance* m_pInstance; + + uint64 m_auiGuestGUID[4]; + + boss_moroes_guestAI(Creature* pCreature) : ScriptedAI(pCreature) + { + memset(&m_auiGuestGUID, 0, sizeof(m_auiGuestGUID)); + + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + AcquireGUID(); + Reset(); + } + + void Reset() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROES, NOT_STARTED); + } + + void AcquireGUID() + { + if (!m_pInstance) + return; + + m_auiGuestGUID[0] = m_pInstance->GetData64(DATA_MOROES); + + if (Creature* pMoroes = m_creature->GetMap()->GetCreature(m_auiGuestGUID[0])) + { + for(uint8 i = 0; i < 3; ++i) + { + uint64 uiGUID = 0; + + if (boss_moroesAI* pMoroesAI = dynamic_cast(pMoroes->AI())) + uiGUID = pMoroesAI->m_auiAddGUID[i]; + + if (uiGUID && uiGUID != m_creature->GetGUID()) + m_auiGuestGUID[i+1] = uiGUID; + } + } + } + + Unit* SelectTarget() + { + if (uint64 uiTempGUID = m_auiGuestGUID[rand()%4]) + { + Creature* pTemp = m_creature->GetMap()->GetCreature(uiTempGUID); + if (pTemp && pTemp->isAlive()) + return pTemp; + } + + return m_creature; + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_pInstance && !m_pInstance->GetData(TYPE_MOROES)) + EnterEvadeMode(); + + DoMeleeAttackIfReady(); + } +}; + +enum +{ + SPELL_MANABURN = 29405, + SPELL_MINDFLY = 29570, + SPELL_SWPAIN = 34441, + SPELL_SHADOWFORM = 29406 +}; + +struct MANGOS_DLL_DECL boss_baroness_dorothea_millstipeAI : public boss_moroes_guestAI +{ + //Shadow Priest + boss_baroness_dorothea_millstipeAI(Creature* pCreature) : boss_moroes_guestAI(pCreature) { Reset(); } + + uint32 m_uiManaBurn_Timer; + uint32 m_uiMindFlay_Timer; + uint32 m_uiShadowWordPain_Timer; + + void Reset() + { + m_uiManaBurn_Timer = 7000; + m_uiMindFlay_Timer = 1000; + m_uiShadowWordPain_Timer = 6000; + + DoCastSpellIfCan(m_creature, SPELL_SHADOWFORM, CAST_TRIGGERED); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_moroes_guestAI::UpdateAI(uiDiff); + + if (m_uiMindFlay_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MINDFLY); + m_uiMindFlay_Timer = 12000; //3sec channeled + } + else + m_uiMindFlay_Timer -= uiDiff; + + if (m_uiManaBurn_Timer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget && pTarget->getPowerType() == POWER_MANA) + DoCastSpellIfCan(pTarget, SPELL_MANABURN); + + m_uiManaBurn_Timer = 5000; //3 sec cast + } + else + m_uiManaBurn_Timer -= uiDiff; + + if (m_uiShadowWordPain_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(pTarget, SPELL_SWPAIN); + m_uiShadowWordPain_Timer = 7000; + } + } + else + m_uiShadowWordPain_Timer -= uiDiff; + } +}; + +enum +{ + SPELL_HAMMEROFJUSTICE = 13005, + SPELL_JUDGEMENTOFCOMMAND = 29386, + SPELL_SEALOFCOMMAND = 29385 +}; + +struct MANGOS_DLL_DECL boss_baron_rafe_dreugerAI : public boss_moroes_guestAI +{ + //Retr Pally + boss_baron_rafe_dreugerAI(Creature* pCreature) : boss_moroes_guestAI(pCreature) { Reset(); } + + uint32 m_uiHammerOfJustice_Timer; + uint32 m_uiSealOfCommand_Timer; + uint32 m_uiJudgementOfCommand_Timer; + + void Reset() + { + m_uiHammerOfJustice_Timer = 1000; + m_uiSealOfCommand_Timer = 7000; + m_uiJudgementOfCommand_Timer = m_uiSealOfCommand_Timer + 29000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_moroes_guestAI::UpdateAI(uiDiff); + + if (m_uiSealOfCommand_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SEALOFCOMMAND); + m_uiSealOfCommand_Timer = 32000; + m_uiJudgementOfCommand_Timer = 29000; + } + else + m_uiSealOfCommand_Timer -= uiDiff; + + if (m_uiJudgementOfCommand_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_JUDGEMENTOFCOMMAND); + m_uiJudgementOfCommand_Timer = m_uiSealOfCommand_Timer + 29000; + } + else + m_uiJudgementOfCommand_Timer -= uiDiff; + + if (m_uiHammerOfJustice_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAMMEROFJUSTICE); + m_uiHammerOfJustice_Timer = 12000; + } + else + m_uiHammerOfJustice_Timer -= uiDiff; + } +}; + +enum +{ + SPELL_DISPELMAGIC = 15090, // Self or other guest+Moroes + SPELL_GREATERHEAL = 29564, // Self or other guest+Moroes + SPELL_HOLYFIRE = 29563, + SPELL_PWSHIELD = 29408 +}; + +struct MANGOS_DLL_DECL boss_lady_catriona_von_indiAI : public boss_moroes_guestAI +{ + //Holy Priest + boss_lady_catriona_von_indiAI(Creature* pCreature) : boss_moroes_guestAI(pCreature) { Reset(); } + + uint32 m_uiDispelMagic_Timer; + uint32 m_uiGreaterHeal_Timer; + uint32 m_uiHolyFire_Timer; + uint32 m_uiPowerWordShield_Timer; + + void Reset() + { + m_uiDispelMagic_Timer = 11000; + m_uiGreaterHeal_Timer = 1500; + m_uiHolyFire_Timer = 5000; + m_uiPowerWordShield_Timer = 1000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_moroes_guestAI::UpdateAI(uiDiff); + + if (m_uiPowerWordShield_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_PWSHIELD); + m_uiPowerWordShield_Timer = 15000; + } + else + m_uiPowerWordShield_Timer -= uiDiff; + + if (m_uiGreaterHeal_Timer < uiDiff) + { + DoCastSpellIfCan(SelectTarget(), SPELL_GREATERHEAL); + m_uiGreaterHeal_Timer = 17000; + } + else + m_uiGreaterHeal_Timer -= uiDiff; + + if (m_uiHolyFire_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HOLYFIRE); + m_uiHolyFire_Timer = 22000; + } + else + m_uiHolyFire_Timer -= uiDiff; + + if (m_uiDispelMagic_Timer < uiDiff) + { + if (Unit* pTarget = urand(0, 1) ? SelectTarget() : m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_DISPELMAGIC); + + m_uiDispelMagic_Timer = 25000; + } + else + m_uiDispelMagic_Timer -= uiDiff; + } +}; + +enum +{ + SPELL_CLEANSE = 29380, //Self or other guest+Moroes + SPELL_GREATERBLESSOFMIGHT = 29381, //Self or other guest+Moroes + SPELL_HOLYLIGHT = 29562, //Self or other guest+Moroes + SPELL_DIVINESHIELD = 41367 +}; + +struct MANGOS_DLL_DECL boss_lady_keira_berrybuckAI : public boss_moroes_guestAI +{ + //Holy Pally + boss_lady_keira_berrybuckAI(Creature* pCreature) : boss_moroes_guestAI(pCreature) { Reset(); } + + uint32 m_uiCleanse_Timer; + uint32 m_uiGreaterBless_Timer; + uint32 m_uiHolyLight_Timer; + uint32 m_uiDivineShield_Timer; + + void Reset() + { + m_uiCleanse_Timer = 13000; + m_uiGreaterBless_Timer = 1000; + m_uiHolyLight_Timer = 7000; + m_uiDivineShield_Timer = 31000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_moroes_guestAI::UpdateAI(uiDiff); + + if (m_uiDivineShield_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_DIVINESHIELD); + m_uiDivineShield_Timer = 31000; + } + else + m_uiDivineShield_Timer -= uiDiff; + + if (m_uiHolyLight_Timer < uiDiff) + { + DoCast(SelectTarget(), SPELL_HOLYLIGHT); + m_uiHolyLight_Timer = 10000; + } + else + m_uiHolyLight_Timer -= uiDiff; + + if (m_uiGreaterBless_Timer < uiDiff) + { + DoCastSpellIfCan(SelectTarget(), SPELL_GREATERBLESSOFMIGHT); + m_uiGreaterBless_Timer = 50000; + } + else + m_uiGreaterBless_Timer -= uiDiff; + + if (m_uiCleanse_Timer < uiDiff) + { + DoCastSpellIfCan(SelectTarget(), SPELL_CLEANSE); + m_uiCleanse_Timer = 10000; + } + else + m_uiCleanse_Timer -= uiDiff; + } +}; + +enum +{ + SPELL_HAMSTRING = 9080, + SPELL_MORTALSTRIKE = 29572, + SPELL_WHIRLWIND = 29573 +}; + +struct MANGOS_DLL_DECL boss_lord_robin_darisAI : public boss_moroes_guestAI +{ + //Arms Warr + boss_lord_robin_darisAI(Creature* pCreature) : boss_moroes_guestAI(pCreature) { Reset(); } + + uint32 m_uiHamstring_Timer; + uint32 m_uiMortalStrike_Timer; + uint32 m_uiWhirlWind_Timer; + + void Reset() + { + m_uiHamstring_Timer = 7000; + m_uiMortalStrike_Timer = 10000; + m_uiWhirlWind_Timer = 21000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_moroes_guestAI::UpdateAI(uiDiff); + + if (m_uiHamstring_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAMSTRING); + m_uiHamstring_Timer = 12000; + } + else + m_uiHamstring_Timer -= uiDiff; + + if (m_uiMortalStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTALSTRIKE); + m_uiMortalStrike_Timer = 18000; + } + else + m_uiMortalStrike_Timer -= uiDiff; + + if (m_uiWhirlWind_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + m_uiWhirlWind_Timer = 21000; + } + else + m_uiWhirlWind_Timer -= uiDiff; + } +}; + +enum +{ + SPELL_DISARM = 8379, + SPELL_HEROICSTRIKE = 29567, + SPELL_SHIELDBASH = 11972, + SPELL_SHIELDWALL = 29390 +}; + +struct MANGOS_DLL_DECL boss_lord_crispin_ferenceAI : public boss_moroes_guestAI +{ + //Arms Warr + boss_lord_crispin_ferenceAI(Creature* pCreature) : boss_moroes_guestAI(pCreature) { Reset(); } + + uint32 m_uiDisarm_Timer; + uint32 m_uiHeroicStrike_Timer; + uint32 m_uiShieldBash_Timer; + uint32 m_uiShieldWall_Timer; + + void Reset() + { + m_uiDisarm_Timer = 6000; + m_uiHeroicStrike_Timer = 10000; + m_uiShieldBash_Timer = 8000; + m_uiShieldWall_Timer = 4000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_moroes_guestAI::UpdateAI(uiDiff); + + if (m_uiDisarm_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DISARM); + m_uiDisarm_Timer = 12000; + } + else + m_uiDisarm_Timer -= uiDiff; + + if (m_uiHeroicStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HEROICSTRIKE); + m_uiHeroicStrike_Timer = 10000; + }else m_uiHeroicStrike_Timer -= uiDiff; + + if (m_uiShieldBash_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHIELDBASH); + m_uiShieldBash_Timer = 13000; + } + else + m_uiShieldBash_Timer -= uiDiff; + + if (m_uiShieldWall_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHIELDWALL); + m_uiShieldWall_Timer = 21000; + } + else + m_uiShieldWall_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_moroes(Creature* pCreature) +{ + return new boss_moroesAI(pCreature); +} + +CreatureAI* GetAI_baroness_dorothea_millstipe(Creature* pCreature) +{ + return new boss_baroness_dorothea_millstipeAI(pCreature); +} + +CreatureAI* GetAI_baron_rafe_dreuger(Creature* pCreature) +{ + return new boss_baron_rafe_dreugerAI(pCreature); +} + +CreatureAI* GetAI_lady_catriona_von_indi(Creature* pCreature) +{ + return new boss_lady_catriona_von_indiAI(pCreature); +} + +CreatureAI* GetAI_lady_keira_berrybuck(Creature* pCreature) +{ + return new boss_lady_keira_berrybuckAI(pCreature); +} + +CreatureAI* GetAI_lord_robin_daris(Creature* pCreature) +{ + return new boss_lord_robin_darisAI(pCreature); +} + +CreatureAI* GetAI_lord_crispin_ference(Creature* pCreature) +{ + return new boss_lord_crispin_ferenceAI(pCreature); +} + +void AddSC_boss_moroes() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_moroes"; + newscript->GetAI = &GetAI_boss_moroes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_baroness_dorothea_millstipe"; + newscript->GetAI = &GetAI_baroness_dorothea_millstipe; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_baron_rafe_dreuger"; + newscript->GetAI = &GetAI_baron_rafe_dreuger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lady_catriona_von_indi"; + newscript->GetAI = &GetAI_lady_catriona_von_indi; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lady_keira_berrybuck"; + newscript->GetAI = &GetAI_lady_keira_berrybuck; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_robin_daris"; + newscript->GetAI = &GetAI_lord_robin_daris; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_crispin_ference"; + newscript->GetAI = &GetAI_lord_crispin_ference; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp b/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp new file mode 100644 index 0000000..8b8f392 --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp @@ -0,0 +1,228 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Netherspite +SD%Complete: 30% +SDComment: find spell ID for tail swipe added in patch 3.0.2 +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" +#include "karazhan.h" + +enum +{ + //netherspite spells + SPELL_NETHERBURN = 30522, + SPELL_VOID_ZONE = 37063, + SPELL_NETHERBREATH = 38523, + SPELL_EMPOWERMENT = 38549, + SPELL_NETHER_INFUSION = 38688, + SPELL_NETHERSPITE_ROAR = 38684, + SPELL_BANISH_VISUAL = 39833, + SPELL_ROOT = 42716, + + //void zone spells + SPELL_CONSUMPTION = 30497, + + //beam buffs + SPELL_PERSEVERENCE_NS = 30466, + SPELL_PERSEVERENCE_PLR = 30421, + SPELL_SERENITY_NS = 30467, + SPELL_SERENITY_PLR = 30422, + SPELL_DOMINANCE_NS = 30468, + SPELL_DOMINANCE_PLR = 30423, + + //beam debuffs + SPELL_EXHAUSTION_DOM = 38639, + SPELL_EXHAUSTION_SER = 38638, + SPELL_EXHAUSTION_PER = 38637, + + //beam spells + SPELL_BEAM_DOM = 30402, + SPELL_BEAM_SER = 30401, + SPELL_BEAM_PER = 30400, + SPELL_BLUE_PORTAL = 30491, + SPELL_GREEN_PORTAL = 30490, + SPELL_RED_PORTAL = 30487, + + //emotes + EMOTE_PHASE_BEAM = -1532089, + EMOTE_PHASE_BANISH = -1532090, + + //npcs + NPC_PORTAL_CREATURE = 17369, + NPC_VOID_ZONE = 16697 +}; + +struct SpawnLocation +{ + float x, y, z; +}; + +// at first spawn portals got fixed coords, should be shuffled in subsequent beam phases +static SpawnLocation PortalCoordinates[] = +{ + {-11105.508789f, -1600.851685f, 279.950256f}, + {-11195.353516f, -1613.237183f, 278.237258f}, + {-11137.846680f, -1685.607422f, 278.239258f} +}; + +enum Phases +{ + BEAM_PHASE = 0, + BANISH_PHASE = 1, +}; + +struct MANGOS_DLL_DECL boss_netherspiteAI : public ScriptedAI +{ + boss_netherspiteAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsEnraged; + uint8 m_uiActivePhase; + + uint32 m_uiEnrageTimer; + uint32 m_uiVoidZoneTimer; + uint32 m_uiPhaseSwitchTimer; + uint32 m_uiNetherbreathTimer; + + + void Reset() + { + m_bIsEnraged = false; + m_uiActivePhase = BEAM_PHASE; + + m_uiEnrageTimer = MINUTE*9*IN_MILLISECONDS; + m_uiVoidZoneTimer = 15000; + m_uiPhaseSwitchTimer = MINUTE*IN_MILLISECONDS; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NETHERSPITE, IN_PROGRESS); + + DoCastSpellIfCan(m_creature, SPELL_NETHERBURN); + m_creature->SetInCombatWithZone(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NETHERSPITE, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NETHERSPITE, NOT_STARTED); + } + + void SwitchPhases() + { + if (m_uiActivePhase == BEAM_PHASE) + { + m_uiActivePhase = BANISH_PHASE; + DoScriptText(EMOTE_PHASE_BANISH, m_creature); + + m_uiNetherbreathTimer = 500; + m_uiPhaseSwitchTimer = (MINUTE/2)*IN_MILLISECONDS; + } + else + { + m_uiActivePhase = BEAM_PHASE; + DoScriptText(EMOTE_PHASE_BEAM, m_creature); + DoCastSpellIfCan(m_creature, SPELL_NETHERSPITE_ROAR); + + m_uiPhaseSwitchTimer = MINUTE*IN_MILLISECONDS; + } + + //reset threat every phase switch + DoResetThreat(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiPhaseSwitchTimer <= uiDiff) + SwitchPhases(); + else + m_uiPhaseSwitchTimer -= uiDiff; + + if (!m_bIsEnraged) + { + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_NETHER_INFUSION, CAST_FORCE_CAST); + m_bIsEnraged = true; + } + else + m_uiEnrageTimer -= uiDiff; + } + + if (m_uiActivePhase == BEAM_PHASE) + { + if (m_uiVoidZoneTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_VOID_ZONE, true); + + m_uiVoidZoneTimer = 15000; + } + else + m_uiVoidZoneTimer -= uiDiff; + + } + else + { + if (m_uiNetherbreathTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_NETHERBREATH); + + m_uiNetherbreathTimer = urand(4000, 5000); + } + else + m_uiNetherbreathTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_netherspite(Creature* pCreature) +{ + return new boss_netherspiteAI(pCreature); +} + +void AddSC_boss_netherspite() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_netherspite"; + newscript->GetAI = &GetAI_boss_netherspite; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp b/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp new file mode 100644 index 0000000..9087abb --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp @@ -0,0 +1,36 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nightbane +SD%Complete: 0 +SDComment: Place holder +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_BELLOWING_ROAR = 39427, + SPELL_CHARRED_EARTH = 30129, //Also 30209 (Target Charred Earth) triggers this + SPELL_DISTRACTING_ASH = 30130, + SPELL_SMOLDERING_BREATH = 30210, + SPELL_TAIL_SWEEP = 25653, + SPELL_RAIN_OF_BONES = 37098, + SPELL_SMOKING_BLAST = 37057, + SPELL_FIREBALL_BARRAGE = 30282 +}; diff --git a/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp b/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp new file mode 100644 index 0000000..b6d8ade --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp @@ -0,0 +1,644 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Prince_Malchezzar +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1532091 +#define SAY_AXE_TOSS1 -1532092 +#define SAY_AXE_TOSS2 -1532093 +#define SAY_SPECIAL1 -1532094 +#define SAY_SPECIAL2 -1532095 +#define SAY_SPECIAL3 -1532096 +#define SAY_SLAY1 -1532097 +#define SAY_SLAY2 -1532098 +#define SAY_SLAY3 -1532099 +#define SAY_SUMMON1 -1532100 +#define SAY_SUMMON2 -1532101 +#define SAY_DEATH -1532102 + +// 18 Coordinates for Infernal spawns +struct InfernalPoint +{ + float x,y; +}; + +#define INFERNAL_Z 275.5 + +static InfernalPoint InfernalPoints[] = +{ + {-10922.8f, -1985.2f}, + {-10916.2f, -1996.2f}, + {-10932.2f, -2008.1f}, + {-10948.8f, -2022.1f}, + {-10958.7f, -1997.7f}, + {-10971.5f, -1997.5f}, + {-10990.8f, -1995.1f}, + {-10989.8f, -1976.5f}, + {-10971.6f, -1973.0f}, + {-10955.5f, -1974.0f}, + {-10939.6f, -1969.8f}, + {-10958.0f, -1952.2f}, + {-10941.7f, -1954.8f}, + {-10943.1f, -1988.5f}, + {-10948.8f, -2005.1f}, + {-10984.0f, -2019.3f}, + {-10932.8f, -1979.6f}, + {-10935.7f, -1996.0f} +}; + +#define TOTAL_INFERNAL_POINTS 18 + +//Enfeeble is supposed to reduce hp to 1 and then heal player back to full when it ends +//Along with reducing healing and regen while enfeebled to 0% +//This spell effect will only reduce healing + +#define SPELL_ENFEEBLE 30843 //Enfeeble during phase 1 and 2 +#define SPELL_ENFEEBLE_EFFECT 41624 + +#define SPELL_SHADOWNOVA 30852 //Shadownova used during all phases +#define SPELL_SW_PAIN 30854 //Shadow word pain during phase 1 and 3 (different targeting rules though) +#define SPELL_THRASH_PASSIVE 12787 //Extra attack chance during phase 2 +#define SPELL_SUNDER_ARMOR 30901 //Sunder armor during phase 2 +#define SPELL_THRASH_AURA 12787 //Passive proc chance for thrash +#define SPELL_EQUIP_AXES 30857 //Visual for axe equiping +#define SPELL_AMPLIFY_DAMAGE 39095 //Amplifiy during phase 3 +#define SPELL_CLEAVE 30131 //Same as Nightbane. +#define SPELL_HELLFIRE 30859 //Infenals' hellfire aura +#define NETHERSPITE_INFERNAL 17646 //The netherspite infernal creature +#define MALCHEZARS_AXE 17650 //Malchezar's axes (creatures), summoned during phase 3 + +#define INFERNAL_MODEL_INVISIBLE 11686 //Infernal Effects +#define SPELL_INFERNAL_RELAY 30834 + +#define EQUIP_ID_AXE 33542 //Axes info + +//---------Infernal code first +struct MANGOS_DLL_DECL netherspite_infernalAI : public ScriptedAI +{ + netherspite_infernalAI(Creature* pCreature) : ScriptedAI(pCreature) , + malchezaar(0), HellfireTimer(0), CleanupTimer(0), point(NULL) {Reset();} + + uint32 HellfireTimer; + uint32 CleanupTimer; + uint64 malchezaar; + InfernalPoint *point; + + void Reset() {} + void MoveInLineOfSight(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (HellfireTimer) + { + if (HellfireTimer <= diff) + { + DoCastSpellIfCan(m_creature, SPELL_HELLFIRE); + HellfireTimer = 0; + } else HellfireTimer -= diff; + } + + if (CleanupTimer) + { + if (CleanupTimer <= diff) + { + Cleanup(); + CleanupTimer = 0; + } else CleanupTimer -= diff; + } + } + + void KilledUnit(Unit *who) + { + if (Creature *pMalchezaar = m_creature->GetMap()->GetCreature(malchezaar)) + pMalchezaar->AI()->KilledUnit(who); + } + + void SpellHit(Unit *who, const SpellEntry *spell) + { + if (spell->Id == SPELL_INFERNAL_RELAY) + { + m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + HellfireTimer = 4000; + CleanupTimer = 170000; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != malchezaar) + damage = 0; + } + + void Cleanup(); //below ... +}; + +struct MANGOS_DLL_DECL boss_malchezaarAI : public ScriptedAI +{ + boss_malchezaarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + for(uint8 i =0; i < 2; ++i) + axes[i] = 0; + + Reset(); + } + + uint32 EnfeebleTimer; + uint32 EnfeebleResetTimer; + uint32 ShadowNovaTimer; + uint32 SWPainTimer; + uint32 SunderArmorTimer; + uint32 AmplifyDamageTimer; + uint32 Cleave_Timer; + uint32 InfernalTimer; + uint32 AxesTargetSwitchTimer; + uint32 InfernalCleanupTimer; + + std::vector infernals; + std::vector positions; + + uint64 axes[2]; + uint64 enfeeble_targets[5]; + uint64 enfeeble_health[5]; + + uint32 phase; + + void Reset() + { + AxesCleanup(); + ClearWeapons(); + InfernalCleanup(); + positions.clear(); + + for(int i =0; i < 5; ++i) + { + enfeeble_targets[i] = 0; + enfeeble_health[i] = 0; + } + + for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i) + positions.push_back(&InfernalPoints[i]); + + EnfeebleTimer = 30000; + EnfeebleResetTimer = 38000; + ShadowNovaTimer = 35500; + SWPainTimer = 20000; + AmplifyDamageTimer = 5000; + Cleave_Timer = 8000; + InfernalTimer = 45000; + InfernalCleanupTimer = 47000; + AxesTargetSwitchTimer = urand(7500, 20000); + SunderArmorTimer = urand(5000, 10000); + phase = 1; + } + + void KilledUnit(Unit *victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + AxesCleanup(); + ClearWeapons(); + InfernalCleanup(); + positions.clear(); + + for(int i = 0; i < TOTAL_INFERNAL_POINTS; ++i) + positions.push_back(&InfernalPoints[i]); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void InfernalCleanup() + { + //Infernal Cleanup + for(std::vector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr) + { + Creature *pInfernal = m_creature->GetMap()->GetCreature(*itr); + if (pInfernal && pInfernal->isAlive()) + { + pInfernal->SetVisibility(VISIBILITY_OFF); + pInfernal->SetDeathState(JUST_DIED); + } + } + infernals.clear(); + } + + void AxesCleanup() + { + for(int i=0; i<2;++i) + { + Creature *axe = m_creature->GetMap()->GetCreature(axes[i]); + if (axe && axe->isAlive()) + axe->DealDamage(axe, axe->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + axes[i] = 0; + } + } + + void ClearWeapons() + { + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + + //damage + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + } + + void EnfeebleHealthEffect() + { + const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT); + if (!info) + return; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + std::vector targets; + + if (tList.empty()) + return; + + //begin + 1 , so we don't target the one with the highest threat + ThreatList::const_iterator itr = tList.begin(); + std::advance(itr, 1); + for(; itr!= tList.end(); ++itr) //store the threat list in a different container + { + Unit *target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //cut down to size if we have more than 5 targets + while(targets.size() > 5) + targets.erase(targets.begin()+rand()%targets.size()); + + int i = 0; + for(std::vector::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i) + { + Unit *target = *iter; + if (target) + { + enfeeble_targets[i] = target->GetGUID(); + enfeeble_health[i] = target->GetHealth(); + + target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID()); + target->SetHealth(1); + } + } + + } + + void EnfeebleResetHealth() + { + for(int i = 0; i < 5; ++i) + { + Player* pTarget = m_creature->GetMap()->GetPlayer(enfeeble_targets[i]); + + if (pTarget && pTarget->isAlive()) + pTarget->SetHealth(enfeeble_health[i]); + + enfeeble_targets[i] = 0; + enfeeble_health[i] = 0; + } + } + + void SummonInfernal(const uint32 diff) + { + InfernalPoint *point = NULL; + float posX,posY,posZ; + if ((m_creature->GetMapId() != 532) || positions.empty()) + { + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 60, posX, posY, posZ); + } + else + { + std::vector::iterator itr = positions.begin()+rand()%positions.size(); + point = *itr; + positions.erase(itr); + + posX = point->x; + posY = point->y; + posZ = INFERNAL_Z; + } + + Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, posX, posY, posZ, 0, TEMPSUMMON_TIMED_DESPAWN, 180000); + + if (Infernal) + { + Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); + Infernal->setFaction(m_creature->getFaction()); + + netherspite_infernalAI* pInfernalAI = dynamic_cast(Infernal->AI()); + + if (pInfernalAI) + { + if (point) + pInfernalAI->point = point; + + pInfernalAI->malchezaar = m_creature->GetGUID(); + } + + infernals.push_back(Infernal->GetGUID()); + DoCastSpellIfCan(Infernal, SPELL_INFERNAL_RELAY); + } + + DoScriptText(urand(0, 1) ? SAY_SUMMON1 : SAY_SUMMON2, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (EnfeebleResetTimer) + { + if (EnfeebleResetTimer <= diff) //Let's not forget to reset that + { + EnfeebleResetHealth(); + EnfeebleResetTimer=0; + } else EnfeebleResetTimer -= diff; + } + + if (m_creature->hasUnitState(UNIT_STAT_STUNNED)) //While shifting to phase 2 malchezaar stuns himself + return; + + if (m_creature->GetUInt64Value(UNIT_FIELD_TARGET)!=m_creature->getVictim()->GetGUID()) + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID()); + + if (phase == 1) + { + if (m_creature->GetHealthPercent() < 60.0f) + { + m_creature->InterruptNonMeleeSpells(false); + + phase = 2; + + //animation + DoCastSpellIfCan(m_creature, SPELL_EQUIP_AXES); + + //text + DoScriptText(SAY_AXE_TOSS1, m_creature); + + //passive thrash aura + m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true); + + //models + SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); + + //damage + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + + m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg); + m_creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg); + //Sigh, updating only works on main attack , do it manually .... + m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); + m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); + + m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100); + } + } + else if (phase == 2) + { + if (m_creature->GetHealthPercent() < 30.0f) + { + InfernalTimer = 15000; + + phase = 3; + + ClearWeapons(); + + //remove thrash + m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA); + + DoScriptText(SAY_AXE_TOSS2, m_creature); + + Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + for(uint32 i=0; i<2; ++i) + { + Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (axe) + { + axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + axe->setFaction(m_creature->getFaction()); + + axes[i] = axe->GetGUID(); + if (target) + { + axe->AI()->AttackStart(target); + // axe->getThreatManager().tauntApply(target); //Taunt Apply and fade out does not work properly + // So we'll use a hack to add a lot of threat to our target + axe->AddThreat(target, 10000000.0f); + } + } + } + + if (ShadowNovaTimer > 35000) + ShadowNovaTimer = EnfeebleTimer + 5000; + + return; + } + + if (SunderArmorTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUNDER_ARMOR); + SunderArmorTimer = urand(10000, 18000); + + }else SunderArmorTimer -= diff; + + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + Cleave_Timer = urand(6000, 12000); + + }else Cleave_Timer -= diff; + } + else + { + if (AxesTargetSwitchTimer < diff) + { + AxesTargetSwitchTimer = urand(7500, 20000); + + Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (target) + { + for(int i = 0; i < 2; ++i) + { + Creature *axe = m_creature->GetMap()->GetCreature(axes[i]); + if (axe) + { + float threat = 1000000.0f; + if (axe->getVictim() && m_creature->getThreatManager().getThreat(axe->getVictim())) + { + threat = axe->getThreatManager().getThreat(axe->getVictim()); + axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100); + } + if (target) + axe->AddThreat(target, threat); + //axe->getThreatManager().tauntFadeOut(axe->getVictim()); + //axe->getThreatManager().tauntApply(target); + } + } + } + } else AxesTargetSwitchTimer -= diff; + + if (AmplifyDamageTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_AMPLIFY_DAMAGE); + + AmplifyDamageTimer = urand(20000, 30000); + }else AmplifyDamageTimer -= diff; + } + + //Time for global and double timers + if (InfernalTimer < diff) + { + SummonInfernal(diff); + InfernalTimer = phase == 3 ? 14500 : 44500; //15 secs in phase 3, 45 otherwise + }else InfernalTimer -= diff; + + if (ShadowNovaTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWNOVA); + ShadowNovaTimer = phase == 3 ? 31000 : -1; + } else ShadowNovaTimer -= diff; + + if (phase != 2) + { + if (SWPainTimer < diff) + { + Unit* target = NULL; + if (phase == 1) + target = m_creature->getVictim(); // the tank + else //anyone but the tank + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (target) + DoCastSpellIfCan(target, SPELL_SW_PAIN); + + SWPainTimer = 20000; + }else SWPainTimer -= diff; + } + + if (phase != 3) + { + if (EnfeebleTimer < diff) + { + EnfeebleHealthEffect(); + EnfeebleTimer = 30000; + ShadowNovaTimer = 5000; + EnfeebleResetTimer = 9000; + }else EnfeebleTimer -= diff; + } + + if (phase==2) + DoMeleeAttacksIfReady(); + else + DoMeleeAttackIfReady(); + } + + void DoMeleeAttacksIfReady() + { + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE) && !m_creature->IsNonMeleeSpellCasted(false)) + { + //Check for base attack + if (m_creature->isAttackReady() && m_creature->getVictim()) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + //Check for offhand attack + if (m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim()) + { + m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK); + m_creature->resetAttackTimer(OFF_ATTACK); + } + } + } + + void Cleanup(Creature *infernal, InfernalPoint *point) + { + for(std::vector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr) + if (*itr == infernal->GetGUID()) + { + infernals.erase(itr); + break; + } + + positions.push_back(point); + } +}; + +void netherspite_infernalAI::Cleanup() +{ + Creature* pMalchezaar = m_creature->GetMap()->GetCreature(malchezaar); + + if (pMalchezaar && pMalchezaar->isAlive()) + { + if (boss_malchezaarAI* pMalAI = dynamic_cast(pMalchezaar->AI())) + pMalAI->Cleanup(m_creature, point); + } +} + +CreatureAI* GetAI_netherspite_infernal(Creature* pCreature) +{ + return new netherspite_infernalAI(pCreature); +} + +CreatureAI* GetAI_boss_malchezaar(Creature* pCreature) +{ + return new boss_malchezaarAI(pCreature); +} + +void AddSC_netherspite_infernal() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "netherspite_infernal"; + newscript->GetAI = &GetAI_netherspite_infernal; + newscript->RegisterSelf(); +} + +void AddSC_boss_malchezaar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_malchezaar"; + newscript->GetAI = &GetAI_boss_malchezaar; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp b/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp new file mode 100644 index 0000000..dbebf3b --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp @@ -0,0 +1,559 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shade_of_Aran +SD%Complete: 95 +SDComment: Flame wreath missing cast animation, mods won't trigger. +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" +#include "karazhan.h" +#include "GameObject.h" + +enum +{ + SAY_AGGRO1 = -1532073, + SAY_AGGRO2 = -1532074, + SAY_AGGRO3 = -1532075, + SAY_FLAMEWREATH1 = -1532076, + SAY_FLAMEWREATH2 = -1532077, + SAY_BLIZZARD1 = -1532078, + SAY_BLIZZARD2 = -1532079, + SAY_EXPLOSION1 = -1532080, + SAY_EXPLOSION2 = -1532081, + SAY_DRINK = -1532082, //Low Mana / AoE Pyroblast + SAY_ELEMENTALS = -1532083, + SAY_KILL1 = -1532084, + SAY_KILL2 = -1532085, + SAY_TIMEOVER = -1532086, + SAY_DEATH = -1532087, + SAY_ATIESH = -1532088, //Atiesh is equipped by a raid member + + //Spells + SPELL_FROSTBOLT = 29954, + SPELL_FIREBALL = 29953, + SPELL_ARCMISSLE = 29955, + SPELL_CHAINSOFICE = 29991, + SPELL_DRAGONSBREATH = 29964, + SPELL_MASSSLOW = 30035, + SPELL_FLAME_WREATH = 29946, + SPELL_AOE_CS = 29961, + SPELL_PLAYERPULL = 32265, + SPELL_AEXPLOSION = 29973, + SPELL_MASS_POLY = 29963, + SPELL_BLINK_CENTER = 29967, + SPELL_ELEMENTALS = 29962, + SPELL_CONJURE = 29975, + SPELL_DRINK = 30024, + SPELL_POTION = 32453, + SPELL_AOE_PYROBLAST = 29978, + + SPELL_EXPLOSION = 20476, + SPELL_KNOCKBACK_500 = 11027, + + //Creature Spells + SPELL_CIRCULAR_BLIZZARD = 29951, //29952 is the REAL circular blizzard that leaves persistant blizzards that last for 10 seconds + SPELL_WATERBOLT = 31012, + SPELL_SHADOW_PYRO = 29978, + + //Creatures + NPC_WATER_ELEMENTAL = 17167, + NPC_SHADOW_OF_ARAN = 18254, + NPC_ARAN_BLIZZARD = 17161 +}; + +enum SuperSpell +{ + SUPER_FLAME = 0, + SUPER_BLIZZARD, + SUPER_AE, +}; + +struct MANGOS_DLL_DECL boss_aranAI : public ScriptedAI +{ + boss_aranAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiSecondarySpell_Timer; + uint32 m_uiNormalCast_Timer; + uint32 m_uiSuperCast_Timer; + uint32 m_uiBerserk_Timer; + uint32 m_uiCloseDoor_Timer; // Don't close the door right on aggro in case some people are still entering. + + uint8 m_uiLastSuperSpell; + + uint32 m_uiFlameWreath_Timer; + uint32 m_uiFlameWreathCheck_Timer; + uint64 m_uiFlameWreathTarget[3]; + float m_fFWTargPosX[3]; + float m_fFWTargPosY[3]; + + uint32 m_uiCurrentNormalSpell; + uint32 m_uiArcaneCooldown; + uint32 m_uiFireCooldown; + uint32 m_uiFrostCooldown; + + uint32 m_uiDrinkInturrupt_Timer; + + bool m_bElementalsSpawned; + bool m_bDrinking; + bool m_bDrinkInturrupted; + + void Reset() + { + m_uiSecondarySpell_Timer = 5000; + m_uiNormalCast_Timer = 0; + m_uiSuperCast_Timer = 35000; + m_uiBerserk_Timer = 720000; + m_uiCloseDoor_Timer = 15000; + + m_uiLastSuperSpell = urand(0, 2); + + m_uiFlameWreath_Timer = 0; + m_uiFlameWreathCheck_Timer = 0; + + m_uiCurrentNormalSpell = 0; + m_uiArcaneCooldown = 0; + m_uiFireCooldown = 0; + m_uiFrostCooldown = 0; + + m_uiDrinkInturrupt_Timer = 10000; + + m_bElementalsSpawned = false; + m_bDrinking = false; + m_bDrinkInturrupted = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARAN, NOT_STARTED); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void JustDied(Unit* pVictim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARAN, DONE); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARAN, IN_PROGRESS); + } + + void FlameWreathEffect() + { + std::vector targets; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + if (tList.empty()) + return; + + //store the threat list in a different container + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* pTarget = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + //only on alive players + if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + targets.push_back(pTarget); + } + + //cut down to size if we have more than 3 targets + while(targets.size() > 3) + targets.erase(targets.begin()+rand()%targets.size()); + + uint32 i = 0; + for(std::vector::iterator itr = targets.begin(); itr!= targets.end(); ++itr) + { + if (*itr) + { + m_uiFlameWreathTarget[i] = (*itr)->GetGUID(); + m_fFWTargPosX[i] = (*itr)->GetPositionX(); + m_fFWTargPosY[i] = (*itr)->GetPositionY(); + m_creature->CastSpell((*itr), SPELL_FLAME_WREATH, true); + ++i; + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCloseDoor_Timer) + { + if (m_uiCloseDoor_Timer <= uiDiff) + { + if (m_pInstance) + { + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_GO_LIBRARY_DOOR))) + pDoor->SetGoState(GO_STATE_READY); + + m_uiCloseDoor_Timer = 0; + } + } + else + m_uiCloseDoor_Timer -= uiDiff; + } + + //Cooldowns for casts + if (m_uiArcaneCooldown) + { + if (m_uiArcaneCooldown >= uiDiff) + m_uiArcaneCooldown -= uiDiff; + else + m_uiArcaneCooldown = 0; + } + + if (m_uiFireCooldown) + { + if (m_uiFireCooldown >= uiDiff) + m_uiFireCooldown -= uiDiff; + else + m_uiFireCooldown = 0; + } + + if (m_uiFrostCooldown) + { + if (m_uiFrostCooldown >= uiDiff) + m_uiFrostCooldown -= uiDiff; + else + m_uiFrostCooldown = 0; + } + + if (!m_bDrinking && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20) + { + m_bDrinking = true; + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_DRINK, m_creature); + + if (!m_bDrinkInturrupted) + { + m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true); + m_creature->CastSpell(m_creature, SPELL_CONJURE, false); + m_creature->CastSpell(m_creature, SPELL_DRINK, false); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + m_uiDrinkInturrupt_Timer = 10000; + } + } + + //Drink Inturrupt + if (m_bDrinking && m_bDrinkInturrupted) + { + m_bDrinking = false; + m_creature->RemoveAurasDueToSpell(SPELL_DRINK); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000); + m_creature->CastSpell(m_creature, SPELL_POTION, false); + } + + //Drink Inturrupt Timer + if (m_bDrinking && !m_bDrinkInturrupted) + { + if (m_uiDrinkInturrupt_Timer >= uiDiff) + m_uiDrinkInturrupt_Timer -= uiDiff; + else + { + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->CastSpell(m_creature, SPELL_POTION, true); + m_creature->CastSpell(m_creature, SPELL_AOE_PYROBLAST, false); + m_bDrinkInturrupted = true; + m_bDrinking = false; + } + } + + //Don't execute any more code if we are drinking + if (m_bDrinking) + return; + + //Normal casts + if (m_uiNormalCast_Timer < uiDiff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (!pTarget) + return; + + uint32 auiSpells[3]; + uint8 uiAvailableSpells = 0; + + //Check for what spells are not on cooldown + if (!m_uiArcaneCooldown) + auiSpells[uiAvailableSpells++] = SPELL_ARCMISSLE; + if (!m_uiFireCooldown) + auiSpells[uiAvailableSpells++] = SPELL_FIREBALL; + if (!m_uiFrostCooldown) + auiSpells[uiAvailableSpells++] = SPELL_FROSTBOLT; + + //If no available spells wait 1 second and try again + if (uiAvailableSpells) + { + m_uiCurrentNormalSpell = auiSpells[rand() % uiAvailableSpells]; + DoCastSpellIfCan(pTarget, m_uiCurrentNormalSpell); + } + } + m_uiNormalCast_Timer = 1000; + } + else + m_uiNormalCast_Timer -= uiDiff; + + if (m_uiSecondarySpell_Timer < uiDiff) + { + switch(urand(0, 1)) + { + case 0: + DoCastSpellIfCan(m_creature, SPELL_AOE_CS); + break; + case 1: + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_CHAINSOFICE); + break; + } + m_uiSecondarySpell_Timer = urand(5000, 20000); + } + else + m_uiSecondarySpell_Timer -= uiDiff; + + if (m_uiSuperCast_Timer < uiDiff) + { + uint8 auiAvailable[2]; + + switch (m_uiLastSuperSpell) + { + case SUPER_AE: + auiAvailable[0] = SUPER_FLAME; + auiAvailable[1] = SUPER_BLIZZARD; + break; + case SUPER_FLAME: + auiAvailable[0] = SUPER_AE; + auiAvailable[1] = SUPER_BLIZZARD; + break; + case SUPER_BLIZZARD: + auiAvailable[0] = SUPER_FLAME; + auiAvailable[1] = SUPER_AE; + break; + } + + m_uiLastSuperSpell = auiAvailable[urand(0, 2)]; + + switch (m_uiLastSuperSpell) + { + case SUPER_AE: + DoScriptText(urand(0, 1) ? SAY_EXPLOSION1 : SAY_EXPLOSION2, m_creature); + + m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true); + m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true); + m_creature->CastSpell(m_creature, SPELL_MASSSLOW, true); + m_creature->CastSpell(m_creature, SPELL_AEXPLOSION, false); + break; + + case SUPER_FLAME: + DoScriptText(urand(0, 1) ? SAY_FLAMEWREATH1 : SAY_FLAMEWREATH2, m_creature); + + m_uiFlameWreath_Timer = 20000; + m_uiFlameWreathCheck_Timer = 500; + + memset(&m_uiFlameWreathTarget, 0, sizeof(m_uiFlameWreathTarget)); + + FlameWreathEffect(); + break; + + case SUPER_BLIZZARD: + DoScriptText(urand(0, 1) ? SAY_BLIZZARD1 : SAY_BLIZZARD2, m_creature); + + if (Creature* pSpawn = m_creature->SummonCreature(NPC_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) + { + pSpawn->setFaction(m_creature->getFaction()); + pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false); + } + break; + } + + m_uiSuperCast_Timer = urand(35000, 40000); + } + else + m_uiSuperCast_Timer -= uiDiff; + + if (!m_bElementalsSpawned && m_creature->GetHealthPercent() < 40.0f) + { + m_bElementalsSpawned = true; + + for (uint32 i = 0; i < 4; ++i) + { + if (Creature* pElemental = m_creature->SummonCreature(NPC_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) + { + pElemental->Attack(m_creature->getVictim(), true); + pElemental->setFaction(m_creature->getFaction()); + } + } + + DoScriptText(SAY_ELEMENTALS, m_creature); + } + + if (m_uiBerserk_Timer < uiDiff) + { + for (uint32 i = 0; i < 5; ++i) + { + if (Creature* pShadow = m_creature->SummonCreature(NPC_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + { + pShadow->Attack(m_creature->getVictim(), true); + pShadow->setFaction(m_creature->getFaction()); + } + } + + DoScriptText(SAY_TIMEOVER, m_creature); + + m_uiBerserk_Timer = 60000; + } + else + m_uiBerserk_Timer -= uiDiff; + + //Flame Wreath check + if (m_uiFlameWreath_Timer) + { + if (m_uiFlameWreath_Timer >= uiDiff) + m_uiFlameWreath_Timer -= uiDiff; + else + m_uiFlameWreath_Timer = 0; + + if (m_uiFlameWreathCheck_Timer < uiDiff) + { + for (uint32 i = 0; i < 3; ++i) + { + if (!m_uiFlameWreathTarget[i]) + continue; + + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiFlameWreathTarget[i]); + + if (pPlayer && !pPlayer->IsWithinDist2d(m_fFWTargPosX[i], m_fFWTargPosY[i], 3.0f)) + { + pPlayer->CastSpell(pPlayer, SPELL_EXPLOSION, true, 0, 0, m_creature->GetGUID()); + pPlayer->CastSpell(pPlayer, SPELL_KNOCKBACK_500, true); + m_uiFlameWreathTarget[i] = 0; + } + } + m_uiFlameWreathCheck_Timer = 500; + } + else + m_uiFlameWreathCheck_Timer -= uiDiff; + } + + if (m_uiArcaneCooldown && m_uiFireCooldown && m_uiFrostCooldown) + DoMeleeAttackIfReady(); + } + + void DamageTaken(Unit* pAttacker, uint32 &damage) + { + if (!m_bDrinkInturrupted && m_bDrinking && damage) + m_bDrinkInturrupted = true; + } + + void SpellHit(Unit* pAttacker, const SpellEntry* Spell) + { + //We only care about inturrupt effects and only if they are durring a spell currently being casted + if ((Spell->Effect[0]!=SPELL_EFFECT_INTERRUPT_CAST && + Spell->Effect[1]!=SPELL_EFFECT_INTERRUPT_CAST && + Spell->Effect[2]!=SPELL_EFFECT_INTERRUPT_CAST) || !m_creature->IsNonMeleeSpellCasted(false)) + return; + + //Inturrupt effect + m_creature->InterruptNonMeleeSpells(false); + + //Normally we would set the cooldown equal to the spell duration + //but we do not have access to the DurationStore + + switch (m_uiCurrentNormalSpell) + { + case SPELL_ARCMISSLE: m_uiArcaneCooldown = 5000; break; + case SPELL_FIREBALL: m_uiFireCooldown = 5000; break; + case SPELL_FROSTBOLT: m_uiFrostCooldown = 5000; break; + } + } +}; + +struct MANGOS_DLL_DECL water_elementalAI : public ScriptedAI +{ + water_elementalAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCast_Timer; + + void Reset() + { + m_uiCast_Timer = urand(2000, 5000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WATERBOLT); + m_uiCast_Timer = urand(2000, 5000); + } + else + m_uiCast_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_aran(Creature* pCreature) +{ + return new boss_aranAI(pCreature); +} + +CreatureAI* GetAI_water_elemental(Creature* pCreature) +{ + return new water_elementalAI(pCreature); +} + +void AddSC_boss_shade_of_aran() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_shade_of_aran"; + newscript->GetAI = &GetAI_boss_aran; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_aran_elemental"; + newscript->GetAI = &GetAI_water_elemental; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp b/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp new file mode 100644 index 0000000..e913671 --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp @@ -0,0 +1,363 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Terestian_Illhoof +SD%Complete: 95 +SDComment: Complete! Needs adjustments to use spell though. +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" +#include "karazhan.h" + +enum +{ + SAY_SLAY1 = -1532065, + SAY_SLAY2 = -1532066, + SAY_DEATH = -1532067, + SAY_AGGRO = -1532068, + SAY_SACRIFICE1 = -1532069, + SAY_SACRIFICE2 = -1532070, + SAY_SUMMON1 = -1532071, + SAY_SUMMON2 = -1532072, + + SPELL_SUMMON_DEMONCHAINS = 30120, // Summons demonic chains that maintain the ritual of sacrifice. + SPELL_DEMON_CHAINS = 30206, // Instant - Visual Effect + SPELL_ENRAGE = 23537, // Increases the caster's attack speed by 50% and the Physical damage it deals by 219 to 281 for 10 min. + SPELL_SHADOW_BOLT = 30055, // Hurls a bolt of dark magic at an enemy, inflicting Shadow damage. + SPELL_SACRIFICE = 30115, // Teleports and adds the debuff + SPELL_BERSERK = 32965, // Increases attack speed by 75%. Periodically casts Shadow Bolt Volley. + + SPELL_SUMMON_IMP = 30066, // Summons Kil'rek + + SPELL_SUMMON_FIENDISH_IMP = 30184, + SPELL_FIENDISH_PORTAL = 30171, // Opens portal and summons Fiendish Portal, 2 sec cast + SPELL_FIENDISH_PORTAL_1 = 30179, // Opens portal and summons Fiendish Portal, instant cast + + SPELL_FIREBOLT = 30050, // Blasts a target for 150 Fire damage. + + SPELL_BROKEN_PACT = 30065, // All damage taken increased by 25%. + SPELL_AMPLIFY_FLAMES = 30053, // Increases the Fire damage taken by an enemy by 500 for 25 sec. + + NPC_DEMONCHAINS = 17248, + NPC_FIENDISHIMP = 17267, + NPC_PORTAL = 17265, + NPC_KILREK = 17229 +}; + +struct MANGOS_DLL_DECL mob_demon_chainAI : public ScriptedAI +{ + mob_demon_chainAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint64 m_uiSacrificeGUID; + + void Reset() + { + m_uiSacrificeGUID = 0; + } + + void AttackStart(Unit* pWho) {} + void MoveInLineOfSight(Unit* pWho) {} + + void JustDied(Unit* pKiller) + { + if (m_uiSacrificeGUID) + { + if (Player* pSacrifice = m_creature->GetMap()->GetPlayer(m_uiSacrificeGUID)) + pSacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); + } + } +}; + +struct MANGOS_DLL_DECL boss_terestianAI : public ScriptedAI +{ + boss_terestianAI(Creature* pCreature) : ScriptedAI(pCreature) + { + memset(&m_uiPortalGUID, 0, sizeof(m_uiPortalGUID)); + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bSummonKilrek = true; + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 m_uiPortalGUID[2]; + + uint32 m_uiSummonKilrekTimer; + uint32 m_uiSacrifice_Timer; + uint32 m_uiShadowbolt_Timer; + uint32 m_uiSummon_Timer; + uint32 m_uiBerserk_Timer; + + bool m_bSummonKilrek; + bool m_bSummonedPortals; + bool m_bBerserk; + + void Reset() + { + m_uiSummonKilrekTimer = 5000; + m_uiSacrifice_Timer = 30000; + m_uiShadowbolt_Timer = 5000; + m_uiSummon_Timer = 10000; + m_uiBerserk_Timer = 600000; + + m_bSummonedPortals = false; + m_bBerserk = false; + + if (!m_pInstance) + return; + + for(uint8 i = 0; i < 2; ++i) + { + if (m_uiPortalGUID[i]) + { + if (Creature* pPortal = m_pInstance->instance->GetCreature(m_uiPortalGUID[i])) + pPortal->ForcedDespawn(); + + m_uiPortalGUID[i] = 0; + } + } + + if (!m_creature->isAlive()) + return; + + m_pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED); + + if (!m_creature->GetPet()) + m_bSummonKilrek = true; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + + if (Pet* pKilrek = m_creature->GetPet()) + pKilrek->SetInCombatWithZone(); + + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_TERESTIAN, IN_PROGRESS); + else + ERROR_INST_DATA(m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_PORTAL: + { + if (m_uiPortalGUID[0]) + { + m_uiPortalGUID[1] = pSummoned->GetGUID(); + + if (npc_fiendish_portalAI* pPortalAI = dynamic_cast(pSummoned->AI())) + pPortalAI->m_uiSummonTimer = 10000; + } + else + { + m_uiPortalGUID[0] = pSummoned->GetGUID(); + DoCastSpellIfCan(m_creature, SPELL_FIENDISH_PORTAL_1, CAST_TRIGGERED); + } + + break; + } + case NPC_KILREK: + m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT); + break; + } + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_KILREK) + { + DoCastSpellIfCan(m_creature, SPELL_BROKEN_PACT, CAST_TRIGGERED); + m_bSummonKilrek = true; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + for(uint8 i = 0; i < 2; ++i) + { + if (m_uiPortalGUID[i]) + { + if (Creature* pPortal = m_pInstance->instance->GetCreature(m_uiPortalGUID[i])) + pPortal->ForcedDespawn(); + + m_uiPortalGUID[i] = 0; + } + } + + m_pInstance->SetData(TYPE_TERESTIAN, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bSummonKilrek) + { + if (m_uiSummonKilrekTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_IMP) == CAST_OK) + { + m_uiSummonKilrekTimer = 45000; + m_bSummonKilrek = false; + } + } + else + m_uiSummonKilrekTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiSacrifice_Timer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(pTarget, SPELL_SACRIFICE, CAST_TRIGGERED); + + if (Creature* pChains = m_creature->SummonCreature(NPC_DEMONCHAINS, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 21000)) + { + if (mob_demon_chainAI* pDemonAI = dynamic_cast(pChains->AI())) + pDemonAI->m_uiSacrificeGUID = pTarget->GetGUID(); + + pChains->CastSpell(pChains, SPELL_DEMON_CHAINS, true); + + DoScriptText(urand(0, 1) ? SAY_SACRIFICE1 : SAY_SACRIFICE2, m_creature); + + m_uiSacrifice_Timer = 30000; + } + } + } + else + m_uiSacrifice_Timer -= uiDiff; + + if (m_uiShadowbolt_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_BOLT); + m_uiShadowbolt_Timer = 10000; + } + else + m_uiShadowbolt_Timer -= uiDiff; + + if (!m_bSummonedPortals) + { + if (m_uiSummon_Timer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FIENDISH_PORTAL, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_SUMMON1 : SAY_SUMMON2, m_creature); + m_bSummonedPortals = true; + } + } + else + m_uiSummon_Timer -= uiDiff; + } + + if (!m_bBerserk) + { + if (m_uiBerserk_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_INTERRUPT_PREVIOUS); + m_bBerserk = true; + } + else + m_uiBerserk_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +npc_fiendish_portalAI::npc_fiendish_portalAI(Creature* pCreature) : ScriptedAI(pCreature), + m_uiSummonTimer(5000) +{ + Reset(); +} + +void npc_fiendish_portalAI::Reset() +{ +} + +void npc_fiendish_portalAI::JustSummoned(Creature* pSummoned) +{ + pSummoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + pSummoned->SetInCombatWithZone(); +} + +void npc_fiendish_portalAI::UpdateAI(const uint32 uiDiff) +{ + if (m_uiSummonTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_FIENDISH_IMP); + m_uiSummonTimer = 10000; + } + else + m_uiSummonTimer -= uiDiff; +} + +CreatureAI* GetAI_npc_fiendish_portal(Creature* pCreature) +{ + return new npc_fiendish_portalAI(pCreature); +} + +CreatureAI* GetAI_mob_demon_chain(Creature* pCreature) +{ + return new mob_demon_chainAI(pCreature); +} + +CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature) +{ + return new boss_terestianAI(pCreature); +} + +void AddSC_boss_terestian_illhoof() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_terestian_illhoof"; + newscript->GetAI = &GetAI_boss_terestian_illhoof; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_fiendish_portal"; + newscript->GetAI = &GetAI_npc_fiendish_portal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_demon_chain"; + newscript->GetAI = &GetAI_mob_demon_chain; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp b/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp new file mode 100644 index 0000000..ae53231 --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp @@ -0,0 +1,1520 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Bosses_Opera +SD%Complete: 90 +SDComment: Oz, Hood, and RAJ event implemented. RAJ event requires more testing. +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" +#include "karazhan.h" + +/***********************************/ +/*** OPERA WIZARD OF OZ EVENT *****/ +/*********************************/ + +#define SAY_DOROTHEE_DEATH -1532025 +#define SAY_DOROTHEE_SUMMON -1532026 +#define SAY_DOROTHEE_TITO_DEATH -1532027 +#define SAY_DOROTHEE_AGGRO -1532028 + +#define SAY_ROAR_AGGRO -1532029 +#define SAY_ROAR_DEATH -1532030 +#define SAY_ROAR_SLAY -1532031 + +#define SAY_STRAWMAN_AGGRO -1532032 +#define SAY_STRAWMAN_DEATH -1532033 +#define SAY_STRAWMAN_SLAY -1532034 + +#define SAY_TINHEAD_AGGRO -1532035 +#define SAY_TINHEAD_DEATH -1532036 +#define SAY_TINHEAD_SLAY -1532037 +#define EMOTE_RUST -1532038 + +#define SAY_CRONE_AGGRO -1532039 +#define SAY_CRONE_AGGRO2 -1532040 +#define SAY_CRONE_DEATH -1532041 +#define SAY_CRONE_SLAY -1532042 + +/**** Spells ****/ +// Dorothee +#define SPELL_WATERBOLT 31012 +#define SPELL_SCREAM 31013 +#define SPELL_SUMMONTITO 31014 + +// Tito +#define SPELL_YIPPING 31015 + +// Strawman +#define SPELL_BRAIN_BASH 31046 +#define SPELL_BRAIN_WIPE 31069 +#define SPELL_BURNING_STRAW 31075 + +// Tinhead +#define SPELL_CLEAVE 31043 +#define SPELL_RUST 31086 + +// Roar +#define SPELL_MANGLE 31041 +#define SPELL_SHRED 31042 +#define SPELL_FRIGHTENED_SCREAM 31013 + +// Crone +#define SPELL_CHAIN_LIGHTNING 32337 + +// Cyclone +#define SPELL_KNOCKBACK 32334 +#define SPELL_CYCLONE_VISUAL 32332 + +/** Creature Entries **/ +#define CREATURE_TITO 17548 +#define CREATURE_CYCLONE 18412 +#define CREATURE_CRONE 18168 + +void SummonCroneIfReady(ScriptedInstance* pInstance, Creature* pCreature) +{ + pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, SPECIAL); // Increment DeathCount + + if (pInstance->GetData(DATA_OPERA_OZ_DEATHCOUNT) == 4) + { + if (Creature* pCrone = pCreature->SummonCreature(CREATURE_CRONE, -10891.96f, -1755.95f, pCreature->GetPositionZ(), 4.64f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) + { + if (pCreature->getVictim()) + pCrone->AI()->AttackStart(pCreature->getVictim()); + } + } +}; + +struct MANGOS_DLL_DECL boss_dorotheeAI : public ScriptedAI +{ + boss_dorotheeAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 AggroTimer; + + uint32 WaterBoltTimer; + uint32 FearTimer; + uint32 SummonTitoTimer; + + bool SummonedTito; + bool TitoDied; + + void Reset() + { + AggroTimer = 500; + + WaterBoltTimer = 5000; + FearTimer = 15000; + SummonTitoTimer = 47500; + + SummonedTito = false; + TitoDied = false; + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_DOROTHEE_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void SummonTito(); // See below + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DOROTHEE_DEATH, m_creature); + + if (m_pInstance) + SummonCroneIfReady(m_pInstance, m_creature); + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (WaterBoltTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_WATERBOLT); + + WaterBoltTimer = TitoDied ? 1500 : 5000; + }else WaterBoltTimer -= diff; + + if (FearTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SCREAM); + FearTimer = 30000; + }else FearTimer -= diff; + + if (!SummonedTito) + { + if (SummonTitoTimer < diff) + SummonTito(); + else SummonTitoTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_titoAI : public ScriptedAI +{ + mob_titoAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint64 DorotheeGUID; + uint32 YipTimer; + + void Reset() + { + DorotheeGUID = 0; + YipTimer = 10000; + } + + void JustDied(Unit* killer) + { + if (DorotheeGUID) + { + Creature* Dorothee = m_creature->GetMap()->GetCreature(DorotheeGUID); + if (Dorothee && Dorothee->isAlive()) + { + if (boss_dorotheeAI* pDoroAI = dynamic_cast(Dorothee->AI())) + pDoroAI->TitoDied = true; + + DoScriptText(SAY_DOROTHEE_TITO_DEATH, Dorothee); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (YipTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_YIPPING); + YipTimer = 10000; + }else YipTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void boss_dorotheeAI::SummonTito() +{ + if (Creature* pTito = m_creature->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + DoScriptText(SAY_DOROTHEE_SUMMON, m_creature); + + if (mob_titoAI* pTitoAI = dynamic_cast(pTito->AI())) + pTitoAI->DorotheeGUID = m_creature->GetGUID(); + + pTito->AI()->AttackStart(m_creature->getVictim()); + + SummonedTito = true; + TitoDied = false; + } +} + +struct MANGOS_DLL_DECL boss_strawmanAI : public ScriptedAI +{ + boss_strawmanAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 AggroTimer; + uint32 BrainBashTimer; + uint32 BrainWipeTimer; + + void Reset() + { + AggroTimer = 13000; + BrainBashTimer = 5000; + BrainWipeTimer = 7000; + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_STRAWMAN_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void SpellHit(Unit* caster, const SpellEntry *Spell) + { + if ((Spell->SchoolMask == SPELL_SCHOOL_MASK_FIRE) && !urand(0, 1)) + { + /* + if (not direct damage(aoe,dot)) + return; + */ + + DoCastSpellIfCan(m_creature, SPELL_BURNING_STRAW, true); + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_STRAWMAN_DEATH, m_creature); + + if (m_pInstance) + SummonCroneIfReady(m_pInstance, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_STRAWMAN_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (BrainBashTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BRAIN_BASH); + BrainBashTimer = 15000; + }else BrainBashTimer -= diff; + + if (BrainWipeTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_BRAIN_WIPE); + + BrainWipeTimer = 20000; + }else BrainWipeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_tinheadAI : public ScriptedAI +{ + boss_tinheadAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 AggroTimer; + uint32 CleaveTimer; + uint32 RustTimer; + + uint8 RustCount; + + void Reset() + { + AggroTimer = 15000; + CleaveTimer = 5000; + RustTimer = 30000; + + RustCount = 0; + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_TINHEAD_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_TINHEAD_DEATH, m_creature); + + if (m_pInstance) + SummonCroneIfReady(m_pInstance, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_TINHEAD_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (CleaveTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = 5000; + }else CleaveTimer -= diff; + + if (RustCount < 8) + { + if (RustTimer < diff) + { + if (DoCastSpellIfCan(m_creature, SPELL_RUST) == CAST_OK) + { + ++RustCount; + + DoScriptText(EMOTE_RUST, m_creature); + RustTimer = 6000; + } + }else RustTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_roarAI : public ScriptedAI +{ + boss_roarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 AggroTimer; + uint32 MangleTimer; + uint32 ShredTimer; + uint32 ScreamTimer; + + void Reset() + { + AggroTimer = 20000; + MangleTimer = 5000; + ShredTimer = 10000; + ScreamTimer = 15000; + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_ROAR_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_ROAR_DEATH, m_creature); + + if (m_pInstance) + SummonCroneIfReady(m_pInstance, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_ROAR_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (MangleTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MANGLE); + MangleTimer = urand(5000, 8000); + }else MangleTimer -= diff; + + if (ShredTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHRED); + ShredTimer = urand(10000, 15000); + }else ShredTimer -= diff; + + if (ScreamTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM); + ScreamTimer = urand(20000, 30000); + }else ScreamTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_croneAI : public ScriptedAI +{ + boss_croneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 CycloneTimer; + uint32 ChainLightningTimer; + + void Reset() + { + CycloneTimer = 30000; + ChainLightningTimer = 10000; + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void Aggro(Unit* who) + { + DoScriptText(urand(0, 1) ? SAY_CRONE_AGGRO : SAY_CRONE_AGGRO2, m_creature); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_CRONE_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_OPERA, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (CycloneTimer < diff) + { + Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, rand()%10, rand()%10, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); + if (Cyclone) + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true); + CycloneTimer = 30000; + }else CycloneTimer -= diff; + + if (ChainLightningTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); + ChainLightningTimer = 15000; + }else ChainLightningTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_cycloneAI : public ScriptedAI +{ + mob_cycloneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 MoveTimer; + + void Reset() + { + MoveTimer = 1000; + } + + void MoveInLineOfSight(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->HasAura(SPELL_KNOCKBACK, EFFECT_INDEX_0)) + DoCastSpellIfCan(m_creature, SPELL_KNOCKBACK, CAST_TRIGGERED); + + if (MoveTimer < diff) + { + float x,y,z; + m_creature->GetPosition(x,y,z); + float PosX, PosY, PosZ; + m_creature->GetRandomPoint(x,y,z,10, PosX, PosY, PosZ); + m_creature->GetMotionMaster()->MovePoint(0, PosX, PosY, PosZ); + MoveTimer = urand(5000, 8000); + }else MoveTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_dorothee(Creature* pCreature) +{ + return new boss_dorotheeAI(pCreature); +} + +CreatureAI* GetAI_boss_strawman(Creature* pCreature) +{ + return new boss_strawmanAI(pCreature); +} + +CreatureAI* GetAI_boss_tinhead(Creature* pCreature) +{ + return new boss_tinheadAI(pCreature); +} + +CreatureAI* GetAI_boss_roar(Creature* pCreature) +{ + return new boss_roarAI(pCreature); +} + +CreatureAI* GetAI_boss_crone(Creature* pCreature) +{ + return new boss_croneAI(pCreature); +} + +CreatureAI* GetAI_mob_tito(Creature* pCreature) +{ + return new mob_titoAI(pCreature); +} + +CreatureAI* GetAI_mob_cyclone(Creature* pCreature) +{ + return new mob_cycloneAI(pCreature); +} + +/**************************************/ +/**** Opera Red Riding Hood Event ****/ +/************************************/ + +/**** Yells for the Wolf ****/ +#define SAY_WOLF_AGGRO -1532043 +#define SAY_WOLF_SLAY -1532044 +#define SAY_WOLF_HOOD -1532045 +#define SOUND_WOLF_DEATH 9275 //Only sound on death, no text. + +/**** Spells For The Wolf ****/ +#define SPELL_LITTLE_RED_RIDING_HOOD 30768 +#define SPELL_TERRIFYING_HOWL 30752 +#define SPELL_WIDE_SWIPE 30761 + +#define GOSSIP_GRANDMA "What phat lewtz you have grandmother?" + +/**** The Wolf's Entry ****/ +#define CREATURE_BIG_BAD_WOLF 17521 + +bool GossipHello_npc_grandmother(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_GRANDMA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(8990, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_grandmother(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + if (Creature* pBigBadWolf = pCreature->SummonCreature(CREATURE_BIG_BAD_WOLF, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) + pBigBadWolf->AI()->AttackStart(pPlayer); + + pCreature->ForcedDespawn(); + } + + return true; +} + +struct MANGOS_DLL_DECL boss_bigbadwolfAI : public ScriptedAI +{ + boss_bigbadwolfAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ChaseTimer; + uint32 FearTimer; + uint32 SwipeTimer; + + uint64 HoodGUID; + float TempThreat; + + bool IsChasing; + + void Reset() + { + ChaseTimer = 30000; + FearTimer = urand(25000, 35000); + SwipeTimer = 5000; + + HoodGUID = 0; + TempThreat = 0; + + IsChasing = false; + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_WOLF_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* killer) + { + DoPlaySoundToSet(m_creature, SOUND_WOLF_DEATH); + + if (m_pInstance) + m_pInstance->SetData(TYPE_OPERA, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + + if (ChaseTimer < diff) + { + if (!IsChasing) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoScriptText(SAY_WOLF_HOOD, m_creature); + DoCastSpellIfCan(target, SPELL_LITTLE_RED_RIDING_HOOD, CAST_TRIGGERED); + + TempThreat = m_creature->getThreatManager().getThreat(target); + if (TempThreat) + m_creature->getThreatManager().modifyThreatPercent(target, -100); + + HoodGUID = target->GetGUID(); + m_creature->AddThreat(target, 1000000.0f); + ChaseTimer = 20000; + IsChasing = true; + } + } + else + { + IsChasing = false; + + if (Player* target = m_creature->GetMap()->GetPlayer(HoodGUID)) + { + HoodGUID = 0; + + if (m_creature->getThreatManager().getThreat(target)) + m_creature->getThreatManager().modifyThreatPercent(target, -100); + + m_creature->AddThreat(target, TempThreat); + TempThreat = 0; + } + + ChaseTimer = 40000; + } + }else ChaseTimer -= diff; + + if (IsChasing) + return; + + if (FearTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TERRIFYING_HOWL); + FearTimer = urand(25000, 35000); + }else FearTimer -= diff; + + if (SwipeTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WIDE_SWIPE); + SwipeTimer = urand(25000, 30000); + }else SwipeTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_bigbadwolf(Creature* pCreature) +{ + return new boss_bigbadwolfAI(pCreature); +} + +/**********************************************/ +/******** Opera Romeo and Juliet Event *******/ +/********************************************/ + +/**** Speech *****/ +#define SAY_JULIANNE_AGGRO -1532046 +#define SAY_JULIANNE_ENTER -1532047 +#define SAY_JULIANNE_DEATH01 -1532048 +#define SAY_JULIANNE_DEATH02 -1532049 +#define SAY_JULIANNE_RESURRECT -1532050 +#define SAY_JULIANNE_SLAY -1532051 + +#define SAY_ROMULO_AGGRO -1532052 +#define SAY_ROMULO_DEATH -1532053 +#define SAY_ROMULO_ENTER -1532054 +#define SAY_ROMULO_RESURRECT -1532055 +#define SAY_ROMULO_SLAY -1532056 + +/***** Spells For Julianne *****/ +#define SPELL_BLINDING_PASSION 30890 +#define SPELL_DEVOTION 30887 +#define SPELL_ETERNAL_AFFECTION 30878 +#define SPELL_POWERFUL_ATTRACTION 30889 +#define SPELL_DRINK_POISON 30907 + +/***** Spells For Romulo ****/ +#define SPELL_BACKWARD_LUNGE 30815 +#define SPELL_DARING 30841 +#define SPELL_DEADLY_SWATHE 30817 +#define SPELL_POISON_THRUST 30822 + +/**** Other Misc. Spells ****/ +#define SPELL_UNDYING_LOVE 30951 +#define SPELL_RES_VISUAL 24171 + +/*** Misc. Information ****/ +#define CREATURE_ROMULO 17533 +#define ROMULO_X -10900 +#define ROMULO_Y -1758 + +enum RAJPhase +{ + PHASE_JULIANNE = 0, + PHASE_ROMULO = 1, + PHASE_BOTH = 2, +}; + +void PretendToDie(Creature* pCreature) +{ + pCreature->InterruptNonMeleeSpells(true); + pCreature->RemoveAllAuras(); + pCreature->SetHealth(0); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pCreature->GetMotionMaster()->MovementExpired(false); + pCreature->GetMotionMaster()->MoveIdle(); + pCreature->SetStandState(UNIT_STAND_STATE_DEAD); +}; + +void Resurrect(Creature* target) +{ + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + target->SetHealth(target->GetMaxHealth()); + target->SetStandState(UNIT_STAND_STATE_STAND); + target->CastSpell(target, SPELL_RES_VISUAL, true); + if (target->getVictim()) + { + target->GetMotionMaster()->MoveChase(target->getVictim()); + target->AI()->AttackStart(target->getVictim()); + } + else + target->GetMotionMaster()->Initialize(); +}; + +struct MANGOS_DLL_DECL boss_julianneAI : public ScriptedAI +{ + boss_julianneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + EntryYellTimer = 1000; + AggroYellTimer = 10000; + IsFakingDeath = false; + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 EntryYellTimer; + uint32 AggroYellTimer; + + uint64 RomuloGUID; + uint32 Phase; + + uint32 BlindingPassionTimer; + uint32 DevotionTimer; + uint32 EternalAffectionTimer; + uint32 PowerfulAttractionTimer; + uint32 SummonRomuloTimer; + uint32 ResurrectTimer; + uint32 DrinkPoisonTimer; + uint32 ResurrectSelfTimer; + + bool IsFakingDeath; + bool SummonedRomulo; + bool RomuloDead; + + void Reset() + { + RomuloGUID = 0; + Phase = PHASE_JULIANNE; + + BlindingPassionTimer = 30000; + DevotionTimer = 15000; + EternalAffectionTimer = 25000; + PowerfulAttractionTimer = 5000; + SummonRomuloTimer = 10000; + ResurrectTimer = 10000; + DrinkPoisonTimer = 0; + ResurrectSelfTimer = 0; + + if (IsFakingDeath) + { + Resurrect(m_creature); + IsFakingDeath = false; + } + + SummonedRomulo = false; + RomuloDead = false; + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void SpellHit(Unit* caster, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_DRINK_POISON) + { + DoScriptText(SAY_JULIANNE_DEATH01, m_creature); + DrinkPoisonTimer = 2500; + } + } + + void DamageTaken(Unit* done_by, uint32 &damage); + + void JustDied(Unit* killer) + { + DoScriptText(SAY_JULIANNE_DEATH02, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_OPERA, DONE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_JULIANNE_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff); +}; + +struct MANGOS_DLL_DECL boss_romuloAI : public ScriptedAI +{ + boss_romuloAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + EntryYellTimer = 8000; + AggroYellTimer = 15000; + } + + ScriptedInstance* m_pInstance; + + uint64 JulianneGUID; + uint32 Phase; + + uint32 EntryYellTimer; + uint32 AggroYellTimer; + uint32 BackwardLungeTimer; + uint32 DaringTimer; + uint32 DeadlySwatheTimer; + uint32 PoisonThrustTimer; + uint32 ResurrectTimer; + + bool IsFakingDeath; + bool JulianneDead; + + void Reset() + { + JulianneGUID = 0; + Phase = PHASE_ROMULO; + + BackwardLungeTimer = 15000; + DaringTimer = 20000; + DeadlySwatheTimer = 25000; + PoisonThrustTimer = 10000; + ResurrectTimer = 10000; + + IsFakingDeath = false; + JulianneDead = false; + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void DamageTaken(Unit* done_by, uint32 &damage); + + void Aggro(Unit* who) + { + DoScriptText(SAY_ROMULO_AGGRO, m_creature); + + if (JulianneGUID) + { + Creature* Julianne = m_creature->GetMap()->GetCreature(JulianneGUID); + + if (Julianne && Julianne->getVictim()) + m_creature->AddThreat(Julianne->getVictim()); + } + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_ROMULO_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_OPERA, DONE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_ROMULO_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff); +}; + +void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage) +{ + if (damage < m_creature->GetHealth()) + return; + + //anything below only used if incoming damage will kill + + if (Phase == PHASE_JULIANNE) + { + damage = 0; + + //this means already drinking, so return + if (IsFakingDeath) + return; + + m_creature->InterruptNonMeleeSpells(true); + DoCastSpellIfCan(m_creature, SPELL_DRINK_POISON); + + IsFakingDeath = true; + return; + } + + if (Phase == PHASE_ROMULO) + { + error_log("SD2: boss_julianneAI: cannot take damage in PHASE_ROMULO, why was i here?"); + damage = 0; + return; + } + + if (Phase == PHASE_BOTH) + { + //if this is true then we have to kill romulo too + if (RomuloDead) + { + if (Creature* Romulo = m_creature->GetMap()->GetCreature(RomuloGUID)) + { + Romulo->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Romulo->GetMotionMaster()->Clear(); + Romulo->SetDeathState(JUST_DIED); + Romulo->CombatStop(true); + Romulo->DeleteThreatList(); + Romulo->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + return; + } + + //if not already returned, then romulo is alive and we can pretend die + if (Creature* Romulo = m_creature->GetMap()->GetCreature(RomuloGUID)) + { + PretendToDie(m_creature); + IsFakingDeath = true; + + if (boss_romuloAI* pRomAI = dynamic_cast(Romulo->AI())) + { + pRomAI->ResurrectTimer = 10000; + pRomAI->JulianneDead = true; + } + + damage = 0; + return; + } + } + + error_log("SD2: boss_julianneAI: DamageTaken reach end of code, that should not happen."); +} + +void boss_romuloAI::DamageTaken(Unit* done_by, uint32 &damage) +{ + if (damage < m_creature->GetHealth()) + return; + + //anything below only used if incoming damage will kill + + if (Phase == PHASE_ROMULO) + { + DoScriptText(SAY_ROMULO_DEATH, m_creature); + PretendToDie(m_creature); + IsFakingDeath = true; + Phase = PHASE_BOTH; + + if (Creature* Julianne = m_creature->GetMap()->GetCreature(JulianneGUID)) + { + if (boss_julianneAI* pJulAI = dynamic_cast(Julianne->AI())) + { + pJulAI->ResurrectSelfTimer = 10000; + pJulAI->RomuloDead = true; + } + } + + damage = 0; + return; + } + + if (Phase == PHASE_BOTH) + { + if (JulianneDead) + { + if (Creature* Julianne = m_creature->GetMap()->GetCreature(JulianneGUID)) + { + Julianne->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Julianne->GetMotionMaster()->Clear(); + Julianne->SetDeathState(JUST_DIED); + Julianne->CombatStop(true); + Julianne->DeleteThreatList(); + Julianne->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + return; + } + + if (Creature* Julianne = m_creature->GetMap()->GetCreature(JulianneGUID)) + { + PretendToDie(m_creature); + IsFakingDeath = true; + + if (boss_julianneAI* pJulAI = dynamic_cast(Julianne->AI())) + { + pJulAI->ResurrectTimer = 10000; + pJulAI->RomuloDead = true; + } + + damage = 0; + return; + } + } + + error_log("SD2: boss_romuloAI: DamageTaken reach end of code, that should not happen."); +} + +void boss_julianneAI::UpdateAI(const uint32 diff) +{ + if (EntryYellTimer) + { + if (EntryYellTimer <= diff) + { + DoScriptText(SAY_JULIANNE_ENTER, m_creature); + EntryYellTimer = 0; + }else EntryYellTimer -= diff; + } + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + DoScriptText(SAY_JULIANNE_AGGRO, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->setFaction(16); + AggroYellTimer = 0; + }else AggroYellTimer -= diff; + } + + if (DrinkPoisonTimer) + { + //will do this 2secs after spell hit. this is time to display visual as expected + if (DrinkPoisonTimer <= diff) + { + PretendToDie(m_creature); + Phase = PHASE_ROMULO; + SummonRomuloTimer = 10000; + DrinkPoisonTimer = 0; + }else DrinkPoisonTimer -= diff; + } + + if (Phase == PHASE_ROMULO && !SummonedRomulo) + { + if (SummonRomuloTimer < diff) + { + if (Creature* pRomulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS)) + { + RomuloGUID = pRomulo->GetGUID(); + + if (boss_romuloAI* pRomAI = dynamic_cast(pRomulo->AI())) + { + pRomAI->JulianneGUID = m_creature->GetGUID(); + pRomAI->Phase = PHASE_ROMULO; + } + + pRomulo->SetInCombatWithZone(); + + //why? + pRomulo->setFaction(16); + } + SummonedRomulo = true; + }else SummonRomuloTimer -= diff; + } + + if (ResurrectSelfTimer) + { + if (ResurrectSelfTimer <= diff) + { + Resurrect(m_creature); + Phase = PHASE_BOTH; + IsFakingDeath = false; + + if (m_creature->getVictim()) + AttackStart(m_creature->getVictim()); + + ResurrectSelfTimer = 0; + ResurrectTimer = 1000; + }else ResurrectSelfTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || IsFakingDeath) + return; + + if (RomuloDead) + { + if (ResurrectTimer < diff) + { + Creature* pRomulo = m_creature->GetMap()->GetCreature(RomuloGUID); + boss_romuloAI* pRomAI = dynamic_cast(pRomulo->AI()); + + if (pRomulo && pRomAI && pRomAI->IsFakingDeath) + { + DoScriptText(SAY_JULIANNE_RESURRECT, m_creature); + Resurrect(pRomulo); + + pRomAI->IsFakingDeath = false; + + RomuloDead = false; + ResurrectTimer = 10000; + } + }else ResurrectTimer -= diff; + } + + if (BlindingPassionTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_BLINDING_PASSION); + + BlindingPassionTimer = urand(30000, 45000); + } else BlindingPassionTimer -= diff; + + if (DevotionTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_DEVOTION); + DevotionTimer = urand(15000, 45000); + } else DevotionTimer -= diff; + + if (PowerfulAttractionTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_POWERFUL_ATTRACTION); + + PowerfulAttractionTimer = urand(5000, 30000); + } else PowerfulAttractionTimer -= diff; + + if (EternalAffectionTimer < diff) + { + if (urand(0, 1) && SummonedRomulo) + { + Creature* Romulo = m_creature->GetMap()->GetCreature(RomuloGUID); + if (Romulo && Romulo->isAlive() && !RomuloDead) + DoCastSpellIfCan(Romulo, SPELL_ETERNAL_AFFECTION); + } else DoCastSpellIfCan(m_creature, SPELL_ETERNAL_AFFECTION); + + EternalAffectionTimer = urand(45000, 60000); + } else EternalAffectionTimer -= diff; + + DoMeleeAttackIfReady(); +} + +void boss_romuloAI::UpdateAI(const uint32 diff) +{ + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || IsFakingDeath) + return; + + if (JulianneDead) + { + if (ResurrectTimer < diff) + { + Creature* pJulianne = m_creature->GetMap()->GetCreature(JulianneGUID); + boss_julianneAI* pJulAI = dynamic_cast(pJulianne->AI()); + + if (pJulianne && pJulAI && pJulAI->IsFakingDeath) + { + DoScriptText(SAY_ROMULO_RESURRECT, m_creature); + Resurrect(pJulianne); + + pJulAI->IsFakingDeath = false; + + JulianneDead = false; + ResurrectTimer = 10000; + } + } else ResurrectTimer -= diff; + } + + if (BackwardLungeTimer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + if (target && !m_creature->HasInArc(M_PI_F, target)) + { + DoCastSpellIfCan(target, SPELL_BACKWARD_LUNGE); + BackwardLungeTimer = urand(15000, 30000); + } + }else BackwardLungeTimer -= diff; + + if (DaringTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_DARING); + DaringTimer = urand(20000, 40000); + }else DaringTimer -= diff; + + if (DeadlySwatheTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_DEADLY_SWATHE); + + DeadlySwatheTimer = urand(15000, 25000); + }else DeadlySwatheTimer -= diff; + + if (PoisonThrustTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_POISON_THRUST); + PoisonThrustTimer = urand(10000, 20000); + }else PoisonThrustTimer -= diff; + + DoMeleeAttackIfReady(); +} + +CreatureAI* GetAI_boss_julianne(Creature* pCreature) +{ + return new boss_julianneAI(pCreature); +} + +CreatureAI* GetAI_boss_romulo(Creature* pCreature) +{ + return new boss_romuloAI(pCreature); +} + +void AddSC_bosses_opera() +{ + Script* newscript; + + // Oz + newscript = new Script; + newscript->GetAI = &GetAI_boss_dorothee; + newscript->Name = "boss_dorothee"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_strawman; + newscript->Name = "boss_strawman"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_tinhead; + newscript->Name = "boss_tinhead"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_roar; + newscript->Name = "boss_roar"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_crone; + newscript->Name = "boss_crone"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_tito; + newscript->Name = "mob_tito"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_mob_cyclone; + newscript->Name = "mob_cyclone"; + newscript->RegisterSelf(); + + // Hood + newscript = new Script; + newscript->pGossipHello = &GossipHello_npc_grandmother; + newscript->pGossipSelect = &GossipSelect_npc_grandmother; + newscript->Name = "npc_grandmother"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_bigbadwolf; + newscript->Name = "boss_bigbadwolf"; + newscript->RegisterSelf(); + + // Romeo And Juliet + newscript = new Script; + newscript->GetAI = &GetAI_boss_julianne; + newscript->Name = "boss_julianne"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_romulo; + newscript->Name = "boss_romulo"; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp b/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp new file mode 100644 index 0000000..5fb9a9e --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp @@ -0,0 +1,297 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Karazhan +SD%Complete: 70 +SDComment: Instance Script for Karazhan to help in various encounters. TODO: GameObject visibility for Opera event. +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.h" +#include "karazhan.h" + +/* +0 - Attumen + Midnight (optional) +1 - Moroes +2 - Maiden of Virtue (optional) +3 - Hyakiss the Lurker / Rokad the Ravager / Shadikith the Glider +4 - Opera Event +5 - Curator +6 - Shade of Aran (optional) +7 - Terestian Illhoof (optional) +8 - Netherspite (optional) +9 - Chess Event +10 - Prince Malchezzar +11 - Nightbane +*/ + +struct MANGOS_DLL_DECL instance_karazhan : public ScriptedInstance +{ + instance_karazhan(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint32 m_uiOperaEvent; + uint32 m_uiOzDeathCount; + + uint64 m_uiCurtainGUID; + uint64 m_uiStageDoorLeftGUID; + uint64 m_uiStageDoorRightGUID; + uint64 m_uiTerestianGUID; + uint64 m_uiMoroesGUID; + uint64 m_uiLibraryDoor; // Door at Shade of Aran + uint64 m_uiMassiveDoor; // Door at Netherspite + uint64 m_uiSideEntranceDoor; // Side Entrance + uint64 m_uiGamesmansDoor; // Door before Chess + uint64 m_uiGamesmansExitDoor; // Door after Chess + uint64 m_uiNetherspaceDoor; // Door at Malchezaar + uint64 m_uiDustCoveredChest; // Chest respawn at event complete + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + // 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered. + m_uiOperaEvent = urand(EVENT_OZ,EVENT_RAJ); + m_uiOzDeathCount = 0; + + m_uiCurtainGUID = 0; + m_uiStageDoorLeftGUID = 0; + m_uiStageDoorRightGUID = 0; + + m_uiTerestianGUID = 0; + m_uiMoroesGUID = 0; + + m_uiLibraryDoor = 0; + m_uiMassiveDoor = 0; + m_uiSideEntranceDoor = 0; + m_uiGamesmansDoor = 0; + m_uiGamesmansExitDoor = 0; + m_uiNetherspaceDoor = 0; + m_uiDustCoveredChest = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch (pCreature->GetEntry()) + { + case 15688: m_uiTerestianGUID = pCreature->GetGUID(); break; + case 15687: m_uiMoroesGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 183932: m_uiCurtainGUID = pGo->GetGUID(); break; + case 184278: + m_uiStageDoorLeftGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 184279: + m_uiStageDoorRightGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 184517: m_uiLibraryDoor = pGo->GetGUID(); break; + case 185521: m_uiMassiveDoor = pGo->GetGUID(); break; + case 184276: m_uiGamesmansDoor = pGo->GetGUID(); break; + case 184277: m_uiGamesmansExitDoor = pGo->GetGUID(); break; + case 185134: m_uiNetherspaceDoor = pGo->GetGUID(); break; + case 184275: + m_uiSideEntranceDoor = pGo->GetGUID(); + if (m_auiEncounter[4] != DONE) + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + else + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + break; + case 185119: m_uiDustCoveredChest = pGo->GetGUID(); break; + } + + switch(m_uiOperaEvent) + { + //TODO: Set DoRespawnGameObject for Opera based on performance + case EVENT_OZ: + break; + case EVENT_HOOD: + break; + case EVENT_RAJ: + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_ATTUMEN: m_auiEncounter[0] = uiData; break; + case TYPE_MOROES: + if (m_auiEncounter[1] != DONE) + m_auiEncounter[1] = uiData; + break; + case TYPE_MAIDEN: m_auiEncounter[2] = uiData; break; + case TYPE_OPTIONAL_BOSS: m_auiEncounter[3] = uiData; break; + case TYPE_OPERA: + m_auiEncounter[4] = uiData; + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiStageDoorLeftGUID); + DoUseDoorOrButton(m_uiStageDoorRightGUID); + if (GameObject* pSideEntrance = instance->GetGameObject(m_uiSideEntranceDoor)) + pSideEntrance->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + } + break; + case TYPE_CURATOR: m_auiEncounter[5] = uiData; break; + case TYPE_ARAN: + m_auiEncounter[6] = uiData; + if (uiData != IN_PROGRESS) + DoUseDoorOrButton(m_uiLibraryDoor); + break; + case TYPE_TERESTIAN: m_auiEncounter[7] = uiData; break; + case TYPE_NETHERSPITE: + m_auiEncounter[8] = uiData; + DoUseDoorOrButton(m_uiMassiveDoor); + break; + case TYPE_CHESS: + if (uiData == DONE) + DoRespawnGameObject(m_uiDustCoveredChest,DAY); + m_auiEncounter[9] = uiData; + break; + case TYPE_MALCHEZZAR: m_auiEncounter[10] = uiData; break; + case TYPE_NIGHTBANE: m_auiEncounter[11] = uiData; break; + case DATA_OPERA_OZ_DEATHCOUNT: + if (uiData == SPECIAL) + ++m_uiOzDeathCount; + else if (uiData == IN_PROGRESS) + m_uiOzDeathCount = 0; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " " + << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + uint32 GetData(uint32 uiType) + { + switch (uiType) + { + case TYPE_ATTUMEN: return m_auiEncounter[0]; + case TYPE_MOROES: return m_auiEncounter[1]; + case TYPE_MAIDEN: return m_auiEncounter[2]; + case TYPE_OPTIONAL_BOSS: return m_auiEncounter[3]; + case TYPE_OPERA: return m_auiEncounter[4]; + case TYPE_CURATOR: return m_auiEncounter[5]; + case TYPE_ARAN: return m_auiEncounter[6]; + case TYPE_TERESTIAN: return m_auiEncounter[7]; + case TYPE_NETHERSPITE: return m_auiEncounter[8]; + case TYPE_CHESS: return m_auiEncounter[9]; + case TYPE_MALCHEZZAR: return m_auiEncounter[10]; + case TYPE_NIGHTBANE: return m_auiEncounter[11]; + case DATA_OPERA_PERFORMANCE: return m_uiOperaEvent; + case DATA_OPERA_OZ_DEATHCOUNT: return m_uiOzDeathCount; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch (uiData) + { + case DATA_TERESTIAN: return m_uiTerestianGUID; + case DATA_MOROES: return m_uiMoroesGUID; + case DATA_GO_STAGEDOORLEFT: return m_uiStageDoorLeftGUID; + case DATA_GO_STAGEDOORRIGHT: return m_uiStageDoorRightGUID; + case DATA_GO_CURTAINS: return m_uiCurtainGUID; + case DATA_GO_LIBRARY_DOOR: return m_uiLibraryDoor; + case DATA_GO_MASSIVE_DOOR: return m_uiMassiveDoor; + case DATA_GO_SIDE_ENTRANCE_DOOR: return m_uiSideEntranceDoor; + case DATA_GO_GAME_DOOR: return m_uiGamesmansDoor; + case DATA_GO_GAME_EXIT_DOOR: return m_uiGamesmansExitDoor; + case DATA_GO_NETHER_DOOR: return m_uiNetherspaceDoor; + } + + return 0; + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] + >> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_karazhan(Map* pMap) +{ + return new instance_karazhan(pMap); +} + +void AddSC_instance_karazhan() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_karazhan"; + newscript->GetInstanceData = &GetInstanceData_instance_karazhan; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/karazhan.cpp b/scripts/eastern_kingdoms/karazhan/karazhan.cpp new file mode 100644 index 0000000..90c709c --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/karazhan.cpp @@ -0,0 +1,433 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Karazhan +SD%Complete: 100 +SDComment: Support for Barnes (Opera controller) and Berthold (Doorman). +SDCategory: Karazhan +EndScriptData */ + +/* ContentData +npc_barnes +npc_berthold +EndContentData */ + +#include "precompiled.h" +#include "karazhan.h" +#include "escort_ai.h" + +/*###### +# npc_barnesAI +######*/ + +#define GOSSIP_READY "I'm not an actor." + +#define SAY_READY "Splendid, I'm going to get the audience ready. Break a leg!" +#define SAY_OZ_INTRO1 "Finally, everything is in place. Are you ready for your big stage debut?" +#define OZ_GOSSIP1 "I'm not an actor." +#define SAY_OZ_INTRO2 "Don't worry, you'll be fine. You look like a natural!" +#define OZ_GOSSIP2 "Ok, I'll give it a try, then." + +#define SAY_RAJ_INTRO1 "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?" +#define RAJ_GOSSIP1 "I've never been more ready." + +#define OZ_GM_GOSSIP1 "[GM] Change event to EVENT_OZ" +#define OZ_GM_GOSSIP2 "[GM] Change event to EVENT_HOOD" +#define OZ_GM_GOSSIP3 "[GM] Change event to EVENT_RAJ" + +struct Dialogue +{ + int32 iTextId; + uint32 uiTimer; +}; + +static Dialogue aOzDialogue[4]= +{ + {-1532103, 6000}, + {-1532104, 18000}, + {-1532105, 9000}, + {-1532106, 15000} +}; + +static Dialogue aHoodDialogue[4]= +{ + {-1532107, 6000}, + {-1532108, 10000}, + {-1532109, 14000}, + {-1532110, 15000} +}; + +static Dialogue aRAJDialogue[4]= +{ + {-1532111, 5000}, + {-1532112, 7000}, + {-1532113, 14000}, + {-1532114, 14000} +}; + +struct Spawn +{ + uint32 uiEntry; + float fPosX; +}; + +// Entries and spawn locations for creatures in Oz event +Spawn aSpawns_OZ[4]= +{ + {17535, -10896.0f}, // Dorothee + {17546, -10891.0f}, // Roar + {17547, -10884.0f}, // Tinhead + {17543, -10902.0f}, // Strawman +}; +Spawn Spawn_HOOD = {17603, -10892.0f}; // Grandmother +Spawn Spawn_RAJ = {17534, -10900.0f}; // Julianne + +enum +{ + NPC_SPOTLIGHT = 19525, + + SPELL_SPOTLIGHT = 25824, + SPELL_TUXEDO = 32616 +}; + +const float SPAWN_Z = 90.5f; +const float SPAWN_Y = -1758.0f; +const float SPAWN_O = 4.738f; + +struct MANGOS_DLL_DECL npc_barnesAI : public npc_escortAI +{ + npc_barnesAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bRaidWiped = false; + m_uiEventId = 0; + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 m_uiSpotlightGUID; + + uint32 m_uiTalkCount; + uint32 m_uiTalkTimer; + uint32 m_uiWipeTimer; + uint32 m_uiEventId; + + bool m_bPerformanceReady; + bool m_bRaidWiped; + + void Reset() + { + m_uiSpotlightGUID = 0; + + m_uiTalkCount = 0; + m_uiTalkTimer = 2000; + m_uiWipeTimer = 5000; + + m_bPerformanceReady = false; + + if (m_pInstance) + m_uiEventId = m_pInstance->GetData(DATA_OPERA_PERFORMANCE); + } + + void StartEvent() + { + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_OPERA, IN_PROGRESS); + + //resets count for this event, in case earlier failed + if (m_uiEventId == EVENT_OZ) + m_pInstance->SetData(DATA_OPERA_OZ_DEATHCOUNT, IN_PROGRESS); + + Start(false, 0, NULL, true); + } + + void WaypointReached(uint32 uiPointId) + { + if (!m_pInstance) + return; + + switch(uiPointId) + { + case 0: + m_creature->CastSpell(m_creature, SPELL_TUXEDO, false); + m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); + break; + case 4: + m_uiTalkCount = 0; + SetEscortPaused(true); + + if (Creature* pSpotlight = m_creature->SummonCreature(NPC_SPOTLIGHT, + m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0.0f, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) + { + pSpotlight->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pSpotlight->CastSpell(pSpotlight, SPELL_SPOTLIGHT, false); + m_uiSpotlightGUID = pSpotlight->GetGUID(); + } + break; + case 8: + m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); + m_bPerformanceReady = true; + break; + case 9: + PrepareEncounter(); + m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(DATA_GO_CURTAINS)); + break; + } + } + + void Talk(uint32 uiCount) + { + int32 iTextId = 0; + + switch(m_uiEventId) + { + case EVENT_OZ: + if (aOzDialogue[uiCount].iTextId) + iTextId = aOzDialogue[uiCount].iTextId; + if (aOzDialogue[uiCount].uiTimer) + m_uiTalkTimer = aOzDialogue[uiCount].uiTimer; + break; + + case EVENT_HOOD: + if (aHoodDialogue[uiCount].iTextId) + iTextId = aHoodDialogue[uiCount].iTextId; + if (aHoodDialogue[uiCount].uiTimer) + m_uiTalkTimer = aHoodDialogue[uiCount].uiTimer; + break; + + case EVENT_RAJ: + if (aRAJDialogue[uiCount].iTextId) + iTextId = aRAJDialogue[uiCount].iTextId; + if (aRAJDialogue[uiCount].uiTimer) + m_uiTalkTimer = aRAJDialogue[uiCount].uiTimer; + break; + } + + if (iTextId) + DoScriptText(iTextId, m_creature); + } + + void PrepareEncounter() + { + debug_log("SD2: Barnes Opera Event - Introduction complete - preparing encounter %d", m_uiEventId); + + switch(m_uiEventId) + { + case EVENT_OZ: + for(int i=0; i < 4; ++i) + m_creature->SummonCreature(aSpawns_OZ[i].uiEntry, aSpawns_OZ[i].fPosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS); + break; + case EVENT_HOOD: + m_creature->SummonCreature(Spawn_HOOD.uiEntry, Spawn_HOOD.fPosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS); + break; + case EVENT_RAJ: + m_creature->SummonCreature(Spawn_RAJ.uiEntry, Spawn_RAJ.fPosX, SPAWN_Y, SPAWN_Z, SPAWN_O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILLISECONDS); + break; + default: + error_log("SD2: Barnes Opera Event - Wrong EventId set: %d", m_uiEventId); + break; + } + + m_bRaidWiped = false; + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (m_uiTalkTimer < uiDiff) + { + if (m_uiTalkCount > 3) + { + if (Creature* pSpotlight = m_creature->GetMap()->GetCreature(m_uiSpotlightGUID)) + pSpotlight->ForcedDespawn(); + + SetEscortPaused(false); + return; + } + + Talk(m_uiTalkCount++); + } + else + m_uiTalkTimer -= uiDiff; + } + + if (m_bPerformanceReady) + { + if (!m_bRaidWiped) + { + if (m_uiWipeTimer < uiDiff) + { + Map *pMap = m_creature->GetMap(); + if (!pMap->IsDungeon()) + return; + + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (PlayerList.isEmpty()) + return; + + m_bRaidWiped = true; + for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && !i->getSource()->isGameMaster()) + { + m_bRaidWiped = false; + break; + } + } + + if (m_bRaidWiped) + EnterEvadeMode(); + + m_uiWipeTimer = 15000; + } + else + m_uiWipeTimer -= uiDiff; + } + } + } +}; + +CreatureAI* GetAI_npc_barnesAI(Creature* pCreature) +{ + return new npc_barnesAI(pCreature); +} + +bool GossipHello_npc_barnes(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + // Check for death of Moroes and if opera event is not done already + if (pInstance->GetData(TYPE_MOROES) == DONE && pInstance->GetData(TYPE_OPERA) != DONE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->isGameMaster()) // for GMs we add the possibility to change the event + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, OZ_GM_GOSSIP3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + } + + if (npc_barnesAI* pBarnesAI = dynamic_cast(pCreature->AI())) + { + if (!pBarnesAI->m_bRaidWiped) + pPlayer->SEND_GOSSIP_MENU(8970, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(8975, pCreature->GetGUID()); + + return true; + } + } + } + + pPlayer->SEND_GOSSIP_MENU(8978, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_barnes(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + npc_barnesAI* pBarnesAI = dynamic_cast(pCreature->AI()); + + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, OZ_GOSSIP2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(8971, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pBarnesAI) + pBarnesAI->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pBarnesAI && pPlayer->isGameMaster()) + pBarnesAI->m_uiEventId = EVENT_OZ; + outstring_log("SD2: pPlayer (GUID " UI64FMTD ") manually set Opera event to EVENT_OZ", pPlayer->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pBarnesAI && pPlayer->isGameMaster()) + pBarnesAI->m_uiEventId = EVENT_HOOD; + outstring_log("SD2: pPlayer (GUID " UI64FMTD ") manually set Opera event to EVENT_HOOD", pPlayer->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pBarnesAI && pPlayer->isGameMaster()) + pBarnesAI->m_uiEventId = EVENT_RAJ; + outstring_log("SD2: pPlayer (GUID " UI64FMTD ") manually set Opera event to EVENT_RAJ", pPlayer->GetGUID()); + break; + } + + return true; +} + +/*### +# npc_berthold +####*/ + +enum +{ + SPELL_TELEPORT = 39567 +}; + +#define GOSSIP_ITEM_TELEPORT "Teleport me to the Guardian's Library" + +bool GossipHello_npc_berthold(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + // Check if Shade of Aran event is done + if (pInstance->GetData(TYPE_ARAN) == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_berthold(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, true); + + pPlayer->CLOSE_GOSSIP_MENU(); + return true; +} + +void AddSC_karazhan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_barnes"; + newscript->GetAI = &GetAI_npc_barnesAI; + newscript->pGossipHello = &GossipHello_npc_barnes; + newscript->pGossipSelect = &GossipSelect_npc_barnes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_berthold"; + newscript->pGossipHello = &GossipHello_npc_berthold; + newscript->pGossipSelect = &GossipSelect_npc_berthold; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/karazhan/karazhan.h b/scripts/eastern_kingdoms/karazhan/karazhan.h new file mode 100644 index 0000000..c9fa18e --- /dev/null +++ b/scripts/eastern_kingdoms/karazhan/karazhan.h @@ -0,0 +1,64 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_KARAZHAN_H +#define DEF_KARAZHAN_H + +enum +{ + MAX_ENCOUNTER = 12, + + TYPE_ATTUMEN = 1, + TYPE_MOROES = 2, + TYPE_MAIDEN = 3, + TYPE_OPTIONAL_BOSS = 4, + TYPE_OPERA = 5, + TYPE_CURATOR = 6, + TYPE_ARAN = 7, + TYPE_TERESTIAN = 8, + TYPE_NETHERSPITE = 9, + TYPE_CHESS = 10, + TYPE_MALCHEZZAR = 11, + TYPE_NIGHTBANE = 12, + + DATA_OPERA_PERFORMANCE = 13, + DATA_OPERA_OZ_DEATHCOUNT = 14, + + DATA_TERESTIAN = 16, + DATA_MOROES = 17, + + DATA_GO_CURTAINS = 18, + DATA_GO_STAGEDOORLEFT = 19, + DATA_GO_STAGEDOORRIGHT = 20, + DATA_GO_LIBRARY_DOOR = 21, + DATA_GO_MASSIVE_DOOR = 22, + DATA_GO_NETHER_DOOR = 23, + DATA_GO_GAME_DOOR = 24, + DATA_GO_GAME_EXIT_DOOR = 25, + DATA_GO_SIDE_ENTRANCE_DOOR = 26 +}; + +enum OperaEvents +{ + EVENT_OZ = 1, + EVENT_HOOD = 2, + EVENT_RAJ = 3 +}; + +#define ERROR_INST_DATA(a) error_log("SD2: Instance Data for Karazhan not set properly. Encounter for Creature Entry %u may not work properly.", a->GetEntry()); + +class MANGOS_DLL_DECL npc_fiendish_portalAI : public ScriptedAI +{ + public: + npc_fiendish_portalAI(Creature* pCreature); + ~npc_fiendish_portalAI() {} + + void Reset(); + void JustSummoned(Creature* pSummoned); + void UpdateAI(const uint32 uiDiff); + + uint32 m_uiSummonTimer; +}; + +#endif diff --git a/scripts/eastern_kingdoms/loch_modan.cpp b/scripts/eastern_kingdoms/loch_modan.cpp new file mode 100644 index 0000000..f25ee07 --- /dev/null +++ b/scripts/eastern_kingdoms/loch_modan.cpp @@ -0,0 +1,195 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Loch_Modan +SD%Complete: 100 +SDComment: Quest support: 3181 (only to argue with pebblebitty to get to searing gorge, before quest rewarded), 309 +SDCategory: Loch Modan +EndScriptData */ + +/* ContentData +npc_mountaineer_pebblebitty +npc_miran +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_mountaineer_pebblebitty +######*/ + +bool GossipHello_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (!pPlayer->GetQuestRewardStatus(3181) == 1) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Open the gate please, i need to get to Searing Gorge", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_mountaineer_pebblebitty(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "But i need to get there, now open the gate!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1833, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok, so what is this other way?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(1834, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Doesn't matter, i'm invulnerable.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(1835, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(1836, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok, i'll try to remember that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(1837, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "A key? Ok!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(1838, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + return true; +} + +/*###### +## npc_miran +######*/ + +enum +{ + QUEST_PROTECTING_THE_SHIPMENT = 309, + + SAY_MIRAN_1 = -1000571, + SAY_DARK_IRON_DWARF = -1000572, + SAY_MIRAN_2 = -1000573, + SAY_MIRAN_3 = -1000574, + + NPC_DARK_IRON_DWARF = 2149 +}; + +struct Location +{ + float m_fX, m_fY, m_fZ, m_fO; +}; + +static const Location m_afAmbushSpawn[] = +{ + {-5691.93f,-3745.91f,319.159f, 2.21f}, + {-5706.98f,-3745.39f,318.728f, 1.04f} +}; + +struct MANGOS_DLL_DECL npc_miranAI: public npc_escortAI +{ + npc_miranAI(Creature* pCreature): npc_escortAI(pCreature) + { + Reset(); + } + + uint8 m_uiDwarves; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + m_uiDwarves = 0; + } + + void WaypointReached(uint32 uiPointId) + { + switch (uiPointId) + { + case 19: + DoScriptText(SAY_MIRAN_1, m_creature); + m_creature->SummonCreature(NPC_DARK_IRON_DWARF, m_afAmbushSpawn[0].m_fX, m_afAmbushSpawn[0].m_fY, m_afAmbushSpawn[0].m_fZ, m_afAmbushSpawn[0].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + m_creature->SummonCreature(NPC_DARK_IRON_DWARF, m_afAmbushSpawn[1].m_fX, m_afAmbushSpawn[1].m_fY, m_afAmbushSpawn[1].m_fZ, m_afAmbushSpawn[1].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + break; + case 23: + DoScriptText(SAY_MIRAN_3, m_creature); + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_PROTECTING_THE_SHIPMENT, m_creature); + break; + } + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_DARK_IRON_DWARF) + { + --m_uiDwarves; + if (!m_uiDwarves) + DoScriptText(SAY_MIRAN_2, m_creature); + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_DARK_IRON_DWARF) + { + if (!m_uiDwarves) + DoScriptText(SAY_DARK_IRON_DWARF, pSummoned); + ++m_uiDwarves; + pSummoned->AI()->AttackStart(m_creature); + } + } +}; + +bool QuestAccept_npc_miran(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_PROTECTING_THE_SHIPMENT) + { + if (npc_miranAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_miran(Creature* pCreature) +{ + return new npc_miranAI(pCreature); +} + +void AddSC_loch_modan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_mountaineer_pebblebitty"; + newscript->pGossipHello = &GossipHello_npc_mountaineer_pebblebitty; + newscript->pGossipSelect = &GossipSelect_npc_mountaineer_pebblebitty; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_miran"; + newscript->GetAI = &GetAI_npc_miran; + newscript->pQuestAccept = &QuestAccept_npc_miran; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp b/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp new file mode 100644 index 0000000..79d86d8 --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp @@ -0,0 +1,631 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Felblood_Kaelthas +SD%Complete: 80 +SDComment: Normal and Heroic Support. Issues: Arcane Spheres do not initially follow targets. +SDCategory: Magisters' Terrace +EndScriptData */ + +#include "precompiled.h" +#include "magisters_terrace.h" +#include "WorldPacket.h" + +#define SAY_AGGRO -1585023 //This yell should be done when the room is cleared. For now, set it as a movelineofsight yell. +#define SAY_PHOENIX -1585024 +#define SAY_FLAMESTRIKE -1585025 +#define SAY_GRAVITY_LAPSE -1585026 +#define SAY_TIRED -1585027 +#define SAY_RECAST_GRAVITY -1585028 +#define SAY_DEATH -1585029 + +/*** Spells ***/ + +// Phase 1 spells +#define SPELL_FIREBALL_NORMAL 44189 // Deals 2700-3300 damage at current target +#define SPELL_FIREBALL_HEROIC 46164 // 4950-6050 + +#define SPELL_PHOENIX 44194 // Summons a phoenix (Doesn't work?) +#define SPELL_PHOENIX_BURN 44197 // A spell Phoenix uses to damage everything around +#define SPELL_REBIRTH_DMG 44196 // DMG if a Phoenix rebirth happen + +#define SPELL_FLAME_STRIKE_DUMMY 44191 // Flamestrike indicator before the damage +#define SPELL_FLAME_STRIKE 44192 // Summons the trigger + animation (projectile) + +#define SPELL_SHOCK_BARRIER 46165 // Heroic only; 10k damage shield, followed by Pyroblast +#define SPELL_PYROBLAST 36819 // Heroic only; 45-55k fire damage + +// Phase 2 spells +#define SPELL_GRAVITY_LAPSE_INITIAL 44224 // Cast at the beginning of every Gravity Lapse +#define SPELL_GRAVITY_LAPSE_CHANNEL 44251 // Channeled; blue beam animation to every enemy in range +#define SPELL_TELEPORT_CENTER 44218 // Should teleport people to the center. Requires DB entry in spell_target_position. +#define SPELL_GRAVITY_LAPSE_FLY 44227 // Hastens flyspeed and allows flying for 1 minute. For some reason removes 44226. +#define SPELL_GRAVITY_LAPSE_DOT 44226 // Knocks up in the air and applies a 300 DPS DoT. +#define SPELL_ARCANE_SPHERE_PASSIVE 44263 // Passive auras on Arcane Spheres +#define SPELL_POWER_FEEDBACK 44233 // Stuns him, making him take 50% more damage for 10 seconds. Cast after Gravity Lapse + +/*** Creatures ***/ +#define NPC_FLAME_STRIKE_TRIGGER 24666 +#define CREATURE_PHOENIX 24674 +#define CREATURE_PHOENIX_EGG 24675 +#define CREATURE_ARCANE_SPHERE 24708 + +/** Locations **/ +float KaelLocations[3][2]= +{ + {148.744659f, 181.377426f}, + {140.823883f, 195.403046f}, + {156.574188f, 195.650482f}, +}; + +#define LOCATION_Z -16.727455f + +struct MANGOS_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI +{ + boss_felblood_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 FireballTimer; + uint32 PhoenixTimer; + uint32 FlameStrikeTimer; + uint32 CombatPulseTimer; + + //Heroic only + uint32 PyroblastTimer; + + uint32 GravityLapseTimer; + uint32 GravityLapsePhase; + // 0 = No Gravity Lapse + // 1 = Casting Gravity Lapse visual + // 2 = Teleported people to self + // 3 = Knocked people up in the air + // 4 = Applied an aura that allows them to fly, channeling visual, relased Arcane Orbs. + + bool FirstGravityLapse; + bool HasTaunted; + + uint8 Phase; + // 0 = Not started + // 1 = Fireball; Summon Phoenix; Flamestrike + // 2 = Gravity Lapses + + void Reset() + { + // TODO: Timers + FireballTimer = 0; + PhoenixTimer = 10000; + FlameStrikeTimer = 25000; + CombatPulseTimer = 0; + + PyroblastTimer = 60000; + + GravityLapseTimer = 0; + GravityLapsePhase = 0; + + FirstGravityLapse = true; + HasTaunted = false; + + Phase = 0; + + if (m_pInstance) + { + m_pInstance->SetData(DATA_KAELTHAS_EVENT, NOT_STARTED); + + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_DOOR))) + pDoor->SetGoState(GO_STATE_ACTIVE); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) + // Small door opened after event are expected to be closed by default + } + } + + void JustDied(Unit *killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + if (GameObject* pEncounterDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_DOOR))) + pEncounterDoor->SetGoState(GO_STATE_ACTIVE); // Open the encounter door + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth()) + RemoveGravityLapse(); // Remove Gravity Lapse so that players fall to ground if they kill him when in air. + } + + void Aggro(Unit *who) + { + if (!m_pInstance) + return; + + if (GameObject* pEncounterDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_DOOR))) + pEncounterDoor->SetGoState(GO_STATE_READY); //Close the encounter door, open it in JustDied/Reset + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 40.0)) + { + DoScriptText(SAY_AGGRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_FLAME_STRIKE_TRIGGER) + pSummoned->CastSpell(pSummoned, SPELL_FLAME_STRIKE_DUMMY, false, NULL, NULL, m_creature->GetGUID()); + } + + void SetThreatList(Creature* SummonedUnit) + { + if (!SummonedUnit) + return; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + { + float threat = m_creature->getThreatManager().getThreat(pUnit); + SummonedUnit->AddThreat(pUnit, threat); + } + } + } + + void TeleportPlayersToSelf() + { + float x = KaelLocations[0][0]; + float y = KaelLocations[0][1]; + + DoCastSpellIfCan(m_creature, SPELL_TELEPORT_CENTER, CAST_TRIGGERED); + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); + } + } + + void CastGravityLapseKnockUp() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + // Knockback into the air + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->GetGUID()); + } + } + + // players can't cast "fly" spells unless in map 530. Has to be done a while after they get knocked into the air... + void CastGravityLapseFly() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + // Also needs an exception in spell system. + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_FLY, true, 0, 0, m_creature->GetGUID()); + } + } + + void RemoveGravityLapse() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + { + pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_FLY); + pUnit->RemoveAurasDueToSpell(SPELL_GRAVITY_LAPSE_DOT); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + switch(Phase) + { + case 0: + { + // *Heroic mode only: + if (!m_bIsRegularMode) + { + if (PyroblastTimer < diff) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PYROBLAST); + PyroblastTimer = 60000; + }else PyroblastTimer -= diff; + } + + if (FireballTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FIREBALL_NORMAL : SPELL_FIREBALL_HEROIC); + FireballTimer = urand(2000, 6000); + }else FireballTimer -= diff; + + if (PhoenixTimer < diff) + { + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + { + uint32 random = urand(1, 2); + float x = KaelLocations[random][0]; + float y = KaelLocations[random][1]; + + if (Creature* Phoenix = m_creature->SummonCreature(CREATURE_PHOENIX, x, y, LOCATION_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000)) + { + Phoenix->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + SetThreatList(Phoenix); + Phoenix->AI()->AttackStart(pTarget); + DoScriptText(SAY_PHOENIX, m_creature); + } + } + + PhoenixTimer = 60000; + }else PhoenixTimer -= diff; + + if (FlameStrikeTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(pTarget, SPELL_FLAME_STRIKE); + DoScriptText(SAY_FLAMESTRIKE, m_creature); + } + FlameStrikeTimer = urand(15000, 25000); + }else FlameStrikeTimer -= diff; + + // Below 50% + if (m_creature->GetHealthPercent() < 50.0f) + { + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + GravityLapseTimer = 0; + GravityLapsePhase = 0; + Phase = 1; + } + + DoMeleeAttackIfReady(); + } + break; + + case 1: + { + if (GravityLapseTimer < diff) + { + switch(GravityLapsePhase) + { + case 0: + if (FirstGravityLapse) // Different yells at 50%, and at every following Gravity Lapse + { + DoScriptText(SAY_GRAVITY_LAPSE, m_creature); + FirstGravityLapse = false; + + if (m_pInstance) + { + if (GameObject* pKaelLeft = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_STATUE_LEFT))) + pKaelLeft->SetGoState(GO_STATE_ACTIVE); + + if (GameObject* pKaelRight = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_KAEL_STATUE_RIGHT))) + pKaelRight->SetGoState(GO_STATE_ACTIVE); + } + } + else + { + DoScriptText(SAY_RECAST_GRAVITY, m_creature); + } + + DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_INITIAL); + GravityLapseTimer = 2000 + diff;// Don't interrupt the visual spell + GravityLapsePhase = 1; + break; + + case 1: + TeleportPlayersToSelf(); + GravityLapseTimer = 1000; + GravityLapsePhase = 2; + break; + + case 2: + CastGravityLapseKnockUp(); + GravityLapseTimer = 1000; + GravityLapsePhase = 3; + break; + + case 3: + CastGravityLapseFly(); + GravityLapseTimer = 30000; + GravityLapsePhase = 4; + + + for(uint8 i = 0; i < 3; ++i) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000)) + Orb->AI()->AttackStart(pTarget); + } + } + + DoCastSpellIfCan(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL); + break; + + case 4: + m_creature->InterruptNonMeleeSpells(false); + DoScriptText(SAY_TIRED, m_creature); + DoCastSpellIfCan(m_creature, SPELL_POWER_FEEDBACK); + RemoveGravityLapse(); + GravityLapseTimer = 10000; + GravityLapsePhase = 0; + break; + } + }else GravityLapseTimer -= diff; + } + break; + } + } +}; + +struct MANGOS_DLL_DECL mob_felkael_phoenixAI : public ScriptedAI +{ + mob_felkael_phoenixAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + uint32 BurnTimer; + uint32 Death_Timer; + bool Rebirth; + bool FakeDeath; + + void Reset() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + m_creature->CastSpell(m_creature,SPELL_PHOENIX_BURN,true); + + BurnTimer = 2000; + Death_Timer = 3000; + Rebirth = false; + FakeDeath = false; + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage < m_creature->GetHealth()) + return; + + //Prevent glitch if in fake death + if (FakeDeath) + { + damage = 0; + return; + + } + //Don't really die in all phases of Kael'Thas + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHAS_EVENT) == 0) + { + //prevent death + damage = 0; + FakeDeath = true; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + } + + } + + void JustDied(Unit* slayer) + { + m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + } + + void UpdateAI(const uint32 diff) + { + + //If we are fake death, we cast revbirth and after that we kill the phoenix to spawn the egg. + if (FakeDeath) + { + if (!Rebirth) + { + DoCastSpellIfCan(m_creature, SPELL_REBIRTH_DMG); + Rebirth = true; + } + + if (Rebirth) + { + + if (Death_Timer < diff) + { + m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + Rebirth = false; + }else Death_Timer -= diff; + } + + + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (BurnTimer < diff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 dmg = urand(1650,2050); + m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false); + BurnTimer += 2000; + } BurnTimer -= diff; + + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_felkael_phoenix_eggAI : public ScriptedAI +{ + mob_felkael_phoenix_eggAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 HatchTimer; + + void Reset() + { + HatchTimer = 10000; + + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (HatchTimer < diff) + { + m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else HatchTimer -= diff; + + } +}; + +struct MANGOS_DLL_DECL mob_arcane_sphereAI : public ScriptedAI +{ + mob_arcane_sphereAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 DespawnTimer; + uint32 ChangeTargetTimer; + + void Reset() + { + DespawnTimer = 30000; + ChangeTargetTimer = urand(6000, 12000); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCastSpellIfCan(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, CAST_TRIGGERED); + } + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer < diff) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else DespawnTimer -= diff; + + if (!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + return; + + if (ChangeTargetTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + m_creature->TauntApply(pTarget); + AttackStart(pTarget); + } + + ChangeTargetTimer = urand(5000, 15000); + }else ChangeTargetTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_felblood_kaelthas(Creature* pCreature) +{ + return new boss_felblood_kaelthasAI(pCreature); +} + +CreatureAI* GetAI_mob_arcane_sphere(Creature* pCreature) +{ + return new mob_arcane_sphereAI(pCreature); +} + +CreatureAI* GetAI_mob_felkael_phoenix(Creature* pCreature) +{ + return new mob_felkael_phoenixAI(pCreature); +} + +CreatureAI* GetAI_mob_felkael_phoenix_egg(Creature* pCreature) +{ + return new mob_felkael_phoenix_eggAI(pCreature); +} + +void AddSC_boss_felblood_kaelthas() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_felblood_kaelthas"; + newscript->GetAI = &GetAI_boss_felblood_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_arcane_sphere"; + newscript->GetAI = &GetAI_mob_arcane_sphere; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felkael_phoenix"; + newscript->GetAI = &GetAI_mob_felkael_phoenix; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_felkael_phoenix_egg"; + newscript->GetAI = &GetAI_mob_felkael_phoenix_egg; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp b/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp new file mode 100644 index 0000000..f376112 --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp @@ -0,0 +1,1337 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Priestess_Delrissa +SD%Complete: 65 +SDComment: No Heroic support yet. Needs further testing. Several scripts for pets disabled, not seem to require any special script. +SDCategory: Magister's Terrace +EndScriptData */ + +#include "precompiled.h" +#include "magisters_terrace.h" + +struct Speech +{ + int32 id; +}; + +static Speech LackeyDeath[]= +{ + {-1585013}, + {-1585014}, + {-1585015}, + {-1585016}, +}; + +static Speech PlayerDeath[]= +{ + {-1585017}, + {-1585018}, + {-1585019}, + {-1585020}, + {-1585021}, +}; + +enum +{ + SAY_AGGRO = -1585012, + SAY_DEATH = -1585022, + + SPELL_DISPEL_MAGIC = 27609, + SPELL_FLASH_HEAL = 17843, + SPELL_SW_PAIN_NORMAL = 14032, + SPELL_SW_PAIN_HEROIC = 15654, + SPELL_SHIELD = 44291, + SPELL_RENEW_NORMAL = 44174, + SPELL_RENEW_HEROIC = 46192, + + MAX_ACTIVE_LACKEY = 4 +}; + +const float fOrientation = 4.98f; +const float fZLocation = -19.921f; + +float LackeyLocations[4][2]= +{ + {123.77f, 17.6007f}, + {131.731f, 15.0827f}, + {121.563f, 15.6213f}, + {129.988f, 17.2355f}, +}; + +const uint32 m_auiAddEntries[] = +{ + 24557, //Kagani Nightstrike + 24558, //Elris Duskhallow + 24554, //Eramas Brightblaze + 24561, //Yazzaj + 24559, //Warlord Salaris + 24555, //Garaxxas + 24553, //Apoko + 24556, //Zelfan +}; + +struct MANGOS_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI +{ + boss_priestess_delrissaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); + LackeyEntryList.clear(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + std::vector LackeyEntryList; + uint64 m_auiLackeyGUID[MAX_ACTIVE_LACKEY]; + + uint8 PlayersKilled; + + uint32 HealTimer; + uint32 RenewTimer; + uint32 ShieldTimer; + uint32 SWPainTimer; + uint32 DispelTimer; + + void Reset() + { + PlayersKilled = 0; + + HealTimer = 15000; + RenewTimer = 10000; + ShieldTimer = 2000; + SWPainTimer = 5000; + DispelTimer = 7500; + + InitializeLackeys(); + } + + //this mean she at some point evaded + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(DATA_DELRISSA_EVENT, FAIL); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUID[i])) + { + if (!pAdd->getVictim()) + { + pWho->SetInCombatWith(pAdd); + pAdd->AddThreat(pWho); + } + } + } + + if (m_pInstance) + m_pInstance->SetData(DATA_DELRISSA_EVENT, IN_PROGRESS); + } + + void InitializeLackeys() + { + //can be called if creature are dead, so avoid + if (!m_creature->isAlive()) + return; + + uint8 j = 0; + + //it's empty, so first time + if (LackeyEntryList.empty()) + { + //pre-allocate size for speed + LackeyEntryList.resize((sizeof(m_auiAddEntries) / sizeof(uint32))); + + //fill vector array with entries from creature array + for(uint8 i = 0; i < LackeyEntryList.size(); ++i) + LackeyEntryList[i] = m_auiAddEntries[i]; + + //remove random entries + while(LackeyEntryList.size() > MAX_ACTIVE_LACKEY) + LackeyEntryList.erase(LackeyEntryList.begin() + rand()%LackeyEntryList.size()); + + //summon all the remaining in vector + for(std::vector::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) + { + if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiLackeyGUID[j] = pAdd->GetGUID(); + + ++j; + } + } + else + { + for(std::vector::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) + { + Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUID[j]); + + //object already removed, not exist + if (!pAdd) + { + if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiLackeyGUID[j] = pAdd->GetGUID(); + } + ++j; + } + } + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(PlayerDeath[PlayersKilled].id, m_creature); + + if (PlayersKilled < 4) + ++PlayersKilled; + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + if (m_pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY) + m_pInstance->SetData(DATA_DELRISSA_EVENT, DONE); + else + { + if (m_creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (HealTimer < diff) + { + uint32 health = m_creature->GetHealth(); + Creature* target = m_creature; + + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUID[i])) + { + if (pAdd->isAlive() && pAdd->GetHealth() < health) + target = pAdd; + } + } + + DoCastSpellIfCan(target, SPELL_FLASH_HEAL); + HealTimer = 15000; + }else HealTimer -= diff; + + if (RenewTimer < diff) + { + Creature* target = m_creature; + + if (urand(0, 1)) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + { + if (pAdd->isAlive()) + target = pAdd; + } + } + + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_RENEW_NORMAL : SPELL_RENEW_HEROIC); + RenewTimer = 5000; + }else RenewTimer -= diff; + + if (ShieldTimer < diff) + { + Creature* target = m_creature; + + if (urand(0, 1)) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + { + if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD)) + target = pAdd; + } + } + + DoCastSpellIfCan(target, SPELL_SHIELD); + ShieldTimer = 7500; + }else ShieldTimer -= diff; + + if (DispelTimer < diff) + { + Unit* target = NULL; + bool friendly = false; + + if (urand(0, 1)) + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + else + { + friendly = true; + + if (urand(0, 1)) + target = m_creature; + else + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + { + if (pAdd->isAlive()) + target = pAdd; + } + } + } + + if (target) + DoCastSpellIfCan(target, SPELL_DISPEL_MAGIC); + + DispelTimer = 12000; + }else DispelTimer -= diff; + + if (SWPainTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SW_PAIN_NORMAL : SPELL_SW_PAIN_HEROIC); + + SWPainTimer = 10000; + }else SWPainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_priestess_delrissa(Creature* pCreature) +{ + return new boss_priestess_delrissaAI(pCreature); +} + +enum +{ + SPELL_HEALING_POTION = 15503 +}; + +//all 8 possible lackey use this common +struct MANGOS_DLL_DECL boss_priestess_lackey_commonAI : public ScriptedAI +{ + boss_priestess_lackey_commonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + memset(&m_auiLackeyGUIDs, 0, sizeof(m_auiLackeyGUIDs)); + Reset(); + AcquireGUIDs(); + } + + ScriptedInstance* m_pInstance; + + uint64 m_auiLackeyGUIDs[MAX_ACTIVE_LACKEY]; + uint32 m_uiResetThreatTimer; + bool m_bUsedPotion; + + void Reset() + { + m_bUsedPotion = false; + + // These guys does not follow normal threat system rules + // For later development, some alternative threat system should be made + // We do not know what this system is based upon, but one theory is class (healers=high threat, dps=medium, etc) + // We reset their threat frequently as an alternative until such a system exist + m_uiResetThreatTimer = urand(5000, 15000); + + // in case she is not alive and Reset was for some reason called, respawn her (most likely party wipe after killing her) + if (Creature* pDelrissa = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_DELRISSA))) + { + if (!pDelrissa->isAlive()) + pDelrissa->Respawn(); + } + } + + void EnterCombat(Unit* pWho) + { + if (!pWho) + return; + + if (m_pInstance) + { + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUIDs[i])) + { + if (!pAdd->getVictim() && pAdd != m_creature) + { + pWho->SetInCombatWith(pAdd); + pAdd->AddThreat(pWho); + } + } + } + + if (Creature* pDelrissa = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_DELRISSA))) + { + if (pDelrissa->isAlive() && !pDelrissa->getVictim()) + { + pWho->SetInCombatWith(pDelrissa); + pDelrissa->AddThreat(pWho); + } + } + } + + Aggro(pWho); + } + + void JustDied(Unit* pKiller) + { + if (!m_pInstance) + return; + + Creature* pDelrissa = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_DELRISSA)); + uint32 uiLackeyDeathCount = m_pInstance->GetData(DATA_DELRISSA_DEATH_COUNT); + + if (!pDelrissa) + return; + + //should delrissa really yell if dead? + DoScriptText(LackeyDeath[uiLackeyDeathCount].id, pDelrissa); + + m_pInstance->SetData(DATA_DELRISSA_DEATH_COUNT, SPECIAL); + + //increase local var, since we now may have four dead + ++uiLackeyDeathCount; + + if (uiLackeyDeathCount == MAX_ACTIVE_LACKEY) + { + //time to make her lootable and complete event if she died before lackeys + if (!pDelrissa->isAlive()) + { + if (!pDelrissa->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) + pDelrissa->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + m_pInstance->SetData(DATA_DELRISSA_EVENT, DONE); + } + } + } + + void KilledUnit(Unit* pVictim) + { + if (!m_pInstance) + return; + + if (Creature* pDelrissa = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_DELRISSA))) + pDelrissa->AI()->KilledUnit(pVictim); + } + + void AcquireGUIDs() + { + if (!m_pInstance) + return; + + if (Creature* pDelrissa = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_DELRISSA))) + { + boss_priestess_delrissaAI* pDelrissaAI = dynamic_cast(pDelrissa->AI()); + + if (!pDelrissaAI) + return; + + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + m_auiLackeyGUIDs[i] = pDelrissaAI->m_auiLackeyGUID[i]; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_bUsedPotion && m_creature->GetHealthPercent() < 25.0f) + { + DoCastSpellIfCan(m_creature, SPELL_HEALING_POTION); + m_bUsedPotion = true; + } + + if (m_uiResetThreatTimer < uiDiff) + { + DoResetThreat(); + m_uiResetThreatTimer = urand(5000, 15000); + }else m_uiResetThreatTimer -= uiDiff; + } +}; + +enum +{ + SPELL_KIDNEY_SHOT = 27615, + SPELL_GOUGE = 12540, + SPELL_KICK = 27613, + SPELL_VANISH = 44290, + SPELL_BACKSTAB = 15657, + SPELL_EVISCERATE = 27611 +}; + +struct MANGOS_DLL_DECL boss_kagani_nightstrikeAI : public boss_priestess_lackey_commonAI +{ + //Rogue + boss_kagani_nightstrikeAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + uint32 Gouge_Timer; + uint32 Kick_Timer; + uint32 Vanish_Timer; + uint32 Eviscerate_Timer; + uint32 Wait_Timer; + bool InVanish; + + void Reset() + { + Gouge_Timer = 5500; + Kick_Timer = 7000; + Vanish_Timer = 2000; + Eviscerate_Timer = 6000; + Wait_Timer = 5000; + InVanish = false; + m_creature->SetVisibility(VISIBILITY_ON); + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Vanish_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_VANISH); + + Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + DoResetThreat(); + + if (pUnit) + m_creature->AddThreat(pUnit, 1000.0f); + + InVanish = true; + Vanish_Timer = 30000; + Wait_Timer = 10000; + }else Vanish_Timer -= diff; + + if (InVanish) + { + if (Wait_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BACKSTAB, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_KIDNEY_SHOT, CAST_TRIGGERED); + m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike + InVanish = false; + }else Wait_Timer -= diff; + } + + if (Gouge_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GOUGE); + Gouge_Timer = 5500; + }else Gouge_Timer -= diff; + + if (Kick_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_KICK); + Kick_Timer = 7000; + }else Kick_Timer -= diff; + + if (Eviscerate_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_EVISCERATE); + Eviscerate_Timer = 4000; + }else Eviscerate_Timer -= diff; + + if (!InVanish) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_kagani_nightstrike(Creature* pCreature) +{ + return new boss_kagani_nightstrikeAI(pCreature); +} + +enum +{ + SPELL_IMMOLATE = 44267, + SPELL_SHADOW_BOLT = 12471, + SPELL_SEED_OF_CORRUPTION = 44141, + SPELL_CURSE_OF_AGONY = 14875, + SPELL_FEAR = 38595, + SPELL_IMP_FIREBALL = 44164, + SPELL_SUMMON_IMP = 44163 +}; + +struct MANGOS_DLL_DECL boss_ellris_duskhallowAI : public boss_priestess_lackey_commonAI +{ + //Warlock + boss_ellris_duskhallowAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + uint32 Immolate_Timer; + uint32 Shadow_Bolt_Timer; + uint32 Seed_of_Corruption_Timer; + uint32 Curse_of_Agony_Timer; + uint32 Fear_Timer; + + void Reset() + { + Immolate_Timer = 6000; + Shadow_Bolt_Timer = 3000; + Seed_of_Corruption_Timer = 2000; + Curse_of_Agony_Timer = 1000; + Fear_Timer = 10000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void Aggro(Unit* pWho) + { + DoCastSpellIfCan(m_creature,SPELL_SUMMON_IMP); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Immolate_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_IMMOLATE); + Immolate_Timer = 6000; + }else Immolate_Timer -= diff; + + if (Shadow_Bolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOW_BOLT); + Shadow_Bolt_Timer = 5000; + }else Shadow_Bolt_Timer -= diff; + + if (Seed_of_Corruption_Timer < diff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_SEED_OF_CORRUPTION); + + Seed_of_Corruption_Timer = 10000; + }else Seed_of_Corruption_Timer -= diff; + + if (Curse_of_Agony_Timer < diff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_CURSE_OF_AGONY); + + Curse_of_Agony_Timer = 13000; + }else Curse_of_Agony_Timer -= diff; + + if (Fear_Timer < diff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_FEAR); + + Fear_Timer = 10000; + }else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_ellris_duskhallow(Creature* pCreature) +{ + return new boss_ellris_duskhallowAI(pCreature); +} + +enum +{ + SPELL_KNOCKDOWN = 11428, + SPELL_SNAP_KICK = 46182 +}; + +struct MANGOS_DLL_DECL boss_eramas_brightblazeAI : public boss_priestess_lackey_commonAI +{ + //Monk + boss_eramas_brightblazeAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + uint32 Knockdown_Timer; + uint32 Snap_Kick_Timer; + + void Reset() + { + Knockdown_Timer = 6000; + Snap_Kick_Timer = 4500; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Knockdown_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = 6000; + }else Knockdown_Timer -= diff; + + if (Snap_Kick_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SNAP_KICK); + Snap_Kick_Timer = 4500; + }else Snap_Kick_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_eramas_brightblaze(Creature* pCreature) +{ + return new boss_eramas_brightblazeAI(pCreature); +} + +enum +{ + SPELL_POLYMORPH = 13323, + SPELL_ICE_BLOCK = 27619, + SPELL_BLIZZARD = 44178, + SPELL_ICE_LANCE = 46194, + SPELL_CONE_OF_COLD = 38384, + SPELL_FROSTBOLT = 15043, + SPELL_BLINK = 14514 +}; + +struct MANGOS_DLL_DECL boss_yazzaiAI : public boss_priestess_lackey_commonAI +{ + //Mage + boss_yazzaiAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + bool HasIceBlocked; + + uint32 Polymorph_Timer; + uint32 Ice_Block_Timer; + uint32 Wait_Timer; + uint32 Blizzard_Timer; + uint32 Ice_Lance_Timer; + uint32 Cone_of_Cold_Timer; + uint32 Frostbolt_Timer; + uint32 Blink_Timer; + + void Reset() + { + HasIceBlocked = false; + + Polymorph_Timer = 1000; + Ice_Block_Timer = 20000; + Wait_Timer = 10000; + Blizzard_Timer = 8000; + Ice_Lance_Timer = 12000; + Cone_of_Cold_Timer = 10000; + Frostbolt_Timer = 3000; + Blink_Timer = 8000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Polymorph_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, SPELL_POLYMORPH); + Polymorph_Timer = 20000; + } + }else Polymorph_Timer -= diff; + + if (m_creature->GetHealthPercent() < 35.0f && !HasIceBlocked) + { + DoCastSpellIfCan(m_creature, SPELL_ICE_BLOCK); + HasIceBlocked = true; + } + + if (Blizzard_Timer < diff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_BLIZZARD); + + Blizzard_Timer = 8000; + }else Blizzard_Timer -= diff; + + if (Ice_Lance_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ICE_LANCE); + Ice_Lance_Timer = 12000; + }else Ice_Lance_Timer -= diff; + + if (Cone_of_Cold_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONE_OF_COLD); + Cone_of_Cold_Timer = 10000; + }else Cone_of_Cold_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROSTBOLT); + Frostbolt_Timer = 8000; + }else Frostbolt_Timer -= diff; + + if (Blink_Timer < diff) + { + bool InMeleeRange = false; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + if (Unit* target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid())) + { + //if in melee range + if (target->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + break; + } + } + } + + //if anybody is in melee range than escape by blink + if (InMeleeRange) + DoCastSpellIfCan(m_creature, SPELL_BLINK); + + Blink_Timer = 8000; + }else Blink_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_yazzai(Creature* pCreature) +{ + return new boss_yazzaiAI(pCreature); +} + +enum +{ + SPELL_INTERCEPT_STUN = 27577, + SPELL_DISARM = 27581, + SPELL_PIERCING_HOWL = 23600, + SPELL_FRIGHTENING_SHOUT = 19134, + SPELL_HAMSTRING = 27584, + SPELL_BATTLE_SHOUT = 27578, + SPELL_MORTAL_STRIKE = 44268 +}; + +struct MANGOS_DLL_DECL boss_warlord_salarisAI : public boss_priestess_lackey_commonAI +{ + //Warrior + boss_warlord_salarisAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + uint32 Intercept_Stun_Timer; + uint32 Disarm_Timer; + uint32 Piercing_Howl_Timer; + uint32 Frightening_Shout_Timer; + uint32 Hamstring_Timer; + uint32 Mortal_Strike_Timer; + + void Reset() + { + Intercept_Stun_Timer = 500; + Disarm_Timer = 6000; + Piercing_Howl_Timer = 10000; + Frightening_Shout_Timer = 18000; + Hamstring_Timer = 4500; + Mortal_Strike_Timer = 8000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void Aggro(Unit* who) + { + DoCastSpellIfCan(m_creature, SPELL_BATTLE_SHOUT); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Intercept_Stun_Timer < diff) + { + bool InMeleeRange = false; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + if (Unit* target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid())) + { + //if in melee range + if (target->IsWithinDistInMap(m_creature, ATTACK_DISTANCE)) + { + InMeleeRange = true; + break; + } + } + } + + //if nobody is in melee range than try to use Intercept + if (!InMeleeRange) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_INTERCEPT_STUN); + } + + Intercept_Stun_Timer = 10000; + }else Intercept_Stun_Timer -= diff; + + if (Disarm_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DISARM); + Disarm_Timer = 6000; + }else Disarm_Timer -= diff; + + if (Hamstring_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAMSTRING); + Hamstring_Timer = 4500; + }else Hamstring_Timer -= diff; + + if (Mortal_Strike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Mortal_Strike_Timer = 4500; + }else Mortal_Strike_Timer -= diff; + + if (Piercing_Howl_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PIERCING_HOWL); + Piercing_Howl_Timer = 10000; + }else Piercing_Howl_Timer -= diff; + + if (Frightening_Shout_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); + Frightening_Shout_Timer = 18000; + }else Frightening_Shout_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_warlord_salaris(Creature* pCreature) +{ + return new boss_warlord_salarisAI(pCreature); +} + +enum +{ + SPELL_AIMED_SHOT = 44271, + SPELL_SHOOT = 15620, + SPELL_CONCUSSIVE_SHOT = 27634, + SPELL_MULTI_SHOT = 31942, + SPELL_WING_CLIP = 44286, + SPELL_FREEZING_TRAP = 44136, + + NPC_SLIVER = 24552 +}; + +struct MANGOS_DLL_DECL boss_garaxxasAI : public boss_priestess_lackey_commonAI +{ + //Hunter + boss_garaxxasAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) + { + SetCombatMovement(false); + m_uiPetGUID = 0; + Reset(); + } + + uint64 m_uiPetGUID; + + uint32 Aimed_Shot_Timer; + uint32 Shoot_Timer; + uint32 Concussive_Shot_Timer; + uint32 Multi_Shot_Timer; + uint32 Wing_Clip_Timer; + uint32 Freezing_Trap_Timer; + + void Reset() + { + Aimed_Shot_Timer = 6000; + Shoot_Timer = 2500; + Concussive_Shot_Timer = 8000; + Multi_Shot_Timer = 10000; + Wing_Clip_Timer = 4000; + Freezing_Trap_Timer = 15000; + + Creature* pPet = m_creature->GetMap()->GetCreature(m_uiPetGUID); + if (!pPet) + m_creature->SummonCreature(NPC_SLIVER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + + boss_priestess_lackey_commonAI::Reset(); + } + + void JustSummoned(Creature* pSummoned) + { + m_uiPetGUID = pSummoned->GetGUID(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + if (Wing_Clip_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WING_CLIP); + Wing_Clip_Timer = 4000; + }else Wing_Clip_Timer -= diff; + + if (Freezing_Trap_Timer < diff) + { + //attempt find go summoned from spell (casted by m_creature) + GameObject* pGo = m_creature->GetGameObject(SPELL_FREEZING_TRAP); + + //if we have a pGo, we need to wait (only one trap at a time) + if (pGo) + Freezing_Trap_Timer = 2500; + else + { + //if pGo does not exist, then we can cast + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Freezing_Trap_Timer = 15000; + } + }else Freezing_Trap_Timer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (Concussive_Shot_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT); + Concussive_Shot_Timer = 8000; + }else Concussive_Shot_Timer -= diff; + + if (Multi_Shot_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MULTI_SHOT); + Multi_Shot_Timer = 10000; + }else Multi_Shot_Timer -= diff; + + if (Aimed_Shot_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_AIMED_SHOT); + Aimed_Shot_Timer = 6000; + }else Aimed_Shot_Timer -= diff; + + if (Shoot_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHOOT); + Shoot_Timer = 2500; + }else Shoot_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_garaxxas(Creature* pCreature) +{ + return new boss_garaxxasAI(pCreature); +} + +enum +{ + SPELL_WINDFURY_TOTEM = 27621, + SPELL_WAR_STOMP = 46026, + SPELL_PURGE = 27626, + SPELL_LESSER_HEALING_WAVE = 44256, + SPELL_FROST_SHOCK = 21401, + SPELL_FIRE_NOVA_TOTEM = 44257, + SPELL_EARTHBIND_TOTEM = 15786 +}; + +struct MANGOS_DLL_DECL boss_apokoAI : public boss_priestess_lackey_commonAI +{ + //Shaman + boss_apokoAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + uint32 Totem_Timer; + uint8 Totem_Amount; + uint32 War_Stomp_Timer; + uint32 Purge_Timer; + uint32 Healing_Wave_Timer; + uint32 Frost_Shock_Timer; + + void Reset() + { + Totem_Timer = 2000; + Totem_Amount = 1; + War_Stomp_Timer = 10000; + Purge_Timer = 8000; + Healing_Wave_Timer = 5000; + Frost_Shock_Timer = 7000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Totem_Timer < diff) + { + switch(urand(0, 2)) + { + case 0: DoCastSpellIfCan(m_creature, SPELL_WINDFURY_TOTEM); break; + case 1: DoCastSpellIfCan(m_creature, SPELL_FIRE_NOVA_TOTEM); break; + case 2: DoCastSpellIfCan(m_creature, SPELL_EARTHBIND_TOTEM); break; + } + ++Totem_Amount; + Totem_Timer = Totem_Amount*2000; + }else Totem_Timer -= diff; + + if (War_Stomp_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_WAR_STOMP); + War_Stomp_Timer = 10000; + }else War_Stomp_Timer -= diff; + + if (Purge_Timer < diff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_PURGE); + + Purge_Timer = 15000; + }else Purge_Timer -= diff; + + if (Frost_Shock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_SHOCK); + Frost_Shock_Timer = 7000; + }else Frost_Shock_Timer -= diff; + + if (Healing_Wave_Timer < diff) + { + // std::vector::iterator itr = Group.begin() + rand()%Group.size(); + // uint64 guid = (*itr)->guid; + // if (guid) + // { + // Unit* pAdd = m_creature->GetMap()->GetUnit((*itr)->guid); + // if (pAdd && pAdd->isAlive()) + // { + DoCastSpellIfCan(m_creature, SPELL_LESSER_HEALING_WAVE); + Healing_Wave_Timer = 5000; + // } + // } + }else Healing_Wave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_apoko(Creature* pCreature) +{ + return new boss_apokoAI(pCreature); +} + +enum +{ + SPELL_GOBLIN_DRAGON_GUN = 44272, + SPELL_ROCKET_LAUNCH = 44137, + SPELL_RECOMBOBULATE = 44274, + SPELL_HIGH_EXPLOSIVE_SHEEP = 44276, + SPELL_FEL_IRON_BOMB = 46024, + SPELL_SHEEP_EXPLOSION = 44279 +}; + +struct MANGOS_DLL_DECL boss_zelfanAI : public boss_priestess_lackey_commonAI +{ + //Engineer + boss_zelfanAI(Creature* pCreature) : boss_priestess_lackey_commonAI(pCreature) { Reset(); } + + uint32 Goblin_Dragon_Gun_Timer; + uint32 Rocket_Launch_Timer; + uint32 Recombobulate_Timer; + uint32 High_Explosive_Sheep_Timer; + uint32 Fel_Iron_Bomb_Timer; + + void Reset() + { + Goblin_Dragon_Gun_Timer = 20000; + Rocket_Launch_Timer = 7000; + Recombobulate_Timer = 4000; + High_Explosive_Sheep_Timer = 10000; + Fel_Iron_Bomb_Timer = 15000; + + boss_priestess_lackey_commonAI::Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Goblin_Dragon_Gun_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); + Goblin_Dragon_Gun_Timer = 10000; + }else Goblin_Dragon_Gun_Timer -= diff; + + if (Rocket_Launch_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ROCKET_LAUNCH); + Rocket_Launch_Timer = 9000; + }else Rocket_Launch_Timer -= diff; + + if (Fel_Iron_Bomb_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FEL_IRON_BOMB); + Fel_Iron_Bomb_Timer = 15000; + }else Fel_Iron_Bomb_Timer -= diff; + + if (Recombobulate_Timer < diff) + { + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiLackeyGUIDs[i])) + { + if (pAdd->IsPolymorphed()) + { + DoCastSpellIfCan(pAdd, SPELL_RECOMBOBULATE); + break; + } + } + } + Recombobulate_Timer = 2000; + }else Recombobulate_Timer -= diff; + + if (High_Explosive_Sheep_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_HIGH_EXPLOSIVE_SHEEP); + High_Explosive_Sheep_Timer = 65000; + }else High_Explosive_Sheep_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_zelfan(Creature* pCreature) +{ + return new boss_zelfanAI(pCreature); +} + +//struct MANGOS_DLL_DECL mob_high_explosive_sheepAI : public ScriptedAI +//{ +// mob_high_explosive_sheepAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} +// +// uint32 Explosion_Timer; +// +// void Reset() +// { +// Explosion_Timer = 60000; +// } +// +// void JustDied(Unit *Killer){} +// +// void UpdateAI(const uint32 diff) +// { +// if (Explosion_Timer < diff) +// { +// DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHEEP_EXPLOSION); +// }else +// Explosion_Timer -= diff; +// } +//}; + +//CreatureAI* GetAI_mob_high_explosive_sheep(Creature* pCreature) +//{ +// return new mob_high_explosive_sheepAI(pCreature); +//}; + +void AddSC_boss_priestess_delrissa() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_priestess_delrissa"; + newscript->GetAI = &GetAI_boss_priestess_delrissa; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_kagani_nightstrike"; + newscript->GetAI = &GetAI_boss_kagani_nightstrike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_ellris_duskhallow"; + newscript->GetAI = &GetAI_ellris_duskhallow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_eramas_brightblaze"; + newscript->GetAI = &GetAI_eramas_brightblaze; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_yazzai"; + newscript->GetAI = &GetAI_yazzai; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_warlord_salaris"; + newscript->GetAI = &GetAI_warlord_salaris; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_garaxxas"; + newscript->GetAI = &GetAI_garaxxas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_apoko"; + newscript->GetAI = &GetAI_apoko; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_zelfan"; + newscript->GetAI = &GetAI_zelfan; + newscript->RegisterSelf(); + + /*newscript = new Script; + newscript->Name = "mob_high_explosive_sheep"; + newscript->GetAI = &GetAI_mob_high_explosive_sheep; + newscript->RegisterSelf();*/ +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp b/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp new file mode 100644 index 0000000..7e72cbe --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp @@ -0,0 +1,387 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Selin_Fireheart +SD%Complete: 90 +SDComment: Heroic and Normal Support. Needs further testing. +SDCategory: Magister's Terrace +EndScriptData */ + +#include "precompiled.h" +#include "magisters_terrace.h" + +#define SAY_AGGRO -1585000 +#define SAY_ENERGY -1585001 +#define SAY_EMPOWERED -1585002 +#define SAY_KILL_1 -1585003 +#define SAY_KILL_2 -1585004 +#define SAY_DEATH -1585005 +#define EMOTE_CRYSTAL -1585006 + +//Crystal effect spells +#define SPELL_FEL_CRYSTAL_COSMETIC 44374 +#define SPELL_FEL_CRYSTAL_DUMMY 44329 +#define SPELL_FEL_CRYSTAL_VISUAL 44355 +#define SPELL_MANA_RAGE 44320 // This spell triggers 44321, which changes scale and regens mana Requires an entry in spell_script_target + +//Selin's spells +#define SPELL_DRAIN_LIFE 44294 +#define SPELL_FEL_EXPLOSION 44314 + +#define SPELL_DRAIN_MANA 46153 // Heroic only + +#define CRYSTALS_NUMBER 5 +#define DATA_CRYSTALS 6 + +#define CREATURE_FEL_CRYSTAL 24722 + +struct MANGOS_DLL_DECL boss_selin_fireheartAI : public ScriptedAI +{ + boss_selin_fireheartAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + + Crystals.clear(); + //GUIDs per instance is static, so we only need to load them once. + if (m_pInstance) + { + uint32 size = m_pInstance->GetData(DATA_FEL_CRYSTAL_SIZE); + for(uint8 i = 0; i < size; ++i) + { + uint64 guid = m_pInstance->GetData64(DATA_FEL_CRYSTAL); + debug_log("SD2: Selin: Adding Fel Crystal " UI64FMTD " to list", guid); + Crystals.push_back(guid); + } + } + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + std::list Crystals; + + uint32 DrainLifeTimer; + uint32 DrainManaTimer; + uint32 FelExplosionTimer; + uint32 DrainCrystalTimer; + uint32 EmpowerTimer; + + bool IsDraining; + bool DrainingCrystal; + + uint64 CrystalGUID; // This will help us create a pointer to the crystal we are draining. We store GUIDs, never units in case unit is deleted/offline (offline if player of course). + + void Reset() + { + if (m_pInstance) + { + //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i) + for(std::list::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + //Creature* pUnit = m_creature->GetMap()->GetCreature(FelCrystals[i]); + if (Creature* pCrystal = m_creature->GetMap()->GetCreature(*itr)) + { + if (!pCrystal->isAlive()) + pCrystal->Respawn(); // Let MaNGOS handle setting death state, etc. + + // Only need to set unselectable flag. You can't attack unselectable units so non_attackable flag is not necessary here. + pCrystal->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR))) + pDoor->SetGoState(GO_STATE_ACTIVE); // Open the big encounter door. Close it in Aggro and open it only in JustDied(and here) + // Small door opened after event are expected to be closed by default + // Set Inst data for encounter + m_pInstance->SetData(DATA_SELIN_EVENT, NOT_STARTED); + }else error_log(ERROR_INST_DATA); + + DrainLifeTimer = urand(3000, 7000); + DrainManaTimer = DrainLifeTimer + 5000; + FelExplosionTimer = 2100; + DrainCrystalTimer = urand(10000, 15000); + DrainCrystalTimer = urand(20000, 25000); + EmpowerTimer = 10000; + + IsDraining = false; + DrainingCrystal = false; + CrystalGUID = 0; + } + + void SelectNearestCrystal() + { + if (Crystals.empty()) + return; + + float ShortestDistance = 0; + CrystalGUID = 0; + Creature* pCrystal = NULL; + Creature* CrystalChosen = NULL; + //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i) + for(std::list::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + pCrystal = m_creature->GetMap()->GetCreature(*itr); + + if (pCrystal && pCrystal->isAlive()) + { + // select nearest + if (!CrystalChosen || m_creature->GetDistanceOrder(pCrystal, CrystalChosen, false)) + { + CrystalGUID = pCrystal->GetGUID(); + CrystalChosen = pCrystal; // Store a copy of pCrystal so we don't need to recreate a pointer to closest crystal for the movement and yell. + } + } + } + if (CrystalChosen) + { + DoScriptText(SAY_ENERGY, m_creature); + DoScriptText(EMOTE_CRYSTAL, m_creature); + + CrystalChosen->CastSpell(CrystalChosen, SPELL_FEL_CRYSTAL_COSMETIC, true); + + float x, y, z; // coords that we move to, close to the crystal. + CrystalChosen->GetClosePoint(x, y, z, m_creature->GetObjectBoundingRadius(), CONTACT_DISTANCE); + + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->GetMotionMaster()->MovePoint(1, x, y, z); + DrainingCrystal = true; + } + } + + void ShatterRemainingCrystals() + { + if (Crystals.empty()) + return; + + //for(uint8 i = 0; i < CRYSTALS_NUMBER; ++i) + for(std::list::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + //Creature* pCrystal = m_creature->GetMap()->GetCreature(FelCrystals[i]); + Creature* pCrystal = m_creature->GetMap()->GetCreature(*itr); + + if (pCrystal && pCrystal->isAlive()) + pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + { + //Close the encounter door, open it in JustDied/Reset + if (GameObject* pEncounterDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR))) + pEncounterDoor->SetGoState(GO_STATE_READY); + } + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == POINT_MOTION_TYPE && id == 1) + { + Creature* CrystalChosen = m_creature->GetMap()->GetCreature(CrystalGUID); + if (CrystalChosen && CrystalChosen->isAlive()) + { + // Make the crystal attackable + // We also remove NON_ATTACKABLE in case the database has it set. + CrystalChosen->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + CrystalChosen->CastSpell(m_creature, SPELL_MANA_RAGE, true); + IsDraining = true; + } + else + { + // Make an error message in case something weird happened here + error_log("SD2: Selin Fireheart unable to drain crystal as the crystal is either dead or despawned"); + DrainingCrystal = false; + } + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + + m_pInstance->SetData(DATA_SELIN_EVENT, DONE); // Encounter complete! + + if (GameObject* pEncounterDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR))) + pEncounterDoor->SetGoState(GO_STATE_ACTIVE); // Open the encounter door + + if (GameObject* pContinueDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SELIN_DOOR))) + pContinueDoor->SetGoState(GO_STATE_ACTIVE); // Open the door leading further in + + ShatterRemainingCrystals(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!DrainingCrystal) + { + uint32 maxPowerMana = m_creature->GetMaxPower(POWER_MANA); + if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) + { + if (DrainLifeTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_DRAIN_LIFE); + + DrainLifeTimer = 10000; + }else DrainLifeTimer -= diff; + + // Heroic only + if (!m_bIsRegularMode) + { + if (DrainManaTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(pTarget, SPELL_DRAIN_MANA); + + DrainManaTimer = 10000; + }else DrainManaTimer -= diff; + } + } + + if (FelExplosionTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCastSpellIfCan(m_creature, SPELL_FEL_EXPLOSION); + FelExplosionTimer = 2000; + } + }else FelExplosionTimer -= diff; + + // If below 10% mana, start recharging + maxPowerMana = m_creature->GetMaxPower(POWER_MANA); + if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) + { + if (DrainCrystalTimer < diff) + { + SelectNearestCrystal(); + + if (m_bIsRegularMode) + DrainCrystalTimer = urand(20000, 25000); + else + DrainCrystalTimer = urand(10000, 15000); + + }else DrainCrystalTimer -= diff; + } + + }else + { + if (IsDraining) + { + if (EmpowerTimer < diff) + { + IsDraining = false; + DrainingCrystal = false; + + DoScriptText(SAY_EMPOWERED, m_creature); + + Creature* CrystalChosen = m_creature->GetMap()->GetCreature(CrystalGUID); + if (CrystalChosen && CrystalChosen->isAlive()) + // Use Deal Damage to kill it, not SetDeathState. + CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CrystalGUID = 0; + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + }else EmpowerTimer -= diff; + } + } + + DoMeleeAttackIfReady(); // No need to check if we are draining crystal here, as the spell has a stun. + } +}; + +CreatureAI* GetAI_boss_selin_fireheart(Creature* pCreature) +{ + return new boss_selin_fireheartAI(pCreature); +}; + +struct MANGOS_DLL_DECL mob_fel_crystalAI : public ScriptedAI +{ + mob_fel_crystalAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) {} + + void JustDied(Unit* killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + Creature* pSelin = m_creature->GetMap()->GetCreature(pInstance->GetData64(DATA_SELIN)); + + if (pSelin && pSelin->isAlive()) + { + boss_selin_fireheartAI* pSelinAI = dynamic_cast(pSelin->AI()); + + if (pSelinAI && pSelinAI->CrystalGUID == m_creature->GetGUID()) + { + // Set this to false if we are the creature that Selin is draining so his AI flows properly + pSelinAI->DrainingCrystal = false; + pSelinAI->IsDraining = false; + pSelinAI->EmpowerTimer = 10000; + + if (pSelin->getVictim()) + { + pSelin->AI()->AttackStart(pSelin->getVictim()); + pSelin->GetMotionMaster()->MoveChase(pSelin->getVictim()); + } + } + } + }else error_log(ERROR_INST_DATA); + } +}; + +CreatureAI* GetAI_mob_fel_crystal(Creature* pCreature) +{ + return new mob_fel_crystalAI(pCreature); +}; + +void AddSC_boss_selin_fireheart() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_selin_fireheart"; + newscript->GetAI = &GetAI_boss_selin_fireheart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fel_crystal"; + newscript->GetAI = &GetAI_mob_fel_crystal; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp b/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp new file mode 100644 index 0000000..08a4e93 --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp @@ -0,0 +1,228 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Vexallus +SD%Complete: 90 +SDComment: Heroic and Normal support. Needs further testing. +SDCategory: Magister's Terrace +EndScriptData */ + +#include "precompiled.h" +#include "magisters_terrace.h" + +enum +{ + SAY_AGGRO = -1585007, + SAY_ENERGY = -1585008, + SAY_OVERLOAD = -1585009, + SAY_KILL = -1585010, + EMOTE_DISCHARGE_ENERGY = -1585011, + + //is this text for real? + //#define SAY_DEATH "What...happen...ed." + + //Pure energy spell info + SPELL_ENERGY_BOLT = 46156, + SPELL_ENERGY_FEEDBACK = 44335, + + //Vexallus spell info + SPELL_CHAIN_LIGHTNING = 44318, + SPELL_H_CHAIN_LIGHTNING = 46380, //heroic spell + SPELL_OVERLOAD = 44353, + SPELL_ARCANE_SHOCK = 44319, + SPELL_H_ARCANE_SHOCK = 46381, //heroic spell + + SPELL_SUMMON_PURE_ENERGY = 44322, //mod scale -10 + H_SPELL_SUMMON_PURE_ENERGY1 = 46154, //mod scale -5 + H_SPELL_SUMMON_PURE_ENERGY2 = 46159, //mod scale -5 + + //Creatures + NPC_PURE_ENERGY = 24745, + + INTERVAL_MODIFIER = 15, + INTERVAL_SWITCH = 6 +}; + +struct MANGOS_DLL_DECL boss_vexallusAI : public ScriptedAI +{ + boss_vexallusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 ChainLightningTimer; + uint32 ArcaneShockTimer; + uint32 OverloadTimer; + uint32 IntervalHealthAmount; + bool Enraged; + + void Reset() + { + ChainLightningTimer = 8000; + ArcaneShockTimer = 5000; + OverloadTimer = 1200; + IntervalHealthAmount = 1; + Enraged = false; + + if (m_pInstance) + m_pInstance->SetData(DATA_VEXALLUS_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit *victim) + { + if (m_pInstance) + m_pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(DATA_VEXALLUS_EVENT, IN_PROGRESS); + } + + void JustSummoned(Creature *summoned) + { + if (Unit *temp = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + summoned->GetMotionMaster()->MoveFollow(temp,0,0); + + //spells are SUMMON_TYPE_GUARDIAN, so using setOwner should be ok + summoned->SetOwnerGUID(m_creature->GetGUID()); + summoned->CastSpell(summoned,SPELL_ENERGY_BOLT,false,0,0,m_creature->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!Enraged) + { + //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% + if (m_creature->GetHealthPercent() <= float(100 - INTERVAL_MODIFIER*IntervalHealthAmount)) + { + //increase amount, unless we're at 10%, then we switch and return + if (IntervalHealthAmount == INTERVAL_SWITCH) + { + Enraged = true; + return; + } + else + ++IntervalHealthAmount; + + DoScriptText(SAY_ENERGY, m_creature); + DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature); + + if (m_bIsRegularMode) + m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false); + else + { + m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false); + m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY2,false); + } + + //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos + m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!m_bIsRegularMode) + m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + } + + if (ChainLightningTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_CHAIN_LIGHTNING : SPELL_H_CHAIN_LIGHTNING); + + ChainLightningTimer = 8000; + }else ChainLightningTimer -= diff; + + if (ArcaneShockTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_ARCANE_SHOCK : SPELL_H_ARCANE_SHOCK); + + ArcaneShockTimer = 8000; + }else ArcaneShockTimer -= diff; + } + else + { + if (OverloadTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_OVERLOAD); + + OverloadTimer = 2000; + }else OverloadTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vexallus(Creature* pCreature) +{ + return new boss_vexallusAI(pCreature); +}; + +struct MANGOS_DLL_DECL mob_pure_energyAI : public ScriptedAI +{ + mob_pure_energyAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + + void JustDied(Unit* slayer) + { + if (Unit *temp = m_creature->GetOwner()) + { + if (temp && temp->isAlive()) + slayer->CastSpell(slayer, SPELL_ENERGY_FEEDBACK, true, 0, 0, temp->GetGUID()); + } + } + + void MoveInLineOfSight(Unit *who) { } + void AttackStart(Unit *who) { } +}; + +CreatureAI* GetAI_mob_pure_energy(Creature* pCreature) +{ + return new mob_pure_energyAI(pCreature); +}; + +void AddSC_boss_vexallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_vexallus"; + newscript->GetAI = &GetAI_boss_vexallus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_pure_energy"; + newscript->GetAI = &GetAI_mob_pure_energy; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp b/scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp new file mode 100644 index 0000000..b88484b --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Magisters_Terrace +SD%Complete: 60 +SDComment: Designed only for Selin Fireheart +SDCategory: Magister's Terrace +EndScriptData */ + +#include "precompiled.h" +#include "magisters_terrace.h" + +#define MAX_ENCOUNTER 4 + +/* +0 - Selin Fireheart +1 - Vexallus +2 - Priestess Delrissa +3 - Kael'thas Sunstrider +*/ + +struct MANGOS_DLL_DECL instance_magisters_terrace : public ScriptedInstance +{ + instance_magisters_terrace(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint32 m_uiDelrissaDeathCount; + + std::list FelCrystals; + std::list::iterator CrystalItr; + + uint64 m_uiSelinGUID; + uint64 m_uiDelrissaGUID; + uint64 m_uiVexallusDoorGUID; + uint64 m_uiSelinDoorGUID; + uint64 m_uiSelinEncounterDoorGUID; + uint64 m_uiDelrissaDoorGUID; + uint64 m_uiKaelDoorGUID; + uint64 m_auiKaelStatue[2]; + + bool m_bInitializedItr; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_auiKaelStatue, 0, sizeof(m_auiKaelStatue)); + + FelCrystals.clear(); + + m_uiDelrissaDeathCount = 0; + + m_uiSelinGUID = 0; + m_uiDelrissaGUID = 0; + m_uiVexallusDoorGUID = 0; + m_uiSelinDoorGUID = 0; + m_uiSelinEncounterDoorGUID = 0; + m_uiDelrissaDoorGUID = 0; + m_uiKaelDoorGUID = 0; + + m_bInitializedItr = false; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + return false; + } + + uint32 GetData(uint32 identifier) + { + switch(identifier) + { + case DATA_SELIN_EVENT: return m_auiEncounter[0]; + case DATA_VEXALLUS_EVENT: return m_auiEncounter[1]; + case DATA_DELRISSA_EVENT: return m_auiEncounter[2]; + case DATA_KAELTHAS_EVENT: return m_auiEncounter[3]; + case DATA_DELRISSA_DEATH_COUNT: return m_uiDelrissaDeathCount; + case DATA_FEL_CRYSTAL_SIZE: return FelCrystals.size(); + } + return 0; + } + + void SetData(uint32 identifier, uint32 data) + { + switch(identifier) + { + case DATA_SELIN_EVENT: + m_auiEncounter[0] = data; + break; + case DATA_VEXALLUS_EVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiVexallusDoorGUID); + m_auiEncounter[1] = data; + break; + case DATA_DELRISSA_EVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiDelrissaDoorGUID); + if (data == IN_PROGRESS) + m_uiDelrissaDeathCount = 0; + m_auiEncounter[2] = data; + break; + case DATA_KAELTHAS_EVENT: + m_auiEncounter[3] = data; + break; + case DATA_DELRISSA_DEATH_COUNT: + if (data == SPECIAL) + ++m_uiDelrissaDeathCount; + else + m_uiDelrissaDeathCount = 0; + break; + } + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 24723: m_uiSelinGUID = pCreature->GetGUID(); break; + case 24560: m_uiDelrissaGUID = pCreature->GetGUID(); break; + case 24722: FelCrystals.push_back(pCreature->GetGUID()); break; + } + } + + void OnObjectCreate(GameObject* go) + { + switch(go->GetEntry()) + { + case 187896: m_uiVexallusDoorGUID = go->GetGUID(); break; + //SunwellRaid Gate 02 + case 187979: m_uiSelinDoorGUID = go->GetGUID(); break; + //Assembly Chamber Door + case 188065: m_uiSelinEncounterDoorGUID = go->GetGUID(); break; + case 187770: m_uiDelrissaDoorGUID = go->GetGUID(); break; + case 188064: m_uiKaelDoorGUID = go->GetGUID(); break; + case 188165: m_auiKaelStatue[0] = go->GetGUID(); break; + case 188166: m_auiKaelStatue[1] = go->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_SELIN: return m_uiSelinGUID; + case DATA_DELRISSA: return m_uiDelrissaGUID; + case DATA_VEXALLUS_DOOR: return m_uiVexallusDoorGUID; + case DATA_SELIN_DOOR: return m_uiSelinDoorGUID; + case DATA_SELIN_ENCOUNTER_DOOR: return m_uiSelinEncounterDoorGUID; + case DATA_DELRISSA_DOOR: return m_uiDelrissaDoorGUID; + case DATA_KAEL_DOOR: return m_uiKaelDoorGUID; + case DATA_KAEL_STATUE_LEFT: return m_auiKaelStatue[0]; + case DATA_KAEL_STATUE_RIGHT: return m_auiKaelStatue[1]; + + case DATA_FEL_CRYSTAL: + { + if (FelCrystals.empty()) + { + error_log("SD2: Magisters Terrace: No Fel Crystals loaded in Inst Data"); + return 0; + } + + if (!m_bInitializedItr) + { + CrystalItr = FelCrystals.begin(); + m_bInitializedItr = true; + } + + uint64 guid = *CrystalItr; + ++CrystalItr; + return guid; + } + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_magisters_terrace(Map* pMap) +{ + return new instance_magisters_terrace(pMap); +} + +void AddSC_instance_magisters_terrace() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_magisters_terrace"; + newscript->GetInstanceData = &GetInstanceData_instance_magisters_terrace; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp b/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp new file mode 100644 index 0000000..20a81a6 --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp @@ -0,0 +1,174 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Magisters_Terrace +SD%Complete: 100 +SDComment: Quest support: 11490(post-event) +SDCategory: Magisters Terrace +EndScriptData */ + +/* ContentData +npc_kalecgos +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_kalecgos +######*/ + +enum +{ + SPELL_TRANSFORM_TO_KAEL = 44670, + SPELL_ORB_KILL_CREDIT = 46307, + NPC_KAEL = 24848, //human form entry + POINT_ID_LAND = 1 +}; + +const float afKaelLandPoint[] = {225.045f, -276.236f, -5.434f}; + +#define GOSSIP_ITEM_KAEL_1 "Who are you?" +#define GOSSIP_ITEM_KAEL_2 "What can we do to assist you?" +#define GOSSIP_ITEM_KAEL_3 "What brings you to the Sunwell?" +#define GOSSIP_ITEM_KAEL_4 "You're not alone here?" +#define GOSSIP_ITEM_KAEL_5 "What would Kil'jaeden want with a mortal woman?" + +// This is friendly keal that appear after used Orb. +// If we assume DB handle summon, summon appear somewhere outside the platform where Orb is +struct MANGOS_DLL_DECL npc_kalecgosAI : public ScriptedAI +{ + npc_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiTransformTimer; + + void Reset() + { + m_uiTransformTimer = 0; + + // we must assume he appear as dragon somewhere outside the platform of orb, and then move directly to here + if (m_creature->GetEntry() != NPC_KAEL) + m_creature->GetMotionMaster()->MovePoint(POINT_ID_LAND, afKaelLandPoint[0], afKaelLandPoint[1], afKaelLandPoint[2]); + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiPointId == POINT_ID_LAND) + m_uiTransformTimer = MINUTE*IN_MILLISECONDS; + } + + // some targeting issues with the spell, so use this workaround as temporary solution + void DoWorkaroundForQuestCredit() + { + Map* pMap = m_creature->GetMap(); + + if (!pMap || !pMap->IsRegularDifficulty()) + return; + + Map::PlayerList const &lList = pMap->GetPlayers(); + + if (lList.isEmpty()) + return; + + SpellEntry const* pSpell = GetSpellStore()->LookupEntry(SPELL_ORB_KILL_CREDIT); + + for(Map::PlayerList::const_iterator i = lList.begin(); i != lList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pSpell && pSpell->EffectMiscValue[0]) + pPlayer->KilledMonsterCredit(pSpell->EffectMiscValue[0]); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiTransformTimer) + { + if (m_uiTransformTimer < uiDiff) + { + m_creature->CastSpell(m_creature,SPELL_ORB_KILL_CREDIT,false); + DoWorkaroundForQuestCredit(); + + // Transform and update entry, now ready for quest/read gossip + m_creature->CastSpell(m_creature,SPELL_TRANSFORM_TO_KAEL,false); + m_creature->UpdateEntry(NPC_KAEL); + + m_uiTransformTimer = 0; + }else m_uiTransformTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_kalecgos(Creature* pCreature) +{ + return new npc_kalecgosAI(pCreature); +} + +bool GossipHello_npc_kalecgos(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(12498, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_kalecgos(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(12500, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(12502, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(12606, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAEL_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(12607, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->SEND_GOSSIP_MENU(12608, pCreature->GetGUID()); + break; + } + + return true; +} + +void AddSC_magisters_terrace() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_kalecgos"; + newscript->GetAI = &GetAI_npc_kalecgos; + newscript->pGossipHello = &GossipHello_npc_kalecgos; + newscript->pGossipSelect = &GossipSelect_npc_kalecgos; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.h b/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.h new file mode 100644 index 0000000..e6ac2d6 --- /dev/null +++ b/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.h @@ -0,0 +1,30 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MAGISTERS_TERRACE_H +#define DEF_MAGISTERS_TERRACE_H + +#define DATA_SELIN_EVENT 1 +#define DATA_VEXALLUS_EVENT 2 +#define DATA_DELRISSA_EVENT 3 +#define DATA_KAELTHAS_EVENT 4 + +#define DATA_SELIN 5 +#define DATA_FEL_CRYSTAL 6 +#define DATA_FEL_CRYSTAL_SIZE 7 + +#define DATA_VEXALLUS_DOOR 8 +#define DATA_SELIN_DOOR 9 +#define DATA_DELRISSA 10 +#define DATA_DELRISSA_DOOR 11 +#define DATA_SELIN_ENCOUNTER_DOOR 12 + +#define DATA_KAEL_DOOR 13 +#define DATA_KAEL_STATUE_LEFT 14 +#define DATA_KAEL_STATUE_RIGHT 15 + +#define DATA_DELRISSA_DEATH_COUNT 16 + +#define ERROR_INST_DATA "SD2 Error: Instance Data not set properly for Magister's Terrace instance (map 585). Encounters will be buggy." +#endif diff --git a/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp b/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp new file mode 100644 index 0000000..6b0c87d --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp @@ -0,0 +1,104 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Baron_Geddon +SD%Complete: 100 +SDComment: +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_SERVICE -1409000 + +#define SPELL_INFERNO 19695 +#define SPELL_IGNITEMANA 19659 +#define SPELL_LIVINGBOMB 20475 +#define SPELL_ARMAGEDDOM 20479 + +struct MANGOS_DLL_DECL boss_baron_geddonAI : public ScriptedAI +{ + boss_baron_geddonAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Inferno_Timer; + uint32 IgniteMana_Timer; + uint32 LivingBomb_Timer; + + void Reset() + { + Inferno_Timer = 45000; //These times are probably wrong + IgniteMana_Timer = 30000; + LivingBomb_Timer = 35000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are <2% hp cast Armageddom + if (m_creature->GetHealthPercent() <= 2.0f) + { + m_creature->InterruptNonMeleeSpells(true); + + DoCastSpellIfCan(m_creature,SPELL_ARMAGEDDOM); + DoScriptText(EMOTE_SERVICE, m_creature); + return; + } + + //Inferno_Timer + if (Inferno_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_INFERNO); + Inferno_Timer = 45000; + }else Inferno_Timer -= diff; + + //IgniteMana_Timer + if (IgniteMana_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_IGNITEMANA); + + IgniteMana_Timer = 30000; + }else IgniteMana_Timer -= diff; + + //LivingBomb_Timer + if (LivingBomb_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_LIVINGBOMB); + + LivingBomb_Timer = 35000; + }else LivingBomb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_baron_geddon(Creature* pCreature) +{ + return new boss_baron_geddonAI(pCreature); +} + +void AddSC_boss_baron_geddon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_baron_geddon"; + newscript->GetAI = &GetAI_boss_baron_geddon; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_garr.cpp b/scripts/eastern_kingdoms/molten_core/boss_garr.cpp new file mode 100644 index 0000000..fd371d2 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_garr.cpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Garr +SD%Complete: 50 +SDComment: Adds NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +// Garr spells +#define SPELL_ANTIMAGICPULSE 19492 +#define SPELL_MAGMASHACKLES 19496 +#define SPELL_ENRAGE 19516 //Stacking enrage (stacks to 10 times) + +//Add spells +#define SPELL_ERUPTION 19497 +#define SPELL_IMMOLATE 20294 + +struct MANGOS_DLL_DECL boss_garrAI : public ScriptedAI +{ + boss_garrAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 AntiMagicPulse_Timer; + uint32 MagmaShackles_Timer; + uint32 CheckAdds_Timer; + uint64 Add[8]; + bool Enraged[8]; + + void Reset() + { + AntiMagicPulse_Timer = 25000; //These times are probably wrong + MagmaShackles_Timer = 15000; + CheckAdds_Timer = 2000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //AntiMagicPulse_Timer + if (AntiMagicPulse_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ANTIMAGICPULSE); + AntiMagicPulse_Timer = urand(10000, 15000); + }else AntiMagicPulse_Timer -= diff; + + //MagmaShackles_Timer + if (MagmaShackles_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_MAGMASHACKLES); + MagmaShackles_Timer = urand(8000, 12000); + }else MagmaShackles_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_fireswornAI : public ScriptedAI +{ + mob_fireswornAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Immolate_Timer; + + void Reset() + { + Immolate_Timer = 4000; //These times are probably wrong + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Immolate_Timer + if (Immolate_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_IMMOLATE); + + Immolate_Timer = urand(5000, 10000); + }else Immolate_Timer -= diff; + + //Cast Erruption and let them die + if (m_creature->GetHealthPercent() <= 10.0f) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ERUPTION); + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_garr(Creature* pCreature) +{ + return new boss_garrAI(pCreature); +} + +CreatureAI* GetAI_mob_firesworn(Creature* pCreature) +{ + return new mob_fireswornAI(pCreature); +} + +void AddSC_boss_garr() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_garr"; + newscript->GetAI = &GetAI_boss_garr; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_firesworn"; + newscript->GetAI = &GetAI_mob_firesworn; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp b/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp new file mode 100644 index 0000000..9387ff9 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp @@ -0,0 +1,89 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gehennas +SD%Complete: 90 +SDComment: Adds MC NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWBOLT 19728 +#define SPELL_RAINOFFIRE 19717 +#define SPELL_GEHENNASCURSE 19716 + +struct MANGOS_DLL_DECL boss_gehennasAI : public ScriptedAI +{ + boss_gehennasAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowBolt_Timer; + uint32 RainOfFire_Timer; + uint32 GehennasCurse_Timer; + + void Reset() + { + ShadowBolt_Timer = 6000; + RainOfFire_Timer = 10000; + GehennasCurse_Timer = 12000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + if (Unit* bTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(bTarget,SPELL_SHADOWBOLT); + ShadowBolt_Timer = 7000; + }else ShadowBolt_Timer -= diff; + + //RainOfFire_Timer + if (RainOfFire_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_RAINOFFIRE); + + RainOfFire_Timer = urand(4000, 12000); + }else RainOfFire_Timer -= diff; + + //GehennasCurse_Timer + if (GehennasCurse_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_GEHENNASCURSE); + GehennasCurse_Timer = urand(22000, 30000); + }else GehennasCurse_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gehennas(Creature* pCreature) +{ + return new boss_gehennasAI(pCreature); +} + +void AddSC_boss_gehennas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gehennas"; + newscript->GetAI = &GetAI_boss_gehennas; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp b/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp new file mode 100644 index 0000000..120efdf --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp @@ -0,0 +1,198 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Golemagg +SD%Complete: 75 +SDComment: Timers need to be confirmed, Golemagg's Trust need to be checked +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" +#include "molten_core.h" + +enum +{ + SPELL_MAGMASPLASH = 13879, + SPELL_PYROBLAST = 20228, + SPELL_EARTHQUAKE = 19798, + SPELL_ENRAGE = 19953, + SPELL_GOLEMAGG_TRUST = 20553, + + // Core Rager + EMOTE_LOWHP = -1409002, + SPELL_MANGLE = 19820 +}; + +struct MANGOS_DLL_DECL boss_golemaggAI : public ScriptedAI +{ + boss_golemaggAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiPyroblastTimer; + uint32 m_uiEarthquakeTimer; + uint32 m_uiBuffTimer; + bool m_bEnraged; + + void Reset() + { + m_uiPyroblastTimer = 7*IN_MILLISECONDS; // These timers are probably wrong + m_uiEarthquakeTimer = 3*IN_MILLISECONDS; + m_uiBuffTimer = 2.5*IN_MILLISECONDS; + m_bEnraged = false; + + m_creature->CastSpell(m_creature, SPELL_MAGMASPLASH, true); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GOLEMAGG, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Pyroblast + if (m_uiPyroblastTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_PYROBLAST); + + m_uiPyroblastTimer = 7*IN_MILLISECONDS; + } + else + m_uiPyroblastTimer -= uiDiff; + + // Enrage + if (!m_bEnraged && m_creature->GetHealthPercent() < 10.0f) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + m_bEnraged = true; + } + + // Earthquake + if (m_bEnraged) + { + if (m_uiEarthquakeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_EARTHQUAKE); + m_uiEarthquakeTimer = 3*IN_MILLISECONDS; + } + else + m_uiEarthquakeTimer -= uiDiff; + } + + /* + // Golemagg's Trust + if (m_uiBuffTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_GOLEMAGG_TRUST); + m_uiBuffTimer = 2.5*IN_MILLISECONDS; + } + else + m_uiBuffTimer -= uiDiff; + */ + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_core_ragerAI : public ScriptedAI +{ + mob_core_ragerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + uint32 m_uiMangleTimer; + + void Reset() + { + m_uiMangleTimer = 7*IN_MILLISECONDS; // These times are probably wrong + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if (m_creature->GetHealthPercent() < 50.0f) + { + if (m_pInstance) + { + if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG))) + { + if (pGolemagg->isAlive()) + { + DoScriptText(EMOTE_LOWHP, m_creature); + m_creature->SetHealth(m_creature->GetMaxHealth()); + } + else + uiDamage = m_creature->GetHealth(); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Mangle + if (m_uiMangleTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MANGLE); + m_uiMangleTimer = 10*IN_MILLISECONDS; + } + else + m_uiMangleTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_golemagg(Creature* pCreature) +{ + return new boss_golemaggAI(pCreature); +} + +CreatureAI* GetAI_mob_core_rager(Creature* pCreature) +{ + return new mob_core_ragerAI(pCreature); +} + +void AddSC_boss_golemagg() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_golemagg"; + newscript->GetAI = &GetAI_boss_golemagg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_core_rager"; + newscript->GetAI = &GetAI_mob_core_rager; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp b/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp new file mode 100644 index 0000000..1d8cd72 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp @@ -0,0 +1,86 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Lucifron +SD%Complete: 100 +SDComment: +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_IMPENDINGDOOM 19702 +#define SPELL_LUCIFRONCURSE 19703 +#define SPELL_SHADOWSHOCK 20603 + +struct MANGOS_DLL_DECL boss_lucifronAI : public ScriptedAI +{ + boss_lucifronAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ImpendingDoom_Timer; + uint32 LucifronCurse_Timer; + uint32 ShadowShock_Timer; + + void Reset() + { + ImpendingDoom_Timer = 10000; //Initial cast after 10 seconds so the debuffs alternate + LucifronCurse_Timer = 20000; //Initial cast after 20 seconds + ShadowShock_Timer = 6000; //6 seconds + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Impending doom timer + if (ImpendingDoom_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_IMPENDINGDOOM); + ImpendingDoom_Timer = 20000; + }else ImpendingDoom_Timer -= diff; + + //Lucifron's curse timer + if (LucifronCurse_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_LUCIFRONCURSE); + LucifronCurse_Timer = 15000; + }else LucifronCurse_Timer -= diff; + + //Shadowshock + if (ShadowShock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWSHOCK); + ShadowShock_Timer = 6000; + }else ShadowShock_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_lucifron(Creature* pCreature) +{ + return new boss_lucifronAI(pCreature); +} + +void AddSC_boss_lucifron() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lucifron"; + newscript->GetAI = &GetAI_boss_lucifron; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp b/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp new file mode 100644 index 0000000..9be5fc7 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp @@ -0,0 +1,99 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Magmadar +SD%Complete: 75 +SDComment: Conflag on ground nyi, fear causes issues without VMAPs +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, + + SPELL_FRENZY = 19451, + SPELL_MAGMASPIT = 19449, //This is actually a buff he gives himself + SPELL_PANIC = 19408, + SPELL_LAVABOMB = 19411, //This calls a dummy server side effect that isn't implemented yet + SPELL_LAVABOMB_ALT = 19428 //This is the spell that the lava bomb casts +}; + +struct MANGOS_DLL_DECL boss_magmadarAI : public ScriptedAI +{ + boss_magmadarAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Frenzy_Timer; + uint32 Panic_Timer; + uint32 Lavabomb_Timer; + + void Reset() + { + Frenzy_Timer = 30000; + Panic_Timer = 20000; + Lavabomb_Timer = 12000; + + m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Frenzy_Timer + if (Frenzy_Timer < diff) + { + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + DoCastSpellIfCan(m_creature,SPELL_FRENZY); + Frenzy_Timer = 15000; + }else Frenzy_Timer -= diff; + + //Panic_Timer + if (Panic_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PANIC); + Panic_Timer = 35000; + }else Panic_Timer -= diff; + + //Lavabomb_Timer + if (Lavabomb_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_LAVABOMB_ALT); + + Lavabomb_Timer = 12000; + }else Lavabomb_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_magmadar(Creature* pCreature) +{ + return new boss_magmadarAI(pCreature); +} + +void AddSC_boss_magmadar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magmadar"; + newscript->GetAI = &GetAI_boss_magmadar; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp b/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp new file mode 100644 index 0000000..b6c8ae6 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Majordomo_Executus +SD%Complete: 30 +SDComment: Correct spawning and Event NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1409003 +#define SAY_SPAWN -1409004 +#define SAY_SLAY -1409005 +#define SAY_SPECIAL -1409006 +#define SAY_DEFEAT -1409007 + +#define SAY_SUMMON_MAJ -1409008 +#define SAY_ARRIVAL1_RAG -1409009 +#define SAY_ARRIVAL2_MAJ -1409010 +#define SAY_ARRIVAL3_RAG -1409011 +#define SAY_ARRIVAL5_RAG -1409012 + +#define SPAWN_RAG_X 838.51 +#define SPAWN_RAG_Y -829.84 +#define SPAWN_RAG_Z -232.00 +#define SPAWN_RAG_O 1.70 + +#define SPELL_MAGIC_REFLECTION 20619 +#define SPELL_DAMAGE_REFLECTION 21075 +#define SPELL_BLASTWAVE 20229 +#define SPELL_AEGIS 20620 //This is self casted whenever we are below 50% +#define SPELL_TELEPORT 20618 +#define SPELL_SUMMON_RAGNAROS 19774 + +#define ENTRY_FLAMEWALKER_HEALER 11663 +#define ENTRY_FLAMEWALKER_ELITE 11664 + +struct MANGOS_DLL_DECL boss_majordomoAI : public ScriptedAI +{ + boss_majordomoAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 MagicReflection_Timer; + uint32 DamageReflection_Timer; + uint32 Blastwave_Timer; + + void Reset() + { + MagicReflection_Timer = 30000; //Damage reflection first so we alternate + DamageReflection_Timer = 15000; + Blastwave_Timer = 10000; + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 4)) + return; + + DoScriptText(SAY_SLAY, m_creature); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Cast Ageis if less than 50% hp + if (m_creature->GetHealthPercent() < 50.0f) + { + DoCastSpellIfCan(m_creature,SPELL_AEGIS); + } + + //MagicReflection_Timer + // if (MagicReflection_Timer < diff) + // { + // DoCastSpellIfCan(m_creature, SPELL_MAGICREFLECTION); + + //60 seconds until we should cast this agian + // MagicReflection_Timer = 30000; + // }else MagicReflection_Timer -= diff; + + //DamageReflection_Timer + // if (DamageReflection_Timer < diff) + // { + // DoCastSpellIfCan(m_creature, SPELL_DAMAGEREFLECTION); + + //60 seconds until we should cast this agian + // DamageReflection_Timer = 30000; + // }else DamageReflection_Timer -= diff; + + //Blastwave_Timer + if (Blastwave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLASTWAVE); + Blastwave_Timer = 10000; + }else Blastwave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_majordomo(Creature* pCreature) +{ + return new boss_majordomoAI(pCreature); +} + +void AddSC_boss_majordomo() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_majordomo"; + newscript->GetAI = &GetAI_boss_majordomo; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp b/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp new file mode 100644 index 0000000..17ed94a --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp @@ -0,0 +1,291 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ragnaros +SD%Complete: 75 +SDComment: Intro Dialog and event NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +#define SAY_REINFORCEMENTS1 -1409013 +#define SAY_REINFORCEMENTS2 -1409014 +#define SAY_HAND -1409015 +#define SAY_WRATH -1409016 +#define SAY_KILL -1409017 +#define SAY_MAGMABURST -1409018 + +#define SPELL_HANDOFRAGNAROS 19780 +#define SPELL_WRATHOFRAGNAROS 20566 +#define SPELL_LAVABURST 21158 + +#define SPELL_MAGMABURST 20565 //Ranged attack + +#define SPELL_SONSOFFLAME_DUMMY 21108 //Server side effect +#define SPELL_RAGSUBMERGE 21107 //Stealth aura +#define SPELL_RAGEMERGE 20568 +#define SPELL_MELTWEAPON 21388 +#define SPELL_ELEMENTALFIRE 20564 +#define SPELL_ERRUPTION 17731 + +#define ADD_1X 848.740356 +#define ADD_1Y -816.103455 +#define ADD_1Z -229.74327 +#define ADD_1O 2.615287 + +#define ADD_2X 852.560791 +#define ADD_2Y -849.861511 +#define ADD_2Z -228.560974 +#define ADD_2O 2.836073 + +#define ADD_3X 808.710632 +#define ADD_3Y -852.845764 +#define ADD_3Z -227.914963 +#define ADD_3O 0.964207 + +#define ADD_4X 786.597107 +#define ADD_4Y -821.132874 +#define ADD_4Z -226.350128 +#define ADD_4O 0.949377 + +#define ADD_5X 796.219116 +#define ADD_5Y -800.948059 +#define ADD_5Z -226.010361 +#define ADD_5O 0.560603 + +#define ADD_6X 821.602539 +#define ADD_6Y -782.744109 +#define ADD_6Z -226.023575 +#define ADD_6O 6.157440 + +#define ADD_7X 844.924744 +#define ADD_7Y -769.453735 +#define ADD_7Z -225.521698 +#define ADD_7O 4.4539958 + +#define ADD_8X 839.823364 +#define ADD_8Y -810.869385 +#define ADD_8Z -229.683182 +#define ADD_8O 4.693108 + +struct MANGOS_DLL_DECL boss_ragnarosAI : public ScriptedAI +{ + boss_ragnarosAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + } + + uint32 WrathOfRagnaros_Timer; + uint32 HandOfRagnaros_Timer; + uint32 LavaBurst_Timer; + uint32 MagmaBurst_Timer; + uint32 ElementalFire_Timer; + uint32 Erruption_Timer; + uint32 Submerge_Timer; + uint32 Attack_Timer; + Creature *Summoned; + bool HasYelledMagmaBurst; + bool HasSubmergedOnce; + bool WasBanished; + bool HasAura; + + void Reset() + { + WrathOfRagnaros_Timer = 30000; + HandOfRagnaros_Timer = 25000; + LavaBurst_Timer = 10000; + MagmaBurst_Timer = 2000; + Erruption_Timer = 15000; + ElementalFire_Timer = 3000; + Submerge_Timer = 180000; + Attack_Timer = 90000; + HasYelledMagmaBurst = false; + HasSubmergedOnce = false; + WasBanished = false; + + m_creature->CastSpell(m_creature,SPELL_MELTWEAPON,true); + HasAura = true; + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 4)) + return; + + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (WasBanished && Attack_Timer < diff) + { + //Become unbanished again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCastSpellIfCan(m_creature,SPELL_RAGEMERGE); + WasBanished = false; + } else if (WasBanished) + { + Attack_Timer -= diff; + //Do nothing while banished + return; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //WrathOfRagnaros_Timer + if (WrathOfRagnaros_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_WRATHOFRAGNAROS); + + if (urand(0, 1)) + DoScriptText(SAY_WRATH, m_creature); + + WrathOfRagnaros_Timer = 30000; + }else WrathOfRagnaros_Timer -= diff; + + //HandOfRagnaros_Timer + if (HandOfRagnaros_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_HANDOFRAGNAROS); + + if (urand(0, 1)) + DoScriptText(SAY_HAND, m_creature); + + HandOfRagnaros_Timer = 25000; + }else HandOfRagnaros_Timer -= diff; + + //LavaBurst_Timer + if (LavaBurst_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_LAVABURST); + LavaBurst_Timer = 10000; + }else LavaBurst_Timer -= diff; + + //Erruption_Timer + if (LavaBurst_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ERRUPTION); + Erruption_Timer = urand(20000, 45000); + }else Erruption_Timer -= diff; + + //ElementalFire_Timer + if (ElementalFire_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ELEMENTALFIRE); + ElementalFire_Timer = urand(10000, 14000); + }else ElementalFire_Timer -= diff; + + //Submerge_Timer + if (!WasBanished && Submerge_Timer < diff) + { + //Creature spawning and ragnaros becomming unattackable + //is not very well supported in the core + //so added normaly spawning and banish workaround and attack again after 90 secs. + + m_creature->InterruptNonMeleeSpells(false); + //Root self + DoCastSpellIfCan(m_creature,23973); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->HandleEmote(EMOTE_ONESHOT_SUBMERGE); + + if (!HasSubmergedOnce) + { + DoScriptText(SAY_REINFORCEMENTS1, m_creature); + + // summon 10 elementals + for(int i = 0; i < 9; ++i) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + HasSubmergedOnce = true; + WasBanished = true; + DoCastSpellIfCan(m_creature,SPELL_RAGSUBMERGE); + Attack_Timer = 90000; + } + else + { + DoScriptText(SAY_REINFORCEMENTS2, m_creature); + + for(int i = 0; i < 9; ++i) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + WasBanished = true; + DoCastSpellIfCan(m_creature,SPELL_RAGSUBMERGE); + Attack_Timer = 90000; + } + + Submerge_Timer = 180000; + }else Submerge_Timer -= diff; + + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + //Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + else + { + //MagmaBurst_Timer + if (MagmaBurst_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MAGMABURST); + + if (!HasYelledMagmaBurst) + { + DoScriptText(SAY_MAGMABURST, m_creature); + HasYelledMagmaBurst = true; + } + + MagmaBurst_Timer = 2500; + }else MagmaBurst_Timer -= diff; + } + } +}; +CreatureAI* GetAI_boss_ragnaros(Creature* pCreature) +{ + return new boss_ragnarosAI(pCreature); +} + +void AddSC_boss_ragnaros() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ragnaros"; + newscript->GetAI = &GetAI_boss_ragnaros; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp b/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp new file mode 100644 index 0000000..a13a463 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp @@ -0,0 +1,122 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shazzrah +SD%Complete: 75 +SDComment: Teleport NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_ARCANEEXPLOSION = 19712, + SPELL_SHAZZRAHCURSE = 19713, + SPELL_DEADENMAGIC = 19714, + SPELL_COUNTERSPELL = 19715, + SPELL_GATE_DUMMY = 23138 // effect spell: 23139 +}; + +struct MANGOS_DLL_DECL boss_shazzrahAI : public ScriptedAI +{ + boss_shazzrahAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ArcaneExplosion_Timer; + uint32 ShazzrahCurse_Timer; + uint32 DeadenMagic_Timer; + uint32 Countspell_Timer; + uint32 Blink_Timer; + + void Reset() + { + ArcaneExplosion_Timer = 6000; //These times are probably wrong + ShazzrahCurse_Timer = 10000; + DeadenMagic_Timer = 24000; + Countspell_Timer = 15000; + Blink_Timer = 30000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANEEXPLOSION); + ArcaneExplosion_Timer = urand(5000, 9000); + }else ArcaneExplosion_Timer -= diff; + + //ShazzrahCurse_Timer + if (ShazzrahCurse_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_SHAZZRAHCURSE); + + ShazzrahCurse_Timer = urand(25000, 30000); + }else ShazzrahCurse_Timer -= diff; + + //DeadenMagic_Timer + if (DeadenMagic_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DEADENMAGIC); + DeadenMagic_Timer = 35000; + }else DeadenMagic_Timer -= diff; + + //Countspell_Timer + if (Countspell_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_COUNTERSPELL); + Countspell_Timer = urand(16000, 20000); + }else Countspell_Timer -= diff; + + //Blink_Timer + if (Blink_Timer < diff) + { + // Teleporting him to a random gamer and casting Arcane Explosion after that. + DoCastSpellIfCan(m_creature, SPELL_GATE_DUMMY, CAST_TRIGGERED); + + // manual, until added effect of dummy properly + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + m_creature->NearTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), m_creature->GetOrientation()); + + DoCastSpellIfCan(m_creature, SPELL_ARCANEEXPLOSION); + + DoResetThreat(); + + Blink_Timer = 45000; + }else Blink_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_shazzrah(Creature* pCreature) +{ + return new boss_shazzrahAI(pCreature); +} + +void AddSC_boss_shazzrah() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shazzrah"; + newscript->GetAI = &GetAI_boss_shazzrah; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp b/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp new file mode 100644 index 0000000..7451653 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sulfuron_Harbringer +SD%Complete: 80 +SDComment: Adds NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" +#include "molten_core.h" + +#define SPELL_DARKSTRIKE 19777 +#define SPELL_DEMORALIZINGSHOUT 19778 +#define SPELL_INSPIRE 19779 +#define SPELL_KNOCKDOWN 19780 +#define SPELL_FLAMESPEAR 19781 + +//Adds Spells +#define SPELL_HEAL 19775 +#define SPELL_SHADOWWORDPAIN 19776 +#define SPELL_IMMOLATE 20294 + +struct MANGOS_DLL_DECL boss_sulfuronAI : public ScriptedAI +{ + boss_sulfuronAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + uint32 Darkstrike_Timer; + uint32 DemoralizingShout_Timer; + uint32 Inspire_Timer; + uint32 Knockdown_Timer; + uint32 Flamespear_Timer; + ScriptedInstance* m_pInstance; + + void Reset() + { + Darkstrike_Timer=10000; //These times are probably wrong + DemoralizingShout_Timer = 15000; + Inspire_Timer = 13000; + Knockdown_Timer = 6000; + Flamespear_Timer = 2000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //DemoralizingShout_Timer + if (DemoralizingShout_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); + DemoralizingShout_Timer = urand(15000, 20000); + }else DemoralizingShout_Timer -= diff; + + //Inspire_Timer + if (Inspire_Timer < diff) + { + Creature* target = NULL; + std::list pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE); + if (!pList.empty()) + { + std::list::iterator i = pList.begin(); + advance(i, (rand()%pList.size())); + target = (*i); + } + + if (target) + DoCastSpellIfCan(target,SPELL_INSPIRE); + + DoCastSpellIfCan(m_creature,SPELL_INSPIRE); + + Inspire_Timer = urand(20000, 26000); + }else Inspire_Timer -= diff; + + //Knockdown_Timer + if (Knockdown_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = urand(12000, 15000); + }else Knockdown_Timer -= diff; + + //Flamespear_Timer + if (Flamespear_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_FLAMESPEAR); + + Flamespear_Timer = urand(12000, 16000); + }else Flamespear_Timer -= diff; + + //DarkStrike_Timer + if (Darkstrike_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_DARKSTRIKE); + Darkstrike_Timer = urand(15000, 18000); + }else Darkstrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI +{ + mob_flamewaker_priestAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + uint32 Heal_Timer; + uint32 ShadowWordPain_Timer; + uint32 Immolate_Timer; + + ScriptedInstance* m_pInstance; + + void Reset() + { + Heal_Timer = urand(15000, 30000); + ShadowWordPain_Timer = 2000; + Immolate_Timer = 8000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Casting Heal to Sulfuron or other Guards. + if (Heal_Timer < diff) + { + Unit* pUnit = DoSelectLowestHpFriendly(60.0f, 1); + if (!pUnit) + return; + + DoCastSpellIfCan(pUnit, SPELL_HEAL); + + Heal_Timer = urand(15000, 20000); + }else Heal_Timer -= diff; + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_SHADOWWORDPAIN); + + ShadowWordPain_Timer = urand(18000, 26000); + }else ShadowWordPain_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_IMMOLATE); + + Immolate_Timer = urand(15000, 25000); + }else Immolate_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_sulfuron(Creature* pCreature) +{ + return new boss_sulfuronAI(pCreature); +} + +CreatureAI* GetAI_mob_flamewaker_priest(Creature* pCreature) +{ + return new mob_flamewaker_priestAI(pCreature); +} + +void AddSC_boss_sulfuron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_sulfuron"; + newscript->GetAI = &GetAI_boss_sulfuron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flamewaker_priest"; + newscript->GetAI = &GetAI_mob_flamewaker_priest; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp b/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp new file mode 100644 index 0000000..046af55 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp @@ -0,0 +1,287 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Molten_Core +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" +#include "molten_core.h" + +struct MANGOS_DLL_DECL instance_molten_core : public ScriptedInstance +{ + instance_molten_core(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiLucifronGUID, m_uiMagmadarGUID, m_uiGehennasGUID, m_uiGarrGUID, m_uiGeddonGUID, m_uiShazzrahGUID, m_uiSulfuronGUID, m_uiGolemaggGUID, m_uiMajorDomoGUID, m_uiRagnarosGUID, m_uiFlamewakerPriestGUID; + uint64 m_uiRuneKoroGUID, m_uiRuneZethGUID, m_uiRuneMazjGUID, m_uiRuneTheriGUID, m_uiRuneBlazGUID, m_uiRuneKressGUID, m_uiRuneMohnGUID, m_uiFirelordCacheGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiLucifronGUID = 0; + m_uiMagmadarGUID = 0; + m_uiGehennasGUID = 0; + m_uiGarrGUID = 0; + m_uiGeddonGUID = 0; + m_uiShazzrahGUID = 0; + m_uiSulfuronGUID = 0; + m_uiGolemaggGUID = 0; + m_uiMajorDomoGUID = 0; + m_uiRagnarosGUID = 0; + m_uiFlamewakerPriestGUID = 0; + + m_uiRuneKoroGUID = 0; + m_uiRuneZethGUID = 0; + m_uiRuneMazjGUID = 0; + m_uiRuneTheriGUID = 0; + m_uiRuneBlazGUID = 0; + m_uiRuneKressGUID = 0; + m_uiRuneMohnGUID = 0; + + m_uiFirelordCacheGUID = 0; + } + + bool IsEncounterInProgress() const + { + return false; + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 176951: //Sulfuron + m_uiRuneKoroGUID = pGo->GetGUID(); + break; + case 176952: //Geddon + m_uiRuneZethGUID = pGo->GetGUID(); + break; + case 176953: //Shazzrah + m_uiRuneMazjGUID = pGo->GetGUID(); + break; + case 176954: //Golemagg + m_uiRuneTheriGUID = pGo->GetGUID(); + break; + case 176955: //Garr + m_uiRuneBlazGUID = pGo->GetGUID(); + break; + case 176956: //Magmadar + m_uiRuneKressGUID = pGo->GetGUID(); + break; + case 176957: //Gehennas + m_uiRuneMohnGUID = pGo->GetGUID(); + break; + case 179703: + m_uiFirelordCacheGUID = pGo->GetGUID(); //majordomo event chest + break; + } + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_LUCIFRON: + m_uiLucifronGUID = pCreature->GetGUID(); + break; + case NPC_MAGMADAR: + m_uiMagmadarGUID = pCreature->GetGUID(); + break; + case NPC_GEHENNAS: + m_uiGehennasGUID = pCreature->GetGUID(); + break; + case NPC_GARR: + m_uiGarrGUID = pCreature->GetGUID(); + break; + case NPC_GEDDON: + m_uiGeddonGUID = pCreature->GetGUID(); + break; + case NPC_SHAZZRAH: + m_uiShazzrahGUID = pCreature->GetGUID(); + break; + case NPC_SULFURON: + m_uiSulfuronGUID = pCreature->GetGUID(); + break; + case NPC_GOLEMAGG: + m_uiGolemaggGUID = pCreature->GetGUID(); + break; + case NPC_DOMO: + m_uiMajorDomoGUID = pCreature->GetGUID(); + break; + case NPC_RAGNAROS: + m_uiRagnarosGUID = pCreature->GetGUID(); + break; + case NPC_FLAMEWAKERPRIEST: + m_uiFlamewakerPriestGUID = pCreature->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_SULFURON: + m_auiEncounter[0] = uiData; + break; + case TYPE_GEDDON: + m_auiEncounter[1] = uiData; + break; + case TYPE_SHAZZRAH: + m_auiEncounter[2] = uiData; + break; + case TYPE_GOLEMAGG: + m_auiEncounter[3] = uiData; + break; + case TYPE_GARR: + m_auiEncounter[4] = uiData; + break; + case TYPE_MAGMADAR: + m_auiEncounter[5] = uiData; + break; + case TYPE_GEHENNAS: + m_auiEncounter[6] = uiData; + break; + case TYPE_LUCIFRON: + m_auiEncounter[7] = uiData; + break; + case TYPE_MAJORDOMO: + if (uiData == DONE) + DoRespawnGameObject(m_uiFirelordCacheGUID); + m_auiEncounter[8] = uiData; + break; + case TYPE_RAGNAROS: + m_auiEncounter[9] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " " + << m_auiEncounter[9]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + bool CanSpawnMajorDomo() + { + return m_auiEncounter[0] && m_auiEncounter[1] && m_auiEncounter[2] && m_auiEncounter[3] && + m_auiEncounter[4] && m_auiEncounter[5] && m_auiEncounter[6]; + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_SULFURON: + return m_auiEncounter[0]; + case TYPE_GEDDON: + return m_auiEncounter[1]; + case TYPE_SHAZZRAH: + return m_auiEncounter[2]; + case TYPE_GOLEMAGG: + return m_auiEncounter[3]; + case TYPE_GARR: + return m_auiEncounter[4]; + case TYPE_MAGMADAR: + return m_auiEncounter[5]; + case TYPE_GEHENNAS: + return m_auiEncounter[6]; + case TYPE_LUCIFRON: + return m_auiEncounter[7]; + case TYPE_MAJORDOMO: + return m_auiEncounter[8]; + case TYPE_RAGNAROS: + return m_auiEncounter[9]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_SULFURON: + return m_uiSulfuronGUID; + case DATA_GOLEMAGG: + return m_uiGolemaggGUID; + case DATA_GARR: + return m_uiGarrGUID; + case DATA_MAJORDOMO: + return m_uiMajorDomoGUID; + } + + return 0; + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] + >> m_auiEncounter[8] >> m_auiEncounter[9]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstance_instance_molten_core(Map* pMap) +{ + return new instance_molten_core(pMap); +} + +void AddSC_instance_molten_core() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_molten_core"; + newscript->GetInstanceData = &GetInstance_instance_molten_core; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/molten_core/molten_core.cpp b/scripts/eastern_kingdoms/molten_core/molten_core.cpp new file mode 100644 index 0000000..564566c --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/molten_core.cpp @@ -0,0 +1,31 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Molten_Core +SD%Complete: +SDComment: +SDCategory: Molten Core +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" + +void AddSC_molten_core() +{ +} diff --git a/scripts/eastern_kingdoms/molten_core/molten_core.h b/scripts/eastern_kingdoms/molten_core/molten_core.h new file mode 100644 index 0000000..0cd1f35 --- /dev/null +++ b/scripts/eastern_kingdoms/molten_core/molten_core.h @@ -0,0 +1,43 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MOLTEN_CORE_H +#define DEF_MOLTEN_CORE_H + +enum +{ + MAX_ENCOUNTER = 10, + + NPC_LUCIFRON = 12118, + NPC_MAGMADAR = 11982, + NPC_GEHENNAS = 12259, + NPC_GARR = 12057, + NPC_GEDDON = 12056, + NPC_SHAZZRAH = 12264, + NPC_GOLEMAGG = 11988, + NPC_SULFURON = 12098, + NPC_DOMO = 12018, + NPC_RAGNAROS = 11502, + NPC_FLAMEWAKERPRIEST = 11662, + + TYPE_SULFURON = 1, + TYPE_GEDDON = 2, + TYPE_SHAZZRAH = 3, + TYPE_GOLEMAGG = 4, + TYPE_GARR = 5, + TYPE_MAGMADAR = 6, + TYPE_GEHENNAS = 7, + TYPE_LUCIFRON = 8, + TYPE_MAJORDOMO = 9, + TYPE_RAGNAROS = 10, + + DATA_SULFURON = 11, + DATA_GOLEMAGG = 12, + DATA_GARR = 13, + DATA_MAJORDOMO = 14, + + DATA_BOSSES_DEAD_CHECK = 15 +}; + +#endif diff --git a/scripts/eastern_kingdoms/redridge_mountains.cpp b/scripts/eastern_kingdoms/redridge_mountains.cpp new file mode 100644 index 0000000..07f4f40 --- /dev/null +++ b/scripts/eastern_kingdoms/redridge_mountains.cpp @@ -0,0 +1,145 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: redridge_mountains +SD%Complete: 100% +SDComment: Quest support: 219 +SDCategory: Redridge Mountains +EndScriptData */ + +/* ContentData +npc_corporal_keeshan */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_corporal_leehsan +######*/ + +enum +{ + QUEST_MISSING_IN_ACTION = 219, + + SPELL_MOCKING_BLOW = 21008, + SPELL_SHIELD_BASH = 11972, + + SAY_CORPORAL_KEESHAN_1 = -1000561, + SAY_CORPORAL_KEESHAN_2 = -1000562, + SAY_CORPORAL_KEESHAN_3 = -1000563, + SAY_CORPORAL_KEESHAN_4 = -1000564, + SAY_CORPORAL_KEESHAN_5 = -1000565, +}; + +struct MANGOS_DLL_DECL npc_corporal_keeshan_escortAI : public npc_escortAI +{ + npc_corporal_keeshan_escortAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + uint32 m_uiMockingBlowTimer; + uint32 m_uiShieldBashTimer; + + void Reset() + { + m_uiMockingBlowTimer = 5000; + m_uiShieldBashTimer = 8000; + } + + void WaypointStart(uint32 uiWP) + { + switch (uiWP) + { + case 27: //break outside + DoScriptText(SAY_CORPORAL_KEESHAN_3, m_creature); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + break; + case 54: //say goodbye + DoScriptText(SAY_CORPORAL_KEESHAN_5, m_creature); + break; + } + } + + void WaypointReached(uint32 uiWP) + { + switch (uiWP) + { + case 26: //break outside + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + DoScriptText(SAY_CORPORAL_KEESHAN_2, m_creature); + break; + case 53: //quest_complete + DoScriptText(SAY_CORPORAL_KEESHAN_4, m_creature); + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_MISSING_IN_ACTION, m_creature); + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + //Combat check + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiMockingBlowTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MOCKING_BLOW); + m_uiMockingBlowTimer = 5000; + } + else + m_uiMockingBlowTimer -= uiDiff; + + if (m_uiShieldBashTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHIELD_BASH); + m_uiShieldBashTimer = 8000; + } + else + m_uiShieldBashTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_corporal_keeshan(Creature* pCreature) +{ + return new npc_corporal_keeshan_escortAI(pCreature); +} + +bool QuestAccept_npc_corporal_keeshan(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_IN_ACTION) + { + if (npc_corporal_keeshan_escortAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + DoScriptText(SAY_CORPORAL_KEESHAN_1, pCreature); + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + } + + return true; +} + +void AddSC_redridge_mountains() +{ + Script* NewScript; + + NewScript = new Script; + NewScript->Name = "npc_corporal_keeshan"; + NewScript->GetAI = &GetAI_npc_corporal_keeshan; + NewScript->pQuestAccept = &QuestAccept_npc_corporal_keeshan; + NewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp b/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp new file mode 100644 index 0000000..34f9c62 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_enclave/ebon_hold.cpp @@ -0,0 +1,3591 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ebon_Hold +SD%Complete: 80 +SDComment: Quest support: 12848, 12733, 12739(and 12742 to 12750), 12727 +SDCategory: Ebon Hold +EndScriptData */ + +/* ContentData +npc_a_special_surprise +npc_death_knight_initiate +npc_unworthy_initiate_anchor +npc_unworthy_initiate +go_acherus_soul_prison +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "WorldPacket.h" +#include "follower_ai.h" + +/*###### +## npc_a_special_surprise +######*/ + +enum SpecialSurprise +{ + SAY_EXEC_START_1 = -1609025, // speech for all + SAY_EXEC_START_2 = -1609026, + SAY_EXEC_START_3 = -1609027, + SAY_EXEC_PROG_1 = -1609028, + SAY_EXEC_PROG_2 = -1609029, + SAY_EXEC_PROG_3 = -1609030, + SAY_EXEC_PROG_4 = -1609031, + SAY_EXEC_PROG_5 = -1609032, + SAY_EXEC_PROG_6 = -1609033, + SAY_EXEC_PROG_7 = -1609034, + SAY_EXEC_NAME_1 = -1609035, + SAY_EXEC_NAME_2 = -1609036, + SAY_EXEC_RECOG_1 = -1609037, + SAY_EXEC_RECOG_2 = -1609038, + SAY_EXEC_RECOG_3 = -1609039, + SAY_EXEC_RECOG_4 = -1609040, + SAY_EXEC_RECOG_5 = -1609041, + SAY_EXEC_RECOG_6 = -1609042, + SAY_EXEC_NOREM_1 = -1609043, + SAY_EXEC_NOREM_2 = -1609044, + SAY_EXEC_NOREM_3 = -1609045, + SAY_EXEC_NOREM_4 = -1609046, + SAY_EXEC_NOREM_5 = -1609047, + SAY_EXEC_NOREM_6 = -1609048, + SAY_EXEC_NOREM_7 = -1609049, + SAY_EXEC_NOREM_8 = -1609050, + SAY_EXEC_NOREM_9 = -1609051, + SAY_EXEC_THINK_1 = -1609052, + SAY_EXEC_THINK_2 = -1609053, + SAY_EXEC_THINK_3 = -1609054, + SAY_EXEC_THINK_4 = -1609055, + SAY_EXEC_THINK_5 = -1609056, + SAY_EXEC_THINK_6 = -1609057, + SAY_EXEC_THINK_7 = -1609058, + SAY_EXEC_THINK_8 = -1609059, + SAY_EXEC_THINK_9 = -1609060, + SAY_EXEC_THINK_10 = -1609061, + SAY_EXEC_LISTEN_1 = -1609062, + SAY_EXEC_LISTEN_2 = -1609063, + SAY_EXEC_LISTEN_3 = -1609064, + SAY_EXEC_LISTEN_4 = -1609065, + SAY_PLAGUEFIST = -1609066, + SAY_EXEC_TIME_1 = -1609067, + SAY_EXEC_TIME_2 = -1609068, + SAY_EXEC_TIME_3 = -1609069, + SAY_EXEC_TIME_4 = -1609070, + SAY_EXEC_TIME_5 = -1609071, + SAY_EXEC_TIME_6 = -1609072, + SAY_EXEC_TIME_7 = -1609073, + SAY_EXEC_TIME_8 = -1609074, + SAY_EXEC_TIME_9 = -1609075, + SAY_EXEC_TIME_10 = -1609076, + SAY_EXEC_WAITING = -1609077, + EMOTE_DIES = -1609078, + + NPC_PLAGUEFIST = 29053 +}; + +struct MANGOS_DLL_DECL npc_a_special_surpriseAI : public ScriptedAI +{ + npc_a_special_surpriseAI(Creature *pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiExecuteSpeech_Timer; + uint32 m_uiExecuteSpeech_Counter; + uint64 m_uiPlayerGUID; + + void Reset() + { + m_uiExecuteSpeech_Timer = 0; + m_uiExecuteSpeech_Counter = 0; + m_uiPlayerGUID = 0; + } + + bool MeetQuestCondition(Player* pPlayer) + { + switch(m_creature->GetEntry()) + { + case 29061: // Ellen Stanbridge + if (pPlayer->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29072: // Kug Ironjaw + if (pPlayer->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29067: // Donovan Pulfrost + if (pPlayer->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29065: // Yazmina Oakenthorn + if (pPlayer->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29071: // Antoine Brack + if (pPlayer->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29032: // Malar Bravehorn + if (pPlayer->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29068: // Goby Blastenheimer + if (pPlayer->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29073: // Iggy Darktusk + if (pPlayer->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29074: // Lady Eonys + if (pPlayer->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE) + return true; + break; + case 29070: // Valok the Righteous + if (pPlayer->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE) + return true; + break; + } + + return false; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_uiPlayerGUID || pWho->GetTypeId() != TYPEID_PLAYER || !pWho->IsWithinDist(m_creature, INTERACTION_DISTANCE)) + return; + + if (MeetQuestCondition((Player*)pWho)) + m_uiPlayerGUID = pWho->GetGUID(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiPlayerGUID && !m_creature->getVictim() && m_creature->isAlive()) + { + if (m_uiExecuteSpeech_Timer < uiDiff) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pPlayer) + { + Reset(); + return; + } + + //TODO: simplify text's selection + + switch(pPlayer->getRace()) + { + case RACE_HUMAN: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_5, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_5, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_7, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_6, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_ORC: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_6, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_7, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_8, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_8, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_DWARF: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_2, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_2, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_3, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_2, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_5, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_2, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_3, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_NIGHTELF: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_5, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_6, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_2, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_7, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_UNDEAD_PLAYER: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_3, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_4, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_3, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_1, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_3, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_4, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_TAUREN: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_1, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_5, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_8, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_9, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_9, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_GNOME: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_4, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_4, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_6, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_5, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_TROLL: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_3, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_7, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_2, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_6, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_9, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_10, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_4, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_10, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_BLOODELF: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_1, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_1, m_creature, pPlayer); break; + //case 5: //unknown + case 6: DoScriptText(SAY_EXEC_THINK_3, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_1, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + case RACE_DRAENEI: + switch(m_uiExecuteSpeech_Counter) + { + case 0: DoScriptText(SAY_EXEC_START_1, m_creature, pPlayer); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_STAND); break; + case 2: DoScriptText(SAY_EXEC_PROG_1, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_EXEC_NAME_1, m_creature, pPlayer); break; + case 4: DoScriptText(SAY_EXEC_RECOG_2, m_creature, pPlayer); break; + case 5: DoScriptText(SAY_EXEC_NOREM_1, m_creature, pPlayer); break; + case 6: DoScriptText(SAY_EXEC_THINK_4, m_creature, pPlayer); break; + case 7: DoScriptText(SAY_EXEC_LISTEN_1, m_creature, pPlayer); break; + case 8: + if (Creature* pPlaguefist = GetClosestCreatureWithEntry(m_creature, NPC_PLAGUEFIST, 85.0f)) + DoScriptText(SAY_PLAGUEFIST, pPlaguefist, pPlayer); + break; + case 9: + DoScriptText(SAY_EXEC_TIME_2, m_creature, pPlayer); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + break; + case 10: DoScriptText(SAY_EXEC_WAITING, m_creature, pPlayer); break; + case 11: + DoScriptText(EMOTE_DIES, m_creature); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetHealth(0); + return; + } + break; + } + + if (m_uiExecuteSpeech_Counter >= 9) + m_uiExecuteSpeech_Timer = 15000; + else + m_uiExecuteSpeech_Timer = 7000; + + ++m_uiExecuteSpeech_Counter; + } + else + m_uiExecuteSpeech_Timer -= uiDiff; + } + } +}; + +/*###### +## npc_death_knight_initiate +######*/ + +enum npc_death_knight_initiate +{ + SAY_DUEL_A = -1609016, + SAY_DUEL_B = -1609017, + SAY_DUEL_C = -1609018, + SAY_DUEL_D = -1609019, + SAY_DUEL_E = -1609020, + SAY_DUEL_F = -1609021, + SAY_DUEL_G = -1609022, + SAY_DUEL_H = -1609023, + SAY_DUEL_I = -1609024, + + SPELL_BLOOD_STRIKE = 52374, + SPELL_DEATH_COIL = 52375, + SPELL_ICY_TOUCH = 52372, + SPELL_PLAGUE_STRIKE = 52373, + + SPELL_DUEL = 52996, + SPELL_DUEL_TRIGGERED = 52990, + SPELL_DUEL_VICTORY = 52994, + SPELL_DUEL_FLAG = 52991, + + QUEST_DEATH_CHALLENGE = 12733, + FACTION_HOSTILE = 2068 +}; + +int32 m_auiRandomSay[] = +{ + SAY_DUEL_A, SAY_DUEL_B, SAY_DUEL_C, SAY_DUEL_D, SAY_DUEL_E, SAY_DUEL_F, SAY_DUEL_G, SAY_DUEL_H, SAY_DUEL_I +}; + +#define GOSSIP_ACCEPT_DUEL "I challenge you, death knight!" + +struct MANGOS_DLL_DECL npc_death_knight_initiateAI : public ScriptedAI +{ + npc_death_knight_initiateAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint64 m_uiDuelerGUID; + uint32 m_uiDuelTimer; + uint32 m_uiBloodStrike_Timer; + uint32 m_uiDeathCoil_Timer; + uint32 m_uiIcyTouch_Timer; + uint32 m_uiPlagueStrike_Timer; + bool m_bIsDuelInProgress; + + void Reset() + { + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); + + m_uiDuelerGUID = 0; + m_uiDuelTimer = 5000; + m_uiBloodStrike_Timer = 4000; + m_uiDeathCoil_Timer = 5000; + m_uiIcyTouch_Timer = 2000; + m_uiPlagueStrike_Timer = 3000; + m_bIsDuelInProgress = false; + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (!m_bIsDuelInProgress && pSpell->Id == SPELL_DUEL_TRIGGERED && pCaster->GetTypeId() == TYPEID_PLAYER) + { + m_uiDuelerGUID = pCaster->GetGUID(); + m_bIsDuelInProgress = true; + } + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_bIsDuelInProgress && uiDamage > m_creature->GetHealth()) + { + uiDamage = 0; + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiDuelerGUID)) + m_creature->CastSpell(pPlayer, SPELL_DUEL_VICTORY, true); + + //possibly not evade, but instead have end sequenze + EnterEvadeMode(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (m_bIsDuelInProgress) + { + if (m_uiDuelTimer < uiDiff) + { + m_creature->setFaction(FACTION_HOSTILE); + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiDuelerGUID)) + AttackStart(pPlayer); + } + else + m_uiDuelTimer -= uiDiff; + } + return; + } + + if (m_uiIcyTouch_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ICY_TOUCH); + m_uiIcyTouch_Timer = 8000; + } + else + m_uiIcyTouch_Timer -= uiDiff; + + if (m_uiPlagueStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PLAGUE_STRIKE); + m_uiPlagueStrike_Timer = 8000; + } + else + m_uiPlagueStrike_Timer -= uiDiff; + + if (m_uiBloodStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLOOD_STRIKE); + m_uiBloodStrike_Timer = 8000; + } + else + m_uiBloodStrike_Timer -= uiDiff; + + if (m_uiDeathCoil_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DEATH_COIL); + m_uiDeathCoil_Timer = 8000; + } + else + m_uiDeathCoil_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_death_knight_initiate(Creature* pCreature) +{ + return new npc_death_knight_initiateAI(pCreature); +} + +bool GossipHello_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_DEATH_CHALLENGE) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ACCEPT_DUEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(13433, pCreature->GetGUID()); + return true; + } + return false; +} + +bool GossipSelect_npc_death_knight_initiate(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_death_knight_initiateAI* pInitiateAI = dynamic_cast(pCreature->AI())) + { + if (pInitiateAI->m_bIsDuelInProgress) + return true; + } + + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_UNK_15); + + int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); + DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); + + pCreature->CastSpell(pPlayer, SPELL_DUEL, false); + pCreature->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); + } + return true; +} + +/*###### +## npc_koltira_deathweaver +######*/ + +enum eKoltira +{ + SAY_BREAKOUT1 = -1609079, + SAY_BREAKOUT2 = -1609080, + SAY_BREAKOUT3 = -1609081, + SAY_BREAKOUT4 = -1609082, + SAY_BREAKOUT5 = -1609083, + SAY_BREAKOUT6 = -1609084, + SAY_BREAKOUT7 = -1609085, + SAY_BREAKOUT8 = -1609086, + SAY_BREAKOUT9 = -1609087, + SAY_BREAKOUT10 = -1609088, + + SPELL_KOLTIRA_TRANSFORM = 52899, + SPELL_ANTI_MAGIC_ZONE = 52894, + + QUEST_BREAKOUT = 12727, + + NPC_CRIMSON_ACOLYTE = 29007, + NPC_HIGH_INQUISITOR_VALROTH = 29001, + NPC_KOLTIRA_ALT = 28447, + + MODEL_DEATH_KNIGHT_MOUNT = 25278 +}; + +struct MANGOS_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI +{ + npc_koltira_deathweaverAI(Creature *pCreature) : npc_escortAI(pCreature) { Reset(); } + + uint32 m_uiWave; + uint32 m_uiWave_Timer; + uint64 m_uiValrothGUID; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + m_uiWave = 0; + m_uiWave_Timer = 3000; + m_uiValrothGUID = 0; + } + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(SAY_BREAKOUT1, m_creature); + break; + case 1: + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case 2: + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not + //DoCastSpellIfCan(m_creature, SPELL_KOLTIRA_TRANSFORM); + break; + case 3: // Kneel with Anti Magic Zone + SetEscortPaused(true); + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + //m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoScriptText(SAY_BREAKOUT2, m_creature); + DoCastSpellIfCan(m_creature, SPELL_ANTI_MAGIC_ZONE); + break; + case 4: // Valroth dead, he runs away + { + //m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + // just makes him stronger and be able to kill out + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg * 100); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg * 100); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoCastSpellIfCan(m_creature, SPELL_KOLTIRA_TRANSFORM); // Somehow he gets naked + SetRun(true); + break; + } + case 9: + m_creature->Mount(MODEL_DEATH_KNIGHT_MOUNT); + break; + case 10: + m_creature->Unmount(); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (Player* pPlayer = GetPlayerForEscort()) + { + pSummoned->AI()->AttackStart(pPlayer); + pSummoned->AddThreat(pPlayer); + } + + if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) + m_uiValrothGUID = pSummoned->GetGUID(); + } + + void SummonAcolyte(uint32 uiAmount) + { + for(uint32 i = 0; i < uiAmount; ++i) + m_creature->SummonCreature(NPC_CRIMSON_ACOLYTE, 1642.329f, -6045.818f, 127.583f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (m_uiWave_Timer < uiDiff) + { + switch(m_uiWave) + { + case 0: + DoScriptText(SAY_BREAKOUT3, m_creature); + SummonAcolyte(3); + m_uiWave_Timer = 20000; + break; + case 1: + DoScriptText(SAY_BREAKOUT4, m_creature); + SummonAcolyte(3); + m_uiWave_Timer = 20000; + break; + case 2: + DoScriptText(SAY_BREAKOUT5, m_creature); + SummonAcolyte(4); + m_uiWave_Timer = 20000; + break; + case 3: + DoScriptText(SAY_BREAKOUT6, m_creature); + DoCastSpellIfCan(m_creature, SPELL_ANTI_MAGIC_ZONE); + m_creature->SummonCreature(NPC_HIGH_INQUISITOR_VALROTH, 1642.329f, -6045.818f, 127.583f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + m_uiWave_Timer = 1000; + break; + case 4: + { + Creature* pTemp = m_creature->GetMap()->GetCreature(m_uiValrothGUID); + + if (!pTemp || !pTemp->isAlive()) + { + DoScriptText(SAY_BREAKOUT8, m_creature); + m_uiWave_Timer = 5000; + } + else + { + m_uiWave_Timer = 2500; + return; //return, we don't want m_uiWave to increment now + } + break; + } + case 5: + DoScriptText(SAY_BREAKOUT9, m_creature); + m_creature->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); + m_uiWave_Timer = 2500; + break; + case 6: + DoScriptText(SAY_BREAKOUT10, m_creature); + SetEscortPaused(false); + break; + } + + ++m_uiWave; + } + else + m_uiWave_Timer -= uiDiff; + } + else + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_npc_koltira_deathweaver(Creature* pCreature) +{ + return new npc_koltira_deathweaverAI(pCreature); +} + +bool QuestAccept_npc_koltira_deathweaver(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_BREAKOUT) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (npc_koltira_deathweaverAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## Mob High Inquisitor Valroth +######*/ +enum valroth +{ + SAY_VALROTH1 = -1609082, + SAY_VALROTH2 = -1609083, + SAY_VALROTH3 = -1609084, + SAY_VALROTH4 = -1609085, + SAY_VALROTH5 = -1609086, + SAY_VALROTH6 = -1609087, + SPELL_RENEW = 38210, + SPELL_INQUISITOR_PENANCE = 52922, + SPELL_VALROTH_SMITE = 52926, + SPELL_SUMMON_VALROTH_REMAINS = 52929 +}; + +struct MANGOS_DLL_DECL mob_high_inquisitor_valrothAI : public ScriptedAI +{ + mob_high_inquisitor_valrothAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 uiRenew_timer; + uint32 uiInquisitor_Penance_timer; + uint32 uiValroth_Smite_timer; + + void Reset() + { + uiRenew_timer = 1000; + uiInquisitor_Penance_timer = 2000; + uiValroth_Smite_timer = 1000; + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_VALROTH2, m_creature); + DoCast(who, SPELL_VALROTH_SMITE); + } + + void UpdateAI(const uint32 diff) + { + if (uiRenew_timer < diff) + { + Shout(); + DoCast(m_creature, SPELL_RENEW); + uiRenew_timer = 1000 + rand()%5000; + }else uiRenew_timer -= diff; + + if (uiInquisitor_Penance_timer < diff) + { + Shout(); + DoCast(m_creature->getVictim(), SPELL_INQUISITOR_PENANCE); + uiInquisitor_Penance_timer = 2000 + rand()%5000; + }else uiInquisitor_Penance_timer -= diff; + + if (uiValroth_Smite_timer < diff) + { + Shout(); + DoCast(m_creature->getVictim(), SPELL_VALROTH_SMITE); + uiValroth_Smite_timer = 1000 + rand()%5000; + }else uiValroth_Smite_timer -= diff; + + DoMeleeAttackIfReady(); + } + + void Shout() + { + switch(rand()%20) + { + case 0: DoScriptText(SAY_VALROTH3, m_creature);break; + case 1: DoScriptText(SAY_VALROTH4, m_creature);break; + case 2: DoScriptText(SAY_VALROTH5, m_creature);break; + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_VALROTH6, m_creature); + killer->CastSpell(m_creature, SPELL_SUMMON_VALROTH_REMAINS, true); + } +}; + +/*###### +## Quest: The Endless Hunger +######*/ + +enum npc_unworthy_initiate +{ + SAY_START = -1609000, // 8 texts in total, GetTextId() generates random with this as base + SAY_AGGRO = -1609008, // 8 texts in total, GetTextId() generates random with this as base + + //SPELL_CHAINED_PESANT_LH = 54602, // not used. possible it determine side, where to go get "weapon" + //SPELL_CHAINED_PESANT_RH = 54610, + SPELL_CHAINED_PESANT_CHEST = 54612, + SPELL_CHAINED_PESANT_BREATH = 54613, + SPELL_INITIATE_VISUAL = 51519, + + //SPELL_BLOOD_STRIKE = 52374, // Already declared in npc_death_knight_initiate + //SPELL_DEATH_COIL = 52375, + //SPELL_ICY_TOUCH = 52372, + //SPELL_PLAGUE_STRIKE = 52373, + + NPC_ANCHOR = 29521, + FACTION_MONSTER = 16, + + PHASE_INACTIVE_OR_COMBAT = 0, + PHASE_DRESSUP = 1, + PHASE_ACTIVATE = 2 +}; + +struct DisplayToSpell +{ + uint32 m_uiDisplayId; + uint32 m_uiSpellToNewDisplay; +}; + +DisplayToSpell m_aDisplayToSpell[] = +{ + {25354, 51520}, // human M + {25355, 51534}, // human F + {25356, 51538}, // dwarf M + {25357, 51541}, // draenei M + {25358, 51535}, // nelf M + {25359, 51539}, // gnome M + {25360, 51536}, // nelf F + {25361, 51537}, // dwarf F + {25362, 51540}, // gnome F + {25363, 51542}, // draenei F + {25364, 51543}, // orc M + {25365, 51546}, // troll M + {25366, 51547}, // tauren M + {25367, 51549}, // forsaken M + {25368, 51544}, // orc F + {25369, 51552}, // belf F + {25370, 51545}, // troll F + {25371, 51548}, // tauren F + {25372, 51550}, // forsaken F + {25373, 51551} // belf M +}; + +/*###### +## npc_unworthy_initiate_anchor +######*/ + +struct MANGOS_DLL_DECL npc_unworthy_initiate_anchorAI : public ScriptedAI +{ + npc_unworthy_initiate_anchorAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiMyInitiate = 0; + Reset(); + } + + uint64 m_uiMyInitiate; + uint64 m_uiMyPrisonGUID; + + void Reset() { } + + void NotifyMe(Unit* pSource, uint64 uiPrisonGuid) + { + m_uiMyPrisonGUID = uiPrisonGuid; + Creature* pInitiate = m_creature->GetMap()->GetCreature(m_uiMyInitiate); + + if (pInitiate && pSource) + { + pInitiate->SetLootRecipient(pSource); + m_creature->CastSpell(pInitiate,SPELL_CHAINED_PESANT_BREATH,true); + } + } + + void RegisterCloseInitiate(uint64 uiGuid) + { + m_uiMyInitiate = uiGuid; + } + + void ResetPrison() + { + if (GameObject* pPrison = m_creature->GetMap()->GetGameObject(m_uiMyPrisonGUID)) + pPrison->ResetDoorOrButton(); + } +}; + +/*###### +## npc_unworthy_initiate +######*/ + +struct MANGOS_DLL_DECL npc_unworthy_initiateAI : public ScriptedAI +{ + npc_unworthy_initiateAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pToTransform = NULL; + + uint32 uiDisplayCount = sizeof(m_aDisplayToSpell)/sizeof(DisplayToSpell); + + for (uint8 i=0; iGetDisplayId()) + { + m_pToTransform = &m_aDisplayToSpell[i]; + break; + } + } + + m_uiNormFaction = pCreature->getFaction(); + Reset(); + } + + DisplayToSpell* m_pToTransform; + + uint64 m_uiMyAnchorGUID; + uint32 m_uiNormFaction; + uint32 m_uiAnchorCheckTimer; + uint32 m_uiPhase; + uint32 m_uiPhaseTimer; + uint32 m_uiBloodStrike_Timer; + uint32 m_uiDeathCoil_Timer; + uint32 m_uiIcyTouch_Timer; + uint32 m_uiPlagueStrike_Timer; + + void Reset() + { + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + + m_uiMyAnchorGUID = 0; + m_uiAnchorCheckTimer = 5000; + m_uiPhase = PHASE_INACTIVE_OR_COMBAT; + m_uiPhaseTimer = 7500; + m_uiBloodStrike_Timer = 4000; + m_uiDeathCoil_Timer = 6000; + m_uiIcyTouch_Timer = 2000; + m_uiPlagueStrike_Timer = 5000; + } + + void JustReachedHome() + { + SetAnchor(); + } + + void JustRespawned() + { + if (Creature* pAnchor = GetAnchor()) + { + if (npc_unworthy_initiate_anchorAI* pAnchorAI = dynamic_cast(pAnchor->AI())) + pAnchorAI->ResetPrison(); + } + + Reset(); + } + + int32 GetTextId() + { + return m_uiPhase == PHASE_DRESSUP ? SAY_START-rand()%8 : SAY_AGGRO-rand()%8; + } + + Creature* GetAnchor() + { + if (m_uiMyAnchorGUID) + return m_creature->GetMap()->GetCreature(m_uiMyAnchorGUID); + else + return GetClosestCreatureWithEntry(m_creature, NPC_ANCHOR, INTERACTION_DISTANCE*2); + } + + void SetAnchor() + { + if (Creature* pAnchor = GetAnchor()) + { + if (npc_unworthy_initiate_anchorAI* pAnchorAI = dynamic_cast(pAnchor->AI())) + pAnchorAI->RegisterCloseInitiate(m_creature->GetGUID()); + + pAnchor->CastSpell(m_creature, SPELL_CHAINED_PESANT_CHEST, false); + + m_uiAnchorCheckTimer = 0; + return; + } + + m_uiAnchorCheckTimer = 5000; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_CHAINED_PESANT_BREATH) + { + pCaster->InterruptNonMeleeSpells(true); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_uiPhase = PHASE_DRESSUP; + + if (Player* pSource = m_creature->GetLootRecipient()) + DoScriptText(GetTextId(), m_creature, pSource); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiAnchorCheckTimer) + { + if (m_uiAnchorCheckTimer <= uiDiff) + SetAnchor(); + else + m_uiAnchorCheckTimer -= uiDiff; + } + + if (m_uiPhase == PHASE_INACTIVE_OR_COMBAT) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBloodStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLOOD_STRIKE); + m_uiBloodStrike_Timer = 9000; + } + else + m_uiBloodStrike_Timer -= uiDiff; + + if (m_uiDeathCoil_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DEATH_COIL); + m_uiDeathCoil_Timer = 8000; + } + else + m_uiDeathCoil_Timer -= uiDiff; + + if (m_uiIcyTouch_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ICY_TOUCH); + m_uiIcyTouch_Timer = 8000; + } + else + m_uiIcyTouch_Timer -= uiDiff; + + if (m_uiPlagueStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PLAGUE_STRIKE); + m_uiPlagueStrike_Timer = 8000; + } + else + m_uiPlagueStrike_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } + else + { + if (m_uiPhaseTimer < uiDiff) + { + if (m_uiPhase == PHASE_DRESSUP) + { + if (m_pToTransform) + { + m_creature->CastSpell(m_creature, m_pToTransform->m_uiSpellToNewDisplay, true); + m_creature->CastSpell(m_creature, SPELL_INITIATE_VISUAL, false); + } + else + error_log("SD2: npc_unworthy_initiate does not have any spell associated with model"); + + m_uiPhase = PHASE_ACTIVATE; + } + else + { + m_creature->setFaction(FACTION_MONSTER); + + m_uiPhase = PHASE_INACTIVE_OR_COMBAT; + + if (Player* pTarget = m_creature->GetLootRecipient()) + { + DoScriptText(GetTextId(), m_creature, pTarget); + AttackStart(pTarget); + } + } + + m_uiPhaseTimer = 5000; + } + else + m_uiPhaseTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) +{ + return new npc_unworthy_initiateAI(pCreature); +} + +CreatureAI* GetAI_npc_unworthy_initiate_anchor(Creature* pCreature) +{ + return new npc_unworthy_initiate_anchorAI(pCreature); +} + +/*###### +## go_acherus_soul_prison +######*/ + +bool GOHello_go_acherus_soul_prison(Player* pPlayer, GameObject* pGo) +{ + if (Creature* pAnchor = GetClosestCreatureWithEntry(pGo, NPC_ANCHOR, INTERACTION_DISTANCE)) + { + if (npc_unworthy_initiate_anchorAI* pAnchorAI = dynamic_cast(pAnchor->AI())) + pAnchorAI->NotifyMe(pPlayer, pGo->GetGUID()); + } + + return false; +} + +/*###### +## npc_eye_of_acherus +######*/ + +struct MANGOS_DLL_DECL npc_eye_of_acherusAI : public ScriptedAI +{ + npc_eye_of_acherusAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_creature->SetActiveObjectState(true); + m_creature->SetLevel(55); //else one hack + StartTimer = 2000; + Active = false; + } + + uint32 StartTimer; + bool Active; + + void Reset(){} + void AttackStart(Unit *) {} + void MoveInLineOfSight(Unit*) {} + + void JustDied(Unit*u) + { + if(!m_creature || m_creature->GetTypeId() != TYPEID_UNIT) + return; + + Unit *target = m_creature->GetCharmer(); + + if(!target || target->GetTypeId() != TYPEID_PLAYER) + return; + + m_creature->SetCharmerGUID(0); + target->RemoveAurasDueToSpell(51852); + target->SetCharm(NULL); + + ((Player*)target)->GetCamera().ResetView(); + ((Player*)target)->SetClientControl(m_creature,0); + ((Player*)target)->SetMover(NULL); + + m_creature->CleanupsBeforeDelete(); + m_creature->AddObjectToRemoveList(); + //m_creature->ForcedDespawn(); + return; + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE && uiPointId == 0) + return; + + char * text = "The Eye of Acherus is in your control"; + m_creature->MonsterTextEmote(text, m_creature->GetGUID(), true); + m_creature->CastSpell(m_creature, 51890, true); + } + + void UpdateAI(const uint32 uiDiff) + { + if(m_creature->isCharmed()) + { + if (StartTimer < uiDiff && !Active) + { + m_creature->CastSpell(m_creature, 70889, true); + m_creature->CastSpell(m_creature, 51892, true); + char * text = "The Eye of Acherus launches towards its destination"; + m_creature->MonsterTextEmote(text, m_creature->GetGUID(), true); + m_creature->SetSpeedRate(MOVE_FLIGHT, 6.4f,true); + m_creature->GetMotionMaster()->MovePoint(0, 1750.8276f, -5873.788f, 147.2266f); + Active = true; + } + else StartTimer -= uiDiff; + } + else + { + m_creature->CleanupsBeforeDelete(); + m_creature->AddObjectToRemoveList(); + } + } +}; + +CreatureAI* GetAI_npc_eye_of_acherus(Creature* pCreature) +{ + return new npc_eye_of_acherusAI(pCreature); +} + +enum zone +{ + SPELL_UNDYING_RESOLVE = 51915, + SPELL_UNDYING_RESOLVE_VISUAL = 51916, + NPC_VALKYR_BATTLE_MAIDEN = 28534 +}; + +void UpdateWorldState(Map *map, uint32 id, uint32 state) +{ + Map::PlayerList const& players = map->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->SendUpdateWorldState(id,state); + } + } +} + +/*###### +## npc_crusade_persuaded - Quest: How To Win Friends And Influence Enemies +######*/ + +enum win_friends +{ + SAY_PERSUADE1 = -1609051, + SAY_PERSUADE2 = -1609052, + SAY_PERSUADE3 = -1609053, + SAY_PERSUADE4 = -1609054, + SAY_PERSUADE5 = -1609055, + SAY_PERSUADE6 = -1609056, + SAY_PERSUADE7 = -1609057, + SAY_CRUSADER1 = -1609058, + SAY_CRUSADER2 = -1609059, + SAY_CRUSADER3 = -1609060, + SAY_CRUSADER4 = -1609061, + SAY_CRUSADER5 = -1609062, + SAY_CRUSADER6 = -1609063, + SAY_PERSUADED1 = -1609064, + SAY_PERSUADED2 = -1609065, + SAY_PERSUADED3 = -1609066, + SAY_PERSUADED4 = -1609067, + SAY_PERSUADED5 = -1609068, + SAY_PERSUADED6 = -1609069, + SPELL_PERSUASIVE_STRIKE = 52781 +}; + +struct MANGOS_DLL_DECL npc_crusade_persuadedAI : public ScriptedAI +{ + npc_crusade_persuadedAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 uiSpeech_timer; + uint32 uiSpeech_counter; + uint32 uiCrusade_faction; + uint64 uiPlayerGUID; + + void Reset() + { + uiSpeech_timer = 0; + uiSpeech_counter = 0; + uiCrusade_faction = 0; + uiPlayerGUID = 0; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == SPELL_PERSUASIVE_STRIKE && uiSpeech_counter == 0) + { + if(((Player*)caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 > 90) // chance + { + uiPlayerGUID = ((Player*)caster)->GetGUID(); + uiCrusade_faction = m_creature->getFaction(); + uiSpeech_timer = 1000; + uiSpeech_counter = 1; + m_creature->setFaction(35); + } + else if (uiSpeech_counter == 0) + { + switch(rand()%6) + { + case 0: DoScriptText(SAY_PERSUADE1, caster);break; + case 1: DoScriptText(SAY_PERSUADE2, caster);break; + case 2: DoScriptText(SAY_PERSUADE3, caster);break; + case 3: DoScriptText(SAY_PERSUADE4, caster);break; + case 4: DoScriptText(SAY_PERSUADE5, caster);break; + case 5: DoScriptText(SAY_PERSUADE6, caster);break; + case 6: DoScriptText(SAY_PERSUADE7, caster);break; + } + switch(rand()%5) + { + case 0: DoScriptText(SAY_CRUSADER1, m_creature);break; + case 1: DoScriptText(SAY_CRUSADER2, m_creature);break; + case 2: DoScriptText(SAY_CRUSADER3, m_creature);break; + case 3: DoScriptText(SAY_CRUSADER4, m_creature);break; + case 4: DoScriptText(SAY_CRUSADER5, m_creature);break; + case 5: DoScriptText(SAY_CRUSADER6, m_creature);break; + } + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (uiSpeech_counter >= 1 && uiSpeech_counter <= 6) + if (uiSpeech_timer < diff) + { + m_creature->CombatStop(true); + m_creature->StopMoving(); + Unit* pPlayer = m_creature->GetMap()->GetUnit(uiPlayerGUID); + + switch(uiSpeech_counter) + { + case 1: DoScriptText(SAY_PERSUADED1, m_creature); uiSpeech_timer = 8000; uiSpeech_counter++; break; + case 2: DoScriptText(SAY_PERSUADED2, m_creature); uiSpeech_timer = 8000; uiSpeech_counter++; break; + case 3: DoScriptText(SAY_PERSUADED3, m_creature); uiSpeech_timer = 8000; uiSpeech_counter++; break; + case 4: DoScriptText(SAY_PERSUADED4, m_creature); uiSpeech_timer = 8000; uiSpeech_counter++; break; + case 5: DoScriptText(SAY_PERSUADED5, pPlayer); uiSpeech_timer = 8000; uiSpeech_counter++; break; + case 6: + DoScriptText(SAY_PERSUADED6, m_creature); + m_creature->setFaction(uiCrusade_faction); + //m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + uiSpeech_timer = 0; + uiCrusade_faction = 0; + uiSpeech_counter++; + AttackStart(pPlayer); + if(((Player*)pPlayer)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) + ((Player*)pPlayer)->AreaExploredOrEventHappens(12720); + break; + } + }else uiSpeech_timer -= diff; + else + DoMeleeAttackIfReady(); + } +}; + +/*###### +## npc_palomino - Quest: Grand Theft Palomino - Vehicle HACK +######*/ +enum npc_palomino +{ + QUEST_GRAND_THEFT_PALOMINO = 12680, + NPC_SALANAR_THE_HORSEMAN = 28653 +}; +struct MANGOS_DLL_DECL npc_palominoAI : public FollowerAI +{ + npc_palominoAI(Creature* pCreature) : FollowerAI(pCreature) { Reset();} + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PASSIVE); + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + } + void MoveInLineOfSight(Unit *pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_SALANAR_THE_HORSEMAN) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*2)) + { + if (Player* pPlayer = GetLeaderForFollower()) + { + pPlayer->KilledMonsterCredit(28767); + } + + SetFollowComplete(); + } + } + } +}; +CreatureAI* GetAI_npc_palomino(Creature* pCreature) +{ + return new npc_palominoAI(pCreature); +} + +bool GossipHello_npc_palomino(Player* pPlayer, Creature* pCreature) +{ + + if (pPlayer->GetQuestStatus(QUEST_GRAND_THEFT_PALOMINO) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM( 0, "Let´s go for a ride!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_palomino(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_palominoAI* ppalominoAI = dynamic_cast(pCreature->AI())) + ppalominoAI->StartFollow(pPlayer, FACTION_ESCORT_N_FRIEND_PASSIVE); + } + return true; +} + +/*###### +## npc_salanar_the_horseman +######*/ +enum salanar +{ + SPELL_REALM_OF_SHADOWS = 52275, + SPELL_HORSEMANS_CALL = 52362, // not working + NPC_ACHERUS_DEATHCHARGER = 28782, + NPC_DARK_RIDER_OF_ACHERUS = 28768 +}; + +bool GossipHello_npc_salanar_the_horseman(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu( pCreature->GetGUID() ); + + if (pPlayer->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM( 0, "Send me into the Realm of Shadows.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_salanar_the_horseman(Player* pPlayer, Creature *pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_REALM_OF_SHADOWS, true); + pPlayer->SummonCreature(NPC_DARK_RIDER_OF_ACHERUS, pCreature->GetPositionX(), pCreature->GetPositionY(), pCreature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000); + break; + } + return true; +} + +/*###### +## mob_dark_rider_of_acherus +######*/ +enum darkrider +{ + //SPELL_ICY_TOUCH = 52372, + //SPELL_BLOOD_STRIKE = 52374, + SPELL_PLAGUE_STRIKE2 = 50688, + SPELL_THROW = 52356, + SPELL_DEATH_RACE_COMPLETE = 52361, + SPELL_ACHERUS_DEATHCHARGER = 48778 +}; +struct Locations2 +{ + float x, y, z; +}; +static Locations2 DarkriderWP[]= +{ + {2317.0f, -5662.0f, 153.1f}, + {2248.4f, -5630.8f, 139.1f}, + {2211.3f, -5658.9f, 122.7f}, + {2144.7f, -5705.0f, 102.1f}, + {2097.5f, -5737.9f, 100.1f}, + {2037.7f, -5738.9f, 99.0f} +}; + +// 52693 +struct MANGOS_DLL_DECL mob_dark_rider_of_acherusAI : public ScriptedAI +{ + mob_dark_rider_of_acherusAI(Creature *pCreature) : ScriptedAI(pCreature) + { + StartRunning(); + } + uint32 id; + uint32 m_uiWalkTimer; + uint32 uiBlood_strike_timer; + uint32 uiIcy_touch_timer; + uint32 uiPlague_strike_timer; + uint32 uiThrow_timer; + + void StartRunning() + { + m_creature->Mount(25279); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->SetSpeedRate(MOVE_RUN, 1.4f); // you cant get him, but see + id = 0; + Reset(); + } + + void Reset() + { + m_creature->GetMotionMaster()->MovePoint(id,DarkriderWP[id].x, DarkriderWP[id].y, DarkriderWP[id].z); + uiBlood_strike_timer = 3000; + uiIcy_touch_timer = 4000; + uiPlague_strike_timer = 5000; + uiThrow_timer = 10000; + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->getVictim()) + { + if (uiBlood_strike_timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BLOOD_STRIKE); + uiBlood_strike_timer = 5000 + rand()%1000; + }else uiBlood_strike_timer -= diff; + + if (uiIcy_touch_timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ICY_TOUCH); + uiIcy_touch_timer = 6000 + rand()%1000; + }else uiIcy_touch_timer -= diff; + + if (uiPlague_strike_timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PLAGUE_STRIKE2); + uiPlague_strike_timer = 12000 + rand()%1000; + }else uiPlague_strike_timer -= diff; + + if (uiThrow_timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THROW); + uiThrow_timer = 10000 + rand()%1000; + }else uiThrow_timer -= diff; + } + if (m_uiWalkTimer) + { + if (m_uiWalkTimer <= diff) + { + m_creature->GetMotionMaster()->MovePoint(id,DarkriderWP[id].x, DarkriderWP[id].y, DarkriderWP[id].z); + m_uiWalkTimer = 0; + + }else m_uiWalkTimer -= diff; + } + + DoMeleeAttackIfReady(); + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + m_creature->CombatStop(); + } + void JustDied(Unit* killer) + { + killer->CastSpell(killer, SPELL_DEATH_RACE_COMPLETE, true); + m_creature->Unmount(); + Creature* pTemp = killer->SummonCreature(NPC_ACHERUS_DEATHCHARGER, m_creature->GetPositionX()+2, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000); + pTemp->setFaction(killer->getFaction()); + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + } + + void MovementInform(uint32 type, uint32 tempid) + { + switch (id) + { + case 1: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + break; + case 5: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + return; + } + + ++id; + m_uiWalkTimer = 200; + } +}; +// Hack untill Vehicle Support +bool GossipHello_npc_acherus_deathcharger(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(12687) == QUEST_STATUS_COMPLETE) + { + pPlayer->Mount(25279); + pCreature->ForcedDespawn(); + } + return true; +} + +/*###### +## mob_scarlet_miner +######*/ +enum scarletminer +{ + NPC_SCARLET_GHOUL = 28845, + SPELL_GIFT_OF_THE_HARVESTER = 52479, // only works, when ghouls attack you + SPELL_GIFT_OF_THE_HARVESTER_MISSILE = 52481, + SPELL_SCARLET_MINER_GHOUL_TRANSFORM = 52490, // approx 35% + SPELL_SCARLET_MINER_GHOST_TRANSFORM = 52505, + SPELL_SCARLET_GHOUL_CREDIT = 52517, // not working + SPELL_GHOULPLOSION_GOTHIK = 52519, // no idea how to implement, but spell works + SPELL_GHOULZAP = 52521 // not working + +}; + +struct MANGOS_DLL_DECL mob_scarlet_minerAI : public ScriptedAI +{ + mob_scarlet_minerAI(Creature *pCreature) : ScriptedAI(pCreature) + { + // hack spell 52481 + SpellEntry *TempSpell = (SpellEntry*)GetSpellStore()->LookupEntry(SPELL_GIFT_OF_THE_HARVESTER_MISSILE); + if (TempSpell && TempSpell->EffectImplicitTargetB[0] != 16) + { + TempSpell->EffectImplicitTargetB[0] = 16; + TempSpell->EffectImplicitTargetB[1] = 87; + TempSpell->EffectImplicitTargetB[2] = 16; + } + } + + void Reset() {} + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pCaster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && pSpell->Id == SPELL_GIFT_OF_THE_HARVESTER_MISSILE) + { + if(((Player*)pCaster)->GetQuestStatus(12698) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 < 35) + { + pCaster->CastSpell(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), SPELL_SCARLET_MINER_GHOUL_TRANSFORM, true); + //pCaster->CastSpell(pCaster, SPELL_SCARLET_GHOUL_CREDIT, true); + ((Player*)pCaster)->KilledMonsterCredit(NPC_SCARLET_GHOUL); // hack quest credit + } + else + pCaster->CastSpell(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), SPELL_SCARLET_MINER_GHOST_TRANSFORM, true, 0, 0, m_creature->GetGUID()); + + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + } + } + } +}; + +/*###### +## npc_highlord_darion_mograine +######*/ +enum mograine +{ + ENCOUNTER_DK_NUMBER = 5, // how many player queue to start the quest , or - + ENCOUNTER_DK_TIMER = 10, // *every 5 minutes. These have to be done in instance data + ENCOUNTER_DEFENDER_NUMBER = 10, // how many of defender + ENCOUNTER_EARTHSHATTER_NUMBER = 10, // how many of earthshatter + ENCOUNTER_ABOMINATION_NUMBER = 3, // how many of abomination + ENCOUNTER_BEHEMOTH_NUMBER = 2, // how many of behemoth + ENCOUNTER_GHOUL_NUMBER = 15, // how many of ghoul + ENCOUNTER_WARRIOR_NUMBER = 2, // how many of warrior + ENCOUNTER_TOTAL_DAWN = 300, // Total number + ENCOUNTER_TOTAL_SCOURGE = 10000, + + WORLD_STATE_REMAINS = 3592, + WORLD_STATE_COUNTDOWN = 3603, + WORLD_STATE_EVENT_BEGIN = 3605, + + SAY_LIGHT_OF_DAWN01 = -1609201, // pre text + SAY_LIGHT_OF_DAWN02 = -1609202, + SAY_LIGHT_OF_DAWN03 = -1609203, + SAY_LIGHT_OF_DAWN04 = -1609204, // intro + SAY_LIGHT_OF_DAWN05 = -1609205, + SAY_LIGHT_OF_DAWN06 = -1609206, + SAY_LIGHT_OF_DAWN07 = -1609207, // During the fight - Korfax, Champion of the Light + SAY_LIGHT_OF_DAWN08 = -1609208, // Lord Maxwell Tyrosus + SAY_LIGHT_OF_DAWN09 = -1609209, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN10 = -1609210, + SAY_LIGHT_OF_DAWN11 = -1609211, + SAY_LIGHT_OF_DAWN12 = -1609212, + SAY_LIGHT_OF_DAWN13 = -1609213, + SAY_LIGHT_OF_DAWN14 = -1609214, + SAY_LIGHT_OF_DAWN15 = -1609215, + SAY_LIGHT_OF_DAWN16 = -1609216, + SAY_LIGHT_OF_DAWN17 = -1609217, + SAY_LIGHT_OF_DAWN18 = -1609218, + SAY_LIGHT_OF_DAWN19 = -1609219, + SAY_LIGHT_OF_DAWN20 = -1609220, + SAY_LIGHT_OF_DAWN21 = -1609221, + SAY_LIGHT_OF_DAWN22 = -1609222, + SAY_LIGHT_OF_DAWN23 = -1609223, + SAY_LIGHT_OF_DAWN24 = -1609224, + SAY_LIGHT_OF_DAWN25 = -1609225, // After the fight + SAY_LIGHT_OF_DAWN26 = -1609226, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN27 = -1609227, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN28 = -1609228, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN29 = -1609229, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN30 = -1609230, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN31 = -1609231, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN32 = -1609232, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN33 = -1609233, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN34 = -1609234, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN35 = -1609235, // Darion Mograine + SAY_LIGHT_OF_DAWN36 = -1609236, // Darion Mograine + SAY_LIGHT_OF_DAWN37 = -1609237, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN38 = -1609238, // Darion Mograine + SAY_LIGHT_OF_DAWN39 = -1609239, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN40 = -1609240, // Darion Mograine + SAY_LIGHT_OF_DAWN41 = -1609241, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN42 = -1609242, // Highlord Alexandros Mograine + SAY_LIGHT_OF_DAWN43 = -1609243, // The Lich King + SAY_LIGHT_OF_DAWN44 = -1609244, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN45 = -1609245, // The Lich King + SAY_LIGHT_OF_DAWN46 = -1609246, // The Lich King + SAY_LIGHT_OF_DAWN47 = -1609247, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN48 = -1609248, // The Lich King + SAY_LIGHT_OF_DAWN49 = -1609249, // The Lich King + SAY_LIGHT_OF_DAWN50 = -1609250, // Lord Maxwell Tyrosus + SAY_LIGHT_OF_DAWN51 = -1609251, // The Lich King + SAY_LIGHT_OF_DAWN52 = -1609252, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN53 = -1609253, // Highlord Darion Mograine + SAY_LIGHT_OF_DAWN54 = -1609254, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN55 = -1609255, // The Lich King + SAY_LIGHT_OF_DAWN56 = -1609256, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN57 = -1609257, // The Lich King + SAY_LIGHT_OF_DAWN58 = -1609258, // The Lich King + SAY_LIGHT_OF_DAWN59 = -1609259, // The Lich King + SAY_LIGHT_OF_DAWN60 = -1609260, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN61 = -1609261, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN62 = -1609262, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN63 = -1609263, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN64 = -1609264, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN65 = -1609265, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN66 = -1609266, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN67 = -1609267, // Highlord Tirion Fordring + SAY_LIGHT_OF_DAWN68 = -1609268, // Highlord Darion Mograine + + EMOTE_LIGHT_OF_DAWN01 = -1609269, // Emotes + EMOTE_LIGHT_OF_DAWN02 = -1609270, + EMOTE_LIGHT_OF_DAWN03 = -1609271, + EMOTE_LIGHT_OF_DAWN04 = -1609272, + EMOTE_LIGHT_OF_DAWN05 = -1609273, + EMOTE_LIGHT_OF_DAWN06 = -1609274, + EMOTE_LIGHT_OF_DAWN07 = -1609275, + EMOTE_LIGHT_OF_DAWN08 = -1609276, + EMOTE_LIGHT_OF_DAWN09 = -1609277, + EMOTE_LIGHT_OF_DAWN10 = -1609278, + EMOTE_LIGHT_OF_DAWN11 = -1609279, + EMOTE_LIGHT_OF_DAWN12 = -1609280, + EMOTE_LIGHT_OF_DAWN13 = -1609281, + EMOTE_LIGHT_OF_DAWN14 = -1609282, + EMOTE_LIGHT_OF_DAWN15 = -1609283, + EMOTE_LIGHT_OF_DAWN16 = -1609284, + EMOTE_LIGHT_OF_DAWN17 = -1609285, + EMOTE_LIGHT_OF_DAWN18 = -1609286, + + GO_LIGHT_OF_DAWN = 191330, + SPELL_THE_LIGHT_OF_DAWN_Q = 53606, // quest credit + + // ---- Dark Knight npc -------------------- + // Highlord Darion Mograine + NPC_HIGHLORD_DARION_MOGRAINE = 29173, + SPELL_ANTI_MAGIC_ZONE1 = 52893, + SPELL_DEATH_STRIKE = 53639, + SPELL_DEATH_EMBRACE = 53635, + SPELL_ICY_TOUCH1 = 49723, + SPELL_THE_LIGHT_OF_DAWN = 53658, + SPELL_THE_MIGHT_OF_MOGRAINE = 53642, // on players when begins + SPELL_UNHOLY_BLIGHT = 53640, + SPELL_ALEXANDROS_MOGRAINE_SPAWN = 53667, + SPELL_MOGRAINE_CHARGE = 53679, + SPELL_ASHBRINGER = 53701, + + // Koltira Deathweaver & Orbaz Bloodbane are using the same abilities + NPC_KOLTIRA_DEATHWEAVER = 29199, + NPC_ORBAZ_BLOODBANE = 29204, // this guy fleed + NPC_THASSARIAN = 29200, // he also does SPELL_THE_LIGHT_OF_DAWN 53658 + //SPELL_BLOOD_STRIKE = 52374, + SPELL_DEATH_GRIP = 49576, + //SPELL_ICY_TOUCH = 52372, + SPELL_PLAGUE_STRIKE1 = 50668, + // all do SPELL_HERO_AGGRO_AURA 53627 + + // Lich King + NPC_THE_LICH_KING = 29183, // show up at end + SPELL_APOCALYPSE = 53210, + SPELL_TELEPORT_VISUAL = 52233, + SPELL_SOUL_FEAST_ALEX = 53677, // on Alexandros + SPELL_SOUL_FEAST_TIRION = 53685, // on Tirion + SPELL_ICEBOUND_VISAGE = 53274, // not sure what is it for + SPELL_REBUKE = 53680, + + // others + NPC_RAMPAGING_ABOMINATION = 29186, + SPELL_CLEAVE1 = 53633, + SPELL_SCOURGE_HOOK = 50335, + SPELL_SCOURGE_AGGRO_AURA = 53624, + + NPC_FLESH_BEHEMOTH = 29190, // giant guy + SPELL_STOMP = 53634, + SPELL_THUNDERCLAP = 36706, + SPELL_HERO_AGGRO_AURA = 53627, + + NPC_ACHERUS_GHOUL = 29219, // just ghoul.... + SPELL_GHOULPLOSION = 53632, + + NPC_WARRIOR_OF_THE_FROZEN_WASTES = 29206, // use SPELL_CLEAVE 53631 + + NPC_HIGHLORD_ALEXANDROS_MOGRAINE = 29227, // ghost + NPC_DARION_MOGRAINE = 29228, // ghost + + // ---- Dawn npc -------------------- + // Highlord Tirion Fordring + NPC_HIGHLORD_TIRION_FORDRING = 29175, + EQUIP_HIGHLORD_TIRION_FORDRING = 13262, + SPELL_LAY_ON_HANDS = 53778, + SPELL_REBIRTH_OF_THE_ASHBRINGER = 53702, + SPELL_TIRION_CHARGE = 53705, + SPELL_TIRION_CHARGE_VISUAL = 53706, + + // others + NPC_KORFAX_CHAMPION_OF_THE_LIGHT = 29176, + SPELL_CLEAVE = 53631, + SPELL_HEROIC_LEAP = 53625, + + NPC_LORD_MAXWELL_TYROSUS = 29178, + NPC_LEONID_BARTHALOMEW_THE_REVERED = 29179, + NPC_DUKE_NICHOLAS_ZVERENHOFF = 29180, + + NPC_COMMANDER_ELIGOR_DAWNBRINGER = 29177, + SPELL_HOLY_LIGHT2 = 37979, + + NPC_RAYNE = 29181, + SPELL_REJUVENATION = 20664, + SPELL_STARFALL = 20678, + SPELL_TRANQUILITY = 25817, + SPELL_WRATH = 21807, + + NPC_DEFENDER_OF_THE_LIGHT = 29174, // also does SPELL_HEROIC_LEAP 53625 + SPELL_HOLY_LIGHT1 = 29427, + SPELL_HOLY_STRIKE = 53643, + SPELL_HOLY_WRATH = 53638, + SPELL_UPPERCUT = 53629, + + NPC_RIMBLAT_EARTHSHATTER = 29182, + SPELL_CHAIN_HEAL = 33642, + //SPELL_THUNDER = 53630 //spell is annoying and kicking units around +}; + +struct Locations +{ + float x, y, z, o; + uint32 id; +}; + +static Locations LightofDawnLoc[]= +{ + {2281.335f, -5300.409f, 85.170f, 0}, // 0 Tirion Fordring loc + {2283.896f, -5287.914f, 83.066f, 1.55f}, // 1 Tirion Fordring loc2 + {2281.461f, -5263.014f, 81.164f, 0}, // 2 Tirion charges + {2262.277f, -5293.477f, 82.167f, 0}, // 3 Tirion run + {2270.286f, -5287.73f, 82.262f, 0}, // 4 Tirion relocate + {2269.511f, -5288.289f, 82.225f, 0}, // 5 Tirion forward + {2262.277f, -5293.477f, 82.167f, 0}, // 6 Tirion runs to Darion + {2270.286f, -5287.73f, 82.262f, 0}, + {2269.511f, -5288.289f, 82.225f, 0}, + {2273.205f, -5288.848f, 82.617f, 0}, // 9 Korfax loc1 + {2274.739f, -5287.926f, 82.684f, 0}, // 10 Korfax loc2 + {2253.673f, -5318.004f, 81.724f, 0}, // 11 Korfax kicked + {2287.028f, -5309.644f, 87.253f, 0}, // 12 Maxwell loc1 + {2286.978f, -5308.025f, 86.83f, 0}, // 13 Maxwell loc2 + {2248.877f, -5307.586f, 82.166f, 0}, // 14 maxwell kicked + {2278.58f, -5316.933f, 88.319f, 0}, // 15 Eligor loc1 + {2278.535f, -5315.479f, 88.08f, 0}, // 16 Eligor loc2 + {2259.416f, -5304.505f, 82.149f, 0}, // 17 eligor kicked + {2289.259f, -5280.355f, 82.112f, 0}, // 18 Koltira loc1 + {2289.02f, -5281.985f, 82.207f, 0}, // 19 Koltira loc2 + {2273.289f, -5273.675f, 81.701f, 0}, // 20 Thassarian loc1 + {2273.332f, -5275.544f, 81.849f, 0}, // 21 Thassarian loc2 + {2281.198f, -5257.397f, 80.224f, 4.66f}, // 22 Alexandros loc1 + {2281.156f, -5259.934f, 80.647f, 0}, // 23 Alexandros loc2 + {2281.294f, -5281.895f, 82.445f, 1.35f}, // 24 Darion loc1 + {2281.093f, -5263.013f, 81.125f, 0}, // 25 Darion loc1 + {2281.313f, -5250.282f, 79.322f, 4.69f}, // 26 Lich King spawns + {2281.523f, -5261.058f, 80.877f, 0}, // 27 Lich king move forwards + {2272.709f, -5255.552f, 78.226f, 0}, // 28 Lich king kicked + {2273.972f, -5257.676f, 78.862f, 0} // 29 Lich king moves forward +}; + +struct MANGOS_DLL_DECL npc_highlord_darion_mograineAI : public npc_escortAI +{ + npc_highlord_darion_mograineAI(Creature *pCreature) : npc_escortAI(pCreature) + { + Reset(); + } + + bool bIsBattle; + uint32 uiStep; + uint32 uiPhase_timer; + uint32 uiFight_duration; + uint32 uiTotal_dawn; + uint32 uiTotal_scourge; + uint32 uiSummon_counter; + + // Darion Mograine + uint32 uiAnti_magic_zone; + uint32 uiDeath_strike; + uint32 uiDeath_embrace; + uint32 uiIcy_touch; + uint32 uiUnholy_blight; + uint32 uiFight_speech; + uint32 uiSpawncheck; + uint32 uiTargetcheck; + + // Dawn + uint64 uiTirionGUID; + uint64 uiAlexandrosGUID; + uint64 uiDarionGUID; + uint64 uiKorfaxGUID; + uint64 uiMaxwellGUID; + uint64 uiEligorGUID; + uint64 uiRayneGUID; + uint64 uiDefenderGUID[ENCOUNTER_DEFENDER_NUMBER]; + uint64 uiEarthshatterGUID[ENCOUNTER_EARTHSHATTER_NUMBER]; + + // Death + uint64 uiKoltiraGUID; + uint64 uiOrbazGUID; + uint64 uiThassarianGUID; + uint64 uiLichKingGUID; + uint64 uiAbominationGUID[ENCOUNTER_ABOMINATION_NUMBER]; + uint64 uiBehemothGUID[ENCOUNTER_BEHEMOTH_NUMBER]; + uint64 uiGhoulGUID[ENCOUNTER_GHOUL_NUMBER]; + uint64 uiWarriorGUID[ENCOUNTER_WARRIOR_NUMBER]; + + // Misc + uint64 uiDawnofLightGUID; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + bIsBattle = false; + uiStep = 0; + uiPhase_timer = 3000; + uiFight_duration = 300000; // 5 minutes + uiTotal_dawn = ENCOUNTER_TOTAL_DAWN; + uiTotal_scourge = ENCOUNTER_TOTAL_SCOURGE; + uiSummon_counter = 0; + + uiDawnofLightGUID = 0; + + uiAnti_magic_zone = 1000 + rand()%5000; + uiDeath_strike = 5000 + rand()%5000; + uiDeath_embrace = 5000 + rand()%5000; + uiIcy_touch = 5000 + rand()%5000; + uiUnholy_blight = 5000 + rand()%5000; + + uiFight_speech = 15000; + uiSpawncheck = 1000; + uiTargetcheck = 10000; + + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->Mount(25279); + + UpdateWorldState(m_creature->GetMap(), WORLD_STATE_REMAINS, 0); + //UpdateWorldState(m_creature->GetMap(), WORLD_STATE_COUNTDOWN, 0); + UpdateWorldState(m_creature->GetMap(), WORLD_STATE_EVENT_BEGIN, 0); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiRayneGUID)) + pTemp->SetDeathState(JUST_DIED); + + uiTirionGUID = NULL; + uiKorfaxGUID = NULL; + uiMaxwellGUID = NULL; + uiEligorGUID = NULL; + uiRayneGUID = NULL; + + for(uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDefenderGUID[i])) + pTemp->SetDeathState(JUST_DIED); + uiDefenderGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEarthshatterGUID[i])) + pTemp->SetDeathState(JUST_DIED); + uiEarthshatterGUID[i] = 0; + } + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiOrbazGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) + pTemp->SetDeathState(JUST_DIED); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + pTemp->SetDeathState(JUST_DIED); + + uiKoltiraGUID = NULL; + uiOrbazGUID = NULL; + uiThassarianGUID = NULL; + uiLichKingGUID = NULL; + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAbominationGUID[i])) + pTemp->SetDeathState(JUST_DIED); + uiAbominationGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiBehemothGUID[i])) + pTemp->SetDeathState(JUST_DIED); + uiBehemothGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiGhoulGUID[i])) + pTemp->SetDeathState(JUST_DIED); + uiGhoulGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiWarriorGUID[i])) + pTemp->SetDeathState(JUST_DIED); + uiWarriorGUID[i] = 0; + } + } + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who == m_creature) + return; + + if (m_creature->Attack(who, true)) + { + m_creature->AddThreat(who, 0.0f); + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + DoStartMovement(who); + } + } + + void MoveInLineOfSight(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack() && m_creature->IsHostileTo(who)) + if (m_creature->IsWithinDistInMap(who, 20) && m_creature->IsWithinLOSInMap(who)) + AttackStart(who); + } + + void SetHoldState(bool bOnHold) + { + SetEscortPaused(bOnHold); + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0: + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + SetHoldState(true); + break; + case 1: + SetHoldState(true); + + if (GameObject* pGo = GetClosestGameObjectWithEntry(m_creature, GO_LIGHT_OF_DAWN, 100.0f)) // make dawn of light effect off + { + uiDawnofLightGUID = pGo->GetGUID(); + pGo->SetPhaseMask(0, true); + } + + SpawnNPC(); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN07, pTemp); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN08, pTemp); + + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + NPCChangeTarget(uiGhoulGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + NPCChangeTarget(uiWarriorGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + NPCChangeTarget(uiAbominationGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + NPCChangeTarget(uiBehemothGUID[i]); + NPCChangeTarget(uiKoltiraGUID); + NPCChangeTarget(uiOrbazGUID); + NPCChangeTarget(uiThassarianGUID); + + m_creature->Unmount(); + m_creature->CastSpell(m_creature, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) + pTemp->Unmount(); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) + pTemp->Unmount(); + + bIsBattle = true; + break; + case 2: + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + DoCast(m_creature, SPELL_THE_LIGHT_OF_DAWN); + break; + case 3: + { + Unit* pTirion = m_creature->GetMap()->GetUnit(uiTirionGUID); + + DoScriptText(EMOTE_LIGHT_OF_DAWN05, m_creature); + if (m_creature->HasAura(SPELL_THE_LIGHT_OF_DAWN, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) + { + if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, EFFECT_INDEX_0)) + pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[19].x, LightofDawnLoc[19].y, LightofDawnLoc[19].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) + { + if (pTemp->HasAura(SPELL_THE_LIGHT_OF_DAWN, EFFECT_INDEX_0)) + pTemp->RemoveAurasDueToSpell(SPELL_THE_LIGHT_OF_DAWN); + pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[21].x, LightofDawnLoc[21].y, LightofDawnLoc[21].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + { + pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[10].x, LightofDawnLoc[10].y, LightofDawnLoc[10].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + { + pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) + { + pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[16].x, LightofDawnLoc[16].y, LightofDawnLoc[16].z); + } + JumpToNextStep(10000); + } break; + case 4: + DoScriptText(SAY_LIGHT_OF_DAWN27, m_creature); + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_KNEEL); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + SetHoldState(true); + break; + case 5: + DoScriptText(SAY_LIGHT_OF_DAWN33, m_creature); + SetHoldState(true); + break; + case 6: + SetHoldState(true); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SPECIALATTACK1H); + JumpToNextStep(1000); + break; + case 7: + SetHoldState(true); + JumpToNextStep(2000); + break; + case 8: + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + m_creature->CastSpell(pTemp, SPELL_ASHBRINGER, true); + DoScriptText(EMOTE_LIGHT_OF_DAWN14, m_creature); + SetHoldState(true); + break; + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!bIsBattle) + { + if (uiPhase_timer < diff) + { + // ******* Before battle ***************************************************************** + switch(uiStep) + { + case 0: // countdown + //UpdateWorldState(m_creature->GetMap(), WORLD_STATE_COUNTDOWN, 1); + break; + + case 1: // just delay + UpdateWorldState(m_creature->GetMap(), WORLD_STATE_REMAINS, 1); + UpdateWorldState(m_creature->GetMap(), WORLD_STATE_COUNTDOWN, 0); + UpdateWorldState(m_creature->GetMap(), WORLD_STATE_EVENT_BEGIN, 1); + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + JumpToNextStep(3000); + break; + + case 2: + DoScriptText(SAY_LIGHT_OF_DAWN04, m_creature); + if (Creature* pKoltira = GetClosestCreatureWithEntry(m_creature, NPC_KOLTIRA_DEATHWEAVER, 50.0f)) + uiKoltiraGUID = pKoltira->GetGUID(); + if (Creature* pOrbaz = GetClosestCreatureWithEntry(m_creature, NPC_ORBAZ_BLOODBANE, 50.0f)) + uiOrbazGUID = pOrbaz->GetGUID(); + if (Creature* pThassarian = GetClosestCreatureWithEntry(m_creature, NPC_THASSARIAN, 50.0f)) + uiThassarianGUID = pThassarian->GetGUID(); + JumpToNextStep(10000); + break; + + case 3: // rise + DoScriptText(SAY_LIGHT_OF_DAWN05, m_creature); + JumpToNextStep(3000); + break; + + case 4: // summon ghoul + // Dunno whats the summon spell, so workaround + DoCast(m_creature, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_GHOUL_NUMBER) + { + if (Creature* pTemp = m_creature->SummonCreature(NPC_ACHERUS_GHOUL, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->setFaction(2084); + uiGhoulGUID[uiSummon_counter] = pTemp->GetGUID(); + uiSummon_counter++; + } + } + else + { + uiSummon_counter = 0; + uiStep++; + } + break; + + case 5: // summon abomination + DoCast(m_creature, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_ABOMINATION_NUMBER) + { + if (Creature* pTemp = m_creature->SummonCreature(NPC_RAMPAGING_ABOMINATION, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->setFaction(2084); + uiAbominationGUID[uiSummon_counter] = pTemp->GetGUID(); + uiSummon_counter++; + } + } + else + { + uiSummon_counter = 0; + uiStep++; + } + break; + + case 6: // summon warrior + DoCast(m_creature, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_WARRIOR_NUMBER) + { + if (Creature* pTemp = m_creature->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->setFaction(2084); + uiWarriorGUID[uiSummon_counter] = pTemp->GetGUID(); + uiSummon_counter++; + } + } + else + { + uiSummon_counter = 0; + uiStep++; + } + break; + + case 7: // summon warrior + DoCast(m_creature, 33271); // shack effect + uiPhase_timer = 500; + if (uiSummon_counter < ENCOUNTER_BEHEMOTH_NUMBER) + { + if (Creature* pTemp = m_creature->SummonCreature(NPC_FLESH_BEHEMOTH, (m_creature->GetPositionX()-20)+rand()%40, (m_creature->GetPositionY()-20)+rand()%40, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->setFaction(2084); + uiBehemothGUID[uiSummon_counter] = pTemp->GetGUID(); + uiSummon_counter++; + } + } + else + { + uiSummon_counter = 0; + uiStep++; + } + break; + + case 8: // summon announce + DoScriptText(SAY_LIGHT_OF_DAWN06, m_creature); + m_creature->CastSpell(m_creature, SPELL_THE_MIGHT_OF_MOGRAINE, true); // need to fix, on player only + JumpToNextStep(5000); + break; + + case 9: // charge begins + SetHoldState(false); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiOrbazGUID)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) + { + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + } + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAbominationGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiBehemothGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiGhoulGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiWarriorGUID[i])) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z); + JumpToNextStep(5000); + break; + + // ******* After battle ***************************************************************** + case 11: // Tirion starts to speak + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN28, pTemp); + JumpToNextStep(21000); + break; + + case 12: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN29, pTemp); + JumpToNextStep(13000); + break; + + case 13: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN30, pTemp); + JumpToNextStep(13000); + break; + + case 14: + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN31, m_creature); + JumpToNextStep(7000); + break; + + case 15: // summon gate + if (Creature* pTemp = m_creature->SummonCreature(NPC_HIGHLORD_ALEXANDROS_MOGRAINE, LightofDawnLoc[22].x, LightofDawnLoc[22].y, LightofDawnLoc[22].z, LightofDawnLoc[22].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pTemp->CastSpell(pTemp, SPELL_ALEXANDROS_MOGRAINE_SPAWN, true); + DoScriptText(EMOTE_LIGHT_OF_DAWN06, pTemp); + uiAlexandrosGUID = pTemp->GetGUID(); + } + JumpToNextStep(4000); + break; + + case 16: // Alexandros out + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAlexandrosGUID)) + { + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[23].x, LightofDawnLoc[23].y, LightofDawnLoc[23].z); + DoScriptText(SAY_LIGHT_OF_DAWN32, pTemp); + } + SetHoldState(false); // makes darion turns back + JumpToNextStep(5000); + break; + + case 17: + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(SAY_LIGHT_OF_DAWN34, m_creature); + JumpToNextStep(5000); + break; + + case 18: // Darion's spirit out + if (Creature* pTemp = m_creature->SummonCreature(NPC_DARION_MOGRAINE, LightofDawnLoc[24].x, LightofDawnLoc[24].y, LightofDawnLoc[24].z, LightofDawnLoc[24].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + DoScriptText(SAY_LIGHT_OF_DAWN35, pTemp); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + uiDarionGUID = pTemp->GetGUID(); + } + JumpToNextStep(4000); + break; + + case 19: // runs to father + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDarionGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN07, pTemp); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[25].x, LightofDawnLoc[25].y, LightofDawnLoc[25].z); + } + JumpToNextStep(4000); + break; + + case 20: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN36, pTemp); + JumpToNextStep(4000); + break; + + case 21: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDarionGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN08, pTemp); + JumpToNextStep(4000); + break; + + case 22: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN37, pTemp); + JumpToNextStep(8000); + break; + + case 23: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN38, pTemp); + JumpToNextStep(8000); + break; + + case 24: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN39, pTemp); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) // Tirion moves forward here + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[1].x, LightofDawnLoc[1].y, LightofDawnLoc[1].z); + + JumpToNextStep(15000); + break; + + case 25: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN40, pTemp); + JumpToNextStep(11000); + break; + + case 26: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN41, pTemp); + JumpToNextStep(5000); + break; + + case 27: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDarionGUID)) + pTemp->SetDeathState(JUST_DIED); + JumpToNextStep(24000); + break; + + case 28: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN42, pTemp); + JumpToNextStep(6000); + break; + + case 29: // lich king spawns + if (Creature* pTemp = m_creature->SummonCreature(NPC_THE_LICH_KING, LightofDawnLoc[26].x, LightofDawnLoc[26].y, LightofDawnLoc[26].z, LightofDawnLoc[26].o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000)) + { + DoScriptText(SAY_LIGHT_OF_DAWN43, pTemp); + uiLichKingGUID = pTemp->GetGUID(); + if (Unit* pAlex = m_creature->GetMap()->GetUnit(uiAlexandrosGUID)) + pTemp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); + } + JumpToNextStep(2000); + break; + + case 30: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiAlexandrosGUID)) // remove him + { + DoScriptText(EMOTE_LIGHT_OF_DAWN09, pTemp); + pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + { + pTemp->InterruptNonMeleeSpells(false); + DoScriptText(SAY_LIGHT_OF_DAWN45, pTemp); + } + JumpToNextStep(3000); + break; + + case 31: + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(EMOTE_LIGHT_OF_DAWN10, m_creature); + DoScriptText(SAY_LIGHT_OF_DAWN44, m_creature); + JumpToNextStep(3000); + break; + + case 32: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[27].x, LightofDawnLoc[27].y, LightofDawnLoc[27].z); + JumpToNextStep(6000); + break; + + case 33: // Darion supports to jump to lich king here +// disable if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) +// because mangos DoCast(m_creature, SPELL_MOGRAINE_CHARGE); // jumping charge +// doesn't make it looks well, so workarounds, Darion charges, looks better + m_creature->SetSpeedRate(MOVE_RUN, 3.0f); + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + SetHoldState(false); + JumpToNextStep(0); + break; + + case 35: // Lich king counterattacks + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + { + pTemp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + DoScriptText(SAY_LIGHT_OF_DAWN46, pTemp); + } + m_creature->SetSpeedRate(MOVE_RUN, 6.0f); + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_DEAD); + SetHoldState(false); // Darion got kicked by lich king + JumpToNextStep(0); + break; + + case 37: // Lich king counterattacks + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_KNEEL); + JumpToNextStep(3000); + break; + + case 38: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN47, pTemp); + JumpToNextStep(8000); + break; + + case 39: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN48, pTemp); + JumpToNextStep(15000); + break; + + case 40: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN49, pTemp); + JumpToNextStep(17000); + break; + + case 41: // Lich king - Apocalypse + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN11, pTemp); + DoScriptText(SAY_LIGHT_OF_DAWN51, pTemp); + if (Creature* pTirion = m_creature->GetMap()->GetCreature(uiTirionGUID)) + { + ((Unit*)pTirion)->SetStandState(UNIT_STAND_STATE_KNEEL); + //pTemp->CastSpell(pTirion, SPELL_APOCALYPSE, false); // not working + pTemp->CastSpell(pTirion, SPELL_SOUL_FEAST_TIRION, false); + DoScriptText(EMOTE_LIGHT_OF_DAWN12, pTirion); + } + } + JumpToNextStep(2000); + break; + + case 42: // Maxwell yells for attack + { + float fLichPositionX, fLichPositionY, fLichPositionZ; + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + { + fLichPositionX = pTemp->GetPositionX(); + fLichPositionY = pTemp->GetPositionY(); + fLichPositionZ = pTemp->GetPositionZ(); + } + + if (fLichPositionX && fLichPositionY) + { + Creature* pTemp; + if (pTemp = m_creature->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetSpeedRate(MOVE_RUN, 2.0f); + pTemp->setFaction(m_creature->getFaction()); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + uiDefenderGUID[0] = pTemp->GetGUID(); + } + + if (pTemp = m_creature->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetSpeedRate(MOVE_RUN, 2.0f); + pTemp->setFaction(m_creature->getFaction()); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + uiEarthshatterGUID[0] = pTemp->GetGUID(); + } + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetSpeedRate(MOVE_RUN, 2.0f); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + DoScriptText(SAY_LIGHT_OF_DAWN50, pTemp); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetSpeedRate(MOVE_RUN, 2.0f); + pTemp->HandleEmoteCommand(EMOTE_STATE_ATTACK_UNARMED); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->SetSpeedRate(MOVE_RUN, 2.0f); + pTemp->GetMotionMaster()->MovePoint(0, fLichPositionX, fLichPositionY, fLichPositionZ); + } + } + JumpToNextStep(4500); + break; + + case 43: // They all got kicked + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN13, pTemp); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeedRate(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14].x, LightofDawnLoc[14].y, LightofDawnLoc[14].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeedRate(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11].x, LightofDawnLoc[11].y, LightofDawnLoc[11].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeedRate(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17].x, LightofDawnLoc[17].y, LightofDawnLoc[17].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiDefenderGUID[0])) + { + pTemp->SetSpeedRate(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEarthshatterGUID[0])) + { + pTemp->SetSpeedRate(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + } + JumpToNextStep(3000); + break; + + case 44: // make them stand up + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + JumpToNextStep(1000); + break; + + case 45: + DoScriptText(SAY_LIGHT_OF_DAWN52, m_creature); + JumpToNextStep(5000); + break; + + case 46: // Darion stand up, "not today" + m_creature->SetSpeedRate(MOVE_RUN, 1.0f); + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN53, m_creature); + SetHoldState(false); // Darion throws sword + JumpToNextStep(7000); + break; + + case 47: // Ashbringer rebirth + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(EMOTE_LIGHT_OF_DAWN15, m_creature); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + { + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_HIGHLORD_TIRION_FORDRING)); + pTemp->CastSpell(pTemp, SPELL_REBIRTH_OF_THE_ASHBRINGER, false); + } + JumpToNextStep(1000); + break; + + case 48: // Show the cleansing effect (dawn of light) + if (GameObject* pGo = m_creature->GetMap()->GetGameObject(uiDawnofLightGUID)) + pGo->SetPhaseMask(128, true); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + { + if (pTemp->HasAura(SPELL_REBIRTH_OF_THE_ASHBRINGER, EFFECT_INDEX_0)) + pTemp->RemoveAurasDueToSpell(SPELL_REBIRTH_OF_THE_ASHBRINGER); + pTemp->CastSpell(pTemp, 41542, false); // workarounds, light expoded, makes it cool + pTemp->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + } + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + pTemp->InterruptNonMeleeSpells(false); + JumpToNextStep(2500); + break; + + case 49: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN54, pTemp); + JumpToNextStep(4000); + break; + + case 50: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN55, pTemp); + JumpToNextStep(5000); + break; + + case 51: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN56, pTemp); + JumpToNextStep(1000); + break; + + case 52: // Tiron charges + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN16, pTemp); + pTemp->CastSpell(pTemp, SPELL_TIRION_CHARGE, false); // jumping charge + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); + pTemp->SetSpeedRate(MOVE_RUN, 3.0f); // workarounds, make Tirion still running + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[2].x, LightofDawnLoc[2].y, LightofDawnLoc[2].z); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + pTemp->GetMap()->CreatureRelocation(pTemp, LightofDawnLoc[28].x, LightofDawnLoc[28].y, LightofDawnLoc[28].z, 0.0f); // workarounds, he should kick back by Tirion, but here we relocate him + } + JumpToNextStep(1500); + break; + + case 53: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN57, pTemp); + JumpToNextStep(1000); + break; + + case 54: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + { + pTemp->SetSpeedRate(MOVE_RUN, 1.0f); + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[29].x, LightofDawnLoc[29].y, LightofDawnLoc[29].z); // 26 + } + JumpToNextStep(4000); + break; + + case 55: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_KNEEL); + JumpToNextStep(2000); + break; + + case 56: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + JumpToNextStep(1500); + break; + + case 57: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN58, pTemp); + JumpToNextStep(10000); + break; + + case 58: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN59, pTemp); + JumpToNextStep(10000); + break; + + case 59: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) + pTemp->CastSpell(pTemp, SPELL_TELEPORT_VISUAL, false); + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) // Tirion runs to Darion + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeedRate(MOVE_RUN, 1.0f); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[6].x, LightofDawnLoc[6].y, LightofDawnLoc[6].z); + } + JumpToNextStep(2500); + break; + + case 60: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiLichKingGUID)) // Lich king disappears here + { + DoScriptText(EMOTE_LIGHT_OF_DAWN17, pTemp); + pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + JumpToNextStep(10000); + break; + + case 61: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN60, pTemp); + JumpToNextStep(3000); + break; + + case 62: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + { + pTemp->AddSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[7].x, LightofDawnLoc[7].y, LightofDawnLoc[7].z); + } + JumpToNextStep(5500); + break; + + case 63: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + { + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[8].x, LightofDawnLoc[8].y, LightofDawnLoc[8].z); + DoScriptText(SAY_LIGHT_OF_DAWN61, pTemp); + } + JumpToNextStep(15000); + break; + + case 64: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN62, pTemp); + JumpToNextStep(7000); + break; + + case 65: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN63, pTemp); + JumpToNextStep(10000); + break; + + case 66: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN64, pTemp); + JumpToNextStep(11000); + break; + + case 67: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN65, pTemp); + JumpToNextStep(10000); + break; + + case 68: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN66, pTemp); + JumpToNextStep(8000); + break; + + case 69: + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN67, pTemp); + JumpToNextStep(10000); + break; + + case 70: + ((Unit*)m_creature)->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN68, m_creature); + JumpToNextStep(10000); + break; + + case 71: + if (GameObject* pGo = m_creature->GetMap()->GetGameObject(uiDawnofLightGUID)) // Turn off dawn of light + pGo->SetPhaseMask(0, true); + + { + Map *map = m_creature->GetMap(); // search players with in 50 yards for quest credit + Map::PlayerList const &PlayerList = map->GetPlayers(); + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource()->isAlive() && m_creature->IsWithinDistInMap(i->getSource(), 50)) + i->getSource()->CastSpell(i->getSource(), SPELL_THE_LIGHT_OF_DAWN_Q, false); + } + } + m_creature->SetVisibility(VISIBILITY_OFF); // respawns another Darion for quest turn in + m_creature->SummonCreature(NPC_HIGHLORD_DARION_MOGRAINE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); + JumpToNextStep(1000); + break; + + case 72: + SetHoldState(false); // Escort ends + JumpToNextStep(0); + break; + } + + }else uiPhase_timer -= diff; + } + + // ******* During battle ***************************************************************** + else + { + if (uiAnti_magic_zone < diff) + { + DoCast(m_creature, SPELL_ANTI_MAGIC_ZONE1); + uiAnti_magic_zone = 25000 + rand()%5000; + }else uiAnti_magic_zone -= diff; + + if (uiDeath_strike < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEATH_STRIKE); + uiDeath_strike = 5000 + rand()%5000; + }else uiDeath_strike -= diff; + + if (uiDeath_embrace < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEATH_EMBRACE); + uiDeath_embrace = 5000 + rand()%5000; + }else uiDeath_embrace -= diff; + + if (uiIcy_touch < diff) + { + DoCast(m_creature->getVictim(), SPELL_ICY_TOUCH1); + uiIcy_touch = 5000 + rand()%5000; + }else uiIcy_touch -= diff; + + if (uiUnholy_blight < diff) + { + DoCast(m_creature->getVictim(), SPELL_UNHOLY_BLIGHT); + uiUnholy_blight = 5000 + rand()%5000; + }else uiUnholy_blight -= diff; + + if (uiFight_speech < diff) + { + switch(rand()%15) + { + case 0: DoScriptText(SAY_LIGHT_OF_DAWN09, m_creature);break; + case 1: DoScriptText(SAY_LIGHT_OF_DAWN10, m_creature);break; + case 2: DoScriptText(SAY_LIGHT_OF_DAWN11, m_creature);break; + case 3: DoScriptText(SAY_LIGHT_OF_DAWN12, m_creature);break; + case 4: DoScriptText(SAY_LIGHT_OF_DAWN13, m_creature);break; + case 5: DoScriptText(SAY_LIGHT_OF_DAWN14, m_creature);break; + case 6: DoScriptText(SAY_LIGHT_OF_DAWN15, m_creature);break; + case 7: DoScriptText(SAY_LIGHT_OF_DAWN16, m_creature);break; + case 8: DoScriptText(SAY_LIGHT_OF_DAWN17, m_creature);break; + case 9: DoScriptText(SAY_LIGHT_OF_DAWN18, m_creature);break; + case 10: DoScriptText(SAY_LIGHT_OF_DAWN19, m_creature);break; + case 11: DoScriptText(SAY_LIGHT_OF_DAWN20, m_creature);break; + case 12: DoScriptText(SAY_LIGHT_OF_DAWN21, m_creature);break; + case 13: DoScriptText(SAY_LIGHT_OF_DAWN22, m_creature);break; + case 14: DoScriptText(SAY_LIGHT_OF_DAWN23, m_creature);break; + case 15: DoScriptText(SAY_LIGHT_OF_DAWN24, m_creature);break; + } + uiFight_speech = 15000 + rand()%5000; + }else uiFight_speech -= diff; + + // Check spawns + if (uiSpawncheck < diff) + { + SpawnNPC(); + uiSpawncheck = 1000; + }else uiSpawncheck -= diff; + + // Check targets + if (uiTargetcheck < diff) + { + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + NPCChangeTarget(uiGhoulGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + NPCChangeTarget(uiWarriorGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + NPCChangeTarget(uiAbominationGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + NPCChangeTarget(uiBehemothGUID[i]); + NPCChangeTarget(uiKoltiraGUID); + NPCChangeTarget(uiOrbazGUID); + NPCChangeTarget(uiThassarianGUID); + + uiTargetcheck = 10000; + }else uiTargetcheck -= diff; + + // Battle end + if (uiFight_duration < diff + 5000) + { + if (!uiTirionGUID) + if (Creature* pTemp = m_creature->SummonCreature(NPC_HIGHLORD_TIRION_FORDRING, LightofDawnLoc[0].x, LightofDawnLoc[0].y, LightofDawnLoc[0].z, 1.528f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000)) + { + pTemp->setFaction(m_creature->getFaction()); + pTemp->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 0, uint32(EQUIP_UNEQUIP)); + DoScriptText(SAY_LIGHT_OF_DAWN25, pTemp); + uiTirionGUID = pTemp->GetGUID(); + } + } + if (uiFight_duration < diff) + { + bIsBattle = false; + uiFight_duration = 300000; + + if (m_creature->HasAura(SPELL_THE_MIGHT_OF_MOGRAINE, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_THE_MIGHT_OF_MOGRAINE); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->InterruptNonMeleeSpells(false); + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + + for(uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) + DespawnNPC(uiDefenderGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + DespawnNPC(uiEarthshatterGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + DespawnNPC(uiAbominationGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + DespawnNPC(uiBehemothGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + DespawnNPC(uiGhoulGUID[i]); + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + DespawnNPC(uiWarriorGUID[i]); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(m_creature->getFaction()); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[9].x, LightofDawnLoc[9].y, LightofDawnLoc[9].z); + } + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(m_creature->getFaction()); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[12].x, LightofDawnLoc[12].y, LightofDawnLoc[12].z); + } + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(m_creature->getFaction()); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[15].x, LightofDawnLoc[15].y, LightofDawnLoc[15].z); + } + DespawnNPC(uiRayneGUID); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiKoltiraGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(m_creature->getFaction()); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[18].x, LightofDawnLoc[18].y, LightofDawnLoc[18].z); + pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); + } + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiOrbazGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN04, pTemp); + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiThassarianGUID)) + { + pTemp->RemoveAllAuras(); + pTemp->DeleteThreatList(); + pTemp->CombatStop(true); + pTemp->AttackStop(); + pTemp->setFaction(m_creature->getFaction()); + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[20].x, LightofDawnLoc[20].y, LightofDawnLoc[20].z); + pTemp->CastSpell(pTemp, SPELL_THE_LIGHT_OF_DAWN, false); + } + + if (Creature* pTemp = m_creature->GetMap()->GetCreature(uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN26, pTemp); + + SetHoldState(false); + + }else uiFight_duration -= diff; + + DoMeleeAttackIfReady(); + } + } + + void JumpToNextStep(uint32 uiTimer) + { + uiPhase_timer = uiTimer; + uiStep++; + } + + void NPCChangeTarget(uint64 ui_GUID) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(ui_GUID)) + if (pTemp->isAlive()) + if (Unit* pTarger = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + if (pTarger->isAlive()) + { + ((Creature*)pTemp)->AddThreat(pTarger, 0.0f); + ((Creature*)pTemp)->AI()->AttackStart(pTarger); + ((Creature*)pTemp)->SetInCombatWith(pTarger); + pTarger->SetInCombatWith(pTemp); + } + } + + void SpawnNPC() + { + Creature* pTemp = NULL; + + // Death + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + { + if (!(pTemp = m_creature->GetMap()->GetCreature(uiGhoulGUID[i]))) + { + pTemp = m_creature->SummonCreature(NPC_ACHERUS_GHOUL, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiGhoulGUID[i] = pTemp->GetGUID(); + } + } + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + { + if (!(pTemp = m_creature->GetMap()->GetCreature(uiAbominationGUID[i]))) + { + pTemp = m_creature->SummonCreature(NPC_WARRIOR_OF_THE_FROZEN_WASTES, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiAbominationGUID[i] = pTemp->GetGUID(); + } + } + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + { + if (!(pTemp = m_creature->GetMap()->GetCreature(uiWarriorGUID[i]))) + { + pTemp = m_creature->SummonCreature(NPC_RAMPAGING_ABOMINATION, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiWarriorGUID[i] = pTemp->GetGUID(); + } + } + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + { + if (!(pTemp = m_creature->GetMap()->GetCreature(uiBehemothGUID[i]))) + { + pTemp = m_creature->SummonCreature(NPC_FLESH_BEHEMOTH, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2084); + uiBehemothGUID[i] = pTemp->GetGUID(); + } + } + + // Dawn + for(uint8 i = 0; i < ENCOUNTER_DEFENDER_NUMBER; ++i) + { + if (!(pTemp = m_creature->GetMap()->GetCreature(uiDefenderGUID[i]))) + { + pTemp = m_creature->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2089); + //m_creature->AddThreat(pTemp, 0.0f); + uiDefenderGUID[i] = pTemp->GetGUID(); + } + } + for(uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + { + if (!(pTemp = m_creature->GetMap()->GetCreature(uiEarthshatterGUID[i]))) + { + pTemp = m_creature->SummonCreature(NPC_RIMBLAT_EARTHSHATTER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2089); + //m_creature->AddThreat(pTemp, 0.0f); + uiEarthshatterGUID[i] = pTemp->GetGUID(); + } + } + if (!(pTemp = m_creature->GetMap()->GetCreature(uiKorfaxGUID))) + { + pTemp = m_creature->SummonCreature(NPC_KORFAX_CHAMPION_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + pTemp->setFaction(2089); + //m_creature->AddThreat(pTemp, 0.0f); + uiKorfaxGUID = pTemp->GetGUID(); + } + if (!(pTemp = m_creature->GetMap()->GetCreature(uiMaxwellGUID))) + { + pTemp = m_creature->SummonCreature(NPC_LORD_MAXWELL_TYROSUS, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + pTemp->setFaction(2089); + //m_creature->AddThreat(pTemp, 0.0f); + uiMaxwellGUID = pTemp->GetGUID(); + } + if (!(pTemp = m_creature->GetMap()->GetCreature(uiEligorGUID))) + { + pTemp = m_creature->SummonCreature(NPC_COMMANDER_ELIGOR_DAWNBRINGER, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + pTemp->setFaction(2089); + //m_creature->AddThreat(pTemp, 0.0f); + uiEligorGUID = pTemp->GetGUID(); + } + if (!(pTemp = m_creature->GetMap()->GetCreature(uiRayneGUID))) + { + pTemp = m_creature->SummonCreature(NPC_RAYNE, LightofDawnLoc[0].x+rand()%30, LightofDawnLoc[0].y+rand()%30, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + pTemp->setFaction(2089); + //m_creature->AddThreat(pTemp, 0.0f); + uiRayneGUID = pTemp->GetGUID(); + } + } + + void DespawnNPC(uint64 pGUID) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(pGUID)) + if (pTemp->isAlive()) + { + pTemp->SetVisibility(VISIBILITY_OFF); + pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } +}; +bool GossipHello_npc_highlord_darion_mograine(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu( pCreature->GetGUID() ); + + if (pPlayer->GetQuestStatus(12801) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM( 0, "I am ready.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_highlord_darion_mograine(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + ((npc_highlord_darion_mograineAI*)pCreature->AI())->uiStep = 1; + ((npc_highlord_darion_mograineAI*)pCreature->AI())->Start(true, false, false, pPlayer->GetGUID()); + break; + } + return true; +} +/*###### +## npc the lich king in dawn of light +######*/ +struct MANGOS_DLL_DECL npc_the_lich_king_tirion_dawnAI : public ScriptedAI +{ + npc_the_lich_king_tirion_dawnAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + void Reset() {} + void AttackStart(Unit *who) { return; } // very sample, just don't make them aggreesive + void UpdateAI(const uint32 diff) { return; } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_npc_crusade_persuaded(Creature* pCreature) +{ + return new npc_crusade_persuadedAI (pCreature); +} + +CreatureAI* GetAI_mob_dark_rider_of_acherus(Creature* pCreature) +{ + return new mob_dark_rider_of_acherusAI (pCreature); +} + +CreatureAI* GetAI_npc_a_special_surprise(Creature* pCreature) +{ + return new npc_a_special_surpriseAI (pCreature); +} + +CreatureAI* GetAI_mob_scarlet_miner(Creature* pCreature) +{ + return new mob_scarlet_minerAI (pCreature); +} + +//CreatureAI* GetAI_mob_scarlet_courier_controller(Creature* pCreature) +//{ +// return new mob_scarlet_courier_controllerAI (pCreature); +//} +// +//CreatureAI* GetAI_mob_scarlet_courier(Creature* pCreature) +//{ +// return new mob_scarlet_courierAI (pCreature); +//} + +CreatureAI* GetAI_mob_high_inquisitor_valroth(Creature* pCreature) +{ + return new mob_high_inquisitor_valrothAI (pCreature); +} + +CreatureAI* GetAI_npc_highlord_darion_mograine(Creature* pCreature) +{ + return new npc_highlord_darion_mograineAI(pCreature); +} + +CreatureAI* GetAI_npc_the_lich_king_tirion_dawn(Creature* pCreature) +{ + return new npc_the_lich_king_tirion_dawnAI (pCreature); +} + +// Hack until Vehicle Support +bool GossipHello_scarlet_cannon(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(12701) == QUEST_STATUS_INCOMPLETE) + { + if (rand()%100 < 50) + { + Creature* pTemp = GetClosestCreatureWithEntry(pPlayer, 28834, DEFAULT_VISIBILITY_DISTANCE); + pCreature->CastSpell(pTemp,52436,true,0,0,pPlayer->GetGUID()); + } + else pPlayer->CastSpell(pPlayer,13261,true,0,0,pCreature->GetGUID()); // Some fun malfunction :) + } + return true; +} + +void AddSC_ebon_hold() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_a_special_surprise"; + pNewScript->GetAI = &GetAI_npc_a_special_surprise; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_death_knight_initiate"; + pNewScript->GetAI = &GetAI_npc_death_knight_initiate; + pNewScript->pGossipHello = &GossipHello_npc_death_knight_initiate; + pNewScript->pGossipSelect = &GossipSelect_npc_death_knight_initiate; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_koltira_deathweaver"; + pNewScript->GetAI = &GetAI_npc_koltira_deathweaver; + pNewScript->pQuestAccept = &QuestAccept_npc_koltira_deathweaver; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_unworthy_initiate"; + pNewScript->GetAI = &GetAI_npc_unworthy_initiate; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_unworthy_initiate_anchor"; + pNewScript->GetAI = &GetAI_npc_unworthy_initiate_anchor; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_acherus_soul_prison"; + pNewScript->pGOHello = &GOHello_go_acherus_soul_prison; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_eye_of_acherus"; + pNewScript->GetAI = &GetAI_npc_eye_of_acherus; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_crusade_persuaded"; + pNewScript->GetAI = &GetAI_npc_crusade_persuaded; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_salanar_the_horseman"; + pNewScript->pGossipHello = &GossipHello_npc_salanar_the_horseman; + pNewScript->pGossipSelect = &GossipSelect_npc_salanar_the_horseman; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_dark_rider_of_acherus"; + pNewScript->GetAI = &GetAI_mob_dark_rider_of_acherus; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_scarlet_miner"; + pNewScript->GetAI = &GetAI_mob_scarlet_miner; + pNewScript->RegisterSelf(); + + /*pNewScript = new Script; + pNewScript->Name = "mob_scarlet_courier_controller"; + pNewScript->GetAI = &GetAI_mob_scarlet_courier_controller; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_scarlet_courier"; + pNewScript->GetAI = &GetAI_mob_scarlet_courier; + pNewScript->RegisterSelf();*/ + + pNewScript = new Script; + pNewScript->Name = "mob_high_inquisitor_valroth"; + pNewScript->GetAI = &GetAI_mob_high_inquisitor_valroth; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_highlord_darion_mograine"; + pNewScript->GetAI = &GetAI_npc_highlord_darion_mograine; + pNewScript->pGossipHello = &GossipHello_npc_highlord_darion_mograine; + pNewScript->pGossipSelect = &GossipSelect_npc_highlord_darion_mograine; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_the_lich_king_tirion_dawn"; + pNewScript->GetAI = &GetAI_npc_the_lich_king_tirion_dawn; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "scarlet_cannon"; + pNewScript->pGossipHello = &GossipHello_scarlet_cannon; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_acherus_deathcharger"; + pNewScript->pGossipHello = &GossipHello_npc_acherus_deathcharger; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_palomino"; + pNewScript->GetAI = &GetAI_npc_palomino; + pNewScript->pGossipHello = &GossipHello_npc_palomino; + pNewScript->pGossipSelect = &GossipSelect_npc_palomino; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp new file mode 100644 index 0000000..a8a5d12 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp @@ -0,0 +1,127 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Arcanist_Doan +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1189019, + SAY_SPECIALAE = -1189020, + + SPELL_POLYMORPH = 13323, + SPELL_AOESILENCE = 8988, + SPELL_ARCANEEXPLOSION = 9433, + SPELL_FIREAOE = 9435, + SPELL_ARCANEBUBBLE = 9438, +}; + +struct MANGOS_DLL_DECL boss_arcanist_doanAI : public ScriptedAI +{ + boss_arcanist_doanAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Polymorph_Timer; + uint32 AoESilence_Timer; + uint32 ArcaneExplosion_Timer; + bool bCanDetonate; + bool bShielded; + + void Reset() + { + Polymorph_Timer = 20000; + AoESilence_Timer = 15000; + ArcaneExplosion_Timer = 3000; + bCanDetonate = false; + bShielded = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (bShielded && bCanDetonate) + { + DoCastSpellIfCan(m_creature,SPELL_FIREAOE); + bCanDetonate = false; + } + + if (m_creature->HasAura(SPELL_ARCANEBUBBLE)) + return; + + //If we are <50% hp cast Arcane Bubble + if (!bShielded && m_creature->GetHealthPercent() <= 50.0f) + { + //wait if we already casting + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_SPECIALAE, m_creature); + DoCastSpellIfCan(m_creature,SPELL_ARCANEBUBBLE); + + bCanDetonate = true; + bShielded = true; + } + + if (Polymorph_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,SPELL_POLYMORPH); + + Polymorph_Timer = 20000; + }else Polymorph_Timer -= diff; + + //AoESilence_Timer + if (AoESilence_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_AOESILENCE); + AoESilence_Timer = urand(15000, 20000); + }else AoESilence_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANEEXPLOSION); + ArcaneExplosion_Timer = 8000; + }else ArcaneExplosion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_arcanist_doan(Creature* pCreature) +{ + return new boss_arcanist_doanAI(pCreature); +} + +void AddSC_boss_arcanist_doan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_arcanist_doan"; + newscript->GetAI = &GetAI_boss_arcanist_doan; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp new file mode 100644 index 0000000..a323c1a --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Azshir_the_Sleepless +SD%Complete: 80 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_CALLOFTHEGRAVE 17831 +#define SPELL_TERRIFY 7399 +#define SPELL_SOULSIPHON 7290 + +struct MANGOS_DLL_DECL boss_azshir_the_sleeplessAI : public ScriptedAI +{ + boss_azshir_the_sleeplessAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 SoulSiphon_Timer; + uint32 CallOftheGrave_Timer; + uint32 Terrify_Timer; + + void Reset() + { + SoulSiphon_Timer = 1; + CallOftheGrave_Timer = 30000; + Terrify_Timer = 20000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are <50% hp cast Soul Siphon rank 1 + if (m_creature->GetHealthPercent() <= 50.0f && !m_creature->IsNonMeleeSpellCasted(false)) + { + //SoulSiphon_Timer + if (SoulSiphon_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SOULSIPHON); + return; + + SoulSiphon_Timer = 20000; + }else SoulSiphon_Timer -= diff; + } + + //CallOfTheGrave_Timer + if (CallOftheGrave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE); + CallOftheGrave_Timer = 30000; + }else CallOftheGrave_Timer -= diff; + + //Terrify_Timer + if (Terrify_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_TERRIFY); + Terrify_Timer = 20000; + }else Terrify_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_azshir_the_sleepless(Creature* pCreature) +{ + return new boss_azshir_the_sleeplessAI(pCreature); +} + +void AddSC_boss_azshir_the_sleepless() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_azshir_the_sleepless"; + newscript->GetAI = &GetAI_boss_azshir_the_sleepless; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp new file mode 100644 index 0000000..d2cc372 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp @@ -0,0 +1,123 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Bloodmage_Thalnos +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1189016, + SAY_HEALTH = -1189017, + SAY_KILL = -1189018, + + SPELL_FLAMESHOCK = 8053, + SPELL_SHADOWBOLT = 1106, + SPELL_FLAMESPIKE = 8814, + SPELL_FIRENOVA = 16079, +}; + +struct MANGOS_DLL_DECL boss_bloodmage_thalnosAI : public ScriptedAI +{ + boss_bloodmage_thalnosAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + bool HpYell; + uint32 FlameShock_Timer; + uint32 ShadowBolt_Timer; + uint32 FlameSpike_Timer; + uint32 FireNova_Timer; + + void Reset() + { + HpYell = false; + FlameShock_Timer = 10000; + ShadowBolt_Timer = 2000; + FlameSpike_Timer = 8000; + FireNova_Timer = 40000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are <35% hp + if (!HpYell && m_creature->GetHealthPercent() <= 35.0f) + { + DoScriptText(SAY_HEALTH, m_creature); + HpYell = true; + } + + //FlameShock_Timer + if (FlameShock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FLAMESHOCK); + FlameShock_Timer = urand(10000, 15000); + }else FlameShock_Timer -= diff; + + //FlameSpike_Timer + if (FlameSpike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FLAMESPIKE); + FlameSpike_Timer = 30000; + }else FlameSpike_Timer -= diff; + + //FireNova_Timer + if (FireNova_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FIRENOVA); + FireNova_Timer = 40000; + }else FireNova_Timer -= diff; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; + }else ShadowBolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_bloodmage_thalnos(Creature* pCreature) +{ + return new boss_bloodmage_thalnosAI(pCreature); +} + +void AddSC_boss_bloodmage_thalnos() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_bloodmage_thalnos"; + newscript->GetAI = &GetAI_boss_bloodmage_thalnos; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp new file mode 100644 index 0000000..28cb350 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp @@ -0,0 +1,90 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_headless_horseman +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_ENTRANCE = -1189022, + SAY_REJOINED = -1189023, + SAY_BODY_DEFEAT = -1189024, + SAY_LOST_HEAD = -1189025, + SAY_CONFLAGRATION = -1189026, + SAY_SPROUTING_PUMPKINS = -1189027, + SAY_SLAY = -1189028, + SAY_DEATH = -1189029, + + EMOTE_LAUGH = -1189030, + + SAY_PLAYER1 = -1189031, + SAY_PLAYER2 = -1189032, + SAY_PLAYER3 = -1189033, + SAY_PLAYER4 = -1189034 +}; + +struct MANGOS_DLL_DECL boss_headless_horsemanAI : public ScriptedAI +{ + boss_headless_horsemanAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_headless_horseman(Creature* pCreature) +{ + return new boss_headless_horsemanAI(pCreature); +} + +void AddSC_boss_headless_horseman() +{ + Script* NewScript; + + NewScript = new Script; + NewScript->Name = "boss_headless_horseman"; + NewScript->GetAI = GetAI_boss_headless_horseman; + NewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp new file mode 100644 index 0000000..2dc4e87 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp @@ -0,0 +1,187 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Herod +SD%Complete: 95 +SDComment: Should in addition spawn Myrmidons in the hallway outside +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" + +enum +{ + SAY_AGGRO = -1189000, + SAY_WHIRLWIND = -1189001, + SAY_ENRAGE = -1189002, + SAY_KILL = -1189003, + EMOTE_ENRAGE = -1189004, + + SAY_TRAINEE_SPAWN = -1189036, + + SPELL_RUSHINGCHARGE = 8260, + SPELL_CLEAVE = 15496, + SPELL_WHIRLWIND = 8989, + SPELL_FRENZY = 8269, + + NPC_SCARLET_TRAINEE = 6575 +}; + +struct MANGOS_DLL_DECL boss_herodAI : public ScriptedAI +{ + boss_herodAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + bool m_bEnrage; + bool m_bTraineeSay; + + uint32 m_uiCleaveTimer; + uint32 m_uiWhirlwindTimer; + + void Reset() + { + m_bTraineeSay = false; + m_bEnrage = false; + + m_uiCleaveTimer = 12000; + m_uiWhirlwindTimer = 45000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + DoCastSpellIfCan(m_creature, SPELL_RUSHINGCHARGE); + } + + void SummonedCreature(Creature* pSummoned) + { + // make first Scarlet Trainee say text + if (pSummoned->GetEntry() == NPC_SCARLET_TRAINEE && !m_bTraineeSay) + { + DoScriptText(SAY_TRAINEE_SPAWN, pSummoned); + m_bTraineeSay = true; + } + + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* pKiller) + { + for(uint8 i = 0; i < 20; ++i) + m_creature->SummonCreature(NPC_SCARLET_TRAINEE, 1939.18f, -431.58f, 17.09f, 6.22f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // If we are < 30% hp enrage + if (!m_bEnrage && m_creature->GetHealthPercent() <= 30.0f && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (DoCastSpellIfCan(m_creature, SPELL_FRENZY) == CAST_OK) + { + DoScriptText(EMOTE_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); + m_bEnrage = true; + } + } + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 12000; + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiWhirlwindTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_WHIRLWIND) == CAST_OK) + { + DoScriptText(SAY_WHIRLWIND, m_creature); + m_uiWhirlwindTimer = 30000; + } + } + else + m_uiWhirlwindTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_herod(Creature* pCreature) +{ + return new boss_herodAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_scarlet_traineeAI : public npc_escortAI +{ + mob_scarlet_traineeAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiStartTimer = urand(1000, 6000); + Reset(); + } + + uint32 m_uiStartTimer; + + void Reset() { } + void WaypointReached(uint32 /*uiPointId*/) {} + + void UpdateEscortAI(const uint32 uiDiff) + { + if (m_uiStartTimer) + { + if (m_uiStartTimer <= uiDiff) + { + Start(true); + m_uiStartTimer = 0; + } + else + m_uiStartTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_scarlet_trainee(Creature* pCreature) +{ + return new mob_scarlet_traineeAI(pCreature); +} + +void AddSC_boss_herod() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "boss_herod"; + pNewScript->GetAI = &GetAI_boss_herod; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_scarlet_trainee"; + pNewScript->GetAI = &GetAI_mob_scarlet_trainee; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp new file mode 100644 index 0000000..73c1421 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp @@ -0,0 +1,128 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_Inquisitor_Fairbanks +SD%Complete: 100 +SDComment: TODO: if this guy not involved in some special event, remove (and let ACID script) +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_CURSEOFBLOOD = 8282, + SPELL_DISPELMAGIC = 15090, + SPELL_FEAR = 12096, + SPELL_HEAL = 12039, + SPELL_POWERWORDSHIELD = 11647, + SPELL_SLEEP = 8399 +}; + +struct MANGOS_DLL_DECL boss_high_inquisitor_fairbanksAI : public ScriptedAI +{ + boss_high_inquisitor_fairbanksAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 CurseOfBlood_Timer; + uint32 DispelMagic_Timer; + uint32 Fear_Timer; + uint32 Heal_Timer; + uint32 Sleep_Timer; + uint32 Dispel_Timer; + bool PowerWordShield; + + void Reset() + { + CurseOfBlood_Timer = 10000; + DispelMagic_Timer = 30000; + Fear_Timer = 40000; + Heal_Timer = 30000; + Sleep_Timer = 30000; + Dispel_Timer = 20000; + PowerWordShield = false; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are <25% hp cast Heal + if (m_creature->GetHealthPercent() <= 25.0f && !m_creature->IsNonMeleeSpellCasted(false) && Heal_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_HEAL); + Heal_Timer = 30000; + }else Heal_Timer -= diff; + + //Fear_Timer + if (Fear_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,SPELL_FEAR); + + Fear_Timer = 40000; + }else Fear_Timer -= diff; + + //Sleep_Timer + if (Sleep_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO,0)) + DoCastSpellIfCan(target,SPELL_SLEEP); + + Sleep_Timer = 30000; + }else Sleep_Timer -= diff; + + //PowerWordShield_Timer + if (!PowerWordShield && m_creature->GetHealthPercent() <= 25.0f) + { + DoCastSpellIfCan(m_creature,SPELL_POWERWORDSHIELD); + PowerWordShield = true; + } + + //Dispel_Timer + if (Dispel_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_DISPELMAGIC); + + DispelMagic_Timer = 30000; + }else DispelMagic_Timer -= diff; + + //CurseOfBlood_Timer + if (CurseOfBlood_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFBLOOD); + CurseOfBlood_Timer = 25000; + }else CurseOfBlood_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_inquisitor_fairbanks(Creature* pCreature) +{ + return new boss_high_inquisitor_fairbanksAI(pCreature); +} + +void AddSC_boss_high_inquisitor_fairbanks() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_high_inquisitor_fairbanks"; + newscript->GetAI = &GetAI_boss_high_inquisitor_fairbanks; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp new file mode 100644 index 0000000..819ff45 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp @@ -0,0 +1,77 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Houndmaster_Loksey +SD%Complete: 100 +SDComment: TODO: if this guy not involved in some special event, remove (and let ACID script) +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1189021, + SPELL_SUMMONSCARLETHOUND = 17164, + SPELL_BLOODLUST = 6742 +}; + +struct MANGOS_DLL_DECL boss_houndmaster_lokseyAI : public ScriptedAI +{ + boss_houndmaster_lokseyAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 BloodLust_Timer; + + void Reset() + { + BloodLust_Timer = 20000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoCastSpellIfCan(m_creature,SPELL_SUMMONSCARLETHOUND); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (BloodLust_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_BLOODLUST); + BloodLust_Timer = 20000; + }else BloodLust_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_houndmaster_loksey(Creature* pCreature) +{ + return new boss_houndmaster_lokseyAI(pCreature); +} + +void AddSC_boss_houndmaster_loksey() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_houndmaster_loksey"; + newscript->GetAI = &GetAI_boss_houndmaster_loksey; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp new file mode 100644 index 0000000..76f13e6 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp @@ -0,0 +1,120 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Interrogator_Vishas +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" +#include "scarlet_monastery.h" + +enum +{ + SAY_AGGRO = -1189011, + SAY_HEALTH1 = -1189012, + SAY_HEALTH2 = -1189013, + SAY_KILL = -1189014, + SAY_TRIGGER_VORREL = -1189015, + + SPELL_SHADOWWORDPAIN = 2767, +}; + +struct MANGOS_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI +{ + boss_interrogator_vishasAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool Yell30; + bool Yell60; + uint32 ShadowWordPain_Timer; + + void Reset() + { + Yell30 = false; + Yell60 = false; + ShadowWordPain_Timer = 5000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* Killer) + { + if (!m_pInstance) + return; + + //Any other actions to do with vorrel? setStandState? + if (Creature *vorrel = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_VORREL))) + DoScriptText(SAY_TRIGGER_VORREL, vorrel); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are low on hp Do sayings + if (!Yell60 && m_creature->GetHealthPercent() <= 60.0f) + { + DoScriptText(SAY_HEALTH1, m_creature); + Yell60 = true; + } + + if (!Yell30 && m_creature->GetHealthPercent() <= 30.0f) + { + DoScriptText(SAY_HEALTH2, m_creature); + Yell30 = true; + } + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = urand(5000, 15000); + }else ShadowWordPain_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_interrogator_vishas(Creature* pCreature) +{ + return new boss_interrogator_vishasAI(pCreature); +} + +void AddSC_boss_interrogator_vishas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_interrogator_vishas"; + newscript->GetAI = &GetAI_boss_interrogator_vishas; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp new file mode 100644 index 0000000..e204403 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp @@ -0,0 +1,398 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mograine_And_Whitemane +SD%Complete: 90 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" +#include "scarlet_monastery.h" + +enum +{ + //Mograine says + SAY_MO_AGGRO = -1189005, + SAY_MO_KILL = -1189006, + SAY_MO_RESSURECTED = -1189007, + + //Whitemane says + SAY_WH_INTRO = -1189008, + SAY_WH_KILL = -1189009, + SAY_WH_RESSURECT = -1189010, + + //Mograine Spells + SPELL_CRUSADERSTRIKE = 14518, + SPELL_HAMMEROFJUSTICE = 5589, + SPELL_LAYONHANDS = 9257, + SPELL_RETRIBUTIONAURA = 8990, + + //Whitemanes Spells + SPELL_DEEPSLEEP = 9256, + SPELL_SCARLETRESURRECTION = 9232, + SPELL_DOMINATEMIND = 14515, + SPELL_HOLYSMITE = 9481, + SPELL_HEAL = 12039, + SPELL_POWERWORDSHIELD = 22187 +}; + +struct MANGOS_DLL_DECL boss_scarlet_commander_mograineAI : public ScriptedAI +{ + boss_scarlet_commander_mograineAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiCrusaderStrike_Timer; + uint32 m_uiHammerOfJustice_Timer; + + bool m_bHasDied; + bool m_bHeal; + bool m_bFakeDeath; + + void Reset() + { + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + //Incase wipe during phase that mograine fake death + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_bHasDied = false; + m_bHeal = false; + m_bFakeDeath = false; + + if (!m_pInstance) + return; + + if (Creature* pWhitemane = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_WHITEMANE))) + { + if (m_creature->isAlive() && !pWhitemane->isAlive()) + pWhitemane->Respawn(); + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_MO_AGGRO, m_creature); + DoCastSpellIfCan(m_creature,SPELL_RETRIBUTIONAURA); + + m_creature->CallForHelp(VISIBLE_RANGE); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_MO_KILL, m_creature); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage < m_creature->GetHealth() || m_bHasDied) + return; + + if (!m_pInstance) + return; + + //On first death, fake death and open door, as well as initiate whitemane if exist + if (Creature* pWhitemane = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_WHITEMANE))) + { + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, IN_PROGRESS); + + pWhitemane->GetMotionMaster()->MovePoint(1, 1163.113370f, 1398.856812f, 32.527786f); + + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->SetHealth(0); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAuras(); + m_creature->ClearAllReactives(); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + m_bHasDied = true; + m_bFakeDeath = true; + + uiDamage = 0; + } + } + + void SpellHit(Unit* pWho, const SpellEntry* pSpell) + { + //When hit with ressurection say text + if (pSpell->Id == SPELL_SCARLETRESURRECTION) + { + DoScriptText(SAY_MO_RESSURECTED, m_creature); + m_bFakeDeath = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, SPECIAL); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bHasDied && !m_bHeal && m_pInstance && m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == SPECIAL) + { + //On ressurection, stop fake death and heal whitemane and resume fight + if (Creature* pWhitemane = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_WHITEMANE))) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoCastSpellIfCan(pWhitemane, SPELL_LAYONHANDS); + + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + m_bHeal = true; + } + } + + //This if-check to make sure mograine does not attack while fake death + if (m_bFakeDeath) + return; + + //m_uiCrusaderStrike_Timer + if (m_uiCrusaderStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 10000; + } + else + m_uiCrusaderStrike_Timer -= uiDiff; + + //m_uiHammerOfJustice_Timer + if (m_uiHammerOfJustice_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE); + m_uiHammerOfJustice_Timer = 60000; + } + else + m_uiHammerOfJustice_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_high_inquisitor_whitemaneAI : public ScriptedAI +{ + boss_high_inquisitor_whitemaneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiHeal_Timer; + uint32 m_uiPowerWordShield_Timer; + uint32 m_uiHolySmite_Timer; + uint32 m_uiWait_Timer; + + bool m_bCanResurrectCheck; + bool m_bCanResurrect; + + void Reset() + { + m_uiWait_Timer = 7000; + m_uiHeal_Timer = 10000; + m_uiPowerWordShield_Timer = 15000; + m_uiHolySmite_Timer = 6000; + + m_bCanResurrectCheck = false; + m_bCanResurrect = false; + + if (!m_pInstance) + return; + + if (Creature* pMograine = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_MOGRAINE))) + { + if (m_creature->isAlive() && !pMograine->isAlive()) + pMograine->Respawn(); + } + } + + + void JustReachedHome() + { + if (m_pInstance) + { + if (!(m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED) || !(m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == FAIL)) + m_pInstance->SetData(TYPE_MOGRAINE_AND_WHITE_EVENT, FAIL); + } + } + + void MoveInLineOfSight() + { + //This needs to be empty because Whitemane should NOT aggro while fighting Mograine. Mograine will give us a target. + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage < m_creature->GetHealth()) + return; + + if (!m_bCanResurrectCheck || m_bCanResurrect) + { + // prevent killing blow before rezzing commander + m_creature->SetHealth(uiDamage+1); + } + } + + void AttackStart(Unit* pWho) + { + if (m_pInstance && (m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == NOT_STARTED || m_pInstance->GetData(TYPE_MOGRAINE_AND_WHITE_EVENT) == FAIL)) + return; + + ScriptedAI::AttackStart(pWho); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_WH_INTRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_WH_KILL, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bCanResurrect) + { + //When casting resuruction make sure to delay so on rez when reinstate battle deepsleep runs out + if (m_pInstance && m_uiWait_Timer < uiDiff) + { + if (Creature* pMograine = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_MOGRAINE))) + { + DoCastSpellIfCan(pMograine, SPELL_SCARLETRESURRECTION); + DoScriptText(SAY_WH_RESSURECT, m_creature); + m_bCanResurrect = false; + } + } + else + m_uiWait_Timer -= uiDiff; + } + + //Cast Deep sleep when health is less than 50% + if (!m_bCanResurrectCheck && m_creature->GetHealthPercent() <= 50.0f) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DEEPSLEEP); + m_bCanResurrectCheck = true; + m_bCanResurrect = true; + return; + } + + //while in "resurrect-mode", don't do anything + if (m_bCanResurrect) + return; + + //If we are <75% hp cast healing spells at self or Mograine + if (m_uiHeal_Timer < uiDiff) + { + Creature* pTarget = NULL; + + if (m_creature->GetHealthPercent() <= 75.0f) + pTarget = m_creature; + + if (m_pInstance) + { + if (Creature* pMograine = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_MOGRAINE))) + { + if (pMograine->isAlive() && pMograine->GetHealthPercent() <= 75.0f) + pTarget = pMograine; + } + } + + if (pTarget) + DoCastSpellIfCan(pTarget, SPELL_HEAL); + + m_uiHeal_Timer = 13000; + } + else + m_uiHeal_Timer -= uiDiff; + + //m_uiPowerWordShield_Timer + if (m_uiPowerWordShield_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature,SPELL_POWERWORDSHIELD); + m_uiPowerWordShield_Timer = 15000; + } + else + m_uiPowerWordShield_Timer -= uiDiff; + + //m_uiHolySmite_Timer + if (m_uiHolySmite_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HOLYSMITE); + m_uiHolySmite_Timer = 6000; + } + else + m_uiHolySmite_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_scarlet_commander_mograine(Creature* pCreature) +{ + return new boss_scarlet_commander_mograineAI(pCreature); +} + +CreatureAI* GetAI_boss_high_inquisitor_whitemane(Creature* pCreature) +{ + return new boss_high_inquisitor_whitemaneAI(pCreature); +} + +void AddSC_boss_mograine_and_whitemane() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_scarlet_commander_mograine"; + newscript->GetAI = &GetAI_boss_scarlet_commander_mograine; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_high_inquisitor_whitemane"; + newscript->GetAI = &GetAI_boss_high_inquisitor_whitemane; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp b/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp new file mode 100644 index 0000000..3476d93 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp @@ -0,0 +1,96 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Scorn +SD%Complete: 100 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_LICHSLAP 28873 +#define SPELL_FROSTBOLTVOLLEY 8398 +#define SPELL_MINDFLAY 17313 +#define SPELL_FROSTNOVA 15531 + +struct MANGOS_DLL_DECL boss_scornAI : public ScriptedAI +{ + boss_scornAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 LichSlap_Timer; + uint32 FrostboltVolley_Timer; + uint32 MindFlay_Timer; + uint32 FrostNova_Timer; + + void Reset() + { + LichSlap_Timer = 45000; + FrostboltVolley_Timer = 30000; + MindFlay_Timer = 30000; + FrostNova_Timer = 30000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //LichSlap_Timer + if (LichSlap_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_LICHSLAP); + LichSlap_Timer = 45000; + }else LichSlap_Timer -= diff; + + //FrostboltVolley_Timer + if (FrostboltVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBOLTVOLLEY); + FrostboltVolley_Timer = 20000; + }else FrostboltVolley_Timer -= diff; + + //MindFlay_Timer + if (MindFlay_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MINDFLAY); + MindFlay_Timer = 20000; + }else MindFlay_Timer -= diff; + + //FrostNova_Timer + if (FrostNova_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTNOVA); + FrostNova_Timer = 15000; + }else FrostNova_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_scorn(Creature* pCreature) +{ + return new boss_scornAI(pCreature); +} + +void AddSC_boss_scorn() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_scorn"; + newscript->GetAI = &GetAI_boss_scorn; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp b/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp new file mode 100644 index 0000000..a4dfad4 --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp @@ -0,0 +1,115 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Scarlet_Monastery +SD%Complete: 50 +SDComment: +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" +#include "scarlet_monastery.h" + +struct MANGOS_DLL_DECL instance_scarlet_monastery : public ScriptedInstance +{ + instance_scarlet_monastery(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiMograineGUID; + uint64 m_uiWhitemaneGUID; + uint64 m_uiVorrelGUID; + uint64 m_uiDoorHighInquisitorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiMograineGUID = 0; + m_uiWhitemaneGUID = 0; + m_uiVorrelGUID = 0; + m_uiDoorHighInquisitorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 3976: m_uiMograineGUID = pCreature->GetGUID(); break; + case 3977: m_uiWhitemaneGUID = pCreature->GetGUID(); break; + case 3981: m_uiVorrelGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + if (pGo->GetEntry() == 104600) + m_uiDoorHighInquisitorGUID = pGo->GetGUID(); + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_MOGRAINE: + return m_uiMograineGUID; + case DATA_WHITEMANE: + return m_uiWhitemaneGUID; + case DATA_VORREL: + return m_uiVorrelGUID; + case DATA_DOOR_WHITEMANE: + return m_uiDoorHighInquisitorGUID; + } + + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == TYPE_MOGRAINE_AND_WHITE_EVENT) + { + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiDoorHighInquisitorGUID); + if (uiData == FAIL) + DoUseDoorOrButton(m_uiDoorHighInquisitorGUID); + + m_auiEncounter[0] = uiData; + } + } + + uint32 GetData(uint32 uiData) + { + if (uiData == TYPE_MOGRAINE_AND_WHITE_EVENT) + return m_auiEncounter[0]; + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_scarlet_monastery(Map* pMap) +{ + return new instance_scarlet_monastery(pMap); +} + +void AddSC_instance_scarlet_monastery() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_scarlet_monastery"; + newscript->GetInstanceData = &GetInstanceData_instance_scarlet_monastery; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scarlet_monastery/scarlet_monastery.h b/scripts/eastern_kingdoms/scarlet_monastery/scarlet_monastery.h new file mode 100644 index 0000000..0a48eab --- /dev/null +++ b/scripts/eastern_kingdoms/scarlet_monastery/scarlet_monastery.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SCARLETM_H +#define DEF_SCARLETM_H + +enum +{ + MAX_ENCOUNTER = 1, + + TYPE_MOGRAINE_AND_WHITE_EVENT = 1, + + DATA_MOGRAINE = 2, + DATA_WHITEMANE = 3, + DATA_DOOR_WHITEMANE = 4, + DATA_VORREL = 5 +}; + +#endif diff --git a/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp b/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp new file mode 100644 index 0000000..6730b7f --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp @@ -0,0 +1,222 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkmaster_Gandling +SD%Complete: 75 +SDComment: Doors missing +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +#define SPELL_ARCANEMISSILES 22272 +#define SPELL_SHADOWSHIELD 22417 //Not right ID. But 12040 is wrong either. +#define SPELL_CURSE 18702 + +#define ADD_1X 170.205 +#define ADD_1Y 99.413 +#define ADD_1Z 104.733 +#define ADD_1O 3.16 + +#define ADD_2X 170.813 +#define ADD_2Y 97.857 +#define ADD_2Z 104.713 +#define ADD_2O 3.16 + +#define ADD_3X 170.720 +#define ADD_3Y 100.900 +#define ADD_3Z 104.739 +#define ADD_3O 3.16 + +#define ADD_4X 171.866 +#define ADD_4Y 99.373 +#define ADD_4Z 104.732 +#define ADD_4O 3.16 + +struct MANGOS_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI +{ + boss_darkmaster_gandlingAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 ShadowShield_Timer; + uint32 Curse_Timer; + uint32 Teleport_Timer; + + Creature *Summoned; + + void Reset() + { + ArcaneMissiles_Timer = 4500; + ShadowShield_Timer = 12000; + Curse_Timer = 2000; + Teleport_Timer = 16000; + } + + void JustDied(Unit *killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GANDLING, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ArcaneMissiles_Timer + if (ArcaneMissiles_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANEMISSILES); + ArcaneMissiles_Timer = 8000; + }else ArcaneMissiles_Timer -= diff; + + //ShadowShield_Timer + if (ShadowShield_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_SHADOWSHIELD); + ShadowShield_Timer = urand(14000, 28000); + }else ShadowShield_Timer -= diff; + + //Curse_Timer + if (Curse_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSE); + Curse_Timer = urand(15000, 27000); + }else Curse_Timer -= diff; + + //Teleporting Random Target to one of the six pre boss rooms and spawn 3-4 skeletons near the gamer. + //We will only telport if gandling has more than 3% of hp so teleported gamers can always loot. + if (m_creature->GetHealthPercent() > 3.0f) + { + if (Teleport_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->getThreatManager().getThreat(target)) + m_creature->getThreatManager().modifyThreatPercent(target, -100); + + switch(urand(0, 5)) + { + case 0: + DoTeleportPlayer(target, 250.0696f, 0.3921f, 84.8408f, 3.149f); + Summoned = m_creature->SummonCreature(16119, 254.2325f, 0.3417f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 257.7133f, 4.0226f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 258.6702f, -2.60656f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + break; + case 1: + DoTeleportPlayer(target, 181.4220f, -91.9481f, 84.8410f, 1.608f); + Summoned = m_creature->SummonCreature(16119, 184.0519f, -73.5649f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 179.5951f, -73.7045f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 180.6452f, -78.2143f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 283.2274f, -78.1518f, 84.8407f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + break; + case 2: + DoTeleportPlayer(target, 95.1547f, -1.8173f, 85.2289f, 0.043f); + Summoned = m_creature->SummonCreature(16119, 100.9404f, -1.8016f, 85.2289f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 101.3729f, 0.4882f, 85.2289f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 101.4596f, -4.4740f, 85.2289f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + break; + case 3: + DoTeleportPlayer(target, 250.0696f, 0.3921f, 72.6722f, 3.149f); + Summoned = m_creature->SummonCreature(16119, 240.34481f, 0.7368f, 72.6722f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 240.3633f, -2.9520f, 72.6722f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 240.6702f, 3.34949f, 72.6722f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + break; + case 4: + DoTeleportPlayer(target, 181.4220f, -91.9481f, 70.7734f, 1.608f); + Summoned = m_creature->SummonCreature(16119, 184.0519f, -73.5649f, 70.7734f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 179.5951f, -73.7045f, 70.7734f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 180.6452f, -78.2143f, 70.7734f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 283.2274f, -78.1518f, 70.7734f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + break; + case 5: + DoTeleportPlayer(target, 106.1541f, -1.8994f, 75.3663f, 0.043f); + Summoned = m_creature->SummonCreature(16119, 115.3945f, -1.5555f, 75.3663f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 257.7133f, 1.8066f, 75.3663f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + Summoned = m_creature->SummonCreature(16119, 258.6702f, -5.1001f, 75.3663f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + Summoned->AI()->AttackStart(target); + break; + } + } + Teleport_Timer = urand(20000, 35000); + }else Teleport_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_darkmaster_gandling(Creature* pCreature) +{ + return new boss_darkmaster_gandlingAI(pCreature); +} + +void AddSC_boss_darkmaster_gandling() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_darkmaster_gandling"; + newscript->GetAI = &GetAI_boss_darkmaster_gandling; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp b/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp new file mode 100644 index 0000000..5675e2f --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp @@ -0,0 +1,56 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Death_knight_darkreaver +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +struct MANGOS_DLL_DECL boss_death_knight_darkreaverAI : public ScriptedAI +{ + boss_death_knight_darkreaverAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (m_creature->GetHealth() <= damage) + { + m_creature->CastSpell(m_creature,23261,true); //Summon Darkreaver's Fallen Charger + } + } +}; + +CreatureAI* GetAI_boss_death_knight_darkreaver(Creature* pCreature) +{ + return new boss_death_knight_darkreaverAI(pCreature); +} + +void AddSC_boss_death_knight_darkreaver() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_death_knight_darkreaver"; + newscript->GetAI = &GetAI_boss_death_knight_darkreaver; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp new file mode 100644 index 0000000..2600ecf --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp @@ -0,0 +1,116 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Doctor_Theolen_Krastinov +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, + + SPELL_REND = 16509, + SPELL_BACKHAND = 18103, + SPELL_FRENZY = 8269 +}; + +struct MANGOS_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI +{ + boss_theolenkrastinovAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiRend_Timer; + uint32 m_uiBackhand_Timer; + uint32 m_uiFrenzy_Timer; + + void Reset() + { + m_uiRend_Timer = 8000; + m_uiBackhand_Timer = 9000; + m_uiFrenzy_Timer = 1000; + } + + void JustDied(Unit *killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + pInstance->SetData(TYPE_THEOLEN, DONE); + + if (pInstance->GetData(TYPE_GANDLING) == SPECIAL) + m_creature->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Rend_Timer + if (m_uiRend_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_REND); + m_uiRend_Timer = 10000; + } + else + m_uiRend_Timer -= uiDiff; + + //m_uiBackhand_Timer + if (m_uiBackhand_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BACKHAND); + m_uiBackhand_Timer = 10000; + } + else + m_uiBackhand_Timer -= uiDiff; + + //Frenzy_Timer + if (m_creature->GetHealthPercent() < 26.0f) + { + if (m_uiFrenzy_Timer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_FRENZY) == CAST_OK) + { + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + m_uiFrenzy_Timer = 120000; + } + } + else + m_uiFrenzy_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature) +{ + return new boss_theolenkrastinovAI(pCreature); +} + +void AddSC_boss_theolenkrastinov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_doctor_theolen_krastinov"; + newscript->GetAI = &GetAI_boss_theolenkrastinov; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp b/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp new file mode 100644 index 0000000..f5052d4 --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp @@ -0,0 +1,111 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Illucia_Barov +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +#define SPELL_CURSEOFAGONY 18671 +#define SPELL_SHADOWSHOCK 20603 +#define SPELL_SILENCE 15487 +#define SPELL_FEAR 6215 + +struct MANGOS_DLL_DECL boss_illuciabarovAI : public ScriptedAI +{ + boss_illuciabarovAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 CurseOfAgony_Timer; + uint32 ShadowShock_Timer; + uint32 Silence_Timer; + uint32 Fear_Timer; + + void Reset() + { + CurseOfAgony_Timer = 18000; + ShadowShock_Timer = 9000; + Silence_Timer = 5000; + Fear_Timer = 30000; + } + + void JustDied(Unit *killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + pInstance->SetData(TYPE_ILLUCIABAROV, DONE); + + if (pInstance->GetData(TYPE_GANDLING) == SPECIAL) + m_creature->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //CurseOfAgony_Timer + if (CurseOfAgony_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFAGONY); + CurseOfAgony_Timer = 30000; + }else CurseOfAgony_Timer -= diff; + + //ShadowShock_Timer + if (ShadowShock_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_SHADOWSHOCK); + + ShadowShock_Timer = 12000; + }else ShadowShock_Timer -= diff; + + //Silence_Timer + if (Silence_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SILENCE); + Silence_Timer = 14000; + }else Silence_Timer -= diff; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FEAR); + Fear_Timer = 30000; + }else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_illuciabarov(Creature* pCreature) +{ + return new boss_illuciabarovAI(pCreature); +} + +void AddSC_boss_illuciabarov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_illucia_barov"; + newscript->GetAI = &GetAI_boss_illuciabarov; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp b/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp new file mode 100644 index 0000000..4f79a10 --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp @@ -0,0 +1,147 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_instructormalicia +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +#define SPELL_CALLOFGRAVES 17831 +#define SPELL_CORRUPTION 11672 +#define SPELL_FLASHHEAL 10917 +#define SPELL_RENEW 10929 +#define SPELL_HEALINGTOUCH 9889 + +struct MANGOS_DLL_DECL boss_instructormaliciaAI : public ScriptedAI +{ + boss_instructormaliciaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 CallOfGraves_Timer; + uint32 Corruption_Timer; + uint32 FlashHeal_Timer; + uint32 Renew_Timer; + uint32 HealingTouch_Timer; + uint32 FlashCounter; + uint32 TouchCounter; + + void Reset() + { + CallOfGraves_Timer = 4000; + Corruption_Timer = 8000; + FlashHeal_Timer = 38000; + Renew_Timer = 32000; + HealingTouch_Timer = 45000; + FlashCounter = 0; + TouchCounter = 0; + } + + void JustDied(Unit *killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + pInstance->SetData(TYPE_MALICIA, DONE); + + if (pInstance->GetData(TYPE_GANDLING) == SPECIAL) + m_creature->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //CallOfGraves_Timer + if (CallOfGraves_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CALLOFGRAVES); + CallOfGraves_Timer = 65000; + }else CallOfGraves_Timer -= diff; + + //Corruption_Timer + if (Corruption_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_CORRUPTION); + + Corruption_Timer = 24000; + }else Corruption_Timer -= diff; + + //Renew_Timer + if (Renew_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_RENEW); + Renew_Timer = 10000; + }else Renew_Timer -= diff; + + //FlashHeal_Timer + if (FlashHeal_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_FLASHHEAL); + + //5 Flashheals will be casted + if (FlashCounter < 2) + { + FlashHeal_Timer = 5000; + ++FlashCounter; + } + else + { + FlashCounter=0; + FlashHeal_Timer = 30000; + } + }else FlashHeal_Timer -= diff; + + //HealingTouch_Timer + if (HealingTouch_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_HEALINGTOUCH); + + //3 Healingtouchs will be casted + if (HealingTouch_Timer < 2) + { + HealingTouch_Timer = 5500; + ++TouchCounter; + } + else + { + TouchCounter=0; + HealingTouch_Timer = 30000; + } + }else HealingTouch_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_instructormalicia(Creature* pCreature) +{ + return new boss_instructormaliciaAI(pCreature); +} + +void AddSC_boss_instructormalicia() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_instructor_malicia"; + newscript->GetAI = &GetAI_boss_instructormalicia; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp b/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp new file mode 100644 index 0000000..25750fa --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp @@ -0,0 +1,201 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* 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, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_jandicebarov +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_CURSEOFBLOOD 24673 +//#define SPELL_ILLUSION 17773 + +//Spells of Illusion of Jandice Barov +#define SPELL_CLEAVE 15584 + +struct MANGOS_DLL_DECL boss_jandicebarovAI : public ScriptedAI +{ + boss_jandicebarovAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 CurseOfBlood_Timer; + uint32 Illusion_Timer; + //uint32 Illusioncounter; + uint32 Invisible_Timer; + bool Invisible; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + CurseOfBlood_Timer = 15000; + Illusion_Timer = 30000; + Invisible_Timer = 3000; //Too much too low? + Invisible = false; + } + + void SummonIllusions(Unit* victim) + { + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(11439, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + if (Summoned) + Summoned->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (Invisible && Invisible_Timer < diff) + { + //Become visible again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(11073); //Jandice Model + Invisible = false; + } else if (Invisible) + { + Invisible_Timer -= diff; + //Do nothing while invisible + return; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //CurseOfBlood_Timer + if (CurseOfBlood_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFBLOOD); + CurseOfBlood_Timer = 30000; + }else CurseOfBlood_Timer -= diff; + + //Illusion_Timer + if (!Invisible && Illusion_Timer < diff) + { + //Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(11686); // Invisible Model + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-99); + + //Summon 10 Illusions attacking random gamers + Unit* target = NULL; + for(int i = 0; i < 10; ++i) + { + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + SummonIllusions(target); + } + Invisible = true; + Invisible_Timer = 3000; + + //25 seconds until we should cast this agian + Illusion_Timer = 25000; + }else Illusion_Timer -= diff; + + // //Illusion_Timer + // if (Illusion_Timer < diff) + // { + // //Cast + // DoCastSpellIfCan(m_creature->getVictim(),SPELL_ILLUSION); + // //3 Illusion will be summoned + // if (Illusioncounter < 3) + // { + // Illusion_Timer = 500; + // ++Illusioncounter; + // } + // else { + // //15 seconds until we should cast this again + // Illusion_Timer = 15000; + // Illusioncounter=0; + // } + // }else Illusion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +// Illusion of Jandice Barov Script + +struct MANGOS_DLL_DECL mob_illusionofjandicebarovAI : public ScriptedAI +{ + mob_illusionofjandicebarovAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Cleave_Timer; + + void Reset() + { + Cleave_Timer = urand(2000, 8000); + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = urand(5000, 8000); + }else Cleave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jandicebarov(Creature* pCreature) +{ + return new boss_jandicebarovAI(pCreature); +} + +CreatureAI* GetAI_mob_illusionofjandicebarov(Creature* pCreature) +{ + return new mob_illusionofjandicebarovAI(pCreature); +} + +void AddSC_boss_jandicebarov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_jandice_barov"; + newscript->GetAI = &GetAI_boss_jandicebarov; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_illusionofjandicebarov"; + newscript->GetAI = &GetAI_mob_illusionofjandicebarov; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp b/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp new file mode 100644 index 0000000..cec9bb4 --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp @@ -0,0 +1,153 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kormok +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWBOLTVOLLEY 20741 +#define SPELL_BONESHIELD 27688 + +struct MANGOS_DLL_DECL boss_kormokAI : public ScriptedAI +{ + boss_kormokAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowVolley_Timer; + uint32 BoneShield_Timer; + uint32 Minion_Timer; + uint32 Mage_Timer; + bool Mages; + int Rand1; + int Rand1X; + int Rand1Y; + int Rand2; + int Rand2X; + int Rand2Y; + Creature* SummonedMinions; + Creature* SummonedMages; + + void Reset() + { + ShadowVolley_Timer = 10000; + BoneShield_Timer = 2000; + Minion_Timer = 15000; + Mage_Timer = 0; + Mages = false; + } + + void SummonMinion(Unit* victim) + { + Rand1 = rand()%8; + switch(urand(0, 1)) + { + case 0: Rand1X = 0 - Rand1; break; + case 1: Rand1X = 0 + Rand1; break; + } + Rand1 = 0; + Rand1 = rand()%8; + switch(urand(0, 1)) + { + case 0: Rand1Y = 0 - Rand1; break; + case 1: Rand1Y = 0 + Rand1; break; + } + Rand1 = 0; + SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedMinions) + SummonedMinions->AI()->AttackStart(victim); + } + + void SummonMages(Unit* victim) + { + Rand2 = rand()%10; + switch(urand(0, 1)) + { + case 0: Rand2X = 0 - Rand2; break; + case 1: Rand2X = 0 + Rand2; break; + } + Rand2 = 0; + Rand2 = rand()%10; + switch(urand(0, 1)) + { + case 0: Rand2Y = 0 - Rand2; break; + case 1: Rand2Y = 0 + Rand2; break; + } + Rand2 = 0; + SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedMages) + SummonedMages->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); + ShadowVolley_Timer = 15000; + }else ShadowVolley_Timer -= diff; + + //BoneShield_Timer + if (BoneShield_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BONESHIELD); + BoneShield_Timer = 45000; + }else BoneShield_Timer -= diff; + + //Minion_Timer + if (Minion_Timer < diff) + { + //Cast + SummonMinion(m_creature->getVictim()); + SummonMinion(m_creature->getVictim()); + SummonMinion(m_creature->getVictim()); + SummonMinion(m_creature->getVictim()); + + Minion_Timer = 12000; + }else Minion_Timer -= diff; + + //Summon 2 Bone Mages + if (!Mages && m_creature->GetHealthPercent() < 26.0f) + { + //Cast + SummonMages(m_creature->getVictim()); + SummonMages(m_creature->getVictim()); + Mages = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_kormok(Creature* pCreature) +{ + return new boss_kormokAI(pCreature); +} + +void AddSC_boss_kormok() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kormok"; + newscript->GetAI = &GetAI_boss_kormok; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp b/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp new file mode 100644 index 0000000..17fc273 --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Lord_Alexei_Barov +SD%Complete: 100 +SDComment: aura applied/defined in database +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +#define SPELL_IMMOLATE 20294 // Old ID was 15570 +#define SPELL_VEILOFSHADOW 17820 + +struct MANGOS_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI +{ + boss_lordalexeibarovAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Immolate_Timer; + uint32 VeilofShadow_Timer; + + void Reset() + { + Immolate_Timer = 7000; + VeilofShadow_Timer = 15000; + + m_creature->LoadCreatureAddon(); + } + + void JustDied(Unit *killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + pInstance->SetData(TYPE_ALEXEIBAROV, DONE); + + if (pInstance->GetData(TYPE_GANDLING) == SPECIAL) + m_creature->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Immolate_Timer + if (Immolate_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_IMMOLATE); + + Immolate_Timer = 12000; + }else Immolate_Timer -= diff; + + //VeilofShadow_Timer + if (VeilofShadow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_VEILOFSHADOW); + VeilofShadow_Timer = 20000; + }else VeilofShadow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_lordalexeibarov(Creature* pCreature) +{ + return new boss_lordalexeibarovAI(pCreature); +} + +void AddSC_boss_lordalexeibarov() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lord_alexei_barov"; + newscript->GetAI = &GetAI_boss_lordalexeibarov; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp b/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp new file mode 100644 index 0000000..f684020 --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp @@ -0,0 +1,108 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Lorekeeper_Polkelt +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +#define SPELL_VOLATILEINFECTION 24928 +#define SPELL_DARKPLAGUE 18270 +#define SPELL_CORROSIVEACID 23313 +#define SPELL_NOXIOUSCATALYST 18151 + +struct MANGOS_DLL_DECL boss_lorekeeperpolkeltAI : public ScriptedAI +{ + boss_lorekeeperpolkeltAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 VolatileInfection_Timer; + uint32 Darkplague_Timer; + uint32 CorrosiveAcid_Timer; + uint32 NoxiousCatalyst_Timer; + + void Reset() + { + VolatileInfection_Timer = 38000; + Darkplague_Timer = 8000; + CorrosiveAcid_Timer = 45000; + NoxiousCatalyst_Timer = 35000; + } + + void JustDied(Unit *killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + pInstance->SetData(TYPE_POLKELT, DONE); + + if (pInstance->GetData(TYPE_GANDLING) == SPECIAL) + m_creature->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //VolatileInfection_Timer + if (VolatileInfection_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_VOLATILEINFECTION); + VolatileInfection_Timer = 32000; + }else VolatileInfection_Timer -= diff; + + //Darkplague_Timer + if (Darkplague_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DARKPLAGUE); + Darkplague_Timer = 8000; + }else Darkplague_Timer -= diff; + + //CorrosiveAcid_Timer + if (CorrosiveAcid_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CORROSIVEACID); + CorrosiveAcid_Timer = 25000; + }else CorrosiveAcid_Timer -= diff; + + //NoxiousCatalyst_Timer + if (NoxiousCatalyst_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_NOXIOUSCATALYST); + NoxiousCatalyst_Timer = 38000; + }else NoxiousCatalyst_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_lorekeeperpolkelt(Creature* pCreature) +{ + return new boss_lorekeeperpolkeltAI(pCreature); +} + +void AddSC_boss_lorekeeperpolkelt() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lorekeeper_polkelt"; + newscript->GetAI = &GetAI_boss_lorekeeperpolkelt; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp b/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp new file mode 100644 index 0000000..349b03e --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp @@ -0,0 +1,121 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ras_Frostwhisper +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FROSTBOLT 21369 +#define SPELL_ICEARMOR 18100 //This is actually a buff he gives himself +#define SPELL_FREEZE 18763 +#define SPELL_FEAR 26070 +#define SPELL_CHILLNOVA 18099 +#define SPELL_FROSTVOLLEY 8398 + +struct MANGOS_DLL_DECL boss_rasfrostAI : public ScriptedAI +{ + boss_rasfrostAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 IceArmor_Timer; + uint32 Frostbolt_Timer; + uint32 Freeze_Timer; + uint32 Fear_Timer; + uint32 ChillNova_Timer; + uint32 FrostVolley_Timer; + + void Reset() + { + IceArmor_Timer = 2000; + Frostbolt_Timer = 8000; + ChillNova_Timer = 12000; + Freeze_Timer = 18000; + FrostVolley_Timer = 24000; + Fear_Timer = 45000; + + m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //IceArmor_Timer + if (IceArmor_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_ICEARMOR); + IceArmor_Timer = 180000; + }else IceArmor_Timer -= diff; + + //Frostbolt_Timer + if (Frostbolt_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_FROSTBOLT); + + Frostbolt_Timer = 8000; + }else Frostbolt_Timer -= diff; + + //Freeze_Timer + if (Freeze_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FREEZE); + Freeze_Timer = 24000; + }else Freeze_Timer -= diff; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FEAR); + Fear_Timer = 30000; + }else Fear_Timer -= diff; + + //ChillNova_Timer + if (ChillNova_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CHILLNOVA); + ChillNova_Timer = 14000; + }else ChillNova_Timer -= diff; + + //FrostVolley_Timer + if (FrostVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTVOLLEY); + FrostVolley_Timer = 15000; + }else FrostVolley_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_rasfrost(Creature* pCreature) +{ + return new boss_rasfrostAI(pCreature); +} + +void AddSC_boss_rasfrost() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_boss_ras_frostwhisper"; + newscript->GetAI = &GetAI_boss_rasfrost; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp b/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp new file mode 100644 index 0000000..7d9dafb --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp @@ -0,0 +1,111 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_the_ravenian +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +#define SPELL_TRAMPLE 15550 +#define SPELL_CLEAVE 20691 +#define SPELL_SUNDERINCLEAVE 25174 +#define SPELL_KNOCKAWAY 10101 + +struct MANGOS_DLL_DECL boss_theravenianAI : public ScriptedAI +{ + boss_theravenianAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Trample_Timer; + uint32 Cleave_Timer; + uint32 SunderingCleave_Timer; + uint32 KnockAway_Timer; + bool HasYelled; + + void Reset() + { + Trample_Timer = 24000; + Cleave_Timer = 15000; + SunderingCleave_Timer = 40000; + KnockAway_Timer = 32000; + HasYelled = false; + } + + void JustDied(Unit *killer) + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + pInstance->SetData(TYPE_RAVENIAN, DONE); + + if (pInstance->GetData(TYPE_GANDLING) == SPECIAL) + m_creature->SummonCreature(1853, 180.73f, -9.43856f, 75.507f, 1.61399f, TEMPSUMMON_DEAD_DESPAWN, 0); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Trample_Timer + if (Trample_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_TRAMPLE); + Trample_Timer = 10000; + }else Trample_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //SunderingCleave_Timer + if (SunderingCleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SUNDERINCLEAVE); + SunderingCleave_Timer = 20000; + }else SunderingCleave_Timer -= diff; + + //KnockAway_Timer + if (KnockAway_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKAWAY); + KnockAway_Timer = 12000; + }else KnockAway_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_theravenian(Creature* pCreature) +{ + return new boss_theravenianAI(pCreature); +} + +void AddSC_boss_theravenian() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_ravenian"; + newscript->GetAI = &GetAI_boss_theravenian; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp new file mode 100644 index 0000000..add111f --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp @@ -0,0 +1,103 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Vectus +SD%Complete: 60 +SDComment: event not implemented +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +enum +{ + //EMOTE_GENERIC_FRENZY_KILL = -1000001, + + SPELL_FLAMESTRIKE = 18399, + SPELL_BLAST_WAVE = 16046 + //SPELL_FRENZY = 28371 //spell is used by Gluth, confirm this is for this boss too + //SPELL_FIRE_SHIELD = 0 //should supposedly have some aura, but proper spell not found +}; + +struct MANGOS_DLL_DECL boss_vectusAI : public ScriptedAI +{ + boss_vectusAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiFlameStrike_Timer; + uint32 m_uiBlastWave_Timer; + uint32 m_uiFrenzy_Timer; + + void Reset() + { + m_uiFlameStrike_Timer = 2000; + m_uiBlastWave_Timer = 14000; + m_uiFrenzy_Timer = 0; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiFlameStrike_Timer + if (m_uiFlameStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FLAMESTRIKE); + m_uiFlameStrike_Timer = 30000; + } + else + m_uiFlameStrike_Timer -= uiDiff; + + //BlastWave_Timer + if (m_uiBlastWave_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BLAST_WAVE); + m_uiBlastWave_Timer = 12000; + } + else + m_uiBlastWave_Timer -= uiDiff; + + //Frenzy_Timer + /*if (m_creature->GetHealthPercent() < 25.0f) + { + if (m_uiFrenzy_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + m_uiFrenzy_Timer = 24000; + } + else + m_uiFrenzy_Timer -= uiDiff; + }*/ + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vectus(Creature* pCreature) +{ + return new boss_vectusAI(pCreature); +} + +void AddSC_boss_vectus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_vectus"; + newscript->GetAI = &GetAI_boss_vectus; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp b/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp new file mode 100644 index 0000000..fb6c3b1 --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp @@ -0,0 +1,130 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Scholomance +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "scholomance.h" + +struct MANGOS_DLL_DECL instance_scholomance : public ScriptedInstance +{ + instance_scholomance(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiGateKirtonosGUID; + uint64 m_uiGateGandlingGUID; + uint64 m_uiGateMiliciaGUID; + uint64 m_uiGateTheolenGUID; + uint64 m_uiGatePolkeltGUID; + uint64 m_uiGateRavenianGUID; + uint64 m_uiGateBarovGUID; + uint64 m_uiGateIlluciaGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiGateKirtonosGUID = 0; + m_uiGateGandlingGUID = 0; + m_uiGateMiliciaGUID = 0; + m_uiGateTheolenGUID = 0; + m_uiGatePolkeltGUID = 0; + m_uiGateRavenianGUID = 0; + m_uiGateBarovGUID = 0; + m_uiGateIlluciaGUID = 0; + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_GATE_KIRTONOS: m_uiGateKirtonosGUID = pGo->GetGUID(); break; + case GO_GATE_GANDLING: m_uiGateGandlingGUID = pGo->GetGUID(); break; + case GO_GATE_MALICIA: m_uiGateMiliciaGUID = pGo->GetGUID(); break; + case GO_GATE_THEOLEN: m_uiGateTheolenGUID = pGo->GetGUID(); break; + case GO_GATE_POLKELT: m_uiGatePolkeltGUID = pGo->GetGUID(); break; + case GO_GATE_RAVENIAN: m_uiGateRavenianGUID = pGo->GetGUID(); break; + case GO_GATE_BAROV: m_uiGateBarovGUID = pGo->GetGUID(); break; + case GO_GATE_ILLUCIA: m_uiGateIlluciaGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_GANDLING: + m_auiEncounter[0] = uiData; + break; + case TYPE_KIRTONOS: + m_auiEncounter[1] = uiData; + break; + case TYPE_ALEXEIBAROV: + m_auiEncounter[2] = uiData; + break; + case TYPE_THEOLEN: + m_auiEncounter[3] = uiData; + break; + case TYPE_RAVENIAN: + m_auiEncounter[4] = uiData; + break; + case TYPE_POLKELT: + m_auiEncounter[5] = uiData; + break; + case TYPE_MALICIA: + m_auiEncounter[6] = uiData; + break; + case TYPE_ILLUCIABAROV: + m_auiEncounter[7] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_GANDLING) + { + if (m_auiEncounter[2] == DONE && m_auiEncounter[3] == DONE && m_auiEncounter[4] == DONE && + m_auiEncounter[5] == DONE && m_auiEncounter[6] == DONE && m_auiEncounter[7] == DONE) + { + m_auiEncounter[0] = SPECIAL; + return SPECIAL; + } + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_scholomance(Map* pMap) +{ + return new instance_scholomance(pMap); +} + +void AddSC_instance_scholomance() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_scholomance"; + newscript->GetInstanceData = &GetInstanceData_instance_scholomance; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/scholomance/scholomance.h b/scripts/eastern_kingdoms/scholomance/scholomance.h new file mode 100644 index 0000000..b91227d --- /dev/null +++ b/scripts/eastern_kingdoms/scholomance/scholomance.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SCHOLOMANCE_H +#define DEF_SCHOLOMANCE_H + +enum +{ + MAX_ENCOUNTER = 8, + + GO_GATE_KIRTONOS = 175570, + GO_GATE_GANDLING = 177374, + GO_GATE_MALICIA = 177375, + GO_GATE_THEOLEN = 177377, + GO_GATE_POLKELT = 177376, + GO_GATE_RAVENIAN = 177372, + GO_GATE_BAROV = 177373, + GO_GATE_ILLUCIA = 177371, + + TYPE_GANDLING = 1, + TYPE_THEOLEN = 2, + TYPE_MALICIA = 3, + TYPE_ILLUCIABAROV = 4, + TYPE_ALEXEIBAROV = 5, + TYPE_POLKELT = 6, + TYPE_RAVENIAN = 7, + TYPE_KIRTONOS = 8 +}; + +#endif diff --git a/scripts/eastern_kingdoms/searing_gorge.cpp b/scripts/eastern_kingdoms/searing_gorge.cpp new file mode 100644 index 0000000..c026146 --- /dev/null +++ b/scripts/eastern_kingdoms/searing_gorge.cpp @@ -0,0 +1,159 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Searing_Gorge +SD%Complete: 80 +SDComment: Quest support: 3377, 3441 (More accurate info on Kalaran needed). Lothos Riftwaker teleport to Molten Core. +SDCategory: Searing Gorge +EndScriptData */ + +/* ContentData +npc_kalaran_windblade +npc_lothos_riftwaker +npc_zamael_lunthistle +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_kalaran_windblade +######*/ + +bool GossipHello_npc_kalaran_windblade(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(3441) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me what drives this vengance?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_kalaran_windblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Continue please", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(1954, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let me confer with my colleagues", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1955, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3441); + break; + } + return true; +} + +/*###### +## npc_lothos_riftwaker +######*/ + +bool GossipHello_npc_lothos_riftwaker(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(7487) || pPlayer->GetQuestRewardStatus(7848)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Teleport me to the Molten Core", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lothos_riftwaker(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TeleportTo(409, 1096.0f, -467.0f, -104.6f, 3.64f); + } + + return true; +} + +/*###### +## npc_zamael_lunthistle +######*/ + +bool GossipHello_npc_zamael_lunthistle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(3377) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(1920, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_zamael_lunthistle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please continue...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(1921, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Goodbye", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(1922, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3377); + break; + } + return true; +} + +/*###### +## +######*/ + +void AddSC_searing_gorge() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_kalaran_windblade"; + newscript->pGossipHello = &GossipHello_npc_kalaran_windblade; + newscript->pGossipSelect = &GossipSelect_npc_kalaran_windblade; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lothos_riftwaker"; + newscript->pGossipHello = &GossipHello_npc_lothos_riftwaker; + newscript->pGossipSelect = &GossipSelect_npc_lothos_riftwaker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_zamael_lunthistle"; + newscript->pGossipHello = &GossipHello_npc_zamael_lunthistle; + newscript->pGossipSelect = &GossipSelect_npc_zamael_lunthistle; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp b/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp new file mode 100644 index 0000000..a612d34 --- /dev/null +++ b/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp @@ -0,0 +1,260 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadowfang_Keep +SD%Complete: 90 +SDComment: +SDCategory: Shadowfang Keep +EndScriptData */ + +#include "precompiled.h" +#include "shadowfang_keep.h" + +enum +{ + MAX_ENCOUNTER = 6, + + SAY_BOSS_DIE_AD = -1033007, + SAY_BOSS_DIE_AS = -1033008, + + NPC_ASH = 3850, + NPC_ADA = 3849, +// NPC_ARUGAL = 10000, //"Arugal" says intro text, not used + NPC_ARCHMAGE_ARUGAL = 4275, //"Archmage Arugal" does Fenrus event + NPC_FENRUS = 4274, //used to summon Arugal in Fenrus event + NPC_VINCENT = 4444, //Vincent should be "dead" is Arugal is done the intro already + + GO_COURTYARD_DOOR = 18895, //door to open when talking to NPC's + GO_SORCERER_DOOR = 18972, //door to open when Fenrus the Devourer + GO_ARUGAL_DOOR = 18971, //door to open when Wolf Master Nandos + GO_ARUGAL_FOCUS = 18973 //this generates the lightning visual in the Fenrus event +}; + +struct MANGOS_DLL_DECL instance_shadowfang_keep : public ScriptedInstance +{ + instance_shadowfang_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiAshGUID; + uint64 m_uiAdaGUID; + + uint64 m_uiDoorCourtyardGUID; + uint64 m_uiDoorSorcererGUID; + uint64 m_uiDoorArugalGUID; + + uint64 m_uiFenrusGUID; + uint64 m_uiVincentGUID; + + uint64 m_uiArugalFocusGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiAshGUID = 0; + m_uiAdaGUID = 0; + + m_uiDoorCourtyardGUID = 0; + m_uiDoorSorcererGUID = 0; + m_uiDoorArugalGUID = 0; + + m_uiFenrusGUID = 0; + m_uiVincentGUID = 0; + + m_uiArugalFocusGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_ASH: m_uiAshGUID = pCreature->GetGUID(); break; + case NPC_ADA: m_uiAdaGUID = pCreature->GetGUID(); break; + case NPC_FENRUS: m_uiFenrusGUID = pCreature->GetGUID(); break; + case NPC_VINCENT: + m_uiVincentGUID = pCreature->GetGUID(); + //if Arugal has done the intro, make Vincent dead! + if (m_auiEncounter[4] == DONE) + pCreature->SetStandState(UNIT_STAND_STATE_DEAD); + break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_COURTYARD_DOOR: + m_uiDoorCourtyardGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + //for this we ignore voidwalkers, because if the server restarts + //they won't be there, but Fenrus is dead so the door can't be opened! + case GO_SORCERER_DOOR: + m_uiDoorSorcererGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ARUGAL_DOOR: + m_uiDoorArugalGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ARUGAL_FOCUS: + m_uiArugalFocusGUID = pGo->GetGUID(); + break; + } + } + + void DoSpeech() + { + Creature* pAda = instance->GetCreature(m_uiAdaGUID); + Creature* pAsh = instance->GetCreature(m_uiAshGUID); + + if (pAda && pAda->isAlive() && pAsh && pAsh->isAlive()) + { + DoScriptText(SAY_BOSS_DIE_AD,pAda); + DoScriptText(SAY_BOSS_DIE_AS,pAsh); + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_FREE_NPC: + if (uiData == DONE) + DoUseDoorOrButton(m_uiDoorCourtyardGUID); + m_auiEncounter[0] = uiData; + break; + case TYPE_RETHILGORE: + if (uiData == DONE) + DoSpeech(); + m_auiEncounter[1] = uiData; + break; + case TYPE_FENRUS: + if (uiData == DONE) + if (Creature* pFenrus = instance->GetCreature(m_uiFenrusGUID)) + pFenrus->SummonCreature(NPC_ARCHMAGE_ARUGAL,-136.89f,2169.17f,136.58f,2.794f,TEMPSUMMON_TIMED_DESPAWN,30000); + m_auiEncounter[2] = uiData; + break; + case TYPE_NANDOS: + if (uiData == DONE) + DoUseDoorOrButton(m_uiDoorArugalGUID); + m_auiEncounter[3] = uiData; + break; + case TYPE_INTRO: + m_auiEncounter[4] = uiData; + break; + case TYPE_VOIDWALKER: + if (uiData == DONE) + { + m_auiEncounter[5]++; + if (m_auiEncounter[5] > 3) + DoUseDoorOrButton(m_uiDoorSorcererGUID); + } + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] + << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_FREE_NPC: + return m_auiEncounter[0]; + case TYPE_RETHILGORE: + return m_auiEncounter[1]; + case TYPE_FENRUS: + return m_auiEncounter[2]; + case TYPE_NANDOS: + return m_auiEncounter[3]; + case TYPE_INTRO: + return m_auiEncounter[4]; + } + return 0; + } + + uint64 GetData64(uint32 uiType) + { + switch(uiType) + { + case DATA_LIGHTNING: + return m_uiArugalFocusGUID; + } + return 0; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadowfang_keep(Map* pMap) +{ + return new instance_shadowfang_keep(pMap); +} + +void AddSC_instance_shadowfang_keep() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadowfang_keep"; + newscript->GetInstanceData = &GetInstanceData_instance_shadowfang_keep; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp b/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp new file mode 100644 index 0000000..24ec02d --- /dev/null +++ b/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp @@ -0,0 +1,935 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Shadowfang_Keep +SD%Complete: 75 +SDComment: npc_shadowfang_prisoner using escortAI for movement to door. +SDCategory: Shadowfang Keep +EndScriptData */ + +/* ContentData +npc_shadowfang_prisoner +mob_arugal_voidwalker +npc_arugal +boss_arugal +npc_deathstalker_vincent +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "shadowfang_keep.h" + +/*###### +## npc_shadowfang_prisoner +######*/ + +enum +{ + SAY_FREE_AS = -1033000, + SAY_OPEN_DOOR_AS = -1033001, + SAY_POST_DOOR_AS = -1033002, + EMOTE_VANISH_AS = -1033014, + SAY_FREE_AD = -1033003, + SAY_OPEN_DOOR_AD = -1033004, + SAY_POST1_DOOR_AD = -1033005, + SAY_POST2_DOOR_AD = -1033006, + EMOTE_UNLOCK_DOOR_AD = -1033015, + + SPELL_UNLOCK = 6421, + SPELL_FIRE = 6422, + NPC_ASH = 3850, + NPC_ADA = 3849 +}; + +#define GOSSIP_ITEM_DOOR "Please unlock the courtyard door." + +struct MANGOS_DLL_DECL npc_shadowfang_prisonerAI : public npc_escortAI +{ + npc_shadowfang_prisonerAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_uiNpcEntry = pCreature->GetEntry(); + Reset(); + } + + ScriptedInstance* m_pInstance; + uint32 m_uiNpcEntry; + + void WaypointReached(uint32 uiPoint) + { + switch(uiPoint) + { + case 0: + if (m_uiNpcEntry == NPC_ASH) + DoScriptText(SAY_FREE_AS, m_creature); + else + DoScriptText(SAY_FREE_AD, m_creature); + break; + case 10: + if (m_uiNpcEntry == NPC_ASH) + DoScriptText(SAY_OPEN_DOOR_AS, m_creature); + else + DoScriptText(SAY_OPEN_DOOR_AD, m_creature); + break; + case 11: + if (m_uiNpcEntry == NPC_ASH) + DoCastSpellIfCan(m_creature, SPELL_UNLOCK); + else + DoScriptText(EMOTE_UNLOCK_DOOR_AD, m_creature); + break; + case 12: + if (m_uiNpcEntry != NPC_ASH) + m_creature->HandleEmote(EMOTE_ONESHOT_USESTANDING); + break; + case 13: + if (m_uiNpcEntry == NPC_ASH) + DoScriptText(SAY_POST_DOOR_AS, m_creature); + else + DoScriptText(SAY_POST1_DOOR_AD, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_FREE_NPC, DONE); + break; + case 14: + if (m_uiNpcEntry == NPC_ASH) + DoCastSpellIfCan(m_creature, SPELL_FIRE); + else + { + DoScriptText(SAY_POST2_DOOR_AD, m_creature); + SetRun(); + } + break; + case 15: + if (m_uiNpcEntry == NPC_ASH) + DoScriptText(EMOTE_VANISH_AS, m_creature); + break; + } + } + + void Reset() {} + + //let's prevent Adamant from charging into Ashcrombe's cell + //and beating the crap out of him and vice versa XD + void AttackStart(Unit* pWho) + { + if (pWho) + { + if (pWho->GetEntry() == NPC_ASH || pWho->GetEntry() == NPC_ADA) + return; + else + ScriptedAI::AttackStart(pWho); + } + } +}; + +CreatureAI* GetAI_npc_shadowfang_prisoner(Creature* pCreature) +{ + return new npc_shadowfang_prisonerAI(pCreature); +} + +bool GossipHello_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + if (pInstance && pInstance->GetData(TYPE_FREE_NPC) != DONE && pInstance->GetData(TYPE_RETHILGORE) == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_shadowfang_prisoner(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_shadowfang_prisonerAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(); + } + return true; +} + +/*###### +## mob_arugal_voidwalker +######*/ + +struct Waypoint +{ + float fX, fY, fZ; +}; + +//Cordinates for voidwalker spawns +static const Waypoint VWWaypoints[]= +{ + //fX fY fZ + {-146.06f, 2172.84f, 127.953f}, //this is the initial location, in the middle of the room + {-159.547f, 2178.11f, 128.944f}, //when they come back up, they hit this point then walk back down + {-171.113f, 2182.69f, 129.255f}, + {-177.613f, 2175.59f, 128.161f}, + {-185.396f, 2178.35f, 126.413f}, + {-184.004f, 2188.31f, 124.122f}, + {-172.781f, 2188.71f, 121.611f}, + {-173.245f, 2176.93f, 119.085f}, + {-183.145f, 2176.04f, 116.995f}, + {-185.551f, 2185.77f, 114.784f}, + {-177.502f, 2190.75f, 112.681f}, + {-171.218f, 2182.61f, 110.314f}, + {-173.857f, 2175.1f, 109.255f} +}; + +enum +{ + LAST_WAYPOINT = 12, + + NPC_VOIDWALKER = 4627, + + SPELL_DARK_OFFERING = 7154 +}; + +struct MANGOS_DLL_DECL mob_arugal_voidwalkerAI : public ScriptedAI +{ + mob_arugal_voidwalkerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsLeader = false; + m_uiLeaderGUID = 0; + m_uiCurrentPoint = 0; + m_bReverse = false; + } + + uint32 m_uiResetTimer, m_uiDarkOffering; + uint8 m_uiCurrentPoint, m_uiPosition; //0 - leader, 1 - behind-right, 2 - behind, 3 - behind-left + uint64 m_uiLeaderGUID; + ScriptedInstance* m_pInstance; + bool m_bIsLeader, m_bReverse, m_bWPDone; + + void Reset() + { + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_uiDarkOffering = urand(4400,12500); + m_bWPDone = true; + + Creature* pLeader = m_creature->GetMap()->GetCreature(m_uiLeaderGUID); + if (pLeader && pLeader->isAlive()) + { + m_creature->GetMotionMaster()->MoveFollow(pLeader, 1.0f, M_PI/2*m_uiPosition); + } + else + { + std::list lVoidwalkerList; + Creature* pNewLeader = NULL; + uint8 uiHighestPosition = 0; + GetCreatureListWithEntryInGrid(lVoidwalkerList, m_creature, NPC_VOIDWALKER, 50.0f); + for(std::list::iterator itr = lVoidwalkerList.begin(); itr != lVoidwalkerList.end(); ++itr) + { + if ((*itr)->isAlive()) + { + if (mob_arugal_voidwalkerAI* pVoidwalkerAI = dynamic_cast((*itr)->AI())) + { + uint8 uiPosition = pVoidwalkerAI->GetPosition(); + if (uiPosition > uiHighestPosition) + { + pNewLeader = (*itr); + uiHighestPosition = uiPosition; + } + } + } + } + + if (pNewLeader) + { + m_uiLeaderGUID = pNewLeader->GetGUID(); + if (pNewLeader == m_creature) + { + m_bIsLeader = true; + m_bWPDone = true; + } + else + m_creature->GetMotionMaster()->MoveFollow(pNewLeader, 1.0f, M_PI/2*m_uiPosition); + } + else + { + pNewLeader = m_creature; + m_bIsLeader = true; + m_bWPDone = true; + } + } + } + + //this is the ACID script converted into C++ + //unfortunately, we can't have both AIs at the same time :( + void UpdateAI(const uint32 uiDiff) + { + if (m_bIsLeader && m_bWPDone) + { + m_creature->GetMotionMaster()->MovePoint(m_uiCurrentPoint, VWWaypoints[m_uiCurrentPoint].fX, + VWWaypoints[m_uiCurrentPoint].fY, VWWaypoints[m_uiCurrentPoint].fZ); + m_bWPDone = false; + } + + if (!m_creature->isInCombat()) + return; + + if (m_uiDarkOffering < uiDiff) + { + m_uiDarkOffering = urand(4400,12500); + + if (Unit* pUnit = DoSelectLowestHpFriendly(10.0f, 290)) + DoCastSpellIfCan(pUnit, SPELL_DARK_OFFERING); + } + else + m_uiDarkOffering -= uiDiff; + + //Check if we have a current target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void MovementInform(uint32 uiMoveType, uint32 uiPointId) + { + if (uiMoveType != POINT_MOTION_TYPE || !m_bIsLeader) + return; + + switch(uiPointId) + { + case 1: + if (m_bReverse) + m_bReverse = false; + break; + case LAST_WAYPOINT: + if (!m_bReverse) + m_bReverse = true; + break; + } + + if (m_bReverse) + --m_uiCurrentPoint; + else + ++m_uiCurrentPoint; + + m_bWPDone = true; + + SendWaypoint(); + } + + void JustDied(Unit* /*pKiller*/) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_VOIDWALKER,DONE); + } + + void SetPosition(uint8 uiPosition, Creature* pLeader) + { + m_uiPosition = uiPosition; + + if (!uiPosition) + m_bIsLeader = true; + else + pLeader ? m_uiLeaderGUID = pLeader->GetGUID() : m_uiLeaderGUID = 0; + + Reset(); + } + + uint8 GetPosition() + { + return m_uiPosition; + } + + void SendWaypoint() + { + std::list lVoidwalkerList; + GetCreatureListWithEntryInGrid(lVoidwalkerList, m_creature, NPC_VOIDWALKER, 50.0f); + for(std::list::iterator itr = lVoidwalkerList.begin(); itr != lVoidwalkerList.end(); ++itr) + { + if ((*itr)->isAlive()) + if (mob_arugal_voidwalkerAI* pVoidwalkerAI = dynamic_cast((*itr)->AI())) + pVoidwalkerAI->ReceiveWaypoint(m_uiCurrentPoint, m_bReverse); + } + } + + void ReceiveWaypoint(uint32 uiNewPoint, bool bReverse) + { + m_uiCurrentPoint = uiNewPoint; + m_bReverse = bReverse; + } + + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreatureAddon(); + + m_creature->SetLootRecipient(NULL); + + Reset(); + } +}; + +CreatureAI* GetAI_mob_arugal_voidwalker(Creature* pCreature) +{ + return new mob_arugal_voidwalkerAI(pCreature); +} + +/*###### +## boss_arugal +######*/ + +enum +{ + SPELL_VOID_BOLT = 7588, + SPELL_SHADOW_PORT_UPPER_LEDGE = 7587, + SPELL_SHADOW_PORT_SPAWN_LEDGE = 7586, + SPELL_SHADOW_PORT_STAIRS = 7136, + SPELL_ARUGALS_CURSE = 7621, + SPELL_THUNDERSHOCK = 7803, + + YELL_AGGRO = -1033017, + YELL_KILLED_PLAYER = -1033018, + YELL_COMBAT = -1033019, + YELL_FENRUS = -1033013 +}; + +enum ArugalPosition +{ + POSITION_SPAWN_LEDGE = 1, + POSITION_UPPER_LEDGE, + POSITION_STAIRS +}; + +struct SpawnPoint +{ + float fX, fY, fZ, fO; +}; + +//Cordinates for voidwalker spawns +static const SpawnPoint VWSpawns[]= +{ + //fX fY fZ fO + {-155.352f, 2172.780f, 128.448f, 4.679f}, + {-147.059f, 2163.193f, 128.696f, 0.128f}, + {-148.869f, 2180.859f, 128.448f, 1.814f}, + {-140.203f, 2175.263f, 128.448f, 0.373f}, +}; + +//roughly the height of Fenrus' room, +//used to tell how he should behave +const float HEIGHT_FENRUS_ROOM = 140.0f; + +struct MANGOS_DLL_DECL boss_arugalAI : public ScriptedAI +{ + boss_arugalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + if (pCreature->GetPositionZ() < HEIGHT_FENRUS_ROOM) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + m_bEventMode = true; + } + else + m_bEventMode = false; + + Reset(); + } + + ScriptedInstance* m_pInstance; + ArugalPosition m_posPosition; + uint32 m_uiTeleportTimer, m_uiCurseTimer, m_uiVoidboltTimer, m_uiThundershockTimer, m_uiYellTimer, m_uiSpeechTimer; + uint8 m_uiSpeechStep; + bool m_bAttacking, m_bEventMode; + + void Reset() + { + m_uiTeleportTimer = urand(22000, 26000); + m_uiCurseTimer = urand(20000, 30000); + m_uiVoidboltTimer = m_uiThundershockTimer = m_uiSpeechTimer = 0; + m_uiYellTimer = urand(32000, 46000); + m_bAttacking = true; + m_posPosition = POSITION_SPAWN_LEDGE; + m_uiSpeechStep = 1; + } + + void Aggro(Unit* pWho) + { + DoScriptText(YELL_AGGRO, m_creature); + DoCastSpellIfCan(pWho, SPELL_VOID_BOLT); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() == TYPEID_PLAYER) + DoScriptText(YELL_KILLED_PLAYER, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bEventMode) + { + if (!m_uiSpeechStep) + return; + + if (m_uiSpeechTimer < uiDiff) + { + switch(m_uiSpeechStep) + { + case 1: + DoScriptText(YELL_FENRUS, m_creature); + m_creature->SetVisibility(VISIBILITY_ON); + m_uiSpeechTimer = 2000; + break; + case 2: + DoCastSpellIfCan(m_creature, SPELL_FIRE); + m_uiSpeechTimer = 5000; + break; + case 3: + if (m_pInstance) + if (GameObject* pLightning = m_creature->GetMap()->GetGameObject(m_pInstance->GetData64(DATA_LIGHTNING))) + pLightning->Use(m_creature); + + m_uiSpeechTimer = 5000; + break; + case 4: + m_creature->SetVisibility(VISIBILITY_OFF); + m_uiSpeechTimer = 500; + break; + case 5: + Creature *pVoidwalker, *pLeader; + pVoidwalker = pLeader = NULL; + + for(uint8 i = 0; i < 4; i++) + { + pVoidwalker = m_creature->SummonCreature(NPC_VOIDWALKER,VWSpawns[i].fX, + VWSpawns[i].fY, VWSpawns[i].fZ, VWSpawns[i].fO, TEMPSUMMON_DEAD_DESPAWN, 1); + + if (!pVoidwalker) + continue; + + if (!i) + pLeader = pVoidwalker; + + if (mob_arugal_voidwalkerAI* pVoidwalkerAI = dynamic_cast(pVoidwalker->AI())) + pVoidwalkerAI->SetPosition(i,pLeader); + + pVoidwalker = NULL; + } + m_uiSpeechStep = 0; + return; + default: + m_uiSpeechStep = 0; + return; + } + ++m_uiSpeechStep; + } + else + m_uiSpeechTimer -= uiDiff; + + return; + } + + //Check if we have a current target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (GetManaPercent() < 6.0f && !m_bAttacking) + { + if (m_posPosition != POSITION_UPPER_LEDGE) + StartAttacking(); + else if (m_uiTeleportTimer > 2000) + m_uiTeleportTimer = 2000; + + m_bAttacking = true; + } + else if (GetManaPercent() > 12.0f && m_bAttacking) + { + StopAttacking(); + m_bAttacking = false; + } + + if (m_uiYellTimer < uiDiff) + { + DoScriptText(YELL_COMBAT, m_creature); + m_uiYellTimer = urand(34000, 68000); + } + else + m_uiYellTimer -= uiDiff; + + if (m_uiCurseTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(pTarget, SPELL_ARUGALS_CURSE); + + m_uiCurseTimer = urand(20000, 35000); + } + else + m_uiCurseTimer -= uiDiff; + + if (m_uiThundershockTimer < uiDiff) + { + if (GetVictimDistance() < 5.0f) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THUNDERSHOCK); + m_uiThundershockTimer = urand(30200, 38500); + } + } + else + m_uiThundershockTimer -= uiDiff; + + if (m_uiVoidboltTimer < uiDiff) + { + if (!m_bAttacking) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_VOID_BOLT); + m_uiVoidboltTimer = urand(2900, 4800); + } + } + else + m_uiVoidboltTimer -= uiDiff; + + if (m_uiTeleportTimer < uiDiff) + { + ArugalPosition posNewPosition; + + if (m_posPosition == POSITION_SPAWN_LEDGE) + posNewPosition = (ArugalPosition)urand(2, 3); + else + { + posNewPosition = (ArugalPosition)urand(1, 2); + + if (m_posPosition == posNewPosition) + posNewPosition = POSITION_STAIRS; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + switch(posNewPosition) + { + case POSITION_SPAWN_LEDGE: + DoCastSpellIfCan(m_creature, SPELL_SHADOW_PORT_SPAWN_LEDGE, true); + break; + case POSITION_UPPER_LEDGE: + DoCastSpellIfCan(m_creature, SPELL_SHADOW_PORT_UPPER_LEDGE, true); + break; + case POSITION_STAIRS: + DoCastSpellIfCan(m_creature, SPELL_SHADOW_PORT_STAIRS, true); + break; + } + + if (GetManaPercent() < 6.0f) + { + if (posNewPosition == POSITION_UPPER_LEDGE) + { + StopAttacking(); + m_uiTeleportTimer = urand(2000, 2200); + } + else + { + StartAttacking(); + m_uiTeleportTimer = urand(48000, 55000); + } + } + else + m_uiTeleportTimer = urand(48000, 55000); + + m_posPosition = posNewPosition; + } + else + m_uiTeleportTimer -= uiDiff; + + if (m_bAttacking) + DoMeleeAttackIfReady(); + } + + void AttackStart(Unit* pWho) + { + if (!m_bEventMode) + ScriptedAI::AttackStart(pWho); + } + + //make the code nice and pleasing to the eye + inline float GetManaPercent() + { + return (((float)m_creature->GetPower(POWER_MANA) / (float)m_creature->GetMaxPower(POWER_MANA)) * 100); + } + + inline float GetVictimDistance() + { + return (m_creature->getVictim() ? m_creature->GetDistance2d(m_creature->getVictim()) : 999.9f); + } + + void StopAttacking() + { + if (Unit* victim = m_creature->getVictim()) + m_creature->SendMeleeAttackStop(victim); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + } + } + + void StartAttacking() + { + if (Unit* victim = m_creature->getVictim()) + m_creature->SendMeleeAttackStart(victim); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 0.0f, 0.0f); + } + } +}; + +CreatureAI* GetAI_boss_arugal(Creature* pCreature) +{ + return new boss_arugalAI(pCreature); +} + +/*###### +## npc_arugal +######*/ + +enum +{ + SAY_INTRO_1 = -1033009, + SAY_INTRO_2 = -1033010, + SAY_INTRO_3 = -1033011, + SAY_INTRO_4 = -1033012, + + SPELL_SPAWN = 7741, + + NPC_VINCENT = 4444 +}; + +struct MANGOS_DLL_DECL npc_arugalAI : public ScriptedAI +{ + npc_arugalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + uint32 m_uiSpeechTimer; + uint8 m_uiSpeechStep; + ScriptedInstance* m_pInstance; + + void Reset() + { + m_uiSpeechTimer = 0; + m_uiSpeechStep = 0; + + m_creature->SetVisibility(VISIBILITY_OFF); + + if (m_pInstance && m_pInstance->GetData(TYPE_INTRO) == NOT_STARTED) + m_uiSpeechStep = 1; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_uiSpeechStep) + return; + + if (m_uiSpeechTimer < uiDiff) + { + switch(m_uiSpeechStep) + { + case 1: + m_creature->SetVisibility(VISIBILITY_ON); + m_uiSpeechTimer = 500; + break; + case 2: + DoCastSpellIfCan(m_creature, SPELL_SPAWN); + m_uiSpeechTimer = 2000; + break; + case 3: + //make him die + if (Creature* pVincent = GetClosestCreatureWithEntry(m_creature,NPC_VINCENT,20.0f)) + pVincent->SetStandState(UNIT_STAND_STATE_DEAD); + + m_uiSpeechTimer = 10000; + break; + case 4: + DoScriptText(SAY_INTRO_1, m_creature); + //m_creature->HandleEmote(EMOTE_ONESHOT_TALK); + m_uiSpeechTimer = 1750; + break; + case 5: + m_creature->HandleEmote(EMOTE_ONESHOT_POINT); + m_uiSpeechTimer = 1750; + break; + case 6: + DoScriptText(SAY_INTRO_2, m_creature); + m_uiSpeechTimer = 1750; + break; + case 7: + m_creature->HandleEmote(EMOTE_ONESHOT_EXCLAMATION); + m_uiSpeechTimer = 1750; + break; + case 8: + //m_creature->HandleEmote(EMOTE_ONESHOT_TALK); + DoScriptText(SAY_INTRO_3, m_creature); + m_uiSpeechTimer = 1750; + break; + case 9: + m_creature->HandleEmote(EMOTE_ONESHOT_LAUGH); + m_uiSpeechTimer = 1750; + break; + case 10: + DoScriptText(SAY_INTRO_4, m_creature); + m_uiSpeechTimer = 2000; + break; + case 11: + DoCastSpellIfCan(m_creature, SPELL_SPAWN); + m_uiSpeechTimer = 500; + break; + case 12: + if (m_pInstance) + m_pInstance->SetData(TYPE_INTRO,DONE); + + m_creature->SetVisibility(VISIBILITY_OFF); + m_uiSpeechStep = 0; + return; + default: + m_uiSpeechStep = 0; + return; + } + ++m_uiSpeechStep; + } + else + m_uiSpeechTimer -= uiDiff; + } + + void AttackStart(Unit* /*who*/) { } +}; + +CreatureAI* GetAI_npc_arugal(Creature* pCreature) +{ + return new npc_arugalAI(pCreature); +} + +/*###### +## npc_deathstalker_vincent +######*/ + +enum +{ + SAY_VINCENT_DIE = -1033016, + + FACTION_FRIENDLY = 35 +}; + +struct MANGOS_DLL_DECL npc_deathstalker_vincentAI : public ScriptedAI +{ + npc_deathstalker_vincentAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + if (m_pInstance && m_pInstance->GetData(TYPE_INTRO) == DONE && !m_creature->GetByteValue(UNIT_FIELD_BYTES_1, 0)) + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if (pDoneBy) + { + m_creature->SetInCombatWith(pDoneBy); + pDoneBy->SetInCombatWith(m_creature); + } + + if (m_creature->getStandState()) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (uiDamage >= m_creature->GetHealth()) + { + m_creature->GetHealth() > 1 ? uiDamage = m_creature->GetHealth() - 1 : uiDamage = 0; + m_creature->setFaction(FACTION_FRIENDLY); + EnterEvadeMode(); + DoScriptText(SAY_VINCENT_DIE, m_creature); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_creature->isInCombat() && m_creature->getFaction() == FACTION_FRIENDLY) + EnterEvadeMode(); + + ScriptedAI::UpdateAI(uiDiff); + } + + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreatureAddon(); + + m_creature->SetLootRecipient(NULL); + + Reset(); + } +}; + +CreatureAI* GetAI_npc_deathstalker_vincent(Creature* pCreature) +{ + return new npc_deathstalker_vincentAI(pCreature); +} + +void AddSC_shadowfang_keep() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_shadowfang_prisoner"; + newscript->pGossipHello = &GossipHello_npc_shadowfang_prisoner; + newscript->pGossipSelect = &GossipSelect_npc_shadowfang_prisoner; + newscript->GetAI = &GetAI_npc_shadowfang_prisoner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_arugal_voidwalker"; + newscript->GetAI = &GetAI_mob_arugal_voidwalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_arugal"; + newscript->GetAI = &GetAI_npc_arugal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_arugal"; + newscript->GetAI = &GetAI_boss_arugal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_deathstalker_vincent"; + newscript->GetAI = &GetAI_npc_deathstalker_vincent; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.h b/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.h new file mode 100644 index 0000000..3cfe4e8 --- /dev/null +++ b/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.h @@ -0,0 +1,19 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOWFANG_H +#define DEF_SHADOWFANG_H + +enum +{ + TYPE_FREE_NPC = 1, + TYPE_RETHILGORE = 2, + TYPE_FENRUS = 3, + TYPE_NANDOS = 4, + TYPE_INTRO = 5, + TYPE_VOIDWALKER = 6, + DATA_LIGHTNING = 7 +}; + +#endif diff --git a/scripts/eastern_kingdoms/silvermoon_city.cpp b/scripts/eastern_kingdoms/silvermoon_city.cpp new file mode 100644 index 0000000..d62c924 --- /dev/null +++ b/scripts/eastern_kingdoms/silvermoon_city.cpp @@ -0,0 +1,96 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Silvermoon_City +SD%Complete: 100 +SDComment: Quest support: 9685 +SDCategory: Silvermoon City +EndScriptData */ + +/* ContentData +npc_blood_knight_stillblade +EndContentData */ + +#include "precompiled.h" + +/*####### +# npc_blood_knight_stillblade +#######*/ + +#define SAY_HEAL -1000193 + +#define QUEST_REDEEMING_THE_DEAD 9685 +#define SPELL_SHIMMERING_VESSEL 31225 +#define SPELL_REVIVE_SELF 32343 + +struct MANGOS_DLL_DECL npc_blood_knight_stillbladeAI : public ScriptedAI +{ + npc_blood_knight_stillbladeAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 lifeTimer; + bool spellHit; + + void Reset() + { + lifeTimer = 120000; + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + spellHit = false; + } + + void MoveInLineOfSight(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (m_creature->IsStandState()) + { + if (lifeTimer < diff) + m_creature->AI()->EnterEvadeMode(); + else + lifeTimer -= diff; + } + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if ((Spellkind->Id == SPELL_SHIMMERING_VESSEL) && !spellHit && + (Hitter->GetTypeId() == TYPEID_PLAYER) && (((Player*)Hitter)->IsActiveQuest(QUEST_REDEEMING_THE_DEAD))) + { + ((Player*)Hitter)->AreaExploredOrEventHappens(QUEST_REDEEMING_THE_DEAD); + DoCastSpellIfCan(m_creature,SPELL_REVIVE_SELF); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0); + //m_creature->RemoveAllAuras(); + DoScriptText(SAY_HEAL, m_creature, Hitter); + spellHit = true; + } + } +}; + +CreatureAI* GetAI_npc_blood_knight_stillblade(Creature* pCreature) +{ + return new npc_blood_knight_stillbladeAI(pCreature); +} + +void AddSC_silvermoon_city() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "npc_blood_knight_stillblade"; + newscript->GetAI = &GetAI_npc_blood_knight_stillblade; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/silverpine_forest.cpp b/scripts/eastern_kingdoms/silverpine_forest.cpp new file mode 100644 index 0000000..0932281 --- /dev/null +++ b/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -0,0 +1,415 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Silverpine_Forest +SD%Complete: 100 +SDComment: Quest support: 435, 452, 1886 +SDCategory: Silverpine Forest +EndScriptData */ + +/* ContentData +npc_astor_hadren +npc_deathstalker_erland +npc_deathstalker_faerleia +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_astor_hadren +######*/ + +struct MANGOS_DLL_DECL npc_astor_hadrenAI : public ScriptedAI +{ + npc_astor_hadrenAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_creature->setFaction(68); + } + + void JustDied(Unit *who) + { + m_creature->setFaction(68); + } +}; + +CreatureAI* GetAI_npc_astor_hadren(Creature *_creature) +{ + return new npc_astor_hadrenAI(_creature); +} + +bool GossipHello_npc_astor_hadren(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(1886) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You're Astor Hadren, right?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(623, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_astor_hadren(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You've got something I need, Astor. And I'll be taking it now.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(624, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(21); + pCreature->AI()->AttackStart(pPlayer); + break; + } + return true; +} + +/*##### +## npc_deathstalker_erland +#####*/ + +enum +{ + SAY_START_1 = -1000306, + SAY_START_2 = -1000307, + SAY_AGGRO_1 = -1000308, + SAY_AGGRO_2 = -1000309, + SAY_AGGRO_3 = -1000310, + SAY_PROGRESS = -1000311, + SAY_END = -1000312, + SAY_RANE = -1000313, + SAY_RANE_REPLY = -1000314, + SAY_CHECK_NEXT = -1000315, + SAY_QUINN = -1000316, + SAY_QUINN_REPLY = -1000317, + SAY_BYE = -1000318, + + QUEST_ERLAND = 435, + NPC_RANE = 1950, + NPC_QUINN = 1951 +}; + +struct MANGOS_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI +{ + npc_deathstalker_erlandAI(Creature* pCreature) : npc_escortAI(pCreature) + { + uiRaneGUID = 0; + uiQuinnGUID = 0; + Reset(); + } + + uint64 uiRaneGUID; + uint64 uiQuinnGUID; + + void MoveInLineOfSight(Unit* pUnit) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (!uiRaneGUID && pUnit->GetEntry() == NPC_RANE) + { + if (m_creature->IsWithinDistInMap(pUnit, 30.0f)) + uiRaneGUID = pUnit->GetGUID(); + } + if (!uiQuinnGUID && pUnit->GetEntry() == NPC_QUINN) + { + if (m_creature->IsWithinDistInMap(pUnit, 30.0f)) + uiQuinnGUID = pUnit->GetGUID(); + } + } + + npc_escortAI::MoveInLineOfSight(pUnit); + } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + DoScriptText(SAY_START_2, m_creature, pPlayer); + break; + case 13: + DoScriptText(SAY_END, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_ERLAND, m_creature); + break; + case 14: + if (Creature* pRane = m_creature->GetMap()->GetCreature(uiRaneGUID)) + DoScriptText(SAY_RANE, pRane, m_creature); + break; + case 15: + DoScriptText(SAY_RANE_REPLY, m_creature); + break; + case 16: + DoScriptText(SAY_CHECK_NEXT, m_creature); + break; + case 24: + DoScriptText(SAY_QUINN, m_creature); + break; + case 25: + if (Creature* pQuinn = m_creature->GetMap()->GetCreature(uiQuinnGUID)) + DoScriptText(SAY_QUINN_REPLY, pQuinn, m_creature); + break; + case 26: + DoScriptText(SAY_BYE, m_creature); + break; + } + } + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + uiRaneGUID = 0; + uiQuinnGUID = 0; + } + } + + void Aggro(Unit* who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature, who); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature, who); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature, who); break; + } + } +}; + +bool QuestAccept_npc_deathstalker_erland(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ERLAND) + { + DoScriptText(SAY_START_1, pCreature); + + if (npc_deathstalker_erlandAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_deathstalker_erland(Creature* pCreature) +{ + return new npc_deathstalker_erlandAI(pCreature); +} + +/*##### +## npc_deathstalker_faerleia +#####*/ + +enum +{ + QUEST_PYREWOOD_AMBUSH = 452, + + // cast it after every wave + SPELL_DRINK_POTION = 3359, + + SAY_START = -1000553, + SAY_COMPLETED = -1000554, + + // 1st wave + NPC_COUNCILMAN_SMITHERS = 2060, + // 2nd wave + NPC_COUNCILMAN_THATHER = 2061, + NPC_COUNCILMAN_HENDRICKS = 2062, + // 3rd wave + NPC_COUNCILMAN_WILHELM = 2063, + NPC_COUNCILMAN_HARTIN = 2064, + NPC_COUNCILMAN_HIGARTH = 2066, + // final wave + NPC_COUNCILMAN_COOPER = 2065, + NPC_COUNCILMAN_BRUNSWICK = 2067, + NPC_LORD_MAYOR_MORRISON = 2068 +}; + +struct SpawnPoint +{ + float fX; + float fY; + float fZ; + float fO; +}; + +SpawnPoint SpawnPoints[] = +{ + {-397.45f, 1509.56f, 18.87f, 4.73f}, + {-398.35f, 1510.75f, 18.87f, 4.76f}, + {-396.41f, 1511.06f, 18.87f, 4.74f} +}; + +static float m_afMoveCoords[] = {-410.69f, 1498.04f, 19.77f}; + +struct MANGOS_DLL_DECL npc_deathstalker_faerleiaAI : public ScriptedAI +{ + npc_deathstalker_faerleiaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + } + + uint64 m_uiPlayerGUID; + uint32 m_uiWaveTimer; + uint32 m_uiSummonCount; + uint8 m_uiWaveCount; + bool m_bEventStarted; + + void StartEvent(uint64 uiPlayerGUID) + { + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + + m_uiPlayerGUID = uiPlayerGUID; + m_bEventStarted = true; + m_uiWaveTimer = 10000; + m_uiSummonCount = 0; + m_uiWaveCount = 0; + } + + void FinishEvent() + { + m_uiPlayerGUID = 0; + m_bEventStarted = false; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + } + + void JustDied(Unit* pKiller) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + pPlayer->SendQuestFailed(QUEST_PYREWOOD_AMBUSH); + + FinishEvent(); + } + + void JustSummoned(Creature* pSummoned) + { + ++m_uiSummonCount; + + // put them on correct waypoints later on + float fX, fY, fZ; + pSummoned->GetRandomPoint(m_afMoveCoords[0], m_afMoveCoords[1], m_afMoveCoords[2], 10.0f, fX, fY, fZ); + pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ); + } + + void SummonedCreatureJustDied(Creature* pKilled) + { + --m_uiSummonCount; + + if (!m_uiSummonCount) + { + DoCastSpellIfCan(m_creature, SPELL_DRINK_POTION); + + // final wave + if (m_uiWaveCount == 4) + { + DoScriptText(SAY_COMPLETED, m_creature); + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + pPlayer->GroupEventHappens(QUEST_PYREWOOD_AMBUSH, m_creature); + + FinishEvent(); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bEventStarted && !m_uiSummonCount) + { + if (m_uiWaveTimer < uiDiff) + { + switch(m_uiWaveCount) + { + case 0: + m_creature->SummonCreature(NPC_COUNCILMAN_SMITHERS, SpawnPoints[1].fX, SpawnPoints[1].fY, SpawnPoints[1].fZ, SpawnPoints[1].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_uiWaveTimer = 10000; + break; + case 1: + m_creature->SummonCreature(NPC_COUNCILMAN_THATHER, SpawnPoints[2].fX, SpawnPoints[2].fY, SpawnPoints[2].fZ, SpawnPoints[2].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_creature->SummonCreature(NPC_COUNCILMAN_HENDRICKS, SpawnPoints[1].fX, SpawnPoints[1].fY, SpawnPoints[1].fZ, SpawnPoints[1].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_uiWaveTimer = 10000; + break; + case 2: + m_creature->SummonCreature(NPC_COUNCILMAN_WILHELM, SpawnPoints[1].fX, SpawnPoints[1].fY, SpawnPoints[1].fZ, SpawnPoints[1].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_creature->SummonCreature(NPC_COUNCILMAN_HARTIN, SpawnPoints[0].fX, SpawnPoints[0].fY, SpawnPoints[0].fZ, SpawnPoints[0].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_creature->SummonCreature(NPC_COUNCILMAN_HIGARTH, SpawnPoints[2].fX, SpawnPoints[2].fY, SpawnPoints[2].fZ, SpawnPoints[2].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_uiWaveTimer = 8000; + break; + case 3: + m_creature->SummonCreature(NPC_COUNCILMAN_COOPER, SpawnPoints[1].fX, SpawnPoints[1].fY, SpawnPoints[1].fZ, SpawnPoints[1].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_creature->SummonCreature(NPC_COUNCILMAN_BRUNSWICK, SpawnPoints[2].fX, SpawnPoints[2].fY, SpawnPoints[2].fZ, SpawnPoints[2].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + m_creature->SummonCreature(NPC_LORD_MAYOR_MORRISON, SpawnPoints[0].fX, SpawnPoints[0].fY, SpawnPoints[0].fZ, SpawnPoints[0].fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000); + break; + } + + ++m_uiWaveCount; + } + else + m_uiWaveTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_deathstalker_faerleia(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_PYREWOOD_AMBUSH) + { + DoScriptText(SAY_START, pCreature, pPlayer); + + if (npc_deathstalker_faerleiaAI* pFaerleiaAI = dynamic_cast(pCreature->AI())) + pFaerleiaAI->StartEvent(pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_deathstalker_faerleia(Creature* pCreature) +{ + return new npc_deathstalker_faerleiaAI(pCreature); +} + +void AddSC_silverpine_forest() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_astor_hadren"; + newscript->pGossipHello = &GossipHello_npc_astor_hadren; + newscript->pGossipSelect = &GossipSelect_npc_astor_hadren; + newscript->GetAI = &GetAI_npc_astor_hadren; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_deathstalker_erland"; + newscript->GetAI = &GetAI_npc_deathstalker_erland; + newscript->pQuestAccept = &QuestAccept_npc_deathstalker_erland; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_deathstalker_faerleia"; + newscript->GetAI = &GetAI_npc_deathstalker_faerleia; + newscript->pQuestAccept = &QuestAccept_npc_deathstalker_faerleia; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stormwind_city.cpp b/scripts/eastern_kingdoms/stormwind_city.cpp new file mode 100644 index 0000000..282ba18 --- /dev/null +++ b/scripts/eastern_kingdoms/stormwind_city.cpp @@ -0,0 +1,268 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Stormwind_City +SD%Complete: 100 +SDComment: Quest support: 1640, 1447, 4185, 11223 (DB support required for spell 42711) +SDCategory: Stormwind City +EndScriptData */ + +/* ContentData +npc_archmage_malin +npc_bartleby +npc_dashel_stonefist +npc_lady_katrana_prestor +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_archmage_malin +######*/ + +#define GOSSIP_ITEM_MALIN "Can you send me to Theramore? I have an urgent message for Lady Jaina from Highlord Bolvar." + +bool GossipHello_npc_archmage_malin(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(11223) == QUEST_STATUS_COMPLETE && !pPlayer->GetQuestRewardStatus(11223)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MALIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_archmage_malin(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 42711, true); + } + + return true; +} + +/*###### +## npc_bartleby +######*/ + +enum +{ + FACTION_ENEMY = 168, + QUEST_BEAT = 1640 +}; + +struct MANGOS_DLL_DECL npc_bartlebyAI : public ScriptedAI +{ + npc_bartlebyAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormalFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormalFaction; + + void Reset() + { + if (m_creature->getFaction() != m_uiNormalFaction) + m_creature->setFaction(m_uiNormalFaction); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + { + uiDamage = 0; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + ((Player*)pDoneBy)->AreaExploredOrEventHappens(QUEST_BEAT); + + EnterEvadeMode(); + } + } +}; + +bool QuestAccept_npc_bartleby(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_BEAT) + { + pCreature->setFaction(FACTION_ENEMY); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +CreatureAI* GetAI_npc_bartleby(Creature* pCreature) +{ + return new npc_bartlebyAI(pCreature); +} + +/*###### +## npc_dashel_stonefist +######*/ + +enum +{ + QUEST_MISSING_DIPLO_PT8 = 1447, + FACTION_HOSTILE = 168 +}; + +struct MANGOS_DLL_DECL npc_dashel_stonefistAI : public ScriptedAI +{ + npc_dashel_stonefistAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormalFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormalFaction; + + void Reset() + { + if (m_creature->getFaction() != m_uiNormalFaction) + m_creature->setFaction(m_uiNormalFaction); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + { + uiDamage = 0; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + ((Player*)pDoneBy)->AreaExploredOrEventHappens(QUEST_MISSING_DIPLO_PT8); + + EnterEvadeMode(); + } + } +}; + +bool QuestAccept_npc_dashel_stonefist(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT8) + { + pCreature->setFaction(FACTION_HOSTILE); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +CreatureAI* GetAI_npc_dashel_stonefist(Creature* pCreature) +{ + return new npc_dashel_stonefistAI(pCreature); +} + +/*###### +## npc_lady_katrana_prestor +######*/ + +#define GOSSIP_ITEM_KAT_1 "Pardon the intrusion, Lady Prestor, but Highlord Bolvar suggested that I seek your advice." +#define GOSSIP_ITEM_KAT_2 "My apologies, Lady Prestor." +#define GOSSIP_ITEM_KAT_3 "Begging your pardon, Lady Prestor. That was not my intent." +#define GOSSIP_ITEM_KAT_4 "Thank you for your time, Lady Prestor." + +bool GossipHello_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(4185) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(2693, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lady_katrana_prestor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(2694, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(2695, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KAT_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(2696, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(4185); + break; + } + return true; +} + +void AddSC_stormwind_city() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_archmage_malin"; + newscript->pGossipHello = &GossipHello_npc_archmage_malin; + newscript->pGossipSelect = &GossipSelect_npc_archmage_malin; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_bartleby"; + newscript->GetAI = &GetAI_npc_bartleby; + newscript->pQuestAccept = &QuestAccept_npc_bartleby; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dashel_stonefist"; + newscript->GetAI = &GetAI_npc_dashel_stonefist; + newscript->pQuestAccept = &QuestAccept_npc_dashel_stonefist; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lady_katrana_prestor"; + newscript->pGossipHello = &GossipHello_npc_lady_katrana_prestor; + newscript->pGossipSelect = &GossipSelect_npc_lady_katrana_prestor; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stranglethorn_vale.cpp b/scripts/eastern_kingdoms/stranglethorn_vale.cpp new file mode 100644 index 0000000..0623f82 --- /dev/null +++ b/scripts/eastern_kingdoms/stranglethorn_vale.cpp @@ -0,0 +1,107 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Stranglethorn_Vale +SD%Complete: 100 +SDComment: Quest support: 592 +SDCategory: Stranglethorn Vale +EndScriptData */ + +/* ContentData +mob_yenniku +EndContentData */ + +#include "precompiled.h" + +/*###### +## mob_yenniku +######*/ + +struct MANGOS_DLL_DECL mob_yennikuAI : public ScriptedAI +{ + mob_yennikuAI(Creature *c) : ScriptedAI(c) + { + bReset = false; + Reset(); + } + + uint32 Reset_Timer; + bool bReset; + + void Reset() + { + Reset_Timer = 0; + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + //Yenniku's Release + if (!bReset && ((Player*)caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + m_creature->CombatStop(); //stop combat + m_creature->DeleteThreatList(); //unsure of this + m_creature->setFaction(83); //horde generic + + bReset = true; + Reset_Timer = 60000; + } + } + return; + } + + void Aggro(Unit *who) {} + + void UpdateAI(const uint32 diff) + { + if (bReset) + if (Reset_Timer < diff) + { + EnterEvadeMode(); + bReset = false; + m_creature->setFaction(28); //troll, bloodscalp + } + else Reset_Timer -= diff; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() ) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_yenniku(Creature *_Creature) +{ + return new mob_yennikuAI (_Creature); +} + +/*###### +## +######*/ + +void AddSC_stranglethorn_vale() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_yenniku"; + newscript->GetAI = &GetAI_mob_yenniku; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp b/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp new file mode 100644 index 0000000..357a423 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp @@ -0,0 +1,185 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Baron_Rivendare +SD%Complete: 70 +SDComment: aura applied/defined in database +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +#define SAY_0 "Intruders! More pawns of the Argent Dawn, no doubt. I already count one of their number among my prisoners. Withdraw from my domain before she is executed!" +#define SAY_1 "You're still here? Your foolishness is amusing! The Argent Dawn wench needn't suffer in vain. Leave at once and she shall be spared!" +#define SAY_2 "I shall take great pleasure in taking this poor wretch's life! It's not too late, she needn't suffer in vain. Turn back and her death shall be merciful!" +#define SAY_3 "May this prisoner's death serve as a warning. None shall defy the Scourge and live!" +#define SAY_4 "So you see fit to toy with the Lich King's creations? Ramstein, be sure to give the intruders a proper greeting." +#define SAY_5 "Time to take matters into my own hands. Come. Enter my domain and challenge the might of the Scourge!" + +#define ADD_1X 4017.403809f +#define ADD_1Y -3339.703369f +#define ADD_1Z 115.057655f +#define ADD_1O 5.487860f + +#define ADD_2X 4013.189209f +#define ADD_2Y -3351.808350f +#define ADD_2Z 115.052254f +#define ADD_2O 0.134280f + +#define ADD_3X 4017.738037f +#define ADD_3Y -3363.478016f +#define ADD_3Z 115.057274f +#define ADD_3O 0.723313f + +#define ADD_4X 4048.877197f +#define ADD_4Y -3363.223633f +#define ADD_4Z 115.054253f +#define ADD_4O 3.627735f + +#define ADD_5X 4051.777588f +#define ADD_5Y -3350.893311f +#define ADD_5Z 115.055351f +#define ADD_5O 3.066176f + +#define ADD_6X 4048.375977f +#define ADD_6Y -3339.966309f +#define ADD_6Z 115.055222f +#define ADD_6O 2.457497f + +#define SPELL_SHADOWBOLT 17393 +#define SPELL_CLEAVE 15284 +#define SPELL_MORTALSTRIKE 15708 + +#define SPELL_UNHOLY_AURA 17467 +#define SPELL_RAISEDEAD 17473 //triggers death pact (17471) + +#define SPELL_RAISE_DEAD1 17475 +#define SPELL_RAISE_DEAD2 17476 +#define SPELL_RAISE_DEAD3 17477 +#define SPELL_RAISE_DEAD4 17478 +#define SPELL_RAISE_DEAD5 17479 +#define SPELL_RAISE_DEAD6 17480 + +struct MANGOS_DLL_DECL boss_baron_rivendareAI : public ScriptedAI +{ + boss_baron_rivendareAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ShadowBolt_Timer; + uint32 Cleave_Timer; + uint32 MortalStrike_Timer; + //uint32 RaiseDead_Timer; + uint32 SummonSkeletons_Timer; + Creature *Summoned; + + void Reset() + { + ShadowBolt_Timer = 5000; + Cleave_Timer = 8000; + MortalStrike_Timer = 12000; + //RaiseDead_Timer = 30000; + SummonSkeletons_Timer = 34000; + } + + void Aggro(Unit *who) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BARON,IN_PROGRESS); + } + + void JustSummoned(Creature* summoned) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BARON,DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowBolt + if (ShadowBolt_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 10000; + }else ShadowBolt_Timer -= diff; + + //Cleave + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = urand(7000, 17000); + }else Cleave_Timer -= diff; + + //MortalStrike + if (MortalStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = urand(10000, 25000); + }else MortalStrike_Timer -= diff; + + //RaiseDead + //if (RaiseDead_Timer < diff) + //{ + // DoCastSpellIfCan(m_creature,SPELL_RAISEDEAD); + // RaiseDead_Timer = 45000; + //}else RaiseDead_Timer -= diff; + + //SummonSkeletons + if (SummonSkeletons_Timer < diff) + { + m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,29000); + + SummonSkeletons_Timer = 40000; + }else SummonSkeletons_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_baron_rivendare(Creature* pCreature) +{ + return new boss_baron_rivendareAI(pCreature); +} + +void AddSC_boss_baron_rivendare() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_baron_rivendare"; + newscript->GetAI = &GetAI_boss_baron_rivendare; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp b/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp new file mode 100644 index 0000000..c356636 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp @@ -0,0 +1,118 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Baroness_Anastari +SD%Complete: 90 +SDComment: MC disabled +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +#define SPELL_BANSHEEWAIL 16565 +#define SPELL_BANSHEECURSE 16867 +#define SPELL_SILENCE 18327 +//#define SPELL_POSSESS 17244 + +struct MANGOS_DLL_DECL boss_baroness_anastariAI : public ScriptedAI +{ + boss_baroness_anastariAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 BansheeWail_Timer; + uint32 BansheeCurse_Timer; + uint32 Silence_Timer; + //uint32 Possess_Timer; + + void Reset() + { + BansheeWail_Timer = 1000; + BansheeCurse_Timer = 11000; + Silence_Timer = 13000; + //Possess_Timer = 35000; + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BARONESS, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //BansheeWail + if (BansheeWail_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BANSHEEWAIL); + BansheeWail_Timer = 4000; + }else BansheeWail_Timer -= diff; + + //BansheeCurse + if (BansheeCurse_Timer < diff) + { + if (!urand(0, 3)) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BANSHEECURSE); + + BansheeCurse_Timer = 18000; + }else BansheeCurse_Timer -= diff; + + //Silence + if (Silence_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SILENCE); + Silence_Timer = 13000; + }else Silence_Timer -= diff; + + //Possess + /* if (Possess_Timer < diff) + { + //Cast + if (rand()%100 < 65) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target)DoCastSpellIfCan(target,SPELL_POSSESS); + } + Possess_Timer = 50000; + }else Possess_Timer -= diff; + */ + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_baroness_anastari(Creature* pCreature) +{ + return new boss_baroness_anastariAI(pCreature); +} + +void AddSC_boss_baroness_anastari() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_baroness_anastari"; + newscript->GetAI = &GetAI_boss_baroness_anastari; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp b/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp new file mode 100644 index 0000000..dce3542 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp @@ -0,0 +1,215 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_cannon_master_willey +SD%Complete: 100 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" + +//front, left +#define ADD_1X 3553.851807f +#define ADD_1Y -2945.885986f +#define ADD_1Z 125.001015f +#define ADD_1O 0.592007f +//front, right +#define ADD_2X 3559.206299f +#define ADD_2Y -2952.929932f +#define ADD_2Z 125.001015f +#define ADD_2O 0.592007f +//mid, left +#define ADD_3X 3552.417480f +#define ADD_3Y -2948.667236f +#define ADD_3Z 125.001015f +#define ADD_3O 0.592007f +//mid, right +#define ADD_4X 3555.651855f +#define ADD_4Y -2953.519043f +#define ADD_4Z 125.001015f +#define ADD_4O 0.592007f +//back, left +#define ADD_5X 3547.927246f +#define ADD_5Y -2950.977295f +#define ADD_5Z 125.001015f +#define ADD_5O 0.592007f +//back, mid +#define ADD_6X 3553.094697f +#define ADD_6Y -2952.123291f +#define ADD_6Z 125.001015f +#define ADD_6O 0.592007f +//back, right +#define ADD_7X 3552.727539f +#define ADD_7Y -2957.776123f +#define ADD_7Z 125.001015f +#define ADD_7O 0.592007f +//behind, left +#define ADD_8X 3547.156250f +#define ADD_8Y -2953.162354f +#define ADD_8Z 125.001015f +#define ADD_8O 0.592007f +//behind, right +#define ADD_9X 3550.202148f +#define ADD_9Y -2957.437744f +#define ADD_9Z 125.001015f +#define ADD_9O 0.592007f + +#define SPELL_KNOCKAWAY 10101 +#define SPELL_PUMMEL 15615 +#define SPELL_SHOOT 20463 +//#define SPELL_SUMMONCRIMSONRIFLEMAN 17279 + +struct MANGOS_DLL_DECL boss_cannon_master_willeyAI : public ScriptedAI +{ + boss_cannon_master_willeyAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 KnockAway_Timer; + uint32 Pummel_Timer; + uint32 Shoot_Timer; + uint32 SummonRifleman_Timer; + + void Reset() + { + Shoot_Timer = 1000; + Pummel_Timer = 7000; + KnockAway_Timer = 11000; + SummonRifleman_Timer = 15000; + } + + void JustDied(Unit* Victim) + { + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Pummel + if (Pummel_Timer < diff) + { + //Cast + if (rand()%100 < 90) //90% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PUMMEL); + } + //12 seconds until we should cast this again + Pummel_Timer = 12000; + }else Pummel_Timer -= diff; + + //KnockAway + if (KnockAway_Timer < diff) + { + //Cast + if (rand()%100 < 80) //80% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKAWAY); + } + //14 seconds until we should cast this again + KnockAway_Timer = 14000; + }else KnockAway_Timer -= diff; + + //Shoot + if (Shoot_Timer < diff) + { + //Cast + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHOOT); + //1 seconds until we should cast this again + Shoot_Timer = 1000; + }else Shoot_Timer -= diff; + + //SummonRifleman + if (SummonRifleman_Timer < diff) + { + //Cast + switch(urand(0, 8)) + { + case 0: + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 1: + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 2: + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 3: + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 4: + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 5: + m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 6: + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 7: + m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 8: + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + } + //30 seconds until we should cast this again + SummonRifleman_Timer = 30000; + }else SummonRifleman_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_cannon_master_willey(Creature* pCreature) +{ + return new boss_cannon_master_willeyAI(pCreature); +} + +void AddSC_boss_cannon_master_willey() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_cannon_master_willey"; + newscript->GetAI = &GetAI_boss_cannon_master_willey; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp b/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp new file mode 100644 index 0000000..b586c21 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Dathrohan_Balnazzar +SD%Complete: 95 +SDComment: Possibly need to fix/improve summons after death +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" + +enum +{ + //Dathrohan spells + SPELL_CRUSADERSHAMMER = 17286, //AOE stun + SPELL_CRUSADERSTRIKE = 17281, + SPELL_HOLYSTRIKE = 17284, //weapon dmg +3 + + //Transform + SPELL_BALNAZZARTRANSFORM = 17288, //restore full HP/mana, trigger spell Balnazzar Transform Stun + + //Balnazzar spells + SPELL_SHADOWSHOCK = 17399, + SPELL_MINDBLAST = 17287, + SPELL_PSYCHICSCREAM = 13704, + SPELL_SLEEP = 12098, + SPELL_MINDCONTROL = 15690, + + NPC_DATHROHAN = 10812, + NPC_BALNAZZAR = 10813, + NPC_ZOMBIE = 10698 //probably incorrect +}; + +struct SummonDef +{ + float m_fX, m_fY, m_fZ, m_fOrient; +}; + +SummonDef m_aSummonPoint[]= +{ + {3444.156f, -3090.626f, 135.002f, 2.240f}, //G1 front, left + {3449.123f, -3087.009f, 135.002f, 2.240f}, //G1 front, right + {3446.246f, -3093.466f, 135.002f, 2.240f}, //G1 back left + {3451.160f, -3089.904f, 135.002f, 2.240f}, //G1 back, right + + {3457.995f, -3080.916f, 135.002f, 3.784f}, //G2 front, left + {3454.302f, -3076.330f, 135.002f, 3.784f}, //G2 front, right + {3460.975f, -3078.901f, 135.002f, 3.784f}, //G2 back left + {3457.338f, -3073.979f, 135.002f, 3.784f} //G2 back, right +}; + +struct MANGOS_DLL_DECL boss_dathrohan_balnazzarAI : public ScriptedAI +{ + boss_dathrohan_balnazzarAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCrusadersHammer_Timer; + uint32 m_uiCrusaderStrike_Timer; + uint32 m_uiMindBlast_Timer; + uint32 m_uiHolyStrike_Timer; + uint32 m_uiShadowShock_Timer; + uint32 m_uiPsychicScream_Timer; + uint32 m_uiDeepSleep_Timer; + uint32 m_uiMindControl_Timer; + bool m_bTransformed; + + void Reset() + { + m_uiCrusadersHammer_Timer = 8000; + m_uiCrusaderStrike_Timer = 12000; + m_uiMindBlast_Timer = 6000; + m_uiHolyStrike_Timer = 18000; + m_uiShadowShock_Timer = 4000; + m_uiPsychicScream_Timer = 16000; + m_uiDeepSleep_Timer = 20000; + m_uiMindControl_Timer = 10000; + m_bTransformed = false; + + if (m_creature->GetEntry() == NPC_BALNAZZAR) + m_creature->UpdateEntry(NPC_DATHROHAN); + + } + + void JustDied(Unit* Victim) + { + static uint32 uiCount = sizeof(m_aSummonPoint)/sizeof(SummonDef); + + for (uint8 i=0; iSummonCreature(NPC_ZOMBIE, + m_aSummonPoint[i].m_fX, m_aSummonPoint[i].m_fY, m_aSummonPoint[i].m_fZ, m_aSummonPoint[i].m_fOrient, + TEMPSUMMON_TIMED_DESPAWN, HOUR*IN_MILLISECONDS); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //START NOT TRANSFORMED + if (!m_bTransformed) + { + //MindBlast + if (m_uiMindBlast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MINDBLAST); + m_uiMindBlast_Timer = urand(15000, 20000); + }else m_uiMindBlast_Timer -= uiDiff; + + //CrusadersHammer + if (m_uiCrusadersHammer_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CRUSADERSHAMMER); + m_uiCrusadersHammer_Timer = 12000; + }else m_uiCrusadersHammer_Timer -= uiDiff; + + //CrusaderStrike + if (m_uiCrusaderStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 15000; + }else m_uiCrusaderStrike_Timer -= uiDiff; + + //HolyStrike + if (m_uiHolyStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HOLYSTRIKE); + m_uiHolyStrike_Timer = 15000; + }else m_uiHolyStrike_Timer -= uiDiff; + + //BalnazzarTransform + if (m_creature->GetHealthPercent() < 40.0f) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //restore hp, mana and stun + DoCastSpellIfCan(m_creature,SPELL_BALNAZZARTRANSFORM); + m_creature->UpdateEntry(NPC_BALNAZZAR); + m_bTransformed = true; + } + } + else + { + //MindBlast + if (m_uiMindBlast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MINDBLAST); + m_uiMindBlast_Timer = urand(15000, 20000); + }else m_uiMindBlast_Timer -= uiDiff; + + //ShadowShock + if (m_uiShadowShock_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWSHOCK); + m_uiShadowShock_Timer = 11000; + }else m_uiShadowShock_Timer -= uiDiff; + + //PsychicScream + if (m_uiPsychicScream_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget,SPELL_PSYCHICSCREAM); + + m_uiPsychicScream_Timer = 20000; + }else m_uiPsychicScream_Timer -= uiDiff; + + //DeepSleep + if (m_uiDeepSleep_Timer < uiDiff) + { + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget,SPELL_SLEEP); + + m_uiDeepSleep_Timer = 15000; + }else m_uiDeepSleep_Timer -= uiDiff; + + //MindControl + if (m_uiMindControl_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MINDCONTROL); + m_uiMindControl_Timer = 15000; + }else m_uiMindControl_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dathrohan_balnazzar(Creature* pCreature) +{ + return new boss_dathrohan_balnazzarAI(pCreature); +} + +void AddSC_boss_dathrohan_balnazzar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_dathrohan_balnazzar"; + newscript->GetAI = &GetAI_boss_dathrohan_balnazzar; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp b/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp new file mode 100644 index 0000000..c72171d --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp @@ -0,0 +1,128 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Magistrate_Barthilas +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +#define SPELL_DRAININGBLOW 16793 +#define SPELL_CROWDPUMMEL 10887 +#define SPELL_MIGHTYBLOW 14099 +#define SPELL_FURIOUS_ANGER 16791 + +#define MODEL_NORMAL 10433 +#define MODEL_HUMAN 3637 + +struct MANGOS_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI +{ + boss_magistrate_barthilasAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 DrainingBlow_Timer; + uint32 CrowdPummel_Timer; + uint32 MightyBlow_Timer; + uint32 FuriousAnger_Timer; + uint32 AngerCount; + + void Reset() + { + DrainingBlow_Timer = 20000; + CrowdPummel_Timer = 15000; + MightyBlow_Timer = 10000; + FuriousAnger_Timer = 5000; + AngerCount = 0; + + if (m_creature->isAlive()) + m_creature->SetDisplayId(MODEL_NORMAL); + else + m_creature->SetDisplayId(MODEL_HUMAN); + } + + void MoveInLineOfSight(Unit *who) + { + //nothing to see here yet + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* Killer) + { + m_creature->SetDisplayId(MODEL_HUMAN); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (FuriousAnger_Timer < diff) + { + FuriousAnger_Timer = 4000; + if (AngerCount > 25) + return; + + ++AngerCount; + m_creature->CastSpell(m_creature,SPELL_FURIOUS_ANGER,false); + }else FuriousAnger_Timer -= diff; + + //DrainingBlow + if (DrainingBlow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DRAININGBLOW); + DrainingBlow_Timer = 15000; + }else DrainingBlow_Timer -= diff; + + //CrowdPummel + if (CrowdPummel_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 15000; + }else CrowdPummel_Timer -= diff; + + //MightyBlow + if (MightyBlow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MIGHTYBLOW); + MightyBlow_Timer = 20000; + }else MightyBlow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_magistrate_barthilas(Creature* pCreature) +{ + return new boss_magistrate_barthilasAI(pCreature); +} + +void AddSC_boss_magistrate_barthilas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magistrate_barthilas"; + newscript->GetAI = &GetAI_boss_magistrate_barthilas; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp b/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp new file mode 100644 index 0000000..c831a3f --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp @@ -0,0 +1,108 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Maleki_the_Pallid +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +#define SPELL_FROSTBOLT 17503 +#define SPELL_DRAIN_LIFE 17238 +#define SPELL_DRAIN_MANA 17243 +#define SPELL_ICETOMB 16869 + +struct MANGOS_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI +{ + boss_maleki_the_pallidAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 FrostNova_Timer; + uint32 Frostbolt_Timer; + uint32 IceTomb_Timer; + uint32 DrainLife_Timer; + + void Reset() + { + FrostNova_Timer = 11000; + Frostbolt_Timer = 1000; + IceTomb_Timer = 16000; + DrainLife_Timer = 31000; + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_PALLID, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Frostbolt + if (Frostbolt_Timer < diff) + { + if (rand()%100 < 90) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBOLT); + + Frostbolt_Timer = 3500; + }else Frostbolt_Timer -= diff; + + //IceTomb + if (IceTomb_Timer < diff) + { + if (rand()%100 < 65) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ICETOMB); + + IceTomb_Timer = 28000; + }else IceTomb_Timer -= diff; + + //DrainLife + if (DrainLife_Timer < diff) + { + if (rand()%100 < 55) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DRAIN_LIFE); + + DrainLife_Timer = 31000; + }else DrainLife_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_maleki_the_pallid(Creature* pCreature) +{ + return new boss_maleki_the_pallidAI(pCreature); +} + +void AddSC_boss_maleki_the_pallid() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_maleki_the_pallid"; + newscript->GetAI = &GetAI_boss_maleki_the_pallid; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp b/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp new file mode 100644 index 0000000..85fde3f --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp @@ -0,0 +1,137 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nerubenkan +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +#define SPELL_ENCASINGWEBS 4962 +#define SPELL_PIERCEARMOR 6016 +#define SPELL_CRYPT_SCARABS 31602 +#define SPELL_RAISEUNDEADSCARAB 17235 + +struct MANGOS_DLL_DECL boss_nerubenkanAI : public ScriptedAI +{ + boss_nerubenkanAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 EncasingWebs_Timer; + uint32 PierceArmor_Timer; + uint32 CryptScarabs_Timer; + uint32 RaiseUndeadScarab_Timer; + + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + CryptScarabs_Timer = 3000; + EncasingWebs_Timer = 7000; + PierceArmor_Timer = 19000; + RaiseUndeadScarab_Timer = 3000; + } + + void RaiseUndeadScarab(Unit* victim) + { + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch(urand(0, 1)) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(10876, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); + if (Summoned) + Summoned->AI()->AttackStart(victim); + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NERUB, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //EncasingWebs + if (EncasingWebs_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ENCASINGWEBS); + EncasingWebs_Timer = 30000; + }else EncasingWebs_Timer -= diff; + + //PierceArmor + if (PierceArmor_Timer < diff) + { + if (rand()%100 < 75) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PIERCEARMOR); + + PierceArmor_Timer = 35000; + }else PierceArmor_Timer -= diff; + + //CryptScarabs + if (CryptScarabs_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CRYPT_SCARABS); + CryptScarabs_Timer = 16000; + }else CryptScarabs_Timer -= diff; + + //RaiseUndeadScarab + if (RaiseUndeadScarab_Timer < diff) + { + RaiseUndeadScarab(m_creature->getVictim()); + RaiseUndeadScarab_Timer = 18000; + }else RaiseUndeadScarab_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_nerubenkan(Creature* pCreature) +{ + return new boss_nerubenkanAI(pCreature); +} + +void AddSC_boss_nerubenkan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nerubenkan"; + newscript->GetAI = &GetAI_boss_nerubenkan; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp b/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp new file mode 100644 index 0000000..b07a589 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp @@ -0,0 +1,154 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Silver_Hand_Bosses +SD%Complete: 40 +SDComment: Basic script to have support for Horde paladin epic mount (quest 9737). All 5 members of Order of the Silver Hand running this script (least for now) +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +/*##### +# Additional: +# Although this is a working solution, the correct would be in addition to check if Aurius is dead. +# Once player extinguish the eternal flame (cast spell 31497->start event 11206) Aurius should become hostile. +# Once Aurius is defeated, he should be the one summoning the ghosts. +#####*/ + +#define SH_GREGOR 17910 +#define SH_CATHELA 17911 +#define SH_NEMAS 17912 +#define SH_AELMAR 17913 +#define SH_VICAR 17914 +#define SH_QUEST_CREDIT 17915 + +#define SPELL_HOLY_LIGHT 25263 +#define SPELL_DIVINE_SHIELD 13874 + +struct MANGOS_DLL_DECL boss_silver_hand_bossesAI : public ScriptedAI +{ + boss_silver_hand_bossesAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 HolyLight_Timer; + uint32 DivineShield_Timer; + + void Reset() + { + HolyLight_Timer = 20000; + DivineShield_Timer = 20000; + + if (m_pInstance) + { + switch(m_creature->GetEntry()) + { + case SH_AELMAR: + m_pInstance->SetData(TYPE_SH_AELMAR, 0); + break; + case SH_CATHELA: + m_pInstance->SetData(TYPE_SH_CATHELA, 0); + break; + case SH_GREGOR: + m_pInstance->SetData(TYPE_SH_GREGOR, 0); + break; + case SH_NEMAS: + m_pInstance->SetData(TYPE_SH_NEMAS, 0); + break; + case SH_VICAR: + m_pInstance->SetData(TYPE_SH_VICAR, 0); + break; + } + } + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + { + switch(m_creature->GetEntry()) + { + case SH_AELMAR: + m_pInstance->SetData(TYPE_SH_AELMAR, 2); + break; + case SH_CATHELA: + m_pInstance->SetData(TYPE_SH_CATHELA, 2); + break; + case SH_GREGOR: + m_pInstance->SetData(TYPE_SH_GREGOR, 2); + break; + case SH_NEMAS: + m_pInstance->SetData(TYPE_SH_NEMAS, 2); + break; + case SH_VICAR: + m_pInstance->SetData(TYPE_SH_VICAR, 2); + break; + } + if (m_pInstance->GetData(TYPE_SH_QUEST) && Killer->GetTypeId() == TYPEID_PLAYER) + ((Player*)Killer)->KilledMonsterCredit(SH_QUEST_CREDIT,m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (HolyLight_Timer < diff) + { + if (m_creature->GetHealthPercent() < 20.0f) + { + DoCastSpellIfCan(m_creature, SPELL_HOLY_LIGHT); + HolyLight_Timer = 20000; + } + }else HolyLight_Timer -= diff; + + if (DivineShield_Timer < diff) + { + if (m_creature->GetHealthPercent() < 5.0f) + { + DoCastSpellIfCan(m_creature, SPELL_DIVINE_SHIELD); + DivineShield_Timer = 40000; + } + }else DivineShield_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_boss_silver_hand_bossesAI(Creature* pCreature) +{ + return new boss_silver_hand_bossesAI(pCreature); +} + + +void AddSC_boss_order_of_silver_hand() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_silver_hand_bosses"; + newscript->GetAI = &GetAI_boss_silver_hand_bossesAI; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp b/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp new file mode 100644 index 0000000..66e14fb --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp @@ -0,0 +1,139 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_postmaster_malown +SD%Complete: 50 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" + +//Spell ID to summon this guy is 24627 "Summon Postmaster Malown" +//He should be spawned along with three other elites once the third postbox has been opened + +#define SAY_MALOWNED "You just got MALOWNED!" + +#define SPELL_WAILINGDEAD 7713 +#define SPELL_BACKHAND 6253 +#define SPELL_CURSEOFWEAKNESS 8552 +#define SPELL_CURSEOFTONGUES 12889 +#define SPELL_CALLOFTHEGRAVE 17831 + +struct MANGOS_DLL_DECL boss_postmaster_malownAI : public ScriptedAI +{ + boss_postmaster_malownAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 WailingDead_Timer; + uint32 Backhand_Timer; + uint32 CurseOfWeakness_Timer; + uint32 CurseOfTongues_Timer; + uint32 CallOfTheGrave_Timer; + bool HasYelled; + + void Reset() + { + WailingDead_Timer = 19000; //lasts 6 sec + Backhand_Timer = 8000; //2 sec stun + CurseOfWeakness_Timer = 20000; //lasts 2 mins + CurseOfTongues_Timer = 22000; + CallOfTheGrave_Timer = 25000; + HasYelled = false; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //WailingDead + if (WailingDead_Timer < diff) + { + //Cast + if (rand()%100 < 65) //65% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_WAILINGDEAD); + } + //19 seconds until we should cast this again + WailingDead_Timer = 19000; + }else WailingDead_Timer -= diff; + + //Backhand + if (Backhand_Timer < diff) + { + //Cast + if (rand()%100 < 45) //45% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BACKHAND); + } + //8 seconds until we should cast this again + Backhand_Timer = 8000; + }else Backhand_Timer -= diff; + + //CurseOfWeakness + if (CurseOfWeakness_Timer < diff) + { + //Cast + if (rand()%100 < 3) //3% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); + } + //20 seconds until we should cast this again + CurseOfWeakness_Timer = 20000; + }else CurseOfWeakness_Timer -= diff; + + //CurseOfTongues + if (CurseOfTongues_Timer < diff) + { + //Cast + if (rand()%100 < 3) //3% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CURSEOFTONGUES); + } + //22 seconds until we should cast this again + CurseOfTongues_Timer = 22000; + }else CurseOfTongues_Timer -= diff; + + //CallOfTheGrave + if (CallOfTheGrave_Timer < diff) + { + //Cast + if (rand()%100 < 5) //5% chance to cast + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE); + } + //25 seconds until we should cast this again + CallOfTheGrave_Timer = 25000; + }else CallOfTheGrave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_postmaster_malown(Creature* pCreature) +{ + return new boss_postmaster_malownAI(pCreature); +} + +void AddSC_boss_postmaster_malown() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_postmaster_malown"; + newscript->GetAI = &GetAI_boss_postmaster_malown; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp b/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp new file mode 100644 index 0000000..1be611f --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ramstein_the_Gorger +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +#define SPELL_TRAMPLE 5568 +#define SPELL_KNOCKOUT 17307 + +#define C_MINDLESS_UNDEAD 11030 + +struct MANGOS_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI +{ + boss_ramstein_the_gorgerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Trample_Timer; + uint32 Knockout_Timer; + + void Reset() + { + Trample_Timer = 3000; + Knockout_Timer = 12000; + } + + void JustDied(Unit* Killer) + { + for(uint8 i = 0; i < 30; ++i) + m_creature->SummonCreature(C_MINDLESS_UNDEAD, 3969.35f, -3391.87f, 119.11f, 5.91f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,1800000); + + if (m_pInstance) + m_pInstance->SetData(TYPE_RAMSTEIN,DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Trample + if (Trample_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_TRAMPLE); + Trample_Timer = 7000; + }else Trample_Timer -= diff; + + //Knockout + if (Knockout_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKOUT); + Knockout_Timer = 10000; + }else Knockout_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ramstein_the_gorger(Creature* pCreature) +{ + return new boss_ramstein_the_gorgerAI(pCreature); +} + +void AddSC_boss_ramstein_the_gorger() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ramstein_the_gorger"; + newscript->GetAI = &GetAI_boss_ramstein_the_gorger; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp b/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp new file mode 100644 index 0000000..030cb9e --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp @@ -0,0 +1,70 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_timmy_the_cruel +SD%Complete: 100 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SPAWN "TIMMY!" + +#define SPELL_RAVENOUSCLAW 17470 + +struct MANGOS_DLL_DECL boss_timmy_the_cruelAI : public ScriptedAI +{ + boss_timmy_the_cruelAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 RavenousClaw_Timer; + + void Reset() + { + RavenousClaw_Timer = 10000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //RavenousClaw + if (RavenousClaw_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_RAVENOUSCLAW); + RavenousClaw_Timer = 15000; + }else RavenousClaw_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_timmy_the_cruel(Creature* pCreature) +{ + return new boss_timmy_the_cruelAI(pCreature); +} + +void AddSC_boss_timmy_the_cruel() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_timmy_the_cruel"; + newscript->GetAI = &GetAI_boss_timmy_the_cruel; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp b/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp new file mode 100644 index 0000000..4c58758 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp @@ -0,0 +1,513 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Stratholme +SD%Complete: 50 +SDComment: In progress. Undead side 80% implemented, wipe support for doors at slaughterhouse needed, event needs better implementation +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "stratholme.h" + +instance_stratholme::instance_stratholme(Map* pMap) : ScriptedInstance(pMap), + m_uiBaronRunTimer(0), + m_uiSlaugtherSquareTimer(0), + + m_uiServiceEntranceGUID(0), + m_uiGauntletGate1GUID(0), + m_uiPortGauntletGUID(0), + m_uiPortSlaugtherGUID(0), + m_uiPortElderGUID(0), + m_auiRamsteinDoorGUID(0), + m_auiRivendareDoorGUID(0), + + m_uiBaronGUID(0), + m_uiYsidaTriggerGUID(0), + + m_uiAcolyteAnnouncerGUID(0) +{ + Initialize(); +} + + +void instance_stratholme::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_bIsSilverHandDead, false, sizeof(m_bIsSilverHandDead)); + memset(&m_auiZigguratGUID, 0, sizeof(m_auiZigguratGUID)); + memset(&m_auiCrystalSortedGUID, 0, sizeof(m_auiCrystalSortedGUID)); + + m_lCrystals.clear(); + m_sAbomnationGUID.clear(); + m_lAcolytes.clear(); +} + +bool instance_stratholme::StartSlaugtherSquare() +{ + if (m_auiEncounter[1] == SPECIAL && m_auiEncounter[2] == SPECIAL && m_auiEncounter[3] == SPECIAL) + { + if (Creature* pBaron = instance->GetCreature(m_uiBaronGUID)) + DoScriptText(SAY_ANNOUNCE_RIVENDARE, pBaron); + + DoUseDoorOrButton(m_uiPortGauntletGUID); + DoUseDoorOrButton(m_uiPortSlaugtherGUID); + return true; + } + + debug_log("SD2: Instance Stratholme: Cannot open slaugther square yet."); + return false; +} + +void instance_stratholme::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_BARON: m_uiBaronGUID = pCreature->GetGUID(); break; + case NPC_YSIDA_TRIGGER: m_uiYsidaTriggerGUID = pCreature->GetGUID(); break; + case NPC_CRYSTAL: m_lCrystals.push_back(pCreature); break; + case NPC_ABOM_BILE: + case NPC_ABOM_VENOM: m_sAbomnationGUID.insert(pCreature->GetGUID()); break; + case NPC_THUZADIN_ACOLYTE: m_lAcolytes.push_back(pCreature); break; + } +} + +void instance_stratholme::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_SERVICE_ENTRANCE: + m_uiServiceEntranceGUID = pGo->GetGUID(); + break; + case GO_GAUNTLET_GATE1: + // TODO + //weird, but unless flag is set, client will not respond as expected. DB bug? + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_LOCKED); + m_uiGauntletGate1GUID = pGo->GetGUID(); + break; + case GO_ZIGGURAT_DOOR_1: + m_auiZigguratGUID[0] = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE || m_auiEncounter[1] == SPECIAL) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ZIGGURAT_DOOR_2: + m_auiZigguratGUID[1] = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE || m_auiEncounter[2] == SPECIAL) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ZIGGURAT_DOOR_3: + m_auiZigguratGUID[2] = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE || m_auiEncounter[3] == SPECIAL) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ZIGGURAT_DOOR_4: + m_auiRamsteinDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ZIGGURAT_DOOR_5: + m_auiRivendareDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PORT_GAUNTLET: + m_uiPortGauntletGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == SPECIAL && m_auiEncounter[2] == SPECIAL && m_auiEncounter[3] == SPECIAL) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PORT_SLAUGTHER: + m_uiPortSlaugtherGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == SPECIAL && m_auiEncounter[2] == SPECIAL && m_auiEncounter[3] == SPECIAL) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PORT_ELDERS: + m_uiPortElderGUID = pGo->GetGUID(); + break; + } +} + +void instance_stratholme::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_BARON_RUN: + switch(uiData) + { + case IN_PROGRESS: + if (m_auiEncounter[0] == IN_PROGRESS || m_auiEncounter[0] == FAIL) + break; + m_uiBaronRunTimer = 45*MINUTE*IN_MILLISECONDS; + debug_log("SD2: Instance Stratholme: Baron run in progress."); + break; + case FAIL: + //may add code to remove aura from players, but in theory the time should be up already and removed. + break; + case DONE: + if (Creature* pYsidaT = instance->GetCreature(m_uiYsidaTriggerGUID)) + pYsidaT->SummonCreature(NPC_YSIDA, pYsidaT->GetPositionX(), pYsidaT->GetPositionY(), pYsidaT->GetPositionZ(), pYsidaT->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN, 1800000); + + m_uiBaronRunTimer = 0; + break; + } + m_auiEncounter[0] = uiData; + break; + case TYPE_BARONESS: + m_auiEncounter[1] = uiData; + if (uiData == DONE) + { + DoSortZiggurats(); + DoUseDoorOrButton(m_auiZigguratGUID[0]); + } + if (uiData == SPECIAL) + StartSlaugtherSquare(); + break; + case TYPE_NERUB: + m_auiEncounter[2] = uiData; + if (uiData == DONE) + { + DoSortZiggurats(); + DoUseDoorOrButton(m_auiZigguratGUID[1]); + } + if (uiData == SPECIAL) + StartSlaugtherSquare(); + break; + case TYPE_PALLID: + m_auiEncounter[3] = uiData; + if (uiData == DONE) + { + DoSortZiggurats(); + DoUseDoorOrButton(m_auiZigguratGUID[2]); + } + if (uiData == SPECIAL) + StartSlaugtherSquare(); + break; + case TYPE_RAMSTEIN: + if (uiData == IN_PROGRESS) + { + if (m_auiEncounter[4] != IN_PROGRESS) + DoUseDoorOrButton(m_uiPortGauntletGUID); + + uint32 uiCount = m_sAbomnationGUID.size(); + for(std::set::iterator i = m_sAbomnationGUID.begin(); i != m_sAbomnationGUID.end(); ++i) + { + if (Creature* pAbom = instance->GetCreature(*i)) + { + if (!pAbom->isAlive()) + --uiCount; + } + } + + if (!uiCount) + { + //a bit itchy, it should close the door after 10 secs, but it doesn't. skipping it for now. + // TODO - not working correctly! + //DoUseDoorOrButton(m_auiRamsteinDoorGUID, 10); + + if (Creature* pBaron = instance->GetCreature(m_uiBaronGUID)) + pBaron->SummonCreature(NPC_RAMSTEIN, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_DEAD_DESPAWN, 0); + + debug_log("SD2: Instance Stratholme: Ramstein spawned."); + } + else + debug_log("SD2: Instance Stratholme: %u Abomnation left to kill.", uiCount); + } + if (uiData == DONE) + { + m_uiSlaugtherSquareTimer = 5*MINUTE*IN_MILLISECONDS; + debug_log("SD2: Instance Stratholme: Slaugther event will continue in 5 minutes."); + } + m_auiEncounter[4] = uiData; + break; + case TYPE_BARON: + if (uiData == IN_PROGRESS) + { + if (GetData(TYPE_BARON_RUN) == IN_PROGRESS) + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + { + if (pPlayer->HasAura(SPELL_BARON_ULTIMATUM)) + pPlayer->RemoveAurasDueToSpell(SPELL_BARON_ULTIMATUM); + + if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_DEAD_MAN_PLEA); + } + } + } + + SetData(TYPE_BARON_RUN,DONE); + } + } + if (uiData == DONE) + // Open a few doors again // TODO: needs research, how to handle wipes in this area! + DoUseDoorOrButton(m_uiPortGauntletGUID); + + m_auiEncounter[5] = uiData; + break; + + case TYPE_SH_AELMAR: + m_bIsSilverHandDead[0] = (uiData) ? true : false; + break; + case TYPE_SH_CATHELA: + m_bIsSilverHandDead[1] = (uiData) ? true : false; + break; + case TYPE_SH_GREGOR: + m_bIsSilverHandDead[2] = (uiData) ? true : false; + break; + case TYPE_SH_NEMAS: + m_bIsSilverHandDead[3] = (uiData) ? true : false; + break; + case TYPE_SH_VICAR: + m_bIsSilverHandDead[4] = (uiData) ? true : false; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_stratholme::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5]; + + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + // Special Treatment for the Ziggurat-Bosses, as otherwise the event couldn't reload + if (m_auiEncounter[1] == DONE) + m_auiEncounter[1] = SPECIAL; + if (m_auiEncounter[2] == DONE) + m_auiEncounter[2] = SPECIAL; + if (m_auiEncounter[3] == DONE) + m_auiEncounter[3] = SPECIAL; + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_stratholme::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_SH_QUEST: + if (m_bIsSilverHandDead[0] && m_bIsSilverHandDead[1] && m_bIsSilverHandDead[2] && m_bIsSilverHandDead[3] && m_bIsSilverHandDead[4]) + return 1; + return 0; + case TYPE_BARON_RUN: + return m_auiEncounter[0]; + case TYPE_BARONESS: + return m_auiEncounter[1]; + case TYPE_NERUB: + return m_auiEncounter[2]; + case TYPE_PALLID: + return m_auiEncounter[3]; + case TYPE_RAMSTEIN: + return m_auiEncounter[4]; + case TYPE_BARON: + return m_auiEncounter[5]; + default: + return 0; + } +} + +uint64 instance_stratholme::GetData64(uint32 uiData) +{ + switch(uiData) + { + case NPC_BARON: + return m_uiBaronGUID; + case NPC_YSIDA_TRIGGER: + return m_uiYsidaTriggerGUID; + default: + return 0; + } +} + +static bool sortByHight(Creature* pFirst, Creature* pSecond) +{ + return pFirst && pSecond && pFirst->GetPositionZ() > pSecond->GetPositionZ(); +} + +void instance_stratholme::DoSortZiggurats() +{ + if (m_lAcolytes.empty()) + return; + + if (!m_uiAcolyteAnnouncerGUID) + { + // Sort the acolytes by hight, and the one with the biggest hight is the announcer (a bit outside the map) + m_lAcolytes.sort(sortByHight); + m_uiAcolyteAnnouncerGUID = (*m_lAcolytes.begin())->GetGUID(); + m_lAcolytes.erase(m_lAcolytes.begin()); + } + + // Sort Acolytes + for (std::list::iterator itr = m_lAcolytes.begin(); itr != m_lAcolytes.end(); ) + { + bool bAlreadyIterated = false; + for (uint8 i = 0; i < MAX_ZIGGURATS; ++i) + { + if (GameObject* pZigguratDoor = instance->GetGameObject(m_auiZigguratGUID[i])) + { + if ((*itr)->isAlive() && (*itr)->IsWithinDistInMap(pZigguratDoor, 50.0f, false)) + { + m_alZigguratAcolyteGUID[i].push_back((*itr)->GetGUID()); + itr = m_lAcolytes.erase(itr); + bAlreadyIterated = true; + break; + } + } + } + + if (itr != m_lAcolytes.end() && !bAlreadyIterated) + ++itr; + } + + // Sort Crystal + for (std::list::iterator itr = m_lCrystals.begin(); itr != m_lCrystals.end(); ) + { + bool bAlreadyIterated = false; + for (uint8 i = 0; i < MAX_ZIGGURATS; ++i) + { + if (GameObject* pZigguratDoor = instance->GetGameObject(m_auiZigguratGUID[i])) + { + if ((*itr)->IsWithinDistInMap(pZigguratDoor, 50.0f, false)) + { + m_auiCrystalSortedGUID[i] = ((*itr)->GetGUID()); + itr = m_lCrystals.erase(itr); + bAlreadyIterated = true; + break; + } + } + } + + if (itr != m_lCrystals.end() && !bAlreadyIterated) + ++itr; + } +} + +void instance_stratholme::OnCreatureDeath(Creature* pCreature) +{ + if (pCreature->GetEntry() == NPC_THUZADIN_ACOLYTE) + { + for (uint8 i = 0; i < MAX_ZIGGURATS; ++i) + { + if (m_alZigguratAcolyteGUID[i].empty()) + continue; // nothing to do anymore for this ziggurat + + m_alZigguratAcolyteGUID[i].remove(pCreature->GetGUID()); + if (m_alZigguratAcolyteGUID[i].empty()) + { + // A random zone yell after one is cleared + int32 aAnnounceSay[MAX_ZIGGURATS] = {SAY_ANNOUNCE_ZIGGURAT_1, SAY_ANNOUNCE_ZIGGURAT_2, SAY_ANNOUNCE_ZIGGURAT_3}; + if (Creature* pAnnouncer = instance->GetCreature(m_uiAcolyteAnnouncerGUID)) + DoScriptText(aAnnounceSay[i], pAnnouncer); + + // Kill Crystal + if (Creature* pCrystal = instance->GetCreature(m_auiCrystalSortedGUID[i])) + pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + switch (i) + { + case 0: SetData(TYPE_BARONESS, SPECIAL); break; + case 1: SetData(TYPE_NERUB, SPECIAL); break; + case 2: SetData(TYPE_PALLID, SPECIAL); break; + } + } + } + } +} + +void instance_stratholme::Update(uint32 uiDiff) +{ + if (m_uiBaronRunTimer) + { + if (m_uiBaronRunTimer <= uiDiff) + { + if (GetData(TYPE_BARON_RUN) != DONE) + SetData(TYPE_BARON_RUN, FAIL); + + m_uiBaronRunTimer = 0; + debug_log("SD2: Instance Stratholme: Baron run event reached end. Event has state %u.",GetData(TYPE_BARON_RUN)); + } + else + m_uiBaronRunTimer -= uiDiff; + } + + if (m_uiSlaugtherSquareTimer) + { + if (m_uiSlaugtherSquareTimer <= uiDiff) + { + if (Creature* pBaron = instance->GetCreature(m_uiBaronGUID)) + { + for(uint8 i = 0; i < 4; ++i) + pBaron->SummonCreature(NPC_BLACK_GUARD, 4032.84f, -3390.24f, 119.73f, 4.71f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + + DoUseDoorOrButton(m_auiRamsteinDoorGUID); + DoUseDoorOrButton(m_auiRivendareDoorGUID); + + debug_log("SD2: Instance Stratholme: Black guard sentries spawned. Opening gates to baron."); + } + m_uiSlaugtherSquareTimer = 0; + } + else + m_uiSlaugtherSquareTimer -= uiDiff; + } +} + +InstanceData* GetInstanceData_instance_stratholme(Map* pMap) +{ + return new instance_stratholme(pMap); +} + +void AddSC_instance_stratholme() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_stratholme"; + pNewScript->GetInstanceData = &GetInstanceData_instance_stratholme; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/stratholme.cpp b/scripts/eastern_kingdoms/stratholme/stratholme.cpp new file mode 100644 index 0000000..9fbe9a8 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/stratholme.cpp @@ -0,0 +1,291 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Stratholme +SD%Complete: 100 +SDComment: Misc mobs for instance. GO-script to apply aura and start event for quest 8945 +SDCategory: Stratholme +EndScriptData */ + +/* ContentData +go_gauntlet_gate +mob_freed_soul +mob_restless_soul +mobs_spectral_ghostly_citizen +EndContentData */ + +#include "precompiled.h" +#include "stratholme.h" + +/*###### +## go_gauntlet_gate (this is the _first_ of the gauntlet gates, two exist) +######*/ + +bool GOHello_go_gauntlet_gate(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance->GetData(TYPE_BARON_RUN) != NOT_STARTED) + return false; + + if (Group *pGroup = pPlayer->GetGroup()) + { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player* pGroupie = itr->getSource(); + if (!pGroupie) + continue; + + if (pGroupie->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && + !pGroupie->HasAura(SPELL_BARON_ULTIMATUM, EFFECT_INDEX_0) && + pGroupie->GetMap() == pGo->GetMap()) + pGroupie->CastSpell(pGroupie,SPELL_BARON_ULTIMATUM,true); + } + } + else + { + if (pPlayer->GetQuestStatus(QUEST_DEAD_MAN_PLEA) == QUEST_STATUS_INCOMPLETE && + !pPlayer->HasAura(SPELL_BARON_ULTIMATUM, EFFECT_INDEX_0) && + pPlayer->GetMap() == pGo->GetMap()) + pPlayer->CastSpell(pPlayer, SPELL_BARON_ULTIMATUM, true); + } + + pInstance->SetData(TYPE_BARON_RUN,IN_PROGRESS); + return false; +} + +/*###### +## mob_freed_soul +######*/ + +//Possibly more of these quotes around. +#define SAY_ZAPPED0 -1329000 +#define SAY_ZAPPED1 -1329001 +#define SAY_ZAPPED2 -1329002 +#define SAY_ZAPPED3 -1329003 + +struct MANGOS_DLL_DECL mob_freed_soulAI : public ScriptedAI +{ + mob_freed_soulAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_ZAPPED0, m_creature); break; + case 1: DoScriptText(SAY_ZAPPED1, m_creature); break; + case 2: DoScriptText(SAY_ZAPPED2, m_creature); break; + case 3: DoScriptText(SAY_ZAPPED3, m_creature); break; + } + } +}; + +CreatureAI* GetAI_mob_freed_soul(Creature* pCreature) +{ + return new mob_freed_soulAI(pCreature); +} + +/*###### +## mob_restless_soul +######*/ + +#define SPELL_EGAN_BLASTER 17368 +#define SPELL_SOUL_FREED 17370 +#define QUEST_RESTLESS_SOUL 5282 +#define ENTRY_RESTLESS 11122 +#define ENTRY_FREED 11136 + +struct MANGOS_DLL_DECL mob_restless_soulAI : public ScriptedAI +{ + mob_restless_soulAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 Tagger; + uint32 Die_Timer; + bool Tagged; + + void Reset() + { + Tagger = 0; + Die_Timer = 5000; + Tagged = false; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER) + { + if (!Tagged && spell->Id == SPELL_EGAN_BLASTER && ((Player*)caster)->GetQuestStatus(QUEST_RESTLESS_SOUL) == QUEST_STATUS_INCOMPLETE) + { + Tagged = true; + Tagger = caster->GetGUID(); + } + } + } + + void JustSummoned(Creature *summoned) + { + summoned->CastSpell(summoned,SPELL_SOUL_FREED,false); + } + + void JustDied(Unit* Killer) + { + if (Tagged) + m_creature->SummonCreature(ENTRY_FREED, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); + } + + void UpdateAI(const uint32 diff) + { + if (Tagged) + { + if (Die_Timer < diff) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(Tagger)) + pPlayer->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else + Die_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_restless_soul(Creature* pCreature) +{ + return new mob_restless_soulAI(pCreature); +} + +/*###### +## mobs_spectral_ghostly_citizen +######*/ + +enum +{ + SPELL_HAUNTING_PHANTOM = 16336, + SPELL_SLAP = 6754 +}; + +struct MANGOS_DLL_DECL mobs_spectral_ghostly_citizenAI : public ScriptedAI +{ + mobs_spectral_ghostly_citizenAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Die_Timer; + bool Tagged; + + void Reset() + { + Die_Timer = 5000; + Tagged = false; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (!Tagged && spell->Id == SPELL_EGAN_BLASTER) + Tagged = true; + } + + void JustDied(Unit* Killer) + { + if (Tagged) + { + for(uint32 i = 1; i <= 4; ++i) + { + float x,y,z; + m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),20.0f,x,y,z); + + //100%, 50%, 33%, 25% chance to spawn + uint32 j = urand(1,i); + if (j==1) + m_creature->SummonCreature(ENTRY_RESTLESS,x,y,z,0,TEMPSUMMON_CORPSE_DESPAWN,600000); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Tagged) + { + if (Die_Timer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else + Die_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + switch(emote) + { + case TEXTEMOTE_DANCE: + EnterEvadeMode(); + break; + case TEXTEMOTE_RUDE: + if (m_creature->IsWithinDistInMap(pPlayer, ATTACK_DISTANCE)) + m_creature->CastSpell(pPlayer,SPELL_SLAP,false); + else + m_creature->HandleEmote(EMOTE_ONESHOT_RUDE); + break; + case TEXTEMOTE_WAVE: + m_creature->HandleEmote(EMOTE_ONESHOT_WAVE); + break; + case TEXTEMOTE_BOW: + m_creature->HandleEmote(EMOTE_ONESHOT_BOW); + break; + case TEXTEMOTE_KISS: + m_creature->HandleEmote(EMOTE_ONESHOT_FLEX); + break; + } + } +}; + +CreatureAI* GetAI_mobs_spectral_ghostly_citizen(Creature* pCreature) +{ + return new mobs_spectral_ghostly_citizenAI(pCreature); +} + +void AddSC_stratholme() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "go_gauntlet_gate"; + pNewScript->pGOHello = &GOHello_go_gauntlet_gate; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_freed_soul"; + pNewScript->GetAI = &GetAI_mob_freed_soul; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_restless_soul"; + pNewScript->GetAI = &GetAI_mob_restless_soul; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mobs_spectral_ghostly_citizen"; + pNewScript->GetAI = &GetAI_mobs_spectral_ghostly_citizen; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/stratholme/stratholme.h b/scripts/eastern_kingdoms/stratholme/stratholme.h new file mode 100644 index 0000000..76f81d7 --- /dev/null +++ b/scripts/eastern_kingdoms/stratholme/stratholme.h @@ -0,0 +1,114 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_STRATHOLME_H +#define DEF_STRATHOLME_H + +enum +{ + MAX_ENCOUNTER = 6, + MAX_SILVERHAND = 5, + MAX_ZIGGURATS = 3, + + TYPE_BARON_RUN = 1, + TYPE_BARONESS = 2, + TYPE_NERUB = 3, + TYPE_PALLID = 4, + TYPE_RAMSTEIN = 5, + TYPE_BARON = 6, + + //DATA_BARON = 10, // Wasn't used, verify that it really was never used! + //DATA_YSIDA_TRIGGER = 11, + + TYPE_SH_QUEST = 20, + TYPE_SH_CATHELA = 21, + TYPE_SH_GREGOR = 22, + TYPE_SH_NEMAS = 23, + TYPE_SH_VICAR = 24, + TYPE_SH_AELMAR = 25, + + NPC_CRYSTAL = 10415, //three ziggurat crystals + NPC_BARON = 10440, + NPC_YSIDA_TRIGGER = 16100, + NPC_THUZADIN_ACOLYTE = 10399, //acolytes in ziggurats + NPC_RAMSTEIN = 10439, + NPC_ABOM_BILE = 10416, + NPC_ABOM_VENOM = 10417, + NPC_BLACK_GUARD = 10394, + NPC_YSIDA = 16031, + + GO_SERVICE_ENTRANCE = 175368, + GO_GAUNTLET_GATE1 = 175357, + GO_ZIGGURAT_DOOR_1 = 175380, //baroness + GO_ZIGGURAT_DOOR_2 = 175379, //nerub'enkan + GO_ZIGGURAT_DOOR_3 = 175381, //maleki + GO_ZIGGURAT_DOOR_4 = 175405, //rammstein + GO_ZIGGURAT_DOOR_5 = 175796, //baron + GO_PORT_GAUNTLET = 175374, //port from gauntlet to slaugther + GO_PORT_SLAUGTHER = 175373, //port at slaugther + GO_PORT_ELDERS = 175377, //port at elders square + + QUEST_DEAD_MAN_PLEA = 8945, + SPELL_BARON_ULTIMATUM = 27861, + + SAY_ANNOUNCE_ZIGGURAT_1 = -1329004, + SAY_ANNOUNCE_ZIGGURAT_2 = -1329005, + SAY_ANNOUNCE_ZIGGURAT_3 = -1329006, + SAY_ANNOUNCE_RIVENDARE = -1329007 +}; + +struct MANGOS_DLL_DECL instance_stratholme : public ScriptedInstance +{ + public: + instance_stratholme(Map* pMap); + ~instance_stratholme() {} + + void Initialize(); + + void OnCreatureCreate(Creature* pCreature); + void OnObjectCreate(GameObject* pGo); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + void OnCreatureDeath(Creature* pCreature); + + void Update(uint32 uiDiff); + + bool StartSlaugtherSquare(); + void DoSortZiggurats(); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + bool m_bIsSilverHandDead[MAX_SILVERHAND]; + std::string strInstData; + + uint32 m_uiBaronRunTimer; + uint32 m_uiSlaugtherSquareTimer; + + uint64 m_uiServiceEntranceGUID; + uint64 m_uiGauntletGate1GUID; + uint64 m_auiZigguratGUID[MAX_ZIGGURATS]; + uint64 m_auiRamsteinDoorGUID; + uint64 m_auiRivendareDoorGUID; + uint64 m_uiPortGauntletGUID; + uint64 m_uiPortSlaugtherGUID; + uint64 m_uiPortElderGUID; + + uint64 m_uiBaronGUID; + uint64 m_uiYsidaTriggerGUID; + uint64 m_uiAcolyteAnnouncerGUID; + uint64 m_auiCrystalSortedGUID[MAX_ZIGGURATS]; + + std::list m_lCrystals; + std::set m_sAbomnationGUID; + std::list m_lAcolytes; // done with pointers, to keep sorting easier + std::list m_alZigguratAcolyteGUID[MAX_ZIGGURATS]; +}; + +#endif diff --git a/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp b/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp new file mode 100644 index 0000000..acd76c2 --- /dev/null +++ b/scripts/eastern_kingdoms/sunken_temple/instance_sunken_temple.cpp @@ -0,0 +1,158 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_sunken_temple +SD%Complete: 30 +SDComment: +SDCategory: Sunken Temple +EndScriptData */ + +#include "precompiled.h" +#include "sunken_temple.h" + +instance_sunken_temple::instance_sunken_temple(Map* pMap) : ScriptedInstance(pMap), + m_uiJammalainBarrierGUID(0), + m_uiProtectorsRemaining(0) +{ + Initialize(); +} + +void instance_sunken_temple::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +} + +void instance_sunken_temple::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_JAMMALAIN_BARRIER: + m_uiJammalainBarrierGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + DoUseDoorOrButton(m_uiJammalainBarrierGUID); + break; + } + +} + +void instance_sunken_temple::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_ZOLO: + case NPC_GASHER: + case NPC_LORO: + case NPC_HUKKU: + case NPC_ZULLOR: + case NPC_MIJAN: + ++m_uiProtectorsRemaining; + break; + } +} + +void instance_sunken_temple::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_ATALARION: + m_auiEncounter[0] = uiData; + break; + case TYPE_PROTECTORS: + if (uiData == DONE) + { + //Jammalain should yell here about barrier being destroyed + --m_uiProtectorsRemaining; + if (!m_uiProtectorsRemaining) + { + m_auiEncounter[1] = uiData; + DoUseDoorOrButton(m_uiJammalainBarrierGUID); + } + } + break; + case TYPE_JAMMALAIN: + m_auiEncounter[2] = uiData; + break; + case TYPE_MALFURION: + m_auiEncounter[3] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_sunken_temple::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_sunken_temple::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_ATALARION: + return m_auiEncounter[0]; + case TYPE_PROTECTORS: + return m_auiEncounter[1]; + case TYPE_JAMMALAIN: + return m_auiEncounter[2]; + case TYPE_MALFURION: + return m_auiEncounter[3]; + } + return 0; +} + +InstanceData* GetInstanceData_instance_sunken_temple(Map* pMap) +{ + return new instance_sunken_temple(pMap); +} + +void AddSC_instance_sunken_temple() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_sunken_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_sunken_temple; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp b/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp new file mode 100644 index 0000000..ff185a5 --- /dev/null +++ b/scripts/eastern_kingdoms/sunken_temple/sunken_temple.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Sunken_Temple +SD%Complete: 100 +SDComment: Quest support: 8733 +SDCategory: Sunken Temple +EndScriptData */ + +/* ContentData +at_shade_of_eranikus +npc_malfurion_stormrage +EndContentData */ + +#include "precompiled.h" +#include "sunken_temple.h" + +enum +{ + QUEST_THE_CHARGE_OF_DRAGONFLIGHTS = 8555, + QUEST_ERANIKUS_TYRANT_OF_DREAMS = 8733 +}; + +bool AreaTrigger_at_shade_of_eranikus(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData()) + { + //Only do stuff, if the player has finished the PreQuest + if (pPlayer->GetQuestRewardStatus(QUEST_THE_CHARGE_OF_DRAGONFLIGHTS) && + !pPlayer->GetQuestRewardStatus(QUEST_ERANIKUS_TYRANT_OF_DREAMS) && + pPlayer->GetQuestStatus(QUEST_ERANIKUS_TYRANT_OF_DREAMS) != QUEST_STATUS_COMPLETE) + { + if (pInstance->GetData(TYPE_MALFURION) != DONE) + { + pPlayer->SummonCreature(NPC_MALFURION, -639.378723f, -4.238533f, -90.835098f, 2.724664f, TEMPSUMMON_DEAD_DESPAWN, 0); + pInstance->SetData(TYPE_MALFURION, DONE); + } + } + } + return false; +} + +/*###### +## npc_malfurion_stormrage +######*/ +enum +{ + EMOTE_MALFURION1 = -1109000, + SAY_MALFURION1 = -1109001, + SAY_MALFURION2 = -1109002, + SAY_MALFURION3 = -1109003, + SAY_MALFURION4 = -1109004, + + MAX_MALFURION_TEMPLE_SPEECHES = 6 +}; + +struct MANGOS_DLL_DECL npc_malfurionAI : public ScriptedAI +{ + npc_malfurionAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiSpeech = 0; + m_uiSayTimer = 0; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + } + + uint32 m_uiSayTimer; + uint32 m_uiSpeech; + + void Reset() {} + void UpdateAI(const uint32 uiDiff) + { + // we are in Sunken Temple + if (m_creature->GetMap()->IsDungeon()) + { + if (m_uiSpeech < MAX_MALFURION_TEMPLE_SPEECHES) + { + if (m_uiSayTimer <= uiDiff) + { + switch (m_uiSpeech) + { + case 0: + DoScriptText(EMOTE_MALFURION1, m_creature); + m_uiSayTimer = 1500; + break; + case 1: + m_creature->HandleEmote(EMOTE_ONESHOT_BOW); + m_uiSayTimer = 2000; + break; + case 2: + DoScriptText(SAY_MALFURION1, m_creature); + m_uiSayTimer = 1000; + break; + case 3: + DoScriptText(SAY_MALFURION2, m_creature); + m_uiSayTimer = 1000; + break; + case 4: + DoScriptText(SAY_MALFURION3, m_creature); + m_uiSayTimer = 2000; + break; + case 5: + DoScriptText(SAY_MALFURION4, m_creature); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + break; + } + + ++m_uiSpeech; + } + else + m_uiSayTimer -= uiDiff; + } + } + } +}; + +CreatureAI* GetAI_npc_malfurion(Creature* pCreature) +{ + return new npc_malfurionAI(pCreature); +} + +void AddSC_sunken_temple() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "at_shade_of_eranikus"; + newscript->pAreaTrigger = &AreaTrigger_at_shade_of_eranikus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_malfurion_stormrage"; + newscript->GetAI = &GetAI_npc_malfurion; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h b/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h new file mode 100644 index 0000000..c2d2481 --- /dev/null +++ b/scripts/eastern_kingdoms/sunken_temple/sunken_temple.h @@ -0,0 +1,74 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SUNKEN_TEMPLE_H +#define DEF_SUNKEN_TEMPLE_H + +enum +{ + MAX_ENCOUNTER = 4, + + TYPE_ATALARION = 1, + TYPE_PROTECTORS = 2, + TYPE_JAMMALAIN = 3, + TYPE_MALFURION = 4, + + NPC_ATALARION = 8580, + NPC_DREAMSCYTH = 5721, + NPC_WEAVER = 5720, + NPC_AVATAR_OF_HAKKAR = 8443, + NPC_SHADE_OF_ERANIKUS = 5709, + + // Jammalain min-bosses + NPC_ZOLO = 5712, + NPC_GASHER = 5713, + NPC_LORO = 5714, + NPC_HUKKU = 5715, + NPC_ZULLOR = 5716, + NPC_MIJAN = 5717, + + NPC_MALFURION = 15362, + + GO_ALTAR_OF_HAKKAR = 148836, + + GO_ATALAI_STATUE_1 = 148830, + GO_ATALAI_STATUE_2 = 148831, + GO_ATALAI_STATUE_3 = 148832, + GO_ATALAI_STATUE_4 = 148833, + GO_ATALAI_STATUE_5 = 148834, + GO_ATALAI_STATUE_6 = 148835, + + GO_ETERNAL_FLAME_1 = 148418, + GO_ETERNAL_FLAME_2 = 148419, + GO_ETERNAL_FLAME_3 = 148420, + GO_ETERNAL_FLAME_4 = 148421, + + GO_JAMMALAIN_BARRIER = 149431 +}; + +class MANGOS_DLL_DECL instance_sunken_temple : public ScriptedInstance +{ + public: + instance_sunken_temple(Map* pMap); + ~instance_sunken_temple() {} + + void Initialize(); + + void OnObjectCreate(GameObject* pGo); + void OnCreatureCreate(Creature* pCreature); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiJammalainBarrierGUID; + uint8 m_uiProtectorsRemaining; +}; +#endif diff --git a/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp b/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp new file mode 100644 index 0000000..9965cbd --- /dev/null +++ b/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Brutallus +SD%Complete: 50 +SDComment: Intro not made. Script for Madrigosa to be added here. +SDCategory: Sunwell Plateau +EndScriptData */ + +#include "precompiled.h" +#include "sunwell_plateau.h" + +enum Brutallus +{ + YELL_INTRO = -1580017, + YELL_INTRO_BREAK_ICE = -1580018, + YELL_INTRO_CHARGE = -1580019, + YELL_INTRO_KILL_MADRIGOSA = -1580020, + YELL_INTRO_TAUNT = -1580021, + + YELL_MADR_ICE_BARRIER = -1580031, + YELL_MADR_INTRO = -1580032, + YELL_MADR_ICE_BLOCK = -1580033, + YELL_MADR_TRAP = -1580034, + YELL_MADR_DEATH = -1580035, + + YELL_AGGRO = -1580022, + YELL_KILL1 = -1580023, + YELL_KILL2 = -1580024, + YELL_KILL3 = -1580025, + YELL_LOVE1 = -1580026, + YELL_LOVE2 = -1580027, + YELL_LOVE3 = -1580028, + YELL_BERSERK = -1580029, + YELL_DEATH = -1580030, + + SPELL_METEOR_SLASH = 45150, + SPELL_BURN = 45141, + SPELL_BURN_AURA_EFFECT = 46394, + SPELL_STOMP = 45185, + SPELL_BERSERK = 26662 +}; + +struct MANGOS_DLL_DECL boss_brutallusAI : public ScriptedAI +{ + boss_brutallusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiSlashTimer; + uint32 m_uiBurnTimer; + uint32 m_uiStompTimer; + uint32 m_uiBerserkTimer; + uint32 m_uiLoveTimer; + + void Reset() + { + m_uiSlashTimer = 11000; + m_uiStompTimer = 30000; + m_uiBurnTimer = 60000; + m_uiBerserkTimer = 360000; + m_uiLoveTimer = urand(10000, 17000); + + //TODO: correct me when pre-event implemented + if (m_pInstance) + m_pInstance->SetData(TYPE_BRUTALLUS, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(YELL_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BRUTALLUS, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(YELL_KILL1, m_creature); break; + case 1: DoScriptText(YELL_KILL2, m_creature); break; + case 2: DoScriptText(YELL_KILL3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(YELL_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BRUTALLUS, DONE); + } + + void SpellHitTarget(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_BURN) + pCaster->CastSpell(pCaster, SPELL_BURN_AURA_EFFECT, true, NULL, NULL, m_creature->GetGUID()); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiLoveTimer < uiDiff) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(YELL_LOVE1, m_creature); break; + case 1: DoScriptText(YELL_LOVE2, m_creature); break; + case 2: DoScriptText(YELL_LOVE3, m_creature); break; + } + m_uiLoveTimer = urand(15000, 23000); + } + else + m_uiLoveTimer -= uiDiff; + + if (m_uiSlashTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_METEOR_SLASH); + m_uiSlashTimer = 11000; + } + else + m_uiSlashTimer -= uiDiff; + + if (m_uiStompTimer < uiDiff) + { + if (Unit* pTarget = m_creature->getVictim()) + { + DoCastSpellIfCan(pTarget,SPELL_STOMP); + + if (pTarget->HasAura(SPELL_BURN_AURA_EFFECT, EFFECT_INDEX_0)) + pTarget->RemoveAurasDueToSpell(SPELL_BURN_AURA_EFFECT); + } + + m_uiStompTimer = 30000; + } + else + m_uiStompTimer -= uiDiff; + + if (m_uiBurnTimer < uiDiff) + { + //returns any unit + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + //so we get owner, in case unit was pet/totem/etc + if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) + DoCastSpellIfCan(pPlayer, SPELL_BURN); + } + + m_uiBurnTimer = 60000; + } + else + m_uiBurnTimer -= uiDiff; + + if (m_uiBerserkTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature,SPELL_BERSERK) == CAST_OK) + { + DoScriptText(YELL_BERSERK, m_creature); + m_uiBerserkTimer = 20000; + } + } + else + m_uiBerserkTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_brutallus(Creature* pCreature) +{ + return new boss_brutallusAI(pCreature); +} + +bool AreaTrigger_at_madrigosa(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData()) + { + //this simply set encounter state, and trigger ice barrier become active + //bosses can start pre-event based on this new state + if (pInstance->GetData(TYPE_BRUTALLUS) == NOT_STARTED) + pInstance->SetData(TYPE_BRUTALLUS, SPECIAL); + } + + return false; +} + +void AddSC_boss_brutallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_brutallus"; + newscript->GetAI = &GetAI_boss_brutallus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_madrigosa"; + newscript->pAreaTrigger = &AreaTrigger_at_madrigosa; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp b/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp new file mode 100644 index 0000000..a27705e --- /dev/null +++ b/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp @@ -0,0 +1,622 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kalecgos +SD%Complete: 40 +SDComment: Script must be considered not complete. +SDCategory: Sunwell Plateau +EndScriptData */ + +#include "precompiled.h" +#include "sunwell_plateau.h" + +enum KalecgosEncounter +{ + //kalecgos dragon form + SAY_EVIL_AGGRO = -1580000, + SAY_EVIL_SPELL1 = -1580001, + SAY_EVIL_SPELL2 = -1580002, + SAY_EVIL_SLAY1 = -1580003, + SAY_EVIL_SLAY2 = -1580004, + SAY_EVIL_ENRAGE = -1580005, + + //kalecgos humanoid form + SAY_GOOD_AGGRO = -1580006, + SAY_GOOD_NEAR_DEATH = -1580007, + SAY_GOOD_NEAR_DEATH2 = -1580008, + SAY_GOOD_PLRWIN = -1580009, + + SAY_SATH_AGGRO = -1580010, + SAY_SATH_DEATH = -1580011, + SAY_SATH_SPELL1 = -1580012, + SAY_SATH_SPELL2 = -1580013, + SAY_SATH_SLAY1 = -1580014, + SAY_SATH_SLAY2 = -1580015, + SAY_SATH_ENRAGE = -1580016, + + //Kalecgos + SPELL_SPECTRAL_BLAST_DUMMY = 44869, + SPELL_SPECTRAL_BLAST = 44866, + + SPELL_ARCANE_BUFFET = 45018, + SPELL_FROST_BREATH = 44799, + SPELL_HEROIC_STRIKE = 45026, + SPELL_REVITALIZE = 45027, + SPELL_TAIL_LASH = 45122, + SPELL_TRANSFORM_KALEC = 45027, + SPELL_CRAZED_RAGE = 44806, // this should be 44807 instead + + //Sathrovarr + SPELL_SPECTRAL_INVIS = 44801, + SPELL_CORRUPTING_STRIKE = 45029, + SPELL_CURSE_OF_BOUNDLESS_AGONY = 45032, + SPELL_SHADOW_BOLT_VOLLEY = 45031, + + //Misc + SPELL_BANISH = 44836 +}; + +uint32 WildMagic[]= { 44978, 45001, 45002, 45004, 45006, 45010 }; + +const float KALECGOS_ARENA[3] = { 1704.34f, 928.17f, 53.08f }; + +//#define NOTIFY_SPECTRALLY_EXHAUSTED "Your body is too exhausted to travel to the Spectral Realm." + +struct MANGOS_DLL_DECL boss_kalecgosAI : public ScriptedAI +{ + boss_kalecgosAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + /*if (pCreature->getFaction() != 14) + { + error_db_log("SD2: creature entry %u has faction %u but spellId %u requires different.", pCreature->GetEntry(), pCreature->getFaction(), SPELL_SPECTRAL_REALM_FORCE_FACTION); + pCreature->setFaction(14); + }*/ + + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiArcaneBuffetTimer; + uint32 m_uiFrostBreathTimer; + uint32 m_uiWildMagicTimer; + uint32 m_uiSpectralBlastTimer; + uint32 m_uiExitTimer; + + bool m_bUncorrupted; + bool m_bBanished; + bool m_bChecked; + bool m_bEnraged; + bool m_bHasSpectralTarget; + + void Reset() + { + m_uiArcaneBuffetTimer = 8000; + m_uiFrostBreathTimer = 24000; + m_uiWildMagicTimer = 18000; + m_uiSpectralBlastTimer = 30000; + + m_uiExitTimer = 0; + + m_bUncorrupted = false; + m_bBanished = false; + m_bChecked = false; + m_bEnraged = false; + m_bHasSpectralTarget = false; + } + + void JustReachedHome() + { + if (m_pInstance) + { + // Reset Sathrovarr too + if (Creature* pSath = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SATHROVARR))) + { + if (pSath->isAlive() && pSath->getVictim()) + pSath->AI()->EnterEvadeMode(); + } + + m_pInstance->SetData(TYPE_KALECGOS, NOT_STARTED); + } + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_EVIL_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KALECGOS, IN_PROGRESS); + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && done_by != m_creature) + { + if (!m_bUncorrupted) + { + damage = 0; + m_bBanished = true; + DoCastSpellIfCan(m_creature, SPELL_BANISH, true); + m_creature->GetMotionMaster()->MoveIdle(); + } + else + { + damage = 0; + BeginOutro(); + } + } + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_EVIL_SLAY1 : SAY_EVIL_SLAY2, m_creature); + } + + void SendToInnerVeil(Unit* pTarget) + { + if (m_pInstance) + { + //just a hack for not implemented spell effect 144 + ((Player*)pTarget)->TeleportTo(pTarget->GetMapId(), pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ()-125.0f, pTarget->GetOrientation()); + + pTarget->CastSpell(pTarget, SPELL_SPECTRAL_REALM_FORCE_FACTION, true); + pTarget->CastSpell(pTarget, SPELL_SPECTRAL_REALM, true); + + m_pInstance->SetData64(DATA_PLAYER_SPECTRAL_REALM, pTarget->GetGUID()); + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_SPECTRAL_BLAST_DUMMY && !m_bHasSpectralTarget) + { + if (pTarget->GetTypeId() != TYPEID_PLAYER) + return; + + if (pTarget->HasAura(SPELL_SPECTRAL_EXHAUSTION, EFFECT_INDEX_0) || pTarget->HasAura(SPELL_SPECTRAL_REALM)) + return; + + if (pTarget == m_creature->getVictim()) + return; + + m_bHasSpectralTarget = true; + pTarget->CastSpell(pTarget, SPELL_SPECTRAL_BLAST, true); + + SendToInnerVeil(pTarget); + } + } + + void BeginOutro() + { + debug_log("SD2: KALEC: Beginning Outro"); + + if (!m_pInstance) + return; + + if (Creature* pSathrovarr = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SATHROVARR))) + { + if (pSathrovarr->isAlive()) + { + pSathrovarr->NearTeleportTo(KALECGOS_ARENA[0], KALECGOS_ARENA[1], KALECGOS_ARENA[2], 0.0f); + pSathrovarr->DealDamage(pSathrovarr, pSathrovarr->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if (Creature* pKalec = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_KALECGOS_HUMAN))) + { + pKalec->DeleteThreatList(); + pKalec->SetVisibility(VISIBILITY_OFF); + } + + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->setFaction(35); + DoScriptText(SAY_GOOD_PLRWIN, m_creature); + m_uiExitTimer = 1000; + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_KALECGOS, DONE); + + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->getVictim() || !m_creature->SelectHostileTarget() || m_bBanished) + return; + + if (!m_bEnraged && m_creature->GetHealthPercent() < 10.0f) + { + if (Creature* pSathrovarr = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SATHROVARR))) + { + if (pSathrovarr->isAlive()) + pSathrovarr->CastSpell(pSathrovarr, SPELL_CRAZED_RAGE, true); + } + + m_creature->CastSpell(m_creature, SPELL_CRAZED_RAGE, true); + m_bEnraged = true; + } + + if (!m_bChecked && m_creature->GetHealthPercent() < 1.0f) + { + m_bChecked = true; + + if (!m_bUncorrupted) + { + m_bBanished = true; + DoCastSpellIfCan(m_creature, SPELL_BANISH, true); + m_creature->GetMotionMaster()->MoveIdle(); + } + else + BeginOutro(); + } + + if (m_uiExitTimer) + { + if (m_uiExitTimer <= diff) + { + debug_log("SD2: KALEC: Exiting the arena"); + + float x, y, z; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 30, x, y, z); + + z = 70.0f; + + m_creature->GetMotionMaster()->MovePoint(1, x, y, z); + m_uiExitTimer = 0; + }else m_uiExitTimer -= diff; + } + + if (m_uiArcaneBuffetTimer < diff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_BUFFET) == CAST_OK) + { + if (!urand(0, 2)) + DoScriptText(SAY_EVIL_SPELL1, m_creature); + + m_uiArcaneBuffetTimer = 20000; + } + } + else + m_uiArcaneBuffetTimer -= diff; + + if (m_uiFrostBreathTimer < diff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_BREATH) == CAST_OK) + { + if (!urand(0, 1)) + DoScriptText(SAY_EVIL_SPELL2, m_creature); + + m_uiFrostBreathTimer = 25000; + } + } + else + m_uiFrostBreathTimer -= diff; + + if (m_uiWildMagicTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, WildMagic[rand()%6]); + + m_uiWildMagicTimer = 19000; + } + else + m_uiWildMagicTimer -= diff; + + if (m_uiSpectralBlastTimer < diff) + { + m_bHasSpectralTarget = false; + m_creature->CastSpell(m_creature, SPELL_SPECTRAL_BLAST_DUMMY, false); + m_uiSpectralBlastTimer = 30000; + } + else + m_uiSpectralBlastTimer -= diff; + + if (!m_bBanished) + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_sathrovarrAI : public ScriptedAI +{ + boss_sathrovarrAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 CorruptingStrikeTimer; + uint32 CurseOfBoundlessAgonyTimer; + uint32 ShadowBoltVolleyTimer; + bool m_bBanished; + bool m_bEnraged; + + void Reset() + { + // FIXME: Timers + CorruptingStrikeTimer = 5000; + CurseOfBoundlessAgonyTimer = 15000; + ShadowBoltVolleyTimer = 10000; + + m_bBanished = false; + m_bEnraged = false; + + m_creature->CastSpell(m_creature, SPELL_SPECTRAL_INVIS, true); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_SATH_AGGRO, m_creature); + + if (!m_pInstance) + return; + + if (Creature* pKalec = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_KALECGOS_HUMAN))) + { + m_creature->AddThreat(pKalec, 10000000.0f); + pKalec->AddThreat(m_creature, 10000000.0f); + } + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth()) + { + damage = 0; + DoCastSpellIfCan(m_creature, SPELL_BANISH, CAST_TRIGGERED); + m_bBanished = true; + + DoScriptText(SAY_SATH_DEATH, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(DATA_SET_SPECTRAL_CHECK, 5000); + + if (Creature* pKalecgos = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_KALECGOS_DRAGON))) + { + if (boss_kalecgosAI* pKalecgosAI = dynamic_cast(pKalecgos->AI())) + { + pKalecgosAI->m_bChecked = false; + pKalecgosAI->m_bUncorrupted = true; + } + } + } + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SATH_SLAY1 : SAY_SATH_SLAY2, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->getVictim() || !m_creature->SelectHostileTarget() || m_bBanished) + return; + + if (!m_bEnraged && m_creature->GetHealthPercent() < 10.0f) + { + if (Creature* pKalecgos = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_KALECGOS_DRAGON))) + { + if (pKalecgos->isAlive()) + pKalecgos->CastSpell(pKalecgos, SPELL_CRAZED_RAGE, true); + } + + m_creature->CastSpell(m_creature, SPELL_CRAZED_RAGE, true); + m_bEnraged = true; + } + + if (CorruptingStrikeTimer < diff) + { + if (!urand(0, 1)) + DoScriptText(SAY_SATH_SPELL2, m_creature); + + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CORRUPTING_STRIKE); + CorruptingStrikeTimer = 13000; + }else CorruptingStrikeTimer -= diff; + + if (CurseOfBoundlessAgonyTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_CURSE_OF_BOUNDLESS_AGONY); + + CurseOfBoundlessAgonyTimer = 35000; + }else CurseOfBoundlessAgonyTimer -= diff; + + if (ShadowBoltVolleyTimer < diff) + { + if (!urand(0, 1)) + DoScriptText(SAY_SATH_SPELL1, m_creature); + + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); + ShadowBoltVolleyTimer = 15000; + }else ShadowBoltVolleyTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_kalecgos_humanoidAI : public ScriptedAI +{ + boss_kalecgos_humanoidAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 RevitalizeTimer; + uint32 HeroicStrikeTimer; + + bool HasYelled10Percent; + bool HasYelled20Percent; + + void Reset() + { + //TODO: Times! + RevitalizeTimer = 30000; + HeroicStrikeTimer = 8000; + + HasYelled10Percent = false; + HasYelled20Percent = false; + + m_creature->CastSpell(m_creature, SPELL_SPECTRAL_INVIS, true); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_GOOD_AGGRO, m_creature); + } + + void JustDied(Unit* killer) + { + // Whatever happens when Kalec (Half-elf) dies + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + return; + + if (RevitalizeTimer < diff) + { + if (m_pInstance) + { + /*Player* pPlayer = m_creature->GetMap()->GetPlayer(m_pInstance->GetData64(DATA_RANDOM_SPECTRAL_PLAYER)); + if (pPlayer) + DoCastSpellIfCan(pPlayer, SPELL_REVITALIZE);*/ + RevitalizeTimer = 30000; + } + }else RevitalizeTimer -= diff; + + if (HeroicStrikeTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HEROIC_STRIKE); + HeroicStrikeTimer = 30000; + }else HeroicStrikeTimer -= diff; + + if (m_creature->GetHealthPercent() < 20.0f && !HasYelled20Percent) + { + DoScriptText(SAY_GOOD_NEAR_DEATH, m_creature); + HasYelled20Percent = true; + } + + if (m_creature->GetHealthPercent() < 10.0f && !HasYelled10Percent) + { + DoScriptText(SAY_GOOD_NEAR_DEATH2, m_creature); + HasYelled10Percent = true; + } + } +}; + +bool GOHello_go_spectral_rift(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() != GAMEOBJECT_TYPE_GOOBER) + return true; + + if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData()) + { + if (pPlayer->HasAura(SPELL_SPECTRAL_EXHAUSTION, EFFECT_INDEX_0)) + return true; + + // Make them able to see Sathrovarr (he's invisible for some reason). Also, when this buff wears off, they get teleported back to Normal Realm (this is handled by Instance Script) + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_TO_SPECTRAL_REALM, true); + pPlayer->CastSpell(pPlayer, SPELL_SPECTRAL_REALM_FORCE_FACTION, true); + pPlayer->CastSpell(pPlayer, SPELL_SPECTRAL_REALM, true); + + // Add player to pSath's threat list + /*if (Creature* pSath = pInstance->instance->GetCreature(pInstance->GetData64(DATA_KALECGOS_DRAGON))) + { + if (pSath->isAlive()) + { + debug_log("SD2: Adding %s in pSath' threatlist", pPlayer->GetName()); + pSath->AddThreat(pPlayer); + } + } + + // Remove player from Sathrovarr's threat list + if (Creature* pKalecgos = pInstance->instance->GetCreature(pInstance->GetData64(DATA_SATHROVARR))) + { + if (pKalecgos->isAlive()) + { + if (HostileReference* pRef = pKalecgos->getThreatManager().getOnlineContainer().getReferenceByTarget(pPlayer)) + { + pRef->removeReference(); + debug_log("SD2: Deleting %s from pKalecgos's threatlist", pPlayer->GetName()); + } + } + }*/ + + pInstance->SetData64(DATA_PLAYER_SPECTRAL_REALM, pPlayer->GetGUID()); + } + + return true; +} + +CreatureAI* GetAI_boss_kalecgos(Creature* pCreature) +{ + return new boss_kalecgosAI(pCreature); +} + +CreatureAI* GetAI_boss_sathrovarr(Creature* pCreature) +{ + return new boss_sathrovarrAI(pCreature); +} + +CreatureAI* GetAI_boss_kalecgos_humanoid(Creature* pCreature) +{ + return new boss_kalecgos_humanoidAI(pCreature); +} + +void AddSC_boss_kalecgos() +{ + Script* newscript; + + newscript = new Script; + newscript->GetAI = &GetAI_boss_kalecgos; + newscript->Name = "boss_kalecgos"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_sathrovarr; + newscript->Name = "boss_sathrovarr"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->GetAI = &GetAI_boss_kalecgos_humanoid; + newscript->Name = "boss_kalecgos_humanoid"; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->pGOHello = &GOHello_go_spectral_rift; + newscript->Name = "go_spectral_rift"; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp b/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp new file mode 100644 index 0000000..8f5ddbc --- /dev/null +++ b/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp @@ -0,0 +1,377 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +/* ScriptData +SDName: Instance_Sunwell_Plateau +SD%Complete: 70% +SDComment: +SDCategory: Sunwell_Plateau +EndScriptData */ + +#include "precompiled.h" +#include "sunwell_plateau.h" + +/* Sunwell Plateau: +0 - Kalecgos and Sathrovarr +1 - Brutallus +2 - Felmyst +3 - Eredar Twins (Alythess and Sacrolash) +4 - M'uru +5 - Kil'Jaeden +*/ + +struct MANGOS_DLL_DECL instance_sunwell_plateau : public ScriptedInstance +{ + instance_sunwell_plateau(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + // Creatures + uint64 m_uiKalecgos_DragonGUID; + uint64 m_uiKalecgos_HumanGUID; + uint64 m_uiSathrovarrGUID; + uint64 m_uiBrutallusGUID; + uint64 m_uiFelmystGUID; + uint64 m_uiAlythessGUID; + uint64 m_uiSacrolashGUID; + uint64 m_uiMuruGUID; + uint64 m_uiKilJaedenGUID; + uint64 m_uiKilJaedenControllerGUID; + uint64 m_uiAnveenaGUID; + uint64 m_uiKalecgosGUID; + + // GameObjects + uint64 m_uiForceFieldGUID; // Kalecgos Encounter + uint64 m_uiBossCollision1GUID; + uint64 m_uiBossCollision2GUID; + uint64 m_uiIceBarrierGUID; // Brutallus Encounter + uint64 m_uiDoorFireBarrierGUID; + uint64 m_uiDoorTheFirstGateGUID; // Felmyst Encounter + uint64 m_uiDoorTheSecondGateGUID; // Alythess Encounter + uint64 m_uiDoorRaid_Gate_07GUID; // Sacrolash Encounter + uint64 m_uiDoorRaid_Gate_08GUID; // Muru Encounter + uint64 m_uiDoorTheThirdGateGUID; // Entropius Encounter + + // Misc + uint32 m_uiSpectralRealmTimer; + std::list SpectralRealmList; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + // Creatures + m_uiKalecgos_DragonGUID = 0; + m_uiKalecgos_HumanGUID = 0; + m_uiSathrovarrGUID = 0; + m_uiBrutallusGUID = 0; + m_uiFelmystGUID = 0; + m_uiAlythessGUID = 0; + m_uiSacrolashGUID = 0; + m_uiMuruGUID = 0; + m_uiKilJaedenGUID = 0; + m_uiKilJaedenControllerGUID = 0; + m_uiAnveenaGUID = 0; + m_uiKalecgosGUID = 0; + + // GameObjects + m_uiForceFieldGUID = 0; + m_uiBossCollision1GUID = 0; + m_uiBossCollision2GUID = 0; + m_uiIceBarrierGUID = 0; + m_uiDoorFireBarrierGUID = 0; + m_uiDoorTheFirstGateGUID = 0; + m_uiDoorTheSecondGateGUID = 0; + m_uiDoorRaid_Gate_07GUID = 0; + m_uiDoorRaid_Gate_08GUID = 0; + m_uiDoorTheThirdGateGUID = 0; + + // Misc + m_uiSpectralRealmTimer = 5000; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 24850: m_uiKalecgos_DragonGUID = pCreature->GetGUID(); break; + case 24891: m_uiKalecgos_HumanGUID = pCreature->GetGUID(); break; + case 24892: m_uiSathrovarrGUID = pCreature->GetGUID(); break; + case 24882: m_uiBrutallusGUID = pCreature->GetGUID(); break; + case 25038: m_uiFelmystGUID = pCreature->GetGUID(); break; + case 25166: m_uiAlythessGUID = pCreature->GetGUID(); break; + case 25165: m_uiSacrolashGUID = pCreature->GetGUID(); break; + case 25741: m_uiMuruGUID = pCreature->GetGUID(); break; + case 25315: m_uiKilJaedenGUID = pCreature->GetGUID(); break; + case 25608: m_uiKilJaedenControllerGUID = pCreature->GetGUID(); break; + case 26046: m_uiAnveenaGUID = pCreature->GetGUID(); break; + case 25319: m_uiKalecgosGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 188421: + m_uiForceFieldGUID = pGo->GetGUID(); + break; + case 188523: + m_uiBossCollision1GUID = pGo->GetGUID(); + break; + case 188524: + m_uiBossCollision2GUID = pGo->GetGUID(); + break; + case 188119: + m_uiIceBarrierGUID = pGo->GetGUID(); + break; + case 188075: + m_uiDoorFireBarrierGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE && m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 187766: + m_uiDoorTheFirstGateGUID = pGo->GetGUID(); + break; + case 187764: + m_uiDoorTheSecondGateGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 187990: + m_uiDoorRaid_Gate_07GUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 188118: + m_uiDoorRaid_Gate_08GUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 187765: + m_uiDoorTheThirdGateGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_KALECGOS: return m_auiEncounter[0]; + case TYPE_BRUTALLUS: return m_auiEncounter[1]; + case TYPE_FELMYST: return m_auiEncounter[2]; + case TYPE_EREDAR_TWINS: return m_auiEncounter[3]; + case TYPE_MURU: return m_auiEncounter[4]; + case TYPE_KILJAEDEN: return m_auiEncounter[5]; + } + + return 0; + } + + uint64 GetData64(uint32 id) + { + switch(id) + { + case DATA_KALECGOS_DRAGON: return m_uiKalecgos_DragonGUID; + case DATA_KALECGOS_HUMAN: return m_uiKalecgos_HumanGUID; + case DATA_SATHROVARR: return m_uiSathrovarrGUID; + case DATA_BRUTALLUS: return m_uiBrutallusGUID; + case DATA_FELMYST: return m_uiFelmystGUID; + case DATA_ALYTHESS: return m_uiAlythessGUID; + case DATA_SACROLASH: return m_uiSacrolashGUID; + case DATA_MURU: return m_uiMuruGUID; + case DATA_KILJAEDEN: return m_uiKilJaedenGUID; + case DATA_KILJAEDEN_CONTROLLER: return m_uiKilJaedenControllerGUID; + case DATA_ANVEENA: return m_uiAnveenaGUID; + case DATA_KALECGOS: return m_uiKalecgosGUID; + case DATA_GO_FORCEFIELD: return m_uiForceFieldGUID; + } + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_KALECGOS: + if (uiData == IN_PROGRESS) + SpectralRealmList.clear(); + + DoUseDoorOrButton(m_uiForceFieldGUID); + DoUseDoorOrButton(m_uiBossCollision1GUID); + DoUseDoorOrButton(m_uiBossCollision2GUID); + + m_auiEncounter[0] = uiData; + break; + case TYPE_BRUTALLUS: + if (uiData == SPECIAL) + DoUseDoorOrButton(m_uiIceBarrierGUID,MINUTE); + + m_auiEncounter[1] = uiData; + break; + case TYPE_FELMYST: + m_auiEncounter[2] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiDoorFireBarrierGUID); + break; + case TYPE_EREDAR_TWINS: + m_auiEncounter[3] = uiData; + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiDoorTheSecondGateGUID); + DoUseDoorOrButton(m_uiDoorRaid_Gate_07GUID); + } + break; + case TYPE_MURU: + m_auiEncounter[4] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiDoorRaid_Gate_08GUID); + break; + case TYPE_KILJAEDEN: m_auiEncounter[5] = uiData; break; + case DATA_SET_SPECTRAL_CHECK: m_uiSpectralRealmTimer = uiData; break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + void SetData64(uint32 uiData, uint64 uiGuid) + { + if (uiData == DATA_PLAYER_SPECTRAL_REALM) + SpectralRealmList.push_back(uiGuid); + } + + void EjectPlayer(Player* pPlayer) + { + debug_log("SD2: Ejecting Player %s from Spectral Realm", pPlayer->GetName()); + + // Put player back in Kalecgos(Dragon)'s threat list + /*if (Creature* pKalecgos = instance->GetCreature(m_uiKalecgos_DragonGUID)) + { + if (pKalecgos->isAlive()) + { + debug_log("SD2: Adding %s in Kalecgos' threatlist", pPlayer->GetName()); + pKalecgos->AddThreat(pPlayer); + } + } + + // Remove player from Sathrovarr's threat list + if (Creature* pSath = instance->GetCreature(m_uiSathrovarrGUID)) + { + if (pSath->isAlive()) + { + if (HostileReference* pRef = pSath->getThreatManager().getOnlineContainer().getReferenceByTarget(pPlayer)) + { + pRef->removeReference(); + debug_log("SD2: Deleting %s from Sathrovarr's threatlist", pPlayer->GetName()); + } + } + }*/ + + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_NORMAL_REALM, true); + pPlayer->CastSpell(pPlayer, SPELL_SPECTRAL_EXHAUSTION, true); + } + + void EjectPlayers() + { + if (SpectralRealmList.empty()) + return; + + Map::PlayerList const& players = instance->GetPlayers(); + + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + Player* plr = itr->getSource(); + + if (plr && !plr->HasAura(SPELL_SPECTRAL_REALM)) + { + SpectralRealmList.remove(plr->GetGUID()); + EjectPlayer(plr); + } + } + + //SpectralRealmList.clear(); + } + + void Update(uint32 uiDiff) + { + // Only check for Spectral Realm if Kalecgos Encounter is running + if (m_auiEncounter[0] == IN_PROGRESS) + { + if (m_uiSpectralRealmTimer <= uiDiff) + { + EjectPlayers(); + m_uiSpectralRealmTimer = 1000; + } + else + m_uiSpectralRealmTimer -= uiDiff; + } + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> + m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_sunwell_plateau(Map* pMap) +{ + return new instance_sunwell_plateau(pMap); +} + +void AddSC_instance_sunwell_plateau() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sunwell_plateau"; + newscript->GetInstanceData = &GetInstanceData_instance_sunwell_plateau; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h b/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h new file mode 100644 index 0000000..e27c078 --- /dev/null +++ b/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.h @@ -0,0 +1,49 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SUNWELLPLATEAU_H +#define DEF_SUNWELLPLATEAU_H + +enum InstanceSWP +{ + MAX_ENCOUNTER = 6, + + TYPE_KALECGOS = 0, + TYPE_BRUTALLUS = 1, + TYPE_FELMYST = 2, + TYPE_EREDAR_TWINS = 3, + TYPE_MURU = 4, + TYPE_KILJAEDEN = 5, + + DATA_KALECGOS_DRAGON = 6, + DATA_KALECGOS_HUMAN = 7, + DATA_SATHROVARR = 8, + DATA_BRUTALLUS = 9, + DATA_FELMYST = 10, + DATA_ALYTHESS = 11, + DATA_SACROLASH = 12, + DATA_MURU = 13, + DATA_KILJAEDEN = 14, + DATA_KILJAEDEN_CONTROLLER = 15, + DATA_ANVEENA = 16, + DATA_KALECGOS = 17, + + DATA_GO_FORCEFIELD = 18, + DATA_GO_FIRE_BARRIER = 19, + DATA_GO_FIRST_GATE = 20, + DATA_GO_SECOND_GATE = 21, + DATA_GO_RAID_GATE_07 = 22, + DATA_GO_RAID_GATE_08 = 23, + DATA_GO_THIRD_GATE = 24, + + DATA_PLAYER_SPECTRAL_REALM = 25, + DATA_SET_SPECTRAL_CHECK = 26, + + SPELL_SPECTRAL_REALM = 46021, + SPELL_TELEPORT_NORMAL_REALM = 46020, + SPELL_TELEPORT_TO_SPECTRAL_REALM = 46019, + SPELL_SPECTRAL_EXHAUSTION = 44867, + SPELL_SPECTRAL_REALM_FORCE_FACTION = 44852 +}; +#endif diff --git a/scripts/eastern_kingdoms/swamp_of_sorrows.cpp b/scripts/eastern_kingdoms/swamp_of_sorrows.cpp new file mode 100644 index 0000000..ee8e1f9 --- /dev/null +++ b/scripts/eastern_kingdoms/swamp_of_sorrows.cpp @@ -0,0 +1,165 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Swamp_of_Sorrows +SD%Complete: 100 +SDComment: Quest support: 1393 +SDCategory: Swap of Sorrows +EndScriptData */ + +/* ContentData +npc_galen_goodward +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_galen_goodward +######*/ + +enum Galen +{ + QUEST_GALENS_ESCAPE = 1393, + + GO_GALENS_CAGE = 37118, + + SAY_PERIODIC = -1000582, + SAY_QUEST_ACCEPTED = -1000583, + SAY_ATTACKED_1 = -1000584, + SAY_ATTACKED_2 = -1000585, + SAY_QUEST_COMPLETE = -1000586, + EMOTE_WHISPER = -1000587, + EMOTE_DISAPPEAR = -1000588 +}; + +struct MANGOS_DLL_DECL npc_galen_goodwardAI : public npc_escortAI +{ + npc_galen_goodwardAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiGalensCageGUID = 0; + Reset(); + } + + uint64 m_uiGalensCageGUID; + uint32 m_uiPeriodicSay; + + void Reset() + { + m_uiPeriodicSay = 6000; + } + + void Aggro(Unit* pWho) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + DoScriptText(urand(0, 1) ? SAY_ATTACKED_1 : SAY_ATTACKED_2, m_creature, pWho); + } + + void WaypointStart(uint32 uiPointId) + { + switch (uiPointId) + { + case 0: + { + GameObject* pCage = NULL; + if (m_uiGalensCageGUID) + pCage = m_creature->GetMap()->GetGameObject(m_uiGalensCageGUID); + else + pCage = GetClosestGameObjectWithEntry(m_creature, GO_GALENS_CAGE, INTERACTION_DISTANCE); + if (pCage) + { + pCage->UseDoorOrButton(); + m_uiGalensCageGUID = pCage->GetGUID(); + } + break; + } + case 21: + DoScriptText(EMOTE_DISAPPEAR, m_creature); + break; + } + } + + void WaypointReached(uint32 uiPointId) + { + switch (uiPointId) + { + case 0: + if (GameObject* pCage = m_creature->GetMap()->GetGameObject(m_uiGalensCageGUID)) + pCage->ResetDoorOrButton(); + break; + case 20: + if (Player* pPlayer = GetPlayerForEscort()) + { + m_creature->SetFacingToObject(pPlayer); + DoScriptText(SAY_QUEST_COMPLETE, m_creature, pPlayer); + DoScriptText(EMOTE_WHISPER, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_GALENS_ESCAPE, m_creature); + } + SetRun(true); + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + + if (m_uiPeriodicSay < uiDiff) + { + if (HasEscortState(STATE_ESCORT_NONE)) + DoScriptText(SAY_PERIODIC, m_creature); + m_uiPeriodicSay = 6000; + } + else + m_uiPeriodicSay -= uiDiff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_galen_goodward(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_GALENS_ESCAPE) + { + + if (npc_galen_goodwardAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + DoScriptText(SAY_QUEST_ACCEPTED, pCreature); + } + } + return true; +} + +CreatureAI* GetAI_npc_galen_goodward(Creature* pCreature) +{ + return new npc_galen_goodwardAI(pCreature); +} + +void AddSC_swamp_of_sorrows() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_galen_goodward"; + newscript->GetAI = &GetAI_npc_galen_goodward; + newscript->pQuestAccept = &QuestAccept_npc_galen_goodward; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/tirisfal_glades.cpp b/scripts/eastern_kingdoms/tirisfal_glades.cpp new file mode 100644 index 0000000..2ccad8e --- /dev/null +++ b/scripts/eastern_kingdoms/tirisfal_glades.cpp @@ -0,0 +1,208 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Tirisfal_Glades +SD%Complete: 100 +SDComment: Quest support: 590, 1819 +SDCategory: Tirisfal Glades +EndScriptData */ + +/* ContentData +go_mausoleum_door +go_mausoleum_trigger +npc_calvin_montague +EndContentData */ + +#include "precompiled.h" + +/*###### +## go_mausoleum_door +## go_mausoleum_trigger +######*/ + +enum +{ + QUEST_ULAG = 1819, + NPC_ULAG = 6390, + GO_TRIGGER = 104593, + GO_DOOR = 176594 +}; + +bool GOHello_go_mausoleum_door(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) + return false; + + if (GameObject* pTrigger = GetClosestGameObjectWithEntry(pPlayer, GO_TRIGGER, 30.0f)) + { + pTrigger->SetGoState(GO_STATE_READY); + pPlayer->SummonCreature(NPC_ULAG, 2390.26f, 336.47f, 40.01f, 2.26f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + return false; + } + + return false; +} + +bool GOHello_go_mausoleum_trigger(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_ULAG) != QUEST_STATUS_INCOMPLETE) + return false; + + if (GameObject* pDoor = GetClosestGameObjectWithEntry(pPlayer, GO_DOOR, 30.0f)) + { + pGo->SetGoState(GO_STATE_ACTIVE); + pDoor->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_INTERACT_COND); + return true; + } + + return false; +} + +/*###### +## npc_calvin_montague +######*/ + +enum +{ + SAY_COMPLETE = -1000356, + SPELL_DRINK = 2639, // possibly not correct spell (but iconId is correct) + QUEST_590 = 590, + FACTION_HOSTILE = 168 +}; + +struct MANGOS_DLL_DECL npc_calvin_montagueAI : public ScriptedAI +{ + npc_calvin_montagueAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormFaction; + uint32 m_uiPhase; + uint32 m_uiPhaseTimer; + uint64 m_uiPlayerGUID; + + void Reset() + { + m_uiPhase = 0; + m_uiPhaseTimer = 5000; + m_uiPlayerGUID = 0; + + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim() || m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || ((m_creature->GetHealth() - uiDamage)*100 / m_creature->GetMaxHealth() < 15)) + { + uiDamage = 0; + + m_creature->setFaction(m_uiNormFaction); + m_creature->CombatStop(true); + + m_uiPhase = 1; + + if (pDoneBy->GetTypeId() == TYPEID_PLAYER) + m_uiPlayerGUID = pDoneBy->GetGUID(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiPhase) + { + if (m_uiPhaseTimer < uiDiff) + m_uiPhaseTimer = 7500; + else + { + m_uiPhaseTimer -= uiDiff; + return; + } + + switch(m_uiPhase) + { + case 1: + DoScriptText(SAY_COMPLETE, m_creature); + ++m_uiPhase; + break; + case 2: + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + pPlayer->AreaExploredOrEventHappens(QUEST_590); + + m_creature->CastSpell(m_creature,SPELL_DRINK,true); + ++m_uiPhase; + break; + case 3: + EnterEvadeMode(); + break; + } + + return; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_calvin_montague(Creature* pCreature) +{ + return new npc_calvin_montagueAI(pCreature); +} + +bool QuestAccept_npc_calvin_montague(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_590) + { + pCreature->setFaction(FACTION_HOSTILE); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +void AddSC_tirisfal_glades() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_mausoleum_door"; + newscript->pGOHello = &GOHello_go_mausoleum_door; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_mausoleum_trigger"; + newscript->pGOHello = &GOHello_go_mausoleum_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_calvin_montague"; + newscript->GetAI = &GetAI_npc_calvin_montague; + newscript->pQuestAccept = &QuestAccept_npc_calvin_montague; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp b/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp new file mode 100644 index 0000000..913b6dc --- /dev/null +++ b/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp @@ -0,0 +1,244 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Archaedas +SD%Complete: 60 +SDComment: Need correct way to deal with awaken vault and guardian spells, waiting for additions in mangos for them (target combination 22/7) +SDCategory: Uldaman +EndScriptData */ + +#include "precompiled.h" +#include "uldaman.h" + +enum +{ + SPELL_GROUND_TREMOR = 6524, + + SPELL_AWAKEN_EARTHEN_GUARDIAN = 10252, + SPELL_AWAKEN_VAULT_WARDER = 10258, + SPELL_AWAKEN_EARTHEN_DWARF = 10259, + + SPELL_ARCHAEDAS_AWAKEN_VISUAL = 10347, + + SAY_AGGRO = -1070001, + SAY_AWAKE_GUARDIANS = -1070002, + SAY_AWAKE_WARDERS = -1070003, + SAY_UNIT_SLAIN = -1070004 +}; + +struct MANGOS_DLL_DECL boss_archaedasAI : public ScriptedAI +{ + boss_archaedasAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_uldaman*)pCreature->GetInstanceData(); + Reset(); + } + + instance_uldaman* m_pInstance; + + uint32 m_uiAwakeningTimer; + uint32 m_uiAwakeDwarfTimer; + uint8 m_uiSubevent; + bool m_bDwarvesAwaken; + bool m_bGuardiansAwaken; + bool m_bWardersAwaken; + + void Reset() + { + m_uiAwakeningTimer = 1000; + m_uiSubevent = 0; + m_uiAwakeDwarfTimer = 10000; + m_bGuardiansAwaken = false; + m_bWardersAwaken = false; + m_bDwarvesAwaken = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ARCHAEDAS, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_UNIT_SLAIN, m_creature); + } + + void JustDied(Unit* pKiller) + { + // open door to vault (handled by instance script) + if (m_pInstance) + m_pInstance->SetData(TYPE_ARCHAEDAS, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ARCHAEDAS, FAIL); + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pTarget->GetTypeId() != TYPEID_PLAYER) + { + if (pTarget->HasAura(SPELL_STONED, EFFECT_INDEX_0)) + { + pTarget->RemoveAurasDueToSpell(SPELL_STONED); + + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + pTarget->SetInCombatWith(pUnit); + pTarget->AddThreat(pUnit); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + // so many things are based in this script on instance data + // so if we don't have access to it better do nothing + if (!m_pInstance) + return; + + // OOC Intro part triggered by Altar activation + if (m_pInstance->GetData(TYPE_ARCHAEDAS) == SPECIAL) + { + if (m_uiAwakeningTimer <= uiDiff) + { + switch(m_uiSubevent) + { + case 0: + DoCastSpellIfCan(m_creature, SPELL_ARCHAEDAS_AWAKEN_VISUAL); + break; + case 1: + DoScriptText(SAY_AGGRO,m_creature,NULL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case 2: + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_pInstance->GetData64(DATA_EVENT_STARTER))) + AttackStart(pPlayer); + else + EnterEvadeMode(); + break; + default: + break; + } + + ++m_uiSubevent; + m_uiAwakeningTimer = 5000; + } + else + m_uiAwakeningTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Awake random Dwarf + if (!m_bDwarvesAwaken && m_creature->GetHealthPercent() >= 33.0f) + { + if (m_uiAwakeDwarfTimer <= uiDiff) + { + if (Creature* pEarthen = m_pInstance->GetClosestDwarfNotInCombat(m_creature, PHASE_ARCHA_1)) + { + if (DoCastSpellIfCan(pEarthen, SPELL_AWAKEN_EARTHEN_DWARF) == CAST_OK) + m_uiAwakeDwarfTimer = urand(9000, 12000); + } + else + m_bDwarvesAwaken = true; + } + else + m_uiAwakeDwarfTimer -= uiDiff; + } + + //Awake Earthen Guardians + if (!m_bGuardiansAwaken && m_creature->GetHealthPercent() <= 66.0f) + { + if (Creature* pGuard = m_pInstance->GetClosestDwarfNotInCombat(m_creature, PHASE_ARCHA_2)) + { + if (DoCastSpellIfCan(pGuard, SPELL_AWAKEN_EARTHEN_GUARDIAN) == CAST_OK) + { + DoScriptText(SAY_AWAKE_GUARDIANS, m_creature); + m_bGuardiansAwaken = true; + } + } + } + + // Awake Warders + if (!m_bWardersAwaken && m_creature->GetHealthPercent() <= 33.0f) + { + if (Creature* pWarder = m_pInstance->GetClosestDwarfNotInCombat(m_creature, PHASE_ARCHA_3)) + { + if (DoCastSpellIfCan(pWarder, SPELL_AWAKEN_VAULT_WARDER) == CAST_OK) + { + DoScriptText(SAY_AWAKE_WARDERS, m_creature); + m_bWardersAwaken = true; + } + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL npc_archaeras_addAI : public ScriptedAI +{ + npc_archaeras_addAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + void Reset() + { + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_archaedas(Creature* pCreature) +{ + return new boss_archaedasAI(pCreature); +} + +CreatureAI* GetAI_npc_archaeras_add(Creature* pCreature) +{ + return new npc_archaeras_addAI(pCreature); +} + +void AddSC_boss_archaedas() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_archaedas"; + pNewScript->GetAI = &GetAI_boss_archaedas; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_archaeras_add"; + pNewScript->GetAI = &GetAI_npc_archaeras_add; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp b/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp new file mode 100644 index 0000000..f0a8f72 --- /dev/null +++ b/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp @@ -0,0 +1,105 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ironaya +SD%Complete: 100 +SDComment: +SDCategory: Uldaman +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1070000 + +#define SPELL_ARCINGSMASH 8374 +#define SPELL_KNOCKAWAY 10101 +#define SPELL_WSTOMP 11876 + +struct MANGOS_DLL_DECL boss_ironayaAI : public ScriptedAI +{ + boss_ironayaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Arcing_Timer; + bool hasCastedWstomp; + bool hasCastedKnockaway; + + void Reset() + { + Arcing_Timer = 3000; + hasCastedKnockaway = false; + hasCastedWstomp = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are <50% hp do knockaway ONCE + if (!hasCastedKnockaway && m_creature->GetHealthPercent() < 50.0f) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0); + + if (!Target || Target == m_creature->getVictim()) + Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); + + if (Target) + m_creature->TauntApply(Target); + + //Shouldn't cast this agian + hasCastedKnockaway = true; + } + + //Arcing_Timer + if (Arcing_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ARCINGSMASH); + Arcing_Timer = 13000; + }else Arcing_Timer -= diff; + + if (!hasCastedWstomp && m_creature->GetHealthPercent() < 25.0f) + { + DoCastSpellIfCan(m_creature,SPELL_WSTOMP); + hasCastedWstomp = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ironaya(Creature* pCreature) +{ + return new boss_ironayaAI(pCreature); +} + +void AddSC_boss_ironaya() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ironaya"; + newscript->GetAI = &GetAI_boss_ironaya; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp b/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp new file mode 100644 index 0000000..ad12a39 --- /dev/null +++ b/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp @@ -0,0 +1,353 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Uldaman +SD%Complete: 60 +SDComment: +SDCategory: Uldaman +EndScriptData +*/ + +#include "precompiled.h" +#include "uldaman.h" + +instance_uldaman::instance_uldaman(Map* pMap) : ScriptedInstance(pMap), + m_uiTempleDoorUpperGUID(0), + m_uiTempleDoorLowerGUID(0), + m_uiAncientVaultGUID(0), + m_uiPlayerGUID(0), + m_uiStoneKeepersFallen(0), + m_uiKeeperCooldown(5000) +{ + Initialize(); +} + +void instance_uldaman::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + m_lWardens.clear(); + m_mKeeperMap.clear(); +} + +void instance_uldaman::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_TEMPLE_DOOR_UPPER: + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + m_uiTempleDoorUpperGUID = pGo->GetGUID(); + break; + case GO_TEMPLE_DOOR_LOWER: + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + m_uiTempleDoorLowerGUID = pGo->GetGUID(); + break; + case GO_ANCIENT_VAULT: + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + m_uiAncientVaultGUID = pGo->GetGUID(); + break; + default: + break; + } +} + +void instance_uldaman::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_HALLSHAPER: + case NPC_CUSTODIAN: + case NPC_GUARDIAN: + case NPC_VAULT_WARDER: + m_lWardens.push_back(pCreature->GetGUID()); + pCreature->CastSpell(pCreature, SPELL_STONED, true); + pCreature->SetNoCallAssistance(true); // no assistance + break; + case NPC_STONE_KEEPER: + m_mKeeperMap[pCreature->GetGUID()] = pCreature->isAlive(); + pCreature->CastSpell(pCreature, SPELL_STONED, true); + pCreature->SetNoCallAssistance(true); // no assistance + break; + default: + break; + } +} + +void instance_uldaman::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_ALTAR_EVENT: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiTempleDoorUpperGUID); + DoUseDoorOrButton(m_uiTempleDoorLowerGUID); + + m_auiEncounter[0] = uiData; + } + break; + + case TYPE_ARCHAEDAS: + if (uiData == FAIL) + { + for (std::list::iterator itr = m_lWardens.begin(); itr != m_lWardens.end(); ++itr) + { + if (Creature* pWarden = instance->GetCreature(*itr)) + { + pWarden->SetDeathState(JUST_DIED); + pWarden->Respawn(); + pWarden->SetNoCallAssistance(true); + } + } + } + else if (uiData == DONE) + { + for (std::list::iterator itr = m_lWardens.begin(); itr != m_lWardens.end(); ++itr) + { + Creature* pWarden = instance->GetCreature(*itr); + if (pWarden && pWarden->isAlive()) + pWarden->ForcedDespawn(); + } + DoUseDoorOrButton(m_uiAncientVaultGUID); + } + m_auiEncounter[1] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + + strInstData = saveStream.str(); + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_uldaman::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +void instance_uldaman::SetData64(uint32 uiData, uint64 uiGuid) +{ + switch(uiData) + { + case DATA_EVENT_STARTER: + m_uiPlayerGUID = uiGuid; + break; + } +} + +uint32 instance_uldaman::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_ARCHAEDAS: + return m_auiEncounter[1]; + } + return 0; +} + +uint64 instance_uldaman::GetData64(uint32 uiData) +{ + switch(uiData) + { + case DATA_EVENT_STARTER: + return m_uiPlayerGUID; + } + return 0; +} + +void instance_uldaman::StartEvent(uint32 uiEventId, Player* pPlayer) +{ + m_uiPlayerGUID = pPlayer->GetGUID(); + + if (uiEventId == EVENT_ID_ALTAR_KEEPER) + { + if (m_auiEncounter[0] == NOT_STARTED) + m_auiEncounter[0] = IN_PROGRESS; + } + else if (m_auiEncounter[1] == NOT_STARTED || m_auiEncounter[1] == FAIL) + m_auiEncounter[1] = SPECIAL; +} + +void instance_uldaman::DoResetKeeperEvent() +{ + m_auiEncounter[0] = NOT_STARTED; + m_uiStoneKeepersFallen = 0; + + for (std::map::iterator itr = m_mKeeperMap.begin(); itr != m_mKeeperMap.end(); ++itr) + { + if (Creature* pKeeper = instance->GetCreature(itr->first)) + { + pKeeper->SetDeathState(JUST_DIED); + pKeeper->Respawn(); + pKeeper->CastSpell(pKeeper, SPELL_STONED, true); + pKeeper->SetNoCallAssistance(true); + itr->second = true; + } + } +} + +Creature* instance_uldaman::GetClosestDwarfNotInCombat(Creature* pSearcher, uint32 uiPhase) +{ + std::list lTemp; + + for (std::list::iterator itr = m_lWardens.begin(); itr != m_lWardens.end(); ++itr) + { + Creature* pTemp = instance->GetCreature(*itr); + + if (pTemp && pTemp->isAlive() && !pTemp->getVictim()) + { + switch(uiPhase) + { + case PHASE_ARCHA_1: + if (pTemp->GetEntry() != NPC_CUSTODIAN && pTemp->GetEntry() != NPC_HALLSHAPER) + continue; + break; + case PHASE_ARCHA_2: + if (pTemp->GetEntry() != NPC_GUARDIAN) + continue; + break; + case PHASE_ARCHA_3: + if (pTemp->GetEntry() != NPC_VAULT_WARDER) + continue; + break; + } + + lTemp.push_back(pTemp); + } + } + + if (lTemp.empty()) + return NULL; + + lTemp.sort(ObjectDistanceOrder(pSearcher)); + return lTemp.front(); +} + +void instance_uldaman::Update(uint32 uiDiff) +{ + if (m_auiEncounter[0] == IN_PROGRESS) + { + if (m_uiKeeperCooldown >= uiDiff) + m_uiKeeperCooldown -= uiDiff; + else + { + m_uiKeeperCooldown = 5000; + + if (!m_mKeeperMap.empty()) + { + for(std::map::iterator itr = m_mKeeperMap.begin(); itr != m_mKeeperMap.end(); ++itr) + { + // died earlier + if (!itr->second) + continue; + + if (Creature* pKeeper = instance->GetCreature(itr->first)) + { + if (pKeeper->isAlive() && !pKeeper->getVictim()) + { + if (Player* pPlayer = pKeeper->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + // we should use group instead, event starter can be dead while group is still fighting + if (pPlayer->isAlive() && !pPlayer->isInCombat()) + { + pKeeper->RemoveAurasDueToSpell(SPELL_STONED); + pKeeper->SetInCombatWith(pPlayer); + pKeeper->AddThreat(pPlayer); + } + else + { + if (!pPlayer->isAlive()) + DoResetKeeperEvent(); + } + } + + break; + } + else if (!pKeeper->isAlive()) + { + itr->second = pKeeper->isAlive(); + ++m_uiStoneKeepersFallen; + } + } + } + + if (m_uiStoneKeepersFallen == m_mKeeperMap.size()) + SetData(TYPE_ALTAR_EVENT, DONE); + } + } + } +} + +InstanceData* GetInstanceData_instance_uldaman(Map* pMap) +{ + return new instance_uldaman(pMap); +} + +bool ProcessEventId_event_spell_altar_boss_aggro(uint32 uiEventId, Object* pSource, Object* pTarget, bool bIsStart) +{ + if (bIsStart && pSource->GetTypeId() == TYPEID_PLAYER) + { + if (instance_uldaman* pInstance = (instance_uldaman*)((Player*)pSource)->GetInstanceData()) + { + pInstance->StartEvent(uiEventId, (Player*)pSource); + return true; + } + } + return false; +} + +void AddSC_instance_uldaman() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_uldaman"; + pNewScript->GetInstanceData = &GetInstanceData_instance_uldaman; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "event_spell_altar_boss_aggro"; + pNewScript->pProcessEventId = &ProcessEventId_event_spell_altar_boss_aggro; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/uldaman/uldaman.cpp b/scripts/eastern_kingdoms/uldaman/uldaman.cpp new file mode 100644 index 0000000..1120b95 --- /dev/null +++ b/scripts/eastern_kingdoms/uldaman/uldaman.cpp @@ -0,0 +1,184 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Uldaman +SD%Complete: 100 +SDComment: Quest support: 2278 + 1 trash mob. +SDCategory: Uldaman +EndScriptData */ + +/* ContentData +mob_jadespine_basilisk +npc_lore_keeper_of_norgannon +EndContentData */ + +#include "precompiled.h" +#include "uldaman.h" + +/*###### +## mob_jadespine_basilisk +######*/ + +#define SPELL_CSLUMBER 3636 + +struct MANGOS_DLL_DECL mob_jadespine_basiliskAI : public ScriptedAI +{ + mob_jadespine_basiliskAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Cslumber_Timer; + + void Reset() + { + Cslumber_Timer = 2000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Cslumber_Timer + if (Cslumber_Timer < diff) + { + //Cast + // DoCastSpellIfCan(m_creature->getVictim(),SPELL_CSLUMBER); + m_creature->CastSpell(m_creature->getVictim(),SPELL_CSLUMBER, true); + + //Stop attacking target thast asleep and pick new target + Cslumber_Timer = 28000; + + Unit* Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0); + + if (!Target || Target == m_creature->getVictim()) + Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (Target) + m_creature->TauntApply(Target); + + }else Cslumber_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_jadespine_basilisk(Creature* pCreature) +{ + return new mob_jadespine_basiliskAI(pCreature); +} + +/*###### +## npc_lore_keeper_of_norgannon +######*/ + +bool GossipHello_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(2278) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Who are the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(1079, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lore_keeper_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What is a \"subterranean being matrix\"?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(1080, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What are the anomalies you speak of?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(1081, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What is a resilient foundation of construction?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(1082, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "So... the Earthen were made out of stone?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(1083, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Anything else I should know about the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(1084, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(1085, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What high-stress environments would cause the Earthen to destabilize?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+8); + pPlayer->SEND_GOSSIP_MENU(1086, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What happens when the Earthen destabilize?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + pPlayer->SEND_GOSSIP_MENU(1087, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Troggs?! Are the troggs you mention the same as the ones in the world today?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); + pPlayer->SEND_GOSSIP_MENU(1088, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You mentioned two results when the Earthen destabilize. What is the second?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+11); + pPlayer->SEND_GOSSIP_MENU(1089, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+12); + pPlayer->SEND_GOSSIP_MENU(1090, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+13); + pPlayer->SEND_GOSSIP_MENU(1091, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Who are the Creators?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+14); + pPlayer->SEND_GOSSIP_MENU(1092, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+14: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "This is a lot to think about.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+15); + pPlayer->SEND_GOSSIP_MENU(1093, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+15: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will access the discs now.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+16); + pPlayer->SEND_GOSSIP_MENU(1094, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+16: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2278); + break; + } + return true; +} + +void AddSC_uldaman() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "mob_jadespine_basilisk"; + pNewScript->GetAI = &GetAI_mob_jadespine_basilisk; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_lore_keeper_of_norgannon"; + pNewScript->pGossipHello = &GossipHello_npc_lore_keeper_of_norgannon; + pNewScript->pGossipSelect = &GossipSelect_npc_lore_keeper_of_norgannon; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/uldaman/uldaman.h b/scripts/eastern_kingdoms/uldaman/uldaman.h new file mode 100644 index 0000000..d07cfda --- /dev/null +++ b/scripts/eastern_kingdoms/uldaman/uldaman.h @@ -0,0 +1,79 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ULDAMAN_H +#define DEF_ULDAMAN_H + +enum +{ + MAX_ENCOUNTER = 2, + + TYPE_ALTAR_EVENT = 1, + TYPE_ARCHAEDAS = 2, + DATA_EVENT_STARTER = 3, + + GO_TEMPLE_DOOR_UPPER = 124367, + GO_TEMPLE_DOOR_LOWER = 141869, + GO_ANCIENT_VAULT = 124369, + + NPC_CUSTODIAN = 7309, + NPC_HALLSHAPER = 7077, + NPC_GUARDIAN = 7076, + NPC_VAULT_WARDER = 10120, + NPC_STONE_KEEPER = 4857, + + PHASE_ARCHA_1 = 1, + PHASE_ARCHA_2 = 2, + PHASE_ARCHA_3 = 3, + + SPELL_STONED = 10255, + + EVENT_ID_ALTAR_KEEPER = 2228, // spell 11568 + EVENT_ID_ALTAR_ARCHAEDAS = 2268 // spell 10340 +}; + +class MANGOS_DLL_DECL instance_uldaman : public ScriptedInstance +{ + public: + instance_uldaman(Map* pMap); + ~instance_uldaman() {} + + void Initialize(); + + void OnObjectCreate(GameObject* pGo); + void OnCreatureCreate(Creature* pCreature); + + void Update(uint32 uiDiff); + + void SetData(uint32 uiType, uint32 uiData); + void SetData64(uint32 uiData, uint64 uiGuid); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + void StartEvent(uint32 uiEventId, Player* pPlayer); + + void DoResetKeeperEvent(); + + Creature* GetClosestDwarfNotInCombat(Creature* pSearcher, uint32 uiPhase); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiTempleDoorUpperGUID; + uint64 m_uiTempleDoorLowerGUID; + uint64 m_uiAncientVaultGUID; + uint64 m_uiPlayerGUID; + + uint32 m_uiKeeperCooldown; + uint32 m_uiStoneKeepersFallen; + + std::list m_lWardens; + std::map m_mKeeperMap; +}; + +#endif diff --git a/scripts/eastern_kingdoms/undercity.cpp b/scripts/eastern_kingdoms/undercity.cpp new file mode 100644 index 0000000..916534b --- /dev/null +++ b/scripts/eastern_kingdoms/undercity.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Undercity +SD%Complete: 95 +SDComment: Quest support: 6628(Parqual Fintallas questions/'answers' might have more to it, need more info), 9180(post-event). +SDCategory: Undercity +EndScriptData */ + +/* ContentData +npc_lady_sylvanas_windrunner +npc_highborne_lamenter +npc_parqual_fintallas +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_lady_sylvanas_windrunner +######*/ + +#define SAY_LAMENT_END -1000196 +#define EMOTE_LAMENT_END -1000197 + +#define SOUND_CREDIT 10896 +#define ENTRY_HIGHBORNE_LAMENTER 21628 +#define ENTRY_HIGHBORNE_BUNNY 21641 + +#define SPELL_HIGHBORNE_AURA 37090 +#define SPELL_SYLVANAS_CAST 36568 +#define SPELL_RIBBON_OF_SOULS 34432 //the real one to use might be 37099 + +float HighborneLoc[4][3]= +{ + {1285.41f, 312.47f, 0.51f}, + {1286.96f, 310.40f, 1.00f}, + {1289.66f, 309.66f, 1.52f}, + {1292.51f, 310.50f, 1.99f}, +}; +#define HIGHBORNE_LOC_Y -61.00f +#define HIGHBORNE_LOC_Y_NEW -55.50f + +struct MANGOS_DLL_DECL npc_lady_sylvanas_windrunnerAI : public ScriptedAI +{ + npc_lady_sylvanas_windrunnerAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 LamentEvent_Timer; + bool LamentEvent; + uint64 targetGUID; + + float myX; + float myY; + float myZ; + + void Reset() + { + myX = m_creature->GetPositionX(); + myY = m_creature->GetPositionY(); + myZ = m_creature->GetPositionZ(); + + LamentEvent_Timer = 5000; + LamentEvent = false; + targetGUID = 0; + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_HIGHBORNE_BUNNY) + { + if (Creature* pBunny = m_creature->GetMap()->GetCreature(targetGUID)) + { + pBunny->NearTeleportTo(pBunny->GetPositionX(), pBunny->GetPositionY(), myZ+15.0f, 0.0f); + summoned->CastSpell(pBunny,SPELL_RIBBON_OF_SOULS,false); + } + + targetGUID = summoned->GetGUID(); + } + } + + void UpdateAI(const uint32 diff) + { + if (LamentEvent) + { + if (LamentEvent_Timer < diff) + { + float raX = myX; + float raY = myY; + float raZ = myZ; + + m_creature->GetRandomPoint(myX,myY,myZ,20.0,raX,raY,raZ); + m_creature->SummonCreature(ENTRY_HIGHBORNE_BUNNY,raX,raY,myZ,0,TEMPSUMMON_TIMED_DESPAWN,3000); + + LamentEvent_Timer = 2000; + if (!m_creature->HasAura(SPELL_SYLVANAS_CAST, EFFECT_INDEX_0)) + { + DoScriptText(SAY_LAMENT_END, m_creature); + DoScriptText(EMOTE_LAMENT_END, m_creature); + LamentEvent = false; + } + }else LamentEvent_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_lady_sylvanas_windrunner(Creature* pCreature) +{ + return new npc_lady_sylvanas_windrunnerAI(pCreature); +} + +bool ChooseReward_npc_lady_sylvanas_windrunner(Player* pPlayer, Creature* pCreature, const Quest* pQuest, uint32 slot) +{ + if (pQuest->GetQuestId() == 9180) + { + if (npc_lady_sylvanas_windrunnerAI* pSylvanAI = dynamic_cast(pCreature->AI())) + { + pSylvanAI->LamentEvent = true; + pSylvanAI->DoPlaySoundToSet(pCreature, SOUND_CREDIT); + } + + pCreature->CastSpell(pCreature,SPELL_SYLVANAS_CAST,false); + + for(uint8 i = 0; i < 4; ++i) + pCreature->SummonCreature(ENTRY_HIGHBORNE_LAMENTER, HighborneLoc[i][0], HighborneLoc[i][1], HIGHBORNE_LOC_Y, HighborneLoc[i][2], TEMPSUMMON_TIMED_DESPAWN, 160000); + } + + return true; +} + +/*###### +## npc_highborne_lamenter +######*/ + +struct MANGOS_DLL_DECL npc_highborne_lamenterAI : public ScriptedAI +{ + npc_highborne_lamenterAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 EventMove_Timer; + uint32 EventCast_Timer; + bool EventMove; + bool EventCast; + + void Reset() + { + EventMove_Timer = 10000; + EventCast_Timer = 17500; + EventMove = true; + EventCast = true; + } + + void UpdateAI(const uint32 diff) + { + if (EventMove) + { + if (EventMove_Timer < diff) + { + m_creature->AddSplineFlag(SPLINEFLAG_NO_SPLINE); + m_creature->SendMonsterMoveWithSpeed(m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,5000); + m_creature->GetMap()->CreatureRelocation(m_creature,m_creature->GetPositionX(),m_creature->GetPositionY(),HIGHBORNE_LOC_Y_NEW,m_creature->GetOrientation()); + EventMove = false; + }else EventMove_Timer -= diff; + } + if (EventCast) + { + if (EventCast_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_HIGHBORNE_AURA); + EventCast = false; + }else EventCast_Timer -= diff; + } + } +}; +CreatureAI* GetAI_npc_highborne_lamenter(Creature* pCreature) +{ + return new npc_highborne_lamenterAI(pCreature); +} + +/*###### +## npc_parqual_fintallas +######*/ + +#define SPELL_MARK_OF_SHAME 6767 + +bool GossipHello_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(6628) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasAura(SPELL_MARK_OF_SHAME, EFFECT_INDEX_0)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Gul'dan", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Kel'Thuzad", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ner'zhul", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(5822, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(5821, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_parqual_fintallas(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,SPELL_MARK_OF_SHAME,false); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(6628); + } + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_undercity() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_lady_sylvanas_windrunner"; + newscript->GetAI = &GetAI_npc_lady_sylvanas_windrunner; + newscript->pChooseReward = &ChooseReward_npc_lady_sylvanas_windrunner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_highborne_lamenter"; + newscript->GetAI = &GetAI_npc_highborne_lamenter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_parqual_fintallas"; + newscript->pGossipHello = &GossipHello_npc_parqual_fintallas; + newscript->pGossipSelect = &GossipSelect_npc_parqual_fintallas; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/western_plaguelands.cpp b/scripts/eastern_kingdoms/western_plaguelands.cpp new file mode 100644 index 0000000..da19bb7 --- /dev/null +++ b/scripts/eastern_kingdoms/western_plaguelands.cpp @@ -0,0 +1,222 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Western_Plaguelands +SD%Complete: 90 +SDComment: Quest support: 5216,5219,5222,5225,5229,5231,5233,5235. To obtain Vitreous Focuser (could use more spesifics about gossip items) +SDCategory: Western Plaguelands +EndScriptData */ + +/* ContentData +npcs_dithers_and_arbington +npc_myranda_hag +npc_the_scourge_cauldron +EndContentData */ + +#include "precompiled.h" + +/*###### +## npcs_dithers_and_arbington +######*/ + +bool GossipHello_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestRewardStatus(5237) || pPlayer->GetQuestRewardStatus(5238)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What does the Felstone Field Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What does the Dalson's Tears Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What does the Writhing Haunt Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What does the Gahrron's Withering Cauldron need?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(3985, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_dithers_and_arbington(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3980, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3981, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3982, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thanks, i need a Vitreous Focuser", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(3983, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 17529, false); + break; + } + return true; +} + +/*###### +## npc_myranda_the_hag +######*/ + +enum +{ + QUEST_SUBTERFUGE = 5862, + QUEST_IN_DREAMS = 5944, + SPELL_SCARLET_ILLUSION = 17961 +}; + +#define GOSSIP_ITEM_ILLUSION "I am ready for the illusion, Myranda." + +bool GossipHello_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_SUBTERFUGE) == QUEST_STATUS_COMPLETE && + !pPlayer->GetQuestRewardStatus(QUEST_IN_DREAMS) && !pPlayer->HasAura(SPELL_SCARLET_ILLUSION)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ILLUSION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(4773, pCreature->GetGUID()); + return true; + } + else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_myranda_the_hag(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_SCARLET_ILLUSION, false); + } + return true; +} + +/*###### +## npc_the_scourge_cauldron +######*/ + +struct MANGOS_DLL_DECL npc_the_scourge_cauldronAI : public ScriptedAI +{ + npc_the_scourge_cauldronAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() {} + + void DoDie() + { + //summoner dies here + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //override any database `spawntimesecs` to prevent duplicated summons + uint32 rTime = m_creature->GetRespawnDelay(); + if (rTime<600) + m_creature->SetRespawnDelay(600); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || who->GetTypeId() != TYPEID_PLAYER) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + switch(m_creature->GetAreaId()) + { + case 199: //felstone + if (((Player*)who)->GetQuestStatus(5216) == QUEST_STATUS_INCOMPLETE || + ((Player*)who)->GetQuestStatus(5229) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11075, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 200: //dalson + if (((Player*)who)->GetQuestStatus(5219) == QUEST_STATUS_INCOMPLETE || + ((Player*)who)->GetQuestStatus(5231) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11077, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + DoDie(); + } + break; + case 201: //gahrron + if (((Player*)who)->GetQuestStatus(5225) == QUEST_STATUS_INCOMPLETE || + ((Player*)who)->GetQuestStatus(5235) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11078, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoDie(); + } + break; + case 202: //writhing + if (((Player*)who)->GetQuestStatus(5222) == QUEST_STATUS_INCOMPLETE || + ((Player*)who)->GetQuestStatus(5233) == QUEST_STATUS_INCOMPLETE) + { + m_creature->SummonCreature(11076, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoDie(); + } + break; + } + } + } +}; +CreatureAI* GetAI_npc_the_scourge_cauldron(Creature* pCreature) +{ + return new npc_the_scourge_cauldronAI(pCreature); +} + +/*###### +## +######*/ + +void AddSC_western_plaguelands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npcs_dithers_and_arbington"; + newscript->pGossipHello = &GossipHello_npcs_dithers_and_arbington; + newscript->pGossipSelect = &GossipSelect_npcs_dithers_and_arbington; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_myranda_the_hag"; + newscript->pGossipHello = &GossipHello_npc_myranda_the_hag; + newscript->pGossipSelect = &GossipSelect_npc_myranda_the_hag; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_the_scourge_cauldron"; + newscript->GetAI = &GetAI_npc_the_scourge_cauldron; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/westfall.cpp b/scripts/eastern_kingdoms/westfall.cpp new file mode 100644 index 0000000..0ecd8d0 --- /dev/null +++ b/scripts/eastern_kingdoms/westfall.cpp @@ -0,0 +1,266 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Westfall +SD%Complete: 90 +SDComment: Quest support: 155, 1651 +SDCategory: Westfall +EndScriptData */ + +/* ContentData +npc_daphne_stilwell +npc_defias_traitor +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_daphne_stilwell +######*/ + +enum +{ + SAY_DS_START = -1000293, + SAY_DS_DOWN_1 = -1000294, + SAY_DS_DOWN_2 = -1000295, + SAY_DS_DOWN_3 = -1000296, + SAY_DS_PROLOGUE = -1000297, + + SPELL_SHOOT = 6660, + QUEST_TOME_VALOR = 1651, + NPC_DEFIAS_RAIDER = 6180, + EQUIP_ID_RIFLE = 2511 +}; + +struct MANGOS_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI +{ + npc_daphne_stilwellAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiWPHolder = 0; + Reset(); + } + + uint32 m_uiWPHolder; + uint32 m_uiShootTimer; + + void Reset() + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + switch(m_uiWPHolder) + { + case 7: DoScriptText(SAY_DS_DOWN_1, m_creature); break; + case 8: DoScriptText(SAY_DS_DOWN_2, m_creature); break; + case 9: DoScriptText(SAY_DS_DOWN_3, m_creature); break; + } + } + else + m_uiWPHolder = 0; + + m_uiShootTimer = 0; + } + + void WaypointReached(uint32 uiPointId) + { + m_uiWPHolder = uiPointId; + + switch(uiPointId) + { + case 4: + SetEquipmentSlots(false, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE, EQUIP_ID_RIFLE); + m_creature->SetSheath(SHEATH_STATE_RANGED); + m_creature->HandleEmote(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 7: + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 8: + m_creature->SetSheath(SHEATH_STATE_RANGED); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + m_creature->SetSheath(SHEATH_STATE_RANGED); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11450.836f, 1569.755f, 54.267f, 4.230f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.697f, 1569.124f, 54.421f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.237f, 1568.307f, 54.620f, 4.206f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11448.037f, 1570.213f, 54.961f, 4.283f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_DEFIAS_RAIDER, -11449.018f, 1570.738f, 54.828f, 4.220f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 10: + SetRun(false); + break; + case 11: + DoScriptText(SAY_DS_PROLOGUE, m_creature); + break; + case 13: + SetEquipmentSlots(true); + m_creature->SetSheath(SHEATH_STATE_UNARMED); + m_creature->HandleEmote(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 17: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_TOME_VALOR, m_creature); + break; + } + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiShootTimer < uiDiff) + { + m_uiShootTimer = 1000; + + if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHOOT); + + } + else + m_uiShootTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_daphne_stilwell(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_TOME_VALOR) + { + DoScriptText(SAY_DS_START, pCreature); + + if (npc_daphne_stilwellAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(true, pPlayer->GetGUID(), pQuest); + } + + return true; +} + +CreatureAI* GetAI_npc_daphne_stilwell(Creature* pCreature) +{ + return new npc_daphne_stilwellAI(pCreature); +} + +/*###### +## npc_defias_traitor +######*/ + +enum +{ + SAY_START = -1000101, + SAY_PROGRESS = -1000102, + SAY_END = -1000103, + SAY_AGGRO_1 = -1000104, + SAY_AGGRO_2 = -1000105, + + QUEST_DEFIAS_BROTHERHOOD = 155 +}; + +struct MANGOS_DLL_DECL npc_defias_traitorAI : public npc_escortAI +{ + npc_defias_traitorAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 uiPointId) + { + switch (uiPointId) + { + case 35: + SetRun(false); + break; + case 36: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); + break; + case 44: + if (Player* pPlayer = GetPlayerForEscort()) + { + DoScriptText(SAY_END, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, m_creature); + } + break; + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(urand(0, 1) ? SAY_AGGRO_1 : SAY_AGGRO_2, m_creature); + } + + void Reset() { } +}; + +bool QuestAccept_npc_defias_traitor(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_DEFIAS_BROTHERHOOD) + { + DoScriptText(SAY_START, pCreature, pPlayer); + + if (npc_defias_traitorAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(true, pPlayer->GetGUID(), pQuest); + } + + return true; +} + +CreatureAI* GetAI_npc_defias_traitor(Creature* pCreature) +{ + return new npc_defias_traitorAI(pCreature); +} + +void AddSC_westfall() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_daphne_stilwell"; + pNewScript->GetAI = &GetAI_npc_daphne_stilwell; + pNewScript->pQuestAccept = &QuestAccept_npc_daphne_stilwell; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_defias_traitor"; + pNewScript->GetAI = &GetAI_npc_defias_traitor; + pNewScript->pQuestAccept = &QuestAccept_npc_defias_traitor; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/wetlands.cpp b/scripts/eastern_kingdoms/wetlands.cpp new file mode 100644 index 0000000..b01a99b --- /dev/null +++ b/scripts/eastern_kingdoms/wetlands.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Wetlands +SD%Complete: 80 +SDComment: Quest support: 1249 +SDCategory: Wetlands +EndScriptData */ + +/* ContentData +npc_mikhail +npc_tapoke_slim_jahn +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_tapoke_slim_jahn +######*/ + +enum +{ + QUEST_MISSING_DIPLO_PT11 = 1249, + FACTION_ENEMY = 168, + SPELL_STEALTH = 1785, + SPELL_CALL_FRIENDS = 16457, //summons 1x friend + NPC_SLIMS_FRIEND = 4971, + NPC_TAPOKE_SLIM_JAHN = 4962 +}; + +struct MANGOS_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI +{ + npc_tapoke_slim_jahnAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + bool m_bFriendSummoned; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + m_bFriendSummoned = false; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 2: + if (m_creature->HasStealthAura()) + m_creature->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + SetRun(); + m_creature->setFaction(FACTION_ENEMY); + break; + } + } + + void Aggro(Unit* pWho) + { + Player* pPlayer = GetPlayerForEscort(); + + if (HasEscortState(STATE_ESCORT_ESCORTING) && !m_bFriendSummoned && pPlayer) + { + for(uint8 i = 0; i < 3; ++i) + m_creature->CastSpell(m_creature, SPELL_CALL_FRIENDS, true); + + m_bFriendSummoned = true; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (Player* pPlayer = GetPlayerForEscort()) + pSummoned->AI()->AttackStart(pPlayer); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if (m_creature->GetHealthPercent() < 20.0f) + { + if (Player* pPlayer = GetPlayerForEscort()) + { + pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); + + uiDamage = 0; + + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + + SetRun(false); + } + } + } +}; + +CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature) +{ + return new npc_tapoke_slim_jahnAI(pCreature); +} + +/*###### +## npc_mikhail +######*/ + +bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11) + { + Creature* pSlim = GetClosestCreatureWithEntry(pCreature, NPC_TAPOKE_SLIM_JAHN, 25.0f); + + if (!pSlim) + return false; + + if (!pSlim->HasStealthAura()) + pSlim->CastSpell(pSlim, SPELL_STEALTH, true); + + if (npc_tapoke_slim_jahnAI* pEscortAI = dynamic_cast(pSlim->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return false; +} + +/*###### +## AddSC +######*/ + +void AddSC_wetlands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_tapoke_slim_jahn"; + newscript->GetAI = &GetAI_npc_tapoke_slim_jahn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mikhail"; + newscript->pQuestAccept = &QuestAccept_npc_mikhail; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp b/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp new file mode 100644 index 0000000..c90776f --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp @@ -0,0 +1,311 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Akilzon +SD%Complete: 50 +SDComment: TODO: Correct timers, correct details, remove hack for eagles +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" + +enum +{ + SAY_EVENT1 = -1568024, + SAY_EVENT2 = -1568025, + SAY_AGGRO = -1568026, + SAY_SUMMON = -1568027, + SAY_SUMMON_ALT = -1568028, + SAY_ENRAGE = -1568029, + SAY_SLAY1 = -1568030, + SAY_SLAY2 = -1568031, + SAY_DEATH = -1568032, + EMOTE_STORM = -1568033, + + SPELL_STATIC_DISRUPTION = 43622, + SPELL_STATIC_VISUAL = 45265, + + SPELL_CALL_LIGHTNING = 43661, + SPELL_GUST_OF_WIND = 43621, + + SPELL_ELECTRICAL_STORM = 43648, + SPELL_STORMCLOUD_VISUAL = 45213, + + SPELL_BERSERK = 45078, + + NPC_SOARING_EAGLE = 24858, + MAX_EAGLE_COUNT = 6, + + //SE_LOC_X_MAX = 400, + //SE_LOC_X_MIN = 335, + //SE_LOC_Y_MAX = 1435, + //SE_LOC_Y_MIN = 1370 +}; + +struct MANGOS_DLL_DECL boss_akilzonAI : public ScriptedAI +{ + boss_akilzonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiStaticDisruptTimer; + uint32 m_uiCallLightTimer; + uint32 m_uiGustOfWindTimer; + uint32 m_uiStormTimer; + uint32 m_uiSummonEagleTimer; + uint32 m_uiBerserkTimer; + bool m_bIsBerserk; + + void Reset() + { + m_uiStaticDisruptTimer = urand(7000, 14000); + m_uiCallLightTimer = urand(15000, 25000); + m_uiGustOfWindTimer = urand(20000, 30000); + m_uiStormTimer = 50000; + m_uiSummonEagleTimer = 65000; + m_uiBerserkTimer = MINUTE*8*IN_MILLISECONDS; + m_bIsBerserk = false; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetInCombatWithZone(); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_AKILZON, DONE); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SOARING_EAGLE) + pSummoned->SetInCombatWithZone(); + } + + void DoSummonEagles() + { + for(uint32 i = 0; i < MAX_EAGLE_COUNT; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+15.0f, 30.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_SOARING_EAGLE, fX, fY, fZ, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCallLightTimer < uiDiff) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_CALL_LIGHTNING, false); + m_uiCallLightTimer = urand(15000, 25000); + }else m_uiCallLightTimer -= uiDiff; + + if (m_uiStaticDisruptTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + m_creature->CastSpell(pTarget, SPELL_STATIC_DISRUPTION, false); + + m_uiStaticDisruptTimer = urand(7000, 14000); + }else m_uiStaticDisruptTimer -= uiDiff; + + if (m_uiStormTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(EMOTE_STORM, m_creature); + m_creature->CastSpell(pTarget, SPELL_ELECTRICAL_STORM, false); + } + + m_uiStormTimer = 60000; + }else m_uiStormTimer -= uiDiff; + + if (m_uiGustOfWindTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + m_creature->CastSpell(pTarget, SPELL_GUST_OF_WIND, false); + + m_uiGustOfWindTimer = urand(20000, 30000); + }else m_uiGustOfWindTimer -= uiDiff; + + if (m_uiSummonEagleTimer < uiDiff) + { + DoScriptText(urand(0,1) ? SAY_SUMMON : SAY_SUMMON_ALT, m_creature); + DoSummonEagles(); + m_uiSummonEagleTimer = 60000; + }else m_uiSummonEagleTimer -= uiDiff; + + if (!m_bIsBerserk && m_uiBerserkTimer < uiDiff) + { + DoScriptText(SAY_ENRAGE, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + m_bIsBerserk = true; + }else m_uiBerserkTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_akilzon(Creature* pCreature) +{ + return new boss_akilzonAI(pCreature); +} + +enum +{ + SPELL_EAGLE_SWOOP = 44732, + POINT_ID_RANDOM = 1 +}; + +struct MANGOS_DLL_DECL mob_soaring_eagleAI : public ScriptedAI +{ + mob_soaring_eagleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiEagleSwoopTimer; + uint32 m_uiReturnTimer; + bool m_bCanMoveToRandom; + bool m_bCanCast; + + void Reset() + { + m_uiEagleSwoopTimer = urand(2000, 6000); + m_uiReturnTimer = 800; + m_bCanMoveToRandom = false; + m_bCanCast = true; + + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE) + return; + + m_bCanCast = true; + } + + void DoMoveToRandom() + { + if (!m_pInstance) + return; + + if (Creature* pAzkil = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_AKILZON))) + { + float fX, fY, fZ; + pAzkil->GetRandomPoint(pAzkil->GetPositionX(), pAzkil->GetPositionY(), pAzkil->GetPositionZ()+15.0f, 30.0f, fX, fY, fZ); + + if (m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + + m_creature->GetMotionMaster()->MovePoint(POINT_ID_RANDOM, fX, fY, fZ); + + m_bCanMoveToRandom = false; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bCanMoveToRandom) + { + if (m_uiReturnTimer < uiDiff) + { + DoMoveToRandom(); + m_uiReturnTimer = 800; + }else m_uiReturnTimer -= uiDiff; + } + + if (!m_bCanCast) + return; + + if (m_uiEagleSwoopTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoCastSpellIfCan(pTarget,SPELL_EAGLE_SWOOP); + + m_bCanMoveToRandom = true; + m_bCanCast = false; + } + + m_uiEagleSwoopTimer = urand(4000, 6000); + }else m_uiEagleSwoopTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_mob_soaring_eagle(Creature* pCreature) +{ + return new mob_soaring_eagleAI(pCreature); +} + +void AddSC_boss_akilzon() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_akilzon"; + newscript->GetAI = &GetAI_boss_akilzon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_soaring_eagle"; + newscript->GetAI = &GetAI_mob_soaring_eagle; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp b/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp new file mode 100644 index 0000000..12f5159 --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp @@ -0,0 +1,400 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Halazzi +SD%Complete: 70 +SDComment: Details and timers need check. +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" +#include "ObjectMgr.h" + +enum +{ + SAY_AGGRO = -1568034, + SAY_SPLIT = -1568035, + SAY_MERGE = -1568036, + SAY_SABERLASH1 = -1568037, + SAY_SABERLASH2 = -1568038, + SAY_BERSERK = -1568039, + SAY_KILL1 = -1568040, + SAY_KILL2 = -1568041, + SAY_DEATH = -1568042, + SAY_EVENT1 = -1568043, + SAY_EVENT2 = -1568044, + + SPELL_DUAL_WIELD = 42459, + SPELL_SABER_LASH = 43267, + SPELL_FRENZY = 43139, + SPELL_FLAMESHOCK = 43303, + SPELL_EARTHSHOCK = 43305, + SPELL_BERSERK = 45078, + + //SPELL_TRANSFORM_TO_ORIGINAL = 43311, + + //SPELL_TRANSFIGURE = 44054, + + SPELL_TRANSFIGURE_TO_TROLL = 43142, + //SPELL_TRANSFIGURE_TO_TROLL_TRIGGERED = 43573, + + SPELL_TRANSFORM_TO_LYNX_75 = 43145, + SPELL_TRANSFORM_TO_LYNX_50 = 43271, + SPELL_TRANSFORM_TO_LYNX_25 = 43272, + + SPELL_SUMMON_LYNX = 43143, + SPELL_SUMMON_TOTEM = 43302, + + NPC_TOTEM = 24224 +}; + +enum HalazziPhase +{ + PHASE_SINGLE = 0, + PHASE_TOTEM = 1, + PHASE_FINAL = 2 +}; + +struct MANGOS_DLL_DECL boss_halazziAI : public ScriptedAI +{ + boss_halazziAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiPhase; + uint32 m_uiPhaseCounter; + uint32 m_uiFrenzyTimer; + uint32 m_uiSaberLashTimer; + uint32 m_uiShockTimer; + uint32 m_uiTotemTimer; + uint32 m_uiCheckTimer; + uint32 m_uiBerserkTimer; + bool m_bIsBerserk; + + void Reset() + { + m_uiPhase = PHASE_SINGLE; // reset phase + m_uiPhaseCounter = 3; + + m_uiCheckTimer = IN_MILLISECONDS; + m_uiFrenzyTimer = 16*IN_MILLISECONDS; + m_uiSaberLashTimer = 20*IN_MILLISECONDS; + m_uiShockTimer = 10*IN_MILLISECONDS; + m_uiTotemTimer = 12*IN_MILLISECONDS; + m_uiBerserkTimer = 10*MINUTE*IN_MILLISECONDS; + m_bIsBerserk = false; + + m_creature->SetMaxHealth(m_creature->GetCreatureInfo()->maxhealth); + + if (m_pInstance) + { + if (Creature* pSpiritLynx = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SPIRIT_LYNX))) + pSpiritLynx->ForcedDespawn(); + } + } + + void JustReachedHome() + { + m_pInstance->SetData(TYPE_HALAZZI, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetInCombatWithZone(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HALAZZI, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HALAZZI, DONE); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SPIRIT_LYNX) + pSummoned->SetInCombatWithZone(); + } + + void DoUpdateStats(const CreatureInfo* pInfo) + { + m_creature->SetMaxHealth(pInfo->maxhealth); + + if (m_uiPhase == PHASE_SINGLE) + { + m_creature->SetHealth(m_creature->GetMaxHealth()/4*m_uiPhaseCounter); + --m_uiPhaseCounter; + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->EffectApplyAuraName[0] != SPELL_AURA_TRANSFORM) + return; + + // possibly hack and health should be set by Aura::HandleAuraTransform() + if (const CreatureInfo* pInfo = GetCreatureTemplateStore(pSpell->EffectMiscValue[0])) + DoUpdateStats(pInfo); + + if (m_uiPhase == PHASE_TOTEM) + DoCastSpellIfCan(m_creature, SPELL_SUMMON_LYNX); + } + + void PhaseChange() + { + if (m_uiPhase == PHASE_SINGLE) + { + if (m_creature->GetHealthPercent() <= float(25*m_uiPhaseCounter)) + { + if (!m_uiPhaseCounter) + { + // final phase + m_uiPhase = PHASE_FINAL; + m_uiFrenzyTimer = 16*IN_MILLISECONDS; + m_uiSaberLashTimer = 20*IN_MILLISECONDS; + } + else + { + m_uiPhase = PHASE_TOTEM; + m_uiShockTimer = 10*IN_MILLISECONDS; + m_uiTotemTimer = 12*IN_MILLISECONDS; + + DoScriptText(SAY_SPLIT, m_creature); + m_creature->CastSpell(m_creature, SPELL_TRANSFIGURE_TO_TROLL, false); + } + } + } + else + { + Creature* pSpiritLynx = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SPIRIT_LYNX)); + + if (m_creature->GetHealthPercent() < 10.0f || + (pSpiritLynx && pSpiritLynx->GetHealthPercent() < 10.0f)) + { + m_uiPhase = PHASE_SINGLE; + + DoScriptText(SAY_MERGE, m_creature); + + uint32 uiSpellId; + + switch(m_uiPhaseCounter) + { + case 3: uiSpellId = SPELL_TRANSFORM_TO_LYNX_75; break; + case 2: uiSpellId = SPELL_TRANSFORM_TO_LYNX_50; break; + case 1: uiSpellId = SPELL_TRANSFORM_TO_LYNX_25; break; + } + + m_creature->CastSpell(m_creature, uiSpellId, false); + + if (pSpiritLynx) + pSpiritLynx->ForcedDespawn(); + + m_uiFrenzyTimer = 16*IN_MILLISECONDS; + m_uiSaberLashTimer = 20*IN_MILLISECONDS; + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsBerserk) + { + if (m_uiBerserkTimer < uiDiff) + { + DoScriptText(SAY_BERSERK, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_TRIGGERED); + m_bIsBerserk = true; + } + else + m_uiBerserkTimer -= uiDiff; + } + + if (m_uiPhase != PHASE_FINAL) + { + if (m_uiCheckTimer < uiDiff) + { + if (m_pInstance) + PhaseChange(); + else + m_uiPhase = PHASE_FINAL; + + m_uiCheckTimer = IN_MILLISECONDS; + } + else + m_uiCheckTimer -= uiDiff; + } + + if (m_uiPhase == PHASE_FINAL || m_uiPhase == PHASE_SINGLE) + { + if (m_uiFrenzyTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + m_uiFrenzyTimer = 16*IN_MILLISECONDS; + } + else + m_uiFrenzyTimer -= uiDiff; + + if (m_uiSaberLashTimer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_SABERLASH1 : SAY_SABERLASH2, m_creature); + + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SABER_LASH); + m_uiSaberLashTimer = 20*IN_MILLISECONDS; + } + else + m_uiSaberLashTimer -= uiDiff; + } + + if (m_uiPhase == PHASE_FINAL || m_uiPhase == PHASE_TOTEM) + { + if (m_uiTotemTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_TOTEM); + m_uiTotemTimer = 20*IN_MILLISECONDS; + } + else + m_uiTotemTimer -= uiDiff; + + if (m_uiShockTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (pTarget->IsNonMeleeSpellCasted(false)) + DoCastSpellIfCan(pTarget, SPELL_EARTHSHOCK); + else + DoCastSpellIfCan(pTarget, SPELL_FLAMESHOCK); + + m_uiShockTimer = urand(10000, 14000); + } + } + else + m_uiShockTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_halazzi(Creature* pCreature) +{ + return new boss_halazziAI(pCreature); +} + +enum +{ + SPELL_LYNX_FRENZY = 43290, + SPELL_SHRED_ARMOR = 43243 +}; + +struct MANGOS_DLL_DECL boss_spirit_lynxAI : public ScriptedAI +{ + boss_spirit_lynxAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiFrenzyTimer; + uint32 m_uiShredArmorTimer; + + void Reset() + { + m_uiFrenzyTimer = urand(10000, 20000); //first frenzy after 10-20 seconds + m_uiShredArmorTimer = 4000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void KilledUnit(Unit* pVictim) + { + if (!m_pInstance) + return; + + if (Creature* pHalazzi = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_HALAZZI))) + pHalazzi->AI()->KilledUnit(pVictim); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiFrenzyTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_LYNX_FRENZY); + m_uiFrenzyTimer = urand(20000, 30000); //subsequent frenzys casted every 20-30 seconds + } + else + m_uiFrenzyTimer -= uiDiff; + + if (m_uiShredArmorTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHRED_ARMOR); + m_uiShredArmorTimer = 4000; + } + else + m_uiShredArmorTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_spirit_lynx(Creature* pCreature) +{ + return new boss_spirit_lynxAI(pCreature); +} + +void AddSC_boss_halazzi() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_halazzi"; + newscript->GetAI = &GetAI_boss_halazzi; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_spirit_lynx"; + newscript->GetAI = &GetAI_boss_spirit_lynx; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp b/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp new file mode 100644 index 0000000..532769f --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp @@ -0,0 +1,784 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Janalai +SD%Complete: 75 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" + +enum +{ + SAY_AGGRO = -1568000, + SAY_FIRE_BOMBS = -1568001, + SAY_SUMMON_HATCHER = -1568002, + SAY_ALL_EGGS = -1568003, + SAY_BERSERK = -1568004, + SAY_SLAY_1 = -1568005, + SAY_SLAY_2 = -1568006, + SAY_DEATH = -1568007, + SAY_EVENT_STRANGERS = -1568008, + SAY_EVENT_FRIENDS = -1568009, + + //Jan'alai + SPELL_FLAME_BREATH = 43140, + SPELL_FIRE_WALL = 43113, + SPELL_ENRAGE = 44779, + SPELL_TELETOCENTER = 43098, + SPELL_SUMMONALL = 43097, + SPELL_BERSERK = 47008, + SPELL_SUMMON_HATCHER_1 = 43962, + SPELL_SUMMON_HATCHER_2 = 45340, + + //Fire Bob Spells + SPELL_FIRE_BOMB_CHANNEL = 42621, + SPELL_FIRE_BOMB_THROW = 42628, + SPELL_FIRE_BOMB_DUMMY = 42629, + SPELL_FIRE_BOMB_DAMAGE = 42630, + + //NPC's + NPC_FIRE_BOMB = 23920, + NPC_AMANI_HATCHER_1 = 23818, + NPC_AMANI_HATCHER_2 = 24504, + NPC_HATCHLING = 23598, + + //Hatcher Spells + SPELL_HATCH_EGG = 43734, //spell 42471 also exist + SPELL_HATCH_ALL_EGGS = 43144, + + //Eggs spells + SPELL_SUMMON_DRAGONHAWK = 42493, + + //Hatchling Spells + SPELL_FLAMEBUFFED = 43299 +}; + +//spells should summon Fire Bomb, used in Throw5Bombs() +static uint32 m_auiSpellFireBombSummon[]= +{ + 42622, 42623, 42624, 42625, 42626 +}; + +const int area_dx = 44; +const int area_dy = 51; + +float JanalainPos[1][3] = +{ + {-33.93f, 1149.27f, 19.0f} +}; + +float FireWallCoords[4][4] = +{ + {-10.13f, 1149.27f, 19.0f, M_PI_F}, + {-33.93f, 1123.90f, 19.0f, 0.5f*M_PI_F}, + {-54.80f, 1150.08f, 19.0f, 0.0f}, + {-33.93f, 1175.68f, 19.0f, 1.5f*M_PI_F} +}; + +struct WaypointDef +{ + float m_fX, m_fY, m_fZ; +}; + +WaypointDef m_aHatcherRight[]= +{ + {-86.203f, 1136.834f, 5.594f}, //this is summon point, not regular waypoint + {-74.783f, 1145.827f, 5.420f}, + {-56.957f, 1146.713f, 18.725f}, + {-45.428f, 1141.697f, 18.709f}, + {-34.002f, 1124.427f, 18.711f}, + {-34.085f, 1106.158f, 18.711f} +}; + +WaypointDef m_aHatcherLeft[]= +{ + {-85.420f, 1167.321f, 5.594f}, //this is summon point, not regular waypoint + {-73.569f, 1154.960f, 5.510f}, + {-56.985f, 1153.373f, 18.608f}, + {-45.515f, 1158.356f, 18.709f}, + {-33.314f, 1174.816f, 18.709f}, + {-33.097f, 1195.359f, 18.709f} +}; + +float hatcherway_l[5][3] = +{ + {-87.46f, 1170.09f, 6.0f}, + {-74.41f, 1154.75f, 6.0f}, + {-52.74f, 1153.32f, 19.0f}, + {-33.37f, 1172.46f, 19.0f}, + {-33.09f, 1203.87f, 19.0f} +}; + +float hatcherway_r[5][3] = +{ + {-86.57f, 1132.85f, 6.0f}, + {-73.94f, 1146.00f, 6.0f}, + {-52.29f, 1146.51f, 19.0f}, + {-33.57f, 1125.72f, 19.0f}, + {-34.29f, 1095.22f, 19.0f} +}; + +struct MANGOS_DLL_DECL boss_janalaiAI : public ScriptedAI +{ + boss_janalaiAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiHatcher1GUID = 0; + m_uiHatcher2GUID = 0; + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 fire_breath_timer; + + std::list m_lBombsGUIDList; + std::list m_lEggsRemainingList; + + uint32 m_uiBombTimer; + uint32 m_uiBombSequenzeTimer; + uint32 m_uiBombPhase; + uint32 m_uiBombCounter; + + uint32 enrage_timer; + uint32 hatchertime; + uint32 eggs; + uint32 wipetimer; + + bool m_bIsBombing; + bool m_bCanBlowUpBombs; + bool m_bIsEggRemaining; + bool enraged; + bool enragetime; + + uint64 m_uiHatcher1GUID; + uint64 m_uiHatcher2GUID; + + void Reset() + { + m_lBombsGUIDList.clear(); + m_lEggsRemainingList.clear(); + + if (Creature* pHatcher = m_creature->GetMap()->GetCreature(m_uiHatcher1GUID)) + { + pHatcher->AI()->EnterEvadeMode(); + pHatcher->SetDeathState(JUST_DIED); + m_uiHatcher1GUID = 0; + } + + if (Creature* pHatcher = m_creature->GetMap()->GetCreature(m_uiHatcher2GUID)) + { + pHatcher->AI()->EnterEvadeMode(); + pHatcher->SetDeathState(JUST_DIED); + m_uiHatcher2GUID = 0; + } + + fire_breath_timer = 8000; + + m_uiBombTimer = 30000; + m_bIsBombing = false; + m_uiBombSequenzeTimer = 1500; + m_uiBombPhase = 0; + m_uiBombCounter = 0; + m_bCanBlowUpBombs = false; + m_bIsEggRemaining = true; + + enrage_timer = MINUTE*5*IN_MILLISECONDS; + hatchertime = 10000; + wipetimer = MINUTE*10*IN_MILLISECONDS; + enraged = false; + enragetime = false; + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_JANALAI, NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_JANALAI, DONE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_JANALAI, IN_PROGRESS); + } + + void JustSummoned(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_AMANI_HATCHER_1: + m_uiHatcher1GUID = pSummoned->GetGUID(); + break; + case NPC_AMANI_HATCHER_2: + m_uiHatcher2GUID = pSummoned->GetGUID(); + break; + case NPC_FIRE_BOMB: + if (m_bIsBombing) + { + //store bombs in list to be used in BlowUpBombs() + m_lBombsGUIDList.push_back(pSummoned->GetGUID()); + + if (pSummoned->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + pSummoned->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //visual spell, spell hit pSummoned after a short time + m_creature->CastSpell(pSummoned,SPELL_FIRE_BOMB_THROW,true); + } + else + { + pSummoned->CastSpell(pSummoned, SPELL_FIRE_WALL, true); + } + break; + } + } + + void SpellHitTarget(Unit* pUnit, const SpellEntry* pSpell) + { + //when spell actually hit the fire bombs, make then cast spell(making them "visible") + if (pUnit->GetEntry() == NPC_FIRE_BOMB && pSpell->Id == SPELL_FIRE_BOMB_THROW) + pUnit->CastSpell(pUnit,SPELL_FIRE_BOMB_DUMMY,false); + } + + void CreateFireWall() // Create Firewall + { + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[0][0],FireWallCoords[0][1],FireWallCoords[0][2],FireWallCoords[0][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[0][0],FireWallCoords[0][1]+5,FireWallCoords[0][2],FireWallCoords[0][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[0][0],FireWallCoords[0][1]-5,FireWallCoords[0][2],FireWallCoords[0][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[1][0]-2,FireWallCoords[1][1]-2,FireWallCoords[1][2],FireWallCoords[1][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[1][0]+2,FireWallCoords[1][1]+2,FireWallCoords[1][2],FireWallCoords[1][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[2][0],FireWallCoords[2][1],FireWallCoords[2][2],FireWallCoords[2][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[2][0],FireWallCoords[2][1]-5,FireWallCoords[2][2],FireWallCoords[2][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[2][0],FireWallCoords[2][1]+5,FireWallCoords[2][2],FireWallCoords[2][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[3][0]-2,FireWallCoords[3][1],FireWallCoords[3][2],FireWallCoords[3][3],TEMPSUMMON_TIMED_DESPAWN,11500); + + m_creature->SummonCreature(NPC_FIRE_BOMB,FireWallCoords[3][0]+2,FireWallCoords[3][1],FireWallCoords[3][2],FireWallCoords[3][3],TEMPSUMMON_TIMED_DESPAWN,11500); + } + + void Throw5Bombs() + { + //all available spells (each spell has different radius for summon location) + uint8 uiMaxBombs = sizeof(m_auiSpellFireBombSummon)/sizeof(uint32); + + //float fX, fY, fZ; + //float fRadius = 5.0f; + + for(uint8 i = 0; i < uiMaxBombs; ++i) + { + m_creature->CastSpell(m_creature, m_auiSpellFireBombSummon[i], true); + + //workaround part + //m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), fRadius+(fRadius*i), fX, fY, fZ); + //m_creature->SummonCreature(NPC_FIRE_BOMB, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN, MINUTE*IN_MILLISECONDS); + } + + ++m_uiBombCounter; + } + + //Teleport every player into the middle if more than 20 yards away (possibly what spell 43096 should do) + void TeleportPlayersOutOfRange() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pTemp = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && !m_creature->IsWithinDist(pTemp, 20.0f)) + m_creature->CastSpell(pTemp, SPELL_SUMMONALL, true); + } + } + + void BlowUpBombs() + { + if (m_lBombsGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lBombsGUIDList.begin(); itr != m_lBombsGUIDList.end(); ++itr) + { + if (Creature* pBomb = m_creature->GetMap()->GetCreature(*itr)) + { + //do damage and then remove aura (making them "disappear") + pBomb->CastSpell(pBomb, SPELL_FIRE_BOMB_DAMAGE, false, NULL, NULL, m_creature->GetGUID()); + pBomb->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_DUMMY); + } + } + + m_lBombsGUIDList.clear(); + } + + void DoHatchRemainingEggs() + { + GetCreatureListWithEntryInGrid(m_lEggsRemainingList, m_creature, NPC_EGG, 125.0f); + + if (!m_lEggsRemainingList.empty()) + { + for(std::list::iterator itr = m_lEggsRemainingList.begin(); itr != m_lEggsRemainingList.end(); ++itr) + { + if ((*itr)->isAlive()) + (*itr)->CastSpell((*itr), SPELL_SUMMON_DRAGONHAWK, true); + } + + m_bIsEggRemaining = false; + + if (!m_pInstance) + return; + + if (uint32 uiEggsRemaining_Right = m_pInstance->GetData(DATA_J_EGGS_RIGHT)) + { + for(uint32 i = 0; i < uiEggsRemaining_Right; ++i) + m_pInstance->SetData(DATA_J_EGGS_RIGHT, SPECIAL); + } + + if (uint32 uiEggsRemaining_Left = m_pInstance->GetData(DATA_J_EGGS_LEFT)) + { + for(uint32 i = 0; i < uiEggsRemaining_Left; ++i) + m_pInstance->SetData(DATA_J_EGGS_LEFT, SPECIAL); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //blow up bombs happen after bombing is over, so handle this here + if (m_bCanBlowUpBombs) + { + if (m_uiBombSequenzeTimer < diff) + { + BlowUpBombs(); + m_bCanBlowUpBombs = false; + }else m_uiBombSequenzeTimer -= diff; + } + + if (!m_bIsBombing) // every Spell if NOT Bombing + { + if (m_uiBombTimer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_FIRE_BOMBS, m_creature); + + //first clear movement + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + //then teleport self + DoCastSpellIfCan(m_creature, SPELL_TELETOCENTER, CAST_TRIGGERED); + + //then players and create the firewall + TeleportPlayersOutOfRange(); + CreateFireWall(); + + //prepare variables for bombing sequenze + m_lBombsGUIDList.clear(); + + m_uiBombPhase = 0; + m_uiBombSequenzeTimer = 500; + m_uiBombCounter = 0; + + m_uiBombTimer = urand(20000, 40000); + m_bIsBombing = true; + + //we don't want anything else to happen this Update() + return; + }else m_uiBombTimer -=diff; + + //FIRE BREATH several videos says every 8Secounds + if (fire_breath_timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_FLAME_BREATH); + fire_breath_timer = 8000; + }else fire_breath_timer -=diff; + + //enrage if under 25% hp before 5 min. + if (m_creature->GetHealthPercent() < 25.0f && !enraged) + { + enragetime = true; + enrage_timer = 600000; + } + + //Enrage but only if not bombing + if (enragetime && !enraged) + { + DoScriptText(SAY_BERSERK, m_creature); + + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature,SPELL_ENRAGE); + enraged = true; + } + + //Hatch All + if (m_bIsEggRemaining && m_creature->GetHealthPercent() < 35.0f) + { + DoScriptText(SAY_ALL_EGGS, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature, SPELL_HATCH_ALL_EGGS); + + DoHatchRemainingEggs(); + } + + DoMeleeAttackIfReady(); + } + else // every Spell if Bombing + { + if (m_uiBombSequenzeTimer < diff) + { + switch(m_uiBombPhase) + { + case 0: + m_creature->CastSpell(m_creature,SPELL_FIRE_BOMB_CHANNEL,true); + m_uiBombSequenzeTimer = 500; + ++m_uiBombPhase; + break; + case 1: + if (m_uiBombCounter < 8) + { + Throw5Bombs(); + m_uiBombSequenzeTimer = 500; + } + else + { + m_uiBombSequenzeTimer = 1000; + ++m_uiBombPhase; + } + break; + case 2: + m_bCanBlowUpBombs = true; + m_uiBombSequenzeTimer = 2000; + m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_bIsBombing = false; + break; + } + + }else m_uiBombSequenzeTimer -= diff; + } + + //Enrage after 5 minutes + if (enrage_timer < diff) + { + enragetime = true; + enrage_timer = 600000; + }else enrage_timer -=diff; + + //Call Hatcher + if (m_bIsEggRemaining) + { + if (hatchertime < diff) + { + if (!m_pInstance || (m_pInstance->GetData(DATA_J_EGGS_LEFT) == 0 && m_pInstance->GetData(DATA_J_EGGS_RIGHT) == 0)) + m_bIsEggRemaining = false; + else + { + DoScriptText(SAY_SUMMON_HATCHER, m_creature); + + Creature* pHatcer1 = m_creature->GetMap()->GetCreature(m_uiHatcher1GUID); + Creature* pHatcer2 = m_creature->GetMap()->GetCreature(m_uiHatcher2GUID); + + if (!pHatcer1 || (pHatcer1 && !pHatcer1->isAlive())) + { + if (Creature* pHatcher = m_creature->SummonCreature(NPC_AMANI_HATCHER_1, m_aHatcherRight[0].m_fX, m_aHatcherRight[0].m_fY, m_aHatcherRight[0].m_fZ, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + pHatcher->GetMotionMaster()->MovePoint(1, m_aHatcherRight[1].m_fX, m_aHatcherRight[1].m_fY, m_aHatcherRight[1].m_fZ); + } + + if (!pHatcer2 || (pHatcer2 && !pHatcer2->isAlive())) + { + if (Creature* pHatcher = m_creature->SummonCreature(NPC_AMANI_HATCHER_2, m_aHatcherLeft[0].m_fX, m_aHatcherLeft[0].m_fY, m_aHatcherLeft[0].m_fZ, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + pHatcher->GetMotionMaster()->MovePoint(1, m_aHatcherLeft[1].m_fX, m_aHatcherLeft[1].m_fY, m_aHatcherLeft[1].m_fZ); + } + + hatchertime = 90000; + } + + }else hatchertime -=diff; + } + + //WIPE after 10 minutes + if (wipetimer < diff) + { + if (DoCastSpellIfCan(m_creature,SPELL_ENRAGE) == CAST_OK) + { + DoScriptText(SAY_BERSERK, m_creature); + wipetimer = 30000; + } + }else wipetimer -=diff; + + //check for reset ... exploit preventing ... pulled from his podest + EnterEvadeIfOutOfCombatArea(diff); + } +}; + +CreatureAI* GetAI_boss_janalaiAI(Creature* pCreature) +{ + return new boss_janalaiAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_jandalai_firebombAI : public ScriptedAI +{ + mob_jandalai_firebombAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() {} + + void AttackStart(Unit* who) {} + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) {} +}; + +CreatureAI* GetAI_mob_jandalai_firebombAI(Creature* pCreature) +{ + return new mob_jandalai_firebombAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_amanishi_hatcherAI : public ScriptedAI +{ + mob_amanishi_hatcherAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiWaypoint; + uint32 m_uiHatchlingTimer; + uint32 m_uiHatchlingCount; + bool m_bCanMoveNext; + bool m_bWaypointEnd; + + void Reset() + { + m_uiWaypoint = 0; + m_uiHatchlingTimer = 1000; + m_uiHatchlingCount = 1; + m_bCanMoveNext = false; + m_bWaypointEnd = false; + + if (m_creature->HasSplineFlag(SPLINEFLAG_WALKMODE)) + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + } + + void MoveInLineOfSight(Unit* pWho) {} + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE || m_bWaypointEnd) + return; + + uint32 uiCount = (m_creature->GetEntry() == NPC_AMANI_HATCHER_1) ? + (sizeof(m_aHatcherRight)/sizeof(WaypointDef)) : (sizeof(m_aHatcherLeft)/sizeof(WaypointDef)); + + m_uiWaypoint = uiPointId+1; + + if (uiCount == m_uiWaypoint) + m_bWaypointEnd = true; + + m_bCanMoveNext = true; + } + + void DoHatchEggs(uint32 uiCount) + { + uint32 uiSaveRightOrLeft = m_creature->GetEntry() == NPC_AMANI_HATCHER_1 ? DATA_J_EGGS_RIGHT : DATA_J_EGGS_LEFT; + + for(uint32 i = 0; i < uiCount; ++i) + { + if (Creature* pEgg = GetClosestCreatureWithEntry(m_creature, NPC_EGG, 40.0f)) + pEgg->CastSpell(pEgg, SPELL_SUMMON_DRAGONHAWK, true); + + m_pInstance->SetData(uiSaveRightOrLeft, SPECIAL); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bCanMoveNext) + { + m_bCanMoveNext = false; + + if (m_bWaypointEnd) + m_creature->GetMotionMaster()->Clear(); + else + { + if (m_creature->GetEntry() == NPC_AMANI_HATCHER_1) + m_creature->GetMotionMaster()->MovePoint(m_uiWaypoint, m_aHatcherRight[m_uiWaypoint].m_fX, m_aHatcherRight[m_uiWaypoint].m_fY, m_aHatcherRight[m_uiWaypoint].m_fZ); + else + m_creature->GetMotionMaster()->MovePoint(m_uiWaypoint, m_aHatcherLeft[m_uiWaypoint].m_fX, m_aHatcherLeft[m_uiWaypoint].m_fY, m_aHatcherLeft[m_uiWaypoint].m_fZ); + } + } + + if (m_bWaypointEnd) + { + if (m_uiHatchlingTimer < uiDiff) + { + m_uiHatchlingTimer = 10000; + + if (!m_pInstance) + return; + + uint32 uiEggsRemaining = m_creature->GetEntry() == NPC_AMANI_HATCHER_1 ? m_pInstance->GetData(DATA_J_EGGS_RIGHT) : m_pInstance->GetData(DATA_J_EGGS_LEFT); + + if (!uiEggsRemaining) + { + //instead, should run to other side and start hatch if eggs remain + m_creature->ForcedDespawn(); + return; + } + else if (m_uiHatchlingCount == uiEggsRemaining/2) + m_uiHatchlingCount = uiEggsRemaining; + + DoCastSpellIfCan(m_creature,SPELL_HATCH_EGG); + + DoHatchEggs(m_uiHatchlingCount); + + ++m_uiHatchlingCount; + + }else m_uiHatchlingTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature* pCreature) +{ + return new mob_amanishi_hatcherAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_hatchlingAI : public ScriptedAI +{ + mob_hatchlingAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 buffer_timer; + bool start; + + void Reset() + { + buffer_timer = 7000; + start = false; + } + + void UpdateAI(const uint32 diff) + { + if (!start) + { + if (m_creature->GetPositionY() > 1150) + m_creature->GetMotionMaster()->MovePoint(0, hatcherway_l[3][0]+rand()%4-2,hatcherway_l[3][1]+rand()%4-2,hatcherway_l[3][2]); + else + m_creature->GetMotionMaster()->MovePoint(0,hatcherway_r[3][0]+rand()%4-2,hatcherway_r[3][1]+rand()%4-2,hatcherway_r[3][2]); + start = true; + } + + if (m_pInstance && m_pInstance->GetData(TYPE_JANALAI) == NOT_STARTED) + { + m_creature->ForcedDespawn(); + return; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (buffer_timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_FLAMEBUFFED); + + buffer_timer = 7000; + }else buffer_timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_hatchlingAI(Creature* pCreature) +{ + return new mob_hatchlingAI(pCreature); +} + +void AddSC_boss_janalai() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_janalai"; + newscript->GetAI = &GetAI_boss_janalaiAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_jandalai_firebomb"; + newscript->GetAI = &GetAI_mob_jandalai_firebombAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_amanishi_hatcher"; + newscript->GetAI = &GetAI_mob_amanishi_hatcherAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_hatchling"; + newscript->GetAI = &GetAI_mob_hatchlingAI; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/boss_malacrass.cpp b/scripts/eastern_kingdoms/zulaman/boss_malacrass.cpp new file mode 100644 index 0000000..34df95b --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/boss_malacrass.cpp @@ -0,0 +1,867 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Malacrass +SD%Complete: 10 +SDComment: Contain adds and adds selection +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" + +enum +{ + SAY_AGGRO = -1568045, + SAY_ENRAGE = -1568046, + SAY_KILL1 = -1568047, + SAY_KILL2 = -1568048, + SAY_SOUL_SIPHON = -1568049, + SAY_DRAIN_POWER = -1568050, + SAY_SPIRIT_BOLTS = -1568051, + SAY_ADD_DIED1 = -1568052, + SAY_ADD_DIED2 = -1568053, + SAY_ADD_DIED3 = -1568054, + SAY_DEATH = -1568055, + + SPELL_SPIRIT_BOLTS = 43383, + SPELL_SIPHON_SOUL = 43501, + SPELL_DRAIN_POWER = 44131, + + //for various powers he uses after using soul drain + //Death Knight + SPELL_DK_DEATH_AND_DECAY = 61603, + SPELL_DK_PLAGUE_STRIKE = 61606, + SPELL_DK_MARK_OF_BLOOD = 61600, + + //Druid + SPELL_DR_THORNS = 43420, + SPELL_DR_LIFEBLOOM = 43421, + SPELL_DR_MOONFIRE = 43545, + + //Hunter + SPELL_HU_EXPLOSIVE_TRAP = 43444, + SPELL_HU_FREEZING_TRAP = 43447, + SPELL_HU_SNAKE_TRAP = 43449, + + //Mage + SPELL_MG_FIREBALL = 41383, + SPELL_MG_FROST_NOVA = 43426, + SPELL_MG_ICE_LANCE = 43427, + SPELL_MG_FROSTBOLT = 43428, + + //Paladin + SPELL_PA_CONSECRATION = 43429, + SPELL_PA_AVENGING_WRATH = 43430, + SPELL_PA_HOLY_LIGHT = 43451, + + //Priest + SPELL_PR_HEAL = 41372, + SPELL_PR_MIND_BLAST = 41374, + SPELL_PR_SW_DEATH = 41375, + SPELL_PR_PSYCHIC_SCREAM = 43432, + SPELL_PR_MIND_CONTROL = 43550, + SPELL_PR_PAIN_SUPP = 44416, + + //Rogue + SPELL_RO_WOUND_POISON = 39665, + SPELL_RO_BLIND = 43433, + SPELL_RO_SLICE_DICE = 43457, + + //Shaman + SPELL_SH_CHAIN_LIGHT = 43435, + SPELL_SH_FIRE_NOVA = 43436, + SPELL_SH_HEALING_WAVE = 43548, + + //Warlock + SPELL_WL_CURSE_OF_DOOM = 43439, + SPELL_WL_RAIN_OF_FIRE = 43440, + SPELL_WL_UNSTABLE_AFFL = 35183, + + //Warrior + SPELL_WR_MORTAL_STRIKE = 43441, + SPELL_WR_WHIRLWIND = 43442, + SPELL_WR_SPELL_REFLECT = 43443, + + //misc + //WEAPON_ID = 33494, //weapon equip id, must be set by database. + MAX_ACTIVE_ADDS = 4 +}; + +//Adds X positions +static float m_afAddPosX[4] = {128.279f, 123.261f, 112.084f, 106.473f}; + +const float ADD_POS_Y = 921.279f; +const float ADD_POS_Z = 33.889f; +const float ADD_ORIENT = 1.527f; + +struct SpawnGroup +{ + uint32 m_uiCreatureEntry; + uint32 m_uiCreatureEntryAlt; +}; + +SpawnGroup m_auiSpawnEntry[] = +{ + {24240, 24241}, //Alyson Antille / Thurg + {24242, 24243}, //Slither / Lord Raadan + {24244, 24245}, //Gazakroth / Fenstalker + {24246, 24247}, //Darkheart / Koragg +}; + +struct MANGOS_DLL_DECL boss_malacrassAI : public ScriptedAI +{ + boss_malacrassAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + memset(&m_auiAddGUIDs, 0, sizeof(m_auiAddGUIDs)); + m_lAddsEntryList.clear(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lAddsEntryList; + uint64 m_auiAddGUIDs[MAX_ACTIVE_ADDS]; + + void Reset() + { + InitializeAdds(); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_MALACRASS, NOT_STARTED); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MALACRASS, FAIL); + + for(uint8 i = 0; i < MAX_ACTIVE_ADDS; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiAddGUIDs[i])) + pAdd->AI()->EnterEvadeMode(); + } + } + + void InitializeAdds() + { + //not if m_creature are dead, so avoid + if (!m_creature->isAlive()) + return; + + uint8 j = 0; + + //it's empty, so first time + if (m_lAddsEntryList.empty()) + { + //fill list with entries from creature array + for(uint8 i = 0; i < MAX_ACTIVE_ADDS; ++i) + m_lAddsEntryList.push_back(rand()%2 ? m_auiSpawnEntry[i].m_uiCreatureEntry : m_auiSpawnEntry[i].m_uiCreatureEntryAlt); + + //summon mobs from the list + for(std::list::iterator itr = m_lAddsEntryList.begin(); itr != m_lAddsEntryList.end(); ++itr) + { + if (Creature* pAdd = m_creature->SummonCreature((*itr), m_afAddPosX[j], ADD_POS_Y, ADD_POS_Z, ADD_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiAddGUIDs[j] = pAdd->GetGUID(); + + ++j; + } + } + else + { + for(std::list::iterator itr = m_lAddsEntryList.begin(); itr != m_lAddsEntryList.end(); ++itr) + { + Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiAddGUIDs[j]); + + //object already removed, not exist + if (!pAdd) + { + if (pAdd = m_creature->SummonCreature((*itr), m_afAddPosX[j], ADD_POS_Y, ADD_POS_Z, ADD_ORIENT, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiAddGUIDs[j] = pAdd->GetGUID(); + } + ++j; + } + } + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + + DoScriptText(SAY_AGGRO, m_creature); + AddsAttack(pWho); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_MALACRASS, IN_PROGRESS); + } + + void AddsAttack(Unit* pWho) + { + for(uint8 i = 0; i < MAX_ACTIVE_ADDS; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiAddGUIDs[i])) + { + if (!pAdd->getVictim()) + pAdd->AI()->AttackStart(pWho); + } + } + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + CleanAdds(); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_MALACRASS, DONE); + } + + void CleanAdds() + { + for(uint8 i = 0; i < MAX_ACTIVE_ADDS; ++i) + { + if (Creature* pAdd = m_creature->GetMap()->GetCreature(m_auiAddGUIDs[i])) + { + pAdd->AI()->EnterEvadeMode(); + pAdd->SetDeathState(JUST_DIED); + } + } + + memset(&m_auiAddGUIDs, 0, sizeof(m_auiAddGUIDs)); + m_lAddsEntryList.clear(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_malacrass(Creature* pCreature) +{ + return new boss_malacrassAI(pCreature); +} + +//common AI for adds +struct MANGOS_DLL_DECL boss_malacrass_addAI : public ScriptedAI +{ + boss_malacrass_addAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() { } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void MoveInLineOfSight(Unit* pWho) + { + } + + void KilledUnit(Unit* pVictim) + { + if (!m_pInstance) + return; + + if (Creature* pMalacrass = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_MALACRASS))) + pMalacrass->AI()->KilledUnit(pVictim); + } + + void JustDied(Unit* pKiller) + { + if (!m_pInstance) + return; + + if (Creature* pMalacrass = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_MALACRASS))) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_ADD_DIED1, pMalacrass); break; + case 1: DoScriptText(SAY_ADD_DIED2, pMalacrass); break; + case 2: DoScriptText(SAY_ADD_DIED3, pMalacrass); break; + } + } + } + + bool IsEnemyPlayerInRangeForSpell(uint32 uiSpellId) + { + SpellEntry const* pSpell = GetSpellStore()->LookupEntry(uiSpellId); + + //if spell not valid + if (!pSpell) + return false; + + //spell known, so lookup using rangeIndex + SpellRangeEntry const* pSpellRange = GetSpellRangeStore()->LookupEntry(pSpell->rangeIndex); + + //not valid, so return + if (!pSpellRange) + return false; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator iter = tList.begin();iter != tList.end(); ++iter) + { + Unit* pTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid()); + + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + { + //if target further away than maxrange or closer than minrange, statement is false + if (m_creature->IsInRange(pTarget, pSpellRange->minRange, pSpellRange->maxRange)) + return true; + } + } + + return false; + } +}; + +enum +{ + SPELL_BLOODLUST = 43578, + SPELL_CLEAVE = 15496 +}; + +struct MANGOS_DLL_DECL mob_thurgAI : public boss_malacrass_addAI +{ + mob_thurgAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiBloodlustTimer; + uint32 m_uiCleaveTimer; + + void Reset() + { + m_uiBloodlustTimer = 15000; + m_uiCleaveTimer = 10000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBloodlustTimer < uiDiff) + { + std::list lTempList = DoFindFriendlyMissingBuff(50.0f, SPELL_BLOODLUST); + + if (!lTempList.empty()) + { + Unit* pTarget = *(lTempList.begin()); + DoCastSpellIfCan(pTarget, SPELL_BLOODLUST); + } + + m_uiBloodlustTimer = 12000; + } + else + m_uiBloodlustTimer -= uiDiff; + + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 12000; + } + else + m_uiCleaveTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_thurg(Creature* pCreature) +{ + return new mob_thurgAI(pCreature); +} + +enum +{ + SPELL_ARCANE_TORRENT = 33390, + SPELL_FLASH_HEAL = 43575, + SPELL_DISPEL_MAGIC = 43577 +}; + +const float RANGE_FRIENDLY_TARGET = 40.0; + +struct MANGOS_DLL_DECL mob_alyson_antilleAI : public boss_malacrass_addAI +{ + mob_alyson_antilleAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiArcaneTorrentTimer; + uint32 m_uiFlashHealTimer; + uint32 m_uiDispelMagicTimer; + + void Reset() + { + m_uiArcaneTorrentTimer = 0; + m_uiFlashHealTimer = 2500; + m_uiDispelMagicTimer = 10000; + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 20.0f); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiArcaneTorrentTimer < uiDiff) + { + if (IsEnemyPlayerInRangeForSpell(SPELL_ARCANE_TORRENT)) + { + DoCastSpellIfCan(m_creature, SPELL_ARCANE_TORRENT); + m_uiArcaneTorrentTimer = 60000; + } + else + m_uiArcaneTorrentTimer = 1000; + } + else + m_uiArcaneTorrentTimer -= uiDiff; + + if (m_uiFlashHealTimer < uiDiff) + { + //this will fail if we previously was following target and pTarget is now different than before + if (Unit* pTarget = DoSelectLowestHpFriendly(RANGE_FRIENDLY_TARGET*2, 30000)) + { + if (pTarget->IsWithinDistInMap(m_creature, RANGE_FRIENDLY_TARGET)) + { + DoCastSpellIfCan(pTarget, SPELL_FLASH_HEAL); + + //if not already chasing, start chase + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 20.0f); + } + else + { + //if chasing, start follow target instead + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveFollow(pTarget, 20.0f, 0.0f); + } + } + } + + m_uiFlashHealTimer = 2500; + } + else + m_uiFlashHealTimer -= uiDiff; + + if (m_uiDispelMagicTimer < uiDiff) + { + Unit* pTarget = NULL; + std::list lTempList = DoFindFriendlyCC(RANGE_FRIENDLY_TARGET); + + if (!lTempList.empty()) + pTarget = *(lTempList.begin()); + else + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (pTarget) + DoCastSpellIfCan(pTarget, SPELL_DISPEL_MAGIC); + + m_uiDispelMagicTimer = 12000; + } + else + m_uiDispelMagicTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_alyson_antille(Creature* pCreature) +{ + return new mob_alyson_antilleAI(pCreature); +} + +enum +{ + SPELL_FIREBOLT = 43584 +}; + +struct MANGOS_DLL_DECL mob_gazakrothAI : public boss_malacrass_addAI +{ + mob_gazakrothAI(Creature* pCreature) : boss_malacrass_addAI(pCreature){ Reset(); } + + uint32 m_uiFireboltTimer; + + void Reset() + { + m_uiFireboltTimer = 1000; + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 20.0f); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiFireboltTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIREBOLT); + m_uiFireboltTimer = 1000; + } + else + m_uiFireboltTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_gazakroth(Creature* pCreature) +{ + return new mob_gazakrothAI(pCreature); +} + +enum +{ + SPELL_FLAME_BREATH = 43582, + SPELL_THUNDERCLAP = 43583 +}; + +struct MANGOS_DLL_DECL mob_lord_raadanAI : public boss_malacrass_addAI +{ + mob_lord_raadanAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiFlameBreathTimer; + uint32 m_uiThunderclapTimer; + + void Reset() + { + m_uiFlameBreathTimer = 8000; + m_uiThunderclapTimer = 13000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiThunderclapTimer < uiDiff) + { + if (IsEnemyPlayerInRangeForSpell(SPELL_THUNDERCLAP)) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THUNDERCLAP); + m_uiThunderclapTimer = 12000; + } + else + m_uiThunderclapTimer = 1000; + } + else + m_uiThunderclapTimer -= uiDiff; + + if (m_uiFlameBreathTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FLAME_BREATH); + m_uiFlameBreathTimer = 12000; + } + else + m_uiFlameBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_lord_raadan(Creature* pCreature) +{ + return new mob_lord_raadanAI(pCreature); +} + +enum +{ + SPELL_PSYCHIC_WAIL = 43590 +}; + +struct MANGOS_DLL_DECL mob_darkheartAI : public boss_malacrass_addAI +{ + mob_darkheartAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiPsychicWailTimer; + + void Reset() + { + m_uiPsychicWailTimer = 8000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiPsychicWailTimer < uiDiff) + { + if (IsEnemyPlayerInRangeForSpell(SPELL_PSYCHIC_WAIL)) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PSYCHIC_WAIL); + m_uiPsychicWailTimer = 12000; + } + else + m_uiPsychicWailTimer = 1000; + } + else + m_uiPsychicWailTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_darkheart(Creature* pCreature) +{ + return new mob_darkheartAI(pCreature); +} + +enum +{ + SPELL_VENOM_SPIT = 43579 +}; + +struct MANGOS_DLL_DECL mob_slitherAI : public boss_malacrass_addAI +{ + mob_slitherAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiVenomSpitTimer; + + void Reset() + { + m_uiVenomSpitTimer = 4000; + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 20.0f); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiVenomSpitTimer < uiDiff) + { + if (Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pVictim, SPELL_VENOM_SPIT); + + m_uiVenomSpitTimer = 2500; + } + else + m_uiVenomSpitTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_slither(Creature* pCreature) +{ + return new mob_slitherAI(pCreature); +} + +enum +{ + SPELL_VOLATILE_INFECTION = 43586 +}; + +struct MANGOS_DLL_DECL mob_fenstalkerAI : public boss_malacrass_addAI +{ + mob_fenstalkerAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiVolatileInfectionTimer; + + void Reset() + { + m_uiVolatileInfectionTimer = 15000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiVolatileInfectionTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_VOLATILE_INFECTION); + m_uiVolatileInfectionTimer = 12000; + } + else + m_uiVolatileInfectionTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_fenstalker(Creature* pCreature) +{ + return new mob_fenstalkerAI(pCreature); +} + +enum +{ + SPELL_COLD_STARE = 43593, + SPELL_MIGHTY_BLOW = 43592, +}; + +struct MANGOS_DLL_DECL mob_koraggAI : public boss_malacrass_addAI +{ + mob_koraggAI(Creature* pCreature) : boss_malacrass_addAI(pCreature) { Reset(); } + + uint32 m_uiColdStareTimer; + uint32 m_uiMightyBlowTimer; + + void Reset() + { + m_uiColdStareTimer = 15000; + m_uiMightyBlowTimer = 10000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiMightyBlowTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MIGHTY_BLOW); + m_uiMightyBlowTimer = 12000; + } + else + m_uiMightyBlowTimer -= uiDiff; + + if (m_uiColdStareTimer < uiDiff) + { + if (Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pVictim, SPELL_COLD_STARE); + + m_uiColdStareTimer = 12000; + } + else + m_uiColdStareTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_koragg(Creature* pCreature) +{ + return new mob_koraggAI(pCreature); +} + +void AddSC_boss_malacrass() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_malacrass"; + newscript->GetAI = &GetAI_boss_malacrass; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_thurg"; + newscript->GetAI = &GetAI_mob_thurg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_gazakroth"; + newscript->GetAI = &GetAI_mob_gazakroth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_lord_raadan"; + newscript->GetAI = &GetAI_mob_lord_raadan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_darkheart"; + newscript->GetAI = &GetAI_mob_darkheart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_slither"; + newscript->GetAI = &GetAI_mob_slither; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fenstalker"; + newscript->GetAI = &GetAI_mob_fenstalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_koragg"; + newscript->GetAI = &GetAI_mob_koragg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_alyson_antille"; + newscript->GetAI = &GetAI_mob_alyson_antille; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp b/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp new file mode 100644 index 0000000..a427834 --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp @@ -0,0 +1,257 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nalorakk +SD%Complete: 80 +SDComment: Todo: Trash Waves +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" + +enum +{ + SAY_WAVE1_AGGRO = -1568010, + SAY_WAVE2_STAIR1 = -1568011, + SAY_WAVE3_STAIR2 = -1568012, + SAY_WAVE4_PLATFORM = -1568013, + + SAY_EVENT1_SACRIFICE = -1568014, + SAY_EVENT2_SACRIFICE = -1568015, + + SAY_AGGRO = -1568016, + SAY_SURGE = -1568017, + SAY_TOBEAR = -1568018, + SAY_TOTROLL = -1568019, + SAY_BERSERK = -1568020, + SAY_SLAY1 = -1568021, + SAY_SLAY2 = -1568022, + SAY_DEATH = -1568023, + + SPELL_BERSERK = 45078, //unsure, this increases damage, size and speed + + //Defines for Troll form + SPELL_BRUTALSWIPE = 42384, + SPELL_MANGLE = 42389, + SPELL_SURGE = 42402, + SPELL_BEARFORM = 42377, + + //Defines for Bear form + SPELL_LACERATINGSLASH = 42395, + SPELL_RENDFLESH = 42397, + SPELL_DEAFENINGROAR = 42398 +}; + +struct MANGOS_DLL_DECL boss_nalorakkAI : public ScriptedAI +{ + boss_nalorakkAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ChangeForm_Timer; + uint32 BrutalSwipe_Timer; + uint32 Mangle_Timer; + uint32 Surge_Timer; + uint32 LaceratingSlash_Timer; + uint32 RendFlesh_Timer; + uint32 DeafeningRoar_Timer; + uint32 ShapeShiftCheck_Timer; + uint32 Berserk_Timer; + bool inBearForm; + bool Berserking; + bool ChangedToBear; + bool ChangedToTroll; + + void Reset() + { + ChangeForm_Timer = 45000; + BrutalSwipe_Timer = 12000; + Mangle_Timer = 15000; + Surge_Timer = 20000; + LaceratingSlash_Timer = 6000; + RendFlesh_Timer = 6000; + DeafeningRoar_Timer = 20000; + ShapeShiftCheck_Timer = 40000; + Berserk_Timer = 600000; + inBearForm = false; + Berserking = false; + ChangedToBear = false; + ChangedToTroll = true; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_NALORAKK, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Berserking + if ((Berserk_Timer < diff) && (!Berserking)) + { + if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) + { + DoScriptText(SAY_BERSERK, m_creature); + Berserking = true; + } + }else Berserk_Timer -= diff; + + //Don't check if we're shapeshifted every UpdateAI + if (ShapeShiftCheck_Timer < diff) + { + //This will return true if we have bearform aura + inBearForm = m_creature->HasAura(SPELL_BEARFORM, EFFECT_INDEX_0); + ShapeShiftCheck_Timer = 1000; + }else ShapeShiftCheck_Timer -= diff; + + //Spells for Troll Form (only to be casted if we NOT have bear phase aura) + if (!inBearForm) + { + //We just changed to troll form! + if (!ChangedToTroll) + { + DoScriptText(SAY_TOTROLL, m_creature); + + ChangedToTroll = true; + ChangedToBear = false; + //Reset spell timers + LaceratingSlash_Timer = urand(6000, 25000); + RendFlesh_Timer = urand(6000, 25000); + DeafeningRoar_Timer = urand(15000, 25000); + ShapeShiftCheck_Timer = 40000; + } + + //Brutal Swipe (some sources may say otherwise, but I've never seen this in Bear form) + if (BrutalSwipe_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BRUTALSWIPE); + BrutalSwipe_Timer = urand(7000, 15000); + }else BrutalSwipe_Timer -= diff; + + //Mangle + if (Mangle_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MANGLE); + Mangle_Timer = urand(3000, 15000); + }else Mangle_Timer -= diff; + + //Surge + if (Surge_Timer < diff) + { + //select a random unit other than the main tank + Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + //if there aren't other units, cast on the tank + if (!target) + target = m_creature->getVictim(); + + if (DoCastSpellIfCan(target, SPELL_SURGE) == CAST_OK) + DoScriptText(SAY_SURGE, m_creature); + + Surge_Timer = urand(15000, 32500); + }else Surge_Timer -= diff; + + //Change to Bear Form if we're in Troll Form for 45sec + if (ChangeForm_Timer < diff) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoCastSpellIfCan(m_creature, SPELL_BEARFORM); + //And 30sec (bear form) + 45sec (troll form) before we should cast this again + ChangeForm_Timer = 75000; + }else ChangeForm_Timer -= diff; + } + //Spells for Bear Form (only to be casted if we have bear phase aura) + else + { + //We just changed to bear form! + if (!ChangedToBear) + { + DoScriptText(SAY_TOBEAR, m_creature); + + ChangedToBear = true; + ChangedToTroll = false; + //Reset spell timers + Surge_Timer = urand(15000, 32000); + BrutalSwipe_Timer = urand(7000, 20000); + Mangle_Timer = urand(3000, 20000); + ShapeShiftCheck_Timer = 25000; + } + + //Lacerating Slash + if (LaceratingSlash_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_LACERATINGSLASH); + LaceratingSlash_Timer = urand(6000, 20000); + }else LaceratingSlash_Timer -= diff; + + //Rend Flesh + if (RendFlesh_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_RENDFLESH); + RendFlesh_Timer = urand(6000, 20000); + }else RendFlesh_Timer -= diff; + + //Deafening Roar + if (DeafeningRoar_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DEAFENINGROAR); + DeafeningRoar_Timer = urand(15000, 25000); + }else DeafeningRoar_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nalorakk(Creature* pCreature) +{ + return new boss_nalorakkAI(pCreature); +} + +void AddSC_boss_nalorakk() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nalorakk"; + newscript->GetAI = &GetAI_boss_nalorakk; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp b/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp new file mode 100644 index 0000000..cd41d39 --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp @@ -0,0 +1,153 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Zuljin +SD%Complete: 0 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" + +enum +{ + SAY_INTRO = -1568056, + SAY_AGGRO = -1568057, + SAY_BEAR_TRANSFORM = -1568058, + SAY_EAGLE_TRANSFORM = -1568059, + SAY_LYNX_TRANSFORM = -1568060, + SAY_DRAGONHAWK_TRANSFORM = -1568061, + SAY_FIRE_BREATH = -1568062, + SAY_BERSERK = -1568053, + SAY_KILL1 = -1568064, + SAY_KILL2 = -1568065, + SAY_DEATH = -1568066, + + // Troll Form + SPELL_WHIRLWIND = 17207, + SPELL_GRIEVOUS_THROW = 43093, //removes debuff after full healed + + // Bear Form + SPELL_CREEPING_PARALYSIS = 43095, //should cast on the whole raid + SPELL_OVERPOWER = 43456, //use after melee attack dodged + + // Eagle Form + SPELL_ENERGY_STORM = 43983, //enemy area aura, trigger 42577 + SPELL_ZAP_INFORM = 42577, + SPELL_ZAP_DAMAGE = 43137, //1250 damage + SPELL_SUMMON_CYCLONE = 43112, //summon four feather vortex + CREATURE_FEATHER_VORTEX = 24136, + SPELL_CYCLONE_VISUAL = 43119, //trigger 43147 visual + SPELL_CYCLONE_PASSIVE = 43120, //trigger 43121 (4y aoe) every second + + // Lynx Form + SPELL_CLAW_RAGE_HASTE = 42583, + SPELL_CLAW_RAGE_TRIGGER = 43149, + SPELL_CLAW_RAGE_DAMAGE = 43150, + SPELL_LYNX_RUSH_HASTE = 43152, + SPELL_LYNX_RUSH_DAMAGE = 43153, + + // Dragonhawk Form + SPELL_FLAME_WHIRL = 43213, //trigger two spells + SPELL_FLAME_BREATH = 43215, + SPELL_SUMMON_PILLAR = 43216, //summon 24187 + CREATURE_COLUMN_OF_FIRE = 24187, + SPELL_PILLAR_TRIGGER = 43218, //trigger 43217 + + // Cosmetic + SPELL_SPIRIT_AURA = 42466, + SPELL_SIPHON_SOUL = 43501, + + // Transforms + SPELL_SHAPE_OF_THE_BEAR = 42594, + SPELL_SHAPE_OF_THE_EAGLE = 42606, + SPELL_SHAPE_OF_THE_LYNX = 42607, + SPELL_SHAPE_OF_THE_DRAGONHAWK = 42608, + + SPELL_BERSERK = 45078, + + WEAPON_ID = 33975, + + PHASE_BEAR = 0, + PHASE_EAGLE = 1, + PHASE_LYNX = 2, + PHASE_DRAGONHAWK = 3, + PHASE_TROLL = 4 +}; + +//coords for going for changing form +const float CENTER_X = 120.148811f; +const float CENTER_Y = 703.713684f; +const float CENTER_Z = 45.111477f; + +struct MANGOS_DLL_DECL boss_zuljinAI : public ScriptedAI +{ + boss_zuljinAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_ZULJIN, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_zuljin(Creature* pCreature) +{ + return new boss_zuljinAI(pCreature); +} + +void AddSC_boss_zuljin() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_zuljin"; + newscript->GetAI = &GetAI_boss_zuljin; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp b/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp new file mode 100644 index 0000000..a12b9e8 --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp @@ -0,0 +1,364 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Zulaman +SD%Complete: 25 +SDComment: +SDCategory: Zul'Aman +EndScriptData */ + +#include "precompiled.h" +#include "zulaman.h" + +struct MANGOS_DLL_DECL instance_zulaman : public ScriptedInstance +{ + instance_zulaman(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 m_auiRandVendor[MAX_VENDOR]; + std::string strInstData; + + uint32 m_uiEventTimer; + uint32 m_uiEventMinuteStep; + + uint32 m_uiGongCount; + + uint64 m_uiAkilzonGUID; + uint64 m_uiNalorakkGUID; + uint64 m_uiJanalaiGUID; + uint64 m_uiHalazziGUID; + uint64 m_uiSpiritLynxGUID; + uint64 m_uiZuljinGUID; + uint64 m_uiMalacrassGUID; + uint64 m_uiHarrisonGUID; + + uint64 m_uiStrangeGongGUID; + uint64 m_uiMassiveGateGUID; + uint64 m_uiMalacrassEntranceGUID; + + std::list m_lEggsGUIDList; + uint32 m_uiEggsRemainingCount_Left; + uint32 m_uiEggsRemainingCount_Right; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_auiRandVendor, 0, sizeof(m_auiRandVendor)); + + m_uiEventTimer = MINUTE*IN_MILLISECONDS; + m_uiEventMinuteStep = MINUTE/3; + + m_uiGongCount = 0; + + m_uiAkilzonGUID = 0; + m_uiNalorakkGUID = 0; + m_uiJanalaiGUID = 0; + m_uiHalazziGUID = 0; + m_uiSpiritLynxGUID = 0; + m_uiZuljinGUID = 0; + m_uiMalacrassGUID = 0; + m_uiHarrisonGUID = 0; + + m_uiStrangeGongGUID = 0; + m_uiMassiveGateGUID = 0; + m_uiMalacrassEntranceGUID = 0; + + m_lEggsGUIDList.clear(); + m_uiEggsRemainingCount_Left = 20; + m_uiEggsRemainingCount_Right = 20; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 23574: m_uiAkilzonGUID = pCreature->GetGUID(); break; + case 23576: m_uiNalorakkGUID = pCreature->GetGUID(); break; + case 23578: m_uiJanalaiGUID = pCreature->GetGUID(); break; + case 23577: m_uiHalazziGUID = pCreature->GetGUID(); break; + case 23863: m_uiZuljinGUID = pCreature->GetGUID(); break; + case 24239: m_uiMalacrassGUID = pCreature->GetGUID(); break; + case 24358: m_uiHarrisonGUID = pCreature->GetGUID(); break; + case NPC_SPIRIT_LYNX: m_uiSpiritLynxGUID = pCreature->GetGUID(); break; + case NPC_EGG: + if (m_auiEncounter[3] != DONE) + m_lEggsGUIDList.push_back(pCreature->GetGUID()); + break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 187359: + m_uiStrangeGongGUID = pGo->GetGUID(); + break; + case 186728: + m_uiMassiveGateGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == IN_PROGRESS || m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 186305: + m_uiMalacrassEntranceGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Zulaman: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_EVENT_RUN: + if (uiData == SPECIAL) + { + ++m_uiGongCount; + if (m_uiGongCount == 5) + m_auiEncounter[0] = uiData; + } + if (uiData == IN_PROGRESS) + { + DoUseDoorOrButton(m_uiMassiveGateGUID); + DoUpdateWorldState(WORLD_STATE_COUNTER,m_uiEventMinuteStep); + DoUpdateWorldState(WORLD_STATE_ID,1); + m_auiEncounter[0] = uiData; + } + break; + case TYPE_AKILZON: + if (uiData == DONE) + { + if (m_auiEncounter[0] == IN_PROGRESS) + { + m_uiEventMinuteStep += MINUTE/6; //add 10 minutes + DoUpdateWorldState(WORLD_STATE_COUNTER,m_uiEventMinuteStep); + } + } + m_auiEncounter[1] = uiData; + break; + case TYPE_NALORAKK: + if (uiData == DONE) + { + if (m_auiEncounter[0] == IN_PROGRESS) + { + m_uiEventMinuteStep += MINUTE/4; //add 15 minutes + DoUpdateWorldState(WORLD_STATE_COUNTER,m_uiEventMinuteStep); + } + } + m_auiEncounter[2] = uiData; + break; + case TYPE_JANALAI: + if (uiData == NOT_STARTED) + { + m_uiEggsRemainingCount_Left = 20; + m_uiEggsRemainingCount_Right = 20; + + if (!m_lEggsGUIDList.empty()) + { + for(std::list::iterator itr = m_lEggsGUIDList.begin(); itr != m_lEggsGUIDList.end(); ++itr) + { + if (Creature* pEgg = instance->GetCreature(*itr)) + { + if (!pEgg->isAlive()) + pEgg->Respawn(); + } + } + } + } + if (uiData == DONE) + m_lEggsGUIDList.clear(); + + m_auiEncounter[3] = uiData; + break; + case TYPE_HALAZZI: + m_auiEncounter[4] = uiData; + break; + case TYPE_ZULJIN: + m_auiEncounter[5] = uiData; + break; + case TYPE_MALACRASS: + m_auiEncounter[6] = uiData; + break; + + case DATA_J_EGGS_RIGHT: + --m_uiEggsRemainingCount_Right; + break; + case DATA_J_EGGS_LEFT: + --m_uiEggsRemainingCount_Left; + break; + + case TYPE_RAND_VENDOR_1: + m_auiRandVendor[0] = uiData; + break; + case TYPE_RAND_VENDOR_2: + m_auiRandVendor[1] = uiData; + break; + default: + error_log("SD2: Instance Zulaman: ERROR SetData = %u for type %u does not exist/not implemented.",uiType,uiData); + break; + } + + if (m_auiEncounter[1] == DONE && m_auiEncounter[2] == DONE && m_auiEncounter[3] == DONE && + m_auiEncounter[4] == DONE && m_auiEncounter[5] != IN_PROGRESS) + DoUseDoorOrButton(m_uiMalacrassEntranceGUID); + + if (uiData == DONE || (uiType == TYPE_EVENT_RUN && uiData == IN_PROGRESS)) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6]; + + //not changing m_uiEncounter[0], TYPE_EVENT_RUN must not reset to NOT_STARTED + for(uint8 i = 1; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_EVENT_RUN: + return m_auiEncounter[0]; + case TYPE_AKILZON: + return m_auiEncounter[1]; + case TYPE_NALORAKK: + return m_auiEncounter[2]; + case TYPE_JANALAI: + return m_auiEncounter[3]; + case TYPE_HALAZZI: + return m_auiEncounter[4]; + case TYPE_ZULJIN: + return m_auiEncounter[5]; + case TYPE_MALACRASS: + return m_auiEncounter[6]; + + case DATA_J_EGGS_LEFT: + return m_uiEggsRemainingCount_Left; + case DATA_J_EGGS_RIGHT: + return m_uiEggsRemainingCount_Right; + + case TYPE_RAND_VENDOR_1: + return m_auiRandVendor[0]; + case TYPE_RAND_VENDOR_2: + return m_auiRandVendor[1]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_AKILZON: + return m_uiAkilzonGUID; + case DATA_NALORAKK: + return m_uiNalorakkGUID; + case DATA_JANALAI: + return m_uiJanalaiGUID; + case DATA_HALAZZI: + return m_uiHalazziGUID; + case DATA_SPIRIT_LYNX: + return m_uiSpiritLynxGUID; + case DATA_ZULJIN: + return m_uiZuljinGUID; + case DATA_MALACRASS: + return m_uiMalacrassGUID; + case DATA_HARRISON: + return m_uiHarrisonGUID; + case DATA_GO_GONG: + return m_uiStrangeGongGUID; + case DATA_GO_ENTRANCE: + return m_uiMassiveGateGUID; + case DATA_GO_MALACRASS_GATE: + return m_uiMalacrassEntranceGUID; + } + return 0; + } + + void Update(uint32 uiDiff) + { + if (GetData(TYPE_EVENT_RUN) == IN_PROGRESS) + { + if (m_uiEventTimer <= uiDiff) + { + if (m_uiEventMinuteStep == 0) + { + debug_log("SD2: Instance Zulaman: event time reach end, event failed."); + m_auiEncounter[0] = FAIL; + return; + } + + --m_uiEventMinuteStep; + DoUpdateWorldState(WORLD_STATE_COUNTER, m_uiEventMinuteStep); + debug_log("SD2: Instance Zulaman: minute decrease to %u.",m_uiEventMinuteStep); + + m_uiEventTimer = MINUTE*IN_MILLISECONDS; + } + else + m_uiEventTimer -= uiDiff; + } + } +}; + +InstanceData* GetInstanceData_instance_zulaman(Map* pMap) +{ + return new instance_zulaman(pMap); +} + +void AddSC_instance_zulaman() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_zulaman"; + pNewScript->GetInstanceData = &GetInstanceData_instance_zulaman; + pNewScript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/zulaman.cpp b/scripts/eastern_kingdoms/zulaman/zulaman.cpp new file mode 100644 index 0000000..0ba94d6 --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/zulaman.cpp @@ -0,0 +1,262 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zulaman +SD%Complete: 90 +SDComment: Forest Frog will turn into different NPC's. Workaround to prevent new entry from running this script +SDCategory: Zul'Aman +EndScriptData */ + +/* ContentData +npc_forest_frog +EndContentData */ + +#include "precompiled.h" +#include "zulaman.h" +#include "escort_ai.h" + +/*###### +## npc_forest_frog +######*/ + +enum +{ + SPELL_REMOVE_AMANI_CURSE = 43732, + SPELL_PUSH_MOJO = 43923, + ENTRY_FOREST_FROG = 24396 +}; + +struct MANGOS_DLL_DECL npc_forest_frogAI : public ScriptedAI +{ + npc_forest_frogAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() { } + + void DoSpawnRandom() + { + if (m_pInstance) + { + uint32 cEntry = 0; + switch(urand(0, 10)) + { + case 0: cEntry = 24024; break; //Kraz + case 1: cEntry = 24397; break; //Mannuth + case 2: cEntry = 24403; break; //Deez + case 3: cEntry = 24404; break; //Galathryn + case 4: cEntry = 24405; break; //Adarrah + case 5: cEntry = 24406; break; //Fudgerick + case 6: cEntry = 24407; break; //Darwen + case 7: cEntry = 24445; break; //Mitzi + case 8: cEntry = 24448; break; //Christian + case 9: cEntry = 24453; break; //Brennan + case 10: cEntry = 24455; break; //Hollee + } + + if (!m_pInstance->GetData(TYPE_RAND_VENDOR_1)) + if (!urand(0, 9)) + cEntry = 24408; //Gunter + + if (!m_pInstance->GetData(TYPE_RAND_VENDOR_2)) + if (!urand(0, 9)) + cEntry = 24409; //Kyren + + if (cEntry) + m_creature->UpdateEntry(cEntry); + + if (cEntry == 24408) + m_pInstance->SetData(TYPE_RAND_VENDOR_1,DONE); + + if (cEntry == 24409) + m_pInstance->SetData(TYPE_RAND_VENDOR_2,DONE); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_REMOVE_AMANI_CURSE && caster->GetTypeId() == TYPEID_PLAYER && m_creature->GetEntry() == ENTRY_FOREST_FROG) + { + //increase or decrease chance of mojo? + if (!urand(0, 49)) + DoCastSpellIfCan(caster, SPELL_PUSH_MOJO, CAST_TRIGGERED); + else + DoSpawnRandom(); + } + } +}; +CreatureAI* GetAI_npc_forest_frog(Creature* pCreature) +{ + return new npc_forest_frogAI(pCreature); +} + +/*###### +## npc_harrison_jones_za +######*/ + +enum +{ + SAY_START = -1568079, + SAY_AT_GONG = -1568080, + SAY_OPEN_ENTRANCE = -1568081, + + SPELL_BANGING_THE_GONG = 45225 +}; + +#define GOSSIP_ITEM_BEGIN "Thanks for the concern, but we intend to explore Zul'Aman." + +struct MANGOS_DLL_DECL npc_harrison_jones_zaAI : public npc_escortAI +{ + npc_harrison_jones_zaAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void WaypointReached(uint32 uiPointId) + { + if (!m_pInstance) + return; + + switch(uiPointId) + { + case 1: + DoScriptText(SAY_AT_GONG, m_creature); + + if (GameObject* pEntranceDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_GO_GONG))) + pEntranceDoor->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + + //Start bang gong for 2min + m_creature->CastSpell(m_creature, SPELL_BANGING_THE_GONG, false); + SetEscortPaused(true); + break; + case 3: + DoScriptText(SAY_OPEN_ENTRANCE, m_creature); + break; + case 4: + m_pInstance->SetData(TYPE_EVENT_RUN,IN_PROGRESS); + //TODO: Spawn group of Amani'shi Savage and make them run to entrance + break; + } + } + + void Reset() { } + + void StartEvent() + { + DoScriptText(SAY_START, m_creature); + Start(); + } + + void SetHoldState(bool bOnHold) + { + SetEscortPaused(bOnHold); + + //Stop banging gong if still + if (m_pInstance && m_pInstance->GetData(TYPE_EVENT_RUN) == SPECIAL && m_creature->HasAura(SPELL_BANGING_THE_GONG)) + m_creature->RemoveAurasDueToSpell(SPELL_BANGING_THE_GONG); + } +}; + +bool GossipHello_npc_harrison_jones_za(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pInstance && pInstance->GetData(TYPE_EVENT_RUN) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_harrison_jones_za(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (npc_harrison_jones_zaAI* pHarrisonAI = dynamic_cast(pCreature->AI())) + pHarrisonAI->StartEvent(); + + pPlayer->CLOSE_GOSSIP_MENU(); + } + return true; +} + +CreatureAI* GetAI_npc_harrison_jones_za(Creature* pCreature) +{ + return new npc_harrison_jones_zaAI(pCreature); +} + +/*###### +## go_strange_gong +######*/ + +//Unsure how this Gong must work. Here we always return false to allow Mangos always process further. +bool GOHello_go_strange_gong(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance->GetData(TYPE_EVENT_RUN) == SPECIAL) + { + if (Creature* pCreature = pGo->GetMap()->GetCreature(pInstance->GetData64(DATA_HARRISON))) + { + if (npc_harrison_jones_zaAI* pHarrisonAI = dynamic_cast(pCreature->AI())) + pHarrisonAI->SetHoldState(false); + } + else + error_log("SD2: Instance Zulaman: go_strange_gong failed"); + + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + return false; + } + + pInstance->SetData(TYPE_EVENT_RUN, SPECIAL); + return false; +} + +void AddSC_zulaman() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_forest_frog"; + newscript->GetAI = &GetAI_npc_forest_frog; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_harrison_jones_za"; + newscript->GetAI = &GetAI_npc_harrison_jones_za; + newscript->pGossipHello = &GossipHello_npc_harrison_jones_za; + newscript->pGossipSelect = &GossipSelect_npc_harrison_jones_za; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_strange_gong"; + newscript->pGOHello = &GOHello_go_strange_gong; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulaman/zulaman.h b/scripts/eastern_kingdoms/zulaman/zulaman.h new file mode 100644 index 0000000..a76e421 --- /dev/null +++ b/scripts/eastern_kingdoms/zulaman/zulaman.h @@ -0,0 +1,60 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ZULAMAN_H +#define DEF_ZULAMAN_H + +enum InstanceZA +{ + MAX_ENCOUNTER = 7, + MAX_VENDOR = 2, + + SAY_INST_RELEASE = -1568067, + SAY_INST_BEGIN = -1568068, + SAY_INST_PROGRESS_1 = -1568069, + SAY_INST_PROGRESS_2 = -1568070, + SAY_INST_PROGRESS_3 = -1568071, + SAY_INST_WARN_1 = -1568072, + SAY_INST_WARN_2 = -1568073, + SAY_INST_WARN_3 = -1568074, + SAY_INST_WARN_4 = -1568075, + SAY_INST_SACRIF1 = -1568076, + SAY_INST_SACRIF2 = -1568077, + SAY_INST_COMPLETE = -1568078, + + WORLD_STATE_ID = 3104, + WORLD_STATE_COUNTER = 3106, + + TYPE_EVENT_RUN = 1, + TYPE_AKILZON = 2, + TYPE_NALORAKK = 3, + TYPE_JANALAI = 4, + TYPE_HALAZZI = 5, + TYPE_MALACRASS = 6, + TYPE_ZULJIN = 7, + + TYPE_RAND_VENDOR_1 = 8, + TYPE_RAND_VENDOR_2 = 9, + + DATA_AKILZON = 10, + DATA_NALORAKK = 11, + DATA_JANALAI = 12, + DATA_HALAZZI = 13, + DATA_MALACRASS = 14, + DATA_ZULJIN = 15, + DATA_HARRISON = 16, + DATA_SPIRIT_LYNX = 17, + + DATA_J_EGGS_RIGHT = 19, + DATA_J_EGGS_LEFT = 20, + + DATA_GO_GONG = 21, + DATA_GO_MALACRASS_GATE = 22, + DATA_GO_ENTRANCE = 23, + + NPC_EGG = 23817, + NPC_SPIRIT_LYNX = 24143 +}; + +#endif diff --git a/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp b/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp new file mode 100644 index 0000000..ffc7b65 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp @@ -0,0 +1,289 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Arlokk +SD%Complete: 95 +SDComment: Wrong cleave and red aura is missing. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +bool GOHello_go_gong_of_bethekk(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) + { + if (pInstance->GetData(TYPE_ARLOKK) == DONE || pInstance->GetData(TYPE_ARLOKK) == IN_PROGRESS) + return true; + + pInstance->SetData(TYPE_ARLOKK, IN_PROGRESS); + } + + return false; +} + +enum +{ + SAY_AGGRO = -1309011, + SAY_FEAST_PANTHER = -1309012, + SAY_DEATH = -1309013, + + SPELL_SHADOWWORDPAIN = 23952, + SPELL_GOUGE = 24698, + SPELL_MARK = 24210, + SPELL_CLEAVE = 26350, //Perhaps not right. Not a red aura... + SPELL_PANTHER_TRANSFORM = 24190, + + MODEL_ID_NORMAL = 15218, + MODEL_ID_PANTHER = 15215, + MODEL_ID_BLANK = 11686, + + NPC_ZULIAN_PROWLER = 15101 +}; + +struct MANGOS_DLL_DECL boss_arlokkAI : public ScriptedAI +{ + boss_arlokkAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiShadowWordPain_Timer; + uint32 m_uiGouge_Timer; + uint32 m_uiMark_Timer; + uint32 m_uiCleave_Timer; + uint32 m_uiVanish_Timer; + uint32 m_uiVisible_Timer; + + uint32 m_uiSummon_Timer; + uint32 m_uiSummonCount; + + uint64 m_uiMarkedGUID; + + bool m_bIsPhaseTwo; + bool m_bIsVanished; + + void Reset() + { + m_uiShadowWordPain_Timer = 8000; + m_uiGouge_Timer = 14000; + m_uiMark_Timer = 35000; + m_uiCleave_Timer = 4000; + m_uiVanish_Timer = 60000; + m_uiVisible_Timer = 6000; + + m_uiSummon_Timer = 5000; + m_uiSummonCount = 0; + + m_bIsPhaseTwo = false; + m_bIsVanished = false; + + m_uiMarkedGUID = 0; + + m_creature->SetDisplayId(MODEL_ID_NORMAL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED); + + //we should be summoned, so despawn + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + m_creature->SetDisplayId(MODEL_ID_NORMAL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARLOKK, DONE); + } + + void DoSummonPhanters() + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiMarkedGUID)) + { + if (pPlayer->isAlive()) + DoScriptText(SAY_FEAST_PANTHER, m_creature, pPlayer); + } + + m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998f, -1649.6734f, 41.4800f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970f, -1606.4840f, 41.2979f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + } + + void JustSummoned(Creature* pSummoned) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiMarkedGUID)) + { + if (pPlayer->isAlive()) + pSummoned->AI()->AttackStart(pPlayer); + } + + ++m_uiSummonCount; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsPhaseTwo) + { + if (m_uiShadowWordPain_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); + m_uiShadowWordPain_Timer = 15000; + } + else + m_uiShadowWordPain_Timer -= uiDiff; + + if (m_uiMark_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (Player* pMark = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + DoCastSpellIfCan(pMark, SPELL_MARK); + m_uiMarkedGUID = pMark->GetGUID(); + } + else + { + if (m_uiMarkedGUID) + m_uiMarkedGUID = 0; + + error_log("SD2: boss_arlokk could not accuire a new target to mark."); + } + } + + m_uiMark_Timer = 15000; + } + else + m_uiMark_Timer -= uiDiff; + } + else + { + //Cleave_Timer + if (m_uiCleave_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 16000; + } + else + m_uiCleave_Timer -= uiDiff; + + //Gouge_Timer + if (m_uiGouge_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GOUGE); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80); + + m_uiGouge_Timer = urand(17000, 27000); + } + else + m_uiGouge_Timer -= uiDiff; + } + + if (m_uiSummonCount <= 30) + { + if (m_uiSummon_Timer < uiDiff) + { + DoSummonPhanters(); + m_uiSummon_Timer = 5000; + } + else + m_uiSummon_Timer -= uiDiff; + } + + if (m_uiVanish_Timer < uiDiff) + { + //Invisble Model + m_creature->SetDisplayId(MODEL_ID_BLANK); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + m_creature->AttackStop(); + DoResetThreat(); + + m_bIsVanished = true; + + m_uiVanish_Timer = 45000; + m_uiVisible_Timer = 6000; + } + else + m_uiVanish_Timer -= uiDiff; + + if (m_bIsVanished) + { + if (m_uiVisible_Timer < uiDiff) + { + //The Panther Model + m_creature->SetDisplayId(MODEL_ID_PANTHER); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + AttackStart(pTarget); + + m_bIsPhaseTwo = true; + m_bIsVanished = false; + } + else + m_uiVisible_Timer -= uiDiff; + } + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_arlokk(Creature* pCreature) +{ + return new boss_arlokkAI(pCreature); +} + +void AddSC_boss_arlokk() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_gong_of_bethekk"; + newscript->pGOHello = &GOHello_go_gong_of_bethekk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_arlokk"; + newscript->GetAI = &GetAI_boss_arlokk; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp b/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp new file mode 100644 index 0000000..b5732b9 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp @@ -0,0 +1,88 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gahz'ranka +SD%Complete: 85 +SDComment: Massive Geyser with knockback not working. Spell buggy. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FROSTBREATH 16099 +#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... +#define SPELL_SLAM 24326 + +struct MANGOS_DLL_DECL boss_gahzrankaAI : public ScriptedAI +{ + boss_gahzrankaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + uint32 Frostbreath_Timer; + uint32 MassiveGeyser_Timer; + uint32 Slam_Timer; + + void Reset() + { + Frostbreath_Timer = 8000; + MassiveGeyser_Timer = 25000; + Slam_Timer = 17000; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Frostbreath_Timer + if (Frostbreath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBREATH); + Frostbreath_Timer = urand(7000, 11000); + }else Frostbreath_Timer -= diff; + + //MassiveGeyser_Timer + if (MassiveGeyser_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MASSIVEGEYSER); + DoResetThreat(); + + MassiveGeyser_Timer = urand(22000, 32000); + }else MassiveGeyser_Timer -= diff; + + //Slam_Timer + if (Slam_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SLAM); + Slam_Timer = urand(12000, 20000); + }else Slam_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gahzranka(Creature* pCreature) +{ + return new boss_gahzrankaAI(pCreature); +} + +void AddSC_boss_gahzranka() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gahzranka"; + newscript->GetAI = &GetAI_boss_gahzranka; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp b/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp new file mode 100644 index 0000000..ad2bc1f --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp @@ -0,0 +1,88 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grilek +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SPELL_AVARTAR 24646 //The Enrage Spell +#define SPELL_GROUNDTREMOR 6524 + +struct MANGOS_DLL_DECL boss_grilekAI : public ScriptedAI +{ + boss_grilekAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Avartar_Timer; + uint32 GroundTremor_Timer; + + void Reset() + { + Avartar_Timer = urand(15000, 25000); + GroundTremor_Timer = urand(8000, 16000); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Avartar_Timer + if (Avartar_Timer < diff) + { + + DoCastSpellIfCan(m_creature, SPELL_AVARTAR); + Unit* target = NULL; + + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50); + if (target) + AttackStart(target); + + Avartar_Timer = urand(25000, 35000); + }else Avartar_Timer -= diff; + + //GroundTremor_Timer + if (GroundTremor_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GROUNDTREMOR); + GroundTremor_Timer = urand(12000, 16000); + }else GroundTremor_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grilek(Creature* pCreature) +{ + return new boss_grilekAI(pCreature); +} + +void AddSC_boss_grilek() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grilek"; + newscript->GetAI = &GetAI_boss_grilek; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp b/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp new file mode 100644 index 0000000..b509fe3 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp @@ -0,0 +1,251 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hakkar +SD%Complete: 95 +SDComment: Blood siphon spell buggy cause of Core Issue. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309020 +#define SAY_FLEEING -1309021 +#define SAY_MINION_DESTROY -1309022 //where does it belong? +#define SAY_PROTECT_ALTAR -1309023 //where does it belong? + +#define SPELL_BLOODSIPHON 24322 +#define SPELL_CORRUPTEDBLOOD 24328 +#define SPELL_CAUSEINSANITY 24327 //Not working disabled. +#define SPELL_WILLOFHAKKAR 24178 +#define SPELL_ENRAGE 24318 + +// The Aspects of all High Priests +#define SPELL_ASPECT_OF_JEKLIK 24687 +#define SPELL_ASPECT_OF_VENOXIS 24688 +#define SPELL_ASPECT_OF_MARLI 24686 +#define SPELL_ASPECT_OF_THEKAL 24689 +#define SPELL_ASPECT_OF_ARLOKK 24690 + +struct MANGOS_DLL_DECL boss_hakkarAI : public ScriptedAI +{ + boss_hakkarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 BloodSiphon_Timer; + uint32 CorruptedBlood_Timer; + uint32 CauseInsanity_Timer; + uint32 WillOfHakkar_Timer; + uint32 Enrage_Timer; + + uint32 CheckJeklik_Timer; + uint32 CheckVenoxis_Timer; + uint32 CheckMarli_Timer; + uint32 CheckThekal_Timer; + uint32 CheckArlokk_Timer; + + uint32 AspectOfJeklik_Timer; + uint32 AspectOfVenoxis_Timer; + uint32 AspectOfMarli_Timer; + uint32 AspectOfThekal_Timer; + uint32 AspectOfArlokk_Timer; + + bool Enraged; + + void Reset() + { + BloodSiphon_Timer = 90000; + CorruptedBlood_Timer = 25000; + CauseInsanity_Timer = 17000; + WillOfHakkar_Timer = 17000; + Enrage_Timer = 600000; + + CheckJeklik_Timer = 1000; + CheckVenoxis_Timer = 2000; + CheckMarli_Timer = 3000; + CheckThekal_Timer = 4000; + CheckArlokk_Timer = 5000; + + AspectOfJeklik_Timer = 4000; + AspectOfVenoxis_Timer = 7000; + AspectOfMarli_Timer = 12000; + AspectOfThekal_Timer = 8000; + AspectOfArlokk_Timer = 18000; + + Enraged = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //BloodSiphon_Timer + if (BloodSiphon_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLOODSIPHON); + BloodSiphon_Timer = 90000; + }else BloodSiphon_Timer -= diff; + + //CorruptedBlood_Timer + if (CorruptedBlood_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CORRUPTEDBLOOD); + CorruptedBlood_Timer = urand(30000, 45000); + }else CorruptedBlood_Timer -= diff; + + //CauseInsanity_Timer + /*if (CauseInsanity_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_CAUSEINSANITY); + + CauseInsanity_Timer = urand(35000, 43000); + }else CauseInsanity_Timer -= diff;*/ + + //WillOfHakkar_Timer + if (WillOfHakkar_Timer < diff) + { + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_WILLOFHAKKAR); + + WillOfHakkar_Timer = urand(25000, 35000); + }else WillOfHakkar_Timer -= diff; + + if (!Enraged && Enrage_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + + //Checking if Jeklik is dead. If not we cast her Aspect + if (CheckJeklik_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_JEKLIK) != DONE) + { + if (AspectOfJeklik_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ASPECT_OF_JEKLIK); + AspectOfJeklik_Timer = urand(10000, 14000); + }else AspectOfJeklik_Timer -= diff; + } + } + CheckJeklik_Timer = 1000; + }else CheckJeklik_Timer -= diff; + + //Checking if Venoxis is dead. If not we cast his Aspect + if (CheckVenoxis_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_VENOXIS) != DONE) + { + if (AspectOfVenoxis_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ASPECT_OF_VENOXIS); + AspectOfVenoxis_Timer = 8000; + }else AspectOfVenoxis_Timer -= diff; + } + } + CheckVenoxis_Timer = 1000; + }else CheckVenoxis_Timer -= diff; + + //Checking if Marli is dead. If not we cast her Aspect + if (CheckMarli_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_MARLI) != DONE) + { + if (AspectOfMarli_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI); + AspectOfMarli_Timer = 10000; + }else AspectOfMarli_Timer -= diff; + + } + } + CheckMarli_Timer = 1000; + }else CheckMarli_Timer -= diff; + + //Checking if Thekal is dead. If not we cast his Aspect + if (CheckThekal_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_THEKAL) != DONE) + { + if (AspectOfThekal_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ASPECT_OF_THEKAL); + AspectOfThekal_Timer = 15000; + }else AspectOfThekal_Timer -= diff; + } + } + CheckThekal_Timer = 1000; + }else CheckThekal_Timer -= diff; + + //Checking if Arlokk is dead. If yes we cast her Aspect + if (CheckArlokk_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_ARLOKK) != DONE) + { + if (AspectOfArlokk_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ASPECT_OF_ARLOKK); + DoResetThreat(); + + AspectOfArlokk_Timer = urand(10000, 15000); + }else AspectOfArlokk_Timer -= diff; + } + } + CheckArlokk_Timer = 1000; + }else CheckArlokk_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_hakkar(Creature* pCreature) +{ + return new boss_hakkarAI(pCreature); +} + +void AddSC_boss_hakkar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hakkar"; + newscript->GetAI = &GetAI_boss_hakkar; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp b/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp new file mode 100644 index 0000000..8bba263 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp @@ -0,0 +1,96 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hazzarah +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SPELL_MANABURN 26046 +#define SPELL_SLEEP 24664 + +struct MANGOS_DLL_DECL boss_hazzarahAI : public ScriptedAI +{ + boss_hazzarahAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ManaBurn_Timer; + uint32 Sleep_Timer; + uint32 Illusions_Timer; + + void Reset() + { + ManaBurn_Timer = urand(4000, 10000); + Sleep_Timer = urand(10000, 18000); + Illusions_Timer = urand(10000, 18000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ManaBurn_Timer + if (ManaBurn_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MANABURN); + ManaBurn_Timer = urand(8000, 16000); + }else ManaBurn_Timer -= diff; + + //Sleep_Timer + if (Sleep_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SLEEP); + Sleep_Timer = urand(12000, 20000); + }else Sleep_Timer -= diff; + + //Illusions_Timer + if (Illusions_Timer < diff) + { + //We will summon 3 illusions that will spawn on a random gamer and attack this gamer + //We will just use one model for the beginning + for(int i = 0; i < 3; ++i) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (Creature* pIllusion = m_creature->SummonCreature(15163, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000)) + pIllusion->AI()->AttackStart(pTarget); + } + } + + Illusions_Timer = urand(15000, 25000); + }else Illusions_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hazzarah(Creature* pCreature) +{ + return new boss_hazzarahAI(pCreature); +} + +void AddSC_boss_hazzarah() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hazzarah"; + newscript->GetAI = &GetAI_boss_hazzarah; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp b/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp new file mode 100644 index 0000000..cf1b3cb --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp @@ -0,0 +1,284 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Jeklik +SD%Complete: 85 +SDComment: Problem in finding the right flying batriders for spawning and making them fly. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309002 +#define SAY_RAIN_FIRE -1309003 +#define SAY_DEATH -1309004 + +#define SPELL_CHARGE 22911 +#define SPELL_SONICBURST 23918 +#define SPELL_SCREECH 6605 +#define SPELL_SHADOW_WORD_PAIN 23952 +#define SPELL_MIND_FLAY 23953 +#define SPELL_CHAIN_MIND_FLAY 26044 //Right ID unknown. So disabled +#define SPELL_GREATERHEAL 23954 +#define SPELL_BAT_FORM 23966 + +// Batriders Spell +#define SPELL_BOMB 40332 //Wrong ID but Magmadars bomb is not working... + +struct MANGOS_DLL_DECL boss_jeklikAI : public ScriptedAI +{ + boss_jeklikAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Charge_Timer; + uint32 SonicBurst_Timer; + uint32 Screech_Timer; + uint32 SpawnBats_Timer; + uint32 ShadowWordPain_Timer; + uint32 MindFlay_Timer; + uint32 ChainMindFlay_Timer; + uint32 GreaterHeal_Timer; + uint32 SpawnFlyingBats_Timer; + + bool PhaseTwo; + + void Reset() + { + Charge_Timer = 20000; + SonicBurst_Timer = 8000; + Screech_Timer = 13000; + SpawnBats_Timer = 60000; + ShadowWordPain_Timer = 6000; + MindFlay_Timer = 11000; + ChainMindFlay_Timer = 26000; + GreaterHeal_Timer = 50000; + SpawnFlyingBats_Timer = 10000; + + PhaseTwo = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoCastSpellIfCan(m_creature,SPELL_BAT_FORM); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_JEKLIK, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() > 50.0f) + { + if (Charge_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_CHARGE); + + Charge_Timer = urand(15000, 30000); + }else Charge_Timer -= diff; + + if (SonicBurst_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SONICBURST); + SonicBurst_Timer = urand(8000, 13000); + }else SonicBurst_Timer -= diff; + + if (Screech_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SCREECH); + Screech_Timer = urand(18000, 26000); + }else Screech_Timer -= diff; + + if (SpawnBats_Timer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + Creature* Bat = NULL; + Bat = m_creature->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368, -12291.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368, -12289.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368, -12293.6220f, -1380.2640f, 144.8304f, 5.483f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + SpawnBats_Timer = 60000; + }else SpawnBats_Timer -= diff; + } + else + { + if (PhaseTwo) + { + if (PhaseTwo && ShadowWordPain_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoCastSpellIfCan(target, SPELL_SHADOW_WORD_PAIN); + ShadowWordPain_Timer = urand(12000, 18000); + } + }ShadowWordPain_Timer -=diff; + + if (MindFlay_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MIND_FLAY); + MindFlay_Timer = 16000; + }MindFlay_Timer -=diff; + + if (ChainMindFlay_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAIN_MIND_FLAY); + ChainMindFlay_Timer = urand(15000, 30000); + }ChainMindFlay_Timer -=diff; + + if (GreaterHeal_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature,SPELL_GREATERHEAL); + GreaterHeal_Timer = urand(25000, 35000); + }GreaterHeal_Timer -=diff; + + if (SpawnFlyingBats_Timer < diff) + { + Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + Creature* FlyingBat = m_creature->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (FlyingBat) + { + if (target) + FlyingBat->AI()->AttackStart(target); + } + + SpawnFlyingBats_Timer = urand(10000, 15000); + } else SpawnFlyingBats_Timer -=diff; + } + else + { + m_creature->SetDisplayId(15219); + DoResetThreat(); + PhaseTwo = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +//Flying Bat +struct MANGOS_DLL_DECL mob_batriderAI : public ScriptedAI +{ + mob_batriderAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Bomb_Timer; + uint32 Check_Timer; + + void Reset() + { + Bomb_Timer = 2000; + Check_Timer = 1000; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void UpdateAI (const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Bomb_Timer + if (Bomb_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, SPELL_BOMB); + Bomb_Timer = 5000; + } + }else Bomb_Timer -= diff; + + //Check_Timer + if (Check_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_JEKLIK) == DONE) + { + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jeklik(Creature* pCreature) +{ + return new boss_jeklikAI(pCreature); +} + +CreatureAI* GetAI_mob_batrider(Creature* pCreature) +{ + return new mob_batriderAI(pCreature); +} + +void AddSC_boss_jeklik() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_jeklik"; + newscript->GetAI = &GetAI_boss_jeklik; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_batrider"; + newscript->GetAI = &GetAI_mob_batrider; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp b/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp new file mode 100644 index 0000000..08234ba --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp @@ -0,0 +1,276 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Jin'do the Hexxer +SD%Complete: 85 +SDComment: Mind Control not working because of core bug. Shades visible for all. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309014 + +#define SPELL_BRAINWASHTOTEM 24262 +#define SPELL_POWERFULLHEALINGWARD 24309 //We will not use this spell. We will summon a totem by script cause the spell totems will not cast. +#define SPELL_HEX 24053 +#define SPELL_DELUSIONSOFJINDO 24306 +#define SPELL_SHADEOFJINDO 24308 //We will not use this spell. We will summon a shade by script. + +//Healing Ward Spell +#define SPELL_HEAL 38588 //Totems are not working right. Right heal spell ID is 24311 but this spell is not casting... + +//Shade of Jindo Spell +#define SPELL_SHADOWSHOCK 19460 +#define SPELL_INVISIBLE 24699 + +struct MANGOS_DLL_DECL boss_jindoAI : public ScriptedAI +{ + boss_jindoAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 BrainWashTotem_Timer; + uint32 HealingWard_Timer; + uint32 Hex_Timer; + uint32 Delusions_Timer; + uint32 Teleport_Timer; + + void Reset() + { + BrainWashTotem_Timer = 20000; + HealingWard_Timer = 16000; + Hex_Timer = 8000; + Delusions_Timer = 10000; + Teleport_Timer = 5000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //BrainWashTotem_Timer + if (BrainWashTotem_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_BRAINWASHTOTEM); + BrainWashTotem_Timer = urand(18000, 26000); + }else BrainWashTotem_Timer -= diff; + + //HealingWard_Timer + if (HealingWard_Timer < diff) + { + //DoCastSpellIfCan(m_creature, SPELL_POWERFULLHEALINGWARD); + m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); + HealingWard_Timer = urand(14000, 20000); + }else HealingWard_Timer -= diff; + + //Hex_Timer + if (Hex_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HEX); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80); + + Hex_Timer = urand(12000, 20000); + }else Hex_Timer -= diff; + + //Casting the delusion curse with a shade. So shade will attack the same target with the curse. + if (Delusions_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoCastSpellIfCan(target, SPELL_DELUSIONSOFJINDO); + + Creature *Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Shade) + Shade->AI()->AttackStart(target); + } + + Delusions_Timer = urand(4000, 12000); + }else Delusions_Timer -= diff; + + //Teleporting a random gamer and spawning 9 skeletons that will attack this gamer + if (Teleport_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoTeleportPlayer(target, -11583.7783f, -1249.4278f, 77.5471f, 4.745f); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(target,-100); + + Creature *Skeletons; + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + } + + Teleport_Timer = urand(15000, 23000); + }else Teleport_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Healing Ward +struct MANGOS_DLL_DECL mob_healing_wardAI : public ScriptedAI +{ + mob_healing_wardAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Heal_Timer; + + void Reset() + { + Heal_Timer = 2000; + } + + void UpdateAI (const uint32 diff) + { + //Heal_Timer + if (Heal_Timer < diff) + { + if (m_pInstance) + { + if (Unit *pJindo = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_JINDO))) + { + if (pJindo->isAlive()) + DoCastSpellIfCan(pJindo, SPELL_HEAL); + } + } + Heal_Timer = 3000; + }else Heal_Timer -= diff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +//Shade of Jindo +struct MANGOS_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI +{ + mob_shade_of_jindoAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ShadowShock_Timer; + + void Reset() + { + ShadowShock_Timer = 1000; + m_creature->CastSpell(m_creature, SPELL_INVISIBLE,true); + } + + void UpdateAI (const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowShock_Timer + if (ShadowShock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWSHOCK); + ShadowShock_Timer = 2000; + }else ShadowShock_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jindo(Creature* pCreature) +{ + return new boss_jindoAI(pCreature); +} + +CreatureAI* GetAI_mob_healing_ward(Creature* pCreature) +{ + return new mob_healing_wardAI(pCreature); +} + +CreatureAI* GetAI_mob_shade_of_jindo(Creature* pCreature) +{ + return new mob_shade_of_jindoAI(pCreature); +} + +void AddSC_boss_jindo() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_jindo"; + newscript->GetAI = &GetAI_boss_jindo; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_healing_ward"; + newscript->GetAI = &GetAI_mob_healing_ward; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shade_of_jindo"; + newscript->GetAI = &GetAI_mob_shade_of_jindo; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp b/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp new file mode 100644 index 0000000..9dc763a --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp @@ -0,0 +1,445 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mandokir +SD%Complete: 80 +SDComment: test Threating Gaze. Script depends on ACID script for Vilebranch Speaker +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +enum +{ + NPC_OHGAN = 14988, + NPC_CHAINED_SPIRIT = 15117, //resing spirits + + SAY_AGGRO = -1309015, + SAY_DING_KILL = -1309016, + SAY_GRATS_JINDO = -1309017, + SAY_WATCH = -1309018, + SAY_WATCH_WHISPER = -1309019, + + EMOTE_RAGE = -1309024, + + SPELL_CHARGE = 24315, + SPELL_CLEAVE = 20691, + SPELL_FEAR = 29321, + SPELL_WHIRLWIND = 24236, + SPELL_MORTAL_STRIKE = 24573, + SPELL_ENRAGE = 23537, + SPELL_WATCH = 24314, + SPELL_SUMMON_PLAYER = 25104, + SPELL_LEVEL_UP = 24312, + + //Ohgans Spells + SPELL_SUNDERARMOR = 24317, + + //Chained Spirit Spells + SPELL_REVIVE = 24341, + + POINT_DOWNSTAIRS = 1 +}; + +struct SpawnLocations +{ + float fX, fY, fZ, fAng; +}; + +static SpawnLocations aSpirits[]= +{ + {-12150.9f, -1956.24f, 133.407f, 2.57835f}, + {-12157.1f, -1972.78f, 133.947f, 2.64903f}, + {-12172.3f, -1982.63f, 134.061f, 1.48664f}, + {-12194.0f, -1979.54f, 132.194f, 1.45916f}, + {-12211.3f, -1978.49f, 133.580f, 1.35705f}, + {-12228.4f, -1977.10f, 132.728f, 1.25495f}, + {-12250.0f, -1964.78f, 135.066f, 0.92901f}, + {-12264.0f, -1953.08f, 134.072f, 0.62663f}, + {-12289.0f, -1924.00f, 132.620f, 5.37829f}, + {-12267.3f, -1902.26f, 131.328f, 5.32724f}, + {-12255.3f, -1893.53f, 134.026f, 5.06413f}, + {-12229.9f, -1891.39f, 134.704f, 4.40047f}, + {-12215.9f, -1889.09f, 137.273f, 4.70285f}, + {-12200.5f, -1890.69f, 135.777f, 4.84422f}, + {-12186.0f, -1890.12f, 134.261f, 4.36513f}, + {-12246.3f, -1890.09f, 135.475f, 4.73427f}, + {-12170.7f, -1894.85f, 133.852f, 3.51690f}, + {-12279.0f, -1931.92f, 136.130f, 0.04151f}, + {-12266.1f, -1940.72f, 132.606f, 0.70910f} +}; + +static SpawnLocations aMandokirDownstairsPos = {-12196.30f, -1948.37f, 130.31f, 3.77f}; + +struct MANGOS_DLL_DECL boss_mandokirAI : public ScriptedAI +{ + boss_mandokirAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_uiOhganGUID = 0; + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiWatch_Timer; + uint32 m_uiCleave_Timer; + uint32 m_uiWhirlwind_Timer; + uint32 m_uiFear_Timer; + uint32 m_uiMortalStrike_Timer; + uint32 m_uiCheck_Timer; + + uint8 m_uiKillCount; + + bool m_bRaptorDead; + bool m_bMandokirDownstairs; + + float m_fTargetThreat; + uint64 m_uiWatchTarget; + uint64 m_uiOhganGUID; + + void Reset() + { + m_uiWatch_Timer = 33000; + m_uiCleave_Timer = 7000; + m_uiWhirlwind_Timer = 20000; + m_uiFear_Timer = 1000; + m_uiMortalStrike_Timer = 1000; + m_uiCheck_Timer = 1000; + + m_uiKillCount = 0; + + m_bRaptorDead = false; + m_bMandokirDownstairs = false; + + m_fTargetThreat = 0.0f; + m_uiWatchTarget = 0; + + if (Creature* pOhgan = m_creature->GetMap()->GetCreature(m_uiOhganGUID)) + pOhgan->ForcedDespawn(); + } + + // should evade to bottom of the stairs when raid fail + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_OHGAN, FAIL); + + std::list lSpirits; //despawn spirits + GetCreatureListWithEntryInGrid(lSpirits, m_creature, NPC_CHAINED_SPIRIT, DEFAULT_VISIBILITY_INSTANCE); + + if (!lSpirits.empty()) + { + for(std::list::iterator iter = lSpirits.begin(); iter != lSpirits.end(); ++iter) + { + if ((*iter) && (*iter)->isAlive()) + (*iter)->ForcedDespawn(); + } + } + + m_bMandokirDownstairs = false; + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() == TYPEID_PLAYER) + { + ++m_uiKillCount; + + if (m_uiKillCount == 3) + { + DoScriptText(SAY_DING_KILL, m_creature); + + if (m_pInstance) + { + if (Creature* jTemp = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_JINDO))) + { + if (jTemp->isAlive()) + DoScriptText(SAY_GRATS_JINDO, jTemp); + } + } + + DoCastSpellIfCan(m_creature, SPELL_LEVEL_UP, CAST_TRIGGERED); + m_creature->SetLevel(m_creature->getLevel() + 1); + m_uiKillCount = 0; + } + + if (m_creature->isInCombat()) + { + if (Creature *pSpirit = GetClosestCreatureWithEntry(pVictim, NPC_CHAINED_SPIRIT, 50.0f)) + pSpirit->CastSpell(pVictim, SPELL_REVIVE, false); + } + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->SetInCombatWithZone(); + + uint32 uiCount = sizeof(aSpirits)/sizeof(SpawnLocations); + + for(uint8 i = 0; i < uiCount; ++i) + m_creature->SummonCreature(NPC_CHAINED_SPIRIT, aSpirits[i].fX, aSpirits[i].fY, aSpirits[i].fZ, aSpirits[i].fAng, TEMPSUMMON_CORPSE_DESPAWN, 0); + + //At combat start Mandokir is mounted so we must unmount it first + m_creature->Unmount(); + + //And summon his raptor + m_creature->SummonCreature(NPC_OHGAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 35000); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_OHGAN) + { + m_uiOhganGUID = pSummoned->GetGUID(); + + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(m_creature->getVictim()); + } + } + + void SummonedCreatureDespawn(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_OHGAN) + m_uiOhganGUID = 0; + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_WATCH) + { + DoScriptText(SAY_WATCH, m_creature, pTarget); + DoScriptText(SAY_WATCH_WHISPER, m_creature, pTarget); + + m_uiWatchTarget = pTarget->GetGUID(); + m_fTargetThreat = m_creature->getThreatManager().getThreat(pTarget); + m_uiWatch_Timer = 6000; + + //Could use this instead of hard coded timer for the above (but no script access), + //but would still a hack since we should better use the dummy, at aura removal + //SpellDurationEntry* const pDuration = sSpellDurationStore.LookupEntry(pSpell->DurationIndex); + } + } + + void MovementInform(uint32 uiMoveType, uint32 uiPointId) + { + if (uiMoveType != POINT_MOTION_TYPE || !m_pInstance) + return; + + if (uiPointId == POINT_DOWNSTAIRS) + { + // evaded at least once, and then attackable + if (m_pInstance->GetData(TYPE_OHGAN) == FAIL) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + else + m_creature->SetInCombatWithZone(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_bMandokirDownstairs && m_pInstance && (m_pInstance->GetData(TYPE_OHGAN) == SPECIAL || m_pInstance->GetData(TYPE_OHGAN) == FAIL)) + { + m_bMandokirDownstairs = true; + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->GetMotionMaster()->MovePoint(POINT_DOWNSTAIRS, aMandokirDownstairsPos.fX, aMandokirDownstairsPos.fY, aMandokirDownstairsPos.fZ); + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiWatch_Timer < uiDiff) + { + //If someone is watched + if (m_uiWatchTarget) + { + Player* pWatchTarget = m_creature->GetMap()->GetPlayer(m_uiWatchTarget); + + //If threat is higher that previously saved, mandokir will act + if (pWatchTarget && pWatchTarget->isAlive() && m_creature->getThreatManager().getThreat(pWatchTarget) > m_fTargetThreat) + { + if (!m_creature->IsWithinLOSInMap(pWatchTarget)) + m_creature->CastSpell(pWatchTarget, SPELL_SUMMON_PLAYER, true); + + DoCastSpellIfCan(pWatchTarget, SPELL_CHARGE); + } + + m_uiWatchTarget = 0; + } + else + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) + m_creature->CastSpell(pPlayer, SPELL_WATCH, false); + } + } + + m_uiWatch_Timer = 20000; + } + else + m_uiWatch_Timer -= uiDiff; + + if (!m_uiWatchTarget) + { + //Cleave + if (m_uiCleave_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 7000; + } + else + m_uiCleave_Timer -= uiDiff; + + //Whirlwind + if (m_uiWhirlwind_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + m_uiWhirlwind_Timer = 18000; + } + else + m_uiWhirlwind_Timer -= uiDiff; + + //If more then 3 targets in melee range mandokir will cast fear + if (m_uiFear_Timer < uiDiff) + { + uint8 uiTargetInRangeCount = 0; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pTarget = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(pTarget, ATTACK_DISTANCE)) + ++uiTargetInRangeCount; + } + + if (uiTargetInRangeCount > 3) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FEAR); + + m_uiFear_Timer = 4000; + } + else + m_uiFear_Timer -= uiDiff; + + //Mortal Strike if target below 50% hp + if (m_creature->getVictim()->GetHealthPercent() < 50.0f) + { + if (m_uiMortalStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + m_uiMortalStrike_Timer = 15000; + } + else + m_uiMortalStrike_Timer -= uiDiff; + } + } + + //Checking if Ohgan is dead. If yes Mandokir will enrage. + if (!m_bRaptorDead && m_pInstance && m_pInstance->GetData(TYPE_OHGAN) == DONE) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + DoScriptText(EMOTE_RAGE, m_creature); + m_bRaptorDead = true; + } + + DoMeleeAttackIfReady(); + } +}; + +//Ohgan +struct MANGOS_DLL_DECL mob_ohganAI : public ScriptedAI +{ + mob_ohganAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiSunderArmor_Timer; + + void Reset() + { + m_uiSunderArmor_Timer = 5000; + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_OHGAN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->isInCombat()) + { + if (Creature* pSpirit = GetClosestCreatureWithEntry(pVictim, NPC_CHAINED_SPIRIT, 50.0f)) + pSpirit->CastSpell(pVictim, SPELL_REVIVE, false); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // SunderArmor + if (m_uiSunderArmor_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUNDERARMOR); + m_uiSunderArmor_Timer = urand(10000, 15000); + } + else + m_uiSunderArmor_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mandokir(Creature* pCreature) +{ + return new boss_mandokirAI(pCreature); +} + +CreatureAI* GetAI_mob_ohgan(Creature* pCreature) +{ + return new mob_ohganAI(pCreature); +} + +void AddSC_boss_mandokir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_mandokir"; + newscript->GetAI = &GetAI_boss_mandokir; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ohgan"; + newscript->GetAI = &GetAI_mob_ohgan; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp b/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp new file mode 100644 index 0000000..e8f1323 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp @@ -0,0 +1,367 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Marli +SD%Complete: 100 +SDComment: Vilebranch Speaker respawned when wipe? +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +enum +{ + GO_EGG = 179985, + + // the spider + NPC_SPAWN_OF_MARLI = 15041, + + SAY_AGGRO = -1309005, + SAY_TRANSFORM = -1309006, + SAY_TRANSFORMBACK = -1309024, + SAY_SPIDER_SPAWN = -1309007, + SAY_DEATH = -1309008, + + SPELL_CHARGE = 22911, + SPELL_ENVELOPINGWEBS = 24110, + SPELL_POISONVOLLEY = 24099, + SPELL_SPIDER_FORM = 24084, + SPELL_DRAIN_LIFE = 24300, + SPELL_CORROSIVE_POISON = 24111, + SPELL_TRANSFORM_BACK = 24085, + SPELL_TRASH = 3391, + SPELL_HATCH = 24083, //visual + + //The Spider Spells + SPELL_LEVELUP = 24312 //visual +}; + +struct MANGOS_DLL_DECL boss_marliAI : public ScriptedAI +{ + boss_marliAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_uiDefaultModel = m_creature->GetDisplayId(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiPoisonVolley_Timer; + uint32 m_uiSpawnSpider_Timer; + uint32 m_uiCharge_Timer; + uint32 m_uiAspect_Timer; + uint32 m_uiTransform_Timer; + uint32 m_uiTransformBack_Timer; + uint32 m_uiDrainLife_Timer; + uint32 m_uiCorrosivePoison_Timer; + uint32 m_uiWebs_Timer; + uint32 m_uiTrash_Timer; + + bool m_bFirstSpidersAreSpawned; + bool m_bIsInPhaseTwo; + bool m_bHasWebbed; + + uint32 m_uiDefaultModel; + + void Reset() + { + m_uiPoisonVolley_Timer = 15000; + m_uiSpawnSpider_Timer = 20000; + m_uiAspect_Timer = 12000; + m_uiTransform_Timer = 60000; + m_uiTransformBack_Timer = 60000; + m_uiDrainLife_Timer = 30000; + m_uiCorrosivePoison_Timer = 1000; + m_uiWebs_Timer = 5000; + m_uiTrash_Timer = 5000; + + m_bFirstSpidersAreSpawned = false; + m_bIsInPhaseTwo = false; + m_bHasWebbed = false; + + std::list lSpiderEggs; + GetGameObjectListWithEntryInGrid(lSpiderEggs, m_creature, GO_EGG, DEFAULT_VISIBILITY_INSTANCE); + if (lSpiderEggs.empty()) + debug_log("SD2: boss_marli, no Eggs with the entry %u were found", GO_EGG); + else + { + for(std::list::iterator iter = lSpiderEggs.begin(); iter != lSpiderEggs.end(); ++iter) + { + if ((*iter)->GetGoState() == GO_STATE_ACTIVE) + (*iter)->SetGoState(GO_STATE_READY); + } + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (!m_bFirstSpidersAreSpawned) + { + DoScriptText(SAY_SPIDER_SPAWN, m_creature); + DoCastSpellIfCan(m_creature, SPELL_HATCH); + + for(uint8 i = 0; i < 4 ; ++i) + { + if (GameObject *pEgg = SelectNextEgg()) + { + pEgg->SetGoState(GO_STATE_ACTIVE); + m_creature->SummonCreature(NPC_SPAWN_OF_MARLI, pEgg->GetPositionX(), pEgg->GetPositionY(), pEgg->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + } + } + + m_bFirstSpidersAreSpawned = true; + } + } + + GameObject* SelectNextEgg() + { + std::list lEggs; + GetGameObjectListWithEntryInGrid(lEggs, m_creature, GO_EGG, DEFAULT_VISIBILITY_INSTANCE); + if (lEggs.empty()) + debug_log("SD2: boss_marli, no Eggs with the entry %i were found", GO_EGG); + else + { + lEggs.sort(ObjectDistanceOrder(m_creature)); + for(std::list::iterator iter = lEggs.begin(); iter != lEggs.end(); ++iter) + { + if ((*iter)->GetGoState() == (GO_STATE_READY)) + return (*iter); + } + } + return NULL; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SPAWN_OF_MARLI) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MARLI, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsInPhaseTwo) + { + if (m_uiPoisonVolley_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_POISONVOLLEY); + m_uiPoisonVolley_Timer = urand(10000, 20000); + } + else + m_uiPoisonVolley_Timer -= uiDiff; + + if (m_uiDrainLife_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DRAIN_LIFE); + m_uiDrainLife_Timer = urand(20000, 50000); + } + else + m_uiDrainLife_Timer -= uiDiff; + + if (m_uiSpawnSpider_Timer < uiDiff) + { + if (GameObject *pEgg = SelectNextEgg()) + { + pEgg->SetGoState(GO_STATE_ACTIVE); + m_creature->SummonCreature(NPC_SPAWN_OF_MARLI, pEgg->GetPositionX(), pEgg->GetPositionY(), pEgg->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + } + m_uiSpawnSpider_Timer = urand(20000, 30000); + } + else + m_uiSpawnSpider_Timer -= uiDiff; + } + else + { + if (!m_bHasWebbed && m_uiWebs_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ENVELOPINGWEBS); + m_uiWebs_Timer = urand(10000, 15000); + m_uiCharge_Timer = 1000; + m_bHasWebbed = true; + } + else + m_uiWebs_Timer -= uiDiff; + + if (m_bHasWebbed && m_uiCharge_Timer < uiDiff) + { + //Shouldn't be random target but highestaggro not Webbed player + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoCastSpellIfCan(pTarget, SPELL_CHARGE); + DoResetThreat(); + AttackStart(pTarget); + m_bHasWebbed = false; + /* + DoResetThreat(); + Unit* pTarget = NULL; + uint8 i = 0 ; + while (i < 5) // max 3 tries to get a random target with power_mana + { + ++i; //not aggro leader + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (pTarget && pTarget->getPowerType() == POWER_MANA) + i=5; + } + */ + } + m_uiWebs_Timer = urand(10000, 20000); + } + else + m_uiCharge_Timer -= uiDiff; + + if (m_uiCorrosivePoison_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CORROSIVE_POISON); + m_uiCorrosivePoison_Timer = urand(25000, 35000); + } + else + m_uiCorrosivePoison_Timer -= uiDiff; + } + + if (m_uiTransformBack_Timer < uiDiff) + { + if (!m_bIsInPhaseTwo) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_TRANSFORM, m_creature); + DoCastSpellIfCan(m_creature,SPELL_SPIDER_FORM); + + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + + DoResetThreat(); + + m_bIsInPhaseTwo = true; + } + else + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_TRANSFORMBACK, m_creature); + DoCastSpellIfCan(m_creature,SPELL_TRANSFORM_BACK); + + m_creature->SetDisplayId(m_uiDefaultModel); + + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + + m_bIsInPhaseTwo = false; + } + + m_uiTransformBack_Timer = urand(55000, 70000); + } + else + m_uiTransformBack_Timer -= uiDiff; + + if (m_uiTrash_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TRASH); + m_uiTrash_Timer = urand(10000, 20000); + } + else + m_uiTrash_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Spawn of Marli +struct MANGOS_DLL_DECL mob_spawn_of_marliAI : public ScriptedAI +{ + mob_spawn_of_marliAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + m_pInstance = (ScriptedInstance*)m_creature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + uint32 m_uiLevelUp_Timer; + + void Reset() + { + m_uiLevelUp_Timer = 3000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiLevelUp_Timer < uiDiff) + { + if (m_pInstance && m_pInstance->GetData(TYPE_MARLI) != DONE) + { + DoCastSpellIfCan(m_creature,SPELL_LEVELUP); + m_creature->SetLevel(m_creature->getLevel() + 1); + } + m_uiLevelUp_Timer = 3000; + } + else + m_uiLevelUp_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_marli(Creature* pCreature) +{ + return new boss_marliAI(pCreature); +} + +CreatureAI* GetAI_mob_spawn_of_marli(Creature* pCreature) +{ + return new mob_spawn_of_marliAI(pCreature); +} + +void AddSC_boss_marli() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_marli"; + newscript->GetAI = &GetAI_boss_marli; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_spawn_of_marli"; + newscript->GetAI = &GetAI_mob_spawn_of_marli; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp b/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp new file mode 100644 index 0000000..d33bcc6 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp @@ -0,0 +1,145 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Renataki +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SPELL_AMBUSH 24337 +#define SPELL_THOUSANDBLADES 24649 + +#define EQUIP_ID_MAIN_HAND 0 //was item display id 31818, but this id does not exist + +struct MANGOS_DLL_DECL boss_renatakiAI : public ScriptedAI +{ + boss_renatakiAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Invisible_Timer; + uint32 Ambush_Timer; + uint32 Visible_Timer; + uint32 Aggro_Timer; + uint32 ThousandBlades_Timer; + + bool Invisible; + bool Ambushed; + + void Reset() + { + Invisible_Timer = urand(8000, 18000); + Ambush_Timer = 3000; + Visible_Timer = 4000; + Aggro_Timer = urand(15000, 25000); + ThousandBlades_Timer = urand(4000, 8000); + + Invisible = false; + Ambushed = false; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Invisible_Timer + if (Invisible_Timer < diff) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + m_creature->SetDisplayId(11686); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Invisible = true; + + Invisible_Timer = urand(15000, 30000); + }else Invisible_Timer -= diff; + + if (Invisible) + { + if (Ambush_Timer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + m_creature->NearTeleportTo(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f); + DoCastSpellIfCan(pTarget, SPELL_AMBUSH); + } + + Ambushed = true; + Ambush_Timer = 3000; + }else Ambush_Timer -= diff; + } + + if (Ambushed) + { + if (Visible_Timer < diff) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + + m_creature->SetDisplayId(15268); + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Invisible = false; + + Visible_Timer = 4000; + }else Visible_Timer -= diff; + } + + //Resetting some aggro so he attacks other gamers + if (!Invisible) + if (Aggro_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-50); + + if (target) + AttackStart(target); + + Aggro_Timer = urand(7000, 20000); + }else Aggro_Timer -= diff; + + if (!Invisible) + if (ThousandBlades_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THOUSANDBLADES); + ThousandBlades_Timer = urand(7000, 12000); + }else ThousandBlades_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_renataki(Creature* pCreature) +{ + return new boss_renatakiAI(pCreature); +} + +void AddSC_boss_renataki() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_renataki"; + newscript->GetAI = &GetAI_boss_renataki; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp b/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp new file mode 100644 index 0000000..528ddcd --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp @@ -0,0 +1,545 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Thekal +SD%Complete: 95 +SDComment: Almost finished. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SAY_AGGRO -1309009 +#define SAY_DEATH -1309010 + +#define SPELL_MORTALCLEAVE 22859 +#define SPELL_SILENCE 23207 +#define SPELL_FRENZY 23342 +#define SPELL_FORCEPUNCH 24189 +#define SPELL_CHARGE 24408 +#define SPELL_ENRAGE 23537 +#define SPELL_SUMMONTIGERS 24183 +#define SPELL_TIGER_FORM 24169 +#define SPELL_RESURRECT 24173 //We will not use this spell. + +//Zealot Lor'Khan Spells +#define SPELL_SHIELD 25020 +#define SPELL_BLOODLUST 24185 +#define SPELL_GREATERHEAL 24208 +#define SPELL_DISARM 22691 + +//Zealot Lor'Khan Spells +#define SPELL_SWEEPINGSTRIKES 18765 +#define SPELL_SINISTERSTRIKE 15667 +#define SPELL_GOUGE 24698 +#define SPELL_KICK 15614 +#define SPELL_BLIND 21060 + +struct MANGOS_DLL_DECL boss_thekalAI : public ScriptedAI +{ + boss_thekalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 MortalCleave_Timer; + uint32 Silence_Timer; + uint32 Frenzy_Timer; + uint32 ForcePunch_Timer; + uint32 Charge_Timer; + uint32 Enrage_Timer; + uint32 SummonTigers_Timer; + uint32 Check_Timer; + uint32 Resurrect_Timer; + + bool Enraged; + bool PhaseTwo; + bool WasDead; + + void Reset() + { + MortalCleave_Timer = 4000; + Silence_Timer = 9000; + Frenzy_Timer = 30000; + ForcePunch_Timer = 4000; + Charge_Timer = 12000; + Enrage_Timer = 32000; + SummonTigers_Timer = 25000; + Check_Timer = 10000; + Resurrect_Timer = 10000; + + Enraged = false; + PhaseTwo = false; + WasDead = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_THEKAL, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_THEKAL, NOT_STARTED); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Check_Timer for the death of LorKhan and Zath. + if (!WasDead && Check_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) + { + //Resurrect LorKhan + if (Creature *pLorKhan = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_LORKHAN))) + { + pLorKhan->SetStandState(UNIT_STAND_STATE_STAND); + pLorKhan->setFaction(14); + pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0)); + + m_pInstance->SetData(TYPE_LORKHAN, DONE); + } + } + + if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) + { + //Resurrect Zath + if (Creature *pZath = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_ZATH))) + { + pZath->SetStandState(UNIT_STAND_STATE_STAND); + pZath->setFaction(14); + pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pZath->SetHealth(int(pZath->GetMaxHealth()*1.0)); + + m_pInstance->SetData(TYPE_ZATH, DONE); + } + } + } + Check_Timer = 5000; + }else Check_Timer -= diff; + + if (!PhaseTwo && MortalCleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTALCLEAVE); + MortalCleave_Timer = urand(15000, 20000); + }else MortalCleave_Timer -= diff; + + if (!PhaseTwo && Silence_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SILENCE); + Silence_Timer = urand(20000, 25000); + }else Silence_Timer -= diff; + + if (!PhaseTwo && !WasDead && m_creature->GetHealthPercent() < 5.0f) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_THEKAL, SPECIAL); + + WasDead = true; + } + + //Thekal will transform to Tiger if he died and was not resurrected after 10 seconds. + if (!PhaseTwo && WasDead) + { + if (Resurrect_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_TIGER_FORM); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0)); + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoResetThreat(); + PhaseTwo = true; + }else Resurrect_Timer -= diff; + } + + if (m_creature->GetHealthPercent() == 100.0f && WasDead) + { + WasDead = false; + } + + if (PhaseTwo) + { + if (Charge_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoCastSpellIfCan(target,SPELL_CHARGE); + DoResetThreat(); + AttackStart(target); + } + Charge_Timer = urand(15000, 22000); + }else Charge_Timer -= diff; + + if (Frenzy_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_FRENZY); + Frenzy_Timer = 30000; + }else Frenzy_Timer -= diff; + + if (ForcePunch_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SILENCE); + ForcePunch_Timer = urand(16000, 21000); + }else ForcePunch_Timer -= diff; + + if (SummonTigers_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SUMMONTIGERS); + SummonTigers_Timer = urand(10000, 14000); + }else SummonTigers_Timer -= diff; + + if (m_creature->GetHealthPercent() < 11.0f && !Enraged) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + Enraged = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +//Zealot Lor'Khan +struct MANGOS_DLL_DECL mob_zealot_lorkhanAI : public ScriptedAI +{ + mob_zealot_lorkhanAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + uint32 Shield_Timer; + uint32 BloodLust_Timer; + uint32 GreaterHeal_Timer; + uint32 Disarm_Timer; + uint32 Check_Timer; + + bool FakeDeath; + + ScriptedInstance* m_pInstance; + + void Reset() + { + Shield_Timer = 1000; + BloodLust_Timer = 16000; + GreaterHeal_Timer = 32000; + Disarm_Timer = 6000; + Check_Timer = 10000; + + FakeDeath = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LORKHAN, NOT_STARTED); + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void UpdateAI (const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Shield_Timer + if (Shield_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_SHIELD); + Shield_Timer = 61000; + }else Shield_Timer -= diff; + + //BloodLust_Timer + if (BloodLust_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_BLOODLUST); + BloodLust_Timer = urand(20000, 28000); + }else BloodLust_Timer -= diff; + + //Casting Greaterheal to Thekal or Zath if they are in meele range. + if (GreaterHeal_Timer < diff) + { + if (m_pInstance) + { + Creature* pThekal = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_THEKAL)); + Creature* pZath = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_ZATH)); + + switch(urand(0, 1)) + { + case 0: + if (pThekal && m_creature->IsWithinDistInMap(pThekal, ATTACK_DISTANCE)) + DoCastSpellIfCan(pThekal, SPELL_GREATERHEAL); + break; + case 1: + if (pZath && m_creature->IsWithinDistInMap(pZath, ATTACK_DISTANCE)) + DoCastSpellIfCan(pZath, SPELL_GREATERHEAL); + break; + } + } + + GreaterHeal_Timer = urand(15000, 20000); + }else GreaterHeal_Timer -= diff; + + //Disarm_Timer + if (Disarm_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DISARM); + Disarm_Timer = urand(15000, 25000); + }else Disarm_Timer -= diff; + + //Check_Timer for the death of LorKhan and Zath. + if (!FakeDeath && Check_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) + { + //Resurrect Thekal + if (Creature* pThekal = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_THEKAL))) + { + pThekal->SetStandState(UNIT_STAND_STATE_STAND); + pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pThekal->setFaction(14); + pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0)); + } + } + + if (m_pInstance->GetData(TYPE_ZATH) == SPECIAL) + { + //Resurrect Zath + if (Creature* pZath = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_ZATH))) + { + pZath->SetStandState(UNIT_STAND_STATE_STAND); + pZath->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pZath->setFaction(14); + pZath->SetHealth(int(pZath->GetMaxHealth()*1.0)); + } + } + } + + Check_Timer = 5000; + }else Check_Timer -= diff; + + if (m_creature->GetHealthPercent() < 5.0f) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->setFaction(35); + m_creature->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LORKHAN, SPECIAL); + + FakeDeath = true; + } + + DoMeleeAttackIfReady(); + } +}; + +//Zealot Zath +struct MANGOS_DLL_DECL mob_zealot_zathAI : public ScriptedAI +{ + mob_zealot_zathAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + uint32 SweepingStrikes_Timer; + uint32 SinisterStrike_Timer; + uint32 Gouge_Timer; + uint32 Kick_Timer; + uint32 Blind_Timer; + uint32 Check_Timer; + + bool FakeDeath; + + ScriptedInstance* m_pInstance; + + void Reset() + { + SweepingStrikes_Timer = 13000; + SinisterStrike_Timer = 8000; + Gouge_Timer = 25000; + Kick_Timer = 18000; + Blind_Timer = 5000; + Check_Timer = 10000; + + FakeDeath = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_ZATH, NOT_STARTED); + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void UpdateAI (const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //SweepingStrikes_Timer + if (SweepingStrikes_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SWEEPINGSTRIKES); + SweepingStrikes_Timer = urand(22000, 26000); + }else SweepingStrikes_Timer -= diff; + + //SinisterStrike_Timer + if (SinisterStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SINISTERSTRIKE); + SinisterStrike_Timer = urand(8000, 16000); + }else SinisterStrike_Timer -= diff; + + //Gouge_Timer + if (Gouge_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_GOUGE); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-100); + + Gouge_Timer = urand(17000, 27000); + }else Gouge_Timer -= diff; + + //Kick_Timer + if (Kick_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KICK); + Kick_Timer = urand(15000, 25000); + }else Kick_Timer -= diff; + + //Blind_Timer + if (Blind_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_BLIND); + Blind_Timer = urand(10000, 20000); + }else Blind_Timer -= diff; + + //Check_Timer for the death of LorKhan and Zath. + if (!FakeDeath && Check_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_LORKHAN) == SPECIAL) + { + //Resurrect LorKhan + if (Creature* pLorKhan = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_LORKHAN))) + { + pLorKhan->SetStandState(UNIT_STAND_STATE_STAND); + pLorKhan->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pLorKhan->setFaction(14); + pLorKhan->SetHealth(int(pLorKhan->GetMaxHealth()*1.0)); + } + } + + if (m_pInstance->GetData(TYPE_THEKAL) == SPECIAL) + { + //Resurrect Thekal + if (Creature* pThekal = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_THEKAL))) + { + pThekal->SetStandState(UNIT_STAND_STATE_STAND); + pThekal->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pThekal->setFaction(14); + pThekal->SetHealth(int(pThekal->GetMaxHealth()*1.0)); + } + } + } + + Check_Timer = 5000; + }else Check_Timer -= diff; + + if (m_creature->GetHealthPercent() <= 5.0f) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->setFaction(35); + m_creature->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ZATH, SPECIAL); + + FakeDeath = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thekal(Creature* pCreature) +{ + return new boss_thekalAI(pCreature); +} + +CreatureAI* GetAI_mob_zealot_lorkhan(Creature* pCreature) +{ + return new mob_zealot_lorkhanAI(pCreature); +} + +CreatureAI* GetAI_mob_zealot_zath(Creature* pCreature) +{ + return new mob_zealot_zathAI(pCreature); +} + +void AddSC_boss_thekal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_thekal"; + newscript->GetAI = &GetAI_boss_thekal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zealot_lorkhan"; + newscript->GetAI = &GetAI_mob_zealot_lorkhan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zealot_zath"; + newscript->GetAI = &GetAI_mob_zealot_zath; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp b/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp new file mode 100644 index 0000000..30cc000 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp @@ -0,0 +1,265 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Venoxis +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +enum +{ + NPC_RAZZASHI_COBRA = 11373, + + SAY_TRANSFORM = -1309000, + SAY_DEATH = -1309001, + + SPELL_HOLY_FIRE = 23860, + SPELL_HOLY_WRATH = 23979, + SPELL_VENOMSPIT = 23862, + SPELL_HOLY_NOVA = 23858, + SPELL_POISON_CLOUD = 23861, + SPELL_SNAKE_FORM = 23849, + SPELL_RENEW = 23895, + SPELL_BERSERK = 23537, + SPELL_DISPELL = 23859, + SPELL_PARASITIC = 23865, + SPELL_TRASH = 3391 +}; + +struct MANGOS_DLL_DECL boss_venoxisAI : public ScriptedAI +{ + boss_venoxisAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_fDefaultSize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiHolyFire_Timer; + uint32 m_uiHolyWrath_Timer; + uint32 m_uiVenomSpit_Timer; + uint32 m_uiRenew_Timer; + uint32 m_uiPoisonCloud_Timer; + uint32 m_uiHolyNova_Timer; + uint32 m_uiDispell_Timer; + uint32 m_uiParasitic_Timer; + uint32 m_uiTrash_Timer; + + uint8 m_uiTargetsInRangeCount; + + bool m_bPhaseTwo; + bool m_bInBerserk; + + float m_fDefaultSize; + + void Reset() + { + m_uiHolyFire_Timer = 10000; + m_uiHolyWrath_Timer = 60500; + m_uiVenomSpit_Timer = 5500; + m_uiRenew_Timer = 30500; + m_uiPoisonCloud_Timer = 2000; + m_uiHolyNova_Timer = 5000; + m_uiDispell_Timer = 35000; + m_uiParasitic_Timer = 10000; + m_uiTrash_Timer = 5000; + + m_uiTargetsInRangeCount = 0; + + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, m_fDefaultSize); + + m_bPhaseTwo = false; + m_bInBerserk = false; + } + + void JustReachedHome() + { + std::list m_lCobras; + GetCreatureListWithEntryInGrid(m_lCobras, m_creature, NPC_RAZZASHI_COBRA, DEFAULT_VISIBILITY_INSTANCE); + + if (m_lCobras.empty()) + debug_log("SD2: boss_venoxis, no Cobras with the entry %u were found", NPC_RAZZASHI_COBRA); + else + { + for(std::list::iterator iter = m_lCobras.begin(); iter != m_lCobras.end(); ++iter) + { + if ((*iter) && !(*iter)->isAlive()) + (*iter)->Respawn(); + } + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VENOXIS, DONE); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (!m_bPhaseTwo && (m_creature->GetHealth()+uiDamage)*100 / m_creature->GetMaxHealth() < 50) + { + DoScriptText(SAY_TRANSFORM, m_creature); + + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature,SPELL_SNAKE_FORM); + + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, m_fDefaultSize*2); + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoResetThreat(); + m_bPhaseTwo = true; + } + + if (m_bPhaseTwo && !m_bInBerserk && (m_creature->GetHealth()+uiDamage)*100 / m_creature->GetMaxHealth() < 11) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + m_bInBerserk = true; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bPhaseTwo) + { + if (m_uiDispell_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_DISPELL); + m_uiDispell_Timer = urand(15000, 30000); + } + else + m_uiDispell_Timer -= uiDiff; + + if (m_uiRenew_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_RENEW); + m_uiRenew_Timer = urand(20000, 30000); + } + else + m_uiRenew_Timer -= uiDiff; + + if (m_uiHolyWrath_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HOLY_WRATH); + m_uiHolyWrath_Timer = urand(15000, 25000); + } + else + m_uiHolyWrath_Timer -= uiDiff; + + if (m_uiHolyNova_Timer < uiDiff) + { + m_uiTargetsInRangeCount = 0; + for(uint8 i = 0; i < 10; ++i) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO,i)) + if (m_creature->IsWithinDistInMap(pTarget, ATTACK_DISTANCE)) + ++m_uiTargetsInRangeCount; + } + + if (m_uiTargetsInRangeCount > 1) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HOLY_NOVA); + m_uiHolyNova_Timer = 1000; + } + else + { + m_uiHolyNova_Timer = 2000; + } + } + else + m_uiHolyNova_Timer -= uiDiff; + + if (m_uiHolyFire_Timer < uiDiff && m_uiTargetsInRangeCount < 3) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_HOLY_FIRE); + + m_uiHolyFire_Timer = 8000; + } + else + m_uiHolyFire_Timer -= uiDiff; + } + else + { + if (m_uiPoisonCloud_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_POISON_CLOUD); + m_uiPoisonCloud_Timer = 15000; + } + else + m_uiPoisonCloud_Timer -= uiDiff; + + if (m_uiVenomSpit_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_VENOMSPIT); + + m_uiVenomSpit_Timer = urand(15000, 20000); + } + else + m_uiVenomSpit_Timer -= uiDiff; + + if (m_uiParasitic_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, SPELL_PARASITIC); + + m_uiParasitic_Timer = 10000; + } + else + m_uiParasitic_Timer -= uiDiff; + } + + if (m_uiTrash_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TRASH); + m_uiTrash_Timer = urand(10000, 20000); + } + else + m_uiTrash_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_venoxis(Creature* pCreature) +{ + return new boss_venoxisAI(pCreature); +} + +void AddSC_boss_venoxis() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_venoxis"; + newscript->GetAI = &GetAI_boss_venoxis; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp b/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp new file mode 100644 index 0000000..7cabb8e --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp @@ -0,0 +1,80 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Wushoolay +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +#define SPELL_LIGHTNINGCLOUD 25033 +#define SPELL_LIGHTNINGWAVE 24819 + +struct MANGOS_DLL_DECL boss_wushoolayAI : public ScriptedAI +{ + boss_wushoolayAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 LightningCloud_Timer; + uint32 LightningWave_Timer; + + void Reset() + { + LightningCloud_Timer = urand(5000, 10000); + LightningWave_Timer = urand(8000, 16000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //LightningCloud_Timer + if (LightningCloud_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_LIGHTNINGCLOUD); + LightningCloud_Timer = urand(15000, 20000); + }else LightningCloud_Timer -= diff; + + //LightningWave_Timer + if (LightningWave_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) DoCastSpellIfCan(target,SPELL_LIGHTNINGWAVE); + + LightningWave_Timer = urand(12000, 16000); + }else LightningWave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_wushoolay(Creature* pCreature) +{ + return new boss_wushoolayAI(pCreature); +} + +void AddSC_boss_wushoolay() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_wushoolay"; + newscript->GetAI = &GetAI_boss_wushoolay; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp b/scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp new file mode 100644 index 0000000..8246820 --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp @@ -0,0 +1,244 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_ZulGurub +SD%Complete: 80 +SDComment: Missing reset function after killing a boss for Ohgan, Thekal. +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "zulgurub.h" + +struct MANGOS_DLL_DECL instance_zulgurub : public ScriptedInstance +{ + instance_zulgurub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + std::string strInstData; + // If all High Priest bosses were killed. Lorkhan, Zath and Ohgan are added too. + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + // Storing Lorkhan, Zath and Thekal because we need to cast on them later. Jindo is needed for heal function too. + uint64 m_uiLorKhanGUID; + uint64 m_uiZathGUID; + uint64 m_uiThekalGUID; + uint64 m_uiJindoGUID; + uint64 m_uiHakkarGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiLorKhanGUID = 0; + m_uiZathGUID = 0; + m_uiThekalGUID = 0; + m_uiJindoGUID = 0; + m_uiHakkarGUID = 0; + } + + // each time High Priest dies lower Hakkar's HP + void LowerHakkarHitPoints() + { + if (Creature* pHakkar = instance->GetCreature(m_uiHakkarGUID)) + { + if (pHakkar->isAlive()) + { + pHakkar->SetMaxHealth(pHakkar->GetMaxHealth() - 60000); + pHakkar->SetHealth(pHakkar->GetHealth() - 60000); + } + } + } + + bool IsEncounterInProgress() const + { + //not active in Zul'Gurub + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_LORKHAN: + m_uiLorKhanGUID = pCreature->GetGUID(); + break; + case NPC_ZATH: + m_uiZathGUID = pCreature->GetGUID(); + break; + case NPC_THEKAL: + m_uiThekalGUID = pCreature->GetGUID(); + break; + case NPC_JINDO: + m_uiJindoGUID = pCreature->GetGUID(); + break; + case NPC_HAKKAR: + m_uiHakkarGUID = pCreature->GetGUID(); + for(uint8 i = 0; i < 5; ++i) + { + if (m_auiEncounter[i] == DONE) + LowerHakkarHitPoints(); + } + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_ARLOKK: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + LowerHakkarHitPoints(); + break; + case TYPE_JEKLIK: + m_auiEncounter[1] = uiData; + if (uiData == DONE) + LowerHakkarHitPoints(); + break; + case TYPE_VENOXIS: + m_auiEncounter[2] = uiData; + if (uiData == DONE) + LowerHakkarHitPoints(); + break; + case TYPE_MARLI: + m_auiEncounter[3] = uiData; + if (uiData == DONE) + LowerHakkarHitPoints(); + break; + case TYPE_THEKAL: + m_auiEncounter[4] = uiData; + if (uiData == DONE) + LowerHakkarHitPoints(); + break; + case TYPE_LORKHAN: + m_auiEncounter[5] = uiData; + break; + case TYPE_ZATH: + m_auiEncounter[6] = uiData; + break; + case TYPE_OHGAN: + m_auiEncounter[7] = uiData; + break; + case TYPE_HAKKAR: + m_auiEncounter[8] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] + >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_ARLOKK: + return m_auiEncounter[0]; + case TYPE_JEKLIK: + return m_auiEncounter[1]; + case TYPE_VENOXIS: + return m_auiEncounter[2]; + case TYPE_MARLI: + return m_auiEncounter[3]; + case TYPE_THEKAL: + return m_auiEncounter[4]; + case TYPE_LORKHAN: + return m_auiEncounter[5]; + case TYPE_ZATH: + return m_auiEncounter[6]; + case TYPE_OHGAN: + return m_auiEncounter[7]; + case TYPE_HAKKAR: + return m_auiEncounter[8]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_LORKHAN: + return m_uiLorKhanGUID; + case DATA_ZATH: + return m_uiZathGUID; + case DATA_THEKAL: + return m_uiThekalGUID; + case DATA_JINDO: + return m_uiJindoGUID; + case DATA_HAKKAR: + return m_uiHakkarGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_zulgurub(Map* pMap) +{ + return new instance_zulgurub(pMap); +} + +void AddSC_instance_zulgurub() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_zulgurub"; + newscript->GetInstanceData = &GetInstanceData_instance_zulgurub; + newscript->RegisterSelf(); +} diff --git a/scripts/eastern_kingdoms/zulgurub/zulgurub.h b/scripts/eastern_kingdoms/zulgurub/zulgurub.h new file mode 100644 index 0000000..7aed3df --- /dev/null +++ b/scripts/eastern_kingdoms/zulgurub/zulgurub.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ZULGURUB_H +#define DEF_ZULGURUB_H + +enum +{ + MAX_ENCOUNTER = 9, + + NPC_LORKHAN = 11347, + NPC_ZATH = 11348, + NPC_THEKAL = 14509, + NPC_JINDO = 11380, + NPC_HAKKAR = 14834, + + TYPE_ARLOKK = 1, + TYPE_JEKLIK = 2, + TYPE_VENOXIS = 3, + TYPE_MARLI = 4, + TYPE_OHGAN = 5, + TYPE_THEKAL = 6, + TYPE_ZATH = 7, + TYPE_LORKHAN = 8, + TYPE_HAKKAR = 9, + + DATA_JINDO = 10, + DATA_LORKHAN = 11, + DATA_THEKAL = 12, + DATA_ZATH = 13, + DATA_HAKKAR = 14 +}; + +#endif diff --git a/scripts/examples/example_creature.cpp b/scripts/examples/example_creature.cpp new file mode 100644 index 0000000..dcea997 --- /dev/null +++ b/scripts/examples/example_creature.cpp @@ -0,0 +1,272 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Example_Creature +SD%Complete: 100 +SDComment: Short custom scripting example +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" + +// **** This script is designed as an example for others to build on **** +// **** Please modify whatever you'd like to as this script is only for developement **** + +// **** Script Info **** +// This script is written in a way that it can be used for both friendly and hostile monsters +// Its primary purpose is to show just how much you can really do with scripts +// I recommend trying it out on both an agressive NPC and on friendly npc + +// **** Quick Info **** +// Functions with Handled Function marked above them are functions that are called automatically by the core +// Functions that are marked Custom Function are functions I've created to simplify code + +enum +{ + //List of text id's. The text is stored in database, also in a localized version + //(if translation not exist for the textId, default english text will be used) + //Not required to define in this way, but simplify if changes are needed. + SAY_AGGRO = -1999900, + SAY_RANDOM_0 = -1999901, + SAY_RANDOM_1 = -1999902, + SAY_RANDOM_2 = -1999903, + SAY_RANDOM_3 = -1999904, + SAY_RANDOM_4 = -1999905, + SAY_BESERK = -1999906, + SAY_PHASE = -1999907, + SAY_DANCE = -1999908, + SAY_SALUTE = -1999909, + + //List of spells. Not required to define them in this way, but will make it easier to maintain in case spellId change + SPELL_BUFF = 25661, + SPELL_ONE = 12555, + SPELL_ONE_ALT = 24099, + SPELL_TWO = 10017, + SPELL_THREE = 26027, + SPELL_ENRAGE = 23537, + SPELL_BESERK = 32309, + + FACTION_WORGEN = 24 +}; + +//List of gossip item texts. Items will appear in the gossip window. +#define GOSSIP_ITEM "I'm looking for a fight" + +struct MANGOS_DLL_DECL example_creatureAI : public ScriptedAI +{ + //*** HANDLED FUNCTION *** + //This is the constructor, called only once when the creature is first created + example_creatureAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + //*** CUSTOM VARIABLES **** + //These variables are for use only by this individual script. + //Nothing else will ever call them but us. + + uint32 m_uiSay_Timer; //Timer for random chat + uint32 m_uiRebuff_Timer; //Timer for rebuffing + uint32 m_uiSpell_1_Timer; //Timer for spell 1 when in combat + uint32 m_uiSpell_2_Timer; //Timer for spell 1 when in combat + uint32 m_uiSpell_3_Timer; //Timer for spell 1 when in combat + uint32 m_uiBeserk_Timer; //Timer until we go into Beserk (enraged) mode + uint32 m_uiPhase; //The current battle phase we are in + uint32 m_uiPhase_Timer; //Timer until phase transition + + //*** HANDLED FUNCTION *** + //This is called whenever the core decides we need to evade + void Reset() + { + m_uiPhase = 1; //Start in phase 1 + m_uiPhase_Timer = 60000; //60 seconds + m_uiSpell_1_Timer = 5000; //5 seconds + m_uiSpell_2_Timer = 37000; //37 seconds + m_uiSpell_3_Timer = 19000; //19 seconds + m_uiBeserk_Timer = 120000; //2 minutes + } + + //*** HANDLED FUNCTION *** + //Attack Start is called whenever someone hits us. + void Aggro(Unit* pWho) + { + //Say some stuff + DoScriptText(SAY_AGGRO, m_creature, pWho); + } + + //Our Recive emote function + void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) + { + m_creature->HandleEmote(uiTextEmote); + + switch(uiTextEmote) + { + case TEXTEMOTE_DANCE: + DoScriptText(SAY_DANCE, m_creature); + break; + case TEXTEMOTE_SALUTE: + DoScriptText(SAY_SALUTE, m_creature); + break; + } + } + + //*** HANDLED FUNCTION *** + //Update AI is called Every single map update (roughly once every 100ms if a player is within the grid) + void UpdateAI(const uint32 uiDiff) + { + //Out of combat timers + if (!m_creature->getVictim()) + { + //Random Say timer + if (m_uiSay_Timer < uiDiff) + { + //Random switch between 5 outcomes + switch(urand(0, 4)) + { + case 0: DoScriptText(SAY_RANDOM_0, m_creature); break; + case 1: DoScriptText(SAY_RANDOM_1, m_creature); break; + case 2: DoScriptText(SAY_RANDOM_2, m_creature); break; + case 3: DoScriptText(SAY_RANDOM_3, m_creature); break; + case 4: DoScriptText(SAY_RANDOM_4, m_creature); break; + } + + m_uiSay_Timer = 45000; //Say something agian in 45 seconds + } + else + m_uiSay_Timer -= uiDiff; + + //Rebuff timer + if (m_uiRebuff_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BUFF); + m_uiRebuff_Timer = 900000; //Rebuff agian in 15 minutes + } + else + m_uiRebuff_Timer -= uiDiff; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Spell 1 timer + if (m_uiSpell_1_Timer < uiDiff) + { + //Cast spell one on our current target. + if (rand()%50 > 10) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ONE_ALT); + else if (m_creature->IsWithinDist(m_creature->getVictim(), 25.0f)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ONE); + + m_uiSpell_1_Timer = 5000; + } + else + m_uiSpell_1_Timer -= uiDiff; + + //Spell 2 timer + if (m_uiSpell_2_Timer < uiDiff) + { + //Cast spell one on our current target. + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TWO); + m_uiSpell_2_Timer = 37000; + } + else + m_uiSpell_2_Timer -= uiDiff; + + //Beserk timer + if (m_uiPhase > 1) + { + //Spell 3 timer + if (m_uiSpell_3_Timer < uiDiff) + { + //Cast spell one on our current target. + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THREE); + + m_uiSpell_3_Timer = 19000; + } + else + m_uiSpell_3_Timer -= uiDiff; + + if (m_uiBeserk_Timer < uiDiff) + { + //Say our line then cast uber death spell + DoScriptText(SAY_BESERK, m_creature, m_creature->getVictim()); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BESERK); + + //Cast our beserk spell agian in 12 seconds if we didn't kill everyone + m_uiBeserk_Timer = 12000; + } + else + m_uiBeserk_Timer -= uiDiff; + } + else if (m_uiPhase == 1) //Phase timer + { + if (m_uiPhase_Timer < uiDiff) + { + //Go to next phase + ++m_uiPhase; + DoScriptText(SAY_PHASE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + } + else + m_uiPhase_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +//This is the GetAI method used by all scripts that involve AI +//It is called every time a new creature using this script is created +CreatureAI* GetAI_example_creature(Creature* pCreature) +{ + return new example_creatureAI(pCreature); +} + +//This function is called when the player clicks an option on the gossip menu +bool GossipSelect_example_creature(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //Set our faction to hostile twoards all + pCreature->setFaction(FACTION_WORGEN); + pCreature->AI()->AttackStart(pPlayer); + } + + return true; +} + +//This function is called when the player opens the gossip menu +bool GossipHello_example_creature(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + + return true; +} + +//This is the actual function called only once durring InitScripts() +//It must define all handled functions that are to be run in this script +void AddSC_example_creature() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "example_creature"; + newscript->GetAI = &GetAI_example_creature; + newscript->pGossipHello = &GossipHello_example_creature; + newscript->pGossipSelect = &GossipSelect_example_creature; + newscript->RegisterSelf(false); +} diff --git a/scripts/examples/example_escort.cpp b/scripts/examples/example_escort.cpp new file mode 100644 index 0000000..566e5b0 --- /dev/null +++ b/scripts/examples/example_escort.cpp @@ -0,0 +1,230 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Example_Escort +SD%Complete: 100 +SDComment: Script used for testing escortAI +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" + +enum +{ + NPC_FELBOAR = 21878, + + SPELL_DEATH_COIL = 33130, + SPELL_ELIXIR_OF_FORTITUDE = 3593, + SPELL_BLUE_FIREWORK = 11540, + + SAY_AGGRO1 = -1999910, + SAY_AGGRO2 = -1999911, + SAY_WP_1 = -1999912, + SAY_WP_2 = -1999913, + SAY_WP_3 = -1999914, + SAY_WP_4 = -1999915, + SAY_DEATH_1 = -1999916, + SAY_DEATH_2 = -1999917, + SAY_DEATH_3 = -1999918, + SAY_SPELL = -1999919, + SAY_RAND_1 = -1999920, + SAY_RAND_2 = -1999921 +}; + +#define GOSSIP_ITEM_1 "Click to Test Escort(Attack, Run)" +#define GOSSIP_ITEM_2 "Click to Test Escort(NoAttack, Walk)" +#define GOSSIP_ITEM_3 "Click to Test Escort(NoAttack, Run)" + +struct MANGOS_DLL_DECL example_escortAI : public npc_escortAI +{ + // CreatureAI functions + example_escortAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} + + uint32 m_uiDeathCoilTimer; + uint32 m_uiChatTimer; + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + // Pure Virtual Functions (Have to be implemented) + void WaypointReached(uint32 uiWP) + { + switch (uiWP) + { + case 1: + DoScriptText(SAY_WP_1, m_creature); + break; + case 3: + DoScriptText(SAY_WP_2, m_creature); + m_creature->SummonCreature(NPC_FELBOAR, m_creature->GetPositionX()+5.0f, m_creature->GetPositionY()+7.0f, m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); + break; + case 4: + if (Player* pTmpPlayer = GetPlayerForEscort()) + { + //pTmpPlayer is the target of the text + DoScriptText(SAY_WP_3, m_creature, pTmpPlayer); + //pTmpPlayer is the source of the text + DoScriptText(SAY_WP_4, pTmpPlayer); + } + break; + } + } + + void Aggro(Unit* pWho) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (Player* pTemp = GetPlayerForEscort()) + DoScriptText(SAY_AGGRO1, m_creature, pTemp); + } + else + DoScriptText(SAY_AGGRO2, m_creature); + } + + void Reset() + { + m_uiDeathCoilTimer = 4000; + m_uiChatTimer = 4000; + } + + void JustDied(Unit* pKiller) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (Player* pTemp = GetPlayerForEscort()) + { + // not a likely case, code here for the sake of example + if (pKiller == m_creature) + { + //This is actually a whisper. You control the text type in database + DoScriptText(SAY_DEATH_1, m_creature, pTemp); + } + else + DoScriptText(SAY_DEATH_2, m_creature, pTemp); + } + } + else + DoScriptText(SAY_DEATH_3, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(uiDiff); + + //Combat check + if (m_creature->getVictim()) + { + if (m_uiDeathCoilTimer < uiDiff) + { + DoScriptText(SAY_SPELL, m_creature); + m_creature->CastSpell(m_creature->getVictim(), SPELL_DEATH_COIL, false); + m_uiDeathCoilTimer = 4000; + } + else + m_uiDeathCoilTimer -= uiDiff; + } + else + { + //Out of combat but being escorted + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (m_uiChatTimer < uiDiff) + { + if (m_creature->HasAura(SPELL_ELIXIR_OF_FORTITUDE, EFFECT_INDEX_0)) + { + DoScriptText(SAY_RAND_1, m_creature); + m_creature->CastSpell(m_creature, SPELL_BLUE_FIREWORK, false); + } + else + { + DoScriptText(SAY_RAND_2, m_creature); + m_creature->CastSpell(m_creature, SPELL_ELIXIR_OF_FORTITUDE, false); + } + + m_uiChatTimer = 12000; + } + else + m_uiChatTimer -= uiDiff; + } + } + } +}; + +CreatureAI* GetAI_example_escort(Creature* pCreature) +{ + return new example_escortAI(pCreature); +} + +bool GossipHello_example_escort(Player* pPlayer, Creature* pCreature) +{ + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pPlayer->PrepareGossipMenu(pCreature, 0); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + + pPlayer->SendPreparedGossip(pCreature); + + return true; +} + +bool GossipSelect_example_escort(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + example_escortAI* pEscortAI = dynamic_cast(pCreature->AI()); + + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pEscortAI) + pEscortAI->Start(true, pPlayer->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pEscortAI) + pEscortAI->Start(false, pPlayer->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pEscortAI) + pEscortAI->Start(true, pPlayer->GetGUID()); + break; + default: + return false; // nothing defined -> mangos core handling + } + + return true; // no default handling -> prevent mangos core handling +} + +void AddSC_example_escort() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "example_escort"; + newscript->GetAI = &GetAI_example_escort; + newscript->pGossipHello = &GossipHello_example_escort; + newscript->pGossipSelect = &GossipSelect_example_escort; + newscript->RegisterSelf(false); +} diff --git a/scripts/examples/example_gossip_codebox.cpp b/scripts/examples/example_gossip_codebox.cpp new file mode 100644 index 0000000..ddf3056 --- /dev/null +++ b/scripts/examples/example_gossip_codebox.cpp @@ -0,0 +1,99 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Example_Gossip_Codebox +SD%Complete: 100 +SDComment: Show a codebox in gossip option +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" +#include + +enum +{ + SPELL_POLYMORPH = 12826, + SPELL_MARK_OF_THE_WILD = 26990, + + SAY_NOT_INTERESTED = -1999922, + SAY_WRONG = -1999923, + SAY_CORRECT = -1999924 +}; + +#define GOSSIP_ITEM_1 "A quiz: what's your name?" +#define GOSSIP_ITEM_2 "I'm not interested" + +//This function is called when the player opens the gossip menubool +bool GossipHello_example_gossip_codebox(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID()); + + return true; +} + +//This function is called when the player clicks an option on the gossip menubool +bool GossipSelect_example_gossip_codebox(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + DoScriptText(SAY_NOT_INTERESTED, pCreature); + pPlayer->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +bool GossipSelectWithCode_example_gossip_codebox(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction, const char* sCode) +{ + if (uiSender == GOSSIP_SENDER_MAIN) + { + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + if (std::strcmp(sCode, pPlayer->GetName())!=0) + { + DoScriptText(SAY_WRONG, pCreature); + pCreature->CastSpell(pPlayer, SPELL_POLYMORPH, true); + } + else + { + DoScriptText(SAY_CORRECT, pCreature); + pCreature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD, true); + } + pPlayer->CLOSE_GOSSIP_MENU(); + + return true; + } + } + + return false; +} + +void AddSC_example_gossip_codebox() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "example_gossip_codebox"; + newscript->pGossipHello = &GossipHello_example_gossip_codebox; + newscript->pGossipSelect = &GossipSelect_example_gossip_codebox; + newscript->pGossipSelectWithCode = &GossipSelectWithCode_example_gossip_codebox; + newscript->RegisterSelf(false); +} diff --git a/scripts/examples/example_misc.cpp b/scripts/examples/example_misc.cpp new file mode 100644 index 0000000..de4437d --- /dev/null +++ b/scripts/examples/example_misc.cpp @@ -0,0 +1,68 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Example_Misc +SD%Complete: 100 +SDComment: Item, Areatrigger and other small code examples +SDCategory: Script Examples +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_HI = -1999925 +}; + +bool AT_example_areatrigger(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + DoScriptText(SAY_HI, pPlayer); + return true; +} + +extern void LoadDatabase(); +bool ItemUse_example_item(Player* pPlayer, Item* pItem, SpellCastTargets const& scTargets) +{ + LoadDatabase(); + return true; +} + +bool GOHello_example_go_teleporter(Player* pPlayer, GameObject* pGo) +{ + pPlayer->TeleportTo(0, 1807.07f, 336.105f, 70.3975f, 0.0f); + return false; +} + +void AddSC_example_misc() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "example_areatrigger"; + newscript->pAreaTrigger = &AT_example_areatrigger; + newscript->RegisterSelf(false); + + newscript = new Script; + newscript->Name = "example_item"; + newscript->pItemUse = &ItemUse_example_item; + newscript->RegisterSelf(false); + + newscript = new Script; + newscript->Name = "example_go_teleporter"; + newscript->pGOHello = &GOHello_example_go_teleporter; + newscript->RegisterSelf(false); +} diff --git a/scripts/kalimdor/ashenvale.cpp b/scripts/kalimdor/ashenvale.cpp new file mode 100644 index 0000000..4512d3c --- /dev/null +++ b/scripts/kalimdor/ashenvale.cpp @@ -0,0 +1,447 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ashenvale +SD%Complete: 70 +SDComment: Quest support: 6482, 6544, 6641 +SDCategory: Ashenvale Forest +EndScriptData */ + +/* ContentData +npc_muglash +npc_ruul_snowhoof +npc_torek +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*#### +# npc_muglash +####*/ + +enum +{ + SAY_MUG_START1 = -1000501, + SAY_MUG_START2 = -1000502, + SAY_MUG_BRAZIER = -1000503, + SAY_MUG_BRAZIER_WAIT = -1000504, + SAY_MUG_ON_GUARD = -1000505, + SAY_MUG_REST = -1000506, + SAY_MUG_DONE = -1000507, + SAY_MUG_GRATITUDE = -1000508, + SAY_MUG_PATROL = -1000509, + SAY_MUG_RETURN = -1000510, + + QUEST_VORSHA = 6641, + + GO_NAGA_BRAZIER = 178247, + NPC_MUGLASH = 12717, + + NPC_WRATH_RIDER = 3713, + NPC_WRATH_SORCERESS = 3717, + NPC_WRATH_RAZORTAIL = 3712, + + NPC_WRATH_PRIESTESS = 3944, + NPC_WRATH_MYRMIDON = 3711, + NPC_WRATH_SEAWITCH = 3715, + + NPC_VORSHA = 12940 +}; + +static float m_afFirstNagaCoord[3][3]= +{ + {3603.504150f, 1122.631104f, 1.635f}, // rider + {3589.293945f, 1148.664063f, 5.565f}, // sorceress + {3609.925537f, 1168.759521f, -1.168f} // razortail +}; + +static float m_afSecondNagaCoord[3][3]= +{ + {3609.925537f, 1168.759521f, -1.168f}, // witch + {3645.652100f, 1139.425415f, 1.322f}, // priest + {3583.602051f, 1128.405762f, 2.347f} // myrmidon +}; + +static float m_fVorshaCoord[] = {3633.056885f, 1172.924072f, -5.388f}; + +struct MANGOS_DLL_DECL npc_muglashAI : public npc_escortAI +{ + npc_muglashAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiWaveId = 0; + m_bIsBrazierExtinguished = false; + Reset(); + } + + bool m_bIsBrazierExtinguished; + + uint32 m_uiWaveId; + uint32 m_uiEventTimer; + + void Reset() + { + m_uiEventTimer = 10000; + + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + m_uiWaveId = 0; + m_bIsBrazierExtinguished = false; + } + } + + void Aggro(Unit* pWho) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (urand(0, 1)) + return; + + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_MUG_ON_GUARD, m_creature, pPlayer); + } + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_MUG_START2, m_creature, pPlayer); + break; + case 24: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_MUG_BRAZIER, m_creature, pPlayer); + + if (GameObject* pGo = GetClosestGameObjectWithEntry(m_creature, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2)) + { + //some kind of event flag? Update to player/group only? + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + SetEscortPaused(true); + } + break; + case 25: + DoScriptText(SAY_MUG_GRATITUDE, m_creature); + + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_VORSHA, m_creature); + break; + case 26: + DoScriptText(SAY_MUG_PATROL, m_creature); + break; + case 27: + DoScriptText(SAY_MUG_RETURN, m_creature); + break; + } + } + + void DoWaveSummon() + { + switch(m_uiWaveId) + { + case 1: + m_creature->SummonCreature(NPC_WRATH_RIDER, m_afFirstNagaCoord[0][0], m_afFirstNagaCoord[0][1], m_afFirstNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + m_creature->SummonCreature(NPC_WRATH_SORCERESS, m_afFirstNagaCoord[1][0], m_afFirstNagaCoord[1][1], m_afFirstNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + m_creature->SummonCreature(NPC_WRATH_RAZORTAIL, m_afFirstNagaCoord[2][0], m_afFirstNagaCoord[2][1], m_afFirstNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 2: + m_creature->SummonCreature(NPC_WRATH_PRIESTESS, m_afSecondNagaCoord[0][0], m_afSecondNagaCoord[0][1], m_afSecondNagaCoord[0][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + m_creature->SummonCreature(NPC_WRATH_MYRMIDON, m_afSecondNagaCoord[1][0], m_afSecondNagaCoord[1][1], m_afSecondNagaCoord[1][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + m_creature->SummonCreature(NPC_WRATH_SEAWITCH, m_afSecondNagaCoord[2][0], m_afSecondNagaCoord[2][1], m_afSecondNagaCoord[2][2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 3: + m_creature->SummonCreature(NPC_VORSHA, m_fVorshaCoord[0], m_fVorshaCoord[1], m_fVorshaCoord[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + break; + case 4: + SetEscortPaused(false); + DoScriptText(SAY_MUG_DONE, m_creature); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasEscortState(STATE_ESCORT_PAUSED) && m_bIsBrazierExtinguished) + { + if (m_uiEventTimer < uiDiff) + { + ++m_uiWaveId; + DoWaveSummon(); + m_uiEventTimer = 10000; + } + else + m_uiEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_muglash(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_VORSHA) + { + if (npc_muglashAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + DoScriptText(SAY_MUG_START1, pCreature); + pCreature->setFaction(FACTION_ESCORT_H_PASSIVE); + + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + } + + return true; +} + +CreatureAI* GetAI_npc_muglash(Creature* pCreature) +{ + return new npc_muglashAI(pCreature); +} + +bool GOHello_go_naga_brazier(Player* pPlayer, GameObject* pGo) +{ + if (Creature* pCreature = GetClosestCreatureWithEntry(pGo, NPC_MUGLASH, INTERACTION_DISTANCE*2)) + { + if (npc_muglashAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + DoScriptText(SAY_MUG_BRAZIER_WAIT, pCreature); + + pEscortAI->m_bIsBrazierExtinguished = true; + return false; + } + } + + return true; +} + +/*#### +# npc_ruul_snowhoof +####*/ + +enum +{ + QUEST_FREEDOM_TO_RUUL = 6482, + NPC_T_URSA = 3921, + NPC_T_TOTEMIC = 3922, + NPC_T_PATHFINDER = 3926 +}; + +struct MANGOS_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI +{ + npc_ruul_snowhoofAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() {} + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 13: + m_creature->SummonCreature(NPC_T_TOTEMIC, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(NPC_T_URSA, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(NPC_T_PATHFINDER, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + case 19: + m_creature->SummonCreature(NPC_T_TOTEMIC, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(NPC_T_URSA, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000); + m_creature->SummonCreature(NPC_T_PATHFINDER, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000); + break; + case 21: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, m_creature); + break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +bool QuestAccept_npc_ruul_snowhoof(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_FREEDOM_TO_RUUL) + { + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE); + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (npc_ruul_snowhoofAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_ruul_snowhoofAI(Creature* pCreature) +{ + return new npc_ruul_snowhoofAI(pCreature); +} + +/*#### +# npc_torek +####*/ + +enum +{ + SAY_READY = -1000106, + SAY_MOVE = -1000107, + SAY_PREPARE = -1000108, + SAY_WIN = -1000109, + SAY_END = -1000110, + + SPELL_REND = 11977, + SPELL_THUNDERCLAP = 8078, + + QUEST_TOREK_ASSULT = 6544, + + NPC_SPLINTERTREE_RAIDER = 12859, + NPC_DURIEL = 12860, + NPC_SILVERWING_SENTINEL = 12896, + NPC_SILVERWING_WARRIOR = 12897 +}; + +struct MANGOS_DLL_DECL npc_torekAI : public npc_escortAI +{ + npc_torekAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} + + uint32 m_uiRend_Timer; + uint32 m_uiThunderclap_Timer; + + void Reset() + { + m_uiRend_Timer = 5000; + m_uiThunderclap_Timer = 8000; + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 1: + DoScriptText(SAY_MOVE, m_creature, pPlayer); + break; + case 8: + DoScriptText(SAY_PREPARE, m_creature, pPlayer); + break; + case 19: + //TODO: verify location and creatures amount. + m_creature->SummonCreature(NPC_DURIEL, 1776.73f, -2049.06f, 109.83f, 1.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + m_creature->SummonCreature(NPC_SILVERWING_SENTINEL, 1774.64f, -2049.41f, 109.83f, 1.40f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + m_creature->SummonCreature(NPC_SILVERWING_WARRIOR, 1778.73f, -2049.50f, 109.83f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,25000); + break; + case 20: + DoScriptText(SAY_WIN, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, m_creature); + break; + case 21: + DoScriptText(SAY_END, m_creature, pPlayer); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiRend_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_REND); + m_uiRend_Timer = 20000; + } + else + m_uiRend_Timer -= uiDiff; + + if (m_uiThunderclap_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_THUNDERCLAP); + m_uiThunderclap_Timer = 30000; + } + else + m_uiThunderclap_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_torek(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_TOREK_ASSULT) + { + //TODO: find companions, make them follow Torek, at any time (possibly done by mangos/database in future?) + DoScriptText(SAY_READY, pCreature, pPlayer); + + if (npc_torekAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(true, pPlayer->GetGUID(), pQuest); + } + + return true; +} + +CreatureAI* GetAI_npc_torek(Creature* pCreature) +{ + return new npc_torekAI(pCreature); +} + +void AddSC_ashenvale() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_muglash"; + newscript->GetAI = &GetAI_npc_muglash; + newscript->pQuestAccept = &QuestAccept_npc_muglash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_naga_brazier"; + newscript->pGOHello = &GOHello_go_naga_brazier; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ruul_snowhoof"; + newscript->GetAI = &GetAI_npc_ruul_snowhoofAI; + newscript->pQuestAccept = &QuestAccept_npc_ruul_snowhoof; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_torek"; + newscript->GetAI = &GetAI_npc_torek; + newscript->pQuestAccept = &QuestAccept_npc_torek; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/azshara.cpp b/scripts/kalimdor/azshara.cpp new file mode 100644 index 0000000..ac8409b --- /dev/null +++ b/scripts/kalimdor/azshara.cpp @@ -0,0 +1,392 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Azshara +SD%Complete: 90 +SDComment: Quest support: 2744, 3141, 9364, 10994 +SDCategory: Azshara +EndScriptData */ + +/* ContentData +npc_rizzle_sprysprocket +npc_depth_charge +go_southfury_moonstone +mobs_spitelashes +npc_loramus_thalipedes +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*##### +## npc_rizzle_sprysprocket +#####*/ + +enum +{ + SAY_START = -1000351, + EMOTE_START = -1000352, + SAY_WHISPER_CHILL = -1000353, + SAY_GRENADE_FAIL = -1000354, + SAY_END = -1000355, + + QUEST_MOONSTONE = 10994, + NPC_RIZZLE = 23002, + NPC_DEPTH_CHARGE = 23025, + + SPELL_SUMMON_RIZZLE = 39866, + SPELL_BLACKJACK = 39865, //stuns player + SPELL_ESCAPE = 39871, //teleports to water + SPELL_SWIM_SPEED = 40596, + + SPELL_FROST_TRAP = 39902, //not used? + + SPELL_PERIODIC_GRENADE = 40553, //cannot tell who are supposed to have this aura + SPELL_FROST_GRENADE = 40525, //triggered by periodic grenade + + SPELL_SUMMON_DEPTH_CHARGE = 39907, //summons the bomb creature + SPELL_TRAP = 39899, //knockback + + SPELL_PERIODIC_CHECK = 39888, + SPELL_SURRENDER = 39889, //should be triggered by periodic check, if player comes in certain distance with quest incomplete + + SPELL_GIVE_MOONSTONE = 39886 +}; + +#define GOSSIP_ITEM_MOONSTONE "Hand over the Southfury moonstone and I'll let you go." + +struct MANGOS_DLL_DECL npc_rizzle_sprysprocketAI : public npc_escortAI +{ + npc_rizzle_sprysprocketAI(Creature* pCreature) : npc_escortAI(pCreature) + { + pCreature->SetActiveObjectState(true); + m_bIsIntro = true; + m_uiIntroPhase = 0; + m_uiIntroTimer = 0; + m_uiDepthChargeTimer = 10000; + Reset(); + } + + bool m_bIsIntro; + uint8 m_uiIntroPhase; + uint32 m_uiIntroTimer; + uint32 m_uiDepthChargeTimer; + + void MoveInLineOfSight(Unit* pUnit) + { + if (HasEscortState(STATE_ESCORT_ESCORTING) && pUnit->GetTypeId() == TYPEID_PLAYER) + { + if (!HasEscortState(STATE_ESCORT_PAUSED) && m_creature->IsWithinDistInMap(pUnit, INTERACTION_DISTANCE) && m_creature->IsWithinLOSInMap(pUnit)) + { + if (((Player*)pUnit)->GetQuestStatus(QUEST_MOONSTONE) == QUEST_STATUS_INCOMPLETE) + m_creature->CastSpell(m_creature, SPELL_SURRENDER, true); + } + } + + npc_escortAI::MoveInLineOfSight(pUnit); + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + m_creature->CastSpell(m_creature,SPELL_PERIODIC_CHECK,true); + break; + } + } + + void Reset() { } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_SURRENDER) + { + SetEscortPaused(true); + DoScriptText(SAY_END, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + } + + //this may be wrong (and doesn't work) + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_FROST_GRENADE) + DoScriptText(SAY_WHISPER_CHILL, m_creature, pTarget); + } + + //this may be wrong + void JustSummoned(Creature* pSummoned) + { + //pSummoned->CastSpell(pSummoned,SPELL_PERIODIC_GRENADE,false,0,0,m_creature->GetGUID()); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (m_bIsIntro) + { + if (m_uiIntroTimer < uiDiff) + m_uiIntroTimer = 1500; + else + { + m_uiIntroTimer -= uiDiff; + return; + } + + switch(m_uiIntroPhase) + { + case 0: + DoScriptText(SAY_START, m_creature); + DoScriptText(EMOTE_START, m_creature); + break; + case 1: + //teleports to water _before_ we Start() + m_creature->CastSpell(m_creature, SPELL_ESCAPE, false); + break; + case 2: + m_creature->CastSpell(m_creature, SPELL_SWIM_SPEED, false); + m_bIsIntro = false; + Start(true); + break; + } + + ++m_uiIntroPhase; + return; + } + + if (m_uiDepthChargeTimer < uiDiff) + { + if (!HasEscortState(STATE_ESCORT_PAUSED)) + m_creature->CastSpell(m_creature, SPELL_SUMMON_DEPTH_CHARGE, false); + + m_uiDepthChargeTimer = urand(10000, 15000); + } + else + m_uiDepthChargeTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_rizzle_sprysprocket(Creature* pCreature) +{ + return new npc_rizzle_sprysprocketAI(pCreature); +} + +bool GossipHello_npc_rizzle_sprysprocket(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_MOONSTONE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MOONSTONE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_rizzle_sprysprocket(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_GIVE_MOONSTONE, false); + } + + return true; +} + +struct MANGOS_DLL_DECL npc_depth_chargeAI : public ScriptedAI +{ + npc_depth_chargeAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void MoveInLineOfSight(Unit* pUnit) + { + if (pUnit->GetTypeId() != TYPEID_PLAYER) + return; + + if (m_creature->IsWithinDistInMap(pUnit, INTERACTION_DISTANCE) && m_creature->IsWithinLOSInMap(pUnit)) + m_creature->CastSpell(pUnit, SPELL_TRAP, false); + } + + void Reset() { } +}; + +CreatureAI* GetAI_npc_depth_charge(Creature* pCreature) +{ + return new npc_depth_chargeAI(pCreature); +} + +/*###### +## go_southfury_moonstone +######*/ + +bool GOHello_go_southfury_moonstone(Player* pPlayer, GameObject* pGo) +{ + //implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose + //pPlayer->CastSpell(pPlayer,SPELL_SUMMON_RIZZLE,false); + + if (Creature* pCreature = pPlayer->SummonCreature(NPC_RIZZLE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0)) + pCreature->CastSpell(pPlayer, SPELL_BLACKJACK, false); + + return false; +} + +/*###### +## mobs_spitelashes +######*/ + +struct MANGOS_DLL_DECL mobs_spitelashesAI : public ScriptedAI +{ + mobs_spitelashesAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 morphtimer; + bool spellhit; + + void Reset() + { + morphtimer = 0; + spellhit = false; + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (!spellhit && + Hitter->GetTypeId() == TYPEID_PLAYER && + ((Player*)Hitter)->GetQuestStatus(9364) == QUEST_STATUS_INCOMPLETE && + (Spellkind->Id==118 || Spellkind->Id== 12824 || Spellkind->Id== 12825 || Spellkind->Id== 12826)) + { + spellhit=true; + DoCastSpellIfCan(m_creature,29124); //become a sheep + } + } + + void UpdateAI(const uint32 diff) + { + // we mustn't remove the creature in the same round in which we cast the summon spell, otherwise there will be no summons + if (spellhit && morphtimer>=5000) + { + m_creature->ForcedDespawn(); + return; + } + + // walk 5 seconds before summoning + if (spellhit && morphtimer<5000) + { + morphtimer+=diff; + if (morphtimer>=5000) + { + DoCastSpellIfCan(m_creature,28406); //summon copies + DoCastSpellIfCan(m_creature,6924); //visual explosion + } + } + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //TODO: add abilities for the different creatures + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mobs_spitelashes(Creature* pCreature) +{ + return new mobs_spitelashesAI(pCreature); +} + +/*###### +## npc_loramus_thalipedes +######*/ + +bool GossipHello_npc_loramus_thalipedes(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(2744) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Can you help me?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (pPlayer->GetQuestStatus(3141) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me your story", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_loramus_thalipedes(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2744); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please continue", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + pPlayer->SEND_GOSSIP_MENU(1813, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I do not understand", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22); + pPlayer->SEND_GOSSIP_MENU(1814, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+22: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Indeed", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 23); + pPlayer->SEND_GOSSIP_MENU(1815, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+23: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will do this with or your help, Loramus", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 24); + pPlayer->SEND_GOSSIP_MENU(1816, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+24: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 25); + pPlayer->SEND_GOSSIP_MENU(1817, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+25: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(3141); + break; + } + return true; +} + +void AddSC_azshara() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_rizzle_sprysprocket"; + newscript->GetAI = &GetAI_npc_rizzle_sprysprocket; + newscript->pGossipHello = &GossipHello_npc_rizzle_sprysprocket; + newscript->pGossipSelect = &GossipSelect_npc_rizzle_sprysprocket; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_depth_charge"; + newscript->GetAI = &GetAI_npc_depth_charge; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_southfury_moonstone"; + newscript->pGOHello = &GOHello_go_southfury_moonstone; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mobs_spitelashes"; + newscript->GetAI = &GetAI_mobs_spitelashes; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_loramus_thalipedes"; + newscript->pGossipHello = &GossipHello_npc_loramus_thalipedes; + newscript->pGossipSelect = &GossipSelect_npc_loramus_thalipedes; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/azuremyst_isle.cpp b/scripts/kalimdor/azuremyst_isle.cpp new file mode 100644 index 0000000..f102f05 --- /dev/null +++ b/scripts/kalimdor/azuremyst_isle.cpp @@ -0,0 +1,464 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Azuremyst_Isle +SD%Complete: 75 +SDComment: Quest support: 9283, 9528, 9537, 9554(special flight path, proper model for mount missing). Injured Draenei cosmetic only +SDCategory: Azuremyst Isle +EndScriptData */ + +/* ContentData +npc_draenei_survivor +npc_engineer_spark_overgrind +npc_injured_draenei +npc_magwin +npc_susurrus +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include + +/*###### +## npc_draenei_survivor +######*/ + +enum +{ + SAY_HEAL1 = -1000176, + SAY_HEAL2 = -1000177, + SAY_HEAL3 = -1000178, + SAY_HEAL4 = -1000179, + SAY_HELP1 = -1000180, + SAY_HELP2 = -1000181, + SAY_HELP3 = -1000182, + SAY_HELP4 = -1000183, + + SPELL_IRRIDATION = 35046, + SPELL_STUNNED = 28630 +}; + +struct MANGOS_DLL_DECL npc_draenei_survivorAI : public ScriptedAI +{ + npc_draenei_survivorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 m_uiCaster; + + uint32 m_uiSayThanksTimer; + uint32 m_uiRunAwayTimer; + uint32 m_uiSayHelpTimer; + + bool m_bCanSayHelp; + + void Reset() + { + m_uiCaster = 0; + + m_uiSayThanksTimer = 0; + m_uiRunAwayTimer = 0; + m_uiSayHelpTimer = 10000; + + m_bCanSayHelp = true; + + m_creature->CastSpell(m_creature, SPELL_IRRIDATION, true); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*.1)); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_bCanSayHelp && pWho->GetTypeId() == TYPEID_PLAYER && m_creature->IsFriendlyTo(pWho) && + m_creature->IsWithinDistInMap(pWho, 25.0f)) + { + //Random switch between 4 texts + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_HELP1, m_creature, pWho); break; + case 1: DoScriptText(SAY_HELP2, m_creature, pWho); break; + case 2: DoScriptText(SAY_HELP3, m_creature, pWho); break; + case 3: DoScriptText(SAY_HELP4, m_creature, pWho); break; + } + + m_uiSayHelpTimer = 20000; + m_bCanSayHelp = false; + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->SpellFamilyFlags2 & 0x080000000) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_creature->CastSpell(m_creature, SPELL_STUNNED, true); + + m_uiCaster = pCaster->GetGUID(); + + m_uiSayThanksTimer = 5000; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiSayThanksTimer) + { + if (m_uiSayThanksTimer <= uiDiff) + { + m_creature->RemoveAurasDueToSpell(SPELL_IRRIDATION); + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiCaster)) + { + if (pPlayer->GetTypeId() != TYPEID_PLAYER) + return; + + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_HEAL1, m_creature, pPlayer); break; + case 1: DoScriptText(SAY_HEAL2, m_creature, pPlayer); break; + case 2: DoScriptText(SAY_HEAL3, m_creature, pPlayer); break; + case 3: DoScriptText(SAY_HEAL4, m_creature, pPlayer); break; + } + + pPlayer->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID()); + } + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, -4115.053711f, -13754.831055f, 73.508949f); + + m_uiRunAwayTimer = 10000; + m_uiSayThanksTimer = 0; + }else m_uiSayThanksTimer -= uiDiff; + + return; + } + + if (m_uiRunAwayTimer) + { + if (m_uiRunAwayTimer <= uiDiff) + m_creature->ForcedDespawn(); + else + m_uiRunAwayTimer -= uiDiff; + + return; + } + + if (m_uiSayHelpTimer < uiDiff) + { + m_bCanSayHelp = true; + m_uiSayHelpTimer = 20000; + }else m_uiSayHelpTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_draenei_survivor(Creature* pCreature) +{ + return new npc_draenei_survivorAI(pCreature); +} + +/*###### +## npc_engineer_spark_overgrind +######*/ + +enum +{ + SAY_TEXT = -1000184, + EMOTE_SHELL = -1000185, + SAY_ATTACK = -1000186, + + AREA_COVE = 3579, + AREA_ISLE = 3639, + QUEST_GNOMERCY = 9537, + FACTION_HOSTILE = 14, + SPELL_DYNAMITE = 7978 +}; + +#define GOSSIP_FIGHT "Traitor! You will be brought to justice!" + +struct MANGOS_DLL_DECL npc_engineer_spark_overgrindAI : public ScriptedAI +{ + npc_engineer_spark_overgrindAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormFaction = pCreature->getFaction(); + m_uiNpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); + Reset(); + + if (pCreature->GetAreaId() == AREA_COVE || pCreature->GetAreaId() == AREA_ISLE) + m_bIsTreeEvent = true; + } + + uint32 m_uiNpcFlags; + uint32 m_uiNormFaction; + + uint32 m_uiDynamiteTimer; + uint32 m_uiEmoteTimer; + + bool m_bIsTreeEvent; + + void Reset() + { + m_creature->setFaction(m_uiNormFaction); + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags); + + m_uiDynamiteTimer = 8000; + m_uiEmoteTimer = urand(120000, 150000); + + m_bIsTreeEvent = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_ATTACK, m_creature, who); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat() && !m_bIsTreeEvent) + { + if (m_uiEmoteTimer < diff) + { + DoScriptText(SAY_TEXT, m_creature); + DoScriptText(EMOTE_SHELL, m_creature); + m_uiEmoteTimer = urand(120000, 150000); + } + else m_uiEmoteTimer -= diff; + } + else if (m_bIsTreeEvent) + { + //nothing here yet + return; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiDynamiteTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DYNAMITE); + m_uiDynamiteTimer = 8000; + } + else m_uiDynamiteTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_engineer_spark_overgrind(Creature* pCreature) +{ + return new npc_engineer_spark_overgrindAI(pCreature); +} + +bool GossipHello_npc_engineer_spark_overgrind(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_GNOMERCY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_engineer_spark_overgrind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_injured_draenei +######*/ + +struct MANGOS_DLL_DECL npc_injured_draeneiAI : public ScriptedAI +{ + npc_injured_draeneiAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*.15)); + switch(urand(0, 1)) + { + case 0: m_creature->SetStandState(UNIT_STAND_STATE_SIT); break; + case 1: m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); break; + } + } + + void MoveInLineOfSight(Unit *who) + { + return; //ignore everyone around them (won't aggro anything) + } + + void UpdateAI(const uint32 diff) + { + return; + } + +}; +CreatureAI* GetAI_npc_injured_draenei(Creature* pCreature) +{ + return new npc_injured_draeneiAI(pCreature); +} + +/*###### +## npc_magwin +######*/ + +#define SAY_START -1000111 +#define SAY_AGGRO -1000112 +#define SAY_PROGRESS -1000113 +#define SAY_END1 -1000114 +#define SAY_END2 -1000115 +#define EMOTE_HUG -1000116 + +#define QUEST_A_CRY_FOR_HELP 9528 + +struct MANGOS_DLL_DECL npc_magwinAI : public npc_escortAI +{ + npc_magwinAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(i) + { + case 0: + DoScriptText(SAY_START, m_creature, pPlayer); + break; + case 17: + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); + break; + case 28: + DoScriptText(SAY_END1, m_creature, pPlayer); + break; + case 29: + DoScriptText(EMOTE_HUG, m_creature, pPlayer); + DoScriptText(SAY_END2, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_A_CRY_FOR_HELP, m_creature); + break; + } + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature, who); + } + + void Reset() { } +}; + +bool QuestAccept_npc_magwin(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_A_CRY_FOR_HELP) + { + pCreature->setFaction(10); + + if (npc_magwinAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_magwinAI(Creature* pCreature) +{ + return new npc_magwinAI(pCreature); +} + +/*###### +## npc_susurrus +######*/ + +enum +{ + ITEM_WHORL_OF_AIR = 23843, + SPELL_BUFFETING_WINDS = 32474, + TAXI_PATH_ID = 506 +}; + +#define GOSSIP_ITEM_READY "I am ready." + +bool GossipHello_npc_susurrus(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasItemCount(ITEM_WHORL_OF_AIR,1,true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_READY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_susurrus(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + //spellId is correct, however it gives flight a somewhat funny effect + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,SPELL_BUFFETING_WINDS,true); + } + return true; +} + +/*###### +## +######*/ + +void AddSC_azuremyst_isle() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_draenei_survivor"; + newscript->GetAI = &GetAI_npc_draenei_survivor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_engineer_spark_overgrind"; + newscript->GetAI = &GetAI_npc_engineer_spark_overgrind; + newscript->pGossipHello = &GossipHello_npc_engineer_spark_overgrind; + newscript->pGossipSelect = &GossipSelect_npc_engineer_spark_overgrind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_injured_draenei"; + newscript->GetAI = &GetAI_npc_injured_draenei; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_magwin"; + newscript->GetAI = &GetAI_npc_magwinAI; + newscript->pQuestAccept = &QuestAccept_npc_magwin; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_susurrus"; + newscript->pGossipHello = &GossipHello_npc_susurrus; + newscript->pGossipSelect = &GossipSelect_npc_susurrus; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/blackfathom_deeps/blackfathom_deeps.h b/scripts/kalimdor/blackfathom_deeps/blackfathom_deeps.h new file mode 100644 index 0000000..a1474de --- /dev/null +++ b/scripts/kalimdor/blackfathom_deeps/blackfathom_deeps.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BFD_H +#define DEF_BFD_H + +enum +{ + MAX_ENCOUNTER = 6, + + TYPE_KELRIS = 1, + TYPE_SHRINE = 2, + + NPC_KELRIS = 4832, + NPC_SERVANT = 4978, + + GO_PORTAL_DOOR = 21117, + GO_SHRINE_1 = 21118, + GO_SHRINE_2 = 21119, + GO_SHRINE_3 = 21120, + GO_SHRINE_4 = 21121, + + DATA_TWILIGHT_LORD_KELRIS = 10, + DATA_SHRINE_OF_GELIHAST = 11, + DATA_ALTAR_OF_THE_DEEPS = 12 +}; + +#endif diff --git a/scripts/kalimdor/blackfathom_deeps/instance_blackfathom_deeps.cpp b/scripts/kalimdor/blackfathom_deeps/instance_blackfathom_deeps.cpp new file mode 100644 index 0000000..3c3f253 --- /dev/null +++ b/scripts/kalimdor/blackfathom_deeps/instance_blackfathom_deeps.cpp @@ -0,0 +1,247 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blackfathom_Deeps +SD%Complete: 50 +SDComment: +SDCategory: Blackfathom Deeps +EndScriptData */ + +#include "precompiled.h" +#include "blackfathom_deeps.h" + +/* Encounter 0 = Twilight Lord Kelris + Encounter 1 = Shrine event + Must kill twilight lord for shrine event to be possible + */ + +struct MANGOS_DLL_DECL instance_blackfathom_deeps : public ScriptedInstance +{ + instance_blackfathom_deeps(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 m_uiKelrisGUID; + uint64 m_uiShrineOfGelihastGUID; + uint64 m_uiAltarOfTheDeepsGUID; + uint64 m_uiPortalGUID; + uint32 m_uiSpawnServantTimer; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiKelrisGUID = 0; + m_uiShrineOfGelihastGUID = 0; + m_uiAltarOfTheDeepsGUID = 0; + m_uiPortalGUID = 0; + m_uiSpawnServantTimer = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + if (pCreature->GetEntry() == NPC_KELRIS) + m_uiKelrisGUID = pCreature->GetGUID(); + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_PORTAL_DOOR: + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + + m_uiPortalGUID = pGo->GetGUID(); + break; + case GO_SHRINE_1: + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_SHRINE_2: + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_SHRINE_3: + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_SHRINE_4: + if (m_auiEncounter[5] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case 103015: m_uiShrineOfGelihastGUID = pGo->GetGUID(); break; + case 103016: m_uiAltarOfTheDeepsGUID = pGo->GetGUID(); break; + + } + } + + bool CanOpenEndDoor() + { + if (m_auiEncounter[0] != DONE) + return false; + + if (m_auiEncounter[2] == DONE && m_auiEncounter[3] == DONE && m_auiEncounter[4] == DONE && m_auiEncounter[5] == DONE) + return true; + + return false; + } + + void SpawnServants() + { + if (Creature* pKelris = instance->GetCreature(m_uiKelrisGUID)) + { + float fX_resp, fY_resp, fZ_resp; + pKelris->GetRespawnCoord(fX_resp, fY_resp, fZ_resp); + + for(uint8 i = 0; i < 5 ; ++i) + { + // this part gets a random position at circumference point in a circle + // fRadius is how far from center to calculate. + // here we use kelris's close point coords as base and then move the summoned to the location of his respawn coords + float fRadius = 30.0f; + float fAngle = 2.0 * M_PI * rand_norm(); + + float fX, fY, fZ; + + fRadius *= sqrt(rand_norm()); + + pKelris->GetClosePoint(fX, fY, fZ, 0.0f, fRadius, fAngle); + + if (Creature* pServant = pKelris->SummonCreature(NPC_SERVANT, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000)) + pServant->GetMotionMaster()->MovePoint(0, fX_resp, fY_resp, fZ_resp); + } + + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_KELRIS: // eventAI must set instance data (1,3) at his death + if (m_auiEncounter[0] != DONE && uiData == DONE) + m_auiEncounter[0] = uiData; + break; + case TYPE_SHRINE: + { + switch(uiData) + { + case GO_SHRINE_1: + m_auiEncounter[2] = DONE; + break; + case GO_SHRINE_2: + m_auiEncounter[3] = DONE; + break; + case GO_SHRINE_3: + m_auiEncounter[4] = DONE; + break; + case GO_SHRINE_4: + m_auiEncounter[5] = DONE; + break; + } + + m_uiSpawnServantTimer = 7500; + + if (CanOpenEndDoor()) + { + m_auiEncounter[1] = DONE; + DoUseDoorOrButton(m_uiPortalGUID); + } + + break; + } + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_KELRIS: + return m_auiEncounter[0]; + case TYPE_SHRINE: + return m_auiEncounter[1]; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_TWILIGHT_LORD_KELRIS: + return m_uiKelrisGUID; + case DATA_SHRINE_OF_GELIHAST: + return m_uiShrineOfGelihastGUID; + } + + return 0; + } + + void Update(uint32 uiDiff) + { + if (m_uiSpawnServantTimer) + { + if (m_uiSpawnServantTimer <= uiDiff) + { + SpawnServants(); + m_uiSpawnServantTimer = 0; + } + else + m_uiSpawnServantTimer -= uiDiff; + } + } +}; + +InstanceData* GetInstanceData_instance_blackfathom_deeps(Map* pMap) +{ + return new instance_blackfathom_deeps(pMap); +} + +bool GOHello_go_fire_of_akumai(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return true; + + if (pInstance->GetData(TYPE_KELRIS) == DONE) + { + pInstance->SetData(TYPE_SHRINE, pGo->GetEntry()); + return false; + } + + return true; +} + +void AddSC_instance_blackfathom_deeps() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_blackfathom_deeps"; + newscript->GetInstanceData = &GetInstanceData_instance_blackfathom_deeps; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_fire_of_akumai"; + newscript->pGOHello = &GOHello_go_fire_of_akumai; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/bloodmyst_isle.cpp b/scripts/kalimdor/bloodmyst_isle.cpp new file mode 100644 index 0000000..0785b95 --- /dev/null +++ b/scripts/kalimdor/bloodmyst_isle.cpp @@ -0,0 +1,137 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Bloodmyst_Isle +SD%Complete: 80 +SDComment: Quest support: 9670, 9756(gossip items text needed). +SDCategory: Bloodmyst Isle +EndScriptData */ + +/* ContentData +mob_webbed_creature +npc_captured_sunhawk_agent +EndContentData */ + +#include "precompiled.h" + +/*###### +## mob_webbed_creature +######*/ + +//possible creatures to be spawned +const uint32 possibleSpawns[32] = {17322, 17661, 17496, 17522, 17340, 17352, 17333, 17524, 17654, 17348, 17339, 17345, 17359, 17353, 17336, 17550, 17330, 17701, 17321, 17680, 17325, 17320, 17683, 17342, 17715, 17334, 17341, 17338, 17337, 17346, 17344, 17327}; + +struct MANGOS_DLL_DECL mob_webbed_creatureAI : public ScriptedAI +{ + mob_webbed_creatureAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + } + + void JustDied(Unit* Killer) + { + uint32 spawnCreatureID = 0; + + switch(urand(0, 2)) + { + case 0: + spawnCreatureID = 17681; + if (Killer->GetTypeId() == TYPEID_PLAYER) + ((Player*)Killer)->KilledMonsterCredit(spawnCreatureID, m_creature->GetGUID()); + break; + case 1: + case 2: + spawnCreatureID = possibleSpawns[urand(0, 31)]; + break; + } + + if (spawnCreatureID) + m_creature->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + } +}; +CreatureAI* GetAI_mob_webbed_creature(Creature* pCreature) +{ + return new mob_webbed_creatureAI(pCreature); +} + +/*###### +## npc_captured_sunhawk_agent +######*/ + +#define C_SUNHAWK_TRIGGER 17974 + +bool GossipHello_npc_captured_sunhawk_agent(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->HasAura(31609, EFFECT_INDEX_1) && pPlayer->GetQuestStatus(9756) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(9136, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(9134, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_captured_sunhawk_agent(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(9137, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(9138, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(9139, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(9140, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(9141, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TalkedToCreature(C_SUNHAWK_TRIGGER, pCreature->GetGUID()); + break; + } + return true; +} + +void AddSC_bloodmyst_isle() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_webbed_creature"; + newscript->GetAI = &GetAI_mob_webbed_creature; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_captured_sunhawk_agent"; + newscript->pGossipHello = &GossipHello_npc_captured_sunhawk_agent; + newscript->pGossipSelect = &GossipSelect_npc_captured_sunhawk_agent; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/boss_azuregos.cpp b/scripts/kalimdor/boss_azuregos.cpp new file mode 100644 index 0000000..6784967 --- /dev/null +++ b/scripts/kalimdor/boss_azuregos.cpp @@ -0,0 +1,151 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Azuregos +SD%Complete: 90 +SDComment: Teleport not included, spell reflect not effecting dots (Core problem) +SDCategory: Azshara +EndScriptData */ + +#include "precompiled.h" + +#define SAY_TELEPORT -1000100 + +#define SPELL_MARKOFFROST 23182 +#define SPELL_MANASTORM 21097 +#define SPELL_CHILL 21098 +#define SPELL_FROSTBREATH 21099 +#define SPELL_REFLECT 22067 +#define SPELL_CLEAVE 8255 //Perhaps not right ID +#define SPELL_ENRAGE 23537 + +struct MANGOS_DLL_DECL boss_azuregosAI : public ScriptedAI +{ + boss_azuregosAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 MarkOfFrost_Timer; + uint32 ManaStorm_Timer; + uint32 Chill_Timer; + uint32 Breath_Timer; + uint32 Teleport_Timer; + uint32 Reflect_Timer; + uint32 Cleave_Timer; + uint32 Enrage_Timer; + bool Enraged; + + void Reset() + { + MarkOfFrost_Timer = 35000; + ManaStorm_Timer = urand(5000, 17000); + Chill_Timer = urand(10000, 30000); + Breath_Timer = urand(2000, 8000); + Teleport_Timer = 30000; + Reflect_Timer = urand(15000, 30000); + Cleave_Timer = 7000; + Enrage_Timer = 0; + Enraged = false; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Teleport_Timer < diff) + { + DoScriptText(SAY_TELEPORT, m_creature); + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+3, pUnit->GetOrientation()); + } + + DoResetThreat(); + Teleport_Timer = 30000; + }else Teleport_Timer -= diff; + + // //MarkOfFrost_Timer + // if (MarkOfFrost_Timer < diff) + // { + // DoCastSpellIfCan(m_creature->getVictim(),SPELL_MARKOFFROST); + // MarkOfFrost_Timer = 25000; + // }else MarkOfFrost_Timer -= diff; + + //Chill_Timer + if (Chill_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CHILL); + Chill_Timer = urand(13000, 25000); + }else Chill_Timer -= diff; + + //Breath_Timer + if (Breath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBREATH); + Breath_Timer = urand(10000, 15000); + }else Breath_Timer -= diff; + + //ManaStorm_Timer + if (ManaStorm_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_MANASTORM); + ManaStorm_Timer = urand(7500, 12500); + }else ManaStorm_Timer -= diff; + + //Reflect_Timer + if (Reflect_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_REFLECT); + Reflect_Timer = urand(20000, 35000); + }else Reflect_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //Enrage_Timer + if (m_creature->GetHealthPercent() < 26.0f && !Enraged) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + Enraged = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_azuregos(Creature* pCreature) +{ + return new boss_azuregosAI(pCreature); +} + +void AddSC_boss_azuregos() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_azuregos"; + newscript->GetAI = &GetAI_boss_azuregos; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp new file mode 100644 index 0000000..abf2044 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.cpp @@ -0,0 +1,235 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: culling_of_stratholme +SD%Complete: 5% +SDComment: Placeholder +SDCategory: Culling of Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "culling_of_stratholme.h" + +/* ************* +** npc_chromie (gossip, quest-accept) +************* */ + +enum +{ + QUEST_DISPELLING_ILLUSIONS = 13149, + QUEST_A_ROYAL_ESCORT = 13151, + + ITEM_ARCANE_DISRUPTOR = 37888, + + GOSSIP_ITEM_ENTRANCE_1 = -3595000, + GOSSIP_ITEM_ENTRANCE_2 = -3595001, + GOSSIP_ITEM_ENTRANCE_3 = -3595002, + + TEXT_ID_ENTRANCE_1 = 12992, + TEXT_ID_ENTRANCE_2 = 12993, + TEXT_ID_ENTRANCE_3 = 12994, + TEXT_ID_ENTRANCE_4 = 12995, + + GOSSIP_ITEM_INN_1 = -3595003, + GOSSIP_ITEM_INN_2 = -3595004, + GOSSIP_ITEM_INN_3 = -3595005, + + TEXT_ID_INN_1 = 12939, + TEXT_ID_INN_2 = 12949, + TEXT_ID_INN_3 = 12950, + TEXT_ID_INN_4 = 12952, +}; + +bool GossipHello_npc_chromie(Player *pPlayer, Creature *pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (instance_culling_of_stratholme* m_pInstance = (instance_culling_of_stratholme*)pCreature->GetInstanceData()) + { + switch (pCreature->GetEntry()) + { + case NPC_CHROMIE_INN: + if (m_pInstance->GetData(TYPE_GRAIN_EVENT) != DONE) + { + if (pPlayer->GetQuestRewardStatus(QUEST_DISPELLING_ILLUSIONS) && !pPlayer->HasItemCount(ITEM_ARCANE_DISRUPTOR, 1)) + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INN_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + } + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_INN_1, pCreature->GetGUID()); + break; + case NPC_CHROMIE_ENTRANCE: + if (m_pInstance->GetData(TYPE_GRAIN_EVENT) == DONE && m_pInstance->GetData(TYPE_ARTHAS_INTRO_EVENT) == NOT_STARTED && pPlayer->GetQuestRewardStatus(QUEST_A_ROYAL_ESCORT)) + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ENTRANCE_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_ENTRANCE_1, pCreature->GetGUID()); + break; + } + } + return true; +} + +bool GossipSelect_npc_chromie(Player* pPlayer, Creature* pCreature, uint32 sender, uint32 uiAction) +{ + switch (pCreature->GetEntry()) + { + case NPC_CHROMIE_INN: + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INN_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_INN_2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INN_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_INN_3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_INN_4, pCreature->GetGUID()); + if (!pPlayer->HasItemCount(ITEM_ARCANE_DISRUPTOR, 1)) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(ITEM_ARCANE_DISRUPTOR, 1)) + { + pPlayer->SendNewItem(pItem, 1, true, false); + if (instance_culling_of_stratholme* pInstance = (instance_culling_of_stratholme*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_GRAIN_EVENT) == NOT_STARTED) + pInstance->SetData(TYPE_GRAIN_EVENT, SPECIAL); + } + } + } + break; + } + break; + case NPC_CHROMIE_ENTRANCE: + switch (uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ENTRANCE_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_ENTRANCE_2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ENTRANCE_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_ENTRANCE_3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_ENTRANCE_4, pCreature->GetGUID()); + if (instance_culling_of_stratholme* pInstance = (instance_culling_of_stratholme*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_ARTHAS_INTRO_EVENT) == NOT_STARTED) + pInstance->DoSpawnArthasIfNeeded(); + } + break; + } + break; + } + return true; +} + +bool QuestAccept_npc_chromie(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + switch (pQuest->GetQuestId()) + { + case QUEST_DISPELLING_ILLUSIONS: + if (instance_culling_of_stratholme* pInstance = (instance_culling_of_stratholme*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_GRAIN_EVENT) == NOT_STARTED) + pInstance->SetData(TYPE_GRAIN_EVENT, SPECIAL); + } + break; + case QUEST_A_ROYAL_ESCORT: + if (instance_culling_of_stratholme* pInstance = (instance_culling_of_stratholme*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_ARTHAS_INTRO_EVENT) == NOT_STARTED) + pInstance->DoSpawnArthasIfNeeded(); + } + break; + } + return true; +} + +/* ************* +** npc_crates_bunny (spell aura effect dummy) +************* */ + +enum +{ + SPELL_ARCANE_DISRUPTION = 49590 +}; + +bool EffectAuraDummy_spell_aura_dummy_npc_crates_dummy(const Aura* pAura, bool bApply) +{ + if (pAura->GetId() == SPELL_ARCANE_DISRUPTION && pAura->GetEffIndex() == EFFECT_INDEX_0 && bApply) + { + if (Creature* pTarget = (Creature*)pAura->GetTarget()) + { + std::list lCrateBunnyList; + if (instance_culling_of_stratholme* pInstance = (instance_culling_of_stratholme*)pTarget->GetInstanceData()) + { + pInstance->GetCratesBunnyOrderedList(lCrateBunnyList); + uint8 i = 0; + for (std::list::const_iterator itr = lCrateBunnyList.begin(); itr != lCrateBunnyList.end(); ++itr) + { + i++; + if (*itr == pTarget) + break; + } + + switch (i) + { + case 1: + // Start NPC_ROGER_OWENS Event + break; + case 2: + // Start NPC_SERGEANT_MORIGAN Event + break; + case 3: + // Start NPC_JENA_ANDERSON Event + break; + case 4: + // Start NPC_MALCOM_MOORE Event + break; + case 5: + // Start NPC_BARTLEBY_BATTSON Event + break; + } + + if (pInstance->GetData(TYPE_GRAIN_EVENT) != DONE) + pInstance->SetData(TYPE_GRAIN_EVENT, IN_PROGRESS); + // pTarget->ForcedDespawn(); // direct despawn has influence on visual effects, + // but despawning makes it impossible to multi-use the spell at the same place + // perhaps some add. GO-Visual + } + } + } + return true; +} + +void AddSC_culling_of_stratholme() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_chromie"; + pNewScript->pGossipHello = &GossipHello_npc_chromie; + pNewScript->pGossipSelect = &GossipSelect_npc_chromie; + pNewScript->pQuestAccept = &QuestAccept_npc_chromie; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "spell_dummy_npc_crates_bunny"; + pNewScript->pEffectAuraDummy = &EffectAuraDummy_spell_aura_dummy_npc_crates_dummy; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h new file mode 100644 index 0000000..cfae166 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/culling_of_stratholme.h @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_CULLING_OF_STRATHOLME_H +#define DEF_CULLING_OF_STRATHOLME_H + +enum +{ + MAX_ENCOUNTER = 9, + + TYPE_GRAIN_EVENT = 0, // crates with plagued grain identified + TYPE_ARTHAS_INTRO_EVENT = 1, // Arhas Speech and Walk to Gates and short intro with MalGanis + TYPE_MEATHOOK_EVENT = 2, // Waves 1-5 + TYPE_SALRAMM_EVENT = 3, // Waves 6-10 + TYPE_EPOCH_EVENT = 4, // Townhall Event, Boss Killed + TYPE_ARTHAS_ESCORT_EVENT = 5, // Townhall to Malganis + TYPE_MALGANIS_EVENT = 6, // Malganis + TYPE_INFINITE_CORRUPTER_TIME = 7, // Time for 25min Timer + TYPE_INFINITE_CORRUPTER = 8, + + // Main Encounter NPCs + NPC_CHROMIE_INN = 26527, + NPC_CHROMIE_ENTRANCE = 27915, + NPC_CHROMIE_END = 30997, + NPC_HOURGLASS = 28656, + NPC_ARTHAS = 26499, + NPC_MEATHOOK = 26529, + NPC_SALRAMM_THE_FLESHCRAFTER = 26530, + NPC_CHRONO_LORD_EPOCH = 26532, + NPC_MALGANIS = 26533, + NPC_INFINITE_CORRUPTER = 32273, + NPC_LORDAERON_CRIER = 27913, + NPC_ZOMBIE = 27737, + + // Inn Event related NPC + NPC_MICHAEL_BELFAST = 30571, + NPC_HEARTHSINGER_FORRESTEN = 30551, + NPC_FRAS_SIABI = 30552, + NPC_FOOTMAN_JAMES = 30553, + NPC_MAL_CORRICKS = 31017, + NPC_GRYAN_STOUTMANTLE = 30561, + + // Grain Event NPCs + NPC_ROGER_OWENS = 27903, + NPC_SERGEANT_MORIGAN = 27877, + NPC_JENA_ANDERSON = 27885, + NPC_MALCOM_MOORE = 27891, // Not (yet?) spawned + NPC_BARTLEBY_BATTSON = 27907, + NPC_CRATES_BUNNY = 30996, + + // Intro Event NPCs + NPC_LORDAERON_FOOTMAN = 27745, + NPC_STRATHOLME_CITIZEN = 28167, + NPC_STRATHOLME_RESIDENT = 28169, + + // Mobs in Stratholme (to despawn) -- only here for sake of completeness handling remains open (mangos feature) + NPC_MAGISTRATE_BARTHILAS = 30994, + NPC_STEPHANIE_SINDREE = 31019, + NPC_LEEKA_TURNER = 31027, + NPC_SOPHIE_AAREN = 31021, + NPC_ROBERT_PIERCE = 31025, + NPC_GEORGE_GOODMAN = 31022, + + // Others NPCs in Stratholme + NPC_EMERY_NEILL = 30570, + NPC_EDWARD_ORRICK = 31018, + NPC_OLIVIA_ZENITH = 31020, + + // Townhall Event NPCs + NPC_AGIATED_STRATHOLME_CITIZEN = 31126, + NPC_AGIATED_STRATHOLME_RESIDENT = 31127, + NPC_PATRICIA_O_REILLY = 31028, + + // Gameobjects + GO_DOOR_BOOKCASE = 188686, + GO_DARK_RUNED_CHEST = 190663, + GO_DARK_RUNED_CHEST_H = 193597, + + // World States + WORLD_STATE_CRATES = 3479, + WORLD_STATE_CRATES_COUNT = 3480, + WORLD_STATE_WAVE = 3504, + WORLD_STATE_TIME = 3932, + WORLD_STATE_TIME_COUNTER = 3931, + + // Areatrigger + AREATRIGGER_INN = 5291, + /* + 5085 before bridge - could be Uther SpawnPos + 5148 ini entrance + 5181 ini exit + 5249 fras siabis store + 5250 leeking shields...(store) + 5251 bar in stratholme + 5252 Aaren flowers + 5253 Angelicas boutique + 5256 townhall + 5291 Inn */ +}; + +enum eInstancePosition +{ + POS_ARTHAS_INTRO = 1, + POS_ARTHAS_WAVES = 2, + POS_ARTHAS_TOWNHALL = 3, + POS_ARTHAS_ESCORTING = 4, + POS_ARTHAS_MALGANIS = 5, + POS_INSTANCE_FINISHED = 6 +}; + +class MANGOS_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance +{ + public: + instance_culling_of_stratholme(Map* pMap); + ~instance_culling_of_stratholme() {} + + void Initialize(); + + void OnCreatureCreate(Creature* pCreature); + void OnObjectCreate(GameObject* pGo); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + void Update(uint32 uiDiff); + + void GetStratAgiatedCitizenList(std::list &lList){ lList = m_lAgiatedCitizenGUIDList; }; + void GetStratAgiatedResidentList(std::list &lList){ lList = m_lAgiatedResidentGUIDList; }; + + void GetCratesBunnyOrderedList(std::list &lList); + Creature* GetStratIntroFootman(); + void GetResidentOrderedList(std::list &lList); + void DoSpawnArthasIfNeeded(); + void DoSpawnChromieIfNeeded(); + uint8 GetInstancePosition(); + void ArthasJustDied(); + + protected: + void OnPlayerEnter(Player* pPlayer); + Player* GetPlayerInMap(); + void UpdateQuestCredit(); + void DoChromieHurrySpeech(); + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint8 m_uiGrainCrateCount; + uint32 m_uiRemoveCrateStateTimer; + uint32 m_uiArthasRespawnTimer; + + uint64 m_uiChromieInnGUID; + uint64 m_uiChromieEntranceGUID; + uint64 m_uiChromieEndGUID; + uint64 m_uiHourglassGUID; + uint64 m_uiArthasGUID; + uint64 m_uiMeathookGUID; + uint64 m_uiSalrammGUID; + uint64 m_uiEpochGUID; + uint64 m_uiMalganisGUID; + uint64 m_uiCorrupterGUID; + uint64 m_uiLordaeronCrierGUID; + + uint64 m_uiBelfastGUID; + uint64 m_uiForrestenGUID; + uint64 m_uiSiabiGUID; + uint64 m_uiJamesGUID; + uint64 m_uiCorricksGUID; + uint64 m_uiStoutmantleGUID; + + uint64 m_uiOwensGUID; + uint64 m_uiMoriganGUID; + uint64 m_uiAndersonGUID; + uint64 m_uiMooreGUID; + uint64 m_uiBattsonGUID; + + uint64 m_uiOReillyGUID; + + std::list m_lCratesBunnyList; + std::list m_lFootmanList; + std::list m_lResidentList; + + std::list m_lAgiatedCitizenGUIDList; + std::list m_lAgiatedResidentGUIDList; + + uint64 m_uiDoorBookcaseGUID; + uint64 m_uiDarkRunedChestGUID; +}; + +#endif diff --git a/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp new file mode 100644 index 0000000..706d976 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp @@ -0,0 +1,558 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_culling_of_stratholme +SD%Complete: 80% +SDComment: +SDCategory: Culling of Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "culling_of_stratholme.h" + +enum +{ + MAX_ARTHAS_SPAWN_POS = 5, + SAY_CHROMIE_HURRY = -1000000 // TODO +}; + +struct sSpawnLocation +{ + float m_fX, m_fY, m_fZ, m_fO; +}; + +static sSpawnLocation m_aArthasSpawnLocs[] = // need tuning +{ + {1969.73f, 1287.12f, 145.48f, 3.14f}, + {2049.43f, 1287.43f, 142.75f, 0.06f}, + {2365.54f, 1194.85f, 131.98f, 0.47f}, + {2534.46f, 1125.99f, 130.75f, 0.27f}, + {2363.77f, 1406.31f, 128.64f, 3.23f} +}; + +static sSpawnLocation m_aChromieSpawnLocs[] = // need tuning, escpecially EndPositions! +{ + {1814.46f, 1283.97f, 142.30f, 4.32f}, // near bridge + {2311.0f, 1502.4f, 127.9f, 0.0f}, // End + {1811.52f, 1285.92f, 142.37f, 4.47f}, // Hourglass, near bridge + {2186.42f, 1323.77f, 129.91f, 0.0f}, // Hourglass, End +}; + +instance_culling_of_stratholme::instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap), + m_uiGrainCrateCount(0), + m_uiRemoveCrateStateTimer(0), + m_uiArthasRespawnTimer(0), + + m_uiChromieInnGUID(0), + m_uiChromieEntranceGUID(0), + m_uiChromieEndGUID(0), + m_uiHourglassGUID(0), + m_uiArthasGUID(0), + m_uiMeathookGUID(0), + m_uiSalrammGUID(0), + m_uiEpochGUID(0), + m_uiCorrupterGUID(0), + m_uiLordaeronCrierGUID(0), + + m_uiBelfastGUID(0), + m_uiForrestenGUID(0), + m_uiSiabiGUID(0), + m_uiJamesGUID(0), + m_uiCorricksGUID(0), + m_uiStoutmantleGUID(0), + + m_uiOwensGUID(0), + m_uiMoriganGUID(0), + m_uiAndersonGUID(0), + m_uiMooreGUID(0), + m_uiBattsonGUID(0), + + m_uiOReillyGUID(0), + + m_uiDoorBookcaseGUID(0), + m_uiDarkRunedChestGUID(0) +{ + Initialize(); +} + +void instance_culling_of_stratholme::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +} + +void instance_culling_of_stratholme::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_CHROMIE_INN: m_uiChromieInnGUID = pCreature->GetGUID(); break; + case NPC_CHROMIE_ENTRANCE: m_uiChromieEntranceGUID = pCreature->GetGUID(); break; + case NPC_CHROMIE_END: m_uiChromieEndGUID = pCreature->GetGUID(); break; + case NPC_HOURGLASS: m_uiHourglassGUID = pCreature->GetGUID(); break; + case NPC_ARTHAS: m_uiArthasGUID = pCreature->GetGUID(); break; + case NPC_MEATHOOK: m_uiMeathookGUID = pCreature->GetGUID(); break; + case NPC_SALRAMM_THE_FLESHCRAFTER: m_uiSalrammGUID = pCreature->GetGUID(); break; + case NPC_CHRONO_LORD_EPOCH: m_uiEpochGUID = pCreature->GetGUID(); break; + case NPC_MALGANIS: m_uiMalganisGUID = pCreature->GetGUID(); break; + case NPC_MICHAEL_BELFAST: m_uiBelfastGUID = pCreature->GetGUID(); break; + case NPC_HEARTHSINGER_FORRESTEN: m_uiForrestenGUID = pCreature->GetGUID(); break; + case NPC_FRAS_SIABI: m_uiSiabiGUID = pCreature->GetGUID(); break; + case NPC_FOOTMAN_JAMES: m_uiJamesGUID = pCreature->GetGUID(); break; + case NPC_MAL_CORRICKS: m_uiCorricksGUID = pCreature->GetGUID(); break; + case NPC_GRYAN_STOUTMANTLE: m_uiStoutmantleGUID = pCreature->GetGUID(); break; + case NPC_ROGER_OWENS: m_uiOwensGUID = pCreature->GetGUID(); break; + case NPC_SERGEANT_MORIGAN: m_uiMoriganGUID = pCreature->GetGUID(); break; + case NPC_JENA_ANDERSON: m_uiAndersonGUID = pCreature->GetGUID(); break; + case NPC_MALCOM_MOORE: m_uiMooreGUID = pCreature->GetGUID(); break; + case NPC_BARTLEBY_BATTSON: m_uiBattsonGUID = pCreature->GetGUID(); break; + case NPC_PATRICIA_O_REILLY: m_uiOReillyGUID = pCreature->GetGUID(); break; + case NPC_LORDAERON_CRIER: m_uiLordaeronCrierGUID = pCreature->GetGUID(); break; + case NPC_INFINITE_CORRUPTER: m_uiCorrupterGUID = pCreature->GetGUID(); break; + + case NPC_CRATES_BUNNY: m_lCratesBunnyList.push_back(pCreature); break; + case NPC_LORDAERON_FOOTMAN: m_lFootmanList.push_back(pCreature); break; + + case NPC_STRATHOLME_CITIZEN: + case NPC_STRATHOLME_RESIDENT: + if (m_auiEncounter[TYPE_ARTHAS_INTRO_EVENT] == DONE) + pCreature->UpdateEntry(NPC_ZOMBIE); + else + m_lResidentList.push_back(pCreature); + break; + case NPC_AGIATED_STRATHOLME_CITIZEN: m_lAgiatedCitizenGUIDList.push_back(pCreature->GetGUID()); break; + case NPC_AGIATED_STRATHOLME_RESIDENT: m_lAgiatedResidentGUIDList.push_back(pCreature->GetGUID()); break; + } +} + +void instance_culling_of_stratholme::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_DOOR_BOOKCASE: + m_uiDoorBookcaseGUID = pGo->GetGUID(); + if (m_auiEncounter[TYPE_EPOCH_EVENT] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DARK_RUNED_CHEST: + case GO_DARK_RUNED_CHEST_H: + m_uiDarkRunedChestGUID = pGo->GetGUID(); + break; + } +} + +Player* instance_culling_of_stratholme::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; + } + } + return NULL; +} + +void instance_culling_of_stratholme::UpdateQuestCredit() +{ + Map::PlayerList const& players = instance->GetPlayers(); + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonsterCredit(NPC_CRATES_BUNNY); + } + } +} + +void instance_culling_of_stratholme::DoChromieHurrySpeech() +{ + if (Creature* pChromie = instance->GetCreature(m_uiChromieEntranceGUID)) + { + Map::PlayerList const& players = instance->GetPlayers(); + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + DoScriptText(SAY_CHROMIE_HURRY, pChromie, pPlayer); + } + } + } +} + +void instance_culling_of_stratholme::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_GRAIN_EVENT: + m_auiEncounter[TYPE_GRAIN_EVENT] = uiData; + if (uiData == SPECIAL) + DoUpdateWorldState(WORLD_STATE_CRATES, 1); + else if (uiData == IN_PROGRESS) + { + if (m_uiGrainCrateCount >= 5) + return; + + ++m_uiGrainCrateCount; + DoUpdateWorldState(WORLD_STATE_CRATES_COUNT, m_uiGrainCrateCount); + + if (m_uiGrainCrateCount == 5) + { + UpdateQuestCredit(); + m_uiRemoveCrateStateTimer = 20000; + SetData(TYPE_GRAIN_EVENT, DONE); + } + } + break; + case TYPE_ARTHAS_INTRO_EVENT: + m_auiEncounter[TYPE_ARTHAS_INTRO_EVENT] = uiData; + break; + case TYPE_ARTHAS_ESCORT_EVENT: + m_auiEncounter[TYPE_ARTHAS_ESCORT_EVENT] = uiData; + break; + case TYPE_MEATHOOK_EVENT: + m_auiEncounter[TYPE_MEATHOOK_EVENT] = uiData; + if (uiData == DONE) + SetData(TYPE_SALRAMM_EVENT, IN_PROGRESS); + break; + case TYPE_SALRAMM_EVENT: + m_auiEncounter[TYPE_SALRAMM_EVENT] = uiData; + if (uiData == DONE) + DoUpdateWorldState(WORLD_STATE_WAVE, 0); // Remove WaveCounter + break; + case TYPE_EPOCH_EVENT: + m_auiEncounter[TYPE_EPOCH_EVENT] = uiData; + break; + case TYPE_MALGANIS_EVENT: + m_auiEncounter[TYPE_MALGANIS_EVENT] = uiData; + if (uiData == DONE) + { + DoRespawnGameObject(m_uiDarkRunedChestGUID, 30*MINUTE); + DoSpawnChromieIfNeeded(); + } + break; + case TYPE_INFINITE_CORRUPTER_TIME: + m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] = uiData; + if (!uiData) + { + DoUpdateWorldState(WORLD_STATE_TIME, 0); // Remove Timer + DoUpdateWorldState(WORLD_STATE_TIME_COUNTER, 0); + } + else + DoUpdateWorldState(WORLD_STATE_TIME_COUNTER, uiData/(MINUTE*IN_MILLISECONDS)); + break; + case TYPE_INFINITE_CORRUPTER: + m_auiEncounter[TYPE_INFINITE_CORRUPTER] = uiData; + switch(uiData) + { + case IN_PROGRESS: + if (!m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]) + SetData(TYPE_INFINITE_CORRUPTER_TIME, MINUTE*25*IN_MILLISECONDS); + DoUpdateWorldState(WORLD_STATE_TIME, 1);// Show Timer + break; + case DONE: + SetData(TYPE_INFINITE_CORRUPTER_TIME, 0); + break; + case SPECIAL: + DoChromieHurrySpeech(); + break; + case FAIL: + SetData(TYPE_INFINITE_CORRUPTER_TIME, 0); + if (Creature* pCorrupter = instance->GetCreature(m_uiCorrupterGUID)) + if (pCorrupter->isAlive()) + pCorrupter->ForcedDespawn(); + break; + } + break; + } + + if (uiData == DONE || (uiType == TYPE_INFINITE_CORRUPTER && uiData == FAIL)) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_culling_of_stratholme::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (i != TYPE_INFINITE_CORRUPTER_TIME) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + } + + // If already started counting down time, the event is "in progress" + if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]) + m_auiEncounter[TYPE_INFINITE_CORRUPTER] = IN_PROGRESS; + + OUT_LOAD_INST_DATA_COMPLETE; +} + +void instance_culling_of_stratholme::OnPlayerEnter(Player* pPlayer) +{ + if (instance->GetPlayersCountExceptGMs() == 0) + { + DoSpawnArthasIfNeeded(); + DoSpawnChromieIfNeeded(); + + // Show World States if needed, TODO verify if needed and if this is the right way + if (m_auiEncounter[TYPE_GRAIN_EVENT] == IN_PROGRESS || m_auiEncounter[TYPE_GRAIN_EVENT] == SPECIAL) + DoUpdateWorldState(WORLD_STATE_CRATES, 1); // Show Crates Counter + else + DoUpdateWorldState(WORLD_STATE_CRATES, 0); // Remove Crates Counter + + if (m_auiEncounter[TYPE_MEATHOOK_EVENT] == IN_PROGRESS) + DoUpdateWorldState(WORLD_STATE_WAVE, 1); // Add WaveCounter + else if (m_auiEncounter[TYPE_SALRAMM_EVENT] == IN_PROGRESS) + DoUpdateWorldState(WORLD_STATE_WAVE, 6); // Add WaveCounter + else + DoUpdateWorldState(WORLD_STATE_WAVE, 0); // Remove WaveCounter + + if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]) + DoUpdateWorldState(WORLD_STATE_TIME, 1); // Show Timer + else + DoUpdateWorldState(WORLD_STATE_TIME, 0); // Remove Timer + } +} + +uint32 instance_culling_of_stratholme::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_GRAIN_EVENT: return m_auiEncounter[0]; + case TYPE_ARTHAS_INTRO_EVENT: return m_auiEncounter[1]; + case TYPE_MEATHOOK_EVENT: return m_auiEncounter[2]; + case TYPE_SALRAMM_EVENT: return m_auiEncounter[3]; + case TYPE_EPOCH_EVENT: return m_auiEncounter[4]; + case TYPE_ARTHAS_ESCORT_EVENT: return m_auiEncounter[5]; + case TYPE_MALGANIS_EVENT: return m_auiEncounter[6]; + case TYPE_INFINITE_CORRUPTER_TIME: return m_auiEncounter[7]; + case TYPE_INFINITE_CORRUPTER: return m_auiEncounter[8]; + default: return 0; + } +} + +uint64 instance_culling_of_stratholme::GetData64(uint32 uiData) +{ + switch(uiData) + { + case NPC_CHROMIE_INN: return m_uiChromieInnGUID; + case NPC_CHROMIE_ENTRANCE: return m_uiChromieEntranceGUID; + case NPC_CHROMIE_END: return m_uiChromieEndGUID; + case NPC_HOURGLASS: return m_uiHourglassGUID; + case NPC_ARTHAS: return m_uiArthasGUID; + case NPC_MEATHOOK: return m_uiMeathookGUID; + case NPC_SALRAMM_THE_FLESHCRAFTER: return m_uiSalrammGUID; + case NPC_CHRONO_LORD_EPOCH: return m_uiEpochGUID; + case NPC_MALGANIS: return m_uiMalganisGUID; + case NPC_INFINITE_CORRUPTER: return m_uiCorrupterGUID; + case NPC_MICHAEL_BELFAST: return m_uiBelfastGUID; + case NPC_HEARTHSINGER_FORRESTEN: return m_uiForrestenGUID; + case NPC_FRAS_SIABI: return m_uiSiabiGUID; + case NPC_FOOTMAN_JAMES: return m_uiJamesGUID; + case NPC_MAL_CORRICKS: return m_uiCorricksGUID; + case NPC_GRYAN_STOUTMANTLE: return m_uiStoutmantleGUID; + case NPC_ROGER_OWENS: return m_uiOwensGUID; + case NPC_SERGEANT_MORIGAN: return m_uiMoriganGUID; + case NPC_JENA_ANDERSON: return m_uiAndersonGUID; + case NPC_MALCOM_MOORE: return m_uiMooreGUID; + case NPC_BARTLEBY_BATTSON: return m_uiBattsonGUID; + case NPC_PATRICIA_O_REILLY: return m_uiOReillyGUID; + case GO_DOOR_BOOKCASE: return m_uiDoorBookcaseGUID; + default: return 0; + } +} + +uint8 instance_culling_of_stratholme::GetInstancePosition() +{ + if (m_auiEncounter[TYPE_MALGANIS_EVENT] == DONE) + return POS_INSTANCE_FINISHED; + else if (m_auiEncounter[TYPE_ARTHAS_ESCORT_EVENT] == DONE) + return POS_ARTHAS_MALGANIS; + else if (m_auiEncounter[TYPE_EPOCH_EVENT] == DONE) + return POS_ARTHAS_ESCORTING; + else if (m_auiEncounter[TYPE_SALRAMM_EVENT] == DONE) + return POS_ARTHAS_TOWNHALL; + else if (m_auiEncounter[TYPE_MEATHOOK_EVENT] == DONE) + return POS_ARTHAS_WAVES; + else if (m_auiEncounter[TYPE_ARTHAS_INTRO_EVENT] == DONE) + return POS_ARTHAS_WAVES; + else if (m_auiEncounter[TYPE_GRAIN_EVENT] == DONE) + return POS_ARTHAS_INTRO; + else + return 0; +} + +static bool sortFromEastToWest(Creature* pFirst, Creature* pSecond) +{ + return pFirst && pSecond && pFirst->GetPositionY() < pSecond->GetPositionY(); +} + +static bool sortFromSouthToNorth(Creature* pFirst, Creature* pSecond) +{ + return pFirst && pSecond && pFirst->GetPositionX() < pSecond->GetPositionX(); +} + +void instance_culling_of_stratholme::GetCratesBunnyOrderedList(std::list &lList) +{ + m_lCratesBunnyList.sort(sortFromEastToWest); + lList = m_lCratesBunnyList; +} + +Creature* instance_culling_of_stratholme::GetStratIntroFootman() +{ + m_lFootmanList.sort(sortFromSouthToNorth); + if (m_lFootmanList.empty()) + return NULL; + else + return *m_lFootmanList.begin(); +} + +void instance_culling_of_stratholme::GetResidentOrderedList(std::list &lList) +{ + m_lResidentList.sort(sortFromSouthToNorth); + lList = m_lResidentList; +} + +void instance_culling_of_stratholme::ArthasJustDied() +{ + m_uiArthasRespawnTimer = 10000; // TODO, could be instant +} + +void instance_culling_of_stratholme::DoSpawnArthasIfNeeded() +{ + Creature* pArthas = instance->GetCreature(m_uiArthasGUID); + if (pArthas && pArthas->isAlive()) + return; + + uint8 uiPosition = GetInstancePosition(); + if (uiPosition && uiPosition <= MAX_ARTHAS_SPAWN_POS) + { + if (Player* pPlayer = GetPlayerInMap()) + pPlayer->SummonCreature(NPC_ARTHAS, m_aArthasSpawnLocs[uiPosition-1].m_fX, m_aArthasSpawnLocs[uiPosition-1].m_fY, m_aArthasSpawnLocs[uiPosition-1].m_fZ, m_aArthasSpawnLocs[uiPosition-1].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + } +} + +// Atm here only new Chromies are spawned - despawning depends on Mangos featuring such a thing +// The hourglass also is not yet spawned/ relocated. +void instance_culling_of_stratholme::DoSpawnChromieIfNeeded() +{ + Player* pPlayer = GetPlayerInMap(); + if (!pPlayer) + return; + + if (GetInstancePosition() == POS_INSTANCE_FINISHED) + { + Creature* pChromie = instance->GetCreature(m_uiChromieEndGUID); + if (!pChromie) + pPlayer->SummonCreature(NPC_CHROMIE_END, m_aChromieSpawnLocs[1].m_fX, m_aChromieSpawnLocs[1].m_fY, m_aChromieSpawnLocs[1].m_fZ, m_aChromieSpawnLocs[1].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + } + else if (GetInstancePosition() >= POS_ARTHAS_INTRO) + { + Creature* pChromie = instance->GetCreature(m_uiChromieEntranceGUID); + if (!pChromie) + pPlayer->SummonCreature(NPC_CHROMIE_ENTRANCE, m_aChromieSpawnLocs[0].m_fX, m_aChromieSpawnLocs[0].m_fY, m_aChromieSpawnLocs[0].m_fZ, m_aChromieSpawnLocs[0].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + } +} + +void instance_culling_of_stratholme::Update(uint32 uiDiff) +{ + // 25min Run - decrease time, update worldstate every ~20s + // as the time is always saved by m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME], there is no need for an extra timer + if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]) + { + if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] <= uiDiff) + SetData(TYPE_INFINITE_CORRUPTER, FAIL); + else + { + m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] -= uiDiff; + if (m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]/IN_MILLISECONDS % 20 == 0) + SetData(TYPE_INFINITE_CORRUPTER_TIME, m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME]); + } + + // This part is needed for a small "hurry up guys" note, TODO, verify 20min + if (m_auiEncounter[TYPE_INFINITE_CORRUPTER] == IN_PROGRESS && m_auiEncounter[TYPE_INFINITE_CORRUPTER_TIME] <= 24*MINUTE*IN_MILLISECONDS) + SetData(TYPE_INFINITE_CORRUPTER, SPECIAL); + } + + // Small Timer, to remove Grain-Crate WorldState and Spawn Second Chromie + if (m_uiRemoveCrateStateTimer) + { + if (m_uiRemoveCrateStateTimer <= uiDiff) + { + DoUpdateWorldState(WORLD_STATE_CRATES, 0); + DoSpawnChromieIfNeeded(); + m_uiRemoveCrateStateTimer = 0; + } + else + m_uiRemoveCrateStateTimer -= uiDiff; + } + + // Respawn Arthas after some time + if (m_uiArthasRespawnTimer) + { + if (m_uiArthasRespawnTimer <= uiDiff) + { + DoSpawnArthasIfNeeded(); + m_uiArthasRespawnTimer = 0; + } + else + m_uiArthasRespawnTimer -= uiDiff; + } +} + +InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* pMap) +{ + return new instance_culling_of_stratholme(pMap); +} + +void AddSC_instance_culling_of_stratholme() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_culling_of_stratholme"; + pNewScript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp new file mode 100644 index 0000000..04d3438 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp @@ -0,0 +1,144 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Aeonus +SD%Complete: 80 +SDComment: Some spells not implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "dark_portal.h" + +enum +{ + SAY_ENTER = -1269012, + SAY_AGGRO = -1269013, + SAY_BANISH = -1269014, + SAY_SLAY1 = -1269015, + SAY_SLAY2 = -1269016, + SAY_DEATH = -1269017, + EMOTE_GENERIC_FRENZY = -1000002, + + SPELL_CLEAVE = 40504, + SPELL_TIME_STOP = 31422, + SPELL_ENRAGE = 37605, + SPELL_SAND_BREATH = 31473, + H_SPELL_SAND_BREATH = 39049 +}; + +struct MANGOS_DLL_DECL boss_aeonusAI : public ScriptedAI +{ + boss_aeonusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 SandBreath_Timer; + uint32 TimeStop_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + SandBreath_Timer = urand(15000, 30000); + TimeStop_Timer = urand(10000, 15000); + Frenzy_Timer = urand(30000, 45000); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_RIFT,DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Sand Breath + if (SandBreath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SAND_BREATH : H_SPELL_SAND_BREATH); + SandBreath_Timer = urand(15000, 25000); + }else SandBreath_Timer -= diff; + + //Time Stop + if (TimeStop_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TIME_STOP); + TimeStop_Timer = urand(20000, 35000); + }else TimeStop_Timer -= diff; + + //Frenzy + if (Frenzy_Timer < diff) + { + DoScriptText(EMOTE_GENERIC_FRENZY, m_creature); + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + Frenzy_Timer = urand(20000, 35000); + }else Frenzy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_aeonus(Creature* pCreature) +{ + return new boss_aeonusAI(pCreature); +} + +void AddSC_boss_aeonus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_aeonus"; + newscript->GetAI = &GetAI_boss_aeonus; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp new file mode 100644 index 0000000..2ae675f --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp @@ -0,0 +1,154 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Chrono_Lord_Deja +SD%Complete: 65 +SDComment: All abilities not implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "dark_portal.h" + +#define SAY_ENTER -1269006 +#define SAY_AGGRO -1269007 +#define SAY_BANISH -1269008 +#define SAY_SLAY1 -1269009 +#define SAY_SLAY2 -1269010 +#define SAY_DEATH -1269011 + +#define SPELL_ARCANE_BLAST 31457 +#define H_SPELL_ARCANE_BLAST 38538 +#define SPELL_ARCANE_DISCHARGE 31472 +#define H_SPELL_ARCANE_DISCHARGE 38539 +#define SPELL_TIME_LAPSE 31467 +#define SPELL_ATTRACTION 38540 //Not Implemented (Heroic mode) + +struct MANGOS_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI +{ + boss_chrono_lord_dejaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 ArcaneBlast_Timer; + uint32 TimeLapse_Timer; + uint32 Attraction_Timer; + uint32 ArcaneDischarge_Timer; + + void Reset() + { + ArcaneBlast_Timer = urand(18000, 23000); + TimeLapse_Timer = urand(10000, 15000); + ArcaneDischarge_Timer = urand(20000, 30000); + Attraction_Timer = urand(25000, 35000); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_RIFT,SPECIAL); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Arcane Blast + if (ArcaneBlast_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_ARCANE_BLAST : H_SPELL_ARCANE_BLAST); + ArcaneBlast_Timer = urand(15000, 25000); + }else ArcaneBlast_Timer -= diff; + + //Arcane Discharge + if (ArcaneDischarge_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_ARCANE_DISCHARGE : H_SPELL_ARCANE_DISCHARGE); + + ArcaneDischarge_Timer = urand(20000, 30000); + }else ArcaneDischarge_Timer -= diff; + + //Time Lapse + if (TimeLapse_Timer < diff) + { + DoScriptText(SAY_BANISH, m_creature); + DoCastSpellIfCan(m_creature, SPELL_TIME_LAPSE); + TimeLapse_Timer = urand(15000, 25000); + }else TimeLapse_Timer -= diff; + + if (!m_bIsRegularMode) + { + if (Attraction_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ATTRACTION); + Attraction_Timer = urand(25000, 35000); + }else Attraction_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_chrono_lord_deja(Creature* pCreature) +{ + return new boss_chrono_lord_dejaAI(pCreature); +} + +void AddSC_boss_chrono_lord_deja() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_chrono_lord_deja"; + newscript->GetAI = &GetAI_boss_chrono_lord_deja; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp new file mode 100644 index 0000000..ed44d79 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Temporus +SD%Complete: 75 +SDComment: More abilities need to be implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "dark_portal.h" + +#define SAY_ENTER -1269000 +#define SAY_AGGRO -1269001 +#define SAY_BANISH -1269002 +#define SAY_SLAY1 -1269003 +#define SAY_SLAY2 -1269004 +#define SAY_DEATH -1269005 + +#define SPELL_HASTE 31458 +#define SPELL_MORTAL_WOUND 31464 +#define SPELL_WING_BUFFET 31475 +#define H_SPELL_WING_BUFFET 38593 +#define SPELL_REFLECT 38592 //Not Implemented (Heroic mod) + +struct MANGOS_DLL_DECL boss_temporusAI : public ScriptedAI +{ + boss_temporusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Haste_Timer; + uint32 SpellReflection_Timer; + uint32 MortalWound_Timer; + uint32 WingBuffet_Timer; + + void Reset() + { + Haste_Timer = urand(15000, 23000); + SpellReflection_Timer = 30000; + MortalWound_Timer = 8000; + WingBuffet_Timer = urand(25000, 35000); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_RIFT,SPECIAL); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == NPC_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Attack Haste + if (Haste_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_HASTE); + Haste_Timer = urand(20000, 25000); + }else Haste_Timer -= diff; + + //MortalWound_Timer + if (MortalWound_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_WOUND); + MortalWound_Timer = urand(10000, 20000); + }else MortalWound_Timer -= diff; + + //Wing ruffet + if (WingBuffet_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WING_BUFFET : H_SPELL_WING_BUFFET); + WingBuffet_Timer = urand(20000, 30000); + }else WingBuffet_Timer -= diff; + + if (!m_bIsRegularMode) + { + if (SpellReflection_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_REFLECT); + SpellReflection_Timer = urand(25000, 35000); + }else SpellReflection_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_temporus(Creature* pCreature) +{ + return new boss_temporusAI(pCreature); +} + +void AddSC_boss_temporus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_temporus"; + newscript->GetAI = &GetAI_boss_temporus; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp new file mode 100644 index 0000000..74db120 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp @@ -0,0 +1,416 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dark_Portal +SD%Complete: 30 +SDComment: Misc NPC's and mobs for instance. Most here far from complete. +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +/* ContentData +npc_medivh_bm +npc_time_rift +npc_saat +EndContentData */ + +#include "precompiled.h" +#include "dark_portal.h" + +#define SAY_ENTER -1269020 //where does this belong? +#define SAY_INTRO -1269021 +#define SAY_WEAK75 -1269022 +#define SAY_WEAK50 -1269023 +#define SAY_WEAK25 -1269024 +#define SAY_DEATH -1269025 +#define SAY_WIN -1269026 +#define SAY_ORCS_ENTER -1269027 +#define SAY_ORCS_ANSWER -1269028 + +#define SPELL_CHANNEL 31556 +#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect) + +#define SPELL_BLACK_CRYSTAL 32563 //aura +#define SPELL_PORTAL_CRYSTAL 32564 //summon + +#define SPELL_BANISH_PURPLE 32566 //aura +#define SPELL_BANISH_GREEN 32567 //aura + +#define SPELL_CORRUPT 31326 +#define SPELL_CORRUPT_AEONUS 37853 + +#define C_COUNCIL_ENFORCER 17023 + +struct MANGOS_DLL_DECL npc_medivh_bmAI : public ScriptedAI +{ + npc_medivh_bmAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 SpellCorrupt_Timer; + uint32 Check_Timer; + + bool Life75; + bool Life50; + bool Life25; + + void Reset() + { + SpellCorrupt_Timer = 0; + Check_Timer = 0; + + Life75 = true; + Life50 = true; + Life25 = true; + + if (!m_pInstance) + return; + + if (m_pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + m_creature->CastSpell(m_creature, SPELL_CHANNEL, true); + else if (m_creature->HasAura(SPELL_CHANNEL, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_CHANNEL); + + m_creature->CastSpell(m_creature, SPELL_PORTAL_RUNE, true); + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_pInstance) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) + { + if (m_pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || m_pInstance->GetData(TYPE_MEDIVH) == DONE) + return; + + DoScriptText(SAY_INTRO, m_creature); + m_pInstance->SetData(TYPE_MEDIVH, IN_PROGRESS); + m_creature->CastSpell(m_creature, SPELL_CHANNEL, false); + Check_Timer = 5000; + } + else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) + { + if (m_pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + return; + + uint32 entry = who->GetEntry(); + if (entry == NPC_ASSAS || entry == NPC_WHELP || entry == NPC_CHRON || entry == NPC_EXECU || entry == NPC_VANQU) + { + who->StopMoving(); + who->CastSpell(m_creature, SPELL_CORRUPT, false); + } + else if (entry == NPC_AEONUS) + { + who->StopMoving(); + who->CastSpell(m_creature, SPELL_CORRUPT_AEONUS, false); + } + } + } + + void AttackStart(Unit *who) + { + //if (m_pInstance && m_pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + //return; + + //ScriptedAI::AttackStart(who); + } + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (SpellCorrupt_Timer) + return; + + if (spell->Id == SPELL_CORRUPT_AEONUS) + SpellCorrupt_Timer = 1000; + + if (spell->Id == SPELL_CORRUPT) + SpellCorrupt_Timer = 3000; + } + + void JustDied(Unit* Killer) + { + if (Killer->GetEntry() == m_creature->GetEntry()) + return; + + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_pInstance) + return; + + if (SpellCorrupt_Timer) + { + if (SpellCorrupt_Timer <= diff) + { + m_pInstance->SetData(TYPE_MEDIVH, SPECIAL); + + if (m_creature->HasAura(SPELL_CORRUPT_AEONUS, EFFECT_INDEX_0)) + SpellCorrupt_Timer = 1000; + else if (m_creature->HasAura(SPELL_CORRUPT, EFFECT_INDEX_0)) + SpellCorrupt_Timer = 3000; + else + SpellCorrupt_Timer = 0; + } + else + SpellCorrupt_Timer -= diff; + } + + if (Check_Timer) + { + if (Check_Timer <= diff) + { + uint32 pct = m_pInstance->GetData(DATA_SHIELD); + + Check_Timer = 5000; + + if (Life25 && pct <= 25) + { + DoScriptText(SAY_WEAK25, m_creature); + Life25 = false; + } + else if (Life50 && pct <= 50) + { + DoScriptText(SAY_WEAK50, m_creature); + Life50 = false; + } + else if (Life75 && pct <= 75) + { + DoScriptText(SAY_WEAK75, m_creature); + Life75 = false; + } + + //if we reach this it means event was running but at some point reset. + if (m_pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + m_creature->Respawn(); + return; + } + + if (m_pInstance->GetData(TYPE_RIFT) == DONE) + { + DoScriptText(SAY_WIN, m_creature); + Check_Timer = 0; + + if (m_creature->HasAura(SPELL_CHANNEL, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_CHANNEL); + + //TODO: start the post-event here + m_pInstance->SetData(TYPE_MEDIVH,DONE); + } + } + else + Check_Timer -= diff; + } + + //if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + //return; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_medivh_bm(Creature* pCreature) +{ + return new npc_medivh_bmAI(pCreature); +} + +struct Wave +{ + uint32 PortalMob[4]; //spawns for portal waves (in order) +}; + +static Wave PortalWaves[]= +{ + {NPC_ASSAS, NPC_WHELP, NPC_CHRON, 0}, + {NPC_EXECU, NPC_CHRON, NPC_WHELP, NPC_ASSAS}, + {NPC_EXECU, NPC_VANQU, NPC_CHRON, NPC_ASSAS} +}; + +struct MANGOS_DLL_DECL npc_time_riftAI : public ScriptedAI +{ + npc_time_riftAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 TimeRiftWave_Timer; + uint8 mRiftWaveCount; + uint8 mPortalCount; + uint8 mWaveId; + + void Reset() + { + TimeRiftWave_Timer = 15000; + mRiftWaveCount = 0; + + if (!m_pInstance) + return; + + mPortalCount = m_pInstance->GetData(DATA_PORTAL_COUNT); + + if (mPortalCount < 6) + mWaveId = 0; + else if (mPortalCount > 12) + mWaveId = 2; + else + mWaveId = 1; + + } + + void DoSummonAtRift(uint32 creature_entry) + { + if (!creature_entry) + return; + + if (m_pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + return; + } + + float x, y, z; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f, x, y, z); + // uncomment the following if something doesn't work correctly, otherwise just delete + // m_creature->UpdateAllowedPositionZ(x, y, z); + + if (Unit *Summon = m_creature->SummonCreature(creature_entry, x, y, z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + if (Creature *temp = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_MEDIVH))) + Summon->AddThreat(temp); + } + } + + void DoSelectSummon() + { + uint32 entry = 0; + + if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) + mRiftWaveCount = 0; + + entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; + debug_log("SD2: npc_time_rift: summoning wave creature (Wave %u, Entry %u).", mRiftWaveCount, entry); + + ++mRiftWaveCount; + + if (entry == NPC_WHELP) + { + for(uint8 i = 0; i < 3; ++i) + DoSummonAtRift(entry); + } + else + DoSummonAtRift(entry); + } + + void UpdateAI(const uint32 diff) + { + if (!m_pInstance) + return; + + if (TimeRiftWave_Timer < diff) + { + DoSelectSummon(); + TimeRiftWave_Timer = 15000; + } + else + TimeRiftWave_Timer -= diff; + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + debug_log("SD2: npc_time_rift: not casting anylonger, i need to die."); + m_creature->SetDeathState(JUST_DIED); + + if (m_pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) + m_pInstance->SetData(TYPE_RIFT, SPECIAL); + } +}; + +CreatureAI* GetAI_npc_time_rift(Creature* pCreature) +{ + return new npc_time_riftAI(pCreature); +} + +#define SAY_SAAT_WELCOME -1269019 + +#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" +#define SPELL_CHRONO_BEACON 34975 +#define ITEM_CHRONO_BEACON 24289 + +bool GossipHello_npc_saat(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_OBTAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID()); + return true; + } + else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_OBTAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_saat(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,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(); +} diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.h b/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.h new file mode 100644 index 0000000..46ca3af --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.h @@ -0,0 +1,45 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_DARKPORTAL_H +#define DEF_DARKPORTAL_H + +enum +{ + MAX_ENCOUNTER = 2, + + TYPE_MEDIVH = 1, + TYPE_RIFT = 2, + + DATA_MEDIVH = 10, + DATA_PORTAL_COUNT = 11, + DATA_SHIELD = 12, + + WORLD_STATE_BM = 2541, + WORLD_STATE_BM_SHIELD = 2540, + WORLD_STATE_BM_RIFT = 2784, + + QUEST_OPENING_PORTAL = 10297, + QUEST_MASTER_TOUCH = 9836, + + NPC_TIME_KEEPER = 17918, + NPC_RKEEP = 21104, + NPC_RLORD = 17839, + NPC_DEJA = 17879, + NPC_TEMPO = 17880, + NPC_AEONUS = 17881, + NPC_ASSAS = 17835, + NPC_WHELP = 21818, + NPC_CHRON = 17892, + NPC_EXECU = 18994, + NPC_VANQU = 18995, + NPC_MEDIVH = 15608, + NPC_TIME_RIFT = 17838, + + SPELL_RIFT_CHANNEL = 31387, + + RIFT_BOSS = 1 +}; + +#endif diff --git a/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp b/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp new file mode 100644 index 0000000..4cb9ba4 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -0,0 +1,334 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Dark_Portal +SD%Complete: 50 +SDComment: Quest support: 9836, 10297. Currently in progress. +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "dark_portal.h" + +inline uint32 RandRiftBoss() { return (urand(0, 1) ? NPC_RKEEP : NPC_RLORD); } + +float PortalLocation[4][4]= +{ + {-2041.06f, 7042.08f, 29.99f, 1.30f}, + {-1968.18f, 7042.11f, 21.93f, 2.12f}, + {-1885.82f, 7107.36f, 22.32f, 3.07f}, + {-1928.11f, 7175.95f, 22.11f, 3.44f} +}; + +struct Wave +{ + 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}, + {NPC_DEJA, 0}, + {RIFT_BOSS, 120000}, + {NPC_TEMPO, 140000}, + {RIFT_BOSS, 120000}, + {NPC_AEONUS, 0} +}; + +struct MANGOS_DLL_DECL instance_dark_portal : public ScriptedInstance +{ + instance_dark_portal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint32 m_uiRiftPortalCount; + uint32 m_uiShieldPercent; + uint8 m_uiRiftWaveCount; + uint8 m_uiRiftWaveId; + + uint32 m_uiNextPortal_Timer; + + uint64 m_uiMedivhGUID; + uint8 m_uiCurrentRiftId; + + void Initialize() + { + m_uiMedivhGUID = 0; + Clear(); + } + + void Clear() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRiftPortalCount = 0; + m_uiShieldPercent = 100; + m_uiRiftWaveCount = 0; + m_uiRiftWaveId = 0; + + m_uiCurrentRiftId = 0; + + m_uiNextPortal_Timer = 0; + } + + void InitWorldState(bool Enable = true) + { + DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0); + DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100); + DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); + } + + bool IsEncounterInProgress() const + { + if (m_auiEncounter[0] == IN_PROGRESS) + return true; + + return false; + } + + void OnPlayerEnter(Player* pPlayer) + { + if (m_auiEncounter[0] == IN_PROGRESS) + return; + + pPlayer->SendUpdateWorldState(WORLD_STATE_BM, 0); + } + + void OnCreatureCreate(Creature* pCreature) + { + if (pCreature->GetEntry() == NPC_MEDIVH) + m_uiMedivhGUID = pCreature->GetGUID(); + } + + // what other conditions to check? + bool CanProgressEvent() + { + if (instance->GetPlayers().isEmpty()) + return false; + + return true; + } + + uint8 GetRiftWaveId() + { + switch(m_uiRiftPortalCount) + { + case 6: + m_uiRiftWaveId = 2; + return 1; + case 12: + m_uiRiftWaveId = 4; + return 3; + case 18: + return 5; + default: + return m_uiRiftWaveId; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_MEDIVH: + if (uiData == SPECIAL && m_auiEncounter[0] == IN_PROGRESS) + { + --m_uiShieldPercent; + + DoUpdateWorldState(WORLD_STATE_BM_SHIELD, m_uiShieldPercent); + + if (!m_uiShieldPercent) + { + if (Creature* pMedivh = instance->GetCreature(m_uiMedivhGUID)) + { + if (pMedivh->isAlive()) + { + pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_auiEncounter[0] = FAIL; + m_auiEncounter[1] = NOT_STARTED; + } + } + } + } + else + { + if (uiData == IN_PROGRESS) + { + debug_log("SD2: Instance Dark Portal: Starting event."); + InitWorldState(); + m_auiEncounter[1] = IN_PROGRESS; + m_uiNextPortal_Timer = 15000; + } + + if (uiData == DONE) + { + // this may be completed further out in the post-event + debug_log("SD2: Instance Dark Portal: Event completed."); + + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + { + if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL); + + if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH); + } + } + } + } + + m_auiEncounter[0] = uiData; + } + break; + case TYPE_RIFT: + if (uiData == SPECIAL) + { + if (m_uiRiftPortalCount < 7) + m_uiNextPortal_Timer = 5000; + } + else + m_auiEncounter[1] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_MEDIVH: + return m_auiEncounter[0]; + case TYPE_RIFT: + return m_auiEncounter[1]; + case DATA_PORTAL_COUNT: + return m_uiRiftPortalCount; + case DATA_SHIELD: + return m_uiShieldPercent; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + if (uiData == DATA_MEDIVH) + return m_uiMedivhGUID; + + return 0; + } + + Creature* SummonedPortalBoss(Creature* pSource) + { + uint32 uiEntry = RiftWaves[GetRiftWaveId()].PortalBoss; + + if (uiEntry == RIFT_BOSS) + uiEntry = RandRiftBoss(); + + float x, y, z; + pSource->GetRandomPoint(pSource->GetPositionX(), pSource->GetPositionY(), pSource->GetPositionZ(), 10.0f, x, y, z); + // uncomment the following if something doesn't work correctly, otherwise just delete + // pSource->UpdateAllowedPositionZ(x, y, z); + + debug_log("SD2: Instance Dark Portal: Summoning rift boss uiEntry %u.", uiEntry); + + if (Creature* pSummoned = pSource->SummonCreature(uiEntry, x, y, z, pSource->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) + return pSummoned; + + debug_log("SD2: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); + return NULL; + } + + void DoSpawnPortal() + { + if (Creature* pMedivh = instance->GetCreature(m_uiMedivhGUID)) + { + uint8 uiTmp = urand(0, 2); + + if (uiTmp >= m_uiCurrentRiftId) + ++uiTmp; + + debug_log("SD2: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).", uiTmp, m_uiCurrentRiftId); + + m_uiCurrentRiftId = uiTmp; + + if (Creature* pTemp = pMedivh->SummonCreature(NPC_TIME_RIFT, PortalLocation[uiTmp][0], PortalLocation[uiTmp][1], PortalLocation[uiTmp][2], PortalLocation[uiTmp][3], TEMPSUMMON_CORPSE_DESPAWN, 0)) + { + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (Creature* pBoss = SummonedPortalBoss(pTemp)) + { + if (pBoss->GetEntry() == NPC_AEONUS) + pBoss->AddThreat(pMedivh); + else + { + pBoss->AddThreat(pTemp); + pTemp->CastSpell(pBoss, SPELL_RIFT_CHANNEL, false); + } + } + } + } + } + + void Update(uint32 uiDiff) + { + if (m_auiEncounter[1] != IN_PROGRESS) + return; + + //add delay timer? + if (!CanProgressEvent()) + { + Clear(); + return; + } + + if (m_uiNextPortal_Timer) + { + if (m_uiNextPortal_Timer <= uiDiff) + { + ++m_uiRiftPortalCount; + + DoUpdateWorldState(WORLD_STATE_BM_RIFT, m_uiRiftPortalCount); + + DoSpawnPortal(); + m_uiNextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; + } + else + m_uiNextPortal_Timer -= uiDiff; + } + } +}; + +InstanceData* GetInstanceData_instance_dark_portal(Map* pMap) +{ + return new instance_dark_portal(pMap); +} + +void AddSC_instance_dark_portal() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_dark_portal"; + newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp b/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp new file mode 100644 index 0000000..f56b1b6 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp @@ -0,0 +1,586 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Archimonde +SD%Complete: 85 +SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented. +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "hyjal.h" +#include "SpellAuras.h" + +//text id -1534018 are the text used when previous events complete. Not part of this script. +#define SAY_AGGRO -1534019 +#define SAY_DOOMFIRE1 -1534020 +#define SAY_DOOMFIRE2 -1534021 +#define SAY_AIR_BURST1 -1534022 +#define SAY_AIR_BURST2 -1534023 +#define SAY_SLAY1 -1534024 +#define SAY_SLAY2 -1534025 +#define SAY_SLAY3 -1534026 +#define SAY_ENRAGE -1534027 +#define SAY_DEATH -1534028 +#define SAY_SOUL_CHARGE1 -1534029 +#define SAY_SOUL_CHARGE2 -1534030 + +#define SPELL_DENOUEMENT_WISP 32124 +#define SPELL_ANCIENT_SPARK 39349 +#define SPELL_PROTECTION_OF_ELUNE 38528 + +#define SPELL_DRAIN_WORLD_TREE 39140 +#define SPELL_DRAIN_WORLD_TREE_2 39141 + +#define SPELL_FINGER_OF_DEATH 31984 +#define SPELL_HAND_OF_DEATH 35354 +#define SPELL_AIR_BURST 32014 +#define SPELL_GRIP_OF_THE_LEGION 31972 +#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures +#define SPELL_DOOMFIRE_SPAWN 32074 +#define SPELL_DOOMFIRE 31945 +#define SPELL_SOUL_CHARGE_YELLOW 32045 +#define SPELL_SOUL_CHARGE_GREEN 32051 +#define SPELL_SOUL_CHARGE_RED 32052 +#define SPELL_UNLEASH_SOUL_YELLOW 32054 +#define SPELL_UNLEASH_SOUL_GREEN 32057 +#define SPELL_UNLEASH_SOUL_RED 32053 +#define SPELL_FEAR 31970 + +#define CREATURE_ARCHIMONDE 17968 +#define CREATURE_DOOMFIRE 18095 +#define CREATURE_DOOMFIRE_SPIRIT 18104 +#define CREATURE_ANCIENT_WISP 17946 +#define CREATURE_CHANNEL_TARGET 22418 + +#define NORDRASSIL_X 5503.713f +#define NORDRASSIL_Y -3523.436f +#define NORDRASSIL_Z 1608.781f + +struct mob_ancient_wispAI : public ScriptedAI +{ + mob_ancient_wispAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + ArchimondeGUID = 0; + Reset(); + } + + ScriptedInstance* m_pInstance; + uint64 ArchimondeGUID; + uint32 CheckTimer; + + void Reset() + { + CheckTimer = 1000; + + if (m_pInstance) + ArchimondeGUID = m_pInstance->GetData64(DATA_ARCHIMONDE); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (Creature* Archimonde = m_creature->GetMap()->GetCreature(ArchimondeGUID)) + { + if (Archimonde->GetHealthPercent() < 2.0f || !Archimonde->isAlive()) + DoCastSpellIfCan(m_creature, SPELL_DENOUEMENT_WISP); + else + DoCastSpellIfCan(Archimonde, SPELL_ANCIENT_SPARK); + } + CheckTimer = 1000; + }else CheckTimer -= diff; + } +}; + +/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will + MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */ +struct MANGOS_DLL_DECL mob_doomfireAI : public ScriptedAI +{ + mob_doomfireAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() { } + + void MoveInLineOfSight(Unit* who) { } + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } +}; + +/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or + travels in random directions if target cannot be found. */ +struct MANGOS_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI +{ + mob_doomfire_targettingAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint64 TargetGUID; + uint32 ChangeTargetTimer; + + void Reset() + { + TargetGUID = 0; + ChangeTargetTimer = 5000; + } + + void MoveInLineOfSight(Unit* who) + { + //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0 + //when UpdateAI needs it, it will be forced to select randomPoint + if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER) + TargetGUID = who->GetGUID(); + } + + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } + + void UpdateAI(const uint32 diff) + { + if (ChangeTargetTimer < diff) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(TargetGUID)) + { + m_creature->GetMotionMaster()->MoveFollow(pPlayer, 0.0f, 0.0f); + TargetGUID = 0; + } + else + { + float x,y,z = 0.0; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + + ChangeTargetTimer = 5000; + }else ChangeTargetTimer -= diff; + } +}; + +/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers. + The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the + hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then + select a random target and cast the spell on them. However, if someone IS in melee range, and this + is NOT the main tank (creature's victim), then we aggro that player and they become the new victim. + For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will + randomly select it's target to follow and then we create the random movement making it unpredictable. */ + +struct MANGOS_DLL_DECL boss_archimondeAI : public ScriptedAI +{ + boss_archimondeAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 DoomfireSpiritGUID; + uint64 WorldTreeGUID; + + uint32 DrainNordrassilTimer; + uint32 FearTimer; + uint32 AirBurstTimer; + uint32 GripOfTheLegionTimer; + uint32 DoomfireTimer; + uint32 MeleeRangeCheckTimer; + uint32 HandOfDeathTimer; + uint32 SummonWispTimer; + uint32 WispCount; + uint32 EnrageTimer; + uint32 CheckDistanceTimer; + + bool Enraged; + bool BelowTenPercent; + bool HasProtected; + bool IsChanneling; + + void Reset() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ARCHIMONDE, NOT_STARTED); + + DoomfireSpiritGUID = 0; + WorldTreeGUID = 0; + + DrainNordrassilTimer = 0; + FearTimer = 42000; + AirBurstTimer = 30000; + GripOfTheLegionTimer = urand(5000, 25000); + DoomfireTimer = 20000; + MeleeRangeCheckTimer = 15000; + HandOfDeathTimer = 2000; + WispCount = 0; // When ~30 wisps are summoned, Archimonde dies + EnrageTimer = 600000; // 10 minutes + CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage + + Enraged = false; + BelowTenPercent = false; + HasProtected = false; + IsChanneling = false; + } + + void Aggro(Unit* pWho) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->SetInCombatWithZone(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARCHIMONDE, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + switch(pVictim->getClass()) + { + case CLASS_PRIEST: + case CLASS_PALADIN: + case CLASS_WARLOCK: + pVictim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true); + break; + case CLASS_MAGE: + case CLASS_ROGUE: + case CLASS_WARRIOR: + pVictim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true); + break; + case CLASS_DRUID: + case CLASS_SHAMAN: + case CLASS_HUNTER: + pVictim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true); + break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARCHIMONDE, DONE); + } + + bool CanUseFingerOfDeath() + { + // First we check if our current victim is in melee range or not. + Unit* victim = m_creature->getVictim(); + if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) + return false; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + if (tList.empty()) + return false; + + std::list targets; + + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + + if (targets.empty()) + return false; + + targets.sort(ObjectDistanceOrder(m_creature)); + Unit* target = targets.front(); + if (target) + { + if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + return true; // Cast Finger of Death + else // This target is closest, he is our new tank + m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); + } + + return false; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == CREATURE_ANCIENT_WISP) + pSummoned->AI()->AttackStart(m_creature); + else + { + pSummoned->setFaction(m_creature->getFaction()); + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + if (pSummoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) + { + DoomfireSpiritGUID = pSummoned->GetGUID(); + } + + if (pSummoned->GetEntry() == CREATURE_DOOMFIRE) + { + pSummoned->CastSpell(pSummoned,SPELL_DOOMFIRE_SPAWN,false); + pSummoned->CastSpell(pSummoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID()); + + if (Creature* pDoomfireSpirit = m_creature->GetMap()->GetCreature(DoomfireSpiritGUID)) + { + pSummoned->GetMotionMaster()->MoveFollow(pDoomfireSpirit,0.0f,0.0f); + DoomfireSpiritGUID = 0; + } + } + } + + //this is code doing close to what the summoning spell would do (spell 31903) + void SummonDoomfire(Unit* target) + { + m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, + target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + + m_creature->SummonCreature(CREATURE_DOOMFIRE, + target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + { + if (m_pInstance) + { + // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. + if ((m_pInstance->GetData(TYPE_AZGALOR) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setFaction(35); + } + else if ((m_pInstance->GetData(TYPE_AZGALOR) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) + { + m_creature->setFaction(1720); + m_creature->SetVisibility(VISIBILITY_ON); + } + } + + if (DrainNordrassilTimer < diff) + { + if (!IsChanneling) + { + Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 1200000); + + if (temp) + WorldTreeGUID = temp->GetGUID(); + + if (Creature *Nordrassil = m_creature->GetMap()->GetCreature(WorldTreeGUID)) + { + Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Nordrassil->SetDisplayId(11686); + DoCastSpellIfCan(Nordrassil, SPELL_DRAIN_WORLD_TREE); + IsChanneling = true; + } + } + + if (Creature *Nordrassil = m_creature->GetMap()->GetCreature(WorldTreeGUID)) + { + Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true); + DrainNordrassilTimer = 1000; + } + }else DrainNordrassilTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() < 10.0f && !BelowTenPercent && !Enraged) + BelowTenPercent = true; + + if (!Enraged) + { + if (EnrageTimer < diff) + { + if (m_creature->GetHealthPercent() > 10.0f) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + Enraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + } + }else EnrageTimer -= diff; + + if (CheckDistanceTimer < diff) + { + // To simplify the check, we simply summon a creature in the location and then check how far we are from the creature + Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); + if (Check) + { + Check->SetVisibility(VISIBILITY_OFF); + + if (m_creature->IsWithinDistInMap(Check, 75)) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + Enraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + } + } + CheckDistanceTimer = 5000; + }else CheckDistanceTimer -= diff; + } + + if (BelowTenPercent) + { + if (!HasProtected) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + //all members of raid must get this buff + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); + HasProtected = true; + Enraged = true; + } + + if (SummonWispTimer < diff) + { + DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + SummonWispTimer = 1500; + ++WispCount; + }else SummonWispTimer -= diff; + + if (WispCount >= 30) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + if (Enraged) + { + if (HandOfDeathTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAND_OF_DEATH); + HandOfDeathTimer = 2000; + }else HandOfDeathTimer -= diff; + return; // Don't do anything after this point. + } + + if (GripOfTheLegionTimer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_GRIP_OF_THE_LEGION); + + GripOfTheLegionTimer = urand(5000, 25000); + }else GripOfTheLegionTimer -= diff; + + if (AirBurstTimer < diff) + { + if (!urand(0, 1)) + DoScriptText(SAY_AIR_BURST1, m_creature); + else + DoScriptText(SAY_AIR_BURST2, m_creature); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(pTarget, SPELL_AIR_BURST); + AirBurstTimer = urand(25000, 40000); + }else AirBurstTimer -= diff; + + if (FearTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FEAR); + FearTimer = 42000; + }else FearTimer -= diff; + + if (DoomfireTimer < diff) + { + if (!urand(0, 1)) + DoScriptText(SAY_DOOMFIRE1, m_creature); + else + DoScriptText(SAY_DOOMFIRE2, m_creature); + + Unit *temp = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + if (!temp) + temp = m_creature->getVictim(); + + //replace with spell cast 31903 once implicitTarget 73 implemented + SummonDoomfire(temp); + + //supposedly three doomfire can be up at the same time + DoomfireTimer = 20000; + }else DoomfireTimer -= diff; + + if (MeleeRangeCheckTimer < diff) + { + if (CanUseFingerOfDeath()) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_FINGER_OF_DEATH); + + MeleeRangeCheckTimer = 1000; + } + + MeleeRangeCheckTimer = 5000; + }else MeleeRangeCheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_archimonde(Creature* pCreature) +{ + return new boss_archimondeAI(pCreature); +} + +CreatureAI* GetAI_mob_doomfire(Creature* pCreature) +{ + return new mob_doomfireAI(pCreature); +} + +CreatureAI* GetAI_mob_doomfire_targetting(Creature* pCreature) +{ + return new mob_doomfire_targettingAI(pCreature); +} + +CreatureAI* GetAI_mob_ancient_wisp(Creature* pCreature) +{ + return new mob_ancient_wispAI(pCreature); +} + +void AddSC_boss_archimonde() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_archimonde"; + newscript->GetAI = &GetAI_boss_archimonde; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_doomfire"; + newscript->GetAI = &GetAI_mob_doomfire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_doomfire_targetting"; + newscript->GetAI = &GetAI_mob_doomfire_targetting; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ancient_wisp"; + newscript->GetAI = &GetAI_mob_ancient_wisp; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp b/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp new file mode 100644 index 0000000..e14b280 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp @@ -0,0 +1,238 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Hyjal +SD%Complete: 80 +SDComment: gossip text id's unknown +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +/* ContentData +npc_jaina_proudmoore +npc_thrall +npc_tyrande_whisperwind +EndContentData */ + +#include "precompiled.h" +#include "hyjalAI.h" + +#define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." +#define GOSSIP_ITEM_ANETHERON "We are ready for whatever Archimonde might send our way, Lady Proudmoore." +#define GOSSIP_ITEM_BEGIN_HORDE "I am with you, Thrall." +#define GOSSIP_ITEM_AZGALOR "We have nothing to fear." + +#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!" + +#define GOSSIP_ITEM_TYRANDE "Aid us in defending Nordrassil" + +CreatureAI* GetAI_npc_jaina_proudmoore(Creature* pCreature) +{ + hyjalAI* pTempAI = new hyjalAI(pCreature); + + pTempAI->m_aSpells[0].m_uiSpellId = SPELL_BLIZZARD; + pTempAI->m_aSpells[0].m_uiCooldown = urand(15000, 35000); + pTempAI->m_aSpells[0].m_pType = TARGETTYPE_RANDOM; + + pTempAI->m_aSpells[1].m_uiSpellId = SPELL_PYROBLAST; + pTempAI->m_aSpells[1].m_uiCooldown = urand(2000, 9000); + pTempAI->m_aSpells[1].m_pType = TARGETTYPE_RANDOM; + + pTempAI->m_aSpells[2].m_uiSpellId = SPELL_SUMMON_ELEMENTALS; + pTempAI->m_aSpells[2].m_uiCooldown = urand(15000, 45000); + pTempAI->m_aSpells[2].m_pType = TARGETTYPE_SELF; + + return pTempAI; +} + +bool GossipHello_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + if (hyjalAI* pJainaAI = dynamic_cast(pCreature->AI())) + { + if (!pJainaAI->m_bIsEventInProgress) + { + // Should not happen that jaina is here now, but for safe we check + if (pInstance->GetData(TYPE_KAZROGAL) != DONE) + { + if (pInstance->GetData(TYPE_WINTERCHILL) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else if (pInstance->GetData(TYPE_WINTERCHILL) == DONE && pInstance->GetData(TYPE_ANETHERON) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + else if (pInstance->GetData(TYPE_ANETHERON) == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + if (pPlayer->isGameMaster()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + } + } + } + } + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (hyjalAI* pJainaAI = dynamic_cast(pCreature->AI())) + { + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pJainaAI->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pJainaAI->m_bIsFirstBossDead = true; + pJainaAI->m_uiWaveCount = 9; + pJainaAI->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pJainaAI->Retreat(); + break; + case GOSSIP_ACTION_INFO_DEF: + pJainaAI->m_bDebugMode = !pJainaAI->m_bDebugMode; + debug_log("SD2: HyjalAI - Debug mode has been toggled"); + break; + } + } + + pPlayer->CLOSE_GOSSIP_MENU(); + return true; +} + +CreatureAI* GetAI_npc_thrall(Creature* pCreature) +{ + hyjalAI* pTempAI = new hyjalAI(pCreature); + + pTempAI->m_aSpells[0].m_uiSpellId = SPELL_CHAIN_LIGHTNING; + pTempAI->m_aSpells[0].m_uiCooldown = urand(2000, 7000); + pTempAI->m_aSpells[0].m_pType = TARGETTYPE_VICTIM; + + pTempAI->m_aSpells[1].m_uiSpellId = SPELL_FERAL_SPIRIT; + pTempAI->m_aSpells[1].m_uiCooldown = urand(6000, 41000); + pTempAI->m_aSpells[1].m_pType = TARGETTYPE_RANDOM; + + return pTempAI; +} + +bool GossipHello_npc_thrall(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + if (hyjalAI* pThrallAI = dynamic_cast(pCreature->AI())) + { + if (!pThrallAI->m_bIsEventInProgress) + { + // Only let them start the Horde phases if Anetheron is dead. + if (pInstance->GetData(TYPE_ANETHERON) == DONE) + { + if (pInstance->GetData(TYPE_KAZROGAL) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else if (pInstance->GetData(TYPE_KAZROGAL) == DONE && pInstance->GetData(TYPE_AZGALOR) == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + else if (pInstance->GetData(TYPE_AZGALOR) == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + if (pPlayer->isGameMaster()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_DOT, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + } + } + } + } + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (hyjalAI* pThrallAI = dynamic_cast(pCreature->AI())) + { + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pThrallAI->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pThrallAI->m_bIsFirstBossDead = true; + pThrallAI->m_uiWaveCount = 9; + pThrallAI->StartEvent(); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pThrallAI->Retreat(); + break; + case GOSSIP_ACTION_INFO_DEF: + pThrallAI->m_bDebugMode = !pThrallAI->m_bDebugMode; + debug_log("SD2: HyjalAI - Debug mode has been toggled"); + break; + } + } + + pPlayer->CLOSE_GOSSIP_MENU(); + return true; +} + +bool GossipHello_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + // Only let them get item if Azgalor is dead. + if (pInstance->GetData(TYPE_AZGALOR) == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + } + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(ITEM_TEAR_OF_GODDESS, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + } + + pPlayer->CLOSE_GOSSIP_MENU(); + return true; +} + +void AddSC_hyjal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_jaina_proudmoore"; + newscript->GetAI = &GetAI_npc_jaina_proudmoore; + newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore; + newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_thrall"; + newscript->GetAI = &GetAI_npc_thrall; + newscript->pGossipHello = &GossipHello_npc_thrall; + newscript->pGossipSelect = &GossipSelect_npc_thrall; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tyrande_whisperwind"; + newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind; + newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/hyjal/hyjal.h b/scripts/kalimdor/caverns_of_time/hyjal/hyjal.h new file mode 100644 index 0000000..f4e03fa --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/hyjal/hyjal.h @@ -0,0 +1,71 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_HYJAL_H +#define DEF_HYJAL_H + +#define ERROR_INST_DATA "SD2: Instance data not set properly for Mount Hyjal. Encounters will be buggy" + +enum eNPC +{ + NPC_JAINA = 17772, + NPC_THRALL = 17852, + NPC_TYRANDE = 17948, + + // Bosses summoned after every 8 waves + NPC_WINTERCHILL = 17767, + NPC_ANETHERON = 17808, + NPC_KAZROGAL = 17888, + NPC_AZGALOR = 17842, + NPC_ARCHIMONDE = 17968, + + // Trash Mobs summoned in waves + NPC_NECRO = 17899, + NPC_ABOMI = 17898, + NPC_GHOUL = 17895, + NPC_BANSH = 17905, + NPC_CRYPT = 17897, + NPC_GARGO = 17906, + NPC_FROST = 17907, + NPC_GIANT = 17908, + NPC_STALK = 17916, + + NPC_WATER_ELEMENTAL = 18001, + NPC_DIRE_WOLF = 17854, + + GO_ANCIENT_GEM = 185557 +}; + +enum +{ + MAX_ENCOUNTER = 5, + + WORLD_STATE_WAVES = 2842, + WORLD_STATE_ENEMY = 2453, + WORLD_STATE_ENEMYCOUNT = 2454, + + // ACID scripted, don't touch id's (or provide update for ACID) + TYPE_WINTERCHILL = 11, + TYPE_ANETHERON = 2, + TYPE_KAZROGAL = 9, + TYPE_AZGALOR = 6, + + TYPE_ARCHIMONDE = 4, + + DATA_ANETHERON = 1, + DATA_RAGEWINTERCHILL = 10, + DATA_AZGALOR = 5, + DATA_KAZROGAL = 8, + + DATA_ARCHIMONDE = 3, + DATA_JAINAPROUDMOORE = 7, + DATA_THRALL = 12, + DATA_TYRANDEWHISPERWIND = 13, + + DATA_TRASH = 14, + DATA_RESET_TRASH_COUNT = 15, + TYPE_RETREAT = 16 +}; + +#endif diff --git a/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp new file mode 100644 index 0000000..ba755d4 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp @@ -0,0 +1,496 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: HyjalAI +SD%Complete: 90 +SDComment: +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "hyjalAI.h" + +struct sHyjalLocation +{ + eBaseArea m_pBaseArea; + float m_fX, m_fY, m_fZ; +}; + +// Locations for summoning waves +sHyjalLocation m_aHyjalSpawnLoc[]= +{ + {BASE_ALLY, 4979.010f, -1709.134f, 1339.674f}, + {BASE_ALLY, 4969.123f, -1705.904f, 1341.363f}, + {BASE_ALLY, 4970.260f, -1698.546f, 1341.200f}, + {BASE_ALLY, 4975.262f, -1698.239f, 1341.427f}, + {BASE_HORDE, 5557.582f, -2587.159f, 1481.644f}, + {BASE_HORDE, 5545.901f, -2582.246f, 1479.256f}, + {BASE_HORDE, 5565.642f, -2565.666f, 1481.635f}, + {BASE_HORDE, 5547.218f, -2574.589f, 1479.194f} +}; + +// used to inform the wave where to move +sHyjalLocation m_aHyjalWaveMoveTo[]= +{ + {BASE_ALLY, 5018.654f, -1752.074f, 1322.203f}, + {BASE_HORDE, 5504.569f, -2688.489f, 1479.991f} +}; + +struct sHyjalYells +{ + uint32 uiCreatureEntry; + YellType m_pYellType; // Used to determine the type of yell (attack, rally, etc) + int32 m_iTextId; // The text id to be yelled +}; + +sHyjalYells m_aHyjalYell[]= +{ + {NPC_JAINA, ATTACKED, -1534000}, + {NPC_JAINA, ATTACKED, -1534001}, + {NPC_JAINA, INCOMING, -1534002}, + {NPC_JAINA, BEGIN, -1534003}, + {NPC_JAINA, RALLY, -1534004}, + {NPC_JAINA, RALLY, -1534005}, + {NPC_JAINA, FAILURE, -1534006}, + {NPC_JAINA, SUCCESS, -1534007}, + {NPC_JAINA, DEATH, -1534008}, + + {NPC_THRALL, ATTACKED, -1534009}, + {NPC_THRALL, ATTACKED, -1534010}, + {NPC_THRALL, INCOMING, -1534011}, + {NPC_THRALL, BEGIN, -1534012}, + {NPC_THRALL, RALLY, -1534013}, + {NPC_THRALL, RALLY, -1534014}, + {NPC_THRALL, FAILURE, -1534015}, + {NPC_THRALL, SUCCESS, -1534016}, + {NPC_THRALL, DEATH, -1534017} +}; + +void hyjalAI::Reset() +{ + // GUIDs + m_uiBossGUID[0] = 0; + m_uiBossGUID[1] = 0; + + // Timers + m_uiNextWaveTimer = 10000; + m_uiWaveMoveTimer = 15000; + m_uiCheckTimer = 0; + m_uiRetreatTimer = 25000; + + // Misc + m_uiWaveCount = 0; + m_uiEnemyCount = 0; + + // Set base area based on creature entry + switch(m_creature->GetEntry()) + { + case NPC_JAINA: + m_uiBase = BASE_ALLY; + DoCastSpellIfCan(m_creature, SPELL_BRILLIANCE_AURA, CAST_TRIGGERED); + break; + case NPC_THRALL: + m_uiBase = BASE_HORDE; + break; + } + + // Bools + m_bIsEventInProgress = false; + m_bIsSummoningWaves = false; + + m_bIsRetreating = false; + m_bDebugMode = false; + + // Flags + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + // Reset World States + m_pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); + + if (!m_pInstance) + return; + + m_bIsFirstBossDead = m_uiBase ? m_pInstance->GetData(TYPE_KAZROGAL) : m_pInstance->GetData(TYPE_WINTERCHILL); + m_bIsSecondBossDead = m_uiBase ? m_pInstance->GetData(TYPE_AZGALOR) : m_pInstance->GetData(TYPE_ANETHERON); + + // Reset Instance Data for trash count + m_pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); +} + +void hyjalAI::EnterEvadeMode() +{ + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreatureAddon(); + + if (m_creature->isAlive()) + m_creature->GetMotionMaster()->MoveTargetedHome(); + + m_creature->SetLootRecipient(NULL); +} + +void hyjalAI::JustReachedHome() +{ + if (m_uiBase == BASE_ALLY) + DoCastSpellIfCan(m_creature, SPELL_BRILLIANCE_AURA, CAST_TRIGGERED); + + m_bIsFirstBossDead = m_uiBase ? m_pInstance->GetData(TYPE_KAZROGAL) : m_pInstance->GetData(TYPE_WINTERCHILL); + m_bIsSecondBossDead = m_uiBase ? m_pInstance->GetData(TYPE_AZGALOR) : m_pInstance->GetData(TYPE_ANETHERON); +} + +void hyjalAI::Aggro(Unit *who) +{ + for(uint8 i = 0; i < MAX_SPELL; ++i) + if (m_aSpells[i].m_uiCooldown) + m_uiSpellTimer[i] = m_aSpells[i].m_uiCooldown; + + DoTalk(ATTACKED); +} + +void hyjalAI::SpawnCreatureForWave(uint32 uiMobEntry) +{ + sHyjalLocation* pSpawn = NULL; + + uint32 uiMaxCount = sizeof(m_aHyjalSpawnLoc)/sizeof(sHyjalLocation); + uint32 uiRandId = urand(1, uiMaxCount/2); //unsafe, if array becomes uneven. + + uint32 uiJ = 0; + + for (uint32 i = 0; i < uiMaxCount; ++i) + { + if (m_aHyjalSpawnLoc[i].m_pBaseArea != m_uiBase) + continue; + + ++uiJ; + + if (uiJ == uiRandId) + { + pSpawn = &m_aHyjalSpawnLoc[i]; + break; + } + } + + if (pSpawn) + m_creature->SummonCreature(uiMobEntry, pSpawn->m_fX, pSpawn->m_fY, pSpawn->m_fZ, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); +} + +void hyjalAI::JustSummoned(Creature* pSummoned) +{ + // not interesting for us + if (pSummoned->GetEntry() == NPC_WATER_ELEMENTAL || pSummoned->GetEntry() == NPC_DIRE_WOLF) + return; + + // Increment Enemy Count to be used in World States and instance script + ++m_uiEnemyCount; + + sHyjalLocation* pMove = NULL; + + uint32 uiMaxCount = sizeof(m_aHyjalWaveMoveTo)/sizeof(sHyjalLocation); + + for (uint32 i = 0; i < uiMaxCount; ++i) + { + if (m_aHyjalWaveMoveTo[i].m_pBaseArea != m_uiBase) + continue; + + pMove = &m_aHyjalWaveMoveTo[i]; + break; + } + + if (pMove) + { + float fX, fY, fZ; + pSummoned->GetRandomPoint(pMove->m_fX, pMove->m_fY, pMove->m_fZ, 10.0f, fX, fY, fZ); + + pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ); + } + + // Check if creature is a boss. + if (pSummoned->IsWorldBoss()) + { + if (!m_bIsFirstBossDead) + m_uiBossGUID[0] = pSummoned->GetGUID(); + else + m_uiBossGUID[1] = pSummoned->GetGUID(); + + m_uiCheckTimer = 5000; + } + else + lWaveMobGUIDList.push_back(pSummoned->GetGUID()); +} + +void hyjalAI::SummonNextWave() +{ + // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. + if (!urand(0, 3)) + DoTalk(RALLY); + + if (!m_pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + + sHyjalWave* pWaveData = m_uiBase ? &m_aHyjalWavesHorde[m_uiWaveCount] : &m_aHyjalWavesAlliance[m_uiWaveCount]; + + if (!pWaveData) + { + error_log("SD2: hyjalAI not able to obtain wavedata for SummonNextWave."); + return; + } + + m_uiEnemyCount = m_pInstance->GetData(DATA_TRASH); + + for(uint8 i = 0; i < MAX_WAVE_MOB; ++i) + { + if (pWaveData->m_auiMobEntry[i]) + SpawnCreatureForWave(pWaveData->m_auiMobEntry[i]); + } + + if (!pWaveData->m_bIsBoss) + { + uint32 stateValue = m_uiWaveCount+1; + + if (m_bIsFirstBossDead) + stateValue -= MAX_WAVES; // Subtract 9 from it to give the proper wave number if we are greater than 8 + + // Set world state to our current wave number + m_pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); + // Enable world state + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); + + m_pInstance->SetData(DATA_TRASH, m_uiEnemyCount); // Send data for instance script to update count + + if (!m_bDebugMode) + m_uiNextWaveTimer = pWaveData->m_uiWaveTimer; + else + { + m_uiNextWaveTimer = 15000; + debug_log("SD2: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); + } + } + else + { + // Set world state for waves to 0 to disable it. + m_pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); + + // Set World State for enemies invading to 1. + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 1); + + m_bIsSummoningWaves = false; + } + + m_uiWaveMoveTimer = 15000; + m_uiCheckTimer = 5000; + ++m_uiWaveCount; +} + +void hyjalAI::StartEvent() +{ + if (!m_pInstance) + return; + + DoTalk(BEGIN); + + m_bIsEventInProgress = true; + m_bIsSummoningWaves = true; + + m_uiNextWaveTimer = 10000; + m_uiCheckTimer = 5000; + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + m_pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); +} + +void hyjalAI::DoTalk(YellType pYellType) +{ + sHyjalYells* pYell = NULL; + + uint32 uiMaxCount = sizeof(m_aHyjalYell)/sizeof(sHyjalYells); + bool bGetNext = false; + + for (uint32 i = 0; i < uiMaxCount; ++i) + { + if (m_aHyjalYell[i].uiCreatureEntry == m_creature->GetEntry() && m_aHyjalYell[i].m_pYellType == pYellType) + { + //this would not be safe unless we knew these had two entries in m_aYell + if (pYellType == ATTACKED || pYellType== RALLY) + { + if (!bGetNext && urand(0, 1)) + { + bGetNext = true; + continue; + } + } + + pYell = &m_aHyjalYell[i]; + break; + } + } + + if (pYell) + DoScriptText(pYell->m_iTextId, m_creature); +} + +void hyjalAI::SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) +{ + //TODO: this spell should cause misc mobs to despawn + //if (pSpell->Id == SPELL_MASS_TELEPORT && pTarget->GetTypeId() != TYPEID_PLAYER) + //{ + //despawn; + //} +} + +void hyjalAI::Retreat() +{ + //this will trigger ancient gem respawn + if (m_pInstance) + m_pInstance->SetData(TYPE_RETREAT, SPECIAL); + + DoCastSpellIfCan(m_creature, SPELL_MASS_TELEPORT); + + m_bIsRetreating = true; +} + +void hyjalAI::JustDied(Unit* pKiller) +{ + DoTalk(DEATH); + + //TODO: in case they die during boss encounter, then what? despawn boss? +} + +void hyjalAI::UpdateAI(const uint32 uiDiff) +{ + if (!m_bIsEventInProgress) + return; + + if (m_bIsSummoningWaves && m_pInstance) + { + if (m_uiWaveMoveTimer < uiDiff) + { + // Skip the master timer, and start next wave in 5. Clear the list, it should not be any here now. + if (!m_pInstance->GetData(DATA_TRASH)) + { + lWaveMobGUIDList.clear(); + m_uiNextWaveTimer = 5000; + } + + if (!lWaveMobGUIDList.empty()) + { + for(std::list::iterator itr = lWaveMobGUIDList.begin(); itr != lWaveMobGUIDList.end(); ++itr) + { + if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) + { + if (!pTemp->isAlive() || pTemp->getVictim()) + continue; + + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pTemp->GetMotionMaster()->MovePoint(1, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } + } + } + m_uiWaveMoveTimer = 10000; + } + else + m_uiWaveMoveTimer -= uiDiff; + + if (m_uiNextWaveTimer < uiDiff) + SummonNextWave(); + else + m_uiNextWaveTimer -= uiDiff; + } + + if (m_uiCheckTimer < uiDiff) + { + for(uint8 i = 0; i < 2; ++i) + { + if (m_uiBossGUID[i]) + { + Creature* pBoss = m_creature->GetMap()->GetCreature(m_uiBossGUID[i]); + + if (pBoss && !pBoss->isAlive()) + { + if (m_uiBossGUID[i] == m_uiBossGUID[0]) + { + DoTalk(INCOMING); + m_bIsFirstBossDead = true; + } + else if (m_uiBossGUID[i] == m_uiBossGUID[1]) + { + DoTalk(SUCCESS); + m_bIsSecondBossDead = true; + } + + m_bIsEventInProgress = false; + m_uiCheckTimer = 0; + + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + m_uiBossGUID[i] = 0; + + // Reset world state for enemies to disable it + m_pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + } + } + } + + m_uiCheckTimer = 5000; + } + else + m_uiCheckTimer -= uiDiff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + for(uint8 i = 0; i < MAX_SPELL; ++i) + { + if (m_aSpells[i].m_uiSpellId) + { + if (m_uiSpellTimer[i] < uiDiff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + Unit* pTarget = NULL; + + switch(m_aSpells[i].m_pType) + { + case TARGETTYPE_SELF: pTarget = m_creature; break; + case TARGETTYPE_RANDOM: pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); break; + case TARGETTYPE_VICTIM: pTarget = m_creature->getVictim(); break; + } + + if (pTarget) + { + DoCastSpellIfCan(pTarget, m_aSpells[i].m_uiSpellId); + m_uiSpellTimer[i] = m_aSpells[i].m_uiCooldown; + } + } + else + m_uiSpellTimer[i] -= uiDiff; + } + } + + DoMeleeAttackIfReady(); +} diff --git a/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h b/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h new file mode 100644 index 0000000..7bbc024 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h @@ -0,0 +1,199 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_HYJALAI_H +#define SC_HYJALAI_H + +#include "hyjal.h" + +enum eBaseArea +{ + BASE_ALLY = 0, + BASE_HORDE = 1 +}; + +enum eMisc +{ + MAX_SPELL = 3, + MAX_WAVES = 9, + MAX_WAVE_MOB = 18, + + ITEM_TEAR_OF_GODDESS = 24494 +}; + +enum eSpell +{ + SPELL_MASS_TELEPORT = 16807, + + // Spells for Jaina + SPELL_BRILLIANCE_AURA = 31260, + SPELL_BLIZZARD = 31266, + SPELL_PYROBLAST = 31263, + SPELL_SUMMON_ELEMENTALS = 31264, + + // Thrall spells + SPELL_CHAIN_LIGHTNING = 31330, + SPELL_FERAL_SPIRIT = 31331 +}; + +struct sHyjalWave +{ + uint32 m_auiMobEntry[MAX_WAVE_MOB]; // Stores Creature Entries to be summoned in Waves + uint32 m_uiWaveTimer; // The timer before the next wave is summoned + bool m_bIsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that +}; + +// Waves that will be summoned in the Alliance Base +static sHyjalWave m_aHyjalWavesAlliance[]= +{ + // Rage Winterchill Wave 1-8 + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron + {NPC_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Anetheron Wave 1-8 + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_NECRO, NPC_NECRO, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_BANSH, NPC_BANSH, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Anatheron + {NPC_ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} +}; + +// Waves that are summoned in the Horde base +static sHyjalWave m_aHyjalWavesHorde[]= +{ + // Kaz'Rogal Wave 1-8 + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_BANSH, NPC_BANSH, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 120000, false}, + {NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_FROST, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_FROST, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, NPC_BANSH, NPC_BANSH, 180000, false}, + // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor + {NPC_KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Azgalor Wave 1-8 + {NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_FROST, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, NPC_GARGO, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GHOUL, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, 0, 0, 0, 0, 120000, false}, + {NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_STALK, NPC_STALK, NPC_STALK, NPC_STALK, NPC_STALK, NPC_STALK, 0, 0, 0, 0, 120000, false}, + {NPC_STALK, NPC_STALK, NPC_STALK, NPC_STALK, NPC_STALK, NPC_STALK, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, 0, 0, 0, 0, 120000, false}, + {NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_NECRO, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, 0, 0, 0, 0, 120000, false}, + {NPC_GHOUL, NPC_GHOUL, NPC_CRYPT, NPC_CRYPT, NPC_STALK, NPC_STALK, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, NPC_GIANT, 0, 0, 0, 0, 0, 0, 120000, false}, + {NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_CRYPT, NPC_STALK, NPC_STALK, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_ABOMI, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_BANSH, NPC_NECRO, NPC_NECRO, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Azgalor + {NPC_AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} +}; + +enum TargetType // Used in the spell cast system for the AI +{ + TARGETTYPE_SELF = 0, + TARGETTYPE_RANDOM = 1, + TARGETTYPE_VICTIM = 2, +}; + +enum YellType +{ + ATTACKED = 0, // Used when attacked and set in combat + BEGIN = 1, // Used when the event is begun + INCOMING = 2, // Used to warn the raid that another wave phase is coming + RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned + FAILURE = 4, // Used when raid has failed (unsure where to place) + SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase + DEATH = 6, // Used on death +}; + +struct MANGOS_DLL_DECL hyjalAI : public ScriptedAI +{ + hyjalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + memset(m_aSpells, 0, sizeof(m_aSpells)); + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat + void Reset(); + + // Send creature back to spawn location and evade. + void EnterEvadeMode(); + + // Called when creature reached home location after evade. + void JustReachedHome(); + + // Used to reset cooldowns for our spells and to inform the raid that we're under attack + void Aggro(Unit* pWho); + + // Called to summon waves, check for boss deaths and to cast our spells. + void UpdateAI(const uint32 uiDiff); + + // Called on death, informs the raid that they have failed. + void JustDied(Unit* pKiller); + + // "Teleport" all friendly creatures away from the base. + void Retreat(); + + // Summons a creature for that wave in that base + void SpawnCreatureForWave(uint32 uiMobEntry); + + void JustSummoned(Creature*); + + // Summons the next wave, calls SummonCreature + void SummonNextWave(); + + // Begins the event by gossip click + void StartEvent(); + + // Searches for the appropriate yell and sound and uses it to inform the raid of various things + void DoTalk(YellType pYellType); + + // Used to filter who to despawn after mass teleport + void SpellHitTarget(Unit*, const SpellEntry*); + + public: + + ScriptedInstance* m_pInstance; + + uint64 m_uiBossGUID[2]; + + uint32 m_uiNextWaveTimer; + uint32 m_uiWaveCount; + uint32 m_uiWaveMoveTimer; + uint32 m_uiCheckTimer; + uint32 m_uiEnemyCount; + uint32 m_uiRetreatTimer; + uint32 m_uiBase; + + bool m_bIsEventInProgress; + bool m_bIsFirstBossDead; + bool m_bIsSecondBossDead; + bool m_bIsSummoningWaves; + bool m_bIsRetreating; + bool m_bDebugMode; + + struct sSpells + { + uint32 m_uiSpellId; + uint32 m_uiCooldown; + TargetType m_pType; + } m_aSpells[MAX_SPELL]; + + private: + uint32 m_uiSpellTimer[MAX_SPELL]; + std::list lWaveMobGUIDList; +}; + +#endif diff --git a/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp b/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp new file mode 100644 index 0000000..ef4fcb6 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp @@ -0,0 +1,244 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Mount_Hyjal +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "hyjal.h" + +/* Battle of Mount Hyjal encounters: +0 - Rage Winterchill event +1 - Anetheron event +2 - Kaz'rogal event +3 - Azgalor event +4 - Archimonde event +*/ + +struct MANGOS_DLL_DECL instance_mount_hyjal : public ScriptedInstance +{ + instance_mount_hyjal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strSaveData; + + std::list lAncientGemGUIDList; + + uint64 m_uiRageWinterchill; + uint64 m_uiAnetheron; + uint64 m_uiKazrogal; + uint64 m_uiAzgalor; + uint64 m_uiArchimonde; + uint64 m_uiJainaProudmoore; + uint64 m_uiThrall; + uint64 m_uiTyrandeWhisperwind; + + uint32 m_uiTrashCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + lAncientGemGUIDList.clear(); + + m_uiRageWinterchill = 0; + m_uiAnetheron = 0; + m_uiKazrogal = 0; + m_uiAzgalor = 0; + m_uiArchimonde = 0; + m_uiJainaProudmoore = 0; + m_uiThrall = 0; + m_uiTyrandeWhisperwind = 0; + + m_uiTrashCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_WINTERCHILL: m_uiRageWinterchill = pCreature->GetGUID(); break; + case NPC_ANETHERON: m_uiAnetheron = pCreature->GetGUID(); break; + case NPC_KAZROGAL: m_uiKazrogal = pCreature->GetGUID(); break; + case NPC_AZGALOR: m_uiAzgalor = pCreature->GetGUID(); break; + case NPC_ARCHIMONDE: m_uiArchimonde = pCreature->GetGUID(); break; + case NPC_JAINA: m_uiJainaProudmoore = pCreature->GetGUID(); break; + case NPC_THRALL: m_uiThrall = pCreature->GetGUID(); break; + case NPC_TYRANDE: m_uiTyrandeWhisperwind = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + if (pGo->GetEntry() == GO_ANCIENT_GEM) + lAncientGemGUIDList.push_back(pGo->GetGUID()); + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_RAGEWINTERCHILL: return m_uiRageWinterchill; + case DATA_ANETHERON: return m_uiAnetheron; + case DATA_KAZROGAL: return m_uiKazrogal; + case DATA_AZGALOR: return m_uiAzgalor; + case DATA_ARCHIMONDE: return m_uiArchimonde; + case DATA_JAINAPROUDMOORE: return m_uiJainaProudmoore; + case DATA_THRALL: return m_uiThrall; + case DATA_TYRANDEWHISPERWIND: return m_uiTyrandeWhisperwind; + } + + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_WINTERCHILL: + if (m_auiEncounter[0] == DONE) + return; + m_auiEncounter[0] = uiData; + break; + case TYPE_ANETHERON: + if (m_auiEncounter[1] == DONE) + return; + m_auiEncounter[1] = uiData; + break; + case TYPE_KAZROGAL: + if (m_auiEncounter[2] == DONE) + return; + m_auiEncounter[2] = uiData; + break; + case TYPE_AZGALOR: + if (m_auiEncounter[3] == DONE) + return; + m_auiEncounter[3] = uiData; + break; + case TYPE_ARCHIMONDE: + m_auiEncounter[4] = uiData; + break; + + case DATA_RESET_TRASH_COUNT: + m_uiTrashCount = 0; + break; + + case DATA_TRASH: + if (uiData) + m_uiTrashCount = uiData; + else + --m_uiTrashCount; + + DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, m_uiTrashCount); + break; + + case TYPE_RETREAT: + if (uiData == SPECIAL) + { + if (!lAncientGemGUIDList.empty()) + { + for(std::list::iterator itr = lAncientGemGUIDList.begin(); itr != lAncientGemGUIDList.end(); ++itr) + { + //don't know how long it expected + DoRespawnGameObject(*itr,DAY); + } + } + } + break; + } + + debug_log("SD2: Instance Hyjal: Instance data updated for event %u (Data=%u)", uiType, uiData); + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + strSaveData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_WINTERCHILL: return m_auiEncounter[0]; + case TYPE_ANETHERON: return m_auiEncounter[1]; + case TYPE_KAZROGAL: return m_auiEncounter[2]; + case TYPE_AZGALOR: return m_auiEncounter[3]; + case TYPE_ARCHIMONDE: return m_auiEncounter[4]; + case DATA_TRASH: return m_uiTrashCount; + } + return 0; + } + + const char* Save() + { + return strSaveData.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as IN_PROGRESS - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_mount_hyjal(Map* pMap) +{ + return new instance_mount_hyjal(pMap); +} + +void AddSC_instance_mount_hyjal() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_hyjal"; + newscript->GetInstanceData = &GetInstanceData_instance_mount_hyjal; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp new file mode 100644 index 0000000..0952e4f --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp @@ -0,0 +1,152 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Captain_Skarloc +SD%Complete: 75 +SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "old_hillsbrad.h" + +#define SAY_ENTER -1560000 +#define SAY_TAUNT1 -1560001 +#define SAY_TAUNT2 -1560002 +#define SAY_SLAY1 -1560003 +#define SAY_SLAY2 -1560004 +#define SAY_DEATH -1560005 + +#define SPELL_HOLY_LIGHT 29427 +#define SPELL_CLEANSE 29380 +#define SPELL_HAMMER_OF_JUSTICE 13005 +#define SPELL_HOLY_SHIELD 31904 +#define SPELL_DEVOTION_AURA 8258 +#define SPELL_CONSECRATION 38385 + +struct MANGOS_DLL_DECL boss_captain_skarlocAI : public ScriptedAI +{ + boss_captain_skarlocAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Holy_Light_Timer; + uint32 Cleanse_Timer; + uint32 HammerOfJustice_Timer; + uint32 HolyShield_Timer; + uint32 DevotionAura_Timer; + uint32 Consecration_Timer; + + void Reset() + { + Holy_Light_Timer = 30000; + Cleanse_Timer = 10000; + HammerOfJustice_Timer = 60000; + HolyShield_Timer = 240000; + DevotionAura_Timer = 3000; + Consecration_Timer = 8000; + } + + void Aggro(Unit *who) + { + //This is not correct. Should taunt Thrall before engage in combat + DoScriptText(SAY_TAUNT1, m_creature); + DoScriptText(SAY_TAUNT2, m_creature); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance && m_pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + m_pInstance->SetData(TYPE_THRALL_PART1, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Holy_Light + if (Holy_Light_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_HOLY_LIGHT); + Holy_Light_Timer = urand(20000, 30000); + }else Holy_Light_Timer -= diff; + + //Cleanse + if (Cleanse_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_CLEANSE); + Cleanse_Timer = 10000; + } else Cleanse_Timer -= diff; + + //Hammer of Justice + if (HammerOfJustice_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + HammerOfJustice_Timer = urand(20000, 35000); + }else HammerOfJustice_Timer -= diff; + + //Holy Shield + if (HolyShield_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_HOLY_SHIELD); + HolyShield_Timer = 240000; + }else HolyShield_Timer -= diff; + + //Devotion_Aura + if (DevotionAura_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_DEVOTION_AURA); + DevotionAura_Timer = urand(45000, 55000); + }else DevotionAura_Timer -= diff; + + //Consecration + if (Consecration_Timer < diff) + { + //DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONSECRATION); + Consecration_Timer = urand(5000, 10000); + }else Consecration_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature) +{ + return new boss_captain_skarlocAI(pCreature); +} + +void AddSC_boss_captain_skarloc() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_captain_skarloc"; + newscript->GetAI = &GetAI_boss_captain_skarloc; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp new file mode 100644 index 0000000..f12fe25 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp @@ -0,0 +1,138 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Epoch_Hunter +SD%Complete: 60 +SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "old_hillsbrad.h" + +#define SAY_ENTER1 -1560013 +#define SAY_ENTER2 -1560014 +#define SAY_ENTER3 -1560015 +#define SAY_AGGRO1 -1560016 +#define SAY_AGGRO2 -1560017 +#define SAY_SLAY1 -1560018 +#define SAY_SLAY2 -1560019 +#define SAY_BREATH1 -1560020 +#define SAY_BREATH2 -1560021 +#define SAY_DEATH -1560022 + +#define SPELL_SAND_BREATH 31914 +#define SPELL_IMPENDING_DEATH 31916 +#define SPELL_MAGIC_DISRUPTION_AURA 33834 +#define SPELL_WING_BUFFET 31475 + +struct MANGOS_DLL_DECL boss_epoch_hunterAI : public ScriptedAI +{ + boss_epoch_hunterAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 SandBreath_Timer; + uint32 ImpendingDeath_Timer; + uint32 WingBuffet_Timer; + uint32 Mda_Timer; + + void Reset() + { + SandBreath_Timer = urand(8000, 16000); + ImpendingDeath_Timer = urand(25000, 30000); + WingBuffet_Timer = 35000; + Mda_Timer = 40000; + } + + void Aggro(Unit *who) + { + DoScriptText(urand(0, 1) ? SAY_AGGRO1 : SAY_AGGRO2, m_creature); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance && m_pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + m_pInstance->SetData(TYPE_THRALL_PART4, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Sand Breath + if (SandBreath_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SAND_BREATH); + + DoScriptText(urand(0, 1) ? SAY_BREATH1 : SAY_BREATH2, m_creature); + + SandBreath_Timer = urand(10000, 20000); + }else SandBreath_Timer -= diff; + + if (ImpendingDeath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_IMPENDING_DEATH); + ImpendingDeath_Timer = urand(25000, 30000); + }else ImpendingDeath_Timer -= diff; + + if (WingBuffet_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_WING_BUFFET); + WingBuffet_Timer = urand(25000, 35000); + }else WingBuffet_Timer -= diff; + + if (Mda_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_MAGIC_DISRUPTION_AURA); + Mda_Timer = 15000; + }else Mda_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature) +{ + return new boss_epoch_hunterAI(pCreature); +} + +void AddSC_boss_epoch_hunter() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_epoch_hunter"; + newscript->GetAI = &GetAI_boss_epoch_hunter; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp new file mode 100644 index 0000000..571db42 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -0,0 +1,188 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Luetenant_Drake +SD%Complete: 70 +SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283 +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "old_hillsbrad.h" +#include "escort_ai.h" + +/*###### +## go_barrel_old_hillsbrad +######*/ + +bool GOHello_go_barrel_old_hillsbrad(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) + { + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) + return false; + + pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); + } + return false; +} + +/*###### +## boss_lieutenant_drake +######*/ + +#define SAY_ENTER -1560006 +#define SAY_AGGRO -1560007 +#define SAY_SLAY1 -1560008 +#define SAY_SLAY2 -1560009 +#define SAY_MORTAL -1560010 +#define SAY_SHOUT -1560011 +#define SAY_DEATH -1560012 + +#define SPELL_WHIRLWIND 31909 +#define SPELL_HAMSTRING 9080 +#define SPELL_MORTAL_STRIKE 31911 +#define SPELL_FRIGHTENING_SHOUT 33789 + +struct Location +{ + uint32 wpId; + float x; + float y; + float z; +}; + +static Location DrakeWP[]= +{ + {0, 2125.84f, 88.2535f, 54.8830f}, + {1, 2111.01f, 93.8022f, 52.6356f}, + {2, 2106.70f, 114.753f, 53.1965f}, + {3, 2107.76f, 138.746f, 52.5109f}, + {4, 2114.83f, 160.142f, 52.4738f}, + {5, 2125.24f, 178.909f, 52.7283f}, + {6, 2151.02f, 208.901f, 53.1551f}, + {7, 2177.00f, 233.069f, 52.4409f}, + {8, 2190.71f, 227.831f, 53.2742f}, + {9, 2178.14f, 214.219f, 53.0779f}, + {10, 2154.99f, 202.795f, 52.6446f}, + {11, 2132.00f, 191.834f, 52.5709f}, + {12, 2117.59f, 166.708f, 52.7686f}, + {13, 2093.61f, 139.441f, 52.7616f}, + {14, 2086.29f, 104.950f, 52.9246f}, + {15, 2094.23f, 81.2788f, 52.6946f}, + {16, 2108.70f, 85.3075f, 53.3294f}, + {17, 2125.50f, 88.9481f, 54.7953f}, + {18, 2128.20f, 70.9763f, 64.4221f} +}; + +struct MANGOS_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI +{ + boss_lieutenant_drakeAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + bool CanPatrol; + uint32 wpId; + + uint32 Whirlwind_Timer; + uint32 Fear_Timer; + uint32 MortalStrike_Timer; + uint32 ExplodingShout_Timer; + + void Reset() + { + CanPatrol = true; + wpId = 0; + + Whirlwind_Timer = 20000; + Fear_Timer = 30000; + MortalStrike_Timer = 45000; + ExplodingShout_Timer = 25000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //TODO: make this work + if (CanPatrol && wpId == 0) + { + m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z); + ++wpId; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Whirlwind + if (Whirlwind_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = urand(20000, 25000); + }else Whirlwind_Timer -= diff; + + //Fear + if (Fear_Timer < diff) + { + DoScriptText(SAY_SHOUT, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); + Fear_Timer = urand(25000, 35000); + }else Fear_Timer -= diff; + + //Mortal Strike + if (MortalStrike_Timer < diff) + { + DoScriptText(SAY_MORTAL, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + MortalStrike_Timer = urand(20000, 30000); + }else MortalStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_lieutenant_drake(Creature* pCreature) +{ + return new boss_lieutenant_drakeAI(pCreature); +} + +void AddSC_boss_lieutenant_drake() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_barrel_old_hillsbrad"; + newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lieutenant_drake"; + newscript->GetAI = &GetAI_boss_lieutenant_drake; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp new file mode 100644 index 0000000..8ed4831 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -0,0 +1,253 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Old_Hillsbrad +SD%Complete: 75 +SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "old_hillsbrad.h" + +instance_old_hillsbrad::instance_old_hillsbrad(Map* pMap) : ScriptedInstance(pMap), + m_uiBarrelCount(0), + m_uiThrallEventCount(0), + m_uiThrallGUID(0), + m_uiTarethaGUID(0), + m_uiScarlocGUID(0), + m_uiEpochGUID(0) +{ + Initialize(); +} + +void instance_old_hillsbrad::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +} + +Player* instance_old_hillsbrad::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 Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + return NULL; +} + +void instance_old_hillsbrad::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_THRALL: + m_uiThrallGUID = pCreature->GetGUID(); + break; + case NPC_TARETHA: + m_uiTarethaGUID = pCreature->GetGUID(); + break; + case NPC_EPOCH: + m_uiEpochGUID = pCreature->GetGUID(); + break; + } +} + +void instance_old_hillsbrad::OnCreatureDeath(Creature* pCreature) +{ + if (pCreature->GetEntry() == NPC_EPOCH) + { + // notify thrall so he can continue + if (Creature* pThrall = instance->GetCreature(m_uiThrallGUID)) + pThrall->AI()->KilledUnit(pCreature); + } +} + +void instance_old_hillsbrad::HandleThrallRelocation() +{ + if (Creature* pThrall = instance->GetCreature(m_uiThrallGUID)) + { + debug_log("SD2: Instance Old Hillsbrad: Thrall relocation"); + + if (m_auiEncounter[TYPE_THRALL_PART4] == IN_PROGRESS) + { + // boss failed, reloc to inn + pThrall->GetMap()->CreatureRelocation(pThrall, 2660.57f, 659.173f, 61.9370f, 0.0f); + m_auiEncounter[TYPE_THRALL_PART4] = NOT_STARTED; + } + else if (m_auiEncounter[TYPE_THRALL_PART3] == IN_PROGRESS) + { + // barn to inn failed, reloc to inn + pThrall->GetMap()->CreatureRelocation(pThrall, 2660.57f, 659.173f, 61.9370f, 0.0f); + m_auiEncounter[TYPE_THRALL_PART3] = DONE; + } + else if (m_auiEncounter[TYPE_THRALL_PART2] == IN_PROGRESS) + { + // keep to barn failed, reloc to barn + pThrall->GetMap()->CreatureRelocation(pThrall, 2486.91f, 626.356f, 58.0761f, 0.0f); + m_auiEncounter[TYPE_THRALL_PART2] = DONE; + } + else if (m_auiEncounter[TYPE_THRALL_PART1] == IN_PROGRESS) + { + // didn't reach very far, back to the basement using default + m_auiEncounter[TYPE_THRALL_PART1] = NOT_STARTED; + } + } +} + +void instance_old_hillsbrad::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_BARREL_DIVERSION: + { + if (uiData == IN_PROGRESS) + { + if (m_uiBarrelCount >= 5) + return; + + ++m_uiBarrelCount; + DoUpdateWorldState(WORLD_STATE_OH, m_uiBarrelCount); + + debug_log("SD2: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u", m_uiBarrelCount); + + m_auiEncounter[TYPE_BARREL_DIVERSION] = IN_PROGRESS; + + if (m_uiBarrelCount == 5) + { + UpdateLodgeQuestCredit(); + + if (Player* pPlayer = GetPlayerInMap()) + pPlayer->SummonCreature(NPC_DRAKE, 2128.43f, 71.01f, 64.42f, 1.74f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + else + debug_log("SD2: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any pPlayer.", uiType, uiData); + + m_auiEncounter[TYPE_BARREL_DIVERSION] = DONE; + } + } + break; + } + case TYPE_THRALL_EVENT: + { + // nothing to do if already done and thrall respawn + if (m_auiEncounter[TYPE_THRALL_EVENT] == DONE) + return; + + if (uiData == FAIL) + { + if (m_uiThrallEventCount <= 20) + { + ++m_uiThrallEventCount; + debug_log("SD2: Instance Old Hillsbrad: Thrall event failed %u times.", m_uiThrallEventCount); + + HandleThrallRelocation(); + } + else if (m_uiThrallEventCount > 20) + { + m_auiEncounter[TYPE_THRALL_EVENT] = uiData; + m_auiEncounter[TYPE_THRALL_PART1] = uiData; + m_auiEncounter[TYPE_THRALL_PART2] = uiData; + m_auiEncounter[TYPE_THRALL_PART3] = uiData; + m_auiEncounter[TYPE_THRALL_PART4] = uiData; + debug_log("SD2: Instance Old Hillsbrad: Thrall event failed %u times. Reset instance required.", m_uiThrallEventCount); + } + } + else + m_auiEncounter[TYPE_THRALL_EVENT] = uiData; + + debug_log("SD2: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",uiData); + break; + } + case TYPE_THRALL_PART1: + m_auiEncounter[TYPE_THRALL_PART1] = uiData; + debug_log("SD2: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",uiData); + break; + case TYPE_THRALL_PART2: + m_auiEncounter[TYPE_THRALL_PART2] = uiData; + debug_log("SD2: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",uiData); + break; + case TYPE_THRALL_PART3: + m_auiEncounter[TYPE_THRALL_PART3] = uiData; + debug_log("SD2: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",uiData); + break; + case TYPE_THRALL_PART4: + m_auiEncounter[TYPE_THRALL_PART4] = uiData; + debug_log("SD2: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",uiData); + break; + } +} + +uint32 instance_old_hillsbrad::GetData(uint32 uiData) +{ + switch(uiData) + { + case TYPE_BARREL_DIVERSION: + return m_auiEncounter[TYPE_BARREL_DIVERSION]; + case TYPE_THRALL_EVENT: + return m_auiEncounter[TYPE_THRALL_EVENT]; + case TYPE_THRALL_PART1: + return m_auiEncounter[TYPE_THRALL_PART1]; + case TYPE_THRALL_PART2: + return m_auiEncounter[TYPE_THRALL_PART2]; + case TYPE_THRALL_PART3: + return m_auiEncounter[TYPE_THRALL_PART3]; + case TYPE_THRALL_PART4: + return m_auiEncounter[TYPE_THRALL_PART4]; + default: + return 0; + } +} + +uint64 instance_old_hillsbrad::GetData64(uint32 uiData) +{ + return 0; +} + +void instance_old_hillsbrad::UpdateLodgeQuestCredit() +{ + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonsterCredit(NPC_LODGE_QUEST_TRIGGER); + } + } +} + +InstanceData* GetInstanceData_instance_old_hillsbrad(Map* pMap) +{ + return new instance_old_hillsbrad(pMap); +} + +void AddSC_instance_old_hillsbrad() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_old_hillsbrad"; + pNewScript->GetInstanceData = &GetInstanceData_instance_old_hillsbrad; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp new file mode 100644 index 0000000..dd5908f --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -0,0 +1,902 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Old_Hillsbrad +SD%Complete: 60 +SDComment: Quest support: 10283, 10284. All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +/* ContentData +npc_brazen +npc_erozion +npc_thrall_old_hillsbrad +npc_taretha +EndContentData */ + +#include "precompiled.h" +#include "old_hillsbrad.h" +#include "escort_ai.h" + +struct MANGOS_DLL_DECL npc_tarethaAI : public npc_escortAI +{ + npc_tarethaAI(Creature* pCreature); + + instance_old_hillsbrad* m_pInstance; + uint64 m_uiErozionGUID; + uint32 m_uiErozionEventTimer; + uint32 m_uiErozionPhase; + + void Reset() {} + void JustSummoned(Creature* pSummoned); + void WaypointReached(uint32 uiPoint); + void UpdateEscortAI(const uint32 uiDiff); +}; + +/*###### +## npc_brazen +######*/ + +enum +{ + GOSSIP_ID_UNKNOWN_TEXT = -1000000, + GOSSIP_ITEM_READY = -3560000, + + TEXT_ID_HAS_BOMBS = 9780, + ITEM_ENTRY_BOMBS = 25853, + + TAXI_PATH_ID = 534 +}; + +bool GossipHello_npc_brazen(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_READY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_brazen(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (!pPlayer->HasItemCount(ITEM_ENTRY_BOMBS, 1)) + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_HAS_BOMBS, pCreature->GetGUID()); + else + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); + } + } + return true; +} + +/*###### +## npc_erozion +######*/ + +enum +{ + GOSSIP_ITEM_NEED_BOMBS = -3560001, + TEXT_ID_DEFAULT = 9778, + TEXT_ID_GOT_ITEM = 9515, +}; + +bool GossipHello_npc_erozion(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1)) + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NEED_BOMBS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + // Need info, should have option to teleport or not + /*if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);*/ + + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_DEFAULT, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(ITEM_ENTRY_BOMBS, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_GOT_ITEM, pCreature->GetGUID()); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + pPlayer->CLOSE_GOSSIP_MENU(); + + return true; +} + +/*###### +## npc_thrall_old_hillsbrad +######*/ + +enum +{ + // Thrall texts + SAY_TH_START_EVENT_PART1 = -1560023, + SAY_TH_ARMORY = -1560024, + SAY_TH_SKARLOC_MEET = -1560025, + SAY_TH_SKARLOC_TAUNT = -1560026, + SAY_TH_START_EVENT_PART2 = -1560027, + SAY_TH_MOUNTS_UP = -1560028, + SAY_TH_CHURCH_END = -1560029, + SAY_TH_MEET_TARETHA = -1560030, + + SAY_EPOCH_ENTER1 = -1560013, + SAY_EPOCH_ENTER2 = -1560014, + SAY_EPOCH_ENTER3 = -1560015, + + SAY_TH_EPOCH_WONDER = -1560031, + SAY_TH_EPOCH_KILL_TARETHA = -1560032, + + SAY_TH_RANDOM_LOW_HP1 = -1560034, + SAY_TH_RANDOM_LOW_HP2 = -1560035, + + SAY_TH_RANDOM_DIE1 = -1560036, + SAY_TH_RANDOM_DIE2 = -1560037, + + SAY_TH_RANDOM_AGGRO1 = -1560038, + SAY_TH_RANDOM_AGGRO2 = -1560039, + SAY_TH_RANDOM_AGGRO3 = -1560040, + SAY_TH_RANDOM_AGGRO4 = -1560041, + + SAY_TH_RANDOM_KILL1 = -1560042, + SAY_TH_RANDOM_KILL2 = -1560043, + SAY_TH_RANDOM_KILL3 = -1560044, + + SAY_TH_KILL_ARMORER = -1560050, + + SAY_TH_LEAVE_COMBAT1 = -1560045, + SAY_TH_LEAVE_COMBAT2 = -1560046, + SAY_TH_LEAVE_COMBAT3 = -1560047, + + // Taretha texts + SAY_TA_ESCAPED = -1560049, + + // end event texts + SAY_TA_FREE = -1560048, + SAY_TR_GLAD_SAFE = -1560054, + SAY_TA_NEVER_MET = -1560055, + SAY_TR_THEN_WHO = -1560056, + SAY_PRE_WIPE = -1560057, + SAY_WIPE_MEMORY = -1560051, + SAY_AFTER_WIPE = -1560058, + SAY_ABOUT_TARETHA = -1560052, + SAY_TH_EVENT_COMPLETE = -1560033, + SAY_TA_FAREWELL = -1560053, + + // Misc for Thrall + SPELL_STRIKE = 14516, + SPELL_SHIELD_BLOCK = 12169, + SPELL_SUMMON_EROZION_IMAGE = 33954, // if thrall dies during escort? + + EQUIP_ID_WEAPON = 927, + EQUIP_ID_SHIELD = 20913, + MODEL_THRALL_UNEQUIPPED = 17292, + MODEL_THRALL_EQUIPPED = 18165, + + // misc creature entries + NPC_ARMORER = 18764, + NPC_SCARLOC = 17862, + + NPC_RIFLE = 17820, + NPC_WARDEN = 17833, + NPC_VETERAN = 17860, + NPC_WATCHMAN = 17814, + NPC_SENTRY = 17815, + + NPC_BARN_GUARDSMAN = 18092, + NPC_BARN_PROTECTOR = 18093, + NPC_BARN_LOOKOUT = 18094, + + NPC_CHURCH_GUARDSMAN = 23175, + NPC_CHURCH_PROTECTOR = 23179, + NPC_CHURCH_LOOKOUT = 23177, + + NPC_INN_GUARDSMAN = 23176, + NPC_INN_PROTECTOR = 23180, + NPC_INN_LOOKOUT = 23178, + + NPC_SKARLOC_MOUNT = 18798, + MODEL_SKARLOC_MOUNT = 18223, + NPC_EROZION = 18723, + NPC_THRALL_QUEST_TRIGGER = 20156, + + // gossip + TEXT_ID_START = 9568, + TEXT_ID_SKARLOC1 = 9614, // I'm glad Taretha is alive. We now must find a way to free her... + GOSSIP_ITEM_SKARLOC1 = -3560002, // "Taretha cannot see you, Thrall." + TEXT_ID_SKARLOC2 = 9579, // What do you mean by this? Is Taretha in danger? + GOSSIP_ITEM_SKARLOC2 = -3560003, // "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe." + TEXT_ID_SKARLOC3 = 9580, + + TEXT_ID_TARREN = 9597, // tarren mill is beyond these trees + GOSSIP_ITEM_TARREN = -3560004, // "We're ready, Thrall." + + TEXT_ID_COMPLETE = 9578, // Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her +}; + +const float SPEED_WALK = 0.5f; +const float SPEED_RUN = 1.0f; +const float SPEED_MOUNT = 1.6f; + +struct MANGOS_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI +{ + npc_thrall_old_hillsbradAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (instance_old_hillsbrad*)pCreature->GetInstanceData(); + m_bHadMount = false; + pCreature->SetActiveObjectState(true); // required for proper relocation + Reset(); + } + + instance_old_hillsbrad* m_pInstance; + + uint64 m_uiScarlocMountGUID; + + bool m_bIsLowHp; + bool m_bHadMount; + + void Reset() + { + m_uiScarlocMountGUID = 0; + + m_bIsLowHp = false; + + if (m_bHadMount) + DoMount(); + + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + DoUnmount(); + m_bHadMount = false; + SetEquipmentSlots(true); + m_creature->SetDisplayId(MODEL_THRALL_UNEQUIPPED); + } + } + + void EnterEvadeMode() + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; + case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; + case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; + } + } + + npc_escortAI::EnterEvadeMode(); + } + + void WaypointReached(uint32 uiPoint) + { + if (!m_pInstance) + return; + + switch(uiPoint) + { + case 8: + SetRun(false); + m_creature->SummonCreature(NPC_ARMORER, 2181.87f, 112.46f, 89.45f, 0.26f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 9: + DoScriptText(SAY_TH_ARMORY, m_creature); + SetEquipmentSlots(false, EQUIP_ID_WEAPON, EQUIP_ID_SHIELD, EQUIP_NO_CHANGE); + break; + case 10: + m_creature->SetDisplayId(MODEL_THRALL_EQUIPPED); + break; + case 11: + SetRun(); + break; + case 15: + m_creature->SummonCreature(NPC_RIFLE, 2200.28f, 137.37f, 87.93f, 5.07f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_WARDEN, 2197.44f, 131.83f, 87.93f, 0.78f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_VETERAN, 2203.62f, 135.40f, 87.93f, 3.70f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_VETERAN, 2200.75f, 130.13f, 87.93f, 1.48f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 21: + m_creature->SummonCreature(NPC_RIFLE, 2135.80f, 154.01f, 67.45f, 4.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_WARDEN, 2144.36f, 151.87f, 67.74f, 4.46f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_VETERAN, 2142.12f, 154.41f, 67.12f, 4.56f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_VETERAN, 2138.08f, 155.38f, 67.24f, 4.60f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 25: + m_creature->SummonCreature(NPC_RIFLE, 2102.98f, 192.17f, 65.24f, 6.02f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_WARDEN, 2108.48f, 198.75f, 65.18f, 5.15f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_VETERAN, 2106.11f, 197.29f, 65.18f, 5.63f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_VETERAN, 2104.18f, 194.82f, 65.18f, 5.75f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 29: + DoScriptText(SAY_TH_SKARLOC_MEET, m_creature); + m_creature->SummonCreature(NPC_SCARLOC, 2036.48f, 271.22f, 63.43f, 5.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 30: + SetEscortPaused(true); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetRun(false); + break; + case 31: + DoScriptText(SAY_TH_MOUNTS_UP, m_creature); + DoMount(); + SetRun(); + break; + case 37: + // possibly regular patrollers? If so, remove this and let database handle them + m_creature->SummonCreature(NPC_WATCHMAN, 2124.26f, 522.16f, 56.87f, 3.99f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_WATCHMAN, 2121.69f, 525.37f, 57.11f, 4.01f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_SENTRY, 2124.65f, 524.55f, 56.63f, 3.98f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 59: + m_creature->SummonCreature(NPC_SKARLOC_MOUNT, 2488.64f, 625.77f, 58.26f, 4.71f, TEMPSUMMON_TIMED_DESPAWN, 10000); + DoUnmount(); + m_bHadMount = false; + SetRun(false); + break; + case 60: + m_creature->HandleEmote(EMOTE_ONESHOT_EXCLAMATION); + // make horsie run off + SetEscortPaused(true); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_pInstance->SetData(TYPE_THRALL_PART2, DONE); + SetRun(); + break; + case 64: + SetRun(false); + break; + case 68: + m_creature->SummonCreature(NPC_BARN_PROTECTOR, 2500.22f, 692.60f, 55.50f, 2.84f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_BARN_LOOKOUT, 2500.13f, 696.55f, 55.51f, 3.38f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_BARN_GUARDSMAN, 2500.55f, 693.64f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_BARN_GUARDSMAN, 2500.94f, 695.81f, 55.50f, 3.14f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 71: + SetRun(); + break; + case 81: + SetRun(false); + break; + case 83: + m_creature->SummonCreature(NPC_CHURCH_PROTECTOR, 2627.33f, 646.82f, 56.03f, 4.28f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000); + m_creature->SummonCreature(NPC_CHURCH_LOOKOUT, 2624.14f, 648.03f, 56.03f, 4.50f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000); + m_creature->SummonCreature(NPC_CHURCH_GUARDSMAN, 2625.32f, 649.60f, 56.03f, 4.38f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000); + m_creature->SummonCreature(NPC_CHURCH_GUARDSMAN, 2627.22f, 649.00f, 56.03f, 4.34f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 5000); + break; + case 84: + DoScriptText(SAY_TH_CHURCH_END, m_creature); + SetRun(); + break; + case 91: + SetRun(false); + break; + case 93: + m_creature->SummonCreature(NPC_INN_PROTECTOR, 2652.71f, 660.31f, 61.93f, 1.67f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_INN_LOOKOUT, 2648.96f, 662.59f, 61.93f, 0.79f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_INN_GUARDSMAN, 2657.36f, 662.34f, 61.93f, 2.68f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SummonCreature(NPC_INN_GUARDSMAN, 2656.39f, 659.77f, 61.93f, 2.61f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 94: + if (Creature* pTaretha = m_pInstance->GetTaretha()) + DoScriptText(SAY_TA_ESCAPED, pTaretha, m_creature); + + break; + case 95: + DoScriptText(SAY_TH_MEET_TARETHA, m_creature); + m_pInstance->SetData(TYPE_THRALL_PART3, DONE); + SetEscortPaused(true); + break; + case 96: + DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); + break; + case 97: + DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); + SetRun(); + break; + case 104: + if (Creature* pEpoch = m_pInstance->GetEpoch()) + DoScriptText(SAY_EPOCH_ENTER3, pEpoch); + + break; + case 105: // outside inn, meeting the dragon + SetEscortPaused(true); + + if (Creature* pEpoch = m_pInstance->GetEpoch()) + m_creature->SetFacingToObject(pEpoch); + + break; + case 106: // epoch is dead, proceeding with cheering + { + // trigger taretha to run down outside + if (Creature* pTaretha = m_pInstance->GetTaretha()) + { + if (Player* pPlayer = GetPlayerForEscort()) + { + if (npc_tarethaAI* pTarethaAI = dynamic_cast(pTaretha->AI())) + pTarethaAI->Start(true, pPlayer->GetGUID()); + } + } + + // kill credit creature for quest + Map::PlayerList const& lPlayerList = m_pInstance->instance->GetPlayers(); + + if (!lPlayerList.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = lPlayerList.begin(); itr != lPlayerList.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonsterCredit(NPC_THRALL_QUEST_TRIGGER, m_creature->GetGUID()); + } + } + + // a lot will happen here, thrall and taretha talk, erozion appear at spot to explain + // handled by taretha script + SetEscortPaused(true); + break; + } + case 107: + m_creature->SetActiveObjectState(false); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + if (!m_pInstance) + return; + + if (uiPointId == 97) + { + if (Creature* pEpoch = m_pInstance->GetEpoch()) + DoScriptText(SAY_EPOCH_ENTER2, pEpoch); + } + } + + void StartWP() + { + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetEscortPaused(false); + } + + void DoMount() + { + m_creature->Mount(MODEL_SKARLOC_MOUNT); + m_creature->SetSpeedRate(MOVE_RUN, SPEED_MOUNT); + } + + void DoUnmount() + { + m_creature->Unmount(); + m_creature->SetSpeedRate(MOVE_RUN, SPEED_RUN); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; + } + + if (m_creature->IsMounted()) + { + DoUnmount(); + m_bHadMount = true; + } + } + + void JustSummoned(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + // TODO: make Scarloc start into event instead, and not start attack directly + case NPC_BARN_GUARDSMAN: + case NPC_BARN_PROTECTOR: + case NPC_BARN_LOOKOUT: + break; + case NPC_SKARLOC_MOUNT: + m_uiScarlocMountGUID = pSummoned->GetGUID(); + break; + default: + pSummoned->AI()->AttackStart(m_creature); + break; + } + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; + } + + // Death called from instance script (or if he has the killing blow of course) + // Thrall should normally always be the one killing, but no support for this yet. + if (pVictim->GetEntry() == NPC_EPOCH) + SetEscortPaused(false); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(urand(0, 1) ? SAY_TH_RANDOM_DIE1 : SAY_TH_RANDOM_DIE2, m_creature); + } + + void CorpseRemoved(uint32 &uiRespawnDelay) + { + uiRespawnDelay = 0; + + // if we're done, just set some high so he never really respawn + if (m_pInstance && m_pInstance->GetData(TYPE_THRALL_EVENT) == DONE) + uiRespawnDelay = 4 * HOUR; + } + + void JustRespawned() + { + if (!m_pInstance) + return; + + Reset(); + + if (m_pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + { + SetEscortPaused(true); + + m_bHadMount = false; + DoUnmount(); + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + + // check current states before fail and set spesific for the part + if (m_pInstance->GetData(TYPE_THRALL_PART1) == IN_PROGRESS) + { + SetCurrentWaypoint(1); // basement + + SetEquipmentSlots(true); + m_creature->SetDisplayId(MODEL_THRALL_UNEQUIPPED); + + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + else if (m_pInstance->GetData(TYPE_THRALL_PART2) == IN_PROGRESS) + { + SetCurrentWaypoint(61); // barn + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + else if (m_pInstance->GetData(TYPE_THRALL_PART3) == IN_PROGRESS || m_pInstance->GetData(TYPE_THRALL_PART4) == IN_PROGRESS) + SetCurrentWaypoint(96); // inn + + // fail, and relocation handled in instance script + m_pInstance->SetData(TYPE_THRALL_EVENT, FAIL); + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // TODO: add his abilities'n-crap here + + if (!m_bIsLowHp && m_creature->GetHealthPercent() < 20.0f) + { + DoScriptText(urand(0, 1) ? SAY_TH_RANDOM_LOW_HP1 : SAY_TH_RANDOM_LOW_HP2, m_creature); + m_bIsLowHp = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature* pCreature) +{ + return new npc_thrall_old_hillsbradAI(pCreature); +} + +bool GossipHello_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + { + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->SendPreparedQuest(pCreature->GetGUID()); + } + + if (instance_old_hillsbrad* pInstance = (instance_old_hillsbrad*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) + { + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ID_UNKNOWN_TEXT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_START, pCreature->GetGUID()); + } + + if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2)) + { + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_SKARLOC1, pCreature->GetGUID()); + } + + if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3)) + { + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_TARREN, pCreature->GetGUID()); + } + } + return true; +} + +bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + instance_old_hillsbrad* pInstance = (instance_old_hillsbrad*)pCreature->GetInstanceData(); + + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + { + pPlayer->CLOSE_GOSSIP_MENU(); + + pInstance->SetData(TYPE_THRALL_EVENT, IN_PROGRESS); + pInstance->SetData(TYPE_THRALL_PART1, IN_PROGRESS); + + DoScriptText(SAY_TH_START_EVENT_PART1, pCreature); + + if (npc_thrall_old_hillsbradAI* pThrallAI = dynamic_cast(pCreature->AI())) + pThrallAI->Start(true, pPlayer->GetGUID()); + + break; + } + case GOSSIP_ACTION_INFO_DEF+2: + { + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_SKARLOC2, pCreature->GetGUID()); + break; + } + case GOSSIP_ACTION_INFO_DEF+20: + { + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_SKARLOC3, pCreature->GetGUID()); + + pCreature->SummonCreature(NPC_SKARLOC_MOUNT, 2038.81f, 270.26f, 63.20f, 5.41f, TEMPSUMMON_TIMED_DESPAWN,12000); + pInstance->SetData(TYPE_THRALL_PART2, IN_PROGRESS); + + DoScriptText(SAY_TH_START_EVENT_PART2, pCreature); + + if (npc_thrall_old_hillsbradAI* pThrallAI = dynamic_cast(pCreature->AI())) + pThrallAI->StartWP(); + + break; + } + case GOSSIP_ACTION_INFO_DEF+3: + { + pPlayer->CLOSE_GOSSIP_MENU(); + + pInstance->SetData(TYPE_THRALL_PART3, IN_PROGRESS); + + if (npc_thrall_old_hillsbradAI* pThrallAI = dynamic_cast(pCreature->AI())) + pThrallAI->StartWP(); + + break; + } + } + return true; +} + +/*###### +## npc_taretha +######*/ + +enum +{ + TEXT_ID_EPOCH1 = 9610, // Thank you for helping Thrall escape, friends. Now I only hope + GOSSIP_ITEM_EPOCH1 = -3560005, // "Strange wizard?" + TEXT_ID_EPOCH2 = 9613, // Yes, friends. This man was no wizard of + GOSSIP_ITEM_EPOCH2 = -3560006, // "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away." +}; + +npc_tarethaAI::npc_tarethaAI(Creature* pCreature) : npc_escortAI(pCreature) +{ + m_pInstance = (instance_old_hillsbrad*)pCreature->GetInstanceData(); + m_uiErozionGUID = 0; + m_uiErozionEventTimer = 5000; + m_uiErozionPhase = 0; + Reset(); +} + +void npc_tarethaAI::JustSummoned(Creature* pSummoned) +{ + if (pSummoned->GetEntry() == NPC_EROZION) + m_uiErozionGUID = pSummoned->GetGUID(); + else + DoScriptText(SAY_EPOCH_ENTER1, pSummoned); +} + +void npc_tarethaAI::WaypointReached(uint32 uiPoint) +{ + switch(uiPoint) + { + case 6: + DoScriptText(SAY_TA_FREE, m_creature); + break; + case 7: + m_creature->HandleEmote(EMOTE_ONESHOT_CHEER); + m_creature->SummonCreature(NPC_EROZION, 2646.47f, 680.416f, 55.38f, 4.16f, TEMPSUMMON_TIMED_DESPAWN, 120000); + SetEscortPaused(true); + SetRun(false); + break; + } +} + +void npc_tarethaAI::UpdateEscortAI(const uint32 uiDiff) +{ + if (!HasEscortState(STATE_ESCORT_PAUSED)) + return; + + if (m_uiErozionEventTimer < uiDiff) + { + ++m_uiErozionPhase; + m_uiErozionEventTimer = 5000; + + switch(m_uiErozionPhase) + { + case 1: + if (Creature* pThrall = m_pInstance->GetThrall()) + { + pThrall->SetFacingToObject(m_creature); + DoScriptText(SAY_TR_GLAD_SAFE, pThrall); + } + break; + case 2: + DoScriptText(SAY_TA_NEVER_MET, m_creature); + break; + case 3: + if (Creature* pThrall = m_pInstance->GetThrall()) + DoScriptText(SAY_TR_THEN_WHO, pThrall); + break; + case 4: + if (Creature* pErozion = m_creature->GetMap()->GetCreature(m_uiErozionGUID)) + DoScriptText(SAY_PRE_WIPE, pErozion); + break; + case 5: + //if (Creature* pErozion = m_creature->GetMap()->GetCreature(m_uiErozionGUID)) + //pErozion->AI()->DoCastSpellIfCan(); + break; + case 6: + if (Creature* pErozion = m_creature->GetMap()->GetCreature(m_uiErozionGUID)) + DoScriptText(SAY_WIPE_MEMORY, pErozion); + break; + case 7: + if (Creature* pErozion = m_creature->GetMap()->GetCreature(m_uiErozionGUID)) + DoScriptText(SAY_ABOUT_TARETHA, pErozion); + break; + case 8: + if (Creature* pErozion = m_creature->GetMap()->GetCreature(m_uiErozionGUID)) + DoScriptText(SAY_AFTER_WIPE, pErozion); + break; + case 9: + if (Creature* pThrall = m_pInstance->GetThrall()) + DoScriptText(SAY_TH_EVENT_COMPLETE, pThrall); + break; + case 10: + DoScriptText(SAY_TA_FAREWELL, m_creature); + SetEscortPaused(false); + + if (Creature* pThrall = m_pInstance->GetThrall()) + { + if (npc_thrall_old_hillsbradAI* pThrallAI = dynamic_cast(pThrall->AI())) + pThrallAI->SetEscortPaused(false); + } + + break; + } + } + else + m_uiErozionEventTimer -= uiDiff; +} + +CreatureAI* GetAI_npc_taretha(Creature* pCreature) +{ + return new npc_tarethaAI(pCreature); +} + +bool GossipHello_npc_taretha(Player* pPlayer, Creature* pCreature) +{ + instance_old_hillsbrad* pInstance = (instance_old_hillsbrad*)pCreature->GetInstanceData(); + + if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) + { + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_EPOCH1, pCreature->GetGUID()); + } + + return true; +} + +bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + instance_old_hillsbrad* pInstance = (instance_old_hillsbrad*)pCreature->GetInstanceData(); + + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_EPOCH2, pCreature->GetGUID()); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + { + pInstance->SetData(TYPE_THRALL_PART4, IN_PROGRESS); + pCreature->SummonCreature(NPC_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + + if (Creature* pThrall = pInstance->GetThrall()) + { + if (npc_thrall_old_hillsbradAI* pThrallAI = dynamic_cast(pThrall->AI())) + pThrallAI->StartWP(); + } + } + } + + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_old_hillsbrad() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_brazen"; + pNewScript->pGossipHello = &GossipHello_npc_brazen; + pNewScript->pGossipSelect = &GossipSelect_npc_brazen; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_erozion"; + pNewScript->pGossipHello = &GossipHello_npc_erozion; + pNewScript->pGossipSelect = &GossipSelect_npc_erozion; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_thrall_old_hillsbrad"; + pNewScript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad; + pNewScript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad; + pNewScript->GetAI = &GetAI_npc_thrall_old_hillsbrad; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_taretha"; + pNewScript->pGossipHello = &GossipHello_npc_taretha; + pNewScript->pGossipSelect = &GossipSelect_npc_taretha; + pNewScript->GetAI = &GetAI_npc_taretha; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.h b/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.h new file mode 100644 index 0000000..d209eb0 --- /dev/null +++ b/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.h @@ -0,0 +1,70 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_OLD_HILLSBRAD_H +#define DEF_OLD_HILLSBRAD_H + +enum +{ + MAX_ENCOUNTER = 6, + + TYPE_BARREL_DIVERSION = 0, + TYPE_THRALL_EVENT = 1, + TYPE_THRALL_PART1 = 2, // prison to keep + TYPE_THRALL_PART2 = 3, // keep to barn + TYPE_THRALL_PART3 = 4, // barn to inn + TYPE_THRALL_PART4 = 5, // inn to boss + + NPC_THRALL = 17876, + NPC_TARETHA = 18887, + NPC_DRAKE = 17848, + NPC_LODGE_QUEST_TRIGGER = 20155, + NPC_EPOCH = 18096, + + QUEST_ENTRY_HILLSBRAD = 10282, + QUEST_ENTRY_DIVERSION = 10283, + QUEST_ENTRY_ESCAPE = 10284, + QUEST_ENTRY_RETURN = 10285, + + WORLD_STATE_OH = 2436, +}; + +class MANGOS_DLL_DECL instance_old_hillsbrad : public ScriptedInstance +{ + public: + instance_old_hillsbrad(Map* pMap); + ~instance_old_hillsbrad() {} + + void Initialize(); + + Player* GetPlayerInMap(); + + void OnCreatureCreate(Creature* pCreature); + void OnCreatureDeath(Creature* pCreature); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + void HandleThrallRelocation(); + + void UpdateLodgeQuestCredit(); + + Creature* GetThrall() { return instance->GetCreature(m_uiThrallGUID); } + Creature* GetTaretha() { return instance->GetCreature(m_uiTarethaGUID); } + Creature* GetScarloc() { return instance->GetCreature(m_uiScarlocGUID); } + Creature* GetEpoch() { return instance->GetCreature(m_uiEpochGUID); } + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint32 m_uiBarrelCount; + uint32 m_uiThrallEventCount; + uint64 m_uiThrallGUID; + uint64 m_uiTarethaGUID; + uint64 m_uiScarlocGUID; + uint64 m_uiEpochGUID; +}; + +#endif diff --git a/scripts/kalimdor/darkshore.cpp b/scripts/kalimdor/darkshore.cpp new file mode 100644 index 0000000..daa3ca6 --- /dev/null +++ b/scripts/kalimdor/darkshore.cpp @@ -0,0 +1,405 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Darkshore +SD%Complete: 100 +SDComment: Quest support: 731, 2078, 5321 +SDCategory: Darkshore +EndScriptData */ + +/* ContentData +npc_kerlonian +npc_prospector_remtravel +npc_threshwackonator +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "follower_ai.h" + +/*#### +# npc_kerlonian +####*/ + +enum +{ + SAY_KER_START = -1000434, + + EMOTE_KER_SLEEP_1 = -1000435, + EMOTE_KER_SLEEP_2 = -1000436, + EMOTE_KER_SLEEP_3 = -1000437, + + SAY_KER_SLEEP_1 = -1000438, + SAY_KER_SLEEP_2 = -1000439, + SAY_KER_SLEEP_3 = -1000440, + SAY_KER_SLEEP_4 = -1000441, + + EMOTE_KER_AWAKEN = -1000445, + + SAY_KER_ALERT_1 = -1000442, + SAY_KER_ALERT_2 = -1000443, + + SAY_KER_END = -1000444, + + SPELL_SLEEP_VISUAL = 25148, + SPELL_AWAKEN = 17536, + QUEST_SLEEPER_AWAKENED = 5321, + NPC_LILADRIS = 11219 //attackers entries unknown +}; + +//TODO: make concept similar as "ringo" -escort. Find a way to run the scripted attacks, _if_ player are choosing road. +struct MANGOS_DLL_DECL npc_kerlonianAI : public FollowerAI +{ + npc_kerlonianAI(Creature* pCreature) : FollowerAI(pCreature) { Reset(); } + + uint32 m_uiFallAsleepTimer; + + void Reset() + { + m_uiFallAsleepTimer = urand(10000, 45000); + } + + void MoveInLineOfSight(Unit *pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_LILADRIS) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*5)) + { + if (Player* pPlayer = GetLeaderForFollower()) + { + if (pPlayer->GetQuestStatus(QUEST_SLEEPER_AWAKENED) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_SLEEPER_AWAKENED, m_creature); + + DoScriptText(SAY_KER_END, m_creature); + } + + SetFollowComplete(); + } + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_AWAKEN) + ClearSleeping(); + } + + void SetSleeping() + { + SetFollowPaused(true); + + switch(urand(0, 2)) + { + case 0: DoScriptText(EMOTE_KER_SLEEP_1, m_creature); break; + case 1: DoScriptText(EMOTE_KER_SLEEP_2, m_creature); break; + case 2: DoScriptText(EMOTE_KER_SLEEP_3, m_creature); break; + } + + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_KER_SLEEP_1, m_creature); break; + case 1: DoScriptText(SAY_KER_SLEEP_2, m_creature); break; + case 2: DoScriptText(SAY_KER_SLEEP_3, m_creature); break; + case 3: DoScriptText(SAY_KER_SLEEP_4, m_creature); break; + } + + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->CastSpell(m_creature, SPELL_SLEEP_VISUAL, false); + } + + void ClearSleeping() + { + m_creature->RemoveAurasDueToSpell(SPELL_SLEEP_VISUAL); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoScriptText(EMOTE_KER_AWAKEN, m_creature); + + SetFollowPaused(false); + } + + void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (!HasFollowState(STATE_FOLLOW_INPROGRESS)) + return; + + if (!HasFollowState(STATE_FOLLOW_PAUSED)) + { + if (m_uiFallAsleepTimer < uiDiff) + { + SetSleeping(); + m_uiFallAsleepTimer = urand(25000, 90000); + } + else + m_uiFallAsleepTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_kerlonian(Creature* pCreature) +{ + return new npc_kerlonianAI(pCreature); +} + +bool QuestAccept_npc_kerlonian(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_SLEEPER_AWAKENED) + { + if (npc_kerlonianAI* pKerlonianAI = dynamic_cast(pCreature->AI())) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_KER_START, pCreature, pPlayer); + pKerlonianAI->StartFollow(pPlayer, FACTION_ESCORT_N_FRIEND_PASSIVE, pQuest); + } + } + + return true; +} + +/*#### +# npc_prospector_remtravel +####*/ + +enum +{ + SAY_REM_START = -1000327, + SAY_REM_AGGRO = -1000339, + SAY_REM_RAMP1_1 = -1000328, + SAY_REM_RAMP1_2 = -1000329, + SAY_REM_BOOK = -1000330, + SAY_REM_TENT1_1 = -1000331, + SAY_REM_TENT1_2 = -1000332, + SAY_REM_MOSS = -1000333, + EMOTE_REM_MOSS = -1000334, + SAY_REM_MOSS_PROGRESS = -1000335, + SAY_REM_PROGRESS = -1000336, + SAY_REM_REMEMBER = -1000337, + EMOTE_REM_END = -1000338, + + QUEST_ABSENT_MINDED_PT2 = 731, + NPC_GRAVEL_SCOUT = 2158, + NPC_GRAVEL_BONE = 2159, + NPC_GRAVEL_GEO = 2160 +}; + +struct MANGOS_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI +{ + npc_prospector_remtravelAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 0: + DoScriptText(SAY_REM_START, m_creature, pPlayer); + break; + case 5: + DoScriptText(SAY_REM_RAMP1_1, m_creature, pPlayer); + break; + case 6: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 9: + DoScriptText(SAY_REM_RAMP1_2, m_creature, pPlayer); + break; + case 14: + //depend quest rewarded? + DoScriptText(SAY_REM_BOOK, m_creature, pPlayer); + break; + case 15: + DoScriptText(SAY_REM_TENT1_1, m_creature, pPlayer); + break; + case 16: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -10.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -10.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + DoScriptText(SAY_REM_TENT1_2, m_creature, pPlayer); + break; + case 26: + DoScriptText(SAY_REM_MOSS, m_creature, pPlayer); + break; + case 27: + DoScriptText(EMOTE_REM_MOSS, m_creature, pPlayer); + break; + case 28: + DoScriptText(SAY_REM_MOSS_PROGRESS, m_creature, pPlayer); + break; + case 29: + DoSpawnCreature(NPC_GRAVEL_SCOUT, -15.0f, 3.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_BONE, -15.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_GRAVEL_GEO, -15.0f, 7.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 31: + DoScriptText(SAY_REM_PROGRESS, m_creature, pPlayer); + break; + case 41: + DoScriptText(SAY_REM_REMEMBER, m_creature, pPlayer); + break; + case 42: + DoScriptText(EMOTE_REM_END, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_ABSENT_MINDED_PT2, m_creature); + break; + } + } + + void Reset() { } + + void Aggro(Unit* pWho) + { + if (urand(0, 1)) + DoScriptText(SAY_REM_AGGRO, m_creature, pWho); + } + + void JustSummoned(Creature* pSummoned) + { + //unsure if it should be any + //pSummoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_prospector_remtravel(Creature* pCreature) +{ + return new npc_prospector_remtravelAI(pCreature); +} + +bool QuestAccept_npc_prospector_remtravel(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ABSENT_MINDED_PT2) + { + pCreature->setFaction(FACTION_ESCORT_A_NEUTRAL_PASSIVE); + + if (npc_prospector_remtravelAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest, true); + } + + return true; +} + +/*#### +# npc_threshwackonator +####*/ + +enum +{ + EMOTE_START = -1000325, + SAY_AT_CLOSE = -1000326, + QUEST_GYROMAST_REV = 2078, + NPC_GELKAK = 6667, + FACTION_HOSTILE = 14 +}; + +#define GOSSIP_ITEM_INSERT_KEY "[PH] Insert key" + +struct MANGOS_DLL_DECL npc_threshwackonatorAI : public FollowerAI +{ + npc_threshwackonatorAI(Creature* pCreature) : FollowerAI(pCreature) { Reset(); } + + void Reset() {} + + void MoveInLineOfSight(Unit* pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_GELKAK) + { + if (m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + DoScriptText(SAY_AT_CLOSE, pWho); + DoAtEnd(); + } + } + } + + void DoAtEnd() + { + m_creature->setFaction(FACTION_HOSTILE); + + if (Player* pHolder = GetLeaderForFollower()) + m_creature->AI()->AttackStart(pHolder); + + SetFollowComplete(); + } +}; + +CreatureAI* GetAI_npc_threshwackonator(Creature* pCreature) +{ + return new npc_threshwackonatorAI(pCreature); +} + +bool GossipHello_npc_threshwackonator(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_GYROMAST_REV) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INSERT_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_threshwackonator(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_threshwackonatorAI* pThreshAI = dynamic_cast(pCreature->AI())) + { + DoScriptText(EMOTE_START, pCreature); + pThreshAI->StartFollow(pPlayer); + } + } + + return true; +} + +void AddSC_darkshore() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_kerlonian"; + pNewScript->GetAI = &GetAI_npc_kerlonian; + pNewScript->pQuestAccept = &QuestAccept_npc_kerlonian; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_prospector_remtravel"; + pNewScript->GetAI = &GetAI_npc_prospector_remtravel; + pNewScript->pQuestAccept = &QuestAccept_npc_prospector_remtravel; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_threshwackonator"; + pNewScript->GetAI = &GetAI_npc_threshwackonator; + pNewScript->pGossipHello = &GossipHello_npc_threshwackonator; + pNewScript->pGossipSelect = &GossipSelect_npc_threshwackonator; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/desolace.cpp b/scripts/kalimdor/desolace.cpp new file mode 100644 index 0000000..1d45c14 --- /dev/null +++ b/scripts/kalimdor/desolace.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Desolace +SD%Complete: 100 +SDComment: Quest support: 5561 +SDCategory: Desolace +EndScriptData */ + +/* ContentData +npc_aged_dying_ancient_kodo +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_SMEED_HOME_1 = -1000348, + SAY_SMEED_HOME_2 = -1000349, + SAY_SMEED_HOME_3 = -1000350, + + QUEST_KODO = 5561, + + NPC_SMEED = 11596, + NPC_AGED_KODO = 4700, + NPC_DYING_KODO = 4701, + NPC_ANCIENT_KODO = 4702, + NPC_TAMED_KODO = 11627, + + SPELL_KODO_KOMBO_ITEM = 18153, + SPELL_KODO_KOMBO_PLAYER_BUFF = 18172, //spells here have unclear function, but using them at least for visual parts and checks + SPELL_KODO_KOMBO_DESPAWN_BUFF = 18377, + SPELL_KODO_KOMBO_GOSSIP = 18362 + +}; + +struct MANGOS_DLL_DECL npc_aged_dying_ancient_kodoAI : public ScriptedAI +{ + npc_aged_dying_ancient_kodoAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiDespawnTimer; + + void Reset() + { + m_uiDespawnTimer = 0; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (pWho->GetEntry() == NPC_SMEED) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + + if (m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SMEED_HOME_1, pWho); break; + case 1: DoScriptText(SAY_SMEED_HOME_2, pWho); break; + case 2: DoScriptText(SAY_SMEED_HOME_3, pWho); break; + } + + //spell have no implemented effect (dummy), so useful to notify spellHit + m_creature->CastSpell(m_creature,SPELL_KODO_KOMBO_GOSSIP,true); + } + } + } + + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + { + if (pSpell->Id == SPELL_KODO_KOMBO_GOSSIP) + { + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_uiDespawnTimer = 60000; + } + } + + void UpdateAI(const uint32 diff) + { + //timer should always be == 0 unless we already updated entry of creature. Then not expect this updated to ever be in combat. + if (m_uiDespawnTimer && m_uiDespawnTimer <= diff) + { + if (!m_creature->getVictim() && m_creature->isAlive()) + { + Reset(); + m_creature->SetDeathState(JUST_DIED); + m_creature->Respawn(); + return; + } + } else m_uiDespawnTimer -= diff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_aged_dying_ancient_kodo(Creature* pCreature) +{ + return new npc_aged_dying_ancient_kodoAI(pCreature); +} + +bool EffectDummyCreature_npc_aged_dying_ancient_kodo(Unit *pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature *pCreatureTarget) +{ + //always check spellid and effectindex + if (spellId == SPELL_KODO_KOMBO_ITEM && effIndex == EFFECT_INDEX_0) + { + //no effect if player/creature already have aura from spells + if (pCaster->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) || pCreatureTarget->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + return true; + + if (pCreatureTarget->GetEntry() == NPC_AGED_KODO || + pCreatureTarget->GetEntry() == NPC_DYING_KODO || + pCreatureTarget->GetEntry() == NPC_ANCIENT_KODO) + { + pCaster->CastSpell(pCaster,SPELL_KODO_KOMBO_PLAYER_BUFF,true); + + pCreatureTarget->UpdateEntry(NPC_TAMED_KODO); + pCreatureTarget->CastSpell(pCreatureTarget,SPELL_KODO_KOMBO_DESPAWN_BUFF,false); + + if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + pCreatureTarget->GetMotionMaster()->MoveIdle(); + + pCreatureTarget->GetMotionMaster()->MoveFollow(pCaster, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + } + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +bool GossipHello_npc_aged_dying_ancient_kodo(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->HasAura(SPELL_KODO_KOMBO_PLAYER_BUFF) && pCreature->HasAura(SPELL_KODO_KOMBO_DESPAWN_BUFF)) + { + //the expected quest objective + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + + pPlayer->RemoveAurasDueToSpell(SPELL_KODO_KOMBO_PLAYER_BUFF); + pCreature->GetMotionMaster()->MoveIdle(); + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +enum +{ + QUEST_GHOST_O_PLASM_ROUND_UP = 6134, + GAMEOBJECT_GHOST_MAGNET = 177746, + MOB_MAGRAMI_SPECTRE = 11560 +}; +struct Locations +{ + float x, y, z; +}; +static Locations SpawnP[]= +{ + {-3009.97f, 2560.86f, 39.05f}, // Start + {-3009.17f, 2684.55f, 42.42f}, + {-3159.04f, 2485.20f, 95.52f}, + {-2864.91f, 2699.52f, 74.07f} +}; + +bool GOHello_go_ghost_magnet (Player* pPlayer, GameObject* pGo) +{ + if ( pPlayer->GetQuestStatus(QUEST_GHOST_O_PLASM_ROUND_UP) == QUEST_STATUS_INCOMPLETE) + if (pGo->GetEntry()== GAMEOBJECT_GHOST_MAGNET) + { + for (int i = 0; i < 3; ++i) + { + pGo->SummonCreature(MOB_MAGRAMI_SPECTRE, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 300000); + } + return true; + } + return false; + + +} +void AddSC_desolace() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_aged_dying_ancient_kodo"; + newscript->GetAI = &GetAI_npc_aged_dying_ancient_kodo; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_aged_dying_ancient_kodo; + newscript->pGossipHello = &GossipHello_npc_aged_dying_ancient_kodo; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_ghost_magnet"; + newscript->pGOHello = &GOHello_go_ghost_magnet; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/dustwallow_marsh.cpp b/scripts/kalimdor/dustwallow_marsh.cpp new file mode 100644 index 0000000..d1d5486 --- /dev/null +++ b/scripts/kalimdor/dustwallow_marsh.cpp @@ -0,0 +1,897 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dustwallow_Marsh +SD%Complete: 95 +SDComment: Quest support: 558, 1173, 1273, 1324, 11209, 11126, 11142, 11180. Vendor Nat Pagle +SDCategory: Dustwallow Marsh +EndScriptData */ + +/* ContentData +mobs_risen_husk_spirit +npc_restless_apparition +npc_deserter_agitator +npc_lady_jaina_proudmoore +npc_morokk +npc_nat_pagle +npc_ogron +npc_private_hendel +npc_cassa_crimsonwing +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## mobs_risen_husk_spirit +######*/ + +enum +{ + QUEST_WHATS_HAUNTING_WITCH_HILL = 11180, + SPELL_SUMMON_RESTLESS_APPARITION = 42511, + SPELL_CONSUME_FLESH = 37933, //Risen Husk + SPELL_INTANGIBLE_PRESENCE = 43127, //Risen Spirit + NPC_RISEN_HUSK = 23555, + NPC_RISEN_SPIRIT = 23554 +}; + + +struct MANGOS_DLL_DECL mobs_risen_husk_spiritAI : public ScriptedAI +{ + mobs_risen_husk_spiritAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiConsumeFlesh_Timer; + uint32 m_uiIntangiblePresence_Timer; + + Player* m_pCreditPlayer; + + void Reset() + { + m_uiConsumeFlesh_Timer = 10000; + m_uiIntangiblePresence_Timer = 5000; + + m_pCreditPlayer = NULL; + } + + void JustSummoned(Creature* pSummoned) + { + if (m_pCreditPlayer) + m_pCreditPlayer->KilledMonsterCredit(pSummoned->GetEntry(), pSummoned->GetGUID()); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage < m_creature->GetHealth()) + return; + + if (Player* pPlayer = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + if (pPlayer->GetQuestStatus(QUEST_WHATS_HAUNTING_WITCH_HILL) == QUEST_STATUS_INCOMPLETE) + { + m_pCreditPlayer = pPlayer; + m_creature->CastSpell(pDoneBy, SPELL_SUMMON_RESTLESS_APPARITION, true); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiConsumeFlesh_Timer < uiDiff) + { + if (m_creature->GetEntry() == NPC_RISEN_HUSK) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CONSUME_FLESH); + + m_uiConsumeFlesh_Timer = 15000; + } + else + m_uiConsumeFlesh_Timer -= uiDiff; + + if (m_uiIntangiblePresence_Timer < uiDiff) + { + if (m_creature->GetEntry() == NPC_RISEN_SPIRIT) + DoCastSpellIfCan(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE); + + m_uiIntangiblePresence_Timer = 20000; + } + else + m_uiIntangiblePresence_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mobs_risen_husk_spirit(Creature* pCreature) +{ + return new mobs_risen_husk_spiritAI(pCreature); +} + +/*###### +## npc_restless_apparition +######*/ + +enum +{ + SAY_RAND_1 = -1000543, + SAY_RAND_2 = -1000544, + SAY_RAND_3 = -1000545, + SAY_RAND_4 = -1000546, + SAY_RAND_5 = -1000547, + SAY_RAND_6 = -1000548, + SAY_RAND_7 = -1000549, + SAY_RAND_8 = -1000550 +}; + +struct MANGOS_DLL_DECL npc_restless_apparitionAI : public ScriptedAI +{ + npc_restless_apparitionAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiTalk_Timer; + + void Reset() + { + m_uiTalk_Timer = 1000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_uiTalk_Timer) + return; + + if (m_uiTalk_Timer <= uiDiff) + { + switch(urand(0, 7)) + { + case 0: DoScriptText(SAY_RAND_1, m_creature); break; + case 1: DoScriptText(SAY_RAND_2, m_creature); break; + case 2: DoScriptText(SAY_RAND_3, m_creature); break; + case 3: DoScriptText(SAY_RAND_4, m_creature); break; + case 4: DoScriptText(SAY_RAND_5, m_creature); break; + case 5: DoScriptText(SAY_RAND_6, m_creature); break; + case 6: DoScriptText(SAY_RAND_7, m_creature); break; + case 7: DoScriptText(SAY_RAND_8, m_creature); break; + } + + m_uiTalk_Timer = 0; + } + else + m_uiTalk_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_restless_apparition(Creature* pCreature) +{ + return new npc_restless_apparitionAI(pCreature); +} + +/*###### +## npc_deserter_agitator +######*/ + +enum +{ + QUEST_TRAITORS_AMONG_US = 11126, + FACTION_THER_DESERTER = 1883 +}; + +struct MANGOS_DLL_DECL npc_deserter_agitatorAI : public ScriptedAI +{ + npc_deserter_agitatorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + } +}; + +CreatureAI* GetAI_npc_deserter_agitator(Creature* pCreature) +{ + return new npc_deserter_agitatorAI(pCreature); +} + +bool GossipHello_npc_deserter_agitator(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_TRAITORS_AMONG_US) == QUEST_STATUS_INCOMPLETE) + { + pCreature->setFaction(FACTION_THER_DESERTER); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_lady_jaina_proudmoore +######*/ + +enum +{ + QUEST_JAINAS_AUTOGRAPH = 558, + SPELL_JAINAS_AUTOGRAPH = 23122 +}; + +#define GOSSIP_ITEM_JAINA "I know this is rather silly but i have a young ward who is a bit shy and would like your autograph." + +bool GossipHello_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_JAINAS_AUTOGRAPH) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_JAINA, GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lady_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_SENDER_INFO) + { + pPlayer->SEND_GOSSIP_MENU(7012, pCreature->GetGUID()); + pPlayer->CastSpell(pPlayer, SPELL_JAINAS_AUTOGRAPH, false); + } + return true; +} + +/*###### +## npc_morokk +######*/ + +enum +{ + SAY_MOR_CHALLENGE = -1000499, + SAY_MOR_SCARED = -1000500, + + QUEST_CHALLENGE_MOROKK = 1173, + + FACTION_MOR_HOSTILE = 168, + FACTION_MOR_RUNNING = 35 +}; + +struct MANGOS_DLL_DECL npc_morokkAI : public npc_escortAI +{ + npc_morokkAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bIsSuccess = false; + Reset(); + } + + bool m_bIsSuccess; + + void Reset() {} + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + SetEscortPaused(true); + break; + case 1: + if (m_bIsSuccess) + DoScriptText(SAY_MOR_SCARED, m_creature); + else + { + m_creature->SetDeathState(JUST_DIED); + m_creature->Respawn(); + } + break; + } + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (m_creature->GetHealthPercent() < 30.0f) + { + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_CHALLENGE_MOROKK, m_creature); + + m_creature->setFaction(FACTION_MOR_RUNNING); + + m_bIsSuccess = true; + EnterEvadeMode(); + + uiDamage = 0; + } + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (Player* pPlayer = GetPlayerForEscort()) + { + m_bIsSuccess = false; + DoScriptText(SAY_MOR_CHALLENGE, m_creature, pPlayer); + m_creature->setFaction(FACTION_MOR_HOSTILE); + AttackStart(pPlayer); + } + + SetEscortPaused(false); + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_morokk(Creature* pCreature) +{ + return new npc_morokkAI(pCreature); +} + +bool QuestAccept_npc_morokk(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_CHALLENGE_MOROKK) + { + if (npc_morokkAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(true, pPlayer->GetGUID(), pQuest); + + return true; + } + + return false; +} +/*###### +## npc_nat_pagle +######*/ + +enum +{ + QUEST_NATS_MEASURING_TAPE = 8227 +}; + +bool GossipHello_npc_nat_pagle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(QUEST_NATS_MEASURING_TAPE)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(7640, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(7638, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_nat_pagle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_ogron +######*/ + +enum +{ + SAY_OGR_START = -1000452, + SAY_OGR_SPOT = -1000453, + SAY_OGR_RET_WHAT = -1000454, + SAY_OGR_RET_SWEAR = -1000455, + SAY_OGR_REPLY_RET = -1000456, + SAY_OGR_RET_TAKEN = -1000457, + SAY_OGR_TELL_FIRE = -1000458, + SAY_OGR_RET_NOCLOSER = -1000459, + SAY_OGR_RET_NOFIRE = -1000460, + SAY_OGR_RET_HEAR = -1000461, + SAY_OGR_CAL_FOUND = -1000462, + SAY_OGR_CAL_MERCY = -1000463, + SAY_OGR_HALL_GLAD = -1000464, + EMOTE_OGR_RET_ARROW = -1000465, + SAY_OGR_RET_ARROW = -1000466, + SAY_OGR_CAL_CLEANUP = -1000467, + SAY_OGR_NODIE = -1000468, + SAY_OGR_SURVIVE = -1000469, + SAY_OGR_RET_LUCKY = -1000470, + SAY_OGR_THANKS = -1000471, + + QUEST_QUESTIONING = 1273, + + FACTION_GENERIC_FRIENDLY = 35, + FACTION_THER_HOSTILE = 151, + + NPC_REETHE = 4980, + NPC_CALDWELL = 5046, + NPC_HALLAN = 5045, + NPC_SKIRMISHER = 5044, + + SPELL_FAKE_SHOT = 7105, + + PHASE_INTRO = 0, + PHASE_GUESTS = 1, + PHASE_FIGHT = 2, + PHASE_COMPLETE = 3 +}; + +static float m_afSpawn[] = {-3383.501953f, -3203.383301f, 36.149f}; +static float m_afMoveTo[] = {-3371.414795f, -3212.179932f, 34.210f}; + +struct MANGOS_DLL_DECL npc_ogronAI : public npc_escortAI +{ + npc_ogronAI(Creature* pCreature) : npc_escortAI(pCreature) + { + lCreatureList.clear(); + m_uiPhase = 0; + m_uiPhaseCounter = 0; + Reset(); + } + + std::list lCreatureList; + + uint32 m_uiPhase; + uint32 m_uiPhaseCounter; + uint32 m_uiGlobalTimer; + + void Reset() + { + m_uiGlobalTimer = 5000; + + if (HasEscortState(STATE_ESCORT_PAUSED) && m_uiPhase == PHASE_FIGHT) + m_uiPhase = PHASE_COMPLETE; + + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + lCreatureList.clear(); + m_uiPhase = 0; + m_uiPhaseCounter = 0; + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (HasEscortState(STATE_ESCORT_ESCORTING) && pWho->GetEntry() == NPC_REETHE && lCreatureList.empty()) + lCreatureList.push_back((Creature*)pWho); + + npc_escortAI::MoveInLineOfSight(pWho); + } + + Creature* GetCreature(uint32 uiCreatureEntry) + { + if (!lCreatureList.empty()) + { + for(std::list::iterator itr = lCreatureList.begin(); itr != lCreatureList.end(); ++itr) + { + if ((*itr)->GetEntry() == uiCreatureEntry && (*itr)->isAlive()) + return (*itr); + } + } + + return NULL; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 9: + DoScriptText(SAY_OGR_SPOT, m_creature); + break; + case 10: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_WHAT, pReethe); + break; + case 11: + SetEscortPaused(true); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + lCreatureList.push_back(pSummoned); + + pSummoned->setFaction(FACTION_GENERIC_FRIENDLY); + + if (pSummoned->GetEntry() == NPC_CALDWELL) + pSummoned->GetMotionMaster()->MovePoint(0, m_afMoveTo[0], m_afMoveTo[1], m_afMoveTo[2]); + else + { + if (Creature* pCaldwell = GetCreature(NPC_CALDWELL)) + { + //will this conversion work without compile warning/error? + size_t iSize = lCreatureList.size(); + pSummoned->GetMotionMaster()->MoveFollow(pCaldwell, 0.5f, (M_PI/2)*(int)iSize); + } + } + } + + void DoStartAttackMe() + { + if (!lCreatureList.empty()) + { + for(std::list::iterator itr = lCreatureList.begin(); itr != lCreatureList.end(); ++itr) + { + if ((*itr)->GetEntry() == NPC_REETHE) + continue; + + if ((*itr)->isAlive()) + { + (*itr)->setFaction(FACTION_THER_HOSTILE); + (*itr)->AI()->AttackStart(m_creature); + } + } + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (m_uiGlobalTimer < uiDiff) + { + m_uiGlobalTimer = 5000; + + switch(m_uiPhase) + { + case PHASE_INTRO: + { + switch(m_uiPhaseCounter) + { + case 0: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_SWEAR, pReethe); + break; + case 1: + DoScriptText(SAY_OGR_REPLY_RET, m_creature); + break; + case 2: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_TAKEN, pReethe); + break; + case 3: + DoScriptText(SAY_OGR_TELL_FIRE, m_creature); + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_NOCLOSER, pReethe); + break; + case 4: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_NOFIRE, pReethe); + break; + case 5: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_HEAR, pReethe); + + m_creature->SummonCreature(NPC_CALDWELL, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + m_creature->SummonCreature(NPC_HALLAN, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + m_creature->SummonCreature(NPC_SKIRMISHER, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + m_creature->SummonCreature(NPC_SKIRMISHER, m_afSpawn[0], m_afSpawn[1], m_afSpawn[2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + + m_uiPhase = PHASE_GUESTS; + break; + } + break; + } + case PHASE_GUESTS: + { + switch(m_uiPhaseCounter) + { + case 6: + if (Creature* pCaldwell = GetCreature(NPC_CALDWELL)) + DoScriptText(SAY_OGR_CAL_FOUND, pCaldwell); + break; + case 7: + if (Creature* pCaldwell = GetCreature(NPC_CALDWELL)) + DoScriptText(SAY_OGR_CAL_MERCY, pCaldwell); + break; + case 8: + if (Creature* pHallan = GetCreature(NPC_HALLAN)) + { + DoScriptText(SAY_OGR_HALL_GLAD, pHallan); + + if (Creature* pReethe = GetCreature(NPC_REETHE)) + pHallan->CastSpell(pReethe, SPELL_FAKE_SHOT, false); + } + break; + case 9: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + { + DoScriptText(EMOTE_OGR_RET_ARROW, pReethe); + DoScriptText(SAY_OGR_RET_ARROW, pReethe); + } + break; + case 10: + if (Creature* pCaldwell = GetCreature(NPC_CALDWELL)) + DoScriptText(SAY_OGR_CAL_CLEANUP, pCaldwell); + + DoScriptText(SAY_OGR_NODIE, m_creature); + break; + case 11: + DoStartAttackMe(); + m_uiPhase = PHASE_FIGHT; + break; + } + break; + } + case PHASE_COMPLETE: + { + switch(m_uiPhaseCounter) + { + case 12: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_QUESTIONING, m_creature); + + DoScriptText(SAY_OGR_SURVIVE, m_creature); + break; + case 13: + if (Creature* pReethe = GetCreature(NPC_REETHE)) + DoScriptText(SAY_OGR_RET_LUCKY, pReethe); + break; + case 14: + DoScriptText(SAY_OGR_THANKS, m_creature); + SetRun(); + SetEscortPaused(false); + break; + } + break; + } + } + + if (m_uiPhase != PHASE_FIGHT) + ++m_uiPhaseCounter; + } + else + m_uiGlobalTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_ogron(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_QUESTIONING) + { + if (npc_ogronAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest, true); + pCreature->setFaction(FACTION_ESCORT_N_FRIEND_PASSIVE); + DoScriptText(SAY_OGR_START, pCreature, pPlayer); + } + } + + return true; +} + +CreatureAI* GetAI_npc_ogron(Creature* pCreature) +{ + return new npc_ogronAI(pCreature); +} + +/*###### +## npc_private_hendel +######*/ + +enum +{ + SAY_PROGRESS_1_TER = -1000411, + SAY_PROGRESS_2_HEN = -1000412, + SAY_PROGRESS_3_TER = -1000413, + SAY_PROGRESS_4_TER = -1000414, + EMOTE_SURRENDER = -1000415, + + QUEST_MISSING_DIPLO_PT16 = 1324, + FACTION_HOSTILE = 168, //guessed, may be different + + NPC_SENTRY = 5184, //helps hendel + NPC_JAINA = 4968, //appears once hendel gives up + NPC_TERVOSH = 4967 +}; + +//TODO: develop this further, end event not created +struct MANGOS_DLL_DECL npc_private_hendelAI : public ScriptedAI +{ + npc_private_hendelAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() + { + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage > m_creature->GetHealth() || m_creature->GetHealthPercent() < 20.0f) + { + uiDamage = 0; + + if (Player* pPlayer = pDoneBy->GetCharmerOrOwnerPlayerOrPlayerItself()) + pPlayer->GroupEventHappens(QUEST_MISSING_DIPLO_PT16, m_creature); + + DoScriptText(EMOTE_SURRENDER, m_creature); + EnterEvadeMode(); + } + } +}; + +bool QuestAccept_npc_private_hendel(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT16) + pCreature->setFaction(FACTION_HOSTILE); + + return true; +} + +CreatureAI* GetAI_npc_private_hendel(Creature* pCreature) +{ + return new npc_private_hendelAI(pCreature); +} + +/*###### +## npc_cassa_crimsonwing +######*/ + +enum +{ + QUEST_SURVEY_ALCAZ = 11142, + SPELL_ALCAZ_SURVEY = 42295 +}; + +#define GOSSIP_RIDE "" + +bool GossipHello_npc_cassa_crimsonwing(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_SURVEY_ALCAZ) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_RIDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_cassa_crimsonwing(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_ALCAZ_SURVEY, false); + } + return true; +} + +/*###### +## at_nats_landing +######*/ +enum +{ + QUEST_NATS_BARGAIN = 11209, + SPELL_FISH_PASTE = 42644, + NPC_LURKING_SHARK = 23928 +}; + +bool AreaTrigger_at_nats_landing(Player* pPlayer, const AreaTriggerEntry* pAt) +{ + if (pPlayer->GetQuestStatus(QUEST_NATS_BARGAIN) == QUEST_STATUS_INCOMPLETE && pPlayer->HasAura(SPELL_FISH_PASTE)) + { + Creature* pShark = GetClosestCreatureWithEntry(pPlayer, NPC_LURKING_SHARK, 20.0f); + + if (!pShark) + pShark = pPlayer->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000); + + pShark->AI()->AttackStart(pPlayer); + return false; + } + return true; +} + +void AddSC_dustwallow_marsh() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "mobs_risen_husk_spirit"; + pNewScript->GetAI = &GetAI_mobs_risen_husk_spirit; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_restless_apparition"; + pNewScript->GetAI = &GetAI_npc_restless_apparition; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_deserter_agitator"; + pNewScript->GetAI = &GetAI_npc_deserter_agitator; + pNewScript->pGossipHello = &GossipHello_npc_deserter_agitator; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_lady_jaina_proudmoore"; + pNewScript->pGossipHello = &GossipHello_npc_lady_jaina_proudmoore; + pNewScript->pGossipSelect = &GossipSelect_npc_lady_jaina_proudmoore; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_morokk"; + pNewScript->GetAI = &GetAI_npc_morokk; + pNewScript->pQuestAccept = &QuestAccept_npc_morokk; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_nat_pagle"; + pNewScript->pGossipHello = &GossipHello_npc_nat_pagle; + pNewScript->pGossipSelect = &GossipSelect_npc_nat_pagle; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_ogron"; + pNewScript->GetAI = &GetAI_npc_ogron; + pNewScript->pQuestAccept = &QuestAccept_npc_ogron; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_private_hendel"; + pNewScript->GetAI = &GetAI_npc_private_hendel; + pNewScript->pQuestAccept = &QuestAccept_npc_private_hendel; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_cassa_crimsonwing"; + pNewScript->pGossipHello = &GossipHello_npc_cassa_crimsonwing; + pNewScript->pGossipSelect = &GossipSelect_npc_cassa_crimsonwing; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_nats_landing"; + pNewScript->pAreaTrigger = &AreaTrigger_at_nats_landing; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/felwood.cpp b/scripts/kalimdor/felwood.cpp new file mode 100644 index 0000000..d58dd93 --- /dev/null +++ b/scripts/kalimdor/felwood.cpp @@ -0,0 +1,506 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Felwood +SD%Complete: 95 +SDComment: Quest support: related to 4101/4102 (To obtain Cenarion Beacon), 4506, 7603, 7603 (Summon Pollo Grande) +SDCategory: Felwood +EndScriptData */ + +/* ContentData +npc_kitten +npcs_riverbreeze_and_silversky +npc_niby_the_almighty +npc_kroshius +EndContentData */ + +#include "precompiled.h" +#include "follower_ai.h" +#include "ObjectMgr.h" + +/*#### +# npc_kitten +####*/ + +enum +{ + EMOTE_SAB_JUMP = -1000541, + EMOTE_SAB_FOLLOW = -1000542, + + SPELL_CORRUPT_SABER_VISUAL = 16510, + + QUEST_CORRUPT_SABER = 4506, + NPC_WINNA = 9996, + NPC_CORRUPT_SABER = 10042 +}; + +#define GOSSIP_ITEM_RELEASE "I want to release the corrupted saber to Winna." + +struct MANGOS_DLL_DECL npc_kittenAI : public FollowerAI +{ + npc_kittenAI(Creature* pCreature) : FollowerAI(pCreature) + { + if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER) + { + StartFollow((Player*)pCreature->GetOwner()); + SetFollowPaused(true); + DoScriptText(EMOTE_SAB_JUMP, m_creature); + + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + //find a decent way to move to center of moonwell + } + + m_uiMoonwellCooldown = 7500; + Reset(); + } + + uint32 m_uiMoonwellCooldown; + + void Reset() { } + + void MoveInLineOfSight(Unit* pWho) + { + //should not have npcflag by default, so set when expected + if (!m_creature->getVictim() && !m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) && HasFollowState(STATE_FOLLOW_INPROGRESS) && pWho->GetEntry() == NPC_WINNA) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + } + + void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasFollowState(STATE_FOLLOW_PAUSED)) + { + if (m_uiMoonwellCooldown < uiDiff) + { + m_creature->CastSpell(m_creature, SPELL_CORRUPT_SABER_VISUAL, false); + SetFollowPaused(false); + } + else + m_uiMoonwellCooldown -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_kitten(Creature* pCreature) +{ + return new npc_kittenAI(pCreature); +} + +bool EffectDummyCreature_npc_kitten(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_CORRUPT_SABER_VISUAL && uiEffIndex == EFFECT_INDEX_0) + { + // Not nice way, however using UpdateEntry will not be correct. + if (const CreatureInfo* pTemp = GetCreatureTemplateStore(NPC_CORRUPT_SABER)) + { + pCreatureTarget->SetEntry(pTemp->Entry); + pCreatureTarget->SetDisplayId(Creature::ChooseDisplayId(pTemp)); + pCreatureTarget->SetName(pTemp->Name); + pCreatureTarget->SetFloatValue(OBJECT_FIELD_SCALE_X, pTemp->scale); + } + + if (Unit* pOwner = pCreatureTarget->GetOwner()) + DoScriptText(EMOTE_SAB_FOLLOW, pCreatureTarget, pOwner); + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +bool GossipHello_npc_corrupt_saber(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CORRUPT_SABER) == QUEST_STATUS_INCOMPLETE) + { + if (GetClosestCreatureWithEntry(pCreature, NPC_WINNA, INTERACTION_DISTANCE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RELEASE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_corrupt_saber(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_kittenAI* pKittenAI = dynamic_cast(pCreature->AI())) + pKittenAI->SetFollowComplete(); + + pPlayer->AreaExploredOrEventHappens(QUEST_CORRUPT_SABER); + } + + return true; +} + +/*###### +## npcs_riverbreeze_and_silversky +######*/ + +enum +{ + QUEST_CLEANSING_FELWOOD_A = 4101, + QUEST_CLEANSING_FELWOOD_H = 4102, + + NPC_ARATHANDIS_SILVERSKY = 9528, + NPC_MAYBESS_RIVERBREEZE = 9529, + + SPELL_CENARION_BEACON = 15120 +}; + +#define GOSSIP_ITEM_BEACON "Please make me a Cenarion Beacon" + +bool GossipHello_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + switch (pCreature->GetEntry()) + { + case NPC_ARATHANDIS_SILVERSKY: + if (pPlayer->GetQuestRewardStatus(QUEST_CLEANSING_FELWOOD_A)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(2848, pCreature->GetGUID()); + }else if (pPlayer->GetTeam() == HORDE) + pPlayer->SEND_GOSSIP_MENU(2845, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(2844, pCreature->GetGUID()); + break; + case NPC_MAYBESS_RIVERBREEZE: + if (pPlayer->GetQuestRewardStatus(QUEST_CLEANSING_FELWOOD_H)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEACON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(2849, pCreature->GetGUID()); + }else if (pPlayer->GetTeam() == ALLIANCE) + pPlayer->SEND_GOSSIP_MENU(2843, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(2842, pCreature->GetGUID()); + break; + } + + return true; +} + +bool GossipSelect_npcs_riverbreeze_and_silversky(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_CENARION_BEACON, false); + } + return true; +} + +/*###### +## npc_niby_the_almighty (summons el pollo grande) +######*/ + +enum +{ + QUEST_KROSHIUS = 7603, + + NPC_IMPSY = 14470, + + SPELL_SUMMON_POLLO = 23056, + + SAY_NIBY_1 = -1000566, + SAY_NIBY_2 = -1000567, + EMOTE_IMPSY_1 = -1000568, + SAY_IMPSY_1 = -1000569, + SAY_NIBY_3 = -1000570 +}; + +struct MANGOS_DLL_DECL npc_niby_the_almightyAI : public ScriptedAI +{ + npc_niby_the_almightyAI(Creature* pCreature) : ScriptedAI(pCreature){ Reset(); } + + uint32 m_uiSummonTimer; + uint8 m_uiSpeech; + + bool m_bEventStarted; + + void Reset() + { + m_uiSummonTimer = 500; + m_uiSpeech = 0; + + m_bEventStarted = false; + } + + void StartEvent() + { + Reset(); + m_bEventStarted = true; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bEventStarted) + { + if (m_uiSummonTimer <= uiDiff) + { + switch (m_uiSpeech) + { + case 1: + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, 5407.19f, -753.00f, 350.82f); + m_uiSummonTimer = 6200; + break; + case 2: + m_creature->SetFacingTo(1.2f); + DoScriptText(SAY_NIBY_1, m_creature); + m_uiSummonTimer = 3000; + break; + case 3: + DoScriptText(SAY_NIBY_2, m_creature); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_POLLO); + m_uiSummonTimer = 2000; + break; + case 4: + if (Creature* pImpsy = GetClosestCreatureWithEntry(m_creature, NPC_IMPSY, 20.0)) + { + DoScriptText(EMOTE_IMPSY_1, pImpsy); + DoScriptText(SAY_IMPSY_1, pImpsy); + m_uiSummonTimer = 2500; + } + else + { + //Skip Speech 5 + m_uiSummonTimer = 40000; + ++m_uiSpeech; + } + break; + case 5: + DoScriptText(SAY_NIBY_3, m_creature); + m_uiSummonTimer = 40000; + break; + case 6: + m_creature->GetMotionMaster()->MoveTargetedHome(); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_bEventStarted = false; + break; + } + ++m_uiSpeech; + } + else + m_uiSummonTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_niby_the_almighty(Creature* pCreature) +{ + return new npc_niby_the_almightyAI(pCreature); +} + +bool ChooseReward_npc_niby_the_almighty(Player* pPlayer, Creature* pCreature, const Quest* pQuest, uint32 slot) +{ + if (pQuest->GetQuestId() == QUEST_KROSHIUS) + { + if (npc_niby_the_almightyAI* pNibyAI = dynamic_cast(pCreature->AI())) + { + pNibyAI->StartEvent(); + } + } + return true; +} + +/*###### +## npc_kroshius +######*/ + +enum +{ + NPC_KROSHIUS = 14467, + SPELL_KNOCKBACK = 10101, + SAY_KROSHIUS_REVIVE = -1000589, + EVENT_KROSHIUS_REVIVE = 8328, + FACTION_HOSTILE = 16, +}; + +struct MANGOS_DLL_DECL npc_kroshiusAI : public ScriptedAI +{ + npc_kroshiusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiPhase = 0; + Reset(); + } + + uint64 m_uiPlayerGUID; + uint32 m_uiKnockBackTimer; + uint32 m_uiPhaseTimer; + + uint8 m_uiPhase; + + void Reset() + { + m_uiKnockBackTimer = urand(5000, 8000); + m_uiPlayerGUID = 0; + + if (!m_uiPhase) + { + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + // TODO: Workaround? till better solution + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + } + + void DoRevive(Player* pSource) + { + if (m_uiPhase) + return; + + m_uiPhase = 1; + m_uiPhaseTimer = 2500; + m_uiPlayerGUID = pSource->GetGUID(); + + // TODO: A visual Flame Circle around the mob still missing + } + + void JustDied(Unit* pKiller) + { + m_uiPhase = 0; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_uiPhase) + return; + + if (m_uiPhase < 4) + { + if (m_uiPhaseTimer < uiDiff) + { + switch (m_uiPhase) + { + case 1: // Revived + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_uiPhaseTimer = 1000; + break; + case 2: + DoScriptText(SAY_KROSHIUS_REVIVE, m_creature); + m_uiPhaseTimer = 3500; + break; + case 3: // Attack + m_creature->setFaction(FACTION_HOSTILE); + // TODO workaround will better idea + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + if (m_creature->IsWithinDistInMap(pPlayer, 30.0f)) + AttackStart(pPlayer); + } + break; + } + m_uiPhase++; + } + else + m_uiPhaseTimer -= uiDiff; + } + else + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiKnockBackTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_KNOCKBACK); + m_uiKnockBackTimer = urand(9000, 12000); + } + else + m_uiKnockBackTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_npc_kroshius(Creature* pCreature) +{ + return new npc_kroshiusAI(pCreature); +} + +bool ProcessEventId_npc_kroshius(uint32 uiEventId, Object* pSource, Object* pTarget, bool bIsStart) +{ + if (uiEventId == EVENT_KROSHIUS_REVIVE) + { + if (pSource->GetTypeId() == TYPEID_PLAYER) + { + if (Creature* pKroshius = GetClosestCreatureWithEntry((Player*)pSource, NPC_KROSHIUS, 20.0f)) + { + if (npc_kroshiusAI* pKroshiusAI = dynamic_cast(pKroshius->AI())) + pKroshiusAI->DoRevive((Player*)pSource); + } + } + + return true; + } + return false; +} + +void AddSC_felwood() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_kitten"; + pNewScript->GetAI = &GetAI_npc_kitten; + pNewScript->pEffectDummyCreature = &EffectDummyCreature_npc_kitten; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_corrupt_saber"; + pNewScript->pGossipHello = &GossipHello_npc_corrupt_saber; + pNewScript->pGossipSelect = &GossipSelect_npc_corrupt_saber; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npcs_riverbreeze_and_silversky"; + pNewScript->pGossipHello = &GossipHello_npcs_riverbreeze_and_silversky; + pNewScript->pGossipSelect = &GossipSelect_npcs_riverbreeze_and_silversky; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_niby_the_almighty"; + pNewScript->GetAI = &GetAI_npc_niby_the_almighty; + pNewScript->pChooseReward = &ChooseReward_npc_niby_the_almighty; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_kroshius"; + pNewScript->GetAI = &GetAI_npc_kroshius; + pNewScript->pProcessEventId = &ProcessEventId_npc_kroshius; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/feralas.cpp b/scripts/kalimdor/feralas.cpp new file mode 100644 index 0000000..70b95a6 --- /dev/null +++ b/scripts/kalimdor/feralas.cpp @@ -0,0 +1,327 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Feralas +SD%Complete: 100 +SDComment: Quest support: 3520, 2767,2845 Special vendor Gregan Brewspewer +SDCategory: Feralas +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "follower_ai.h" + +/*###### +## npc_shay_leafrunner +######*/ +enum +{ + SPELL_STANDUP = 11402, + QUEST_WANDERING_SHAY = 2845, + NPC_ROCKBITER = 7765 +}; +struct Locations +{ + float x, y, z; +}; +static Locations ShayWP[]= +{ + {-3009.97f, 2560.86f, 39.05f}, // Start + {-3009.17f, 2684.55f, 42.42f}, + {-3159.04f, 2485.20f, 95.52f}, + {-2864.91f, 2699.52f, 74.07f}, +}; +struct MANGOS_DLL_DECL npc_shayAI : public FollowerAI +{ + npc_shayAI(Creature* pCreature) : FollowerAI(pCreature) { Reset();} + + uint32 m_uiSitdownTimer; + + void Reset() + { + m_uiSitdownTimer = urand(45000, 75000); + } + + void MoveInLineOfSight(Unit *pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_ROCKBITER) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE*2)) + { + if (Player* pPlayer = GetLeaderForFollower()) + { + if (pPlayer->GetQuestStatus(QUEST_WANDERING_SHAY) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_WANDERING_SHAY, m_creature); + } + + SetFollowComplete(); + } + } + } + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_STANDUP) + StandUp(); + } + + void SetSiting() + { + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + } + + void StandUp() + { + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + SetFollowPaused(false); + } + + void GoAway() + { + SetFollowPaused(true); + uint32 id = urand(0,3); + m_creature->GetMotionMaster()->MovePoint(id, ShayWP[id].x, ShayWP[id].y, ShayWP[id].z); + } + void MovementInform(uint32 type, uint32 id) + { + if ( id == 0 || id == 1 || id == 2 || id == 3 ) + SetSiting(); + } + void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (!HasFollowState(STATE_FOLLOW_INPROGRESS)) + return; + + if (!HasFollowState(STATE_FOLLOW_PAUSED)) + { + if (m_uiSitdownTimer < uiDiff) + { + GoAway(); + m_uiSitdownTimer = urand(45000, 75000); + } + else + m_uiSitdownTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_shay(Creature* pCreature) +{ + return new npc_shayAI(pCreature); +} + +bool QuestAccept_npc_shay(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_WANDERING_SHAY) + { + if (npc_shayAI* pshayAI = dynamic_cast(pCreature->AI())) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + pshayAI->StartFollow(pPlayer, FACTION_ESCORT_N_FRIEND_PASSIVE, pQuest); + } + } + + return true; +} +/*###### +## npc_gregan_brewspewer +######*/ + +bool GossipHello_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestStatus(3909) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Buy somethin', will ya?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(2433, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_gregan_brewspewer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(2434, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + +/*###### +## npc_oox22fe +######*/ + +enum +{ + SAY_OOX_START = -1000287, + SAY_OOX_AGGRO1 = -1000288, + SAY_OOX_AGGRO2 = -1000289, + SAY_OOX_AMBUSH = -1000290, + SAY_OOX_END = -1000292, + + NPC_YETI = 7848, + NPC_GORILLA = 5260, + NPC_WOODPAW_REAVER = 5255, + NPC_WOODPAW_BRUTE = 5253, + NPC_WOODPAW_ALPHA = 5258, + NPC_WOODPAW_MYSTIC = 5254, + + QUEST_RESCUE_OOX22FE = 2767 +}; + +struct MANGOS_DLL_DECL npc_oox22feAI : public npc_escortAI +{ + npc_oox22feAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 i) + { + switch (i) + { + // First Ambush(3 Yetis) + case 11: + DoScriptText(SAY_OOX_AMBUSH,m_creature); + m_creature->SummonCreature(NPC_YETI, -4841.01f, 1593.91f, 73.42f, 3.98f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_YETI, -4837.61f, 1568.58f, 78.21f, 3.13f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_YETI, -4841.89f, 1569.95f, 76.53f, 0.68f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + //Second Ambush(3 Gorillas) + case 21: + DoScriptText(SAY_OOX_AMBUSH,m_creature); + m_creature->SummonCreature(NPC_GORILLA, -4595.81f, 2005.99f, 53.08f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_GORILLA, -4597.53f, 2008.31f, 52.70f, 3.78f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_GORILLA, -4599.37f, 2010.59f, 52.77f, 3.84f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + //Third Ambush(4 Gnolls) + case 30: + DoScriptText(SAY_OOX_AMBUSH,m_creature); + m_creature->SummonCreature(NPC_WOODPAW_REAVER, -4425.14f, 2075.87f, 47.77f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_WOODPAW_BRUTE , -4426.68f, 2077.98f, 47.57f, 3.77f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_WOODPAW_MYSTIC, -4428.33f, 2080.24f, 47.43f, 3.87f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_WOODPAW_ALPHA , -4430.04f, 2075.54f, 46.83f, 3.81f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + break; + case 37: + DoScriptText(SAY_OOX_END,m_creature); + // Award quest credit + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature); + break; + } + } + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + + void Aggro(Unit* who) + { + //For an small probability the npc says something when he get aggro + switch(urand(0, 9)) + { + case 0: DoScriptText(SAY_OOX_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_OOX_AGGRO2, m_creature); break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_oox22fe(Creature* pCreature) +{ + return new npc_oox22feAI(pCreature); +} + +bool QuestAccept_npc_oox22fe(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESCUE_OOX22FE) + { + DoScriptText(SAY_OOX_START, pCreature); + //change that the npc is not lying dead on the ground + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORT_A_PASSIVE); + + if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORT_H_PASSIVE); + + if (npc_oox22feAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## npc_screecher_spirit +######*/ + +bool GossipHello_npc_screecher_spirit(Player* pPlayer, Creature* pCreature) +{ + pPlayer->SEND_GOSSIP_MENU(2039, pCreature->GetGUID()); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_feralas() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_shay"; + newscript->GetAI = &GetAI_npc_shay; + newscript->pQuestAccept = &QuestAccept_npc_shay; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_gregan_brewspewer"; + newscript->pGossipHello = &GossipHello_npc_gregan_brewspewer; + newscript->pGossipSelect = &GossipSelect_npc_gregan_brewspewer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_oox22fe"; + newscript->GetAI = &GetAI_npc_oox22fe; + newscript->pQuestAccept = &QuestAccept_npc_oox22fe; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_screecher_spirit"; + newscript->pGossipHello = &GossipHello_npc_screecher_spirit; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp b/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp new file mode 100644 index 0000000..2fbdfd9 --- /dev/null +++ b/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Celebras_the_Cursed +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_WRATH 21807 +#define SPELL_ENTANGLINGROOTS 12747 +#define SPELL_CORRUPT_FORCES 21968 +#define QUEST_THE_SCEPTER_OF_CELEBRAS 7046 + +struct MANGOS_DLL_DECL celebras_the_cursedAI : public ScriptedAI +{ + celebras_the_cursedAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Wrath_Timer; + uint32 EntanglingRoots_Timer; + uint32 CorruptForces_Timer; + + void Reset() + { + Wrath_Timer = 8000; + EntanglingRoots_Timer = 2000; + CorruptForces_Timer = 30000; + } + + void JustDied(Unit* Killer) + { + m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Wrath + if (Wrath_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + DoCastSpellIfCan(target,SPELL_WRATH); + Wrath_Timer = 8000; + }else Wrath_Timer -= diff; + + //EntanglingRoots + if (EntanglingRoots_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ENTANGLINGROOTS); + EntanglingRoots_Timer = 20000; + }else EntanglingRoots_Timer -= diff; + + //CorruptForces + if (CorruptForces_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature,SPELL_CORRUPT_FORCES); + CorruptForces_Timer = 20000; + }else CorruptForces_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_celebras_the_cursed(Creature* pCreature) +{ + return new celebras_the_cursedAI(pCreature); +} +struct Locations +{ + float x, y, z; +}; +static Locations CelebrasWP[] = +{ + {653.61f, 73.41f, -85.86f}, +}; +struct MANGOS_DLL_DECL npc_celebrasAI : public ScriptedAI +{ + npc_celebrasAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + float x; + float y; + float z; + uint32 m_uiWalkTimer; + + void MovementInform(uint32 type, uint32 tempid) + { + if (tempid == 0) + if(Player* pPlayer = GetPlayerAtMinimumRange( 50)) + if (pPlayer->GetQuestStatus(QUEST_THE_SCEPTER_OF_CELEBRAS) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->GroupEventHappens(QUEST_THE_SCEPTER_OF_CELEBRAS, m_creature); + m_uiWalkTimer = 200; + } + } + + void Reset() + { + } + void GoToStone() + { + m_uiWalkTimer = 200; + } + void UpdateAI(const uint32 diff) + { + if (m_uiWalkTimer) + { + if (m_uiWalkTimer <= diff) + { + m_creature->GetMotionMaster()->MovePoint(0,CelebrasWP[0].x, CelebrasWP[0].y, CelebrasWP[0].z); + m_uiWalkTimer = 0; + + }else m_uiWalkTimer -= diff; + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_celebras(Creature* pCreature) +{ + return new npc_celebrasAI(pCreature); +} + +bool QuestAccept_npc_celebras(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_THE_SCEPTER_OF_CELEBRAS) + { + if (npc_celebrasAI* pCreatureAI = dynamic_cast(pCreature->AI())) + pCreatureAI->GoToStone(); + } + return true; +} + +void AddSC_boss_celebras_the_cursed() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "celebras_the_cursed"; + newscript->GetAI = &GetAI_celebras_the_cursed; + newscript->RegisterSelf(); + + //quest from his ghost + newscript = new Script; + newscript->Name = "npc_celebras_the_redeemed"; + newscript->GetAI = &GetAI_npc_celebras; + newscript->pQuestAccept = &QuestAccept_npc_celebras; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/maraudon/boss_landslide.cpp b/scripts/kalimdor/maraudon/boss_landslide.cpp new file mode 100644 index 0000000..35ee503 --- /dev/null +++ b/scripts/kalimdor/maraudon/boss_landslide.cpp @@ -0,0 +1,90 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Landslide +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_KNOCKAWAY 18670 +#define SPELL_TRAMPLE 5568 +#define SPELL_LANDSLIDE 21808 + +struct MANGOS_DLL_DECL boss_landslideAI : public ScriptedAI +{ + boss_landslideAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 KnockAway_Timer; + uint32 Trample_Timer; + uint32 Landslide_Timer; + + void Reset() + { + KnockAway_Timer = 8000; + Trample_Timer = 2000; + Landslide_Timer = 0; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //KnockAway_Timer + if (KnockAway_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKAWAY); + KnockAway_Timer = 15000; + }else KnockAway_Timer -= diff; + + //Trample_Timer + if (Trample_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_TRAMPLE); + Trample_Timer = 8000; + }else Trample_Timer -= diff; + + //Landslide + if (m_creature->GetHealthPercent() < 50.0f) + { + if (Landslide_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature,SPELL_LANDSLIDE); + Landslide_Timer = 60000; + } else Landslide_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_landslide(Creature* pCreature) +{ + return new boss_landslideAI(pCreature); +} + +void AddSC_boss_landslide() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_landslide"; + newscript->GetAI = &GetAI_boss_landslide; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/maraudon/boss_noxxion.cpp b/scripts/kalimdor/maraudon/boss_noxxion.cpp new file mode 100644 index 0000000..fc0070a --- /dev/null +++ b/scripts/kalimdor/maraudon/boss_noxxion.cpp @@ -0,0 +1,145 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Noxxion +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_TOXICVOLLEY 21687 +#define SPELL_UPPERCUT 22916 + +struct MANGOS_DLL_DECL boss_noxxionAI : public ScriptedAI +{ + boss_noxxionAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ToxicVolley_Timer; + uint32 Uppercut_Timer; + uint32 Adds_Timer; + uint32 Invisible_Timer; + bool Invisible; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + ToxicVolley_Timer = 7000; + Uppercut_Timer = 16000; + Adds_Timer = 19000; + Invisible_Timer = 15000; //Too much too low? + Invisible = false; + } + + void SummonAdds(Unit* victim) + { + Rand = rand()%8; + switch(urand(0, 1)) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%8; + switch(urand(0, 1)) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); + if (Summoned) + Summoned->AI()->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (Invisible && Invisible_Timer < diff) + { + //Become visible again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //Noxxion model + m_creature->SetDisplayId(11172); + Invisible = false; + //m_creature->m_canMove = true; + } else if (Invisible) + { + Invisible_Timer -= diff; + //Do nothing while invisible + return; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ToxicVolley_Timer + if (ToxicVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_TOXICVOLLEY); + ToxicVolley_Timer = 9000; + }else ToxicVolley_Timer -= diff; + + //Uppercut_Timer + if (Uppercut_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 12000; + }else Uppercut_Timer -= diff; + + //Adds_Timer + if (!Invisible && Adds_Timer < diff) + { + //Inturrupt any spell casting + //m_creature->m_canMove = true; + m_creature->InterruptNonMeleeSpells(false); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Invisible Model + m_creature->SetDisplayId(11686); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + Invisible = true; + Invisible_Timer = 15000; + + Adds_Timer = 40000; + }else Adds_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_noxxion(Creature* pCreature) +{ + return new boss_noxxionAI(pCreature); +} + +void AddSC_boss_noxxion() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_noxxion"; + newscript->GetAI = &GetAI_boss_noxxion; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/maraudon/boss_princess_theradras.cpp b/scripts/kalimdor/maraudon/boss_princess_theradras.cpp new file mode 100644 index 0000000..2340082 --- /dev/null +++ b/scripts/kalimdor/maraudon/boss_princess_theradras.cpp @@ -0,0 +1,104 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Princess_Theradras +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_DUSTFIELD 21909 +#define SPELL_BOULDER 21832 +#define SPELL_THRASH 3391 +#define SPELL_REPULSIVEGAZE 21869 + +struct MANGOS_DLL_DECL boss_ptheradrasAI : public ScriptedAI +{ + boss_ptheradrasAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Dustfield_Timer; + uint32 Boulder_Timer; + uint32 Thrash_Timer; + uint32 RepulsiveGaze_Timer; + + void Reset() + { + Dustfield_Timer = 8000; + Boulder_Timer = 2000; + Thrash_Timer = 5000; + RepulsiveGaze_Timer = 23000; + } + + void JustDied(Unit* Killer) + { + m_creature->SummonCreature(12238,28.067f, 61.875f, -123.405f, 4.67f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Dustfield_Timer + if (Dustfield_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DUSTFIELD); + Dustfield_Timer = 14000; + }else Dustfield_Timer -= diff; + + //Boulder_Timer + if (Boulder_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + DoCastSpellIfCan(target,SPELL_BOULDER); + Boulder_Timer = 10000; + }else Boulder_Timer -= diff; + + //RepulsiveGaze_Timer + if (RepulsiveGaze_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_REPULSIVEGAZE); + RepulsiveGaze_Timer = 20000; + }else RepulsiveGaze_Timer -= diff; + + //Thrash_Timer + if (Thrash_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_THRASH); + Thrash_Timer = 18000; + }else Thrash_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ptheradras(Creature* pCreature) +{ + return new boss_ptheradrasAI(pCreature); +} + +void AddSC_boss_ptheradras() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_princess_theradras"; + newscript->GetAI = &GetAI_boss_ptheradras; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/moonglade.cpp b/scripts/kalimdor/moonglade.cpp new file mode 100644 index 0000000..4f08965 --- /dev/null +++ b/scripts/kalimdor/moonglade.cpp @@ -0,0 +1,363 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Moonglade +SD%Complete: 100 +SDComment: Quest support: 30, 272, 5929, 5930, 10965. Special Flight Paths for Druid class. +SDCategory: Moonglade +EndScriptData */ + +/* ContentData +npc_bunthen_plainswind +npc_clintar_dw_spirit +npc_great_bear_spirit +npc_silva_filnaveth +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "ObjectMgr.h" + +/*###### +## npc_bunthen_plainswind +######*/ + +enum +{ + QUEST_SEA_LION_HORDE = 30, + QUEST_SEA_LION_ALLY = 272, + TAXI_PATH_ID_ALLY = 315, + TAXI_PATH_ID_HORDE = 316 +}; + +#define GOSSIP_ITEM_THUNDER "I'd like to fly to Thunder Bluff." +#define GOSSIP_ITEM_AQ_END "Do you know where I can find Half Pendant of Aquatic Endurance?" + +bool GossipHello_npc_bunthen_plainswind(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->getClass() != CLASS_DRUID) + pPlayer->SEND_GOSSIP_MENU(4916, pCreature->GetGUID()); + else if (pPlayer->GetTeam() != HORDE) + { + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(4917, pCreature->GetGUID()); + } + else if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == HORDE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THUNDER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_END, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + pPlayer->SEND_GOSSIP_MENU(4918, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_bunthen_plainswind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == HORDE) + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_HORDE); + + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->SEND_GOSSIP_MENU(5373, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(5376, pCreature->GetGUID()); + break; + } + return true; +} + +/*#### +# npc_clintar_dw_spirit +####*/ + +enum +{ + SAY_START = -1000280, + SAY_AGGRO_1 = -1000281, + SAY_AGGRO_2 = -1000282, + SAY_RELIC1 = -1000283, + SAY_RELIC2 = -1000284, + SAY_RELIC3 = -1000285, + SAY_END = -1000286, + + QUEST_MERE_DREAM = 10965, + SPELL_EMERALD_DREAM = 39601, + NPC_CLINTAR_DW_SPIRIT = 22916, + NPC_CLINTAR_SPIRIT = 22901, + NPC_ASPECT_OF_RAVEN = 22915, +}; + +struct MANGOS_DLL_DECL npc_clintar_dw_spiritAI : public npc_escortAI +{ + npc_clintar_dw_spiritAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + //visual details here probably need refinement + switch(i) + { + case 0: + DoScriptText(SAY_START, m_creature, pPlayer); + break; + case 13: + m_creature->HandleEmote(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 14: + DoScriptText(SAY_RELIC1, m_creature, pPlayer); + break; + case 26: + m_creature->HandleEmote(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 27: + DoScriptText(SAY_RELIC2, m_creature, pPlayer); + break; + case 31: + m_creature->SummonCreature(NPC_ASPECT_OF_RAVEN, 7465.321f, -3088.515f, 429.006f, 5.550f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + break; + case 35: + m_creature->HandleEmote(EMOTE_STATE_USESTANDING_NOSHEATHE); + break; + case 36: + DoScriptText(SAY_RELIC3, m_creature, pPlayer); + break; + case 49: + DoScriptText(SAY_END, m_creature, pPlayer); + pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID()); + break; + } + } + + void Aggro(Unit* who) + { + DoScriptText(urand(0, 1) ? SAY_AGGRO_1 : SAY_AGGRO_2, m_creature); + } + + void Reset() + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + //m_creature are expected to always be spawned, but not visible for player + //spell casted from quest_template.SrcSpell require this to be this way + //we handle the triggered spell to get a "hook" to our guy so he can be escorted on quest accept + + if (CreatureInfo const* pTemp = GetCreatureTemplateStore(m_creature->GetEntry())) + m_creature->SetDisplayId(Creature::ChooseDisplayId(pTemp)); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + } + + //called only from EffectDummy + void DoStart(uint64 uiPlayerGuid) + { + //not the best way, maybe check in DummyEffect if this creature are "free" and not in escort. + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Start(false, uiPlayerGuid); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_clintar_dw_spirit(Creature* pCreature) +{ + return new npc_clintar_dw_spiritAI(pCreature); +} + +//we expect this spell to be triggered from spell casted at questAccept +bool EffectDummyCreature_npc_clintar_dw_spirit(Unit *pCaster, uint32 spellId, SpellEffectIndex effIndex, Creature *pCreatureTarget) +{ + //always check spellid and effectindex + if (spellId == SPELL_EMERALD_DREAM && effIndex == EFFECT_INDEX_0) + { + if (pCaster->GetTypeId() != TYPEID_PLAYER || pCaster->HasAura(SPELL_EMERALD_DREAM)) + return true; + + if (pCreatureTarget->GetEntry() != NPC_CLINTAR_DW_SPIRIT) + return true; + + if (CreatureInfo const* pTemp = GetCreatureTemplateStore(NPC_CLINTAR_SPIRIT)) + pCreatureTarget->SetDisplayId(Creature::ChooseDisplayId(pTemp)); + else + return true; + + //done here, escort can start + if (npc_clintar_dw_spiritAI* pSpiritAI = dynamic_cast(pCreatureTarget->AI())) + pSpiritAI->DoStart(pCaster->GetGUID()); + + //always return true when we are handling this spell and effect + return true; + } + return true; +} + +/*###### +## npc_great_bear_spirit +######*/ + +#define GOSSIP_BEAR1 "What do you represent, spirit?" +#define GOSSIP_BEAR2 "I seek to understand the importance of strength of the body." +#define GOSSIP_BEAR3 "I seek to understand the importance of strength of the heart." +#define GOSSIP_BEAR4 "I have heard your words, Great Bear Spirit, and I understand. I now seek your blessings to fully learn the way of the Claw." + +bool GossipHello_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature) +{ + //ally or horde quest + if (pPlayer->GetQuestStatus(5929) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(5930) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(4719, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(4718, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_great_bear_spirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(4721, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(4733, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BEAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(4734, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(4735, pCreature->GetGUID()); + if (pPlayer->GetQuestStatus(5929)==QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(5929); + if (pPlayer->GetQuestStatus(5930)==QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(5930); + break; + } + return true; +} + +/*###### +## npc_silva_filnaveth +######*/ + +#define GOSSIP_ITEM_RUTHERAN "I'd like to fly to Rut'theran Village." +#define GOSSIP_ITEM_AQ_AGI "Do you know where I can find Half Pendant of Aquatic Agility?" + +bool GossipHello_npc_silva_filnaveth(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->getClass() != CLASS_DRUID) + pPlayer->SEND_GOSSIP_MENU(4913, pCreature->GetGUID()); + else if (pPlayer->GetTeam() != ALLIANCE) + { + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_HORDE) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(4915, pCreature->GetGUID()); + } + else if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == ALLIANCE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTHERAN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestStatus(QUEST_SEA_LION_ALLY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AQ_AGI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + pPlayer->SEND_GOSSIP_MENU(4914, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_silva_filnaveth(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pPlayer->getClass() == CLASS_DRUID && pPlayer->GetTeam() == ALLIANCE) + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_ALLY); + + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->SEND_GOSSIP_MENU(5374, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->SEND_GOSSIP_MENU(5375, pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## +######*/ + +void AddSC_moonglade() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_bunthen_plainswind"; + newscript->pGossipHello = &GossipHello_npc_bunthen_plainswind; + newscript->pGossipSelect = &GossipSelect_npc_bunthen_plainswind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_clintar_dw_spirit"; + newscript->GetAI = &GetAI_npc_clintar_dw_spirit; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_clintar_dw_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_great_bear_spirit"; + newscript->pGossipHello = &GossipHello_npc_great_bear_spirit; + newscript->pGossipSelect = &GossipSelect_npc_great_bear_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_silva_filnaveth"; + newscript->pGossipHello = &GossipHello_npc_silva_filnaveth; + newscript->pGossipSelect = &GossipSelect_npc_silva_filnaveth; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/mulgore.cpp b/scripts/kalimdor/mulgore.cpp new file mode 100644 index 0000000..ff4d119 --- /dev/null +++ b/scripts/kalimdor/mulgore.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Mulgore +SD%Complete: 100 +SDComment: Quest support: 11129. Skorn Whitecloud: Just a story if not rewarded for quest +SDCategory: Mulgore +EndScriptData */ + +/* ContentData +npc_kyle_the_frenzied +npc_skorn_whitecloud +EndContentData */ + +#include "precompiled.h" + +/*###### +# npc_kyle_the_frenzied +######*/ + +enum +{ + EMOTE_SEE_LUNCH = -1000340, + EMOTE_EAT_LUNCH = -1000341, + EMOTE_DANCE = -1000342, + + SPELL_LUNCH = 42222, + NPC_KYLE_FRENZIED = 23616, + NPC_KYLE_FRIENDLY = 23622, + POINT_ID = 1 +}; + +struct MANGOS_DLL_DECL npc_kyle_the_frenziedAI : public ScriptedAI +{ + npc_kyle_the_frenziedAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + bool m_bEvent; + bool m_bIsMovingToLunch; + uint64 m_uiPlayerGUID; + uint32 m_uiEventTimer; + uint8 m_uiEventPhase; + + void Reset() + { + m_bEvent = false; + m_bIsMovingToLunch = false; + m_uiPlayerGUID = 0; + m_uiEventTimer = 5000; + m_uiEventPhase = 0; + + if (m_creature->GetEntry() == NPC_KYLE_FRIENDLY) + m_creature->UpdateEntry(NPC_KYLE_FRENZIED); + } + + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + { + if (!m_creature->getVictim() && !m_bEvent && pSpell->Id == SPELL_LUNCH) + { + if (pCaster->GetTypeId() == TYPEID_PLAYER) + m_uiPlayerGUID = pCaster->GetGUID(); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + } + + m_bEvent = true; + DoScriptText(EMOTE_SEE_LUNCH, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_CREATURE_SPECIAL); + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE || !m_bEvent) + return; + + if (uiPointId == POINT_ID) + m_bIsMovingToLunch = false; + } + + void UpdateAI(const uint32 diff) + { + if (m_bEvent) + { + if (m_bIsMovingToLunch) + return; + + if (m_uiEventTimer < diff) + { + m_uiEventTimer = 5000; + ++m_uiEventPhase; + + switch(m_uiEventPhase) + { + case 1: + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + if (GameObject* pGo = pPlayer->GetGameObject(SPELL_LUNCH)) + { + m_bIsMovingToLunch = true; + m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); + } + } + break; + case 2: + DoScriptText(EMOTE_EAT_LUNCH, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USESTANDING); + break; + case 3: + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + pPlayer->TalkedToCreature(m_creature->GetEntry(), m_creature->GetGUID()); + + m_creature->UpdateEntry(NPC_KYLE_FRIENDLY); + break; + case 4: + m_uiEventTimer = 30000; + DoScriptText(EMOTE_DANCE, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_DANCESPECIAL); + break; + case 5: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Reset(); + m_creature->GetMotionMaster()->Clear(); + break; + } + } + else + m_uiEventTimer -= diff; + } + } +}; + +CreatureAI* GetAI_npc_kyle_the_frenzied(Creature* pCreature) +{ + return new npc_kyle_the_frenziedAI(pCreature); +} + +/*###### +# npc_skorn_whitecloud +######*/ + +bool GossipHello_npc_skorn_whitecloud(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (!pPlayer->GetQuestRewardStatus(770)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tell me a story, Skorn.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(522, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_skorn_whitecloud(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + pPlayer->SEND_GOSSIP_MENU(523, pCreature->GetGUID()); + + return true; +} + +void AddSC_mulgore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_kyle_the_frenzied"; + newscript->GetAI = &GetAI_npc_kyle_the_frenzied; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_skorn_whitecloud"; + newscript->pGossipHello = &GossipHello_npc_skorn_whitecloud; + newscript->pGossipSelect = &GossipSelect_npc_skorn_whitecloud; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp new file mode 100644 index 0000000..83e6b22 --- /dev/null +++ b/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp @@ -0,0 +1,544 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Onyxia +SD%Complete: 70 +SDComment: Phase 3 need additional code. The spawning Whelps need GO-Support. Erruption needs GO-Support +SDCategory: Onyxia's Lair +EndScriptData */ + +#include "precompiled.h" +#include "onyxias_lair.h" + +enum +{ + SAY_AGGRO = -1249000, + SAY_KILL = -1249001, + SAY_PHASE_2_TRANS = -1249002, + SAY_PHASE_3_TRANS = -1249003, + EMOTE_BREATH = -1249004, + + SPELL_WINGBUFFET = 18500, + SPELL_WINGBUFFET_H = 69293, + SPELL_FLAMEBREATH = 18435, + SPELL_FLAMEBREATH_H = 68970, + SPELL_CLEAVE = 68868, + SPELL_TAILSWEEP = 68867, + SPELL_TAILSWEEP_H = 69286, + SPELL_KNOCK_AWAY = 19633, + SPELL_FIREBALL = 18392, + SPELL_FIREBALL_H = 68926, + SPELL_ERRUPTION = 17731, // does not work + SPELL_ERRUPTION_H = 69294, // does not work + + //Not much choise about these. We have to make own defintion on the direction/start-end point + SPELL_BREATH_NORTH_TO_SOUTH = 17086, // 20x in "array" + SPELL_BREATH_SOUTH_TO_NORTH = 18351, // 11x in "array" + + SPELL_BREATH_EAST_TO_WEST = 18576, // 7x in "array" + SPELL_BREATH_WEST_TO_EAST = 18609, // 7x in "array" + + SPELL_BREATH_SE_TO_NW = 18564, // 12x in "array" + SPELL_BREATH_NW_TO_SE = 18584, // 12x in "array" + SPELL_BREATH_SW_TO_NE = 18596, // 12x in "array" + SPELL_BREATH_NE_TO_SW = 18617, // 12x in "array" + + //SPELL_BREATH = 21131, // 8x in "array", different initial cast than the other arrays + + SPELL_BELLOWINGROAR = 18431, + SPELL_HEATED_GROUND = 22191, // TODO + + SPELL_SUMMONWHELP = 17646, // TODO this spell is only a summon spell, but would need a spell to activate the eggs + SPELL_SUMMON_LAIR_GUARD = 68968, + + MAX_WHELPS_PER_PACK = 40, + NPC_WHELP = 11262, + + PHASE_START = 1, + PHASE_BREATH = 2, + PHASE_END = 3, + PHASE_BREATH_PRE = 4, + PHASE_BREATH_POST = 5 +}; + +struct sOnyxMove +{ + uint32 uiLocId; + uint32 uiLocIdEnd; + uint32 uiSpellId; + float fX, fY, fZ; +}; + +static sOnyxMove aMoveData[]= +{ + {0, 4, SPELL_BREATH_NORTH_TO_SOUTH, 22.8763f, -217.152f, -60.0548f}, //north + {1, 5, SPELL_BREATH_NE_TO_SW, 10.2191f, -247.912f, -60.896f}, //north-east + {2, 6, SPELL_BREATH_EAST_TO_WEST, -31.4963f, -250.123f, -60.1278f}, //east + {3, 7, SPELL_BREATH_SE_TO_NW, -63.5156f, -240.096f, -60.477f}, //south-east + {4, 0, SPELL_BREATH_SOUTH_TO_NORTH, -65.8444f, -213.809f, -60.2985f}, //south + {5, 1, SPELL_BREATH_SW_TO_NE, -58.2509f, -189.020f, -60.790f}, //south-west + {6, 2, SPELL_BREATH_WEST_TO_EAST, -33.5561f, -182.682f, -60.9457f}, //west + {7, 3, SPELL_BREATH_NW_TO_SE, 6.8951f, -180.246f, -60.896f}, //north-west +}; + +static float afSpawnLocations[4][3]= +{ + {-30.127f, -254.463f, -89.440f}, // whelps + {-30.817f, -177.106f, -89.258f}, // whelps + {-126.57f, -214.609f, -71.446f} // guardians +}; + +struct MANGOS_DLL_DECL boss_onyxiaAI : public ScriptedAI +{ + boss_onyxiaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_onyxias_lair*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_uiMaxBreathPositions = sizeof(aMoveData)/sizeof(sOnyxMove); + Reset(); + } + + bool m_bIsRegularMode; + instance_onyxias_lair* m_pInstance; + + uint8 m_uiPhase; + uint8 m_uiMaxBreathPositions; + + uint32 m_uiFlameBreathTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiTailSweepTimer; + uint32 m_uiWingBuffetTimer; + + uint32 m_uiMovePoint; + uint32 m_uiMovementTimer; + sOnyxMove* m_pPointData; + + uint32 m_uiFireballTimer; + uint32 m_uiSummonWhelpsTimer; + uint32 m_uiBellowingRoarTimer; + uint32 m_uiWhelpTimer; + uint32 m_uiSummonGuardTimer; + + uint8 m_uiSummonCount; + + bool m_bIsSummoningWhelps; + + void Reset() + { + if (!IsCombatMovement()) + SetCombatMovement(true); + + m_uiPhase = PHASE_START; + + m_uiFlameBreathTimer = urand(10000, 20000); + m_uiTailSweepTimer = urand(15000, 20000); + m_uiCleaveTimer = urand(2000, 5000); + m_uiWingBuffetTimer = urand(10000, 20000); + + m_uiMovePoint = urand(0, m_uiMaxBreathPositions - 1); + m_uiMovementTimer = 20000; + m_pPointData = GetMoveData(); + + m_uiFireballTimer = 15000; + m_uiSummonWhelpsTimer = 15000; + m_uiBellowingRoarTimer = 2000; // Immediately after landing + m_uiWhelpTimer = 1000; + m_uiSummonGuardTimer = 15000; + + m_uiSummonCount = 0; + + m_bIsSummoningWhelps = false; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetInCombatWithZone(); + } + + void JustReachedHome() + { + // in case evade in phase 2, see comments for hack where phase 2 is set + m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + m_creature->SetByteFlag(UNIT_FIELD_BYTES_1, 3, 0); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->GetMotionMaster()->MovePoint(0, afSpawnLocations[3][0], afSpawnLocations[3][1], afSpawnLocations[3][2]); + pSummoned->SetInCombatWithZone(); + + if (pSummoned->GetEntry() == NPC_WHELP) + ++m_uiSummonCount; + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_BREATH_EAST_TO_WEST || + pSpell->Id == SPELL_BREATH_WEST_TO_EAST || + pSpell->Id == SPELL_BREATH_SE_TO_NW || + pSpell->Id == SPELL_BREATH_NW_TO_SE || + pSpell->Id == SPELL_BREATH_SW_TO_NE || + pSpell->Id == SPELL_BREATH_NE_TO_SW || + pSpell->Id == SPELL_BREATH_SOUTH_TO_NORTH || + pSpell->Id == SPELL_BREATH_NORTH_TO_SOUTH) + { + if (m_pPointData = GetMoveData()) + { + if (!m_pInstance) + return; + + if (Creature* pTrigger = m_pInstance->instance->GetCreature(m_pInstance->GetOnyxiaTriggerGUID())) + { + m_creature->GetMap()->CreatureRelocation(m_creature, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, m_creature->GetAngle(pTrigger)); + m_creature->SendMonsterMove(m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ, SPLINETYPE_FACINGTARGET, m_creature->GetSplineFlags(), 1, NULL, pTrigger->GetGUID()); + } + } + } + } + + sOnyxMove* GetMoveData() + { + for (uint32 i = 0; i < m_uiMaxBreathPositions; ++i) + { + if (aMoveData[i].uiLocId == m_uiMovePoint) + return &aMoveData[i]; + } + + return NULL; + } + + void MovementInform(uint32 uiMoveType, uint32 uiPointId) + { + if (uiMoveType != POINT_MOTION_TYPE || !m_pInstance) + return; + + if (m_uiPhase == PHASE_BREATH) + { + if (Creature* pTrigger = m_pInstance->instance->GetCreature(m_pInstance->GetOnyxiaTriggerGUID())) + m_creature->SetFacingToObject(pTrigger); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + switch (m_uiPhase) + { + case PHASE_END: // Here is room for additional summoned whelps and Erruption + if (m_uiBellowingRoarTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_BELLOWINGROAR) == CAST_OK) + m_uiBellowingRoarTimer = 30000; + } + else + m_uiBellowingRoarTimer -= uiDiff; + // no break, phase 3 will use same abilities as in 1 + case PHASE_START: + { + if (m_uiFlameBreathTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FLAMEBREATH : SPELL_FLAMEBREATH_H) == CAST_OK) + m_uiFlameBreathTimer = urand(10000, 20000); + } + else + m_uiFlameBreathTimer -= uiDiff; + + if (m_uiTailSweepTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_TAILSWEEP : SPELL_TAILSWEEP_H) == CAST_OK) + m_uiTailSweepTimer = urand(15000, 20000); + } + else + m_uiTailSweepTimer -= uiDiff; + + if (m_uiCleaveTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK) + m_uiCleaveTimer = urand(2000, 5000); + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiWingBuffetTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WINGBUFFET : SPELL_WINGBUFFET_H) == CAST_OK) + m_uiWingBuffetTimer = urand(15000, 30000); + } + else + m_uiWingBuffetTimer -= uiDiff; + + if (m_uiPhase == PHASE_START && m_creature->GetHealthPercent() < 65.0f) + { + m_uiPhase = PHASE_BREATH; + + SetCombatMovement(false); + m_creature->GetMotionMaster()->MoveIdle(); + + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + + // sort of a hack, it is unclear how this really work but the values appear to be valid + m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, UNIT_BYTE1_FLAG_ALWAYS_STAND | UNIT_BYTE1_FLAG_UNK_2); + m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + + if (m_pPointData) + m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); + + return; + } + + DoMeleeAttackIfReady(); + break; + } + case PHASE_BREATH: + { + if (m_creature->GetHealthPercent() < 40.0f) + { + m_uiPhase = PHASE_END; + DoScriptText(SAY_PHASE_3_TRANS, m_creature); + + // undo flying + m_creature->SetByteValue(UNIT_FIELD_BYTES_1, 3, 0); + m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + + SetCombatMovement(true); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + return; + } + + if (m_uiMovementTimer < uiDiff) + { + m_uiMovementTimer = 25000; + + // 3 possible actions + switch(urand(0, 2)) + { + case 0: // breath + if (m_pPointData = GetMoveData()) + { + DoScriptText(EMOTE_BREATH, m_creature); + DoCastSpellIfCan(m_creature, m_pPointData->uiSpellId, CAST_INTERRUPT_PREVIOUS); + m_uiMovePoint = m_pPointData->uiLocIdEnd; + } + return; + case 1: // a point on the left side + { + // C++ is stupid, so add -1 with +7 + m_uiMovePoint += m_uiMaxBreathPositions - 1; + m_uiMovePoint %= m_uiMaxBreathPositions; + break; + } + case 2: // a point on the right side + ++m_uiMovePoint %= m_uiMaxBreathPositions; + break; + } + + if (m_pPointData = GetMoveData()) + m_creature->GetMotionMaster()->MovePoint(m_pPointData->uiLocId, m_pPointData->fX, m_pPointData->fY, m_pPointData->fZ); + } + else + m_uiMovementTimer -= uiDiff; + + if (m_uiFireballTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_FIREBALL : SPELL_FIREBALL_H) == CAST_OK) + m_uiFireballTimer = 8000; + } + } + else + m_uiFireballTimer -= uiDiff; //engulfingflames is supposed to be activated by a fireball but haven't come by + + if (m_bIsSummoningWhelps) + { + if (m_uiSummonCount < MAX_WHELPS_PER_PACK) + { + if (m_uiWhelpTimer < uiDiff) + { + m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[0][0], afSpawnLocations[0][1], afSpawnLocations[0][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + m_creature->SummonCreature(NPC_WHELP, afSpawnLocations[1][0], afSpawnLocations[1][1], afSpawnLocations[1][2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + m_uiWhelpTimer = 500; + } + else + m_uiWhelpTimer -= uiDiff; + } + else + { + m_bIsSummoningWhelps = false; + m_uiSummonCount = 0; + m_uiSummonWhelpsTimer = 80000; // 90s -10s for summoning + } + } + else + { + if (m_uiSummonWhelpsTimer < uiDiff) + m_bIsSummoningWhelps = true; + else + m_uiSummonWhelpsTimer -= uiDiff; + } + + if (m_uiSummonGuardTimer < uiDiff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->CastSpell(afSpawnLocations[2][0], afSpawnLocations[2][1], afSpawnLocations[2][2], SPELL_SUMMON_LAIR_GUARD, true); + m_uiSummonGuardTimer = 30000; + } + } + else + m_uiSummonGuardTimer -= uiDiff; + + break; + } + } + } +}; + +CreatureAI* GetAI_boss_onyxia(Creature* pCreature) +{ + return new boss_onyxiaAI(pCreature); +} + +void AddSC_boss_onyxia() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "boss_onyxia"; + pNewScript->GetAI = &GetAI_boss_onyxia; + pNewScript->RegisterSelf(); +} + +/* +-- SPELL_BREATH_EAST_TO_WEST +DELETE FROM spell_target_position WHERE id IN (18576, 18578, 18579, 18580, 18581, 18582, 18583); +INSERT INTO spell_target_position VALUES (18576, 249, -37.743851, -243.667923, -88.217651, 1.416); +INSERT INTO spell_target_position VALUES (18578, 249, -35.805332, -232.028900, -87.749153, 1.416); +INSERT INTO spell_target_position VALUES (18579, 249, -34.045738, -224.714661, -85.529465, 1.416); +INSERT INTO spell_target_position VALUES (18580, 249, -32.081570, -214.916962, -88.327438, 1.416); +INSERT INTO spell_target_position VALUES (18581, 249, -36.611721, -202.684677, -85.653786, 1.416); +INSERT INTO spell_target_position VALUES (18582, 249, -37.067261, -195.758652, -87.745834, 1.416); +INSERT INTO spell_target_position VALUES (18583, 249, -37.728523, -188.616806, -88.074898, 1.416); +-- SPELL_BREATH_WEST_TO_EAST +DELETE FROM spell_target_position WHERE id IN (18609, 18611, 18612, 18613, 18614, 18615, 18616); +INSERT INTO spell_target_position VALUES (18609, 249, -37.728523, -188.616806, -88.074898, 4.526); +INSERT INTO spell_target_position VALUES (18611, 249, -37.067261, -195.758652, -87.745834, 4.526); +INSERT INTO spell_target_position VALUES (18612, 249, -36.611721, -202.684677, -85.653786, 4.526); +INSERT INTO spell_target_position VALUES (18613, 249, -32.081570, -214.916962, -88.327438, 4.526); +INSERT INTO spell_target_position VALUES (18614, 249, -34.045738, -224.714661, -85.529465, 4.526); +INSERT INTO spell_target_position VALUES (18615, 249, -35.805332, -232.028900, -87.749153, 4.526); +INSERT INTO spell_target_position VALUES (18616, 249, -37.743851, -243.667923, -88.217651, 4.526); +-- SPELL_BREATH_NW_TO_SE +DELETE FROM spell_target_position WHERE id IN (18584, 18585, 18586, 18587, 18588, 18589, 18590, 18591, 18592, 18593, 18594, 18595); +INSERT INTO spell_target_position VALUES (18584, 249, 6.016711, -181.305771, -85.654648, 3.776); +INSERT INTO spell_target_position VALUES (18585, 249, 3.860220, -183.227249, -86.375381, 3.776); +INSERT INTO spell_target_position VALUES (18586, 249, -2.529650, -188.690491, -87.172859, 3.776); +INSERT INTO spell_target_position VALUES (18587, 249, -8.449303, -193.957962, -87.564957, 3.776); +INSERT INTO spell_target_position VALUES (18588, 249, -14.321238, -199.462219, -87.922478, 3.776); +INSERT INTO spell_target_position VALUES (18589, 249, -15.602085, -216.893936, -88.403183, 3.776); +INSERT INTO spell_target_position VALUES (18590, 249, -23.650263, -221.969086, -89.172699, 3.776); +INSERT INTO spell_target_position VALUES (18591, 249, -29.495876, -213.014359, -88.910423, 3.776); +INSERT INTO spell_target_position VALUES (18592, 249, -35.439922, -217.260284, -87.336311, 3.776); +INSERT INTO spell_target_position VALUES (18593, 249, -41.762104, -221.896545, -86.114113, 3.776); +INSERT INTO spell_target_position VALUES (18594, 249, -51.067528, -228.909988, -85.765556, 3.776); +INSERT INTO spell_target_position VALUES (18595, 249, -56.559654, -241.223923, -85.423607, 3.776); +-- SPELL_BREATH_SE_TO_NW +DELETE FROM spell_target_position WHERE id IN (18564, 18565, 18566, 18567, 18568, 18569, 18570, 18571, 18572, 18573, 18574, 18575); +INSERT INTO spell_target_position VALUES (18564, 249, -56.559654, -241.223923, -85.423607, 0.666); +INSERT INTO spell_target_position VALUES (18565, 249, -51.067528, -228.909988, -85.765556, 0.666); +INSERT INTO spell_target_position VALUES (18566, 249, -41.762104, -221.896545, -86.114113, 0.666); +INSERT INTO spell_target_position VALUES (18567, 249, -35.439922, -217.260284, -87.336311, 0.666); +INSERT INTO spell_target_position VALUES (18568, 249, -29.495876, -213.014359, -88.910423, 0.666); +INSERT INTO spell_target_position VALUES (18569, 249, -23.650263, -221.969086, -89.172699, 0.666); +INSERT INTO spell_target_position VALUES (18570, 249, -15.602085, -216.893936, -88.403183, 0.666); +INSERT INTO spell_target_position VALUES (18571, 249, -14.321238, -199.462219, -87.922478, 0.666); +INSERT INTO spell_target_position VALUES (18572, 249, -8.449303, -193.957962, -87.564957, 0.666); +INSERT INTO spell_target_position VALUES (18573, 249, -2.529650, -188.690491, -87.172859, 0.666); +INSERT INTO spell_target_position VALUES (18574, 249, 3.860220, -183.227249, -86.375381, 0.666); +INSERT INTO spell_target_position VALUES (18575, 249, 6.016711, -181.305771, -85.654648, 0.666); +-- SPELL_BREATH_SW_TO_NE +DELETE FROM spell_target_position WHERE id IN (18596, 18597, 18598, 18599, 18600, 18601, 18602, 18603, 18604, 18605, 18606, 18607); +INSERT INTO spell_target_position VALUES (18596, 249, -58.250900, -189.020004, -85.292267, 5.587); +INSERT INTO spell_target_position VALUES (18597, 249, -52.006271, -193.796570, -85.808769, 5.587); +INSERT INTO spell_target_position VALUES (18598, 249, -46.135464, -198.548553, -85.901764, 5.587); +INSERT INTO spell_target_position VALUES (18599, 249, -40.500187, -203.001053, -85.555107, 5.587); +INSERT INTO spell_target_position VALUES (18600, 249, -30.907579, -211.058197, -88.592125, 5.587); +INSERT INTO spell_target_position VALUES (18601, 249, -20.098139, -218.681427, -88.937088, 5.587); +INSERT INTO spell_target_position VALUES (18602, 249, -12.223192, -224.666168, -87.856300, 5.587); +INSERT INTO spell_target_position VALUES (18603, 249, -6.475297, -229.098724, -87.076401, 5.587); +INSERT INTO spell_target_position VALUES (18604, 249, -2.010256, -232.541992, -86.995140, 5.587); +INSERT INTO spell_target_position VALUES (18605, 249, 2.736300, -236.202347, -86.790367, 5.587); +INSERT INTO spell_target_position VALUES (18606, 249, 7.197779, -239.642868, -86.307297, 5.587); +INSERT INTO spell_target_position VALUES (18607, 249, 12.120926, -243.439407, -85.874260, 5.587); +-- SPELL_BREATH_NE_TO_SW +DELETE FROM spell_target_position WHERE id IN (18617, 18619, 18620, 18621, 18622, 18623, 18624, 18625, 18626, 18627, 18628, 18618); +INSERT INTO spell_target_position VALUES (18617, 249, 12.120926, -243.439407, -85.874260, 2.428); +INSERT INTO spell_target_position VALUES (18619, 249, 7.197779, -239.642868, -86.307297, 2.428); +INSERT INTO spell_target_position VALUES (18620, 249, 2.736300, -236.202347, -86.790367, 2.428); +INSERT INTO spell_target_position VALUES (18621, 249, -2.010256, -232.541992, -86.995140, 2.428); +INSERT INTO spell_target_position VALUES (18622, 249, -6.475297, -229.098724, -87.076401, 2.428); +INSERT INTO spell_target_position VALUES (18623, 249, -12.223192, -224.666168, -87.856300, 2.428); +INSERT INTO spell_target_position VALUES (18624, 249, -20.098139, -218.681427, -88.937088, 2.428); +INSERT INTO spell_target_position VALUES (18625, 249, -30.907579, -211.058197, -88.592125, 2.428); +INSERT INTO spell_target_position VALUES (18626, 249, -40.500187, -203.001053, -85.555107, 2.428); +INSERT INTO spell_target_position VALUES (18627, 249, -46.135464, -198.548553, -85.901764, 2.428); +INSERT INTO spell_target_position VALUES (18628, 249, -52.006271, -193.796570, -85.808769, 2.428); +INSERT INTO spell_target_position VALUES (18618, 249, -58.250900, -189.020004, -85.292267, 2.428); + +-- SPELL_BREATH_SOUTH_TO_NORTH +DELETE FROM spell_target_position WHERE id IN (18351, 18352, 18353, 18354, 18355, 18356, 18357, 18358, 18359, 18360, 18361); +INSERT INTO spell_target_position VALUES (18351, 249, -68.834236, -215.036163, -84.018875, 6.280); +INSERT INTO spell_target_position VALUES (18352, 249, -61.834255, -215.051910, -84.673416, 6.280); +INSERT INTO spell_target_position VALUES (18353, 249, -53.343277, -215.071014, -85.597191, 6.280); +INSERT INTO spell_target_position VALUES (18354, 249, -42.619305, -215.095139, -86.663605, 6.280); +INSERT INTO spell_target_position VALUES (18355, 249, -35.899323, -215.110245, -87.196548, 6.280); +INSERT INTO spell_target_position VALUES (18356, 249, -28.248341, -215.127457, -89.191750, 6.280); +INSERT INTO spell_target_position VALUES (18357, 249, -20.324360, -215.145279, -88.963997, 6.280); +INSERT INTO spell_target_position VALUES (18358, 249, -11.189384, -215.165833, -87.817093, 6.280); +INSERT INTO spell_target_position VALUES (18359, 249, -2.047405, -215.186386, -86.279655, 6.280); +INSERT INTO spell_target_position VALUES (18360, 249, 7.479571, -215.207809, -86.075531, 6.280); +INSERT INTO spell_target_position VALUES (18361, 249, 20.730539, -215.237610, -85.254387, 6.280); +-- SPELL_BREATH_NORTH_TO_SOUTH +DELETE FROM spell_target_position WHERE id IN (17086, 17087, 17088, 17089, 17090, 17091, 17092, 17093, 17094, 17095, 17097, 22267, 22268, 21132, 21133, 21135, 21136, 21137, 21138, 21139); +INSERT INTO spell_target_position VALUES (17086, 249, 20.730539, -215.237610, -85.254387, 3.142); +INSERT INTO spell_target_position VALUES (17087, 249, 7.479571, -215.207809, -86.075531, 3.142); +INSERT INTO spell_target_position VALUES (17088, 249, -2.047405, -215.186386, -86.279655, 3.142); +INSERT INTO spell_target_position VALUES (17089, 249, -11.189384, -215.165833, -87.817093, 3.142); +INSERT INTO spell_target_position VALUES (17090, 249, -20.324360, -215.145279, -88.963997, 3.142); +INSERT INTO spell_target_position VALUES (17091, 249, -28.248341, -215.127457, -89.191750, 3.142); +INSERT INTO spell_target_position VALUES (17092, 249, -35.899323, -215.110245, -87.196548, 3.142); +INSERT INTO spell_target_position VALUES (17093, 249, -42.619305, -215.095139, -86.663605, 3.142); +INSERT INTO spell_target_position VALUES (17094, 249, -53.343277, -215.071014, -85.597191, 3.142); +INSERT INTO spell_target_position VALUES (17095, 249, -61.834255, -215.051910, -84.673416, 3.142); +INSERT INTO spell_target_position VALUES (17097, 249, -68.834236, -215.036163, -84.018875, 3.142); +INSERT INTO spell_target_position VALUES (22267, 249, -75.736046, -214.984970, -83.394188, 3.142); +INSERT INTO spell_target_position VALUES (22268, 249, -84.087578, -214.857834, -82.640053, 3.142); +INSERT INTO spell_target_position VALUES (21132, 249, -90.424416, -214.601974, -82.482697, 3.142); +INSERT INTO spell_target_position VALUES (21133, 249, -96.572411, -214.353745, -82.239967, 3.142); +INSERT INTO spell_target_position VALUES (21135, 249, -102.069931, -214.131775, -80.571190, 3.142); +INSERT INTO spell_target_position VALUES (21136, 249, -107.385597, -213.917145, -77.447037, 3.142); +INSERT INTO spell_target_position VALUES (21137, 249, -114.281258, -213.866486, -73.851128, 3.142); +INSERT INTO spell_target_position VALUES (21138, 249, -123.328560, -213.607910, -71.559921, 3.142); +INSERT INTO spell_target_position VALUES (21139, 249, -130.788300, -213.424026, -70.751007, 3.142); +*/ diff --git a/scripts/kalimdor/onyxias_lair/instance_onyxias_lair.cpp b/scripts/kalimdor/onyxias_lair/instance_onyxias_lair.cpp new file mode 100644 index 0000000..0aa3490 --- /dev/null +++ b/scripts/kalimdor/onyxias_lair/instance_onyxias_lair.cpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Onyxias_Lair +SD%Complete: 50% +SDComment: +SDCategory: Onyxia's Lair +EndScriptData */ + +#include "precompiled.h" +#include "onyxias_lair.h" + +instance_onyxias_lair::instance_onyxias_lair(Map* pMap) : ScriptedInstance(pMap), + m_uiOnyxTriggerGUID(0) +{ + Initialize(); +} + +void instance_onyxias_lair::Initialize() +{ +} + +void instance_onyxias_lair::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_ONYXIA_TRIGGER: + m_uiOnyxTriggerGUID = pCreature->GetGUID(); + break; + } +} + +InstanceData* GetInstanceData_instance_onyxias_lair(Map* pMap) +{ + return new instance_onyxias_lair(pMap); +} + +void AddSC_instance_onyxias_lair() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_onyxias_lair"; + pNewScript->GetInstanceData = &GetInstanceData_instance_onyxias_lair; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/onyxias_lair/onyxias_lair.h b/scripts/kalimdor/onyxias_lair/onyxias_lair.h new file mode 100644 index 0000000..536fdcf --- /dev/null +++ b/scripts/kalimdor/onyxias_lair/onyxias_lair.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ONYXIA_H +#define DEF_ONYXIA_H + +enum +{ + NPC_ONYXIA_TRIGGER = 12758 +}; + +class MANGOS_DLL_DECL instance_onyxias_lair : public ScriptedInstance +{ + public: + instance_onyxias_lair(Map* pMap); + ~instance_onyxias_lair() {} + + void Initialize(); + + void OnCreatureCreate(Creature* pCreature); + + uint64 GetOnyxiaTriggerGUID() { return m_uiOnyxTriggerGUID; } + + protected: + uint64 m_uiOnyxTriggerGUID; +}; + +#endif diff --git a/scripts/kalimdor/orgrimmar.cpp b/scripts/kalimdor/orgrimmar.cpp new file mode 100644 index 0000000..8262621 --- /dev/null +++ b/scripts/kalimdor/orgrimmar.cpp @@ -0,0 +1,274 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Orgrimmar +SD%Complete: 100 +SDComment: Quest support: 2460, 5727, 6566 +SDCategory: Orgrimmar +EndScriptData */ + +/* ContentData +npc_neeru_fireblade npc_text + gossip options text missing +npc_shenthul +npc_thrall_warchief +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_neeru_fireblade +######*/ + +#define QUEST_5727 5727 + +bool GossipHello_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_5727) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You may speak frankly, Neeru...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_neeru_fireblade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] ...", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(4513, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_5727); + break; + } + return true; +} + +/*###### +## npc_shenthul +######*/ + +enum +{ + QUEST_SHATTERED_SALUTE = 2460 +}; + +struct MANGOS_DLL_DECL npc_shenthulAI : public ScriptedAI +{ + npc_shenthulAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool CanTalk; + bool CanEmote; + uint32 Salute_Timer; + uint32 Reset_Timer; + uint64 playerGUID; + + void Reset() + { + CanTalk = false; + CanEmote = false; + Salute_Timer = 6000; + Reset_Timer = 0; + playerGUID = 0; + } + + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + if (emote == TEXTEMOTE_SALUTE && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) + { + if (CanEmote) + { + pPlayer->AreaExploredOrEventHappens(QUEST_SHATTERED_SALUTE); + Reset(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (CanEmote) + { + if (Reset_Timer < diff) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(playerGUID)) + { + if (pPlayer->GetTypeId() == TYPEID_PLAYER && pPlayer->GetQuestStatus(QUEST_SHATTERED_SALUTE) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_SHATTERED_SALUTE); + } + Reset(); + } else Reset_Timer -= diff; + } + + if (CanTalk && !CanEmote) + { + if (Salute_Timer < diff) + { + m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE); + CanEmote = true; + Reset_Timer = 60000; + } else Salute_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_shenthul(Creature* pCreature) +{ + return new npc_shenthulAI(pCreature); +} + +bool QuestAccept_npc_shenthul(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_SHATTERED_SALUTE) + { + if (npc_shenthulAI* pShenAI = dynamic_cast(pCreature->AI())) + { + pShenAI->CanTalk = true; + pShenAI->playerGUID = pPlayer->GetGUID(); + } + } + return true; +} + +/*###### +## npc_thrall_warchief +######*/ + +#define QUEST_6566 6566 + +#define SPELL_CHAIN_LIGHTNING 16033 +#define SPELL_SHOCK 16034 + +//TODO: verify abilities/timers +struct MANGOS_DLL_DECL npc_thrall_warchiefAI : public ScriptedAI +{ + npc_thrall_warchiefAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 ChainLightning_Timer; + uint32 Shock_Timer; + + void Reset() + { + ChainLightning_Timer = 2000; + Shock_Timer = 8000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (ChainLightning_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CHAIN_LIGHTNING); + ChainLightning_Timer = 9000; + }else ChainLightning_Timer -= diff; + + if (Shock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHOCK); + Shock_Timer = 15000; + }else Shock_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_thrall_warchief(Creature* pCreature) +{ + return new npc_thrall_warchiefAI(pCreature); +} + +bool GossipHello_npc_thrall_warchief(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_6566) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Please share your wisdom with me, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_thrall_warchief(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What discoveries?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(5733, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Usurper?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(5734, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "With all due respect, Warchief - why not allow them to be destroyed? Does this not strengthen our position?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(5735, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I... I did not think of it that way, Warchief.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(5736, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I live only to serve, Warchief! My life is empty and meaningless without your guidance.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(5737, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Of course, Warchief!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(5738, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_6566); + break; + } + return true; +} + +void AddSC_orgrimmar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_neeru_fireblade"; + newscript->pGossipHello = &GossipHello_npc_neeru_fireblade; + newscript->pGossipSelect = &GossipSelect_npc_neeru_fireblade; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_shenthul"; + newscript->GetAI = &GetAI_npc_shenthul; + newscript->pQuestAccept = &QuestAccept_npc_shenthul; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_thrall_warchief"; + newscript->GetAI = &GetAI_npc_thrall_warchief; + newscript->pGossipHello = &GossipHello_npc_thrall_warchief; + newscript->pGossipSelect = &GossipSelect_npc_thrall_warchief; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp new file mode 100644 index 0000000..e6b32e0 --- /dev/null +++ b/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp @@ -0,0 +1,129 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Amnennar_the_coldbringer +SD%Complete: 100 +SDComment: +SDCategory: Razorfen Downs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1129000 +#define SAY_SUMMON60 -1129001 +#define SAY_SUMMON30 -1129002 +#define SAY_HP -1129003 +#define SAY_KILL -1129004 + +#define SPELL_AMNENNARSWRATH 13009 +#define SPELL_FROSTBOLT 15530 +#define SPELL_FROST_NOVA 15531 +#define SPELL_FROST_SPECTRES 12642 + +struct MANGOS_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI +{ + boss_amnennar_the_coldbringerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 AmnenarsWrath_Timer; + uint32 FrostBolt_Timer; + uint32 FrostNova_Timer; + bool Spectrals60; + bool Spectrals30; + bool Hp; + + void Reset() + { + AmnenarsWrath_Timer = 8000; + FrostBolt_Timer = 1000; + FrostNova_Timer = urand(10000, 15000); + Spectrals30 = false; + Spectrals60 = false; + Hp = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit() + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //AmnenarsWrath_Timer + if (AmnenarsWrath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_AMNENNARSWRATH); + AmnenarsWrath_Timer = 12000; + } else AmnenarsWrath_Timer -= diff; + + //FrostBolt_Timer + if (FrostBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBOLT); + FrostBolt_Timer = 8000; + } else FrostBolt_Timer -= diff; + + if (FrostNova_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_FROST_NOVA); + FrostNova_Timer = 15000; + } else FrostNova_Timer -= diff; + + if (!Spectrals60 && m_creature->GetHealthPercent() < 60.0f) + { + DoScriptText(SAY_SUMMON60, m_creature); + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals60 = true; + } + + if (!Hp && m_creature->GetHealthPercent() < 50.0f) + { + DoScriptText(SAY_HP, m_creature); + Hp = true; + } + + if (!Spectrals30 && m_creature->GetHealthPercent() < 30.0f) + { + DoScriptText(SAY_SUMMON30, m_creature); + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals30 = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature* pCreature) +{ + return new boss_amnennar_the_coldbringerAI(pCreature); +} + +void AddSC_boss_amnennar_the_coldbringer() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_amnennar_the_coldbringer"; + newscript->GetAI = &GetAI_boss_amnennar_the_coldbringer; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp new file mode 100644 index 0000000..c36f862 --- /dev/null +++ b/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp @@ -0,0 +1,85 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Razorfen_Downs +SD%Complete: 100 +SDComment: Support for Henry Stern(2 recipes) +SDCategory: Razorfen Downs +EndScriptData */ + +/* ContentData +npc_henry_stern +EndContentData */ + +#include "precompiled.h" + +/*### +# npc_henry_stern +####*/ + +enum +{ + SPELL_GOLDTHORN_TEA = 13028, + SPELL_TEACHING_GOLDTHORN_TEA = 13029, + SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, + SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, + GOSSIP_TEXT_TEA_ANSWER = 2114, + GOSSIP_TEXT_POTION_ANSWER = 2115, +}; + +#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" +#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" + +bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID()); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + { + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); + } + + return true; +} + +void AddSC_razorfen_downs() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_henry_stern"; + newscript->pGossipHello = &GossipHello_npc_henry_stern; + newscript->pGossipSelect = &GossipSelect_npc_henry_stern; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp b/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp new file mode 100644 index 0000000..b374941 --- /dev/null +++ b/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_razorfen_kraul +SD%Complete: 50 +SDComment: +SDCategory: Razorfen Kraul +EndScriptData */ + +#include "precompiled.h" +#include "razorfen_kraul.h" + +instance_razorfen_kraul::instance_razorfen_kraul(Map* pMap) : ScriptedInstance(pMap), + m_uiAgathelosWardGUID(0), + m_uiWardKeepersRemaining(0) +{ + Initialize(); +} + +void instance_razorfen_kraul::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +} + +void instance_razorfen_kraul::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_AGATHELOS_WARD: + m_uiAgathelosWardGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + DoUseDoorOrButton(m_uiAgathelosWardGUID); + break; + } + +} + +void instance_razorfen_kraul::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_WARD_KEEPER: + ++m_uiWardKeepersRemaining; + break; + } +} + +void instance_razorfen_kraul::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_AGATHELOS: + --m_uiWardKeepersRemaining; + if (!m_uiWardKeepersRemaining) + { + m_auiEncounter[0] = uiData; + DoUseDoorOrButton(m_uiAgathelosWardGUID); + } + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + + saveStream << m_auiEncounter[0]; + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_razorfen_kraul::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_razorfen_kraul::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_AGATHELOS: + return m_auiEncounter[0]; + } + return 0; +} + +InstanceData* GetInstanceData_instance_razorfen_kraul(Map* pMap) +{ + return new instance_razorfen_kraul(pMap); +} + +void AddSC_instance_razorfen_kraul() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_razorfen_kraul"; + newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/razorfen_kraul/razorfen_kraul.h b/scripts/kalimdor/razorfen_kraul/razorfen_kraul.h new file mode 100644 index 0000000..36378b5 --- /dev/null +++ b/scripts/kalimdor/razorfen_kraul/razorfen_kraul.h @@ -0,0 +1,43 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RFK_H +#define DEF_RFK_H + +enum +{ + MAX_ENCOUNTER = 1, + + TYPE_AGATHELOS = 1, + + GO_AGATHELOS_WARD = 21099, + + NPC_WARD_KEEPER = 4625 +}; + +class MANGOS_DLL_DECL instance_razorfen_kraul : public ScriptedInstance +{ + public: + instance_razorfen_kraul(Map* pMap); + ~instance_razorfen_kraul() {} + + void Initialize(); + + void OnObjectCreate(GameObject* pGo); + void OnCreatureCreate(Creature* pCreature); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiAgathelosWardGUID; + uint8 m_uiWardKeepersRemaining; +}; +#endif diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp new file mode 100644 index 0000000..4789b02 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp @@ -0,0 +1,119 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ayamiss +SD%Complete: 50 +SDComment: VERIFY SCRIPT +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +/* +To do: +make him fly from 70-100% +*/ + +enum +{ + SPELL_STINGERSPRAY = 25749, + SPELL_POISONSTINGER = 25748, //only used in phase1 + SPELL_SUMMONSWARMER = 25844, //might be 25708 + //SPELL_PARALYZE 23414 doesnt work correct (core) + + PHASE_AIR = 0, + PHASE_GROUND = 1 +}; + +struct MANGOS_DLL_DECL boss_ayamissAI : public ScriptedAI +{ + boss_ayamissAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiStingerSprayTimer; + uint32 m_uiPoisonStingerTimer; + uint32 m_uiSummonSwarmerTimer; + uint8 m_uiPhase; + + void Reset() + { + m_uiStingerSprayTimer = 30000; + m_uiPoisonStingerTimer = 30000; + m_uiSummonSwarmerTimer = 60000; + + m_uiPhase = PHASE_AIR; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Stinger Spray + if (m_uiStingerSprayTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_STINGERSPRAY); + m_uiStingerSprayTimer = 30000; + } + else + m_uiStingerSprayTimer -= uiDiff; + + if (m_uiPhase == PHASE_AIR) + { + // Start ground phase at 70% of HP + if (m_creature->GetHealthPercent() <= 70.0f) + { + m_uiPhase = PHASE_GROUND; + DoResetThreat(); + } + + // Poison Stinger + if (m_uiPoisonStingerTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_POISONSTINGER); + m_uiPoisonStingerTimer = 30000; + } + else + m_uiPoisonStingerTimer -= uiDiff; + } + else + { + //m_uiSummonSwarmerTimer + if (m_uiSummonSwarmerTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUMMONSWARMER); + m_uiSummonSwarmerTimer = 60000; + } + else + m_uiSummonSwarmerTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; +CreatureAI* GetAI_boss_ayamiss(Creature* pCreature) +{ + return new boss_ayamissAI(pCreature); +} + +void AddSC_boss_ayamiss() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_ayamiss"; + newscript->GetAI = &GetAI_boss_ayamiss; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp new file mode 100644 index 0000000..8fe03e2 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp @@ -0,0 +1,26 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Buru +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_TARGET -1509002 diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp new file mode 100644 index 0000000..e258ddb --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp @@ -0,0 +1,97 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kurinnaxx +SD%Complete: 100 +SDComment: VERIFY SCRIPT AND SQL +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SPELL_TRASH = 3391, + SPELL_WIDE_SLASH = 25814, + SPELL_MORTAL_WOUND = 25646, + SPELL_SANDTRAP = 25656, + SPELL_ENRAGE = 28798 +}; + +struct MANGOS_DLL_DECL boss_kurinnaxxAI : public ScriptedAI +{ + boss_kurinnaxxAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiMortalWoundTimer; + uint32 m_uiSandTrapTimer; + bool m_bEnraged; + + void Reset() + { + m_bEnraged = false; + + m_uiMortalWoundTimer = 30000; + m_uiSandTrapTimer = 30000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // If we are belowe 30% HP cast enrage + if (!m_bEnraged && m_creature->GetHealthPercent() <= 30.0f) + { + m_bEnraged = true; + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ENRAGE); + } + + // Mortal Wound + if (m_uiMortalWoundTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_WOUND); + m_uiMortalWoundTimer = 30000; + } + else + m_uiMortalWoundTimer -= uiDiff; + + // Sand Trap + if (m_uiSandTrapTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SANDTRAP); + m_uiSandTrapTimer = 30000; + } + else + m_uiSandTrapTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_kurinnaxx(Creature* pCreature) +{ + return new boss_kurinnaxxAI(pCreature); +} + +void AddSC_boss_kurinnaxx() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_kurinnaxx"; + newscript->GetAI = &GetAI_boss_kurinnaxx; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp new file mode 100644 index 0000000..724de86 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp @@ -0,0 +1,174 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Moam +SD%Complete: 100 +SDComment: +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +enum +{ + EMOTE_AGGRO = -1509000, + EMOTE_MANA_FULL = -1509001, + EMOTE_ENERGIZING = -1509028, + + SPELL_TRAMPLE = 15550, + SPELL_DRAIN_MANA = 25671, + SPELL_ARCANE_ERUPTION = 25672, + SPELL_SUMMON_MANAFIEND_1 = 25681, + SPELL_SUMMON_MANAFIEND_2 = 25682, + SPELL_SUMMON_MANAFIEND_3 = 25683, + SPELL_ENERGIZE = 25685, + + PHASE_ATTACKING = 0, + PHASE_ENERGIZING = 1 +}; + +struct MANGOS_DLL_DECL boss_moamAI : public ScriptedAI +{ + boss_moamAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint8 m_uiPhase; + + uint32 m_uiTrample_Timer; + uint32 m_uiManaDrain_Timer; + uint32 m_uiCheckoutMana_Timer; + uint32 m_uiSummonManaFiends_Timer; + + void Reset() + { + m_uiTrample_Timer = 9000; + m_uiManaDrain_Timer = 3000; + m_uiSummonManaFiends_Timer = 90000; + m_uiCheckoutMana_Timer = 1500; + m_uiPhase = PHASE_ATTACKING; + m_creature->SetPower(POWER_MANA, 0); + m_creature->SetMaxPower(POWER_MANA, 0); + } + + void Aggro(Unit* pWho) + { + DoScriptText(EMOTE_AGGRO, m_creature); + m_creature->SetMaxPower(POWER_MANA, m_creature->GetCreatureInfo()->maxmana); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + switch(m_uiPhase) + { + case PHASE_ATTACKING: + if (m_uiCheckoutMana_Timer <= uiDiff) + { + m_uiCheckoutMana_Timer = 1500; + if (m_creature->GetPower(POWER_MANA) * 100 / m_creature->GetMaxPower(POWER_MANA) > 75.0f) + { + DoCastSpellIfCan(m_creature, SPELL_ENERGIZE); + DoScriptText(EMOTE_ENERGIZING, m_creature); + m_uiPhase = PHASE_ENERGIZING; + return; + } + } + else + m_uiCheckoutMana_Timer -= uiDiff; + + if (m_uiSummonManaFiends_Timer <= uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUMMON_MANAFIEND_1, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUMMON_MANAFIEND_2, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SUMMON_MANAFIEND_3, CAST_TRIGGERED); + m_uiSummonManaFiends_Timer = 90000; + } + else + m_uiSummonManaFiends_Timer -= uiDiff; + + if (m_uiManaDrain_Timer <= uiDiff) + { + m_uiManaDrain_Timer = urand(2000, 6000); + // choose random target with mana + std::list lTargets; + ThreatList const& threatlist = m_creature->getThreatManager().getThreatList(); + if (threatlist.empty()) + return; + + for (ThreatList::const_iterator itr = threatlist.begin(); itr != threatlist.end(); ++itr) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pUnit && pUnit->isAlive() && pUnit->GetPower(POWER_MANA)) + lTargets.push_back(pUnit); + } + + if (lTargets.empty()) + return; + + std::list::iterator itr = lTargets.begin(); + std::advance(itr, urand(0, lTargets.size()-1)); + + DoCastSpellIfCan(*itr, SPELL_DRAIN_MANA); + } + else + m_uiManaDrain_Timer -= uiDiff; + + if (m_uiTrample_Timer <= uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TRAMPLE); + m_uiTrample_Timer = 15000; + } + else + m_uiTrample_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + break; + case PHASE_ENERGIZING: + if (m_uiCheckoutMana_Timer <= uiDiff) + { + m_uiCheckoutMana_Timer = 1500; + if (m_creature->GetPower(POWER_MANA) == m_creature->GetMaxPower(POWER_MANA)) + { + m_creature->RemoveAurasDueToSpell(SPELL_ENERGIZE); + DoCastSpellIfCan(m_creature, SPELL_ARCANE_ERUPTION); + DoScriptText(EMOTE_MANA_FULL, m_creature); + m_uiPhase = PHASE_ATTACKING; + return; + } + } + else + m_uiCheckoutMana_Timer -= uiDiff; + break; + } + } +}; + +CreatureAI* GetAI_boss_moam(Creature* pCreature) +{ + return new boss_moamAI(pCreature); +} + +void AddSC_boss_moam() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_moam"; + newscript->GetAI = &GetAI_boss_moam; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp new file mode 100644 index 0000000..5e282f9 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ossirian +SD%Complete: 0 +SDComment: Place holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SURPREME1 -1509018 +#define SAY_SURPREME2 -1509019 +#define SAY_SURPREME3 -1509020 + +#define SAY_RAND_INTRO1 -1509021 +#define SAY_RAND_INTRO2 -1509022 +#define SAY_RAND_INTRO3 -1509023 +#define SAY_RAND_INTRO4 -1509024 //possibly old? + +#define SAY_AGGRO -1509025 + +#define SAY_SLAY -1509026 +#define SAY_DEATH -1509027 diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp new file mode 100644 index 0000000..2fe293f --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp @@ -0,0 +1,44 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Rajaxx +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_ANDOROV_INTRO -1509003 +#define SAY_ANDOROV_ATTACK -1509004 + +#define SAY_WAVE3 -1509005 +#define SAY_WAVE4 -1509006 +#define SAY_WAVE5 -1509007 +#define SAY_WAVE6 -1509008 +#define SAY_WAVE7 -1509009 +#define SAY_INTRO -1509010 + +#define SAY_UNK1 -1509011 +#define SAY_UNK2 -1509012 +#define SAY_UNK3 -1509013 +#define SAY_UNK4 -1509014 + +#define SAY_DEAGGRO -1509015 +#define SAY_KILLS_ANDOROV -1509016 + +#define SAY_COMPLETE_QUEST -1509017 //Yell when realm complete quest 8743 for world event diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp new file mode 100644 index 0000000..e033266 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Ruins_of_Ahnqiraj +SD%Complete: 80 +SDComment: +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "ruins_of_ahnqiraj.h" + + +struct MANGOS_DLL_DECL instance_ruins_of_ahnqiraj : public ScriptedInstance +{ + instance_ruins_of_ahnqiraj(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + std::string strInstData; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiOssirianGUID; + uint64 m_uiBuruGUID; + uint64 m_uiKurinnaxxGUID; + uint64 m_uiAndorovGUID; + uint64 m_uiRajaxxGUID; + uint64 m_uiQeezGUID; + uint64 m_uiTuubidGUID; + uint64 m_uiDrennGUID; + uint64 m_uiXurremGUID; + uint64 m_uiYeggethGUID; + uint64 m_uiPakkonGUID; + uint64 m_uiZerranGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiOssirianGUID = 0; + m_uiBuruGUID = 0; + m_uiKurinnaxxGUID = 0; + m_uiAndorovGUID = 0; + m_uiQeezGUID = 0; + m_uiTuubidGUID = 0; + m_uiDrennGUID = 0; + m_uiXurremGUID = 0; + m_uiYeggethGUID = 0; + m_uiPakkonGUID = 0; + m_uiZerranGUID = 0; + m_uiRajaxxGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_OSSIRIAN: m_uiOssirianGUID = pCreature->GetGUID(); break; + case NPC_BURU: m_uiBuruGUID = pCreature->GetGUID(); break; + case NPC_KURINNAXX: m_uiKurinnaxxGUID = pCreature->GetGUID(); break; + case NPC_GENERAL_ANDOROV: m_uiAndorovGUID = pCreature->GetGUID(); break; + case NPC_CAPTAIN_QEEZ: m_uiQeezGUID = pCreature->GetGUID(); break; + case NPC_CAPTAIN_TUUBID: m_uiTuubidGUID = pCreature->GetGUID(); break; + case NPC_CAPTAIN_DRENN: m_uiDrennGUID = pCreature->GetGUID(); break; + case NPC_CAPTAIN_XURREM: m_uiXurremGUID = pCreature->GetGUID(); break; + case NPC_MAJOR_YEGGETH: m_uiYeggethGUID = pCreature->GetGUID(); break; + case NPC_MAJOR_PAKKON: m_uiPakkonGUID = pCreature->GetGUID(); break; + case NPC_COLONEL_ZERRAN: m_uiZerranGUID = pCreature->GetGUID(); break; + case NPC_RAJAXX: m_uiRajaxxGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_OSSIRIAN_CRYSTAL: pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_INTERACT_COND); break; //to make them unusable temporarily + } + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + const char* Save() + { + return strInstData.c_str(); + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_OSSIRIAN: return m_uiOssirianGUID; + case DATA_BURU: return m_uiBuruGUID; + case DATA_ANDOROV: return m_uiAndorovGUID; + case DATA_KURINNAXX: return m_uiKurinnaxxGUID; + case DATA_QEEZ: return m_uiQeezGUID; + case DATA_TUUBID: return m_uiTuubidGUID; + case DATA_DRENN: return m_uiDrennGUID; + case DATA_XURREM: return m_uiXurremGUID; + case DATA_YEGGETH: return m_uiYeggethGUID; + case DATA_PAKKON: return m_uiPakkonGUID; + case DATA_ZERRAN: return m_uiZerranGUID; + case DATA_RAJAXX: return m_uiRajaxxGUID; + } + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_RAJAXX: + m_auiEncounter[0] = uiData; + break; + case TYPE_KURINNAXX: + m_auiEncounter[1] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + + //spawn andorov on load + if (m_auiEncounter[0] == DONE) + if (Creature* pRajaxx = instance->GetCreature(m_uiRajaxxGUID)) + pRajaxx->SummonCreature(NPC_GENERAL_ANDOROV, -8873.42f, 1647.67f, 21.386f, 5.69141f, TEMPSUMMON_CORPSE_DESPAWN, 0); + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_RAJAXX: + return m_auiEncounter[0]; + case TYPE_KURINNAXX: + return m_auiEncounter[1]; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_ruins_of_ahnqiraj(Map* pMap) +{ + return new instance_ruins_of_ahnqiraj(pMap); +} + +void AddSC_instance_ruins_of_ahnqiraj() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_ruins_of_ahnqiraj"; + newscript->GetInstanceData = &GetInstanceData_instance_ruins_of_ahnqiraj; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp b/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp new file mode 100644 index 0000000..bcaa515 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.cpp @@ -0,0 +1,170 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ruins of Ahn'Qiraj +SD%Complete: 40 +SDComment: +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +/* ContentData +mob_anubisath_guardian +EndContentData */ + +#include "precompiled.h" + +/*###### +## mob_anubisath_guardian +######*/ +enum +{ + SPELL_METEOR = 24340, + SPELL_PLAGUE = 22997, + SPELL_SHADOW_STORM = 26546, + SPELL_THUNDER_CLAP = 26554, + SPELL_REFLECT_ARFR = 13022, + SPELL_REFLECT_FSSH = 19595, + SPELL_ENRAGE = 8559, + SPELL_EXPLODE = 25698, + + SPELL_SUMMON_ANUB_SWARMGUARD = 17430, + SPELL_SUMMON_ANUB_WARRIOR = 17431, + + EMOTE_FRENZY = -1000002, + + NPC_ANUB_WARRIOR = 15537, + NPC_ANUB_SWARM = 15538 +}; + +struct MANGOS_DLL_DECL mob_anubisath_guardianAI : public ScriptedAI +{ + mob_anubisath_guardianAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiSpell1; + uint32 m_uiSpell2; + uint32 m_uiSpell3; + uint32 m_uiSpell4; + uint32 m_uiSpell5; + + uint32 m_uiSpell1Timer; + uint32 m_uiSpell2Timer; + uint32 m_uiSpell5Timer; + + uint8 m_uiSummonCount; + + bool m_bIsEnraged; + + void Reset() + { + m_uiSpell1 = urand(0,1) ? SPELL_METEOR : SPELL_PLAGUE; + m_uiSpell2 = urand(0,1) ? SPELL_SHADOW_STORM : SPELL_THUNDER_CLAP; + m_uiSpell3 = urand(0,1) ? SPELL_REFLECT_ARFR : SPELL_REFLECT_FSSH; + m_uiSpell4 = urand(0,1) ? SPELL_ENRAGE : SPELL_EXPLODE; + m_uiSpell5 = urand(0,1) ? SPELL_SUMMON_ANUB_SWARMGUARD : SPELL_SUMMON_ANUB_WARRIOR; + + m_uiSpell1Timer = 10000; + m_uiSpell2Timer = 20000; + m_uiSpell5Timer = 10000; + m_uiSummonCount = 0; + m_bIsEnraged = false; + } + + void Aggro(Unit* pWho) + { + // spell reflection + DoCastSpellIfCan(m_creature, m_uiSpell3); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature->getVictim()); + ++m_uiSummonCount; + } + + void SummonedCreatureDespawn(Creature* pDespawned) + { + --m_uiSummonCount; + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + // when we reach 10% of HP explode or enrage + if (!m_bIsEnraged && m_creature->GetHealthPercent() < 10.0f) + { + if (m_uiSpell4 == SPELL_ENRAGE) + { + DoScriptText(EMOTE_FRENZY, m_creature); + DoCastSpellIfCan(m_creature, m_uiSpell4); + m_bIsEnraged = true; + } + else + DoCastSpellIfCan(m_creature->getVictim(), m_uiSpell4); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Meteor or Plague + if (m_uiSpell1Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_uiSpell1); + m_uiSpell1Timer = 15000; + } + else + m_uiSpell1Timer -= uiDiff; + + // Shadow Storm or Thunder Clap + if (m_uiSpell2Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_uiSpell2); + m_uiSpell2Timer = 15000; + } + else + m_uiSpell2Timer -= uiDiff; + + // summon Anubisath Swarmguard or Anubisath Warrior + if (m_uiSpell5Timer < uiDiff) + { + // change for summon spell + if (m_uiSummonCount < 4) + DoCastSpellIfCan(m_creature->getVictim(), m_uiSpell5); + + m_uiSpell5Timer = 15000; + } + else + m_uiSpell5Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_anubisath_guardian(Creature* pCreature) +{ + return new mob_anubisath_guardianAI(pCreature); +} + +void AddSC_ruins_of_ahnqiraj() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "mob_anubisath_guardian"; + newscript->GetAI = &GetAI_mob_anubisath_guardian; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h b/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h new file mode 100644 index 0000000..7196b43 --- /dev/null +++ b/scripts/kalimdor/ruins_of_ahnqiraj/ruins_of_ahnqiraj.h @@ -0,0 +1,44 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RUINS_OF_AHNQIRAJ_H +#define DEF_RUINS_OF_AHNQIRAJ_H + +enum +{ + MAX_ENCOUNTER = 2, + + DATA_OSSIRIAN = 1, + DATA_BURU = 2, + DATA_ANDOROV = 3, + DATA_KURINNAXX = 4, + DATA_QEEZ = 5, + DATA_TUUBID = 6, + DATA_DRENN = 7, + DATA_XURREM = 8, + DATA_YEGGETH = 9, + DATA_PAKKON = 10, + DATA_ZERRAN = 11, + DATA_RAJAXX = 12, + + TYPE_RAJAXX = 13, + TYPE_KURINNAXX = 14, + + NPC_OSSIRIAN = 15339, + NPC_BURU = 15370, + NPC_KALDOREI_ELITE = 15473, + NPC_GENERAL_ANDOROV = 15471, + NPC_RAJAXX = 15341, + NPC_KURINNAXX = 15348, + NPC_COLONEL_ZERRAN = 15385, + NPC_MAJOR_PAKKON = 15388, + NPC_MAJOR_YEGGETH = 15386, + NPC_CAPTAIN_XURREM = 15390, + NPC_CAPTAIN_DRENN = 15389, + NPC_CAPTAIN_TUUBID = 15392, + NPC_CAPTAIN_QEEZ = 15391, + + GO_OSSIRIAN_CRYSTAL = 180619 +}; +#endif diff --git a/scripts/kalimdor/silithus.cpp b/scripts/kalimdor/silithus.cpp new file mode 100644 index 0000000..7b801a7 --- /dev/null +++ b/scripts/kalimdor/silithus.cpp @@ -0,0 +1,252 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Silithus +SD%Complete: 100 +SDComment: Quest support: 7785, 8304. +SDCategory: Silithus +EndScriptData */ + +/* ContentData +npc_highlord_demitrian +npcs_rutgar_and_frankal +EndContentData */ + +#include "precompiled.h" + +/*### +## npc_highlord_demitrian +###*/ + +#define GOSSIP_ITEM_DEMITRIAN1 "What do you know of it?" +#define GOSSIP_ITEM_DEMITRIAN2 "I am listening , Demitrian." +#define GOSSIP_ITEM_DEMITRIAN3 "Continue, please." +#define GOSSIP_ITEM_DEMITRIAN4 "A battle?" +#define GOSSIP_ITEM_DEMITRIAN5 "" +#define GOSSIP_ITEM_DEMITRIAN6 "Caught unaware? How?" +#define GOSSIP_ITEM_DEMITRIAN7 "So what did Ragnaros do next?" + +enum +{ + QUEST_EXAMINE_THE_VESSEL = 7785, + ITEM_BINDINGS_WINDSEEKER_LEFT = 18563, + ITEM_BINDINGS_WINDSEEKER_RIGHT = 18564, + ITEM_VESSEL_OF_REBIRTH = 19016, + GOSSIP_TEXTID_DEMITRIAN1 = 6842, + GOSSIP_TEXTID_DEMITRIAN2 = 6843, + GOSSIP_TEXTID_DEMITRIAN3 = 6844, + GOSSIP_TEXTID_DEMITRIAN4 = 6867, + GOSSIP_TEXTID_DEMITRIAN5 = 6868, + GOSSIP_TEXTID_DEMITRIAN6 = 6869, + GOSSIP_TEXTID_DEMITRIAN7 = 6870 +}; + +bool GossipHello_npc_highlord_demitrian(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_EXAMINE_THE_VESSEL) == QUEST_STATUS_NONE && + (pPlayer->HasItemCount(ITEM_BINDINGS_WINDSEEKER_LEFT,1,false) || pPlayer->HasItemCount(ITEM_BINDINGS_WINDSEEKER_RIGHT,1,false))) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_highlord_demitrian(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEMITRIAN7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN6, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEMITRIAN7, pCreature->GetGUID()); + + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(ITEM_VESSEL_OF_REBIRTH, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + + break; + } + return true; +} + +/*### +## npcs_rutgar_and_frankal +###*/ + +//gossip item text best guess +#define GOSSIP_ITEM_SEEK1 "I seek information about Natalia" + +#define GOSSIP_ITEM_RUTGAR2 "That sounds dangerous!" +#define GOSSIP_ITEM_RUTGAR3 "What did you do?" +#define GOSSIP_ITEM_RUTGAR4 "Who?" +#define GOSSIP_ITEM_RUTGAR5 "Women do that. What did she demand?" +#define GOSSIP_ITEM_RUTGAR6 "What do you mean?" +#define GOSSIP_ITEM_RUTGAR7 "What happened next?" + +#define GOSSIP_ITEM_FRANKAL11 "Yes, please continue" +#define GOSSIP_ITEM_FRANKAL12 "What language?" +#define GOSSIP_ITEM_FRANKAL13 "The Priestess attacked you?!" +#define GOSSIP_ITEM_FRANKAL14 "I should ask the monkey about this" +#define GOSSIP_ITEM_FRANKAL15 "Then what..." + +enum +{ + QUEST_DEAREST_NATALIA = 8304, + NPC_RUTGAR = 15170, + NPC_FRANKAL = 15171, + TRIGGER_RUTGAR = 15222, + TRIGGER_FRANKAL = 15221, + GOSSIP_TEXTID_RF = 7754, + GOSSIP_TEXTID_RUTGAR1 = 7755, + GOSSIP_TEXTID_RUTGAR2 = 7756, + GOSSIP_TEXTID_RUTGAR3 = 7757, + GOSSIP_TEXTID_RUTGAR4 = 7758, + GOSSIP_TEXTID_RUTGAR5 = 7759, + GOSSIP_TEXTID_RUTGAR6 = 7760, + GOSSIP_TEXTID_RUTGAR7 = 7761, + GOSSIP_TEXTID_FRANKAL1 = 7762, + GOSSIP_TEXTID_FRANKAL2 = 7763, + GOSSIP_TEXTID_FRANKAL3 = 7764, + GOSSIP_TEXTID_FRANKAL4 = 7765, + GOSSIP_TEXTID_FRANKAL5 = 7766, + GOSSIP_TEXTID_FRANKAL6 = 7767 +}; + +bool GossipHello_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_DEAREST_NATALIA) == QUEST_STATUS_INCOMPLETE && + pCreature->GetEntry() == NPC_RUTGAR && + !pPlayer->GetReqKillOrCastCurrentCount(QUEST_DEAREST_NATALIA, TRIGGER_RUTGAR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SEEK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + if (pPlayer->GetQuestStatus(QUEST_DEAREST_NATALIA) == QUEST_STATUS_INCOMPLETE && + pCreature->GetEntry() == NPC_FRANKAL && + pPlayer->GetReqKillOrCastCurrentCount(QUEST_DEAREST_NATALIA, TRIGGER_RUTGAR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SEEK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+9); + + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RF, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_rutgar_and_frankal(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTGAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTGAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTGAR4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTGAR5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTGAR6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RUTGAR7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR6, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_RUTGAR7, pCreature->GetGUID()); + //'kill' our trigger to update quest status + pPlayer->KilledMonsterCredit(TRIGGER_RUTGAR, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF + 9: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FRANKAL11, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FRANKAL1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FRANKAL12, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FRANKAL2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FRANKAL13, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FRANKAL3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FRANKAL14, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FRANKAL4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FRANKAL15, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FRANKAL5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FRANKAL6, pCreature->GetGUID()); + //'kill' our trigger to update quest status + pPlayer->KilledMonsterCredit(TRIGGER_FRANKAL, pCreature->GetGUID()); + break; + } + return true; +} + +void AddSC_silithus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_highlord_demitrian"; + newscript->pGossipHello = &GossipHello_npc_highlord_demitrian; + newscript->pGossipSelect = &GossipSelect_npc_highlord_demitrian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npcs_rutgar_and_frankal"; + newscript->pGossipHello = &GossipHello_npcs_rutgar_and_frankal; + newscript->pGossipSelect = &GossipSelect_npcs_rutgar_and_frankal; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/stonetalon_mountains.cpp b/scripts/kalimdor/stonetalon_mountains.cpp new file mode 100644 index 0000000..3944825 --- /dev/null +++ b/scripts/kalimdor/stonetalon_mountains.cpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Stonetalon_Mountains +SD%Complete: 95 +SDComment: Quest support: 6627 (Braug Dimspirits questions/'answers' might have more to it, need more info),6523 +SDCategory: Stonetalon Mountains +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_braug_dimspirit +######*/ + +bool GossipHello_npc_braug_dimspirit(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(6627) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ysera", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Neltharion", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Nozdormu", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Alexstrasza", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Malygos", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(5820, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(5819, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_braug_dimspirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,6766,false); + + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(6627); + } + return true; +} + +/*###### +## npc_kaya +######*/ + +enum +{ + NPC_GRIMTOTEM_RUFFIAN = 11910, + NPC_GRIMTOTEM_BRUTE = 11912, + NPC_GRIMTOTEM_SORCERER = 11913, + + SAY_START = -1000357, + SAY_AMBUSH = -1000358, + SAY_END = -1000359, + + QUEST_PROTECT_KAYA = 6523 +}; + +struct MANGOS_DLL_DECL npc_kayaAI : public npc_escortAI +{ + npc_kayaAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + //Ambush + case 16: + //note about event here: + //apparently NPC say _after_ the ambush is over, and is most likely a bug at you-know-where. + //we simplify this, and make say when the ambush actually start. + DoScriptText(SAY_AMBUSH, m_creature); + m_creature->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -50.75f, -500.77f, -46.13f, 0.4f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_GRIMTOTEM_BRUTE, -40.05f, -510.89f, -46.05f, 1.7f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_GRIMTOTEM_SORCERER, -32.21f, -499.20f, -45.35f, 2.8f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + break; + // Award quest credit + case 18: + DoScriptText(SAY_END, m_creature); + + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); + break; + } + } +}; + +CreatureAI* GetAI_npc_kaya(Creature* pCreature) +{ + return new npc_kayaAI(pCreature); +} + +bool QuestAccept_npc_kaya(Player* pPlayer, Creature* pCreature, Quest const* pQuest) +{ + //Casting Spell and Starting the Escort quest is buggy, so this is a hack. Use the spell when it is possible. + + if (pQuest->GetQuestId() == QUEST_PROTECT_KAYA) + { + pCreature->setFaction(FACTION_ESCORT_H_PASSIVE); + DoScriptText(SAY_START,pCreature); + + if (npc_kayaAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_stonetalon_mountains() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_braug_dimspirit"; + newscript->pGossipHello = &GossipHello_npc_braug_dimspirit; + newscript->pGossipSelect = &GossipSelect_npc_braug_dimspirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_kaya"; + newscript->GetAI = &GetAI_npc_kaya; + newscript->pQuestAccept = &QuestAccept_npc_kaya; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/tanaris.cpp b/scripts/kalimdor/tanaris.cpp new file mode 100644 index 0000000..d4aa0f3 --- /dev/null +++ b/scripts/kalimdor/tanaris.cpp @@ -0,0 +1,637 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Tanaris +SD%Complete: 80 +SDComment: Quest support: 648, 1560, 2954, 4005, 10277, 10279(Special flight path). Noggenfogger vendor +SDCategory: Tanaris +EndScriptData */ + +/* ContentData +mob_aquementas +npc_custodian_of_time +npc_marin_noggenfogger +npc_oox17tn +npc_steward_of_time +npc_stone_watcher_of_norgannon +npc_tooga +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "follower_ai.h" + +/*###### +## mob_aquementas +######*/ + +#define AGGRO_YELL_AQUE -1000168 + +#define SPELL_AQUA_JET 13586 +#define SPELL_FROST_SHOCK 15089 + +struct MANGOS_DLL_DECL mob_aquementasAI : public ScriptedAI +{ + mob_aquementasAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 SendItem_Timer; + uint32 SwitchFaction_Timer; + bool isFriendly; + + uint32 FrostShock_Timer; + uint32 AquaJet_Timer; + + void Reset() + { + SendItem_Timer = 0; + SwitchFaction_Timer = 10000; + m_creature->setFaction(35); + isFriendly = true; + + AquaJet_Timer = 5000; + FrostShock_Timer = 1000; + } + + void SendItem(Unit* receiver) + { + if (((Player*)receiver)->HasItemCount(11169,1,false) && + ((Player*)receiver)->HasItemCount(11172,11,false) && + ((Player*)receiver)->HasItemCount(11173,1,false) && + !((Player*)receiver)->HasItemCount(11522,1,true)) + { + if (Item* pItem = ((Player*)receiver)->StoreNewItemInInventorySlot(11522, 1)) + ((Player*)receiver)->SendNewItem(pItem, 1, true, false); + } + } + + void Aggro(Unit* who) + { + DoScriptText(AGGRO_YELL_AQUE, m_creature, who); + } + + void UpdateAI(const uint32 diff) + { + if (isFriendly) + { + if (SwitchFaction_Timer < diff) + { + m_creature->setFaction(91); + isFriendly = false; + }else SwitchFaction_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!isFriendly) + { + if (SendItem_Timer < diff) + { + if (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER) + SendItem(m_creature->getVictim()); + SendItem_Timer = 5000; + }else SendItem_Timer -= diff; + } + + if (FrostShock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROST_SHOCK); + FrostShock_Timer = 15000; + }else FrostShock_Timer -= diff; + + if (AquaJet_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_AQUA_JET); + AquaJet_Timer = 15000; + }else AquaJet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_aquementas(Creature* pCreature) +{ + return new mob_aquementasAI(pCreature); +} + +/*###### +## npc_custodian_of_time +######*/ + +#define WHISPER_CUSTODIAN_1 -1000217 +#define WHISPER_CUSTODIAN_2 -1000218 +#define WHISPER_CUSTODIAN_3 -1000219 +#define WHISPER_CUSTODIAN_4 -1000220 +#define WHISPER_CUSTODIAN_5 -1000221 +#define WHISPER_CUSTODIAN_6 -1000222 +#define WHISPER_CUSTODIAN_7 -1000223 +#define WHISPER_CUSTODIAN_8 -1000224 +#define WHISPER_CUSTODIAN_9 -1000225 +#define WHISPER_CUSTODIAN_10 -1000226 +#define WHISPER_CUSTODIAN_11 -1000227 +#define WHISPER_CUSTODIAN_12 -1000228 +#define WHISPER_CUSTODIAN_13 -1000229 +#define WHISPER_CUSTODIAN_14 -1000230 + +struct MANGOS_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI +{ + npc_custodian_of_timeAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(i) + { + case 0: DoScriptText(WHISPER_CUSTODIAN_1, m_creature, pPlayer); break; + case 1: DoScriptText(WHISPER_CUSTODIAN_2, m_creature, pPlayer); break; + case 2: DoScriptText(WHISPER_CUSTODIAN_3, m_creature, pPlayer); break; + case 3: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 5: DoScriptText(WHISPER_CUSTODIAN_5, m_creature, pPlayer); break; + case 6: DoScriptText(WHISPER_CUSTODIAN_6, m_creature, pPlayer); break; + case 7: DoScriptText(WHISPER_CUSTODIAN_7, m_creature, pPlayer); break; + case 8: DoScriptText(WHISPER_CUSTODIAN_8, m_creature, pPlayer); break; + case 9: DoScriptText(WHISPER_CUSTODIAN_9, m_creature, pPlayer); break; + case 10: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 13: DoScriptText(WHISPER_CUSTODIAN_10, m_creature, pPlayer); break; + case 14: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 16: DoScriptText(WHISPER_CUSTODIAN_11, m_creature, pPlayer); break; + case 17: DoScriptText(WHISPER_CUSTODIAN_12, m_creature, pPlayer); break; + case 18: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 22: DoScriptText(WHISPER_CUSTODIAN_13, m_creature, pPlayer); break; + case 23: DoScriptText(WHISPER_CUSTODIAN_4, m_creature, pPlayer); break; + case 24: + DoScriptText(WHISPER_CUSTODIAN_14, m_creature, pPlayer); + DoCastSpellIfCan(pPlayer, 34883); + //below here is temporary workaround, to be removed when spell works properly + pPlayer->AreaExploredOrEventHappens(10277); + break; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (((Player*)who)->HasAura(34877, EFFECT_INDEX_1) && ((Player*)who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0; + + if (m_creature->IsWithinDistInMap(who, Radius)) + Start(false, who->GetGUID()); + } + } + } + + void Reset() { } +}; + +CreatureAI* GetAI_npc_custodian_of_time(Creature* pCreature) +{ + return new npc_custodian_of_timeAI(pCreature); +} + +/*###### +## npc_marin_noggenfogger +######*/ + +bool GossipHello_npc_marin_noggenfogger(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetQuestRewardStatus(2662)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_marin_noggenfogger(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_oox17tn +######*/ + +enum +{ + SAY_OOX_START = -1000287, + SAY_OOX_AGGRO1 = -1000288, + SAY_OOX_AGGRO2 = -1000289, + SAY_OOX_AMBUSH = -1000290, + SAY_OOX17_AMBUSH_REPLY = -1000291, + SAY_OOX_END = -1000292, + + QUEST_RESCUE_OOX_17TN = 648, + + NPC_SCORPION = 7803, + NPC_SCOFFLAW = 7805, + NPC_SHADOW_MAGE = 5617 +}; + +struct MANGOS_DLL_DECL npc_oox17tnAI : public npc_escortAI +{ + npc_oox17tnAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch (i) + { + //1. Ambush: 3 scorpions + case 22: + DoScriptText(SAY_OOX_AMBUSH, m_creature); + m_creature->SummonCreature(NPC_SCORPION, -8340.70f, -4448.17f, 9.17f, 3.10f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SCORPION, -8343.18f, -4444.35f, 9.44f, 2.35f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SCORPION, -8348.70f, -4457.80f, 9.58f, 2.02f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + break; + //2. Ambush: 2 Rogues & 1 Shadow Mage + case 28: + DoScriptText(SAY_OOX_AMBUSH, m_creature); + + m_creature->SummonCreature(NPC_SCOFFLAW, -7488.02f, -4786.56f, 10.67f, 3.74f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); + m_creature->SummonCreature(NPC_SHADOW_MAGE, -7486.41f, -4791.55f, 10.54f, 3.26f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + + if (Creature* pCreature = m_creature->SummonCreature(NPC_SCOFFLAW, -7488.47f, -4800.77f, 9.77f, 2.50f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000)) + DoScriptText(SAY_OOX17_AMBUSH_REPLY,pCreature); + + break; + case 34: + DoScriptText(SAY_OOX_END, m_creature); + // Award quest credit + pPlayer->GroupEventHappens(QUEST_RESCUE_OOX_17TN, m_creature); + break; + } + } + + void Reset() { } + + void Aggro(Unit* who) + { + //For an small probability he say something when it aggros + switch(urand(0, 9)) + { + case 0: DoScriptText(SAY_OOX_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_OOX_AGGRO2, m_creature); break; + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_oox17tn(Creature* pCreature) +{ + return new npc_oox17tnAI(pCreature); +} + +bool QuestAccept_npc_oox17tn(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESCUE_OOX_17TN) + { + DoScriptText(SAY_OOX_START, pCreature); + + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORT_A_PASSIVE); + + if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORT_H_PASSIVE); + + if (npc_oox17tnAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## npc_steward_of_time +######*/ + +#define GOSSIP_ITEM_FLIGHT "Please take me to the master's lair." + +bool GossipHello_npc_steward_of_time(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10279) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestRewardStatus(10279)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9978, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(9977, pCreature->GetGUID()); + + return true; +} + +bool QuestAccept_npc_steward_of_time(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == 10279) //Quest: To The Master's Lair + pPlayer->CastSpell(pPlayer,34891,true); //(Flight through Caverns) + + return false; +} + +bool GossipSelect_npc_steward_of_time(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CastSpell(pPlayer,34891,true); //(Flight through Caverns) + + return true; +} + +/*###### +## npc_stone_watcher_of_norgannon +######*/ + +#define GOSSIP_ITEM_NORGANNON_1 "What function do you serve?" +#define GOSSIP_ITEM_NORGANNON_2 "What are the Plates of Uldum?" +#define GOSSIP_ITEM_NORGANNON_3 "Where are the Plates of Uldum?" +#define GOSSIP_ITEM_NORGANNON_4 "Excuse me? We've been \"reschedueled for visitations\"? What does that mean?!" +#define GOSSIP_ITEM_NORGANNON_5 "So, what's inside Uldum?" +#define GOSSIP_ITEM_NORGANNON_6 "I will return when i have the Plates of Uldum." + +bool GossipHello_npc_stone_watcher_of_norgannon(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(2954) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(1674, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_stone_watcher_of_norgannon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1675, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(1676, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(1677, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(1678, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NORGANNON_6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(1679, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(2954); + break; + } + return true; +} + +/*#### +# npc_tooga +####*/ + +enum +{ + SAY_TOOG_THIRST = -1000391, + SAY_TOOG_WORRIED = -1000392, + SAY_TOOG_POST_1 = -1000393, + SAY_TORT_POST_2 = -1000394, + SAY_TOOG_POST_3 = -1000395, + SAY_TORT_POST_4 = -1000396, + SAY_TOOG_POST_5 = -1000397, + SAY_TORT_POST_6 = -1000398, + + QUEST_TOOGA = 1560, + NPC_TORTA = 6015, + + POINT_ID_TO_WATER = 1 +}; + +const float m_afToWaterLoc[] = {-7032.664551f, -4906.199219f, -1.606446f}; + +struct MANGOS_DLL_DECL npc_toogaAI : public FollowerAI +{ + npc_toogaAI(Creature* pCreature) : FollowerAI(pCreature) { Reset(); } + + uint32 m_uiCheckSpeechTimer; + uint32 m_uiPostEventTimer; + uint32 m_uiPhasePostEvent; + + Unit* pTorta; + + void Reset() + { + m_uiCheckSpeechTimer = 2500; + m_uiPostEventTimer = 1000; + m_uiPhasePostEvent = 0; + + pTorta = NULL; + } + + void MoveInLineOfSight(Unit* pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE | STATE_FOLLOW_POSTEVENT) && pWho->GetEntry() == NPC_TORTA) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) + { + if (Player* pPlayer = GetLeaderForFollower()) + { + if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_TOOGA, m_creature); + } + + pTorta = pWho; + SetFollowComplete(true); + } + } + } + + void MovementInform(uint32 uiMotionType, uint32 uiPointId) + { + FollowerAI::MovementInform(uiMotionType, uiPointId); + + if (uiMotionType != POINT_MOTION_TYPE) + return; + + if (uiPointId == POINT_ID_TO_WATER) + SetFollowComplete(); + } + + void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + //we are doing the post-event, or... + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + if (m_uiPostEventTimer < uiDiff) + { + m_uiPostEventTimer = 5000; + + if (!pTorta || !pTorta->isAlive()) + { + //something happened, so just complete + SetFollowComplete(); + return; + } + + switch(m_uiPhasePostEvent) + { + case 1: + DoScriptText(SAY_TOOG_POST_1, m_creature); + break; + case 2: + DoScriptText(SAY_TORT_POST_2, pTorta); + break; + case 3: + DoScriptText(SAY_TOOG_POST_3, m_creature); + break; + case 4: + DoScriptText(SAY_TORT_POST_4, pTorta); + break; + case 5: + DoScriptText(SAY_TOOG_POST_5, m_creature); + break; + case 6: + DoScriptText(SAY_TORT_POST_6, pTorta); + m_creature->GetMotionMaster()->MovePoint(POINT_ID_TO_WATER, m_afToWaterLoc[0], m_afToWaterLoc[1], m_afToWaterLoc[2]); + break; + } + + ++m_uiPhasePostEvent; + } + else + m_uiPostEventTimer -= uiDiff; + } + //...we are doing regular speech check + else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + { + if (m_uiCheckSpeechTimer < uiDiff) + { + m_uiCheckSpeechTimer = 5000; + + switch(urand(0, 50)) + { + case 10: DoScriptText(SAY_TOOG_THIRST, m_creature); break; + case 25: DoScriptText(SAY_TOOG_WORRIED, m_creature); break; + } + } + else + m_uiCheckSpeechTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_tooga(Creature* pCreature) +{ + return new npc_toogaAI(pCreature); +} + +bool QuestAccept_npc_tooga(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_TOOGA) + { + if (npc_toogaAI* pToogaAI = dynamic_cast(pCreature->AI())) + pToogaAI->StartFollow(pPlayer, FACTION_ESCORT_N_FRIEND_PASSIVE, pQuest); + } + + return true; +} + +void AddSC_tanaris() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_aquementas"; + newscript->GetAI = &GetAI_mob_aquementas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_custodian_of_time"; + newscript->GetAI = &GetAI_npc_custodian_of_time; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_marin_noggenfogger"; + newscript->pGossipHello = &GossipHello_npc_marin_noggenfogger; + newscript->pGossipSelect = &GossipSelect_npc_marin_noggenfogger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_oox17tn"; + newscript->GetAI = &GetAI_npc_oox17tn; + newscript->pQuestAccept = &QuestAccept_npc_oox17tn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_steward_of_time"; + newscript->pGossipHello = &GossipHello_npc_steward_of_time; + newscript->pGossipSelect = &GossipSelect_npc_steward_of_time; + newscript->pQuestAccept = &QuestAccept_npc_steward_of_time; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_stone_watcher_of_norgannon"; + newscript->pGossipHello = &GossipHello_npc_stone_watcher_of_norgannon; + newscript->pGossipSelect = &GossipSelect_npc_stone_watcher_of_norgannon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tooga"; + newscript->GetAI = &GetAI_npc_tooga; + newscript->pQuestAccept = &QuestAccept_npc_tooga; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/teldrassil.cpp b/scripts/kalimdor/teldrassil.cpp new file mode 100644 index 0000000..febc5ae --- /dev/null +++ b/scripts/kalimdor/teldrassil.cpp @@ -0,0 +1,113 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Teldrassil +SD%Complete: 100 +SDComment: Quest support: 938 +SDCategory: Teldrassil +EndScriptData */ + +/* ContentData +npc_mist +EndContentData */ + +#include "precompiled.h" +#include "follower_ai.h" + +/*#### +# npc_mist +####*/ + +enum +{ + SAY_AT_HOME = -1000323, + EMOTE_AT_HOME = -1000324, + QUEST_MIST = 938, + NPC_ARYNIA = 3519, + FACTION_DARNASSUS = 79 +}; + +struct MANGOS_DLL_DECL npc_mistAI : public FollowerAI +{ + npc_mistAI(Creature* pCreature) : FollowerAI(pCreature) { Reset(); } + + void Reset() { } + + void MoveInLineOfSight(Unit *pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_ARYNIA) + { + if (m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + DoScriptText(SAY_AT_HOME, pWho); + DoComplete(); + } + } + } + + void DoComplete() + { + DoScriptText(EMOTE_AT_HOME, m_creature); + + if (Player* pPlayer = GetLeaderForFollower()) + { + if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_MIST, m_creature); + } + + //The follow is over (and for later development, run off to the woods before really end) + SetFollowComplete(); + } + + //call not needed here, no known abilities + /*void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + }*/ +}; + +CreatureAI* GetAI_npc_mist(Creature* pCreature) +{ + return new npc_mistAI(pCreature); +} + +bool QuestAccept_npc_mist(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MIST) + { + if (npc_mistAI* pMistAI = dynamic_cast(pCreature->AI())) + pMistAI->StartFollow(pPlayer, FACTION_DARNASSUS, pQuest); + } + + return true; +} + +void AddSC_teldrassil() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_mist"; + newscript->GetAI = &GetAI_npc_mist; + newscript->pQuestAccept = &QuestAccept_npc_mist; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp new file mode 100644 index 0000000..90edbfd --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -0,0 +1,332 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio +SD%Complete: 100 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "temple_of_ahnqiraj.h" + +#define SPELL_CLEAVE 26350 +#define SPELL_TOXIC_VOLLEY 25812 +#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg. +#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors. + +#define SPELL_CHARGE 26561 +#define SPELL_KNOCKBACK 26027 + +#define SPELL_HEAL 25807 +#define SPELL_FEAR 19408 + +struct MANGOS_DLL_DECL boss_kriAI : public ScriptedAI +{ + boss_kriAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Cleave_Timer; + uint32 ToxicVolley_Timer; + uint32 Check_Timer; + + bool VemDead; + bool Death; + + void Reset() + { + Cleave_Timer = urand(4000, 8000); + ToxicVolley_Timer = urand(6000, 12000); + Check_Timer = 2000; + + VemDead = false; + Death = false; + } + + void JustDied(Unit* killer) + { + if (m_pInstance) + { + if (m_pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + m_pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + } + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = urand(5000, 12000); + }else Cleave_Timer -= diff; + + //ToxicVolley_Timer + if (ToxicVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_TOXIC_VOLLEY); + ToxicVolley_Timer = urand(10000, 15000); + }else ToxicVolley_Timer -= diff; + + if (m_creature->GetHealthPercent() < 5.0f && !Death) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_POISON_CLOUD); + Death = true; + } + + if (!VemDead) + { + //Checking if Vem is dead. If yes we will enrage. + if (Check_Timer < diff) + { + if (m_pInstance && m_pInstance->GetData(TYPE_VEM) == DONE) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + VemDead = true; + } + Check_Timer = 2000; + }else Check_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_vemAI : public ScriptedAI +{ + boss_vemAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Charge_Timer; + uint32 KnockBack_Timer; + uint32 Enrage_Timer; + + bool Enraged; + + void Reset() + { + Charge_Timer = urand(15000, 27000); + KnockBack_Timer = urand(8000, 20000); + Enrage_Timer = 120000; + + Enraged = false; + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + { + m_pInstance->SetData(TYPE_VEM, DONE); + + // Unlootable if death + if (m_pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + m_pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_CHARGE); + + Charge_Timer = urand(8000, 16000); + }else Charge_Timer -= diff; + + //KnockBack_Timer + if (KnockBack_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKBACK); + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(),-80); + KnockBack_Timer = urand(15000, 25000); + }else KnockBack_Timer -= diff; + + //Enrage_Timer + if (!Enraged && Enrage_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Charge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_yaujAI : public ScriptedAI +{ + boss_yaujAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Heal_Timer; + uint32 Fear_Timer; + uint32 Check_Timer; + + bool VemDead; + + void Reset() + { + Heal_Timer = urand(25000, 40000); + Fear_Timer = urand(12000, 24000); + Check_Timer = 2000; + + VemDead = false; + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + { + if (m_pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + m_pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + + for(int i = 0; i < 10; ++i) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); + if (Summoned && target) + Summoned->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FEAR); + DoResetThreat(); + Fear_Timer = 20000; + }else Fear_Timer -= diff; + + //Casting Heal to other twins or herself. + if (Heal_Timer < diff) + { + if (m_pInstance) + { + Creature *pKri = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_KRI)); + Creature *pVem = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_VEM)); + + switch(urand(0, 2)) + { + case 0: + if (pKri) + DoCastSpellIfCan(pKri, SPELL_HEAL); + break; + case 1: + if (pVem) + DoCastSpellIfCan(pVem, SPELL_HEAL); + break; + case 2: + DoCastSpellIfCan(m_creature, SPELL_HEAL); + break; + } + } + + Heal_Timer = urand(15000, 30000); + }else Heal_Timer -= diff; + + //Checking if Vem is dead. If yes we will enrage. + if (Check_Timer < diff) + { + if (!VemDead) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_VEM) == DONE) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + VemDead = true; + } + } + } + Check_Timer = 2000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_yauj(Creature* pCreature) +{ + return new boss_yaujAI(pCreature); +} + +CreatureAI* GetAI_boss_vem(Creature* pCreature) +{ + return new boss_vemAI(pCreature); +} + +CreatureAI* GetAI_boss_kri(Creature* pCreature) +{ + return new boss_kriAI(pCreature); +} + +void AddSC_bug_trio() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kri"; + newscript->GetAI = &GetAI_boss_kri; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_vem"; + newscript->GetAI = &GetAI_boss_vem; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_yauj"; + newscript->GetAI = &GetAI_boss_yauj; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp new file mode 100644 index 0000000..274d8a6 --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp @@ -0,0 +1,1355 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Cthun +SD%Complete: 95 +SDComment: Darkglare tracking issue +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "temple_of_ahnqiraj.h" + +//Text emote +#define EMOTE_WEAKENED -1531011 + +#define PI 3.14 + +//****** Out of Combat ****** +//Random Wispers - No txt only sound +#define RANDOM_SOUND_WHISPER 8663 + +//***** Phase 1 ******** + +//Mobs +#define BOSS_EYE_OF_CTHUN 15589 +#define MOB_CLAW_TENTACLE 15725 +#define MOB_EYE_TENTACLE 15726 +#define MOB_SMALL_PORTAL 15904 + +//Eye Spells +#define SPELL_GREEN_BEAM 26134 +#define SPELL_DARK_GLARE 26029 +#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar + +//Eye Tentacles Spells +#define SPELL_MIND_FLAY 26143 + +//Claw Tentacles Spells +#define SPELL_GROUND_RUPTURE 26139 +#define SPELL_HAMSTRING 26141 + +#define MOB_ + +//*****Phase 2****** +//Body spells +//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs +#define SPELL_TRANSFORM 26232 + +//Eye Tentacles Spells +//SAME AS PHASE1 + +//Giant Claw Tentacles +#define SPELL_MASSIVE_GROUND_RUPTURE 26100 + +//Also casts Hamstring +#define SPELL_THRASH 3391 + +//Giant Eye Tentacles +//CHAIN CASTS "SPELL_GREEN_BEAM" + +//Stomach Spells +#define SPELL_MOUTH_TENTACLE 26332 +#define SPELL_EXIT_STOMACH_KNOCKBACK 25383 +#define SPELL_DIGESTIVE_ACID 26476 + +//Mobs +#define MOB_BODY_OF_CTHUN 15809 +#define MOB_GIANT_CLAW_TENTACLE 15728 +#define MOB_GIANT_EYE_TENTACLE 15334 +#define MOB_FLESH_TENTACLE 15802 +#define MOB_GIANT_PORTAL 15910 + +//Stomach Teleport positions +#define STOMACH_X -8562.0f +#define STOMACH_Y 2037.0f +#define STOMACH_Z -70.0f +#define STOMACH_O 5.05f + +//Flesh tentacle positions +#define TENTACLE_POS1_X -8571.0f +#define TENTACLE_POS1_Y 1990.0f +#define TENTACLE_POS1_Z -98.0f +#define TENTACLE_POS1_O 1.22f + +#define TENTACLE_POS2_X -8525.0f +#define TENTACLE_POS2_Y 1994.0f +#define TENTACLE_POS2_Z -98.0f +#define TENTACLE_POS2_O 2.12f + +//Kick out position +#define KICK_X -8545.0f +#define KICK_Y 1984.0f +#define KICK_Z -96.0f + +struct MANGOS_DLL_DECL flesh_tentacleAI : public ScriptedAI +{ + flesh_tentacleAI(Creature* pCreature) : ScriptedAI(pCreature), Parent(0) + { + SetCombatMovement(false); + Reset(); + } + + uint64 Parent; + uint32 CheckTimer; + + void SpawnedByCthun(uint64 p) + { + Parent = p; + } + + void Reset() + { + CheckTimer = 1000; + } + + void UpdateAI(const uint32 diff); + + void JustDied(Unit* killer); +}; + +struct MANGOS_DLL_DECL eye_of_cthunAI : public ScriptedAI +{ + eye_of_cthunAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + if (!m_pInstance) + error_log("SD2: No Instance eye_of_cthunAI"); + + Reset(); + } + + ScriptedInstance* m_pInstance; + + //Global variables + uint32 PhaseTimer; + + //Eye beam phase + uint32 BeamTimer; + uint32 EyeTentacleTimer; + uint32 ClawTentacleTimer; + + //Dark Glare phase + uint32 DarkGlareTick; + uint32 DarkGlareTickTimer; + float DarkGlareAngle; + bool ClockWise; + + void Reset() + { + //Phase information + PhaseTimer = 50000; //First dark glare in 50 seconds + + //Eye beam phase 50 seconds + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) + + //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) + DarkGlareTick = 0; + DarkGlareTickTimer = 1000; + DarkGlareAngle = 0; + ClockWise = false; + + //Reset flags + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Reset Phase + if (m_pInstance) + m_pInstance->SetData(TYPE_CTHUN_PHASE, 0); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void SpawnEyeTentacle(float x, float y) + { + Creature* Spawned; + Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + if (Spawned) + { + Unit* target; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + if (target) + Spawned->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //No instance + if (!m_pInstance) + return; + + switch (m_pInstance->GetData(TYPE_CTHUN_PHASE)) + { + case 0: + { + //BeamTimer + if (BeamTimer < diff) + { + //SPELL_GREEN_BEAM + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(target,SPELL_GREEN_BEAM); + + //Correctly update our target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + } + + //Beam every 3 seconds + BeamTimer = 3000; + }else BeamTimer -= diff; + + //ClawTentacleTimer + if (ClawTentacleTimer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + { + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = (Creature*)m_creature->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One claw tentacle every 12.5 seconds + ClawTentacleTimer = 12500; + }else ClawTentacleTimer -= diff; + + //EyeTentacleTimer + if (EyeTentacleTimer < diff) + { + //Spawn the 8 Eye Tentacles in the corret spots + SpawnEyeTentacle(0, 20); //south + SpawnEyeTentacle(10, 10); //south west + SpawnEyeTentacle(20, 0); //west + SpawnEyeTentacle(10, -10); //north west + + SpawnEyeTentacle(0, -20); //north + SpawnEyeTentacle(-10, -10); //north east + SpawnEyeTentacle(-20, 0); // east + SpawnEyeTentacle(-10, 10); // south east + + //No point actually putting a timer here since + //These shouldn't trigger agian until after phase shifts + EyeTentacleTimer = 45000; + }else EyeTentacleTimer -= diff; + + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch to Dark Beam + m_pInstance->SetData(TYPE_CTHUN_PHASE, 1); + + m_creature->InterruptNonMeleeSpells(false); + + //Select random target for dark beam to start on + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + if (target) + { + //Correctly update our target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + + //Face our target + DarkGlareAngle = m_creature->GetAngle(target); + DarkGlareTickTimer = 1000; + DarkGlareTick = 0; + ClockWise = urand(0, 1); + } + + //Add red coloration to C'thun + DoCastSpellIfCan(m_creature,SPELL_RED_COLORATION); + + //Freeze animation + + //Darkbeam for 35 seconds + PhaseTimer = 35000; + }else PhaseTimer -= diff; + + } + break; + case 1: + { + //EyeTentacleTimer + if (DarkGlareTick < 35) + if (DarkGlareTickTimer < diff) + { + //Remove any target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Set angle and cast + if (ClockWise) + m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35)); + else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35)); + + m_creature->StopMoving(); + + //Actual dark glare cast, maybe something missing here? + m_creature->CastSpell(NULL, SPELL_DARK_GLARE, false); + + //Increase tick + ++DarkGlareTick; + + //1 second per tick + DarkGlareTickTimer = 1000; + }else DarkGlareTickTimer -= diff; + + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch to Eye Beam + m_pInstance->SetData(TYPE_CTHUN_PHASE, 0); + + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) + + m_creature->InterruptNonMeleeSpells(false); + + //Remove Red coloration from c'thun + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Freeze animation + m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); + + //Eye Beam for 50 seconds + PhaseTimer = 50000; + }else PhaseTimer -= diff; + }break; + + //Transition phase + case 2: + { + //Remove any target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetHealth(0); + } + + //Dead phase + case 5: + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + //No instance + if (!m_pInstance) + return; + + switch (m_pInstance->GetData(TYPE_CTHUN_PHASE)) + { + case 0: + case 1: + { + //Only if it will kill + if (damage < m_creature->GetHealth()) + return; + + //Fake death in phase 0 or 1 (green beam or dark glare phase) + m_creature->InterruptNonMeleeSpells(false); + + //Remove Red coloration from c'thun + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Reset to normal emote state and prevent select and attack + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Remove Target field + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Death animation/respawning; + m_pInstance->SetData(TYPE_CTHUN_PHASE, 2); + + m_creature->SetHealth(0); + damage = 0; + + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + } + break; + + case 5: + { + //Allow death here + return; + } + + default: + { + //Prevent death in this phase + damage = 0; + return; + } + break; + } + } +}; + +struct MANGOS_DLL_DECL cthunAI : public ScriptedAI +{ + cthunAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + if (!m_pInstance) + error_log("SD2: No Instance eye_of_cthunAI"); + + Reset(); + } + + ScriptedInstance* m_pInstance; + + //Out of combat whisper timer + uint32 WisperTimer; + + //Global variables + uint32 PhaseTimer; + + //------------------- + + //Phase transition + uint64 HoldPlayer; + + //Body Phase + uint32 EyeTentacleTimer; + uint8 FleshTentaclesKilled; + uint32 GiantClawTentacleTimer; + uint32 GiantEyeTentacleTimer; + uint32 StomachAcidTimer; + uint32 StomachEnterTimer; + uint32 StomachEnterVisTimer; + uint64 StomachEnterTarget; + + //Stomach map, bool = true then in stomach + UNORDERED_MAP Stomach_Map; + + void Reset() + { + //One random wisper every 90 - 300 seconds + WisperTimer = 90000; + + //Phase information + PhaseTimer = 10000; //Emerge in 10 seconds + + //No hold player for transition + HoldPlayer = 0; + + //Body Phase + EyeTentacleTimer = 30000; + FleshTentaclesKilled = 0; + GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) + GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) + StomachAcidTimer = 4000; //Every 4 seconds + StomachEnterTimer = 10000; //Every 10 seconds + StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer + StomachEnterTarget = 0; //Target to be teleported to stomach + + //Clear players in stomach and outside + Stomach_Map.clear(); + + //Reset flags + m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_CTHUN_PHASE, 0); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void SpawnEyeTentacle(float x, float y) + { + Creature* Spawned; + Spawned = (Creature*)m_creature->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + if (Spawned) + { + Unit* target; + + target = SelectRandomNotStomach(); + + if (target) + Spawned->AI()->AttackStart(target); + } + } + + Unit* SelectRandomNotStomach() + { + if (Stomach_Map.empty()) + return NULL; + + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + std::list temp; + std::list::iterator j; + + //Get all players in map + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = m_creature->GetMap()->GetUnit(i->first); + + //Only units out of stomach + if (pUnit && i->second == false) + { + temp.push_back(pUnit); + } + ++i; + } + + if (temp.empty()) + return NULL; + + j = temp.begin(); + + //Get random but only if we have more than one unit on threat list + if (temp.size() > 1) + advance (j , rand() % (temp.size() - 1)); + + return (*j); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + //No target so we'll use this section to do our random wispers instance wide + //WisperTimer + if (WisperTimer < diff) + { + Map *map = m_creature->GetMap(); + if (!map->IsDungeon()) + return; + + //Play random sound to the zone + Map::PlayerList const &PlayerList = map->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + { + if (Player* pPlr = itr->getSource()) + pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr); + } + } + + //One random wisper every 90 - 300 seconds + WisperTimer = urand(90000, 300000); + }else WisperTimer -= diff; + + return; + } + + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //No instance + if (!m_pInstance) + return; + + switch (m_pInstance->GetData(TYPE_CTHUN_PHASE)) + { + //Transition phase + case 2: + { + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch + m_pInstance->SetData(TYPE_CTHUN_PHASE, 3); + + //Switch to c'thun model + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_TRANSFORM); + m_creature->SetHealth(m_creature->GetMaxHealth()); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Emerging phase + m_creature->SetInCombatWithZone(); + + //Place all units in threat list on outside of stomach + Stomach_Map.clear(); + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + //Outside stomach + Stomach_Map[(*i)->getUnitGuid()] = false; + } + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + //Spawn flesh tentacle + Creature* pSpawned = m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!pSpawned) + ++FleshTentaclesKilled; + else + { + if (flesh_tentacleAI* pTentacleAI = dynamic_cast(pSpawned->AI())) + pTentacleAI->SpawnedByCthun(m_creature->GetGUID()); + } + + //Spawn flesh tentacle + pSpawned = m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!pSpawned) + ++FleshTentaclesKilled; + else + { + if (flesh_tentacleAI* pTentacleAI = dynamic_cast(pSpawned->AI())) + pTentacleAI->SpawnedByCthun(m_creature->GetGUID()); + } + + PhaseTimer = 0; + }else PhaseTimer -= diff; + + }break; + + //Body Phase + case 3: + { + //Remove Target field + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Weaken + if (FleshTentaclesKilled > 1) + { + m_pInstance->SetData(TYPE_CTHUN_PHASE, 4); + + DoScriptText(EMOTE_WEAKENED, m_creature); + PhaseTimer = 45000; + + DoCastSpellIfCan(m_creature, SPELL_RED_COLORATION, CAST_TRIGGERED); + + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + //Kick all players out of stomach + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = m_creature->GetMap()->GetUnit(i->first); + + //Only move units in stomach + if (pUnit && i->second == true) + { + //Teleport each player out + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); + + //Cast knockback on them + DoCastSpellIfCan(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, CAST_TRIGGERED); + + //Remove the acid debuff + pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + ++i; + } + + return; + } + + //Stomach acid + if (StomachAcidTimer < diff) + { + //Apply aura to all players in stomach + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = m_creature->GetMap()->GetUnit(i->first); + + //Only apply to units in stomach + if (pUnit && i->second == true) + { + //Cast digestive acid on them + DoCastSpellIfCan(pUnit, SPELL_DIGESTIVE_ACID, CAST_TRIGGERED); + + //Check if player should be kicked from stomach + if (pUnit->IsWithinDist3d(KICK_X, KICK_Y, KICK_Z, 15.0f)) + { + //Teleport each player out + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); + + //Cast knockback on them + DoCastSpellIfCan(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, CAST_TRIGGERED); + + //Remove the acid debuff + pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + } + ++i; + } + + StomachAcidTimer = 4000; + }else StomachAcidTimer -= diff; + + //Stomach Enter Timer + if (StomachEnterTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + + if (target) + { + //Set target in stomach + Stomach_Map[target->GetGUID()] = true; + target->InterruptNonMeleeSpells(false); + target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID()); + StomachEnterTarget = target->GetGUID(); + StomachEnterVisTimer = 3800; + } + + StomachEnterTimer = 13800; + }else StomachEnterTimer -= diff; + + if (StomachEnterVisTimer && StomachEnterTarget) + if (StomachEnterVisTimer <= diff) + { + //Check for valid player + Unit* pUnit = m_creature->GetMap()->GetUnit(StomachEnterTarget); + + if (pUnit) + { + DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); + } + + StomachEnterTarget = 0; + StomachEnterVisTimer = 0; + }else StomachEnterVisTimer -= diff; + + //GientClawTentacleTimer + if (GiantClawTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + if (target) + { + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One giant claw tentacle every minute + GiantClawTentacleTimer = 60000; + }else GiantClawTentacleTimer -= diff; + + //GiantEyeTentacleTimer + if (GiantEyeTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + if (target) + { + + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = (Creature*)m_creature->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One giant eye tentacle every minute + GiantEyeTentacleTimer = 60000; + }else GiantEyeTentacleTimer -= diff; + + //EyeTentacleTimer + if (EyeTentacleTimer < diff) + { + //Spawn the 8 Eye Tentacles in the corret spots + SpawnEyeTentacle(0, 25); //south + SpawnEyeTentacle(12, 12); //south west + SpawnEyeTentacle(25, 0); //west + SpawnEyeTentacle(12, -12); //north west + + SpawnEyeTentacle(0, -25); //north + SpawnEyeTentacle(-12, -12); //north east + SpawnEyeTentacle(-25, 0); // east + SpawnEyeTentacle(-12, 12); // south east + + //These spawn at every 30 seconds + EyeTentacleTimer = 30000; + }else EyeTentacleTimer -= diff; + + }break; + + //Weakened state + case 4: + { + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch + m_pInstance->SetData(TYPE_CTHUN_PHASE, 3); + + //Remove red coloration + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + //Spawn flesh tentacle + Creature* pSpawned = m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!pSpawned) + ++FleshTentaclesKilled; + else + { + if (flesh_tentacleAI* pTentacleAI = dynamic_cast(pSpawned->AI())) + pTentacleAI->SpawnedByCthun(m_creature->GetGUID()); + } + + //Spawn flesh tentacle + pSpawned = m_creature->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!pSpawned) + ++FleshTentaclesKilled; + else + { + if (flesh_tentacleAI* pTentacleAI = dynamic_cast(pSpawned->AI())) + pTentacleAI->SpawnedByCthun(m_creature->GetGUID()); + } + + PhaseTimer = 0; + }else PhaseTimer -= diff; + } + } + } + + void JustDied(Unit* pKiller) + { + //Switch + if (m_pInstance) + m_pInstance->SetData(TYPE_CTHUN_PHASE, 5); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + //No instance + if (!m_pInstance) + return; + + switch (m_pInstance->GetData(TYPE_CTHUN_PHASE)) + { + case 3: + { + //Not weakened so reduce damage by 99% + if (damage / 99 > 0) damage/= 99; + else damage = 1; + + //Prevent death in non-weakened state + if (damage >= m_creature->GetHealth()) + damage = 0; + + return; + } + break; + + case 4: + { + //Weakened - takes normal damage + return; + } + + default: + damage = 0; + break; + } + } + + void FleshTentcleKilled() + { + ++FleshTentaclesKilled; + } +}; + +struct MANGOS_DLL_DECL eye_tentacleAI : public ScriptedAI +{ + eye_tentacleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 MindflayTimer; + uint32 KillSelfTimer; + uint64 Portal; + + void JustDied(Unit*) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(Portal)) + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //Mind flay half a second after we spawn + MindflayTimer = 500; + + //This prevents eyes from overlapping + KillSelfTimer = 35000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //KillSelfTimer + if (KillSelfTimer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + return; + }else KillSelfTimer -= diff; + + //MindflayTimer + if (MindflayTimer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, EFFECT_INDEX_0)) + DoCastSpellIfCan(target,SPELL_MIND_FLAY); + + //Mindflay every 10 seconds + MindflayTimer = 10100; + }else MindflayTimer -= diff; + } +}; + +struct MANGOS_DLL_DECL claw_tentacleAI : public ScriptedAI +{ + claw_tentacleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 GroundRuptureTimer; + uint32 HamstringTimer; + uint32 EvadeTimer; + uint64 Portal; + + void JustDied(Unit*) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(Portal)) + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //First rupture should happen half a second after we spawn + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //EvadeTimer + if (!m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) + if (EvadeTimer < diff) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(Portal)) + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + //Dissapear and reappear at new position + m_creature->SetVisibility(VISIBILITY_OFF); + + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (!target) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + if (!target->HasAura(SPELL_DIGESTIVE_ACID, EFFECT_INDEX_0)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + AttackStart(target); + } + + m_creature->SetVisibility(VISIBILITY_ON); + + }else EvadeTimer -= diff; + + //GroundRuptureTimer + if (GroundRuptureTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_GROUND_RUPTURE); + GroundRuptureTimer = 30000; + }else GroundRuptureTimer -= diff; + + //HamstringTimer + if (HamstringTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HAMSTRING); + HamstringTimer = 5000; + }else HamstringTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL giant_claw_tentacleAI : public ScriptedAI +{ + giant_claw_tentacleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 GroundRuptureTimer; + uint32 ThrashTimer; + uint32 HamstringTimer; + uint32 EvadeTimer; + uint64 Portal; + + void JustDied(Unit*) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(Portal)) + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //First rupture should happen half a second after we spawn + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //EvadeTimer + if (m_creature->IsWithinDist(m_creature->getVictim(), ATTACK_DISTANCE)) + if (EvadeTimer < diff) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(Portal)) + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + //Dissapear and reappear at new position + m_creature->SetVisibility(VISIBILITY_OFF); + + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (!target) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + if (!target->HasAura(SPELL_DIGESTIVE_ACID, EFFECT_INDEX_0)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + AttackStart(target); + } + + m_creature->SetVisibility(VISIBILITY_ON); + + }else EvadeTimer -= diff; + + //GroundRuptureTimer + if (GroundRuptureTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_GROUND_RUPTURE); + GroundRuptureTimer = 30000; + }else GroundRuptureTimer -= diff; + + //ThrashTimer + if (ThrashTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_THRASH); + ThrashTimer = 10000; + }else ThrashTimer -= diff; + + //HamstringTimer + if (HamstringTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HAMSTRING); + HamstringTimer = 10000; + }else HamstringTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL giant_eye_tentacleAI : public ScriptedAI +{ + giant_eye_tentacleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 BeamTimer; + uint64 Portal; + + void JustDied(Unit*) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(Portal)) + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //Green Beam half a second after we spawn + BeamTimer = 500; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //BeamTimer + if (BeamTimer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID, EFFECT_INDEX_0)) + DoCastSpellIfCan(target,SPELL_GREEN_BEAM); + + //Beam every 2 seconds + BeamTimer = 2100; + }else BeamTimer -= diff; + } +}; + +//Flesh tentacle functions +void flesh_tentacleAI::UpdateAI(const uint32 diff) +{ + //Check if we have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Parent) + if (CheckTimer < diff) + { + Creature* pParent = m_creature->GetMap()->GetCreature(Parent); + + if (!pParent || !pParent->isAlive() || !pParent->isInCombat()) + { + Parent = 0; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + CheckTimer = 1000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); +} + +void flesh_tentacleAI::JustDied(Unit* killer) +{ + if (!Parent) + { + error_log("SD2: flesh_tentacle: No Parent variable"); + return; + } + + if (Creature* pCthun = m_creature->GetMap()->GetCreature(Parent)) + { + if (cthunAI* pCthunAI = dynamic_cast(pCthun->AI())) + pCthunAI->FleshTentcleKilled(); + } + else + error_log("SD2: flesh_tentacle: No Cthun"); +} + +//GetAIs +CreatureAI* GetAI_eye_of_cthun(Creature* pCreature) +{ + return new eye_of_cthunAI(pCreature); +} + +CreatureAI* GetAI_cthun(Creature* pCreature) +{ + return new cthunAI(pCreature); +} + +CreatureAI* GetAI_eye_tentacle(Creature* pCreature) +{ + return new eye_tentacleAI(pCreature); +} + +CreatureAI* GetAI_claw_tentacle(Creature* pCreature) +{ + return new claw_tentacleAI(pCreature); +} + +CreatureAI* GetAI_giant_claw_tentacle(Creature* pCreature) +{ + return new giant_claw_tentacleAI(pCreature); +} + +CreatureAI* GetAI_giant_eye_tentacle(Creature* pCreature) +{ + return new giant_eye_tentacleAI(pCreature); +} + +CreatureAI* GetAI_flesh_tentacle(Creature* pCreature) +{ + return new flesh_tentacleAI(pCreature); +} + +void AddSC_boss_cthun() +{ + Script *newscript; + + //Eye + newscript = new Script; + newscript->Name = "boss_eye_of_cthun"; + newscript->GetAI = &GetAI_eye_of_cthun; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_cthun"; + newscript->GetAI = &GetAI_cthun; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_eye_tentacle"; + newscript->GetAI = &GetAI_eye_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_claw_tentacle"; + newscript->GetAI = &GetAI_claw_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_giant_claw_tentacle"; + newscript->GetAI = &GetAI_giant_claw_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_giant_eye_tentacle"; + newscript->GetAI = &GetAI_giant_eye_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_giant_flesh_tentacle"; + newscript->GetAI = &GetAI_flesh_tentacle; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp new file mode 100644 index 0000000..fc7c3fb --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp @@ -0,0 +1,198 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fankriss +SD%Complete: 100 +SDComment: sound not implemented +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SOUND_SENTENCE_YOU 8588 +#define SOUND_SERVE_TO 8589 +#define SOUND_LAWS 8590 +#define SOUND_TRESPASS 8591 +#define SOUND_WILL_BE 8592 + +#define SPELL_MORTAL_WOUND 28467 +#define SPELL_ROOT 28858 + +// Enrage for his spawns +#define SPELL_ENRAGE 28798 + +struct MANGOS_DLL_DECL boss_fankrissAI : public ScriptedAI +{ + boss_fankrissAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 MortalWound_Timer; + uint32 SpawnHatchlings_Timer; + uint32 SpawnSpawns_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Hatchling; + Creature* Spawn; + + void Reset() + { + MortalWound_Timer = urand(10000, 15000); + SpawnHatchlings_Timer = urand(6000, 12000); + SpawnSpawns_Timer = urand(15000, 45000); + } + + void SummonSpawn(Unit* pVictim) + { + Rand = 10 + (rand()%10); + switch(urand(0, 1)) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = 10 + (rand()%10); + switch(urand(0, 1)) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + if (Spawn && pVictim) + Spawn->AI()->AttackStart(pVictim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //MortalWound_Timer + if (MortalWound_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTAL_WOUND); + MortalWound_Timer = urand(10000, 20000); + }else MortalWound_Timer -= diff; + + //Summon 1-3 Spawns of Fankriss at random time. + if (SpawnSpawns_Timer < diff) + { + switch(urand(0, 2)) + { + case 0: + SummonSpawn(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + break; + case 1: + SummonSpawn(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + SummonSpawn(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + break; + case 2: + SummonSpawn(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + SummonSpawn(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + SummonSpawn(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)); + break; + } + SpawnSpawns_Timer = urand(30000, 60000); + }else SpawnSpawns_Timer -= diff; + + // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. + //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot. + if (m_creature->GetHealthPercent() > 3.0f) + { + if (SpawnHatchlings_Timer< diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(target, SPELL_ROOT); + + if (m_creature->getThreatManager().getThreat(target)) + m_creature->getThreatManager().modifyThreatPercent(target, -100); + + switch(urand(0, 2)) + { + case 0: + DoTeleportPlayer(target, -8106.0142f, 1289.2900f, -74.419533f, 5.112f); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + break; + case 1: + DoTeleportPlayer(target, -7990.135354f, 1155.1907f, -78.849319f, 2.608f); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + break; + case 2: + DoTeleportPlayer(target, -8159.7753f, 1127.9064f, -76.868660f, 0.675f); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + Hatchling->AI()->AttackStart(target); + break; + } + } + SpawnHatchlings_Timer = urand(45000, 60000); + }else SpawnHatchlings_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_fankriss(Creature* pCreature) +{ + return new boss_fankrissAI(pCreature); +} + +void AddSC_boss_fankriss() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_fankriss"; + newscript->GetAI = &GetAI_boss_fankriss; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp new file mode 100644 index 0000000..5e60935 --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp @@ -0,0 +1,143 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Huhuran +SD%Complete: 100 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 +#define EMOTE_GENERIC_BERSERK -1000004 + +#define SPELL_FRENZY 26051 +#define SPELL_BERSERK 26068 +#define SPELL_POISONBOLT 26052 +#define SPELL_NOXIOUSPOISON 26053 +#define SPELL_WYVERNSTING 26180 +#define SPELL_ACIDSPIT 26050 + +struct MANGOS_DLL_DECL boss_huhuranAI : public ScriptedAI +{ + boss_huhuranAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Frenzy_Timer; + uint32 Wyvern_Timer; + uint32 Spit_Timer; + uint32 PoisonBolt_Timer; + uint32 NoxiousPoison_Timer; + uint32 FrenzyBack_Timer; + + bool Frenzy; + bool Berserk; + + void Reset() + { + Frenzy_Timer = urand(25000, 35000); + Wyvern_Timer = urand(18000, 28000); + Spit_Timer = 8000; + PoisonBolt_Timer = 4000; + NoxiousPoison_Timer = urand(10000, 20000); + FrenzyBack_Timer = 15000; + + Frenzy = false; + Berserk = false; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Frenzy_Timer + if (!Frenzy && Frenzy_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + Frenzy = true; + PoisonBolt_Timer = 3000; + Frenzy_Timer = urand(25000, 35000); + }else Frenzy_Timer -= diff; + + // Wyvern Timer + if (Wyvern_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_WYVERNSTING); + Wyvern_Timer = urand(15000, 32000); + }else Wyvern_Timer -= diff; + + //Spit Timer + if (Spit_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ACIDSPIT); + Spit_Timer = urand(5000, 10000); + }else Spit_Timer -= diff; + + //NoxiousPoison_Timer + if (NoxiousPoison_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_NOXIOUSPOISON); + NoxiousPoison_Timer = urand(12000, 24000); + }else NoxiousPoison_Timer -= diff; + + //PoisonBolt only if frenzy or berserk + if (Frenzy || Berserk) + { + if (PoisonBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_POISONBOLT); + PoisonBolt_Timer = 3000; + }else PoisonBolt_Timer -= diff; + } + + //FrenzyBack_Timer + if (Frenzy && FrenzyBack_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + Frenzy = false; + FrenzyBack_Timer = 15000; + }else FrenzyBack_Timer -= diff; + + if (!Berserk && m_creature->GetHealthPercent() < 31.0f) + { + m_creature->InterruptNonMeleeSpells(false); + DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + Berserk = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_huhuran(Creature* pCreature) +{ + return new boss_huhuranAI(pCreature); +} + +void AddSC_boss_huhuran() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_huhuran"; + newscript->GetAI = &GetAI_boss_huhuran; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp new file mode 100644 index 0000000..cc3a8f8 --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp @@ -0,0 +1,178 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ouro +SD%Complete: 50 +SDComment: script needs to be reworked +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "temple_of_ahnqiraj.h" + +enum +{ + SPELL_SWEEP = 26103, + SPELL_SANDBLAST = 26102, + SPELL_GROUND_RUPTURE = 26100, + SPELL_BIRTH = 26262, //The Birth Animation + SPELL_BOULDER = 26616, + SPELL_BERSERK = 26615, + + SPELL_SUMMON_SCARABS = 26060, + SPELL_SUMMON_OURO_MOUND = 26058, + SPELL_SUMMON_OURO = 26642, + + SPELL_DIRTMOUND_PASSIVE = 26092, + SPELL_SUBMERGE_VISUAL = 26063, + + NPC_OURO_SCARAB = 15718, + NPC_OURO_SPAWNER = 15957, + NPC_OURO_TRIGGER = 15717 +}; + +struct MANGOS_DLL_DECL boss_ouroAI : public ScriptedAI +{ + boss_ouroAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiSweepTimer; + uint32 m_uiSandBlastTimer; + uint32 m_uiSubmergeTimer; + uint32 m_uiBackTimer; + uint32 m_uiChangeTargetTimer; + uint32 m_uiSpawnTimer; + + bool m_bEnraged; + bool m_bSubmerged; + + void Reset() + { + m_uiSweepTimer = urand(5000, 10000); + m_uiSandBlastTimer = urand(20000, 35000); + m_uiSubmergeTimer = urand(90000, 150000); + m_uiBackTimer = urand(30000, 45000); + m_uiChangeTargetTimer = urand(5000, 8000); + m_uiSpawnTimer = urand(10000, 20000); + + m_bEnraged = false; + m_bSubmerged = false; + } + + void Aggro(Unit* pWho) + { + DoCastSpellIfCan(m_creature, SPELL_BIRTH); + } + + void UpdateAI(const uint32 uiDiff) + { + // Return since we have no pTarget + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bSubmerged) + { + // Sweep + if (m_uiSweepTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SWEEP); + m_uiSweepTimer = urand(15000, 30000); + } + else + m_uiSweepTimer -= uiDiff; + + // Sand Blast + if (m_uiSandBlastTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SANDBLAST); + m_uiSandBlastTimer = urand(20000, 35000); + } + else + m_uiSandBlastTimer -= uiDiff; + + if (!m_bEnraged) + { + if (m_creature->GetHealthPercent() < 20.0f) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + m_bEnraged = true; + return; + } + + // Submerge + if (m_uiSubmergeTimer < uiDiff) + { + //Cast + m_creature->HandleEmote(EMOTE_ONESHOT_SUBMERGE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(35); + DoCastSpellIfCan(m_creature, SPELL_DIRTMOUND_PASSIVE); + + m_bSubmerged = true; + m_uiBackTimer = urand(30000, 45000); + } + else + m_uiSubmergeTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } + else + { + // Change Target + if (m_uiChangeTargetTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 0.0f); + m_creature->SendMonsterMove(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), SPLINETYPE_NORMAL, SPLINEFLAG_WALKMODE, 1); + } + + m_uiChangeTargetTimer = urand(10000, 20000); + } + else + m_uiChangeTargetTimer -= uiDiff; + + // Back + if (m_uiBackTimer < uiDiff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GROUND_RUPTURE); + + m_bSubmerged = false; + m_uiSubmergeTimer = urand(60000, 120000); + } + else + m_uiBackTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_boss_ouro(Creature* pCreature) +{ + return new boss_ouroAI(pCreature); +} + +void AddSC_boss_ouro() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "boss_ouro"; + newscript->GetAI = &GetAI_boss_ouro; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp new file mode 100644 index 0000000..ce86a0c --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp @@ -0,0 +1,292 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sartura +SD%Complete: 95 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1531008 +#define SAY_SLAY -1531009 +#define SAY_DEATH -1531010 + +#define SPELL_WHIRLWIND 26083 +#define SPELL_ENRAGE 28747 //Not sure if right ID. +#define SPELL_ENRAGEHARD 28798 + +//Guard Spell +#define SPELL_WHIRLWINDADD 26038 +#define SPELL_KNOCKBACK 26027 + +struct MANGOS_DLL_DECL boss_sarturaAI : public ScriptedAI +{ + boss_sarturaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 WhirlWind_Timer; + uint32 WhirlWindRandom_Timer; + uint32 WhirlWindEnd_Timer; + uint32 AggroReset_Timer; + uint32 AggroResetEnd_Timer; + uint32 EnrageHard_Timer; + + bool Enraged; + bool EnragedHard; + bool WhirlWind; + bool AggroReset; + + void Reset() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = urand(3000, 7000); + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = urand(45000, 55000); + AggroResetEnd_Timer = 5000; + EnrageHard_Timer = 10*60000; + + WhirlWind = false; + AggroReset = false; + Enraged = false; + EnragedHard = false; + + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (WhirlWind) + { + if (WhirlWindRandom_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target); + m_creature->TauntApply(target); + AttackStart(target); + + WhirlWindRandom_Timer = urand(3000, 7000); + }else WhirlWindRandom_Timer -= diff; + + if (WhirlWindEnd_Timer < diff) + { + WhirlWind = false; + WhirlWind_Timer = urand(25000, 40000); + }else WhirlWindEnd_Timer -= diff; + } + + if (!WhirlWind) + { + if (WhirlWind_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + WhirlWind = true; + WhirlWindEnd_Timer = 15000; + }else WhirlWind_Timer -= diff; + + if (AggroReset_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target); + m_creature->TauntApply(target); + AttackStart(target); + + AggroReset = true; + AggroReset_Timer = urand(2000, 5000); + }else AggroReset_Timer -= diff; + + if (AggroReset) + { + if (AggroResetEnd_Timer GetHealthPercent() <= 20.0f && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + Enraged = true; + } + } + + //After 10 minutes hard enrage + if (!EnragedHard) + { + if (EnrageHard_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGEHARD); + EnragedHard = true; + } else EnrageHard_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +struct MANGOS_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI +{ + mob_sartura_royal_guardAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 WhirlWind_Timer; + uint32 WhirlWindRandom_Timer; + uint32 WhirlWindEnd_Timer; + uint32 AggroReset_Timer; + uint32 AggroResetEnd_Timer; + uint32 KnockBack_Timer; + + bool WhirlWind; + bool AggroReset; + + void Reset() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = urand(3000, 7000); + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = urand(45000, 55000); + AggroResetEnd_Timer = 5000; + KnockBack_Timer = 10000; + + WhirlWind = false; + AggroReset = false; + + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!WhirlWind && WhirlWind_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWINDADD); + WhirlWind = true; + WhirlWind_Timer = urand(25000, 40000); + WhirlWindEnd_Timer = 15000; + }else WhirlWind_Timer -= diff; + + if (WhirlWind) + { + if (WhirlWindRandom_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target); + m_creature->TauntApply(target); + AttackStart(target); + + WhirlWindRandom_Timer = urand(3000, 7000); + }else WhirlWindRandom_Timer -= diff; + + if (WhirlWindEnd_Timer < diff) + { + WhirlWind = false; + }else WhirlWindEnd_Timer -= diff; + } + + if (!WhirlWind) + { + if (AggroReset_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target); + m_creature->TauntApply(target); + AttackStart(target); + + AggroReset = true; + AggroReset_Timer = urand(2000, 5000); + }else AggroReset_Timer -= diff; + + if (KnockBack_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWINDADD); + KnockBack_Timer = urand(10000, 20000); + }else KnockBack_Timer -= diff; + } + + if (AggroReset) + { + if (AggroResetEnd_Timer Name = "boss_sartura"; + newscript->GetAI = &GetAI_boss_sartura; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_sartura_royal_guard"; + newscript->GetAI = &GetAI_mob_sartura_royal_guard; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp new file mode 100644 index 0000000..c154ee5 --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp @@ -0,0 +1,306 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skeram +SD%Complete: 75 +SDComment: Mind Control buggy. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "temple_of_ahnqiraj.h" +#include "Group.h" + +#define SAY_AGGRO1 -1531000 +#define SAY_AGGRO2 -1531001 +#define SAY_AGGRO3 -1531002 +#define SAY_SLAY1 -1531003 +#define SAY_SLAY2 -1531004 +#define SAY_SLAY3 -1531005 +#define SAY_SPLIT -1531006 +#define SAY_DEATH -1531007 + +#define SPELL_ARCANE_EXPLOSION 25679 +#define SPELL_EARTH_SHOCK 26194 +#define SPELL_TRUE_FULFILLMENT4 26526 +#define SPELL_BLINK 28391 + +class ov_mycoordinates +{ + public: + float x,y,z,r; + ov_mycoordinates(float cx, float cy, float cz, float cr) + { + x = cx; y = cy; z = cz; r = cr; + } +}; + +struct MANGOS_DLL_DECL boss_skeramAI : public ScriptedAI +{ + boss_skeramAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + IsImage = false; + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ArcaneExplosion_Timer; + uint32 EarthShock_Timer; + uint32 FullFillment_Timer; + uint32 Blink_Timer; + uint32 Invisible_Timer; + + Creature *Image1, *Image2; + + bool Images75; + bool Images50; + bool Images25; + bool IsImage; + bool Invisible; + + void Reset() + { + ArcaneExplosion_Timer = urand(6000, 12000); + EarthShock_Timer = 2000; + FullFillment_Timer = 15000; + Blink_Timer = urand(8000, 20000); + Invisible_Timer = 500; + + Images75 = false; + Images50 = false; + Images25 = false; + Invisible = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + if (IsImage) + m_creature->SetDeathState(JUST_DIED); + } + + void KilledUnit(Unit* victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + if (!IsImage) + DoScriptText(SAY_DEATH, m_creature); + } + + void Aggro(Unit *who) + { + if (IsImage || Images75) + return; + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = urand(8000, 18000); + }else ArcaneExplosion_Timer -= diff; + + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + //Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + }else + { + //EarthShock_Timer + if (EarthShock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_EARTH_SHOCK); + EarthShock_Timer = 1000; + }else EarthShock_Timer -= diff; + } + + //Blink_Timer + if (Blink_Timer < diff) + { + //DoCastSpellIfCan(m_creature, SPELL_BLINK); + switch(urand(0, 2)) + { + case 0: + m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227f, 2083.814453f, 125.648788f, 0.0f); + DoResetThreat(); + break; + case 1: + m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875f, 2118.504639f, 133.058151f, 0.0f); + DoResetThreat(); + break; + case 2: + m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266f, 2058.231201f, 133.058151f, 0.0f); + DoResetThreat(); + break; + } + DoStopAttack(); + + Blink_Timer = urand(20000, 40000); + }else Blink_Timer -= diff; + + float procent = m_creature->GetHealthPercent(); + + //Summoning 2 Images and teleporting to a random position on 75% health + if (!Images75 && !IsImage && procent <= 75.0f && procent > 70.0f) + DoSplit(75); + + //Summoning 2 Images and teleporting to a random position on 50% health + if (!Images50 && !IsImage && procent <= 50.0f && procent > 45.0f) + DoSplit(50); + + //Summoning 2 Images and teleporting to a random position on 25% health + if (!Images25 && !IsImage && procent <= 25.0f && procent > 20.0f) + DoSplit(25); + + //Invisible_Timer + if (Invisible) + { + if (Invisible_Timer < diff) + { + //Making Skeram visible after telporting + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + Invisible_Timer = 2500; + Invisible = false; + }else Invisible_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void DoSplit(int atPercent /* 75 50 25 */) + { + DoScriptText(SAY_SPLIT, m_creature); + + ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227f, 2083.814453f, 125.648788f, 0.0f); + ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875f, 2118.504639f, 133.058151f, 0.0f); + ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266f, 2058.231201f, 133.058151f, 0.0f); + + ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; + + switch(urand(0, 2)) + { + case 0: + bossc = place1; + i1 = place2; + i2 = place3; + break; + case 1: + bossc = place2; + i1 = place1; + i2 = place3; + break; + case 2: + bossc = place3; + i1 = place1; + i2 = place2; + break; + } + + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + + m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r); + + Invisible = true; + DoResetThreat(); + DoStopAttack(); + + switch (atPercent) + { + case 75: Images75 = true; break; + case 50: Images50 = true; break; + case 25: Images25 = true; break; + } + + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); + if (Image1) + { + Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image1->SetHealth(m_creature->GetHealth() / 5); + + if (target) + Image1->AI()->AttackStart(target); + + if (boss_skeramAI* pImageAI = dynamic_cast(Image1->AI())) + pImageAI->IsImage = true; + } + + Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); + if (Image2) + { + Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image2->SetHealth(m_creature->GetHealth() / 5); + + if (target) + Image2->AI()->AttackStart(target); + + if (boss_skeramAI* pImageAI = dynamic_cast(Image2->AI())) + pImageAI->IsImage = true; + } + + + Invisible = true; + delete place1; + delete place2; + delete place3; + } +}; + +CreatureAI* GetAI_boss_skeram(Creature* pCreature) +{ + return new boss_skeramAI(pCreature); +} + +void AddSC_boss_skeram() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_skeram"; + newscript->GetAI = &GetAI_boss_skeram; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp new file mode 100644 index 0000000..829bb0c --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -0,0 +1,653 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Twinemperors +SD%Complete: 95 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "temple_of_ahnqiraj.h" +#include "WorldPacket.h" + +#include "Item.h" +#include "Spell.h" + +#define SPELL_HEAL_BROTHER 7393 +#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer +#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual + +#define SPELL_EXPLODEBUG 804 +#define SPELL_MUTATE_BUG 802 + +#define SOUND_VN_DEATH 8660 //8660 - Death - Feel +#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none +#define SOUND_VN_KILL 8662 //8661 - Kill - your fate + +#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late +#define SOUND_VL_KILL 8658 //8658 - Kill - You will not +#define SOUND_VL_DEATH 8659 //8659 - Death + +#define PULL_RANGE 50 +#define ABUSE_BUG_RANGE 20 +#define SPELL_BERSERK 26662 +#define TELEPORTTIME 30000 + +#define SPELL_UPPERCUT 26007 +#define SPELL_UNBALANCING_STRIKE 26613 + +#define VEKLOR_DIST 20 // VL will not come to melee when attacking + +#define SPELL_SHADOWBOLT 26006 +#define SPELL_BLIZZARD 26607 +#define SPELL_ARCANEBURST 568 + +struct MANGOS_DLL_DECL boss_twinemperorsAI : public ScriptedAI +{ + ScriptedInstance* m_pInstance; + uint32 Heal_Timer; + uint32 Teleport_Timer; + bool AfterTeleport; + uint32 AfterTeleportTimer; + bool DontYellWhenDead; + uint32 Abuse_Bug_Timer, BugsTimer; + bool tspellcasted; + uint32 EnrageTimer; + + virtual bool IAmVeklor() = 0; + virtual void Reset() = 0; + virtual void CastSpellOnBug(Creature *target) = 0; + + boss_twinemperorsAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + } + + void TwinReset() + { + Heal_Timer = 0; // first heal immediately when they get close together + Teleport_Timer = TELEPORTTIME; + AfterTeleport = false; + tspellcasted = false; + AfterTeleportTimer = 0; + Abuse_Bug_Timer = urand(10000, 17000); + BugsTimer = 2000; + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DontYellWhenDead = false; + EnrageTimer = 15*60000; + } + + Creature *GetOtherBoss() + { + if (m_pInstance) + { + return m_creature->GetMap()->GetCreature(m_pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); + } + else + { + return NULL; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth()); + int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth())); + int ohealth = pOtherBoss->GetHealth()-odmg; + pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0); + if (ohealth <= 0) + { + pOtherBoss->SetDeathState(JUST_DIED); + pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + } + + void JustDied(Unit* Killer) + { + if (Creature* pOtherBoss = GetOtherBoss()) + { + pOtherBoss->SetHealth(0); + pOtherBoss->SetDeathState(JUST_DIED); + pOtherBoss->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + if (boss_twinemperorsAI* pOtherAI = dynamic_cast(pOtherBoss->AI())) + pOtherAI->DontYellWhenDead = true; + } + + if (!DontYellWhenDead) // I hope AI is not threaded + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); + } + + void KilledUnit(Unit* victim) + { + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + // TODO: we should activate the other boss location so he can start attackning even if nobody + // is near I dont know how to do that + if (!pOtherBoss->isInCombat()) + { + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); + pOtherBoss->AI()->AttackStart(pWho); + } + } + } + + void SpellHit(Unit *caster, const SpellEntry *entry) + { + if (caster == m_creature) + return; + + Creature *pOtherBoss = GetOtherBoss(); + if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss) + return; + + // add health so we keep same percentage for both brothers + uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth(); + float mult = ((float)mytotal) / ((float)histotal); + if (mult < 1) + mult = 1.0f/mult; + #define HEAL_BROTHER_AMOUNT 30000.0f + uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT); + + uint32 myh = m_creature->GetHealth(); + uint32 hish = pOtherBoss->GetHealth(); + if (mytotal > histotal) + { + uint32 h = m_creature->GetHealth()+largerAmount; + m_creature->SetHealth(std::min(mytotal, h)); + } + else + { + uint32 h = pOtherBoss->GetHealth()+largerAmount; + pOtherBoss->SetHealth(std::min(histotal, h)); + } + } + + void TryHealBrother(uint32 diff) + { + if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it + return; + + if (Heal_Timer < diff) + { + Unit *pOtherBoss = GetOtherBoss(); + if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature, 60.0f)) + { + DoCastSpellIfCan(pOtherBoss, SPELL_HEAL_BROTHER); + Heal_Timer = 1000; + } + } else Heal_Timer -= diff; + } + + Unit *GetAnyoneCloseEnough(float dist, bool totallyRandom) + { + int cnt = 0; + std::list candidates; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (m_creature->IsWithinDistInMap(pUnit, dist)) + { + if (!totallyRandom) + return pUnit; + candidates.push_back((*i)); + ++cnt; + } + } + if (!cnt) + return NULL; + for (int randomi = rand() % cnt; randomi > 0; randomi --) + candidates.pop_front(); + + Unit *ret = m_creature->GetMap()->GetUnit(candidates.front()->getUnitGuid()); + candidates.clear(); + return ret; + } + + Unit *PickNearestPlayer() + { + Unit *nearp = NULL; + float neardist = 0.0f; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (!pUnit) + continue; + + float pudist = pUnit->GetDistance((const Creature *)m_creature); + if (!nearp || (neardist > pudist)) + { + nearp = pUnit; + neardist = pudist; + } + } + return nearp; + } + + void TeleportToMyBrother() + { + if (!m_pInstance) + return; + + Teleport_Timer = TELEPORTTIME; + + if (IAmVeklor()) + return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates + + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); + float other_x = pOtherBoss->GetPositionX(); + float other_y = pOtherBoss->GetPositionY(); + float other_z = pOtherBoss->GetPositionZ(); + float other_o = pOtherBoss->GetOrientation(); + + Map *thismap = m_creature->GetMap(); + thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(), + m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); + thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o); + + SetAfterTeleport(); + + if (boss_twinemperorsAI* pOtherAI = dynamic_cast(pOtherBoss->AI())) + pOtherAI->SetAfterTeleport(); + } + } + + void SetAfterTeleport() + { + m_creature->InterruptNonMeleeSpells(false); + DoStopAttack(); + DoResetThreat(); + DoCastSpellIfCan(m_creature, SPELL_TWIN_TELEPORT_VISUAL); + m_creature->addUnitState(UNIT_STAT_STUNNED); + AfterTeleport = true; + AfterTeleportTimer = 2000; + tspellcasted = false; + } + + bool TryActivateAfterTTelep(uint32 diff) + { + if (AfterTeleport) + { + if (!tspellcasted) + { + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DoCastSpellIfCan(m_creature, SPELL_TWIN_TELEPORT); + m_creature->addUnitState(UNIT_STAT_STUNNED); + } + + tspellcasted = true; + + if (AfterTeleportTimer < diff) + { + AfterTeleport = false; + m_creature->clearUnitState(UNIT_STAT_STUNNED); + Unit *nearu = PickNearestPlayer(); + //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); + AttackStart(nearu); + m_creature->getThreatManager().addThreat(nearu, 10000); + return true; + } + else + { + AfterTeleportTimer -= diff; + // update important timers which would otherwise get skipped + if (EnrageTimer > diff) + EnrageTimer -= diff; + else + EnrageTimer = 0; + if (Teleport_Timer > diff) + Teleport_Timer -= diff; + else + Teleport_Timer = 0; + return false; + } + } + else + { + return true; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (attackRadius < PULL_RANGE) + attackRadius = PULL_RANGE; + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/) + { + if (who->HasStealthAura()) + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + Creature *RespawnNearbyBugsAndGetOne() + { + std::list lUnitList; + GetCreatureListWithEntryInGrid(lUnitList,m_creature,15316,150.0f); + GetCreatureListWithEntryInGrid(lUnitList,m_creature,15317,150.0f); + + if (lUnitList.empty()) + return NULL; + + Creature *nearb = NULL; + + for(std::list::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter) + { + Creature *c = (Creature *)(*iter); + if (c->isDead()) + { + c->Respawn(); + c->setFaction(7); + c->RemoveAllAuras(); + } + if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE)) + { + if (!nearb || !urand(0, 3)) + nearb = c; + } + } + return nearb; + } + + void HandleBugs(uint32 diff) + { + if (BugsTimer < diff || Abuse_Bug_Timer < diff) + { + Creature *c = RespawnNearbyBugsAndGetOne(); + if (Abuse_Bug_Timer < diff) + { + if (c) + { + CastSpellOnBug(c); + Abuse_Bug_Timer = urand(10000, 17000); + } + else + { + Abuse_Bug_Timer = 1000; + } + } + else + { + Abuse_Bug_Timer -= diff; + } + BugsTimer = 2000; + } + else + { + BugsTimer -= diff; + Abuse_Bug_Timer -= diff; + } + } + + void CheckEnrage(uint32 diff) + { + if (EnrageTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(true)) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + EnrageTimer = 60*60000; + } else EnrageTimer = 0; + } else EnrageTimer-=diff; + } +}; + +struct MANGOS_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI +{ + bool IAmVeklor() {return false;} + boss_veknilashAI(Creature* pCreature) : boss_twinemperorsAI(pCreature) + { + Reset(); + } + + uint32 UpperCut_Timer; + uint32 UnbalancingStrike_Timer; + uint32 Scarabs_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() + { + TwinReset(); + UpperCut_Timer = urand(14000, 29000); + UnbalancingStrike_Timer = urand(8000, 18000); + Scarabs_Timer = urand(7000, 14000); + + //Added. Can be removed if its included in DB. + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + } + + void CastSpellOnBug(Creature *target) + { + target->setFaction(14); + + DoCastSpellIfCan(target, SPELL_MUTATE_BUG, CAST_TRIGGERED); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!TryActivateAfterTTelep(diff)) + return; + + //UnbalancingStrike_Timer + if (UnbalancingStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE); + UnbalancingStrike_Timer = urand(8000, 20000); + }else UnbalancingStrike_Timer -= diff; + + if (UpperCut_Timer < diff) + { + Unit* randomMelee = GetAnyoneCloseEnough(ATTACK_DISTANCE, true); + if (randomMelee) + DoCastSpellIfCan(randomMelee,SPELL_UPPERCUT); + UpperCut_Timer = urand(15000, 30000); + }else UpperCut_Timer -= diff; + + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer < diff) + { + TeleportToMyBrother(); + }else Teleport_Timer -= diff; + + CheckEnrage(diff); + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_veklorAI : public boss_twinemperorsAI +{ + bool IAmVeklor() {return true;} + boss_veklorAI(Creature* pCreature) : boss_twinemperorsAI(pCreature) + { + Reset(); + } + + uint32 ShadowBolt_Timer; + uint32 Blizzard_Timer; + uint32 ArcaneBurst_Timer; + uint32 Scorpions_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() + { + TwinReset(); + ShadowBolt_Timer = 0; + Blizzard_Timer = urand(15000, 20000); + ArcaneBurst_Timer = 1000; + Scorpions_Timer = urand(7000, 14000); + + //Added. Can be removed if its included in DB. + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0); + } + + void CastSpellOnBug(Creature *target) + { + target->setFaction(14); + + DoCastSpellIfCan(target, SPELL_EXPLODEBUG, CAST_TRIGGERED); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // reset arcane burst after teleport - we need to do this because + // when VL jumps to VN's location there will be a warrior who will get only 2s to run away + // which is almost impossible + if (AfterTeleport) + ArcaneBurst_Timer = 5000; + if (!TryActivateAfterTTelep(diff)) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f)) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0); + else + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; + }else ShadowBolt_Timer -= diff; + + //Blizzard_Timer + if (Blizzard_Timer < diff) + { + Unit* target = NULL; + target = GetAnyoneCloseEnough(45, true); + if (target) + DoCastSpellIfCan(target,SPELL_BLIZZARD); + Blizzard_Timer = urand(15000, 30000); + }else Blizzard_Timer -= diff; + + if (ArcaneBurst_Timer < diff) + { + Unit *mvic; + if ((mvic=GetAnyoneCloseEnough(ATTACK_DISTANCE, false))!=NULL) + { + DoCastSpellIfCan(mvic,SPELL_ARCANEBURST); + ArcaneBurst_Timer = 5000; + } + }else ArcaneBurst_Timer -= diff; + + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer < diff) + { + TeleportToMyBrother(); + }else Teleport_Timer -= diff; + + CheckEnrage(diff); + + //VL doesn't melee + //DoMeleeAttackIfReady(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + // VL doesn't melee + if (m_creature->Attack(who, false)) + { + m_creature->AddThreat(who); + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); + } + } +}; + +CreatureAI* GetAI_boss_veknilash(Creature* pCreature) +{ + return new boss_veknilashAI(pCreature); +} + +CreatureAI* GetAI_boss_veklor(Creature* pCreature) +{ + return new boss_veklorAI(pCreature); +} + +void AddSC_boss_twinemperors() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_veknilash"; + newscript->GetAI = &GetAI_boss_veknilash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_veklor"; + newscript->GetAI = &GetAI_boss_veklor; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp b/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp new file mode 100644 index 0000000..e9ee3ab --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Viscidus +SD%Complete: 0 +SDComment: place holder +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_POISON_SHOCK 25993 +#define SPELL_POISONBOLT_VOLLEY 25991 + +#define SPELL_TOXIN_CLOUD 25989 diff --git a/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp new file mode 100644 index 0000000..393a7d3 --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Temple_of_Ahnqiraj +SD%Complete: 80 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "temple_of_ahnqiraj.h" + +struct MANGOS_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance +{ + instance_temple_of_ahnqiraj(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + //Storing Skeram, Vem and Kri. + uint64 m_uiSkeramGUID; + uint64 m_uiVemGUID; + uint64 m_uiKriGUID; + uint64 m_uiVeklorGUID; + uint64 m_uiVeknilashGUID; + + uint32 m_uiBugTrioDeathCount; + + uint32 m_uiCthunPhase; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiSkeramGUID = 0; + m_uiVemGUID = 0; + m_uiKriGUID = 0; + m_uiVeklorGUID = 0; + m_uiVeknilashGUID = 0; + + m_uiBugTrioDeathCount = 0; + + m_uiCthunPhase = 0; + } + + void OnCreatureCreate (Creature* pCreature) + { + switch (pCreature->GetEntry()) + { + case 15263: m_uiSkeramGUID = pCreature->GetGUID(); break; + case 15544: m_uiVemGUID = pCreature->GetGUID(); break; + case 15511: m_uiKriGUID = pCreature->GetGUID(); break; + case 15276: m_uiVeklorGUID = pCreature->GetGUID(); break; + case 15275: m_uiVeknilashGUID = pCreature->GetGUID(); break; + } + } + + bool IsEncounterInProgress() const + { + //not active in AQ40 + return false; + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_VEM: + m_auiEncounter[0] = uiData; + break; + case TYPE_VEKLOR: + m_auiEncounter[1] = uiData; + break; + case TYPE_VEKNILASH: + m_auiEncounter[2] = uiData; + break; + + case DATA_BUG_TRIO_DEATH: + ++m_uiBugTrioDeathCount; + break; + + case TYPE_CTHUN_PHASE: + m_uiCthunPhase = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_VEM: + return m_auiEncounter[0]; + + case DATA_BUG_TRIO_DEATH: + return m_uiBugTrioDeathCount; + + case TYPE_CTHUN_PHASE: + return m_uiCthunPhase; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_SKERAM: + return m_uiSkeramGUID; + case DATA_VEM: + return m_uiVemGUID; + case DATA_KRI: + return m_uiKriGUID; + case DATA_VEKLOR: + return m_uiVeklorGUID; + case DATA_VEKNILASH: + return m_uiVeknilashGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* pMap) +{ + return new instance_temple_of_ahnqiraj(pMap); +} + +void AddSC_instance_temple_of_ahnqiraj() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_temple_of_ahnqiraj"; + newscript->GetInstanceData = &GetInstanceData_instance_temple_of_ahnqiraj; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp new file mode 100644 index 0000000..609097a --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp @@ -0,0 +1,196 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: mob_anubisath_sentinel +SD%Complete: 75 +SDComment: Abilities selection needs further improvements. Shadow storm is not properly implemented in core it should only target ppl outside of melee range. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +enum +{ + EMOTE_GENERIC_FRENZY = -1000002, + + SPELL_PERIODIC_MANA_BURN = 812, + SPELL_MENDING = 2147, + SPELL_PERIODIC_SHADOW_STORM = 2148, + SPELL_PERIODIC_THUNDERCLAP = 2834, + SPELL_MORTAL_STRIKE = 9347, + SPELL_FIRE_ARCANE_REFLECT = 13022, + SPELL_SHADOW_FROST_REFLECT = 19595, + SPELL_PERIODIC_KNOCK_AWAY = 21737, + SPELL_THORNS = 25777, + + SPELL_ENRAGE = 8599, + + MAX_BUDDY = 4 +}; + +struct MANGOS_DLL_DECL npc_anubisath_sentinelAI : public ScriptedAI +{ + npc_anubisath_sentinelAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_lAssistList.clear(); + Reset(); + } + + uint32 m_uiMyAbility; + bool m_bEnraged; + + std::list m_lAssistList; + + void Reset() + { + m_uiMyAbility = 0; + m_bEnraged = false; + } + + void JustReachedHome() + { + for(std::list::iterator itr = m_lAssistList.begin(); itr != m_lAssistList.end(); ++itr) + { + if (*itr == m_creature->GetGUID()) + continue; + + if (Creature* pBuddy = m_creature->GetMap()->GetCreature(*itr)) + { + if (pBuddy->isDead()) + pBuddy->Respawn(); + } + } + } + + void Aggro(Unit* pWho) + { + SetAbility(); + InitSentinelsNear(pWho); + } + + void JustDied(Unit* pKiller) + { + DoTransferAbility(); + } + + // this way will make it quite possible that sentinels get the same buff as others, need to fix that, it should be one unique each + void SetAbility() + { + switch(urand(0, 8)) + { + case 0: m_uiMyAbility = SPELL_MENDING; break; + case 1: m_uiMyAbility = SPELL_PERIODIC_KNOCK_AWAY; break; + case 2: m_uiMyAbility = SPELL_PERIODIC_MANA_BURN; break; + case 3: m_uiMyAbility = SPELL_FIRE_ARCANE_REFLECT; break; + case 4: m_uiMyAbility = SPELL_SHADOW_FROST_REFLECT; break; + case 5: m_uiMyAbility = SPELL_THORNS; break; + case 6: m_uiMyAbility = SPELL_PERIODIC_THUNDERCLAP; break; + case 7: m_uiMyAbility = SPELL_MORTAL_STRIKE; break; + case 8: m_uiMyAbility = SPELL_PERIODIC_SHADOW_STORM; break; + } + + DoCastSpellIfCan(m_creature, m_uiMyAbility, CAST_TRIGGERED); + } + + void DoTransferAbility() + { + for(std::list::iterator itr = m_lAssistList.begin(); itr != m_lAssistList.end(); ++itr) + { + if (Creature* pBuddy = m_creature->GetMap()->GetCreature(*itr)) + { + if (*itr == m_creature->GetGUID()) + continue; + + if (!pBuddy->isAlive()) + continue; + + pBuddy->SetHealth(pBuddy->GetMaxHealth()); + DoCastSpellIfCan(pBuddy, m_uiMyAbility, CAST_TRIGGERED); + } + } + } + + void InitSentinelsNear(Unit* pTarget) + { + if (!m_lAssistList.empty()) + { + for(std::list::iterator itr = m_lAssistList.begin(); itr != m_lAssistList.end(); ++itr) + { + if (*itr == m_creature->GetGUID()) + continue; + + if (Creature* pBuddy = m_creature->GetMap()->GetCreature(*itr)) + { + if (pBuddy->isAlive()) + pBuddy->AI()->AttackStart(pTarget); + } + } + + return; + } + + std::list lAssistList; + GetCreatureListWithEntryInGrid(lAssistList, m_creature, m_creature->GetEntry(), 80.0f); + + if (lAssistList.empty()) + return; + + for(std::list::iterator iter = lAssistList.begin(); iter != lAssistList.end(); ++iter) + { + m_lAssistList.push_back((*iter)->GetGUID()); + + if ((*iter)->GetGUID() == m_creature->GetGUID()) + continue; + + (*iter)->AI()->AttackStart(pTarget); + } + + if (m_lAssistList.size() != MAX_BUDDY) + error_log("SD2: npc_anubisath_sentinel found too few/too many buddies, expected %u.", MAX_BUDDY); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bEnraged && m_creature->GetHealthPercent() < 30.0f) + { + if (DoCastSpellIfCan(m_creature, SPELL_ENRAGE) == CAST_OK) + { + DoScriptText(EMOTE_GENERIC_FRENZY, m_creature); + m_bEnraged = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_anubisath_sentinel(Creature* pCreature) +{ + return new npc_anubisath_sentinelAI(pCreature); +} + +void AddSC_mob_anubisath_sentinel() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_anubisath_sentinel"; + newscript->GetAI = &GetAI_npc_anubisath_sentinel; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.h b/scripts/kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.h new file mode 100644 index 0000000..6f59313 --- /dev/null +++ b/scripts/kalimdor/temple_of_ahnqiraj/temple_of_ahnqiraj.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_TEMPLE_OF_AHNQIRAJ_H +#define DEF_TEMPLE_OF_AHNQIRAJ_H + +enum +{ + MAX_ENCOUNTER = 3, + + TYPE_VEM = 1, + TYPE_VEKLOR = 2, + TYPE_VEKNILASH = 3, + + DATA_SKERAM = 5, + DATA_KRI = 6, + DATA_VEM = 7, + DATA_VEKLOR = 8, + DATA_VEKNILASH = 9, + + DATA_BUG_TRIO_DEATH = 10, + + TYPE_CTHUN_PHASE = 20 +}; + +#endif diff --git a/scripts/kalimdor/the_barrens.cpp b/scripts/kalimdor/the_barrens.cpp new file mode 100644 index 0000000..163e43b --- /dev/null +++ b/scripts/kalimdor/the_barrens.cpp @@ -0,0 +1,694 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: The_Barrens +SD%Complete: 90 +SDComment: Quest support: 863, 898, 1719, 2458, 4921, 6981 +SDCategory: Barrens +EndScriptData */ + +/* ContentData +npc_beaten_corpse +npc_gilthares +npc_sputtervalve +npc_taskmaster_fizzule +npc_twiggy_flathead +at_twiggy_flathead +npc_wizzlecrank_shredder +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_beaten_corpse +######*/ + +enum +{ + QUEST_LOST_IN_BATTLE = 4921 +}; + +bool GossipHello_npc_beaten_corpse(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || + pPlayer->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,"Examine corpse in detail...",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(3557, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_beaten_corpse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF +1) + { + pPlayer->SEND_GOSSIP_MENU(3558, pCreature->GetGUID()); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + } + return true; +} + +/*###### +# npc_gilthares +######*/ + +enum +{ + SAY_GIL_START = -1000370, + SAY_GIL_AT_LAST = -1000371, + SAY_GIL_PROCEED = -1000372, + SAY_GIL_FREEBOOTERS = -1000373, + SAY_GIL_AGGRO_1 = -1000374, + SAY_GIL_AGGRO_2 = -1000375, + SAY_GIL_AGGRO_3 = -1000376, + SAY_GIL_AGGRO_4 = -1000377, + SAY_GIL_ALMOST = -1000378, + SAY_GIL_SWEET = -1000379, + SAY_GIL_FREED = -1000380, + + QUEST_FREE_FROM_HOLD = 898, + AREA_MERCHANT_COAST = 391 +}; + +struct MANGOS_DLL_DECL npc_giltharesAI : public npc_escortAI +{ + npc_giltharesAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 16: + DoScriptText(SAY_GIL_AT_LAST, m_creature, pPlayer); + break; + case 17: + DoScriptText(SAY_GIL_PROCEED, m_creature, pPlayer); + break; + case 18: + DoScriptText(SAY_GIL_FREEBOOTERS, m_creature, pPlayer); + break; + case 37: + DoScriptText(SAY_GIL_ALMOST, m_creature, pPlayer); + break; + case 47: + DoScriptText(SAY_GIL_SWEET, m_creature, pPlayer); + break; + case 53: + DoScriptText(SAY_GIL_FREED, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_FREE_FROM_HOLD, m_creature); + break; + } + } + + void Aggro(Unit* pWho) + { + //not always use + if (urand(0, 3)) + return; + + //only aggro text if not player and only in this area + if (pWho->GetTypeId() != TYPEID_PLAYER && m_creature->GetAreaId() == AREA_MERCHANT_COAST) + { + //appears to be pretty much random (possible only if escorter not in combat with pWho yet?) + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_GIL_AGGRO_1, m_creature, pWho); break; + case 1: DoScriptText(SAY_GIL_AGGRO_2, m_creature, pWho); break; + case 2: DoScriptText(SAY_GIL_AGGRO_3, m_creature, pWho); break; + case 3: DoScriptText(SAY_GIL_AGGRO_4, m_creature, pWho); break; + } + } + } +}; + +CreatureAI* GetAI_npc_gilthares(Creature* pCreature) +{ + return new npc_giltharesAI(pCreature); +} + +bool QuestAccept_npc_gilthares(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_FREE_FROM_HOLD) + { + pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE); + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + DoScriptText(SAY_GIL_START, pCreature, pPlayer); + + if (npc_giltharesAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +## npc_sputtervalve +######*/ + +bool GossipHello_npc_sputtervalve(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(6981) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,"Can you tell me about this shard?",GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_sputtervalve(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->SEND_GOSSIP_MENU(2013, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(6981); + } + return true; +} + +/*###### +## npc_taskmaster_fizzule +######*/ + +enum +{ + FACTION_FRIENDLY_F = 35, + SPELL_FLARE = 10113, + SPELL_FOLLY = 10137, +}; + +struct MANGOS_DLL_DECL npc_taskmaster_fizzuleAI : public ScriptedAI +{ + npc_taskmaster_fizzuleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + factionNorm = pCreature->getFaction(); + Reset(); + } + + uint32 factionNorm; + bool IsFriend; + uint32 Reset_Timer; + uint8 FlareCount; + + void Reset() + { + IsFriend = false; + Reset_Timer = 120000; + FlareCount = 0; + m_creature->setFaction(factionNorm); + } + + void DoFriend() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->setFaction(FACTION_FRIENDLY_F); + m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_FLARE || spell->Id == SPELL_FOLLY) + { + ++FlareCount; + + if (FlareCount >= 2) + IsFriend = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (IsFriend) + { + if (Reset_Timer < diff) + { + EnterEvadeMode(); + } else Reset_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void ReceiveEmote(Player* pPlayer, uint32 emote) + { + if (emote == TEXTEMOTE_SALUTE) + { + if (FlareCount >= 2) + { + if (m_creature->getFaction() == FACTION_FRIENDLY_F) + return; + + DoFriend(); + } + } + } +}; + +CreatureAI* GetAI_npc_taskmaster_fizzule(Creature* pCreature) +{ + return new npc_taskmaster_fizzuleAI(pCreature); +} + +/*##### +## npc_twiggy_flathead +#####*/ + +#define SAY_BIG_WILL_READY -1000123 +#define SAY_TWIGGY_BEGIN -1000124 +#define SAY_TWIGGY_FRAY -1000125 +#define SAY_TWIGGY_DOWN -1000126 +#define SAY_TWIGGY_OVER -1000127 + +#define NPC_TWIGGY 6248 +#define NPC_BIG_WILL 6238 +#define NPC_AFFRAY_CHALLENGER 6240 +#define QUEST_AFFRAY 1719 + +float AffrayChallengerLoc[6][4]= +{ + {-1683.0f, -4326.0f, 2.79f, 0.00f}, + {-1682.0f, -4329.0f, 2.79f, 0.00f}, + {-1683.0f, -4330.0f, 2.79f, 0.00f}, + {-1680.0f, -4334.0f, 2.79f, 1.49f}, + {-1674.0f, -4326.0f, 2.79f, 3.49f}, + {-1677.0f, -4334.0f, 2.79f, 1.66f} +}; + +struct MANGOS_DLL_DECL npc_twiggy_flatheadAI : public ScriptedAI +{ + npc_twiggy_flatheadAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + bool EventInProgress; + + uint32 Event_Timer; + uint32 Step; + uint32 Challenger_Count; + uint32 ChallengerDeath_Timer; + + uint64 PlayerGUID; + uint64 BigWillGUID; + uint64 AffrayChallenger[6]; + + void Reset() + { + EventInProgress = false; + + Event_Timer = 2000; + Step = 0; + Challenger_Count = 0; + ChallengerDeath_Timer = 0; + + PlayerGUID = 0; + BigWillGUID = 0; + + for(uint8 i = 0; i < 6; ++i) + AffrayChallenger[i] = 0; + } + + bool CanStartEvent(Player* pPlayer) + { + if (!EventInProgress) + { + EventInProgress = true; + PlayerGUID = pPlayer->GetGUID(); + DoScriptText(SAY_TWIGGY_BEGIN, m_creature, pPlayer); + return true; + } + + debug_log("SD2: npc_twiggy_flathead event already in progress, need to wait."); + return false; + } + + void SetChallengers() + { + for(uint8 i = 0; i < 6; ++i) + { + Creature* pCreature = m_creature->SummonCreature(NPC_AFFRAY_CHALLENGER, AffrayChallengerLoc[i][0], AffrayChallengerLoc[i][1], AffrayChallengerLoc[i][2], AffrayChallengerLoc[i][3], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000); + if (!pCreature) + { + debug_log("SD2: npc_twiggy_flathead event cannot summon challenger as expected."); + continue; + } + + pCreature->setFaction(35); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->HandleEmote(EMOTE_ONESHOT_ROAR); + AffrayChallenger[i] = pCreature->GetGUID(); + } + } + + void SetChallengerReady(Unit *pUnit) + { + pUnit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pUnit->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pUnit->HandleEmote(EMOTE_ONESHOT_ROAR); + pUnit->setFaction(14); + } + + void UpdateAI(const uint32 diff) + { + if (!EventInProgress) + return; + + if (ChallengerDeath_Timer) + { + if (ChallengerDeath_Timer <= diff) + { + for(uint8 i = 0; i < 6; ++i) + { + Creature *challenger = m_creature->GetMap()->GetCreature(AffrayChallenger[i]); + if (challenger && !challenger->isAlive() && challenger->isDead()) + { + DoScriptText(SAY_TWIGGY_DOWN, m_creature); + challenger->RemoveCorpse(); + AffrayChallenger[i] = 0; + continue; + } + } + ChallengerDeath_Timer = 2500; + } else ChallengerDeath_Timer -= diff; + } + + if (Event_Timer < diff) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(PlayerGUID); + + if (!pPlayer || pPlayer->isDead()) + Reset(); + + switch(Step) + { + case 0: + SetChallengers(); + ChallengerDeath_Timer = 2500; + Event_Timer = 5000; + ++Step; + break; + case 1: + DoScriptText(SAY_TWIGGY_FRAY, m_creature); + if (Creature *challenger = m_creature->GetMap()->GetCreature(AffrayChallenger[Challenger_Count])) + SetChallengerReady(challenger); + else Reset(); + ++Challenger_Count; + Event_Timer = 25000; + if (Challenger_Count == 6) + ++Step; + break; + case 2: + if (Unit *temp = m_creature->SummonCreature(NPC_BIG_WILL, -1713.79f, -4342.09f, 6.05f, 6.15f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,300000)) + { + BigWillGUID = temp->GetGUID(); + temp->setFaction(35); + temp->GetMotionMaster()->MovePoint(0, -1682.31f, -4329.68f, 2.78f); + } + Event_Timer = 15000; + ++Step; + break; + case 3: + if (Creature *will = m_creature->GetMap()->GetCreature(BigWillGUID)) + { + will->setFaction(32); + DoScriptText(SAY_BIG_WILL_READY, will, pPlayer); + } + Event_Timer = 5000; + ++Step; + break; + case 4: + Creature *will = m_creature->GetMap()->GetCreature(BigWillGUID); + if (will && will->isDead()) + { + DoScriptText(SAY_TWIGGY_OVER, m_creature); + Reset(); + } else if (!will) + Reset(); + Event_Timer = 5000; + break; + } + } else Event_Timer -= diff; + } +}; + +CreatureAI* GetAI_npc_twiggy_flathead(Creature* pCreature) +{ + return new npc_twiggy_flatheadAI(pCreature); +} + +bool AreaTrigger_at_twiggy_flathead(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (!pPlayer->isDead() && pPlayer->GetQuestStatus(QUEST_AFFRAY) == QUEST_STATUS_INCOMPLETE) + { + if (uint16 slot = pPlayer->FindQuestSlot(QUEST_AFFRAY)) + { + //we don't want player to start event if failed already. + if (pPlayer->GetQuestSlotState(slot) == QUEST_STATE_FAIL) + return true; + } + + Creature* pCreature = GetClosestCreatureWithEntry(pPlayer, NPC_TWIGGY, 30.0f); + + if (!pCreature) + return true; + + if (npc_twiggy_flatheadAI* pTwiggyAI = dynamic_cast(pCreature->AI())) + { + if (pTwiggyAI->CanStartEvent(pPlayer)) + return false; //ok to let mangos process further + } + + return true; + } + return true; +} + +/*##### +## npc_wizzlecranks_shredder +#####*/ + +enum +{ + SAY_START = -1000298, + SAY_STARTUP1 = -1000299, + SAY_STARTUP2 = -1000300, + SAY_MERCENARY = -1000301, + SAY_PROGRESS_1 = -1000302, + SAY_PROGRESS_2 = -1000303, + SAY_PROGRESS_3 = -1000304, + SAY_END = -1000305, + + QUEST_ESCAPE = 863, + FACTION_RATCHET = 637, + NPC_PILOT_WIZZ = 3451, + NPC_MERCENARY = 3282 +}; + +struct MANGOS_DLL_DECL npc_wizzlecranks_shredderAI : public npc_escortAI +{ + npc_wizzlecranks_shredderAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bIsPostEvent = false; + m_uiPostEventTimer = 1000; + m_uiPostEventCount = 0; + Reset(); + } + + bool m_bIsPostEvent; + uint32 m_uiPostEventTimer; + uint32 m_uiPostEventCount; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_bIsPostEvent = false; + m_uiPostEventTimer = 1000; + m_uiPostEventCount = 0; + } + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_STARTUP1, m_creature, pPlayer); + break; + case 9: + SetRun(false); + break; + case 17: + if (Creature* pTemp = m_creature->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + { + DoScriptText(SAY_MERCENARY, pTemp); + m_creature->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + } + break; + case 24: + m_bIsPostEvent = true; + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 9: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_STARTUP2, m_creature, pPlayer); + break; + case 18: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); + SetRun(); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_PILOT_WIZZ) + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + if (pSummoned->GetEntry() == NPC_MERCENARY) + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (m_bIsPostEvent) + { + if (m_uiPostEventTimer < uiDiff) + { + switch(m_uiPostEventCount) + { + case 0: + DoScriptText(SAY_PROGRESS_2, m_creature); + break; + case 1: + DoScriptText(SAY_PROGRESS_3, m_creature); + break; + case 2: + DoScriptText(SAY_END, m_creature); + break; + case 3: + if (Player* pPlayer = GetPlayerForEscort()) + { + pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); + m_creature->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); + } + break; + } + + ++m_uiPostEventCount; + m_uiPostEventTimer = 5000; + } + else + m_uiPostEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_wizzlecranks_shredder(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPE) + { + DoScriptText(SAY_START, pCreature); + pCreature->setFaction(FACTION_RATCHET); + + if (npc_wizzlecranks_shredderAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(true, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_wizzlecranks_shredder(Creature* pCreature) +{ + return new npc_wizzlecranks_shredderAI(pCreature); +} + +void AddSC_the_barrens() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_beaten_corpse"; + newscript->pGossipHello = &GossipHello_npc_beaten_corpse; + newscript->pGossipSelect = &GossipSelect_npc_beaten_corpse; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_gilthares"; + newscript->GetAI = &GetAI_npc_gilthares; + newscript->pQuestAccept = &QuestAccept_npc_gilthares; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_sputtervalve"; + newscript->pGossipHello = &GossipHello_npc_sputtervalve; + newscript->pGossipSelect = &GossipSelect_npc_sputtervalve; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_taskmaster_fizzule"; + newscript->GetAI = &GetAI_npc_taskmaster_fizzule; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_twiggy_flathead"; + newscript->GetAI = &GetAI_npc_twiggy_flathead; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_twiggy_flathead"; + newscript->pAreaTrigger = &AreaTrigger_at_twiggy_flathead; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_wizzlecranks_shredder"; + newscript->GetAI = &GetAI_npc_wizzlecranks_shredder; + newscript->pQuestAccept = &QuestAccept_npc_wizzlecranks_shredder; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/thousand_needles.cpp b/scripts/kalimdor/thousand_needles.cpp new file mode 100644 index 0000000..2df92cc --- /dev/null +++ b/scripts/kalimdor/thousand_needles.cpp @@ -0,0 +1,398 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Thousand_Needles +SD%Complete: 90 +SDComment: Quest support: 1950, 4770, 4904, 4966 +SDCategory: Thousand Needles +EndScriptData +*/ + +/* ContentData +npc_kanati +npc_lakota_windsong +npc_paoka_swiftmountain +npc_plucky_johnson +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +# npc_kanati +######*/ + +enum +{ + SAY_KAN_START = -1000410, + + QUEST_PROTECT_KANATI = 4966, + NPC_GALAK_ASS = 10720 +}; + +const float m_afGalakLoc[] = {-4867.387695f, -1357.353760f, -48.226f}; + +struct MANGOS_DLL_DECL npc_kanatiAI : public npc_escortAI +{ + npc_kanatiAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(SAY_KAN_START, m_creature); + DoSpawnGalak(); + break; + case 1: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature); + break; + } + } + + void DoSpawnGalak() + { + for(int i = 0; i < 3; ++i) + m_creature->SummonCreature(NPC_GALAK_ASS, + m_afGalakLoc[0], m_afGalakLoc[1], m_afGalakLoc[2], 0.0f, + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_kanati(Creature* pCreature) +{ + return new npc_kanatiAI(pCreature); +} + +bool QuestAccept_npc_kanati(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_PROTECT_KANATI) + { + if (npc_kanatiAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest, true); + } + return true; +} + +/*###### +# npc_lakota_windsong +######*/ + +enum +{ + SAY_LAKO_START = -1000365, + SAY_LAKO_LOOK_OUT = -1000366, + SAY_LAKO_HERE_COME = -1000367, + SAY_LAKO_MORE = -1000368, + SAY_LAKO_END = -1000369, + + QUEST_FREE_AT_LAST = 4904, + NPC_GRIM_BANDIT = 10758, + + ID_AMBUSH_1 = 0, + ID_AMBUSH_2 = 2, + ID_AMBUSH_3 = 4 +}; + +float m_afBanditLoc[6][6]= +{ + {-4905.479492f, -2062.732666f, 84.352f}, + {-4915.201172f, -2073.528320f, 84.733f}, + {-4878.883301f, -1986.947876f, 91.966f}, + {-4877.503906f, -1966.113403f, 91.859f}, + {-4767.985352f, -1873.169189f, 90.192f}, + {-4788.861328f, -1888.007813f, 89.888f} +}; + +struct MANGOS_DLL_DECL npc_lakota_windsongAI : public npc_escortAI +{ + npc_lakota_windsongAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 8: + DoScriptText(SAY_LAKO_LOOK_OUT, m_creature); + DoSpawnBandits(ID_AMBUSH_1); + break; + case 14: + DoScriptText(SAY_LAKO_HERE_COME, m_creature); + DoSpawnBandits(ID_AMBUSH_2); + break; + case 21: + DoScriptText(SAY_LAKO_MORE, m_creature); + DoSpawnBandits(ID_AMBUSH_3); + break; + case 45: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature); + break; + } + } + + void DoSpawnBandits(int uiAmbushId) + { + for(int i = 0; i < 2; ++i) + m_creature->SummonCreature(NPC_GRIM_BANDIT, + m_afBanditLoc[i+uiAmbushId][0], m_afBanditLoc[i+uiAmbushId][1], m_afBanditLoc[i+uiAmbushId][2], 0.0f, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } +}; + +CreatureAI* GetAI_npc_lakota_windsong(Creature* pCreature) +{ + return new npc_lakota_windsongAI(pCreature); +} + +bool QuestAccept_npc_lakota_windsong(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_FREE_AT_LAST) + { + DoScriptText(SAY_LAKO_START, pCreature, pPlayer); + pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE); + + if (npc_lakota_windsongAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +# npc_paoka_swiftmountain +######*/ + +enum +{ + SAY_START = -1000362, + SAY_WYVERN = -1000363, + SAY_COMPLETE = -1000364, + + QUEST_HOMEWARD = 4770, + NPC_WYVERN = 4107 +}; + +float m_afWyvernLoc[3][3]= +{ + {-4990.606f, -906.057f, -5.343f}, + {-4970.241f, -927.378f, -4.951f}, + {-4985.364f, -952.528f, -5.199f} +}; + +struct MANGOS_DLL_DECL npc_paoka_swiftmountainAI : public npc_escortAI +{ + npc_paoka_swiftmountainAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 15: + DoScriptText(SAY_WYVERN, m_creature); + DoSpawnWyvern(); + break; + case 26: + DoScriptText(SAY_COMPLETE, m_creature); + break; + case 27: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature); + break; + } + } + + void DoSpawnWyvern() + { + for(int i = 0; i < 3; ++i) + m_creature->SummonCreature(NPC_WYVERN, + m_afWyvernLoc[i][0], m_afWyvernLoc[i][1], m_afWyvernLoc[i][2], 0.0f, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } +}; + +CreatureAI* GetAI_npc_paoka_swiftmountain(Creature* pCreature) +{ + return new npc_paoka_swiftmountainAI(pCreature); +} + +bool QuestAccept_npc_paoka_swiftmountain(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_HOMEWARD) + { + DoScriptText(SAY_START, pCreature, pPlayer); + pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE); + + if (npc_paoka_swiftmountainAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*###### +# "Plucky" Johnson +######*/ + +enum +{ + FACTION_FRIENDLY = 35, + QUEST_SCOOP = 1950, + SPELL_PLUCKY_HUMAN = 9192, + SPELL_PLUCKY_CHICKEN = 9220 +}; + +#define GOSSIP_ITEM_QUEST "Please tell me the Phrase.." + +struct MANGOS_DLL_DECL npc_plucky_johnsonAI : public ScriptedAI +{ + npc_plucky_johnsonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormFaction; + uint32 m_uiResetTimer; + + void Reset() + { + m_uiResetTimer = 120000; + + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + m_creature->CastSpell(m_creature, SPELL_PLUCKY_CHICKEN, false); + } + + void ReceiveEmote(Player* pPlayer, uint32 uiTextEmote) + { + if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + { + if (uiTextEmote == TEXTEMOTE_BECKON) + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); + } + } + + if (uiTextEmote == TEXTEMOTE_CHICKEN) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + return; + else + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->CastSpell(m_creature, SPELL_PLUCKY_HUMAN, false); + m_creature->HandleEmote(EMOTE_ONESHOT_WAVE); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP)) + { + if (m_uiResetTimer < uiDiff) + { + if (!m_creature->getVictim()) + EnterEvadeMode(); + else + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + return; + } + else + m_uiResetTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_plucky_johnson(Creature* pCreature) +{ + return new npc_plucky_johnsonAI(pCreature); +} + +bool GossipHello_npc_plucky_johnson(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_QUEST, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(720, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_plucky_johnson(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->SEND_GOSSIP_MENU(738, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(QUEST_SCOOP); + } + + return true; +} + +void AddSC_thousand_needles() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_kanati"; + newscript->GetAI = &GetAI_npc_kanati; + newscript->pQuestAccept = &QuestAccept_npc_kanati; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lakota_windsong"; + newscript->GetAI = &GetAI_npc_lakota_windsong; + newscript->pQuestAccept = &QuestAccept_npc_lakota_windsong; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_paoka_swiftmountain"; + newscript->GetAI = &GetAI_npc_paoka_swiftmountain; + newscript->pQuestAccept = &QuestAccept_npc_paoka_swiftmountain; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_plucky_johnson"; + newscript->GetAI = &GetAI_npc_plucky_johnson; + newscript->pGossipHello = &GossipHello_npc_plucky_johnson; + newscript->pGossipSelect = &GossipSelect_npc_plucky_johnson; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/thunder_bluff.cpp b/scripts/kalimdor/thunder_bluff.cpp new file mode 100644 index 0000000..e3e104f --- /dev/null +++ b/scripts/kalimdor/thunder_bluff.cpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Thunder_Bluff +SD%Complete: 100 +SDComment: Quest support: 925 +SDCategory: Thunder Bluff +EndScriptData */ + +#include "precompiled.h" + +/*##### +# npc_cairne_bloodhoof +######*/ + +#define SPELL_BERSERKER_CHARGE 16636 +#define SPELL_CLEAVE 16044 +#define SPELL_MORTAL_STRIKE 16856 +#define SPELL_THUNDERCLAP 23931 +#define SPELL_UPPERCUT 22916 + +//TODO: verify abilities/timers +struct MANGOS_DLL_DECL npc_cairne_bloodhoofAI : public ScriptedAI +{ + npc_cairne_bloodhoofAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 BerserkerCharge_Timer; + uint32 Cleave_Timer; + uint32 MortalStrike_Timer; + uint32 Thunderclap_Timer; + uint32 Uppercut_Timer; + + void Reset() + { + BerserkerCharge_Timer = 30000; + Cleave_Timer = 5000; + MortalStrike_Timer = 10000; + Thunderclap_Timer = 15000; + Uppercut_Timer = 10000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (BerserkerCharge_Timer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + DoCastSpellIfCan(target,SPELL_BERSERKER_CHARGE); + BerserkerCharge_Timer = 25000; + }else BerserkerCharge_Timer -= diff; + + if (Uppercut_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 20000; + }else Uppercut_Timer -= diff; + + if (Thunderclap_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_THUNDERCLAP); + Thunderclap_Timer = 15000; + }else Thunderclap_Timer -= diff; + + if (MortalStrike_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MORTAL_STRIKE); + MortalStrike_Timer = 15000; + }else MortalStrike_Timer -= diff; + + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_cairne_bloodhoof(Creature* pCreature) +{ + return new npc_cairne_bloodhoofAI(pCreature); +} + +bool GossipHello_npc_cairne_bloodhoof(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(925) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I know this is rather silly but a young ward who is a bit shy would like your hoofprint.", GOSSIP_SENDER_MAIN, GOSSIP_SENDER_INFO); + + pPlayer->SEND_GOSSIP_MENU(7013, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_cairne_bloodhoof(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_SENDER_INFO) + { + pPlayer->CastSpell(pPlayer, 23123, false); + pPlayer->SEND_GOSSIP_MENU(7014, pCreature->GetGUID()); + } + return true; +} + +void AddSC_thunder_bluff() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_cairne_bloodhoof"; + newscript->GetAI = &GetAI_npc_cairne_bloodhoof; + newscript->pGossipHello = &GossipHello_npc_cairne_bloodhoof; + newscript->pGossipSelect = &GossipSelect_npc_cairne_bloodhoof; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/ungoro_crater.cpp b/scripts/kalimdor/ungoro_crater.cpp new file mode 100644 index 0000000..7db7440 --- /dev/null +++ b/scripts/kalimdor/ungoro_crater.cpp @@ -0,0 +1,345 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ungoro_Crater +SD%Complete: 100 +SDComment: Quest support: 4245, 4491 +SDCategory: Un'Goro Crater +EndScriptData */ + +/* ContentData +npc_ringo +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "follower_ai.h" + +/*###### +## npc_ame01 +######*/ + +enum +{ + SAY_AME_START = -1000446, + SAY_AME_PROGRESS = -1000447, + SAY_AME_END = -1000448, + SAY_AME_AGGRO1 = -1000449, + SAY_AME_AGGRO2 = -1000450, + SAY_AME_AGGRO3 = -1000451, + + QUEST_CHASING_AME = 4245 +}; + +struct MANGOS_DLL_DECL npc_ame01AI : public npc_escortAI +{ + npc_ame01AI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void Reset() {} + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(SAY_AME_START, m_creature); + break; + case 19: + DoScriptText(SAY_AME_PROGRESS, m_creature); + break; + case 37: + DoScriptText(SAY_AME_END, m_creature); + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_CHASING_AME, m_creature); + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->GetTypeId() == TYPEID_PLAYER) + return; + + if (Player* pPlayer = GetPlayerForEscort()) + { + if (pPlayer->getVictim() && pPlayer->getVictim() == pWho) + return; + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AME_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AME_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AME_AGGRO3, m_creature); break; + } + } + } +}; + +bool QuestAccept_npc_ame01(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_CHASING_AME) + { + if (npc_ame01AI* pAmeAI = dynamic_cast(pCreature->AI())) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORT_A_PASSIVE); + else if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORT_H_PASSIVE); + + pAmeAI->Start(false, pPlayer->GetGUID(), pQuest); + } + } + return true; +} + +CreatureAI* GetAI_npc_ame01(Creature* pCreature) +{ + return new npc_ame01AI(pCreature); +} + +/*#### +# npc_ringo +####*/ + +enum +{ + SAY_RIN_START_1 = -1000416, + SAY_RIN_START_2 = -1000417, + + SAY_FAINT_1 = -1000418, + SAY_FAINT_2 = -1000419, + SAY_FAINT_3 = -1000420, + SAY_FAINT_4 = -1000421, + + SAY_WAKE_1 = -1000422, + SAY_WAKE_2 = -1000423, + SAY_WAKE_3 = -1000424, + SAY_WAKE_4 = -1000425, + + SAY_RIN_END_1 = -1000426, + SAY_SPR_END_2 = -1000427, + SAY_RIN_END_3 = -1000428, + EMOTE_RIN_END_4 = -1000429, + EMOTE_RIN_END_5 = -1000430, + SAY_RIN_END_6 = -1000431, + SAY_SPR_END_7 = -1000432, + EMOTE_RIN_END_8 = -1000433, + + SPELL_REVIVE_RINGO = 15591, + QUEST_A_LITTLE_HELP = 4491, + NPC_SPRAGGLE = 9997 +}; + +struct MANGOS_DLL_DECL npc_ringoAI : public FollowerAI +{ + npc_ringoAI(Creature* pCreature) : FollowerAI(pCreature) { Reset(); } + + uint32 m_uiFaintTimer; + uint32 m_uiEndEventProgress; + uint32 m_uiEndEventTimer; + + Unit* pSpraggle; + + void Reset() + { + m_uiFaintTimer = urand(30000, 60000); + m_uiEndEventProgress = 0; + m_uiEndEventTimer = 1000; + pSpraggle = NULL; + } + + void MoveInLineOfSight(Unit *pWho) + { + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !HasFollowState(STATE_FOLLOW_COMPLETE) && pWho->GetEntry() == NPC_SPRAGGLE) + { + if (m_creature->IsWithinDistInMap(pWho, INTERACTION_DISTANCE)) + { + if (Player* pPlayer = GetLeaderForFollower()) + { + if (pPlayer->GetQuestStatus(QUEST_A_LITTLE_HELP) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_A_LITTLE_HELP, m_creature); + } + + pSpraggle = pWho; + SetFollowComplete(true); + } + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (HasFollowState(STATE_FOLLOW_INPROGRESS | STATE_FOLLOW_PAUSED) && pSpell->Id == SPELL_REVIVE_RINGO) + ClearFaint(); + } + + void SetFaint() + { + if (!HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + SetFollowPaused(true); + + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_FAINT_1, m_creature); break; + case 1: DoScriptText(SAY_FAINT_2, m_creature); break; + case 2: DoScriptText(SAY_FAINT_3, m_creature); break; + case 3: DoScriptText(SAY_FAINT_4, m_creature); break; + } + } + + //what does actually happen here? Emote? Aura? + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + } + + void ClearFaint() + { + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + return; + + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_WAKE_1, m_creature); break; + case 1: DoScriptText(SAY_WAKE_2, m_creature); break; + case 2: DoScriptText(SAY_WAKE_3, m_creature); break; + case 3: DoScriptText(SAY_WAKE_4, m_creature); break; + } + + SetFollowPaused(false); + } + + void UpdateFollowerAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasFollowState(STATE_FOLLOW_POSTEVENT)) + { + if (m_uiEndEventTimer < uiDiff) + { + if (!pSpraggle || !pSpraggle->isAlive()) + { + SetFollowComplete(); + return; + } + + switch(m_uiEndEventProgress) + { + case 1: + DoScriptText(SAY_RIN_END_1, m_creature); + m_uiEndEventTimer = 3000; + break; + case 2: + DoScriptText(SAY_SPR_END_2, pSpraggle); + m_uiEndEventTimer = 5000; + break; + case 3: + DoScriptText(SAY_RIN_END_3, m_creature); + m_uiEndEventTimer = 1000; + break; + case 4: + DoScriptText(EMOTE_RIN_END_4, m_creature); + SetFaint(); + m_uiEndEventTimer = 9000; + break; + case 5: + DoScriptText(EMOTE_RIN_END_5, m_creature); + ClearFaint(); + m_uiEndEventTimer = 1000; + break; + case 6: + DoScriptText(SAY_RIN_END_6, m_creature); + m_uiEndEventTimer = 3000; + break; + case 7: + DoScriptText(SAY_SPR_END_7, pSpraggle); + m_uiEndEventTimer = 10000; + break; + case 8: + DoScriptText(EMOTE_RIN_END_8, m_creature); + m_uiEndEventTimer = 5000; + break; + case 9: + SetFollowComplete(); + break; + } + + ++m_uiEndEventProgress; + } + else + m_uiEndEventTimer -= uiDiff; + } + else if (HasFollowState(STATE_FOLLOW_INPROGRESS)) + { + if (!HasFollowState(STATE_FOLLOW_PAUSED)) + { + if (m_uiFaintTimer < uiDiff) + { + SetFaint(); + m_uiFaintTimer = urand(60000, 120000); + } + else + m_uiFaintTimer -= uiDiff; + } + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_ringo(Creature* pCreature) +{ + return new npc_ringoAI(pCreature); +} + +bool QuestAccept_npc_ringo(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_A_LITTLE_HELP) + { + if (npc_ringoAI* pRingoAI = dynamic_cast(pCreature->AI())) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + pRingoAI->StartFollow(pPlayer, FACTION_ESCORT_N_FRIEND_PASSIVE, pQuest); + } + } + + return true; +} + +void AddSC_ungoro_crater() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_ame01"; + pNewScript->GetAI = &GetAI_npc_ame01; + pNewScript->pQuestAccept = &QuestAccept_npc_ame01; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_ringo"; + pNewScript->GetAI = &GetAI_npc_ringo; + pNewScript->pQuestAccept = &QuestAccept_npc_ringo; + pNewScript->RegisterSelf(); +} diff --git a/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp b/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp new file mode 100644 index 0000000..7a24380 --- /dev/null +++ b/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp @@ -0,0 +1,146 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Wailing_Caverns +SD%Complete: 90 +SDComment: +SDCategory: Wailing Caverns +EndScriptData */ + +#include "precompiled.h" +#include "wailing_caverns.h" + +instance_wailing_caverns::instance_wailing_caverns(Map* pMap) : ScriptedInstance(pMap), + m_uiNaralexGUID(0) +{ + Initialize(); +} + +void instance_wailing_caverns::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +} + +void instance_wailing_caverns::OnCreatureCreate(Creature* pCreature) +{ + switch (pCreature->GetEntry()) + { + case NPC_NARLEX: m_uiNaralexGUID = pCreature->GetGUID(); break; + } +} + +void instance_wailing_caverns::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_ANACONDRA: + m_auiEncounter[0] = uiData; + break; + case TYPE_COBRAHN: + m_auiEncounter[1] = uiData; + break; + case TYPE_PYTHAS: + m_auiEncounter[2] = uiData; + break; + case TYPE_SERPENTIS: + m_auiEncounter[3] = uiData; + break; + case TYPE_DISCIPLE: + m_auiEncounter[4] = uiData; + break; + case TYPE_MUTANOUS: + m_auiEncounter[5] = uiData; + break; + } + + if (m_auiEncounter[0] == DONE && m_auiEncounter[1] == DONE && m_auiEncounter[2] == DONE && m_auiEncounter[3] == DONE && m_auiEncounter[4] == NOT_STARTED) + m_auiEncounter[4] = SPECIAL; + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + + strInstData = saveStream.str(); + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_wailing_caverns::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] + >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_wailing_caverns::GetData(uint32 uiType) +{ + switch (uiType) + { + case TYPE_ANACONDRA: return m_auiEncounter[0]; break; + case TYPE_COBRAHN: return m_auiEncounter[1]; break; + case TYPE_PYTHAS: return m_auiEncounter[2]; break; + case TYPE_SERPENTIS: return m_auiEncounter[3]; break; + case TYPE_DISCIPLE: return m_auiEncounter[4]; break; + case TYPE_MUTANOUS: return m_auiEncounter[5]; break; + } + return 0; +} + +uint64 instance_wailing_caverns::GetData64(uint32 uiData) +{ + switch (uiData) + { + case DATA_NARALEX: return m_uiNaralexGUID; + } + return 0; +} + +InstanceData* GetInstanceData_instance_wailing_caverns(Map* pMap) +{ + return new instance_wailing_caverns(pMap); +} + +void AddSC_instance_wailing_caverns() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_wailing_caverns"; + newscript->GetInstanceData = &GetInstanceData_instance_wailing_caverns; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/wailing_caverns/wailing_caverns.h b/scripts/kalimdor/wailing_caverns/wailing_caverns.h new file mode 100644 index 0000000..bf315d1 --- /dev/null +++ b/scripts/kalimdor/wailing_caverns/wailing_caverns.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_WAILING_CAVERNS_H +#define DEF_WAILING_CAVERNS_H + +enum +{ + MAX_ENCOUNTER = 6, + + TYPE_ANACONDRA = 0, + TYPE_COBRAHN = 1, + TYPE_PYTHAS = 2, + TYPE_SERPENTIS = 3, + TYPE_DISCIPLE = 4, + TYPE_MUTANOUS = 5, + + DATA_NARALEX = 6, + + NPC_NARLEX = 3679 +}; + +class MANGOS_DLL_DECL instance_wailing_caverns : public ScriptedInstance +{ + public: + instance_wailing_caverns(Map* pMap); + ~instance_wailing_caverns() {} + + void Initialize(); + + void OnCreatureCreate(Creature* pCreature); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiNaralexGUID; +}; +#endif diff --git a/scripts/kalimdor/winterspring.cpp b/scripts/kalimdor/winterspring.cpp new file mode 100644 index 0000000..3d8e550 --- /dev/null +++ b/scripts/kalimdor/winterspring.cpp @@ -0,0 +1,157 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Winterspring +SD%Complete: 90 +SDComment: Quest support: 5126 (Loraxs' tale missing proper gossip items text). Vendor Rivern Frostwind. Obtain Cache of Mau'ari +SDCategory: Winterspring +EndScriptData */ + +/* ContentData +npc_lorax +npc_rivern_frostwind +npc_witch_doctor_mauari +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_lorax +######*/ + +bool GossipHello_npc_lorax(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(5126) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Talk to me", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lorax(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What do you do here?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(3759, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I can help you", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(3760, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What deal?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(3761, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Then what happened?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(3762, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "He is not safe, i'll make sure of that.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(3763, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(5126); + break; + } + return true; +} + +/*###### +## npc_rivern_frostwind +######*/ + +bool GossipHello_npc_rivern_frostwind(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor() && pPlayer->GetReputationRank(589) == REP_EXALTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_rivern_frostwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_witch_doctor_mauari +######*/ + +bool GossipHello_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(975)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I'd like you to make me a new Cache of Mau'ari please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(3377, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(3375, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_witch_doctor_mauari(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction==GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, 16351, false); + } + + return true; +} + +void AddSC_winterspring() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_lorax"; + newscript->pGossipHello = &GossipHello_npc_lorax; + newscript->pGossipSelect = &GossipSelect_npc_lorax; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_rivern_frostwind"; + newscript->pGossipHello = &GossipHello_npc_rivern_frostwind; + newscript->pGossipSelect = &GossipSelect_npc_rivern_frostwind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_witch_doctor_mauari"; + newscript->pGossipHello = &GossipHello_npc_witch_doctor_mauari; + newscript->pGossipSelect = &GossipSelect_npc_witch_doctor_mauari; + newscript->RegisterSelf(); +} diff --git a/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/scripts/kalimdor/zulfarrak/zulfarrak.cpp new file mode 100644 index 0000000..2b41e19 --- /dev/null +++ b/scripts/kalimdor/zulfarrak/zulfarrak.cpp @@ -0,0 +1,237 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zulfarrak +SD%Complete: 50 +SDComment: Consider it temporary, no instance script made for this instance yet. +SDCategory: Zul'Farrak +EndScriptData */ + +/* ContentData +npc_sergeant_bly +npc_weegli_blastfuse +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_sergeant_bly +######*/ + +enum +{ + FACTION_HOSTILE = 14, + FACTION_FRIENDLY = 35, + + SPELL_SHIELD_BASH = 11972, + SPELL_REVENGE = 12170 +}; +#define GOSSIP_BLY "That's it! I'm tired of helping you out. It's time we settled things on the battlefield!" + +//find Bly's gossip menus + +struct MANGOS_DLL_DECL npc_sergeant_blyAI : public ScriptedAI +{ + npc_sergeant_blyAI(Creature* pCreature) : ScriptedAI(pCreature) + { + //m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + //ScriptedInstance* m_pInstance; + + uint32 m_uiShieldBashTimer; + uint32 m_uiRevengeTimer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Mangos support required. + + void Reset() + { + m_uiShieldBashTimer = 5000; + m_uiRevengeTimer = 8000; + + m_creature->setFaction(FACTION_FRIENDLY); + + /*if (m_pInstance) + m_pInstance->SetData(0, NOT_STARTED);*/ + } + + void Aggro(Unit* pWho) + { + /*if (m_pInstance) + m_pInstance->SetData(0, IN_PROGRESS);*/ + } + + void JustDied(Unit* pVictim) + { + /*if (m_pInstance) + m_pInstance->SetData(0, DONE);*/ + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiShieldBashTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHIELD_BASH); + m_uiShieldBashTimer = 15000; + } + else + m_uiShieldBashTimer -= uiDiff; + + if (m_uiRevengeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_REVENGE); + m_uiRevengeTimer = 10000; + } + else + m_uiRevengeTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_sergeant_bly(Creature* pCreature) +{ + return new npc_sergeant_blyAI(pCreature); +} + +bool GossipHello_npc_sergeant_bly(Player* pPlayer, Creature* pCreature) +{ + /*if (m_pInstance->GetData(0) == DONE) + {*/ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1517, pCreature->GetGUID()); + /*} + else if (m_pInstance->GetData(0) == IN_PROGRESS) + pPlayer->SEND_GOSSIP_MENU(1516, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(1515, pCreature->GetGUID());*/ + + return true; +} + +bool GossipSelect_npc_sergeant_bly(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_weegli_blastfuse +######*/ + +enum +{ + SPELL_BOMB = 8858, + SPELL_GOBLIN_LAND_MINE = 21688, + SPELL_SHOOT = 6660, + SPELL_WEEGLIS_BARREL = 10772 +}; + +#define GOSSIP_WEEGLI "[PH] Please blow up the door." + +struct MANGOS_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI +{ + npc_weegli_blastfuseAI(Creature* pCreature) : ScriptedAI(pCreature) + { + //m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + //ScriptedInstance* m_pInstance; + + void Reset() + { + /*if (m_pInstance) + m_pInstance->SetData(0, NOT_STARTED);*/ + } + + void Aggro(Unit* pWho) + { + /*if (m_pInstance) + m_pInstance->SetData(0, IN_PROGRESS);*/ + } + + void JustDied(Unit* pVictim) + { + /*if (m_pInstance) + m_pInstance->SetData(0, DONE);*/ + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_weegli_blastfuse(Creature* pCreature) +{ + return new npc_weegli_blastfuseAI(pCreature); +} + +bool GossipHello_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature) +{ + //event not implemented yet, this is only placeholder for future developement + /*if (m_pInstance->GetData(0) == DONE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1514, pCreature->GetGUID());//if event can proceed to end + } + else if (m_pInstance->GetData(0) == IN_PROGRESS) + pPlayer->SEND_GOSSIP_MENU(1513, pCreature->GetGUID());//if event are in progress + else*/ + pPlayer->SEND_GOSSIP_MENU(1511, pCreature->GetGUID()); //if event not started + return true; +} + +bool GossipSelect_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //here we make him run to door, set the charge and run away off to nowhere + } + return true; +} + +void AddSC_zulfarrak() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_sergeant_bly"; + newscript->GetAI = &GetAI_npc_sergeant_bly; + newscript->pGossipHello = &GossipHello_npc_sergeant_bly; + newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_weegli_blastfuse"; + newscript->GetAI = &GetAI_npc_weegli_blastfuse; + newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse; + newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/ahnkahet/ahnkahet.h b/scripts/northrend/azjol-nerub/ahnkahet/ahnkahet.h new file mode 100644 index 0000000..dcb9d5f --- /dev/null +++ b/scripts/northrend/azjol-nerub/ahnkahet/ahnkahet.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_AHNKAHET_H +#define DEF_AHNKAHET_H +/* Encounters + * Elder Nadox = 1 + * Prince Taldram = 2 + * Jedoga Shadowseeker = 3 + * Herald Volazj = 4 + * Amanitar = 5 +*/ +enum +{ + MAX_ENCOUNTER = 5, + + TYPE_NADOX = 0, + TYPE_TALDARAM = 1, + TYPE_JEDOGA = 2, + TYPE_VOLAZJ = 3, + TYPE_AMANITAR = 4, + + GO_DOOR_TALDARAM = 192236, + GO_ANCIENT_DEVICE_L = 193093, + GO_ANCIENT_DEVICE_R = 193094, + GO_VORTEX = 193564, + + NPC_ELDER_NADOX = 29309, + NPC_JEDOGA_SHADOWSEEKER = 29310 +}; + +#endif diff --git a/scripts/northrend/azjol-nerub/ahnkahet/boss_jedoga.cpp b/scripts/northrend/azjol-nerub/ahnkahet/boss_jedoga.cpp new file mode 100644 index 0000000..106a0d0 --- /dev/null +++ b/scripts/northrend/azjol-nerub/ahnkahet/boss_jedoga.cpp @@ -0,0 +1,462 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Jedoga +SD%Complete: 95% +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "ahnkahet.h" + +enum +{ + SAY_AGGRO = -1619017, + SAY_CALL_SACRIFICE_1 = -1619018, + SAY_CALL_SACRIFICE_2 = -1619019, + SAY_SACRIFICE_1 = -1619020, + SAY_SACRIFICE_2 = -1619021, + SAY_SLAY_1 = -1619022, + SAY_SLAY_2 = -1619023, + SAY_SLAY_3 = -1619024, + SAY_DEATH = -1619025, + SAY_PREACHING_1 = -1619026, + SAY_PREACHING_2 = -1619027, + SAY_PREACHING_3 = -1619028, + SAY_PREACHING_4 = -1619029, + SAY_PREACHING_5 = -1619030, + + SAY_VOLUNTEER_1 = -1619031, //said by the volunteer image + SAY_VOLUNTEER_2 = -1619032, + + NPC_VOLUNTEER = 30385, + NPC_TWILIGHT_INITIATE = 30114, + NPC_VISUAL_TRIGGER = 38667, + + FAC_FRIENDLY = 35, + FAC_HOSTILE = 16, + + SPELL_SPHERE_VISUAL = 56075, + SPELL_SACRIFICE_VISUAL = 56133, + SPELL_DARK_BEAM = 46016, + SPELL_GIFT_OF_THE_HERALD = 56219, + + SPELL_LIGHTING_BALL = 56891, + SPELL_LIGHTING_BALL_H = 60032, + + SPELL_THUNDERSHOCK = 56926, + SPELL_THUNDERSHOCK_H = 60029, + + SPELL_CYCLONE_STRIKE = 56855, + SPELL_CYCLONE_STRIKE_H = 60030, + + ACHIEVEMENT_VOLUNTEER_WORK = 2056 +}; + +const float volunteerPos[7][4] = +{ + {362.002197f, -729.438904f, -16.179300f, 1.125480f}, + {372.852570f, -730.883850f, -16.179300f, 1.688610f}, + {379.525360f, -726.276672f, -16.179300f, 2.160635f}, + {385.052338f, -718.627014f, -16.179300f, 2.408821f}, + {391.472870f, -710.442200f, -16.082842f, 3.012007f}, + {394.789246f, -701.645203f, -16.179674f, 3.290038f}, + {393.005707f, -694.984816f, -16.179674f, 3.748711f} +}; + +#define MAX_VOLUNTEER 7 + +#define CORD_CENTER_X 372.330994f +#define CORD_CENTER_Y -705.278015f +#define CORD_CENTER_Z -16.179701f + +#define CORD_ABOVE_Z -0.624178f + +#define START_X 372.33f +#define START_Y -705.28f +#define START_Z -8.904f +#define START_O 5.427970f + +/*###### +## boss_jedoga +######*/ + +struct MANGOS_DLL_DECL boss_jedogaAI : public ScriptedAI +{ + boss_jedogaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool volunteerPhase; + bool getsAchievement; + + std::list volunteerGUIDList; + + Creature* pChosenVolunteer; + Creature* pVisualTrigger; + + uint32 volunteerDeathTimer; + uint32 volunteerPhaseTimer; + uint32 volunteerReachedTimer; + uint32 lightingBallTimer; + uint32 thundershockTimer; + uint32 cycloneStrikeTimer; + + uint8 victimCounter; + + void Reset() + { + DepawnVolunteers(); + victimCounter = 0; + volunteerPhase = false; + volunteerDeathTimer = 9999999; + volunteerPhaseTimer = 20000; + volunteerReachedTimer = 9999999; + lightingBallTimer = 4000; + thundershockTimer = 6000; + cycloneStrikeTimer = 8000; + getsAchievement = true; + + volunteerGUIDList.clear(); + + if(m_pInstance) + m_pInstance->SetData(TYPE_JEDOGA,NOT_STARTED); + + m_creature->NearTeleportTo(START_X,START_Y,START_Z,START_O); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->CastSpell(m_creature,SPELL_SPHERE_VISUAL,true); + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PASSIVE); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + SpawnVolunteers(); + if(m_pInstance) + m_pInstance->SetData(TYPE_JEDOGA,IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + if(m_pInstance) + m_pInstance->SetData(TYPE_JEDOGA,DONE); + DoScriptText(SAY_DEATH, m_creature); + DepawnVolunteers(); + + /*if(!m_bIsRegularMode && getsAchievement) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + *itr->getSource() //add Achievement here + } + }*/ + } + + void MoveInLineOfSight(Unit* pWho) + { + + } + + void SpawnVolunteers() + { + for (int i = 0; i < MAX_VOLUNTEER; i++) + { + if (Creature* pVolunteer = m_creature->SummonCreature(NPC_VOLUNTEER, + volunteerPos[i][0], volunteerPos[i][1], volunteerPos[i][2],volunteerPos[i][3], TEMPSUMMON_DEAD_DESPAWN, 5000)) + { + pVolunteer->setFaction(FAC_FRIENDLY); + pVolunteer->DeleteThreatList(); + pVolunteer->CastSpell(pVolunteer, SPELL_SPHERE_VISUAL, true); + pVolunteer->HandleEmoteCommand(EMOTE_STATE_KNEEL); + volunteerGUIDList.push_back(pVolunteer->GetGUID()); + } + } + } + + void DepawnVolunteers() + { + if (!volunteerGUIDList.empty() && m_pInstance) + { + for(std::list::iterator itr = volunteerGUIDList.begin(); itr != volunteerGUIDList.end(); ++itr) + { + if (Creature* pVolunteer = m_pInstance->instance->GetCreature(*itr)) + { + if (pVolunteer->isAlive()) + pVolunteer->ForcedDespawn(); + } + } + } + } + + void MoveVolunteer() + { + if (Creature* pVolunteer = SelectRandomCreatureOfEntryInRange(NPC_VOLUNTEER, 100.0f)) + { + if (pVolunteer->isAlive()) + { + pVolunteer->GetMotionMaster()->Clear(); + pVolunteer->GetMotionMaster()->MovePoint(0, CORD_CENTER_X, CORD_CENTER_Y, CORD_CENTER_Z); + pVolunteer->setFaction(FAC_HOSTILE); + pVolunteer->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); + pVolunteer->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL); + pChosenVolunteer = pVolunteer; + switch(urand(0, 1)) + { + case 0: DoScriptText(SAY_CALL_SACRIFICE_1, pVolunteer); break; + case 1: DoScriptText(SAY_CALL_SACRIFICE_2, pVolunteer); break; + } + + if (pVisualTrigger = m_creature->SummonCreature(NPC_VISUAL_TRIGGER, CORD_CENTER_X, CORD_CENTER_Y, CORD_CENTER_X, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + pVisualTrigger->GetMotionMaster()->Clear(); + pVisualTrigger->GetMotionMaster()->MoveIdle(); + pVisualTrigger->SetVisibility(VISIBILITY_ON); + pVisualTrigger->CastSpell(pVisualTrigger, SPELL_SACRIFICE_VISUAL, true); + } + } + else + { + MoveVolunteer(); + if (pVisualTrigger) + pVisualTrigger->ForcedDespawn(); + } + } + } + + Creature* SelectRandomCreatureOfEntryInRange(uint32 uiEntry, float fRange) + { + std::list lCreatureList; + GetCreatureListWithEntryInGrid(lCreatureList, m_creature, uiEntry, fRange); + + if (lCreatureList.empty()) + return NULL; + + std::list::iterator iter = lCreatureList.begin(); + advance(iter, urand(0, lCreatureList.size()-1)); + + return *iter; + } + + void MovementInform(uint32 mtype, uint32 id) + { + if (m_creature->GetPositionZ() > CORD_CENTER_Z + 10.0f) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->CastSpell(m_creature, SPELL_SPHERE_VISUAL, true); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + } + + bool allStartMobsDead() + { + std::list lCreatureList; + GetCreatureListWithEntryInGrid(lCreatureList, m_creature, NPC_TWILIGHT_INITIATE, 40.); + + if (!lCreatureList.empty()) + for(std::list::iterator itr = lCreatureList.begin(); itr != lCreatureList.end(); ++itr) + if ((*itr)->isAlive()) + return false; + + return true; + } + + void UpdateAI(const uint32 uiDiff) + { + if(m_pInstance && m_pInstance->GetData(TYPE_JEDOGA) == NOT_STARTED) + if(allStartMobsDead()) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PASSIVE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveAurasDueToSpell(SPELL_SPHERE_VISUAL); + m_creature->SetInCombatWithZone(); + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (volunteerPhase) + { + if (volunteerReachedTimer < uiDiff) + { + if (pChosenVolunteer && pChosenVolunteer->isAlive()) + { + m_creature->CastSpell(m_creature, SPELL_GIFT_OF_THE_HERALD, true); + m_creature->CastSpell(pChosenVolunteer, SPELL_DARK_BEAM, true); + pChosenVolunteer->GetMotionMaster()->MoveIdle(); + pChosenVolunteer->RemoveAllAuras(); + pChosenVolunteer->setFaction(FAC_FRIENDLY); + pChosenVolunteer->SetHealth(m_creature->GetMaxHealth()); + switch(urand(0, 1)) + { + case 0: DoScriptText(SAY_SACRIFICE_1, pChosenVolunteer); break; + case 1: DoScriptText(SAY_SACRIFICE_2, pChosenVolunteer); break; + } + } + volunteerReachedTimer = 9999999; + }else volunteerReachedTimer -= uiDiff; + + if (volunteerDeathTimer < uiDiff) + { + if (pChosenVolunteer) + volunteerGUIDList.remove(pChosenVolunteer->GetGUID()); + + if (pChosenVolunteer && pChosenVolunteer->isAlive()) + pChosenVolunteer->DealDamage(pChosenVolunteer, pChosenVolunteer->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + if (volunteerGUIDList.empty() || victimCounter >= 6) + { + DepawnVolunteers(); + SpawnVolunteers(); + victimCounter = 0; + } + + m_creature->NearTeleportTo(CORD_CENTER_X, CORD_CENTER_Y, CORD_CENTER_Z, START_O); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + m_creature->GetMotionMaster()->MoveChase(pTarget); + m_creature->Attack(pTarget, true); + } + + if (pVisualTrigger) + pVisualTrigger->ForcedDespawn(); + + victimCounter++; + volunteerPhase = false; + volunteerDeathTimer = 9999999; + }else volunteerDeathTimer -= uiDiff; + } + else + { + if (volunteerPhaseTimer < uiDiff) + { + MoveVolunteer(); + m_creature->GetMotionMaster()->Clear(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->NearTeleportTo(CORD_CENTER_X, CORD_CENTER_Y, CORD_ABOVE_Z, START_O); + volunteerPhase = true; + volunteerPhaseTimer = 32000; + volunteerDeathTimer = 16000; + volunteerReachedTimer = 14500; + }else volunteerPhaseTimer -= uiDiff; + + if (lightingBallTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_LIGHTING_BALL : SPELL_LIGHTING_BALL_H); + lightingBallTimer = urand(4000, 6000); + }else lightingBallTimer -= uiDiff; + + if (thundershockTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0), m_bIsRegularMode ? SPELL_THUNDERSHOCK : SPELL_THUNDERSHOCK_H); + thundershockTimer = urand(12000, 18000); + }else thundershockTimer -= uiDiff; + + if (cycloneStrikeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_CYCLONE_STRIKE : SPELL_CYCLONE_STRIKE_H); + cycloneStrikeTimer = urand(14000, 20000); + }else cycloneStrikeTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jedoga(Creature* pCreature) +{ + return new boss_jedogaAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_jedoga_volunteerAI : public ScriptedAI +{ + mob_jedoga_volunteerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + SetCombatMovement(false); + Reset(); + } + + ScriptedInstance *m_pInstance; // the instance + + void Reset() { } + + void MovementInform(uint32 mtype, uint32 id) + { + + } + + void JustDied(Unit* pKiller) + { + if((pKiller->GetTypeId() == TYPEID_PLAYER) || (pKiller->GetOwner()) && (pKiller->GetOwner()->GetTypeId() == TYPEID_PLAYER)) + if (m_pInstance) + if (Creature* pJedoga = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_JEDOGA_SHADOWSEEKER))) + if (boss_jedogaAI* pJedogaAI = dynamic_cast(pJedoga->AI())) + { + pJedogaAI->getsAchievement = false; + } + } + + void UpdateAI(const uint32 uiDiff) + { + + } +}; + +CreatureAI* GetAI_mob_jedoga_volunteer(Creature* pCreature) +{ + return new mob_jedoga_volunteerAI(pCreature); +} + +void AddSC_boss_jedoga() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_jedoga"; + newscript->GetAI = &GetAI_boss_jedoga; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_jedoga_volunteer"; + newscript->GetAI = &GetAI_mob_jedoga_volunteer; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/ahnkahet/boss_nadox.cpp b/scripts/northrend/azjol-nerub/ahnkahet/boss_nadox.cpp new file mode 100644 index 0000000..e897b3b --- /dev/null +++ b/scripts/northrend/azjol-nerub/ahnkahet/boss_nadox.cpp @@ -0,0 +1,249 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nadox +SD%Complete: 90% +SDComment: TODO: some more research on guardian aura needed, BroodRage needs core and db support +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "ahnkahet.h" + +enum +{ + SAY_AGGRO = -1619000, + SAY_SUMMON_EGG_1 = -1619001, + SAY_SUMMON_EGG_2 = -1619002, + SAY_SLAY_1 = -1619003, + SAY_SLAY_2 = -1619004, + SAY_SLAY_3 = -1619005, + SAY_DEATH = -1619006, + EMOTE_HATCH = -1619007, + + SPELL_BROOD_PLAGUE = 56130, + SPELL_BROOD_PLAGUE_H = 59467, + SPELL_BERSERK = 26662, + SPELL_BROOD_RAGE = 59465, + + // guardian aura done via EventAI + SPELL_GUARDIAN_AURA = 56151, + SPELL_GUARDIAN_AURA_TRIGGERED = 56153, + + // JustSummoned is not called for spell summoned creatures + SPELL_SUMMON_SWARM_GUARDIAN = 56120, + SPELL_SUMMON_SWARMERS = 56119, + + NPC_AHNKAHAR_GUARDIAN_EGG = 30173, + NPC_AHNKAHAR_SWARM_EGG = 30172, + NPC_AHNKAHAR_GUARDIAN = 30176, + NPC_AHNKAHAR_SWARMER = 30178 +}; + +/*###### +## mob_ahnkahat_egg +######*/ +struct MANGOS_DLL_DECL mob_ahnkahar_eggAI : public ScriptedAI +{ + mob_ahnkahar_eggAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + void MoveInLineOfSight(Unit* pWho) {} + void AttackStart(Unit* pWho) {} + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_AHNKAHAR_GUARDIAN) + DoScriptText(EMOTE_HATCH, m_creature); + + if (m_pInstance) + { + if (Creature* pElderNadox = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_ELDER_NADOX))) + { + float fPosX, fPosY, fPosZ; + pElderNadox->GetPosition(fPosX, fPosY, fPosZ); + pSummoned->GetMotionMaster()->MovePoint(0, fPosX, fPosY, fPosZ); + } + } + } +}; + +CreatureAI* GetAI_mob_ahnkahar_egg(Creature* pCreature) +{ + return new mob_ahnkahar_eggAI(pCreature); +} + +/*###### +## boss_nadox +######*/ + +struct MANGOS_DLL_DECL boss_nadoxAI : public ScriptedAI +{ + boss_nadoxAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bBerserk; + bool m_bGuardianSummoned; + uint32 m_uiBroodPlagueTimer; + uint32 m_uiBroodRageTimer; + uint32 m_uiSummonTimer; + uint8 m_uiGuardCount; + + void Reset() + { + m_bBerserk = false; + m_bGuardianSummoned = false; + m_uiSummonTimer = 5000; + m_uiBroodPlagueTimer = 15000; + m_uiBroodRageTimer = 20000; + m_uiGuardCount = 0; + if(m_pInstance) + m_pInstance->SetData(TYPE_NADOX,NOT_STARTED); + } + + Creature* SelectRandomCreatureOfEntryInRange(uint32 uiEntry, float fRange) + { + std::list lCreatureList; + GetCreatureListWithEntryInGrid(lCreatureList, m_creature, uiEntry, fRange); + + if (lCreatureList.empty()) + return NULL; + + std::list::iterator iter = lCreatureList.begin(); + advance(iter, urand(0, lCreatureList.size()-1)); + + return *iter; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + if(m_pInstance) + m_pInstance->SetData(TYPE_NADOX,IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + if(m_pInstance) + m_pInstance->SetData(TYPE_NADOX,DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if ((m_uiGuardCount == 0 && m_creature->GetHealthPercent() < 75.0f) || + (m_uiGuardCount == 1 && m_creature->GetHealthPercent() < 50.0f) || + (m_uiGuardCount == 2 && m_creature->GetHealthPercent() < 25.0f)) + { + // guardian is summoned at 75, 50 and 25% of boss HP + if (Creature* pGuardianEgg = GetClosestCreatureWithEntry(m_creature,NPC_AHNKAHAR_GUARDIAN_EGG, 75.0f)) + pGuardianEgg->CastSpell(pGuardianEgg, SPELL_SUMMON_SWARM_GUARDIAN, false); + + m_uiGuardCount++; + m_bGuardianSummoned = true; + } + + if (m_uiSummonTimer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_SUMMON_EGG_1 : SAY_SUMMON_EGG_2, m_creature); + + if (Creature* pSwarmerEgg = SelectRandomCreatureOfEntryInRange(NPC_AHNKAHAR_SWARM_EGG, 75.0)) + pSwarmerEgg->CastSpell(pSwarmerEgg, SPELL_SUMMON_SWARMERS, false); + + m_uiSummonTimer = 10000; + } + else + m_uiSummonTimer -= uiDiff; + + if (m_uiBroodPlagueTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE_H); + + m_uiBroodPlagueTimer = 20000; + } + else + m_uiBroodPlagueTimer -= uiDiff; + + if (!m_bIsRegularMode) + { + if (m_uiBroodRageTimer < uiDiff) + { + if (Creature* pRageTarget = SelectRandomCreatureOfEntryInRange(NPC_AHNKAHAR_SWARMER, 50.0)) + DoCastSpellIfCan(pRageTarget, SPELL_BROOD_RAGE); + + m_uiBroodRageTimer = 20000; + } + else + m_uiBroodRageTimer -= uiDiff; + } + + if (!m_bBerserk && m_creature->GetPositionZ() < 24.0) + { + m_bBerserk = true; + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nadox(Creature* pCreature) +{ + return new boss_nadoxAI(pCreature); +} + +void AddSC_boss_nadox() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_nadox"; + newscript->GetAI = &GetAI_boss_nadox; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ahnkahar_egg"; + newscript->GetAI = &GetAI_mob_ahnkahar_egg; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp b/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp new file mode 100644 index 0000000..624df70 --- /dev/null +++ b/scripts/northrend/azjol-nerub/ahnkahet/boss_taldaram.cpp @@ -0,0 +1,381 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Taldaram +SD%Complete: 20% +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "ahnkahet.h" + +enum +{ + SAY_AGGRO = -1619008, + SAY_VANISH_1 = -1619009, + SAY_VANISH_2 = -1619010, + SAY_FEED_1 = -1619011, + SAY_FEED_2 = -1619012, + SAY_SLAY_1 = -1619013, + SAY_SLAY_2 = -1619014, + SAY_SLAY_3 = -1619015, + SAY_DEATH = -1619016, + + SPELL_BEAM_VISUAL = 60342, // Used when taldram levitates before encounter + SPELL_CONJURE_FLAME_ORB = 55931, // Dummy spell, dont do anything except cast + SPELL_BLOODTHIRST = 55968, + SPELL_VANISH = 55964, // Don't work, Creature goes outfight (hp boost) + SPELL_EMBRACE_OF_THE_VAMPYR = 55959, + SPELL_EMBRACE_OF_THE_VAMPYR_H = 59513, + + SPELL_FLAME_ORB_SPAWN_EFFECT = 55891, // Orb Grow up + SPELL_FLAME_ORB_VISUAL = 55928, // Flame orb effect + SPELL_FLAME_ORB_DEATH = 55947, // Despawn effect + SPELL_FLAME_ORB = 57750, // Flame orb damage + SPELL_FLAME_ORB_H = 58937, + + SPELL_FLAME_SPHERE_PERIODIC = 55926, + SPELL_FLAME_SPHERE_VISUAL = 55928, + + NPC_FLAME_ORB = 30702, + + FLAME_ORB_Z = 17, + + FLAME_ORB_UP_X = 383, + FLAME_ORB_UP_Y = -984, + + FLAME_ORB_DOWN_X = 632, + FLAME_ORB_DOWN_Y = -684, + + FLAME_ORB_RIGHT_X = 350, + FLAME_ORB_RIGHT_Y = -705, + + FLAME_ORB_LEFT_X = 613, + FLAME_ORB_LEFT_Y = -966, +}; + +/*###### +## boss_taldaram +######*/ + +struct MANGOS_DLL_DECL boss_taldaramAI : public ScriptedAI +{ + boss_taldaramAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool isInVanish; + bool isInVampyrMode; + + uint32 summonFlameOrbTimer; + uint32 vanishTimer; + uint32 bloodthirstTimer; + uint32 embraceOfTheVampyrTimer; + uint32 embraceOfTheVampyrInterruptDamage; + uint32 embraceOfTheVampyrFinishedTimer; + uint32 damageToInterrupt; + + void Reset() + { + damageToInterrupt = m_bIsRegularMode ? 20000 : 40000; + summonFlameOrbTimer = 12000; + vanishTimer = 14000; + bloodthirstTimer = 10000; + embraceOfTheVampyrFinishedTimer = 20000; + isInVanish = false; + isInVampyrMode = false; + m_creature->SetVisibility(VISIBILITY_ON); + + if (m_pInstance) + m_pInstance->SetData(TYPE_TALDARAM, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->RemoveAurasDueToSpell(SPELL_BEAM_VISUAL); + + if (m_pInstance) + m_pInstance->SetData(TYPE_TALDARAM, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + m_creature->SetVisibility(VISIBILITY_ON); + if (m_pInstance) + m_pInstance->SetData(TYPE_TALDARAM, DONE); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (isInVampyrMode) + embraceOfTheVampyrInterruptDamage += uiDamage; + + if (embraceOfTheVampyrInterruptDamage > damageToInterrupt) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + m_creature->InterruptNonMeleeSpells(false); + isInVampyrMode = false; + embraceOfTheVampyrInterruptDamage = 0; + } + if(pDoneBy->GetEntry() == NPC_FLAME_ORB) + { + uiDamage = 0; + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_pInstance) + { + if (pWho->IsWithinDist(m_creature, 10.0f, true)) + { + if (m_creature->isAlive()) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + } + AttackStart(pWho); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!isInVanish && !isInVampyrMode) + // Summon Flame Orb + if(summonFlameOrbTimer <= uiDiff) + { + for(int i = 0; i < 3; ++i) + { + m_creature->SummonCreature(NPC_FLAME_ORB, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ() + 7, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if(m_bIsRegularMode) + break; + } + DoCast(m_creature, SPELL_CONJURE_FLAME_ORB); + vanishTimer += 10000; + summonFlameOrbTimer = 16000 + rand()%10000; + }else summonFlameOrbTimer -= uiDiff; + + + if (!isInVampyrMode) + if(vanishTimer < uiDiff) + { + //m_creature->CastSpell(m_creature,SPELL_VANISH,true); + m_creature->SetVisibility(VISIBILITY_OFF); + isInVanish = true; + embraceOfTheVampyrTimer = 2000; + vanishTimer = 200000; + }else vanishTimer -= uiDiff; + + if (isInVanish) + { + if (embraceOfTheVampyrTimer < uiDiff) + { + m_creature->SetVisibility(VISIBILITY_ON); + Player* pPlayer; + + // get player enemy + do + { + pPlayer = (Player*) m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + } + while (!pPlayer); + + m_creature->NearTeleportTo(pPlayer->GetPositionX() + 3.0f, pPlayer->GetPositionY() + 3.0f, pPlayer->GetPositionZ(), pPlayer->GetOrientation()); + m_creature->RemoveAurasDueToSpell(SPELL_VANISH); + DoCastSpellIfCan(pPlayer, m_bIsRegularMode ? SPELL_EMBRACE_OF_THE_VAMPYR : SPELL_EMBRACE_OF_THE_VAMPYR_H); + embraceOfTheVampyrInterruptDamage = 0; + isInVampyrMode = true; + summonFlameOrbTimer += 20000; + isInVanish = false; + vanishTimer = 25000; + }else embraceOfTheVampyrTimer -= uiDiff; + } + + // set VampyrMode false when Spell not stopped by damage + if(isInVampyrMode) + if(embraceOfTheVampyrFinishedTimer < uiDiff) + { + isInVampyrMode = false; + embraceOfTheVampyrFinishedTimer = 20000; + } else embraceOfTheVampyrFinishedTimer -= uiDiff; + + if(!isInVampyrMode && !isInVanish) + if (bloodthirstTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BLOODTHIRST); + bloodthirstTimer = m_bIsRegularMode ? 15000 : 8000; + }else bloodthirstTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_taldaram(Creature* pCreature) +{ + return new boss_taldaramAI(pCreature); +} + +/*###### +## mob_flame_orb +######*/ + +struct MANGOS_DLL_DECL mob_taldaram_flame_orbAI : public ScriptedAI +{ + mob_taldaram_flame_orbAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + bool m_bIsFlying; + int8 direction; + float m_fPosiZ; + + + uint32 m_uiDespawn_Timer; + uint32 m_uiCast_Timer; + + void Reset() + { + m_fPosiZ = m_creature->GetPositionZ(); + m_uiDespawn_Timer = 13000; + m_uiCast_Timer = 3000; + direction = -1; + m_bIsFlying = false; + //hack to set model invisible + m_creature->SetDisplayId(10045); + m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + DoCast(m_creature, SPELL_FLAME_ORB_VISUAL); + DoCast(m_creature, SPELL_FLAME_ORB_SPAWN_EFFECT); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + void AttackStart(Unit* pWho) + { + return; + } + void UpdateAI(const uint32 uiDiff) + { + // Despawn Timer + if(m_uiDespawn_Timer <= uiDiff) + { + DoCast(m_creature, SPELL_FLAME_ORB_DEATH); + m_creature->ForcedDespawn(); + }else m_uiDespawn_Timer -= uiDiff; + + // Fly timer + if(m_uiCast_Timer <= uiDiff) + { + if(m_bIsFlying) + return; + + DoCast(m_creature, m_bIsRegularMode ? SPELL_FLAME_ORB : SPELL_FLAME_ORB_H); + direction = urand(0,3); + switch(direction) + { + case 0: // Up + m_creature->GetMotionMaster()->MovePoint(0, FLAME_ORB_UP_X, FLAME_ORB_UP_Y, m_fPosiZ); + break; + case 1: // Down + m_creature->GetMotionMaster()->MovePoint(0, FLAME_ORB_DOWN_X, FLAME_ORB_DOWN_Y, m_fPosiZ); + break; + case 2: // Right + m_creature->GetMotionMaster()->MovePoint(0, FLAME_ORB_RIGHT_X, FLAME_ORB_RIGHT_Y, m_fPosiZ); + break; + case 3: // Left + m_creature->GetMotionMaster()->MovePoint(0, FLAME_ORB_LEFT_X, FLAME_ORB_LEFT_Y, m_fPosiZ); + break; + default: + m_creature->GetMotionMaster()->MovePoint(0, FLAME_ORB_UP_X, FLAME_ORB_UP_Y, m_fPosiZ); + break; + + } + m_bIsFlying = true; + }else m_uiCast_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_mob_taldaram_flame_orb(Creature* pCreature) +{ + return new mob_taldaram_flame_orbAI(pCreature); +} + + +/*###### +## go_nerubian_device +######*/ + +bool GOHello_go_nerubian_device(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + pInstance->SetData(TYPE_TALDARAM, SPECIAL); + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + return false; +} + +void AddSC_boss_taldaram() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_taldaram"; + newscript->GetAI = &GetAI_boss_taldaram; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_taldaram_flame_orb"; + newscript->GetAI = &GetAI_mob_taldaram_flame_orb; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_nerubian_device"; + newscript->pGOHello = &GOHello_go_nerubian_device; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/ahnkahet/boss_volazj.cpp b/scripts/northrend/azjol-nerub/ahnkahet/boss_volazj.cpp new file mode 100644 index 0000000..378a508 --- /dev/null +++ b/scripts/northrend/azjol-nerub/ahnkahet/boss_volazj.cpp @@ -0,0 +1,895 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* 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, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Volazj +SD%Complete: 20% +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "ahnkahet.h" + +enum +{ + SAY_AGGRO = -1619033, + SAY_INSANITY = -1619034, + SAY_SLAY_1 = -1619035, + SAY_SLAY_2 = -1619036, + SAY_SLAY_3 = -1619037, + SAY_DEATH = -1619038, + WHISPER_AGGRO = -1619039, + WHISPER_INSANITY = -1619040, + WHISPER_SLAY_1 = -1619041, + WHISPER_SLAY_2 = -1619042, + WHISPER_SLAY_3 = -1619043, + WHISPER_DEATH = -1619044, + + SPELL_INSANITY = 57496, + + SPELL_INSANITY_PHASE_16 = 57508, + SPELL_INSANITY_PHASE_32 = 57509, + SPELL_INSANITY_PHASE_64 = 57510, + SPELL_INSANITY_PHASE_128 = 57511, + SPELL_INSANITY_PHASE_256 = 57512, + + SPELL_SHIVER = 57949, + SPELL_SHIVER_H = 59978, + + SPELL_SHADOW_BOLT_SALVE = 57942, + SPELL_SHADOW_BOLT_SALVE_H = 59975, + + SPELL_MIND_FLAY = 57941, + SPELL_MIND_FLAY_H = 59974, + + // FIXME: these are not the right clone NPCs! + CLONE = 31627, + CLONE_H = 31627, + FAC_HOSTILE = 16, + ACHIEVEMENT_QUICK_DEMISE = 1862 +}; + +enum clonehealth +{ + CLONE_HEALTH_DRUID = 16101, + CLONE_HEALTH_DRUID_H = CLONE_HEALTH_DRUID * 3, + CLONE_HEALTH_PRIEST = 16404, + CLONE_HEALTH_PRIEST_H = CLONE_HEALTH_PRIEST * 3, + CLONE_HEALTH_PALA = 17334, + CLONE_HEALTH_PALA_H = CLONE_HEALTH_PALA * 3, + CLONE_HEALTH_HUNT = 15899, + CLONE_HEALTH_HUNT_H = CLONE_HEALTH_HUNT * 3, + CLONE_HEALTH_SHAMAN = 17655, + CLONE_HEALTH_SHAMAN_H = CLONE_HEALTH_SHAMAN * 3, + CLONE_HEALTH_ROGUE = 14530, + CLONE_HEALTH_ROGUE_H = CLONE_HEALTH_ROGUE * 3, + CLONE_HEALTH_MAGE = 12444, + CLONE_HEALTH_MAGE_H = CLONE_HEALTH_MAGE * 3, + CLONE_HEALTH_WARRIOR = 19883, + CLONE_HEALTH_WARRIOR_H = CLONE_HEALTH_WARRIOR * 3, + CLONE_HEALTH_WARLOCK = 16877, + CLONE_HEALTH_WARLOCK_H = CLONE_HEALTH_WARLOCK * 3, + CLONE_HEALTH_DK = 20012, + CLONE_HEALTH_DK_H = CLONE_HEALTH_DK * 3, +}; + +enum +{ + SPELL_DRUID_1 = 69882, + SPELL_DRUID_1_H = 71141, + SPELL_DRUID_2 = 69898, + SPELL_DRUID_2_H = 71142, + SPELL_DRUID_3 = 38658, + SPELL_HUNT = 59604, + SPELL_DK = 55978, + SPELL_MAGE = 69869, + SPELL_MAGE_H = 71130, + SPELL_ROGUE_1 = 37331, + SPELL_ROGUE_2 = 1330, + SPELL_SHAMAN = 68113, + SPELL_SHAMAN_H = 64213, + SPELL_PRIEST_1 = 71932, + SPELL_PRIEST_2 = 30854, + SPELL_PRIEST_1_H = 43575, + SPELL_PRIEST_2_H = 68089, + SPELL_WARRIOR = 46271, + SPELL_WARRIOR_H = 41399, + SPELL_WARLOCK = 37668, + SPELL_WARLOCK_H = 75383, + SPELL_PALA = 46029, + SPELL_PALA_H = 41541 +}; + +/*###### +## boss_volazj +######*/ + +struct MANGOS_DLL_DECL boss_volazjAI : public ScriptedAI +{ + boss_volazjAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool isInInsanity; + bool phase66; + bool phase33; + bool clone16; + bool clone32; + bool clone64; + bool clone128; + bool clone256; + bool startAchievement; + bool getsAchievement; + + std::list cloneGUIDList; + std::list clone16GUIDList; + std::list clone32GUIDList; + std::list clone64GUIDList; + std::list clone128GUIDList; + std::list clone256GUIDList; + + uint32 insanityEndTimer; + uint32 insanityTimer; + uint32 createMirrorTimer; + uint32 shadowBoltSalveTimer; + uint32 shiverTimer; + uint32 mindFlayTimer; + uint32 achievementTimer; + + void Reset() + { + insanityEndTimer = 9999999; + createMirrorTimer = 9999999; + achievementTimer = 120000; // 2minutes + shadowBoltSalveTimer = 6000; + shiverTimer = 13000; + mindFlayTimer = 9000; + cloneGUIDList.clear(); + clone16GUIDList.clear(); + clone32GUIDList.clear(); + clone64GUIDList.clear(); + clone128GUIDList.clear(); + clone256GUIDList.clear(); + + isInInsanity = false; + phase66 = false; + phase33 = false; + clone16 = false; + clone32 = false; + clone64 = false; + clone128 = false; + clone256 = false; + startAchievement = false; + getsAchievement = true; + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLAZJ, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + DoScriptText(WHISPER_AGGRO,m_creature,target); + + startAchievement = true; + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLAZJ, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + int32 textId = 0; + + switch(urand(0, 2)) + { + case 0: textId = SAY_SLAY_1; break; + case 1: textId = SAY_SLAY_2; break; + case 2: textId = SAY_SLAY_3; break; + } + + DoScriptText(textId,m_creature); + + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + DoScriptText(textId-6,m_creature,target); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + Map* pMap = m_creature->GetMap(); + /*if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if(!m_bIsRegularMode && getsAchievement) + itr->getSource() //add Achievement here + DoScriptText(WHISPER_DEATH,m_creature,itr->getSource()); + } + }*/ + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLAZJ, DONE); + } + + void setPlayersPhase() + { + int i = 1; + + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if(Player* target = m_creature->GetMap()->GetPlayer(itr->getSource()->GetGUID())) + { + switch(i) + { + case 1: + target->CastSpell(target, SPELL_INSANITY_PHASE_16, true); + break; + case 2: + target->CastSpell(target, SPELL_INSANITY_PHASE_32, true); + break; + case 3: + target->CastSpell(target, SPELL_INSANITY_PHASE_64, true); + break; + case 4: + target->CastSpell(target, SPELL_INSANITY_PHASE_128, true); + break; + case 5: + target->CastSpell(target, SPELL_INSANITY_PHASE_256, true); + break; + default: + break; + } + i++; + } + } + + void createClassMirrors() + { + for (int i = 0; i <= 5; i++) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if(Unit* target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + { + Unit* pClone = m_creature->SummonCreature(m_bIsRegularMode ? CLONE : CLONE_H, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (pClone) + { + pClone->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PASSIVE); + pClone->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE); + pClone->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_OOC_NOT_ATTACKABLE); + pClone->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_UNK_6); + pClone->SetDisplayId(target->GetNativeDisplayId()); + pClone->SetName(target->GetName()); + pClone->setFaction(FAC_HOSTILE); + + switch (target->getClass()) + { + case CLASS_PRIEST: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_PRIEST : CLONE_HEALTH_PRIEST_H); break; + case CLASS_PALADIN: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_PALA : CLONE_HEALTH_PALA_H); break; + case CLASS_WARLOCK: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_WARLOCK : CLONE_HEALTH_WARLOCK_H); break; + case CLASS_MAGE: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_MAGE : CLONE_HEALTH_MAGE_H); break; + case CLASS_ROGUE: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_ROGUE : CLONE_HEALTH_ROGUE_H); break; + case CLASS_WARRIOR: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_WARRIOR : CLONE_HEALTH_WARRIOR_H); break; + case CLASS_DRUID: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_DRUID : CLONE_HEALTH_DRUID_H); break; + case CLASS_SHAMAN: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_SHAMAN : CLONE_HEALTH_SHAMAN_H); break; + case CLASS_HUNTER: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_HUNT : CLONE_HEALTH_HUNT_H); break; + case CLASS_DEATH_KNIGHT: pClone->SetMaxHealth(m_bIsRegularMode ? CLONE_HEALTH_DK : CLONE_HEALTH_DK_H); break; + default: break; + } + + pClone->SetHealth(pClone->GetMaxHealth()); + pClone->Attack(target, true); + pClone->AddThreat(target, 10.0f); + cloneGUIDList.push_back(pClone->GetGUID()); + } + + switch(i) + { + case 1: + pClone->SetPhaseMask(16, true); + clone16GUIDList.push_back(pClone->GetGUID()); + break; + case 2: + pClone->SetPhaseMask(32, true); + clone32GUIDList.push_back(pClone->GetGUID()); + break; + case 3: + pClone->SetPhaseMask(64, true); + clone64GUIDList.push_back(pClone->GetGUID()); + break; + case 4: + pClone->SetPhaseMask(128, true); + clone128GUIDList.push_back(pClone->GetGUID()); + break; + case 5: + pClone->SetPhaseMask(256, true); + clone256GUIDList.push_back(pClone->GetGUID()); + break; + default: + break; + } + } + } + } + } + + bool cloneAlive() + { + if (!cloneGUIDList.empty() && m_pInstance) + { + for (std::list::iterator itr = cloneGUIDList.begin(); itr != cloneGUIDList.end(); ++itr) + { + if (Creature* pClone = m_pInstance->instance->GetCreature(*itr)) + { + if (pClone->isAlive()) + return true; + } + } + } + + return false; + } + + bool clone16Alive() + { + if (!clone16GUIDList.empty() && m_pInstance) + { + for (std::list::iterator itr = clone16GUIDList.begin(); itr != clone16GUIDList.end(); ++itr) + { + if (Creature* pClone = m_pInstance->instance->GetCreature(*itr)) + { + if (pClone->isAlive()) + return true; + } + } + } + + return false; + } + + bool clone32Alive() + { + if (!clone32GUIDList.empty() && m_pInstance) + { + for (std::list::iterator itr = clone32GUIDList.begin(); itr != clone32GUIDList.end(); ++itr) + { + if (Creature* pClone = m_pInstance->instance->GetCreature(*itr)) + { + if (pClone->isAlive()) + return true; + } + } + } + + return false; + } + + bool clone64Alive() + { + if (!clone64GUIDList.empty() && m_pInstance) + { + for (std::list::iterator itr = clone64GUIDList.begin(); itr != clone64GUIDList.end(); ++itr) + { + if (Creature* pClone = m_pInstance->instance->GetCreature(*itr)) + { + if (pClone->isAlive()) + return true; + } + } + } + + return false; + } + + bool clone128Alive() + { + if (!clone128GUIDList.empty() && m_pInstance) + { + for (std::list::iterator itr = clone128GUIDList.begin(); itr != clone128GUIDList.end(); ++itr) + { + if (Creature* pClone = m_pInstance->instance->GetCreature(*itr)) + { + if (pClone->isAlive()) + return true; + } + } + } + + return false; + } + + bool clone256Alive() + { + if (!clone256GUIDList.empty() && m_pInstance) + { + for (std::list::iterator itr = clone256GUIDList.begin(); itr != clone256GUIDList.end(); ++itr) + { + if (Creature* pClone = m_pInstance->instance->GetCreature(*itr)) + { + if (pClone->isAlive()) + return true; + } + } + } + + return false; + } + + void UpdateAI(const uint32 uiDiff) + { + if(startAchievement) + if(achievementTimer < uiDiff) + { + startAchievement = false; + getsAchievement = false; + } else + achievementTimer -= uiDiff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (isInInsanity) + { + if (insanityEndTimer < uiDiff) + { + if (!cloneAlive()) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + isInInsanity = false; + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->Attack(m_creature->getVictim(), true); + insanityEndTimer = 9999999; + clone16 = clone32 = clone64 = clone128 = clone256 = false; + return; + }else + insanityEndTimer = 1000; + }else insanityEndTimer -= uiDiff; + + if (!clone16Alive() && !clone16) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + { + if (target->GetPhaseMask() == 16) + { + target->RemoveAurasDueToSpell(SPELL_INSANITY_PHASE_16); + if (!clone32) + target->CastSpell(target, SPELL_INSANITY_PHASE_32, true); + else if (!clone64) + target->CastSpell(target, SPELL_INSANITY_PHASE_64, true); + else if (!clone128) + target->CastSpell(target, SPELL_INSANITY_PHASE_128, true); + else if (!clone256) + target->CastSpell(target, SPELL_INSANITY_PHASE_256, true); + } + } + } + + clone16 = true; + } + + if (!clone32Alive() && !clone32) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + { + if (target->GetPhaseMask() == 32) + { + target->RemoveAurasDueToSpell(SPELL_INSANITY_PHASE_32); + if (!clone16) + target->CastSpell(target, SPELL_INSANITY_PHASE_16, true); + else if (!clone64) + target->CastSpell(target, SPELL_INSANITY_PHASE_64, true); + else if (!clone128) + target->CastSpell(target, SPELL_INSANITY_PHASE_128, true); + else if (!clone256) + target->CastSpell(target, SPELL_INSANITY_PHASE_256, true); + } + } + } + + clone32 = true; + } + + if (!clone64Alive() && !clone64) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + { + if (target->GetPhaseMask() == 64) + { + target->RemoveAurasDueToSpell(SPELL_INSANITY_PHASE_64); + if (!clone16) + target->CastSpell(target, SPELL_INSANITY_PHASE_16, true); + else if (!clone32) + target->CastSpell(target, SPELL_INSANITY_PHASE_32, true); + else if (!clone128) + target->CastSpell(target, SPELL_INSANITY_PHASE_128, true); + else if (!clone256) + target->CastSpell(target, SPELL_INSANITY_PHASE_256, true); + } + } + } + + clone64 = true; + } + + if (!clone128Alive() && !clone128) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + { + if (target->GetPhaseMask() == 128) + { + target->RemoveAurasDueToSpell(SPELL_INSANITY_PHASE_128); + if (!clone16) + target->CastSpell(target, SPELL_INSANITY_PHASE_16, true); + else if (!clone32) + target->CastSpell(target, SPELL_INSANITY_PHASE_32, true); + else if (!clone64) + target->CastSpell(target, SPELL_INSANITY_PHASE_64, true); + else if (!clone256) + target->CastSpell(target, SPELL_INSANITY_PHASE_256, true); + } + } + } + + clone128 = true; + } + + if (!clone256Alive() && !clone256) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + { + if (target->GetPhaseMask() == 256) + { + target->RemoveAurasDueToSpell(SPELL_INSANITY_PHASE_256); + if (!clone16) + target->CastSpell(target, SPELL_INSANITY_PHASE_16, true); + else if (!clone32) + target->CastSpell(target, SPELL_INSANITY_PHASE_32, true); + else if (!clone64) + target->CastSpell(target, SPELL_INSANITY_PHASE_64, true); + else if (!clone128) + target->CastSpell(target, SPELL_INSANITY_PHASE_128, true); + } + } + } + + clone256 = true; + } + } + else + { + if (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.66 && !phase66) + { + DoScriptText(SAY_INSANITY, m_creature); + + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + DoScriptText(WHISPER_INSANITY,m_creature,target); + + m_creature->InterruptNonMeleeSpells(true); + phase66 = true; + DoCastSpellIfCan(m_creature, SPELL_INSANITY); + createMirrorTimer = 5000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + } + + if (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.33 && !phase33) + { + DoScriptText(SAY_INSANITY, m_creature); + + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + if (Unit *target = m_creature->GetMap()->GetUnit(itr->getSource()->GetGUID())) + DoScriptText(WHISPER_INSANITY,m_creature,target); + + m_creature->InterruptNonMeleeSpells(true); + phase33 = true; + DoCastSpellIfCan(m_creature, SPELL_INSANITY); + createMirrorTimer = 5000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + } + + if (createMirrorTimer < uiDiff) + { + isInInsanity = true; + createClassMirrors(); + createMirrorTimer = 9999999; + insanityEndTimer = 5000; + }else createMirrorTimer -= uiDiff; + + if (mindFlayTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0), m_bIsRegularMode ? SPELL_MIND_FLAY : SPELL_MIND_FLAY_H); + mindFlayTimer = urand(10000, 12000); + }else mindFlayTimer -= uiDiff; + + if (shadowBoltSalveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_BOLT_SALVE : SPELL_SHADOW_BOLT_SALVE_H); + shadowBoltSalveTimer = urand(5000, 10000); + }else shadowBoltSalveTimer -= uiDiff; + + if (shiverTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0), m_bIsRegularMode ? SPELL_SHIVER : SPELL_SHIVER_H); + shiverTimer = urand(13000, 14000); + }else shiverTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_volazj(Creature* pCreature) +{ + return new boss_volazjAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_volazj_cloneAI : public ScriptedAI +{ + mob_volazj_cloneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsRegularMode; + + uint32 spellPriestTimer; + uint32 spellRogueTimer; + uint32 spellMageTimer; + uint32 spellDeathKnightTimer; + uint32 spellShamanTimer; + uint32 spellWarlockTimer; + uint32 spellDruidTimer; + uint32 spellWarriorTimer; + uint32 spellPaladinTimer; + uint32 spellHunterTimer; + + void Reset() + { + spellPriestTimer = 5000; + spellRogueTimer = 5000; + spellMageTimer = 5000; + spellDeathKnightTimer = 5000; + spellShamanTimer = 5000; + spellWarlockTimer = 5000; + spellDruidTimer = 5000; + spellWarriorTimer = 5000; + spellPaladinTimer = 5000; + spellHunterTimer = 5000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_creature->GetMaxHealth() == CLONE_HEALTH_DRUID || m_creature->GetMaxHealth() == CLONE_HEALTH_DRUID_H) + { + if (spellDruidTimer < uiDiff) + { + int randomSpell = urand(0, 2); + switch (randomSpell) + { + case 0: + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DRUID_1 : SPELL_DRUID_1_H); + break; + case 1: + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DRUID_2 : SPELL_DRUID_2_H); + break; + case 2: + DoCastSpellIfCan(m_creature, SPELL_DRUID_3); + break; + } + spellDruidTimer = 5000; + }else spellDruidTimer -= uiDiff; + + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_MAGE || m_creature->GetMaxHealth() == CLONE_HEALTH_MAGE_H) + { + if (spellMageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_MAGE : SPELL_MAGE_H); + + spellMageTimer = urand(4000, 6000); + }else spellMageTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_PALA || m_creature->GetMaxHealth() == CLONE_HEALTH_PALA_H) + { + if (spellPaladinTimer < uiDiff) + { + if (!m_bIsRegularMode) + { + if (!urand(0, 2)) + DoCastSpellIfCan(m_creature, SPELL_PALA_H); + else + DoCastSpellIfCan(m_creature, SPELL_PALA); + } + else + DoCastSpellIfCan(m_creature, SPELL_PALA); + + spellPaladinTimer = urand(4000, 5000); + }else spellPaladinTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_HUNT || m_creature->GetMaxHealth() == CLONE_HEALTH_HUNT_H) + { + if (spellHunterTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HUNT); + + spellHunterTimer = m_bIsRegularMode ? urand(8000, 9000) : urand(4000, 5000); + }else spellHunterTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_WARLOCK || m_creature->GetMaxHealth() == CLONE_HEALTH_WARLOCK_H) + { + if (spellWarlockTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_WARLOCK : SPELL_WARLOCK_H); + + spellWarlockTimer = urand(6000, 10000); + }else spellWarlockTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_DK || m_creature->GetMaxHealth() == CLONE_HEALTH_DK_H) + { + if (spellDeathKnightTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DK); + + spellDeathKnightTimer = m_bIsRegularMode ? urand(9000, 12000) : urand(4000, 5000); + }else spellDeathKnightTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_WARRIOR || m_creature->GetMaxHealth() == CLONE_HEALTH_WARRIOR_H) + { + if (spellWarriorTimer < uiDiff) + { + if (m_bIsRegularMode) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WARRIOR); + spellWarriorTimer = urand(4000, 6000); + } + else + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WARRIOR_H); + spellWarriorTimer = urand(20000, 25000); + } + }else spellWarriorTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_PRIEST || m_creature->GetMaxHealth() == CLONE_HEALTH_PRIEST_H) + { + if (spellPriestTimer < uiDiff) + { + if (m_bIsRegularMode) + { + if (urand(0, 1)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PRIEST_2); + else + DoCastSpellIfCan(m_creature, SPELL_PRIEST_1); + } + else + { + if (!urand(0, 3)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PRIEST_2_H); + else + DoCastSpellIfCan(m_creature, SPELL_PRIEST_1_H); + } + + spellPriestTimer = urand (5000, 7000); + }else spellPriestTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_SHAMAN || m_creature->GetMaxHealth() == CLONE_HEALTH_SHAMAN_H) + { + if (spellShamanTimer < uiDiff) + { + if (m_bIsRegularMode) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHAMAN); + spellShamanTimer = urand(4000, 6000); + } + else + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHAMAN_H); + spellShamanTimer = urand(10000, 11000); + } + }else spellShamanTimer -= uiDiff; + } + else if (m_creature->GetMaxHealth() == CLONE_HEALTH_ROGUE || m_creature->GetMaxHealth() == CLONE_HEALTH_ROGUE_H) + { + if (spellRogueTimer < uiDiff) + { + if (m_bIsRegularMode) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ROGUE_2); + spellRogueTimer = urand(4000, 6000); + } + else + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ROGUE_1); + spellRogueTimer = urand(10000, 14000); + } + }else spellRogueTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_volazj_clone(Creature* pCreature) +{ + return new mob_volazj_cloneAI(pCreature); +} + +void AddSC_boss_volazj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_volazj"; + newscript->GetAI = &GetAI_boss_volazj; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_volazj_clone"; + newscript->GetAI = &GetAI_mob_volazj_clone; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/ahnkahet/instance_ahnkahet.cpp b/scripts/northrend/azjol-nerub/ahnkahet/instance_ahnkahet.cpp new file mode 100644 index 0000000..694413f --- /dev/null +++ b/scripts/northrend/azjol-nerub/ahnkahet/instance_ahnkahet.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_ahnkahet +SD%Complete: 80% +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "ahnkahet.h" + +struct MANGOS_DLL_DECL instance_ahnkahet : public ScriptedInstance +{ + instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiElderNadoxGUID; + uint64 m_uiJedogaShadowseekerGUID; + uint64 m_uiTaldaramDoorGUID; + uint64 m_uiTaldaramVortexGUID; + uint8 m_uiDevicesActivated; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiElderNadoxGUID = 0; + m_uiJedogaShadowseekerGUID = 0; + m_uiTaldaramDoorGUID = 0; + m_uiTaldaramVortexGUID = 0; + m_uiDevicesActivated = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_ELDER_NADOX: m_uiElderNadoxGUID = pCreature->GetGUID(); break; + case NPC_JEDOGA_SHADOWSEEKER: m_uiJedogaShadowseekerGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_DOOR_TALDARAM: + m_uiTaldaramDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + DoUseDoorOrButton(m_uiTaldaramDoorGUID); + break; + case GO_ANCIENT_DEVICE_L: + if (m_auiEncounter[1] == NOT_STARTED) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_ANCIENT_DEVICE_R: + if (m_auiEncounter[1] == NOT_STARTED) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_VORTEX: + m_uiTaldaramVortexGUID = pGo->GetGUID(); + if (m_auiEncounter[1] != NOT_STARTED) + DoUseDoorOrButton(m_uiTaldaramVortexGUID); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Ahn'Kahet: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_NADOX: + m_auiEncounter[0] = uiData; + break; + case TYPE_TALDARAM: + if (uiData == SPECIAL) + { + if (m_uiDevicesActivated < 2) + ++m_uiDevicesActivated; + + if (m_uiDevicesActivated == 2) + { + m_auiEncounter[1] = uiData; + DoUseDoorOrButton(m_uiTaldaramVortexGUID); + } + } + if (uiData == DONE) + { + m_auiEncounter[1] = uiData; + DoUseDoorOrButton(m_uiTaldaramDoorGUID); + } + break; + case TYPE_JEDOGA: + m_auiEncounter[2] = uiData; + break; + case TYPE_VOLAZJ: + m_auiEncounter[3] = uiData; + break; + case TYPE_AMANITAR: + m_auiEncounter[4] = uiData; + break; + default: + error_log("SD2: Instance Ahn'Kahet: ERROR SetData = %u for type %u does not exist/not implemented.",uiType,uiData); + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] + << " " << m_auiEncounter[4]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_NADOX: + return m_auiEncounter[0]; + case TYPE_TALDARAM: + return m_auiEncounter[1]; + case TYPE_JEDOGA: + return m_auiEncounter[2]; + case TYPE_VOLAZJ: + return m_auiEncounter[3]; + case TYPE_AMANITAR: + return m_auiEncounter[4]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case NPC_ELDER_NADOX: + return m_uiElderNadoxGUID; + case NPC_JEDOGA_SHADOWSEEKER: + return m_uiJedogaShadowseekerGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap) +{ + return new instance_ahnkahet(pMap); +} + +void AddSC_instance_ahnkahet() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "instance_ahnkahet"; + newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/azjol-nerub/azjol-nerub.h b/scripts/northrend/azjol-nerub/azjol-nerub/azjol-nerub.h new file mode 100644 index 0000000..c939271 --- /dev/null +++ b/scripts/northrend/azjol-nerub/azjol-nerub/azjol-nerub.h @@ -0,0 +1,70 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_AZJOL_NERUB_H +#define DEF_AZJOL_NERUB_H + +enum +{ + MAX_ENCOUNTER = 3, + MAX_WATCHERS = 3, + + TYPE_KRIKTHIR = 0, + TYPE_HADRONOX = 1, + TYPE_ANUBARAK = 2, + + NPC_KRIKTHIR = 28684, + + SAY_SEND_GROUP_1 = -1601004, + SAY_SEND_GROUP_2 = -1601005, + SAY_SEND_GROUP_3 = -1601006, + + NPC_GASHRA = 28730, + NPC_NARJIL = 28729, + NPC_SILTHIK = 28731, + + GO_DOOR_KRIKTHIR = 192395, + GO_DOOR_ANUBARAK_1 = 192396, + GO_DOOR_ANUBARAK_2 = 192397, + GO_DOOR_ANUBARAK_3 = 192398 +}; + +struct MANGOS_DLL_DECL instance_azjol_nerub : public ScriptedInstance +{ + public: + instance_azjol_nerub(Map* pMap); + ~instance_azjol_nerub() {}; + + void Initialize(); + void OnObjectCreate(GameObject* pGo); + void OnCreatureCreate(Creature* pCreature); + void OnCreatureEvade(Creature* pCreature); + void OnCreatureEnterCombat(Creature* pCreature); + void OnCreatureDeath(Creature* pCreature); + void SetData(uint32 uiType, uint32 uiData); + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + void Update(uint32 uiDiff); + void DoSendWatcherOrKrikthir(); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiDoorKrikthirGUID; + uint64 m_uiDoorAnubarak1GUID; + uint64 m_uiDoorAnubarak2GUID; + uint64 m_uiDoorAnubarak3GUID; + + uint64 m_uiKrikthirGUID; + uint64 m_uiGashraGUID; + uint64 m_uiNarjilGUID; + uint64 m_uiSilthikGUID; + + uint64 m_uiPlayerGUID; + + uint64 m_auiWatcherGUIDS[3]; + uint32 m_uiWatcherTimer; +}; +#endif diff --git a/scripts/northrend/azjol-nerub/azjol-nerub/boss_anubarak.cpp b/scripts/northrend/azjol-nerub/azjol-nerub/boss_anubarak.cpp new file mode 100644 index 0000000..e0b412a --- /dev/null +++ b/scripts/northrend/azjol-nerub/azjol-nerub/boss_anubarak.cpp @@ -0,0 +1,558 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Anubarak +SD%Complete: 80% +SDComment: Some cosmetic mistakes. TODO: spikes. +SDCategory: Azjol'Nerub +EndScriptData */ + +#include "precompiled.h" +#include "azjol-nerub.h" + +enum +{ + SAY_INTRO = -1601014, + SAY_AGGRO = -1601015, + SAY_KILL_1 = -1601016, + SAY_KILL_2 = -1601017, + SAY_KILL_3 = -1601018, + SAY_SUBMERGE_1 = -1601019, + SAY_SUBMERGE_2 = -1601020, + SAY_LOCUST_1 = -1601021, + SAY_LOCUST_2 = -1601022, + SAY_LOCUST_3 = -1601023, + SAY_DEATH = -1601024, + + SPELL_EARTH_EXPLOSION = 42373, + SPELL_CARRION_SWARM = 53520, + SPELL_IMPALE = 53454, + SPELL_IMPALE_H = 59446, + SPELL_LEECHING_SWARM = 53467, + SPELL_LEECHING_SWARM_H = 59430, + SPELL_POUND = 53472, + SPELL_POUND_H = 59433, + SPELL_POUND_DMG = 53509, + SPELL_POUND_DMG_H = 59432, + SPELL_BURROW = 26381, + + NPC_ADD1 = 28736, + NPC_ADD2 = 29349, + NPC_ELITE_ADD = 28732, + + NPC_IMPALE_TRIGGER = 105000, + + FAC_HOSTILE = 16, + + ACHIEV_SPEEDKILL_H = 1860, + +}; + +#define MIDDLE_CORD_X 552.927734f +#define MIDDLE_CORD_Y 248.950851f +#define MIDDLE_CORD_Z 223.912796f + +#define ELITE_SPAWN_1_X 547.412841f +#define ELITE_SPAWN_1_Y 320.102448f +#define ELITE_SPAWN_1_Z 236.062057f + +#define ELITE_SPAWN_2_X 554.539185f +#define ELITE_SPAWN_2_Y 319.792603f +#define ELITE_SPAWN_2_Z 235.927032f + +#define ACHIEV_SPEEDKILL_H 1860 + +/*###### +## boss_anubarak +######*/ + +struct MANGOS_DLL_DECL boss_anubarakAI : public ScriptedAI +{ + boss_anubarakAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_azjol_nerub*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_azjol_nerub* m_pInstance; + bool m_bIsRegularMode; + + bool m_bIsInTimeForAchiev; + uint32 SpeedKillTimer; + + bool phase66; + bool phase66Over; + bool phase33; + bool phase33Over; + bool phase15; + bool phase15Over; + + uint32 BurrowTimer; + uint32 VisComeBackTimer; + uint32 BurComeBackTimer; + uint32 IsBackTimer; + uint32 SummonCreatureTimer; + uint32 LeechingSwarmTimer; + uint32 CloseDoorTimer; + uint32 ImpaleTimer; + uint32 PoundTimer; + uint32 CarrionSwarmTimer; + uint32 ImpaleTriggerTimer; + + Unit* pTriggerTarget; + + int i; + + Creature* Elite[5]; + + void Reset() + { + phase66 = false; + phase66Over = false; + phase33 = false; + phase33Over = false; + phase15 = false; + phase15Over = false; + + BurrowTimer = 9999999; + VisComeBackTimer = 9999999; + BurComeBackTimer = 9999999; + IsBackTimer = 9999999; + SummonCreatureTimer = 9999999; + LeechingSwarmTimer = 4000; + CloseDoorTimer = 4000; + ImpaleTimer = 5000; + ImpaleTriggerTimer = 9999999; + PoundTimer = 12000; + CarrionSwarmTimer = 13000; + + m_bIsInTimeForAchiev = true; + SpeedKillTimer = 240000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + pTriggerTarget = NULL; + + i = 0; + + m_pInstance->SetData(TYPE_ANUBARAK, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetVisibility(VISIBILITY_ON); + DoScriptText(SAY_DEATH, m_creature); + m_pInstance->SetData(TYPE_ANUBARAK, DONE); + + if (m_bIsInTimeForAchiev && !m_bIsRegularMode) + { + if (ACHIEV_SPEEDKILL_H) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->RewardPlayerAndGroupAtEvent(ACHIEV_SPEEDKILL_H, m_creature); + } + } + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_POUND) + { + if (pTarget) + pTarget->CastSpell(pTarget, SPELL_POUND_DMG, true); + } + + if (pSpell->Id == SPELL_POUND_H) + { + if (pTarget) + pTarget->CastSpell(pTarget, SPELL_POUND_DMG_H, true); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Small hack to prevent a precocious close of the battlefield + if (CloseDoorTimer < uiDiff) + { + m_pInstance->SetData(TYPE_ANUBARAK, IN_PROGRESS); + CloseDoorTimer = 9999999; + }else CloseDoorTimer -= uiDiff; + + if (SpeedKillTimer < uiDiff) + { + m_bIsInTimeForAchiev = false; + } + else + SpeedKillTimer -= uiDiff; + + if (phase66 || phase33 || phase15) + { + // TODO: Impale + if (ImpaleTimer < uiDiff) + { + if (Unit* pImpaleVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + if (pImpaleVictim->GetTypeId() == TYPEID_PLAYER) + { + m_creature->SummonCreature(NPC_IMPALE_TRIGGER, pImpaleVictim->GetPositionX(), pImpaleVictim->GetPositionY(), pImpaleVictim->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 4000); + ImpaleTimer = 8000; + } + }else ImpaleTimer -= uiDiff; + } + else + { + if (PoundTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_POUND : SPELL_POUND_H); + PoundTimer = urand(15000, 18000); + }else PoundTimer -= uiDiff; + + if (LeechingSwarmTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_LEECHING_SWARM : SPELL_LEECHING_SWARM_H); + LeechingSwarmTimer = 15000; + }else LeechingSwarmTimer -= uiDiff; + + if (CarrionSwarmTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_CARRION_SWARM); + CarrionSwarmTimer = urand(23000, 31000); + }else CarrionSwarmTimer -= uiDiff; + } + + if (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.66 && !phase66Over) + { + phase66 = true; + phase66Over = true; + DoCastSpellIfCan(m_creature, SPELL_BURROW); + BurrowTimer = 1700; + SummonCreatureTimer = 2000; + } + else if (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.33 && !phase33Over) + { + phase33 = true; + phase33Over = true; + DoCastSpellIfCan(m_creature, SPELL_BURROW); + BurrowTimer = 1700; + SummonCreatureTimer = 2000; + } + else if (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.15 && !phase15Over) + { + phase15 = true; + phase15Over = true; + DoCastSpellIfCan(m_creature, SPELL_BURROW); + BurrowTimer = 1700; + SummonCreatureTimer = 2000; + } + + if (BurrowTimer < uiDiff) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MoveIdle(); + if (phase66) + BurComeBackTimer = 7000; + else if (phase33) + BurComeBackTimer = 15000; + else if (phase15) + BurComeBackTimer = 25000; + + BurrowTimer = 9999999; + }else BurrowTimer -= uiDiff; + + if (BurComeBackTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BURROW); + VisComeBackTimer = 8000; + + BurComeBackTimer = 9999999; + }else BurComeBackTimer -= uiDiff; + + if (VisComeBackTimer < uiDiff) + { + m_creature->SetVisibility(VISIBILITY_ON); + IsBackTimer = 3000; + + VisComeBackTimer = 9999999; + }else VisComeBackTimer -= uiDiff; + + if (IsBackTimer < uiDiff) + { + phase66 = false; + phase33 = false; + phase15 = false; + i = 0; + + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + IsBackTimer = 9999999; + }else IsBackTimer -= uiDiff; + + if (SummonCreatureTimer < uiDiff) + { + if (phase66 || phase33 || phase15) + { + switch(i) + { + case 0: + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_ELITE_ADD, ELITE_SPAWN_1_X, ELITE_SPAWN_1_Y, ELITE_SPAWN_1_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + if (phase15) + m_creature->SummonCreature(NPC_ADD2, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 2000; + break; + case 1: + m_creature->SummonCreature(NPC_ELITE_ADD, ELITE_SPAWN_2_X, ELITE_SPAWN_2_Y, ELITE_SPAWN_2_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + SummonCreatureTimer = phase33 ? 10000 : 6000; + if (phase15) + { + i += 3; + SummonCreatureTimer = 10000; + } + break; + case 2: + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + if (phase66) + { + SummonCreatureTimer = 9999999; + break; + } + m_creature->SummonCreature(NPC_ELITE_ADD, ELITE_SPAWN_1_X, ELITE_SPAWN_1_Y, ELITE_SPAWN_1_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 1000; + break; + case 3: + m_creature->SummonCreature(NPC_ELITE_ADD, ELITE_SPAWN_2_X, ELITE_SPAWN_2_Y, ELITE_SPAWN_2_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 7000; + break; + case 4: + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 9999999; + break; + case 5: + m_creature->SummonCreature(NPC_ADD2, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 2500; + break; + case 6: + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_ADD1, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + m_creature->SummonCreature(NPC_ELITE_ADD, ELITE_SPAWN_1_X, ELITE_SPAWN_1_Y, ELITE_SPAWN_1_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); + + SummonCreatureTimer = 2000; + break; + case 7: + m_creature->SummonCreature(NPC_ELITE_ADD, ELITE_SPAWN_2_X, ELITE_SPAWN_2_Y, ELITE_SPAWN_2_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 3000; + break; + case 8: + m_creature->SummonCreature(NPC_ADD2, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 8000; + break; + case 9: + m_creature->SummonCreature(NPC_ADD2, MIDDLE_CORD_X + urand(0.0f, 10.0f), MIDDLE_CORD_Y + urand(0.0f, 10.0f), MIDDLE_CORD_Z, m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + SummonCreatureTimer = 9999999; + break; + default: + break; + } + i++; + } + }else SummonCreatureTimer -= uiDiff; + + if (!phase66 && !phase33 && !phase15) + DoMeleeAttackIfReady(); + } +}; + +enum +{ + SPELL_STRIKE = 52532, + SPELL_CLEAVE = 49806, +}; +#define ELITE_SPAWN_1_X_END 556.115845f +#define ELITE_SPAWN_1_Y_END 260.768311f +#define ELITE_SPAWN_1_Z_END 223.889069f + +#define ELITE_SPAWN_2_X_END 547.456970f +#define ELITE_SPAWN_2_Y_END 260.716064f +#define ELITE_SPAWN_2_Z_END 223.643402f + +#define ELITE_WP_1_X 546.684875f +#define ELITE_WP_1_Y 278.920990f +#define ELITE_WP_1_Z 224.348969f + +#define ELITE_WP_2_X 555.046631f +#define ELITE_WP_2_Y 278.821503f +#define ELITE_WP_2_Z 224.304581f + +struct MANGOS_DLL_DECL npc_elite_anubAI : public ScriptedAI +{ + npc_elite_anubAI(Creature* pCreature) : ScriptedAI(pCreature) + {Reset();} + + + uint32 moveWpTimer; + uint32 moveMiddleTimer; + uint32 strikeTimer; + uint32 cleaveTimer; + + bool setSpeed; + + void Reset() + { + moveWpTimer = 100; + moveMiddleTimer = 7000; + strikeTimer = urand(9000,12000); + cleaveTimer = urand(4000,7000); + setSpeed = false; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (!m_creature->IsTemporarySummon()) + return; + + if (m_creature->GetPositionX() < 550.0f) + { + if (moveWpTimer < uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(0, ELITE_WP_1_X, ELITE_WP_1_Y, ELITE_WP_1_Z); + moveWpTimer = 9999999; + return; + }else moveWpTimer -= uiDiff; + } + else + { + if (moveWpTimer < uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(0, ELITE_WP_2_X, ELITE_WP_2_Y, ELITE_WP_2_Z); + moveWpTimer = 9999999; + return; + }else moveWpTimer -= uiDiff; + } + + if (m_creature->GetPositionX() < 550.0f) + { + if (moveMiddleTimer < uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(0, ELITE_SPAWN_2_X_END, ELITE_SPAWN_2_Y_END, ELITE_SPAWN_2_Z_END); + moveMiddleTimer = 9999999; + return; + }else moveMiddleTimer -= uiDiff; + } + else + { + if (moveMiddleTimer < uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(0, ELITE_SPAWN_1_X_END, ELITE_SPAWN_1_Y_END, ELITE_SPAWN_1_Z_END); + moveMiddleTimer = 9999999; + return; + }else moveMiddleTimer -= uiDiff; + } + return; + + if (!setSpeed) + { + m_creature->SetSpeedRate(MOVE_WALK, 1.7f); + m_creature->SetSpeedRate(MOVE_RUN, 1.7f); + setSpeed = true; + } + } + else + { + if (strikeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_STRIKE); + strikeTimer = urand(5000,7000); + } + else + strikeTimer -= uiDiff; + + if (cleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + cleaveTimer = urand(14000,17000); + } + else + cleaveTimer -= uiDiff; + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anubarak(Creature* pCreature) +{ + return new boss_anubarakAI(pCreature); +} + +CreatureAI* GetAI_npc_elite_anub(Creature* pCreature) +{ + return new npc_elite_anubAI(pCreature); +} + +void AddSC_boss_anubarak() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_anubarak"; + pNewScript->GetAI = &GetAI_boss_anubarak; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_elite_anub"; + pNewScript->GetAI = &GetAI_npc_elite_anub; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/azjol-nerub/boss_hadronox.cpp b/scripts/northrend/azjol-nerub/azjol-nerub/boss_hadronox.cpp new file mode 100644 index 0000000..cd53d4d --- /dev/null +++ b/scripts/northrend/azjol-nerub/azjol-nerub/boss_hadronox.cpp @@ -0,0 +1,122 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hadronox +SD%Complete: 60% +SDComment: Just spells implementet; cosmetic mistakes +SDCategory: Azjol'Nerub +EndScriptData */ + +#include "precompiled.h" +#include "azjol-nerub.h" + +enum +{ + SPELL_LEECH_POISON = 53030, + SPELL_LEECH_POISON_H = 59417, + SPELL_ARMOR_PENETRATION = 53418, + SPELL_ACID_CLOUD = 53400, + SPELL_ACID_CLOUD_H = 59419, + SPELL_WEB_GRAB = 53406, //57731, 53406 + SPELL_WEB_GRAB_H = 59420, //59420, 59421 +}; + +/*###### +## boss_hadronox +######*/ + +struct MANGOS_DLL_DECL boss_hadronoxAI : public ScriptedAI +{ + boss_hadronoxAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_azjol_nerub*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_azjol_nerub* m_pInstance; + bool m_bIsRegularMode; + + uint32 LeechPoisonTimer; + uint32 ArmorPenetrationTimer; + uint32 AcidCloudTimer; + uint32 WebGrabTimer; + + void Reset() + { + LeechPoisonTimer = 2000; + ArmorPenetrationTimer = 4000; + AcidCloudTimer = 6000; + WebGrabTimer = 15000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (LeechPoisonTimer < uiDiff) + { + if (Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pVictim, m_bIsRegularMode ? SPELL_LEECH_POISON : SPELL_LEECH_POISON_H); + + LeechPoisonTimer = urand(12000, 13000); + }else LeechPoisonTimer -= uiDiff; + + if (ArmorPenetrationTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARMOR_PENETRATION); + ArmorPenetrationTimer = urand(7000, 11000); + }else ArmorPenetrationTimer -= uiDiff; + + if (AcidCloudTimer < uiDiff) + { + if (Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + if (pVictim->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(pVictim, m_bIsRegularMode ? SPELL_ACID_CLOUD : SPELL_ACID_CLOUD_H); + AcidCloudTimer = urand(8000, 10000); + } + }else AcidCloudTimer -= uiDiff; + + if (WebGrabTimer < uiDiff) + { + if (Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(pVictim, m_bIsRegularMode ? SPELL_WEB_GRAB : SPELL_WEB_GRAB_H); + WebGrabTimer = urand(16000, 20000); + } + }else WebGrabTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_hadronox(Creature* pCreature) +{ + return new boss_hadronoxAI(pCreature); +} + +void AddSC_boss_hadronox() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_hadronox"; + pNewScript->GetAI = &GetAI_boss_hadronox; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/azjol-nerub/boss_krikthir.cpp b/scripts/northrend/azjol-nerub/azjol-nerub/boss_krikthir.cpp new file mode 100644 index 0000000..2530b8d --- /dev/null +++ b/scripts/northrend/azjol-nerub/azjol-nerub/boss_krikthir.cpp @@ -0,0 +1,185 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Krikthir +SD%Complete: 90% +SDComment: Implement Achievement +SDCategory: Azjol'Nerub +EndScriptData */ + +#include "precompiled.h" +#include "azjol-nerub.h" + +enum +{ + SAY_AGGRO = -1601000, + SAY_KILL_1 = -1601001, + SAY_KILL_2 = -1601002, + SAY_KILL_3 = -1601003, + SAY_PREFIGHT_1 = -1601007, + SAY_PREFIGHT_2 = -1601008, + SAY_PREFIGHT_3 = -1601009, + SAY_SWARM_1 = -1601010, + SAY_SWARM_2 = -1601011, + SAY_DEATH = -1601012, + EMOTE_BOSS_GENERIC_FRENZY = -1000005, + + SPELL_SWARM = 52440, + SPELL_CURSE_OF_FATIGUE = 52592, + SPELL_CURSE_OF_FATIGUE_H = 59368, + SPELL_MINDFLAY = 52586, + SPELL_MINDFLAY_H = 59367, + SPELL_FRENZY = 28747, + + NPC_SKITTERING_SWARMER = 28735, + NPC_SKITTERING_INFECTOR = 28736 +}; + +/*###### +## boss_krikthir +######*/ + +struct MANGOS_DLL_DECL boss_krikthirAI : public ScriptedAI +{ + boss_krikthirAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_azjol_nerub*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_azjol_nerub* m_pInstance; + bool m_bIsRegularMode; + + bool m_bFrenzy; + bool m_bIntroSpeech; + + uint32 m_uiSwarmTimer; + uint32 m_uiCurseTimer; + uint32 m_uiMindFlayTimer; + + void Reset() + { + m_uiSwarmTimer = 15000; + m_uiCurseTimer = 20000; + m_uiMindFlayTimer = 8000; + + m_bIntroSpeech = false; + m_bFrenzy = false; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; + } + } + + void MoveInLineOfSight (Unit* pWho) + { + if (!m_bIntroSpeech && m_creature->IsWithinDistInMap(pWho, DEFAULT_VISIBILITY_INSTANCE)) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_PREFIGHT_1, m_creature); break; + case 1: DoScriptText(SAY_PREFIGHT_2, m_creature); break; + case 2: DoScriptText(SAY_PREFIGHT_3, m_creature); break; + } + m_bIntroSpeech = true; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KRIKTHIR, DONE); + } + + void JustSummoned(Creature* pSummoned) + { + uint32 uiEntry = pSummoned->GetEntry(); + if (uiEntry == NPC_SKITTERING_SWARMER || uiEntry == NPC_SKITTERING_INFECTOR) + pSummoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bFrenzy && m_creature->GetHealthPercent() <= 10.0f) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_BOSS_GENERIC_FRENZY, m_creature); + m_bFrenzy = true; + } + + if (m_uiCurseTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_CURSE_OF_FATIGUE : SPELL_CURSE_OF_FATIGUE_H); + m_uiCurseTimer = 20000; + + } + else + m_uiCurseTimer -= uiDiff; + + if (m_uiMindFlayTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_MINDFLAY : SPELL_MINDFLAY_H); + m_uiMindFlayTimer = 8000; + } + else + m_uiMindFlayTimer -= uiDiff; + + if (m_uiSwarmTimer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_SWARM_1 : SAY_SWARM_2, m_creature); + DoCastSpellIfCan(m_creature, SPELL_SWARM); + m_uiSwarmTimer = 15000; + + } + else + m_uiSwarmTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_krikthir(Creature* pCreature) +{ + return new boss_krikthirAI(pCreature); +} + +void AddSC_boss_krikthir() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_krikthir"; + pNewScript->GetAI = &GetAI_boss_krikthir; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/azjol-nerub/azjol-nerub/instance_azjol-nerub.cpp b/scripts/northrend/azjol-nerub/azjol-nerub/instance_azjol-nerub.cpp new file mode 100644 index 0000000..ecb1288 --- /dev/null +++ b/scripts/northrend/azjol-nerub/azjol-nerub/instance_azjol-nerub.cpp @@ -0,0 +1,239 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Azjol-Nerub +SD%Complete: 50 +SDComment: +SDCategory: Azjol-Nerub +EndScriptData */ + +#include "precompiled.h" +#include "azjol-nerub.h" + +instance_azjol_nerub::instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap), + m_uiDoorKrikthirGUID(0), + m_uiDoorAnubarak1GUID(0), + m_uiDoorAnubarak2GUID(0), + m_uiDoorAnubarak3GUID(0), + + m_uiKrikthirGUID(0), + m_uiGashraGUID(0), + m_uiNarjilGUID(0), + m_uiSilthikGUID(0), + + m_uiPlayerGUID(0), + + m_uiWatcherTimer(0) +{ + Initialize(); +} + +void instance_azjol_nerub::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_auiWatcherGUIDS, 0, sizeof(m_auiWatcherGUIDS)); +} + +void instance_azjol_nerub::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_DOOR_KRIKTHIR: + m_uiDoorKrikthirGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOOR_ANUBARAK_1: + m_uiDoorAnubarak1GUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE || m_auiEncounter[2] == NOT_STARTED) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOOR_ANUBARAK_2: + m_uiDoorAnubarak2GUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE || m_auiEncounter[2] == NOT_STARTED) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_DOOR_ANUBARAK_3: + m_uiDoorAnubarak3GUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE || m_auiEncounter[2] == NOT_STARTED) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } +} + +void instance_azjol_nerub::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_KRIKTHIR: m_uiKrikthirGUID = pCreature->GetGUID(); break; + case NPC_GASHRA: m_auiWatcherGUIDS[0] = pCreature->GetGUID(); break; + case NPC_NARJIL: m_auiWatcherGUIDS[1] = pCreature->GetGUID(); break; + case NPC_SILTHIK: m_auiWatcherGUIDS[2] = pCreature->GetGUID(); break; + } +} + +void instance_azjol_nerub::OnCreatureDeath(Creature* pCreature) +{ + uint32 uiEntry = pCreature->GetEntry(); + if (uiEntry == NPC_GASHRA || uiEntry == NPC_NARJIL || uiEntry == NPC_SILTHIK) + { + if (m_auiEncounter[0] == NOT_STARTED) + m_uiWatcherTimer = 5000; + } +} + +void instance_azjol_nerub::OnCreatureEnterCombat(Creature* pCreature) +{ + uint32 uiEntry = pCreature->GetEntry(); + if (uiEntry == NPC_GASHRA || uiEntry == NPC_NARJIL || uiEntry == NPC_SILTHIK) + { + if (!m_uiPlayerGUID) + m_uiPlayerGUID = pCreature->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->GetGUID(); + } +} + +void instance_azjol_nerub::OnCreatureEvade(Creature* pCreature) +{ + uint32 uiEntry = pCreature->GetEntry(); + if (uiEntry == NPC_GASHRA || uiEntry == NPC_NARJIL || uiEntry == NPC_SILTHIK) + m_uiPlayerGUID = 0; +} + +void instance_azjol_nerub::Update(uint32 uiDiff) +{ + if (m_uiWatcherTimer) + { + if (m_uiWatcherTimer <= uiDiff) + { + DoSendWatcherOrKrikthir(); + m_uiWatcherTimer = 0; + } + else + m_uiWatcherTimer -= uiDiff; + } +} + +void instance_azjol_nerub::DoSendWatcherOrKrikthir() +{ + Creature* pAttacker = NULL; + Creature* pKrikthir = instance->GetCreature(m_uiKrikthirGUID); + + if (!pKrikthir) + return; + + for (uint8 i = 0; i < MAX_WATCHERS; ++i) + { + if (Creature* pTemp = instance->GetCreature(m_auiWatcherGUIDS[i])) + { + if (pTemp->isAlive()) + { + if (pAttacker && urand(0, 1)) + continue; + else + pAttacker = pTemp; + } + } + } + + if (pAttacker) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SEND_GROUP_1, pKrikthir); break; + case 1: DoScriptText(SAY_SEND_GROUP_2, pKrikthir); break; + case 2: DoScriptText(SAY_SEND_GROUP_3, pKrikthir); break; + } + } + else + pAttacker = pKrikthir; + + if (Unit* pTarget = instance->GetUnit(m_uiPlayerGUID)) + { + if (pTarget->isAlive()) + pAttacker->AI()->AttackStart(pTarget); + } +} + +void instance_azjol_nerub::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_KRIKTHIR: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiDoorKrikthirGUID); + break; + case TYPE_HADRONOX: + m_auiEncounter[1] = uiData; + break; + case TYPE_ANUBARAK: + m_auiEncounter[2] = uiData; + DoUseDoorOrButton(m_uiDoorAnubarak1GUID); + DoUseDoorOrButton(m_uiDoorAnubarak2GUID); + DoUseDoorOrButton(m_uiDoorAnubarak3GUID); + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_azjol_nerub::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap) +{ + return new instance_azjol_nerub(pMap); +} + +void AddSC_instance_azjol_nerub() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_azjol-nerub"; + pNewScript->GetInstanceData = &GetInstanceData_instance_azjol_nerub; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/borean_tundra.cpp b/scripts/northrend/borean_tundra.cpp new file mode 100644 index 0000000..3ce5b28 --- /dev/null +++ b/scripts/northrend/borean_tundra.cpp @@ -0,0 +1,579 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Borean_Tundra +SD%Complete: 100 +SDComment: Quest support: 11708, 11692, 11961, 11865. Taxi vendors. 11570 +SDCategory: Borean Tundra +EndScriptData */ + +/* ContentData +npc_fizzcrank_fullthrottle +npc_iruk +npc_kara_thricestar +npc_nesingwary_trapper +go_caribou_trap +npc_surristrasz +npc_tiare +npc_lurgglbr +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_fizzcrank_fullthrottle +######*/ + +#define GOSSIP_ITEM_GO_ON "Go on." +#define GOSSIP_ITEM_TELL_ME "Tell me what's going on out here, Fizzcrank." + +enum +{ + GOSSIP_TEXTID_FIZZCRANK1 = 12456, + GOSSIP_TEXTID_FIZZCRANK2 = 12457, + GOSSIP_TEXTID_FIZZCRANK3 = 12458, + GOSSIP_TEXTID_FIZZCRANK4 = 12459, + GOSSIP_TEXTID_FIZZCRANK5 = 12460, + GOSSIP_TEXTID_FIZZCRANK6 = 12461, + GOSSIP_TEXTID_FIZZCRANK7 = 12462, + GOSSIP_TEXTID_FIZZCRANK8 = 12463, + GOSSIP_TEXTID_FIZZCRANK9 = 12464, + + QUEST_THE_MECHAGNOMES = 11708 +}; + +bool GossipHello_npc_fizzcrank_fullthrottle(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_THE_MECHAGNOMES) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELL_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_fizzcrank_fullthrottle(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK6, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK7, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+8: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GO_ON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK8, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+9: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_FIZZCRANK9, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(QUEST_THE_MECHAGNOMES); + break; + } + return true; +} + +/*###### +## npc_iruk +######*/ + +#define GOSSIP_ITEM_IRUK "" + +enum +{ + QUEST_SPIRITS_WATCH_OVER_US = 11961, + SPELL_CREATE_TOTEM = 46816 +}; + +bool GossipHello_npc_iruk(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_SPIRITS_WATCH_OVER_US) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_IRUK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_iruk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,SPELL_CREATE_TOTEM,true); + } + + return true; +} + +/*###### +## npc_kara_thricestar +######*/ + +#define GOSSIP_ITEM_THRICESTAR1 "Do you think I could take a ride on one of those flying machines?" +#define GOSSIP_ITEM_THRICESTAR2 "Kara, I need to be flown out the Dens of Dying to find Bixie." + +enum +{ + QUEST_CHECK_IN_WITH_BIXIE = 11692, + SPELL_FIZZCRANK_AIRSTRIP = 51446 +}; + +bool GossipHello_npc_kara_thricestar(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isTaxi()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TAXI, GOSSIP_ITEM_THRICESTAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetQuestStatus(QUEST_CHECK_IN_WITH_BIXIE) == QUEST_STATUS_COMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THRICESTAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_kara_thricestar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->GetSession()->SendTaxiMenu(pCreature); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_FIZZCRANK_AIRSTRIP, false); + break; + } + + return true; +} + +/*###### +## npc_nesingwary_trapper +######*/ + +enum +{ + NPC_NESINGWARY_TRAPPER = 25835, + GO_QUALITY_FUR = 187983, + + SAY_PHRASE_1 = -1000599, + SAY_PHRASE_2 = -1000600, + SAY_PHRASE_3 = -1000601, + SAY_PHRASE_4 = -1000602 +}; + +struct MANGOS_DLL_DECL npc_nesingwary_trapperAI : public ScriptedAI +{ + npc_nesingwary_trapperAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint8 m_uiPhase; + uint32 m_uiPhaseTimer; + uint64 m_uiPlayerGUID; + uint64 m_uiGobjectTrapGUID; + + void Reset() + { + m_uiPhase = 0; + m_uiPhaseTimer = 0; + m_uiPlayerGUID = 0; + m_uiGobjectTrapGUID = 0; + } + + void StartAction(uint64 uiPlayerGUID, uint64 uiGoTrapGUID) + { + m_uiPhase = 1; + m_uiPhaseTimer = 3000; + m_uiPlayerGUID = uiPlayerGUID; + m_uiGobjectTrapGUID = uiGoTrapGUID; + + switch (urand(0, 3)) + { + case 0: DoScriptText(SAY_PHRASE_1, m_creature); break; + case 1: DoScriptText(SAY_PHRASE_2, m_creature); break; + case 2: DoScriptText(SAY_PHRASE_3, m_creature); break; + case 3: DoScriptText(SAY_PHRASE_4, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->getVictim() && m_uiPhase) + { + if (m_uiPhaseTimer <= uiDiff) + { + switch(m_uiPhase) + { + case 1: + if (GameObject* pTrap = m_creature->GetMap()->GetGameObject(m_uiGobjectTrapGUID)) + { + if (pTrap->isSpawned()) + m_creature->GetMotionMaster()->MovePoint(0, pTrap->GetPositionX(), pTrap->GetPositionY(), pTrap->GetPositionZ()); + } + break; + case 2: + if (GameObject* pTrap = m_creature->GetMap()->GetGameObject(m_uiGobjectTrapGUID)) + { + if (pTrap->isSpawned()) + { + pTrap->Use(m_creature); + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + if (pPlayer->isAlive()) + pPlayer->KilledMonsterCredit(m_creature->GetEntry()); + } + } + } + break; + } + + m_uiPhase = 0; + } + else + m_uiPhaseTimer -= uiDiff; + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + m_creature->HandleEmote(EMOTE_ONESHOT_LOOT); + m_uiPhaseTimer = 2000; + m_uiPhase = 2; + } +}; + +CreatureAI* GetAI_npc_nesingwary_trapper(Creature* pCreature) +{ + return new npc_nesingwary_trapperAI(pCreature); +} + +/*###### +## go_caribou_trap +######*/ + +bool GOHello_go_caribou_trap(Player* pPlayer, GameObject* pGo) +{ + float fX, fY, fZ; + pGo->GetClosePoint(fX, fY, fZ, pGo->GetObjectBoundingRadius(), 2*INTERACTION_DISTANCE, frand(0, M_PI_F*2)); + + if (Creature* pCreature = pGo->SummonCreature(NPC_NESINGWARY_TRAPPER, fX, fY, fZ, pGo->GetOrientation(), TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 10000)) + { + if (npc_nesingwary_trapperAI* pTrapperAI = dynamic_cast(pCreature->AI())) + pTrapperAI->StartAction(pPlayer->GetGUID(), pGo->GetGUID()); + + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + + if (GameObject* pGoFur = GetClosestGameObjectWithEntry(pGo, GO_QUALITY_FUR, INTERACTION_DISTANCE)) + { + if (!pGoFur->isSpawned()) + { + pGoFur->SetRespawnTime(10); + pGoFur->Refresh(); + } + } + } + + return true; +} + +/*###### +## npc_surristrasz +######*/ + +#define GOSSIP_ITEM_FREE_FLIGHT "I'd like passage to the Transitus Shield." +#define GOSSIP_ITEM_FLIGHT "May I use a drake to fly elsewhere?" + +enum +{ + SPELL_ABMER_TO_COLDARRA = 46064 +}; + +bool GossipHello_npc_surristrasz(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isTaxi()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FREE_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TAXI, GOSSIP_ITEM_FLIGHT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_TAXIVENDOR); + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_surristrasz(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_OPTION_GOSSIP) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + //TaxiPath 795 (amber to coldarra) + pPlayer->CastSpell(pPlayer, SPELL_ABMER_TO_COLDARRA, true); + } + + if (uiAction == GOSSIP_OPTION_TAXIVENDOR) + pPlayer->GetSession()->SendTaxiMenu(pCreature); + + return true; +} + +/*###### +## npc_tiare +######*/ + +#define GOSSIP_ITEM_TELEPORT "Teleport me to Amber Ledge, please." + +enum +{ + SPELL_TELEPORT_COLDARRA = 50135 +}; + +bool GossipHello_npc_tiare(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_GOSSIP); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tiare(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_OPTION_GOSSIP) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_COLDARRA, true); + } + return true; +} + +/*###### +## npc_lurgglbr +######*/ + +enum +{ + QUEST_ESCAPE_FROM_WINTERFIN_CAVERNS = 11570, + GO_CAGE = 187369, + + SAY_START_1 = -1000575, + SAY_START_2 = -1000576, + SAY_END_1 = -1000577, + SAY_END_2 = -1000578 +}; + +struct MANGOS_DLL_DECL npc_lurgglbrAI : public npc_escortAI +{ + npc_lurgglbrAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiSayTimer = 0; + m_uiSpeech = 0; + Reset(); + } + + uint32 m_uiSayTimer; + uint8 m_uiSpeech; + + void Reset() + { + if (!HasEscortState(STATE_ESCORT_ESCORTING)) + { + m_uiSayTimer = 0; + m_uiSpeech = 0; + } + } + + void JustStartedEscort() + { + if (GameObject* pCage = GetClosestGameObjectWithEntry(m_creature, GO_CAGE, INTERACTION_DISTANCE)) + { + if (pCage->GetGoState() == GO_STATE_READY) + pCage->Use(m_creature); + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 1: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_START_2, m_creature, pPlayer); + + // Cage actually closes here, however it's normally determined by GO template and auto close time + + break; + } + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + if (Player* pPlayer = GetPlayerForEscort()) + { + m_creature->SetFacingToObject(pPlayer); + DoScriptText(SAY_START_1, m_creature, pPlayer); + } + break; + case 25: + if (Player* pPlayer = GetPlayerForEscort()) + { + DoScriptText(SAY_END_1, m_creature, pPlayer); + m_uiSayTimer = 3000; + } + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (m_uiSayTimer) + { + if (m_uiSayTimer <= uiDiff) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + { + m_uiSayTimer = 0; + return; + } + + m_creature->SetFacingToObject(pPlayer); + + switch(m_uiSpeech) + { + case 0: + DoScriptText(SAY_END_2, m_creature, pPlayer); + m_uiSayTimer = 3000; + break; + case 1: + pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM_WINTERFIN_CAVERNS, m_creature); + m_uiSayTimer = 0; + break; + } + + ++m_uiSpeech; + } + else + m_uiSayTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_lurgglbr(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM_WINTERFIN_CAVERNS) + { + if (npc_lurgglbrAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE); + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + } + return true; +} + +CreatureAI* GetAI_npc_lurgglbr(Creature* pCreature) +{ + return new npc_lurgglbrAI(pCreature); +} + +void AddSC_borean_tundra() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_fizzcrank_fullthrottle"; + newscript->pGossipHello = &GossipHello_npc_fizzcrank_fullthrottle; + newscript->pGossipSelect = &GossipSelect_npc_fizzcrank_fullthrottle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_iruk"; + newscript->pGossipHello = &GossipHello_npc_iruk; + newscript->pGossipSelect = &GossipSelect_npc_iruk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_kara_thricestar"; + newscript->pGossipHello = &GossipHello_npc_kara_thricestar; + newscript->pGossipSelect = &GossipSelect_npc_kara_thricestar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_nesingwary_trapper"; + newscript->GetAI = &GetAI_npc_nesingwary_trapper; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_caribou_trap"; + newscript->pGOHello = &GOHello_go_caribou_trap; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_surristrasz"; + newscript->pGossipHello = &GossipHello_npc_surristrasz; + newscript->pGossipSelect = &GossipSelect_npc_surristrasz; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tiare"; + newscript->pGossipHello = &GossipHello_npc_tiare; + newscript->pGossipSelect = &GossipSelect_npc_tiare; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lurgglbr"; + newscript->GetAI = &GetAI_npc_lurgglbr; + newscript->pQuestAccept = &QuestAccept_npc_lurgglbr; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp new file mode 100644 index 0000000..488cc57 --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_anubarak_trial.cpp @@ -0,0 +1,78 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_anubarak_trial +SD%Complete: 0 +SDComment: +SDCategory: +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" + +struct MANGOS_DLL_DECL boss_anubarak_trialAI : public ScriptedAI +{ + boss_anubarak_trialAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ANUBARAK, NOT_STARTED); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ANUBARAK, DONE); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anubarak_trial(Creature* pCreature) +{ + return new boss_anubarak_trialAI(pCreature); +} + +void AddSC_boss_anubarak_trial() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_anubarak_trial"; + newscript->GetAI = &GetAI_boss_anubarak_trial; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_faction_champions.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_faction_champions.cpp new file mode 100644 index 0000000..acc9c69 --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_faction_champions.cpp @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: faction_champions +SD%Complete: 0 +SDComment: +SDCategory: Crusader Coliseum +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_jaraxxus.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_jaraxxus.cpp new file mode 100644 index 0000000..c7e2c89 --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_jaraxxus.cpp @@ -0,0 +1,82 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: trial_of_the_crusader +SD%Complete: 0 +SDComment: +SDCategory: Crusader Coliseum +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" + +/*###### +## boss_jaraxxus +######*/ + +struct MANGOS_DLL_DECL boss_jaraxxusAI : public ScriptedAI +{ + boss_jaraxxusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_JARAXXUS, NOT_STARTED); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_JARAXXUS, DONE); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_jaraxxus(Creature* pCreature) +{ + return new boss_jaraxxusAI(pCreature); +} + +void AddSC_boss_jaraxxus() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_jaraxxus"; + newscript->GetAI = &GetAI_boss_jaraxxus; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_northrend_beasts.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_northrend_beasts.cpp new file mode 100644 index 0000000..f0d5da0 --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_northrend_beasts.cpp @@ -0,0 +1,199 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: +SD%Complete: 0 +SDComment: +SDCategory: +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" + +struct MANGOS_DLL_DECL boss_gormokAI : public ScriptedAI +{ + boss_gormokAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NORTHREND_BEASTS, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gormok(Creature* pCreature) +{ + return new boss_gormokAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_acidmawAI : public ScriptedAI +{ + boss_acidmawAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NORTHREND_BEASTS, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_acidmaw(Creature* pCreature) +{ + return new boss_acidmawAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_dreadscaleAI : public ScriptedAI +{ + boss_dreadscaleAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NORTHREND_BEASTS, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dreadscale(Creature* pCreature) +{ + return new boss_dreadscaleAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_icehowlAI : public ScriptedAI +{ + boss_icehowlAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NORTHREND_BEASTS, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_icehowl(Creature* pCreature) +{ + return new boss_icehowlAI(pCreature); +} + +void AddSC_northrend_beasts() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_gormok"; + newscript->GetAI = &GetAI_boss_gormok; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_acidmaw"; + newscript->GetAI = &GetAI_boss_acidmaw; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_dreadscale"; + newscript->GetAI = &GetAI_boss_dreadscale; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_icehowl"; + newscript->GetAI = &GetAI_boss_icehowl; + newscript->RegisterSelf(); + +} diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp new file mode 100644 index 0000000..4f2d189 --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/boss_twin_valkyr.cpp @@ -0,0 +1,100 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: trial_of_the_crusader +SD%Complete: 0 +SDComment: +SDCategory: Crusader Coliseum +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" + +/*###### +## boss_fjola +######*/ + +struct MANGOS_DLL_DECL boss_fjolaAI : public ScriptedAI +{ + boss_fjolaAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_fjola(Creature* pCreature) +{ + return new boss_fjolaAI(pCreature); +} + +/*###### +## boss_eydis +######*/ + +struct MANGOS_DLL_DECL boss_eydisAI : public ScriptedAI +{ + boss_eydisAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() {} + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_eydis(Creature* pCreature) +{ + return new boss_eydisAI(pCreature); +} + +void AddSC_twin_valkyr() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_fjola"; + newscript->GetAI = &GetAI_boss_fjola; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_eydis"; + newscript->GetAI = &GetAI_boss_fjola; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/instance_trial_of_the_crusader.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/instance_trial_of_the_crusader.cpp new file mode 100644 index 0000000..9fba55a --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/instance_trial_of_the_crusader.cpp @@ -0,0 +1,199 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_trial_of_the_crusader +SD%Complete: 100 +SDComment: +SDCategory: Crusader Coliseum +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" + +/* Trial Of The Crusader encounters: +0 - Northrend Beasts +1 - Jaraxxus +2 - Faction Champions +3 - Twin Valkyr +4 - Anubarak +*/ + +struct MANGOS_DLL_DECL instance_trial_of_the_crusader : public ScriptedInstance +{ + instance_trial_of_the_crusader(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint32 m_uiGormokGUID; + uint32 m_uiAcidmawGUID; + uint32 m_uiDreadscaleGUID; + uint32 m_uiIcehowlGUID; + uint32 m_uiJaraxxusGUID; + uint32 m_uiFjolaGUID; + uint32 m_uiEydisGUID; + uint32 m_uiAnubarakGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiGormokGUID = 0; + m_uiAcidmawGUID = 0; + m_uiDreadscaleGUID = 0; + m_uiIcehowlGUID = 0; + m_uiJaraxxusGUID = 0; + m_uiFjolaGUID = 0; + m_uiEydisGUID = 0; + m_uiAnubarakGUID = 0; + + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 34796: m_uiGormokGUID = pCreature->GetGUID(); break; + case 35144: m_uiAcidmawGUID = pCreature->GetGUID(); break; + case 34799: m_uiDreadscaleGUID = pCreature->GetGUID(); break; + case 34797: m_uiIcehowlGUID = pCreature->GetGUID(); break; + case 34780: m_uiJaraxxusGUID = pCreature->GetGUID(); break; + case 34497: m_uiFjolaGUID = pCreature->GetGUID(); break; + case 34496: m_uiEydisGUID = pCreature->GetGUID(); break; + case 34564: m_uiAnubarakGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Trial Of The Crusader: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_NORTHREND_BEASTS: + m_auiEncounter[0] = uiData; + break; + case TYPE_JARAXXUS: + m_auiEncounter[1] = uiData; + break; + case TYPE_FACTION_CHAMPIONS: + m_auiEncounter[2] = uiData; + break; + case TYPE_TWIN_VALKYR: + m_auiEncounter[3] = uiData; + break; + case TYPE_ANUBARAK: + m_auiEncounter[4] = uiData; + break; + default: + error_log("SD2: Instance Trial of The Crusader: ERROR SetData = %u for type %u does not exist/not implemented.",uiType,uiData); + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_NORTHREND_BEASTS: return m_auiEncounter[0]; + case TYPE_JARAXXUS: return m_auiEncounter[1]; + case TYPE_FACTION_CHAMPIONS: return m_auiEncounter[2]; + case TYPE_TWIN_VALKYR: return m_auiEncounter[3]; + case TYPE_ANUBARAK: return m_auiEncounter[4]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_GORMOK: return m_uiGormokGUID; + case DATA_ACIDMAW: return m_uiAcidmawGUID; + case DATA_DREADSCALE: return m_uiDreadscaleGUID; + case DATA_ICEHOWL: return m_uiIcehowlGUID; + case DATA_JARAXXUS: return m_uiJaraxxusGUID; + case DATA_FJOLA: return m_uiFjolaGUID; + case DATA_EYDIS: return m_uiEydisGUID; + case DATA_ANUBARAK: return m_uiAnubarakGUID; + } + return 0; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_trial_of_the_crusader(Map* pMap) +{ + return new instance_trial_of_the_crusader(pMap); +} + +void AddSC_instance_trial_of_the_crusader() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "instance_trial_of_the_crusader"; + newscript->GetInstanceData = &GetInstanceData_instance_trial_of_the_crusader; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp new file mode 100644 index 0000000..b97c0bc --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.cpp @@ -0,0 +1,87 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: trial_of_the_crusader +SD%Complete: 0 +SDComment: +SDCategory: Crusader Coliseum +EndScriptData */ + +#include "precompiled.h" +#include "trial_of_the_crusader.h" + +enum +{ + NPC_GORMOK = 34796, + NPC_JARAXXUS = 34780, + + GOSSIP_ITEM_START_EVENT1 = -3649000 +}; + +/*###### +## npc_barrett_ramsey +######*/ + +struct MANGOS_DLL_DECL npc_barrett_ramseyAI : public ScriptedAI +{ + npc_barrett_ramseyAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + ScriptedInstance* m_pInstance; + + void Reset() {} + + void StartEvent(Player* pPlayer) + { + // code starting the event here + } +}; + +bool GossipHello_npc_barrett_ramsey(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START_EVENT1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_barrett_ramsey(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + if (npc_barrett_ramseyAI* pBarrettAI = dynamic_cast(pCreature->AI())) + pBarrettAI->StartEvent(pPlayer); + } + + return true; +} + +CreatureAI* GetAI_npc_barrett_ramsey(Creature* pCreature) +{ + return new npc_barrett_ramseyAI(pCreature); +} + +void AddSC_trial_of_the_crusader() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_barrett_ramsey"; + pNewScript->GetAI = &GetAI_npc_barrett_ramsey; + pNewScript->pGossipHello = &GossipHello_npc_barrett_ramsey; + pNewScript->pGossipSelect = &GossipSelect_npc_barrett_ramsey; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.h b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.h new file mode 100644 index 0000000..4a2b680 --- /dev/null +++ b/scripts/northrend/crusaders_coliseum/trial_of_the_crusader/trial_of_the_crusader.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_TRIAL_OF_THE_CRUSADER_H +#define DEF_TRIAL_OF_THE_CRUSADER_H + +enum +{ + MAX_ENCOUNTER = 5, + + TYPE_NORTHREND_BEASTS = 1, + TYPE_JARAXXUS = 2, + TYPE_FACTION_CHAMPIONS = 3, + TYPE_TWIN_VALKYR = 4, + TYPE_ANUBARAK = 5, + + DATA_GORMOK = 6, + DATA_ACIDMAW = 7, + DATA_DREADSCALE = 8, + DATA_ICEHOWL = 9, + DATA_JARAXXUS = 10, + DATA_FACTION_CHAMPIONS = 11, + DATA_FJOLA = 12, + DATA_EYDIS = 13, + DATA_ANUBARAK = 14, +}; + +#endif diff --git a/scripts/northrend/dalaran.cpp b/scripts/northrend/dalaran.cpp new file mode 100644 index 0000000..64291d4 --- /dev/null +++ b/scripts/northrend/dalaran.cpp @@ -0,0 +1,125 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dalaran +SD%Complete: 100 +SDComment: +SDCategory: Dalaran +EndScriptData */ + +/* ContentData +npc_dalaran_guardian_mage +npc_zirdomi +EndContentData */ + +#include "precompiled.h" + +enum +{ + SPELL_TRESPASSER_H = 54029, + SPELL_TRESPASSER_A = 54028, + + AREA_ID_SUNREAVER = 4616, + AREA_ID_SILVER_ENCLAVE = 4740 +}; + +struct MANGOS_DLL_DECL npc_dalaran_guardian_mageAI : public ScriptedAI +{ + npc_dalaran_guardian_mageAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + if (pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho)) + { + if (m_creature->IsWithinDistInMap(pWho, m_creature->GetAttackDistance(pWho)) && m_creature->IsWithinLOSInMap(pWho)) + { + if (Player* pPlayer = pWho->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + // it's mentioned that pet may also be teleported, if so, we need to tune script to apply to those in addition. + + if (pPlayer->GetAreaId() == AREA_ID_SILVER_ENCLAVE) + DoCastSpellIfCan(pPlayer, SPELL_TRESPASSER_A); + else if (pPlayer->GetAreaId() == AREA_ID_SUNREAVER) + DoCastSpellIfCan(pPlayer, SPELL_TRESPASSER_H); + } + } + } + } + + void AttackedBy(Unit* /*pAttacker*/) {} + + void Reset() {} + + void UpdateAI(const uint32 /*uiDiff*/) {} +}; + +CreatureAI* GetAI_npc_dalaran_guardian_mage(Creature* pCreature) +{ + return new npc_dalaran_guardian_mageAI(pCreature); +} + +/*###### +## npc_zidormi +######*/ + +#define GOSSIP_ITEM_ZIDORMI1 "Take me to the Caverns of Time." + +enum +{ + SPELL_TELEPORT_COT = 46343, + GOSSIP_TEXTID_ZIDORMI1 = 14066 +}; + +bool GossipHello_npc_zidormi(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->getLevel() >= 65) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ZIDORMI1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ZIDORMI1, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_zidormi(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->CastSpell(pPlayer,SPELL_TELEPORT_COT,false); + + return true; +} + +void AddSC_dalaran() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_dalaran_guardian_mage"; + newscript->GetAI = &GetAI_npc_dalaran_guardian_mage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_zidormi"; + newscript->pGossipHello = &GossipHello_npc_zidormi; + newscript->pGossipSelect = &GossipSelect_npc_zidormi; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/dragonblight.cpp b/scripts/northrend/dragonblight.cpp new file mode 100644 index 0000000..aaac9ef --- /dev/null +++ b/scripts/northrend/dragonblight.cpp @@ -0,0 +1,219 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Dragonblight +SD%Complete: 100 +SDComment: Quest support: 12166, 12499/12500(end sequenze). Taxi paths Wyrmrest temple. +SDCategory: Dragonblight +EndScriptData */ + +/* ContentData +npc_afrasastrasz +npc_alexstrasza_wr_gate +npc_liquid_fire_of_elune +npc_tariolstrasz +npc_torastrasza +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_afrasastrasz +######*/ + +enum +{ + TAXI_PATH_ID_MIDDLE_DOWN = 882, + TAXI_PATH_ID_MIDDLE_TOP = 881 +}; + +#define GOSSIP_ITEM_TAXI_MIDDLE_DOWN "I would like to take a flight to the ground, Lord Of Afrasastrasz." +#define GOSSIP_ITEM_TAXI_MIDDLE_TOP "My Lord, I must go to the upper floor of the temple." + +bool GossipHello_npc_afrasastrasz(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TAXI_MIDDLE_DOWN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TAXI_MIDDLE_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_afrasastrasz(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_MIDDLE_DOWN); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_MIDDLE_TOP); + } + return true; +} + +/*###### +## npc_alexstrasza_wr_gate +######*/ + +enum +{ + QUEST_RETURN_TO_AG_A = 12499, + QUEST_RETURN_TO_AG_H = 12500, + MOVIE_ID_GATES = 14 +}; + +#define GOSSIP_ITEM_WHAT_HAPPENED "Alexstrasza, can you show me what happened here?" + +bool GossipHello_npc_alexstrasza_wr_gate(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_AG_A) || pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_AG_H)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_HAPPENED, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_alexstrasza_wr_gate(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->SendMovieStart(MOVIE_ID_GATES); + } + + return true; +} + +/*###### +## npc_tariolstrasz +######*/ + +enum +{ + QUEST_INFORM_QUEEN_A = 12123, //need to check if quests are required before gossip available + QUEST_INFORM_QUEEN_H = 12124, + TAXI_PATH_ID_BOTTOM_TOP = 878, + TAXI_PATH_ID_BOTTOM_MIDDLE = 883 +}; + +#define GOSSIP_ITEM_TAXI_BOTTOM_TOP "My Lord, I must go to the upper floor of the temple." +#define GOSSIP_ITEM_TAXI_BOTTOM_MIDDLE "Can you spare a drake to travel to Lord Of Afrasastrasz, in the middle of the temple?" + +bool GossipHello_npc_tariolstrasz(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TAXI_BOTTOM_TOP, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TAXI_BOTTOM_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tariolstrasz(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_BOTTOM_TOP); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_BOTTOM_MIDDLE); + } + return true; +} + +/*###### +## npc_torastrasza +######*/ + +enum +{ + TAXI_PATH_ID_TOP_MIDDLE = 880, + TAXI_PATH_ID_TOP_BOTTOM = 879 +}; + +#define GOSSIP_ITEM_TAXI_TOP_MIDDLE "I would like to see Lord Of Afrasastrasz, in the middle of the temple." +#define GOSSIP_ITEM_TAXI_TOP_BOTTOM "Yes, Please. I would like to return to the ground floor of the temple." + +bool GossipHello_npc_torastrasza(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TAXI_TOP_MIDDLE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TAXI_TOP_BOTTOM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_torastrasza(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_TOP_MIDDLE); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID_TOP_BOTTOM); + } + return true; +} + +void AddSC_dragonblight() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_afrasastrasz"; + newscript->pGossipHello = &GossipHello_npc_afrasastrasz; + newscript->pGossipSelect = &GossipSelect_npc_afrasastrasz; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_alexstrasza_wr_gate"; + newscript->pGossipHello = &GossipHello_npc_alexstrasza_wr_gate; + newscript->pGossipSelect = &GossipSelect_npc_alexstrasza_wr_gate; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tariolstrasz"; + newscript->pGossipHello = &GossipHello_npc_tariolstrasz; + newscript->pGossipSelect = &GossipSelect_npc_tariolstrasz; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_torastrasza"; + newscript->pGossipHello = &GossipHello_npc_torastrasza; + newscript->pGossipSelect = &GossipSelect_npc_torastrasza; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/draktharon_keep/boss_novos.cpp b/scripts/northrend/draktharon_keep/boss_novos.cpp new file mode 100644 index 0000000..6082d58 --- /dev/null +++ b/scripts/northrend/draktharon_keep/boss_novos.cpp @@ -0,0 +1,95 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Novos +SD%Complete: 20% +SDComment: +SDCategory: Drak'Tharon Keep +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1600005, + SAY_DEATH = -1600006, + SAY_KILL = -1600007, + SAY_ADDS = -1600008, + SAY_BUBBLE_1 = -1600009, + SAY_BUBBLE_2 = -1600010, + + EMOTE_ASSISTANCE = -1600011 +}; + +/*###### +## boss_novos +######*/ + +struct MANGOS_DLL_DECL boss_novosAI : public ScriptedAI +{ + boss_novosAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_novos(Creature* pCreature) +{ + return new boss_novosAI(pCreature); +} + +void AddSC_boss_novos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_novos"; + newscript->GetAI = &GetAI_boss_novos; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/draktharon_keep/boss_tharonja.cpp b/scripts/northrend/draktharon_keep/boss_tharonja.cpp new file mode 100644 index 0000000..64e669f --- /dev/null +++ b/scripts/northrend/draktharon_keep/boss_tharonja.cpp @@ -0,0 +1,95 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Tharonja +SD%Complete: 20% +SDComment: +SDCategory: Drak'Tharon Keep +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1600012, + SAY_KILL_1 = -1600013, + SAY_KILL_2 = -1600014, + SAY_FLESH_1 = -1600015, + SAY_FLESH_2 = -1600016, + SAY_SKELETON_1 = -1600017, + SAY_SKELETON_2 = -1600018, + SAY_DEATH = -1600019 +}; + +/*###### +## boss_tharonja +######*/ + +struct MANGOS_DLL_DECL boss_tharonjaAI : public ScriptedAI +{ + boss_tharonjaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_tharonja(Creature* pCreature) +{ + return new boss_tharonjaAI(pCreature); +} + +void AddSC_boss_tharonja() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_tharonja"; + newscript->GetAI = &GetAI_boss_tharonja; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/draktharon_keep/boss_trollgore.cpp b/scripts/northrend/draktharon_keep/boss_trollgore.cpp new file mode 100644 index 0000000..81c75c0 --- /dev/null +++ b/scripts/northrend/draktharon_keep/boss_trollgore.cpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Trollgore +SD%Complete: 20% +SDComment: +SDCategory: Drak'Tharon Keep +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1600000, + SAY_CONSUME = -1600001, + SAY_DEATH = -1600002, + SAY_EXPLODE = -1600003, + SAY_KILL = -1600004 +}; + +/*###### +## boss_trollgore +######*/ + +struct MANGOS_DLL_DECL boss_trollgoreAI : public ScriptedAI +{ + boss_trollgoreAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetCharmerOrOwnerPlayerOrPlayerItself()) + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_trollgore(Creature* pCreature) +{ + return new boss_trollgoreAI(pCreature); +} + +void AddSC_boss_trollgore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_trollgore"; + newscript->GetAI = &GetAI_boss_trollgore; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/grizzly_hills.cpp b/scripts/northrend/grizzly_hills.cpp new file mode 100644 index 0000000..67c02d1 --- /dev/null +++ b/scripts/northrend/grizzly_hills.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Grizzly_Hills +SD%Complete: +SDComment: +SDCategory: Grizzly Hills +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/gundrak/boss_colossus.cpp b/scripts/northrend/gundrak/boss_colossus.cpp new file mode 100644 index 0000000..ed1b5f9 --- /dev/null +++ b/scripts/northrend/gundrak/boss_colossus.cpp @@ -0,0 +1,433 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Colossus +SD%Complete: 20% +SDComment: +SDCategory: Gundrak +EndScriptData */ + +#include "precompiled.h" +#include "gundrak.h" +#include + +enum +{ + EMOTE_SURGE = -1604008, + EMOTE_SEEP = -1604009, + EMOTE_GLOW = -1604010 +}; + +#define SPELL_MIGHTY_BLOW 54719 +#define SPELL_EMERGE 54850 +#define SPELL_SURGE 54801 //no work +#define SPELL_MERGE 54878 //no work + +#define MOJO_ENTRY 29830 +#define ELEMENTAL_ENTRY 29573 + +float distance = 10.0f; + +#define START_POS_X 1672.959961f +#define START_POS_Y 743.487976f +#define START_POS_Z 143.337997f + +#define MODELID_FAKE 26592 +#define MODELID_RIGHT 26589 + +/*###### +## boss_colossus +######*/ + +struct MANGOS_DLL_DECL boss_colossusAI : public ScriptedAI +{ + boss_colossusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bHasCreatedList; + bool m_bIsElementarPhase; + bool m_bIsSpawnt; + bool m_bIsDead; + bool m_bElementsHasMoved; + bool m_bEventStarted; + bool m_bModelChanged; + + std::list m_lLivingMojoGUIDList; + + Creature* pElemental; + + Player* pFirstTarget; + + uint32 m_uielementalLifepoints; + uint32 m_uimightyBlowTimer; + uint32 m_uiemergeTimer; + uint32 m_uispawnElementalTimer; + uint32 m_uichangePhaseTimer; + uint32 m_uiElementalDeathTimer; + uint32 m_uiFirstModelChangeTimer; + + void Reset() + { + m_bHasCreatedList = true; + m_bIsElementarPhase = false; + m_bIsSpawnt = false; + m_bIsDead = false; + m_bElementsHasMoved = false; + m_bEventStarted = false; + m_bModelChanged = false; + + m_uiemergeTimer = 12000; + m_uispawnElementalTimer = 25000; + m_uiElementalDeathTimer = 4000; + m_uiFirstModelChangeTimer = 1000; + m_uimightyBlowTimer = 3000; + + if (m_pInstance) + m_pInstance->SetData(TYPE_COLOSSUS, NOT_STARTED); + + RespawnElementalsIfDeadOrEvade(); + + m_lLivingMojoGUIDList.clear(); + + m_creature->RemoveAllAuras(); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_COLOSSUS, IN_PROGRESS); + } + + void JustReachedHome() + { + m_creature->RemoveAllAuras(); + } + + void JustDied(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_COLOSSUS, DONE); + if (m_bIsSpawnt) + { + pElemental->SetInCombatWith(pFirstTarget); + pElemental->GetMotionMaster()->MoveChase(pFirstTarget); + pElemental->SetVisibility(VISIBILITY_ON); + pElemental->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + void RespawnElementalsIfDeadOrEvade() + { + if (!m_lLivingMojoGUIDList.empty() && m_pInstance) + { + for(std::list::iterator itr = m_lLivingMojoGUIDList.begin(); itr != m_lLivingMojoGUIDList.end(); ++itr) + { + if (Creature* pMojo = m_pInstance->instance->GetCreature(*itr)) + { + if (!pMojo->isAlive()) + pMojo->Respawn(); + else + pMojo->AI()->EnterEvadeMode(); + + if (pMojo->GetVisibility() == VISIBILITY_OFF) + pMojo->SetVisibility(VISIBILITY_ON); + } + } + } + } + + void MoveInLineOfSight(Unit* pUnit) + { + if (pUnit->GetTypeId() == TYPEID_PLAYER && !m_bElementsHasMoved) + { + if (m_creature->GetDistance(pUnit) < 25.0f) + { + pFirstTarget = (Player*)pUnit; + PrepareElementals(); + pUnit->SetInCombatWith(m_creature); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_bEventStarted = true; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + + if (!m_lLivingMojoGUIDList.empty() && m_pInstance) + { + for(std::list::iterator itr = m_lLivingMojoGUIDList.begin(); itr != m_lLivingMojoGUIDList.end(); ++itr) + { + if (Creature* pElemental = m_pInstance->instance->GetCreature(*itr)) + { + if (pElemental->isAlive()) + { + pElemental->GetMotionMaster()->MovePoint(0, START_POS_X, START_POS_Y, START_POS_Z); + pElemental->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + pElemental->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + } + + m_bElementsHasMoved = true; + } + } + } + + void KillElementals() + { + if (!m_lLivingMojoGUIDList.empty() && m_pInstance) + { + for(std::list::iterator itr = m_lLivingMojoGUIDList.begin(); itr != m_lLivingMojoGUIDList.end(); ++itr) + { + if (Creature* pElemental = m_pInstance->instance->GetCreature(*itr)) + { + if (pElemental->isAlive()) + { + m_creature->DealDamage(pElemental, pElemental->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pElemental->SetVisibility(VISIBILITY_OFF); + pFirstTarget->SetInCombatWith(m_creature); + m_creature->AddThreat(pFirstTarget); + m_creature->GetMotionMaster()->MoveChase(pFirstTarget); + } + } + } + } + } + + void PrepareElementals() + { + std::list lLivingMojoList; + GetCreatureListWithEntryInGrid(lLivingMojoList,m_creature, MOJO_ENTRY, 50.0f); + + if (!lLivingMojoList.empty()) + { + m_lLivingMojoGUIDList.clear(); + + for(std::list::iterator itr = lLivingMojoList.begin(); itr != lLivingMojoList.end(); ++itr) + m_lLivingMojoGUIDList.push_back((*itr)->GetGUID());; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bIsSpawnt) + if (!pElemental->isAlive()) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + if (m_bEventStarted) + { + if (!m_bIsDead) + { + if (m_uiElementalDeathTimer < uiDiff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + KillElementals(); + m_bIsDead = true; + m_bEventStarted = false; + }else m_uiElementalDeathTimer -= uiDiff; + + return; + } + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bIsElementarPhase) + { + if (m_uichangePhaseTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + m_creature->GetMotionMaster()->MoveChase(pTarget); + m_creature->SetInCombatWith(pTarget); + } + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (m_bIsSpawnt) + { + pElemental->SetVisibility(VISIBILITY_OFF); + pElemental->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pElemental->GetMotionMaster()->Clear(); + pElemental->GetMotionMaster()->MoveIdle(); + } + + m_uichangePhaseTimer = 25000; + m_bIsElementarPhase = false; + }else m_uichangePhaseTimer -= uiDiff; + + return; + } + + if (m_uimightyBlowTimer < uiDiff) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_MIGHTY_BLOW, false); + m_uimightyBlowTimer = urand(14000, 18000); + }else m_uimightyBlowTimer -= uiDiff; + + if (m_uiemergeTimer < uiDiff) + { + m_creature->CastSpell(m_creature, SPELL_EMERGE, true); + m_uiemergeTimer = 9999999; + m_uispawnElementalTimer = 2700; + }m_uiemergeTimer -= uiDiff; + + if (m_uispawnElementalTimer < uiDiff) + { + m_bIsElementarPhase = true; + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + float x; + float y; + float winkel = m_creature->GetOrientation() / 0.01744444444444444f; + if (winkel < 90) + { + float sinWinkel = sin(winkel); + float h = sinWinkel * distance; + float p = sqrt(distance * distance - h * h); + x = p; + y = h; + } + else if (winkel < 180) + { + float sinWinkel = sin(winkel); + float h = sinWinkel * distance; + float p = sqrt(distance * distance - h * h); + x = p*(-1); + y = h; + } + else if (winkel < 270) + { + float sinWinkel = sin(winkel); + float h = sinWinkel * distance; + float p = sqrt(distance * distance - h * h); + x = p*(-1); + y = h*(-1); + } + else + { + float sinWinkel = sin(winkel); + float h = sinWinkel * distance; + float p = sqrt(distance * distance - h * h); + x = p; + y = h*(-1); + } + + if (!m_bIsSpawnt) + { + if (pElemental = m_creature->SummonCreature(ELEMENTAL_ENTRY, m_creature->GetPositionX() + x, m_creature->GetPositionY() + y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600000)) + { + pElemental->SetInCombatWith(m_creature->getVictim()); + m_bIsSpawnt = true; + } + } + else + { + pElemental->NearTeleportTo(m_creature->GetPositionX() + x, m_creature->GetPositionY() + y, m_creature->GetPositionZ(), 0); + pElemental->SetInCombatWith(m_creature->getVictim()); + pElemental->GetMotionMaster()->MoveChase(m_creature->getVictim()); + pElemental->SetVisibility(VISIBILITY_ON); + pElemental->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_uispawnElementalTimer = 25000; + m_uichangePhaseTimer = 25000; + m_bIsElementarPhase = true; + }else m_uispawnElementalTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_colossus(Creature* pCreature) +{ + return new boss_colossusAI(pCreature); +} +/* +struct MANGOS_DLL_DECL mob_colossus_elementalAI : public ScriptedAI +{ + mob_colossus_elementalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiMergeTimer; + + void Reset() + { + m_uiMergeTimer = 25000; + } + + void Aggro(Unit* pWho) + { + + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetVisibility() == VISIBILITY_ON) + { + if (m_uiMergeTimer < uiDiff) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_uiMergeTimer = 25000; + }else m_uiMergeTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_mob_colossus_elemental(Creature* pCreature) +{ + return new mob_colossus_elementalAI(pCreature); +}*/ + +void AddSC_boss_colossus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_colossus"; + newscript->GetAI = &GetAI_boss_colossus; + newscript->RegisterSelf(); + +/* newscript = new Script; + newscript->Name = "mob_colossus_elemental"; + newscript->GetAI = &GetAI_mob_colossus_elemental; + newscript->RegisterSelf();*/ +} diff --git a/scripts/northrend/gundrak/boss_galdarah.cpp b/scripts/northrend/gundrak/boss_galdarah.cpp new file mode 100644 index 0000000..71d9d0c --- /dev/null +++ b/scripts/northrend/gundrak/boss_galdarah.cpp @@ -0,0 +1,269 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Galdarah +SD%Complete: 20% +SDComment: +SDCategory: Gundrak +EndScriptData */ + +#include "precompiled.h" +#include "gundrak.h" + +enum +{ + SAY_AGGRO = -1604019, + SAY_TRANSFORM_1 = -1604020, + SAY_TRANSFORM_2 = -1604021, + SAY_SUMMON_1 = -1604022, + SAY_SUMMON_2 = -1604023, + SAY_SUMMON_3 = -1604024, + SAY_SLAY_1 = -1604025, + SAY_SLAY_2 = -1604026, + SAY_SLAY_3 = -1604027, + SAY_DEATH = -1604028, + + SPELL_STAMPEDE = 55220, + SPELL_STAMPEDE_H = 59823, + SPELL_CHARGE = 74399, + SPELL_WHIRLING_SLASH = 55250, + SPELL_WHIRLING_SLASH_H = 59824, + SPELL_IMPALING_CHARGE = 54956, + SPELL_IMPALING_CHARGE_H = 59827, + SPELL_KNOCK_BACK = 56104, + SPELL_PUNCTURE = 55276, + SPELL_PUNCTURE_H = 59826, + SPELL_STOMP = 55292, + SPELL_STOMP_H = 59829, + SPELL_ENRAGE = 55285, + SPELL_ENRAGE_H = 59828, + + NPC_RHINO_SPIRIT = 29791, + + MODELID_HUMAN = 27061, + MODELID_RHINO = 26265, + + AURA_ECK_RESIDUE = 55817, + ACHIEV_WHAT_THE_ECK_H = 1864 +}; + +/*###### +## boss_galdarah +######*/ + +struct MANGOS_DLL_DECL boss_galdarahAI : public ScriptedAI +{ + boss_galdarahAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bRhinoPhase; + bool m_bUseStampede; + + uint32 m_uiChangePhaseTimer; + uint32 m_uiStampedeTimer; + uint32 m_uiWhirlingSlashTimer; + uint32 m_uiStompTimer; + uint32 m_uiEnrageTimer; + uint32 m_uiImpalingChargeTimer; + uint32 m_uiPunctureTimer; + + uint64 m_uiRhinoGUID; + + void Reset() + { + m_bRhinoPhase = false; + m_bUseStampede = false; + + m_uiChangePhaseTimer = 40000; + m_uiStampedeTimer = 6000; + m_uiWhirlingSlashTimer = 8000; + m_uiStompTimer = 5000; + m_uiEnrageTimer = 4000; + m_uiImpalingChargeTimer = 7000; + m_uiPunctureTimer = 10000; + + m_uiRhinoGUID = 0; + + m_creature->SetDisplayId(MODELID_HUMAN); + + if (m_pInstance) + m_pInstance->SetData(TYPE_GALDARAH, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GALDARAH, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GALDARAH, DONE); + + DoScriptText(SAY_DEATH, m_creature); + /* + Map::PlayerList const& plList = m_pInstance->instance->GetPlayers(); + + if(plList.isEmpty()) + return; + + for(Map::PlayerList::const_iterator ittr = plList.begin(); ittr != plList.end(); ++ittr) + { + if(ittr->getSource() && ittr->getSource()->HasAura(AURA_ECK_RESIDUE)) + { + ittr->getSource() // add Archivment here + } + }*/ + } + + void ChangePhase() + { + m_bRhinoPhase ? m_bRhinoPhase = false : m_bRhinoPhase = true; + m_creature->SetDisplayId(m_creature->GetDisplayId() == MODELID_HUMAN ? MODELID_RHINO : MODELID_HUMAN); + } + + void SummonRhinoSpirit() + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if(pTarget) + { + float x = pTarget->GetPositionX() + 20.0f; + float y = pTarget->GetPositionY() + 20.0f; + float z = pTarget->GetPositionZ(); + Creature* cRhino = m_creature->SummonCreature(NPC_RHINO_SPIRIT, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 1800); + if (cRhino) + { + m_uiRhinoGUID = cRhino->GetGUID(); + cRhino->CastSpell(pTarget, SPELL_CHARGE, true); + cRhino->SetInCombatWith(pTarget); + cRhino->AddThreat(pTarget, 1000.0f); + } + } + m_bUseStampede = true; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bUseStampede) + { + if (Creature* cRhino = m_creature->GetMap()->GetCreature(m_uiRhinoGUID)) + { + if (cRhino->getVictim()) + { + if (cRhino->getVictim()->GetDistance(cRhino) < ATTACK_DISTANCE) + { + cRhino->CastSpell(cRhino->getVictim(), m_bIsRegularMode ? SPELL_STAMPEDE : SPELL_STAMPEDE_H, true); + m_bUseStampede = false; + } + } + } + } + + if (m_uiChangePhaseTimer < uiDiff) + { + ChangePhase(); + m_uiChangePhaseTimer = 40000; + }else m_uiChangePhaseTimer -= uiDiff; + + if (!m_bRhinoPhase) + { + if (m_uiStampedeTimer < uiDiff) + { + SummonRhinoSpirit(); + m_uiStampedeTimer = urand(8000, 11000); + }else m_uiStampedeTimer -= uiDiff; + + if (m_uiWhirlingSlashTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WHIRLING_SLASH : SPELL_WHIRLING_SLASH_H); + m_uiWhirlingSlashTimer = urand(15000, 23000); + if (m_uiChangePhaseTimer < 5000) + m_uiChangePhaseTimer = 5000; + }else m_uiWhirlingSlashTimer -= uiDiff; + } + else + { + if (m_uiStompTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_STOMP : SPELL_STOMP_H); + m_uiStompTimer = urand(12000, 15000); + }else m_uiStompTimer -= uiDiff; + + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ENRAGE : SPELL_ENRAGE_H); + m_uiEnrageTimer = urand(12000, 15000); + }else m_uiEnrageTimer -= uiDiff; + + if (m_uiImpalingChargeTimer < uiDiff) + { + if (Unit* pVictim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(pVictim, m_bIsRegularMode ? SPELL_IMPALING_CHARGE : SPELL_IMPALING_CHARGE_H); + DoCastSpellIfCan(pVictim, SPELL_KNOCK_BACK); + } + m_uiImpalingChargeTimer = urand(7000, 9000); + }else m_uiImpalingChargeTimer -= uiDiff; + + if (m_uiPunctureTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0), m_bIsRegularMode ? SPELL_PUNCTURE : SPELL_PUNCTURE_H); + m_uiPunctureTimer = urand(20000, 25000); + }else m_uiPunctureTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_galdarah(Creature* pCreature) +{ + return new boss_galdarahAI(pCreature); +} + +void AddSC_boss_galdarah() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_galdarah"; + newscript->GetAI = &GetAI_boss_galdarah; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/gundrak/boss_moorabi.cpp b/scripts/northrend/gundrak/boss_moorabi.cpp new file mode 100644 index 0000000..d0cab47 --- /dev/null +++ b/scripts/northrend/gundrak/boss_moorabi.cpp @@ -0,0 +1,188 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Moorabi +SD%Complete: 20% +SDComment: +SDCategory: Gundrak +EndScriptData */ + +#include "precompiled.h" +#include "gundrak.h" + +enum +{ + SAY_AGGRO = -1604011, + SAY_QUAKE = -1604012, + SAY_TRANSFORM = -1604013, + SAY_SLAY_1 = -1604014, + SAY_SLAY_2 = -1604015, + SAY_SLAY_3 = -1604016, + SAY_DEATH = -1604017, + EMOTE_TRANSFORM = -1604018, + EMOTE_TRANSFORMED = -1604029, + + // Troll form + SPELL_DETERMINED_STAB = 55104, + SPELL_MOJO_FRENZY = 55163, + SPELL_GROUND_TREMOR = 55142, + SPELL_NUMBING_SHOUT = 55106, + SPELL_TRANSFORMATION = 55098, + + // Mammoth + SPELL_DETERMINED_GORE = 55102, + SPELL_DETERMINED_GORE_H = 59444, + SPELL_QUAKE = 55101, + SPELL_NUMBING_ROAR = 55100, +}; + +/*###### +## boss_moorabi +######*/ + +struct MANGOS_DLL_DECL boss_moorabiAI : public ScriptedAI +{ + boss_moorabiAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + + uint32 m_uiStabTimer; // used for stab and gore + uint32 m_uiQuakeTimer; // used for quake and ground tremor + uint32 m_uiRoarTimer; // both roars on it + uint32 m_uiTransformationTimer; + uint32 m_uiPreviousTimer; + + bool m_bMammothPhase; + + void Reset() + { + m_bMammothPhase = false; + + m_uiStabTimer = 8000; + m_uiQuakeTimer = 1000; + m_uiRoarTimer = 7000; + m_uiTransformationTimer = 10000; + m_uiPreviousTimer = 10000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + DoCastSpellIfCan(m_creature, SPELL_MOJO_FRENZY); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOORABI, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOORABI, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->HasAura(SPELL_TRANSFORMATION) && !m_bMammothPhase) + { + DoScriptText(EMOTE_TRANSFORMED, m_creature); + m_bMammothPhase = true; + } + + if (m_uiRoarTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bMammothPhase ? SPELL_NUMBING_ROAR : SPELL_NUMBING_SHOUT); + m_uiRoarTimer = 20000; + } + else + m_uiRoarTimer -= uiDiff; + + if (m_uiQuakeTimer < uiDiff) + { + DoScriptText(SAY_QUAKE, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bMammothPhase ? SPELL_QUAKE : SPELL_GROUND_TREMOR); + m_uiQuakeTimer = m_bMammothPhase ? 13000 : 18000; + } + else + m_uiQuakeTimer -= uiDiff; + + if (m_uiStabTimer < uiDiff) + { + if (m_bMammothPhase) + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_DETERMINED_GORE : SPELL_DETERMINED_GORE_H); + else + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DETERMINED_STAB); + + m_uiStabTimer = 7000; + } + else + m_uiStabTimer -= uiDiff; + + // check only in troll phase + if (!m_bMammothPhase) + { + if (m_uiTransformationTimer < uiDiff) + { + DoScriptText(SAY_TRANSFORM, m_creature); + DoScriptText(EMOTE_TRANSFORM, m_creature); + DoCastSpellIfCan(m_creature, SPELL_TRANSFORMATION); + m_uiPreviousTimer *= 0.8; + m_uiTransformationTimer = m_uiPreviousTimer; + } + else + m_uiTransformationTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_moorabi(Creature* pCreature) +{ + return new boss_moorabiAI(pCreature); +} + +void AddSC_boss_moorabi() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_moorabi"; + newscript->GetAI = &GetAI_boss_moorabi; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/gundrak/boss_sladran.cpp b/scripts/northrend/gundrak/boss_sladran.cpp new file mode 100644 index 0000000..803b58f --- /dev/null +++ b/scripts/northrend/gundrak/boss_sladran.cpp @@ -0,0 +1,246 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sladran +SD%Complete: 75% +SDComment: +SDCategory: Gundrak +EndScriptData */ + +#include "precompiled.h" +#include "gundrak.h" + +enum +{ + SAY_AGGRO = -1604000, + SAY_SUMMON_SNAKE = -1604001, + SAY_SUMMON_CONSTRICTOR = -1604002, + SAY_SLAY_1 = -1604003, + SAY_SLAY_2 = -1604004, + SAY_SLAY_3 = -1604005, + SAY_DEATH = -1604006, + EMOTE_NOVA = -1604007, + + // Slad'Ran spells + SPELL_POISON_NOVA = 55081, + SPELL_POISON_NOVA_H = 59842, + SPELL_POWERFUL_BITE = 48287, + SPELL_POWERFUL_BITE_H = 59840, + SPELL_VENOM_BOLT = 54970, + SPELL_VENOM_BOLT_H = 59839, + + // Summon spells + SPELL_SUMMON_VIPER = 55060, + SPELL_SUMMON_CONSTRICTOR = 54969, + + SPELL_GRIP_OF_SLADRAN = 55093, + SPELL_GRIP_OF_SLADRAN_H = 61474, + + NPC_SLADRAN_CONSTRICTOR = 29713, + NPC_SLADRAN_VIPER = 29680, + NPC_SNAKE_WRAP = 29742, + NPC_SLADRAN_SUMMON_TARGET = 29682 +}; + +/*###### +## mob_sladran_summon_target +######*/ +struct MANGOS_DLL_DECL mob_sladran_summon_targetAI : public ScriptedAI +{ + mob_sladran_summon_targetAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() {} + void MoveInLineOfSight(Unit* pWho) {} + void AttackStart(Unit* pWho) {} + + void JustSummoned(Creature* pSummoned) + { + if (!m_pInstance) + return; + + if (Creature* pSladran = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_SLADRAN))) + { + float fPosX, fPosY, fPosZ; + pSladran->GetPosition(fPosX, fPosY, fPosZ); + pSummoned->GetMotionMaster()->MovePoint(0, fPosX, fPosY, fPosZ); + } + } + + void UpdateAI(const uint32 diff) {} +}; + +CreatureAI* GetAI_mob_sladran_summon_target(Creature* pCreature) +{ + return new mob_sladran_summon_targetAI(pCreature); +} + +/*###### +## boss_sladran +######*/ +struct MANGOS_DLL_DECL boss_sladranAI : public ScriptedAI +{ + boss_sladranAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiSummonTimer; + uint32 m_uiPoisonNovaTimer; + uint32 m_uiPowerfulBiteTimer; + uint32 m_uiVenomBoltTimer; + + void Reset() + { + m_uiSummonTimer = m_bIsRegularMode ? 5000 : 3000; + m_uiPoisonNovaTimer = 22000; + m_uiPowerfulBiteTimer = 10000; + m_uiVenomBoltTimer = 15000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SLADRAN, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SLADRAN, DONE); + } + + Creature* SelectRandomCreatureOfEntryInRange(uint32 uiEntry, float fRange) + { + std::list lCreatureList; + GetCreatureListWithEntryInGrid(lCreatureList, m_creature, uiEntry, fRange); + + if (lCreatureList.empty()) + return NULL; + + std::list::iterator iter = lCreatureList.begin(); + advance(iter, urand(0, lCreatureList.size()-1)); + + return *iter; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiPoisonNovaTimer < uiDiff) + { + DoScriptText(EMOTE_NOVA, m_creature); + DoCastSpellIfCan(m_creature->getVictim(),m_bIsRegularMode ? SPELL_POISON_NOVA : SPELL_POISON_NOVA_H); + m_uiPoisonNovaTimer = 22000; + } + else + m_uiPoisonNovaTimer -= uiDiff; + + if (m_uiSummonTimer < uiDiff) + { + if (Creature* pSummonTarget = SelectRandomCreatureOfEntryInRange(NPC_SLADRAN_SUMMON_TARGET, 75.0f)) + { + if (urand(0, 3)) + { + // we don't want to get spammed + if (!urand(0, 4)) + DoScriptText(SAY_SUMMON_CONSTRICTOR, m_creature); + + pSummonTarget->CastSpell(pSummonTarget, SPELL_SUMMON_CONSTRICTOR, false); + } + else + { + // we don't want to get spammed + if (!urand(0, 4)) + DoScriptText(SAY_SUMMON_SNAKE, m_creature); + + pSummonTarget->CastSpell(pSummonTarget, SPELL_SUMMON_VIPER, false); + } + } + + m_uiSummonTimer = m_bIsRegularMode ? 5000 : 3000; + } + else + m_uiSummonTimer -= uiDiff; + + if (m_uiPowerfulBiteTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_POWERFUL_BITE : SPELL_POWERFUL_BITE_H); + m_uiPowerfulBiteTimer = 10000; + } + else + m_uiPowerfulBiteTimer -= uiDiff; + + if (m_uiVenomBoltTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_VENOM_BOLT : SPELL_VENOM_BOLT_H); + + m_uiVenomBoltTimer = 15000; + } + else + m_uiVenomBoltTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_sladran(Creature* pCreature) +{ + return new boss_sladranAI(pCreature); +} + +void AddSC_boss_sladran() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_sladran"; + newscript->GetAI = &GetAI_boss_sladran; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_sladran_summon_target"; + newscript->GetAI = &GetAI_mob_sladran_summon_target; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/gundrak/gundrak.h b/scripts/northrend/gundrak/gundrak.h new file mode 100644 index 0000000..a54b0ba --- /dev/null +++ b/scripts/northrend/gundrak/gundrak.h @@ -0,0 +1,47 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_GUNDRAK_H +#define DEF_GUNDRAK_H +/* Encounters + * Slad'ran = 1 + * Drakkari Colossus = 2 + * Moorabi = 3 + * Gal'darah = 4 + * Eck the Ferocious = 5 +*/ +enum +{ + MAX_ENCOUNTER = 5, + + TYPE_SLADRAN = 1, + TYPE_COLOSSUS = 2, + TYPE_MOORABI = 3, + TYPE_GALDARAH = 4, + TYPE_ECK = 5, + + NPC_SLADRAN = 29304, + NPC_MOORABI = 29307, + NPC_COLOSSUS = 29305, + NPC_GALDARAH = 29306, + NPC_ECK = 29932, + + GO_ECK_DOOR = 192632, + GO_ECK_UNDERWATER_DOOR = 192569, + GO_GALDARAH_DOOR = 192568, + GO_EXIT_DOOR_L = 193208, + GO_EXIT_DOOR_R = 193209, + + GO_ALTAR_OF_SLADRAN = 192518, + GO_ALTAR_OF_MOORABI = 192519, + GO_ALTAR_OF_COLOSSUS = 192520, + + GO_SNAKE_KEY = 192564, + GO_TROLL_KEY = 192567, + GO_MAMMOTH_KEY = 192565, + + GO_BRIDGE = 193188 +}; + +#endif diff --git a/scripts/northrend/gundrak/instance_gundrak.cpp b/scripts/northrend/gundrak/instance_gundrak.cpp new file mode 100644 index 0000000..d027553 --- /dev/null +++ b/scripts/northrend/gundrak/instance_gundrak.cpp @@ -0,0 +1,333 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_gundrak +SD%Complete: 0 +SDComment: +SDCategory: Gundrak +EndScriptData */ + +#include "precompiled.h" +#include "gundrak.h" + +#define NPC_BRIDGE_GUARD 105002 +#define BRIDGE_GUARD_X 1751.449951f +#define BRIDGE_GUARD_Y 740.658020f +#define BRIDGE_GUARD_Z 118.949997f +#define BRIDGE_GUARD_O 2.434944f + +bool GOHello_go_gundrak_altar(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + switch(pGo->GetEntry()) + { + case GO_ALTAR_OF_SLADRAN: pInstance->SetData(TYPE_SLADRAN, SPECIAL); break; + case GO_ALTAR_OF_MOORABI: pInstance->SetData(TYPE_MOORABI, SPECIAL); break; + case GO_ALTAR_OF_COLOSSUS: pInstance->SetData(TYPE_COLOSSUS, SPECIAL); break; + } + + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + return true; +} + +struct MANGOS_DLL_DECL instance_gundrak : public ScriptedInstance +{ + instance_gundrak(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + bool guardSpawnt; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + int bridgeCounter; + + uint64 m_uiEckDoorGUID; + uint64 m_uiEckUnderwaterDoorGUID; + uint64 m_uiGaldarahDoorGUID; + uint64 m_uiExitDoorLeftGUID; + uint64 m_uiExitDoorRightGUID; + uint64 m_uiSnakeKeyGUID; + uint64 m_uiMammothKeyGUID; + uint64 m_uiTrollKeyGUID; + uint64 m_uiAltarOfSladranGUID; + uint64 m_uiAltarOfMoorabiGUID; + uint64 m_uiAltarOfColossusGUID; + uint64 m_uiBridgeGUID; + + uint64 m_uiSladranGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + guardSpawnt = false; + + m_uiEckDoorGUID = 0; + m_uiEckUnderwaterDoorGUID = 0; + m_uiGaldarahDoorGUID = 0; + m_uiExitDoorLeftGUID = 0; + m_uiExitDoorRightGUID = 0; + m_uiAltarOfSladranGUID = 0; + m_uiAltarOfMoorabiGUID = 0; + m_uiAltarOfColossusGUID = 0; + m_uiSnakeKeyGUID = 0; + m_uiTrollKeyGUID = 0; + m_uiMammothKeyGUID = 0; + m_uiBridgeGUID = 0; + + bridgeCounter = 0; + + m_uiSladranGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_SLADRAN: m_uiSladranGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_ECK_DOOR: + m_uiEckDoorGUID = pGo->GetGUID(); + if ((m_auiEncounter[1] == DONE) && !instance->IsRegularDifficulty()) + DoUseDoorOrButton(m_uiEckDoorGUID); + break; + case GO_ECK_UNDERWATER_DOOR: + m_uiEckUnderwaterDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + DoUseDoorOrButton(m_uiEckUnderwaterDoorGUID); + break; + case GO_GALDARAH_DOOR: + m_uiGaldarahDoorGUID = pGo->GetGUID(); + DoUseDoorOrButton(m_uiGaldarahDoorGUID); + break; + case GO_EXIT_DOOR_L: + m_uiExitDoorLeftGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + DoUseDoorOrButton(m_uiExitDoorLeftGUID); + break; + case GO_EXIT_DOOR_R: + m_uiExitDoorRightGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + DoUseDoorOrButton(m_uiExitDoorRightGUID); + break; + case GO_ALTAR_OF_SLADRAN: + m_uiAltarOfSladranGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_ALTAR_OF_MOORABI: + m_uiAltarOfMoorabiGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_ALTAR_OF_COLOSSUS: + m_uiAltarOfColossusGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_SNAKE_KEY: + m_uiSnakeKeyGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == SPECIAL) + DoUseDoorOrButton(m_uiSnakeKeyGUID); + break; + case GO_TROLL_KEY: + m_uiTrollKeyGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == SPECIAL) + DoUseDoorOrButton(m_uiTrollKeyGUID); + break; + case GO_MAMMOTH_KEY: + m_uiMammothKeyGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == SPECIAL) + DoUseDoorOrButton(m_uiMammothKeyGUID); + break; + case GO_BRIDGE: + m_uiBridgeGUID = pGo->GetGUID(); + break; + } + + + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Gundrak: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_SLADRAN: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + if (GameObject* pGo = instance->GetGameObject(m_uiAltarOfSladranGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + if (uiData == SPECIAL) + { + DoUseDoorOrButton(m_uiSnakeKeyGUID); + bridgeCounter++; + } + break; + case TYPE_MOORABI: + m_auiEncounter[1] = uiData; + if (uiData == DONE) + { + if (!instance->IsRegularDifficulty()) + DoUseDoorOrButton(m_uiEckDoorGUID); + if (GameObject* pGo = instance->GetGameObject(m_uiAltarOfMoorabiGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + if (uiData == SPECIAL) + { + DoUseDoorOrButton(m_uiMammothKeyGUID); + bridgeCounter++; + } + break; + case TYPE_COLOSSUS: + m_auiEncounter[2] = uiData; + if (uiData == DONE) + if (GameObject* pGo = instance->GetGameObject(m_uiAltarOfColossusGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + if (uiData == SPECIAL) + { + DoUseDoorOrButton(m_uiTrollKeyGUID); + bridgeCounter++; + } + break; + case TYPE_GALDARAH: + m_auiEncounter[3] = uiData; + DoUseDoorOrButton(m_uiGaldarahDoorGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiExitDoorLeftGUID); + DoUseDoorOrButton(m_uiExitDoorRightGUID); + } + break; + case TYPE_ECK: + m_auiEncounter[4] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiEckUnderwaterDoorGUID); + break; + default: + error_log("SD2: Instance Gundrak: ERROR SetData = %u for type %u does not exist/not implemented.",uiType,uiData); + break; + } + + if (bridgeCounter == 3 && !guardSpawnt) + { + if (GameObject* pGo = instance->GetGameObject(m_uiAltarOfColossusGUID)) + pGo->SummonCreature(NPC_BRIDGE_GUARD, BRIDGE_GUARD_X, BRIDGE_GUARD_Y, BRIDGE_GUARD_Z, BRIDGE_GUARD_O, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 2000); + guardSpawnt = true; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " + << m_auiEncounter[4]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_SLADRAN: + return m_auiEncounter[0]; + case TYPE_MOORABI: + return m_auiEncounter[1]; + case TYPE_COLOSSUS: + return m_auiEncounter[2]; + case TYPE_GALDARAH: + return m_auiEncounter[3]; + case TYPE_ECK: + return m_auiEncounter[4]; + } + return 0; + } + + uint64 GetData64(uint32 uiType) + { + switch(uiType) + { + case NPC_SLADRAN: + return m_uiSladranGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_gundrak(Map* pMap) +{ + return new instance_gundrak(pMap); +} + +void AddSC_instance_gundrak() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "go_gundrak_altar"; + newscript->pGOHello = &GOHello_go_gundrak_altar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "instance_gundrak"; + newscript->GetInstanceData = &GetInstanceData_instance_gundrak; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/howling_fjord.cpp b/scripts/northrend/howling_fjord.cpp new file mode 100644 index 0000000..82c9eaf --- /dev/null +++ b/scripts/northrend/howling_fjord.cpp @@ -0,0 +1,196 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Howling_Fjord +SD%Complete: ? +SDComment: Quest support: 11221, 11483 +SDCategory: Howling Fjord +EndScriptData */ + +#include "precompiled.h" + +/*####################### +## Deathstalker Razael ## +#######################*/ + +#define GOSSIP_ITEM_DEATHSTALKER_RAZAEL "High Executor Anselm requests your report." + +enum +{ + QUEST_REPORTS_FROM_THE_FIELD = 11221, + SPELL_RAZAEL_KILL_CREDIT = 42756, + GOSSIP_TEXTID_DEATHSTALKER_RAZAEL1 = 11562, + GOSSIP_TEXTID_DEATHSTALKER_RAZAEL2 = 11564 +}; + +bool GossipHello_npc_deathstalker_razael(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_REPORTS_FROM_THE_FIELD) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DEATHSTALKER_RAZAEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEATHSTALKER_RAZAEL1, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_deathstalker_razael(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEATHSTALKER_RAZAEL2, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_RAZAEL_KILL_CREDIT, true); + break; + } + + return true; +} + +/*##################### +## Dark Ranger Lyana ## +#####################*/ + +#define GOSSIP_ITEM_DARK_RANGER_LYANA "High Executor Anselm requests your report." + +enum +{ + GOSSIP_TEXTID_DARK_RANGER_LYANA1 = 11586, + GOSSIP_TEXTID_DARK_RANGER_LYANA2 = 11588, + SPELL_DARK_RANGER_LYANA_KILL_CREDIT = 42799 +}; + +bool GossipHello_npc_dark_ranger_lyana(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_REPORTS_FROM_THE_FIELD) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_DARK_RANGER_LYANA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DARK_RANGER_LYANA1, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_dark_ranger_lyana(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DARK_RANGER_LYANA2, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_DARK_RANGER_LYANA_KILL_CREDIT, true); + break; + } + + return true; +} + +/*############ +## McGoyver ## +############*/ + +#define GOSSIP_ITEM_MCGOYVER1 "Walt sent me to pick up some dark iron ingots." +#define GOSSIP_ITEM_MCGOYVER2 "Yarp." + +enum +{ + QUEST_WE_CAN_REBUILD_IT = 11483, + GOSSIP_TEXTID_MCGOYVER = 12193, + ITEM_DARK_IRON_INGOTS = 34135, + SPELL_MCGOYVER_TAXI_EXPLORERSLEAGUE = 44280, + SPELL_MCGOYVER_CREATE_DARK_IRON_INGOTS = 44512 +}; + +bool GossipHello_npc_mcgoyver(Player* pPlayer, Creature* pCreature) +{ + switch(pPlayer->GetQuestStatus(QUEST_WE_CAN_REBUILD_IT)) + { + case QUEST_STATUS_INCOMPLETE: + if (!pPlayer->HasItemCount(ITEM_DARK_IRON_INGOTS, 1, true)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MCGOYVER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + else + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MCGOYVER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_MCGOYVER, pCreature->GetGUID()); + } + break; + case QUEST_STATUS_COMPLETE: + if (!pPlayer->GetQuestRewardStatus(QUEST_WE_CAN_REBUILD_IT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MCGOYVER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_MCGOYVER, pCreature->GetGUID()); + break; + } + default: + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + + return true; +} + +bool GossipSelect_npc_mcgoyver(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pCreature->CastSpell(pPlayer, SPELL_MCGOYVER_CREATE_DARK_IRON_INGOTS, true); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_MCGOYVER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_MCGOYVER, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_MCGOYVER_TAXI_EXPLORERSLEAGUE, true); + break; + } + + return true; +} + +void AddSC_howling_fjord() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_deathstalker_razael"; + newscript->pGossipHello = &GossipHello_npc_deathstalker_razael; + newscript->pGossipSelect = &GossipSelect_npc_deathstalker_razael; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dark_ranger_lyana"; + newscript->pGossipHello = &GossipHello_npc_dark_ranger_lyana; + newscript->pGossipSelect = &GossipSelect_npc_dark_ranger_lyana; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mcgoyver"; + newscript->pGossipHello = &GossipHello_npc_mcgoyver; + newscript->pGossipSelect = &GossipSelect_npc_mcgoyver; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/icecrown.cpp b/scripts/northrend/icecrown.cpp new file mode 100644 index 0000000..412b1cd --- /dev/null +++ b/scripts/northrend/icecrown.cpp @@ -0,0 +1,149 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Icecrown +SD%Complete: 100 +SDComment: Quest support: 12807, Vendor support: 34885 +SDCategory: Icecrown +EndScriptData */ + +/* ContentData +npc_arete +npc_dame_evniki_kapsalis +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_arete +######*/ + +#define GOSSIP_ARETE_ITEM1 "Lord-Commander, I would hear your tale." +#define GOSSIP_ARETE_ITEM2 "" +#define GOSSIP_ARETE_ITEM3 "I thought that they now called themselves the Scarlet Onslaught?" +#define GOSSIP_ARETE_ITEM4 "Where did the grand admiral go?" +#define GOSSIP_ARETE_ITEM5 "That's fine. When do I start?" +#define GOSSIP_ARETE_ITEM6 "Let's finish this!" +#define GOSSIP_ARETE_ITEM7 "That's quite a tale, Lord-Commander." + +enum +{ + GOSSIP_TEXTID_ARETE1 = 13525, + GOSSIP_TEXTID_ARETE2 = 13526, + GOSSIP_TEXTID_ARETE3 = 13527, + GOSSIP_TEXTID_ARETE4 = 13528, + GOSSIP_TEXTID_ARETE5 = 13529, + GOSSIP_TEXTID_ARETE6 = 13530, + GOSSIP_TEXTID_ARETE7 = 13531, + + QUEST_THE_STORY_THUS_FAR = 12807 +}; + +bool GossipHello_npc_arete(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_THE_STORY_THUS_FAR) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE1, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_arete(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE5, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE6, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARETE_ITEM7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ARETE7, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_THE_STORY_THUS_FAR); + break; + } + + return true; +} + +/*###### +## npc_dame_evniki_kapsalis +######*/ + +enum +{ + TITLE_CRUSADER = 123 +}; + +bool GossipHello_npc_dame_evniki_kapsalis(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->HasTitle(TITLE_CRUSADER)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_dame_evniki_kapsalis(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + +void AddSC_icecrown() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_arete"; + newscript->pGossipHello = &GossipHello_npc_arete; + newscript->pGossipSelect = &GossipSelect_npc_arete; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dame_evniki_kapsalis"; + newscript->pGossipHello = &GossipHello_npc_dame_evniki_kapsalis; + newscript->pGossipSelect = &GossipSelect_npc_dame_evniki_kapsalis; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_bronjahm.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_bronjahm.cpp new file mode 100644 index 0000000..3a002cb --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_bronjahm.cpp @@ -0,0 +1,98 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_bronjahm +SD%Complete: 0% +SDComment: Placeholder +SDCategory: The Forge of Souls +EndScriptData */ + +#include "precompiled.h" +#include "forge_of_souls.h" + +enum +{ + SAY_AGGRO_1 = -1632000, // without sound, really correct? + SAY_AGGRO_2 = -1632001, + SAY_SLAY_1 = -1632002, + SAY_SLAY_2 = -1632003, + SAY_DEATH = -1632004, + SAY_SOULSTORM = -1632005, + SAY_CORRUPT_SOUL = -1632006, +}; + +struct MANGOS_DLL_DECL boss_bronjahmAI : public ScriptedAI +{ + boss_bronjahmAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_forge_of_souls*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_forge_of_souls* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(urand(0, 1) ? SAY_AGGRO_1 : SAY_AGGRO_2, m_creature); + if (m_pInstance) + m_pInstance->SetData(TYPE_BRONJAHM, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + if (urand(0, 1)) + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BRONJAHM, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BRONJAHM, NOT_STARTED); + } +}; + +CreatureAI* GetAI_boss_bronjahm(Creature* pCreature) +{ + return new boss_bronjahmAI(pCreature); +} + +void AddSC_boss_bronjahm() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_bronjahm"; + pNewScript->GetAI = &GetAI_boss_bronjahm; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp new file mode 100644 index 0000000..4ad33e8 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/boss_devourer_of_souls.cpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_devourer_of_souls +SD%Complete: 0% +SDComment: Placeholder +SDCategory: The Forge of Souls +EndScriptData */ + +#include "precompiled.h" +#include "forge_of_souls.h" + +enum +{ + // TODO, how to change the face on random?, how to know which face is shown, to use the additional entries + SAY_MALE_1_AGGRO = -1632007, + SAY_FEMALE_AGGRO = -1632008, + SAY_MALE_1_SLAY_1 = -1632009, + SAY_FEMALE_SLAY_1 = -1632010, + SAY_MALE_2_SLAY_1 = -1632011, + SAY_MALE_1_SLAY_2 = -1632012, + SAY_FEMALE_SLAY_2 = -1632013, + SAY_MALE_2_SLAY_2 = -1632014, + SAY_MALE_1_DEATH = -1632015, + SAY_FEMALE_DEATH = -1632016, + SAY_MALE_2_DEATH = -1632017, + SAY_MALE_1_SOUL_ATTACK = -1632018, + SAY_FEMALE_SOUL_ATTACK = -1632019, + SAY_MALE_2_SOUL_ATTACK = -1632020, + SAY_MALE_1_DARK_GLARE = -1632021, + SAY_FEMALE_DARK_GLARE = -1632022, + + EMOTE_MIRRORED_SOUL = -1632023, + EMOTE_UNLEASH_SOULS = -1632024, + EMOTE_WAILING_SOULS = -1632025, + + FACE_NORMAL = 0, + FACE_UNLEASHING = 1, + FACE_WAILING = 2, +}; + +static const int aTexts[6][3] = +{ + {SAY_MALE_1_AGGRO, SAY_FEMALE_AGGRO, 0}, // 0 - aggro + {SAY_MALE_1_SLAY_1, SAY_FEMALE_SLAY_1, SAY_MALE_2_SLAY_1}, // 1 - slay1 + {SAY_MALE_1_SLAY_2, SAY_FEMALE_SLAY_2, SAY_MALE_2_SLAY_2}, // 2 - slay2 + {SAY_MALE_1_DEATH, SAY_FEMALE_DEATH, SAY_MALE_2_DEATH}, // 3 - death + {SAY_MALE_1_SOUL_ATTACK, SAY_FEMALE_SOUL_ATTACK, SAY_MALE_2_SOUL_ATTACK}, // 4 - soul + {SAY_MALE_1_DARK_GLARE, SAY_FEMALE_DARK_GLARE, 0} // 5 - glare +}; + +struct MANGOS_DLL_DECL boss_devourer_of_soulsAI : public ScriptedAI +{ + boss_devourer_of_soulsAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_forge_of_souls*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_forge_of_souls* m_pInstance; + uint8 m_uiFace; + bool m_bIsRegularMode; + + void Reset() + { + m_uiFace = FACE_NORMAL; + } + + void Aggro(Unit* pWho) + { + DoScriptText(aTexts[0][m_uiFace], m_creature); + if (m_pInstance) + m_pInstance->SetData(TYPE_DECOURER_OF_SOULS, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + if (urand(0, 1)) + DoScriptText(aTexts[urand(1, 2)][m_uiFace], m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(aTexts[3][m_uiFace], m_creature); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_DECOURER_OF_SOULS, DONE); + } + } + + void JustReachedHome() + { + if (m_pInstance) + { + m_pInstance->SetData(NPC_DEVOURER_OF_SOULS, NOT_STARTED); + // If we previously failed, set such that possible to try again + m_pInstance->SetData(TYPE_ACHIEV_PHANTOM_BLAST, IN_PROGRESS); + } + } +}; + +CreatureAI* GetAI_boss_devourer_of_souls(Creature* pCreature) +{ + return new boss_devourer_of_soulsAI(pCreature); +} + +void AddSC_boss_devourer_of_souls() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_devourer_of_souls"; + pNewScript->GetAI = &GetAI_boss_devourer_of_souls; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.h b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.h new file mode 100644 index 0000000..d62c46e --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/forge_of_souls.h @@ -0,0 +1,129 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_FORGE_OF_SOULS_H +#define DEF_FORGE_OF_SOULS_H + +enum +{ + MAX_ENCOUNTER = 2, + TYPE_BRONJAHM = 1, + TYPE_DECOURER_OF_SOULS = 2, + TYPE_ACHIEV_PHANTOM_BLAST = 3, + + DATA_SOULFRAGMENT_REMOVE = 4, // on Death and on Use + + NPC_BRONJAHM = 36497, + NPC_DEVOURER_OF_SOULS = 36502, + NPC_CORRUPTED_SOUL_FRAGMENT = 36535, + + // Event NPCs + NPC_SILVANA_BEGIN = 37596, + NPC_SILVANA_END = 38161, + NPC_JAINA_BEGIN = 37597, + NPC_JAINA_END = 38160, + NPC_ARCHMAGE_ELANDRA = 37774, + NPC_ARCHMAGE_KORELN = 37582, + NPC_DARK_RANGER_KALIRA = 37583, + NPC_DARK_RANGER_LORALEN = 37779, + NPC_COLISEUM_CHAMPION_A_P = 37498, // Alliance Paladin + NPC_COLISEUM_CHAMPION_A_F = 37496, // Alliance Footman + NPC_COLISEUM_CHAMPION_A_M = 37497, // Alliance Mage + NPC_COLISEUM_CHAMPION_H_F = 37584, // Horde Footman + NPC_COLISEUM_CHAMPION_H_T = 37587, // Horde Taure + NPC_COLISEUM_CHAMPION_H_M = 37588, // Horde Mage + + ACHIEV_CRIT_SOUL_POWER = 12752, + ACHIEV_CRIT_PHANTOM_BLAST = 12976, +}; + +struct sIntoEventNpcSpawnLocations +{ + uint32 uiEntryHorde, uiEntryAlliance; + float fSpawnX, fSpawnY, fSpawnZ, fSpawnO; +}; + +/* Still TODO +** We have 12 npc-entries to do moving, and often different waypoints for one entry +** Best way to handle the paths of these mobs is still open +*/ + +struct sExtroEventNpcLocations +{ + uint32 uiEntryHorde, uiEntryAlliance; + float fStartO, fEndO; // Orientation for Spawning + float fSpawnX, fSpawnY, fSpawnZ; + float fEndX, fEndY, fEndZ; +}; + +// TODO: verify Horde - Entries +const sIntoEventNpcSpawnLocations aEventBeginLocations[3] = +{ + {NPC_SILVANA_BEGIN, NPC_JAINA_BEGIN, 4901.25439f, 2206.861f, 638.8166f, 5.88175964f}, + {NPC_DARK_RANGER_KALIRA, NPC_ARCHMAGE_ELANDRA, 4899.709961f, 2205.899902f, 638.817017f, 5.864306f}, + {NPC_DARK_RANGER_LORALEN, NPC_ARCHMAGE_KORELN, 4903.160156f, 2213.090088f, 638.817017f, 0.1745329f} +}; + +const sExtroEventNpcLocations aEventEndLocations[18] = +{ + // Horde Entry Ally Entry O_Spawn O_End SpawnPos EndPos + {NPC_SILVANA_END, NPC_JAINA_END, 0.8901179f, 0.890118f, 5606.34033f, 2436.32129f, 705.9351f, 5638.404f, 2477.154f, 708.6932f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 0.9773844f, 1.780236f, 5593.632f, 2428.57983f, 705.9351f, 5695.879f, 2522.944f, 714.6915f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 1.1519173f, 1.78023f, 5594.079f, 2425.111f, 705.9351f, 5692.123f, 2522.613f, 714.6915f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 0.6108652f, 0.296706f, 5597.932f, 2421.78125f, 705.9351f, 5669.314f, 2540.029f, 714.6915f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 1.0471975f, 5.358161f, 5598.03564f, 2429.37671f, 705.9351f, 5639.267f, 2520.912f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 0.8901179f, 0.112373f, 5600.836f, 2421.35938f, 705.9351f, 5668.145f, 2543.854f, 714.6915f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 0.8901179f, 5.358161f, 5600.848f, 2429.54517f, 705.9351f, 5639.961f, 2522.936f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 0.8901179f, 5.347504f, 5601.46533f, 2426.77075f, 705.9351f, 5643.156f, 2525.342f, 708.6958f}, + {NPC_COLISEUM_CHAMPION_H_F, NPC_COLISEUM_CHAMPION_A_F, 1.1519173f, 0.232039f, 5601.587f, 2418.60425f, 705.9351f, 5670.483f, 2536.204f, 714.6915f}, + {NPC_DARK_RANGER_LORALEN, NPC_ARCHMAGE_KORELN, 0.7853982f, 3.717551f, 5606.35059f, 2432.88013f, 705.9351f, 5688.9f, 2538.981f, 714.6915f}, + {NPC_DARK_RANGER_KALIRA, NPC_ARCHMAGE_ELANDRA, 0.9599311f, 4.694936f, 5602.80371f, 2435.66846f, 705.9351f, 5685.069f, 2541.771f, 714.6915f}, + {NPC_COLISEUM_CHAMPION_H_T, NPC_COLISEUM_CHAMPION_A_P, 0.8552113f, 1.958489f, 5589.8125f, 2421.27075f, 705.9351f, 5669.351f, 2472.626f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_T, NPC_COLISEUM_CHAMPION_A_P, 0.8552113f, 2.111848f, 5592.2666f, 2419.37842f, 705.9351f, 5665.927f, 2470.574f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_T, NPC_COLISEUM_CHAMPION_A_P, 0.9075712f, 2.196496f, 5594.64746f, 2417.10767f, 705.9351f, 5662.503f, 2468.522f, 708.6958f}, + {NPC_COLISEUM_CHAMPION_H_M, NPC_COLISEUM_CHAMPION_A_M, 1.0646508f, 0.837758f, 5585.49854f, 2418.22925f, 705.9351f, 5624.832f, 2473.713f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_M, NPC_COLISEUM_CHAMPION_A_M, 0.9424777f, 0.837758f, 5586.80029f, 2416.97388f, 705.9351f, 5627.443f, 2472.236f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_M, NPC_COLISEUM_CHAMPION_A_M, 0.9250245f, 0.977384f, 5591.653f, 2412.89771f, 705.9351f, 5637.912f, 2465.69f, 708.6959f}, + {NPC_COLISEUM_CHAMPION_H_M, NPC_COLISEUM_CHAMPION_A_M, 0.8726646f, 0.977384f, 5593.93652f, 2410.875f, 705.9351f, 5642.629f, 2474.331f, 708.6959f} +}; + +class MANGOS_DLL_DECL instance_forge_of_souls : public ScriptedInstance +{ + public: + instance_forge_of_souls(Map* pMap); + ~instance_forge_of_souls() {} + + void Initialize(); + + void OnCreatureCreate(Creature* pCreature); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + void SetData64(uint32 uiType, uint64 uiData); + + Player* GetPlayer(); + void OnPlayerEnter(Player* pPlayer); + void ProcessEventNpcs(Player* pPlayer, bool bChanged); + bool CheckAchievementCriteriaMeet(uint32 uiCriteriaId, Player const* pSource, Unit const* pTarget, uint32 uiMiscValue1 /* = 0*/); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + bool m_bCriteriaPhantomBlastFailed; + + uint32 m_uiTeam; // Team of first entered player, used to set if Jaina or Silvana to spawn + + uint64 m_uiBronjahmGUID; + uint64 m_uiDevourerOrSoulsGUID; + + std::list m_luiSoulFragmentAliveGUIDs; + std::list m_lEventMobGUIDs; +}; + +#endif diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp new file mode 100644 index 0000000..c600db6 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp @@ -0,0 +1,239 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_forge_of_souls +SD%Complete: 90% +SDComment: TODO: Movement of the extro-event is missing, implementation unclear! +SDCategory: The Forge of Souls +EndScriptData */ + +#include "precompiled.h" +#include "forge_of_souls.h" + +instance_forge_of_souls::instance_forge_of_souls(Map* pMap) : ScriptedInstance(pMap), + m_bCriteriaPhantomBlastFailed(false), + m_uiTeam(0), + m_uiBronjahmGUID(0), + m_uiDevourerOrSoulsGUID(0) +{ + Initialize(); +} + +void instance_forge_of_souls::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); +} + +void instance_forge_of_souls::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_BRONJAHM: m_uiBronjahmGUID = pCreature->GetGUID(); break; + case NPC_DEVOURER_OF_SOULS: m_uiDevourerOrSoulsGUID = pCreature->GetGUID(); break; + case NPC_CORRUPTED_SOUL_FRAGMENT: m_luiSoulFragmentAliveGUIDs.push_back(pCreature->GetGUID()); break; + } +} + +void instance_forge_of_souls::OnPlayerEnter(Player* pPlayer) +{ + if (!m_uiTeam) // very first player to enter + { + m_uiTeam = pPlayer->GetTeam(); + ProcessEventNpcs(pPlayer, false); + } +} + +void instance_forge_of_souls::ProcessEventNpcs(Player* pPlayer, bool bChanged) +{ + if (!pPlayer) + return; + + if (m_auiEncounter[0] != DONE || m_auiEncounter[1] != DONE) + { + // Spawn Begin Mobs + for (uint8 i = 0; i < sizeof(aEventBeginLocations)/sizeof(sIntoEventNpcSpawnLocations); i++) + { + if (Creature* pSummon = pPlayer->SummonCreature(m_uiTeam == HORDE ? aEventBeginLocations[i].uiEntryHorde : aEventBeginLocations[i].uiEntryAlliance, + aEventBeginLocations[i].fSpawnX, aEventBeginLocations[i].fSpawnY, aEventBeginLocations[i].fSpawnZ, aEventBeginLocations[i].fSpawnO, TEMPSUMMON_DEAD_DESPAWN, 24*HOUR*IN_MILLISECONDS)) + m_lEventMobGUIDs.push_back(pSummon->GetGUID()); + } + } + else + { + // if bChanged, despawn Begin Mobs, spawn End Mobs at Spawn, else spawn EndMobs at End + if (bChanged) + { + for (std::list::const_iterator itr = m_lEventMobGUIDs.begin(); itr != m_lEventMobGUIDs.end(); itr++) + { + if (Creature* pSummoned = instance->GetCreature(*itr)) + pSummoned->ForcedDespawn(); + } + + for (uint8 i = 0; i < sizeof(aEventEndLocations)/sizeof(sExtroEventNpcLocations); i++) + { + pPlayer->SummonCreature(m_uiTeam == HORDE ? aEventEndLocations[i].uiEntryHorde : aEventEndLocations[i].uiEntryAlliance, + aEventEndLocations[i].fSpawnX, aEventEndLocations[i].fSpawnY, aEventEndLocations[i].fSpawnZ, aEventEndLocations[i].fStartO, TEMPSUMMON_DEAD_DESPAWN, 24*HOUR*IN_MILLISECONDS); + + // TODO: Let the NPCs Move along their paths + } + } + else + { // Summon at end, without event + for (uint8 i = 0; i < sizeof(aEventEndLocations)/sizeof(sExtroEventNpcLocations); i++) + { + pPlayer->SummonCreature(m_uiTeam == HORDE ? aEventEndLocations[i].uiEntryHorde : aEventEndLocations[i].uiEntryAlliance, + aEventEndLocations[i].fEndX, aEventEndLocations[i].fEndY, aEventEndLocations[i].fEndZ, aEventEndLocations[i].fEndO, TEMPSUMMON_DEAD_DESPAWN, 24*HOUR*IN_MILLISECONDS); + } + } + } +} + +Player* instance_forge_of_souls::GetPlayer() +{ + 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; + } + } + return NULL; +} + +bool instance_forge_of_souls::CheckAchievementCriteriaMeet(uint32 uiCriteriaId, Player const* pSource, Unit const* pTarget, uint32 uiMiscValue1 /* = 0*/) +{ + switch (uiCriteriaId) + { + case ACHIEV_CRIT_SOUL_POWER: + return m_luiSoulFragmentAliveGUIDs.size() >= 4; + case ACHIEV_CRIT_PHANTOM_BLAST: + return !m_bCriteriaPhantomBlastFailed; + default: + return 0; + } +} + +void instance_forge_of_souls::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_BRONJAHM: + m_auiEncounter[0] = uiData; + + // Despawn remaining adds and clear list + for (std::list::const_iterator itr = m_luiSoulFragmentAliveGUIDs.begin(); itr != m_luiSoulFragmentAliveGUIDs.end(); itr++) + { + if (Creature* pFragment = instance->GetCreature(*itr)) + pFragment->ForcedDespawn(); + } + m_luiSoulFragmentAliveGUIDs.clear(); + break; + case TYPE_DECOURER_OF_SOULS: + m_auiEncounter[1] = uiData; + if (uiData == DONE) + ProcessEventNpcs(GetPlayer(), true); + break; + case TYPE_ACHIEV_PHANTOM_BLAST: + m_bCriteriaPhantomBlastFailed = (uiData == FAIL); + return; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_forge_of_souls::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_forge_of_souls::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_BRONJAHM: + return m_auiEncounter[0]; + case TYPE_DECOURER_OF_SOULS: + return m_auiEncounter[1]; + default: + return 0; + } +} + +uint64 instance_forge_of_souls::GetData64(uint32 uiData) +{ + switch(uiData) + { + case NPC_BRONJAHM: + return m_uiBronjahmGUID; + case NPC_DEVOURER_OF_SOULS: + return m_uiDevourerOrSoulsGUID; + default: + return 0; + } +} + +void instance_forge_of_souls::SetData64(uint32 uiType, uint64 uiData) +{ + if (uiType == DATA_SOULFRAGMENT_REMOVE) + m_luiSoulFragmentAliveGUIDs.remove(uiData); +} + +InstanceData* GetInstanceData_instance_forge_of_souls(Map* pMap) +{ + return new instance_forge_of_souls(pMap); +} + +void AddSC_instance_forge_of_souls() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_forge_of_souls"; + pNewScript->GetInstanceData = &GetInstanceData_instance_forge_of_souls; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falryn.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falryn.cpp new file mode 100644 index 0000000..498053e --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_falryn.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_falryn +SD%Complete: 0% +SDComment: +SDCategory: Halls of Reflection +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp new file mode 100644 index 0000000..0ed1ec9 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_lich_king.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_lich_king +SD%Complete: 0% +SDComment: +SDCategory: Halls of Reflection +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp new file mode 100644 index 0000000..b8b5e84 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/halls_of_reflection/boss_marwyn.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_marwyn +SD%Complete: 0% +SDComment: +SDCategory: Halls of Reflection +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_forgemaster_gafrost.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_forgemaster_gafrost.cpp new file mode 100644 index 0000000..d0adf97 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_forgemaster_gafrost.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_forgemaster_gafrost +SD%Complete: 0% +SDComment: +SDCategory: Pit of Saron +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_krick_and_ick.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_krick_and_ick.cpp new file mode 100644 index 0000000..c2d93f3 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_krick_and_ick.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_krick_and_ick +SD%Complete: 0% +SDComment: +SDCategory: Pit of Saron +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp b/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp new file mode 100644 index 0000000..dfac29e --- /dev/null +++ b/scripts/northrend/icecrown_citadel/frozen_halls/pit_of_saron/boss_scourgelord_tyrannus.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_scourgelord_tyrannus +SD%Complete: 0% +SDComment: +SDCategory: Pit of Saron +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp new file mode 100644 index 0000000..b2f817b --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/blood_prince_council.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: blood_prince_council +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp new file mode 100644 index 0000000..ce11b79 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_blood_queen_lanathel.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_blood_queen_lanathel +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_deathbringer_saurfang.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_deathbringer_saurfang.cpp new file mode 100644 index 0000000..2ebf1be --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_deathbringer_saurfang.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_deathbringer_saurfang +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_festergut.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_festergut.cpp new file mode 100644 index 0000000..1156afd --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_festergut.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_festergut +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lady_deathwhisper.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lady_deathwhisper.cpp new file mode 100644 index 0000000..8df083c --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lady_deathwhisper.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_lady_deathwhisper +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp new file mode 100644 index 0000000..1bd579d --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_lord_marrowgar.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_lord_marrowgar +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp new file mode 100644 index 0000000..21a1cb9 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_professor_putricide.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_professor_putricide +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp new file mode 100644 index 0000000..12939b8 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_rotface.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_rotface +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp new file mode 100644 index 0000000..9aa17a3 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_sindragosa.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_sindragosa +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp new file mode 100644 index 0000000..d51e2e5 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_the_lich_king.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_the_lich_king +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_valithria_dreamwalker.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_valithria_dreamwalker.cpp new file mode 100644 index 0000000..5adb40e --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/boss_valithria_dreamwalker.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_valithria +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/icecrown_citadel/icecrown_citadel/gunship_battle.cpp b/scripts/northrend/icecrown_citadel/icecrown_citadel/gunship_battle.cpp new file mode 100644 index 0000000..39d9f43 --- /dev/null +++ b/scripts/northrend/icecrown_citadel/icecrown_citadel/gunship_battle.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: gunship_battle +SD%Complete: 0% +SDComment: +SDCategory: Icecrown Citadel +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/naxxramas/boss_anubrekhan.cpp b/scripts/northrend/naxxramas/boss_anubrekhan.cpp new file mode 100644 index 0000000..7e05548 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_anubrekhan.cpp @@ -0,0 +1,298 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Anubrekhan +SD%Complete: 70 +SDComment: +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SAY_GREET = -1533000, + SAY_AGGRO1 = -1533001, + SAY_AGGRO2 = -1533002, + SAY_AGGRO3 = -1533003, + SAY_TAUNT1 = -1533004, + SAY_TAUNT2 = -1533005, + SAY_TAUNT3 = -1533006, + SAY_TAUNT4 = -1533007, + SAY_SLAY = -1533008, + + SPELL_IMPALE = 28783, //May be wrong spell id. Causes more dmg than I expect + SPELL_IMPALE_H = 56090, + SPELL_LOCUSTSWARM = 28785, //This is a self buff that triggers the dmg debuff + SPELL_LOCUSTSWARM_H = 54021, + + //spellId invalid + SPELL_SUMMONGUARD = 29508, //Summons 1 crypt guard at targeted location + + SPELL_SELF_SPAWN_5 = 29105, //This spawns 5 corpse scarabs ontop of us (most likely the pPlayer casts this on death) + SPELL_SELF_SPAWN_10 = 28864, //This is used by the crypt guards when they die + + SPELL_FRENZY = 8269, + SPELL_ACID_SPIT = 28969, + SPELL_ACID_SPIT_H = 56098, + SPELL_CLEAVE = 40504, + + NPC_CRYPT_GUARD = 16573 +}; + +struct MANGOS_DLL_DECL boss_anubrekhanAI : public ScriptedAI +{ + boss_anubrekhanAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_bHasTaunted = false; + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiImpaleTimer; + uint32 m_uiLocustSwarmTimer; + uint32 m_uiCryptGuardTimer; + bool m_bHasTaunted; + + void Reset() + { + m_uiImpaleTimer = 15000; // 15 seconds + m_uiLocustSwarmTimer = urand(70000, 120000); // Random time between 80 seconds and 2 minutes for initial cast + m_uiCryptGuardTimer = 0; + } + + void KilledUnit(Unit* pVictim) + { + //Force the player to spawn corpse scarabs via spell + if (pVictim->GetTypeId() == TYPEID_PLAYER) + pVictim->CastSpell(pVictim, SPELL_SELF_SPAWN_5, true); + + if (urand(0, 4)) + return; + + DoScriptText(SAY_SLAY, m_creature); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_ANUB_REKHAN, IN_PROGRESS); + + if (m_bIsRegularMode) + m_uiCryptGuardTimer = 20000; + else + { + SummonGuard(); + SummonGuard(); + m_uiCryptGuardTimer = 30000; + } + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ANUB_REKHAN, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ANUB_REKHAN, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bHasTaunted && m_creature->IsWithinDistInMap(pWho, 60.0f)) + { + switch(urand(0, 4)) + { + case 0: DoScriptText(SAY_GREET, m_creature); break; + case 1: DoScriptText(SAY_TAUNT1, m_creature); break; + case 2: DoScriptText(SAY_TAUNT2, m_creature); break; + case 3: DoScriptText(SAY_TAUNT3, m_creature); break; + case 4: DoScriptText(SAY_TAUNT4, m_creature); break; + } + m_bHasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(pWho); + } + void SummonGuard() + { + m_creature->SummonCreature(NPC_CRYPT_GUARD,m_creature->GetPositionX()+rand()%5, + m_creature->GetPositionY()+rand()%5, + m_creature->GetPositionZ(),0, + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,60000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Impale + if (m_uiImpaleTimer < uiDiff) + { + //Cast Impale on a random target + //Do NOT cast it when we are afflicted by locust swarm + if (!m_creature->HasAura(SPELL_LOCUSTSWARM) || !m_creature->HasAura(SPELL_LOCUSTSWARM_H)) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_IMPALE : SPELL_IMPALE_H); + } + + m_uiImpaleTimer = 15000; + } + else + m_uiImpaleTimer -= uiDiff; + + // Locust Swarm + if (m_uiLocustSwarmTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_LOCUSTSWARM :SPELL_LOCUSTSWARM_H); + m_uiLocustSwarmTimer = 90000; + //spawn crypt guards with swarm on 10man mode + m_uiCryptGuardTimer = 2000; + } + else + m_uiLocustSwarmTimer -= uiDiff; + + // Summon crypt guard + if (m_uiCryptGuardTimer < uiDiff) + { + SummonGuard(); + if (!m_bIsRegularMode) + SummonGuard(); + + //DoCastSpellIfCan(m_creature, SPELL_SUMMONGUARD); + m_uiCryptGuardTimer = 30000; + } + else + m_uiCryptGuardTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_crypt_guardAI : public ScriptedAI +{ + mob_crypt_guardAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 AcidSpit_Timer; + uint32 Cleave_Timer; + uint32 Berserk_Timer; + + void Reset() + { + AcidSpit_Timer = 10000 + rand()%1000; + Cleave_Timer = 5000 + rand()%5000; + Berserk_Timer = 120000; + } + + void KilledUnit(Unit* pVictim) + { + //Force the player to spawn corpse scarabs via spell + if (pVictim->GetTypeId() == TYPEID_PLAYER) + pVictim->CastSpell(pVictim, SPELL_SELF_SPAWN_5, true); + } + + void JustDied(Unit* Killer) + { + m_creature->CastSpell(m_creature, SPELL_SELF_SPAWN_10, true); + } + + void Aggro(Unit *who) + { + if (m_pInstance) + { + if (Creature* pAnubRekhan = ((Creature*)m_creature->GetMap()->GetUnit( m_pInstance->GetData64(NPC_ANUB_REKHAN)))) + if (pAnubRekhan->isAlive() && !pAnubRekhan->getVictim()) + pAnubRekhan->AI()->AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Berserk_Timer) + if (Berserk_Timer < diff) + { + DoCast(m_creature, SPELL_FRENZY); + Berserk_Timer = 0; + }else Berserk_Timer -= diff; + + if (AcidSpit_Timer < diff) + { + DoCast(m_creature->getVictim(), m_bIsRegularMode ? SPELL_ACID_SPIT : SPELL_ACID_SPIT_H); + AcidSpit_Timer = 10000 + rand()%1000; + }else AcidSpit_Timer -= diff; + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 5000 + rand()%5000; + }else Cleave_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anubrekhan(Creature* pCreature) +{ + return new boss_anubrekhanAI(pCreature); +} + +CreatureAI* GetAI_mob_crypt_guard(Creature* pCreature) +{ + return new mob_crypt_guardAI(pCreature); +} + +void AddSC_boss_anubrekhan() +{ + Script* NewScript; + NewScript = new Script; + NewScript->Name = "boss_anubrekhan"; + NewScript->GetAI = &GetAI_boss_anubrekhan; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "mob_crypt_guard"; + NewScript->GetAI = &GetAI_mob_crypt_guard; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_faerlina.cpp b/scripts/northrend/naxxramas/boss_faerlina.cpp new file mode 100644 index 0000000..4c6fbc3 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_faerlina.cpp @@ -0,0 +1,250 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Faerlina +SD%Complete: 50 +SDComment: +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SAY_GREET = -1533009, + SAY_AGGRO1 = -1533010, + SAY_AGGRO2 = -1533011, + SAY_AGGRO3 = -1533012, + SAY_AGGRO4 = -1533013, + SAY_SLAY1 = -1533014, + SAY_SLAY2 = -1533015, + SAY_DEATH = -1533016, + + MOB_WORSHIPPER = 16506, + MOB_FOLLOWER = 16505, + + //SOUND_RANDOM_AGGRO = 8955, //soundId containing the 4 aggro sounds, we not using this + + SPELL_POSIONBOLT_VOLLEY = 28796, + H_SPELL_POSIONBOLT_VOLLEY = 54098, + + SPELL_RAINOFFIRE = 28794, + H_SPELL_RAINOFFIRE = 58936, + + SPELL_ENRAGE = 28798, + H_SPELL_ENRAGE = 54100, + + //MOB SPELLS + SPELL_WIDOWS_EMBRACE = 28732, + SPELL_FIRE_BALL = 54095, + H_SPELL_FIRE_BALL = 54096 +}; + +static uint32 m_uiWorshippers[4] = {NPC_WORSHIPPER_1,NPC_WORSHIPPER_2,NPC_WORSHIPPER_3,NPC_WORSHIPPER_4}; +static uint32 m_uiFollower[2] = {NPC_FOLLOWER_1, NPC_FOLLOWER_2}; + +struct MANGOS_DLL_DECL boss_faerlinaAI : public ScriptedAI +{ + boss_faerlinaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_bHasTaunted = false; + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiPoisonBoltVolleyTimer; + uint32 m_uiRainOfFireTimer; + uint32 m_uiEnrageTimer; + uint8 m_uiDeadWorshippers; + bool m_bHasTaunted; + + uint64 m_uiFollowerGUID[5]; + + void Reset() + { + m_uiPoisonBoltVolleyTimer = 8000; + m_uiRainOfFireTimer = 16000; + m_uiEnrageTimer = 60000; + m_uiDeadWorshippers = 0; + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_AGGRO4, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_FAERLINA, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bHasTaunted && m_creature->IsWithinDistInMap(pWho, 60.0f)) + { + DoScriptText(SAY_GREET, m_creature); + m_bHasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1)?SAY_SLAY1:SAY_SLAY2, m_creature); + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_WIDOWS_EMBRACE) + { + if (m_creature->HasAura(SPELL_ENRAGE,EFFECT_INDEX_2)) + { + m_creature->RemoveAurasDueToSpell(SPELL_ENRAGE); + m_uiEnrageTimer = 60000; + + /*if (!m_bIsRegularMode) //hack worshipper should die + pCaster->DealDamage(pCaster, pCaster->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);*/ + + }else m_uiEnrageTimer += 30000; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_FAERLINA, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_FAERLINA, FAIL); + + for(int i=0;i<4;i++) + { + if(Creature* worshipper = (Creature*) m_creature->GetMap()->GetUnit(m_pInstance->GetData64(m_uiWorshippers[i]))) + { + worshipper->Respawn(); + } + } + for(int i=0;i<2;i++) + { + if(Creature* follower = (Creature*) m_creature->GetMap()->GetUnit(m_pInstance->GetData64(m_uiFollower[i]))) + { + follower->Respawn(); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Poison Bolt Volley + if (m_uiPoisonBoltVolleyTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_POSIONBOLT_VOLLEY : H_SPELL_POSIONBOLT_VOLLEY); + m_uiPoisonBoltVolleyTimer = 11000; + }else m_uiPoisonBoltVolleyTimer -= uiDiff; + + // Rain Of Fire + if (m_uiRainOfFireTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_RAINOFFIRE : H_SPELL_RAINOFFIRE); + + m_uiRainOfFireTimer = 16000; + }else m_uiRainOfFireTimer -= uiDiff; + + //Enrage_Timer + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ENRAGE : H_SPELL_ENRAGE); + m_uiEnrageTimer = 60000; + }else m_uiEnrageTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_faerlina(Creature* pCreature) +{ + return new boss_faerlinaAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_worshipperAI : public ScriptedAI +{ + mob_worshipperAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FIRE_BALL : H_SPELL_FIRE_BALL); + } + + void JustDied(Unit* pKiller) + { + // if (m_bIsRegularMode) //only 10 mode + m_creature->CastSpell(m_creature, SPELL_WIDOWS_EMBRACE, true, 0, 0, pKiller->GetGUID()); + } + +}; + +CreatureAI* GetAI_mob_worshipper(Creature* pCreature) +{ + return new mob_worshipperAI(pCreature); +} +void AddSC_boss_faerlina() +{ + Script* NewScript; + + NewScript = new Script; + NewScript->Name = "boss_faerlina"; + NewScript->GetAI = &GetAI_boss_faerlina; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "mob_worshipper"; + NewScript->GetAI = &GetAI_mob_worshipper; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_four_horsemen.cpp b/scripts/northrend/naxxramas/boss_four_horsemen.cpp new file mode 100644 index 0000000..e077380 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_four_horsemen.cpp @@ -0,0 +1,784 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Four_Horsemen +SD%Complete: 85 +SDComment: Lady Blaumeux, Thane Korthazz, Sir Zeliek, Baron Rivendare +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + //all horsemen + SPELL_SHIELDWALL = 29061, + SPELL_BESERK = 26662, + + //lady blaumeux + SAY_BLAU_AGGRO = -1533044, + SAY_BLAU_TAUNT1 = -1533045, + SAY_BLAU_TAUNT2 = -1533046, + SAY_BLAU_TAUNT3 = -1533047, + SAY_BLAU_SPECIAL = -1533048, + SAY_BLAU_SLAY = -1533049, + SAY_BLAU_DEATH = -1533050, + + SPELL_MARK_OF_BLAUMEUX = 28833, + SPELL_UNYILDING_PAIN = 57381, + SPELL_VOIDZONE = 28863, + H_SPELL_VOIDZONE = 57463, + SPELL_SHADOW_BOLT = 57374, + H_SPELL_SHADOW_BOLT = 57464, + + //baron rivendare + SAY_RIVE_AGGRO1 = -1533065, + SAY_RIVE_AGGRO2 = -1533066, + SAY_RIVE_AGGRO3 = -1533067, + SAY_RIVE_SLAY1 = -1533068, + SAY_RIVE_SLAY2 = -1533069, + SAY_RIVE_SPECIAL = -1533070, + SAY_RIVE_TAUNT1 = -1533071, + SAY_RIVE_TAUNT2 = -1533072, + SAY_RIVE_TAUNT3 = -1533073, + SAY_RIVE_DEATH = -1533074, + + SPELL_MARK_OF_RIVENDARE = 28834, + SPELL_UNHOLY_SHADOW = 28882, + H_SPELL_UNHOLY_SHADOW = 57369, + + //thane korthazz + SAY_KORT_AGGRO = -1533051, + SAY_KORT_TAUNT1 = -1533052, + SAY_KORT_TAUNT2 = -1533053, + SAY_KORT_TAUNT3 = -1533054, + SAY_KORT_SPECIAL = -1533055, + SAY_KORT_SLAY = -1533056, + SAY_KORT_DEATH = -1533057, + + SPELL_MARK_OF_KORTHAZZ = 28832, + SPELL_METEOR = 26558, // m_creature->getVictim() auto-area spell but with a core problem + + //sir zeliek + SAY_ZELI_AGGRO = -1533058, + SAY_ZELI_TAUNT1 = -1533059, + SAY_ZELI_TAUNT2 = -1533060, + SAY_ZELI_TAUNT3 = -1533061, + SAY_ZELI_SPECIAL = -1533062, + SAY_ZELI_SLAY = -1533063, + SAY_ZELI_DEATH = -1533064, + + SPELL_MARK_OF_ZELIEK = 28835, + SPELL_HOLY_WRATH = 28883, + H_SPELL_HOLY_WRATH = 57466, + SPELL_HOLY_BOLT = 57376, + H_SPELL_HOLY_BOLT = 57465, + SPELL_CONDEMNATION = 57377, + + // horseman spirits + NPC_SPIRIT_OF_BLAUMEUX = 16776, + NPC_SPIRIT_OF_RIVENDARE = 0, //creature entry not known yet + NPC_SPIRIT_OF_KORTHAZZ = 16778, + NPC_SPIRIT_OF_ZELIREK = 16777 +}; + +/*walk coords*/ +#define WALKX_BLAU 2462.112f +#define WALKY_BLAU -2956.598f +#define WALKZ_BLAU 241.276f + +#define WALKX_RIVE 2579.571f +#define WALKY_RIVE -2960.945f +#define WALKZ_RIVE 241.32f + +#define WALKX_KORT 2529.108f +#define WALKY_KORT -3015.303f +#define WALKZ_KORT 241.32f +#define WALKX_ZELI 2521.039f +#define WALKY_ZELI -2891.633f +#define WALKZ_ZELI 241.276f + +#define HIGH_THREAT 50.0f + +struct MANGOS_DLL_DECL boss_lady_blaumeuxAI : public ScriptedAI +{ + boss_lady_blaumeuxAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Mark_Timer; + uint32 VoidZone_Timer; + uint32 Cast_Timer; + bool Move_Check; + bool Chase; + + bool ShieldWall1; + bool ShieldWall2; + + void Reset() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. + VoidZone_Timer = 12000; // right + Cast_Timer = 9000; + Move_Check = true; + Chase = true; + + ShieldWall1 = true; + ShieldWall2 = true; + } + + void JustReachedHome() + { + if (Creature* Zeliek = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ZELIEK))) + if (!Zeliek->isAlive()) + Zeliek->Respawn(); + if (Creature* Rivedare = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_RIVENDARE))) + if (!Rivedare->isAlive()) + Rivedare->Respawn(); + if (Creature* Thane = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_THANE))) + if (!Thane->isAlive()) + Thane->Respawn(); + } + + void Aggro(Unit *who) + { + m_creature->SetInCombatWithZone(); + DoScriptText(SAY_BLAU_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BLAUMEUX, IN_PROGRESS); + + m_creature->AddThreat(who, HIGH_THREAT); + m_creature->CallForHelp(50.0f); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_BLAU_SLAY, m_creature); + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + if(Chase) + { + m_creature->GetMotionMaster()->MoveChase(pWho); + Chase = false; + } + } + } + + Unit *PickNearestPlayer() + { + Unit *nearp = NULL; + float neardist = 0.0f; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &lPlayers = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (!pPlayer || !pPlayer->isAlive()) + continue; + float pudist = pPlayer->GetDistance((const Creature *)m_creature); + if (!nearp || (neardist > pudist)) + { + nearp = pPlayer; + neardist = pudist; + } + } + return nearp; + } + + + void Cast(Unit* pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (!pWho) + return; + + AttackStart(pWho); + if(pWho->IsWithinDist(m_creature, 40)) + DoCastSpellIfCan(pWho, m_bIsRegularMode ? SPELL_SHADOW_BOLT : H_SPELL_SHADOW_BOLT); + else + DoCast(m_creature, SPELL_UNYILDING_PAIN); + Cast_Timer = 2500; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_BLAU_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BLAUMEUX, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //run on aggro + if (m_creature->getVictim() && Move_Check) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovePoint(0.f, WALKX_BLAU, WALKY_BLAU, WALKZ_BLAU); + Move_Check = false; + } + + // Mark of Blaumeux + if (Mark_Timer < uiDiff) + { + DoCast(m_creature,SPELL_MARK_OF_BLAUMEUX, true); + Mark_Timer = 12000; + }else Mark_Timer -= uiDiff; + + // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds + if (ShieldWall1 && m_creature->GetHealthPercent() < 50.0f) + { + if (ShieldWall1) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall1 = false; + } + } + if (ShieldWall2 && m_creature->GetHealthPercent() < 20.0f) + { + if (ShieldWall2) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall2 = false; + } + } + + // Void Zone + if (VoidZone_Timer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(),SPELL_VOIDZONE) == CAST_OK) + VoidZone_Timer = 12000; + }else VoidZone_Timer -= uiDiff; + + // Cast + if (Cast_Timer < uiDiff) + { + Unit *nearu = PickNearestPlayer(); + Cast(nearu); + }else Cast_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_lady_blaumeux(Creature* pCreature) +{ + return new boss_lady_blaumeuxAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_rivendare_naxxAI : public ScriptedAI +{ + boss_rivendare_naxxAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Mark_Timer; + uint32 UnholyShadow_Timer; + bool Move_Check; + bool Attack_Check; + bool ShieldWall1; + bool ShieldWall2; + + void Reset() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + Mark_Timer = 20000; + UnholyShadow_Timer = 15000; + Move_Check = true; + Attack_Check = true; + ShieldWall1 = true; + ShieldWall2 = true; + + if (m_pInstance) + m_pInstance->SetData(TYPE_FOUR_HORSEMEN, NOT_STARTED); + } + + void JustReachedHome() + { + if (Creature* Blaumeux = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_BLAUMEUX))) + if (!Blaumeux->isAlive()) + Blaumeux->Respawn(); + if (Creature* Zeliek = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ZELIEK))) + if (!Zeliek->isAlive()) + Zeliek->Respawn(); + if (Creature* Thane = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_THANE))) + if (!Thane->isAlive()) + Thane->Respawn(); + } + + void Aggro(Unit *who) + { + m_creature->SetInCombatWithZone(); + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_RIVE_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_RIVE_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_RIVE_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_FOUR_HORSEMEN, IN_PROGRESS); + m_pInstance->SetData(TYPE_RIVENDARE, IN_PROGRESS); + + m_creature->AddThreat(who, HIGH_THREAT); + m_creature->CallForHelp(50.0f); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(urand(0, 1) ? SAY_RIVE_SLAY1 : SAY_RIVE_SLAY2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_RIVE_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_RIVENDARE, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //run on aggro + if (m_creature->getVictim() && Move_Check) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovePoint(0, WALKX_RIVE, WALKY_RIVE, WALKZ_RIVE); + Move_Check = false; + } + + //when reach position, set possible to attack + if (m_creature->GetDistance2d(WALKX_RIVE, WALKY_RIVE) <= 2 && Attack_Check) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + Attack_Check = false; + } + + // Mark of Rivendare + if (Mark_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_MARK_OF_RIVENDARE); + Mark_Timer = 12000; + }else Mark_Timer -= diff; + + // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds + if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + if (ShieldWall1) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall1 = false; + } + } + if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) + { + if (ShieldWall2) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall2 = false; + } + } + + if (UnholyShadow_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_UNHOLY_SHADOW : H_SPELL_UNHOLY_SHADOW); + UnholyShadow_Timer = 15000; + }else UnholyShadow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_rivendare_naxx(Creature* pCreature) +{ + return new boss_rivendare_naxxAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_thane_korthazzAI : public ScriptedAI +{ + boss_thane_korthazzAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Mark_Timer; + uint32 Meteor_Timer; + bool Move_Check; + bool Attack_Check; + + bool ShieldWall1; + bool ShieldWall2; + + void Reset() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. + Meteor_Timer = 30000; // wrong + + Move_Check = true; + Attack_Check = true; + ShieldWall1 = true; + ShieldWall2 = true; + } + void JustReachedHome() + { + if (Creature* Blaumeux = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_BLAUMEUX))) + if (!Blaumeux->isAlive()) + Blaumeux->Respawn(); + if (Creature* Zeliek = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_ZELIEK))) + if (!Zeliek->isAlive()) + Zeliek->Respawn(); + if (Creature* Rivedare = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_RIVENDARE))) + if (!Rivedare->isAlive()) + Rivedare->Respawn(); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_KORT_SLAY, m_creature); + } + + void Aggro(Unit *who) + { + m_creature->SetInCombatWithZone(); + DoScriptText(SAY_KORT_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KORTHAZZ, IN_PROGRESS); + + m_creature->AddThreat(who, HIGH_THREAT); + m_creature->CallForHelp(50.0f); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_KORT_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KORTHAZZ, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //run on aggro + if (m_creature->getVictim() && Move_Check) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovePoint(0, WALKX_KORT, WALKY_KORT, WALKZ_KORT); + Move_Check = false; + } + + //when reach position, set possible to attack + if (m_creature->GetDistance2d(WALKX_KORT, WALKY_KORT) <= 2 && Attack_Check) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + Attack_Check = false; + } + + // Mark of Korthazz + if (Mark_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature,SPELL_MARK_OF_KORTHAZZ); + Mark_Timer = 12000; + }else Mark_Timer -= uiDiff; + + // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds + if (ShieldWall1 && m_creature->GetHealthPercent() < 50.0f) + { + if (ShieldWall1) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall1 = false; + } + } + if (ShieldWall2 && m_creature->GetHealthPercent() < 20.0f) + { + if (ShieldWall2) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall2 = false; + } + } + + // Meteor + if (Meteor_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_METEOR); + Meteor_Timer = 20000; // wrong + }else Meteor_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thane_korthazz(Creature* pCreature) +{ + return new boss_thane_korthazzAI(pCreature); +} + +struct MANGOS_DLL_DECL boss_sir_zeliekAI : public ScriptedAI +{ + boss_sir_zeliekAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Cast_Timer; + uint32 Mark_Timer; + uint32 HolyWrath_Timer; + bool Move_Check; + bool Chase; + + bool ShieldWall1; + bool ShieldWall2; + + void Reset() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. + HolyWrath_Timer = 12000; // right + Cast_Timer = 9000; + Move_Check = true; + Chase = true; + + ShieldWall1 = true; + ShieldWall2 = true; + } + void JustReachedHome() + { + if (Creature* Blaumeux = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_BLAUMEUX))) + if (!Blaumeux->isAlive()) + Blaumeux->Respawn(); + if (Creature* Rivedare = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_RIVENDARE))) + if (!Rivedare->isAlive()) + Rivedare->Respawn(); + if (Creature* Thane = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_THANE))) + if (!Thane->isAlive()) + Thane->Respawn(); + } + + void Aggro(Unit *who) + { + m_creature->SetInCombatWithZone(); + DoScriptText(SAY_ZELI_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ZELIEK, IN_PROGRESS); + + m_creature->AddThreat(who, HIGH_THREAT); + m_creature->CallForHelp(50.0f); + } + + Unit *PickNearestPlayer() + { + Unit *nearp = NULL; + float neardist = 0.0f; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &lPlayers = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr) + { + Player* pPlayer = itr->getSource(); + if (!pPlayer || !pPlayer->isAlive()) + continue; + float pudist = pPlayer->GetDistance((const Creature *)m_creature); + if (!nearp || (neardist > pudist)) + { + nearp = pPlayer; + neardist = pudist; + } + } + return nearp; + } + + void Cast(Unit* pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + AttackStart(pWho); + if(pWho->IsWithinDist(m_creature, 40)) + DoCastSpellIfCan(pWho, m_bIsRegularMode ? SPELL_HOLY_BOLT : H_SPELL_HOLY_BOLT); + else + DoCast(m_creature, SPELL_CONDEMNATION); + Cast_Timer = 2500; + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + if(Chase) + { + m_creature->GetMotionMaster()->MoveChase(pWho); + Chase = false; + } + } + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_ZELI_SLAY, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_ZELI_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ZELIEK, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //run on aggro + if (m_creature->getVictim() && Move_Check) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovePoint(0, WALKX_ZELI, WALKY_ZELI, WALKZ_ZELI); + Move_Check = false; + } + + // Mark of Zeliek + if (Mark_Timer < uiDiff) + { + DoCast(m_creature, SPELL_MARK_OF_ZELIEK, true); + Mark_Timer = 12000; + }else Mark_Timer -= uiDiff; + + // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds + if (ShieldWall1 && m_creature->GetHealthPercent() < 50.0f) + { + if (ShieldWall1) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall1 = false; + } + } + if (ShieldWall2 && m_creature->GetHealthPercent() < 20.0f) + { + if (ShieldWall2) + { + if (DoCastSpellIfCan(m_creature,SPELL_SHIELDWALL) == CAST_OK) + ShieldWall2 = false; + } + } + + // Holy Wrath + if (HolyWrath_Timer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(),SPELL_HOLY_WRATH) == CAST_OK) + HolyWrath_Timer = 12000; + }else HolyWrath_Timer -= uiDiff; + + // Cast + if (Cast_Timer < uiDiff) + { + Unit *nearu = PickNearestPlayer(); + Cast(nearu); + }else Cast_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_sir_zeliek(Creature* pCreature) +{ + return new boss_sir_zeliekAI(pCreature); +} + +void AddSC_boss_four_horsemen() +{ + Script* NewScript; + + NewScript = new Script; + NewScript->Name = "boss_lady_blaumeux"; + NewScript->GetAI = &GetAI_boss_lady_blaumeux; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "boss_rivendare_naxx"; + NewScript->GetAI = &GetAI_boss_rivendare_naxx; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "boss_thane_korthazz"; + NewScript->GetAI = &GetAI_boss_thane_korthazz; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "boss_sir_zeliek"; + NewScript->GetAI = &GetAI_boss_sir_zeliek; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_gluth.cpp b/scripts/northrend/naxxramas/boss_gluth.cpp new file mode 100644 index 0000000..2b57d51 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_gluth.cpp @@ -0,0 +1,249 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gluth +SD%Complete: 70 +SDComment: +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + EMOTE_ZOMBIE = -1533119, + + SPELL_MORTALWOUND = 25646, + SPELL_DECIMATE = 28374, + SPELL_ENRAGE = 28371, + SPELL_ENRAGE_H = 54427, + SPELL_BERSERK = 26662, + SPELL_ZOMBIE_CHOW_SEARCH = 28404, //don't work. Onehit for Player + + NPC_ZOMBIE_CHOW = 16360 +}; + +const float ADD_SPAWN[5][3] = +{ + {3269.5f, -3161.2f, 297.4f}, + {3277.0f, -3190.1f, 297.4f}, + {3316.0f, -3188.6f, 297.4f}, + {3247.0f, -3139.2f, 297.4f}, + {3258.0f, -3121.1f, 297.4f} +}; +struct MANGOS_DLL_DECL boss_gluthAI : public ScriptedAI +{ + boss_gluthAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiMortalWoundTimer; + uint32 m_uiDecimateTimer; + uint32 m_uiEnrageTimer; + uint32 m_uiSummonTimer; + + uint32 m_uiBerserkTimer; + + uint32 m_uiRangeCheck_Timer; + std::list m_lZombieGUIDList; + + void Reset() + { + m_uiMortalWoundTimer = 8000; + m_uiDecimateTimer = 110000; + m_uiEnrageTimer = 60000; + m_uiSummonTimer = 10000; + + m_uiBerserkTimer = MINUTE*7*IN_MILLISECONDS; + + m_uiRangeCheck_Timer = 1000; + m_lZombieGUIDList.clear(); + if (!m_lZombieGUIDList.empty()) + { + for(std::list::iterator itr = m_lZombieGUIDList.begin(); itr != m_lZombieGUIDList.end(); ++itr) + if (Creature* pTemp = (Creature*)m_creature->GetMap()->GetUnit( *itr)) + if (pTemp->isAlive() && m_creature->IsWithinDistInMap(pTemp, ATTACK_DISTANCE)) + pTemp->ForcedDespawn(); + } + m_lZombieGUIDList.clear(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GLUTH, DONE); + + std::list pZombies; + GetCreatureListWithEntryInGrid(pZombies, m_creature, NPC_ZOMBIE_CHOW, DEFAULT_VISIBILITY_INSTANCE); + + if (!pZombies.empty()) + for(std::list::iterator itr = pZombies.begin(); itr != pZombies.end(); ++itr) + (*itr)->ForcedDespawn(); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GLUTH, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GLUTH, FAIL); + } + + void JustSummoned(Creature* summoned) + { + //summoned->SetSpeedRate(MOVE_RUN, 0.5f); + //summoned->SetSpeedRate(MOVE_WALK, 0.5f); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Mortal Wound + if (m_uiMortalWoundTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTALWOUND); + m_uiMortalWoundTimer = 10000; + } + else + m_uiMortalWoundTimer -= uiDiff; + + //Decimate_Timer + if (m_uiDecimateTimer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_DECIMATE); // need core support + + // workaround below + std::list t_list = m_creature->getThreatManager().getThreatList(); + if (t_list.size()) + { + //begin + 1 , so we don't target the one with the highest threat + std::list::iterator itr = t_list.begin(); + for(; itr!= t_list.end(); ++itr) + { + Unit *target = m_creature->GetMap()->GetUnit( (*itr)->getUnitGuid()); + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER && + (target->GetHealth() > target->GetMaxHealth() * 0.05)) + target->SetHealth(target->GetMaxHealth() * 0.05); + } + } + // Move Zombies + if (!m_lZombieGUIDList.empty()) + { + for(std::list::iterator itr = m_lZombieGUIDList.begin(); itr != m_lZombieGUIDList.end(); ++itr) + if (Creature* pTemp = (Creature*)m_creature->GetMap()->GetUnit( *itr)) + if (pTemp->isAlive()) + { + if (m_creature->GetHealth() > m_creature->GetMaxHealth() * 0.05) // remove when SPELL_DECIMATE is working + pTemp->SetHealth(pTemp->GetMaxHealth() * 0.05); + pTemp->AddThreat(m_creature, 1000000000.0f); // force move toward to Gluth + } + } + m_uiDecimateTimer = (m_bIsRegularMode ? 100000 : 120000); + }else m_uiDecimateTimer -= uiDiff; + + // Enrage + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ENRAGE : SPELL_ENRAGE_H); + m_uiEnrageTimer = 60000; + } + else + m_uiEnrageTimer -= uiDiff; + + if (m_uiRangeCheck_Timer < uiDiff) + { + if (!m_lZombieGUIDList.empty()) + { + for(std::list::iterator itr = m_lZombieGUIDList.begin(); itr != m_lZombieGUIDList.end(); ++itr) + if (Creature* pTemp = (Creature*)m_creature->GetMap()->GetUnit( *itr)) + if (pTemp->isAlive() && m_creature->IsWithinDistInMap(pTemp, ATTACK_DISTANCE)) + { + DoScriptText(EMOTE_ZOMBIE, m_creature); + m_creature->SetHealth(m_creature->GetHealth() + m_creature->GetMaxHealth() * 0.05); + pTemp->ForcedDespawn(); + } + } + m_uiRangeCheck_Timer = 1000; + }else m_uiRangeCheck_Timer -= uiDiff; + + // Summon + if (m_uiSummonTimer < uiDiff) + { + SummonZombie(); + + if (!m_bIsRegularMode) + { + SummonZombie(); + } + + m_uiSummonTimer = 10000; + } + else + m_uiSummonTimer -= uiDiff; + + // Berserk + if (m_uiBerserkTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_TRIGGERED); + m_uiBerserkTimer = MINUTE*5*IN_MILLISECONDS; + } + else + m_uiBerserkTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + void SummonZombie() + { + uint32 ran = rand()%5; + if (Creature* pZombie = m_creature->SummonCreature(NPC_ZOMBIE_CHOW, ADD_SPAWN[ran][0], ADD_SPAWN[ran][1], ADD_SPAWN[ran][2], 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 80000)) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + pZombie->AddThreat(pTarget); + m_lZombieGUIDList.push_back(pZombie->GetGUID()); + } + } + } + +}; + +CreatureAI* GetAI_boss_gluth(Creature* pCreature) +{ + return new boss_gluthAI(pCreature); +} + +void AddSC_boss_gluth() +{ + Script* NewScript; + NewScript = new Script; + NewScript->Name = "boss_gluth"; + NewScript->GetAI = &GetAI_boss_gluth; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_gothik.cpp b/scripts/northrend/naxxramas/boss_gothik.cpp new file mode 100644 index 0000000..dc5728c --- /dev/null +++ b/scripts/northrend/naxxramas/boss_gothik.cpp @@ -0,0 +1,442 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gothik +SD%Complete: 60 +SDComment: Only base implemented. Todo: control adds at summon. Handle case of raid not splitted in two sides +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SAY_SPEECH_1 = -1533040, + SAY_SPEECH_2 = -1533140, + SAY_SPEECH_3 = -1533141, + SAY_SPEECH_4 = -1533142, + + SAY_KILL = -1533041, + SAY_DEATH = -1533042, + SAY_TELEPORT = -1533043, + + EMOTE_TO_FRAY = -1533138, + EMOTE_GATE = -1533139, + + PHASE_SPEECH = 0, + PHASE_BALCONY = 1, + PHASE_GROUND = 2, + PHASE_END = 3, + + MAX_WAVES = 19, + + SPELL_TELEPORT_LEFT = 28025, // guesswork + SPELL_TELEPORT_RIGHT = 28026, // could be defined as dead or live side, left or right facing north + + SPELL_HARVESTSOUL = 28679, + SPELL_SHADOWBOLT = 29317, + SPELL_SHADOWBOLT_H = 56405, +}; + +enum eSpellDummy +{ + SPELL_A_TO_ANCHOR_1 = 27892, + SPELL_B_TO_ANCHOR_1 = 27928, + SPELL_C_TO_ANCHOR_1 = 27935, + + SPELL_A_TO_ANCHOR_2 = 27893, + SPELL_B_TO_ANCHOR_2 = 27929, + SPELL_C_TO_ANCHOR_2 = 27936, + + SPELL_A_TO_SKULL = 27915, + SPELL_B_TO_SKULL = 27931, + SPELL_C_TO_SKULL = 27937 +}; + +struct MANGOS_DLL_DECL boss_gothikAI : public ScriptedAI +{ + boss_gothikAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + SetCombatMovement(false); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint8 m_uiPhase; + + uint8 m_uiSpeechCount; + uint32 m_uiSpeechTimer; + + uint8 m_uiSummonCount; + uint32 m_uiSummonTimer; + + uint32 m_uiTeleportTimer; + uint32 m_uiShadowboltTimer; + + void Reset() + { + m_uiPhase = PHASE_SPEECH; + + m_uiSpeechCount = 0; + m_uiSpeechTimer = 5000; + + m_uiSummonCount = 0; + m_uiSummonTimer = 5000; + + m_uiTeleportTimer = 15000; + m_uiShadowboltTimer = 2500; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + + DoScriptText(SAY_SPEECH_1, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_GOTHIK, IN_PROGRESS); + + m_pInstance->SetGothTriggers(); + } + + bool HasPlayersInLeftSide() + { + Map::PlayerList const& lPlayers = m_pInstance->instance->GetPlayers(); + + if (lPlayers.isEmpty()) + return false; + + for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + { + if (!m_pInstance->IsInRightSideGothArea(pPlayer)) + return true; + } + } + + return false; + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() == TYPEID_PLAYER) + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_GOTHIK, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GOTHIK, FAIL); + } + + void SummonAdds(bool bRightSide, uint32 uiSummonEntry) + { + std::list lSummonList; + m_pInstance->GetGothSummonPointCreatures(lSummonList, bRightSide); + + if (lSummonList.empty()) + return; + + uint8 uiCount = 2; + + switch(uiSummonEntry) + { + case NPC_UNREL_TRAINEE: + lSummonList.sort(ObjectDistanceOrder(m_creature)); + break; + case NPC_UNREL_DEATH_KNIGHT: + case NPC_UNREL_RIDER: + uiCount = 1; + lSummonList.sort(ObjectDistanceOrderReversed(m_creature)); + break; + } + + for(std::list::iterator itr = lSummonList.begin(); itr != lSummonList.end(); ++itr) + { + if (uiCount == 0) + break; + + m_creature->SummonCreature(uiSummonEntry, (*itr)->GetPositionX(), (*itr)->GetPositionY(), (*itr)->GetPositionZ(), (*itr)->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + --uiCount; + } + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + if (!m_pInstance) + return; + + if (Creature* pAnchor = m_pInstance->GetClosestAnchorForGoth(pSummoned, true)) + { + switch(pSummoned->GetEntry()) + { + // Wrong caster, it expected to be pSummoned. + // Mangos deletes the spell event at caster death, so for delayed spell like this + // it's just a workaround. Does not affect other than the visual though (+ spell takes longer to "travel") + case NPC_UNREL_TRAINEE: m_creature->CastSpell(pAnchor, SPELL_A_TO_ANCHOR_1, true, NULL, NULL, pSummoned->GetGUID()); break; + case NPC_UNREL_DEATH_KNIGHT: m_creature->CastSpell(pAnchor, SPELL_B_TO_ANCHOR_1, true, NULL, NULL, pSummoned->GetGUID()); break; + case NPC_UNREL_RIDER: m_creature->CastSpell(pAnchor, SPELL_C_TO_ANCHOR_1, true, NULL, NULL, pSummoned->GetGUID()); break; + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + switch(m_uiPhase) + { + case PHASE_SPEECH: + { + if (m_uiSpeechTimer < uiDiff) + { + m_uiSpeechTimer = 5000; + ++m_uiSpeechCount; + + switch(m_uiSpeechCount) + { + case 1: DoScriptText(SAY_SPEECH_2, m_creature); break; + case 2: DoScriptText(SAY_SPEECH_3, m_creature); break; + case 3: DoScriptText(SAY_SPEECH_4, m_creature); break; + case 4: m_uiPhase = PHASE_BALCONY; break; + } + } + else + m_uiSpeechTimer -= uiDiff; + + break; + } + case PHASE_BALCONY: + { + if (m_uiSummonTimer < uiDiff) + { + if (m_uiSummonCount >= MAX_WAVES) + { + DoScriptText(SAY_TELEPORT, m_creature); + DoScriptText(EMOTE_TO_FRAY, m_creature); + DoCastSpellIfCan(m_creature, SPELL_TELEPORT_RIGHT); + m_uiPhase = PHASE_GROUND; + return; + } + + // npc, npc, npc, timer + static uint32 const auiSummonData[MAX_WAVES][4] = + { + {NPC_UNREL_TRAINEE, 0, 0, 20000}, + {NPC_UNREL_TRAINEE, 0, 0, 20000}, + {NPC_UNREL_TRAINEE, 0, 0, 10000}, + {NPC_UNREL_DEATH_KNIGHT, 0, 0, 10000}, + {NPC_UNREL_TRAINEE, 0, 0, 15000}, + {NPC_UNREL_DEATH_KNIGHT, 0, 0, 10000}, + {NPC_UNREL_TRAINEE, 0, 0, 15000}, + {NPC_UNREL_DEATH_KNIGHT, NPC_UNREL_TRAINEE, 0, 10000}, + {NPC_UNREL_RIDER, 0, 0, 10000}, + {NPC_UNREL_TRAINEE, 0, 0, 5000}, + {NPC_UNREL_DEATH_KNIGHT, 0, 0, 15000}, + {NPC_UNREL_TRAINEE, NPC_UNREL_RIDER, 0, 10000}, + {NPC_UNREL_DEATH_KNIGHT, NPC_UNREL_DEATH_KNIGHT, 0, 10000}, + {NPC_UNREL_TRAINEE, 0, 0, 10000}, + {NPC_UNREL_RIDER, 0, 0, 5000}, + {NPC_UNREL_DEATH_KNIGHT, 0, 0, 5000}, + {NPC_UNREL_TRAINEE, 0, 0, 20000}, + {NPC_UNREL_RIDER, NPC_UNREL_DEATH_KNIGHT, NPC_UNREL_TRAINEE, 15000}, + {NPC_UNREL_TRAINEE, 0, 0, 30000}, + }; + + SummonAdds(true, auiSummonData[m_uiSummonCount][0]); + + if (auiSummonData[m_uiSummonCount][1]) + SummonAdds(true, auiSummonData[m_uiSummonCount][1]); + + if (auiSummonData[m_uiSummonCount][2]) + SummonAdds(true, auiSummonData[m_uiSummonCount][2]); + + m_uiSummonTimer = auiSummonData[m_uiSummonCount][3]; + + ++m_uiSummonCount; + } + else + m_uiSummonTimer -= uiDiff; + + break; + } + case PHASE_GROUND: + case PHASE_END: + { + if (m_uiPhase == PHASE_GROUND) + { + if (m_creature->GetHealthPercent() < 30.0f) + { + if (m_pInstance->IsInRightSideGothArea(m_creature)) + { + DoScriptText(EMOTE_GATE, m_creature); + m_pInstance->SetData(TYPE_GOTHIK, SPECIAL); + m_uiPhase = PHASE_END; + m_uiShadowboltTimer = 2000; + return; + } + } + + if (m_uiTeleportTimer < uiDiff) + { + uint32 uiTeleportSpell = m_pInstance->IsInRightSideGothArea(m_creature) ? SPELL_TELEPORT_LEFT : SPELL_TELEPORT_RIGHT; + + if (DoCastSpellIfCan(m_creature, uiTeleportSpell) == CAST_OK) + { + DoResetThreat(); + m_uiTeleportTimer = 15000; + m_uiShadowboltTimer = 2000; + return; + } + } + else + m_uiTeleportTimer -= uiDiff; + } + + if (m_uiShadowboltTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOWBOLT: SPELL_SHADOWBOLT_H) == CAST_OK) + m_uiShadowboltTimer = 1500; + } + else + m_uiShadowboltTimer -= uiDiff; + + DoMeleeAttackIfReady(); // possibly no melee at all + break; + } + } + } +}; + +CreatureAI* GetAI_boss_gothik(Creature* pCreature) +{ + return new boss_gothikAI(pCreature); +} + +bool EffectDummyCreature_spell_anchor(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + if (uiEffIndex != EFFECT_INDEX_0 || pCreatureTarget->GetEntry() != NPC_SUB_BOSS_TRIGGER) + return true; + + instance_naxxramas* pInstance = (instance_naxxramas*)pCreatureTarget->GetInstanceData(); + + if (!pInstance) + return true; + + switch(uiSpellId) + { + case SPELL_A_TO_ANCHOR_1: // trigger mobs at high right side + case SPELL_B_TO_ANCHOR_1: + case SPELL_C_TO_ANCHOR_1: + { + if (Creature* pAnchor2 = pInstance->GetClosestAnchorForGoth(pCreatureTarget, false)) + { + uint32 uiTriggered = SPELL_A_TO_ANCHOR_2; + + if (uiSpellId == SPELL_B_TO_ANCHOR_1) + uiTriggered = SPELL_B_TO_ANCHOR_2; + else if (uiSpellId == SPELL_C_TO_ANCHOR_1) + uiTriggered = SPELL_C_TO_ANCHOR_2; + + pCreatureTarget->CastSpell(pAnchor2, uiTriggered, true); + } + + return true; + } + case SPELL_A_TO_ANCHOR_2: // trigger mobs at high left side + case SPELL_B_TO_ANCHOR_2: + case SPELL_C_TO_ANCHOR_2: + { + std::list lTargets; + pInstance->GetGothSummonPointCreatures(lTargets, false); + + if (!lTargets.empty()) + { + std::list::iterator itr = lTargets.begin(); + uint32 uiPosition = urand(0, lTargets.size()-1); + advance(itr, uiPosition); + + if (Creature* pTarget = (*itr)) + { + uint32 uiTriggered = SPELL_A_TO_SKULL; + + if (uiSpellId == SPELL_B_TO_ANCHOR_2) + uiTriggered = SPELL_B_TO_SKULL; + else if (uiSpellId == SPELL_C_TO_ANCHOR_2) + uiTriggered = SPELL_C_TO_SKULL; + + pCreatureTarget->CastSpell(pTarget, uiTriggered, true); + } + } + return true; + } + case SPELL_A_TO_SKULL: // final destination trigger mob + case SPELL_B_TO_SKULL: + case SPELL_C_TO_SKULL: + { + if (Creature* pGoth = pInstance->instance->GetCreature(pInstance->GetData64(NPC_GOTHIK))) + { + uint32 uiNpcEntry = NPC_SPECT_TRAINEE; + + if (uiSpellId == SPELL_B_TO_SKULL) + uiNpcEntry = NPC_SPECT_DEATH_KNIGTH; + else if (uiSpellId == SPELL_C_TO_SKULL) + uiNpcEntry = NPC_SPECT_RIDER; + + pGoth->SummonCreature(uiNpcEntry, pCreatureTarget->GetPositionX(), pCreatureTarget->GetPositionY(), pCreatureTarget->GetPositionZ(), pCreatureTarget->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); + + if (uiNpcEntry == NPC_SPECT_RIDER) + pGoth->SummonCreature(NPC_SPECT_HORSE, pCreatureTarget->GetPositionX(), pCreatureTarget->GetPositionY(), pCreatureTarget->GetPositionZ(), pCreatureTarget->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); + } + return true; + } + } + + return true; +}; + +void AddSC_boss_gothik() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_gothik"; + newscript->GetAI = &GetAI_boss_gothik; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "spell_anchor"; + newscript->pEffectDummyCreature = &EffectDummyCreature_spell_anchor; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_grobbulus.cpp b/scripts/northrend/naxxramas/boss_grobbulus.cpp new file mode 100644 index 0000000..5eca36b --- /dev/null +++ b/scripts/northrend/naxxramas/boss_grobbulus.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grobbulus +SD%Complete: 0 +SDComment: Place holder +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SPELL_BOMBARD_SLIME = 28280, + + SPELL_POISON_CLOUD = 28240, + SPELL_MUTATING_INJECTION = 28169, + SPELL_SLIME_SPRAY = 28157, + H_SPELL_SLIME_SPRAY = 54364, + SPELL_BERSERK = 26662, + + SPELL_POISON_CLOUD_DAMAGE = 59116, + + MOB_FALLOUT_SLIME = 16290, + MOB_GROBBOLUS_CLOUD = 16363, + +}; +struct MANGOS_DLL_DECL boss_grobbulusAI : public ScriptedAI +{ + boss_grobbulusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 PoisonCloud_Timer; + uint32 MutatingInjection_Timer; + uint32 SlimeSpray_Timer; + uint32 Enrage_Timer; + + void Reset() + { + PoisonCloud_Timer = 15000; + MutatingInjection_Timer = 20000; + SlimeSpray_Timer = 15000+rand()%15000; + Enrage_Timer = 720000; + + Despawnall(); + if (m_pInstance) + m_pInstance->SetData(TYPE_GROBBULUS, NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GROBBULUS, DONE); + Despawnall(); + } + + void Despawnall() + { + std::list m_pCloud; + GetCreatureListWithEntryInGrid(m_pCloud, m_creature, MOB_GROBBOLUS_CLOUD, DEFAULT_VISIBILITY_INSTANCE); + + if (!m_pCloud.empty()) + for(std::list::iterator itr = m_pCloud.begin(); itr != m_pCloud.end(); ++itr) + { + (*itr)->ForcedDespawn(); + } + + std::list m_pSpray; + GetCreatureListWithEntryInGrid(m_pSpray, m_creature, MOB_FALLOUT_SLIME, DEFAULT_VISIBILITY_INSTANCE); + + if (!m_pSpray.empty()) + for(std::list::iterator iter = m_pSpray.begin(); iter != m_pSpray.end(); ++iter) + { + (*iter)->ForcedDespawn(); + } + } + + void Aggro(Unit *who) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GROBBULUS, IN_PROGRESS); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if(spell->Id == SPELL_SLIME_SPRAY || spell->Id == H_SPELL_SLIME_SPRAY) + { + if (Creature* pTemp = m_creature->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000)) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + pTemp->AddThreat(pTarget,0.0f); + pTemp->AI()->AttackStart(pTarget); + } + } + if(spell->Id == H_SPELL_SLIME_SPRAY) + { + if (Creature* pTemp = m_creature->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000)) + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + pTemp->AddThreat(pTarget,0.0f); + pTemp->AI()->AttackStart(pTarget); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (PoisonCloud_Timer < diff) + { + DoCast(m_creature, SPELL_POISON_CLOUD); + PoisonCloud_Timer = 15000; + }else PoisonCloud_Timer -= diff; + + if (MutatingInjection_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + if (target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_MUTATING_INJECTION); + MutatingInjection_Timer = 20000; + } + }else MutatingInjection_Timer -= diff; + + if (SlimeSpray_Timer < diff) + { + DoCast(m_creature, m_bIsRegularMode ? SPELL_SLIME_SPRAY : H_SPELL_SLIME_SPRAY); + SlimeSpray_Timer = 15000+rand()%15000; + }else SlimeSpray_Timer -= diff; + + if (Enrage_Timer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + Enrage_Timer = 300000; + }else Enrage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL npc_grobbulus_poison_cloudAI : public Scripted_NoMovementAI +{ + npc_grobbulus_poison_cloudAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + Reset(); + } + + uint32 Cloud_Timer; + + void Reset() + { + Cloud_Timer = 1000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void UpdateAI(const uint32 diff) + { + if (Cloud_Timer < diff) + { + DoCast(m_creature, SPELL_POISON_CLOUD_DAMAGE); + Cloud_Timer = 10000; + }else Cloud_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_grobbulus(Creature* pCreature) +{ + return new boss_grobbulusAI(pCreature); +} + +CreatureAI* GetAI_npc_grobbulus_poison_cloud(Creature* pCreature) +{ + return new npc_grobbulus_poison_cloudAI(pCreature); +} + +void AddSC_boss_grobbulus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grobbulus"; + newscript->GetAI = &GetAI_boss_grobbulus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_grobbulus_poison_cloud"; + newscript->GetAI = &GetAI_npc_grobbulus_poison_cloud; + newscript->RegisterSelf(); +} + diff --git a/scripts/northrend/naxxramas/boss_heigan.cpp b/scripts/northrend/naxxramas/boss_heigan.cpp new file mode 100644 index 0000000..18eead9 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_heigan.cpp @@ -0,0 +1,510 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Heigan +SD%Complete: 65 +SDComment: Missing traps dance +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + PHASE_GROUND = 1, + PHASE_PLATFORM = 2, + + SAY_AGGRO1 = -1533109, + SAY_AGGRO2 = -1533110, + SAY_AGGRO3 = -1533111, + SAY_SLAY = -1533112, + SAY_TAUNT1 = -1533113, + SAY_TAUNT2 = -1533114, + SAY_TAUNT3 = -1533115, + SAY_TAUNT4 = -1533117, + SAY_CHANNELING = -1533116, + SAY_DEATH = -1533118, + EMOTE_TELEPORT = -1533136, + EMOTE_RETURN = -1533137, + + SPELL_ERUPTION = 29371, //Spell used by floor pieces to cause damage to players + + //Spells by boss + SPELL_DECREPIT_FEVER_N = 29998, + SPELL_DECREPIT_FEVER_H = 55011, + SPELL_DISRUPTION = 29310, + SPELL_TELEPORT_SELF = 30211, + SPELL_PLAGUE_CLOUD = 29350, + + //Spell by eye stalks + SPELL_MIND_FLAY = 26143, + + HEIGAN_TRIGGER = 45101 +}; + +#define POS_X 2793.86f +#define POS_Y -3707.38f +#define POS_Z 276.627f +#define POS_O 0.593f + +#define TRIGGER_X 2769.f +#define TRIGGER_Y -3671.f +#define TRIGGER_Z 273.667f +#define TRIGGER_O 0.f + + +struct MANGOS_DLL_DECL boss_heiganAI : public ScriptedAI +{ + boss_heiganAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Disruption_Timer; + uint32 Feaver_Timer; + uint32 Erupt_Timer; + uint32 Phase_Timer; + uint32 PlagueCloudTimer; + + uint32 eruptSection; + bool eruptDirection; + + uint8 phase; + + void Reset() + { + if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + phase = 0; + + if(m_pInstance) + m_pInstance->SetData(TYPE_HEIGAN, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if(phase != 1) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + DoStartMovement(pWho); + } + + } + void SetPhase(uint8 tPhase) + { + phase = tPhase; + if(phase == 1) + { + m_creature->InterruptNonMeleeSpells(false); + Feaver_Timer = 20000; + Phase_Timer = 90000; + Disruption_Timer = 5000+rand()%10000; + if(m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoStartMovement(m_creature->getVictim()); + }else if(phase == 2) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoCast(m_creature, SPELL_TELEPORT_SELF); + + Phase_Timer = 45000; + PlagueCloudTimer = 2000; + } + } + void Aggro(Unit *who) + { + m_creature->SummonCreature(HEIGAN_TRIGGER, TRIGGER_X, TRIGGER_Y, TRIGGER_Z, TRIGGER_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + SetPhase(1); + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if(m_pInstance) + m_pInstance->SetData(TYPE_HEIGAN, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if(m_pInstance) + m_pInstance->SetData(TYPE_HEIGAN, DONE); + } + + void UpdateAI(const uint32 diff) + { + if(phase == 0) + return; + + if (Phase_Timer < diff) + { + if ( phase == 1) + SetPhase(2); + else + SetPhase(1); + }else Phase_Timer -= diff; + + if ( phase == 2 && PlagueCloudTimer < diff) + { + DoCast(m_creature, SPELL_PLAGUE_CLOUD); + PlagueCloudTimer = 999999; + } + else + PlagueCloudTimer -= diff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || phase != 1) + return; + if (Disruption_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DISRUPTION); + Disruption_Timer = 5000+rand()%10000; + }else Disruption_Timer -= diff; + + if (Feaver_Timer < diff) + { + DoCast(m_creature->getVictim(), m_bIsRegularMode ? SPELL_DECREPIT_FEVER_N : SPELL_DECREPIT_FEVER_H); + Feaver_Timer = 30000+rand()%10000; + }else Feaver_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL npc_heigan_eruptionAI : public ScriptedAI +{ + npc_heigan_eruptionAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); + Reset(); + } + ScriptedInstance* pInstance; + + uint32 phase; + uint32 safeSpot; + uint32 fastTimer; + uint32 phaseTimer; + uint32 slowTimer; + bool forward; + std::list GetGameObjectsByEntry(uint32 entry) + { + CellPair pair(MaNGOS::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + std::list gameobjectList; + + AllGameObjectsWithEntryInRangeCheck check(m_creature, entry, 100); + MaNGOS::GameObjectListSearcher searcher(gameobjectList, check); + TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); + + cell.Visit(pair, visitor, *(m_creature->GetMap())); + + return gameobjectList; + } + //Let's Dance! + void DoErupt(uint32 safePlace) + { + uint64 heiganGUID = pInstance->GetData64(NPC_HEIGAN); + Map::PlayerList const &PlList = pInstance->instance->GetPlayers(); + if (PlList.isEmpty()) + return; + + if(safePlace != 1) + { + std::list eruptGOs = GetGameObjectsByEntry(181678); + //Visual part of eruption + for (int32 i = 181510; i <= 181526; i++) + { + if (i == 181513 || i == 181512 || i == 181511 || i == 181525 || i == 181514 || i == 181515 || i == 181516) + continue; + std::list visualGO = GetGameObjectsByEntry(i); + for (std::list::iterator itr = visualGO.begin(); itr != visualGO.end(); ++itr) + { + if((*itr)) + //Required GO Custom Animation Patch for this + { + WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); + data << (*itr)->GetGUID(); + data << 0; + (*itr)->SendMessageToSet(&data,true); + } + } + } + //Damage part of eruption + for (std::list::iterator itr = eruptGOs.begin(); itr != eruptGOs.end(); ++itr) + { + if(!(*itr)) + continue; + for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pPlayer->isGameMaster()) + continue; + + if (pPlayer->isAlive()) + { + if(pPlayer->GetDistance((*itr)) <= 4.0f) + //We use originalCaster for deal damage by Plague Fissure + pPlayer->CastSpell(pPlayer, SPELL_ERUPTION, true, 0, 0, m_creature->GetGUID()); } + } + } + } + } + //Change direction of dance + else forward = true; + if(safePlace != 2) + { + std::list eruptGOs = GetGameObjectsByEntry(181676); + for (int32 i = 181511; i <= 181531; i++) + { + if ((i > 181516 && i < 181525) || (i == 181526)) + continue; + std::list visualGO = GetGameObjectsByEntry(i); + for (std::list::iterator itr = visualGO.begin(); itr != visualGO.end(); ++itr) + { + if((*itr)) + { + WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); + data << (*itr)->GetGUID(); + data << 0; + (*itr)->SendMessageToSet(&data,true); + } + } + } + for (std::list::iterator itr = eruptGOs.begin(); itr != eruptGOs.end(); ++itr) + { + if(!(*itr)) + continue; + for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pPlayer->isGameMaster()) + continue; + + if (pPlayer->isAlive()) + { + if(pPlayer->GetDistance((*itr)) <= 4.0f) + pPlayer->CastSpell(pPlayer, SPELL_ERUPTION, true, 0, 0, m_creature->GetGUID()); } + } + } + } + } + if(safePlace != 3) + { + std::list eruptGOs = GetGameObjectsByEntry(181677); + for (int32 i = 181532; i <= 181545; i++) + { + if (i >= 181537 && i <= 181539) + continue; + std::list visualGO = GetGameObjectsByEntry(i); + for (std::list::iterator itr = visualGO.begin(); itr != visualGO.end(); ++itr) + { + if((*itr)) + { + WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); + data << (*itr)->GetGUID(); + data << 0; + (*itr)->SendMessageToSet(&data,true); + } + } + } + for (std::list::iterator itr = eruptGOs.begin(); itr != eruptGOs.end(); ++itr) + { + if(!(*itr)) + continue; + for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pPlayer->isGameMaster()) + continue; + + if (pPlayer->isAlive()) + { + if(pPlayer->GetDistance((*itr)) <= 4.0f) + pPlayer->CastSpell(pPlayer, SPELL_ERUPTION, true, 0, 0, m_creature->GetGUID()); } + } + } + } + } + if(safePlace != 4) + { + std::list eruptGOs = GetGameObjectsByEntry(181695); + for (int32 i = 181537; i <= 181552; i++) + { + if (i > 181539 && i < 181545) + continue; + std::list visualGO = GetGameObjectsByEntry(i); + for (std::list::iterator itr = visualGO.begin(); itr != visualGO.end(); ++itr) + { + if((*itr)) + { + WorldPacket data(SMSG_GAMEOBJECT_CUSTOM_ANIM,8+4); + data << (*itr)->GetGUID(); + data << 0; + (*itr)->SendMessageToSet(&data,true); + } + } + } + for (std::list::iterator itr = eruptGOs.begin(); itr != eruptGOs.end(); ++itr) + { + if(!(*itr)) + continue; + for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i) + { + if (Player* pPlayer = i->getSource()) + { + if (pPlayer->isGameMaster()) + continue; + + if (pPlayer->isAlive()) + { + if(pPlayer->GetDistance((*itr)) <= 4.0f) + pPlayer->CastSpell(pPlayer, SPELL_ERUPTION, true, 0, 0, m_creature->GetGUID()); + } + } + } + } + //Let's dance back! + }else forward=false; + } + + void Reset() + { + phase = 1; + safeSpot = 1; + fastTimer = 3500; + slowTimer = 10500; + phaseTimer = 90000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + void Aggro(Unit* who) + { + //This is just for dance. It doesn't attack anybody. + DoStopAttack(); + SetCombatMovement(false); + } + void UpdateAI(const uint32 diff) + { + if(m_creature->GetMapId() != 533) + return; + + if(pInstance->GetData(TYPE_HEIGAN) != IN_PROGRESS) + { + m_creature->ForcedDespawn(); + } + + if (phase == 1) + { + if(phaseTimer < diff) + { + // Let's fast dance + phase = 2; + phaseTimer = 45000; + safeSpot = 1; + } + else + { + phaseTimer-=diff; + if(slowTimer < diff) + { + DoErupt(safeSpot); + if(forward) + safeSpot++; + else + safeSpot--; + slowTimer = 10500; + }else slowTimer-=diff; + } + } + else if(phase == 2) + { + if(phaseTimer < diff) + { + // Slow dance again + phase = 1; + phaseTimer = 90000; + safeSpot = 1; + } + else + { + phaseTimer-=diff; + if(fastTimer < diff) + { + DoErupt(safeSpot); + if(forward) + safeSpot++; + else + safeSpot--; + fastTimer = 3500; + }else fastTimer-=diff; + } + } + } +}; + +CreatureAI* GetAI_boss_heigan(Creature* pCreature) +{ + return new boss_heiganAI(pCreature); +} + +CreatureAI* GetAI_npc_heigan_eruptionAI(Creature* pCreature) +{ + return new npc_heigan_eruptionAI(pCreature); +} + +void AddSC_boss_heigan() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_heigan"; + newscript->GetAI = &GetAI_boss_heigan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_heigan_eruption"; + newscript->GetAI = &GetAI_npc_heigan_eruptionAI; + newscript->RegisterSelf(); +} + diff --git a/scripts/northrend/naxxramas/boss_kelthuzad.cpp b/scripts/northrend/naxxramas/boss_kelthuzad.cpp new file mode 100644 index 0000000..2d0494d --- /dev/null +++ b/scripts/northrend/naxxramas/boss_kelthuzad.cpp @@ -0,0 +1,611 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_KelThuzad +SD%Complete: 75 +SDComment: Timers will need adjustments, along with tweaking positions and amounts +SDCategory: Naxxramas +EndScriptData */ + +// some not answered questions: +// - will intro mobs, not sent to center, despawn when phase 2 start? +// - what happens if raid fail, can they start the event as soon after as they want? + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + //when shappiron dies. dialog between kel and lich king (in this order) + SAY_SAPP_DIALOG1 = -1533084, + SAY_SAPP_DIALOG2_LICH = -1533085, + SAY_SAPP_DIALOG3 = -1533086, + SAY_SAPP_DIALOG4_LICH = -1533087, + SAY_SAPP_DIALOG5 = -1533088, + + //when cat dies + SAY_CAT_DIED = -1533089, + + SAY_SUMMON_MINIONS = -1533105, //start of phase 1 + + EMOTE_PHASE2 = -1533135, //start of phase 2 + SAY_AGGRO1 = -1533094, + SAY_AGGRO2 = -1533095, + SAY_AGGRO3 = -1533096, + + SAY_SLAY1 = -1533097, + SAY_SLAY2 = -1533098, + + SAY_DEATH = -1533099, + + SAY_CHAIN1 = -1533100, + SAY_CHAIN2 = -1533101, + SAY_FROST_BLAST = -1533102, + + SAY_REQUEST_AID = -1533103, //start of phase 3 + SAY_ANSWER_REQUEST = -1533104, //lich king answer + + SAY_SPECIAL1_MANA_DET = -1533106, + SAY_SPECIAL3_MANA_DET = -1533107, + SAY_SPECIAL2_DISPELL = -1533108, + + EMOTE_GUARDIAN = -1533134, // at each guardian summon + + //spells to be casted + SPELL_FROST_BOLT = 28478, + SPELL_FROST_BOLT_H = 55802, + SPELL_FROST_BOLT_NOVA = 28479, + SPELL_FROST_BOLT_NOVA_H = 55807, + + SPELL_CHAINS_OF_KELTHUZAD = 28408, // 3.x, heroic only + SPELL_CHAINS_OF_KELTHUZAD_TARGET = 28410, + + SPELL_MANA_DETONATION = 27819, + SPELL_SHADOW_FISSURE = 27810, + SPELL_FROST_BLAST = 27808, + + SPELL_CHANNEL_VISUAL = 29423, + + NPC_SHADOW_FISSURE = 16129, + + MAX_SOLDIER_COUNT = 71, + MAX_ABOMINATION_COUNT = 8, + MAX_BANSHEE_COUNT = 8, +}; + +static float M_F_ANGLE = 0.2f; // to adjust for map rotation +static float M_F_HEIGHT = 2.0f; // adjust for height difference +static float M_F_RANGE = 55.0f; // ~ range from center of chamber to center of alcove + +enum Phase +{ + PHASE_INTRO, + PHASE_NORMAL, + PHASE_GUARDIANS, +}; + +struct MANGOS_DLL_DECL boss_kelthuzadAI : public ScriptedAI +{ + boss_kelthuzadAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + + m_uiGuardiansCountMax = m_bIsRegularMode ? 2 : 4; + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiGuardiansCount; + uint32 m_uiGuardiansCountMax; + uint32 m_uiGuardiansTimer; + uint32 m_uiFrostBoltTimer; + uint32 m_uiFrostBoltNovaTimer; + uint32 m_uiChainsTimer; + uint32 m_uiManaDetonationTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiFrostBlastTimer; + uint32 m_uiShadowFissureActiveTimer; + + uint32 m_uiPhase1Timer; + uint32 m_uiSoldierTimer; + uint32 m_uiBansheeTimer; + uint32 m_uiAbominationTimer; + uint8 m_uiPhase; + uint32 m_uiSoldierCount; + uint32 m_uiBansheeCount; + uint32 m_uiAbominationCount; + uint32 m_uiSummonIntroTimer; + uint32 m_uiIntroPackCount; + + std::set m_lIntroMobsSet; + std::set m_lAddsSet; + + void Reset() + { + m_uiFrostBoltTimer = urand(1000, 60000); //It won't be more than a minute without cast it + m_uiFrostBoltNovaTimer = 15000; //Cast every 15 seconds + m_uiChainsTimer = urand(30000, 60000); //Cast no sooner than once every 30 seconds + m_uiManaDetonationTimer = 20000; //Seems to cast about every 20 seconds + m_uiShadowFissureTimer = 25000; //25 seconds + m_uiFrostBlastTimer = urand(30000, 60000); //Random time between 30-60 seconds + m_uiGuardiansTimer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3 + m_uiGuardiansCount = 0; + m_uiSummonIntroTimer = 0; + m_uiIntroPackCount = 0; + m_uiShadowFissureActiveTimer = 0; + + m_uiPhase1Timer = 228000; //Phase 1 lasts "3 minutes and 48 seconds" + m_uiSoldierTimer = 5000; + m_uiBansheeTimer = 5000; + m_uiAbominationTimer = 5000; + m_uiSoldierCount = 0; + m_uiBansheeCount = 0; + m_uiAbominationCount = 0; + m_uiPhase = PHASE_INTRO; + + // it may be some spell should be used instead, to control the intro phase + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + SetCombatMovement(false); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + if (urand(0, 1)) + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnAdds(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KELTHUZAD, DONE); + } + + void JustReachedHome() + { + DespawnIntroCreatures(); + DespawnAdds(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KELTHUZAD, NOT_STARTED); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KELTHUZAD) != IN_PROGRESS) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void DespawnIntroCreatures() + { + if (m_pInstance) + { + for(std::set::const_iterator itr = m_lIntroMobsSet.begin(); itr != m_lIntroMobsSet.end(); ++itr) + { + if (Creature* pCreature = m_pInstance->instance->GetCreature(*itr)) + pCreature->ForcedDespawn(); + } + } + + m_lIntroMobsSet.clear(); + } + + void DespawnAdds() + { + if (m_pInstance) + { + for(std::set::const_iterator itr = m_lAddsSet.begin(); itr != m_lAddsSet.end(); ++itr) + { + if (Creature* pCreature = m_pInstance->instance->GetCreature(*itr)) + { + if (pCreature->isAlive()) + { + pCreature->AI()->EnterEvadeMode(); + pCreature->ForcedDespawn(15000); + } + } + } + } + + m_lAddsSet.clear(); + } + + float GetLocationAngle(uint32 uiId) + { + switch(uiId) + { + case 1: return M_PI_F - M_F_ANGLE; // south + case 2: return M_PI_F / 2 * 3 - M_F_ANGLE; // east + case 3: return M_PI_F / 2 - M_F_ANGLE; // west + case 4: return M_PI_F / 4 - M_F_ANGLE; // north-west + case 5: return M_PI_F / 4 * 7 - M_F_ANGLE; // north-east + case 6: return M_PI_F / 4 * 5 - M_F_ANGLE; // south-east + case 7: return M_PI_F / 4 * 3 - M_F_ANGLE; // south-west + } + + return M_F_ANGLE; + } + + void SummonIntroCreatures(uint32 packId) + { + if (!m_pInstance) + return; + + float fAngle = GetLocationAngle(packId+1); + + float fX, fY, fZ; + m_pInstance->GetChamberCenterCoords(fX, fY, fZ); + + fX += M_F_RANGE * cos(fAngle); + fY += M_F_RANGE * sin(fAngle); + fZ += M_F_HEIGHT; + + MaNGOS::NormalizeMapCoord(fX); + MaNGOS::NormalizeMapCoord(fY); + + uint32 uiNpcEntry = NPC_SOUL_WEAVER; + + for(uint8 uiI = 0; uiI < 14; ++uiI) + { + if (uiI > 0) + { + if (uiI < 4) + uiNpcEntry = NPC_UNSTOPPABLE_ABOM; + else + uiNpcEntry = NPC_SOLDIER_FROZEN; + } + + float fNewX, fNewY, fNewZ; + m_creature->GetRandomPoint(fX, fY, fZ, 12.0f, fNewX, fNewY, fNewZ); + + m_creature->SummonCreature(uiNpcEntry, fNewX, fNewY, fNewZ, fAngle + M_PI_F, TEMPSUMMON_CORPSE_DESPAWN, 5000); + } + } + + void SummonMob(uint32 uiType) + { + if (!m_pInstance) + return; + + float fAngle = GetLocationAngle(urand(1, 7)); + + float fX, fY, fZ; + m_pInstance->GetChamberCenterCoords(fX, fY, fZ); + + fX += M_F_RANGE * cos(fAngle); + fY += M_F_RANGE * sin(fAngle); + fZ += M_F_HEIGHT; + + MaNGOS::NormalizeMapCoord(fX); + MaNGOS::NormalizeMapCoord(fY); + + m_creature->SummonCreature(uiType, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 5000); + } + + void JustSummoned(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_GUARDIAN: + { + DoScriptText(EMOTE_GUARDIAN, m_creature); + + m_lAddsSet.insert(pSummoned->GetGUID()); + ++m_uiGuardiansCount; + + pSummoned->SetInCombatWithZone(); + break; + } + case NPC_SOLDIER_FROZEN: + case NPC_UNSTOPPABLE_ABOM: + case NPC_SOUL_WEAVER: + { + if (m_uiIntroPackCount < 7) + m_lIntroMobsSet.insert(pSummoned->GetGUID()); + else + { + m_lAddsSet.insert(pSummoned->GetGUID()); + + if(m_pInstance) + { + float fX, fY, fZ; + m_pInstance->GetChamberCenterCoords(fX, fY, fZ); + pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ); + } + } + + break; + } + } + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_GUARDIAN: + case NPC_SOLDIER_FROZEN: + case NPC_UNSTOPPABLE_ABOM: + case NPC_SOUL_WEAVER: + m_lAddsSet.erase(pSummoned->GetGUID()); + break; + } + } + + void SummonedMovementInform(Creature* pSummoned, uint32 uiMotionType, uint32 uiPointId) + { + if (uiMotionType == POINT_MOTION_TYPE && uiPointId == 0) + pSummoned->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_pInstance || m_pInstance->GetData(TYPE_KELTHUZAD) != IN_PROGRESS) + return; + + if (m_uiPhase == PHASE_INTRO) + { + if (m_uiIntroPackCount < 7) + { + if (m_uiSummonIntroTimer < uiDiff) + { + if (!m_uiIntroPackCount) + DoScriptText(SAY_SUMMON_MINIONS, m_creature); + + SummonIntroCreatures(m_uiIntroPackCount); + ++m_uiIntroPackCount; + m_uiSummonIntroTimer = 2000; + } + else + m_uiSummonIntroTimer -= uiDiff; + } + else + { + if (m_uiPhase1Timer < uiDiff) + { + m_uiPhase = PHASE_NORMAL; + DespawnIntroCreatures(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + SetCombatMovement(true); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + DoScriptText(EMOTE_PHASE2, m_creature); + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + }; + } + else + m_uiPhase1Timer -= uiDiff; + + if (m_uiSoldierCount < MAX_SOLDIER_COUNT) + { + if (m_uiSoldierTimer < uiDiff) + { + SummonMob(NPC_SOLDIER_FROZEN); + ++m_uiSoldierCount; + m_uiSoldierTimer = 3000; + } + else + m_uiSoldierTimer -= uiDiff; + } + + if (m_uiAbominationCount < MAX_ABOMINATION_COUNT) + { + if (m_uiAbominationTimer < uiDiff) + { + SummonMob(NPC_UNSTOPPABLE_ABOM); + ++m_uiAbominationCount; + m_uiAbominationTimer = 25000; + } + else + m_uiAbominationTimer -= uiDiff; + } + + if (m_uiBansheeCount < MAX_BANSHEE_COUNT) + { + if (m_uiBansheeTimer < uiDiff) + { + SummonMob(NPC_SOUL_WEAVER); + ++m_uiBansheeCount; + m_uiBansheeTimer = 25000; + } + else + m_uiBansheeTimer -= uiDiff; + } + } + } + else // normal or guardian phase + { + if (m_uiFrostBoltTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FROST_BOLT : SPELL_FROST_BOLT_H) == CAST_OK) + m_uiFrostBoltTimer = urand(1000, 60000); + } + else + m_uiFrostBoltTimer -= uiDiff; + + if (m_uiFrostBoltNovaTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FROST_BOLT_NOVA : SPELL_FROST_BOLT_NOVA_H) == CAST_OK) + m_uiFrostBoltNovaTimer = 15000; + } + else + m_uiFrostBoltNovaTimer -= uiDiff; + + //Check for Mana Detonation + if (m_uiManaDetonationTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + if (pTarget->getPowerType() == POWER_MANA) + { + int32 curPower = pTarget->GetPower(POWER_MANA); + if (curPower < (m_bIsRegularMode ? 4000 : 5500)) + return; + + m_creature->CastSpell(pTarget,SPELL_MANA_DETONATION, true); + int32 manareduction = m_bIsRegularMode ? urand(2500,4000) : urand(3500,5500); + int32 mana = curPower - manareduction; + pTarget->SetPower(POWER_MANA, mana); + + Map *map = m_creature->GetMap(); + if (map->IsDungeon()) + { + Map::PlayerList const &PlayerList = map->GetPlayers(); + + if (!PlayerList.isEmpty()) + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && pTarget->GetDistance2d(i->getSource()->GetPositionX(), i->getSource()->GetPositionY()) < 15) + i->getSource()->DealDamage(i->getSource(), manareduction, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true); + } + } + } + + if (rand()%2) + DoScriptText(SAY_SPECIAL1_MANA_DET, m_creature); + + m_uiManaDetonationTimer = 15000; + }else m_uiManaDetonationTimer -= uiDiff; + + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + m_creature->CastSpell(pTarget,SPELL_SHADOW_FISSURE,true); + m_uiShadowFissureActiveTimer = 3000; + if (urand(0, 1)) + DoScriptText(SAY_SPECIAL3_MANA_DET, m_creature); + } + } + m_uiShadowFissureTimer = m_bIsRegularMode ? 25000: 10000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + if(m_uiShadowFissureActiveTimer) + if(m_uiShadowFissureActiveTimer < uiDiff) + { + // hack for shadow fissure + // TODO: find energy beam visual spell + m_uiShadowFissureActiveTimer = 0; + + Creature* pFissure = GetClosestCreatureWithEntry(m_creature, NPC_SHADOW_FISSURE, 100.0f); + + if(!pFissure) + return; + + Map::PlayerList const& pPlayers = m_creature->GetMap()->GetPlayers(); + for (Map::PlayerList::const_iterator itr = pPlayers.begin(); itr != pPlayers.end(); ++itr) + if(itr->getSource()->GetDistance2d(pFissure) < 2.0f) + pFissure->DealDamage(itr->getSource(),itr->getSource()->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else + m_uiShadowFissureActiveTimer -= uiDiff; + + if (m_uiFrostBlastTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_BLAST) == CAST_OK) + { + if (urand(0, 1)) + DoScriptText(SAY_FROST_BLAST, m_creature); + + m_uiFrostBlastTimer = urand(30000, 60000); + } + } + else + m_uiFrostBlastTimer -= uiDiff; + + // not sure if this is right + //if (!m_bIsRegularMode) + //{ + if (m_uiChainsTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAINS_OF_KELTHUZAD) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_CHAIN1 : SAY_CHAIN2, m_creature); + + m_uiChainsTimer = urand(30000, 60000); + } + } + else + m_uiChainsTimer -= uiDiff; + //} + + if (m_uiPhase == PHASE_NORMAL) + { + if (m_creature->GetHealthPercent() < 45.0f) + { + m_uiPhase = PHASE_GUARDIANS; + DoScriptText(SAY_REQUEST_AID, m_creature); + + // here Lich King should respond to Kel'Thuzad but I don't know which creature to make talk + // so for now just make Kel'Thuzad says it. + DoScriptText(SAY_ANSWER_REQUEST, m_creature); + } + } + else if (m_uiPhase == PHASE_GUARDIANS && m_uiGuardiansCount < m_uiGuardiansCountMax) + { + if (m_uiGuardiansTimer < uiDiff) + { + // Summon a Guardian of Icecrown in a random alcove + SummonMob(NPC_GUARDIAN); + m_uiGuardiansTimer = 5000; + } + else + m_uiGuardiansTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_kelthuzad(Creature* pCreature) +{ + return new boss_kelthuzadAI(pCreature); +} + +void AddSC_boss_kelthuzad() +{ + Script* NewScript; + + NewScript = new Script; + NewScript->Name = "boss_kelthuzad"; + NewScript->GetAI = &GetAI_boss_kelthuzad; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_loatheb.cpp b/scripts/northrend/naxxramas/boss_loatheb.cpp new file mode 100644 index 0000000..ef2206b --- /dev/null +++ b/scripts/northrend/naxxramas/boss_loatheb.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Loatheb +SD%Complete: 100 +SDComment: +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + EMOTE_AURA_BLOCKING = -1533143, + EMOTE_AURA_WANE = -1533144, + EMOTE_AURA_FADING = -1533145, + //spells Loatheb + SPELL_DEATHBLOOM = 29865, + SPELL_DEATHBLOOM_H = 55053, + SPELL_INEVITABLE_DOOM = 29204, + SPELL_INEVITABLE_DOOM_H = 55052, + SPELL_NECROTIC_AURA = 55593, + SPELL_SUMMON_SPORE = 29234, + SPELL_BERSERK = 26662, + //spells Spore + SPELL_FUNGAL_CREEP = 29232, + + NPC_SPORE = 16286 +}; + +struct MANGOS_DLL_DECL boss_loathebAI : public ScriptedAI +{ + boss_loathebAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiDeathbloomTimer; + uint32 m_uiNecroticAuraTimer; + uint32 m_uiInevitableDoomTimer; + uint32 m_uiSummonTimer; + uint32 m_uiBerserkTimer; + uint8 m_uiNecroticAuraCount; // Used for emotes, 5min check + + void Reset() + { + m_uiDeathbloomTimer = 5000; + m_uiNecroticAuraTimer = 12000; + m_uiInevitableDoomTimer = MINUTE*2*IN_MILLISECONDS; + m_uiSummonTimer = urand(10000, 15000); // first seen in vid after approx 12s + m_uiBerserkTimer = MINUTE*12*IN_MILLISECONDS; // only in heroic, after 12min + m_uiNecroticAuraCount = 0; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_LOATHEB, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_LOATHEB, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_LOATHEB, NOT_STARTED); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Berserk (only heroic) + if (!m_bIsRegularMode) + { + if (m_uiBerserkTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + m_uiBerserkTimer = 300000; + } + else + m_uiBerserkTimer -= uiDiff; + } + + // Inevitable Doom + if (m_uiInevitableDoomTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_INEVITABLE_DOOM : SPELL_INEVITABLE_DOOM_H); + m_uiInevitableDoomTimer = (m_uiNecroticAuraCount <= 40) ? 30000 : 15000; + } + else + m_uiInevitableDoomTimer -= uiDiff; + + // Necrotic Aura + if (m_uiNecroticAuraTimer < uiDiff) + { + switch (m_uiNecroticAuraCount % 3) + { + case 0: + DoCastSpellIfCan(m_creature, SPELL_NECROTIC_AURA); + DoScriptText(EMOTE_AURA_BLOCKING, m_creature); + m_uiNecroticAuraTimer = 14000; + break; + case 1: + DoScriptText(EMOTE_AURA_WANE, m_creature); + m_uiNecroticAuraTimer = 3000; + break; + case 2: + DoScriptText(EMOTE_AURA_FADING, m_creature); + m_uiNecroticAuraTimer = 3000; + break; + } + m_uiNecroticAuraCount++; + } + else + m_uiNecroticAuraTimer -= uiDiff; + + // Summon + if (m_uiSummonTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SPORE); + m_uiSummonTimer = m_bIsRegularMode ? 36000 : 18000; + } + else + m_uiSummonTimer -= uiDiff; + + // Deathbloom + if (m_uiDeathbloomTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DEATHBLOOM : SPELL_DEATHBLOOM_H); + m_uiDeathbloomTimer = 30000; + } + else + m_uiDeathbloomTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_loatheb(Creature* pCreature) +{ + return new boss_loathebAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_sporeAI : public ScriptedAI +{ + mob_sporeAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + void Reset() + { + if (Creature* loatheb = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_LOATHEB))) + if (Unit* pTarget = loatheb->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + m_creature->AddThreat(pTarget, 0); + + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* pKiller) + { + m_creature->CastSpell(m_creature, SPELL_FUNGAL_CREEP, true); + } + +}; + + +CreatureAI* GetAI_mob_spore(Creature* pCreature) +{ + return new mob_sporeAI(pCreature); +} + +void AddSC_boss_loatheb() +{ + Script* NewScript; + NewScript = new Script; + NewScript->Name = "boss_loatheb"; + NewScript->GetAI = &GetAI_boss_loatheb; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "mob_spore"; + NewScript->GetAI = &GetAI_mob_spore; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_maexxna.cpp b/scripts/northrend/naxxramas/boss_maexxna.cpp new file mode 100644 index 0000000..a6e3a6c --- /dev/null +++ b/scripts/northrend/naxxramas/boss_maexxna.cpp @@ -0,0 +1,307 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Maexxna +SD%Complete: 70 +SDComment: Need to correct web wrap ability +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + EMOTE_SPIN_WEB = -1533146, + EMOTE_SPIDERLING = -1533147, + EMOTE_SPRAY = -1533148, + EMOTE_BOSS_GENERIC_FRENZY = -1000005, + + SPELL_WEBWRAP = 28622, //Spell is normally used by the webtrap on the wall NOT by Maexxna + + SPELL_WEBSPRAY = 29484, + SPELL_WEBSPRAY_H = 54125, + + SPELL_POISONSHOCK = 28741, + SPELL_POISONSHOCK_H = 54122, + + SPELL_NECROTICPOISON = 28776, + SPELL_NECROTICPOISON_H = 54121, + + SPELL_FRENZY = 54123, + SPELL_FRENZY_H = 54124, + + NPC_WEB_WRAP = 16486, + NPC_SPIDERLING = 17055 +}; + +#define LOC_X1 3546.796f +#define LOC_Y1 -3869.082f +#define LOC_Z1 296.450f + +#define LOC_X2 3531.271f +#define LOC_Y2 -3847.424f +#define LOC_Z2 299.450f + +#define LOC_X3 3497.067f +#define LOC_Y3 -3843.384f +#define LOC_Z3 302.384f + +struct MANGOS_DLL_DECL npc_web_wrapAI : public ScriptedAI +{ + npc_web_wrapAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint64 m_uiVictimGUID; + + void Reset() + { + m_uiVictimGUID = 0; + } + + void MoveInLineOfSight(Unit* pWho) { } + void AttackStart(Unit* pWho) { } + + void SetVictim(Unit* pVictim) + { + if (pVictim) + { + m_uiVictimGUID = pVictim->GetGUID(); + pVictim->CastSpell(pVictim, SPELL_WEBWRAP, true); + } + } + + void JustDied(Unit* pKiller) + { + if (m_uiVictimGUID) + { + if (Player* pVictim = m_creature->GetMap()->GetPlayer(m_uiVictimGUID)) + { + if (pVictim->isAlive()) + pVictim->RemoveAurasDueToSpell(SPELL_WEBWRAP); + } + } + } +}; + +struct MANGOS_DLL_DECL boss_maexxnaAI : public ScriptedAI +{ + boss_maexxnaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiWebWrapTimer; + uint32 m_uiWebSprayTimer; + uint32 m_uiPoisonShockTimer; + uint32 m_uiNecroticPoisonTimer; + uint32 m_uiSummonSpiderlingTimer; + bool m_bEnraged; + + void Reset() + { + m_uiWebWrapTimer = 20000; // 20 sec init, 40 sec normal + m_uiWebSprayTimer = 40000; // 40 seconds + m_uiPoisonShockTimer = 20000; // 20 seconds + m_uiNecroticPoisonTimer = 30000; // 30 seconds + m_uiSummonSpiderlingTimer = 30000; // 30 sec init, 40 sec normal + m_bEnraged = false; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MAEXXNA, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MAEXXNA, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MAEXXNA, FAIL); + } + + void DoCastWebWrap() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + std::vector targets; + + // This spell doesn't work if we only have 1 player on threat list + if (tList.size() < 2) + return; + + // begin + 1 , so we don't target the one with the highest threat + ThreatList::const_iterator itr = tList.begin(); + std::advance(itr, 1); + + // store the threat list in a different container + for (;itr != tList.end(); ++itr) + { + Unit* target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + // only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + // cut down to size if we have more than 3 targets + while(targets.size() > m_bIsRegularMode ? 1 : 3) + targets.erase(targets.begin()+rand()%targets.size()); + + int i = 0; + + for(std::vector::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i) + { + // Teleport the 3 targets to a location on the wall and summon a Web Wrap on them + switch(i) + { + case 0: + DoTeleportPlayer((*iter), LOC_X1, LOC_Y1, LOC_Z1, (*iter)->GetOrientation()); + if (Creature* pWrap = m_creature->SummonCreature(NPC_WEB_WRAP, LOC_X1, LOC_Y1, LOC_Z1, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) + { + if (npc_web_wrapAI* pWebAI = dynamic_cast(pWrap->AI())) + pWebAI->SetVictim(*iter); + } + break; + case 1: + DoTeleportPlayer((*iter), LOC_X2, LOC_Y2, LOC_Z2, (*iter)->GetOrientation()); + if (Creature* pWrap = m_creature->SummonCreature(NPC_WEB_WRAP, LOC_X2, LOC_Y2, LOC_Z2, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) + { + if (npc_web_wrapAI* pWebAI = dynamic_cast(pWrap->AI())) + pWebAI->SetVictim(*iter); + } + break; + case 2: + DoTeleportPlayer((*iter), LOC_X3, LOC_Y3, LOC_Z3, (*iter)->GetOrientation()); + if (Creature* pWrap = m_creature->SummonCreature(NPC_WEB_WRAP, LOC_X3, LOC_Y3, LOC_Z3, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000)) + { + if (npc_web_wrapAI* pWebAI = dynamic_cast(pWrap->AI())) + pWebAI->SetVictim(*iter); + } + break; + } + } + } + + void SummonSpiderlings() + { + for(uint8 i = 0; i < 8; ++i) + m_creature->SummonCreature(NPC_SPIDERLING, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Web Wrap + if (m_uiWebWrapTimer < uiDiff) + { + DoCastWebWrap(); + DoScriptText(EMOTE_SPIN_WEB, m_creature); + m_uiWebWrapTimer = 40000; + } + else + m_uiWebWrapTimer -= uiDiff; + + // Web Spray + if (m_uiWebSprayTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_WEBSPRAY : SPELL_WEBSPRAY_H) == CAST_OK) + { + DoScriptText(EMOTE_SPRAY, m_creature); + m_uiWebSprayTimer = 40000; + } + } + else + m_uiWebSprayTimer -= uiDiff; + + // Poison Shock + if (m_uiPoisonShockTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_POISONSHOCK : SPELL_POISONSHOCK_H); + m_uiPoisonShockTimer = 20000; + } + else + m_uiPoisonShockTimer -= uiDiff; + + // Necrotic Poison + if (m_uiNecroticPoisonTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_NECROTICPOISON : SPELL_NECROTICPOISON_H); + m_uiNecroticPoisonTimer = 30000; + } + else + m_uiNecroticPoisonTimer -= uiDiff; + + // Summon Spiderling + if (m_uiSummonSpiderlingTimer < uiDiff) + { + SummonSpiderlings(); + DoScriptText(EMOTE_SPIDERLING, m_creature); + m_uiSummonSpiderlingTimer = 40000; + } + else + m_uiSummonSpiderlingTimer -= uiDiff; + + // Enrage if not already enraged and below 30% + if (!m_bEnraged && m_creature->GetHealthPercent() < 30.0f) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FRENZY : SPELL_FRENZY_H) == CAST_OK) + { + DoScriptText(EMOTE_BOSS_GENERIC_FRENZY, m_creature); + m_bEnraged = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_web_wrap(Creature* pCreature) +{ + return new npc_web_wrapAI(pCreature); +} + +CreatureAI* GetAI_boss_maexxna(Creature* pCreature) +{ + return new boss_maexxnaAI(pCreature); +} + +void AddSC_boss_maexxna() +{ + Script* NewScript; + + NewScript = new Script; + NewScript->Name = "boss_maexxna"; + NewScript->GetAI = &GetAI_boss_maexxna; + NewScript->RegisterSelf(); + + NewScript = new Script; + NewScript->Name = "npc_web_wrap"; + NewScript->GetAI = &GetAI_npc_web_wrap; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_noth.cpp b/scripts/northrend/naxxramas/boss_noth.cpp new file mode 100644 index 0000000..d0bbc08 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_noth.cpp @@ -0,0 +1,314 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Noth +SD%Complete: 60 +SDComment: Summons need tuning, timers need tuning, need to add berserk "phase" after last skeleton phase +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SAY_AGGRO1 = -1533075, + SAY_AGGRO2 = -1533076, + SAY_AGGRO3 = -1533077, + SAY_SUMMON = -1533078, + SAY_SLAY1 = -1533079, + SAY_SLAY2 = -1533080, + SAY_DEATH = -1533081, + + EMOTE_WARRIOR = -1533130, + EMOTE_SKELETON = -1533131, + EMOTE_TELEPORT = -1533132, + EMOTE_TELEPORT_RETURN = -1533133, + + SPELL_TELEPORT = 29216, + SPELL_TELEPORT_RETURN = 29231, + + SPELL_BLINK_1 = 29208, + SPELL_BLINK_2 = 29209, + SPELL_BLINK_3 = 29210, + SPELL_BLINK_4 = 29211, + + SPELL_CRIPPLE = 29212, + SPELL_CRIPPLE_H = 54814, + SPELL_CURSE_PLAGUEBRINGER = 29213, + SPELL_CURSE_PLAGUEBRINGER_H = 54835, + + SPELL_SUMMON_WARRIOR_1 = 29247, + SPELL_SUMMON_WARRIOR_2 = 29248, + SPELL_SUMMON_WARRIOR_3 = 29249, + + SPELL_SUMMON_WARRIOR_THREE = 29237, + + SPELL_SUMMON_CHAMP01 = 29217, + SPELL_SUMMON_CHAMP02 = 29224, + SPELL_SUMMON_CHAMP03 = 29225, + SPELL_SUMMON_CHAMP04 = 29227, + SPELL_SUMMON_CHAMP05 = 29238, + SPELL_SUMMON_CHAMP06 = 29255, + SPELL_SUMMON_CHAMP07 = 29257, + SPELL_SUMMON_CHAMP08 = 29258, + SPELL_SUMMON_CHAMP09 = 29262, + SPELL_SUMMON_CHAMP10 = 29267, + + SPELL_SUMMON_GUARD01 = 29226, + SPELL_SUMMON_GUARD02 = 29239, + SPELL_SUMMON_GUARD03 = 29256, + SPELL_SUMMON_GUARD04 = 29268, + + PHASE_GROUND = 0, + PHASE_BALCONY = 1, + + PHASE_SKELETON_1 = 1, + PHASE_SKELETON_2 = 2, + PHASE_SKELETON_3 = 3 +}; + +struct MANGOS_DLL_DECL boss_nothAI : public ScriptedAI +{ + boss_nothAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint8 m_uiPhase; + uint8 m_uiPhaseSub; + uint32 m_uiPhaseTimer; + + uint32 m_uiBlinkTimer; + uint32 m_uiCurseTimer; + uint32 m_uiSummonTimer; + + void Reset() + { + m_uiPhase = PHASE_GROUND; + m_uiPhaseSub = PHASE_GROUND; + m_uiPhaseTimer = 110000; + + m_uiBlinkTimer = 25000; + m_uiCurseTimer = 4000; + m_uiSummonTimer = 30000; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_NOTH, IN_PROGRESS); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->SetInCombatWithZone(); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_NOTH, DONE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NOTH, FAIL); + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pCaster == m_creature && pSpell->Effect[EFFECT_INDEX_0] == SPELL_EFFECT_LEAP) + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_CRIPPLE : SPELL_CRIPPLE_H); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiPhase == PHASE_GROUND) + { + if (m_uiPhaseTimer < uiDiff) + { + // TODO: avoid teleport when skeleton phases is ended + + if (DoCastSpellIfCan(m_creature, SPELL_TELEPORT) == CAST_OK) + { + DoScriptText(EMOTE_TELEPORT, m_creature); + m_creature->GetMotionMaster()->MoveIdle(); + m_uiPhaseTimer = 70000; + m_uiPhase = PHASE_BALCONY; + ++m_uiPhaseSub; + return; + } + } + else + m_uiPhaseTimer -= uiDiff; + + if (m_bIsRegularMode) + { + if (m_uiBlinkTimer < uiDiff) + { + static uint32 const auiSpellBlink[4] = + { + SPELL_BLINK_1, SPELL_BLINK_2, SPELL_BLINK_3, SPELL_BLINK_4 + }; + + if (DoCastSpellIfCan(m_creature, auiSpellBlink[urand(0,3)]) == CAST_OK) + { + DoResetThreat(); + m_uiBlinkTimer = 25000; + } + } + else + m_uiBlinkTimer -= uiDiff; + } + + if (m_uiCurseTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_CURSE_PLAGUEBRINGER : SPELL_CURSE_PLAGUEBRINGER_H); + m_uiCurseTimer = 28000; + } + else + m_uiCurseTimer -= uiDiff; + + if (m_uiSummonTimer < uiDiff) + { + DoScriptText(SAY_SUMMON, m_creature); + DoScriptText(EMOTE_WARRIOR, m_creature); + + if (m_bIsRegularMode) + { + static uint32 const auiSpellSummonPlaguedWarrior[3] = + { + SPELL_SUMMON_WARRIOR_1, SPELL_SUMMON_WARRIOR_2, SPELL_SUMMON_WARRIOR_3 + }; + + for(uint8 i = 0; i < 2; ++i) + DoCastSpellIfCan(m_creature, auiSpellSummonPlaguedWarrior[urand(0,2)], CAST_TRIGGERED); + } + else + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_WARRIOR_THREE, CAST_TRIGGERED); + } + + m_uiSummonTimer = 30000; + } + else + m_uiSummonTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + else + { + if (m_uiPhaseTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_TELEPORT_RETURN) == CAST_OK) + { + DoScriptText(EMOTE_TELEPORT_RETURN, m_creature); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_uiPhaseTimer = 90000; + m_uiPhase = PHASE_GROUND; + return; + } + } + else + m_uiPhaseTimer -= uiDiff; + + if (m_uiSummonTimer < uiDiff) + { + DoScriptText(EMOTE_SKELETON, m_creature); + + static uint32 const auiSpellSummonPlaguedChampion[10] = + { + SPELL_SUMMON_CHAMP01, SPELL_SUMMON_CHAMP02, SPELL_SUMMON_CHAMP03, SPELL_SUMMON_CHAMP04, SPELL_SUMMON_CHAMP05, SPELL_SUMMON_CHAMP06, SPELL_SUMMON_CHAMP07, SPELL_SUMMON_CHAMP08, SPELL_SUMMON_CHAMP09, SPELL_SUMMON_CHAMP10 + }; + + static uint32 const auiSpellSummonPlaguedGuardian[4] = + { + SPELL_SUMMON_GUARD01, SPELL_SUMMON_GUARD02, SPELL_SUMMON_GUARD03, SPELL_SUMMON_GUARD04 + }; + + // A bit unclear how many in each sub phase, and if there are any clear difference in 25man + switch(m_uiPhaseSub) + { + case PHASE_SKELETON_1: + { + for(uint8 i = 0; i < 2; ++i) + DoCastSpellIfCan(m_creature, auiSpellSummonPlaguedChampion[urand(0,9)], CAST_TRIGGERED); + + break; + } + case PHASE_SKELETON_2: + { + DoCastSpellIfCan(m_creature, auiSpellSummonPlaguedChampion[urand(0,9)], CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, auiSpellSummonPlaguedGuardian[urand(0,3)], CAST_TRIGGERED); + break; + } + case PHASE_SKELETON_3: + { + for(uint8 i = 0; i < 2; ++i) + DoCastSpellIfCan(m_creature, auiSpellSummonPlaguedGuardian[urand(0,3)], CAST_TRIGGERED); + + break; + } + } + + m_uiSummonTimer = 30000; + } + else + m_uiSummonTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_boss_noth(Creature* pCreature) +{ + return new boss_nothAI(pCreature); +} + +void AddSC_boss_noth() +{ + Script* NewScript; + NewScript = new Script; + NewScript->Name = "boss_noth"; + NewScript->GetAI = &GetAI_boss_noth; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_patchwerk.cpp b/scripts/northrend/naxxramas/boss_patchwerk.cpp new file mode 100644 index 0000000..42f8d9b --- /dev/null +++ b/scripts/northrend/naxxramas/boss_patchwerk.cpp @@ -0,0 +1,195 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Patchwerk +SD%Complete: 100 +SDComment: +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SAY_AGGRO1 = -1533017, + SAY_AGGRO2 = -1533018, + SAY_SLAY = -1533019, + SAY_DEATH = -1533020, + + EMOTE_BERSERK = -1533021, + EMOTE_ENRAGE = -1533022, + + SPELL_HATEFULSTRIKE = 28308, + SPELL_HATEFULSTRIKE_H = 59192, + SPELL_ENRAGE = 28131, + SPELL_BERSERK = 26662, + SPELL_SLIMEBOLT = 32309 +}; + +struct MANGOS_DLL_DECL boss_patchwerkAI : public ScriptedAI +{ + boss_patchwerkAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiHatefulStrikeTimer; + uint32 m_uiBerserkTimer; + uint32 m_uiSlimeboltTimer; + bool m_bEnraged; + bool m_bBerserk; + + void Reset() + { + m_uiHatefulStrikeTimer = 1000; //1 second + m_uiBerserkTimer = MINUTE*6*IN_MILLISECONDS; //6 minutes + m_uiSlimeboltTimer = 10000; + m_bEnraged = false; + m_bBerserk = false; + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 4)) + return; + + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_PATCHWERK, DONE); + } + + void Aggro(Unit* pWho) + { + DoScriptText(urand(0, 1)?SAY_AGGRO1:SAY_AGGRO2, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_PATCHWERK, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_PATCHWERK, FAIL); + } + + void DoHatefulStrike() + { + // The ability is used on highest HP target choosen of the top 2 (3 heroic) targets on threat list being in melee range + Unit* pTarget = NULL; + uint32 uiHighestHP = 0; + uint32 uiTargets = m_bIsRegularMode ? 2 : 3; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator iter = tList.begin();iter != tList.end(); ++iter) + { + if (!uiTargets) + break; + + if (Unit* pTempTarget = m_creature->GetMap()->GetUnit((*iter)->getUnitGuid())) + { + if (pTempTarget->GetHealth() > uiHighestHP && m_creature->IsWithinDistInMap(pTempTarget, ATTACK_DISTANCE)) + { + uiHighestHP = pTempTarget->GetHealth(); + pTarget = pTempTarget; + } + } + + --uiTargets; + } + + if (pTarget) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_HATEFULSTRIKE : SPELL_HATEFULSTRIKE_H); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Hateful Strike + if (m_uiHatefulStrikeTimer < uiDiff) + { + DoHatefulStrike(); + m_uiHatefulStrikeTimer = 1000; + } + else + m_uiHatefulStrikeTimer -= uiDiff; + + // Soft Enrage at 5% + if (!m_bEnraged) + { + if (m_creature->GetHealthPercent() < 5.0f) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + DoScriptText(EMOTE_ENRAGE, m_creature); + m_bEnraged = true; + } + } + + // Berserk after 6 minutes + if (!m_bBerserk) + { + if (m_uiBerserkTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + m_bBerserk = true; + } + else + m_uiBerserkTimer -= uiDiff; + } + else + { + // Slimebolt - casted only while Berserking to prevent kiting + if (m_uiSlimeboltTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SLIMEBOLT); + m_uiSlimeboltTimer = 5000; + } + else + m_uiSlimeboltTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_patchwerk(Creature* pCreature) +{ + return new boss_patchwerkAI(pCreature); +} + +void AddSC_boss_patchwerk() +{ + Script* NewScript; + NewScript = new Script; + NewScript->Name = "boss_patchwerk"; + NewScript->GetAI = &GetAI_boss_patchwerk; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_razuvious.cpp b/scripts/northrend/naxxramas/boss_razuvious.cpp new file mode 100644 index 0000000..5dcb7f6 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_razuvious.cpp @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Razuvious +SD%Complete: 75% +SDComment: TODO: Timers and sounds need confirmation, implement spell Hopeless +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + SAY_AGGRO1 = -1533120, + SAY_AGGRO2 = -1533121, + SAY_AGGRO3 = -1533122, + SAY_SLAY1 = -1533123, + SAY_SLAY2 = -1533124, + SAY_COMMAND1 = -1533125, + SAY_COMMAND2 = -1533126, + SAY_COMMAND3 = -1533127, + SAY_COMMAND4 = -1533128, + SAY_DEATH = -1533129, + + SPELL_UNBALANCING_STRIKE = 26613, + SPELL_DISRUPTING_SHOUT = 55543, + SPELL_DISRUPTING_SHOUT_H = 29107, + SPELL_JAGGED_KNIFE = 55550, + SPELL_FORCE_OBEDIENCE = 55479, + SPELL_HOPELESS = 29125 +}; + +static uint32 m_uiDeathKnightUnderstudy[4] = {NPC_DEATH_KNIGHT_UNDERSTUDY_1,NPC_DEATH_KNIGHT_UNDERSTUDY_2, NPC_DEATH_KNIGHT_UNDERSTUDY_3, NPC_DEATH_KNIGHT_UNDERSTUDY_4}; + +struct MANGOS_DLL_DECL boss_razuviousAI : public ScriptedAI +{ + boss_razuviousAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiUnbalancingStrikeTimer; + uint32 m_uiDisruptingShoutTimer; + uint32 m_uiJaggedKnifeTimer; + uint32 m_uiCommandSoundTimer; + + void Reset() + { + m_uiUnbalancingStrikeTimer = 30000; // 30 seconds + m_uiDisruptingShoutTimer = 15000; // 15 seconds + m_uiJaggedKnifeTimer = urand(10000, 15000); + m_uiCommandSoundTimer = 40000; // 40 seconds + } + + void KilledUnit(Unit* Victim) + { + if (urand(0, 3)) + return; + + switch(urand(0, 1)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_RAZUVIOUS, DONE); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_RAZUVIOUS, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_RAZUVIOUS, FAIL); + + for(int i=0;i<4;i++) + { + if(Creature* Understudy = (Creature*) m_creature->GetMap()->GetUnit(m_pInstance->GetData64(m_uiDeathKnightUnderstudy[i]))) + Understudy->Respawn(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Unbalancing Strike + if (m_uiUnbalancingStrikeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_UNBALANCING_STRIKE); + m_uiUnbalancingStrikeTimer = 30000; + } + else + m_uiUnbalancingStrikeTimer -= uiDiff; + + // Disrupting Shout + if (m_uiDisruptingShoutTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_DISRUPTING_SHOUT : SPELL_DISRUPTING_SHOUT_H); + m_uiDisruptingShoutTimer = 25000; + } + else + m_uiDisruptingShoutTimer -= uiDiff; + + // Jagged Knife + if (m_uiJaggedKnifeTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_JAGGED_KNIFE); + m_uiJaggedKnifeTimer = 10000; + } + else + m_uiJaggedKnifeTimer -= uiDiff; + + // Random say + if (m_uiCommandSoundTimer < uiDiff) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_COMMAND1, m_creature); break; + case 1: DoScriptText(SAY_COMMAND2, m_creature); break; + case 2: DoScriptText(SAY_COMMAND3, m_creature); break; + case 3: DoScriptText(SAY_COMMAND4, m_creature); break; + } + + m_uiCommandSoundTimer = 40000; + } + else + m_uiCommandSoundTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_razuvious(Creature* pCreature) +{ + return new boss_razuviousAI(pCreature); +} + +bool GossipHello_obedience_crystal(Player* pPlayer, Creature* pCreature) +{ + for(int i=0;i<2;i++) + { + if(Creature* Understudy = (Creature*) pCreature->GetMap()->GetUnit(((instance_naxxramas*)pCreature->GetInstanceData())->GetData64(m_uiDeathKnightUnderstudy[i]))) + { + if(!Understudy->HasAuraType(SPELL_AURA_MOD_POSSESS)) + { + pPlayer->CastSpell(Understudy,SPELL_FORCE_OBEDIENCE,true); + return true; + } + } + } +} + +void AddSC_boss_razuvious() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_razuvious"; + pNewScript->GetAI = &GetAI_boss_razuvious; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "obedience_crystal"; + pNewScript->pGossipHello = &GossipHello_obedience_crystal; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_sapphiron.cpp b/scripts/northrend/naxxramas/boss_sapphiron.cpp new file mode 100644 index 0000000..21b5114 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_sapphiron.cpp @@ -0,0 +1,374 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sapphiron +SD%Complete: 80 +SDComment: Blizzard workaround +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + EMOTE_BREATH = -1533082, + EMOTE_FLY = -1533149, + EMOTE_GROUND = -1533150, + EMOTE_ENRAGE = -1533083, + + SPELL_ICEBOLT = 28522, + SPELL_ICEBLOCK = 62766, + SPELL_FROST_BREATH = 28524, //2 zauber: 29318,28524 + SPELL_FROST_BREATH_VISUAL = 30101, + + SPELL_FROST_AURA = 28531, + H_SPELL_FROST_AURA = 55799, + + SPELL_LIFE_DRAIN = 28542, + H_SPELL_LIFE_DRAIN = 55665, + + SPELL_TAIL_SWEEP = 55697, + H_SPELL_TAIL_SWEEP = 55696, + + SPELL_BLIZZARD = 28547, + H_SPELL_BLIZZARD = 55699, + + SPELL_CLEAVE = 19983, + SPELL_BESERK = 26662, + + SPELL_DIES = 29357, + + NPC_FROST_BREATH_TARGET = 34548, //hack +}; + +//float frostBreathTargetCoord[3] = {3522.39f, -5236.78f, 137.6f}; + +struct MANGOS_DLL_DECL boss_sapphironAI : public ScriptedAI +{ + boss_sapphironAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_naxxramas*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_uiIceboltCountMax = m_bIsRegularMode ? 2 : 3; + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiIceboltCount; + uint32 m_uiIceboltCountMax; + uint32 m_uiIceboltTimer; + uint32 m_uiFrostBreathTimer; + uint32 m_uiLifeDrainTimer; + uint32 m_uiBlizzardTimer; + uint32 m_uiTailSweepTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiFlyTimer; + uint32 m_uiBeserkTimer; + uint32 m_uiPhase; + uint32 m_uiLandTimer; + uint64 m_uiFrostBreathTargetGUID; + bool m_bLandoff; + bool m_bReachedMiddle; + std::vector targets; + //std::vector immunePlayers; + //Creature* pFrostBreathTarget; + + void Reset() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiFrostBreathTimer = 7000; + m_uiLifeDrainTimer = 22000; + m_uiBlizzardTimer = 20000; + m_uiTailSweepTimer = 10000; + m_uiCleaveTimer = 10000; + m_uiFlyTimer = 45000; + m_uiIceboltTimer = 4000; + m_uiLandTimer = 2000; + m_uiBeserkTimer = 15*MINUTE*IN_MILLISECONDS; + m_uiPhase = 1; + m_uiIceboltCount = 0; + m_bLandoff = false; + m_bReachedMiddle = false; + targets.clear(); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SAPPHIRON, IN_PROGRESS); + + m_creature->SetInCombatWithZone(); + DoCast(m_creature, m_bIsRegularMode ? SPELL_FROST_AURA : H_SPELL_FROST_AURA); + + if(Creature* pFrostBreathTarget = m_creature->SummonCreature(NPC_FROST_BREATH_TARGET, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0.f,TEMPSUMMON_DEAD_DESPAWN,0)) + { + pFrostBreathTarget->SetSpeedRate(MOVE_WALK,0.0f,true); + pFrostBreathTarget->SetSpeedRate(MOVE_RUN,0.0f,true); + //pFrostBreathTarget->SetDisplayId(16586); + m_uiFrostBreathTargetGUID = pFrostBreathTarget->GetGUID(); + } + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SAPPHIRON, DONE); + + Map *map = m_creature->GetMap(); + if (!map->IsDungeon()) + return; + if(Creature* pFrostBreathTarget = map->GetCreature(m_uiFrostBreathTargetGUID)) + pFrostBreathTarget->ForcedDespawn(); + + RemoveAuraAndIce(); + m_creature->CastSpell(m_creature, SPELL_DIES, true); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SAPPHIRON, FAIL); + + Map *map = m_creature->GetMap(); + if (!map->IsDungeon()) + return; + if(Creature* pFrostBreathTarget = map->GetCreature(m_uiFrostBreathTargetGUID)) + pFrostBreathTarget->ForcedDespawn(); + + RemoveAuraAndIce(); + } + void RemoveAuraAndIce() + { + Map::PlayerList const &PlayerList = m_creature->GetMap()->GetPlayers(); + //remove frost immunity icebolt and iceblock + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + i->getSource()->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + if (!i->getSource()->isAlive()) + continue; + if (i->getSource()->HasAura(SPELL_ICEBOLT)) + i->getSource()->RemoveAurasDueToSpell(SPELL_ICEBOLT); + if (i->getSource()->HasAura(SPELL_ICEBLOCK)) + i->getSource()->RemoveAurasDueToSpell(SPELL_ICEBLOCK); + + } + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_ICEBOLT) + { + if (target->HasAura(SPELL_ICEBOLT)) + { + target->CastSpell(target, SPELL_ICEBLOCK, true); + target->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + } + } + else if (spell->Id == SPELL_FROST_BREATH_VISUAL) + { + target->GetMotionMaster()->MoveIdle(); + target->getThreatManager().clearReferences(); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if(type == POINT_MOTION_TYPE && id ==0) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_uiIceboltTimer = 4000; + m_uiIceboltCount = 0; + m_bReachedMiddle = true; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBeserkTimer) + { + if (m_uiBeserkTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_BESERK) == CAST_OK) + { + m_uiBeserkTimer = 0; + DoScriptText(EMOTE_ENRAGE, m_creature); + } + }else m_uiBeserkTimer -= uiDiff; + } + + if (m_uiPhase == 1) + { + if (m_uiLifeDrainTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_LIFE_DRAIN : H_SPELL_LIFE_DRAIN) == CAST_OK) + m_uiLifeDrainTimer = 22000; + }else m_uiLifeDrainTimer -= uiDiff; + + if (m_uiBlizzardTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_BLIZZARD : H_SPELL_BLIZZARD) == CAST_OK) + m_uiBlizzardTimer = 2000; // blizzlike urand(17,20)*IN_MILLISECONDS; + } + }else m_uiBlizzardTimer -= uiDiff; + + if (m_uiCleaveTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE) == CAST_OK) + m_uiCleaveTimer = urand(7000, 10000); + }else m_uiCleaveTimer -= uiDiff; + + if (m_uiTailSweepTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_TAIL_SWEEP : H_SPELL_TAIL_SWEEP) == CAST_OK) + m_uiTailSweepTimer = urand(10000, 15000); + }else m_uiTailSweepTimer -= uiDiff; + + if (m_creature->GetHealthPercent() > 10.0f) + { + if (m_uiFlyTimer < uiDiff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->HandleEmote(EMOTE_ONESHOT_LIFTOFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoCastSpellIfCan(m_creature,11010); + m_creature->SetHover(true); + DoScriptText(EMOTE_FLY, m_creature); + m_uiPhase = 2; + m_bLandoff = false; + m_bReachedMiddle = false; + + if(Creature* pFrostBreathTarget = m_creature->GetMap()->GetCreature(m_uiFrostBreathTargetGUID)) + m_creature->GetMotionMaster()->MovePoint(0, pFrostBreathTarget->GetPositionX(), pFrostBreathTarget->GetPositionY(), pFrostBreathTarget->GetPositionZ()+10); + }else m_uiFlyTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } + else if (m_uiPhase == 2 && m_bReachedMiddle) // Phase 2 + { + if (m_uiIceboltCount < m_uiIceboltCountMax) + { + if (m_uiIceboltTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + if(DoCastSpellIfCan(pTarget,SPELL_ICEBOLT) == CAST_OK) + { + targets.push_back(pTarget); + ++m_uiIceboltCount; + + if (m_uiIceboltCount == m_uiIceboltCountMax) + { + DoScriptText(EMOTE_BREATH, m_creature); + m_uiFrostBreathTimer = 8700; + if(Creature* pFrostBreathTarget = m_creature->GetMap()->GetCreature(m_uiFrostBreathTargetGUID)) + DoCast(pFrostBreathTarget, SPELL_FROST_BREATH_VISUAL, true); + } + + m_uiIceboltTimer = 4000; + } + } + } + }else m_uiIceboltTimer -= uiDiff; + } + else + { + if (m_bLandoff) + { + if (m_uiLandTimer < uiDiff) + { + RemoveAuraAndIce(); + targets.clear(); + m_uiPhase = 1; + m_creature->HandleEmote(EMOTE_ONESHOT_LAND); + m_creature->SetHover(false); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_uiFlyTimer = 45000; + DoScriptText(EMOTE_GROUND, m_creature); + }else m_uiLandTimer -= uiDiff; + } + else + { + if (m_uiFrostBreathTimer < uiDiff) + { + Map *map = m_creature->GetMap(); + if (!map->IsDungeon()) + return; + if(Creature* pFrostBreathTarget = map->GetCreature(m_uiFrostBreathTargetGUID)) + { + Map::PlayerList const &PlayerList = map->GetPlayers(); + + //check for each player + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + //check for both iceblocks + for(std::vector::iterator itr = targets.begin(); itr!= targets.end(); ++itr) + //check if player near iceblock + { + if(i->getSource()->GetDistance2d((*itr)) <= 10.0f) + { + //check if iceblock is closer to breathtarget then player + if(pFrostBreathTarget->GetDistanceOrder((*itr),i->getSource(),false)) + { + // applySpellImune to specific player + i->getSource()->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + break; + } + } + } + if(pFrostBreathTarget) + { + pFrostBreathTarget->CastSpell(pFrostBreathTarget, SPELL_FROST_BREATH, true, 0, 0, m_creature->GetGUID()); + m_uiLandTimer = 2000; + m_bLandoff = true; + } + } + + }else m_uiFrostBreathTimer -= uiDiff; + } + } + } + } +}; + +CreatureAI* GetAI_boss_sapphiron(Creature* pCreature) +{ + return new boss_sapphironAI(pCreature); +} + +void AddSC_boss_sapphiron() +{ + Script* NewScript; + NewScript = new Script; + NewScript->Name = "boss_sapphiron"; + NewScript->GetAI = &GetAI_boss_sapphiron; + NewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/boss_thaddius.cpp b/scripts/northrend/naxxramas/boss_thaddius.cpp new file mode 100644 index 0000000..451fd07 --- /dev/null +++ b/scripts/northrend/naxxramas/boss_thaddius.cpp @@ -0,0 +1,744 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Thaddius +SD%Complete: 90 +SDComment: Placeholder. Includes Feugen & Stalagg. +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +enum +{ + // Stalagg + SAY_STAL_AGGRO = -1533023, + SAY_STAL_SLAY = -1533024, + SAY_STAL_DEATH = -1533025, + + SPELL_POWERSURGE = 54529, + SPELL_POWERSURGE_H = 28134, + + //Feugen + SAY_FEUG_AGGRO = -1533026, + SAY_FEUG_SLAY = -1533027, + SAY_FEUG_DEATH = -1533028, + + SPELL_STATIC_FIELD = 28135, + SPELL_STATIC_FIELD_H = 54528, + + //both + SPELL_WARSTOMP = 28125, + + //Thaddus + SAY_GREET = -1533029, + SAY_AGGRO1 = -1533030, + SAY_AGGRO2 = -1533031, + SAY_AGGRO3 = -1533032, + SAY_SLAY = -1533033, + SAY_ELECT = -1533034, + SAY_DEATH = -1533035, + SAY_SCREAM1 = -1533036, + SAY_SCREAM2 = -1533037, + SAY_SCREAM3 = -1533038, + SAY_SCREAM4 = -1533039, + + SPELL_BALL_LIGHTNING = 28299, + + SPELL_CHARGE_POSITIVE_DMGBUFF = 29659, + SPELL_CHARGE_POSITIVE_NEARDMG = 28062, + + SPELL_CHARGE_NEGATIVE_DMGBUFF = 29660, + SPELL_CHARGE_NEGATIVE_NEARDMG = 28085, + + SPELL_POLARITYSHIFT = 28089, + + SPELL_CHAIN_LIGHTNING = 28167, + SPELL_CHAIN_LIGHTNING_H = 54531, + + SPELL_BESERK = 26662, + + //generic + C_TESLA_COIL = 16218 //the coils (emotes "Tesla Coil overloads!") +}; + +static const float StalaggPos[] = {3449.0613f, -2933.2119f, 312.0044f}; +static const float FeugenPos[] = {3506.7844f, -2989.0639f, 312.0093f}; + +struct MANGOS_DLL_DECL boss_thaddiusAI: public ScriptedAI +{ + boss_thaddiusAI(Creature* c): ScriptedAI(c) + { + m_pInstance = (instance_naxxramas*)m_creature->GetInstanceData(); + m_bIsRegularMode = m_creature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + uint64 StalaggGUID, FeugenGUID; + + uint32 PreBossTimer; + bool CanAggro; + + uint32 PolarityShiftTimer; + uint32 PolarityClearTimer; + uint32 PolarityDamageTimer; + uint32 ChainLightningTimer; + uint32 BerserkTimer; + uint32 BallLightningTimer; + + std::list PlusList; + std::list MinusList; + + void Reset() + { + PreBossRespawn(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_STUNNED); + StalaggGUID = 0; + FeugenGUID = 0; + + CanAggro = false; + PreBossTimer = 0; + + PolarityShiftTimer = 10000; + PolarityClearTimer = 0; + PolarityDamageTimer = 1000; + ChainLightningTimer = 12000+urand(0,5000); + BerserkTimer = 360000; + BallLightningTimer = 3000; + + RemoveCharges(); + + PlusList.clear(); + MinusList.clear(); + } + + void PreBossDeath() + { + if(PreBossTimer) + { + DoScriptText(SAY_GREET,m_creature); + CanAggro = true; + PreBossTimer = 15000+urand(0,5000); + return; + } + + PreBossTimer = 5000; + } + + void PreBossRespawn() + { + if(Creature* Stalagg = m_pInstance->instance->GetCreature(StalaggGUID)) + if(Stalagg->isDead()) + Stalagg->Respawn(); + if(Creature* Feugen = m_pInstance->instance->GetCreature(FeugenGUID)) + if(Feugen->isDead()) + Feugen->Respawn(); + } + + void RemoveCharges() + { + Map::PlayerList const& plList = m_pInstance->instance->GetPlayers(); + + if(plList.isEmpty()) + return; + + for(Map::PlayerList::const_iterator ittr = plList.begin(); ittr != plList.end(); ++ittr) + { + if(ittr->getSource()) + { + ittr->getSource()->RemoveAurasDueToSpell(SPELL_CHARGE_POSITIVE_DMGBUFF); + ittr->getSource()->RemoveAurasDueToSpell(SPELL_CHARGE_NEGATIVE_DMGBUFF); + } + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* spell) + { + if(spell->Id == SPELL_POLARITYSHIFT && pTarget->GetTypeId() == TYPEID_PLAYER && pTarget->isAlive()) + { + pTarget->RemoveAura(SPELL_CHARGE_POSITIVE_DMGBUFF, EFFECT_INDEX_0); + pTarget->RemoveAura(SPELL_CHARGE_NEGATIVE_DMGBUFF, EFFECT_INDEX_0); + + if(urand(1,4) > 2) //positive + { + PlusList.push_back((Player*)pTarget); + pTarget->CastSpell(pTarget,SPELL_CHARGE_POSITIVE_DMGBUFF,true); + } + else //negative + { + MinusList.push_back((Player*)pTarget); + pTarget->CastSpell(pTarget,SPELL_CHARGE_NEGATIVE_DMGBUFF,true); + } + } + } + + void Aggro(Unit* pVictim) + { + switch(urand(1,3)) + { + case 1: DoScriptText(SAY_AGGRO1, m_creature); break; + case 2: DoScriptText(SAY_AGGRO2, m_creature); break; + default: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + RemoveCharges(); + } + + void KilledUnit(Unit* pVictim) + { + if(urand(0,1)) + DoScriptText(SAY_SLAY,m_creature); + + pVictim->RemoveAura(SPELL_CHARGE_POSITIVE_DMGBUFF, EFFECT_INDEX_0); + pVictim->RemoveAura(SPELL_CHARGE_NEGATIVE_DMGBUFF, EFFECT_INDEX_0); + } + + void UpdateAI(const uint32 diff) + { + if(!CanAggro) + { + if(PreBossTimer) + { + if(PreBossTimer <= diff) + { + PreBossRespawn(); + PreBossTimer = 0; + } else PreBossTimer -= diff; + } + } + else + { + if(PreBossTimer) + { + if(PreBossTimer <= diff) + { + Map::PlayerList const& plList = m_pInstance->instance->GetPlayers(); + if(plList.isEmpty()) + { + error_log("ThaddiusAI: cannot start attacking, player list is empty!"); + PreBossTimer = 0; + return; + } + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_STUNNED); + if(plList.begin()->getSource()) + m_creature->AI()->AttackStart(plList.begin()->getSource()); + PreBossTimer = 0; + } else PreBossTimer -= diff; + } + } + + if(!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + { + if(m_creature->GetHealth() < m_creature->GetMaxHealth()) + EnterEvadeMode(); + return; + } + + if(PolarityShiftTimer <= diff) + { + DoScriptText(SAY_ELECT,m_creature); + + DoCast(m_creature,SPELL_POLARITYSHIFT); + PolarityShiftTimer = 30000; + PolarityClearTimer = 2000; + PolarityDamageTimer = 5000; + } else PolarityShiftTimer -= diff; + + if(PolarityClearTimer) + { + if(PolarityClearTimer <= diff) + { + PlusList.clear(); + MinusList.clear(); + PolarityClearTimer = 0; + } else PolarityClearTimer -= diff; + } + + if(PolarityDamageTimer <= diff) + { + if(!PlusList.empty()) + { + for(std::list::const_iterator itr = PlusList.begin(); itr != PlusList.end(); ++itr) + { + int32 charge = 0; + Map::PlayerList const& plList = m_pInstance->instance->GetPlayers(); + for(Map::PlayerList::const_iterator ittr = plList.begin(); ittr != plList.end(); ++ittr) + { + if(ittr->getSource() && ittr->getSource()->isAlive() && ittr->getSource()->HasAura(SPELL_CHARGE_NEGATIVE_DMGBUFF,EFFECT_INDEX_0) && ittr->getSource()->IsWithinDistInMap((*itr),m_bIsRegularMode ? 10.0f : 5.0f)) + (*itr)->CastSpell((*itr),SPELL_CHARGE_POSITIVE_NEARDMG,true); + if(ittr->getSource() && ittr->getSource()->isAlive() && ittr->getSource()->HasAura(SPELL_CHARGE_POSITIVE_DMGBUFF,EFFECT_INDEX_0) && ittr->getSource()->IsWithinDistInMap((*itr),m_bIsRegularMode ? 10.0f : 5.0f)) + ++charge; + } + (*itr)->RemoveAura(SPELL_CHARGE_POSITIVE_DMGBUFF, EFFECT_INDEX_0); + for( int32 i = 0; i < charge; i++) + { + (*itr)->CastSpell((*itr), SPELL_CHARGE_POSITIVE_DMGBUFF,true); + } + + + } + } + if(!MinusList.empty()) + { + for(std::list::const_iterator itr = MinusList.begin(); itr != MinusList.end(); ++itr) + { + int32 charge = 0; + Map::PlayerList const& plList = m_pInstance->instance->GetPlayers(); + for(Map::PlayerList::const_iterator ittr = plList.begin(); ittr != plList.end(); ++ittr) + { + if(ittr->getSource() && ittr->getSource()->isAlive() && ittr->getSource()->HasAura(SPELL_CHARGE_POSITIVE_DMGBUFF,EFFECT_INDEX_0) && ittr->getSource()->IsWithinDistInMap((*itr),m_bIsRegularMode ? 10.0f : 5.0f)) + (*itr)->CastSpell((*itr),SPELL_CHARGE_NEGATIVE_NEARDMG,true); + if(ittr->getSource() && ittr->getSource()->isAlive() && ittr->getSource()->HasAura(SPELL_CHARGE_NEGATIVE_DMGBUFF,EFFECT_INDEX_0) && ittr->getSource()->IsWithinDistInMap((*itr),m_bIsRegularMode ? 10.0f : 5.0f)) + ++charge; + } + (*itr)->RemoveAura(SPELL_CHARGE_NEGATIVE_DMGBUFF, EFFECT_INDEX_0); + for( int32 i = 0; i < charge; i++) + { + (*itr)->CastSpell((*itr), SPELL_CHARGE_NEGATIVE_DMGBUFF,true); + } + } + } + PolarityDamageTimer = 1000; + } else PolarityDamageTimer -= diff; + + if(ChainLightningTimer <= diff) + { + DoCast(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0),m_bIsRegularMode?SPELL_CHAIN_LIGHTNING:SPELL_CHAIN_LIGHTNING_H); + ChainLightningTimer = 12000+urand(0,5000); + } else ChainLightningTimer -= diff; + + if(!m_creature->getVictim()->IsWithinDistInMap(m_creature,ATTACK_DISTANCE)) + { + if(BallLightningTimer <= diff) + { + DoCast(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0),SPELL_BALL_LIGHTNING); + BallLightningTimer = 2500; + } else BallLightningTimer -= diff; + } + + if (BerserkTimer) + { + if (BerserkTimer <= diff) + { + DoCast(m_creature, SPELL_BESERK); + BerserkTimer = 0; + }else BerserkTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thaddius(Creature* pCreature) +{ + return new boss_thaddiusAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_stalaggAI: public ScriptedAI +{ + mob_stalaggAI(Creature* c): ScriptedAI(c) + { + m_pInstance = (instance_naxxramas*)m_creature->GetInstanceData(); + m_bIsRegularMode = m_creature->GetMap()->IsRegularDifficulty(); + + if(boss_thaddiusAI* ThaddiusAI = GetThaddiusAI()) + ThaddiusAI->StalaggGUID = m_creature->GetGUID(); + + Reset(); + } + + boss_thaddiusAI* GetThaddiusAI() + { + if(m_pInstance) + if(Creature* Thaddius = GetClosestCreatureWithEntry(m_creature,NPC_THADDIUS,1000.0f))//m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_THADDIUS))) + return (boss_thaddiusAI*)Thaddius->AI(); + + return NULL; + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + bool JustSpawnedVisual; + + uint32 PullTimer; + uint32 PowerSurgeTimer; + bool JustEnraged; + bool isFeugenClose; + uint32 EnrageCastTimer; + + uint32 CheckAggroTimer; + + uint32 WarStompTimer; + + uint64 StalaggTelsa; + + void Reset() + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(StalaggTelsa)) + pTemp->ForcedDespawn(); + + JustSpawnedVisual = false; + + PullTimer = 30000; + PowerSurgeTimer = 10000; + JustEnraged = false; + isFeugenClose = false; + EnrageCastTimer = 1000; + + WarStompTimer = 10000+urand(0,5000); + + CheckAggroTimer = 5000; + + /*if(Creature* TeslaVisual = GetClosestCreatureWithEntry(m_creature,C_TESLA_COIL,30.0f)) + TeslaVisual->CastSpell(m_creature,45537,true);*/ //mob falls down + + } + + void JustDied(Unit* pKiller) + { + boss_thaddiusAI* ThaddiusAI = GetThaddiusAI(); + if(!ThaddiusAI) + return; + + ThaddiusAI->PreBossDeath(); + } + + void UpdateAI(const uint32 diff) + { + if(!JustSpawnedVisual) + { + if(GameObject* NearTeslaCoil = GetClosestGameObjectWithEntry(m_creature,181478,100.0f)) + { + float gx,gy,gz; + NearTeslaCoil->GetPosition(gx,gy,gz); + if(Creature* TeslaVisual = m_creature->SummonCreature(C_TESLA_COIL,gx,gy,gz,0.0f,TEMPSUMMON_DEAD_DESPAWN,0)) + { + TeslaVisual->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PASSIVE + UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + TeslaVisual->GetMotionMaster()->MovePoint(0,gx,gy,gz); + TeslaVisual->CastSpell(m_creature,45537,true); + StalaggTelsa = TeslaVisual->GetGUID(); + JustSpawnedVisual = true; + } + } + } + + static boss_thaddiusAI* ThaddiusAI; + if((ThaddiusAI = GetThaddiusAI()) && !ThaddiusAI->StalaggGUID) + ThaddiusAI->StalaggGUID = m_creature->GetGUID(); + + if(!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + { + if(m_creature->GetHealth() < m_creature->GetMaxHealth()) + EnterEvadeMode(); + return; + } + + if(boss_thaddiusAI* ThaddiusAI = GetThaddiusAI()) + { + if(Creature* Feugen = m_pInstance->instance->GetCreature(ThaddiusAI->FeugenGUID)) + { + if(Feugen->IsWithinDist(m_creature,20.0f)) + isFeugenClose = true; + else + isFeugenClose = false; + } + } + + if( (m_creature->GetPositionZ() < 309.58f) || isFeugenClose) + { + if(!JustEnraged) + { + JustEnraged = true; + } + else + { + if(EnrageCastTimer <= diff) + { + m_creature->CastSpell(m_creature->getVictim(),17364,true); + EnrageCastTimer = 500; + } else EnrageCastTimer -= diff; + } + } + else + JustEnraged = false; + + if(WarStompTimer <= diff) + { + DoCast(m_creature,SPELL_WARSTOMP,true); + WarStompTimer = 10000+urand(0,5000); + } else WarStompTimer -= diff; + + if(CheckAggroTimer) + { + if(CheckAggroTimer <= diff) + { + if(boss_thaddiusAI* ThaddiusAI = GetThaddiusAI()) + { + if(Creature* Feugen = m_pInstance->instance->GetCreature(ThaddiusAI->FeugenGUID)) + { + if(!Feugen->getVictim()) + { + Feugen->AI()->AttackStart(m_creature->getVictim()); + Feugen->AddThreat(m_creature->getVictim(),1000.0f); + } + } + } + CheckAggroTimer = 0; + } else CheckAggroTimer -= diff; + } + + if(PowerSurgeTimer <= diff) + { + DoCast(m_creature, m_bIsRegularMode? SPELL_POWERSURGE : SPELL_POWERSURGE_H,true); + PowerSurgeTimer = 15000+urand(0,5000); + } else PowerSurgeTimer -= diff; + + if(PullTimer <= diff) + { + if(Unit* StalaggVictim = m_creature->getVictim()) + { + //workaround for non working move type + if(boss_thaddiusAI* ThaddiusAI = GetThaddiusAI()) + { + Unit* FeugenVictim = NULL; + Unit* StalaggVictim = m_creature->getVictim(); + float ThreatFeugenVictim = NULL; + float ThreatStalaggVictim = m_creature->getThreatManager().getThreat(StalaggVictim); + if(Creature* Feugen = m_pInstance->instance->GetCreature(ThaddiusAI->FeugenGUID)) + { + FeugenVictim = Feugen->getVictim(); + if (FeugenVictim) + { + ThreatFeugenVictim = Feugen->getThreatManager().getThreat(FeugenVictim); + //swap + StalaggVictim->NearTeleportTo(FeugenPos[0],FeugenPos[1],FeugenPos[2],0.0f); + Feugen->AddThreat(StalaggVictim, ThreatFeugenVictim); + Feugen->getThreatManager().modifyThreatPercent(FeugenVictim, -100); + FeugenVictim->NearTeleportTo(StalaggPos[0],StalaggPos[1],StalaggPos[2], 0.0f); + m_creature->AddThreat(FeugenVictim, ThreatStalaggVictim); + m_creature->getThreatManager().modifyThreatPercent(StalaggVictim, -100); + + } + } + } + /*m_creature->GetMotionMaster()->MoveIdle(); + ((Player*)Victim)->NearTeleportTo(Victim->GetPositionX(),Victim->GetPositionY(),Victim->GetPositionZ()+5.0f,Victim->GetOrientation()); + + float vsin = sin(Victim->GetAngle(FeugenPos[0],FeugenPos[1])); + float vcos = cos(Victim->GetAngle(FeugenPos[0],FeugenPos[1])); + + WorldPacket data(SMSG_MOVE_KNOCK_BACK, (8+4+4+4+4+4)); + data.appendPackGUID(Victim->GetGUID()); + data << uint32(1); // Sequence + data << float(vcos); // x direction + data << float(vsin); // y direction + data << float(Victim->GetDistance2d(FeugenPos[0],FeugenPos[1])); + data << float(-10.0); // Z Movement speed + + ((Player*)Victim)->GetSession()->SendPacket(&data);*/ + } + PullTimer = 30000; + } else PullTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stalagg(Creature* pCreature) +{ + return new mob_stalaggAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_feugenAI: public ScriptedAI +{ + mob_feugenAI(Creature* c): ScriptedAI(c) + { + m_pInstance = (instance_naxxramas*)m_creature->GetInstanceData(); + m_bIsRegularMode = m_creature->GetMap()->IsRegularDifficulty(); + + if(boss_thaddiusAI* ThaddiusAI = GetThaddiusAI()) + ThaddiusAI->FeugenGUID = m_creature->GetGUID(); + + Reset(); + } + + boss_thaddiusAI* GetThaddiusAI() + { + if(m_pInstance) + if(Creature* Thaddius = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_THADDIUS))) + return (boss_thaddiusAI*)Thaddius->AI(); + + return NULL; + } + + instance_naxxramas* m_pInstance; + bool m_bIsRegularMode; + + bool JustSpawnedVisual; + + uint32 StaticFieldTimer; + bool JustEnraged; + uint32 EnrageCastTimer; + + uint32 WarStompTimer; + + uint32 CheckAggroTimer; + + uint64 FeugenTelsa; + + void Reset() + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(FeugenTelsa)) + pTemp->ForcedDespawn(); + + JustSpawnedVisual = false; + + StaticFieldTimer = 3000; + JustEnraged = false; + EnrageCastTimer = 1000; + + WarStompTimer = 10000+urand(0,5000); + + CheckAggroTimer = 5000; + + /*if(Creature* TeslaVisual = GetClosestCreatureWithEntry(m_creature,C_TESLA_COIL,30.0f)) + TeslaVisual->CastSpell(m_creature,45537,true);*/ //mob falls down + } + + void JustDied(Unit* pKiller) + { + boss_thaddiusAI* ThaddiusAI = GetThaddiusAI(); + if(!ThaddiusAI) + return; + + ThaddiusAI->PreBossDeath(); + } + + void UpdateAI(const uint32 diff) + { + if(!JustSpawnedVisual) + { + if(GameObject* NearTeslaCoil = GetClosestGameObjectWithEntry(m_creature,181477,100.0f)) + { + float gx,gy,gz; + NearTeslaCoil->GetPosition(gx,gy,gz); + if(Creature* TeslaVisual = m_creature->SummonCreature(C_TESLA_COIL,gx,gy,gz,0.0f,TEMPSUMMON_DEAD_DESPAWN,0)) + { + TeslaVisual->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_PASSIVE + UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + TeslaVisual->GetMotionMaster()->MovePoint(0,gx,gy,gz); + TeslaVisual->CastSpell(m_creature,45537,true); + FeugenTelsa = TeslaVisual->GetGUID(); + JustSpawnedVisual = true; + } + } + } + + static boss_thaddiusAI* ThaddiusAI; + if((ThaddiusAI = GetThaddiusAI()) && !ThaddiusAI->FeugenGUID) + ThaddiusAI->FeugenGUID = m_creature->GetGUID(); + + if(!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + { + if(m_creature->GetHealth() < m_creature->GetMaxHealth()) + EnterEvadeMode(); + return; + } + + if( (m_creature->GetPositionZ() < 309.58f/* || m_pInstance->instance->GetCreature(GetThaddiusAI()->FeugenGUID)->IsWithinDist(m_creature,20.0f) */)) + { + if(!JustEnraged) + { + JustEnraged = true; + } else + { + if(EnrageCastTimer <= diff) + { + m_creature->CastSpell(m_creature->getVictim(),17364,true); + EnrageCastTimer = 500; + } else EnrageCastTimer -= diff; + } + } else + JustEnraged = false; + + if(CheckAggroTimer) + { + if(CheckAggroTimer <= diff) + { + if(boss_thaddiusAI* ThaddiusAI = GetThaddiusAI()) + { + if(Creature* Stalagg = m_pInstance->instance->GetCreature(ThaddiusAI->StalaggGUID)) + { + if(!Stalagg->getVictim()) + { + Stalagg->AI()->AttackStart(m_creature->getVictim()); + Stalagg->AddThreat(m_creature->getVictim(),1000.0f); + } + } + } + CheckAggroTimer = 0; + } else CheckAggroTimer -= diff; + } + + if(WarStompTimer <= diff) + { + DoCast(m_creature,SPELL_WARSTOMP,true); + WarStompTimer = 10000+urand(0,5000); + } else WarStompTimer -= diff; + + if(StaticFieldTimer <= diff) + { + DoCast(m_creature,m_bIsRegularMode ? SPELL_STATIC_FIELD : SPELL_STATIC_FIELD_H,true); + StaticFieldTimer = 3000; + } else StaticFieldTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_feugen(Creature* pCreature) +{ + return new mob_feugenAI(pCreature); +} + +void AddSC_boss_thaddius() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_thaddius"; + newscript->GetAI = &GetAI_boss_thaddius; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stalagg"; + newscript->GetAI = &GetAI_mob_stalagg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_feugen"; + newscript->GetAI = &GetAI_mob_feugen; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/instance_naxxramas.cpp b/scripts/northrend/naxxramas/instance_naxxramas.cpp new file mode 100644 index 0000000..5c7c15d --- /dev/null +++ b/scripts/northrend/naxxramas/instance_naxxramas.cpp @@ -0,0 +1,725 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Naxxramas +SD%Complete: 90% +SDComment: +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "naxxramas.h" + +instance_naxxramas::instance_naxxramas(Map* pMap) : ScriptedInstance(pMap), + m_uiAracEyeRampGUID(0), + m_uiPlagEyeRampGUID(0), + m_uiMiliEyeRampGUID(0), + m_uiConsEyeRampGUID(0), + + m_uiAracPortalGUID(0), + m_uiPlagPortalGUID(0), + m_uiMiliPortalGUID(0), + m_uiConsPortalGUID(0), + + m_uiAnubRekhanGUID(0), + m_uiFaerlinanGUID(0), + m_uiWorshipperCount(0), + m_uiFollowerCount(0), + + m_uiZeliekGUID(0), + m_uiThaneGUID(0), + m_uiBlaumeuxGUID(0), + m_uiRivendareGUID(0), + + m_uiThaddiusGUID(0), + m_uiStalaggGUID(0), + m_uiFeugenGUID(0), + + m_uiLoathebGUID(0), + + m_uiHeiganGUID(0), + + m_uiKelthuzadGUID(0), + + m_uiPathExitDoorGUID(0), + m_uiGlutExitDoorGUID(0), + m_uiThadDoorGUID(0), + + m_uiAnubDoorGUID(0), + m_uiAnubGateGUID(0), + m_uiFaerDoorGUID(0), + m_uiFaerWebGUID(0), + m_uiMaexOuterGUID(0), + m_uiMaexInnerGUID(0), + + m_uiGothikGUID(0), + m_uiGothCombatGateGUID(0), + m_uiGothikEntryDoorGUID(0), + m_uiGothikExitDoorGUID(0), + m_uiHorsemenDoorGUID(0), + m_uiHorsemenChestGUID(0), + m_uiDeathKnightUnderstudyCount(0), + + m_uiNothEntryDoorGUID(0), + m_uiNothExitDoorGUID(0), + m_uiHeigEntryDoorGUID(0), + m_uiHeigExitDoorGUID(0), + m_uiLoathebDoorGUID(0), + + m_uiKelthuzadDoorGUID(0), + m_uiKelthuzadExitDoorGUID(0), + + m_bBlaumeuxDead(false), + m_bRivendareDead(false), + m_bZeliekDead(false), + m_bKorthazzDead(false), + + m_fChamberCenterX(0.0f), + m_fChamberCenterY(0.0f), + m_fChamberCenterZ(0.0f) +{ + Initialize(); +} + +void instance_naxxramas::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_uiWorshipperGUID, 0, sizeof(m_uiWorshipperGUID)); + memset(&m_uiDeathKnightUnderstudyGUID, 0, sizeof(m_uiDeathKnightUnderstudyGUID)); +} + +void instance_naxxramas::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_ANUB_REKHAN: m_uiAnubRekhanGUID = pCreature->GetGUID(); break; + case NPC_FAERLINA: m_uiFaerlinanGUID = pCreature->GetGUID(); break; + case NPC_THADDIUS: m_uiThaddiusGUID = pCreature->GetGUID(); break; + case NPC_STALAGG: m_uiStalaggGUID = pCreature->GetGUID(); break; + case NPC_FEUGEN: m_uiFeugenGUID = pCreature->GetGUID(); break; + case NPC_LOATHEB: m_uiLoathebGUID = pCreature->GetGUID(); break; + case NPC_HEIGAN: m_uiHeiganGUID = pCreature->GetGUID(); break; + case NPC_ZELIEK: m_uiZeliekGUID = pCreature->GetGUID(); break; + case NPC_THANE: m_uiThaneGUID = pCreature->GetGUID(); break; + case NPC_BLAUMEUX: m_uiBlaumeuxGUID = pCreature->GetGUID(); break; + case NPC_RIVENDARE: m_uiRivendareGUID = pCreature->GetGUID(); break; + case NPC_GOTHIK: m_uiGothikGUID = pCreature->GetGUID(); break; + case NPC_KELTHUZAD: m_uiKelthuzadGUID = pCreature->GetGUID(); break; + case NPC_SUB_BOSS_TRIGGER: m_lGothTriggerList.push_back(pCreature->GetGUID()); break; + case NPC_WORSHIPPER: if(m_uiWorshipperCount<5) m_uiWorshipperGUID[m_uiWorshipperCount++] = pCreature->GetGUID(); break; + case NPC_FOLLOWER: if(m_uiFollowerCount<3) m_uiFollowerGUID[m_uiFollowerCount++] = pCreature->GetGUID(); break; + case NPC_DEATH_KNIGHT_UNDERSTUDY: if(m_uiDeathKnightUnderstudyCount<5) m_uiDeathKnightUnderstudyGUID[m_uiDeathKnightUnderstudyCount++] = pCreature->GetGUID(); break; + } +} + +void instance_naxxramas::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_ARAC_ANUB_DOOR: + m_uiAnubDoorGUID = pGo->GetGUID(); + break; + case GO_ARAC_ANUB_GATE: + m_uiAnubGateGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ARAC_FAER_WEB: + m_uiFaerWebGUID = pGo->GetGUID(); + break; + case GO_ARAC_FAER_DOOR: + m_uiFaerDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ARAC_MAEX_INNER_DOOR: + m_uiMaexInnerGUID = pGo->GetGUID(); + break; + case GO_ARAC_MAEX_OUTER_DOOR: + m_uiMaexOuterGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case GO_PLAG_NOTH_ENTRY_DOOR: + m_uiNothEntryDoorGUID = pGo->GetGUID(); + break; + case GO_PLAG_NOTH_EXIT_DOOR: + m_uiNothExitDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PLAG_HEIG_ENTRY_DOOR: + m_uiHeigEntryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PLAG_HEIG_EXIT_DOOR: + m_uiHeigExitDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PLAG_LOAT_DOOR: + m_uiLoathebDoorGUID = pGo->GetGUID(); + break; + + case GO_MILI_GOTH_ENTRY_GATE: + m_uiGothikEntryDoorGUID = pGo->GetGUID(); + break; + case GO_MILI_GOTH_EXIT_GATE: + m_uiGothikExitDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_MILI_GOTH_COMBAT_GATE: + m_uiGothCombatGateGUID = pGo->GetGUID(); + break; + case GO_MILI_HORSEMEN_DOOR: + m_uiHorsemenDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case GO_CHEST_HORSEMEN_NORM: + case GO_CHEST_HORSEMEN_HERO: + m_uiHorsemenChestGUID = pGo->GetGUID(); + break; + + case GO_CONS_PATH_EXIT_DOOR: + m_uiPathExitDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[9] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_CONS_GLUT_EXIT_DOOR: + m_uiGlutExitDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[11] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_CONS_THAD_DOOR: + m_uiThadDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[11] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case GO_KELTHUZAD_WATERFALL_DOOR: + m_uiKelthuzadDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[13] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case GO_KELTHUZAD_EXIT_DOOR: + m_uiKelthuzadExitDoorGUID = pGo->GetGUID(); + break; + + case GO_ARAC_EYE_RAMP: + m_uiAracEyeRampGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_PLAG_EYE_RAMP: + m_uiPlagEyeRampGUID = pGo->GetGUID(); + if (m_auiEncounter[5] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_MILI_EYE_RAMP: + m_uiMiliEyeRampGUID = pGo->GetGUID(); + if (m_auiEncounter[8] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_CONS_EYE_RAMP: + m_uiConsEyeRampGUID = pGo->GetGUID(); + if (m_auiEncounter[12] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + + case GO_ARAC_PORTAL: + m_uiAracPortalGUID = pGo->GetGUID(); + break; + case GO_PLAG_PORTAL: + m_uiPlagPortalGUID = pGo->GetGUID(); + break; + case GO_MILI_PORTAL: + m_uiMiliPortalGUID = pGo->GetGUID(); + break; + case GO_CONS_PORTAL: + m_uiConsPortalGUID = pGo->GetGUID(); + break; + } +} + +bool instance_naxxramas::IsEncounterInProgress() const +{ + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; +} + +void instance_naxxramas::SetData(uint32 uiType, uint32 uiData) +{ + switch(uiType) + { + case TYPE_ANUB_REKHAN: + m_auiEncounter[0] = uiData; + DoUseDoorOrButton(m_uiAnubDoorGUID); + if (uiData == DONE) + DoUseDoorOrButton(m_uiAnubGateGUID); + break; + case TYPE_FAERLINA: + m_auiEncounter[1] = uiData; + DoUseDoorOrButton(m_uiFaerWebGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiFaerDoorGUID); + DoUseDoorOrButton(m_uiMaexOuterGUID); + } + break; + case TYPE_MAEXXNA: + m_auiEncounter[2] = uiData; + DoUseDoorOrButton(m_uiMaexInnerGUID, uiData); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiAracEyeRampGUID); + DoRespawnGameObject(m_uiAracPortalGUID, 30*MINUTE); + DoTaunt(); + } + break; + case TYPE_NOTH: + m_auiEncounter[3] = uiData; + DoUseDoorOrButton(m_uiNothEntryDoorGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiNothExitDoorGUID); + DoUseDoorOrButton(m_uiHeigEntryDoorGUID); + } + break; + case TYPE_HEIGAN: + m_auiEncounter[4] = uiData; + DoUseDoorOrButton(m_uiHeigEntryDoorGUID); + if (uiData == DONE) + DoUseDoorOrButton(m_uiHeigExitDoorGUID); + break; + case TYPE_LOATHEB: + m_auiEncounter[5] = uiData; + DoUseDoorOrButton(m_uiLoathebDoorGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiPlagEyeRampGUID); + DoRespawnGameObject(m_uiPlagPortalGUID, 30*MINUTE); + DoTaunt(); + } + break; + case TYPE_RAZUVIOUS: + m_auiEncounter[6] = uiData; + break; + case TYPE_GOTHIK: + switch(uiData) + { + case IN_PROGRESS: + DoUseDoorOrButton(m_uiGothikEntryDoorGUID); + DoUseDoorOrButton(m_uiGothCombatGateGUID); + break; + case SPECIAL: + DoUseDoorOrButton(m_uiGothCombatGateGUID); + break; + case FAIL: + if (m_auiEncounter[7] == IN_PROGRESS) + DoUseDoorOrButton(m_uiGothCombatGateGUID); + + DoUseDoorOrButton(m_uiGothikEntryDoorGUID); + break; + case DONE: + DoUseDoorOrButton(m_uiGothikEntryDoorGUID); + DoUseDoorOrButton(m_uiGothikExitDoorGUID); + DoUseDoorOrButton(m_uiHorsemenDoorGUID); + break; + } + m_auiEncounter[7] = uiData; + break; + case TYPE_BLAUMEUX: + if (uiData == DONE) + { + m_bBlaumeuxDead = true; + if (m_bRivendareDead && m_bZeliekDead && m_bKorthazzDead) + SetData(TYPE_FOUR_HORSEMEN, DONE); + } + break; + case TYPE_RIVENDARE: + if (uiData == DONE) + { + m_bRivendareDead = true; + if (m_bBlaumeuxDead && m_bZeliekDead && m_bKorthazzDead) + SetData(TYPE_FOUR_HORSEMEN, DONE); + } + break; + case TYPE_ZELIEK: + if (uiData == DONE) + { + m_bZeliekDead = true; + if (m_bBlaumeuxDead && m_bRivendareDead && m_bKorthazzDead) + SetData(TYPE_FOUR_HORSEMEN, DONE); + } + break; + case TYPE_KORTHAZZ: + if (uiData == DONE) + { + m_bKorthazzDead = true; + if (m_bBlaumeuxDead && m_bRivendareDead && m_bZeliekDead) + SetData(TYPE_FOUR_HORSEMEN, DONE); + } + break; + case TYPE_FOUR_HORSEMEN: + m_auiEncounter[8] = uiData; + DoUseDoorOrButton(m_uiHorsemenDoorGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiMiliEyeRampGUID); + DoRespawnGameObject(m_uiMiliPortalGUID, 30*MINUTE); + DoRespawnGameObject(m_uiHorsemenChestGUID, 30*MINUTE); + DoTaunt(); + } + break; + case TYPE_PATCHWERK: + m_auiEncounter[9] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiPathExitDoorGUID); + break; + case TYPE_GROBBULUS: + m_auiEncounter[10] = uiData; + break; + case TYPE_GLUTH: + m_auiEncounter[11] = uiData; + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiGlutExitDoorGUID); + DoUseDoorOrButton(m_uiThadDoorGUID); + } + break; + case TYPE_THADDIUS: + m_auiEncounter[12] = uiData; + DoUseDoorOrButton(m_uiThadDoorGUID, uiData); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiConsEyeRampGUID); + DoRespawnGameObject(m_uiConsPortalGUID, 30*MINUTE); + DoTaunt(); + } + break; + case TYPE_SAPPHIRON: + m_auiEncounter[13] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiKelthuzadDoorGUID); + break; + case TYPE_KELTHUZAD: + m_auiEncounter[14] = uiData; + DoUseDoorOrButton(m_uiKelthuzadExitDoorGUID); + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " " + << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11] << " " + << m_auiEncounter[12] << " " << m_auiEncounter[13] << " " << m_auiEncounter[14]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +void instance_naxxramas::Load(const char* chrIn) +{ + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] + >> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11] + >> m_auiEncounter[12] >> m_auiEncounter[13] >> m_auiEncounter[14]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +uint32 instance_naxxramas::GetData(uint32 uiType) +{ + switch(uiType) + { + case TYPE_ANUB_REKHAN: + return m_auiEncounter[0]; + case TYPE_FAERLINA: + return m_auiEncounter[1]; + case TYPE_MAEXXNA: + return m_auiEncounter[2]; + case TYPE_NOTH: + return m_auiEncounter[3]; + case TYPE_HEIGAN: + return m_auiEncounter[4]; + case TYPE_LOATHEB: + return m_auiEncounter[5]; + case TYPE_RAZUVIOUS: + return m_auiEncounter[6]; + case TYPE_GOTHIK: + return m_auiEncounter[7]; + case TYPE_FOUR_HORSEMEN: + return m_auiEncounter[8]; + case TYPE_PATCHWERK: + return m_auiEncounter[9]; + case TYPE_GROBBULUS: + return m_auiEncounter[10]; + case TYPE_GLUTH: + return m_auiEncounter[11]; + case TYPE_THADDIUS: + return m_auiEncounter[12]; + case TYPE_SAPPHIRON: + return m_auiEncounter[13]; + case TYPE_KELTHUZAD: + return m_auiEncounter[14]; + } + return 0; +} + +uint64 instance_naxxramas::GetData64(uint32 uiData) +{ + switch(uiData) + { + case NPC_ANUB_REKHAN: + return m_uiAnubRekhanGUID; + case NPC_FAERLINA: + return m_uiFaerlinanGUID; + case GO_MILI_GOTH_COMBAT_GATE: + return m_uiGothCombatGateGUID; + case NPC_DEATH_KNIGHT_UNDERSTUDY_1: + return m_uiDeathKnightUnderstudyGUID[0]; + case NPC_DEATH_KNIGHT_UNDERSTUDY_2: + return m_uiDeathKnightUnderstudyGUID[1]; + case NPC_DEATH_KNIGHT_UNDERSTUDY_3: + return m_uiDeathKnightUnderstudyGUID[2]; + case NPC_DEATH_KNIGHT_UNDERSTUDY_4: + return m_uiDeathKnightUnderstudyGUID[3]; + case NPC_ZELIEK: + return m_uiZeliekGUID; + case NPC_THANE: + return m_uiThaneGUID; + case NPC_BLAUMEUX: + return m_uiBlaumeuxGUID; + case NPC_RIVENDARE: + return m_uiRivendareGUID; + case NPC_THADDIUS: + return m_uiThaddiusGUID; + case NPC_STALAGG: + return m_uiStalaggGUID; + case NPC_FEUGEN: + return m_uiFeugenGUID; + case NPC_LOATHEB: + return m_uiLoathebGUID; + case NPC_HEIGAN: + return m_uiHeiganGUID; + case NPC_GOTHIK: + return m_uiGothikGUID; + case NPC_KELTHUZAD: + return m_uiKelthuzadGUID; + case NPC_WORSHIPPER_1: + return m_uiWorshipperGUID[0]; + case NPC_WORSHIPPER_2: + return m_uiWorshipperGUID[1]; + case NPC_WORSHIPPER_3: + return m_uiWorshipperGUID[2]; + case NPC_WORSHIPPER_4: + return m_uiWorshipperGUID[3]; + case NPC_FOLLOWER_1: + return m_uiFollowerGUID[0]; + case NPC_FOLLOWER_2: + return m_uiFollowerGUID[1]; + } + return 0; +} + +void instance_naxxramas::SetGothTriggers() +{ + Creature* pGoth = instance->GetCreature(m_uiGothikGUID); + + if (!pGoth) + return; + + for(std::list::iterator itr = m_lGothTriggerList.begin(); itr != m_lGothTriggerList.end(); ++itr) + { + if (Creature* pTrigger = instance->GetCreature(*itr)) + { + GothTrigger pGt; + pGt.bIsAnchorHigh = (pTrigger->GetPositionZ() >= (pGoth->GetPositionZ() - 5.0f)); + pGt.bIsRightSide = IsInRightSideGothArea(pTrigger); + + m_mGothTriggerMap[pTrigger->GetGUID()] = pGt; + } + } +} + +Creature* instance_naxxramas::GetClosestAnchorForGoth(Creature* pSource, bool bRightSide) +{ + std::list lList; + + for (UNORDERED_MAP::iterator itr = m_mGothTriggerMap.begin(); itr != m_mGothTriggerMap.end(); ++itr) + { + if (!itr->second.bIsAnchorHigh) + continue; + + if (itr->second.bIsRightSide != bRightSide) + continue; + + if (Creature* pCreature = instance->GetCreature(itr->first)) + lList.push_back(pCreature); + } + + if (!lList.empty()) + { + lList.sort(ObjectDistanceOrder(pSource)); + return lList.front(); + } + + return NULL; +} + +void instance_naxxramas::GetGothSummonPointCreatures(std::list &lList, bool bRightSide) +{ + for (UNORDERED_MAP::iterator itr = m_mGothTriggerMap.begin(); itr != m_mGothTriggerMap.end(); ++itr) + { + if (itr->second.bIsAnchorHigh) + continue; + + if (itr->second.bIsRightSide != bRightSide) + continue; + + if (Creature* pCreature = instance->GetCreature(itr->first)) + lList.push_back(pCreature); + } +} + +bool instance_naxxramas::IsInRightSideGothArea(Unit* pUnit) +{ + if (GameObject* pCombatGate = instance->GetGameObject(m_uiGothCombatGateGUID)) + return (pCombatGate->GetPositionY() >= pUnit->GetPositionY()); + + error_log("SD2: left/right side check, Gothik combat area failed."); + return true; +} + +void instance_naxxramas::SetChamberCenterCoords(float fX, float fY, float fZ) +{ + m_fChamberCenterX = fX; + m_fChamberCenterY = fY; + m_fChamberCenterZ = fZ; +} + +void instance_naxxramas::DoTaunt() +{ + Creature* pKelThuzad = instance->GetCreature(m_uiKelthuzadGUID); + + if (pKelThuzad && pKelThuzad->isAlive()) + { + uint8 uiWingsCleared = 0; + + if (m_auiEncounter[2] == DONE) + ++uiWingsCleared; + + if (m_auiEncounter[5] == DONE) + ++uiWingsCleared; + + if (m_auiEncounter[8] == DONE) + ++uiWingsCleared; + + if (m_auiEncounter[12] == DONE) + ++uiWingsCleared; + + switch(uiWingsCleared) + { + case 1: DoScriptText(SAY_KELTHUZAD_TAUNT1, pKelThuzad); break; + case 2: DoScriptText(SAY_KELTHUZAD_TAUNT2, pKelThuzad); break; + case 3: DoScriptText(SAY_KELTHUZAD_TAUNT3, pKelThuzad); break; + case 4: DoScriptText(SAY_KELTHUZAD_TAUNT4, pKelThuzad); break; + } + } +} + +InstanceData* GetInstanceData_instance_naxxramas(Map* pMap) +{ + return new instance_naxxramas(pMap); +} + +bool AreaTrigger_at_naxxramas(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (pAt->id == AREATRIGGER_KELTHUZAD) + { + if (pPlayer->isGameMaster() || pPlayer->isDead()) + return false; + + instance_naxxramas* pInstance = (instance_naxxramas*)pPlayer->GetInstanceData(); + + if (!pInstance) + return false; + + pInstance->SetChamberCenterCoords(pAt->x, pAt->y, pAt->z); + + if (pInstance->GetData(TYPE_KELTHUZAD) == NOT_STARTED) + { + if (Creature* pKelthuzad = pInstance->instance->GetCreature(pInstance->GetData64(NPC_KELTHUZAD))) + { + if (pKelthuzad->isAlive()) + { + pInstance->SetData(TYPE_KELTHUZAD, IN_PROGRESS); + pKelthuzad->SetInCombatWithZone(); + } + } + } + } + + return false; +} + +void AddSC_instance_naxxramas() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_naxxramas"; + pNewScript->GetInstanceData = &GetInstanceData_instance_naxxramas; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_naxxramas"; + pNewScript->pAreaTrigger = &AreaTrigger_at_naxxramas; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/naxxramas/naxxramas.h b/scripts/northrend/naxxramas/naxxramas.h new file mode 100644 index 0000000..8725309 --- /dev/null +++ b/scripts/northrend/naxxramas/naxxramas.h @@ -0,0 +1,261 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_NAXXRAMAS_H +#define DEF_NAXXRAMAS_H + +enum +{ + MAX_ENCOUNTER = 15, + + // Kel'Thuzad's taunts after killing Wing Bosses + SAY_KELTHUZAD_TAUNT1 = -1533090, + SAY_KELTHUZAD_TAUNT2 = -1533091, + SAY_KELTHUZAD_TAUNT3 = -1533092, + SAY_KELTHUZAD_TAUNT4 = -1533093, + + TYPE_ANUB_REKHAN = 1, + TYPE_FAERLINA = 2, + TYPE_MAEXXNA = 3, + + TYPE_NOTH = 4, + TYPE_HEIGAN = 5, + TYPE_LOATHEB = 6, + + TYPE_RAZUVIOUS = 7, + TYPE_GOTHIK = 8, + TYPE_FOUR_HORSEMEN = 9, + TYPE_BLAUMEUX = 91, + TYPE_RIVENDARE = 92, + TYPE_KORTHAZZ = 93, + TYPE_ZELIEK = 94, + + TYPE_PATCHWERK = 10, + TYPE_GROBBULUS = 11, + TYPE_GLUTH = 12, + TYPE_THADDIUS = 13, + TYPE_STALAGG = 14, + TYPE_FEUGEN = 15, + + TYPE_SAPPHIRON = 16, + TYPE_KELTHUZAD = 17, + + NPC_ANUB_REKHAN = 15956, + NPC_FAERLINA = 15953, + NPC_WORSHIPPER = 16506, + NPC_WORSHIPPER_1 = 165061, + NPC_WORSHIPPER_2 = 165062, + NPC_WORSHIPPER_3 = 165063, + NPC_WORSHIPPER_4 = 165064, + NPC_FOLLOWER = 16505, + NPC_FOLLOWER_1 = 165051, + NPC_FOLLOWER_2 = 165052, + + NPC_THADDIUS = 15928, + NPC_STALAGG = 15929, + NPC_FEUGEN = 15930, + + NPC_LOATHEB = 16011, + + NPC_HEIGAN = 15936, + + NPC_DEATH_KNIGHT_UNDERSTUDY = 16803, + NPC_DEATH_KNIGHT_UNDERSTUDY_1= 168031, + NPC_DEATH_KNIGHT_UNDERSTUDY_2= 168032, + NPC_DEATH_KNIGHT_UNDERSTUDY_3= 168033, + NPC_DEATH_KNIGHT_UNDERSTUDY_4= 168034, + + NPC_ZELIEK = 16063, + NPC_THANE = 16064, + NPC_BLAUMEUX = 16065, + NPC_RIVENDARE = 30549, + + NPC_KELTHUZAD = 15990, + + // Gothik + NPC_GOTHIK = 16060, + NPC_SUB_BOSS_TRIGGER = 16137, //summon locations + NPC_UNREL_TRAINEE = 16124, + NPC_UNREL_DEATH_KNIGHT = 16125, + NPC_UNREL_RIDER = 16126, + NPC_SPECT_TRAINEE = 16127, + NPC_SPECT_DEATH_KNIGTH = 16148, + NPC_SPECT_RIDER = 16150, + NPC_SPECT_HORSE = 16149, + + // End boss adds + NPC_SOLDIER_FROZEN = 16427, + NPC_UNSTOPPABLE_ABOM = 16428, + NPC_SOUL_WEAVER = 16429, + NPC_GUARDIAN = 16441, + + // Arachnid Quarter + GO_ARAC_ANUB_DOOR = 181126, //encounter door + GO_ARAC_ANUB_GATE = 181195, //open after boss is dead + GO_ARAC_FAER_WEB = 181235, //encounter door + GO_ARAC_FAER_DOOR = 194022, //after faerlina, to outer ring + GO_ARAC_MAEX_INNER_DOOR = 181197, //encounter door + GO_ARAC_MAEX_OUTER_DOOR = 181209, //right before maex + + // Plague Quarter + GO_PLAG_SLIME01_DOOR = 181198, //not used + GO_PLAG_SLIME02_DOOR = 181199, //not used + GO_PLAG_NOTH_ENTRY_DOOR = 181200, //encounter door + GO_PLAG_NOTH_EXIT_DOOR = 181201, //exit, open when boss dead + GO_PLAG_HEIG_ENTRY_DOOR = 181202, + GO_PLAG_HEIG_EXIT_DOOR = 181203, //exit, open when boss dead + GO_PLAG_LOAT_DOOR = 181241, //encounter door + + // Military Quarter + GO_MILI_GOTH_ENTRY_GATE = 181124, //used while encounter is in progress + GO_MILI_GOTH_EXIT_GATE = 181125, //exit, open at boss dead + GO_MILI_GOTH_COMBAT_GATE = 181170, //used while encounter is in progress + GO_MILI_HORSEMEN_DOOR = 181119, //encounter door + + GO_CHEST_HORSEMEN_NORM = 181366, //four horsemen event, DoRespawnGameObject() when event == DONE + GO_CHEST_HORSEMEN_HERO = 193426, + + // Construct Quarter + GO_CONS_PATH_EXIT_DOOR = 181123, + GO_CONS_GLUT_EXIT_DOOR = 181120, + GO_CONS_THAD_DOOR = 181121, // Thaddius enc door + + // Frostwyrm Lair + GO_KELTHUZAD_WATERFALL_DOOR = 181225, // exit, open after sapphiron is dead + GO_KELTHUZAD_EXIT_DOOR = 181228, + + // Eyes + GO_ARAC_EYE_RAMP = 181212, + GO_PLAG_EYE_RAMP = 181211, + GO_MILI_EYE_RAMP = 181210, + GO_CONS_EYE_RAMP = 181213, + + // Portals + GO_ARAC_PORTAL = 181575, + GO_PLAG_PORTAL = 181577, + GO_MILI_PORTAL = 181578, + GO_CONS_PORTAL = 181576, + + AREATRIGGER_FROSTWYRM = 4120, //not needed here, but AT to be scripted + AREATRIGGER_KELTHUZAD = 4112, + AREATRIGGER_GOTHIK = 4116 +}; + +struct GothTrigger +{ + bool bIsRightSide; + bool bIsAnchorHigh; +}; + +class MANGOS_DLL_DECL instance_naxxramas : public ScriptedInstance +{ + public: + instance_naxxramas(Map* pMap); + ~instance_naxxramas() {} + + void Initialize(); + + bool IsEncounterInProgress() const; + + void OnCreatureCreate(Creature* pCreature); + void OnObjectCreate(GameObject* pGo); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + // goth + void SetGothTriggers(); + Creature* GetClosestAnchorForGoth(Creature* pSource, bool bRightSide); + void GetGothSummonPointCreatures(std::list &lList, bool bRightSide); + bool IsInRightSideGothArea(Unit* pUnit); + + // kel + void SetChamberCenterCoords(float fX, float fY, float fZ); + void GetChamberCenterCoords(float &fX, float &fY, float &fZ) { fX = m_fChamberCenterX; fY = m_fChamberCenterY; fZ = m_fChamberCenterZ; } + void DoTaunt(); + + protected: + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiAracEyeRampGUID; + uint64 m_uiPlagEyeRampGUID; + uint64 m_uiMiliEyeRampGUID; + uint64 m_uiConsEyeRampGUID; + + uint64 m_uiAracPortalGUID; + uint64 m_uiPlagPortalGUID; + uint64 m_uiMiliPortalGUID; + uint64 m_uiConsPortalGUID; + + uint64 m_uiAnubRekhanGUID; + uint64 m_uiFaerlinanGUID; + uint64 m_uiWorshipperGUID[4]; + uint8 m_uiWorshipperCount; + uint64 m_uiFollowerGUID[2]; + uint8 m_uiFollowerCount; + + uint64 m_uiDeathKnightUnderstudyGUID[4]; + uint8 m_uiDeathKnightUnderstudyCount; + + uint64 m_uiZeliekGUID; + uint64 m_uiThaneGUID; + uint64 m_uiBlaumeuxGUID; + uint64 m_uiRivendareGUID; + + uint64 m_uiThaddiusGUID; + uint64 m_uiStalaggGUID; + uint64 m_uiFeugenGUID; + + uint64 m_uiLoathebGUID; + + uint64 m_uiHeiganGUID; + + uint64 m_uiKelthuzadGUID; + + uint64 m_uiPathExitDoorGUID; + uint64 m_uiGlutExitDoorGUID; + uint64 m_uiThadDoorGUID; + + uint64 m_uiAnubDoorGUID; + uint64 m_uiAnubGateGUID; + uint64 m_uiFaerDoorGUID; + uint64 m_uiFaerWebGUID; + uint64 m_uiMaexOuterGUID; + uint64 m_uiMaexInnerGUID; + + uint64 m_uiGothikGUID; + uint64 m_uiGothCombatGateGUID; + uint64 m_uiGothikEntryDoorGUID; + uint64 m_uiGothikExitDoorGUID; + std::list m_lGothTriggerList; + UNORDERED_MAP m_mGothTriggerMap; + + uint64 m_uiHorsemenDoorGUID; + uint64 m_uiHorsemenChestGUID; + + uint64 m_uiNothEntryDoorGUID; + uint64 m_uiNothExitDoorGUID; + uint64 m_uiHeigEntryDoorGUID; + uint64 m_uiHeigExitDoorGUID; + uint64 m_uiLoathebDoorGUID; + + uint64 m_uiKelthuzadDoorGUID; + uint64 m_uiKelthuzadExitDoorGUID; + + bool m_bBlaumeuxDead; + bool m_bRivendareDead; + bool m_bZeliekDead; + bool m_bKorthazzDead; + + float m_fChamberCenterX; + float m_fChamberCenterY; + float m_fChamberCenterZ; +}; + +#endif diff --git a/scripts/northrend/nexus/nexus/boss_anomalus.cpp b/scripts/northrend/nexus/nexus/boss_anomalus.cpp new file mode 100644 index 0000000..3015b13 --- /dev/null +++ b/scripts/northrend/nexus/nexus/boss_anomalus.cpp @@ -0,0 +1,248 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Anomalus +SD%Complete: 50% +SDComment: TODO: remove hacks, add support for rift charging +SDCategory: Nexus +EndScriptData */ + +#include "precompiled.h" +#include "nexus.h" + +enum +{ + SAY_AGGRO = -1576006, + SAY_RIFT = -1576007, + SAY_SHIELD = -1576008, + SAY_KILL = -1576009, + SAY_DEATH = -1576010, + EMOTE_OPEN_RIFT = -1576021, + EMOTE_SHIELD = -1576022, + + // Anomalus + SPELL_CREATE_RIFT = 47743, + SPELL_CHARGE_RIFT = 47747, + SPELL_RIFT_SHIELD = 47748, + + SPELL_SPARK = 47751, + SPELL_SPARK_H = 57062, + + SPELL_ARCANE_FORM = 48019, + // Chaotic Rift + SPELL_RIFT_AURA = 47687, + SPELL_RIFT_SUMMON_AURA = 47732, + + // Charged Chaotic Rift + SPELL_CHARGED_RIFT_AURA = 47733, + SPELL_CHARGED_RIFT_SUMMON_AURA = 47742, + + SPELL_SUMMON_CRAZED_MANA_WRAITH = 47692, + NPC_CHAOTIC_RIFT = 26918, + NPC_CRAZED_MANA_WRAITH = 26746 +}; + +/*###### +## boss_anomalus +######*/ + +struct MANGOS_DLL_DECL boss_anomalusAI : public ScriptedAI +{ + boss_anomalusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bChaoticRift; + uint32 m_uiSparkTimer; + uint32 m_uiCreateRiftTimer; + uint64 m_uiChaoticRiftGUID; + + void Reset() + { + m_bChaoticRift = false; + m_uiSparkTimer = 5000; + m_uiCreateRiftTimer = 25000; + m_uiChaoticRiftGUID = 0; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ANOMALUS, DONE); + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 1)) + DoScriptText(SAY_KILL, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_CHAOTIC_RIFT) + { + DoScriptText(SAY_RIFT, m_creature); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + void SummonedCreatureDespawn(Creature* pSummoned) + { + if (pSummoned->GetGUID() == m_uiChaoticRiftGUID) + { + if (m_creature->HasAura(SPELL_RIFT_SHIELD)) + m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); + + m_uiChaoticRiftGUID = 0; + } + } + + uint64 CreateRiftAtRandomPoint() + { + float fPosX, fPosY, fPosZ; + m_creature->GetPosition(fPosX, fPosY, fPosZ); + m_creature->GetRandomPoint(fPosX, fPosY, fPosZ, urand(15, 25), fPosX, fPosY, fPosZ); + + Creature* pRift = m_creature->SummonCreature(NPC_CHAOTIC_RIFT, fPosX, fPosY, fPosZ, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 1000); + DoScriptText(EMOTE_OPEN_RIFT, m_creature); + + return pRift?pRift->GetGUID():0; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || m_creature->HasAura(SPELL_RIFT_SHIELD)) + return; + + // Create additional Chaotic Rift at 50% HP + if (!m_bChaoticRift && m_creature->GetHealthPercent() < 50.0f) + { + DoScriptText(EMOTE_SHIELD, m_creature); + m_uiChaoticRiftGUID = CreateRiftAtRandomPoint(); + + DoScriptText(SAY_SHIELD, m_creature); + DoCastSpellIfCan(m_creature, SPELL_RIFT_SHIELD); + m_bChaoticRift = true; + return; + } + + if (m_uiCreateRiftTimer < uiDiff) + { + CreateRiftAtRandomPoint(); + m_uiCreateRiftTimer = 25000; + } + else + m_uiCreateRiftTimer -= uiDiff; + + if (m_uiSparkTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SPARK : SPELL_SPARK_H); + + m_uiSparkTimer = 5000; + } + else + m_uiSparkTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anomalus(Creature* pCreature) +{ + return new boss_anomalusAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI +{ + mob_chaotic_riftAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + uint32 m_uiSummonTimer; + + void Reset() + { + m_uiSummonTimer = 16000; + DoCastSpellIfCan(m_creature, SPELL_RIFT_AURA); + //DoCastSpellIfCan(m_creature, SPELL_RIFT_SUMMON_AURA); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_CRAZED_MANA_WRAITH) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_creature->HasAura(SPELL_ARCANE_FORM)) + DoCastSpellIfCan(m_creature, SPELL_ARCANE_FORM); + + if (m_uiSummonTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_CRAZED_MANA_WRAITH); + m_uiSummonTimer = 16000; + } + else + m_uiSummonTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_mob_chaotic_rift(Creature* pCreature) +{ + return new mob_chaotic_riftAI(pCreature); +} + +void AddSC_boss_anomalus() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_anomalus"; + newscript->GetAI = &GetAI_boss_anomalus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_chaotic_rift"; + newscript->GetAI = &GetAI_mob_chaotic_rift; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/nexus/nexus/boss_keristrasza.cpp b/scripts/northrend/nexus/nexus/boss_keristrasza.cpp new file mode 100644 index 0000000..415f93e --- /dev/null +++ b/scripts/northrend/nexus/nexus/boss_keristrasza.cpp @@ -0,0 +1,219 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Keristrasza +SD%Complete: 65% +SDComment: timers tuning, add achievement +SDCategory: Nexus +EndScriptData */ + +#include "precompiled.h" +#include "nexus.h" + +enum +{ + SAY_AGGRO = -1576016, + SAY_CRYSTAL_NOVA = -1576017, + SAY_ENRAGE = -1576018, + SAY_KILL = -1576019, + SAY_DEATH = -1576020, + + SPELL_INTENSE_COLD = 48094, + + SPELL_CRYSTALFIRE_BREATH = 48096, + SPELL_CRYSTALFIRE_BREATH_H = 57091, + + SPELL_CRYSTALLIZE = 48179, + + SPELL_CRYSTAL_CHAINS = 50997, + + SPELL_TAIL_SWEEP = 50155, + + SPELL_ENRAGE = 8599 +}; + +/*###### +## boss_keristrasza +######*/ + +struct MANGOS_DLL_DECL boss_keristraszaAI : public ScriptedAI +{ + boss_keristraszaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 uiCrystalChainTimer; + uint32 uiTailSweepTimer; + uint32 uiCrystalfireBreathTimer; + uint32 uiCrystallizeTimer; + + bool m_bIsEnraged; + + void Reset() + { + uiCrystalChainTimer = 30000; + uiTailSweepTimer = urand(5000, 7500); + uiCrystalfireBreathTimer = urand(10000, 20000); + uiCrystallizeTimer = urand(20000, 30000); + + m_bIsEnraged = false; + + if (!m_pInstance) + return; + + if (m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_KERISTRASZA) != SPECIAL) + m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, true); + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->CastSpell(m_creature, SPELL_INTENSE_COLD, true); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KERISTRASZA, DONE); + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 1)) + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsEnraged && m_creature->GetHealthPercent() < 25.0f) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_bIsEnraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + } + } + + if (uiCrystalChainTimer < uiDiff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + if (m_bIsRegularMode) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + { + if (Player* pPlayer = pTarget->GetCharmerOrOwnerPlayerOrPlayerItself()) + DoCastSpellIfCan(pPlayer, SPELL_CRYSTAL_CHAINS); + + uiCrystalChainTimer = 30000; + } + } + else + { + if (Unit* pSource = m_creature->getVictim()) + { + uiCrystalChainTimer = 15000; + + Player* pPlayer = pSource->GetCharmerOrOwnerPlayerOrPlayerItself(); + + if (!pPlayer) + return; + + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (pMember->isAlive() && pMember->IsWithinDistInMap(m_creature, 50.0f)) + m_creature->CastSpell(pMember, SPELL_CRYSTAL_CHAINS, true); + } + } + } + else + m_creature->CastSpell(pPlayer, SPELL_CRYSTAL_CHAINS, false); + } + } + } + } + else + uiCrystalChainTimer -= uiDiff; + + if (uiTailSweepTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_TAIL_SWEEP) == CAST_OK) + uiTailSweepTimer = urand(2500, 7500); + } + else + uiCrystalChainTimer -= uiDiff; + + if (uiCrystalfireBreathTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_CRYSTALFIRE_BREATH : SPELL_CRYSTALFIRE_BREATH_H) == CAST_OK) + uiCrystalfireBreathTimer = urand(15000, 20000); + } + else + uiCrystalfireBreathTimer -= uiDiff; + + if (!m_bIsRegularMode) + { + if (uiCrystallizeTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_CRYSTALLIZE) == CAST_OK) + { + uiCrystallizeTimer = urand(15000, 25000); + DoScriptText(SAY_CRYSTAL_NOVA, m_creature); + } + } + else + uiCrystallizeTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_keristrasza(Creature* pCreature) +{ + return new boss_keristraszaAI(pCreature); +} + +void AddSC_boss_keristrasza() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_keristrasza"; + newscript->GetAI = &GetAI_boss_keristrasza; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/nexus/nexus/boss_ormorok.cpp b/scripts/northrend/nexus/nexus/boss_ormorok.cpp new file mode 100644 index 0000000..0a77e98 --- /dev/null +++ b/scripts/northrend/nexus/nexus/boss_ormorok.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ormorok +SD%Complete: 50% +SDComment: TODO: Correct timers. Research how spikes work, and attempt code it properly from mangos side. +SDCategory: Nexus +EndScriptData */ + +#include "precompiled.h" +#include "nexus.h" + +enum +{ + SAY_AGGRO = -1576011, + SAY_KILL = -1576012, + SAY_REFLECT = -1576013, + SAY_ICESPIKE = -1576014, + SAY_DEATH = -1576015, + EMOTE_BOSS_GENERIC_FRENZY = -1000005, + + SPELL_REFLECTION = 47981, + + SPELL_CRYSTAL_SPIKES = 47958, + SPELL_CRYSTAL_SPIKES_H1 = 57082, + SPELL_CRYSTAL_SPIKES_H2 = 57083, + + SPELL_FRENZY = 48017, + SPELL_FRENZY_H = 57086, + + SPELL_TRAMPLE = 48016, + SPELL_TRAMPLE_H = 57066, + + SPELL_SUMMON_TANGLER_H = 61564 +}; + +/*###### +## boss_ormorok +######*/ + +struct MANGOS_DLL_DECL boss_ormorokAI : public ScriptedAI +{ + boss_ormorokAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bIsEnraged; + + uint32 m_uiTrampleTimer; + uint32 m_uiSpellReflectTimer; + uint32 m_uiCrystalSpikeTimer; + uint32 m_uiTanglerTimer; + + void Reset() + { + m_bIsEnraged = false; + + m_uiTrampleTimer = urand(10000, 35000); + m_uiSpellReflectTimer = urand(5000, 10000); + m_uiCrystalSpikeTimer = urand(15000, 30000); + m_uiTanglerTimer = 20000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ORMOROK, DONE); + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 1)) + DoScriptText(SAY_KILL, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + pSummoned->AI()->AttackStart(pTarget); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsEnraged && m_creature->GetHealthPercent() < 25.0f) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_bIsEnraged = true; + DoScriptText(EMOTE_BOSS_GENERIC_FRENZY, m_creature); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FRENZY : SPELL_FRENZY_H); + } + } + + if (m_uiTrampleTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_TRAMPLE : SPELL_TRAMPLE_H); + m_uiTrampleTimer = urand(10000, 35000); + } + else + m_uiTrampleTimer -= uiDiff; + + if (m_uiSpellReflectTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_REFLECTION); + m_uiSpellReflectTimer = urand(25000, 40000); + } + else + m_uiSpellReflectTimer -= uiDiff; + + if (m_uiCrystalSpikeTimer < uiDiff) + { + DoScriptText(SAY_ICESPIKE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_CRYSTAL_SPIKES); + m_uiCrystalSpikeTimer = urand(15000, 30000); + } + else + m_uiCrystalSpikeTimer -= uiDiff; + + if (!m_bIsRegularMode) + { + if (m_uiTanglerTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_TANGLER_H); + m_uiTanglerTimer = urand(15000, 25000); + } + else + m_uiTanglerTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ormorok(Creature* pCreature) +{ + return new boss_ormorokAI(pCreature); +} + +void AddSC_boss_ormorok() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ormorok"; + newscript->GetAI = &GetAI_boss_ormorok; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/nexus/nexus/boss_telestra.cpp b/scripts/northrend/nexus/nexus/boss_telestra.cpp new file mode 100644 index 0000000..cfcc5ef --- /dev/null +++ b/scripts/northrend/nexus/nexus/boss_telestra.cpp @@ -0,0 +1,260 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Telestra +SD%Complete: 80% +SDComment: script depend on database spell support and eventAi for clones. transition to phase 2 also not fully implemented +SDCategory: Nexus +EndScriptData */ + +#include "precompiled.h" +#include "nexus.h" + +enum +{ + SAY_AGGRO = -1576000, + SAY_SPLIT_1 = -1576001, + SAY_SPLIT_2 = -1576002, + SAY_MERGE = -1576003, + SAY_KILL = -1576004, + SAY_DEATH = -1576005, + + SPELL_FIREBOMB = 47773, + SPELL_FIREBOMB_H = 56934, + + SPELL_ICE_NOVA = 47772, + SPELL_ICE_NOVA_H = 56935, + + SPELL_GRAVITY_WELL = 47756, + + SPELL_SUMMON_CLONES = 47710, + + SPELL_ARCANE_VISUAL = 47704, + SPELL_FIRE_VISUAL = 47705, + SPELL_FROST_VISUAL = 47706, + + SPELL_SUMMON_FIRE = 47707, + SPELL_SUMMON_ARCANE = 47708, + SPELL_SUMMON_FROST = 47709, + + SPELL_FIRE_DIES = 47711, // cast by clones at their death + SPELL_ARCANE_DIES = 47713, + SPELL_FROST_DIES = 47712, + + SPELL_SPAWN_BACK_IN = 47714, + + NPC_TELEST_FIRE = 26928, + NPC_TELEST_ARCANE = 26929, + NPC_TELEST_FROST = 26930, + + PHASE_1 = 1, + PHASE_2 = 2, + PHASE_3 = 3, + PHASE_4 = 4 +}; + +/*###### +## boss_telestra +######*/ + +struct MANGOS_DLL_DECL boss_telestraAI : public ScriptedAI +{ + boss_telestraAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint8 m_uiPhase; + uint8 m_uiCloneDeadCount; + + uint32 m_uiFirebombTimer; + uint32 m_uiIceNovaTimer; + uint32 m_uiGravityWellTimer; + + void Reset() + { + m_uiPhase = PHASE_1; + m_uiCloneDeadCount = 0; + + m_uiFirebombTimer = urand(2000, 4000); + m_uiIceNovaTimer = urand(8000, 12000); + m_uiGravityWellTimer = urand(15000, 25000); + } + + void JustReachedHome() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 15.0f); + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_TELESTRA, DONE); + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 1)) + DoScriptText(SAY_KILL, m_creature); + } + + void SpellHit(Unit* pCaster, const SpellEntry *pSpell) + { + switch(pSpell->Id) + { + // eventAi must make sure clones cast spells when each of them die + case SPELL_FIRE_DIES: + case SPELL_ARCANE_DIES: + case SPELL_FROST_DIES: + { + ++m_uiCloneDeadCount; + + if (m_uiCloneDeadCount == 3 || m_uiCloneDeadCount == 6) + { + m_creature->RemoveAurasDueToSpell(SPELL_SUMMON_CLONES); + m_creature->CastSpell(m_creature, SPELL_SPAWN_BACK_IN, false); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_MERGE, m_creature); + + m_uiPhase = m_uiCloneDeadCount == 3 ? PHASE_3 : PHASE_4; + } + break; + } + case SPELL_SUMMON_CLONES: + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_TELEST_FIRE: pSummoned->CastSpell(pSummoned, SPELL_FIRE_VISUAL, true); break; + case NPC_TELEST_ARCANE: pSummoned->CastSpell(pSummoned, SPELL_ARCANE_VISUAL, true); break; + case NPC_TELEST_FROST: pSummoned->CastSpell(pSummoned, SPELL_FROST_VISUAL, true); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + switch(m_uiPhase) + { + case PHASE_1: + case PHASE_3: + case PHASE_4: + { + if (!m_creature->GetCurrentSpell(CURRENT_CHANNELED_SPELL)) + { + if (m_uiFirebombTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FIREBOMB : SPELL_FIREBOMB_H) == CAST_OK) + m_uiFirebombTimer = urand(4000, 6000); + } + else + m_uiFirebombTimer -= uiDiff; + + if (m_uiIceNovaTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ICE_NOVA : SPELL_ICE_NOVA_H) == CAST_OK) + m_uiIceNovaTimer = urand(10000, 15000); + } + else + m_uiIceNovaTimer -= uiDiff; + + if (m_uiPhase == PHASE_1 && m_creature->GetHealthPercent() < 50.0f) + { + if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_CLONES, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_SPLIT_1 : SAY_SPLIT_2, m_creature); + m_uiPhase = PHASE_2; + } + } + + if (m_uiPhase == PHASE_3 && !m_bIsRegularMode && m_creature->GetHealthPercent() < 15.0f) + { + if (DoCastSpellIfCan(m_creature, SPELL_SUMMON_CLONES, CAST_INTERRUPT_PREVIOUS) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_SPLIT_1 : SAY_SPLIT_2, m_creature); + m_uiPhase = PHASE_2; + } + } + + DoMeleeAttackIfReady(); + } + + if (m_uiGravityWellTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, SPELL_GRAVITY_WELL) == CAST_OK) + m_uiGravityWellTimer = urand(15000, 30000); + } + else + m_uiGravityWellTimer -= uiDiff; + + break; + } + case PHASE_2: + { + break; + } + } + } +}; + +CreatureAI* GetAI_boss_telestra(Creature* pCreature) +{ + return new boss_telestraAI(pCreature); +} + +void AddSC_boss_telestra() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_telestra"; + newscript->GetAI = &GetAI_boss_telestra; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/nexus/nexus/instance_nexus.cpp b/scripts/northrend/nexus/nexus/instance_nexus.cpp new file mode 100644 index 0000000..66266da --- /dev/null +++ b/scripts/northrend/nexus/nexus/instance_nexus.cpp @@ -0,0 +1,259 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_nexus +SD%Complete: 75% +SDComment: +SDCategory: The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "nexus.h" + +bool GOHello_go_containment_sphere(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + switch(pGo->GetEntry()) + { + case GO_CONTAINMENT_SPHERE_TELESTRA: pInstance->SetData(TYPE_TELESTRA, SPECIAL); break; + case GO_CONTAINMENT_SPHERE_ANOMALUS: pInstance->SetData(TYPE_ANOMALUS, SPECIAL); break; + case GO_CONTAINMENT_SPHERE_ORMOROK: pInstance->SetData(TYPE_ORMOROK, SPECIAL); break; + } + + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + return false; +} + +struct MANGOS_DLL_DECL instance_nexus : public ScriptedInstance +{ + instance_nexus(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiAnomalusGUID; + uint64 m_uiKeristrazaGUID; + + uint64 m_uiTelestrasContainmentSphereGUID; + uint64 m_uiAnomalusContainmentSphereGUID; + uint64 m_uiOrmoroksContainmentSphereGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiAnomalusGUID = 0; + m_uiKeristrazaGUID = 0; + + m_uiTelestrasContainmentSphereGUID = 0; + m_uiAnomalusContainmentSphereGUID = 0; + m_uiOrmoroksContainmentSphereGUID = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + } + + return false; + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_CONTAINMENT_SPHERE_TELESTRA: + m_uiTelestrasContainmentSphereGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_CONTAINMENT_SPHERE_ANOMALUS: + m_uiAnomalusContainmentSphereGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_CONTAINMENT_SPHERE_ORMOROK: + m_uiOrmoroksContainmentSphereGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_ANOMALUS: + m_uiAnomalusGUID = pCreature->GetGUID(); + break; + case NPC_KERISTRASZA: + m_uiKeristrazaGUID = pCreature->GetGUID(); + break; + } + } + + uint64 GetData64(uint32 uiType) + { + switch(uiType) + { + case NPC_ANOMALUS: + return m_uiAnomalusGUID; + } + + return 0; + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_TELESTRA: + return m_auiEncounter[0]; + case TYPE_ANOMALUS: + return m_auiEncounter[1]; + case TYPE_ORMOROK: + return m_auiEncounter[2]; + case TYPE_KERISTRASZA: + return m_auiEncounter[3]; + } + + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Nexus: SetData received for type %u with data %u", uiType, uiData); + + switch(uiType) + { + case TYPE_TELESTRA: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + { + if (GameObject* pGo = instance->GetGameObject(m_uiTelestrasContainmentSphereGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + break; + case TYPE_ANOMALUS: + m_auiEncounter[1] = uiData; + if (uiData == DONE) + { + if (GameObject* pGo = instance->GetGameObject(m_uiAnomalusContainmentSphereGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + break; + case TYPE_ORMOROK: + m_auiEncounter[2] = uiData; + if (uiData == DONE) + { + if (GameObject* pGo = instance->GetGameObject(m_uiOrmoroksContainmentSphereGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + break; + case TYPE_KERISTRASZA: + m_auiEncounter[3] = uiData; + break; + default: + error_log("SD2: Instance Nexus: ERROR SetData = %u for type %u does not exist/not implemented.", uiType, uiData); + break; + } + + if (m_auiEncounter[0] == SPECIAL && m_auiEncounter[1] == SPECIAL && m_auiEncounter[2] == SPECIAL) + { + // release Keristrasza from her prison here + m_auiEncounter[3] = SPECIAL; + + if (Creature* pCreature = instance->GetCreature(m_uiKeristrazaGUID)) + { + if (pCreature->isAlive()) + { + pCreature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + } + } + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_nexus(Map* pMap) +{ + return new instance_nexus(pMap); +} + +void AddSC_instance_nexus() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "instance_nexus"; + newscript->GetInstanceData = &GetInstanceData_instance_nexus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_containment_sphere"; + newscript->pGOHello = &GOHello_go_containment_sphere; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/nexus/nexus/nexus.h b/scripts/northrend/nexus/nexus/nexus.h new file mode 100644 index 0000000..5da01c0 --- /dev/null +++ b/scripts/northrend/nexus/nexus/nexus.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_NEXUS_H +#define DEF_NEXUS_H + +enum +{ + MAX_ENCOUNTER = 4, + + TYPE_TELESTRA = 0, + TYPE_ANOMALUS = 1, + TYPE_ORMOROK = 2, + TYPE_KERISTRASZA = 3, + + NPC_TELESTRA = 26731, + NPC_ANOMALUS = 26763, + NPC_ORMOROK = 26794, + NPC_KERISTRASZA = 26723, + + GO_CONTAINMENT_SPHERE_TELESTRA = 188526, + GO_CONTAINMENT_SPHERE_ANOMALUS = 188527, + GO_CONTAINMENT_SPHERE_ORMOROK = 188528, + + SPELL_FROZEN_PRISON = 47854 // may not be correct spell +}; +#endif diff --git a/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp new file mode 100644 index 0000000..023781c --- /dev/null +++ b/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -0,0 +1,1144 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Sartharion +SD%Complete: 70% +SDComment: Flame wave, achievement and portal events need to be implemented +SDCategory: Obsidian Sanctum +EndScriptData */ + +#include "precompiled.h" +#include "obsidian_sanctum.h" + +enum +{ + //Sartharion Yell + SAY_SARTHARION_AGGRO = -1615018, + SAY_SARTHARION_BERSERK = -1615019, + SAY_SARTHARION_BREATH = -1615020, + SAY_SARTHARION_CALL_SHADRON = -1615021, + SAY_SARTHARION_CALL_TENEBRON = -1615022, + SAY_SARTHARION_CALL_VESPERON = -1615023, + SAY_SARTHARION_DEATH = -1615024, + SAY_SARTHARION_SPECIAL_1 = -1615025, + SAY_SARTHARION_SPECIAL_2 = -1615026, + SAY_SARTHARION_SPECIAL_3 = -1615027, + SAY_SARTHARION_SPECIAL_4 = -1615028, + SAY_SARTHARION_SLAY_1 = -1615029, + SAY_SARTHARION_SLAY_2 = -1615030, + SAY_SARTHARION_SLAY_3 = -1615031, + + WHISPER_LAVA_CHURN = -1615032, + + WHISPER_SHADRON_DICIPLE = -1615008, + WHISPER_VESPERON_DICIPLE = -1615041, + WHISPER_HATCH_EGGS = -1615017, + WHISPER_OPEN_PORTAL = -1615042, // whisper, shared by two dragons + + //Sartharion Spells + SPELL_BERSERK = 61632, // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min. + SPELL_CLEAVE = 56909, // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets. + SPELL_FLAME_BREATH = 56908, // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster. + SPELL_FLAME_BREATH_H = 58956, // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster. + SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. + SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. + SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. + SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) + SPELL_TWILIGHT_REVENGE = 60639, + + SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes + SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x creature entry 30494) + + SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO + SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase + SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave) + + //Mini bosses common spells + SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase + + //Miniboses (Vesperon, Shadron, Tenebron) + SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster. + SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster. + + SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec. + SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec. + + //Vesperon + //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times + NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon + SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%. + SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988 + SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988 + + //Shadron + //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times + NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron + SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%. + SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron + SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion + + //Tenebron + //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708 + SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%. + //Tenebron, dummy spell + SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP + SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP + + SPELL_HATCH_EGGS_H = 59189, + SPELL_HATCH_EGGS = 58542, + SPELL_HATCH_EGGS_EFFECT_H = 59190, + SPELL_HATCH_EGGS_EFFECT = 58685, + + //Whelps + NPC_TWILIGHT_WHELP = 30890, + NPC_SHARTHARION_TWILIGHT_WHELP = 31214, + SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s + + //flame tsunami + SPELL_FLAME_TSUNAMI = 57494, // the visual dummy + SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction + SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // periodic damage, npc has this aura + + NPC_FLAME_TSUNAMI = 30616, // for the flame waves + NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike + + //using these custom points for dragons start and end + POINT_ID_INIT = 100, + POINT_ID_LAND = 200 +}; + +struct Waypoint +{ + float m_fX, m_fY, m_fZ; +}; + +//each dragons special points. First where fly to before connect to connon, second where land point is. +Waypoint m_aTene[]= +{ + {3212.854f, 575.597f, 109.856f}, //init + {3246.425f, 565.367f, 61.249f} //end +}; + +Waypoint m_aShad[]= +{ + {3293.238f, 472.223f, 106.968f}, + {3271.669f, 526.907f, 61.931f} +}; + +Waypoint m_aVesp[]= +{ + {3193.310f, 472.861f, 102.697f}, + {3227.268f, 533.238f, 59.995f} +}; + +//points around raid "isle", counter clockwise. should probably be adjusted to be more alike +Waypoint m_aDragonCommon[]= +{ + {3214.012f, 468.932f, 98.652f}, + {3244.950f, 468.427f, 98.652f}, + {3283.520f, 496.869f, 98.652f}, + {3287.316f, 555.875f, 98.652f}, + {3250.479f, 585.827f, 98.652f}, + {3209.969f, 566.523f, 98.652f} +}; + +/*###### +## Boss Sartharion +######*/ + +struct MANGOS_DLL_DECL boss_sartharionAI : public ScriptedAI +{ + boss_sartharionAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bIsBerserk; + bool m_bIsSoftEnraged; + + uint32 m_uiEnrageTimer; + bool m_bIsHardEnraged; + + uint32 m_uiTenebronTimer; + uint32 m_uiShadronTimer; + uint32 m_uiVesperonTimer; + + uint32 m_uiFlameTsunamiTimer; + uint32 m_uiFlameBreathTimer; + uint32 m_uiTailSweepTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiLavaStrikeTimer; + + bool m_bHasCalledTenebron; + bool m_bHasCalledShadron; + bool m_bHasCalledVesperon; + + void Reset() + { + m_bIsBerserk = false; + m_bIsSoftEnraged = false; + + m_uiEnrageTimer = MINUTE*15*IN_MILLISECONDS; + m_bIsHardEnraged = false; + + m_uiTenebronTimer = 30000; + m_uiShadronTimer = 75000; + m_uiVesperonTimer = 120000; + + m_uiFlameTsunamiTimer = 30000; + m_uiFlameBreathTimer = 20000; + m_uiTailSweepTimer = 20000; + m_uiCleaveTimer = 7000; + m_uiLavaStrikeTimer = 5000; + + m_bHasCalledTenebron = false; + m_bHasCalledShadron = false; + m_bHasCalledVesperon = false; + + if (m_creature->HasAura(SPELL_TWILIGHT_REVENGE)) + m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_SARTHARION_AGGRO,m_creature); + + m_creature->SetInCombatWithZone(); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_SARTHARION_EVENT, IN_PROGRESS); + FetchDragons(); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_SARTHARION_DEATH,m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SARTHARION_EVENT, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SARTHARION_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SARTHARION_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SARTHARION_SLAY_3, m_creature); break; + } + } + + void FetchDragons() + { + Creature* pTene = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_TENEBRON)); + Creature* pShad = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SHADRON)); + Creature* pVesp = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_VESPERON)); + + //if at least one of the dragons are alive and are being called + bool bCanUseWill = false; + + if (pTene && pTene->isAlive() && !pTene->getVictim()) + { + bCanUseWill = true; + pTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); + + if (!pTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (pShad && pShad->isAlive() && !pShad->getVictim()) + { + bCanUseWill = true; + pShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); + + if (!pShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (pVesp && pVesp->isAlive() && !pVesp->getVictim()) + { + bCanUseWill = true; + pVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); + + if (!pVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (bCanUseWill) + DoCastSpellIfCan(m_creature, SPELL_WILL_OF_SARTHARION); + } + + void CallDragon(uint32 uiDataId) + { + if (m_pInstance) + { + Creature* pTemp = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(uiDataId)); + + if (pTemp && pTemp->isAlive() && !pTemp->getVictim()) + { + if (pTemp->HasSplineFlag(SPLINEFLAG_WALKMODE)) + pTemp->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + + if (pTemp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + int32 iTextId = 0; + + switch(pTemp->GetEntry()) + { + case NPC_TENEBRON: + iTextId = SAY_SARTHARION_CALL_TENEBRON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); + break; + case NPC_SHADRON: + iTextId = SAY_SARTHARION_CALL_SHADRON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); + break; + case NPC_VESPERON: + iTextId = SAY_SARTHARION_CALL_VESPERON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); + break; + } + + DoScriptText(iTextId, m_creature); + } + } + } + + void SendFlameTsunami() + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive()) + DoScriptText(WHISPER_LAVA_CHURN, m_creature,i->getSource()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //spell will target dragons, if they are still alive at 35% + if (!m_bIsBerserk && m_creature->GetHealthPercent() < 35.0f) + { + DoScriptText(SAY_SARTHARION_BERSERK, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + m_bIsBerserk = true; + } + + //soft enrage + if (!m_bIsSoftEnraged && m_creature->GetHealthPercent() <= 10.0f) + { + // TODO + m_bIsSoftEnraged = true; + } + + // hard enrage + if (!m_bIsHardEnraged) + { + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_PYROBUFFET, CAST_TRIGGERED); + m_bIsHardEnraged = true; + } + else + m_uiEnrageTimer -= uiDiff; + } + + // flame tsunami + if (m_uiFlameTsunamiTimer < uiDiff) + { + SendFlameTsunami(); + m_uiFlameTsunamiTimer = 30000; + } + else + m_uiFlameTsunamiTimer -= uiDiff; + + // flame breath + if (m_uiFlameBreathTimer < uiDiff) + { + DoScriptText(SAY_SARTHARION_BREATH, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_FLAME_BREATH : SPELL_FLAME_BREATH_H); + m_uiFlameBreathTimer = urand(25000, 35000); + } + else + m_uiFlameBreathTimer -= uiDiff; + + // Tail Sweep + if (m_uiTailSweepTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_TAIL_LASH : SPELL_TAIL_LASH_H); + m_uiTailSweepTimer = urand(15000, 20000); + } + else + m_uiTailSweepTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = urand(7000, 10000); + } + else + m_uiCleaveTimer -= uiDiff; + + // Lavas Strike + if (m_uiLavaStrikeTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(pTarget, SPELL_LAVA_STRIKE); + + switch(urand(0, 15)) + { + case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; + case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; + case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; + } + } + m_uiLavaStrikeTimer = urand(5000, 20000); + } + else + m_uiLavaStrikeTimer -= uiDiff; + + // call tenebron + if (!m_bHasCalledTenebron && m_uiTenebronTimer < uiDiff) + { + CallDragon(DATA_TENEBRON); + m_bHasCalledTenebron = true; + } + else + m_uiTenebronTimer -= uiDiff; + + // call shadron + if (!m_bHasCalledShadron && m_uiShadronTimer < uiDiff) + { + CallDragon(DATA_SHADRON); + m_bHasCalledShadron = true; + } + else + m_uiShadronTimer -= uiDiff; + + // call vesperon + if (!m_bHasCalledVesperon && m_uiVesperonTimer < uiDiff) + { + CallDragon(DATA_VESPERON); + m_bHasCalledVesperon = true; + } + else + m_uiVesperonTimer -= uiDiff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(uiDiff); + } +}; + +CreatureAI* GetAI_boss_sartharion(Creature* pCreature) +{ + return new boss_sartharionAI(pCreature); +} + +enum TeneText +{ + SAY_TENEBRON_AGGRO = -1615009, + SAY_TENEBRON_SLAY_1 = -1615010, + SAY_TENEBRON_SLAY_2 = -1615011, + SAY_TENEBRON_DEATH = -1615012, + SAY_TENEBRON_BREATH = -1615013, + SAY_TENEBRON_RESPOND = -1615014, + SAY_TENEBRON_SPECIAL_1 = -1615015, + SAY_TENEBRON_SPECIAL_2 = -1615016 +}; + +enum ShadText +{ + SAY_SHADRON_AGGRO = -1615000, + SAY_SHADRON_SLAY_1 = -1615001, + SAY_SHADRON_SLAY_2 = -1615002, + SAY_SHADRON_DEATH = -1615003, + SAY_SHADRON_BREATH = -1615004, + SAY_SHADRON_RESPOND = -1615005, + SAY_SHADRON_SPECIAL_1 = -1615006, + SAY_SHADRON_SPECIAL_2 = -1615007 +}; + +enum VespText +{ + SAY_VESPERON_AGGRO = -1615033, + SAY_VESPERON_SLAY_1 = -1615034, + SAY_VESPERON_SLAY_2 = -1615035, + SAY_VESPERON_DEATH = -1615036, + SAY_VESPERON_BREATH = -1615037, + SAY_VESPERON_RESPOND = -1615038, + SAY_VESPERON_SPECIAL_1 = -1615039, + SAY_VESPERON_SPECIAL_2 = -1615040 +}; + +//to control each dragons common abilities +struct MANGOS_DLL_DECL dummy_dragonAI : public ScriptedAI +{ + dummy_dragonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiWaypointId; + uint32 m_uiMoveNextTimer; + int32 m_iPortalRespawnTime; + bool m_bCanMoveFree; + + void Reset() + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiWaypointId = 0; + m_uiMoveNextTimer = 500; + m_iPortalRespawnTime = 30000; + m_bCanMoveFree = false; + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (!m_pInstance || uiType != POINT_MOTION_TYPE) + return; + + debug_log("dummy_dragonAI: %s reached point %u", m_creature->GetName(), uiPointId); + + //if healers messed up the raid and we was already initialized + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + { + EnterEvadeMode(); + return; + } + + //this is the end (!) + if (uiPointId == POINT_ID_LAND) + { + m_creature->GetMotionMaster()->Clear(); + m_bCanMoveFree = false; + m_creature->SetInCombatWithZone(); + return; + } + + //get amount of common points + uint32 uiCommonWPCount = sizeof(m_aDragonCommon)/sizeof(Waypoint); + + //increase + m_uiWaypointId = uiPointId+1; + + //if we have reached a point bigger or equal to count, it mean we must reset to point 0 + if (m_uiWaypointId >= uiCommonWPCount) + { + if (!m_bCanMoveFree) + m_bCanMoveFree = true; + + m_uiWaypointId = 0; + } + + m_uiMoveNextTimer = 500; + } + + //used when open portal and spawn mobs in phase + void DoRaidWhisper(int32 iTextId) + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + DoScriptText(iTextId, m_creature, i->getSource()); + } + } + } + + //"opens" the portal and does the "opening" whisper + void OpenPortal() + { + int32 iTextId = 0; + + //there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database + + //using a grid search here seem to be more efficient than caching all four guids + //in instance script and calculate range to each. + GameObject* pPortal = GetClosestGameObjectWithEntry(m_creature,GO_TWILIGHT_PORTAL,50.0f); + + switch(m_creature->GetEntry()) + { + case NPC_TENEBRON: + iTextId = WHISPER_HATCH_EGGS; + break; + case NPC_SHADRON: + case NPC_VESPERON: + iTextId = WHISPER_OPEN_PORTAL; + break; + } + + DoRaidWhisper(iTextId); + + //By using SetRespawnTime() we will actually "spawn" the object with our defined time. + //Once time is up, portal will disappear again. + if (pPortal && !pPortal->isSpawned()) + { + pPortal->SetRespawnTime(m_iPortalRespawnTime); + pPortal->Refresh(); + } + + //Unclear what are expected to happen if one drake has a portal open already + //Refresh respawnTime so time again are set to 30secs? + } + + //Removes each drakes unique debuff from players + void RemoveDebuff(uint32 uiSpellId) + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->HasAura(uiSpellId)) + i->getSource()->RemoveAurasDueToSpell(uiSpellId); + } + } + } + + void JustDied(Unit* pKiller) + { + int32 iTextId = 0; + uint32 uiSpellId = 0; + + switch(m_creature->GetEntry()) + { + case NPC_TENEBRON: + iTextId = SAY_TENEBRON_DEATH; + uiSpellId = SPELL_POWER_OF_TENEBRON; + break; + case NPC_SHADRON: + iTextId = SAY_SHADRON_DEATH; + uiSpellId = SPELL_POWER_OF_SHADRON; + break; + case NPC_VESPERON: + iTextId = SAY_VESPERON_DEATH; + uiSpellId = SPELL_POWER_OF_VESPERON; + break; + } + + DoScriptText(iTextId, m_creature); + + RemoveDebuff(uiSpellId); + + if (m_pInstance) + { + // not if solo mini-boss fight + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + return; + + // Twilight Revenge to main boss + if (Creature* pSartharion = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SARTHARION))) + { + if (pSartharion->isAlive()) + m_creature->CastSpell(pSartharion,SPELL_TWILIGHT_REVENGE,true); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bCanMoveFree && m_uiMoveNextTimer) + { + if (m_uiMoveNextTimer <= uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId, + m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ); + + debug_log("dummy_dragonAI: %s moving to point %u", m_creature->GetName(), m_uiWaypointId); + m_uiMoveNextTimer = 0; + } + else + m_uiMoveNextTimer -= uiDiff; + } + } +}; + +/*###### +## Mob Tenebron +######*/ + +struct MANGOS_DLL_DECL mob_tenebronAI : public dummy_dragonAI +{ + mob_tenebronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { Reset(); } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiHatchEggTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiHatchEggTimer = 30000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_TENEBRON_AGGRO, m_creature); + DoCastSpellIfCan(m_creature, SPELL_POWER_OF_TENEBRON); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_TENEBRON_SLAY_1 : SAY_TENEBRON_SLAY_2, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SHADOW_FISSURE : SPELL_SHADOW_FISSURE_H); + + m_uiShadowFissureTimer = urand(15000, 20000); + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_TENEBRON_BREATH, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_BREATH : SPELL_SHADOW_BREATH_H); + m_uiShadowBreathTimer = urand(20000, 25000); + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_tenebron(Creature* pCreature) +{ + return new mob_tenebronAI(pCreature); +} + +/*###### +## Mob Shadron +######*/ + +struct MANGOS_DLL_DECL mob_shadronAI : public dummy_dragonAI +{ + mob_shadronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { Reset(); } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiAcolyteShadronTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiAcolyteShadronTimer = 60000; + + if (m_creature->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) + m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); + + if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + m_creature->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_SHADRON_AGGRO,m_creature); + DoCastSpellIfCan(m_creature, SPELL_POWER_OF_SHADRON); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SHADRON_SLAY_1 : SAY_SHADRON_SLAY_2, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SHADOW_FISSURE : SPELL_SHADOW_FISSURE_H); + + m_uiShadowFissureTimer = urand(15000, 20000); + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_SHADRON_BREATH, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_BREATH : SPELL_SHADOW_BREATH_H); + m_uiShadowBreathTimer = urand(20000, 25000); + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadron(Creature* pCreature) +{ + return new mob_shadronAI(pCreature); +} + +/*###### +## Mob Vesperon +######*/ + +struct MANGOS_DLL_DECL mob_vesperonAI : public dummy_dragonAI +{ + mob_vesperonAI(Creature* pCreature) : dummy_dragonAI(pCreature) { Reset(); } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiAcolyteVesperonTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiAcolyteVesperonTimer = 60000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_VESPERON_AGGRO,m_creature); + DoCastSpellIfCan(m_creature, SPELL_POWER_OF_VESPERON); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_VESPERON_SLAY_1 : SAY_VESPERON_SLAY_2, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SHADOW_FISSURE : SPELL_SHADOW_FISSURE_H); + + m_uiShadowFissureTimer = urand(15000, 20000); + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_VESPERON_BREATH, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_BREATH : SPELL_SHADOW_BREATH_H); + m_uiShadowBreathTimer = urand(20000, 25000); + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_vesperon(Creature* pCreature) +{ + return new mob_vesperonAI(pCreature); +} + +/*###### +## Mob Acolyte of Shadron +######*/ + +struct MANGOS_DLL_DECL mob_acolyte_of_shadronAI : public ScriptedAI +{ + mob_acolyte_of_shadronAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + if (m_pInstance) + { + //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + DoCastSpellIfCan(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR); + else + DoCastSpellIfCan(m_creature, SPELL_GIFT_OF_TWILIGTH_SHA); + } + } + + void JustDied(Unit* killer) + { + if (m_pInstance) + { + Creature* pDebuffTarget = NULL; + + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + { + //not solo fight, so main boss has deduff + pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SARTHARION)); + + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); + } + else + { + //event not in progress, then solo fight and must remove debuff mini-boss + pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADRON)); + + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_acolyte_of_shadron(Creature* pCreature) +{ + return new mob_acolyte_of_shadronAI(pCreature); +} + +/*###### +## Mob Acolyte of Vesperon +######*/ + +struct MANGOS_DLL_DECL mob_acolyte_of_vesperonAI : public ScriptedAI +{ + mob_acolyte_of_vesperonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + DoCastSpellIfCan(m_creature, SPELL_TWILIGHT_TORMENT_VESP_ACO); + } + + void JustDied(Unit* pKiller) + { + // remove twilight torment on Vesperon + if (m_pInstance) + { + Creature* pVesperon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VESPERON)); + + if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) + pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_acolyte_of_vesperon(Creature* pCreature) +{ + return new mob_acolyte_of_vesperonAI(pCreature); +} + +/*###### +## Mob Twilight Eggs +######*/ + +struct MANGOS_DLL_DECL mob_twilight_eggsAI : public ScriptedAI +{ + mob_twilight_eggsAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() + { + } + + void AttackStart(Unit* pWho) { } + void MoveInLineOfSight(Unit* pWho) { } +}; + +CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) +{ + return new mob_twilight_eggsAI(pCreature); +} + +/*###### +## Mob Twilight Whelps +######*/ + +struct MANGOS_DLL_DECL mob_twilight_whelpAI : public ScriptedAI +{ + mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiFadeArmorTimer; + + void Reset() + { + m_uiFadeArmorTimer = 1000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // twilight torment + if (m_uiFadeArmorTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FADE_ARMOR); + m_uiFadeArmorTimer = urand(5000, 10000); + } + else + m_uiFadeArmorTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_twilight_whelp(Creature* pCreature) +{ + return new mob_twilight_whelpAI(pCreature); +} + +void AddSC_boss_sartharion() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_sartharion"; + newscript->GetAI = &GetAI_boss_sartharion; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_vesperon"; + newscript->GetAI = &GetAI_mob_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadron"; + newscript->GetAI = &GetAI_mob_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_tenebron"; + newscript->GetAI = &GetAI_mob_tenebron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_acolyte_of_shadron"; + newscript->GetAI = &GetAI_mob_acolyte_of_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_acolyte_of_vesperon"; + newscript->GetAI = &GetAI_mob_acolyte_of_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_twilight_eggs"; + newscript->GetAI = &GetAI_mob_twilight_eggs; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_twilight_whelp"; + newscript->GetAI = &GetAI_mob_twilight_whelp; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp b/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp new file mode 100644 index 0000000..7a4aac3 --- /dev/null +++ b/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp @@ -0,0 +1,118 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Obsidian_Sanctum +SD%Complete: 80% +SDComment: +SDCategory: Obsidian Sanctum +EndScriptData */ + +#include "precompiled.h" +#include "obsidian_sanctum.h" + +/* Obsidian Sanctum encounters: +0 - Sartharion +*/ + +struct MANGOS_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance +{ + instance_obsidian_sanctum(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiSartharionGUID; + uint64 m_uiTenebronGUID; + uint64 m_uiShadronGUID; + uint64 m_uiVesperonGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiSartharionGUID = 0; + m_uiTenebronGUID = 0; + m_uiShadronGUID = 0; + m_uiVesperonGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_SARTHARION: + m_uiSartharionGUID = pCreature->GetGUID(); + break; + //three dragons below set to active state once created. + //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences + case NPC_TENEBRON: + m_uiTenebronGUID = pCreature->GetGUID(); + pCreature->SetActiveObjectState(true); + break; + case NPC_SHADRON: + m_uiShadronGUID = pCreature->GetGUID(); + pCreature->SetActiveObjectState(true); + break; + case NPC_VESPERON: + m_uiVesperonGUID = pCreature->GetGUID(); + pCreature->SetActiveObjectState(true); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == TYPE_SARTHARION_EVENT) + m_auiEncounter[0] = uiData; + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_SARTHARION_EVENT) + return m_auiEncounter[0]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_SARTHARION: + return m_uiSartharionGUID; + case DATA_TENEBRON: + return m_uiTenebronGUID; + case DATA_SHADRON: + return m_uiShadronGUID; + case DATA_VESPERON: + return m_uiVesperonGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* pMap) +{ + return new instance_obsidian_sanctum(pMap); +} + +void AddSC_instance_obsidian_sanctum() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_obsidian_sanctum"; + newscript->GetInstanceData = GetInstanceData_instance_obsidian_sanctum; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/obsidian_sanctum/obsidian_sanctum.h b/scripts/northrend/obsidian_sanctum/obsidian_sanctum.h new file mode 100644 index 0000000..801b3ad --- /dev/null +++ b/scripts/northrend/obsidian_sanctum/obsidian_sanctum.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_OBSIDIAN_SANCTUM_H +#define DEF_OBSIDIAN_SANCTUM_H + +enum +{ + MAX_ENCOUNTER = 1, + + TYPE_SARTHARION_EVENT = 1, + + DATA_SARTHARION = 10, + DATA_TENEBRON = 11, + DATA_SHADRON = 12, + DATA_VESPERON = 13, + + NPC_SARTHARION = 28860, + NPC_TENEBRON = 30452, + NPC_SHADRON = 30451, + NPC_VESPERON = 30449, + GO_TWILIGHT_PORTAL = 193988 +}; + +#endif diff --git a/scripts/northrend/ruby_sanctum/boss_baltharus.cpp b/scripts/northrend/ruby_sanctum/boss_baltharus.cpp new file mode 100644 index 0000000..8574ab9 --- /dev/null +++ b/scripts/northrend/ruby_sanctum/boss_baltharus.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_baltharus +SD%Complete: +SDComment: placeholder +SDCategory: Ruby Sanctum +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ruby_sanctum/boss_halion.cpp b/scripts/northrend/ruby_sanctum/boss_halion.cpp new file mode 100644 index 0000000..04969e6 --- /dev/null +++ b/scripts/northrend/ruby_sanctum/boss_halion.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_halion +SD%Complete: +SDComment: placeholder +SDCategory: Ruby Sanctum +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ruby_sanctum/boss_saviana.cpp b/scripts/northrend/ruby_sanctum/boss_saviana.cpp new file mode 100644 index 0000000..abef372 --- /dev/null +++ b/scripts/northrend/ruby_sanctum/boss_saviana.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_saviana +SD%Complete: +SDComment: placeholder +SDCategory: Ruby Sanctum +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ruby_sanctum/boss_zarithian.cpp b/scripts/northrend/ruby_sanctum/boss_zarithian.cpp new file mode 100644 index 0000000..489ccf5 --- /dev/null +++ b/scripts/northrend/ruby_sanctum/boss_zarithian.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_zarithian +SD%Complete: +SDComment:placeholder +SDCategory: Ruby Sanctum +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/sholazar_basin.cpp b/scripts/northrend/sholazar_basin.cpp new file mode 100644 index 0000000..922929a --- /dev/null +++ b/scripts/northrend/sholazar_basin.cpp @@ -0,0 +1,93 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Sholazar_Basin +SD%Complete: 100 +SDComment: Quest support: 12573 +SDCategory: Sholazar Basin +EndScriptData */ + +/* ContentData +npc_vekjik +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_vekjik +######*/ + +#define GOSSIP_VEKJIK_ITEM1 "Shaman Vekjik, I have spoken with the big-tongues and they desire peace. I have brought this offering on their behalf." +#define GOSSIP_VEKJIK_ITEM2 "No no... I had no intentions of betraying your people. I was only defending myself. it was all a misunderstanding." + +enum +{ + GOSSIP_TEXTID_VEKJIK1 = 13137, + GOSSIP_TEXTID_VEKJIK2 = 13138, + + SAY_TEXTID_VEKJIK1 = -1000208, + + SPELL_FREANZYHEARTS_FURY = 51469, + + QUEST_MAKING_PEACE = 12573 +}; + +bool GossipHello_npc_vekjik(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_MAKING_PEACE) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VEKJIK_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VEKJIK1, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_vekjik(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VEKJIK_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_VEKJIK2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + DoScriptText(SAY_TEXTID_VEKJIK1, pCreature, pPlayer); + pPlayer->AreaExploredOrEventHappens(QUEST_MAKING_PEACE); + pCreature->CastSpell(pPlayer, SPELL_FREANZYHEARTS_FURY, false); + break; + } + + return true; +} + +void AddSC_sholazar_basin() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_vekjik"; + newscript->pGossipHello = &GossipHello_npc_vekjik; + newscript->pGossipSelect = &GossipSelect_npc_vekjik; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/storm_peaks.cpp b/scripts/northrend/storm_peaks.cpp new file mode 100644 index 0000000..a90d0c9 --- /dev/null +++ b/scripts/northrend/storm_peaks.cpp @@ -0,0 +1,275 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Storm_Peaks +SD%Complete: 100 +SDComment: Vendor Support (31247). Quest support: 12970, 12684 +SDCategory: Storm Peaks +EndScriptData */ + +/* ContentData +npc_loklira_the_crone +npc_roxi_ramrocket +npc_frostborn_scout +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_frostborn_scout +######*/ + +enum Scout +{ + QUEST_MISSING_SCOUT = 12864, + + GOSSIP_TEXTID_SCOUT_1 = 13611, + GOSSIP_TEXTID_SCOUT_2 = 13612, + GOSSIP_TEXTID_SCOUT_3 = 13613, + GOSSIP_TEXTID_SCOUT_4 = 13614 + +}; + +#define GOSSIP_ITEM_SCOUT_1 "Are you okay? I've come to take you back to Frosthold if you can stand." +#define GOSSIP_ITEM_SCOUT_2 "I'm sorry that I didn't get here sooner. What happened?" +#define GOSSIP_ITEM_SCOUT_3 "I'll go get some help. Hang in there." + +bool GossipHello_npc_frostborn_scout(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_MISSING_SCOUT) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SCOUT_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_1, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_frostborn_scout(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SCOUT_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SCOUT_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_SCOUT_4, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(QUEST_MISSING_SCOUT); + break; + } + return true; +} + +/*###### +## npc_loklira_the_crone +######*/ + +#define GOSSIP_ITEM_TELL_ME "Tell me about this proposal." +#define GOSSIP_ITEM_WHAT_HAPPENED "What happened then?" +#define GOSSIP_ITEM_YOU_WANT_ME "You want me to take part in the Hyldsmeet to end the war?" +#define GOSSIP_ITEM_VERY_WELL "Very well. I'll take part in this competition." + +enum +{ + GOSSIP_TEXTID_LOKLIRA1 = 13777, + GOSSIP_TEXTID_LOKLIRA2 = 13778, + GOSSIP_TEXTID_LOKLIRA3 = 13779, + GOSSIP_TEXTID_LOKLIRA4 = 13780, + + QUEST_THE_HYLDSMEET = 12970, + + CREDIT_LOKLIRA = 30467 +}; + +bool GossipHello_npc_loklira_the_crone(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_THE_HYLDSMEET) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELL_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA1, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_loklira_the_crone(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_HAPPENED, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_YOU_WANT_ME, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_VERY_WELL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_LOKLIRA4, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->TalkedToCreature(CREDIT_LOKLIRA, pCreature->GetGUID()); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + return true; +} + +/*###### +## npc_thorim +######*/ + +#define GOSSIP_ITEM_THORIM1 "Can you tell me what became of Sif?" +#define GOSSIP_ITEM_THORIM2 "He did more than that, Thorim. He controls Ulduar now." +#define GOSSIP_ITEM_THORIM3 "It needn't end this way." + +enum +{ + QUEST_SIBLING_RIVALRY = 13064, + + SPELL_THORIM_STORY_KILL_CREDIT = 56940, + + GOSSIP_TEXTID_THORIM1 = 13799, + GOSSIP_TEXTID_THORIM2 = 13801, + GOSSIP_TEXTID_THORIM3 = 13802, + GOSSIP_TEXTID_THORIM4 = 13803 +}; + +bool GossipHello_npc_thorim(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_SIBLING_RIVALRY) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THORIM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM1, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_thorim(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THORIM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_THORIM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM3, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_THORIM4, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_THORIM_STORY_KILL_CREDIT, true); + break; + } + + return true; +} + +/*###### +## npc_roxi_ramrocket +######*/ + +#define GOSSIP_TEXT_RAMROCKET1 "How do you fly in this cold climate?" +#define GOSSIP_TEXT_RAMROCKET2 "I hear you sell motorcycle parts." + +enum +{ + SPELL_MECHANO_HOG = 60866, + SPELL_MEKGINEER_CHOPPER = 60867 +}; + +bool GossipHello_npc_roxi_ramrocket(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isTrainer()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_RAMROCKET1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + if (pCreature->isVendor()) + { + if (pPlayer->HasSpell(SPELL_MECHANO_HOG) || pPlayer->HasSpell(SPELL_MEKGINEER_CHOPPER)) + { + if (pPlayer->HasSkill(SKILL_ENGINEERING) && pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 450) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_RAMROCKET2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_roxi_ramrocket(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRAIN: + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + } + + return true; +} + +void AddSC_storm_peaks() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_frostborn_scout"; + newscript->pGossipHello = &GossipHello_npc_frostborn_scout; + newscript->pGossipSelect = &GossipSelect_npc_frostborn_scout; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_loklira_the_crone"; + newscript->pGossipHello = &GossipHello_npc_loklira_the_crone; + newscript->pGossipSelect = &GossipSelect_npc_loklira_the_crone; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_thorim"; + newscript->pGossipHello = &GossipHello_npc_thorim; + newscript->pGossipSelect = &GossipSelect_npc_thorim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_roxi_ramrocket"; + newscript->pGossipHello = &GossipHello_npc_roxi_ramrocket; + newscript->pGossipSelect = &GossipSelect_npc_roxi_ramrocket; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp new file mode 100644 index 0000000..dc23763 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp @@ -0,0 +1,443 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss General Bjarngrim +SD%Complete: 70% +SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_lightning.h" + +enum +{ + //Yell + SAY_AGGRO = -1602000, + SAY_SLAY_1 = -1602001, + SAY_SLAY_2 = -1602002, + SAY_SLAY_3 = -1602003, + SAY_DEATH = -1602004, + SAY_BATTLE_STANCE = -1602005, + EMOTE_BATTLE_STANCE = -1602006, + SAY_BERSEKER_STANCE = -1602007, + EMOTE_BERSEKER_STANCE = -1602008, + SAY_DEFENSIVE_STANCE = -1602009, + EMOTE_DEFENSIVE_STANCE = -1602010, + + SPELL_DEFENSIVE_STANCE = 53790, + //SPELL_DEFENSIVE_AURA = 41105, + SPELL_SPELL_REFLECTION = 36096, + SPELL_PUMMEL = 12555, + SPELL_KNOCK_AWAY = 52029, + SPELL_IRONFORM = 52022, + + SPELL_BERSEKER_STANCE = 53791, + //SPELL_BERSEKER_AURA = 41107, + SPELL_INTERCEPT = 58769, + SPELL_WHIRLWIND = 52027, + SPELL_CLEAVE = 15284, + + SPELL_BATTLE_STANCE = 53792, + //SPELL_BATTLE_AURA = 41106, + SPELL_MORTAL_STRIKE = 16856, + SPELL_SLAM = 52026, + + //OTHER SPELLS + //SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other + //SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above + + NPC_STORMFORGED_LIEUTENANT = 29240, + SPELL_ARC_WELD = 59085, + SPELL_RENEW_STEEL_N = 52774, + SPELL_RENEW_STEEL_H = 59160, + + EQUIP_SWORD = 37871, + EQUIP_SHIELD = 35642, + EQUIP_MACE = 43623, + + STANCE_DEFENSIVE = 0, + STANCE_BERSERKER = 1, + STANCE_BATTLE = 2 +}; + +/*###### +## boss_bjarngrim +######*/ + +struct MANGOS_DLL_DECL boss_bjarngrimAI : public ScriptedAI +{ + boss_bjarngrimAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_uiStance = STANCE_DEFENSIVE; + memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID)); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsRegularMode; + bool m_bIsChangingStance; + + uint8 m_uiChargingStatus; + uint8 m_uiStance; + + uint32 m_uiCharge_Timer; + uint32 m_uiChangeStance_Timer; + + uint32 m_uiReflection_Timer; + uint32 m_uiKnockAway_Timer; + uint32 m_uiPummel_Timer; + uint32 m_uiIronform_Timer; + + uint32 m_uiIntercept_Timer; + uint32 m_uiWhirlwind_Timer; + uint32 m_uiCleave_Timer; + + uint32 m_uiMortalStrike_Timer; + uint32 m_uiSlam_Timer; + + uint64 m_auiStormforgedLieutenantGUID[2]; + + void Reset() + { + m_bIsChangingStance = false; + + m_uiChargingStatus = 0; + m_uiCharge_Timer = 1000; + + m_uiChangeStance_Timer = urand(20000, 25000); + + m_uiReflection_Timer = 8000; + m_uiKnockAway_Timer = 20000; + m_uiPummel_Timer = 10000; + m_uiIronform_Timer = 25000; + + m_uiIntercept_Timer = 5000; + m_uiWhirlwind_Timer = 10000; + m_uiCleave_Timer = 8000; + + m_uiMortalStrike_Timer = 8000; + m_uiSlam_Timer = 10000; + + for(uint8 i = 0; i < 2; ++i) + { + if (Creature* pStormforgedLieutenant = m_creature->GetMap()->GetCreature(m_auiStormforgedLieutenantGUID[i])) + { + if (!pStormforgedLieutenant->isAlive()) + pStormforgedLieutenant->Respawn(); + } + } + + if (m_uiStance != STANCE_DEFENSIVE) + { + DoRemoveStanceAura(m_uiStance); + DoCastSpellIfCan(m_creature, SPELL_DEFENSIVE_STANCE); + m_uiStance = STANCE_DEFENSIVE; + } + + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + //must get both lieutenants here and make sure they are with him + m_creature->CallForHelp(30.0f); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, DONE); + } + + //TODO: remove when removal is done by mangos + void DoRemoveStanceAura(uint8 uiStance) + { + switch(uiStance) + { + case STANCE_DEFENSIVE: + m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE); + break; + case STANCE_BERSERKER: + m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE); + break; + case STANCE_BATTLE: + m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Change stance + if (m_uiChangeStance_Timer < uiDiff) + { + //wait for current spell to finish before change stance + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoRemoveStanceAura(m_uiStance); + + int uiTempStance = rand()%(3-1); + + if (uiTempStance >= m_uiStance) + ++uiTempStance; + + m_uiStance = uiTempStance; + + switch(m_uiStance) + { + case STANCE_DEFENSIVE: + DoScriptText(SAY_DEFENSIVE_STANCE, m_creature); + DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_DEFENSIVE_STANCE); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); + break; + case STANCE_BERSERKER: + DoScriptText(SAY_BERSEKER_STANCE, m_creature); + DoScriptText(EMOTE_BERSEKER_STANCE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BERSEKER_STANCE); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); + break; + case STANCE_BATTLE: + DoScriptText(SAY_BATTLE_STANCE, m_creature); + DoScriptText(EMOTE_BATTLE_STANCE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BATTLE_STANCE); + SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + break; + } + + m_uiChangeStance_Timer = urand(20000, 25000); + return; + } + else + m_uiChangeStance_Timer -= uiDiff; + + switch(m_uiStance) + { + case STANCE_DEFENSIVE: + { + if (m_uiReflection_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SPELL_REFLECTION); + m_uiReflection_Timer = urand(8000, 9000); + } + else + m_uiReflection_Timer -= uiDiff; + + if (m_uiKnockAway_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_KNOCK_AWAY); + m_uiKnockAway_Timer = urand(20000, 21000); + } + else + m_uiKnockAway_Timer -= uiDiff; + + if (m_uiPummel_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PUMMEL); + m_uiPummel_Timer = urand(10000, 11000); + } + else + m_uiPummel_Timer -= uiDiff; + + if (m_uiIronform_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_IRONFORM); + m_uiIronform_Timer = urand(25000, 26000); + } + else + m_uiIronform_Timer -= uiDiff; + + break; + } + case STANCE_BERSERKER: + { + if (m_uiIntercept_Timer < uiDiff) + { + //not much point is this, better random target and more often? + DoCastSpellIfCan(m_creature->getVictim(), SPELL_INTERCEPT); + m_uiIntercept_Timer = urand(45000, 46000); + } + else + m_uiIntercept_Timer -= uiDiff; + + if (m_uiWhirlwind_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + m_uiWhirlwind_Timer = urand(10000, 11000); + } + else + m_uiWhirlwind_Timer -= uiDiff; + + if (m_uiCleave_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = urand(8000, 9000); + } + else + m_uiCleave_Timer -= uiDiff; + + break; + } + case STANCE_BATTLE: + { + if (m_uiMortalStrike_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + m_uiMortalStrike_Timer = urand(20000, 21000); + } + else + m_uiMortalStrike_Timer -= uiDiff; + + if (m_uiSlam_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SLAM); + m_uiSlam_Timer = urand(15000, 16000); + } + else + m_uiSlam_Timer -= uiDiff; + + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## mob_stormforged_lieutenant +######*/ + +struct MANGOS_DLL_DECL mob_stormforged_lieutenantAI : public ScriptedAI +{ + mob_stormforged_lieutenantAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiArcWeld_Timer; + uint32 m_uiRenewSteel_Timer; + + void Reset() + { + m_uiArcWeld_Timer = urand(20000, 21000); + m_uiRenewSteel_Timer = urand(10000, 11000); + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + { + if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) + { + if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) + pBjarngrim->AI()->AttackStart(pWho); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiArcWeld_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARC_WELD); + m_uiArcWeld_Timer = urand(20000, 21000); + } + else + m_uiArcWeld_Timer -= uiDiff; + + if (m_uiRenewSteel_Timer < uiDiff) + { + if (m_pInstance) + { + if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) + { + if (pBjarngrim->isAlive()) + DoCastSpellIfCan(pBjarngrim, m_bIsRegularMode ? SPELL_RENEW_STEEL_N : SPELL_RENEW_STEEL_H); + } + } + m_uiRenewSteel_Timer = urand(10000, 14000); + } + else + m_uiRenewSteel_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_bjarngrim(Creature* pCreature) +{ + return new boss_bjarngrimAI(pCreature); +} + +CreatureAI* GetAI_mob_stormforged_lieutenant(Creature* pCreature) +{ + return new mob_stormforged_lieutenantAI(pCreature); +} + +void AddSC_boss_bjarngrim() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_bjarngrim"; + newscript->GetAI = &GetAI_boss_bjarngrim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stormforged_lieutenant"; + newscript->GetAI = &GetAI_mob_stormforged_lieutenant; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp b/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp new file mode 100644 index 0000000..b4d6aa1 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp @@ -0,0 +1,389 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Ionar +SD%Complete: 80% +SDComment: Timer check +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602011, + SAY_SLAY_1 = -1602012, + SAY_SLAY_2 = -1602013, + SAY_SLAY_3 = -1602014, + SAY_DEATH = -1602015, + SAY_SPLIT_1 = -1602016, + SAY_SPLIT_2 = -1602017, + + SPELL_BALL_LIGHTNING_N = 52780, + SPELL_BALL_LIGHTNING_H = 59800, + SPELL_STATIC_OVERLOAD_N = 52658, + SPELL_STATIC_OVERLOAD_H = 59795, + + SPELL_DISPERSE = 52770, + SPELL_SUMMON_SPARK = 52746, + SPELL_SPARK_DESPAWN = 52776, + + //Spark of Ionar + SPELL_SPARK_VISUAL_TRIGGER_N = 52667, + SPELL_SPARK_VISUAL_TRIGGER_H = 59833, + + NPC_SPARK_OF_IONAR = 28926, + + MAX_SPARKS = 5, + POINT_CALLBACK = 0 +}; + +/*###### +## Boss Ionar +######*/ + +struct MANGOS_DLL_DECL boss_ionarAI : public ScriptedAI +{ + boss_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lSparkGUIDList; + + bool m_bIsRegularMode; + + bool m_bIsSplitPhase; + uint32 m_uiSplit_Timer; + uint32 m_uiSparkAtHomeCount; + + uint32 m_uiStaticOverload_Timer; + uint32 m_uiBallLightning_Timer; + + uint32 m_uiHealthAmountModifier; + + void Reset() + { + m_lSparkGUIDList.clear(); + + m_bIsSplitPhase = true; + m_uiSplit_Timer = 25000; + m_uiSparkAtHomeCount = 0; + + m_uiStaticOverload_Timer = urand(5000, 6000); + m_uiBallLightning_Timer = urand(10000, 11000); + + m_uiHealthAmountModifier = 1; + + if (m_creature->GetVisibility() == VISIBILITY_OFF) + m_creature->SetVisibility(VISIBILITY_ON); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->GetVisibility() == VISIBILITY_OFF) + return; + + AttackStart(pAttacker); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_creature->GetVisibility() != VISIBILITY_OFF) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnSpark(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, DONE); + } + + void KilledUnit(Unit *victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void DespawnSpark() + { + if (m_lSparkGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr)) + { + if (pTemp->isAlive()) + pTemp->ForcedDespawn(); + } + } + + m_lSparkGUIDList.clear(); + } + + //make sparks come back + void CallBackSparks() + { + //should never be empty here, but check + if (m_lSparkGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) + { + if (Creature* pSpark = m_creature->GetMap()->GetCreature(*itr)) + { + if (pSpark->isAlive()) + { + if (pSpark->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + pSpark->GetMotionMaster()->MovementExpired(); + + pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } + } + } + } + + void RegisterSparkAtHome() + { + ++m_uiSparkAtHomeCount; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SPARK_OF_IONAR) + { + pSummoned->CastSpell(pSummoned, m_bIsRegularMode ? SPELL_SPARK_VISUAL_TRIGGER_N : SPELL_SPARK_VISUAL_TRIGGER_H, true); + + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); + + m_lSparkGUIDList.push_back(pSummoned->GetGUID()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + // Splitted + if (m_creature->GetVisibility() == VISIBILITY_OFF) + { + if (!m_creature->isInCombat()) + { + Reset(); + return; + } + + if (m_uiSplit_Timer < uiDiff) + { + m_uiSplit_Timer = 2500; + + // Return sparks to where Ionar splitted + if (m_bIsSplitPhase) + { + CallBackSparks(); + m_bIsSplitPhase = false; + } + // Lightning effect and restore Ionar + else if (m_uiSparkAtHomeCount == MAX_SPARKS) + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->CastSpell(m_creature, SPELL_SPARK_DESPAWN, false); + + DespawnSpark(); + + m_uiSparkAtHomeCount = 0; + m_uiSplit_Timer = 25000; + m_bIsSplitPhase = true; + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } + else + m_uiSplit_Timer -= uiDiff; + + return; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiStaticOverload_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_STATIC_OVERLOAD_N : SPELL_STATIC_OVERLOAD_H); + + m_uiStaticOverload_Timer = urand(5000, 6000); + } + else + m_uiStaticOverload_Timer -= uiDiff; + + if (m_uiBallLightning_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + m_creature->CastSpell(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), m_bIsRegularMode ? SPELL_BALL_LIGHTNING_N : SPELL_BALL_LIGHTNING_H, false, NULL, NULL, m_creature->GetGUID()); + m_uiBallLightning_Timer = urand(10000, 11000); + } + else + m_uiBallLightning_Timer -= uiDiff; + + // Health check + if (m_creature->GetHealthPercent() < float(100 - 20*m_uiHealthAmountModifier)) + { + ++m_uiHealthAmountModifier; + + DoScriptText(urand(0, 1) ? SAY_SPLIT_1 : SAY_SPLIT_2, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature, SPELL_DISPERSE); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ionar(Creature* pCreature) +{ + return new boss_ionarAI(pCreature); +} + +bool EffectDummyCreature_boss_ionar(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_DISPERSE && uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->GetEntry() != NPC_IONAR) + return true; + + for(uint8 i = 0; i < MAX_SPARKS; ++i) + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUMMON_SPARK, true); + + pCreatureTarget->AttackStop(); + pCreatureTarget->SetVisibility(VISIBILITY_OFF); + + if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + pCreatureTarget->GetMotionMaster()->MovementExpired(); + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +/*###### +## mob_spark_of_ionar +######*/ + +struct MANGOS_DLL_DECL mob_spark_of_ionarAI : public ScriptedAI +{ + mob_spark_of_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() { } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE || !m_pInstance) + return; + + if (uiPointId == POINT_CALLBACK) + { + if (Creature* pIonar = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_IONAR))) + { + if (!pIonar->isAlive()) + { + m_creature->ForcedDespawn(); + return; + } + + if (boss_ionarAI* pIonarAI = dynamic_cast(pIonar->AI())) + pIonarAI->RegisterSparkAtHome(); + } + else + m_creature->ForcedDespawn(); + } + } +}; + +CreatureAI* GetAI_mob_spark_of_ionar(Creature* pCreature) +{ + return new mob_spark_of_ionarAI(pCreature); +} + +void AddSC_boss_ionar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ionar"; + newscript->GetAI = &GetAI_boss_ionar; + newscript->pEffectDummyCreature = &EffectDummyCreature_boss_ionar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_spark_of_ionar"; + newscript->GetAI = &GetAI_mob_spark_of_ionar; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp b/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp new file mode 100644 index 0000000..9e88b3b --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp @@ -0,0 +1,228 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Loken +SD%Complete: 60% +SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414) +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602018, + SAY_INTRO_1 = -1602019, + SAY_INTRO_2 = -1602020, + SAY_SLAY_1 = -1602021, + SAY_SLAY_2 = -1602022, + SAY_SLAY_3 = -1602023, + SAY_DEATH = -1602024, + SAY_NOVA_1 = -1602025, + SAY_NOVA_2 = -1602026, + SAY_NOVA_3 = -1602027, + SAY_75HEALTH = -1602028, + SAY_50HEALTH = -1602029, + SAY_25HEALTH = -1602030, + EMOTE_NOVA = -1602031, + + SPELL_ARC_LIGHTNING = 52921, + SPELL_LIGHTNING_NOVA_N = 52960, + SPELL_LIGHTNING_NOVA_H = 59835, + + SPELL_PULSING_SHOCKWAVE_N = 52961, + SPELL_PULSING_SHOCKWAVE_H = 59836, + SPELL_PULSING_SHOCKWAVE_AURA = 59414 +}; + +/*###### +## Boss Loken +######*/ + +struct MANGOS_DLL_DECL boss_lokenAI : public ScriptedAI +{ + boss_lokenAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsRegularMode; + bool m_bIsAura; + + uint32 m_uiArcLightning_Timer; + uint32 m_uiLightningNova_Timer; + uint32 m_uiPulsingShockwave_Timer; + uint32 m_uiResumePulsingShockwave_Timer; + + uint32 m_uiHealthAmountModifier; + + void Reset() + { + m_bIsAura = false; + + m_uiArcLightning_Timer = 15000; + m_uiLightningNova_Timer = 20000; + m_uiPulsingShockwave_Timer = 2000; + m_uiResumePulsingShockwave_Timer = 15000; + + m_uiHealthAmountModifier = 1; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bIsAura) + { + // workaround for PULSING_SHOCKWAVE + /*if (m_uiPulsingShockwave_Timer < uiDiff) + { + Map *map = m_creature->GetMap(); + if (map->IsDungeon()) + { + Map::PlayerList const &PlayerList = map->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) + { + int32 dmg; + float m_fDist = m_creature->GetDistance(i->getSource()); + + if (m_fDist <= 1.0f) // Less than 1 yard + dmg = (m_bIsRegularMode ? 800 : 850); // need to correct damage + else // Further from 1 yard + dmg = round((m_bIsRegularMode ? 200 : 250) * m_fDist) + (m_bIsRegularMode ? 800 : 850); // need to correct damage + + m_creature->CastCustomSpell(i->getSource(), (m_bIsRegularMode ? 52942 : 59837), &dmg, 0, 0, false); + } + } + m_uiPulsingShockwave_Timer = 2000; + }else m_uiPulsingShockwave_Timer -= uiDiff;*/ + } + else + { + if (m_uiResumePulsingShockwave_Timer < uiDiff) + { + //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? + //m_creature->CastSpell(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true); + + //DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_PULSING_SHOCKWAVE_N : SPELL_PULSING_SHOCKWAVE_H); // need core support + m_bIsAura = true; + m_uiResumePulsingShockwave_Timer = 0; + } + else + m_uiResumePulsingShockwave_Timer -= uiDiff; + } + + if (m_uiArcLightning_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_ARC_LIGHTNING); + + m_uiArcLightning_Timer = urand(15000, 16000); + } + else + m_uiArcLightning_Timer -= uiDiff; + + if (m_uiLightningNova_Timer < uiDiff) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_NOVA_1, m_creature);break; + case 1: DoScriptText(SAY_NOVA_2, m_creature);break; + case 2: DoScriptText(SAY_NOVA_3, m_creature);break; + } + + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_LIGHTNING_NOVA_N : SPELL_LIGHTNING_NOVA_H); + + m_bIsAura = false; + m_uiResumePulsingShockwave_Timer = (m_bIsRegularMode ? 5000 : 4000); // Pause Pulsing Shockwave aura + m_uiLightningNova_Timer = urand(20000, 21000); + } + else + m_uiLightningNova_Timer -= uiDiff; + + // Health check + if (m_creature->GetHealthPercent() < float(100 - 25*m_uiHealthAmountModifier)) + { + switch(m_uiHealthAmountModifier) + { + case 1: DoScriptText(SAY_75HEALTH, m_creature); break; + case 2: DoScriptText(SAY_50HEALTH, m_creature); break; + case 3: DoScriptText(SAY_25HEALTH, m_creature); break; + } + + ++m_uiHealthAmountModifier; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_loken(Creature* pCreature) +{ + return new boss_lokenAI(pCreature); +} + +void AddSC_boss_loken() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_loken"; + newscript->GetAI = &GetAI_boss_loken; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp b/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp new file mode 100644 index 0000000..68f8f96 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp @@ -0,0 +1,381 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Volkhan +SD%Complete: 60% +SDComment: Not considered complete. Some events may fail and need further development +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602032, + SAY_SLAY_1 = -1602033, + SAY_SLAY_2 = -1602034, + SAY_SLAY_3 = -1602035, + SAY_DEATH = -1602036, + SAY_STOMP_1 = -1602037, + SAY_STOMP_2 = -1602038, + SAY_FORGE_1 = -1602039, + SAY_FORGE_2 = -1602040, + EMOTE_TO_ANVIL = -1602041, + EMOTE_SHATTER = -1602042, + + SPELL_HEAT_N = 52387, + SPELL_HEAT_H = 59528, + SPELL_SHATTERING_STOMP_N = 52237, + SPELL_SHATTERING_STOMP_H = 59529, + + //unclear how "directions" of spells must be. Last, summoning GO, what is it for? Script depend on: + SPELL_TEMPER = 52238, //TARGET_SCRIPT boss->anvil + SPELL_TEMPER_DUMMY = 52654, //TARGET_SCRIPT anvil->boss + + //SPELL_TEMPER_VISUAL = 52661, //summons GO + + SPELL_SUMMON_MOLTEN_GOLEM = 52405, + + //Molten Golem + SPELL_BLAST_WAVE = 23113, + SPELL_IMMOLATION_STRIKE_N = 52433, + SPELL_IMMOLATION_STRIKE_H = 59530, + SPELL_SHATTER_N = 52429, + SPELL_SHATTER_H = 59527, + + NPC_VOLKHAN_ANVIL = 28823, + NPC_MOLTEN_GOLEM = 28695, + NPC_BRITTLE_GOLEM = 28681, + + POINT_ID_ANVIL = 0, + MAX_GOLEM = 2 +}; + +/*###### +## Boss Volkhan +######*/ + +struct MANGOS_DLL_DECL boss_volkhanAI : public ScriptedAI +{ + boss_volkhanAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lGolemGUIDList; + + bool m_bIsRegularMode; + bool m_bHasTemper; + bool m_bIsStriking; + bool m_bCanShatterGolem; + bool m_bHasShattered; + + uint32 m_uiPause_Timer; + uint32 m_uiShatter_Timer; + uint32 m_uiSummon_Timer; + + void Reset() + { + m_bIsStriking = false; + m_bHasTemper = false; + m_bCanShatterGolem = false; + m_bHasShattered = false; + + m_uiPause_Timer = 3500; + m_uiShatter_Timer = 5000; + m_uiSummon_Timer = 10000; + + + DespawnGolem(); + m_lGolemGUIDList.clear(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (!m_bHasTemper) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnGolem(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void DespawnGolem() + { + if (m_lGolemGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr)) + { + if (pTemp->isAlive()) + pTemp->ForcedDespawn(); + } + } + + m_lGolemGUIDList.clear(); + } + + void ShatterGolem() + { + if (m_lGolemGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(*itr)) + { + // only shatter brittle golems + if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM) + pTemp->CastSpell(pTemp, m_bIsRegularMode ? SPELL_SHATTER_N : SPELL_SHATTER_H, false); + } + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_MOLTEN_GOLEM) + { + m_lGolemGUIDList.push_back(pSummoned->GetGUID()); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + + //why healing when just summoned? + pSummoned->CastSpell(pSummoned, m_bIsRegularMode ? SPELL_HEAT_N : SPELL_HEAT_H, false, NULL, NULL, m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiSummon_Timer < uiDiff) + { + m_creature->SummonCreature(NPC_MOLTEN_GOLEM, 1323.061f, -90.179f, 56.717f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + m_creature->SummonCreature(NPC_MOLTEN_GOLEM, 1323.061f, -90.179f, 56.717f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + m_uiSummon_Timer = 20000; + } + else + m_uiSummon_Timer -= uiDiff; + + + + // he shatters only one time, at 20% + if (m_creature->GetHealthPercent() <= 20.0f && !m_bHasShattered) + { + // should he stomp even if he has no brittle golem to shatter? <-yes! + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHATTERING_STOMP_N : SPELL_SHATTERING_STOMP_H) == CAST_OK) + { + DoScriptText(urand(0, 1) ? SAY_STOMP_1 : SAY_STOMP_2, m_creature); + DoScriptText(EMOTE_SHATTER, m_creature); + m_bCanShatterGolem = true; + m_bHasShattered = true; + } + } + + // Shatter Golems 3 seconds after Shattering Stomp + if (m_bCanShatterGolem) + { + if (m_uiShatter_Timer < uiDiff) + { + ShatterGolem(); + m_uiShatter_Timer = 3000; + m_bCanShatterGolem = false; + } + else + m_uiShatter_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_volkhan(Creature* pCreature) +{ + return new boss_volkhanAI(pCreature); +} +/*###### +## mob_molten_golem +######*/ + +struct MANGOS_DLL_DECL mob_molten_golemAI : public ScriptedAI +{ + mob_molten_golemAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsRegularMode; + bool m_bIsFrozen; + + uint32 m_uiBlast_Timer; + uint32 m_uiDeathDelay_Timer; + uint32 m_uiImmolation_Timer; + + void Reset() + { + m_bIsFrozen = false; + + m_uiBlast_Timer = 20000; + m_uiDeathDelay_Timer = 0; + m_uiImmolation_Timer = 5000; + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (!m_bIsFrozen) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_bIsFrozen) + { + //workaround for now, brittled should be immune to any kind of attacks + uiDamage = 0; + return; + } + + if (uiDamage > m_creature->GetHealth()) + { + m_bIsFrozen = true; + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->RemoveAllAuras(); + m_creature->AttackStop(); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + uiDamage = m_creature->GetHealth()-1; + + m_creature->UpdateEntry(NPC_BRITTLE_GOLEM); + m_creature->SetMaxHealth(1); + m_creature->SetHealth(1); + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + //this is the dummy effect of the spells + if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H) + { + if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM) + m_creature->ForcedDespawn(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target or if we are frozen + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || m_bIsFrozen) + return; + + if (m_uiBlast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BLAST_WAVE); + m_uiBlast_Timer = 20000; + } + else + m_uiBlast_Timer -= uiDiff; + + if (m_uiImmolation_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_IMMOLATION_STRIKE_N : SPELL_IMMOLATION_STRIKE_H); + m_uiImmolation_Timer = 5000; + } + else + m_uiImmolation_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_molten_golem(Creature* pCreature) +{ + return new mob_molten_golemAI(pCreature); +} + +void AddSC_boss_volkhan() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_volkhan"; + newscript->GetAI = &GetAI_boss_volkhan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_molten_golem"; + newscript->GetAI = &GetAI_mob_molten_golem; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_lightning/halls_of_lightning.h b/scripts/northrend/ulduar/halls_of_lightning/halls_of_lightning.h new file mode 100644 index 0000000..72106ff --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_lightning/halls_of_lightning.h @@ -0,0 +1,33 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_HALLS_OF_LIGHTNING_H +#define DEF_HALLS_OF_LIGHTNING_H + +enum +{ + MAX_ENCOUNTER = 4, + + DATA_BJARNGRIM = 1, + DATA_IONAR = 2, + DATA_LOKEN = 3, + DATA_VOLKHAN = 4, + + TYPE_BJARNGRIM = 10, + TYPE_IONAR = 11, + TYPE_LOKEN = 12, + TYPE_VOLKHAN = 13, + + NPC_BJARNGRIM = 28586, + NPC_VOLKHAN = 28587, + NPC_IONAR = 28546, + NPC_LOKEN = 28923, + + GO_VOLKHAN_DOOR = 191325, //_doors07 + GO_IONAR_DOOR = 191326, //_doors05 + GO_LOKEN_DOOR = 191324, //_doors02 + GO_LOKEN_THRONE = 192654 +}; + +#endif diff --git a/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp new file mode 100644 index 0000000..a789a90 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp @@ -0,0 +1,226 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Halls_of_Lightning +SD%Complete: 90% +SDComment: All ready. +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_lightning.h" + +/* Halls of Lightning encounters: +0 - General Bjarngrim +1 - Volkhan +2 - Ionar +3 - Loken +*/ + +struct MANGOS_DLL_DECL instance_halls_of_lightning : public ScriptedInstance +{ + instance_halls_of_lightning(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiGeneralBjarngrimGUID; + uint64 m_uiIonarGUID; + uint64 m_uiLokenGUID; + uint64 m_uiVolkhanGUID; + + uint64 m_uiVolkhanDoorGUID; + uint64 m_uiIonarDoorGUID; + uint64 m_uiLokenDoorGUID; + uint64 m_uiLokenGlobeGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiGeneralBjarngrimGUID = 0; + m_uiVolkhanGUID = 0; + m_uiIonarGUID = 0; + m_uiLokenGUID = 0; + + m_uiVolkhanDoorGUID = 0; + m_uiIonarDoorGUID = 0; + m_uiLokenDoorGUID = 0; + m_uiLokenGlobeGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_BJARNGRIM: + m_uiGeneralBjarngrimGUID = pCreature->GetGUID(); + break; + case NPC_VOLKHAN: + m_uiVolkhanGUID = pCreature->GetGUID(); + break; + case NPC_IONAR: + m_uiIonarGUID = pCreature->GetGUID(); + break; + case NPC_LOKEN: + m_uiLokenGUID = pCreature->GetGUID(); + break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_VOLKHAN_DOOR: + m_uiVolkhanDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_IONAR_DOOR: + m_uiIonarDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_LOKEN_DOOR: + m_uiLokenDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_LOKEN_THRONE: + m_uiLokenGlobeGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_BJARNGRIM: + m_auiEncounter[0] = uiData; + break; + case TYPE_VOLKHAN: + if (uiData == DONE) + DoUseDoorOrButton(m_uiVolkhanDoorGUID); + m_auiEncounter[1] = uiData; + break; + case TYPE_IONAR: + if (uiData == DONE) + DoUseDoorOrButton(m_uiIonarDoorGUID); + m_auiEncounter[2] = uiData; + break; + case TYPE_LOKEN: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiLokenDoorGUID); + + //Appears to be type 5 GO with animation. Need to figure out how this work, code below only placeholder + if (GameObject* pGlobe = instance->GetGameObject(m_uiLokenGlobeGUID)) + pGlobe->SetGoState(GO_STATE_ACTIVE); + } + m_auiEncounter[3] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_BJARNGRIM: + return m_auiEncounter[0]; + case TYPE_VOLKHAN: + return m_auiEncounter[1]; + case TYPE_IONAR: + return m_auiEncounter[2]; + case TYPE_LOKEN: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_BJARNGRIM: + return m_uiGeneralBjarngrimGUID; + case DATA_VOLKHAN: + return m_uiVolkhanGUID; + case DATA_IONAR: + return m_uiIonarGUID; + case DATA_LOKEN: + return m_uiLokenGUID; + } + return 0; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_halls_of_lightning(Map* pMap) +{ + return new instance_halls_of_lightning(pMap); +} + +void AddSC_instance_halls_of_lightning() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_lightning"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_lightning; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp new file mode 100644 index 0000000..0b28902 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp @@ -0,0 +1,152 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Maiden_of_Grief +SD%Complete: 60% +SDComment: +SDCategory: Halls of Stone +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_stone.h" + +enum +{ + SAY_AGGRO = -1599005, + SAY_SLAY_1 = -1599006, + SAY_SLAY_2 = -1599007, + SAY_SLAY_3 = -1599008, + SAY_SLAY_4 = -1599009, + SAY_STUN = -1599010, + SAY_DEATH = -1599011, + + SPELL_STORM_OF_GRIEF = 50752, + SPELL_STORM_OF_GRIEF_H = 59772, + + SPELL_SHOCK_OF_SORROW = 50760, + SPELL_SHOCK_OF_SORROW_H = 59726, + + SPELL_PILLAR_OF_WOE = 50761, + SPELL_PILLAR_OF_WOE_H = 59727, + + SPELL_PARTING_SORROW = 59723 +}; + +/*###### +## boss_maiden_of_grief +######*/ + +struct MANGOS_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI +{ + boss_maiden_of_griefAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiStormTimer; + uint32 m_uiShockTimer; + uint32 m_uiPillarTimer; + + void Reset() + { + m_uiStormTimer = 5000; + m_uiShockTimer = 10000; + m_uiPillarTimer = 15000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + case 3: DoScriptText(SAY_SLAY_4, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MAIDEN, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiStormTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_STORM_OF_GRIEF : SPELL_STORM_OF_GRIEF_H) == CAST_OK) + m_uiStormTimer = 20000; + } + else + m_uiStormTimer -= uiDiff; + + if (m_uiPillarTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_PILLAR_OF_WOE : SPELL_PILLAR_OF_WOE_H) == CAST_OK) + m_uiPillarTimer = 10000; + } + } + else + m_uiPillarTimer -= uiDiff; + + if (m_uiShockTimer < uiDiff) + { + if (DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHOCK_OF_SORROW : SPELL_SHOCK_OF_SORROW_H) == CAST_OK) + { + DoScriptText(SAY_STUN, m_creature); + m_uiShockTimer = 35000; + } + } + else + m_uiShockTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_maiden_of_grief(Creature* pCreature) +{ + return new boss_maiden_of_griefAI(pCreature); +} + +void AddSC_boss_maiden_of_grief() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_maiden_of_grief"; + newscript->GetAI = &GetAI_boss_maiden_of_grief; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp b/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp new file mode 100644 index 0000000..b9f30e9 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sjonnir +SD%Complete: 20% +SDComment: +SDCategory: Halls of Stone +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_stone.h" + +enum +{ + SAY_AGGRO = -1599000, + SAY_SLAY_1 = -1599001, + SAY_SLAY_2 = -1599002, + SAY_SLAY_3 = -1599003, + SAY_DEATH = -1599004, + EMOTE_GENERIC_FRENZY = -1000002, + + SPELL_FRENZY = 28747, + + SPELL_CHAIN_LIGHTNING = 50830, + SPELL_CHAIN_LIGHTNING_H = 59844, + + SPELL_STATIC_CHARGE = 50834, + SPELL_STATIC_CHARGE_H = 59846, + + SPELL_LIGHTNING_SHIELD = 50831, + SPELL_LIGHTNING_SHIELD_H = 59845, + + SPELL_LIGHTNING_RING = 50840, + SPELL_LIGHTNING_RING_H = 59848, + + SPELL_SUMMON_IRON_DWARF = 50789, // periodic dummy aura, tick each 30sec or each 20sec in heroic + SPELL_SUMMON_IRON_DWARF_H = 59860, // left/right 50790,50791 + + SPELL_SUMMON_IRON_TROGG = 50792, // periodic dummy aura, tick each 10sec or each 7sec in heroic + SPELL_SUMMON_IRON_TROGG_H = 59859, // left/right 50793,50794 + + SPELL_SUMMON_MALFORMED_OOZE = 50801, // periodic dummy aura, tick each 5sec or each 3sec in heroic + SPELL_SUMMON_MALFORMED_OOZE_H = 59858, // left/right 50802,50803 + + SPELL_SUMMON_IRON_SLUDGE = 50747, // instakill TARGET_SCRIPT + SPELL_IRON_SLUDGE_SPAWN_VISUAL = 50777, + + NPC_IRON_TROGG = 27979, + NPC_IRON_DWARF = 27982, + NPC_MALFORMED_OOZE = 27981, + NPC_IRON_SLUDGE = 28165 +}; + +/*###### +## boss_sjonnir +######*/ + +struct MANGOS_DLL_DECL boss_sjonnirAI : public ScriptedAI +{ + boss_sjonnirAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + if (m_creature->isAlive()) + m_creature->CastSpell(m_creature, m_bIsRegularMode ? SPELL_LIGHTNING_SHIELD : SPELL_LIGHTNING_SHIELD_H, false); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->CastSpell(m_creature, m_bIsRegularMode ? SPELL_SUMMON_IRON_DWARF : SPELL_SUMMON_IRON_DWARF_H, true); + m_creature->CastSpell(m_creature, m_bIsRegularMode ? SPELL_SUMMON_IRON_TROGG : SPELL_SUMMON_IRON_TROGG_H, true); + } + + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_IRON_TROGG || pSummoned->GetEntry() == NPC_IRON_DWARF || pSummoned->GetEntry() == NPC_MALFORMED_OOZE) + { + float fX, fY, fZ; + pSummoned->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 10.0f, fX, fY, fZ); + + pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->GetMotionMaster()->MovePoint(0, fX, fY, fZ); + } + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_sjonnir(Creature* pCreature) +{ + return new boss_sjonnirAI(pCreature); +} + +void AddSC_boss_sjonnir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_sjonnir"; + newscript->GetAI = &GetAI_boss_sjonnir; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp b/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp new file mode 100644 index 0000000..8731713 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.cpp @@ -0,0 +1,184 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Halls_of_Stone +SD%Complete: 20% +SDComment: +SDCategory: Halls of Stone +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_stone.h" +#include "escort_ai.h" + +enum +{ + SAY_KILL_1 = -1599012, + SAY_KILL_2 = -1599013, + SAY_KILL_3 = -1599014, + SAY_LOW_HEALTH = -1599015, + SAY_DEATH = -1599016, + SAY_PLAYER_DEATH_1 = -1599017, + SAY_PLAYER_DEATH_2 = -1599018, + SAY_PLAYER_DEATH_3 = -1599019, + SAY_ESCORT_START = -1599020, + + SAY_SPAWN_DWARF = -1599021, + SAY_SPAWN_TROGG = -1599022, + SAY_SPAWN_OOZE = -1599023, + SAY_SPAWN_EARTHEN = -1599024, + + SAY_EVENT_INTRO_1 = -1599025, + SAY_EVENT_INTRO_2 = -1599026, + SAY_EVENT_INTRO_3_ABED = -1599027, + + SAY_EVENT_A_1 = -1599028, + SAY_EVENT_A_2_KADD = -1599029, + SAY_EVENT_A_3 = -1599030, + + SAY_EVENT_B_1 = -1599031, + SAY_EVENT_B_2_MARN = -1599032, + SAY_EVENT_B_3 = -1599033, + + SAY_EVENT_C_1 = -1599034, + SAY_EVENT_C_2_ABED = -1599035, + SAY_EVENT_C_3 = -1599036, + + SAY_EVENT_D_1 = -1599037, + SAY_EVENT_D_2_ABED = -1599038, + SAY_EVENT_D_3 = -1599039, + SAY_EVENT_D_4_ABED = -1599040, + + SAY_EVENT_END_01 = -1599041, + SAY_EVENT_END_02 = -1599042, + SAY_EVENT_END_03_ABED = -1599043, + SAY_EVENT_END_04 = -1599044, + SAY_EVENT_END_05_ABED = -1599045, + SAY_EVENT_END_06 = -1599046, + SAY_EVENT_END_07_ABED = -1599047, + SAY_EVENT_END_08 = -1599048, + SAY_EVENT_END_09_KADD = -1599049, + SAY_EVENT_END_10 = -1599050, + SAY_EVENT_END_11_KADD = -1599051, + SAY_EVENT_END_12 = -1599052, + SAY_EVENT_END_13_KADD = -1599053, + SAY_EVENT_END_14 = -1599054, + SAY_EVENT_END_15_MARN = -1599055, + SAY_EVENT_END_16 = -1599056, + SAY_EVENT_END_17_MARN = -1599057, + SAY_EVENT_END_18 = -1599058, + SAY_EVENT_END_19_MARN = -1599059, + SAY_EVENT_END_20 = -1599060, + SAY_EVENT_END_21_ABED = -1599061, + + SAY_VICTORY_SJONNIR_1 = -1599062, + SAY_VICTORY_SJONNIR_2 = -1599063, + + SAY_ENTRANCE_MEET = -1599064, + + TEXT_ID_START = 13100, + TEXT_ID_PROGRESS = 13101 +}; + +#define GOSSIP_ITEM_START "Brann, it would be our honor!" +#define GOSSIP_ITEM_PROGRESS "Let's move Brann, enough of the history lessons!" + +/*###### +## npc_brann_hos +######*/ + +struct MANGOS_DLL_DECL npc_brann_hosAI : public npc_escortAI +{ + npc_brann_hosAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void WaypointReached(uint32 uiPointId) + { + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +bool GossipHello_npc_brann_hos(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_START, pCreature->GetGUID()); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + //pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_PROGRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + //pPlayer->SEND_GOSSIP_MENU(TEXT_ID_PROGRESS, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_brann_hos(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1 || uiAction == GOSSIP_ACTION_INFO_DEF+2) + pPlayer->CLOSE_GOSSIP_MENU(); + + return true; +} + +CreatureAI* GetAI_npc_brann_hos(Creature* pCreature) +{ + return new npc_brann_hosAI(pCreature); +} + +void AddSC_halls_of_stone() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_brann_hos"; + pNewScript->GetAI = &GetAI_npc_brann_hos; + pNewScript->pGossipHello = &GossipHello_npc_brann_hos; + pNewScript->pGossipSelect = &GossipSelect_npc_brann_hos; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.h b/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.h new file mode 100644 index 0000000..7c5e557 --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_stone/halls_of_stone.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_HALLS_OF_STONE_H +#define DEF_HALLS_OF_STONE_H + +enum +{ + MAX_ENCOUNTER = 4, + + TYPE_TRIBUNAL = 0, + TYPE_MAIDEN = 1, + TYPE_KRYSTALLUS = 2, + TYPE_SJONNIR = 3, + + NPC_BRANN = 28070, + + NPC_KADDRAK = 30898, + NPC_ABEDNEUM = 30899, + NPC_MARNAK = 30897, + + GO_DOOR_SJONNIR = 191296, + GO_DOOR_TRIBUNAL = 191294, // possibly closed during event? + + GO_TRIBUNAL_CHEST = 190586, + GO_TRIBUNAL_CHEST_H = 193996, + + GO_TRIBUNAL_HEAD_RIGHT = 191670, // marnak + GO_TRIBUNAL_HEAD_CENTER = 191669, // abedneum + GO_TRIBUNAL_HEAD_LEFT = 191671, // kaddrak + + GO_TRIBUNAL_CONSOLE = 193907, + GO_TRIBUNAL_FLOOR = 191527, + + GO_SJONNIR_CONSOLE = 193906 +}; + +#endif diff --git a/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp new file mode 100644 index 0000000..27ba40f --- /dev/null +++ b/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Halls_of_Stone +SD%Complete: 10% +SDComment: +SDCategory: Halls of Stone +EndScriptData */ + +#include "precompiled.h" +#include "halls_of_stone.h" + +struct MANGOS_DLL_DECL instance_halls_of_stone : public ScriptedInstance +{ + instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiBrannGUID; + uint64 m_uiKaddrakGUID; + uint64 m_uiAbedneumGUID; + uint64 m_uiMarnakGUID; + + uint64 m_uiSjonnirDoorGUID; + uint64 m_uiTribunalDoorGUID; + uint64 m_uiTribunalChestGUID; + uint64 m_uiTribunalHeadRightGUID; + uint64 m_uiTribunalHeadCenterGUID; + uint64 m_uiTribunalHeadLeftGUID; + uint64 m_uiTribunalConsoleGUID; + uint64 m_uiTribunalFloorGUID; + uint64 m_uiSjonnirConsoleGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiBrannGUID = 0; + m_uiKaddrakGUID = 0; + m_uiAbedneumGUID = 0; + m_uiMarnakGUID = 0; + + m_uiSjonnirDoorGUID = 0; + m_uiTribunalDoorGUID = 0; + m_uiTribunalChestGUID = 0; + m_uiTribunalHeadRightGUID = 0; + m_uiTribunalHeadCenterGUID = 0; + m_uiTribunalHeadLeftGUID = 0; + m_uiTribunalConsoleGUID = 0; + m_uiTribunalFloorGUID = 0; + m_uiSjonnirConsoleGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_BRANN: + m_uiBrannGUID = pCreature->GetGUID(); + break; + case NPC_KADDRAK: + m_uiKaddrakGUID = pCreature->GetGUID(); + break; + case NPC_ABEDNEUM: + m_uiAbedneumGUID = pCreature->GetGUID(); + break; + case NPC_MARNAK: + m_uiMarnakGUID = pCreature->GetGUID(); + break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_DOOR_SJONNIR: + m_uiSjonnirDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_TRIBUNAL: + m_uiTribunalDoorGUID = pGo->GetGUID(); + break; + case GO_TRIBUNAL_CHEST: + case GO_TRIBUNAL_CHEST_H: + m_uiTribunalChestGUID = pGo->GetGUID(); + break; + case GO_TRIBUNAL_HEAD_RIGHT: + m_uiTribunalHeadRightGUID = pGo->GetGUID(); + break; + case GO_TRIBUNAL_HEAD_CENTER: + m_uiTribunalHeadCenterGUID = pGo->GetGUID(); + break; + case GO_TRIBUNAL_HEAD_LEFT: + m_uiTribunalHeadLeftGUID = pGo->GetGUID(); + break; + case GO_TRIBUNAL_CONSOLE: + m_uiTribunalConsoleGUID = pGo->GetGUID(); + break; + case GO_TRIBUNAL_FLOOR: + m_uiTribunalFloorGUID = pGo->GetGUID(); + break; + case GO_SJONNIR_CONSOLE: + m_uiSjonnirConsoleGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_TRIBUNAL: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + DoRespawnGameObject(m_uiTribunalChestGUID); + break; + case TYPE_MAIDEN: + m_auiEncounter[1] = uiData; + break; + case TYPE_KRYSTALLUS: + m_auiEncounter[2] = uiData; + break; + case TYPE_SJONNIR: + m_auiEncounter[3] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_TRIBUNAL: + return m_auiEncounter[0]; + case TYPE_MAIDEN: + return m_auiEncounter[1]; + case TYPE_KRYSTALLUS: + return m_auiEncounter[2]; + case TYPE_SJONNIR: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case NPC_BRANN: + return m_uiBrannGUID; + case NPC_KADDRAK: + return m_uiKaddrakGUID; + case NPC_ABEDNEUM: + return m_uiAbedneumGUID; + case NPC_MARNAK: + return m_uiMarnakGUID; + case GO_DOOR_SJONNIR: + return m_uiSjonnirDoorGUID; + case GO_DOOR_TRIBUNAL: + return m_uiTribunalDoorGUID; + case GO_TRIBUNAL_CHEST: + case GO_TRIBUNAL_CHEST_H: + return m_uiTribunalChestGUID; + case GO_TRIBUNAL_HEAD_RIGHT: + return m_uiTribunalHeadRightGUID; + case GO_TRIBUNAL_HEAD_CENTER: + return m_uiTribunalHeadCenterGUID; + case GO_TRIBUNAL_HEAD_LEFT: + return m_uiTribunalHeadLeftGUID; + case GO_TRIBUNAL_CONSOLE: + return m_uiTribunalConsoleGUID; + case GO_TRIBUNAL_FLOOR: + return m_uiTribunalFloorGUID; + case GO_SJONNIR_CONSOLE: + return m_uiSjonnirConsoleGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_halls_of_stone(Map* pMap) +{ + return new instance_halls_of_stone(pMap); +} + +void AddSC_instance_halls_of_stone() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_stone"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_stone; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/ulduar/assembly_of_iron.cpp b/scripts/northrend/ulduar/ulduar/assembly_of_iron.cpp new file mode 100644 index 0000000..bfacdce --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/assembly_of_iron.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: assembly_of_iron +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/scripts/northrend/ulduar/ulduar/boss_algalon.cpp new file mode 100644 index 0000000..7bdb2d0 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_algalon.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_algalon +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp b/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp new file mode 100644 index 0000000..912eec1 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_auriaya +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp b/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp new file mode 100644 index 0000000..08681a0 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_flame_leviathan +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_freya.cpp b/scripts/northrend/ulduar/ulduar/boss_freya.cpp new file mode 100644 index 0000000..16ff0f5 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_freya.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_freya +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp b/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp new file mode 100644 index 0000000..139e185 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_general_vezax +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_hodir.cpp b/scripts/northrend/ulduar/ulduar/boss_hodir.cpp new file mode 100644 index 0000000..30b6c9c --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_hodir.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_hodir +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_ignis.cpp b/scripts/northrend/ulduar/ulduar/boss_ignis.cpp new file mode 100644 index 0000000..7658527 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_ignis.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_ignis +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp b/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp new file mode 100644 index 0000000..a3f63cb --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_kologarn +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp b/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp new file mode 100644 index 0000000..1ce8f3d --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_mimiron +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp new file mode 100644 index 0000000..7b42fd1 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_razorscale +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_thorim.cpp b/scripts/northrend/ulduar/ulduar/boss_thorim.cpp new file mode 100644 index 0000000..053d91e --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_thorim.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_thorim +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_xt_002.cpp b/scripts/northrend/ulduar/ulduar/boss_xt_002.cpp new file mode 100644 index 0000000..dd25d26 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_xt_002.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_xt_002 +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp b/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp new file mode 100644 index 0000000..4a07fe6 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/boss_yogg_saron.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_yogg_saron +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp b/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp new file mode 100644 index 0000000..87b5a16 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp @@ -0,0 +1,902 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* 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, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: instance_ulduar +SD%Complete: +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" +#include "ulduar.h" + +struct sSpawnLocation +{ + float m_fX, m_fY, m_fZ, m_fO; +}; + +static sSpawnLocation m_aKeepersSpawnLocs[] = +{ + {2036.892f, 25.621f, 411.358f, 3.83f}, // Freya + {1939.215f, 42.677f, 411.355f, 5.31f}, // Mimiron + {1939.195f, -90.662f, 411.357f, 1.06f}, // Hodir + {2036.674f, -73.814f, 411.355f, 2.51f}, // Thorim +}; + +instance_ulduar::instance_ulduar(Map* pMap) : ScriptedInstance(pMap), + // Creatures + m_uiLeviathanGUID(0), + m_uiIgnisGUID(0), + m_uiRazorscaleGUID(0), + m_uiCommanderGUID(0), + m_uiXT002GUID(0), + m_uiBrundirGUID(0), + m_uiMolgeimGUID(0), + m_uiSteelbreakerGUID(0), + m_uiKologarnGUID(0), + m_uiAuriayaGUID(0), + m_uiMimironGUID(0), + m_uiHodirGUID(0), + m_uiThorimGUID(0), + m_uiFreyaGUID(0), + m_uiVezaxGUID(0), + m_uiYoggSaronGUID(0), + m_uiAlgalonGUID(0), + m_uiRightArmGUID(0), + m_uiLeftArmGUID(0), + m_uiFeralDefenderGUID(0), + m_uiElderBrightleafGUID(0), + m_uiElderStonebarkGUID(0), + m_uiElderIronbrachGUID(0), + m_uiSaroniteAnimusGUID(0), + m_uiRunicColossusGUID(0), + m_uiRuneGiantGUID(0), + m_uiJormungarGUID(0), + m_uiLeviathanMkGUID(0), + m_uiSaraGUID(0), + m_uiYoggBrainGUID(0), + + // Chests + m_uiKologarnLootGUID(0), + m_uiHodirLootGUID(0), + m_uiHodirRareLootGUID(0), + m_uiThorimLootGUID(0), + m_uiThorimRareLootGUID(0), + m_uiMimironLootGUID(0), + m_uiMimironHardLootGUID(0), + m_uiAlagonLootGUID(0), + + // Doors + // The siege + m_uiShieldWallGUID(0), + m_uiLeviathanGateGUID(0), + m_uiXT002GateGUID(0), + m_uiBrokenHarpoonGUID(0), + // Archivum + m_uiIronCouncilDoorGUID(0), + m_uiArchivumDoorGUID(0), + m_uiArchivumConsoleGUID(0), + m_uiUniverseFloorArchivumGUID(0), + // Celestial planetarium + m_uiCelestialDoorGUID(0), + m_uiCelestialConsoleGUID(0), + m_uiUniverseFloorCelestialGUID(0), + m_uiAzerothGlobeGUID(0), + // Kologarn + m_uiShatteredHallsDoorGUID(0), + m_uiKologarnBridgeGUID(0), + // Hodir + m_uiHodirEnterDoorGUID(0), + m_uiHodirWallGUID(0), + m_uiHodirExitDoorGUID(0), + // Mimiron + m_uiMimironButtonGUID(0), + m_uiMimironDoor1GUID(0), + m_uiMimironDoor2GUID(0), + m_uiMimironDoor3GUID(0), + m_uiMimironElevatorGUID(0), + // Thorim + m_uiArenaEnterDoorGUID(0), + m_uiArenaExitDoorGUID(0), + m_uiHallwayDoorGUID(0), + m_uiThorimEnterDoorGUID(0), + m_uiThorimLeverGUID(0), + // Prison + m_uiAncientGateGUID(0), + m_uiVezaxGateGUID(0), + m_uiYoggGateGUID(0), + m_uiBrainDoor1GUID(0), + m_uiBrainDoor2GUID(0), + m_uiBrainDoor3GUID(0) +{ + Initialize(); +} + +void instance_ulduar::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_auiHardBoss, 0, sizeof(m_auiHardBoss)); + memset(&m_auiUlduarKeepers, 0, sizeof(m_auiUlduarKeepers)); + memset(&m_auiUlduarTeleporters, 0, sizeof(m_auiUlduarTeleporters)); + memset(&m_auiMimironTelGUID, 0, sizeof(m_auiMimironTelGUID)); +} + +bool instance_ulduar::IsEncounterInProgress() const +{ + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + } + return false; +} + +void instance_ulduar::OnCreatureCreate(Creature* pCreature) +{ + switch (pCreature->GetEntry()) + { + case NPC_LEVIATHAN: + m_uiLeviathanGUID = pCreature->GetGUID(); + break; + case NPC_IGNIS: + m_uiIgnisGUID = pCreature->GetGUID(); + break; + case NPC_RAZORSCALE: + m_uiRazorscaleGUID = pCreature->GetGUID(); + break; + case NPC_COMMANDER: + m_uiCommanderGUID = pCreature->GetGUID(); + break; + case NPC_XT002: + m_uiXT002GUID = pCreature->GetGUID(); + break; + case NPC_STEELBREAKER: + m_uiSteelbreakerGUID = pCreature->GetGUID(); + break; + case NPC_MOLGEIM: + m_uiMolgeimGUID = pCreature->GetGUID(); + break; + case NPC_BRUNDIR: + m_uiBrundirGUID = pCreature->GetGUID(); + break; + case NPC_KOLOGARN: + m_uiKologarnGUID = pCreature->GetGUID(); + break; + case NPC_RIGHT_ARM: + m_uiRightArmGUID = pCreature->GetGUID(); + break; + case NPC_LEFT_ARM: + m_uiLeftArmGUID = pCreature->GetGUID(); + break; + case NPC_AURIAYA: + m_uiAuriayaGUID = pCreature->GetGUID(); + break; + case NPC_FERAL_DEFENDER: + m_uiFeralDefenderGUID = pCreature->GetGUID(); + break; + case NPC_MIMIRON: + m_uiMimironGUID = pCreature->GetGUID(); + if(m_auiEncounter[7] == DONE) + SpawnFriendlyKeeper(NPC_MIMIRON_IMAGE); + break; + case NPC_LEVIATHAN_MK: + m_uiLeviathanMkGUID = pCreature->GetGUID(); + break; + case NPC_HODIR: + m_uiHodirGUID = pCreature->GetGUID(); + if(m_auiEncounter[8] == DONE) + SpawnFriendlyKeeper(NPC_HODIR_IMAGE); + break; + case NPC_THORIM: + m_uiThorimGUID = pCreature->GetGUID(); + if(m_auiEncounter[9] == DONE) + SpawnFriendlyKeeper(NPC_THORIM_IMAGE); + break; + case NPC_RUNIC_COLOSSUS: + m_uiRunicColossusGUID = pCreature->GetGUID(); + break; + case NPC_RUNE_GIANT: + m_uiRuneGiantGUID = pCreature->GetGUID(); + break; + case NPC_JORMUNGAR_BEHEMOTH: + m_uiJormungarGUID = pCreature->GetGUID(); + break; + case NPC_FREYA: + m_uiFreyaGUID = pCreature->GetGUID(); + if(m_auiEncounter[10] == DONE) + SpawnFriendlyKeeper(NPC_FREYA_IMAGE); + break; + case NPC_ELDER_BRIGHTLEAF: + m_uiElderBrightleafGUID = pCreature->GetGUID(); + break; + case NPC_ELDER_IRONBRACH: + m_uiElderIronbrachGUID = pCreature->GetGUID(); + break; + case NPC_ELDER_STONEBARK: + m_uiElderStonebarkGUID = pCreature->GetGUID(); + break; + case NPC_VEZAX: + m_uiVezaxGUID = pCreature->GetGUID(); + break; + case NPC_SARONITE_ANIMUS: + m_uiSaroniteAnimusGUID = pCreature->GetGUID(); + break; + case NPC_YOGGSARON: + m_uiYoggSaronGUID = pCreature->GetGUID(); + break; + case NPC_SARA: + m_uiSaraGUID = pCreature->GetGUID(); + break; + case NPC_YOGG_BRAIN: + m_uiYoggBrainGUID = pCreature->GetGUID(); + break; + case NPC_ALGALON: + m_uiAlgalonGUID = pCreature->GetGUID(); + break; + } +} + +void instance_ulduar::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + // ----------------- Doors & Other ----------------- + // The siege + case GO_SHIELD_WALL: + m_uiShieldWallGUID = pGo->GetGUID(); + break; + case GO_LEVIATHAN_GATE: + m_uiLeviathanGateGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_XT002_GATE: + pGo->SetGoState(GO_STATE_READY); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + if (m_auiEncounter[1] == DONE && m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + m_uiXT002GateGUID = pGo->GetGUID(); + break; + case GO_BROKEN_HARPOON: + m_uiBrokenHarpoonGUID = pGo->GetGUID(); + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + + // Archivum + case GO_IRON_ENTRANCE_DOOR: + m_uiIronCouncilDoorGUID = pGo->GetGUID(); + break; + case GO_ARCHIVUM_DOOR: + m_uiArchivumDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[4]) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_ARCHIVUM_CONSOLE: + m_uiArchivumConsoleGUID = pGo->GetGUID(); + break; + case GO_UNIVERSE_FLOOR_ARCHIVUM: + m_uiUniverseFloorArchivumGUID = pGo->GetGUID(); + break; + // Celestial Planetarium + case GO_CELESTIAL_ACCES: + m_uiCelestialConsoleGUID = pGo->GetGUID(); + break; + case GO_CELESTIAL_DOOR: + m_uiCelestialDoorGUID = pGo->GetGUID(); + break; + case GO_UNIVERSE_FLOOR_CELESTIAL: + m_uiUniverseFloorCelestialGUID = pGo->GetGUID(); + break; + case GO_AZEROTH_GLOBE: + m_uiAzerothGlobeGUID = pGo->GetGUID(); + break; + // Shattered Hallway + case GO_KOLOGARN_BRIDGE: + m_uiKologarnBridgeGUID = pGo->GetGUID(); + pGo->SetGoState(GO_STATE_ACTIVE); + if (m_auiEncounter[5] == DONE) + pGo->SetGoState(GO_STATE_READY); + break; + case GO_SHATTERED_DOOR: + m_uiShatteredHallsDoorGUID = pGo->GetGUID(); + break; + + // ----------------- The Keepers ----------------- + // Hodir + case GO_HODIR_EXIT: + m_uiHodirExitDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[8]) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_HODIR_ICE_WALL: + m_uiHodirWallGUID = pGo->GetGUID(); + if (m_auiEncounter[8]) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_HODIR_ENTER: + m_uiHodirEnterDoorGUID = pGo->GetGUID(); + break; + // Mimiron + case G0_MIMIRON_BUTTON: + m_uiMimironButtonGUID = pGo->GetGUID(); + if (m_auiEncounter[7] == NOT_STARTED) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case GO_MIMIRON_DOOR_1: + m_uiMimironDoor1GUID = pGo->GetGUID(); + break; + case GO_MIMIRON_DOOR_2: + m_uiMimironDoor2GUID = pGo->GetGUID(); + break; + case GO_MIMIRON_DOOR_3: + m_uiMimironDoor3GUID = pGo->GetGUID(); + break; + case GO_MIMIRON_ELEVATOR: + m_uiMimironElevatorGUID = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL1: + m_auiMimironTelGUID[0] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL2: + m_auiMimironTelGUID[1] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL3: + m_auiMimironTelGUID[2] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL4: + m_auiMimironTelGUID[3] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL5: + m_auiMimironTelGUID[4] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL6: + m_auiMimironTelGUID[5] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL7: + m_auiMimironTelGUID[6] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL8: + m_auiMimironTelGUID[7] = pGo->GetGUID(); + break; + case GO_MIMIRON_TEL9: + m_auiMimironTelGUID[8] = pGo->GetGUID(); + break; + // Thorim + case GO_DARK_IRON_PORTCULIS: + m_uiArenaExitDoorGUID = pGo->GetGUID(); + break; + case GO_RUNED_STONE_DOOR: + m_uiHallwayDoorGUID = pGo->GetGUID(); + break; + case GO_THORIM_STONE_DOOR: + m_uiThorimEnterDoorGUID = pGo->GetGUID(); + break; + case GO_LIGHTNING_FIELD: + m_uiArenaEnterDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_LEVER: + m_uiThorimLeverGUID = pGo->GetGUID(); + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + + // Prison + case GO_ANCIENT_GATE: + m_uiAncientGateGUID = pGo->GetGUID(); + DoOpenMadnessDoorIfCan(); + break; + case GO_VEZAX_GATE: + m_uiVezaxGateGUID = pGo->GetGUID(); + pGo->SetGoState(GO_STATE_READY); + if (m_auiEncounter[11]) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_YOGG_GATE: + m_uiYoggGateGUID = pGo->GetGUID(); + break; + case GO_BRAIN_DOOR1: + m_uiBrainDoor1GUID = pGo->GetGUID(); + break; + case GO_BRAIN_DOOR2: + m_uiBrainDoor2GUID = pGo->GetGUID(); + break; + case GO_BRAIN_DOOR3: + m_uiBrainDoor3GUID = pGo->GetGUID(); + break; + + // ----------------- Chests ----------------- + // Kologarn + case GO_CACHE_OF_LIVING_STONE: + case GO_CACHE_OF_LIVING_STONE_H: + m_uiKologarnLootGUID = pGo->GetGUID(); + break; + + // Hodir + case GO_CACHE_OF_WINTER: + case GO_CACHE_OF_WINTER_H: + m_uiHodirLootGUID = pGo->GetGUID(); + break; + case GO_CACHE_OF_RARE_WINTER: + case GO_CACHE_OF_RARE_WINTER_H: + m_uiHodirRareLootGUID = pGo->GetGUID(); + break; + + // Thorim + case GO_CACHE_OF_STORMS: + case GO_CACHE_OF_STORMS_H: + m_uiThorimLootGUID = pGo->GetGUID(); + break; + case GO_CACHE_OF_RARE_STORMS: + case GO_CACHE_OF_RARE_STORMS_H: + m_uiThorimRareLootGUID = pGo->GetGUID(); + break; + + // Mimiron + case GO_CACHE_OF_INOV: + case GO_CACHE_OF_INOV_H: + m_uiMimironLootGUID = pGo->GetGUID(); + break; + case GO_CACHE_OF_INOV_HARD: + case GO_CACHE_OF_INOV_HARD_H: + m_uiMimironHardLootGUID = pGo->GetGUID(); + break; + + // Alagon + case GO_GIFT_OF_OBSERVER: + case GO_GIFT_OF_OBSERVER_H: + m_uiAlagonLootGUID = pGo->GetGUID(); + break; + } +} + +Player* instance_ulduar::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; + } + } + return NULL; +} + +// Used in order to unlock the door to Vezax +void instance_ulduar::DoOpenMadnessDoorIfCan() +{ + if (m_auiEncounter[TYPE_MIMIRON] == DONE && m_auiEncounter[TYPE_HODIR] == DONE && m_auiEncounter[TYPE_THORIM] == DONE && m_auiEncounter[TYPE_FREYA] == DONE) + { + if (GameObject* pDoor = instance->GetGameObject(m_uiAncientGateGUID)) + pDoor->SetGoState(GO_STATE_ACTIVE); + } +} + +void instance_ulduar::SetData(uint32 uiType, uint32 uiData) +{ + switch (uiType) + { + case TYPE_LEVIATHAN: + m_auiEncounter[0] = uiData; + DoUseDoorOrButton(m_uiShieldWallGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiXT002GateGUID); + DoUseDoorOrButton(m_uiLeviathanGateGUID); + } + break; + case TYPE_IGNIS: + m_auiEncounter[1] = uiData; + break; + case TYPE_RAZORSCALE: + m_auiEncounter[2] = uiData; + break; + case TYPE_XT002: + m_auiEncounter[3] = uiData; + DoUseDoorOrButton(m_uiXT002GateGUID); + break; + case TYPE_ASSEMBLY: + m_auiEncounter[4] = uiData; + DoUseDoorOrButton(m_uiIronCouncilDoorGUID); + if (uiData == DONE) + DoUseDoorOrButton(m_uiArchivumDoorGUID); + break; + case TYPE_KOLOGARN: + m_auiEncounter[5] = uiData; + DoUseDoorOrButton(m_uiShatteredHallsDoorGUID); + if (uiData == DONE) + { + DoRespawnGameObject(m_uiKologarnLootGUID, 30*MINUTE); + if(GameObject* pBridge = instance->GetGameObject(m_uiKologarnBridgeGUID)) + pBridge->SetGoState(GO_STATE_READY); + } + break; + case TYPE_AURIAYA: + m_auiEncounter[6] = uiData; + break; + // Keepers + case TYPE_MIMIRON: + m_auiEncounter[7] = uiData; + DoUseDoorOrButton(m_uiMimironDoor1GUID); + DoUseDoorOrButton(m_uiMimironDoor2GUID); + DoUseDoorOrButton(m_uiMimironDoor3GUID); + if (uiData == DONE) + { + if (m_auiHardBoss[3] != DONE) + DoRespawnGameObject(m_uiMimironLootGUID, 30*MINUTE); + SpawnFriendlyKeeper(NPC_MIMIRON_IMAGE); + } + break; + case TYPE_HODIR: + m_auiEncounter[8] = uiData; + DoUseDoorOrButton(m_uiHodirEnterDoorGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiHodirWallGUID); + DoUseDoorOrButton(m_uiHodirExitDoorGUID); + DoRespawnGameObject(m_uiHodirLootGUID, 30*MINUTE); + SpawnFriendlyKeeper(NPC_HODIR_IMAGE); + } + break; + case TYPE_THORIM: + m_auiEncounter[9] = uiData; + DoUseDoorOrButton(m_uiArenaEnterDoorGUID); + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiArenaExitDoorGUID); + if (uiData == DONE) + { + if (m_auiHardBoss[5] != DONE) + DoRespawnGameObject(m_uiThorimLootGUID, 30*MINUTE); + SpawnFriendlyKeeper(NPC_THORIM_IMAGE); + } + break; + case TYPE_FREYA: + m_auiEncounter[10] = uiData; + if (uiData == DONE) + SpawnFriendlyKeeper(NPC_FREYA_IMAGE); + break; + // Prison + case TYPE_VEZAX: + m_auiEncounter[11] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiVezaxGateGUID); + break; + case TYPE_YOGGSARON: + m_auiEncounter[12] = uiData; + DoUseDoorOrButton(m_uiYoggGateGUID); + break; + + // Celestial Planetarium + case TYPE_ALGALON: + m_auiEncounter[13] = uiData; + //TODO: need to find the proper way to use these + DoUseDoorOrButton(m_uiCelestialDoorGUID); + DoUseDoorOrButton(m_uiUniverseFloorCelestialGUID); + if (uiData == DONE) + DoRespawnGameObject(m_uiAlagonLootGUID, 30*MINUTE); + break; + + // Hard modes + case TYPE_LEVIATHAN_HARD: + m_auiHardBoss[0] = uiData; // TODO: add extra loot + break; + case TYPE_XT002_HARD: + m_auiHardBoss[1] = uiData; // TODO: add extra loot + break; + case TYPE_HODIR_HARD: + m_auiHardBoss[4] = uiData; + if (uiData == DONE) + DoRespawnGameObject(m_uiHodirRareLootGUID, 30*MINUTE); + break; + case TYPE_ASSEMBLY_HARD: + m_auiHardBoss[2] = uiData; // TODO: add extra loot + break; + case TYPE_FREYA_HARD: + m_auiHardBoss[6] = uiData; // Hard mode loot in in script + break; + case TYPE_THORIM_HARD: + m_auiHardBoss[5] = uiData; + if (uiData == DONE) + DoRespawnGameObject(m_uiThorimRareLootGUID, 30*MINUTE); + break; + case TYPE_MIMIRON_HARD: + m_auiHardBoss[3] = uiData; + if (uiData == DONE) + DoRespawnGameObject(m_uiMimironHardLootGUID, 30*MINUTE); + break; + case TYPE_VEZAX_HARD: + m_auiHardBoss[7] = uiData; // TODO: add extra loot + break; + case TYPE_YOGGSARON_HARD: + m_auiHardBoss[8] = uiData; // TODO: add extra loot + break; + + // Ulduar keepers + case TYPE_KEEPER_HODIR: + m_auiUlduarKeepers[0] = uiData; + break; + case TYPE_KEEPER_THORIM: + m_auiUlduarKeepers[1] = uiData; + break; + case TYPE_KEEPER_FREYA: + m_auiUlduarKeepers[2] = uiData; + break; + case TYPE_KEEPER_MIMIRON: + m_auiUlduarKeepers[3] = uiData; + break; + + // Teleporters + case TYPE_LEVIATHAN_TP: + m_auiUlduarTeleporters[0] = uiData; + break; + case TYPE_XT002_TP: + m_auiUlduarTeleporters[1] = uiData; + break; + case TYPE_MIMIRON_TP: + m_auiUlduarTeleporters[2] = uiData; + break; + } + + DoOpenMadnessDoorIfCan(); + + if (uiData == DONE || uiData == FAIL) + { + OUT_SAVE_INST_DATA; + + // Save all encounters, hard bosses, keepers and teleporters + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8] << " " + << m_auiEncounter[9] << " " << m_auiEncounter[10] << " " << m_auiEncounter[11] << " " + << m_auiEncounter[12] << " " << m_auiEncounter[13] << " " << m_auiHardBoss[0] << " " + << m_auiHardBoss[1] << " " << m_auiHardBoss[2] << " " << m_auiHardBoss[2] << " " + << m_auiHardBoss[4] << " " << m_auiHardBoss[5] << " " << m_auiHardBoss[6] << " " + << m_auiHardBoss[7] << " " << m_auiHardBoss[8] << " " << m_auiUlduarKeepers[0] << " " + << m_auiUlduarKeepers[1] << " " << m_auiUlduarKeepers[2] << " " << m_auiUlduarKeepers[3]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } +} + +uint64 instance_ulduar::GetData64(uint32 uiData) +{ + switch (uiData) + { + // Siege + case NPC_LEVIATHAN: + return m_uiLeviathanGUID; + case NPC_IGNIS: + return m_uiIgnisGUID; + case NPC_RAZORSCALE: + return m_uiRazorscaleGUID; + case NPC_COMMANDER: + return m_uiCommanderGUID; + case NPC_XT002: + return m_uiXT002GUID; + // Antechamber + case NPC_STEELBREAKER: + return m_uiSteelbreakerGUID; + case NPC_MOLGEIM: + return m_uiMolgeimGUID; + case NPC_BRUNDIR: + return m_uiBrundirGUID; + case NPC_KOLOGARN: + return m_uiKologarnGUID; + case NPC_LEFT_ARM: + return m_uiLeftArmGUID; + case NPC_RIGHT_ARM: + return m_uiRightArmGUID; + case NPC_AURIAYA: + return m_uiAuriayaGUID; + // Keepers + case NPC_MIMIRON: + return m_uiMimironGUID; + case NPC_LEVIATHAN_MK: + return m_uiLeviathanMkGUID; + case NPC_HODIR: + return m_uiMimironGUID; + case NPC_THORIM: + return m_uiThorimGUID; + case NPC_RUNE_GIANT: + return m_uiRuneGiantGUID; + case NPC_RUNIC_COLOSSUS: + return m_uiRunicColossusGUID; + case NPC_JORMUNGAR_BEHEMOTH: + return m_uiJormungarGUID; + case NPC_FREYA: + return m_uiFreyaGUID; + case NPC_ELDER_BRIGHTLEAF: + return m_uiElderBrightleafGUID; + case NPC_ELDER_IRONBRACH: + return m_uiElderIronbrachGUID; + case NPC_ELDER_STONEBARK: + return m_uiElderStonebarkGUID; + case NPC_VEZAX: + return m_uiVezaxGUID; + case NPC_YOGGSARON: + return m_uiYoggSaronGUID; + case NPC_SARA: + return m_uiSaraGUID; + case NPC_YOGG_BRAIN: + return m_uiYoggBrainGUID; + case NPC_ALGALON: + return m_uiAlgalonGUID; + + // Mimiron hard mode button + case G0_MIMIRON_BUTTON: + return m_uiMimironButtonGUID; + // Celestial door + case GO_CELESTIAL_DOOR: + return m_uiCelestialDoorGUID; + } + + return 0; +} + +// TODO: implement all hard mode loot here! +bool instance_ulduar::CheckConditionCriteriaMeet(Player const* pSource, uint32 uiMapId, uint32 uiInstanceConditionId) +{ + if (uiMapId != instance->GetId()) + return false; + + switch (uiInstanceConditionId) + { + case TYPE_XT002_HARD: + break; + } + return false; +} + +uint32 instance_ulduar::GetData(uint32 uiType) +{ + switch (uiType) + { + case TYPE_LEVIATHAN: + return m_auiEncounter[0]; + case TYPE_IGNIS: + return m_auiEncounter[1]; + case TYPE_RAZORSCALE: + return m_auiEncounter[2]; + case TYPE_XT002: + return m_auiEncounter[3]; + case TYPE_ASSEMBLY: + return m_auiEncounter[4]; + case TYPE_KOLOGARN: + return m_auiEncounter[5]; + case TYPE_AURIAYA: + return m_auiEncounter[6]; + case TYPE_MIMIRON: + return m_auiEncounter[7]; + case TYPE_HODIR: + return m_auiEncounter[8]; + case TYPE_THORIM: + return m_auiEncounter[9]; + case TYPE_FREYA: + return m_auiEncounter[10]; + case TYPE_VEZAX: + return m_auiEncounter[11]; + case TYPE_YOGGSARON: + return m_auiEncounter[12]; + case TYPE_ALGALON: + return m_auiEncounter[13]; + + // Hard modes + case TYPE_LEVIATHAN_HARD: + return m_auiHardBoss[0]; + case TYPE_XT002_HARD: + return m_auiHardBoss[1]; + case TYPE_ASSEMBLY_HARD: + return m_auiHardBoss[2]; + case TYPE_MIMIRON_HARD: + return m_auiHardBoss[3]; + case TYPE_HODIR_HARD: + return m_auiHardBoss[4]; + case TYPE_THORIM_HARD: + return m_auiHardBoss[5]; + case TYPE_FREYA_HARD: + return m_auiHardBoss[6]; + case TYPE_VEZAX_HARD: + return m_auiHardBoss[7]; + case TYPE_YOGGSARON_HARD: + return m_auiHardBoss[8]; + + // Ulduar Keepers + case TYPE_KEEPER_HODIR: + return m_auiUlduarKeepers[0]; + case TYPE_KEEPER_THORIM: + return m_auiUlduarKeepers[1]; + case TYPE_KEEPER_FREYA: + return m_auiUlduarKeepers[2]; + case TYPE_KEEPER_MIMIRON: + return m_auiUlduarKeepers[3]; + + // Teleporters + case TYPE_LEVIATHAN_TP: + return m_auiUlduarTeleporters[0]; + case TYPE_XT002_TP: + return m_auiUlduarTeleporters[1]; + case TYPE_MIMIRON_TP: + return m_auiUlduarTeleporters[2]; + } + + return 0; +} + +// Spawn the friendly keepers in the central chamber +void instance_ulduar::SpawnFriendlyKeeper(uint32 uiWho) +{ + Player* pPlayer = GetPlayerInMap(); + if (!pPlayer) + return; + + switch(uiWho) + { + case NPC_MIMIRON_IMAGE: pPlayer->SummonCreature(NPC_MIMIRON_IMAGE, m_aKeepersSpawnLocs[1].m_fX, m_aKeepersSpawnLocs[1].m_fY, m_aKeepersSpawnLocs[1].m_fZ, m_aKeepersSpawnLocs[1].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); break; + case NPC_HODIR_IMAGE: pPlayer->SummonCreature(NPC_HODIR_IMAGE, m_aKeepersSpawnLocs[2].m_fX, m_aKeepersSpawnLocs[2].m_fY, m_aKeepersSpawnLocs[2].m_fZ, m_aKeepersSpawnLocs[2].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); break; + case NPC_THORIM_IMAGE: pPlayer->SummonCreature(NPC_THORIM_IMAGE, m_aKeepersSpawnLocs[3].m_fX, m_aKeepersSpawnLocs[3].m_fY, m_aKeepersSpawnLocs[3].m_fZ, m_aKeepersSpawnLocs[3].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); break; + case NPC_FREYA_IMAGE: pPlayer->SummonCreature(NPC_FREYA_IMAGE, m_aKeepersSpawnLocs[0].m_fX, m_aKeepersSpawnLocs[0].m_fY, m_aKeepersSpawnLocs[0].m_fZ, m_aKeepersSpawnLocs[0].m_fO, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000); break; + } +} + +void instance_ulduar::Load(const char* strIn) +{ + if (!strIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(strIn); + + std::istringstream loadStream(strIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] + >> m_auiEncounter[8] >> m_auiEncounter[9] >> m_auiEncounter[10] >> m_auiEncounter[11] + >> m_auiEncounter[12] >> m_auiEncounter[13] >> m_auiHardBoss[0] >> m_auiHardBoss[1] + >> m_auiHardBoss[2] >> m_auiHardBoss[3] >> m_auiHardBoss[4] >> m_auiHardBoss[5] + >> m_auiHardBoss[6] >> m_auiHardBoss[7] >> m_auiHardBoss[8] >> m_auiUlduarKeepers[0] + >> m_auiUlduarKeepers[1] >> m_auiUlduarKeepers[2] >> m_auiUlduarKeepers[3]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; +} + +InstanceData* GetInstanceData_instance_ulduar(Map* pMap) +{ + return new instance_ulduar(pMap); +} + +void AddSC_instance_ulduar() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_ulduar"; + pNewScript->GetInstanceData = &GetInstanceData_instance_ulduar; + pNewScript->RegisterSelf(); +} diff --git a/scripts/northrend/ulduar/ulduar/ulduar.cpp b/scripts/northrend/ulduar/ulduar/ulduar.cpp new file mode 100644 index 0000000..d7da144 --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/ulduar.cpp @@ -0,0 +1,55 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: ulduar +SD%Complete: 0% +SDComment: +SDCategory: Ulduar +EndScriptData */ + +#include "precompiled.h" +#include "ulduar.h" + +/*##### +## Teleporters +#####*/ +enum TeleporterSpells +{ + SPELL_TELE_EXPEDITION_BASE_CAMP = 64014, + SPELL_TELE_FORMATION_GROUNDS = 64032, + SPELL_TELE_COLOSSAL_FORGE = 64028, + SPELL_TELE_SCRAPYARD = 64031, + SPELL_TELE_ANTECHAMBER_OF_ULDUAR = 64030, + SPELL_TELE_SHATTERED_WALKWAY = 64029, + SPELL_TELE_CONSERVATORY_OF_LIFE = 64024, + SPELL_TELE_SPARK_OF_IMAGINATION = 65061, + SPELL_TELE_PRISON_OF_YOGG = 65042, +}; + +// Teleporter Gossip handled by SD2 because depending on Instance Data +enum TeleporterGossipItems +{ + GOSSIP_ITEM_TELE_BASE_CAMP = -3603000, + GOSSIP_ITEM_TELE_FORMATION_GROUNDS = -3603001, + GOSSIP_ITEM_TELE_COLOSSAR_FORGE = -3603002, + GOSSIP_ITEM_TELE_SCRAPYARD = -3603003, + GOSSIP_ITEM_TELE_ANTECHAMBER = -3603004, + GOSSIP_ITEM_TELE_WALKWAY = -3603005, + GOSSIP_ITEM_TELE_CONSERVATORY = -3603006, + GOSSIP_ITEM_TELE_SPARK_IMAGINATION = -3603007, + GOSSIP_ITEM_TELE_YOGG_SARON = -3603008, +}; diff --git a/scripts/northrend/ulduar/ulduar/ulduar.h b/scripts/northrend/ulduar/ulduar/ulduar.h new file mode 100644 index 0000000..349f66e --- /dev/null +++ b/scripts/northrend/ulduar/ulduar/ulduar.h @@ -0,0 +1,325 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ULDUAR_H +#define DEF_ULDUAR_H + +enum +{ + MAX_ENCOUNTER = 14, + HARD_MODE_ENCOUNTER = 9, + KEEPER_ENCOUNTER = 4, + TELEPORTER_ENCOUNTER = 3, + + // Main boss types + TYPE_LEVIATHAN = 0, + TYPE_IGNIS = 1, + TYPE_RAZORSCALE = 2, + TYPE_XT002 = 3, + TYPE_ASSEMBLY = 4, + TYPE_KOLOGARN = 5, + TYPE_AURIAYA = 6, + TYPE_MIMIRON = 7, + TYPE_HODIR = 8, + TYPE_THORIM = 9, + TYPE_FREYA = 10, + TYPE_VEZAX = 11, + TYPE_YOGGSARON = 12, + TYPE_ALGALON = 13, + + // Hard mode boss types + // Used for hard mode bosses only + TYPE_LEVIATHAN_HARD = 14, + TYPE_XT002_HARD = 15, + TYPE_ASSEMBLY_HARD = 16, + TYPE_MIMIRON_HARD = 17, + TYPE_HODIR_HARD = 18, + TYPE_THORIM_HARD = 19, + TYPE_FREYA_HARD = 20, + TYPE_VEZAX_HARD = 21, + TYPE_YOGGSARON_HARD = 22, + + // Keeper types + // Used to store the keepers which will be used at yogg + TYPE_KEEPER_HODIR = 23, + TYPE_KEEPER_FREYA = 24, + TYPE_KEEPER_THORIM = 25, + TYPE_KEEPER_MIMIRON = 26, + + // Teleporter types + // Some teleporters aren't depending directly on a boss, so we use a distinct type for them (maybe use areatrigger?) + TYPE_LEVIATHAN_TP = 27, + TYPE_XT002_TP = 28, + TYPE_MIMIRON_TP = 29, + + // The siege of ulduar + NPC_LEVIATHAN = 33113, + NPC_IGNIS = 33118, + NPC_RAZORSCALE = 33186, + NPC_COMMANDER = 33210, + NPC_XT002 = 33293, + + // The antechamber of ulduar + NPC_STEELBREAKER = 32867, + NPC_MOLGEIM = 32927, + NPC_BRUNDIR = 32857, + NPC_KOLOGARN = 32930, + NPC_RIGHT_ARM = 32934, + NPC_LEFT_ARM = 32933, + NPC_AURIAYA = 33515, + NPC_SANCTUM_SENTRY = 34014, + NPC_FERAL_DEFENDER = 34035, + + // The keepers of ulduar + NPC_MIMIRON = 33350, + NPC_LEVIATHAN_MK = 33432, + NPC_VX001 = 33651, + NPC_AERIAL_UNIT = 33670, + NPC_HODIR = 32845, + NPC_THORIM = 32865, + NPC_RUNIC_COLOSSUS = 32872, + NPC_RUNE_GIANT = 32873, + NPC_JORMUNGAR_BEHEMOTH = 32882, + NPC_FREYA = 32906, + NPC_ELDER_BRIGHTLEAF = 32915, + NPC_ELDER_IRONBRACH = 32913, + NPC_ELDER_STONEBARK = 32914, + + // The descent into madness + NPC_VEZAX = 33271, + NPC_SARONITE_ANIMUS = 33524, + NPC_YOGGSARON = 33288, + NPC_SARA = 33134, + NPC_YOGG_BRAIN = 33890, + + // Celestial planetarium + NPC_ALGALON = 32871, + + // Keepers images + // They spawn in the central room after they are released from Yogg's enslavement + // You may talk to them and ask them to help you fight Yogg-Saron + NPC_THORIM_IMAGE = 33413, + NPC_MIMIRON_IMAGE = 33412, + NPC_HODIR_IMAGE = 33411, + NPC_FREYA_IMAGE = 33410, + + // Keepers used to fight Yogg-Saron + NPC_KEEPER_FREYA = 33241, + NPC_KEEPER_HODIR = 33213, + NPC_KEEPER_MIMIRON = 33244, + NPC_KEEPER_THORIM = 33242, + + // Loot chests + // Kologarn + GO_CACHE_OF_LIVING_STONE = 195046, + GO_CACHE_OF_LIVING_STONE_H = 195047, + + // Hodir + GO_CACHE_OF_WINTER = 194307, + GO_CACHE_OF_WINTER_H = 194308, + GO_CACHE_OF_RARE_WINTER = 194200, + GO_CACHE_OF_RARE_WINTER_H = 194201, + + // Mimiron + GO_CACHE_OF_INOV = 194789, + GO_CACHE_OF_INOV_H = 194956, + GO_CACHE_OF_INOV_HARD = 194957, + GO_CACHE_OF_INOV_HARD_H = 194958, + + // Thorim + GO_CACHE_OF_STORMS = 194312, + GO_CACHE_OF_STORMS_H = 194314, + GO_CACHE_OF_RARE_STORMS = 194313, + GO_CACHE_OF_RARE_STORMS_H = 194315, + + // Alagon + GO_GIFT_OF_OBSERVER_H = 194821, + GO_GIFT_OF_OBSERVER = 194822, + GO_GIFT_OF_OBSERVER_HH = 194823, // Purpose Unknown + + // Doors and other Objects + // The siege + GO_SHIELD_WALL = 194416, // Gate before Leviathan + GO_LEVIATHAN_GATE = 194630, // Gate after Leviathan -> this should be used before the boss enter the arena + // There should be another gate after the Leviathan here which should be used during the Leviathan encounter + GO_XT002_GATE = 194631, // Gate before Xt002 + GO_BROKEN_HARPOON = 194565, // Broken harpoon from Razorscale + + // Antechamber + GO_KOLOGARN_BRIDGE = 194232, + GO_SHATTERED_DOOR = 194553, // Door before kologarn + GO_IRON_ENTRANCE_DOOR = 194554, // Door before iron council + GO_ARCHIVUM_DOOR = 194556, // Entrance door to the archivum + GO_ARCHIVUM_CONSOLE = 194555, // Used at some sort of cinematic + GO_UNIVERSE_FLOOR_ARCHIVUM = 194715, // Used for animation + + // Planetarium + GO_CELESTIAL_ACCES = 194628, // Acces console for 10 man mode + GO_CELESTIAL_ACCES_H = 194752, // Acces console for 25 man mode + GO_CELESTIAL_DOOR = 194767, // Entrance door to the planetarium + GO_UNIVERSE_FLOOR_CELESTIAL = 194716, // For animation + GO_AZEROTH_GLOBE = 194148, // For animation + + // The keepers + // Hodir + GO_HODIR_EXIT = 194634, + GO_HODIR_ICE_WALL = 194441, + GO_HODIR_ENTER = 194442, + // Mimiron + G0_MIMIRON_BUTTON = 194739, // Used to start hard mode + GO_MIMIRON_DOOR_1 = 194774, + GO_MIMIRON_DOOR_2 = 194775, + GO_MIMIRON_DOOR_3 = 194776, + GO_MIMIRON_TEL1 = 194741, // Used to summon mobs in phase 3 + GO_MIMIRON_TEL2 = 194742, + GO_MIMIRON_TEL3 = 194743, + GO_MIMIRON_TEL4 = 194744, + GO_MIMIRON_TEL5 = 194740, + GO_MIMIRON_TEL6 = 194746, + GO_MIMIRON_TEL7 = 194747, + GO_MIMIRON_TEL8 = 194748, + GO_MIMIRON_TEL9 = 194745, + GO_MIMIRON_ELEVATOR = 194749, // Central elevator + // Thorim + GO_DARK_IRON_PORTCULIS = 194560, // Door from the arena to the hallway + GO_RUNED_STONE_DOOR = 194557, // Door after the runic colossus + GO_THORIM_STONE_DOOR = 194558, // Door after the ancient rune giant + GO_LIGHTNING_DOOR = 194905, // Arena exit door + GO_LIGHTNING_FIELD = 194559, // For the platform animation + GO_DOOR_LEVER = 194264, // In front of the door + + // Descent to madness + GO_ANCIENT_GATE = 194255, // Door upstairs before vezax, opens when all keepers are freed + GO_VEZAX_GATE = 194750, // Door after vezax + GO_YOGG_GATE = 194773, // Yogg-Saron chamber door + GO_BRAIN_DOOR1 = 194635, // Brain chamber doors + GO_BRAIN_DOOR2 = 194636, + GO_BRAIN_DOOR3 = 194637, + + // World state used for algalon timer + WORLD_STATE_TIMER = 4132, + WORLD_STATE_TIMER_COUNT = 4131, +}; + +class MANGOS_DLL_DECL instance_ulduar : public ScriptedInstance +{ + public: + instance_ulduar(Map* pMap); + ~instance_ulduar() {} + + void Initialize(); + bool IsEncounterInProgress() const; + + void OnCreatureCreate(Creature* pCreature); + void OnObjectCreate(GameObject* pGo); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + const char* Save() { return strInstData.c_str(); } + void Load(const char* chrIn); + + // Dummy, leave till correct solution for hardmode found + bool CheckConditionCriteriaMeet(Player const* pSource, uint32 uiMapId, uint32 uiInstanceConditionId); + + void DoOpenMadnessDoorIfCan(); + Player* GetPlayerInMap(); + void SpawnFriendlyKeeper(uint32 uiWho); + + protected: + std::string strInstData; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 m_auiHardBoss[HARD_MODE_ENCOUNTER]; + uint32 m_auiUlduarKeepers[KEEPER_ENCOUNTER]; + uint32 m_auiUlduarTeleporters[TELEPORTER_ENCOUNTER]; + + // Creatures + uint64 m_uiLeviathanGUID; + uint64 m_uiIgnisGUID; + uint64 m_uiRazorscaleGUID; + uint64 m_uiCommanderGUID; + uint64 m_uiXT002GUID; + uint64 m_uiBrundirGUID; + uint64 m_uiMolgeimGUID; + uint64 m_uiSteelbreakerGUID; + uint64 m_uiKologarnGUID; + uint64 m_uiAuriayaGUID; + uint64 m_uiMimironGUID; + uint64 m_uiHodirGUID; + uint64 m_uiThorimGUID; + uint64 m_uiFreyaGUID; + uint64 m_uiVezaxGUID; + uint64 m_uiYoggSaronGUID; + uint64 m_uiAlgalonGUID; + uint64 m_uiRightArmGUID; + uint64 m_uiLeftArmGUID; + uint64 m_uiFeralDefenderGUID; + uint64 m_uiElderBrightleafGUID; + uint64 m_uiElderStonebarkGUID; + uint64 m_uiElderIronbrachGUID; + uint64 m_uiSaroniteAnimusGUID; + uint64 m_uiRunicColossusGUID; + uint64 m_uiRuneGiantGUID; + uint64 m_uiJormungarGUID; + uint64 m_uiLeviathanMkGUID; + uint64 m_uiSaraGUID; + uint64 m_uiYoggBrainGUID; + + // Doors & Objects + // The siege + uint64 m_uiShieldWallGUID; + uint64 m_uiLeviathanGateGUID; + uint64 m_uiXT002GateGUID; + uint64 m_uiBrokenHarpoonGUID; + // Archivum + uint64 m_uiIronCouncilDoorGUID; + uint64 m_uiArchivumDoorGUID; + uint64 m_uiArchivumConsoleGUID; + uint64 m_uiUniverseFloorArchivumGUID; + // Celestial planetarium + uint64 m_uiCelestialDoorGUID; + uint64 m_uiCelestialConsoleGUID; + uint64 m_uiUniverseFloorCelestialGUID; + uint64 m_uiAzerothGlobeGUID; + // Kologarn + uint64 m_uiShatteredHallsDoorGUID; + uint64 m_uiKologarnBridgeGUID; + // Hodir + uint64 m_uiHodirEnterDoorGUID; + uint64 m_uiHodirWallGUID; + uint64 m_uiHodirExitDoorGUID; + // Mimiron + uint64 m_uiMimironButtonGUID; + uint64 m_uiMimironDoor1GUID; + uint64 m_uiMimironDoor2GUID; + uint64 m_uiMimironDoor3GUID; + uint64 m_uiMimironElevatorGUID; + uint64 m_auiMimironTelGUID[9]; + // Thorim + uint64 m_uiArenaEnterDoorGUID; + uint64 m_uiArenaExitDoorGUID; + uint64 m_uiHallwayDoorGUID; + uint64 m_uiThorimEnterDoorGUID; + uint64 m_uiThorimLeverGUID; + // Prison + uint64 m_uiAncientGateGUID; + uint64 m_uiVezaxGateGUID; + uint64 m_uiYoggGateGUID; + uint64 m_uiBrainDoor1GUID; + uint64 m_uiBrainDoor2GUID; + uint64 m_uiBrainDoor3GUID; + + // Chests + uint64 m_uiKologarnLootGUID; + uint64 m_uiHodirLootGUID; + uint64 m_uiHodirRareLootGUID; + uint64 m_uiThorimLootGUID; + uint64 m_uiThorimRareLootGUID; + uint64 m_uiMimironLootGUID; + uint64 m_uiMimironHardLootGUID; + uint64 m_uiAlagonLootGUID; +}; + +#endif diff --git a/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar.cpp b/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar.cpp new file mode 100644 index 0000000..882ab94 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar.cpp @@ -0,0 +1,237 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ingvar +SD%Complete: 35% +SDComment: TODO: correct timers. Create ressurection sequenze and phase 2. +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_keep.h" + +enum +{ + SAY_AGGRO_FIRST = -1574005, + SAY_AGGRO_SECOND = -1574006, + SAY_DEATH_FIRST = -1574007, + SAY_DEATH_SECOND = -1574008, + SAY_KILL_FIRST = -1574009, + SAY_KILL_SECOND = -1574010, + EMOTE_ROAR = -1574022, + SAY_ANNHYLDE_REZ = -1574023, + + NPC_ANNHYLDE = 24068, + NPC_THROW_TARGET = 23996, //the target, casting spell and target of moving dummy + NPC_THROW_DUMMY = 23997, //the axe, moving to target + + //phase 1 + SPELL_CLEAVE = 42724, + + SPELL_SMASH = 42669, + SPELL_SMASH_H = 59706, + + SPELL_ENRAGE = 42705, + SPELL_ENRAGE_H = 59707, + + SPELL_STAGGERING_ROAR = 42708, + SPELL_STAGGERING_ROAR_H = 59708, + + //phase 2 + SPELL_DARK_SMASH_H = 42723, + + SPELL_DREADFUL_ROAR = 42729, + SPELL_DREADFUL_ROAR_H = 59734, + + SPELL_WOE_STRIKE = 42730, + SPELL_WOE_STRIKE_H = 59735, + + SPELL_SHADOW_AXE = 42748, + SPELL_SHADOW_AXE_PROC = 42751, + SPELL_SHADOW_AXE_PROC_H = 59720, + + //ressurection sequenze + SPELL_FEIGN_DEATH = 42795, + SPELL_TRANSFORM = 42796, + SPELL_SCOURGE_RES_SUMMON = 42863, //summones a dummy target + SPELL_SCOURGE_RES_HEAL = 42704, //heals max HP + SPELL_SCOURGE_RES_BUBBLE = 42862, //black bubble + SPELL_SCOURGE_RES_CHANNEL = 42857 //the whirl from annhylde +}; + +/*###### +## boss_ingvar +######*/ + +struct MANGOS_DLL_DECL boss_ingvarAI : public ScriptedAI +{ + boss_ingvarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bIsResurrected; + + uint32 m_uiCleaveTimer; + uint32 m_uiSmashTimer; + uint32 m_uiStaggeringRoarTimer; + uint32 m_uiEnrageTimer; + + void Reset() + { + m_bIsResurrected = false; + + m_uiCleaveTimer = urand(5000, 7000); + m_uiSmashTimer = urand(8000, 15000); + m_uiStaggeringRoarTimer = urand(10000, 25000); + m_uiEnrageTimer = 30000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(m_bIsResurrected ? SAY_AGGRO_SECOND : SAY_AGGRO_FIRST, m_creature); + } + + //this need to be done when spell works + /*void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_bIsResurrected) + return; + + if (uiDamage >= m_creature->GetHealth()) + { + uiDamage = m_creature->GetHealth() -1; + + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + DoScriptText(SAY_DEATH_FIRST, m_creature); + + m_creature->CastSpell(m_creature, SPELL_FEIGN_DEATH, true); + } + }*/ + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH_SECOND, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 1)) + DoScriptText(m_bIsResurrected ? SAY_KILL_SECOND : SAY_KILL_FIRST, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsResurrected) + { + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = urand(2500, 7000); + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiSmashTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SMASH : SPELL_SMASH_H); + m_uiSmashTimer = urand(8000, 15000); + } + else + m_uiSmashTimer -= uiDiff; + + if (m_uiStaggeringRoarTimer < uiDiff) + { + DoScriptText(EMOTE_ROAR, m_creature); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR_H); + m_uiStaggeringRoarTimer = urand(15000, 30000); + } + else + m_uiStaggeringRoarTimer -= uiDiff; + + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ENRAGE : SPELL_ENRAGE_H); + m_uiEnrageTimer = urand(10000, 20000); + } + else + m_uiEnrageTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ingvar(Creature* pCreature) +{ + return new boss_ingvarAI(pCreature); +} + +/*###### +## npc_annhylde +######*/ + +struct MANGOS_DLL_DECL npc_annhyldeAI : public ScriptedAI +{ + npc_annhyldeAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void UpdateAI(const uint32 uiDiff) + { + } +}; + +CreatureAI* GetAI_npc_annhylde(Creature* pCreature) +{ + return new npc_annhyldeAI(pCreature); +} + +void AddSC_boss_ingvar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ingvar"; + newscript->GetAI = &GetAI_boss_ingvar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_annhylde"; + newscript->GetAI = &GetAI_npc_annhylde; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp new file mode 100644 index 0000000..24cf8d9 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp @@ -0,0 +1,336 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Keleseth +SD%Complete: 60% +SDComment: +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_keep.h" + +enum +{ + SAY_AGGRO = -1574000, + SAY_FROSTTOMB = -1574001, + SAY_SKELETONS = -1574002, + SAY_KILL = -1574003, + SAY_DEATH = -1574004, + EMOTE_FROST_TOMB = -1574021, + + // Boss Spells + SPELL_SHADOWBOLT = 43667, + SPELL_SHADOWBOLT_H = 59389, + + SPELL_SUMMON_FROST_TOMB = 42714, + SPELL_FROST_TOMB = 48400, // stun and deal damage + + // Skeleton Spells + SPELL_DECREPIFY = 42702, + SPELL_DECREPIFY_H = 59397, + SPELL_BONE_ARMOR = 59386, // casted on boss, heroic only + + NPC_FROST_TOMB = 23965, + NPC_VRYKUL_SKELETON = 23970 +}; + +const float RUN_DISTANCE = 20.0; + +static float fAddPosition[4] = {163.5727f, 252.1900f, 42.8684f, 5.57052f}; + +/*###### +## mob_vrykul_skeleton +######*/ + +struct MANGOS_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI +{ + mob_vrykul_skeletonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = m_creature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + Creature* m_pKeleseth; + uint32 m_uiCastTimer; + uint32 m_uiReviveTimer; + + void Reset() + { + m_uiReviveTimer = 0; + m_uiCastTimer = urand(5000, 10000); // taken out of thin air + + if (!m_pInstance) + return; + + m_pKeleseth = m_pInstance->instance->GetCreature(m_pInstance->GetData64(NPC_KELESETH)); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pWho || m_uiReviveTimer) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || m_uiReviveTimer) + return; + + ScriptedAI::AttackStart(pWho); + } + + void Revive() + { + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + m_creature->GetMotionMaster()->MoveChase(pTarget); + + DoResetThreat(); + m_uiReviveTimer = 0; + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (!m_pKeleseth || !m_pKeleseth->isAlive()) + { + uiDamage = m_creature->GetHealth(); + return; + } + + if (m_uiReviveTimer) + { + uiDamage = 0; + return; + } + + if (m_creature->GetHealth() < uiDamage) + { + // start faking death + uiDamage = 0; + m_uiReviveTimer = 6000; + m_creature->SetHealth(0); + m_creature->RemoveAllAuras(); + m_creature->GetMotionMaster()->Clear(); + m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + return; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiReviveTimer) + { + if (m_uiReviveTimer <= uiDiff) + Revive(); + else + m_uiReviveTimer -= uiDiff; + + return; + } + + if (m_uiCastTimer < uiDiff) + { + if (m_bIsRegularMode) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DECREPIFY); + else + { + if (urand(0, 3)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DECREPIFY_H); + else if (m_pKeleseth && m_pKeleseth->isAlive()) + DoCastSpellIfCan(m_pKeleseth, SPELL_BONE_ARMOR); + } + + m_uiCastTimer = urand(5000, 15000); + } + else + m_uiCastTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_vrykul_skeleton(Creature* pCreature) +{ + return new mob_vrykul_skeletonAI(pCreature); +} + +/*###### +## boss_keleseth +######*/ + +struct MANGOS_DLL_DECL boss_kelesethAI : public ScriptedAI +{ + boss_kelesethAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiFrostTombTimer; + uint32 m_uiSummonTimer; + uint32 m_uiShadowboltTimer; + + void Reset() + { + // timers need confirmation + m_uiFrostTombTimer = 20000; + m_uiSummonTimer = 5000 ; + m_uiShadowboltTimer = 0; + + DespawnAdds(); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, RUN_DISTANCE); + } + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void SummonAdds() + { + for (uint8 i=0; i<4; ++i) + m_creature->SummonCreature(NPC_VRYKUL_SKELETON, fAddPosition[0]+rand()%7, fAddPosition[1]+rand()%7, fAddPosition[2], fAddPosition[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, MINUTE*IN_MILLISECONDS); + } + + void DespawnAdds() + { + std::list lAddsList; + GetCreatureListWithEntryInGrid(lAddsList, m_creature, NPC_VRYKUL_SKELETON, 100.0f); + + if (!lAddsList.empty()) + for(std::list::iterator itr = lAddsList.begin(); itr != lAddsList.end(); ++itr) + (*itr)->ForcedDespawn(); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_VRYKUL_SKELETON) + pSummoned->AI()->AttackStart(m_creature->getVictim()); + + if (pSummoned->GetEntry() == NPC_FROST_TOMB) + pSummoned->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_FROST, true); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiSummonTimer) + { + if (m_uiSummonTimer <= uiDiff) + { + SummonAdds(); + m_uiSummonTimer = 0; + } + else + m_uiSummonTimer -= uiDiff; + } + + if (m_uiShadowboltTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOWBOLT : SPELL_SHADOWBOLT_H); + m_uiShadowboltTimer = 3000; + } + else + m_uiShadowboltTimer -= uiDiff; + + if (m_uiFrostTombTimer < uiDiff) + { + if (Unit* pTombTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + //DoCastSpellIfCan(pTombTarget, SPELL_SUMMON_FROST_TOMB); + float fPosX, fPosY, fPosZ; + pTombTarget->GetPosition(fPosX, fPosY, fPosZ); + + if (Creature* pFrostTomb = m_creature->SummonCreature(NPC_FROST_TOMB, fPosX, fPosY, fPosZ, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + pFrostTomb->AddThreat(pTombTarget); + pFrostTomb->CastSpell(pTombTarget, SPELL_FROST_TOMB, false); + } + + DoScriptText(SAY_FROSTTOMB, m_creature); + DoScriptText(EMOTE_FROST_TOMB, m_creature, pTombTarget); + } + + m_uiFrostTombTimer = 25000; + } + else + m_uiFrostTombTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_keleseth(Creature* pCreature) +{ + return new boss_kelesethAI(pCreature); +} + +void AddSC_boss_keleseth() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_keleseth"; + newscript->GetAI = &GetAI_boss_keleseth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_vrykul_skeleton"; + newscript->GetAI = &GetAI_mob_vrykul_skeleton; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_and_dalronn.cpp b/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_and_dalronn.cpp new file mode 100644 index 0000000..77ea23c --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_and_dalronn.cpp @@ -0,0 +1,335 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skarvald_and_Dalronn +SD%Complete: 60% +SDComment: TODO: correct timers +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_keep.h" + +enum +{ + SAY_SKA_AGGRO = -1574011, + SAY_SKA_DEATH = -1574012, + SAY_SKA_DEATH_REAL = -1574013, + SAY_SKA_KILL = -1574014, + SAY_SKA_DAL_DIES_REPLY = -1574015, + + SAY_DAL_AGGRO_REPLY = -1574016, + SAY_DAL_DEATH = -1574017, + SAY_DAL_DEATH_REAL = -1574018, + SAY_DAL_KILL = -1574019, + SAY_DAL_SKA_DIES_REPLY = -1574020, + + SPELL_SUMMON_DAL_GHOST = 48612, + SPELL_SUMMON_SKA_GHOST = 48613, + + NPC_DAL_GHOST = 27389, + NPC_SKA_GHOST = 27390, + + NPC_SKELETAL = 28878, //summoned guardian in heroic + + //skarvald + SPELL_CHARGE = 43651, + SPELL_STONE_STRIKE = 48583, + SPELL_ENRAGE = 48193, + + //dalronn + SPELL_SHADOW_BOLT = 43649, + SPELL_SHADOW_BOLT_H = 59575, + + SPELL_DEBILITATE = 43650, + SPELL_DEBILITATE_H = 59577, + + SPELL_SUMMON_SKELETONS = 52611 +}; + +struct Yell +{ + int32 m_iTextId; + int32 m_iTextReplyId; +}; + +Yell m_aYell[] = +{ + {SAY_SKA_AGGRO, SAY_DAL_AGGRO_REPLY}, + {SAY_SKA_DEATH, SAY_DAL_SKA_DIES_REPLY}, + {SAY_DAL_DEATH, SAY_SKA_DAL_DIES_REPLY} +}; + +struct MANGOS_DLL_DECL boss_s_and_d_dummyAI : public ScriptedAI +{ + boss_s_and_d_dummyAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_uiGhostGUID = 0; + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + uint64 m_uiGhostGUID; + + Creature* GetBuddy() + { + if (!m_pInstance) + return NULL; + + return m_pInstance->instance->GetCreature(m_pInstance->GetData64(m_creature->GetEntry() == NPC_DALRONN ? NPC_SKARVALD : NPC_DALRONN)); + } + + void Reset() { } + + void JustReachedHome() + { + if (Creature* pBuddy = GetBuddy()) + { + if (pBuddy->isDead()) + pBuddy->Respawn(); + } + + if (Creature* pGhost = m_creature->GetMap()->GetCreature(m_uiGhostGUID)) + { + if (pGhost->isAlive()) + pGhost->ForcedDespawn(); + } + } + + void EnterCombat(Unit* pWho) + { + if (!pWho) + return; + + if (Creature* pBuddy = GetBuddy()) + { + if (!pBuddy->getVictim()) + pBuddy->AI()->AttackStart(pWho); + } + + Aggro(pWho); + } + + void JustSummoned(Creature* pSummoned) + { + // EventAI can probably handle ghosts + if (pSummoned->GetEntry() == NPC_DAL_GHOST || pSummoned->GetEntry() == NPC_SKA_GHOST) + m_uiGhostGUID = pSummoned->GetGUID(); + + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO,1); + + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); + } + + void JustDied(Unit* pKiller) + { + if (Creature* pBuddy = GetBuddy()) + { + if (pBuddy->isAlive()) + { + DoScriptText(m_creature->GetEntry() == NPC_SKARVALD ? m_aYell[1].m_iTextId : m_aYell[2].m_iTextId, m_creature); + DoScriptText(m_creature->GetEntry() == NPC_SKARVALD ? m_aYell[1].m_iTextReplyId : m_aYell[2].m_iTextReplyId, pBuddy); + + pBuddy->CastSpell(m_creature, m_creature->GetEntry() == NPC_SKARVALD ? SPELL_SUMMON_SKA_GHOST : SPELL_SUMMON_DAL_GHOST, true); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + else + { + if (Creature* pGhost = m_creature->GetMap()->GetCreature(m_uiGhostGUID)) + pGhost->ForcedDespawn(); + + pBuddy->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + } +}; + +/*###### +## boss_skarvald +######*/ + +struct MANGOS_DLL_DECL boss_skarvaldAI : public boss_s_and_d_dummyAI +{ + boss_skarvaldAI(Creature* pCreature) : boss_s_and_d_dummyAI(pCreature) { Reset(); } + + uint32 m_uiYellDelayTimer; + uint32 m_uiChargeTimer; + uint32 m_uiEnrageTimer; + uint32 m_uiStoneStrikeTimer; + + void Reset() + { + m_uiYellDelayTimer = 0; + m_uiChargeTimer = urand(2000, 6000); + m_uiEnrageTimer = 15000; + m_uiStoneStrikeTimer = 8000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(m_aYell[0].m_iTextId, m_creature); + m_uiYellDelayTimer = 5000; + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_SKA_KILL, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiYellDelayTimer) + { + if (m_uiYellDelayTimer <= uiDiff) + { + if (Creature* pBuddy = GetBuddy()) + DoScriptText(m_aYell[0].m_iTextReplyId, pBuddy); + + m_uiYellDelayTimer = 0; + } + else + m_uiYellDelayTimer -= uiDiff; + } + + if (m_uiChargeTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(pTarget, SPELL_CHARGE); + + m_uiChargeTimer = urand(8000, 16000); + } + else + m_uiChargeTimer -= uiDiff; + + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + m_uiEnrageTimer = 20000; + } + else + m_uiEnrageTimer -= uiDiff; + + if (m_uiStoneStrikeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_STONE_STRIKE); + m_uiStoneStrikeTimer = urand(5000, 15000); + } + else + m_uiStoneStrikeTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_skarvald(Creature* pCreature) +{ + return new boss_skarvaldAI(pCreature); +} + +/*###### +## boss_dalronn +######*/ + +struct MANGOS_DLL_DECL boss_dalronnAI : public boss_s_and_d_dummyAI +{ + boss_dalronnAI(Creature* pCreature) : boss_s_and_d_dummyAI(pCreature) { Reset(); } + + uint32 m_uiDebilitateTimer; + uint32 m_uiShadowBoltTimer; + uint32 m_uiSkeletonTimer; + + void Reset() + { + m_uiDebilitateTimer = urand(5000, 10000); + m_uiShadowBoltTimer = urand(2500, 6000); + m_uiSkeletonTimer = urand(25000, 35000); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_DAL_KILL, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiDebilitateTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_DEBILITATE : SPELL_DEBILITATE_H); + + m_uiDebilitateTimer = urand(12000, 20000); + } + else + m_uiDebilitateTimer -= uiDiff; + + if (m_uiShadowBoltTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, m_bIsRegularMode ? SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT_H); + + m_uiShadowBoltTimer = urand(3000, 6000); + } + else + m_uiShadowBoltTimer -= uiDiff; + + if (!m_bIsRegularMode) + { + if (m_uiSkeletonTimer < uiDiff) + { + if (!m_creature->FindGuardianWithEntry(NPC_SKELETAL)) + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SKELETONS); + + m_uiSkeletonTimer = 30000; + } + else + m_uiSkeletonTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dalronn(Creature* pCreature) +{ + return new boss_dalronnAI(pCreature); +} + +void AddSC_boss_skarvald_and_dalronn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_skarvald"; + newscript->GetAI = &GetAI_boss_skarvald; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_dalronn"; + newscript->GetAI = &GetAI_boss_dalronn; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp new file mode 100644 index 0000000..ced7659 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp @@ -0,0 +1,203 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Utgarde_Keep +SD%Complete: 20% +SDComment: +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_keep.h" + +struct MANGOS_DLL_DECL instance_utgarde_keep : public ScriptedInstance +{ + instance_utgarde_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiKelesethGUID; + uint64 m_uiSkarvaldGUID; + uint64 m_uiDalronnGUID; + + uint64 m_uiBellow1GUID; + uint64 m_uiBellow2GUID; + uint64 m_uiBellow3GUID; + uint64 m_uiForgeFire1GUID; + uint64 m_uiForgeFire2GUID; + uint64 m_uiForgeFire3GUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiKelesethGUID = 0; + m_uiSkarvaldGUID = 0; + m_uiDalronnGUID = 0; + + m_uiBellow1GUID = 0; + m_uiBellow2GUID = 0; + m_uiBellow3GUID = 0; + m_uiForgeFire1GUID = 0; + m_uiForgeFire2GUID = 0; + m_uiForgeFire3GUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_KELESETH: m_uiKelesethGUID = pCreature->GetGUID(); break; + case NPC_SKARVALD: m_uiSkarvaldGUID = pCreature->GetGUID(); break; + case NPC_DALRONN: m_uiDalronnGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_BELLOW_1: + m_uiBellow1GUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_BELLOW_2: + m_uiBellow2GUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_BELLOW_3: + m_uiBellow3GUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_FORGEFIRE_1: + m_uiForgeFire1GUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_FORGEFIRE_2: + m_uiForgeFire2GUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_FORGEFIRE_3: + m_uiForgeFire3GUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case GO_BELLOW_1: + m_auiEncounter[0] = uiData; + break; + case GO_BELLOW_2: + m_auiEncounter[1] = uiData; + break; + case GO_BELLOW_3: + m_auiEncounter[2] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strInstData.c_str(); + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case NPC_KELESETH: + return m_uiKelesethGUID; + case NPC_SKARVALD: + return m_uiSkarvaldGUID; + case NPC_DALRONN: + return m_uiDalronnGUID; + case GO_BELLOW_1: + return m_uiBellow1GUID; + case GO_BELLOW_2: + return m_uiBellow2GUID; + case GO_BELLOW_3: + return m_uiBellow3GUID; + case GO_FORGEFIRE_1: + return m_uiForgeFire1GUID; + case GO_FORGEFIRE_2: + return m_uiForgeFire2GUID; + case GO_FORGEFIRE_3: + return m_uiForgeFire3GUID; + } + return 0; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_utgarde_keep(Map* pMap) +{ + return new instance_utgarde_keep(pMap); +} + +void AddSC_instance_utgarde_keep() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_utgarde_keep"; + newscript->GetInstanceData = GetInstanceData_instance_utgarde_keep; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp new file mode 100644 index 0000000..9d17110 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Utgarde_Keep +SD%Complete: 75 +SDComment: +SDCategory: Utgarde Keep +EndScriptData */ + +/* ContentData +mob_dragonflayer_forge_master +EndContentData */ + +#include "precompiled.h" +#include "utgarde_keep.h" + +/*###### +## mob_dragonflayer_forge_master +######*/ + +enum +{ + SPELL_BURNING_BRAND = 43757, + SPELL_BURNING_BRAND_H = 59601, + SPELL_CAUTERIZE = 60211, + + MAX_FORGE = 3 +}; + +struct MANGOS_DLL_DECL mob_dragonflayer_forge_masterAI : public ScriptedAI +{ + mob_dragonflayer_forge_masterAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_uiForgeEncounterId = 0; + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiForgeEncounterId; + uint32 m_uiBurningBrandTimer; + + void Reset() + { + m_uiBurningBrandTimer = 2000; + } + + void SetMyForge() + { + std::list lGOList; + uint32 uiGOBellow = 0; + uint32 uiGOFire = 0; + + for(uint8 i = 0; i < MAX_FORGE; ++i) + { + switch(i) + { + case 0: uiGOBellow = GO_BELLOW_1; break; + case 1: uiGOBellow = GO_BELLOW_2; break; + case 2: uiGOBellow = GO_BELLOW_3; break; + } + + if (GameObject* pGOTemp = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(uiGOBellow))) + lGOList.push_back(pGOTemp); + } + + if (!lGOList.empty()) + { + if (lGOList.size() != MAX_FORGE) + error_log("SD2: mob_dragonflayer_forge_master expected %u in lGOList, but does not match.", MAX_FORGE); + + lGOList.sort(ObjectDistanceOrder(m_creature)); + + if (lGOList.front()->getLootState() == GO_READY) + lGOList.front()->UseDoorOrButton(DAY); + else if (lGOList.front()->getLootState() == GO_ACTIVATED) + lGOList.front()->ResetDoorOrButton(); + + switch(lGOList.front()->GetEntry()) + { + case GO_BELLOW_1: uiGOFire = GO_FORGEFIRE_1; break; + case GO_BELLOW_2: uiGOFire = GO_FORGEFIRE_2; break; + case GO_BELLOW_3: uiGOFire = GO_FORGEFIRE_3; break; + } + + if (GameObject* pGOTemp = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(uiGOFire))) + { + if (pGOTemp->getLootState() == GO_READY) + pGOTemp->UseDoorOrButton(DAY); + else if (pGOTemp->getLootState() == GO_ACTIVATED) + pGOTemp->ResetDoorOrButton(); + } + + m_uiForgeEncounterId = lGOList.front()->GetEntry(); + } + } + + void Aggro(Unit* pWho) + { + SetMyForge(); + } + + void JustReachedHome() + { + SetMyForge(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(m_uiForgeEncounterId, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBurningBrandTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_BURNING_BRAND : SPELL_BURNING_BRAND_H); + m_uiBurningBrandTimer = 15000; + } + else m_uiBurningBrandTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_dragonflayer_forge_master(Creature* pCreature) +{ + return new mob_dragonflayer_forge_masterAI(pCreature); +} + +void AddSC_utgarde_keep() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_dragonflayer_forge_master"; + newscript->GetAI = &GetAI_mob_dragonflayer_forge_master; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.h b/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.h new file mode 100644 index 0000000..90b77b1 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.h @@ -0,0 +1,25 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_UTG_KEEP_H +#define DEF_UTG_KEEP_H + +enum +{ + MAX_ENCOUNTER = 3, + + //also using these as identifier for Set/GetData(), unlike normal naming + NPC_KELESETH = 23953, + NPC_SKARVALD = 24200, + NPC_DALRONN = 24201, + + GO_BELLOW_1 = 186688, + GO_BELLOW_2 = 186689, + GO_BELLOW_3 = 186690, + GO_FORGEFIRE_1 = 186692, + GO_FORGEFIRE_2 = 186693, + GO_FORGEFIRE_3 = 186691 +}; + +#endif diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_gortok.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_gortok.cpp new file mode 100644 index 0000000..f5426d9 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_gortok.cpp @@ -0,0 +1,105 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gortok +SD%Complete: 20% +SDComment: +SDCategory: Utgarde Pinnacle +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_pinnacle.h" + +enum +{ + SAY_AGGRO = -1575015, + SAY_SLAY_1 = -1575016, + SAY_SLAY_2 = -1575017, + SAY_DEATH = -1575018, + + SPELL_FREEZE_ANIM = 16245, + + SPELL_IMPALE = 48261, + SPELL_IMPALE_H = 59268, + + SPELL_WITHERING_ROAR = 48256, + SPELL_WITHERING_ROAR_H = 59267, + + SPELL_ARCING_SMASH = 48260 +}; + +/*###### +## boss_gortok +######*/ + +struct MANGOS_DLL_DECL boss_gortokAI : public ScriptedAI +{ + boss_gortokAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_GORTOK, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gortok(Creature* pCreature) +{ + return new boss_gortokAI(pCreature); +} + +void AddSC_boss_gortok() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_gortok"; + newscript->GetAI = &GetAI_boss_gortok; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp new file mode 100644 index 0000000..175bc12 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skadi +SD%Complete: 20% +SDComment: starts at trigger 4991 +SDCategory: Utgarde Pinnacle +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_pinnacle.h" + +enum +{ + SAY_AGGRO = -1575019, + SAY_DRAKEBREATH_1 = -1575020, + SAY_DRAKEBREATH_2 = -1575021, + SAY_DRAKEBREATH_3 = -1575022, + SAY_DRAKE_HARPOON_1 = -1575023, + SAY_DRAKE_HARPOON_2 = -1575024, + SAY_KILL_1 = -1575025, + SAY_KILL_2 = -1575026, + SAY_KILL_3 = -1575027, + SAY_DEATH = -1575028, + SAY_DRAKE_DEATH = -1575029, + EMOTE_HARPOON_RANGE = -1575030, + + SPELL_CRUSH = 50234, + SPELL_CRUSH_H = 59330, + + SPELL_WHIRLWIND = 50228, + SPELL_WHIRLWIND_H = 59322, + + SPELL_POISONED_SPEAR = 50255, + SPELL_POISONED_SPEAR_H = 59331, + + // casted with base of creature 22515 (World Trigger), so we must make sure + // to use the close one by the door leading further in to instance. + SPELL_SUMMON_GAUNTLET_MOBS = 48630, // tick every 30 sec + SPELL_SUMMON_GAUNTLET_MOBS_H = 59275, // tick every 25 sec + + SPELL_GAUNTLET_PERIODIC = 47546, // what is this? Unknown use/effect, but probably related + + SPELL_LAUNCH_HARPOON = 48642, // this spell hit drake to reduce HP (force triggered from 48641) +}; + +/*###### +## boss_skadi +######*/ + +struct MANGOS_DLL_DECL boss_skadiAI : public ScriptedAI +{ + boss_skadiAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SKADI, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SKADI, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_skadi(Creature* pCreature) +{ + return new boss_skadiAI(pCreature); +} + +bool AreaTrigger_at_skadi(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData()) + { + if (pInstance->GetData(TYPE_SKADI) == NOT_STARTED) + pInstance->SetData(TYPE_SKADI, SPECIAL); + } + + return false; +} + +void AddSC_boss_skadi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_skadi"; + newscript->GetAI = &GetAI_boss_skadi; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_skadi"; + newscript->pAreaTrigger = &AreaTrigger_at_skadi; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp new file mode 100644 index 0000000..e1f7124 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp @@ -0,0 +1,275 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Svala +SD%Complete: 30% +SDComment: TODO: abilities. The way spells for intro works could use more research. +SDCategory: Utgarde Pinnacle +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_pinnacle.h" + +enum +{ + SAY_INTRO_1 = -1575000, + SAY_INTRO_2_ARTHAS = -1575001, + SAY_INTRO_3 = -1575002, + SAY_INTRO_4_ARTHAS = -1575003, + SAY_INTRO_5 = -1575004, + + SAY_AGGRO = -1575005, + SAY_SLAY_1 = -1575006, + SAY_SLAY_2 = -1575007, + SAY_SLAY_3 = -1575008, + SAY_SACRIFICE_1 = -1575009, + SAY_SACRIFICE_2 = -1575010, + SAY_SACRIFICE_3 = -1575011, + SAY_SACRIFICE_4 = -1575012, + SAY_SACRIFICE_5 = -1575013, + SAY_DEATH = -1575014, + + NPC_SVALA_SORROW = 26668, + NPC_ARTHAS_IMAGE = 29280, + + SPELL_ARTHAS_VISUAL = 54134, + + // don't know how these should work in relation to each other + SPELL_TRANSFORMING = 54205, + SPELL_TRANSFORMING_FLOATING = 54140, + SPELL_TRANSFORMING_CHANNEL = 54142, + + SPELL_RITUAL_OF_SWORD = 48276, + SPELL_CALL_FLAMES = 48258, + SPELL_SINISTER_STRIKE = 15667, + SPELL_SINISTER_STRIKE_H = 59409 +}; + +/*###### +## boss_svala +######*/ + +struct MANGOS_DLL_DECL boss_svalaAI : public ScriptedAI +{ + boss_svalaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + m_bIsIntroDone = false; + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + Creature* pArthas; + + bool m_bIsIntroDone; + uint32 m_uiIntroTimer; + uint32 m_uiIntroCount; + + void Reset() + { + pArthas = NULL; + + m_uiIntroTimer = 2500; + m_uiIntroCount = 0; + + if (m_creature->isAlive() && m_pInstance && m_pInstance->GetData(TYPE_SVALA) > IN_PROGRESS) + { + if (m_creature->GetEntry() != NPC_SVALA_SORROW) + m_creature->UpdateEntry(NPC_SVALA_SORROW); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_bIsIntroDone = true; + } + } + + void JustReachedHome() + { + DoMoveToPosition(); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bIsIntroDone) + { + if (m_pInstance && m_pInstance->GetData(TYPE_SVALA) == IN_PROGRESS) + { + m_pInstance->SetData(TYPE_SVALA, SPECIAL); + + float fX, fY, fZ; + m_creature->GetClosePoint(fX, fY, fZ, m_creature->GetObjectBoundingRadius(), 16.0f, 0.0f); + + // we assume m_creature is spawned in proper location + m_creature->SummonCreature(NPC_ARTHAS_IMAGE, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 60000); + } + + return; + } + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void Aggro(Unit* pWho) + { + if (m_creature->HasSplineFlag(SPLINEFLAG_FLYING)) + m_creature->RemoveSplineFlag(SPLINEFLAG_FLYING); + + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_ARTHAS_IMAGE) + { + pSummoned->CastSpell(pSummoned, SPELL_ARTHAS_VISUAL, true); + pArthas = pSummoned; + pSummoned->SetFacingToObject(m_creature); + } + } + + void SummonedCreatureDespawn(Creature* pDespawned) + { + if (pDespawned->GetEntry() == NPC_ARTHAS_IMAGE) + pArthas = NULL; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_TRANSFORMING) + { + if (pArthas) + pArthas->InterruptNonMeleeSpells(true); + + m_creature->UpdateEntry(NPC_SVALA_SORROW); + } + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SVALA, DONE); + } + + void DoMoveToPosition() + { + float fX, fZ, fY; + m_creature->GetRespawnCoord(fX, fY, fZ); + + m_creature->AddSplineFlag(SPLINEFLAG_FLYING); + + m_creature->SendMonsterMoveWithSpeed(fX, fY, fZ + 5.0f, m_uiIntroTimer); + m_creature->GetMap()->CreatureRelocation(m_creature, fX, fY, fZ + 5.0f, m_creature->GetOrientation()); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (m_bIsIntroDone) + return; + + if (pArthas && pArthas->isAlive()) + { + if (m_uiIntroTimer < uiDiff) + { + m_uiIntroTimer = 10000; + + switch(m_uiIntroCount) + { + case 0: + DoScriptText(SAY_INTRO_1, m_creature); + break; + case 1: + DoScriptText(SAY_INTRO_2_ARTHAS, pArthas); + break; + case 2: + pArthas->CastSpell(m_creature, SPELL_TRANSFORMING_CHANNEL, false); + m_creature->CastSpell(m_creature, SPELL_TRANSFORMING_FLOATING, false); + DoMoveToPosition(); + break; + case 3: + m_creature->CastSpell(m_creature, SPELL_TRANSFORMING, false); + DoScriptText(SAY_INTRO_3, m_creature); + break; + case 4: + DoScriptText(SAY_INTRO_4_ARTHAS, pArthas); + break; + case 5: + DoScriptText(SAY_INTRO_5, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_bIsIntroDone = true; + break; + } + + ++m_uiIntroCount; + } + else + m_uiIntroTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_svala(Creature* pCreature) +{ + return new boss_svalaAI(pCreature); +} + +bool AreaTrigger_at_svala_intro(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData()) + { + if (pInstance->GetData(TYPE_SVALA) == NOT_STARTED) + pInstance->SetData(TYPE_SVALA, IN_PROGRESS); + } + + return false; +} + +void AddSC_boss_svala() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_svala"; + newscript->GetAI = &GetAI_boss_svala; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_svala_intro"; + newscript->pAreaTrigger = &AreaTrigger_at_svala_intro; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp new file mode 100644 index 0000000..e5a9a07 --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp @@ -0,0 +1,103 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ymiron +SD%Complete: 20% +SDComment: +SDCategory: Utgarde Pinnacle +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1575031, + SAY_SUMMON_BJORN = -1575032, + SAY_SUMMON_HALDOR = -1575033, + SAY_SUMMON_RANULF = -1575034, + SAY_SUMMON_TORGYN = -1575035, + SAY_SLAY_1 = -1575036, + SAY_SLAY_2 = -1575037, + SAY_SLAY_3 = -1575038, + SAY_SLAY_4 = -1575039, + SAY_DEATH = -1575040 +}; + +/*###### +## boss_ymiron +######*/ + +struct MANGOS_DLL_DECL boss_ymironAI : public ScriptedAI +{ + boss_ymironAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() + { + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + case 3: DoScriptText(SAY_SLAY_4, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ymiron(Creature* pCreature) +{ + return new boss_ymironAI(pCreature); +} + +void AddSC_boss_ymiron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ymiron"; + newscript->GetAI = &GetAI_boss_ymiron; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp b/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp new file mode 100644 index 0000000..84855cb --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_utgarde_pinnacle.cpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: instance_pinnacle +SD%Complete: 25% +SDComment: +SDCategory: Utgarde Pinnacle +EndScriptData */ + +#include "precompiled.h" +#include "utgarde_pinnacle.h" + +struct MANGOS_DLL_DECL instance_pinnacle : public ScriptedInstance +{ + instance_pinnacle(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiSkadiDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiSkadiDoorGUID = 0; + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_DOOR_SKADI: + m_uiSkadiDoorGUID = pGo->GetGUID(); + + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Pinnacle: SetData received for type %u with data %u", uiType, uiData); + + switch(uiType) + { + case TYPE_SVALA: + m_auiEncounter[0] = uiData; + break; + case TYPE_GORTOK: + m_auiEncounter[1] = uiData; + break; + case TYPE_SKADI: + if (uiData == DONE) + DoUseDoorOrButton(m_uiSkadiDoorGUID); + + m_auiEncounter[2] = uiData; + break; + case TYPE_YMIRON: + m_auiEncounter[3] = uiData; + break; + default: + error_log("SD2: Instance Pinnacle: SetData = %u for type %u does not exist/not implemented.", uiType, uiData); + break; + } + + //saving also SPECIAL for this instance + if (uiData == DONE || uiData == SPECIAL) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_SVALA: + return m_auiEncounter[0]; + case TYPE_GORTOK: + return m_auiEncounter[1]; + case TYPE_SKADI: + return m_auiEncounter[2]; + case TYPE_YMIRON: + return m_auiEncounter[3]; + } + + return 0; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_pinnacle(Map* pMap) +{ + return new instance_pinnacle(pMap); +} + +void AddSC_instance_pinnacle() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "instance_pinnacle"; + newscript->GetInstanceData = &GetInstanceData_instance_pinnacle; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h b/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h new file mode 100644 index 0000000..6876adf --- /dev/null +++ b/scripts/northrend/utgarde_keep/utgarde_pinnacle/utgarde_pinnacle.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_NEXUS_H +#define DEF_NEXUS_H + +enum +{ + MAX_ENCOUNTER = 4, + + TYPE_SVALA = 0, + TYPE_GORTOK = 1, + TYPE_SKADI = 2, + TYPE_YMIRON = 3, + + GO_STASIS_GENERATOR = 188593, + GO_DOOR_SKADI = 192173, + + NPC_FURBOLG = 26684, + NPC_WORGEN = 26683, + NPC_JORMUNGAR = 26685, + NPC_RHINO = 26686 +}; + +#endif diff --git a/scripts/northrend/violet_hold/instance_violet_hold.cpp b/scripts/northrend/violet_hold/instance_violet_hold.cpp new file mode 100644 index 0000000..19fe60d --- /dev/null +++ b/scripts/northrend/violet_hold/instance_violet_hold.cpp @@ -0,0 +1,533 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Violet_Hold +SD%Complete: 50 +SDComment: "experimental" use of header/source object +SDCategory: Violet Hold +EndScriptData */ + +#include "precompiled.h" +#include "violet_hold.h" + +/* The Violet Hold encounters: +1 Main Event +2 Erekem +3 Moragg +4 Ichoron +5 Xevozz +6 Lavanthor +7 Zuramat +8 Cyanigosa +*/ + +instance_violet_hold::instance_violet_hold(Map* pMap) : ScriptedInstance(pMap), + m_uiSinclariGUID(0), + m_uiSinclariAltGUID(0), + m_uiErekemGUID(0), + m_uiMoraggGUID(0), + m_uiIchoronGUID(0), + m_uiXevozzGUID(0), + m_uiLavanthorGUID(0), + m_uiZuramatGUID(0), + + m_uiSealDoorGUID(0), + m_uiErekemDoorGUID(0), + m_uiErekemDoorLeftGUID(0), + m_uiErekemDoorRightGUID(0), + m_uiMoraggDoorGUID(0), + m_uiIchoronDoorGUID(0), + m_uiXevozzDoorGUID(0), + m_uiLavanthorDoorGUID(0), + m_uiZuramatDoorGUID(0), + + m_uiCellErekemGuard_LGUID(0), + m_uiCellErekemGuard_RGUID(0), + m_uiIntroCrystalGUID(0), + + m_uiWorldState(0), + m_uiWorldStateSealCount(100), + m_uiWorldStatePortalCount(0), + + m_uiPortalId(0), + m_uiPortalTimer(0), + m_uiMaxCountPortalLoc(0), + m_uiSealDmgSay(0), + m_uiChosenBoss(0) +{ + Initialize(); +} + +GameObject* pSealDoor; +std::string m_strInstData; + +void instance_violet_hold::Initialize() +{ + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + m_uiMaxCountPortalLoc = (sizeof(afPortalLocation)/sizeof(sPortalData)) - 1; +} +void instance_violet_hold::OnPlayerEnter(Player* pPlayer) +{ + if(m_auiEncounter[0] != NOT_STARTED) + pPlayer->SendUpdateWorldState(WORLD_STATE_ID,1); +} +void instance_violet_hold::ResetVariables() +{ + m_uiWorldStateSealCount = 100; + m_uiWorldStatePortalCount = 0; + m_uiSealDmgSay = 0; + m_uiChosenBoss = 0; +} + +void instance_violet_hold::ResetAll() +{ + ResetVariables(); + UpdateWorldState(false); + CallGuards(true); + SetIntroPortals(false); +} + +void instance_violet_hold::OnCreatureCreate(Creature* pCreature) +{ + switch(pCreature->GetEntry()) + { + case NPC_SINCLARI: m_uiSinclariGUID = pCreature->GetGUID(); break; + case NPC_SINCLARI_ALT: m_uiSinclariAltGUID = pCreature->GetGUID(); break; + case NPC_DOOR_SEAL: m_uiSealDoorGUID = pCreature->GetGUID(); break; + + case NPC_EREKEM: + m_uiErekemGUID = pCreature->GetGUID(); + break; + case NPC_MORAGG: + m_uiMoraggGUID = pCreature->GetGUID(); + break; + case NPC_ICHORON: + m_uiIchoronGUID = pCreature->GetGUID(); + break; + case NPC_XEVOZZ: + m_uiXevozzGUID = pCreature->GetGUID(); + break; + case NPC_LAVANTHOR: + m_uiLavanthorGUID = pCreature->GetGUID(); + break; + case NPC_ZURAMAT: + m_uiZuramatGUID = pCreature->GetGUID(); + break; + + case NPC_PORTAL_INTRO: + m_lIntroPortalList.push_back(pCreature->GetGUID()); + break; + case NPC_HOLD_GUARD: + m_lGuardsList.push_back(pCreature->GetGUID()); + pCreature->setFaction(35); + break; + } +} + +void instance_violet_hold::OnObjectCreate(GameObject* pGo) +{ + switch(pGo->GetEntry()) + { + case GO_DOOR_SEAL: + m_uiSealDoorGUID = pGo->GetGUID(); + pSealDoor = pGo; + DoUseDoorOrButton(pGo->GetGUID()); + break; + case GO_DOOR_EREKEM: + m_uiErekemDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_EREKEM_LEFT: + m_uiErekemDoorLeftGUID = pGo->GetGUID(); + break; + case GO_DOOR_EREKEM_RIGHT: + m_uiErekemDoorRightGUID = pGo->GetGUID(); + break; + case GO_DOOR_MORAGG: + m_uiMoraggDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_ICHORON: + m_uiIchoronDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_XEVOZZ: + m_uiXevozzDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_LAVANTHOR: + m_uiLavanthorDoorGUID = pGo->GetGUID(); + break; + case GO_DOOR_ZURAMAT: + m_uiZuramatDoorGUID = pGo->GetGUID(); + break; + + case GO_INTRO_CRYSTAL: + m_uiIntroCrystalGUID = pGo->GetGUID(); + break; + } +} + +void instance_violet_hold::UpdateWorldState(bool bEnable) +{ + if (bEnable) + m_uiWorldState = 1; + else + m_uiWorldState = 0; + + DoUpdateWorldState(WORLD_STATE_ID, m_uiWorldState); + DoUpdateWorldState(WORLD_STATE_SEAL, m_uiWorldStateSealCount); + DoUpdateWorldState(WORLD_STATE_PORTALS, m_uiWorldStatePortalCount); +} + +void instance_violet_hold::SetData(uint32 uiType, uint32 uiData) +{ + debug_log("SD2: instance_violet_hold: SetData got type % u, data %u.", uiType, uiData); + + switch(uiType) + { + case TYPE_MAIN: + { + if (uiData == m_auiEncounter[0]) + return; + + switch(uiData) + { + case NOT_STARTED: + ResetAll(); + break; + case IN_PROGRESS: + + //DoUseDoorOrButton(m_uiSealDoorGUID); // is not working for unknown reason + if(pSealDoor) + pSealDoor->UseDoorOrButton(); + UpdateWorldState(); + m_uiPortalId = urand(0, 2); + m_uiPortalTimer = 15000; + break; + case FAIL: + /*if (Creature* pSinclari = instance->GetCreature(m_uiSinclariGUID)) + pSinclari->Respawn(); + ResetAll();*/ + case DONE: + UpdateWorldState(false); + //DoUseDoorOrButton(m_uiSealDoorGUID); + if(pSealDoor) + pSealDoor->ResetDoorOrButton(); + if(Creature* pDoorSeal = instance->GetCreature(m_uiSealDoorGUID)) + pDoorSeal->ForcedDespawn(); + break; + case SPECIAL: + break; + } + m_auiEncounter[0] = uiData; + break; + } + case TYPE_SEAL: + m_auiEncounter[1] = uiData; + if(uiData == SPECIAL && m_auiEncounter[TYPE_MAIN] == IN_PROGRESS) + { + --m_uiWorldStateSealCount; + if(Creature* pSinclari = instance->GetCreature(m_uiSinclariGUID)) + { + if(m_uiSealDmgSay==0 && m_uiWorldStateSealCount<=75) + { + ++m_uiSealDmgSay; + DoScriptText(SAY_SEAL_75,pSinclari); + } + else if(m_uiSealDmgSay==1 && m_uiWorldStateSealCount<=50) + { + ++m_uiSealDmgSay; + DoScriptText(SAY_SEAL_50,pSinclari); + } + else if(m_uiSealDmgSay==2 && m_uiWorldStateSealCount<=5) + { + ++m_uiSealDmgSay; + DoScriptText(SAY_SEAL_5,pSinclari); + } + UpdateWorldState(); + if(m_uiWorldStateSealCount <= 0) + SetData(TYPE_MAIN,FAIL); + } + } + break; + case TYPE_PORTAL: + { + if(m_auiEncounter[TYPE_MAIN] == IN_PROGRESS) + switch(uiData) + { + case SPECIAL: // timer to next + m_uiPortalTimer = 90000; + break; + case DONE: // portal done, set timer to 5 secs + m_uiPortalTimer = 5000; + break; + } + m_auiEncounter[2] = uiData; + break; + } + case TYPE_EREKEM: + case TYPE_MORAGG: + case TYPE_ICHORON: + case TYPE_XEVOZZ: + case TYPE_LAVANTHOR: + case TYPE_ZURAMAT: + m_auiEncounter[uiType] = uiData; + if(uiData == DONE) + m_uiPortalTimer = 20000; + break; + case TYPE_CYANIGOSA: + m_auiEncounter[uiType] = uiData; + if(uiData == DONE) + SetData(TYPE_MAIN,DONE); + break; + } + if (uiData == DONE) + { + //check if boss was completed + for(int i = TYPE_EREKEM;i::iterator i = m_lIntroPortalList.begin(); i != m_lIntroPortalList.end(); ++i) + { + if (Creature* pPortal = instance->GetCreature(*i)) + { + if (bDeactivate) + pPortal->ForcedDespawn(); + else + pPortal->Respawn(); + } + } +} + +void instance_violet_hold::SpawnPortal() +{ + if (const sPortalData* pData = GetPortalData()) + { + if (Creature* pController = instance->GetCreature(m_uiSinclariAltGUID)) + { + uint32 uiPortalEntry; + + switch(pData->pPortalType) + { + case PORTAL_TYPE_NORM: uiPortalEntry = NPC_PORTAL; break; + case PORTAL_TYPE_SQUAD: + case PORTAL_TYPE_BOSS: uiPortalEntry = NPC_PORTAL_ELITE; break; + } + + pController->SummonCreature(uiPortalEntry, pData->fX, pData->fY, pData->fZ, pData->fOrient, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 1800*IN_MILLISECONDS); + } + } +} + +void instance_violet_hold::SetPortalId() +{ + if (IsCurrentPortalForTrash()) + { + int iTemp = rand()%(m_uiMaxCountPortalLoc - 1); + + if (iTemp >= m_uiPortalId) + ++iTemp; + + debug_log("SD2: instance_violet_hold: SetPortalId %i, old was id %u.", iTemp, m_uiPortalId); + + m_uiPortalId = iTemp; + } + else + { + debug_log("SD2: instance_violet_hold: SetPortalId %u (is boss), old was id %u.", m_uiMaxCountPortalLoc, m_uiPortalId); + m_uiPortalId = m_uiMaxCountPortalLoc; + } +} + +void instance_violet_hold::CallGuards(bool bRespawn) +{ + for(std::list::iterator i = m_lGuardsList.begin(); i != m_lGuardsList.end(); ++i) + { + if (Creature* pGuard = instance->GetCreature(*i)) + { + if (bRespawn) + { + pGuard->Respawn(); + } + else if (pGuard->isAlive()) + { + pGuard->AI()->EnterEvadeMode(); + + if (Creature* pSinclari = instance->GetCreature(m_uiSinclariGUID)) + pGuard->GetMotionMaster()->MoveFollow(pSinclari, 0.0f, 0.0f); + + pGuard->ForcedDespawn(20000); + } + } + } +} + +void instance_violet_hold::ProcessActivationCrystal(Unit* pUser, bool bIsIntro) +{ + if (Creature* pSummon = pUser->SummonCreature(NPC_DEFENSE_SYSTEM, fDefenseSystemLoc[0], fDefenseSystemLoc[1], fDefenseSystemLoc[2], fDefenseSystemLoc[3], TEMPSUMMON_TIMED_DESPAWN, 10000)) + { + pSummon->CastSpell(pSummon, SPELL_DEFENSE_SYSTEM_VISUAL, true); + + // TODO: figure out how the rest work + // NPC's NPC_DEFENSE_DUMMY_TARGET are probably channeling some spell to the defense system + } + + if (bIsIntro) + DoUseDoorOrButton(m_uiIntroCrystalGUID); + + // else, kill (and despawn?) certain trash mobs. Also boss affected, but not killed. +} + +uint32 instance_violet_hold::GetRandomPortalEliteEntry() +{ + return (urand(0, 1) ? NPC_PORTAL_GUARDIAN : NPC_PORTAL_KEEPER); +} + +uint32 instance_violet_hold::GetRandomMobForNormalPortal() +{ + switch(urand(1, 4)) + { + case 1: return NPC_AZURE_INVADER; + case 2: return NPC_MAGE_HUNTER; + case 3: return NPC_AZURE_SPELLBREAKER; + case 4: return NPC_AZURE_BINDER; + } + + return 0; +} + +uint64 instance_violet_hold::GetData64(uint32 uiData) +{ + switch(uiData) + { + case DATA_EREKEM: + return m_uiErekemGUID; + case DATA_MORAGG: + return m_uiMoraggGUID; + case DATA_ICHORON: + return m_uiIchoronGUID; + case DATA_XEVOZZ: + return m_uiXevozzGUID; + case DATA_LAVANTHOR: + return m_uiLavanthorGUID; + case DATA_ZURAMAT: + return m_uiZuramatGUID; + case DATA_SINCLARI: + return m_uiSinclariGUID; + case DATA_NPC_SEAL_DOOR: + return m_uiSealDoorGUID; + case DATA_SEAL_DOOR: + return m_uiSealDoorGUID; + case DATA_EREKEM_DOOR: + return m_uiErekemDoorGUID; + case DATA_EREKEM_DOOR_L: + return m_uiErekemDoorLeftGUID; + case DATA_EREKEM_DOOR_R: + return m_uiErekemDoorRightGUID; + case DATA_MORAGG_DOOR: + return m_uiMoraggDoorGUID; + case DATA_ICHORON_DOOR: + return m_uiIchoronDoorGUID; + case DATA_XEVOZZ_DOOR: + return m_uiXevozzDoorGUID; + case DATA_LAVANTHOR_DOOR: + return m_uiLavanthorDoorGUID; + case DATA_ZURAMAT_DOOR: + return m_uiZuramatDoorGUID; + } + return 0; +} + +void instance_violet_hold::Update(uint32 uiDiff) +{ + if (!(m_auiEncounter[0] == IN_PROGRESS || m_auiEncounter[0] == SPECIAL)) + return; + + if (m_uiPortalTimer) + { + if (m_uiPortalTimer <= uiDiff) + { + DoUpdateWorldState(WORLD_STATE_PORTALS, ++m_uiWorldStatePortalCount); + + SetPortalId(); + SpawnPortal(); + + m_uiPortalTimer = 0; + } + else + m_uiPortalTimer -= uiDiff; + } +} + +InstanceData* GetInstanceData_instance_violet_hold(Map* pMap) +{ + return new instance_violet_hold(pMap); +} + +void AddSC_instance_violet_hold() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_violet_hold"; + newscript->GetInstanceData = GetInstanceData_instance_violet_hold; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/violet_hold/violet_hold.cpp b/scripts/northrend/violet_hold/violet_hold.cpp new file mode 100644 index 0000000..e1811be --- /dev/null +++ b/scripts/northrend/violet_hold/violet_hold.cpp @@ -0,0 +1,496 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Violet_Hold +SD%Complete: 40 +SDComment: +SDCategory: Violet Hold +EndScriptData */ + +/* ContentData +go_activation_crystal +npc_door_seal +npc_sinclari +npc_teleportation_portal +EndContentData */ + +#include "precompiled.h" +#include "violet_hold.h" +#include "escort_ai.h" + +/*###### +## go_activation_crystal +######*/ + +bool GOHello_go_activation_crystal(Player* pPlayer, GameObject* pGo) +{ + if (instance_violet_hold* pInstance = (instance_violet_hold*)pGo->GetInstanceData()) + pInstance->ProcessActivationCrystal(pPlayer); + + return false; +} + +/*###### +## npc_door_seal +######*/ + +bool EffectDummyCreature_npc_door_seal(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_DESTROY_DOOR_SEAL && uiEffIndex == EFFECT_INDEX_0) + { + if (instance_violet_hold* pInstance = (instance_violet_hold*)pCreatureTarget->GetInstanceData()) + pInstance->SetData(TYPE_SEAL, SPECIAL); + + //always return true when we are handling this spell and effect + return true; + } + + return false; +} + +/*###### +## npc_sinclari +######*/ + +enum +{ + SAY_BEGIN = -1608000, + SAY_LOCK_DOOR = -1608001, + + GOSSIP_ITEM_INTRO = -3608000, + GOSSIP_ITEM_START = -3608001, + + GOSSIP_TEXT_ID_INTRO = 13853, + GOSSIP_TEXT_ID_START = 13854, +}; + +struct MANGOS_DLL_DECL npc_sinclariAI : public npc_escortAI +{ + npc_sinclariAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (instance_violet_hold*)pCreature->GetInstanceData(); + Reset(); + } + + uint8 m_uiSealWeakenCount; + + instance_violet_hold* m_pInstance; + + void Reset() + { + } + + void WaypointReached(uint32 uiPointId) + { + if (!m_pInstance) + return; + + switch(uiPointId) + { + case 0: + m_pInstance->ProcessActivationCrystal(m_creature, true); + break; + case 1: + DoScriptText(SAY_BEGIN, m_creature); + m_pInstance->SetIntroPortals(true); + m_pInstance->CallGuards(false); + break; + case 2: + DoScriptText(SAY_LOCK_DOOR, m_creature); + m_pInstance->SetData(TYPE_MAIN, IN_PROGRESS); + } + } + + void JustRespawned() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MAIN, NOT_STARTED); + } +}; + +CreatureAI* GetAI_npc_sinclari(Creature* pCreature) +{ + return new npc_sinclariAI(pCreature); +} + +bool GossipHello_npc_sinclari(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_INTRO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_ID_INTRO, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_sinclari(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (instance_violet_hold* pInstance = (instance_violet_hold*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_MAIN) == NOT_STARTED) + { + pPlayer->PlayerTalkClass->ClearMenus(); + pPlayer->ADD_GOSSIP_ITEM_ID(GOSSIP_ICON_CHAT, GOSSIP_ITEM_START, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_ID_START, pCreature->GetGUID()); + } + } + else + pPlayer->CLOSE_GOSSIP_MENU(); + } + else + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + if (instance_violet_hold* pInstance = (instance_violet_hold*)pCreature->GetInstanceData()) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pInstance->GetData(TYPE_MAIN) == NOT_STARTED) + { + pInstance->SetData(TYPE_MAIN, SPECIAL); + + if (npc_sinclariAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(); + } + } + else + pPlayer->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +/*###### +## npc_teleportation_portal +######*/ + +struct MANGOS_DLL_DECL npc_teleportation_portalAI : public ScriptedAI +{ + npc_teleportation_portalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (instance_violet_hold*)pCreature->GetInstanceData(); + m_uiMyPortalNumber = 0; + Reset(); + } + + instance_violet_hold* m_pInstance; + + std::set m_lMobSet; + + bool m_bNeedInvisible; + bool m_bIntro; + uint32 m_uiIntroTimer; + uint32 m_uiMyPortalNumber; + + void Reset() + { + m_bNeedInvisible = false; + m_bIntro = false; + m_uiIntroTimer = 6000; + + if (m_pInstance) + m_uiMyPortalNumber = m_pInstance->GetCurrentPortalNumber(); + } + + void DoSummon() + { + if (m_creature->GetEntry() == NPC_PORTAL_INTRO) + { + //not made yet + return; + } + else if (m_creature->GetEntry() == NPC_PORTAL) + { + m_creature->SummonCreature(m_pInstance->GetRandomPortalEliteEntry(), 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600*IN_MILLISECONDS); + m_creature->CastSpell(m_creature, SPELL_PORTAL_PERIODIC, true); + } + else if (m_pInstance->IsCurrentPortalForTrash()) + { + for(uint8 i = 0; i < 4; ++i) + { + uint32 uiSummonId; + + switch(i) + { + case 0: uiSummonId = NPC_AZURE_CAPTAIN; break; + case 1: uiSummonId = NPC_AZURE_RAIDER; break; + case 2: uiSummonId = NPC_AZURE_SORCEROR; break; + case 3: uiSummonId = NPC_AZURE_STALKER; break; + } + + m_creature->SummonCreature(uiSummonId, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600*IN_MILLISECONDS); + } + + m_bNeedInvisible = true; + } + else + { + if(m_uiMyPortalNumber < 18) + m_creature->SummonCreature(NPC_AZURE_SABOTEUR, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600*IN_MILLISECONDS); + else + m_creature->SummonCreature(NPC_CYANIGOSA, PortalLoc[0].x, PortalLoc[0].y, PortalLoc[0].z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 300000); + m_bNeedInvisible = true; + } + } + + void JustSummoned(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_PORTAL_GUARDIAN: + DoScriptText(EMOTE_GUARDIAN_PORTAL, pSummoned); + m_creature->CastSpell(pSummoned, SPELL_PORTAL_CHANNEL, false); + break; + case NPC_PORTAL_KEEPER: + DoScriptText(EMOTE_KEEPER_PORTAL, pSummoned); + m_creature->CastSpell(pSummoned, SPELL_PORTAL_CHANNEL, false); + break; + case NPC_AZURE_CAPTAIN: + DoScriptText(EMOTE_DRAGONFLIGHT_PORTAL, pSummoned); + m_lMobSet.insert(pSummoned->GetGUID()); + break; + case NPC_AZURE_RAIDER: + case NPC_AZURE_SORCEROR: + case NPC_AZURE_STALKER: + m_lMobSet.insert(pSummoned->GetGUID()); + return; + default: + return; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_PORTAL, SPECIAL); + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + switch(pSummoned->GetEntry()) + { + case NPC_PORTAL_GUARDIAN: + case NPC_PORTAL_KEEPER: + break; + case NPC_AZURE_CAPTAIN: + case NPC_AZURE_RAIDER: + case NPC_AZURE_SORCEROR: + case NPC_AZURE_STALKER: + { + m_lMobSet.erase(pSummoned->GetGUID()); + + if (!m_lMobSet.empty()) + return; + + break; + } + default: + return; + } + + if (m_pInstance) + { + // no need if a new portal was made while this was in progress + if (m_uiMyPortalNumber == m_pInstance->GetCurrentPortalNumber()) + m_pInstance->SetData(TYPE_PORTAL, DONE); + } + + m_creature->ForcedDespawn(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiIntroTimer) + { + if (m_uiIntroTimer <= uiDiff) + { + if (!m_pInstance) + { + m_creature->ForcedDespawn(); + return; + } + + m_uiIntroTimer = 0; + } + else + { + m_uiIntroTimer -= uiDiff; + return; + } + } + + if (!m_bIntro) + { + DoSummon(); + m_bIntro = true; + } + + if (m_bNeedInvisible) + { + // hack; find a better way + m_creature->SetVisibility(VISIBILITY_OFF); + m_bNeedInvisible = false; + } + } +}; + +CreatureAI* GetAI_npc_teleportation_portal(Creature* pCreature) +{ + return new npc_teleportation_portalAI(pCreature); +} + +bool EffectDummyCreature_npc_teleportation_portal(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_PORTAL_PERIODIC && uiEffIndex == EFFECT_INDEX_0) + { + if (instance_violet_hold* pInstance = (instance_violet_hold*)pCreatureTarget->GetInstanceData()) + pCreatureTarget->SummonCreature(pInstance->GetRandomMobForNormalPortal(), 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 600*IN_MILLISECONDS); + + //always return true when we are handling this spell and effect + return true; + } + + return false; +} + +/*###### +## npc_azure_saboteur +######*/ +struct MANGOS_DLL_DECL npc_azure_saboteurAI : public ScriptedAI +{ + npc_azure_saboteurAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = ((ScriptedInstance*)pCreature->GetInstanceData()); + Reset(); + } + ScriptedInstance *m_pInstance; + + bool m_bIsActiving; + + uint32 m_uiDisruption_Timer; + uint32 m_uiDisruptionCounter; + uint32 m_uiDisruptionsCount; + + uint8 m_uiBossID; + uint8 m_bIsRegular; + uint64 m_uiBossGUID; + uint64 m_uiDoorGUID; + + void AttackStart(Unit* pWho) + { + return; + } + + void Reset() + { + m_bIsActiving = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_uiDisruptionCounter = 0; + m_uiDisruptionsCount = 0; + m_uiDisruption_Timer = 1000; + + if (m_pInstance) + { + m_uiBossID = m_pInstance->GetData(TYPE_RAND_BOSS_ID); + + m_uiBossGUID = m_pInstance->GetData64(m_uiBossID); + m_uiDoorGUID = m_pInstance->GetData64(m_uiBossID+30); + m_creature->GetMotionMaster()->MovePoint(0, BossLoc[m_uiBossID].x, BossLoc[m_uiBossID].y, BossLoc[m_uiBossID].z); + //else m_creature->GetMotionMaster()->MovePoint(0, 1827.960, 804.208, 44.364); + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if(uiType != POINT_MOTION_TYPE) + return; + + switch(uiPointId) + { + case 0: + m_bIsActiving = true; + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bIsActiving) + { + if(!m_pInstance) + return; + if (m_uiDisruption_Timer < uiDiff) + { + DoCast(m_creature, SPELL_SHIELD_DISRUPTION); + if(Creature* pBoss = (Creature*) m_creature->GetMap()->GetUnit(m_uiBossGUID)) + { + pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE); + pBoss->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + } + + m_pInstance->DoUseDoorOrButton(m_uiDoorGUID); + m_pInstance->SetData(m_uiBossID,SPECIAL); + + if (m_uiBossID == TYPE_EREKEM) + { + m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(DATA_EREKEM_DOOR_L)); + m_pInstance->DoUseDoorOrButton(m_pInstance->GetData64(DATA_EREKEM_DOOR_R)); + } + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_bIsActiving = false; + } + else m_uiDisruption_Timer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_azure_saboteur(Creature* pCreature) +{ + return new npc_azure_saboteurAI (pCreature); +} + +void AddSC_violet_hold() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_activation_crystal"; + newscript->pGOHello = &GOHello_go_activation_crystal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_door_seal"; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_door_seal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_sinclari"; + newscript->GetAI = &GetAI_npc_sinclari; + newscript->pGossipHello = &GossipHello_npc_sinclari; + newscript->pGossipSelect = &GossipSelect_npc_sinclari; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_teleportation_portal"; + newscript->GetAI = &GetAI_npc_teleportation_portal; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_teleportation_portal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_azure_saboteur"; + newscript->GetAI = &GetAI_npc_azure_saboteur; + newscript->RegisterSelf(); +} diff --git a/scripts/northrend/violet_hold/violet_hold.h b/scripts/northrend/violet_hold/violet_hold.h new file mode 100644 index 0000000..d16b756 --- /dev/null +++ b/scripts/northrend/violet_hold/violet_hold.h @@ -0,0 +1,298 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_VIOLET_H +#define DEF_VIOLET_H + +enum +{ + MAX_ENCOUNTER = 10, + + TYPE_MAIN = 0, + TYPE_PORTAL = 1, + TYPE_SEAL = 2, + + TYPE_EREKEM = 3, + TYPE_MORAGG = 4, + TYPE_ICHORON = 5, + TYPE_XEVOZZ = 6, + TYPE_LAVANTHOR = 7, + TYPE_ZURAMAT = 8, + TYPE_CYANIGOSA = 9, + + TYPE_LASTBOSS = 11, + TYPE_DOOR = 12, + TYPE_SEAL_DMG_SAY = 13, + + TYPE_RAND_BOSS_ID = 14, + + DATA_EREKEM = 23, + DATA_MORAGG = 24, + DATA_ICHORON = 25, + DATA_XEVOZZ = 26, + DATA_LAVANTHOR = 27, + DATA_ZURAMAT = 28, + DATA_SINCLARI = 29, + DATA_NPC_SEAL_DOOR = 31, + + DATA_SEAL_DOOR = 32, + DATA_EREKEM_DOOR = 33, + DATA_MORAGG_DOOR = 34, + DATA_ICHORON_DOOR = 35, + DATA_XEVOZZ_DOOR = 36, + DATA_LAVANTHOR_DOOR = 37, + DATA_ZURAMAT_DOOR = 38, + DATA_EREKEM_DOOR_L = 39, + DATA_EREKEM_DOOR_R = 40, + + WORLD_STATE_ID = 3816, + WORLD_STATE_SEAL = 3815, + WORLD_STATE_PORTALS = 3810, + + GO_INTRO_CRYSTAL = 193615, + + GO_DOOR_SEAL = 191723, + GO_DOOR_EREKEM = 191564, + GO_DOOR_EREKEM_RIGHT = 191563, + GO_DOOR_EREKEM_LEFT = 191562, + GO_DOOR_MORAGG = 191606, + GO_DOOR_ICHORON = 191722, + GO_DOOR_XEVOZZ = 191556, + GO_DOOR_LAVANTHOR = 191566, + GO_DOOR_ZURAMAT = 191565, + + NPC_EVENT_CONTROLLER = 30883, + NPC_PORTAL_INTRO = 31011, + NPC_PORTAL = 30679, + NPC_PORTAL_ELITE = 32174, + NPC_DOOR_SEAL = 30896, + + NPC_SINCLARI = 30658, + NPC_SINCLARI_ALT = 32204, // yeller for seal weakening and summoner for portals + NPC_HOLD_GUARD = 30659, + + NPC_EREKEM = 29315, + NPC_EREKEM_GUARD = 29395, + NPC_MORAGG = 29316, + NPC_ICHORON = 29313, + NPC_XEVOZZ = 29266, + NPC_LAVANTHOR = 29312, + NPC_ZURAMAT = 29314, + NPC_CYANIGOSA = 31134, + + NPC_PORTAL_GUARDIAN = 30660, + NPC_PORTAL_KEEPER = 30695, + + NPC_AZURE_INVADER = 30661, + NPC_AZURE_SPELLBREAKER = 30662, + NPC_AZURE_BINDER = 30663, + NPC_AZURE_MAGE_SLAYER = 30664, + NPC_MAGE_HUNTER = 30665, + NPC_AZURE_CAPTAIN = 30666, + NPC_AZURE_SORCEROR = 30667, + NPC_AZURE_RAIDER = 30668, + NPC_AZURE_STALKER = 32191, + + // used for intro + NPC_AZURE_BINDER_INTRO = 31007, + NPC_AZURE_INVADER_INTRO = 31008, + NPC_AZURE_SPELLBREAKER_INTRO= 31009, + NPC_AZURE_MAGE_SLAYER_INTRO = 31010, + + NPC_AZURE_SABOTEUR = 31079, + + NPC_DEFENSE_SYSTEM = 30837, + NPC_DEFENSE_DUMMY_TARGET = 30857, + + NPC_ARAKKOA = 32226, + NPC_VOID_LORD = 32230, + NPC_ETHERAL = 32231, + NPC_SWIRLING = 32234, + NPC_WATCHER = 32235, + NPC_LAVA_HOUND = 32237, + + SPELL_DEFENSE_SYSTEM_VISUAL = 57887, + SPELL_DEFENSE_SYSTEM_SPAWN = 57886, + + SPELL_DESTROY_DOOR_SEAL = 58040, // spell periodic cast by misc + SPELL_TELEPORTATION_PORTAL = 57687, // visual aura, but possibly not used? creature_template model for portals are same + + SPELL_SHIELD_DISRUPTION = 58291, // dummy when opening a cell + + SPELL_PORTAL_PERIODIC = 58008, // most likely the tick for each summon (tick each 15 seconds) + SPELL_PORTAL_CHANNEL = 58012, // the blue "stream" between portal and guardian/keeper + SPELL_PORTAL_BEAM = 56046, // large beam, unsure if really used here (or possible for something different) + + SPELL_PORTAL_VISUAL_1 = 57872, // no idea, but is possibly related based on it's visual appearence + SPELL_PORTAL_VISUAL_2 = 57630, + + SAY_SEAL_75 = -1608002, + SAY_SEAL_50 = -1608003, + SAY_SEAL_5 = -1608004, + + EMOTE_GUARDIAN_PORTAL = -1608005, + EMOTE_DRAGONFLIGHT_PORTAL = -1608006, + EMOTE_KEEPER_PORTAL = -1608007, + + MAX_NORMAL_PORTAL = 8 +}; + +static float fDefenseSystemLoc[4] = {1888.146f, 803.382f, 58.604f, 3.072f}; + +enum ePortalType +{ + PORTAL_TYPE_NORM = 0, + PORTAL_TYPE_SQUAD, + PORTAL_TYPE_BOSS, +}; + +struct sPortalData +{ + ePortalType pPortalType; + float fX, fY, fZ, fOrient; +}; + +static sPortalData afPortalLocation[]= +{ + {PORTAL_TYPE_NORM, 1936.07f, 803.198f, 53.3749f, 3.1241f}, //balcony + {PORTAL_TYPE_NORM, 1877.51f, 850.104f, 44.6599f, 4.7822f}, //erekem + {PORTAL_TYPE_NORM, 1890.64f, 753.471f, 48.7224f, 1.7104f}, //moragg + {PORTAL_TYPE_SQUAD, 1911.06f, 802.103f, 38.6465f, 2.8908f}, //below balcony + {PORTAL_TYPE_SQUAD, 1928.06f, 763.256f, 51.3167f, 2.3905f}, //bridge + {PORTAL_TYPE_SQUAD, 1924.26f, 847.661f, 47.1591f, 4.0202f}, //zuramat + {PORTAL_TYPE_NORM, 1914.16f, 832.527f, 38.6441f, 3.5160f}, //xevozz + {PORTAL_TYPE_NORM, 1857.30f, 764.145f, 38.6543f, 0.8339f}, //lavanthor + {PORTAL_TYPE_BOSS, 1890.73f, 803.309f, 38.4001f, 2.4139f}, //center +}; + +class MANGOS_DLL_DECL instance_violet_hold : public ScriptedInstance +{ + public: + instance_violet_hold(Map* pMap); + ~instance_violet_hold() {} + + void Initialize(); + void ResetAll(); + void ResetVariables(); + + void OnCreatureCreate(Creature* pCreature); + void OnObjectCreate(GameObject* pGo); + + void UpdateCellForBoss(uint32 uiBossEntry); + void UpdateWorldState(bool bEnable = true); + + void OnPlayerEnter(Player* pPlayer); + + void SetIntroPortals(bool bDeactivate); + void SpawnPortal(); + + void SetPortalId(); + + void CallGuards(bool bRespawn); + + uint32 GetRandomPortalEliteEntry(); + uint32 GetRandomMobForNormalPortal(); + + uint32 GetCurrentPortalNumber() { return m_uiWorldStatePortalCount; } + + sPortalData const* GetPortalData() { return &afPortalLocation[m_uiPortalId]; } + + bool IsCurrentPortalForTrash() + { + if (m_uiWorldStatePortalCount % 6) + return true; + + return false; + } + + bool IsNextPortalForTrash() + { + if ((m_uiWorldStatePortalCount+1) % 6) + return true; + + return false; + } + + void ProcessActivationCrystal(Unit* pUser, bool bIsIntro = false); + + void SetRandomBosses(); + + void SetData(uint32 uiType, uint32 uiData); + uint32 GetData(uint32 uiType); + uint64 GetData64(uint32 uiData); + + void Update(uint32 uiDiff); + + typedef std::multimap BossToCellMap; + + protected: + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiSinclariGUID; + uint64 m_uiSinclariAltGUID; + uint64 m_uiErekemGUID; + uint64 m_uiMoraggGUID; + uint64 m_uiIchoronGUID; + uint64 m_uiXevozzGUID; + uint64 m_uiLavanthorGUID; + uint64 m_uiZuramatGUID; + + uint64 m_uiSealDoorGUID; + uint64 m_uiErekemDoorGUID; + uint64 m_uiErekemDoorLeftGUID; + uint64 m_uiErekemDoorRightGUID; + uint64 m_uiMoraggDoorGUID; + uint64 m_uiIchoronDoorGUID; + uint64 m_uiXevozzDoorGUID; + uint64 m_uiLavanthorDoorGUID; + uint64 m_uiZuramatDoorGUID; + + uint64 m_uiCellErekemGuard_LGUID; + uint64 m_uiCellErekemGuard_RGUID; + uint64 m_uiIntroCrystalGUID; + + uint32 m_uiWorldState; + uint32 m_uiWorldStateSealCount; + uint32 m_uiWorldStatePortalCount; + + uint8 m_uiPortalId; + uint32 m_uiPortalTimer; + uint32 m_uiMaxCountPortalLoc; + uint32 m_uiSealDmgSay; + uint32 m_uiChosenBoss; + + std::list m_lIntroPortalList; + std::list m_lGuardsList; +}; + +struct Locations +{ + float x, y, z; + uint32 id; +}; + +static Locations BossLoc[]= +{ + {1876.100f, 857.079f, 43.333f}, // Erekem + {1892.737f, 744.589f, 47.666f}, // Moragg + {1908.863f, 785.647f, 37.435f}, // Ichoron + {1905.364f, 840.607f, 38.670f}, // Xevozz + {1857.125f, 763.295f, 38.654f}, // Lavanthor + {1925.480f, 849.981f, 47.174f}, // Zuramat +}; + +static Locations PortalLoc[]= +{ + {1888.271f, 810.781f, 38.441f}, // 0 center + {1857.125f, 763.295f, 38.654f}, // 1 Lavanthor + {1925.480f, 849.981f, 47.174f}, // 2 Zuramat + {1892.737f, 744.589f, 47.666f}, // 3 Moragg + {1878.198f, 850.005f, 43.333f}, // 4 Portal in front of Erekem + {1909.381f, 806.796f, 38.645f}, // 5 Portal outside of Ichoron + {1936.101f, 802.950f, 52.417f}, // 6 at the highest platform +}; + +#endif diff --git a/scripts/northrend/zuldrak.cpp b/scripts/northrend/zuldrak.cpp new file mode 100644 index 0000000..a3d817d --- /dev/null +++ b/scripts/northrend/zuldrak.cpp @@ -0,0 +1,98 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zuldrak +SD%Complete: 100 +SDComment: Quest support: 12934. +SDCategory: Zuldrak +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" + +enum +{ + QUEST_FROM_BEYOND = 12934, + + NPC_AZBARIN = 30026, + NPC_DUKE_SINGEN = 30019, + NPC_ERATHIUS = 30025, + NPC_GARGORAL = 30024 +}; + +static float m_afSpawnLocation[] = {5768.71f, -2969.29f, 273.816f}; +static uint32 m_auiBosses[] = {NPC_AZBARIN, NPC_DUKE_SINGEN, NPC_ERATHIUS, NPC_GARGORAL}; + +struct MANGOS_DLL_DECL npc_gurgthockAI : public ScriptedAI +{ + npc_gurgthockAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint64 m_uiPlayerGUID; + + void SetPlayerGUID(uint64 uiPlayerGUID) { m_uiPlayerGUID = uiPlayerGUID; } + + void Reset() + { + m_uiPlayerGUID = 0; + } + + void SummonedCreatureJustDied(Creature* pSummoned) + { + uint32 uiEntry = pSummoned->GetEntry(); + for(uint8 i = 0; i < 4; ++i) + { + if (uiEntry == m_auiBosses[i]) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + pPlayer->GroupEventHappens(QUEST_FROM_BEYOND, m_creature); + + m_uiPlayerGUID = 0; + return; + } + } + } +}; + +bool QuestAccept_npc_gurgthock(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_FROM_BEYOND) + { + pCreature->SummonCreature(m_auiBosses[urand(0, 3)], m_afSpawnLocation[0], m_afSpawnLocation[1], m_afSpawnLocation[2], 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 600000); + + if (npc_gurgthockAI* pGurthockAI = dynamic_cast(pCreature->AI())) + pGurthockAI->SetPlayerGUID(pPlayer->GetGUID()); + } + return true; +} + +CreatureAI* GetAI_npc_gurgthock(Creature* pCreature) +{ + return new npc_gurgthockAI(pCreature); +} + +void AddSC_zuldrak() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "npc_gurgthock"; + pNewScript->GetAI = &GetAI_npc_gurgthock; + pNewScript->pQuestAccept = &QuestAccept_npc_gurgthock; + pNewScript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 0000000..61ea485 --- /dev/null +++ b/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,361 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "precompiled.h" + +enum +{ + SPELL_MOONFIRE = 37328, + SPELL_FIREBALL = 37329, + SPELL_MIND_FLAY = 37330, + SPELL_HEMORRHAGE = 37331, + SPELL_FROSTSHOCK = 37332, + SPELL_CURSE_OF_AGONY = 37334, + SPELL_MORTAL_STRIKE = 37335, + SPELL_FREEZING_TRAP = 37368, + SPELL_HAMMER_OF_JUSTICE = 37369, + SPELL_PLAGUE_STRIKE = 58339 +}; + +struct MANGOS_DLL_DECL mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint8 m_uiStolenClass; + uint32 m_uiSpellTimer; + + void Reset() + { + m_uiSpellTimer = 1000; + } + + void SetSoulInfo(Unit* pTarget) + { + m_uiStolenClass = pTarget->getClass(); + m_creature->SetDisplayId(pTarget->GetDisplayId()); + + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiSpellTimer < uiDiff) + { + switch (m_uiStolenClass) + { + case CLASS_WARRIOR: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + m_uiSpellTimer = 6000; + break; + case CLASS_PALADIN: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + m_uiSpellTimer = 6000; + break; + case CLASS_HUNTER: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FREEZING_TRAP); + m_uiSpellTimer = 20000; + break; + case CLASS_ROGUE: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HEMORRHAGE); + m_uiSpellTimer = 10000; + break; + case CLASS_PRIEST: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MIND_FLAY); + m_uiSpellTimer = 5000; + break; + case CLASS_SHAMAN: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROSTSHOCK); + m_uiSpellTimer = 8000; + break; + case CLASS_MAGE: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIREBALL); + m_uiSpellTimer = 5000; + break; + case CLASS_WARLOCK: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); + m_uiSpellTimer = 20000; + break; + case CLASS_DRUID: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MOONFIRE); + m_uiSpellTimer = 10000; + break; + case CLASS_DEATH_KNIGHT: + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); + m_uiSpellTimer = 10000; + break; + } + } + else + m_uiSpellTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI(pCreature); +} + +enum +{ + SAY_INTRO = -1558000, + SAY_SUMMON = -1558001, + SAY_AGGRO_1 = -1558002, + SAY_AGGRO_2 = -1558003, + SAY_AGGRO_3 = -1558004, + SAY_ROAR = -1558005, + SAY_SOUL_CLEAVE = -1558006, + SAY_SLAY_1 = -1558007, + SAY_SLAY_2 = -1558008, + SAY_DEATH = -1558009, + + SPELL_RIBBON_OF_SOULS = 32422, + SPELL_SOUL_SCREAM = 32421, + SPELL_STOLEN_SOUL = 32346, + SPELL_STOLEN_SOUL_VISUAL = 32395, + SPELL_SUMMON_AVATAR = 32424, + + NPC_STOLEN_SOUL = 18441, + NPC_DORE = 19412 +}; + +struct MANGOS_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bHasTaunted = false; + Reset(); + } + + uint64 m_uiTargetGUID; + + uint32 m_uiFearTimer; + uint32 m_uiRibbonOfSoulsTimer; + uint32 m_uiStolenSoulTimer; + + bool m_bHasTaunted; + bool m_bHasSummonedAvatar; + + void Reset() + { + m_uiTargetGUID = 0; + + m_uiFearTimer = urand(15000, 20000); + m_uiRibbonOfSoulsTimer = 5000; + m_uiStolenSoulTimer = urand(25000, 35000); + + m_bHasSummonedAvatar = false; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bHasTaunted && m_creature->IsWithinDistInMap(pWho, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + m_bHasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in mangos for this spell. + pSummoned->CastSpell(pSummoned, SPELL_STOLEN_SOUL_VISUAL, false); + pSummoned->setFaction(m_creature->getFaction()); + + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_uiTargetGUID)) + { + if (mob_stolen_soulAI* pSoulAI = dynamic_cast(pSummoned->AI())) + { + pSoulAI->SetSoulInfo(pTarget); + pSoulAI->AttackStart(pTarget); + } + } + } + } + + void KilledUnit(Unit* pVictim) + { + if (urand(0, 1)) + return; + + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + // When Exarch Maladaar is defeated D'ore appear. + DoSpawnCreature(NPC_DORE, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bHasSummonedAvatar && m_creature->GetHealthPercent() < 25.0f) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCastSpellIfCan(m_creature, SPELL_SUMMON_AVATAR); + m_bHasSummonedAvatar = true; + m_uiStolenSoulTimer = urand(15000, 30000); + } + + if (m_uiStolenSoulTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(urand(0, 1) ? SAY_ROAR : SAY_SOUL_CLEAVE, m_creature); + + m_uiTargetGUID = pTarget->GetGUID(); + + DoCastSpellIfCan(pTarget, SPELL_STOLEN_SOUL); + DoSpawnCreature(NPC_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + m_uiStolenSoulTimer = urand(20000, 30000); + } + else + m_uiStolenSoulTimer = 1000; + } + } + else + m_uiStolenSoulTimer -= uiDiff; + + if (m_uiRibbonOfSoulsTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_RIBBON_OF_SOULS); + + m_uiRibbonOfSoulsTimer = urand(5000, 25000); + } + else + m_uiRibbonOfSoulsTimer -= uiDiff; + + if (m_uiFearTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SOUL_SCREAM); + m_uiFearTimer = urand(15000, 30000); + } + else + m_uiFearTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI(pCreature); +} + +enum +{ + SPELL_AV_MORTAL_STRIKE = 16856, + SPELL_AV_SUNDER_ARMOR = 16145 +}; + +struct MANGOS_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_uiMortalStrikeTimer = 10000; + } + + uint32 m_uiMortalStrikeTimer; + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiMortalStrikeTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + m_uiMortalStrikeTimer = urand(10000, 30000); + } + else + m_uiMortalStrikeTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI(pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 0000000..2b8ff51 --- /dev/null +++ b/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,265 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431 +}; + +struct MANGOS_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bHasTaunted = false; + Reset(); + } + + uint32 m_uiBlink_Timer; + uint32 m_uiBeacon_Timer; + uint32 m_uiFireBall_Timer; + uint32 m_uiFrostbolt_Timer; + uint32 m_uiFrostNova_Timer; + + bool m_bHasTaunted; + bool m_bCanBlink; + + void Reset() + { + m_uiBlink_Timer = 1500; + m_uiBeacon_Timer = 10000; + m_uiFireBall_Timer = 8000; + m_uiFrostbolt_Timer = 4000; + m_uiFrostNova_Timer = 15000; + + m_bCanBlink = false; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bHasTaunted && pWho->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(pWho, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + m_bHasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_BEACON) + { + pSummoned->CastSpell(pSummoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEAD, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiFrostNova_Timer < uiDiff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoCastSpellIfCan(m_creature,SPELL_FROSTNOVA); + m_uiFrostNova_Timer = urand(17500, 25000); + m_bCanBlink = true; + }else m_uiFrostNova_Timer -= uiDiff; + + if (m_uiFrostbolt_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBOLT); + m_uiFrostbolt_Timer = urand(4500, 6000); + }else m_uiFrostbolt_Timer -= uiDiff; + + if (m_uiFireBall_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FIREBALL); + m_uiFireBall_Timer = urand(4500, 6000); + }else m_uiFireBall_Timer -= uiDiff; + + if (m_bCanBlink) + { + if (m_uiBlink_Timer < uiDiff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + DoCastSpellIfCan(m_creature,SPELL_BLINK); + + m_uiBlink_Timer = urand(1000, 2500); + m_bCanBlink = false; + }else m_uiBlink_Timer -= uiDiff; + } + + if (m_uiBeacon_Timer < uiDiff) + { + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCastSpellIfCan(m_creature, SPELL_ETHEREAL_BEACON, CAST_TRIGGERED); + + m_uiBeacon_Timer = 10000; + }else m_uiBeacon_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI(pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct MANGOS_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + + uint32 m_uiApprentice_Timer; + uint32 m_uiArcaneBolt_Timer; + + void Reset() + { + m_uiApprentice_Timer = m_bIsRegularMode ? 20000 : 10000; + m_uiArcaneBolt_Timer = 1000; + } + + void JustSummoned(Creature* pSummoned) + { + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiArcaneBolt_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_BOLT); + m_uiArcaneBolt_Timer = urand(2000, 4500); + }else m_uiArcaneBolt_Timer -= uiDiff; + + if (m_uiApprentice_Timer < uiDiff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->CastSpell(m_creature, SPELL_ETHEREAL_APPRENTICE, true); + + m_creature->ForcedDespawn(); + return; + + }else m_uiApprentice_Timer -= uiDiff; + + //should they do meele? + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI(pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 0000000..a01ef2d --- /dev/null +++ b/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp @@ -0,0 +1,134 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct MANGOS_DLL_DECL boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = urand(8000, 23000); + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (VoidBlast_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_VOID_BLAST : H_SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = urand(15000, 25000); + VoidBlast_Counter = 0; + } + }else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_DARK_SHELL : H_SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI(pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 0000000..3db7054 --- /dev/null +++ b/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,431 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 39945 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET 33526 +#define H_SPELL_FLAME_BUFFET 38141 +#define SPELL_ARCANE_BUFFET 33527 +#define H_SPELL_ARCANE_BUFFET 38138 +#define SPELL_FROST_BUFFET 33528 +#define H_SPELL_FROST_BUFFET 38142 +#define SPELL_SHADOW_BUFFET 33529 +#define H_SPELL_SHADOW_BUFFET 38143 + +struct MANGOS_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 1)) + return; + + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SYTH_ARCANE, CAST_TRIGGERED);//front + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SYTH_FIRE, CAST_TRIGGERED);//back + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SYTH_FROST, CAST_TRIGGERED);//left + DoCastSpellIfCan(m_creature, SPELL_SUMMON_SYTH_SHADOW, CAST_TRIGGERED);//right + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() < 90.0f && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (m_creature->GetHealthPercent() < 50.0f && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (m_creature->GetHealthPercent() < 10.0f && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_FLAME_SHOCK); + + flameshock_timer = urand(10000, 15000); + } else flameshock_timer -= diff; + + if (arcaneshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = urand(10000, 15000); + } else arcaneshock_timer -= diff; + + if (frostshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_FROST_SHOCK); + + frostshock_timer = urand(10000, 15000); + } else frostshock_timer -= diff; + + if (shadowshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = urand(10000, 15000); + } else shadowshock_timer -= diff; + + if (chainlightning_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI(pCreature); +} + +/* ELEMENTALS */ + +struct MANGOS_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 flameshock_timer; + uint32 flamebuffet_timer; + + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (flameshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + }else flameshock_timer -= diff; + + if (flamebuffet_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_FLAME_BUFFET : SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + + }else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (arcaneshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + }else arcaneshock_timer -= diff; + + if (arcanebuffet_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_ARCANE_BUFFET : SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + }else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 frostshock_timer; + uint32 frostbuffet_timer; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (frostshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + }else frostshock_timer -= diff; + + if (frostbuffet_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_FROST_BUFFET : SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + }else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (shadowshock_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + }else shadowshock_timer -= diff; + + if (shadowbuffet_timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_SHADOW_BUFFET : SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + }else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI(pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_fire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 0000000..5d331ad --- /dev/null +++ b/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "sethekk_halls.h" + +#define SAY_INTRO -1556007 +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct MANGOS_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = urand(15000, 30000); + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessablePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + + if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Blink) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_EXPLOSION : H_SPELL_ARCANE_EXPLOSION); + m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); + Blink = false; + } + + if (ArcaneVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_ARCANE_VOLLEY : H_SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = urand(7000, 12000); + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + if (m_bIsRegularMode ? target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1) : target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_POLYMORPH : H_SPELL_POLYMORPH); + Sheep_Timer = urand(15000, 17500); + }else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && m_creature->GetHealthPercent() < 20.0f) + { + DoCastSpellIfCan(m_creature,SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (!m_bIsRegularMode) + { + if (Slow_Timer < diff) + { + DoCastSpellIfCan(m_creature,H_SPELL_SLOW); + Slow_Timer = urand(15000, 40000); + }else Slow_Timer -= diff; + } + + if (Blink_Timer < diff) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCastSpellIfCan(target,SPELL_BLINK); + + float X = target->GetPositionX(); + float Y = target->GetPositionY(); + float Z = target->GetPositionZ(); + + m_creature->GetMap()->CreatureRelocation(m_creature,X,Y,Z,0.0f); + m_creature->SendMonsterMove(X, Y, Z, SPLINETYPE_NORMAL, SPLINEFLAG_WALKMODE, 1); + + DoCastSpellIfCan(target,SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = urand(35000, 40000); + }else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI(pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 0000000..2a2d65b --- /dev/null +++ b/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,70 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "sethekk_halls.h" + +#define IKISS_DOOR 177203 + +struct MANGOS_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + m_uiIkissDoorGUID = 0; + } + + void OnObjectCreate(GameObject* pGo) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case DATA_IKISSDOOREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILLISECONDS); + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/sethekk_halls/sethekk_halls.h b/scripts/outland/auchindoun/sethekk_halls/sethekk_halls.h new file mode 100644 index 0000000..e51ce8b --- /dev/null +++ b/scripts/outland/auchindoun/sethekk_halls/sethekk_halls.h @@ -0,0 +1,9 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +#define DATA_IKISSDOOREVENT 1 +#endif diff --git a/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 0000000..c23b37b --- /dev/null +++ b/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -0,0 +1,208 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "shadow_labyrinth.h" +#include "escort_ai.h" + +#define SAY_INTRO -1555000 + +#define SAY_AGGRO1 -1555001 +#define SAY_AGGRO2 -1555002 +#define SAY_AGGRO3 -1555003 + +#define SAY_HELP -1555004 + +#define SAY_SLAY1 -1555005 +#define SAY_SLAY2 -1555006 + +#define SAY_DEATH -1555007 + +#define SPELL_BANISH 30231 +#define SPELL_CORROSIVE_ACID 33551 +#define SPELL_FEAR 33547 +#define SPELL_ENRAGE 34970 + +struct MANGOS_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = urand(5000, 10000); + Fear_Timer = urand(25000, 30000); + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->HasAura(SPELL_BANISH, EFFECT_INDEX_0)) + return; + + npc_escortAI::MoveInLineOfSight(who); + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateEscortAI(const uint32 diff) + { + if (!Intro && !HasEscortState(STATE_ESCORT_ESCORTING)) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (CorrosiveAcid_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = urand(15000, 25000); + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_FEAR); + Fear_Timer = urand(20000, 35000); + }else Fear_Timer -= diff; + + if (!m_bIsRegularMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 0000000..ff07641 --- /dev/null +++ b/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,174 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct MANGOS_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (m_pInstance) + m_pInstance->SetData(TYPE_INCITER, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_INCITER, DONE); + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_INCITER, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer < diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + }else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_INCITE_CHAOS); + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (target && target->GetTypeId() == TYPEID_PLAYER) + target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + }else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, SPELL_CHARGE); + Charge_Timer = urand(15000, 25000); + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = urand(18000, 24000); + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI(pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 0000000..86d6373 --- /dev/null +++ b/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,233 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 75 +SDComment: Despawn all summoned on death not implemented. Void Traveler effects not implemented. +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_VOID_PORTAL_A 33566 //spell only summon one unit, but we use it for the visual effect and summon the 4 other portals manual way(only one spell exist) +#define SPELL_VOID_PORTAL_VISUAL 33569 +#define SPELL_SHADOW_BOLT_VOLLEY 32963 +#define SPELL_SUMMON_VOIDWALKER_A 33582 +#define SPELL_SUMMON_VOIDWALKER_B 33583 +#define SPELL_SUMMON_VOIDWALKER_C 33584 +#define SPELL_SUMMON_VOIDWALKER_D 33585 +#define SPELL_SUMMON_VOIDWALKER_E 33586 +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 +#define H_SPELL_BANISH 38791 + +#define ENTRY_VOID_PORTAL 19224 +#define ENTRY_VOID_TRAVELER 19226 + +#define LOCX -253.06f +#define LOCY -264.02f +#define LOCZ 17.08f + +struct MANGOS_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Intro = false; + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 Teleport_Timer; + uint32 VoidTraveler_Timer; + uint32 Banish_Timer; + bool Intro; + bool Teleport; + + void Reset() + { + ShadowBoltVolley_Timer = urand(7000, 14000); + DrawShadows_Timer = 40000; + Teleport_Timer = 1000; + VoidTraveler_Timer = 20000; + Banish_Timer = 25000; + Teleport = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_VORPIL, NOT_STARTED); + } + + void MoveInLineOfSight(Unit *who) + { + //not sure about right radius + if (!Intro && m_creature->IsWithinDistInMap(who, 50)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + DoCastSpellIfCan(m_creature, SPELL_VOID_PORTAL_A,true); + m_creature->SummonCreature(ENTRY_VOID_PORTAL, -262.40f, -229.57f, 17.08f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN,0); + m_creature->SummonCreature(ENTRY_VOID_PORTAL, -260.35f, -297.56f, 17.08f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN,0); + m_creature->SummonCreature(ENTRY_VOID_PORTAL, -292.05f, -270.37f, 12.68f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN,0); + m_creature->SummonCreature(ENTRY_VOID_PORTAL, -301.64f, -255.97f, 12.68f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN,0); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VORPIL, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_VOID_TRAVELER) + summoned->GetMotionMaster()->MoveFollow(m_creature, 1.0f, 0.0f); + + if (summoned->GetEntry() == ENTRY_VOID_PORTAL) + summoned->CastSpell(summoned,SPELL_VOID_PORTAL_VISUAL,true); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VORPIL, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Teleport) + { + if (Teleport_Timer <= diff) + { + m_creature->NearTeleportTo(LOCX, LOCY, LOCZ, 0.0f); + + float ranX = LOCX; + float ranY = LOCY; + float ranZ = LOCZ; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + target->GetRandomPoint(LOCX,LOCY,LOCZ,3.0f,ranX,ranY,ranZ); + DoTeleportPlayer(target,ranX,ranY,ranZ,m_creature->GetAngle(m_creature->GetPositionX(),m_creature->GetPositionY())); + } + } + Teleport = false; + + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_RAIN_OF_FIRE : H_SPELL_RAIN_OF_FIRE); + + Teleport_Timer = 1000; + }else Teleport_Timer -= diff; + } + + if (ShadowBoltVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOW_BOLT_VOLLEY); + ShadowBoltVolley_Timer = urand(15000, 30000); + }else ShadowBoltVolley_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DRAW_SHADOWS); + DrawShadows_Timer = 30000; + Teleport = true; + }else DrawShadows_Timer -= diff; + + if (VoidTraveler_Timer < diff) + { + DoScriptText(SAY_HELP, m_creature); + + switch(urand(0, 4)) + { + case 0: DoCastSpellIfCan(m_creature, SPELL_SUMMON_VOIDWALKER_A, CAST_TRIGGERED); break; + case 1: DoCastSpellIfCan(m_creature, SPELL_SUMMON_VOIDWALKER_B, CAST_TRIGGERED); break; + case 2: DoCastSpellIfCan(m_creature, SPELL_SUMMON_VOIDWALKER_C, CAST_TRIGGERED); break; + case 3: DoCastSpellIfCan(m_creature, SPELL_SUMMON_VOIDWALKER_D, CAST_TRIGGERED); break; + case 4: DoCastSpellIfCan(m_creature, SPELL_SUMMON_VOIDWALKER_E, CAST_TRIGGERED); break; + } + //faster rate when below (X) health? + VoidTraveler_Timer = 35000; + }else VoidTraveler_Timer -= diff; + + if (!m_bIsRegularMode) + { + if (Banish_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(target,H_SPELL_BANISH); + Banish_Timer = 35000; + }else Banish_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI(pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 0000000..8701bc8 --- /dev/null +++ b/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 75 +SDComment: Database should have `RegenHealth`=0 to prevent regen. Also, his shockwave triggered after magnetic pull may be incorrect. Murmur's Touch does not work properly. +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_BOOM_PRE 33923 +#define SPELL_SONIC_BOOM_CAST 38795 +#define SPELL_MURMURS_TOUCH 33711 +#define SPELL_RESONANCE 33657 +#define SPELL_SHOCKWAVE 33686 + +#define SPELL_SONIC_SHOCK 38797 //Heroic Spell +#define SPELL_THUNDERING_STORM 39365 //Heroic Spell + +struct MANGOS_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool CanSonicBoom; + bool CanShockWave; + uint64 m_uiPlayerTargetGUID; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = urand(8000, 20000); + Resonance_Timer = 5000; + MagneticPull_Timer = urand(15000, 30000); + SonicShock_Timer = urand(4000, 10000); + ThunderingStorm_Timer = 12000; //Casting directly after Sonic Boom. + CanSonicBoom = false; + CanShockWave = false; + m_uiPlayerTargetGUID = 0; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) + m_creature->SetHealth(hp); + } + + void SonicBoomEffect() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST, EFFECT_INDEX_1) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //SonicBoom_Timer + if (SonicBoom_Timer < diff) + { + if (CanSonicBoom) + { + DoCastSpellIfCan(m_creature, SPELL_SONIC_BOOM_CAST, CAST_TRIGGERED); + SonicBoomEffect(); + + CanSonicBoom = false; + SonicBoom_Timer = 30000; + } + else + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCastSpellIfCan(m_creature,SPELL_SONIC_BOOM_PRE); + CanSonicBoom = true; + SonicBoom_Timer = 5000; + } + }else SonicBoom_Timer -= diff; + + //MurmursTouch_Timer + if (MurmursTouch_Timer < diff) + { + /*Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + if (target) + DoCastSpellIfCan(target, SPELL_MURMURS_TOUCH);*/ + DoCastSpellIfCan(m_creature, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = urand(25000, 35000); + }else MurmursTouch_Timer -= diff; + + //Resonance_Timer + if (!CanSonicBoom && !m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + if (Resonance_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_RESONANCE); + Resonance_Timer = m_bIsRegularMode ? 5000 : 3000; + }else Resonance_Timer -= diff; + } + + if (!m_bIsRegularMode) + { + if (SonicShock_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = urand(8000, 12000); + }else SonicShock_Timer -= diff; + + if (ThunderingStorm_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_THUNDERING_STORM); + ThunderingStorm_Timer = 12000; + }else ThunderingStorm_Timer -= diff; + } + + //MagneticPull_Timer + if (MagneticPull_Timer < diff) + { + if (!CanShockWave) + { + if (Unit* temp = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (temp->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(temp, SPELL_MAGNETIC_PULL); + m_uiPlayerTargetGUID = temp->GetGUID(); + CanShockWave = true; + } + MagneticPull_Timer = 2500; + } + } + else + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerTargetGUID)) + pPlayer->CastSpell(pPlayer, SPELL_SHOCKWAVE, true); + + MagneticPull_Timer = urand(15000, 30000); + CanShockWave = false; + m_uiPlayerTargetGUID = 0; + } + }else MagneticPull_Timer -= diff; + + //no meele if preparing for sonic boom + if (!CanSonicBoom) + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI(pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 0000000..dacde3d --- /dev/null +++ b/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "shadow_labyrinth.h" + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct MANGOS_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("SD2: Shadow Labyrinth: counting %u Fel Overseers.", m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("SD2: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("SD2: Shadow Labyrinth: %u Fel Overseers left to kill.", m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("SD2: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case TYPE_INCITER: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case TYPE_VORPIL: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case TYPE_MURMUR: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (uiType == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_HELLMAW: + return m_auiEncounter[0]; + case TYPE_OVERSEER: + return m_auiEncounter[1]; + } + return false; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h b/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h new file mode 100644 index 0000000..b6a1d40 --- /dev/null +++ b/scripts/outland/auchindoun/shadow_labyrinth/shadow_labyrinth.h @@ -0,0 +1,22 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +enum +{ + MAX_ENCOUNTER = 5, + + TYPE_HELLMAW = 1, + TYPE_OVERSEER = 2, + TYPE_INCITER = 3, + TYPE_VORPIL = 4, + TYPE_MURMUR = 5, + + GO_REFECTORY_DOOR = 183296, //door opened when blackheart the inciter dies + GO_SCREAMING_HALL_DOOR = 183295 //door opened when grandmaster vorpil dies +}; + +#endif diff --git a/scripts/outland/black_temple/black_temple.cpp b/scripts/outland/black_temple/black_temple.cpp new file mode 100644 index 0000000..aaac9d8 --- /dev/null +++ b/scripts/outland/black_temple/black_temple.cpp @@ -0,0 +1,68 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Black_Temple +SD%Complete: 95 +SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. +SDCategory: Black Temple +EndScriptData */ + +/* ContentData +npc_spirit_of_olum +EndContentData */ + +#include "precompiled.h" +#include "black_temple.h" + +/*### +# npc_spirit_of_olum +####*/ + +#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's +#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" + +bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + if (pInstance && (pInstance->GetData(TYPE_SUPREMUS) >= DONE) && (pInstance->GetData(TYPE_NAJENTUS) >= DONE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CLOSE_GOSSIP_MENU(); + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); + return true; +} + +void AddSC_black_temple() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_spirit_of_olum"; + newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; + newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/black_temple.h b/scripts/outland/black_temple/black_temple.h new file mode 100644 index 0000000..c32938d --- /dev/null +++ b/scripts/outland/black_temple/black_temple.h @@ -0,0 +1,45 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLACK_TEMPLE_H +#define DEF_BLACK_TEMPLE_H + +enum +{ + MAX_ENCOUNTER = 9, + + TYPE_NAJENTUS = 1, + TYPE_SUPREMUS = 2, + TYPE_SHADE = 3, + TYPE_GOREFIEND = 4, + TYPE_BLOODBOIL = 5, + TYPE_RELIQUIARY = 6, + TYPE_SHAHRAZ = 7, + TYPE_COUNCIL = 8, + TYPE_ILLIDAN = 9, + + DATA_HIGHWARLORDNAJENTUS = 10, + DATA_SUPREMUS = 11, + DATA_SHADEOFAKAMA = 12, + DATA_AKAMA_SHADE = 13, + DATA_ILLIDARICOUNCIL = 14, + DATA_BLOOD_ELF_COUNCIL_VOICE = 15, + DATA_LADYMALANDE = 16, + DATA_HIGHNETHERMANCERZEREVOR = 17, + DATA_GATHIOSTHESHATTERER = 18, + DATA_VERASDARKSHADOW = 19, + DATA_AKAMA = 20, + DATA_ILLIDANSTORMRAGE = 21, + + DATA_GAMEOBJECT_NAJENTUS_GATE = 22, + DATA_GAMEOBJECT_SUPREMUS_DOORS = 23, + DATA_GO_PRE_SHAHRAZ_DOOR = 24, + DATA_GO_POST_SHAHRAZ_DOOR = 25, + DATA_GO_COUNCIL_DOOR = 26, + DATA_GAMEOBJECT_ILLIDAN_GATE = 27, + DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 28, + DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 29 +}; + +#endif diff --git a/scripts/outland/black_temple/boss_bloodboil.cpp b/scripts/outland/black_temple/boss_bloodboil.cpp new file mode 100644 index 0000000..8234862 --- /dev/null +++ b/scripts/outland/black_temple/boss_bloodboil.cpp @@ -0,0 +1,347 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Bloodboil +SD%Complete: 85 +SDComment: Bloodboil not working correctly +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +//Speech'n'Sound +#define SAY_AGGRO -1564029 +#define SAY_SLAY1 -1564030 +#define SAY_SLAY2 -1564031 +#define SAY_SPECIAL1 -1564032 +#define SAY_SPECIAL2 -1564033 +#define SAY_ENRAGE1 -1564034 +#define SAY_ENRAGE2 -1564035 +#define SAY_DEATH -1564036 + +//Spells +#define SPELL_ACID_GEYSER 40630 +#define SPELL_ACIDIC_WOUND 40481 +#define SPELL_ARCING_SMASH 40599 +#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be +#define SPELL_FEL_ACID 40508 +#define SPELL_FEL_RAGE_SELF 40594 +#define SPELL_FEL_RAGE_TARGET 40604 +#define SPELL_FEL_RAGE_2 40616 +#define SPELL_FEL_RAGE_3 41625 +#define SPELL_BEWILDERING_STRIKE 40491 +#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) +#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) +#define SPELL_TAUNT_GURTOGG 40603 +#define SPELL_INSIGNIFIGANCE 40618 +#define SPELL_BERSERK 45078 +#define SPELL_ENRAGE 27680 + +struct MANGOS_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI +{ + boss_gurtogg_bloodboilAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 TargetGUID; + + float TargetThreat; + + uint32 BloodboilTimer; + uint32 BloodboilCount; + uint32 AcidGeyserTimer; + uint32 AcidicWoundTimer; + uint32 ArcingSmashTimer; + uint32 EnrageTimer; + uint32 FelAcidTimer; + uint32 EjectTimer; + uint32 BewilderingStrikeTimer; + uint32 PhaseChangeTimer; + uint32 m_uiEnrageTimer; + + bool Phase1; + + void Reset() + { + TargetGUID = 0; + + TargetThreat = 0; + + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidGeyserTimer = 1000; + AcidicWoundTimer = 6000; + ArcingSmashTimer = 19000; + EnrageTimer = 600000; + FelAcidTimer = 25000; + EjectTimer = 10000; + BewilderingStrikeTimer = 15000; + PhaseChangeTimer = 60000; + m_uiEnrageTimer = 600000; + + Phase1 = true; + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BLOODBOIL, NOT_STARTED); + } + + void Aggro(Unit *who) + { + m_creature->SetInCombatWithZone(); + + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BLOODBOIL, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BLOODBOIL, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. + void CastBloodboil() + { + // Get the Threat List + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + + // He doesn't have anyone in his threatlist, useless to continue + if (tList.empty()) + return; + + std::list targets; + + //store the threat list in a different container + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit *target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //Sort the list of players + targets.sort(ObjectDistanceOrderReversed(m_creature)); + //Resize so we only get top 5 + targets.resize(5); + + //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp + /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); + if (spellInfo) + { + for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + Unit* target = *itr; + if (!target) return; + for(uint32 i = 0;i<3; ++i) + { + uint8 eff = spellInfo->Effect[i]; + if (eff>=TOTAL_SPELL_EFFECTS) + continue; + + Aura *Aur = new Aura(spellInfo, i, NULL, target); + target->AddAura(Aur); + } + } + }*/ + } + + void RevertThreatOnTarget(uint64 guid) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(guid)) + { + if (m_creature->getThreatManager().getThreat(pPlayer)) + m_creature->getThreatManager().modifyThreatPercent(pPlayer, -100); + + if (TargetThreat) + m_creature->AddThreat(pPlayer, TargetThreat); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (ArcingSmashTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCING_SMASH); + ArcingSmashTimer = 10000; + }else ArcingSmashTimer -= diff; + + if (FelAcidTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FEL_ACID); + FelAcidTimer = 25000; + }else FelAcidTimer -= diff; + + if (!m_creature->HasAura(SPELL_BERSERK, EFFECT_INDEX_0)) + { + if (EnrageTimer < diff) + { + if (DoCastSpellIfCan(m_creature, SPELL_BERSERK) == CAST_OK) + DoScriptText(urand(0, 1) ? SAY_ENRAGE1 : SAY_ENRAGE2, m_creature); + }else EnrageTimer -= diff; + } + + if (Phase1) + { + if (BewilderingStrikeTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE); + float mt_threat = m_creature->getThreatManager().getThreat(m_creature->getVictim()); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1)) + m_creature->AddThreat(target, mt_threat); + + BewilderingStrikeTimer = 20000; + }else BewilderingStrikeTimer -= diff; + + if (EjectTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_EJECT1); + m_creature->getThreatManager().modifyThreatPercent(m_creature->getVictim(), -40); + EjectTimer = 15000; + }else EjectTimer -= diff; + + if (AcidicWoundTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ACIDIC_WOUND); + AcidicWoundTimer = 10000; + }else AcidicWoundTimer -= diff; + + if (BloodboilTimer < diff) + { + if (BloodboilCount < 5) // Only cast it five times. + { + //CastBloodboil(); // Causes issues on windows, so is commented out. + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BLOODBOIL); + ++BloodboilCount; + BloodboilTimer = 10000*BloodboilCount; + } + }else BloodboilTimer -= diff; + } + + if (!Phase1) + { + if (AcidGeyserTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ACID_GEYSER); + AcidGeyserTimer = 30000; + }else AcidGeyserTimer -= diff; + + if (EjectTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_EJECT2); + EjectTimer = 15000; + }else EjectTimer -= diff; + } + + if (PhaseChangeTimer < diff) + { + if (Phase1) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (target && target->isAlive()) + { + Phase1 = false; + + TargetThreat = m_creature->getThreatManager().getThreat(target); + TargetGUID = target->GetGUID(); + target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true); + + if (m_creature->getThreatManager().getThreat(target)) + m_creature->getThreatManager().modifyThreatPercent(target, -100); + + m_creature->AddThreat(target, 50000000.0f); + + // If VMaps are disabled, this spell can call the whole instance + DoCastSpellIfCan(m_creature, SPELL_INSIGNIFIGANCE, CAST_TRIGGERED); + DoCastSpellIfCan(target, SPELL_FEL_RAGE_TARGET, CAST_TRIGGERED); + DoCastSpellIfCan(target, SPELL_FEL_RAGE_2, CAST_TRIGGERED); + + /* These spells do not work, comment them out for now. + DoCastSpellIfCan(target, SPELL_FEL_RAGE_2, CAST_TRIGGERED); + DoCastSpellIfCan(target, SPELL_FEL_RAGE_3, CAST_TRIGGERED);*/ + + //Cast this without triggered so that it appears in combat logs and shows visual. + DoCastSpellIfCan(m_creature, SPELL_FEL_RAGE_SELF); + + DoScriptText(urand(0, 1) ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); + + AcidGeyserTimer = 1000; + PhaseChangeTimer = 30000; + } + }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage + { + if (TargetGUID) + RevertThreatOnTarget(TargetGUID); + + TargetGUID = 0; + Phase1 = true; + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidicWoundTimer += 2000; + ArcingSmashTimer += 2000; + FelAcidTimer += 2000; + EjectTimer += 2000; + PhaseChangeTimer = 60000; + } + }else PhaseChangeTimer -= diff; + + //Enrage + if (m_uiEnrageTimer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + m_uiEnrageTimer = 60000; + }else m_uiEnrageTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) +{ + return new boss_gurtogg_bloodboilAI(pCreature); +} + +void AddSC_boss_gurtogg_bloodboil() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gurtogg_bloodboil"; + newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_illidan.cpp b/scripts/outland/black_temple/boss_illidan.cpp new file mode 100644 index 0000000..4a586aa --- /dev/null +++ b/scripts/outland/black_temple/boss_illidan.cpp @@ -0,0 +1,2479 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Illidan_Stormrage +SD%Complete: 90 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" +#include "WorldPacket.h" + +/**** Creature Summon and Recognition IDs ****/ +enum CreatureEntry +{ + EMPTY = 0, + AKAMA = 22990, + ILLIDAN_STORMRAGE = 22917, + BLADE_OF_AZZINOTH = 22996, + FLAME_OF_AZZINOTH = 22997, + MAIEV_SHADOWSONG = 23197, + SHADOW_DEMON = 23375, + DEMON_FIRE = 23069, + FLAME_CRASH = 23336, + ILLIDAN_DOOR_TRIGGER = 23412, + SPIRIT_OF_OLUM = 23411, + SPIRIT_OF_UDALO = 23410, + ILLIDARI_ELITE = 23226, + PARASITIC_SHADOWFIEND = 23498, + CAGE_TRAP_TRIGGER = 23292, +}; + +/************* Quotes and Sounds ***********************/ +// Gossip for when a player clicks Akama +#define GOSSIP_ITEM "We are ready to face Illidan" + +#define SAY_CONVO_1 -1564097 +#define SAY_CONVO_2 -1564098 +#define SAY_CONVO_3 -1564099 +#define SAY_CONVO_4 -1564100 +#define SAY_CONVO_5 -1564101 +#define SAY_CONVO_6 -1564102 +#define SAY_CONVO_7 -1564103 +#define SAY_CONVO_8 -1564104 +#define SAY_CONVO_9 -1564105 +#define SAY_CONVO_10 -1564106 +#define SAY_CONVO_11 -1564107 +#define SAY_CONVO_12 -1564108 +#define SAY_CONVO_13 -1564109 +#define SAY_CONVO_14 -1564110 +#define SAY_CONVO_15 -1564111 + +#define SAY_TAUNT_1 -1564112 +#define SAY_TAUNT_2 -1564113 +#define SAY_TAUNT_3 -1564114 +#define SAY_TAUNT_4 -1564115 + +#define SAY_MAIEV_TAUNT_1 -1564116 +#define SAY_MAIEV_TAUNT_2 -1564117 +#define SAY_MAIEV_TAUNT_3 -1564118 +#define SAY_MAIEV_TAUNT_4 -1564119 + +//emote only defined if not related to textId (in database) +struct Yells +{ + int32 textId; + uint32 creature, timer, emote; + bool Talk; +}; + +static Yells Conversation[]= +{ + {SAY_CONVO_1, ILLIDAN_STORMRAGE, 8000, 0, true}, + {0, ILLIDAN_STORMRAGE, 5000, 396, true}, + {SAY_CONVO_2, AKAMA, 7000, 0, true}, + {0, AKAMA, 5000, 66, true}, + {SAY_CONVO_3, ILLIDAN_STORMRAGE, 8000, 0, true}, + {SAY_CONVO_4, AKAMA, 3000, 0, true}, + {0, AKAMA, 2000, 15, true}, + {SAY_CONVO_5, ILLIDAN_STORMRAGE, 3000, 0, true}, + {0, EMPTY, 1000, 0, true}, + {0, EMPTY, 0, 0, false}, + {SAY_CONVO_6, ILLIDAN_STORMRAGE, 8000, 0, true}, + {SAY_CONVO_7, MAIEV_SHADOWSONG, 8000, 0, true}, + {SAY_CONVO_8, ILLIDAN_STORMRAGE, 7000, 0, true}, + {SAY_CONVO_9, MAIEV_SHADOWSONG, 8000, 0, true}, + {SAY_CONVO_10, ILLIDAN_STORMRAGE, 1000, 0, false}, + {SAY_CONVO_11, MAIEV_SHADOWSONG, 6000, 0, true}, + // Emote dead for now. Kill him later + {SAY_CONVO_12, ILLIDAN_STORMRAGE, 22000, 0, true}, + {SAY_CONVO_13, MAIEV_SHADOWSONG, 9000, 0, true}, + {SAY_CONVO_14, MAIEV_SHADOWSONG, 0, true}, + {SAY_CONVO_15, AKAMA, 8000, 0, true}, + {0, EMPTY, 1000, 0, false} +}; + +static Yells RandomTaunts[]= +{ + {SAY_TAUNT_1, ILLIDAN_STORMRAGE, 0, 0, false}, + {SAY_TAUNT_2, ILLIDAN_STORMRAGE, 0, 0, false}, + {SAY_TAUNT_3, ILLIDAN_STORMRAGE, 0, 0, false}, + {SAY_TAUNT_4, ILLIDAN_STORMRAGE, 0, 0, false} +}; + +static Yells MaievTaunts[]= +{ + {SAY_MAIEV_TAUNT_1, MAIEV_SHADOWSONG, 0, 0, false}, + {SAY_MAIEV_TAUNT_2, MAIEV_SHADOWSONG, 0, 0, false}, + {SAY_MAIEV_TAUNT_3, MAIEV_SHADOWSONG, 0, 0, false}, + {SAY_MAIEV_TAUNT_4, MAIEV_SHADOWSONG, 0, 0, false} +}; + +// Yells for/by Akama +#define SAY_AKAMA_BEWARE -1564120 +#define SAY_AKAMA_MINION -1564121 +#define SAY_AKAMA_LEAVE -1564122 + +// Self explanatory +#define SAY_KILL1 -1564123 +#define SAY_KILL2 -1564124 + +// I think I'll fly now and let my subordinates take you on +#define SAY_TAKEOFF -1564125 +#define SAY_SUMMONFLAMES -1564126 + +// When casting Eye Blast. Demon Fire will be appear on places that he casts this +#define SAY_EYE_BLAST -1564127 + +// kk, I go big, dark and demon on you. +#define SAY_MORPH -1564128 + +// I KILL! +#define SAY_ENRAGE -1564129 + +/************** Spells *************/ +// Normal Form +#define SPELL_SHEAR 41032 // Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast +#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. +#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) +#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) +#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( +#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY +#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY +// Flying (Phase 2) +#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground +#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell +#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan +#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. +#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. +// Demon Form +#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) +#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) +#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) +#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. +#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. +#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) +#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Handled by core (41126 triggers 41131) +// Other Illidan spells +#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to Wilson). +#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. +#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. +#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% + +// Non-Illidan spells +#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit +#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit +#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... +#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. +#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. +#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. +#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them +#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target +#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target +#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. +#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius +#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. +#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons +#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds +#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature +#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. +#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards +#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) +#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' +#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. +#define SPELL_CHARGE 40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. +#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev +#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends + +// Other defines +#define CENTER_X 676.740f +#define CENTER_Y 305.297f +#define CENTER_Z 353.192f + +#define EQUIP_ID_MAIN_HAND 32837 +#define EQUIP_ID_OFF_HAND 32838 + +/*** Phase Names ***/ +enum Phase +{ + PHASE_NORMAL = 1, + PHASE_FLIGHT = 2, + PHASE_NORMAL_2 = 3, + PHASE_DEMON = 4, + PHASE_NORMAL_MAIEV = 5, + PHASE_DEMON_SEQUENCE = 6, +}; + +struct Locations +{ + float x, y, z; + uint32 id; +}; + +static Locations GlaivePosition[]= +{ + {695.105f, 305.303f, 354.256f}, + {659.338f, 305.303f, 354.256f}, + {700.105f, 305.303f, 354.256f}, + {664.338f, 305.303f, 354.256f} +}; + +static Locations EyeBlast[]= +{ + {650.697f, 320.128f, 353.730f}, + {652.799f, 275.091f, 353.367f}, + {701.527f, 273.815f, 353.230f}, + {709.865f, 325.654f, 353.322f} +}; + +static Locations AkamaWP[]= +{ + {770.01f, 304.50f, 312.29f}, // Bottom of the first stairs, at the doors + {780.66f, 304.50f, 319.74f}, // Top of the first stairs + {790.13f, 319.68f, 319.76f}, // Bottom of the second stairs (left from the entrance) + {787.17f, 347.38f, 341.42f}, // Top of the second stairs + {781.34f, 350.31f, 341.44f}, // Bottom of the third stairs + {762.60f, 361.06f, 353.60f}, // Top of the third stairs + {756.35f, 360.52f, 353.27f}, // Before the door-thingy + {743.82f, 342.21f, 353.00f}, // Somewhere further + {732.69f, 305.13f, 353.00f}, // In front of Illidan + {738.11f, 365.44f, 353.00f}, // in front of the door-thingy (the other one!) + {792.18f, 366.62f, 341.42f}, // Down the first flight of stairs + {796.84f, 304.89f, 319.76f}, // Down the second flight of stairs + {782.01f, 304.55f, 319.76f} // Final location - back at the initial gates. This is where he will fight the minions! +}; +// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned +static Locations SpiritSpawns[]= +{ + {755.5426f, 309.9156f, 312.2129f, SPIRIT_OF_UDALO}, + {755.5426f, 298.7923f, 312.0834f, SPIRIT_OF_OLUM} +}; + +struct WayPoints +{ + WayPoints(uint32 _id, float _x, float _y, float _z) + { + id = _id; + x = _x; + y = _y; + z = _z; + } + uint32 id; + float x, y, z; +}; + +struct Animation // For the demon transformation +{ + uint32 aura, unaura, timer, size, displayid, phase; + bool equip; +}; + +static Animation DemonTransformation[]= +{ + {SPELL_DEMON_TRANSFORM_1, 0, 1300, 0, 0, 6, true}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, + {SPELL_DEMON_FORM, 0, 3000, 1073741824, 21322, 6, false}, + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, + {0, 0, 0, 0, 0, 4, false}, + {SPELL_DEMON_TRANSFORM_1, 0, 1500, 0, 0, 6, false}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, + {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, + {0, 0, 0, 0, 0, 8, true} +}; + +/**** Demon Fire will be used for Eye Blast. Illidan needs to have access to it's vars and functions, so we'll set it here ****/ +struct MANGOS_DLL_DECL demonfireAI : public ScriptedAI +{ + demonfireAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 IllidanGUID; + + bool IsTrigger; + + uint32 CheckTimer; + uint32 DemonFireTimer; + uint32 DespawnTimer; + + void Reset() + { + IllidanGUID = 0; + + IsTrigger = false; + + CheckTimer = 2000; + DemonFireTimer = 0; + DespawnTimer = 45000; + } + + void AttackStart(Unit* who) { } + void MoveInLineOfSight(Unit *who){ } + + void UpdateAI(const uint32 diff) + { + if (IsTrigger) + return; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (CheckTimer < diff) + { + if (!IllidanGUID && m_pInstance) + { + if (Creature* pIllidan = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_ILLIDANSTORMRAGE))) + { + IllidanGUID = m_pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + + if (!pIllidan->HasSplineFlag(SPLINEFLAG_NO_SPLINE)) + m_creature->SetDeathState(JUST_DIED); + } + } + CheckTimer = 2000; + }else CheckTimer -= diff; + + if (DemonFireTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_DEMON_FIRE); + DemonFireTimer = 30000; + }else DemonFireTimer -= diff; + + if (DespawnTimer < diff) + m_creature->SetDeathState(JUST_DIED); + else DespawnTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +/******* Functions and vars for Akama's AI ******/ +struct MANGOS_DLL_DECL npc_akama_illidanAI : public ScriptedAI +{ + npc_akama_illidanAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + WayPointList.clear(); + Reset(); + } + + /* Instance Data */ + ScriptedInstance* m_pInstance; + + /* Timers */ + uint32 ChannelTimer; + uint32 TalkTimer; + uint32 WalkTimer; + uint32 SummonMinionTimer; + + /* GUIDs */ + uint64 IllidanGUID; + uint64 PlayerGUID; + uint64 SpiritGUID[2]; + uint64 ChannelGUID; + + bool IsTalking; + bool StartChanneling; + bool DoorOpen; + bool FightMinions; + bool IsReturningToIllidan; + bool IsWalking; + uint32 TalkCount; + uint32 ChannelCount; + + std::list WayPointList; + std::list::iterator WayPoint; + + void BeginEvent(uint64 PlayerGUID); + + void Reset() + { + if (m_pInstance) + { + m_pInstance->SetData(TYPE_ILLIDAN, NOT_STARTED); + GameObject* pGate = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE)); + + // close door if already open (when raid wipes or something) + if (pGate && !pGate->GetGoState()) + pGate->SetGoState(GO_STATE_READY); + + for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) + { + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(i))) + pDoor->SetGoState(GO_STATE_ACTIVE); + } + } + + IllidanGUID = 0; + PlayerGUID = 0; + ChannelGUID = 0; + for(uint8 i = 0; i < 2; ++i) SpiritGUID[i] = 0; + + ChannelTimer = 0; + ChannelCount = 0; + SummonMinionTimer = 2000; + + WalkTimer = 0; + IsWalking = false; + + TalkTimer = 0; + TalkCount = 0; + + KillAllElites(); + + IsReturningToIllidan = false; + FightMinions = false; + IsTalking = false; + StartChanneling = false; + DoorOpen = false; + + // Database sometimes has strange values.. + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetVisibility(VISIBILITY_ON); + } + + // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + } + + void KillAllElites() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pUnit && pUnit->GetTypeId() == TYPEID_UNIT && pUnit->GetEntry() == ILLIDARI_ELITE) + pUnit->SetDeathState(JUST_DIED); + } + } + + void ReturnToIllidan() + { + KillAllElites(); + FightMinions = false; + IsReturningToIllidan = true; + WayPoint = WayPointList.begin(); + m_creature->SetSpeedRate(MOVE_RUN, 2.0f); + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + IsWalking = true; + } + + void AddWaypoint(uint32 id, float x, float y, float z) + { + WayPoints AWP(id, x, y, z); + WayPointList.push_back(AWP); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth() && (done_by->GetGUID() != m_creature->GetGUID())) + { + damage = 0; + DoCastSpellIfCan(m_creature, SPELL_HEALING_POTION); + } + } + + void BeginDoorEvent(Player* pPlayer) + { + if (!m_pInstance) + return; + + debug_log("SD2: Akama - Door event initiated by player %s", pPlayer->GetName()); + PlayerGUID = pPlayer->GetGUID(); + + if (GameObject* pGate = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE))) + { + float x,y,z; + pGate->GetPosition(x, y, z); + Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); + if (Channel) + { + ChannelGUID = Channel->GetGUID(); + + // Invisible but spell visuals can still be seen. + Channel->SetDisplayId(11686); + Channel->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + float PosX, PosY, PosZ; + m_creature->GetPosition(PosX, PosY, PosZ); + for(uint8 i = 0; i < 2; ++i) + { + Creature* Spirit = m_creature->SummonCreature(SpiritSpawns[i].id, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); + if (Spirit) + { + Spirit->SetVisibility(VISIBILITY_OFF); + SpiritGUID[i] = Spirit->GetGUID(); + } + } + + StartChanneling = true; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoCastSpellIfCan(Channel, SPELL_AKAMA_DOOR_FAIL); + } + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE || !IsWalking) + return; + + if (WayPoint->id != id) + return; + + switch(id) + { + case 6: + if (!IsReturningToIllidan) + { + // open the doors that close the summit + for(uint32 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L+1; ++i) + { + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(i))) + pDoor->SetGoState(GO_STATE_ACTIVE); + } + } + break; + case 7: + if (IsReturningToIllidan) + { + IsWalking = false; + if (IllidanGUID) + { + Creature* Illidan = m_creature->GetMap()->GetCreature(IllidanGUID); + if (Illidan) + { + float dx = Illidan->GetPositionX() + rand()%15; + float dy = Illidan->GetPositionY() + rand()%15; + m_creature->GetMotionMaster()->MovePoint(13, dx, dy, Illidan->GetPositionZ()); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); + } + } + } + break; + case 8: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (!IsReturningToIllidan) + { + IsWalking = false; + BeginEvent(PlayerGUID); + } + break; + case 12: + IsWalking = false; + FightMinions = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + break; + } + + ++WayPoint; + WalkTimer = 200; + } + + void DeleteFromThreatList() + { + // If we do not have Illidan's GUID, do not proceed + if (!IllidanGUID) + return; + + // Create a pointer to Illidan + Creature* Illidan = m_creature->GetMap()->GetCreature(IllidanGUID); + + // No use to continue if Illidan does not exist + if (!Illidan) + return; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + // Loop through threatlist till our GUID is found in it. + if ((*itr)->getUnitGuid() == m_creature->GetGUID()) + { + (*itr)->removeReference(); // Delete ourself from his threatlist. + return; // No need to continue anymore. + } + } + + // Now we delete our threatlist to prevent attacking anyone for now + m_creature->DeleteThreatList(); + } + + void UpdateAI(const uint32 diff) + { + if (IllidanGUID) + { + if (Creature* Illidan = m_creature->GetMap()->GetCreature(IllidanGUID)) + { + if (Illidan->IsInEvadeMode() && !m_creature->IsInEvadeMode()) + EnterEvadeMode(); + + if (Illidan->GetHealthPercent() < 85.0f && m_creature->isInCombat() && !FightMinions) + { + if (TalkTimer < diff) + { + switch(TalkCount) + { + case 0: + DoScriptText(SAY_AKAMA_MINION, Illidan); + TalkTimer = 8000; + TalkCount = 1; + break; + case 1: + DoScriptText(SAY_AKAMA_LEAVE, m_creature); + TalkTimer = 3000; + TalkCount = 2; + break; + case 2: + IsTalking = true; + TalkTimer = 2000; + m_creature->RemoveAllAuras(); + m_creature->CombatStop(true); + m_creature->AttackStop(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + TalkCount = 3; + break; + case 3: + DeleteFromThreatList(); + IsWalking = true; + WayPoint = WayPointList.begin(); + std::advance(WayPoint, 9); + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + break; + } + }else TalkTimer -= diff; + } + + if (Illidan->GetHealthPercent() < 4.0f && !IsReturningToIllidan) + ReturnToIllidan(); + } + }else + { + if (m_pInstance) + IllidanGUID = m_pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + } + + if (IsWalking && WalkTimer) + { + if (WalkTimer <= diff) + { + if (WayPoint == WayPointList.end()) + return; + + m_creature->GetMotionMaster()->MovePoint(WayPoint->id, WayPoint->x, WayPoint->y,WayPoint->z); + WalkTimer = 0; + }else WalkTimer -= diff; + } + + if (StartChanneling) + { + if (ChannelTimer < diff) + { + switch(ChannelCount) + { + case 3: + if (!DoorOpen) + { + m_creature->InterruptNonMeleeSpells(true); + + for(uint8 i = 0; i < 2; ++i) + { + if (SpiritGUID[i]) + { + Creature* Spirit = m_creature->GetMap()->GetCreature(SpiritGUID[i]); + if (Spirit) + Spirit->InterruptNonMeleeSpells(true); + } + } + + if (GameObject* pGate = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE))) + pGate->SetGoState(GO_STATE_ACTIVE); + + ++ChannelCount; + ChannelTimer = 5000; + } + break; + case 4: + m_creature->HandleEmote(EMOTE_ONESHOT_SALUTE); + ChannelTimer = 2000; + ++ChannelCount; + break; + case 5: + DoScriptText(SAY_AKAMA_BEWARE, m_creature); + if (ChannelGUID) + { + Creature* ChannelTarget = m_creature->GetMap()->GetCreature(ChannelGUID); + if (ChannelTarget) + ChannelTarget->SetDeathState(JUST_DIED); + ChannelGUID = 0; + } + for(uint8 i = 0; i < 2; ++i) + { + if (SpiritGUID[i]) + { + Creature* Spirit = m_creature->GetMap()->GetCreature(SpiritGUID[i]); + if (Spirit) + Spirit->SetDeathState(JUST_DIED); + } + } + ChannelTimer = 6000; + ++ChannelCount; + break; + case 6: + StartChanneling = false; + if (WayPointList.empty()) + { + error_log("SD2: Akama has no waypoints to start with!"); + return; + } + + WayPoint = WayPointList.begin(); + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->GetMotionMaster()->MovePoint(WayPoint->id, WayPoint->x, WayPoint->y, WayPoint->z); + IsWalking = true; + break; + default: + if (ChannelGUID) + { + Creature* Channel = m_creature->GetMap()->GetCreature(ChannelGUID); + if (Channel) + { + m_creature->InterruptNonMeleeSpells(true); + + for(uint8 i = 0; i < 2; ++i) + { + if (SpiritGUID[i]) + { + Creature* Spirit = m_creature->GetMap()->GetCreature(SpiritGUID[i]); + if (Spirit) + { + Spirit->InterruptNonMeleeSpells(true); + if (ChannelCount%2 == 0) + { + Spirit->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + DoCastSpellIfCan(Channel, SPELL_AKAMA_DOOR_CHANNEL); + } + else + { + if (Spirit->GetVisibility() == VISIBILITY_OFF) + Spirit->SetVisibility(VISIBILITY_ON); + } + } + } + } + if (ChannelCount < 3) + ++ChannelCount; + ChannelTimer = 10000; + } + } + break; + } + }else ChannelTimer -= diff; + } + + if (FightMinions) + { + if (SummonMinionTimer < diff) + { + if (IllidanGUID) + { + Creature* Illidan = m_creature->GetMap()->GetCreature(IllidanGUID); + if (!Illidan || Illidan->IsInEvadeMode()) + { + Reset(); + EnterEvadeMode(); + return; + } + } + + float x,y,z; + m_creature->GetPosition(x,y,z); + Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + if (Elite) + { + Elite->AI()->AttackStart(m_creature); + Elite->AddThreat(m_creature, 1000000.0f); + AttackStart(Elite); + } + SummonMinionTimer = urand(10000, 16000); + }else SummonMinionTimer -= diff; + } + + // If we don't have a target, or is talking, or has run away, return + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; + + DoMeleeAttackIfReady(); + } +}; + +/************************************** Illidan's AI ***************************************/ +struct MANGOS_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI +{ + boss_illidan_stormrageAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + for(uint8 i = 0; i < 2; ++i) + { + FlameGUID[i] = 0; + GlaiveGUID[i] = 0; + } + + AkamaGUID = 0; + MaievGUID = 0; + + Reset(); + } + + /** Instance Data **/ + ScriptedInstance* m_pInstance; + + /** Generic **/ + bool IsTalking; + bool HasSummoned; + bool RefaceVictim; + bool InformAkama; + uint32 Phase; + uint32 GlobalTimer; + uint32 TalkCount; + uint32 DemonFormSequence; + + /** GUIDs **/ + uint64 FlameGUID[2]; + uint64 GlaiveGUID[2]; + uint64 AkamaGUID; + uint64 MaievGUID; + + /** Timers **/ + uint32 ShearTimer; + uint32 DrawSoulTimer; + uint32 FlameCrashTimer; + uint32 ParasiticShadowFiendTimer; + uint32 FireballTimer; + uint32 EyeBlastTimer; + uint32 DarkBarrageTimer; + uint32 SummonBladesTimer; // Animate summoning the Blades of Azzinoth in Phase 2 + uint32 SummonFlamesTimer; // Summon Flames of Azzinoth in Phase 2 + uint32 CheckFlamesTimer; // This is used to check the status of the Flames to see if we should begin entering Phase 3 or not. + uint32 RetrieveBladesTimer; // Animate retrieving the Blades of Azzinoth in Phase 2 -> 3 transition + uint32 LandTimer; // This is used at the end of phase 2 to signal Illidan landing after Flames are dead + uint32 AgonizingFlamesTimer; + uint32 ShadowBlastTimer; + uint32 FlameBurstTimer; + uint32 ShadowDemonTimer; + uint32 TalkTimer; + uint32 TransformTimer; + uint32 EnrageTimer; + uint32 CageTimer; + uint32 LayTrapTimer; + uint32 AnimationTimer; + uint32 TauntTimer; // This is used for his random yells + uint32 FaceVictimTimer; + uint32 BerserkTimer; + + void Reset() + { + Phase = PHASE_NORMAL; + + // Check if any flames/glaives are alive/existing. Kill if alive and set GUIDs to 0 + for(uint8 i = 0; i < 2; ++i) + { + if (Creature* Flame = m_creature->GetMap()->GetCreature(FlameGUID[i])) + { + if (Flame->isAlive()) + Flame->SetDeathState(JUST_DIED); + + FlameGUID[i] = 0; + } + + if (Creature* Glaive = m_creature->GetMap()->GetCreature(GlaiveGUID[i])) + { + if (Glaive->isAlive()) + Glaive->SetDeathState(JUST_DIED); + + GlaiveGUID[i] = 0; + } + } + + if (Creature* pAkama = m_creature->GetMap()->GetCreature(AkamaGUID)) + { + if (!pAkama->isAlive()) + pAkama->Respawn(); + + pAkama->AI()->EnterEvadeMode(); + } + + InformAkama = false; + RefaceVictim = false; + HasSummoned = false; + + FaceVictimTimer = 1000; + BerserkTimer = 1500000; + GlobalTimer = 0; + DemonFormSequence = 0; + + /** Normal Form **/ + ShearTimer = urand(20000, 30000); // 20 to 30 seconds + FlameCrashTimer = 30000; // 30 seconds + ParasiticShadowFiendTimer = 25000; // 25 seconds + DrawSoulTimer = 50000; // 50 seconds + + /** Phase 2 **/ + SummonBladesTimer = 10000; + SummonFlamesTimer = 20000; // Phase 2 timers may be incorrect + FireballTimer = 5000; + DarkBarrageTimer = 45000; + EyeBlastTimer = 30000; + CheckFlamesTimer = 5000; + RetrieveBladesTimer = 5000; + LandTimer = 0; + + /** Phase 3+ **/ + AgonizingFlamesTimer = 35000; // Phase 3+ timers may be incorrect + ShadowBlastTimer = 3000; + FlameBurstTimer = 10000; + ShadowDemonTimer = 30000; + TransformTimer = 90000; + EnrageTimer = 40000; + CageTimer = 30000; + LayTrapTimer = CageTimer + 2000; + AnimationTimer = 0; + + TauntTimer = 30000; // This timer may be off. + + m_creature->SetDisplayId(21135); + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + // Unequip warglaives if needed + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + + m_creature->RemoveSplineFlag(SPLINEFLAG_NO_SPLINE); + + IsTalking = false; + + TalkCount = 0; + TalkTimer = 0; + + if (m_pInstance) + m_pInstance->SetData(TYPE_ILLIDAN, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void AttackStart(Unit *who) + { + if (!who || IsTalking || Phase == 2 || Phase == 4 || Phase == 6 || m_creature->HasAura(SPELL_KNEEL, EFFECT_INDEX_0)) + return; + + if (who == m_creature) + return; + + if (m_creature->Attack(who, true)) + { + m_creature->AddThreat(who); + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + + DoStartMovement(who); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim() || IsTalking || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void JustDied(Unit *killer) + { + IsTalking = false; + TalkCount = 0; + TalkTimer = 0; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (!m_pInstance) + return; + + // Completed + m_pInstance->SetData(TYPE_ILLIDAN, DONE); + + for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) + { + // Open Doors + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(i))) + pDoor->SetGoState(GO_STATE_ACTIVE); + } + + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth()) // Don't let ourselves be slain before we do our death speech + { + damage = 0; + m_creature->SetHealth(m_creature->GetMaxHealth()/100); + } + } + + void Cast(Unit* victim, uint32 Spell, bool triggered = false) + { + if (!victim) + return; + + RefaceVictim = true; + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, victim->GetGUID()); + m_creature->CastSpell(victim, Spell, triggered); + } + + /** This will handle the cast of eye blast **/ + void CastEyeBlast() + { + m_creature->InterruptNonMeleeSpells(false); + + DarkBarrageTimer += 10000; + + DoScriptText(SAY_EYE_BLAST, m_creature); + + uint32 initial = urand(0, 3); + uint32 final = 0; + + if (initial < 3) + final = initial+1; + + float initial_X = EyeBlast[initial].x; + float initial_Y = EyeBlast[initial].y; + float initial_Z = EyeBlast[initial].z; + + float final_X = EyeBlast[final].x; + float final_Y = EyeBlast[final].y; + float final_Z = EyeBlast[final].z; + + for(uint8 i = 0; i < 2; ++i) + { + if (Creature* pTrigger = m_creature->SummonCreature(DEMON_FIRE, initial_X, initial_Y, initial_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + if (demonfireAI* pTriggerAI = dynamic_cast(pTrigger->AI())) + pTriggerAI->IsTrigger = true; + + pTrigger->GetMotionMaster()->MovePoint(0, final_X, final_Y, final_Z); + + if (!i) + pTrigger->CastSpell(pTrigger, SPELL_EYE_BLAST_TRIGGER, true); + else + { + pTrigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pTrigger->GetGUID()); + DoCastSpellIfCan(pTrigger, SPELL_EYE_BLAST); + } + } + } + } + + // It's only cast on players that are greater than 15 yards away from Illidan. + //If no one is found, cast it on MT instead (since selecting someone in that 15 yard radius would cause the flames to hit the MT anyway). + void CastAgonizingFlames() + { + // We'll use a grid searcher that selects a player that is at a distance >15 yards + if (Player* pPlayer = GetPlayerAtMinimumRange(15.0f)) + DoCastSpellIfCan(pPlayer, SPELL_AGONIZING_FLAMES); + else + DoCastSpellIfCan(m_creature->getVictim(), SPELL_AGONIZING_FLAMES); + } + + void Talk(uint32 count) + { + if (!m_creature->isAlive()) + return; + + int32 text = 0; + + if (Conversation[count].textId) + text = Conversation[count].textId; + + TalkTimer = Conversation[count].timer; + uint32 emote = Conversation[count].emote; + IsTalking = Conversation[count].Talk; + Creature* pCreature = NULL; + uint64 GUID = 0; + + if (Conversation[count].creature == ILLIDAN_STORMRAGE) + pCreature = m_creature; + else if (Conversation[count].creature == AKAMA) + { + if (!AkamaGUID) + { + if (m_pInstance) + { + AkamaGUID = m_pInstance->GetData64(DATA_AKAMA); + if (!AkamaGUID) + return; + GUID = AkamaGUID; + } + } + else GUID = AkamaGUID; + } + else if (Conversation[count].creature == MAIEV_SHADOWSONG) + { + if (!MaievGUID) + return; + GUID = MaievGUID; + } + else if (Conversation[count].creature == EMPTY) // This is just for special cases without speech/sounds/emotes. + return; + + if (GUID) // Now we check if we actually specified a GUID, if so: + // we grab a pointer to that creature + pCreature = m_creature->GetMap()->GetCreature(GUID); + + if (pCreature) + { + if (emote) + pCreature->HandleEmote(emote); // Make the creature do some animation + if (text) + DoScriptText(text, pCreature); // Have the creature yell out some text + } + } + + void Move(float X, float Y, float Z, Creature* pCreature) + { + pCreature->GetMotionMaster()->MovePoint(0, X, Y, Z); + } + + void HandleDemonTransformAnimation(uint32 count) + { + uint32 unaura = DemonTransformation[count].unaura; + uint32 aura = DemonTransformation[count].aura; + uint32 displayid = DemonTransformation[count].displayid; + AnimationTimer = DemonTransformation[count].timer; + uint32 size = DemonTransformation[count].size; + + m_creature->InterruptNonMeleeSpells(false); + + if (DemonTransformation[count].phase != 8) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + } + + if (unaura) + m_creature->RemoveAurasDueToSpell(unaura); + + if (aura) + DoCastSpellIfCan(m_creature, aura, CAST_TRIGGERED); + + if (displayid) + // It's morphin time! + m_creature->SetDisplayId(displayid); + /*if (size) + m_creature->SetUInt32Value(OBJECT_FIELD_SCALE_X, size); // Let us grow! (or shrink)*/ + + if (DemonTransformation[count].equip) + { + // Requip warglaives if needed + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + } + else + { + // Unequip warglaives if needed + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + } + + if (DemonTransformation[count].phase != 8) + Phase = DemonTransformation[count].phase; // Set phase properly + else + { + // Refollow and attack our old victim + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 + if (MaievGUID) Phase = PHASE_NORMAL_MAIEV; + else Phase = PHASE_NORMAL_2; + } + + if (count == 7) + { + DoResetThreat(); + m_creature->RemoveAurasDueToSpell(SPELL_DEMON_FORM); + } + else if (count == 4) + { + DoResetThreat(); + if (!m_creature->HasAura(SPELL_DEMON_FORM, EFFECT_INDEX_0)) + DoCastSpellIfCan(m_creature, SPELL_DEMON_FORM, CAST_TRIGGERED); + } + } + + /** To reduce the amount of code in UpdateAI, we can seperate them into different functions and simply call them from UpdateAI **/ + void EnterPhase2() + { + DoScriptText(SAY_TAKEOFF, m_creature); + + SummonBladesTimer = 10000; // Summon Glaives when this decrements + SummonFlamesTimer = 20000; // Summon Flames when this decrements + GlobalTimer += 20000; + LandTimer = 0; + Phase = PHASE_FLIGHT; + m_creature->RemoveAllAuras(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + // So players don't shoot us down + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + // We now hover! + m_creature->AddSplineFlag(SPLINEFLAG_NO_SPLINE); + + m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); + for(uint8 i = 0; i < 2; ++i) + { + Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); // We need this to remove them later on + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Glaive->SetVisibility(VISIBILITY_OFF); + Glaive->setFaction(m_creature->getFaction()); + } + } + } + + void SummonBladesOfAzzinoth() + { + m_creature->GetMotionMaster()->Clear(false); + + LandTimer = 0; + RetrieveBladesTimer = 0; + + // Make it look like we're throwing the glaives on the ground + DoCastSpellIfCan(m_creature, SPELL_THROW_GLAIVE2); + + // We no longer wear the glaives! + // since they are now channeling the flames (or will be) + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + + for(uint8 i = 0; i < 2; ++i) + { + Creature* Glaive = NULL; + Glaive = m_creature->GetMap()->GetCreature(GlaiveGUID[i]); + if (Glaive) + { + DoCastSpellIfCan(Glaive, SPELL_THROW_GLAIVE, CAST_TRIGGERED); + Glaive->SetVisibility(VISIBILITY_ON); + } + } + } + + void SummonFlamesOfAzzinoth() + { + DoScriptText(SAY_SUMMONFLAMES, m_creature); + + for(uint8 i = 0; i < 2; ++i) + { + Creature* Flame = NULL; + Creature* Glaive = NULL; + Glaive = m_creature->GetMap()->GetCreature(GlaiveGUID[i]); + if (Glaive) + { + Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + if (Flame) + { + // Just in case the database has it as a different faction + Flame->setFaction(m_creature->getFaction()); + + // Attack our target! + Flame->AI()->AttackStart(m_creature->getVictim()); + + // Record GUID in order to check if they're dead later on to move to the next phase + FlameGUID[i] = Flame->GetGUID(); + + // Glaives do some random Beam type channel on it. + Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, true); + + if (m_creature->getVictim()) + Flame->AI()->AttackStart(m_creature->getVictim()); + } + else + { + error_log("SD2: Illidan Stormrage AI: Unable to summon Flame of Azzinoth (entry: 22997), please check your database"); + EnterEvadeMode(); + } + } + else + { + error_log("SD2: Illidan Stormrage AI: Unable to summon Blade of Azzinoth (entry: 22996), please check your database"); + } + } + DoResetThreat(); // And now reset our threatlist + HasSummoned = true; + } + + void SummonMaiev() + { + TauntTimer += 4000; + GlobalTimer += 4000; + + m_creature->InterruptNonMeleeSpells(false); // Interrupt any of our spells + Creature* Maiev = NULL; // Summon Maiev near Illidan + Maiev = m_creature->SummonCreature(MAIEV_SHADOWSONG, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ()+2, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + if (Maiev) + { + m_creature->GetMotionMaster()->Clear(false); // Stop moving, it's rude to walk and talk! + m_creature->GetMotionMaster()->MoveIdle(); + // Just in case someone is unaffected by Shadow Prison + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoCastSpellIfCan(m_creature, SPELL_SHADOW_PRISON, CAST_TRIGGERED); + TalkCount = 10; + IsTalking = true; // We are now talking/ + Maiev->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk + Maiev->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + MaievGUID = Maiev->GetGUID(); + } + else // If Maiev cannot be summoned, reset the encounter and post some errors to the console. + { + EnterEvadeMode(); + debug_log("SD2: Unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter."); + error_log("SD2: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); + } + } + + void InitializeDeath() + { + m_creature->RemoveAllAuras(); + DoCastSpellIfCan(m_creature, SPELL_DEATH); // Animate his kneeling + stun him + // Don't let the players interrupt our talk! + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->Clear(false); // No moving! + m_creature->GetMotionMaster()->MoveIdle(); + + if (MaievGUID) + { + if (Creature* Maiev = m_creature->GetMap()->GetCreature(MaievGUID)) + { + Maiev->CombatStop(true); // Maiev shouldn't do anything either. No point in her attacking us =] + Maiev->GetMotionMaster()->Clear(false); // Stop her from moving as well + Maiev->GetMotionMaster()->MoveIdle(); + + float distance = 10.0f; + float dx = m_creature->GetPositionX() + (distance*cos(m_creature->GetOrientation())); + float dy = m_creature->GetPositionY() + (distance*sin(m_creature->GetOrientation())); + + Maiev->NearTeleportTo(dx, dy, Maiev->GetPositionZ(), 0.0f); + + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + Maiev->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + } + } + IsTalking = true; + ++TalkCount; + } + + void UpdateAI(const uint32 diff) + { + /*** This section will handle the conversations ***/ + if (IsTalking) // Somewhat more efficient using a function rather than a long switch + { + if (TalkTimer < diff) + { + switch(TalkCount) // This is only for specialized cases + { + case 0: + // Time to stand up! + m_creature->RemoveAurasDueToSpell(SPELL_KNEEL); + break; + case 8: + // Equip our warglaives! + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + // Hostile if we weren't before + m_creature->setFaction(14); + break; + case 9: + if (AkamaGUID) + { + if (Creature* pAkama = m_creature->GetMap()->GetCreature(AkamaGUID)) + { + // Start attacking Akama + AttackStart(pAkama); + + // Akama stop talk and start attack illidan + if (npc_akama_illidanAI* pAkamaAI = dynamic_cast(pAkama->AI())) + pAkamaAI->IsTalking = false; + + pAkama->AI()->AttackStart(m_creature); + pAkama->AddThreat(m_creature, 1000000.0f); + } + } + + // We are now attackable! + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + debug_log("SD2: Black Temple: Illidan intro complete, players can attack Illidan."); + break; + case 11: + if (MaievGUID) + { + Creature* Maiev = m_creature->GetMap()->GetCreature(MaievGUID); + if (Maiev) + { + // Maiev is now visible + Maiev->SetVisibility(VISIBILITY_ON); + // onoz she looks like she teleported! + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + // Have her face us + Maiev->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + // Face her, so it's not rude =P + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Maiev->GetGUID()); + } + } + break; + case 14: + if (MaievGUID) + { + Creature* Maiev = m_creature->GetMap()->GetCreature(MaievGUID); + if (Maiev) + { + Maiev->GetMotionMaster()->Clear(false); + Maiev->GetMotionMaster()->MoveChase(m_creature); + // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE + Maiev->AddThreat(m_creature, 10000000.0f); + // Force Maiev to attack us. + Maiev->AI()->AttackStart(m_creature); + Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + IsTalking = false; + FaceVictimTimer = 2000; + RefaceVictim = true; + break; + case 20: + // Kill ourself. + if (MaievGUID) + { + Creature* Maiev = m_creature->GetMap()->GetCreature(MaievGUID); + if (Maiev) + { + // Make Maiev leave + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + Maiev->SetDeathState(JUST_DIED); + } + } + IsTalking = false; + if (m_creature->getVictim()) + m_creature->getVictim()->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else + // Now we kill ourself + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + break; + } + + // This function does most of the talking + Talk(TalkCount); + ++TalkCount; + }else TalkTimer -= diff; + } + + // If we don't have a target, return. + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || IsTalking) + return; + + // If we are 'caged', then we shouldn't do anything such as cast spells or transform into Demon Form. + if (m_creature->HasAura(SPELL_CAGED, EFFECT_INDEX_0)) + { + // Just so that he doesn't immediately enrage after he stops being caged. + EnrageTimer = 40000; + CageTimer = 30000; + return; + } + + // Berserk Timer - flat 25 minutes + if (!m_creature->HasAura(SPELL_BERSERK, EFFECT_INDEX_0) && Phase != PHASE_DEMON_SEQUENCE) + { + if (BerserkTimer < diff) + { + DoScriptText(SAY_ENRAGE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BERSERK, CAST_TRIGGERED); + }else BerserkTimer -= diff; + } + + if (RefaceVictim) + { + if (FaceVictimTimer < diff) + { + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID()); + FaceVictimTimer = 1000; + RefaceVictim = false; + }else FaceVictimTimer -= diff; + } + + /** Signal to change to phase 2 **/ + if (m_creature->GetHealthPercent() < 65.0f && Phase == PHASE_NORMAL) + EnterPhase2(); + + /** Signal to summon Maiev **/ + if (m_creature->GetHealthPercent() < 30.0f && !MaievGUID && (Phase != PHASE_DEMON || Phase != PHASE_DEMON_SEQUENCE)) + SummonMaiev(); + + /** Time for the death speech **/ + if (m_creature->GetHealthPercent() < 1.0f && !IsTalking && (Phase != PHASE_DEMON || Phase != PHASE_DEMON_SEQUENCE)) + InitializeDeath(); + + /***** Spells for Phase 1, 3 and 5 (Normal Form) ******/ + if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV) + { + if (TauntTimer < diff) // His random taunt/yell timer. + { + uint32 random = urand(0, 3); + int32 yell = RandomTaunts[random].textId; + if (yell) + DoScriptText(yell, m_creature); + TauntTimer = 32000; + }else TauntTimer -= diff; + + // Global Timer so that spells do not overlap. + if (GlobalTimer < diff) + { + if (ShearTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHEAR); + ShearTimer = urand(25000, 40000); + GlobalTimer += 2000; + }else ShearTimer -= diff; + + if (FlameCrashTimer < diff) + { + //It spawns multiple flames sometimes. Therefore, we'll do this manually. + //DoCastSpellIfCan(m_creature->getVictim(), SPELL_FLAME_CRASH); + m_creature->SummonCreature(FLAME_CRASH, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 40000); + FlameCrashTimer = 35000; + GlobalTimer += 2000; + }else FlameCrashTimer -= diff; + + if (ParasiticShadowFiendTimer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + if (target && target->isAlive() && !target->HasAura(SPELL_PARASITIC_SHADOWFIEND, EFFECT_INDEX_0)) + { + Cast(target, SPELL_PARASITIC_SHADOWFIEND); + ParasiticShadowFiendTimer = 40000; + } + }else ParasiticShadowFiendTimer -= diff; + + if (DrawSoulTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DRAW_SOUL); + DrawSoulTimer = 55000; + GlobalTimer += 3000; + }else DrawSoulTimer -= diff; + }else GlobalTimer -= diff; + + if (!IsTalking) + DoMeleeAttackIfReady(); + } + + /*** Phase 2 ***/ + if (Phase == PHASE_FLIGHT) + { + // Check if we have summoned or not. + if (!HasSummoned) + { + if (SummonBladesTimer) + if (SummonBladesTimer <= diff) + { + SummonBladesOfAzzinoth(); + SummonBladesTimer = 0; + }else SummonBladesTimer -= diff; + + if (SummonFlamesTimer < diff) + { + SummonFlamesOfAzzinoth(); + }else SummonFlamesTimer -= diff; + } + + if (!m_creature->GetMotionMaster()->empty() && (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)) + m_creature->GetMotionMaster()->Clear(false); + + if (HasSummoned) + { + if (CheckFlamesTimer) + { + if (CheckFlamesTimer <= diff) + { + // Check if flames are dead or non-existant. If so, set GUID to 0. + for(uint8 i = 0; i < 2; ++i) + { + if (FlameGUID[i]) + { + Creature* Flame = m_creature->GetMap()->GetCreature(FlameGUID[i]); + + // If the flame dies, or somehow the pointer becomes invalid, reset GUID to 0. + if (!Flame || !Flame->isAlive()) + FlameGUID[i] = 0; + } + } + CheckFlamesTimer = 500; + }else CheckFlamesTimer -= diff; + } + + // If both flames are dead/non-existant, kill glaives and change to phase 3. + if (!FlameGUID[0] && !FlameGUID[1] && CheckFlamesTimer) + { + RetrieveBladesTimer = 5000; // Prepare for re-equipin! + CheckFlamesTimer = 0; + } + + if (RetrieveBladesTimer) + { + if (RetrieveBladesTimer <= diff) // Time to get back our glaives! + { + // Interrupt any spells we might be doing *cough* DArk Barrage *cough* + m_creature->InterruptNonMeleeSpells(false); + for(uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + Creature* Glaive = m_creature->GetMap()->GetCreature(GlaiveGUID[i]); + if (Glaive) + { + // Make it look like the Glaive flies back up to us + Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, true); + // Despawn the Glaive + Glaive->SetDeathState(JUST_DIED); + } + GlaiveGUID[i] = 0; + } + } + + // Re-equip our warblades! + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + + // Prepare for landin'! + LandTimer = 5000; + RetrieveBladesTimer = 0; + }else RetrieveBladesTimer -= diff; + } + + if (LandTimer) + { + // Time to land! + if (LandTimer <= diff) + { + DoResetThreat(); + + // anndddd touchdown! + m_creature->HandleEmote(EMOTE_ONESHOT_LAND); + m_creature->RemoveSplineFlag(SPLINEFLAG_NO_SPLINE); + Phase = PHASE_NORMAL_2; + + // We should let the raid fight us =) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID()); + + // Chase our victim! + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + }else LandTimer -= diff; + return; // Do not continue past this point if LandTimer is not 0 and we are in phase 2. + } + } + + if (GlobalTimer < diff) + { + if (FireballTimer < diff) + { + Cast(m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0), SPELL_FIREBALL); + FireballTimer = 5000; + }else FireballTimer -= diff; + + if (DarkBarrageTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_DARK_BARRAGE); + + DarkBarrageTimer = 35000; + GlobalTimer += 9000; + }else DarkBarrageTimer -= diff; + + if (EyeBlastTimer < diff) + { + CastEyeBlast(); + EyeBlastTimer = 30000; + }else EyeBlastTimer -= diff; + }else GlobalTimer -= diff; + } + + /** Phase 3,5 spells only**/ + if (Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV) + { + if (GlobalTimer < diff) + { + if (AgonizingFlamesTimer < diff) + { + CastAgonizingFlames(); + AgonizingFlamesTimer = 60000; + }else AgonizingFlamesTimer -= diff; + }else GlobalTimer -= diff; + + if (TransformTimer < diff) + { + float CurHealth = m_creature->GetHealthPercent(); + // Prevent Illidan from morphing if less than 32% or 5%, as this may cause issues with the phase transition or death speech + if ((CurHealth < 32.0f && !MaievGUID) || CurHealth < 5.0f) + return; + + Phase = PHASE_DEMON_SEQUENCE; // Transform sequence + DemonFormSequence = 0; + AnimationTimer = 0; + + DoScriptText(SAY_MORPH, m_creature); + + TransformTimer = 60000; + FlameBurstTimer = 10000; + ShadowDemonTimer = 30000; + m_creature->GetMotionMaster()->Clear(false);// Stop moving + }else TransformTimer -= diff; + } + + /** Phase 4 spells only (Demon Form) **/ + if (Phase == PHASE_DEMON) + { + // Stop moving if we are by clearing movement generators. + if (!m_creature->GetMotionMaster()->empty()) + m_creature->GetMotionMaster()->Clear(false); + + if (TransformTimer < diff) + { + Phase = PHASE_DEMON_SEQUENCE; + DemonFormSequence = 5; + AnimationTimer = 100; + TransformTimer = 60000; + }else TransformTimer -= diff; + + if (ShadowDemonTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + Creature* ShadowDemon = NULL; + for(uint8 i = 0; i < 4; ++i) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + // only on players. + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + ShadowDemon = m_creature->SummonCreature(SHADOW_DEMON, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (ShadowDemon) + { + ShadowDemon->AddThreat(target, 5000000.0f); + ShadowDemon->AI()->AttackStart(target); + ShadowDemon->SetInCombatWithZone(); + } + } + } + ShadowDemonTimer = 60000; + }else ShadowDemonTimer -= diff; + + if (GlobalTimer < diff) + { + if (ShadowBlastTimer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0); + if (target && target->isAlive()) + { + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + DoCastSpellIfCan(target, SPELL_SHADOW_BLAST); + ShadowBlastTimer = 4000; + GlobalTimer += 1500; + } + if (!m_creature->HasAura(SPELL_DEMON_FORM, EFFECT_INDEX_0)) + DoCastSpellIfCan(m_creature, SPELL_DEMON_FORM, CAST_TRIGGERED); + }else ShadowBlastTimer -= diff; + + if (FlameBurstTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_FLAME_BURST); + FlameBurstTimer = 15000; + }else FlameBurstTimer -= diff; + }else GlobalTimer -= diff; + } + + /** Phase 5 timers. Enrage spell **/ + if (Phase == PHASE_NORMAL_MAIEV) + { + if (EnrageTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + EnrageTimer = 40000; + CageTimer = 30000; + TransformTimer += 10000; + }else EnrageTimer -= diff; + + // We'll handle Cage Trap in Illidan's script for simplicity's sake + if (CageTimer < diff) + { + if (MaievGUID) + { + Creature* Maiev = m_creature->GetMap()->GetCreature(MaievGUID); + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (!Maiev || !target || (target->GetTypeId() != TYPEID_PLAYER)) + return; + + float X, Y, Z; + target->GetPosition(X, Y, Z); + Maiev->GetMap()->CreatureRelocation(m_creature, X, Y, Z, Maiev->GetOrientation()); + + // Make it look like she 'teleported' + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + // summon the trap! + Maiev->CastSpell(Maiev, SPELL_CAGE_TRAP_SUMMON, false); + } + CageTimer = 15000; + }else CageTimer -= diff; + } + + if (Phase == PHASE_DEMON_SEQUENCE) // Demonic Transformation + { + if (AnimationTimer < diff) + { + HandleDemonTransformAnimation(DemonFormSequence); + ++DemonFormSequence; + }else AnimationTimer -= diff; + } + } +}; + +/*********************** End of Illidan AI ******************************************/ + +void npc_akama_illidanAI::BeginEvent(uint64 PlayerGUID) +{ + debug_log("SD2: Akama - Illidan Introduction started. Illidan event properly begun."); + if (m_pInstance) + { + IllidanGUID = m_pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + m_pInstance->SetData(TYPE_ILLIDAN, IN_PROGRESS); + } + + if (m_pInstance) + { + for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L+1; ++i) + { + if (GameObject* pDoor = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(i))) + pDoor->SetGoState(GO_STATE_READY); + } + } + + if (IllidanGUID) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Creature* pIllidan = m_creature->GetMap()->GetCreature(IllidanGUID)) + { + boss_illidan_stormrageAI* pIllidanAI = dynamic_cast(pIllidan->AI()); + + if (!pIllidanAI) + return; + + // Time for Illidan to stand up. + pIllidan->RemoveAurasDueToSpell(SPELL_KNEEL); + + // First line of Akama-Illidan convo + + pIllidanAI->TalkCount = 0; + + // Begin Talking + pIllidanAI->IsTalking = true; + pIllidanAI->AkamaGUID = m_creature->GetGUID(); + + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, pIllidan->GetGUID()); + pIllidan->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + + IsTalking = true; // Prevent Akama from starting to attack him + // Prevent players from talking again + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + pIllidan->GetMotionMaster()->Clear(false); + pIllidan->GetMotionMaster()->MoveIdle(); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + if (PlayerGUID) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(PlayerGUID)) + pIllidan->AddThreat(pPlayer, 100.0f); + } + } + } +} + +bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the event + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_akama_illidanAI* pAkamaAI = dynamic_cast(pCreature->AI())) + pAkamaAI->BeginDoorEvent(pPlayer); + } + return true; +} + +struct MANGOS_DLL_DECL boss_maievAI : public ScriptedAI +{ + boss_maievAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + }; + + uint32 TauntTimer; + uint64 IllidanGUID; + + ScriptedInstance* m_pInstance; + + void Reset() + { + TauntTimer = 12000; + IllidanGUID = 0; + } + + void UpdateAI(const uint32 diff) + { + if (!IllidanGUID) + { + if (m_pInstance) + IllidanGUID = m_pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + }else + { + Creature* Illidan = m_creature->GetMap()->GetCreature(IllidanGUID); + + if (!Illidan || !Illidan->isAlive() || Illidan->IsInEvadeMode()) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else if (Illidan && Illidan->GetHealthPercent() < 2.0f) + return; + } + + // Return if we don't have a target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (TauntTimer < diff) + { + uint32 random = urand(0, 3); + int32 text = MaievTaunts[random].textId; + + DoScriptText(text, m_creature); + + TauntTimer = urand(22000, 42000); + }else TauntTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL cage_trap_triggerAI : public ScriptedAI +{ + cage_trap_triggerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 IllidanGUID; + uint64 CageTrapGUID; + + uint32 DespawnTimer; + + bool Active; + bool SummonedBeams; + + void Reset() + { + IllidanGUID = 0; + CageTrapGUID = 0; + + Active = false; + SummonedBeams = false; + + DespawnTimer = 0; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void MoveInLineOfSight(Unit *who) + { + if (!Active) + return; + + if (who && (who->GetTypeId() != TYPEID_PLAYER)) + { + if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan + { + if (!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && !who->HasAura(SPELL_CAGED, EFFECT_INDEX_0)) + { + IllidanGUID = who->GetGUID(); + who->CastSpell(who, SPELL_CAGED, true); + DespawnTimer = 5000; + + // Dispel his enrage + if (who->HasAura(SPELL_ENRAGE, EFFECT_INDEX_0)) + who->RemoveAurasDueToSpell(SPELL_ENRAGE); + + if (GameObject* pCageTrap = m_creature->GetMap()->GetGameObject(CageTrapGUID)) + pCageTrap->SetLootState(GO_JUST_DEACTIVATED); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer) + { + if (DespawnTimer <= diff) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else DespawnTimer -= diff; + } + + //if (IllidanGUID && !SummonedBeams) + //{ + // if (Creature* pIllidan = m_creature->GetMap()->GetCreature(IllidanGUID) + // { + // //TODO: Find proper spells and properly apply 'caged' Illidan effect + // } + //} + } +}; + +bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) +{ + float x, y, z; + pPlayer->GetPosition(x, y, z); + + // Grid search for nearest live creature of entry 23304 within 10 yards + Creature* pTrigger = GetClosestCreatureWithEntry(pGo, 23304, 10.0f); + + if (!pTrigger) + { + error_log("SD2: Cage Trap- Unable to find trigger. This Cage Trap is now useless"); + return false; + } + + if (cage_trap_triggerAI* pTriggerAI = dynamic_cast(pTrigger->AI())) + pTriggerAI->Active = true; + + pGo->SetGoState(GO_STATE_ACTIVE); + return true; +} + +struct MANGOS_DLL_DECL flame_of_azzinothAI : public ScriptedAI +{ + flame_of_azzinothAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 FlameBlastTimer; + uint32 SummonBlazeTimer; + uint32 ChargeTimer; + + void Reset() + { + FlameBlastTimer = urand(15000, 30000); + SummonBlazeTimer = urand(10000, 30000); + ChargeTimer = 5000; + } + + void Charge() + { + // Get the Threat List + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + + // He doesn't have anyone in his threatlist, useless to continue + if (tList.empty()) + return; + + std::list targets; + + //store the threat list in a different container + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit *target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //Sort the list of players + targets.sort(ObjectDistanceOrderReversed(m_creature)); + //Resize so we only get the furthest target + targets.resize(1); + + Unit* target = (*targets.begin()); + if (target && (!m_creature->IsWithinDistInMap(target, 40))) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CAST_TRIGGERED); + DoCastSpellIfCan(target, SPELL_CHARGE); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (FlameBlastTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FLAME_BLAST); + FlameBlastTimer = 30000; + }else FlameBlastTimer -= diff; + + if (SummonBlazeTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_BLAZE_SUMMON); + SummonBlazeTimer = urand(30000, 50000); + }else SummonBlazeTimer -= diff; + + if (ChargeTimer < diff) + { + Charge(); + ChargeTimer = 5000; + }else ChargeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL shadow_demonAI : public ScriptedAI +{ + shadow_demonAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 TargetGUID; + + void Reset() { TargetGUID = 0; } + + void JustDied(Unit *killer) + { + if (TargetGUID) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(TargetGUID)) + pPlayer->RemoveAurasDueToSpell(SPELL_PARALYZE); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) return; + + // Only cast the below on players. + if (m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; + + if (!m_creature->getVictim()->HasAura(SPELL_PARALYZE, EFFECT_INDEX_0)) + { + TargetGUID = m_creature->getVictim()->GetGUID(); + m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); + DoCastSpellIfCan(m_creature, SPELL_SHADOW_DEMON_PASSIVE, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PURPLE_BEAM, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PARALYZE, CAST_TRIGGERED); + } + // Kill our target if we're very close. + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONSUME_SOUL); + } +}; + +struct MANGOS_DLL_DECL flamecrashAI : public ScriptedAI +{ + flamecrashAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 FlameCrashTimer; + uint32 DespawnTimer; + + void Reset() + { + FlameCrashTimer = urand(3000, 8000); + DespawnTimer = 60000; + } + + void AttackStart(Unit *who) { } + + void MoveInLineOfSight(Unit *who){ } + + void UpdateAI(const uint32 diff) + { + if (FlameCrashTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_FLAME_CRASH_EFFECT); + FlameCrashTimer = 15000; + }else FlameCrashTimer -= diff; + + if (DespawnTimer < diff) + { + // So that players don't see the sparkly effect when we die. + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else DespawnTimer -= diff; + } +}; + +// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap +struct MANGOS_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI +{ + mob_parasitic_shadowfiendAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + void Reset() {} + + void DoMeleeAttackIfReady() + { + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + //Make sure our attack is ready and we aren't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND, EFFECT_INDEX_0)) + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND, CAST_TRIGGERED); + + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + } +}; + +struct MANGOS_DLL_DECL blazeAI : public ScriptedAI +{ + blazeAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 BlazeTimer; + uint32 DespawnTimer; + + void Reset() + { + BlazeTimer = 2000; + DespawnTimer = 15000; + } + + void AttackStart(Unit* who) { } + + void MoveInLineOfSight(Unit *who){ } + + void UpdateAI(const uint32 diff) + { + if (BlazeTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_BLAZE_EFFECT); + BlazeTimer = 15000; + }else BlazeTimer -= diff; + + if (DespawnTimer < diff) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else DespawnTimer -= diff; + } +}; + +struct MANGOS_DLL_DECL blade_of_azzinothAI : public ScriptedAI +{ + blade_of_azzinothAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() {} + + // Do-Nothing-But-Stand-There + void AttackStart(Unit* who) { } + void MoveInLineOfSight(Unit* who) { } + +}; + +CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) +{ + return new boss_illidan_stormrageAI(pCreature); +} + +CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) +{ + npc_akama_illidanAI* Akama_AI = new npc_akama_illidanAI(pCreature); + + for(uint8 i = 0; i < 13; ++i) + Akama_AI->AddWaypoint(i, AkamaWP[i].x, AkamaWP[i].y, AkamaWP[i].z); + + return ((CreatureAI*)Akama_AI); +} + +CreatureAI* GetAI_boss_maiev(Creature* pCreature) +{ + return new boss_maievAI(pCreature); +} + +CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) +{ + return new flame_of_azzinothAI(pCreature); +} + +CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) +{ + return new cage_trap_triggerAI(pCreature); +} + +CreatureAI* GetAI_shadow_demon(Creature* pCreature) +{ + return new shadow_demonAI(pCreature); +} + +CreatureAI* GetAI_flamecrash(Creature* pCreature) +{ + return new flamecrashAI(pCreature); +} + +CreatureAI* GetAI_demonfire(Creature* pCreature) +{ + return new demonfireAI(pCreature); +} + +CreatureAI* GetAI_blaze(Creature* pCreature) +{ + return new blazeAI(pCreature); +} + +CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) +{ + return new blade_of_azzinothAI(pCreature); +} + +CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) +{ + return new mob_parasitic_shadowfiendAI(pCreature); +} + +void AddSC_boss_illidan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_illidan_stormrage"; + newscript->GetAI = &GetAI_boss_illidan_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akama_illidan"; + newscript->GetAI = &GetAI_npc_akama_at_illidan; + newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; + newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_maiev_shadowsong"; + newscript->GetAI = &GetAI_boss_maiev; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flame_of_azzinoth"; + newscript->GetAI = &GetAI_mob_flame_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blade_of_azzinoth"; + newscript->GetAI = &GetAI_blade_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "gameobject_cage_trap"; + newscript->pGOHello = &GOHello_cage_trap; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_cage_trap_trigger"; + newscript->GetAI = &GetAI_cage_trap_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadow_demon"; + newscript->GetAI = &GetAI_shadow_demon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flame_crash"; + newscript->GetAI = &GetAI_flamecrash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_demon_fire"; + newscript->GetAI = &GetAI_demonfire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blaze"; + newscript->GetAI = &GetAI_blaze; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_parasitic_shadowfiend"; + newscript->GetAI = &GetAI_parasitic_shadowfiend; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_mother_shahraz.cpp b/scripts/outland/black_temple/boss_mother_shahraz.cpp new file mode 100644 index 0000000..05cbebb --- /dev/null +++ b/scripts/outland/black_temple/boss_mother_shahraz.cpp @@ -0,0 +1,308 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mother_Shahraz +SD%Complete: 80 +SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +//Speech'n'Sounds +#define SAY_TAUNT1 -1564018 +#define SAY_TAUNT2 -1564019 +#define SAY_TAUNT3 -1564020 +#define SAY_AGGRO -1564021 +#define SAY_SPELL1 -1564022 +#define SAY_SPELL2 -1564023 +#define SAY_SPELL3 -1564024 +#define SAY_SLAY1 -1564025 +#define SAY_SLAY2 -1564026 +#define SAY_ENRAGE -1564027 +#define SAY_DEATH -1564028 + +//Spells +#define SPELL_BEAM_SINISTER 40859 +#define SPELL_BEAM_VILE 40860 +#define SPELL_BEAM_WICKED 40861 +#define SPELL_BEAM_SINFUL 40827 +#define SPELL_ATTRACTION 40871 +#define SPELL_SILENCING_SHRIEK 40823 +#define SPELL_ENRAGE 23537 +#define SPELL_SABER_LASH 43267 +#define SPELL_SABER_LASH_IMM 43690 +#define SPELL_TELEPORT_VISUAL 40869 +#define SPELL_BERSERK 45078 + +uint32 PrismaticAuras[]= +{ + 40880, // Shadow + 40882, // Fire + 40883, // Nature + 40891, // Arcane + 40896, // Frost + 40897, // Holy +}; + +struct Locations +{ + float x,y,z; +}; + +static Locations TeleportPoint[]= +{ + {959.996f, 212.576f, 193.843f}, + {932.537f, 231.813f, 193.838f}, + {958.675f, 254.767f, 193.822f}, + {946.955f, 201.316f, 192.535f}, + {944.294f, 149.676f, 197.551f}, + {930.548f, 284.888f, 193.367f}, + {965.997f, 278.398f, 195.777f} +}; + +struct MANGOS_DLL_DECL boss_shahrazAI : public ScriptedAI +{ + boss_shahrazAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 TargetGUID[3]; + uint32 BeamTimer; + uint32 BeamCount; + uint32 CurrentBeam; + uint32 PrismaticShieldTimer; + uint32 FatalAttractionTimer; + uint32 FatalAttractionExplodeTimer; + uint32 ShriekTimer; + uint32 RandomYellTimer; + uint32 EnrageTimer; + uint32 ExplosionCount; + + bool Enraged; + + void Reset() + { + for(uint8 i = 0; i<3; ++i) + TargetGUID[i] = 0; + + BeamTimer = 60000; // Timers may be incorrect + BeamCount = 0; + CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful + PrismaticShieldTimer = 0; + FatalAttractionTimer = 60000; + FatalAttractionExplodeTimer = 70000; + ShriekTimer = 30000; + RandomYellTimer = urand(70000, 110000); + EnrageTimer = 600000; + ExplosionCount = 0; + + Enraged = false; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SHAHRAZ, IN_PROGRESS); + + m_creature->SetInCombatWithZone(); + + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SHAHRAZ, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SHAHRAZ, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void TeleportPlayers() + { + uint32 random = urand(0, 6); + float X = TeleportPoint[random].x; + float Y = TeleportPoint[random].y; + float Z = TeleportPoint[random].z; + + for(uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + TargetGUID[i] = pUnit->GetGUID(); + pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); + DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() < 10.0f && !Enraged) + { + Enraged = true; + DoCastSpellIfCan(m_creature, SPELL_ENRAGE, CAST_TRIGGERED); + DoScriptText(SAY_ENRAGE, m_creature); + } + + //Randomly cast one beam. + if (BeamTimer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (!target || !target->isAlive()) + return; + + BeamTimer = 9000; + + switch(CurrentBeam) + { + case 0: + DoCastSpellIfCan(target, SPELL_BEAM_SINISTER); + break; + case 1: + DoCastSpellIfCan(target, SPELL_BEAM_VILE); + break; + case 2: + DoCastSpellIfCan(target, SPELL_BEAM_WICKED); + break; + case 3: + DoCastSpellIfCan(target, SPELL_BEAM_SINFUL); + break; + } + ++BeamCount; + uint32 Beam = CurrentBeam; + + if (BeamCount > 3) + while(CurrentBeam == Beam) + CurrentBeam = urand(0, 2); + + }else BeamTimer -= diff; + + // Random Prismatic Shield every 15 seconds. + if (PrismaticShieldTimer < diff) + { + uint32 random = urand(0, 5); + if (PrismaticAuras[random]) + DoCastSpellIfCan(m_creature, PrismaticAuras[random]); + PrismaticShieldTimer = 15000; + }else PrismaticShieldTimer -= diff; + + // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. + if (FatalAttractionTimer < diff) + { + ExplosionCount = 0; + + TeleportPlayers(); + + DoScriptText(urand(0, 1) ? SAY_SPELL2 : SAY_SPELL3, m_creature); + + FatalAttractionExplodeTimer = 2000; + FatalAttractionTimer = urand(40000, 70000); + }else FatalAttractionTimer -= diff; + + if (FatalAttractionExplodeTimer < diff) + { + // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. + if (ExplosionCount < 3) + { + for(uint8 i = 0; i < 3; ++i) + { + if (TargetGUID[i]) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(TargetGUID[i])) + pPlayer->CastSpell(pPlayer, SPELL_ATTRACTION, true); + + TargetGUID[i] = 0; + } + } + + ++ExplosionCount; + FatalAttractionExplodeTimer = 1000; + } + else + { + FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; + ExplosionCount = 0; + } + }else FatalAttractionExplodeTimer -= diff; + + if (ShriekTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SILENCING_SHRIEK); + ShriekTimer = 30000; + }else ShriekTimer -= diff; + + //Enrage + if (!m_creature->HasAura(SPELL_BERSERK, EFFECT_INDEX_0)) + { + if (EnrageTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + }else EnrageTimer -= diff; + } + + //Random taunts + if (RandomYellTimer < diff) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_TAUNT1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT3, m_creature); break; + } + + RandomYellTimer = urand(60000, 150000); + }else RandomYellTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shahraz(Creature* pCreature) +{ + return new boss_shahrazAI(pCreature); +} + +void AddSC_boss_mother_shahraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_mother_shahraz"; + newscript->GetAI = &GetAI_boss_shahraz; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_reliquary_of_souls.cpp b/scripts/outland/black_temple/boss_reliquary_of_souls.cpp new file mode 100644 index 0000000..df79938 --- /dev/null +++ b/scripts/outland/black_temple/boss_reliquary_of_souls.cpp @@ -0,0 +1,980 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Reliquary_of_Souls +SD%Complete: 90 +SDComment: Persistent Area Auras for each Essence (Aura of Suffering, Aura of Desire, Aura of Anger) requires core support. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +//Sound'n'speech +//Suffering +#define SUFF_SAY_FREED -1564047 +#define SUFF_SAY_AGGRO -1564048 +#define SUFF_SAY_SLAY1 -1564049 +#define SUFF_SAY_SLAY2 -1564050 +#define SUFF_SAY_SLAY3 -1564051 +#define SUFF_SAY_RECAP -1564052 +#define SUFF_SAY_AFTER -1564053 +#define SUFF_EMOTE_ENRAGE -1564054 + +//Desire +#define DESI_SAY_FREED -1564055 +#define DESI_SAY_SLAY1 -1564056 +#define DESI_SAY_SLAY2 -1564057 +#define DESI_SAY_SLAY3 -1564058 +#define DESI_SAY_SPEC -1564059 +#define DESI_SAY_RECAP -1564060 +#define DESI_SAY_AFTER -1564061 + +//Anger +#define ANGER_SAY_FREED -1564062 +#define ANGER_SAY_FREED2 -1564063 +#define ANGER_SAY_SLAY1 -1564064 +#define ANGER_SAY_SLAY2 -1564065 +#define ANGER_SAY_SPEC -1564066 +#define ANGER_SAY_BEFORE -1564067 +#define ANGER_SAY_DEATH -1564068 + +//Spells +#define AURA_OF_SUFFERING 41292 +#define AURA_OF_SUFFERING_ARMOR 42017 +#define ESSENCE_OF_SUFFERING_PASSIVE 41296 +#define SPELL_ENRAGE 41305 +#define SPELL_SOUL_DRAIN 41303 +#define SPELL_FIXATE 41295 + +#define AURA_OF_DESIRE 41350 +#define SPELL_RUNE_SHIELD 41431 +#define SPELL_DEADEN 41410 +#define SPELL_SOUL_SHOCK 41426 + +#define AURA_OF_ANGER 41337 +#define SPELL_SELF_SEETHE 41364 +#define SPELL_ENEMY_SEETHE 41520 +#define SPELL_SOUL_SCREAM 41545 +#define SPELL_SPITE 41377 + +#define ENSLAVED_SOUL_PASSIVE 41535 +#define SPELL_SOUL_RELEASE 41542 +#define SPELL_RESTORE_MANA 32848 +#define SPELL_RESTORE_HEALTH 25329 + +#define CREATURE_ENSLAVED_SOUL 23469 + +struct ReliquaryPosition +{ + float x,y; +}; + +static ReliquaryPosition Coords[]= +{ + {450.4f, 212.3f}, + {542.1f, 212.3f}, + {542.1f, 168.3f}, + {542.1f, 137.4f}, + {450.4f, 137.4f}, + {450.4f, 168.3f} +}; + +struct MANGOS_DLL_DECL npc_enslaved_soulAI : public ScriptedAI +{ + npc_enslaved_soulAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 ReliquaryGUID; + + void Reset() + { + ReliquaryGUID = 0; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth()) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + { + done_by->CastSpell(done_by, SPELL_RESTORE_HEALTH, true); + if (done_by->GetMaxPower(POWER_MANA) > 0) + { + if ((done_by->GetPower(POWER_MANA) / done_by->GetMaxPower(POWER_MANA)) < 70) + { + uint32 mana = done_by->GetPower(POWER_MANA) + (uint32)(done_by->GetMaxPower(POWER_MANA)*0.3); + done_by->SetPower(POWER_MANA, mana); + }else done_by->SetPower(POWER_MANA, done_by->GetMaxPower(POWER_MANA)); + } + } + DoCastSpellIfCan(done_by, SPELL_SOUL_RELEASE); + } + } + + void JustDied(Unit *killer); +}; + +struct MANGOS_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI +{ + boss_reliquary_of_soulsAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SufferingGUID = 0; + DesireGUID = 0; + AngerGUID = 0; + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 SufferingGUID; + uint64 DesireGUID; + uint64 AngerGUID; + + uint32 SoulDeathCount; + // 0 = Out of Combat, 1 = Not started, 2 = Suffering, 3 = Souls, 4 = Desire, 5 = Souls, 6 = Anger + uint32 Phase; + uint32 SummonEssenceTimer; + uint32 DespawnEssenceTimer; + uint32 SoulCount; + uint32 SummonSoulTimer; + uint32 AnimationTimer; + + bool IsDead; + bool EndingPhase; + + void Reset() + { + DespawnEssences(); + + SoulDeathCount = 0; + Phase = 0; + SummonEssenceTimer = 8000; + DespawnEssenceTimer = 2000; + SoulCount = 0; + SummonSoulTimer = 1000; + AnimationTimer = 8000; + + IsDead = false; + EndingPhase = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); + m_creature->GetMotionMaster()->Clear(false); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_RELIQUIARY, NOT_STARTED); + } + + void DespawnEssences() + { + Creature* pEssence = NULL; + + if (SufferingGUID) + pEssence = m_creature->GetMap()->GetCreature(SufferingGUID); + else if (DesireGUID) + pEssence = m_creature->GetMap()->GetCreature(DesireGUID); + else if (AngerGUID) + pEssence = m_creature->GetMap()->GetCreature(AngerGUID); + + if (pEssence && pEssence->isAlive()) + pEssence->ForcedDespawn(); + } + + void AttackStart(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + if (m_creature->getThreatManager().getThreatList().empty()) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_RELIQUIARY, IN_PROGRESS); + + Phase = 1; + + // I R ANNNGRRRY! + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,375); + SummonEssenceTimer = 8000; + AnimationTimer = 5100; + m_creature->AddThreat(who); + //m_creature->SetInCombatWith(who); // Don't know what is like retail + //who->SetInCombatWith(m_creature); + m_creature->SetInCombatWithZone(); // Same goes here, but setting to zone will prevent bug if the only player of threatList dies + + } + } + } + } + + void SummonSoul() + { + uint32 random = urand(0, 5); + float x = Coords[random].x; + float y = Coords[random].y; + + Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (target && Soul) + { + if (npc_enslaved_soulAI* pSoulAI = dynamic_cast(Soul->AI())) + pSoulAI->ReliquaryGUID = m_creature->GetGUID(); + + Soul->CastSpell(Soul, ENSLAVED_SOUL_PASSIVE, true); + Soul->AddThreat(target); + ++SoulCount; + } + } + + void MergeThreatList(Creature* target) + { + if (!target) + return; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + if (Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid())) + { + m_creature->AddThreat(pUnit); // This is so that we make sure the unit is in Reliquary's threat list before we reset the unit's threat. + m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); + float threat = target->getThreatManager().getThreat(pUnit); + m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). + } + } + } + + void JustDied(Unit* killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_RELIQUIARY, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + // Reset if event is begun and we don't have a threatlist + if (Phase && m_creature->getThreatManager().getThreatList().empty()) + EnterEvadeMode(); + + if (Phase == 1) + { + if (AnimationTimer < diff) + { + // Release the cube + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); + AnimationTimer = 8300; + }else AnimationTimer -= diff; + + if (SummonEssenceTimer < diff) + { + // Ribs: open + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,373); + + Creature* EssenceSuffering = m_creature->SummonCreature(23418, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 1.57f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + + if (EssenceSuffering) + { + DoScriptText(SUFF_SAY_FREED, EssenceSuffering); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0)) + { + EssenceSuffering->AddThreat(target); + EssenceSuffering->AI()->AttackStart(target); + } + + SufferingGUID = EssenceSuffering->GetGUID(); + } + + EndingPhase = false; + Phase = 2; + }else SummonEssenceTimer -= diff; + } + + if (Phase == 2) + { + if (SufferingGUID) + { + Creature* EssenceSuffering = m_creature->GetMap()->GetCreature(SufferingGUID); + + if (!EssenceSuffering || (!EssenceSuffering->isAlive())) + EnterEvadeMode(); + + if (!EndingPhase) + { + if (EssenceSuffering) + { + if (EssenceSuffering->GetHealthPercent() < 10.0f) + { + DoScriptText(SUFF_SAY_RECAP, EssenceSuffering); + MergeThreatList(EssenceSuffering); + EssenceSuffering->RemoveAllAuras(); + EssenceSuffering->DeleteThreatList(); + EssenceSuffering->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f); + EssenceSuffering->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DespawnEssenceTimer = 4000; + AnimationTimer = 2200; + EndingPhase = true; + } + } + } + + if ((EndingPhase) && (EssenceSuffering) && (EssenceSuffering->isAlive())) + { + if (AnimationTimer < diff) + { + // Return + EssenceSuffering->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); + AnimationTimer = 10000; + }else AnimationTimer -= diff; + + if (DespawnEssenceTimer < diff) + { + DoScriptText(SUFF_SAY_AFTER, EssenceSuffering); + + EssenceSuffering->DeleteThreatList(); + EssenceSuffering->SetDisplayId(11686); + EssenceSuffering->setFaction(35); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); + SummonEssenceTimer = 20000; //60000; + AnimationTimer = 18200; //58100; + SoulDeathCount = 0; + SoulCount = 0; + SummonSoulTimer = 1000; + EndingPhase = false; + Phase = 3; + SufferingGUID = 0; + }else DespawnEssenceTimer -= diff; + } + } + } + + if (Phase == 3) + { + if (SoulCount < 36) + { + if (SummonSoulTimer < diff) + { + SummonSoul(); + SummonSoulTimer = 500; + }else SummonSoulTimer -= diff; + } + + if (SoulDeathCount >= SoulCount) + { + if (AnimationTimer < diff) + { + // Release the cube + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); + AnimationTimer = 10000; + }else AnimationTimer -= diff; + + if (SummonEssenceTimer < diff) + { + // Ribs: open + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,373); + + Creature* EssenceDesire = m_creature->SummonCreature(23419, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 1.57f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000); + + if (EssenceDesire) + { + DoScriptText(DESI_SAY_FREED, EssenceDesire); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + EssenceDesire->AddThreat(target); + EssenceDesire->AI()->AttackStart(target); + } + + DesireGUID = EssenceDesire->GetGUID(); + SoulDeathCount = 0; + } + + Phase = 4; + }else SummonEssenceTimer -= diff; + } + } + + if (Phase == 4) + { + if (DesireGUID) + { + Creature* EssenceDesire = m_creature->GetMap()->GetCreature(DesireGUID); + + if (!EssenceDesire || !EssenceDesire->isAlive()) + EnterEvadeMode(); + + if (!EndingPhase && EssenceDesire) + { + if (EssenceDesire->GetHealthPercent() < 10.0f) + { + MergeThreatList(EssenceDesire); + EssenceDesire->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f); + EssenceDesire->RemoveAllAuras(); + EssenceDesire->DeleteThreatList(); + + DoScriptText(DESI_SAY_RECAP, EssenceDesire); + + EssenceDesire->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DespawnEssenceTimer = 4000; + AnimationTimer = 2200; + EndingPhase = true; + } + } + + if (EndingPhase && EssenceDesire) + { + if (EssenceDesire->isAlive()) + { + if (AnimationTimer < diff) + { + // Return + EssenceDesire->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); + AnimationTimer = 10000; + }else AnimationTimer -= diff; + + if (DespawnEssenceTimer < diff) + { + EssenceDesire->DeleteThreatList(); + EssenceDesire->setFaction(35); + + DoScriptText(DESI_SAY_AFTER, EssenceDesire); + + EssenceDesire->SetDisplayId(11686); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); + SummonEssenceTimer = 20000; + AnimationTimer = 18200; + SoulDeathCount = 0; + SoulCount = 0; + SummonSoulTimer = 1000; + EndingPhase = false; + Phase = 5; + DesireGUID = 0; + }else DespawnEssenceTimer -= diff; + } + } + } + } + + if (Phase == 5) + { + if (SoulCount < 36) + { + if (SummonSoulTimer < diff) + { + SummonSoul(); + SummonSoulTimer = 500; + }else SummonSoulTimer -= diff; + } + + if (SoulDeathCount >= SoulCount) + { + if (AnimationTimer < diff) + { + // Release the cube + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); + AnimationTimer = 10000; + }else AnimationTimer -= diff; + + if (SummonEssenceTimer < diff) + { + // Ribs: open + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,373); + + Creature* EssenceAnger = m_creature->SummonCreature(23420, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 1.57f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000); + + if (EssenceAnger) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0)) + { + EssenceAnger->AddThreat(target); + EssenceAnger->AI()->AttackStart(target); + } + + AngerGUID = EssenceAnger->GetGUID(); + DoScriptText(ANGER_SAY_FREED, EssenceAnger); + SoulDeathCount = 0; + } + + Phase = 6; + }else SummonEssenceTimer -= diff; + } + } + + if (Phase == 6) + { + if (AngerGUID) + { + Creature* EssenceAnger = m_creature->GetMap()->GetCreature(AngerGUID); + + if (!EssenceAnger) + EnterEvadeMode(); + + if (m_creature->isAlive() && EssenceAnger) + { + if (!EssenceAnger->isAlive()) + { + AngerGUID = 0; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + } + } + } +}; + +struct MANGOS_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI +{ + boss_essence_of_sufferingAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 StatAuraGUID; + + uint32 AggroYellTimer; + uint32 FixateTimer; + uint32 EnrageTimer; + uint32 SoulDrainTimer; + + void Reset() + { + StatAuraGUID = 0; + + AggroYellTimer = 5000; + FixateTimer = 5000; + EnrageTimer = 30000; + SoulDrainTimer = 150000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if ((damage >= m_creature->GetHealth()) && (done_by != m_creature)) + { + damage = 0; + // 10% of total health, signalling time to return + m_creature->SetHealth(m_creature->GetMaxHealth()/10); + if (StatAuraGUID) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(StatAuraGUID)) + pPlayer->RemoveAurasDueToSpell(AURA_OF_SUFFERING_ARMOR); + } + } + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + DoCastSpellIfCan(pWho, AURA_OF_SUFFERING, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, CAST_TRIGGERED); + } + + void KilledUnit(Unit *victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* killer) + { + } + + void CastFixate() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + if (tList.empty()) + return; // No point continuing if empty threatlist. + + std::list targets; + + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + // Only alive players + if (pUnit && pUnit->isAlive() && pUnit->GetTypeId() == TYPEID_PLAYER) + targets.push_back(pUnit); + } + + if (targets.empty()) + return; // No targets added for some reason. No point continuing. + + targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance. + targets.resize(1); // Only need closest target. + Unit* target = targets.front(); // Get the first target. + + // Add threat equivalent to threat on victim. + m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); + DoCastSpellIfCan(target, SPELL_FIXATE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() <= 10.0f) + { + if (StatAuraGUID) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(StatAuraGUID)) + pPlayer->RemoveAurasDueToSpell(AURA_OF_SUFFERING_ARMOR); + } + } + + if (m_creature->GetHealthPercent() <= 10.0f) + { + if (m_creature->getVictim()) + m_creature->DeleteThreatList(); // Delete our threatlist if below 10% as we should no longer attack. + return; + } + + // Prevent overlapping yells + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + DoScriptText(SUFF_SAY_AGGRO, m_creature); + AggroYellTimer = 0; + }else AggroYellTimer -= diff; + } + + //Supposed to be cast on nearest target + if (FixateTimer < diff) + { + CastFixate(); + FixateTimer = 5000; + }else FixateTimer -= diff; + + if (EnrageTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); + EnrageTimer = 60000; + }else EnrageTimer -= diff; + + if (SoulDrainTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, SPELL_SOUL_DRAIN); + SoulDrainTimer = 60000; + }else SoulDrainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; +struct MANGOS_DLL_DECL boss_essence_of_desireAI : public ScriptedAI +{ + boss_essence_of_desireAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 AggroYellTimer; + uint32 RuneShieldTimer; + uint32 DeadenTimer; + uint32 SoulShockTimer; + + void Reset() + { + AggroYellTimer = 5000; + RuneShieldTimer = 60000; + DeadenTimer = 15000; + SoulShockTimer = 40000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if ((damage >= m_creature->GetHealth()) && (done_by != m_creature)) + { + damage = 0; + // 10% of total health, signalling time to return + m_creature->SetHealth(m_creature->GetMaxHealth()/10); + } + else + { + if (done_by && (done_by->GetTypeId() == TYPEID_PLAYER) && done_by->isAlive()) + done_by->DealDamage(done_by, damage/2, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void KilledUnit(Unit *victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + if (!m_creature->isInCombat()) + { + DoCastSpellIfCan(who, AURA_OF_DESIRE); + } + + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() <= 10.0f) + { + if (m_creature->getVictim()) + m_creature->DeleteThreatList(); // Delete our threatlist if below 10% as we should no longer attack. + return; + } + + if (RuneShieldTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_RUNE_SHIELD); + RuneShieldTimer = 60000; + }else RuneShieldTimer -= diff; + + if (DeadenTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DEADEN); + DeadenTimer = urand(30000, 60000); + }else DeadenTimer -= diff; + + if (SoulShockTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SOUL_SHOCK); + SoulShockTimer = 40000; + + if (urand(0, 1)) + DoScriptText(DESI_SAY_SPEC, m_creature); + + }else SoulShockTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_essence_of_angerAI : public ScriptedAI +{ + boss_essence_of_angerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 AggroTargetGUID; + + uint32 AggroYellTimer; + uint32 CheckTankTimer; + uint32 SoulScreamTimer; + uint32 SpiteTimer; + + bool CheckedAggro; + + void Reset() + { + AggroTargetGUID = 0; + + AggroYellTimer = 5000; + CheckTankTimer = 5000; + SoulScreamTimer = 10000; + SpiteTimer = 30000; + + CheckedAggro = false; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + DoCastSpellIfCan(m_creature->getVictim(), AURA_OF_ANGER, CAST_TRIGGERED); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + if (!m_creature->isInCombat()) + { + DoCastSpellIfCan(who, AURA_OF_ANGER); + } + + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void JustDied(Unit *victim) + { + DoScriptText(ANGER_SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? ANGER_SAY_SLAY1 : ANGER_SAY_SLAY2, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!CheckedAggro) + { + AggroTargetGUID = m_creature->getVictim()->GetGUID(); + CheckedAggro = true; + } + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + DoScriptText(ANGER_SAY_FREED2, m_creature); + AggroYellTimer = 0; + }else AggroYellTimer -= diff; + } + + if (CheckTankTimer < diff) + { + if (m_creature->getVictim()->GetGUID() != AggroTargetGUID) + { + DoScriptText(ANGER_SAY_BEFORE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_SELF_SEETHE); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ENEMY_SEETHE, CAST_TRIGGERED); + AggroTargetGUID = m_creature->getVictim()->GetGUID(); + } + CheckTankTimer = 2000; + }else CheckTankTimer -= diff; + + if (SoulScreamTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SOUL_SCREAM); + SoulScreamTimer = 10000; + }else SoulScreamTimer -= diff; + + if (SpiteTimer < diff) + { + for(uint8 i = 0; i < 4; ++i) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target, SPELL_SPITE); + } + + SpiteTimer = 30000; + DoScriptText(ANGER_SAY_SPEC, m_creature); + }else SpiteTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void npc_enslaved_soulAI::JustDied(Unit *killer) +{ + if (ReliquaryGUID) + { + if (Creature* pReliquary = m_creature->GetMap()->GetCreature(ReliquaryGUID)) + { + if (boss_reliquary_of_soulsAI* pReliqAI = dynamic_cast(pReliquary->AI())) + pReliqAI->SoulDeathCount++; + } + } +} + +CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) +{ + return new boss_reliquary_of_soulsAI(pCreature); +} + +CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) +{ + return new boss_essence_of_sufferingAI(pCreature); +} + +CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) +{ + return new boss_essence_of_desireAI(pCreature); +} + +CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) +{ + return new boss_essence_of_angerAI(pCreature); +} + +CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) +{ + return new npc_enslaved_soulAI(pCreature); +} + +void AddSC_boss_reliquary_of_souls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_reliquary_of_souls"; + newscript->GetAI = &GetAI_boss_reliquary_of_souls; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_essence_of_suffering"; + newscript->GetAI = &GetAI_boss_essence_of_suffering; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_essence_of_desire"; + newscript->GetAI = &GetAI_boss_essence_of_desire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_essence_of_anger"; + newscript->GetAI = &GetAI_boss_essence_of_anger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_enslaved_soul"; + newscript->GetAI = &GetAI_npc_enslaved_soul; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_shade_of_akama.cpp b/scripts/outland/black_temple/boss_shade_of_akama.cpp new file mode 100644 index 0000000..410435c --- /dev/null +++ b/scripts/outland/black_temple/boss_shade_of_akama.cpp @@ -0,0 +1,896 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shade_of_Akama +SD%Complete: 85 +SDComment: Seems to be complete. Some little details/cosmetics left (see next comment section). +SDCategory: Black Temple +EndScriptData */ + +/* ToDo: +(1) After start event Akama should walk a bit towards Shade of Akama, then stop (between the two pillars) and begin to channel. +(2) Some minor changes to post event (after killing Shade of Akama): +(2.1) After Shade of Akama is dead Akama should roar in direction to the door (he must turn around if he reached the stage). +(2.2) Positioning of broken NPCs. +(3) The channelers are casting their spell somestimes even if they are daed (move out of view distance and then move in - they are dead but they channel - maybe some clientspecific issue?). +(4) Unbanish Shade of Akama if a ashtongue sorcerer is spawned but not reached Shade of Akama and channels his spell? +*/ + +#include "precompiled.h" +#include "black_temple.h" + +#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" + +// Spells +enum +{ + SAY_DEATH = -1564013, + SAY_LOW_HEALTH = -1564014, + // Ending cinematic text + SAY_FREE = -1564015, + SAY_BROKEN_FREE_01 = -1564016, + SAY_BROKEN_FREE_02 = -1564017, + + SPELL_VERTEX_SHADE_BLACK = 39833, + SPELL_SHADE_SOUL_CHANNEL = 40401, + SPELL_DESTRUCTIVE_POISON = 40874, + SPELL_LIGHTNING_BOLT = 42024, + SPELL_AKAMA_SOUL_CHANNEL = 40447, + SPELL_AKAMA_SOUL_RETRIEVE = 40902, + + NPC_AKAMA = 22990, + NPC_ASH_CHANNELER = 23421, + NPC_ASH_SORCERER = 23215, + NPC_ASH_DEFENDER = 23216, + NPC_ASH_BROKEN = 23319, + NPC_ASH_ELEMENTAL = 23523, + NPC_ASH_ROGUE = 23318, + NPC_ASH_SPIRITBIND = 23524, + + //akama's phases (used as point id's) + //PHASE_CHANNEL = 1, + //PHASE_BELOW_PLATFORM = 2, + //PHASE_ON_PLATFORM = 3 +}; + +const uint32 m_auiRandSpawnEntry[]= +{ + NPC_ASH_ELEMENTAL, + NPC_ASH_ROGUE, + NPC_ASH_SPIRITBIND +}; + +const float LOC_RAND_TO_CENTER_X = 482.793182f; +const float LOC_RAND_TO_CENTER_Y = 401.270172f; +const float LOC_RAND_TO_CENTER_Z = 112.783928f; + +const float LOC_PLATFORM_Z = 118.537f; +const float LOC_LOW_Z = 112.784f; + +struct Location +{ + float m_fX, m_fY, m_fZ, m_fO; +}; + +Location m_afSpawnLoc[]= +{ + {498.652740f, 461.728119f, LOC_LOW_Z, 0.0f}, + {498.505003f, 339.619324f, LOC_LOW_Z, 0.0f} +}; + +Location m_afAkamaWP[]= +{ + //{516.885193, 400.836060, LOC_LOW_Z_SPAWN, 0.0}, //not used yet, he moves to here before start channel + {482.352448f, 401.162720f, LOC_LOW_Z, 0.0f}, + {469.597443f, 402.264404f, LOC_PLATFORM_Z, 0.0f} +}; + +Location m_afBrokenSpawnLoc[]= +{ + {541.375916f, 401.439575f, LOC_LOW_Z, M_PI_F}, // The place where Akama channels + {534.130005f, 352.394531f, LOC_LOW_Z, 2.164150f}, // Behind a 'pillar' which is behind the east alcove + {499.621185f, 341.534729f, LOC_LOW_Z, 1.652856f}, // East Alcove + {499.151093f, 461.036438f, LOC_LOW_Z, 4.770888f} // West Alcove +}; + +Location m_afBrokenWP[]= +{ + {492.491638f, 400.744690f, LOC_LOW_Z, 3.122336f}, + {494.335724f, 382.221771f, LOC_LOW_Z, 2.676230f}, + {489.555939f, 373.507202f, LOC_LOW_Z, 2.416263f}, + {491.136353f, 427.868774f, LOC_LOW_Z, 3.519748f} +}; + +struct MANGOS_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI +{ + boss_shade_of_akamaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_lChannelersGUIDList.clear(); + m_lSorcerersGUIDList.clear(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lChannelersGUIDList; + std::list m_lSorcerersGUIDList; + + uint64 m_uiAkamaGUID; + + uint32 m_uiSorcererCount; + uint32 m_uiDeathCount; + + uint32 m_uiReduceHealthTimer; + uint32 m_uiSummonTimer; + uint32 m_uiResetTimer; + uint32 m_uiDefenderTimer; // They are on a flat 15 second timer, independant of the other summon creature timer. + + bool m_bIsBanished; + bool m_bHasKilledAkama; + + void Reset() + { + m_uiSorcererCount = 0; + m_uiDeathCount = 0; + + m_uiSummonTimer = 10000; + m_uiReduceHealthTimer = 0; + m_uiResetTimer = 60000; + m_uiDefenderTimer = 15000; + + m_bIsBanished = true; + m_bHasKilledAkama = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || m_bIsBanished) + return; + + ScriptedAI::AttackStart(pWho); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_bIsBanished) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SHADE, NOT_STARTED); + + RespawnChannelersIfDeadOrEvade(); + } + + void IncrementDeathCount(uint64 uiGuid = 0) // If guid is set, will remove it from list of sorcerer + { + debug_log("SD2: Increasing Death Count for Shade of Akama encounter"); + ++m_uiDeathCount; + + if (uiGuid) + { + if (m_lSorcerersGUIDList.empty()) + error_log("SD2: boss_shade_of_akamaAI attempt to remove guid " UI64FMTD " from Sorcerers list but list is already empty", uiGuid); + else + m_lSorcerersGUIDList.remove(uiGuid); + } + } + + void SummonCreature() + { + uint32 uiRand = sizeof(m_afSpawnLoc)/sizeof(Location); + + // max of 6 sorcerers can be summoned + if (!urand(0, 2) && (m_uiDeathCount > 0) && (m_uiSorcererCount < 7)) + { + if (Creature* pSorcerer = m_creature->SummonCreature(NPC_ASH_SORCERER, + m_afSpawnLoc[uiRand].m_fX, m_afSpawnLoc[uiRand].m_fY, m_afSpawnLoc[uiRand].m_fZ, m_afSpawnLoc[uiRand].m_fO, + TEMPSUMMON_DEAD_DESPAWN, 0)) + { + pSorcerer->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + pSorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + + m_lSorcerersGUIDList.push_back(pSorcerer->GetGUID()); + + --m_uiDeathCount; + ++m_uiSorcererCount; + } + } + else + { + int iSize = (sizeof(m_auiRandSpawnEntry) / sizeof(uint32)); + + for(uint8 i = 0; i < iSize; ++i) + { + if (Creature* pSpawn = m_creature->SummonCreature(m_auiRandSpawnEntry[i], + m_afSpawnLoc[uiRand].m_fX, m_afSpawnLoc[uiRand].m_fY, m_afSpawnLoc[uiRand].m_fZ, m_afSpawnLoc[uiRand].m_fO, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000)) + { + pSpawn->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSpawn->GetMotionMaster()->MovePoint(0, LOC_RAND_TO_CENTER_X, LOC_RAND_TO_CENTER_Y, LOC_RAND_TO_CENTER_Z); + } + } + } + } + + void DespawnSorceres() + { + if (!m_lSorcerersGUIDList.empty() && m_pInstance) + { + for(std::list::iterator itr = m_lSorcerersGUIDList.begin(); itr != m_lSorcerersGUIDList.end(); ++itr) + { + if (Creature* pSorcerer = m_pInstance->instance->GetCreature(*itr)) + { + if (pSorcerer->isAlive()) + pSorcerer->ForcedDespawn(); + } + } + } + } + + void RespawnChannelersIfDeadOrEvade() + { + if (!m_lChannelersGUIDList.empty() && m_pInstance) + { + for(std::list::iterator itr = m_lChannelersGUIDList.begin(); itr != m_lChannelersGUIDList.end(); ++itr) + { + if (Creature* pChanneler = m_pInstance->instance->GetCreature(*itr)) + { + if (!pChanneler->isAlive()) + pChanneler->Respawn(); + else + pChanneler->AI()->EnterEvadeMode(); + } + } + } + else + error_log("SD2: boss_shade_of_akamaAI not able to respawn channelers, list is empty."); + } + + void PrepareChannelers() + { + std::list lChannelerList; + GetCreatureListWithEntryInGrid(lChannelerList,m_creature, NPC_ASH_CHANNELER, 50.0f); + + if (!lChannelerList.empty()) + { + //clear this, we want a clean start + m_lChannelersGUIDList.clear(); + + for(std::list::iterator itr = lChannelerList.begin(); itr != lChannelerList.end(); ++itr) + { + m_lChannelersGUIDList.push_back((*itr)->GetGUID()); + debug_log("SD2: boss_shade_of_akamaAI found channeler " UI64FMTD ". Adding to list", (*itr)->GetGUID()); + + (*itr)->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + else + error_log("SD2: boss_shade_of_akamaAI unable to find any channelers."); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetEntry() == NPC_AKAMA) + EnterEvadeMode(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SHADE, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->isInCombat()) + return; + + if (m_bIsBanished) + { + // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check + if (m_creature->getThreatManager().getThreatList().size() < 2) + ScriptedAI::EnterEvadeMode(); + + if (m_uiDefenderTimer < uiDiff) + { + uint32 uiRand = sizeof(m_afSpawnLoc)/sizeof(Location); + + if (Creature* pDefender = m_creature->SummonCreature(NPC_ASH_DEFENDER, + m_afSpawnLoc[uiRand].m_fX, m_afSpawnLoc[uiRand].m_fY, m_afSpawnLoc[uiRand].m_fZ, m_afSpawnLoc[uiRand].m_fO, + TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000)) + { + if (Creature* pAkama = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_AKAMA_SHADE))) + pDefender->AI()->AttackStart(pAkama); + } + + m_uiDefenderTimer = 15000; + } + else + m_uiDefenderTimer -= uiDiff; + + if (m_uiSummonTimer < uiDiff) + { + SummonCreature(); + m_uiSummonTimer = 35000; + } + else + m_uiSummonTimer -= uiDiff; + + if (m_uiDeathCount >= 6) + { + if (Creature* pAkama = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_AKAMA_SHADE))) + { + if (pAkama && pAkama->isAlive()) + { + m_bIsBanished = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + // Shade should move to Akama, not the other way around + AttackStart(pAkama); + + // Crazy amount of threat + m_creature->AddThreat(pAkama, 10000000.0f); + pAkama->AddThreat(m_creature, 10000000.0f); + } + } + } + } + else // No longer banished, let's fight Akama now + { + if (m_uiReduceHealthTimer < uiDiff) + { + if (Creature* pAkama = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_AKAMA_SHADE))) + { + if (pAkama->isAlive()) + { + // 10 % less health every few seconds. + m_creature->DealDamage(pAkama, pAkama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_uiReduceHealthTimer = 12000; + } + else + { + m_bHasKilledAkama = true; // Akama is dead, we stop fighting and disappear + EnterEvadeMode(); + return; + } + } + } + else + m_uiReduceHealthTimer -= uiDiff; + + if (m_bHasKilledAkama) + { + if (m_uiResetTimer < uiDiff) + { + EnterEvadeMode(); // Reset a little while after killing Akama + return; + } + else + m_uiResetTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +struct MANGOS_DLL_DECL npc_akamaAI : public ScriptedAI +{ + npc_akamaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsShadeDead = false; + m_bCanStartCombat = false; + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiDestructivePoisonTimer; + uint32 m_uiLightningBoltTimer; + uint32 m_uiCheckTimer; + uint32 m_uiCastSoulRetrieveTimer; + uint32 m_uiSoulRetrieveTimer; + uint32 m_uiSummonBrokenTimer; + uint32 m_uiEndingTalkCount; + uint32 m_uiWayPointId; + uint32 m_uiBrokenSummonIndex; + + std::list m_lBrokenGUIDList; + + bool m_bIsEventBegun; + bool m_bIsShadeDead; + bool m_bCanStartCombat; + bool m_bHasYelledOnce; + + void Reset() + { + SetCombatMovement(false); + + m_uiDestructivePoisonTimer = 15000; + m_uiLightningBoltTimer = 10000; + m_uiCheckTimer = 2000; + m_uiCastSoulRetrieveTimer = 0; + m_uiSoulRetrieveTimer = 0; + m_uiSummonBrokenTimer = 0; + m_uiEndingTalkCount = 0; + m_uiWayPointId = 0; + m_uiBrokenSummonIndex = 0; + + m_lBrokenGUIDList.clear(); + + m_bIsEventBegun = false; + m_bHasYelledOnce = false; + + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + + void BeginEvent() + { + if (!m_pInstance) + return; + + if (Creature* pShade = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + if (boss_shade_of_akamaAI* pShadeAI = dynamic_cast(pShade->AI())) + pShadeAI->PrepareChannelers(); + + // Prevent players from trying to restart event + m_pInstance->SetData(TYPE_SHADE, IN_PROGRESS); + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + pShade->AddThreat(m_creature, 1000000.0f); + pShade->SetInCombatWith(m_creature); + m_creature->SetInCombatWith(pShade); + + pShade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + pShade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + + pShade->SetInCombatWithZone(); + + m_bIsEventBegun = true; + } + } + + void MovementInform(uint32 uiMoveType, uint32 uiPointId) + { + if (uiMoveType != POINT_MOTION_TYPE || !m_pInstance) + return; + + switch(uiPointId) + { + case 0: + ++m_uiWayPointId; + break; + case 1: + if (Creature* pShade = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + DoCastSpellIfCan(pShade, SPELL_AKAMA_SOUL_RETRIEVE); + m_uiEndingTalkCount = 0; + m_uiSoulRetrieveTimer = 16000; + } + break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_bIsEventBegun || !m_pInstance) + return; + + if (!m_bCanStartCombat) + { + if (Creature* pShade = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + if (!pShade->isAlive()) + { + EnterEvadeMode(); + return; + } + + if (boss_shade_of_akamaAI* pShadeAI = dynamic_cast(pShade->AI())) + { + if (pShadeAI->m_bIsBanished) + { + if (m_uiCastSoulRetrieveTimer < uiDiff) + { + DoCastSpellIfCan(pShade, SPELL_AKAMA_SOUL_CHANNEL); + m_uiCastSoulRetrieveTimer = 500; + } + else + m_uiCastSoulRetrieveTimer -= uiDiff; + } + else + { + m_creature->InterruptNonMeleeSpells(false); + m_bCanStartCombat = true; + } + } + } + } + + if (m_bIsShadeDead && (m_uiWayPointId == 1)) + { + m_creature->GetMotionMaster()->MovePoint(m_uiWayPointId, m_afAkamaWP[1].m_fX, m_afAkamaWP[1].m_fY, m_afAkamaWP[1].m_fZ); + ++m_uiWayPointId; + } + + if (!m_bIsShadeDead && m_bCanStartCombat) + { + if (m_uiCheckTimer < uiDiff) + { + if (Creature* pShade = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + if (!pShade->isAlive()) + { + m_bIsShadeDead = true; + m_uiWayPointId = 0; + m_creature->AddSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->GetMotionMaster()->MovePoint(m_uiWayPointId, m_afAkamaWP[0].m_fX, m_afAkamaWP[0].m_fY, m_afAkamaWP[0].m_fZ); + } + } + m_uiCheckTimer = 5000; + } + else + m_uiCheckTimer -= uiDiff; + } + + if (m_uiSummonBrokenTimer && m_uiBrokenSummonIndex < 4) + { + if (m_uiSummonBrokenTimer <= uiDiff) + { + for(uint8 i = 0; i < 4; ++i) + { + float x = m_afBrokenSpawnLoc[m_uiBrokenSummonIndex].m_fX + (i*5); + float y = m_afBrokenSpawnLoc[m_uiBrokenSummonIndex].m_fY + (1*5); + float z = m_afBrokenSpawnLoc[m_uiBrokenSummonIndex].m_fZ; + float o = m_afBrokenSpawnLoc[m_uiBrokenSummonIndex].m_fO; + + if (Creature* pBroken = m_creature->SummonCreature(NPC_ASH_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) + { + float wx = m_afBrokenWP[m_uiBrokenSummonIndex].m_fX + (i*5); + float wy = m_afBrokenWP[m_uiBrokenSummonIndex].m_fY + (i*5); + float wz = m_afBrokenWP[m_uiBrokenSummonIndex].m_fZ; + + pBroken->GetMotionMaster()->MovePoint(0, wx, wy, wz); + pBroken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_lBrokenGUIDList.push_back(pBroken->GetGUID()); + } + } + + ++m_uiBrokenSummonIndex; + m_uiSummonBrokenTimer = 1000; + } + else + m_uiSummonBrokenTimer -= uiDiff; + } + + if (m_uiSoulRetrieveTimer) + { + if (m_uiSoulRetrieveTimer <= uiDiff) + { + switch(m_uiEndingTalkCount) + { + case 0: + m_creature->HandleEmote(EMOTE_ONESHOT_ROAR); + ++m_uiEndingTalkCount; + m_uiSoulRetrieveTimer = 2000; + m_uiSummonBrokenTimer = 1; + break; + case 1: + DoScriptText(SAY_FREE, m_creature); + ++m_uiEndingTalkCount; + m_uiSoulRetrieveTimer = 25000; + break; + case 2: + if (!m_lBrokenGUIDList.empty()) + { + bool bYelled = false; + + for(std::list::iterator itr = m_lBrokenGUIDList.begin(); itr != m_lBrokenGUIDList.end(); ++itr) + { + if (Creature* pBroken = m_creature->GetMap()->GetCreature(*itr)) + { + if (!bYelled) + { + DoScriptText(SAY_BROKEN_FREE_01, pBroken); + bYelled = true; + } + + pBroken->HandleEmote(EMOTE_ONESHOT_KNEEL); + } + } + } + ++m_uiEndingTalkCount; + m_uiSoulRetrieveTimer = 1500; + break; + case 3: + if (!m_lBrokenGUIDList.empty()) + { + for(std::list::iterator itr = m_lBrokenGUIDList.begin(); itr != m_lBrokenGUIDList.end(); ++itr) + { + // This is the incorrect spell, but can't seem to find the right one. + if (Creature* pBroken = m_creature->GetMap()->GetCreature(*itr)) + pBroken->CastSpell(pBroken, 39656, true); + } + } + ++m_uiEndingTalkCount; + m_uiSoulRetrieveTimer = 5000; + break; + case 4: + if (!m_lBrokenGUIDList.empty()) + { + for(std::list::iterator itr = m_lBrokenGUIDList.begin(); itr != m_lBrokenGUIDList.end(); ++itr) + { + if (Creature* pBroken = m_creature->GetMap()->GetCreature(*itr)) + DoScriptText(SAY_BROKEN_FREE_02, pBroken); + } + } + m_uiSoulRetrieveTimer = 0; + break; + } + } + else + m_uiSoulRetrieveTimer -= uiDiff; + } + + if (!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + return; + + if (!m_bHasYelledOnce && m_creature->GetHealthPercent() < 15.0f) + { + DoScriptText(SAY_LOW_HEALTH, m_creature); + m_bHasYelledOnce = true; + } + + if (m_uiDestructivePoisonTimer < uiDiff) + { + if (Creature* pShade = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + if (pShade->isAlive()) + DoCastSpellIfCan(pShade, SPELL_DESTRUCTIVE_POISON); + } + + m_uiDestructivePoisonTimer = 15000; + } + else + m_uiDestructivePoisonTimer -= uiDiff; + + if (m_uiLightningBoltTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); + m_uiLightningBoltTimer = 10000; + } + else + m_uiLightningBoltTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pCreature->GetInstanceData()) + { + if (pInstance->GetData(TYPE_SHADE) != DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + } + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (npc_akamaAI* pAkamaAI = dynamic_cast(pCreature->AI())) + pAkamaAI->BeginEvent(); + } + + return true; +} + +struct MANGOS_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI +{ + mob_ashtongue_channelerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + if (m_pInstance) + { + //self-resurrect if encounter not done and we are dead + if (!m_creature->isAlive() && m_pInstance->GetData(TYPE_SHADE) != DONE) + m_creature->Respawn(); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + + void AttackStart(Unit* pWho) {} + void MoveInLineOfSight(Unit* pWho) {} + + void JustDied(Unit* pKiller) + { + if (!m_pInstance) + return; + + if (Creature* pShade = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + if (pShade->isAlive()) + { + if (boss_shade_of_akamaAI* pShadeAI = dynamic_cast(pShade->AI())) + pShadeAI->IncrementDeathCount(); + else + error_log("SD2: mob_ashtongue_channelerAI dead but unable to increment DeathCount for Shade of Akama."); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->isAlive()) + return; + + //start channel (not nice way to start channeling) + if (!m_creature->IsNonMeleeSpellCasted(false) && !m_creature->getVictim() && m_pInstance) + { + if (Creature* pShade = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + m_creature->CastSpell(pShade, SPELL_SHADE_SOUL_CHANNEL, false); + } + } +}; + +struct MANGOS_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI +{ + mob_ashtongue_sorcererAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiCheckTimer; + bool m_bStartBanishing; + + void Reset() + { + m_uiCheckTimer = 5000; + m_bStartBanishing = false; + } + + void AttackStart(Unit* pWho) {} + void MoveInLineOfSight(Unit* pWho) {} + + void JustDied(Unit* pKiller) + { + if (!m_pInstance) + return; + + if (Creature* pShade = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA))) + { + if (pShade->isAlive()) + { + if (boss_shade_of_akamaAI* pShadeAI = dynamic_cast(pShade->AI())) + pShadeAI->IncrementDeathCount(m_creature->GetGUID()); + else + error_log("SD2: mob_ashtongue_sorcererAI dead but unable to increment DeathCount for Shade of Akama."); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bStartBanishing || !m_pInstance) + return; + + if (m_uiCheckTimer < uiDiff) + { + Creature* pShade = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SHADEOFAKAMA)); + + if (pShade && pShade->isAlive() && m_creature->isAlive()) + { + if (m_creature->IsWithinDist(pShade, 20.0f, false)) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + DoCastSpellIfCan(pShade, SPELL_SHADE_SOUL_CHANNEL, CAST_TRIGGERED); + + m_bStartBanishing = true; + } + } + m_uiCheckTimer = 2000; + } + else + m_uiCheckTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) +{ + return new boss_shade_of_akamaAI(pCreature); +} + +CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) +{ + return new npc_akamaAI(pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) +{ + return new mob_ashtongue_channelerAI(pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) +{ + return new mob_ashtongue_sorcererAI(pCreature); +} + +void AddSC_boss_shade_of_akama() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_shade_of_akama"; + newscript->GetAI = &GetAI_boss_shade_of_akama; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akama_shade"; + newscript->GetAI = &GetAI_npc_akama_shade; + newscript->pGossipHello = &GossipHello_npc_akama; + newscript->pGossipSelect = &GossipSelect_npc_akama; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ashtongue_channeler"; + newscript->GetAI = &GetAI_mob_ashtongue_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ashtongue_sorcerer"; + newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_supremus.cpp b/scripts/outland/black_temple/boss_supremus.cpp new file mode 100644 index 0000000..64ee18c --- /dev/null +++ b/scripts/outland/black_temple/boss_supremus.cpp @@ -0,0 +1,396 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Supremus +SD%Complete: 95 +SDComment: Need to implement molten punch +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +#define EMOTE_NEW_TARGET -1564010 +#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, m_creature); +#define EMOTE_GROUND_CRACK -1564012 + +//Spells +#define SPELL_HURTFUL_STRIKE 41926 +#define SPELL_DEMON_FIRE 40029 +#define SPELL_MOLTEN_FLAME 40253 +#define SPELL_VOLCANIC_ERUPTION 40276 +#define SPELL_VOLCANIC_FIREBALL 40118 +#define SPELL_VOLCANIC_GEYSER 42055 +#define SPELL_MOLTEN_PUNCH 40126 +#define SPELL_BERSERK 45078 + +#define CREATURE_VOLCANO 23085 +#define CREATURE_STALKER 23095 + +struct MANGOS_DLL_DECL molten_flameAI : public ScriptedAI +{ + molten_flameAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint64 SupremusGUID; + bool TargetLocked; + uint32 CheckTimer; + + void Reset() + { + SupremusGUID = 0; + TargetLocked = false; + + CheckTimer = 1000; + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit *who) + { + if (TargetLocked) + return; + + // stop it from aggroing players who move in LOS if we have a target. + if (who && (who != m_creature) && (m_creature->IsWithinDistInMap(who, 10))) + StalkTarget(who); + } + + void SetSupremusGUID(uint64 GUID) { SupremusGUID = GUID; } + + void StalkTarget(Unit* target) + { + if (!target) + return; + + m_creature->AddThreat(target, 50000000.0f); + m_creature->GetMotionMaster()->MoveChase(target); + DoCastSpellIfCan(m_creature, SPELL_DEMON_FIRE, CAST_TRIGGERED); + // DoCastSpellIfCan(m_creature, SPELL_MOLTEN_FLAME, CAST_TRIGGERED); // This spell damages self, so disabled for now + TargetLocked = true; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget()) + return; + + if (m_creature->getVictim() && m_creature->isAlive()) + { + if (CheckTimer < diff) + { + if (SupremusGUID) + { + Unit* Supremus = m_creature->GetMap()->GetCreature(SupremusGUID); + if (Supremus && (!Supremus->isAlive())) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + CheckTimer = 2000; + }else CheckTimer -= diff; + } + } +}; + +struct MANGOS_DLL_DECL npc_volcanoAI : public ScriptedAI +{ + npc_volcanoAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 CheckTimer; + uint64 SupremusGUID; + uint32 FireballTimer; + uint32 GeyserTimer; + + void Reset() + { + CheckTimer = 1000; + SupremusGUID = 0; + FireballTimer = 500; + GeyserTimer = 0; + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void SetSupremusGUID(uint64 guid) { SupremusGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (SupremusGUID) + { + Unit* Supremus = m_creature->GetMap()->GetCreature(SupremusGUID); + if (Supremus && (!Supremus->isAlive())) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), 0, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + CheckTimer = 2000; + }else CheckTimer -= diff; + + if (GeyserTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_VOLCANIC_GEYSER); + GeyserTimer = 18000; + }else GeyserTimer -= diff; + } +}; + +struct MANGOS_DLL_DECL boss_supremusAI : public ScriptedAI +{ + boss_supremusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 SummonFlameTimer; + uint32 SwitchTargetTimer; + uint32 PhaseSwitchTimer; + uint32 SummonVolcanoTimer; + uint32 HurtfulStrikeTimer; + uint32 BerserkTimer; + + bool Phase1; + + void Reset() + { + HurtfulStrikeTimer = 5000; + SummonFlameTimer = 20000; + SwitchTargetTimer = 90000; + PhaseSwitchTimer = 60000; + SummonVolcanoTimer = 5000; + BerserkTimer = 900000; // 15 minute enrage + + Phase1 = true; + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SUPREMUS, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SUPREMUS, IN_PROGRESS); + } + + void JustDied(Unit *killer) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SUPREMUS, DONE); + } + + float CalculateRandomCoord(float initial) + { + float coord = 0; + + switch(urand(0, 1)) + { + case 0: coord = initial + 20 + rand()%20; break; + case 1: coord = initial - 20 - rand()%20; break; + } + + return coord; + } + + Creature* SummonCreature(uint32 entry, Unit* target) + { + if (target && entry) + { + Creature* Summon = m_creature->SummonCreature(entry, CalculateRandomCoord(target->GetPositionX()), CalculateRandomCoord(target->GetPositionY()), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 20000); + if (Summon) + { + Summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summon->setFaction(m_creature->getFaction()); + return Summon; + } + } + return NULL; + } + + Unit* CalculateHurtfulStrikeTarget() + { + uint32 health = 0; + Unit* target = NULL; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && m_creature->IsWithinDistInMap(pUnit, ATTACK_DISTANCE)) + { + if (pUnit->GetHealth() > health) + { + health = pUnit->GetHealth(); + target = pUnit; + } + } + } + + return target; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_creature->HasAura(SPELL_BERSERK, EFFECT_INDEX_0)) + { + if (BerserkTimer < diff) + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + else BerserkTimer -= diff; + } + + if (SummonFlameTimer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (!target) // someone is trying to solo, set target as current victim. + target = m_creature->getVictim(); + + if (target) + { + if (Creature* pMoltenFlame = SummonCreature(CREATURE_STALKER, target)) + { + // Invisible model + pMoltenFlame->SetDisplayId(11686); + + if (molten_flameAI* pMoltenAI = dynamic_cast(pMoltenFlame->AI())) + { + pMoltenAI->SetSupremusGUID(m_creature->GetGUID()); + pMoltenAI->StalkTarget(target); + } + + SummonFlameTimer = 20000; + } + } + }else SummonFlameTimer -= diff; + + if (Phase1) + { + if (HurtfulStrikeTimer < diff) + { + Unit* target = CalculateHurtfulStrikeTarget(); + if (target) + { + DoCastSpellIfCan(target, SPELL_HURTFUL_STRIKE); + HurtfulStrikeTimer = 5000; + } + }else HurtfulStrikeTimer -= diff; + } + + if (!Phase1) + { + if (SwitchTargetTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoResetThreat(); + m_creature->AddThreat(target, 5000000.0f); + DoScriptText(EMOTE_NEW_TARGET, m_creature); + SwitchTargetTimer = 10000; + } + }else SwitchTargetTimer -= diff; + + if (SummonVolcanoTimer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (!target) + target = m_creature->getVictim(); + + if (target) + { + if (Creature* pVolcano = SummonCreature(CREATURE_VOLCANO, target)) + { + DoCastSpellIfCan(target, SPELL_VOLCANIC_ERUPTION); + + if (npc_volcanoAI* pVolcanoAI = dynamic_cast(pVolcano->AI())) + pVolcanoAI->SetSupremusGUID(m_creature->GetGUID()); + } + + DoScriptText(EMOTE_GROUND_CRACK, m_creature); + SummonVolcanoTimer = 10000; + } + }else SummonVolcanoTimer -= diff; + } + + if (PhaseSwitchTimer < diff) + { + if (!Phase1) + { + Phase1 = true; + DoResetThreat(); + PhaseSwitchTimer = 60000; + m_creature->SetSpeedRate(MOVE_RUN, 1.0f); + } + else + { + Phase1 = false; + DoResetThreat(); + SwitchTargetTimer = 10000; + SummonVolcanoTimer = 2000; + PhaseSwitchTimer = 60000; + m_creature->SetSpeedRate(MOVE_RUN, 0.9f); + } + }else PhaseSwitchTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_supremus(Creature* pCreature) +{ + return new boss_supremusAI(pCreature); +} + +CreatureAI* GetAI_molten_flame(Creature* pCreature) +{ + return new molten_flameAI(pCreature); +} + +CreatureAI* GetAI_npc_volcano(Creature* pCreature) +{ + return new npc_volcanoAI(pCreature); +} + +void AddSC_boss_supremus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_supremus"; + newscript->GetAI = &GetAI_boss_supremus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "molten_flame"; + newscript->GetAI = &GetAI_molten_flame; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_volcano"; + newscript->GetAI = &GetAI_npc_volcano; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_teron_gorefiend.cpp b/scripts/outland/black_temple/boss_teron_gorefiend.cpp new file mode 100644 index 0000000..51a3e76 --- /dev/null +++ b/scripts/outland/black_temple/boss_teron_gorefiend.cpp @@ -0,0 +1,517 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Teron_Gorefiend +SD%Complete: 60 +SDComment: Requires Mind Control support for Ghosts. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +enum +{ + //Speech'n'sound + SAY_INTRO = -1564037, + SAY_AGGRO = -1564038, + SAY_SLAY1 = -1564039, + SAY_SLAY2 = -1564040, + SAY_SPELL1 = -1564041, + SAY_SPELL2 = -1564042, + SAY_SPECIAL1 = -1564043, + SAY_SPECIAL2 = -1564044, + SAY_ENRAGE = -1564045, + SAY_DEATH = -1564046, + + //Spells + SPELL_INCINERATE = 40239, + SPELL_CRUSHING_SHADOWS = 40243, + SPELL_SHADOWBOLT = 40185, + SPELL_PASSIVE_SHADOWFORM = 40326, + SPELL_SHADOW_OF_DEATH = 40251, + SPELL_BERSERK = 45078, + + SPELL_ATROPHY = 40327, // Shadowy Constructs use this when they get within melee range of a player + + NPC_DOOM_BLOSSOM = 23123, + NPC_SHADOWY_CONSTRUCT = 23111 +}; + +struct MANGOS_DLL_DECL mob_doom_blossomAI : public ScriptedAI +{ + mob_doom_blossomAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 m_uiCheckTeronTimer; + uint32 m_uiShadowBoltTimer; + uint64 m_uiTeronGUID; + + void Reset() + { + m_uiCheckTeronTimer = 5000; + m_uiShadowBoltTimer = 12000; + m_uiTeronGUID = 0; + } + + void AttackStart(Unit* pWho) { } + void MoveInLineOfSight(Unit* pWho) { } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiCheckTeronTimer < uiDiff) + { + if (m_uiTeronGUID) + { + m_creature->SetInCombatWithZone(); + + Creature* pTeron = m_creature->GetMap()->GetCreature(m_uiTeronGUID); + if (pTeron && (!pTeron->isAlive() || pTeron->IsInEvadeMode())) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + m_uiCheckTeronTimer = 5000; + } + else + m_uiCheckTeronTimer -= uiDiff; + + if (!m_creature->getVictim() || !m_creature->SelectHostileTarget()) + return; + + if (m_uiShadowBoltTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_SHADOWBOLT); + + m_uiShadowBoltTimer = 10000; + } + else + m_uiShadowBoltTimer -= uiDiff; + } + + void SetTeronGUID(uint64 uiGUID){ m_uiTeronGUID = uiGUID; } +}; + +struct MANGOS_DLL_DECL mob_shadowy_constructAI : public ScriptedAI +{ + mob_shadowy_constructAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint64 m_uiGhostGUID; + uint64 m_uiTeronGUID; + + uint32 m_uiCheckPlayerTimer; + uint32 m_uiCheckTeronTimer; + + void Reset() + { + m_uiGhostGUID = 0; + m_uiTeronGUID = 0; + + m_uiCheckPlayerTimer = 2000; + m_uiCheckTeronTimer = 5000; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pWho || !pWho->isAlive() || pWho->GetGUID() == m_uiGhostGUID) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + +/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by->GetGUID() != m_uiGhostGUID) + damage = 0; // Only the ghost can deal damage. + } + */ + + void CheckPlayers() + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + if (tList.empty()) + return; // No threat list. Don't continue. + + std::list lTargets; + + for (ThreatList::const_iterator itr = tList.begin(); itr != tList.end(); ++itr) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + if (pUnit && pUnit->isAlive()) + lTargets.push_back(pUnit); + } + + lTargets.sort(ObjectDistanceOrder(m_creature)); + Unit* pTarget = lTargets.front(); + if (pTarget && m_creature->IsWithinDistInMap(pTarget, m_creature->GetAttackDistance(pTarget))) + { + DoCastSpellIfCan(pTarget, SPELL_ATROPHY); + m_creature->AI()->AttackStart(pTarget); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiCheckPlayerTimer < uiDiff) + { + CheckPlayers(); + m_uiCheckPlayerTimer = 3000; + } + else + m_uiCheckPlayerTimer -= uiDiff; + + if (m_uiCheckTeronTimer < uiDiff) + { + Creature* pTeron = m_creature->GetMap()->GetCreature(m_uiTeronGUID); + if (!pTeron || !pTeron->isAlive() || pTeron->IsInEvadeMode()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + m_uiCheckTeronTimer = 5000; + } + else + m_uiCheckTeronTimer -= uiDiff; + } +}; + +struct MANGOS_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI +{ + boss_teron_gorefiendAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiIncinerateTimer; + uint32 m_uiSummonDoomBlossomTimer; + uint32 m_uiEnrageTimer; + uint32 m_uiCrushingShadowsTimer; + uint32 m_uiShadowOfDeathTimer; + uint32 m_uiSummonShadowsTimer; + uint32 m_uiRandomYellTimer; + uint32 m_uiAggroTimer; + + uint64 m_uiAggroTargetGUID; + uint64 m_uiGhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost + + bool m_bIntro; + + void Reset() + { + m_uiIncinerateTimer = urand(20000, 30000); + m_uiSummonDoomBlossomTimer = 12000; + m_uiEnrageTimer = MINUTE*10*IN_MILLISECONDS; + m_uiCrushingShadowsTimer = 22000; + m_uiSummonShadowsTimer = 60000; + m_uiRandomYellTimer = 50000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Start off unattackable so that the intro is done properly + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiAggroTimer = 20000; + m_uiAggroTargetGUID = 0; + m_bIntro = false; + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GOREFIEND, NOT_STARTED); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_GOREFIEND)!= IN_PROGRESS && !m_bIntro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && + m_creature->IsHostileTo(pWho) && pWho->isInAccessablePlaceFor(m_creature)) + { + if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho)) + { + m_pInstance->SetData(TYPE_GOREFIEND, IN_PROGRESS); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + DoScriptText(SAY_INTRO, m_creature); + + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); + m_uiAggroTargetGUID = pWho->GetGUID(); + m_bIntro = true; + } + } + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GOREFIEND, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + float CalculateRandomLocation(float fLoc, uint32 uiRadius) + { + return fLoc + urand(0, 1) ? -rand()%uiRadius : rand()%uiRadius; + } + + void SetThreatList(Creature* pCreature) + { + if (!pCreature) + return; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && pUnit->isAlive()) + { + float threat = m_creature->getThreatManager().getThreat(pUnit); + pCreature->AddThreat(pUnit, threat); + } + } + } + + void MindControlGhost() + { + /************************************************************************/ + /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ + /** ONLY AFTER MaNGOS FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ + /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ + /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ + /************************************************************************/ + + Player* pGhost = NULL; + if (m_uiGhostGUID) + pGhost = m_creature->GetMap()->GetPlayer(m_uiGhostGUID); + + if (pGhost && pGhost->isAlive() && pGhost->HasAura(SPELL_SHADOW_OF_DEATH, EFFECT_INDEX_0)) + { + /*float x,y,z; + pGhost->GetPosition(x,y,z); + Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); + if (control) + { + ((Player*)pGhost)->Possess(control); + pGhost->DealDamage(pGhost, pGhost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, + false); + }*/ + for(uint8 i = 0; i < 4; ++i) + { + float fX = CalculateRandomLocation(pGhost->GetPositionX(), 10); + float fY = CalculateRandomLocation(pGhost->GetPositionY(), 10); + + if (Creature* pConstruct = m_creature->SummonCreature(NPC_SHADOWY_CONSTRUCT, fX, fY, pGhost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000)) + { + pConstruct->CastSpell(pConstruct, SPELL_PASSIVE_SHADOWFORM, true); + + SetThreatList(pConstruct); // Use same function as Doom Blossom to set Threat List. + if (mob_shadowy_constructAI* pConstructAI = dynamic_cast(pConstruct->AI())) + pConstructAI->m_uiGhostGUID = m_uiGhostGUID; + + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + pConstruct->GetMotionMaster()->MoveChase(pTarget ? pTarget : m_creature->getVictim()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bIntro) + { + if (m_uiAggroTimer < uiDiff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + m_bIntro = false; + if (m_uiAggroTargetGUID) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiAggroTargetGUID)) + AttackStart(pPlayer); + + m_creature->SetInCombatWithZone(); + } + else + EnterEvadeMode(); + } + else + m_uiAggroTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim() || m_bIntro) + return; + + if (m_uiSummonShadowsTimer < uiDiff) + { + //MindControlGhost(); + for(uint8 i = 0; i < 2; ++i) + { + float fX = CalculateRandomLocation(m_creature->GetPositionX(), 10); + + if (Creature* pShadow = m_creature->SummonCreature(NPC_SHADOWY_CONSTRUCT, fX, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0)) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + pShadow->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); + } + } + m_uiSummonShadowsTimer = 60000; + } + else + m_uiSummonShadowsTimer -= uiDiff; + + if (m_uiSummonDoomBlossomTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + float fX = CalculateRandomLocation(pTarget->GetPositionX(), 20); + float fY = CalculateRandomLocation(pTarget->GetPositionY(), 20); + + if (Creature* pDoomBlossom = m_creature->SummonCreature(NPC_DOOM_BLOSSOM, fX, fY, pTarget->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000)) + { + pDoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pDoomBlossom->setFaction(m_creature->getFaction()); + pDoomBlossom->AddThreat(pTarget); + + if (mob_doom_blossomAI* pDoomBlossomAI = dynamic_cast(pDoomBlossom->AI())) + pDoomBlossomAI->SetTeronGUID(m_creature->GetGUID()); + + SetThreatList(pDoomBlossom); + } + + m_uiSummonDoomBlossomTimer = 35000; + } + } + else + m_uiSummonDoomBlossomTimer -= uiDiff; + + if (m_uiIncinerateTimer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); + + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + DoCastSpellIfCan(pTarget ? pTarget : m_creature->getVictim(), SPELL_INCINERATE); + m_uiIncinerateTimer = urand(20000, 50000); + } + else + m_uiIncinerateTimer -= uiDiff; + + if (m_uiCrushingShadowsTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget && pTarget->isAlive()) + DoCastSpellIfCan(pTarget, SPELL_CRUSHING_SHADOWS); + + m_uiCrushingShadowsTimer = urand(10000, 26000); + } + else + m_uiCrushingShadowsTimer -= uiDiff; + + /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ + /*if (m_uiShadowOfDeathTimer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (!pTarget) + pTarget = m_creature->getVictim(); + + if (pTarget && pTarget->isAlive() && pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(pTarget, SPELL_SHADOW_OF_DEATH); + m_uiGhostGUID = pTarget->GetGUID(); + m_uiShadowOfDeathTimer = 30000; + m_uiSummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the pPlayer + } + }else m_uiShadowOfDeathTimer -= uiDiff;*/ + + if (m_uiRandomYellTimer < uiDiff) + { + DoScriptText(urand(0, 1) ? SAY_SPELL1 : SAY_SPELL2, m_creature); + m_uiRandomYellTimer = urand(50000, 100000); + } + else + m_uiRandomYellTimer -= uiDiff; + + if (!m_creature->HasAura(SPELL_BERSERK, EFFECT_INDEX_0)) + { + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + } + else + m_uiEnrageTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) +{ + return new mob_doom_blossomAI(pCreature); +} + +CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) +{ + return new mob_shadowy_constructAI(pCreature); +} + +CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) +{ + return new boss_teron_gorefiendAI(pCreature); +} + +void AddSC_boss_teron_gorefiend() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_doom_blossom"; + newscript->GetAI = &GetAI_mob_doom_blossom; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowy_construct"; + newscript->GetAI = &GetAI_mob_shadowy_construct; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_teron_gorefiend"; + newscript->GetAI = &GetAI_boss_teron_gorefiend; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/boss_warlord_najentus.cpp b/scripts/outland/black_temple/boss_warlord_najentus.cpp new file mode 100644 index 0000000..38a20c1 --- /dev/null +++ b/scripts/outland/black_temple/boss_warlord_najentus.cpp @@ -0,0 +1,214 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Najentus +SD%Complete: 90 +SDComment: Does the GO need script? Uncomment code to test. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +enum +{ + SAY_AGGRO = -1564000, + SAY_NEEDLE1 = -1564001, + SAY_NEEDLE2 = -1564002, + SAY_SLAY1 = -1564003, + SAY_SLAY2 = -1564004, + SAY_SPECIAL1 = -1564005, + SAY_SPECIAL2 = -1564006, + SAY_ENRAGE1 = -1564007, //is this text actually in use? + SAY_ENRAGE2 = -1564008, + SAY_DEATH = -1564009, + + SPELL_CRASHINGWAVE = 40100, + SPELL_NEEDLE_SPINE = 39835, + SPELL_NEEDLE_AOE = 39968, + SPELL_TIDAL_BURST = 39878, + SPELL_TIDAL_SHIELD = 39872, // Not going to use this since Hurl Spine doesn't dispel it. + SPELL_IMPALING_SPINE = 39837, + SPELL_CREATE_NAJENTUS_SPINE = 39956, + SPELL_HURL_SPINE = 39948, + SPELL_BERSERK = 26662 +}; + +struct MANGOS_DLL_DECL boss_najentusAI : public ScriptedAI +{ + boss_najentusAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiNeedleSpineTimer; + uint32 m_uiEnrageTimer; + uint32 m_uiSpecialYellTimer; + uint32 m_uiTidalShieldTimer; + uint32 m_uiImpalingSpineTimer; + + bool m_bIsShielded; + + void Reset() + { + m_bIsShielded = false; + + m_uiNeedleSpineTimer = 10000; + m_uiEnrageTimer = MINUTE*8*IN_MILLISECONDS; + m_uiSpecialYellTimer = urand(45000, 120000); + m_uiTidalShieldTimer = 60000; + m_uiImpalingSpineTimer = 20000; + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NAJENTUS, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit *victim) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NAJENTUS, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (m_bIsShielded) + { + if (spell->Id == SPELL_HURL_SPINE) + { + if (m_creature->HasAura(SPELL_TIDAL_SHIELD, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); + + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TIDAL_BURST); + m_bIsShielded = false; + } + } + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NAJENTUS, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->SetInCombatWithZone(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiEnrageTimer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_ENRAGE2, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BERSERK); + m_uiEnrageTimer = MINUTE*8*IN_MILLISECONDS; + }else m_uiEnrageTimer -= diff; + + if (m_bIsShielded) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + return; // Don't cast or do anything while Shielded + } + + // Needle + if (m_uiNeedleSpineTimer < diff) + { + for(uint8 i = 0; i < 3; ++i) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (!target) + target = m_creature->getVictim(); + + DoCastSpellIfCan(target, SPELL_NEEDLE_SPINE); + target->CastSpell(target, SPELL_NEEDLE_AOE, false); + } + + m_uiNeedleSpineTimer = 3000; + }else m_uiNeedleSpineTimer -= diff; + + if (m_uiSpecialYellTimer < diff) + { + DoScriptText(urand(0, 1) ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); + m_uiSpecialYellTimer = urand(25000, 100000); + }else m_uiSpecialYellTimer -= diff; + + if (m_uiImpalingSpineTimer < diff) + { + Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (!target) + target = m_creature->getVictim(); + + if (target && (target->GetTypeId() == TYPEID_PLAYER)) + { + DoCastSpellIfCan(target, SPELL_IMPALING_SPINE); + m_uiImpalingSpineTimer = 20000; + + DoScriptText(urand(0, 1) ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature); + } + }else m_uiImpalingSpineTimer -= diff; + + if (m_uiTidalShieldTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_TIDAL_SHIELD, CAST_TRIGGERED); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + m_bIsShielded = true; + m_uiTidalShieldTimer = 60000; + }else m_uiTidalShieldTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_najentus(Creature* pCreature) +{ + return new boss_najentusAI(pCreature); +} + +void AddSC_boss_najentus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_najentus"; + newscript->GetAI = &GetAI_boss_najentus; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/illidari_council.cpp b/scripts/outland/black_temple/illidari_council.cpp new file mode 100644 index 0000000..d39fd6a --- /dev/null +++ b/scripts/outland/black_temple/illidari_council.cpp @@ -0,0 +1,861 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Illidari_Council +SD%Complete: 85 +SDComment: Circle of Healing not working properly. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +//Speech'n'Sounds +#define SAY_GATH_SLAY -1564085 +#define SAY_GATH_SLAY_COMNT -1564089 +#define SAY_GATH_DEATH -1564093 +#define SAY_GATH_SPECIAL1 -1564077 +#define SAY_GATH_SPECIAL2 -1564081 + +#define SAY_VERA_SLAY -1564086 +#define SAY_VERA_COMNT -1564089 +#define SAY_VERA_DEATH -1564094 +#define SAY_VERA_SPECIAL1 -1564078 +#define SAY_VERA_SPECIAL2 -1564082 + +#define SAY_MALA_SLAY -1564087 +#define SAY_MALA_COMNT -1564090 +#define SAY_MALA_DEATH -1564095 +#define SAY_MALA_SPECIAL1 -1564079 +#define SAY_MALA_SPECIAL2 -1564083 + +#define SAY_ZERE_SLAY -1564088 +#define SAY_ZERE_COMNT -1564091 +#define SAY_ZERE_DEATH -1564096 +#define SAY_ZERE_SPECIAL1 -1564080 +#define SAY_ZERE_SPECIAL2 -1564084 + +#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." + +struct CouncilYells +{ + int32 entry; + uint32 timer; +}; + +static CouncilYells CouncilAggro[]= +{ + {-1564069, 5000}, // Gathios + {-1564070, 5500}, // Veras + {-1564071, 5000}, // Malande + {-1564072, 0}, // Zerevor +}; + +// Need to get proper timers for this later +static CouncilYells CouncilEnrage[]= +{ + {-1564073, 2000}, // Gathios + {-1564074, 6000}, // Veras + {-1564075, 5000}, // Malande + {-1564076, 0}, // Zerevor +}; + +// High Nethermancer Zerevor's spells +#define SPELL_FLAMESTRIKE 41481 +#define SPELL_BLIZZARD 41482 +#define SPELL_ARCANE_BOLT 41483 +#define SPELL_ARCANE_EXPLOSION 41524 +#define SPELL_DAMPEN_MAGIC 41478 + +// Lady Malande's spells +#define SPELL_EMPOWERED_SMITE 41471 +#define SPELL_CIRCLE_OF_HEALING 41455 +#define SPELL_REFLECTIVE_SHIELD 41475 +#define SPELL_DIVINE_WRATH 41472 +#define SPELL_HEAL_VISUAL 24171 + +// Gathios the Shatterer's spells +#define SPELL_BLESS_PROTECTION 41450 +#define SPELL_BLESS_SPELLWARD 41451 +#define SPELL_CONSECRATION 41541 +#define SPELL_HAMMER_OF_JUSTICE 41468 +#define SPELL_SEAL_OF_COMMAND 41469 +#define SPELL_SEAL_OF_BLOOD 41459 +#define SPELL_CHROMATIC_AURA 41453 +#define SPELL_DEVOTION_AURA 41452 + +// Veras Darkshadow's spells +#define SPELL_DEADLY_POISON 41485 +#define SPELL_ENVENOM 41487 +#define SPELL_VANISH 41479 + +#define SPELL_BERSERK 45078 + +struct MANGOS_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI +{ + mob_blood_elf_council_voice_triggerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + Reset(); + } + + uint64 Council[4]; + + uint32 EnrageTimer; + uint32 AggroYellTimer; + + uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells + + bool EventStarted; + + void Reset() + { + EnrageTimer = 900000; // 15 minutes + AggroYellTimer = 500; + YellCounter = 0; + + EventStarted = false; + } + + // finds and stores the GUIDs for each Council member using instance data system. + void LoadCouncilGUIDs() + { + if (ScriptedInstance* pInstance = (ScriptedInstance*)m_creature->GetInstanceData()) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + }else error_log(ERROR_INST_DATA); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!EventStarted) + return; + + if (YellCounter > 3) + return; + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + if (Creature* pMember = m_creature->GetMap()->GetCreature(Council[YellCounter])) + { + DoScriptText(CouncilAggro[YellCounter].entry, pMember); + AggroYellTimer = CouncilAggro[YellCounter].timer; + } + ++YellCounter; + + if (YellCounter > 3) + YellCounter = 0; // Reuse for Enrage Yells + }else AggroYellTimer -= diff; + } + + if (EnrageTimer) + { + if (EnrageTimer <= diff) + { + if (Creature* pMember = m_creature->GetMap()->GetCreature(Council[YellCounter])) + { + pMember->CastSpell(pMember, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + EnrageTimer = CouncilEnrage[YellCounter].timer; + } + ++YellCounter; + }else EnrageTimer -= diff; + } + } +}; + +struct MANGOS_DLL_DECL mob_illidari_councilAI : public ScriptedAI +{ + mob_illidari_councilAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint64 Council[4]; + + uint32 CheckTimer; + uint32 EndEventTimer; + + uint8 DeathCount; + + bool EventBegun; + + void Reset() + { + CheckTimer = 2000; + EndEventTimer = 0; + + DeathCount = 0; + + for(uint8 i = 0; i < 4; ++i) + { + if (Creature* pMember = m_creature->GetMap()->GetCreature(Council[i])) + { + if (!pMember->isAlive()) + { + pMember->RemoveCorpse(); + pMember->Respawn(); + } + pMember->AI()->EnterEvadeMode(); + } + } + + EventBegun = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(11686); + + if (m_pInstance) + { + //if already done, not do anything + if (m_pInstance->GetData(TYPE_COUNCIL) == DONE) + return; + + if (Creature* VoiceTrigger = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))) + VoiceTrigger->AI()->EnterEvadeMode(); + + m_pInstance->SetData(TYPE_COUNCIL, NOT_STARTED); + } + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void StartEvent(Unit *target) + { + if (!m_pInstance) + return; + + if (target && target->isAlive() && !EventBegun) + { + Council[0] = m_pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = m_pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = m_pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = m_pInstance->GetData64(DATA_VERASDARKSHADOW); + + // Start the event for the Voice Trigger + if (Creature* pVoiceTrigger = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))) + { + if (mob_blood_elf_council_voice_triggerAI* pVoiceAI = dynamic_cast(pVoiceTrigger->AI())) + { + pVoiceAI->LoadCouncilGUIDs(); + pVoiceAI->EventStarted = true; + } + } + + for(uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + Creature* pMember = m_creature->GetMap()->GetCreature(Council[i]); + if (pMember && pMember->isAlive()) + pMember->AI()->AttackStart(target); + } + } + + m_pInstance->SetData(TYPE_COUNCIL, IN_PROGRESS); + + EventBegun = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) + return; + + if (EndEventTimer) + { + if (EndEventTimer <= diff) + { + if (DeathCount > 3) + { + if (m_pInstance) + { + if (Creature* VoiceTrigger = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE))) + VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + m_pInstance->SetData(TYPE_COUNCIL, DONE); + } + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + + Creature* pMember = m_creature->GetMap()->GetCreature(Council[DeathCount]); + if (pMember && pMember->isAlive()) + pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + ++DeathCount; + EndEventTimer = 1500; + }else EndEventTimer -= diff; + } + + if (CheckTimer) + { + if (CheckTimer <= diff) + { + uint8 EvadeCheck = 0; + for(uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + if (Creature* Member = m_creature->GetMap()->GetCreature(Council[i])) + { + // This is the evade/death check. + if (Member->isAlive() && !Member->SelectHostileTarget()) + ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event + else if (!Member->isAlive()) //If even one member dies, kill the rest, set instance data, and kill self. + { + EndEventTimer = 1000; + CheckTimer = 0; + return; + } + } + } + } + + if (EvadeCheck > 3) + Reset(); + + CheckTimer = 2000; + }else CheckTimer -= diff; + } + } +}; + +struct MANGOS_DLL_DECL boss_illidari_councilAI : public ScriptedAI +{ + boss_illidari_councilAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + + LoadedGUIDs = false; + } + + ScriptedInstance* m_pInstance; + + uint64 Council[4]; + + bool LoadedGUIDs; + + void Aggro(Unit* pWho) + { + if (m_pInstance) + { + if (Creature* pController = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_ILLIDARICOUNCIL))) + { + if (mob_illidari_councilAI* pControlAI = dynamic_cast(pController->AI())) + pControlAI->StartEvent(pWho); + } + } + else + { + error_log(ERROR_INST_DATA); + EnterEvadeMode(); + } + + m_creature->SetInCombatWithZone(); + + // Load GUIDs on first aggro because the creature guids are only set as the creatures are created in world- + // this means that for each creature, it will attempt to LoadGUIDs even though some of the other creatures are + // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures + // have been loaded and have their GUIDs set in the instance data system. + if (!LoadedGUIDs) + LoadGUIDs(); + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by == m_creature) + return; + + damage /= 4; + for(uint8 i = 0; i < 4; ++i) + { + if (Creature* pCouncil = m_creature->GetMap()->GetCreature(Council[i])) + { + if (pCouncil != m_creature && damage < pCouncil->GetHealth()) + pCouncil->SetHealth(pCouncil->GetHealth() - damage); + } + } + } + + void LoadGUIDs() + { + if (!m_pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + + Council[0] = m_pInstance->GetData64(DATA_LADYMALANDE); + Council[1] = m_pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = m_pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[3] = m_pInstance->GetData64(DATA_VERASDARKSHADOW); + + LoadedGUIDs = true; + } +}; + +struct MANGOS_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI +{ + boss_gathios_the_shattererAI(Creature* pCreature) : boss_illidari_councilAI(pCreature) { Reset(); } + + uint32 ConsecrationTimer; + uint32 HammerOfJusticeTimer; + uint32 SealTimer; + uint32 AuraTimer; + uint32 BlessingTimer; + + void Reset() + { + ConsecrationTimer = 40000; + HammerOfJusticeTimer = 10000; + SealTimer = 40000; + AuraTimer = 90000; + BlessingTimer = 60000; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_GATH_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_GATH_DEATH, m_creature); + } + + Unit* SelectCouncilMember() + { + Unit* pUnit = m_creature; + uint32 member = 0; // He chooses Lady Malande most often + + if (!urand(0, 9)) // But there is a chance he picks someone else. + member = urand(1, 3); + + if (member != 2) // No need to create another pointer + pUnit = m_creature->GetMap()->GetCreature(Council[member]); + + return pUnit; + } + + void CastAuraOnCouncil() + { + uint32 spellid = 0; + switch(urand(0, 1)) + { + case 0: spellid = SPELL_DEVOTION_AURA; break; + case 1: spellid = SPELL_CHROMATIC_AURA; break; + } + for(uint8 i = 0; i < 4; ++i) + { + if (Creature* pCouncil = m_creature->GetMap()->GetCreature(Council[i])) + pCouncil->CastSpell(pCouncil, spellid, true, NULL, NULL, m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (BlessingTimer < diff) + { + if (Unit* pUnit = SelectCouncilMember()) + DoCastSpellIfCan(pUnit, urand(0, 1) ? SPELL_BLESS_SPELLWARD : SPELL_BLESS_PROTECTION); + + BlessingTimer = 60000; + }else BlessingTimer -= diff; + + if (ConsecrationTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_CONSECRATION); + ConsecrationTimer = 40000; + }else ConsecrationTimer -= diff; + + if (HammerOfJusticeTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + // is in ~10-40 yd range + if (m_creature->IsInRange(target, 10.0f, 40.0f, false)) + { + DoCastSpellIfCan(target, SPELL_HAMMER_OF_JUSTICE); + HammerOfJusticeTimer = 20000; + } + } + }else HammerOfJusticeTimer -= diff; + + if (SealTimer < diff) + { + DoCastSpellIfCan(m_creature, urand(0, 1) ? SPELL_SEAL_OF_COMMAND : SPELL_SEAL_OF_BLOOD); + SealTimer = 40000; + }else SealTimer -= diff; + + if (AuraTimer < diff) + { + CastAuraOnCouncil(); + AuraTimer = 90000; + }else AuraTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI +{ + boss_high_nethermancer_zerevorAI(Creature* pCreature) : boss_illidari_councilAI(pCreature) { Reset(); } + + uint32 BlizzardTimer; + uint32 FlamestrikeTimer; + uint32 ArcaneBoltTimer; + uint32 DampenMagicTimer; + uint32 Cooldown; + uint32 ArcaneExplosionTimer; + + void Reset() + { + BlizzardTimer = urand(30000, 90000); + FlamestrikeTimer = urand(30000, 90000); + ArcaneBoltTimer = 10000; + DampenMagicTimer = 2000; + ArcaneExplosionTimer = 14000; + Cooldown = 0; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_ZERE_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_ZERE_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Cooldown) + { + if (Cooldown < diff) + Cooldown = 0; + else + { + Cooldown -= diff; + return; // Don't cast any other spells if global cooldown is still ticking + } + } + + if (DampenMagicTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_DAMPEN_MAGIC); + Cooldown = 1000; + DampenMagicTimer = 110000; // almost 2 minutes + ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. + }else DampenMagicTimer -= diff; + + if (ArcaneExplosionTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + Cooldown = 1000; + ArcaneExplosionTimer = 14000; + }else ArcaneExplosionTimer -= diff; + + if (ArcaneBoltTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_BOLT); + ArcaneBoltTimer = 3000; + Cooldown = 2000; + }else ArcaneBoltTimer -= diff; + + if (BlizzardTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, SPELL_BLIZZARD); + BlizzardTimer = urand(45000, 90000); + FlamestrikeTimer += 10000; + Cooldown = 1000; + } + }else BlizzardTimer -= diff; + + if (FlamestrikeTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, SPELL_FLAMESTRIKE); + FlamestrikeTimer = urand(55000, 100000); + BlizzardTimer += 10000; + Cooldown = 2000; + } + }else FlamestrikeTimer -= diff; + } +}; + +struct MANGOS_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI +{ + boss_lady_malandeAI(Creature* pCreature) : boss_illidari_councilAI(pCreature) { Reset(); } + + uint32 EmpoweredSmiteTimer; + uint32 CircleOfHealingTimer; + uint32 DivineWrathTimer; + uint32 ReflectiveShieldTimer; + + void Reset() + { + EmpoweredSmiteTimer = 38000; + CircleOfHealingTimer = 20000; + DivineWrathTimer = 40000; + ReflectiveShieldTimer = 0; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_MALA_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_MALA_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (EmpoweredSmiteTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, SPELL_EMPOWERED_SMITE); + EmpoweredSmiteTimer = 38000; + } + }else EmpoweredSmiteTimer -= diff; + + if (CircleOfHealingTimer < diff) + { + //Currently bugged and puts Malande on the threatlist of the other council members. It also heals players. + //DoCastSpellIfCan(m_creature, SPELL_CIRCLE_OF_HEALING); + CircleOfHealingTimer = 60000; + }else CircleOfHealingTimer -= diff; + + if (DivineWrathTimer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(target, SPELL_DIVINE_WRATH); + DivineWrathTimer = urand(40000, 80000); + } + }else DivineWrathTimer -= diff; + + if (ReflectiveShieldTimer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_REFLECTIVE_SHIELD); + ReflectiveShieldTimer = 65000; + }else ReflectiveShieldTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI +{ + boss_veras_darkshadowAI(Creature* pCreature) : boss_illidari_councilAI(pCreature) { Reset(); } + + uint64 EnvenomTargetGUID; + + uint32 DeadlyPoisonTimer; + uint32 VanishTimer; + uint32 AppearEnvenomTimer; + + bool HasVanished; + + void Reset() + { + EnvenomTargetGUID = 0; + + DeadlyPoisonTimer = 20000; + VanishTimer = urand(60000, 120000); + AppearEnvenomTimer = 150000; + + HasVanished = false; + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_VERA_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_VERA_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!HasVanished) + { + if (DeadlyPoisonTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DEADLY_POISON); + DeadlyPoisonTimer = urand(15000, 45000); + }else DeadlyPoisonTimer -= diff; + + if (AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ENVENOM); + AppearEnvenomTimer = 90000; + }else AppearEnvenomTimer -= diff; + + if (VanishTimer < diff) // Disappear and stop attacking, but follow a random unit + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + VanishTimer = 30000; + AppearEnvenomTimer= 28000; + HasVanished = true; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking + m_creature->AddThreat(target, 500000.0f); + m_creature->GetMotionMaster()->MoveChase(target); + } + }else VanishTimer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (VanishTimer < diff) // Become attackable and poison current target + { + Unit* target = m_creature->getVictim(); + DoCastSpellIfCan(target, SPELL_DEADLY_POISON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. + DeadlyPoisonTimer += 6000; + VanishTimer = 90000; + AppearEnvenomTimer = 4000; + HasVanished = false; + }else VanishTimer -= diff; + + if (AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->SetVisibility(VISIBILITY_ON); + AppearEnvenomTimer = 6000; + }else AppearEnvenomTimer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* pCreature) +{ + return new mob_blood_elf_council_voice_triggerAI(pCreature); +} + +CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) +{ + return new mob_illidari_councilAI(pCreature); +} + +CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) +{ + return new boss_gathios_the_shattererAI(pCreature); +} + +CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) +{ + return new boss_lady_malandeAI(pCreature); +} + +CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) +{ + return new boss_veras_darkshadowAI(pCreature); +} + +CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) +{ + return new boss_high_nethermancer_zerevorAI(pCreature); +} + +void AddSC_boss_illidari_council() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_illidari_council"; + newscript->GetAI = &GetAI_mob_illidari_council; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blood_elf_council_voice_trigger"; + newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_gathios_the_shatterer"; + newscript->GetAI = &GetAI_boss_gathios_the_shatterer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lady_malande"; + newscript->GetAI = &GetAI_boss_lady_malande; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_veras_darkshadow"; + newscript->GetAI = &GetAI_boss_veras_darkshadow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_high_nethermancer_zerevor"; + newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/black_temple/instance_black_temple.cpp b/scripts/outland/black_temple/instance_black_temple.cpp new file mode 100644 index 0000000..a09b158 --- /dev/null +++ b/scripts/outland/black_temple/instance_black_temple.cpp @@ -0,0 +1,332 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Black_Temple +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "black_temple.h" + +/* Black Temple encounters: +0 - High Warlord Naj'entus event +1 - Supremus Event +2 - Shade of Akama Event +3 - Teron Gorefiend Event +4 - Gurtogg Bloodboil Event +5 - Reliquary Of Souls Event +6 - Mother Shahraz Event +7 - Illidari Council Event +8 - Illidan Stormrage Event +*/ + +struct MANGOS_DLL_DECL instance_black_temple : public ScriptedInstance +{ + instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiNajentusGUID; + uint64 m_uiAkamaGUID; // This is the Akama that starts the Illidan encounter. + uint64 m_uiAkama_ShadeGUID; // This is the Akama that starts the Shade of Akama encounter. + uint64 m_uiShadeOfAkamaGUID; + uint64 m_uiSupremusGUID; + uint64 m_uiLadyMalandeGUID; + uint64 m_uiGathiosTheShattererGUID; + uint64 m_uiHighNethermancerZerevorGUID; + uint64 m_uiVerasDarkshadowGUID; + uint64 m_uiIllidariCouncilGUID; + uint64 m_uiBloodElfCouncilVoiceGUID; + uint64 m_uiIllidanStormrageGUID; + + uint64 m_uiNajentusGateGUID; + uint64 m_uiMainTempleDoorsGUID; + uint64 m_uiShadeAkamaDoorGUID; + uint64 m_uiIllidanGateGUID; + uint64 m_uiIllidanDoorGUID[2]; + uint64 m_uiShahrazPreDoorGUID; + uint64 m_uiShahrazPostDoorGUID; + uint64 m_uiCouncilDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiNajentusGUID = 0; + m_uiAkamaGUID = 0; + m_uiAkama_ShadeGUID = 0; + m_uiShadeOfAkamaGUID = 0; + m_uiSupremusGUID = 0; + m_uiLadyMalandeGUID = 0; + m_uiGathiosTheShattererGUID = 0; + m_uiHighNethermancerZerevorGUID = 0; + m_uiVerasDarkshadowGUID = 0; + m_uiIllidariCouncilGUID = 0; + m_uiBloodElfCouncilVoiceGUID = 0; + m_uiIllidanStormrageGUID = 0; + + m_uiNajentusGateGUID = 0; + m_uiMainTempleDoorsGUID = 0; + m_uiShadeAkamaDoorGUID = 0; + m_uiIllidanGateGUID = 0; + m_uiIllidanDoorGUID[0] = 0; + m_uiIllidanDoorGUID[1] = 0; + m_uiShahrazPreDoorGUID = 0; + m_uiShahrazPostDoorGUID = 0; + m_uiCouncilDoorGUID = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 22887: m_uiNajentusGUID = pCreature->GetGUID(); break; + case 23089: m_uiAkamaGUID = pCreature->GetGUID(); break; + case 22990: m_uiAkama_ShadeGUID = pCreature->GetGUID(); break; + case 22841: m_uiShadeOfAkamaGUID = pCreature->GetGUID(); break; + case 22898: m_uiSupremusGUID = pCreature->GetGUID(); break; + case 22917: m_uiIllidanStormrageGUID = pCreature->GetGUID(); break; + case 22949: m_uiGathiosTheShattererGUID = pCreature->GetGUID(); break; + case 22950: m_uiHighNethermancerZerevorGUID = pCreature->GetGUID(); break; + case 22951: m_uiLadyMalandeGUID = pCreature->GetGUID(); break; + case 22952: m_uiVerasDarkshadowGUID = pCreature->GetGUID(); break; + case 23426: m_uiIllidariCouncilGUID = pCreature->GetGUID(); break; + case 23499: m_uiBloodElfCouncilVoiceGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 185483: // Gate past Naj'entus (at the entrance to Supermoose's courtyards) + m_uiNajentusGateGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 185882: // Main Temple Doors - right past Supermoose (Supremus) + m_uiMainTempleDoorsGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 185478: + m_uiShadeAkamaDoorGUID = pGo->GetGUID(); // Door close during encounter + break; + case 185479: // Door leading to Mother Shahraz + m_uiShahrazPreDoorGUID = pGo->GetGUID(); + if (CanPreMotherDoorOpen()) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 185481: // Door leading to the Council (grand promenade) + m_uiCouncilDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[6] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 185482: // Door after shahraz + m_uiShahrazPostDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[6] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 185905: // Gate leading to Temple Summit + m_uiIllidanGateGUID = pGo->GetGUID(); + break; + case 186261: // Right door at Temple Summit + m_uiIllidanDoorGUID[0] = pGo->GetGUID(); + break; + case 186262: // Left door at Temple Summit + m_uiIllidanDoorGUID[1] = pGo->GetGUID(); + break; + } + } + + bool CanPreMotherDoorOpen() + { + if (m_auiEncounter[2] == DONE && m_auiEncounter[3] == DONE && m_auiEncounter[4] == DONE && m_auiEncounter[5] == DONE) + { + debug_log("SD2: Black Temple: door to Mother Shahraz can open"); + return true; + } + + debug_log("SD2: Black Temple: Door data to Mother Shahraz requested, cannot open yet (Encounter data: %u %u %u %u)",m_auiEncounter[2],m_auiEncounter[3],m_auiEncounter[4],m_auiEncounter[5]); + return false; + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Black Temple: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_NAJENTUS: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiNajentusGateGUID); + break; + case TYPE_SUPREMUS: + m_auiEncounter[1] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiMainTempleDoorsGUID); + break; + case TYPE_SHADE: + m_auiEncounter[2] = uiData; + if (uiData == DONE && CanPreMotherDoorOpen()) + DoUseDoorOrButton(m_uiShahrazPreDoorGUID); + break; + case TYPE_GOREFIEND: + m_auiEncounter[3] = uiData; + if (uiData == DONE && CanPreMotherDoorOpen()) + DoUseDoorOrButton(m_uiShahrazPreDoorGUID); + break; + case TYPE_BLOODBOIL: + m_auiEncounter[4] = uiData; + if (uiData == DONE && CanPreMotherDoorOpen()) + DoUseDoorOrButton(m_uiShahrazPreDoorGUID); + break; + case TYPE_RELIQUIARY: + m_auiEncounter[5] = uiData; + if (uiData == DONE && CanPreMotherDoorOpen()) + DoUseDoorOrButton(m_uiShahrazPreDoorGUID); + break; + case TYPE_SHAHRAZ: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiCouncilDoorGUID); + DoUseDoorOrButton(m_uiShahrazPostDoorGUID); + } + m_auiEncounter[6] = uiData; + break; + case TYPE_COUNCIL: m_auiEncounter[7] = uiData; break; + case TYPE_ILLIDAN: m_auiEncounter[8] = uiData; break; + default: + error_log("SD2: Instance Black Temple: ERROR SetData = %u for type %u does not exist/not implemented.",uiType,uiData); + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5] << " " + << m_auiEncounter[6] << " " << m_auiEncounter[7] << " " << m_auiEncounter[8]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_NAJENTUS: return m_auiEncounter[0]; + case TYPE_SUPREMUS: return m_auiEncounter[1]; + case TYPE_SHADE: return m_auiEncounter[2]; + case TYPE_GOREFIEND: return m_auiEncounter[3]; + case TYPE_BLOODBOIL: return m_auiEncounter[4]; + case TYPE_RELIQUIARY: return m_auiEncounter[5]; + case TYPE_SHAHRAZ: return m_auiEncounter[6]; + case TYPE_COUNCIL: return m_auiEncounter[7]; + case TYPE_ILLIDAN: return m_auiEncounter[8]; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_HIGHWARLORDNAJENTUS: return m_uiNajentusGUID; + case DATA_AKAMA: return m_uiAkamaGUID; + case DATA_AKAMA_SHADE: return m_uiAkama_ShadeGUID; + case DATA_SHADEOFAKAMA: return m_uiShadeOfAkamaGUID; + case DATA_SUPREMUS: return m_uiSupremusGUID; + case DATA_ILLIDANSTORMRAGE: return m_uiIllidanStormrageGUID; + case DATA_GATHIOSTHESHATTERER: return m_uiGathiosTheShattererGUID; + case DATA_HIGHNETHERMANCERZEREVOR: return m_uiHighNethermancerZerevorGUID; + case DATA_LADYMALANDE: return m_uiLadyMalandeGUID; + case DATA_VERASDARKSHADOW: return m_uiVerasDarkshadowGUID; + case DATA_ILLIDARICOUNCIL: return m_uiIllidariCouncilGUID; + case DATA_GAMEOBJECT_NAJENTUS_GATE: return m_uiNajentusGateGUID; + case DATA_GAMEOBJECT_ILLIDAN_GATE: return m_uiIllidanGateGUID; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return m_uiIllidanDoorGUID[0]; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return m_uiIllidanDoorGUID[1]; + case DATA_GAMEOBJECT_SUPREMUS_DOORS: return m_uiMainTempleDoorsGUID; + case DATA_BLOOD_ELF_COUNCIL_VOICE: return m_uiBloodElfCouncilVoiceGUID; + case DATA_GO_PRE_SHAHRAZ_DOOR: return m_uiShahrazPreDoorGUID; + case DATA_GO_POST_SHAHRAZ_DOOR: return m_uiShahrazPostDoorGUID; + case DATA_GO_COUNCIL_DOOR: return m_uiCouncilDoorGUID; + } + + return 0; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_black_temple(Map* pMap) +{ + return new instance_black_temple(pMap); +} + +void AddSC_instance_black_temple() +{ + Script* newscript; + newscript = new Script; + newscript->Name = "instance_black_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_black_temple; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/blades_edge_mountains.cpp b/scripts/outland/blades_edge_mountains.cpp new file mode 100644 index 0000000..872b044 --- /dev/null +++ b/scripts/outland/blades_edge_mountains.cpp @@ -0,0 +1,391 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Blades_Edge_Mountains +SD%Complete: 90 +SDComment: Quest support: 10503, 10504, 10556, 10609, 10682, 10980. Ogri'la->Skettis Flight. (npc_daranelle needs bit more work before consider complete) +SDCategory: Blade's Edge Mountains +EndScriptData */ + +/* ContentData +mobs_bladespire_ogre +mobs_nether_drake +npc_daranelle +npc_overseer_nuaar +npc_saikkal_the_elder +npc_skyguard_handler_irena +EndContentData */ + +#include "precompiled.h" + +/*###### +## mobs_bladespire_ogre +######*/ + +//TODO: add support for quest 10512 + creature abilities +struct MANGOS_DLL_DECL mobs_bladespire_ogreAI : public ScriptedAI +{ + mobs_bladespire_ogreAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mobs_bladespire_ogre(Creature* pCreature) +{ + return new mobs_bladespire_ogreAI(pCreature); +} + +/*###### +## mobs_nether_drake +######*/ + +#define SAY_NIHIL_1 -1000169 +#define SAY_NIHIL_2 -1000170 +#define SAY_NIHIL_3 -1000171 +#define SAY_NIHIL_4 -1000172 +#define SAY_NIHIL_INTERRUPT -1000173 + +#define ENTRY_WHELP 20021 +#define ENTRY_PROTO 21821 +#define ENTRY_ADOLE 21817 +#define ENTRY_MATUR 21820 +#define ENTRY_NIHIL 21823 + +#define SPELL_T_PHASE_MODULATOR 37573 + +#define SPELL_ARCANE_BLAST 38881 +#define SPELL_MANA_BURN 38884 +#define SPELL_INTANGIBLE_PRESENCE 36513 + +struct MANGOS_DLL_DECL mobs_nether_drakeAI : public ScriptedAI +{ + mobs_nether_drakeAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool IsNihil; + uint32 NihilSpeech_Timer; + uint32 NihilSpeech_Phase; + + uint32 ArcaneBlast_Timer; + uint32 ManaBurn_Timer; + uint32 IntangiblePresence_Timer; + + void Reset() + { + IsNihil = false; + NihilSpeech_Timer = 3000; + NihilSpeech_Phase = 0; + + ArcaneBlast_Timer = 7500; + ManaBurn_Timer = 10000; + IntangiblePresence_Timer = 15000; + } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + //in case creature was not summoned (not expected) + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 0) + { + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + m_creature->SetHealth(0); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_T_PHASE_MODULATOR && caster->GetTypeId() == TYPEID_PLAYER) + { + const uint32 entry_list[4] = {ENTRY_PROTO, ENTRY_ADOLE, ENTRY_MATUR, ENTRY_NIHIL}; + int cid = rand()%(4-1); + + if (entry_list[cid] == m_creature->GetEntry()) + ++cid; + + //we are nihil, so say before transform + if (m_creature->GetEntry() == ENTRY_NIHIL) + { + DoScriptText(SAY_NIHIL_INTERRUPT, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + IsNihil = false; + } + + if (m_creature->UpdateEntry(entry_list[cid])) + { + if (entry_list[cid] == ENTRY_NIHIL) + { + EnterEvadeMode(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + IsNihil = true; + }else + AttackStart(caster); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (IsNihil) + { + if (NihilSpeech_Timer <= diff) + { + switch(NihilSpeech_Phase) + { + case 0: + DoScriptText(SAY_NIHIL_1, m_creature); + ++NihilSpeech_Phase; + break; + case 1: + DoScriptText(SAY_NIHIL_2, m_creature); + ++NihilSpeech_Phase; + break; + case 2: + DoScriptText(SAY_NIHIL_3, m_creature); + ++NihilSpeech_Phase; + break; + case 3: + DoScriptText(SAY_NIHIL_4, m_creature); + ++NihilSpeech_Phase; + break; + case 4: + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //take off to location above + m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+50.0f, m_creature->GetPositionY(), m_creature->GetPositionZ()+50.0f); + ++NihilSpeech_Phase; + break; + } + NihilSpeech_Timer = 5000; + }else NihilSpeech_Timer -=diff; + + //anything below here is not interesting for Nihil, so skip it + return; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (IntangiblePresence_Timer <= diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_INTANGIBLE_PRESENCE); + IntangiblePresence_Timer = urand(15000, 30000); + }else IntangiblePresence_Timer -= diff; + + if (ManaBurn_Timer <= diff) + { + Unit* target = m_creature->getVictim(); + if (target && target->getPowerType() == POWER_MANA) + DoCastSpellIfCan(target,SPELL_MANA_BURN); + ManaBurn_Timer = urand(8000, 16000); + }else ManaBurn_Timer -= diff; + + if (ArcaneBlast_Timer <= diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_BLAST); + ArcaneBlast_Timer = urand(2500, 7500); + }else ArcaneBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mobs_nether_drake(Creature* pCreature) +{ + return new mobs_nether_drakeAI(pCreature); +} + +/*###### +## npc_daranelle +######*/ + +enum +{ + SAY_SPELL_INFLUENCE = -1000174, + NPC_KALIRI_AURA_DISPEL = 21511, + SPELL_LASHHAN_CHANNEL = 36904 +}; + +struct MANGOS_DLL_DECL npc_daranelleAI : public ScriptedAI +{ + npc_daranelleAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + + void MoveInLineOfSight(Unit* pWho) + { + if (pWho->GetTypeId() == TYPEID_PLAYER) + { + if (pWho->HasAura(SPELL_LASHHAN_CHANNEL, EFFECT_INDEX_0) && m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + DoScriptText(SAY_SPELL_INFLUENCE, m_creature, pWho); + + //TODO: Move the below to updateAI and run if this statement == true + ((Player*)pWho)->KilledMonsterCredit(NPC_KALIRI_AURA_DISPEL, m_creature->GetGUID()); + pWho->RemoveAurasDueToSpell(SPELL_LASHHAN_CHANNEL); + } + } + + ScriptedAI::MoveInLineOfSight(pWho); + } +}; + +CreatureAI* GetAI_npc_daranelle(Creature* pCreature) +{ + return new npc_daranelleAI(pCreature); +} + +/*###### +## npc_overseer_nuaar +######*/ + +bool GossipHello_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10682) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Overseer, I am here to negotiate on behalf of the Cenarion Expedition.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10532, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_overseer_nuaar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->SEND_GOSSIP_MENU(10533, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens(10682); + } + return true; +} + +/*###### +## npc_saikkal_the_elder +######*/ + +bool GossipHello_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10980) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes... yes, it's me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10794, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_saikkal_the_elder(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes elder. Tell me more of the book.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(10795, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(10796, pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## npc_skyguard_handler_irena +######*/ + +#define GOSSIP_SKYGUARD "Fly me to Skettis please" + +bool GossipHello_npc_skyguard_handler_irena(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetReputationRank(1031) >= REP_HONORED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_skyguard_handler_irena(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,41278,true); //TaxiPath 706 + } + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_blades_edge_mountains() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mobs_bladespire_ogre"; + newscript->GetAI = &GetAI_mobs_bladespire_ogre; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mobs_nether_drake"; + newscript->GetAI = &GetAI_mobs_nether_drake; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_daranelle"; + newscript->GetAI = &GetAI_npc_daranelle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_overseer_nuaar"; + newscript->pGossipHello = &GossipHello_npc_overseer_nuaar; + newscript->pGossipSelect = &GossipSelect_npc_overseer_nuaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_saikkal_the_elder"; + newscript->pGossipHello = &GossipHello_npc_saikkal_the_elder; + newscript->pGossipSelect = &GossipSelect_npc_saikkal_the_elder; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_skyguard_handler_irena"; + newscript->pGossipHello = &GossipHello_npc_skyguard_handler_irena; + newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_irena; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/boss_doomlord_kazzak.cpp b/scripts/outland/boss_doomlord_kazzak.cpp new file mode 100644 index 0000000..cdea9a4 --- /dev/null +++ b/scripts/outland/boss_doomlord_kazzak.cpp @@ -0,0 +1,183 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Doomlord_Kazzak +SD%Complete: 70 +SDComment: Using incorrect spell for Mark of Kazzak +SDCategory: Hellfire Peninsula +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1000147, + SAY_AGGRO1 = -1000148, + SAY_AGGRO2 = -1000149, + SAY_SURPREME1 = -1000150, + SAY_SURPREME2 = -1000151, + SAY_KILL1 = -1000152, + SAY_KILL2 = -1000153, + SAY_KILL3 = -1000154, + SAY_DEATH = -1000155, + EMOTE_GENERIC_FRENZY = -1000002, + SAY_RAND1 = -1000157, + SAY_RAND2 = -1000158, + + SPELL_SHADOWVOLLEY = 32963, + SPELL_CLEAVE = 31779, + SPELL_THUNDERCLAP = 36706, + SPELL_VOIDBOLT = 39329, + SPELL_MARKOFKAZZAK = 32960, + SPELL_ENRAGE = 32964, + SPELL_CAPTURESOUL = 32966, + SPELL_TWISTEDREFLECTION = 21063 +}; + +struct MANGOS_DLL_DECL boss_doomlordkazzakAI : public ScriptedAI +{ + boss_doomlordkazzakAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 ShadowVolley_Timer; + uint32 Cleave_Timer; + uint32 ThunderClap_Timer; + uint32 VoidBolt_Timer; + uint32 MarkOfKazzak_Timer; + uint32 Enrage_Timer; + uint32 Twisted_Reflection_Timer; + + void Reset() + { + ShadowVolley_Timer = urand(6000, 10000); + Cleave_Timer = 7000; + ThunderClap_Timer = urand(14000, 18000); + VoidBolt_Timer = 30000; + MarkOfKazzak_Timer = 25000; + Enrage_Timer = 60000; + Twisted_Reflection_Timer = 33000; // Timer may be incorrect + } + + void JustRespawned() + { + DoScriptText(SAY_INTRO, m_creature); + } + + void Aggro(Unit *who) + { + DoScriptText(urand(0, 1) ? SAY_AGGRO1 : SAY_AGGRO2, m_creature); + } + + void KilledUnit(Unit* victim) + { + // When Kazzak kills a player (not pets/totems), he regens some health + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + DoCastSpellIfCan(m_creature,SPELL_CAPTURESOUL); + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 2: DoScriptText(SAY_KILL3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWVOLLEY); + ShadowVolley_Timer = urand(4000, 6000); + }else ShadowVolley_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = urand(8000, 12000); + }else Cleave_Timer -= diff; + + //ThunderClap_Timer + if (ThunderClap_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_THUNDERCLAP); + ThunderClap_Timer = urand(10000, 14000); + }else ThunderClap_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_VOIDBOLT); + VoidBolt_Timer = urand(15000, 18000); + }else VoidBolt_Timer -= diff; + + //MarkOfKazzak_Timer + if (MarkOfKazzak_Timer < diff) + { + Unit* victim = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (victim->GetPower(POWER_MANA)) + { + DoCastSpellIfCan(victim, SPELL_MARKOFKAZZAK); + MarkOfKazzak_Timer = 20000; + } + }else MarkOfKazzak_Timer -= diff; + + //Enrage_Timer + if (Enrage_Timer < diff) + { + DoScriptText(EMOTE_GENERIC_FRENZY, m_creature); + DoCastSpellIfCan(m_creature,SPELL_ENRAGE); + Enrage_Timer = 30000; + }else Enrage_Timer -= diff; + + if (Twisted_Reflection_Timer < diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_TWISTEDREFLECTION); + + Twisted_Reflection_Timer = 15000; + }else Twisted_Reflection_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_doomlordkazzak(Creature* pCreature) +{ + return new boss_doomlordkazzakAI(pCreature); +} + +void AddSC_boss_doomlordkazzak() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_doomlord_kazzak"; + newscript->GetAI = &GetAI_boss_doomlordkazzak; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/boss_doomwalker.cpp b/scripts/outland/boss_doomwalker.cpp new file mode 100644 index 0000000..eb5655b --- /dev/null +++ b/scripts/outland/boss_doomwalker.cpp @@ -0,0 +1,184 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Doomwalker +SD%Complete: 100 +SDComment: +SDCategory: Shadowmoon Valley +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1000159 +#define SAY_EARTHQUAKE_1 -1000160 +#define SAY_EARTHQUAKE_2 -1000161 +#define SAY_OVERRUN_1 -1000162 +#define SAY_OVERRUN_2 -1000163 +#define SAY_SLAY_1 -1000164 +#define SAY_SLAY_2 -1000165 +#define SAY_SLAY_3 -1000166 +#define SAY_DEATH -1000167 + +#define SPELL_EARTHQUAKE 32686 +#define SPELL_SUNDER_ARMOR 33661 +#define SPELL_CHAIN_LIGHTNING 33665 +#define SPELL_OVERRUN 32636 +#define SPELL_ENRAGE 33653 +#define SPELL_MARK_DEATH 37128 +#define SPELL_AURA_DEATH 37131 + +struct MANGOS_DLL_DECL boss_doomwalkerAI : public ScriptedAI +{ + boss_doomwalkerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Chain_Timer; + uint32 Enrage_Timer; + uint32 Overrun_Timer; + uint32 Quake_Timer; + uint32 Armor_Timer; + + bool InEnrage; + + void Reset() + { + Enrage_Timer = 0; + Armor_Timer = urand(5000, 13000); + Chain_Timer = urand(10000, 30000); + Quake_Timer = urand(25000, 35000); + Overrun_Timer = urand(30000, 45000); + + InEnrage = false; + } + + void KilledUnit(Unit* Victim) + { + + Victim->CastSpell(Victim,SPELL_MARK_DEATH,0); + + if (urand(0, 4)) + return; + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + + void MoveInLineOfSight(Unit *who) + { + if (who && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsHostileTo(who)) + { + if (who->HasAura(SPELL_MARK_DEATH, EFFECT_INDEX_0)) + { + who->CastSpell(who,SPELL_AURA_DEATH,true); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Spell Enrage, when hp <= 20% gain enrage + if (m_creature->GetHealthPercent() <= 20.0f) + { + if (Enrage_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_ENRAGE); + Enrage_Timer = 6000; + InEnrage = true; + }else Enrage_Timer -= diff; + } + + //Spell Overrun + if (Overrun_Timer < diff) + { + DoScriptText(urand(0, 1) ? SAY_OVERRUN_1 : SAY_OVERRUN_2, m_creature); + DoCastSpellIfCan(m_creature->getVictim(),SPELL_OVERRUN); + Overrun_Timer = urand(25000, 40000); + }else Overrun_Timer -= diff; + + //Spell Earthquake + if (Quake_Timer < diff) + { + if (urand(0, 1)) + return; + + DoScriptText(urand(0, 1) ? SAY_EARTHQUAKE_1 : SAY_EARTHQUAKE_2, m_creature); + + //remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead + if (InEnrage) + m_creature->RemoveAurasDueToSpell(SPELL_ENRAGE); + + DoCastSpellIfCan(m_creature,SPELL_EARTHQUAKE); + Quake_Timer = urand(30000, 55000); + }else Quake_Timer -= diff; + + //Spell Chain Lightning + if (Chain_Timer < diff) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1); + + if (!target) + target = m_creature->getVictim(); + + if (target) + DoCastSpellIfCan(target,SPELL_CHAIN_LIGHTNING); + + Chain_Timer = urand(7000, 27000); + }else Chain_Timer -= diff; + + //Spell Sunder Armor + if (Armor_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SUNDER_ARMOR); + Armor_Timer = urand(10000, 25000); + }else Armor_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_doomwalker(Creature* pCreature) +{ + return new boss_doomwalkerAI(pCreature); +} + +void AddSC_boss_doomwalker() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_doomwalker"; + newscript->GetAI = &GetAI_boss_doomwalker; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/boss_fathomlord_karathress.cpp b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_fathomlord_karathress.cpp new file mode 100644 index 0000000..cc33967 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -0,0 +1,612 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fathomlord_Karathress +SD%Complete: 60 +SDComment: Missing Multishot, Totems, Windfury, Whirlwind +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "serpent_shrine.h" + +enum +{ + SAY_AGGRO = -1548021, + SAY_GAIN_BLESSING = -1548022, + SAY_GAIN_ABILITY1 = -1548023, + SAY_GAIN_ABILITY2 = -1548024, + SAY_GAIN_ABILITY3 = -1548025, + SAY_SLAY1 = -1548026, + SAY_SLAY2 = -1548027, + SAY_SLAY3 = -1548028, + SAY_DEATH = -1548029, + + //Karathress spells + SPELL_CATACLYSMIC_BOLT = 38441, + SPELL_POWER_OF_SHARKKIS = 38455, + SPELL_POWER_OF_TIDALVESS = 38452, + SPELL_POWER_OF_CARIBDIS = 38451, + SPELL_ENRAGE = 24318, + SPELL_SEAR_NOVA = 38445, + SPELL_BLESSING_OF_THE_TIDES = 38449, + + //Sharkkis spells + SPELL_LEECHING_THROW = 29436, + SPELL_THE_BEAST_WITHIN = 38373, + SPELL_HURL_TRIDENT = 38374, + SPELL_MULTI_TOSS = 38366, + SPELL_SUMMON_FATHOM_LURKER = 38433, + SPELL_SUMMON_FATHOM_SPOREBAT = 38431, + + //Tidalvess spells + SPELL_FROST_SHOCK = 38234, + SPELL_SPITFIRE_TOTEM = 38236, + SPELL_POISON_CLEANSING_TOTEM = 38306, + SPELL_EARTHBIND_TOTEM = 38304, + SPELL_WINDFURY_WEAPON = 32911, // triggers spell 32912 (Windfury) + + //Caribdis Spells + SPELL_WATER_BOLT_VOLLEY = 38335, + SPELL_TIDAL_SURGE = 38353, // triggers 38357 + SPELL_HEAL = 38330, + SPELL_SUMMON_CYCLONE = 38337, // summons creature 22104 which uses spell 29538 + + MAX_ADVISORS = 3, + + NPC_SEER_OLUM = 22820 +}; + +// position for Seer Olum +const float afCoords_Olum[] = {446.78f, -542.76f, -7.54773f, 0.401581f}; + +//Fathom-Lord Karathress AI +struct MANGOS_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI +{ + boss_fathomlord_karathressAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + memset(&m_auiAdvisorsGUID, 0, sizeof(m_auiAdvisorsGUID)); + Reset(); + } + + ScriptedInstance* m_pInstance; + + // timers + uint32 m_uiCataclysmicBolt_Timer; + uint32 m_uiEnrage_Timer; + + bool m_bBlessingOfTides_MobsChecked; + + uint64 m_auiAdvisorsGUID[MAX_ADVISORS]; // the GUIDs from the advisors + + void Reset() + { + m_uiCataclysmicBolt_Timer = 10000; + m_uiEnrage_Timer = 600000; + m_bBlessingOfTides_MobsChecked = false; + + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature* pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorsGUID[i])) + { + if (pAdvisor->getVictim()) + pAdvisor->AI()->EnterEvadeMode(); + else if (!pAdvisor->isAlive()) + pAdvisor->Respawn(); + } + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_KARATHRESS_EVENT, NOT_STARTED); + } + + // select the spell and the text based on the advisor which died + void EventAdvisorDeath(uint8 uiAdvisor) + { + if (!m_creature->isAlive()) + return; + + int32 iSayGainAbility = 0; + uint32 uiSpell = 0; + + switch(uiAdvisor) + { + case DATA_SHARKKIS: + iSayGainAbility = SAY_GAIN_ABILITY1; + uiSpell = SPELL_POWER_OF_SHARKKIS; + break; + case DATA_TIDALVESS: + iSayGainAbility = SAY_GAIN_ABILITY2; + uiSpell = SPELL_POWER_OF_TIDALVESS; + break; + case DATA_CARIBDIS: + iSayGainAbility = SAY_GAIN_ABILITY3; + uiSpell = SPELL_POWER_OF_CARIBDIS; + break; + default: + error_log("SD2: invalid advisor (id %u) for karathress!", uiAdvisor); + break; + } + + DoScriptText(iSayGainAbility, m_creature); + DoCastSpellIfCan(m_creature, uiSpell); + } + + void GetAdvisors() + { + if (!m_pInstance) + return; + + m_auiAdvisorsGUID[0] = m_pInstance->GetData64(DATA_SHARKKIS); + m_auiAdvisorsGUID[1] = m_pInstance->GetData64(DATA_TIDALVESS); + m_auiAdvisorsGUID[2] = m_pInstance->GetData64(DATA_CARIBDIS); + } + + void Aggro(Unit* pWho) + { + if (!m_pInstance) + return; + + GetAdvisors(); + + DoScriptText(SAY_AGGRO, m_creature); + + if (Player* pPlayer = pWho->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + m_pInstance->SetData64(DATA_KARATHRESS_STARTER, pPlayer->GetGUID()); + m_pInstance->SetData(TYPE_KARATHRESS_EVENT, IN_PROGRESS); + } + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KARATHRESS_EVENT, DONE); + + //support for quest 10944 + m_creature->SummonCreature(NPC_SEER_OLUM, afCoords_Olum[0], afCoords_Olum[1], afCoords_Olum[2], afCoords_Olum[3], TEMPSUMMON_TIMED_DESPAWN, 3600000); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + //check if the event is started + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == IN_PROGRESS) + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetData64(DATA_KARATHRESS_STARTER))) + { + AttackStart(pTarget); + GetAdvisors(); + } + } + return; + } + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiCataclysmicBolt_Timer + if (m_uiCataclysmicBolt_Timer < uiDiff) + { + //select a random unit other than the main tank + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + //if there aren't other units, cast on the tank + if (!pTarget) + pTarget = m_creature->getVictim(); + + m_creature->CastSpell(pTarget, SPELL_CATACLYSMIC_BOLT, false); + + m_uiCataclysmicBolt_Timer = 10000; + }else m_uiCataclysmicBolt_Timer -= uiDiff; + + //hp under 75% + if (!m_bBlessingOfTides_MobsChecked && m_creature->GetHealthPercent() < 75.0f) + { + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature* pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorsGUID[i])) + { + //stack max three times (one for each alive) + if (pAdvisor->isAlive()) + { + pAdvisor->InterruptNonMeleeSpells(false); + pAdvisor->CastSpell(m_creature, SPELL_BLESSING_OF_THE_TIDES, false); + } + } + } + + //yell if we now have the aura + if (m_creature->HasAura(SPELL_BLESSING_OF_THE_TIDES)) + DoScriptText(SAY_GAIN_BLESSING, m_creature); + + m_bBlessingOfTides_MobsChecked = true; + } + + //m_uiEnrage_Timer + if (m_uiEnrage_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + m_uiEnrage_Timer = 90000; + }else m_uiEnrage_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +// Base AI for every advisor +struct MANGOS_DLL_DECL Advisor_Base_AI : public ScriptedAI +{ + Advisor_Base_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + } + protected: + uint8 m_uiAdvisor; + + public: + ScriptedInstance* m_pInstance; + + void JustReachedHome() + { + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == IN_PROGRESS) + m_pInstance->SetData(TYPE_KARATHRESS_EVENT, NOT_STARTED); + } + + void Aggro(Unit *pWho) + { + if (!m_pInstance) + return; + + if (m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == NOT_STARTED) + m_pInstance->SetData(TYPE_KARATHRESS_EVENT, IN_PROGRESS); + + if (Player* pPlayer = pWho->GetCharmerOrOwnerPlayerOrPlayerItself()) + m_pInstance->SetData64(DATA_KARATHRESS_STARTER, pPlayer->GetGUID()); + } + + void JustDied(Unit* pVictim) + { + if (!m_pInstance) + return; + + if (Creature* pKarathress = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_KARATHRESS))) + { + if (boss_fathomlord_karathressAI* pKaraAI = dynamic_cast(pKarathress->AI())) + pKaraAI->EventAdvisorDeath(m_uiAdvisor); + } + } +}; + +//Fathom-Guard Sharkkis AI +struct MANGOS_DLL_DECL boss_fathomguard_sharkkisAI : public Advisor_Base_AI +{ + boss_fathomguard_sharkkisAI(Creature* pCreature) : Advisor_Base_AI(pCreature) + { + Reset(); + m_uiAdvisor = DATA_SHARKKIS; + } + + // timers + uint32 m_uiHurlTrident_Timer; + uint32 m_uiLeechingThrow_Timer; + uint32 m_uiTheBeastWithin_Timer; + uint32 m_uiPet_Timer; + + bool m_bIsPetCheckNeeded; + + void Reset() + { + m_uiHurlTrident_Timer = 2500; + m_uiLeechingThrow_Timer = 20000; + m_uiTheBeastWithin_Timer = 30000; + m_uiPet_Timer = 10000; + + m_bIsPetCheckNeeded = true; + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + //using larger distance, since hunter type + m_creature->GetMotionMaster()->MoveChase(pWho, 15.0f); + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->IsPet()) + { + m_uiPet_Timer = 10000; + m_bIsPetCheckNeeded = false; + } + } + + void SummonedCreatureDespawn(Creature* pDespawned) + { + if (pDespawned->IsPet()) + m_bIsPetCheckNeeded = true; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + //check if the event is started + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == IN_PROGRESS) + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetData64(DATA_KARATHRESS_STARTER))) + AttackStart(pTarget); + } + return; + } + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //after 10 seconds: spawn pet if not exist + if (m_bIsPetCheckNeeded) + { + if (m_uiPet_Timer < uiDiff) + { + if (!m_creature->GetPet()) + DoCastSpellIfCan(m_creature, urand(0,1) ? SPELL_SUMMON_FATHOM_LURKER : SPELL_SUMMON_FATHOM_SPOREBAT); + } + else + m_uiPet_Timer -= uiDiff; + } + + //m_uiHurlTrident_Timer + if (m_uiHurlTrident_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (!m_creature->IsWithinDist(pTarget,ATTACK_DISTANCE)) + DoCastSpellIfCan(pTarget, SPELL_HURL_TRIDENT); + } + + m_uiHurlTrident_Timer = 5000; + }else m_uiHurlTrident_Timer -= uiDiff; + + //m_uiLeechingThrow_Timer + if (m_uiLeechingThrow_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_LEECHING_THROW); + m_uiLeechingThrow_Timer = 20000; + }else m_uiLeechingThrow_Timer -= uiDiff; + + //m_uiTheBeastWithin_Timer + if (m_uiTheBeastWithin_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_THE_BEAST_WITHIN); + m_uiTheBeastWithin_Timer = 30000; + }else m_uiTheBeastWithin_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Tidalvess AI +struct MANGOS_DLL_DECL boss_fathomguard_tidalvessAI : public Advisor_Base_AI +{ + boss_fathomguard_tidalvessAI(Creature* pCreature) : Advisor_Base_AI(pCreature) + { + Reset(); + m_uiAdvisor = DATA_TIDALVESS; + } + + // timers + uint32 m_uiFrostShock_Timer; + + void Reset() + { + m_uiFrostShock_Timer = 25000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + //check if the event is started + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == IN_PROGRESS) + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetData64(DATA_KARATHRESS_STARTER))) + AttackStart(pTarget); + } + return; + } + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiFrostShock_Timer + if (m_uiFrostShock_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_SHOCK); + m_uiFrostShock_Timer = urand(25000, 30000); + }else m_uiFrostShock_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Caribdis AI +struct MANGOS_DLL_DECL boss_fathomguard_caribdisAI : public Advisor_Base_AI +{ + boss_fathomguard_caribdisAI(Creature* pCreature) : Advisor_Base_AI(pCreature) + { + Reset(); + m_uiAdvisor = DATA_CARIBDIS; + } + + // timers + uint32 m_uiWaterBoltVolley_Timer; + uint32 m_uiTidalSurge_Timer; + uint32 m_uiHeal_Timer; + + void Reset() + { + m_uiWaterBoltVolley_Timer = 35000; + m_uiTidalSurge_Timer = urand(15000, 20000); + m_uiHeal_Timer = 55000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + //check if the event is started + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == IN_PROGRESS) + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_pInstance->GetData64(DATA_KARATHRESS_STARTER))) + AttackStart(pTarget); + } + return; + } + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_KARATHRESS_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiWaterBoltVolley_Timer + if (m_uiWaterBoltVolley_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY); + m_uiWaterBoltVolley_Timer = 30000; + }else m_uiWaterBoltVolley_Timer -= uiDiff; + + //m_uiTidalSurge_Timer + if (m_uiTidalSurge_Timer < uiDiff) + { + // the victim has to cast it on himself because in the spell.dbc the EffectImplicitTargetA1 is 1 (TARGET_SELF) + m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_TIDAL_SURGE, true); + m_uiTidalSurge_Timer = urand(15000, 20000); + }else m_uiTidalSurge_Timer -= uiDiff; + + //m_uiHeal_Timer + if (m_uiHeal_Timer < uiDiff) + { + // It can be cast on any of the mobs + Unit* pUnit = NULL; + + if (m_pInstance) + { + switch(urand(0, 3)) + { + case 0: pUnit = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_KARATHRESS)); break; + case 1: pUnit = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_SHARKKIS)); break; + case 2: pUnit = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_TIDALVESS)); break; + case 3: pUnit = m_creature; break; + } + } + else + pUnit = m_creature; + + if (pUnit && pUnit->isAlive()) + DoCastSpellIfCan(pUnit, SPELL_HEAL); + + m_uiHeal_Timer = 60000; + }else m_uiHeal_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) +{ + return new boss_fathomlord_karathressAI(pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) +{ + return new boss_fathomguard_sharkkisAI(pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) +{ + return new boss_fathomguard_tidalvessAI(pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) +{ + return new boss_fathomguard_caribdisAI(pCreature); +} + +void AddSC_boss_fathomlord_karathress() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_fathomlord_karathress"; + newscript->GetAI = &GetAI_boss_fathomlord_karathress; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fathomguard_sharkkis"; + newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fathomguard_tidalvess"; + newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_fathomguard_caribdis"; + newscript->GetAI = &GetAI_boss_fathomguard_caribdis; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/boss_hydross_the_unstable.cpp b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_hydross_the_unstable.cpp new file mode 100644 index 0000000..7206ec5 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -0,0 +1,322 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydross_The_Unstable +SD%Complete: 90 +SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. code cleanup needed +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "serpent_shrine.h" + +enum +{ + SAY_AGGRO = -1548000, + SAY_SWITCH_TO_CLEAN = -1548001, + SAY_CLEAN_SLAY1 = -1548002, + SAY_CLEAN_SLAY2 = -1548003, + SAY_CLEAN_DEATH = -1548004, + SAY_SWITCH_TO_CORRUPT = -1548005, + SAY_CORRUPT_SLAY1 = -1548006, + SAY_CORRUPT_SLAY2 = -1548007, + SAY_CORRUPT_DEATH = -1548008, + + SWITCH_RADIUS = 18, + + MODEL_CORRUPT = 20609, + MODEL_CLEAN = 20162, + + SPELL_WATER_TOMB = 38235, + SPELL_MARK_OF_HYDROSS1 = 38215, + SPELL_MARK_OF_HYDROSS2 = 38216, + SPELL_MARK_OF_HYDROSS3 = 38217, + SPELL_MARK_OF_HYDROSS4 = 38218, + SPELL_MARK_OF_HYDROSS5 = 38231, + SPELL_MARK_OF_HYDROSS6 = 40584, + SPELL_MARK_OF_CORRUPTION1 = 38219, + SPELL_MARK_OF_CORRUPTION2 = 38220, + SPELL_MARK_OF_CORRUPTION3 = 38221, + SPELL_MARK_OF_CORRUPTION4 = 38222, + SPELL_MARK_OF_CORRUPTION5 = 38230, + SPELL_MARK_OF_CORRUPTION6 = 40583, + SPELL_VILE_SLUDGE = 38246, + SPELL_ENRAGE = 27680, //this spell need verification + SPELL_SUMMON_WATER_ELEMENT = 36459, //not in use yet(in use ever?) + SPELL_ELEMENTAL_SPAWNIN = 25035, + SPELL_BLUE_BEAM = 38015, //channeled Hydross Beam Helper (not in use yet) + SPELL_PURIFY_ELEMENTAL = 36461, //(not in use) visualize the line by tainting/purifying mobs + + NPC_PURE_SPAWN = 22035, + NPC_TAINTED_SPAWN = 22036 +}; + +const float afSpawnDiffs[4][2] = +{ + {6.934003f , -11.255012f}, // diff 1 + {-6.934003f , 11.255012f }, // diff 2 + {-12.577011f, -4.72702f }, // diff 3 + {12.577011f , 4.72702f } // diff 4 +}; + +struct MANGOS_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI +{ + boss_hydross_the_unstableAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; // the instance + + uint32 m_uiPosCheck_Timer; + uint32 m_uiMarkOfHydross_Timer; + uint32 m_uiMarkOfCorruption_Timer; + uint32 m_uiWaterTomb_Timer; + uint32 m_uiVileSludge_Timer; + uint32 m_uiMarkOfHydross_Count; + uint32 m_uiMarkOfCorruption_Count; + uint32 m_uiEnrageTimer; + bool m_bCorruptedForm; + + void Reset() + { + m_uiPosCheck_Timer = 2500; + m_uiMarkOfHydross_Timer = 15000; + m_uiMarkOfCorruption_Timer = 15000; + m_uiWaterTomb_Timer = 7000; + m_uiVileSludge_Timer = 7000; + m_uiMarkOfHydross_Count = 0; + m_uiMarkOfCorruption_Count = 0; + m_uiEnrageTimer = 600000; + + m_bCorruptedForm = false; + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + m_creature->SetDisplayId(MODEL_CLEAN); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HYDROSS_EVENT, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HYDROSS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + if (m_bCorruptedForm) + DoScriptText(urand(0,1) ? SAY_CORRUPT_SLAY1 : SAY_CORRUPT_SLAY2, m_creature); + else + DoScriptText(urand(0,1) ? SAY_CLEAN_SLAY1 : SAY_CLEAN_SLAY2, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_PURE_SPAWN) + pSummoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + else if (pSummoned->GetEntry() == NPC_TAINTED_SPAWN) + pSummoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + + pSummoned->CastSpell(pSummoned, SPELL_ELEMENTAL_SPAWNIN, true); + } + + void JustDied(Unit* pVictim) + { + DoScriptText(m_bCorruptedForm ? SAY_CORRUPT_DEATH : SAY_CLEAN_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HYDROSS_EVENT, DONE); + } + + void SpawnAdds() + { + for(uint8 i = 0; i < 4; ++i) + DoSpawnCreature(m_bCorruptedForm ? NPC_TAINTED_SPAWN : NPC_PURE_SPAWN, + afSpawnDiffs[i][0], afSpawnDiffs[i][1], 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // corrupted form + if (m_bCorruptedForm) + { + //MarkOfCorruption_Timer + if (m_uiMarkOfCorruption_Timer < uiDiff) + { + if (m_uiMarkOfCorruption_Count <= 5) + { + uint32 uiMarkSpell = 0; + + switch(m_uiMarkOfCorruption_Count) + { + case 0: uiMarkSpell = SPELL_MARK_OF_CORRUPTION1; break; + case 1: uiMarkSpell = SPELL_MARK_OF_CORRUPTION2; break; + case 2: uiMarkSpell = SPELL_MARK_OF_CORRUPTION3; break; + case 3: uiMarkSpell = SPELL_MARK_OF_CORRUPTION4; break; + case 4: uiMarkSpell = SPELL_MARK_OF_CORRUPTION5; break; + case 5: uiMarkSpell = SPELL_MARK_OF_CORRUPTION6; break; + } + + DoCastSpellIfCan(m_creature->getVictim(), uiMarkSpell); + + if (m_uiMarkOfCorruption_Count < 5) + ++m_uiMarkOfCorruption_Count; + } + + m_uiMarkOfCorruption_Timer = 15000; + }else m_uiMarkOfCorruption_Timer -= uiDiff; + + //VileSludge_Timer + if (m_uiVileSludge_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_VILE_SLUDGE); + + m_uiVileSludge_Timer = 15000; + }else m_uiVileSludge_Timer -= uiDiff; + + //PosCheck_Timer + if (m_uiPosCheck_Timer < uiDiff) + { + float fPosX, fPosY, fPosZ; + m_creature->GetCombatStartPosition(fPosX, fPosY, fPosZ); + + if (m_creature->IsWithinDist2d(fPosX, fPosY, SWITCH_RADIUS)) + { + DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature); + + // switch to clean form + m_creature->SetDisplayId(MODEL_CLEAN); + m_uiMarkOfHydross_Count = 0; + DoResetThreat(); + + // spawn 4 adds + SpawnAdds(); + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + m_bCorruptedForm = false; + } + + m_uiPosCheck_Timer = 2500; + }else m_uiPosCheck_Timer -=uiDiff; + } + // clean form + else + { + //MarkOfHydross_Timer + if (m_uiMarkOfHydross_Timer < uiDiff) + { + if (m_uiMarkOfHydross_Count <= 5) + { + uint32 uiMarkSpell; + + switch(m_uiMarkOfHydross_Count) + { + case 0: uiMarkSpell = SPELL_MARK_OF_HYDROSS1; break; + case 1: uiMarkSpell = SPELL_MARK_OF_HYDROSS2; break; + case 2: uiMarkSpell = SPELL_MARK_OF_HYDROSS3; break; + case 3: uiMarkSpell = SPELL_MARK_OF_HYDROSS4; break; + case 4: uiMarkSpell = SPELL_MARK_OF_HYDROSS5; break; + case 5: uiMarkSpell = SPELL_MARK_OF_HYDROSS6; break; + } + + DoCastSpellIfCan(m_creature->getVictim(), uiMarkSpell); + + if (m_uiMarkOfHydross_Count < 5) + ++m_uiMarkOfHydross_Count; + } + + m_uiMarkOfHydross_Timer = 15000; + }else m_uiMarkOfHydross_Timer -= uiDiff; + + //WaterTomb_Timer + if (m_uiWaterTomb_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_WATER_TOMB); + + m_uiWaterTomb_Timer = 7000; + }else m_uiWaterTomb_Timer -= uiDiff; + + //PosCheck_Timer + if (m_uiPosCheck_Timer < uiDiff) + { + float fPosX, fPosY, fPosZ; + m_creature->GetCombatStartPosition(fPosX, fPosY, fPosZ); + + if (!m_creature->IsWithinDist2d(fPosX, fPosY, SWITCH_RADIUS)) + { + DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature); + + // switch to corrupted form + m_creature->SetDisplayId(MODEL_CORRUPT); + m_uiMarkOfCorruption_Count = 0; + DoResetThreat(); + + // spawn 4 adds + SpawnAdds(); + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + + m_bCorruptedForm = true; + } + + m_uiPosCheck_Timer = 2500; + }else m_uiPosCheck_Timer -=uiDiff; + } + + //EnrageTimer + if (m_uiEnrageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + m_uiEnrageTimer = 60000; + }else m_uiEnrageTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) +{ + return new boss_hydross_the_unstableAI(pCreature); +} + +void AddSC_boss_hydross_the_unstable() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_hydross_the_unstable"; + newscript->GetAI = &GetAI_boss_hydross_the_unstable; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/boss_lady_vashj.cpp b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_lady_vashj.cpp new file mode 100644 index 0000000..f1eeec3 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_lady_vashj.cpp @@ -0,0 +1,769 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA + */ + +/* ScriptData +SDName: Boss_Lady_Vashj +SD%Complete: 60 +SDComment: Code cleanup needed. This script needs further adjustments. +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "serpent_shrine.h" +#include "Item.h" +#include "Spell.h" + +enum +{ + SAY_INTRO = -1548042, + SAY_AGGRO1 = -1548043, + SAY_AGGRO2 = -1548044, + SAY_AGGRO3 = -1548045, + SAY_AGGRO4 = -1548046, + SAY_PHASE1 = -1548047, + SAY_PHASE2 = -1548048, + SAY_PHASE3 = -1548049, + SAY_BOWSHOT1 = -1548050, + SAY_BOWSHOT2 = -1548051, + SAY_SLAY1 = -1548052, + SAY_SLAY2 = -1548053, + SAY_SLAY3 = -1548054, + SAY_DEATH = -1548055, + + POINT_MOVE_CENTER = 0, + + PHASE_1 = 1, + PHASE_2 = 2, + PHASE_3 = 3, + + MAX_SHIELD_GEN = 4, + + SPELL_MULTI_SHOT = 38310, + SPELL_SHOCK_BLAST = 38509, + SPELL_ENTANGLE = 38316, + SPELL_STATIC_CHARGE_TRIGGER = 38280, + SPELL_FORKED_LIGHTNING = 38145, + SPELL_SHOOT = 38295, + + SPELL_TOXIC_SPORES = 38575, + SPELL_MAGIC_BARRIER = 38112, + SPELL_SURGE = 38044, + + //tainted elemental + SPELL_POISON_BOLT = 38253, + SPELL_SUMMON_TAINTED = 38139, + + NPC_ENCHANTED_ELEMENTAL = 21958, + NPC_TAINTED_ELEMENTAL = 22009, + NPC_COILFANG_STRIDER = 22056, + NPC_COILFANG_ELITE = 22055, + NPC_TOXIC_SPOREBAT = 22140, + + NPC_SHIELD_GENERATOR = 19870 +}; + +const float afMiddlePos[3] = {30.134f, -923.65f, 42.9f}; + +const float afSporebatPos[4] = {30.977156f, -925.297761f, 77.176567f, 5.223932f}; + +const float afElementPos[8][4] = +{ + {8.3f , -835.3f , 21.9f, 5.0f}, + {53.4f , -835.3f , 21.9f, 4.5f}, + {96.0f , -861.9f , 21.8f, 4.0f}, + {96.0f , -986.4f , 21.4f, 2.5f}, + {54.4f , -1010.6f, 22.0f, 1.8f}, + {9.8f , -1012.0f, 21.7f, 1.4f}, + {-35.0f, -987.6f , 21.5f, 0.8f}, + {-58.9f, -901.6f , 21.5f, 6.0f} +}; + +const float afCoilfangElitePos[3][4] = +{ + {28.84f , -923.28f , 42.9f , 6.0f }, + {31.183281f, -953.502625f, 41.523602f, 1.640957f}, + {58.895180f, -923.124268f, 41.545307f, 3.152848f} +}; + +const float afCoilfangStriderPos[3][4] = +{ + {66.427f, -948.778f, 41.262245f, 2.584f}, + {7.513f , -959.538f, 41.300422f, 1.0346f}, + {-12.843f, -907.798f, 41.239620f, 6.087f} +}; + +const float afShieldGeneratorChannelPos[4][4] = +{ + {49.626f, -902.181f, 41.54f, 3.956f}, + {10.988f, -901.616f, 41.54f, 5.437f}, + {10.385f, -944.036f, 41.54f, 0.779f}, + {49.312f, -943.398f, 41.54f, 2.401f} +}; + +//Lady Vashj AI +struct MANGOS_DLL_DECL boss_lady_vashjAI : public ScriptedAI +{ + boss_lady_vashjAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + memset(&m_auiShieldGeneratorChannel, 0, sizeof(m_auiShieldGeneratorChannel)); + Reset(); + } + + ScriptedInstance *m_pInstance; // the instance + + uint64 m_auiShieldGeneratorChannel[MAX_SHIELD_GEN]; + + // timers + uint32 m_uiShockBlast_Timer; + uint32 m_uiEntangle_Timer; + uint32 m_uiStaticCharge_Timer; + uint32 m_uiForkedLightning_Timer; + uint32 m_uiCheck_Timer; + uint32 m_uiEnchantedElemental_Timer; + uint32 m_uiTaintedElemental_Timer; + uint32 m_uiCoilfangElite_Timer; + uint32 m_uiCoilfangStrider_Timer; + uint32 m_uiSummonSporebat_Timer; + uint32 m_uiSummonSporebat_StaticTimer; + uint8 m_uiEnchantedElemental_Pos; + uint8 m_uiPhase; + + bool m_bEntangle; + + void Reset() + { + SetCombatMovement(true); + + m_uiShockBlast_Timer = urand(1000, 60000); + m_uiEntangle_Timer = 30000; + m_uiStaticCharge_Timer = urand(10000, 25000); + m_uiCheck_Timer = 1000; + + m_uiForkedLightning_Timer = urand(43000, 49000); + m_uiEnchantedElemental_Timer = 10000; + m_uiTaintedElemental_Timer = 50000; + m_uiCoilfangElite_Timer = 45000; + m_uiCoilfangStrider_Timer = 60000; + + m_uiSummonSporebat_Timer = 10000; + m_uiSummonSporebat_StaticTimer = 30000; + m_uiEnchantedElemental_Pos = 0; + m_uiPhase = PHASE_1; + + m_bEntangle = false; + + RemoveAllShieldGenerators(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LADYVASHJ_EVENT, NOT_STARTED); + } + + void RemoveAllShieldGenerators() + { + for(uint8 i = 0; i < MAX_SHIELD_GEN; ++i) + { + if (Creature* pTemp = m_creature->GetMap()->GetCreature(m_auiShieldGeneratorChannel[i])) + { + if (pTemp->isAlive()) + pTemp->SetDeathState(JUST_DIED); + + m_auiShieldGeneratorChannel[i] = 0; + } + } + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_AGGRO4, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_LADYVASHJ_EVENT, IN_PROGRESS); + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiPointId == POINT_MOVE_CENTER) + { + m_creature->RemoveAllAuras(); + + for(uint8 i = 0; i < MAX_SHIELD_GEN; ++i) + { + if (Creature* pCreature = m_creature->SummonCreature(NPC_SHIELD_GENERATOR, afShieldGeneratorChannelPos[i][0], afShieldGeneratorChannelPos[i][1], afShieldGeneratorChannelPos[i][2], afShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiShieldGeneratorChannel[i] = pCreature->GetGUID(); + } + } + } + + void JustSummoned(Creature* pSummoned) + { + uint32 uiEntry = pSummoned->GetEntry(); + + if (uiEntry == NPC_COILFANG_STRIDER || uiEntry == NPC_COILFANG_ELITE || uiEntry == NPC_TOXIC_SPOREBAT) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + if (uiEntry == NPC_SHIELD_GENERATOR) + { + //we should really expect database to have this set already + if (!pSummoned->HasFlag(UNIT_FIELD_FLAGS, (UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE))) + { + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + pSummoned->CastSpell(m_creature,SPELL_MAGIC_BARRIER,true); + } + } + + //called when any summoned (by m_creature) despawns + void SummonedCreatureDespawn(Creature* pDespawned) + { + if (pDespawned->GetEntry() == NPC_TAINTED_ELEMENTAL) + { + if (m_uiTaintedElemental_Timer > 50000) + m_uiTaintedElemental_Timer = 50000; + } + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* pVictim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LADYVASHJ_EVENT, DONE); + } + + void CastShootOrMultishot() + { + //Shoot: Used in m_uiPhases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. + //Multishot: Used in m_uiPhases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. + DoCastSpellIfCan(m_creature->getVictim(), urand(0,1) ? SPELL_SHOOT : SPELL_MULTI_SHOT); + + if (urand(0, 2)) + DoScriptText(urand(0,1) ? SAY_BOWSHOT1 : SAY_BOWSHOT2, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiPhase == PHASE_1 || m_uiPhase == PHASE_3) + { + //m_uiShockBlast_Timer + if (m_uiShockBlast_Timer < uiDiff) + { + //Randomly used in m_uiPhases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHOCK_BLAST); + + m_uiShockBlast_Timer = urand(1000, 15000); //random cooldown + }else m_uiShockBlast_Timer -= uiDiff; + + //m_uiStaticCharge_Timer + if (m_uiStaticCharge_Timer < uiDiff) + { + //Used on random people (only 1 person at any given time) in m_uiPhases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. + Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + //cast Static Charge every 2 seconds for 20 seconds + if (pTarget && !pTarget->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + DoCastSpellIfCan(pTarget, SPELL_STATIC_CHARGE_TRIGGER); + + m_uiStaticCharge_Timer = urand(10000, 30000); + }else m_uiStaticCharge_Timer -= uiDiff; + + //m_uiEntangle_Timer + if (m_uiEntangle_Timer < uiDiff) + { + if (!m_bEntangle) + { + //Used in m_uiPhases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ENTANGLE); + m_bEntangle = true; + m_uiEntangle_Timer = 10000; + } + else + { + CastShootOrMultishot(); + m_bEntangle = false; + m_uiEntangle_Timer = urand(20000, 25000); + } + }else m_uiEntangle_Timer -= uiDiff; + + //m_uiPhase 1 + if (m_uiPhase == PHASE_1) + { + //m_uiPhase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. + if (m_creature->GetHealthPercent() <= 70.0f) + { + DoScriptText(SAY_PHASE2, m_creature); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + { + //set false, so MoveChase is not triggered in AttackStart + SetCombatMovement(false); + + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MovePoint(POINT_MOVE_CENTER, afMiddlePos[0], afMiddlePos[1], afMiddlePos[2]); + } + + m_uiPhase = PHASE_2; + return; + } + } + //m_uiPhase PHASE_3 + else + { + //m_uiSummonSporebat_Timer + if (m_uiSummonSporebat_Timer < uiDiff) + { + m_creature->SummonCreature(NPC_TOXIC_SPOREBAT, + afSporebatPos[0], afSporebatPos[1], afSporebatPos[2], afSporebatPos[3], + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + + //summon sporebats faster and faster + if (m_uiSummonSporebat_StaticTimer > 1000) + m_uiSummonSporebat_StaticTimer -= 1000; + + m_uiSummonSporebat_Timer = m_uiSummonSporebat_StaticTimer; + }else m_uiSummonSporebat_Timer -= uiDiff; + } + + //Melee attack + DoMeleeAttackIfReady(); + + //m_uiCheck_Timer - used to check if somebody is in melee range + if (m_uiCheck_Timer < uiDiff) + { + bool bInMeleeRange = false; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + Unit* pTarget = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + //if in melee range + if (pTarget && pTarget->IsWithinDistInMap(m_creature, ATTACK_DISTANCE)) + { + bInMeleeRange = true; + break; + } + } + + //if nobody is in melee range + if (!bInMeleeRange) + CastShootOrMultishot(); + + m_uiCheck_Timer = 1500; + }else m_uiCheck_Timer -= uiDiff; + } + //m_uiPhase PHASE_2 + else + { + //m_uiForkedLightning_Timer + if (m_uiForkedLightning_Timer < uiDiff) + { + //Used constantly in m_uiPhase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (!pTarget) + pTarget = m_creature->getVictim(); + + DoCastSpellIfCan(pTarget, SPELL_FORKED_LIGHTNING); + + m_uiForkedLightning_Timer = urand(3000, 9000); + }else m_uiForkedLightning_Timer -= uiDiff; + + //NPC_ENCHANTED_ELEMENTAL + if (m_uiEnchantedElemental_Timer < uiDiff) + { + if (Creature* pElemental = m_creature->SummonCreature(NPC_ENCHANTED_ELEMENTAL, afElementPos[m_uiEnchantedElemental_Pos][0], afElementPos[m_uiEnchantedElemental_Pos][1], afElementPos[m_uiEnchantedElemental_Pos][2], afElementPos[m_uiEnchantedElemental_Pos][3], TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000)) + pElemental->GetMotionMaster()->MoveFollow(m_creature, 0.0f, 0.0f); + + if (m_uiEnchantedElemental_Pos == 7) + m_uiEnchantedElemental_Pos = 0; + else + ++m_uiEnchantedElemental_Pos; + + m_uiEnchantedElemental_Timer = urand(10000, 15000); + }else m_uiEnchantedElemental_Timer -= uiDiff; + + //NPC_TAINTED_ELEMENTAL + if (m_uiTaintedElemental_Timer < uiDiff) + { + uint32 uiPos = urand(0,7); + + m_creature->SummonCreature(NPC_TAINTED_ELEMENTAL, + afElementPos[uiPos][0], afElementPos[uiPos][1], afElementPos[uiPos][2], afElementPos[uiPos][3], + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 15000); + + m_uiTaintedElemental_Timer = 120000; + }else m_uiTaintedElemental_Timer -= uiDiff; + + //NPC_COILFANG_ELITE + if (m_uiCoilfangElite_Timer < uiDiff) + { + uint32 uiPos = urand(0,2); + + m_creature->SummonCreature(NPC_COILFANG_ELITE, + afCoilfangElitePos[uiPos][0], afCoilfangElitePos[uiPos][1], afCoilfangElitePos[uiPos][2], afCoilfangElitePos[uiPos][3], + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 45000); + + //wowwiki says 50 seconds, bosskillers says 45 + m_uiCoilfangElite_Timer = urand(45000, 50000); + }else m_uiCoilfangElite_Timer -= uiDiff; + + //NPC_COILFANG_STRIDER + if (m_uiCoilfangStrider_Timer < uiDiff) + { + uint32 uiPos = urand(0,2); + + m_creature->SummonCreature(NPC_COILFANG_STRIDER, + afCoilfangStriderPos[uiPos][0], afCoilfangStriderPos[uiPos][1], afCoilfangStriderPos[uiPos][2], afCoilfangStriderPos[uiPos][3], + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + + //wowwiki says 60 seconds, bosskillers says 60-70 + m_uiCoilfangStrider_Timer = urand(60000, 70000); + }else m_uiCoilfangStrider_Timer -= uiDiff; + + //m_uiCheck_Timer + if (m_uiCheck_Timer < uiDiff) + { + //Start m_uiPhase 3 + if (m_pInstance && m_pInstance->GetData(TYPE_VASHJ_PHASE3_CHECK) == DONE) + { + DoScriptText(SAY_PHASE3, m_creature); + + //set life 50%, not correct. Must remove 5% for each generator switched off + m_creature->SetHealth(m_creature->GetMaxHealth()/2); + + //m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); + + SetCombatMovement(true); + + //return to chase top aggro + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + m_uiPhase = PHASE_3; + } + m_uiCheck_Timer = 1000; + }else m_uiCheck_Timer -= uiDiff; + } + } +}; + +//Enchanted Elemental +//If one of them reaches Vashj he will increase her damage done by 5%. +struct MANGOS_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI +{ + mob_enchanted_elementalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + SetCombatMovement(false); + Reset(); + } + + ScriptedInstance *m_pInstance; // the instance + + void Reset() { } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_pInstance) + { + if (Creature* pVashj = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_LADYVASHJ))) + { + if (pVashj->IsWithinDistInMap(m_creature, ATTACK_DISTANCE)) + { + //increase lady vashj damage + if (pVashj->isAlive() && pVashj->isInCombat()) + m_creature->CastSpell(pVashj, SPELL_SURGE, false, 0, 0, pVashj->GetGUID()); + else + m_creature->SetDeathState(JUST_DIED); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) { } +}; + +//Tainted Elemental +//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental +struct MANGOS_DLL_DECL mob_tainted_elementalAI : public ScriptedAI +{ + mob_tainted_elementalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + SetCombatMovement(false); + Reset(); + } + + ScriptedInstance* m_pInstance; // the instance + + // timers + uint32 m_uiPoisonBolt_Timer; + + void Reset() + { + m_uiPoisonBolt_Timer = urand(5000, 10000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiPoisonBolt_Timer + if (m_uiPoisonBolt_Timer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (pTarget && pTarget->IsWithinDistInMap(m_creature, 30.0f)) + DoCastSpellIfCan(pTarget, SPELL_POISON_BOLT); + + m_uiPoisonBolt_Timer = urand(5000, 10000); + }else m_uiPoisonBolt_Timer -= uiDiff; + } +}; + +//Toxic Sporebat +//Toxic Spores: Used in m_uiPhase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. +struct MANGOS_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI +{ + mob_toxic_sporebatAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiToxicSpore_Timer; + uint32 m_uiCheck_Timer; + + void Reset() + { + m_creature->setFaction(14); + m_uiToxicSpore_Timer = 5000; + m_uiCheck_Timer = 1000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiToxicSpore_Timer + if (m_uiToxicSpore_Timer < uiDiff) + { + //The Spores will hit you anywhere in the instance: underwater, at the elevator, at the entrance, wherever. + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_TOXIC_SPORES); + + m_uiToxicSpore_Timer = urand(20000, 25000); + }else m_uiToxicSpore_Timer -= uiDiff; + + //m_uiCheck_Timer + if (m_uiCheck_Timer < uiDiff) + { + if (m_pInstance) + { + //check if vashj is death + Creature* pVashj = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_LADYVASHJ)); + if (!pVashj || !pVashj->isAlive()) + { + //remove + m_creature->SetDeathState(DEAD); + m_creature->RemoveCorpse(); + m_creature->setFaction(35); + } + } + + m_uiCheck_Timer = 1000; + }else m_uiCheck_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +enum +{ + SPELL_CLEAVE = 31345, + SPELL_MIND_BLAST = 41374 +}; + +//can probably be removed +struct MANGOS_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI +{ + mob_shield_generator_channelAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; // the instance + + void Reset() { } + + void MoveInLineOfSight(Unit* pWho) { } +}; + +//this is wrong, alternative script needed +bool ItemUse_item_tainted_core(Player* pPlayer, Item* pItem, SpellCastTargets const& sctTargets) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pPlayer->GetInstanceData(); + + if (!pInstance) + { + error_log("SD2: Lady Vashj Tainted Core: Instance Script Not Initialized"); + return true; + } + + Creature* pVashj = pPlayer->GetMap()->GetCreature(pInstance->GetData64(DATA_LADYVASHJ)); + + if (!pVashj) + return true; + + boss_lady_vashjAI* pVashjAI = dynamic_cast(pVashj->AI()); + + if (pVashjAI && pVashjAI->m_uiPhase == 2) + { + if (sctTargets.getGOTarget() && sctTargets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT) + { + uint32 uiIdentifier; + uint8 uiChannelIdentifier; + switch(sctTargets.getGOTarget()->GetEntry()) + { + case 185052: + uiIdentifier = TYPE_SHIELDGENERATOR1; + uiChannelIdentifier = 0; + break; + case 185053: + uiIdentifier = TYPE_SHIELDGENERATOR2; + uiChannelIdentifier = 1; + break; + case 185051: + uiIdentifier = TYPE_SHIELDGENERATOR3; + uiChannelIdentifier = 2; + break; + case 185054: + uiIdentifier = TYPE_SHIELDGENERATOR4; + uiChannelIdentifier = 3; + break; + default: + return true; + break; + } + + if (pInstance->GetData(uiIdentifier) == DONE) + return true; + + //get and remove channel + if (Creature* pChannel = pVashj->GetMap()->GetCreature(pVashjAI->m_auiShieldGeneratorChannel[uiChannelIdentifier])) + pChannel->SetDeathState(JUST_DIED); //calls Unsummon() + + pInstance->SetData(uiIdentifier, DONE); + + //remove this item + pPlayer->DestroyItemCount(31088, 1, true); + } + } + return true; +} + +CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) +{ + return new boss_lady_vashjAI(pCreature); +} + +CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) +{ + return new mob_enchanted_elementalAI(pCreature); +} + +CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) +{ + return new mob_tainted_elementalAI(pCreature); +} + +CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) +{ + return new mob_toxic_sporebatAI(pCreature); +} + +CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) +{ + return new mob_shield_generator_channelAI(pCreature); +} + +void AddSC_boss_lady_vashj() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_lady_vashj"; + newscript->GetAI = &GetAI_boss_lady_vashj; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_enchanted_elemental"; + newscript->GetAI = &GetAI_mob_enchanted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_tainted_elemental"; + newscript->GetAI = &GetAI_mob_tainted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_toxic_sporebat"; + newscript->GetAI = &GetAI_mob_toxic_sporebat; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shield_generator_channel"; + newscript->GetAI = &GetAI_mob_shield_generator_channel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_tainted_core"; + newscript->pItemUse = &ItemUse_item_tainted_core; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/boss_leotheras_the_blind.cpp b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_leotheras_the_blind.cpp new file mode 100644 index 0000000..3524c74 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -0,0 +1,342 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Leotheras_The_Blind +SD%Complete: 50 +SDComment: Missing Inner Demons +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "serpent_shrine.h" + +enum +{ + SAY_AGGRO = -1548009, + SAY_SWITCH_TO_DEMON = -1548010, + SAY_INNER_DEMONS = -1548011, + SAY_DEMON_SLAY1 = -1548012, + SAY_DEMON_SLAY2 = -1548013, + SAY_DEMON_SLAY3 = -1548014, + SAY_NIGHTELF_SLAY1 = -1548015, + SAY_NIGHTELF_SLAY2 = -1548016, + SAY_NIGHTELF_SLAY3 = -1548017, + SAY_FINAL_FORM = -1548018, + SAY_FREE = -1548019, + SAY_DEATH = -1548020, + + SPELL_ENRAGE = 26662, + + SPELL_WHIRLWIND = 37640, + SPELL_CHAOS_BLAST = 37674, + SPELL_INSIDIOUS_WHISPER = 37676, //not implemented yet. After cast (spellHit), do the inner demon + SPELL_CONS_MADNESS = 37749, + + SPELL_DEMON_ALIGNMENT = 37713, //inner demon have this aura + SPELL_SHADOW_BOLT = 39309, //inner demon spell spam + + FACTION_DEMON_1 = 1829, + FACTION_DEMON_2 = 1830, + FACTION_DEMON_3 = 1831, + FACTION_DEMON_4 = 1832, + FACTION_DEMON_5 = 1833, + + MODEL_NIGHTELF = 20514, + MODEL_DEMON = 20125, + + NPC_INNER_DEMON = 21857, + NPC_SHADOW_LEO = 21875 +}; + +//Original Leotheras the Blind AI +struct MANGOS_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI +{ + boss_leotheras_the_blindAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_uiShadowLeo = 0; + Reset(); + } + + ScriptedInstance* m_pInstance; // the instance + + // timers + uint32 m_uiWhirlwind_Timer; + uint32 m_uiInnerDemon_Timer; + uint32 m_uiSwitch_Timer; + uint32 m_uiEnrage_Timer; + + bool m_bDemonForm; + bool m_bIsFinalForm; + + uint64 m_uiShadowLeo; + + void Reset() + { + m_uiWhirlwind_Timer = 18500; + m_uiInnerDemon_Timer = 15000; + m_uiSwitch_Timer = 45000; + m_uiEnrage_Timer = MINUTE*10*IN_MILLISECONDS; + + m_bDemonForm = false; + m_bIsFinalForm = false; + + if (m_creature->GetDisplayId() != MODEL_NIGHTELF) + m_creature->SetDisplayId(MODEL_NIGHTELF); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LEOTHERAS_EVENT, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LEOTHERAS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + switch(urand(0, 2)) + { + case 0: DoScriptText(m_bDemonForm ? SAY_DEMON_SLAY1 : SAY_NIGHTELF_SLAY1, m_creature); break; + case 1: DoScriptText(m_bDemonForm ? SAY_DEMON_SLAY2 : SAY_NIGHTELF_SLAY2, m_creature); break; + case 2: DoScriptText(m_bDemonForm ? SAY_DEMON_SLAY3 : SAY_NIGHTELF_SLAY3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (m_creature->getVictim() && pSummoned->GetEntry() == NPC_SHADOW_LEO) + { + m_uiShadowLeo = pSummoned->GetGUID(); + pSummoned->AI()->AttackStart(m_creature->getVictim()); + } + } + + void JustDied(Unit* pVictim) + { + DoScriptText(SAY_DEATH, m_creature); + + //despawn copy + if (m_uiShadowLeo) + { + if (Creature* pShadowLeo = m_creature->GetMap()->GetCreature(m_uiShadowLeo)) + pShadowLeo->ForcedDespawn(); + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_LEOTHERAS_EVENT, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bDemonForm) + { + //Whirlwind_Timer + if (m_uiWhirlwind_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + m_uiWhirlwind_Timer = 30000; + }else m_uiWhirlwind_Timer -= uiDiff; + + //Switch_Timer + if (!m_bIsFinalForm) + { + if (m_uiSwitch_Timer < uiDiff) + { + DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == CHASE_MOTION_TYPE) + { + //set false, so MoveChase is not triggered in AttackStart + SetCombatMovement(false); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + } + + //switch to demon form + m_creature->SetDisplayId(MODEL_DEMON); + DoResetThreat(); + m_bDemonForm = true; + + m_uiInnerDemon_Timer = 15000; + m_uiSwitch_Timer = 60000; + }else m_uiSwitch_Timer -= uiDiff; + } + } + else + { + //inner demon + if (m_uiInnerDemon_Timer < uiDiff) + { + DoScriptText(SAY_INNER_DEMONS, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature, SPELL_INSIDIOUS_WHISPER); + + m_uiInnerDemon_Timer = 60000; + }else m_uiInnerDemon_Timer -= uiDiff; + + //chaos blast spam + if (!m_creature->IsNonMeleeSpellCasted(false)) + m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, false); + + //Switch_Timer + if (m_uiSwitch_Timer < uiDiff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //switch to nightelf form + m_creature->SetDisplayId(MODEL_NIGHTELF); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + //set true + SetCombatMovement(true); + + DoResetThreat(); + m_bDemonForm = false; + + m_uiWhirlwind_Timer = 18500; + m_uiSwitch_Timer = 45000; + }else m_uiSwitch_Timer -= uiDiff; + } + + if (!m_bIsFinalForm && m_creature->GetHealthPercent() < 15.0f) + { + DoScriptText(SAY_FINAL_FORM, m_creature); + + //at this point he divides himself in two parts + m_creature->SummonCreature(NPC_SHADOW_LEO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (m_bDemonForm) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //switch to nightelf form + m_creature->SetDisplayId(MODEL_NIGHTELF); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + + //set true + SetCombatMovement(true); + + DoResetThreat(); + m_bDemonForm = false; + } + + m_bIsFinalForm = true; + } + + //m_uiEnrage_Timer + if (m_uiEnrage_Timer < uiDiff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature, SPELL_ENRAGE); + m_uiEnrage_Timer = MINUTE*5*IN_MILLISECONDS; + }else m_uiEnrage_Timer -= uiDiff; + + if (!m_bDemonForm) + DoMeleeAttackIfReady(); + } +}; + +//Leotheras the Blind Demon Form AI +struct MANGOS_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI +{ + boss_leotheras_the_blind_demonformAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + } + + void Reset() { } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_FREE, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_creature->IsNonMeleeSpellCasted(false)) + m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, false); + + //Do NOT deal any melee damage to the target. + } +}; + +CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) +{ + return new boss_leotheras_the_blindAI(pCreature); +} + +CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) +{ + return new boss_leotheras_the_blind_demonformAI(pCreature); +} + +void AddSC_boss_leotheras_the_blind() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_leotheras_the_blind"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_leotheras_the_blind_demonform"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_morogrim_tidewalker.cpp new file mode 100644 index 0000000..d236fa4 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -0,0 +1,317 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Morogrim_Tidewalker +SD%Complete: 90 +SDComment: +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "serpent_shrine.h" + +enum +{ + SAY_AGGRO = -1548030, + SAY_SUMMON1 = -1548031, + SAY_SUMMON2 = -1548032, + SAY_SUMMON_BUBL1 = -1548033, + SAY_SUMMON_BUBL2 = -1548034, + SAY_SLAY1 = -1548035, + SAY_SLAY2 = -1548036, + SAY_SLAY3 = -1548037, + SAY_DEATH = -1548038, + EMOTE_WATERY_GRAVE = -1548039, + EMOTE_EARTHQUAKE = -1548040, + EMOTE_WATERY_GLOBULES = -1548041, + + SPELL_TIDAL_WAVE = 37730, + SPELL_EARTHQUAKE = 37764, + + SPELL_WATERY_GRAVE_1 = 37850, + SPELL_WATERY_GRAVE_2 = 38023, + SPELL_WATERY_GRAVE_3 = 38024, + SPELL_WATERY_GRAVE_4 = 38025, + + SPELL_SUMMON_MURLOC_A6 = 39813, + SPELL_SUMMON_MURLOC_A7 = 39814, + SPELL_SUMMON_MURLOC_A8 = 39815, + SPELL_SUMMON_MURLOC_A9 = 39816, + SPELL_SUMMON_MURLOC_A10 = 39817, + + SPELL_SUMMON_MURLOC_B6 = 39818, + SPELL_SUMMON_MURLOC_B7 = 39819, + SPELL_SUMMON_MURLOC_B8 = 39820, + SPELL_SUMMON_MURLOC_B9 = 39821, + SPELL_SUMMON_MURLOC_B10 = 39822, + + SPELL_SUMMON_GLOBULE_1 = 37854, + SPELL_SUMMON_GLOBULE_2 = 37858, + SPELL_SUMMON_GLOBULE_3 = 37860, + SPELL_SUMMON_GLOBULE_4 = 37861, + + NPC_WATER_GLOBULE = 21913, + NPC_TIDEWALKER_LURKER = 21920 +}; + +//Morogrim Tidewalker AI +struct MANGOS_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI +{ + boss_morogrim_tidewalkerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; // the instance + + // timers + uint32 m_uiTidalWave_Timer; + uint32 m_uiWateryGrave_Timer; + uint32 m_uiEarthquake_Timer; + uint32 m_uiWateryGlobules_Timer; + + bool m_bEarthquake; + bool m_bPhase2; + + void Reset() + { + m_uiTidalWave_Timer = 10000; + m_uiWateryGrave_Timer = 30000; + m_uiEarthquake_Timer = 40000; + m_uiWateryGlobules_Timer = 0; + + m_bEarthquake = false; + m_bPhase2 = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROGRIM_EVENT, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROGRIM_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* pVictim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MOROGRIM_EVENT, DONE); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_TIDEWALKER_LURKER) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + if (pSummoned->GetEntry() == NPC_WATER_GLOBULE) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->GetMotionMaster()->MoveFollow(pTarget, 0.0f, 0.0f); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiEarthquake_Timer + if (m_uiEarthquake_Timer < uiDiff) + { + if (!m_bEarthquake) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_EARTHQUAKE); + m_bEarthquake = true; + m_uiEarthquake_Timer = 5000; + } + else + { + DoScriptText(urand(0,1) ? SAY_SUMMON1 : SAY_SUMMON2, m_creature); + + //north + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A6,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A7,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A8,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A9,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_A10,true); + + //south + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B6,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B7,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B8,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B9,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_MURLOC_B10,true); + + DoScriptText(EMOTE_EARTHQUAKE, m_creature); + + m_bEarthquake = false; + m_uiEarthquake_Timer = urand(40000, 45000); + } + }else m_uiEarthquake_Timer -= uiDiff; + + //m_uiTidalWave_Timer + if (m_uiTidalWave_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_TIDAL_WAVE); + m_uiTidalWave_Timer = 20000; + }else m_uiTidalWave_Timer -= uiDiff; + + if (!m_bPhase2) + { + //m_uiWateryGrave_Timer + if (m_uiWateryGrave_Timer < uiDiff) + { + //Teleport 4 players under the waterfalls + for(uint8 i = 0; i < 4; ++i) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1); + + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER && !pTarget->HasAuraType(SPELL_AURA_MOD_STUN) && pTarget->IsWithinDistInMap(m_creature, 45.0f)) + { + switch(i) + { + case 0: pTarget->CastSpell(pTarget,SPELL_WATERY_GRAVE_1,false); break; + case 1: pTarget->CastSpell(pTarget,SPELL_WATERY_GRAVE_2,false); break; + case 2: pTarget->CastSpell(pTarget,SPELL_WATERY_GRAVE_3,false); break; + case 3: pTarget->CastSpell(pTarget,SPELL_WATERY_GRAVE_4,false); break; + } + } + } + + DoScriptText(urand(0,1) ? SAY_SUMMON_BUBL1 : SAY_SUMMON_BUBL2, m_creature); + DoScriptText(EMOTE_WATERY_GRAVE, m_creature); + + m_uiWateryGrave_Timer = 30000; + }else m_uiWateryGrave_Timer -= uiDiff; + + //Start Phase2 + if (m_creature->GetHealthPercent() < 25.0f) + m_bPhase2 = true; + } + else + { + //m_uiWateryGlobules_Timer + if (m_uiWateryGlobules_Timer < uiDiff) + { + DoScriptText(EMOTE_WATERY_GLOBULES, m_creature); + + m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_1,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_2,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_3,true); + m_creature->CastSpell(m_creature,SPELL_SUMMON_GLOBULE_4,false); + + m_uiWateryGlobules_Timer = 25000; + }else m_uiWateryGlobules_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Water Globule AI +struct MANGOS_DLL_DECL mob_water_globuleAI : public ScriptedAI +{ + mob_water_globuleAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + // timers + uint32 m_uiCheck_Timer; + + void Reset() + { + m_uiCheck_Timer = 1000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pWho || m_creature->getVictim()) + return; + + if (pWho->isTargetableForAttack() && pWho->isInAccessablePlaceFor(m_creature) && m_creature->IsHostileTo(pWho)) + { + //no attack radius check - it attacks the first target that moves in his los + pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCheck_Timer < uiDiff) + { + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + m_creature->DealDamage(m_creature->getVictim(), 4000+rand()%2000, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_FROST, NULL, false); + + //despawn + m_creature->ForcedDespawn(); + return; + } + m_uiCheck_Timer = 500; + }else m_uiCheck_Timer -= uiDiff; + + //do NOT deal any melee damage to the target. + } +}; + +CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) +{ + return new boss_morogrim_tidewalkerAI (pCreature); +} +CreatureAI* GetAI_mob_water_globule(Creature* pCreature) +{ + return new mob_water_globuleAI (pCreature); +} + +void AddSC_boss_morogrim_tidewalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_morogrim_tidewalker"; + newscript->GetAI = &GetAI_boss_morogrim_tidewalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_water_globule"; + newscript->GetAI = &GetAI_mob_water_globule; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/instance_serpent_shrine.cpp b/scripts/outland/coilfang_reservoir/serpent_shrine/instance_serpent_shrine.cpp new file mode 100644 index 0000000..78f205b --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/instance_serpent_shrine.cpp @@ -0,0 +1,211 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Serpent_Shrine +SD%Complete: 90 +SDComment: +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "serpent_shrine.h" + +/* Serpentshrine cavern encounters: +0 - Hydross The Unstable event +1 - Leotheras The Blind Event +2 - The Lurker Below Event +3 - Fathom-Lord Karathress Event +4 - Morogrim Tidewalker Event +5 - Lady Vashj Event +*/ + +const int MAX_ENCOUNTER = 6; +const int MAX_GENERATOR = 4; + +struct MANGOS_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance +{ + instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) { Initialize(); }; + + uint64 m_uiSharkkis; + uint64 m_uiTidalvess; + uint64 m_uiCaribdis; + uint64 m_uiLadyVashj; + uint64 m_uiKarathress; + uint64 m_uiKarathressEvent_Starter; + + uint32 m_auiShieldGenerator[MAX_GENERATOR]; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + memset(&m_auiShieldGenerator, 0, sizeof(m_auiShieldGenerator)); + + m_uiSharkkis = 0; + m_uiTidalvess = 0; + m_uiCaribdis = 0; + m_uiLadyVashj = 0; + m_uiKarathress = 0; + m_uiKarathressEvent_Starter = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 21212: m_uiLadyVashj = pCreature->GetGUID(); break; + case 21214: m_uiKarathress = pCreature->GetGUID(); break; + case 21966: m_uiSharkkis = pCreature->GetGUID(); break; + case 21965: m_uiTidalvess = pCreature->GetGUID(); break; + case 21964: m_uiCaribdis = pCreature->GetGUID(); break; + } + } + + void SetData64(uint32 uiType, uint64 uiData) + { + if (uiType == DATA_KARATHRESS_STARTER) + m_uiKarathressEvent_Starter = uiData; + } + + uint64 GetData64(uint32 uiIdentifier) + { + switch(uiIdentifier) + { + case DATA_SHARKKIS: + return m_uiSharkkis; + case DATA_TIDALVESS: + return m_uiTidalvess; + case DATA_CARIBDIS: + return m_uiCaribdis; + case DATA_LADYVASHJ: + return m_uiLadyVashj; + case DATA_KARATHRESS: + return m_uiKarathress; + case DATA_KARATHRESS_STARTER: + return m_uiKarathressEvent_Starter; + } + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_HYDROSS_EVENT: + m_auiEncounter[0] = uiData; + break; + case TYPE_LEOTHERAS_EVENT: + m_auiEncounter[1] = uiData; + break; + case TYPE_THELURKER_EVENT: + m_auiEncounter[2] = uiData; + break; + case TYPE_KARATHRESS_EVENT: + m_auiEncounter[3] = uiData; + break; + case TYPE_MOROGRIM_EVENT: + m_auiEncounter[4] = uiData; + break; + case TYPE_LADYVASHJ_EVENT: + if (uiData == NOT_STARTED) + memset(&m_auiShieldGenerator, 0, sizeof(m_auiShieldGenerator)); + m_auiEncounter[5] = uiData; + break; + case TYPE_SHIELDGENERATOR1: + m_auiShieldGenerator[0] = uiData; + break; + case TYPE_SHIELDGENERATOR2: + m_auiShieldGenerator[1] = uiData; + break; + case TYPE_SHIELDGENERATOR3: + m_auiShieldGenerator[2] = uiData; + break; + case TYPE_SHIELDGENERATOR4: + m_auiShieldGenerator[3] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_HYDROSS_EVENT: + return m_auiEncounter[0]; + + case TYPE_LEOTHERAS_EVENT: + return m_auiEncounter[1]; + + case TYPE_THELURKER_EVENT: + return m_auiEncounter[2]; + + case TYPE_KARATHRESS_EVENT: + return m_auiEncounter[3]; + + case TYPE_MOROGRIM_EVENT: + return m_auiEncounter[4]; + + case TYPE_LADYVASHJ_EVENT: + return m_auiEncounter[5]; + + case TYPE_SHIELDGENERATOR1: + return m_auiShieldGenerator[0]; + + case TYPE_SHIELDGENERATOR2: + return m_auiShieldGenerator[1]; + + case TYPE_SHIELDGENERATOR3: + return m_auiShieldGenerator[2]; + + case TYPE_SHIELDGENERATOR4: + return m_auiShieldGenerator[3]; + + case TYPE_VASHJ_PHASE3_CHECK: + for(uint8 i = 0; i < MAX_GENERATOR; ++i) + { + if (m_auiShieldGenerator[i] != DONE) + return NOT_STARTED; + } + return DONE; + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_serpentshrine_cavern(Map* pMap) +{ + return new instance_serpentshrine_cavern(pMap); +} + +void AddSC_instance_serpentshrine_cavern() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_serpent_shrine"; + newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/serpent_shrine/serpent_shrine.h b/scripts/outland/coilfang_reservoir/serpent_shrine/serpent_shrine.h new file mode 100644 index 0000000..c8caf29 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/serpent_shrine/serpent_shrine.h @@ -0,0 +1,31 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SERPENT_SHRINE_H +#define DEF_SERPENT_SHRINE_H + +enum +{ + TYPE_HYDROSS_EVENT = 1, + TYPE_KARATHRESS_EVENT = 2, + TYPE_LADYVASHJ_EVENT = 3, + TYPE_LEOTHERAS_EVENT = 4, + TYPE_MOROGRIM_EVENT = 5, + TYPE_THELURKER_EVENT = 6, + + DATA_KARATHRESS_STARTER = 10, + DATA_KARATHRESS = 11, + DATA_CARIBDIS = 12, + DATA_SHARKKIS = 13, + DATA_TIDALVESS = 14, + + DATA_LADYVASHJ = 15, + TYPE_VASHJ_PHASE3_CHECK = 16, + + TYPE_SHIELDGENERATOR1 = 20, + TYPE_SHIELDGENERATOR2 = 21, + TYPE_SHIELDGENERATOR3 = 22, + TYPE_SHIELDGENERATOR4 = 23 +}; +#endif diff --git a/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp b/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp new file mode 100644 index 0000000..367e276 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/steam_vault/boss_hydromancer_thespia.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydromancer_Thespia +SD%Complete: 80 +SDComment: Needs additional adjustments (when instance script is adjusted) +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_hydromancer_thespia +mob_coilfang_waterelemental +EndContentData */ + +#include "precompiled.h" +#include "steam_vault.h" + +#define SAY_SUMMON -1545000 +#define SAY_AGGRO_1 -1545001 +#define SAY_AGGRO_2 -1545002 +#define SAY_AGGRO_3 -1545003 +#define SAY_SLAY_1 -1545004 +#define SAY_SLAY_2 -1545005 +#define SAY_DEAD -1545006 + +#define SPELL_LIGHTNING_CLOUD 25033 +#define SPELL_LUNG_BURST 31481 +#define SPELL_ENVELOPING_WINDS 31718 + +struct MANGOS_DLL_DECL boss_thespiaAI : public ScriptedAI +{ + boss_thespiaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 LightningCloud_Timer; + uint32 LungBurst_Timer; + uint32 EnvelopingWinds_Timer; + + void Reset() + { + LightningCloud_Timer = 15000; + LungBurst_Timer = 7000; + EnvelopingWinds_Timer = 9000; + + if (m_pInstance && m_creature->isAlive()) + m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA,NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //LightningCloud_Timer + if (LightningCloud_Timer < diff) + { + //cast twice in Heroic mode + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_LIGHTNING_CLOUD); + if (!m_bIsRegularMode) + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_LIGHTNING_CLOUD); + LightningCloud_Timer = urand(15000, 25000); + }else LightningCloud_Timer -=diff; + + //LungBurst_Timer + if (LungBurst_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_LUNG_BURST); + LungBurst_Timer = urand(7000, 12000); + }else LungBurst_Timer -=diff; + + //EnvelopingWinds_Timer + if (EnvelopingWinds_Timer < diff) + { + //cast twice in Heroic mode + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_ENVELOPING_WINDS); + if (!m_bIsRegularMode) + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, SPELL_ENVELOPING_WINDS); + EnvelopingWinds_Timer = urand(10000, 15000); + }else EnvelopingWinds_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_WATER_BOLT_VOLLEY 34449 +#define H_SPELL_WATER_BOLT_VOLLEY 37924 + +struct MANGOS_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI +{ + mob_coilfang_waterelementalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + uint32 WaterBoltVolley_Timer; + + void Reset() + { + WaterBoltVolley_Timer = urand(3000, 6000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (WaterBoltVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_WATER_BOLT_VOLLEY : H_SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = urand(7000, 12000); + }else WaterBoltVolley_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) +{ + return new boss_thespiaAI(pCreature); +} + +CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) +{ + return new mob_coilfang_waterelementalAI(pCreature); +} + +void AddSC_boss_hydromancer_thespia() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_hydromancer_thespia"; + newscript->GetAI = &GetAI_boss_thespiaAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_coilfang_waterelemental"; + newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp b/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp new file mode 100644 index 0000000..a0fdab6 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/steam_vault/boss_mekgineer_steamrigger.cpp @@ -0,0 +1,279 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mekgineer_Steamrigger +SD%Complete: 60 +SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_mekgineer_steamrigger +mob_steamrigger_mechanic +EndContentData */ + +#include "precompiled.h" +#include "steam_vault.h" + +#define SAY_MECHANICS -1545007 +#define SAY_AGGRO_1 -1545008 +#define SAY_AGGRO_2 -1545009 +#define SAY_AGGRO_3 -1545010 +#define SAY_AGGRO_4 -1545011 +#define SAY_SLAY_1 -1545012 +#define SAY_SLAY_2 -1545013 +#define SAY_SLAY_3 -1545014 +#define SAY_DEATH -1545015 + +#define SPELL_SUPER_SHRINK_RAY 31485 +#define SPELL_SAW_BLADE 31486 +#define SPELL_ELECTRIFIED_NET 35107 +#define H_SPELL_ENRAGE 1 //corrent enrage spell not known + +#define ENTRY_STREAMRIGGER_MECHANIC 17951 + +struct MANGOS_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI +{ + boss_mekgineer_steamriggerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Shrink_Timer; + uint32 Saw_Blade_Timer; + uint32 Electrified_Net_Timer; + bool Summon75; + bool Summon50; + bool Summon25; + + void Reset() + { + Shrink_Timer = 20000; + Saw_Blade_Timer = 15000; + Electrified_Net_Timer = 10000; + + Summon75 = false; + Summon50 = false; + Summon25 = false; + + if (m_pInstance && m_creature->isAlive()) + m_pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); + } + + //no known summon spells exist + void SummonMechanichs() + { + DoScriptText(SAY_MECHANICS, m_creature); + + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + + if (urand(0, 1)) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + + if (urand(0, 1)) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Shrink_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY); + Shrink_Timer = 20000; + }else Shrink_Timer -= diff; + + if (Saw_Blade_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,SPELL_SAW_BLADE); + else + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SAW_BLADE); + + Saw_Blade_Timer = 15000; + } else Saw_Blade_Timer -= diff; + + if (Electrified_Net_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ELECTRIFIED_NET); + Electrified_Net_Timer = 10000; + } + else Electrified_Net_Timer -= diff; + + if (!Summon75) + { + if (m_creature->GetHealthPercent() < 75.0f) + { + SummonMechanichs(); + Summon75 = true; + } + } + + if (!Summon50) + { + if (m_creature->GetHealthPercent() < 50.0f) + { + SummonMechanichs(); + Summon50 = true; + } + } + + if (!Summon25) + { + if (m_creature->GetHealthPercent() < 25.0f) + { + SummonMechanichs(); + Summon25 = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) +{ + return new boss_mekgineer_steamriggerAI(pCreature); +} + +#define SPELL_DISPEL_MAGIC 17201 +#define SPELL_REPAIR 31532 +#define H_SPELL_REPAIR 37936 + +#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair +#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required + +struct MANGOS_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI +{ + mob_steamrigger_mechanicAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Repair_Timer; + + void Reset() + { + Repair_Timer = 2000; + } + + void MoveInLineOfSight(Unit* who) + { + //react only if attacked + return; + } + + void UpdateAI(const uint32 diff) + { + if (Repair_Timer < diff) + { + if (m_pInstance && m_pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && m_pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) + { + if (Creature* pMekgineer = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) + { + if (m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) + { + //are we already channeling? Doesn't work very well, find better check? + if (!m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL)) + { + //m_creature->GetMotionMaster()->MovementExpired(); + //m_creature->GetMotionMaster()->MoveIdle(); + + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_REPAIR : H_SPELL_REPAIR, CAST_TRIGGERED); + } + Repair_Timer = 5000; + } + else + { + //m_creature->GetMotionMaster()->MovementExpired(); + //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0); + } + } + }else Repair_Timer = 5000; + }else Repair_Timer -= diff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) +{ + return new mob_steamrigger_mechanicAI(pCreature); +} + +void AddSC_boss_mekgineer_steamrigger() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_mekgineer_steamrigger"; + newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_steamrigger_mechanic"; + newscript->GetAI = &GetAI_mob_steamrigger_mechanic; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/steam_vault/boss_warlord_kalithresh.cpp b/scripts/outland/coilfang_reservoir/steam_vault/boss_warlord_kalithresh.cpp new file mode 100644 index 0000000..4627d0c --- /dev/null +++ b/scripts/outland/coilfang_reservoir/steam_vault/boss_warlord_kalithresh.cpp @@ -0,0 +1,210 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Kalithres +SD%Complete: 65 +SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "precompiled.h" +#include "steam_vault.h" + +#define SAY_INTRO -1545016 +#define SAY_REGEN -1545017 +#define SAY_AGGRO1 -1545018 +#define SAY_AGGRO2 -1545019 +#define SAY_AGGRO3 -1545020 +#define SAY_SLAY1 -1545021 +#define SAY_SLAY2 -1545022 +#define SAY_DEATH -1545023 + +#define SPELL_SPELL_REFLECTION 31534 +#define SPELL_IMPALE 39061 +#define SPELL_WARLORDS_RAGE 37081 +#define SPELL_WARLORDS_RAGE_NAGA 31543 + +#define SPELL_WARLORDS_RAGE_PROC 36453 + +struct MANGOS_DLL_DECL mob_naga_distillerAI : public ScriptedAI +{ + mob_naga_distillerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + //hack, due to really weird spell behaviour :( + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + + void StartRageGen(Unit *caster) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoCastSpellIfCan(m_creature, SPELL_WARLORDS_RAGE_NAGA, CAST_TRIGGERED); + + if (m_pInstance) + m_pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (m_creature->GetHealth() <= damage) + if (m_pInstance) + m_pInstance->SetData(TYPE_DISTILLER,DONE); + } +}; + +struct MANGOS_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI +{ + boss_warlord_kalithreshAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Reflection_Timer; + uint32 Impale_Timer; + uint32 Rage_Timer; + bool CanRage; + + void Reset() + { + Reflection_Timer = 10000; + Impale_Timer = urand(7000, 14000); + Rage_Timer = 45000; + CanRage = false; + + if (m_pInstance) + m_pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + //hack :( + if (spell->Id == SPELL_WARLORDS_RAGE_PROC) + if (m_pInstance) + if (m_pInstance->GetData(TYPE_DISTILLER) == DONE) + m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Rage_Timer < diff) + { + if (Creature* pDistiller = GetClosestCreatureWithEntry(m_creature, 17954, 100.0f)) + { + DoScriptText(SAY_REGEN, m_creature); + DoCastSpellIfCan(m_creature,SPELL_WARLORDS_RAGE); + + if (mob_naga_distillerAI* pDistillerAI = dynamic_cast(pDistiller->AI())) + pDistillerAI->StartRageGen(m_creature); + } + Rage_Timer = urand(3000, 18000); + }else Rage_Timer -= diff; + + //Reflection_Timer + if (Reflection_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_SPELL_REFLECTION); + Reflection_Timer = urand(15000, 25000); + }else Reflection_Timer -= diff; + + //Impale_Timer + if (Impale_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_IMPALE); + + Impale_Timer = urand(7500, 12500); + }else Impale_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) +{ + return new mob_naga_distillerAI(pCreature); +} + +CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) +{ + return new boss_warlord_kalithreshAI(pCreature); +} + +void AddSC_boss_warlord_kalithresh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_naga_distiller"; + newscript->GetAI = &GetAI_mob_naga_distiller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_warlord_kalithresh"; + newscript->GetAI = &GetAI_boss_warlord_kalithresh; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/steam_vault/instance_steam_vault.cpp b/scripts/outland/coilfang_reservoir/steam_vault/instance_steam_vault.cpp new file mode 100644 index 0000000..5487495 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/steam_vault/instance_steam_vault.cpp @@ -0,0 +1,204 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Steam_Vault +SD%Complete: 80 +SDComment: Instance script and access panel GO +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "precompiled.h" +#include "steam_vault.h" + +#define MAX_ENCOUNTER 4 + +#define MAIN_CHAMBERS_DOOR 183049 +#define ACCESS_PANEL_HYDRO 184125 +#define ACCESS_PANEL_MEK 184126 + +/* Steam Vaults encounters: +1 - Hydromancer Thespia Event +2 - Mekgineer Steamrigger Event +3 - Warlord Kalithresh Event +*/ + +bool GOHello_go_main_chambers_access_panel(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); + + if (pGo->GetEntry() == ACCESS_PANEL_MEK && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); + + return true; +} + +struct MANGOS_DLL_DECL instance_steam_vault : public ScriptedInstance +{ + instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiThespiaGUID; + uint64 m_uiMekgineerGUID; + uint64 m_uiKalithreshGUID; + + uint64 m_uiMainChambersDoor; + uint64 m_uiAccessPanelHydro; + uint64 m_uiAccessPanelMek; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiThespiaGUID = 0; + m_uiMekgineerGUID = 0; + m_uiKalithreshGUID = 0; + m_uiMainChambersDoor = 0; + m_uiAccessPanelHydro = 0; + m_uiAccessPanelMek = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 17797: m_uiThespiaGUID = pCreature->GetGUID(); break; + case 17796: m_uiMekgineerGUID = pCreature->GetGUID(); break; + case 17798: m_uiKalithreshGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case MAIN_CHAMBERS_DOOR: m_uiMainChambersDoor = pGo->GetGUID(); break; + case ACCESS_PANEL_HYDRO: m_uiAccessPanelHydro = pGo->GetGUID(); break; + case ACCESS_PANEL_MEK: m_uiAccessPanelMek = pGo->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + if (data == SPECIAL) + { + if (GameObject* pGo = instance->GetGameObject(m_uiAccessPanelHydro)) + pGo->SetGoState(GO_STATE_ACTIVE); + + if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) + { + if (GameObject* pGo = instance->GetGameObject(m_uiMainChambersDoor)) + pGo->SetGoState(GO_STATE_ACTIVE); + } + + debug_log("SD2: Instance Steamvault: Access panel used."); + } + m_auiEncounter[0] = data; + break; + case TYPE_MEKGINEER_STEAMRIGGER: + if (data == SPECIAL) + { + if (GameObject* pGo = instance->GetGameObject(m_uiAccessPanelMek)) + pGo->SetGoState(GO_STATE_ACTIVE); + + if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) + { + if (GameObject* pGo = instance->GetGameObject(m_uiMainChambersDoor)) + pGo->SetGoState(GO_STATE_ACTIVE); + } + + debug_log("SD2: Instance Steamvault: Access panel used."); + } + m_auiEncounter[1] = data; + break; + case TYPE_WARLORD_KALITHRESH: + m_auiEncounter[2] = data; + break; + case TYPE_DISTILLER: + m_auiEncounter[3] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + return m_auiEncounter[0]; + case TYPE_MEKGINEER_STEAMRIGGER: + return m_auiEncounter[1]; + case TYPE_WARLORD_KALITHRESH: + return m_auiEncounter[2]; + case TYPE_DISTILLER: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THESPIA: + return m_uiThespiaGUID; + case DATA_MEKGINEERSTEAMRIGGER: + return m_uiMekgineerGUID; + case DATA_KALITRESH: + return m_uiKalithreshGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) +{ + return new instance_steam_vault(pMap); +} + +void AddSC_instance_steam_vault() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_main_chambers_access_panel"; + newscript->pGOHello = &GOHello_go_main_chambers_access_panel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "instance_steam_vault"; + newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/coilfang_reservoir/steam_vault/steam_vault.h b/scripts/outland/coilfang_reservoir/steam_vault/steam_vault.h new file mode 100644 index 0000000..a789ea5 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/steam_vault/steam_vault.h @@ -0,0 +1,16 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_STEAM_VAULT_H +#define DEF_STEAM_VAULT_H + +#define TYPE_HYDROMANCER_THESPIA 1 +#define TYPE_MEKGINEER_STEAMRIGGER 2 +#define TYPE_WARLORD_KALITHRESH 3 +#define TYPE_DISTILLER 4 + +#define DATA_MEKGINEERSTEAMRIGGER 5 +#define DATA_KALITRESH 6 +#define DATA_THESPIA 7 +#endif diff --git a/scripts/outland/coilfang_reservoir/underbog/boss_hungarfen.cpp b/scripts/outland/coilfang_reservoir/underbog/boss_hungarfen.cpp new file mode 100644 index 0000000..8b1b737 --- /dev/null +++ b/scripts/outland/coilfang_reservoir/underbog/boss_hungarfen.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hungarfen +SD%Complete: 95 +SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FOUL_SPORES 31673 +#define SPELL_ACID_GEYSER 38739 + +struct MANGOS_DLL_DECL boss_hungarfenAI : public ScriptedAI +{ + boss_hungarfenAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + bool Root; + uint32 Mushroom_Timer; + uint32 AcidGeyser_Timer; + + void Reset() + { + Root = false; + Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode + AcidGeyser_Timer = 10000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() <= 20.0f) + { + if (!Root) + { + DoCastSpellIfCan(m_creature,SPELL_FOUL_SPORES); + Root = true; + } + } + + if (Mushroom_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + else + m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + + Mushroom_Timer = 10000; + }else Mushroom_Timer -= diff; + + if (AcidGeyser_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_ACID_GEYSER); + AcidGeyser_Timer = urand(10000, 17500); + }else AcidGeyser_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) +{ + return new boss_hungarfenAI(pCreature); +} + +#define SPELL_SPORE_CLOUD 34168 +#define SPELL_PUTRID_MUSHROOM 31690 +#define SPELL_GROW 31698 + +struct MANGOS_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI +{ + mob_underbog_mushroomAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool Stop; + uint32 Grow_Timer; + uint32 Shrink_Timer; + + void Reset() + { + Stop = false; + Grow_Timer = 0; + Shrink_Timer = 20000; + + DoCastSpellIfCan(m_creature, SPELL_PUTRID_MUSHROOM, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SPORE_CLOUD, CAST_TRIGGERED); + } + + void MoveInLineOfSight(Unit *who) { return; } + + void AttackStart(Unit* who) { return; } + + void UpdateAI(const uint32 diff) + { + if (Stop) + return; + + if (Grow_Timer <= diff) + { + DoCastSpellIfCan(m_creature,SPELL_GROW); + Grow_Timer = 3000; + }else Grow_Timer -= diff; + + if (Shrink_Timer <= diff) + { + m_creature->RemoveAurasDueToSpell(SPELL_GROW); + Stop = true; + }else Shrink_Timer -= diff; + } +}; +CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) +{ + return new mob_underbog_mushroomAI(pCreature); +} + +void AddSC_boss_hungarfen() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_hungarfen"; + newscript->GetAI = &GetAI_boss_hungarfen; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_underbog_mushroom"; + newscript->GetAI = &GetAI_mob_underbog_mushroom; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/gruuls_lair/boss_gruul.cpp b/scripts/outland/gruuls_lair/boss_gruul.cpp new file mode 100644 index 0000000..3c9b648 --- /dev/null +++ b/scripts/outland/gruuls_lair/boss_gruul.cpp @@ -0,0 +1,283 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gruul +SD%Complete: 60 +SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to mangos) +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "gruuls_lair.h" + +enum +{ + SAY_AGGRO = -1565010, + SAY_SLAM1 = -1565011, + SAY_SLAM2 = -1565012, + SAY_SHATTER1 = -1565013, + SAY_SHATTER2 = -1565014, + SAY_SLAY1 = -1565015, + SAY_SLAY2 = -1565016, + SAY_SLAY3 = -1565017, + SAY_DEATH = -1565018, + + EMOTE_GROW = -1565019, + + SPELL_GROWTH = 36300, + SPELL_CAVE_IN = 36240, + SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) + SPELL_REVERBERATION = 36297, + SPELL_SHATTER = 33654, + + SPELL_SHATTER_EFFECT = 33671, + SPELL_HURTFUL_STRIKE = 33813, + SPELL_STONED = 33652, //Spell is self cast by target + + SPELL_MAGNETIC_PULL = 28337, + SPELL_KNOCK_BACK = 24199 //Knockback spell until correct implementation is made +}; + +struct MANGOS_DLL_DECL boss_gruulAI : public ScriptedAI +{ + boss_gruulAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiGrowth_Timer; + uint32 m_uiCaveIn_Timer; + uint32 m_uiCaveIn_StaticTimer; + uint32 m_uiGroundSlamTimer; + uint32 m_uiHurtfulStrike_Timer; + uint32 m_uiReverberation_Timer; + + bool m_bPerformingGroundSlam; + + void Reset() + { + m_uiGrowth_Timer = 30000; + m_uiCaveIn_Timer = 27000; + m_uiCaveIn_StaticTimer = 30000; + m_uiGroundSlamTimer = 35000; + m_uiHurtfulStrike_Timer = 8000; + m_uiReverberation_Timer = 60000+45000; + m_bPerformingGroundSlam = false; + } + + void Aggro(Unit *pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_GRUUL_EVENT, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_GRUUL_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit* pVictim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_GRUUL_EVENT, DONE); + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction + //It's initially wrong, since this will cause fall damage, which is by comments, not intended. + if (pSpell->Id == SPELL_GROUND_SLAM) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + switch(urand(0, 1)) + { + case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break; + case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break; + } + } + } + + //this part should be in mangos + if (pSpell->Id == SPELL_SHATTER) + { + //this spell must have custom handling in mangos, dealing damage based on distance + pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); + + if (pTarget->HasAura(SPELL_STONED)) + pTarget->RemoveAurasDueToSpell(SPELL_STONED); + + //clear this, if we are still performing + if (m_bPerformingGroundSlam) + { + m_bPerformingGroundSlam = false; + + //and correct movement, if not already + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != CHASE_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Growth + // Gruul can cast this spell up to 30 times + if (m_uiGrowth_Timer < uiDiff) + { + DoScriptText(EMOTE_GROW, m_creature); + DoCastSpellIfCan(m_creature,SPELL_GROWTH); + m_uiGrowth_Timer = 30000; + } + else + m_uiGrowth_Timer -= uiDiff; + + if (m_bPerformingGroundSlam) + { + if (m_uiGroundSlamTimer < uiDiff) + { + m_uiGroundSlamTimer = 120000; + m_uiHurtfulStrike_Timer = 8000; + + //Give a little time to the players to undo the damage from shatter + if (m_uiReverberation_Timer < 10000) + m_uiReverberation_Timer += 10000; + + DoCastSpellIfCan(m_creature, SPELL_SHATTER); + } + else + m_uiGroundSlamTimer -= uiDiff; + } + else + { + // Hurtful Strike + if (m_uiHurtfulStrike_Timer < uiDiff) + { + // Find 2nd-aggro target within melee range. + Unit *pTarget = NULL; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + ThreatList::const_iterator itr = tList.begin(); + std::advance(itr, 1); + for (;itr != tList.end(); ++itr) + { + pTarget = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + // exclude pets, totems & player out of melee range + if (pTarget->GetTypeId() != TYPEID_PLAYER || !pTarget->IsWithinDist(m_creature, ATTACK_DISTANCE, false)) + { + pTarget = NULL; + continue; + } + //we've found someone + break; + } + + if (pTarget) + DoCastSpellIfCan(pTarget,SPELL_HURTFUL_STRIKE); + else + DoCastSpellIfCan(m_creature->getVictim(),SPELL_HURTFUL_STRIKE); + + m_uiHurtfulStrike_Timer = 8000; + } + else + m_uiHurtfulStrike_Timer -= uiDiff; + + // Reverberation + if (m_uiReverberation_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_REVERBERATION, CAST_TRIGGERED); + m_uiReverberation_Timer = urand(15000, 25000); + } + else + m_uiReverberation_Timer -= uiDiff; + + // Cave In + if (m_uiCaveIn_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget,SPELL_CAVE_IN); + + if (m_uiCaveIn_StaticTimer >= 4000) + m_uiCaveIn_StaticTimer -= 2000; + + m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; + + } + else + m_uiCaveIn_Timer -= uiDiff; + + // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter + if (m_uiGroundSlamTimer < uiDiff) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_bPerformingGroundSlam = true; + m_uiGroundSlamTimer = 10000; + + DoCastSpellIfCan(m_creature, SPELL_GROUND_SLAM); + } + else + m_uiGroundSlamTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_gruul(Creature* pCreature) +{ + return new boss_gruulAI(pCreature); +} + +void AddSC_boss_gruul() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gruul"; + newscript->GetAI = &GetAI_boss_gruul; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp b/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp new file mode 100644 index 0000000..ff9b645 --- /dev/null +++ b/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp @@ -0,0 +1,655 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_King_Maulgar +SD%Complete: 80 +SDComment: Verify that the script is working properly +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "gruuls_lair.h" + +enum +{ + SAY_AGGRO = -1565000, + SAY_ENRAGE = -1565001, + SAY_OGRE_DEATH1 = -1565002, + SAY_OGRE_DEATH2 = -1565003, + SAY_OGRE_DEATH3 = -1565004, + SAY_OGRE_DEATH4 = -1565005, + SAY_SLAY1 = -1565006, + SAY_SLAY2 = -1565007, + SAY_SLAY3 = -1565008, + SAY_DEATH = -1565009, + + // High King Maulgar Spells + SPELL_ARCING_SMASH = 39144, + SPELL_MIGHTY_BLOW = 33230, + SPELL_WHIRLWIND = 33238, + SPELL_FLURRY = 33232, + SPELL_CHARGE = 26561, + SPELL_FEAR = 16508, + + // Olm the Summoner Spells + SPELL_DARK_DECAY = 33129, + SPELL_DEATH_COIL = 33130, + SPELL_SUMMON_WILD_FELHUNTER = 33131, + + //Kiggler the Crazed Spells + SPELL_GREATER_POLYMORPH = 33173, + SPELL_LIGHTNING_BOLT = 36152, + SPELL_ARCANE_SHOCK = 33175, + SPELL_ARCANE_EXPLOSION = 33237, + + //Blindeye the Seer Spells + SPELL_GREATER_PW_SHIELD = 33147, + SPELL_HEAL = 33144, + SPELL_PRAYEROFHEALING = 33152, + + //Krosh Firehand Spells + SPELL_GREATER_FIREBALL = 33051, + SPELL_SPELLSHIELD = 33054, + SPELL_BLAST_WAVE = 33061, + + MAX_COUNCIL = 4 +}; + +const float DISTANCE_KIGGLER = 20.0f; +const float DISTANCE_KROSH = 30.0f; + +//High King Maulgar AI +struct MANGOS_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI +{ + boss_high_king_maulgarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + memset(&m_auiCouncil, 0, sizeof(m_auiCouncil)); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiArcingSmash_Timer; + uint32 m_uiMightyBlow_Timer; + uint32 m_uiWhirlwind_Timer; + uint32 m_uiCharge_Timer; + uint32 m_uiFear_Timer; + uint32 m_uiCouncilDeathCount; + + bool m_bPhase2; + + uint64 m_auiCouncil[MAX_COUNCIL]; // Council GUIDs + + void Reset() + { + m_uiArcingSmash_Timer = urand(8000, 14000); + m_uiMightyBlow_Timer = urand(15000, 25000); + m_uiWhirlwind_Timer = 30000; + m_uiCharge_Timer = 2000; + m_uiFear_Timer = urand(10000, 25000); + m_uiCouncilDeathCount = 0; + m_bPhase2 = false; + } + + void JustReachedHome() + { + for (uint8 i = 0; i < MAX_COUNCIL; ++i) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(m_auiCouncil[i])) + { + if (!pCreature->isAlive()) + pCreature->Respawn(); + else if (pCreature->getVictim()) + pCreature->AI()->EnterEvadeMode(); + } + } + + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == IN_PROGRESS) + m_pInstance->SetData(TYPE_MAULGAR_EVENT, NOT_STARTED); + } + + void KilledUnit() + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!m_pInstance) + return; + + //we risk being DONE before adds are in fact dead + m_pInstance->SetData(TYPE_MAULGAR_EVENT, DONE); + } + + void Aggro(Unit *pWho) + { + if (!m_pInstance) + return; + + GetCouncil(); + + DoScriptText(SAY_AGGRO, m_creature); + + m_creature->CallForHelp(50.0f); + + if (m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + m_pInstance->SetData(TYPE_MAULGAR_EVENT, IN_PROGRESS); + } + + void GetCouncil() + { + if (!m_pInstance) + return; + + //get council member's guid to respawn them if needed + m_auiCouncil[0] = m_pInstance->GetData64(DATA_KIGGLER); + m_auiCouncil[1] = m_pInstance->GetData64(DATA_BLINDEYE); + m_auiCouncil[2] = m_pInstance->GetData64(DATA_OLM); + m_auiCouncil[3] = m_pInstance->GetData64(DATA_KROSH); + } + + void EventCouncilDeath() + { + switch(++m_uiCouncilDeathCount) + { + case 1: DoScriptText(SAY_OGRE_DEATH1, m_creature); break; + case 2: DoScriptText(SAY_OGRE_DEATH2, m_creature); break; + case 3: DoScriptText(SAY_OGRE_DEATH3, m_creature); break; + case 4: DoScriptText(SAY_OGRE_DEATH4, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiArcingSmash_Timer + if (m_uiArcingSmash_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_ARCING_SMASH); + m_uiArcingSmash_Timer = urand(8000, 12000); + } + else + m_uiArcingSmash_Timer -= uiDiff; + + //m_uiWhirlwind_Timer + if (m_uiWhirlwind_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_WHIRLWIND); + m_uiWhirlwind_Timer = urand(30000, 40000); + } + else + m_uiWhirlwind_Timer -= uiDiff; + + //m_uiMightyBlow_Timer + if (m_uiMightyBlow_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MIGHTY_BLOW); + m_uiMightyBlow_Timer = urand(20000, 35000); + } + else + m_uiMightyBlow_Timer -= uiDiff; + + //Entering Phase 2 + if (!m_bPhase2 && m_creature->GetHealthPercent() < 50.0f) + { + m_bPhase2 = true; + DoScriptText(SAY_ENRAGE, m_creature); + DoCastSpellIfCan(m_creature, SPELL_FLURRY); + } + + if (m_bPhase2) + { + //m_uiCharge_Timer + if (m_uiCharge_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(pTarget, SPELL_CHARGE); + + m_uiCharge_Timer = urand(14000, 20000); + } + else + m_uiCharge_Timer -= uiDiff; + + //m_uiFear_Timer + if (m_uiFear_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FEAR); + m_uiFear_Timer = urand(20000, 35000); + } + else + m_uiFear_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +// Base AI for every council member +struct MANGOS_DLL_DECL Council_Base_AI : public ScriptedAI +{ + Council_Base_AI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + void JustReachedHome() + { + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == IN_PROGRESS) + m_pInstance->SetData(TYPE_MAULGAR_EVENT, NOT_STARTED); + } + + void Aggro(Unit *pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + m_pInstance->SetData(TYPE_MAULGAR_EVENT, IN_PROGRESS); + + m_creature->CallForHelp(50.0f); + } + + void JustDied(Unit* pVictim) + { + if (!m_pInstance) + return; + + Creature* pMaulgar = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_MAULGAR)); + + if (pMaulgar->isAlive()) + { + if (boss_high_king_maulgarAI* pMaulgarAI = dynamic_cast(pMaulgar->AI())) + pMaulgarAI->EventCouncilDeath(); + } + } +}; + +//Olm The Summoner AI +struct MANGOS_DLL_DECL boss_olm_the_summonerAI : public Council_Base_AI +{ + boss_olm_the_summonerAI(Creature* pCreature) : Council_Base_AI(pCreature) {Reset();} + + uint32 m_uiDarkDecay_Timer; + uint32 m_uiDeathCoil_Timer; + uint32 m_uiSummon_Timer; + + void Reset() + { + m_uiDarkDecay_Timer = 18000; + m_uiDeathCoil_Timer = 14000; + m_uiSummon_Timer = 10000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiDarkDecay_Timer + if (m_uiDarkDecay_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DARK_DECAY); + m_uiDarkDecay_Timer = 20000; + } + else + m_uiDarkDecay_Timer -= uiDiff; + + //m_uiDeathCoil_Timer + if (m_uiDeathCoil_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DEATH_COIL); + m_uiDeathCoil_Timer = urand(8000, 13000); + } + else + m_uiDeathCoil_Timer -= uiDiff; + + //m_uiSummon_Timer + if (m_uiSummon_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SUMMON_WILD_FELHUNTER); + m_uiSummon_Timer = urand(25000, 35000); + } + else + m_uiSummon_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Kiggler The Crazed AI +struct MANGOS_DLL_DECL boss_kiggler_the_crazedAI : public Council_Base_AI +{ + boss_kiggler_the_crazedAI(Creature* pCreature) : Council_Base_AI(pCreature) {Reset();} + + uint32 m_uiGreatherPolymorph_Timer; + uint32 m_uiLightningBolt_Timer; + uint32 m_uiArcaneShock_Timer; + uint32 m_uiArcaneExplosion_Timer; + + void Reset() + { + m_uiGreatherPolymorph_Timer = 15000; + m_uiLightningBolt_Timer = 10000; + m_uiArcaneShock_Timer = 20000; + m_uiArcaneExplosion_Timer = 30000; + } + + void SpellHitTarget(Unit* pVictim, const SpellEntry* pSpell) + { + // Spell currently not supported by core. Knock back effect should lower threat + // Workaround in script: + if (pSpell->Id == SPELL_ARCANE_EXPLOSION) + { + if (pVictim->GetTypeId() != TYPEID_PLAYER) + return; + + m_creature->getThreatManager().modifyThreatPercent(pVictim,-75); + } + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, false)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, DISTANCE_KIGGLER); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + if (m_uiGreatherPolymorph_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_GREATER_POLYMORPH); + m_uiGreatherPolymorph_Timer = urand(15000, 20000); + } + else + m_uiGreatherPolymorph_Timer -= uiDiff; + + //LightningBolt_Timer + if (m_uiLightningBolt_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); + m_uiLightningBolt_Timer = urand(2500, 4000); + } + else + m_uiLightningBolt_Timer -= uiDiff; + + //ArcaneShock_Timer + if (m_uiArcaneShock_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_SHOCK); + m_uiArcaneShock_Timer = urand(15000, 20000); + } + else + m_uiArcaneShock_Timer -= uiDiff; + + //ArcaneExplosion_Timer + if (m_uiArcaneExplosion_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_ARCANE_EXPLOSION); + m_uiArcaneExplosion_Timer = 30000; + } + else + m_uiArcaneExplosion_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Blindeye The Seer AI +struct MANGOS_DLL_DECL boss_blindeye_the_seerAI : public Council_Base_AI +{ + boss_blindeye_the_seerAI(Creature* pCreature) : Council_Base_AI(pCreature) {Reset();} + + uint32 m_uiGreaterPowerWordShield_Timer; + uint32 m_uiHeal_Timer; + uint32 m_uiPrayerofHealing_Timer; + + void Reset() + { + m_uiGreaterPowerWordShield_Timer = 5000; + m_uiHeal_Timer = urand(25000, 40000); + m_uiPrayerofHealing_Timer = urand(45000, 55000); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiGreaterPowerWordShield_Timer + if (m_uiGreaterPowerWordShield_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_GREATER_PW_SHIELD); + m_uiGreaterPowerWordShield_Timer = urand(30000, 40000); + } + else + m_uiGreaterPowerWordShield_Timer -= uiDiff; + + //m_uiHeal_Timer + if (m_uiHeal_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_HEAL); + m_uiHeal_Timer = urand(15000, 40000); + } + else + m_uiHeal_Timer -= uiDiff; + + //PrayerofHealing_Timer + if (m_uiPrayerofHealing_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_PRAYEROFHEALING); + m_uiPrayerofHealing_Timer = urand(35000, 50000); + } + else + m_uiPrayerofHealing_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Krosh Firehand AI +struct MANGOS_DLL_DECL boss_krosh_firehandAI : public Council_Base_AI +{ + boss_krosh_firehandAI(Creature* pCreature) : Council_Base_AI(pCreature) {Reset();} + + uint32 m_uiGreaterFireball_Timer; + uint32 m_uiSpellShield_Timer; + uint32 m_uiBlastWave_Timer; + + void Reset() + { + m_uiGreaterFireball_Timer = 4000; + m_uiSpellShield_Timer = 1000; + m_uiBlastWave_Timer = 12000; + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, DISTANCE_KROSH); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //someone evaded! + if (m_pInstance && m_pInstance->GetData(TYPE_MAULGAR_EVENT) == NOT_STARTED) + { + EnterEvadeMode(); + return; + } + + //m_uiGreaterFireball_Timer + if (m_uiGreaterFireball_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_GREATER_FIREBALL); + m_uiGreaterFireball_Timer = 3200; + } + else + m_uiGreaterFireball_Timer -= uiDiff; + + //SpellShield_Timer + if (m_uiSpellShield_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SPELLSHIELD, CAST_INTERRUPT_PREVIOUS); + m_uiSpellShield_Timer = 30000; + } + else + m_uiSpellShield_Timer -= uiDiff; + + //BlastWave_Timer + if (m_uiBlastWave_Timer < uiDiff) + { + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin(); i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && pUnit->IsWithinDistInMap(m_creature, 15.0f)) + { + DoCastSpellIfCan(m_creature, SPELL_BLAST_WAVE, CAST_INTERRUPT_PREVIOUS); + break; + } + } + + m_uiBlastWave_Timer = 6000; + } + else + m_uiBlastWave_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) +{ + return new boss_high_king_maulgarAI(pCreature); +} + +CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) +{ + return new boss_olm_the_summonerAI(pCreature); +} + +CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) +{ + return new boss_kiggler_the_crazedAI(pCreature); +} + +CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) +{ + return new boss_blindeye_the_seerAI(pCreature); +} + +CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) +{ + return new boss_krosh_firehandAI(pCreature); +} + +void AddSC_boss_high_king_maulgar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_high_king_maulgar"; + newscript->GetAI = &GetAI_boss_high_king_maulgar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_kiggler_the_crazed"; + newscript->GetAI = &GetAI_boss_kiggler_the_crazed; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_blindeye_the_seer"; + newscript->GetAI = &GetAI_boss_blindeye_the_seer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_olm_the_summoner"; + newscript->GetAI = &GetAI_boss_olm_the_summoner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_krosh_firehand"; + newscript->GetAI = &GetAI_boss_krosh_firehand; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/gruuls_lair/gruuls_lair.h b/scripts/outland/gruuls_lair/gruuls_lair.h new file mode 100644 index 0000000..03abdb4 --- /dev/null +++ b/scripts/outland/gruuls_lair/gruuls_lair.h @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_GRUULS_LAIR_H +#define DEF_GRUULS_LAIR_H + +enum +{ + MAX_ENCOUNTER = 2, + + // Encounter Status + TYPE_MAULGAR_EVENT = 1, + TYPE_GRUUL_EVENT = 2, + + // NPC GUIDs + DATA_MAULGAR = 3, + DATA_BLINDEYE = 4, + DATA_KIGGLER = 5, + DATA_KROSH = 6, + DATA_OLM = 7 +}; + +#endif diff --git a/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp b/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp new file mode 100644 index 0000000..5aa83cc --- /dev/null +++ b/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp @@ -0,0 +1,188 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Gruuls_Lair +SD%Complete: 100 +SDComment: +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "gruuls_lair.h" + +/* Gruuls Lair encounters: +1 - High King Maulgar event +2 - Gruul event +*/ + +struct MANGOS_DLL_DECL instance_gruuls_lair : public ScriptedInstance +{ + instance_gruuls_lair(Map *pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strSaveData; + + uint64 m_uiMaulgarGUID; + uint64 m_uiKigglerGUID; + uint64 m_uiBlindeyeGUID; + uint64 m_uiOlmGUID; + uint64 m_uiKroshGUID; + uint64 m_uiMaulgarDoorGUID; + uint64 m_uiGruulEncounterDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiMaulgarGUID = 0; + m_uiKigglerGUID = 0; + m_uiBlindeyeGUID = 0; + m_uiOlmGUID = 0; + m_uiKroshGUID = 0; + + m_uiMaulgarDoorGUID = 0; + m_uiGruulEncounterDoorGUID = 0; + } + + bool IsEncounterInProgress() const + { + for (uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch (pCreature->GetEntry()) + { + case 18831: m_uiMaulgarGUID = pCreature->GetGUID(); break; + case 18832: m_uiKroshGUID = pCreature->GetGUID(); break; + case 18834: m_uiOlmGUID = pCreature->GetGUID(); break; + case 18835: m_uiKigglerGUID = pCreature->GetGUID(); break; + case 18836: m_uiBlindeyeGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch (pGo->GetEntry()) + { + case 184468: + m_uiMaulgarDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case 184662: + m_uiGruulEncounterDoorGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch (uiType) + { + case TYPE_MAULGAR_EVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiMaulgarDoorGUID); + m_auiEncounter[0] = uiData; + break; + case TYPE_GRUUL_EVENT: + DoUseDoorOrButton(m_uiGruulEncounterDoorGUID); + m_auiEncounter[1] = uiData; + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + + strSaveData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + const char* Save() + { + return strSaveData.c_str(); + } + + uint32 GetData(uint32 uiType) + { + switch (uiType) + { + case TYPE_MAULGAR_EVENT: return m_auiEncounter[0]; + case TYPE_GRUUL_EVENT: return m_auiEncounter[1]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch (uiData) + { + case DATA_MAULGAR: return m_uiMaulgarGUID; + case DATA_BLINDEYE: return m_uiBlindeyeGUID; + case DATA_KIGGLER: return m_uiKigglerGUID; + case DATA_KROSH: return m_uiKroshGUID; + case DATA_OLM: return m_uiOlmGUID; + } + return 0; + } + + void Load(const char* chrIn) + { + if (!chrIn) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(chrIn); + + std::istringstream loadStream(chrIn); + + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) +{ + return new instance_gruuls_lair(pMap); +} + +void AddSC_instance_gruuls_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gruuls_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h b/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h new file mode 100644 index 0000000..1694688 --- /dev/null +++ b/scripts/outland/hellfire_citadel/blood_furnace/blood_furnace.h @@ -0,0 +1,35 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLOOD_FURNACE_H +#define DEF_BLOOD_FURNACE_H + +enum +{ + GO_DOOR_FINAL_EXIT = 181766, + GO_DOOR_MAKER_FRONT = 181811, + GO_DOOR_MAKER_REAR = 181812, + GO_DOOR_BROGGOK_FRONT = 181822, + GO_DOOR_BROGGOK_REAR = 181819, + GO_DOOR_KELIDAN_EXIT = 181823, + + DATA_THE_MAKER = 1, + DATA_BROGGOK = 2, + DATA_KELIDAN_THE_MAKER = 3, + + TYPE_THE_MAKER_EVENT = 4, + TYPE_BROGGOK_EVENT = 5, + TYPE_KELIDAN_EVENT = 6, + + DATA_PRISON_CELL_MAKER1 = 10, + DATA_PRISON_CELL_MAKER2 = 11, + DATA_PRISON_CELL_MAKER3 = 12, + DATA_PRISON_CELL_MAKER4 = 13, + DATA_PRISON_CELL_BROGGOK1 = 14, + DATA_PRISON_CELL_BROGGOK2 = 15, + DATA_PRISON_CELL_BROGGOK3 = 16, + DATA_PRISON_CELL_BROGGOK4 = 17 +}; + +#endif diff --git a/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp b/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp new file mode 100644 index 0000000..429c764 --- /dev/null +++ b/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp @@ -0,0 +1,149 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Broggok +SD%Complete: 70 +SDComment: pre-event not made +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "blood_furnace.h" + +enum +{ + SAY_AGGRO = -1542008, + + SPELL_SLIME_SPRAY = 30913, + H_SPELL_SLIME_SPRAY = 38458, + SPELL_POISON_CLOUD = 30916, + SPELL_POISON_BOLT = 30917, + H_SPELL_POISON_BOLT = 38459, + + SPELL_POISON = 30914 +}; + +struct MANGOS_DLL_DECL boss_broggokAI : public ScriptedAI +{ + boss_broggokAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 AcidSpray_Timer; + uint32 PoisonSpawn_Timer; + uint32 PoisonBolt_Timer; + + void Reset() + { + AcidSpray_Timer = 10000; + PoisonSpawn_Timer = 5000; + PoisonBolt_Timer = 7000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BROGGOK_EVENT,IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BROGGOK_EVENT,FAIL); + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); + } + + void JustDied(Unit *who) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_BROGGOK_EVENT,DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (AcidSpray_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? H_SPELL_SLIME_SPRAY : SPELL_SLIME_SPRAY); + AcidSpray_Timer = urand(4000, 12000); + }else AcidSpray_Timer -=diff; + + if (PoisonBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? H_SPELL_POISON_BOLT : SPELL_POISON_BOLT); + PoisonBolt_Timer = urand(4000, 12000); + }else PoisonBolt_Timer -=diff; + + if (PoisonSpawn_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_POISON_CLOUD); + PoisonSpawn_Timer = 20000; + }else PoisonSpawn_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_broggok_poisoncloudAI : public ScriptedAI +{ + mob_broggok_poisoncloudAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + void MoveInLineOfSight(Unit *who) { } + void AttackStart(Unit *who) { } +}; + +CreatureAI* GetAI_boss_broggok(Creature* pCreature) +{ + return new boss_broggokAI(pCreature); +} + +CreatureAI* GetAI_mob_broggok_poisoncloud(Creature* pCreature) +{ + return new mob_broggok_poisoncloudAI(pCreature); +} + +void AddSC_boss_broggok() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_broggok"; + newscript->GetAI = &GetAI_boss_broggok; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_broggok_poisoncloud"; + newscript->GetAI = &GetAI_mob_broggok_poisoncloud; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp new file mode 100644 index 0000000..383ae7f --- /dev/null +++ b/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -0,0 +1,238 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kelidan_The_Breaker +SD%Complete: 60 +SDComment: Event with channeleres vs. boss not implemented yet +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +/* ContentData +boss_kelidan_the_breaker +mob_shadowmoon_channeler +EndContentData */ + +#include "precompiled.h" +#include "blood_furnace.h" + +enum +{ + SAY_WAKE = -1542000, + SAY_ADD_AGGRO_1 = -1542001, + SAY_ADD_AGGRO_2 = -1542002, + SAY_ADD_AGGRO_3 = -1542003, + SAY_KILL_1 = -1542004, + SAY_KILL_2 = -1542005, + SAY_NOVA = -1542006, + SAY_DIE = -1542007, + + SPELL_CORRUPTION = 30938, + + SPELL_FIRE_NOVA = 33132, + H_SPELL_FIRE_NOVA = 37371, + + SPELL_SHADOW_BOLT_VOLLEY = 28599, + H_SPELL_SHADOW_BOLT_VOLLEY = 40070, + + SPELL_BURNING_NOVA = 30940, + SPELL_VORTEX = 37370 +}; + +struct MANGOS_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI +{ + boss_kelidan_the_breakerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsRegularMode; + + uint32 ShadowVolley_Timer; + uint32 BurningNova_Timer; + uint32 Firenova_Timer; + uint32 Corruption_Timer; + bool Firenova; + + void Reset() + { + ShadowVolley_Timer = 1000; + BurningNova_Timer = 15000; + Corruption_Timer = 5000; + Firenova = false; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_WAKE, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 1)) + return; + + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KELIDAN_EVENT,DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Firenova) + { + if (Firenova_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_FIRE_NOVA : H_SPELL_FIRE_NOVA); + Firenova = false; + ShadowVolley_Timer = 2000; + }else Firenova_Timer -=diff; + + return; + } + + if (ShadowVolley_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_BOLT_VOLLEY : H_SPELL_SHADOW_BOLT_VOLLEY); + ShadowVolley_Timer = urand(5000, 13000); + }else ShadowVolley_Timer -=diff; + + if (Corruption_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_CORRUPTION); + Corruption_Timer = urand(30000, 50000); + }else Corruption_Timer -=diff; + + if (BurningNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_NOVA, m_creature); + + if (!m_bIsRegularMode) + DoCastSpellIfCan(m_creature, SPELL_VORTEX); + + DoCastSpellIfCan(m_creature,SPELL_BURNING_NOVA); + + BurningNova_Timer = urand(20000, 28000); + Firenova_Timer= 5000; + Firenova = true; + }else BurningNova_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) +{ + return new boss_kelidan_the_breakerAI(pCreature); +} + +/*###### +## mob_shadowmoon_channeler +######*/ + +enum +{ + SPELL_SHADOW_BOLT = 12739, + H_SPELL_SHADOW_BOLT = 15472, + + SPELL_MARK_OF_SHADOW = 30937, + + SPELL_CHANNELING = 0 //initial spell channeling boss/each other not known +}; //when engaged all channelers must stop, trigger yell (SAY_ADD_AGGRO_*), and engage. + +struct MANGOS_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI +{ + mob_shadowmoon_channelerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 ShadowBolt_Timer; + uint32 MarkOfShadow_Timer; + + void Reset() + { + ShadowBolt_Timer = urand(1000, 2000); + MarkOfShadow_Timer = urand(5000, 7000); + } + + void Aggro(Unit* who) + { + //trigger boss to yell + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (MarkOfShadow_Timer < diff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(target,SPELL_MARK_OF_SHADOW); + MarkOfShadow_Timer = urand(15000, 20000); + }else MarkOfShadow_Timer -=diff; + + if (ShadowBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_BOLT : H_SPELL_SHADOW_BOLT); + ShadowBolt_Timer = urand(5000, 6000); + }else ShadowBolt_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) +{ + return new mob_shadowmoon_channelerAI(pCreature); +} + +void AddSC_boss_kelidan_the_breaker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_kelidan_the_breaker"; + newscript->GetAI = &GetAI_boss_kelidan_the_breaker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowmoon_channeler"; + newscript->GetAI = &GetAI_mob_shadowmoon_channeler; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp new file mode 100644 index 0000000..d8504c4 --- /dev/null +++ b/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_The_Maker +SD%Complete: 80 +SDComment: Mind control no support +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "blood_furnace.h" + +enum +{ + SAY_AGGRO_1 = -1542009, + SAY_AGGRO_2 = -1542010, + SAY_AGGRO_3 = -1542011, + SAY_KILL_1 = -1542012, + SAY_KILL_2 = -1542013, + SAY_DIE = -1542014, + + SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 + SPELL_EXPLODING_BREAKER = 30925, + H_SPELL_EXPLODING_BREAKER = 40059, + SPELL_KNOCKDOWN = 20276, + SPELL_DOMINATION = 25772 // ??? +}; + +struct MANGOS_DLL_DECL boss_the_makerAI : public ScriptedAI +{ + boss_the_makerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 AcidSpray_Timer; + uint32 ExplodingBreaker_Timer; + uint32 Domination_Timer; + uint32 Knockdown_Timer; + + void Reset() + { + AcidSpray_Timer = 15000; + ExplodingBreaker_Timer = 6000; + Domination_Timer = 20000; + Knockdown_Timer = 10000; + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_THE_MAKER_EVENT,IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_THE_MAKER_EVENT,FAIL); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_THE_MAKER_EVENT,DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (AcidSpray_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ACID_SPRAY); + AcidSpray_Timer = urand(15000, 23000); + }else AcidSpray_Timer -=diff; + + if (ExplodingBreaker_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target, m_bIsRegularMode ? H_SPELL_EXPLODING_BREAKER : SPELL_EXPLODING_BREAKER); + ExplodingBreaker_Timer = urand(4000, 12000); + }else ExplodingBreaker_Timer -=diff; + + if (Domination_Timer < diff) + { + Unit* target; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + DoCastSpellIfCan(target,SPELL_DOMINATION); + + Domination_Timer = 15000+rand()%10000; + }else Domination_Timer -=diff; + + if (Knockdown_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = urand(4000, 12000); + }else Knockdown_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) +{ + return new boss_the_makerAI(pCreature); +} + +void AddSC_boss_the_maker() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_maker"; + newscript->GetAI = &GetAI_boss_the_makerAI; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp new file mode 100644 index 0000000..cbe5c24 --- /dev/null +++ b/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -0,0 +1,256 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blood_Furnace +SD%Complete: 75 +SDComment: +SDCategory: Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "blood_furnace.h" + +#define MAX_ENCOUNTER 3 + +struct MANGOS_DLL_DECL instance_blood_furnace : public ScriptedInstance +{ + instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string strInstData; + + uint64 m_uiMakerGUID; + uint64 m_uiBroggokGUID; + uint64 m_uiKelidanGUID; + + uint64 m_uiDoorFinalExitGUID; + uint64 m_uiDoorMakerFrontGUID; + uint64 m_uiDoorMakerRearGUID; + uint64 m_uiDoorBroggokFrontGUID; + uint64 m_uiDoorBrokkokRearGUID; + uint64 m_uiDoorKelidanExitGUID; + + uint64 m_uiPrisonCell1GUID; + uint64 m_uiPrisonCell2GUID; + uint64 m_uiPrisonCell3GUID; + uint64 m_uiPrisonCell4GUID; + uint64 m_uiPrisonCell5GUID; + uint64 m_uiPrisonCell6GUID; + uint64 m_uiPrisonCell7GUID; + uint64 m_uiPrisonCell8GUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiMakerGUID = 0; + m_uiBroggokGUID = 0; + m_uiKelidanGUID = 0; + + m_uiDoorFinalExitGUID = 0; + m_uiDoorMakerFrontGUID = 0; + m_uiDoorMakerRearGUID = 0; + m_uiDoorBroggokFrontGUID = 0; + m_uiDoorBrokkokRearGUID = 0; + m_uiDoorKelidanExitGUID = 0; + + m_uiPrisonCell1GUID = 0; + m_uiPrisonCell2GUID = 0; + m_uiPrisonCell3GUID = 0; + m_uiPrisonCell4GUID = 0; + m_uiPrisonCell5GUID = 0; + m_uiPrisonCell6GUID = 0; + m_uiPrisonCell7GUID = 0; + m_uiPrisonCell8GUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 17381: m_uiMakerGUID = pCreature->GetGUID(); break; + case 17380: m_uiBroggokGUID = pCreature->GetGUID(); break; + case 17377: m_uiKelidanGUID = pCreature->GetGUID(); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch (pGo->GetEntry()) + { + case GO_DOOR_MAKER_FRONT: //the maker front door + m_uiDoorMakerFrontGUID = pGo->GetGUID(); + break; + case GO_DOOR_MAKER_REAR: //the maker rear door + m_uiDoorMakerRearGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE && pGo->GetGoState() == GO_STATE_READY) + DoUseDoorOrButton(m_uiDoorMakerRearGUID); + break; + case GO_DOOR_BROGGOK_FRONT: //broggok front door + m_uiDoorBroggokFrontGUID = pGo->GetGUID(); + break; + case GO_DOOR_BROGGOK_REAR: //broggok rear door + m_uiDoorBrokkokRearGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE && pGo->GetGoState() == GO_STATE_READY) + DoUseDoorOrButton(m_uiDoorBrokkokRearGUID); + break; + case GO_DOOR_KELIDAN_EXIT: //kelidan exit door + m_uiDoorKelidanExitGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE && pGo->GetGoState() == GO_STATE_READY) + DoUseDoorOrButton(m_uiDoorKelidanExitGUID); + break; + case GO_DOOR_FINAL_EXIT: //final exit door + m_uiDoorFinalExitGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE && pGo->GetGoState() == GO_STATE_READY) + DoUseDoorOrButton(m_uiDoorFinalExitGUID); + break; + case 181813: m_uiPrisonCell1GUID = pGo->GetGUID(); break;//the maker cell front right + case 181814: m_uiPrisonCell2GUID = pGo->GetGUID(); break;//the maker cell back right + case 181816: m_uiPrisonCell3GUID = pGo->GetGUID(); break;//the maker cell front left + case 181815: m_uiPrisonCell4GUID = pGo->GetGUID(); break;//the maker cell back left + case 181821: m_uiPrisonCell5GUID = pGo->GetGUID(); break;//broggok cell front right + case 181818: m_uiPrisonCell6GUID = pGo->GetGUID(); break;//broggok cell back right + case 181820: m_uiPrisonCell7GUID = pGo->GetGUID(); break;//broggok cell front left + case 181817: m_uiPrisonCell8GUID = pGo->GetGUID(); break;//broggok cell back left + } + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_THE_MAKER: return m_uiMakerGUID; + case DATA_BROGGOK: return m_uiBroggokGUID; + case DATA_PRISON_CELL_MAKER1: return m_uiPrisonCell1GUID; + case DATA_PRISON_CELL_MAKER2: return m_uiPrisonCell2GUID; + case DATA_PRISON_CELL_MAKER3: return m_uiPrisonCell3GUID; + case DATA_PRISON_CELL_MAKER4: return m_uiPrisonCell4GUID; + case DATA_PRISON_CELL_BROGGOK1: return m_uiPrisonCell5GUID; + case DATA_PRISON_CELL_BROGGOK2: return m_uiPrisonCell6GUID; + case DATA_PRISON_CELL_BROGGOK3: return m_uiPrisonCell7GUID; + case DATA_PRISON_CELL_BROGGOK4: return m_uiPrisonCell8GUID; + } + + return 0; + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_THE_MAKER_EVENT: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiDoorMakerFrontGUID); + if (uiData == FAIL) + DoUseDoorOrButton(m_uiDoorMakerFrontGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiDoorMakerFrontGUID); + DoUseDoorOrButton(m_uiDoorMakerRearGUID); + } + m_auiEncounter[0] = uiData; + break; + case TYPE_BROGGOK_EVENT: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiDoorBroggokFrontGUID); + if (uiData == FAIL) + DoUseDoorOrButton(m_uiDoorBroggokFrontGUID); + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiDoorBroggokFrontGUID); + DoUseDoorOrButton(m_uiDoorBrokkokRearGUID); + } + m_auiEncounter[1] = uiData; + break; + case TYPE_KELIDAN_EVENT: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiDoorKelidanExitGUID); + DoUseDoorOrButton(m_uiDoorFinalExitGUID); + } + m_auiEncounter[2] = uiData; + break; + default: + error_log("SD2: Instance Blood Furnace SetData with Type %u Data %u, but this is not implemented.",uiType,uiData); + break; + } + + if (uiData == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 uiData) + { + switch(uiData) + { + case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; + case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; + case TYPE_KELIDAN_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + const char* Save() + { + return strInstData.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) +{ + return new instance_blood_furnace(pMap); +} + +void AddSC_instance_blood_furnace() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blood_furnace"; + newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp new file mode 100644 index 0000000..71edf86 --- /dev/null +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_nazan_and_vazruden.cpp @@ -0,0 +1,290 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nazan_And_Vazruden +SD%Complete: 30 +SDComment: Encounter is not complete. TODO: re-check script when MovementInform call from core work as expected. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" +#include "hellfire_ramparts.h" + +enum +{ + SAY_INTRO = -1543017, + SAY_AGGRO1 = -1543018, + SAY_AGGRO2 = -1543019, + SAY_AGGRO3 = -1543020, + SAY_TAUNT = -1543021, + SAY_KILL1 = -1543022, + SAY_KILL2 = -1543023, + SAY_DEATH = -1543024, + EMOTE_DESCEND = -1543025, + + //vazruden + SPELL_REVENGE = 40392, + + //nazan + SPELL_FIREBALL = 30691, + SPELL_H_FIREBALL = 36920, + + SPELL_CONE_OF_FIRE = 30926, + SPELL_H_CONE_OF_FIRE = 36921, + + SPELL_H_BELLOW_ROAR = 39427, + + //misc + POINT_ID_CENTER = 100, + POINT_ID_WAITING = 101, + POINT_ID_COMBAT = 102, + + NPC_VAZRUDEN_HERALD = 17307, + NPC_NAZAN = 17536, + NPC_VAZRUDEN = 17537 +}; + +const float afCenterPos[3] = {-1399.401f, 1736.365f, 86.008f}; //moves here to drop off nazan +const float afCombatPos[3] = {-1413.848f, 1754.019f, 83.146f}; //moves here when decending + +struct MANGOS_DLL_DECL boss_vazrudenAI : public ScriptedAI +{ + boss_vazrudenAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bHealthBelow; + + void Reset() + { + m_bHealthBelow = false; + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VAZRUDEN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_KILL1 : SAY_KILL2, m_creature); + } + + void PrepareAndDescendMount() + { + if (Creature* pHerald = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_HERALD))) + { + if (pHerald->HasSplineFlag(SPLINEFLAG_WALKMODE)) + pHerald->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + + pHerald->GetMotionMaster()->MovePoint(POINT_ID_COMBAT, afCombatPos[0], afCombatPos[1], afCombatPos[2]); + + DoScriptText(EMOTE_DESCEND, pHerald); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bHealthBelow && m_creature->GetHealthPercent() <= 30.0f) + { + if (m_pInstance) + PrepareAndDescendMount(); + + m_bHealthBelow = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vazruden(Creature* pCreature) +{ + return new boss_vazrudenAI(pCreature); +} + +// Creature fly around platform by default. +// After "dropping off" Vazruden, transforms to mount (Nazan) and are then ready to fight when +// Vazruden reach 30% HP +struct MANGOS_DLL_DECL boss_vazruden_heraldAI : public ScriptedAI +{ + boss_vazruden_heraldAI(Creature* pCreature) : ScriptedAI(pCreature) + { + pCreature->SetActiveObjectState(true); + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 m_uiMovementTimer; + + void Reset() + { + if (m_creature->GetEntry() != NPC_VAZRUDEN_HERALD) + m_creature->UpdateEntry(NPC_VAZRUDEN_HERALD); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiMovementTimer = 0; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_NAZAN) != IN_PROGRESS) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (!m_pInstance) + return; + + if (uiType == WAYPOINT_MOTION_TYPE) + { + if (m_uiMovementTimer) + return; + + if (m_pInstance->GetData(TYPE_NAZAN) == SPECIAL) + { + m_creature->SetCombatStartPosition(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + m_uiMovementTimer = 1000; + } + } + + if (uiType == POINT_MOTION_TYPE) + { + if (uiPointId == POINT_ID_CENTER) + DoSplit(); + else if (uiPointId == POINT_ID_COMBAT) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_pInstance->SetData(TYPE_NAZAN, IN_PROGRESS); + } + } + } + + void DoMoveToCenter() + { + DoScriptText(SAY_INTRO, m_creature); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + } + + m_creature->GetMotionMaster()->MovePoint(POINT_ID_CENTER, afCenterPos[0], afCenterPos[1], afCenterPos[2]); + } + + void DoMoveToHold() + { + float fX, fY, fZ; + m_creature->GetCombatStartPosition(fX, fY, fZ); + + m_creature->GetMotionMaster()->MovePoint(POINT_ID_WAITING, fX, fY, fZ); + } + + void DoSplit() + { + m_creature->UpdateEntry(NPC_NAZAN); + + m_creature->SummonCreature(NPC_VAZRUDEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + + m_uiMovementTimer = 3000; + } + + void JustSummoned(Creature* pSummoned) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_VAZRUDEN, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_NAZAN, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->getVictim() && m_uiMovementTimer) + { + if (m_uiMovementTimer <= uiDiff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_VAZRUDEN) == IN_PROGRESS) + DoMoveToHold(); + else + DoMoveToCenter(); + } + m_uiMovementTimer = 0; + } else m_uiMovementTimer -= uiDiff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vazruden_herald(Creature* pCreature) +{ + return new boss_vazruden_heraldAI(pCreature); +} + +void AddSC_boss_nazan_and_vazruden() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_vazruden"; + newscript->GetAI = &GetAI_boss_vazruden; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_vazruden_herald"; + newscript->GetAI = &GetAI_boss_vazruden_herald; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp new file mode 100644 index 0000000..9c1d84a --- /dev/null +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp @@ -0,0 +1,214 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Omar_The_Unscarred +SD%Complete: 90 +SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1543009 +#define SAY_AGGRO_2 -1543010 +#define SAY_AGGRO_3 -1543011 +#define SAY_SUMMON -1543012 +#define SAY_CURSE -1543013 +#define SAY_KILL_1 -1543014 +#define SAY_DIE -1543015 +#define SAY_WIPE -1543016 + +#define SPELL_ORBITAL_STRIKE 30637 +#define SPELL_SHADOW_WHIP 30638 +#define SPELL_TREACHEROUS_AURA 30695 +#define H_SPELL_BANE_OF_TREACHERY 37566 +#define SPELL_DEMONIC_SHIELD 31901 +#define SPELL_SHADOW_BOLT 30686 +#define H_SPELL_SHADOW_BOLT 39297 +#define SPELL_SUMMON_FIENDISH_HOUND 30707 + +struct MANGOS_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI +{ + boss_omor_the_unscarredAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + + uint32 OrbitalStrike_Timer; + uint32 ShadowWhip_Timer; + uint32 Aura_Timer; + uint32 DemonicShield_Timer; + uint32 Shadowbolt_Timer; + uint32 Summon_Timer; + uint32 SummonedCount; + uint64 playerGUID; + bool CanPullBack; + + void Reset() + { + DoScriptText(SAY_WIPE, m_creature); + + OrbitalStrike_Timer = 25000; + ShadowWhip_Timer = 2000; + Aura_Timer = 10000; + DemonicShield_Timer = 1000; + Shadowbolt_Timer = 2000; + Summon_Timer = 10000; + SummonedCount = 0; + playerGUID = 0; + CanPullBack = false; + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 1)) + return; + + DoScriptText(SAY_KILL_1, m_creature); + } + + void JustSummoned(Creature* summoned) + { + DoScriptText(SAY_SUMMON, m_creature); + + if (Unit* random = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(random); + + ++SummonedCount; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //only two may be wrong, perhaps increase timer and spawn periodically instead. + if (SummonedCount < 2) + { + if (Summon_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature,SPELL_SUMMON_FIENDISH_HOUND); + Summon_Timer = urand(15000, 30000); + }else Summon_Timer -= diff; + } + + if (CanPullBack) + { + if (ShadowWhip_Timer < diff) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(playerGUID)) + { + //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) + if (pPlayer->HasMovementFlag(MOVEFLAG_FALLING)) + { + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(pPlayer,SPELL_SHADOW_WHIP); + } + } + playerGUID = 0; + ShadowWhip_Timer = 2000; + CanPullBack = false; + }else ShadowWhip_Timer -= diff; + } + else if (OrbitalStrike_Timer < diff) + { + Unit* temp = NULL; + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + temp = m_creature->getVictim(); + else temp = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + + if (temp && temp->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(temp,SPELL_ORBITAL_STRIKE); + OrbitalStrike_Timer = urand(14000, 16000); + playerGUID = temp->GetGUID(); + + if (playerGUID) + CanPullBack = true; + } + }else OrbitalStrike_Timer -= diff; + + if (m_creature->GetHealthPercent() < 20.0f) + { + if (DemonicShield_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DEMONIC_SHIELD); + DemonicShield_Timer = 15000; + }else DemonicShield_Timer -= diff; + } + + if (Aura_Timer < diff) + { + DoScriptText(SAY_CURSE, m_creature); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_TREACHEROUS_AURA : H_SPELL_BANE_OF_TREACHERY); + Aura_Timer = urand(8000, 16000); + } + }else Aura_Timer -= diff; + + if (Shadowbolt_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + if (target) + target = m_creature->getVictim(); + + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_SHADOW_BOLT : H_SPELL_SHADOW_BOLT); + Shadowbolt_Timer = urand(4000, 6500); + } + }else Shadowbolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) +{ + return new boss_omor_the_unscarredAI(pCreature); +} + +void AddSC_boss_omor_the_unscarred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_omor_the_unscarred"; + newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp new file mode 100644 index 0000000..c90b91b --- /dev/null +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -0,0 +1,164 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Watchkeeper_Gargolmar +SD%Complete: 80 +SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SAY_TAUNT -1543000 +#define SAY_HEAL -1543001 +#define SAY_SURGE -1543002 +#define SAY_AGGRO_1 -1543003 +#define SAY_AGGRO_2 -1543004 +#define SAY_AGGRO_3 -1543005 +#define SAY_KILL_1 -1543006 +#define SAY_KILL_2 -1543007 +#define SAY_DIE -1543008 + +#define SPELL_MORTAL_WOUND 30641 +#define H_SPELL_MORTAL_WOUND 36814 +#define SPELL_SURGE 34645 +#define SPELL_RETALIATION 22857 + +struct MANGOS_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI +{ + boss_watchkeeper_gargolmarAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + + uint32 Surge_Timer; + uint32 MortalWound_Timer; + uint32 Retaliation_Timer; + + bool HasTaunted; + bool YelledForHeal; + + void Reset() + { + Surge_Timer = 5000; + MortalWound_Timer = 4000; + Retaliation_Timer = 0; + + HasTaunted = false; + YelledForHeal = false; + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void MoveInLineOfSight(Unit* who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessablePlaceFor(m_creature)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_TAUNT, m_creature); + HasTaunted = true; + } + } + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (MortalWound_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_MORTAL_WOUND : H_SPELL_MORTAL_WOUND); + MortalWound_Timer = urand(5000, 13000); + }else MortalWound_Timer -= diff; + + if (Surge_Timer < diff) + { + DoScriptText(SAY_SURGE, m_creature); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(target,SPELL_SURGE); + + Surge_Timer = urand(5000, 12000); + }else Surge_Timer -= diff; + + if (m_creature->GetHealthPercent() < 20.0f) + { + if (Retaliation_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_RETALIATION); + Retaliation_Timer = 30000; + }else Retaliation_Timer -= diff; + } + + if (!YelledForHeal) + { + if (m_creature->GetHealthPercent() < 40.0f) + { + DoScriptText(SAY_HEAL, m_creature); + YelledForHeal = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) +{ + return new boss_watchkeeper_gargolmarAI(pCreature); +} + +void AddSC_boss_watchkeeper_gargolmar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_watchkeeper_gargolmar"; + newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h b/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h new file mode 100644 index 0000000..3935489 --- /dev/null +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/hellfire_ramparts.h @@ -0,0 +1,17 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RAMPARTS_H +#define DEF_RAMPARTS_H + +enum +{ + MAX_ENCOUNTER = 2, + + TYPE_VAZRUDEN = 1, + TYPE_NAZAN = 2, + DATA_HERALD = 3 +}; + +#endif diff --git a/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp new file mode 100644 index 0000000..e8ac5c7 --- /dev/null +++ b/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp @@ -0,0 +1,124 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Hellfire_Ramparts +SD%Complete: 50 +SDComment: +SDCategory: Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" +#include "hellfire_ramparts.h" + +struct MANGOS_DLL_DECL instance_ramparts : public ScriptedInstance +{ + instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 m_uiSentryCounter; + uint64 m_uiChestNGUID; + uint64 m_uiChestHGUID; + uint64 m_uiHeraldGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiSentryCounter = 0; + m_uiChestNGUID = 0; + m_uiChestHGUID = 0; + m_uiHeraldGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature) + { + if (pCreature->GetEntry() == 17307) + m_uiHeraldGUID = pCreature->GetGUID(); + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 185168: m_uiChestNGUID = pGo->GetGUID(); break; + case 185169: m_uiChestHGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("SD2: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_VAZRUDEN: + if (uiData == DONE && m_auiEncounter[1] == DONE) + DoRespawnGameObject(instance->IsRegularDifficulty() ? m_uiChestNGUID : m_uiChestHGUID, HOUR*IN_MILLISECONDS); + m_auiEncounter[0] = uiData; + break; + case TYPE_NAZAN: + if (uiData == SPECIAL) + { + ++m_uiSentryCounter; + + if (m_uiSentryCounter == 2) + m_auiEncounter[1] = uiData; + } + if (uiData == DONE && m_auiEncounter[0] == DONE) + { + DoRespawnGameObject(instance->IsRegularDifficulty() ? m_uiChestNGUID : m_uiChestHGUID, HOUR*IN_MILLISECONDS); + m_auiEncounter[1] = uiData; + } + if (uiData == IN_PROGRESS) + m_auiEncounter[1] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_VAZRUDEN) + return m_auiEncounter[0]; + + if (uiType == TYPE_NAZAN) + return m_auiEncounter[1]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + if (uiData == DATA_HERALD) + return m_uiHeraldGUID; + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_ramparts(Map* pMap) +{ + return new instance_ramparts(pMap); +} + +void AddSC_instance_ramparts() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_ramparts"; + pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; + pNewScript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp new file mode 100644 index 0000000..931397b --- /dev/null +++ b/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -0,0 +1,705 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Magtheridon +SD%Complete: 80 +SDComment: Some spell issues with target selection. +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "precompiled.h" +#include "magtheridons_lair.h" + +struct Yell +{ + int32 id; +}; + +static Yell RandomTaunt[]= +{ + {-1544000}, + {-1544001}, + {-1544002}, + {-1544003}, + {-1544004}, + {-1544005}, +}; + +enum +{ + SAY_FREED = -1544006, + SAY_AGGRO = -1544007, + SAY_BANISH = -1544008, + SAY_CHAMBER_DESTROY = -1544009, + SAY_PLAYER_KILLED = -1544010, + SAY_DEATH = -1544011, + + EMOTE_BERSERK = -1544012, + EMOTE_BLASTNOVA = -1544013, + EMOTE_BEGIN = -1544014, + EMOTE_FREED = -1544015, + + SPELL_BLASTNOVA = 30616, + SPELL_CLEAVE = 30619, + SPELL_QUAKE_TRIGGER = 30576, // must be cast with 30561 as the proc spell + SPELL_QUAKE_KNOCKBACK = 30571, + + SPELL_BLAZE_TRAP = 30542, + SPELL_DEBRIS_VISUAL = 30632, + SPELL_CAMERA_SHAKE = 36455, + SPELL_BERSERK = 27680, + + SPELL_SHADOW_CAGE_DUMMY = 30205, + SPELL_SHADOW_CAGE = 30168, + + SPELL_SHADOW_GRASP_DUMMY = 30207, + SPELL_SHADOW_GRASP = 30410, + SPELL_SHADOW_GRASP_VISUAL = 30166, + SPELL_MIND_EXHAUSTION = 44032, // Casted by the cubes when channeling ends + + SPELL_FIRE_BLAST = 37110, + + SPELL_SHADOW_BOLT_VOLLEY = 30510, + SPELL_DARK_MENDING = 30528, + SPELL_FEAR = 30530, // 39176 + SPELL_BURNING_ABYSSAL = 30511, + + NPC_MAGS_ROOM = 17516, + NPC_BURNING_ABYSS = 17454, + + // count of clickers needed to interrupt blast nova + MAX_CLICK = 5 +}; + +typedef std::map CubeMap; + +struct MANGOS_DLL_DECL mob_abyssalAI : public ScriptedAI +{ + mob_abyssalAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiTriggerId = 0; + m_uiDespawn_Timer = 60000; + Reset(); + } + + uint32 m_uiFireBlast_Timer; + uint32 m_uiDespawn_Timer; + uint32 m_uiTriggerId; + + void Reset() + { + m_uiFireBlast_Timer = 6000; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (m_uiTriggerId == 2 && pSpell->Id == SPELL_BLAZE_TARGET) + { + m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true); + m_creature->SetVisibility(VISIBILITY_OFF); + m_uiDespawn_Timer = 130000; + } + } + + void SetTrigger(uint32 uiTrigger) + { + m_uiTriggerId = uiTrigger; + m_creature->SetDisplayId(11686); + + if (m_uiTriggerId == 1) //debris + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true); + m_uiFireBlast_Timer = 5000; + m_uiDespawn_Timer = 10000; + } + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + } + + void AttackStart(Unit* pWho) + { + if (m_uiTriggerId) + return; + + ScriptedAI::AttackStart(pWho); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_uiTriggerId) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiTriggerId) + { + if (m_uiTriggerId == 1) + { + if (m_uiFireBlast_Timer < uiDiff) + { + m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true); + m_uiTriggerId = 3; + } + else + m_uiFireBlast_Timer -= uiDiff; + } + } + + if (m_uiDespawn_Timer < uiDiff) + { + m_creature->ForcedDespawn(); + return; + } + else + m_uiDespawn_Timer -= uiDiff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiFireBlast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FIRE_BLAST); + m_uiFireBlast_Timer = urand(5000, 15000); + } + else + m_uiFireBlast_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL boss_magtheridonAI : public ScriptedAI +{ + boss_magtheridonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + CubeMap Cube; + + ScriptedInstance* m_pInstance; + + uint32 m_uiRandChat_Timer; + + uint32 m_uiBerserk_Timer; + uint32 m_uiQuake_Timer; + uint32 m_uiCleave_Timer; + uint32 m_uiBlastNova_Timer; + uint32 m_uiBlaze_Timer; + uint32 m_uiPhase3_Timer; + uint32 m_uiPhase3_Count; + + bool m_bIsIntroDone; + bool m_bIsPhase3; + bool m_bNeedCheckCube; + + void Reset() + { + m_uiRandChat_Timer = 90000; + + m_uiBerserk_Timer = 1320000; + m_uiQuake_Timer = 40000; + m_uiPhase3_Timer = 5000; + m_uiPhase3_Count = 0; + m_uiBlaze_Timer = urand(10000, 30000); + m_uiBlastNova_Timer = 60000; + m_uiCleave_Timer = 15000; + + m_bIsIntroDone = false; + m_bIsPhase3 = false; + m_bNeedCheckCube = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void JustReachedHome() + { + if (m_pInstance) + { + m_pInstance->SetData(TYPE_MAGTHERIDON_EVENT, NOT_STARTED); + m_pInstance->SetData(TYPE_HALL_COLLAPSE, NOT_STARTED); + } + } + + void SetClicker(uint64 uiCubeGUID, uint64 uiClickerGUID) + { + // to avoid multiclicks from 1 cube + if (uint64 guid = Cube[uiCubeGUID]) + DebuffClicker(m_creature->GetMap()->GetPlayer(guid)); + + Cube[uiCubeGUID] = uiClickerGUID; + m_bNeedCheckCube = true; + } + + //function to interrupt channeling and debuff clicker with mind exhaused if second person clicks with same cube or after dispeling/ending shadow grasp DoT) + void DebuffClicker(Player* pClicker) + { + if (!pClicker || !pClicker->isAlive()) + return; + + pClicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP);// cannot interrupt triggered spells + pClicker->InterruptNonMeleeSpells(false); + pClicker->CastSpell(pClicker, SPELL_MIND_EXHAUSTION, true); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bIsIntroDone) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void NeedCheckCubeStatus() + { + uint32 ClickerNum = 0; + + // now checking if every clicker has debuff from manticron + // if not - apply mind exhaustion and delete from clicker's list + for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) + { + Player* pClicker = m_creature->GetMap()->GetPlayer(i->second); + + if (!pClicker || !pClicker->HasAura(SPELL_SHADOW_GRASP, EFFECT_INDEX_1)) + { + DebuffClicker(pClicker); + i->second = 0; + } + else + ++ClickerNum; + } + + // if 5 clickers from other cubes apply shadow cage + if (ClickerNum >= MAX_CLICK && !m_creature->HasAura(SPELL_SHADOW_CAGE, EFFECT_INDEX_0) && m_creature->HasAura(SPELL_BLASTNOVA, EFFECT_INDEX_0)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true); + } + else + { + if (ClickerNum < MAX_CLICK && m_creature->HasAura(SPELL_SHADOW_CAGE, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); + } + + if (!ClickerNum) + m_bNeedCheckCube = false; + } + + void IntroDone() + { + if (!m_pInstance) + return; + + if (m_pInstance->GetData(TYPE_MAGTHERIDON_EVENT) == NOT_STARTED) + return; + + if (m_pInstance->GetData(TYPE_MAGTHERIDON_EVENT) == DONE) + return; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_DUMMY); + m_creature->clearUnitState(UNIT_STAT_STUNNED); + + DoScriptText(EMOTE_FREED, m_creature); + DoScriptText(SAY_FREED, m_creature); + + m_bIsIntroDone = true; + } + + void Aggro(Unit* pWho) + { + m_creature->SetInCombatWithZone(); + DoScriptText(SAY_AGGRO, m_creature); + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_SHADOW_GRASP_DUMMY) + { + m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_DUMMY, false); + m_creature->addUnitState(UNIT_STAT_STUNNED); + } + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_PLAYER_KILLED, m_creature); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_MAGTHERIDON_EVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (!m_bIsIntroDone) + { + IntroDone(); + return; + } + + if (m_uiRandChat_Timer < uiDiff) + { + DoScriptText(RandomTaunt[rand()%6].id, m_creature); + m_uiRandChat_Timer = 90000; + } + else + m_uiRandChat_Timer -= uiDiff; + + return; + } + + if (m_bNeedCheckCube) + NeedCheckCubeStatus(); + + if (m_uiBerserk_Timer < uiDiff) + { + DoScriptText(EMOTE_BERSERK, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + m_uiBerserk_Timer = 60000; + } + else + m_uiBerserk_Timer -= uiDiff; + + //Cleave_Timer + if (m_uiCleave_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 10000; + } + else + m_uiCleave_Timer -= uiDiff; + + if (m_uiQuake_Timer < uiDiff) + { + // to avoid blastnova interruption + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + int32 i = SPELL_QUAKE_KNOCKBACK; + m_creature->CastCustomSpell(m_creature, SPELL_QUAKE_TRIGGER, &i, 0, 0, false); + m_uiQuake_Timer = 50000; + } + } + else + m_uiQuake_Timer -= uiDiff; + + if (m_uiBlastNova_Timer < uiDiff) + { + // to avoid earthquake interruption + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) + { + DoScriptText(EMOTE_BLASTNOVA, m_creature); + DoCastSpellIfCan(m_creature, SPELL_BLASTNOVA); + m_uiBlastNova_Timer = 60000; + } + } + else + m_uiBlastNova_Timer -= uiDiff; + + if (m_uiBlaze_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + float x, y, z; + pTarget->GetPosition(x, y, z); + + if (Creature* pSummon = m_creature->SummonCreature(NPC_BURNING_ABYSS, x, y, z, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + { + if (mob_abyssalAI* pAbyssAI = dynamic_cast(pSummon->AI())) + pAbyssAI->SetTrigger(2); + + m_creature->CastSpell(pSummon, SPELL_BLAZE_TARGET, true); + pSummon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + + m_uiBlaze_Timer = urand(20000, 40000); + } + else + m_uiBlaze_Timer -= uiDiff; + + if (!m_bIsPhase3 && m_creature->GetHealthPercent() < 30.0f + && !m_creature->IsNonMeleeSpellCasted(false) // blast nova + && !m_creature->hasUnitState(UNIT_STAT_STUNNED))// shadow cage and earthquake + { + m_bIsPhase3 = true; + DoScriptText(SAY_CHAMBER_DESTROY, m_creature); + } + + if (m_bIsPhase3) + { + if (m_uiPhase3_Timer < uiDiff) + { + switch(m_uiPhase3_Count) + { + case 0: + m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true); + ++m_uiPhase3_Count; + m_uiPhase3_Timer = 2000; + break; + case 1: + if (m_pInstance) + m_pInstance->SetData(TYPE_HALL_COLLAPSE, IN_PROGRESS); + ++m_uiPhase3_Count; + m_uiPhase3_Timer = 8000; + break; + case 2: + m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true); + ++m_uiPhase3_Count; + m_uiPhase3_Timer = 15000; + break; + case 3: + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + float x, y, z; + pTarget->GetPosition(x, y, z); + + if (Creature* pSummon = m_creature->SummonCreature(NPC_BURNING_ABYSS, x, y, z, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + { + if (mob_abyssalAI* pAbyssAI = dynamic_cast(pSummon->AI())) + pAbyssAI->SetTrigger(1); + } + + m_uiPhase3_Timer = 15000; + } + break; + } + } + else + m_uiPhase3_Timer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI +{ + mob_hellfire_channelerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiShadowBoltVolley_Timer; + uint32 m_uiDarkMending_Timer; + uint32 m_uiFear_Timer; + uint32 m_uiInfernal_Timer; + + bool m_bIsInfernalSpawned; + + void Reset() + { + m_uiShadowBoltVolley_Timer = urand(8000, 10000); + m_uiDarkMending_Timer = 10000; + m_uiFear_Timer = urand(15000, 20000); + m_uiInfernal_Timer = urand(10000, 50000); + + m_bIsInfernalSpawned = false; + } + + void Aggro(Unit* pWho) + { + if (!m_pInstance) + return; + + m_creature->InterruptNonMeleeSpells(false); + + if (Creature* pMagtheridon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_MAGTHERIDON))) + { + if (!pMagtheridon->isAlive()) + return; + + if (m_pInstance->GetData(TYPE_CHANNELER_EVENT) == NOT_STARTED) + DoScriptText(EMOTE_BEGIN, pMagtheridon); + } + + m_pInstance->SetData(TYPE_CHANNELER_EVENT, IN_PROGRESS); + + m_creature->SetInCombatWithZone(); + } + + void JustSummoned(Creature* pSummoned) + { + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(m_creature->getVictim()); + } + + void MoveInLineOfSight(Unit* pWho) + { + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + m_pInstance->SetData(TYPE_CHANNELER_EVENT, DONE); + + pKiller->CastSpell(pKiller, SPELL_SOUL_TRANSFER, false); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_CHANNELER_EVENT, NOT_STARTED); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (!m_creature->IsNonMeleeSpellCasted(false) && !m_creature->IsInEvadeMode()) + DoCastSpellIfCan(m_creature, SPELL_SHADOW_GRASP_DUMMY); + + return; + } + + //Shadow bolt volley + if (m_uiShadowBoltVolley_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHADOW_BOLT_VOLLEY); + m_uiShadowBoltVolley_Timer = urand(10000, 20000); + } + else + m_uiShadowBoltVolley_Timer -= uiDiff; + + //Dark Mending + if (m_uiDarkMending_Timer < uiDiff) + { + if (m_creature->GetHealthPercent() < 50.0f) + { + //Cast on ourselves if we are lower then lowest hp friendly unit + /*if (pLowestHPTarget && LowestHP < m_creature->GetHealth()) + DoCastSpellIfCan(pLowestHPTarget, SPELL_DARK_MENDING); + else*/ + DoCastSpellIfCan(m_creature, SPELL_DARK_MENDING); + } + + m_uiDarkMending_Timer = urand(10000, 20000); + } + else + m_uiDarkMending_Timer -= uiDiff; + + //Fear + if (m_uiFear_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + DoCastSpellIfCan(pTarget, SPELL_FEAR); + + m_uiFear_Timer = urand(25000, 40000); + } + else + m_uiFear_Timer -= uiDiff; + + //Infernal spawning + if (!m_bIsInfernalSpawned && m_uiInfernal_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + m_creature->CastSpell(pTarget, SPELL_BURNING_ABYSSAL, true); + + m_bIsInfernalSpawned = true; + } + else + m_uiInfernal_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Manticron Cube +bool GOHello_go_manticron_cube(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) + { + if (pInstance->GetData(TYPE_MAGTHERIDON_EVENT) != IN_PROGRESS) + return true; + + if (Creature* pMagtheridon = pInstance->instance->GetCreature(pInstance->GetData64(DATA_MAGTHERIDON))) + { + if (!pMagtheridon->isAlive()) + return true; + + // if exhausted or already channeling return + if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION, EFFECT_INDEX_0) || pPlayer->HasAura(SPELL_SHADOW_GRASP, EFFECT_INDEX_1)) + return true; + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); + + if (boss_magtheridonAI* pMagAI = dynamic_cast(pMagtheridon->AI())) + pMagAI->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); + } + } + + return false; +} + +CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) +{ + return new boss_magtheridonAI(pCreature); +} + +CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) +{ + return new mob_hellfire_channelerAI(pCreature); +} + +CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) +{ + return new mob_abyssalAI(pCreature); +} + +void AddSC_boss_magtheridon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_magtheridon"; + newscript->GetAI = &GetAI_boss_magtheridon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_hellfire_channeler"; + newscript->GetAI = &GetAI_mob_hellfire_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_manticron_cube"; + newscript->pGOHello = &GOHello_go_manticron_cube; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_abyssal"; + newscript->GetAI = &GetAI_mob_abyssalAI; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp new file mode 100644 index 0000000..889f0d0 --- /dev/null +++ b/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -0,0 +1,288 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Magtheridons_Lair +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "precompiled.h" +#include "magtheridons_lair.h" + +struct MANGOS_DLL_DECL instance_magtheridons_lair : public ScriptedInstance +{ + instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) { Initialize(); } + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiMagtheridonGUID; + std::set ChannelerGUID; + uint64 m_uiDoorGUID; + std::set ColumnGUID; + + uint32 m_uiCageTimer; + uint32 m_uiRespawnTimer; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ChannelerGUID.clear(); + ColumnGUID.clear(); + + m_uiMagtheridonGUID = 0; + m_uiDoorGUID = 0; + + m_uiCageTimer = 0; + m_uiRespawnTimer = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case NPC_MAGTHERION: m_uiMagtheridonGUID = pCreature->GetGUID(); break; + case NPC_CHANNELER: ChannelerGUID.insert(pCreature->GetGUID()); break; + } + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case 181713: + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + case 183847: //event door + m_uiDoorGUID = pGo->GetGUID(); + break; + case 184653: // hall + case 184634: // six columns + case 184635: + case 184636: + case 184637: + case 184638: + case 184639: + ColumnGUID.insert(pGo->GetGUID()); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_MAGTHERIDON_EVENT: + m_auiEncounter[0] = uiData; + if (uiData == NOT_STARTED) + m_uiRespawnTimer = 10000; + if (uiData != IN_PROGRESS) + { + if (GameObject* pDoor = instance->GetGameObject(m_uiDoorGUID)) + pDoor->SetGoState(GO_STATE_ACTIVE); + } + break; + case TYPE_CHANNELER_EVENT: + switch(uiData) + { + case NOT_STARTED: // Reset all channelers once one is reset. + if (m_auiEncounter[1] != NOT_STARTED) + { + m_auiEncounter[1] = NOT_STARTED; + + if (ChannelerGUID.empty()) + { + debug_log("SD2: Instance Magtheridon: Channeler GUID list are empty."); + break; + } + + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature* pChanneler = instance->GetCreature(*i)) + { + if (pChanneler->isAlive()) + pChanneler->AI()->EnterEvadeMode(); + else + pChanneler->Respawn(); + } + } + + m_uiCageTimer = 0; + + if (GameObject* pDoor = instance->GetGameObject(m_uiDoorGUID)) + pDoor->SetGoState(GO_STATE_ACTIVE); + } + break; + case IN_PROGRESS: // Event start. + if (m_auiEncounter[1] != IN_PROGRESS) + { + m_auiEncounter[1] = IN_PROGRESS; + + // Let all five channelers aggro. + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature* pChanneler = instance->GetCreature(*i); + + if (pChanneler && pChanneler->isAlive()) + AttackNearestTarget(pChanneler); + } + + // Magtheridon breaks free after two minutes. + Creature* pMagtheridon = instance->GetCreature(m_uiMagtheridonGUID); + + if (pMagtheridon && pMagtheridon->isAlive()) + m_uiCageTimer = 120000; + + if (GameObject* pDoor = instance->GetGameObject(m_uiDoorGUID)) + pDoor->SetGoState(GO_STATE_READY); + } + break; + case DONE: // Add buff and check if all channelers are dead. + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature* pChanneler = instance->GetCreature(*i); + + if (pChanneler && pChanneler->isAlive()) + { + //Channeler->InterruptNonMeleeSpells(false); + //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, false); + uiData = IN_PROGRESS; + break; + } + } + break; + } + m_auiEncounter[1] = uiData; + break; + case TYPE_HALL_COLLAPSE: + // IN_PROGRESS - collapse / NOT_STARTED - reset + for(std::set::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) + { + DoUseDoorOrButton(*i); + } + break; + } + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_MAGTHERIDON_EVENT) + return m_auiEncounter[0]; + if (uiType == TYPE_CHANNELER_EVENT) + return m_auiEncounter[1]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + if (uiData == DATA_MAGTHERIDON) + return m_uiMagtheridonGUID; + + return 0; + } + + void AttackNearestTarget(Creature* pCreature) + { + float minRange = VISIBLE_RANGE; + float range; + Player* target = NULL; + + Map::PlayerList const& players = instance->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* i_pl = itr->getSource()) + { + if (i_pl->isTargetableForAttack()) + { + range = i_pl->GetDistance(pCreature); + if (range < minRange) + { + minRange = range; + target = i_pl; + } + } + } + } + + if (!target) + { + debug_log("SD2: Instance Magtheridon: AttackNearestTarget failed. No player."); + return; + } + pCreature->AI()->AttackStart(target); + } + + void Update(uint32 uiDiff) + { + if (m_uiCageTimer) + { + if (m_uiCageTimer <= uiDiff) + { + SetData(TYPE_MAGTHERIDON_EVENT, IN_PROGRESS); + m_uiCageTimer = 0; + } + else + m_uiCageTimer -= uiDiff; + } + + if (m_uiRespawnTimer) + { + if (m_uiRespawnTimer <= uiDiff) + { + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature* pChanneler = instance->GetCreature(*i)) + { + if (pChanneler->isAlive()) + pChanneler->AI()->EnterEvadeMode(); + else + pChanneler->Respawn(); + } + } + + m_uiRespawnTimer = 0; + } + else + m_uiRespawnTimer -= uiDiff; + } + } +}; + +InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) +{ + return new instance_magtheridons_lair(pMap); +} + +void AddSC_instance_magtheridons_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_magtheridons_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h b/scripts/outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h new file mode 100644 index 0000000..31bd881 --- /dev/null +++ b/scripts/outland/hellfire_citadel/magtheridons_lair/magtheridons_lair.h @@ -0,0 +1,28 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MAGTHERIDONS_LAIR_H +#define DEF_MAGTHERIDONS_LAIR_H + +enum +{ + MAX_ENCOUNTER = 2, + + TYPE_MAGTHERIDON_EVENT = 1, + TYPE_CHANNELER_EVENT = 2, + DATA_MAGTHERIDON = 3, + TYPE_HALL_COLLAPSE = 4, + + DATA_CHANNELER = 5, + + NPC_MAGTHERION = 17257, + NPC_CHANNELER = 17256, + + SPELL_SOUL_TRANSFER = 30531, + SPELL_BLAZE_TARGET = 30541, + SPELL_DEBRIS_DAMAGE = 30631, + SPELL_DEBRIS_KNOCKDOWN = 36449 +}; + +#endif diff --git a/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp new file mode 100644 index 0000000..12c38ec --- /dev/null +++ b/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp @@ -0,0 +1,425 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grand_Warlock_Nethekurse +SD%Complete: 75 +SDComment: encounter not fully completed. missing part where boss kill minions. +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_grand_warlock_nethekurse +mob_fel_orc_convert +mob_lesser_shadow_fissure +EndContentData */ + +#include "precompiled.h" +#include "shattered_halls.h" + +struct Say +{ + int32 id; +}; + +static Say PeonAttacked[]= +{ + {-1540001}, + {-1540002}, + {-1540003}, + {-1540004}, +}; + +static Say PeonDies[]= +{ + {-1540005}, + {-1540006}, + {-1540007}, + {-1540008}, +}; + +enum +{ + SAY_INTRO = -1540000, + SAY_TAUNT_1 = -1540009, + SAY_TAUNT_2 = -1540010, + SAY_TAUNT_3 = -1540011, + SAY_AGGRO_1 = -1540012, + SAY_AGGRO_2 = -1540013, + SAY_AGGRO_3 = -1540014, + SAY_SLAY_1 = -1540015, + SAY_SLAY_2 = -1540016, + SAY_DIE = -1540017, + + SPELL_DEATH_COIL = 30500, + SPELL_DARK_SPIN = 30502, // core bug spell attack caster :D + SPELL_SHADOW_FISSURE = 30496, // Summon the ShadowFissure NPC + + SPELL_SHADOW_CLEAVE = 30495, + H_SPELL_SHADOW_SLAM = 35953, + + SPELL_HEMORRHAGE = 30478, + + SPELL_CONSUMPTION = 30497, + SPELL_TEMPORARY_VISUAL = 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should +}; + +struct MANGOS_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI +{ + boss_grand_warlock_nethekurseAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool m_bIntroOnce; + bool m_bIsIntroEvent; + bool m_bIsMainEvent; + bool m_bSpinOnce; + //bool m_bHasTaunted; + bool m_bPhase; + + uint32 m_uiPeonEngagedCount; + uint32 m_uiPeonKilledCount; + + uint32 m_uiIntroEventTimer; + uint32 m_uiDeathCoilTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiCleaveTimer; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_bIsIntroEvent = false; + m_bIntroOnce = false; + m_bIsMainEvent = false; + //m_bHasTaunted = false; + m_bSpinOnce = false; + m_bPhase = false; + + m_uiPeonEngagedCount = 0; + m_uiPeonKilledCount = 0; + + m_uiIntroEventTimer = 90000; // how long before getting bored and kills his minions? + m_uiDeathCoilTimer = 20000; + m_uiShadowFissureTimer = 8000; + m_uiCleaveTimer = 5000; + } + + void DoYellForPeonAggro() + { + if (m_uiPeonEngagedCount >= 4) + return; + + DoScriptText(PeonAttacked[m_uiPeonEngagedCount].id, m_creature); + ++m_uiPeonEngagedCount; + } + + void DoYellForPeonDeath() + { + if (m_uiPeonKilledCount >= 4) + return; + + DoScriptText(PeonDies[m_uiPeonKilledCount].id, m_creature); + ++m_uiPeonKilledCount; + + if (m_uiPeonKilledCount == 4) + { + m_bIsIntroEvent = false; + m_bIsMainEvent = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + void DoTauntPeons() + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_TAUNT_1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT_2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT_3, m_creature); break; + } + + // TODO: kill the peons first + m_bIsIntroEvent = false; + m_uiPeonEngagedCount = 4; + m_uiPeonKilledCount = 4; + m_bIsMainEvent = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackStart(Unit* pWho) + { + if (m_bIsIntroEvent || !m_bIsMainEvent) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_bPhase) + DoStartNoMovement(pWho); + else + DoStartMovement(pWho); + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_bIntroOnce && m_creature->IsWithinDistInMap(pWho, 50.0f)) + { + if (pWho->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(SAY_INTRO, m_creature); + m_bIntroOnce = true; + m_bIsIntroEvent = true; + + if (m_pInstance) + m_pInstance->SetData(TYPE_NETHEKURSE, IN_PROGRESS); + } + + if (m_bIsIntroEvent || !m_bIsMainEvent) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void Aggro(Unit* pWho) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->setFaction(16); + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pSummoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + // triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? + pSummoned->CastSpell(pSummoned, SPELL_TEMPORARY_VISUAL, true); + pSummoned->CastSpell(pSummoned, SPELL_CONSUMPTION, false, 0, 0, m_creature->GetGUID()); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DIE, m_creature); + + if (!m_pInstance) + return; + + m_pInstance->SetData(TYPE_NETHEKURSE, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bIsIntroEvent) + { + if (!m_pInstance) + return; + + if (m_pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + { + if (m_uiIntroEventTimer < uiDiff) + DoTauntPeons(); + else + m_uiIntroEventTimer -= uiDiff; + } + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!m_bIsMainEvent) + return; + + if (m_bPhase) + { + if (!m_bSpinOnce) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_DARK_SPIN); + m_bSpinOnce = true; + } + + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_SHADOW_CLEAVE : H_SPELL_SHADOW_SLAM); + m_uiCleaveTimer = urand(6000, 8500); + } + else + m_uiCleaveTimer -= uiDiff; + } + else + { + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_SHADOW_FISSURE); + m_uiShadowFissureTimer = urand(7500, 15000); + } + else + m_uiShadowFissureTimer -= uiDiff; + + if (m_uiDeathCoilTimer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_DEATH_COIL); + m_uiDeathCoilTimer = urand(15000, 20000); + } + else + m_uiDeathCoilTimer -= uiDiff; + + if (m_creature->GetHealthPercent() <= 20.0f) + m_bPhase = true; + + DoMeleeAttackIfReady(); + } + } +}; + +struct MANGOS_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI +{ + mob_fel_orc_convertAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + uint32 m_uiHemorrhageTimer; + + void Reset() + { + m_creature->SetNoCallAssistance(true); // we don't want any assistance (WE R HEROZ!) + m_uiHemorrhageTimer = 3000; + } + + void MoveInLineOfSight(Unit* pWho) + { + return; + } + + void Aggro(Unit* pWho) + { + if (m_pInstance) + { + Creature* pKurse = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_NETHEKURSE)); + if (pKurse && m_creature->IsWithinDist(pKurse, 45.0f)) + { + if (boss_grand_warlock_nethekurseAI* pKurseAI = dynamic_cast(pKurse->AI())) + pKurseAI->DoYellForPeonAggro(); + + if (m_pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + return; + else + m_pInstance->SetData(TYPE_NETHEKURSE, IN_PROGRESS); + } + } + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) + return; + + if (Creature* pKurse = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_NETHEKURSE))) + { + if (boss_grand_warlock_nethekurseAI* pKurseAI = dynamic_cast(pKurse->AI())) + pKurseAI->DoYellForPeonAggro(); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiHemorrhageTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_HEMORRHAGE); + m_uiHemorrhageTimer = 15000; + } + else + m_uiHemorrhageTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +// NOTE: this creature are also summoned by other spells, for different creatures +struct MANGOS_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI +{ + mob_lesser_shadow_fissureAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + void MoveInLineOfSight(Unit* pWho) { } + void AttackStart(Unit* pWho) { } +}; + +CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) +{ + return new boss_grand_warlock_nethekurseAI(pCreature); +} + +CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) +{ + return new mob_fel_orc_convertAI(pCreature); +} + +CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) +{ + return new mob_lesser_shadow_fissureAI(pCreature); +} + +void AddSC_boss_grand_warlock_nethekurse() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "boss_grand_warlock_nethekurse"; + pNewScript->GetAI = &GetAI_boss_grand_warlock_nethekurse; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_fel_orc_convert"; + pNewScript->GetAI = &GetAI_mob_fel_orc_convert; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "mob_lesser_shadow_fissure"; + pNewScript->GetAI = &GetAI_mob_lesser_shadow_fissure; + pNewScript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp new file mode 100644 index 0000000..be13569 --- /dev/null +++ b/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp @@ -0,0 +1,408 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warbringer_Omrogg +SD%Complete: 85 +SDComment: Heroic enabled. Spell timing may need additional tweaks +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +mob_omrogg_heads +boss_warbringer_omrogg +EndContentData */ + +#include "precompiled.h" +#include "shattered_halls.h" + +enum +{ + YELL_DIE_L = -1540039, + YELL_DIE_R = -1540040, + EMOTE_ENRAGE = -1540041, + + SPELL_BLAST_WAVE = 30600, + SPELL_FEAR = 30584, + SPELL_THUNDERCLAP = 30633, + + SPELL_BURNING_MAUL = 30598, + H_SPELL_BURNING_MAUL = 36056, + + NPC_LEFT_HEAD = 19523, + NPC_RIGHT_HEAD = 19524 +}; + +struct Yell +{ + int32 id; + uint32 creature; +}; + +static Yell GoCombat[]= +{ + {-1540018, NPC_LEFT_HEAD}, + {-1540019, NPC_LEFT_HEAD}, + {-1540020, NPC_LEFT_HEAD}, +}; +static Yell GoCombatDelay[]= +{ + {-1540021, NPC_RIGHT_HEAD}, + {-1540022, NPC_RIGHT_HEAD}, + {-1540023, NPC_RIGHT_HEAD}, +}; + +static Yell Threat[]= +{ + {-1540024, NPC_LEFT_HEAD}, + {-1540025, NPC_RIGHT_HEAD}, + {-1540026, NPC_LEFT_HEAD}, + {-1540027, NPC_LEFT_HEAD}, +}; +static Yell ThreatDelay1[]= +{ + {-1540028, NPC_RIGHT_HEAD}, + {-1540029, NPC_LEFT_HEAD}, + {-1540030, NPC_RIGHT_HEAD}, + {-1540031, NPC_RIGHT_HEAD}, +}; +static Yell ThreatDelay2[]= +{ + {-1540032, NPC_LEFT_HEAD}, + {-1540033, NPC_RIGHT_HEAD}, + {-1540034, NPC_LEFT_HEAD}, + {-1540035, NPC_LEFT_HEAD}, +}; + +static Yell Killing[]= +{ + {-1540036, NPC_LEFT_HEAD}, + {-1540037, NPC_RIGHT_HEAD}, +}; +static Yell KillingDelay[]= +{ + {-1540038, NPC_RIGHT_HEAD}, + {-1000000, NPC_LEFT_HEAD}, +}; + +struct MANGOS_DLL_DECL mob_omrogg_headsAI : public ScriptedAI +{ + mob_omrogg_headsAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 m_uiDeath_Timer; + bool m_bDeathYell; + + void Reset() + { + m_uiDeath_Timer = 4000; + m_bDeathYell = false; + } + + void DoDeathYell() + { + m_bDeathYell = true; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_bDeathYell) + return; + + if (m_uiDeath_Timer < uiDiff) + { + DoScriptText(YELL_DIE_R, m_creature); + m_uiDeath_Timer = false; + m_creature->SetDeathState(JUST_DIED); + }else m_uiDeath_Timer -= uiDiff; + } +}; + +struct MANGOS_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI +{ + boss_warbringer_omroggAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiLeftHeadGUID = 0; + m_uiRightHeadGUID = 0; + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint64 m_uiLeftHeadGUID; + uint64 m_uiRightHeadGUID; + + int m_iAggro; + int m_iThreat; + int m_iKilling; + + bool m_bAggroYell; + bool m_bThreatYell; + bool m_bThreatYell2; + bool m_bKillingYell; + + uint32 m_uiDelay_Timer; + uint32 m_uiBlastWave_Timer; + uint32 m_uiBlastCount; + uint32 m_uiFear_Timer; + uint32 m_uiBurningMaul_Timer; + uint32 m_uiThunderClap_Timer; + uint32 m_uiResetThreat_Timer; + + void Reset() + { + if (Creature* pLeftHead = m_creature->GetMap()->GetCreature(m_uiLeftHeadGUID)) + { + pLeftHead->SetDeathState(JUST_DIED); + m_uiLeftHeadGUID = 0; + } + + if (Creature* pRightHead = m_creature->GetMap()->GetCreature(m_uiRightHeadGUID)) + { + pRightHead->SetDeathState(JUST_DIED); + m_uiRightHeadGUID = 0; + } + + m_bAggroYell = false; + m_bThreatYell = false; + m_bThreatYell2 = false; + m_bKillingYell = false; + + m_uiDelay_Timer = 4000; + m_uiBlastWave_Timer = 0; + m_uiBlastCount = 0; + m_uiFear_Timer = 8000; + m_uiBurningMaul_Timer = 25000; + m_uiThunderClap_Timer = 15000; + m_uiResetThreat_Timer = 30000; + + if (m_pInstance) + m_pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. + } + + void DoYellForThreat() + { + Creature* pLeftHead = m_creature->GetMap()->GetCreature(m_uiLeftHeadGUID); + Creature* pRightHead = m_creature->GetMap()->GetCreature(m_uiRightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + m_iThreat = irand(0, 3); + + Unit* pSource = (pLeftHead->GetEntry() == Threat[m_iThreat].creature ? pLeftHead : pRightHead); + + DoScriptText(Threat[m_iThreat].id, pSource); + + m_uiDelay_Timer = 3500; + m_bThreatYell = true; + } + + void Aggro(Unit* pWho) + { + m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + + if (Creature* pLeftHead = m_creature->GetMap()->GetCreature(m_uiLeftHeadGUID)) + { + m_iAggro = irand(0, 2); + + DoScriptText(GoCombat[m_iAggro].id, pLeftHead); + + m_uiDelay_Timer = 3500; + m_bAggroYell = true; + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_LEFT_HEAD) + m_uiLeftHeadGUID = pSummoned->GetGUID(); + + if (pSummoned->GetEntry() == NPC_RIGHT_HEAD) + m_uiRightHeadGUID = pSummoned->GetGUID(); + + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + pSummoned->SetVisibility(VISIBILITY_OFF); + } + + void KilledUnit(Unit* pVictim) + { + Creature* pLeftHead = m_creature->GetMap()->GetCreature(m_uiLeftHeadGUID); + Creature* pRightHead = m_creature->GetMap()->GetCreature(m_uiRightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + m_iKilling = irand(0, 1); + + Creature* pSource = (pLeftHead->GetEntry() == Killing[m_iKilling].creature ? pLeftHead : pRightHead); + + switch(m_iKilling) + { + case 0: + DoScriptText(Killing[m_iKilling].id, pSource); + m_uiDelay_Timer = 3500; + m_bKillingYell = true; + break; + case 1: + DoScriptText(Killing[m_iKilling].id, pSource); + m_bKillingYell = false; + break; + } + } + + void JustDied(Unit* pKiller) + { + Creature* pLeftHead = m_creature->GetMap()->GetCreature(m_uiLeftHeadGUID); + Creature* pRightHead = m_creature->GetMap()->GetCreature(m_uiRightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + DoScriptText(YELL_DIE_L, pLeftHead); + pLeftHead->SetDeathState(JUST_DIED); + + if (mob_omrogg_headsAI* pHeadAI = dynamic_cast(pRightHead->AI())) + pHeadAI->DoDeathYell(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_OMROGG, DONE); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiDelay_Timer < uiDiff) + { + m_uiDelay_Timer = 3500; + + Creature* pLeftHead = m_creature->GetMap()->GetCreature(m_uiLeftHeadGUID); + Creature* pRightHead = m_creature->GetMap()->GetCreature(m_uiRightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + if (m_bAggroYell) + { + DoScriptText(GoCombatDelay[m_iAggro].id, pRightHead); + m_bAggroYell = false; + } + + if (m_bThreatYell2) + { + Creature* pSource = (pLeftHead->GetEntry() == ThreatDelay2[m_iThreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay2[m_iThreat].id, pSource); + m_bThreatYell2 = false; + } + + if (m_bThreatYell) + { + Creature* pSource = (pLeftHead->GetEntry() == ThreatDelay1[m_iThreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay1[m_iThreat].id, pSource); + m_bThreatYell = false; + m_bThreatYell2 = true; + } + + if (m_bKillingYell) + { + Creature* pSource = (pLeftHead->GetEntry() == KillingDelay[m_iKilling].creature ? pLeftHead : pRightHead); + + DoScriptText(KillingDelay[m_iKilling].id, pSource); + m_bKillingYell = false; + } + }else m_uiDelay_Timer -= uiDiff; + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiBlastCount && m_uiBlastWave_Timer <= uiDiff) + { + DoCastSpellIfCan(m_creature,SPELL_BLAST_WAVE); + m_uiBlastWave_Timer = 5000; + ++m_uiBlastCount; + + if (m_uiBlastCount == 3) + m_uiBlastCount = 0; + }else m_uiBlastWave_Timer -= uiDiff; + + if (m_uiBurningMaul_Timer < uiDiff) + { + DoScriptText(EMOTE_ENRAGE, m_creature); + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_BURNING_MAUL : H_SPELL_BURNING_MAUL); + m_uiBurningMaul_Timer = 40000; + m_uiBlastWave_Timer = 16000; + m_uiBlastCount = 1; + }else m_uiBurningMaul_Timer -= uiDiff; + + if (m_uiResetThreat_Timer < uiDiff) + { + if (Unit *target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + { + DoYellForThreat(); + DoResetThreat(); + m_creature->AddThreat(target); + } + m_uiResetThreat_Timer = urand(25000, 40000); + }else m_uiResetThreat_Timer -= uiDiff; + + if (m_uiFear_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature,SPELL_FEAR); + m_uiFear_Timer = urand(15000, 35000); + }else m_uiFear_Timer -= uiDiff; + + if (m_uiThunderClap_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature,SPELL_THUNDERCLAP); + m_uiThunderClap_Timer = urand(15000, 30000); + }else m_uiThunderClap_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) +{ + return new boss_warbringer_omroggAI(pCreature); +} + +CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) +{ + return new mob_omrogg_headsAI(pCreature); +} + +void AddSC_boss_warbringer_omrogg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_warbringer_omrogg"; + newscript->GetAI = &GetAI_boss_warbringer_omrogg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_omrogg_heads"; + newscript->GetAI = &GetAI_mob_omrogg_heads; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp new file mode 100644 index 0000000..0464852 --- /dev/null +++ b/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -0,0 +1,296 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warchief_Kargath_Bladefist +SD%Complete: 90 +SDComment: +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_warchief_kargath_bladefist +EndContentData */ + +#include "precompiled.h" + +#define SAY_AGGRO1 -1540042 +#define SAY_AGGRO2 -1540043 +#define SAY_AGGRO3 -1540044 +#define SAY_SLAY1 -1540045 +#define SAY_SLAY2 -1540046 +#define SAY_DEATH -1540047 + +#define SPELL_BLADE_DANCE 30739 +#define H_SPELL_CHARGE 25821 + +#define TARGET_NUM 5 + +#define MOB_SHATTERED_ASSASSIN 17695 +#define MOB_HEARTHEN_GUARD 17621 +#define MOB_SHARPSHOOTER_GUARD 17622 +#define MOB_REAVER_GUARD 17623 + +float AssassEntrance[3] = {275.136f, -84.29f, 2.3f}; // y -8 +float AssassExit[3] = {184.233f, -84.29f, 2.3f}; // y -8 +float AddsEntrance[3] = {306.036f, -84.29f, 1.93f}; + +struct MANGOS_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI +{ + boss_warchief_kargath_bladefistAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + std::vector adds; + std::vector assassins; + + uint32 Charge_timer; + uint32 Blade_Dance_Timer; + uint32 Summon_Assistant_Timer; + uint32 resetcheck_timer; + uint32 Wait_Timer; + + uint32 Assassins_Timer; + + uint32 summoned; + bool InBlade; + + uint32 target_num; + + void Reset() + { + removeAdds(); + + m_creature->SetSpeedRate(MOVE_RUN, 2.0f); + + summoned = 2; + InBlade = false; + Wait_Timer = 0; + + Charge_timer = 0; + Blade_Dance_Timer = 45000; + Summon_Assistant_Timer = 30000; + Assassins_Timer = 5000; + resetcheck_timer = 5000; + } + + void Aggro(Unit *who) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + switch(summoned->GetEntry()) + { + case MOB_HEARTHEN_GUARD: + case MOB_SHARPSHOOTER_GUARD: + case MOB_REAVER_GUARD: + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(pTarget); + + adds.push_back(summoned->GetGUID()); + break; + case MOB_SHATTERED_ASSASSIN: + assassins.push_back(summoned->GetGUID()); + break; + } + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + removeAdds(); + } + + void MovementInform(uint32 type, uint32 id) + { + if (InBlade) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id != 1) + return; + + if (target_num > 0) // to prevent loops + { + Wait_Timer = 1; + DoCastSpellIfCan(m_creature, SPELL_BLADE_DANCE, CAST_TRIGGERED); + --target_num; + } + } + } + + void removeAdds() + { + if (!m_pInstance) + return; + + for(std::vector::iterator itr = adds.begin(); itr!= adds.end(); ++itr) + { + if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) + pTemp->ForcedDespawn(); + } + + adds.clear(); + + for(std::vector::iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) + { + if (Creature* pTemp = m_pInstance->instance->GetCreature(*itr)) + pTemp->ForcedDespawn(); + } + + assassins.clear(); + } + + void SpawnAssassin() + { + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Assassins_Timer) + if (Assassins_Timer <= diff) + { + SpawnAssassin(); + Assassins_Timer = 0; + }else Assassins_Timer -= diff; + + if (InBlade) + { + if (Wait_Timer) + if (Wait_Timer <= diff) + { + if (target_num <= 0) + { + // stop bladedance + InBlade = false; + m_creature->SetSpeedRate(MOVE_RUN, 2.0f); + (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); + Wait_Timer = 0; + if (!m_bIsRegularMode) + Charge_timer = 5000; + } + else + { + //move in bladedance + float x,y,randx,randy; + randx = (rand()%40); + randy = (rand()%40); + x = 210+ randx ; + y = -60- randy ; + (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); + Wait_Timer = 0; + } + }else Wait_Timer -= diff; + } + else + { + if (Blade_Dance_Timer < diff) + { + target_num = TARGET_NUM; + Wait_Timer = 1; + InBlade = true; + Blade_Dance_Timer = 30000; + m_creature->SetSpeedRate(MOVE_RUN, 4.0f); + return; + }else Blade_Dance_Timer -= diff; + + if (Charge_timer) + if (Charge_timer <= diff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + DoCastSpellIfCan(pTarget, H_SPELL_CHARGE); + + Charge_timer = 0; + }else Charge_timer -= diff; + + if (Summon_Assistant_Timer < diff) + { + Unit* target = NULL; + + for(uint32 i = 0; i < summoned; ++i) + { + switch(urand(0, 2)) + { + case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: m_creature->SummonCreature(MOB_REAVER_GUARD, AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + } + } + + if (!urand(0, 4)) + ++summoned; + + Summon_Assistant_Timer = urand(25000, 35000); + } + else Summon_Assistant_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + if (resetcheck_timer < diff) + { + uint32 tempx,tempy; + tempx = uint32(m_creature->GetPositionX()); + tempy = uint32(m_creature->GetPositionY()); + if (tempx > 255 || tempx < 205) + { + EnterEvadeMode(); + } + resetcheck_timer = 5000; + }else resetcheck_timer -= diff; + } +}; + +CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) +{ + return new boss_warchief_kargath_bladefistAI(pCreature); +} + +void AddSC_boss_warchief_kargath_bladefist() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_warchief_kargath_bladefist"; + newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp new file mode 100644 index 0000000..49ab319 --- /dev/null +++ b/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp @@ -0,0 +1,116 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shattered_Halls +SD%Complete: 50 +SDComment: currently missing info about door. instance not complete +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +#include "precompiled.h" +#include "shattered_halls.h" + +struct MANGOS_DLL_DECL instance_shattered_halls : public ScriptedInstance +{ + instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiNethekurseGUID; + uint64 m_uiNethekurseDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiNethekurseGUID = 0; + m_uiNethekurseDoorGUID = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; i++) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + return false; + } + + void OnObjectCreate(GameObject* pGo) + { + if (pGo->GetEntry() == GO_NETHEKURSE_DOOR) + m_uiNethekurseDoorGUID = pGo->GetGUID(); + } + + void OnCreatureCreate(Creature* pCreature) + { + if (pCreature->GetEntry() == NPC_NETHEKURSE) + m_uiNethekurseGUID = pCreature->GetGUID(); + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_NETHEKURSE: + m_auiEncounter[0] = uiData; + if (uiData == DONE) + DoUseDoorOrButton(m_uiNethekurseDoorGUID); + break; + case TYPE_OMROGG: + m_auiEncounter[1] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_NETHEKURSE: + return m_auiEncounter[0]; + case TYPE_OMROGG: + return m_auiEncounter[1]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case NPC_NETHEKURSE: + return m_uiNethekurseGUID; + case GO_NETHEKURSE_DOOR: + return m_uiNethekurseDoorGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) +{ + return new instance_shattered_halls(pMap); +} + +void AddSC_instance_shattered_halls() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "instance_shattered_halls"; + pNewScript->GetInstanceData = &GetInstanceData_instance_shattered_halls; + pNewScript->RegisterSelf(); +} diff --git a/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h b/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h new file mode 100644 index 0000000..2381877 --- /dev/null +++ b/scripts/outland/hellfire_citadel/shattered_halls/shattered_halls.h @@ -0,0 +1,18 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHATTERED_H +#define DEF_SHATTERED_H + +enum +{ + MAX_ENCOUNTER = 2, + + TYPE_NETHEKURSE = 0, + TYPE_OMROGG = 1, + + GO_NETHEKURSE_DOOR = 182540, + NPC_NETHEKURSE = 16807 +}; +#endif diff --git a/scripts/outland/hellfire_peninsula.cpp b/scripts/outland/hellfire_peninsula.cpp new file mode 100644 index 0000000..7d62dbe --- /dev/null +++ b/scripts/outland/hellfire_peninsula.cpp @@ -0,0 +1,815 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Hellfire_Peninsula +SD%Complete: 100 +SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths), 10838 +SDCategory: Hellfire Peninsula +EndScriptData */ + +/* ContentData +npc_aeranas +go_haaleshi_altar +npc_ancestral_wolf +npc_demoniac_scryer +npc_gryphoneer_windbellow +npc_naladu +npc_tracy_proudwell +npc_trollbane +npc_wing_commander_dabiree +npc_wing_commander_brack +npc_wounded_blood_elf +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_aeranas +######*/ + +#define SAY_SUMMON -1000138 +#define SAY_FREE -1000139 + +#define FACTION_HOSTILE 16 +#define FACTION_FRIENDLY 35 + +#define SPELL_ENVELOPING_WINDS 15535 +#define SPELL_SHOCK 12553 + +#define C_AERANAS 17085 + +struct MANGOS_DLL_DECL npc_aeranasAI : public ScriptedAI +{ + npc_aeranasAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 Faction_Timer; + uint32 EnvelopingWinds_Timer; + uint32 Shock_Timer; + + void Reset() + { + Faction_Timer = 8000; + EnvelopingWinds_Timer = 9000; + Shock_Timer = 5000; + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(FACTION_FRIENDLY); + + DoScriptText(SAY_SUMMON, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (Faction_Timer) + { + if (Faction_Timer <= diff) + { + m_creature->setFaction(FACTION_HOSTILE); + Faction_Timer = 0; + }else Faction_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->GetHealthPercent() < 30.0f) + { + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + DoScriptText(SAY_FREE, m_creature); + return; + } + + if (Shock_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SHOCK); + Shock_Timer = 10000; + }else Shock_Timer -= diff; + + if (EnvelopingWinds_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ENVELOPING_WINDS); + EnvelopingWinds_Timer = 25000; + }else EnvelopingWinds_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_aeranas(Creature* pCreature) +{ + return new npc_aeranasAI(pCreature); +} + +/*###### +## go_haaleshi_altar +######*/ + +bool GOHello_go_haaleshi_altar(Player* pPlayer, GameObject* pGo) +{ + pGo->SummonCreature(C_AERANAS, -1321.79f, 4043.80f, 116.24f, 1.25f, TEMPSUMMON_TIMED_DESPAWN, 180000); + return false; +} + +/*###### +## npc_ancestral_wolf +######*/ + +enum +{ + EMOTE_WOLF_LIFT_HEAD = -1000496, + EMOTE_WOLF_HOWL = -1000497, + SAY_WOLF_WELCOME = -1000498, + + SPELL_ANCESTRAL_WOLF_BUFF = 29981, + + NPC_RYGA = 17123 +}; + +struct MANGOS_DLL_DECL npc_ancestral_wolfAI : public npc_escortAI +{ + npc_ancestral_wolfAI(Creature* pCreature) : npc_escortAI(pCreature) + { + if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER) + Start(false, pCreature->GetOwner()->GetGUID()); + else + error_log("SD2: npc_ancestral_wolf can not obtain owner or owner is not a player."); + + Reset(); + } + + Unit* pRyga; + + void Reset() + { + pRyga = NULL; + m_creature->CastSpell(m_creature, SPELL_ANCESTRAL_WOLF_BUFF, true); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pRyga && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_RYGA && m_creature->IsWithinDistInMap(pWho, 15.0f)) + pRyga = pWho; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(EMOTE_WOLF_LIFT_HEAD, m_creature); + break; + case 2: + DoScriptText(EMOTE_WOLF_HOWL, m_creature); + break; + case 50: + if (pRyga && pRyga->isAlive() && !pRyga->isInCombat()) + DoScriptText(SAY_WOLF_WELCOME, pRyga); + break; + } + } +}; + +CreatureAI* GetAI_npc_ancestral_wolf(Creature* pCreature) +{ + return new npc_ancestral_wolfAI(pCreature); +} + +/*###### +## npc_demoniac_scryer +######*/ + +#define GOSSIP_ITEM_ATTUNE "Yes, Scryer. You may possess me." + +enum +{ + GOSSIP_TEXTID_PROTECT = 10659, + GOSSIP_TEXTID_ATTUNED = 10643, + + QUEST_DEMONIAC = 10838, + NPC_HELLFIRE_WARDLING = 22259, + NPC_BUTTRESS = 22267, //the 4x nodes + NPC_SPAWNER = 22260, //just a dummy, not used + + MAX_BUTTRESS = 4, + TIME_TOTAL = MINUTE*10*IN_MILLISECONDS, + + SPELL_SUMMONED_DEMON = 7741, //visual spawn-in for demon + SPELL_DEMONIAC_VISITATION = 38708, //create item + + SPELL_BUTTRESS_APPERANCE = 38719, //visual on 4x bunnies + the flying ones + SPELL_SUCKER_CHANNEL = 38721, //channel to the 4x nodes + SPELL_SUCKER_DESPAWN_MOB = 38691 +}; + +//script is basic support, details like end event are not implemented +struct MANGOS_DLL_DECL npc_demoniac_scryerAI : public ScriptedAI +{ + npc_demoniac_scryerAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsComplete = false; + m_uiSpawnDemonTimer = 15000; + m_uiSpawnButtressTimer = 45000; + m_uiButtressCount = 0; + Reset(); + } + + bool m_bIsComplete; + + uint32 m_uiSpawnDemonTimer; + uint32 m_uiSpawnButtressTimer; + uint32 m_uiButtressCount; + + void Reset() {} + + //we don't want anything to happen when attacked + void AttackedBy(Unit* pEnemy) {} + void AttackStart(Unit* pEnemy) {} + + void DoSpawnButtress() + { + ++m_uiButtressCount; + + float fAngle; + + switch(m_uiButtressCount) + { + case 1: fAngle = 0.0f; break; + case 2: fAngle = M_PI_F+M_PI_F/2; break; + case 3: fAngle = M_PI_F/2; break; + case 4: fAngle = M_PI_F; break; + } + + float fX, fY; + m_creature->GetNearPoint2D(fX, fY, 5.0f, fAngle); + + float fZ_Ground = m_creature->GetMap()->GetHeight(fX, fY, MAX_HEIGHT); + + uint32 uiTime = TIME_TOTAL - (m_uiSpawnButtressTimer * m_uiButtressCount); + m_creature->SummonCreature(NPC_BUTTRESS, fX, fY, fZ_Ground, m_creature->GetAngle(fX, fY), TEMPSUMMON_TIMED_DESPAWN, uiTime); + } + + void DoSpawnDemon() + { + float fX, fY, fZ; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_HELLFIRE_WARDLING, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_HELLFIRE_WARDLING) + { + pSummoned->CastSpell(pSummoned, SPELL_SUMMONED_DEMON, false); + pSummoned->AI()->AttackStart(m_creature); + } + else + { + if (pSummoned->GetEntry() == NPC_BUTTRESS) + { + pSummoned->CastSpell(pSummoned, SPELL_BUTTRESS_APPERANCE, false); + pSummoned->CastSpell(m_creature, SPELL_SUCKER_CHANNEL, true); + } + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pTarget->GetEntry() == NPC_HELLFIRE_WARDLING && pSpell->Id == SPELL_SUCKER_DESPAWN_MOB) + ((Creature*)pTarget)->ForcedDespawn(); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bIsComplete || !m_creature->isAlive()) + return; + + if (m_uiSpawnButtressTimer <= uiDiff) + { + if (m_uiButtressCount >= MAX_BUTTRESS) + { + m_creature->CastSpell(m_creature, SPELL_SUCKER_DESPAWN_MOB, false); + + if (m_creature->isInCombat()) + { + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + } + + m_bIsComplete = true; + return; + } + + m_uiSpawnButtressTimer = 45000; + DoSpawnButtress(); + } + else + m_uiSpawnButtressTimer -= uiDiff; + + if (m_uiSpawnDemonTimer <= uiDiff) + { + DoSpawnDemon(); + m_uiSpawnDemonTimer = 15000; + } + else + m_uiSpawnDemonTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_demoniac_scryer(Creature* pCreature) +{ + return new npc_demoniac_scryerAI(pCreature); +} + +bool GossipHello_npc_demoniac_scryer(Player* pPlayer, Creature* pCreature) +{ + if (npc_demoniac_scryerAI* pScryerAI = dynamic_cast(pCreature->AI())) + { + if (pScryerAI->m_bIsComplete) + { + if (pPlayer->GetQuestStatus(QUEST_DEMONIAC) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ATTUNE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_ATTUNED, pCreature->GetGUID()); + return true; + } + } + + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_PROTECT, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_demoniac_scryer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer, SPELL_DEMONIAC_VISITATION, false); + } + + return true; +} + +/*###### +## npc_gryphoneer_windbellow +######*/ + +enum +{ + QUEST_ABYSSAL_A = 10163, + QUEST_RETURN_ABYSSAL_A = 10346, + QUEST_TO_THE_FRONT = 10382, + SPELL_TAXI_AERIAL_ASSULT = 33899, + SPELL_TAXI_TO_BEACH_HEAD = 35065 +}; + +#define GOSSIP_ITEM1_WIN "Fly me to The Abyssal Shelf" +#define GOSSIP_ITEM2_WIN "Fly me to Honor Point" + +bool GossipHello_npc_gryphoneer_windbellow(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + //Mission: The Abyssal Shelf || Return to the Abyssal Shelf + if (pPlayer->GetQuestStatus(QUEST_ABYSSAL_A) == QUEST_STATUS_INCOMPLETE || + pPlayer->GetQuestStatus(QUEST_RETURN_ABYSSAL_A) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + //Go to the Front + if (pPlayer->GetQuestStatus(QUEST_TO_THE_FRONT) == QUEST_STATUS_COMPLETE || + pPlayer->GetQuestRewardStatus(QUEST_TO_THE_FRONT)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2_WIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_gryphoneer_windbellow(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 589 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_AERIAL_ASSULT,true); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 607 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_TO_BEACH_HEAD,true); + } + return true; +} + +/*###### +## npc_naladu +######*/ + +#define GOSSIP_NALADU_ITEM1 "Why don't you escape?" + +enum +{ + GOSSIP_TEXTID_NALADU1 = 9788 +}; + +bool GossipHello_npc_naladu(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NALADU_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_naladu(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_NALADU1, pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_tracy_proudwell +######*/ + +#define GOSSIP_TEXT_REDEEM_MARKS "I have marks to redeem!" +#define GOSSIP_TRACY_PROUDWELL_ITEM1 "I heard that your dog Fei Fei took Klatu's prayer beads..." +#define GOSSIP_TRACY_PROUDWELL_ITEM2 "" + +enum +{ + GOSSIP_TEXTID_TRACY_PROUDWELL1 = 10689, + QUEST_DIGGING_FOR_PRAYER_BEADS = 10916 +}; + +bool GossipHello_npc_tracy_proudwell(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_REDEEM_MARKS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestStatus(QUEST_DIGGING_FOR_PRAYER_BEADS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tracy_proudwell(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TRACY_PROUDWELL1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + } + + return true; +} + +/*###### +## npc_trollbane +######*/ + +#define GOSSIP_TROLLBANE_ITEM1 "Tell me of the Sons of Lothar." +#define GOSSIP_TROLLBANE_ITEM2 "" +#define GOSSIP_TROLLBANE_ITEM3 "Tell me of your homeland." + +enum +{ + GOSSIP_TEXTID_TROLLBANE1 = 9932, + GOSSIP_TEXTID_TROLLBANE2 = 9933, + GOSSIP_TEXTID_TROLLBANE3 = 8772 +}; + +bool GossipHello_npc_trollbane(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_trollbane(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TROLLBANE_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE2, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TROLLBANE3, pCreature->GetGUID()); + break; + } + + return true; +} + +/*###### +## npc_wing_commander_dabiree +######*/ + +enum +{ + SPELL_TAXI_TO_GATEWAYS = 33768, + SPELL_TAXI_TO_SHATTER = 35069, + QUEST_MISSION_GATEWAYS_A = 10146, + QUEST_SHATTER_POINT = 10340 +}; + +#define GOSSIP_ITEM1_DAB "Fly me to Murketh and Shaadraz Gateways" +#define GOSSIP_ITEM2_DAB "Fly me to Shatter Point" + +bool GossipHello_npc_wing_commander_dabiree(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + //Mission: The Murketh and Shaadraz Gateways + if (pPlayer->GetQuestStatus(QUEST_MISSION_GATEWAYS_A) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + //Shatter Point + if (pPlayer->GetQuestStatus(QUEST_SHATTER_POINT) == QUEST_STATUS_COMPLETE || + pPlayer->GetQuestRewardStatus(QUEST_SHATTER_POINT)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2_DAB, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_wing_commander_dabiree(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 585 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_TO_GATEWAYS,true); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 612 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_TO_SHATTER,true); + } + return true; +} + +/*###### +## npc_wing_commander_brack +######*/ + +enum +{ + QUEST_MISSION_GATEWAYS_H = 10129, + QUEST_ABYSSAL_H = 10162, + QUEST_RETURN_ABYSSAL_H = 10347, + QUEST_SPINEBREAKER = 10242, + SPELL_TAXI_GATEWAYS_H = 33659, + SPELL_TAXI_ASSULT_H = 33825, + SPELL_TAXI_SPINEBREAKER = 34578 +}; + +#define GOSSIP_ITEM1_BRA "I'm on a bombing mission for Forward Commander To'arch. I need a wyvern destroyer!" +#define GOSSIP_ITEM2_BRA "Fly me to The Abyssal Shelf" +#define GOSSIP_ITEM3_BRA "Lend me a Wind Rider, I'm going to Spinebreaker Post." + +bool GossipHello_npc_wing_commander_brack(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + //Mission: The Murketh and Shaadraz Gateways + if (pPlayer->GetQuestStatus(QUEST_MISSION_GATEWAYS_H) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM1_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + //Mission: The Abyssal Shelf || Return to the Abyssal Shelf + if (pPlayer->GetQuestStatus(QUEST_ABYSSAL_H) == QUEST_STATUS_INCOMPLETE || + pPlayer->GetQuestStatus(QUEST_RETURN_ABYSSAL_H) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM2_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + //Spinebreaker Post + if (pPlayer->GetQuestStatus(QUEST_SPINEBREAKER) == QUEST_STATUS_COMPLETE || + pPlayer->GetQuestRewardStatus(QUEST_SPINEBREAKER)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM3_BRA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_wing_commander_brack(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 584 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_GATEWAYS_H,true); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 587 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_ASSULT_H,true); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + //TaxiPath 604 + pPlayer->CastSpell(pPlayer,SPELL_TAXI_SPINEBREAKER,true); + break; + } + return true; +} + +/*###### +## npc_wounded_blood_elf +######*/ + +#define SAY_ELF_START -1000117 +#define SAY_ELF_SUMMON1 -1000118 +#define SAY_ELF_RESTING -1000119 +#define SAY_ELF_SUMMON2 -1000120 +#define SAY_ELF_COMPLETE -1000121 +#define SAY_ELF_AGGRO -1000122 + +#define QUEST_ROAD_TO_FALCON_WATCH 9375 + +struct MANGOS_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI +{ + npc_wounded_blood_elfAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch (i) + { + case 0: + DoScriptText(SAY_ELF_START, m_creature, pPlayer); + break; + case 9: + DoScriptText(SAY_ELF_SUMMON1, m_creature, pPlayer); + // Spawn two Haal'eshi Talonguard + DoSpawnCreature(16967, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16967, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 13: + DoScriptText(SAY_ELF_RESTING, m_creature, pPlayer); + break; + case 14: + DoScriptText(SAY_ELF_SUMMON2, m_creature, pPlayer); + // Spawn two Haal'eshi Windwalker + DoSpawnCreature(16966, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + DoSpawnCreature(16966, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + break; + case 27: + DoScriptText(SAY_ELF_COMPLETE, m_creature, pPlayer); + // Award quest credit + pPlayer->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, m_creature); + break; + } + } + + void Reset() { } + + void Aggro(Unit* who) + { + if (HasEscortState(STATE_ESCORT_ESCORTING)) + DoScriptText(SAY_ELF_AGGRO, m_creature); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } +}; + +CreatureAI* GetAI_npc_wounded_blood_elf(Creature* pCreature) +{ + return new npc_wounded_blood_elfAI(pCreature); +} + +bool QuestAccept_npc_wounded_blood_elf(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH) + { + // Change faction so mobs attack + pCreature->setFaction(FACTION_ESCORT_H_PASSIVE); + + if (npc_wounded_blood_elfAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + + return true; +} + +void AddSC_hellfire_peninsula() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_aeranas"; + newscript->GetAI = &GetAI_npc_aeranas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_haaleshi_altar"; + newscript->pGOHello = &GOHello_go_haaleshi_altar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ancestral_wolf"; + newscript->GetAI = &GetAI_npc_ancestral_wolf; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_demoniac_scryer"; + newscript->GetAI = &GetAI_npc_demoniac_scryer; + newscript->pGossipHello = &GossipHello_npc_demoniac_scryer; + newscript->pGossipSelect = &GossipSelect_npc_demoniac_scryer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_gryphoneer_windbellow"; + newscript->pGossipHello = &GossipHello_npc_gryphoneer_windbellow; + newscript->pGossipSelect = &GossipSelect_npc_gryphoneer_windbellow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_naladu"; + newscript->pGossipHello = &GossipHello_npc_naladu; + newscript->pGossipSelect = &GossipSelect_npc_naladu; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tracy_proudwell"; + newscript->pGossipHello = &GossipHello_npc_tracy_proudwell; + newscript->pGossipSelect = &GossipSelect_npc_tracy_proudwell; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_trollbane"; + newscript->pGossipHello = &GossipHello_npc_trollbane; + newscript->pGossipSelect = &GossipSelect_npc_trollbane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_wing_commander_dabiree"; + newscript->pGossipHello = &GossipHello_npc_wing_commander_dabiree; + newscript->pGossipSelect = &GossipSelect_npc_wing_commander_dabiree; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_wing_commander_brack"; + newscript->pGossipHello = &GossipHello_npc_wing_commander_brack; + newscript->pGossipSelect = &GossipSelect_npc_wing_commander_brack; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_wounded_blood_elf"; + newscript->GetAI = &GetAI_npc_wounded_blood_elf; + newscript->pQuestAccept = &QuestAccept_npc_wounded_blood_elf; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/nagrand.cpp b/scripts/outland/nagrand.cpp new file mode 100644 index 0000000..d8dbf94 --- /dev/null +++ b/scripts/outland/nagrand.cpp @@ -0,0 +1,736 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Nagrand +SD%Complete: 90 +SDComment: Quest support: 9849, 9868, 9874, 9918, 9991, 10044, 10085, 10107, 10108, 10172, 10646. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text) +SDCategory: Nagrand +EndScriptData */ + +/* ContentData +mob_shattered_rumbler +mob_lump +mob_sunspring_villager +npc_altruis_the_sufferer +npc_greatmother_geyah +npc_lantresor_of_the_blade +npc_maghar_captive +npc_creditmarker_visit_with_ancestors +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## mob_shattered_rumbler - this should be done with ACID +######*/ + +struct MANGOS_DLL_DECL mob_shattered_rumblerAI : public ScriptedAI +{ + bool Spawn; + + mob_shattered_rumblerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + Spawn = false; + } + + void SpellHit(Unit *Hitter, const SpellEntry *Spellkind) + { + if (Spellkind->Id == 32001 && !Spawn) + { + float x = m_creature->GetPositionX(); + float y = m_creature->GetPositionY(); + float z = m_creature->GetPositionZ(); + + Hitter->SummonCreature(18181,x+(0.7 * (rand()%30)),y+(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + Hitter->SummonCreature(18181,x+(rand()%5),y-(rand()%5),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + Hitter->SummonCreature(18181,x-(rand()%5),y+(0.5 *(rand()%60)),z,0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,60000); + m_creature->SetDeathState(CORPSE); + Spawn = true; + } + return; + } +}; +CreatureAI* GetAI_mob_shattered_rumbler(Creature* pCreature) +{ + return new mob_shattered_rumblerAI(pCreature); +} + +/*###### +## mob_lump +######*/ + +#define SAY_LUMP_0 -1000190 +#define SAY_LUMP_1 -1000191 +#define SAY_LUMP_DEFEAT -1000192 + +#define SPELL_VISUAL_SLEEP 16093 +#define SPELL_SPEAR_THROW 32248 + +struct MANGOS_DLL_DECL mob_lumpAI : public ScriptedAI +{ + mob_lumpAI(Creature* pCreature) : ScriptedAI(pCreature) + { + bReset = false; + Reset(); + } + + uint32 Reset_Timer; + uint32 Spear_Throw_Timer; + bool bReset; + + void Reset() + { + Reset_Timer = 60000; + Spear_Throw_Timer = 2000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit *done_by, uint32 & damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER && (m_creature->GetHealth() - damage)*100 / m_creature->GetMaxHealth() < 30) + { + if (!bReset && ((Player*)done_by)->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) + { + //Take 0 damage + damage = 0; + + ((Player*)done_by)->AttackStop(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->setFaction(1080); //friendly + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + DoScriptText(SAY_LUMP_DEFEAT, m_creature, done_by); + + bReset = true; + } + } + } + + void Aggro(Unit *who) + { + if (m_creature->HasAura(SPELL_VISUAL_SLEEP, EFFECT_INDEX_0)) + m_creature->RemoveAurasDueToSpell(SPELL_VISUAL_SLEEP); + + if (!m_creature->IsStandState()) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoScriptText(urand(0, 1) ? SAY_LUMP_0 : SAY_LUMP_1, m_creature, who); + } + + void UpdateAI(const uint32 diff) + { + //check if we waiting for a reset + if (bReset) + { + if (Reset_Timer < diff) + { + EnterEvadeMode(); + bReset = false; + m_creature->setFaction(1711); //hostile + } + else Reset_Timer -= diff; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Spear_Throw_Timer + if (Spear_Throw_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SPEAR_THROW); + Spear_Throw_Timer = 20000; + }else Spear_Throw_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_lump(Creature *_creature) +{ + return new mob_lumpAI(_creature); +} + +bool GossipHello_mob_lump(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(9918) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need answers, ogre!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9352, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_mob_lump(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Why are Boulderfist out this far? You know that this is Kurenai territory.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9353, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "And you think you can just eat anything you want? You're obviously trying to eat the Broken of Telaar.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(9354, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "This means war, Lump! War I say!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(9355, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->SEND_GOSSIP_MENU(9356, pCreature->GetGUID()); + pPlayer->TalkedToCreature(18354, pCreature->GetGUID()); + break; + } + return true; +} + +/*#### +# mob_sunspring_villager - should be done with ACID +####*/ + +struct MANGOS_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI +{ + mob_sunspring_villagerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == 32146) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + } +}; +CreatureAI* GetAI_mob_sunspring_villager(Creature* pCreature) +{ + return new mob_sunspring_villagerAI(pCreature); +} + +/*###### +## npc_altruis_the_sufferer +######*/ + +enum +{ + QUEST_SURVEY = 9991, + QUEST_PUPIL = 10646, + + TAXI_PATH_ID = 532 +}; + +bool GossipHello_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + //gossip before obtaining Survey the Land + if (pPlayer->GetQuestStatus(QUEST_SURVEY) == QUEST_STATUS_NONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I see twisted steel and smell sundered earth.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+10); + + //gossip when Survey the Land is incomplete (technically, after the flight) + if (pPlayer->GetQuestStatus(QUEST_SURVEY) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Well...?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); + + //wowwiki.com/Varedis + if (pPlayer->GetQuestStatus(QUEST_PUPIL) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Story about Illidan's Pupil", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+30); + + pPlayer->SEND_GOSSIP_MENU(9419, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Legion?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(9420, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "And now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + pPlayer->SEND_GOSSIP_MENU(9421, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "How do you see them now?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + pPlayer->SEND_GOSSIP_MENU(9422, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Forge camps?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + pPlayer->SEND_GOSSIP_MENU(9423, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+14: + pPlayer->SEND_GOSSIP_MENU(9424, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+20: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Ok.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21); + pPlayer->SEND_GOSSIP_MENU(9427, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+21: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_SURVEY); + break; + + case GOSSIP_ACTION_INFO_DEF+30: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Story done", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 31); + pPlayer->SEND_GOSSIP_MENU(384, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+31: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(QUEST_PUPIL); + break; + } + return true; +} + +bool QuestAccept_npc_altruis_the_sufferer(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (!pPlayer->GetQuestRewardStatus(QUEST_SURVEY)) //Survey the Land + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); + } + return true; +} + +/*###### +## npc_greatmother_geyah +######*/ + +//all the textId's for the below is unknown, but i do believe the gossip item texts are proper. +bool GossipHello_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10044) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Hello, Greatmother. Garrosh told me that you wanted to speak with me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + else if (pPlayer->GetQuestStatus(10172) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Garrosh is beyond redemption, Greatmother. I fear that in helping the Mag'har, I have convinced Garrosh that he is unfit to lead.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + else + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_greatmother_geyah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "You raised all of the orcs here, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Do you believe that?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What can be done? I have tried many different things. I have done my best to help the people of Nagrand. Each time I have approached Garrosh, he has dismissed me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Left? How can you choose to leave?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What is this duty?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Is there anything I can do for you, Greatmother?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 7: + pPlayer->AreaExploredOrEventHappens(10044); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + + case GOSSIP_ACTION_INFO_DEF + 10: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have done all that I could, Greatmother. I thank you for your kind words.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 11: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Greatmother, you are the mother of Durotan?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 12: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Greatmother, I never had the honor. Durotan died long before my time, but his heroics are known to all on my world. The orcs of Azeroth reside in a place known as Durotar, named after your son. And ... (You take a moment to breathe and think through what you are about to tell the Greatmother.)", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 13: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "It is my Warchief, Greatmother. The leader of my people. From my world. He ... He is the son of Durotan. He is your grandchild.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 14: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I will return to Azeroth at once, Greatmother.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 15: + pPlayer->AreaExploredOrEventHappens(10172); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } + return true; +} + +/*###### +## npc_lantresor_of_the_blade +######*/ + +bool GossipHello_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have killed many of your ogres, Lantresor. I have no fear.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9361, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_lantresor_of_the_blade(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Should I know? You look like an orc to me.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9362, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "And the other half?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(9363, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have heard of your kind, but I never thought to see the day when I would meet a half-breed.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + pPlayer->SEND_GOSSIP_MENU(9364, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "My apologies. I did not mean to offend. I am here on behalf of my people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4); + pPlayer->SEND_GOSSIP_MENU(9365, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "My people ask that you pull back your Boulderfist ogres and cease all attacks on our territories. In return, we will also pull back our forces.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5); + pPlayer->SEND_GOSSIP_MENU(9366, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "We will fight you until the end, then, Lantresor. We will not stand idly by as you pillage our towns and kill our people.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6); + pPlayer->SEND_GOSSIP_MENU(9367, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "What do I need to do?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7); + pPlayer->SEND_GOSSIP_MENU(9368, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->SEND_GOSSIP_MENU(9369, pCreature->GetGUID()); + if (pPlayer->GetQuestStatus(10107) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(10107); + if (pPlayer->GetQuestStatus(10108) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(10108); + break; + } + return true; +} + +/*##### +## npc_maghar_captive +#####*/ + +enum +{ + SAY_MAG_START = -1000482, + SAY_MAG_NO_ESCAPE = -1000483, + SAY_MAG_MORE = -1000484, + SAY_MAG_MORE_REPLY = -1000485, + SAY_MAG_LIGHTNING = -1000486, + SAY_MAG_SHOCK = -1000487, + SAY_MAG_COMPLETE = -1000488, + + SPELL_CHAIN_LIGHTNING = 16006, + SPELL_EARTHBIND_TOTEM = 15786, + SPELL_FROST_SHOCK = 12548, + SPELL_HEALING_WAVE = 12491, + + QUEST_TOTEM_KARDASH_H = 9868, + + NPC_MURK_RAIDER = 18203, + NPC_MURK_BRUTE = 18211, + NPC_MURK_SCAVENGER = 18207, + NPC_MURK_PUTRIFIER = 18202 +}; + +static float m_afAmbushA[]= {-1568.805786f, 8533.873047f, 1.958f}; +static float m_afAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f}; + +struct MANGOS_DLL_DECL npc_maghar_captiveAI : public npc_escortAI +{ + npc_maghar_captiveAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + uint32 m_uiChainLightningTimer; + uint32 m_uiHealTimer; + uint32 m_uiFrostShockTimer; + + void Reset() + { + m_uiChainLightningTimer = 1000; + m_uiHealTimer = 0; + m_uiFrostShockTimer = 6000; + } + + void Aggro(Unit* pWho) + { + m_creature->CastSpell(m_creature, SPELL_EARTHBIND_TOTEM, false); + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 7: + DoScriptText(SAY_MAG_MORE, m_creature); + + if (Creature* pTemp = m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000)) + DoScriptText(SAY_MAG_MORE_REPLY, pTemp); + + m_creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + + m_creature->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 16: + DoScriptText(SAY_MAG_COMPLETE, m_creature); + + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_TOTEM_KARDASH_H, m_creature); + + SetRun(); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_MURK_BRUTE) + DoScriptText(SAY_MAG_NO_ESCAPE, pSummoned); + + if (pSummoned->IsTotem()) + return; + + pSummoned->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_CHAIN_LIGHTNING) + { + if (urand(0, 9)) + return; + + DoScriptText(SAY_MAG_LIGHTNING, m_creature); + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiChainLightningTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); + m_uiChainLightningTimer = urand(7000, 14000); + } + else + m_uiChainLightningTimer -= uiDiff; + + if (m_creature->GetHealthPercent() < 30.0f) + { + if (m_uiHealTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_HEALING_WAVE); + m_uiHealTimer = 5000; + } + else + m_uiHealTimer -= uiDiff; + } + + if (m_uiFrostShockTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_FROST_SHOCK); + m_uiFrostShockTimer = urand(7500, 15000); + } + else + m_uiFrostShockTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_maghar_captive(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_TOTEM_KARDASH_H) + { + if (npc_maghar_captiveAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + pCreature->setFaction(FACTION_ESCORT_H_NEUTRAL_ACTIVE); + + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + + DoScriptText(SAY_MAG_START, pCreature); + + pCreature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + pCreature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0]-2.5f, m_afAmbushA[1]+2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + pCreature->SummonCreature(NPC_MURK_BRUTE, m_afAmbushA[0], m_afAmbushA[1], m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + } + } + return true; +} + +CreatureAI* GetAI_npc_maghar_captive(Creature* pCreature) +{ + return new npc_maghar_captiveAI(pCreature); +} + +/*###### +## npc_creditmarker_visist_with_ancestors (Quest 10085) +######*/ + +enum +{ + QUEST_VISIT_WITH_ANCESTORS = 10085 +}; + +struct MANGOS_DLL_DECL npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI +{ + npc_creditmarker_visit_with_ancestorsAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() {} + + void MoveInLineOfSight(Unit* pWho) + { + if (pWho->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(pWho, 30.0f)) + { + if (((Player*)pWho)->GetQuestStatus(QUEST_VISIT_WITH_ANCESTORS) == QUEST_STATUS_INCOMPLETE) + { + uint32 creditMarkerId = m_creature->GetEntry(); + if ((creditMarkerId >= 18840) && (creditMarkerId <= 18843)) + { + // 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding + if (!((Player*)pWho)->GetReqKillOrCastCurrentCount(QUEST_VISIT_WITH_ANCESTORS, creditMarkerId)) + ((Player*)pWho)->KilledMonsterCredit(creditMarkerId, m_creature->GetGUID()); + } + } + } + } +}; + +CreatureAI* GetAI_npc_creditmarker_visit_with_ancestors(Creature* pCreature) +{ + return new npc_creditmarker_visit_with_ancestorsAI(pCreature); +} + +/*###### +## AddSC +######*/ + +void AddSC_nagrand() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_shattered_rumbler"; + newscript->GetAI = &GetAI_mob_shattered_rumbler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_lump"; + newscript->GetAI = &GetAI_mob_lump; + newscript->pGossipHello = &GossipHello_mob_lump; + newscript->pGossipSelect = &GossipSelect_mob_lump; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_sunspring_villager"; + newscript->GetAI = &GetAI_mob_sunspring_villager; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_altruis_the_sufferer"; + newscript->pGossipHello = &GossipHello_npc_altruis_the_sufferer; + newscript->pGossipSelect = &GossipSelect_npc_altruis_the_sufferer; + newscript->pQuestAccept = &QuestAccept_npc_altruis_the_sufferer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_greatmother_geyah"; + newscript->pGossipHello = &GossipHello_npc_greatmother_geyah; + newscript->pGossipSelect = &GossipSelect_npc_greatmother_geyah; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lantresor_of_the_blade"; + newscript->pGossipHello = &GossipHello_npc_lantresor_of_the_blade; + newscript->pGossipSelect = &GossipSelect_npc_lantresor_of_the_blade; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_maghar_captive"; + newscript->GetAI = &GetAI_npc_maghar_captive; + newscript->pQuestAccept = &QuestAccept_npc_maghar_captive; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_creditmarker_visit_with_ancestors"; + newscript->GetAI = &GetAI_npc_creditmarker_visit_with_ancestors; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/netherstorm.cpp b/scripts/outland/netherstorm.cpp new file mode 100644 index 0000000..6dc65b7 --- /dev/null +++ b/scripts/outland/netherstorm.cpp @@ -0,0 +1,798 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Netherstorm +SD%Complete: 80 +SDComment: Quest support: 10438, 10652 (special flight paths), 10299, 10321, 10322, 10323, 10329, 10330, 10337, 10338, 10365(Shutting Down Manaforge), 10198 +SDCategory: Netherstorm +EndScriptData */ + +/* ContentData +npc_manaforge_control_console +go_manaforge_control_console +npc_commander_dawnforge +npc_protectorate_nether_drake +npc_veronia +npc_bessy +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_manaforge_control_console +######*/ +enum +{ + EMOTE_START = -1000211, + EMOTE_60 = -1000212, + EMOTE_30 = -1000213, + EMOTE_10 = -1000214, + EMOTE_COMPLETE = -1000215, + EMOTE_ABORT = -1000216, + + NPC_BNAAR_C_CONSOLE = 20209, + NPC_CORUU_C_CONSOLE = 20417, + NPC_DURO_C_CONSOLE = 20418, + NPC_ARA_C_CONSOLE = 20440, + + NPC_SUNFURY_TECH = 20218, + NPC_SUNFURY_PROT = 20436, + + NPC_ARA_TECH = 20438, + NPC_ARA_ENGI = 20439, + NPC_ARA_GORKLONN = 20460, + + QUEST_SHUTDOWN_BNAAR_ALDOR = 10299, + QUEST_SHUTDOWN_BNAAR_SCRYERS = 10329, + QUEST_SHUTDOWN_CORUU_ALDOR = 10321, + QUEST_SHUTDOWN_CORUU_SCRYERS = 10330, + QUEST_SHUTDOWN_DURO_ALDOR = 10322, + QUEST_SHUTDOWN_DURO_SCRYERS = 10338, + QUEST_SHUTDOWN_ARA_ALDOR = 10323, + QUEST_SHUTDOWN_ARA_SCRYERS = 10365, + + ITEM_BNAAR_ACESS_CRYSTAL = 29366, + ITEM_CORUU_ACESS_CRYSTAL = 29396, + ITEM_DURO_ACESS_CRYSTAL = 29397, + ITEM_ARA_ACESS_CRYSTAL = 29411, + + SPELL_DISABLE_VISUAL = 35031, + SPELL_INTERRUPT_1 = 35016, // ACID mobs should cast this + SPELL_INTERRUPT_2 = 35176, // ACID mobs should cast this (Manaforge Ara-version) +}; + +struct MANGOS_DLL_DECL npc_manaforge_control_consoleAI : public ScriptedAI +{ + npc_manaforge_control_consoleAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 m_uiPlayerGUID; + uint64 m_uiConsoleGUID; + uint32 m_uiEventTimer; + uint32 m_uiWaveTimer; + uint32 m_uiPhase; + bool m_bWave; + + void Reset() + { + m_uiPlayerGUID = 0; + m_uiConsoleGUID = 0; + m_uiEventTimer = 3000; + m_uiWaveTimer = 0; + m_uiPhase = 1; + m_bWave = false; + } + + /*void SpellHit(Unit *caster, const SpellEntry *spell) + { + //we have no way of telling the creature was hit by spell -> got aura applied after 10-12 seconds + //then no way for the mobs to actually stop the shutdown as intended. + if (spell->Id == SPELL_INTERRUPT_1) + ... + }*/ + + void JustDied(Unit* pKiller) + { + DoScriptText(EMOTE_ABORT, m_creature); + + if (m_uiPlayerGUID) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (pPlayer) + { + switch(m_creature->GetEntry()) + { + case NPC_BNAAR_C_CONSOLE: + pPlayer->FailQuest(QUEST_SHUTDOWN_BNAAR_ALDOR); + pPlayer->FailQuest(QUEST_SHUTDOWN_BNAAR_SCRYERS); + break; + case NPC_CORUU_C_CONSOLE: + pPlayer->FailQuest(QUEST_SHUTDOWN_CORUU_ALDOR); + pPlayer->FailQuest(QUEST_SHUTDOWN_CORUU_SCRYERS); + break; + case NPC_DURO_C_CONSOLE: + pPlayer->FailQuest(QUEST_SHUTDOWN_DURO_ALDOR); + pPlayer->FailQuest(QUEST_SHUTDOWN_DURO_SCRYERS); + break; + case NPC_ARA_C_CONSOLE: + pPlayer->FailQuest(QUEST_SHUTDOWN_ARA_ALDOR); + pPlayer->FailQuest(QUEST_SHUTDOWN_ARA_SCRYERS); + break; + } + } + } + + if (m_uiConsoleGUID) + { + if (GameObject* pGo = m_creature->GetMap()->GetGameObject(m_uiConsoleGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + } + } + + void DoWaveSpawnForCreature(Creature* pCreature) + { + Creature* pAdd = NULL; + + switch(pCreature->GetEntry()) + { + case NPC_BNAAR_C_CONSOLE: + if (urand(0, 1)) + { + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2933.68f, 4162.55f, 164.00f, 1.60f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2927.36f, 4212.97f, 164.00f); + } + else + { + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2927.36f, 4212.97f, 164.00f, 4.94f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2933.68f, 4162.55f, 164.00f); + } + m_uiWaveTimer = 30000; + break; + case NPC_CORUU_C_CONSOLE: + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2445.21f, 2765.26f, 134.49f, 3.93f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2424.21f, 2740.15f, 133.81f); + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2429.86f, 2731.85f, 134.53f, 1.31f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2435.37f, 2766.04f, 133.81f); + m_uiWaveTimer = 20000; + break; + case NPC_DURO_C_CONSOLE: + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2986.80f, 2205.36f, 165.37f, 3.74f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2985.15f, 2197.32f, 164.79f); + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2952.91f, 2191.20f, 165.32f, 0.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2060.01f, 2185.27f, 164.67f); + m_uiWaveTimer = 15000; + break; + case NPC_ARA_C_CONSOLE: + if (urand(0, 1)) + { + if (pAdd = m_creature->SummonCreature(NPC_ARA_TECH, 4035.11f, 4038.97f, 194.27f, 2.57f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4003.42f, 4040.19f, 193.49f); + if (pAdd = m_creature->SummonCreature(NPC_ARA_TECH, 4033.66f, 4036.79f, 194.28f, 2.57f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4003.42f, 4040.19f, 193.49f); + if (pAdd = m_creature->SummonCreature(NPC_ARA_TECH, 4037.13f, 4037.30f, 194.23f, 2.57f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4003.42f, 4040.19f, 193.49f); + } + else + { + if (pAdd = m_creature->SummonCreature(NPC_ARA_TECH, 3099.59f, 4049.30f, 194.22f, 0.05f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4028.01f, 4035.17f, 193.59f); + if (pAdd = m_creature->SummonCreature(NPC_ARA_TECH, 3999.72f, 4046.75f, 194.22f, 0.05f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4028.01f, 4035.17f, 193.59f); + if (pAdd = m_creature->SummonCreature(NPC_ARA_TECH, 3996.81f, 4048.26f, 194.22f, 0.05f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4028.01f, 4035.17f, 193.59f); + } + m_uiWaveTimer = 15000; + break; + } + } + + void DoFinalSpawnForCreature(Creature* pCreature) + { + Creature* pAdd = NULL; + + switch(pCreature->GetEntry()) + { + case NPC_BNAAR_C_CONSOLE: + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2946.52f, 4201.42f, 163.47f, 3.54f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2927.49f, 4192.81f, 163.00f); + break; + case NPC_CORUU_C_CONSOLE: + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2453.88f, 2737.85f, 133.27f, 2.59f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2433.96f, 2751.53f, 133.85f); + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2441.62f, 2735.32f, 134.49f, 1.97f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2433.96f, 2751.53f, 133.85f); + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2450.73f, 2754.50f, 134.49f, 3.29f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2433.96f, 2751.53f, 133.85f); + break; + case NPC_DURO_C_CONSOLE: + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2956.18f, 2202.85f, 165.32f, 5.45f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2972.27f, 2193.22f, 164.48f); + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_TECH, 2975.30f, 2211.50f, 165.32f, 4.55f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2972.27f, 2193.22f, 164.48f); + if (pAdd = m_creature->SummonCreature(NPC_SUNFURY_PROT, 2965.02f, 2217.45f, 164.16f, 4.96f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 2972.27f, 2193.22f, 164.48f); + break; + case NPC_ARA_C_CONSOLE: + if (pAdd = m_creature->SummonCreature(NPC_ARA_ENGI, 3994.51f, 4020.46f, 192.18f, 0.91f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4008.35f, 4035.04f, 192.70f); + if (pAdd = m_creature->SummonCreature(NPC_ARA_GORKLONN, 4021.56f, 4059.35f, 193.59f, 4.44f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) + pAdd->GetMotionMaster()->MovePoint(0, 4016.62f, 4039.89f, 193.46f); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiEventTimer < uiDiff) + { + if (!m_uiPlayerGUID) + return; + + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pPlayer) + return; + + switch(m_uiPhase) + { + case 1: + DoScriptText(EMOTE_START, m_creature, pPlayer); + m_uiEventTimer = 60000; + m_bWave = true; + ++m_uiPhase; + break; + case 2: + DoScriptText(EMOTE_60, m_creature, pPlayer); + m_uiEventTimer = 30000; + ++m_uiPhase; + break; + case 3: + DoScriptText(EMOTE_30, m_creature, pPlayer); + m_uiEventTimer = 20000; + DoFinalSpawnForCreature(m_creature); + ++m_uiPhase; + break; + case 4: + DoScriptText(EMOTE_10, m_creature, pPlayer); + m_uiEventTimer = 10000; + m_bWave = false; + ++m_uiPhase; + break; + case 5: + DoScriptText(EMOTE_COMPLETE, m_creature, pPlayer); + pPlayer->KilledMonsterCredit(m_creature->GetEntry(), m_creature->GetGUID()); + DoCastSpellIfCan(m_creature, SPELL_DISABLE_VISUAL); + if (m_uiConsoleGUID) + { + if (GameObject* pGo = m_creature->GetMap()->GetGameObject(m_uiConsoleGUID)) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + } + ++m_uiPhase; + break; + } + } + else + m_uiEventTimer -= uiDiff; + + if (m_bWave) + { + if (m_uiWaveTimer < uiDiff) + { + DoWaveSpawnForCreature(m_creature); + } + else + m_uiWaveTimer -= uiDiff; + } + } +}; +CreatureAI* GetAI_npc_manaforge_control_console(Creature* pCreature) +{ + return new npc_manaforge_control_consoleAI(pCreature); +} + +/*###### +## go_manaforge_control_console +######*/ + +// TODO: clean up this workaround when mangos adds support to do it properly (with gossip selections instead of instant summon) +bool GOHello_go_manaforge_control_console(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + { + pPlayer->PrepareQuestMenu(pGo->GetGUID()); + pPlayer->SendPreparedQuest(pGo->GetGUID()); + } + + Creature* pManaforge = NULL; + + switch(pGo->GetAreaId()) + { + case 3726: // b'naar + if ((pPlayer->GetQuestStatus(QUEST_SHUTDOWN_BNAAR_ALDOR) == QUEST_STATUS_INCOMPLETE + || pPlayer->GetQuestStatus(QUEST_SHUTDOWN_BNAAR_SCRYERS) == QUEST_STATUS_INCOMPLETE) + && pPlayer->HasItemCount(ITEM_BNAAR_ACESS_CRYSTAL, 1)) + pManaforge = pPlayer->SummonCreature(NPC_BNAAR_C_CONSOLE, 2918.95f, 4189.98f, 161.88f, 0.34f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000); + break; + case 3730: // coruu + if ((pPlayer->GetQuestStatus(QUEST_SHUTDOWN_CORUU_ALDOR) == QUEST_STATUS_INCOMPLETE + || pPlayer->GetQuestStatus(QUEST_SHUTDOWN_CORUU_SCRYERS) == QUEST_STATUS_INCOMPLETE) + && pPlayer->HasItemCount(ITEM_CORUU_ACESS_CRYSTAL, 1)) + pManaforge = pPlayer->SummonCreature(NPC_CORUU_C_CONSOLE, 2426.77f, 2750.38f, 133.24f, 2.14f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000); + break; + case 3734: // duro + if ((pPlayer->GetQuestStatus(QUEST_SHUTDOWN_DURO_ALDOR) == QUEST_STATUS_INCOMPLETE + || pPlayer->GetQuestStatus(QUEST_SHUTDOWN_DURO_SCRYERS) == QUEST_STATUS_INCOMPLETE) + && pPlayer->HasItemCount(ITEM_DURO_ACESS_CRYSTAL, 1)) + pManaforge = pPlayer->SummonCreature(NPC_DURO_C_CONSOLE, 2976.48f, 2183.29f, 163.20f, 1.85f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000); + break; + case 3722: // ara + if ((pPlayer->GetQuestStatus(QUEST_SHUTDOWN_ARA_ALDOR) == QUEST_STATUS_INCOMPLETE + || pPlayer->GetQuestStatus(QUEST_SHUTDOWN_ARA_SCRYERS) == QUEST_STATUS_INCOMPLETE) + && pPlayer->HasItemCount(ITEM_ARA_ACESS_CRYSTAL, 1)) + pManaforge = pPlayer->SummonCreature(NPC_ARA_C_CONSOLE, 4013.71f, 4028.76f, 192.10f, 1.25f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 125000); + break; + } + + if (pManaforge) + { + if (npc_manaforge_control_consoleAI* pManaforgeAI = dynamic_cast(pManaforge->AI())) + { + pManaforgeAI->m_uiPlayerGUID = pPlayer->GetGUID(); + pManaforgeAI->m_uiConsoleGUID = pGo->GetGUID(); + } + + pGo->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE); + } + return true; +} + +/*###### +## npc_commander_dawnforge +######*/ + +// The Speech of Dawnforge, Ardonis & Pathaleon +enum +{ + SAY_COMMANDER_DAWNFORGE_1 = -1000128, + SAY_ARCANIST_ARDONIS_1 = -1000129, + SAY_COMMANDER_DAWNFORGE_2 = -1000130, + SAY_PATHALEON_THE_CALCULATOR_IMAGE_1 = -1000131, + SAY_COMMANDER_DAWNFORGE_3 = -1000132, + SAY_PATHALEON_THE_CALCULATOR_IMAGE_2 = -1000133, + SAY_PATHALEON_THE_CALCULATOR_IMAGE_2_1 = -1000134, + SAY_PATHALEON_THE_CALCULATOR_IMAGE_2_2 = -1000135, + SAY_COMMANDER_DAWNFORGE_4 = -1000136, + SAY_ARCANIST_ARDONIS_2 = -1000136, + SAY_COMMANDER_DAWNFORGE_5 = -1000137, + + QUEST_INFO_GATHERING = 10198, + SPELL_SUNFURY_DISGUISE = 34603, + + NPC_ARCANIST_ARDONIS = 19830, + NPC_COMMANDER_DAWNFORGE = 19831, + NPC_PATHALEON_THE_CALCULATOR_IMAGE = 21504 +}; + +struct MANGOS_DLL_DECL npc_commander_dawnforgeAI : public ScriptedAI +{ + npc_commander_dawnforgeAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset (); } + + uint64 m_uiPlayerGUID; + uint64 m_uiArdonisGUID; + uint64 m_uiPathaleonGUID; + + uint32 m_uiPhase; + uint32 m_uiPhaseSubphase; + uint32 m_uiPhaseTimer; + bool m_bIsEvent; + + void Reset() + { + m_uiPlayerGUID = 0; + m_uiArdonisGUID = 0; + m_uiPathaleonGUID = 0; + + m_uiPhase = 1; + m_uiPhaseSubphase = 0; + m_uiPhaseTimer = 4000; + m_bIsEvent = false; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_PATHALEON_THE_CALCULATOR_IMAGE) + m_uiPathaleonGUID = pSummoned->GetGUID(); + } + + void TurnToPathaleonsImage() + { + Creature* pArdonis = m_creature->GetMap()->GetCreature(m_uiArdonisGUID); + Creature* pPathaleon = m_creature->GetMap()->GetCreature(m_uiPathaleonGUID); + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pArdonis || !pPathaleon || !pPlayer) + return; + + m_creature->SetFacingToObject(pPathaleon); + pArdonis->SetFacingToObject(pPathaleon); + + // the boss is there kneel before him + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + pArdonis->SetStandState(UNIT_STAND_STATE_KNEEL); + } + + void TurnToEachOther() + { + if (Creature* pArdonis = m_creature->GetMap()->GetCreature(m_uiArdonisGUID)) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pPlayer) + return; + + m_creature->SetFacingToObject(pArdonis); + pArdonis->SetFacingToObject(m_creature); + + // get up + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + pArdonis->SetStandState(UNIT_STAND_STATE_STAND); + } + } + + bool CanStartEvent(Player* pPlayer) + { + if (!m_bIsEvent) + { + Creature* pArdonis = GetClosestCreatureWithEntry(m_creature, NPC_ARCANIST_ARDONIS, 10.0f); + + if (!pArdonis) + return false; + + m_uiArdonisGUID = pArdonis->GetGUID(); + m_uiPlayerGUID = pPlayer->GetGUID(); + + m_bIsEvent = true; + + TurnToEachOther(); + return true; + } + + debug_log("SD2: npc_commander_dawnforge event already in progress, need to wait."); + return false; + } + + void UpdateAI(const uint32 uiDiff) + { + // Is event even running? + if (!m_bIsEvent) + return; + + // Phase timing + if (m_uiPhaseTimer >= uiDiff) + { + m_uiPhaseTimer -= uiDiff; + return; + } + + Creature* pArdonis = m_creature->GetMap()->GetCreature(m_uiArdonisGUID); + Creature* pPathaleon = m_creature->GetMap()->GetCreature(m_uiPathaleonGUID); + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pArdonis || !pPlayer) + { + Reset(); + return; + } + + if (m_uiPhase > 4 && !pPathaleon) + { + Reset(); + return; + } + + switch (m_uiPhase) + { + case 1: + DoScriptText(SAY_COMMANDER_DAWNFORGE_1, m_creature); + ++m_uiPhase; + m_uiPhaseTimer = 16000; + break; + case 2: + DoScriptText(SAY_ARCANIST_ARDONIS_1, pArdonis); + ++m_uiPhase; + m_uiPhaseTimer = 16000; + break; + case 3: + DoScriptText(SAY_COMMANDER_DAWNFORGE_2, m_creature); + ++m_uiPhase; + m_uiPhaseTimer = 16000; + break; + case 4: + // spawn pathaleon's image + m_creature->SummonCreature(NPC_PATHALEON_THE_CALCULATOR_IMAGE, 2325.851563f, 2799.534668f, 133.084229f, 6.038996f, TEMPSUMMON_TIMED_DESPAWN, 90000); + ++m_uiPhase; + m_uiPhaseTimer = 500; + break; + case 5: + DoScriptText(SAY_PATHALEON_THE_CALCULATOR_IMAGE_1, pPathaleon); + ++m_uiPhase; + m_uiPhaseTimer = 6000; + break; + case 6: + switch(m_uiPhaseSubphase) + { + case 0: + TurnToPathaleonsImage(); + ++m_uiPhaseSubphase; + m_uiPhaseTimer = 8000; + break; + case 1: + DoScriptText(SAY_COMMANDER_DAWNFORGE_3, m_creature); + m_uiPhaseSubphase = 0; + ++m_uiPhase; + m_uiPhaseTimer = 8000; + break; + } + break; + case 7: + switch(m_uiPhaseSubphase) + { + case 0: + DoScriptText(SAY_PATHALEON_THE_CALCULATOR_IMAGE_2, pPathaleon); + ++m_uiPhaseSubphase; + m_uiPhaseTimer = 12000; + break; + case 1: + DoScriptText(SAY_PATHALEON_THE_CALCULATOR_IMAGE_2_1, pPathaleon); + ++m_uiPhaseSubphase; + m_uiPhaseTimer = 16000; + break; + case 2: + DoScriptText(SAY_PATHALEON_THE_CALCULATOR_IMAGE_2_2, pPathaleon); + m_uiPhaseSubphase = 0; + ++m_uiPhase; + m_uiPhaseTimer = 10000; + break; + } + break; + case 8: + DoScriptText(SAY_COMMANDER_DAWNFORGE_4, m_creature); + DoScriptText(SAY_ARCANIST_ARDONIS_2, pArdonis); + ++m_uiPhase; + m_uiPhaseTimer = 4000; + break; + case 9: + TurnToEachOther(); + // hide pathaleon, unit will despawn shortly + pPathaleon->SetVisibility(VISIBILITY_OFF); + m_uiPhaseSubphase = 0; + ++m_uiPhase; + m_uiPhaseTimer = 3000; + break; + case 10: + DoScriptText(SAY_COMMANDER_DAWNFORGE_5, m_creature); + pPlayer->AreaExploredOrEventHappens(QUEST_INFO_GATHERING); + Reset(); + break; + } + } +}; + +CreatureAI* GetAI_npc_commander_dawnforge(Creature* pCreature) +{ + return new npc_commander_dawnforgeAI(pCreature); +} + +bool AreaTrigger_at_commander_dawnforge(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + // if player lost aura or not have at all, we should not try start event. + if (!pPlayer->HasAura(SPELL_SUNFURY_DISGUISE, EFFECT_INDEX_0)) + return false; + + if (pPlayer->isAlive() && pPlayer->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE) + { + Creature* pDawnforge = GetClosestCreatureWithEntry(pPlayer, NPC_COMMANDER_DAWNFORGE, 30.0f); + + if (!pDawnforge) + return false; + + if (npc_commander_dawnforgeAI* pDawnforgeAI = dynamic_cast(pDawnforge->AI())) + { + pDawnforgeAI->CanStartEvent(pPlayer); + return true; + } + + + } + return false; +} + +/*###### +## npc_protectorate_nether_drake +######*/ + +enum +{ + QUEST_NETHER_WINGS = 10438, + ITEM_PH_DISRUPTOR = 29778, + TAXI_PATH_ID = 627 //(possibly 627+628(152->153->154->155)) +}; + +#define GOSSIP_ITEM_FLY_ULTRIS "Fly me to Ultris" + +bool GossipHello_npc_protectorate_nether_drake(Player* pPlayer, Creature* pCreature) +{ + // On Nethery Wings + if (pPlayer->GetQuestStatus(QUEST_NETHER_WINGS) == QUEST_STATUS_INCOMPLETE && pPlayer->HasItemCount(ITEM_PH_DISRUPTOR, 1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLY_ULTRIS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_protectorate_nether_drake(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); + } + return true; +} + +/*###### +## npc_veronia +######*/ + +enum +{ + QUEST_BEHIND_ENEMY_LINES = 10652, + SPELL_STEALTH_FLIGHT = 34905 +}; + +#define GOSSIP_ITEM_FLY_CORUU "Fly me to Manaforge Coruu please" + +bool GossipHello_npc_veronia(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + // Behind Enemy Lines + if (pPlayer->GetQuestStatus(QUEST_BEHIND_ENEMY_LINES) && !pPlayer->GetQuestRewardStatus(QUEST_BEHIND_ENEMY_LINES)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_FLY_CORUU, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_veronia(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_STEALTH_FLIGHT, true);//TaxiPath 606 + } + return true; +} + +/*###### +## npc_bessy +######*/ + +enum +{ + QUEST_COWS_COME_HOME = 10337, + + NPC_THADELL = 20464, + NPC_TORMENTED_SOUL = 20512, + NPC_SEVERED_SPIRIT = 19881 +}; + +struct MANGOS_DLL_DECL npc_bessyAI : public npc_escortAI +{ + npc_bessyAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 3: + m_creature->SummonCreature(NPC_TORMENTED_SOUL, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(NPC_TORMENTED_SOUL, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(NPC_TORMENTED_SOUL, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 7: + m_creature->SummonCreature(NPC_SEVERED_SPIRIT, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + m_creature->SummonCreature(NPC_SEVERED_SPIRIT, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 12: + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_COWS_COME_HOME, m_creature); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void Reset() {} +}; + +bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_COWS_COME_HOME) + { + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (npc_bessyAI* pBessyAI = dynamic_cast(pCreature->AI())) + pBessyAI->Start(true, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_bessy(Creature* pCreature) +{ + return new npc_bessyAI(pCreature); +} + +void AddSC_netherstorm() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "go_manaforge_control_console"; + pNewScript->pGOHello = &GOHello_go_manaforge_control_console; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_manaforge_control_console"; + pNewScript->GetAI = &GetAI_npc_manaforge_control_console; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_commander_dawnforge"; + pNewScript->GetAI = GetAI_npc_commander_dawnforge; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_commander_dawnforge"; + pNewScript->pAreaTrigger = &AreaTrigger_at_commander_dawnforge; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_protectorate_nether_drake"; + pNewScript->pGossipHello = &GossipHello_npc_protectorate_nether_drake; + pNewScript->pGossipSelect = &GossipSelect_npc_protectorate_nether_drake; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_veronia"; + pNewScript->pGossipHello = &GossipHello_npc_veronia; + pNewScript->pGossipSelect = &GossipSelect_npc_veronia; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "npc_bessy"; + pNewScript->GetAI = &GetAI_npc_bessy; + pNewScript->pQuestAccept = &QuestAccept_npc_bessy; + pNewScript->RegisterSelf(); +} diff --git a/scripts/outland/shadowmoon_valley.cpp b/scripts/outland/shadowmoon_valley.cpp new file mode 100644 index 0000000..47aeb87 --- /dev/null +++ b/scripts/outland/shadowmoon_valley.cpp @@ -0,0 +1,1345 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Shadowmoon_Valley +SD%Complete: 100 +SDComment: Quest support: 10519, 10583, 10601, 10781, 10814, 10804, 10854, 11082. Vendor Drake Dealer Hurlunk. +SDCategory: Shadowmoon Valley +EndScriptData */ + +/* ContentData +mob_mature_netherwing_drake +mob_enslaved_netherwing_drake +npc_drake_dealer_hurlunk +npcs_flanis_swiftwing_and_kagrosh +npc_murkblood_overseer +npc_neltharaku +npc_karynaku +npc_oronok_tornheart +npc_wilda +mob_torloth +npc_lord_illidan_stormrage +go_crystal_prison +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*##### +# mob_mature_netherwing_drake +#####*/ + +enum +{ + SAY_JUST_EATEN = -1000175, + + SPELL_PLACE_CARCASS = 38439, + SPELL_JUST_EATEN = 38502, + SPELL_NETHER_BREATH = 38467, + POINT_ID = 1, + + QUEST_KINDNESS = 10804, + NPC_EVENT_PINGER = 22131 +}; + +struct MANGOS_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI +{ + mob_mature_netherwing_drakeAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint64 uiPlayerGUID; + + bool bCanEat; + bool bIsEating; + + uint32 EatTimer; + uint32 CastTimer; + + void Reset() + { + uiPlayerGUID = 0; + + bCanEat = false; + bIsEating = false; + + EatTimer = 5000; + CastTimer = 5000; + } + + void SpellHit(Unit* pCaster, SpellEntry const* pSpell) + { + if (bCanEat || bIsEating) + return; + + if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_PLACE_CARCASS && !m_creature->HasAura(SPELL_JUST_EATEN)) + { + uiPlayerGUID = pCaster->GetGUID(); + bCanEat = true; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == POINT_ID) + { + bIsEating = true; + EatTimer = 7000; + m_creature->HandleEmote(EMOTE_ONESHOT_ATTACKUNARMED); + } + } + + void UpdateAI(const uint32 diff) + { + if (bCanEat || bIsEating) + { + if (EatTimer < diff) + { + if (bCanEat && !bIsEating) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(uiPlayerGUID)) + { + if (GameObject* pGo = pPlayer->GetGameObject(SPELL_PLACE_CARCASS)) + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->StopMoving(); + + m_creature->GetMotionMaster()->MovePoint(POINT_ID, pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ()); + } + } + bCanEat = false; + } + else if (bIsEating) + { + DoCastSpellIfCan(m_creature, SPELL_JUST_EATEN); + DoScriptText(SAY_JUST_EATEN, m_creature); + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(uiPlayerGUID)) + pPlayer->KilledMonsterCredit(NPC_EVENT_PINGER, m_creature->GetGUID()); + + Reset(); + m_creature->GetMotionMaster()->Clear(); + } + } + else + EatTimer -= diff; + + return; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (CastTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_NETHER_BREATH); + CastTimer = 5000; + }else CastTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_mature_netherwing_drake(Creature* pCreature) +{ + return new mob_mature_netherwing_drakeAI(pCreature); +} + +/*### +# mob_enslaved_netherwing_drake +####*/ + +enum +{ + FACTION_DEFAULT = 62, + FACTION_FRIENDLY = 1840, // Not sure if this is correct, it was taken off of Mordenai. + + SPELL_HIT_FORCE_OF_NELTHARAKU = 38762, + SPELL_FORCE_OF_NELTHARAKU = 38775, + + QUEST_FORCE_OF_NELT = 10854, + NPC_DRAGONMAW_SUBJUGATOR = 21718, + NPC_ESCAPE_DUMMY = 21348 +}; + +struct MANGOS_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI +{ + mob_enslaved_netherwing_drakeAI(Creature* pCreature) : ScriptedAI(pCreature) + { + PlayerGUID = 0; + Tapped = false; + Reset(); + } + + uint64 PlayerGUID; + uint32 FlyTimer; + bool Tapped; + + void Reset() + { + if (!Tapped) + m_creature->setFaction(FACTION_DEFAULT); + + FlyTimer = 2500; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_HIT_FORCE_OF_NELTHARAKU && !Tapped) + { + if (Player* pPlayer = pCaster->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + Tapped = true; + PlayerGUID = pPlayer->GetGUID(); + + m_creature->setFaction(FACTION_FRIENDLY); + + if (Creature* pDragonmaw = GetClosestCreatureWithEntry(m_creature, NPC_DRAGONMAW_SUBJUGATOR, 50.0f)) + AttackStart(pDragonmaw); + } + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + m_creature->ForcedDespawn(); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (Tapped) + { + if (FlyTimer <= diff) + { + Tapped = false; + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(PlayerGUID)) + { + if (pPlayer->GetQuestStatus(QUEST_FORCE_OF_NELT) == QUEST_STATUS_INCOMPLETE) + { + DoCastSpellIfCan(pPlayer, SPELL_FORCE_OF_NELTHARAKU, CAST_TRIGGERED); + PlayerGUID = 0; + + float dx, dy, dz; + + if (Creature* EscapeDummy = GetClosestCreatureWithEntry(m_creature, NPC_ESCAPE_DUMMY, 30.0f)) + EscapeDummy->GetPosition(dx, dy, dz); + else + { + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 20, dx, dy, dz); + dz += 25; + } + + m_creature->GetMotionMaster()->MovePoint(1, dx, dy, dz); + } + } + } + else + FlyTimer -= diff; + } + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_enslaved_netherwing_drake(Creature* pCreature) +{ + return new mob_enslaved_netherwing_drakeAI(pCreature); +} + +/*##### +# mob_dragonmaw_peon +#####*/ + +enum +{ + SPELL_SERVING_MUTTON = 40468, + NPC_DRAGONMAW_KILL_CREDIT = 23209, + QUEST_SLOW_DEATH = 11020, + POINT_DEST = 1 +}; + +struct MANGOS_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI +{ + mob_dragonmaw_peonAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint64 m_uiPlayerGUID; + bool m_bIsTapped; + uint32 m_uiPoisonTimer; + + void Reset() + { + m_uiPlayerGUID = 0; + m_bIsTapped = false; + m_uiPoisonTimer = 0; + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (!pCaster) + return; + + if (pCaster->GetTypeId() == TYPEID_PLAYER && pSpell->Id == SPELL_SERVING_MUTTON && !m_bIsTapped) + { + m_uiPlayerGUID = pCaster->GetGUID(); + + m_bIsTapped = true; + + float fX, fY, fZ; + pCaster->GetClosePoint(fX, fY, fZ, m_creature->GetObjectBoundingRadius()); + + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + m_creature->GetMotionMaster()->MovePoint(POINT_DEST, fX, fY, fZ); + } + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE) + return; + + if (uiPointId == POINT_DEST) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_EAT); + m_uiPoisonTimer = 15000; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiPoisonTimer) + { + if (m_uiPoisonTimer <= uiDiff) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + if (pPlayer->GetQuestStatus(QUEST_SLOW_DEATH) == QUEST_STATUS_INCOMPLETE) + pPlayer->KilledMonsterCredit(NPC_DRAGONMAW_KILL_CREDIT, m_creature->GetGUID()); + } + + m_uiPoisonTimer = 0; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + else + m_uiPoisonTimer -= uiDiff; + } + } +}; + +/*###### +## npc_drake_dealer_hurlunk +######*/ + +bool GossipHello_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isVendor() && pPlayer->GetReputationRank(1015) == REP_EXALTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_drake_dealer_hurlunk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_flanis_swiftwing_and_kagrosh +######*/ + +bool GossipHello_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(10583) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30658,1,true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Take Flanis's Pack", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (pPlayer->GetQuestStatus(10601) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(30659,1,true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Take Kagrosh's Pack", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_flanis_swiftwing_and_kagrosh(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(30658, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + + pPlayer->CLOSE_GOSSIP_MENU(); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(30659, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + + pPlayer->CLOSE_GOSSIP_MENU(); + } + return true; +} + +/*###### +## npc_murkblood_overseer +######*/ + +#define QUEST_11082 11082 + +bool GossipHello_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_11082) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I am here for you, overseer.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_murkblood_overseer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "How dare you question an overseer of the Dragonmaw!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Who speaks of me? What are you talking about, broken?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Continue please.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Who are these bidders?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Well... yes.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + //correct id not known + pPlayer->SEND_GOSSIP_MENU(10940, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer,41121,false); + pPlayer->AreaExploredOrEventHappens(QUEST_11082); + break; + } + return true; +} + +/*###### +## npc_neltharaku +######*/ + +bool GossipHello_npc_neltharaku(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(10814) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I am listening, dragon", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(10613, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_neltharaku(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "But you are dragons! How could orcs do this to you?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(10614, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Your mate?", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(10615, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I have battled many beasts, dragon. I will help you.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(10616, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(10814); + break; + } + return true; +} + +/*###### +## npc_oronok +######*/ + +#define GOSSIP_ORONOK1 "I am ready to hear your story, Oronok." +#define GOSSIP_ORONOK2 "How do I find the cipher?" +#define GOSSIP_ORONOK3 "How do you know all of this?" +#define GOSSIP_ORONOK4 "Yet what? What is it, Oronok?" +#define GOSSIP_ORONOK5 "Continue, please." +#define GOSSIP_ORONOK6 "So what of the cipher now? And your boys?" +#define GOSSIP_ORONOK7 "I will find your boys and the cipher, Oronok." + +bool GossipHello_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(10312, pCreature->GetGUID()); + }else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_oronok_tornheart(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10313, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(10314, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(10315, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(10316, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(10317, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(10318, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->AreaExploredOrEventHappens(10519); + break; + } + return true; +} + +/*#### +# npc_karynaku +####*/ + +enum +{ + QUEST_ALLY_OF_NETHER = 10870, + TAXI_PATH_ID = 649 +}; + +bool QuestAccept_npc_karynaku(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ALLY_OF_NETHER) + pPlayer->ActivateTaxiPathTo(TAXI_PATH_ID); + + return true; +} + +/*###### +# npc_wilda +######*/ + +enum +{ + SAY_WIL_START = -1000381, + SAY_WIL_AGGRO1 = -1000382, + SAY_WIL_AGGRO2 = -1000383, + SAY_WIL_PROGRESS1 = -1000384, + SAY_WIL_PROGRESS2 = -1000385, + SAY_WIL_FIND_EXIT = -1000386, + SAY_WIL_PROGRESS4 = -1000387, + SAY_WIL_PROGRESS5 = -1000388, + SAY_WIL_JUST_AHEAD = -1000389, + SAY_WIL_END = -1000390, + + SPELL_CHAIN_LIGHTNING = 16006, + SPELL_EARTHBING_TOTEM = 15786, + SPELL_FROST_SHOCK = 12548, + SPELL_HEALING_WAVE = 12491, + + QUEST_ESCAPE_COILSCAR = 10451, + NPC_COILSKAR_ASSASSIN = 21044, + FACTION_EARTHEN = 1726 //guessed +}; + +//this script needs verification +struct MANGOS_DLL_DECL npc_wildaAI : public npc_escortAI +{ + npc_wildaAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + uint32 m_uiHealingTimer; + + void Reset() + { + m_uiHealingTimer = 0; + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) + { + case 13: + DoScriptText(SAY_WIL_PROGRESS1, m_creature, pPlayer); + DoSpawnAssassin(); + break; + case 14: + DoSpawnAssassin(); + break; + case 15: + DoScriptText(SAY_WIL_FIND_EXIT, m_creature, pPlayer); + break; + case 19: + DoRandomSay(); + break; + case 20: + DoSpawnAssassin(); + break; + case 26: + DoRandomSay(); + break; + case 27: + DoSpawnAssassin(); + break; + case 33: + DoRandomSay(); + break; + case 34: + DoSpawnAssassin(); + break; + case 37: + DoRandomSay(); + break; + case 38: + DoSpawnAssassin(); + break; + case 39: + DoScriptText(SAY_WIL_JUST_AHEAD, m_creature, pPlayer); + break; + case 43: + DoRandomSay(); + break; + case 44: + DoSpawnAssassin(); + break; + case 50: + DoScriptText(SAY_WIL_END, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, m_creature); + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_COILSKAR_ASSASSIN) + pSummoned->AI()->AttackStart(m_creature); + } + + //this is very unclear, random say without no real relevance to script/event + void DoRandomSay() + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_WIL_PROGRESS2, m_creature); break; + case 1: DoScriptText(SAY_WIL_PROGRESS4, m_creature); break; + case 2: DoScriptText(SAY_WIL_PROGRESS5, m_creature); break; + } + } + + void DoSpawnAssassin() + { + //unknown where they actually appear + float fX, fY, fZ; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 15.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_COILSKAR_ASSASSIN, fX, fY, fZ, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + void Aggro(Unit* pWho) + { + //don't always use + if (urand(0, 4)) + return; + + //only aggro text if not player + if (pWho->GetTypeId() != TYPEID_PLAYER) + { + //appears to be random + switch(urand(0, 3)) + { + case 0: DoScriptText(SAY_WIL_AGGRO1, m_creature, pWho); break; + case 1: DoScriptText(SAY_WIL_AGGRO2, m_creature, pWho); break; + } + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //TODO: add more abilities + if (m_creature->GetHealthPercent() <= 30.0f) + { + if (m_uiHealingTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_HEALING_WAVE); + m_uiHealingTimer = 15000; + } + else + m_uiHealingTimer -= uiDiff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_wilda(Creature* pCreature) +{ + return new npc_wildaAI(pCreature); +} + +bool QuestAccept_npc_wilda(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPE_COILSCAR) + { + DoScriptText(SAY_WIL_START, pCreature, pPlayer); + pCreature->setFaction(FACTION_EARTHEN); + + if (npc_wildaAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +/*##### +# Quest: Battle of the Crimson Watch +#####*/ + +enum +{ + QUEST_BATTLE_OF_THE_CRIMSON_WATCH = 10781, + + EVENT_COOLDOWN = 30000, + + SAY_TORLOTH_DIALOGUE1 = -1000532, + SAY_TORLOTH_DIALOGUE2 = -1000533, + SAY_TORLOTH_DIALOGUE3 = -1000534, + SAY_ILLIDAN_DIALOGUE = -1000535, + SAY_ILLIDAN_SUMMON1 = -1000536, + SAY_ILLIDAN_SUMMON2 = -1000537, + SAY_ILLIDAN_SUMMON3 = -1000538, + SAY_ILLIDAN_SUMMON4 = -1000539, + SAY_EVENT_COMPLETED = -1000540, + + MODEL_ID_FELGUARD = 18654, + MODEL_ID_DREADLORD = 19991, + + NPC_ILLIDARI_SOLDIER = 22075, + NPC_ILLIDARI_MIND_BREAKER = 22074, + NPC_ILLIDARI_HIGHLORD = 19797, + NPC_TORLOTH_THE_MAGNIFICENT = 22076, + NPC_LORD_ILLIDAN = 22083 +}; + +enum CinematicCreature +{ + LORD_ILLIDAN = 1, + TORLOTH = 0 +}; + +const float EVENT_AREA_RADIUS = 65.0; + +struct TorlothCinematic +{ + int32 iTextId; + uint32 uiCreature; + uint32 uiTimer; +}; + +static TorlothCinematic TorlothAnim[]= +{ + {SAY_TORLOTH_DIALOGUE1, TORLOTH, 2000}, + {SAY_ILLIDAN_DIALOGUE, LORD_ILLIDAN, 7000}, + {SAY_TORLOTH_DIALOGUE2, TORLOTH, 3000}, + {0, TORLOTH, 2000}, // Torloth stand + {SAY_TORLOTH_DIALOGUE3, TORLOTH, 1000}, + {0, TORLOTH, 3000}, + {0, TORLOTH, 0} +}; + +struct Location +{ + float fLocX; + float fLocY; + float fLocZ; + float fOrient; +}; + +static Location SpawnLocation[]= +{ + {-4615.8556f, 1342.2532f, 139.9f, 1.612f}, // Illidari Soldier + {-4598.9365f, 1377.3182f, 139.9f, 3.917f}, // Illidari Soldier + {-4598.4697f, 1360.8999f, 139.9f, 2.427f}, // Illidari Soldier + {-4589.3599f, 1369.1061f, 139.9f, 3.165f}, // Illidari Soldier + {-4608.3477f, 1386.0076f, 139.9f, 4.108f}, // Illidari Soldier + {-4633.1889f, 1359.8033f, 139.9f, 0.949f}, // Illidari Soldier + {-4623.5791f, 1351.4574f, 139.9f, 0.971f}, // Illidari Soldier + {-4607.2988f, 1351.6099f, 139.9f, 2.416f}, // Illidari Soldier + {-4633.7764f, 1376.0417f, 139.9f, 5.608f}, // Illidari Soldier + {-4600.2461f, 1369.1240f, 139.9f, 3.056f}, // Illidari Mind Breaker + {-4631.7808f, 1367.9459f, 139.9f, 0.020f}, // Illidari Mind Breaker + {-4600.2461f, 1369.1240f, 139.9f, 3.056f}, // Illidari Highlord + {-4631.7808f, 1367.9459f, 139.9f, 0.020f}, // Illidari Highlord + {-4615.5586f, 1353.0031f, 139.9f, 1.540f}, // Illidari Highlord + {-4616.4736f, 1384.2170f, 139.9f, 4.971f}, // Illidari Highlord + {-4627.1240f, 1378.8752f, 139.9f, 2.544f} // Torloth The Magnificent +}; + +struct WaveData +{ + uint8 uiSpawnCount; + uint8 uiUsedSpawnPoint; + uint32 uiCreatureId; + uint32 uiSpawnTimer; + uint32 uiYellTimer; + int32 iTextId; +}; + +static WaveData WavesInfo[]= +{ + // Illidari Soldier + {9, 0, NPC_ILLIDARI_SOLDIER, 10000, 7000, SAY_ILLIDAN_SUMMON1}, + // Illidari Mind Breaker + {2, 9, NPC_ILLIDARI_MIND_BREAKER, 10000, 7000, SAY_ILLIDAN_SUMMON2}, + // Illidari Highlord + {4, 11, NPC_ILLIDARI_HIGHLORD, 10000, 7000, SAY_ILLIDAN_SUMMON3}, + // Torloth The Magnificent + {1, 15, NPC_TORLOTH_THE_MAGNIFICENT, 10000, 7000, SAY_ILLIDAN_SUMMON4} +}; + +/*###### +# mob_torloth +#####*/ + +enum +{ + SPELL_CLEAVE = 15284, + SPELL_SHADOWFURY = 39082, + SPELL_SPELL_REFLECTION = 33961 +}; + +struct MANGOS_DLL_DECL mob_torlothAI : public ScriptedAI +{ + mob_torlothAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 m_uiLordIllidanGUID; + uint64 m_uiPlayerGUID; + + uint32 m_uiCleaveTimer; + uint32 m_uiShadowfuryTimer; + uint32 m_uiSpellReflectionTimer; + uint8 m_uiAnimationCount; + uint32 m_uiAnimationTimer; + + void Reset() + { + m_uiLordIllidanGUID = 0; + m_uiPlayerGUID = 0; + + m_uiAnimationCount = 0; + m_uiAnimationTimer = 4000; + m_uiCleaveTimer = 10000; + m_uiShadowfuryTimer = 18000; + m_uiSpellReflectionTimer = 25000; + + // make him not attackable for the time of animation + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + SetCombatMovement(false); + } + + void EnterEvadeMode() + { + m_creature->ForcedDespawn(); + } + + void HandleAnimation() + { + Creature* pCreature = m_creature; + + if (TorlothAnim[m_uiAnimationCount].uiCreature == LORD_ILLIDAN) + { + pCreature = m_creature->GetMap()->GetCreature(m_uiLordIllidanGUID); + + if (!pCreature) + { + m_creature->ForcedDespawn(); + return; + } + } + + if (TorlothAnim[m_uiAnimationCount].iTextId) + DoScriptText(TorlothAnim[m_uiAnimationCount].iTextId, pCreature); + + m_uiAnimationTimer = TorlothAnim[m_uiAnimationCount].uiTimer; + + switch(m_uiAnimationCount) + { + case 0: + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + break; + case 3: + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + break; + case 5: + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + m_creature->AddThreat(pTarget); + m_creature->SetFacingToObject(pTarget); + m_creature->HandleEmote(EMOTE_ONESHOT_POINT); + } + break; + case 6: + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + SetCombatMovement(true); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + float fLocX, fLocY, fLocZ; + pTarget->GetPosition(fLocX, fLocY, fLocZ); + m_creature->GetMotionMaster()->MovePoint(0, fLocX, fLocY, fLocZ); + } + break; + } + } + + ++m_uiAnimationCount; + } + + void JustDied(Unit* pKiller) + { + if (Player* pPlayer = pKiller->GetCharmerOrOwnerPlayerOrPlayerItself()) + { + pPlayer->GroupEventHappens(QUEST_BATTLE_OF_THE_CRIMSON_WATCH, m_creature); + + if (Creature* pLordIllidan = m_creature->GetMap()->GetCreature(m_uiLordIllidanGUID)) + { + DoScriptText(SAY_EVENT_COMPLETED, pLordIllidan, pPlayer); + pLordIllidan->AI()->EnterEvadeMode(); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiAnimationCount < 7) + { + if (m_uiAnimationTimer < uiDiff) + HandleAnimation(); + else + m_uiAnimationTimer -= uiDiff; + } + else + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCleaveTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 15000; + } + else + m_uiCleaveTimer -= uiDiff; + + if (m_uiShadowfuryTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SHADOWFURY); + m_uiShadowfuryTimer = 20000; + } + else + m_uiShadowfuryTimer -= uiDiff; + + if (m_uiSpellReflectionTimer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SPELL_REFLECTION); + m_uiSpellReflectionTimer = 30000; + } + else + m_uiSpellReflectionTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_mob_torloth(Creature* pCreature) +{ + return new mob_torlothAI(pCreature); +} + +/*##### +# npc_lord_illidan_stormrage +#####*/ + +struct MANGOS_DLL_DECL npc_lord_illidan_stormrageAI : public Scripted_NoMovementAI +{ + npc_lord_illidan_stormrageAI(Creature* pCreature) : Scripted_NoMovementAI(pCreature) {Reset();} + + uint64 m_uiPlayerGUID; + uint32 m_uiWaveTimer; + uint32 m_uiAnnounceTimer; + uint32 m_uiCheckTimer; + uint8 m_uiMobCount; + uint8 m_uiWaveCount; + + bool m_bEventStarted; + bool m_bEventFailed; + bool m_bWaveAnnounced; + + void Reset() + { + m_uiPlayerGUID = 0; + + m_uiWaveTimer = 10000; + m_uiAnnounceTimer = 7000; + m_uiCheckTimer = 2000; + + m_uiMobCount = 0; + m_uiWaveCount = 0; + + m_bEventStarted = false; + m_bEventFailed = false; + m_bWaveAnnounced = false; + } + + void StartEvent(Player* pPlayer) + { + m_bEventStarted = true; + m_uiPlayerGUID = pPlayer->GetGUID(); + } + + void SummonWave() + { + uint8 uiCount = WavesInfo[m_uiWaveCount].uiSpawnCount; + uint8 uiLocIndex = WavesInfo[m_uiWaveCount].uiUsedSpawnPoint; + uint8 uiFelguardCount = 0; + uint8 uiDreadlordCount = 0; + + for(uint8 i = 0; i < uiCount; ++i) + { + float fLocX, fLocY, fLocZ, fOrient; + fLocX = SpawnLocation[uiLocIndex + i].fLocX; + fLocY = SpawnLocation[uiLocIndex + i].fLocY; + fLocZ = SpawnLocation[uiLocIndex + i].fLocZ; + fOrient = SpawnLocation[uiLocIndex + i].fOrient; + + if (Creature* pSpawn = m_creature->SummonCreature(WavesInfo[m_uiWaveCount].uiCreatureId, fLocX, fLocY, fLocZ, fOrient, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000)) + { + + if (m_uiWaveCount) // only in first wave + continue; + + if (!urand(0,2) && uiFelguardCount < 2) + { + pSpawn->SetDisplayId(MODEL_ID_FELGUARD); + ++uiFelguardCount; + } + else if (uiDreadlordCount < 3) + { + pSpawn->SetDisplayId(MODEL_ID_DREADLORD); + ++uiDreadlordCount; + } + else if (uiFelguardCount < 2) + { + pSpawn->SetDisplayId(MODEL_ID_FELGUARD); + ++uiFelguardCount; + } + } + } + + ++m_uiWaveCount; + m_uiWaveTimer = WavesInfo[m_uiWaveCount].uiSpawnTimer; + m_uiAnnounceTimer = WavesInfo[m_uiWaveCount].uiYellTimer; + } + + void JustSummoned(Creature* pSummoned) + { + // increment mob count + ++m_uiMobCount; + + if (!m_uiPlayerGUID) + return; + + if (pSummoned->GetEntry() == NPC_TORLOTH_THE_MAGNIFICENT) + { + if (mob_torlothAI* pTorlothAI = dynamic_cast(pSummoned->AI())) + { + pTorlothAI->m_uiLordIllidanGUID = m_creature->GetGUID(); + pTorlothAI->m_uiPlayerGUID = m_uiPlayerGUID; + } + } + else + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + float fLocX, fLocY, fLocZ; + pTarget->GetPosition(fLocX, fLocY, fLocZ); + pSummoned->GetMotionMaster()->MovePoint(0, fLocX, fLocY, fLocZ); + } + } + } + + void SummonedCreatureDespawn(Creature* pCreature) + { + // decrement mob count + --m_uiMobCount; + + if (!m_uiMobCount) + m_bWaveAnnounced = false; + } + + void CheckEventFail() + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pPlayer) + return; + + if (Group* pEventGroup = pPlayer->GetGroup()) + { + uint8 uiDeadMemberCount = 0; + uint8 uiFailedMemberCount = 0; + + for(GroupReference* pRef = pEventGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (!pMember->isAlive()) + ++uiDeadMemberCount; + + // if we already failed no need to check other things + if (pMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_FAILED) + { + ++uiFailedMemberCount; + continue; + } + + // we left event area fail quest + if (!pMember->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS)) + { + pMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); + ++uiFailedMemberCount; + } + } + } + + if (pEventGroup->GetMembersCount() == uiFailedMemberCount) + { + m_bEventFailed = true; + return; + } + + if (pEventGroup->GetMembersCount() == uiDeadMemberCount) + { + for(GroupReference* pRef = pEventGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (pMember->GetQuestStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) == QUEST_STATUS_INCOMPLETE) + pMember->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); + } + } + + m_bEventFailed = true; + } + } + else if (pPlayer->isDead() || !pPlayer->IsWithinDistInMap(m_creature, EVENT_AREA_RADIUS)) + { + pPlayer->FailQuest(QUEST_BATTLE_OF_THE_CRIMSON_WATCH); + m_bEventFailed = true; + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_uiPlayerGUID || !m_bEventStarted) + return; + + if (!m_uiMobCount && m_uiWaveCount < 4) + { + if (!m_bWaveAnnounced && m_uiAnnounceTimer < uiDiff) + { + DoScriptText(WavesInfo[m_uiWaveCount].iTextId, m_creature); + m_bWaveAnnounced = true; + } + else + m_uiAnnounceTimer -= uiDiff; + + if (m_uiWaveTimer < uiDiff) + SummonWave(); + else + m_uiWaveTimer -= uiDiff; + } + + if (m_uiCheckTimer < uiDiff) + { + CheckEventFail(); + m_uiCheckTimer = 2000; + } + else + m_uiCheckTimer -= uiDiff; + + if (m_bEventFailed) + Reset(); + } +}; + +CreatureAI* GetAI_npc_lord_illidan_stormrage(Creature* (pCreature)) +{ + return new npc_lord_illidan_stormrageAI(pCreature); +} + +/*##### +# go_crystal_prison : GameObject that begins the event and hands out quest +######*/ +bool GOQuestAccept_GO_crystal_prison(Player* pPlayer, GameObject* pGo, Quest const* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_BATTLE_OF_THE_CRIMSON_WATCH ) + if (Creature* pLordIllidan = GetClosestCreatureWithEntry(pPlayer, NPC_LORD_ILLIDAN, 50.0)) + if (npc_lord_illidan_stormrageAI* pIllidanAI = dynamic_cast(pLordIllidan->AI())) + if (!pIllidanAI->m_bEventStarted) + pIllidanAI->StartEvent(pPlayer); + + return true; +} + +void AddSC_shadowmoon_valley() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_mature_netherwing_drake"; + newscript->GetAI = &GetAI_mob_mature_netherwing_drake; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_enslaved_netherwing_drake"; + newscript->GetAI = &GetAI_mob_enslaved_netherwing_drake; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_drake_dealer_hurlunk"; + newscript->pGossipHello = &GossipHello_npc_drake_dealer_hurlunk; + newscript->pGossipSelect = &GossipSelect_npc_drake_dealer_hurlunk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npcs_flanis_swiftwing_and_kagrosh"; + newscript->pGossipHello = &GossipHello_npcs_flanis_swiftwing_and_kagrosh; + newscript->pGossipSelect = &GossipSelect_npcs_flanis_swiftwing_and_kagrosh; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_murkblood_overseer"; + newscript->pGossipHello = &GossipHello_npc_murkblood_overseer; + newscript->pGossipSelect = &GossipSelect_npc_murkblood_overseer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_neltharaku"; + newscript->pGossipHello = &GossipHello_npc_neltharaku; + newscript->pGossipSelect = &GossipSelect_npc_neltharaku; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_karynaku"; + newscript->pQuestAccept = &QuestAccept_npc_karynaku; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_oronok_tornheart"; + newscript->pGossipHello = &GossipHello_npc_oronok_tornheart; + newscript->pGossipSelect = &GossipSelect_npc_oronok_tornheart; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_wilda"; + newscript->GetAI = &GetAI_npc_wilda; + newscript->pQuestAccept = &QuestAccept_npc_wilda; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lord_illidan_stormrage"; + newscript->GetAI = &GetAI_npc_lord_illidan_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_torloth"; + newscript->GetAI = &GetAI_mob_torloth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_crystal_prison"; + newscript->pGOQuestAccept = &GOQuestAccept_GO_crystal_prison; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/shattrath_city.cpp b/scripts/outland/shattrath_city.cpp new file mode 100644 index 0000000..0e1a409 --- /dev/null +++ b/scripts/outland/shattrath_city.cpp @@ -0,0 +1,901 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Shattrath_City +SD%Complete: 100 +SDComment: Quest support: 10004, 10009, 10211, 10231. Flask vendors, Teleport to Caverns of Time +SDCategory: Shattrath City +EndScriptData */ + +/* ContentData +npc_dirty_larry +npc_ishanah +npc_khadgar +npc_khadgars_servant +npc_raliq_the_drunk +npc_salsalabim +npc_shattrathflaskvendors +npc_zephyr +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +enum +{ + SAY_START = -1000274, + SAY_COUNT = -1000275, + SAY_COUNT_1 = -1000276, + SAY_COUNT_2 = -1000277, + SAY_ATTACK = -1000278, + SAY_GIVEUP = -1000279, + QUEST_WHAT_BOOK = 10231, + ENTRY_CREEPJACK = 19726, + ENTRY_MALONE = 19725, +}; + +#define GOSSIP_ITEM_BOOK "Ezekiel said that you might have a certain book..." + +struct MANGOS_DLL_DECL npc_dirty_larryAI : public ScriptedAI +{ + npc_dirty_larryAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNpcFlags = pCreature->GetUInt32Value(UNIT_NPC_FLAGS); + m_uiCreepjackGUID = 0; + m_uiMaloneGUID = 0; + Reset(); + } + + uint32 m_uiNpcFlags; + + uint64 m_uiCreepjackGUID; + uint64 m_uiMaloneGUID; + uint64 m_uiPlayerGUID; + + bool bEvent; + bool bActiveAttack; + + uint32 m_uiSayTimer; + uint32 m_uiStep; + + void Reset() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_uiNpcFlags); + + m_uiPlayerGUID = 0; + m_uiCreepjackGUID = 0; + m_uiMaloneGUID = 0; + + bEvent = false; + bActiveAttack = false; + + m_uiSayTimer = 1000; + m_uiStep = 0; + + //expect database to have correct faction (1194) and then only unit flags set/remove needed + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + } + + void SetRuffies(uint64 guid, bool bAttack, bool bReset) + { + Creature* pCreature = m_creature->GetMap()->GetCreature(guid); + + if (!pCreature) + return; + + if (bReset) + { + if (!pCreature->IsInEvadeMode() && pCreature->isAlive()) + pCreature->AI()->EnterEvadeMode(); + + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + } + else + { + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + + if (!pCreature->isAlive()) + return; + + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (bAttack) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + if (pPlayer->isAlive()) + pCreature->AI()->AttackStart(pPlayer); + } + } + } + } + + void StartEvent() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PASSIVE); + + if (Creature* pCreepjack = GetClosestCreatureWithEntry(m_creature, ENTRY_CREEPJACK, 20.0f)) + m_uiCreepjackGUID = pCreepjack->GetGUID(); + + if (Creature* pMalone = GetClosestCreatureWithEntry(m_creature, ENTRY_MALONE, 20.0f)) + m_uiMaloneGUID = pMalone->GetGUID(); + + bEvent = true; + } + + uint32 NextStep(uint32 uiStep) + { + Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID); + + if (!pPlayer) + { + SetRuffies(m_uiCreepjackGUID,false,true); + SetRuffies(m_uiMaloneGUID,false,true); + EnterEvadeMode(); + return 0; + } + + switch(uiStep) + { + case 1: + DoScriptText(SAY_START, m_creature, pPlayer); + SetRuffies(m_uiCreepjackGUID,false,false); + SetRuffies(m_uiMaloneGUID,false,false); + return 3000; + case 2: DoScriptText(SAY_COUNT, m_creature, pPlayer); return 5000; + case 3: DoScriptText(SAY_COUNT_1, m_creature, pPlayer); return 3000; + case 4: DoScriptText(SAY_COUNT_2, m_creature, pPlayer); return 3000; + case 5: DoScriptText(SAY_ATTACK, m_creature, pPlayer); return 3000; + case 6: + if (!m_creature->isInCombat() && pPlayer->isAlive()) + AttackStart(pPlayer); + + SetRuffies(m_uiCreepjackGUID,true,false); + SetRuffies(m_uiMaloneGUID,true,false); + bActiveAttack = true; + return 2000; + default: return 0; + } + } + + void DamageTaken(Unit* pDoneBy, uint32 &damage) + { + if (damage < m_creature->GetHealth()) + return; + + //damage will kill, this is pretty much the same as 1%HP left + if (bEvent) + { + damage = 0; + + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + DoScriptText(SAY_GIVEUP, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_WHAT_BOOK, m_creature); + } + + SetRuffies(m_uiCreepjackGUID,false,true); + SetRuffies(m_uiMaloneGUID,false,true); + EnterEvadeMode(); + } + } + + void UpdateAI(const uint32 diff) + { + if (bEvent && !bActiveAttack) + { + if (m_uiSayTimer < diff) + m_uiSayTimer = NextStep(++m_uiStep); + else + m_uiSayTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +bool GossipHello_npc_dirty_larry(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_WHAT_BOOK) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BOOK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_dirty_larry(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + if (npc_dirty_larryAI* pLarryAI = dynamic_cast(pCreature->AI())) + { + pLarryAI->m_uiPlayerGUID = pPlayer->GetGUID(); + pLarryAI->StartEvent(); + } + + pPlayer->CLOSE_GOSSIP_MENU(); + } + + return true; +} + +CreatureAI* GetAI_npc_dirty_larry(Creature* pCreature) +{ + return new npc_dirty_larryAI(pCreature); +} + +/*###### +## npc_ishanah +######*/ + +#define GOSSIP_ISHANAH_1 "Who are the Sha'tar?" +#define GOSSIP_ISHANAH_2 "Isn't Shattrath a draenei city? Why do you allow others here?" + +bool GossipHello_npc_ishanah(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ISHANAH_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ISHANAH_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_ishanah(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->SEND_GOSSIP_MENU(9458, pCreature->GetGUID()); + else if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + pPlayer->SEND_GOSSIP_MENU(9459, pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_khadgar +######*/ + +enum +{ + QUEST_CITY_LIGHT = 10211, +}; + +#define KHADGAR_GOSSIP_1 "I've heard your name spoken only in whispers, mage. Who are you?" +#define KHADGAR_GOSSIP_2 "Go on, please." +#define KHADGAR_GOSSIP_3 "I see." +#define KHADGAR_GOSSIP_4 "What did you do then?" +#define KHADGAR_GOSSIP_5 "What happened next?" +#define KHADGAR_GOSSIP_7 "There was something else I wanted to ask you." + +bool GossipHello_npc_khadgar(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestRewardStatus(QUEST_CITY_LIGHT)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_khadgar(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(9876, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(9877, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->SEND_GOSSIP_MENU(9878, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(9879, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(9880, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + pPlayer->SEND_GOSSIP_MENU(9881, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, KHADGAR_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(9243, pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## npc_khadgars_servant +######*/ + +enum +{ + SAY_KHAD_START = -1000489, + SAY_KHAD_SERV_0 = -1000234, + + SAY_KHAD_SERV_1 = -1000235, + SAY_KHAD_SERV_2 = -1000236, + SAY_KHAD_SERV_3 = -1000237, + SAY_KHAD_SERV_4 = -1000238, + + SAY_KHAD_SERV_5 = -1000239, + SAY_KHAD_SERV_6 = -1000240, + SAY_KHAD_SERV_7 = -1000241, + + SAY_KHAD_SERV_8 = -1000242, + SAY_KHAD_SERV_9 = -1000243, + SAY_KHAD_SERV_10 = -1000244, + SAY_KHAD_SERV_11 = -1000245, + + SAY_KHAD_SERV_12 = -1000246, + SAY_KHAD_SERV_13 = -1000247, + + SAY_KHAD_SERV_14 = -1000248, + SAY_KHAD_SERV_15 = -1000249, + SAY_KHAD_SERV_16 = -1000250, + SAY_KHAD_SERV_17 = -1000251, + + SAY_KHAD_SERV_18 = -1000252, + SAY_KHAD_SERV_19 = -1000253, + SAY_KHAD_SERV_20 = -1000254, + SAY_KHAD_SERV_21 = -1000255, + + SAY_KHAD_INJURED = -1000490, + SAY_KHAD_MIND_YOU = -1000491, + SAY_KHAD_MIND_ALWAYS = -1000492, + SAY_KHAD_ALDOR_GREET = -1000493, + SAY_KHAD_SCRYER_GREET = -1000494, + SAY_KHAD_HAGGARD = -1000495, + + NPC_KHADGAR = 18166, + NPC_SHANIR = 18597, + NPC_IZZARD = 18622, + NPC_ADYRIA = 18596, + NPC_ANCHORITE = 19142, + NPC_ARCANIST = 18547, + NPC_HAGGARD = 19684 +}; + +struct MANGOS_DLL_DECL npc_khadgars_servantAI : public npc_escortAI +{ + npc_khadgars_servantAI(Creature* pCreature) : npc_escortAI(pCreature) + { + if (pCreature->GetOwner() && pCreature->GetOwner()->GetTypeId() == TYPEID_PLAYER) + Start(false, pCreature->GetOwner()->GetGUID()); + else + error_log("SD2: npc_khadgars_servant can not obtain owner or owner is not a player."); + + Reset(); + } + + uint32 m_uiPointId; + uint32 m_uiTalkTimer; + uint32 m_uiTalkCount; + uint32 m_uiRandomTalkCooldown; + + void Reset() + { + m_uiTalkTimer = 2500; + m_uiTalkCount = 0; + m_uiPointId = 0; + m_uiRandomTalkCooldown = 0; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_uiRandomTalkCooldown && pWho->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(pWho, 10.0f)) + { + switch(pWho->GetEntry()) + { + case NPC_HAGGARD: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_KHAD_HAGGARD, pWho, pPlayer); + m_uiRandomTalkCooldown = 7500; + break; + case NPC_ANCHORITE: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_KHAD_ALDOR_GREET, pWho, pPlayer); + m_uiRandomTalkCooldown = 7500; + break; + case NPC_ARCANIST: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_KHAD_SCRYER_GREET, pWho, pPlayer); + m_uiRandomTalkCooldown = 7500; + break; + } + } + } + + void WaypointStart(uint32 uiPointId) + { + if (uiPointId == 2) + DoScriptText(SAY_KHAD_SERV_0, m_creature); + } + + void WaypointReached(uint32 uiPointId) + { + m_uiPointId = uiPointId; + + switch(uiPointId) + { + case 0: + if (Creature* pKhadgar = GetClosestCreatureWithEntry(m_creature, NPC_KHADGAR, 10.0f)) + DoScriptText(SAY_KHAD_START, pKhadgar); + break; + case 5: + case 24: + case 50: + case 63: + case 74: + case 75: + SetEscortPaused(true); + break; + case 34: + if (Creature* pIzzard = GetClosestCreatureWithEntry(m_creature, NPC_IZZARD, 10.0f)) + DoScriptText(SAY_KHAD_MIND_YOU, pIzzard); + break; + case 35: + if (Creature* pAdyria = GetClosestCreatureWithEntry(m_creature, NPC_ADYRIA, 10.0f)) + DoScriptText(SAY_KHAD_MIND_ALWAYS, pAdyria); + break; + } + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (m_uiRandomTalkCooldown) + { + if (m_uiRandomTalkCooldown <= uiDiff) + m_uiRandomTalkCooldown = 0; + else + m_uiRandomTalkCooldown -= uiDiff; + } + + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (m_uiTalkTimer <= uiDiff) + { + ++m_uiTalkCount; + m_uiTalkTimer = 7500; + + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(m_uiPointId) + { + case 5: //to lower city + { + switch(m_uiTalkCount) + { + case 1: + DoScriptText(SAY_KHAD_SERV_1, m_creature, pPlayer); + break; + case 2: + DoScriptText(SAY_KHAD_SERV_2, m_creature, pPlayer); + break; + case 3: + DoScriptText(SAY_KHAD_SERV_3, m_creature, pPlayer); + break; + case 4: + DoScriptText(SAY_KHAD_SERV_4, m_creature, pPlayer); + SetEscortPaused(false); + break; + } + break; + } + case 24: //in lower city + { + switch(m_uiTalkCount) + { + case 5: + if (Creature* pShanir = GetClosestCreatureWithEntry(m_creature, NPC_SHANIR, 15.0f)) + DoScriptText(SAY_KHAD_INJURED, pShanir, pPlayer); + + DoScriptText(SAY_KHAD_SERV_5, m_creature, pPlayer); + break; + case 6: + DoScriptText(SAY_KHAD_SERV_6, m_creature, pPlayer); + break; + case 7: + DoScriptText(SAY_KHAD_SERV_7, m_creature, pPlayer); + SetEscortPaused(false); + break; + } + break; + } + case 50: //outside + { + switch(m_uiTalkCount) + { + case 8: + DoScriptText(SAY_KHAD_SERV_8, m_creature, pPlayer); + break; + case 9: + DoScriptText(SAY_KHAD_SERV_9, m_creature, pPlayer); + break; + case 10: + DoScriptText(SAY_KHAD_SERV_10, m_creature, pPlayer); + break; + case 11: + DoScriptText(SAY_KHAD_SERV_11, m_creature, pPlayer); + SetEscortPaused(false); + break; + } + break; + } + case 63: //scryer + { + switch(m_uiTalkCount) + { + case 12: + DoScriptText(SAY_KHAD_SERV_12, m_creature, pPlayer); + break; + case 13: + DoScriptText(SAY_KHAD_SERV_13, m_creature, pPlayer); + SetEscortPaused(false); + break; + } + break; + } + case 74: //aldor + { + switch(m_uiTalkCount) + { + case 14: + DoScriptText(SAY_KHAD_SERV_14, m_creature, pPlayer); + break; + case 15: + DoScriptText(SAY_KHAD_SERV_15, m_creature, pPlayer); + break; + case 16: + DoScriptText(SAY_KHAD_SERV_16, m_creature, pPlayer); + break; + case 17: + DoScriptText(SAY_KHAD_SERV_17, m_creature, pPlayer); + SetEscortPaused(false); + break; + } + break; + } + case 75: //a'dal + { + switch(m_uiTalkCount) + { + case 18: + DoScriptText(SAY_KHAD_SERV_18, m_creature, pPlayer); + break; + case 19: + DoScriptText(SAY_KHAD_SERV_19, m_creature, pPlayer); + break; + case 20: + DoScriptText(SAY_KHAD_SERV_20, m_creature, pPlayer); + break; + case 21: + DoScriptText(SAY_KHAD_SERV_21, m_creature, pPlayer); + pPlayer->AreaExploredOrEventHappens(QUEST_CITY_LIGHT); + SetEscortPaused(false); + break; + } + break; + } + } + } + else + m_uiTalkTimer -= uiDiff; + } + } +}; + +CreatureAI* GetAI_npc_khadgars_servant(Creature* pCreature) +{ + return new npc_khadgars_servantAI(pCreature); +} + +/*###### +## npc_raliq_the_drunk +######*/ + +enum +{ + SPELL_UPPERCUT = 10966, + QUEST_CRACK_SKULLS = 10009, + FACTION_HOSTILE_RD = 45 +}; + +#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!" + +struct MANGOS_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI +{ + npc_raliq_the_drunkAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormFaction; + uint32 m_uiUppercut_Timer; + + void Reset() + { + m_uiUppercut_Timer = 5000; + + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiUppercut_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_UPPERCUT); + m_uiUppercut_Timer = 15000; + }else m_uiUppercut_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_raliq_the_drunk(Creature* pCreature) +{ + return new npc_raliq_the_drunkAI(pCreature); +} + +bool GossipHello_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(9440, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_raliq_the_drunk(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE_RD); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +# npc_salsalabim +######*/ + +#define FACTION_HOSTILE_SA 90 +#define FACTION_FRIENDLY_SA 35 +#define QUEST_10004 10004 + +#define SPELL_MAGNETIC_PULL 31705 + +struct MANGOS_DLL_DECL npc_salsalabimAI : public ScriptedAI +{ + npc_salsalabimAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + uint32 MagneticPull_Timer; + + void Reset() + { + MagneticPull_Timer = 15000; + m_creature->setFaction(FACTION_FRIENDLY_SA); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 20) + { + ((Player*)done_by)->GroupEventHappens(QUEST_10004,m_creature); + damage = 0; + EnterEvadeMode(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (MagneticPull_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000; + }else MagneticPull_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_salsalabim(Creature* pCreature) +{ + return new npc_salsalabimAI(pCreature); +} + +bool GossipHello_npc_salsalabim(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE) + { + pCreature->setFaction(FACTION_HOSTILE_SA); + pCreature->AI()->AttackStart(pPlayer); + } + else + { + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + return true; +} + +/* +################################################## +Shattrath City Flask Vendors provides flasks to people exalted with 3 factions: +Haldor the Compulsive +Arcanist Xorith +Both sell special flasks for use in Outlands 25man raids only, +purchasable for one Mark of Illidari each +Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar +################################################## +*/ + +bool GossipHello_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->GetEntry() == 23484) + { + // Aldor vendor + if (pCreature->isVendor() && (pPlayer->GetReputationRank(932) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID()); + } + else + { + pPlayer->SEND_GOSSIP_MENU(11083, pCreature->GetGUID()); + } + } + + if (pCreature->GetEntry() == 23483) + { + // Scryers vendor + if (pCreature->isVendor() && (pPlayer->GetReputationRank(934) == REP_EXALTED) && (pPlayer->GetReputationRank(935) == REP_EXALTED) && (pPlayer->GetReputationRank(942) == REP_EXALTED)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(11085, pCreature->GetGUID()); + } + else + { + pPlayer->SEND_GOSSIP_MENU(11084, pCreature->GetGUID()); + } + } + + return true; +} + +bool GossipSelect_npc_shattrathflaskvendors(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +# npc_zephyr +######*/ + +bool GossipHello_npc_zephyr(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetReputationRank(989) >= REP_REVERED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Take me to the Caverns of Time.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_zephyr(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->CastSpell(pPlayer,37778,false); + + return true; +} + +void AddSC_shattrath_city() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_dirty_larry"; + newscript->GetAI = &GetAI_npc_dirty_larry; + newscript->pGossipHello = &GossipHello_npc_dirty_larry; + newscript->pGossipSelect = &GossipSelect_npc_dirty_larry; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_ishanah"; + newscript->pGossipHello = &GossipHello_npc_ishanah; + newscript->pGossipSelect = &GossipSelect_npc_ishanah; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_khadgar"; + newscript->pGossipHello = &GossipHello_npc_khadgar; + newscript->pGossipSelect = &GossipSelect_npc_khadgar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_khadgars_servant"; + newscript->GetAI = &GetAI_npc_khadgars_servant; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_raliq_the_drunk"; + newscript->GetAI = &GetAI_npc_raliq_the_drunk; + newscript->pGossipHello = &GossipHello_npc_raliq_the_drunk; + newscript->pGossipSelect = &GossipSelect_npc_raliq_the_drunk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_salsalabim"; + newscript->GetAI = &GetAI_npc_salsalabim; + newscript->pGossipHello = &GossipHello_npc_salsalabim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_shattrathflaskvendors"; + newscript->pGossipHello = &GossipHello_npc_shattrathflaskvendors; + newscript->pGossipSelect = &GossipSelect_npc_shattrathflaskvendors; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_zephyr"; + newscript->pGossipHello = &GossipHello_npc_zephyr; + newscript->pGossipSelect = &GossipSelect_npc_zephyr; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp b/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp new file mode 100644 index 0000000..9a03c90 --- /dev/null +++ b/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp @@ -0,0 +1,515 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arcatraz +SD%Complete: 60 +SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +npc_millhouse_manastorm +npc_warden_mellichar +mob_zerekethvoidzone +EndContentData */ + +#include "precompiled.h" +#include "arcatraz.h" + +/*##### +# npc_millhouse_manastorm +#####*/ + +#define SAY_INTRO_1 -1552010 +#define SAY_INTRO_2 -1552011 +#define SAY_WATER -1552012 +#define SAY_BUFFS -1552013 +#define SAY_DRINK -1552014 +#define SAY_READY -1552015 +#define SAY_KILL_1 -1552016 +#define SAY_KILL_2 -1552017 +#define SAY_PYRO -1552018 +#define SAY_ICEBLOCK -1552019 +#define SAY_LOWHP -1552020 +#define SAY_DEATH -1552021 +#define SAY_COMPLETE -1552022 + +#define SPELL_CONJURE_WATER 36879 +#define SPELL_ARCANE_INTELLECT 36880 +#define SPELL_ICE_ARMOR 36881 + +#define SPELL_ARCANE_MISSILES 33833 +#define SPELL_CONE_OF_COLD 12611 +#define SPELL_FIRE_BLAST 13341 +#define SPELL_FIREBALL 14034 +#define SPELL_FROSTBOLT 15497 +#define SPELL_PYROBLAST 33975 + +struct MANGOS_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI +{ + npc_millhouse_manastormAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 EventProgress_Timer; + uint32 Phase; + bool Init; + bool LowHp; + + uint32 Pyroblast_Timer; + uint32 Fireball_Timer; + + void Reset() + { + EventProgress_Timer = 2000; + LowHp = false; + Init = false; + Phase = 1; + + Pyroblast_Timer = 1000; + Fireball_Timer = 2500; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_WARDEN_2) == DONE) + Init = true; + + if (m_pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) + DoScriptText(SAY_COMPLETE, m_creature); + } + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f); + } + } + + void KilledUnit(Unit *victim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + /*for questId 10886 (heroic mode only) + if (m_pInstance && m_pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) + ->FailQuest();*/ + } + + void UpdateAI(const uint32 diff) + { + if (!Init) + { + if (EventProgress_Timer < diff) + { + if (Phase < 8) + { + switch(Phase) + { + case 1: + DoScriptText(SAY_INTRO_1, m_creature); + EventProgress_Timer = 18000; + break; + case 2: + DoScriptText(SAY_INTRO_2, m_creature); + EventProgress_Timer = 18000; + break; + case 3: + DoScriptText(SAY_WATER, m_creature); + DoCastSpellIfCan(m_creature,SPELL_CONJURE_WATER); + EventProgress_Timer = 7000; + break; + case 4: + DoScriptText(SAY_BUFFS, m_creature); + DoCastSpellIfCan(m_creature,SPELL_ICE_ARMOR); + EventProgress_Timer = 7000; + break; + case 5: + DoScriptText(SAY_DRINK, m_creature); + DoCastSpellIfCan(m_creature,SPELL_ARCANE_INTELLECT); + EventProgress_Timer = 7000; + break; + case 6: + DoScriptText(SAY_READY, m_creature); + EventProgress_Timer = 6000; + break; + case 7: + if (m_pInstance) + m_pInstance->SetData(TYPE_WARDEN_2,DONE); + Init = true; + break; + } + ++Phase; + } + } else EventProgress_Timer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!LowHp && m_creature->GetHealthPercent() < 20.0f) + { + DoScriptText(SAY_LOWHP, m_creature); + LowHp = true; + } + + if (Pyroblast_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_PYRO, m_creature); + + DoCastSpellIfCan(m_creature->getVictim(),SPELL_PYROBLAST); + Pyroblast_Timer = 40000; + }else Pyroblast_Timer -=diff; + + if (Fireball_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FIREBALL); + Fireball_Timer = 4000; + }else Fireball_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) +{ + return new npc_millhouse_manastormAI(pCreature); +} + +/*##### +# npc_warden_mellichar +#####*/ + +#define YELL_INTRO1 -1552023 +#define YELL_INTRO2 -1552024 +#define YELL_RELEASE1 -1552025 +#define YELL_RELEASE2A -1552026 +#define YELL_RELEASE2B -1552027 +#define YELL_RELEASE3 -1552028 +#define YELL_RELEASE4 -1552029 +#define YELL_WELCOME -1552030 + +//phase 2(acid mobs) +#define ENTRY_TRICKSTER 20905 +#define ENTRY_PH_HUNTER 20906 +//phase 3 +#define ENTRY_MILLHOUSE 20977 +//phase 4(acid mobs) +#define ENTRY_AKKIRIS 20908 +#define ENTRY_SULFURON 20909 +//phase 5(acid mobs) +#define ENTRY_TW_DRAK 20910 +#define ENTRY_BL_DRAK 20911 +//phase 6 +#define ENTRY_SKYRISS 20912 + +//TARGET_SCRIPT +#define SPELL_TARGET_ALPHA 36856 +#define SPELL_TARGET_BETA 36854 +#define SPELL_TARGET_DELTA 36857 +#define SPELL_TARGET_GAMMA 36858 +#define SPELL_TARGET_OMEGA 36852 +#define SPELL_BUBBLE_VISUAL 36849 + +struct MANGOS_DLL_DECL npc_warden_mellicharAI : public ScriptedAI +{ + npc_warden_mellicharAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool IsRunning; + bool CanSpawn; + + uint32 EventProgress_Timer; + uint32 Phase; + + void Reset() + { + IsRunning = false; + CanSpawn = false; + + EventProgress_Timer = 22000; + Phase = 1; + + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + DoCastSpellIfCan(m_creature,SPELL_TARGET_OMEGA); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); + } + + void AttackStart(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (IsRunning) + return; + + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessablePlaceFor(m_creature)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + float attackRadius = m_creature->GetAttackDistance(who)/10; + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + Aggro(who); + } + } + + void Aggro(Unit *who) + { + DoScriptText(YELL_INTRO1, m_creature); + DoCastSpellIfCan(m_creature,SPELL_BUBBLE_VISUAL); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); + + if (GameObject* pSphere = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SPHERE_SHIELD))) + pSphere->SetGoState(GO_STATE_READY); + + IsRunning = true; + } + } + + bool CanProgress() + { + if (m_pInstance) + { + if (Phase == 7 && m_pInstance->GetData(TYPE_WARDEN_4) == DONE) + return true; + if (Phase == 6 && m_pInstance->GetData(TYPE_WARDEN_3) == DONE) + return true; + if (Phase == 5 && m_pInstance->GetData(TYPE_WARDEN_2) == DONE) + return true; + if (Phase == 4) + return true; + if (Phase == 3 && m_pInstance->GetData(TYPE_WARDEN_1) == DONE) + return true; + if (Phase == 2 && m_pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + if (Phase == 1 && m_pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + + return false; + } + return false; + } + + void DoPrepareForPhase() + { + if (m_pInstance) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveSpellsCausingAura(SPELL_AURA_DUMMY); + + switch(Phase) + { + case 2: + DoCastSpellIfCan(m_creature,SPELL_TARGET_ALPHA); + m_pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); + break; + case 3: + DoCastSpellIfCan(m_creature,SPELL_TARGET_BETA); + m_pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); + break; + case 5: + DoCastSpellIfCan(m_creature,SPELL_TARGET_DELTA); + m_pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); + break; + case 6: + DoCastSpellIfCan(m_creature,SPELL_TARGET_GAMMA); + m_pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); + break; + case 7: + m_pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); + break; + } + CanSpawn = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!IsRunning) + return; + + if (EventProgress_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) + Reset(); + } + + if (CanSpawn) + { + //continue beam omega pod, unless we are about to summon skyriss + if (Phase != 7) + DoCastSpellIfCan(m_creature,SPELL_TARGET_OMEGA); + + switch(Phase) + { + case 2: + switch(urand(0, 1)) + { + case 0: m_creature->SummonCreature(ENTRY_TRICKSTER, 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER, 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 3: + m_creature->SummonCreature(ENTRY_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + break; + case 4: + DoScriptText(YELL_RELEASE2B, m_creature); + break; + case 5: + switch(urand(0, 1)) + { + case 0: m_creature->SummonCreature(ENTRY_AKKIRIS, 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_SULFURON, 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 6: + switch(urand(0, 1)) + { + case 0: m_creature->SummonCreature(ENTRY_TW_DRAK, 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_BL_DRAK, 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 7: + m_creature->SummonCreature(ENTRY_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoScriptText(YELL_WELCOME, m_creature); + break; + } + CanSpawn = false; + ++Phase; + } + if (CanProgress()) + { + switch(Phase) + { + case 1: + DoScriptText(YELL_INTRO2, m_creature); + EventProgress_Timer = 10000; + ++Phase; + break; + case 2: + DoScriptText(YELL_RELEASE1, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 7000; + break; + case 3: + DoScriptText(YELL_RELEASE2A, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 10000; + break; + case 4: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 5: + DoScriptText(YELL_RELEASE3, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 6: + DoScriptText(YELL_RELEASE4, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 7: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + } + } + } else EventProgress_Timer -= diff; + } +}; + +CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) +{ + return new npc_warden_mellicharAI(pCreature); +} + +/*##### +# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') +#####*/ + +#define SPELL_VOID_ZONE_DAMAGE 36120 + +struct MANGOS_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI +{ + mob_zerekethvoidzoneAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); + m_creature->setFaction(16); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + DoCastSpellIfCan(m_creature,SPELL_VOID_ZONE_DAMAGE); + } +}; +CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) +{ + return new mob_zerekethvoidzoneAI(pCreature); +} + +void AddSC_arcatraz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_millhouse_manastorm"; + newscript->GetAI = &GetAI_npc_millhouse_manastorm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_warden_mellichar"; + newscript->GetAI = &GetAI_npc_warden_mellichar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_zerekethvoidzone"; + newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/arcatraz/arcatraz.h b/scripts/outland/tempest_keep/arcatraz/arcatraz.h new file mode 100644 index 0000000..4f3a34f --- /dev/null +++ b/scripts/outland/tempest_keep/arcatraz/arcatraz.h @@ -0,0 +1,37 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ARCATRAZ_H +#define DEF_ARCATRAZ_H + +enum +{ + MAX_ENCOUNTER = 9, + + GO_CORE_SECURITY_FIELD_ALPHA = 184318, //door opened when Wrath-Scryer Soccothrates dies + GO_CORE_SECURITY_FIELD_BETA = 184319, //door opened when Dalliah the Doomsayer dies + GO_SEAL_SPHERE = 184802, //shield 'protecting' mellichar + GO_POD_ALPHA = 183961, //pod first boss wave + GO_POD_BETA = 183963, //pod second boss wave + GO_POD_DELTA = 183964, //pod third boss wave + GO_POD_GAMMA = 183962, //pod fourth boss wave + GO_POD_OMEGA = 183965, //pod fifth boss wave + + NPC_MELLICHAR = 20904, //skyriss will kill this unit + + TYPE_ZEREKETH = 1, + TYPE_DALLIAH = 2, + TYPE_SOCCOTHRATES = 3, + TYPE_HARBINGERSKYRISS = 4, + TYPE_WARDEN_1 = 5, + TYPE_WARDEN_2 = 6, + TYPE_WARDEN_3 = 7, + TYPE_WARDEN_4 = 8, + TYPE_WARDEN_5 = 9, + + DATA_MELLICHAR = 10, + DATA_SPHERE_SHIELD = 11 +}; + +#endif diff --git a/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp new file mode 100644 index 0000000..91c5f01 --- /dev/null +++ b/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -0,0 +1,291 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Harbinger_Skyriss +SD%Complete: 45 +SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +boss_harbinger_skyriss +boss_harbinger_skyriss_illusion +EndContentData */ + +#include "precompiled.h" +#include "arcatraz.h" + +#define SAY_INTRO -1552000 +#define SAY_AGGRO -1552001 +#define SAY_KILL_1 -1552002 +#define SAY_KILL_2 -1552003 +#define SAY_MIND_1 -1552004 +#define SAY_MIND_2 -1552005 +#define SAY_FEAR_1 -1552006 +#define SAY_FEAR_2 -1552007 +#define SAY_IMAGE -1552008 +#define SAY_DEATH -1552009 + +#define SPELL_FEAR 39415 + +#define SPELL_MIND_REND 36924 +#define H_SPELL_MIND_REND 39017 + +#define SPELL_DOMINATION 37162 +#define H_SPELL_DOMINATION 39019 + +#define H_SPELL_MANA_BURN 39020 + +#define SPELL_66_ILLUSION 36931 //entry 21466 +#define SPELL_33_ILLUSION 36932 //entry 21467 + +struct MANGOS_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI +{ + boss_harbinger_skyrissAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Intro = false; + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + bool Intro; + bool IsImage33; + bool IsImage66; + + uint32 Intro_Phase; + uint32 Intro_Timer; + uint32 MindRend_Timer; + uint32 Fear_Timer; + uint32 Domination_Timer; + uint32 ManaBurn_Timer; + + void Reset() + { + IsImage33 = false; + IsImage66 = false; + + Intro_Phase = 1; + Intro_Timer = 5000; + MindRend_Timer = 3000; + Fear_Timer = 15000; + Domination_Timer = 30000; + ManaBurn_Timer = 25000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (!Intro) + return; + + ScriptedAI::AttackStart(who); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); + } + + void KilledUnit(Unit* victim) + { + //won't yell killing pet/other unit + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void DoSplit() + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_IMAGE, m_creature); + + DoCastSpellIfCan(m_creature, IsImage33 ? SPELL_33_ILLUSION : SPELL_66_ILLUSION); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !m_creature->isInCombat()) + { + if (!m_pInstance) + return; + + if (Intro_Timer < diff) + { + switch(Intro_Phase) + { + case 1: + DoScriptText(SAY_INTRO, m_creature); + if (GameObject* pSphere = m_pInstance->instance->GetGameObject(m_pInstance->GetData64(DATA_SPHERE_SHIELD))) + pSphere->SetGoState(GO_STATE_ACTIVE); + ++Intro_Phase; + Intro_Timer = 25000; + break; + case 2: + DoScriptText(SAY_AGGRO, m_creature); + if (Creature *mellic = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_MELLICHAR))) + { + //should have a better way to do this. possibly spell exist. + mellic->SetDeathState(JUST_DIED); + mellic->SetHealth(0); + } + ++Intro_Phase; + Intro_Timer = 3000; + break; + case 3: + Intro = true; + break; + } + }else Intro_Timer -=diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!IsImage66 && m_creature->GetHealthPercent() <= 66.0f) + { + IsImage66 = true; + DoSplit(); + } + + if (!IsImage33 && m_creature->GetHealthPercent() <= 33.0f) + { + IsImage33 = true; + DoSplit(); + } + + if (MindRend_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_MIND_REND : H_SPELL_MIND_REND); + else + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_MIND_REND : H_SPELL_MIND_REND); + + MindRend_Timer = 8000; + }else MindRend_Timer -=diff; + + if (Fear_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(urand(0, 1) ? SAY_FEAR_1 : SAY_FEAR_2, m_creature); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,SPELL_FEAR); + else + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FEAR); + + Fear_Timer = 25000; + }else Fear_Timer -=diff; + + if (Domination_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(urand(0, 1) ? SAY_MIND_1 : SAY_MIND_2, m_creature); + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target, m_bIsRegularMode ? SPELL_DOMINATION : H_SPELL_DOMINATION); + else + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_DOMINATION : H_SPELL_DOMINATION); + + Domination_Timer = urand(16000, 32000); + }else Domination_Timer -=diff; + + if (!m_bIsRegularMode) + { + if (ManaBurn_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,H_SPELL_MANA_BURN); + + ManaBurn_Timer = urand(16000, 32000); + }else ManaBurn_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) +{ + return new boss_harbinger_skyrissAI(pCreature); +} + +#define SPELL_MIND_REND_IMAGE 36929 +#define H_SPELL_MIND_REND_IMAGE 39021 + +struct MANGOS_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI +{ + boss_harbinger_skyriss_illusionAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + void Reset() { } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) +{ + return new boss_harbinger_skyriss_illusionAI(pCreature); +} + +void AddSC_boss_harbinger_skyriss() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_harbinger_skyriss"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_harbinger_skyriss_illusion"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp new file mode 100644 index 0000000..a585068 --- /dev/null +++ b/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Arcatraz +SD%Complete: 80 +SDComment: Mainly Harbringer Skyriss event +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +#include "precompiled.h" +#include "arcatraz.h" + +/* Arcatraz encounters: +1 - Zereketh the Unbound event +2 - Dalliah the Doomsayer event +3 - Wrath-Scryer Soccothrates event +4 - Harbinger Skyriss event, 5 sub-events +*/ + +struct MANGOS_DLL_DECL instance_arcatraz : public ScriptedInstance +{ + instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiCore_Security_Field_AlphaGUID; + uint64 m_uiCore_Security_Field_BetaGUID; + uint64 m_uiPod_AlphaGUID; + uint64 m_uiPod_GammaGUID; + uint64 m_uiPod_BetaGUID; + uint64 m_uiPod_DeltaGUID; + uint64 m_uiPod_OmegaGUID; + + uint64 m_uiGoSphereGUID; + uint64 m_uiMellicharGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiCore_Security_Field_AlphaGUID = 0; + m_uiCore_Security_Field_BetaGUID = 0; + m_uiPod_AlphaGUID = 0; + m_uiPod_BetaGUID = 0; + m_uiPod_DeltaGUID = 0; + m_uiPod_GammaGUID = 0; + m_uiPod_OmegaGUID = 0; + + m_uiGoSphereGUID = 0; + m_uiMellicharGUID = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnObjectCreate(GameObject* pGo) + { + switch(pGo->GetEntry()) + { + case GO_CORE_SECURITY_FIELD_ALPHA: m_uiCore_Security_Field_AlphaGUID = pGo->GetGUID(); break; + case GO_CORE_SECURITY_FIELD_BETA: m_uiCore_Security_Field_BetaGUID = pGo->GetGUID(); break; + case GO_SEAL_SPHERE: m_uiGoSphereGUID = pGo->GetGUID(); break; + case GO_POD_ALPHA: m_uiPod_AlphaGUID = pGo->GetGUID(); break; + case GO_POD_BETA: m_uiPod_BetaGUID = pGo->GetGUID(); break; + case GO_POD_DELTA: m_uiPod_DeltaGUID = pGo->GetGUID(); break; + case GO_POD_GAMMA: m_uiPod_GammaGUID = pGo->GetGUID(); break; + case GO_POD_OMEGA: m_uiPod_OmegaGUID = pGo->GetGUID(); break; + } + } + + void OnCreatureCreate(Creature* pCreature) + { + if (pCreature->GetEntry() == NPC_MELLICHAR) + m_uiMellicharGUID = pCreature->GetGUID(); + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_ZEREKETH: + m_auiEncounter[0] = uiData; + break; + + case TYPE_DALLIAH: + if (uiData == DONE) + DoUseDoorOrButton(m_uiCore_Security_Field_BetaGUID); + m_auiEncounter[1] = uiData; + break; + + case TYPE_SOCCOTHRATES: + if (uiData == DONE) + DoUseDoorOrButton(m_uiCore_Security_Field_AlphaGUID); + m_auiEncounter[2] = uiData; + break; + + case TYPE_HARBINGERSKYRISS: + if (uiData == NOT_STARTED || uiData == FAIL) + { + m_auiEncounter[4] = NOT_STARTED; + m_auiEncounter[5] = NOT_STARTED; + m_auiEncounter[6] = NOT_STARTED; + m_auiEncounter[7] = NOT_STARTED; + m_auiEncounter[8] = NOT_STARTED; + } + m_auiEncounter[3] = uiData; + break; + + case TYPE_WARDEN_1: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiPod_AlphaGUID); + m_auiEncounter[4] = uiData; + break; + + case TYPE_WARDEN_2: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiPod_BetaGUID); + m_auiEncounter[5] = uiData; + break; + + case TYPE_WARDEN_3: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiPod_DeltaGUID); + m_auiEncounter[6] = uiData; + break; + + case TYPE_WARDEN_4: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiPod_GammaGUID); + m_auiEncounter[7] = uiData; + break; + + case TYPE_WARDEN_5: + if (uiData == IN_PROGRESS) + DoUseDoorOrButton(m_uiPod_OmegaGUID); + m_auiEncounter[8] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_HARBINGERSKYRISS: + return m_auiEncounter[3]; + case TYPE_WARDEN_1: + return m_auiEncounter[4]; + case TYPE_WARDEN_2: + return m_auiEncounter[5]; + case TYPE_WARDEN_3: + return m_auiEncounter[6]; + case TYPE_WARDEN_4: + return m_auiEncounter[7]; + case TYPE_WARDEN_5: + return m_auiEncounter[8]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_MELLICHAR: + return m_uiMellicharGUID; + case DATA_SPHERE_SHIELD: + return m_uiGoSphereGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) +{ + return new instance_arcatraz(pMap); +} + +void AddSC_instance_arcatraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_arcatraz"; + newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp new file mode 100644 index 0000000..0b69004 --- /dev/null +++ b/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp @@ -0,0 +1,190 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_Botanist_Freywinn +SD%Complete: 90 +SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1553000 +#define SAY_KILL_1 -1553001 +#define SAY_KILL_2 -1553002 +#define SAY_TREE_1 -1553003 +#define SAY_TREE_2 -1553004 +#define SAY_DEATH -1553005 + +#define SPELL_TRANQUILITY 34550 +#define SPELL_TREE_FORM 34551 + +#define SPELL_SUMMON_FRAYER 34557 +#define ENTRY_FRAYER 19953 + +#define SPELL_PLANT_WHITE 34759 +#define SPELL_PLANT_GREEN 34761 +#define SPELL_PLANT_BLUE 34762 +#define SPELL_PLANT_RED 34763 + +struct MANGOS_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI +{ + boss_high_botanist_freywinnAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + std::list Adds_List; + + uint32 SummonSeedling_Timer; + uint32 TreeForm_Timer; + uint32 MoveCheck_Timer; + uint32 DeadAddsCount; + bool MoveFree; + + void Reset() + { + Adds_List.clear(); + + SummonSeedling_Timer = 6000; + TreeForm_Timer = 30000; + MoveCheck_Timer = 1000; + DeadAddsCount = 0; + MoveFree = true; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_FRAYER) + Adds_List.push_back(summoned->GetGUID()); + } + + void DoSummonSeedling() + { + switch(urand(0, 3)) + { + case 0: DoCastSpellIfCan(m_creature,SPELL_PLANT_WHITE); break; + case 1: DoCastSpellIfCan(m_creature,SPELL_PLANT_GREEN); break; + case 2: DoCastSpellIfCan(m_creature,SPELL_PLANT_BLUE); break; + case 3: DoCastSpellIfCan(m_creature,SPELL_PLANT_RED); break; + } + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_KILL_1 : SAY_KILL_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (TreeForm_Timer < diff) + { + DoScriptText(urand(0, 1) ? SAY_TREE_1 : SAY_TREE_2, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->RemoveAllAuras(); + + DoCastSpellIfCan(m_creature, SPELL_SUMMON_FRAYER, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_TRANQUILITY, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_TREE_FORM, CAST_TRIGGERED); + + m_creature->GetMotionMaster()->MoveIdle(); + MoveFree = false; + + TreeForm_Timer = 75000; + }else TreeForm_Timer -= diff; + + if (!MoveFree) + { + if (MoveCheck_Timer < diff) + { + if (!Adds_List.empty()) + { + for(std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) + { + if (Creature *temp = m_creature->GetMap()->GetCreature(*itr)) + { + if (!temp->isAlive()) + { + Adds_List.erase(itr); + ++DeadAddsCount; + break; + } + } + } + } + + if (DeadAddsCount < 3 && TreeForm_Timer-30000 < diff) + DeadAddsCount = 3; + + if (DeadAddsCount >= 3) + { + Adds_List.clear(); + DeadAddsCount = 0; + + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + MoveFree = true; + } + MoveCheck_Timer = 500; + } + else MoveCheck_Timer -= diff; + + return; + } + + /*if (m_creature->HasAura(SPELL_TREE_FORM, EFFECT_INDEX_0) || m_creature->HasAura(SPELL_TRANQUILITY, EFFECT_INDEX_0)) + return;*/ + + //one random seedling every 5 secs, but not in tree form + if (SummonSeedling_Timer < diff) + { + DoSummonSeedling(); + SummonSeedling_Timer = 6000; + }else SummonSeedling_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) +{ + return new boss_high_botanist_freywinnAI(pCreature); +} + +void AddSC_boss_high_botanist_freywinn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_high_botanist_freywinn"; + newscript->GetAI = &GetAI_boss_high_botanist_freywinn; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/botanica/boss_laj.cpp b/scripts/outland/tempest_keep/botanica/boss_laj.cpp new file mode 100644 index 0000000..ac69f7b --- /dev/null +++ b/scripts/outland/tempest_keep/botanica/boss_laj.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Laj +SD%Complete: 90 +SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_SUMMON -1553006 + +#define SPELL_ALLERGIC_REACTION 34697 +#define SPELL_TELEPORT_SELF 34673 + +#define SPELL_SUMMON_LASHER_1 34681 +#define SPELL_SUMMON_FLAYER_1 34682 +#define SPELL_SUMMON_LASHER_2 34684 +#define SPELL_SUMMON_FLAYER_2 34685 +#define SPELL_SUMMON_LASHER_3 34686 +#define SPELL_SUMMON_FLAYER_4 34687 +#define SPELL_SUMMON_LASHER_4 34688 +#define SPELL_SUMMON_FLAYER_3 34690 + +#define MODEL_DEFAULT 13109 +#define MODEL_ARCANE 14213 +#define MODEL_FIRE 13110 +#define MODEL_FROST 14112 +#define MODEL_NATURE 14214 + +struct MANGOS_DLL_DECL boss_lajAI : public ScriptedAI +{ + boss_lajAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool CanSummon; + uint32 Teleport_Timer; + uint32 Summon_Timer; + uint32 Transform_Timer; + uint32 Allergic_Timer; + + void Reset() + { + m_creature->SetDisplayId(MODEL_DEFAULT); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + CanSummon = false; + Teleport_Timer = 20000; + Summon_Timer = 2500; + Transform_Timer = 30000; + Allergic_Timer = 5000; + } + + void DoTransform() + { + switch(urand(0, 4)) + { + case 0: + m_creature->SetDisplayId(MODEL_DEFAULT); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 1: + m_creature->SetDisplayId(MODEL_ARCANE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 2: + m_creature->SetDisplayId(MODEL_FIRE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 3: + m_creature->SetDisplayId(MODEL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 4: + m_creature->SetDisplayId(MODEL_NATURE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + break; + } + } + + void DoSummons() + { + switch(urand(0, 3)) + { + case 0: + DoCastSpellIfCan(m_creature, SPELL_SUMMON_LASHER_1, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_FLAYER_1, CAST_TRIGGERED); + break; + case 1: + DoCastSpellIfCan(m_creature, SPELL_SUMMON_LASHER_2, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_FLAYER_2, CAST_TRIGGERED); + break; + case 2: + DoCastSpellIfCan(m_creature, SPELL_SUMMON_LASHER_3, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_FLAYER_3, CAST_TRIGGERED); + break; + case 3: + DoCastSpellIfCan(m_creature, SPELL_SUMMON_LASHER_4, CAST_TRIGGERED); + DoCastSpellIfCan(m_creature, SPELL_SUMMON_FLAYER_4, CAST_TRIGGERED); + break; + } + CanSummon = false; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (CanSummon) + { + if (Summon_Timer < diff) + { + DoScriptText(EMOTE_SUMMON, m_creature); + DoSummons(); + Summon_Timer = 2500; + }else Summon_Timer -= diff; + } + + if (Allergic_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ALLERGIC_REACTION); + Allergic_Timer = urand(25000, 40000); + }else Allergic_Timer -= diff; + + if (Teleport_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_TELEPORT_SELF); + Teleport_Timer = urand(30000, 40000); + CanSummon = true; + }else Teleport_Timer -= diff; + + if (Transform_Timer < diff) + { + DoTransform(); + Transform_Timer = urand(25000, 40000); + }else Transform_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_laj(Creature* pCreature) +{ + return new boss_lajAI(pCreature); +} + +void AddSC_boss_laj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_laj"; + newscript->GetAI = &GetAI_boss_laj; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp b/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp new file mode 100644 index 0000000..53d8408 --- /dev/null +++ b/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp @@ -0,0 +1,242 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warp_Splinter +SD%Complete: 80 +SDComment: Includes Sapling (need some better control with these). Spells for boss possibly need some rework. +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +/*##### +# mob_treant (Sapling) +#####*/ + +struct MANGOS_DLL_DECL mob_treantAI : public ScriptedAI +{ + mob_treantAI (Creature* pCreature) : ScriptedAI(pCreature) + { + WarpGuid = 0; + Reset(); + } + + uint64 WarpGuid; + + void Reset() + { + m_creature->SetSpeedRate(MOVE_RUN, 0.5f); + } + + void MoveInLineOfSight(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->getVictim()->GetGUID() != WarpGuid) + DoMeleeAttackIfReady(); + } +}; + +/*##### +# boss_warp_splinter +#####*/ + +#define SAY_AGGRO -1553007 +#define SAY_SLAY_1 -1553008 +#define SAY_SLAY_2 -1553009 +#define SAY_SUMMON_1 -1553010 +#define SAY_SUMMON_2 -1553011 +#define SAY_DEATH -1553012 + +#define WAR_STOMP 34716 +#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) +#define ARCANE_VOLLEY 36705 //37078, 34785 //must additional script them (because Splinter eats them after 20 sec ^) +#define SPELL_HEAL_FATHER 6262 + +#define CREATURE_TREANT 19949 +#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point + +float treant_pos[6][3] = +{ + {24.301233f, 427.221100f, -27.060635f}, + {16.795492f, 359.678802f, -27.355425f}, + {53.493484f, 345.381470f, -26.196192f}, + {61.867096f, 439.362732f, -25.921030f}, + {109.86187f, 423.201630f, -27.356019f}, + {106.78015f, 355.582580f, -27.593357f} +}; + +struct MANGOS_DLL_DECL boss_warp_splinterAI : public ScriptedAI +{ + boss_warp_splinterAI(Creature* pCreature) : ScriptedAI(pCreature) + { + Treant_Spawn_Pos_X = pCreature->GetPositionX(); + Treant_Spawn_Pos_Y = pCreature->GetPositionY(); + Reset(); + } + + uint32 War_Stomp_Timer; + uint32 Summon_Treants_Timer; + uint32 Arcane_Volley_Timer; + uint32 CheckTreantLOS_Timer; + uint32 TreantLife_Timer; + uint64 Treant_GUIDs[6]; + + float Treant_Spawn_Pos_X; + float Treant_Spawn_Pos_Y; + + void Reset() + { + War_Stomp_Timer = urand(25000, 40000); + Summon_Treants_Timer = 45000; + Arcane_Volley_Timer = urand(8000, 20000); + CheckTreantLOS_Timer = 1000; + TreantLife_Timer = 999999; + + for(int i = 0; i < 6; ++i) + Treant_GUIDs[i] = 0; + + m_creature->SetSpeedRate(MOVE_RUN, 0.7f); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void SummonTreants() + { + for(int i = 0; i < 6; ++i) + { + float angle = (M_PI / 3) * i; + + float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); + float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); + //float Z = m_creature->GetMap()->GetHeight(X,Y, m_creature->GetPositionZ()); + //float Z = m_creature->GetPositionZ(); + float O = - m_creature->GetAngle(X,Y); + + if (Creature* pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,40000)) + { + //pTreant->GetMotionMaster()->Mutate(new TargetedMovementGenerator(*m_creature)); + pTreant->AddThreat(m_creature); + Treant_GUIDs[i] = pTreant->GetGUID(); + + if (mob_treantAI* pTreantAI = dynamic_cast(pTreant->AI())) + pTreantAI->WarpGuid = m_creature->GetGUID(); + } + } + + DoScriptText(urand(0, 1) ? SAY_SUMMON_1 : SAY_SUMMON_2, m_creature); + } + + // Warp Splinter eat treants if they are near him + void EatTreant() + { + for(int i=0; i<6; ++i) + { + Creature* pTreant = m_creature->GetMap()->GetCreature(Treant_GUIDs[i]); + + if (pTreant) + { + if (m_creature->IsWithinDistInMap(pTreant, 5)) + { + // 2) Heal Warp Splinter + int32 CurrentHP_Treant = (int32)pTreant->GetHealth(); + m_creature->CastCustomSpell(m_creature,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID()); + + // 3) Kill Treant + pTreant->DealDamage(pTreant, pTreant->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Check for War Stomp + if (War_Stomp_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),WAR_STOMP); + War_Stomp_Timer = urand(25000, 40000); + } else War_Stomp_Timer -= diff; + + //Check for Arcane Volley + if (Arcane_Volley_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),ARCANE_VOLLEY); + Arcane_Volley_Timer = urand(20000, 35000); + } else Arcane_Volley_Timer -= diff; + + //Check for Summon Treants + if (Summon_Treants_Timer < diff) + { + SummonTreants(); + Summon_Treants_Timer = 45000; + } else Summon_Treants_Timer -= diff; + + // I check if there is a Treant in Warp Splinter's LOS, so he can eat them + if (CheckTreantLOS_Timer < diff) + { + EatTreant(); + CheckTreantLOS_Timer = 1000; + } else CheckTreantLOS_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) +{ + return new boss_warp_splinterAI(pCreature); +} + +CreatureAI* GetAI_mob_treant(Creature* pCreature) +{ + return new mob_treantAI(pCreature); +} + +void AddSC_boss_warp_splinter() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_warp_splinter"; + newscript->GetAI = &GetAI_boss_warp_splinter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_warp_splinter_treant"; + newscript->GetAI = &GetAI_mob_treant; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp b/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp new file mode 100644 index 0000000..f6c052c --- /dev/null +++ b/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp @@ -0,0 +1,474 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Astromancer +SD%Complete: 80 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "the_eye.h" + +enum +{ + SAY_AGGRO = -1550007, + SAY_SUMMON1 = -1550008, + SAY_SUMMON2 = -1550009, + SAY_KILL1 = -1550010, + SAY_KILL2 = -1550011, + SAY_KILL3 = -1550012, + SAY_DEATH = -1550013, + SAY_VOIDA = -1550014, + SAY_VOIDB = -1550015, + + SPELL_ARCANE_MISSILES = 33031, + SPELL_WRATH_OF_THE_ASTROMANCER = 42783, + SPELL_BLINDING_LIGHT = 33009, + SPELL_FEAR = 34322, + SPELL_VOID_BOLT = 39329, + + SPELL_SPOTLIGHT = 25824, + NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, + + NPC_SOLARIUM_AGENT = 18925, + NPC_SOLARIUM_PRIEST = 18806, + + MODEL_HUMAN = 18239, + MODEL_VOIDWALKER = 18988, + + SPELL_SOLARIUM_GREAT_HEAL = 33387, + SPELL_SOLARIUM_HOLY_SMITE = 25054, + SPELL_SOLARIUM_ARCANE_TORRENT = 33390, + + WV_ARMOR = 31000 +}; + +const float CENTER_X = 432.909f; +const float CENTER_Y = -373.424f; +const float CENTER_Z = 17.9608f; +const float CENTER_O = 1.06421f; +const float SMALL_PORTAL_RADIUS = 12.6f; +const float LARGE_PORTAL_RADIUS = 26.0f; +const float PORTAL_Z = 17.005f; + +struct MANGOS_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI +{ + boss_high_astromancer_solarianAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + + defaultarmor = m_creature->GetArmor(); + defaultsize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 m_uiWrathOfTheAstromancer_Timer; + uint32 BlindingLight_Timer; + uint32 Fear_Timer; + uint32 VoidBolt_Timer; + uint32 Phase1_Timer; + uint32 Phase2_Timer; + uint32 Phase3_Timer; + uint32 AppearDelay_Timer; + uint32 defaultarmor; + + float defaultsize; + + bool AppearDelay; + + uint8 Phase; + + float Portals[3][3]; + + void Reset() + { + ArcaneMissiles_Timer = 2000; + m_uiWrathOfTheAstromancer_Timer = 15000; + BlindingLight_Timer = 41000; + Fear_Timer = 20000; + VoidBolt_Timer = 10000; + Phase1_Timer = 50000; + Phase2_Timer = 10000; + Phase3_Timer = 15000; + AppearDelay_Timer = 2000; + AppearDelay = false; + Phase = 1; + + if (m_pInstance) + m_pInstance->SetData(TYPE_ASTROMANCER, NOT_STARTED); + + m_creature->SetArmor(defaultarmor); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + m_creature->SetDisplayId(MODEL_HUMAN); + } + + void KilledUnit(Unit *victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 2: DoScriptText(SAY_KILL3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + m_creature->SetDisplayId(MODEL_HUMAN); + + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ASTROMANCER, DONE); + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetInCombatWithZone(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ASTROMANCER, IN_PROGRESS); + } + + void SummonMinion(uint32 entry, float x, float y, float z) + { + Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (Summoned) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); + } + } + + float Portal_X(float radius) + { + if (urand(0, 1)) + radius = -radius; + + return (radius * (float)(rand()%100)/100.0f + CENTER_X); + } + + float Portal_Y(float x, float radius) + { + float z = 0.0f; + + switch(urand(0, 1)) + { + case 0: z = 1; break; + case 1: z = -1; break; + } + return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (AppearDelay) + { + m_creature->StopMoving(); + m_creature->AttackStop(); + + if (AppearDelay_Timer < diff) + { + AppearDelay = false; + + if (Phase == 2) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + } + + AppearDelay_Timer = 2000; + }else AppearDelay_Timer -= diff; + } + + if (Phase == 1) + { + //ArcaneMissiles_Timer + if (ArcaneMissiles_Timer < diff) + { + //Solarian casts Arcane Missiles on on random targets in the raid. + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + if (!m_creature->HasInArc(2.5f, target)) + target = m_creature->getVictim(); + + if (target) + DoCastSpellIfCan(target, SPELL_ARCANE_MISSILES); + } + + ArcaneMissiles_Timer = 3000; + }else ArcaneMissiles_Timer -= diff; + + //Wrath of the Astromancer targets a random player which will explode after 6 secondes + if (m_uiWrathOfTheAstromancer_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + + //Target the tank ? + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 1)) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); + m_uiWrathOfTheAstromancer_Timer = 25000; + } + else + m_uiWrathOfTheAstromancer_Timer = 1000; + } + }else m_uiWrathOfTheAstromancer_Timer -= diff; + + //BlindingLight_Timer + if (BlindingLight_Timer < diff) + { + //She casts this spell every 45 seconds. It is a kind of Moonfire spell, which she strikes down on the whole raid simultaneously. It hits everyone in the raid for 2280 to 2520 arcane damage. + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BLINDING_LIGHT); + BlindingLight_Timer = 45000; + }else BlindingLight_Timer -= diff; + + //Phase1_Timer + if (Phase1_Timer < diff) + { + Phase = 2; + Phase1_Timer = 50000; + + //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); + + for(int i = 0; i <= 2; ++i) + { + if (!i) + { + Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); + Portals[i][2] = CENTER_Z; + } + else + { + Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); + Portals[i][2] = PORTAL_Z; + } + } + + if ((abs(int(Portals[2][0]) - int(Portals[1][0])) < 7) && (abs(int(Portals[2][1]) - int(Portals[1][1])) < 7)) + { + int i = 1; + if (abs(int(CENTER_X) + int(26.0f) - int(Portals[2][0])) < 7) + i = -1; + + Portals[2][0] = Portals[2][0]+7*i; + Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); + } + + for (int i = 0; i <= 2; ++i) + { + if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); + } + } + + AppearDelay = true; + }else Phase1_Timer -= diff; + } + else if (Phase == 2) + { + m_creature->AttackStop(); + m_creature->StopMoving(); + + //Check Phase2_Timer + if (Phase2_Timer < diff) + { + //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. + Phase = 3; + for (int i = 0; i <= 2; ++i) + { + for (int j = 1; j <= 4; ++j) + SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); + } + + DoScriptText(SAY_SUMMON1, m_creature); + + Phase2_Timer = 10000; + } else Phase2_Timer -= diff; + } + else if (Phase == 3) + { + m_creature->AttackStop(); + m_creature->StopMoving(); + + //Check Phase3_Timer + if (Phase3_Timer < diff) + { + Phase = 1; + + //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. + int i = irand(0, 2); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); + + for (int j = 0; j <= 2; ++j) + if (j != i) + SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + DoScriptText(SAY_SUMMON2, m_creature); + + AppearDelay = true; + Phase3_Timer = 15000; + }else Phase3_Timer -= diff; + } + else if (Phase == 4) + { + //Fear_Timer + if (Fear_Timer < diff) + { + DoCastSpellIfCan(m_creature, SPELL_FEAR); + Fear_Timer = 20000; + }else Fear_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_VOID_BOLT); + VoidBolt_Timer = 10000; + }else VoidBolt_Timer -= diff; + } + + //When Solarian reaches 20% she will transform into a huge void walker. + if (Phase != 4 && m_creature->GetHealthPercent() < 20.0f) + { + Phase = 4; + + //To make sure she wont be invisible or not selecatble + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + DoScriptText(SAY_VOIDA, m_creature); + DoScriptText(SAY_VOIDB, m_creature); + + m_creature->SetArmor(WV_ARMOR); + m_creature->SetDisplayId(MODEL_VOIDWALKER); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); + } + + DoMeleeAttackIfReady(); + } +}; + +struct MANGOS_DLL_DECL mob_solarium_priestAI : public ScriptedAI +{ + mob_solarium_priestAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 healTimer; + uint32 holysmiteTimer; + uint32 aoesilenceTimer; + + void Reset() + { + healTimer = 9000; + holysmiteTimer = 1; + aoesilenceTimer = 15000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (healTimer < diff) + { + Creature* target = NULL; + + switch(urand(0, 1)) + { + case 0: + if (m_pInstance) + target = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(DATA_ASTROMANCER)); + break; + case 1: + target = m_creature; + break; + } + + if (target) + { + DoCastSpellIfCan(target,SPELL_SOLARIUM_GREAT_HEAL); + healTimer = 9000; + } + } else healTimer -= diff; + + if (holysmiteTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); + holysmiteTimer = 4000; + } else holysmiteTimer -= diff; + + if (aoesilenceTimer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); + aoesilenceTimer = 13000; + } else aoesilenceTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) +{ + return new mob_solarium_priestAI(pCreature); +} + +CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) +{ + return new boss_high_astromancer_solarianAI(pCreature); +} + +void AddSC_boss_high_astromancer_solarian() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_high_astromancer_solarian"; + newscript->GetAI = &GetAI_boss_high_astromancer_solarian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_solarium_priest"; + newscript->GetAI = &GetAI_mob_solarium_priest; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp new file mode 100644 index 0000000..b690816 --- /dev/null +++ b/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp @@ -0,0 +1,1514 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kaelthas +SD%Complete: 60 +SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "the_eye.h" +#include "WorldPacket.h" + +enum +{ + //kael'thas Speech + SAY_INTRO = -1550016, + SAY_INTRO_CAPERNIAN = -1550017, + SAY_INTRO_TELONICUS = -1550018, + SAY_INTRO_THALADRED = -1550019, + SAY_INTRO_SANGUINAR = -1550020, + SAY_PHASE2_WEAPON = -1550021, + SAY_PHASE3_ADVANCE = -1550022, + SAY_PHASE4_INTRO2 = -1550023, + SAY_PHASE5_NUTS = -1550024, + SAY_SLAY1 = -1550025, + SAY_SLAY2 = -1550026, + SAY_SLAY3 = -1550027, + SAY_MINDCONTROL1 = -1550028, + SAY_MINDCONTROL2 = -1550029, + SAY_GRAVITYLAPSE1 = -1550030, + SAY_GRAVITYLAPSE2 = -1550031, + SAY_SUMMON_PHOENIX1 = -1550032, + SAY_SUMMON_PHOENIX2 = -1550033, + SAY_DEATH = -1550034, + + //Thaladred the Darkener speech + SAY_THALADRED_AGGRO = -1550035, + SAY_THALADRED_DEATH = -1550036, + EMOTE_THALADRED_GAZE = -1550037, + + //Lord Sanguinar speech + SAY_SANGUINAR_AGGRO = -1550038, + SAY_SANGUINAR_DEATH = -1550039, + + //Grand Astromancer Capernian speech + SAY_CAPERNIAN_AGGRO = -1550040, + SAY_CAPERNIAN_DEATH = -1550041, + + //Master Engineer Telonicus speech + SAY_TELONICUS_AGGRO = -1550042, + SAY_TELONICUS_DEATH = -1550043, + + //Phase 2 spells + SPELL_SUMMON_WEAPONS = 36976, + SPELL_SUMMON_WEAPONA = 36958, + SPELL_SUMMON_WEAPONB = 36959, + SPELL_SUMMON_WEAPONC = 36960, + SPELL_SUMMON_WEAPOND = 36961, + SPELL_SUMMON_WEAPONE = 36962, + SPELL_SUMMON_WEAPONF = 36963, + SPELL_SUMMON_WEAPONG = 36964, + SPELL_RES_VISUAL = 24171, + + //Phase 4 spells + SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell + SPELL_PYROBLAST = 36819, + SPELL_FLAME_STRIKE = 36735, // summons + SPELL_FLAME_STRIKE_DUMMY = 36730, + SPELL_ARCANE_DISRUPTION = 36834, + SPELL_SHOCK_BARRIER = 36815, + SPELL_PHOENIX_ANIMATION = 36723, + SPELL_MIND_CONTROL = 32830, + + //Phase 5 spells + SPELL_EXPLODE = 36092, + SPELL_FULLPOWER = 36187, + SPELL_KNOCKBACK = 11027, + SPELL_GRAVITY_LAPSE = 34480, + SPELL_GRAVITY_LAPSE_AURA = 39432, + SPELL_NETHER_BEAM = 35873, + + //Thaladred the Darkener spells + SPELL_PSYCHIC_BLOW = 10689, + SPELL_SILENCE = 30225, + //Lord Sanguinar spells + SPELL_BELLOWING_ROAR = 40636, + //Grand Astromancer Capernian spells + + SPELL_CAPERNIAN_FIREBALL = 36971, + SPELL_CONFLAGRATION = 37018, + SPELL_ARCANE_EXPLOSION = 36970, + //Master Engineer Telonicus spells + SPELL_BOMB = 37036, + SPELL_REMOTE_TOY = 37027, + //Nether Vapor spell + SPELL_NETHER_VAPOR = 35859, + //Phoenix spell + SPELL_BURN = 36720, + SPELL_EMBER_BLAST = 34341, + SPELL_REBIRTH = 41587, + + //Creature IDs + NPC_FLAME_STRIKE_TRIGGER = 21369, + NPC_PHOENIX = 21362, + NPC_PHOENIX_EGG = 21364, + + //Phoenix egg and phoenix model + MODEL_ID_PHOENIX = 19682, + MODEL_ID_PHOENIX_EGG = 20245, + + MAX_ADVISORS = 4 +}; + +uint32 m_auiSpellSummonWeapon[]= +{ + SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, + SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG +}; + +enum Phases +{ + PHASE_0_NOT_BEGUN = 0, + PHASE_1_ADVISOR = 1, + PHASE_2_WEAPON = 2, + PHASE_3_ADVISOR_ALL = 3, + PHASE_4_SOLO = 4, + PHASE_5_GRAVITY = 5, + PHASE_6_COMPLETE = 6 +}; + +const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target +const float KAEL_VISIBLE_RANGE = 50.0f; + +const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; + +#define TIME_PHASE_2_3 120000 +#define TIME_PHASE_3_4 180000 + +//Base AI for Advisors +struct MANGOS_DLL_DECL advisorbase_ai : public ScriptedAI +{ + advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bDoubled_Health = false; + Reset(); + } + protected: + uint32 m_uiAdvisor_Speech; + + public: + ScriptedInstance* m_pInstance; + bool m_bFakeDeath; + bool m_bDoubled_Health; + uint32 m_uiDelayRes_Timer; + uint64 m_uiDelayRes_Target; + + void Reset() + { + if (m_bDoubled_Health) + { + m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); + m_bDoubled_Health = false; + } + + m_bFakeDeath = false; + m_uiDelayRes_Timer = 0; + m_uiDelayRes_Target = 0; + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //reset encounter + if (m_pInstance && (m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_1_ADVISOR || m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_3_ADVISOR_ALL)) + { + if (Creature* pKaelthas = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_KAELTHAS))) + pKaelthas->AI()->EnterEvadeMode(); + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(pWho); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(pWho); + } + + void Revive(Unit* Target) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // double health for phase 3 + m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); + m_bDoubled_Health = true; + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoCastSpellIfCan(m_creature, SPELL_RES_VISUAL); + m_uiDelayRes_Timer = 2000; + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_3_ADVISOR_ALL) + DoScriptText(m_uiAdvisor_Speech, m_creature); + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage < m_creature->GetHealth()) + return; + + //Prevent glitch if in fake death + if (m_bFakeDeath && m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) != PHASE_0_NOT_BEGUN) + { + damage = 0; + return; + } + + //Don't really die in phase 1 & 3, only die after that + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) != PHASE_0_NOT_BEGUN) + { + //prevent death + damage = 0; + m_bFakeDeath = true; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + JustDied(pKiller); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_uiDelayRes_Timer) + { + if (m_uiDelayRes_Timer <= uiDiff) + { + m_uiDelayRes_Timer = 0; + m_bFakeDeath = false; + + Unit* pTarget = m_creature->GetMap()->GetUnit(m_uiDelayRes_Target); + + if (!pTarget) + pTarget = m_creature->getVictim(); + + DoResetThreat(); + AttackStart(pTarget); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(pTarget); + m_creature->AddThreat(pTarget); + } + else + m_uiDelayRes_Timer -= uiDiff; + } + } + +}; + +//Kael'thas AI +struct MANGOS_DLL_DECL boss_kaelthasAI : public ScriptedAI +{ + boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 m_uiFireball_Timer; + uint32 m_uiArcaneDisruption_Timer; + uint32 m_uiPhoenix_Timer; + uint32 m_uiShockBarrier_Timer; + uint32 m_uiGravityLapse_Timer; + uint32 m_uiGravityLapse_Phase; + uint32 m_uiNetherBeam_Timer; + uint32 m_uiNetherVapor_Timer; + uint32 m_uiFlameStrike_Timer; + uint32 m_uiMindControl_Timer; + uint32 m_uiPhase; + uint32 m_uiPhaseSubphase; //generic + uint32 m_uiPhase_Timer; //generic timer + uint32 m_uiPyrosCasted; + + bool m_bInGravityLapse; + bool m_bIsCastingFireball; + bool m_bChainPyros; + + uint64 m_auiAdvisorGuid[MAX_ADVISORS]; + + void Reset() + { + m_uiFireball_Timer = urand(5000, 15000); + m_uiArcaneDisruption_Timer = 45000; + m_uiMindControl_Timer = 40000; + m_uiPhoenix_Timer = 50000; + m_uiShockBarrier_Timer = 60000; + m_uiFlameStrike_Timer = 30000; + m_uiGravityLapse_Timer = 20000; + m_uiGravityLapse_Phase = 0; + m_uiNetherBeam_Timer = 8000; + m_uiNetherVapor_Timer = 10000; + m_uiPyrosCasted = 0; + m_uiPhase = 0; + m_bInGravityLapse = false; + m_bIsCastingFireball = false; + m_bChainPyros = false; + + if (m_creature->isInCombat()) + PrepareAdvisors(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_0_NOT_BEGUN); + } + + void PrepareAdvisors() + { + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature* pCreature = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[i])) + { + pCreature->Respawn(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->setFaction(m_creature->getFaction()); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + void StartEvent() + { + if (!m_pInstance) + return; + + m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADRED); + m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_SANGUINAR); + m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_CAPERNIAN); + m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_TELONICUS); + + if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) + { + error_log("SD2: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + + m_uiPhase = PHASE_4_SOLO; + + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_4_SOLO); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + AttackStart(pTarget); + + } + else + { + PrepareAdvisors(); + + DoScriptText(SAY_INTRO, m_creature); + + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_1_ADVISOR); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiPhaseSubphase = 0; + m_uiPhase_Timer = 23000; + m_uiPhase = PHASE_1_ADVISOR; + } + } + + void MoveInLineOfSight(Unit* pWho) + { + if (pWho->isTargetableForAttack() && + m_creature->IsHostileTo(pWho) && pWho->isInAccessablePlaceFor(m_creature)) + { + if (!m_creature->CanFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(pWho); + if (m_creature->IsWithinDistInMap(pWho, attackRadius) && m_creature->IsWithinLOSInMap(pWho)) + { + if (!m_creature->getVictim() && m_uiPhase >= PHASE_4_SOLO) + { + pWho->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else if (m_creature->GetMap()->IsDungeon()) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_0_NOT_BEGUN && !m_uiPhase) + StartEvent(); + + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho); + } + } + } + } + + void Aggro(Unit* pWho) + { + if (m_pInstance && m_pInstance->GetData(TYPE_KAELTHAS_PHASE) == PHASE_0_NOT_BEGUN && !m_uiPhase) + StartEvent(); + } + + void KilledUnit(Unit* pUnit) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_FLAME_STRIKE_TRIGGER) + { + pSummoned->CastSpell(pSummoned, SPELL_FLAME_STRIKE_DUMMY, false, NULL, NULL, m_creature->GetGUID()); + return; + } + + if (pSummoned->GetEntry() == NPC_PHOENIX) + { + return; + } + + // if not phoenix or trigger, then it's one of the 7 weapons + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + void JustDied(Unit* pKiller) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_6_COMPLETE); + + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature* pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[i])) + pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Phase 1 + switch (m_uiPhase) + { + case PHASE_1_ADVISOR: + { + Unit* pTarget = NULL; + Creature* pAdvisor = NULL; + + //Subphase switch + switch(m_uiPhaseSubphase) + { + //Subphase 1 - Start + case 0: + if (m_uiPhase_Timer < uiDiff) + { + DoScriptText(SAY_INTRO_THALADRED, m_creature); + + //start advisor within 7 seconds + m_uiPhase_Timer = 7000; + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 1 - Unlock advisor + case 1: + if (m_uiPhase_Timer < uiDiff) + { + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[0]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 2 - Start + case 2: + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[0]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_SANGUINAR, m_creature); + + //start advisor within 12.5 seconds + m_uiPhase_Timer = 12500; + ++m_uiPhaseSubphase; + } + break; + + //Subphase 2 - Unlock advisor + case 3: + if (m_uiPhase_Timer < uiDiff) + { + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[1]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 3 - Start + case 4: + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[1]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); + + //start advisor within 7 seconds + m_uiPhase_Timer = 7000; + ++m_uiPhaseSubphase; + } + break; + + //Subphase 3 - Unlock advisor + case 5: + if (m_uiPhase_Timer < uiDiff) + { + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[2]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + ++m_uiPhaseSubphase; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + + //Subphase 4 - Start + case 6: + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[2]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_TELONICUS, m_creature); + + //start advisor within 8.4 seconds + m_uiPhase_Timer = 8400; + ++m_uiPhaseSubphase; + } + break; + + //Subphase 4 - Unlock advisor + case 7: + if (m_uiPhase_Timer < uiDiff) + { + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[3]); + + if (pAdvisor) + { + pAdvisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAdvisor->setFaction(m_creature->getFaction()); + + pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + if (pTarget) + pAdvisor->AI()->AttackStart(pTarget); + } + + m_uiPhase_Timer = 3000; + ++m_uiPhaseSubphase; + }else m_uiPhase_Timer -= uiDiff; + break; + + //End of phase 1 + case 8: + pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[3]); + + if (pAdvisor && (pAdvisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + m_uiPhase = PHASE_2_WEAPON; + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_2_WEAPON); + + DoScriptText(SAY_PHASE2_WEAPON, m_creature); + + m_uiPhaseSubphase = 0; + m_uiPhase_Timer = 3500; + DoCastSpellIfCan(m_creature, SPELL_SUMMON_WEAPONS); + } + break; + } + + break; + } + + case PHASE_2_WEAPON: + { + if (m_uiPhaseSubphase == 0) + { + if (m_uiPhase_Timer < uiDiff) + { + m_uiPhaseSubphase = 1; + }else m_uiPhase_Timer -= uiDiff; + } + + //Spawn weapons + if (m_uiPhaseSubphase == 1) + { + m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); + + uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); + + for (uint32 i = 0; i < uiMaxWeapon; ++i) + m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); + + m_uiPhaseSubphase = 2; + m_uiPhase_Timer = TIME_PHASE_2_3; + } + + if (m_uiPhaseSubphase == 2) + { + if (m_uiPhase_Timer < uiDiff) + { + DoScriptText(SAY_PHASE3_ADVANCE, m_creature); + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_3_ADVISOR_ALL); + m_uiPhase = PHASE_3_ADVISOR_ALL; + m_uiPhaseSubphase = 0; + } + else + m_uiPhase_Timer -= uiDiff; + } + + break; + } + + case PHASE_3_ADVISOR_ALL: + { + if (m_uiPhaseSubphase == 0) + { + //Respawn advisors + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + for (uint32 i = 0; i < MAX_ADVISORS; ++i) + { + Creature* pAdvisor = m_creature->GetMap()->GetCreature(m_auiAdvisorGuid[i]); + + if (!pAdvisor) + error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); + else + { + if (advisorbase_ai* pAdvisorAI = dynamic_cast(pAdvisor->AI())) + pAdvisorAI->Revive(pTarget); + } + } + + m_uiPhaseSubphase = 1; + m_uiPhase_Timer = TIME_PHASE_3_4; + } + + if (m_uiPhase_Timer < uiDiff) + { + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + m_uiPhase = PHASE_4_SOLO; + + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_4_SOLO); + + // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. + DoResetThreat(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + AttackStart(pTarget); + + m_uiPhase_Timer = 30000; + } + else + m_uiPhase_Timer -= uiDiff; + + break; + } + + case PHASE_4_SOLO: + case 5: + case 6: + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiFireball_Timer + if (!m_bInGravityLapse && !m_bChainPyros && m_uiPhase != 5) + { + if (m_uiFireball_Timer < uiDiff) + { + if (!m_bIsCastingFireball) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + //interruptable + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); + int32 uiDmg = irand(20000, 25000); + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &uiDmg, 0, 0, false); + m_bIsCastingFireball = true; + m_uiFireball_Timer = 2500; + } + } + else + { + //apply resistance + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + m_bIsCastingFireball = false; + m_uiFireball_Timer = urand(5000, 15000); + } + } + else + m_uiFireball_Timer -= uiDiff; + + //m_uiArcaneDisruption_Timer + if (m_uiArcaneDisruption_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, CAST_TRIGGERED); + m_uiArcaneDisruption_Timer = 60000; + } + else + m_uiArcaneDisruption_Timer -= uiDiff; + + //m_uiFlameStrike_Timer + if (m_uiFlameStrike_Timer < uiDiff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_FLAME_STRIKE); + + m_uiFlameStrike_Timer = 30000; + } + else + m_uiFlameStrike_Timer -= uiDiff; + + if (m_uiMindControl_Timer < uiDiff) + { + if (m_creature->getThreatManager().getThreatList().size() >= 2) + for (uint32 i = 0; i < 3; ++i) + { + debug_log("SD2: Kael'Thas mind control not supported."); + //DoCastSpellIfCan(pUnit, SPELL_MIND_CONTROL); + } + + m_uiMindControl_Timer = 60000; + } + else + m_uiMindControl_Timer -= uiDiff; + } + + // Summon Phoenix + if (m_uiPhoenix_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoCastSpellIfCan(pTarget, SPELL_PHOENIX_ANIMATION); + DoScriptText(urand(0, 1) ? SAY_SUMMON_PHOENIX1 : SAY_SUMMON_PHOENIX2, pTarget); + } + + m_uiPhoenix_Timer = 60000; + } + else + m_uiPhoenix_Timer -= uiDiff; + + //Phase 4 specific spells + if (m_uiPhase == PHASE_4_SOLO) + { + if (m_creature->GetHealthPercent() < 50.0f) + { + m_pInstance->SetData(TYPE_KAELTHAS_PHASE, PHASE_5_GRAVITY); + m_uiPhase = PHASE_5_GRAVITY; + m_uiPhase_Timer = 10000; + + DoScriptText(SAY_PHASE5_NUTS, m_creature); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->NearTeleportTo(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0.0f); + + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_FULLPOWER); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + //m_uiShockBarrier_Timer + if (m_uiShockBarrier_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER); + m_bChainPyros = true; + m_uiPyrosCasted = 0; + m_uiShockBarrier_Timer = 60000; + } + else + m_uiShockBarrier_Timer -= uiDiff; + + //Chain Pyros (3 of them max) + if (m_bChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (m_uiPyrosCasted < 3) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PYROBLAST); + ++m_uiPyrosCasted; + } + else + { + m_bChainPyros = false; + m_uiFireball_Timer = 2500; + m_uiArcaneDisruption_Timer = 60000; + } + } + } + + if (m_uiPhase == PHASE_5_GRAVITY) + { + if (m_uiPhase_Timer < uiDiff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); + + DoCastSpellIfCan(m_creature, SPELL_EXPLODE); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_uiPhase = 6; + AttackStart(m_creature->getVictim()); + } + else + m_uiPhase_Timer -= uiDiff; + } + + //Phase 5 + if (m_uiPhase == 6) + { + + //m_uiGravityLapse_Timer + if (m_uiGravityLapse_Timer < uiDiff) + { + switch(m_uiGravityLapse_Phase) + { + case 0: + { + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0.0f); + m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], SPLINETYPE_NORMAL, SPLINEFLAG_NONE, 1); + + // 1) Kael'thas will portal the whole raid right into his body + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + if (pUnit && pUnit->GetTypeId() == TYPEID_PLAYER) + { + //Use work around packet to prevent player from being dropped from combat + DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); + } + } + + m_uiGravityLapse_Timer = 500; + ++m_uiGravityLapse_Phase; + m_bInGravityLapse = true; + m_uiShockBarrier_Timer = 1000; + m_uiNetherBeam_Timer = 5000; + break; + } + case 1: + { + DoScriptText(urand(0, 1) ? SAY_GRAVITYLAPSE1 : SAY_GRAVITYLAPSE2, m_creature); + + // 2) At that point he will put a Gravity Lapse debuff on everyone + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + if (Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid())) + { + m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); + //Gravity lapse - needs an exception in Spell system to work + + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID()); + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID()); + } + } + m_uiGravityLapse_Timer = 10000; + ++m_uiGravityLapse_Phase; + break; + } + case 2: + //Cast nether vapor aura on self + m_creature->InterruptNonMeleeSpells(false); + DoCastSpellIfCan(m_creature, SPELL_NETHER_VAPOR); + + m_uiGravityLapse_Timer = 20000; + ++m_uiGravityLapse_Phase; + break; + + case 3: + { + //Remove flight + m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); + m_bInGravityLapse = false; + m_uiGravityLapse_Timer = 60000; + m_uiGravityLapse_Phase = 0; + AttackStart(m_creature->getVictim()); + break; + } + } + } + else + m_uiGravityLapse_Timer -= uiDiff; + + if (m_bInGravityLapse) + { + //m_uiShockBarrier_Timer + if (m_uiShockBarrier_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_SHOCK_BARRIER); + m_uiShockBarrier_Timer = 20000; + } + else + m_uiShockBarrier_Timer -= uiDiff; + + //m_uiNetherBeam_Timer + if (m_uiNetherBeam_Timer < uiDiff) + { + if (Unit* pUnit = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pUnit, SPELL_NETHER_BEAM); + + m_uiNetherBeam_Timer = 4000; + } + else + m_uiNetherBeam_Timer -= uiDiff; + } + } + + if (!m_bInGravityLapse) + DoMeleeAttackIfReady(); + } + } + } +}; + +//Thaladred the Darkener AI +struct MANGOS_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai +{ + boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_THALADRED_DEATH; + } + + uint32 m_uiGaze_Timer; + uint32 m_uiSilence_Timer; + uint32 m_uiPsychicBlow_Timer; + + void Reset() + { + m_uiGaze_Timer = 100; + m_uiSilence_Timer = 20000; + m_uiPsychicBlow_Timer = 10000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit* pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + + DoScriptText(SAY_THALADRED_AGGRO, m_creature); + m_creature->AddThreat(pWho, 5000000.0f); + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking death, don't do anything + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiGaze_Timer + if (m_uiGaze_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + DoResetThreat(); + m_creature->AddThreat(pTarget, 5000000.0f); + DoScriptText(EMOTE_THALADRED_GAZE, m_creature, pTarget); + } + m_uiGaze_Timer = 8500; + } + else + m_uiGaze_Timer -= uiDiff; + + //m_uiSilence_Timer + if (m_uiSilence_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_SILENCE); + m_uiSilence_Timer = 20000; + } + else + m_uiSilence_Timer -= uiDiff; + + //m_uiPsychicBlow_Timer + if (m_uiPsychicBlow_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); + m_uiPsychicBlow_Timer = urand(20000, 25000); + } + else + m_uiPsychicBlow_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Lord Sanguinar AI +struct MANGOS_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai +{ + boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_SANGUINAR_DEATH; + } + + uint32 m_uiFear_Timer; + + void Reset() + { + m_uiFear_Timer = 20000; + advisorbase_ai::Reset(); + } + + void Aggro(Unit* pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + + DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking death, don't do anything + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiFear_Timer + if (m_uiFear_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BELLOWING_ROAR); + m_uiFear_Timer = urand(25000, 35000); //approximately every 30 seconds + } + else + m_uiFear_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Grand Astromancer Capernian AI +struct MANGOS_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai +{ + boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_CAPERNIAN_DEATH; + } + + uint32 m_uiFireball_Timer; + uint32 m_uiConflagration_Timer; + uint32 m_uiArcaneExplosion_Timer; + uint32 m_uiYell_Timer; + bool m_bYell; + + void Reset() + { + m_uiFireball_Timer = 2000; + m_uiConflagration_Timer = 20000; + m_uiArcaneExplosion_Timer = 5000; + m_uiYell_Timer = 2000; + m_bYell = false; + + advisorbase_ai::Reset(); + } + + void AttackStart(Unit* pWho) + { + if (!pWho || m_bFakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, CAPERNIAN_DISTANCE); + } + } + + void Aggro(Unit *pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking Death, don't do anything + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiYell_Timer + if (!m_bYell) + { + if (m_uiYell_Timer < uiDiff) + { + DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); + m_bYell = true; + } + else + m_uiYell_Timer -= uiDiff; + } + + //m_uiFireball_Timer + if (m_uiFireball_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); + m_uiFireball_Timer = 4000; + } + else + m_uiFireball_Timer -= uiDiff; + + //m_uiConflagration_Timer + if (m_uiConflagration_Timer < uiDiff) + { + Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0); + + if (pTarget && m_creature->IsWithinDistInMap(pTarget, 30.0f)) + DoCastSpellIfCan(pTarget, SPELL_CONFLAGRATION); + else + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CONFLAGRATION); + + m_uiConflagration_Timer = urand(10000, 15000); + } + else + m_uiConflagration_Timer -= uiDiff; + + //m_uiArcaneExplosion_Timer + if (m_uiArcaneExplosion_Timer < uiDiff) + { + bool m_bInMeleeRange = false; + Unit* pTarget = NULL; + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator i = tList.begin();i != tList.end(); ++i) + { + Unit* pUnit = m_creature->GetMap()->GetUnit((*i)->getUnitGuid()); + + //if in melee range + if (pUnit && pUnit->IsWithinDistInMap(m_creature, ATTACK_DISTANCE)) + { + m_bInMeleeRange = true; + pTarget = pUnit; + break; + } + } + + if (m_bInMeleeRange) + DoCastSpellIfCan(pTarget, SPELL_ARCANE_EXPLOSION); + + m_uiArcaneExplosion_Timer = urand(4000, 6000); + } + else + m_uiArcaneExplosion_Timer -= uiDiff; + + //Do NOT deal any melee damage. + } +}; + +//Master Engineer Telonicus AI +struct MANGOS_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai +{ + boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) + { + m_uiAdvisor_Speech = SAY_TELONICUS_DEATH; + } + + uint32 m_uiBomb_Timer; + uint32 m_uiRemoteToy_Timer; + + void Reset() + { + m_uiBomb_Timer = 10000; + m_uiRemoteToy_Timer = 5000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit *pWho) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!pWho || m_bFakeDeath) + return; + + DoScriptText(SAY_TELONICUS_AGGRO, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + advisorbase_ai::UpdateAI(uiDiff); + + //Faking Death, do nothing + if (m_bFakeDeath) + return; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //m_uiBomb_Timer + if (m_uiBomb_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BOMB); + m_uiBomb_Timer = 25000; + } + else + m_uiBomb_Timer -= uiDiff; + + //m_uiRemoteToy_Timer + if (m_uiRemoteToy_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_REMOTE_TOY); + + m_uiRemoteToy_Timer = urand(10000, 15000); + } + else + m_uiRemoteToy_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix AI +struct MANGOS_DLL_DECL mob_phoenix_tkAI : public ScriptedAI +{ + mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiCycle_Timer; + + void Reset() + { + m_uiCycle_Timer = 2000; + m_creature->CastSpell(m_creature,SPELL_BURN,true); + } + + void JustDied(Unit* pKiller) + { + //is this spell in use anylonger? + //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); + m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiCycle_Timer < uiDiff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 uiDmg = urand(4500,5500); + + if (m_creature->GetHealth() > uiDmg) + m_creature->SetHealth(uint32(m_creature->GetHealth()-uiDmg)); + + m_uiCycle_Timer = 2000; + } + else + m_uiCycle_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix Egg AI +struct MANGOS_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI +{ + mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiRebirth_Timer; + + void Reset() + { + m_uiRebirth_Timer = 15000; + } + + //ignore any + void MoveInLineOfSight(Unit* pWho) { return; } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, false)) + { + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + DoStartNoMovement(pWho); + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AddThreat(m_creature->getVictim()); + pSummoned->CastSpell(pSummoned,SPELL_REBIRTH,false); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_uiRebirth_Timer) + return; + + if (m_uiRebirth_Timer <= uiDiff) + { + m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); + m_uiRebirth_Timer = 0; + } + else + m_uiRebirth_Timer -= uiDiff; + } +}; + +CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) +{ + return new boss_kaelthasAI(pCreature); +} + +CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) +{ + return new boss_thaladred_the_darkenerAI(pCreature); +} + +CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) +{ + return new boss_lord_sanguinarAI(pCreature); +} + +CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) +{ + return new boss_grand_astromancer_capernianAI(pCreature); +} + +CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) +{ + return new boss_master_engineer_telonicusAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) +{ + return new mob_phoenix_tkAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) +{ + return new mob_phoenix_egg_tkAI(pCreature); +} + +void AddSC_boss_kaelthas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kaelthas"; + newscript->GetAI = &GetAI_boss_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_thaladred_the_darkener"; + newscript->GetAI = &GetAI_boss_thaladred_the_darkener; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_sanguinar"; + newscript->GetAI = &GetAI_boss_lord_sanguinar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_grand_astromancer_capernian"; + newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_master_engineer_telonicus"; + newscript->GetAI = &GetAI_boss_master_engineer_telonicus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_tk"; + newscript->GetAI = &GetAI_mob_phoenix_tk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_egg_tk"; + newscript->GetAI = &GetAI_mob_phoenix_egg_tk; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp b/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp new file mode 100644 index 0000000..1b808f2 --- /dev/null +++ b/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp @@ -0,0 +1,179 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Void_Reaver +SD%Complete: 90 +SDComment: Should reset if raid are out of room. +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "the_eye.h" + +#define SAY_AGGRO -1550000 +#define SAY_SLAY1 -1550001 +#define SAY_SLAY2 -1550002 +#define SAY_SLAY3 -1550003 +#define SAY_DEATH -1550004 +#define SAY_POUNDING1 -1550005 +#define SAY_POUNDING2 -1550006 + +#define SPELL_POUNDING 34162 +#define SPELL_ARCANE_ORB_MISSILE 34172 +#define SPELL_KNOCK_AWAY 25778 +#define SPELL_BERSERK 26662 + +//Unknown function. If target not found, this will be created and used as dummy target instead? +//#define CREATURE_ORB_TARGET 19577 + +struct MANGOS_DLL_DECL boss_void_reaverAI : public ScriptedAI +{ + boss_void_reaverAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + uint32 Pounding_Timer; + uint32 ArcaneOrb_Timer; + uint32 KnockAway_Timer; + uint32 Berserk_Timer; + + void Reset() + { + Pounding_Timer = 15000; + ArcaneOrb_Timer = 3000; + KnockAway_Timer = 30000; + Berserk_Timer = 600000; + + if (m_pInstance && m_creature->isAlive()) + m_pInstance->SetData(TYPE_VOIDREAVER, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOIDREAVER, DONE); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetInCombatWithZone(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOIDREAVER, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + // Pounding + if (Pounding_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_POUNDING); + DoScriptText(urand(0, 1) ? SAY_POUNDING1 : SAY_POUNDING2, m_creature); + + Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) + }else Pounding_Timer -= diff; + + // Arcane Orb + if (ArcaneOrb_Timer < diff) + { + Unit *target = NULL; + std::vector target_list; + + ThreatList const& tList = m_creature->getThreatManager().getThreatList(); + for (ThreatList::const_iterator itr = tList.begin();itr != tList.end(); ++itr) + { + target = m_creature->GetMap()->GetUnit((*itr)->getUnitGuid()); + + // exclude pets & totems + if (!target || target->GetTypeId() != TYPEID_PLAYER) + continue; + + //18 yard radius minimum + if (target->IsWithinDist(m_creature, 18.0f, false)) + continue; + + target_list.push_back(target); + } + + if (target_list.size()) + target = *(target_list.begin()+rand()%target_list.size()); + else + target = m_creature->getVictim(); + + if (target) + DoCastSpellIfCan(target, SPELL_ARCANE_ORB_MISSILE); + + ArcaneOrb_Timer = 3000; + }else ArcaneOrb_Timer -= diff; + + // Single Target knock back, reduces aggro + if (KnockAway_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCK_AWAY); + + KnockAway_Timer = 30000; + }else KnockAway_Timer -= diff; + + //Berserk + if (Berserk_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCastSpellIfCan(m_creature,SPELL_BERSERK); + Berserk_Timer = 600000; + }else Berserk_Timer -= diff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(diff); + } +}; + +CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) +{ + return new boss_void_reaverAI(pCreature); +} + +void AddSC_boss_void_reaver() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_void_reaver"; + newscript->GetAI = &GetAI_boss_void_reaver; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp b/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp new file mode 100644 index 0000000..3992f68 --- /dev/null +++ b/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp @@ -0,0 +1,161 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "the_eye.h" + +/* The Eye encounters: +0 - Kael'thas event +1 - Al' ar event +2 - Solarian Event +3 - Void Reaver event +*/ + +struct MANGOS_DLL_DECL instance_the_eye : public ScriptedInstance +{ + instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiThaladredGUID; + uint64 m_uiSanguinarGUID; + uint64 m_uiCapernianGUID; + uint64 m_uiTelonicusGUID; + uint64 m_uiKaelthasGUID; + uint64 m_uiAstromancerGUID; + + uint32 m_uiKaelthasEventPhase; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiThaladredGUID = 0; + m_uiSanguinarGUID = 0; + m_uiCapernianGUID = 0; + m_uiTelonicusGUID = 0; + m_uiKaelthasGUID = 0; + m_uiAstromancerGUID = 0; + + m_uiKaelthasEventPhase = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature) + { + switch(pCreature->GetEntry()) + { + case 20064: m_uiThaladredGUID = pCreature->GetGUID(); break; + case 20063: m_uiTelonicusGUID = pCreature->GetGUID(); break; + case 20062: m_uiCapernianGUID = pCreature->GetGUID(); break; + case 20060: m_uiSanguinarGUID = pCreature->GetGUID(); break; + case 19622: m_uiKaelthasGUID = pCreature->GetGUID(); break; + case 18805: m_uiAstromancerGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_ALAR: + m_auiEncounter[0] = uiData; + break; + case TYPE_SOLARIAN: + m_auiEncounter[1] = uiData; + break; + case TYPE_VOIDREAVER: + m_auiEncounter[2] = uiData; + break; + case TYPE_ASTROMANCER: + m_auiEncounter[3] = uiData; + break; + + case TYPE_KAELTHAS_PHASE: + m_uiKaelthasEventPhase = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_ALAR: + return m_auiEncounter[0]; + case TYPE_SOLARIAN: + return m_auiEncounter[1]; + case TYPE_VOIDREAVER: + return m_auiEncounter[2]; + case TYPE_ASTROMANCER: + return m_auiEncounter[3]; + + case TYPE_KAELTHAS_PHASE: + return m_uiKaelthasEventPhase; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_THALADRED: + return m_uiThaladredGUID; + case DATA_SANGUINAR: + return m_uiSanguinarGUID; + case DATA_CAPERNIAN: + return m_uiCapernianGUID; + case DATA_TELONICUS: + return m_uiTelonicusGUID; + case DATA_KAELTHAS: + return m_uiKaelthasGUID; + case DATA_ASTROMANCER: + return m_uiAstromancerGUID; + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_the_eye(Map* pMap) +{ + return new instance_the_eye(pMap); +} + +void AddSC_instance_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_the_eye"; + newscript->GetInstanceData = &GetInstanceData_instance_the_eye; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_eye/the_eye.cpp b/scripts/outland/tempest_keep/the_eye/the_eye.cpp new file mode 100644 index 0000000..390c079 --- /dev/null +++ b/scripts/outland/tempest_keep/the_eye/the_eye.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +/* ContentData +mob_crystalcore_devastator +EndContentData */ + +#include "precompiled.h" +#include "the_eye.h" + +#define SPELL_COUNTERCHARGE 35035 +#define SPELL_KNOCKAWAY 22893 + +struct MANGOS_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI +{ + mob_crystalcore_devastatorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 Knockaway_Timer; + uint32 Countercharge_Timer; + + void Reset() + { + Countercharge_Timer = 9000; + Knockaway_Timer = 25000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Check if we have a current target + //Knockaway_Timer + if (Knockaway_Timer < diff) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 0); + + if (!Target || Target == m_creature->getVictim()) + Target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_TOPAGGRO, 1); + + if (Target) + m_creature->TauntApply(Target); + + Knockaway_Timer = 23000; + } + else Knockaway_Timer -= diff; + + //Countercharge_Timer + if (Countercharge_Timer < diff) + { + DoCastSpellIfCan(this->m_creature,SPELL_COUNTERCHARGE); + Countercharge_Timer = 45000; + }else Countercharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) +{ + return new mob_crystalcore_devastatorAI(pCreature); +} + +void AddSC_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_crystalcore_devastator"; + newscript->GetAI = &GetAI_mob_crystalcore_devastator; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_eye/the_eye.h b/scripts/outland/tempest_keep/the_eye/the_eye.h new file mode 100644 index 0000000..0b02489 --- /dev/null +++ b/scripts/outland/tempest_keep/the_eye/the_eye.h @@ -0,0 +1,27 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_THE_EYE_H +#define DEF_THE_EYE_H + +enum +{ + MAX_ENCOUNTER = 4, + + TYPE_ALAR = 1, + TYPE_ASTROMANCER = 2, + TYPE_SOLARIAN = 3, + TYPE_VOIDREAVER = 4, + TYPE_KAELTHAS_PHASE = 5, //not regular encounter, contains phase instead + + DATA_ASTROMANCER = 8, + DATA_KAELTHAS = 9, + + DATA_CAPERNIAN = 10, + DATA_SANGUINAR = 11, + DATA_TELONICUS = 12, + DATA_THALADRED = 13 +}; + +#endif diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp new file mode 100644 index 0000000..7cea388 --- /dev/null +++ b/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp @@ -0,0 +1,37 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gatewatcher_Gyrokill +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554000 +#define SAY_SAW_ATTACK1 -1554001 +#define SAY_SAW_ATTACK2 -1554002 +#define SAY_SLAY1 -1554003 +#define SAY_SLAY2 -1554004 +#define SAY_DEATH -1554005 + +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 +#define SPELL_SAW_BLADE 35318 +#define H_SPELL_SAW_BLADE 39192 +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp new file mode 100644 index 0000000..7873719 --- /dev/null +++ b/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -0,0 +1,136 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gatewatcher_Ironhand +SD%Complete: 75 +SDComment: +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1554006 +#define SAY_HAMMER_1 -1554007 +#define SAY_HAMMER_2 -1554008 +#define SAY_SLAY_1 -1554009 +#define SAY_SLAY_2 -1554010 +#define SAY_DEATH_1 -1554011 +#define EMOTE_HAMMER -1554012 + +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 +#define SPELL_HAMMER_PUNCH 35326 +#define SPELL_JACKHAMMER 35327 +#define H_SPELL_JACKHAMMER 39194 +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 + +struct MANGOS_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI +{ + boss_gatewatcher_iron_handAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 Shadow_Power_Timer; + uint32 Jackhammer_Timer; + uint32 Stream_of_Machine_Fluid_Timer; + + void Reset() + { + Shadow_Power_Timer = 25000; + Jackhammer_Timer = 45000; + Stream_of_Machine_Fluid_Timer = 55000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO_1, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (urand(0, 1)) + return; + + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH_1, m_creature); + + if (!m_pInstance) + return; + + //TODO: Add door check/open code + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Shadow Power + if (Shadow_Power_Timer < diff) + { + DoCastSpellIfCan(m_creature, m_bIsRegularMode ? SPELL_SHADOW_POWER : H_SPELL_SHADOW_POWER); + Shadow_Power_Timer = urand(20000, 28000); + }else Shadow_Power_Timer -= diff; + + //Jack Hammer + if (Jackhammer_Timer < diff) + { + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoScriptText(EMOTE_HAMMER, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_JACKHAMMER : H_SPELL_JACKHAMMER); + + //chance to yell, but not same time as emote (after spell in fact casted) + if (urand(0, 4)) + DoScriptText(urand(0, 1) ? SAY_HAMMER_1 : SAY_HAMMER_2, m_creature); + + Jackhammer_Timer = 30000; + }else Jackhammer_Timer -= diff; + + //Stream of Machine Fluid + if (Stream_of_Machine_Fluid_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); + Stream_of_Machine_Fluid_Timer = urand(35000, 50000); + }else Stream_of_Machine_Fluid_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) +{ + return new boss_gatewatcher_iron_handAI(pCreature); +} + +void AddSC_boss_gatewatcher_iron_hand() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_gatewatcher_iron_hand"; + newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp new file mode 100644 index 0000000..60fd06b --- /dev/null +++ b/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -0,0 +1,247 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Nethermancer_Sepethrea +SD%Complete: 90 +SDComment: Need adjustments to initial summons +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "mechanar.h" + +#define SAY_AGGRO -1554013 +#define SAY_SUMMON -1554014 +#define SAY_DRAGONS_BREATH_1 -1554015 +#define SAY_DRAGONS_BREATH_2 -1554016 +#define SAY_SLAY1 -1554017 +#define SAY_SLAY2 -1554018 +#define SAY_DEATH -1554019 + +#define SPELL_SUMMON_RAGIN_FLAMES 35275 + +#define SPELL_FROST_ATTACK 35263 +#define SPELL_ARCANE_BLAST 35314 +#define SPELL_DRAGONS_BREATH 35250 +#define SPELL_KNOCKBACK 37317 +#define SPELL_SOLARBURN 35267 + +struct MANGOS_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI +{ + boss_nethermancer_sepethreaAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 frost_attack_Timer; + uint32 arcane_blast_Timer; + uint32 dragons_breath_Timer; + uint32 knockback_Timer; + uint32 solarburn_Timer; + + void Reset() + { + frost_attack_Timer = urand(7000, 10000); + arcane_blast_Timer = urand(12000, 18000); + dragons_breath_Timer = urand(18000, 22000); + knockback_Timer = urand(22000, 28000); + solarburn_Timer = 30000; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + //Summon two guards, three in heroic + uint8 am = (m_bIsRegularMode ? 2 : 1); + for(int i = 0; i < am; ++i) + { + DoCastSpellIfCan(who,SPELL_SUMMON_RAGIN_FLAMES); + } + + DoScriptText(SAY_SUMMON, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY1 : SAY_SLAY2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SEPETHREA, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Frost Attack + if (frost_attack_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROST_ATTACK); + frost_attack_Timer = urand(7000, 10000); + }else frost_attack_Timer -= diff; + + //Arcane Blast + if (arcane_blast_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_BLAST); + arcane_blast_Timer = 15000; + }else arcane_blast_Timer -= diff; + + //Dragons Breath + if (dragons_breath_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_DRAGONS_BREATH); + + if (urand(0, 1)) + DoScriptText(urand(0, 1) ? SAY_DRAGONS_BREATH_1 : SAY_DRAGONS_BREATH_2, m_creature); + + dragons_breath_Timer = urand(12000, 22000); + }else dragons_breath_Timer -= diff; + + //Check for Knockback + if (knockback_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_KNOCKBACK); + knockback_Timer = urand(15000, 25000); + }else knockback_Timer -= diff; + + //Check for Solarburn + if (solarburn_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SOLARBURN); + solarburn_Timer = 30000; + }else solarburn_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) +{ + return new boss_nethermancer_sepethreaAI(pCreature); +} + +#define SPELL_INFERNO 35268 +#define H_SPELL_INFERNO 39346 +#define SPELL_FIRE_TAIL 35278 + +struct MANGOS_DLL_DECL mob_ragin_flamesAI : public ScriptedAI +{ + mob_ragin_flamesAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = (ScriptedInstance*)pCreature->GetInstanceData(); + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsRegularMode; + + uint32 inferno_Timer; + uint32 flame_timer; + uint32 Check_Timer; + + bool onlyonce; + + void Reset() + { + inferno_Timer = 10000; + flame_timer = 500; + Check_Timer = 2000; + onlyonce = false; + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (!onlyonce) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0)) + m_creature->GetMotionMaster()->MoveChase(target); + onlyonce = true; + } + + if (inferno_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(), m_bIsRegularMode ? SPELL_INFERNO : H_SPELL_INFERNO); + + m_creature->TauntApply(m_creature->getVictim()); + + inferno_Timer = 10000; + }else inferno_Timer -= diff; + + if (flame_timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_FIRE_TAIL); + flame_timer = 500; + }else flame_timer -=diff; + + //Check_Timer + if (Check_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_SEPETHREA) == DONE) + { + //remove + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + + Check_Timer = 1000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) +{ + return new mob_ragin_flamesAI(pCreature); +} +void AddSC_boss_nethermancer_sepethrea() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_nethermancer_sepethrea"; + newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ragin_flames"; + newscript->GetAI = &GetAI_mob_ragin_flames; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp new file mode 100644 index 0000000..dc64d95 --- /dev/null +++ b/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -0,0 +1,239 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Pathaleon the Calculator +SD%Complete: 50 +SDComment: Event missing. Script for himself 99% blizzlike. +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554020 +#define SAY_DOMINATION_1 -1554021 +#define SAY_DOMINATION_2 -1554022 +#define SAY_SUMMON -1554023 +#define SAY_ENRAGE -1554024 +#define SAY_SLAY_1 -1554025 +#define SAY_SLAY_2 -1554026 +#define SAY_DEATH -1554027 + +// Spells to be casted +#define SPELL_MANA_TAP 36021 +#define SPELL_ARCANE_TORRENT 36022 +#define SPELL_DOMINATION 35280 +#define H_SPELL_ARCANE_EXPLOSION 15453 +#define SPELL_FRENZY 36992 + +#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented +#define SPELL_SUMMON_NETHER_WRAITH_2 35286 +#define SPELL_SUMMON_NETHER_WRAITH_3 35287 +#define SPELL_SUMMON_NETHER_WRAITH_4 35288 + +// Add Spells +#define SPELL_DETONATION 35058 +#define SPELL_ARCANE_MISSILES 35034 + +struct MANGOS_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI +{ + boss_pathaleon_the_calculatorAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_bIsRegularMode = pCreature->GetMap()->IsRegularDifficulty(); + Reset(); + } + + bool m_bIsRegularMode; + + uint32 Summon_Timer; + uint32 ManaTap_Timer; + uint32 ArcaneTorrent_Timer; + uint32 Domination_Timer; + uint32 ArcaneExplosion_Timer; + bool Enraged; + + uint32 Counter; + + void Reset() + { + Summon_Timer = 30000; + ManaTap_Timer = urand(12000, 20000); + ArcaneTorrent_Timer = urand(16000, 25000); + Domination_Timer = urand(25000, 40000); + ArcaneExplosion_Timer = urand(8000, 13000); + + Enraged = false; + Counter = 0; + } + + void Aggro(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(urand(0, 1) ? SAY_SLAY_1 : SAY_SLAY_2, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Summon_Timer < diff) + { + for(int i = 0; i < 3; ++i) + { + Unit* target = NULL; + target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,0); + Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (target && Wraith) + Wraith->AI()->AttackStart(target); + } + + DoScriptText(SAY_SUMMON, m_creature); + + Summon_Timer = urand(30000, 45000); + }else Summon_Timer -= diff; + + if (ManaTap_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_MANA_TAP); + ManaTap_Timer = urand(14000, 22000); + }else ManaTap_Timer -= diff; + + if (ArcaneTorrent_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_TORRENT); + ArcaneTorrent_Timer = urand(12000, 18000); + }else ArcaneTorrent_Timer -= diff; + + if (Domination_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + { + DoScriptText(urand(0, 1) ? SAY_DOMINATION_1 : SAY_DOMINATION_2, m_creature); + DoCastSpellIfCan(target,SPELL_DOMINATION); + } + + Domination_Timer = urand(25000, 30000); + }else Domination_Timer -= diff; + + //Only casting if Heroic Mode is used + if (!m_bIsRegularMode) + { + if (ArcaneExplosion_Timer < diff) + { + DoCastSpellIfCan(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = urand(10000, 14000); + }else ArcaneExplosion_Timer -= diff; + } + + if (!Enraged && m_creature->GetHealthPercent() < 21.0f) + { + DoCastSpellIfCan(m_creature, SPELL_FRENZY); + DoScriptText(SAY_ENRAGE, m_creature); + Enraged = true; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) +{ + return new boss_pathaleon_the_calculatorAI(pCreature); +} + +struct MANGOS_DLL_DECL mob_nether_wraithAI : public ScriptedAI +{ + mob_nether_wraithAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + ScriptedInstance* m_pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 Detonation_Timer; + uint32 Die_Timer; + bool Detonation; + + void Reset() + { + ArcaneMissiles_Timer = urand(1000, 4000); + Detonation_Timer = 20000; + Die_Timer = 2200; + Detonation = false; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (ArcaneMissiles_Timer < diff) + { + if (Unit* target = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM,1)) + DoCastSpellIfCan(target,SPELL_ARCANE_MISSILES); + else + DoCastSpellIfCan(m_creature->getVictim(),SPELL_ARCANE_MISSILES); + + ArcaneMissiles_Timer = urand(5000, 10000); + }else ArcaneMissiles_Timer -=diff; + + if (!Detonation) + { + if (Detonation_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_DETONATION); + Detonation = true; + }else Detonation_Timer -= diff; + } + + if (Detonation) + { + if (Die_Timer < diff) + { + m_creature->SetDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + }else Die_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) +{ + return new mob_nether_wraithAI(pCreature); +} + +void AddSC_boss_pathaleon_the_calculator() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_pathaleon_the_calculator"; + newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_nether_wraith"; + newscript->GetAI = &GetAI_mob_nether_wraith; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp b/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp new file mode 100644 index 0000000..6f52374 --- /dev/null +++ b/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Mechanar +SD%Complete: 20 +SDComment: +SDCategory: Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "mechanar.h" + +struct MANGOS_DLL_DECL instance_mechanar : public ScriptedInstance +{ + instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_SEPETHREA: + m_auiEncounter[0] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_SEPETHREA) + return m_auiEncounter[0]; + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_mechanar(Map* pMap) +{ + return new instance_mechanar(pMap); +} + +void AddSC_instance_mechanar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_mechanar"; + newscript->GetInstanceData = &GetInstanceData_instance_mechanar; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/tempest_keep/the_mechanar/mechanar.h b/scripts/outland/tempest_keep/the_mechanar/mechanar.h new file mode 100644 index 0000000..25ce26e --- /dev/null +++ b/scripts/outland/tempest_keep/the_mechanar/mechanar.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MECHANAR_H +#define DEF_MECHANAR_H + +enum +{ + MAX_ENCOUNTER = 1, + + TYPE_SEPETHREA = 1 +}; + +#endif diff --git a/scripts/outland/terokkar_forest.cpp b/scripts/outland/terokkar_forest.cpp new file mode 100644 index 0000000..2bfbdef --- /dev/null +++ b/scripts/outland/terokkar_forest.cpp @@ -0,0 +1,1008 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Terokkar_Forest +SD%Complete: 80 +SDComment: Quest support: 9889, 10009, 10873, 10896, 10446/10447, 10852, 10887, 10922, 11096. Skettis->Ogri'la Flight +SDCategory: Terokkar Forest +EndScriptData */ + +/* ContentData +mob_unkor_the_ruthless +mob_infested_root_walker +mob_rotting_forest_rager +mob_netherweb_victim +npc_akuno +npc_floon +npc_letoll +npc_mana_bomb_exp_trigger +go_mana_bomb +npc_skyguard_handler_deesak +npc_slim +go_veil_skith_cage +npc_captive_child +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## mob_unkor_the_ruthless +######*/ + +#define SAY_SUBMIT -1000194 + +#define FACTION_HOSTILE 45 +#define FACTION_FRIENDLY 35 +#define QUEST_DONTKILLTHEFATONE 9889 + +#define SPELL_PULVERIZE 2676 +//#define SPELL_QUID9889 32174 + +struct MANGOS_DLL_DECL mob_unkor_the_ruthlessAI : public ScriptedAI +{ + mob_unkor_the_ruthlessAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + bool CanDoQuest; + uint32 UnkorUnfriendly_Timer; + uint32 Pulverize_Timer; + + void Reset() + { + CanDoQuest = false; + UnkorUnfriendly_Timer = 0; + Pulverize_Timer = 3000; + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->setFaction(FACTION_HOSTILE); + } + + void DoNice() + { + DoScriptText(SAY_SUBMIT, m_creature); + m_creature->setFaction(FACTION_FRIENDLY); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + UnkorUnfriendly_Timer = 60000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + if ((m_creature->GetHealth()-damage)*100 / m_creature->GetMaxHealth() < 30) + { + if (Group* pGroup = ((Player*)done_by)->GetGroup()) + { + for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next()) + { + Player *pGroupie = itr->getSource(); + if (pGroupie && + pGroupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + pGroupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + { + pGroupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + if (!CanDoQuest) + CanDoQuest = true; + } + } + } else + if (((Player*)done_by)->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE && + ((Player*)done_by)->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10) + { + ((Player*)done_by)->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE); + CanDoQuest = true; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (CanDoQuest) + { + if (!UnkorUnfriendly_Timer) + { + //DoCastSpellIfCan(m_creature,SPELL_QUID9889); //not using spell for now + DoNice(); + } + else + { + if (UnkorUnfriendly_Timer <= diff) + { + EnterEvadeMode(); + }else UnkorUnfriendly_Timer -= diff; + } + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (Pulverize_Timer < diff) + { + DoCastSpellIfCan(m_creature,SPELL_PULVERIZE); + Pulverize_Timer = 9000; + }else Pulverize_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_unkor_the_ruthless(Creature* pCreature) +{ + return new mob_unkor_the_ruthlessAI(pCreature); +} + +/*###### +## mob_infested_root_walker +######*/ + +struct MANGOS_DLL_DECL mob_infested_root_walkerAI : public ScriptedAI +{ + mob_infested_root_walkerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by && done_by->GetTypeId() == TYPEID_PLAYER) + if (m_creature->GetHealth() <= damage) + if (urand(0, 3)) + //Summon Wood Mites + m_creature->CastSpell(m_creature,39130,true); + } +}; +CreatureAI* GetAI_mob_infested_root_walker(Creature* pCreature) +{ + return new mob_infested_root_walkerAI(pCreature); +} + +/*###### +## mob_rotting_forest_rager +######*/ + +struct MANGOS_DLL_DECL mob_rotting_forest_ragerAI : public ScriptedAI +{ + mob_rotting_forest_ragerAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() { } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetTypeId() == TYPEID_PLAYER) + if (m_creature->GetHealth() <= damage) + if (urand(0, 3)) + //Summon Lots of Wood Mights + m_creature->CastSpell(m_creature,39134,true); + } +}; +CreatureAI* GetAI_mob_rotting_forest_rager(Creature* pCreature) +{ + return new mob_rotting_forest_ragerAI(pCreature); +} + +/*###### +## mob_netherweb_victim +######*/ + +enum +{ + NPC_FREED_WARRIOR = 22459, + QUEST_TAKEN_IN_NIGHT = 10873 + //SPELL_FREE_WEBBED = 38950 +}; + +const uint32 netherwebVictims[6] = +{ + 18470, 16805, 21242, 18452, 22482, 21285 +}; +struct MANGOS_DLL_DECL mob_netherweb_victimAI : public ScriptedAI +{ + mob_netherweb_victimAI(Creature* pCreature) : ScriptedAI(pCreature) + { + SetCombatMovement(false); + Reset(); + } + + void Reset() { } + void MoveInLineOfSight(Unit* pWho) { } + + void JustDied(Unit* pKiller) + { + if (pKiller->GetTypeId() == TYPEID_PLAYER) + { + if (((Player*)pKiller)->GetQuestStatus(QUEST_TAKEN_IN_NIGHT) == QUEST_STATUS_INCOMPLETE) + { + if (!urand(0, 3)) + { + m_creature->SummonCreature(NPC_FREED_WARRIOR, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + ((Player*)pKiller)->KilledMonsterCredit(NPC_FREED_WARRIOR, m_creature->GetGUID()); + } + else + m_creature->SummonCreature(netherwebVictims[rand()%6], 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + } + } + } +}; + +CreatureAI* GetAI_mob_netherweb_victim(Creature* pCreature) +{ + return new mob_netherweb_victimAI(pCreature); +} + +/*##### +## npc_akuno +#####*/ + +enum +{ + SAY_AKU_START = -1000477, + SAY_AKU_AMBUSH_A = -1000478, + SAY_AKU_AMBUSH_B = -1000479, + SAY_AKU_AMBUSH_B_REPLY = -1000480, + SAY_AKU_COMPLETE = -1000481, + + SPELL_CHAIN_LIGHTNING = 39945, + + QUEST_ESCAPING_TOMB = 10887, + NPC_CABAL_SKIRMISHER = 21661 +}; + +static float m_afAmbushB1[]= {-2895.525879f, 5336.431641f, -11.800f}; +static float m_afAmbushB2[]= {-2890.604980f, 5331.938965f, -11.282f}; + +struct MANGOS_DLL_DECL npc_akunoAI : public npc_escortAI +{ + npc_akunoAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + uint32 m_uiChainLightningTimer; + + void Reset() + { + m_uiChainLightningTimer = 1000; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 5: + DoScriptText(SAY_AKU_AMBUSH_A, m_creature); + m_creature->SummonCreature(NPC_CABAL_SKIRMISHER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 14: + DoScriptText(SAY_AKU_AMBUSH_B, m_creature); + + if (Creature* pTemp = m_creature->SummonCreature(NPC_CABAL_SKIRMISHER, m_afAmbushB1[0], m_afAmbushB1[1], m_afAmbushB1[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000)) + DoScriptText(SAY_AKU_AMBUSH_B_REPLY, pTemp); + + m_creature->SummonCreature(NPC_CABAL_SKIRMISHER, m_afAmbushB2[0], m_afAmbushB2[1], m_afAmbushB2[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 15: + SetRun(); + break; + case 18: + DoScriptText(SAY_AKU_COMPLETE, m_creature); + + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->GroupEventHappens(QUEST_ESCAPING_TOMB, m_creature); + + break; + } + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiChainLightningTimer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); + m_uiChainLightningTimer = urand(7000, 14000); + } + else + m_uiChainLightningTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +bool QuestAccept_npc_akuno(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPING_TOMB) + { + if (npc_akunoAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_ACTIVE); + + DoScriptText(SAY_AKU_START, pCreature); + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + } + return true; +} + +CreatureAI* GetAI_npc_akuno(Creature* pCreature) +{ + return new npc_akunoAI(pCreature); +} + +/*###### +## npc_floon +######*/ + +enum +{ + SAY_FLOON_ATTACK = -1000195, + + SPELL_SILENCE = 6726, + SPELL_FROSTBOLT = 9672, + SPELL_FROST_NOVA = 11831, + + FACTION_HOSTILE_FL = 1738, + QUEST_CRACK_SKULLS = 10009 +}; + +#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!" +#define GOSSIP_FLOON2 "Hand over the money or die...again!" + +struct MANGOS_DLL_DECL npc_floonAI : public ScriptedAI +{ + npc_floonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormFaction; + uint32 m_uiSilence_Timer; + uint32 m_uiFrostbolt_Timer; + uint32 m_uiFrostNova_Timer; + + void Reset() + { + m_uiSilence_Timer = 2000; + m_uiFrostbolt_Timer = 4000; + m_uiFrostNova_Timer = 9000; + + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiSilence_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_SILENCE); + m_uiSilence_Timer = 30000; + }else m_uiSilence_Timer -= uiDiff; + + if (m_uiFrostNova_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature,SPELL_FROST_NOVA); + m_uiFrostNova_Timer = 20000; + }else m_uiFrostNova_Timer -= uiDiff; + + if (m_uiFrostbolt_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_FROSTBOLT); + m_uiFrostbolt_Timer = 5000; + }else m_uiFrostbolt_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_floon(Creature* pCreature) +{ + return new npc_floonAI(pCreature); +} + +bool GossipHello_npc_floon(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9442, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_floon(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(9443, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE_FL); + DoScriptText(SAY_FLOON_ATTACK, pCreature, pPlayer); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_skyguard_handler_deesak +######*/ + +#define GOSSIP_SKYGUARD "Fly me to Ogri'la please" + +bool GossipHello_npc_skyguard_handler_deesak(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetReputationRank(1031) >= REP_HONORED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SKYGUARD, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_skyguard_handler_deesak(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,41279,true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost) + } + return true; +} + +/*###### +## npc_letoll +######*/ + +enum +{ + SAY_LE_START = -1000511, + SAY_LE_KEEP_SAFE = -1000512, + SAY_LE_NORTH = -1000513, + SAY_LE_ARRIVE = -1000514, + SAY_LE_BURIED = -1000515, + SAY_LE_ALMOST = -1000516, + SAY_LE_DRUM = -1000517, + SAY_LE_DRUM_REPLY = -1000518, + SAY_LE_DISCOVERY = -1000519, + SAY_LE_DISCOVERY_REPLY = -1000520, + SAY_LE_NO_LEAVE = -1000521, + SAY_LE_NO_LEAVE_REPLY1 = -1000522, + SAY_LE_NO_LEAVE_REPLY2 = -1000523, + SAY_LE_NO_LEAVE_REPLY3 = -1000524, + SAY_LE_NO_LEAVE_REPLY4 = -1000525, + SAY_LE_SHUT = -1000526, + SAY_LE_REPLY_HEAR = -1000527, + SAY_LE_IN_YOUR_FACE = -1000528, + SAY_LE_HELP_HIM = -1000529, + EMOTE_LE_PICK_UP = -1000530, + SAY_LE_THANKS = -1000531, + + QUEST_DIGGING_BONES = 10922, + + NPC_RESEARCHER = 22464, + NPC_BONE_SIFTER = 22466, + + MAX_RESEARCHER = 4 +}; + +//Some details still missing from here, and will also have issues if followers evade for any reason. +struct MANGOS_DLL_DECL npc_letollAI : public npc_escortAI +{ + npc_letollAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_uiEventTimer = 5000; + m_uiEventCount = 0; + Reset(); + } + + std::list m_lResearchersList; + + uint32 m_uiEventTimer; + uint32 m_uiEventCount; + + void Reset() {} + + //will make them follow, but will only work until they enter combat with any unit + void SetFormation() + { + uint32 uiCount = 0; + + for(std::list::iterator itr = m_lResearchersList.begin(); itr != m_lResearchersList.end(); ++itr) + { + float fAngle = uiCount < MAX_RESEARCHER ? M_PI/MAX_RESEARCHER - (uiCount*2*M_PI/MAX_RESEARCHER) : 0.0f; + + if ((*itr)->isAlive() && !(*itr)->isInCombat()) + (*itr)->GetMotionMaster()->MoveFollow(m_creature, 2.5f, fAngle); + + ++uiCount; + } + } + + Creature* GetAvailableResearcher(uint8 uiListNum) + { + if (!m_lResearchersList.empty()) + { + uint8 uiNum = 1; + + for(std::list::iterator itr = m_lResearchersList.begin(); itr != m_lResearchersList.end(); ++itr) + { + if (uiListNum && uiListNum != uiNum) + { + ++uiNum; + continue; + } + + if ((*itr)->isAlive() && (*itr)->IsWithinDistInMap(m_creature, 20.0f)) + return (*itr); + } + } + + return NULL; + } + + void JustStartedEscort() + { + m_uiEventTimer = 5000; + m_uiEventCount = 0; + + m_lResearchersList.clear(); + + GetCreatureListWithEntryInGrid(m_lResearchersList, m_creature, NPC_RESEARCHER, 25.0f); + + if (!m_lResearchersList.empty()) + SetFormation(); + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_LE_KEEP_SAFE, m_creature, pPlayer); + break; + case 1: + DoScriptText(SAY_LE_NORTH, m_creature); + break; + case 10: + DoScriptText(SAY_LE_ARRIVE, m_creature); + break; + case 12: + DoScriptText(SAY_LE_BURIED, m_creature); + SetEscortPaused(true); + break; + case 13: + SetRun(); + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->isInCombat() && pWho->GetTypeId() == TYPEID_UNIT && pWho->GetEntry() == NPC_BONE_SIFTER) + DoScriptText(SAY_LE_HELP_HIM, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + Player* pPlayer = GetPlayerForEscort(); + + if (pPlayer && pPlayer->isAlive()) + pSummoned->AI()->AttackStart(pPlayer); + else + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + { + if (HasEscortState(STATE_ESCORT_PAUSED)) + { + if (m_uiEventTimer < uiDiff) + { + m_uiEventTimer = 7000; + + switch(m_uiEventCount) + { + case 0: + DoScriptText(SAY_LE_ALMOST, m_creature); + break; + case 1: + DoScriptText(SAY_LE_DRUM, m_creature); + break; + case 2: + if (Creature* pResearcher = GetAvailableResearcher(0)) + DoScriptText(SAY_LE_DRUM_REPLY, pResearcher); + break; + case 3: + DoScriptText(SAY_LE_DISCOVERY, m_creature); + break; + case 4: + if (Creature* pResearcher = GetAvailableResearcher(0)) + DoScriptText(SAY_LE_DISCOVERY_REPLY, pResearcher); + break; + case 5: + DoScriptText(SAY_LE_NO_LEAVE, m_creature); + break; + case 6: + if (Creature* pResearcher = GetAvailableResearcher(1)) + DoScriptText(SAY_LE_NO_LEAVE_REPLY1, pResearcher); + break; + case 7: + if (Creature* pResearcher = GetAvailableResearcher(2)) + DoScriptText(SAY_LE_NO_LEAVE_REPLY2, pResearcher); + break; + case 8: + if (Creature* pResearcher = GetAvailableResearcher(3)) + DoScriptText(SAY_LE_NO_LEAVE_REPLY3, pResearcher); + break; + case 9: + if (Creature* pResearcher = GetAvailableResearcher(4)) + DoScriptText(SAY_LE_NO_LEAVE_REPLY4, pResearcher); + break; + case 10: + DoScriptText(SAY_LE_SHUT, m_creature); + break; + case 11: + if (Creature* pResearcher = GetAvailableResearcher(0)) + DoScriptText(SAY_LE_REPLY_HEAR, pResearcher); + break; + case 12: + DoScriptText(SAY_LE_IN_YOUR_FACE, m_creature); + m_creature->SummonCreature(NPC_BONE_SIFTER, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 13: + DoScriptText(EMOTE_LE_PICK_UP, m_creature); + + if (Player* pPlayer = GetPlayerForEscort()) + { + DoScriptText(SAY_LE_THANKS, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_DIGGING_BONES, m_creature); + } + + SetEscortPaused(false); + break; + } + + ++m_uiEventCount; + } + else + m_uiEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_letoll(Creature* pCreature) +{ + return new npc_letollAI(pCreature); +} + +bool QuestAccept_npc_letoll(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_DIGGING_BONES) + { + if (npc_letollAI* pEscortAI = dynamic_cast(pCreature->AI())) + { + DoScriptText(SAY_LE_START, pCreature); + pCreature->setFaction(FACTION_ESCORT_N_NEUTRAL_PASSIVE); + + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest, true); + } + } + + return true; +} + +/*###### +## npc_mana_bomb_exp_trigger +######*/ + +enum +{ + SAY_COUNT_1 = -1000472, + SAY_COUNT_2 = -1000473, + SAY_COUNT_3 = -1000474, + SAY_COUNT_4 = -1000475, + SAY_COUNT_5 = -1000476, + + SPELL_MANA_BOMB_LIGHTNING = 37843, + SPELL_MANA_BOMB_EXPL = 35513, + + NPC_MANA_BOMB_EXPL_TRIGGER = 20767, + NPC_MANA_BOMB_KILL_TRIGGER = 21039 +}; + +struct MANGOS_DLL_DECL npc_mana_bomb_exp_triggerAI : public ScriptedAI +{ + npc_mana_bomb_exp_triggerAI(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + GameObject* pManaBomb; + + bool m_bIsActivated; + uint32 m_uiEventTimer; + uint32 m_uiEventCounter; + + void Reset() + { + pManaBomb = NULL; + m_bIsActivated = false; + m_uiEventTimer = 1000; + m_uiEventCounter = 0; + } + + void DoTrigger(Player* pPlayer, GameObject* pGo) + { + if (m_bIsActivated) + return; + + m_bIsActivated = true; + + pPlayer->KilledMonsterCredit(NPC_MANA_BOMB_KILL_TRIGGER); + + pManaBomb = pGo; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_bIsActivated) + return; + + if (m_uiEventTimer < uiDiff) + { + m_uiEventTimer = 1000; + + if (m_uiEventCounter < 10) + m_creature->CastSpell(m_creature, SPELL_MANA_BOMB_LIGHTNING, false); + + switch(m_uiEventCounter) + { + case 5: + if (pManaBomb) + pManaBomb->SetGoState(GO_STATE_ACTIVE); + + DoScriptText(SAY_COUNT_1, m_creature); + break; + case 6: + DoScriptText(SAY_COUNT_2, m_creature); + break; + case 7: + DoScriptText(SAY_COUNT_3, m_creature); + break; + case 8: + DoScriptText(SAY_COUNT_4, m_creature); + break; + case 9: + DoScriptText(SAY_COUNT_5, m_creature); + break; + case 10: + m_creature->CastSpell(m_creature, SPELL_MANA_BOMB_EXPL, false); + break; + case 30: + if (pManaBomb) + pManaBomb->SetGoState(GO_STATE_READY); + + Reset(); + break; + } + + ++m_uiEventCounter; + } + else + m_uiEventTimer -= uiDiff; + } +}; + +CreatureAI* GetAI_npc_mana_bomb_exp_trigger(Creature* pCreature) +{ + return new npc_mana_bomb_exp_triggerAI(pCreature); +} + +/*###### +## go_mana_bomb +######*/ + +bool GOHello_go_mana_bomb(Player* pPlayer, GameObject* pGo) +{ + if (Creature* pCreature = GetClosestCreatureWithEntry(pGo, NPC_MANA_BOMB_EXPL_TRIGGER, INTERACTION_DISTANCE)) + { + if (npc_mana_bomb_exp_triggerAI* pBombAI = dynamic_cast(pCreature->AI())) + pBombAI->DoTrigger(pPlayer, pGo); + } + + return true; +} + +/*###### +## npc_slim +######*/ + +enum +{ + FACTION_CONSORTIUM = 933 +}; + +bool GossipHello_npc_slim(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isVendor() && pPlayer->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(9896, pCreature->GetGUID()); + } + else + pPlayer->SEND_GOSSIP_MENU(9895, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_slim(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*##### +## go_veil_skith_cage & npc_captive_child +#####*/ + +enum +{ + QUEST_MISSING_FRIENDS = 10852, + NPC_CAPTIVE_CHILD = 22314, + SAY_THANKS_1 = -1000590, + SAY_THANKS_2 = -1000591, + SAY_THANKS_3 = -1000592, + SAY_THANKS_4 = -1000593 +}; + +bool GOHello_veil_skith_cage(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_MISSING_FRIENDS) == QUEST_STATUS_INCOMPLETE) + { + std::list lChildrenList; + GetCreatureListWithEntryInGrid(lChildrenList, pGo, NPC_CAPTIVE_CHILD, INTERACTION_DISTANCE); + for(std::list::const_iterator itr = lChildrenList.begin(); itr != lChildrenList.end(); ++itr) + { + pPlayer->KilledMonsterCredit(NPC_CAPTIVE_CHILD, (*itr)->GetGUID()); + switch(urand(0,3)) + { + case 0: DoScriptText(SAY_THANKS_1, *itr); break; + case 1: DoScriptText(SAY_THANKS_2, *itr); break; + case 2: DoScriptText(SAY_THANKS_3, *itr); break; + case 3: DoScriptText(SAY_THANKS_4, *itr); break; + } + + (*itr)->GetMotionMaster()->Clear(); + (*itr)->GetMotionMaster()->MovePoint(0, -2648.049f, 5274.573f, 1.691529f); + } + } + return false; +}; + +struct MANGOS_DLL_DECL npc_captive_child : public ScriptedAI +{ + npc_captive_child(Creature* pCreature) : ScriptedAI(pCreature) { Reset(); } + + void Reset() {} + + void WaypointReached(uint32 uiPointId) + { + // we only have one waypoint + m_creature->ForcedDespawn(); + } +}; + +CreatureAI* GetAI_npc_captive_child(Creature* pCreature) +{ + return new npc_captive_child(pCreature); +} + +void AddSC_terokkar_forest() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "mob_unkor_the_ruthless"; + newscript->GetAI = &GetAI_mob_unkor_the_ruthless; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_infested_root_walker"; + newscript->GetAI = &GetAI_mob_infested_root_walker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_rotting_forest_rager"; + newscript->GetAI = &GetAI_mob_rotting_forest_rager; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_netherweb_victim"; + newscript->GetAI = &GetAI_mob_netherweb_victim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akuno"; + newscript->GetAI = &GetAI_npc_akuno; + newscript->pQuestAccept = &QuestAccept_npc_akuno; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_floon"; + newscript->GetAI = &GetAI_npc_floon; + newscript->pGossipHello = &GossipHello_npc_floon; + newscript->pGossipSelect = &GossipSelect_npc_floon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_letoll"; + newscript->GetAI = &GetAI_npc_letoll; + newscript->pQuestAccept = &QuestAccept_npc_letoll; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mana_bomb_exp_trigger"; + newscript->GetAI = &GetAI_npc_mana_bomb_exp_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_mana_bomb"; + newscript->pGOHello = &GOHello_go_mana_bomb; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_skyguard_handler_deesak"; + newscript->pGossipHello = &GossipHello_npc_skyguard_handler_deesak; + newscript->pGossipSelect = &GossipSelect_npc_skyguard_handler_deesak; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_slim"; + newscript->pGossipHello = &GossipHello_npc_slim; + newscript->pGossipSelect = &GossipSelect_npc_slim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_veil_skith_cage"; + newscript->pGOHello = &GOHello_veil_skith_cage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_captive_child"; + newscript->GetAI = &GetAI_npc_captive_child; + newscript->RegisterSelf(); +} diff --git a/scripts/outland/zangarmarsh.cpp b/scripts/outland/zangarmarsh.cpp new file mode 100644 index 0000000..aa52605 --- /dev/null +++ b/scripts/outland/zangarmarsh.cpp @@ -0,0 +1,431 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zangarmarsh +SD%Complete: 100 +SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs. +SDCategory: Zangarmarsh +EndScriptData */ + +/* ContentData +npcs_ashyen_and_keleth +npc_cooshcoosh +npc_elder_kuruti +npc_kayra_longmane +npc_mortog_steamhead +npc_timothy_daniels +event_stormcrow +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npcs_ashyen_and_keleth +######*/ + +#define SAY_REWARD_BLESS -1000207 + +#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient." +#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient." + +//#define TEXT_BLESSINGS "" + +bool GossipHello_npcs_ashyen_and_keleth(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetReputationRank(942) > REP_NEUTRAL) + { + if (pCreature->GetEntry() == 17900) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + if (pCreature->GetEntry() == 17901) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + } + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npcs_ashyen_and_keleth(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pCreature->setPowerType(POWER_MANA); + pCreature->SetMaxPower(POWER_MANA,200); //set a "fake" mana value, we can't depend on database doing it in this case + pCreature->SetPower(POWER_MANA,200); + + if (pCreature->GetEntry() == 17900) //check which creature we are dealing with + { + switch (pPlayer->GetReputationRank(942)) + { //mark of lore + case REP_FRIENDLY: + pCreature->CastSpell(pPlayer, 31808, true); + break; + case REP_HONORED: + pCreature->CastSpell(pPlayer, 31810, true); + break; + case REP_REVERED: + pCreature->CastSpell(pPlayer, 31811, true); + break; + case REP_EXALTED: + pCreature->CastSpell(pPlayer, 31815, true); + break; + } + } + + if (pCreature->GetEntry() == 17901) + { + switch (pPlayer->GetReputationRank(942)) //mark of war + { + case REP_FRIENDLY: + pCreature->CastSpell(pPlayer, 31807, true); + break; + case REP_HONORED: + pCreature->CastSpell(pPlayer, 31812, true); + break; + case REP_REVERED: + pCreature->CastSpell(pPlayer, 31813, true); + break; + case REP_EXALTED: + pCreature->CastSpell(pPlayer, 31814, true); + break; + } + } + + DoScriptText(SAY_REWARD_BLESS, pCreature, pPlayer); + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + } + return true; +} + +/*###### +## npc_cooshcoosh +######*/ + +enum +{ + SPELL_LIGHTNING_BOLT = 9532, + QUEST_CRACK_SKULLS = 10009, + FACTION_HOSTILE_CO = 45 +}; + +#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!" + +struct MANGOS_DLL_DECL npc_cooshcooshAI : public ScriptedAI +{ + npc_cooshcooshAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_uiNormFaction = pCreature->getFaction(); + Reset(); + } + + uint32 m_uiNormFaction; + uint32 m_uiLightningBolt_Timer; + + void Reset() + { + m_uiLightningBolt_Timer = 2000; + + if (m_creature->getFaction() != m_uiNormFaction) + m_creature->setFaction(m_uiNormFaction); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_uiLightningBolt_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(),SPELL_LIGHTNING_BOLT); + m_uiLightningBolt_Timer = 5000; + }else m_uiLightningBolt_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_cooshcoosh(Creature* pCreature) +{ + return new npc_cooshcooshAI(pCreature); +} + +bool GossipHello_npc_cooshcoosh(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9441, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_cooshcoosh(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE_CO); + pCreature->AI()->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_elder_kuruti +######*/ + +#define GOSSIP_ITEM_KUR1 "Offer treat" +#define GOSSIP_ITEM_KUR2 "Im a messenger for Draenei" +#define GOSSIP_ITEM_KUR3 "Get message" + +bool GossipHello_npc_elder_kuruti(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(9226, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_elder_kuruti(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(9227, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(9229, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + { + if (!pPlayer->HasItemCount(24573,1)) + { + if (Item* pItem = pPlayer->StoreNewItemInInventorySlot(24573, 1)) + pPlayer->SendNewItem(pItem, 1, true, false); + } + + pPlayer->SEND_GOSSIP_MENU(9231, pCreature->GetGUID()); + break; + } + } + return true; +} + +/*##### +## npc_kayra_longmane +#####*/ + +enum +{ + SAY_START = -1000343, + SAY_AMBUSH1 = -1000344, + SAY_PROGRESS = -1000345, + SAY_AMBUSH2 = -1000346, + SAY_END = -1000347, + + QUEST_ESCAPE_FROM = 9752, + NPC_SLAVEBINDER = 18042 +}; + +struct MANGOS_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI +{ + npc_kayra_longmaneAI(Creature* pCreature) : npc_escortAI(pCreature) { Reset(); } + + void WaypointReached(uint32 i) + { + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(i) + { + case 4: + DoScriptText(SAY_AMBUSH1, m_creature, pPlayer); + DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 5: + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); + SetRun(); + break; + case 16: + DoScriptText(SAY_AMBUSH2, m_creature, pPlayer); + DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + break; + case 17: + DoScriptText(SAY_END, m_creature, pPlayer); + break; + case 25: + pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); + break; + } + } + + void Reset() { } +}; + +bool QuestAccept_npc_kayra_longmane(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_ESCAPE_FROM) + { + DoScriptText(SAY_START, pCreature, pPlayer); + + if (npc_kayra_longmaneAI* pEscortAI = dynamic_cast(pCreature->AI())) + pEscortAI->Start(false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_kayra_longmane(Creature* pCreature) +{ + return new npc_kayra_longmaneAI(pCreature); +} + +/*###### +## npc_mortog_steamhead +######*/ + +bool GossipHello_npc_mortog_steamhead(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isVendor() && pPlayer->GetReputationRank(942) == REP_EXALTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_mortog_steamhead(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + { + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + } + return true; +} + +/*###### +## npc_timothy_daniels +######*/ + +#define GOSSIP_TIMOTHY_DANIELS_ITEM1 "Specialist, eh? Just what kind of specialist are you, anyway?" +#define GOSSIP_TEXT_BROWSE_POISONS "Let me browse your reagents and poison supplies." + +enum +{ + GOSSIP_TEXTID_TIMOTHY_DANIELS1 = 9239 +}; + +bool GossipHello_npc_timothy_daniels(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_POISONS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TIMOTHY_DANIELS_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_timothy_daniels(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TIMOTHY_DANIELS1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + } + + return true; +} + +/*###### +## event_stormcrow +######*/ + +enum +{ + EVENT_ID_STORMCROW = 11225, +}; + +bool ProcessEventId_event_taxi_stormcrow(uint32 uiEventId, Object* pSource, Object* pTarget, bool bIsStart) +{ + if (uiEventId == EVENT_ID_STORMCROW && !bIsStart && pSource->GetTypeId() == TYPEID_PLAYER) + { + ((Player*)pSource)->SetDisplayId(((Player*)pSource)->GetNativeDisplayId()); + return true; + } + return false; +} + +void AddSC_zangarmarsh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npcs_ashyen_and_keleth"; + newscript->pGossipHello = &GossipHello_npcs_ashyen_and_keleth; + newscript->pGossipSelect = &GossipSelect_npcs_ashyen_and_keleth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_cooshcoosh"; + newscript->GetAI = &GetAI_npc_cooshcoosh; + newscript->pGossipHello = &GossipHello_npc_cooshcoosh; + newscript->pGossipSelect = &GossipSelect_npc_cooshcoosh; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_elder_kuruti"; + newscript->pGossipHello = &GossipHello_npc_elder_kuruti; + newscript->pGossipSelect = &GossipSelect_npc_elder_kuruti; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_kayra_longmane"; + newscript->GetAI = &GetAI_npc_kayra_longmane; + newscript->pQuestAccept = &QuestAccept_npc_kayra_longmane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mortog_steamhead"; + newscript->pGossipHello = &GossipHello_npc_mortog_steamhead; + newscript->pGossipSelect = &GossipSelect_npc_mortog_steamhead; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_timothy_daniels"; + newscript->pGossipHello = &GossipHello_npc_timothy_daniels; + newscript->pGossipSelect = &GossipSelect_npc_timothy_daniels; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "event_taxi_stormcrow"; + newscript->pProcessEventId = &ProcessEventId_event_taxi_stormcrow; + newscript->RegisterSelf(); +} diff --git a/scripts/world/areatrigger_scripts.cpp b/scripts/world/areatrigger_scripts.cpp new file mode 100644 index 0000000..6a451eb --- /dev/null +++ b/scripts/world/areatrigger_scripts.cpp @@ -0,0 +1,278 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Areatrigger_Scripts +SD%Complete: 100 +SDComment: Quest support: 6681, 11686, 10589/10604, 12741, 12548, 13315/13351 +SDCategory: Areatrigger +EndScriptData */ + +/* ContentData +at_aldurthar_gate 5284,5285,5286,5287 +at_coilfang_waterfall 4591 +at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm +at_ravenholdt +at_warsong_farms +at_stormwright_shelf 5108 +at_childrens_week_spot 3546,3547,3548,3552,3549,3550 +EndContentData */ + +#include "precompiled.h" + +static uint32 TriggerOrphanSpell[6][3] = +{ + {3546, 14305, 65056}, // The Bough of the Eternals + {3547, 14444, 65059}, // Lordaeron Throne Room + {3548, 14305, 65055}, // The Stonewrought Dam + {3549, 14444, 65058}, // Gateway to the Frontier + {3550, 14444, 65057}, // Down at the Docks + {3552, 14305, 65054} // Spooky Lighthouse +}; + +bool AreaTrigger_at_childrens_week_spot(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + for (uint8 i = 0; i < 6; ++i) + { + if (pAt->id == TriggerOrphanSpell[i][0] && + pPlayer->GetMiniPet() && pPlayer->GetMiniPet()->GetEntry() == TriggerOrphanSpell[i][1]) + { + pPlayer->CastSpell(pPlayer, TriggerOrphanSpell[i][2], true); + return true; + } + } + return false; +} + +/*###### +## Quest 13315/13351 +######*/ + +enum +{ + TRIGGER_SOUTH = 5284, + TRIGGER_CENTRAL = 5285, + TRIGGER_NORTH = 5286, + TRIGGER_NORTHWEST = 5287, + + NPC_SOUTH_GATE = 32195, + NPC_CENTRAL_GATE = 32196, + NPC_NORTH_GATE = 32197, + NPC_NORTHWEST_GATE = 32199 +}; + +bool AreaTrigger_at_aldurthar_gate(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + switch(pAt->id) + { + case TRIGGER_SOUTH: pPlayer->KilledMonsterCredit(NPC_SOUTH_GATE); break; + case TRIGGER_CENTRAL: pPlayer->KilledMonsterCredit(NPC_CENTRAL_GATE); break; + case TRIGGER_NORTH: pPlayer->KilledMonsterCredit(NPC_NORTH_GATE); break; + case TRIGGER_NORTHWEST: pPlayer->KilledMonsterCredit(NPC_NORTHWEST_GATE); break; + } + return true; +} + +/*###### +## at_coilfang_waterfall +######*/ + +enum +{ + GO_COILFANG_WATERFALL = 184212 +}; + +bool AreaTrigger_at_coilfang_waterfall(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (GameObject* pGo = GetClosestGameObjectWithEntry(pPlayer, GO_COILFANG_WATERFALL, 35.0f)) + { + if (pGo->getLootState() == GO_READY) + pGo->UseDoorOrButton(); + } + return false; +} + +/*###### +## at_legion_teleporter +######*/ + +enum +{ + SPELL_TELE_A_TO = 37387, + QUEST_GAINING_ACCESS_A = 10589, + + SPELL_TELE_H_TO = 37389, + QUEST_GAINING_ACCESS_H = 10604 +}; + +bool AreaTrigger_at_legion_teleporter(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (pPlayer->isAlive() && !pPlayer->isInCombat()) + { + if (pPlayer->GetTeam() == ALLIANCE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_A)) + { + pPlayer->CastSpell(pPlayer, SPELL_TELE_A_TO, false); + return true; + } + + if (pPlayer->GetTeam() == HORDE && pPlayer->GetQuestRewardStatus(QUEST_GAINING_ACCESS_H)) + { + pPlayer->CastSpell(pPlayer, SPELL_TELE_H_TO, false); + return true; + } + return false; + } + return false; +} + +/*###### +## at_ravenholdt +######*/ + +enum +{ + QUEST_MANOR_RAVENHOLDT = 6681, + NPC_RAVENHOLDT = 13936 +}; + +bool AreaTrigger_at_ravenholdt(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (pPlayer->GetQuestStatus(QUEST_MANOR_RAVENHOLDT) == QUEST_STATUS_INCOMPLETE) + pPlayer->KilledMonsterCredit(NPC_RAVENHOLDT); + + return false; +} + +/*###### +## at_warsong_farms +######*/ + +enum +{ + QUEST_THE_WARSONG_FARMS = 11686, + NPC_CREDIT_SLAUGHTERHOUSE = 25672, + NPC_CREDIT_GRAINERY = 25669, + NPC_CREDIT_TORP_FARM = 25671, + + AT_SLAUGHTERHOUSE = 4873, + AT_GRAINERY = 4871, + AT_TORP_FARM = 4872 +}; + +bool AreaTrigger_at_warsong_farms(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (!pPlayer->isDead() && pPlayer->GetQuestStatus(QUEST_THE_WARSONG_FARMS) == QUEST_STATUS_INCOMPLETE) + { + switch(pAt->id) + { + case AT_SLAUGHTERHOUSE: pPlayer->KilledMonsterCredit(NPC_CREDIT_SLAUGHTERHOUSE); break; + case AT_GRAINERY: pPlayer->KilledMonsterCredit(NPC_CREDIT_GRAINERY); break; + case AT_TORP_FARM: pPlayer->KilledMonsterCredit(NPC_CREDIT_TORP_FARM); break; + } + } + return true; +} + +/*###### +## Quest 12548 +######*/ + +enum +{ + SPELL_SHOLOZAR_TO_UNGORO_TELEPORT = 52056, + SPELL_UNGORO_TO_SHOLOZAR_TELEPORT = 52057, + AT_WAYGATE_SHOLOZAR = 5046, + AT_WAYGATE_UNGORO = 5047, + QUEST_THE_MARKERS_OVERLOOK = 12613, + QUEST_THE_MARKERS_PERCH = 12559 +}; + +bool AreaTrigger_at_waygate(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (!pPlayer->isDead() && pPlayer->GetQuestStatus(QUEST_THE_MARKERS_OVERLOOK) == QUEST_STATUS_COMPLETE && pPlayer->GetQuestStatus(QUEST_THE_MARKERS_PERCH) == QUEST_STATUS_COMPLETE) + { + switch(pAt->id) + { + case AT_WAYGATE_SHOLOZAR: pPlayer->CastSpell(pPlayer, SPELL_SHOLOZAR_TO_UNGORO_TELEPORT, false); break; + case AT_WAYGATE_UNGORO: pPlayer->CastSpell(pPlayer, SPELL_UNGORO_TO_SHOLOZAR_TELEPORT, false); break; + } + } + + return false; +} + +/*###### +## Quest 12741 +######*/ + +enum +{ + QUEST_STRENGTH_OF_THE_TEMPEST = 12741, + SPELL_CREATE_TRUE_POWER_OF_THE_TEMPEST = 53067 +}; + +bool AreaTrigger_at_stormwright_shelf(Player* pPlayer, AreaTriggerEntry const* pAt) +{ + if (!pPlayer->isDead() && pPlayer->GetQuestStatus(QUEST_STRENGTH_OF_THE_TEMPEST) == QUEST_STATUS_INCOMPLETE) + pPlayer->CastSpell(pPlayer, SPELL_CREATE_TRUE_POWER_OF_THE_TEMPEST, false); + + return true; +} + +void AddSC_areatrigger_scripts() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "at_childrens_week_spot"; + pNewScript->pAreaTrigger = &AreaTrigger_at_childrens_week_spot; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_aldurthar_gate"; + pNewScript->pAreaTrigger = &AreaTrigger_at_aldurthar_gate; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_coilfang_waterfall"; + pNewScript->pAreaTrigger = &AreaTrigger_at_coilfang_waterfall; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_legion_teleporter"; + pNewScript->pAreaTrigger = &AreaTrigger_at_legion_teleporter; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_ravenholdt"; + pNewScript->pAreaTrigger = &AreaTrigger_at_ravenholdt; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_warsong_farms"; + pNewScript->pAreaTrigger = &AreaTrigger_at_warsong_farms; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_waygate"; + pNewScript->pAreaTrigger = &AreaTrigger_at_waygate; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "at_stormwright_shelf"; + pNewScript->pAreaTrigger = &AreaTrigger_at_stormwright_shelf; + pNewScript->RegisterSelf(); +} diff --git a/scripts/world/boss_emeriss.cpp b/scripts/world/boss_emeriss.cpp new file mode 100644 index 0000000..aab3374 --- /dev/null +++ b/scripts/world/boss_emeriss.cpp @@ -0,0 +1,142 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Emeriss +SD%Complete: 90 +SDComment: Teleport function & Mark of Nature missing +SDCategory: Bosses +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1000401, + SAY_CASTCORRUPTION = -1000402, + + SPELL_SLEEP = 24777, + SPELL_NOXIOUSBREATH = 24818, + SPELL_TAILSWEEP = 15847, + //SPELL_MARKOFNATURE = 25040, // Not working + SPELL_VOLATILEINFECTION = 24928, + SPELL_CORRUPTIONOFEARTH = 24910 +}; + +struct MANGOS_DLL_DECL boss_emerissAI : public ScriptedAI +{ + boss_emerissAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiSleep_Timer; + uint32 m_uiNoxiousBreath_Timer; + uint32 m_uiTailSweep_Timer; + //uint32 m_uiMarkOfNature_Timer; + uint32 m_uiVolatileInfection_Timer; + uint32 m_uiCorruptionsCasted; + + void Reset() + { + m_uiSleep_Timer = urand(15000, 20000); + m_uiNoxiousBreath_Timer = 8000; + m_uiTailSweep_Timer = 4000; + //m_uiMarkOfNature_Timer = 45000; + m_uiVolatileInfection_Timer = 12000; + m_uiCorruptionsCasted = 0; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Sleep_Timer + if (m_uiSleep_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_SLEEP); + + m_uiSleep_Timer = urand(8000, 16000); + } + else + m_uiSleep_Timer -= uiDiff; + + //NoxiousBreath_Timer + if (m_uiNoxiousBreath_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_NOXIOUSBREATH); + m_uiNoxiousBreath_Timer = urand(14000, 20000); + } + else + m_uiNoxiousBreath_Timer -= uiDiff; + + //Tailsweep every 2 seconds + if (m_uiTailSweep_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_TAILSWEEP); + m_uiTailSweep_Timer = 2000; + } + else + m_uiTailSweep_Timer -= uiDiff; + + //MarkOfNature_Timer + //if (m_uiMarkOfNature_Timer < uiDiff) + //{ + // DoCastSpellIfCan(m_creature->getVictim(), SPELL_MARKOFNATURE); + // m_uiMarkOfNature_Timer = 45000; + //} + //else + //m_uiMarkOfNature_Timer -= uiDiff; + + //VolatileInfection_Timer + if (m_uiVolatileInfection_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_VOLATILEINFECTION); + m_uiVolatileInfection_Timer = urand(7000, 12000); + } + else + m_uiVolatileInfection_Timer -= uiDiff; + + //CorruptionofEarth at 75%, 50% and 25% + if (m_creature->GetHealthPercent() < float(100 - 25*m_uiCorruptionsCasted)) + { + ++m_uiCorruptionsCasted; // prevent casting twice on same hp + DoScriptText(SAY_CASTCORRUPTION, m_creature); + DoCastSpellIfCan(m_creature->getVictim(), SPELL_CORRUPTIONOFEARTH); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_emeriss(Creature* pCreature) +{ + return new boss_emerissAI(pCreature); +} + +void AddSC_boss_emeriss() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_emeriss"; + newscript->GetAI = &GetAI_boss_emeriss; + newscript->RegisterSelf(); +} diff --git a/scripts/world/boss_lethon.cpp b/scripts/world/boss_lethon.cpp new file mode 100644 index 0000000..623a4ac --- /dev/null +++ b/scripts/world/boss_lethon.cpp @@ -0,0 +1,24 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Lethon +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Bosses +EndScriptData */ + +#include "precompiled.h" diff --git a/scripts/world/boss_taerar.cpp b/scripts/world/boss_taerar.cpp new file mode 100644 index 0000000..f6f4f0a --- /dev/null +++ b/scripts/world/boss_taerar.cpp @@ -0,0 +1,262 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Taerar +SD%Complete: 70 +SDComment: Mark of Nature & Teleport NYI. Fix the way to be banished. +SDCategory: Bosses +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1000399, + SAY_SUMMONSHADE = -1000400, + + //Spells of Taerar + SPELL_SLEEP = 24777, + SPELL_NOXIOUSBREATH = 24818, + SPELL_TAILSWEEP = 15847, + // SPELL_MARKOFNATURE = 25040, // Not working + SPELL_ARCANEBLAST = 24857, + SPELL_BELLOWINGROAR = 22686, + + SPELL_SUMMONSHADE_1 = 24841, + SPELL_SUMMONSHADE_2 = 24842, + SPELL_SUMMONSHADE_3 = 24843, + + //Spells of Shades of Taerar + SPELL_POSIONCLOUD = 24840, + SPELL_POSIONBREATH = 20667 +}; + +uint32 m_auiSpellSummonShade[]= +{ + SPELL_SUMMONSHADE_1, SPELL_SUMMONSHADE_2, SPELL_SUMMONSHADE_3 +}; + +struct MANGOS_DLL_DECL boss_taerarAI : public ScriptedAI +{ + boss_taerarAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiSleep_Timer; + uint32 m_uiNoxiousBreath_Timer; + uint32 m_uiTailSweep_Timer; + //uint32 m_uiMarkOfNature_Timer; + uint32 m_uiArcaneBlast_Timer; + uint32 m_uiBellowingRoar_Timer; + uint32 m_uiShades_Timer; + uint32 m_uiShadesSummoned; + + bool m_bShades; + + void Reset() + { + m_uiSleep_Timer = urand(15000, 20000); + m_uiNoxiousBreath_Timer = 8000; + m_uiTailSweep_Timer = 4000; + //m_uiMarkOfNature_Timer = 45000; + m_uiArcaneBlast_Timer = 12000; + m_uiBellowingRoar_Timer = 30000; + m_uiShades_Timer = 60000; //The time that Taerar is banished + m_uiShadesSummoned = 0; + + m_bShades = false; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bShades && m_uiShades_Timer < uiDiff) + { + //Become unbanished again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_bShades = false; + } + else if (m_bShades) + { + m_uiShades_Timer -= uiDiff; + //Do nothing while banished + return; + } + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Sleep_Timer + if (m_uiSleep_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_SLEEP); + + m_uiSleep_Timer = urand(8000, 15000); + } + else + m_uiSleep_Timer -= uiDiff; + + //NoxiousBreath_Timer + if (m_uiNoxiousBreath_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_NOXIOUSBREATH); + m_uiNoxiousBreath_Timer = urand(14000, 20000); + } + else + m_uiNoxiousBreath_Timer -= uiDiff; + + //Tailsweep every 2 seconds + if (m_uiTailSweep_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_TAILSWEEP); + m_uiTailSweep_Timer = 2000; + } + else + m_uiTailSweep_Timer -= uiDiff; + + //MarkOfNature_Timer + //if (m_uiMarkOfNature_Timer < uiDiff) + //{ + // DoCastSpellIfCan(m_creature->getVictim(), SPELL_MARKOFNATURE); + // m_uiMarkOfNature_Timer = 45000; + //} + //else + //m_uiMarkOfNature_Timer -= uiDiff; + + //ArcaneBlast_Timer + if (m_uiArcaneBlast_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_ARCANEBLAST); + m_uiArcaneBlast_Timer = urand(7000, 12000); + } + else + m_uiArcaneBlast_Timer -= uiDiff; + + //BellowingRoar_Timer + if (m_uiBellowingRoar_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_BELLOWINGROAR); + m_uiBellowingRoar_Timer = urand(20000, 30000); + } + else + m_uiBellowingRoar_Timer -= uiDiff; + + //Summon 3 Shades at 75%, 50% and 25% (if bShades is true we already left in line 117, no need to check here again) + if (!m_bShades && m_creature->GetHealthPercent() < float(100 - 25*m_uiShadesSummoned)) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + { + //Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + + //horrible workaround, need to fix + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + DoScriptText(SAY_SUMMONSHADE, m_creature); + + int iSize = sizeof(m_auiSpellSummonShade) / sizeof(uint32); + + for(int i = 0; i < iSize; ++i) + m_creature->CastSpell(pTarget, m_auiSpellSummonShade[i], true); + + ++m_uiShadesSummoned; // prevent casting twice at same health + m_bShades = true; + } + m_uiShades_Timer = 60000; + } + + DoMeleeAttackIfReady(); + } +}; + +// Shades of Taerar Script +struct MANGOS_DLL_DECL boss_shadeoftaerarAI : public ScriptedAI +{ + boss_shadeoftaerarAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiPoisonCloud_Timer; + uint32 m_uiPosionBreath_Timer; + + void Reset() + { + m_uiPoisonCloud_Timer = 8000; + m_uiPosionBreath_Timer = 12000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //PoisonCloud_Timer + if (m_uiPoisonCloud_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_POSIONCLOUD); + m_uiPoisonCloud_Timer = 30000; + } + else + m_uiPoisonCloud_Timer -= uiDiff; + + //PosionBreath_Timer + if (m_uiPosionBreath_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_POSIONBREATH); + m_uiPosionBreath_Timer = 12000; + } + else + m_uiPosionBreath_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_taerar(Creature* pCreature) +{ + return new boss_taerarAI(pCreature); +} + +CreatureAI* GetAI_boss_shadeoftaerar(Creature* pCreature) +{ + return new boss_shadeoftaerarAI(pCreature); +} + +void AddSC_boss_taerar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_taerar"; + newscript->GetAI = &GetAI_boss_taerar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_shade_of_taerar"; + newscript->GetAI = &GetAI_boss_shadeoftaerar; + newscript->RegisterSelf(); +} diff --git a/scripts/world/boss_ysondre.cpp b/scripts/world/boss_ysondre.cpp new file mode 100644 index 0000000..98866ed --- /dev/null +++ b/scripts/world/boss_ysondre.cpp @@ -0,0 +1,200 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Ysondre +SD%Complete: 90 +SDComment: Mark of Nature & Teleport missing +SDCategory: Bosses +EndScriptData */ + +#include "precompiled.h" + +enum +{ + SAY_AGGRO = -1000360, + SAY_SUMMONDRUIDS = -1000361, + + SPELL_SLEEP = 24777, + SPELL_NOXIOUSBREATH = 24818, + SPELL_TAILSWEEP = 15847, + //SPELL_MARKOFNATURE = 25040, // Not working + SPELL_LIGHTNINGWAVE = 24819, + SPELL_SUMMONDRUIDS = 24795, + + SPELL_SUMMON_PLAYER = 24776, + + //druid spells + SPELL_MOONFIRE = 21669 +}; + +// Ysondre script +struct MANGOS_DLL_DECL boss_ysondreAI : public ScriptedAI +{ + boss_ysondreAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiSleep_Timer; + uint32 m_uiNoxiousBreath_Timer; + uint32 m_uiTailSweep_Timer; + //uint32 m_uiMarkOfNature_Timer; + uint32 m_uiLightningWave_Timer; + uint32 m_uiSummonDruidModifier; + + void Reset() + { + m_uiSleep_Timer = urand(15000, 20000); + m_uiNoxiousBreath_Timer = 8000; + m_uiTailSweep_Timer = 4000; + //m_uiMarkOfNature_Timer = 45000; + m_uiLightningWave_Timer = 12000; + m_uiSummonDruidModifier = 0; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //Sleep_Timer + if (m_uiSleep_Timer < uiDiff) + { + if (Unit* pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_SLEEP); + + m_uiSleep_Timer = urand(8000, 15000); + } + else + m_uiSleep_Timer -= uiDiff; + + //NoxiousBreath_Timer + if (m_uiNoxiousBreath_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_NOXIOUSBREATH); + m_uiNoxiousBreath_Timer = urand(14000, 20000); + } + else + m_uiNoxiousBreath_Timer -= uiDiff; + + //Tailsweep every 2 seconds + if (m_uiTailSweep_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature, SPELL_TAILSWEEP); + m_uiTailSweep_Timer = 2000; + } + else + m_uiTailSweep_Timer -= uiDiff; + + //MarkOfNature_Timer + //if (m_uiMarkOfNature_Timer < uiDiff) + //{ + // DoCastSpellIfCan(m_creature->getVictim(), SPELL_MARKOFNATURE); + // m_uiMarkOfNature_Timer = 45000; + //} + //else + //m_uiMarkOfNature_Timer -= uiDiff; + + //LightningWave_Timer + if (m_uiLightningWave_Timer < uiDiff) + { + //Cast LIGHTNINGWAVE on a Random target + if (Unit *pTarget = m_creature->SelectAttackingTarget(ATTACKING_TARGET_RANDOM, 0)) + DoCastSpellIfCan(pTarget, SPELL_LIGHTNINGWAVE); + + m_uiLightningWave_Timer = urand(7000, 12000); + } + else + m_uiLightningWave_Timer -= uiDiff; + + //Summon Druids + if (m_creature->GetHealthPercent() <= float(100 - 25*m_uiSummonDruidModifier)) + { + DoScriptText(SAY_SUMMONDRUIDS, m_creature); + + for(int i = 0; i < 10; ++i) + DoCastSpellIfCan(m_creature, SPELL_SUMMONDRUIDS, CAST_TRIGGERED); + + ++m_uiSummonDruidModifier; + } + + DoMeleeAttackIfReady(); + } +}; + +// Summoned druid script +struct MANGOS_DLL_DECL mob_dementeddruidsAI : public ScriptedAI +{ + mob_dementeddruidsAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiMoonFire_Timer; + + void Reset() + { + m_uiMoonFire_Timer = 3000; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //MoonFire_Timer + if (m_uiMoonFire_Timer < uiDiff) + { + DoCastSpellIfCan(m_creature->getVictim(), SPELL_MOONFIRE); + m_uiMoonFire_Timer = 5000; + } + else + m_uiMoonFire_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ysondre(Creature* pCreature) +{ + return new boss_ysondreAI(pCreature); +} + +CreatureAI* GetAI_mob_dementeddruids(Creature* pCreature) +{ + return new mob_dementeddruidsAI(pCreature); +} + +void AddSC_boss_ysondre() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ysondre"; + newscript->GetAI = &GetAI_boss_ysondre; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_dementeddruids"; + newscript->GetAI = &GetAI_mob_dementeddruids; + newscript->RegisterSelf(); +} diff --git a/scripts/world/go_scripts.cpp b/scripts/world/go_scripts.cpp new file mode 100644 index 0000000..a06958f --- /dev/null +++ b/scripts/world/go_scripts.cpp @@ -0,0 +1,653 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: GO_Scripts +SD%Complete: 100 +SDComment: Quest support: 4285,4287,4288(crystal pylons), 4296, 5088, 5097, 5098, 6481, 10990, 10991, 10992, 14092/14076. Field_Repair_Bot->Teaches spell 22704. Barov_journal->Teaches spell 26089 +SDCategory: Game Objects +EndScriptData */ + +/* ContentData +go_cat_figurine (the "trap" version of GO, two different exist) +go_northern_crystal_pylon +go_eastern_crystal_pylon +go_western_crystal_pylon +go_barov_journal +go_ethereum_prison +go_ethereum_stasis +go_field_repair_bot_74A +go_mysterious_snow_mound +go_orb_of_command +go_resonite_cask +go_sacred_fire_of_life +go_shrine_of_the_birds +go_tablet_of_madness +go_tablet_of_the_seven +go_tele_to_dalaran_crystal +go_tele_to_violet_stand +go_andorhal_tower +go_scourge_enclosure +EndContentData */ + +#include "precompiled.h" + +/*###### +## go_cat_figurine +######*/ + +enum +{ + SPELL_SUMMON_GHOST_SABER = 5968, +}; + +bool GOHello_go_cat_figurine(Player* pPlayer, GameObject* pGo) +{ + pPlayer->CastSpell(pPlayer, SPELL_SUMMON_GHOST_SABER, true); + return false; +} + +/*###### +## go_crystal_pylons (3x) +######*/ + +enum +{ + QUEST_THE_NORTHERN_PYLON = 4285, + QUEST_THE_EASTERN_PYLON = 4287, + QUEST_THE_WESTERN_PYLON = 4288 +}; + +bool GOHello_go_northern_crystal_pylon(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + { + pPlayer->PrepareQuestMenu(pGo->GetGUID()); + pPlayer->SendPreparedQuest(pGo->GetGUID()); + } + + if (pPlayer->GetQuestStatus(QUEST_THE_NORTHERN_PYLON) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_THE_NORTHERN_PYLON); + + return true; +} + +bool GOHello_go_eastern_crystal_pylon(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + { + pPlayer->PrepareQuestMenu(pGo->GetGUID()); + pPlayer->SendPreparedQuest(pGo->GetGUID()); + } + + if (pPlayer->GetQuestStatus(QUEST_THE_EASTERN_PYLON) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_THE_EASTERN_PYLON); + + return true; +} + +bool GOHello_go_western_crystal_pylon(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() == GAMEOBJECT_TYPE_QUESTGIVER) + { + pPlayer->PrepareQuestMenu(pGo->GetGUID()); + pPlayer->SendPreparedQuest(pGo->GetGUID()); + } + + if (pPlayer->GetQuestStatus(QUEST_THE_WESTERN_PYLON) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_THE_WESTERN_PYLON); + + return true; +} + +/*###### +## go_barov_journal +######*/ + +enum +{ + SPELL_TAILOR_FELCLOTH_BAG = 26086, + SPELL_LEARN_FELCLOTH_BAG = 26095 +}; + +bool GOHello_go_barov_journal(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->HasSkill(SKILL_TAILORING) && pPlayer->GetBaseSkillValue(SKILL_TAILORING) >= 280 && !pPlayer->HasSpell(SPELL_TAILOR_FELCLOTH_BAG)) + { + pPlayer->CastSpell(pPlayer, SPELL_LEARN_FELCLOTH_BAG, false); + } + return true; +} + +/*###### +## go_ethereum_prison +######*/ + +enum +{ + FACTION_LC = 1011, + FACTION_SHAT = 935, + FACTION_CE = 942, + FACTION_CON = 933, + FACTION_KT = 989, + FACTION_SPOR = 970, + + SPELL_REP_LC = 39456, + SPELL_REP_SHAT = 39457, + SPELL_REP_CE = 39460, + SPELL_REP_CON = 39474, + SPELL_REP_KT = 39475, + SPELL_REP_SPOR = 39476 +}; + +const uint32 uiNpcPrisonEntry[] = +{ + 22810, 22811, 22812, 22813, 22814, 22815, //good guys + 20783, 20784, 20785, 20786, 20788, 20789, 20790 //bad guys +}; + +bool GOHello_go_ethereum_prison(Player* pPlayer, GameObject* pGo) +{ + uint8 uiRandom = urand(0, (sizeof(uiNpcPrisonEntry) / sizeof(uint32)) -1); + + if (Creature* pCreature = pPlayer->SummonCreature(uiNpcPrisonEntry[uiRandom], + pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), pGo->GetAngle(pPlayer), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + if (!pCreature->IsHostileTo(pPlayer)) + { + uint32 uiSpell = 0; + + if (FactionTemplateEntry const* pFaction = pCreature->getFactionTemplateEntry()) + { + switch(pFaction->faction) + { + case FACTION_LC: uiSpell = SPELL_REP_LC; break; + case FACTION_SHAT: uiSpell = SPELL_REP_SHAT; break; + case FACTION_CE: uiSpell = SPELL_REP_CE; break; + case FACTION_CON: uiSpell = SPELL_REP_CON; break; + case FACTION_KT: uiSpell = SPELL_REP_KT; break; + case FACTION_SPOR: uiSpell = SPELL_REP_SPOR; break; + } + + if (uiSpell) + pCreature->CastSpell(pPlayer,uiSpell,false); + else + error_log("SD2: go_ethereum_prison summoned creature (entry %u) but faction (%u) are not expected by script.",pCreature->GetEntry(),pCreature->getFaction()); + } + } + } + + return false; +} + +/*###### +## go_ethereum_stasis +######*/ + +const uint32 uiNpcStasisEntry[] = +{ + 22825, 20888, 22827, 22826, 22828 +}; + +bool GOHello_go_ethereum_stasis(Player* pPlayer, GameObject* pGo) +{ + uint8 uiRandom = urand(0, (sizeof(uiNpcStasisEntry) / sizeof(uint32)) -1); + + pPlayer->SummonCreature(uiNpcStasisEntry[uiRandom], + pGo->GetPositionX(), pGo->GetPositionY(), pGo->GetPositionZ(), pGo->GetAngle(pPlayer), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + return false; +} + +/*###### +## go_field_repair_bot_74A +######*/ + +enum +{ + SPELL_ENGINEER_FIELD_REPAIR_BOT_74A = 22704, + SPELL_LEARN_FIELD_REPAIR_BOT_74A = 22864 +}; + +bool GOHello_go_field_repair_bot_74A(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->HasSkill(SKILL_ENGINEERING) && pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 300 && !pPlayer->HasSpell(SPELL_ENGINEER_FIELD_REPAIR_BOT_74A)) + pPlayer->CastSpell(pPlayer, SPELL_LEARN_FIELD_REPAIR_BOT_74A, false); + + return true; +} + +/*###### +## go_gilded_brazier +######*/ + +enum +{ + NPC_STILLBLADE = 17716, +}; + +bool GOHello_go_gilded_brazier(Player* pPlayer, GameObject* pGO) +{ + if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + { + if (Creature* pCreature = pPlayer->SummonCreature(NPC_STILLBLADE, 8087.632f, -7542.740f, 151.568f, 0.122f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + pCreature->AI()->AttackStart(pPlayer); + } + + return true; +} + +/*###### +## go_jump_a_tron +######*/ + +enum +{ + SPELL_JUMP_A_TRON = 33382, + NPC_JUMP_A_TRON = 19041 +}; + +bool GOHello_go_jump_a_tron(Player* pPlayer, GameObject* pGo) +{ + if (Creature* pCreature = GetClosestCreatureWithEntry(pGo, NPC_JUMP_A_TRON, INTERACTION_DISTANCE)) + pCreature->CastSpell(pPlayer, SPELL_JUMP_A_TRON, false); + + return false; +} + +/*###### +## go_mysterious_snow_mound +######*/ + +enum +{ + SPELL_SUMMON_DEEP_JORMUNGAR = 66510, + SPELL_SUMMON_MOLE_MACHINE = 66492, + SPELL_SUMMON_MARAUDER = 66491, +}; + +bool GOHello_go_mysterious_snow_mound(Player* pPlayer, GameObject* pGo) +{ + if (urand(0,1)) + { + pPlayer->CastSpell(pPlayer, SPELL_SUMMON_DEEP_JORMUNGAR, true); + } + else + { + // This is basically wrong, but added for support. + // Mole machine would summon, along with unkonwn GO (a GO trap?) and then + // the npc would summon with base of that location. + pPlayer->CastSpell(pPlayer, SPELL_SUMMON_MOLE_MACHINE, true); + pPlayer->CastSpell(pPlayer, SPELL_SUMMON_MARAUDER, true); + } + + pGo->SetLootState(GO_JUST_DEACTIVATED); + return true; +} + +/*###### +## go_orb_of_command +######*/ + +enum +{ + QUEST_BLACKHANDS_COMMAND = 7761, + SPELL_TELEPORT_TO_BWL = 23460 +}; + +bool GOHello_go_orb_of_command(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestRewardStatus(QUEST_BLACKHANDS_COMMAND)) + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT_TO_BWL, true); + + return true; +} + +/*###### +## go_resonite_cask +######*/ + +enum +{ + NPC_GOGGEROC = 11920 +}; + +bool GOHello_go_resonite_cask(Player* pPlayer, GameObject* pGO) +{ + if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + pGO->SummonCreature(NPC_GOGGEROC, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); + + return false; +} + +/*###### +## go_sacred_fire_of_life +######*/ + +enum +{ + NPC_ARIKARA = 10882, +}; + +bool GOHello_go_sacred_fire_of_life(Player* pPlayer, GameObject* pGO) +{ + if (pGO->GetGoType() == GAMEOBJECT_TYPE_GOOBER) + pPlayer->SummonCreature(NPC_ARIKARA, -5008.338f, -2118.894f, 83.657f, 0.874f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + + return true; +} + +/*###### +## go_shrine_of_the_birds +######*/ + +enum +{ + NPC_HAWK_GUARD = 22992, + NPC_EAGLE_GUARD = 22993, + NPC_FALCON_GUARD = 22994, + GO_SHRINE_HAWK = 185551, + GO_SHRINE_EAGLE = 185547, + GO_SHRINE_FALCON = 185553 +}; + +bool GOHello_go_shrine_of_the_birds(Player* pPlayer, GameObject* pGo) +{ + uint32 uiBirdEntry = 0; + + float fX,fY,fZ; + pGo->GetClosePoint(fX, fY, fZ, pGo->GetObjectBoundingRadius(), INTERACTION_DISTANCE); + + switch(pGo->GetEntry()) + { + case GO_SHRINE_HAWK: + uiBirdEntry = NPC_HAWK_GUARD; + break; + case GO_SHRINE_EAGLE: + uiBirdEntry = NPC_EAGLE_GUARD; + break; + case GO_SHRINE_FALCON: + uiBirdEntry = NPC_FALCON_GUARD; + break; + } + + if (uiBirdEntry) + pPlayer->SummonCreature(uiBirdEntry, fX, fY, fZ, pGo->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000); + + return false; +} + +/*###### +## go_tablet_of_madness +######*/ + +enum +{ + SPELL_ALCHEMY_GURUBASHI_MOJO_MADNESS = 24266, + SPELL_LEARN_GURUBASHI_MOJO_MADNESS = 24267 +}; + +bool GOHello_go_tablet_of_madness(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->HasSkill(SKILL_ALCHEMY) && pPlayer->GetSkillValue(SKILL_ALCHEMY) >= 300 && !pPlayer->HasSpell(SPELL_ALCHEMY_GURUBASHI_MOJO_MADNESS)) + pPlayer->CastSpell(pPlayer, SPELL_LEARN_GURUBASHI_MOJO_MADNESS, false); + + return true; +} + +/*###### +## go_tablet_of_the_seven - OBSOLETE +######*/ + +//TODO: use gossip option ("Transcript the Tablet") instead, if Mangos adds support. +bool GOHello_go_tablet_of_the_seven(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER) + return true; + + if (pPlayer->GetQuestStatus(4296) == QUEST_STATUS_INCOMPLETE) + pPlayer->CastSpell(pPlayer, 15065, false); + + return true; +} + +/*###### +## go_tele_to_dalaran_crystal +######*/ + +enum +{ + QUEST_LEARN_LEAVE_RETURN = 12790, + QUEST_TELE_CRYSTAL_FLAG = 12845 +}; + +bool GOHello_go_tele_to_dalaran_crystal(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestRewardStatus(QUEST_TELE_CRYSTAL_FLAG)) + return false; + + //TODO: must send error message (what kind of message? On-screen?) + return true; +} + +/*###### +## go_tele_to_violet_stand +######*/ + +bool GOHello_go_tele_to_violet_stand(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestRewardStatus(QUEST_LEARN_LEAVE_RETURN) || pPlayer->GetQuestStatus(QUEST_LEARN_LEAVE_RETURN) == QUEST_STATUS_INCOMPLETE) + return false; + + return true; +} + +enum +{ + NPC_ZELEMAR_THE_WRATHFULL = 17830, + SAY_AGGRO = -1000579 +}; + +float Position[4] = {-327.99f, 221.74f, -20.31f, 3.87f}; + +bool GOHello_go_blood_filled_orb(Player* pPlayer, GameObject* pGo) +{ + if (Creature* pZelemar = pGo->SummonCreature(NPC_ZELEMAR_THE_WRATHFULL, Position[0], Position[1], Position[2], Position[3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + DoScriptText(SAY_AGGRO, pZelemar); + pZelemar->AI()->AttackStart(pPlayer); + } + return false; +} + +/*###### +## go_andorhal_tower +######*/ + +enum +{ + QUEST_ALL_ALONG_THE_WATCHTOWERS_ALLIANCE = 5097, + QUEST_ALL_ALONG_THE_WATCHTOWERS_HORDE = 5098, + NPC_ANDORHAL_TOWER_1 = 10902, + NPC_ANDORHAL_TOWER_2 = 10903, + NPC_ANDORHAL_TOWER_3 = 10904, + NPC_ANDORHAL_TOWER_4 = 10905, + GO_ANDORHAL_TOWER_1 = 176094, + GO_ANDORHAL_TOWER_2 = 176095, + GO_ANDORHAL_TOWER_3 = 176096, + GO_ANDORHAL_TOWER_4 = 176097 +}; + +bool GOHello_go_andorhal_tower(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->GetQuestStatus(QUEST_ALL_ALONG_THE_WATCHTOWERS_ALLIANCE) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_ALL_ALONG_THE_WATCHTOWERS_HORDE) == QUEST_STATUS_INCOMPLETE) + { + uint32 uiKillCredit = 0; + switch(pGo->GetEntry()) + { + case GO_ANDORHAL_TOWER_1: uiKillCredit = NPC_ANDORHAL_TOWER_1; break; + case GO_ANDORHAL_TOWER_2: uiKillCredit = NPC_ANDORHAL_TOWER_2; break; + case GO_ANDORHAL_TOWER_3: uiKillCredit = NPC_ANDORHAL_TOWER_3; break; + case GO_ANDORHAL_TOWER_4: uiKillCredit = NPC_ANDORHAL_TOWER_4; break; + } + if (uiKillCredit) + pPlayer->KilledMonsterCredit(uiKillCredit); + } + return true; +} + +/*###### +## go_scourge_enclosure +######*/ + +enum +{ + SPELL_GYMER_LOCK_EXPLOSION = 55529, + NPC_GYMER_LOCK_DUMMY = 29928 + +}; + +bool GOHello_go_scourge_enclosure(Player* pPlayer, GameObject* pGo) +{ + std::list m_lResearchersList; + GetCreatureListWithEntryInGrid(m_lResearchersList, pGo, NPC_GYMER_LOCK_DUMMY, 15.0f); + if (!m_lResearchersList.empty()) + { + for(std::list::iterator itr = m_lResearchersList.begin(); itr != m_lResearchersList.end(); ++itr) + { + (*itr)->CastSpell((*itr),SPELL_GYMER_LOCK_EXPLOSION,true); + } + } + pPlayer->KilledMonsterCredit(NPC_GYMER_LOCK_DUMMY); + return true; +} + +void AddSC_go_scripts() +{ + Script* pNewScript; + + pNewScript = new Script; + pNewScript->Name = "go_cat_figurine"; + pNewScript->pGOHello = &GOHello_go_cat_figurine; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_northern_crystal_pylon"; + pNewScript->pGOHello = &GOHello_go_northern_crystal_pylon; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_eastern_crystal_pylon"; + pNewScript->pGOHello = &GOHello_go_eastern_crystal_pylon; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_western_crystal_pylon"; + pNewScript->pGOHello = &GOHello_go_western_crystal_pylon; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_barov_journal"; + pNewScript->pGOHello = &GOHello_go_barov_journal; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_ethereum_prison"; + pNewScript->pGOHello = &GOHello_go_ethereum_prison; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_ethereum_stasis"; + pNewScript->pGOHello = &GOHello_go_ethereum_stasis; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_field_repair_bot_74A"; + pNewScript->pGOHello = &GOHello_go_field_repair_bot_74A; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_gilded_brazier"; + pNewScript->pGOHello = &GOHello_go_gilded_brazier; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_jump_a_tron"; + pNewScript->pGOHello = &GOHello_go_jump_a_tron; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_mysterious_snow_mound"; + pNewScript->pGOHello = &GOHello_go_mysterious_snow_mound; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_orb_of_command"; + pNewScript->pGOHello = &GOHello_go_orb_of_command; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_resonite_cask"; + pNewScript->pGOHello = &GOHello_go_resonite_cask; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_sacred_fire_of_life"; + pNewScript->pGOHello = &GOHello_go_sacred_fire_of_life; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_shrine_of_the_birds"; + pNewScript->pGOHello = &GOHello_go_shrine_of_the_birds; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_tablet_of_madness"; + pNewScript->pGOHello = &GOHello_go_tablet_of_madness; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_tablet_of_the_seven"; + pNewScript->pGOHello = &GOHello_go_tablet_of_the_seven; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_tele_to_dalaran_crystal"; + pNewScript->pGOHello = &GOHello_go_tele_to_dalaran_crystal; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_tele_to_violet_stand"; + pNewScript->pGOHello = &GOHello_go_tele_to_violet_stand; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_blood_filled_orb"; + pNewScript->pGOHello = &GOHello_go_blood_filled_orb; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_andorhal_tower"; + pNewScript->pGOHello = &GOHello_go_andorhal_tower; + pNewScript->RegisterSelf(); + + pNewScript = new Script; + pNewScript->Name = "go_scourge_enclosure"; + pNewScript->pGOHello = &GOHello_go_scourge_enclosure; + pNewScript->RegisterSelf(); +} diff --git a/scripts/world/guards.cpp b/scripts/world/guards.cpp new file mode 100644 index 0000000..f9418c9 --- /dev/null +++ b/scripts/world/guards.cpp @@ -0,0 +1,381 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Guards +SD%Complete: 100 +SDComment: CombatAI should be organized better for future. +SDCategory: Guards +EndScriptData */ + +/* ContentData +guard_azuremyst +guard_bluffwatcher +guard_contested +guard_darnassus +guard_dunmorogh +guard_durotar +guard_elwynnforest +guard_eversong +guard_exodar +guard_ironforge +guard_mulgore +guard_orgrimmar +guard_shattrath +guard_shattrath_aldor +guard_shattrath_scryer +guard_silvermoon +guard_stormwind +guard_teldrassil +guard_tirisfal +guard_undercity +EndContentData */ + +#include "precompiled.h" +#include "guard_ai.h" + +CreatureAI* GetAI_guard_azuremyst(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_bluffwatcher(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_contested(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_darnassus(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_dunmorogh(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_durotar(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_elwynnforest(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_eversong(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_exodar(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_ironforge(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_mulgore(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_orgrimmar(Creature* pCreature) +{ + return new guardAI_orgrimmar(pCreature); +} + +CreatureAI* GetAI_guard_shattrath(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +/******************************************************* + * guard_shattrath_aldor + *******************************************************/ + +struct MANGOS_DLL_DECL guard_shattrath_aldorAI : public guardAI +{ + guard_shattrath_aldorAI(Creature* pCreature) : guardAI(pCreature) { Reset(); } + + uint32 m_uiExile_Timer; + uint32 m_uiBanish_Timer; + uint64 m_uiPlayerGUID; + bool m_bCanTeleport; + + void Reset() + { + m_uiBanish_Timer = 5000; + m_uiExile_Timer = 8500; + m_uiPlayerGUID = 0; + m_bCanTeleport = false; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bCanTeleport) + { + if (m_uiExile_Timer < uiDiff) + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + pTarget->CastSpell(pTarget, SPELL_EXILE, true); + pTarget->CastSpell(pTarget, SPELL_BANISH_TELEPORT, true); + } + + m_uiPlayerGUID = 0; + m_uiExile_Timer = 8500; + m_bCanTeleport = false; + } + else + m_uiExile_Timer -= uiDiff; + } + else if (m_uiBanish_Timer < uiDiff) + { + Unit* pVictim = m_creature->getVictim(); + + if (pVictim && pVictim->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(pVictim, SPELL_BANISHED_SHATTRATH_A); + m_uiBanish_Timer = 9000; + m_uiPlayerGUID = pVictim->GetGUID(); + + if (m_uiPlayerGUID) + m_bCanTeleport = true; + } + } + else + m_uiBanish_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_guard_shattrath_aldor(Creature* pCreature) +{ + return new guard_shattrath_aldorAI(pCreature); +} + +/******************************************************* + * guard_shattrath_scryer + *******************************************************/ + +struct MANGOS_DLL_DECL guard_shattrath_scryerAI : public guardAI +{ + guard_shattrath_scryerAI(Creature* pCreature) : guardAI(pCreature) { Reset(); } + + uint32 m_uiExile_Timer; + uint32 m_uiBanish_Timer; + uint64 m_uiPlayerGUID; + bool m_bCanTeleport; + + void Reset() + { + m_uiBanish_Timer = 5000; + m_uiExile_Timer = 8500; + m_uiPlayerGUID = 0; + m_bCanTeleport = false; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_bCanTeleport) + { + if (m_uiExile_Timer < uiDiff) + { + if (Player* pTarget = m_creature->GetMap()->GetPlayer(m_uiPlayerGUID)) + { + pTarget->CastSpell(pTarget, SPELL_EXILE, true); + pTarget->CastSpell(pTarget, SPELL_BANISH_TELEPORT, true); + } + + m_uiPlayerGUID = 0; + m_uiExile_Timer = 8500; + m_bCanTeleport = false; + } + else + m_uiExile_Timer -= uiDiff; + } + else if (m_uiBanish_Timer < uiDiff) + { + Unit* pVictim = m_creature->getVictim(); + + if (pVictim && pVictim->GetTypeId() == TYPEID_PLAYER) + { + DoCastSpellIfCan(pVictim, SPELL_BANISHED_SHATTRATH_S); + m_uiBanish_Timer = 9000; + m_uiPlayerGUID = pVictim->GetGUID(); + + if (m_uiPlayerGUID) + m_bCanTeleport = true; + } + } + else + m_uiBanish_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_guard_shattrath_scryer(Creature* pCreature) +{ + return new guard_shattrath_scryerAI(pCreature); +} + +CreatureAI* GetAI_guard_silvermoon(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_stormwind(Creature* pCreature) +{ + return new guardAI_stormwind(pCreature); +} + +CreatureAI* GetAI_guard_teldrassil(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_tirisfal(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +CreatureAI* GetAI_guard_undercity(Creature* pCreature) +{ + return new guardAI(pCreature); +} + +void AddSC_guards() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "guard_azuremyst"; + newscript->GetAI = &GetAI_guard_azuremyst; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_bluffwatcher"; + newscript->GetAI = &GetAI_guard_bluffwatcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_contested"; + newscript->GetAI = &GetAI_guard_contested; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_darnassus"; + newscript->GetAI = &GetAI_guard_darnassus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_dunmorogh"; + newscript->GetAI = &GetAI_guard_dunmorogh; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_durotar"; + newscript->GetAI = &GetAI_guard_durotar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_elwynnforest"; + newscript->GetAI = &GetAI_guard_elwynnforest; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_eversong"; + newscript->GetAI = &GetAI_guard_eversong; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_exodar"; + newscript->GetAI = &GetAI_guard_exodar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_ironforge"; + newscript->GetAI = &GetAI_guard_ironforge; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_mulgore"; + newscript->GetAI = &GetAI_guard_mulgore; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_orgrimmar"; + newscript->GetAI = &GetAI_guard_orgrimmar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_shattrath"; + newscript->GetAI = &GetAI_guard_shattrath; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_shattrath_aldor"; + newscript->GetAI = &GetAI_guard_shattrath_aldor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_shattrath_scryer"; + newscript->GetAI = &GetAI_guard_shattrath_scryer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_silvermoon"; + newscript->GetAI = &GetAI_guard_silvermoon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_stormwind"; + newscript->GetAI = &GetAI_guard_stormwind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_teldrassil"; + newscript->GetAI = &GetAI_guard_teldrassil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_tirisfal"; + newscript->GetAI = &GetAI_guard_tirisfal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "guard_undercity"; + newscript->GetAI = &GetAI_guard_undercity; + newscript->RegisterSelf(); +} diff --git a/scripts/world/item_scripts.cpp b/scripts/world/item_scripts.cpp new file mode 100644 index 0000000..62e729f --- /dev/null +++ b/scripts/world/item_scripts.cpp @@ -0,0 +1,153 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Item_Scripts +SD%Complete: 100 +SDComment: Items for a range of different items. See content below (in script) +SDCategory: Items +EndScriptData */ + +/* ContentData +item_arcane_charges Prevent use if player is not flying (cannot cast while on ground) +item_flying_machine(i34060,i34061) Engineering crafted flying machines +item_gor_dreks_ointment(i30175) Protecting Our Own(q10488) +EndContentData */ + +#include "precompiled.h" +#include "Spell.h" + +/*##### +# item_arcane_charges +#####*/ + +enum +{ + SPELL_ARCANE_CHARGES = 45072 +}; + +bool ItemUse_item_arcane_charges(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + if (pPlayer->IsTaxiFlying()) + return false; + + pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + + if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_ARCANE_CHARGES)) + Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_ON_GROUND); + + return true; +} + +/*##### +# item_flying_machine +#####*/ + +bool ItemUse_item_flying_machine(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + uint32 itemId = pItem->GetEntry(); + + if (itemId == 34060) + if (pPlayer->GetBaseSkillValue(SKILL_RIDING) >= 225) + return false; + + if (itemId == 34061) + if (pPlayer->GetBaseSkillValue(SKILL_RIDING) == 300) + return false; + + debug_log("SD2: Player attempt to use item %u, but did not meet riding requirement",itemId); + pPlayer->SendEquipError(EQUIP_ERR_CANT_EQUIP_SKILL, pItem, NULL); + return true; +} + +/*##### +# item_gor_dreks_ointment +#####*/ + +enum +{ + NPC_TH_DIRE_WOLF = 20748, + SPELL_GORDREKS_OINTMENT = 32578 +}; + +bool ItemUse_item_gor_dreks_ointment(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + if (pTargets.getUnitTarget() && pTargets.getUnitTarget()->GetTypeId() == TYPEID_UNIT && pTargets.getUnitTarget()->HasAura(SPELL_GORDREKS_OINTMENT)) + { + pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + + if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_GORDREKS_OINTMENT)) + Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_TARGET_AURASTATE); + + return true; + } + + return false; +} + +/*##### +# item_petrov_cluster_bombs +#####*/ + +enum +{ + SPELL_PETROV_BOMB = 42406, + AREA_ID_SHATTERED_STRAITS = 4064, + ZONE_ID_HOWLING = 495 +}; + +bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets) +{ + if (pPlayer->GetZoneId() != ZONE_ID_HOWLING) + return false; + + if (!pPlayer->GetTransport() || pPlayer->GetAreaId() != AREA_ID_SHATTERED_STRAITS) + { + pPlayer->SendEquipError(EQUIP_ERR_NONE, pItem, NULL); + + if (const SpellEntry* pSpellInfo = GetSpellStore()->LookupEntry(SPELL_PETROV_BOMB)) + Spell::SendCastResult(pPlayer, pSpellInfo, 1, SPELL_FAILED_NOT_HERE); + + return true; + } + + return false; +} + +void AddSC_item_scripts() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "item_arcane_charges"; + newscript->pItemUse = &ItemUse_item_arcane_charges; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_flying_machine"; + newscript->pItemUse = &ItemUse_item_flying_machine; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_gor_dreks_ointment"; + newscript->pItemUse = &ItemUse_item_gor_dreks_ointment; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "item_petrov_cluster_bombs"; + newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs; + newscript->RegisterSelf(); +} diff --git a/scripts/world/mob_generic_creature.cpp b/scripts/world/mob_generic_creature.cpp new file mode 100644 index 0000000..e79a217 --- /dev/null +++ b/scripts/world/mob_generic_creature.cpp @@ -0,0 +1,172 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Generic_Creature +SD%Complete: 80 +SDComment: Should be replaced with core based AI +SDCategory: Creatures +EndScriptData */ + +#include "precompiled.h" + +#define GENERIC_CREATURE_COOLDOWN 5000 + +struct MANGOS_DLL_DECL generic_creatureAI : public ScriptedAI +{ + generic_creatureAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) + uint32 BuffTimer; //This variable keeps track of buffs + bool IsSelfRooted; + + void Reset() + { + GlobalCooldown = 0; + BuffTimer = 0; //Rebuff as soon as we can + IsSelfRooted = false; + } + + void Aggro(Unit *who) + { + if (!m_creature->IsWithinDistInMap(who, ATTACK_DISTANCE)) + { + IsSelfRooted = true; + } + } + + void UpdateAI(const uint32 diff) + { + //Always decrease our global cooldown first + if (GlobalCooldown > diff) + GlobalCooldown -= diff; + else GlobalCooldown = 0; + + //Buff timer (only buff when we are alive and not in combat + if (!m_creature->isInCombat() && m_creature->isAlive()) + if (BuffTimer < diff) + { + //Find a spell that targets friendly and applies an aura (these are generally buffs) + SpellEntry const *info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA); + + if (info && !GlobalCooldown) + { + //Cast the buff spell + DoCastSpell(m_creature, info); + + //Set our global cooldown + GlobalCooldown = GENERIC_CREATURE_COOLDOWN; + + //Set our timer to 10 minutes before rebuff + BuffTimer = 600000; + }//Try agian in 30 seconds + else BuffTimer = 30000; + }else BuffTimer -= diff; + + //Return since we have no target + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + //If we are within range melee the target + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + //Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + bool Healing = false; + SpellEntry const *info = NULL; + + //Select a healing spell if less than 30% hp + if (m_creature->GetHealthPercent() < 30.0f) + info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); + + //No healing spell available, select a hostile spell + if (info) Healing = true; + else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE); + + //50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell + if (info && (rand() % (m_creature->GetCreatureInfo()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown) + { + //Cast the spell + if (Healing)DoCastSpell(m_creature, info); + else DoCastSpell(m_creature->getVictim(), info); + + //Set our global cooldown + GlobalCooldown = GENERIC_CREATURE_COOLDOWN; + } + else m_creature->AttackerStateUpdate(m_creature->getVictim()); + + m_creature->resetAttackTimer(); + } + } + else + { + //Only run this code if we arn't already casting + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + bool Healing = false; + SpellEntry const *info = NULL; + + //Select a healing spell if less than 30% hp ONLY 33% of the time + if (m_creature->GetHealthPercent() < 30.0f && !urand(0, 2)) + info = SelectSpell(m_creature, -1, -1, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING); + + //No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE) + if (info) Healing = true; + else info = SelectSpell(m_creature->getVictim(), -1, -1, SELECT_TARGET_ANY_ENEMY, 0, 0, ATTACK_DISTANCE, 0, SELECT_EFFECT_DONTCARE); + + //Found a spell, check if we arn't on cooldown + if (info && !GlobalCooldown) + { + //If we are currently moving stop us and set the movement generator + if (!IsSelfRooted) + { + IsSelfRooted = true; + } + + //Cast spell + if (Healing) DoCastSpell(m_creature,info); + else DoCastSpell(m_creature->getVictim(),info); + + //Set our global cooldown + GlobalCooldown = GENERIC_CREATURE_COOLDOWN; + + + }//If no spells available and we arn't moving run to target + else if (IsSelfRooted) + { + //Cancel our current spell and then allow movement agian + m_creature->InterruptNonMeleeSpells(false); + IsSelfRooted = false; + } + } + } + } +}; + +CreatureAI* GetAI_generic_creature(Creature* pCreature) +{ + return new generic_creatureAI(pCreature); +} + +void AddSC_generic_creature() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "generic_creature"; + newscript->GetAI = &GetAI_generic_creature; + newscript->RegisterSelf(false); +} diff --git a/scripts/world/npc_professions.cpp b/scripts/world/npc_professions.cpp new file mode 100644 index 0000000..cd02104 --- /dev/null +++ b/scripts/world/npc_professions.cpp @@ -0,0 +1,1341 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Npc_Professions +SD%Complete: 80 +SDComment: Provides learn/unlearn/relearn-options for professions. Not supported: Unlearn engineering, re-learn engineering, re-learn leatherworking. +SDCategory: NPCs +EndScriptData */ + +#include "precompiled.h" + +/* +A few notes for future developement: +- A full implementation of gossip for GO's is required. They must have the same scripting capabilities as creatures. Basically, +there is no difference here (except that default text is chosen with `gameobject_template`.`data3` (for GO type2, different dataN for a few others) +- It's possible blacksmithing still require some tweaks and adjustments due to the way we _have_ to use reputation. +*/ + +/* +-- UPDATE `gameobject_template` SET `ScriptName` = 'go_soothsaying_for_dummies' WHERE `entry` = 177226; +*/ + +/*### +# to be removed from here (->ncp_text). This is data for database projects. +###*/ +#define TALK_MUST_UNLEARN_WEAPON "You must forget your weapon type specialty before I can help you. Go to Everlook in Winterspring and seek help there." + +#define TALK_HAMMER_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the hammersmith." +#define TALK_AXE_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the axesmith." +#define TALK_SWORD_LEARN "Ah, a seasoned veteran you once were. I know you are capable, you merely need to ask and I shall teach you the way of the swordsmith." + +#define TALK_HAMMER_UNLEARN "Forgetting your Hammersmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Hammersmithing to create!" +#define TALK_AXE_UNLEARN "Forgetting your Axesmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Axesmithing to create!" +#define TALK_SWORD_UNLEARN "Forgetting your Swordsmithing skill is not something to do lightly. If you choose to abandon it you will forget all recipes that require Swordsmithing to create!" + +/*### +# generic defines +###*/ + +#define GOSSIP_SENDER_LEARN 50 +#define GOSSIP_SENDER_UNLEARN 51 +#define GOSSIP_SENDER_CHECK 52 + +/*### +# gossip item and box texts +###*/ + +#define GOSSIP_LEARN_POTION "Please teach me how to become a Master of Potions, Lauranna" +#define GOSSIP_UNLEARN_POTION "I wish to unlearn Potion Mastery" +#define GOSSIP_LEARN_TRANSMUTE "Please teach me how to become a Master of Transmutations, Zarevhi" +#define GOSSIP_UNLEARN_TRANSMUTE "I wish to unlearn Transmutation Mastery" +#define GOSSIP_LEARN_ELIXIR "Please teach me how to become a Master of Elixirs, Lorokeem" +#define GOSSIP_UNLEARN_ELIXIR "I wish to unlearn Elixir Mastery" + +#define BOX_UNLEARN_ALCHEMY_SPEC "Do you really want to unlearn your alchemy specialty and lose all associated recipes? \n Cost: " + +#define GOSSIP_WEAPON_LEARN "Please teach me how to become a Weaponsmith" +#define GOSSIP_WEAPON_UNLEARN "I wish to unlearn the art of Weaponsmithing" +#define GOSSIP_ARMOR_LEARN "Please teach me how to become a Armorsmith" +#define GOSSIP_ARMOR_UNLEARN "I wish to unlearn the art of Armorsmithing" + +#define GOSSIP_UNLEARN_SMITH_SPEC "I wish to unlearn my blacksmith specialty" +#define BOX_UNLEARN_ARMORORWEAPON "Do you really want to unlearn your blacksmith specialty and lose all associated recipes? \n Cost: " + +#define GOSSIP_LEARN_HAMMER "Please teach me how to become a Hammersmith, Lilith" +#define GOSSIP_UNLEARN_HAMMER "I wish to unlearn Hammersmithing" +#define GOSSIP_LEARN_AXE "Please teach me how to become a Axesmith, Kilram" +#define GOSSIP_UNLEARN_AXE "I wish to unlearn Axesmithing" +#define GOSSIP_LEARN_SWORD "Please teach me how to become a Swordsmith, Seril" +#define GOSSIP_UNLEARN_SWORD "I wish to unlearn Swordsmithing" + +#define BOX_UNLEARN_WEAPON_SPEC "Do you really want to unlearn your weaponsmith specialty and lose all associated recipes? \n Cost: " + +#define GOSSIP_LEARN_DRAGON "I am absolutely certain that i want to learn dragonscale leatherworking" +#define GOSSIP_UNLEARN_DRAGON "I wish to unlearn Dragonscale Leatherworking" +#define GOSSIP_LEARN_ELEMENTAL "I am absolutely certain that i want to learn elemental leatherworking" +#define GOSSIP_UNLEARN_ELEMENTAL "I wish to unlearn Elemental Leatherworking" +#define GOSSIP_LEARN_TRIBAL "I am absolutely certain that i want to learn tribal leatherworking" +#define GOSSIP_UNLEARN_TRIBAL "I wish to unlearn Tribal Leatherworking" + +#define BOX_UNLEARN_LEATHER_SPEC "Do you really want to unlearn your leatherworking specialty and lose all associated recipes? \n Cost: " + +#define GOSSIP_LEARN_SPELLFIRE "Please teach me how to become a Spellcloth tailor" +#define GOSSIP_UNLEARN_SPELLFIRE "I wish to unlearn Spellfire Tailoring" +#define GOSSIP_LEARN_MOONCLOTH "Please teach me how to become a Mooncloth tailor" +#define GOSSIP_UNLEARN_MOONCLOTH "I wish to unlearn Mooncloth Tailoring" +#define GOSSIP_LEARN_SHADOWEAVE "Please teach me how to become a Shadoweave tailor" +#define GOSSIP_UNLEARN_SHADOWEAVE "I wish to unlearn Shadoweave Tailoring" + +#define BOX_UNLEARN_TAILOR_SPEC "Do you really want to unlearn your tailoring specialty and lose all associated recipes? \n Cost: " + +#define GOSSIP_LEARN_GOBLIN "I am absolutely certain that i want to learn Goblin engineering" +#define GOSSIP_LEARN_GNOMISH "I am absolutely certain that i want to learn Gnomish engineering" + +/*### +# spells defines +###*/ + +#define S_WEAPON 9787 +#define S_ARMOR 9788 +#define S_HAMMER 17040 +#define S_AXE 17041 +#define S_SWORD 17039 + +#define S_LEARN_WEAPON 9789 +#define S_LEARN_ARMOR 9790 +#define S_LEARN_HAMMER 39099 +#define S_LEARN_AXE 39098 +#define S_LEARN_SWORD 39097 + +#define S_UNLEARN_WEAPON 36436 +#define S_UNLEARN_ARMOR 36435 +#define S_UNLEARN_HAMMER 36441 +#define S_UNLEARN_AXE 36439 +#define S_UNLEARN_SWORD 36438 + +#define S_REP_ARMOR 17451 +#define S_REP_WEAPON 17452 + +#define REP_ARMOR 46 +#define REP_WEAPON 289 +#define REP_HAMMER 569 +#define REP_AXE 570 +#define REP_SWORD 571 + +#define S_DRAGON 10656 +#define S_ELEMENTAL 10658 +#define S_TRIBAL 10660 + +#define S_LEARN_DRAGON 10657 +#define S_LEARN_ELEMENTAL 10659 +#define S_LEARN_TRIBAL 10661 + +#define S_UNLEARN_DRAGON 36434 +#define S_UNLEARN_ELEMENTAL 36328 +#define S_UNLEARN_TRIBAL 36433 + +#define S_GOBLIN 20222 +#define S_GNOMISH 20219 + +#define S_LEARN_GOBLIN 20221 +#define S_LEARN_GNOMISH 20220 + +#define S_SPELLFIRE 26797 +#define S_MOONCLOTH 26798 +#define S_SHADOWEAVE 26801 + +#define S_LEARN_SPELLFIRE 26796 +#define S_LEARN_MOONCLOTH 26799 +#define S_LEARN_SHADOWEAVE 26800 + +#define S_UNLEARN_SPELLFIRE 41299 +#define S_UNLEARN_MOONCLOTH 41558 +#define S_UNLEARN_SHADOWEAVE 41559 + +#define S_TRANSMUTE 28672 +#define S_ELIXIR 28677 +#define S_POTION 28675 + +#define S_LEARN_TRANSMUTE 28674 +#define S_LEARN_ELIXIR 28678 +#define S_LEARN_POTION 28676 + +#define S_UNLEARN_TRANSMUTE 41565 +#define S_UNLEARN_ELIXIR 41564 +#define S_UNLEARN_POTION 41563 + +/*### +# formulas to calculate unlearning cost +###*/ + +int32 GetLearningCost(Player* pPlayer) //tailor, alchemy +{ + return 200000; +} + +int32 GetUnlearnCostHigh(Player* pPlayer) //tailor, alchemy +{ + return 1500000; +} + +int32 GetUnlearnCostMedium(Player* pPlayer) //blacksmith, leatherwork +{ + uint32 level = pPlayer->getLevel(); + + if (level < 51) + return 250000; + else if (level < 66) + return 500000; + else + return 1000000; +} + +int32 GetUnlearnCostLow(Player* pPlayer) //blacksmith +{ + if (pPlayer->getLevel() < 66) + return 50000; + else + return 100000; +} + +/*### +# unlearning related profession spells +###*/ + +bool EquippedOk(Player* pPlayer, uint32 spellId) +{ + SpellEntry const* spell = GetSpellStore()->LookupEntry(spellId); + + if (!spell) + return false; + + for(int i=0; i<3; ++i) + { + uint32 reqSpell = spell->EffectTriggerSpell[i]; + if (!reqSpell) + continue; + + Item* pItem; + for(int j = EQUIPMENT_SLOT_START; j < EQUIPMENT_SLOT_END; ++j) + { + pItem = pPlayer->GetItemByPos(INVENTORY_SLOT_BAG_0, j); + if (pItem) + if (pItem->GetProto()->RequiredSpell == reqSpell) + { + //pPlayer has item equipped that require specialty. Not allow to unlearn, player has to unequip first + debug_log("SD2: player attempt to unlearn spell %u, but item %u is equipped.",reqSpell,pItem->GetProto()->ItemId); + return false; + } + } + } + return true; +} + +void ProfessionUnlearnSpells(Player* pPlayer, uint32 type) +{ + switch (type) + { + case 36436: // S_UNLEARN_WEAPON + pPlayer->removeSpell(36125); // Light Earthforged Blade + pPlayer->removeSpell(36128); // Light Emberforged Hammer + pPlayer->removeSpell(36126); // Light Skyforged Axe + break; + case 36435: // S_UNLEARN_ARMOR + pPlayer->removeSpell(36122); // Earthforged Leggings + pPlayer->removeSpell(36129); // Heavy Earthforged Breastplate + pPlayer->removeSpell(36130); // Stormforged Hauberk + pPlayer->removeSpell(34533); // Breastplate of Kings + pPlayer->removeSpell(34529); // Nether Chain Shirt + pPlayer->removeSpell(34534); // Bulwark of Kings + pPlayer->removeSpell(36257); // Bulwark of the Ancient Kings + pPlayer->removeSpell(36256); // Embrace of the Twisting Nether + pPlayer->removeSpell(34530); // Twisting Nether Chain Shirt + pPlayer->removeSpell(36124); // Windforged Leggings + break; + case 36441: // S_UNLEARN_HAMMER + pPlayer->removeSpell(36262); // Dragonstrike + pPlayer->removeSpell(34546); // Dragonmaw + pPlayer->removeSpell(34545); // Drakefist Hammer + pPlayer->removeSpell(36136); // Lavaforged Warhammer + pPlayer->removeSpell(34547); // Thunder + pPlayer->removeSpell(34567); // Deep Thunder + pPlayer->removeSpell(36263); // Stormherald + pPlayer->removeSpell(36137); // Great Earthforged Hammer + break; + case 36439: // S_UNLEARN_AXE + pPlayer->removeSpell(36260); // Wicked Edge of the Planes + pPlayer->removeSpell(34562); // Black Planar Edge + pPlayer->removeSpell(34541); // The Planar Edge + pPlayer->removeSpell(36134); // Stormforged Axe + pPlayer->removeSpell(36135); // Skyforged Great Axe + pPlayer->removeSpell(36261); // Bloodmoon + pPlayer->removeSpell(34543); // Lunar Crescent + pPlayer->removeSpell(34544); // Mooncleaver + break; + case 36438: // S_UNLEARN_SWORD + pPlayer->removeSpell(36258); // Blazefury + pPlayer->removeSpell(34537); // Blazeguard + pPlayer->removeSpell(34535); // Fireguard + pPlayer->removeSpell(36131); // Windforged Rapier + pPlayer->removeSpell(36133); // Stoneforged Claymore + pPlayer->removeSpell(34538); // Lionheart Blade + pPlayer->removeSpell(34540); // Lionheart Champion + pPlayer->removeSpell(36259); // Lionheart Executioner + break; + case 36434: // S_UNLEARN_DRAGON + pPlayer->removeSpell(36076); // Dragonstrike Leggings + pPlayer->removeSpell(36079); // Golden Dragonstrike Breastplate + pPlayer->removeSpell(35576); // Ebon Netherscale Belt + pPlayer->removeSpell(35577); // Ebon Netherscale Bracers + pPlayer->removeSpell(35575); // Ebon Netherscale Breastplate + pPlayer->removeSpell(35582); // Netherstrike Belt + pPlayer->removeSpell(35584); // Netherstrike Bracers + pPlayer->removeSpell(35580); // Netherstrike Breastplate + break; + case 36328: // S_UNLEARN_ELEMENTAL + pPlayer->removeSpell(36074); // Blackstorm Leggings + pPlayer->removeSpell(36077); // Primalstorm Breastplate + pPlayer->removeSpell(35590); // Primalstrike Belt + pPlayer->removeSpell(35591); // Primalstrike Bracers + pPlayer->removeSpell(35589); // Primalstrike Vest + break; + case 36433: // S_UNLEARN_TRIBAL + pPlayer->removeSpell(35585); // Windhawk Hauberk + pPlayer->removeSpell(35587); // Windhawk Belt + pPlayer->removeSpell(35588); // Windhawk Bracers + pPlayer->removeSpell(36075); // Wildfeather Leggings + pPlayer->removeSpell(36078); // Living Crystal Breastplate + break; + case 41299: // S_UNLEARN_SPELLFIRE + pPlayer->removeSpell(26752); // Spellfire Belt + pPlayer->removeSpell(26753); // Spellfire Gloves + pPlayer->removeSpell(26754); // Spellfire Robe + break; + case 41558: // S_UNLEARN_MOONCLOTH + pPlayer->removeSpell(26760); // Primal Mooncloth Belt + pPlayer->removeSpell(26761); // Primal Mooncloth Shoulders + pPlayer->removeSpell(26762); // Primal Mooncloth Robe + break; + case 41559: // S_UNLEARN_SHADOWEAVE + pPlayer->removeSpell(26756); // Frozen Shadoweave Shoulders + pPlayer->removeSpell(26757); // Frozen Shadoweave Boots + pPlayer->removeSpell(26758); // Frozen Shadoweave Robe + break; + } +} + +/*### +# start menues alchemy +###*/ + +bool HasAlchemySpell(Player* pPlayer) +{ + if (pPlayer->HasSpell(S_TRANSMUTE) || pPlayer->HasSpell(S_ELIXIR) || pPlayer->HasSpell(S_POTION)) + return true; + return false; +} + +bool GossipHello_npc_prof_alchemy(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (pCreature->isTrainer()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + uint32 eCreature = pCreature->GetEntry(); + + if (pPlayer->HasSkill(SKILL_ALCHEMY) && pPlayer->GetBaseSkillValue(SKILL_ALCHEMY)>=350 && pPlayer->getLevel() > 67) + { + if (pPlayer->GetQuestRewardStatus(10899) || pPlayer->GetQuestRewardStatus(10902) || pPlayer->GetQuestRewardStatus(10897)) + { + switch (eCreature) + { + case 22427: //Zarevhi + if (!HasAlchemySpell(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1); + if (pPlayer->HasSpell(S_TRANSMUTE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4); + break; + case 19052: //Lorokeem + if (!HasAlchemySpell(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2); + if (pPlayer->HasSpell(S_ELIXIR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5); + break; + case 17909: //Lauranna Thar'well + if (!HasAlchemySpell(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3); + if (pPlayer->HasSpell(S_POTION)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6); + break; + } + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +void SendActionMenu_npc_prof_alchemy(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRAIN: + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + break; + //Learn Alchemy + case GOSSIP_ACTION_INFO_DEF + 1: + if (!pPlayer->HasSpell(S_TRANSMUTE) && pPlayer->GetMoney() >= uint32(GetLearningCost(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_LEARN_TRANSMUTE, true); + pPlayer->ModifyMoney(-GetLearningCost(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + if (!pPlayer->HasSpell(S_ELIXIR) && pPlayer->GetMoney() >= uint32(GetLearningCost(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_LEARN_ELIXIR, true); + pPlayer->ModifyMoney(-GetLearningCost(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + if (!pPlayer->HasSpell(S_POTION) && pPlayer->GetMoney() >= uint32(GetLearningCost(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_LEARN_POTION, true); + pPlayer->ModifyMoney(-GetLearningCost(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + //Unlearn Alchemy + case GOSSIP_ACTION_INFO_DEF + 4: + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostHigh(pPlayer))) + { + pCreature->CastSpell(pPlayer, S_UNLEARN_TRANSMUTE, true); + pPlayer->ModifyMoney(-GetUnlearnCostHigh(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostHigh(pPlayer))) + { + pCreature->CastSpell(pPlayer, S_UNLEARN_ELIXIR, true); + pPlayer->ModifyMoney(-GetUnlearnCostHigh(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostHigh(pPlayer))) + { + pCreature->CastSpell(pPlayer, S_UNLEARN_POTION, true); + pPlayer->ModifyMoney(-GetUnlearnCostHigh(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } +} + +void SendConfirmLearn_npc_prof_alchemy(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 22427: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 19052: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_ELIXIR, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 17909: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_POTION, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +void SendConfirmUnlearn_npc_prof_alchemy(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 22427: //Zarevhi + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRANSMUTE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, GetUnlearnCostHigh(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 19052: //Lorokeem + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELIXIR, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, GetUnlearnCostHigh(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 17909: //Lauranna Thar'well + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_POTION, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ALCHEMY_SPEC, GetUnlearnCostHigh(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +bool GossipSelect_npc_prof_alchemy(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiSender) + { + case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_alchemy(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_alchemy(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_alchemy(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_alchemy(pPlayer, pCreature, uiAction); break; + } + return true; +} + +/*### +# start menues blacksmith +###*/ + +bool HasWeaponSub(Player* pPlayer) +{ + if (pPlayer->HasSpell(S_HAMMER) || pPlayer->HasSpell(S_AXE) || pPlayer->HasSpell(S_SWORD)) + return true; + return false; +} + +bool GossipHello_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (pCreature->isTrainer()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + uint32 eCreature = pCreature->GetEntry(); + //WEAPONSMITH & ARMORSMITH + if (pPlayer->GetBaseSkillValue(SKILL_BLACKSMITHING)>=225) + { + switch (eCreature) + { + case 11145: //Myolor Sunderfury + case 11176: //Krathok Moltenfist + if (!pPlayer->HasSpell(S_ARMOR) && !pPlayer->HasSpell(S_WEAPON) && pPlayer->GetReputationRank(REP_ARMOR) == REP_FRIENDLY) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARMOR_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + if (!pPlayer->HasSpell(S_WEAPON) && !pPlayer->HasSpell(S_ARMOR) && pPlayer->GetReputationRank(REP_WEAPON) == REP_FRIENDLY) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEAPON_LEARN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + break; + case 11146: //Ironus Coldsteel + case 11178: //Borgosh Corebender + if (pPlayer->HasSpell(S_WEAPON)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEAPON_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3); + break; + case 5164: //Grumnus Steelshaper + case 11177: //Okothos Ironrager + if (pPlayer->HasSpell(S_ARMOR)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ARMOR_UNLEARN, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4); + break; + } + } + //WEAPONSMITH SPEC + if (pPlayer->HasSpell(S_WEAPON) && pPlayer->getLevel() > 49 && pPlayer->GetBaseSkillValue(SKILL_BLACKSMITHING)>=250) + { + switch (eCreature) + { + case 11191: //Lilith the Lithe + if (!HasWeaponSub(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 5); + if (pPlayer->HasSpell(S_HAMMER)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 8); + break; + case 11192: //Kilram + if (!HasWeaponSub(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 6); + if (pPlayer->HasSpell(S_AXE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 9); + break; + case 11193: //Seril Scourgebane + if (!HasWeaponSub(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 7); + if (pPlayer->HasSpell(S_SWORD)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 10); + break; + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +void SendActionMenu_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRAIN: + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + break; + //Learn Armor/Weapon + case GOSSIP_ACTION_INFO_DEF + 1: + if (!pPlayer->HasSpell(S_ARMOR)) + { + pPlayer->CastSpell(pPlayer, S_LEARN_ARMOR, true); + //pCreature->CastSpell(pPlayer, S_REP_ARMOR, true); + } + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + if (!pPlayer->HasSpell(S_WEAPON)) + { + pPlayer->CastSpell(pPlayer, S_LEARN_WEAPON, true); + //pCreature->CastSpell(pPlayer, S_REP_WEAPON, true); + } + pPlayer->CLOSE_GOSSIP_MENU(); + break; + //Unlearn Armor/Weapon + case GOSSIP_ACTION_INFO_DEF + 3: + if (HasWeaponSub(pPlayer)) + { + //unknown textID (TALK_MUST_UNLEARN_WEAPON) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + else if (EquippedOk(pPlayer,S_UNLEARN_WEAPON)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostLow(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_WEAPON, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_WEAPON); + pPlayer->ModifyMoney(-GetUnlearnCostLow(pPlayer)); + pCreature->CastSpell(pPlayer, S_REP_ARMOR, true); + pPlayer->CLOSE_GOSSIP_MENU(); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } + else + { + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + } + break; + case GOSSIP_ACTION_INFO_DEF + 4: + if (EquippedOk(pPlayer,S_UNLEARN_ARMOR)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostLow(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_ARMOR, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_ARMOR); + pPlayer->ModifyMoney(-GetUnlearnCostLow(pPlayer)); + pCreature->CastSpell(pPlayer, S_REP_WEAPON, true); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + //Learn Hammer/Axe/Sword + case GOSSIP_ACTION_INFO_DEF + 5: + pPlayer->CastSpell(pPlayer, S_LEARN_HAMMER, true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + pPlayer->CastSpell(pPlayer, S_LEARN_AXE, true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 7: + pPlayer->CastSpell(pPlayer, S_LEARN_SWORD, true); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + //Unlearn Hammer/Axe/Sword + case GOSSIP_ACTION_INFO_DEF + 8: + if (EquippedOk(pPlayer,S_UNLEARN_HAMMER)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostMedium(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_HAMMER, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_HAMMER); + pPlayer->ModifyMoney(-GetUnlearnCostMedium(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 9: + if (EquippedOk(pPlayer,S_UNLEARN_AXE)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostMedium(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_AXE, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_AXE); + pPlayer->ModifyMoney(-GetUnlearnCostMedium(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 10: + if (EquippedOk(pPlayer,S_UNLEARN_SWORD)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostMedium(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_SWORD, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_SWORD); + pPlayer->ModifyMoney(-GetUnlearnCostMedium(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } +} + +void SendConfirmLearn_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 11191: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_HAMMER, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID (TALK_HAMMER_LEARN) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 11192: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_AXE, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID (TALK_AXE_LEARN) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 11193: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SWORD, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID (TALK_SWORD_LEARN) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +void SendConfirmUnlearn_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 11146: //Ironus Coldsteel + case 11178: //Borgosh Corebender + case 5164: //Grumnus Steelshaper + case 11177: //Okothos Ironrager + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SMITH_SPEC, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_ARMORORWEAPON, GetUnlearnCostLow(pPlayer),false); + //unknown textID (TALK_UNLEARN_AXEORWEAPON) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + + case 11191: + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_HAMMER, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, GetUnlearnCostMedium(pPlayer),false); + //unknown textID (TALK_HAMMER_UNLEARN) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 11192: + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_AXE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, GetUnlearnCostMedium(pPlayer),false); + //unknown textID (TALK_AXE_UNLEARN) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 11193: + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SWORD, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_WEAPON_SPEC, GetUnlearnCostMedium(pPlayer),false); + //unknown textID (TALK_SWORD_UNLEARN) + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +bool GossipSelect_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiSender) + { + case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_blacksmith(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_blacksmith(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_blacksmith(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_blacksmith(pPlayer, pCreature, uiAction); break; + } + return true; +} + +/*bool QuestComplete_npc_prof_blacksmith(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if ((pQuest->GetQuestId() == 5283) || (pQuest->GetQuestId() == 5301)) //armorsmith + pCreature->CastSpell(pPlayer, 17451, true); + + if ((pQuest->GetQuestId() == 5284) || (pQuest->GetQuestId() == 5302)) //weaponsmith + pCreature->CastSpell(pPlayer, 17452, true); + + return true; +}*/ + +/*### +# engineering trinkets +###*/ + +enum +{ + NPC_ZAP = 14742, + NPC_JHORDY = 14743, + NPC_KABLAM = 21493, + NPC_SMILES = 21494, + + SPELL_LEARN_TO_EVERLOOK = 23490, + SPELL_LEARN_TO_GADGET = 23491, + SPELL_LEARN_TO_AREA52 = 36956, + SPELL_LEARN_TO_TOSHLEY = 36957, + + SPELL_TO_EVERLOOK = 23486, + SPELL_TO_GADGET = 23489, + SPELL_TO_AREA52 = 36954, + SPELL_TO_TOSHLEY = 36955, + + ITEM_GNOMISH_CARD = 10790, + ITEM_GOBLIN_CARD = 10791 +}; + +#define GOSSIP_ITEM_ZAP "[PH] Unknown" +#define GOSSIP_ITEM_JHORDY "I must build a beacon for this marvelous device!" +#define GOSSIP_ITEM_KABLAM "[PH] Unknown" +#define GOSSIP_ITEM_SMILES "[PH] Unknown" + +bool GossipHello_npc_engineering_tele_trinket(Player* pPlayer, Creature* pCreature) +{ + uint32 uiNpcTextId = 0; + std::string strGossipItem; + bool bCanLearn = false; + + if (pPlayer->HasSkill(SKILL_ENGINEERING)) + { + switch(pCreature->GetEntry()) + { + case NPC_ZAP: + uiNpcTextId = 7249; + if (pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 260 && pPlayer->HasSpell(S_GOBLIN)) + { + if (!pPlayer->HasSpell(SPELL_TO_EVERLOOK)) + { + bCanLearn = true; + strGossipItem = GOSSIP_ITEM_ZAP; + } + else if (pPlayer->HasSpell(SPELL_TO_EVERLOOK)) + uiNpcTextId = 0; + } + break; + case NPC_JHORDY: + uiNpcTextId = 7251; + if (pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 260 && pPlayer->HasSpell(S_GNOMISH)) + { + if (!pPlayer->HasSpell(SPELL_TO_GADGET)) + { + bCanLearn = true; + strGossipItem = GOSSIP_ITEM_JHORDY; + } + else if (pPlayer->HasSpell(SPELL_TO_GADGET)) + uiNpcTextId = 7252; + } + break; + case NPC_KABLAM: + uiNpcTextId = 10365; + if (pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 350 && pPlayer->HasSpell(S_GOBLIN)) + { + if (!pPlayer->HasSpell(SPELL_TO_AREA52)) + { + bCanLearn = true; + strGossipItem = GOSSIP_ITEM_KABLAM; + } + else if (pPlayer->HasSpell(SPELL_TO_AREA52)) + uiNpcTextId = 0; + } + break; + case NPC_SMILES: + uiNpcTextId = 10363; + if (pPlayer->GetBaseSkillValue(SKILL_ENGINEERING) >= 350 && pPlayer->HasSpell(S_GNOMISH)) + { + if (!pPlayer->HasSpell(SPELL_TO_TOSHLEY)) + { + bCanLearn = true; + strGossipItem = GOSSIP_ITEM_SMILES; + } + else if (pPlayer->HasSpell(SPELL_TO_TOSHLEY)) + uiNpcTextId = 0; + } + break; + } + } + + if (bCanLearn) + { + if (pPlayer->HasItemCount(ITEM_GOBLIN_CARD,1) || pPlayer->HasItemCount(ITEM_GNOMISH_CARD,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, strGossipItem, pCreature->GetEntry(), GOSSIP_ACTION_INFO_DEF+1); + } + + pPlayer->SEND_GOSSIP_MENU(uiNpcTextId ? uiNpcTextId : pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_engineering_tele_trinket(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + pPlayer->CLOSE_GOSSIP_MENU(); + + if (uiSender != pCreature->GetEntry()) + return true; + + switch(uiSender) + { + case NPC_ZAP: + pPlayer->CastSpell(pPlayer,SPELL_LEARN_TO_EVERLOOK,false); + break; + case NPC_JHORDY: + pPlayer->CastSpell(pPlayer,SPELL_LEARN_TO_GADGET,false); + break; + case NPC_KABLAM: + pPlayer->CastSpell(pPlayer,SPELL_LEARN_TO_AREA52,false); + break; + case NPC_SMILES: + pPlayer->CastSpell(pPlayer,SPELL_LEARN_TO_TOSHLEY,false); + break; + } + + return true; +} + +/*### +# start menues leatherworking +###*/ + +bool GossipHello_npc_prof_leather(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (pCreature->isTrainer()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + uint32 eCreature = pCreature->GetEntry(); + + if (pPlayer->HasSkill(SKILL_LEATHERWORKING) && pPlayer->GetBaseSkillValue(SKILL_LEATHERWORKING)>=250 && pPlayer->getLevel() > 49) + { + switch (eCreature) + { + case 7866: //Peter Galen + case 7867: //Thorkaf Dragoneye + if (pPlayer->HasSpell(S_DRAGON)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 1); + break; + case 7868: //Sarah Tanner + case 7869: //Brumn Winterhoof + if (pPlayer->HasSpell(S_ELEMENTAL)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 2); + break; + case 7870: //Caryssia Moonhunter + case 7871: //Se'Jib + if (pPlayer->HasSpell(S_TRIBAL)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 3); + break; + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +void SendActionMenu_npc_prof_leather(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRAIN: + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + break; + //Unlearn Leather + case GOSSIP_ACTION_INFO_DEF + 1: + if (EquippedOk(pPlayer,S_UNLEARN_DRAGON)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostMedium(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_DRAGON, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_DRAGON); + pPlayer->ModifyMoney(-GetUnlearnCostMedium(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + if (EquippedOk(pPlayer,S_UNLEARN_ELEMENTAL)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostMedium(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_ELEMENTAL, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_ELEMENTAL); + pPlayer->ModifyMoney(-GetUnlearnCostMedium(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + if (EquippedOk(pPlayer,S_UNLEARN_TRIBAL)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostMedium(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_TRIBAL, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_TRIBAL); + pPlayer->ModifyMoney(-GetUnlearnCostMedium(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } +} + +void SendConfirmUnlearn_npc_prof_leather(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 7866: //Peter Galen + case 7867: //Thorkaf Dragoneye + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_DRAGON, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, GetUnlearnCostMedium(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 7868: //Sarah Tanner + case 7869: //Brumn Winterhoof + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_ELEMENTAL, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, GetUnlearnCostMedium(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 7870: //Caryssia Moonhunter + case 7871: //Se'Jib + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_TRIBAL, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_LEATHER_SPEC, GetUnlearnCostMedium(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +bool GossipSelect_npc_prof_leather(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiSender) + { + case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_leather(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_leather(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_leather(pPlayer, pCreature, uiAction); break; + } + return true; +} + +/*### +# start menues tailoring +###*/ + +bool HasTailorSpell(Player* pPlayer) +{ + if (pPlayer->HasSpell(S_MOONCLOTH) || pPlayer->HasSpell(S_SHADOWEAVE) || pPlayer->HasSpell(S_SPELLFIRE)) + return true; + return false; +} + +bool GossipHello_npc_prof_tailor(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + if (pCreature->isTrainer()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + uint32 eCreature = pCreature->GetEntry(); + //TAILORING SPEC + if (pPlayer->HasSkill(SKILL_TAILORING) && pPlayer->GetBaseSkillValue(SKILL_TAILORING)>=350 && pPlayer->getLevel() > 59) + { + if (pPlayer->GetQuestRewardStatus(10831) || pPlayer->GetQuestRewardStatus(10832) || pPlayer->GetQuestRewardStatus(10833)) + { + switch (eCreature) + { + case 22213: //Gidge Spellweaver + if (!HasTailorSpell(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 1); + if (pPlayer->HasSpell(S_SPELLFIRE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 4); + break; + case 22208: //Nasmara Moonsong + if (!HasTailorSpell(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 2); + if (pPlayer->HasSpell(S_MOONCLOTH)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 5); + break; + case 22212: //Andrion Darkspinner + if (!HasTailorSpell(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_LEARN, GOSSIP_ACTION_INFO_DEF + 3); + if (pPlayer->HasSpell(S_SHADOWEAVE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_UNLEARN, GOSSIP_ACTION_INFO_DEF + 6); + break; + } + } + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +void SendActionMenu_npc_prof_tailor(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRAIN: + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + break; + //Learn Tailor + case GOSSIP_ACTION_INFO_DEF + 1: + if (!pPlayer->HasSpell(S_SPELLFIRE) && pPlayer->GetMoney() >= uint32(GetLearningCost(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_LEARN_SPELLFIRE, true); + pPlayer->ModifyMoney(-GetLearningCost(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + if (!pPlayer->HasSpell(S_MOONCLOTH) && pPlayer->GetMoney() >= uint32(GetLearningCost(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_LEARN_MOONCLOTH, true); + pPlayer->ModifyMoney(-GetLearningCost(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + if (!pPlayer->HasSpell(S_SHADOWEAVE) && pPlayer->GetMoney() >= uint32(GetLearningCost(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_LEARN_SHADOWEAVE, true); + pPlayer->ModifyMoney(-GetLearningCost(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + //Unlearn Tailor + case GOSSIP_ACTION_INFO_DEF + 4: + if (EquippedOk(pPlayer,S_UNLEARN_SPELLFIRE)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostHigh(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_SPELLFIRE, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_SPELLFIRE); + pPlayer->ModifyMoney(-GetUnlearnCostHigh(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 5: + if (EquippedOk(pPlayer,S_UNLEARN_MOONCLOTH)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostHigh(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_MOONCLOTH, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_MOONCLOTH); + pPlayer->ModifyMoney(-GetUnlearnCostHigh(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + case GOSSIP_ACTION_INFO_DEF + 6: + if (EquippedOk(pPlayer,S_UNLEARN_SHADOWEAVE)) + { + if (pPlayer->GetMoney() >= uint32(GetUnlearnCostHigh(pPlayer))) + { + pPlayer->CastSpell(pPlayer, S_UNLEARN_SHADOWEAVE, true); + ProfessionUnlearnSpells(pPlayer, S_UNLEARN_SHADOWEAVE); + pPlayer->ModifyMoney(-GetUnlearnCostHigh(pPlayer)); + } else + pPlayer->SendBuyError(BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, 0, 0); + } else + pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW,NULL,NULL); + pPlayer->CLOSE_GOSSIP_MENU(); + break; + } +} + +void SendConfirmLearn_npc_prof_tailor(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 22213: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 22208: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 22212: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, uiAction); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +void SendConfirmUnlearn_npc_prof_tailor(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + if (uiAction) + { + uint32 eCreature = pCreature->GetEntry(); + switch(eCreature) + { + case 22213: //Gidge Spellweaver + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SPELLFIRE, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, GetUnlearnCostHigh(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 22208: //Nasmara Moonsong + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_MOONCLOTH, GOSSIP_SENDER_CHECK, uiAction, BOX_UNLEARN_TAILOR_SPEC, GetUnlearnCostHigh(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + case 22212: //Andrion Darkspinner + pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_UNLEARN_SHADOWEAVE, GOSSIP_SENDER_CHECK, uiAction,BOX_UNLEARN_TAILOR_SPEC, GetUnlearnCostHigh(pPlayer),false); + //unknown textID () + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + break; + } + } +} + +bool GossipSelect_npc_prof_tailor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiSender) + { + case GOSSIP_SENDER_MAIN: SendActionMenu_npc_prof_tailor(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_LEARN: SendConfirmLearn_npc_prof_tailor(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_UNLEARN: SendConfirmUnlearn_npc_prof_tailor(pPlayer, pCreature, uiAction); break; + case GOSSIP_SENDER_CHECK: SendActionMenu_npc_prof_tailor(pPlayer, pCreature, uiAction); break; + } + return true; +} + +/*### +# start menues for GO (engineering and leatherworking) +###*/ + +/*bool GOHello_go_soothsaying_for_dummies(Player* pPlayer, GameObject* pGo) +{ + pPlayer->PlayerTalkClass->GetGossipMenu()->AddMenuItem(0,GOSSIP_LEARN_DRAGON, GOSSIP_SENDER_INFO, GOSSIP_ACTION_INFO_DEF, "", 0); + + pPlayer->SEND_GOSSIP_MENU(5584, pGo->GetGUID()); + + return true; +}*/ + +/*### +# +###*/ + +void AddSC_npc_professions() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_prof_alchemy"; + newscript->pGossipHello = &GossipHello_npc_prof_alchemy; + newscript->pGossipSelect = &GossipSelect_npc_prof_alchemy; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_prof_blacksmith"; + newscript->pGossipHello = &GossipHello_npc_prof_blacksmith; + newscript->pGossipSelect = &GossipSelect_npc_prof_blacksmith; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_engineering_tele_trinket"; + newscript->pGossipHello = &GossipHello_npc_engineering_tele_trinket; + newscript->pGossipSelect = &GossipSelect_npc_engineering_tele_trinket; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_prof_leather"; + newscript->pGossipHello = &GossipHello_npc_prof_leather; + newscript->pGossipSelect = &GossipSelect_npc_prof_leather; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_prof_tailor"; + newscript->pGossipHello = &GossipHello_npc_prof_tailor; + newscript->pGossipSelect = &GossipSelect_npc_prof_tailor; + newscript->RegisterSelf(); + + /*newscript = new Script; + newscript->Name = "go_soothsaying_for_dummies"; + newscript->pGOHello = &GOHello_go_soothsaying_for_dummies; + //newscript->pGossipSelect = &GossipSelect_go_soothsaying_for_dummies; + newscript->RegisterSelf();*/ +} diff --git a/scripts/world/npcs_special.cpp b/scripts/world/npcs_special.cpp new file mode 100644 index 0000000..29fbdc8 --- /dev/null +++ b/scripts/world/npcs_special.cpp @@ -0,0 +1,1842 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Npcs_Special +SD%Complete: 100 +SDComment: To be used for special NPCs that are located globally. +SDCategory: NPCs +EndScriptData +*/ + +#include "precompiled.h" +#include "escort_ai.h" +#include "ObjectMgr.h" +#include "GameEventMgr.h" + +/* ContentData +npc_air_force_bots 80% support for misc (invisible) guard bots in areas where player allowed to fly. Summon guards after a preset time if tagged by spell +npc_chicken_cluck 100% support for quest 3861 (Cluck!) +npc_dancing_flames 100% midsummer event NPC +npc_guardian 100% guardianAI used to prevent players from accessing off-limits areas. Not in use by SD2 +npc_garments_of_quests 80% NPC's related to all Garments of-quests 5621, 5624, 5625, 5648, 5650 +npc_injured_patient 100% patients for triage-quests (6622 and 6624) +npc_doctor 100% Gustaf Vanhowzen and Gregory Victor, quest 6622 and 6624 (Triage) +npc_innkeeper 25% Innkeepers in general. A lot do be done here (misc options for events) +npc_kingdom_of_dalaran_quests Misc NPC's gossip option related to quests 12791, 12794 and 12796 +npc_lunaclaw_spirit 100% Appears at two different locations, quest 6001/6002 +npc_mount_vendor 100% Regular mount vendors all over the world. Display gossip if player doesn't meet the requirements to buy +npc_rogue_trainer 80% Scripted trainers, so they are able to offer item 17126 for class quest 6681 +npc_sayge 100% Darkmoon event fortune teller, buff player based on answers given +npc_tabard_vendor 50% allow recovering quest related tabards, achievement related ones need core support +npc_locksmith 75% list of keys needs to be confirmed +EndContentData */ + +/*######## +# npc_air_force_bots +#########*/ + +enum SpawnType +{ + SPAWNTYPE_TRIPWIRE_ROOFTOP, // no warning, summon creature at smaller range + SPAWNTYPE_ALARMBOT // cast guards mark and summon npc - if player shows up with that buff duration < 5 seconds attack +}; + +struct SpawnAssociation +{ + uint32 m_uiThisCreatureEntry; + uint32 m_uiSpawnedCreatureEntry; + SpawnType m_SpawnType; +}; + +enum +{ + SPELL_GUARDS_MARK = 38067, + AURA_DURATION_TIME_LEFT = 5000 +}; + +const float RANGE_TRIPWIRE = 15.0f; +const float RANGE_GUARDS_MARK = 50.0f; + +SpawnAssociation m_aSpawnAssociations[] = +{ + {2614, 15241, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Alliance) + {2615, 15242, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Horde) + {21974, 21976, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Area 52) + {21993, 15242, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Horde - Bat Rider) + {21996, 15241, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Alliance - Gryphon) + {21997, 21976, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Goblin - Area 52 - Zeppelin) + {21999, 15241, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Alliance) + {22001, 15242, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Horde) + {22002, 15242, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Ground (Horde) + {22003, 15241, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Ground (Alliance) + {22063, 21976, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Goblin - Area 52) + {22065, 22064, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Ethereal - Stormspire) + {22066, 22067, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Scryer - Dragonhawk) + {22068, 22064, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Ethereal - Stormspire) + {22069, 22064, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Stormspire) + {22070, 22067, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Scryer) + {22071, 22067, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Scryer) + {22078, 22077, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Aldor) + {22079, 22077, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Aldor - Gryphon) + {22080, 22077, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Aldor) + {22086, 22085, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Sporeggar) + {22087, 22085, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Sporeggar - Spore Bat) + {22088, 22085, SPAWNTYPE_TRIPWIRE_ROOFTOP}, //Air Force Trip Wire - Rooftop (Sporeggar) + {22090, 22089, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Toshley's Station - Flying Machine) + {22124, 22122, SPAWNTYPE_ALARMBOT}, //Air Force Alarm Bot (Cenarion) + {22125, 22122, SPAWNTYPE_ALARMBOT}, //Air Force Guard Post (Cenarion - Stormcrow) + {22126, 22122, SPAWNTYPE_ALARMBOT} //Air Force Trip Wire - Rooftop (Cenarion Expedition) +}; + +struct MANGOS_DLL_DECL npc_air_force_botsAI : public ScriptedAI +{ + npc_air_force_botsAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pSpawnAssoc = NULL; + m_uiSpawnedGUID = 0; + + // find the correct spawnhandling + static uint32 uiEntryCount = sizeof(m_aSpawnAssociations)/sizeof(SpawnAssociation); + + for (uint8 i=0; iGetEntry()) + { + m_pSpawnAssoc = &m_aSpawnAssociations[i]; + break; + } + } + + if (!m_pSpawnAssoc) + error_db_log("SD2: Creature template entry %u has ScriptName npc_air_force_bots, but it's not handled by that script", pCreature->GetEntry()); + else + { + CreatureInfo const* spawnedTemplate = GetCreatureTemplateStore(m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + + if (!spawnedTemplate) + { + error_db_log("SD2: Creature template entry %u does not exist in DB, which is required by npc_air_force_bots", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + m_pSpawnAssoc = NULL; + return; + } + } + } + + SpawnAssociation* m_pSpawnAssoc; + uint64 m_uiSpawnedGUID; + + void Reset() { } + + Creature* SummonGuard() + { + Creature* pSummoned = m_creature->SummonCreature(m_pSpawnAssoc->m_uiSpawnedCreatureEntry, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 300000); + + if (pSummoned) + m_uiSpawnedGUID = pSummoned->GetGUID(); + else + { + error_db_log("SD2: npc_air_force_bots: wasn't able to spawn creature %u", m_pSpawnAssoc->m_uiSpawnedCreatureEntry); + m_pSpawnAssoc = NULL; + } + + return pSummoned; + } + + Creature* GetSummonedGuard() + { + Creature* pCreature = m_creature->GetMap()->GetCreature(m_uiSpawnedGUID); + + if (pCreature && pCreature->isAlive()) + return pCreature; + + return NULL; + } + + void MoveInLineOfSight(Unit* pWho) + { + if (!m_pSpawnAssoc) + return; + + if (pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho)) + { + Player* pPlayerTarget = pWho->GetTypeId() == TYPEID_PLAYER ? (Player*)pWho : NULL; + + // airforce guards only spawn for players + if (!pPlayerTarget) + return; + + Creature* pLastSpawnedGuard = m_uiSpawnedGUID == 0 ? NULL : GetSummonedGuard(); + + // prevent calling GetCreature at next MoveInLineOfSight call - speedup + if (!pLastSpawnedGuard) + m_uiSpawnedGUID = 0; + + switch(m_pSpawnAssoc->m_SpawnType) + { + case SPAWNTYPE_ALARMBOT: + { + if (!pWho->IsWithinDistInMap(m_creature, RANGE_GUARDS_MARK)) + return; + + Aura* pMarkAura = pWho->GetAura(SPELL_GUARDS_MARK, EFFECT_INDEX_0); + if (pMarkAura) + { + // the target wasn't able to move out of our range within 25 seconds + if (!pLastSpawnedGuard) + { + pLastSpawnedGuard = SummonGuard(); + + if (!pLastSpawnedGuard) + return; + } + + if (pMarkAura->GetAuraDuration() < AURA_DURATION_TIME_LEFT) + { + if (!pLastSpawnedGuard->getVictim()) + pLastSpawnedGuard->AI()->AttackStart(pWho); + } + } + else + { + if (!pLastSpawnedGuard) + pLastSpawnedGuard = SummonGuard(); + + if (!pLastSpawnedGuard) + return; + + pLastSpawnedGuard->CastSpell(pWho, SPELL_GUARDS_MARK, true); + } + break; + } + case SPAWNTYPE_TRIPWIRE_ROOFTOP: + { + if (!pWho->IsWithinDistInMap(m_creature, RANGE_TRIPWIRE)) + return; + + if (!pLastSpawnedGuard) + pLastSpawnedGuard = SummonGuard(); + + if (!pLastSpawnedGuard) + return; + + // ROOFTOP only triggers if the player is on the ground + if (!pPlayerTarget->IsFlying()) + { + if (!pLastSpawnedGuard->getVictim()) + pLastSpawnedGuard->AI()->AttackStart(pWho); + } + break; + } + } + } + } +}; + +CreatureAI* GetAI_npc_air_force_bots(Creature* pCreature) +{ + return new npc_air_force_botsAI(pCreature); +} + +/*######## +# npc_chicken_cluck +#########*/ + +enum +{ + EMOTE_A_HELLO = -1000204, + EMOTE_H_HELLO = -1000205, + EMOTE_CLUCK_TEXT2 = -1000206, + + QUEST_CLUCK = 3861, + FACTION_FRIENDLY = 35, + FACTION_CHICKEN = 31 +}; + +struct MANGOS_DLL_DECL npc_chicken_cluckAI : public ScriptedAI +{ + npc_chicken_cluckAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint32 m_uiResetFlagTimer; + + void Reset() + { + m_uiResetFlagTimer = 120000; + + m_creature->setFaction(FACTION_CHICKEN); + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + } + + void ReceiveEmote(Player* pPlayer, uint32 uiEmote) + { + if (uiEmote == TEXTEMOTE_CHICKEN) + { + if (!urand(0, 29)) + { + if (pPlayer->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_NONE) + { + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(FACTION_FRIENDLY); + + DoScriptText(EMOTE_A_HELLO, m_creature); + + /* are there any difference in texts, after 3.x ? + if (pPlayer->GetTeam() == HORDE) + DoScriptText(EMOTE_H_HELLO, m_creature); + else + DoScriptText(EMOTE_A_HELLO, m_creature); + */ + } + } + } + + if (uiEmote == TEXTEMOTE_CHEER) + { + if (pPlayer->GetQuestStatus(QUEST_CLUCK) == QUEST_STATUS_COMPLETE) + { + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER); + m_creature->setFaction(FACTION_FRIENDLY); + DoScriptText(EMOTE_CLUCK_TEXT2, m_creature); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + // Reset flags after a certain time has passed so that the next player has to start the 'event' again + if (m_creature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER)) + { + if (m_uiResetFlagTimer < uiDiff) + EnterEvadeMode(); + else + m_uiResetFlagTimer -= uiDiff; + } + + if (m_creature->SelectHostileTarget() && m_creature->getVictim()) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_chicken_cluck(Creature* pCreature) +{ + return new npc_chicken_cluckAI(pCreature); +} + +bool QuestAccept_npc_chicken_cluck(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_CLUCK) + { + if (npc_chicken_cluckAI* pChickenAI = dynamic_cast(pCreature->AI())) + pChickenAI->Reset(); + } + + return true; +} + +bool QuestComplete_npc_chicken_cluck(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_CLUCK) + { + if (npc_chicken_cluckAI* pChickenAI = dynamic_cast(pCreature->AI())) + pChickenAI->Reset(); + } + + return true; +} + +/*###### +## npc_dancing_flames +######*/ + +enum +{ + SPELL_FIERY_SEDUCTION = 47057 +}; + +struct MANGOS_DLL_DECL npc_dancing_flamesAI : public ScriptedAI +{ + npc_dancing_flamesAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() {} + + void ReceiveEmote(Player* pPlayer, uint32 uiEmote) + { + m_creature->SetFacingToObject(pPlayer); + + if (pPlayer->HasAura(SPELL_FIERY_SEDUCTION)) + pPlayer->RemoveAurasDueToSpell(SPELL_FIERY_SEDUCTION); + + if (pPlayer->IsMounted()) + { + pPlayer->Unmount(); // doesnt remove mount aura + pPlayer->RemoveSpellsCausingAura(SPELL_AURA_MOUNTED); + } + + switch(uiEmote) + { + case TEXTEMOTE_DANCE: DoCastSpellIfCan(pPlayer, SPELL_FIERY_SEDUCTION); break;// dance -> cast SPELL_FIERY_SEDUCTION + case TEXTEMOTE_WAVE: m_creature->HandleEmote(EMOTE_ONESHOT_WAVE); break;// wave -> wave + case TEXTEMOTE_JOKE: m_creature->HandleEmote(EMOTE_STATE_LAUGH); break;// silly -> laugh(with sound) + case TEXTEMOTE_BOW: m_creature->HandleEmote(EMOTE_ONESHOT_BOW); break;// bow -> bow + case TEXTEMOTE_KISS: m_creature->HandleEmote(TEXTEMOTE_CURTSEY); break;// kiss -> curtsey + } + } +}; + +CreatureAI* GetAI_npc_dancing_flames(Creature* pCreature) +{ + return new npc_dancing_flamesAI(pCreature); +} + +/*###### +## Triage quest +######*/ + +enum +{ + SAY_DOC1 = -1000201, + SAY_DOC2 = -1000202, + SAY_DOC3 = -1000203, + + QUEST_TRIAGE_H = 6622, + QUEST_TRIAGE_A = 6624, + + DOCTOR_ALLIANCE = 12939, + DOCTOR_HORDE = 12920, + ALLIANCE_COORDS = 7, + HORDE_COORDS = 6 +}; + +struct Location +{ + float x, y, z, o; +}; + +static Location AllianceCoords[]= +{ + {-3757.38f, -4533.05f, 14.16f, 3.62f}, // Top-far-right bunk as seen from entrance + {-3754.36f, -4539.13f, 14.16f, 5.13f}, // Top-far-left bunk + {-3749.54f, -4540.25f, 14.28f, 3.34f}, // Far-right bunk + {-3742.10f, -4536.85f, 14.28f, 3.64f}, // Right bunk near entrance + {-3755.89f, -4529.07f, 14.05f, 0.57f}, // Far-left bunk + {-3749.51f, -4527.08f, 14.07f, 5.26f}, // Mid-left bunk + {-3746.37f, -4525.35f, 14.16f, 5.22f}, // Left bunk near entrance +}; + +//alliance run to where +#define A_RUNTOX -3742.96f +#define A_RUNTOY -4531.52f +#define A_RUNTOZ 11.91f + +static Location HordeCoords[]= +{ + {-1013.75f, -3492.59f, 62.62f, 4.34f}, // Left, Behind + {-1017.72f, -3490.92f, 62.62f, 4.34f}, // Right, Behind + {-1015.77f, -3497.15f, 62.82f, 4.34f}, // Left, Mid + {-1019.51f, -3495.49f, 62.82f, 4.34f}, // Right, Mid + {-1017.25f, -3500.85f, 62.98f, 4.34f}, // Left, front + {-1020.95f, -3499.21f, 62.98f, 4.34f} // Right, Front +}; + +//horde run to where +#define H_RUNTOX -1016.44f +#define H_RUNTOY -3508.48f +#define H_RUNTOZ 62.96f + +const uint32 AllianceSoldierId[3] = +{ + 12938, // 12938 Injured Alliance Soldier + 12936, // 12936 Badly injured Alliance Soldier + 12937 // 12937 Critically injured Alliance Soldier +}; + +const uint32 HordeSoldierId[3] = +{ + 12923, //12923 Injured Soldier + 12924, //12924 Badly injured Soldier + 12925 //12925 Critically injured Soldier +}; + +/*###### +## npc_doctor (handles both Gustaf Vanhowzen and Gregory Victor) +######*/ + +struct MANGOS_DLL_DECL npc_doctorAI : public ScriptedAI +{ + npc_doctorAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 Playerguid; + + uint32 SummonPatient_Timer; + uint32 SummonPatientCount; + uint32 PatientDiedCount; + uint32 PatientSavedCount; + + bool Event; + + std::list Patients; + std::vector Coordinates; + + void Reset() + { + Playerguid = 0; + + SummonPatient_Timer = 10000; + SummonPatientCount = 0; + PatientDiedCount = 0; + PatientSavedCount = 0; + + Patients.clear(); + Coordinates.clear(); + + Event = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void BeginEvent(Player* pPlayer); + void PatientDied(Location* Point); + void PatientSaved(Creature* soldier, Player* pPlayer, Location* Point); + void UpdateAI(const uint32 diff); +}; + +/*##### +## npc_injured_patient (handles all the patients, no matter Horde or Alliance) +#####*/ + +struct MANGOS_DLL_DECL npc_injured_patientAI : public ScriptedAI +{ + npc_injured_patientAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + uint64 Doctorguid; + Location* Coord; + + void Reset() + { + Doctorguid = 0; + Coord = NULL; + + //no select + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //no regen health + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + //to make them lay with face down + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + uint32 mobId = m_creature->GetEntry(); + + switch (mobId) + { //lower max health + case 12923: + case 12938: //Injured Soldier + m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.75)); + break; + case 12924: + case 12936: //Badly injured Soldier + m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.50)); + break; + case 12925: + case 12937: //Critically injured Soldier + m_creature->SetHealth(uint32(m_creature->GetMaxHealth()*.25)); + break; + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (caster->GetTypeId() == TYPEID_PLAYER && m_creature->isAlive() && spell->Id == 20804) + { + if ((((Player*)caster)->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (((Player*)caster)->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE)) + { + if (Doctorguid) + { + if (Creature* pDoctor = m_creature->GetMap()->GetCreature(Doctorguid)) + { + if (npc_doctorAI* pDocAI = dynamic_cast(pDoctor->AI())) + pDocAI->PatientSaved(m_creature, (Player*)caster, Coord); + } + } + } + //make not selectable + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //regen health + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + //stand up + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + switch(urand(0, 2)) + { + case 0: DoScriptText(SAY_DOC1,m_creature); break; + case 1: DoScriptText(SAY_DOC2,m_creature); break; + case 2: DoScriptText(SAY_DOC3,m_creature); break; + } + + m_creature->RemoveSplineFlag(SPLINEFLAG_WALKMODE); + + uint32 mobId = m_creature->GetEntry(); + + switch (mobId) + { + case 12923: + case 12924: + case 12925: + m_creature->GetMotionMaster()->MovePoint(0, H_RUNTOX, H_RUNTOY, H_RUNTOZ); + break; + case 12936: + case 12937: + case 12938: + m_creature->GetMotionMaster()->MovePoint(0, A_RUNTOX, A_RUNTOY, A_RUNTOZ); + break; + } + } + } + + void UpdateAI(const uint32 diff) + { + //lower HP on every world tick makes it a useful counter, not officlone though + if (m_creature->isAlive() && m_creature->GetHealth() > 6) + { + m_creature->SetHealth(uint32(m_creature->GetHealth()-5)); + } + + if (m_creature->isAlive() && m_creature->GetHealth() <= 6) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IN_COMBAT); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDeathState(JUST_DIED); + m_creature->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); + + if (Doctorguid) + { + if (Creature* pDoctor = m_creature->GetMap()->GetCreature(Doctorguid)) + { + if (npc_doctorAI* pDocAI = dynamic_cast(pDoctor->AI())) + pDocAI->PatientDied(Coord); + } + } + } + } +}; + +CreatureAI* GetAI_npc_injured_patient(Creature* pCreature) +{ + return new npc_injured_patientAI(pCreature); +} + +/* +npc_doctor (continue) +*/ + +void npc_doctorAI::BeginEvent(Player* pPlayer) +{ + Playerguid = pPlayer->GetGUID(); + + SummonPatient_Timer = 10000; + SummonPatientCount = 0; + PatientDiedCount = 0; + PatientSavedCount = 0; + + switch(m_creature->GetEntry()) + { + case DOCTOR_ALLIANCE: + for(uint8 i = 0; i < ALLIANCE_COORDS; ++i) + Coordinates.push_back(&AllianceCoords[i]); + break; + case DOCTOR_HORDE: + for(uint8 i = 0; i < HORDE_COORDS; ++i) + Coordinates.push_back(&HordeCoords[i]); + break; + } + + Event = true; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); +} + +void npc_doctorAI::PatientDied(Location* Point) +{ + Player* pPlayer = m_creature->GetMap()->GetPlayer(Playerguid); + + if (pPlayer && ((pPlayer->GetQuestStatus(6624) == QUEST_STATUS_INCOMPLETE) || (pPlayer->GetQuestStatus(6622) == QUEST_STATUS_INCOMPLETE))) + { + ++PatientDiedCount; + + if (PatientDiedCount > 5 && Event) + { + if (pPlayer->GetQuestStatus(QUEST_TRIAGE_A) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_TRIAGE_A); + else if (pPlayer->GetQuestStatus(QUEST_TRIAGE_H) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_TRIAGE_H); + + Reset(); + return; + } + + Coordinates.push_back(Point); + } + else + // If no player or player abandon quest in progress + Reset(); +} + +void npc_doctorAI::PatientSaved(Creature* soldier, Player* pPlayer, Location* Point) +{ + if (pPlayer && Playerguid == pPlayer->GetGUID()) + { + if ((pPlayer->GetQuestStatus(QUEST_TRIAGE_A) == QUEST_STATUS_INCOMPLETE) || (pPlayer->GetQuestStatus(QUEST_TRIAGE_H) == QUEST_STATUS_INCOMPLETE)) + { + ++PatientSavedCount; + + if (PatientSavedCount == 15) + { + if (!Patients.empty()) + { + std::list::iterator itr; + for(itr = Patients.begin(); itr != Patients.end(); ++itr) + { + if (Creature* Patient = m_creature->GetMap()->GetCreature(*itr)) + Patient->SetDeathState(JUST_DIED); + } + } + + if (pPlayer->GetQuestStatus(QUEST_TRIAGE_A) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_TRIAGE_A, m_creature); + else if (pPlayer->GetQuestStatus(QUEST_TRIAGE_H) == QUEST_STATUS_INCOMPLETE) + pPlayer->GroupEventHappens(QUEST_TRIAGE_H, m_creature); + + Reset(); + return; + } + + Coordinates.push_back(Point); + } + } +} + +void npc_doctorAI::UpdateAI(const uint32 diff) +{ + if (Event && SummonPatientCount >= 20) + { + Reset(); + return; + } + + if (Event) + { + if (SummonPatient_Timer < diff) + { + Creature* Patient = NULL; + Location* Point = NULL; + + if (Coordinates.empty()) + return; + + std::vector::iterator itr = Coordinates.begin()+rand()%Coordinates.size(); + uint32 patientEntry = 0; + + switch(m_creature->GetEntry()) + { + case DOCTOR_ALLIANCE: patientEntry = AllianceSoldierId[urand(0, 2)]; break; + case DOCTOR_HORDE: patientEntry = HordeSoldierId[urand(0, 2)]; break; + default: + error_log("SD2: Invalid entry for Triage doctor. Please check your database"); + return; + } + + Point = *itr; + + Patient = m_creature->SummonCreature(patientEntry, Point->x, Point->y, Point->z, Point->o, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + + if (Patient) + { + //303, this flag appear to be required for client side item->spell to work (TARGET_SINGLE_FRIEND) + Patient->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE); + + Patients.push_back(Patient->GetGUID()); + + npc_injured_patientAI* pPatientAI = dynamic_cast(Patient->AI()); + + if (pPatientAI) + { + pPatientAI->Doctorguid = m_creature->GetGUID(); + + if (Point) + pPatientAI->Coord = Point; + } + + Coordinates.erase(itr); + } + SummonPatient_Timer = 10000; + ++SummonPatientCount; + }else SummonPatient_Timer -= diff; + } +} + +bool QuestAccept_npc_doctor(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if ((pQuest->GetQuestId() == QUEST_TRIAGE_A) || (pQuest->GetQuestId() == QUEST_TRIAGE_H)) + { + if (npc_doctorAI* pDocAI = dynamic_cast(pCreature->AI())) + pDocAI->BeginEvent(pPlayer); + } + + return true; +} + +CreatureAI* GetAI_npc_doctor(Creature* pCreature) +{ + return new npc_doctorAI(pCreature); +} + +/*###### +## npc_garments_of_quests +######*/ + +//TODO: get text for each NPC + +enum +{ + SPELL_LESSER_HEAL_R2 = 2052, + SPELL_FORTITUDE_R1 = 1243, + + QUEST_MOON = 5621, + QUEST_LIGHT_1 = 5624, + QUEST_LIGHT_2 = 5625, + QUEST_SPIRIT = 5648, + QUEST_DARKNESS = 5650, + + ENTRY_SHAYA = 12429, + ENTRY_ROBERTS = 12423, + ENTRY_DOLF = 12427, + ENTRY_KORJA = 12430, + ENTRY_DG_KEL = 12428, + + SAY_COMMON_HEALED = -1000231, + SAY_DG_KEL_THANKS = -1000232, + SAY_DG_KEL_GOODBYE = -1000233, + SAY_ROBERTS_THANKS = -1000256, + SAY_ROBERTS_GOODBYE = -1000257, + SAY_KORJA_THANKS = -1000258, + SAY_KORJA_GOODBYE = -1000259, + SAY_DOLF_THANKS = -1000260, + SAY_DOLF_GOODBYE = -1000261, + SAY_SHAYA_THANKS = -1000262, + SAY_SHAYA_GOODBYE = -1000263, +}; + +struct MANGOS_DLL_DECL npc_garments_of_questsAI : public npc_escortAI +{ + npc_garments_of_questsAI(Creature* pCreature) : npc_escortAI(pCreature) {Reset();} + + uint64 caster; + + bool bIsHealed; + bool bCanRun; + + uint32 RunAwayTimer; + + void Reset() + { + caster = 0; + + bIsHealed = false; + bCanRun = false; + + RunAwayTimer = 5000; + + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + //expect database to have RegenHealth=0 + m_creature->SetHealth(int(m_creature->GetMaxHealth()*0.7)); + } + + void SpellHit(Unit* pCaster, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_LESSER_HEAL_R2 || Spell->Id == SPELL_FORTITUDE_R1) + { + //not while in combat + if (m_creature->isInCombat()) + return; + + //nothing to be done now + if (bIsHealed && bCanRun) + return; + + if (pCaster->GetTypeId() == TYPEID_PLAYER) + { + switch(m_creature->GetEntry()) + { + case ENTRY_SHAYA: + if (((Player*)pCaster)->GetQuestStatus(QUEST_MOON) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_SHAYA_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_ROBERTS: + if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_1) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_ROBERTS_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_DOLF: + if (((Player*)pCaster)->GetQuestStatus(QUEST_LIGHT_2) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_DOLF_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_KORJA: + if (((Player*)pCaster)->GetQuestStatus(QUEST_SPIRIT) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_KORJA_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + case ENTRY_DG_KEL: + if (((Player*)pCaster)->GetQuestStatus(QUEST_DARKNESS) == QUEST_STATUS_INCOMPLETE) + { + if (bIsHealed && !bCanRun && Spell->Id == SPELL_FORTITUDE_R1) + { + DoScriptText(SAY_DG_KEL_THANKS,m_creature,pCaster); + bCanRun = true; + } + else if (!bIsHealed && Spell->Id == SPELL_LESSER_HEAL_R2) + { + caster = pCaster->GetGUID(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_COMMON_HEALED,m_creature,pCaster); + bIsHealed = true; + } + } + break; + } + + //give quest credit, not expect any special quest objectives + if (bCanRun) + ((Player*)pCaster)->TalkedToCreature(m_creature->GetEntry(),m_creature->GetGUID()); + } + } + } + + void WaypointReached(uint32 uiPoint) + { + } + + void UpdateEscortAI(const uint32 diff) + { + if (bCanRun && !m_creature->isInCombat()) + { + if (RunAwayTimer <= diff) + { + if (Player* pPlayer = m_creature->GetMap()->GetPlayer(caster)) + { + switch(m_creature->GetEntry()) + { + case ENTRY_SHAYA: DoScriptText(SAY_SHAYA_GOODBYE, m_creature, pPlayer); break; + case ENTRY_ROBERTS: DoScriptText(SAY_ROBERTS_GOODBYE, m_creature, pPlayer); break; + case ENTRY_DOLF: DoScriptText(SAY_DOLF_GOODBYE, m_creature, pPlayer); break; + case ENTRY_KORJA: DoScriptText(SAY_KORJA_GOODBYE, m_creature, pPlayer); break; + case ENTRY_DG_KEL: DoScriptText(SAY_DG_KEL_GOODBYE, m_creature, pPlayer); break; + } + + Start(true); + } + else + EnterEvadeMode(); //something went wrong + + RunAwayTimer = 30000; + }else RunAwayTimer -= diff; + } + + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_garments_of_quests(Creature* pCreature) +{ + return new npc_garments_of_questsAI(pCreature); +} + +/*###### +## npc_guardian +######*/ + +#define SPELL_DEATHTOUCH 5 + +struct MANGOS_DLL_DECL npc_guardianAI : public ScriptedAI +{ + npc_guardianAI(Creature* pCreature) : ScriptedAI(pCreature) {Reset();} + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->SelectHostileTarget() || !m_creature->getVictim()) + return; + + if (m_creature->isAttackReady()) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_DEATHTOUCH, true); + m_creature->resetAttackTimer(); + } + } +}; + +CreatureAI* GetAI_npc_guardian(Creature* pCreature) +{ + return new npc_guardianAI(pCreature); +} + +/*######## +# npc_innkeeper +#########*/ + +// Script applied to all innkeepers by npcflag. +// Are there any known innkeepers that does not hape the options in the below? +// (remember gossipHello is not called unless npcflag|1 is present) + +enum +{ + TEXT_ID_WHAT_TO_DO = 1853, + + SPELL_TRICK_OR_TREAT = 24751, // create item or random buff + SPELL_TRICK_OR_TREATED = 24755, // buff player get when tricked or treated + SPELL_TREAT = 24715, + SPELL_TRICK_NO_ATTACK = 24753, + SPELL_TRICK_GNOME = 24713, + SPELL_TRICK_GHOST_MALE = 24735, + SPELL_TRICK_GHOST_FEMALE = 24736, + SPELL_TRICK_NINJA_MALE = 24710, + SPELL_TRICK_NINJA_FEMALE = 24711, + SPELL_TRICK_PIRATE_MALE = 24708, + SPELL_TRICK_PIRATE_FEMALE = 24709, + SPELL_TRICK_SKELETON = 24723, + SPELL_TRICK_BAT = 24732 +}; + +#define GOSSIP_ITEM_TRICK_OR_TREAT "Trick or Treat!" +#define GOSSIP_ITEM_WHAT_TO_DO "What can I do at an Inn?" + +bool GossipHello_npc_innkeeper(Player* pPlayer, Creature* pCreature) +{ + pPlayer->PrepareGossipMenu(pCreature); + + if (IsHolidayActive(HOLIDAY_HALLOWS_END) && !pPlayer->HasAura(SPELL_TRICK_OR_TREATED, EFFECT_INDEX_0)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRICK_OR_TREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + // Should only apply to innkeeper close to start areas. + if (AreaTableEntry const* pAreaEntry = GetAreaEntryByAreaID(pCreature->GetAreaId())) + { + if (pAreaEntry->flags & AREA_FLAG_LOWLEVEL) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_WHAT_TO_DO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + } + + pPlayer->TalkedToCreature(pCreature->GetEntry(), pCreature->GetGUID()); + pPlayer->SendPreparedGossip(pCreature); + return true; +} + +bool GossipSelect_npc_innkeeper(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_WHAT_TO_DO, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + { + pPlayer->CLOSE_GOSSIP_MENU(); + + // either trick or treat, 50% chance + if (urand(0, 1)) + { + pPlayer->CastSpell(pPlayer, SPELL_TREAT, true); + } + else + { + uint32 uiTrickSpell = 0; + + switch(urand(0, 9)) // note that female characters can get male costumes and vice versa + { + case 0: uiTrickSpell = SPELL_TRICK_NO_ATTACK; break; + case 1: uiTrickSpell = SPELL_TRICK_GNOME; break; + case 2: uiTrickSpell = SPELL_TRICK_GHOST_MALE; break; + case 3: uiTrickSpell = SPELL_TRICK_GHOST_FEMALE; break; + case 4: uiTrickSpell = SPELL_TRICK_NINJA_MALE; break; + case 5: uiTrickSpell = SPELL_TRICK_NINJA_FEMALE; break; + case 6: uiTrickSpell = SPELL_TRICK_PIRATE_MALE; break; + case 7: uiTrickSpell = SPELL_TRICK_PIRATE_FEMALE; break; + case 8: uiTrickSpell = SPELL_TRICK_SKELETON; break; + case 9: uiTrickSpell = SPELL_TRICK_BAT; break; + } + + pPlayer->CastSpell(pPlayer, uiTrickSpell, true); + } + + pPlayer->CastSpell(pPlayer, SPELL_TRICK_OR_TREATED, true); + break; + } + + case GOSSIP_OPTION_VENDOR: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_OPTION_INNKEEPER: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->SetBindPoint(pCreature->GetGUID()); + break; + } + + return true; +} + +/*###### +## npc_kingdom_of_dalaran_quests +######*/ + +enum +{ + SPELL_TELEPORT_DALARAN = 53360, + ITEM_KT_SIGNET = 39740, + QUEST_MAGICAL_KINGDOM_A = 12794, + QUEST_MAGICAL_KINGDOM_H = 12791, + QUEST_MAGICAL_KINGDOM_N = 12796 +}; + +#define GOSSIP_ITEM_TELEPORT_TO "I am ready to be teleported to Dalaran." + +bool GossipHello_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasItemCount(ITEM_KT_SIGNET,1) && (!pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_A) || + !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_H) || !pPlayer->GetQuestRewardStatus(QUEST_MAGICAL_KINGDOM_N))) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TELEPORT_TO, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_kingdom_of_dalaran_quests(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,SPELL_TELEPORT_DALARAN,false); + } + return true; +} + +/*###### +## npc_lunaclaw_spirit +######*/ + +enum +{ + QUEST_BODY_HEART_A = 6001, + QUEST_BODY_HEART_H = 6002, + + TEXT_ID_DEFAULT = 4714, + TEXT_ID_PROGRESS = 4715 +}; + +#define GOSSIP_ITEM_GRANT "You have thought well, spirit. I ask you to grant me the strength of your body and the strength of your heart." + +bool GossipHello_npc_lunaclaw_spirit(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetQuestStatus(QUEST_BODY_HEART_A) == QUEST_STATUS_INCOMPLETE || pPlayer->GetQuestStatus(QUEST_BODY_HEART_H) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_GRANT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_DEFAULT, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_lunaclaw_spirit(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->SEND_GOSSIP_MENU(TEXT_ID_PROGRESS, pCreature->GetGUID()); + pPlayer->AreaExploredOrEventHappens((pPlayer->GetTeam() == ALLIANCE) ? QUEST_BODY_HEART_A : QUEST_BODY_HEART_H); + } + return true; +} + +/*###### +## npc_mount_vendor +######*/ + +bool GossipHello_npc_mount_vendor(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + bool canBuy; + canBuy = false; + uint32 vendor = pCreature->GetEntry(); + uint8 race = pPlayer->getRace(); + + switch (vendor) + { + case 384: //Katie Hunter + case 1460: //Unger Statforth + case 2357: //Merideth Carlson + case 4885: //Gregor MacVince + if (pPlayer->GetReputationRank(72) != REP_EXALTED && race != RACE_HUMAN) + pPlayer->SEND_GOSSIP_MENU(5855, pCreature->GetGUID()); + else canBuy = true; + break; + case 1261: //Veron Amberstill + if (pPlayer->GetReputationRank(47) != REP_EXALTED && race != RACE_DWARF) + pPlayer->SEND_GOSSIP_MENU(5856, pCreature->GetGUID()); + else canBuy = true; + break; + case 3362: //Ogunaro Wolfrunner + if (pPlayer->GetReputationRank(76) != REP_EXALTED && race != RACE_ORC) + pPlayer->SEND_GOSSIP_MENU(5841, pCreature->GetGUID()); + else canBuy = true; + break; + case 3685: //Harb Clawhoof + if (pPlayer->GetReputationRank(81) != REP_EXALTED && race != RACE_TAUREN) + pPlayer->SEND_GOSSIP_MENU(5843, pCreature->GetGUID()); + else canBuy = true; + break; + case 4730: //Lelanai + if (pPlayer->GetReputationRank(69) != REP_EXALTED && race != RACE_NIGHTELF) + pPlayer->SEND_GOSSIP_MENU(5844, pCreature->GetGUID()); + else canBuy = true; + break; + case 4731: //Zachariah Post + if (pPlayer->GetReputationRank(68) != REP_EXALTED && race != RACE_UNDEAD_PLAYER) + pPlayer->SEND_GOSSIP_MENU(5840, pCreature->GetGUID()); + else canBuy = true; + break; + case 7952: //Zjolnir + if (pPlayer->GetReputationRank(530) != REP_EXALTED && race != RACE_TROLL) + pPlayer->SEND_GOSSIP_MENU(5842, pCreature->GetGUID()); + else canBuy = true; + break; + case 7955: //Milli Featherwhistle + if (pPlayer->GetReputationRank(54) != REP_EXALTED && race != RACE_GNOME) + pPlayer->SEND_GOSSIP_MENU(5857, pCreature->GetGUID()); + else canBuy = true; + break; + case 16264: //Winaestra + if (pPlayer->GetReputationRank(911) != REP_EXALTED && race != RACE_BLOODELF) + pPlayer->SEND_GOSSIP_MENU(10305, pCreature->GetGUID()); + else canBuy = true; + break; + case 17584: //Torallius the Pack Handler + if (pPlayer->GetReputationRank(930) != REP_EXALTED && race != RACE_DRAENEI) + pPlayer->SEND_GOSSIP_MENU(10239, pCreature->GetGUID()); + else canBuy = true; + break; + } + + if (canBuy) + { + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_mount_vendor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +/*###### +## npc_rogue_trainer +######*/ + +bool GossipHello_npc_rogue_trainer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isTrainer()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN); + + if (pCreature->CanTrainAndResetTalentsOf(pPlayer)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "I wish to unlearn my talents", GOSSIP_SENDER_MAIN, GOSSIP_OPTION_UNLEARNTALENTS); + + if (pPlayer->getClass() == CLASS_ROGUE && pPlayer->getLevel() >= 24 && !pPlayer->HasItemCount(17126,1) && !pPlayer->GetQuestRewardStatus(6681)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(5996, pCreature->GetGUID()); + } else + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_rogue_trainer(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer,21100,false); + break; + case GOSSIP_ACTION_TRAIN: + pPlayer->SEND_TRAINERLIST(pCreature->GetGUID()); + break; + case GOSSIP_OPTION_UNLEARNTALENTS: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->SendTalentWipeConfirm(pCreature->GetGUID()); + break; + } + return true; +} + +/*###### +## npc_sayge +######*/ + +#define SPELL_DMG 23768 //dmg +#define SPELL_RES 23769 //res +#define SPELL_ARM 23767 //arm +#define SPELL_SPI 23738 //spi +#define SPELL_INT 23766 //int +#define SPELL_STM 23737 //stm +#define SPELL_STR 23735 //str +#define SPELL_AGI 23736 //agi +#define SPELL_FORTUNE 23765 //faire fortune + +bool GossipHello_npc_sayge(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasSpellCooldown(SPELL_INT) || + pPlayer->HasSpellCooldown(SPELL_ARM) || + pPlayer->HasSpellCooldown(SPELL_DMG) || + pPlayer->HasSpellCooldown(SPELL_RES) || + pPlayer->HasSpellCooldown(SPELL_STR) || + pPlayer->HasSpellCooldown(SPELL_AGI) || + pPlayer->HasSpellCooldown(SPELL_STM) || + pPlayer->HasSpellCooldown(SPELL_SPI)) + pPlayer->SEND_GOSSIP_MENU(7393, pCreature->GetGUID()); + else + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Yes", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(7339, pCreature->GetGUID()); + } + + return true; +} + +void SendAction_npc_sayge(Player* pPlayer, Creature* pCreature, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Slay the Man", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Turn him over to liege", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Confiscate the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let him go and have the corn", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + pPlayer->SEND_GOSSIP_MENU(7340, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Execute your friend painfully", GOSSIP_SENDER_MAIN+1, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Execute your friend painlessly", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let your friend go", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(7341, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Confront the diplomat", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Show not so quiet defiance", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Remain quiet", GOSSIP_SENDER_MAIN+2, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(7361, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Speak against your brother openly", GOSSIP_SENDER_MAIN+6, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Help your brother in", GOSSIP_SENDER_MAIN+7, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Keep your brother out without letting him know", GOSSIP_SENDER_MAIN+8, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(7362, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Take credit, keep gold", GOSSIP_SENDER_MAIN+5, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Take credit, share the gold", GOSSIP_SENDER_MAIN+4, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let the knight take credit", GOSSIP_SENDER_MAIN+3, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(7363, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Thanks", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->SEND_GOSSIP_MENU(7364, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pCreature->CastSpell(pPlayer, SPELL_FORTUNE, false); + pPlayer->SEND_GOSSIP_MENU(7365, pCreature->GetGUID()); + break; + } +} + +bool GossipSelect_npc_sayge(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiSender) + { + case GOSSIP_SENDER_MAIN: + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+1: + pCreature->CastSpell(pPlayer, SPELL_DMG, false); + pPlayer->AddSpellCooldown(SPELL_DMG,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+2: + pCreature->CastSpell(pPlayer, SPELL_RES, false); + pPlayer->AddSpellCooldown(SPELL_RES,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+3: + pCreature->CastSpell(pPlayer, SPELL_ARM, false); + pPlayer->AddSpellCooldown(SPELL_ARM,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+4: + pCreature->CastSpell(pPlayer, SPELL_SPI, false); + pPlayer->AddSpellCooldown(SPELL_SPI,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+5: + pCreature->CastSpell(pPlayer, SPELL_INT, false); + pPlayer->AddSpellCooldown(SPELL_INT,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+6: + pCreature->CastSpell(pPlayer, SPELL_STM, false); + pPlayer->AddSpellCooldown(SPELL_STM,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+7: + pCreature->CastSpell(pPlayer, SPELL_STR, false); + pPlayer->AddSpellCooldown(SPELL_STR,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + case GOSSIP_SENDER_MAIN+8: + pCreature->CastSpell(pPlayer, SPELL_AGI, false); + pPlayer->AddSpellCooldown(SPELL_AGI,0,time(NULL) + 7200); + SendAction_npc_sayge(pPlayer, pCreature, uiAction); + break; + } + return true; +} + +/*###### +## npc_tabard_vendor +######*/ + +enum +{ + QUEST_TRUE_MASTERS_OF_LIGHT = 9737, + QUEST_THE_UNWRITTEN_PROPHECY = 9762, + QUEST_INTO_THE_BREACH = 10259, + QUEST_BATTLE_OF_THE_CRIMSON_WATCH = 10781, + QUEST_SHARDS_OF_AHUNE = 11972, + + ACHIEVEMENT_EXPLORE_NORTHREND = 45, + ACHIEVEMENT_TWENTYFIVE_TABARDS = 1021, + ACHIEVEMENT_THE_LOREMASTER_A = 1681, + ACHIEVEMENT_THE_LOREMASTER_H = 1682, + + ITEM_TABARD_OF_THE_HAND = 24344, + ITEM_TABARD_OF_THE_BLOOD_KNIGHT = 25549, + ITEM_TABARD_OF_THE_PROTECTOR = 28788, + ITEM_OFFERING_OF_THE_SHATAR = 31408, + ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 31404, + ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 31405, + ITEM_TABARD_OF_THE_SUMMER_SKIES = 35279, + ITEM_TABARD_OF_THE_SUMMER_FLAMES = 35280, + ITEM_TABARD_OF_THE_ACHIEVER = 40643, + ITEM_LOREMASTERS_COLORS = 43300, + ITEM_TABARD_OF_THE_EXPLORER = 43348, + + SPELL_TABARD_OF_THE_BLOOD_KNIGHT = 54974, + SPELL_TABARD_OF_THE_HAND = 54976, + SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI = 54977, + SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI = 54982, + SPELL_TABARD_OF_THE_ACHIEVER = 55006, + SPELL_TABARD_OF_THE_PROTECTOR = 55008, + SPELL_LOREMASTERS_COLORS = 58194, + SPELL_TABARD_OF_THE_EXPLORER = 58224, + SPELL_TABARD_OF_SUMMER_SKIES = 62768, + SPELL_TABARD_OF_SUMMER_FLAMES = 62769 +}; + +#define GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT "I've lost my Tabard of Blood Knight." +#define GOSSIP_LOST_TABARD_OF_THE_HAND "I've lost my Tabard of the Hand." +#define GOSSIP_LOST_TABARD_OF_THE_PROTECTOR "I've lost my Tabard of the Protector." +#define GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Green Trophy Tabard of the Illidari." +#define GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI "I've lost my Purple Trophy Tabard of the Illidari." +#define GOSSIP_LOST_TABARD_OF_SUMMER_SKIES "I've lost my Tabard of Summer Skies." +#define GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES "I've lost my Tabard of Summer Flames." +#define GOSSIP_LOST_LOREMASTERS_COLORS "I've lost my Loremaster's Colors." +#define GOSSIP_LOST_TABARD_OF_THE_EXPLORER "I've lost my Tabard of the Explorer." +#define GOSSIP_LOST_TABARD_OF_THE_ACHIEVER "I've lost my Tabard of the Achiever." + +bool GossipHello_npc_tabard_vendor(Player* pPlayer, Creature* pCreature) +{ + bool m_bLostBloodKnight = false; + bool m_bLostHand = false; + bool m_bLostProtector = false; + bool m_bLostIllidari = false; + bool m_bLostSummer = false; + + //Tabard of the Blood Knight + if (pPlayer->GetQuestRewardStatus(QUEST_TRUE_MASTERS_OF_LIGHT) && !pPlayer->HasItemCount(ITEM_TABARD_OF_THE_BLOOD_KNIGHT, 1, true)) + m_bLostBloodKnight = true; + + //Tabard of the Hand + if (pPlayer->GetQuestRewardStatus(QUEST_THE_UNWRITTEN_PROPHECY) && !pPlayer->HasItemCount(ITEM_TABARD_OF_THE_HAND, 1, true)) + m_bLostHand = true; + + //Tabard of the Protector + if (pPlayer->GetQuestRewardStatus(QUEST_INTO_THE_BREACH) && !pPlayer->HasItemCount(ITEM_TABARD_OF_THE_PROTECTOR, 1, true)) + m_bLostProtector = true; + + //Green Trophy Tabard of the Illidari + //Purple Trophy Tabard of the Illidari + if (pPlayer->GetQuestRewardStatus(QUEST_BATTLE_OF_THE_CRIMSON_WATCH) && + (!pPlayer->HasItemCount(ITEM_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) && + !pPlayer->HasItemCount(ITEM_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, 1, true) && + !pPlayer->HasItemCount(ITEM_OFFERING_OF_THE_SHATAR, 1, true))) + m_bLostIllidari = true; + + //Tabard of Summer Skies + //Tabard of Summer Flames + if (pPlayer->GetQuestRewardStatus(QUEST_SHARDS_OF_AHUNE) && + !pPlayer->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_SKIES, 1, true) && + !pPlayer->HasItemCount(ITEM_TABARD_OF_THE_SUMMER_FLAMES, 1, true)) + m_bLostSummer = true; + + if (m_bLostBloodKnight || m_bLostHand || m_bLostProtector || m_bLostIllidari || m_bLostSummer) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (m_bLostBloodKnight) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_BLOOD_KNIGHT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +1); + + if (m_bLostHand) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_HAND, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +2); + + if (m_bLostProtector) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_THE_PROTECTOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + + if (m_bLostIllidari) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5); + } + + if (m_bLostSummer) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_SKIES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_TABARD_OF_SUMMER_FLAMES, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+7); + } + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + } + else + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_tabard_vendor(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TABARD_OF_THE_BLOOD_KNIGHT, false); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TABARD_OF_THE_HAND, false); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TABARD_OF_THE_PROTECTOR, false); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_GREEN_TROPHY_TABARD_OF_THE_ILLIDARI, false); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_PURPLE_TROPHY_TABARD_OF_THE_ILLIDARI, false); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TABARD_OF_SUMMER_SKIES, false); + break; + case GOSSIP_ACTION_INFO_DEF+7: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_TABARD_OF_SUMMER_FLAMES, false); + break; + } + return true; +} + +/*###### +## npc_locksmith +######*/ + +enum +{ + QUEST_HOW_TO_BRAKE_IN_TO_THE_ARCATRAZ = 10704, + QUEST_DARK_IRON_LEGACY = 3802, + QUEST_THE_KEY_TO_SCHOLOMANCE_A = 5505, + QUEST_THE_KEY_TO_SCHOLOMANCE_H = 5511, + QUEST_HOTTER_THAN_HELL_A = 10758, + QUEST_HOTTER_THAN_HELL_H = 10764, + QUEST_RETURN_TO_KHAGDAR = 9837, + QUEST_CONTAINMENT = 13159, + + ITEM_ARCATRAZ_KEY = 31084, + ITEM_SHADOWFORGE_KEY = 11000, + ITEM_SKELETON_KEY = 13704, + ITEM_SHATTERED_HALLS_KEY = 28395, + ITEM_THE_MASTERS_KEY = 24490, + ITEM_VIOLET_HOLD_KEY = 42482, + + SPELL_ARCATRAZ_KEY = 54881, + SPELL_SHADOWFORGE_KEY = 54882, + SPELL_SKELETON_KEY = 54883, + SPELL_SHATTERED_HALLS_KEY = 54884, + SPELL_THE_MASTERS_KEY = 54885, + SPELL_VIOLET_HOLD_KEY = 67253 +}; + +#define GOSSIP_LOST_ARCATRAZ_KEY "I've lost my key to the Arcatraz." +#define GOSSIP_LOST_SHADOWFORGE_KEY "I've lost my key to the Blackrock Depths." +#define GOSSIP_LOST_SKELETON_KEY "I've lost my key to the Scholomance." +#define GOSSIP_LOST_SHATTERED_HALLS_KEY "I've lost my key to the Shattered Halls." +#define GOSSIP_LOST_THE_MASTERS_KEY "I've lost my key to the Karazhan." +#define GOSSIP_LOST_VIOLET_HOLD_KEY "I've lost my key to the Violet Hold." + + +bool GossipHello_npc_locksmith(Player* pPlayer, Creature* pCreature) +{ + + // Arcatraz Key + if (pPlayer->GetQuestRewardStatus(QUEST_HOW_TO_BRAKE_IN_TO_THE_ARCATRAZ) && !pPlayer->HasItemCount(ITEM_ARCATRAZ_KEY, 1, true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_ARCATRAZ_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +1); + + // Shadowforge Key + if (pPlayer->GetQuestRewardStatus(QUEST_DARK_IRON_LEGACY) && !pPlayer->HasItemCount(ITEM_SHADOWFORGE_KEY, 1, true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_SHADOWFORGE_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +2); + + // Skeleton Key + if ((pPlayer->GetQuestRewardStatus(QUEST_THE_KEY_TO_SCHOLOMANCE_A) || pPlayer->GetQuestRewardStatus(QUEST_THE_KEY_TO_SCHOLOMANCE_H)) && + !pPlayer->HasItemCount(ITEM_SKELETON_KEY, 1, true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_SKELETON_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +3); + + // Shatered Halls Key + if ((pPlayer->GetQuestRewardStatus(QUEST_HOTTER_THAN_HELL_A) || pPlayer->GetQuestRewardStatus(QUEST_HOTTER_THAN_HELL_H)) && + !pPlayer->HasItemCount(ITEM_SHATTERED_HALLS_KEY, 1, true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_SHATTERED_HALLS_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +4); + + // Master's Key + if (pPlayer->GetQuestRewardStatus(QUEST_RETURN_TO_KHAGDAR) && !pPlayer->HasItemCount(ITEM_THE_MASTERS_KEY, 1, true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_THE_MASTERS_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +5); + + // Violet Hold Key + if (pPlayer->GetQuestRewardStatus(QUEST_CONTAINMENT) && !pPlayer->HasItemCount(ITEM_VIOLET_HOLD_KEY, 1, true)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_LOST_VIOLET_HOLD_KEY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF +6); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_locksmith(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_ARCATRAZ_KEY, false); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_SHADOWFORGE_KEY, false); + break; + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_SKELETON_KEY, false); + break; + case GOSSIP_ACTION_INFO_DEF+4: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_SHATTERED_HALLS_KEY, false); + break; + case GOSSIP_ACTION_INFO_DEF+5: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_THE_MASTERS_KEY, false); + break; + case GOSSIP_ACTION_INFO_DEF+6: + pPlayer->CLOSE_GOSSIP_MENU(); + pPlayer->CastSpell(pPlayer, SPELL_VIOLET_HOLD_KEY, false); + break; + } + return true; +} + +void AddSC_npcs_special() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_air_force_bots"; + newscript->GetAI = &GetAI_npc_air_force_bots; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_chicken_cluck"; + newscript->GetAI = &GetAI_npc_chicken_cluck; + newscript->pQuestAccept = &QuestAccept_npc_chicken_cluck; + newscript->pQuestComplete = &QuestComplete_npc_chicken_cluck; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dancing_flames"; + newscript->GetAI = &GetAI_npc_dancing_flames; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_injured_patient"; + newscript->GetAI = &GetAI_npc_injured_patient; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_doctor"; + newscript->GetAI = &GetAI_npc_doctor; + newscript->pQuestAccept = &QuestAccept_npc_doctor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_garments_of_quests"; + newscript->GetAI = &GetAI_npc_garments_of_quests; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_guardian"; + newscript->GetAI = &GetAI_npc_guardian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_innkeeper"; + newscript->pGossipHello = &GossipHello_npc_innkeeper; + newscript->pGossipSelect = &GossipSelect_npc_innkeeper; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_kingdom_of_dalaran_quests"; + newscript->pGossipHello = &GossipHello_npc_kingdom_of_dalaran_quests; + newscript->pGossipSelect = &GossipSelect_npc_kingdom_of_dalaran_quests; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_lunaclaw_spirit"; + newscript->pGossipHello = &GossipHello_npc_lunaclaw_spirit; + newscript->pGossipSelect = &GossipSelect_npc_lunaclaw_spirit; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mount_vendor"; + newscript->pGossipHello = &GossipHello_npc_mount_vendor; + newscript->pGossipSelect = &GossipSelect_npc_mount_vendor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_rogue_trainer"; + newscript->pGossipHello = &GossipHello_npc_rogue_trainer; + newscript->pGossipSelect = &GossipSelect_npc_rogue_trainer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_sayge"; + newscript->pGossipHello = &GossipHello_npc_sayge; + newscript->pGossipSelect = &GossipSelect_npc_sayge; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tabard_vendor"; + newscript->pGossipHello = &GossipHello_npc_tabard_vendor; + newscript->pGossipSelect = &GossipSelect_npc_tabard_vendor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_locksmith"; + newscript->pGossipHello = &GossipHello_npc_locksmith; + newscript->pGossipSelect = &GossipSelect_npc_locksmith; + newscript->RegisterSelf(); +} diff --git a/scripts/world/spell_scripts.cpp b/scripts/world/spell_scripts.cpp new file mode 100644 index 0000000..b27c42b --- /dev/null +++ b/scripts/world/spell_scripts.cpp @@ -0,0 +1,693 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 + * 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, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Spell_Scripts +SD%Complete: 100 +SDComment: Spell scripts for dummy effects (if script need access/interaction with parts of other AI or instance, add it in related source files) +SDCategory: Spell +EndScriptData */ + +/* ContentData +spell 34665 +spell 19512 +spell 8913 +spell 21014 +spell 29528 +spell 29866 +spell 46770 +spell 46023 +spell 47575 +spell 50706 +spell 45109 +spell 45111 +EndContentData */ + +#include "precompiled.h" + +/* When you make a spell effect: +- always check spell id and effect index +- always return true when the spell is handled by script +*/ + +enum +{ + // quest 9452 + SPELL_CAST_FISHING_NET = 29866, + GO_RED_SNAPPER = 181616, + NPC_ANGRY_MURLOC = 17102, + ITEM_RED_SNAPPER = 23614, + //SPELL_SUMMON_TEST = 49214 // ! Just wrong spell name? It summon correct creature (17102)but does not appear to be used. + + // quest 11472 + SPELL_ANUNIAQS_NET = 21014, + GO_TASTY_REEF_FISH = 186949, + NPC_REEF_SHARK = 24637, + ITEM_TASTY_REEF_FISH = 34127, +}; + +bool EffectDummyGameObj_spell_dummy_go(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, GameObject* pGOTarget) +{ + switch(uiSpellId) + { + case SPELL_ANUNIAQS_NET: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pGOTarget->GetRespawnTime() != 0 || pGOTarget->GetEntry() != GO_TASTY_REEF_FISH || pCaster->GetTypeId() != TYPEID_PLAYER) + return true; + + if (urand(0, 3)) + { + if (Item* pItem = ((Player*)pCaster)->StoreNewItemInInventorySlot(ITEM_TASTY_REEF_FISH, 1)) + ((Player*)pCaster)->SendNewItem(pItem, 1, true, false); + } + else + { + if (Creature* pShark = pCaster->SummonCreature(NPC_REEF_SHARK, pGOTarget->GetPositionX(), pGOTarget->GetPositionY(), pGOTarget->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + pShark->AI()->AttackStart(pCaster); + } + + pGOTarget->SetLootState(GO_JUST_DEACTIVATED); + return true; + } + return true; + } + case SPELL_CAST_FISHING_NET: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pGOTarget->GetRespawnTime() != 0 || pGOTarget->GetEntry() != GO_RED_SNAPPER || pCaster->GetTypeId() != TYPEID_PLAYER) + return true; + + if (urand(0, 2)) + { + if (Creature* pMurloc = pCaster->SummonCreature(NPC_ANGRY_MURLOC, pCaster->GetPositionX(), pCaster->GetPositionY()+20.0f, pCaster->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000)) + pMurloc->AI()->AttackStart(pCaster); + } + else + { + if (Item* pItem = ((Player*)pCaster)->StoreNewItemInInventorySlot(ITEM_RED_SNAPPER, 1)) + ((Player*)pCaster)->SendNewItem(pItem, 1, true, false); + } + + pGOTarget->SetLootState(GO_JUST_DEACTIVATED); + return true; + } + return true; + } + } + + return false; +} + +enum +{ + // quest 9629 + SPELL_TAG_MURLOC = 30877, + SPELL_TAG_MURLOC_PROC = 30875, + NPC_BLACKSILT_MURLOC = 17326, + NPC_TAGGED_MURLOC = 17654, + + // quest 9447 + SPELL_HEALING_SALVE = 29314, + SPELL_HEALING_SALVE_DUMMY = 29319, + NPC_MAGHAR_GRUNT = 16846, + + // quest 10190 + SPELL_RECHARGING_BATTERY = 34219, + NPC_DRAINED_PHASE_HUNTER = 19595, + + // target hulking helboar + SPELL_ADMINISTER_ANTIDOTE = 34665, + NPC_HELBOAR = 16880, + NPC_DREADTUSK = 16992, + + // quest 6124/6129 + SPELL_APPLY_SALVE = 19512, + + NPC_SICKLY_DEER = 12298, + NPC_SICKLY_GAZELLE = 12296, + + NPC_CURED_DEER = 12299, + NPC_CURED_GAZELLE = 12297, + + // quest 12906/13422 + SPELL_DISCIPLINING_ROD = 56033, + SAY_RAND_WORK1 = -1000555, + SAY_RAND_WORK2 = -1000556, + SAY_RAND_WORK3 = -1000557, + SAY_RAND_ATTACK1 = -1000558, + SAY_RAND_ATTACK2 = -1000559, + SAY_RAND_ATTACK3 = -1000560, + + // target morbent fel + SPELL_SACRED_CLEANSING = 8913, + NPC_MORBENT = 1200, + NPC_WEAKENED_MORBENT = 24782, + + // quest 11515 + SPELL_FEL_SIPHON_DUMMY = 44936, + NPC_FELBLOOD_INITIATE = 24918, + NPC_EMACIATED_FELBLOOD = 24955, + + // target nestlewood owlkin + SPELL_INOCULATE_OWLKIN = 29528, + NPC_OWLKIN = 16518, + NPC_OWLKIN_INOC = 16534, + + // target for quest 12166) + SPELL_LIQUID_FIRE = 46770, + SPELL_LIQUID_FIRE_AURA = 47972, + + NPC_ELK = 26616, + NPC_GRIZZLY = 26643, + + NPC_ELK_BUNNY = 27111, + NPC_GRIZZLY_BUNNY = 27112, + + // for quest 12516 + SPELL_MODIFIED_MOJO = 50706, + + NPC_PROPHET_OF_SSERATUS = 28068, + NPC_WEAK_PROPHET_OF_SSERATUS = 28151, + + // for quest 12459 + SPELL_SEEDS_OF_NATURES_WRATH = 49587, + + NPC_REANIMATED_FROSTWYRM = 26841, + NPC_TURGID = 27808, + NPC_DEATHGAZE = 27122, + + NPC_WEAK_REANIMATED_FROSTWYRM = 27821, + NPC_WEAK_TURGID = 27809, + NPC_WEAK_DEATHGAZE = 27807, + + // quest 11982 + SPELL_THROW_BOULDER = 47005, + SPELL_BOULBER_IMPACT = 47007, + SPELL_BOULDER_TOSS_CREDIT = 47009, + + NPC_IRON_RUNESHAPER = 26270, + NPC_RUNE_REAVER = 26268, + + // for quest 11730 + SPELL_ULTRASONIC_SCREWDRIVER = 46023, + SPELL_REPROGRAM_KILL_CREDIT = 46027, + + NPC_COLLECT_A_TRON = 25793, + SPELL_SUMMON_COLLECT_A_TRON = 46034, + + NPC_DEFENDO_TANK = 25758, + SPELL_SUMMON_DEFENDO_TANK = 46058, + + NPC_SCAVENGE_A8 = 25752, + SPELL_SUMMON_SCAVENGE_A8 = 46063, + + NPC_SCAVENGE_B6 = 25792, + SPELL_SUMMON_SCAVENGE_B6 = 46066, + + NPC_SENTRY_BOT = 25753, + SPELL_SUMMON_SENTRY_BOT = 46068, + + // target woodlands walker + SPELL_STRENGTH_ANCIENTS = 47575, + SPELL_CREATE_BARK_WALKERS = 47550, + FACTION_HOSTILE = 16, + + EMOTE_AGGRO = -1000551, + EMOTE_CREATE = -1000552, + + SAY_SPECIMEN = -1000581, + NPC_NEXUS_DRAKE_HATCHLING = 26127, + SPELL_RAELORASZ_FIREBALL = 46704, + + // Quest "Disrupt the Greengill Coast" (11541) + SPELL_ORB_OF_MURLOC_CONTROL = 45109, + SPELL_GREENGILL_SLAVE_FREED = 45110, + SPELL_ENRAGE = 45111, + NPC_FREED_GREENGILL_SLAVE = 25085, + NPC_DARKSPINE_MYRMIDON = 25060, + NPC_DARKSPINE_SIREN = 25073, + + // quest 14107 + SPELL_BLESSING_OF_PEACE = 66719, + NPC_FALLEN_HERO_SPIRIT = 32149, + NPC_FALLEN_HERO_SPIRIT_PROXY = 35055, + SAY_BLESS_1 = -1000594, + SAY_BLESS_2 = -1000595, + SAY_BLESS_3 = -1000596, + SAY_BLESS_4 = -1000597, + SAY_BLESS_5 = -1000598, +}; + +bool EffectAuraDummy_spell_aura_dummy_npc(const Aura* pAura, bool bApply) +{ + switch(pAura->GetId()) + { + case SPELL_BLESSING_OF_PEACE: + { + Creature* pCreature = (Creature*)pAura->GetTarget(); + + if (!pCreature || pCreature->GetEntry() != NPC_FALLEN_HERO_SPIRIT) + return true; + + if (pAura->GetEffIndex() != EFFECT_INDEX_0) + return true; + + if (bApply) + { + switch(urand(0, 4)) + { + case 0: DoScriptText(SAY_BLESS_1, pCreature); break; + case 1: DoScriptText(SAY_BLESS_2, pCreature); break; + case 2: DoScriptText(SAY_BLESS_3, pCreature); break; + case 3: DoScriptText(SAY_BLESS_4, pCreature); break; + case 4: DoScriptText(SAY_BLESS_5, pCreature); break; + } + } + else + { + if (Player* pPlayer = (Player*)pAura->GetCaster()) + { + pPlayer->KilledMonsterCredit(NPC_FALLEN_HERO_SPIRIT_PROXY, pCreature->GetGUID()); + pCreature->ForcedDespawn(); + } + } + + return true; + } + case SPELL_HEALING_SALVE: + { + if (pAura->GetEffIndex() != EFFECT_INDEX_0) + return true; + + if (bApply) + { + if (Unit* pCaster = pAura->GetCaster()) + pCaster->CastSpell(pAura->GetTarget(), SPELL_HEALING_SALVE_DUMMY, true); + } + + return true; + } + case SPELL_HEALING_SALVE_DUMMY: + { + if (pAura->GetEffIndex() != EFFECT_INDEX_0) + return true; + + if (!bApply) + { + Creature* pCreature = (Creature*)pAura->GetTarget(); + + pCreature->UpdateEntry(NPC_MAGHAR_GRUNT); + + if (pCreature->getStandState() == UNIT_STAND_STATE_KNEEL) + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + pCreature->ForcedDespawn(60*IN_MILLISECONDS); + } + + return true; + } + case SPELL_RECHARGING_BATTERY: + { + if (pAura->GetEffIndex() != EFFECT_INDEX_0) + return true; + + if (!bApply) + { + if (pAura->GetTarget()->HasAuraState(AURA_STATE_HEALTHLESS_20_PERCENT)) + ((Creature*)pAura->GetTarget())->UpdateEntry(NPC_DRAINED_PHASE_HUNTER); + } + + return true; + } + case SPELL_TAG_MURLOC: + { + Creature* pCreature = (Creature*)pAura->GetTarget(); + + if (pAura->GetEffIndex() != EFFECT_INDEX_0) + return true; + + if (bApply) + { + if (pCreature->GetEntry() == NPC_BLACKSILT_MURLOC) + { + if (Unit* pCaster = pAura->GetCaster()) + pCaster->CastSpell(pCreature, SPELL_TAG_MURLOC_PROC, true); + } + } + else + { + if (pCreature->GetEntry() == NPC_TAGGED_MURLOC) + pCreature->ForcedDespawn(); + } + + return true; + } + case SPELL_RAELORASZ_FIREBALL: + { + if (pAura->GetEffIndex() != EFFECT_INDEX_0) + return true; + + if (Unit* pCaster = pAura->GetCaster()) + DoScriptText(SAY_SPECIMEN, pCaster); + + Unit* pTarget = pAura->GetTarget(); + if (pTarget->GetTypeId() == TYPEID_UNIT) + { + Creature* pCreature = (Creature*)pTarget; + + if (pCreature->GetEntry() == NPC_NEXUS_DRAKE_HATCHLING) + { + pCreature->SetStandState(UNIT_STAND_STATE_SLEEP); + pCreature->ForcedDespawn(3000); + } + } + return true; + } + case SPELL_ENRAGE: + { + if (pAura->GetTarget()->GetTypeId() != TYPEID_UNIT || !bApply) + return false; + + if (Creature* pCreature = GetClosestCreatureWithEntry(pAura->GetTarget(), NPC_DARKSPINE_MYRMIDON, 25.0f)) + { + dynamic_cast(pAura->GetTarget())->AI()->AttackStart(pCreature); + return true; + } + + if (Creature* pCreature = GetClosestCreatureWithEntry(pAura->GetTarget(), NPC_DARKSPINE_SIREN, 25.0f)) + { + dynamic_cast(pAura->GetTarget())->AI()->AttackStart(pCreature); + return true; + } + + return false; + } + } + + return false; +} + +bool EffectDummyCreature_spell_dummy_npc(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget) +{ + switch(uiSpellId) + { + case SPELL_ADMINISTER_ANTIDOTE: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->GetEntry() != NPC_HELBOAR) + return true; + + // possible needs check for quest state, to not have any effect when quest really complete + + pCreatureTarget->UpdateEntry(NPC_DREADTUSK); + return true; + } + return true; + } + case SPELL_APPLY_SALVE: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCaster->GetTypeId() != TYPEID_PLAYER) + return true; + + if (pCreatureTarget->GetEntry() == NPC_SICKLY_DEER && ((Player*)pCaster)->GetTeam() == ALLIANCE) + pCreatureTarget->UpdateEntry(NPC_CURED_DEER); + + if (pCreatureTarget->GetEntry() == NPC_SICKLY_GAZELLE && ((Player*)pCaster)->GetTeam() == HORDE) + pCreatureTarget->UpdateEntry(NPC_CURED_GAZELLE); + + return true; + } + return true; + } + case SPELL_DISCIPLINING_ROD: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->getStandState() == UNIT_STAND_STATE_STAND) + return true; + + switch(urand(1,2)) + { + case 1: + { + switch(urand(1,3)) + { + case 1: DoScriptText(SAY_RAND_ATTACK1, pCreatureTarget); break; + case 2: DoScriptText(SAY_RAND_ATTACK2, pCreatureTarget); break; + case 3: DoScriptText(SAY_RAND_ATTACK3, pCreatureTarget); break; + } + + pCreatureTarget->SetStandState(UNIT_STAND_STATE_STAND); + pCreatureTarget->AI()->AttackStart(pCaster); + break; + } + case 2: + { + switch(urand(1,3)) + { + case 1: DoScriptText(SAY_RAND_WORK1, pCreatureTarget); break; + case 2: DoScriptText(SAY_RAND_WORK2, pCreatureTarget); break; + case 3: DoScriptText(SAY_RAND_WORK3, pCreatureTarget); break; + } + + pCreatureTarget->SetStandState(UNIT_STAND_STATE_STAND); + pCreatureTarget->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK); + break; + } + } + + return true; + } + return true; + } + case SPELL_INOCULATE_OWLKIN: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->GetEntry() != NPC_OWLKIN) + return true; + + pCreatureTarget->UpdateEntry(NPC_OWLKIN_INOC); + + //set despawn timer, since we want to remove creature after a short time + pCreatureTarget->ForcedDespawn(15000); + + return true; + } + return true; + } + case SPELL_LIQUID_FIRE: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCaster->GetTypeId() == TYPEID_PLAYER) + { + if (pCreatureTarget->HasAura(SPELL_LIQUID_FIRE_AURA)) + return true; + + if (pCreatureTarget->GetEntry() == NPC_ELK) + { + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_LIQUID_FIRE_AURA, true); + ((Player*)pCaster)->KilledMonsterCredit(NPC_ELK_BUNNY); + } + else if (pCreatureTarget->GetEntry() == NPC_GRIZZLY) + { + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_LIQUID_FIRE_AURA, true); + ((Player*)pCaster)->KilledMonsterCredit(NPC_GRIZZLY_BUNNY); + } + } + return true; + } + return true; + } + case SPELL_MODIFIED_MOJO: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->GetEntry() != NPC_PROPHET_OF_SSERATUS) + return true; + + // Apparently done before updateEntry, so need to make a way to handle that + // "Mmm, more mojo" + // "%s drinks the Mojo" + // "NOOOOOOOOOOOOooooooo...............!" + + pCreatureTarget->UpdateEntry(NPC_WEAK_PROPHET_OF_SSERATUS); + return true; + } + return true; + } + case SPELL_FEL_SIPHON_DUMMY: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->GetEntry() != NPC_FELBLOOD_INITIATE) + return true; + + pCreatureTarget->UpdateEntry(NPC_EMACIATED_FELBLOOD); + return true; + } + return true; + } + case SPELL_SACRED_CLEANSING: + { + if (uiEffIndex == EFFECT_INDEX_1) + { + if (pCreatureTarget->GetEntry() != NPC_MORBENT) + return true; + + pCreatureTarget->UpdateEntry(NPC_WEAKENED_MORBENT); + return true; + } + return true; + } + case SPELL_SEEDS_OF_NATURES_WRATH: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + uint32 uiNewEntry = 0; + + switch(pCreatureTarget->GetEntry()) + { + case NPC_REANIMATED_FROSTWYRM: uiNewEntry = NPC_WEAK_REANIMATED_FROSTWYRM; break; + case NPC_TURGID: uiNewEntry = NPC_WEAK_TURGID; break; + case NPC_DEATHGAZE: uiNewEntry = NPC_WEAK_DEATHGAZE; break; + } + + if (uiNewEntry) + pCreatureTarget->UpdateEntry(uiNewEntry); + + return true; + } + return true; + } + case SPELL_STRENGTH_ANCIENTS: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCaster->GetTypeId() == TYPEID_PLAYER) + { + if (urand(0, 1)) + { + DoScriptText(EMOTE_AGGRO, pCreatureTarget); + pCreatureTarget->setFaction(FACTION_HOSTILE); + pCreatureTarget->AI()->AttackStart(pCaster); + } + else + { + DoScriptText(EMOTE_CREATE, pCreatureTarget); + pCaster->CastSpell(pCaster, SPELL_CREATE_BARK_WALKERS, true); + pCreatureTarget->ForcedDespawn(5000); + } + } + return true; + } + return true; + } + case SPELL_TAG_MURLOC_PROC: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->GetEntry() == NPC_BLACKSILT_MURLOC) + pCreatureTarget->UpdateEntry(NPC_TAGGED_MURLOC); + } + return true; + } + case SPELL_THROW_BOULDER: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCaster->GetTypeId() != TYPEID_PLAYER) + return true; + + if (pCreatureTarget->GetEntry() != NPC_IRON_RUNESHAPER && pCreatureTarget->GetEntry() != NPC_RUNE_REAVER) + return true; + + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_BOULBER_IMPACT, true); + pCaster->CastSpell(pCaster, SPELL_BOULDER_TOSS_CREDIT, true); + + return true; + } + return true; + } + case SPELL_ULTRASONIC_SCREWDRIVER: + { + if (uiEffIndex == EFFECT_INDEX_0) + { + if (pCreatureTarget->isDead()) + { + uint32 newSpellId = 0; + + switch(pCreatureTarget->GetEntry()) + { + case NPC_COLLECT_A_TRON: newSpellId = SPELL_SUMMON_COLLECT_A_TRON; break; + case NPC_DEFENDO_TANK: newSpellId = SPELL_SUMMON_DEFENDO_TANK; break; + case NPC_SCAVENGE_A8: newSpellId = SPELL_SUMMON_SCAVENGE_A8; break; + case NPC_SCAVENGE_B6: newSpellId = SPELL_SUMMON_SCAVENGE_B6; break; + case NPC_SENTRY_BOT: newSpellId = SPELL_SUMMON_SENTRY_BOT; break; + } + + if (const SpellEntry* pSpell = GetSpellStore()->LookupEntry(newSpellId)) + { + pCaster->CastSpell(pCreatureTarget, pSpell->Id, true); + + if (Pet* pPet = pCaster->FindGuardianWithEntry(pSpell->EffectMiscValue[uiEffIndex])) + pPet->CastSpell(pCaster, SPELL_REPROGRAM_KILL_CREDIT, true); + + pCreatureTarget->ForcedDespawn(); + } + } + return true; + } + return true; + } + case SPELL_ORB_OF_MURLOC_CONTROL: + { + pCreatureTarget->CastSpell(pCaster, SPELL_GREENGILL_SLAVE_FREED, true); + + if (pCreatureTarget->GetTypeId() == TYPEID_UNIT) + dynamic_cast(pCreatureTarget)->UpdateEntry(NPC_FREED_GREENGILL_SLAVE); // Freed Greengill Slave + + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_ENRAGE, true); + + return true; + } + } + + return false; +} + +void AddSC_spell_scripts() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "spell_dummy_go"; + newscript->pEffectDummyGameObj = &EffectDummyGameObj_spell_dummy_go; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "spell_dummy_npc"; + newscript->pEffectDummyCreature = &EffectDummyCreature_spell_dummy_npc; + newscript->pEffectAuraDummy = &EffectAuraDummy_spell_aura_dummy_npc; + newscript->RegisterSelf(); +} diff --git a/sql/Makefile.am b/sql/Makefile.am new file mode 100644 index 0000000..1f7301b --- /dev/null +++ b/sql/Makefile.am @@ -0,0 +1,32 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse +SUBDIRS = Updates + +## Change installation location +# datadir = scriptdev2/sql +pkgdatadir = $(datadir)/scriptdev2/sql + +## Files to be installed +# Install basic SQL files to datadir +pkgdata_DATA = \ + mangos_scriptname_full.sql \ + scriptdev2_create_database.sql \ + scriptdev2_create_structure_mysql.sql \ + scriptdev2_create_structure_pgsql.sql \ + scriptdev2_script_full.sql diff --git a/sql/Updates/0.0.1/09_BraveWindfeather.sql b/sql/Updates/0.0.1/09_BraveWindfeather.sql new file mode 100644 index 0000000..ae78c70 --- /dev/null +++ b/sql/Updates/0.0.1/09_BraveWindfeather.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET`ScriptName` = '' WHERE `entry` = 3209; \ No newline at end of file diff --git a/sql/Updates/0.0.1/11_SilvaFilnaveth.sql b/sql/Updates/0.0.1/11_SilvaFilnaveth.sql new file mode 100644 index 0000000..9900466 --- /dev/null +++ b/sql/Updates/0.0.1/11_SilvaFilnaveth.sql @@ -0,0 +1 @@ +UPDATE `creature` SET `id` = 11798, `curhealth` = 3857 WHERE `guid` = 46833; \ No newline at end of file diff --git a/sql/Updates/0.0.1/27_Vaelastraz.sql b/sql/Updates/0.0.1/27_Vaelastraz.sql new file mode 100644 index 0000000..a8f30f1 --- /dev/null +++ b/sql/Updates/0.0.1/27_Vaelastraz.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET faction=35 WHERE entry=13020; +UPDATE creature_template SET npcflag=65 WHERE entry=13020; \ No newline at end of file diff --git a/sql/Updates/0.0.1/Makefile.am b/sql/Updates/0.0.1/Makefile.am new file mode 100644 index 0000000..2900766 --- /dev/null +++ b/sql/Updates/0.0.1/Makefile.am @@ -0,0 +1,29 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse + +## Change installation location +# datadir = scriptdev2/sql/updates/0.0.1 +pkgdatadir = $(datadir)/scriptdev2/sql/updates/0.0.1 + +## Files to be installed +# Install basic SQL files to datadir +pkgdata_DATA = \ + 09_BraveWindfeather.sql \ + 11_SilvaFilnaveth.sql \ + 27_Vaelastraz.sql diff --git a/sql/Updates/0.0.2/Makefile.am b/sql/Updates/0.0.2/Makefile.am new file mode 100644 index 0000000..7eec3f3 --- /dev/null +++ b/sql/Updates/0.0.2/Makefile.am @@ -0,0 +1,270 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse + +## Change installation location +# datadir = scriptdev2/sql/updates/0.0.2 +pkgdatadir = $(datadir)/scriptdev2/sql/updates/0.0.2 + +## Files to be installed +# Install basic SQL files to datadir +pkgdata_DATA = \ + r56.sql \ + r59.sql \ + r63.sql \ + r65.sql \ + r72.sql \ + r78.sql \ + r81.sql \ + r91.sql \ + r92.sql \ + r97.sql \ + r108.sql \ + r110.sql \ + r121.sql \ + r123.sql \ + r124.sql \ + r125.sql \ + r128.sql \ + r131.sql \ + r134.sql \ + r136.sql \ + r139.sql \ + r142.sql \ + r144.sql \ + r145.sql \ + r149.sql \ + r150.sql \ + r152.sql \ + r153.sql \ + r157.sql \ + r161.sql \ + r163.sql \ + r169.sql \ + r170.sql \ + r171.sql \ + r172.sql \ + r174.sql \ + r176.sql \ + r177.sql \ + r178.sql \ + r181.sql \ + r182.sql \ + r183.sql \ + r184.sql \ + r186.sql \ + r187.sql \ + r189.sql \ + r191.sql \ + r192.sql \ + r197.sql \ + r204.sql \ + r206.sql \ + r211.sql \ + r213.sql \ + r214.sql \ + r215.sql \ + r218.sql \ + r219.sql \ + r221_scriptdev2.sql \ + r227_scriptdev2.sql \ + r230_mangos.sql \ + r234_mangos.sql \ + r237_mangos.sql \ + r238_mangos.sql \ + r239_mangos.sql \ + r240_scriptdev2.sql \ + r241_mangos.sql \ + r242_mangos.sql \ + r243_mangos.sql \ + r249_mangos.sql \ + r250_mangos.sql \ + r253_mangos.sql \ + r255_mangos.sql \ + r256_mangos.sql \ + r257_mangos.sql \ + r258_mangos.sql \ + r260_mangos.sql \ + r261_mangos.sql \ + r262_mangos.sql \ + r263_mangos.sql \ + r264_mangos.sql \ + r265_mangos.sql \ + r269_mangos.sql \ + r270_mangos.sql \ + r271_mangos.sql \ + r272_mangos.sql \ + r273_mangos.sql \ + r274_mangos.sql \ + r275_mangos.sql \ + r281_scriptdev2.sql \ + r282_mangos.sql \ + r286_mangos.sql \ + r289_mangos.sql \ + r291_mangos.sql \ + r295_mangos.sql \ + r297_mangos.sql \ + r298_scriptdev2.sql \ + r299_scriptdev2.sql \ + r304_mangos.sql \ + r306_scriptdev2.sql \ + r307_mangos.sql \ + r308_mangos.sql \ + r309_mangos.sql \ + r311_mangos.sql \ + r312_mangos.sql \ + r318_mangos.sql \ + r324_mangos.sql \ + r327_mangos.sql \ + r332_scriptdev2.sql \ + r333_mangos.sql \ + r334_mangos.sql \ + r336_mangos.sql \ + r352_mangos.sql \ + r355_mangos.sql \ + r358_mangos.sql \ + r364_mangos.sql \ + r367_mangos.sql \ + r368_mangos.sql \ + r369_mangos.sql \ + r374_mangos.sql \ + r386_mangos.sql \ + r417_mangos.sql \ + r428_mangos.sql \ + r431_mangos.sql \ + r444_mangos.sql \ + r445_mangos.sql \ + r446_mangos.sql \ + r448_scriptdev2.sql \ + r462_mangos.sql \ + r465_mangos.sql \ + r467_mangos.sql \ + r473_mangos.sql \ + r476_mangos.sql \ + r477_mangos.sql \ + r479_mangos.sql \ + r482_mangos.sql \ + r484_mangos.sql \ + r486_mangos.sql \ + r487_mangos.sql \ + r494_mangos.sql \ + r501_mangos.sql \ + r513_mangos.sql \ + r514_mangos.sql \ + r515_mangos.sql \ + r516_mangos.sql \ + r517_mangos.sql \ + r518_mangos.sql \ + r519_mangos.sql \ + r520_mangos.sql \ + r521_mangos.sql \ + r522_mangos.sql \ + r526_mangos.sql \ + r528_mangos.sql \ + r533_mangos.sql \ + r538_scriptdev2.sql \ + r547_mangos.sql \ + r554_mangos.sql \ + r555_mangos.sql \ + r575_mangos.sql \ + r576_mangos.sql \ + r578_mangos.sql \ + r584_mangos.sql \ + r590_mangos.sql \ + r591_mangos.sql \ + r593_mangos.sql \ + r594_mangos.sql \ + r596_mangos.sql \ + r610_mangos.sql \ + r615_scriptdev2.sql \ + r617_mangos.sql \ + r621_mangos.sql \ + r628_mangos.sql \ + r632_mangos.sql \ + r633_mangos.sql \ + r634_scriptdev2.sql \ + r636_mangos.sql \ + r637_mangos.sql \ + r638_mangos.sql \ + r639_mangos.sql \ + r642_mangos.sql \ + r643_mangos.sql \ + r646_mangos.sql \ + r647_scriptdev2.sql \ + r656_scriptdev2.sql \ + r658_mangos.sql \ + r659_mangos.sql \ + r681_scriptdev2.sql \ + r695_scriptdev2.sql \ + r699_scriptdev2_script_texts.sql \ + r700_scriptdev2_script_texts.sql \ + r701_scriptdev2_script_texts.sql \ + r702_scriptdev2_script_texts.sql \ + r703_scriptdev2_script_texts.sql \ + r704_scriptdev2_script_texts.sql \ + r705_scriptdev2_script_texts.sql \ + r706_mangos.sql \ + r707_scriptdev2_script_texts.sql \ + r709_scriptdev2_script_texts.sql \ + r710_scriptdev2_script_texts.sql \ + r713_scriptdev2_script_texts.sql \ + r715_scriptdev2_script_texts.sql \ + r725_scriptdev2_script_texts.sql \ + r726_scriptdev2_script_texts.sql \ + r727_scriptdev2_script_texts.sql \ + r728_scriptdev2_script_texts.sql \ + r729_scriptdev2_script_texts.sql \ + r730_scriptdev2_script_texts.sql \ + r732_scriptdev2_script_texts.sql \ + r735_mangos.sql \ + r735_scriptdev2_script_texts.sql \ + r740_mangos.sql \ + r740_scriptdev2_script_texts.sql \ + r743_mangos.sql \ + r743_scriptdev2_script_texts.sql \ + r745_scriptdev2_script_texts.sql \ + r747_scriptdev2_script_texts.sql \ + r751_scriptdev2_script_texts.sql \ + r755_scriptdev2_script_texts.sql \ + r757_mangos.sql \ + r757_scriptdev2_script_texts.sql \ + r764_mangos.sql \ + r764_scriptdev2_script_texts.sql \ + r766_mangos.sql \ + r766_scriptdev2_script_texts.sql \ + r767_mangos.sql \ + r768_scriptdev2_script_texts.sql \ + r769_mangos.sql \ + r771_scriptdev2_script_texts.sql \ + r772_mangos.sql \ + r777_mangos.sql \ + r778_mangos.sql \ + r779_scriptdev2_script_texts.sql \ + r779_mangos.sql \ + r782_mangos.sql \ + r783_mangos.sql \ + r783_scriptdev2_script_texts.sql \ + r790_mangos.sql \ + r794_mangos.sql \ + r796_scriptdev2_script_texts.sql \ + r802_mangos.sql \ + r804_mangos.sql \ + r804_scriptdev2_script_texts.sql \ + r809_mangos.sql \ + r809_scriptdev2_script_texts.sql \ + r810_mangos.sql diff --git a/sql/Updates/0.0.2/r104.sql b/sql/Updates/0.0.2/r104.sql new file mode 100644 index 0000000..29372b7 --- /dev/null +++ b/sql/Updates/0.0.2/r104.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_orb_of_command' WHERE `entry`='179879'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r108.sql b/sql/Updates/0.0.2/r108.sql new file mode 100644 index 0000000..7c50fe1 --- /dev/null +++ b/sql/Updates/0.0.2/r108.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_dementeddruids' WHERE `entry` = 15260; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r110.sql b/sql/Updates/0.0.2/r110.sql new file mode 100644 index 0000000..d5bd73a --- /dev/null +++ b/sql/Updates/0.0.2/r110.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_illusionofjandicebarov' WHERE `entry` = 11439; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r121.sql b/sql/Updates/0.0.2/r121.sql new file mode 100644 index 0000000..874c3be --- /dev/null +++ b/sql/Updates/0.0.2/r121.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'mobs_spectral_ghostly_citizen' WHERE `entry` IN (10384, 10385); + diff --git a/sql/Updates/0.0.2/r123.sql b/sql/Updates/0.0.2/r123.sql new file mode 100644 index 0000000..3444ce7 --- /dev/null +++ b/sql/Updates/0.0.2/r123.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName = 'dashel_stonefist' WHERE entry = '4961'; +UPDATE creature_template SET ScriptName = 'blood_knight_stillblade' WHERE entry = '17768'; +UPDATE creature_template SET ScriptName = 'shattered_rumbler' WHERE entry = '17157'; +UPDATE `creature_template` SET `ScriptName`='neltharaku' WHERE `entry`='21657'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r124.sql b/sql/Updates/0.0.2/r124.sql new file mode 100644 index 0000000..9df45fb --- /dev/null +++ b/sql/Updates/0.0.2/r124.sql @@ -0,0 +1,13 @@ +-- BT Trash Mobs +UPDATE `creature_template` SET `scriptname`='mob_blacktemple' WHERE `entry` IN (22844,22845,22846,22849,22853,22855,22869,22873,22875,22876,22877,22878,22880,22881,22882,22883,22884,22945,22953,22954,23337,23339); + +-- The Eye Trash Mobs +UPDATE `creature_template` SET `scriptname`='mob_the_eye' WHERE `entry` IN (20031,20032,20033,20034,20035,20039,20041,20043,20046,20052); +UPDATE `creature_template` SET `scriptname`='mob_crystalcore_devastator' WHERE `entry`='20040'; + +-- Uldaman Trash Mobs +UPDATE `creature_template` SET `scriptname`='mob_uldaman' WHERE `entry` IN (4847,4852,4853,4854,4860,4861,6910,7011,7012,7022,7030,7078,7291); +UPDATE `creature_template` SET `scriptname`='mob_jadespine_basilisk' WHERE `entry`='4863'; + +-- Uldaman Boss Ironaya +UPDATE `creature_template` SET `scriptname`='boss_ironaya' WHERE `entry`='7228'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r125.sql b/sql/Updates/0.0.2/r125.sql new file mode 100644 index 0000000..a2e19c1 --- /dev/null +++ b/sql/Updates/0.0.2/r125.sql @@ -0,0 +1,24 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_infested_root_walker' WHERE `entry` = 22095; +UPDATE `creature_template` SET `ScriptName` = 'mob_rotting_forest_rager' WHERE `entry` = 22307; +UPDATE `creature_template` SET `ScriptName` = 'mob_netherweb_victim' WHERE `entry` = 22355; + +UPDATE `creature_template` SET `ScriptName` = 'mobs_shadow_council_covert' WHERE `entry` IN (18716, 18717, 18719); +UPDATE `creature_template` SET `npcflag` = 1 WHERE `entry` IN (18716, 18717, 18719); + +UPDATE `creature_template` SET `ScriptName` = 'mob_gurok_the_usurper' WHERE `entry` = 18182; +UPDATE `creature_template` SET `ScriptName` = 'mob_shattered_rumbler' WHERE `entry` = '17157'; +UPDATE `creature_template` SET `ScriptName` = 'mobs_kilsorrow_agent' WHERE `entry` IN (17146, 17147, 17148, 18397, 18658); +UPDATE `creature_template` SET `ScriptName` = 'npc_altruis_the_sufferer' WHERE `entry` = 18417; + +UPDATE `creature_template` SET `ScriptName` = 'npcs_ashyen_and_keleth' WHERE `entry` IN (17900, 17901); +UPDATE `creature_template` SET `npcflag` = 1 WHERE `entry` IN (17900,17901); +UPDATE `creature_template` SET `ScriptName` = 'npc_elder_kuruti' WHERE `entry` = 18197; +UPDATE `creature_template` SET `npcflag` = 1 WHERE `entry` = 18197; + +UPDATE `creature_template` SET `ScriptName` = 'mob_lunaclaw' WHERE `entry` = 12138; + +UPDATE `creature_template` SET `ScriptName` = 'npc_steward_of_time' WHERE `entry` = 20142; + +UPDATE `creature_template` SET `ScriptName` = 'boss_death_knight_darkreaver' WHERE `entry` = 14516; + +UPDATE `creature_template` SET `ScriptName` = 'mob_yenniku' WHERE `entry` = 2530; diff --git a/sql/Updates/0.0.2/r128.sql b/sql/Updates/0.0.2/r128.sql new file mode 100644 index 0000000..f652fa1 --- /dev/null +++ b/sql/Updates/0.0.2/r128.sql @@ -0,0 +1 @@ +update `creature_template` SET `scriptname`='npc_guardian' WHERE `entry`='5764'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r131.sql b/sql/Updates/0.0.2/r131.sql new file mode 100644 index 0000000..0899dae --- /dev/null +++ b/sql/Updates/0.0.2/r131.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_henze_faulk' WHERE `entry`= 6172; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r134.sql b/sql/Updates/0.0.2/r134.sql new file mode 100644 index 0000000..1be50e3 --- /dev/null +++ b/sql/Updates/0.0.2/r134.sql @@ -0,0 +1,15 @@ + +UPDATE `instance_template` SET `script` = 'instance_molten_core' WHERE `map`= 409; +UPDATE `instance_template` SET `script` = 'instance_blackwing_lair' WHERE `map`= 469; +UPDATE `instance_template` SET `script` = 'instance_zulgurub' WHERE `map`= 309; +UPDATE `instance_template` SET `script` = 'instance_ruins_of_ahnqiraj' WHERE `map`= 509; +UPDATE `instance_template` SET `script` = 'instance_temple_of_ahnqiraj' WHERE `map`= 531; +UPDATE `instance_template` SET `script` = 'instance_naxxramas' WHERE `map`= 533; + +UPDATE `instance_template` SET `script` = 'instance_karazhan' WHERE `map`= 532; +UPDATE `instance_template` SET `script` = 'instance_hyjal' WHERE `map`= 534; +UPDATE `instance_template` SET `script` = 'instance_gruuls_lair' WHERE `map`= 565; +UPDATE `instance_template` SET `script` = 'instance_magtheridons_lair' WHERE `map`= 544; +UPDATE `instance_template` SET `script` = 'instance_serpent_shrine' WHERE `map`= 548; +UPDATE `instance_template` SET `script` = 'instance_the_eye' WHERE `map`= 550; +UPDATE `instance_template` SET `script` = 'instance_black_temple' WHERE `map`= 564; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r136.sql b/sql/Updates/0.0.2/r136.sql new file mode 100644 index 0000000..ea3b399 --- /dev/null +++ b/sql/Updates/0.0.2/r136.sql @@ -0,0 +1,55 @@ + +-- AQ40 bosses -- + +-- Skeram 15263 +UPDATE `creature_template` SET `ScriptName` = 'boss_skeram' WHERE `entry` = 15263; + +-- Vem, Yauj, Kri +-- Vem 15544 +UPDATE `creature_template` SET `ScriptName` = 'boss_vem' WHERE `entry` = 15544; +-- Yauj 15543 +UPDATE `creature_template` SET `ScriptName` = 'boss_yauj' WHERE `entry` = 15543; +-- Yauj Brood 15621 +UPDATE `creature_template` SET `ScriptName` = 'mob_yauj_brood' WHERE `entry` = 15621; +-- Kri 15511 +UPDATE `creature_template` SET `ScriptName` = 'boss_kri' WHERE `entry` = 15511; + +-- Sartura 15516 +UPDATE `creature_template` SET `ScriptName` = 'boss_sartura' WHERE `entry` = 15516; +-- Sartura's Royal Guard 15984 +UPDATE `creature_template` SET `ScriptName` = 'mob_sartura_royal_guard' WHERE `entry` = 15984; + +-- Fankriss 15510 +UPDATE `creature_template` SET `ScriptName` = 'boss_fankriss' WHERE `entry` = 15510; +-- Spawn of Fankriss 15630 +UPDATE `creature_template` SET `ScriptName` = 'mob_spawn_of_fankriss' WHERE `entry` = 15630; + +-- Viscidus 15299 +UPDATE `creature_template` SET `ScriptName` = 'boss_viscidus' WHERE `entry` = 15299; +-- Glob of Viscidus 15667 +UPDATE `creature_template` SET `ScriptName` = 'boss_glob_of_viscidus' WHERE `entry` = 15667; + +-- Huhuran 15509 +UPDATE `creature_template` SET `ScriptName` = 'boss_huhuran' WHERE `entry` = 15509; + +-- Veklor & Veknilash +-- Veklor 15276 +UPDATE `creature_template` SET `ScriptName` = 'boss_veklor' WHERE `entry` = 15276; +-- Veknilash 15275 +UPDATE `creature_template` SET `ScriptName` = 'boss_veknilash' WHERE `entry` = 15275; + +-- Ouro 15517 +UPDATE `creature_template` SET `ScriptName` = 'boss_ouro' WHERE `entry` = 15517; + +-- C'thun +-- Eye 15589 +-- Body 15727 + +UPDATE creature_template SET ScriptName='boss_eye_of_cthun' WHERE entry=15589; +UPDATE creature_template SET ScriptName='mob_claw_tentacle' WHERE entry=15725; +UPDATE creature_template SET ScriptName='mob_eye_tentacle' WHERE entry=15726; + +UPDATE creature_template SET ScriptName='boss_cthun' WHERE entry=15727; +UPDATE creature_template SET ScriptName='mob_giant_claw_tentacle' WHERE entry=15728; +UPDATE creature_template SET ScriptName='mob_giant_eye_tentacle' WHERE entry=15334; +UPDATE creature_template SET ScriptName='mob_giant_flesh_tentacle' WHERE entry=15802; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r139.sql b/sql/Updates/0.0.2/r139.sql new file mode 100644 index 0000000..0945648 --- /dev/null +++ b/sql/Updates/0.0.2/r139.sql @@ -0,0 +1,35 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_lokhtos_darkbargainer' WHERE `entry` = 12944; + +UPDATE creature_template SET ScriptName='npc_lady_jaina_proudmoore' WHERE entry=4968; + +UPDATE `creature_template` SET `ScriptName` = 'mobs_spitelashes' WHERE entry IN (6190,6193,6194,6195,6196,7885,7886,12204,12205); + +UPDATE creature_template SET npcflag=1, ScriptName='npc_beaten_corpse' WHERE entry=10668; +UPDATE quest_template SET SpecialFlags=8, ReqCreatureOrGOId1=10668, ReqCreatureOrGOCount1=1 WHERE entry=4921; + +UPDATE creature_template SET ScriptName='boss_rokmar_the_crackler' WHERE entry=17991; +UPDATE creature_template SET ScriptName='boss_warlord_kalithresh' WHERE entry=17798; + +UPDATE `creature_template` SET `ScriptName` = 'boss_midnight' WHERE `entry` = 16151; +UPDATE `creature_template` SET `ScriptName` = 'boss_attumen' WHERE `entry` = 15550; +UPDATE `creature_template` SET `ScriptName` = 'boss_moroes' WHERE `entry` = 15687; +UPDATE `creature_template` SET `ScriptName` = 'boss_maiden_of_virtue' WHERE `entry` = 16457; +UPDATE `creature_template` SET `ScriptName` = 'boss_curator' WHERE `entry` = 15691; +UPDATE `creature_template` SET `ScriptName` = 'boss_big_bad_wolf' WHERE `entry` = 17521; +UPDATE `creature_template` SET `ScriptName` = 'boss_julianne' WHERE `entry` = 17534; +UPDATE `creature_template` SET `ScriptName` = 'boss_romulo' WHERE `entry` = 17533; +UPDATE `creature_template` SET `ScriptName` = 'boss_dorothee' WHERE `entry` = 17535; +UPDATE `creature_template` SET `ScriptName` = 'boss_strawman' WHERE `entry` = 17543; +UPDATE `creature_template` SET `ScriptName` = 'boss_tinhead' WHERE `entry` = 17547; +UPDATE `creature_template` SET `ScriptName` = 'boss_tito' WHERE `entry` = 17548; +UPDATE `creature_template` SET `ScriptName` = 'boss_roar' WHERE `entry` = 17546; +UPDATE `creature_template` SET `ScriptName` = 'boss_crone' WHERE `entry` = 18168; +UPDATE `creature_template` SET `ScriptName` = 'boss_terestian_illhoof' WHERE `entry` = 15688; +UPDATE `creature_template` SET `ScriptName` = 'boss_shade_of_aran' WHERE `entry` = 16524; +UPDATE `creature_template` SET `ScriptName` = 'boss_netherspite' WHERE `entry` = 15689; +UPDATE `creature_template` SET `ScriptName` = 'boss_malchezaar' WHERE `entry` = 15690; +UPDATE `creature_template` SET `ScriptName` = 'boss_nightbane' WHERE `entry` = 17225; + +UPDATE `creature_template` SET `ScriptName` = 'mob_homunculus' WHERE `entry` = 16539; +UPDATE `creature_template` SET `ScriptName` = 'mob_kilrek' WHERE `entry` = 17229; +UPDATE `creature_template` SET `ScriptName` = 'netherspite_infernal' WHERE `entry` = 17646; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r142.sql b/sql/Updates/0.0.2/r142.sql new file mode 100644 index 0000000..a4c581a --- /dev/null +++ b/sql/Updates/0.0.2/r142.sql @@ -0,0 +1,11 @@ +-- VoidReaver 19516 +UPDATE `creature_template` SET `ScriptName` = 'boss_void_reaver' WHERE `entry` = 19516; + +-- Arcane Orb Target +REPLACE INTO `creature_template` (`entry`, `modelid_A`, `modelid_H`, `name`, `subname`, `minlevel`, `maxlevel`, `minhealth`, `maxhealth`, `minmana`, `maxmana`, `armor`, `faction_A`, `faction_H`, `npcflag`, `speed`, `rank`, `mindmg`, `maxdmg`, `dmgschool`, `attackpower`, `baseattacktime`, `rangeattacktime`, `flags`, `dynamicflags`, `family`, `trainer_type`, `trainer_spell`, `class`, `race`, `minrangedmg`, `maxrangedmg`, `rangedattackpower`, `type`, `civilian`, `flag1`, `lootid`, `pickpocketloot`, `skinloot`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `spell1`, `spell2`, `spell3`, `spell4`, `mingold`, `maxgold`, `AIName`, `MovementType`, `InhabitType`, `RacialLeader`, `RegenHealth`, `equipment_id`, `ScriptName`) VALUES (19577, 16946, 16946, 'Arcane Orb Target', '', 70, 70, 1, 1, 0, 0, 0, 35, 35, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '', 0, 3, 0, 1, 0, 'mob_arcane_orb_target'); + +UPDATE `creature_template` SET `ScriptName` = 'boss_omor_the_unscarred' WHERE `entry` = 17308; +UPDATE `creature_template` SET `ScriptName` = 'boss_watchkeeper_gargolmar' WHERE `entry` = 17306; + +UPDATE `creature_template` SET `ScriptName` = 'boss_hungarfen' WHERE `entry` = 17770; +UPDATE `creature_template` SET `ScriptName` = 'mob_underbog_mushroom' WHERE `entry` = 17990; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r144.sql b/sql/Updates/0.0.2/r144.sql new file mode 100644 index 0000000..cf9a8ec --- /dev/null +++ b/sql/Updates/0.0.2/r144.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_the_maker' WHERE `entry` = 17381; +UPDATE `creature_template` SET `ScriptName` = 'boss_broggok' WHERE `entry` = 17380; +UPDATE `creature_template` SET `ScriptName` = 'boss_kelidan_the_breaker' WHERE `entry` = 17377; +UPDATE `creature_template` SET `ScriptName` = 'mob_broggok_poisoncloud' WHERE `entry` = 17662; +UPDATE `creature_template` SET minlevel = 63, maxlevel = 63 WHERE `entry` = 17662; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r145.sql b/sql/Updates/0.0.2/r145.sql new file mode 100644 index 0000000..b19206b --- /dev/null +++ b/sql/Updates/0.0.2/r145.sql @@ -0,0 +1,4 @@ + +UPDATE `creature_template` SET `ScriptName` = 'mob_shadow_of_aran' WHERE `entry` = 18254; +UPDATE `creature_template` SET `ScriptName` = 'mob_aran_elemental' WHERE `entry` = 17167; +UPDATE `creature_template` SET `ScriptName` = 'mob_aran_blizzard' WHERE `entry` = 17161; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r149.sql b/sql/Updates/0.0.2/r149.sql new file mode 100644 index 0000000..0a184be --- /dev/null +++ b/sql/Updates/0.0.2/r149.sql @@ -0,0 +1 @@ +INSERT INTO `spell_script_target` VALUES (30834, 1, 17646); diff --git a/sql/Updates/0.0.2/r150.sql b/sql/Updates/0.0.2/r150.sql new file mode 100644 index 0000000..a0856a4 --- /dev/null +++ b/sql/Updates/0.0.2/r150.sql @@ -0,0 +1,19 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_grand_warlock_nethekurse' WHERE `entry` = 16807; +UPDATE `creature_template` SET `ScriptName` = 'mob_nethe_shadowfissure' WHERE `entry` = 17471; + +UPDATE `creature_template` SET `scriptname`='mob_phoenix' WHERE `entry`='21362'; +UPDATE `creature_template` SET `scriptname`='mob_phoenix_egg' WHERE `entry`='21364'; + +UPDATE `item_template` SET `ScriptName` = 'vorenthals_presence' WHERE `entry`= 30259; + +UPDATE `creature_template` SET `ScriptName` = 'boss_hydromancer_thespia' WHERE `entry` = 17797; +UPDATE `creature_template` SET `ScriptName` = 'mob_coilfang_waterelemental' WHERE `entry` = 17917; + +UPDATE `creature_template` SET `ScriptName` = 'mob_ethereal_beacon' WHERE `entry` = 18431; +UPDATE `creature_template` SET `ScriptName` = 'mob_ethereal_apprentice' WHERE `entry` = 18430; + +UPDATE `creature_template` SET `ScriptName` = 'boss_tavarok' WHERE `entry` = 18343; +UPDATE `creature_template` SET `ScriptName` = 'boss_pandemonius' WHERE `entry` = 18341; +UPDATE `creature_template` SET `ScriptName` = 'boss_nexusprince_shaffar' WHERE `entry` = 18344; + +UPDATE `creature_template` SET `ScriptName` = 'boss_ghazan' WHERE `entry` = 18105; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r152.sql b/sql/Updates/0.0.2/r152.sql new file mode 100644 index 0000000..7e05fee --- /dev/null +++ b/sql/Updates/0.0.2/r152.sql @@ -0,0 +1,12 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_syth_fire' WHERE `entry` = 19203; +UPDATE `creature_template` SET `ScriptName` = 'mob_syth_arcane' WHERE `entry` = 19205; +UPDATE `creature_template` SET `ScriptName` = 'mob_syth_frost' WHERE `entry` = 19204; +UPDATE `creature_template` SET `ScriptName` = 'mob_syth_shadow' WHERE `entry` = 19206; + +UPDATE `creature_template` SET `ScriptName` = 'boss_tailonking_ikiss' WHERE `entry` = 18473; +UPDATE `creature_template` SET `ScriptName` = 'boss_darkweaver_syth' WHERE `entry` = 18472; + +UPDATE creature_template SET ScriptName = 'npc_shattrathflaskvendors' WHERE entry = '23483'; +UPDATE creature_template SET ScriptName = 'npc_shattrathflaskvendors' WHERE entry = '23484'; + +UPDATE `creature_template` SET ScriptName='innkeeper' WHERE `npcflag` & 128<>0; diff --git a/sql/Updates/0.0.2/r153.sql b/sql/Updates/0.0.2/r153.sql new file mode 100644 index 0000000..6630c11 --- /dev/null +++ b/sql/Updates/0.0.2/r153.sql @@ -0,0 +1,33 @@ +-- Fishing net +UPDATE item_template SET ScriptName = 'draenei_fishing_net' WHERE entry = 23654; + +-- Auchenai Crypts +UPDATE `creature_template` set `scriptname` = 'boss_shirrak_the_dead_watcher' where `entry` = '18371'; +UPDATE `creature_template` set `scriptname` = 'boss_shirrak_the_dead_watcher' where `entry` = '20318'; + +-- Old Hillsbrad +UPDATE `creature_template` set `scriptname` = 'mob_lieutenant_drake' where `entry` = '17848'; +UPDATE `creature_template` set `scriptname` = 'mob_epoch_hunter' where `entry` = '18096'; +UPDATE `creature_template` SET `ScriptName` = 'boss_captain_skarloc' WHERE `entry`=17862; + +-- The Black Morass +UPDATE `creature_template` set `ScriptName` = 'boss_chrono_lord_deja' where `entry` = '17879'; +UPDATE `creature_template` SET `ScriptName` = 'boss_aeonus' WHERE `entry`=17881; +UPDATE `creature_template` set `ScriptName` = 'boss_temporus' where `entry` = '17880'; + +-- Deadmines +UPDATE `creature_template` SET `ScriptName` = 'boss_deadmines' WHERE `entry`=645; +UPDATE `creature_template` SET `ScriptName` = 'boss_deadmines' WHERE `entry`=1763; +UPDATE `creature_template` SET `ScriptName` = 'boss_deadmines' WHERE `entry`=599; +UPDATE `creature_template` SET `ScriptName` = 'boss_deadmines' WHERE `entry`=3586; + +-- Wailing Caverns +UPDATE `creature_template` SET `ScriptName` = 'boss_wailing_caverns' WHERE `entry`=3654; + +-- Gruul's Lair +UPDATE `creature_template` SET `ScriptName` = 'boss_high_king_maulgar' WHERE `entry`=18831; +UPDATE `creature_template` SET `ScriptName` = 'boss_kiggler_the_crazed' WHERE `entry`=18835; +UPDATE `creature_template` SET `ScriptName` = 'boss_blindeye_the_seer' WHERE `entry`=18836; +UPDATE `creature_template` SET `ScriptName` = 'boss_olm_the_summoner' WHERE `entry`=18834; +UPDATE `creature_template` SET `ScriptName` = 'boss_krosh_firehand' WHERE `entry`=18832; +UPDATE `instance_template` SET `script`="instance_gruuls_lair" WHERE `map`=565; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r157.sql b/sql/Updates/0.0.2/r157.sql new file mode 100644 index 0000000..0850000 --- /dev/null +++ b/sql/Updates/0.0.2/r157.sql @@ -0,0 +1,7 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_hydross_the_unstable' WHERE `entry`=21216; +UPDATE `creature_template` SET `ScriptName` = 'boss_leotheras_the_blind' WHERE `entry`=21215; + +-- Magtheridon's Lair +UPDATE `gameobject_template` SET `ScriptName`='go_manticron_cube' WHERE `entry`='181713'; +UPDATE `creature_template` SET `ScriptName` = 'boss_magtheridon' WHERE `entry`=17257; +UPDATE `creature_template` SET `ScriptName` = 'mob_hellfire_channeler' WHERE `entry`=17256; diff --git a/sql/Updates/0.0.2/r161.sql b/sql/Updates/0.0.2/r161.sql new file mode 100644 index 0000000..fef59c7 --- /dev/null +++ b/sql/Updates/0.0.2/r161.sql @@ -0,0 +1,12 @@ +-- shadow labyrinth +UPDATE `instance_template` SET `script` = 'instance_shadow_labyrinth' WHERE `map`= 555; +UPDATE `creature_template` SET `ScriptName` = 'boss_murmur' WHERE `entry` = 18708; +UPDATE `creature_template` SET `ScriptName` = 'boss_ambassador_hellmaw' WHERE `entry` = 18731; +UPDATE `creature_template` SET `ScriptName` = 'boss_grandmaster_vorpil' WHERE `entry` = 18732; +UPDATE `creature_template` SET `ScriptName` = 'boss_blackheart_the_inciter' WHERE `entry` = 18667; + +-- fathomlord karathress +UPDATE `creature_template` SET `ScriptName` = 'boss_fathomlord_karathress' WHERE `entry`=21214; +UPDATE `creature_template` SET `ScriptName` = 'boss_fathomguard_sharkkis' WHERE `entry`=21966; +UPDATE `creature_template` SET `ScriptName` = 'boss_fathomguard_tidalvess' WHERE `entry`=21965; +UPDATE `creature_template` SET `ScriptName` = 'boss_fathomguard_caribdis' WHERE `entry`=21964; diff --git a/sql/Updates/0.0.2/r163.sql b/sql/Updates/0.0.2/r163.sql new file mode 100644 index 0000000..93650db --- /dev/null +++ b/sql/Updates/0.0.2/r163.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET npcflag=npcflag|1, ScriptName='npc_cairne_bloodhoof' WHERE entry=3057; +UPDATE `gameobject_template` SET `ScriptName`='go_barov_journal' WHERE `entry`=180794; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r164.sql b/sql/Updates/0.0.2/r164.sql new file mode 100644 index 0000000..71bc9c2 --- /dev/null +++ b/sql/Updates/0.0.2/r164.sql @@ -0,0 +1,10 @@ +-- gruuls lair trash mobs +UPDATE `creature_template` SET `ScriptName` = 'mob_gruuls_lair' WHERE `entry` IN (19389, 21350); + +-- morogrim tidewalker +UPDATE `creature_template` SET `ScriptName` = 'boss_morogrim_tidewalker' WHERE `entry`=21213; +-- Water Globule +UPDATE `creature_template` SET `ScriptName` = 'mob_water_globule' WHERE `entry`=21913; + +-- Serpentshrine Cavern Trash Mobs +UPDATE `creature_template` SET `ScriptName` = 'mob_serpentshrine_cavern' WHERE `entry` IN (21246, 21339, 21221, 21224, 21227, 21228, 21226, 21225, 21298, 21299); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r165.sql b/sql/Updates/0.0.2/r165.sql new file mode 100644 index 0000000..bd7dcc8 --- /dev/null +++ b/sql/Updates/0.0.2/r165.sql @@ -0,0 +1,8 @@ + +-- the steam vault +UPDATE `instance_template` SET `script` = 'instance_steam_vault' WHERE `map` = 545; + +-- right old hillsbrad foothills bosses script name +UPDATE `creature_template` SET `ScriptName` = 'boss_lieutenant_drake' WHERE `entry` = 17848; +UPDATE `creature_template` SET `ScriptName` = 'boss_epoch_hunter' WHERE `entry` = 18096; + diff --git a/sql/Updates/0.0.2/r169.sql b/sql/Updates/0.0.2/r169.sql new file mode 100644 index 0000000..30ea53d --- /dev/null +++ b/sql/Updates/0.0.2/r169.sql @@ -0,0 +1,4 @@ +-- hellfire peninsula special taxi path +UPDATE `creature_template` SET `ScriptName` = 'npc_wing_commander_brack' WHERE `entry` = 19401; +UPDATE `creature_template` SET `ScriptName` = 'npc_wing_commander_dabiree' WHERE `entry` = 19409; +UPDATE `creature_template` SET `ScriptName` = 'npc_gryphoneer_windbellow' WHERE `entry` = 20235; diff --git a/sql/Updates/0.0.2/r170.sql b/sql/Updates/0.0.2/r170.sql new file mode 100644 index 0000000..600122a --- /dev/null +++ b/sql/Updates/0.0.2/r170.sql @@ -0,0 +1,2 @@ +-- special taxi path netherstorm +UPDATE `creature_template` SET `ScriptName` = 'npc_protectorate_nether_drake' WHERE `entry` = 20903; diff --git a/sql/Updates/0.0.2/r171.sql b/sql/Updates/0.0.2/r171.sql new file mode 100644 index 0000000..e241953 --- /dev/null +++ b/sql/Updates/0.0.2/r171.sql @@ -0,0 +1,2 @@ +-- multi kill quest mobs hfp +UPDATE `creature_template` SET `ScriptName` = 'mobs_shattered_hand_orc' WHERE `entry` IN (19411, 19410, 19413, 19414, 16867, 19295, 16870, 16878, 19415); diff --git a/sql/Updates/0.0.2/r172.sql b/sql/Updates/0.0.2/r172.sql new file mode 100644 index 0000000..4b8638f --- /dev/null +++ b/sql/Updates/0.0.2/r172.sql @@ -0,0 +1,3 @@ +-- support multikill bladespire and bloodmaul ogres +UPDATE `creature_template` SET `ScriptName` = 'mobs_bladespire_ogre' WHERE `entry` IN (19998, 20334, 21296, 21975); +UPDATE `creature_template` SET `ScriptName` = 'mobs_bloodmaul_ogre' WHERE `entry` IN (19948, 19952, 19957); diff --git a/sql/Updates/0.0.2/r174.sql b/sql/Updates/0.0.2/r174.sql new file mode 100644 index 0000000..0b31c6f --- /dev/null +++ b/sql/Updates/0.0.2/r174.sql @@ -0,0 +1,8 @@ +-- multikill creatures +UPDATE `creature_template` SET `ScriptName` = 'mobs_dragonmaw_orc' WHERE `entry` IN (21717, 21718, 21719, 21720, 22331); +UPDATE `creature_template` SET `ScriptName` = 'mobs_shadowmoon_valley_wildlife' WHERE `entry` IN (21878, 21879); +UPDATE `creature_template` SET `ScriptName` = 'mobs_gordunni_ogre' WHERE `entry` IN (22143, 22144, 22148, 23022); +-- vendor +UPDATE `creature_template` SET `ScriptName` = 'npc_drake_dealer_hurlunk' WHERE `entry` = 23489; +UPDATE `creature_template` SET `ScriptName` = 'npc_rivern_frostwind' WHERE `entry` = 10618; + diff --git a/sql/Updates/0.0.2/r176.sql b/sql/Updates/0.0.2/r176.sql new file mode 100644 index 0000000..e51ea4a --- /dev/null +++ b/sql/Updates/0.0.2/r176.sql @@ -0,0 +1,5 @@ +-- tales and stories +UPDATE `creature_template` SET `ScriptName` = 'npc_tirion_fordring' WHERE `entry` = 1855; +UPDATE `creature_template` SET `ScriptName` = 'npc_loramus_thalipedes' WHERE `entry` = 7783; +UPDATE `creature_template` SET `ScriptName` = 'npc_fallen_hero_of_horde' WHERE `entry` = 7572; +UPDATE `creature_template` SET `ScriptName` = 'npc_lorax' WHERE `entry` = 10918; diff --git a/sql/Updates/0.0.2/r177.sql b/sql/Updates/0.0.2/r177.sql new file mode 100644 index 0000000..22bb7cc --- /dev/null +++ b/sql/Updates/0.0.2/r177.sql @@ -0,0 +1,2 @@ +-- kalaran windblade +UPDATE `creature_template` SET `ScriptName` = 'npc_kalaran_windblade' WHERE `entry` = 8479; diff --git a/sql/Updates/0.0.2/r178.sql b/sql/Updates/0.0.2/r178.sql new file mode 100644 index 0000000..29b1c02 --- /dev/null +++ b/sql/Updates/0.0.2/r178.sql @@ -0,0 +1,2 @@ +-- kharan mighthammer +UPDATE `creature_template` SET `ScriptName` = 'npc_kharan_mighthammer' WHERE `entry` = 9021; diff --git a/sql/Updates/0.0.2/r181.sql b/sql/Updates/0.0.2/r181.sql new file mode 100644 index 0000000..f688415 --- /dev/null +++ b/sql/Updates/0.0.2/r181.sql @@ -0,0 +1,2 @@ +-- npc_lantresor_of_the_blade +UPDATE `creature_template` SET `ScriptName` = 'npc_lantresor_of_the_blade' WHERE `entry` = 18261; diff --git a/sql/Updates/0.0.2/r182.sql b/sql/Updates/0.0.2/r182.sql new file mode 100644 index 0000000..9fdc5f8 --- /dev/null +++ b/sql/Updates/0.0.2/r182.sql @@ -0,0 +1,2 @@ +-- npc_ragged_john +UPDATE `creature_template` SET `ScriptName` = 'npc_ragged_john' WHERE `entry` = 9563; diff --git a/sql/Updates/0.0.2/r183.sql b/sql/Updates/0.0.2/r183.sql new file mode 100644 index 0000000..d483d2f --- /dev/null +++ b/sql/Updates/0.0.2/r183.sql @@ -0,0 +1,5 @@ +-- revert to original specialflags + flag 4 for mangos support, script no longer needed for quest +UPDATE `quest_template` SET `SpecialFlags`= 140 WHERE `entry` IN (10040, 10041); +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (18716, 18717, 18719); +-- gossip only, key to searing gorge discussion +UPDATE `creature_template` SET `ScriptName` = 'npc_mountaineer_pebblebitty' WHERE `entry` = 3836; diff --git a/sql/Updates/0.0.2/r184.sql b/sql/Updates/0.0.2/r184.sql new file mode 100644 index 0000000..9c7007b --- /dev/null +++ b/sql/Updates/0.0.2/r184.sql @@ -0,0 +1,2 @@ +-- revert to default database values +UPDATE `quest_template` SET `SpecialFlags`= 10, `ReqCreatureOrGOId1` = 0, `ReqCreatureOrGOId2` = 0, `ReqCreatureOrGOId3`= 0, `ReqCreatureOrGOId4`= 0, `ReqCreatureOrGOCount1` = 0, `ReqCreatureOrGOCount2` = 0, `ReqCreatureOrGOCount3` = 0, `ReqCreatureOrGOCount4`= 0, `ReqSpellCast1` = 0, `ReqSpellCast2` = 0, `ReqSpellCast3` = 0, `ReqSpellCast4` = 0 WHERE `entry` IN (5929, 5930); diff --git a/sql/Updates/0.0.2/r186.sql b/sql/Updates/0.0.2/r186.sql new file mode 100644 index 0000000..7a25e08 --- /dev/null +++ b/sql/Updates/0.0.2/r186.sql @@ -0,0 +1,2 @@ +-- leotheras the blind demonform +UPDATE `creature_template` SET `ScriptName` = 'boss_leotheras_the_blind_demonform' WHERE `entry` = 21845; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r187.sql b/sql/Updates/0.0.2/r187.sql new file mode 100644 index 0000000..35e62e6 --- /dev/null +++ b/sql/Updates/0.0.2/r187.sql @@ -0,0 +1,12 @@ +-- test of lore quest npcs +UPDATE `creature_template` SET `ScriptName` = 'npc_parqual_fintallas' WHERE `entry` = 4488; +UPDATE `creature_template` SET `ScriptName` = 'npc_braug_dimspirit' WHERE `entry` = 4489; +-- quest Scratches +UPDATE `creature_template` SET `ScriptName` = 'npc_daranelle' WHERE `entry` = 21469; + +-- no comments of malfuntion, implementing mount vendors script +UPDATE `creature_template` SET `ScriptName` = 'npc_mount_vendor' WHERE `entry` IN (384, 1261, 1460, 2357, 3362, 3685, 4730, 4731, 4885, 7952, 7955, 16264, 17584); + +-- one time update, this is database related sql and should be included in any database +UPDATE `creature_template` SET `npcflag` = `npcflag`|1 WHERE `entry` IN (4488, 4489, 21469); +INSERT IGNORE `spell_teleport` VALUES (6766, 1,-2354.03,-1902.07,95.78,4.6); diff --git a/sql/Updates/0.0.2/r189.sql b/sql/Updates/0.0.2/r189.sql new file mode 100644 index 0000000..ef4d69c --- /dev/null +++ b/sql/Updates/0.0.2/r189.sql @@ -0,0 +1,3 @@ +UPDATE `gameobject_template` SET `ScriptName` = 'go_field_repair_bot' where `entry`=179552; +UPDATE `creature_template` SET `ScriptName` = 'boss_doomwalker' WHERE `entry` = 17711; +UPDATE `creature_template` SET `ScriptName` = 'boss_exarch_maladaar' WHERE `entry` = 18373; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r191.sql b/sql/Updates/0.0.2/r191.sql new file mode 100644 index 0000000..8af44db --- /dev/null +++ b/sql/Updates/0.0.2/r191.sql @@ -0,0 +1,5 @@ + +/* THE MECHANAR */ +UPDATE `creature_template` SET `ScriptName` = 'boss_gatewatcher_iron_hand' WHERE `entry` = 19710; +UPDATE `creature_template` SET `ScriptName` = 'boss_nethermancer_sepethrea' WHERE `entry` = 19221; +UPDATE `creature_template` SET `ScriptName` = 'mob_ragin_flames' WHERE `entry` = 20481; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r192.sql b/sql/Updates/0.0.2/r192.sql new file mode 100644 index 0000000..aa1e9d3 --- /dev/null +++ b/sql/Updates/0.0.2/r192.sql @@ -0,0 +1,9 @@ +-- lady vashj event +UPDATE `creature_template` SET `ScriptName` = 'boss_lady_vashj' WHERE `entry` = 21212; +UPDATE `creature_template` SET `ScriptName` = 'mob_enchanted_elemental' WHERE `entry` = 21958; +UPDATE `creature_template` SET `ScriptName` = 'mob_tainted_elemental' WHERE `entry` = 22009; +UPDATE `creature_template` SET `ScriptName` = 'mob_coilfang_elite' WHERE `entry` = 22055; +UPDATE `creature_template` SET `ScriptName` = 'mob_coilfang_strider' WHERE `entry` = 22056; +UPDATE `creature_template` SET `ScriptName` = 'mob_fathom_sporebat' WHERE `entry` = 22120; + +UPDATE `gameobject_template` SET `ScriptName` = 'go_shield_generator' WHERE `entry` IN (185052, 185053, 185051, 185054); diff --git a/sql/Updates/0.0.2/r197.sql b/sql/Updates/0.0.2/r197.sql new file mode 100644 index 0000000..f04fd32 --- /dev/null +++ b/sql/Updates/0.0.2/r197.sql @@ -0,0 +1,5 @@ +-- scholomance script +UPDATE `instance_template` SET `script` = 'instance_scholomance' WHERE `map` = 289; + +-- arcatraz script +UPDATE `instance_template` SET `script` = 'instance_arcatraz' WHERE `map` = 552; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r204.sql b/sql/Updates/0.0.2/r204.sql new file mode 100644 index 0000000..b3bdc1a --- /dev/null +++ b/sql/Updates/0.0.2/r204.sql @@ -0,0 +1,7 @@ +-- lady vashj event +UPDATE `gameobject_template` SET `type`=0,`ScriptName`='' WHERE `entry` IN (185052, 185053, 185051, 185054); +UPDATE `item_template` SET `ScriptName` = 'item_tainted_core' WHERE `entry` = 31088; +UPDATE `creature_template` SET `ScriptName` = 'mob_shield_generator_channel' WHERE `entry` = 19870; + +-- BWL trash mobs +UPDATE `creature_template` SET `ScriptName` = 'mob_blackwing_lair' WHERE `entry` IN (14265, 12457, 13996, 12459, 14261, 14263, 12467, 12463, 12461, 12464, 12460, 12465, 14262, 14264); diff --git a/sql/Updates/0.0.2/r206.sql b/sql/Updates/0.0.2/r206.sql new file mode 100644 index 0000000..5cb8d99 --- /dev/null +++ b/sql/Updates/0.0.2/r206.sql @@ -0,0 +1,16 @@ +-- Zul'Gurub Bosses Part 1 + Trash Mobs +UPDATE `creature_template` SET `ScriptName` = 'boss_jeklik' WHERE `entry` = 14517; +UPDATE `creature_template` SET `ScriptName` = 'boss_venoxis' WHERE `entry` = 14607; +UPDATE `creature_template` SET `ScriptName` = 'boss_marli' WHERE `entry` = 14510; +UPDATE `creature_template` SET `ScriptName` = 'boss_mandokir' WHERE `entry` = 11382; +UPDATE `creature_template` SET `ScriptName` = 'boss_gahzranka' WHERE `entry` = 15114; +UPDATE `creature_template` SET `ScriptName` = 'boss_jindo' WHERE `entry` = 11380; + +/* Spawn of Marli */ +UPDATE `creature_template` SET `ScriptName` = 'mob_spawn_of_marli' WHERE `entry` = 15041; +/* Jeklik Batrider */ +UPDATE `creature_template` SET `ScriptName` = 'mob_batrider' WHERE `entry` = 14965; + + +-- Darkmaster Ganling +UPDATE `creature_template` SET `ScriptName` = 'boss_darkmaster_gandling' WHERE `entry` = 1853; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r211.sql b/sql/Updates/0.0.2/r211.sql new file mode 100644 index 0000000..cce85f9 --- /dev/null +++ b/sql/Updates/0.0.2/r211.sql @@ -0,0 +1,6 @@ +-- kael'thas event +UPDATE `creature_template` SET `ScriptName` = 'boss_kaelthas' WHERE `entry` = 19622; +UPDATE `creature_template` SET `ScriptName` = 'boss_thaladred_the_darkener' WHERE `entry` = 20064; +UPDATE `creature_template` SET `ScriptName` = 'boss_lord_sanguinar' WHERE `entry` = 20060; +UPDATE `creature_template` SET `ScriptName` = 'boss_grand_astromancer_capernian' WHERE `entry` = 20062; +UPDATE `creature_template` SET `ScriptName` = 'boss_master_engineer_telonicus' WHERE `entry` = 20063; diff --git a/sql/Updates/0.0.2/r213.sql b/sql/Updates/0.0.2/r213.sql new file mode 100644 index 0000000..da69998 --- /dev/null +++ b/sql/Updates/0.0.2/r213.sql @@ -0,0 +1,11 @@ +-- Zul'Gurub Part II +UPDATE `creature_template` SET `ScriptName` = "boss_hakkar" WHERE `creature_template`.`entry` = 15295; +UPDATE `creature_template` SET `ScriptName` = "boss_thekal" WHERE `creature_template`.`entry` = 14509; +UPDATE `creature_template` SET `ScriptName` = "boss_arlokk" WHERE `creature_template`.`entry` = 14515; +UPDATE `creature_template` SET `ScriptName` = "mob_zealot_lorkhan" WHERE `creature_template`.`entry` = 11347; +UPDATE `creature_template` SET `ScriptName` = "mob_zealot_zath" WHERE `creature_template`.`entry` = 11348; +UPDATE `creature_template` SET `ScriptName` = "mob_healing_ward" WHERE `creature_template`.`entry` = 14987; +UPDATE `creature_template` SET `Scriptname` = "mobs_zulgurub" WHERE `creature_template`.`entry` IN (11340 ,11352 , 11350, 11830, 11372, 11351, 14750); + + + diff --git a/sql/Updates/0.0.2/r214.sql b/sql/Updates/0.0.2/r214.sql new file mode 100644 index 0000000..d98677b --- /dev/null +++ b/sql/Updates/0.0.2/r214.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = "boss_hakkar" WHERE `creature_template`.`entry` = 14834; + diff --git a/sql/Updates/0.0.2/r215.sql b/sql/Updates/0.0.2/r215.sql new file mode 100644 index 0000000..49482bd --- /dev/null +++ b/sql/Updates/0.0.2/r215.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName` = 'item_skin_of_purest_water' WHERE `entry` = 23751; diff --git a/sql/Updates/0.0.2/r218.sql b/sql/Updates/0.0.2/r218.sql new file mode 100644 index 0000000..0f5f664 --- /dev/null +++ b/sql/Updates/0.0.2/r218.sql @@ -0,0 +1,5 @@ +-- misc quest related +UPDATE `creature_template` SET `ScriptName` = 'npc_restless_apparition' WHERE `entry` = 23861; +UPDATE `creature_template` SET `ScriptName` = 'mobs_direhorn_grimtotem' WHERE `entry` = 23595; +UPDATE `creature_template` SET `ScriptName` = 'mobs_risen_husk_spirit' WHERE `entry` IN (23554, 23555); + diff --git a/sql/Updates/0.0.2/r219.sql b/sql/Updates/0.0.2/r219.sql new file mode 100644 index 0000000..da8fe03 --- /dev/null +++ b/sql/Updates/0.0.2/r219.sql @@ -0,0 +1,3 @@ +/* Fix for Wrong ZG Update */ +UPDATE `creature_template` SET `ScriptName` = ' ' WHERE `entry` = 14607; +UPDATE `creature_template` SET `ScriptName` = ' ' WHERE `entry` = 15295; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r221_scriptdev2.sql b/sql/Updates/0.0.2/r221_scriptdev2.sql new file mode 100644 index 0000000..06cd433 --- /dev/null +++ b/sql/Updates/0.0.2/r221_scriptdev2.sql @@ -0,0 +1 @@ +ALTER TABLE `eventai_Scripts` RENAME TO `eventai_scripts`; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r227_scriptdev2.sql b/sql/Updates/0.0.2/r227_scriptdev2.sql new file mode 100644 index 0000000..e97e542 --- /dev/null +++ b/sql/Updates/0.0.2/r227_scriptdev2.sql @@ -0,0 +1,28 @@ +ALTER TABLE `eventai_scripts` + DROP PRIMARY KEY, + DROP `id`, + ADD `id` int(11) unsigned NOT NULL COMMENT 'Identifier' PRIMARY KEY AUTO_INCREMENT FIRST, + + MODIFY `event_param1` int(11) signed NOT NULL default '0', + MODIFY `event_param2` int(11) signed NOT NULL default '0', + MODIFY `event_param3` int(11) signed NOT NULL default '0', + + MODIFY `action1_param1` int(11) signed NOT NULL default '0', + MODIFY `action1_param2` int(11) signed NOT NULL default '0', + MODIFY `action1_param3` int(11) signed NOT NULL default '0', + + MODIFY `action2_param1` int(11) signed NOT NULL default '0', + MODIFY `action2_param2` int(11) signed NOT NULL default '0', + MODIFY `action2_param3` int(11) signed NOT NULL default '0', + + MODIFY `action3_param1` int(11) signed NOT NULL default '0', + MODIFY `action3_param2` int(11) signed NOT NULL default '0', + MODIFY `action3_param3` int(11) signed NOT NULL default '0', + + ADD `comment` varchar(255) NOT NULL default '' COMMENT 'Event Comment'; + +ALTER TABLE `localized_texts` + DROP PRIMARY KEY, + DROP `id`, + ADD `id` int(11) unsigned NOT NULL COMMENT 'Identifier' PRIMARY KEY AUTO_INCREMENT FIRST, + ADD `comment` varchar(255) NOT NULL default '' COMMENT 'Text Comment'; diff --git a/sql/Updates/0.0.2/r230_mangos.sql b/sql/Updates/0.0.2/r230_mangos.sql new file mode 100644 index 0000000..271c716 --- /dev/null +++ b/sql/Updates/0.0.2/r230_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_deserter_agitator' WHERE `entry` = 23602; +UPDATE `gameobject_template` SET `ScriptName` = 'go_field_repair_bot_74A' where `entry`= 179552; diff --git a/sql/Updates/0.0.2/r234_mangos.sql b/sql/Updates/0.0.2/r234_mangos.sql new file mode 100644 index 0000000..d403ec3 --- /dev/null +++ b/sql/Updates/0.0.2/r234_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_screecher_spirit' WHERE `entry` = 8612; +UPDATE `item_template` SET `ScriptName` = 'item_yehkinyas_bramble' WHERE `entry`= 10699; diff --git a/sql/Updates/0.0.2/r237_mangos.sql b/sql/Updates/0.0.2/r237_mangos.sql new file mode 100644 index 0000000..c66f7e8 --- /dev/null +++ b/sql/Updates/0.0.2/r237_mangos.sql @@ -0,0 +1,6 @@ +-- new +UPDATE `creature_template` SET `ScriptName` = 'guard_azuremyst' WHERE `entry` = 18038; +UPDATE `creature_template` SET `ScriptName` = 'guard_eversong' WHERE `entry` = 16221; +-- update +UPDATE `creature_template` SET `ScriptName` = 'guard_durotar' WHERE `entry` = 5953; +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (3210, 3211, 3213, 3214, 1736, 1739, 1737); diff --git a/sql/Updates/0.0.2/r238_mangos.sql b/sql/Updates/0.0.2/r238_mangos.sql new file mode 100644 index 0000000..16c8fa1 --- /dev/null +++ b/sql/Updates/0.0.2/r238_mangos.sql @@ -0,0 +1,2 @@ +-- revert previously bad sql +UPDATE `creature_template` SET `ScriptName` = '' WHERE `ScriptName` LIKE '%innkeeper%' AND `npcflag` & 128<>0; diff --git a/sql/Updates/0.0.2/r239_mangos.sql b/sql/Updates/0.0.2/r239_mangos.sql new file mode 100644 index 0000000..a432d23 --- /dev/null +++ b/sql/Updates/0.0.2/r239_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName` = '' WHERE `entry` = 23268; diff --git a/sql/Updates/0.0.2/r240_scriptdev2.sql b/sql/Updates/0.0.2/r240_scriptdev2.sql new file mode 100644 index 0000000..486efe9 --- /dev/null +++ b/sql/Updates/0.0.2/r240_scriptdev2.sql @@ -0,0 +1,2 @@ +ALTER TABLE `eventai_scripts` +ADD `event_inverse_phase_mask` int(11) signed NOT NULL default '0', COMMENT 'Mask which phases this event will not trigger in'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r241_mangos.sql b/sql/Updates/0.0.2/r241_mangos.sql new file mode 100644 index 0000000..b9970ef --- /dev/null +++ b/sql/Updates/0.0.2/r241_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_skyguard_handler_irena' WHERE `entry` = 23413; +UPDATE `creature_template` SET `ScriptName` = 'npc_skyguard_handler_deesak' WHERE `entry` = 23415; diff --git a/sql/Updates/0.0.2/r242_mangos.sql b/sql/Updates/0.0.2/r242_mangos.sql new file mode 100644 index 0000000..b03b4be --- /dev/null +++ b/sql/Updates/0.0.2/r242_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_zamael_lunthistle' WHERE `entry` = 8436; +UPDATE `creature_template` SET `ScriptName` = 'npc_lothos_riftwaker' WHERE `entry` = 14387; diff --git a/sql/Updates/0.0.2/r243_mangos.sql b/sql/Updates/0.0.2/r243_mangos.sql new file mode 100644 index 0000000..901214d --- /dev/null +++ b/sql/Updates/0.0.2/r243_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_marin_noggenfogger' WHERE `entry` = 7564; diff --git a/sql/Updates/0.0.2/r249_mangos.sql b/sql/Updates/0.0.2/r249_mangos.sql new file mode 100644 index 0000000..ed29c26 --- /dev/null +++ b/sql/Updates/0.0.2/r249_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_flamewaker_priest' WHERE `entry` = 11662; +UPDATE `creature_template` SET `ScriptName` = 'boss_datrohan_balnazzar' WHERE `entry` = 10812; + diff --git a/sql/Updates/0.0.2/r250_mangos.sql b/sql/Updates/0.0.2/r250_mangos.sql new file mode 100644 index 0000000..ff513a6 --- /dev/null +++ b/sql/Updates/0.0.2/r250_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_dathrohan_balnazzar' WHERE `entry` = 10812; diff --git a/sql/Updates/0.0.2/r253_mangos.sql b/sql/Updates/0.0.2/r253_mangos.sql new file mode 100644 index 0000000..424237b --- /dev/null +++ b/sql/Updates/0.0.2/r253_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName` = 'item_zezzaks_shard' WHERE `entry` = 31463; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r255_mangos.sql b/sql/Updates/0.0.2/r255_mangos.sql new file mode 100644 index 0000000..1593210 --- /dev/null +++ b/sql/Updates/0.0.2/r255_mangos.sql @@ -0,0 +1,5 @@ +UPDATE instance_template SET script = 'instance_zulaman' WHERE map = 568; +UPDATE creature_template SET scriptname='boss_janalai' WHERE entry=23578; +UPDATE creature_template SET scriptname='mob_jandalai_firebomb' WHERE entry=23920; +UPDATE creature_template SET scriptname='mob_amanishi_hatcher' WHERE entry=23818; +UPDATE creature_template SET scriptname='mob_hatchling' WHERE entry=23598; diff --git a/sql/Updates/0.0.2/r256_mangos.sql b/sql/Updates/0.0.2/r256_mangos.sql new file mode 100644 index 0000000..755d92a --- /dev/null +++ b/sql/Updates/0.0.2/r256_mangos.sql @@ -0,0 +1,35 @@ +UPDATE creature_template SET ScriptName = 'npc_tyrande_whisperwind' WHERE entry = 17948; +UPDATE creature_template SET ScriptName = 'npc_thrall' WHERE entry = 17852; +UPDATE creature_template SET ScriptName = 'npc_jaina_proudmoore' WHERE entry = 17772; + +UPDATE creature_template SET ScriptName = 'npc_akama_shade' WHERE entry = 23089; -- Akama at Shade of Akama +UPDATE creature_template SET ScriptName = 'npc_akama_illidan' WHERE entry = 22990; -- Akama at Illidan +UPDATE creature_template SET ScriptName = 'illidari_council' WHERE entry = 23426; -- Illidari Council controller mob +UPDATE creature_template SET ScriptName = 'boss_veras_darkshadow' WHERE entry = 22952; -- Rogue of Illidari Council +UPDATE creature_template SET ScriptName = 'boss_teron_gorefiend' WHERE entry = 22871; -- Teron Gorefiend +UPDATE creature_template SET ScriptName = 'boss_supremus' WHERE entry = 22898; -- Supremus +UPDATE creature_template SET ScriptName = 'boss_shade_of_akama' WHERE entry = 22841; -- Shade of Akama +UPDATE creature_template SET ScriptName = 'boss_reliquary_of_souls' WHERE entry = 22856; -- Reliquary Controller Mob +UPDATE creature_template SET ScriptName = 'boss_essence_of_suffering' WHERE entry = 23418; -- Essence Of Suffering +UPDATE creature_template SET ScriptName = 'boss_essence_of_desire' WHERE entry = 23419; -- Essence of Desire +UPDATE creature_template SET ScriptName = 'boss_essence_of_anger' WHERE entry = 23420; -- Essence of Anger +UPDATE creature_template SET ScriptName = 'boss_najentus' WHERE entry = 22887; -- High Warlord Naj'entus +UPDATE creature_template SET ScriptName = 'boss_gurtogg_bloodboil' WHERE entry = 22948; -- Gurtogg Bloodboil +UPDATE creature_template SET ScriptName = 'boss_mother_shahraz' WHERE entry = 22947; -- Mother Shahraz +UPDATE creature_template SET ScriptName = 'boss_lady_malande' WHERE entry = 22951; -- Priest <3 at Illidari Council +UPDATE creature_template SET ScriptName = 'boss_illidan_stormrage' WHERE entry = 22917; -- Illidan The Betrayer! +UPDATE creature_template SET ScriptName = 'boss_high_nethermancer_zerevor' WHERE entry = 22950; -- Mage at Illidari Council +UPDATE creature_template SET ScriptName = 'boss_gathios_the_shatterer' WHERE entry = 22949; -- Paladin at Illidari Council +UPDATE creature_template SET ScriptName = 'boss_maiev_shadowsong' WHERE entry = 23197; -- Maiev Shadowsong +UPDATE creature_template SET ScriptName = 'mob_blaze' WHERE entry = 23259; -- Blaze mob in Illidan Phase 2 +UPDATE creature_template SET ScriptName = 'mob_flame_of_azzinoth' WHERE entry = 22997; -- Flame of Azzinoth (Illidan Phase 2) +UPDATE creature_template SET ScriptName = 'mob_demon_fire' WHERE entry = 23069; -- Demon Fire in Illidan Phase 2 +UPDATE creature_template SET ScriptName = 'mob_flame_crash' WHERE entry = 23336; -- Flame Crash in Illidan Normal Form +UPDATE creature_template SET ScriptName = 'mob_cage_trap_trigger' WHERE entry = 23304; -- Cage Trap mob in Illidan Phase 3/4 Normal +UPDATE creature_template SET ScriptName = 'mob_shadow_demon' WHERE entry = 23375; -- Shadow Demon in Illidan Demon Form +UPDATE creature_template SET ScriptName = 'npc_volcano' WHERE entry = 23085; -- Supremus Volcano +UPDATE creature_template SET ScriptName = 'molten_flame' WHERE entry = 23095; -- Molten Flame in SUpremus +UPDATE creature_template SET ScriptName = 'mob_ashtongue_channeler' WHERE entry = 23421; -- Ashtongue CHanneler in Shade of AKama +UPDATE creature_template SET ScriptName = 'mob_ashtongue_sorcerer' WHERE entry = 23215; -- Ashtongue Sorcerer in Shade of Akama +UPDATE creature_template SET ScriptName = 'npc_enslaved_soul' WHERE entry = 23469; -- Enslaved Soul in Reliquary Event +-- UPDATE creature_template SET ScriptName = 'mob_najentus_spine' WHERE entry = 500000; -- Workaround creature for spine in Najentus event \ No newline at end of file diff --git a/sql/Updates/0.0.2/r257_mangos.sql b/sql/Updates/0.0.2/r257_mangos.sql new file mode 100644 index 0000000..afb569a --- /dev/null +++ b/sql/Updates/0.0.2/r257_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_archmage_malin' WHERE `entry` = 2708; +UPDATE `creature_template` SET `ScriptName` = 'npc_dashel_stonefist' WHERE `entry` = 4961; +UPDATE `creature_template` SET `ScriptName` = 'npc_doctor' WHERE `entry` IN (12939, 12920); +UPDATE `creature_template` SET `ScriptName` = 'npc_injured_patient' WHERE `entry` IN (12936, 12937, 12938, 12923, 12924, 12925); diff --git a/sql/Updates/0.0.2/r258_mangos.sql b/sql/Updates/0.0.2/r258_mangos.sql new file mode 100644 index 0000000..9535423 --- /dev/null +++ b/sql/Updates/0.0.2/r258_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_deathly_usher' WHERE `entry` = 8816; diff --git a/sql/Updates/0.0.2/r260_mangos.sql b/sql/Updates/0.0.2/r260_mangos.sql new file mode 100644 index 0000000..fdb0227 --- /dev/null +++ b/sql/Updates/0.0.2/r260_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_lady_katrana_prestor' WHERE `entry` = 1749; diff --git a/sql/Updates/0.0.2/r261_mangos.sql b/sql/Updates/0.0.2/r261_mangos.sql new file mode 100644 index 0000000..9d9ba2e --- /dev/null +++ b/sql/Updates/0.0.2/r261_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_general_marcus_jonathan' WHERE `entry` = 466; diff --git a/sql/Updates/0.0.2/r262_mangos.sql b/sql/Updates/0.0.2/r262_mangos.sql new file mode 100644 index 0000000..641eabf --- /dev/null +++ b/sql/Updates/0.0.2/r262_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_royal_historian_archesonus' WHERE `entry` = 8879; +UPDATE `creature_template` SET `ScriptName` = 'npc_bunthen_plainswind' WHERE `entry` = 11798; +UPDATE `creature_template` SET `ScriptName` = 'npc_silva_filnaveth' WHERE `entry` = 11800; diff --git a/sql/Updates/0.0.2/r263_mangos.sql b/sql/Updates/0.0.2/r263_mangos.sql new file mode 100644 index 0000000..bf94ce0 --- /dev/null +++ b/sql/Updates/0.0.2/r263_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `gameobject_template` SET `ScriptName` = 'go_northern_crystal_pylon' WHERE `entry` = 164955; +UPDATE `gameobject_template` SET `ScriptName` = 'go_western_crystal_pylon' WHERE `entry` = 164956; +UPDATE `gameobject_template` SET `ScriptName` = 'go_eastern_crystal_pylon' WHERE `entry` = 164957; diff --git a/sql/Updates/0.0.2/r264_mangos.sql b/sql/Updates/0.0.2/r264_mangos.sql new file mode 100644 index 0000000..77f72fe --- /dev/null +++ b/sql/Updates/0.0.2/r264_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_astor_hadren' WHERE `entry` = 6497; diff --git a/sql/Updates/0.0.2/r265_mangos.sql b/sql/Updates/0.0.2/r265_mangos.sql new file mode 100644 index 0000000..4ecf140 --- /dev/null +++ b/sql/Updates/0.0.2/r265_mangos.sql @@ -0,0 +1,9 @@ +UPDATE `item_template` SET `ScriptName` = 'item_nether_wraith_beacon' WHERE `entry` = 31742; +UPDATE `item_template` SET `ScriptName` = 'item_area_52_special' WHERE `entry` = 28132; +UPDATE `item_template` SET `ScriptName` = 'item_vorenthals_presence' WHERE `entry` = 30259; +UPDATE `item_template` SET `ScriptName` = 'item_draenei_fishing_net' WHERE `entry` = 23654; +UPDATE `item_template` SET `ScriptName` = 'item_skin_of_purest_water' WHERE `entry` = 23751; +UPDATE `item_template` SET `ScriptName` = 'item_yehkinyas_bramble' WHERE `entry` = 10699; +UPDATE `item_template` SET `ScriptName` = 'item_zezzaks_shard' WHERE `entry` = 31463; +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (40100,40101,40102,40103,40104,40105,40106,40107,40108,40109,40110,40111,40112,40113); +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (40200,40201,40202,40203,40204,40205,40206,40207,40208,40209,40210,40211,40212,40213); diff --git a/sql/Updates/0.0.2/r269_mangos.sql b/sql/Updates/0.0.2/r269_mangos.sql new file mode 100644 index 0000000..0683e31 --- /dev/null +++ b/sql/Updates/0.0.2/r269_mangos.sql @@ -0,0 +1,6 @@ +-- removing old script names that does no longer exist +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (12198,14982,857,12197,7427,347,15007,2804); +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (9564,12136,3149,12137,9566,3150,9559,9558); +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` = 197; +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (11328, 11260); +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (80, 1236, 3578, 40, 1358, 1360, 5996, 1426, 1094, 674); diff --git a/sql/Updates/0.0.2/r270_mangos.sql b/sql/Updates/0.0.2/r270_mangos.sql new file mode 100644 index 0000000..6d30ec7 --- /dev/null +++ b/sql/Updates/0.0.2/r270_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_overseer_nuaar' WHERE `entry` = 21981; diff --git a/sql/Updates/0.0.2/r271_mangos.sql b/sql/Updates/0.0.2/r271_mangos.sql new file mode 100644 index 0000000..ff2f1c1 --- /dev/null +++ b/sql/Updates/0.0.2/r271_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_greatmother_geyah' WHERE `entry` = 18141; diff --git a/sql/Updates/0.0.2/r272_mangos.sql b/sql/Updates/0.0.2/r272_mangos.sql new file mode 100644 index 0000000..81a8365 --- /dev/null +++ b/sql/Updates/0.0.2/r272_mangos.sql @@ -0,0 +1,8 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_kaelthas' WHERE `entry` = 23054; +UPDATE `creature_template` SET `ScriptName` = 'boss_thaladred_the_darkener' WHERE `entry` = 20064; +UPDATE `creature_template` SET `ScriptName` = 'boss_lord_sanguinar' WHERE `entry` = 20060; +UPDATE `creature_template` SET `ScriptName` = 'boss_grand_astromancer_capernian' WHERE `entry` = 20062; +UPDATE `creature_template` SET `ScriptName` = 'boss_master_engineer_telonicus' WHERE `entry` = 20063; +UPDATE `creature_template` SET `ScriptName` = 'mob_phoenix' WHERE `entry` = 21362; +UPDATE `creature_template` SET `ScriptName` = 'mob_nether_vapor' WHERE `entry` = 21002; +UPDATE `creature_template` SET `ScriptName` = 'mob_kael_flamestrike' WHERE `entry` = 21369; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r273_mangos.sql b/sql/Updates/0.0.2/r273_mangos.sql new file mode 100644 index 0000000..9639dc1 --- /dev/null +++ b/sql/Updates/0.0.2/r273_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_saikkal_the_elder' WHERE `entry` = 22932; diff --git a/sql/Updates/0.0.2/r274_mangos.sql b/sql/Updates/0.0.2/r274_mangos.sql new file mode 100644 index 0000000..6174d4c --- /dev/null +++ b/sql/Updates/0.0.2/r274_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_blackwing_lair' WHERE `entry` = 12557; diff --git a/sql/Updates/0.0.2/r275_mangos.sql b/sql/Updates/0.0.2/r275_mangos.sql new file mode 100644 index 0000000..1a4ad51 --- /dev/null +++ b/sql/Updates/0.0.2/r275_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_shade_of_jindo' WHERE `entry` = 14986; diff --git a/sql/Updates/0.0.2/r281_scriptdev2.sql b/sql/Updates/0.0.2/r281_scriptdev2.sql new file mode 100644 index 0000000..a519571 --- /dev/null +++ b/sql/Updates/0.0.2/r281_scriptdev2.sql @@ -0,0 +1,35 @@ +ALTER TABLE eventai_scripts +ADD event_chance tinyint(3) unsigned NOT NULL default 100 AFTER event_inverse_phase_mask; + +-- EVENT_T_TIMER_REPEAT +UPDATE eventai_scripts SET event_chance = -event_param3 WHERE event_type = 0 AND event_param3 < 0; + +-- EVENT_T_TIMER_SINGLE +UPDATE eventai_scripts SET event_chance = event_param2 WHERE event_type = 1; + +-- EVENT_T_TIMER_OOC_REPEAT +UPDATE eventai_scripts SET event_chance = -event_param3 WHERE event_type = 2 AND event_param3 < 0; + +-- EVENT_T_TIMER_OOC_SINGLE +UPDATE eventai_scripts SET event_chance = event_param2 WHERE event_type = 3; + +-- EVENT_T_HP_SINGLE +UPDATE eventai_scripts SET event_chance = -event_param3 WHERE event_type = 4 AND event_param3 < 0; + +-- EVENT_T_MANA_SINGLE +UPDATE eventai_scripts SET event_chance = -event_param3 WHERE event_type = 5 AND event_param3 < 0; + +-- EVENT_T_AGGRO +UPDATE eventai_scripts SET event_chance = event_param1 WHERE event_type = 6; + +-- EVENT_T_KILL +UPDATE eventai_scripts SET event_chance = event_param2 WHERE event_type = 7; + +-- EVENT_T_DEATH +UPDATE eventai_scripts SET event_chance = event_param1 WHERE event_type = 8; + +-- EVENT_T_EVADE +UPDATE eventai_scripts SET event_chance = event_param1 WHERE event_type = 9; + +-- EVENT_T_SPELLHIT +UPDATE eventai_scripts SET event_chance = event_param3 WHERE event_type = 10; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r282_mangos.sql b/sql/Updates/0.0.2/r282_mangos.sql new file mode 100644 index 0000000..c1e86f2 --- /dev/null +++ b/sql/Updates/0.0.2/r282_mangos.sql @@ -0,0 +1,38 @@ +UPDATE creature_template SET ScriptName = 'npc_tyrande_whisperwind' WHERE entry = 17948; +UPDATE creature_template SET ScriptName = 'npc_thrall' WHERE entry = 17852; +UPDATE creature_template SET ScriptName = 'npc_jaina_proudmoore' WHERE entry = 17772; + +UPDATE creature_template SET ScriptName = 'npc_akama_shade' WHERE entry = 23089; -- Akama at Shade of Akama +UPDATE creature_template SET ScriptName = 'npc_akama_illidan' WHERE entry = 22990; -- Akama at Illidan +UPDATE creature_template SET ScriptName = 'illidari_council' WHERE entry = 23426; -- Illidari Council controller mob +UPDATE creature_template SET ScriptName = 'boss_veras_darkshadow' WHERE entry = 22952; -- Rogue of Illidari Council +UPDATE creature_template SET ScriptName = 'boss_teron_gorefiend' WHERE entry = 22871; -- Teron Gorefiend +UPDATE creature_template SET ScriptName = 'boss_supremus' WHERE entry = 22898; -- Supremus +UPDATE creature_template SET ScriptName = 'boss_shade_of_akama' WHERE entry = 22841; -- Shade of Akama +UPDATE creature_template SET ScriptName = 'boss_reliquary_of_souls' WHERE entry = 22856; -- Reliquary Controller Mob +UPDATE creature_template SET ScriptName = 'boss_essence_of_suffering' WHERE entry = 23418; -- Essence Of Suffering +UPDATE creature_template SET ScriptName = 'boss_essence_of_desire' WHERE entry = 23419; -- Essence of Desire +UPDATE creature_template SET ScriptName = 'boss_essence_of_anger' WHERE entry = 23420; -- Essence of Anger +UPDATE creature_template SET ScriptName = 'boss_najentus' WHERE entry = 22887; -- High Warlord Naj'entus +UPDATE creature_template SET ScriptName = 'boss_gurtogg_bloodboil' WHERE entry = 22948; -- Gurtogg Bloodboil +UPDATE creature_template SET ScriptName = 'boss_mother_shahraz' WHERE entry = 22947; -- Mother Shahraz +UPDATE creature_template SET ScriptName = 'boss_lady_malande' WHERE entry = 22951; -- Priest <3 at Illidari Council +UPDATE creature_template SET ScriptName = 'boss_illidan_stormrage' WHERE entry = 22917; -- Illidan The Betrayer! +UPDATE creature_template SET ScriptName = 'boss_high_nethermancer_zerevor' WHERE entry = 22950; -- Mage at Illidari Council +UPDATE creature_template SET ScriptName = 'boss_gathios_the_shatterer' WHERE entry = 22949; -- Paladin at Illidari Council +UPDATE creature_template SET ScriptName = 'boss_maiev_shadowsong' WHERE entry = 23197; -- Maiev Shadowsong +UPDATE creature_template SET ScriptName = 'mob_blaze' WHERE entry = 23259; -- Blaze mob in Illidan Phase 2 +UPDATE creature_template SET ScriptName = 'mob_flame_of_azzinoth' WHERE entry = 22997; -- Flame of Azzinoth (Illidan Phase 2) +UPDATE creature_template SET ScriptName = 'mob_blade_of_azzinoth' WHERE entry = 22996; -- Blade of Azzinoth (Illidan Phase 2) +UPDATE creature_template SET ScriptName = 'mob_demon_fire' WHERE entry = 23069; -- Demon Fire in Illidan Phase 2 +UPDATE creature_template SET ScriptName = 'mob_flame_crash' WHERE entry = 23336; -- Flame Crash in Illidan Normal Form +UPDATE creature_template SET ScriptName = 'mob_cage_trap_trigger' WHERE entry = 23304; -- Cage Trap mob in Illidan Phase 3/4 Normal +UPDATE creature_template SET ScriptName = 'mob_shadow_demon' WHERE entry = 23375; -- Shadow Demon in Illidan Demon Form +UPDATE creature_template SET ScriptName = 'npc_volcano' WHERE entry = 23085; -- Supremus Volcano +UPDATE creature_template SET ScriptName = 'molten_flame' WHERE entry = 23095; -- Molten Flame in SUpremus +UPDATE creature_template SET ScriptName = 'mob_ashtongue_channeler' WHERE entry = 23421; -- Ashtongue CHanneler in Shade of AKama +UPDATE creature_template SET ScriptName = 'mob_ashtongue_sorcerer' WHERE entry = 23215; -- Ashtongue Sorcerer in Shade of Akama +UPDATE creature_template SET ScriptName = 'npc_enslaved_soul' WHERE entry = 23469; -- Enslaved Soul in Reliquary Event +UPDATE creature_template SET ScriptName = 'mob_doom_blossom' WHERE entry = 23123; -- Doom Blossoms in Teron Gorefiend's encounter +-- UPDATE creature_template sET ScriptName = 'mob_shadowy_construct' WHERE entry = 23111; -- Shadowy Construct in Teron Gorefiend's encounter. Commented until Mind Control is implemented. +-- UPDATE creature_template SET ScriptName = 'mob_najentus_spine' WHERE entry = 500000; -- Workaround creature for spine in Najentus event diff --git a/sql/Updates/0.0.2/r286_mangos.sql b/sql/Updates/0.0.2/r286_mangos.sql new file mode 100644 index 0000000..6db455a --- /dev/null +++ b/sql/Updates/0.0.2/r286_mangos.sql @@ -0,0 +1,2 @@ +-- Items +UPDATE `item_template` SET `ScriptName` = '' WHERE `entry` = 23751; -- Remove script for Skin of Purest Water \ No newline at end of file diff --git a/sql/Updates/0.0.2/r289_mangos.sql b/sql/Updates/0.0.2/r289_mangos.sql new file mode 100644 index 0000000..48e08eb --- /dev/null +++ b/sql/Updates/0.0.2/r289_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `scriptname` = 'npc_creditmarker_visit_with_ancestors' WHERE `entry` IN (18840,18841,18842,18843); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r291_mangos.sql b/sql/Updates/0.0.2/r291_mangos.sql new file mode 100644 index 0000000..a85fb7b --- /dev/null +++ b/sql/Updates/0.0.2/r291_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_spawn_of_fankriss' WHERE `entry` = 15630; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r295_mangos.sql b/sql/Updates/0.0.2/r295_mangos.sql new file mode 100644 index 0000000..0bf8ae9 --- /dev/null +++ b/sql/Updates/0.0.2/r295_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `instance_template` SET `script` = 'instance_stratholme' WHERE `map` = 329; +UPDATE `creature_template` SET `ScriptName` = 'boss_silver_hand_bosses' WHERE `entry` IN (17910, 17911, 17912, 17913, 17914); diff --git a/sql/Updates/0.0.2/r297_mangos.sql b/sql/Updates/0.0.2/r297_mangos.sql new file mode 100644 index 0000000..341a783 --- /dev/null +++ b/sql/Updates/0.0.2/r297_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_berthold' WHERE `entry` = 16153; diff --git a/sql/Updates/0.0.2/r298_scriptdev2.sql b/sql/Updates/0.0.2/r298_scriptdev2.sql new file mode 100644 index 0000000..f80db72 --- /dev/null +++ b/sql/Updates/0.0.2/r298_scriptdev2.sql @@ -0,0 +1,2 @@ +-- EVENT_T_SPELLHIT +UPDATE eventai_scripts SET event_param3 = event_param2, event_param2 = -1 WHERE event_type = 10; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r299_scriptdev2.sql b/sql/Updates/0.0.2/r299_scriptdev2.sql new file mode 100644 index 0000000..acd78e0 --- /dev/null +++ b/sql/Updates/0.0.2/r299_scriptdev2.sql @@ -0,0 +1,9 @@ +CREATE TABLE `eventai_summons` ( +`id` int(11) unsigned NOT NULL COMMENT 'Location Identifier' AUTO_INCREMENT, +`position_x` float NOT NULL default '0', +`position_y` float NOT NULL default '0', +`position_z` float NOT NULL default '0', +`orientation` float NOT NULL default '0', +`spawntimesecs` int(11) unsigned NOT NULL default '120', +PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='EventAI Summoning Locations'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r304_mangos.sql b/sql/Updates/0.0.2/r304_mangos.sql new file mode 100644 index 0000000..314ca8a --- /dev/null +++ b/sql/Updates/0.0.2/r304_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (15440, 15612); diff --git a/sql/Updates/0.0.2/r306_scriptdev2.sql b/sql/Updates/0.0.2/r306_scriptdev2.sql new file mode 100644 index 0000000..139c006 --- /dev/null +++ b/sql/Updates/0.0.2/r306_scriptdev2.sql @@ -0,0 +1,4 @@ +DROP TABLE IF EXISTS `db_version`; +CREATE TABLE `db_version` ( +`version` varchar(255) NOT NULL default '' COMMENT 'Database version string' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r307_mangos.sql b/sql/Updates/0.0.2/r307_mangos.sql new file mode 100644 index 0000000..2bf9847 --- /dev/null +++ b/sql/Updates/0.0.2/r307_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName` = 'npcs_dithers_and_arbington' WHERE `entry` IN (11056, 11057); +UPDATE `creature_template` SET `ScriptName` = 'npc_witch_doctor_mauari' WHERE `entry` = 10307; +UPDATE `creature_template` SET `ScriptName` = 'npcs_riverbreeze_and_silversky' WHERE `entry` IN (9528, 9529); +UPDATE `creature_template` SET `ScriptName` = 'npc_sayge' WHERE `entry` = 14822; diff --git a/sql/Updates/0.0.2/r308_mangos.sql b/sql/Updates/0.0.2/r308_mangos.sql new file mode 100644 index 0000000..8d37228 --- /dev/null +++ b/sql/Updates/0.0.2/r308_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_nat_pagle' WHERE `entry` = 12919; diff --git a/sql/Updates/0.0.2/r309_mangos.sql b/sql/Updates/0.0.2/r309_mangos.sql new file mode 100644 index 0000000..d109534 --- /dev/null +++ b/sql/Updates/0.0.2/r309_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_webbed_creature' WHERE `entry` = 17680; diff --git a/sql/Updates/0.0.2/r311_mangos.sql b/sql/Updates/0.0.2/r311_mangos.sql new file mode 100644 index 0000000..55afeea --- /dev/null +++ b/sql/Updates/0.0.2/r311_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_invis_legion_teleporter' WHERE `entry` = 21807; diff --git a/sql/Updates/0.0.2/r312_mangos.sql b/sql/Updates/0.0.2/r312_mangos.sql new file mode 100644 index 0000000..037d18e --- /dev/null +++ b/sql/Updates/0.0.2/r312_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_captured_sunhawk_agent' WHERE `entry` = 17824; +UPDATE `creature_template` SET `ScriptName` = 'npc_neltharaku' WHERE `entry` = 21657; diff --git a/sql/Updates/0.0.2/r318_mangos.sql b/sql/Updates/0.0.2/r318_mangos.sql new file mode 100644 index 0000000..b1a090b --- /dev/null +++ b/sql/Updates/0.0.2/r318_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npcs_flanis_swiftwing_and_kagrosh' WHERE `entry` IN (21725, 21727); diff --git a/sql/Updates/0.0.2/r324_mangos.sql b/sql/Updates/0.0.2/r324_mangos.sql new file mode 100644 index 0000000..fcd2d55 --- /dev/null +++ b/sql/Updates/0.0.2/r324_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_mortog_steamhead' WHERE `entry` = 23373; +UPDATE `creature_template` SET `ScriptName` = 'npc_veronia' WHERE `entry` = 20162; +UPDATE `creature_template` SET `ScriptName` = 'npc_susurrus' WHERE `entry` = 17435; diff --git a/sql/Updates/0.0.2/r327_mangos.sql b/sql/Updates/0.0.2/r327_mangos.sql new file mode 100644 index 0000000..7242b63 --- /dev/null +++ b/sql/Updates/0.0.2/r327_mangos.sql @@ -0,0 +1,5 @@ +-- Sunspring Villagers. +UPDATE `creature_template` SET `ScriptName` = 'mob_sunspring_villager' WHERE `entry` = 18240; + +-- Terestian Illhoof +UPDATE `creature_template` SET `ScriptName` = 'mob_demon_chain' WHERE `entry` = 17248; diff --git a/sql/Updates/0.0.2/r332_scriptdev2.sql b/sql/Updates/0.0.2/r332_scriptdev2.sql new file mode 100644 index 0000000..ea312bb --- /dev/null +++ b/sql/Updates/0.0.2/r332_scriptdev2.sql @@ -0,0 +1,2 @@ +ALTER TABLE eventai_summons +ADD `comment` varchar(255) NOT NULL default '' COMMENT 'Summon Comment' AFTER spawntimesecs; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r333_mangos.sql b/sql/Updates/0.0.2/r333_mangos.sql new file mode 100644 index 0000000..14c4a5e --- /dev/null +++ b/sql/Updates/0.0.2/r333_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_oronok_tornheart' WHERE `entry` = 21183; diff --git a/sql/Updates/0.0.2/r334_mangos.sql b/sql/Updates/0.0.2/r334_mangos.sql new file mode 100644 index 0000000..9a74239 --- /dev/null +++ b/sql/Updates/0.0.2/r334_mangos.sql @@ -0,0 +1 @@ +UPDATE `instance_template` SET `script` = 'instance_sethekk_halls' WHERE `map` = 556; diff --git a/sql/Updates/0.0.2/r336_mangos.sql b/sql/Updates/0.0.2/r336_mangos.sql new file mode 100644 index 0000000..2d2b483 --- /dev/null +++ b/sql/Updates/0.0.2/r336_mangos.sql @@ -0,0 +1,9 @@ +UPDATE `gameobject_template` SET `ScriptName` = 'go_tablet_of_madness' WHERE `entry` = 180368; +UPDATE `creature_template` SET `ScriptName` = 'boss_grilek' WHERE `entry` = 15082; +UPDATE `creature_template` SET `ScriptName` = 'boss_hazzarah' WHERE `entry` = 15083; +UPDATE `creature_template` SET `ScriptName` = 'boss_renataki' WHERE `entry` = 15084; +UPDATE `creature_template` SET `ScriptName` = 'boss_wushoolay' WHERE `entry` = 15085; +UPDATE `creature_template` SET `ScriptName` = 'mobs_zulgurub' WHERE `entry` = 14883; +UPDATE `creature_template` SET `ScriptName` = 'mob_blackwing_lair' WHERE `entry` = 12468; + + diff --git a/sql/Updates/0.0.2/r352_mangos.sql b/sql/Updates/0.0.2/r352_mangos.sql new file mode 100644 index 0000000..ad3558e --- /dev/null +++ b/sql/Updates/0.0.2/r352_mangos.sql @@ -0,0 +1,23 @@ +-- Moroes +update creature_template set scriptname = "boss_moroes" where entry = 15687; +update creature_template set scriptname = "boss_baroness_dorothea_millstipe" where entry = 19875; +update creature_template set scriptname = "boss_baron_rafe_dreuger" where entry = 19874; +update creature_template set scriptname = "boss_lady_catriona_von_indi" where entry = 19872; +update creature_template set scriptname = "boss_lady_keira_berrybuck" where entry = 17007; +update creature_template set scriptname = "boss_lord_robin_daris" where entry = 19876; +update creature_template set scriptname = "boss_lord_crispin_ference" where entry = 19873; + +-- Barnes +update creature_template set scriptname = "npc_barnes" where entry = 16812; +-- Oz Event +update creature_template set scriptname = "boss_dorothee" where entry = 17535; +update creature_template set scriptname = "boss_strawman" where entry = 17543; +update creature_template set scriptname = "boss_tinhead" where entry = 17547; +update creature_template set scriptname = "boss_roar" where entry = 17546; +update creature_template set scriptname = "boss_crone" where entry = 18168; +-- Hood Event +update creature_template set scriptname = "npc_grandmother" where entry = 17603; +update creature_template set scriptname = "boss_bigbadwolf" where entry = 17521; +-- Romeo and Juliet disabled for now +-- update creature_template set scriptname = "boss_julianne" where entry = 17543; +-- update creature_template set scriptname = "boss_romulo" where entry = 17533; diff --git a/sql/Updates/0.0.2/r355_mangos.sql b/sql/Updates/0.0.2/r355_mangos.sql new file mode 100644 index 0000000..ad3558e --- /dev/null +++ b/sql/Updates/0.0.2/r355_mangos.sql @@ -0,0 +1,23 @@ +-- Moroes +update creature_template set scriptname = "boss_moroes" where entry = 15687; +update creature_template set scriptname = "boss_baroness_dorothea_millstipe" where entry = 19875; +update creature_template set scriptname = "boss_baron_rafe_dreuger" where entry = 19874; +update creature_template set scriptname = "boss_lady_catriona_von_indi" where entry = 19872; +update creature_template set scriptname = "boss_lady_keira_berrybuck" where entry = 17007; +update creature_template set scriptname = "boss_lord_robin_daris" where entry = 19876; +update creature_template set scriptname = "boss_lord_crispin_ference" where entry = 19873; + +-- Barnes +update creature_template set scriptname = "npc_barnes" where entry = 16812; +-- Oz Event +update creature_template set scriptname = "boss_dorothee" where entry = 17535; +update creature_template set scriptname = "boss_strawman" where entry = 17543; +update creature_template set scriptname = "boss_tinhead" where entry = 17547; +update creature_template set scriptname = "boss_roar" where entry = 17546; +update creature_template set scriptname = "boss_crone" where entry = 18168; +-- Hood Event +update creature_template set scriptname = "npc_grandmother" where entry = 17603; +update creature_template set scriptname = "boss_bigbadwolf" where entry = 17521; +-- Romeo and Juliet disabled for now +-- update creature_template set scriptname = "boss_julianne" where entry = 17543; +-- update creature_template set scriptname = "boss_romulo" where entry = 17533; diff --git a/sql/Updates/0.0.2/r358_mangos.sql b/sql/Updates/0.0.2/r358_mangos.sql new file mode 100644 index 0000000..01db373 --- /dev/null +++ b/sql/Updates/0.0.2/r358_mangos.sql @@ -0,0 +1 @@ +update creature_template set scriptname = "mob_cyclone" where entry = 18412; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r364_mangos.sql b/sql/Updates/0.0.2/r364_mangos.sql new file mode 100644 index 0000000..fe8e726 --- /dev/null +++ b/sql/Updates/0.0.2/r364_mangos.sql @@ -0,0 +1,7 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_ayren_cloudbreaker' WHERE `entry` = 25059; +UPDATE `creature_template` SET `ScriptName` = 'npc_unrestrained_dragonhawk' WHERE `entry` = 25236; +UPDATE `creature_template` SET `ScriptName` = 'npc_sputtervalve' WHERE `entry` = 3442; +UPDATE `creature_template` SET `ScriptName` = 'npc_budd_nedreck' WHERE `entry` = 23559; +UPDATE `creature_template` SET `ScriptName` = 'npc_blood_knight_dawnstar' WHERE `entry` = 17832; +UPDATE `creature_template` SET `ScriptName` = 'npc_stone_watcher_of_norgannon' WHERE `entry` = 7918; +UPDATE `creature_template` SET `ScriptName` = 'npc_lore_keeper_of_norgannon' WHERE `entry` = 7172; diff --git a/sql/Updates/0.0.2/r367_mangos.sql b/sql/Updates/0.0.2/r367_mangos.sql new file mode 100644 index 0000000..0df91eb --- /dev/null +++ b/sql/Updates/0.0.2/r367_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'mob_aquementas' WHERE `entry` = 9453; diff --git a/sql/Updates/0.0.2/r368_mangos.sql b/sql/Updates/0.0.2/r368_mangos.sql new file mode 100644 index 0000000..1e61aa3 --- /dev/null +++ b/sql/Updates/0.0.2/r368_mangos.sql @@ -0,0 +1,5 @@ +UPDATE `instance_template` SET `script` = 'instance_shadowfang_keep' WHERE `map` = 33; +UPDATE `creature_template` SET `ScriptName` = 'boss_fenrus' WHERE `entry` = 4274; +UPDATE `creature_template` SET `ScriptName` = 'boss_nandos' WHERE `entry` = 3927; +UPDATE `creature_template` SET `ScriptName` = 'boss_rethilgore' WHERE `entry` = 3914; +UPDATE `creature_template` SET `ScriptName` = 'npc_shadowfang_prisoner' WHERE `entry` IN (3849, 3850); diff --git a/sql/Updates/0.0.2/r369_mangos.sql b/sql/Updates/0.0.2/r369_mangos.sql new file mode 100644 index 0000000..b34e717 --- /dev/null +++ b/sql/Updates/0.0.2/r369_mangos.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_rage_winterchill' WHERE `entry` = 17767; +UPDATE `creature_template` SET `ScriptName` = 'boss_anetheron' WHERE `entry` = 17808; +UPDATE `creature_template` SET `ScriptName` = 'boss_kazrogal' WHERE `entry` = 17888; +UPDATE `creature_template` SET `ScriptName` = 'boss_azgalor' WHERE `entry` = 17842; +UPDATE `creature_template` SET `ScriptName` = 'mob_echo_of_archimonde' WHERE `entry` = 13083; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r374_mangos.sql b/sql/Updates/0.0.2/r374_mangos.sql new file mode 100644 index 0000000..edac04d --- /dev/null +++ b/sql/Updates/0.0.2/r374_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_the_scourge_cauldron' WHERE `entry` = 11152; diff --git a/sql/Updates/0.0.2/r386_mangos.sql b/sql/Updates/0.0.2/r386_mangos.sql new file mode 100644 index 0000000..1c4768f --- /dev/null +++ b/sql/Updates/0.0.2/r386_mangos.sql @@ -0,0 +1,7 @@ +UPDATE `item_template` SET `ScriptName` = 'item_Sparrowhawk_Net' WHERE `entry` = 32321; +UPDATE `item_template` SET `ScriptName` = 'item_Blackwhelp_Net' WHERE `entry` = 31129; + +UPDATE `creature_template` SET `ScriptName` = 'npc_spirit_of_olum' WHERE `entry` = 23411; + +UPDATE creature_template SET ScriptName='boss_warp_splinter' WHERE entry='17977'; +UPDATE creature_template SET ScriptName='mob_warp_splinter_treant' WHERE entry='19949'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r417_mangos.sql b/sql/Updates/0.0.2/r417_mangos.sql new file mode 100644 index 0000000..2125b2d --- /dev/null +++ b/sql/Updates/0.0.2/r417_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName` = 'item_tame_beast_rods' WHERE `entry` IN (15908,15911,15913,15914,15915,15916,15917,15919,15920,15921,15922,15923,23697,23702,23703,23896,23897,23898); diff --git a/sql/Updates/0.0.2/r428_mangos.sql b/sql/Updates/0.0.2/r428_mangos.sql new file mode 100644 index 0000000..e8cfb1f --- /dev/null +++ b/sql/Updates/0.0.2/r428_mangos.sql @@ -0,0 +1,4 @@ +-- Quest Support 10804 (Kindness) +UPDATE creature_template SET scriptname = 'mob_mature_netherwing_drake' WHERE entry = 21648; +-- Quest Support 10854 (The Force of Neltharaku) +UPDATE creature_template SET scriptname = 'mob_enslaved_netherwing_drake' WHERE entry = 21722; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r431_mangos.sql b/sql/Updates/0.0.2/r431_mangos.sql new file mode 100644 index 0000000..bb800fd --- /dev/null +++ b/sql/Updates/0.0.2/r431_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName`='npc_zephyr' WHERE `entry`=25967; +UPDATE `instance_template` SET `script`='instance_old_hillsbrad' WHERE `map`=560; +UPDATE `creature_template` SET `ScriptName`='npc_brazen' WHERE `entry`=18725; +UPDATE `creature_template` SET `ScriptName`='npc_erozion' WHERE `entry`=18723; diff --git a/sql/Updates/0.0.2/r444_mangos.sql b/sql/Updates/0.0.2/r444_mangos.sql new file mode 100644 index 0000000..4eb2685 --- /dev/null +++ b/sql/Updates/0.0.2/r444_mangos.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=22120; +UPDATE `creature_template` SET `ScriptName`='mob_fathom_sporebat' WHERE `entry`=22140; +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=20318; +UPDATE `creature_template` SET `ScriptName`='mob_eventai' WHERE `entry` IN (3927,3914,4274); +UPDATE `creature_template` SET `ScriptName`='mob_eventai' WHERE `entry` IN (21717,21718,21719,21720,22331,21878,21879,18371,18343,13083,17808); diff --git a/sql/Updates/0.0.2/r445_mangos.sql b/sql/Updates/0.0.2/r445_mangos.sql new file mode 100644 index 0000000..cc581e1 --- /dev/null +++ b/sql/Updates/0.0.2/r445_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='boss_high_astromancer_solarian' WHERE `entry`=18805; +UPDATE `creature_template` SET `ScriptName`='mob_solarium_priest' WHERE `entry`=18806; diff --git a/sql/Updates/0.0.2/r446_mangos.sql b/sql/Updates/0.0.2/r446_mangos.sql new file mode 100644 index 0000000..acd11fa --- /dev/null +++ b/sql/Updates/0.0.2/r446_mangos.sql @@ -0,0 +1,2 @@ +-- Set ACID (mob_eventai) ScriptName for 4 Hyjal-wave bosses +UPDATE `creature_template` SET `ScriptName` = 'mob_eventai' WHERE `entry` IN (17767, 17808, 17888, 17842); diff --git a/sql/Updates/0.0.2/r448_scriptdev2.sql b/sql/Updates/0.0.2/r448_scriptdev2.sql new file mode 100644 index 0000000..705543d --- /dev/null +++ b/sql/Updates/0.0.2/r448_scriptdev2.sql @@ -0,0 +1,5 @@ +DROP TABLE IF EXISTS `db_version`; +DROP TABLE IF EXISTS `sd2_db_version`; +CREATE TABLE `sd2_db_version` ( +`version` varchar(255) NOT NULL default '' COMMENT 'Database version string' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r462_mangos.sql b/sql/Updates/0.0.2/r462_mangos.sql new file mode 100644 index 0000000..d78f770 --- /dev/null +++ b/sql/Updates/0.0.2/r462_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_taretha' WHERE `entry`=18887; +UPDATE `creature_template` SET `ScriptName`='npc_thrall_old_hillsbrad' WHERE `entry`=17876; diff --git a/sql/Updates/0.0.2/r465_mangos.sql b/sql/Updates/0.0.2/r465_mangos.sql new file mode 100644 index 0000000..b755e73 --- /dev/null +++ b/sql/Updates/0.0.2/r465_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='boss_harbinger_skyriss' WHERE `entry`=20912; +UPDATE `creature_template` SET `ScriptName`='npc_warden_mellichar' WHERE `entry`=20904; +UPDATE `creature_template` SET `ScriptName`='npc_millhouse_manastorm' WHERE `entry`=20977; diff --git a/sql/Updates/0.0.2/r467_mangos.sql b/sql/Updates/0.0.2/r467_mangos.sql new file mode 100644 index 0000000..c0a2e95 --- /dev/null +++ b/sql/Updates/0.0.2/r467_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName`='item_flying_machine' WHERE `entry` IN (34060,34061); diff --git a/sql/Updates/0.0.2/r473_mangos.sql b/sql/Updates/0.0.2/r473_mangos.sql new file mode 100644 index 0000000..c3c25b7 --- /dev/null +++ b/sql/Updates/0.0.2/r473_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `item_template` SET `ScriptName`='item_soul_cannon' WHERE `entry`=32825; +UPDATE `item_template` SET `ScriptName`='item_sparrowhawk_net' WHERE `entry`=32321; +UPDATE `item_template` SET `ScriptName`='item_blackwhelp_net' WHERE `entry`=31129; diff --git a/sql/Updates/0.0.2/r476_mangos.sql b/sql/Updates/0.0.2/r476_mangos.sql new file mode 100644 index 0000000..74afef9 --- /dev/null +++ b/sql/Updates/0.0.2/r476_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_engineer_spark_overgrind' WHERE `entry`=17243; diff --git a/sql/Updates/0.0.2/r477_mangos.sql b/sql/Updates/0.0.2/r477_mangos.sql new file mode 100644 index 0000000..351b5e6 --- /dev/null +++ b/sql/Updates/0.0.2/r477_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=19577; diff --git a/sql/Updates/0.0.2/r479_mangos.sql b/sql/Updates/0.0.2/r479_mangos.sql new file mode 100644 index 0000000..60e530a --- /dev/null +++ b/sql/Updates/0.0.2/r479_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_chicken_cluck' WHERE `entry`=620; diff --git a/sql/Updates/0.0.2/r482_mangos.sql b/sql/Updates/0.0.2/r482_mangos.sql new file mode 100644 index 0000000..5a96575 --- /dev/null +++ b/sql/Updates/0.0.2/r482_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_dancing_flames' WHERE `entry`=25305; diff --git a/sql/Updates/0.0.2/r484_mangos.sql b/sql/Updates/0.0.2/r484_mangos.sql new file mode 100644 index 0000000..6c7a884 --- /dev/null +++ b/sql/Updates/0.0.2/r484_mangos.sql @@ -0,0 +1,8 @@ +-- Quest support 9678 +UPDATE `gameobject_template` SET `ScriptName`='go_gilded_brazier' WHERE `entry` = '181956'; + +-- Archimonde with related creatures. +UPDATE `creature_template` SET `Scriptname` = "boss_archimonde" WHERE `entry` = 17968; +UPDATE `creature_template` SET `ScriptName` = "mob_doomfire" WHERE `entry` = 18095; +UPDATE `creature_template` SET `Scriptname` = "mob_doomfire_targetting" WHERE `entry` = 18104; +UPDATE `creature_template` SET `ScriptName` = "mob_ancient_wisp" WHERE `entry` = 17946; diff --git a/sql/Updates/0.0.2/r486_mangos.sql b/sql/Updates/0.0.2/r486_mangos.sql new file mode 100644 index 0000000..a6d7f80 --- /dev/null +++ b/sql/Updates/0.0.2/r486_mangos.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='' WHERE `entry`=181956; diff --git a/sql/Updates/0.0.2/r487_mangos.sql b/sql/Updates/0.0.2/r487_mangos.sql new file mode 100644 index 0000000..ba7c52f --- /dev/null +++ b/sql/Updates/0.0.2/r487_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_prospector_anvilward' WHERE `entry`=15420; diff --git a/sql/Updates/0.0.2/r494_mangos.sql b/sql/Updates/0.0.2/r494_mangos.sql new file mode 100644 index 0000000..ab38861 --- /dev/null +++ b/sql/Updates/0.0.2/r494_mangos.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName` = 'gameobject_cage_trap' WHERE `entry` = 185916; diff --git a/sql/Updates/0.0.2/r501_mangos.sql b/sql/Updates/0.0.2/r501_mangos.sql new file mode 100644 index 0000000..f3851cc --- /dev/null +++ b/sql/Updates/0.0.2/r501_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName`='npc_prof_alchemy' WHERE `entry` IN (17909,19052,22427); +UPDATE `creature_template` SET `ScriptName`='npc_prof_blacksmith' WHERE `entry` IN (5164,11145,11146,11176,11177,11178,11191,11192,11193); +UPDATE `creature_template` SET `ScriptName`='npc_prof_leather' WHERE `entry` IN (7866,7867,7868,7869,7870,7871); +UPDATE `creature_template` SET `ScriptName`='npc_prof_tailor' WHERE `entry` IN (22208,22212,22213); diff --git a/sql/Updates/0.0.2/r513_mangos.sql b/sql/Updates/0.0.2/r513_mangos.sql new file mode 100644 index 0000000..e96397d --- /dev/null +++ b/sql/Updates/0.0.2/r513_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_salsalabim' WHERE `entry`=18584; diff --git a/sql/Updates/0.0.2/r514_mangos.sql b/sql/Updates/0.0.2/r514_mangos.sql new file mode 100644 index 0000000..785567f --- /dev/null +++ b/sql/Updates/0.0.2/r514_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='npc_raliq_the_drunk' WHERE `entry`=18585; +UPDATE `creature_template` SET `ScriptName`='npc_cooshcoosh' WHERE `entry`=18586; +UPDATE `creature_template` SET `ScriptName`='npc_floon' WHERE `entry`=18588; diff --git a/sql/Updates/0.0.2/r515_mangos.sql b/sql/Updates/0.0.2/r515_mangos.sql new file mode 100644 index 0000000..8c47054 --- /dev/null +++ b/sql/Updates/0.0.2/r515_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_murkblood_overseer' WHERE `entry`=23309; diff --git a/sql/Updates/0.0.2/r516_mangos.sql b/sql/Updates/0.0.2/r516_mangos.sql new file mode 100644 index 0000000..c26e855 --- /dev/null +++ b/sql/Updates/0.0.2/r516_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='npc_neeru_fireblade' WHERE `entry`=3216; +UPDATE `creature_template` SET `ScriptName`='npc_shenthul' WHERE `entry`=3401; +UPDATE `creature_template` SET `ScriptName`='npc_thrall_warchief' WHERE `entry`=4949; diff --git a/sql/Updates/0.0.2/r517_mangos.sql b/sql/Updates/0.0.2/r517_mangos.sql new file mode 100644 index 0000000..4c4d62b --- /dev/null +++ b/sql/Updates/0.0.2/r517_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_taskmaster_fizzule' WHERE `entry`=7233; diff --git a/sql/Updates/0.0.2/r518_mangos.sql b/sql/Updates/0.0.2/r518_mangos.sql new file mode 100644 index 0000000..702ac10 --- /dev/null +++ b/sql/Updates/0.0.2/r518_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_rathis_tomber' WHERE `entry`=16224; diff --git a/sql/Updates/0.0.2/r519_mangos.sql b/sql/Updates/0.0.2/r519_mangos.sql new file mode 100644 index 0000000..408ff7e --- /dev/null +++ b/sql/Updates/0.0.2/r519_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_calvin_montague' WHERE `entry`=6784; diff --git a/sql/Updates/0.0.2/r520_mangos.sql b/sql/Updates/0.0.2/r520_mangos.sql new file mode 100644 index 0000000..e119c7d --- /dev/null +++ b/sql/Updates/0.0.2/r520_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `item_template` SET `ScriptName`='item_disciplinary_rod' WHERE `entry`=22473; +UPDATE `item_template` SET `ScriptName`='item_protovoltaic_magneto_collector' WHERE `entry`=30656; diff --git a/sql/Updates/0.0.2/r521_mangos.sql b/sql/Updates/0.0.2/r521_mangos.sql new file mode 100644 index 0000000..a984ffa --- /dev/null +++ b/sql/Updates/0.0.2/r521_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_gregan_brewspewer' WHERE `entry`=7775; diff --git a/sql/Updates/0.0.2/r522_mangos.sql b/sql/Updates/0.0.2/r522_mangos.sql new file mode 100644 index 0000000..a740930 --- /dev/null +++ b/sql/Updates/0.0.2/r522_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='guard_shattrath_aldor' WHERE `entry`=18549; +UPDATE `creature_template` SET `ScriptName`='guard_shattrath_scryer' WHERE `entry`=18568; diff --git a/sql/Updates/0.0.2/r526_mangos.sql b/sql/Updates/0.0.2/r526_mangos.sql new file mode 100644 index 0000000..b4b9a2b --- /dev/null +++ b/sql/Updates/0.0.2/r526_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_injured_draenei' WHERE `entry`=16971; diff --git a/sql/Updates/0.0.2/r528_mangos.sql b/sql/Updates/0.0.2/r528_mangos.sql new file mode 100644 index 0000000..7990c4a --- /dev/null +++ b/sql/Updates/0.0.2/r528_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_skorn_whitecloud' WHERE `entry`=3052; +UPDATE `creature_template` SET `ScriptName`='npc_blood_knight_stillblade' WHERE `entry`=17768; diff --git a/sql/Updates/0.0.2/r533_mangos.sql b/sql/Updates/0.0.2/r533_mangos.sql new file mode 100644 index 0000000..064a236 --- /dev/null +++ b/sql/Updates/0.0.2/r533_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_augustus_the_touched' WHERE `entry`=12384; diff --git a/sql/Updates/0.0.2/r538_scriptdev2.sql b/sql/Updates/0.0.2/r538_scriptdev2.sql new file mode 100644 index 0000000..22a8212 --- /dev/null +++ b/sql/Updates/0.0.2/r538_scriptdev2.sql @@ -0,0 +1,60 @@ +-- Structure updates + +ALTER TABLE eventai_scripts +ADD event_flags tinyint(3) unsigned NOT NULL default '0' AFTER event_chance; + +ALTER TABLE eventai_scripts +ADD event_param4 int(11) signed NOT NULL default '0' AFTER event_param3; + +-- Event updates + +-- EVENT_T_TIMER_REPEAT +UPDATE eventai_scripts SET event_param4 = event_param3+event_param1, event_param3 = event_param1, event_param1 = event_param2, event_flags = 1 WHERE event_type = 0; + +-- EVENT_T_TIMER_SINGLE +UPDATE eventai_scripts SET event_param4 = event_param3+event_param1, event_param3 = event_param1, event_param1 = event_param2, event_type = 0 WHERE event_type = 1; + +-- EVENT_T_TIMER_OOC_REPEAT +UPDATE eventai_scripts SET event_param4 = event_param3+event_param1, event_param3 = event_param1, event_param1 = event_param2, event_flags = 1, event_type = 1 WHERE event_type = 2; + +-- EVENT_T_TIMER_OOC_SINGLE +UPDATE eventai_scripts SET event_param4 = event_param3+event_param1, event_param3 = event_param1, event_param1 = event_param2, event_type = 1 WHERE event_type = 3; + +-- EVENT_T_HP_SINGLE +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 0, event_type = 2 WHERE event_type = 4; + +-- EVENT_T_MANA_SINGLE +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 0, event_type = 3 WHERE event_type = 5; + +-- EVENT_T_AGGRO +UPDATE eventai_scripts SET event_type = 4 WHERE event_type = 6; + +-- EVENT_T_KILL +UPDATE eventai_scripts SET event_param2 = event_param1, event_flags = 1, event_type = 5 WHERE event_type = 7; + +-- EVENT_T_DEATH +UPDATE eventai_scripts SET event_type = 6 WHERE event_type = 8; + +-- EVENT_T_EVADE +UPDATE eventai_scripts SET event_type = 7 WHERE event_type = 9; + +-- EVENT_T_SPELLHIT +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 1, event_type = 8 WHERE event_type = 10; + +-- EVENT_T_RANGE +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 1, event_type = 9 WHERE event_type = 11; + +-- EVENT_T_OOC_LOS +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 1, event_type = 10 WHERE event_type = 12; + +-- EVENT_T_SPAWNED +UPDATE eventai_scripts SET event_type = 11 WHERE event_type = 13; + +-- EVENT_T_TARGET_HP +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 1, event_type = 12 WHERE event_type = 14; + +-- EVENT_T_TARGET_CASTING +UPDATE eventai_scripts SET event_param2 = event_param1, event_flags = 1, event_type = 13 WHERE event_type = 15; + +-- EVENT_T_FRIENDLY_HP +UPDATE eventai_scripts SET event_param4 = event_param3, event_flags = 1, event_type = 14 WHERE event_type = 16; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r547_mangos.sql b/sql/Updates/0.0.2/r547_mangos.sql new file mode 100644 index 0000000..8c2bb41 --- /dev/null +++ b/sql/Updates/0.0.2/r547_mangos.sql @@ -0,0 +1,22 @@ +/* Magister's Terrace */ +UPDATE `instance_template` SET `script` = 'instance_magisters_terrace' WHERE `map` = 585; +UPDATE `creature_template` SET `ScriptName` = 'boss_selin_fireheart' WHERE `entry` = 24723; +UPDATE `creature_template` SET `ScriptName` = 'mob_fel_crystal' WHERE `entry` = 24722; +UPDATE `creature_template` SET `ScriptName` = 'boss_vexallus' WHERE `entry` = 24744; +UPDATE `creature_template` SET `ScriptName` = 'mob_pure_energy' WHERE `entry` = 24745; +UPDATE `creature_template` SET `ScriptName` = 'boss_priestess_delrissa' WHERE `entry` = 24560; +UPDATE `creature_template` SET `ScriptName` = 'boss_kagani_nightstrike' WHERE `entry` = 24557; +UPDATE `creature_template` SET `ScriptName` = 'boss_ellris_duskhallow' WHERE `entry` = 24558; +UPDATE `creature_template` SET `ScriptName` = 'mob_imp' WHERE `entry` = 24656; +UPDATE `creature_template` SET `ScriptName` = 'boss_eramas_brightblaze' WHERE `entry` = 24554; +UPDATE `creature_template` SET `ScriptName` = 'boss_yazzai' WHERE `entry` = 24561; +UPDATE `creature_template` SET `ScriptName` = 'boss_warlord_salaris' WHERE `entry` = 24559; +UPDATE `creature_template` SET `ScriptName` = 'boss_garaxxas' WHERE `entry` = 24555; +UPDATE `creature_template` SET `ScriptName` = 'mob_sliver' WHERE `entry` = 24552; +UPDATE `creature_template` SET `ScriptName` = 'boss_apoko' WHERE `entry` = 24553; +UPDATE `creature_template` SET `ScriptName` = 'boss_zelfan' WHERE `entry` = 24556; +UPDATE `creature_template` SET `ScriptName` = 'boss_felblood_kaelthas' WHERE `entry` = 24664; +UPDATE `creature_template` SET `ScriptName` = 'mob_arcane_sphere' WHERE `entry` = 24708; +UPDATE `creature_template` SET `ScriptName` = 'mob_felkael_phoenix' WHERE `entry` = 24674; +UPDATE `creature_template` SET `ScriptName` = 'mob_felkael_phoenix_egg' WHERE `entry` = 24675; +UPDATE `creature_template` SET `ScriptName` = 'mob_felkael_flamestrike' WHERE `entry` = 24666; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r554_mangos.sql b/sql/Updates/0.0.2/r554_mangos.sql new file mode 100644 index 0000000..65a5199 --- /dev/null +++ b/sql/Updates/0.0.2/r554_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='boss_mekgineer_steamrigger' WHERE `entry`=17796; +UPDATE `creature_template` SET `ScriptName`='mob_steamrigger_mechanic' WHERE `entry`=17951; +UPDATE `creature_template` SET `ScriptName`='mob_naga_distiller' WHERE `entry`=17954; diff --git a/sql/Updates/0.0.2/r555_mangos.sql b/sql/Updates/0.0.2/r555_mangos.sql new file mode 100644 index 0000000..d5bff33 --- /dev/null +++ b/sql/Updates/0.0.2/r555_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_manaforge_control_console' WHERE `entry` IN (183770,183956,184311,184312); +UPDATE `creature_template` SET `ScriptName`='npc_manaforge_control_console' WHERE `entry` IN (20209,20417,20418,20440); diff --git a/sql/Updates/0.0.2/r56.sql b/sql/Updates/0.0.2/r56.sql new file mode 100644 index 0000000..cc91667 --- /dev/null +++ b/sql/Updates/0.0.2/r56.sql @@ -0,0 +1,2 @@ +/* Remove guildmaster script from npc's. Core has full support */ +UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` IN (4974,5054,4613); diff --git a/sql/Updates/0.0.2/r575_mangos.sql b/sql/Updates/0.0.2/r575_mangos.sql new file mode 100644 index 0000000..7ccf062 --- /dev/null +++ b/sql/Updates/0.0.2/r575_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName`='item_gor_dreks_ointment' WHERE `entry`=30175; diff --git a/sql/Updates/0.0.2/r576_mangos.sql b/sql/Updates/0.0.2/r576_mangos.sql new file mode 100644 index 0000000..13e530e --- /dev/null +++ b/sql/Updates/0.0.2/r576_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName`='item_muiseks_vessel' WHERE `entry` IN (9606,9618,9619,9620,9621); diff --git a/sql/Updates/0.0.2/r578_mangos.sql b/sql/Updates/0.0.2/r578_mangos.sql new file mode 100644 index 0000000..95f3fe2 --- /dev/null +++ b/sql/Updates/0.0.2/r578_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_forest_frog' WHERE `entry`=24396; diff --git a/sql/Updates/0.0.2/r584_mangos.sql b/sql/Updates/0.0.2/r584_mangos.sql new file mode 100644 index 0000000..50e4a56 --- /dev/null +++ b/sql/Updates/0.0.2/r584_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName`='item_voodoo_charm' WHERE `entry`=8149; diff --git a/sql/Updates/0.0.2/r59.sql b/sql/Updates/0.0.2/r59.sql new file mode 100644 index 0000000..dfc0473 --- /dev/null +++ b/sql/Updates/0.0.2/r59.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_narm_faulk' WHERE `entry`= 6177; +UPDATE `creature_template` SET `ScriptName` = 'npc_q8304' WHERE `entry` IN (15170, 15171); +UPDATE `creature_template` SET `ScriptName` = 'npc_q8507_q8731' WHERE `entry` IN (15440, 15612); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r590_mangos.sql b/sql/Updates/0.0.2/r590_mangos.sql new file mode 100644 index 0000000..6aa43d7 --- /dev/null +++ b/sql/Updates/0.0.2/r590_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_sergeant_bly' WHERE `entry`=7604; +UPDATE `creature_template` SET `ScriptName`='npc_weegli_blastfuse' WHERE `entry`=7607; diff --git a/sql/Updates/0.0.2/r591_mangos.sql b/sql/Updates/0.0.2/r591_mangos.sql new file mode 100644 index 0000000..15e14ce --- /dev/null +++ b/sql/Updates/0.0.2/r591_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='mobs_nether_drake' WHERE `entry` IN (20021,21817,21820,21821,21823); diff --git a/sql/Updates/0.0.2/r593_mangos.sql b/sql/Updates/0.0.2/r593_mangos.sql new file mode 100644 index 0000000..265fcda --- /dev/null +++ b/sql/Updates/0.0.2/r593_mangos.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_tablet_of_the_seven' WHERE `entry`=169294; diff --git a/sql/Updates/0.0.2/r594_mangos.sql b/sql/Updates/0.0.2/r594_mangos.sql new file mode 100644 index 0000000..3315fd4 --- /dev/null +++ b/sql/Updates/0.0.2/r594_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='mob_anubisath_sentinel' WHERE `entry`=15264; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r596_mangos.sql b/sql/Updates/0.0.2/r596_mangos.sql new file mode 100644 index 0000000..cc24c28 --- /dev/null +++ b/sql/Updates/0.0.2/r596_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='boss_ambassador_hellmaw' WHERE `entry`=18731; diff --git a/sql/Updates/0.0.2/r610_mangos.sql b/sql/Updates/0.0.2/r610_mangos.sql new file mode 100644 index 0000000..e6565e5 --- /dev/null +++ b/sql/Updates/0.0.2/r610_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_lady_sylvanas_windrunner' WHERE `entry`=10181; +UPDATE `creature_template` SET `ScriptName`='npc_highborne_lamenter' WHERE `entry`=21628; diff --git a/sql/Updates/0.0.2/r615_scriptdev2.sql b/sql/Updates/0.0.2/r615_scriptdev2.sql new file mode 100644 index 0000000..50f2516 --- /dev/null +++ b/sql/Updates/0.0.2/r615_scriptdev2.sql @@ -0,0 +1,4 @@ +-- Structure updates + +ALTER TABLE localized_texts +ADD `locale_8` varchar(255) NOT NULL default '' AFTER locale_7; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r617_mangos.sql b/sql/Updates/0.0.2/r617_mangos.sql new file mode 100644 index 0000000..a176200 --- /dev/null +++ b/sql/Updates/0.0.2/r617_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName`='item_razorthorn_flayer_gland' WHERE `entry`=34255; diff --git a/sql/Updates/0.0.2/r621_mangos.sql b/sql/Updates/0.0.2/r621_mangos.sql new file mode 100644 index 0000000..c07a5ba --- /dev/null +++ b/sql/Updates/0.0.2/r621_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='boss_talon_king_ikiss' WHERE `entry`=18473; diff --git a/sql/Updates/0.0.2/r628_mangos.sql b/sql/Updates/0.0.2/r628_mangos.sql new file mode 100644 index 0000000..accb13d --- /dev/null +++ b/sql/Updates/0.0.2/r628_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `instance_template` SET `script`='instance_shattered_halls' WHERE `map`=540; +UPDATE `creature_template` SET `ScriptName`='mob_fel_orc_convert' WHERE `entry`=17083; +UPDATE `creature_template` SET `ScriptName`='mob_lesser_shadow_fissure' WHERE `entry`=17471; diff --git a/sql/Updates/0.0.2/r63.sql b/sql/Updates/0.0.2/r63.sql new file mode 100644 index 0000000..4627d40 --- /dev/null +++ b/sql/Updates/0.0.2/r63.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_bartleby' WHERE `entry` IN (6090); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r632_mangos.sql b/sql/Updates/0.0.2/r632_mangos.sql new file mode 100644 index 0000000..17c8cc7 --- /dev/null +++ b/sql/Updates/0.0.2/r632_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='boss_warbringer_omrogg' WHERE `entry`=16809; +UPDATE `creature_template` SET `ScriptName`='mob_omrogg_heads' WHERE `entry` IN (19523,19524); diff --git a/sql/Updates/0.0.2/r633_mangos.sql b/sql/Updates/0.0.2/r633_mangos.sql new file mode 100644 index 0000000..24fbcb0 --- /dev/null +++ b/sql/Updates/0.0.2/r633_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_rogue_trainer' WHERE `entry` IN (918,4163,3328,4583,5165,5167,13283,16684); diff --git a/sql/Updates/0.0.2/r634_scriptdev2.sql b/sql/Updates/0.0.2/r634_scriptdev2.sql new file mode 100644 index 0000000..8e4bb09 --- /dev/null +++ b/sql/Updates/0.0.2/r634_scriptdev2.sql @@ -0,0 +1,35 @@ +DROP TABLE IF EXISTS `script_texts`; +CREATE TABLE `script_texts` ( +`ScriptName` varchar(255) NOT NULL default '', +`Id` int(11) unsigned NOT NULL default '0', +`Sound` int(11) unsigned NOT NULL default '0', +`Type` int(11) unsigned NOT NULL default '0', +`Language` int(11) unsigned NOT NULL default '0', +`Text` varchar(255) NOT NULL default '', +`Comment` varchar(255) NOT NULL default '', +PRIMARY KEY (`ScriptName`,`Id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; + + +DROP TABLE IF EXISTS `script_localized_texts`; +CREATE TABLE `script_localized_texts` ( +`id` int(11) unsigned NOT NULL auto_increment COMMENT 'Identifier', +`locale_1` varchar(255) NOT NULL default '', +`locale_2` varchar(255) NOT NULL default '', +`locale_3` varchar(255) NOT NULL default '', +`locale_4` varchar(255) NOT NULL default '', +`locale_5` varchar(255) NOT NULL default '', +`locale_6` varchar(255) NOT NULL default '', +`locale_7` varchar(255) NOT NULL default '', +`locale_8` varchar(255) NOT NULL default '', +`comment` varchar(255) NOT NULL default '' COMMENT 'Text Comment', +PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Localized Script Text'; + + +DROP TABLE IF EXISTS `eventai_texts`; +CREATE TABLE `eventai_texts` AS SELECT `id`, `locale_0` AS `text`, `comment` FROM `localized_texts`; +TRUNCATE TABLE `localized_texts`; +DROP TABLE IF EXISTS `eventai_localized_texts`; +ALTER TABLE `localized_texts` RENAME TO `eventai_localized_texts`; +ALTER TABLE `eventai_localized_texts` DROP COLUMN `locale_0`; diff --git a/sql/Updates/0.0.2/r636_mangos.sql b/sql/Updates/0.0.2/r636_mangos.sql new file mode 100644 index 0000000..11352e5 --- /dev/null +++ b/sql/Updates/0.0.2/r636_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='boss_laj' WHERE `entry`=17980; diff --git a/sql/Updates/0.0.2/r637_mangos.sql b/sql/Updates/0.0.2/r637_mangos.sql new file mode 100644 index 0000000..e7cf929 --- /dev/null +++ b/sql/Updates/0.0.2/r637_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='boss_high_botanist_freywinn' WHERE `entry`=17975; diff --git a/sql/Updates/0.0.2/r638_mangos.sql b/sql/Updates/0.0.2/r638_mangos.sql new file mode 100644 index 0000000..b29e0b0 --- /dev/null +++ b/sql/Updates/0.0.2/r638_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `item_template` SET `ScriptName`='item_attuned_crystal_cores' WHERE `entry`=34368; +UPDATE `creature_template` SET `ScriptName`='npc_converted_sentry' WHERE `entry`=24981; diff --git a/sql/Updates/0.0.2/r639_mangos.sql b/sql/Updates/0.0.2/r639_mangos.sql new file mode 100644 index 0000000..3a11ba4 --- /dev/null +++ b/sql/Updates/0.0.2/r639_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_ravenholdt' WHERE `entry`=13936; diff --git a/sql/Updates/0.0.2/r642_mangos.sql b/sql/Updates/0.0.2/r642_mangos.sql new file mode 100644 index 0000000..496c018 --- /dev/null +++ b/sql/Updates/0.0.2/r642_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='mob_shadowmoon_channeler' WHERE `entry`=17653; diff --git a/sql/Updates/0.0.2/r643_mangos.sql b/sql/Updates/0.0.2/r643_mangos.sql new file mode 100644 index 0000000..a109f89 --- /dev/null +++ b/sql/Updates/0.0.2/r643_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='mob_stolen_soul' WHERE `entry`=18441; +UPDATE `creature_template` SET `ScriptName`='mob_avatar_of_martyred' WHERE `entry`=18478; diff --git a/sql/Updates/0.0.2/r646_mangos.sql b/sql/Updates/0.0.2/r646_mangos.sql new file mode 100644 index 0000000..26b38ac --- /dev/null +++ b/sql/Updates/0.0.2/r646_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='boss_harbinger_skyriss_illusion' WHERE `entry` IN (21466,21467); diff --git a/sql/Updates/0.0.2/r647_scriptdev2.sql b/sql/Updates/0.0.2/r647_scriptdev2.sql new file mode 100644 index 0000000..7045225 --- /dev/null +++ b/sql/Updates/0.0.2/r647_scriptdev2.sql @@ -0,0 +1,10 @@ +DROP TABLE IF EXISTS `script_texts`; +CREATE TABLE `script_texts` ( +`id` int(11) unsigned NOT NULL auto_increment COMMENT 'Identifier', +`sound` int(11) unsigned NOT NULL default '0', +`type` int(11) unsigned NOT NULL default '0', +`language` int(11) unsigned NOT NULL default '0', +`text` varchar(255) NOT NULL default '', +`comment` varchar(255) NOT NULL default '', +PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r65.sql b/sql/Updates/0.0.2/r65.sql new file mode 100644 index 0000000..70aa0bc --- /dev/null +++ b/sql/Updates/0.0.2/r65.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `npcflag`='3', `ScriptName`='npc_lothos_riftwalker' WHERE `entry`='14387'; +UPDATE creature_template SET ScriptName="boss_gruul" WHERE entry=19044; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r656_scriptdev2.sql b/sql/Updates/0.0.2/r656_scriptdev2.sql new file mode 100644 index 0000000..62d99df --- /dev/null +++ b/sql/Updates/0.0.2/r656_scriptdev2.sql @@ -0,0 +1,5 @@ +ALTER TABLE +`eventai_localized_texts` ADD COLUMN `locale_8` varchar(255) NOT NULL default '' AFTER locale_7; + +ALTER TABLE +`script_localized_texts` ADD COLUMN `locale_8` varchar(255) NOT NULL default '' AFTER locale_7; diff --git a/sql/Updates/0.0.2/r658_mangos.sql b/sql/Updates/0.0.2/r658_mangos.sql new file mode 100644 index 0000000..9dc7e42 --- /dev/null +++ b/sql/Updates/0.0.2/r658_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_custodian_of_time' WHERE `entry`=20129; diff --git a/sql/Updates/0.0.2/r659_mangos.sql b/sql/Updates/0.0.2/r659_mangos.sql new file mode 100644 index 0000000..dba89f7 --- /dev/null +++ b/sql/Updates/0.0.2/r659_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName`='npc_akama_shade' WHERE `entry`=22990; -- Akama at Shade of Akama +UPDATE `creature_template` SET `ScriptName`='npc_akama_illidan' WHERE `entry`=23089; -- Akama at Illidan +UPDATE `creature_template` SET `ScriptName`='mob_illidari_council' WHERE `entry`=23426; -- Illidari Council controller mob +UPDATE `creature_template` SET `ScriptName`='mob_blood_elf_council_voice_trigger' WHERE `entry` = 23499; -- Voice Trigger Mob (Controls Aggro + Enrage yells) diff --git a/sql/Updates/0.0.2/r681_scriptdev2.sql b/sql/Updates/0.0.2/r681_scriptdev2.sql new file mode 100644 index 0000000..992a768 --- /dev/null +++ b/sql/Updates/0.0.2/r681_scriptdev2.sql @@ -0,0 +1,43 @@ +-- +-- NOTE: if you have temporary stored data in table `script_localized_texts` make sure to make backup of this before running this update! +-- Also note if you have any texts in current script_texts and they are not using entries valid for *_texts table, you _will_ get error messages on startup. +-- + +-- drop obsolete table +DROP TABLE script_localized_texts; + +-- alter and add fields in table `script_texts` +ALTER TABLE script_texts CHANGE COLUMN `id` `entry` mediumint(8) NOT NULL; +ALTER TABLE script_texts CHANGE COLUMN `text` `content_default` text NOT NULL AFTER `entry`; +ALTER TABLE script_texts ADD COLUMN `content_loc1` text AFTER `content_default`; +ALTER TABLE script_texts ADD COLUMN `content_loc2` text AFTER `content_loc1`; +ALTER TABLE script_texts ADD COLUMN `content_loc3` text AFTER `content_loc2`; +ALTER TABLE script_texts ADD COLUMN `content_loc4` text AFTER `content_loc3`; +ALTER TABLE script_texts ADD COLUMN `content_loc5` text AFTER `content_loc4`; +ALTER TABLE script_texts ADD COLUMN `content_loc6` text AFTER `content_loc5`; +ALTER TABLE script_texts ADD COLUMN `content_loc7` text AFTER `content_loc6`; +ALTER TABLE script_texts ADD COLUMN `content_loc8` text AFTER `content_loc7`; +ALTER TABLE script_texts MODIFY COLUMN `sound` tinyint unsigned NOT NULL default '0'; +ALTER TABLE script_texts MODIFY COLUMN `type` tinyint unsigned NOT NULL default '0'; +ALTER TABLE script_texts MODIFY COLUMN `language` tinyint unsigned NOT NULL default '0'; +ALTER TABLE script_texts MODIFY COLUMN `comment` text; + +-- new table for custom texts +DROP TABLE IF EXISTS `custom_texts`; +CREATE TABLE `custom_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `sound` mediumint(8) unsigned NOT NULL default '0', + `type` tinyint unsigned NOT NULL default '0', + `language` tinyint unsigned NOT NULL default '0', + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Custom Texts'; diff --git a/sql/Updates/0.0.2/r695_scriptdev2.sql b/sql/Updates/0.0.2/r695_scriptdev2.sql new file mode 100644 index 0000000..3f5eda4 --- /dev/null +++ b/sql/Updates/0.0.2/r695_scriptdev2.sql @@ -0,0 +1,62 @@ +-- +-- NOTE: If you have temporary stored data in table `eventai_localized_texts` make sure to make backup of this before running this update! +-- NOTE: If you have any texts in current eventai_texts and they are not using entries valid for *_texts table, you _will_ get error messages on startup. +-- NOTE: Do not run this update twice, it may create bad data if you choose to do so. +-- + +-- drop obsolete table +DROP TABLE eventai_localized_texts; + +-- alter and add fields in table `eventai_texts` +ALTER TABLE eventai_texts CHANGE COLUMN `id` `entry` mediumint(8) NOT NULL; +ALTER TABLE eventai_texts CHANGE COLUMN `text` `content_default` text NOT NULL AFTER `entry`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc1` text AFTER `content_default`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc2` text AFTER `content_loc1`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc3` text AFTER `content_loc2`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc4` text AFTER `content_loc3`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc5` text AFTER `content_loc4`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc6` text AFTER `content_loc5`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc7` text AFTER `content_loc6`; +ALTER TABLE eventai_texts ADD COLUMN `content_loc8` text AFTER `content_loc7`; +ALTER TABLE eventai_texts ADD COLUMN `sound` mediumint(8) unsigned NOT NULL default '0' AFTER `content_loc8`; +ALTER TABLE eventai_texts ADD COLUMN `type` tinyint unsigned NOT NULL default '0' AFTER `sound`; +ALTER TABLE eventai_texts ADD COLUMN `language` tinyint unsigned NOT NULL default '0' AFTER `type`; +ALTER TABLE eventai_texts MODIFY COLUMN `comment` text; + +-- get our current action type, and update text type = yell +UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=1 WHERE eventai_scripts.action1_type IN (2,7) AND eventai_scripts.action1_param1=eventai_texts.entry; +UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=1 WHERE eventai_scripts.action2_type IN (2,7) AND eventai_scripts.action2_param1=eventai_texts.entry; +UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=1 WHERE eventai_scripts.action3_type IN (2,7) AND eventai_scripts.action3_param1=eventai_texts.entry; +-- get our current action type, and update text type = textemote +UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=2 WHERE eventai_scripts.action1_type IN (3,8) AND eventai_scripts.action1_param1=eventai_texts.entry; +UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=2 WHERE eventai_scripts.action2_type IN (3,8) AND eventai_scripts.action2_param1=eventai_texts.entry; +UPDATE eventai_texts,eventai_scripts SET eventai_texts.type=2 WHERE eventai_scripts.action3_type IN (3,8) AND eventai_scripts.action3_param1=eventai_texts.entry; + +-- update our scripts, for all action type 2, 3, 6, 7 & 8 to become 1 +UPDATE eventai_scripts SET action1_type=1 WHERE action1_type IN (2,3,6,7,8); +UPDATE eventai_scripts SET action2_type=1 WHERE action2_type IN (2,3,6,7,8); +UPDATE eventai_scripts SET action3_type=1 WHERE action3_type IN (2,3,6,7,8); + +-- was OOC, so at least one could be -1, set this to 0 (dev note: below will be bad, if run twice) +UPDATE eventai_scripts SET action1_param2=0 WHERE action1_type=1 AND action1_param2=-1; +UPDATE eventai_scripts SET action1_param3=0 WHERE action1_type=1 AND action1_param3=-1; +UPDATE eventai_scripts SET action2_param2=0 WHERE action2_type=1 AND action2_param2=-1; +UPDATE eventai_scripts SET action2_param3=0 WHERE action2_type=1 AND action2_param3=-1; +UPDATE eventai_scripts SET action3_param2=0 WHERE action3_type=1 AND action3_param2=-1; +UPDATE eventai_scripts SET action3_param3=0 WHERE action3_type=1 AND action3_param3=-1; + +-- expect all to be action type 1 now, continue convert to negative text entry +UPDATE eventai_scripts SET action1_param1=(`action1_param1`) *-1 WHERE action1_type=1 AND action1_param1>0; +UPDATE eventai_scripts SET action2_param1=(`action2_param1`) *-1 WHERE action2_type=1 AND action2_param1>0; +UPDATE eventai_scripts SET action3_param1=(`action3_param1`) *-1 WHERE action3_type=1 AND action3_param1>0; + +UPDATE eventai_scripts SET action1_param2=(`action1_param2`) *-1 WHERE action1_type=1 AND action1_param2>0; +UPDATE eventai_scripts SET action2_param2=(`action2_param2`) *-1 WHERE action2_type=1 AND action2_param2>0; +UPDATE eventai_scripts SET action3_param2=(`action3_param2`) *-1 WHERE action3_type=1 AND action3_param2>0; + +UPDATE eventai_scripts SET action1_param3=(`action1_param3`) *-1 WHERE action1_type=1 AND action1_param3>0; +UPDATE eventai_scripts SET action2_param3=(`action2_param3`) *-1 WHERE action2_type=1 AND action2_param3>0; +UPDATE eventai_scripts SET action3_param3=(`action3_param3`) *-1 WHERE action3_type=1 AND action3_param3>0; + +-- now we have negative numbers in script, must make sure text entries have same entry as script +UPDATE eventai_texts SET entry=(`entry`) *-1 WHERE entry>0; diff --git a/sql/Updates/0.0.2/r699_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r699_scriptdev2_script_texts.sql new file mode 100644 index 0000000..325ab41 --- /dev/null +++ b/sql/Updates/0.0.2/r699_scriptdev2_script_texts.sql @@ -0,0 +1 @@ +ALTER TABLE script_texts MODIFY COLUMN `sound` mediumint(8) unsigned NOT NULL default '0'; diff --git a/sql/Updates/0.0.2/r700_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r700_scriptdev2_script_texts.sql new file mode 100644 index 0000000..5f08f5f --- /dev/null +++ b/sql/Updates/0.0.2/r700_scriptdev2_script_texts.sql @@ -0,0 +1,81 @@ +TRUNCATE `script_texts`; + +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000000,'',0,0,0,'DEFAULT_TEXT'), +(-1555000,'Infidels have invaded the sanctuary! Sniveling pests...You have yet to learn the true meaning of agony!',10473,1,0,'hellmaw SAY_INTRO'), +(-1555001,'Pathetic mortals! You will pay dearly!',10475,1,0,'hellmaw SAY_AGGRO1'), +(-1555002,'I will break you!',10476,1,0,'hellmaw SAY_AGGRO2'), +(-1555003,'Finally! Something to relieve the tedium!',10477,1,0,'hellmaw SAY_AGGRO3'), +(-1555004,'Aid me, you fools, before it\'s too late!',10474,1,0,'hellmaw SAY_HELP'), +(-1555005,'Do you fear death?',10478,1,0,'hellmaw SAY_SLAY1'), +(-1555006,'This is the part I enjoy most.',10479,1,0,'hellmaw SAY_SLAY2'), +(-1555007,'Do not...grow...overconfident, mortal.',10480,1,0,'hellmaw SAY_DEATH'), +(-1555008,'All flesh must burn.',10482,1,0,'blackhearth SAY_INTRO1'), +(-1555009,'All creation must be unmade!',10483,1,0,'blackhearth SAY_INTRO2'), +(-1555010,'Power will be yours!',10484,1,0,'blackhearth SAY_INTRO3'), +(-1555011,'You\'ll be sorry!',10486,1,0,'blackhearth SAY_AGGRO1'), +(-1555012,'Time for fun!',10487,1,0,'blackhearth SAY_AGGRO2'), +(-1555013,'I see dead people!',10488,1,0,'blackhearth SAY_AGGRO3'), +(-1555014,'No comin\' back for you!',10489,1,0,'blackhearth SAY_SLAY1'), +(-1555015,'Nice try!',10490,1,0,'blackhearth SAY_SLAY2'), +(-1555016,'Help us, hurry!',10485,1,0,'blackhearth SAY_HELP'), +(-1555017,'This... no... good...',10491,1,0,'blackhearth SAY_DEATH'), +(-1555018,'Be ready for Dark One\'s return.',10492,1,0,'blackhearth SAY2_INTRO1'), +(-1555019,'So we have place in new universe.',10493,1,0,'blackhearth SAY2_INTRO2'), +(-1555020,'Dark one promise!',10494,1,0,'blackhearth SAY2_INTRO3'), +(-1555021,'You\'ll be sorry!',10496,1,0,'blackhearth SAY2_AGGRO1'), +(-1555022,'Time to kill!',10497,1,0,'blackhearth SAY2_AGGRO2'), +(-1555023,'You be dead people!',10498,1,0,'blackhearth SAY2_AGGRO3'), +(-1555024,'Now you gone for good.',10499,1,0,'blackhearth SAY2_SLAY1'), +(-1555025,'You failed, haha haha',10500,1,0,'blackhearth SAY2_SLAY2'), +(-1555026,'Help us, hurry!',10495,1,0,'blackhearth SAY2_HELP'), +(-1555027,'Arrgh, aah...ahhh',10501,1,0,'blackhearth SAY2_DEATH'), +(-1555028,'Keep your minds focused for the days of reckoning are close at hand. Soon, the destroyer of worlds will return to make good on his promise. Soon the destruction of all that is will begin!',10522,1,0,'vorpil SAY_INTRO'), +(-1555029,'I\'ll make an offering of your blood!',10524,1,0,'vorpil SAY_AGGRO1'), +(-1555030,'You\'ll be a fine example, for the others.',10525,1,0,'vorpil SAY_AGGRO2'), +(-1555031,'Good, a worthy sacrifice.',10526,1,0,'vorpil SAY_AGGRO3'), +(-1555032,'Come to my aid, heed your master now!',10523,1,0,'vorpil SAY_HELP'), +(-1555033,'I serve with pride.',10527,1,0,'vorpil SAY_SLAY1'), +(-1555034,'Your death is for the greater cause!',10528,1,0,'vorpil SAY_SLAY2'), +(-1555035,'I give my life... Gladly.',10529,1,0,'vorpil SAY_DEATH'), +(-1555036,'draws energy from the air.',0,2,0,'murmur EMOTE_SONIC_BOOM'), +(-1556000,'I have pets....of my own!',10502,1,0,'syth SAY_SUMMON'), +(-1556001,'Hrrmm.. Time to.. hrrm.. make my move.',10503,1,0,'syth SAY_AGGRO_1'), +(-1556002,'Nice pets..hrm.. Yes! ',10504,1,0,'syth SAY_AGGRO_2'), +(-1556003,'Nice pets have.. weapons. No so....nice.',10505,1,0,'syth SAY_AGGRO_3'), +(-1556004,'Death.. meeting life is.. ',10506,1,0,'syth SAY_SLAY_1'), +(-1556005,'Uhn.. Be free..',10507,1,0,'syth SAY_SLAY_2'), +(-1556006,'No more life..hrm. No more pain. ',10508,1,0,'syth SAY_DEATH'), +(-1556007,'..Trinkets yes pretty Trinkets....power, great power...power in Trinkets..',10557,1,0,'ikiss SAY_INTRO'), +(-1556008,'You make war on Ikiss?..',10554,1,0,'ikiss SAY_AGGRO_1'), +(-1556009,'Ikiss cut you pretty....slice you. Yes!',10555,1,0,'ikiss SAY_AGGRO_2'), +(-1556010,'No escape for....for you',10556,1,0,'ikiss SAY_AGGRO_3'), +(-1556011,'You die....stay away from Trinkets',10558,1,0,'ikiss SAY_SLAY_1'), +(-1556012,'',10559,1,0,'ikiss SAY_SLAY_2'), +(-1556013,'Ikiss will not....die',10560,1,0,'ikiss SAY_DEATH'), +(-1556015,'begins to channel arcane energy...',0,3,0,'ikiss EMOTE_ARCANE_EXP'), +(-1557000,'What is this? You must forgive me, but I was not expecting company. As you can see, we are somewhat preoccupied right now. But no matter. As I am a gracious host, I will tend to you... personally.',10539,1,0,'shaffar SAY_INTRO'), +(-1557001,'We have not yet been properly introduced.',10541,1,0,'shaffar SAY_AGGRO_1'), +(-1557002,'An epic battle. How exciting!',10542,1,0,'shaffar SAY_AGGRO_2'), +(-1557003,'I have longed for a good adventure.',10543,1,0,'shaffar SAY_AGGRO_3'), +(-1557004,'It has been... entertaining.',10544,1,0,'shaffar SAY_SLAY_1'), +(-1557005,'And now we part company.',10545,1,0,'shaffar SAY_SLAY_2'), +(-1557006,'I have such fascinating things to show you.',10540,1,0,'shaffar SAY_SUMMON'), +(-1557007,'I must bid you... farewell.',10546,1,0,'shaffar SAY_DEAD'), +(-1557008,'I will feed on your soul.',10561,1,0,'pandemonius SAY_AGGRO_1'), +(-1557009,'So... full of life!',10562,1,0,'pandemonius SAY_AGGRO_2'), +(-1557010,'Do not... resist.',10563,1,0,'pandemonius SAY_AGGRO_3'), +(-1557011,'Yes! I am... empowered!',10564,1,0,'pandemonius SAY_KILL_1'), +(-1557012,'More... I must have more!',10565,1,0,'pandemonius SAY_KILL_2'), +(-1557013,'To the void... once... more..',10566,1,0,'pandemonius SAY_DEATH'), +(-1557014,'shifts into the void...',0,3,0,'pandemonius EMOTE_DARK_SHELL'), +(-1558000,'You have defiled the resting place of our ancestors. For this offense, there can be but one punishment. It is fitting that you have come to a place of the dead... for you will soon be joining them.',10509,1,0,'maladaar SAY_INTRO'), +(-1558001,'Rise my fallen brothers. Take form and fight!',10512,1,0,'maladaar SAY_SUMMON'), +(-1558002,'You will pay with your life!',10513,1,0,'maladaar SAY_AGGRO_1'), +(-1558003,'There\'s no turning back now!',10514,1,0,'maladaar SAY_AGGRO_2'), +(-1558004,'Serve your penitence!',10515,1,0,'maladaar SAY_AGGRO_3'), +(-1558005,'Let your mind be clouded.',10510,1,0,'maladaar SAY_ROAR'), +(-1558006,'Stare into the darkness of your soul.',10511,1,0,'maladaar SAY_SOUL_CLEAVE'), +(-1558007,'These walls will be your doom.',10516,1,0,'maladaar SAY_SLAY_1'), +(-1558008,' Now, you\'ll stay for eternity!',10517,1,0,'maladaar SAY_SLAY_2'), +(-1558009,'This is... where.. I belong...',10518,1,0,'maladaar SAY_DEATH'); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r701_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r701_scriptdev2_script_texts.sql new file mode 100644 index 0000000..ee746d6 --- /dev/null +++ b/sql/Updates/0.0.2/r701_scriptdev2_script_texts.sql @@ -0,0 +1,33 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1469030 AND -1469000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1469000,'None of your kind should be here! You\'ve doomed only yourselves!',8286,1,0,'broodlord SAY_AGGRO'), +(-1469001,'Clever Mortals but I am not so easily lured away from my sanctum!',8287,1,0,'broodlord SAY_LEASH'), +(-1469002,'goes into a killing frenzy!',0,2,0,'chromaggus EMOTE_FRENZY'), +(-1469003,'flinches as its skin shimmers.',0,2,0,'chromaggus EMOTE_SHIMMER'), +(-1469004,'In this world where time is your enemy, it is my greatest ally. This grand game of life that you think you play in fact plays you. To that I say...',0,0,0,'victor_nefarius SAY_GAMESBEGIN_1'), +(-1469005,'Let the games begin!',8280,1,0,'victor_nefarius SAY_GAMESBEGIN_2'), +(-1469006,'Ah, the heroes. You are persistent, aren\'t you. Your allied attempted to match his power against mine, and had to pay the price. Now he shall serve me, by slaughtering you. Get up little red wyrm and destroy them!',8279,1,0,'victor_nefarius SAY_VAEL_INTRO'), +(-1469007,'Well done, my minions. The mortals\' courage begins to wane! Now, let\'s see how they contend with the true Lord of Blackrock Spire!',8288,1,0,'nefarian SAY_AGGRO'), +(-1469008,'Enough! Now you vermin shall feel the force of my birthright, the fury of the earth itself.',8289,1,0,'nefarian SAY_XHEALTH'), +(-1469009,'Burn, you wretches! Burn!',8290,1,0,'nefarian SAY_SHADOWFLAME'), +(-1469010,'Impossible! Rise my minions! Serve your master once more!',8291,1,0,'nefarian SAY_RAISE_SKELETONS'), +(-1469011,'Worthless $N! Your friends will join you soon enough!',8293,1,0,'nefarian SAY_SLAY'), +(-1469012,'This cannot be! I am the Master here! You mortals are nothing to my kind! DO YOU HEAR? NOTHING!',8292,1,0,'nefarian SAY_DEATH'), +(-1469013,'Mages too? You should be more careful when you play with magic...',0,1,0,'nefarian SAY_MAGE'), +(-1469014,'Warriors, I know you can hit harder than that! Let\'s see it!',0,1,0,'nefarian SAY_WARRIOR'), +(-1469015,'Druids and your silly shapeshifting. Let\'s see it in action!',0,1,0,'nefarian SAY_DRUID'), +(-1469016,'Priests! If you\'re going to keep healing like that, we might as well make it a little more interesting!',0,1,0,'nefarian SAY_PRIEST'), +(-1469017,'Paladins, I\'ve heard you have many lives. Show me.',0,1,0,'nefarian SAY_PALADIN'), +(-1469018,'Shamans, show me what your totems can do!',0,1,0,'nefarian SAY_SHAMAN'), +(-1469019,'Warlocks, you shouldn\'t be playing with magic you don\'t understand. See what happens?',0,1,0,'nefarian SAY_WARLOCK'), +(-1469020,'Hunters and your annoying pea-shooters!',0,1,0,'nefarian SAY_HUNTER'), +(-1469021,'Rogues? Stop hiding and face me!',0,1,0,'nefarian SAY_ROGUE'), +(-1469022,'You\'ll pay for forcing me to do this.',8275,1,0,'razorgore SAY_EGGS_BROKEN1'), +(-1469023,'Fools! These eggs are more precious than you know.',8276,1,0,'razorgore SAY_EGGS_BROKEN2'), +(-1469024,'No! Not another one! I\'ll have your heads for this atrocity.',8277,1,0,'razorgore SAY_EGGS_BROKEN3'), +(-1469025,'If I fall into the abyss I\'ll take all of you mortals with me...',8278,1,0,'razorgore SAY_DEATH'), +(-1469026,'Too late...friends. Nefarius\' corruption has taken hold. I cannot...control myself.',8281,1,0,'vaelastrasz SAY_LINE1'), +(-1469027,'I beg you Mortals, flee! Flee before I lose all control. The Black Fire rages within my heart. I must release it!',8282,1,0,'vaelastrasz SAY_LINE2'), +(-1469028,'FLAME! DEATH! DESTRUCTION! COWER MORTALS BEFORE THE WRATH OF LORD....NO! I MUST FIGHT THIS!',8283,1,0,'vaelastrasz SAY_LINE3'), +(-1469029,'Nefarius\' hate has made me stronger than ever before. You should have fled, while you could, mortals! The fury of Blackrock courses through my veins!',8285,1,0,'vaelastrasz SAY_HALFLIFE'), +(-1469030,'Forgive me $N, your death only adds to my failure.',8284,1,0,'vaelastrasz SAY_KILLTARGET'); diff --git a/sql/Updates/0.0.2/r702_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r702_scriptdev2_script_texts.sql new file mode 100644 index 0000000..eef18bc --- /dev/null +++ b/sql/Updates/0.0.2/r702_scriptdev2_script_texts.sql @@ -0,0 +1,46 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1269017 AND -1269000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1269000,'Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives ...',10442,1,0,'temporus SAY_ENTER'), +(-1269001,'So be it ... you have been warned.',10444,1,0,'temporus SAY_AGGRO'), +(-1269002,'Time... sands of time is run out for you.',10443,1,0,'temporus SAY_BANISH'), +(-1269003,'You should have left when you had the chance.',10445,1,0,'temporus SAY_SLAY1'), +(-1269004,'Your days are done.',10446,1,0,'temporus SAY_SLAY2'), +(-1269005,'My death means ... little.',10447,1,0,'temporus SAY_DEATH'), +(-1269006,'Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased ...',10412,1,0,'chrono_lord_deja SAY_ENTER'), +(-1269007,'If you will not cease this foolish quest, then you will die!',10414,1,0,'chrono_lord_deja SAY_AGGRO'), +(-1269008,'You have outstayed your welcome, Timekeeper. Begone!',10413,1,0,'chrono_lord_deja SAY_BANISH'), +(-1269009,'I told you it was a fool\'s quest!',10415,1,0,'chrono_lord_deja SAY_SLAY1'), +(-1269010,'Leaving so soon?',10416,1,0,'chrono_lord_deja SAY_SLAY2'), +(-1269011,'Time ... is on our side.',10417,1,0,'chrono_lord_deja SAY_DEATH'), +(-1269012,'The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace the greater path shall become victims of its passing!',10400,1,0,'aeonus SAY_ENTER'), +(-1269013,'Let us see what fate lays in store...',10402,1,0,'aeonus SAY_AGGRO'), +(-1269014,'Your time is up, slave of the past!',10401,1,0,'aeonus SAY_BANISH'), +(-1269015,'One less obstacle in our way!',10403,1,0,'aeonus SAY_SLAY1'), +(-1269016,'No one can stop us! No one!',10404,1,0,'aeonus SAY_SLAY2'), +(-1269017,'It is only a matter...of time.',10405,1,0,'aeonus SAY_DEATH'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1560022 AND -1560000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1560000,'Thrall! You didn\'t really think you would escape did you? You and your allies shall answer to Blackmoore - after I\'ve had my fun!',10406,1,0,'skarloc SAY_ENTER'), +(-1560001,'You\'re a slave. That\'s all you\'ll ever be.',10407,1,0,'skarloc SAY_TAUNT1'), +(-1560002,'I don\'t know what Blackmoore sees in you. For my money, you\'re just another ignorant savage!',10408,1,0,'skarloc SAY_TAUNT2'), +(-1560003,'Thrall will never be free!',10409,1,0,'skarloc SAY_SLAY1'), +(-1560004,'Did you really think you would leave here alive?',10410,1,0,'skarloc SAY_SLAY2'), +(-1560005,'Guards! Urgh..Guards..!',10411,1,0,'skarloc SAY_DEATH'), +(-1560006,'You there, fetch water quickly! Get these flames out before they spread to the rest of the keep! Hurry, damn you!',10428,1,0,'lieutenant_drake SAY_ENTER'), +(-1560007,'I know what you\'re up to, and I mean to put an end to it, permanently!',10429,1,0,'lieutenant_drake SAY_AGGRO'), +(-1560008,'No more middling for you.',10432,1,0,'lieutenant_drake SAY_SLAY1'), +(-1560009,'You will not interfere!',10433,1,0,'lieutenant_drake SAY_SLAY2'), +(-1560010,'Time to bleed!',10430,1,0,'lieutenant_drake SAY_MORTAL'), +(-1560011,'Run, you blasted cowards!',10431,1,0,'lieutenant_drake SAY_SHOUT'), +(-1560012,'Thrall... must not... go free.',10434,1,0,'lieutenant_drake SAY_DEATH'), +(-1560013,'Thrall! Come outside and face your fate!',10418,1,0,'epoch SAY_ENTER1'), +(-1560014,'Taretha\'s life hangs in the balance. Surely you care for her. Surely you wish to save her...',10419,1,0,'epoch SAY_ENTER2'), +(-1560015,'Ah, there you are. I had hoped to accomplish this with a bit of subtlety, but I suppose direct confrontation was inevitable. Your future, Thrall, must not come to pass and so...you and your troublesome friends must die!',10420,1,0,'epoch SAY_ENTER3'), +(-1560016,'Enough! I will erase your very existence!',10421,1,0,'epoch SAY_AGGRO1'), +(-1560017,'You cannot fight fate!',10422,1,0,'epoch SAY_AGGRO2'), +(-1560018,'You are...irrelevant.',10425,1,0,'epoch SAY_SLAY1'), +(-1560019,'Thrall will remain a slave. Taretha will die. You have failed.',10426,1,0,'epoch SAY_SLAY2'), +(-1560020,'Not so fast!',10423,1,0,'epoch SAY_BREATH1'), +(-1560021,'Struggle as much as you like!',10424,1,0,'epoch SAY_BREATH2'), +(-1560022,'No!...The master... will not... be pleased.',10427,1,0,'epoch SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r703_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r703_scriptdev2_script_texts.sql new file mode 100644 index 0000000..75f7d8d --- /dev/null +++ b/sql/Updates/0.0.2/r703_scriptdev2_script_texts.sql @@ -0,0 +1,58 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1548055 AND -1548000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1548000,'I cannot allow you to interfere!',11289,1,0,'hydross SAY_AGGRO'), +(-1548001,'Better, much better.',11290,1,0,'hydross SAY_SWITCH_TO_CLEAN'), +(-1548002,'They have forced me to this...',11291,1,0,'hydross SAY_CLEAN_SLAY1'), +(-1548003,'I have no choice.',11292,1,0,'hydross SAY_CLEAN_SLAY2'), +(-1548004,'I am... released...',11293,1,0,'hydross SAY_CLEAN_DEATH'), +(-1548005,'Aaghh, the poison...',11297,1,0,'hydross SAY_SWITCH_TO_CORRUPT'), +(-1548006,'I will purge you from this place.',11298,1,0,'hydross SAY_CORRUPT_SLAY1'), +(-1548007,'You are no better than they!',11299,1,0,'hydross SAY_CORRUPT_SLAY2'), +(-1548008,'You are the disease, not I',11300,1,0,'hydross SAY_CORRUPT_DEATH'), +(-1548009,'Finally my banishment ends!',11312,1,0,'leotheras SAY_AGGRO'), +(-1548010,'Be gone trifling elf. I\'m in control now.',11304,1,0,'leotheras SAY_SWITCH_TO_DEMON'), +(-1548011,'We all have our demons...',11305,1,0,'leotheras SAY_INNER_DEMONS'), +(-1548012,'I have no equal.',11306,1,0,'leotheras SAY_DEMON_SLAY1'), +(-1548013,'Perish, mortal.',11307,1,0,'leotheras SAY_DEMON_SLAY2'), +(-1548014,'Yes, YES! Ahahah!',11308,1,0,'leotheras SAY_DEMON_SLAY3'), +(-1548015,'Kill! KILL!',11314,1,0,'leotheras SAY_NIGHTELF_SLAY1'), +(-1548016,'That\'s right! Yes!',11315,1,0,'leotheras SAY_NIGHTELF_SLAY2'), +(-1548017,'Who\'s the master now?',11316,1,0,'leotheras SAY_NIGHTELF_SLAY3'), +(-1548018,'No! NO! What have you done?! I am the master, do you hear me? I... aaghh... Can\'t... contain him...',11313,1,0,'leotheras SAY_FINAL_FORM'), +(-1548019,'At last I am liberated. It has been too long since I have tasted true freedom!',11309,1,0,'leotheras SAY_FREE'), +(-1548020,'You cannot kill me! Fools, I\'ll be back! I\'ll... aarghh...',11317,1,0,'leotheras SAY_DEATH'), +(-1548021,'Guards, attention! We have visitors...',11277,1,0,'karathress SAY_AGGRO'), +(-1548022,'Your overconfidence will be your undoing! Guards, lend me your strength!',11278,1,0,'karathress SAY_GAIN_BLESSING'), +(-1548023,'Go on, kill them! I\'ll be the better for it!',11279,1,0,'karathress SAY_GAIN_ABILITY1'), +(-1548024,'I am more powerful than ever!',11280,1,0,'karathress SAY_GAIN_ABILITY2'), +(-1548025,'More knowledge, more power!',11281,1,0,'karathress SAY_GAIN_ABILITY3'), +(-1548026,'Land-dwelling scum!',11282,1,0,'karathress SAY_SLAY1'), +(-1548027,'Alana be\'lendor!',11283,1,0,'karathress SAY_SLAY2'), +(-1548028,'I am rid of you.',11284,1,0,'karathress SAY_SLAY3'), +(-1548029,'Her ... excellency ... awaits!',11285,1,0,'karathress SAY_DEATH'), +(-1548030,'Flood of the deep, take you!',11321,1,0,'morogrim SAY_AGGRO'), +(-1548031,'By the Tides, kill them at once!',11322,1,0,'morogrim SAY_SUMMON1'), +(-1548032,'Destroy them my subjects!',11323,1,0,'morogrim SAY_SUMMON2'), +(-1548033,'There is nowhere to hide!',11324,1,0,'morogrim SAY_SUMMON_BUBL1'), +(-1548034,'Soon it will be finished!',11325,1,0,'morogrim SAY_SUMMON_BUBL2'), +(-1548035,'It is done!',11326,1,0,'morogrim SAY_SLAY1'), +(-1548036,'Strugging only makes it worse.',11327,1,0,'morogrim SAY_SLAY2'), +(-1548037,'Only the strong survive.',11328,1,0,'morogrim SAY_SLAY3'), +(-1548038,'Great... currents of... Ageon.',11329,1,0,'morogrim SAY_DEATH'), +(-1548039,'sends his enemies to their watery graves!',0,2,0,'morogrim EMOTE_WATERY_GRAVE'), +(-1548040,'The violent earthquake has alerted nearby murlocs!',0,3,0,'morogrim EMOTE_EARTHQUAKE'), +(-1548041,'summons Watery Globules!',0,2,0,'morogrim EMOTE_WATERY_GLOBULES'), +(-1548042,'Water is life. It has become a rare commodity here in Outland. A commodity that we alone shall control. We are the Highborne, and the time has come at last for us to retake our rightful place in the world!',11531,1,0,'vashj SAY_INTRO'), +(-1548043,'I\'ll split you from stem to stern!',11532,1,0,'vashj SAY_AGGRO1'), +(-1548044,'Victory to Lord Illidan!',11533,1,0,'vashj SAY_AGGRO2'), +(-1548045,'I spit on you, surface filth!',11534,1,0,'vashj SAY_AGGRO3'), +(-1548046,'Death to the outsiders!',11535,1,0,'vashj SAY_AGGRO4'), +(-1548047,'I did not wish to lower myself by engaging your kind, but you leave me little choice!',11538,1,0,'vashj SAY_PHASE1'), +(-1548048,'The time is now! Leave none standing!',11539,1,0,'vashj SAY_PHASE2'), +(-1548049,'You may want to take cover.',11540,1,0,'vashj SAY_PHASE3'), +(-1548050,'Straight to the heart!',11536,1,0,'vashj SAY_BOWSHOT1'), +(-1548051,'Seek your mark!',11537,1,0,'vashj SAY_BOWSHOT2'), +(-1548052,'Your time ends now!',11541,1,0,'vashj SAY_SLAY1'), +(-1548053,'You have failed!',11542,1,0,'vashj SAY_SLAY2'), +(-1548054,'Be\'lamere an\'delay',11543,1,0,'vashj SAY_SLAY3'), +(-1548055,'Lord Illidan, I... I am... sorry.',11544,1,0,'vashj SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r704_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r704_scriptdev2_script_texts.sql new file mode 100644 index 0000000..e864b0a --- /dev/null +++ b/sql/Updates/0.0.2/r704_scriptdev2_script_texts.sql @@ -0,0 +1,26 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1545023 AND -1545000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1545000,'Surge forth my pets!',10360,1,0,'thespia SAY_SUMMON'), +(-1545001,'The depths will consume you!',10361,1,0,'thespia SAY_AGGRO_1'), +(-1545002,'Meet your doom, surface dwellers!',10362,1,0,'thespia SAY_AGGRO_2'), +(-1545003,'You will drown in blood!',10363,1,0,'thespia SAY_AGGRO_3'), +(-1545004,'To the depths of oblivion with you!',10364,1,0,'thespia SAY_SLAY_1'), +(-1545005,'For my lady and master!',10365,1,0,'thespia SAY_SLAY_2'), +(-1545006,'Our matron will be.. the end of.. you..',10366,1,0,'thespia SAY_DEAD'), +(-1545007,'I\'m bringin\' the pain!',10367,1,0,'mekgineer SAY_MECHANICS'), +(-1545008,'You\'re in for a world of hurt!',10368,1,0,'mekgineer SAY_AGGRO_1'), +(-1545009,'Eat hot metal, scumbag!',10369,1,0,'mekgineer SAY_AGGRO_2'), +(-1545010,'I\'ll come over there!',10370,1,0,'mekgineer SAY_AGGRO_3'), +(-1545011,'I\'m bringin\' the pain!',10371,1,0,'mekgineer SAY_AGGRO_4'), +(-1545012,'You just got served, punk!',10372,1,0,'mekgineer SOUND_SLAY_1'), +(-1545013,'I own you!',10373,1,0,'mekgineer SOUND_SLAY_2'), +(-1545014,'Have fun dyin\', cupcake!',10374,1,0,'mekgineer SOUND_SLAY_3'), +(-1545015,'Mommy!',10375,1,0,'mekgineer SAY_DEATH'), +(-1545016,'You deem yourselves worthy simply because you bested my guards? Our work here will not be compromised!',10390,1,0,'kalithresh SAY_INTRO'), +(-1545017,'This is not nearly over...',10391,1,0,'kalithresh SAY_REGEN'), +(-1545018,'Your head will roll!',10392,1,0,'kalithresh SAY_AGGRO1'), +(-1545019,'I despise all of your kind!',10393,1,0,'kalithresh SAY_AGGRO2'), +(-1545020,'Ba\'ahntha sol\'dorei!',10394,1,0,'kalithresh SAY_AGGRO3'), +(-1545021,'Scram, surface filth!',10395,1,0,'kalithresh SAY_SLAY1'), +(-1545022,'Ah ha ha ha ha ha ha!',10396,1,0,'kalithresh SAY_SLAY2'), +(-1545023,'For her Excellency... for... Vashj!',10397,1,0,'kalithresh SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r705_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r705_scriptdev2_script_texts.sql new file mode 100644 index 0000000..90b4d1d --- /dev/null +++ b/sql/Updates/0.0.2/r705_scriptdev2_script_texts.sql @@ -0,0 +1,100 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1540041 AND -1540000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1540000,'You wish to fight us all at once? This should be amusing!',10262,1,0,'nethekurse SAY_INTRO'), +(-1540001,'You can have that one. I no longer need him.',10263,1,0,'nethekurse PEON_ATTACK_1'), +(-1540002,'Yes, beat him mercilessly. His skull is a thick as an ogres.',10264,1,0,'nethekurse PEON_ATTACK_2'), +(-1540003,'Don\'t waste your time on that one. He\'s weak!',10265,1,0,'nethekurse PEON_ATTACK_3'), +(-1540004,'You want him? Very well, take him!',10266,1,0,'nethekurse PEON_ATTACK_4'), +(-1540005,'One pitiful wretch down. Go on, take another one.',10267,1,0,'nethekurse PEON_DIE_1'), +(-1540006,'Ahh, what a waste... Next!',10268,1,0,'nethekurse PEON_DIE_2'), +(-1540007,'I was going to kill him anyway!',10269,1,0,'nethekurse PEON_DIE_3'), +(-1540008,'Thank you for saving me the trouble! Now it\'s my turn to have some fun...',10270,1,0,'nethekurse PEON_DIE_4'), +(-1540009,'Beg for your pittyfull life!',10259,1,0,'nethekurse SAY_TAUNT_1'), +(-1540010,'Run covad, ruun!',10260,1,0,'nethekurse SAY_TAUNT_2'), +(-1540011,'Your pain amuses me.',10261,1,0,'nethekurse SAY_TAUNT_3'), +(-1540012,'I\'m already bored.',10271,1,0,'nethekurse SAY_AGGRO_1'), +(-1540013,'Come on! ... Show me a real fight.',10272,1,0,'nethekurse SAY_AGGRO_2'), +(-1540014,'I had more fun torturing the peons.',10273,1,0,'nethekurse SAY_AGGRO_3'), +(-1540015,'You Loose.',10274,1,0,'nethekurse SAY_SLAY_1'), +(-1540016,'Ohh! Just die.',10275,1,0,'nethekurse SAY_SLAY_2'), +(-1540017,'What a ... a shame.',10276,1,0,'nethekurse SAY_DIE'), +(-1540018,'Smash!',10306,1,0,'omrogg GoCombat_1'), +(-1540019,'If you nice me let you live.',10308,1,0,'omrogg GoCombat_2'), +(-1540020,'Me hungry!',10309,1,0,'omrogg GoCombat_3'), +(-1540021,'Why don\'t you let me do the talking?',10317,1,0,'omrogg GoCombatDelay_1'), +(-1540022,'No, we will NOT let you live!',10318,1,0,'omrogg GoCombatDelay_2'), +(-1540023,'You always hungry. That why we so fat!',10319,1,0,'omrogg GoCombatDelay_3'), +(-1540024,'You stay here. Me go kill someone else!',10303,1,0,'omrogg Threat_1'), +(-1540025,'What are you doing!',10315,1,0,'omrogg Threat_2'), +(-1540026,'Me kill someone else...',10302,1,0,'omrogg Threat_3'), +(-1540027,'Me not like this one...',10300,1,0,'omrogg Threat_4'), +(-1540028,'That\'s not funny!',10314,1,0,'omrogg ThreatDelay1_1'), +(-1540029,'Me get bored...',10305,1,0,'omrogg ThreatDelay1_2'), +(-1540030,'I\'m not done yet, idiot!',10313,1,0,'omrogg ThreatDelay1_3'), +(-1540031,'Hey you numbskull!',10312,1,0,'omrogg ThreatDelay1_4'), +(-1540032,'Ha ha ha.',10304,1,0,'omrogg ThreatDelay2_1'), +(-1540033,'Whhy! He almost dead!',10316,1,0,'omrogg ThreatDelay2_2'), +(-1540034,'H\'ey...',10307,1,0,'omrogg ThreatDelay2_3'), +(-1540035,'We kill his friend!',10301,1,0,'omrogg ThreatDelay2_4'), +(-1540036,'This one die easy!',10310,1,0,'omrogg Killing_1'), +(-1540037,'I\'m tired. You kill next one!',10320,1,0,'omrogg Killing_2'), +(-1540038,'That\'s because I do all the hard work!',10321,1,0,'omrogg KillingDelay_1'), +(-1540039,'This all...your fault!',10311,1,0,'omrogg YELL_DIE_L'), +(-1540040,'I...hate...you...',10322,1,0,'omrogg YELL_DIE_R'), +(-1540041,'enrages',0,2,0,'omrogg EMOTE_ENRAGE'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1542014 AND -1542000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1542000,'Who dares interrupt... What is this? What have you done? You ruin everything!',10164,1,0,'kelidan SAY_WAKE'), +(-1542001,'You mustn\'t let him loose!',10166,1,0,'kelidan SAY_ADD_AGGRO_1'), +(-1542002,'Ignorant whelps!',10167,1,0,'kelidan SAY_ADD_AGGRO_2'), +(-1542003,'You fools! He\'ll kill us all!',10168,1,0,'kelidan SAY_ADD_AGGRO_3'), +(-1542004,'Just as you deserve!',10169,1,0,'kelidan SAY_KILL_1'), +(-1542005,'Your friends will soon be joining you.',10170,1,0,'kelidan SAY_KILL_2'), +(-1542006,'Closer... Come closer.. and burn!',10165,1,0,'kelidan SAY_NOVA'), +(-1542007,'Good luck... you\'ll need it..',10171,1,0,'kelidan SAY_DIE'), +(-1542008,'Come intruders....',0,1,0,'broggok SAY_AGGRO'), +(-1542009,'My work must not be interrupted.',10286,1,0,'the_maker SAY_AGGRO_1'), +(-1542010,'Perhaps I can find a use for you.',10287,1,0,'the_maker SAY_AGGRO_2'), +(-1542011,'Anger... Hate... These are tools I can use.',10288,1,0,'the_maker SAY_AGGRO_3'), +(-1542012,'Let\'s see what I can make of you.',10289,1,0,'the_maker SAY_KILL_1'), +(-1542013,'It is pointless to resist.',10290,1,0,'the_maker SAY_KILL_2'), +(-1542014,'Stay away from... me.',10291,1,0,'the_maker SAY_DIE'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1543016 AND -1543000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1543000,'Do you smell that? Fresh meat has somehow breached our citadel. Be wary of any intruders.',0,1,0,'gargolmar SAY_TAUNT'), +(-1543001,'Heal me! QUICKLY!',10329,1,0,'gargolmar SAY_HEAL'), +(-1543002,'Back off, pup!',10330,1,0,'gargolmar SAY_SURGE'), +(-1543003,'What have we here...?',10331,1,0,'gargolmar SAY_AGGRO_1'), +(-1543004,'Heh... this may hurt a little.',10332,1,0,'gargolmar SAY_AGGRO_2'), +(-1543005,'I\'m gonna enjoy this.',10333,1,0,'gargolmar SAY_AGGRO_3'), +(-1543006,'Say farewell!',10334,1,0,'gargolmar SAY_KILL_1'), +(-1543007,'Much too easy...',10335,1,0,'gargolmar SAY_KILL_2'), +(-1543008,'Hahah.. ..argh!',10336,1,0,'gargolmar SAY_DIE'), +(-1543009,'You dare stand against me?!',10280,1,0,'omor SAY_AGGRO_1'), +(-1543010,'I will not be defeated!',10279,1,0,'omor SAY_AGGRO_2'), +(-1543011,'Your insolence will be your death.',10281,1,0,'omor SAY_AGGRO_3'), +(-1543012,'Achor-she-ki! Feast my pet! Eat your fill!',10277,1,0,'omor SAY_SUMMON'), +(-1543013,'A-Kreesh!',10278,1,0,'omor SAY_CURSE'), +(-1543014,'Die, weakling!',10282,1,0,'omor SAY_KILL_1'), +(-1543015,'It is... not over.',10284,1,0,'omor SAY_DIE'), +(-1543016,'I am victorious!',10283,1,0,'omor SAY_WIPE'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1544014 AND -1544000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1544000,'Wretched, meddling insects. Release me and perhaps i will grant you a merciful death!',10247,1,0,'magtheridon SAY_TAUNT1'), +(-1544001,'Vermin! Leeches! Take my blood and choke on it!',10248,1,0,'magtheridon SAY_TAUNT2'), +(-1544002,'Illidan is an arrogant fool. I will crush him and reclaim Outland as my own.',10249,1,0,'magtheridon SAY_TAUNT3'), +(-1544003,'Away, you mindless parasites. My blood is my own!',10250,1,0,'magtheridon SAY_TAUNT4'), +(-1544004,'How long do you believe your pathetic sorcery can hold me?',10251,1,0,'magtheridon SAY_TAUNT5'), +(-1544005,'My blood will be the end of you!',10252,1,0,'magtheridon SAY_TAUNT6'), +(-1544006,'I...am...UNLEASHED!!!',10253,1,0,'magtheridon SAY_FREED'), +(-1544007,'Thank you for releasing me. Now...die!',10254,1,0,'magtheridon SAY_AGGRO'), +(-1544008,'Not again...NOT AGAIN!',10256,1,0,'magtheridon SAY_BANISH'), +(-1544009,'I will not be taken so easily. Let the walls of this prison tremble...and FALL!!!',10257,1,0,'magtheridon SAY_CHAMBER_DESTROY'), +(-1544010,'Did you think me weak? Soft? Who is the weak one now?!',10255,1,0,'magtheridon SAY_PLAYER_KILLED'), +(-1544011,'The Legion...will consume you...all...',10258,1,0,'magtheridon SAY_DEATH'), +(-1544012,'becomes enraged!',0,2,0,'magtheridon EMOTE_BERSERK'), +(-1544013,'begins to cast Blast Nova!',0,2,0,'magtheridon EMOTE_BLASTNOVA'), +(-1544014,'bonds begin to weaken!',0,2,0,'magtheridon EMOTE_BEGIN'); diff --git a/sql/Updates/0.0.2/r706_mangos.sql b/sql/Updates/0.0.2/r706_mangos.sql new file mode 100644 index 0000000..65ba79c --- /dev/null +++ b/sql/Updates/0.0.2/r706_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='boss_pathaleon_the_calculator' WHERE `entry`=19220; +UPDATE `creature_template` SET `ScriptName`='mob_nether_wraith' WHERE `entry`=21062; +UPDATE `instance_template` SET `script`='instance_mechanar' WHERE `map`=554; diff --git a/sql/Updates/0.0.2/r707_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r707_scriptdev2_script_texts.sql new file mode 100644 index 0000000..69edf3d --- /dev/null +++ b/sql/Updates/0.0.2/r707_scriptdev2_script_texts.sql @@ -0,0 +1,128 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1565019 AND -1565000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1565000,'Gronn are the real power in outland.',11367,1,0,'maulgar SAY_AGGRO'), +(-1565001,'You will not defeat the hand of Gruul!',11368,1,0,'maulgar SAY_ENRAGE'), +(-1565002,'You won\'t kill next one so easy!',11369,1,0,'maulgar SAY_OGRE_DEATH1'), +(-1565003,'Pah! Does not prove anything!',11370,1,0,'maulgar SAY_OGRE_DEATH2'), +(-1565004,'I\'m not afraid of you.',11371,1,0,'maulgar SAY_OGRE_DEATH3'), +(-1565005,'Good, now you fight me!',11372,1,0,'maulgar SAY_OGRE_DEATH4'), +(-1565006,'You not so tough afterall!',11373,1,0,'maulgar SAY_SLAY1'), +(-1565007,'Aha-ha ha ha!',11374,1,0,'maulgar SAY_SLAY2'), +(-1565008,'Mulgar is king!',11375,1,0,'maulgar SAY_SLAY3'), +(-1565009,'Gruul... will crush you...',11376,1,0,'maulgar SAY_DEATH'), +(-1565010,'Come... and die.',11355,1,0,'gruul SAY_AGGRO'), +(-1565011,'Scurry',11356,1,0,'gruul SAY_SLAM1'), +(-1565012,'No escape',11357,1,0,'gruul SAY_SLAM2'), +(-1565013,'Stay',11358,1,0,'gruul SAY_SHATTER1'), +(-1565014,'Beg... for life',11359,1,0,'gruul SAY_SHATTER2'), +(-1565015,'No more',11360,1,0,'gruul SAY_SLAY1'), +(-1565016,'Unworthy',11361,1,0,'gruul SAY_SLAY2'), +(-1565017,'Die',11362,1,0,'gruul SAY_SLAY3'), +(-1565018,'Aaargh...',11363,1,0,'gruul SAY_DEATH'), +(-1565019,'grows in size!',0,2,0,'gruul EMOTE_GROW'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1532102 AND -1532000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1532000,'Well done Midnight!',9173,1,0,'attumen SAY_MIDNIGHT_KILL'), +(-1532001,'Cowards! Wretches!',9167,1,0,'attumen SAY_APPEAR1'), +(-1532002,'Who dares attack the steed of the Huntsman?',9298,1,0,'attumen SAY_APPEAR2'), +(-1532003,'Perhaps you would rather test yourselves against a more formidable opponent?!',9299,1,0,'attumen SAY_APPEAR3'), +(-1532004,'Come, Midnight, let\'s disperse this petty rabble!',9168,1,0,'attumen SAY_MOUNT'), +(-1532005,'It was... inevitable.',9169,1,0,'attumen SAY_KILL1'), +(-1532006,'Another trophy to add to my collection!',9300,1,0,'attumen SAY_KILL2'), +(-1532007,'Weapons are merely a convenience for a warrior of my skill!',9166,1,0,'attumen SAY_DISARMED'), +(-1532008,'I always knew... someday I would become... the hunted.',9165,1,0,'attumen SAY_DEATH'), +(-1532009,'Such easy sport.',9170,1,0,'attumen SAY_RANDOM1'), +(-1532010,'Amateurs! Do not think you can best me! I kill for a living.',9304,1,0,'attumen SAY_RANDOM2'), +(-1532011,'Hmm, unannounced visitors? Preparations must be made.',9211,1,0,'moroes SAY_AGGRO'), +(-1532012,'Now, where was I? Oh yes...',9215,1,0,'moroes SAY_SPECIAL_1'), +(-1532013,'You rang?',9316,1,0,'moroes SAY_SPECIAL_2'), +(-1532014,'One more for dinner this evening.',9214,1,0,'moroes SAY_KILL_1'), +(-1532015,'Time... Never enough time.',9314,1,0,'moroes SAY_KILL_2'), +(-1532016,'I\'ve gone and made a mess.',9315,1,0,'moroes SAY_KILL_3'), +(-1532017,'How terribly clumsy of me...',9213,1,0,'moroes SAY_DEATH'), +(-1532018,'Your behavior will not be tolerated!',9204,1,0,'maiden SAY_AGGRO'), +(-1532019,'Ah ah ah...',9207,1,0,'maiden SAY_SLAY1'), +(-1532020,'This is for the best.',9312,1,0,'maiden SAY_SLAY2'), +(-1532021,'Impure thoughts lead to profane actions.',9311,1,0,'maiden SAY_SLAY3'), +(-1532022,'Cast out your corrupt thoughts.',9313,1,0,'maiden SAY_REPENTANCE1'), +(-1532023,'Your impurity must be cleansed.',9208,1,0,'maiden SAY_REPENTANCE2'), +(-1532024,'Death comes. Will your conscience be clear?',9206,1,0,'maiden SAY_DEATH'), +(-1532025,'Oh at last, at last. I can go home.',9190,1,0,'dorothee SAY_DOROTHEE_DEATH'), +(-1532026,'Don\'t let them hurt us, Tito! Oh, you won\'t, will you?',9191,1,0,'dorothee SAY_DOROTHEE_SUMMON'), +(-1532027,'Tito, oh Tito, no!',9192,1,0,'dorothee SAY_DOROTHEE_TITO_DEATH'), +(-1532028,'Oh dear, we simply must find a way home! The old wizard could be our only hope! Strawman, Roar, Tinhead, will you... wait! Oh golly, look! We have visitors!',9195,1,0,'dorothee SAY_DOROTHEE_AGGRO'), +(-1532029,'Wanna fight? Huh? Do ya? C\'mon, I\'ll fight you with both claws behind my back!',9227,1,0,'roar SAY_ROAR_AGGRO'), +(-1532030,'You didn\'t have to go and do that.',9229,1,0,'roar SAY_ROAR_DEATH'), +(-1532031,'I think I\'m going to go take fourty winks.',9230,1,0,'roar SAY_ROAR_SLAY'), +(-1532032,'Now what should I do with you? I simply can\'t make up my mind.',9254,1,0,'strawman SAY_STRAWMAN_AGGRO'), +(-1532033,'Don\'t let them make a mattress... out of me.',9256,1,0,'strawman SAY_STRAWMAN_DEATH'), +(-1532034,'I guess I\'m not a failure after all.',9257,1,0,'strawman SAY_STRAWMAN_SLAY'), +(-1532035,'I could really use a heart. Say, can I have yours?',9268,1,0,'tinhead SAY_TINHEAD_AGGRO'), +(-1532036,'Back to being an old rustbucket.',9270,1,0,'tinhead SAY_TINHEAD_DEATH'), +(-1532037,'Guess I\'m not so rusty, after all.',9271,1,0,'tinhead SAY_TINHEAD_SLAY'), +(-1532038,'begins to rust.',0,2,0,'tinhead EMOTE_RUST'), +(-1532039,'Woe to each and every one of you my pretties! ',9179,1,0,'crone SAY_CRONE_AGGRO'), +(-1532040,'It will all be over soon! ',9307,1,0,'crone SAY_CRONE_AGGRO2'), +(-1532041,'How could you? What a cruel, cruel world!',9178,1,0,'crone SAY_CRONE_DEATH'), +(-1532042,'Fixed you, didn\'t I? ',9180,1,0,'crone SAY_CRONE_SLAY'), +(-1532043,'All the better to own you with!',9276,1,0,'wolf SAY_WOLF_AGGRO'), +(-1532044,'Mmmm... delicious.',9277,1,0,'wolf SAY_WOLF_SLAY'), +(-1532045,'Run away little girl, run away!',9278,1,0,'wolf SAY_WOLF_HOOD'), +(-1532046,'What devil art thou, that dost torment me thus?',9196,1,0,'julianne SAY_JULIANNE_AGGRO'), +(-1532047,'Where is my lord? Where is my Romulo?',9199,1,0,'julianne SAY_JULIANNE_ENTER'), +(-1532048,'Romulo, I come! Oh... this do I drink to thee!',9198,1,0,'julianne SAY_JULIANNE_DEATH01'), +(-1532049,'Where is my Lord? Where is my Romulo? Ohh, happy dagger! This is thy sheath! There rust, and let me die!',9310,1,0,'julianne SAY_JULIANNE_DEATH02'), +(-1532050,'Come, gentle night; and give me back my Romulo!',9200,1,0,'julianne SAY_JULIANNE_RESURRECT'), +(-1532051,'Parting is such sweet sorrow.',9201,1,0,'julianne SAY_JULIANNE_SLAY'), +(-1532052,'Wilt thou provoke me? Then have at thee, boy!',9233,1,0,'romulo SAY_ROMULO_AGGRO'), +(-1532053,'Thou smilest... upon the stroke that... murders me.',9235,1,0,'romulo SAY_ROMULO_DEATH'), +(-1532054,'This day\'s black fate on more days doth depend. This but begins the woe. Others must end.',9236,1,0,'romulo SAY_ROMULO_ENTER'), +(-1532055,'Thou detestable maw, thou womb of death; I enforce thy rotten jaws to open!',9237,1,0,'romulo SAY_ROMULO_RESURRECT'), +(-1532056,'How well my comfort is revived by this!',9238,1,0,'romulo SAY_ROMULO_SLAY'), +(-1532057,'The Menagerie is for guests only.',9183,1,0,'curator SAY_AGGRO'), +(-1532058,'Gallery rules will be strictly enforced.',9188,1,0,'curator SAY_SUMMON1'), +(-1532059,'This curator is equipped for gallery protection.',9309,1,0,'curator SAY_SUMMON2'), +(-1532060,'Your request cannot be processed.',9186,1,0,'curator SAY_EVOCATE'), +(-1532061,'Failure to comply will result in offensive action.',9185,1,0,'curator SAY_ENRAGE'), +(-1532062,'Do not touch the displays.',9187,1,0,'curator SAY_KILL1'), +(-1532063,'You are not a guest.',9308,1,0,'curator SAY_KILL2'), +(-1532064,'This Curator is no longer op... er... ation... al.',9184,1,0,'curator SAY_DEATH'), +(-1532065,'Your blood will anoint my circle.',9264,1,0,'terestian SAY_SLAY1'), +(-1532066,'The great one will be pleased.',9329,1,0,'terestian SAY_SLAY2'), +(-1532067,'My life, is yours. Oh great one.',9262,1,0,'terestian SAY_DEATH'), +(-1532068,'Ah, you\'re just in time. The rituals are about to begin.',9260,1,0,'terestian SAY_AGGRO'), +(-1532069,'Please, accept this humble offering, oh great one.',9263,1,0,'terestian SAY_SACRIFICE1'), +(-1532070,'Let the sacrifice serve his testament to my fealty.',9330,1,0,'terestian SAY_SACRIFICE2'), +(-1532071,'Come, you dwellers in the dark. Rally to my call!',9265,1,0,'terestian SAY_SUMMON1'), +(-1532072,'Gather, my pets. There is plenty for all.',9331,1,0,'terestian SAY_SUMMON2'), +(-1532073,'Please, no more. My son... he\'s gone mad!',9241,1,0,'aran SAY_AGGRO1'), +(-1532074,'I\'ll not be tortured again!',9323,1,0,'aran SAY_AGGRO2'), +(-1532075,'Who are you? What do you want? Stay away from me!',9324,1,0,'aran SAY_AGGRO3'), +(-1532076,'I\'ll show you this beaten dog still has some teeth!',9245,1,0,'aran SAY_FLAMEWREATH1'), +(-1532077,'Burn you hellish fiends!',9326,1,0,'aran SAY_FLAMEWREATH2'), +(-1532078,'I\'ll freeze you all!',9246,1,0,'aran SAY_BLIZZARD1'), +(-1532079,'Back to the cold dark with you!',9327,1,0,'aran SAY_BLIZZARD2'), +(-1532080,'Yes, yes, my son is quite powerful... but I have powers of my own!',9242,1,0,'aran SAY_EXPLOSION1'), +(-1532081,'I am not some simple jester! I am Nielas Aran!',9325,1,0,'aran SAY_EXPLOSION2'), +(-1532082,'Surely you would not deny an old man a replenishing drink? No, no I thought not.',9248,1,0,'aran SAY_DRINK'), +(-1532083,'I\'m not finished yet! No, I have a few more tricks up me sleeve.',9251,1,0,'aran SAY_ELEMENTALS'), +(-1532084,'I want this nightmare to be over!',9250,1,0,'aran SAY_KILL1'), +(-1532085,'Torment me no more!',9328,1,0,'aran SAY_KILL2'), +(-1532086,'You\'ve wasted enough of my time. Let these games be finished!',9247,1,0,'aran SAY_TIMEOVER'), +(-1532087,'At last... The nightmare is.. over...',9244,1,0,'aran SAY_DEATH'), +(-1532088,'Where did you get that?! Did HE send you?!',9249,1,0,'aran SAY_ATIESH'), +(-1532089,'cries out in withdrawal, opening gates to the warp.',0,2,0,'netherspite EMOTE_PHASE_PORTAL'), +(-1532090,'goes into a nether-fed rage!',0,2,0,'netherspite EMOTE_PHASE_BANISH'), +(-1532091,'Madness has brought you here to me. I shall be your undoing!',9218,1,0,'malchezaar SAY_AGGRO'), +(-1532092,'Simple fools! Time is the fire in which you\'ll burn!',9220,1,0,'malchezaar SAY_AXE_TOSS1'), +(-1532093,'I see the subtlety of conception is beyond primitives such as you.',9317,1,0,'malchezaar SAY_AXE_TOSS2'), +(-1532094,'Who knows what secrets hide in the dark.',9223,1,0,'malchezaar SAY_SPECIAL1'), +(-1532095,'The cerestial forces are mine to manipulate.',9320,1,0,'malchezaar SAY_SPECIAL2'), +(-1532096,'How can you hope to withstand against such overwhelming power?',9321,1,0,'malchezaar SAY_SPECIAL3'), +(-1532097,'Surely you did not think you could win.',9222,1,0,'malchezaar SAY_SLAY1'), +(-1532098,'Your greed, your foolishness has brought you to this end.',9318,1,0,'malchezaar SAY_SLAY2'), +(-1532099,'You are, but a plaything, unfit even to amuse.',9319,1,0,'malchezaar SAY_SLAY3'), +(-1532100,'All realities, all dimensions are open to me!',9224,1,0,'malchezaar SAY_SUMMON1'), +(-1532101,'You face not Malchezaar alone, but the legions I command!',9322,1,0,'malchezaar SAY_SUMMON2'), +(-1532102,'I refuse to concede defeat. I am a prince of the Eredar! I am...',9221,1,0,'malchezaar SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r709_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r709_scriptdev2_script_texts.sql new file mode 100644 index 0000000..c5fddef --- /dev/null +++ b/sql/Updates/0.0.2/r709_scriptdev2_script_texts.sql @@ -0,0 +1,93 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1550043 AND -1550000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1550000,'Alert, you are marked for extermination!',11213,1,0,'voidreaver SAY_AGGRO'), +(-1550001,'Extermination, successful.',11215,1,0,'voidreaver SAY_SLAY1'), +(-1550002,'Imbecile life form, no longer functional.',11216,1,0,'voidreaver SAY_SLAY2'), +(-1550003,'Threat neutralized.',11217,1,0,'voidreaver SAY_SLAY3'), +(-1550004,'Systems... shutting... down...',11214,1,0,'voidreaver SAY_DEATH'), +(-1550005,'Alternative measure commencing...',11218,1,0,'voidreaver SAY_POUNDING1'), +(-1550006,'Calculating force parameters...',11219,1,0,'voidreaver SAY_POUNDING2'), +(-1550007,'Tal anu\'men no Sin\'dorei!',11134,1,0,'solarian SAY_AGGRO'), +(-1550008,'Ha ha ha! You are hopelessly outmatched!',11139,1,0,'solarian SAY_SUMMON1'), +(-1550009,'I will crush your delusions of grandeur!',11140,1,0,'solarian SAY_SUMMON2'), +(-1550010,'Your soul belongs to the Abyss!',11136,1,0,'solarian SAY_KILL1'), +(-1550011,'By the blood of the Highborne!',11137,1,0,'solarian SAY_KILL2'), +(-1550012,'For the Sunwell!',11138,1,0,'solarian SAY_KILL3'), +(-1550013,'The warmth of the sun... awaits.',11135,1,0,'solarian SAY_DEATH'), +(-1550014,'Enough of this! Now I call upon the fury of the cosmos itself.',0,1,0,'solarian SAY_VOIDA'), +(-1550015,'I become ONE... with the VOID!',0,1,0,'solarian SAY_VOIDB'), +(-1550016,'Energy. Power. My people are addicted to it... a dependence made manifest after the Sunwell was destroyed. Welcome... to the future. A pity you are too late to stop it. No one can stop me now! Selama ashal\'anore!',11256,1,0,'kaelthas SAY_INTRO'), +(-1550017,'Capernian will see to it that your stay here is a short one.',11257,1,0,'kaelthas SAY_INTRO_CAPERNIAN'), +(-1550018,'Well done, you have proven worthy to test your skills against my master engineer, Telonicus.',11258,1,0,'kaelthas SAY_INTRO_TELONICUS'), +(-1550019,'Let us see how your nerves hold up against the Darkener, Thaladred.',11259,1,0,'kaelthas SAY_INTRO_THALADRED'), +(-1550020,'You have persevered against some of my best advisors... but none can withstand the might of the Blood Hammer. Behold, Lord Sanguinar!',11260,1,0,'kaelthas SAY_INTRO_SANGUINAR'), +(-1550021,'As you see, I have many weapons in my arsenal...',11261,1,0,'kaelthas SAY_PHASE2_WEAPON'), +(-1550022,'Perhaps I underestimated you. It would be unfair to make you fight all four advisors at once, but... fair treatment was never shown to my people. I\'m just returning the favor.',11262,1,0,'kaelthas SAY_PHASE3_ADVANCE'), +(-1550023,'Alas, sometimes one must take matters into one\'s own hands. Balamore shanal!',11263,1,0,'kaelthas SAY_PHASE4_INTRO2'), +(-1550024,'I have not come this far to be stopped! The future I have planned will not be jeopardized! Now you will taste true power!!',11273,1,0,'kaelthas SAY_PHASE5_NUTS'), +(-1550025,'You will not prevail.',11270,1,0,'kaelthas SAY_SLAY1'), +(-1550026,'You gambled...and lost.',11271,1,0,'kaelthas SAY_SLAY2'), +(-1550027,'This was Child\'s play.',11272,1,0,'kaelthas SAY_SLAY3'), +(-1550028,'Obey me.',11268,1,0,'kaelthas SAY_MINDCONTROL1'), +(-1550029,'Bow to my will.',11269,1,0,'kaelthas SAY_MINDCONTROL2'), +(-1550030,'Let us see how you fare when your world is turned upside down.',11264,1,0,'kaelthas SAY_GRAVITYLAPSE1'), +(-1550031,'Having trouble staying grounded?',11265,1,0,'kaelthas SAY_GRAVITYLAPSE2'), +(-1550032,'Anara\'nel belore!',11267,1,0,'kaelthas SAY_SUMMON_PHOENIX1'), +(-1550033,'By the power of the sun!',11266,1,0,'kaelthas SAY_SUMMON_PHOENIX2'), +(-1550034,'For...Quel...thalas!',11274,1,0,'kaelthas SAY_DEATH'), +(-1550035,'Prepare yourselves!',11203,1,0,'thaladred SAY_THALADRED_AGGRO'), +(-1550036,'Forgive me, my prince! I have... failed.',11204,1,0,'thaladred SAY_THALADRED_DEATH'), +(-1550037,'sets his gaze on $N!',0,2,0,'thaladred EMOTE_THALADRED_GAZE'), +(-1550038,'Blood for blood!',11152,1,0,'sanguinar SAY_SANGUINAR_AGGRO'), +(-1550039,'NO! I ...will... not...',11153,1,0,'sanguinar SAY_SANGUINAR_DEATH'), +(-1550040,'The sin\'dore reign supreme!',11117,1,0,'capernian SAY_CAPERNIAN_AGGRO'), +(-1550041,'This is not over!',11118,1,0,'capernian SAY_CAPERNIAN_DEATH'), +(-1550042,'Anar\'alah belore!',11157,1,0,'telonicus SAY_TELONICUS_AGGRO'), +(-1550043,'More perils... await',11158,1,0,'telonicus SAY_TELONICUS_DEATH'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1553012 AND -1553000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1553000,'What are you doing? These specimens are very delicate!',11144,1,0,'freywinn SAY_AGGRO'), +(-1553001,'Your life cycle is now concluded!',11145,1,0,'freywinn SAY_KILL_1'), +(-1553002,'You will feed the worms.',11146,1,0,'freywinn SAY_KILL_2'), +(-1553003,'Endorel aluminor!',11147,1,0,'freywinn SAY_TREE_1'), +(-1553004,'Nature bends to my will!',11148,1,0,'freywinn SAY_TREE_2'), +(-1553005,'The specimens...must be preserved.',11149,1,0,'freywinn SAY_DEATH'), +(-1553006,'emits a strange noise.',0,2,0,'laj EMOTE_SUMMON'), +(-1553007,'Who disturbs this sanctuary?',11230,1,0,'warp SAY_AGGRO'), +(-1553008,'You must die! But wait: this does not--No, no... you must die!',11231,1,0,'warp SAY_SLAY_1'), +(-1553009,'What am I doing? Why do I...',11232,1,0,'warp SAY_SLAY_2'), +(-1553010,'Children, come to me!',11233,1,0,'warp SAY_SUMMON_1'), +(-1553011,'Maybe this is not--No, we fight! Come to my aid.',11234,1,0,'warp SAY_SUMMON_2'), +(-1553012,'So... confused. Do not... belong here!',11235,1,0,'warp SAY_DEATH'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1554027 AND -1554000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1554000,'I predict a painful death.',11101,1,0,'gyro SAY_AGGRO'), +(-1554001,'Measure twice; cut once!',11104,1,0,'gyro SAY_SAW_ATTACK1'), +(-1554002,'If my division is correct, you should be quite dead.',11105,1,0,'gyro SAY_SAW_ATTACK2'), +(-1554003,'Your strategy was flawed!',11102,1,0,'gyro SAY_SLAY1'), +(-1554004,'Yes, the only logical outcome.',11103,1,0,'gyro SAY_SLAY2'), +(-1554005,'An unforseen... contingency',11106,1,0,'gyro SAY_DEATH'), +(-1554006,'You have approximately five seconds to live.',11109,1,0,'ironhand SAY_AGGRO_1'), +(-1554007,'With the precise angle and velocity...',11112,1,0,'ironhand SAY_HAMMER_1'), +(-1554008,'Low tech yet quiet effective!',11113,1,0,'ironhand SAY_HAMMER_2'), +(-1554009,'A foregone conclusion.',11110,1,0,'ironhand SAY_SLAY_1'), +(-1554010,'The processing will continue a schedule!',11111,1,0,'ironhand SAY_SLAY_2'), +(-1554011,'My calculations did not...',11114,1,0,'ironhand SAY_DEATH_1'), +(-1554012,'raises his hammer menacingly...',0,3,0,'ironhand EMOTE_HAMMER'), +(-1554013,'Don\'t value your life very much, do you?',11186,1,0,'sepethrea SAY_AGGRO'), +(-1554014,'I am not alone.',11191,1,0,'sepethrea SAY_SUMMON'), +(-1554015,'Think you can take the heat?',11189,1,0,'sepethrea SAY_DRAGONS_BREATH_1'), +(-1554016,'Anar\'endal dracon!',11190,1,0,'sepethrea SAY_DRAGONS_BREATH_2'), +(-1554017,'And don\'t come back!',11187,1,0,'sepethrea SAY_SLAY1'), +(-1554018,'En\'dala finel el\'dal',11188,1,0,'sepethrea SAY_SLAY2'), +(-1554019,'Anu... bala belore...alon.',11192,1,0,'sepethrea SAY_DEATH'), +(-1554020,'We are on a strict timetable. You will not interfere!',11193,1,0,'pathaleon SAY_AGGRO'), +(-1554021,'I\'m looking for a team player...',11197,1,0,'pathaleon SAY_DOMINATION_1'), +(-1554022,'You work for me now!',11198,1,0,'pathaleon SAY_DOMINATION_2'), +(-1554023,'Time to supplement my work force.',11196,1,0,'pathaleon SAY_SUMMON'), +(-1554024,'I prefeer to be hands-on...',11199,1,0,'pathaleon SAY_ENRAGE'), +(-1554025,'A minor inconvenience.',11194,1,0,'pathaleon SAY_SLAY_1'), +(-1554026,'Looks like you lose.',11195,1,0,'pathaleon SAY_SLAY_2'), +(-1554027,'The project will... continue.',11200,1,0,'pathaleon SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r710_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r710_scriptdev2_script_texts.sql new file mode 100644 index 0000000..073bb3a --- /dev/null +++ b/sql/Updates/0.0.2/r710_scriptdev2_script_texts.sql @@ -0,0 +1,32 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1585029 AND -1585000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1585000,'You only waste my time!',12378,1,0,'selin SAY_AGGRO'), +(-1585001,'My hunger knows no bounds!',12381,1,0,'selin SAY_ENERGY'), +(-1585002,'Yes! I am a god!',12382,1,0,'selin SAY_EMPOWERED'), +(-1585003,'Enough distractions!',12388,1,0,'selin SAY_KILL_1'), +(-1585004,'I am invincible!',12385,1,0,'selin SAY_KILL_2'), +(-1585005,'No! More... I must have more!',12383,1,0,'selin SAY_DEATH'), +(-1585006,'begins to channel from the nearby Fel Crystal...',0,3,0,'selin EMOTE_CRYSTAL'), +(-1585007,'Drain...life!',12389,1,0,'vexallus SAY_AGGRO'), +(-1585008,'Un...con...tainable.',12392,1,0,'vexallus SAY_ENERGY'), +(-1585009,'Un...leash...',12390,1,0,'vexallus SAY_OVERLOAD'), +(-1585010,'Con...sume.',12393,1,0,'vexallus SAY_KILL'), +(-1585011,'discharges pure energy!',0,3,0,'vexallus EMOTE_DISCHARGE_ENERGY'), +(-1585012,'Annihilate them!',12395,1,0,'delrissa SAY_AGGRO'), +(-1585013,'Oh, the horror.',12398,1,0,'delrissa LackeyDeath1'), +(-1585014,'Well, aren\'t you lucky?',12400,1,0,'delrissa LackeyDeath2'), +(-1585015,'Now I\'m getting annoyed.',12401,1,0,'delrissa LackeyDeath3'), +(-1585016,'Lackies be damned! I\'ll finish you myself!',12403,1,0,'delrissa LackeyDeath4'), +(-1585017,'I call that a good start.',12405,1,0,'delrissa PlayerDeath1'), +(-1585018,'I could have sworn there were more of you.',12407,1,0,'delrissa PlayerDeath2'), +(-1585019,'Not really much of a group, anymore, is it?',12409,1,0,'delrissa PlayerDeath3'), +(-1585020,'One is such a lonely number.',12410,1,0,'delrissa PlayerDeath4'), +(-1585021,'It\'s been a kick, really.',12411,1,0,'delrissa PlayerDeath5'), +(-1585022,'Not what I had... planned...',12397,1,0,'delrissa SAY_DEATH'), +(-1585023,'Don\'t look so smug! I know what you\'re thinking, but Tempest Keep was merely a set back. Did you honestly believe I would trust the future to some blind, half-night elf mongrel? Oh no, he was merely an instrument, a stepping stone to a much larger plan! It has all led to this, and this time, you will not interfere!',12413,1,0,'kaelthas MT SAY_AGGRO'), +(-1585024,'Vengeance burns!',12415,1,0,'kaelthas MT SAY_PHOENIX'), +(-1585025,'Felomin ashal!',12417,1,0,'kaelthas MT SAY_FLAMESTRIKE'), +(-1585026,'I\'ll turn your world... upside... down...',12418,1,0,'kaelthas MT SAY_GRAVITY_LAPSE'), +(-1585027,'Master... grant me strength.',12419,1,0,'kaelthas MT SAY_TIRED'), +(-1585028,'Do not... get too comfortable.',12420,1,0,'kaelthas MT SAY_RECAST_GRAVITY'), +(-1585029,'My demise accomplishes nothing! The Master will have you! You will drown in your own blood! This world shall burn! Aaaghh!',12421,1,0,'kaelthas MT SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r713_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r713_scriptdev2_script_texts.sql new file mode 100644 index 0000000..d05fc24 --- /dev/null +++ b/sql/Updates/0.0.2/r713_scriptdev2_script_texts.sql @@ -0,0 +1,38 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1580035 AND -1580000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1580000,'Aggh! No longer will I be a slave to Malygos! Challenge me and you will be destroyed!',12422,1,0,'kalecgos SAY_EVIL_AGGRO'), +(-1580001,'I will purge you!',12423,1,0,'kalecgos SAY_EVIL_SPELL1'), +(-1580002,'Your pain has only begun!',12424,1,0,'kalecgos SAY_EVIL_SPELL2'), +(-1580003,'In the name of Kil\'jaeden!',12425,1,0,'kalecgos SAY_EVIL_SLAY1'), +(-1580004,'You were warned!',12426,1,0,'kalecgos SAY_EVIL_SLAY2'), +(-1580005,'My awakening is complete! You shall all perish!',12427,1,0,'kalecgos SAY_EVIL_ENRAGE'), +(-1580006,'I need... your help... Cannot... resist him... much longer...',12428,1,0,'kalecgos humanoid SAY_GOOD_AGGRO'), +(-1580007,'Aaahhh! Help me, before I lose my mind!',12429,1,0,'kalecgos humanoid SAY_GOOD_NEAR_DEATH'), +(-1580008,'Hurry! There is not much of me left!',12430,1,0,'kalecgos humanoid SAY_GOOD_NEAR_DEATH2'), +(-1580009,'I am forever in your debt. Once we have triumphed over Kil\'jaeden, this entire world will be in your debt as well.',12431,1,0,'kalecgos humanoid SAY_GOOD_PLRWIN'), +(-1580010,'There will be no reprieve. My work here is nearly finished.',12451,1,0,'sathrovarr SAY_SATH_AGGRO'), +(-1580011,'I\'m... never on... the losing... side...',12452,1,0,'sathrovarr SAY_SATH_DEATH'), +(-1580012,'Your misery is my delight!',12453,1,0,'sathrovarr SAY_SATH_SPELL1'), +(-1580013,'I will watch you bleed!',12454,1,0,'sathrovarr SAY_SATH_SPELL2'), +(-1580014,'Pitious mortal!',12455,1,0,'sathrovarr SAY_SATH_SLAY1'), +(-1580015,'Haven\'t you heard? I always win!',12456,1,0,'sathrovarr SAY_SATH_SLAY2'), +(-1580016,'I have toyed with you long enough!',12457,1,0,'sathrovarr SAY_SATH_ENRAGE'), +(-1580017,'Puny lizard! Death is the only answer you\'ll find here!',12458,1,0,'brutallus YELL_INTRO'), +(-1580018,'Grah! Your magic is weak!',12459,1,0,'brutallus YELL_INTRO_BREAK_ICE'), +(-1580019,'I will crush you!',12460,1,0,'brutallus YELL_INTRO_CHARGE'), +(-1580020,'That was fun.',12461,1,0,'brutallus YELL_INTRO_KILL_MADRIGOSA'), +(-1580021,'Come, try your luck!',12462,1,0,'brutallus YELL_INTRO_TAUNT'), +(-1580022,'Ahh! More lambs to the slaughter!',12463,1,0,'brutallus YELL_AGGRO'), +(-1580023,'Perish, insect!',12464,1,0,'brutallus YELL_KILL1'), +(-1580024,'You are meat!',12465,1,0,'brutallus YELL_KILL2'), +(-1580025,'Too easy!',12466,1,0,'brutallus YELL_KILL3'), +(-1580026,'Bring the fight to me!',12467,1,0,'brutallus YELL_LOVE1'), +(-1580027,'Another day, another glorious battle!',12468,1,0,'brutallus YELL_LOVE2'), +(-1580028,'I live for this!',12469,1,0,'brutallus YELL_LOVE3'), +(-1580029,'So much for a real challenge... Die!',12470,1,0,'brutallus YELL_BERSERK'), +(-1580030,'Gah! Well done... Now... this gets... interesting...',12471,1,0,'brutallus YELL_DEATH'), +(-1580031,'Hold, friends! There is information to be had before this devil meets his fate!',12472,1,0,'madrigosa YELL_MADR_ICE_BARRIER'), +(-1580032,'Where is Anveena, demon? What has become of Kalec?',12473,1,0,'madrigosa YELL_MADR_INTRO'), +(-1580033,'You will tell me where they are!',12474,1,0,'madrigosa YELL_MADR_ICE_BLOCK'), +(-1580034,'Speak, I grow weary of asking!',12475,1,0,'madrigosa YELL_MADR_TRAP'), +(-1580035,'Malygos, my lord! I did my best!',12476,1,0,'madrigosa YELL_MADR_DEATH'); diff --git a/sql/Updates/0.0.2/r715_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r715_scriptdev2_script_texts.sql new file mode 100644 index 0000000..adfd4a6 --- /dev/null +++ b/sql/Updates/0.0.2/r715_scriptdev2_script_texts.sql @@ -0,0 +1,3 @@ +DELETE FROM `script_texts` WHERE `entry`=-1033000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1033000,'Thanks for freeing me, I\'ll open this door for you, then I will get out of here.',0,0,0,'shadowfang_prisoner SAY_FREE'); diff --git a/sql/Updates/0.0.2/r72.sql b/sql/Updates/0.0.2/r72.sql new file mode 100644 index 0000000..2c0df90 --- /dev/null +++ b/sql/Updates/0.0.2/r72.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName` = 'mobs_mana_tapped' WHERE `entry` IN (15273,15274,15294,15298,15367); +UPDATE `creature_template` SET `ScriptName` = 'mobs_ghoul_flayer' WHERE `entry` IN (8530, 8531, 8532); +UPDATE `creature_template` SET `ScriptName` = 'mobs_bonechewer_orc' WHERE `entry` IN (16876, 16925, 18952, 19701); +UPDATE `item_template` SET `ScriptName` = 'purification_mixture' WHERE `entry`= 23268; \ No newline at end of file diff --git a/sql/Updates/0.0.2/r725_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r725_scriptdev2_script_texts.sql new file mode 100644 index 0000000..0fa1a0b --- /dev/null +++ b/sql/Updates/0.0.2/r725_scriptdev2_script_texts.sql @@ -0,0 +1,26 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1309023 AND -1309000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1309000,'Let the coils of hate unfurl!',8421,1,0,'venoxis SAY_TRANSFORM'), +(-1309001,'Ssserenity..at lassst!',0,1,0,'venoxis SAY_DEATH'), +(-1309002,'Lord Hir\'eek, grant me wings of vengance!',8417,1,0,'jeklik SAY_AGGRO'), +(-1309003,'I command you to rain fire down upon these invaders!',0,1,0,'jeklik SAY_RAIN_FIRE'), +(-1309004,'Finally ...death. Curse you Hakkar! Curse you!',8422,1,0,'jeklik SAY_DEATH'), +(-1309005,'Draw me to your web mistress Shadra. Unleash your venom!',8418,1,0,'marli SAY_AGGRO'), +(-1309006,'Shadra, make of me your avatar!',0,1,0,'marli SAY_TRANSFORM'), +(-1309007,'Aid me my brood!',0,1,0,'marli SAY_SPIDER_SPAWN'), +(-1309008,'Bless you mortal for this release. Hakkar controls me no longer...',8423,1,0,'marli SAY_DEATH'), +(-1309009,'Shirvallah, fill me with your RAGE!',8419,1,0,'thekal SAY_AGGRO'), +(-1309010,'Hakkar binds me no more! Peace at last!',8424,1,0,'thekal SAY_DEATH'), +(-1309011,'Bethekk, your priestess calls upon your might!',8416,1,0,'arlokk SAY_AGGRO'), +(-1309012,'Feast on $n, my pretties!',0,1,0,'arlokk SAY_FEAST_PANTHER'), +(-1309013,'At last, I am free of the Soulflayer!',8412,1,0,'arlokk SAY_DEATH'), +(-1309014,'Welcome to da great show friends! Step right up to die!',8425,1,0,'jindo SAY_AGGRO'), +(-1309015,'I\'ll feed your souls to Hakkar himself!',8413,1,0,'mandokir SAY_AGGRO'), +(-1309016,'DING!',0,1,0,'mandokir SAY_DING_KILL'), +(-1309017,'GRATS!',0,1,0,'mandokir SAY_GRATS_JINDO'), +(-1309018,'I\'m keeping my eye on you, $N!',0,1,0,'mandokir SAY_WATCH'), +(-1309019,'Don\'t make me angry. You won\'t like it when I\'m angry.',0,1,0,'mandokir SAY_WATCH_WHISPER'), +(-1309020,'PRIDE HERALDS THE END OF YOUR WORLD. COME, MORTALS! FACE THE WRATH OF THE SOULFLAYER!',8414,1,0,'hakkar SAY_AGGRO'), +(-1309021,'Fleeing will do you no good, mortals!',0,1,0,'hakkar SAY_FLEEING'), +(-1309022,'You dare set foot upon Hakkari holy ground? Minions of Hakkar, destroy the infidels!',0,1,0,'hakkar SAY_MINION_DESTROY'), +(-1309023,'Minions of Hakkar, hear your God. The sanctity of this temple has been compromised. Invaders encroach upon holy ground! The Altar of Blood must be protected. Kill them all!',0,1,0,'hakkar SAY_PROTECT_ALTAR'); diff --git a/sql/Updates/0.0.2/r726_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r726_scriptdev2_script_texts.sql new file mode 100644 index 0000000..d26c77e --- /dev/null +++ b/sql/Updates/0.0.2/r726_scriptdev2_script_texts.sql @@ -0,0 +1,26 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1568023 AND -1568000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1568000,'Spirits of da wind be your doom!',12031,1,0,'janalai SAY_AGGRO'), +(-1568001,'I burn ya now!',12032,1,0,'janalai SAY_FIRE_BOMBS'), +(-1568002,'Where ma hatcha? Get to work on dem eggs!',12033,1,0,'janalai SAY_SUMMON_HATCHER'), +(-1568003,'I show you strength... in numbers.',12034,1,0,'janalai SAY_ALL_EGGS'), +(-1568004,'You done run outta time!',12035,1,0,'janalai SAY_BERSERK'), +(-1568005,'It all be over now, mon!',12036,1,0,'janalai SAY_SLAY_1'), +(-1568006,'Tazaga-choo!',12037,1,0,'janalai SAY_SLAY_2'), +(-1568007,'Zul\'jin... got a surprise for you...',12038,1,0,'janalai SAY_DEATH'), +(-1568008,'Come, strangers. The spirit of the dragonhawk hot be hungry for worthy souls.',12039,1,0,'janalai SAY_EVENT_STRANGERS'), +(-1568009,'Come, friends. Your bodies gonna feed ma hatchlings, and your souls are going to feed me with power!',12040,1,0,'janalai SAY_EVENT_FRIENDS'), +(-1568010,'Get da move on, guards! It be killin\' time!',12066,1,0,'nalorakk SAY_WAVE1_AGGRO'), +(-1568011,'Guards, go already! Who you more afraid of, dem... or me?',12067,1,0,'nalorakk SAY_WAVE2_STAIR1'), +(-1568012,'Ride now! Ride out dere and bring me back some heads!',12068,1,0,'nalorakk SAY_WAVE3_STAIR2'), +(-1568013,'I be losin\' me patience! Go on: make dem wish dey was never born!',12069,1,0,'nalorakk SAY_WAVE4_PLATFORM'), +(-1568014,'What could be better than servin\' da bear spirit for eternity? Come closer now. Bring your souls to me!',12078,1,0,'nalorakk SAY_EVENT1_SACRIFICE'), +(-1568015,'Don\'t be delayin\' your fate. Come to me now. I make your sacrifice quick.',12079,1,0,'nalorakk SAY_EVENT2_SACRIFICE'), +(-1568016,'You be dead soon enough!',12070,1,0,'nalorakk SAY_AGGRO'), +(-1568017,'I bring da pain!',12071,1,0,'nalorakk SAY_SURGE'), +(-1568018,'You call on da beast, you gonna get more dan you bargain for!',12072,1,0,'nalorakk SAY_TOBEAR'), +(-1568019,'Make way for Nalorakk!',12073,1,0,'nalorakk SAY_TOTROLL'), +(-1568020,'You had your chance, now it be too late!',12074,1,0,'nalorakk SAY_BERSERK'), +(-1568021,'Mua-ha-ha! Now whatchoo got to say?',12075,1,0,'nalorakk SAY_SLAY1'), +(-1568022,'Da Amani gonna rule again!',12076,1,0,'nalorakk SAY_SLAY2'), +(-1568023,'I... be waitin\' on da udda side....',12077,1,0,'nalorakk SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r727_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r727_scriptdev2_script_texts.sql new file mode 100644 index 0000000..fcaed26 --- /dev/null +++ b/sql/Updates/0.0.2/r727_scriptdev2_script_texts.sql @@ -0,0 +1,45 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1509027 AND -1509000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1509000,'senses your fear.',0,2,0,'moam EMOTE_AGGRO'), +(-1509001,'bristles with energy!',0,2,0,'moan EMOTE_MANA_FULL'), +(-1509002,'sets eyes on $N!',0,2,0,'buru EMOTE_TARGET'), +(-1509003,'They come now. Try not to get yourself killed, young blood.',0,1,0,'andorov SAY_ANDOROV_INTRO'), +(-1509004,'Remember, Rajaxx, when I said I\'d kill you last? I lied...',0,1,0,'andorov SAY_ANDOROV_ATTACK'), +(-1509005,'The time of our retribution is at hand! Let darkness reign in the hearts of our enemies!',8612,1,0,'rajaxx SAY_WAVE3'), +(-1509006,'No longer will we wait behind barred doors and walls of stone! No longer will our vengeance be denied! The dragons themselves will tremble before our wrath!',8610,1,0,'rajaxx SAY_WAVE4'), +(-1509007,'Fear is for the enemy! Fear and death!',8608,1,0,'rajaxx SAY_WAVE5'), +(-1509008,'Staghelm will whimper and beg for his life, just as his whelp of a son did! One thousand years of injustice will end this day!',8611,1,0,'rajaxx SAY_WAVE6'), +(-1509009,'Fandral! Your time has come! Go and hide in the Emerald Dream and pray we never find you!',8607,1,0,'rajaxx SAY_WAVE7'), +(-1509010,'Impudent fool! I will kill you myself!',8609,1,0,'rajaxx SAY_INTRO'), +(-1509011,'Attack and make them pay dearly!',8603,1,0,'rajaxx SAY_UNK1'), +(-1509012,'Crush them! Drive them out!',8605,1,0,'rajaxx SAY_UNK2'), +(-1509013,'Do not hesitate! Destroy them!',8606,1,0,'rajaxx SAY_UNK3'), +(-1509014,'Warriors! Captains! Continue the fight!',8613,1,0,'rajaxx SAY_UNK4'), +(-1509015,'You are not worth my time $N!',8614,1,0,'rajaxx SAY_DEAGGRO'), +(-1509016,'Breath your last!',8604,1,0,'rajaxx SAY_KILLS_ANDOROV'), +(-1509017,'Soon you will know the price of your meddling, mortals... The master is nearly whole... And when he rises, your world will be cease!',0,1,0,'rajaxx SAY_COMPLETE_QUEST'); +(-1509018,'I am rejuvinated!',8593,1,0,'ossirian SAY_SURPREME1'), +(-1509019,'My powers are renewed!',8595,1,0,'ossirian SAY_SURPREME2'), +(-1509020,'My powers return!',8596,1,0,'ossirian SAY_SURPREME3'), +(-1509021,'Protect the city at all costs!',8597,1,0,'ossirian SAY_RAND_INTRO1'), +(-1509022,'The walls have been breached!',8599,1,0,'ossirian SAY_RAND_INTRO2'), +(-1509023,'To your posts. Defend the city.',8600,1,0,'ossirian SAY_RAND_INTRO3'), +(-1509024,'Tresspassers will be terminated.',8601,1,0,'ossirian SAY_RAND_INTRO4'), +(-1509025,'Sands of the desert rise and block out the sun!',8598,1,0,'ossirian SAY_AGGRO'), +(-1509026,'You are terminated.',8602,1,0,'ossirian SAY_SLAY'), +(-1509027,'I...have...failed.',8594,1,0,'ossirian SAY_DEATH'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1531011 AND -1531000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1531000,'Are you so eager to die? I would be happy to accomodate you.',8615,1,0,'skeram SAY_AGGRO1'), +(-1531001,'Cower mortals! The age of darkness is at hand.',8616,1,0,'skeram SAY_AGGRO2'), +(-1531002,'Tremble! The end is upon you.',8621,1,0,'skeram SAY_AGGRO3'), +(-1531003,'Let your death serve as an example!',8617,1,0,'skeram SAY_SLAY1'), +(-1531004,'Spineless wretches! You will drown in rivers of blood!',8619,1,0,'skeram SAY_SLAY2'), +(-1531005,'The screams of the dying will fill the air. A symphony of terror is about to begin!',8620,1,0,'skeram SAY_SLAY3'), +(-1531006,'Prepare for the return of the ancient ones!',8618,1,0,'skeram SAY_SPLIT'), +(-1531007,'You only delay... the inevetable.',8622,1,0,'skeram SAY_DEATH'), +(-1531008,'You will be judged for defiling these sacred grounds! The laws of the Ancients will not be challenged! Trespassers will be annihilated!',8646,1,0,'sartura SAY_AGGRO'), +(-1531009,'I sentence you to death!',8647,1,0,'sartura SAY_SLAY'), +(-1531010,'I serve to the last!',8648,1,0,'sartura SAY_DEATH'), +(-1531011,'is weakened!',0,2,0,'cthun EMOTE_WEAKENED'); diff --git a/sql/Updates/0.0.2/r728_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r728_scriptdev2_script_texts.sql new file mode 100644 index 0000000..ae1b7f8 --- /dev/null +++ b/sql/Updates/0.0.2/r728_scriptdev2_script_texts.sql @@ -0,0 +1,12 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1509027 AND -1509018; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1509018,'I am rejuvinated!',8593,1,0,'ossirian SAY_SURPREME1'), +(-1509019,'My powers are renewed!',8595,1,0,'ossirian SAY_SURPREME2'), +(-1509020,'My powers return!',8596,1,0,'ossirian SAY_SURPREME3'), +(-1509021,'Protect the city at all costs!',8597,1,0,'ossirian SAY_RAND_INTRO1'), +(-1509022,'The walls have been breached!',8599,1,0,'ossirian SAY_RAND_INTRO2'), +(-1509023,'To your posts. Defend the city.',8600,1,0,'ossirian SAY_RAND_INTRO3'), +(-1509024,'Tresspassers will be terminated.',8601,1,0,'ossirian SAY_RAND_INTRO4'), +(-1509025,'Sands of the desert rise and block out the sun!',8598,1,0,'ossirian SAY_AGGRO'), +(-1509026,'You are terminated.',8602,1,0,'ossirian SAY_SLAY'), +(-1509027,'I...have...failed.',8594,1,0,'ossirian SAY_DEATH'); diff --git a/sql/Updates/0.0.2/r729_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r729_scriptdev2_script_texts.sql new file mode 100644 index 0000000..9ab405b --- /dev/null +++ b/sql/Updates/0.0.2/r729_scriptdev2_script_texts.sql @@ -0,0 +1,99 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1564096 AND -1564000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1564000,'You will die in the name of Lady Vashj!',11450,1,0,'SAY_AGGRO'), +(-1564001,'Stick around!',11451,1,0,'SAY_NEEDLE1'), +(-1564002,'I\'ll deal with you later!',11452,1,0,'SAY_NEEDLE2'), +(-1564003,'Your success was short lived!',11455,1,0,'SAY_SLAY1'), +(-1564004,'Time for you to go!',11456,1,0,'SAY_SLAY2'), +(-1564005,'Bel\'anen dal\'lorei!',11453,1,0,'SAY_SPECIAL1'), +(-1564006,'Blood will flow!',11454,1,0,'SAY_SPECIAL2'), +(-1564007,'Bal\'amer ch\'itah!',11457,1,0,'SAY_ENRAGE1'), +(-1564008,'My patience has ran out! Die, DIE!',11458,1,0,'SAY_ENRAGE2'), +(-1564009,'Lord Illidan will... crush you.',11459,1,0,'SAY_DEATH'), +(-1564010,'%s acquires a new target!',0,3,0,'supremus EMOTE_NEW_TARGET'), +(-1564011,'%s punches the ground in anger!',0,3,0,'supremus EMOTE_PUNCH_GROUND'), +(-1564012,'The ground begins to crack open!',0,3,0,'supremus EMOTE_GROUND_CRACK'), +(-1564013,'No! Not yet...',11385,1,0,'akama shade SAY_LOW_HEALTH'), +(-1564014,'I will not last much longer...',11386,1,0,'akama shade SAY_DEATH'), +(-1564015,'Come out from the shadows! I\'ve returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!',0,1,0,'akama shade SAY_FREE'), +(-1564016,'Hail our leader! Hail Akama!',0,1,0,'akama shade broken SAY_BROKEN_FREE_01'), +(-1564017,'Hail Akama!',0,1,0,'akama shade broken SAY_BROKEN_FREE_02'), +(-1564018,'You play, you pay.',11501,1,0,'shahraz SAY_TAUNT1'), +(-1564019,'I\'m not impressed.',11502,1,0,'shahraz SAY_TAUNT2'), +(-1564020,'Enjoying yourselves?',11503,1,0,'shahraz SAY_TAUNT3'), +(-1564021,'So... business or pleasure?',11504,1,0,'shahraz SAY_AGGRO'), +(-1564022,'You seem a little tense.',11505,1,0,'shahraz SAY_SPELL1'), +(-1564023,'Don\'t be shy.',11506,1,0,'shahraz SAY_SPELL2'), +(-1564024,'I\'m all... yours.',11507,1,0,'shahraz SAY_SPELL3'), +(-1564025,'Easy come, easy go.',11508,1,0,'shahraz SAY_SLAY1'), +(-1564026,'So much for a happy ending.',11509,1,0,'shahraz SAY_SLAY2'), +(-1564027,'Stop toying with my emotions!',11510,1,0,'shahraz SAY_ENRAGE'), +(-1564028,'I wasn\'t... finished.',11511,1,0,'shahraz SAY_DEATH'), +(-1564029,'Horde will... crush you.',11432,1,0,'bloodboil SOUND_AGGRO'), +(-1564030,'Time to feast!',11433,1,0,'bloodboil SAY_SLAY1'), +(-1564031,'More! I want more!',11434,1,0,'bloodboil SAY_SLAY2'), +(-1564032,'Drink your blood! Eat your flesh!',11435,1,0,'bloodboil SAY_SPECIAL1'), +(-1564033,'I hunger!',11436,1,0,'bloodboil SAY_SPECIAL2'), +(-1564034,'',11437,1,0,'bloodboil SAY_ENRAGE1'), +(-1564035,'I\'ll rip the meat from your bones!',11438,1,0,'bloodboil SAY_ENRAGE2'), +(-1564036,'Aaaahrg...',11439,1,0,'bloodboil SAY_DEATH'), +(-1564037,'I was the first, you know. For me, the wheel of death has spun many times. So much time has passed. I have a lot of catching up to do...',11512,1,0,'teron SAY_INTRO'), +(-1564038,'Vengeance is mine!',11513,1,0,'teron SAY_AGGRO'), +(-1564039,'I have use for you!',11514,1,0,'teron SAY_SLAY1'), +(-1564040,'It gets worse...',11515,1,0,'teron SAY_SLAY2'), +(-1564041,'What are you afraid of?',11517,1,0,'teron SAY_SPELL1'), +(-1564042,'Death... really isn\'t so bad.',11516,1,0,'teron SAY_SPELL2'), +(-1564043,'Give in!',11518,1,0,'teron SAY_SPECIAL1'), +(-1564044,'I have something for you...',11519,1,0,'teron SAY_SPECIAL2'), +(-1564045,'YOU WILL SHOW THE PROPER RESPECT!',11520,1,0,'teron SAY_ENRAGE'), +(-1564046,'The wheel...spins...again....',11521,1,0,'teron SAY_DEATH'), +(-1564047,'Pain and suffering are all that await you!',11415,1,0,'essence SUFF_SAY_FREED'), +(-1564048,'Don\'t leave me alone!',11416,1,0,'essence SUFF_SAY_AGGRO'), +(-1564049,'Look at what you make me do!',11417,1,0,'essence SUFF_SAY_SLAY1'), +(-1564050,'I didn\'t ask for this!',11418,1,0,'essence SUFF_SAY_SLAY2'), +(-1564051,'The pain is only beginning!',11419,1,0,'essence SUFF_SAY_SLAY3'), +(-1564052,'I don\'t want to go back!',11420,1,0,'essence SUFF_SAY_RECAP'), +(-1564053,'Now what do I do?',11421,1,0,'essence SUFF_SAY_AFTER'), +(-1564054,'%s becomes enraged!',0,3,0,'essence SUFF_EMOTE_ENRAGE'), +(-1564055,'You can have anything you desire... for a price.',11408,1,0,'essence DESI_SAY_FREED'), +(-1564056,'Fulfilment is at hand!',11409,1,0,'essence DESI_SAY_SLAY1'), +(-1564057,'Yes... you\'ll stay with us now...',11410,1,0,'essence DESI_SAY_SLAY2'), +(-1564058,'Your reach exceeds your grasp.',11412,1,0,'essence DESI_SAY_SLAY3'), +(-1564059,'Be careful what you wish for...',11411,1,0,'essence DESI_SAY_SPEC'), +(-1564060,'I\'ll be waiting...',11413,1,0,'essence DESI_SAY_RECAP'), +(-1564061,'I won\'t be far...',11414,1,0,'essence DESI_SAY_AFTER'), +(-1564062,'Beware: I live!',11399,1,0,'essence ANGER_SAY_FREED'), +(-1564063,'So... foolish.',11400,1,0,'essence ANGER_SAY_FREED2'), +(-1564064,'',11401,1,0,'essence ANGER_SAY_SLAY1'), +(-1564065,'Enough. No more.',11402,1,0,'essence ANGER_SAY_SLAY2'), +(-1564066,'On your knees!',11403,1,0,'essence ANGER_SAY_SPEC'), +(-1564067,'Beware, coward.',11405,1,0,'essence ANGER_SAY_BEFORE'), +(-1564068,'I won\'t... be... ignored.',11404,1,0,'essence ANGER_SAY_DEATH'), +(-1564069,'You wish to test me?',11524,1,0,'council vera AGGRO'), +(-1564070,'I have better things to do...',11422,1,0,'council gath AGGRO'), +(-1564071,'Flee or die!',11482,1,0,'council mala AGGRO'), +(-1564072,'Common... such a crude language. Bandal!',11440,1,0,'council zere AGGRO'), +(-1564073,'Enough games!',11428,1,0,'council gath ENRAGE'), +(-1564074,'You wish to kill me? Hahaha, you first!',11530,1,0,'council vera ENRAGE'), +(-1564075,'For Quel\'Thalas! For the Sunwell!',11488,1,0,'council mala ENRAGE'), +(-1564076,'Sha\'amoor sine menoor!',11446,1,0,'council zere ENRAGE'), +(-1564077,'Enjoy your final moments!',11426,1,0,'council gath SPECIAL1'), +(-1564078,'You\'re not caught up for this!',11528,1,0,'council vera SPECIAL1'), +(-1564079,'No second chances!',11486,1,0,'council mala SPECIAL1'), +(-1564080,'Diel fin\'al',11444,1,0,'council zere SPECIAL1'), +(-1564081,'You are mine!',11427,1,0,'council gath SPECIAL2'), +(-1564082,'Anar\'alah belore!',11529,1,0,'council vera SPECIAL2'), +(-1564083,'I\'m full of surprises!',11487,1,0,'council mala SPECIAL2'), +(-1564084,'Sha\'amoor ara mashal?',11445,1,0,'council zere SPECIAL2'), +(-1564085,'Selama am\'oronor!',11423,1,0,'council gath SLAY'), +(-1564086,'Valiant effort!',11525,1,0,'council vera SLAY'), +(-1564087,'My work is done.',11483,1,0,'council mala SLAY'), +(-1564088,'Shorel\'aran.',11441,1,0,'council zere SLAY'), +(-1564089,'Well done!',11424,1,0,'council gath SLAY_COMT'), +(-1564090,'A glorious kill!',11526,1,0,'council vera SLAY_COMT'), +(-1564091,'As it should be!',11484,1,0,'council mala SLAY_COMT'), +(-1564092,'Belesa menoor!',11442,1,0,'council zere SLAY_COMT'), +(-1564093,'Lord Illidan... I...',11425,1,0,'council gath DEATH'), +(-1564094,'You got lucky!',11527,1,0,'council vera DEATH'), +(-1564095,'Destiny... awaits.',11485,1,0,'council mala DEATH'), +(-1564096,'Diel ma\'ahn... oreindel\'o',11443,1,0,'council zere DEATH'); diff --git a/sql/Updates/0.0.2/r730_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r730_scriptdev2_script_texts.sql new file mode 100644 index 0000000..f263417 --- /dev/null +++ b/sql/Updates/0.0.2/r730_scriptdev2_script_texts.sql @@ -0,0 +1,21 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1409018 AND -1409000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1409000,'performs one last service for Ragnaros.',0,2,0,'geddon EMOTE_SERVICE'), +(-1409001,'goes into a killing frenzy!',0,2,0,'magmadar EMOTE_FRENZY'), +(-1409002,'refuses to die while its master is in trouble.',0,2,0,'core rager EMOTE_AEGIS'), +(-1409003,'Reckless mortals, none may challenge the sons of the living flame!',8035,1,0,'majordomo SAY_AGGRO'), +(-1409004,'The runes of warding have been destroyed! Hunt down the infedels my bretheren.',8039,1,0,'majordomo SAY_SPAWN'), +(-1409005,'Ashes to Ashes!',8037,1,0,'majordomo SAY_SLAY'), +(-1409006,'Burn mortals! Burn for this transgression!',8036,1,0,'majordomo SAY_SPECIAL'), +(-1409007,'Impossible! Stay your attack mortals! I submitt! I submitt! Brashly you have come to rest the secrets of the living flame. You will soon regret the recklessness of your quest. I go now to summon the lord whos house this is. Should you seek an audiance with him your paltry lives will surly be forfit. Nevertheless seek out his lair if you dare!',8038,1,0,'majordomo SAY_DEFEAT'), +(-1409008,'Behold Ragnaros, the Firelord! He who was ancient when this world was young! Bow before him, mortals! Bow before your ending!',8040,1,0,'ragnaros SAY_SUMMON_MAJ'), +(-1409009,'TOO SOON! YOU HAVE AWAKENED ME TOO SOON, EXECUTUS! WHAT IS THE MEANING OF THIS INTRUSION?',8043,1,0,'ragnaros SAY_ARRIVAL1_RAG'), +(-1409010,'These mortal infidels, my lord! They have invaded your sanctum, and seek to steal your secrets!',8041,1,0,'ragnaros SAY_ARRIVAL2_MAJ'), +(-1409011,'FOOL! YOU ALLOWED THESE INSECTS TO RUN RAMPANT THROUGH THE HALLOWED CORE, AND NOW YOU LEAD THEM TO MY VERY LAIR? YOU HAVE FAILED ME, EXECUTUS! JUSTICE SHALL BE MET, INDEED!',8044,1,0,'ragnaros SAY_ARRIVAL3_RAG'), +(-1409012,'NOW FOR YOU, INSECTS. BOLDLY YOU SAUGHT THE POWER OF RAGNAROS NOW YOU SHALL SEE IT FIRST HAND.',8045,1,0,'ragnaros SAY_ARRIVAL5_RAG'), +(-1409013,'COME FORTH, MY SERVANTS! DEFEND YOUR MASTER!',8049,1,0,'ragnaros SAY_REINFORCEMENTS1'), +(-1409014,'YOU CANNOT DEFEAT THE LIVING FLAME! COME YOU MINIONS OF FIRE! COME FORTH YOU CREATURES OF HATE! YOUR MASTER CALLS!',8050,1,0,'ragnaros SAY_REINFORCEMENTS2'), +(-1409015,'BY FIRE BE PURGED!',8046,1,0,'ragnaros SAY_HAND'), +(-1409016,'TASTE THE FLAMES OF SULFURON!',8047,1,0,'ragnaros SAY_WRATH'), +(-1409017,'DIE INSECT!',8051,1,0,'ragnaros SAY_KILL'), +(-1409018,'MY PATIENCE IS DWINDILING! COME NATS TO YOUR DEATH!',8048,1,0,'ragnaros SAY_MAGMABURST'); diff --git a/sql/Updates/0.0.2/r732_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r732_scriptdev2_script_texts.sql new file mode 100644 index 0000000..0a60099 --- /dev/null +++ b/sql/Updates/0.0.2/r732_scriptdev2_script_texts.sql @@ -0,0 +1,50 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1552030 AND -1552000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1552000,'It is a small matter to control the mind of the weak... for I bear allegiance to powers untouched by time, unmoved by fate. No force on this world or beyond harbors the strength to bend our knee... not even the mighty Legion!',11122,1,0,'skyriss SAY_INTRO'), +(-1552001,'Bear witness to the agent of your demise!',11123,1,0,'skyriss SAY_AGGRO'), +(-1552002,'Your fate is written!',11124,1,0,'skyriss SAY_KILL_1'), +(-1552003,'The chaos I have sown here is but a taste...',11125,1,0,'skyriss SAY_KILL_2'), +(-1552004,'You will do my bidding, weakling.',11127,1,0,'skyriss SAY_MIND_1'), +(-1552005,'Your will is no longer your own.',11128,1,0,'skyriss SAY_MIND_2'), +(-1552006,'Flee in terror!',11129,1,0,'skyriss SAY_FEAR_1'), +(-1552007,'I will show you horrors undreamed of!',11130,1,0,'skyriss SAY_FEAR_2'), +(-1552008,'We span the universe, as countless as the stars!',11131,1,0,'skyriss SAY_IMAGE'), +(-1552009,'I am merely one of... infinite multitudes.',11126,1,0,'skyriss SAY_DEATH'), +(-1552010,'Where in Bonzo\'s brass buttons am I? And who are-- yaaghh, that\'s one mother of a headache!',11171,1,0,'millhouse SAY_INTRO_1'), +(-1552011,'\"Lowly\"? I don\'t care who you are friend, no one refers to the mighty Millhouse Manastorm as \"Lowly\"! I have no idea what goes on here, but I will gladly join your fight against this impudent imbecile! Prepare to defend yourself, cretin!',11172,1,0,'millhouse SAY_INTRO_2'), +(-1552012,'I just need to get some things ready first. You guys go ahead and get started. I need to summon up some water...',11173,1,0,'millhouse SAY_WATER'), +(-1552013,'Fantastic! Next, some protective spells. Yes! Now we\'re cookin\'',11174,1,0,'millhouse SAY_BUFFS'), +(-1552014,'And of course i\'ll need some mana. You guys are gonna love this, just wait.',11175,1,0,'millhouse SAY_DRINK'), +(-1552015,'Aaalllriiiight!! Who ordered up an extra large can of whoop-ass?',11176,1,0,'millhouse SAY_READY'), +(-1552016,'I didn\'t even break a sweat on that one.',11177,1,0,'millhouse SAY_KILL_1'), +(-1552017,'You guys, feel free to jump in anytime.',11178,1,0,'millhouse SAY_KILL_2'), +(-1552018,'I\'m gonna light you up, sweet cheeks!',11179,1,0,'millhouse SAY_PYRO'), +(-1552019,'Ice, ice, baby!',11180,1,0,'millhouse SAY_ICEBLOCK'), +(-1552020,'Heal me! Oh, for the love of all that is holy, HEAL me! I\'m dying!',11181,1,0,'millhouse SAY_LOWHP'), +(-1552021,'You\'ll be hearing from my lawyer...',11182,1,0,'millhouse SAY_DEATH'), +(-1552022,'Who\'s bad? Who\'s bad? That\'s right: we bad!',11183,1,0,'millhouse SAY_COMPLETE'), +(-1552023,'I knew the prince would be angry but, I... I have not been myself. I had to let them out! The great one speaks to me, you see. Wait--outsiders. Kael\'thas did not send you! Good... I\'ll just tell the prince you released the prisoners!',11222,1,0,'mellichar YELL_INTRO1'), +(-1552024,'The naaru kept some of the most dangerous beings in existence here in these cells. Let me introduce you to another...',11223,1,0,'mellichar YELL_INTRO2'), +(-1552025,'Yes, yes... another! Your will is mine!',11224,1,0,'mellichar YELL_RELEASE1'), +(-1552026,'Behold another terrifying creature of incomprehensible power!',11225,1,0,'mellichar YELL_RELEASE2A'), +(-1552027,'What is this? A lowly gnome? I will do better, O\'great one.',11226,1,0,'mellichar YELL_RELEASE2B'), +(-1552028,'Anarchy! Bedlam! Oh, you are so wise! Yes, I see it now, of course!',11227,1,0,'mellichar YELL_RELEASE3'), +(-1552029,'One final cell remains. Yes, O\'great one, right away!',11228,1,0,'mellichar YELL_RELEASE4'), +(-1552030,'Welcome, O\'great one. I am your humble servant.',11229,1,0,'mellichar YELL_WELCOME'); + +DELETE FROM `script_texts` WHERE `entry`=-1000100; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000100,'Come, little ones. Face me!',0,1,0,'azuregos SAY_TELEPORT'); + +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1249004 AND -1249000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1249000,'How fortuitous. Usually, I must leave my lair to feed.',0,1,0,'onyxia SAY_AGGRO'), +(-1249001,'Learn your place mortal!',0,1,0,'onyxia SAY_KILL'), +(-1249002,'This meaningless exertion bores me. I\'ll incinerate you all from above!',0,1,0,'onyxia SAY_PHASE_2_TRANS'), +(-1249003,'It seems you\'ll need another lesson, mortals!',0,1,0,'onyxia SAY_PHASE_3_TRANS'), +(-1249004,'takes in a deep breath...',0,1,0,'onyxia EMOTE_BREATH'); + +DELETE FROM `script_texts` WHERE `entry`=-1469031; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1469031,'goes into a frenzy!',0,2,0,'flamegor EMOTE_FRENZY'); + diff --git a/sql/Updates/0.0.2/r735_mangos.sql b/sql/Updates/0.0.2/r735_mangos.sql new file mode 100644 index 0000000..7a42148 --- /dev/null +++ b/sql/Updates/0.0.2/r735_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`=467; diff --git a/sql/Updates/0.0.2/r735_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r735_scriptdev2_script_texts.sql new file mode 100644 index 0000000..0b7908b --- /dev/null +++ b/sql/Updates/0.0.2/r735_scriptdev2_script_texts.sql @@ -0,0 +1,7 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000105 AND -1000101; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000101,'Follow me, $N. I\'ll take you to the Defias hideout. But you better protect me or I am as good as dead',0,0,7,'defias traitor SAY_START'), +(-1000102,'The entrance is hidden here in Moonbrook. Keep your eyes peeled for thieves. They want me dead.',0,0,7,'defias traitor SAY_PROGRESS'), +(-1000103,'You can go tell Stoutmantle this is where the Defias Gang is holed up, $N.',0,0,7,'defias traitor SAY_END'), +(-1000104,'%s coming in fast! Prepare to fight!',0,0,7,'defias traitor SAY_AGGRO_1'), +(-1000105,'Help!',0,0,7,'defias traitor SAY_AGGRO_2'); diff --git a/sql/Updates/0.0.2/r740_mangos.sql b/sql/Updates/0.0.2/r740_mangos.sql new file mode 100644 index 0000000..5b21597 --- /dev/null +++ b/sql/Updates/0.0.2/r740_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_torek' WHERE `entry`=12858; diff --git a/sql/Updates/0.0.2/r740_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r740_scriptdev2_script_texts.sql new file mode 100644 index 0000000..5f6cccc --- /dev/null +++ b/sql/Updates/0.0.2/r740_scriptdev2_script_texts.sql @@ -0,0 +1,7 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000110 AND -1000106; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000106,'Everyone ready?',0,0,1,'torek SAY_READY'), +(-1000107,'Ok, Lets move out!',0,0,1,'torek SAY_MOVE'), +(-1000108,'Prepare yourselves. Silverwing is just around the bend.',0,0,1,'torek SAY_PREPARE'), +(-1000109,'Silverwing is ours!',0,0,1,'torek SAY_WIN'), +(-1000110,'Go report that the outpost is taken. We will remain here.',0,0,1,'torek SAY_END'); diff --git a/sql/Updates/0.0.2/r743_mangos.sql b/sql/Updates/0.0.2/r743_mangos.sql new file mode 100644 index 0000000..5ff3858 --- /dev/null +++ b/sql/Updates/0.0.2/r743_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_magwin' WHERE `entry`=17312; diff --git a/sql/Updates/0.0.2/r743_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r743_scriptdev2_script_texts.sql new file mode 100644 index 0000000..73249d4 --- /dev/null +++ b/sql/Updates/0.0.2/r743_scriptdev2_script_texts.sql @@ -0,0 +1,8 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000116 AND -1000111; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000111, 'Our house is this way, through the thicket.', 0, 0, 7, 'magwin SAY_START'), +(-1000112, 'Help me!', 0, 0, 7, 'magwin SAY_AGGRO'), +(-1000113, 'My poor family. Everything has been destroyed.', 0, 0, 7, 'magwin SAY_PROGRESS'), +(-1000114, 'Father! Father! You\'re alive!', 0, 0, 7, 'magwin SAY_END1'), +(-1000115, 'You can thank $N for getting me back here safely, father.', 0, 0, 7, 'magwin SAY_END2'), +(-1000116, 'hugs her father.', 0, 2, 7, 'magwin EMOTE_HUG'); diff --git a/sql/Updates/0.0.2/r745_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r745_scriptdev2_script_texts.sql new file mode 100644 index 0000000..c323ad3 --- /dev/null +++ b/sql/Updates/0.0.2/r745_scriptdev2_script_texts.sql @@ -0,0 +1,28 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1560048 AND -1560023; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1560023,'Very well then. Let\'s go!',10465,1,0,'thrall hillsbrad SAY_TH_START_EVENT_PART1'), +(-1560024,'As long as we\'re going with a new plan, I may aswell pick up a weapon and some armor.',0,0,0,'thrall hillsbrad SAY_TH_ARMORY'), +(-1560025,'A rider approaches!',10466,0,0,'thrall hillsbrad SAY_TH_SKARLOC_MEET'), +(-1560026,'I\'ll never be chained again!',10467,1,0,'thrall hillsbrad SAY_TH_SKARLOC_TAUNT'), +(-1560027,'Very well. Tarren Mill lies just west of here. Since time is of the essence...',10468,1,0,'thrall hillsbrad SAY_TH_START_EVENT_PART2'), +(-1560028,'Let\'s ride!',10469,0,0,'thrall hillsbrad SAY_TH_MOUNTS_UP'), +(-1560029,'Taretha must be in the inn. Let\'s go.',0,0,0,'thrall hillsbrad SAY_TH_CHURCH_END'), +(-1560030,'Taretha! What foul magic is this?',0,0,0,'thrall hillsbrad SAY_TH_MEET_TARETHA'), +(-1560031,'Who or what was that?',10470,1,0,'thrall hillsbrad SAY_TH_EPOCH_WONDER'), +(-1560032,'No!',10471,1,0,'thrall hillsbrad SAY_TH_EPOCH_KILL_TARETHA'), +(-1560033,'Goodbye, Taretha. I will never forget your kindness.',10472,1,0,'thrall hillsbrad SAY_TH_EVENT_COMPLETE'), +(-1560034,'Things are looking grim...',10458,1,0,'thrall hillsbrad SAY_TH_RANDOM_LOW_HP1'), +(-1560035,'I will fight to the last!',10459,1,0,'thrall hillsbrad SAY_TH_RANDOM_LOW_HP2'), +(-1560036,'Taretha...',10460,1,0,'thrall hillsbrad SAY_TH_RANDOM_DIE1'), +(-1560037,'A good day...to die...',10461,1,0,'thrall hillsbrad SAY_TH_RANDOM_DIE2'), +(-1560038,'I have earned my freedom!',10448,1,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO1'), +(-1560039,'This day is long overdue. Out of my way!',10449,1,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO2'), +(-1560040,'I am a slave no longer!',10450,1,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO3'), +(-1560041,'Blackmoore has much to answer for!',10451,1,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO4'), +(-1560042,'You have forced my hand!',10452,1,0,'thrall hillsbrad SAY_TH_RANDOM_KILL1'), +(-1560043,'It should not have come to this!',10453,1,0,'thrall hillsbrad SAY_TH_RANDOM_KILL2'), +(-1560044,'I did not ask for this!',10454,1,0,'thrall hillsbrad SAY_TH_RANDOM_KILL3'), +(-1560045,'I am truly in your debt, strangers.',10455,1,0,'thrall hillsbrad SAY_TH_LEAVE_COMBAT1'), +(-1560046,'Thank you, strangers. You have given me hope.',10456,1,0,'thrall hillsbrad SAY_TH_LEAVE_COMBAT2'), +(-1560047,'I will not waste this chance. I will seek out my destiny.',10457,1,0,'thrall hillsbrad SAY_TH_LEAVE_COMBAT3'), +(-1560048,'I\'m free! Thank you all!',0,0,0,'taretha SAY_TA_FREE'); diff --git a/sql/Updates/0.0.2/r747_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r747_scriptdev2_script_texts.sql new file mode 100644 index 0000000..354bc71 --- /dev/null +++ b/sql/Updates/0.0.2/r747_scriptdev2_script_texts.sql @@ -0,0 +1,3 @@ +DELETE FROM `script_texts` WHERE `entry`=-1560049; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1560049,'Thrall, you escaped!',0,0,0,'taretha SAY_TA_ESCAPED'); diff --git a/sql/Updates/0.0.2/r751_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r751_scriptdev2_script_texts.sql new file mode 100644 index 0000000..e31ef02 --- /dev/null +++ b/sql/Updates/0.0.2/r751_scriptdev2_script_texts.sql @@ -0,0 +1,20 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1534017 AND -1534000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1534000,'I\'m in jeopardy, help me if you can!',11007,1,0,'jaina hyjal ATTACKED 1'), +(-1534001,'They\'ve broken through!',11049,1,0,'jaina hyjal ATTACKED 2'), +(-1534002,'Stay alert! Another wave approaches.',11008,1,0,'jaina hyjal INCOMING'), +(-1534003,'Don\'t give up! We must prevail!',11006,1,0,'jaina hyjal BEGIN'), +(-1534004,'Hold them back as long as possible.',11050,1,0,'jaina hyjal RALLY 1'), +(-1534005,'We must hold strong!',11051,1,0,'jaina hyjal RALLY 2'), +(-1534006,'We are lost. Fall back!',11009,1,0,'jaina hyjal FAILURE'), +(-1534007,'We have won valuable time. Now we must pull back!',11011,1,0,'jaina hyjal SUCCESS'), +(-1534008,'I did... my best.',11010,1,0,'jaina hyjal DEATH'), +(-1534009,'I will lie down for no one!',11031,1,0,'thrall hyjal ATTACKED 1'), +(-1534010,'Bring the fight to me and pay with your lives!',11061,1,0,'thrall hyjal ATTACKED 2'), +(-1534011,'Make ready for another wave! LOK-TAR OGAR!',11032,1,0,'thrall hyjal INCOMING'), +(-1534012,'Hold them back! Do not falter!',11030,1,0,'thrall hyjal BEGIN'), +(-1534013,'Victory or death!',11059,1,0,'thrall hyjal RALLY 1'), +(-1534014,'Do not give an inch of ground!',11060,1,0,'thrall hyjal RALLY 2'), +(-1534015,'It is over. Withdraw! We have failed.',11033,1,0,'thrall hyjal FAILURE'), +(-1534016,'We have played our part and done well. It is up to the others now.',11035,1,0,'thrall hyjal SUCCESS'), +(-1534017,'Uraaa...',11034,1,0,'thrall hyjal DEATH'); diff --git a/sql/Updates/0.0.2/r755_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r755_scriptdev2_script_texts.sql new file mode 100644 index 0000000..5b22667 --- /dev/null +++ b/sql/Updates/0.0.2/r755_scriptdev2_script_texts.sql @@ -0,0 +1,15 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1534030 AND -1534018; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1534018,'All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.',10986,1,0,'archimonde SAY_PRE_EVENTS_COMPLETE'), +(-1534019,'Your resistance is insignificant.',10987,1,0,'archimonde SAY_AGGRO'), +(-1534020,'This world will burn!',10990,1,0,'archimonde SAY_DOOMFIRE1'), +(-1534021,'Manach sheek-thrish!',11041,1,0,'archimonde SAY_DOOMFIRE2'), +(-1534022,'A-kreesh!',10989,1,0,'archimonde SAY_AIR_BURST1'), +(-1534023,'Away vermin!',11043,1,0,'archimonde SAY_AIR_BURST2'), +(-1534024,'All creation will be devoured!',11044,1,0,'archimonde SAY_SLAY1'), +(-1534025,'Your soul will languish for eternity.',10991,1,0,'archimonde SAY_SLAY2'), +(-1534026,'I am the coming of the end!',11045,1,0,'archimonde SAY_SLAY3'), +(-1534027,'At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!',10993,1,0,'archimonde SAY_ENRAGE'), +(-1534028,'No, it cannot be! Nooo!',10992,1,0,'archimonde SAY_DEATH'), +(-1534029,'You are mine now.',10988,1,0,'archimonde SAY_SOUL_CHARGE1'), +(-1534030,'Bow to my will.',11042,1,0,'archimonde SAY_SOUL_CHARGE2'); diff --git a/sql/Updates/0.0.2/r757_mangos.sql b/sql/Updates/0.0.2/r757_mangos.sql new file mode 100644 index 0000000..c33b00b --- /dev/null +++ b/sql/Updates/0.0.2/r757_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_wounded_blood_elf' WHERE `entry`=16993; diff --git a/sql/Updates/0.0.2/r757_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r757_scriptdev2_script_texts.sql new file mode 100644 index 0000000..44506cc --- /dev/null +++ b/sql/Updates/0.0.2/r757_scriptdev2_script_texts.sql @@ -0,0 +1,8 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000117 AND -1000122; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000117, 'Thank you for agreeing to help. Now, let\'s get out of here $N.', 0, 0, 1, 'wounded elf SAY_ELF_START'), +(-1000118, 'Over there! They\'re following us!', 0, 0, 1, 'wounded elf SAY_ELF_SUMMON1'), +(-1000119, 'Allow me a moment to rest. The journey taxes what little strength I have.', 0, 0, 1, 'wounded elf SAY_ELF_RESTING'), +(-1000120, 'Did you hear something?', 0, 0, 1, 'wounded elf SAY_ELF_SUMMON2'), +(-1000121, 'Falcon Watch, at last! Now, where\'s my... Oh no! My pack, it\'s missing! Where has -', 0, 0, 1, 'wounded elf SAY_ELF_COMPLETE'), +(-1000122, 'You won\'t keep me from getting to Falcon Watch!', 0, 0, 1, 'wounded elf SAY_ELF_AGGRO'); diff --git a/sql/Updates/0.0.2/r764_mangos.sql b/sql/Updates/0.0.2/r764_mangos.sql new file mode 100644 index 0000000..d86d3a5 --- /dev/null +++ b/sql/Updates/0.0.2/r764_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='mob_abyssal' WHERE `entry`=17454; diff --git a/sql/Updates/0.0.2/r764_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r764_scriptdev2_script_texts.sql new file mode 100644 index 0000000..f827342 --- /dev/null +++ b/sql/Updates/0.0.2/r764_scriptdev2_script_texts.sql @@ -0,0 +1,5 @@ +DELETE FROM `script_texts` WHERE `entry`=-1544015; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1544015,'breaks free!',0,2,0,'magtheridon EMOTE_FREED'); + +UPDATE `script_texts` SET `type`=3 WHERE `entry`=-1544013; diff --git a/sql/Updates/0.0.2/r766_mangos.sql b/sql/Updates/0.0.2/r766_mangos.sql new file mode 100644 index 0000000..dc06600 --- /dev/null +++ b/sql/Updates/0.0.2/r766_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='mob_scarlet_trainee' WHERE `entry`=6575; diff --git a/sql/Updates/0.0.2/r766_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r766_scriptdev2_script_texts.sql new file mode 100644 index 0000000..b4e6d14 --- /dev/null +++ b/sql/Updates/0.0.2/r766_scriptdev2_script_texts.sql @@ -0,0 +1,7 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1189004 AND -1189000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1189000,'Ah, I have been waiting for a real challenge!',5830,1,0,'herod SAY_AGGRO'), +(-1189001,'Blades of Light!',5832,1,0,'herod SAY_WHIRLWIND'), +(-1189002,'Light, give me strength!',5833,1,0,'herod SAY_ENRAGE'), +(-1189003,'Hah, is that all?',5831,1,0,'herod SAY_KILL'), +(-1189004,'becomes enraged!',0,2,0,'herod EMOTE_ENRAGE'); diff --git a/sql/Updates/0.0.2/r767_mangos.sql b/sql/Updates/0.0.2/r767_mangos.sql new file mode 100644 index 0000000..e80b48d --- /dev/null +++ b/sql/Updates/0.0.2/r767_mangos.sql @@ -0,0 +1 @@ +UPDATE `instance_template` SET `script`='instance_scarlet_monastery' WHERE `map`=189; diff --git a/sql/Updates/0.0.2/r768_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r768_scriptdev2_script_texts.sql new file mode 100644 index 0000000..af342c4 --- /dev/null +++ b/sql/Updates/0.0.2/r768_scriptdev2_script_texts.sql @@ -0,0 +1,8 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1189010 AND -1189005; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1189005,'Infidels! They must be purified!',5835,1,0,'mograine SAY_MO_AGGRO'), +(-1189006,'Unworthy!',5836,1,0,'mograine SAY_MO_KILL'), +(-1189007,'At your side, milady!',5837,1,0,'mograine SAY_MO_RESSURECTED'), +(-1189008,'What, Mograine has fallen? You shall pay for this treachery!',5838,1,0,'whitemane SAY_WH_INTRO'), +(-1189009,'The Light has spoken!',5839,1,0,'whitemane SAY_WH_KILL'), +(-1189010,'Arise, my champion!',5840,1,0,'whitemane SAY_WH_RESSURECT'); diff --git a/sql/Updates/0.0.2/r769_mangos.sql b/sql/Updates/0.0.2/r769_mangos.sql new file mode 100644 index 0000000..c10e1f6 --- /dev/null +++ b/sql/Updates/0.0.2/r769_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='mob_phoenix_tk' WHERE `entry`=21362; +UPDATE `creature_template` SET `ScriptName`='mob_phoenix_egg_tk' WHERE `entry`=21364; diff --git a/sql/Updates/0.0.2/r771_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r771_scriptdev2_script_texts.sql new file mode 100644 index 0000000..96bb00b --- /dev/null +++ b/sql/Updates/0.0.2/r771_scriptdev2_script_texts.sql @@ -0,0 +1,14 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1532114 AND -1532103; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1532103,'Welcome Ladies and Gentlemen, to this evening\'s presentation!',9174,1,0,'barnes OZ1'), +(-1532104,'Tonight we plumb the depths of the human soul as we join a lost, lonely girl trying desperately -- with the help of her loyal companions -- to find her way home!',9338,1,0,'barnes OZ2'), +(-1532105,'But she is pursued... by a wicked malevolent crone!',9339,1,0,'barnes OZ3'), +(-1532106,'Will she survive? Will she prevail? Only time will tell. And now ... on with the show!',9340,1,0,'barnes OZ4'), +(-1532107,'Good evening, Ladies and Gentlemen! Welcome to this evening\'s presentation!',9175,1,0,'barnes HOOD1'), +(-1532108,'Tonight, things are not what they seem. For tonight, your eyes may not be trusted',9335,1,0,'barnes HOOD2'), +(-1532109,'Take for instance, this quiet, elderly woman, waiting for a visit from her granddaughter. Surely there is nothing to fear from this sweet, grey-haired, old lady.',9336,1,0,'barnes HOOD3'), +(-1532110,'But don\'t let me pull the wool over your eyes. See for yourself what lies beneath those covers! And now... on with the show!',9337,1,0,'barnes HOOD4'), +(-1532111,'Welcome, Ladies and Gentlemen, to this evening\'s presentation!',9176,1,0,'barnes RAJ1'), +(-1532112,'Tonight, we explore a tale of forbidden love!',9341,1,0,'barnes RAJ2'), +(-1532113,'But beware, for not all love stories end happily, as you may find out. Sometimes, love pricks like a thorn.',9342,1,0,'barnes RAJ3'), +(-1532114,'But don\'t take it from me, see for yourself what tragedy lies ahead when the paths of star-crossed lovers meet. And now...on with the show!',9343,1,0,'barnes RAJ4'); diff --git a/sql/Updates/0.0.2/r772_mangos.sql b/sql/Updates/0.0.2/r772_mangos.sql new file mode 100644 index 0000000..b0f288e --- /dev/null +++ b/sql/Updates/0.0.2/r772_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_highlord_demitrian' WHERE `entry`=14347; diff --git a/sql/Updates/0.0.2/r777_mangos.sql b/sql/Updates/0.0.2/r777_mangos.sql new file mode 100644 index 0000000..f6aae27 --- /dev/null +++ b/sql/Updates/0.0.2/r777_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_gauntlet_gate' WHERE `entry`=175357; +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=11197; +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=10399; diff --git a/sql/Updates/0.0.2/r778_mangos.sql b/sql/Updates/0.0.2/r778_mangos.sql new file mode 100644 index 0000000..7e8a18c --- /dev/null +++ b/sql/Updates/0.0.2/r778_mangos.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_barrel_old_hillsbrad' WHERE `entry`=182589; diff --git a/sql/Updates/0.0.2/r779_mangos.sql b/sql/Updates/0.0.2/r779_mangos.sql new file mode 100644 index 0000000..0198ae3 --- /dev/null +++ b/sql/Updates/0.0.2/r779_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `instance_template` SET `script`='instance_deadmines' WHERE `map`=36; +UPDATE `gameobject_template` SET `ScriptName`='go_defias_cannon' WHERE `entry`=16398; +UPDATE `gameobject_template` SET `ScriptName`='go_door_lever_dm' WHERE `entry`=101833; diff --git a/sql/Updates/0.0.2/r779_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r779_scriptdev2_script_texts.sql new file mode 100644 index 0000000..ae717ba --- /dev/null +++ b/sql/Updates/0.0.2/r779_scriptdev2_script_texts.sql @@ -0,0 +1,4 @@ +DELETE FROM `script_texts` WHERE `entry` IN (-1036000,-1036001); +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1036000,'You there, check out that noise!',5775,1,7,'smite INST_SAY_ALARM1'), +(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,1,7,'smite INST_SAY_ALARM2'); diff --git a/sql/Updates/0.0.2/r78.sql b/sql/Updates/0.0.2/r78.sql new file mode 100644 index 0000000..590c86e --- /dev/null +++ b/sql/Updates/0.0.2/r78.sql @@ -0,0 +1,3 @@ +UPDATE `item_template` SET `ScriptName` = 'nether_wraith_beacon' WHERE `entry` = 31742; +UPDATE `item_template` SET `ScriptName` = 'area_52_special' WHERE `entry` = 28132; +UPDATE `creature_template` SET `ScriptName` = 'guard_shattrath' WHERE `entry` = 19687; diff --git a/sql/Updates/0.0.2/r782_mangos.sql b/sql/Updates/0.0.2/r782_mangos.sql new file mode 100644 index 0000000..c066f02 --- /dev/null +++ b/sql/Updates/0.0.2/r782_mangos.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_main_chambers_access_panel' WHERE `entry` IN (184125,184126); diff --git a/sql/Updates/0.0.2/r783_mangos.sql b/sql/Updates/0.0.2/r783_mangos.sql new file mode 100644 index 0000000..6a1e8a8 --- /dev/null +++ b/sql/Updates/0.0.2/r783_mangos.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='npc_twiggy_flathead' WHERE `entry`=6248; +DELETE FROM `areatrigger_scripts` WHERE `entry`=522; +INSERT INTO `areatrigger_scripts` VALUES (522,'at_twiggy_flathead'); diff --git a/sql/Updates/0.0.2/r783_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r783_scriptdev2_script_texts.sql new file mode 100644 index 0000000..d03a607 --- /dev/null +++ b/sql/Updates/0.0.2/r783_scriptdev2_script_texts.sql @@ -0,0 +1,7 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000127 AND -1000123; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000123, 'Ready when you are, $c.', 0, 0, 0, 'big will SAY_BIG_WILL_READY'), +(-1000124, 'The Affray has begun. $n, get ready to fight!', 0, 0, 0, 'twiggy SAY_TWIGGY_BEGIN'), +(-1000125, 'You! Enter the fray!', 0, 0, 0, 'twiggy SAY_TWIGGY_FRAY'), +(-1000126, 'Challenger is down!', 0, 0, 0, 'twiggy SAY_TWIGGY_DOWN'), +(-1000127, 'The Affray is over.', 0, 0, 0, 'twiggy SAY_TWIGGY_OVER'); diff --git a/sql/Updates/0.0.2/r790_mangos.sql b/sql/Updates/0.0.2/r790_mangos.sql new file mode 100644 index 0000000..ea6ffc2 --- /dev/null +++ b/sql/Updates/0.0.2/r790_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `instance_template` SET `script`='instance_dark_portal' WHERE `map`=269; +UPDATE `creature_template` SET `ScriptName`='npc_medivh_bm' WHERE `entry`=15608; +UPDATE `creature_template` SET `ScriptName`='npc_time_rift' WHERE `entry`=17838; +UPDATE `creature_template` SET `ScriptName`='npc_saat' WHERE `entry`=20201; diff --git a/sql/Updates/0.0.2/r794_mangos.sql b/sql/Updates/0.0.2/r794_mangos.sql new file mode 100644 index 0000000..3bcd8ec --- /dev/null +++ b/sql/Updates/0.0.2/r794_mangos.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry` IN (15299,15621,15667,15689,15928,15929,15930,15931,15936,15990,16060,16539,17161,17225,21002,24552); +UPDATE `creature_template` SET `ScriptName`='mob_unkor_the_ruthless' WHERE `entry`=18262; +UPDATE `creature_template` SET `ScriptName`='mob_tito' WHERE `entry`=17548; +UPDATE `creature_template` SET `ScriptName`='mob_ohgan' WHERE `entry`=14988; +UPDATE `instance_template` SET `script`='' WHERE `map` IN (469,509,533); diff --git a/sql/Updates/0.0.2/r796_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r796_scriptdev2_script_texts.sql new file mode 100644 index 0000000..32cfa92 --- /dev/null +++ b/sql/Updates/0.0.2/r796_scriptdev2_script_texts.sql @@ -0,0 +1,13 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1269028 AND -1269018; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1269018,'goes into a frenzy!',0,2,0,'aeonus EMOTE_FRENZY'), +(-1269019,'Stop! Do not go further, mortals. You are ill-prepared to face the forces of the Infinite Dragonflight. Come, let me help you.',0,0,0,'saat SAY_SAAT_WELCOME'), +(-1269020,'The time has come! Gul\'dan, order your warlocks to double their efforts! Moments from now the gateway will open, and your Horde will be released upon this ripe, unsuspecting world!',10435,1,0,'medivh SAY_ENTER'), +(-1269021,'What is this? Champions, coming to my aid? I sense the hand of the dark one in this. Truly this sacred event bears his blessing?',10436,1,0,'medivh SAY_INTRO'), +(-1269022,'Champions, my shield grows weak!',10437,1,0,'medivh SAY_WEAK75'), +(-1269023,'My powers must be concentrated on the portal! I do not have time to hold the shield!',10438,1,0,'medivh SAY_WEAK50'), +(-1269024,'The shield is nearly gone! All that I have worked for is in danger!',10439,1,0,'medivh SAY_WEAK25'), +(-1269025,'No... damn this feeble mortal coil...',10441,1,0,'medivh SAY_DEATH'), +(-1269026,'I am grateful for your aid, champions. Now, Gul\'dan\'s Horde will sweep across this world, like a locust swarm, and all my designs, all my carefully laid plans will at last fall into place.',10440,1,0,'medivh SAY_WIN'), +(-1269027,'Orcs of the Horde! This portalis the gateway to your new destiny! Azeroth lies before you, ripe for the taking!',0,1,0,'medivh SAY_ORCS_ENTER'), +(-1269028,'Gul\'dan speaks the truth! We should return at once to tell our brothers of the news! Retreat back trought the portal!',0,1,0,'medivh SAY_ORCS_ANSWER'); diff --git a/sql/Updates/0.0.2/r802_mangos.sql b/sql/Updates/0.0.2/r802_mangos.sql new file mode 100644 index 0000000..eef412f --- /dev/null +++ b/sql/Updates/0.0.2/r802_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=21807; + +DELETE FROM `areatrigger_scripts` WHERE `entry`=4560; +INSERT INTO `areatrigger_scripts` VALUES (4560,'at_legion_teleporter'); diff --git a/sql/Updates/0.0.2/r804_mangos.sql b/sql/Updates/0.0.2/r804_mangos.sql new file mode 100644 index 0000000..6b04f02 --- /dev/null +++ b/sql/Updates/0.0.2/r804_mangos.sql @@ -0,0 +1,4 @@ +UPDATE `creature_template` SET `ScriptName`='npc_commander_dawnforge' WHERE `entry`=19831; + +DELETE FROM `areatrigger_scripts` WHERE `entry`=4497; +INSERT INTO `areatrigger_scripts` VALUES (4497,'at_commander_dawnforge'); diff --git a/sql/Updates/0.0.2/r804_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r804_scriptdev2_script_texts.sql new file mode 100644 index 0000000..6b0662b --- /dev/null +++ b/sql/Updates/0.0.2/r804_scriptdev2_script_texts.sql @@ -0,0 +1,12 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000137 AND -1000128; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000128, 'We need you to send reinforcements to Manaforge Duro, Ardonis. This is not a request, it\'s an order.', 0, 0, 0, 'dawnforge SAY_COMMANDER_DAWNFORGE_1'), +(-1000129, 'You cannot be serious! We are severely understaffed and can barely keep this manaforge functional!', 0, 0, 0, 'dawnforge SAY_ARCANIST_ARDONIS_1'), +(-1000130, 'You will do as ordered. Manaforge Duro has come under heavy attack by mana creatures and the situation is out of control. Failure to comply will not be tolerated!', 0, 0, 0, 'dawnforge SAY_COMMANDER_DAWNFORGE_2'), +(-1000131, 'Indeed, it is not a request.', 0, 0, 0, 'dawnforge SAY_PATHALEON_CULATOR_IMAGE_1'), +(-1000132, 'My lord!', 0, 0, 0, 'dawnforge SAY_COMMANDER_DAWNFORGE_3'), +(-1000133, 'Duro will be reinforced! Ultris was a complete disaster. I will NOT have that mistake repeated!', 0, 0, 0, 'dawnforge PATHALEON_CULATOR_IMAGE_2'), +(-1000134, 'We\'ve had too many setbacks along the way: Hellfire Citadel, Fallen Sky Ridge, Firewing Point... Prince Kael\'thas will tolerate no further delays. I will tolerate nothing other than complete success!', 0, 0, 0, 'dawnforge PATHALEON_CULATOR_IMAGE_2_1'), +(-1000135, 'I am returning to Tempest Keep. See to it that I do not have reason to return!', 0, 0, 0, 'dawnforge PATHALEON_CULATOR_IMAGE_2_2' ), +(-1000136, 'Yes, my lord.', 0, 0, 0, 'dawnforge COMMANDER_DAWNFORGE_4 SAY_ARCANIST_ARDONIS_2'), +(-1000137, 'See to it, Ardonis!', 0, 0, 0, 'dawnforge COMMANDER_DAWNFORGE_5'); diff --git a/sql/Updates/0.0.2/r809_mangos.sql b/sql/Updates/0.0.2/r809_mangos.sql new file mode 100644 index 0000000..4e29aa4 --- /dev/null +++ b/sql/Updates/0.0.2/r809_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='npc_aeranas' WHERE `entry`=17085; +UPDATE `gameobject_template` SET `ScriptName`='go_haaleshi_altar' WHERE `entry`=181606; diff --git a/sql/Updates/0.0.2/r809_scriptdev2_script_texts.sql b/sql/Updates/0.0.2/r809_scriptdev2_script_texts.sql new file mode 100644 index 0000000..7bf8b82 --- /dev/null +++ b/sql/Updates/0.0.2/r809_scriptdev2_script_texts.sql @@ -0,0 +1,4 @@ +DELETE FROM `script_texts` WHERE `entry` IN (-1000138,-1000139); +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000138, 'Avruu\'s magic... it still controls me. You must fight me, mortal. It\'s the only way to break the spell!', 0, 0, 0, 'aeranas SAY_SUMMON'), +(-1000139, 'Avruu\'s magic is broken! I\'m free once again!', 0, 0, 0, 'aeranas SAY_FREE'); diff --git a/sql/Updates/0.0.2/r81.sql b/sql/Updates/0.0.2/r81.sql new file mode 100644 index 0000000..5548744 --- /dev/null +++ b/sql/Updates/0.0.2/r81.sql @@ -0,0 +1,17 @@ +UPDATE `creature_template` SET `ScriptName` = 'boss_gyth' WHERE `entry` = 10339; +UPDATE `creature_template` SET `ScriptName` = 'boss_rend_blackhand' WHERE `entry` = 10429; +UPDATE `creature_template` SET `ScriptName` = 'boss_pyroguard_emberseer' WHERE `entry` = 9816; +UPDATE `creature_template` SET `ScriptName` = 'mob_chromatic_elite_guard' WHERE `entry` = 10814; +UPDATE `creature_template` SET `ScriptName` = 'mob_ancient_core_hound' WHERE `entry` = 11673; +UPDATE `creature_template` SET `ScriptName` = 'mob_core_rager' WHERE `entry` = 11672; +UPDATE `creature_template` SET `ScriptName` = 'mob_firesworn' WHERE `entry` = 12099; +UPDATE `creature_template` SET `ScriptName` = 'mob_firewalker' WHERE `entry` = 11666; +UPDATE `creature_template` SET `ScriptName` = 'mob_flame_guard' WHERE `entry` = 11667; +UPDATE `creature_template` SET `ScriptName` = 'mob_flamewaker' WHERE `entry` = 11661; +UPDATE `creature_template` SET `ScriptName` = 'mob_flamewaker_elite' WHERE `entry` = 11664; +UPDATE `creature_template` SET `ScriptName` = 'mob_flamewaker_healer' WHERE `entry` = 11663; +UPDATE `creature_template` SET `ScriptName` = 'mob_flamewaker_protector' WHERE `entry` = 12119; +UPDATE `creature_template` SET `ScriptName` = 'mob_lavaspawn' WHERE `entry` = 12265; +UPDATE `creature_template` SET `ScriptName` = 'mob_molten_destroyer' WHERE `entry` = 11659; +UPDATE `creature_template` SET `ScriptName` = 'mob_molten_giant' WHERE `entry` = 11658; +UPDATE `creature_template` SET `ScriptName` = 'boss_azuregos' WHERE `entry` = 6109; diff --git a/sql/Updates/0.0.2/r810_mangos.sql b/sql/Updates/0.0.2/r810_mangos.sql new file mode 100644 index 0000000..7495791 --- /dev/null +++ b/sql/Updates/0.0.2/r810_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_mausoleum_trigger' WHERE `entry`=104593; +UPDATE `gameobject_template` SET `ScriptName`='go_mausoleum_door' WHERE `entry`=176594; diff --git a/sql/Updates/0.0.2/r91.sql b/sql/Updates/0.0.2/r91.sql new file mode 100644 index 0000000..237b5cd --- /dev/null +++ b/sql/Updates/0.0.2/r91.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_great_bear_spirit' WHERE `entry` = 11956; +UPDATE `creature_template` SET `ScriptName` = 'npcs_rutgar_and_frankal.cpp' WHERE `entry` IN (15170, 15171); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r92.sql b/sql/Updates/0.0.2/r92.sql new file mode 100644 index 0000000..b149b69 --- /dev/null +++ b/sql/Updates/0.0.2/r92.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npcs_rutgar_and_frankal' WHERE `entry` IN (15170, 15171); \ No newline at end of file diff --git a/sql/Updates/0.0.2/r97.sql b/sql/Updates/0.0.2/r97.sql new file mode 100644 index 0000000..ef6c18a --- /dev/null +++ b/sql/Updates/0.0.2/r97.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npcs_captains_blackanvil_and_skullsplit' WHERE `entry` IN (15440, 15612); diff --git a/sql/Updates/0.0.3/Makefile.am b/sql/Updates/0.0.3/Makefile.am new file mode 100644 index 0000000..b18efca --- /dev/null +++ b/sql/Updates/0.0.3/Makefile.am @@ -0,0 +1,304 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse + +## Change installation location +# datadir = scriptdev2/sql/updates/0.0.3 +pkgdatadir = $(datadir)/scriptdev2/sql/updates/0.0.3 + +## Files to be installed +# Install basic SQL files to datadir +pkgdata_DATA = \ + r814_scriptdev2_eventai_scripts.sql \ + r820_scriptdev2_script_texts.sql \ + r822_mangos.sql \ + r822_scriptdev2_script_texts.sql \ + r823_scriptdev2_script_texts.sql \ + r824_mangos.sql \ + r824_scriptdev2_script_texts.sql \ + r825_scriptdev2_script_texts.sql \ + r826_scriptdev2.sql \ + r827_mangos.sql \ + r828_mangos.sql \ + r834_mangos.sql \ + r834_scriptdev2_script_texts.sql \ + r835_mangos.sql \ + r845_mangos.sql \ + r846_scriptdev2.sql \ + r847_scriptdev2_script_texts.sql \ + r848_scriptdev2_script_texts.sql \ + r849_scriptdev2_script_texts.sql \ + r850_mangos.sql \ + r851_scriptdev2_script_texts.sql \ + r852_scriptdev2_script_texts.sql \ + r854_scriptdev2_script_texts.sql \ + r855_scriptdev2_script_texts.sql \ + r856_scriptdev2_script_texts.sql \ + r860_scriptdev2_script_texts.sql \ + r862_scriptdev2_script_texts.sql \ + r863_mangos.sql \ + r872_mangos.sql \ + r883_mangos.sql \ + r895_mangos.sql \ + r900_mangos.sql \ + r903_mangos.sql \ + r903_scriptdev2_script_texts.sql \ + r907_mangos.sql \ + r907_scriptdev2_script_texts.sql \ + r909_mangos.sql \ + r910_scriptdev2_script_texts.sql \ + r912_mangos.sql \ + r912_scriptdev2_script_texts.sql \ + r916_mangos.sql \ + r916_scriptdev2_script_texts.sql \ + r919_mangos.sql \ + r922_scriptdev2_script_waypoint.sql \ + r924_scriptdev2_script_waypoint.sql \ + r936_scriptdev2_script_waypoint.sql \ + r937_mangos.sql \ + r937_scriptdev2_script_texts.sql \ + r937_scriptdev2_script_waypoint.sql \ + r939_scriptdev2_script_texts.sql \ + r940_mangos.sql \ + r941_mangos.sql \ + r945_mangos.sql \ + r945_scriptdev2_script_texts.sql \ + r945_scriptdev2_script_waypoint.sql \ + r947_mangos.sql \ + r949_scriptdev2_script_waypoint.sql \ + r951_scriptdev2_script_waypoint.sql \ + r953_scriptdev2_script_waypoint.sql \ + r956_scriptdev2.sql \ + r963_mangos.sql \ + r964_mangos.sql \ + r965_mangos.sql \ + r965_scriptdev2.sql \ + r972_mangos.sql \ + r972_scriptdev2.sql \ + r973_mangos.sql \ + r973_scriptdev2_script_waypoint.sql \ + r975_mangos.sql \ + r975_scriptdev2.sql \ + r976_mangos.sql \ + r976_scriptdev2.sql \ + r978_mangos.sql \ + r979_mangos.sql \ + r979_scriptdev2_script_texts.sql \ + r980_mangos.sql \ + r982_mangos.sql \ + r982_scriptdev2_script_texts.sql \ + r989_mangos.sql \ + r990_mangos.sql \ + r991_scriptdev2.sql \ + r992_mangos.sql \ + r993_mangos.sql \ + r993_scriptdev2_script_texts.sql \ + r995_mangos.sql \ + r995_scriptdev2.sql \ + r997_mangos.sql \ + r998_mangos.sql \ + r998_scriptdev2_script_texts.sql \ + r1002_scriptdev2.sql \ + r1006_scriptdev2.sql \ + r1008_mangos.sql \ + r1008_scriptdev2.sql \ + r1009_scriptdev2.sql \ + r1010_mangos.sql \ + r1010_scriptdev2.sql \ + r1012_mangos.sql \ + r1012_scriptdev2.sql \ + r1014_mangos.sql \ + r1014_scriptdev2.sql \ + r1016_scriptdev2.sql \ + r1023_scriptdev2.sql \ + r1025_mangos.sql \ + r1030_scriptdev2.sql \ + r1032_mangos.sql \ + r1032_scriptdev2.sql \ + r1039_mangos.sql \ + r1056_scriptdev2.sql \ + r1058_mangos.sql \ + r1058_scriptdev2.sql \ + r1062_mangos.sql \ + r1067_mangos.sql \ + r1068_mangos.sql \ + r1068_scriptdev2.sql \ + r1069_mangos.sql \ + r1073_mangos.sql \ + r1074_scriptdev2.sql \ + r1075_mangos.sql \ + r1080_scriptdev2.sql \ + r1082_mangos.sql \ + r1098_scriptdev2.sql \ + r1099_mangos.sql \ + r1100_mangos.sql \ + r1103_mangos.sql \ + r1104_scriptdev2.sql \ + r1106_mangos.sql \ + r1112_mangos.sql \ + r1116_mangos.sql \ + r1119_mangos.sql \ + r1119_scriptdev2.sql \ + r1120_scriptdev2.sql \ + r1121_mangos.sql \ + r1121_scriptdev2.sql \ + r1123_scriptdev2.sql \ + r1128_mangos.sql \ + r1129_mangos.sql \ + r1129_scriptdev2.sql \ + r1131_mangos.sql \ + r1136_mangos.sql \ + r1136_scriptdev2.sql \ + r1140_scriptdev2.sql \ + r1141_mangos.sql \ + r1145_scriptdev2.sql \ + r1146_scriptdev2.sql \ + r1149_scriptdev2.sql \ + r1152_scriptdev2.sql \ + r1154_mangos.sql \ + r1155_mangos.sql \ + r1169_mangos.sql \ + r1169_scriptdev2.sql \ + r1171_scriptdev2.sql \ + r1173_scriptdev2.sql \ + r1180_mangos.sql \ + r1184_mangos.sql \ + r1197_mangos.sql \ + r1199_mangos.sql \ + r1202_mangos.sql \ + r1202_scriptdev2.sql \ + r1207_mangos.sql \ + r1207_scriptdev2.sql \ + r1210_mangos.sql \ + r1212_mangos.sql \ + r1212_scriptdev2.sql \ + r1215_mangos.sql \ + r1215_scriptdev2.sql \ + r1218_scriptdev2.sql \ + r1221_mangos.sql \ + r1221_scriptdev2.sql \ + r1222_scriptdev2.sql \ + r1234_mangos.sql \ + r1241_scriptdev2.sql \ + r1242_mangos.sql \ + r1242_scriptdev2.sql \ + r1243_mangos.sql \ + r1243_scriptdev2.sql \ + r1249_mangos.sql \ + r1249_scriptdev2.sql \ + r1250_mangos.sql \ + r1250_scriptdev2.sql \ + r1251_scriptdev2.sql \ + r1257_scriptdev2.sql \ + r1258_mangos.sql \ + r1258_scriptdev2.sql \ + r1260_scriptdev2.sql \ + r1261_mangos.sql \ + r1263_mangos.sql \ + r1265_mangos.sql \ + r1265_scriptdev2.sql \ + r1266_mangos.sql \ + r1266_scriptdev2.sql \ + r1280_mangos.sql \ + r1280_scriptdev2.sql \ + r1281_mangos.sql \ + r1282_mangos.sql \ + r1283_mangos.sql \ + r1299_scriptdev2.sql \ + r1300_mangos.sql \ + r1307_mangos.sql \ + r1317_mangos.sql \ + r1317_scriptdev2.sql \ + r1321_mangos.sql \ + r1321_scriptdev2.sql \ + r1322_scriptdev2.sql \ + r1326_scriptdev2.sql \ + r1333_mangos.sql \ + r1334_mangos.sql \ + r1335_scriptdev2.sql \ + r1336_mangos.sql \ + r1336_scriptdev2.sql \ + r1341_scriptdev2.sql \ + r1351_mangos.sql \ + r1351_scriptdev2.sql \ + r1352_mangos.sql \ + r1352_scriptdev2.sql \ + r1354_scriptdev2.sql \ + r1358_mangos.sql \ + r1359_mangos.sql \ + r1359_scriptdev2.sql \ + r1367_mangos.sql \ + r1368_mangos.sql \ + r1369_mangos.sql \ + r1370_mangos.sql \ + r1371_scriptdev2.sql \ + r1374_mangos.sql \ + r1374_scriptdev2.sql \ + r1378_mangos.sql \ + r1378_scriptdev2.sql \ + r1379_mangos.sql \ + r1379_scriptdev2.sql \ + r1380_mangos.sql \ + r1380_scriptdev2.sql \ + r1382_mangos.sql \ + r1383_scriptdev2.sql \ + r1384_scriptdev2.sql \ + r1385_mangos.sql \ + r1385_scriptdev2.sql \ + r1386_mangos.sql \ + r1386_scriptdev2.sql \ + r1388_mangos.sql \ + r1388_scriptdev2.sql \ + r1391_mangos.sql \ + r1391_scriptdev2.sql \ + r1392_mangos.sql \ + r1392_scriptdev2.sql \ + r1394_mangos.sql \ + r1394_scriptdev2.sql \ + r1405_mangos.sql \ + r1405_scriptdev2.sql \ + r1406_mangos.sql \ + r1408_mangos.sql \ + r1408_scriptdev2.sql \ + r1409_mangos.sql \ + r1409_scriptdev2.sql \ + r1410_mangos.sql \ + r1410_scriptdev2.sql \ + r1411_mangos.sql \ + r1411_scriptdev2.sql \ + r1412_mangos.sql \ + r1412_scriptdev2.sql \ + r1413_mangos.sql \ + r1413_scriptdev2.sql \ + r1414_mangos.sql \ + r1414_scriptdev2.sql \ + r1415_mangos.sql \ + r1417_mangos.sql \ + r1418_scriptdev2.sql \ + r1419_mangos.sql \ + r1421_scriptdev2.sql \ + r1422_mangos.sql \ + r1422_scriptdev2.sql \ + r1428_scriptdev2.sql \ + r1430_mangos.sql \ + r1433_mangos.sql \ + r1435_mangos.sql \ + r1436_mangos.sql \ + r1437_scriptdev2.sql \ + r1439_scriptdev2.sql \ + r1441_mangos.sql diff --git a/sql/Updates/0.0.3/r1002_scriptdev2.sql b/sql/Updates/0.0.3/r1002_scriptdev2.sql new file mode 100644 index 0000000..4a1a98a --- /dev/null +++ b/sql/Updates/0.0.3/r1002_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7658+) '; diff --git a/sql/Updates/0.0.3/r1006_scriptdev2.sql b/sql/Updates/0.0.3/r1006_scriptdev2.sql new file mode 100644 index 0000000..695eb72 --- /dev/null +++ b/sql/Updates/0.0.3/r1006_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7667+) '; diff --git a/sql/Updates/0.0.3/r1008_mangos.sql b/sql/Updates/0.0.3/r1008_mangos.sql new file mode 100644 index 0000000..3372616 --- /dev/null +++ b/sql/Updates/0.0.3/r1008_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kayra_longmane' WHERE entry=17969; diff --git a/sql/Updates/0.0.3/r1008_scriptdev2.sql b/sql/Updates/0.0.3/r1008_scriptdev2.sql new file mode 100644 index 0000000..40fed50 --- /dev/null +++ b/sql/Updates/0.0.3/r1008_scriptdev2.sql @@ -0,0 +1,36 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000347 AND -1000343; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000343, 'Is the way clear? Let\'s get out while we can, $N.',0,0,0,0,'kayra SAY_START'), +(-1000344, 'Looks like we won\'t get away so easy. Get ready!',0,0,0,0,'kayra SAY_AMBUSH1'), +(-1000345, 'Let\'s keep moving. We\'re not safe here!',0,0,0,0,'kayra SAY_PROGRESS'), +(-1000346, 'Look out, $N! Enemies ahead!',0,0,0,0,'kayra SAY_AMBUSH2'), +(-1000347, 'We\'re almost to the refuge! Let\'s go.',0,0,0,0,'kayra SAY_END'); + +DELETE FROM script_waypoint WHERE entry=17969; +INSERT INTO script_waypoint VALUES +(17969, 0, -930.048950, 5288.080078, 23.848402, 0, ''), +(17969, 1, -925.677917, 5296.482910, 18.183748, 0, ''), +(17969, 2, -924.297180, 5299.016113, 17.710915, 0, ''), +(17969, 3, -928.390076, 5317.022949, 18.208593, 0, ''), +(17969, 4, -930.620972, 5329.915039, 18.773422, 0, 'SAY_AMBUSH1'), +(17969, 5, -931.490295, 5357.654785, 18.027155, 0, 'SAY_PROGRESS'), +(17969, 6, -934.777771, 5369.341797, 22.278048, 0, ''), +(17969, 7, -934.521851, 5373.407227, 22.834690, 0, ''), +(17969, 8, -937.008545, 5382.980469, 22.699078, 0, ''), +(17969, 9, -941.948059, 5404.141602, 22.669743, 0, ''), +(17969, 10, -931.244263, 5415.846680, 23.063961, 0, 'at crossroad'), +(17969, 11, -901.497925, 5420.315430, 24.213270, 0, ''), +(17969, 12, -860.311707, 5415.617676, 23.671139, 0, ''), +(17969, 13, -777.988953, 5391.982422, 23.001669, 0, ''), +(17969, 14, -750.362000, 5385.786621, 22.765791, 0, ''), +(17969, 15, -731.339417, 5382.449707, 22.517065, 0, ''), +(17969, 16, -681.235901, 5381.377930, 22.050159, 2500, 'end bridge SAY_AMBUSH2'), +(17969, 17, -637.944458, 5384.338379, 22.205647, 0, 'SAY_END'), +(17969, 18, -608.954407, 5408.715332, 21.630386, 0, ''), +(17969, 19, -598.134277, 5413.608398, 21.412275, 0, ''), +(17969, 20, -571.268982, 5420.771973, 21.184925, 0, ''), +(17969, 21, -553.099915, 5424.616211, 21.193716, 0, ''), +(17969, 22, -524.745483, 5443.945313, 20.977013, 0, ''), +(17969, 23, -502.984985, 5446.283691, 22.149435, 0, ''), +(17969, 24, -472.463959, 5449.546875, 22.561453, 0, ''), +(17969, 25, -454.533264, 5461.302246, 22.602837, 30000, 'quest complete'); diff --git a/sql/Updates/0.0.3/r1009_scriptdev2.sql b/sql/Updates/0.0.3/r1009_scriptdev2.sql new file mode 100644 index 0000000..452fd86 --- /dev/null +++ b/sql/Updates/0.0.3/r1009_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7672+) '; diff --git a/sql/Updates/0.0.3/r1010_mangos.sql b/sql/Updates/0.0.3/r1010_mangos.sql new file mode 100644 index 0000000..42b1926 --- /dev/null +++ b/sql/Updates/0.0.3/r1010_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=466; diff --git a/sql/Updates/0.0.3/r1010_scriptdev2.sql b/sql/Updates/0.0.3/r1010_scriptdev2.sql new file mode 100644 index 0000000..4e1cdb0 --- /dev/null +++ b/sql/Updates/0.0.3/r1010_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE script_texts SET content_default='UNUSED', language=0, comment='REUSE ME' WHERE entry=-1000208; diff --git a/sql/Updates/0.0.3/r1012_mangos.sql b/sql/Updates/0.0.3/r1012_mangos.sql new file mode 100644 index 0000000..5c7472e --- /dev/null +++ b/sql/Updates/0.0.3/r1012_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_aged_dying_ancient_kodo' WHERE entry IN (4700, 4701, 4702, 11627); diff --git a/sql/Updates/0.0.3/r1012_scriptdev2.sql b/sql/Updates/0.0.3/r1012_scriptdev2.sql new file mode 100644 index 0000000..3993272 --- /dev/null +++ b/sql/Updates/0.0.3/r1012_scriptdev2.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000350 AND -1000348; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000348, 'Ah...the wondrous sound of kodos. I love the way they make the ground shake... inspect the beast for me.',0,0,0,0,'kodo round SAY_SMEED_HOME_1'), +(-1000349, 'Hey, look out with that kodo! You had better inspect that beast before i give you credit!',0,0,0,0,'kodo round SAY_SMEED_HOME_2'), +(-1000350, 'That kodo sure is a beauty. Wait a minute, where are my bifocals? Perhaps you should inspect the beast for me.',0,0,0,0,'kodo round SAY_SMEED_HOME_3'); diff --git a/sql/Updates/0.0.3/r1014_mangos.sql b/sql/Updates/0.0.3/r1014_mangos.sql new file mode 100644 index 0000000..7193db7 --- /dev/null +++ b/sql/Updates/0.0.3/r1014_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE ScriptName='mob_eventai'; diff --git a/sql/Updates/0.0.3/r1014_scriptdev2.sql b/sql/Updates/0.0.3/r1014_scriptdev2.sql new file mode 100644 index 0000000..3820e1e --- /dev/null +++ b/sql/Updates/0.0.3/r1014_scriptdev2.sql @@ -0,0 +1,5 @@ +-- Note: if SD2 installed after rev 986, you do not have to run this query (will produce error) +-- This only intended for cleaning up older, existing SD2 database. +DROP TABLE eventai_scripts; +DROP TABLE eventai_summons; +DROP TABLE eventai_texts; diff --git a/sql/Updates/0.0.3/r1016_scriptdev2.sql b/sql/Updates/0.0.3/r1016_scriptdev2.sql new file mode 100644 index 0000000..f076fea --- /dev/null +++ b/sql/Updates/0.0.3/r1016_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7690+) '; diff --git a/sql/Updates/0.0.3/r1023_scriptdev2.sql b/sql/Updates/0.0.3/r1023_scriptdev2.sql new file mode 100644 index 0000000..2dd1175 --- /dev/null +++ b/sql/Updates/0.0.3/r1023_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7715+) '; diff --git a/sql/Updates/0.0.3/r1025_mangos.sql b/sql/Updates/0.0.3/r1025_mangos.sql new file mode 100644 index 0000000..b0b1343 --- /dev/null +++ b/sql/Updates/0.0.3/r1025_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_blood_furnace' WHERE map=542; diff --git a/sql/Updates/0.0.3/r1030_scriptdev2.sql b/sql/Updates/0.0.3/r1030_scriptdev2.sql new file mode 100644 index 0000000..3d9ba07 --- /dev/null +++ b/sql/Updates/0.0.3/r1030_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7723+) '; diff --git a/sql/Updates/0.0.3/r1032_mangos.sql b/sql/Updates/0.0.3/r1032_mangos.sql new file mode 100644 index 0000000..407f6ce --- /dev/null +++ b/sql/Updates/0.0.3/r1032_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=21845; +UPDATE creature_template SET ScriptName='boss_leotheras_the_blind_demonform' WHERE entry=21875; diff --git a/sql/Updates/0.0.3/r1032_scriptdev2.sql b/sql/Updates/0.0.3/r1032_scriptdev2.sql new file mode 100644 index 0000000..e1e6f2b --- /dev/null +++ b/sql/Updates/0.0.3/r1032_scriptdev2.sql @@ -0,0 +1,3 @@ +UPDATE script_texts SET content_default='Finally, my banishment ends!' WHERE entry=-1548009; +UPDATE script_texts SET content_default='Be gone, trifling elf. I am in control now!' WHERE entry=-1548010; +UPDATE script_texts SET content_default='No... no! What have you done? I am the master! Do you hear me? I am... aaggh! Can\'t... contain him...' WHERE entry=-1548018; diff --git a/sql/Updates/0.0.3/r1039_mangos.sql b/sql/Updates/0.0.3/r1039_mangos.sql new file mode 100644 index 0000000..38d404f --- /dev/null +++ b/sql/Updates/0.0.3/r1039_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_plucky_johnson' WHERE entry=6626; diff --git a/sql/Updates/0.0.3/r1056_scriptdev2.sql b/sql/Updates/0.0.3/r1056_scriptdev2.sql new file mode 100644 index 0000000..a2fa736 --- /dev/null +++ b/sql/Updates/0.0.3/r1056_scriptdev2.sql @@ -0,0 +1,15 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1543025 AND -1543017; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1543017,'You have faced many challenges, pity they were all in vain. Soon your people will kneel to my lord!',10292,1,0,0,'vazruden SAY_INTRO'), +(-1543018,'Your time is running out!',10294,1,0,0,'vazruden SAY_AGGRO1'), +(-1543019,'You are nothing, I answer a higher call!',10295,1,0,0,'vazruden SAY_AGGRO2'), +(-1543020,'The Dark Lord laughs at you!',10296,1,0,0,'vazruden SAY_AGGRO3'), +(-1543021,'Is there no one left to test me?',10293,1,0,0,'vazruden SAY_TAUNT'), +(-1543022,'It is over. Finished!',10297,1,0,0,'vazruden SAY_KILL1'), +(-1543023,'Your days are done!',10298,1,0,0,'vazruden SAY_KILL2'), +(-1543024,'My lord will be the end you all...',10299,1,0,0,'vazruden SAY_DEATH'), +(-1543025,'%s descends from the sky.',0,3,0,0,'vazruden EMOTE_DESCEND'); + +UPDATE script_waypoint SET waittime=10000 WHERE entry=24358 AND pointid=3; +DELETE FROM script_waypoint WHERE entry=24358 AND pointid=4; +INSERT INTO script_waypoint VALUES (24358, 4, 120.536003, 1611.654663, 43.473, 0, ''); diff --git a/sql/Updates/0.0.3/r1058_mangos.sql b/sql/Updates/0.0.3/r1058_mangos.sql new file mode 100644 index 0000000..7e572cd --- /dev/null +++ b/sql/Updates/0.0.3/r1058_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_karynaku' WHERE entry=22112; diff --git a/sql/Updates/0.0.3/r1058_scriptdev2.sql b/sql/Updates/0.0.3/r1058_scriptdev2.sql new file mode 100644 index 0000000..b939bae --- /dev/null +++ b/sql/Updates/0.0.3/r1058_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7798+) '; diff --git a/sql/Updates/0.0.3/r1062_mangos.sql b/sql/Updates/0.0.3/r1062_mangos.sql new file mode 100644 index 0000000..945444a --- /dev/null +++ b/sql/Updates/0.0.3/r1062_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_air_force_bots' WHERE entry IN (2614, 2615, 21974, 21993, 21996, 21997, 21999, 22001, 22002, 22003, 22063, 22065, 22066, 22068, 22069, 22070, 22071, 22078, 22079, 22080, 22086, 22087, 22088, 22090, 22124, 22125, 22126); diff --git a/sql/Updates/0.0.3/r1067_mangos.sql b/sql/Updates/0.0.3/r1067_mangos.sql new file mode 100644 index 0000000..9c6c620 --- /dev/null +++ b/sql/Updates/0.0.3/r1067_mangos.sql @@ -0,0 +1,8 @@ +UPDATE creature_template SET ScriptName='mob_alyson_antille' WHERE entry=24240; +UPDATE creature_template SET ScriptName='mob_thurg' WHERE entry=24241; +UPDATE creature_template SET ScriptName='mob_slither' WHERE entry=24242; +UPDATE creature_template SET ScriptName='mob_lord_raadan' WHERE entry=24243; +UPDATE creature_template SET ScriptName='mob_gazakroth' WHERE entry=24244; +UPDATE creature_template SET ScriptName='mob_fenstalker' WHERE entry=24245; +UPDATE creature_template SET ScriptName='mob_darkheart' WHERE entry=24246; +UPDATE creature_template SET ScriptName='mob_koragg' WHERE entry=24247; diff --git a/sql/Updates/0.0.3/r1068_mangos.sql b/sql/Updates/0.0.3/r1068_mangos.sql new file mode 100644 index 0000000..e240fa0 --- /dev/null +++ b/sql/Updates/0.0.3/r1068_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='npc_rizzle_sprysprocket' WHERE entry=23002; +UPDATE creature_template SET ScriptName='npc_depth_charge' WHERE entry=23025; +UPDATE gameobject_template SET ScriptName='go_southfury_moonstone' WHERE entry=185566; diff --git a/sql/Updates/0.0.3/r1068_scriptdev2.sql b/sql/Updates/0.0.3/r1068_scriptdev2.sql new file mode 100644 index 0000000..8553b7b --- /dev/null +++ b/sql/Updates/0.0.3/r1068_scriptdev2.sql @@ -0,0 +1,85 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000355 AND -1000351; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000351, 'You, there! Hand over that moonstone and nobody gets hurt!',0,1,0,0,'sprysprocket SAY_START'), +(-1000352, '%s takes the Southfury moonstone and escapes into the river. Follow her!',0,3,0,0,'sprysprocket EMOTE_START'), +(-1000353, 'Just chill!',0,4,0,0,'sprysprocket SAY_WHISPER_CHILL'), +(-1000354, 'Stupid grenade picked a fine time to backfire! So much for high quality goblin engineering!',0,1,0,0,'sprysprocket SAY_GRENADE_FAIL'), +(-1000355, 'All right, you win! I surrender! Just don\'t hurt me!',0,1,0,0,'sprysprocket SAY_END'); + +DELETE FROM script_waypoint WHERE entry=23002; +INSERT INTO script_waypoint VALUES +(23002, 0, 3687.11, -3960.69, 31.8726, 0, ''), +(23002, 1, 3676.28, -3953.76, 29.9396, 0, ''), +(23002, 2, 3658.54, -3952.15, 30.0414, 0, ''), +(23002, 3, 3628.91, -3956.90, 29.4050, 0, ''), +(23002, 4, 3602.54, -3968.16, 31.5110, 0, ''), +(23002, 5, 3564.96, -3978.00, 30.3622, 0, ''), +(23002, 6, 3542.47, -3981.81, 29.1465, 0, ''), +(23002, 7, 3511.34, -3981.25, 30.2822, 0, ''), +(23002, 8, 3473.45, -3992.67, 30.2861, 0, ''), +(23002, 9, 3439.10, -4006.73, 29.2737, 0, ''), +(23002, 10, 3415.66, -4026.24, 25.2498, 0, ''), +(23002, 11, 3380.88, -4045.38, 26.3114, 0, ''), +(23002, 12, 3355.23, -4051.42, 25.5665, 0, ''), +(23002, 13, 3312.00, -4055.65, 28.3297, 0, ''), +(23002, 14, 3286.34, -4079.27, 28.2464, 0, ''), +(23002, 15, 3260.68, -4087.29, 31.4043, 0, ''), +(23002, 16, 3236.83, -4087.65, 32.6894, 0, ''), +(23002, 17, 3215.06, -4082.10, 32.4181, 0, ''), +(23002, 18, 3203.59, -4082.47, 32.7436, 0, ''), +(23002, 19, 3166.41, -4062.09, 33.2357, 0, ''), +(23002, 20, 3147.51, -4055.33, 33.5683, 0, ''), +(23002, 21, 3125.41, -4050.01, 34.6100, 0, ''), +(23002, 22, 3121.16, -4045.07, 36.5481, 0, ''), +(23002, 23, 3101.54, -4023.78, 33.7169, 0, ''), +(23002, 24, 3094.16, -4016.89, 33.8487, 0, ''), +(23002, 25, 3079.57, -4011.01, 35.7546, 0, ''), +(23002, 26, 3058.83, -4001.71, 34.3039, 0, ''), +(23002, 27, 3037.83, -3986.60, 33.4216, 0, ''), +(23002, 28, 3016.93, -3970.83, 33.3743, 0, ''), +(23002, 29, 2998.05, -3954.89, 33.2338, 0, ''), +(23002, 30, 2969.35, -3929.27, 33.4831, 0, ''), +(23002, 31, 2941.23, -3909.56, 31.3506, 0, ''), +(23002, 32, 2911.42, -3895.07, 32.0950, 0, ''), +(23002, 33, 2892.44, -3875.52, 30.8123, 0, ''), +(23002, 34, 2870.52, -3858.97, 32.1977, 0, ''), +(23002, 35, 2865.84, -3836.99, 32.1108, 0, ''), +(23002, 36, 2850.52, -3814.52, 32.8635, 0, ''), +(23002, 37, 2836.63, -3796.94, 33.1473, 0, ''), +(23002, 38, 2820.73, -3780.22, 28.6916, 0, ''), +(23002, 39, 2795.82, -3770.13, 30.1327, 0, ''), +(23002, 40, 2773.15, -3765.54, 30.2947, 0, ''), +(23002, 41, 2742.31, -3761.65, 30.1218, 0, ''), +(23002, 42, 2708.43, -3748.46, 21.2468, 0, ''), +(23002, 43, 2661.45, -3741.11, 21.9603, 0, ''), +(23002, 44, 2623.89, -3735.29, 25.8979, 0, ''), +(23002, 45, 2585.93, -3728.85, 28.5146, 0, ''), +(23002, 46, 2554.93, -3730.10, 26.6795, 0, ''), +(23002, 47, 2538.68, -3721.28, 28.1589, 0, ''), +(23002, 48, 2508.54, -3708.71, 29.6718, 0, ''), +(23002, 49, 2474.69, -3710.37, 31.0805, 0, ''), +(23002, 50, 2456.40, -3698.83, 31.6187, 0, ''), +(23002, 51, 2430.54, -3701.87, 31.0494, 0, ''), +(23002, 52, 2390.13, -3681.76, 29.5484, 0, ''), +(23002, 53, 2357.06, -3673.96, 29.8845, 0, ''), +(23002, 54, 2330.15, -3672.73, 31.1314, 0, ''), +(23002, 55, 2302.77, -3665.22, 29.4110, 0, ''), +(23002, 56, 2279.24, -3659.46, 29.6247, 0, ''), +(23002, 57, 2254.65, -3661.12, 29.6984, 0, ''), +(23002, 58, 2223.32, -3654.92, 31.0149, 0, ''), +(23002, 59, 2194.29, -3645.40, 32.0417, 0, ''), +(23002, 60, 2153.05, -3650.82, 31.2292, 0, ''), +(23002, 61, 2114.15, -3639.96, 31.7371, 0, ''), +(23002, 62, 2093.68, -3646.65, 31.3745, 0, ''), +(23002, 63, 2069.86, -3670.59, 30.6172, 0, ''), +(23002, 64, 2024.40, -3677.64, 29.7682, 0, ''), +(23002, 65, 1988.61, -3680.02, 31.8937, 0, ''), +(23002, 66, 1962.68, -3692.17, 32.7811, 0, ''), +(23002, 67, 1931.94, -3708.48, 31.3641, 0, ''), +(23002, 68, 1893.36, -3710.02, 33.0193, 0, ''), +(23002, 69, 1865.73, -3718.35, 32.1664, 0, ''), +(23002, 70, 1839.74, -3732.92, 32.5322, 0, ''), +(23002, 71, 1805.08, -3757.76, 32.6295, 0, ''), +(23002, 72, 1780.24, -3775.53, 30.5931, 0, ''), +(23002, 73, 1753.28, -3786.79, 30.7445, 0, ''), +(23002, 74, 1731.09, -3796.64, 36.8866, 0, ''); diff --git a/sql/Updates/0.0.3/r1069_mangos.sql b/sql/Updates/0.0.3/r1069_mangos.sql new file mode 100644 index 0000000..789b269 --- /dev/null +++ b/sql/Updates/0.0.3/r1069_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_blackfathom_deeps' WHERE map=48; diff --git a/sql/Updates/0.0.3/r1073_mangos.sql b/sql/Updates/0.0.3/r1073_mangos.sql new file mode 100644 index 0000000..8f100cc --- /dev/null +++ b/sql/Updates/0.0.3/r1073_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_naxxramas' WHERE map=533; diff --git a/sql/Updates/0.0.3/r1074_scriptdev2.sql b/sql/Updates/0.0.3/r1074_scriptdev2.sql new file mode 100644 index 0000000..5436617 --- /dev/null +++ b/sql/Updates/0.0.3/r1074_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7810+) '; diff --git a/sql/Updates/0.0.3/r1075_mangos.sql b/sql/Updates/0.0.3/r1075_mangos.sql new file mode 100644 index 0000000..2522354 --- /dev/null +++ b/sql/Updates/0.0.3/r1075_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='npc_afrasastrasz' WHERE entry=27575; +UPDATE creature_template SET ScriptName='npc_tariolstrasz' WHERE entry=26443; +UPDATE creature_template SET ScriptName='npc_torastrasza' WHERE entry=26949; diff --git a/sql/Updates/0.0.3/r1080_scriptdev2.sql b/sql/Updates/0.0.3/r1080_scriptdev2.sql new file mode 100644 index 0000000..085ca2b --- /dev/null +++ b/sql/Updates/0.0.3/r1080_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7829+) '; diff --git a/sql/Updates/0.0.3/r1082_mangos.sql b/sql/Updates/0.0.3/r1082_mangos.sql new file mode 100644 index 0000000..57afe06 --- /dev/null +++ b/sql/Updates/0.0.3/r1082_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='mob_amanishi_hatcher' WHERE entry IN (23818,24504); diff --git a/sql/Updates/0.0.3/r1098_scriptdev2.sql b/sql/Updates/0.0.3/r1098_scriptdev2.sql new file mode 100644 index 0000000..444f6b6 --- /dev/null +++ b/sql/Updates/0.0.3/r1098_scriptdev2.sql @@ -0,0 +1,45 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1615042 AND -1615000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1615000,'I fear nothing! Least of all you!',14111,1,0,0,'shadron SAY_SHADRON_AGGRO'), +(-1615001,'You are insignificant!',14112,1,0,0,'shadron SAY_SHADRON_SLAY_1'), +(-1615002,'Such mediocre resistance!',14113,1,0,0,'shadron SAY_SHADRON_SLAY_2'), +(-1615003,'We...are superior! How could this...be...',14118,1,0,0,'shadron SAY_SHADRON_DEATH'), +(-1615004,'You are easily bested! ',14114,1,0,0,'shadron SAY_SHADRON_BREATH'), +(-1615005,'I will take pity on you Sartharion, just this once.',14117,1,0,0,'shadron SAY_SHADRON_RESPOND'), +(-1615006,'Father tought me well!',14115,1,0,0,'shadron SAY_SHADRON_SPECIAL_1'), +(-1615007,'On your knees!',14116,1,0,0,'shadron SAY_SHADRON_SPECIAL_2'), +(-1615008,'A Shadron Disciple appears in the Twilight!',0,5,0,0,'shadron WHISPER_SHADRON_DICIPLE'), +(-1615009,'You have no place here. Your place is among the departed.',14122,1,0,0,'tenebron SAY_TENEBRON_AGGRO'), +(-1615010,'No contest.',14123,1,0,0,'tenebron SAY_TENEBRON_SLAY_1'), +(-1615011,'Typical... Just as I was having fun.',14124,1,0,0,'tenebron SAY_TENEBRON_SLAY_2'), +(-1615012,'I should not... have held back...', 14129,1,0,0,'tenebron SAY_TENEBRON_DEATH'), +(-1615013,'To darkness I condemn you...',14125,1,0,0,'tenebron SAY_TENEBRON_BREATH'), +(-1615014,'It is amusing to watch you struggle. Very well, witness how it is done.',14128,1,0,0,'tenebron SAY_TENEBRON_RESPOND'), +(-1615015,'Arrogant little creatures! To challenge powers you do not yet understand...',14126,1,0,0,'tenebron SAY_TENEBRON_SPECIAL_1'), +(-1615016,'I am no mere dragon! You will find I am much, much, more...',14127,1,0,0,'tenebron SAY_TENEBRON_SPECIAL_2'), +(-1615017,'%s begins to hatch eggs in the twilight!',0,5,0,0,'tenebron WHISPER_HATCH_EGGS'), +(-1615018,'It is my charge to watch over these eggs. I will see you burn before any harm comes to them!',14093,1,0,0,'sartharion SAY_SARTHARION_AGGRO'), +(-1615019,'This pathetic siege ends NOW!',14103,1,0,0,'sartharion SAY_SARTHARION_BERSERK'), +(-1615020,'Burn, you miserable wretches!',14098, 1,0,0,'sartharion SAY_SARTHARION_BREATH'), +(-1615021,'Shadron! Come to me, all is at risk!',14105,1,0,0,'sartharion SARTHARION_CALL_SHADRON'), +(-1615022,'Tenebron! The eggs are yours to protect as well!',14106,1,0,0,'sartharion SAY_SARTHARION_CALL_TENEBRON'), +(-1615023,'Vesperon! The clutch is in danger! Assist me!',14104,1,0,0,'sartharion SAY_SARTHARION_CALL_VESPERON'), +(-1615024,'Such is the price... of failure...',14107,1,0,0,'sartharion SAY_SARTHARION_DEATH'), +(-1615025,'Such flammable little insects....',14099,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_1'), +(-1615026,'Your charred bones will litter the floor!',14100,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_2'), +(-1615027,'How much heat can you take?',14101,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_3'), +(-1615028,'All will be reduced to ash!',14102,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_4'), +(-1615029,'You will make a fine meal for the hatchlings.',14094,1,0,0,'sartharion SAY_SARTHARION_SLAY_1'), +(-1615030,'You are the grave disadvantage.',14096,1,0,0,'sartharion SAY_SARTHARION_SLAY_2'), +(-1615031,'This is why we call you lesser beeings.',14097,1,0,0,'sartharion SAY_SARTHARION_SLAY_3'), +(-1615032,'The lava surrounding %s churns!',0,5,0,0,'sartharion WHISPER_LAVA_CHURN'), +(-1615033,'You pose no threat, lesser beings...give me your worst!',14133,1,0,0,'vesperon SAY_VESPERON_AGGRO'), +(-1615034,'The least you could do is put up a fight...',14134,1,0,0,'vesperon SAY_VESPERON_SLAY_1'), +(-1615035,'Was that the best you can do?',14135,1,0,0,'vesperon SAY_VESPERON_SLAY_2'), +(-1615036,'I still have some...fight..in...me...', 14140,1,0,0,'vesperon SAY_VESPERON_DEATH'), +(-1615037,'I will pick my teeth with your bones!',14136,1,0,0,'vesperon SAY_VESPERON_BREATH'), +(-1615038,'Father was right about you, Sartharion...You are a weakling!',14139,1,0,0,'vesperon SAY_VESPERON_RESPOND'), +(-1615039,'Aren\'t you tricky...I have a few tricks of my own...',14137,1,0,0,'vesperon SAY_VESPERON_SPECIAL_1'), +(-1615040,'Unlike, I have many talents.',14138,1,0,0,'vesperon SAY_VESPERON_SPECIAL_2'), +(-1615041,'A Vesperon Disciple appears in the Twilight!',0,5,0,0,'shadron WHISPER_VESPERON_DICIPLE'), +(-1615042,'%s begins to open a Twilight Portal!',0,5,0,0,'sartharion drake WHISPER_OPEN_PORTAL'); diff --git a/sql/Updates/0.0.3/r1099_mangos.sql b/sql/Updates/0.0.3/r1099_mangos.sql new file mode 100644 index 0000000..95f0d51 --- /dev/null +++ b/sql/Updates/0.0.3/r1099_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_obsidian_sanctum' WHERE map=615; diff --git a/sql/Updates/0.0.3/r1100_mangos.sql b/sql/Updates/0.0.3/r1100_mangos.sql new file mode 100644 index 0000000..ae3b665 --- /dev/null +++ b/sql/Updates/0.0.3/r1100_mangos.sql @@ -0,0 +1,8 @@ +UPDATE creature_template SET ScriptName='boss_sartharion' WHERE entry=28860; +UPDATE creature_template SET ScriptName='mob_vesperon' WHERE entry=30449; +UPDATE creature_template SET ScriptName='mob_shadron' WHERE entry=30451; +UPDATE creature_template SET ScriptName='mob_tenebron' WHERE entry=30452; +UPDATE creature_template SET ScriptName='mob_twilight_eggs' WHERE entry=30882; +UPDATE creature_template SET ScriptName='mob_twilight_whelp' WHERE entry IN (30890, 31214); +UPDATE creature_template SET ScriptName='mob_acolyte_of_shadron' WHERE entry=31218; +UPDATE creature_template SET ScriptName='mob_acolyte_of_vesperon' WHERE entry=31219; diff --git a/sql/Updates/0.0.3/r1103_mangos.sql b/sql/Updates/0.0.3/r1103_mangos.sql new file mode 100644 index 0000000..4568524 --- /dev/null +++ b/sql/Updates/0.0.3/r1103_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_resonite_cask' WHERE entry=178145; diff --git a/sql/Updates/0.0.3/r1104_scriptdev2.sql b/sql/Updates/0.0.3/r1104_scriptdev2.sql new file mode 100644 index 0000000..d1a3194 --- /dev/null +++ b/sql/Updates/0.0.3/r1104_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7871+) '; diff --git a/sql/Updates/0.0.3/r1106_mangos.sql b/sql/Updates/0.0.3/r1106_mangos.sql new file mode 100644 index 0000000..e77fc77 --- /dev/null +++ b/sql/Updates/0.0.3/r1106_mangos.sql @@ -0,0 +1 @@ +UPDATE item_template SET ScriptName='item_dart_gun' WHERE entry=44222; diff --git a/sql/Updates/0.0.3/r1112_mangos.sql b/sql/Updates/0.0.3/r1112_mangos.sql new file mode 100644 index 0000000..b77ae3a --- /dev/null +++ b/sql/Updates/0.0.3/r1112_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kalecgos' WHERE entry IN (24844, 24848); diff --git a/sql/Updates/0.0.3/r1116_mangos.sql b/sql/Updates/0.0.3/r1116_mangos.sql new file mode 100644 index 0000000..0fff2eb --- /dev/null +++ b/sql/Updates/0.0.3/r1116_mangos.sql @@ -0,0 +1,2 @@ +UPDATE instance_template SET script='instance_utgarde_keep' WHERE map=574; +UPDATE creature_template SET ScriptName='mob_dragonflayer_forge_master' WHERE entry=24079; diff --git a/sql/Updates/0.0.3/r1119_mangos.sql b/sql/Updates/0.0.3/r1119_mangos.sql new file mode 100644 index 0000000..3e336db --- /dev/null +++ b/sql/Updates/0.0.3/r1119_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='boss_skarvald' WHERE entry=24200; +UPDATE creature_template SET ScriptName='boss_dalronn' WHERE entry=24201; +UPDATE creature_template SET ScriptName='boss_ingvar' WHERE entry=23954; +UPDATE creature_template SET ScriptName='boss_keleseth' WHERE entry=23953; diff --git a/sql/Updates/0.0.3/r1119_scriptdev2.sql b/sql/Updates/0.0.3/r1119_scriptdev2.sql new file mode 100644 index 0000000..61a55b5 --- /dev/null +++ b/sql/Updates/0.0.3/r1119_scriptdev2.sql @@ -0,0 +1,23 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1574020 AND -1574000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1574000,'Your blood is mine!',13221,1,0,0,'keleseth SAY_AGGRO'), +(-1574001,'Not so fast.',13222,1,0,0,'keleseth SAY_FROSTTOMB'), +(-1574002,'Aranal, lidel! Their fate shall be yours!',13224,1,0,0,'keleseth SAY_SKELETONS'), +(-1574003,'Darkness waits!',13223,1,0,0,'keleseth SAY_KILL'), +(-1574004,'I join... the night.',13225,1,0,0,'keleseth SAY_DEATH'), +(-1574005,'I\'ll paint my face with your blood!',13207,1,0,0,'ingvar SAY_AGGRO_FIRST'), +(-1574006,'I return! A second chance to carve out your skull!',13209,1,0,0,'ingvar SAY_AGGRO_SECOND'), +(-1574007,'My life for the... death god!',13213,1,0,0,'ingvar SAY_DEATH_FIRST'), +(-1574008,'No! I can do... better! I can...',13211,1,0,0,'ingvar SAY_DEATH_SECOND'), +(-1574009,'Mjul orm agn gjor!',13212,1,0,0,'ingvar SAY_KILL_FIRST'), +(-1574010,'I am a warrior born!',13214,1,0,0,'ingvar SAY_KILL_SECOND'), +(-1574011,'Dalronn! See if you can muster the nerve to join my attack!',13229,1,0,0,'skarvald SAY_SKA_AGGRO'), +(-1574012,'Not... over... yet.',13230,1,0,0,'skarvald SAY_SKA_DEATH'), +(-1574013,'A warrior\'s death.',13231,1,0,0,'skarvald SAY_SKA_DEATH_REAL'), +(-1574014,'???',13232,1,0,0,'skarvald SAY_SKA_KILL'), +(-1574015,'Pagh! What sort of necromancer lets death stop him? I knew you were worthless!',13233,1,0,0,'skarvald SAY_SKA_DAL_DIES_REPLY'), +(-1574016,'By all means, don\'t assess the situation, you halfwit! Just jump into the fray!',13199,1,0,0,'dalronn SAY_DAL_AGGRO_REPLY'), +(-1574017,'See... you... soon.',13200,1,0,0,'dalronn SAY_DAL_DEATH'), +(-1574018,'There\'s no... greater... glory.',13201,1,0,0,'dalronn SAY_DAL_DEATH_REAL'), +(-1574019,'You may serve me yet.',13202,1,0,0,'dalronn SAY_DAL_KILL'), +(-1574020,'Skarvald, you incompetent slug! Return and make yourself useful!',13203,1,0,0,'dalronn SAY_DAL_SKA_DIES_REPLY'); diff --git a/sql/Updates/0.0.3/r1120_scriptdev2.sql b/sql/Updates/0.0.3/r1120_scriptdev2.sql new file mode 100644 index 0000000..955f8e3 --- /dev/null +++ b/sql/Updates/0.0.3/r1120_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7951+) '; diff --git a/sql/Updates/0.0.3/r1121_mangos.sql b/sql/Updates/0.0.3/r1121_mangos.sql new file mode 100644 index 0000000..11a396b --- /dev/null +++ b/sql/Updates/0.0.3/r1121_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='boss_anomalus' WHERE entry=26763; +UPDATE creature_template SET ScriptName='boss_keristrasza' WHERE entry=26723; +UPDATE creature_template SET ScriptName='boss_ormorok' WHERE entry=26794; +UPDATE creature_template SET ScriptName='boss_telestra' WHERE entry=26731; diff --git a/sql/Updates/0.0.3/r1121_scriptdev2.sql b/sql/Updates/0.0.3/r1121_scriptdev2.sql new file mode 100644 index 0000000..b99bcc4 --- /dev/null +++ b/sql/Updates/0.0.3/r1121_scriptdev2.sql @@ -0,0 +1,23 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1576020 AND -1576000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1576000,'You know what they say about curiosity.',13319,1,0,0,'telestra SAY_AGGRO'), +(-1576001,'I\'ll give you more than you can handle.',13321,1,0,0,'telestra SAY_SPLIT_1'), +(-1576002,'There\'s plenty of me to go around.',13322,1,0,0,'telestra SAY_SPLIT_2'), +(-1576003,'Now to finish the job!',13323,1,0,0,'telestra SAY_MERGE'), +(-1576004,'Death becomes you!',13324,1,0,0,'telestra SAY_KILL'), +(-1576005,'Damn the... luck.',13320,1,0,0,'telestra SAY_DEATH'), +(-1576006,'Chaos beckons.',13186,1,0,0,'anomalus SAY_AGGRO'), +(-1576007,'Reality... unwoven.',13188,1,0,0,'anomalus SAY_RIFT'), +(-1576008,'Indestructible.',13189,1,0,0,'anomalus SAY_SHIELD'), +(-1576009,'Expiration... is necesarry.',13274,1,0,0,'anomalus SAY_KILL'), +(-1576010,'Of course.',13187,1,0,0,'anomalus SAY_DEATH'), +(-1576011,'Noo!',13328,1,0,0,'ormorok SAY_AGGRO'), +(-1576012,'???',13329,1,0,0,'ormorok SAY_KILL'), +(-1576013,'Baaack!',13331,1,0,0,'ormorok SAY_REFLECT'), +(-1576014,'Bleeeed!',13332,1,0,0,'ormorok SAY_ICESPIKE'), +(-1576015,'Aaggh!',13330,1,0,0,'ormorok SAY_DEATH'), +(-1576016,'Preserve? Why? There\'s no truth in it. No no no... only in the taking! I see that now!',13450,1,0,0,'keristrasza SAY_AGGRO'), +(-1576017,'Stay. Enjoy your final moments.',13451,1,0,0,'keristrasza SAY_CRYSTAL_NOVA'), +(-1576018,'Finish it! Finish it! Kill me, or I swear by the Dragonqueen you\'ll never see daylight again!',13452,1,0,0,'keristrasza SAY_ENRAGE'), +(-1576019,'Now we\'ve come to the truth!',13453,1,0,0,'keristrasza SAY_KILL'), +(-1576020,'Dragonqueen... Life-Binder... preserve... me.',13454,1,0,0,'keristrasza SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r1123_scriptdev2.sql b/sql/Updates/0.0.3/r1123_scriptdev2.sql new file mode 100644 index 0000000..e609864 --- /dev/null +++ b/sql/Updates/0.0.3/r1123_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1533119; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533119,'%s spots a nearby Zombie to devour!',0,3,0,0,'gluth EMOTE_ZOMBIE'); diff --git a/sql/Updates/0.0.3/r1128_mangos.sql b/sql/Updates/0.0.3/r1128_mangos.sql new file mode 100644 index 0000000..642e4e8 --- /dev/null +++ b/sql/Updates/0.0.3/r1128_mangos.sql @@ -0,0 +1,14 @@ +UPDATE item_template SET ScriptName='' WHERE entry=34368; +UPDATE item_template SET ScriptName='' WHERE entry=31129; +UPDATE item_template SET ScriptName='' WHERE entry=44222; +UPDATE item_template SET ScriptName='' WHERE entry=22473; +UPDATE item_template SET ScriptName='' WHERE entry IN (9606,9618,9619,9620,9621); +UPDATE item_template SET ScriptName='' WHERE entry=30656; +UPDATE item_template SET ScriptName='' WHERE entry=34255; +UPDATE item_template SET ScriptName='' WHERE entry=32825; +UPDATE item_template SET ScriptName='' WHERE entry=32321; +UPDATE item_template SET ScriptName='' WHERE entry IN (15908,15911,15913,15914,15915,15916,15917,15919,15920,15921,15922,15923,23697,23702,23703,23896,23897,23898); +UPDATE item_template SET ScriptName='' WHERE entry=8149; +UPDATE item_template SET ScriptName='' WHERE entry=30259; +UPDATE item_template SET ScriptName='' WHERE entry=10699; +UPDATE item_template SET ScriptName='' WHERE entry=31463; diff --git a/sql/Updates/0.0.3/r1129_mangos.sql b/sql/Updates/0.0.3/r1129_mangos.sql new file mode 100644 index 0000000..d00defd --- /dev/null +++ b/sql/Updates/0.0.3/r1129_mangos.sql @@ -0,0 +1 @@ +UPDATE item_template SET ScriptName='' WHERE entry=28132; diff --git a/sql/Updates/0.0.3/r1129_scriptdev2.sql b/sql/Updates/0.0.3/r1129_scriptdev2.sql new file mode 100644 index 0000000..5f80e3f --- /dev/null +++ b/sql/Updates/0.0.3/r1129_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7983+) '; diff --git a/sql/Updates/0.0.3/r1131_mangos.sql b/sql/Updates/0.0.3/r1131_mangos.sql new file mode 100644 index 0000000..3188100 --- /dev/null +++ b/sql/Updates/0.0.3/r1131_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='boss_vazruden_herald' WHERE entry=17307; +UPDATE creature_template SET ScriptName='boss_vazruden' WHERE entry=17537; diff --git a/sql/Updates/0.0.3/r1136_mangos.sql b/sql/Updates/0.0.3/r1136_mangos.sql new file mode 100644 index 0000000..6e8d65d --- /dev/null +++ b/sql/Updates/0.0.3/r1136_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='npc_unworthy_initiate_anchor' WHERE entry=29521; +UPDATE creature_template SET ScriptName='npc_unworthy_initiate' WHERE entry IN (29519,29520,29565,29566,29567); +UPDATE gameobject_template SET ScriptName='go_acherus_soul_prison' WHERE entry IN (191577,191580,191581,191582,191583,191584,191585,191586,191587,191588,191589,191590); diff --git a/sql/Updates/0.0.3/r1136_scriptdev2.sql b/sql/Updates/0.0.3/r1136_scriptdev2.sql new file mode 100644 index 0000000..c807653 --- /dev/null +++ b/sql/Updates/0.0.3/r1136_scriptdev2.sql @@ -0,0 +1,18 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1609015 AND -1609000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1609000,'You have made a grave error, fiend!',0,0,0,0,'unworthy SAY_START_1'), +(-1609001,'I was a soldier of the Light once... Look at what I have become... ',0,0,0,0,'unworthy SAY_START_2'), +(-1609002,'You are hopelessly outmatched, $R.',0,0,0,0,'unworthy SAY_START_3'), +(-1609003,'They brand me unworthy? I will show them unmorthy!',0,0,0,0,'unworthy SAY_START_4'), +(-1609004,'You will allow me a weapon and armor, yes?',0,0,0,0,'unworthy SAY_START_5'), +(-1609005,'I will win my freedom and leave this cursed place!',0,0,0,0,'unworthy SAY_START_6'), +(-1609006,'I will dismantle this festering hellhole!',0,0,0,0,'unworthy SAY_START_7'), +(-1609007,'There can be only one survivor!',0,0,0,0,'unworthy SAY_START_8'), +(-1609008,'Let your fears consume you!',0,0,0,0,'unworthy SAY_AGGRO_1'), +(-1609009,'HAH! You can barely hold a blade! Yours will be a quick death.',0,0,0,0,'unworthy SAY_AGGRO_2'), +(-1609010,'And now you die',0,0,0,0,'unworthy SAY_AGGRO_3'), +(-1609011,'To battle!',0,0,0,0,'unworthy SAY_AGGRO_4'), +(-1609012,'There is no hope for our future...',0,0,0,0,'unworthy SAY_AGGRO_5'), +(-1609013,'Sate your hunger on cold steel, $R',0,0,0,0,'unworthy SAY_AGGRO_6'), +(-1609014,'It ends here!',0,0,0,0,'unworthy SAY_AGGRO_7'), +(-1609015,'Death is the only cure!',0,0,0,0,'unworthy SAY_AGGRO_8'); diff --git a/sql/Updates/0.0.3/r1140_scriptdev2.sql b/sql/Updates/0.0.3/r1140_scriptdev2.sql new file mode 100644 index 0000000..c0a119a --- /dev/null +++ b/sql/Updates/0.0.3/r1140_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8015+) '; diff --git a/sql/Updates/0.0.3/r1141_mangos.sql b/sql/Updates/0.0.3/r1141_mangos.sql new file mode 100644 index 0000000..77e7dc5 --- /dev/null +++ b/sql/Updates/0.0.3/r1141_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_azjol-nerub' WHERE map=601; diff --git a/sql/Updates/0.0.3/r1145_scriptdev2.sql b/sql/Updates/0.0.3/r1145_scriptdev2.sql new file mode 100644 index 0000000..826c8e5 --- /dev/null +++ b/sql/Updates/0.0.3/r1145_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1000356; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000356,'Okay, okay... gimme a minute to rest now. You gone and beat me up good.',0,0,14,1,'calvin SAY_COMPLETE'); diff --git a/sql/Updates/0.0.3/r1146_scriptdev2.sql b/sql/Updates/0.0.3/r1146_scriptdev2.sql new file mode 100644 index 0000000..67705df --- /dev/null +++ b/sql/Updates/0.0.3/r1146_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8040+) '; diff --git a/sql/Updates/0.0.3/r1149_scriptdev2.sql b/sql/Updates/0.0.3/r1149_scriptdev2.sql new file mode 100644 index 0000000..ed96b24 --- /dev/null +++ b/sql/Updates/0.0.3/r1149_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE script_texts SET language=1, emote=14 WHERE entry=-1000356; diff --git a/sql/Updates/0.0.3/r1152_scriptdev2.sql b/sql/Updates/0.0.3/r1152_scriptdev2.sql new file mode 100644 index 0000000..46c94bc --- /dev/null +++ b/sql/Updates/0.0.3/r1152_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8057+) '; diff --git a/sql/Updates/0.0.3/r1154_mangos.sql b/sql/Updates/0.0.3/r1154_mangos.sql new file mode 100644 index 0000000..fe3cf9c --- /dev/null +++ b/sql/Updates/0.0.3/r1154_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='mob_soaring_eagle' WHERE entry=24858; diff --git a/sql/Updates/0.0.3/r1155_mangos.sql b/sql/Updates/0.0.3/r1155_mangos.sql new file mode 100644 index 0000000..ff97c33 --- /dev/null +++ b/sql/Updates/0.0.3/r1155_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_spirit_lynx' WHERE entry=24143; diff --git a/sql/Updates/0.0.3/r1169_mangos.sql b/sql/Updates/0.0.3/r1169_mangos.sql new file mode 100644 index 0000000..66ee7e6 --- /dev/null +++ b/sql/Updates/0.0.3/r1169_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_death_knight_initiate' WHERE entry=28406; diff --git a/sql/Updates/0.0.3/r1169_scriptdev2.sql b/sql/Updates/0.0.3/r1169_scriptdev2.sql new file mode 100644 index 0000000..d16177f --- /dev/null +++ b/sql/Updates/0.0.3/r1169_scriptdev2.sql @@ -0,0 +1,8 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1609021 AND -1609016; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1609016,'No potions!',0,0,0,0,'dk_initiate SAY_DUEL_A'), +(-1609017,'Remember this day, $n, for it is the day that you will be thoroughly owned.',0,0,0,0,'dk_initiate SAY_DUEL_B'), +(-1609018,'I\'m going to tear your heart out, cupcake!',0,0,0,0,'dk_initiate SAY_DUEL_C'), +(-1609019,'Don\'t make me laugh.',0,0,0,0,'dk_initiate SAY_DUEL_D'), +(-1609020,'Here come the tears...',0,0,0,0,'dk_initiate SAY_DUEL_E'), +(-1609021,'You have challenged death itself!',0,0,0,0,'dk_initiate SAY_DUEL_F'); diff --git a/sql/Updates/0.0.3/r1171_scriptdev2.sql b/sql/Updates/0.0.3/r1171_scriptdev2.sql new file mode 100644 index 0000000..5eef42b --- /dev/null +++ b/sql/Updates/0.0.3/r1171_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8078+) '; diff --git a/sql/Updates/0.0.3/r1173_scriptdev2.sql b/sql/Updates/0.0.3/r1173_scriptdev2.sql new file mode 100644 index 0000000..b5bcbd7 --- /dev/null +++ b/sql/Updates/0.0.3/r1173_scriptdev2.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1609024 AND -1609022; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1609022,'The Lich King will see his true champion on this day!',0,0,0,0,'dk_initiate SAY_DUEL_G'), +(-1609023,'You\'re going down!',0,0,0,0,'dk_initiate SAY_DUEL_H'), +(-1609024,'You don\'t stand a chance, $n',0,0,0,0,'dk_initiate SAY_DUEL_I'); diff --git a/sql/Updates/0.0.3/r1180_mangos.sql b/sql/Updates/0.0.3/r1180_mangos.sql new file mode 100644 index 0000000..30be03f --- /dev/null +++ b/sql/Updates/0.0.3/r1180_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_slim' WHERE entry=19679; diff --git a/sql/Updates/0.0.3/r1184_mangos.sql b/sql/Updates/0.0.3/r1184_mangos.sql new file mode 100644 index 0000000..1257fb8 --- /dev/null +++ b/sql/Updates/0.0.3/r1184_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName` = 'npc_cassa_crimsonwing' WHERE `entry` =23704; diff --git a/sql/Updates/0.0.3/r1197_mangos.sql b/sql/Updates/0.0.3/r1197_mangos.sql new file mode 100644 index 0000000..4515b7e --- /dev/null +++ b/sql/Updates/0.0.3/r1197_mangos.sql @@ -0,0 +1,5 @@ +UPDATE instance_template SET script='instance_sunwell_plateau' WHERE map=580; +UPDATE creature_template SET ScriptName='boss_kalecgos' WHERE entry=24850; +UPDATE creature_template SET ScriptName='boss_kalecgos_humanoid' WHERE entry=24891; +UPDATE creature_template SET ScriptName='boss_sathrovarr' WHERE entry=24892; +UPDATE gameobject_template SET ScriptName='go_spectral_rift' WHERE entry=187055; diff --git a/sql/Updates/0.0.3/r1199_mangos.sql b/sql/Updates/0.0.3/r1199_mangos.sql new file mode 100644 index 0000000..05a7943 --- /dev/null +++ b/sql/Updates/0.0.3/r1199_mangos.sql @@ -0,0 +1,2 @@ +DELETE FROM areatrigger_scripts WHERE entry=4853; +INSERT INTO areatrigger_scripts VALUES (4853,'at_madrigosa'); diff --git a/sql/Updates/0.0.3/r1202_mangos.sql b/sql/Updates/0.0.3/r1202_mangos.sql new file mode 100644 index 0000000..3b0b314 --- /dev/null +++ b/sql/Updates/0.0.3/r1202_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_a_special_surprise' WHERE entry IN (29032,29061,29065,29067,29068,29070,29074,29072,29073,29071); diff --git a/sql/Updates/0.0.3/r1202_scriptdev2.sql b/sql/Updates/0.0.3/r1202_scriptdev2.sql new file mode 100644 index 0000000..2214199 --- /dev/null +++ b/sql/Updates/0.0.3/r1202_scriptdev2.sql @@ -0,0 +1,56 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1609078 AND -1609025; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1609025,'Come to finish the job, have you?',0,0,0,1,'special_surprise SAY_EXEC_START_1'), +(-1609026,'Come to finish the job, have ye?',0,0,0,1,'special_surprise SAY_EXEC_START_2'), +(-1609027,'Come ta finish da job, mon?',0,0,0,1,'special_surprise SAY_EXEC_START_3'), +(-1609028,'You\'ll look me in the eyes when...',0,0,0,25,'special_surprise SAY_EXEC_PROG_1'), +(-1609029,'Well this son o\' Ironforge would like...',0,0,0,25,'special_surprise SAY_EXEC_PROG_2'), +(-1609030,'Ironic, isn\'t it? To be killed...',0,0,0,25,'special_surprise SAY_EXEC_PROG_3'), +(-1609031,'If you\'d allow me just one...',0,0,0,25,'special_surprise SAY_EXEC_PROG_4'), +(-1609032,'I\'d like to stand for...',0,0,0,25,'special_surprise SAY_EXEC_PROG_5'), +(-1609033,'I want to die like an orc...',0,0,0,25,'special_surprise SAY_EXEC_PROG_6'), +(-1609034,'Dis troll gonna stand for da...',0,0,0,25,'special_surprise SAY_EXEC_PROG_7'), +(-1609035,'$N?',0,0,0,1,'special_surprise SAY_EXEC_NAME_1'), +(-1609036,'$N? Mon?',0,0,0,1,'special_surprise SAY_EXEC_NAME_2'), +(-1609037,'$N, I\'d recognize that face anywhere... What... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_1'), +(-1609038,'$N, I\'d recognize those face tentacles anywhere... What... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_2'), +(-1609039,'$N, I\'d recognize that face anywhere... What... What have they done to ye, $Glad:lass;?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_3'), +(-1609040,'$N, I\'d recognize that decay anywhere... What... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_4'), +(-1609041,'$N, I\'d recognize those horns anywhere... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_5'), +(-1609042,'$N, I\'d recognize dem tusks anywhere... What... What have dey done ta you, mon?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_6'), +(-1609043,'You don\'t remember me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a righteous force of reckoning. Every last ounce of good... Everything that made you a draenei!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_1'), +(-1609044,'Ye don\'t remember me, do ye? Blasted Scourge... They\'ve tried to drain ye o\' everything that made ye a righteous force o\' reckoning. Every last ounce o\' good... Everything that made you a $Gson:daughter; of Ironforge!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_2'), +(-1609045,'You don\'t remember me, do you? We were humans once - long, long ago - until Lordaeron fell to the Scourge. Your transformation to a Scourge zombie came shortly after my own. Not long after that, our minds were freed by the Dark Lady.',0,0,0,1,'special_surprise SAY_EXEC_NOREM_3'), +(-1609046,'You don\'t remember me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a pint-sized force of reckoning. Every last ounce of good... Everything that made you a gnome!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_4'), +(-1609047,'You don\'t remember me, do you? Blasted Scourge...They\'ve tried to drain of everything that made you a righteous force of reckoning. Every last ounce of good...Everything that made you a human!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_5'), +(-1609048,'You don\'t remember me? When you were a child your mother would leave you in my care while she served at the Temple of the Moon. I held you in my arms and fed you with honey and sheep\'s milk to calm you until she would return. You were my little angel. Blasted Scourge... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_NOREM_6'), +(-1609049,'You don\'t recognize me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a righteous force of reckoning. Every last ounce of good... Everything that made you an orc!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_7'), +(-1609050,'You don\'t remember me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a righteous force of reckoning. Every last ounce of good... Everything that made you a tauren!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_8'), +(-1609051,'You don\'t remember me, mon? Damn da Scourge! Dey gone ta drain you of everytin dat made ya a mojo masta. Every last ounce of good... Everytin\' dat made ya a troll hero, mon!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_9'), +(-1609052,'A pact was made, $Gbrother:sister;! We vowed vengeance against the Lich King! For what he had done to us! We battled the Scourge as Forsaken, pushing them back into the plaguelands and freeing Tirisfal! You and I were champions of the Forsaken!',0,0,0,1,'special_surprise SAY_EXEC_THINK_1'), +(-1609053,'You must remember the splendor of life, $Gbrother:sister;. You were a champion of the Kaldorei once! This isn\'t you!',0,0,0,1,'special_surprise SAY_EXEC_THINK_2'), +(-1609054,'Think, $N. Think back. Try and remember the majestic halls of Silvermoon City, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the sin\'dorei once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_3'), +(-1609055,'Think, $N. Think back. Try and remember the proud mountains of Argus, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the draenei once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_4'), +(-1609056,'Think, $N. Think back. Try and remember the snow capped mountains o\' Dun Morogh! Ye were born there, $Glad:lass;. Remember the splendor o\' life, $N! Ye were a champion o\' the dwarves once! This isn\'t ye!',0,0,0,6,'special_surprise SAY_EXEC_THINK_5'), +(-1609057,'Think, $N. Think back. Try and remember Gnomeregan before those damned troggs! Remember the feel of an [arclight spanner] $Gbrother:sister;. You were a champion of gnome-kind once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_6'), +(-1609058,'Think, $N. Think back. Try and remember the hills and valleys of Elwynn, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the Alliance once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_7'), +(-1609059,'Think, $N. Think back. Try and remember Durotar, $Gbrother:sister;! Remember the sacrifices our heroes made so that we could be free of the blood curse. Harken back to the Valley of Trials, where we were reborn into a world without demonic influence. We found the splendor of life, $N. Together! This isn\'t you. You were a champion of the Horde once!',0,0,0,6,'special_surprise SAY_EXEC_THINK_8'), +(-1609060,'Think, $N. Think back. Try and remember the rolling plains of Mulgore, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the tauren once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_9'), +(-1609061,'TINK $N. Tink back, mon! We be Darkspear, mon! Bruddas and sistas! Remember when we fought the Zalazane and done took he head and freed da Echo Isles? MON! TINK! You was a champion of da Darkspear trolls!',0,0,0,6,'special_surprise SAY_EXEC_THINK_10'), +(-1609062,'Listen to me, $N. You must fight against the Lich King\'s control. He is a monster that wants to see this world - our world - in ruin. Don\'t let him use you to accomplish his goals. You were once a hero and you can be again. Fight, damn you! Fight his control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_1'), +(-1609063,'Listen to me, $N Ye must fight against the Lich King\'s control. He\'s a monster that wants to see this world - our world - in ruin. Don\'t let him use ye to accomplish his goals. Ye were once a hero and ye can be again. Fight, damn ye! Fight his control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_2'), +(-1609064,'Listen to me, $N. You must fight against the Lich King\'s control. He is a monster that wants to see this world - our world - in ruin. Don\'t let him use you to accomplish his goals AGAIN. You were once a hero and you can be again. Fight, damn you! Fight his control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_3'), +(-1609065,'Listen ta me, $Gbrudda:sista;. You must fight against da Lich King\'s control. He be a monstar dat want ta see dis world - our world - be ruined. Don\'t let he use you ta accomplish he goals. You be a hero once and you be a hero again! Fight it, mon! Fight he control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_4'), +(-1609066,'What\'s going on in there? What\'s taking so long, $N?',0,1,0,0,'special_surprise SAY_PLAGUEFIST'), +(-1609067,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Silvermoon. This world is worth saving!',0,0,0,18,'special_surprise SAY_EXEC_TIME_1'), +(-1609068,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Argus. Don\'t let that happen to this world.',0,0,0,18,'special_surprise SAY_EXEC_TIME_2'), +(-1609069,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both $N... For KHAAAAAAAAZZZ MODAAAAAANNNNNN!!!',0,0,0,18,'special_surprise SAY_EXEC_TIME_3'), +(-1609070,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Tirisfal! This world is worth saving!',0,0,0,18,'special_surprise SAY_EXEC_TIME_4'), +(-1609071,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Gnomeregan! This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_5'), +(-1609072,'There... There\'s no more time for me. I\'m done for. FInish me off, $N. Do it or they\'ll kill us both. $N...Remember Elwynn. This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_6'), +(-1609073,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Teldrassil, our beloved home. This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_7'), +(-1609074,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... For the Horde! This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_8'), +(-1609075,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Mulgore. This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_9'), +(-1609076,'Der... Der\'s no more time for me. I be done for. Finish me off $N. Do it or they\'ll kill us both. $N... Remember Sen\'jin Village, mon! Dis world be worth saving!',0,0,0,18,'special_surprise SAY_EXEC_TIME_10'), +(-1609077,'Do it, $N! Put me out of my misery!',0,0,0,1,'special_surprise SAY_EXEC_WAITING'), +(-1609078,'dies from his wounds.',0,2,0,0,'special_surprise EMOTE_DIES'); diff --git a/sql/Updates/0.0.3/r1207_mangos.sql b/sql/Updates/0.0.3/r1207_mangos.sql new file mode 100644 index 0000000..0102f74 --- /dev/null +++ b/sql/Updates/0.0.3/r1207_mangos.sql @@ -0,0 +1,9 @@ +UPDATE instance_template SET script='instance_halls_of_lightning' WHERE map=602; +UPDATE creature_template SET ScriptName='boss_bjarngrim' WHERE entry=28586; +UPDATE creature_template SET ScriptName='mob_stormforged_lieutenant' WHERE entry=29240; +UPDATE creature_template SET ScriptName='boss_volkhan' WHERE entry=28587; +UPDATE creature_template SET ScriptName='mob_molten_golem' WHERE entry=28695; +UPDATE creature_template SET ScriptName='npc_volkhan_anvil' WHERE entry=28823; +UPDATE creature_template SET ScriptName='boss_ionar' WHERE entry=28546; +UPDATE creature_template SET ScriptName='mob_spark_of_ionar' WHERE entry=28926; +UPDATE creature_template SET ScriptName='boss_loken' WHERE entry=28923; diff --git a/sql/Updates/0.0.3/r1207_scriptdev2.sql b/sql/Updates/0.0.3/r1207_scriptdev2.sql new file mode 100644 index 0000000..28d0b0e --- /dev/null +++ b/sql/Updates/0.0.3/r1207_scriptdev2.sql @@ -0,0 +1,45 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1602042 AND -1602000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1602000,'I am the greatest of my father\'s sons! Your end has come!',14149,1,0,0,'bjarngrim SAY_AGGRO'), +(-1602001,'So ends your curse!',14153,1,0,0,'bjarngrim SAY_SLAY_1'), +(-1602002,'Flesh... is... weak!',14154,1,0,0,'bjarngrim SAY_SLAY_2'), +(-1602003,'...',14155,1,0,0,'bjarngrim SAY_SLAY_3'), +(-1602004,'How can it be...? Flesh is not... stronger!',14156,1,0,0,'bjarngrim SAY_DEATH'), +(-1602005,'Defend yourself, for all the good it will do!',14151,1,0,0,'bjarngrim SAY_BATTLE_STANCE'), +(-1602006,'switches to Battle Stance!',0,3,0,0,'bjarngrim EMOTE_BATTLE_STANCE'), +(-1602007,'GRAAAAAH! Behold the fury of iron and steel!',14152,1,0,0,'bjarngrim SAY_BERSEKER_STANCE'), +(-1602008,'switches to Berserker Stance!',0,3,0,0,'bjarngrim EMOTE_BERSEKER_STANCE'), +(-1602009,'Give me your worst!',14150,1,0,0,'bjarngrim SAY_DEFENSIVE_STANCE'), +(-1602010,'switches to Defensive Stance!',0,3,0,0,'bjarngrim EMOTE_DEFENSIVE_STANCE'), +(-1602011,'You wish to confront the master? You must weather the storm!',14453,1,0,0,'ionar SAY_AGGRO'), +(-1602012,'Shocking ... I know!',14456,1,0,0,'ionar SAY_SLAY_1'), +(-1602013,'You atempt the unpossible.',14457,1,0,0,'ionar SAY_SLAY_2'), +(-1602014,'Your spark of light is ... extinguish.',14458,1,0,0,'ionar SAY_SLAY_3'), +(-1602015,'Master... you have guests.',14459,1,0,0,'ionar SAY_DEATH'), +(-1602016,'The slightest spark shall be your undoing.',14454,1,0,0,'ionar SAY_SPLIT_1'), +(-1602017,'No one is safe!',14455,1,0,0,'ionar SAY_SPLIT_2'), +(-1602018,'What hope is there for you? None!',14162,1,0,0,'loken SAY_AGGRO0'), +(-1602019,'I have witnessed the rise and fall of empires. The birth and extinction of entire species. Over countless millennia the foolishness of mortals has remained beyond a constant. Your presence here confirms this.',14160,1,0,0,'loken SAY_INTRO_1'), +(-1602020,'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!',14162,1,0,0,'loken SAY_INTRO_2'), +(-1602021,'Only mortal...',14166,1,0,0,'loken SAY_SLAY_1'), +(-1602022,'I... am... FOREVER!',14167,1,0,0,'loken SAY_SLAY_2'), +(-1602023,'What little time you had, you wasted!',14168,1,0,0,'loken SAY_SLAY_3'), +(-1602024,'My death... heralds the end of this world.',14172,1,0,0,'loken SAY_DEATH'), +(-1602025,'You cannot hide from fate!',14163,1,0,0,'loken SAY_NOVA_1'), +(-1602026,'Come closer. I will make it quick.',14164,1,0,0,'loken SAY_NOVA_2'), +(-1602027,'Your flesh cannot hold out for long.',14165,1,0,0,'loken SAY_NOVA_3'), +(-1602028,'You stare blindly into the abyss!',14169,1,0,0,'loken SAY_75HEALTH'), +(-1602029,'Your ignorance is profound. Can you not see where this path leads?',14170,1,0,0,'loken SAY_50HEALTH'), +(-1602030,'You cross the precipice of oblivion!',14171,1,0,0,'loken SAY_25HEALTH'), +(-1602031,'begins to cast Lightning Nova!',0,3,0,0,'loken EMOTE_NOVA'), +(-1602032,'It is you who have destroyed my children? You... shall... pay!',13960,1,0,0,'volkhan SAY_AGGRO'), +(-1602033,'The armies of iron will conquer all!',13965, 1,0,0,'volkhan SAY_SLAY_1'), +(-1602034,'Ha, pathetic!',13966,1,0,0,'volkhan SAY_SLAY_2'), +(-1602035,'You have cost me too much work!',13967,1,0,0,'volkhan SAY_SLAY_3'), +(-1602036,'The master was right... to be concerned.',13968,1,0,0,'volkhan SAY_DEATH'), +(-1602037,'I will crush you beneath my boots!',13963,1,0,0,'volkhan SAY_STOMP_1'), +(-1602038,'All my work... undone!',13964,1,0,0,'volkhan SAY_STOMP_2'), +(-1602039,'Life from the lifelessness... death for you.',13961,1,0,0,'volkhan SAY_FORGE_1'), +(-1602040,'Nothing is wasted in the process. You will see....',13962,1,0,0,'volkhan SAY_FORGE_2'), +(-1602041,'runs to his anvil!',0,3,0,0,'volkhan EMOTE_TO_ANVIL'), +(-1602042,'prepares to shatter his Brittle Golems!',0,3,0,0,'volkhan EMOTE_SHATTER'); diff --git a/sql/Updates/0.0.3/r1210_mangos.sql b/sql/Updates/0.0.3/r1210_mangos.sql new file mode 100644 index 0000000..236c1e4 --- /dev/null +++ b/sql/Updates/0.0.3/r1210_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_brutallus' WHERE entry=24882; diff --git a/sql/Updates/0.0.3/r1212_mangos.sql b/sql/Updates/0.0.3/r1212_mangos.sql new file mode 100644 index 0000000..a964374 --- /dev/null +++ b/sql/Updates/0.0.3/r1212_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kaya' WHERE entry=11856; diff --git a/sql/Updates/0.0.3/r1212_scriptdev2.sql b/sql/Updates/0.0.3/r1212_scriptdev2.sql new file mode 100644 index 0000000..92fa0d8 --- /dev/null +++ b/sql/Updates/0.0.3/r1212_scriptdev2.sql @@ -0,0 +1,27 @@ +DELETE FROM script_waypoint WHERE entry=11856; +INSERT INTO script_waypoint VALUES +(11856, 0, 113.91, -350.13, 4.55, 0, ''), +(11856, 1, 109.54, -350.08, 3.74, 0, ''), +(11856, 2, 106.95, -353.40, 3.60, 0, ''), +(11856, 3, 100.28, -338.89, 2.97, 0, ''), +(11856, 4, 110.11, -320.26, 3.47, 0, ''), +(11856, 5, 109.78, -287.80, 5.30, 0, ''), +(11856, 6, 105.02, -269.71, 4.71, 0, ''), +(11856, 7, 86.71, -251.81, 5.34, 0, ''), +(11856, 8, 64.10, -246.38, 5.91, 0, ''), +(11856, 9, -2.55, -243.58, 6.3, 0, ''), +(11856, 10, -27.78, -267.53, -1.08, 0, ''), +(11856, 11, -31.27, -283.54, -4.36, 0, ''), +(11856, 12, -28.96, -322.44, -9.19, 0, ''), +(11856, 13, -35.63, -360.03, -16.59, 0, ''), +(11856, 14, -58.30, -412.26, -30.60, 0, ''), +(11856, 15, -58.88, -474.17, -44.54, 0, ''), +(11856, 16, -45.92, -496.57, -46.26, 5000, 'AMBUSH'), +(11856, 17, -40.25, -510.07, -46.05, 0, ''), +(11856, 18, -38.88, -520.72, -46.06, 5000, 'END'); + +DELETE FROM script_texts WHERE entry BETWEEN -1000359 AND -1000357; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000357,'Let\'s go before they find out I\'m free!',0,0,0,1,'KAYA_SAY_START'), +(-1000358,'Look out! We\'re under attack!',0,0,0,0,'KAYA_AMBUSH'), +(-1000359,'Thank you for helping me. I know my way back from here.',0,0,0,0,'KAYA_END'); diff --git a/sql/Updates/0.0.3/r1215_mangos.sql b/sql/Updates/0.0.3/r1215_mangos.sql new file mode 100644 index 0000000..dd0907d --- /dev/null +++ b/sql/Updates/0.0.3/r1215_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_koltira_deathweaver' WHERE entry=28912; diff --git a/sql/Updates/0.0.3/r1215_scriptdev2.sql b/sql/Updates/0.0.3/r1215_scriptdev2.sql new file mode 100644 index 0000000..ed6f95d --- /dev/null +++ b/sql/Updates/0.0.3/r1215_scriptdev2.sql @@ -0,0 +1,26 @@ +DELETE FROM script_waypoint WHERE entry=28912; +INSERT INTO script_waypoint VALUES +(28912, 0, 1653.518, -6038.374, 127.585, 0, 'Jump off'), +(28912, 1, 1653.978, -6034.614, 127.585, 5000, 'To Box'), +(28912, 2, 1653.854, -6034.726, 127.585, 500, 'Equip'), +(28912, 3, 1652.297, -6035.671, 127.585, 3000, 'Recover'), +(28912, 4, 1639.762, -6046.343, 127.948, 0, 'Escape'), +(28912, 5, 1640.963, -6028.119, 134.740, 0, ''), +(28912, 6, 1625.805, -6029.197, 134.740, 0, ''), +(28912, 7, 1626.845, -6015.085, 134.740, 0, ''), +(28912, 8, 1649.150, -6016.975, 133.240, 0, ''), +(28912, 9, 1653.063, -5974.844, 132.652, 5000, 'Mount'), +(28912, 10, 1654.747, -5926.424, 121.191, 0, 'Disappear'); + +DELETE FROM script_texts WHERE entry BETWEEN -1609088 AND -1609079; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1609079, 'I\'ll need to get my runeblade and armor... Just need a little more time.',0,0,0,399,'koltira SAY_BREAKOUT1'), +(-1609080, 'I\'m still weak, but I think I can get an anti-magic barrier up. Stay inside it or you\'ll be destroyed by their spells.',0,0,0,0,'koltira SAY_BREAKOUT2'), +(-1609081, 'Maintaining this barrier will require all of my concentration. Kill them all!',0,0,0,16,'koltira SAY_BREAKOUT3'), +(-1609082, 'There are more coming. Defend yourself! Don\'t fall out of the anti-magic field! They\'ll tear you apart without its protection!',0,0,0,0,'koltira SAY_BREAKOUT4'), +(-1609083, 'I can\'t keep barrier up much longer... Where is that coward?',0,0,0,0,'koltira SAY_BREAKOUT5'), +(-1609084, 'The High Inquisitor comes! Be ready, death knight! Do not let him draw you out of the protective bounds of my anti-magic field! Kill him and take his head!',0,0,0,0,'koltira SAY_BREAKOUT6'), +(-1609085, 'Stay in the anti-magic field! Make them come to you!',0,0,0,0,'koltira SAY_BREAKOUT7'), +(-1609086, 'The death of the High Inquisitor of New Avalon will not go unnoticed. You need to get out of here at once! Go, before more of them show up. I\'ll be fine on my own.',0,0,0,0,'koltira SAY_BREAKOUT8'), +(-1609087, 'I\'ll draw their fire, you make your escape behind me.',0,0,0,0,'koltira SAY_BREAKOUT9'), +(-1609088, 'Your High Inquisitor is nothing more than a pile of meat, Crusaders! There are none beyond the grasp of the Scourge!',0,1,0,0,'koltira SAY_BREAKOUT10'); diff --git a/sql/Updates/0.0.3/r1218_scriptdev2.sql b/sql/Updates/0.0.3/r1218_scriptdev2.sql new file mode 100644 index 0000000..cec2fc1 --- /dev/null +++ b/sql/Updates/0.0.3/r1218_scriptdev2.sql @@ -0,0 +1,57 @@ +UPDATE script_texts SET content_default='%s goes into a killing frenzy!' WHERE entry=-1000001; +UPDATE script_texts SET content_default='%s goes into a frenzy!' WHERE entry=-1000002; +UPDATE script_texts SET content_default='%s becomes enraged!' WHERE entry=-1000003; +UPDATE script_texts SET content_default='%s goes into a berserker rage!' WHERE entry=-1000004; +UPDATE script_texts SET content_default='%s hugs her father.' WHERE entry=-1000116; +UPDATE script_texts SET content_default='%s looks up at you quizzically. Maybe you should inspect it?' WHERE entry=-1000204; +UPDATE script_texts SET content_default='%s looks at you unexpectadly.' WHERE entry=-1000205; +UPDATE script_texts SET content_default='%s starts pecking at the feed.' WHERE entry=-1000206; +UPDATE script_texts SET content_default='Warning! %s emergency shutdown process initiated by $N. Shutdown will complete in two minutes.' WHERE entry=-1000211; +UPDATE script_texts SET content_default='%s begins tinkering with the goggles before the stone.' WHERE entry=-1000267; +UPDATE script_texts SET content_default='%s hands one glowing goggles over to Doctor Draxlegauge.' WHERE entry=-1000272; +UPDATE script_texts SET content_default='%s growls in acknowledgement before straightening and making her way off into the forest.' WHERE entry=-1000324; +UPDATE script_texts SET content_default='%s becomes enraged!' WHERE entry=-1189004; +UPDATE script_texts SET content_default='%s takes in a deep breath...' WHERE entry=-1249004; +UPDATE script_texts SET content_default='%s goes into a frenzy!' WHERE entry=-1269018; +UPDATE script_texts SET content_default='%s performs one last service for Ragnaros.' WHERE entry=-1409000; +UPDATE script_texts SET content_default='%s goes into a killing frenzy!' WHERE entry=-1409001; +UPDATE script_texts SET content_default='%s refuses to die while its master is in trouble.' WHERE entry=-1409002; +UPDATE script_texts SET content_default='%s goes into a killing frenzy!' WHERE entry=-1469002; +UPDATE script_texts SET content_default='%s flinches as its skin shimmers.' WHERE entry=-1469003; +UPDATE script_texts SET content_default='%s goes into a frenzy!' WHERE entry=-1469031; +UPDATE script_texts SET content_default='%s senses your fear.' WHERE entry=-1509000; +UPDATE script_texts SET content_default='%s bristles with energy!' WHERE entry=-1509001; +UPDATE script_texts SET content_default='%s sets eyes on $N!' WHERE entry=-1509002; +UPDATE script_texts SET content_default='%s is weakened!' WHERE entry=-1531011; +UPDATE script_texts SET content_default='%s begins to rust.' WHERE entry=-1532038; +UPDATE script_texts SET content_default='%s cries out in withdrawal, opening gates to the warp.' WHERE entry=-1532089; +UPDATE script_texts SET content_default='%s goes into a nether-fed rage!' WHERE entry=-1532090; +UPDATE script_texts SET content_default='%s goes into a berserker rage!' WHERE entry=-1533021; +UPDATE script_texts SET content_default='%s becomes enraged!' WHERE entry=-1533022; +UPDATE script_texts SET content_default='%s takes in a deep breath...' WHERE entry=-1533082; +UPDATE script_texts SET content_default='%s enrages!' WHERE entry=-1533083; +UPDATE script_texts SET content_default='%s enrages!' WHERE entry=-1540041; +UPDATE script_texts SET content_default='%s becomes enraged!' WHERE entry=-1544012; +UPDATE script_texts SET content_default='%s begins to cast Blast Nova!' WHERE entry=-1544013; +UPDATE script_texts SET content_default='%s\'s bonds begin to weaken!' WHERE entry=-1544014; +UPDATE script_texts SET content_default='%s breaks free!' WHERE entry=-1544015; +UPDATE script_texts SET content_default='%s sends his enemies to their watery graves!' WHERE entry=-1548039; +UPDATE script_texts SET content_default='%s summons Watery Globules!' WHERE entry=-1548041; +UPDATE script_texts SET content_default='%s sets his gaze on $N!' WHERE entry=-1550037; +UPDATE script_texts SET content_default='%s emits a strange noise.' WHERE entry=-1553006; +UPDATE script_texts SET content_default='%s draws energy from the air.' WHERE entry=-1555036; +UPDATE script_texts SET content_default='%s begins to channel arcane energy...' WHERE entry=-1556015; +UPDATE script_texts SET content_default='%s shifts into the void...' WHERE entry=-1557014; +UPDATE script_texts SET content_default='%s grows in size!' WHERE entry=-1565019; +UPDATE script_texts SET content_default='%s begins to channel from the nearby Fel Crystal...' WHERE entry=-1585006; +UPDATE script_texts SET content_default='%s discharges pure energy!' WHERE entry=-1585011; +UPDATE script_texts SET content_default='%s switches to Berserker Stance!' WHERE entry=-1602008; +UPDATE script_texts SET content_default='%s switches to Defensive Stance!' WHERE entry=-1602010; +UPDATE script_texts SET content_default='%s switches to Battle Stance!' WHERE entry=-1602006; +UPDATE script_texts SET content_default='%s begins to cast Lightning Nova!' WHERE entry=-1602031; +UPDATE script_texts SET content_default='%s runs to his anvil!' WHERE entry=-1602041; +UPDATE script_texts SET content_default='%s prepares to shatter his Brittle Golems!' WHERE entry=-1602042; +UPDATE script_texts SET content_default='%s dies from his wounds.' WHERE entry=-1609078; +UPDATE script_texts SET content_default='%s puts the shell to his ear.' WHERE entry=-1000185; +UPDATE script_texts SET content_default='%s kneels down and pick up the amulet.' WHERE entry=-1000197; +UPDATE script_texts SET content_default='%s raises his hammer menacingly...' WHERE entry=-1554012; diff --git a/sql/Updates/0.0.3/r1221_mangos.sql b/sql/Updates/0.0.3/r1221_mangos.sql new file mode 100644 index 0000000..d992510 --- /dev/null +++ b/sql/Updates/0.0.3/r1221_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=13936; + +DELETE FROM areatrigger_scripts WHERE entry=3066; +INSERT INTO areatrigger_scripts VALUES (3066,'at_ravenholdt'); diff --git a/sql/Updates/0.0.3/r1221_scriptdev2.sql b/sql/Updates/0.0.3/r1221_scriptdev2.sql new file mode 100644 index 0000000..cf1727c --- /dev/null +++ b/sql/Updates/0.0.3/r1221_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8190+) '; diff --git a/sql/Updates/0.0.3/r1222_scriptdev2.sql b/sql/Updates/0.0.3/r1222_scriptdev2.sql new file mode 100644 index 0000000..6581760 --- /dev/null +++ b/sql/Updates/0.0.3/r1222_scriptdev2.sql @@ -0,0 +1,12 @@ +DELETE FROM script_waypoint WHERE entry=16812; +INSERT INTO script_waypoint VALUES +(16812, 0, -10868.260, -1779.836, 90.476, 2500, 'Open door, begin walking'), +(16812, 1, -10875.585, -1779.581, 90.478, 0, ''), +(16812, 2, -10887.447, -1779.258, 90.476, 0, ''), +(16812, 3, -10894.592, -1780.668, 90.476, 0, ''), +(16812, 4, -10895.015, -1782.036, 90.476, 2500, 'Begin Speech after this'), +(16812, 5, -10894.592, -1780.668, 90.476, 0, 'Resume walking (back to spawn point now) after speech'), +(16812, 6, -10887.447, -1779.258, 90.476, 0, ''), +(16812, 7, -10875.585, -1779.581, 90.478, 0, ''), +(16812, 8, -10868.260, -1779.836, 90.476, 5000, 'close door'), +(16812, 9, -10866.799, -1780.958, 90.470, 2000, 'Summon mobs, open curtains'); diff --git a/sql/Updates/0.0.3/r1234_mangos.sql b/sql/Updates/0.0.3/r1234_mangos.sql new file mode 100644 index 0000000..794ec5a --- /dev/null +++ b/sql/Updates/0.0.3/r1234_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_gong_of_bethekk' WHERE entry=180526; diff --git a/sql/Updates/0.0.3/r1241_scriptdev2.sql b/sql/Updates/0.0.3/r1241_scriptdev2.sql new file mode 100644 index 0000000..49353de --- /dev/null +++ b/sql/Updates/0.0.3/r1241_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry IN (-1000360, -1000361); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000360,'The strands of LIFE have been severed! The Dreamers must be avenged!',0,1,0,0,' ysondre SAY_AGGRO'), +(-1000361,'Come forth, ye Dreamers – and claim your vengeance!',0,1,0,0,' ysondre SAY_SUMMONDRUIDS'); diff --git a/sql/Updates/0.0.3/r1242_mangos.sql b/sql/Updates/0.0.3/r1242_mangos.sql new file mode 100644 index 0000000..ab4a821 --- /dev/null +++ b/sql/Updates/0.0.3/r1242_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_paoka_swiftmountain' WHERE entry=10427; diff --git a/sql/Updates/0.0.3/r1242_scriptdev2.sql b/sql/Updates/0.0.3/r1242_scriptdev2.sql new file mode 100644 index 0000000..3177f89 --- /dev/null +++ b/sql/Updates/0.0.3/r1242_scriptdev2.sql @@ -0,0 +1,36 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000364 AND -1000362; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000362,'Let\'s go $N. I am ready to reach Whitereach Post.',0,0,1,0,'paoka SAY_START'), +(-1000363,'Now this looks familiar. If we keep heading east, I think we can... Ahh, Wyvern on the attack!',0,0,1,0,'paoka SAY_WYVERN'), +(-1000364,'Thanks a bunch... I can find my way back to Whitereach Post from here. Be sure to talk with Motega Firemane; perhaps you can keep him from sending me home.',0,0,1,0,'paoka SAY_COMPLETE'); + +DELETE FROM script_waypoint WHERE entry=10427; +INSERT INTO script_waypoint VALUES +(10427, 0, -5185.463, -1185.927, 45.951, 0, ''), +(10427, 1, -5184.880, -1154.210, 45.035, 0, ''), +(10427, 2, -5175.880, -1126.526, 43.701, 0, ''), +(10427, 3, -5138.651, -1111.874, 44.024, 0, ''), +(10427, 4, -5134.728, -1104.796, 47.365, 0, ''), +(10427, 5, -5129.681, -1097.878, 49.449, 2500, ''), +(10427, 6, -5125.303, -1080.572, 47.033, 0, ''), +(10427, 7, -5146.668, -1053.694, 28.415, 0, ''), +(10427, 8, -5147.463, -1027.539, 13.818, 0, ''), +(10427, 9, -5139.238, -1018.889, 8.220, 0, ''), +(10427, 10, -5121.168, -1013.126, -0.619, 0, ''), +(10427, 11, -5091.919, -1014.205, -4.902, 0, ''), +(10427, 12, -5069.240, -994.299, -4.631, 0, ''), +(10427, 13, -5059.975, -944.112, -5.377, 0, ''), +(10427, 14, -5013.546, -906.184, -5.490, 0, ''), +(10427, 15, -4992.461, -920.983, -4.980, 5000, 'SAY_WYVERN'), +(10427, 16, -4976.355, -1002.997, -5.380, 0, ''), +(10427, 17, -4958.478, -1033.185, -5.433, 0, ''), +(10427, 18, -4953.353, -1052.211, -10.836, 0, ''), +(10427, 19, -4937.447, -1056.351, -22.139, 0, ''), +(10427, 20, -4908.455, -1050.433, -33.458, 0, ''), +(10427, 21, -4905.530, -1056.885, -33.722, 0, ''), +(10427, 22, -4920.830, -1073.284, -45.515, 0, ''), +(10427, 23, -4933.368, -1082.700, -50.186, 0, ''), +(10427, 24, -4935.313, -1092.353, -52.785, 0, ''), +(10427, 25, -4929.553, -1101.268, -50.637, 0, ''), +(10427, 26, -4920.679, -1100.028, -51.944, 10000, 'SAY_COMPLETE'), +(10427, 27, -4920.679, -1100.028, -51.944, 0, 'quest complete'); diff --git a/sql/Updates/0.0.3/r1243_mangos.sql b/sql/Updates/0.0.3/r1243_mangos.sql new file mode 100644 index 0000000..1880368 --- /dev/null +++ b/sql/Updates/0.0.3/r1243_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_lakota_windsong' WHERE entry=10646; diff --git a/sql/Updates/0.0.3/r1243_scriptdev2.sql b/sql/Updates/0.0.3/r1243_scriptdev2.sql new file mode 100644 index 0000000..722ee97 --- /dev/null +++ b/sql/Updates/0.0.3/r1243_scriptdev2.sql @@ -0,0 +1,56 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000369 AND -1000365; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000365,'Be on guard... Arnak has some strange power over the Grimtotem... they will not be happy to see me escape.',0,0,1,0,'lakota SAY_LAKO_START'), +(-1000366,'Look out, the Grimtotem are upon us!',0,0,1,0,'lakota SAY_LAKO_LOOK_OUT'), +(-1000367,'Here they come.',0,0,1,0,'lakota SAY_LAKO_HERE_COME'), +(-1000368,'More Grimtotems are coming this way!',0,0,1,0,'lakota SAY_LAKO_MORE'), +(-1000369,'Finally, free at last... I must be going now, thanks for helping me escape. I can get back to Freewind Post by myself.',0,0,1,0,'lakota SAY_LAKO_END'); + +DELETE FROM script_waypoint WHERE entry=10646; +INSERT INTO script_waypoint VALUES +(10646, 0, -4792.401855, -2137.775146, 82.423, 0, ''), +(10646, 1, -4813.508301, -2141.543457, 80.774, 0, ''), +(10646, 2, -4828.630859, -2154.309814, 82.074, 0, ''), +(10646, 3, -4833.772949, -2149.182617, 81.676, 0, ''), +(10646, 4, -4846.418945, -2136.045410, 77.871, 0, ''), +(10646, 5, -4865.076660, -2116.549561, 76.483, 0, ''), +(10646, 6, -4888.434570, -2090.729248, 80.907, 0, ''), +(10646, 7, -4893.068359, -2085.468994, 82.094, 0, ''), +(10646, 8, -4907.256836, -2074.929932, 84.437, 5000, 'SAY_LAKO_LOOK_OUT'), +(10646, 9, -4899.899902, -2062.143555, 83.780, 0, ''), +(10646, 10, -4897.762207, -2056.520020, 84.184, 0, ''), +(10646, 11, -4888.331543, -2033.182495, 83.654, 0, ''), +(10646, 12, -4876.343750, -2003.916138, 90.887, 0, ''), +(10646, 13, -4872.227051, -1994.173340, 91.513, 0, ''), +(10646, 14, -4879.569336, -1976.985229, 92.185, 5000, 'SAY_LAKO_HERE_COME'), +(10646, 15, -4879.049316, -1964.349609, 92.001, 0, ''), +(10646, 16, -4874.720215, -1956.939819, 90.737, 0, ''), +(10646, 17, -4869.474609, -1952.612671, 89.206, 0, ''), +(10646, 18, -4842.466797, -1929.000732, 84.147, 0, ''), +(10646, 19, -4804.444824, -1897.302734, 89.362, 0, ''), +(10646, 20, -4798.072754, -1892.383545, 89.368, 0, ''), +(10646, 21, -4779.447754, -1882.759155, 90.169, 5000, 'SAY_LAKO_MORE'), +(10646, 22, -4762.081055, -1866.530640, 89.481, 0, ''), +(10646, 23, -4766.267090, -1861.867798, 87.847, 0, ''), +(10646, 24, -4782.929688, -1852.174683, 78.354, 0, ''), +(10646, 25, -4793.605469, -1850.961182, 77.658, 0, ''), +(10646, 26, -4803.323730, -1855.102661, 78.958, 0, ''), +(10646, 27, -4807.971680, -1854.501221, 77.743, 0, ''), +(10646, 28, -4837.212891, -1848.493408, 64.488, 0, ''), +(10646, 29, -4884.619629, -1840.401123, 56.219, 0, ''), +(10646, 30, -4889.705566, -1839.623291, 54.417, 0, ''), +(10646, 31, -4893.904297, -1843.685791, 53.012, 0, ''), +(10646, 32, -4903.142090, -1872.383545, 32.266, 0, ''), +(10646, 33, -4910.940918, -1879.864868, 29.940, 0, ''), +(10646, 34, -4920.047363, -1880.940796, 30.597, 0, ''), +(10646, 35, -4924.457031, -1881.447144, 29.292, 0, ''), +(10646, 36, -4966.120117, -1886.033081, 10.977, 0, ''), +(10646, 37, -4999.369629, -1890.847290, 4.430, 0, ''), +(10646, 38, -5007.271484, -1891.669678, 2.771, 0, ''), +(10646, 39, -5013.334473, -1879.588257, -1.947, 0, ''), +(10646, 40, -5023.328613, -1855.959961, -17.103, 0, ''), +(10646, 41, -5038.513184, -1825.986694, -35.821, 0, ''), +(10646, 42, -5048.733887, -1809.798218, -46.457, 0, ''), +(10646, 43, -5053.188965, -1791.682983, -57.186, 0, ''), +(10646, 44, -5062.093750, -1794.399780, -56.515, 0, ''), +(10646, 45, -5052.657227, -1797.044800, -54.734, 5000, 'SAY_LAKO_END'); diff --git a/sql/Updates/0.0.3/r1249_mangos.sql b/sql/Updates/0.0.3/r1249_mangos.sql new file mode 100644 index 0000000..9fb7425 --- /dev/null +++ b/sql/Updates/0.0.3/r1249_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_gilthares' WHERE entry=3465; diff --git a/sql/Updates/0.0.3/r1249_scriptdev2.sql b/sql/Updates/0.0.3/r1249_scriptdev2.sql new file mode 100644 index 0000000..0802b0f --- /dev/null +++ b/sql/Updates/0.0.3/r1249_scriptdev2.sql @@ -0,0 +1,70 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000380 AND -1000370; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000370,'Stay close, $n. I\'ll need all the help I can get to break out of here. Let\'s go!',0,0,1,1,'gilthares SAY_GIL_START'), +(-1000371,'At last! Free from Northwatch Hold! I need a moment to catch my breath...',0,0,1,5,'gilthares SAY_GIL_AT_LAST'), +(-1000372,'Now i feel better. Let\'s get back to Ratchet. Come on, $n.',0,0,1,23,'gilthares SAY_GIL_PROCEED'), +(-1000373,'Looks like the Southsea Freeboters are heavily entrenched on the coast. This could get rough.',0,0,1,25,'gilthares SAY_GIL_FREEBOOTERS'), +(-1000374,'Help! $C attacking!',0,0,1,0,'gilthares SAY_GIL_AGGRO_1'), +(-1000375,'$C heading this way fast! Time for revenge!',0,0,1,0,'gilthares SAY_GIL_AGGRO_2'), +(-1000376,'$C coming right at us!',0,0,1,0,'gilthares SAY_GIL_AGGRO_3'), +(-1000377,'Get this $C off of me!',0,0,1,0,'gilthares SAY_GIL_AGGRO_4'), +(-1000378,'Almost back to Ratchet! Let\'s keep up the pace...',0,0,1,0,'gilthares SAY_GIL_ALMOST'), +(-1000379,'Ah, the sweet salt air of Ratchet.',0,0,1,0,'gilthares SAY_GIL_SWEET'), +(-1000380,'Captain Brightsun, $N here has freed me! $N, i am certain the Captain will reward your bravery.',0,0,1,66,'gilthares SAY_GIL_FREED'); + +DELETE FROM script_waypoint WHERE entry=3465; +INSERT INTO script_waypoint VALUES +(3465, 0, -2095.840820, -3650.001221, 61.716, 0, ''), +(3465, 1, -2100.193604, -3613.949219, 61.604, 0, ''), +(3465, 2, -2098.549561, -3601.557129, 59.154, 0, ''), +(3465, 3, -2093.796387, -3595.234375, 56.658, 0, ''), +(3465, 4, -2072.575928, -3578.827637, 48.844, 0, ''), +(3465, 5, -2023.858398, -3568.146240, 24.636, 0, ''), +(3465, 6, -2013.576416, -3571.499756, 22.203, 0, ''), +(3465, 7, -2009.813721, -3580.547852, 21.791, 0, ''), +(3465, 8, -2015.296021, -3597.387695, 21.760, 0, ''), +(3465, 9, -2020.677368, -3610.296143, 21.759, 0, ''), +(3465, 10, -2019.990845, -3640.155273, 21.759, 0, ''), +(3465, 11, -2016.110596, -3664.133301, 21.758, 0, ''), +(3465, 12, -1999.397095, -3679.435059, 21.316, 0, ''), +(3465, 13, -1987.455811, -3688.309326, 18.495, 0, ''), +(3465, 14, -1973.966553, -3687.666748, 14.996, 0, ''), +(3465, 15, -1949.163940, -3678.054932, 11.293, 0, ''), +(3465, 16, -1934.091187, -3682.859619, 9.897, 30000, 'SAY_GIL_AT_LAST'), +(3465, 17, -1935.383911, -3682.322021, 10.029, 1500, 'SAY_GIL_PROCEED'), +(3465, 18, -1879.039185, -3699.498047, 6.582, 7500, 'SAY_GIL_FREEBOOTERS'), +(3465, 19, -1852.728149, -3703.778809, 6.875, 0, ''), +(3465, 20, -1812.989990, -3718.500732, 10.572, 0, ''), +(3465, 21, -1788.171265, -3722.867188, 9.663, 0, ''), +(3465, 22, -1767.206665, -3739.923096, 10.082, 0, ''), +(3465, 23, -1750.194580, -3747.392090, 10.390, 0, ''), +(3465, 24, -1729.335571, -3776.665527, 11.779, 0, ''), +(3465, 25, -1715.997925, -3802.404541, 12.618, 0, ''), +(3465, 26, -1690.711548, -3829.262451, 13.905, 0, ''), +(3465, 27, -1674.700684, -3842.398682, 13.872, 0, ''), +(3465, 28, -1632.726318, -3846.109619, 14.401, 0, ''), +(3465, 29, -1592.734497, -3842.225342, 14.981, 0, ''), +(3465, 30, -1561.614746, -3839.320801, 19.118, 0, ''), +(3465, 31, -1544.567627, -3834.393311, 18.761, 0, ''), +(3465, 32, -1512.514404, -3831.715820, 22.914, 0, ''), +(3465, 33, -1486.889771, -3836.639893, 23.964, 0, ''), +(3465, 34, -1434.193604, -3852.702881, 18.843, 0, ''), +(3465, 35, -1405.794678, -3854.488037, 17.276, 0, ''), +(3465, 36, -1366.592041, -3852.383789, 19.273, 0, ''), +(3465, 37, -1337.360962, -3837.827148, 17.352, 2000, 'SAY_GIL_ALMOST'), +(3465, 38, -1299.744507, -3810.691406, 20.801, 0, ''), +(3465, 39, -1277.144409, -3782.785156, 25.918, 0, ''), +(3465, 40, -1263.686768, -3781.251953, 26.447, 0, ''), +(3465, 41, -1243.674438, -3786.328125, 25.281, 0, ''), +(3465, 42, -1221.875488, -3784.124512, 24.051, 0, ''), +(3465, 43, -1204.011230, -3775.943848, 24.437, 0, ''), +(3465, 44, -1181.706787, -3768.934082, 23.368, 0, ''), +(3465, 45, -1156.913818, -3751.559326, 21.074, 0, ''), +(3465, 46, -1138.830688, -3741.809326, 17.843, 0, ''), +(3465, 47, -1080.101196, -3738.780029, 19.805, 0, 'SAY_GIL_SWEET'), +(3465, 48, -1069.065186, -3735.006348, 19.302, 0, ''), +(3465, 49, -1061.941040, -3724.062256, 21.086, 0, ''), +(3465, 50, -1053.593262, -3697.608643, 27.320, 0, ''), +(3465, 51, -1044.110474, -3690.133301, 24.856, 0, ''), +(3465, 52, -1040.260986, -3690.739014, 25.342, 0, ''), +(3465, 53, -1028.146606, -3688.718750, 23.843, 7500, 'SAY_GIL_FREED'); diff --git a/sql/Updates/0.0.3/r1250_mangos.sql b/sql/Updates/0.0.3/r1250_mangos.sql new file mode 100644 index 0000000..61479da --- /dev/null +++ b/sql/Updates/0.0.3/r1250_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_wilda' WHERE entry=21027; diff --git a/sql/Updates/0.0.3/r1250_scriptdev2.sql b/sql/Updates/0.0.3/r1250_scriptdev2.sql new file mode 100644 index 0000000..86d39d2 --- /dev/null +++ b/sql/Updates/0.0.3/r1250_scriptdev2.sql @@ -0,0 +1,66 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000390 AND -1000381; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000381,'I sense the tortured spirits, $n. They are this way, come quickly!',0,0,0,1,'wilda SAY_WIL_START'), +(-1000382,'Watch out!',0,0,0,0,'wilda SAY_WIL_AGGRO1'), +(-1000383,'Naga attackers! Defend yourself!',0,0,0,0,'wilda SAY_WIL_AGGRO2'), +(-1000384,'Grant me protection $n, i must break trough their foul magic!',0,0,0,0,'wilda SAY_WIL_PROGRESS1'), +(-1000385,'The naga of Coilskar are exceptionally cruel to their prisoners. It is a miracle that I survived inside that watery prison for as long as I did. Earthmother be praised.',0,0,0,0,'wilda SAY_WIL_PROGRESS2'), +(-1000386,'Now we must find the exit.',0,0,0,0,'wilda SAY_WIL_FIND_EXIT'), +(-1000387,'Lady Vashj must answer for these atrocities. She must be brought to justice!',0,0,0,0,'wilda SAY_WIL_PROGRESS4'), +(-1000388,'The tumultuous nature of the great waterways of Azeroth and Draenor are a direct result of tormented water spirits.',0,0,0,0,'wilda SAY_WIL_PROGRESS5'), +(-1000389,'It shouldn\'t be much further, $n. The exit is just up ahead.',0,0,0,0,'wilda SAY_WIL_JUST_AHEAD'), +(-1000390,'Thank you, $n. Please return to my brethren at the Altar of Damnation, near the Hand of Gul\'dan, and tell them that Wilda is safe. May the Earthmother watch over you...',0,0,0,0,'wilda SAY_WIL_END'); + +DELETE FROM script_waypoint WHERE entry=21027; +INSERT INTO script_waypoint VALUES +(21027, 0, -2714.697266, 1326.879395, 34.306953, 0, ''), +(21027, 1, -2666.364990, 1348.222656, 34.445557, 0, ''), +(21027, 2, -2693.789307, 1336.964966, 34.445557, 0, ''), +(21027, 3, -2715.495361, 1328.054443, 34.106014, 0, ''), +(21027, 4, -2742.530762, 1314.138550, 33.606144, 0, ''), +(21027, 5, -2745.077148, 1311.108765, 33.630898, 0, ''), +(21027, 6, -2749.855225, 1302.737915, 33.475632, 0, ''), +(21027, 7, -2753.639648, 1294.059448, 33.314930, 0, ''), +(21027, 8, -2756.796387, 1285.122192, 33.391262, 0, ''), +(21027, 9, -2750.042969, 1273.661987, 33.188259, 0, ''), +(21027, 10, -2740.378418, 1258.846680, 33.212521, 0, ''), +(21027, 11, -2733.629395, 1248.259766, 33.640598, 0, ''), +(21027, 12, -2727.212646, 1238.606445, 33.520847, 0, ''), +(21027, 13, -2726.377197, 1237.264526, 33.461823, 3000, 'SAY_WIL_PROGRESS1'), +(21027, 14, -2746.383301, 1266.390625, 33.191952, 2000, ''), +(21027, 15, -2746.383301, 1266.390625, 33.191952, 4000, 'SAY_WIL_FIND_EXIT'), +(21027, 16, -2758.927734, 1285.134155, 33.341728, 0, ''), +(21027, 17, -2761.845703, 1292.313599, 33.209042, 0, ''), +(21027, 18, -2758.871826, 1300.677612, 33.285332, 0, ''), +(21027, 19, -2753.928955, 1307.755859, 33.452457, 0, ''), +(21027, 20, -2738.612061, 1316.191284, 33.482975, 0, ''), +(21027, 21, -2727.897461, 1320.013916, 33.381111, 0, ''), +(21027, 22, -2709.458740, 1315.739990, 33.301838, 0, ''), +(21027, 23, -2704.658936, 1301.620361, 32.463303, 0, ''), +(21027, 24, -2704.120117, 1298.922607, 32.768162, 0, ''), +(21027, 25, -2691.798340, 1292.846436, 33.852642, 0, ''), +(21027, 26, -2682.879639, 1288.853882, 32.995399, 0, ''), +(21027, 27, -2661.869141, 1279.682495, 26.686783, 0, ''), +(21027, 28, -2648.943604, 1270.272827, 24.147522, 0, ''), +(21027, 29, -2642.506836, 1262.938721, 23.512444, 0, ''), +(21027, 30, -2636.984863, 1252.429077, 20.418257, 0, ''), +(21027, 31, -2648.113037, 1224.984863, 8.691818, 0, ''), +(21027, 32, -2658.393311, 1200.136719, 5.492243, 0, ''), +(21027, 33, -2668.504395, 1190.450562, 3.127407, 0, ''), +(21027, 34, -2685.930420, 1174.360840, 5.163924, 0, ''), +(21027, 35, -2701.613770, 1160.026367, 5.611311, 0, ''), +(21027, 36, -2714.659668, 1149.980347, 4.342373, 0, ''), +(21027, 37, -2721.443359, 1145.002808, 1.913474, 0, ''), +(21027, 38, -2733.962158, 1143.436279, 2.620415, 0, ''), +(21027, 39, -2757.876709, 1146.937500, 6.184002, 2000, 'SAY_WIL_JUST_AHEAD'), +(21027, 40, -2772.300537, 1166.052734, 6.331811, 0, ''), +(21027, 41, -2790.265381, 1189.941650, 5.207958, 0, ''), +(21027, 42, -2805.448975, 1208.663940, 5.557623, 0, ''), +(21027, 43, -2820.617676, 1225.870239, 6.266103, 0, ''), +(21027, 44, -2831.926758, 1237.725830, 5.808506, 0, ''), +(21027, 45, -2842.578369, 1252.869629, 6.807481, 0, ''), +(21027, 46, -2846.344971, 1258.727295, 7.386168, 0, ''), +(21027, 47, -2847.556396, 1266.771729, 8.208790, 0, ''), +(21027, 48, -2841.654541, 1285.809204, 7.933223, 0, ''), +(21027, 49, -2841.754883, 1289.832520, 6.990304, 0, ''), +(21027, 50, -2871.398438, 1302.348145, 6.807335, 7500, 'SAY_WIL_END'); diff --git a/sql/Updates/0.0.3/r1251_scriptdev2.sql b/sql/Updates/0.0.3/r1251_scriptdev2.sql new file mode 100644 index 0000000..865f1af --- /dev/null +++ b/sql/Updates/0.0.3/r1251_scriptdev2.sql @@ -0,0 +1,11 @@ +DELETE FROM script_waypoint WHERE entry=18731; +INSERT INTO script_waypoint VALUES +(18731, 0, -157.366, 2.177, 8.073, 0, ''), +(18731, 1, -172.266, -18.280, 8.073, 0, ''), +(18731, 2, -171.051, -38.748, 8.073, 0, ''), +(18731, 3, -170.718, -59.436, 8.073, 0, ''), +(18731, 4, -156.659, -72.118, 8.073, 0, ''), +(18731, 5, -142.292, -59.423, 8.073, 0, ''), +(18731, 6, -141.779, -38.972, 8.073, 0, ''), +(18731, 7, -142.922, -18.950, 8.073, 0, ''), +(18731, 8, -157.366, 2.177, 8.073, 0, ''); diff --git a/sql/Updates/0.0.3/r1257_scriptdev2.sql b/sql/Updates/0.0.3/r1257_scriptdev2.sql new file mode 100644 index 0000000..a42a401 --- /dev/null +++ b/sql/Updates/0.0.3/r1257_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_waypoint WHERE entry=2768 AND pointid IN (0, 18); +INSERT INTO script_waypoint VALUES +(2768, 0, -2077.73, -2091.17, 9.49, 0, ''), +(2768, 18, -2077.73, -2091.17, 9.49, 0, ''); diff --git a/sql/Updates/0.0.3/r1258_mangos.sql b/sql/Updates/0.0.3/r1258_mangos.sql new file mode 100644 index 0000000..bababd8 --- /dev/null +++ b/sql/Updates/0.0.3/r1258_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_tooga' WHERE entry=5955; diff --git a/sql/Updates/0.0.3/r1258_scriptdev2.sql b/sql/Updates/0.0.3/r1258_scriptdev2.sql new file mode 100644 index 0000000..79d61e2 --- /dev/null +++ b/sql/Updates/0.0.3/r1258_scriptdev2.sql @@ -0,0 +1,10 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000398 AND -1000391; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000391,'I\'m Thirsty.',0,0,0,0,'tooga SAY_TOOG_THIRST'), +(-1000392,'Torta must be so worried.',0,0,0,0,'tooga SAY_TOOG_WORRIED'), +(-1000393,'Torta, my love! I have returned at long last.',0,0,0,0,'tooga SAY_TOOG_POST_1'), +(-1000394,'You have any idea how long I\'ve been waiting here? And where\'s dinner? All that time gone and nothing to show for it?',0,0,0,0,'tooga SAY_TORT_POST_2'), +(-1000395,'My dearest Torta. I have been gone for so long. Finally we are reunited. At long last our love can blossom again.',0,0,0,0,'tooga SAY_TOOG_POST_3'), +(-1000396,'Enough with the rambling. I am starving! Now, get your dusty shell into that ocean and bring momma some grub.',0,0,0,0,'tooga SAY_TORT_POST_4'), +(-1000397,'Yes Torta. Whatever your heart desires...',0,0,0,0,'tooga SAY_TOOG_POST_5'), +(-1000398,'And try not to get lost this time...',0,0,0,0,'tooga SAY_TORT_POST_6'); diff --git a/sql/Updates/0.0.3/r1260_scriptdev2.sql b/sql/Updates/0.0.3/r1260_scriptdev2.sql new file mode 100644 index 0000000..73f8588 --- /dev/null +++ b/sql/Updates/0.0.3/r1260_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000402 AND -1000399; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000399,'Peace is but a fleeting dream! Let the NIGHTMARE reign!',0,1,0,0,'taerar SAY_AGGRO'), +(-1000400,'Children of Madness - I release you upon this world!',0,1,0,0,'taerar SAY_SUMMONSHADE'), +(-1000401,'Hope is a DISEASE of the soul! This land shall wither and die!',0,1,0,0,'emeriss SAY_AGGRO'), +(-1000402,'Taste your world\'s corruption!',0,1,0,0,'emeriss SAY_CASTCORRUPTION'); diff --git a/sql/Updates/0.0.3/r1261_mangos.sql b/sql/Updates/0.0.3/r1261_mangos.sql new file mode 100644 index 0000000..75de0e6 --- /dev/null +++ b/sql/Updates/0.0.3/r1261_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_shadowforge_brazier' WHERE entry IN (174744, 174745); diff --git a/sql/Updates/0.0.3/r1263_mangos.sql b/sql/Updates/0.0.3/r1263_mangos.sql new file mode 100644 index 0000000..f1fe028 --- /dev/null +++ b/sql/Updates/0.0.3/r1263_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE entry IN (9034, 9035, 9036, 9038, 9040); diff --git a/sql/Updates/0.0.3/r1265_mangos.sql b/sql/Updates/0.0.3/r1265_mangos.sql new file mode 100644 index 0000000..e6c0bc8 --- /dev/null +++ b/sql/Updates/0.0.3/r1265_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_rinji' WHERE entry=7780; diff --git a/sql/Updates/0.0.3/r1265_scriptdev2.sql b/sql/Updates/0.0.3/r1265_scriptdev2.sql new file mode 100644 index 0000000..d843211 --- /dev/null +++ b/sql/Updates/0.0.3/r1265_scriptdev2.sql @@ -0,0 +1,36 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000409 AND -1000403; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000403,'Rin\'ji is free!',0,0,0,0,'SAY_RIN_FREE'), +(-1000404,'Attack my sisters! The troll must not escape!',0,0,0,0,'SAY_RIN_BY_OUTRUNNER'), +(-1000405,'Rin\'ji needs help!',0,0,1,0,'SAY_RIN_HELP_1'), +(-1000406,'Rin\'ji is being attacked!',0,0,1,0,'SAY_RIN_HELP_2'), +(-1000407,'Rin\'ji can see road now, $n. Rin\'ji knows the way home.',0,0,1,0,'SAY_RIN_COMPLETE'), +(-1000408,'Rin\'ji will tell you secret now... $n, should go to the Overlook Cliffs. Rin\'ji hid something on island there',0,0,1,0,'SAY_RIN_PROGRESS_1'), +(-1000409,'You find it, you keep it! Don\'t tell no one that Rin\'ji talked to you!',0,0,1,0,'SAY_RIN_PROGRESS_2'); + +DELETE FROM script_waypoint WHERE entry=7780; +INSERT INTO script_waypoint VALUES +(7780, 0, 261.058868, -2757.876221, 122.553, 0, ''), +(7780, 1, 259.812195, -2758.249023, 122.555, 0, 'SAY_RIN_FREE'), +(7780, 2, 253.823441, -2758.619141, 122.562, 0, ''), +(7780, 3, 241.394791, -2769.754883, 123.309, 0, ''), +(7780, 4, 218.915588, -2783.397461, 123.355, 0, ''), +(7780, 5, 209.088196, -2789.676270, 122.001, 0, ''), +(7780, 6, 204.453568, -2792.205811, 120.620, 0, ''), +(7780, 7, 182.012604, -2809.995361, 113.887, 0, 'summon'), +(7780, 8, 164.411591, -2825.162842, 107.779, 0, ''), +(7780, 9, 149.727600, -2833.704346, 106.224, 0, ''), +(7780, 10, 142.448074, -2838.807373, 109.665, 0, ''), +(7780, 11, 133.274963, -2845.135254, 112.606, 0, ''), +(7780, 12, 111.247459, -2861.065674, 116.305, 0, ''), +(7780, 13, 96.104073, -2874.886230, 114.397, 0, 'summon'), +(7780, 14, 73.369942, -2881.184570, 117.666, 0, ''), +(7780, 15, 58.579178, -2889.151611, 116.253, 0, ''), +(7780, 16, 33.214249, -2906.343994, 115.083, 0, ''), +(7780, 17, 19.586519, -2908.712402, 117.276, 7500, 'SAY_RIN_COMPLETE'), +(7780, 18, 10.282522, -2911.607422, 118.394, 0, ''), +(7780, 19, -37.580383, -2942.730225, 117.145, 0, ''), +(7780, 20, -68.599411, -2953.694824, 116.685, 0, ''), +(7780, 21, -102.054253, -2956.965576, 116.677, 0, ''), +(7780, 22, -135.993637, -2955.743652, 115.788, 0, ''), +(7780, 23, -171.561600, -2951.417480, 115.451, 0, ''); diff --git a/sql/Updates/0.0.3/r1266_mangos.sql b/sql/Updates/0.0.3/r1266_mangos.sql new file mode 100644 index 0000000..56e757c --- /dev/null +++ b/sql/Updates/0.0.3/r1266_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kanati' WHERE entry=10638; diff --git a/sql/Updates/0.0.3/r1266_scriptdev2.sql b/sql/Updates/0.0.3/r1266_scriptdev2.sql new file mode 100644 index 0000000..3c8b2fb --- /dev/null +++ b/sql/Updates/0.0.3/r1266_scriptdev2.sql @@ -0,0 +1,8 @@ +DELETE FROM script_texts WHERE entry=-1000410; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000410,'Here they come! Defend yourself!',0,0,1,5,'kanati SAY_KAN_START'); + +DELETE FROM script_waypoint WHERE entry=10638; +INSERT INTO script_waypoint VALUES +(10638, 0, -4903.521973, -1368.339844, -52.611, 5000, 'SAY_KAN_START'), +(10638, 1, -4906.004395, -1367.048096, -52.611, 0, ''); diff --git a/sql/Updates/0.0.3/r1280_mangos.sql b/sql/Updates/0.0.3/r1280_mangos.sql new file mode 100644 index 0000000..e28442d --- /dev/null +++ b/sql/Updates/0.0.3/r1280_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_private_hendel' WHERE entry=4966; diff --git a/sql/Updates/0.0.3/r1280_scriptdev2.sql b/sql/Updates/0.0.3/r1280_scriptdev2.sql new file mode 100644 index 0000000..fc519ac --- /dev/null +++ b/sql/Updates/0.0.3/r1280_scriptdev2.sql @@ -0,0 +1,7 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000415 AND -1000411; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000411,'Why don\'t we deal with you now, Hendel? Lady Proudmoore will speak for you back in the tower.',0,0,7,0,'hendel SAY_PROGRESS_1_TER'), +(-1000412,'Please... please... Miss Proudmore. I didn\'t mean to...',0,0,7,0,'hendel SAY_PROGRESS_2_HEN'), +(-1000413,'I apologize for taking so long to get here. I wanted Lady Proudmoore to be present also.',0,0,7,0,'hendel SAY_PROGRESS_3_TER'), +(-1000414,'We can only stay a few moments before returning to the tower. If you wish to speak to us more you may find us there.',0,0,7,0,'hendel SAY_PROGRESS_4_TER'), +(-1000415,'%s, too injured, gives up the chase.',0,2,0,0,'hendel EMOTE_SURRENDER'); diff --git a/sql/Updates/0.0.3/r1281_mangos.sql b/sql/Updates/0.0.3/r1281_mangos.sql new file mode 100644 index 0000000..48fb3fa --- /dev/null +++ b/sql/Updates/0.0.3/r1281_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_orsonn_and_kodian' WHERE entry IN (27274, 27275); diff --git a/sql/Updates/0.0.3/r1282_mangos.sql b/sql/Updates/0.0.3/r1282_mangos.sql new file mode 100644 index 0000000..e1d3d44 --- /dev/null +++ b/sql/Updates/0.0.3/r1282_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_fizzcrank_fullthrottle' WHERE entry=25590; diff --git a/sql/Updates/0.0.3/r1283_mangos.sql b/sql/Updates/0.0.3/r1283_mangos.sql new file mode 100644 index 0000000..cd05151 --- /dev/null +++ b/sql/Updates/0.0.3/r1283_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_arete' WHERE entry=29344; diff --git a/sql/Updates/0.0.3/r1299_scriptdev2.sql b/sql/Updates/0.0.3/r1299_scriptdev2.sql new file mode 100644 index 0000000..f1b4aeb --- /dev/null +++ b/sql/Updates/0.0.3/r1299_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE script_texts SET comment='core rager EMOTE_LOWHP' WHERE entry=-1409002; diff --git a/sql/Updates/0.0.3/r1300_mangos.sql b/sql/Updates/0.0.3/r1300_mangos.sql new file mode 100644 index 0000000..a024d20 --- /dev/null +++ b/sql/Updates/0.0.3/r1300_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_naladu' WHERE entry=19361; diff --git a/sql/Updates/0.0.3/r1307_mangos.sql b/sql/Updates/0.0.3/r1307_mangos.sql new file mode 100644 index 0000000..2aabff1 --- /dev/null +++ b/sql/Updates/0.0.3/r1307_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_tracy_proudwell' WHERE entry=18266; diff --git a/sql/Updates/0.0.3/r1317_mangos.sql b/sql/Updates/0.0.3/r1317_mangos.sql new file mode 100644 index 0000000..a21ac52 --- /dev/null +++ b/sql/Updates/0.0.3/r1317_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; diff --git a/sql/Updates/0.0.3/r1317_scriptdev2.sql b/sql/Updates/0.0.3/r1317_scriptdev2.sql new file mode 100644 index 0000000..ddb10d8 --- /dev/null +++ b/sql/Updates/0.0.3/r1317_scriptdev2.sql @@ -0,0 +1,9 @@ +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); diff --git a/sql/Updates/0.0.3/r1321_mangos.sql b/sql/Updates/0.0.3/r1321_mangos.sql new file mode 100644 index 0000000..f9caee0 --- /dev/null +++ b/sql/Updates/0.0.3/r1321_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_00x09hl' WHERE entry=7806; diff --git a/sql/Updates/0.0.3/r1321_scriptdev2.sql b/sql/Updates/0.0.3/r1321_scriptdev2.sql new file mode 100644 index 0000000..c4a140d --- /dev/null +++ b/sql/Updates/0.0.3/r1321_scriptdev2.sql @@ -0,0 +1,74 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000419 AND -1000416; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000416,'Emergency power activated! Initializing ambulatory motor! CLUCK!',0,0,0,0,'oox09 SAY_OOX_START'), +(-1000417,'Threat analyzed! Activating combat plan beta! CLUCK!',0,0,0,0,'oox09 SAY_OOX_AGGRO'), +(-1000418,'CLUCK! Sensors detect spatial anomaly -- danger imminent! CLUCK!',0,0,0,0,'oox09 SAY_OOX_DANGER'), +(-1000419,'Cloaking systems online! CLUCK! Engaging cloak for transport to Booty Bay!',0,0,0,0,'oox09 SAY_OOX_COMPLETE'); + +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); diff --git a/sql/Updates/0.0.3/r1322_scriptdev2.sql b/sql/Updates/0.0.3/r1322_scriptdev2.sql new file mode 100644 index 0000000..7cb360f --- /dev/null +++ b/sql/Updates/0.0.3/r1322_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8273+) '; diff --git a/sql/Updates/0.0.3/r1326_scriptdev2.sql b/sql/Updates/0.0.3/r1326_scriptdev2.sql new file mode 100644 index 0000000..1077a1d --- /dev/null +++ b/sql/Updates/0.0.3/r1326_scriptdev2.sql @@ -0,0 +1,27 @@ +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1105.090332, -3101.254150, 82.706, 1000, 'SAY_STARTUP1'), +(3439, 1, 1103.204468, -3104.345215, 83.113, 1000, ''), +(3439, 2, 1107.815186, -3106.495361, 82.739, 1000, ''), +(3439, 3, 1104.733276, -3100.830811, 82.747, 1000, ''), +(3439, 4, 1103.242554, -3106.270020, 83.133, 1000, ''), +(3439, 5, 1112.807373, -3106.285400, 82.320, 1000, ''), +(3439, 6, 1112.826782, -3108.908691, 82.377, 1000, ''), +(3439, 7, 1108.053955, -3115.156738, 82.894, 0, ''), +(3439, 8, 1108.355591, -3104.365234, 82.377, 5000, ''), +(3439, 9, 1100.306763, -3097.539063, 83.150, 0, 'SAY_STARTUP2'), +(3439, 10, 1100.562378, -3082.721924, 82.768, 0, ''), +(3439, 11, 1097.512939, -3069.226563, 82.206, 0, ''), +(3439, 12, 1092.964966, -3053.114746, 82.351, 0, ''), +(3439, 13, 1094.010986, -3036.958496, 82.888, 0, ''), +(3439, 14, 1095.623901, -3025.760254, 83.392, 0, ''), +(3439, 15, 1107.656494, -3013.530518, 85.653, 0, ''), +(3439, 16, 1119.647705, -3006.928223, 87.019, 0, ''), +(3439, 17, 1129.991211, -3002.410645, 91.232, 7000, 'SAY_MERCENARY'), +(3439, 18, 1133.328735, -2997.710693, 91.675, 1000, 'SAY_PROGRESS_1'), +(3439, 19, 1131.799316, -2987.948242, 91.976, 1000, ''), +(3439, 20, 1122.028687, -2993.397461, 91.536, 0, ''), +(3439, 21, 1116.614868, -2981.916748, 92.103, 0, ''), +(3439, 22, 1102.239136, -2994.245117, 92.074, 0, ''), +(3439, 23, 1096.366211, -2978.306885, 91.873, 0, ''), +(3439, 24, 1091.971558, -2985.919189, 91.730, 40000, 'SAY_PROGRESS_2'); diff --git a/sql/Updates/0.0.3/r1333_mangos.sql b/sql/Updates/0.0.3/r1333_mangos.sql new file mode 100644 index 0000000..864927f --- /dev/null +++ b/sql/Updates/0.0.3/r1333_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=24666; +UPDATE creature_template SET ScriptName='' WHERE entry=21369; diff --git a/sql/Updates/0.0.3/r1334_mangos.sql b/sql/Updates/0.0.3/r1334_mangos.sql new file mode 100644 index 0000000..c05d4ff --- /dev/null +++ b/sql/Updates/0.0.3/r1334_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_trollbane' WHERE entry=16819; +UPDATE creature_template SET ScriptName='npc_timothy_daniels' WHERE entry=18019; diff --git a/sql/Updates/0.0.3/r1335_scriptdev2.sql b/sql/Updates/0.0.3/r1335_scriptdev2.sql new file mode 100644 index 0000000..b6c13c0 --- /dev/null +++ b/sql/Updates/0.0.3/r1335_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1230003; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1230003,'You have challenged the Seven, and now you will die!',0,0,0,0,'doomrel SAY_DOOMREL_START_EVENT'); diff --git a/sql/Updates/0.0.3/r1336_mangos.sql b/sql/Updates/0.0.3/r1336_mangos.sql new file mode 100644 index 0000000..0a13e5b --- /dev/null +++ b/sql/Updates/0.0.3/r1336_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_vekjik' WHERE entry=28315; diff --git a/sql/Updates/0.0.3/r1336_scriptdev2.sql b/sql/Updates/0.0.3/r1336_scriptdev2.sql new file mode 100644 index 0000000..c765c0a --- /dev/null +++ b/sql/Updates/0.0.3/r1336_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE script_texts SET content_default='Frenzyheart kill you if you come back. You no welcome here no more!', comment='vekjik SAY_TEXTID_VEKJIK1' WHERE entry=-1000208; diff --git a/sql/Updates/0.0.3/r1341_scriptdev2.sql b/sql/Updates/0.0.3/r1341_scriptdev2.sql new file mode 100644 index 0000000..88bbe7e --- /dev/null +++ b/sql/Updates/0.0.3/r1341_scriptdev2.sql @@ -0,0 +1,11 @@ +UPDATE script_texts SET content_default='Emergency power activated! Initializing ambulanory motor! CLUCK!' WHERE entry = -1000287; +UPDATE script_texts SET comment='oox SAY_OOX_START' WHERE entry = -1000287; +UPDATE script_texts SET comment='oox SAY_OOX_AGGRO1' WHERE entry = -1000288; +UPDATE script_texts SET comment='oox SAY_OOX_AGGRO2' WHERE entry = -1000289; +UPDATE script_texts SET comment='oox SAY_OOX_AMBUSH' WHERE entry = -1000290; +UPDATE script_texts SET comment='oox SAY_OOX17_AMBUSH_REPLY' WHERE entry = -1000291; +UPDATE script_texts SET comment='oox SAY_OOX_END' WHERE entry = -1000292; +UPDATE script_texts SET content_default='REUSE', comment='REUSE' WHERE entry = -1000416; +UPDATE script_texts SET content_default='REUSE', comment='REUSE' WHERE entry = -1000417; +UPDATE script_texts SET content_default='REUSE', comment='REUSE' WHERE entry = -1000418; +UPDATE script_texts SET content_default='REUSE', comment='REUSE' WHERE entry = -1000419; diff --git a/sql/Updates/0.0.3/r1351_mangos.sql b/sql/Updates/0.0.3/r1351_mangos.sql new file mode 100644 index 0000000..e868b5c --- /dev/null +++ b/sql/Updates/0.0.3/r1351_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_ringo' WHERE entry=9999; diff --git a/sql/Updates/0.0.3/r1351_scriptdev2.sql b/sql/Updates/0.0.3/r1351_scriptdev2.sql new file mode 100644 index 0000000..46bc760 --- /dev/null +++ b/sql/Updates/0.0.3/r1351_scriptdev2.sql @@ -0,0 +1,21 @@ +UPDATE script_texts SET content_default='Well, I\'m not sure how far I\'ll make it in this state... I\'m feeling kind of faint...', comment='ringo SAY_RIN_START_1' WHERE entry=-1000416; +UPDATE script_texts SET content_default='Remember, if I faint again, the water that Spraggle gave you will revive me.', comment='ringo SAY_RIN_START_2' WHERE entry=-1000417; +UPDATE script_texts SET content_default='The heat... I can\'t take it...', comment='ringo SAY_FAINT_1' WHERE entry=-1000418; +UPDATE script_texts SET content_default='Maybe... you could carry me?', comment='ringo SAY_FAINT_2' WHERE entry=-1000419; + +DELETE FROM script_texts WHERE entry BETWEEN -1000433 AND -1000420; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000420,'Uuuuuuggggghhhhh....',0,0,0,0,'ringo SAY_FAINT_3'), +(-1000421,'I\'m not feeling so well...',0,0,0,0,'ringo SAY_FAINT_4'), +(-1000422,'Where... Where am I?',0,0,0,0,'ringo SAY_WAKE_1'), +(-1000423,'I am feeling a little better now, thank you.',0,0,0,0,'ringo SAY_WAKE_2'), +(-1000424,'Yes, I must go on.',0,0,0,0,'ringo SAY_WAKE_3'), +(-1000425,'How am I feeling? Quite soaked, thank you.',0,0,0,0,'ringo SAY_WAKE_4'), +(-1000426,'Spraggle! I didn\'t think I\'d make it back!',0,0,0,0,'ringo SAY_RIN_END_1'), +(-1000427,'Ringo! You\'re okay!',0,0,0,0,'ringo SAY_SPR_END_2'), +(-1000428,'Oh... I\'m feeling faint...',0,0,0,0,'ringo SAY_RIN_END_3'), +(-1000429,'%s collapses onto the ground.',0,2,0,0,'ringo EMOTE_RIN_END_4'), +(-1000430,'%s stands up after a short pause.',0,2,0,0,'ringo EMOTE_RIN_END_5'), +(-1000431,'Ugh.',0,0,0,0,'ringo SAY_RIN_END_6'), +(-1000432,'Ringo? Wake up! Don\'t worry, I\'ll take care of you.',0,0,0,0,'ringo SAY_SPR_END_7'), +(-1000433,'%s fades away after a long pause.',0,2,0,0,'ringo EMOTE_RIN_END_8'); diff --git a/sql/Updates/0.0.3/r1352_mangos.sql b/sql/Updates/0.0.3/r1352_mangos.sql new file mode 100644 index 0000000..8b196a5 --- /dev/null +++ b/sql/Updates/0.0.3/r1352_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kerlonian' WHERE entry=11218; diff --git a/sql/Updates/0.0.3/r1352_scriptdev2.sql b/sql/Updates/0.0.3/r1352_scriptdev2.sql new file mode 100644 index 0000000..9670f1a --- /dev/null +++ b/sql/Updates/0.0.3/r1352_scriptdev2.sql @@ -0,0 +1,13 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000444 AND -1000434; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000434,'Liladris has been waiting for me at Maestra\'s Post, so we should make haste, $N.',0,0,0,0,'kerlonian SAY_KER_START'), +(-1000435,'%s looks very sleepy...',0,2,0,0,'kerlonian EMOTE_KER_SLEEP_1'), +(-1000436,'%s suddenly falls asleep',0,2,0,0,'kerlonian EMOTE_KER_SLEEP_2'), +(-1000437,'%s begins to drift off...',0,2,0,0,'kerlonian EMOTE_KER_SLEEP_3'), +(-1000438,'This looks like the perfect place for a nap...',0,0,0,0,'kerlonian SAY_KER_SLEEP_1'), +(-1000439,'Yaaaaawwwwwnnnn...',0,0,0,0,'kerlonian SAY_KER_SLEEP_2'), +(-1000440,'Oh, I am so tired...',0,0,0,0,'kerlonian SAY_KER_SLEEP_3'), +(-1000441,'You don\'t mind if I stop here for a moment, do you?',0,0,0,0,'kerlonian SAY_KER_SLEEP_4'), +(-1000442,'Be on the alert! The Blackwood furbolgs are numerous in the area...',0,0,0,0,'kerlonian SAY_KER_ALERT_1'), +(-1000443,'It\'s quiet... Too quiet...',0,0,0,0,'kerlonian SAY_KER_ALERT_2'), +(-1000444,'Oh, I can see Liladris from here... Tell her I\'m here, won\'t you?',0,0,0,0,'kerlonian SAY_KER_END'); diff --git a/sql/Updates/0.0.3/r1354_scriptdev2.sql b/sql/Updates/0.0.3/r1354_scriptdev2.sql new file mode 100644 index 0000000..67f7bb3 --- /dev/null +++ b/sql/Updates/0.0.3/r1354_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1000445; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000445,'%s wakes up!',0,2,0,0,'kerlonian EMOTE_KER_AWAKEN'); diff --git a/sql/Updates/0.0.3/r1358_mangos.sql b/sql/Updates/0.0.3/r1358_mangos.sql new file mode 100644 index 0000000..0598d52 --- /dev/null +++ b/sql/Updates/0.0.3/r1358_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kara_thricestar' WHERE entry=26602; diff --git a/sql/Updates/0.0.3/r1359_mangos.sql b/sql/Updates/0.0.3/r1359_mangos.sql new file mode 100644 index 0000000..247dc4f --- /dev/null +++ b/sql/Updates/0.0.3/r1359_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_ame01' WHERE entry=9623; diff --git a/sql/Updates/0.0.3/r1359_scriptdev2.sql b/sql/Updates/0.0.3/r1359_scriptdev2.sql new file mode 100644 index 0000000..4d98c9a --- /dev/null +++ b/sql/Updates/0.0.3/r1359_scriptdev2.sql @@ -0,0 +1,51 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000451 AND -1000446; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000446,'A-Me good. Good, A-Me. Follow... follow A-Me. Home. A-Me go home.',0,0,0,0,'ame01 SAY_AME_START'), +(-1000447,'Good... good, A-Me. A-Me good. Home. Find home.',0,0,0,0,'ame01 SAY_AME_PROGRESS'), +(-1000448,'A-Me home! A-Me good! Good A-Me. Home. Home. Home.',0,0,0,0,'ame01 SAY_AME_END'), +(-1000449,'$c, no hurt A-Me. A-Me good.',0,0,0,0,'ame01 SAY_AME_AGGRO1'), +(-1000450,'Danger. Danger! $c try hurt A-Me.',0,0,0,0,'ame01 SAY_AME_AGGRO2'), +(-1000451,'Bad, $c. $c, bad!',0,0,0,0,'ame01 SAY_AME_AGGRO3'); + +DELETE FROM script_waypoint WHERE entry=9623; +INSERT INTO script_waypoint VALUES +(9623, 0, -6383.070801, -1964.368896, -258.709, 0, 'SAY_AME_START'), +(9623, 1, -6393.649414, -1949.572266, -261.449, 0, ''), +(9623, 2, -6397.846680, -1931.099609, -263.366, 0, ''), +(9623, 3, -6397.501953, -1921.470703, -263.876, 0, ''), +(9623, 4, -6389.630371, -1909.995361, -259.601, 0, ''), +(9623, 5, -6380.065430, -1905.452881, -255.858, 0, ''), +(9623, 6, -6373.437988, -1900.275024, -254.774, 0, ''), +(9623, 7, -6372.868652, -1893.500854, -255.678, 0, ''), +(9623, 8, -6379.730469, -1877.627808, -259.654, 0, ''), +(9623, 9, -6380.264160, -1871.139648, -260.617, 0, ''), +(9623, 10, -6373.830566, -1855.620361, -259.566, 0, ''), +(9623, 11, -6368.824707, -1847.770508, -259.246, 0, ''), +(9623, 12, -6370.902832, -1835.038940, -260.212, 0, ''), +(9623, 13, -6376.591309, -1821.592285, -260.856, 0, ''), +(9623, 14, -6381.931152, -1810.434326, -266.180, 0, ''), +(9623, 15, -6396.713867, -1807.123535, -269.329, 0, ''), +(9623, 16, -6400.266602, -1795.053589, -269.744, 0, ''), +(9623, 17, -6402.675781, -1747.514648, -272.961, 0, ''), +(9623, 18, -6396.997559, -1710.052979, -273.719, 0, ''), +(9623, 19, -6388.105957, -1676.328125, -272.133, 5000, 'SAY_AME_PROGRESS'), +(9623, 20, -6370.711914, -1638.638306, -272.031, 0, ''), +(9623, 21, -6366.709473, -1592.645996, -272.201, 0, ''), +(9623, 22, -6333.869629, -1534.598755, -270.493, 0, ''), +(9623, 23, -6305.362305, -1477.913330, -269.518, 0, ''), +(9623, 24, -6311.588867, -1419.017456, -267.622, 0, ''), +(9623, 25, -6330.014648, -1400.064331, -266.425, 0, ''), +(9623, 26, -6356.021973, -1392.607422, -267.123, 0, ''), +(9623, 27, -6370.859375, -1386.179321, -270.218, 0, ''), +(9623, 28, -6381.529785, -1369.780273, -272.110, 0, ''), +(9623, 29, -6405.381348, -1321.522827, -271.699, 0, ''), +(9623, 30, -6406.583496, -1307.574585, -271.802, 0, ''), +(9623, 31, -6386.325684, -1286.851074, -272.074, 0, ''), +(9623, 32, -6364.254883, -1264.706299, -269.075, 0, ''), +(9623, 33, -6343.636230, -1239.844360, -268.364, 0, ''), +(9623, 34, -6335.568848, -1202.449585, -271.515, 0, ''), +(9623, 35, -6325.625000, -1184.455322, -270.461, 0, ''), +(9623, 36, -6317.797363, -1177.668091, -269.792, 0, ''), +(9623, 37, -6303.024414, -1180.252686, -269.332, 0, 'SAY_AME_END'), +(9623, 38, -6301.975098, -1184.787842, -269.371, 1000, ''), +(9623, 39, -6297.575684, -1186.412964, -268.962, 5000, ''); diff --git a/sql/Updates/0.0.3/r1367_mangos.sql b/sql/Updates/0.0.3/r1367_mangos.sql new file mode 100644 index 0000000..2e28ca0 --- /dev/null +++ b/sql/Updates/0.0.3/r1367_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_iruk' WHERE entry=26219; diff --git a/sql/Updates/0.0.3/r1368_mangos.sql b/sql/Updates/0.0.3/r1368_mangos.sql new file mode 100644 index 0000000..a56a358 --- /dev/null +++ b/sql/Updates/0.0.3/r1368_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_roxi_ramrocket' WHERE entry=31247; diff --git a/sql/Updates/0.0.3/r1369_mangos.sql b/sql/Updates/0.0.3/r1369_mangos.sql new file mode 100644 index 0000000..a861af6 --- /dev/null +++ b/sql/Updates/0.0.3/r1369_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_zidormi' WHERE entry=31848; diff --git a/sql/Updates/0.0.3/r1370_mangos.sql b/sql/Updates/0.0.3/r1370_mangos.sql new file mode 100644 index 0000000..ae3b804 --- /dev/null +++ b/sql/Updates/0.0.3/r1370_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_demoniac_scryer' WHERE entry=22258; diff --git a/sql/Updates/0.0.3/r1371_scriptdev2.sql b/sql/Updates/0.0.3/r1371_scriptdev2.sql new file mode 100644 index 0000000..e6c8efe --- /dev/null +++ b/sql/Updates/0.0.3/r1371_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8422+) '; diff --git a/sql/Updates/0.0.3/r1374_mangos.sql b/sql/Updates/0.0.3/r1374_mangos.sql new file mode 100644 index 0000000..0eb0faa --- /dev/null +++ b/sql/Updates/0.0.3/r1374_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_ogron' WHERE entry=4983; diff --git a/sql/Updates/0.0.3/r1374_scriptdev2.sql b/sql/Updates/0.0.3/r1374_scriptdev2.sql new file mode 100644 index 0000000..39070c7 --- /dev/null +++ b/sql/Updates/0.0.3/r1374_scriptdev2.sql @@ -0,0 +1,48 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000471 AND -1000452; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000452,'I noticed some fire on that island over there. A human, too. Let\'s go check it out, $n.',0,0,1,0,'ogron SAY_OGR_START'), +(-1000453,'That\'s Reethe alright. Let\'s go see what he has to say, yeah?',0,0,1,1,'ogron SAY_OGR_SPOT'), +(-1000454,'W-what do you want? Just leave me alone...',0,0,0,6,'ogron SAY_OGR_RET_WHAT'), +(-1000455,'I swear. I didn\'t steal anything from you! Here, take some of my supplies, just go away!',0,0,0,27,'ogron SAY_OGR_RET_SWEAR'), +(-1000456,'Just tell us what you know about the Shady Rest Inn, and I won\'t bash your skull in.',0,0,1,0,'ogron SAY_OGR_REPLY_RET'), +(-1000457,'I... Well, I may of taken a little thing or two from the inn... but what would an ogre care about that?',0,0,0,6,'ogron SAY_OGR_RET_TAKEN'), +(-1000458,'Look here, if you don\'t tell me about the fire--',0,0,1,0,'ogron SAY_OGR_TELL_FIRE'), +(-1000459,'Not one step closer, ogre!',0,0,0,27,'ogron SAY_OGR_RET_NOCLOSER'), +(-1000460,'And I don\'t know anything about this fire of yours...',0,0,0,0,'ogron SAY_OGR_RET_NOFIRE'), +(-1000461,'What was that? Did you hear something?',0,0,0,0,'ogron SAY_OGR_RET_HEAR'), +(-1000462,'Paval Reethe! Found you at last. And consorting with ogres now? No fear, even deserters and traitors are afforded some mercy.',0,0,0,0,'ogron SAY_OGR_CAL_FOUND'), +(-1000463,'Private, show Lieutenant Reethe some mercy.',0,0,0,29,'ogron SAY_OGR_CAL_MERCY'), +(-1000464,'Gladly, sir.',0,0,0,0,'ogron SAY_OGR_HALL_GLAD'), +(-1000465,'%s staggers backwards as the arrow lodges itself deeply in his chest.',0,2,0,0,'ogron EMOTE_OGR_RET_ARROW'), +(-1000466,'Ugh... Hallan, didn\'t think you had it in you...',0,0,0,34,'ogron SAY_OGR_RET_ARROW'), +(-1000467,'Now, let\'s clean up the rest of the trash, men!',0,0,0,0,'ogron SAY_OGR_CAL_CLEANUP'), +(-1000468,'Damn it! You\'d better not die on me, human!',0,0,1,0,'ogron SAY_OGR_NODIE'), +(-1000469,'Still with us, Reethe?',0,0,1,0,'ogron SAY_OGR_SURVIVE'), +(-1000470,'Must be your lucky day. Alright, I\'ll talk. Just leave me alone. Look, you\'re not going to believe me, but it wa... oh, Light, looks like the girl could shoot...',0,0,0,0,'ogron SAY_OGR_RET_LUCKY'), +(-1000471,'By the way, thanks for watching my back.',0,0,1,0,'ogron SAY_OGR_THANKS'); + +DELETE FROM script_waypoint WHERE entry=4983; +INSERT INTO script_waypoint VALUES +(4983, 0, -3322.649414, -3124.631836, 33.842, 0, ''), +(4983, 1, -3326.336670, -3126.833496, 34.426, 0, ''), +(4983, 2, -3336.984131, -3129.611816, 30.692, 0, ''), +(4983, 3, -3342.598389, -3132.146729, 30.422, 0, ''), +(4983, 4, -3355.827881, -3140.947998, 29.534, 0, ''), +(4983, 5, -3365.828125, -3144.284180, 35.176, 0, ''), +(4983, 6, -3368.904541, -3147.265381, 36.091, 0, ''), +(4983, 7, -3369.355957, -3169.828857, 36.325, 0, ''), +(4983, 8, -3371.443359, -3183.905029, 33.454, 0, ''), +(4983, 9, -3373.824951, -3190.861084, 34.717, 5000, 'SAY_OGR_SPOT'), +(4983, 10, -3368.529785, -3198.210205, 34.926, 0, 'SAY_OGR_RET_WHAT'), +(4983, 11, -3366.265625, -3210.867676, 33.733, 5000, 'pause'), +(4983, 12, -3368.529785, -3198.210205, 34.926, 0, ''), +(4983, 13, -3373.824951, -3190.861084, 34.717, 0, ''), +(4983, 14, -3371.443359, -3183.905029, 33.454, 0, ''), +(4983, 15, -3369.355957, -3169.828857, 36.325, 0, ''), +(4983, 16, -3368.904541, -3147.265381, 36.091, 0, ''), +(4983, 17, -3365.828125, -3144.284180, 35.176, 0, ''), +(4983, 18, -3355.827881, -3140.947998, 29.534, 0, ''), +(4983, 19, -3342.598389, -3132.146729, 30.422, 0, ''), +(4983, 20, -3336.984131, -3129.611816, 30.692, 0, ''), +(4983, 21, -3326.336670, -3126.833496, 34.426, 0, ''), +(4983, 22, -3322.649414, -3124.631836, 33.842, 0, ''); diff --git a/sql/Updates/0.0.3/r1378_mangos.sql b/sql/Updates/0.0.3/r1378_mangos.sql new file mode 100644 index 0000000..8d63bba --- /dev/null +++ b/sql/Updates/0.0.3/r1378_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_mana_bomb_exp_trigger' WHERE entry=20767; +UPDATE gameobject_template SET ScriptName='go_mana_bomb' WHERE entry=184725; diff --git a/sql/Updates/0.0.3/r1378_scriptdev2.sql b/sql/Updates/0.0.3/r1378_scriptdev2.sql new file mode 100644 index 0000000..8ff5a12 --- /dev/null +++ b/sql/Updates/0.0.3/r1378_scriptdev2.sql @@ -0,0 +1,7 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000476 AND -1000472; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000472,'1...',0,3,0,0,'mana bomb SAY_COUNT_1'), +(-1000473,'2...',0,3,0,0,'mana bomb SAY_COUNT_2'), +(-1000474,'3...',0,3,0,0,'mana bomb SAY_COUNT_3'), +(-1000475,'4...',0,3,0,0,'mana bomb SAY_COUNT_4'), +(-1000476,'5...',0,3,0,0,'mana bomb SAY_COUNT_5'); diff --git a/sql/Updates/0.0.3/r1379_mangos.sql b/sql/Updates/0.0.3/r1379_mangos.sql new file mode 100644 index 0000000..7f4d154 --- /dev/null +++ b/sql/Updates/0.0.3/r1379_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_akuno' WHERE entry=22377; diff --git a/sql/Updates/0.0.3/r1379_scriptdev2.sql b/sql/Updates/0.0.3/r1379_scriptdev2.sql new file mode 100644 index 0000000..fa193c0 --- /dev/null +++ b/sql/Updates/0.0.3/r1379_scriptdev2.sql @@ -0,0 +1,29 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000481 AND -1000477; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000477,'Let us leave this place. I\'ve had enough of these madmen!',0,0,0,0,'akuno SAY_AKU_START'), +(-1000478,'You\'ll go nowhere, fool!',0,0,0,0,'akuno SAY_AKU_AMBUSH_A'), +(-1000479,'Beware! More cultists come!',0,0,0,0,'akuno SAY_AKU_AMBUSH_B'), +(-1000480,'You will not escape us so easily!',0,0,0,0,'akuno SAY_AKU_AMBUSH_B_REPLY'), +(-1000481,'I can find my way from here. My friend Mekeda will reward you for your kind actions.',0,0,0,0,'akuno SAY_AKU_COMPLETE'); + +DELETE FROM script_waypoint WHERE entry=22377; +INSERT INTO script_waypoint VALUES +(22377, 0, -2770.457520, 5418.410645, -34.538, 0, ''), +(22377, 1, -2778.180420, 5416.253906, -34.538, 0, ''), +(22377, 2, -2816.960449, 5414.944336, -34.529, 0, ''), +(22377, 3, -2827.533203, 5414.737305, -28.265, 0, ''), +(22377, 4, -2841.610596, 5413.021973, -28.261, 0, ''), +(22377, 5, -2863.605957, 5411.964355, -28.262, 1000, 'SAY_AKU_AMBUSH_A'), +(22377, 6, -2874.559570, 5413.799316, -28.260, 0, ''), +(22377, 7, -2878.775879, 5413.812012, -28.261, 0, ''), +(22377, 8, -2892.586914, 5413.478516, -18.784, 0, ''), +(22377, 9, -2896.040527, 5413.137207, -18.589, 0, ''), +(22377, 10, -2896.318848, 5409.431641, -18.450, 0, ''), +(22377, 11, -2895.997803, 5396.909668, -8.855, 0, ''), +(22377, 12, -2895.734131, 5386.623535, -9.260, 0, ''), +(22377, 13, -2895.318359, 5367.613281, -9.456, 0, ''), +(22377, 14, -2890.306641, 5353.883301, -11.280, 1000, 'SAY_AKU_AMBUSH_B'), +(22377, 15, -2880.419189, 5334.625977, -10.629, 0, ''), +(22377, 16, -2866.394043, 5314.253906, -9.678, 0, ''), +(22377, 17, -2864.753174, 5277.734375, -11.087, 0, ''), +(22377, 18, -2856.330322, 5255.902344, -11.496, 5000, 'SAY_AKU_COMPLETE'); diff --git a/sql/Updates/0.0.3/r1380_mangos.sql b/sql/Updates/0.0.3/r1380_mangos.sql new file mode 100644 index 0000000..456acf7 --- /dev/null +++ b/sql/Updates/0.0.3/r1380_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_maghar_captive' WHERE entry=18210; diff --git a/sql/Updates/0.0.3/r1380_scriptdev2.sql b/sql/Updates/0.0.3/r1380_scriptdev2.sql new file mode 100644 index 0000000..f73a9fa --- /dev/null +++ b/sql/Updates/0.0.3/r1380_scriptdev2.sql @@ -0,0 +1,32 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000488 AND -1000482; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000482,'Look out!',0,0,0,0,'maghar captive SAY_MAG_START'), +(-1000483,'Don\'t let them escape! Kill the strong one first!',0,0,0,0,'maghar captive SAY_MAG_NO_ESCAPE'), +(-1000484,'More of them coming! Watch out!',0,0,0,0,'maghar captive SAY_MAG_MORE'), +(-1000485,'Where do you think you\'re going? Kill them all!',0,0,0,0,'maghar captive SAY_MAG_MORE_REPLY'), +(-1000486,'Ride the lightning, filth!',0,0,0,0,'maghar captive SAY_MAG_LIGHTNING'), +(-1000487,'FROST SHOCK!!!',0,0,0,0,'maghar captive SAY_MAG_SHOCK'), +(-1000488,'It is best that we split up now, in case they send more after us. Hopefully one of us will make it back to Garrosh. Farewell stranger.',0,0,0,0,'maghar captive SAY_MAG_COMPLETE'); + +DELETE FROM script_waypoint WHERE entry=18210; +INSERT INTO script_waypoint VALUES +(18210, 0, -1581.410034, 8557.933594, 2.726, 0, ''), +(18210, 1, -1579.908447, 8553.716797, 2.559, 0, ''), +(18210, 2, -1577.829102, 8549.880859, 2.001, 0, ''), +(18210, 3, -1571.161987, 8543.494141, 2.001, 0, ''), +(18210, 4, -1563.944824, 8530.334961, 1.605, 0, ''), +(18210, 5, -1554.565552, 8518.413086, 0.364, 0, ''), +(18210, 6, -1549.239136, 8515.518555, 0.293, 0, ''), +(18210, 7, -1518.490112, 8516.771484, 0.683, 2000, 'SAY_MAG_MORE'), +(18210, 8, -1505.038940, 8513.247070, 0.672, 0, ''), +(18210, 9, -1476.161133, 8496.066406, 2.157, 0, ''), +(18210, 10, -1464.450684, 8492.601563, 3.529, 0, ''), +(18210, 11, -1457.568359, 8492.183594, 4.449, 0, ''), +(18210, 12, -1444.100342, 8499.031250, 6.177, 0, ''), +(18210, 13, -1426.472168, 8510.116211, 7.686, 0, ''), +(18210, 14, -1403.685303, 8524.146484, 9.680, 0, ''), +(18210, 15, -1384.890503, 8542.014648, 11.180, 0, ''), +(18210, 16, -1382.286133, 8539.869141, 11.139, 7500, 'SAY_MAG_COMPLETE'), +(18210, 17, -1361.224609, 8521.440430, 11.144, 0, ''), +(18210, 18, -1324.803589, 8510.688477, 13.050, 0, ''), +(18210, 19, -1312.075439, 8492.709961, 14.235, 0, ''); diff --git a/sql/Updates/0.0.3/r1382_mangos.sql b/sql/Updates/0.0.3/r1382_mangos.sql new file mode 100644 index 0000000..ed843a5 --- /dev/null +++ b/sql/Updates/0.0.3/r1382_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_jump_a_tron' WHERE entry=183146; diff --git a/sql/Updates/0.0.3/r1383_scriptdev2.sql b/sql/Updates/0.0.3/r1383_scriptdev2.sql new file mode 100644 index 0000000..e474d6e --- /dev/null +++ b/sql/Updates/0.0.3/r1383_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8443+) '; diff --git a/sql/Updates/0.0.3/r1384_scriptdev2.sql b/sql/Updates/0.0.3/r1384_scriptdev2.sql new file mode 100644 index 0000000..f59577e --- /dev/null +++ b/sql/Updates/0.0.3/r1384_scriptdev2.sql @@ -0,0 +1,88 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000495 AND -1000489; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000489,'Show our guest around Shattrath, will you? Keep an eye out for pickpockets in the lower city.',0,0,0,0,'SAY_KHAD_START'), +(-1000490,'A newcomer to Shattrath! Make sure to drop by later. We can always use a hand with the injured.',0,0,0,0,'SAY_KHAD_INJURED'), +(-1000491,'Be mindful of what you say, this one\'s being shown around by Khadgar\'s pet.',0,0,0,0,'SAY_KHAD_MIND_YOU'), +(-1000492,'Are you joking? I\'m a Scryer, I always watch what i say. More enemies than allies in this city, it seems.',0,0,0,0,'SAY_KHAD_MIND_ALWAYS'), +(-1000493,'Light be with you, $n. And welcome to Shattrath.',0,0,0,0,'SAY_KHAD_ALDOR_GREET'), +(-1000494,'We\'re rather selective of who we befriend, $n. You think you have what it takes?',0,0,0,0,'SAY_KHAD_SCRYER_GREET'), +(-1000495,'Khadgar himself is showing you around? You must have made a good impression, $n.',0,0,0,0,'SAY_KHAD_HAGGARD'); + +DELETE FROM script_waypoint WHERE entry=19685; +INSERT INTO script_waypoint VALUES +(19685, 0, -1860.536987, 5416.987793, -10.480, 2500, ''), +(19685, 1, -1855.899048, 5412.805664, -12.427, 0, 'SAY_KHAD_SERV_0'), +(19685, 2, -1845.518433, 5385.352539, -12.427, 0, ''), +(19685, 3, -1815.247803, 5340.255371, -12.427, 0, ''), +(19685, 4, -1799.338379, 5312.777344, -12.427, 0, ''), +(19685, 5, -1780.491455, 5278.535156, -33.877, 2500, 'pause'), +(19685, 6, -1776.057983, 5270.247559, -38.809, 0, ''), +(19685, 7, -1772.219727, 5262.777344, -38.810, 0, ''), +(19685, 8, -1762.195557, 5261.720215, -38.850, 0, ''), +(19685, 9, -1759.242798, 5259.751465, -40.208, 0, ''), +(19685, 10, -1743.427612, 5259.661621, -40.208, 0, ''), +(19685, 11, -1744.361816, 5251.179199, -44.523, 0, ''), +(19685, 12, -1740.121582, 5240.120117, -47.740, 0, ''), +(19685, 13, -1737.636719, 5238.288086, -49.793, 0, ''), +(19685, 14, -1727.411621, 5233.874512, -50.477, 0, ''), +(19685, 15, -1707.489746, 5230.437988, -51.050, 0, ''), +(19685, 16, -1684.122925, 5223.633301, -49.415, 0, ''), +(19685, 17, -1669.973267, 5221.929688, -46.336, 0, ''), +(19685, 18, -1662.870117, 5221.712891, -44.959, 0, ''), +(19685, 19, -1657.170410, 5225.206055, -45.708, 0, ''), +(19685, 20, -1645.025635, 5238.360352, -40.212, 0, ''), +(19685, 21, -1631.657471, 5252.759766, -40.962, 0, ''), +(19685, 22, -1631.368286, 5276.543945, -41.032, 0, ''), +(19685, 23, -1621.732544, 5298.553711, -40.209, 0, ''), +(19685, 24, -1615.498169, 5298.098145, -40.209, 2500, 'pause'), +(19685, 25, -1636.979370, 5302.677734, -40.209, 0, ''), +(19685, 26, -1655.330322, 5315.736328, -40.207, 0, ''), +(19685, 27, -1656.884155, 5321.649414, -40.209, 0, ''), +(19685, 28, -1663.975586, 5335.206055, -46.526, 0, ''), +(19685, 29, -1659.141602, 5359.131836, -45.846, 0, ''), +(19685, 30, -1644.207520, 5390.886230, -45.542, 0, ''), +(19685, 31, -1646.183594, 5405.273926, -44.649, 0, ''), +(19685, 32, -1650.202637, 5414.541992, -46.324, 0, ''), +(19685, 33, -1656.052490, 5424.683594, -40.461, 0, ''), +(19685, 34, -1661.628296, 5423.929199, -40.405, 0, ''), +(19685, 35, -1664.651855, 5423.659180, -38.848, 0, ''), +(19685, 36, -1681.772339, 5425.999512, -38.809, 0, ''), +(19685, 37, -1729.785767, 5427.246094, -12.445, 0, ''), +(19685, 38, -1735.371460, 5423.663086, -12.427, 0, ''), +(19685, 39, -1741.627075, 5386.767578, -12.427, 0, ''), +(19685, 40, -1764.786133, 5363.735840, -12.427, 0, ''), +(19685, 41, -1816.372314, 5340.664063, -12.427, 0, ''), +(19685, 42, -1880.022705, 5309.796387, -12.427, 0, ''), +(19685, 43, -1887.374146, 5315.426270, -12.427, 0, ''), +(19685, 44, -1888.768066, 5324.518066, -5.146, 0, ''), +(19685, 45, -1888.399170, 5334.149902, 0.151, 0, ''), +(19685, 46, -1890.221680, 5337.659668, 0.921, 0, ''), +(19685, 47, -1897.542725, 5323.042969, 1.256, 0, ''), +(19685, 48, -1900.250244, 5319.804688, 0.831, 0, ''), +(19685, 49, -1910.039673, 5291.258789, 1.288, 0, ''), +(19685, 50, -1915.219482, 5275.572266, 2.502, 2500, 'pause'), +(19685, 51, -1927.226196, 5273.250977, 2.703, 0, ''), +(19685, 52, -1926.980225, 5278.467285, 0.109, 0, ''), +(19685, 53, -1927.665894, 5299.210449, -12.427, 0, ''), +(19685, 54, -1922.841797, 5319.263672, -12.427, 0, ''), +(19685, 55, -1925.779053, 5347.405273, -12.427, 0, ''), +(19685, 56, -1954.912476, 5384.230957, -12.427, 0, ''), +(19685, 57, -1966.727295, 5428.203613, -12.427, 0, ''), +(19685, 58, -1979.477661, 5448.415527, -12.427, 0, ''), +(19685, 59, -1977.533569, 5453.861328, -12.385, 0, ''), +(19685, 60, -1968.064087, 5455.781250, -4.343, 0, ''), +(19685, 61, -1959.223145, 5454.895020, 0.202, 0, ''), +(19685, 62, -1954.629028, 5457.011230, 0.900, 0, ''), +(19685, 63, -1967.760010, 5464.953125, 1.220, 2500, 'pause'), +(19685, 64, -1952.874023, 5462.962402, 0.956, 0, ''), +(19685, 65, -1955.339478, 5467.116699, 0.445, 0, ''), +(19685, 66, -1962.033203, 5472.804688, -4.243, 0, ''), +(19685, 67, -1968.007690, 5480.914551, -12.427, 0, ''), +(19685, 68, -1945.900146, 5515.948242, -12.427, 0, ''), +(19685, 69, -1874.867310, 5549.783691, -12.427, 0, ''), +(19685, 70, -1840.641602, 5544.234375, -12.427, 0, ''), +(19685, 71, -1838.963501, 5536.059570, -5.639, 0, ''), +(19685, 72, -1839.582275, 5525.627930, 0.193, 0, ''), +(19685, 73, -1837.931763, 5521.119629, 0.844, 0, ''), +(19685, 74, -1829.182495, 5533.433594, 1.209, 2500, 'pause'), +(19685, 75, -1848.397095, 5476.073730, 0.856, 40000, 'end'); diff --git a/sql/Updates/0.0.3/r1385_mangos.sql b/sql/Updates/0.0.3/r1385_mangos.sql new file mode 100644 index 0000000..69215a2 --- /dev/null +++ b/sql/Updates/0.0.3/r1385_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_ancestral_wolf' WHERE entry=17077; diff --git a/sql/Updates/0.0.3/r1385_scriptdev2.sql b/sql/Updates/0.0.3/r1385_scriptdev2.sql new file mode 100644 index 0000000..6dd7daf --- /dev/null +++ b/sql/Updates/0.0.3/r1385_scriptdev2.sql @@ -0,0 +1,59 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000498 AND -1000496; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000496,'%s lifts its head into the air, as if listening for something.',0,2,0,0,'ancestral wolf EMOTE_WOLF_LIFT_HEAD'), +(-1000497,'%s lets out a howl that rings across the mountains to the north and motions for you to follow.',0,2,0,0,'ancestral wolf EMOTE_WOLF_HOWL'), +(-1000498,'Welcome, kind spirit. What has brought you to us?',0,0,0,0,'ancestral wolf SAY_WOLF_WELCOME'); + +DELETE FROM script_waypoint WHERE entry=17077; +INSERT INTO script_waypoint VALUES +(17077, 0, -16.950142, 3801.409424, 95.064, 5000, 'EMOTE_WOLF_LIFT_HEAD'), +(17077, 1, -15.577404, 3805.170898, 94.833, 2500, ''), +(17077, 2, -20.011766, 3806.609863, 92.476, 5000, 'EMOTE_WOLF_HOWL'), +(17077, 3, -18.594666, 3816.207764, 91.482, 0, ''), +(17077, 4, -19.293468, 3838.218750, 85.012, 0, ''), +(17077, 5, -16.504408, 3871.034668, 82.327, 0, ''), +(17077, 6, 2.064510, 3898.678711, 85.623, 0, ''), +(17077, 7, 16.403864, 3921.174072, 86.024, 0, ''), +(17077, 8, 47.307926, 3932.001465, 83.302, 0, ''), +(17077, 9, 90.067230, 3942.906250, 77.000, 0, ''), +(17077, 10, 106.886024, 3944.388428, 76.502, 0, ''), +(17077, 11, 139.085480, 3941.897217, 80.617, 0, ''), +(17077, 12, 150.092346, 3942.782959, 80.399, 0, ''), +(17077, 13, 193.511475, 3950.396484, 74.366, 0, ''), +(17077, 14, 226.274948, 3958.003418, 73.257, 0, ''), +(17077, 15, 246.686981, 3963.309326, 76.376, 0, ''), +(17077, 16, 264.206177, 3977.726563, 83.704, 0, ''), +(17077, 17, 279.857422, 3986.417236, 88.245, 0, ''), +(17077, 18, 304.039642, 3998.354004, 95.649, 0, ''), +(17077, 19, 328.071503, 3995.832764, 104.434, 0, ''), +(17077, 20, 347.485229, 3990.817627, 113.608, 0, ''), +(17077, 21, 351.257202, 3954.260254, 125.747, 0, ''), +(17077, 22, 345.625977, 3932.016113, 132.358, 0, ''), +(17077, 23, 347.971893, 3908.549561, 135.520, 0, ''), +(17077, 24, 351.887878, 3891.062744, 139.957, 0, ''), +(17077, 25, 346.116852, 3864.634277, 146.647, 0, ''), +(17077, 26, 330.012360, 3839.859375, 154.148, 0, ''), +(17077, 27, 297.250610, 3811.855225, 166.893, 0, ''), +(17077, 28, 290.783112, 3800.188477, 172.130, 0, ''), +(17077, 29, 288.125427, 3782.474365, 180.825, 0, ''), +(17077, 30, 296.817841, 3771.629639, 184.961, 0, ''), +(17077, 31, 305.256256, 3765.380615, 185.360, 0, ''), +(17077, 32, 311.447906, 3757.902100, 184.312, 0, ''), +(17077, 33, 325.258026, 3730.282227, 184.076, 0, ''), +(17077, 34, 341.158630, 3717.757080, 183.904, 0, ''), +(17077, 35, 365.589020, 3717.200684, 183.902, 0, ''), +(17077, 36, 387.395081, 3731.750732, 183.645, 0, ''), +(17077, 37, 396.574127, 3732.604248, 179.831, 0, ''), +(17077, 38, 404.303192, 3737.313232, 180.151, 0, ''), +(17077, 39, 410.995972, 3742.286865, 183.364, 0, ''), +(17077, 40, 434.904541, 3761.058838, 186.219, 0, ''), +(17077, 41, 460.128815, 3774.436768, 186.348, 0, ''), +(17077, 42, 467.643951, 3788.506104, 186.446, 0, ''), +(17077, 43, 491.551666, 3815.446777, 189.848, 0, ''), +(17077, 44, 496.957855, 3836.875244, 193.078, 0, ''), +(17077, 45, 502.889191, 3855.458740, 194.834, 0, ''), +(17077, 46, 508.208466, 3863.689453, 194.024, 0, ''), +(17077, 47, 528.907593, 3887.348633, 189.762, 0, ''), +(17077, 48, 527.722229, 3890.686523, 189.240, 0, ''), +(17077, 49, 524.637329, 3891.768066, 189.149, 0, ''), +(17077, 50, 519.146057, 3886.701660, 190.128, 60000, 'SAY_WOLF_WELCOME'); diff --git a/sql/Updates/0.0.3/r1386_mangos.sql b/sql/Updates/0.0.3/r1386_mangos.sql new file mode 100644 index 0000000..c830a04 --- /dev/null +++ b/sql/Updates/0.0.3/r1386_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_morokk' WHERE entry=4500; diff --git a/sql/Updates/0.0.3/r1386_scriptdev2.sql b/sql/Updates/0.0.3/r1386_scriptdev2.sql new file mode 100644 index 0000000..935a629 --- /dev/null +++ b/sql/Updates/0.0.3/r1386_scriptdev2.sql @@ -0,0 +1,15 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000500 AND -1000499; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000499,'Puny $r wanna fight %s? Me beat you! Me boss here!',0,0,1,0,'morokk SAY_MOR_CHALLENGE'), +(-1000500,'Me scared! Me run now!',0,1,0,0,'morokk SAY_MOR_SCARED'); + +DELETE FROM script_waypoint WHERE entry=4500; +INSERT INTO script_waypoint VALUES +(4500, 0, -3125.597168, -2885.673828, 34.731, 2500, ''), +(4500, 1, -3120.257080, -2877.830322, 34.917, 0, ''), +(4500, 2, -3116.487305, -2850.670410, 34.869, 0, ''), +(4500, 3, -3093.474854, -2819.189697, 34.432, 0, ''), +(4500, 4, -3104.726318, -2802.020996, 33.954, 0, ''), +(4500, 5, -3105.906006, -2780.234375, 34.469, 0, ''), +(4500, 6, -3116.080811, -2757.902588, 34.734, 0, ''), +(4500, 7, -3125.234375, -2733.960205, 33.189, 0, ''); diff --git a/sql/Updates/0.0.3/r1388_mangos.sql b/sql/Updates/0.0.3/r1388_mangos.sql new file mode 100644 index 0000000..617b3f1 --- /dev/null +++ b/sql/Updates/0.0.3/r1388_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_muglash' WHERE entry=12717; +UPDATE gameobject_template SET ScriptName='go_naga_brazier' WHERE entry=178247; diff --git a/sql/Updates/0.0.3/r1388_scriptdev2.sql b/sql/Updates/0.0.3/r1388_scriptdev2.sql new file mode 100644 index 0000000..8d405cc --- /dev/null +++ b/sql/Updates/0.0.3/r1388_scriptdev2.sql @@ -0,0 +1,45 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000510 AND -1000501; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000501,'Are you sure that you are ready? If we do not have a group of your allies to aid us, we will surely fail.',0,0,1,0,'muglash SAY_MUG_START1'), +(-1000502,'This will be a though fight, $n. Follow me closely.',0,0,1,0,'muglash SAY_MUG_START2'), +(-1000503,'This is the brazier, $n. Put it out. Vorsha is a beast, worthy of praise from no one!',0,0,1,0,'muglash SAY_MUG_BRAZIER'), +(-1000504,'Now we must wait. It won\'t be long before the naga realize what we have done.',0,0,1,0,'muglash SAY_MUG_BRAZIER_WAIT'), +(-1000505,'Be on your guard, $n!',0,0,1,0,'muglash SAY_MUG_ON_GUARD'), +(-1000506,'Perhaps we will get a moment to rest. But i will not give up until we have faced off against Vorsha!',0,0,1,0,'muglash SAY_MUG_REST'), +(-1000507,'We have done it!',0,0,1,0,'muglash SAY_MUG_DONE'), +(-1000508,'You have my deepest gratitude. I thank you.',0,0,1,0,'muglash SAY_MUG_GRATITUDE'), +(-1000509,'I am going to patrol the area for a while longer and ensure that things are truly safe.',0,0,1,0,'muglash SAY_MUG_PATROL'), +(-1000510,'Please return to Zoram\'gar and report our success to the Warsong runner.',0,0,1,0,'muglash SAY_MUG_RETURN'); + +DELETE FROM script_waypoint WHERE entry=12717; +INSERT INTO script_waypoint VALUES +(12717, 0, 3346.247070, 1007.879028, 3.590, 0, 'SAY_MUG_START2'), +(12717, 1, 3367.388428, 1011.505859, 3.720, 0, ''), +(12717, 2, 3418.636963, 1013.963684, 2.905, 0, ''), +(12717, 3, 3426.844971, 1015.097534, 3.449, 0, ''), +(12717, 4, 3437.025391, 1020.786194, 2.742, 0, ''), +(12717, 5, 3460.563721, 1024.256470, 1.353, 0, ''), +(12717, 6, 3479.869629, 1037.957153, 1.023, 0, ''), +(12717, 7, 3490.526367, 1043.346313, 3.338, 0, ''), +(12717, 8, 3504.282959, 1047.772339, 8.205, 0, ''), +(12717, 9, 3510.733398, 1049.790771, 12.143, 0, ''), +(12717, 10, 3514.411133, 1051.167725, 13.235, 0, ''), +(12717, 11, 3516.939697, 1052.911377, 12.918, 0, ''), +(12717, 12, 3523.635742, 1056.297485, 7.563, 0, ''), +(12717, 13, 3531.939941, 1059.863525, 6.175, 0, ''), +(12717, 14, 3535.475342, 1069.959473, 1.697, 0, ''), +(12717, 15, 3546.978027, 1093.485474, 0.680, 0, ''), +(12717, 16, 3549.729980, 1101.882446, -1.123, 0, ''), +(12717, 17, 3555.140137, 1116.985718, -4.326, 0, ''), +(12717, 18, 3571.940430, 1132.175781, -0.634, 0, ''), +(12717, 19, 3574.283203, 1137.575928, 3.684, 0, ''), +(12717, 20, 3579.312744, 1137.252319, 8.205, 0, ''), +(12717, 21, 3590.218994, 1143.646973, 8.291, 0, ''), +(12717, 22, 3595.972900, 1145.827148, 6.773, 0, ''), +(12717, 23, 3603.650391, 1146.920776, 9.763, 0, ''), +(12717, 24, 3607.081787, 1146.014282, 10.692, 5000, 'SAY_MUG_BRAZIER'), +(12717, 25, 3614.518555, 1142.629150, 10.248, 0, ''), +(12717, 26, 3616.660889, 1140.837036, 10.682, 3000, 'SAY_MUG_PATROL'), +(12717, 27, 3621.078613, 1138.109497, 10.369, 0, 'SAY_MUG_RETURN'), +(12717, 28, 3615.478516, 1145.525879, 9.614, 0, ''), +(12717, 29, 3607.188232, 1152.715942, 8.871, 0, ''); diff --git a/sql/Updates/0.0.3/r1391_mangos.sql b/sql/Updates/0.0.3/r1391_mangos.sql new file mode 100644 index 0000000..b258eca --- /dev/null +++ b/sql/Updates/0.0.3/r1391_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_letoll' WHERE entry=22458; diff --git a/sql/Updates/0.0.3/r1391_scriptdev2.sql b/sql/Updates/0.0.3/r1391_scriptdev2.sql new file mode 100644 index 0000000..d76b13c --- /dev/null +++ b/sql/Updates/0.0.3/r1391_scriptdev2.sql @@ -0,0 +1,50 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000531 AND -1000511; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000511,'Aright, listen up! Form a circle around me and move out!',0,0,0,0,'letoll SAY_LE_START'), +(-1000512,'Aright, $r, just keep us safe from harm while we work. We\'ll pay you when we return.',0,0,0,0,'letoll SAY_LE_KEEP_SAFE'), +(-1000513,'The dig site is just north of here.',0,0,0,0,'letoll SAY_LE_NORTH'), +(-1000514,'We\'re here! Start diggin\'!',0,0,0,0,'letoll SAY_LE_ARRIVE'), +(-1000515,'I think there\'s somethin\' buried here, beneath the sand!',0,0,0,0,'letoll SAY_LE_BURIED'), +(-1000516,'Almost got it!',0,0,0,0,'letoll SAY_LE_ALMOST'), +(-1000517,'By brann\'s brittle bananas! What is it!? It... It looks like a drum.',0,0,0,0,'letoll SAY_LE_DRUM'), +(-1000518,'Wow... a drum.',0,0,0,0,'letoll SAY_LE_DRUM_REPLY'), +(-1000519,'This discovery will surely rock the foundation of modern archaeology.',0,0,0,0,'letoll SAY_LE_DISCOVERY'), +(-1000520,'Yea, great. Can we leave now? This desert is giving me hives.',0,0,0,0,'letoll SAY_LE_DISCOVERY_REPLY'), +(-1000521,'Have ye gone mad? You expect me to leave behind a drum without first beatin\' on it? Not this son of Ironforge! No sir!',0,0,0,0,'letoll SAY_LE_NO_LEAVE'), +(-1000522,'This reminds me of that one time where you made us search Silithus for evidence of sand gnomes.',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY1'), +(-1000523,'Or that time when you told us that you\'d discovered the cure for the plague of the 20th century. What is that even? 20th century?',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY2'), +(-1000524,'I don\'t think it can top the one time where he told us that he\'d heard that Artha\'s "cousin\'s" skeleton was frozen beneath a glacier in Winterspring. I\'ll never forgive you for that one, Letoll. I mean honestly... Artha\'s cousin?',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY3'), +(-1000525,'I dunno. It can\'t possibly beat the time he tried to convince us that we\'re all actually a figment of some being\'s imagination and that they only use us for their own personal amusement. That went over well during dinner with the family.',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY4'), +(-1000526,'Shut yer yaps! I\'m gonna bang on this drum and that\'s that!',0,0,0,0,'letoll SAY_LE_SHUT'), +(-1000527,'Say, do you guys hear that?',0,0,0,0,'letoll SAY_LE_REPLY_HEAR'), +(-1000528,'IN YOUR FACE! I told you there was somethin\' here!',0,0,0,0,'letoll SAY_LE_IN_YOUR_FACE'), +(-1000529,'Don\'t just stand there! Help him out!',0,0,0,0,'letoll SAY_LE_HELP_HIM'), +(-1000530,'%s picks up the drum.',0,2,0,0,'letoll EMOTE_LE_PICK_UP'), +(-1000531,'You\'ve been a tremendous help, $r! Let\'s get out of here before more of those things show up! I\'ll let Dwarfowitz know you did the job asked of ya\' admirably.',0,0,0,0,'letoll SAY_LE_THANKS'); + +DELETE FROM script_waypoint WHERE entry=22458; +INSERT INTO script_waypoint VALUES +(22458, 0, -3739.907959, 5393.691895, -4.213, 5000, 'SAY_LE_KEEP_SAFE'), +(22458, 1, -3733.334229, 5389.243164, -5.331, 0, ''), +(22458, 2, -3728.771729, 5385.649414, -3.704, 0, ''), +(22458, 3, -3717.267090, 5379.179199, -4.400, 0, ''), +(22458, 4, -3705.626465, 5379.261719, -7.711, 0, ''), +(22458, 5, -3688.279541, 5379.716309, -9.400, 0, ''), +(22458, 6, -3649.186523, 5389.111816, -11.917, 0, ''), +(22458, 7, -3612.791504, 5392.812500, -13.655, 0, ''), +(22458, 8, -3574.865479, 5412.704590, -16.543, 0, ''), +(22458, 9, -3564.438232, 5422.615723, -16.104, 0, ''), +(22458, 10, -3553.387695, 5444.732910, -12.184, 2500, 'arivve dig site SAY_LE_ARRIVE'), +(22458, 11, -3557.291016, 5465.319336, -9.282, 7500, 'dig 1'), +(22458, 12, -3548.102051, 5453.417969, -12.282, 10000, 'dig 2 SAY_LE_BURIED pause'), +(22458, 13, -3556.580322, 5446.475098, -11.920, 0, 'start returning'), +(22458, 14, -3564.438232, 5422.615723, -16.104, 0, ''), +(22458, 15, -3574.865479, 5412.704590, -16.543, 0, ''), +(22458, 16, -3612.791504, 5392.812500, -13.655, 0, ''), +(22458, 17, -3649.186523, 5389.111816, -11.917, 0, ''), +(22458, 18, -3688.279541, 5379.716309, -9.400, 0, ''), +(22458, 19, -3705.626465, 5379.261719, -7.711, 0, ''), +(22458, 20, -3717.267090, 5379.179199, -4.400, 0, ''), +(22458, 21, -3728.771729, 5385.649414, -3.704, 0, ''), +(22458, 22, -3733.334229, 5389.243164, -5.331, 0, ''), +(22458, 23, -3739.907959, 5393.691895, -4.213, 0, ''); diff --git a/sql/Updates/0.0.3/r1392_mangos.sql b/sql/Updates/0.0.3/r1392_mangos.sql new file mode 100644 index 0000000..6b8c4da --- /dev/null +++ b/sql/Updates/0.0.3/r1392_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='mob_torloth' WHERE entry=22076; +UPDATE creature_template SET ScriptName='npc_lord_illidan_stormrage' WHERE entry=22083; diff --git a/sql/Updates/0.0.3/r1392_scriptdev2.sql b/sql/Updates/0.0.3/r1392_scriptdev2.sql new file mode 100644 index 0000000..a844f52 --- /dev/null +++ b/sql/Updates/0.0.3/r1392_scriptdev2.sql @@ -0,0 +1,11 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000540 AND -1000532; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000532,'At your command, my liege...',0,0,0,0,'torloth TORLOTH_DIALOGUE1'), +(-1000533,'As you desire, Lord Illidan.',0,0,0,0,'torloth TORLOTH_DIALOGUE2'), +(-1000534,'Yes, Lord Illidan, I would sacrifice to you this magnificent physique. On this day you will fall - another victim of Torloth...',0,0,0,0,'torloth TORLOTH_DIALOGUE3'), +(-1000535,'Destroy them, Torloth. Let lose their blood like a river upon this hallowed ground.',0,0,0,0,'lordillidan ILLIDAN_DIALOGUE'), +(-1000536,'What manner of fool dares stand before Illidan Stormrage? Soldiers, destroy these insects!',0,1,0,0,'lordillidan ILLIDAN_SUMMON1'), +(-1000537,'You are no challenge for the Crimson Sigil. Mind breakers, end this nonsense.',0,1,0,0,'lordillidan ILLIDAN_SUMMON2'), +(-1000538,'Run while you still can. The highlords come soon...',0,1,0,0,'lordillidan ILLIDAN_SUMMON3'), +(-1000539,'Torloth your master calls!',0,1,0,0,'lordillidan ILLIDAN_SUMMON4'), +(-1000540,'So you have defeated the Crimson Sigil. You now seek to challenge my rule? Not even Arthas could defeat me, yet you dare to even harbor such thoughts? Then I say to you, come! Come $N! The Black Temple awaits...',0,1,0,0,'lordillidan EVENT_COMPLETED'); diff --git a/sql/Updates/0.0.3/r1394_mangos.sql b/sql/Updates/0.0.3/r1394_mangos.sql new file mode 100644 index 0000000..b04bc0b --- /dev/null +++ b/sql/Updates/0.0.3/r1394_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_kitten' WHERE entry=9937; +UPDATE creature_template SET ScriptName='npc_corrupt_saber' WHERE entry=10042; diff --git a/sql/Updates/0.0.3/r1394_scriptdev2.sql b/sql/Updates/0.0.3/r1394_scriptdev2.sql new file mode 100644 index 0000000..683f1ec --- /dev/null +++ b/sql/Updates/0.0.3/r1394_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000542 AND -1000541; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000541,'%s jumps into the moonwell and goes underwater...',0,2,0,0,'kitten EMOTE_SAB_JUMP'), +(-1000542,'%s follows $n obediertly.',0,2,0,0,'kitten EMOTE_SAB_FOLLOW'); diff --git a/sql/Updates/0.0.3/r1405_mangos.sql b/sql/Updates/0.0.3/r1405_mangos.sql new file mode 100644 index 0000000..77887d3 --- /dev/null +++ b/sql/Updates/0.0.3/r1405_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='boss_gortok' WHERE entry=26687; +UPDATE creature_template SET ScriptName='boss_skadi' WHERE entry=26693; +UPDATE creature_template SET ScriptName='boss_svala' WHERE entry=29281; +UPDATE creature_template SET ScriptName='boss_ymiron' WHERE entry=26861; diff --git a/sql/Updates/0.0.3/r1405_scriptdev2.sql b/sql/Updates/0.0.3/r1405_scriptdev2.sql new file mode 100644 index 0000000..b84ad18 --- /dev/null +++ b/sql/Updates/0.0.3/r1405_scriptdev2.sql @@ -0,0 +1,43 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1575040 AND -1575000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1575000,'My liege! I have done as you asked, and now beseech you for your blessing!',13856,1,0,0,'svala SAY_INTRO_1'), +(-1575001,'Your sacrifice is a testament to your obedience. Indeed you are worthy of this charge. Arise, and forever be known as Svala Sorrowgrave!',14732,1,0,0,'svala SAY_INTRO_2_ARTHAS'), +(-1575002,'The sensation is... beyond my imagining. I am yours to command, my king.',13857,1,0,0,'svala SAY_INTRO_3'), +(-1575003,'Your first test awaits you. Destroy our uninvited guests.',14733,1,0,0,'svala SAY_INTRO_4_ARTHAS'), +(-1575004,'I will be happy to slaughter them in your name! Come, enemies of the Scourge! I will show you the might of the Lich King!',13858,1,0,0,'svala SAY_INTRO_5'), +(-1575005,'I will vanquish your soul!',13842,1,0,0,'svala SAY_AGGRO'), +(-1575006,'You were a fool to challenge the power of the Lich King!',13845,1,0,0,'svala SAY_SLAY_1'), +(-1575007,'Your will is done, my king.',13847,1,0,0,'svala SAY_SLAY_2'), +(-1575008,'Another soul for my master.',13848,1,0,0,'svala SAY_SLAY_3'), +(-1575009,'Your death approaches.',13850,1,0,0,'svala SAY_SACRIFICE_1'), +(-1575010,'Go now to my master.',13851,1,0,0,'svala SAY_SACRIFICE_2'), +(-1575011,'Your end is inevitable.',13852,1,0,0,'svala SAY_SACRIFICE_3'), +(-1575012,'Yor-guul mak!',13853,1,0,0,'svala SAY_SACRIFICE_4'), +(-1575013,'Any last words?',13854,1,0,0,'svala SAY_SACRIFICE_5'), +(-1575014,'Nooo! I did not come this far... to...',13855,1,0,0,'svala SAY_DEATH'), +(-1575015,'What this place? I will destroy you!',13464,1,0,0,'gortok SAY_AGGRO'), +(-1575016,'You die! That what master wants!',13465,1,0,0,'gortok SAY_SLAY_1'), +(-1575017,'An easy task!',13466,1,0,0,'gortok SAY_SLAY_2'), +(-1575018,' ',13467,1,0,0,'gortok SAY_DEATH'), +(-1575019,'What mongrels dare intrude here? Look alive, my brothers! A feast for the one that brings me their heads!',13497,1,0,0,'skadi SAY_AGGRO'), +(-1575020,'Sear them to the bone!',13498,1,0,0,'skadi SAY_DRAKEBREATH_1'), +(-1575021,'Go now! Leave nothing but ash in your wake!',13499,1,0,0,'skadi SAY_DRAKEBREATH_2'), +(-1575022,'Cleanse our sacred halls with flame!',13500,1,0,0,'skadi SAY_DRAKEBREATH_3'), +(-1575023,'I ask for ... to kill them, yet all I get is feeble whelps! By Ye.. SLAUGHTER THEM!',13501,1,0,0,'skadi SAY_DRAKE_HARPOON_1'), +(-1575024,'If one more harpoon touches my drake I\'ll flae my miserable heins.',13502,1,0,0,'skadi SAY_DRAKE_HARPOON_2'), +(-1575025,'Mjor Na Ul Kaval!',13503,1,0,0,'skadi SAY_KILL_1'), +(-1575026,'Not so brash now, are you?',13504,1,0,0,'skadi SAY_KILL_2'), +(-1575027,'I\'ll mount your skull from the highest tower!',13505,1,0,0,'skadi SAY_KILL_3'), +(-1575028,'ARGH! You call that... an attack? I\'ll... show... aghhhh...',13506,1,0,0,'skadi SAY_DEATH'), +(-1575029,'You motherless knaves! Your corpses will make fine morsels for my new drake!',13507,1,0,0,'skadi SAY_DRAKE_DEATH'), +(-1575030,'%s is within range of the harpoon launchers!',0,3,0,0,'skadi EMOTE_HARPOON_RANGE'), +(-1575031,'You invade my home and then dare to challenge me? I will tear the hearts from your chests and offer them as gifts to the death god! Rualg nja gaborr!',13609,1,0,0,'ymiron SAY_AGGRO'), +(-1575032,'Bjorn of the Black Storm! Honor me now with your presence!',13610,1,0,0,'ymiron SAY_SUMMON_BJORN'), +(-1575033,'Haldor of the rocky cliffs, grant me your strength!',13611,1,0,0,'ymiron SAY_SUMMON_HALDOR'), +(-1575034,'Ranulf of the screaming abyss, snuff these maggots with darkest night!',13612,1,0,0,'ymiron SAY_SUMMON_RANULF'), +(-1575035,'Tor of the Brutal Siege! Bestow your might upon me!',13613,1,0,0,'ymiron SAY_SUMMON_TORGYN'), +(-1575036,'Your death is only the beginning!',13614,1,0,0,'ymiron SAY_SLAY_1'), +(-1575037,'You have failed your people!',13615,1,0,0,'ymiron SAY_SLAY_2'), +(-1575038,'There is a reason I am king!',13616,1,0,0,'ymiron SAY_SLAY_3'), +(-1575039,'Bleed no more!',13617,1,0,0,'ymiron SAY_SLAY_4'), +(-1575040,'What... awaits me... now?',13618,1,0,0,'ymiron SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r1406_mangos.sql b/sql/Updates/0.0.3/r1406_mangos.sql new file mode 100644 index 0000000..9c1c1f5 --- /dev/null +++ b/sql/Updates/0.0.3/r1406_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_ulduar' WHERE map=603; diff --git a/sql/Updates/0.0.3/r1408_mangos.sql b/sql/Updates/0.0.3/r1408_mangos.sql new file mode 100644 index 0000000..d0429d4 --- /dev/null +++ b/sql/Updates/0.0.3/r1408_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='boss_colossus' WHERE entry=29307; +UPDATE creature_template SET ScriptName='boss_galdarah' WHERE entry=29306; +UPDATE creature_template SET ScriptName='boss_moorabi' WHERE entry=29305; +UPDATE creature_template SET ScriptName='boss_sladran' WHERE entry=29304; diff --git a/sql/Updates/0.0.3/r1408_scriptdev2.sql b/sql/Updates/0.0.3/r1408_scriptdev2.sql new file mode 100644 index 0000000..b2240fa --- /dev/null +++ b/sql/Updates/0.0.3/r1408_scriptdev2.sql @@ -0,0 +1,31 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1604028 AND -1604000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1604000,'Drakkari gonna kill anybody who trespass on these lands!',14443,1,0,0,'sladran SAY_AGGRO'), +(-1604001,'Minions of the scale, heed my call!',14444,1,0,0,'sladran SAY_SUMMON_SNAKE'), +(-1604002,'Our thousand fangs gonna rend your flesh! ',14445,1,0,0,'sladran SAY_SUMMON_CONSTRICT'), +(-1604003,'Ye not breathin\'! Good.',14446,1,0,0,'sladran SAY_SLAY_1'), +(-1604004,'You scared now?',14447,1,0,0,'sladran SAY_SLAY_2'), +(-1604005,'I\'ll eat you next, mon!',14448,1,0,0,'sladran SAY_SLAY_3'), +(-1604006,'I sssee now... Ssscourge wasss not... our greatessst enemy...',14449,1,0,0,'sladran SAY_DEATH'), +(-1604007,'%s begins to cast Poison Nova!',0,3,0,0,'sladran EMOTE_NOVA'), +(-1604008,'%s surges forward!',0,2,0,0,'colossus EMOTE_SURGE'), +(-1604009,'%s seep into the ground.',0,2,0,0,'colossus EMOTE_SEEP'), +(-1604010,'%s begins to glow faintly.',0,2,0,0,'colossus EMOTE_GLOW'), +(-1604011,'We fought back da Scourge. What chance joo be thinkin\' JOO got?',14721,1,0,0,'moorabi SAY_AGGRO'), +(-1604012,'Da ground gonna swallow you up! ',14723,1,0,0,'moorabi SAY_QUAKE'), +(-1604013,'Get ready for somethin\'... much... BIGGAH!',14722,1,0,0,'moorabi SAY_TRANSFORM'), +(-1604014,'I crush you, cockroaches!',14725,1,0,0,'moorabi SAY_SLAY_1'), +(-1604015,'Who gonna stop me; you?',14726,1,0,0,'moorabi SAY_SLAY_2'), +(-1604016,'Not so tough now.',14727,1,0,0,'moorabi SAY_SLAY_3'), +(-1604017,'If our gods can die... den so can we...',14728,1,0,0,'moorabi SAY_DEATH'), +(-1604018,'%s begins to transform!',0,3,0,0,'moorabi EMOTE_TRANSFORM'), +(-1604019,'I\'m gonna spill your guts, mon!',14430,1,0,0,'galdarah SAY_AGGRO'), +(-1604020,'Ain\'t gonna be nottin\' left after this!',14431,1,0,0,'galdarah SAY_TRANSFORM_1'), +(-1604021,'You wanna see power? I\'m gonna show you power!',14432,1,0,0,'galdarah SAY_TRANSFORM_2'), +(-1604022,'Gut them! Impale them!',14433,1,0,0,'galdarah SAY_SUMMON_1'), +(-1604023,'Kill them all!',14434,1,0,0,'galdarah SAY_SUMMON_2'), +(-1604024,'Say hello to my BIG friend!',14435,1,0,0,'galdarah SAY_SUMMON_3'), +(-1604025,'What a rush!',14436,1,0,0,'galdarah SAY_SLAY_1'), +(-1604026,'Who needs gods, when WE ARE GODS!',14437,1,0,0,'galdarah SAY_SLAY_2'), +(-1604027,'I told ya so!',14438,1,0,0,'galdarah SAY_SLAY_3'), +(-1604028,'Even the mighty... can fall.',14439,1,0,0,'galdarah SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r1409_mangos.sql b/sql/Updates/0.0.3/r1409_mangos.sql new file mode 100644 index 0000000..a4c06a9 --- /dev/null +++ b/sql/Updates/0.0.3/r1409_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='boss_novos' WHERE entry=26631; +UPDATE creature_template SET ScriptName='boss_tharonja' WHERE entry=26632; +UPDATE creature_template SET ScriptName='boss_trollgore' WHERE entry=26630; diff --git a/sql/Updates/0.0.3/r1409_scriptdev2.sql b/sql/Updates/0.0.3/r1409_scriptdev2.sql new file mode 100644 index 0000000..8080e09 --- /dev/null +++ b/sql/Updates/0.0.3/r1409_scriptdev2.sql @@ -0,0 +1,22 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1600019 AND -1600000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1600000,'More grunts, more glands, more FOOD!',13181,1,0,0,'trollgore SAY_AGGRO'), +(-1600001,'So hungry! Must feed!',13182,1,0,0,'trollgore SAY_CONSUME'), +(-1600002,'Aaaargh...',13183,1,0,0,'trollgore SAY_DEATH'), +(-1600003,'Corpse go boom!',13184,1,0,0,'trollgore SAY_EXPLODE'), +(-1600004,'You have gone, me gonna eat you!',13185,1,0,0,'trollgore SAY_KILL'), +(-1600005,'The chill that you feel is the herald of your doom!',13173,1,0,0,'novos SAY_AGGRO'), +(-1600006,'Your efforts... are in vain.',13174,1,0,0,'novos SAY_DEATH'), +(-1600007,'Such is the fate of all who oppose the Lich King.',13175,1,0,0,'novos SAY_KILL'), +(-1600008,'Bolster my defenses! Hurry, curse you!',13176,1,0,0,'novos SAY_ADDS'), +(-1600009,'Surely you can see the futility of it all!',13177,1,0,0,'novos SAY_BUBBLE_1'), +(-1600010,'Just give up and die already!',13178,1,0,0,'novos SAY_BUBBLE_2'), +(-1600011,'%s calls for assistance.',0,3,0,0,'novos EMOTE_ASSISTANCE'), +(-1600012,'Tharon\'ja sees all! The work of mortals shall not end the eternal dynasty!',13862,1,0,0,'tharonja SAY_AGGRO'), +(-1600013,'As Tharon\'ja predicted.',13863,1,0,0,'tharonja SAY_KILL_1'), +(-1600014,'As it was written.',13864,1,0,0,'tharonja SAY_KILL_2'), +(-1600015,'Your flesh serves Tharon\'ja now!',13865,1,0,0,'tharonja SAY_FLESH_1'), +(-1600016,'Tharon\'ja has a use for your mortal shell!',13866,1,0,0,'tharonja SAY_FLESH_2'), +(-1600017,'No! A taste... all too brief!',13867,1,0,0,'tharonja SAY_SKELETON_1'), +(-1600018,'Tharon\'ja will have more!',13868,1,0,0,'tharonja SAY_SKELETON_2'), +(-1600019,'Im... impossible! Tharon\'ja is eternal! Tharon\'ja... is...',13869,1,0,0,'tharonja SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r1410_mangos.sql b/sql/Updates/0.0.3/r1410_mangos.sql new file mode 100644 index 0000000..df63152 --- /dev/null +++ b/sql/Updates/0.0.3/r1410_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='mob_vrykul_skeleton' WHERE entry=23970; diff --git a/sql/Updates/0.0.3/r1410_scriptdev2.sql b/sql/Updates/0.0.3/r1410_scriptdev2.sql new file mode 100644 index 0000000..3598696 --- /dev/null +++ b/sql/Updates/0.0.3/r1410_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1574021; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1574021,'%s casts Frost Tomb on $N',0,3,0,0,'keleseth EMOTE_FROST_TOMB'); diff --git a/sql/Updates/0.0.3/r1411_mangos.sql b/sql/Updates/0.0.3/r1411_mangos.sql new file mode 100644 index 0000000..faccecb --- /dev/null +++ b/sql/Updates/0.0.3/r1411_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='boss_maiden_of_grief' WHERE entry=27975; +UPDATE creature_template SET ScriptName='boss_sjonnir' WHERE entry=27978; diff --git a/sql/Updates/0.0.3/r1411_scriptdev2.sql b/sql/Updates/0.0.3/r1411_scriptdev2.sql new file mode 100644 index 0000000..614f90d --- /dev/null +++ b/sql/Updates/0.0.3/r1411_scriptdev2.sql @@ -0,0 +1,14 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1599011 AND -1599000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1599000,'Soft, vulnerable shells. Brief, fragile lives. You can not escape the curse of flesh!',14180,1,0,0,'sjonnir SAY_AGGRO'), +(-1599001,'???',14181,1,0,0,'sjonnir SAY_SLAY_1'), +(-1599002,'Flesh is no match for iron!',14182,1,0,0,'sjonnir SAY_SLAY_2'), +(-1599003,'Armies of iron will smother the world!',14183,1,0,0,'sjonnir SAY_SLAY_3'), +(-1599004,'Loken will not rest, until the forge is retaken. You changed nothing!',14184,1,0,0,'sjonnir SAY_DEATH'), +(-1599005,'You shouldn\'t have come...now you will die!',13487,1,0,0,'maiden SAY_AGGRO'), +(-1599006,'Why must it be this way?',13488,1,0,0,'maiden SAY_SLAY_1'), +(-1599007,'You had it coming!',13489,1,0,0,'maiden SAY_SLAY_2'), +(-1599008,'My burden grows heavier.',13490,1,0,0,'maiden SAY_SLAY_3'), +(-1599009,'This is your own fault!',13491,1,0,0,'maiden SAY_SLAY_4'), +(-1599010,'So much lost time... that you\'ll never get back!',13492,1,0,0,'maiden SAY_STUN'), +(-1599011,'I hope you all rot! I never...wanted...this.',13493,1,0,0,'maiden SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r1412_mangos.sql b/sql/Updates/0.0.3/r1412_mangos.sql new file mode 100644 index 0000000..6f02efd --- /dev/null +++ b/sql/Updates/0.0.3/r1412_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_brann_hos' WHERE entry=28070; diff --git a/sql/Updates/0.0.3/r1412_scriptdev2.sql b/sql/Updates/0.0.3/r1412_scriptdev2.sql new file mode 100644 index 0000000..c8f480a --- /dev/null +++ b/sql/Updates/0.0.3/r1412_scriptdev2.sql @@ -0,0 +1,89 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1599064 AND -1599012; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1599012,'Now that\'s owning your supper!',14244,1,0,0,'brann SAY_KILL_1'), +(-1599013,'Press on, that\'s the way!',14245,1,0,0,'brann SAY_KILL_2'), +(-1599014,'Keep it up now. Plenty of death-dealing for everyone!',14246,1,0,0,'brann SAY_KILL_3'), +(-1599015,'I\'m all kinds of busted up. Might not... make it...',14257,1,0,0,'brann SAY_LOW_HEALTH'), +(-1599016,'Not yet, not... yet-',14258,1,0,0,'brann SAY_DEATH'), +(-1599017,'I\'m doing everything I can!',14260,1,0,0,'brann SAY_PLAYER_DEATH_1'), +(-1599018,'Light preserve you!',14261,1,0,0,'brann SAY_PLAYER_DEATH_2'), +(-1599019,'I hope this is all worth it!',14262,1,0,0,'brann SAY_PLAYER_DEATH_3'), +(-1599020,'Time to get some answers! Let\'s get this show on the road!',14259,1,0,0,'brann SAY_ESCORT_START'), + +(-1599021,'Don\'t worry. Old Brann has got your back. Keep that metal monstrosity busy and I\'ll see if I can sweet talk this machine into helping you.',14274,1,0,0,'brann SAY_SPAWN_DWARF'), +(-1599022,'This is a wee bit trickier that before... Oh, bloody--incomin\'!',14275,1,0,0,'brann SAY_SPAWN_TROGG'), +(-1599023,'What in the name o\' Madoran did THAT do? Oh! Wait: I just about got it...',14276,1,0,0,'brann SAY_SPAWN_OOZE'), +(-1599024,'Ha, that did it. Help\'s a-coming. Take this you glow-eying brute!',14277,1,0,0,'brann SAY_SPAWN_EARTHEN'), + +(-1599025,'Take a moment and relish this with me! Soon all will be revealed! Okay then, let’s do this!',14247,1,0,0,'brann SAY_EVENT_INTRO_1'), +(-1599026,'Now keep an eye out! I\'ll have this licked in two shakes of a--',14248,1,0,0,'brann SAY_EVENT_INTRO_2'), +(-1599027,'Warning! Life form pattern not recognized. Archival processing terminated. Continued interference will result in targeted response.',13765,1,0,0,'brann SAY_EVENT_INTRO_3_ABED'), + +(-1599028,'Oh, that doesn\'t sound good. We might have a complication or two...',14249,1,0,0,'brann SAY_EVENT_A_1'), +(-1599029,'Security breach in progress. Analysis of historical archives transferred to lower priority queue. Countermeasures engaged.',13756,1,0,0,'brann SAY_EVENT_A_2_KADD'), +(-1599030,'Ah, you want to play hardball, eh? That\'s just my game!',14250,1,0,0,'brann SAY_EVENT_A_3'), + +(-1599031,'Couple more minutes and I\'ll--',14251,1,0,0,'brann SAY_EVENT_B_1'), +(-1599032,'Threat index threshold exceeded. Celestial archive aborted. Security level heightened.',13761,1,0,0,'brann SAY_EVENT_B_2_MARN'), +(-1599033,'Heightened? What\'s the good news?',14252,1,0,0,'brann SAY_EVENT_B_3'), + +(-1599034,'So that was the problem? Now I\'m makin\' progress...',14253,1,0,0,'brann SAY_EVENT_C_1'), +(-1599035,'Critical threat index. Void analysis diverted. Initiating sanitization protocol.',13767,1,0,0,'brann SAY_EVENT_C_2_ABED'), +(-1599036,'Hang on! Nobody\'s gonna\' be sanitized as long as I have a say in it!',14254,1,0,0,'brann SAY_EVENT_C_3'), + +(-1599037,'Ha! The old magic fingers finally won through! Now let\'s get down to-',14255,1,0,0,'brann SAY_EVENT_D_1'), +(-1599038,'Alert! Security fail safes deactivated. Beginning memory purge...',13768,1,0,0,'brann SAY_EVENT_D_2_ABED'), +(-1599039,'Purge? No no no no no! Where did I-- Aha, this should do the trick...',14256,1,0,0,'brann SAY_EVENT_D_3'), +(-1599040,'System online. Life form pattern recognized. Welcome Branbronzan. Query?',13769,1,0,0,'brann SAY_EVENT_D_4_ABED'), + +(-1599041,'Query? What do you think I’m here for? Tea and biscuits? Spill the beans already!',14263,1,0,0,'brann SAY_EVENT_END_01'), +(-1599042,'Tell me how that dwarfs came to be! And start at the beginning!',14264,1,0,0,'brann SAY_EVENT_END_02'), +(-1599043,'Accessing prehistoric data. Retrieved. In the beginning Earthen were created to-',13770,1,0,0,'brann SAY_EVENT_END_03_ABED'), +(-1599044,'Right, right! I know that the Earthen were made of stone to shape the deep reaches of the world but what about the anomalies? Matrix non-stabilizing and whatnot.',14265,1,0,0,'brann SAY_EVENT_END_04'), +(-1599045,'Accessing. In the early stages of its development cycle Azeroth suffered infection by parasitic, necrophotic symbiotes.',13771,1,0,0,'brann SAY_EVENT_END_05_ABED'), +(-1599046,'Necro-what? Speak bloody common will ya?',14266,1,0,0,'brann SAY_EVENT_END_06'), +(-1599047,'Designation: Old Gods. Old Gods rendered all systems, including Earthen defenseless in order to facilitate assimilation. This matrix destabilization has been termed the Curse of Flesh. Effects of destabilization increased over time.',13772,1,0,0,'brann SAY_EVENT_END_07_ABED'), +(-1599048,'Old Gods eh? So they zapped the Earthen with this Curse of Flesh. And then what?',14267,1,0,0,'brann SAY_EVENT_END_08'), +(-1599049,'Accessing. Creators arrived to extirpate symbiotic infection. Assessment revealed that Old God infestation had grown malignant. Excising parasites would result in loss of host.',13757,1,0,0,'brann SAY_EVENT_END_09_KADD'), +(-1599050,'If they killed the Old Gods Azeroth would have been destroyed.',14268,1,0,0,'brann SAY_EVENT_END_10'), +(-1599051,'Correct. Creators neutralized parasitic threat and contained it within the host. Forge of Wills and other systems were instituted to create new Earthen. Safeguards were implemented and protectors were appointed.',13758,1,0,0,'brann SAY_EVENT_END_11_KADD'), +(-1599052,'What protectors?',14269,1,0,0,'brann SAY_EVENT_END_12'), +(-1599053,'Designations: Aesir and Vanir or in common nomenclator Storm and Earth Giants. Sentinel Loken designated supreme. Dragon Aspects appointed to monitor evolution of Azeroth.',13759,1,0,0,'brann SAY_EVENT_END_13_KADD'), +(-1599054,'Aesir and Vanir. Okay. So the Forge of Wills started to make new Earthen. But what happened to the old ones?',14270,1,0,0,'brann SAY_EVENT_END_14'), +(-1599055,'Additional background is relevant to your query. Following global combat between-',13262,1,0,0,'brann SAY_EVENT_END_15_MARN'), +(-1599056,'Hold everything! The Aesir and Vanir went to war? Why?',14271,1,0,0,'brann SAY_EVENT_END_16'), +(-1599057,'Unknown. Data suggests that impetus for global combat originated with prime designate Loken who neutralized all remaining Aesir and Vanir affecting termination of conflict. Prime designate Loken then initiated stasis of several seed races including Earthen, Giant and Vrykul at designated holding facilities.',13263,1,0,0,'brann SAY_EVENT_END_17_MARN'), +(-1599058,'This Loken sounds like a nasty character. Glad we don’t have to worry about the likes of him anymore. So if I’m understanding you lads the original Earthen eventually woke up from this statis. And by that time this destabily-whatever had turned them into our brother dwarfs. Or at least dwarf ancestors. Hm?',14272,1,0,0,'brann SAY_EVENT_END_18'), +(-1599059,'Essentially that is correct.',13764,1,0,0,'brann SAY_EVENT_END_19_MARN'), +(-1599060,'Well now. That’s a lot to digest. I’m gonna need some time to take all of this in. Thank you!',14273,1,0,0,'brann SAY_EVENT_END_20'), +(-1599061,'Acknowledged Branbronzan. Session terminated.',13773,1,0,0,'brann SAY_EVENT_END_21_ABED'), + +(-1599062,'Loken?! That\'s downright bothersome... We might\'ve neutralized the iron dwarves, but I\'d lay odds there\'s another machine somewhere else churnin\' out a whole mess o\' these iron vrykul!',14278,1,0,0,'brann SAY_VICTORY_SJONNIR_1'), +(-1599063,'I\'ll use the forge to make badtches o\' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!',14279,1,0,0,'brann SAY_VICTORY_SJONNIR_2'), + +(-1599064,'I think it\'s time to see what\'s behind the door near the entrance. I\'m going to sneak over there, nice and quiet. Meet me at the door and I\'ll get us in.',0,1,0,0,'brann SAY_ENTRANCE_MEET'); + +DELETE FROM script_waypoint WHERE entry=28070; +INSERT INTO script_waypoint VALUES +(28070, 0, 1053.789795, 476.639343, 207.744, 0, ''), +(28070, 1, 1032.293945, 467.623444, 207.736, 0, ''), +(28070, 2, 1017.908752, 454.765656, 207.719, 0, ''), +(28070, 3, 1004.810120, 441.305115, 207.373, 0, ''), +(28070, 4, 988.694214, 424.422485, 207.425, 0, ''), +(28070, 5, 984.816345, 422.177917, 205.994, 0, ''), +(28070, 6, 977.204468, 420.026917, 205.994, 0, ''), +(28070, 7, 962.388123, 421.983307, 205.994, 0, ''), +(28070, 8, 950.419556, 416.515198, 205.994, 0, ''), +(28070, 9, 943.972290, 403.071228, 205.994, 0, ''), +(28070, 10, 947.921936, 387.683563, 205.994, 0, ''), +(28070, 11, 946.554749, 383.270782, 205.994, 0, ''), +(28070, 12, 944.654724, 380.630859, 207.286, 0, ''), +(28070, 13, 941.101563, 377.373413, 207.421, 0, 'reach tribunal, set pause'), +(28070, 14, 935.217896, 370.557343, 207.421, 0, ''), +(28070, 15, 928.035950, 363.026733, 204.018, 0, ''), +(28070, 16, 909.287292, 344.392792, 203.706, 0, ''), +(28070, 17, 897.946838, 333.634735, 203.706, 0, 'reach panel'), +(28070, 18, 918.914429, 351.312866, 203.706, 0, 'reach floor disc (end event begin)'), +(28070, 19, 928.070068, 363.296326, 204.091, 0, 'stealth'), +(28070, 20, 934.817627, 370.136261, 207.421, 0, ''), +(28070, 21, 941.501465, 377.254456, 207.421, 0, ''); diff --git a/sql/Updates/0.0.3/r1413_mangos.sql b/sql/Updates/0.0.3/r1413_mangos.sql new file mode 100644 index 0000000..b1949c3 --- /dev/null +++ b/sql/Updates/0.0.3/r1413_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='boss_anubarak' WHERE entry=29120; +UPDATE creature_template SET ScriptName='boss_hadronox' WHERE entry=28921; +UPDATE creature_template SET ScriptName='boss_krikthir' WHERE entry=28684; diff --git a/sql/Updates/0.0.3/r1413_scriptdev2.sql b/sql/Updates/0.0.3/r1413_scriptdev2.sql new file mode 100644 index 0000000..b70b9fd --- /dev/null +++ b/sql/Updates/0.0.3/r1413_scriptdev2.sql @@ -0,0 +1,28 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1601024 AND -1601000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1601000,'This kingdom belongs to the Scourge! Only the dead may enter.',14075,1,0,0,'krikthir SAY_AGGRO'), +(-1601001,'???',14076,1,0,0,'krikthir SAY_KILL_1'), +(-1601002,'You were foolish to come.',14077,1,0,0,'krikthir SAY_KILL_2'), +(-1601003,'As Anub\'Arak commands!',14078,1,0,0,'krikthir SAY_KILL_3'), +(-1601004,'We are besieged. Strike out and bring back their corpses!',14079,1,0,0,'krikthir SAY_SEND_GROUP_1'), +(-1601005,'We must hold the gate. Attack! Tear them limb from limb!',14080,1,0,0,'krikthir SAY_SEND_GROUP_2'), +(-1601006,'The gate must be protected at all costs. Rip them to shreds!',14081,1,0,0,'krikthir SAY_SEND_GROUP_3'), +(-1601007,'Keep an eye on the tunnel. We must not let anyone through!',14082,1,0,0,'krikthir SAY_PREFIGHT_1'), +(-1601008,'I hear footsteps. Be on your guard.',14083,1,0,0,'krikthir SAY_PREFIGHT_2'), +(-1601009,'I sense the living. Be ready.',14084,1,0,0,'krikthir SAY_PREFIGHT_3'), +(-1601010,'They hunger.',14085,1,0,0,'krikthir SAY_SWARM_1'), +(-1601011,'Dinner time, my pets.',14086,1,0,0,'krikthir SAY_SWARM_2'), +(-1601012,'I should be grateful. But I long ago lost the capacity.',14087,1,0,0,'krikthir SAY_DEATH'), +(-1601013,'%s goes into a frenzy!',0,3,0,0,'krikthir EMOTE_FRENZY'), + +(-1601014,'I was king of this empire once, long ago. In life I stood as champion. In death I returned as conqueror. Now I protect the kingdom once more. Ironic, yes?',14053,1,0,0,'anubarak SAY_INTRO'), +(-1601015,'Eternal agony awaits you!',14054,1,0,0,'anubarak SAY_AGGRO'), +(-1601016,'You shall experience my torment, first-hand!',14055,1,0,0,'anubarak SAY_KILL_1'), +(-1601017,'You have made your choice.',14056,1,0,0,'anubarak SAY_KILL_2'), +(-1601018,'Soon, the Master\'s voice will call to you.',14057,1,0,0,'anubarak SAY_KILL_3'), +(-1601019,'Come forth, my brethren. Feast on their flesh!',14058,1,0,0,'anubarak SAY_SUBMERGE_1'), +(-1601020,'Auum na-l ak-k-k-k, isshhh.',14059,1,0,0,'anubarak SAY_SUBMERGE_2'), +(-1601021,'Your armor is useless against my locusts!',14060,1,0,0,'anubarak SAY_LOCUST_1'), +(-1601022,'The pestilence upon you!',14067,1,0,0,'anubarak SAY_LOCUST_2'), +(-1601023,'Uunak-hissss tik-k-k-k-k!',14068,1,0,0,'anubarak SAY_LOCUST_3'), +(-1601024,'Ahhh... RAAAAAGH! Never thought... I would be free of him...',14069,1,0,0,'anubarak SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r1414_mangos.sql b/sql/Updates/0.0.3/r1414_mangos.sql new file mode 100644 index 0000000..8a78c91 --- /dev/null +++ b/sql/Updates/0.0.3/r1414_mangos.sql @@ -0,0 +1,5 @@ +UPDATE creature_template SET ScriptName='boss_jedoga' WHERE entry=29310; +UPDATE creature_template SET ScriptName='boss_nadox' WHERE entry=29309; +UPDATE creature_template SET ScriptName='boss_taldaram' WHERE entry=29308; +UPDATE gameobject_template SET ScriptName='go_nerubian_device' WHERE entry IN (193093,193094); +UPDATE creature_template SET ScriptName='boss_volazj' WHERE entry=29311; diff --git a/sql/Updates/0.0.3/r1414_scriptdev2.sql b/sql/Updates/0.0.3/r1414_scriptdev2.sql new file mode 100644 index 0000000..3bc4137 --- /dev/null +++ b/sql/Updates/0.0.3/r1414_scriptdev2.sql @@ -0,0 +1,42 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1619039 AND -1619000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1619000,'The secrets of the deep shall remain hidden.',14033,1,0,0,'nadox SAY_AGGRO'), +(-1619001,'The young must not grow hungry...',14034,1,0,0,'nadox SAY_SUMMON_EGG_1'), +(-1619002,'Shhhad ak kereeesshh chak-k-k!',14035,1,0,0,'nadox SAY_SUMMON_EGG_2'), +(-1619003,'Sleep now, in the cold dark.',14036,1,0,0,'nadox SAY_SLAY_1'), +(-1619004,'For the Lich King!',14037,1,0,0,'nadox SAY_SLAY_2'), +(-1619005,'Perhaps we will be allies soon.',14038,1,0,0,'nadox SAY_SLAY_3'), +(-1619006,'Master, is my service complete?',14039,1,0,0,'nadox SAY_DEATH'), +(-1619007,'An Ahn\'kahar Guardian hatches!',0,3,0,0,'nadox EMOTE_HATCH'), +(-1619008,'I will feast on your remains.',14360,1,0,0,'taldaram SAY_AGGRO'), +(-1619009,'Your heartbeat is music to my ears.',14361,1,0,0,'taldaram SAY_VANISH_1'), +(-1619010,'I am nowhere. I am everywhere. I am the watcher, unseen.',14362,1,0,0,'taldaram SAY_VANISH_2'), +(-1619011,'So appetizing.',14363,1,0,0,'taldaram SAY_FEED_1'), +(-1619012,'Fresh, warm blood. It has been too long.',14364,1,0,0,'taldaram SAY_FEED_2'), +(-1619013,'Bin-dor\'el',14365,1,0,0,'taldaram SAY_SLAY_1'), +(-1619014,'I will drink no blood before it\'s time.',14366,1,0,0,'taldaram SAY_SLAY_2'), +(-1619015,'One final embrace.',14367,1,0,0,'taldaram SAY_SLAY_3'), +(-1619016,'Still I hunger, still I thirst.',14368,1,0,0,'taldaram SAY_DEATH'), +(-1619017,'These are sacred halls! Your intrusion will be met with death.',14343,1,0,0,'jedoga SAY_AGGRO'), +(-1619018,'Who among you is devoted?',14344,1,0,0,'jedoga SAY_CALL_SACRIFICE_1'), +(-1619019,'You there! Step forward!',14345,1,0,0,'jedoga SAY_CALL_SACRIFICE_2'), +(-1619020,'Yogg-Saron, grant me your power!',14346,1,0,0,'jedoga SAY_SACRIFICE_1'), +(-1619021,'Master, a gift for you!',14347,1,0,0,'jedoga SAY_SACRIFICE_2'), +(-1619022,'Glory to Yogg-Saron!',14348,1,0,0,'jedoga SAY_SLAY_1'), +(-1619023,'You are unworthy!',14349,1,0,0,'jedoga SAY_SLAY_2'), +(-1619024,'Get up! You haven\'t suffered enough.',14350,1,0,0,'jedoga SAY_SLAY_3'), +(-1619025,'Do not expect your sacrilege... to go unpunished.',14351,1,0,0,'jedoga SAY_DEATH'), +(-1619026,'The elements themselves will rise up against the civilized world! Only the faithful will be spared!',14352,1,0,0,'jedoga SAY_PREACHING_1'), +(-1619027,'Immortality can be yours. But only if you pledge yourself fully to Yogg-Saron!',14353,1,0,0,'jedoga SAY_PREACHING_2'), +(-1619028,'Here on the very borders of his domain. You will experience powers you would never have imagined! ',14354,1,0,0,'jedoga SAY_PREACHING_3'), +(-1619029,'You have traveled long and risked much to be here. Your devotion shall be rewarded.',14355,1,0,0,'jedoga SAY_PREACHING_4'), +(-1619030,'The faithful shall be exalted! But there is more work to be done. We will press on until all of Azeroth lies beneath his shadow!',14356,1,0,0,'jedoga SAY_PREACHING_5'), +(-1619031,'I have been chosen!',0,1,0,0,'jedoga SAY_VOLUNTEER_1'), +(-1619032,'I give myself to the master!',0,1,0,0,'jedoga SAY_VOLUNTEER_2'), +(-1619033,'Shgla\'yos plahf mh\'naus.',14043,1,0,0,'volazj SAY_AGGRO'), +(-1619034,' ',14044,1,0,0,'volazj SAY_INSANITY'), +(-1619035,' ',14045,1,0,0,'volazj SAY_SLAY_1'), +(-1619036,' ',14046,1,0,0,'volazj SAY_SLAY_2'), +(-1619037,' ',14047,1,0,0,'volazj SAY_SLAY_3'), +(-1619038,' ',14048,1,0,0,'volazj SAY_DEATH_1'), +(-1619039,' ',14049,1,0,0,'volazj SAY_DEATH_2'); diff --git a/sql/Updates/0.0.3/r1415_mangos.sql b/sql/Updates/0.0.3/r1415_mangos.sql new file mode 100644 index 0000000..7f65569 --- /dev/null +++ b/sql/Updates/0.0.3/r1415_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_lunaclaw_spirit' WHERE entry=12144; diff --git a/sql/Updates/0.0.3/r1417_mangos.sql b/sql/Updates/0.0.3/r1417_mangos.sql new file mode 100644 index 0000000..da54d5b --- /dev/null +++ b/sql/Updates/0.0.3/r1417_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_loklira_the_crone' WHERE entry=29975; diff --git a/sql/Updates/0.0.3/r1418_scriptdev2.sql b/sql/Updates/0.0.3/r1418_scriptdev2.sql new file mode 100644 index 0000000..6f1950e --- /dev/null +++ b/sql/Updates/0.0.3/r1418_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8524+) '; diff --git a/sql/Updates/0.0.3/r1419_mangos.sql b/sql/Updates/0.0.3/r1419_mangos.sql new file mode 100644 index 0000000..1fdb69e --- /dev/null +++ b/sql/Updates/0.0.3/r1419_mangos.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET ScriptName='go_gundrak_altar' WHERE entry IN (192518, 192519, 192520); +UPDATE instance_template SET script='instance_gundrak' WHERE map=604; diff --git a/sql/Updates/0.0.3/r1421_scriptdev2.sql b/sql/Updates/0.0.3/r1421_scriptdev2.sql new file mode 100644 index 0000000..a7fe6ea --- /dev/null +++ b/sql/Updates/0.0.3/r1421_scriptdev2.sql @@ -0,0 +1,2 @@ +UPDATE script_texts SET sound=13762 WHERE entry=-1599055; +UPDATE script_texts SET sound=13763 WHERE entry=-1599057; diff --git a/sql/Updates/0.0.3/r1422_mangos.sql b/sql/Updates/0.0.3/r1422_mangos.sql new file mode 100644 index 0000000..474ad50 --- /dev/null +++ b/sql/Updates/0.0.3/r1422_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_spirit_guide' WHERE entry IN (13116, 13117); diff --git a/sql/Updates/0.0.3/r1422_scriptdev2.sql b/sql/Updates/0.0.3/r1422_scriptdev2.sql new file mode 100644 index 0000000..f7c7b43 --- /dev/null +++ b/sql/Updates/0.0.3/r1422_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8555+) '; diff --git a/sql/Updates/0.0.3/r1428_scriptdev2.sql b/sql/Updates/0.0.3/r1428_scriptdev2.sql new file mode 100644 index 0000000..1a5cf05 --- /dev/null +++ b/sql/Updates/0.0.3/r1428_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE script_texts SET type=3 WHERE entry=-1249004; diff --git a/sql/Updates/0.0.3/r1430_mangos.sql b/sql/Updates/0.0.3/r1430_mangos.sql new file mode 100644 index 0000000..3125cd7 --- /dev/null +++ b/sql/Updates/0.0.3/r1430_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_crystal_prison' WHERE entry=185126; diff --git a/sql/Updates/0.0.3/r1433_mangos.sql b/sql/Updates/0.0.3/r1433_mangos.sql new file mode 100644 index 0000000..f2db5d6 --- /dev/null +++ b/sql/Updates/0.0.3/r1433_mangos.sql @@ -0,0 +1,2 @@ +UPDATE instance_template SET Script='instance_nexus' WHERE map=576; +UPDATE gameobject_template SET ScriptName='go_containment_sphere' WHERE entry IN (188526, 188527, 188528); diff --git a/sql/Updates/0.0.3/r1435_mangos.sql b/sql/Updates/0.0.3/r1435_mangos.sql new file mode 100644 index 0000000..52e9e15 --- /dev/null +++ b/sql/Updates/0.0.3/r1435_mangos.sql @@ -0,0 +1,5 @@ +DELETE FROM areatrigger_scripts WHERE entry IN (4871, 4872, 4873); +INSERT INTO areatrigger_scripts VALUES +(4871,'at_warsong_grainery'), +(4872,'at_torp_farm'), +(4873,'at_warsong_slaughterhouse'); diff --git a/sql/Updates/0.0.3/r1436_mangos.sql b/sql/Updates/0.0.3/r1436_mangos.sql new file mode 100644 index 0000000..a8b443a --- /dev/null +++ b/sql/Updates/0.0.3/r1436_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_thorim' WHERE entry=29445; diff --git a/sql/Updates/0.0.3/r1437_scriptdev2.sql b/sql/Updates/0.0.3/r1437_scriptdev2.sql new file mode 100644 index 0000000..d74f909 --- /dev/null +++ b/sql/Updates/0.0.3/r1437_scriptdev2.sql @@ -0,0 +1,10 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000550 AND -1000543; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000543,'Why have you come here, outsider? You will only find pain! Our fate will be yours...',0,0,0,25,'restless app SAY_RAND_1'), +(-1000544,'It was ... terrible... the demon...',0,0,0,25,'restless app SAY_RAND_2'), +(-1000545,'The darkness... the corruption... they came too quickly for anyone to know...',0,0,0,25,'restless app SAY_RAND_3'), +(-1000546,'The darkness will consume all... all the living...',0,0,0,25,'restless app SAY_RAND_4'), +(-1000547,'It is too late for us, living one. Take yourself and your friend away from here before you both are... claimed...',0,0,0,25,'restless app SAY_RAND_5'), +(-1000548,'It is too late for Jarl... its hold is too strong...',0,0,0,25,'restless app SAY_RAND_6'), +(-1000549,'Go away, whoever you are! Witch Hill is mine... mine!',0,0,0,25,'restless app SAY_RAND_7'), +(-1000550,'The manor... someone else... will soon be consumed...',0,0,0,25,'restless app SAY_RAND_8'); diff --git a/sql/Updates/0.0.3/r1439_scriptdev2.sql b/sql/Updates/0.0.3/r1439_scriptdev2.sql new file mode 100644 index 0000000..f330a49 --- /dev/null +++ b/sql/Updates/0.0.3/r1439_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1576022 AND -1576021; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1576021,'%s opens a Chaotic Rift!',0,3,0,0,'anomalus EMOTE_OPEN_RIFT'), +(-1576022,'%s shields himself and divert his power to the rifts!',0,3,0,0,'anomalus EMOTE_SHIELD'); diff --git a/sql/Updates/0.0.3/r1441_mangos.sql b/sql/Updates/0.0.3/r1441_mangos.sql new file mode 100644 index 0000000..b68fe41 --- /dev/null +++ b/sql/Updates/0.0.3/r1441_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_deathstalker_razael' WHERE entry=23998; +UPDATE creature_template SET ScriptName='npc_dark_ranger_lyana' WHERE entry=23778; diff --git a/sql/Updates/0.0.3/r814_scriptdev2_eventai_scripts.sql b/sql/Updates/0.0.3/r814_scriptdev2_eventai_scripts.sql new file mode 100644 index 0000000..3aa1b6f --- /dev/null +++ b/sql/Updates/0.0.3/r814_scriptdev2_eventai_scripts.sql @@ -0,0 +1,18 @@ +ALTER TABLE `eventai_scripts` + CHANGE COLUMN `creature_id` `creature_id` mediumint unsigned NOT NULL DEFAULT 0 COMMENT 'Creature Template Identifier', + CHANGE COLUMN `event_type` `event_type` tinyint unsigned NOT NULL DEFAULT 0 COMMENT 'Event Type', + CHANGE COLUMN `event_inverse_phase_mask` `event_inverse_phase_mask` int NOT NULL DEFAULT 0 COMMENT 'Mask which phases this event will not trigger in', + CHANGE COLUMN `event_chance` `event_chance` tinyint unsigned NOT NULL DEFAULT 100, + CHANGE COLUMN `event_flags` `event_flags` tinyint unsigned NOT NULL DEFAULT 0, + CHANGE COLUMN `action1_param1` `action1_param1` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action1_param2` `action1_param2` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action1_param3` `action1_param3` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action1_type` `action1_type` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Action Type', + CHANGE COLUMN `action2_param1` `action2_param1` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action2_param2` `action2_param2` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action2_param3` `action2_param3` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action2_type` `action2_type` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Action Type', + CHANGE COLUMN `action3_param1` `action3_param1` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action3_param2` `action3_param2` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action3_param3` `action3_param3` int NOT NULL DEFAULT 0, + CHANGE COLUMN `action3_type` `action3_type` tinyint(3) unsigned NOT NULL DEFAULT 0 COMMENT 'Action Type'; diff --git a/sql/Updates/0.0.3/r820_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r820_scriptdev2_script_texts.sql new file mode 100644 index 0000000..9b102b2 --- /dev/null +++ b/sql/Updates/0.0.3/r820_scriptdev2_script_texts.sql @@ -0,0 +1,42 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533039 AND -1533000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1533000,'Ahh... welcome to my parlor.',8788,1,0,'anubrekhan SAY_GREET'), +(-1533001,'Just a little taste...',8785,1,0,'anubrekhan SAY_AGGRO1'), +(-1533002,'There is no way out.',8786,1,0,'anubrekhan SAY_AGGRO2'), +(-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,'anubrekhan SAY_AGGRO3'), +(-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,'anubrekhan SAY_TAUNT1'), +(-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,'anubrekhan SAY_TAUNT2'), +(-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,'anubrekhan SAY_TAUNT3'), +(-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,'anubrekhan SAY_TAUNT4'), +(-1533008,'Shh... it will all be over soon.',8789,1,0,'anubrekhan SAY_SLAY'), +(-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,'faerlina SAY_GREET'), +(-1533010,'Slay them in the master\'s name!',8794,1,0,'faerlina SAY_AGGRO1'), +(-1533011,'You cannot hide from me!',8795,1,0,'faerlina SAY_AGGRO2'), +(-1533012,'Kneel before me, worm!',8796,1,0,'faerlina SAY_AGGRO3'), +(-1533013,'Run while you still can!',8797,1,0,'faerlina SAY_AGGRO4'), +(-1533014,'You have failed!',8800,1,0,'faerlina SAY_SLAY1'), +(-1533015,'Pathetic wretch!',8801,1,0,'faerlina SAY_SLAY2'), +(-1533016,'The master... will avenge me!',8798,1,0,'faerlina SAY_DEATH'), +(-1533017,'Patchwerk want to play!',8909,1,0,'patchwerk SAY_AGGRO1'), +(-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,'patchwerk SAY_AGGRO2'), +(-1533019,'No more play?',8912,1,0,'patchwerk SAY_SLAY'), +(-1533020,'What happened to... Patch...',8911,1,0,'patchwerk SAY_DEATH'), +(-1533021,'goes into a berserker rage!',0,2,0,'patchwerk EMOTE_BERSERK'), +(-1533022,'becomes enraged!',0,2,0,'patchwerk EMOTE_ENRAGE'), +(-1533023,'Stalagg crush you!',8864,1,0,'stalagg SAY_STAL_AGGRO'), +(-1533024,'Stalagg kill!',8866,1,0,'stalagg SAY_STAL_SLAY'), +(-1533025,'Master save me...',8865,1,0,'stalagg SAY_STAL_DEATH'), +(-1533026,'Feed you to master!',8802,1,0,'feugen SAY_FEUG_AGGRO'), +(-1533027,'Feugen make master happy!',8804,1,0,'feugen SAY_FEUG_SLAY'), +(-1533028,'No... more... Feugen...',8803,1,0,'feugen SAY_FEUG_DEATH'), +(-1533029,'You are too late... I... must... OBEY!',8872,1,0,'thaddius SAY_GREET'), +(-1533030,'KILL!',8867,1,0,'thaddius SAY_AGGRO1'), +(-1533031,'EAT YOUR BONES!',8868,1,0,'thaddius SAY_AGGRO2'), +(-1533032,'BREAK YOU!',8869,1,0,'thaddius SAY_AGGRO3'), +(-1533033,'You die now!',8877,1,0,'thaddius SAY_SLAY'), +(-1533034,'Now YOU feel pain!',8871,1,0,'thaddius SAY_ELECT'), +(-1533035,'Thank... you...',8870,1,0,'thaddius SAY_DEATH'), +(-1533036,'Pleeease!',8873,1,0,'thaddius SAY_SCREAM1'), +(-1533037,'Stop, make it stop!',8874,1,0,'thaddius SAY_SCREAM2'), +(-1533038,'Help me! Save me!',8875,1,0,'thaddius SAY_SCREAM3'), +(-1533039,'Please, nooo!',8876,1,0,'thaddius SAY_SCREAM4'); diff --git a/sql/Updates/0.0.3/r822_mangos.sql b/sql/Updates/0.0.3/r822_mangos.sql new file mode 100644 index 0000000..3eaad22 --- /dev/null +++ b/sql/Updates/0.0.3/r822_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry`=16062; +UPDATE `creature_template` SET `ScriptName`='boss_rivendare_naxx' WHERE `entry`=30549; diff --git a/sql/Updates/0.0.3/r822_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r822_scriptdev2_script_texts.sql new file mode 100644 index 0000000..3ac0bbf --- /dev/null +++ b/sql/Updates/0.0.3/r822_scriptdev2_script_texts.sql @@ -0,0 +1,37 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533074 AND -1533040; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1533040,'Foolishly you have sought your own demise. Brazenly you have disregarded powers beyond your understanding. You have fought hard to invade the realm of the harvester. Now there is only one way out - to walk the lonely path of the damned.',8807,1,0,'gothik SAY_SPEECH'), +(-1533041,'Death is the only escape.',8806,1,0,'gothik SAY_KILL'), +(-1533042,'I... am... undone!',8805,1,0,'gothik SAY_DEATH'), +(-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,'gothik SAY_TELEPORT'), +(-1533044,'Defend youself!',8892,1,0,'blaumeux SAY_BLAU_AGGRO'), +(-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,'blaumeux SAY_BLAU_TAUNT1'), +(-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,'blaumeux SAY_BLAU_TAUNT2'), +(-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,'blaumeux SAY_BLAU_TAUNT3'), +(-1533048,'Your life is mine!',8895,1,0,'blaumeux SAY_BLAU_SPECIAL'), +(-1533049,'Who\'s next?',8894,1,0,'blaumeux SAY_BLAU_SLAY'), +(-1533050,'Tou... che!',8893,1,0,'blaumeux SAY_BLAU_DEATH'), +(-1533051,'Come out and fight, ye wee ninny!',8899,1,0,'korthazz SAY_KORT_AGGRO'), +(-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,'korthazz SAY_KORT_TAUNT1'), +(-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,'korthazz SAY_KORT_TAUNT2'), +(-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,'korthazz SAY_KORT_TAUNT3'), +(-1533055,'I like my meat extra crispy!',8901,1,0,'korthazz SAY_KORT_SPECIAl'), +(-1533056,'Next time, bring more friends!',8902,1,0,'korthazz SAY_KORT_SLAY'), +(-1533057,'What a bloody waste this is!',8900,1,0,'korthazz SAY_KORT_DEATH'), +(-1533058,'Flee, before it\'s too late!',8913,1,0,'zeliek SAY_ZELI_AGGRO'), +(-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,'zeliek SAY_ZELI_TAUNT1'), +(-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,'zeliek SAY_ZELI_TAUNT2'), +(-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,'zeliek SAY_ZELI_TAUNT3'), +(-1533062,'I- I have no choice but to obey!',8916,1,0,'zeliek SAY_ZELI_SPECIAL'), +(-1533063,'Forgive me!',8915,1,0,'zeliek SAY_ZELI_SLAY'), +(-1533064,'It is... as it should be.',8914,1,0,'zeliek SAY_ZELI_DEATH'), +(-1533065,'You seek death?',14571,1,0,'rivendare_naxx SAY_RIVE_AGGRO1'), +(-1533066,'None shall pass!',14572,1,0,'rivendare_naxx SAY_RIVE_AGGRO2'), +(-1533067,'Be still!',14573,1,0,'rivendare_naxx SAY_RIVE_AGGRO3'), +(-1533068,'You will find no peace in death.',14574,1,0,'rivendare_naxx SAY_RIVE_SLAY1'), +(-1533069,'The master\'s will is done.',14575,1,0,'rivendare_naxx SAY_RIVE_SLAY2'), +(-1533070,'Bow to the might of the scourge!',14576,1,0,'rivendare_naxx SAY_RIVE_SPECIAL'), +(-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,'rivendare_naxx SAY_RIVE_TAUNT1'), +(-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,'rivendare_naxx SAY_RIVE_TAUNT2'), +(-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,'rivendare_naxx SAY_RIVE_TAUNT3'), +(-1533074,'Death... will not stop me...',14580,1,0,'rivendare_naxx SAY_RIVE_DEATH'); diff --git a/sql/Updates/0.0.3/r823_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r823_scriptdev2_script_texts.sql new file mode 100644 index 0000000..d909d9f --- /dev/null +++ b/sql/Updates/0.0.3/r823_scriptdev2_script_texts.sql @@ -0,0 +1,36 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1533108 AND -1533075; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1533075,'Glory to the master!',8845,1,0,'noth SAY_AGGRO1'), +(-1533076,'Your life is forfeit!',8846,1,0,'noth SAY_AGGRO2'), +(-1533077,'Die, trespasser!',8847,1,0,'noth SAY_AGGRO3'), +(-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,'noth SAY_SUMMON'), +(-1533079,'My task is done!',8849,1,0,'noth SAY_SLAY1'), +(-1533080,'Breathe no more!',8850,1,0,'noth SAY_SLAY2'), +(-1533081,'I will serve the master... in... death!',8848,1,0,'noth SAY_DEATH'), +(-1533082,'takes in a deep breath...',0,2,0,'sapphiron EMOTE_BREATH'), +(-1533083,'enrages!',0,2,0,'sapphiron EMOTE_ENRAGE'), +(-1533084,'Our preparations continue as planned, master.',14467,1,0,'kelthuzad SAY_SAPP_DIALOG1'), +(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'), +(-1533086,'I see no complications... Wait... What is this?',14468,1,0,'kelthuzad SAY_SAPP_DIALOG3'), +(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'), +(-1533088,'Yes, master!',14469,1,0,'kelthuzad SAY_SAPP_DIALOG5'), +(-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,'kelthuzad SAY_CAT_DIED'), +(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,1,0,'kelthuzad SAY_TAUNT1'), +(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,1,0,'kelthuzad SAY_TAUNT2'), +(-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,1,0,'kelthuzad SAY_TAUNT3'), +(-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,1,0,'kelthuzad SAY_TAUNT4'), +(-1533094,'Pray for mercy!',14475,1,0,'kelthuzad SAY_AGGRO1'), +(-1533095,'Scream your dying breath!',14476,1,0,'kelthuzad SAY_AGGRO2'), +(-1533096,'The end is upon you!',14477,1,0,'kelthuzad SAY_AGGRO3'), +(-1533097,'The dark void awaits you!',14478,1,0,'kelthuzad SAY_SLAY1'), +(-1533098,'',14479,1,0,'kelthuzad SAY_SLAY2'), +(-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,'kelthuzad SAY_DEATH'), +(-1533100,'Your soul, is bound to me now!',14472,1,0,'kelthuzad SAY_CHAIN1'), +(-1533101,'There will be no escape!',14473,1,0,'kelthuzad SAY_CHAIN2'), +(-1533102,'I will freeze the blood in your veins!',14474,1,0,'kelthuzad SAY_FROST_BLAST'), +(-1533103,'Master! I require aid! ',14470,1,0,'kelthuzad SAY_REQUEST_AID'), +(-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,'kelthuzad SAY_ANSWER_REQUEST'), +(-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,'kelthuzad SAY_SUMMON_MINIONS'), +(-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,'kelthuzad SAY_SPECIAL1_MANA_DET'), +(-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,'kelthuzad SAY_SPECIAL3_MANA_DET'), +(-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,'kelthuzad SAY_SPECIAL2_DISPELL'); diff --git a/sql/Updates/0.0.3/r824_mangos.sql b/sql/Updates/0.0.3/r824_mangos.sql new file mode 100644 index 0000000..60cc624 --- /dev/null +++ b/sql/Updates/0.0.3/r824_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_ranger_lilatha' WHERE `entry`=16295; diff --git a/sql/Updates/0.0.3/r824_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r824_scriptdev2_script_texts.sql new file mode 100644 index 0000000..4184d24 --- /dev/null +++ b/sql/Updates/0.0.3/r824_scriptdev2_script_texts.sql @@ -0,0 +1,9 @@ +DELETE FROM `script_texts` WHERE `entry` BETWEEN -1000146 AND -1000140; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1000140,'Let\'s go.',0,0,1,'lilatha SAY_START'), +(-1000141,'$N, let\'s use the antechamber to the right.',0,0,1,'lilatha SAY_PROGRESS1'), +(-1000142,'I can see the light at the end of the tunnel!',0,0,1,'lilatha SAY_PROGRESS2'), +(-1000143,'There\'s Farstrider Enclave now, $C. Not far to go... Look out! Troll ambush!!',0,0,1,'lilatha SAY_PROGRESS3'), +(-1000144,'Thank you for saving my life and bringing me back to safety, $N',0,0,1,'lilatha SAY_END1'), +(-1000145,'Captain Helios, I\'ve been rescued from the Amani Catacombs. Reporting for duty, sir!',0,0,1,'lilatha SAY_END2'), +(-1000146,'Liatha, get someone to look at those injuries. Thank you for bringing her back safely.',0,0,1,'lilatha CAPTAIN_ANSWER'); diff --git a/sql/Updates/0.0.3/r825_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r825_scriptdev2_script_texts.sql new file mode 100644 index 0000000..23a74a7 --- /dev/null +++ b/sql/Updates/0.0.3/r825_scriptdev2_script_texts.sql @@ -0,0 +1,2 @@ +UPDATE `script_texts` SET `sound`=8902 WHERE `entry`=-1533055; +UPDATE `script_texts` SET `sound`=8901 WHERE `entry`=-1533056; diff --git a/sql/Updates/0.0.3/r826_scriptdev2.sql b/sql/Updates/0.0.3/r826_scriptdev2.sql new file mode 100644 index 0000000..4705f8b --- /dev/null +++ b/sql/Updates/0.0.3/r826_scriptdev2.sql @@ -0,0 +1,3 @@ +ALTER TABLE custom_texts ADD COLUMN emote tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER language; +ALTER TABLE eventai_texts ADD COLUMN emote tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER language; +ALTER TABLE script_texts ADD COLUMN emote tinyint(3) UNSIGNED DEFAULT '0' NOT NULL AFTER language; diff --git a/sql/Updates/0.0.3/r827_mangos.sql b/sql/Updates/0.0.3/r827_mangos.sql new file mode 100644 index 0000000..54f4030 --- /dev/null +++ b/sql/Updates/0.0.3/r827_mangos.sql @@ -0,0 +1 @@ +UPDATE `instance_template` SET `script`='instance_blackrock_depths' WHERE `map` =230; diff --git a/sql/Updates/0.0.3/r828_mangos.sql b/sql/Updates/0.0.3/r828_mangos.sql new file mode 100644 index 0000000..66a811a --- /dev/null +++ b/sql/Updates/0.0.3/r828_mangos.sql @@ -0,0 +1,5 @@ +UPDATE `creature_template` SET `ScriptName`='npc_grimstone' WHERE `entry`=10096; +UPDATE `creature_template` SET `ScriptName`='mob_phalanx' WHERE `entry`=9502; + +DELETE FROM `areatrigger_scripts` WHERE `entry`=1526; +INSERT INTO `areatrigger_scripts` VALUES (1526,'at_ring_of_law'); diff --git a/sql/Updates/0.0.3/r834_mangos.sql b/sql/Updates/0.0.3/r834_mangos.sql new file mode 100644 index 0000000..4dfc9b3 --- /dev/null +++ b/sql/Updates/0.0.3/r834_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_rocknot' WHERE `entry`=9503; diff --git a/sql/Updates/0.0.3/r834_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r834_scriptdev2_script_texts.sql new file mode 100644 index 0000000..e74291a --- /dev/null +++ b/sql/Updates/0.0.3/r834_scriptdev2_script_texts.sql @@ -0,0 +1,3 @@ +DELETE FROM `script_texts` WHERE `entry`=-1230000; +INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES +(-1230000,'Ah, hits the spot!',0,0,0,'rocknot SAY_GOT_BEER'); diff --git a/sql/Updates/0.0.3/r835_mangos.sql b/sql/Updates/0.0.3/r835_mangos.sql new file mode 100644 index 0000000..75a3d3b --- /dev/null +++ b/sql/Updates/0.0.3/r835_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='mob_toxic_sporebat' WHERE `entry`=22140; diff --git a/sql/Updates/0.0.3/r845_mangos.sql b/sql/Updates/0.0.3/r845_mangos.sql new file mode 100644 index 0000000..f6323a8 --- /dev/null +++ b/sql/Updates/0.0.3/r845_mangos.sql @@ -0,0 +1,2 @@ +UPDATE `creature_template` SET `ScriptName`='boss_warchief_kargath_bladefist' WHERE `entry`=16808; +UPDATE `creature_template` SET `ScriptName`='mob_karazhan_imp' WHERE `entry`=17267; diff --git a/sql/Updates/0.0.3/r846_scriptdev2.sql b/sql/Updates/0.0.3/r846_scriptdev2.sql new file mode 100644 index 0000000..94394d1 --- /dev/null +++ b/sql/Updates/0.0.3/r846_scriptdev2.sql @@ -0,0 +1,3 @@ +ALTER TABLE custom_texts CHANGE COLUMN emote emote smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE eventai_texts CHANGE COLUMN emote emote smallint(5) unsigned NOT NULL DEFAULT '0'; +ALTER TABLE script_texts CHANGE COLUMN emote emote smallint(5) unsigned NOT NULL DEFAULT '0'; diff --git a/sql/Updates/0.0.3/r847_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r847_scriptdev2_script_texts.sql new file mode 100644 index 0000000..1c12be4 --- /dev/null +++ b/sql/Updates/0.0.3/r847_scriptdev2_script_texts.sql @@ -0,0 +1,8 @@ +UPDATE script_texts SET emote=15 WHERE entry=-1000123; +UPDATE script_texts SET emote=1 WHERE entry=-1560028; +UPDATE script_texts SET emote=1 WHERE entry=-1560031; +UPDATE script_texts SET emote=5 WHERE entry=-1560032; +UPDATE script_texts SET emote=16 WHERE entry=-1000119; +UPDATE script_texts SET emote=254 WHERE entry=-1249002; +UPDATE script_texts SET emote=293 WHERE entry=-1249003; +UPDATE script_texts SET emote=1 WHERE entry=-1033000; diff --git a/sql/Updates/0.0.3/r848_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r848_scriptdev2_script_texts.sql new file mode 100644 index 0000000..48269b0 --- /dev/null +++ b/sql/Updates/0.0.3/r848_scriptdev2_script_texts.sql @@ -0,0 +1,21 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1540047 AND -1540042; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1540042,'Ours is the true Horde! The only Horde!',10323,1,0,0,'kargath SAY_AGGRO1'), +(-1540043,'I\'ll carve the meat from your bones!',10324,1,0,0,'kargath SAY_AGGRO2'), +(-1540044,'I am called Bladefist for a reason, as you will see!',10325,1,0,0,'kargath SAY_AGGRO3'), +(-1540045,'For the real Horde!',10326,1,0,0,'kargath SAY_SLAY1'), +(-1540046,'I am the only Warchief!',10327,1,0,0,'kargath SAY_SLAY2'), +(-1540047,'The true Horde... will.. prevail...',10328,1,0,0,'kargath SAY_DEATH'); + +DELETE FROM script_texts WHERE entry BETWEEN -1533118 AND -1533109; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533109,'You are mine now!',8825,1,0,0,'heigan SAY_AGGRO1'), +(-1533110,'I see you!',8826,1,0,0,'heigan SAY_AGGRO2'), +(-1533111,'You...are next!',8827,1,0,0,'heigan SAY_AGGRO3'), +(-1533112,'Close your eyes... sleep!',8829,1,0,0,'heigan SAY_SLAY'), +(-1533113,'The races of the world will perish. It is only a matter of time.',8830,1,0,0,'heigan SAY_TAUNT1'), +(-1533114,'I see endless suffering, I see torment, I see rage. I see... everything!',8831,1,0,0,'heigan SAY_TAUNT2'), +(-1533115,'Soon... the world will tremble!',8832,1,0,0,'heigan SAY_TAUNT3'), +(-1533116,'The end is upon you.',8833,1,0,0,'heigan SAY_TAUNT4'), +(-1533117,'Hungry worms will feast on your rotten flesh!',8834,1,0,0,'heigan SAY_TAUNT5'), +(-1533118,'Noo... o...',8828,1,0,0,'heigan SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r849_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r849_scriptdev2_script_texts.sql new file mode 100644 index 0000000..bca0ec2 --- /dev/null +++ b/sql/Updates/0.0.3/r849_scriptdev2_script_texts.sql @@ -0,0 +1,16 @@ +DELETE FROM script_texts WHERE entry=-1070000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1070000,'None may steal the secrets of the makers!',5851,1,0,0,'ironaya SAY_AGGRO'); + +DELETE FROM script_texts WHERE entry BETWEEN -1129004 AND -1129000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1129000,'You\'ll never leave this place... alive.',5825,1,0,0,'amnennar SAY_AGGRO'), +(-1129001,'To me, my servants!',5828,1,0,0,'amnennar SAY_SUMMON60'), +(-1129002,'Come, spirits, attend your master!',5829,1,0,0,'amnennar SAY_SUMMON30'), +(-1129003,'I am the hand of the Lich King!',5827,1,0,0,'amnennar SAY_HP'), +(-1129004,'Too...easy!',5826,1,0,0,'amnennar SAY_KILL'); + +DELETE FROM script_texts WHERE entry IN (-1230001,-1230002); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1230001,'Come to aid the Throne!',0,1,0,0,'dagran SAY_AGGRO'), +(-1230002,'Hail to the king, baby!',0,1,0,0,'dagran SAY_SLAY'); diff --git a/sql/Updates/0.0.3/r850_mangos.sql b/sql/Updates/0.0.3/r850_mangos.sql new file mode 100644 index 0000000..addabe9 --- /dev/null +++ b/sql/Updates/0.0.3/r850_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_surristrasz' WHERE entry=24795; +UPDATE creature_template SET ScriptName='npc_tiare' WHERE entry=30051; diff --git a/sql/Updates/0.0.3/r851_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r851_scriptdev2_script_texts.sql new file mode 100644 index 0000000..bb293b6 --- /dev/null +++ b/sql/Updates/0.0.3/r851_scriptdev2_script_texts.sql @@ -0,0 +1,23 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000167 AND -1000147; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000147,'I remember well the sting of defeat at the conclusion of the Third War. I have waited far too long for my revenge. Now the shadow of the Legion falls over this world. It is only a matter of time until all of your failed creation... is undone.',11332,1,0,0,'kazzak SAY_INTRO'), +(-1000148,'The Legion will conquer all!',11333,1,0,0,'kazzak SAY_AGGRO1'), +(-1000149,'All mortals will perish!',11334,1,0,0,'kazzak SAY_AGGRO2'), +(-1000150,'All life must be eradicated!',11335,1,0,0,'kazzak SAY_SURPREME1'), +(-1000151,'I\'ll rip the flesh from your bones!',11336,1,0,0,'kazzak SAY_SURPREME2'), +(-1000152,'Kirel Narak!',11337,1,0,0,'kazzak SAY_KILL1'), +(-1000153,'Contemptible wretch!',11338,1,0,0,'kazzak SAY_KILL2'), +(-1000154,'The universe will be remade.',11339,1,0,0,'kazzak SAY_KILL3'), +(-1000155,'The Legion... will never... fall.',11340,1,0,0,'kazzak SAY_DEATH'), +(-1000156,'%s goes into a frenzy!',0,2,0,0,'kazzak EMOTE_FRENZY'), +(-1000157,'Invaders, you dangle upon the precipice of oblivion! The Burning Legion comes and with it comes your end.',0,1,0,0,'kazzak SAY_RAND1'), +(-1000158,'Impudent whelps, you only delay the inevitable. Where one has fallen, ten shall rise. Such is the will of Kazzak...',0,1,0,0,'kazzak SAY_RAND2'), +(-1000159,'Do not proceed. You will be eliminated!',11344,1,0,0,'doomwalker SAY_AGGRO'), +(-1000160,'Tectonic disruption commencing.',11345,1,0,0,'doomwalker SAY_EARTHQUAKE_1'), +(-1000161,'Magnitude set. Release.',11346,1,0,0,'doomwalker SAY_EARTHQUAKE_2'), +(-1000162,'Trajectory locked.',11347,1,0,0,'doomwalker SAY_OVERRUN_1'), +(-1000163,'Engage maximum speed.',11348,1,0,0,'doomwalker SAY_OVERRUN_2'), +(-1000164,'Threat level zero.',11349,1,0,0,'doomwalker SAY_SLAY_1'), +(-1000165,'Directive accomplished.',11350,1,0,0,'doomwalker SAY_SLAY_2'), +(-1000166,'Target exterminated.',11351,1,0,0,'doomwalker SAY_SLAY_3'), +(-1000167,'System failure in five, f-o-u-r...',11352,1,0,0,'doomwalker SAY_DEATH'); diff --git a/sql/Updates/0.0.3/r852_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r852_scriptdev2_script_texts.sql new file mode 100644 index 0000000..6631443 --- /dev/null +++ b/sql/Updates/0.0.3/r852_scriptdev2_script_texts.sql @@ -0,0 +1,13 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1189021 AND -1189011; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1189011,'Tell me... tell me everything!',5847,1,0,0,'vishas SAY_AGGRO'), +(-1189012,'Naughty secrets!',5849,1,0,0,'vishas SAY_HEALTH1'), +(-1189013,'I\'ll rip the secrets from your flesh!',5850,1,0,0,'vishas SAY_HEALTH2'), +(-1189014,'Purged by pain!',5848,1,0,0,'vishas SAY_KILL'), +(-1189015,'The monster got what he deserved.',0,0,1,0,'vishas SAY_TRIGGER_VORREL'), +(-1189016,'We hunger for vengeance.',5844,1,0,0,'thalnos SAY_AGGRO'), +(-1189017,'No rest, for the angry dead.',5846,1,0,0,'thalnos SAY_HEALTH'), +(-1189018,'More... More souls.',5845,1,0,0,'thalnos SAY_KILL'), +(-1189019,'You will not defile these mysteries!',5842,1,0,0,'doan SAY_AGGRO'), +(-1189020,'Burn in righteous fire!',5843,1,0,0,'doan SAY_SPECIALAE'), +(-1189021,'Release the hounds!',5841,1,0,0,'loksey SAY_AGGRO'); diff --git a/sql/Updates/0.0.3/r854_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r854_scriptdev2_script_texts.sql new file mode 100644 index 0000000..77192e5 --- /dev/null +++ b/sql/Updates/0.0.3/r854_scriptdev2_script_texts.sql @@ -0,0 +1,41 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000206 AND -1000168; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000168,'Who dares awaken Aquementas?',0,1,0,0,'aquementas AGGRO_YELL_AQUE'), +(-1000169,'Muahahahaha! You fool! You\'ve released me from my banishment in the interstices between space and time!',0,1,0,0,'nether_drake SAY_NIHIL_1'), +(-1000170,'All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!',0,1,0,0,'nether_drake SAY_NIHIL_2'), +(-1000171,'Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!',0,1,0,0,'nether_drake SAY_NIHIL_3'), +(-1000172,'No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again.',0,1,0,0,'nether_drake SAY_NIHIL_4'), +(-1000173,'NOOOOooooooo!',0,1,0,0,'nether_drake SAY_NIHIL_INTERRUPT'), +(-1000174,'Good $N, you are under the spell\'s influence. I must analyze it quickly, then we can talk.',0,0,7,0,'daranelle SAY_SPELL_INFLUENCE'), +(-1000175,'Thank you, mortal.',0,0,11,0,' SAY_JUST_EATEN'), +(-1000176,'The last thing I remember is the ship falling and us getting into the pods. I\'ll go see how I can help. Thank you!',0,0,7,0,'draenei_survivor SAY_HEAL1'), +(-1000177,'$C, Where am I? Who are you? Oh no! What happened to the ship?',0,0,7,0,'draenei_survivor SAY_HEAL2'), +(-1000178,'$C You saved me! I owe you a debt that I can never repay. I\'ll go see if I can help the others.',0,0,7,0,'draenei_survivor SAY_HEAL3'), +(-1000179,'Ugh... what is this place? Is that all that\'s left of the ship over there?',0,0,7,0,'draenei_survivor SAY_HEAL4'), +(-1000180,'Oh, the pain...',0,0,7,0,'draenei_survivor SAY_HELP1'), +(-1000181,'Everything hurts, Please make it stop...',0,0,7,0,'draenei_survivor SAY_HELP2'), +(-1000182,'Ughhh... I hurt. Can you help me?',0,0,7,0,'draenei_survivor SAY_HELP3'), +(-1000183,'I don\'t know if I can make it, please help me...',0,0,7,0,'draenei_survivor SAY_HELP4'), +(-1000184,'Yes Master, all goes along as planned.',0,0,7,0,'engineer_spark SAY_TEXT'), +(-1000185,'puts the shell to his ear.',0,2,7,0,'engineer_spark EMOTE_SHELL'), +(-1000186,'Now I cut you!',0,1,7,0,'engineer_spark SAY_ATTACK'), +(-1000187,'Thank you, dear $C, you just saved my life.',0,0,7,0,'faulk SAY_HEAL'), +(-1000188,'Deployment sucessful. Trespassers will be neutralized.',0,0,0,0,'converted_sentry SAY_CONVERTED_1'), +(-1000189,'Objective acquired. Initiating security routines.',0,0,0,0,'converted_sentry SAY_CONVERTED_2'), +(-1000190,'In Nagrand, food hunt ogre!',0,0,0,0,' SAY_LUMP_0'), +(-1000191,'You taste good with maybe a little salt and pepper.',0,0,0,0,' SAY_LUMP_1'), +(-1000192,'OK, OK! Lump give up!',0,0,0,0,' SAY_LUMP_DEFEAT'), +(-1000193,'Thank you, dear $C, you just saved my life.',0,0,1,0,'stillblade SAY_HEAL'), +(-1000194,'I give up! Please don\'t kill me!',0,0,0,0,'unkor SAY_SUBMIT'), +(-1000195,'I choose the third option: KILLING YOU!',0,0,0,0,'floon SAY_FLOON_ATTACK'), +(-1000196,'Belore...',0,0,1,0,'lady_sylvanas SAY_LAMENT_END'), +(-1000197,'kneels down and pick up the amulet.',0,2,1,0,'lady_sylvanas EMOTE_LAMENT_END'), +(-1000198,'Taste blade, mongrel!',0,0,0,0,'SAY_GUARD_SIL_AGGRO1'), +(-1000199,'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...',0,0,0,0,'SAY_GUARD_SIL_AGGRO2'), +(-1000200,'As if we don\'t have enough problems, you go and create more!',0,0,0,0,'SAY_GUARD_SIL_AGGRO3'), +(-1000201,'I\'m saved! Thank you, doctor!',0,0,0,0,'injured_patient SAY_DOC1'), +(-1000202,'HOORAY! I AM SAVED!',0,0,0,0,'injured_patient SAY_DOC2'), +(-1000203,'Sweet, sweet embrace... take me...',0,0,0,0,'injured_patient SAY_DOC3'), +(-1000204,'looks up at you quizzically. Maybe you should inspect it?',0,2,0,0,'cluck EMOTE_A_HELLO'), +(-1000205,'looks at you unexpectadly.',0,2,0,0,'cluck EMOTE_H_HELLO'), +(-1000206,'starts pecking at the feed.',0,2,0,0,'cluck EMOTE_CLUCK_TEXT2'); diff --git a/sql/Updates/0.0.3/r855_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r855_scriptdev2_script_texts.sql new file mode 100644 index 0000000..857e2cd --- /dev/null +++ b/sql/Updates/0.0.3/r855_scriptdev2_script_texts.sql @@ -0,0 +1,26 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000004 AND -1000001; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000001,'goes into a killing frenzy!',0,2,0,0,'EMOTE_GENERIC_FRENZY_KILL'), +(-1000002,'goes into a frenzy!',0,2,0,0,'EMOTE_GENERIC_FRENZY'), +(-1000003,'becomes enraged!',0,2,0,0,'EMOTE_GENERIC_ENRAGED'), +(-1000004,'goes into a berserker rage!',0,2,0,0,'EMOTE_GENERIC_BERSERK'); + +DELETE FROM script_texts WHERE entry BETWEEN -1000216 AND -1000207; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000207,'You have my blessing',0,0,0,0,'ashyen_and_keleth SAY_REWARD_BLESS'), +(-1000208,'Greetings citizen',0,0,7,0,'general_marcus SAY_GREETING'), +(-1000209,'Very well. Let\'s see what you have to show me, $N.',0,0,1,0,'anvilward SAY_ANVIL1'), +(-1000210,'What manner of trick is this, $R? If you seek to ambush me, I warn you I will not go down quietly!',0,0,1,0,'anvilward SAY_ANVIL2'), +(-1000211,'Warning! Emergency shutdown process initiated by $N. Shutdown will complete in two minutes.',0,2,0,0,'manaforge_control EMOTE_START'), +(-1000212,'Emergency shutdown will complete in one minute.',0,2,0,0,'manaforge_control EMOTE_60'), +(-1000213,'Emergency shutdown will complete in thirty seconds.',0,2,0,0,'manaforge_control EMOTE_30'), +(-1000214,'Emergency shutdown will complete in ten seconds.',0,2,0,0,'manaforge_control EMOTE_10'), +(-1000215,'Emergency shutdown complete.',0,2,0,0,'manaforge_control EMOTE_COMPLETE'), +(-1000216,'Emergency shutdown aborted.',0,2,0,0,'manaforge_control EMOTE_ABORT'); + +DELETE FROM script_texts WHERE entry BETWEEN -1329003 AND -1329000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1329000,'Thanks to Egan',0,0,0,0,'freed_soul SAY_ZAPPED0'), +(-1329001,'Rivendare must die',0,0,0,0,'freed_soul SAY_ZAPPED1'), +(-1329002,'Who you gonna call?',0,0,0,0,'freed_soul SAY_ZAPPED2'), +(-1329003,'Don\'t cross those beams!',0,0,0,0,'freed_soul SAY_ZAPPED3'); diff --git a/sql/Updates/0.0.3/r856_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r856_scriptdev2_script_texts.sql new file mode 100644 index 0000000..384c7c3 --- /dev/null +++ b/sql/Updates/0.0.3/r856_scriptdev2_script_texts.sql @@ -0,0 +1,35 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1564129 AND -1564097; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1564097,'Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.',11463,1,0,0,'illidan SAY_CONVO_1'), +(-1564098,'We\'ve come to end your reign, Illidan. My people and all of Outland shall be free!',11389,1,0,25,'illidan SAY_CONVO_2'), +(-1564099,'Boldly said. But I remain unconvinced.',11464,1,0,396,'illidan SAY_CONVO_3'), +(-1564100,'The time has come! The moment is at hand!',11380,1,0,22,'illidan SAY_CONVO_4'), +(-1564101,'You are not prepared!',11466,1,0,406,'illidan SAY_CONVO_5'), +(-1564102,'Is this it, mortals? Is this all the fury you can muster?',11476,1,0,0,'illidan SAY_CONVO_6'), +(-1564103,'Their fury pales before mine, Illidan. We have some unsettled business between us.',11491,1,0,5,'illidan SAY_CONVO_7'), +(-1564104,'Maiev... How is this even possible?',11477,1,0,1,'illidan SAY_CONVO_8'), +(-1564105,'Ah... my long hunt is finally over. Today, Justice will be done!',11492,1,0,15,'illidan SAY_CONVO_9'), +(-1564106,'Feel the hatred of ten thousand years!',11470,1,0,0,'illidan SAY_CONVO_10'), +(-1564107,'Ahh... It is finished. You are beaten.',11496,1,0,0,'illidan SAY_CONVO_11'), +(-1564108,'You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..',11478,1,0,65,'illidan SAY_CONVO_12'), +(-1564109,'He is right. I feel nothing... I am nothing...',11497,1,0,0,'illidan SAY_CONVO_13'), +(-1564110,'Farewell, champions.',11498,1,0,0,'illidan SAY_CONVO_14'), +(-1564111,'The Light will fill these dismal halls once again. I swear it.',11387,1,0,0,'illidan SAY_CONVO_15'), +(-1564112,'I can feel your hatred.',11467,1,0,0,'illidan SAY_TAUNT_1'), +(-1564113,'Give in to your fear!',11468,1,0,0,'illidan SAY_TAUNT_2'), +(-1564114,'You know nothing of power!',11469,1,0,0,'illidan SAY_TAUNT_3'), +(-1564115,'Such... arrogance!',11471,1,0,0,'illidan SAY_TAUNT_4'), +(-1564116,'That is for Naisha!',11493,1,0,0,'illidan SAY_MAIEV_TAUNT_1'), +(-1564117,'Bleed as I have bled!',11494,1,0,0,'illidan SAY_MAIEV_TAUNT_2'), +(-1564118,'There shall be no prison for you this time!',11495,1,0,0,'illidan SAY_MAIEV_TAUNT_3'), +(-1564119,'Meet your end, demon!',11500,1,0,0,'illidan SAY_MAIEV_TAUNT_4'), +(-1564120,'Be wary friends, The Betrayer meditates in the court just beyond.',11388,1,0,0,'illidan SAY_AKAMA_BEWARE'), +(-1564121,'Come, my minions. Deal with this traitor as he deserves!',11465,1,0,0,'illidan SAY_AKAMA_MINION'), +(-1564122,'I\'ll deal with these mongrels. Strike now, friends! Strike at the betrayer!',11390,1,0,0,'illidan SAY_AKAMA_LEAVE'), +(-1564123,'Who shall be next to taste my blades?!',11473,1,0,0,'illidan SAY_KILL1'), +(-1564124,'This is too easy!',11472,1,0,0,'illidan SAY_KILL2'), +(-1564125,'I will not be touched by rabble such as you!',11479,1,0,254,'illidan SAY_TAKEOFF'), +(-1564126,'Behold the flames of Azzinoth!',11480,1,0,0,'illidan SAY_SUMMONFLAMES'), +(-1564127,'Stare into the eyes of the Betrayer!',11481,1,0,0,'illidan SAY_EYE_BLAST'), +(-1564128,'Behold the power... of the demon within!',11475,1,0,0,'illidan SAY_MORPH'), +(-1564129,'You\'ve wasted too much time mortals, now you shall fall!',11474,1,0,0,'illidan SAY_ENRAGE'); diff --git a/sql/Updates/0.0.3/r860_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r860_scriptdev2_script_texts.sql new file mode 100644 index 0000000..aa29771 --- /dev/null +++ b/sql/Updates/0.0.3/r860_scriptdev2_script_texts.sql @@ -0,0 +1,28 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1999925 AND -1999900; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1999900,'Let the games begin.',8280,1,0,0,'example_creature SAY_AGGRO'), +(-1999901,'I see endless suffering. I see torment. I see rage. I see everything.',8831,1,0,0,'example_creature SAY_RANDOM_0'), +(-1999902,'Muahahahaha',8818,1,0,0,'example_creature SAY_RANDOM_1'), +(-1999903,'These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets.',8041,1,0,0,'example_creature SAY_RANDOM_2'), +(-1999904,'You are already dead.',8581,1,0,0,'example_creature SAY_RANDOM_3'), +(-1999905,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,0,'example_creature SAY_RANDOM_4'), +(-1999906,'$N, I sentance you to death!',8588,1,0,0,'example_creature SAY_BESERK'), +(-1999907,'The suffering has just begun!',0,1,0,0,'example_creature SAY_PHASE'), +(-1999908,'I always thought I was a good dancer.',0,0,0,0,'example_creature SAY_DANCE'), +(-1999909,'Move out Soldier!',0,0,0,0,'example_creature SAY_SALUTE'), +(-1999910,'Help $N! I\'m under attack!',0,0,0,0,'example_escort SAY_AGGRO1'), +(-1999911,'Die scum!',0,0,0,0,'example_escort SAY_AGGRO2'), +(-1999912,'Hmm a nice day for a walk alright',0,0,0,0,'example_escort SAY_WP_1'), +(-1999913,'Wild Felboar attack!',0,0,0,0,'example_escort SAY_WP_2'), +(-1999914,'Time for me to go! See ya around $N!',0,0,0,3,'example_escort SAY_WP_3'), +(-1999915,'Bye Bye!',0,0,0,3,'example_escort SAY_WP_4'), +(-1999916,'How dare you leave me like that! I hate you! =*(',0,3,0,0,'example_escort SAY_DEATH_1'), +(-1999917,'...no...how could you let me die $N',0,0,0,0,'example_escort SAY_DEATH_2'), +(-1999918,'ugh...',0,0,0,0,'example_escort SAY_DEATH_3'), +(-1999919,'Taste death!',0,0,0,0,'example_escort SAY_SPELL'), +(-1999920,'Fireworks!',0,0,0,0,'example_escort SAY_RAND_1'), +(-1999921,'Hmm, I think I could use a buff.',0,0,0,0,'example_escort SAY_RAND_2'), +(-1999922,'Normal select, guess you\'re not interested.',0,0,0,0,'example_gossip_codebox SAY_NOT_INTERESTED'), +(-1999923,'Wrong!',0,0,0,0,'example_gossip_codebox SAY_WRONG'), +(-1999924,'You\'re right, you are allowed to see my inner secrets.',0,0,0,0,'example_gossip_codebox SAY_CORRECT'), +(-1999925,'Hi!',0,0,0,0,'example_areatrigger SAY_HI'); diff --git a/sql/Updates/0.0.3/r862_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r862_scriptdev2_script_texts.sql new file mode 100644 index 0000000..0223c91 --- /dev/null +++ b/sql/Updates/0.0.3/r862_scriptdev2_script_texts.sql @@ -0,0 +1,16 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000230 AND -1000217; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000217,'Greetings, $N. I will guide you through the cavern. Please try and keep up.',0,3,0,0,'WHISPER_CUSTODIAN_1'), +(-1000218,'We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place.',0,3,0,0,'WHISPER_CUSTODIAN_2'), +(-1000219,'It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality.',0,3,0,0,'WHISPER_CUSTODIAN_3'), +(-1000220,'Follow me, please.',0,3,0,0,'WHISPER_CUSTODIAN_4'), +(-1000221,'There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality.',0,3,0,0,'WHISPER_CUSTODIAN_5'), +(-1000222,'As custodians of time, we watch over and care for Nozdormu\'s realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard.',0,3,0,0,'WHISPER_CUSTODIAN_6'), +(-1000223,'For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present.',0,3,0,0,'WHISPER_CUSTODIAN_7'), +(-1000224,'These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as \'trouble spots.\' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one...',0,3,0,0,'WHISPER_CUSTODIAN_8'), +(-1000225,'This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall\'s freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost.',0,3,0,0,'WHISPER_CUSTODIAN_9'), +(-1000226,'We have very little information on this timeway. Sa\'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not...',0,3,0,0,'WHISPER_CUSTODIAN_10'), +(-1000227,'This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown...',0,3,0,0,'WHISPER_CUSTODIAN_11'), +(-1000228,'The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities.',0,3,0,0,'WHISPER_CUSTODIAN_12'), +(-1000229,'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway\'s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.',0,3,0,0,'WHISPER_CUSTODIAN_13'), +(-1000230,'Our time is at an end $N. I would wish you luck, if such a thing existed.',0,3,0,0,'WHISPER_CUSTODIAN_14'); diff --git a/sql/Updates/0.0.3/r863_mangos.sql b/sql/Updates/0.0.3/r863_mangos.sql new file mode 100644 index 0000000..e4ae1f3 --- /dev/null +++ b/sql/Updates/0.0.3/r863_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='' WHERE `entry` IN (15273,15274,15294,15298,15367); diff --git a/sql/Updates/0.0.3/r872_mangos.sql b/sql/Updates/0.0.3/r872_mangos.sql new file mode 100644 index 0000000..a362b5d --- /dev/null +++ b/sql/Updates/0.0.3/r872_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_draenei_survivor' WHERE `entry`=16483; diff --git a/sql/Updates/0.0.3/r883_mangos.sql b/sql/Updates/0.0.3/r883_mangos.sql new file mode 100644 index 0000000..fc0f830 --- /dev/null +++ b/sql/Updates/0.0.3/r883_mangos.sql @@ -0,0 +1 @@ +UPDATE `item_template` SET `ScriptName`='item_arcane_charges' WHERE `entry`=34475; diff --git a/sql/Updates/0.0.3/r895_mangos.sql b/sql/Updates/0.0.3/r895_mangos.sql new file mode 100644 index 0000000..da3afdc --- /dev/null +++ b/sql/Updates/0.0.3/r895_mangos.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_ishanah' WHERE `entry`=18538; diff --git a/sql/Updates/0.0.3/r900_mangos.sql b/sql/Updates/0.0.3/r900_mangos.sql new file mode 100644 index 0000000..b0dcfe2 --- /dev/null +++ b/sql/Updates/0.0.3/r900_mangos.sql @@ -0,0 +1 @@ +UPDATE `gameobject_template` SET `ScriptName`='go_cat_figurine' WHERE `entry`=13873; diff --git a/sql/Updates/0.0.3/r903_mangos.sql b/sql/Updates/0.0.3/r903_mangos.sql new file mode 100644 index 0000000..72880e4 --- /dev/null +++ b/sql/Updates/0.0.3/r903_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_garments_of_quests' WHERE entry IN (12429,12423,12427,12430,12428); +UPDATE creature_template SET ScriptName='npc_ruul_snowhoof' WHERE entry=12818; diff --git a/sql/Updates/0.0.3/r903_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r903_scriptdev2_script_texts.sql new file mode 100644 index 0000000..4be9451 --- /dev/null +++ b/sql/Updates/0.0.3/r903_scriptdev2_script_texts.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000233 AND -1000231; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000231,'Ah, $GPriest:Priestess; you came along just in time. I appreciate it.',0,0,1,2,'SAY_DG_KEL_HEALED'), +(-1000232,'Thank you! Thank you, $GPriest:Priestess;. Now i can take on those gnolls with your power back to me!',0,0,1,1,'SAY_DG_KEL_THANKS'), +(-1000233,'Farewell to you, and may shadow always protect you!',0,0,1,3,'SAY_DG_KEL_GOODBYE'); diff --git a/sql/Updates/0.0.3/r907_mangos.sql b/sql/Updates/0.0.3/r907_mangos.sql new file mode 100644 index 0000000..6049556 --- /dev/null +++ b/sql/Updates/0.0.3/r907_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_khadgar' WHERE entry=18166; +UPDATE creature_template SET ScriptName='npc_khadgars_servant' WHERE entry=19685; diff --git a/sql/Updates/0.0.3/r907_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r907_scriptdev2_script_texts.sql new file mode 100644 index 0000000..390f92f --- /dev/null +++ b/sql/Updates/0.0.3/r907_scriptdev2_script_texts.sql @@ -0,0 +1,24 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000255 AND -1000234; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000234,'Follow me, stranger. This won\'t take long.',0,0,0,0,'SAY_KHAD_SERV_0'), +(-1000235,'Shattrath was once the draenei capital of this world. Its name means "dwelling of light."',0,4,0,0,'SAY_KHAD_SERV_1'), +(-1000236,'When the Burning Legion turned the orcs against the draenei, the fiercest battle was fought here. The draenei fought tooth and nail, but in the end the city fell.',0,4,0,0,'SAY_KHAD_SERV_2'), +(-1000237,'The city was left in ruins and darkness... until the Sha\'tar arrived.',0,4,0,0,'SAY_KHAD_SERV_3'), +(-1000238,'Let us go into the Lower City. I will warn you that as one of the only safe havens in Outland, Shattrath has attracted droves of refugees from all wars, current and past.',0,4,0,0,'SAY_KHAD_SERV_4'), +(-1000239,'The Sha\'tar, or "born from light" are the naaru that came to Outland to fight the demons of the Burning Legion.',0,4,0,0,'SAY_KHAD_SERV_5'), +(-1000240,'They were drawn to the ruins of Shattrath City where a small remnant of the draenei priesthood conducted its rites inside a ruined temple on this very spot.',0,4,0,0,'SAY_KHAD_SERV_6'), +(-1000241,'The priesthood, known as the Aldor, quickly regained its strength as word spread that the naaru had returned and reconstruction soon began. The ruined temple is now used as an infirmary for injured refugees.',0,4,0,0,'SAY_KHAD_SERV_7'), +(-1000242,'It wouldn\'t be long, however, before the city came under attack once again. This time, the attack came from Illidan\'s armies. A large regiment of blood elves had been sent by Illidan\'s ally, Kael\'thas Sunstrider, to lay waste to the city.',0,4,0,0,'SAY_KHAD_SERV_8'), +(-1000243,'As the regiment of blood elves crossed this very bridge, the Aldor\'s exarchs and vindicators lined up to defend the Terrace of Light. But then the unexpected happened.',0,4,0,0,'SAY_KHAD_SERV_9'), +(-1000244,'The blood elves laid down their weapons in front of the city\'s defenders; their leader, a blood elf elder known as Voren\'thal, stormed into the Terrace of Light and demanded to speak to A\'dal.',0,4,0,0,'SAY_KHAD_SERV_10'), +(-1000245,'As the naaru approached him, Voren\'thal kneeled before him and uttered the following words: "I\'ve seen you in a vision, naaru. My race\'s only hope for survival lies with you. My followers and I are here to serve you."',0,4,0,0,'SAY_KHAD_SERV_11'), +(-1000246,'The defection of Voren\'thal and his followers was the largest loss ever incurred by Kael\'s forces. And these weren\'t just any blood elves. Many of the best and brightest amongst Kael\'s scholars and magisters had been swayed by Voren\'thal\'s influence.',0,4,0,0,'SAY_KHAD_SERV_12'), +(-1000247,'The naaru accepted the defectors, who would become known as the Scryers; their dwelling lies in the platform above. Only those initiated with the Scryers are allowed there.',0,4,0,0,'SAY_KHAD_SERV_13'), +(-1000248,'The Aldor are followers of the Light and forgiveness and redemption are values they understand. However, they found hard to forget the deeds of the blood elves while under Kael\'s command.',0,4,0,0,'SAY_KHAD_SERV_14'), +(-1000249,'Many of the priesthood had been slain by the same magisters who now vowed to serve the naaru. They were not happy to share the city with their former enemies.',0,4,0,0,'SAY_KHAD_SERV_15'), +(-1000250,'The Aldor\'s most holy temple and its surrounding dwellings lie on the terrace above. As a holy site, only the initiated are welcome inside.',0,4,0,0,'SAY_KHAD_SERV_16'), +(-1000251,'The attacks against Shattrath continued, but the city did not fall\, as you can see. On the contrary, the naaru known as Xi\'ri led a successful incursion into Shadowmoon Valley - Illidan\'s doorstep.',0,4,0,0,'SAY_KHAD_SERV_17'), +(-1000252,'There he continues to wage war on Illidan with the assistance of the Aldor and the Scryers. The two factions have not given up on their old feuds, though.',0,4,0,0,'SAY_KHAD_SERV_18'), +(-1000253,'Such is their animosity that they vie for the honor of being sent to assist the naaru there. Each day, that decision is made here by A\'dal. The armies gather here to receive A\'dal\'s blessing before heading to Shadowmoon.',0,4,0,0,'SAY_KHAD_SERV_19'), +(-1000254,'Khadgar should be ready to see you again. Just remember that to serve the Sha\'tar you will most likely have to ally with the Aldor or the Scryers. And seeking the favor of one group will cause the others\' dislike.',0,4,0,0,'SAY_KHAD_SERV_20'), +(-1000255,'Good luck stranger, and welcome to Shattrath City.','0','4','0','0','SAY_KHAD_SERV_21'); diff --git a/sql/Updates/0.0.3/r909_mangos.sql b/sql/Updates/0.0.3/r909_mangos.sql new file mode 100644 index 0000000..e8df16f --- /dev/null +++ b/sql/Updates/0.0.3/r909_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_nestlewood_owlkin' WHERE entry=16518; diff --git a/sql/Updates/0.0.3/r910_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r910_scriptdev2_script_texts.sql new file mode 100644 index 0000000..9418b05 --- /dev/null +++ b/sql/Updates/0.0.3/r910_scriptdev2_script_texts.sql @@ -0,0 +1,16 @@ +UPDATE script_texts SET language=0 WHERE entry=-1000231; +UPDATE script_texts SET comment='garments SAY_COMMON_HEALED' WHERE entry=-1000231; +UPDATE script_texts SET content_default='Thank you! Thank you, $GPriest:Priestess;. Now I can take on those gnolls with your power to back me!' WHERE entry=-1000232; +UPDATE script_texts SET comment='garments SAY_DG_KEL_THANKS' WHERE entry=-1000232; +UPDATE script_texts SET comment='garments SAY_DG_KEL_GOODBYE' WHERE entry=-1000233; + +DELETE FROM script_texts WHERE entry BETWEEN -1000263 AND -1000256; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000256,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those murlocs with the Light on my side!',0,0,7,1,'garments SAY_ROBERTS_THANKS'), +(-1000257,'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_ROBERTS_GOODBYE'), +(-1000258,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those humans with your power to back me!',0,0,1,1,'garments SAY_KORJA_THANKS'), +(-1000259,'Farewell to you, and may our ancestors be with you always!',0,0,1,3,'garments SAY_KORJA_GOODBYE'), +(-1000260,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those wendigo with the Light on my side!',0,0,7,1,'garments SAY_DOLF_THANKS'), +(-1000261,'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_DOLF_GOODBYE'), +(-1000262,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those corrupt timberlings with Elune\'s power behind me!',0,0,2,1,'garments SAY_SHAYA_THANKS'), +(-1000263,'Farewell to you, and may Elune be with you always.',0,0,2,3,'garments SAY_SHAYA_GOODBYE'); diff --git a/sql/Updates/0.0.3/r912_mangos.sql b/sql/Updates/0.0.3/r912_mangos.sql new file mode 100644 index 0000000..91b5fc1 --- /dev/null +++ b/sql/Updates/0.0.3/r912_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_professor_phizzlethorpe' WHERE entry=2768; diff --git a/sql/Updates/0.0.3/r912_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r912_scriptdev2_script_texts.sql new file mode 100644 index 0000000..1a043a2 --- /dev/null +++ b/sql/Updates/0.0.3/r912_scriptdev2_script_texts.sql @@ -0,0 +1,12 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000273 and -1000264; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000264,'Ok, $N. Follow me to the cave where I\'ll attempt to harness the power of the rune stone into these goggles.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_1'), +(-1000265,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_2'), +(-1000266,'I\'ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_3'), +(-1000267,'begins tinkering with the goggles before the stone.',0,2,0,0,'phizzlethorpe EMOTE_PROGRESS_4'), +(-1000268,'Help!!! Get these things off me so I can get my work done!',0,0,0,0,'phizzlethorpe SAY_AGGRO'), +(-1000269,'Almost done! Just a little longer!',0,0,0,1,'phizzlethorpe SAY_PROGRESS_5'), +(-1000270,'I\'ve done it! I have harnessed the power of the stone into the goggles! Let\'s get out of here!',0,0,0,1,'phizzlethorpe SAY_PROGRESS_6'), +(-1000271,'Phew! Glad to be back from that creepy cave.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_7'), +(-1000272,'hands one glowing goggles over to Doctor Draxlegauge.',0,2,0,0,'phizzlethorpe EMOTE_PROGRESS_8'), +(-1000273,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',0,0,0,1,'phizzlethorpe SAY_PROGRESS_9'); diff --git a/sql/Updates/0.0.3/r916_mangos.sql b/sql/Updates/0.0.3/r916_mangos.sql new file mode 100644 index 0000000..4db37b3 --- /dev/null +++ b/sql/Updates/0.0.3/r916_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_dirty_larry' WHERE entry=19720; diff --git a/sql/Updates/0.0.3/r916_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r916_scriptdev2_script_texts.sql new file mode 100644 index 0000000..11bd48b --- /dev/null +++ b/sql/Updates/0.0.3/r916_scriptdev2_script_texts.sql @@ -0,0 +1,8 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000279 AND -1000274; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000274,'Time to teach you a lesson in manners, little $Gboy:girl;!',0,0,0,0,'larry SAY_START'), +(-1000275,'Now I\'m gonna give you to the count of \'3\' to get out of here before I sick the dogs on you.',0,0,0,0,'larry SAY_COUNT'), +(-1000276,'1...',0,0,0,0,'larry SAY_COUNT_1'), +(-1000277,'2...',0,0,0,0,'larry SAY_COUNT_2'), +(-1000278,'Time to meet your maker!',0,0,0,0,'larry SAY_ATTACK_5'), +(-1000279,'Alright, we give up! Don\'t hurt us!',0,0,0,0,'larry SAY_GIVEUP'); diff --git a/sql/Updates/0.0.3/r919_mangos.sql b/sql/Updates/0.0.3/r919_mangos.sql new file mode 100644 index 0000000..0055fbf --- /dev/null +++ b/sql/Updates/0.0.3/r919_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_gilded_brazier' WHERE entry=181956; diff --git a/sql/Updates/0.0.3/r922_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r922_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..bad4a64 --- /dev/null +++ b/sql/Updates/0.0.3/r922_scriptdev2_script_waypoint.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS script_waypoint; +CREATE TABLE script_waypoint ( + entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry', + pointid mediumint(8) unsigned NOT NULL DEFAULT '0', + location_x float NOT NULL DEFAULT '0', + location_y float NOT NULL DEFAULT '0', + location_z float NOT NULL DEFAULT '0', + waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs', + point_comment text, + PRIMARY KEY (entry, pointid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; diff --git a/sql/Updates/0.0.3/r924_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r924_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..415edc4 --- /dev/null +++ b/sql/Updates/0.0.3/r924_scriptdev2_script_waypoint.sql @@ -0,0 +1,37 @@ +DELETE FROM script_waypoint WHERE entry=16295; +INSERT INTO script_waypoint VALUES +(16295, 0, 7545.070000, -7359.870000, 162.354000, 4000, 'SAY_START'), +(16295, 1, 7550.048340, -7362.237793, 162.235657, 0, ''), +(16295, 2, 7566.976074, -7364.315430, 161.738770, 0, ''), +(16295, 3, 7578.830566, -7361.677734, 161.738770, 0, ''), +(16295, 4, 7590.969238, -7359.053711, 162.257660, 0, ''), +(16295, 5, 7598.354004, -7362.815430, 162.256683, 4000, 'SAY_PROGRESS_1'), +(16295, 6, 7605.861328, -7380.424316, 161.937073, 0, ''), +(16295, 7, 7605.295410, -7387.382813, 157.253998, 0, ''), +(16295, 8, 7606.131836, -7393.893555, 156.941925, 0, ''), +(16295, 9, 7615.207520, -7400.187012, 157.142639, 0, ''), +(16295, 10, 7618.956543, -7402.652832, 158.202042, 0, ''), +(16295, 11, 7636.850586, -7401.756836, 162.144791, 0, 'SAY_PROGRESS_2'), +(16295, 12, 7637.058105, -7404.944824, 162.206970, 4000, ''), +(16295, 13, 7636.910645, -7412.585449, 162.366425, 0, ''), +(16295, 14, 7637.607910, -7425.591797, 162.630661, 0, ''), +(16295, 15, 7637.816895, -7459.057129, 163.302704, 0, ''), +(16295, 16, 7638.859863, -7470.902344, 162.517059, 0, ''), +(16295, 17, 7641.395996, -7488.217285, 157.381287, 0, ''), +(16295, 18, 7634.455566, -7505.451660, 154.682159, 0, 'SAY_PROGRESS_3'), +(16295, 19, 7631.906738, -7516.948730, 153.597382, 0, ''), +(16295, 20, 7622.231445, -7537.037598, 151.587112, 0, ''), +(16295, 21, 7610.921875, -7550.670410, 149.639374, 0, ''), +(16295, 22, 7598.229004, -7562.551758, 145.953888, 0, ''), +(16295, 23, 7588.509277, -7577.755371, 148.294479, 0, ''), +(16295, 24, 7567.339355, -7608.456055, 146.006485, 0, ''), +(16295, 25, 7562.547852, -7617.417969, 148.097504, 0, ''), +(16295, 26, 7561.508789, -7645.064453, 151.245163, 0, ''), +(16295, 27, 7563.337402, -7654.652344, 151.227158, 0, ''), +(16295, 28, 7565.533691, -7658.296387, 151.248886, 0, ''), +(16295, 39, 7571.155762, -7659.118652, 151.244568, 0, ''), +(16295, 30, 7579.119629, -7662.213867, 151.651505, 0, 'quest complete'), +(16295, 31, 7603.768066, -7667.000488, 153.997726, 0, ''), +(16295, 32, 7603.768066, -7667.000488, 153.997726, 4000, 'SAY_END_1'), +(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'), +(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, ''); diff --git a/sql/Updates/0.0.3/r936_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r936_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..cbd2890 --- /dev/null +++ b/sql/Updates/0.0.3/r936_scriptdev2_script_waypoint.sql @@ -0,0 +1,288 @@ +DELETE FROM script_waypoint WHERE entry=467; +INSERT INTO script_waypoint VALUES +(467, 0, -10508.40, 1068.00, 55.21, 0, ''), +(467, 1, -10518.30, 1074.84, 53.96, 0, ''), +(467, 2, -10534.82, 1081.92, 49.88, 0, ''), +(467, 3, -10546.51, 1084.88, 50.13, 0, ''), +(467, 4, -10555.29, 1084.45, 45.75, 0, ''), +(467, 5, -10566.57, 1083.53, 42.10, 0, ''), +(467, 6, -10575.83, 1082.34, 39.46, 0, ''), +(467, 7, -10585.67, 1081.08, 37.77, 0, ''), +(467, 8, -10600.08, 1078.19, 36.23, 0, ''), +(467, 9, -10608.69, 1076.08, 35.88, 0, ''), +(467, 10, -10621.26, 1073.00, 35.40, 0, ''), +(467, 11, -10638.12, 1060.18, 33.61, 0, ''), +(467, 12, -10655.87, 1038.99, 33.48, 0, ''), +(467, 13, -10664.68, 1030.54, 32.70, 0, ''), +(467, 14, -10708.68, 1033.86, 33.32, 0, ''), +(467, 15, -10754.43, 1017.93, 32.79, 0, ''), +(467, 16, -10802.26, 1018.01, 32.16, 0, ''), +(467, 17, -10832.60, 1009.04, 32.71, 0, ''), +(467, 18, -10866.56, 1006.51, 31.71, 0, ''), +(467, 19, -10879.98, 1005.10, 32.84, 0, ''), +(467, 20, -10892.45, 1001.32, 34.46, 0, ''), +(467, 21, -10906.14, 997.11, 36.15, 0, ''), +(467, 22, -10922.26, 1002.23, 35.74, 0, ''), +(467, 23, -10936.32, 1023.38, 36.52, 0, ''), +(467, 24, -10933.35, 1052.61, 35.85, 0, ''), +(467, 25, -10940.25, 1077.66, 36.49, 0, ''), +(467, 26, -10957.09, 1099.33, 36.83, 0, ''), +(467, 27, -10956.53, 1119.90, 36.73, 0, ''), +(467, 28, -10939.30, 1150.75, 37.42, 0, ''), +(467, 29, -10915.14, 1202.09, 36.55, 0, ''), +(467, 30, -10892.59, 1257.03, 33.37, 0, ''), +(467, 31, -10891.93, 1306.66, 35.45, 0, ''), +(467, 32, -10896.17, 1327.86, 37.77, 0, ''), +(467, 33, -10906.03, 1368.05, 40.91, 0, ''), +(467, 34, -10910.18, 1389.33, 42.62, 0, ''), +(467, 35, -10915.42, 1417.72, 42.93, 0, ''), +(467, 36, -10926.37, 1421.18, 43.04, 0, 'walk here and say'), +(467, 37, -10952.31, 1421.74, 43.40, 0, ''), +(467, 38, -10980.04, 1411.38, 42.79, 0, ''), +(467, 39, -11006.06, 1420.47, 43.26, 0, ''), +(467, 40, -11021.98, 1450.59, 43.09, 0, ''), +(467, 41, -11025.36, 1491.59, 43.15, 0, ''), +(467, 42, -11036.09, 1508.32, 43.28, 0, ''), +(467, 43, -11060.68, 1526.72, 43.19, 0, ''), +(467, 44, -11072.75, 1527.77, 43.20, 5000, 'say and quest credit'); + +DELETE FROM script_waypoint WHERE entry=2768; +INSERT INTO script_waypoint VALUES +(2768, 0, -2066.45, -2085.96, 9.08, 0, ''), +(2768, 1, -2077.99, -2105.33, 13.24, 0, ''), +(2768, 2, -2074.60, -2109.67, 14.24, 0, ''), +(2768, 3, -2076.60, -2117.46, 16.67, 0, ''), +(2768, 4, -2073.51, -2123.46, 18.42, 2000, ''), +(2768, 5, -2073.51, -2123.46, 18.42, 4000, ''), +(2768, 6, -2066.60, -2131.85, 21.56, 0, ''), +(2768, 7, -2053.85, -2143.19, 20.31, 0, ''), +(2768, 8, -2043.49, -2153.73, 20.20, 10000, ''), +(2768, 9, -2043.49, -2153.73, 20.20, 20000, ''), +(2768, 10, -2043.49, -2153.73, 20.20, 10000, ''), +(2768, 11, -2043.49, -2153.73, 20.20, 2000, ''), +(2768, 12, -2053.85, -2143.19, 20.31, 0, ''), +(2768, 13, -2066.60, -2131.85, 21.56, 0, ''), +(2768, 14, -2073.51, -2123.46, 18.42, 0, ''), +(2768, 15, -2076.60, -2117.46, 16.67, 0, ''), +(2768, 16, -2074.60, -2109.67, 14.24, 0, ''), +(2768, 17, -2077.99, -2105.33, 13.24, 0, ''), +(2768, 18, -2066.45, -2085.96, 9.08, 0, ''), +(2768, 19, -2066.41, -2086.21, 8.97, 6000, ''), +(2768, 20, -2066.41, -2086.21, 8.97, 2000, ''); + +DELETE FROM script_waypoint WHERE entry=12818; +INSERT INTO script_waypoint VALUES +(12818, 0, 3347.250089, -694.700989, 159.925995, 0, ''), +(12818, 1, 3341.527039, -694.725891, 161.124542, 4000, ''), +(12818, 2, 3338.351074, -686.088138, 163.444000, 0, ''), +(12818, 3, 3352.744873, -677.721741, 162.316269, 0, ''), +(12818, 4, 3370.291016, -669.366943, 160.751358, 0, ''), +(12818, 5, 3381.479492, -659.449097, 162.545303, 0, ''), +(12818, 6, 3389.554199, -648.500000, 163.651825, 0, ''), +(12818, 7, 3396.645020, -641.508911, 164.216019, 0, ''), +(12818, 8, 3410.498535, -634.299622, 165.773453, 0, ''), +(12818, 9, 3418.461426, -631.791992, 166.477615, 0, ''), +(12818, 10, 3429.500000, -631.588745, 166.921265, 0, ''), +(12818, 11,3434.950195, -629.245483, 168.333969, 0, ''), +(12818, 12,3438.927979, -618.503235, 171.503143, 0, ''), +(12818, 13,3444.217529, -609.293640, 173.077972, 1000, 'Ambush 1'), +(12818, 14,3460.505127, -593.794189, 174.342255, 0, ''), +(12818, 15,3480.283203, -578.210327, 176.652313, 0, ''), +(12818, 16,3492.912842, -562.335449, 181.396301, 0, ''), +(12818, 17,3495.230957, -550.977600, 184.652267, 0, ''), +(12818, 18,3496.247070, -529.194214, 188.172028, 0, ''), +(12818, 19,3497.619385, -510.411499, 188.345322, 1000, 'Ambush 2'), +(12818, 20,3498.498047, -497.787506, 185.806274, 0, ''), +(12818, 21,3484.218750, -489.717529, 182.389862, 4000, ''); + +DELETE FROM script_waypoint WHERE entry=12858; +INSERT INTO script_waypoint VALUES +(12858, 0, 1782.63, -2241.11, 109.73, 5000, ''), +(12858, 1, 1788.88, -2240.17, 111.71, 0, ''), +(12858, 2, 1797.49, -2238.11, 112.31, 0, ''), +(12858, 3, 1803.83, -2232.77, 111.22, 0, ''), +(12858, 4, 1806.65, -2217.83, 107.36, 0, ''), +(12858, 5, 1811.81, -2208.01, 107.45, 0, ''), +(12858, 6, 1820.85, -2190.82, 100.49, 0, ''), +(12858, 7, 1829.60, -2177.49, 96.44, 0, ''), +(12858, 8, 1837.98, -2164.19, 96.71, 0, 'prepare'), +(12858, 9, 1839.99, -2149.29, 96.78, 0, ''), +(12858, 10, 1835.14, -2134.98, 96.80, 0, ''), +(12858, 11, 1823.57, -2118.27, 97.43, 0, ''), +(12858, 12, 1814.99, -2110.35, 98.38, 0, ''), +(12858, 13, 1806.60, -2103.09, 99.19, 0, ''), +(12858, 14, 1798.27, -2095.77, 100.04, 0, ''), +(12858, 15, 1783.59, -2079.92, 100.81, 0, ''), +(12858, 16, 1776.79, -2069.48, 101.77, 0, ''), +(12858, 17, 1776.82, -2054.59, 109.82, 0, ''), +(12858, 18, 1776.88, -2047.56, 109.83, 0, ''), +(12858, 19, 1776.86, -2036.55, 109.83, 0, ''), +(12858, 20, 1776.90, -2024.56, 109.83, 0, 'win'), +(12858, 21, 1776.87, -2028.31, 109.83,60000, 'stay'), +(12858, 22, 1776.90, -2028.30, 109.83, 0, ''); + +DELETE FROM script_waypoint WHERE entry=15420; +INSERT INTO script_waypoint VALUES +(15420, 0, 9294.78, -6682.51, 22.42, 0, ''), +(15420, 1, 9298.27, -6667.99, 22.42, 0, ''), +(15420, 2, 9309.63, -6658.84, 22.43, 0, ''), +(15420, 3, 9304.43, -6649.31, 26.46, 0, ''), +(15420, 4, 9298.83, -6648.00, 28.61, 0, ''), +(15420, 5, 9291.06, -6653.46, 31.83,2500, ''), +(15420, 6, 9289.08, -6660.17, 31.85,5000, ''), +(15420, 7, 9291.06, -6653.46, 31.83, 0, ''); + +DELETE FROM script_waypoint WHERE entry=16993; +INSERT INTO script_waypoint VALUES +(16993, 0, -1137.72, 4272.10, 14.04, 5000, ''), +(16993, 1, -1141.34, 4232.42, 14.63, 0, ''), +(16993, 2, -1133.47, 4220.88, 11.78, 0, ''), +(16993, 3, -1126.18, 4213.26, 13.51, 0, ''), +(16993, 4, -1100.12, 4204.32, 16.41, 0, ''), +(16993, 5, -1063.68, 4197.92, 15.51, 0, ''), +(16993, 6, -1027.28, 4194.36, 15.52, 0, ''), +(16993, 7, -995.68, 4189.59, 19.84, 0, ''), +(16993, 8, -970.90, 4188.60, 24.61, 0, ''), +(16993, 9, -961.93, 4193.34, 26.11, 15000, 'Summon 1'), +(16993, 10, -935.52, 4210.99, 31.98, 0, ''), +(16993, 11, -913.42, 4218.27, 37.29, 0, ''), +(16993, 12, -896.53, 4207.73, 43.23, 0, ''), +(16993, 13, -868.49, 4194.77, 46.75, 30000, 'Kneel and Rest Here'), +(16993, 14, -852.83, 4198.29, 47.28, 15000, 'Summon 2'), +(16993, 15, -819.85, 4200.50, 46.37, 0, ''), +(16993, 16, -791.92, 4201.96, 44.19, 0, ''), +(16993, 17, -774.42, 4202.46, 47.41, 0, ''), +(16993, 18, -762.90, 4202.17, 48.81, 0, ''), +(16993, 19, -728.25, 4195.35, 50.68, 0, ''), +(16993, 20, -713.58, 4192.07, 53.98, 0, ''), +(16993, 21, -703.09, 4189.74, 56.96, 0, ''), +(16993, 22, -693.70, 4185.43, 57.06, 0, ''), +(16993, 23, -686.38, 4159.81, 60.26, 0, ''), +(16993, 24, -679.88, 4147.04, 64.20, 0, ''), +(16993, 25, -656.74, 4147.72, 64.11, 0, ''), +(16993, 26, -652.22, 4137.50, 64.58, 0, ''), +(16993, 27, -649.99, 4136.38, 64.63, 30000, 'Quest Credit'); + +DELETE FROM script_waypoint WHERE entry=17312; +INSERT INTO script_waypoint VALUES +(17312, 0, -4784.532227, -11051.060547, 3.484263, 0, ''), +(17312, 1, -4805.509277, -11037.293945, 3.043942, 0, ''), +(17312, 2, -4827.826172, -11034.398438, 1.741959, 0, ''), +(17312, 3, -4852.630859, -11033.695313, 2.208656, 0, ''), +(17312, 4, -4876.791992, -11034.517578, 3.175228, 0, ''), +(17312, 5, -4895.486816, -11038.306641, 9.390890, 0, ''), +(17312, 6, -4915.464844, -11048.402344, 12.369793, 0, ''), +(17312, 7, -4937.288086, -11067.041992, 13.857983, 0, ''), +(17312, 8, -4966.577637, -11067.507813, 15.754786, 0, ''), +(17312, 9, -4993.799805, -11056.544922, 19.175295, 0, ''), +(17312, 10, -5017.836426, -11052.569336, 22.476587, 0, ''), +(17312, 11, -5039.706543, -11058.459961, 25.831593, 0, ''), +(17312, 12, -5057.289063, -11045.474609, 26.972496, 0, ''), +(17312, 13, -5078.828125, -11037.601563, 29.053417, 0, ''), +(17312, 14, -5104.158691, -11039.195313, 29.440195, 0, ''), +(17312, 15, -5120.780273, -11039.518555, 30.142139, 0, ''), +(17312, 16, -5140.833008, -11039.810547, 28.788074, 0, ''), +(17312, 17, -5161.201660, -11040.050781, 27.879545, 4000, ''), +(17312, 18, -5171.842285, -11046.803711, 27.183821, 0, ''), +(17312, 19, -5185.995117, -11056.359375, 20.234867, 0, ''), +(17312, 20, -5198.485840, -11065.065430, 18.872593, 0, ''), +(17312, 21, -5214.062500, -11074.653320, 19.215731, 0, ''), +(17312, 22, -5220.157227, -11088.377930, 19.818476, 0, ''), +(17312, 23, -5233.652832, -11098.846680, 18.349432, 0, ''), +(17312, 24, -5250.163086, -11111.653320, 16.438959, 0, ''), +(17312, 25, -5268.194336, -11125.639648, 12.668313, 0, ''), +(17312, 26, -5286.270508, -11130.669922, 6.912246, 0, ''), +(17312, 27, -5317.449707, -11137.392578, 4.963446, 0, ''), +(17312, 28, -5334.854492, -11154.384766, 6.742664, 0, ''), +(17312, 29, -5353.874512, -11171.595703, 6.903912, 20000, ''), +(17312, 30, -5354.240000, -11171.940000, 6.890000, 0, ''); + +DELETE FROM script_waypoint WHERE entry=19685; +INSERT INTO script_waypoint VALUES +(19685, 0, -1863.369019, 5419.517090, -10.463668, 5000, ''), +(19685, 1, -1861.749023, 5416.465332, -10.508068, 0, ''), +(19685, 2, -1857.036133, 5410.966309, -12.428039, 0, ''), +(19685, 3, -1831.539185, 5365.472168, -12.428039, 0, ''), +(19685, 4, -1813.416504, 5333.776855, -12.428039, 0, ''), +(19685, 5, -1800.354370, 5313.290039, -12.428039, 0, ''), +(19685, 6, -1775.624878, 5268.786133, -38.809181, 0, ''), +(19685, 7, -1770.147339, 5259.268066, -38.829231, 0, ''), +(19685, 8, -1762.814209, 5261.098145, -38.848995, 0, ''), +(19685, 9, -1740.110474, 5268.858398, -40.208965, 0, ''), +(19685, 10, -1725.837402, 5270.936035, -40.208965, 0, ''), +(19685, 11, -1701.580322, 5290.323242, -40.209187, 0, ''), +(19685, 12, -1682.877808, 5291.406738, -34.429646, 0, ''), +(19685, 13, -1670.101685, 5291.201172, -32.786007, 0, ''), +(19685, 14, -1656.666870, 5294.333496, -37.862648, 0, ''), +(19685, 15, -1652.035767, 5295.413086, -40.245499, 0, ''), +(19685, 16, -1620.860596, 5300.133301, -40.208992, 0, ''), +(19685, 17, -1607.630981, 5293.983398, -38.577045, 5000, ''), +(19685, 18, -1607.630981, 5293.983398, -38.577045, 5000, ''), +(19685, 19, -1607.630981, 5293.983398, -38.577045, 5000, ''), +(19685, 20, -1622.140869, 5301.955566, -40.208897, 0, ''), +(19685, 21, -1621.131836, 5333.112793, -40.208897, 0, ''), +(19685, 22, -1637.598999, 5342.134277, -40.208790, 0, ''), +(19685, 23, -1648.521606, 5352.309570, -47.496170, 0, ''), +(19685, 24, -1654.606934, 5357.419434, -45.870892, 0, ''), +(19685, 25, -1633.670044, 5422.067871, -42.835541, 0, ''), +(19685, 26, -1656.567505, 5426.236328, -40.405815, 0, ''), +(19685, 27, -1664.932373, 5425.686523, -38.846405, 0, ''), +(19685, 28, -1681.406006, 5425.871094, -38.810928, 0, ''), +(19685, 29, -1730.875977, 5427.413574, -12.427910, 0, ''), +(19685, 30, -1743.509521, 5369.599121, -12.427910, 0, ''), +(19685, 31, -1877.217041, 5303.710449, -12.427989, 0, ''), +(19685, 32, -1890.371216, 5289.273438, -12.428268, 0, ''), +(19685, 33, -1905.505737, 5266.534668, 2.630672, 0, ''), +(19685, 34, -1909.381348, 5273.008301, 1.663714, 10000, ''), +(19685, 35, -1909.381348, 5273.008301, 1.663714, 12000, ''), +(19685, 36, -1909.381348, 5273.008301, 1.663714, 8000, ''), +(19685, 37, -1909.381348, 5273.008301, 1.663714, 15000, ''), +(19685, 38, -1927.561401, 5275.324707, 1.984987, 0, ''), +(19685, 39, -1927.385498, 5300.879883, -12.427236, 0, ''), +(19685, 40, -1921.063965, 5314.318359, -12.427236, 0, ''), +(19685, 41, -1965.425415, 5379.298828, -12.427236, 0, ''), +(19685, 42, -1981.233154, 5450.743652, -12.427236, 0, ''), +(19685, 43, -1958.022461, 5455.904297, 0.487659, 0, ''), +(19685, 44, -1951.991455, 5463.580566, 0.874490, 10000, ''), +(19685, 45, -1951.991455, 5463.580566, 0.874490, 12000, ''), +(19685, 46, -1968.730225, 5481.752930, -12.427846, 0, ''), +(19685, 47, -1881.839844, 5554.040039, -12.427846, 0, ''), +(19685, 48, -1841.566650, 5545.965332, -12.427846, 0, ''), +(19685, 49, -1837.658325, 5523.780273, 0.558756, 0, ''), +(19685, 50, -1831.321777, 5534.821777, 1.221819, 6000, ''), +(19685, 51, -1831.321777, 5534.821777, 1.221819, 8000, ''), +(19685, 52, -1831.321777, 5534.821777, 1.221819, 5000, ''), +(19685, 53, -1850.060669, 5472.610840, 0.857320, 6000, ''), +(19685, 54, -1850.060669, 5472.610840, 0.857320, 8000, ''), +(19685, 55, -1850.060669, 5472.610840, 0.857320, 9000, ''), +(19685, 56, -1850.060669, 5472.610840, 0.857320, 9000, ''), +(19685, 57, -1850.060669, 5472.610840, 0.857320, 4000, ''); + +DELETE FROM script_waypoint WHERE entry=20129; +INSERT INTO script_waypoint VALUES +(20129, 0, -8374.93,-4250.21, -204.38,5000, ''), +(20129, 1, -8374.93,-4250.21, -204.38,16000, ''), +(20129, 2, -8374.93,-4250.21, -204.38,10000, ''), +(20129, 3, -8374.93,-4250.21, -204.38,2000, ''), +(20129, 4, -8439.40,-4180.05, -209.25, 0, ''), +(20129, 5, -8437.82,-4120.84, -208.59,10000, ''), +(20129, 6, -8437.82,-4120.84, -208.59,16000, ''), +(20129, 7, -8437.82,-4120.84, -208.59,13000, ''), +(20129, 8, -8437.82,-4120.84, -208.59,18000, ''), +(20129, 9, -8437.82,-4120.84, -208.59,15000, ''), +(20129, 10, -8437.82,-4120.84, -208.59,2000, ''), +(20129, 11, -8467.26,-4198.63, -214.21, 0, ''), +(20129, 12, -8667.76,-4252.13, -209.56, 0, ''), +(20129, 13, -8703.71,-4234.58, -209.5,14000, ''), +(20129, 14, -8703.71,-4234.58, -209.5,2000, ''), +(20129, 15, -8642.81,-4304.37, -209.57, 0, ''), +(20129, 16, -8649.06,-4394.36, -208.46,6000, ''), +(20129, 17, -8649.06,-4394.36, -208.46,18000, ''), +(20129, 18, -8649.06,-4394.36, -208.46,2000, ''), +(20129, 19, -8468.72,-4437.67, -215.45, 0, ''), +(20129, 20, -8427.54,-4426, -211.13, 0, ''), +(20129, 21, -8364.83,-4393.32, -205.91, 0, ''), +(20129, 22, -8304.54,-4357.2, -208.2,18000, ''), +(20129, 23, -8304.54,-4357.2, -208.2,2000, ''), +(20129, 24, -8375.42,-4250.41, -205.14,5000, ''), +(20129, 25, -8375.42,-4250.41, -205.14,5000, ''); diff --git a/sql/Updates/0.0.3/r937_mangos.sql b/sql/Updates/0.0.3/r937_mangos.sql new file mode 100644 index 0000000..7a738be --- /dev/null +++ b/sql/Updates/0.0.3/r937_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_clintar_dw_spirit' WHERE entry=22916; diff --git a/sql/Updates/0.0.3/r937_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r937_scriptdev2_script_texts.sql new file mode 100644 index 0000000..bfe8af9 --- /dev/null +++ b/sql/Updates/0.0.3/r937_scriptdev2_script_texts.sql @@ -0,0 +1,9 @@ +DELETE FROM script_texts where entry BETWEEN -1000286 and -1000280; +INSERT INTO script_texts (entry, content_default, sound, type, language, emote, comment) VALUES +(-1000280, 'A shadowy, sinister presence has invaded the Emerald Dream. Its power is poised to spill over into our world, $N. We must oppose it! That\'s why I cannot accompany you in person.',0,0,0,1,'clintar SAY_START'), +(-1000281, 'The Emerald Dream will never be yours!',0,0,0,0,'clintar SAY_AGGRO_1'), +(-1000282, 'Begone from this place!',0,0,0,0,'clintar SAY_AGGRO_2'), +(-1000283, 'That\'s the first relic, but there are still two more. Follow me, $N.',0,0,0,0,'clintar SAY_RELIC1'), +(-1000284, 'I\'ve recovered the second relic. Take a moment to rest, and then we\'ll continue to the last reliquary.',0,0,0,0,'clintar SAY_RELIC2'), +(-1000285, 'We have all three of the relics, but my energy is rapidly fading. We must make our way back to Dreamwarden Lurosa! He will let you know what to do next.',0,0,0,0,'clintar SAY_RELIC3'), +(-1000286, 'Lurosa, I am entrusting the Relics of Aviana to $N, who will take them to Morthis Whisperwing. I must return completely to the Emerald Dream now. Do not let $N fail!',0,0,0,1,'clintar SAY_END'); diff --git a/sql/Updates/0.0.3/r937_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r937_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..43029cd --- /dev/null +++ b/sql/Updates/0.0.3/r937_scriptdev2_script_waypoint.sql @@ -0,0 +1,52 @@ +DELETE FROM script_waypoint WHERE entry=22916; +INSERT INTO script_waypoint VALUES +(22916, 0, 7461.49, -3121.06, 438.210, 7000, 'SAY_START'), +(22916, 1, 7465.26, -3115.50, 439.315, 0, ''), +(22916, 2, 7470.03, -3109.29, 439.333, 0, ''), +(22916, 3, 7473.77, -3104.65, 442.366, 0, ''), +(22916, 4, 7478.67, -3098.55, 443.551, 0, ''), +(22916, 5, 7482.78, -3093.35, 441.883, 0, ''), +(22916, 6, 7486.23, -3089.19, 439.698, 0, ''), +(22916, 7, 7484.64, -3084.55, 439.566, 0, ''), +(22916, 8, 7477.09, -3084.43, 442.132, 0, ''), +(22916, 9, 7470.66, -3084.86, 443.194, 0, ''), +(22916, 10, 7456.51, -3085.83, 438.863, 0, ''), +(22916, 11, 7446.00, -3085.59, 438.210, 0, ''), +(22916, 12, 7444.60, -3084.10, 438.323, 0, ''), +(22916, 13, 7445.58, -3080.92, 439.374, 5000, 'collect 1'), +(22916, 14, 7446.18, -3085.36, 438.210, 5000, 'SAY_RELIC1'), +(22916, 15, 7453.90, -3086.69, 439.454, 0, ''), +(22916, 16, 7459.41, -3085.50, 439.158, 0, ''), +(22916, 17, 7465.90, -3085.01, 442.329, 0, ''), +(22916, 18, 7472.80, -3084.81, 443.085, 0, ''), +(22916, 19, 7480.58, -3084.56, 440.642, 0, ''), +(22916, 20, 7484.59, -3084.71, 439.568, 0, ''), +(22916, 21, 7491.81, -3090.55, 440.052, 0, ''), +(22916, 22, 7497.13, -3095.34, 437.505, 0, ''), +(22916, 23, 7496.61, -3113.62, 434.554, 0, ''), +(22916, 24, 7501.79, -3123.79, 435.347, 0, ''), +(22916, 25, 7506.60, -3130.78, 434.179, 0, ''), +(22916, 26, 7504.53, -3133.46, 435.579, 5000, 'collect 2'), +(22916, 27, 7505.20, -3130.03, 434.151, 15000, 'SAY_RELIC2'), +(22916, 28, 7502.04, -3124.44, 435.298, 0, ''), +(22916, 29, 7495.90, -3113.93, 434.538, 0, ''), +(22916, 30, 7488.79, -3111.10, 434.310, 0, ''), +(22916, 31, 7477.81, -3105.37, 430.541, 0, 'summon'), +(22916, 32, 7471.49, -3092.55, 429.006, 0, ''), +(22916, 33, 7472.35, -3062.72, 428.341, 0, ''), +(22916, 34, 7472.26, -3054.92, 427.150, 0, ''), +(22916, 35, 7475.03, -3053.39, 428.672, 5000, 'collect 3'), +(22916, 36, 7472.40, -3057.21, 426.870, 5000, 'SAY_RELIC3'), +(22916, 37, 7472.39, -3062.86, 428.301, 0, ''), +(22916, 38, 7470.24, -3087.69, 429.045, 0, ''), +(22916, 39, 7475.24, -3099.03, 429.917, 0, ''), +(22916, 40, 7484.24, -3109.85, 432.719, 0, ''), +(22916, 41, 7489.10, -3111.31, 434.400, 0, ''), +(22916, 42, 7497.02, -3108.54, 434.798, 0, ''), +(22916, 43, 7497.75, -3097.70, 437.031, 0, ''), +(22916, 44, 7492.53, -3090.12, 440.041, 0, ''), +(22916, 45, 7490.43, -3085.44, 439.807, 0, ''), +(22916, 46, 7501.02, -3069.70, 441.875, 0, ''), +(22916, 47, 7509.15, -3064.67, 445.012, 0, ''), +(22916, 48, 7515.78, -3060.16, 445.727, 0, ''), +(22916, 49, 7516.46, -3058.11, 445.682, 10000, 'quest credit'); diff --git a/sql/Updates/0.0.3/r939_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r939_scriptdev2_script_texts.sql new file mode 100644 index 0000000..28508e7 --- /dev/null +++ b/sql/Updates/0.0.3/r939_scriptdev2_script_texts.sql @@ -0,0 +1,57 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1568078 AND -1568024; +INSERT INTO script_texts (entry, content_default, sound, type, language, emote, comment) VALUES +(-1568024,'Da eagles gonna bear your spirits to me. Your sacrifice is not gonna be in vein!',12122,1,0,0,'akilzon SAY_EVENT1'), +(-1568025,'Your death gonna be quick, strangers. You shoulda never have come to this place...',12123,1,0,0,'akilzon SAY_EVENT2'), +(-1568026,'I be da predator! You da prey...',12013,1,0,0,'akilzon SAY_AGGRO'), +(-1568027,'Feed, me bruddahs!',12014,1,0,0,'akilzon SAY_SUMMON'), +(-1568028,'Come, and join me bruddahs!',12015,1,0,0,'akilzon SAY_SUMMON_ALT'), +(-1568029,'All you be doing is wasting my time!',12016,1,0,0,'akilzon SAY_ENRAGE'), +(-1568030,'Ya got nothin\'!',12017,1,0,0,'akilzon SAY_SLAY1'), +(-1568031,'Stop your cryin\'!',12018,1,0,0,'akilzon SAY_SLAY2'), +(-1568032,'You can\'t... kill... me spirit!',12019,1,0,0,'akilzon SAY_DEATH'), +(-1568033,'An Electrical Storm Appears!',0,2,0,0,'akilzon EMOTE_STORM'), +(-1568034,'Get on ya knees and bow.... to da fang and claw!',12020,1,0,0,'halazzi SAY_AGGRO'), +(-1568035,'I fight wit\' untamed spirit....',12021,1,0,0,'halazzi SAY_SPLIT'), +(-1568036,'Spirit, come back to me!',12022,1,0,0,'halazzi SAY_MERGE'), +(-1568037,'Me gonna carve ya now!',12023,1,0,0,'halazzi SAY_SABERLASH1'), +(-1568038,'You gonna leave in pieces!',12024,1,0,0,'halazzi SAY_SABERLASH2'), +(-1568039,'Whatch you be doing? Pissin\' yourselves...',12025,1,0,0,'halazzi SAY_BERSERK'), +(-1568040,'You cant fight the power!',12026,1,0,0,'halazzi SAY_KILL1'), +(-1568041,'You gonna fail!',12027,1,0,0,'halazzi SAY_KILL2'), +(-1568042,'Chaga... choka\'jinn.',12028,1,0,0,'halazzi SAY_DEATH'), +(-1568043,'Come, fools. Fill ma empty cages...',12029,1,0,0,'halazzi SAY_EVENT1'), +(-1568044,'I be waitin, strangers. Your deaths gonna make me stronger!',12030,1,0,0,'halazzi SAY_EVENT2'), +(-1568045,'Da shadow gonna fall on you...',12041,1,0,0,'malacrass SAY_AGGRO'), +(-1568046,'Ya don\'t kill me yet, ya don\'t get another chance!',12042,1,0,0,'malacrass SAY_ENRAGE'), +(-1568047,'Dis a nightmare ya don\' wake up from!',12043,1,0,0,'malacrass SAY_KILL1'), +(-1568048,'Azzaga choogo zinn!',12044,1,0,0,'malacrass SAY_KILL2'), +(-1568049,'Your will belong ta me now!',12045,1,0,0,'malacrass SAY_SOUL_SIPHON'), +(-1568050,'Darkness comin\' for you...',12046,1,0,0,'malacrass SAY_DRAIN_POWER'), +(-1568051,'Your soul gonna bleed!',12047,1,0,0,'malacrass SAY_SPIRIT_BOLTS'), +(-1568052,'It not gonna make no difference.',12048,1,0,0,'malacrass SAY_ADD_DIED1'), +(-1568053,'You gonna die worse dan him.',12049,1,0,0,'malacrass SAY_ADD_DIED2'), +(-1568054,'Dat no bodda me.',12050,1,0,0,'malacrass SAY_ADD_DIED3'), +(-1568055,'Dis not... da end of me...',12051,1,0,0,'malacrass SAY_DEATH'), +(-1568056,'Everybody always wanna take from us. Now we gonna start takin\' back. Anybody who get in our way...gonna drown in dey own blood! Da Amani empire be back now...seekin\' vengeance. And we gonna start wit\' you.',12090,1,0,0,'zuljin SAY_INTRO'), +(-1568057,'Nobody badduh dan me!',12091,1,0,0,'zuljin SAY_AGGRO'), +(-1568058,'Got me some new tricks... like me brudda bear....',12092,1,0,0,'zuljin SAY_BEAR_TRANSFORM'), +(-1568059,'Dere be no hidin\' from da eagle!',12093,1,0,0,'zuljin SAY_EAGLE_TRANSFORM'), +(-1568060,'Let me introduce you to me new bruddas: fang and claw!',12094,1,0,0,'zuljin SAY_LYNX_TRANSFORM'), +(-1568061,'Ya don\' have to look to da sky to see da dragonhawk!',12095,1,0,0,'zuljin SAY_DRAGONHAWK_TRANSFORM'), +(-1568062,'Fire kill you just as quick!',12096,1,0,0,'zuljin SAY_FIRE_BREATH'), +(-1568063,'You too slow! Me too strong!',12097,1,0,0,'zuljin SAY_BERSERK'), +(-1568064,'Da Amani de chuka!',12098,1,0,0,'zuljin SAY_KILL1'), +(-1568065,'Lot more gonna fall like you!',12099,1,0,0,'zuljin SAY_KILL2'), +(-1568066,'Mebbe me fall...but da Amani empire...never gonna die...',12100,1,0,0,'zuljin SAY_DEATH'), +(-1568067,'Zul\'jin got a surprise for ya...',12052,1,0,0,'zulaman SAY_INST_RELEASE'), +(-1568068,'Da spirits gonna feast today! Begin da ceremonies, sacrifice da prisoners... make room for our new guests!',12053,1,0,0,'zulaman SAY_INST_BEGIN'), +(-1568069,'Take your pick, trespassers! Any of ma priests be happy to accommodate ya.',12054,1,0,0,'zulaman SAY_INST_PROGRESS_1'), +(-1568070,'Don\'t be shy. Thousands have come before you. Ya not be alone in your service.',12055,1,0,0,'zulaman SAY_INST_PROGRESS_2'), +(-1568071,'Ya gonna fail, strangers. Many try before you, but dey only make us stronger!',12056,1,0,0,'zulaman SAY_INST_PROGRESS_3'), +(-1568072,'Your efforts was in vain, trespassers. The rituals nearly be complete.',12057,1,0,0,'zulaman SAY_INST_WARN_1'), +(-1568073,'Soon da cages gonna be empty, da sacrifices be complete, and you gonna take dere places.',12058,1,0,0,'zulaman SAY_INST_WARN_2'), +(-1568074,'Time be running low, strangers. Soon you gonna join da souls of dem ya failed to save.',12059,1,0,0,'zulaman SAY_INST_WARN_3'), +(-1568075,'Make haste, ma priests! Da rituals must not be interrupted!',12060,1,0,0,'zulaman SAY_INST_WARN_4'), +(-1568076,'Ya make a good try... but now you gonna join da ones who already fall.',12061,1,0,0,'zulaman SAY_INST_SACRIF1'), +(-1568077,'Ya not do too bad. Ya efforts [...] for a small time. Come to me now. Ya prove yourself worthy offerings.',12062,1,0,0,'zulaman SAY_INST_SACRIF2'), +(-1568078,'Watch now. Every offering gonna strengthen our ties to da spirit world. Soon, we gonna be unstoppable!',12065,1,0,0,'zulaman SAY_INST_COMPLETE'); diff --git a/sql/Updates/0.0.3/r940_mangos.sql b/sql/Updates/0.0.3/r940_mangos.sql new file mode 100644 index 0000000..7f25446 --- /dev/null +++ b/sql/Updates/0.0.3/r940_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_henry_stern' WHERE entry=8696; diff --git a/sql/Updates/0.0.3/r941_mangos.sql b/sql/Updates/0.0.3/r941_mangos.sql new file mode 100644 index 0000000..089a2da --- /dev/null +++ b/sql/Updates/0.0.3/r941_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_sacred_fire_of_life' WHERE entry=175944; diff --git a/sql/Updates/0.0.3/r945_mangos.sql b/sql/Updates/0.0.3/r945_mangos.sql new file mode 100644 index 0000000..f643e40 --- /dev/null +++ b/sql/Updates/0.0.3/r945_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_harrison_jones_za' WHERE entry=24358; +UPDATE gameobject_template SET ScriptName='go_strange_gong' WHERE entry=187359; diff --git a/sql/Updates/0.0.3/r945_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r945_scriptdev2_script_texts.sql new file mode 100644 index 0000000..bd14f85 --- /dev/null +++ b/sql/Updates/0.0.3/r945_scriptdev2_script_texts.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1568081 AND -1568079; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1568079,'Suit yourself. At least five of you must assist me if we\'re to get inside. Follow me.',0,1,0,0,'harrison SAY_START'), +(-1568080,'According to my calculations, if enough of us bang the gong at once the seal on these doors will break and we can enter.',0,1,0,0,'harrison SAY_AT_GONG'), +(-1568081,'I\'ve researched this site extensively and i won\'t allow any dim-witted treasure hunters to swoop in and steal what belongs to in a museum. I\'ll lead this charge.',0,1,0,0,'harrison SAY_OPEN_ENTRANCE'); diff --git a/sql/Updates/0.0.3/r945_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r945_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..b06146d --- /dev/null +++ b/sql/Updates/0.0.3/r945_scriptdev2_script_waypoint.sql @@ -0,0 +1,6 @@ +DELETE FROM script_waypoint WHERE entry=24358; +INSERT INTO script_waypoint VALUES +(24358, 0, 121.193970, 1645.619385, 42.021, 0, ''), +(24358, 1, 132.051468, 1642.176025, 42.021, 10000, 'SAY_AT_GONG'), +(24358, 2, 120.670631, 1636.346802, 42.415, 0, ''), +(24358, 3, 120.536003, 1611.654663, 43.473, 30000, 'SAY_OPEN_ENTRANCE'); diff --git a/sql/Updates/0.0.3/r947_mangos.sql b/sql/Updates/0.0.3/r947_mangos.sql new file mode 100644 index 0000000..dc24a72 --- /dev/null +++ b/sql/Updates/0.0.3/r947_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='boss_akilzon' WHERE entry=23574; +UPDATE creature_template SET ScriptName='boss_halazzi' WHERE entry=23577; +UPDATE creature_template SET ScriptName='boss_malacrass' WHERE entry=24239; +UPDATE creature_template SET ScriptName='boss_zuljin' WHERE entry=23863; diff --git a/sql/Updates/0.0.3/r949_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r949_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..2ad3cc9 --- /dev/null +++ b/sql/Updates/0.0.3/r949_scriptdev2_script_waypoint.sql @@ -0,0 +1,14 @@ +DELETE FROM script_waypoint WHERE entry=6575; +INSERT INTO script_waypoint VALUES +(6575, 0, 1945.81, -431.54, 16.36, 0, ''), +(6575, 1, 1946.21, -436.41, 16.36, 0, ''), +(6575, 2, 1950.01, -444.11, 14.63, 0, ''), +(6575, 3, 1956.08, -449.34, 13.12, 0, ''), +(6575, 4, 1966.59, -450.55, 11.27, 0, ''), +(6575, 5, 1976.09, -447.51, 11.27, 0, ''), +(6575, 6, 1983.42, -435.85, 11.27, 0, ''), +(6575, 7, 1978.17, -428.81, 11.27, 0, ''), +(6575, 8, 1973.97, -422.08, 9.04, 0, ''), +(6575, 9, 1963.84, -418.90, 6.17, 0, ''), +(6575, 10, 1961.22, -422.74, 6.17, 0, ''), +(6575, 11, 1964.80, -431.26, 6.17, 300000, ''); diff --git a/sql/Updates/0.0.3/r951_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r951_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..d9fc015 --- /dev/null +++ b/sql/Updates/0.0.3/r951_scriptdev2_script_waypoint.sql @@ -0,0 +1,19 @@ +DELETE FROM script_waypoint WHERE entry=3849; +INSERT INTO script_waypoint VALUES +(3849, 0, -252.92, 2126.82, 81.17, 0, ''), +(3849, 1, -253.88, 2131.11, 81.21, 0, ''), +(3849, 2, -249.66, 2142.45, 87.01, 0, ''), +(3849, 3, -248.08, 2143.68, 87.01, 0, ''), +(3849, 4, -238.87, 2139.93, 87.01, 0, ''), +(3849, 5, -235.47, 2149.18, 90.59, 0, ''), +(3849, 6, -239.89, 2156.06, 90.62, 20000, 'SAY_FREE'); + +DELETE FROM script_waypoint WHERE entry=3850; +INSERT INTO script_waypoint VALUES +(3850, 0, -255.33, 2117.99, 81.17, 0, ''), +(3850, 1, -253.88, 2131.11, 81.21, 0, ''), +(3850, 2, -249.66, 2142.45, 87.01, 0, ''), +(3850, 3, -248.08, 2143.68, 87.01, 0, ''), +(3850, 4, -238.87, 2139.93, 87.01, 0, ''), +(3850, 5, -235.47, 2149.18, 90.59, 0, ''), +(3850, 6, -239.89, 2156.06, 90.62, 20000, 'SAY_FREE'); diff --git a/sql/Updates/0.0.3/r953_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r953_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..b724b72 --- /dev/null +++ b/sql/Updates/0.0.3/r953_scriptdev2_script_waypoint.sql @@ -0,0 +1,142 @@ +DELETE FROM script_waypoint WHERE entry=17876; +INSERT INTO script_waypoint VALUES +(17876, 0, 2230.91, 118.765, 82.2947,5000, ''), +(17876, 1, 2230.33, 114.980, 82.2946, 0, ''), +(17876, 2, 2233.36, 111.057, 82.2996, 0, ''), +(17876, 3, 2231.17, 108.486, 82.6624, 0, ''), +(17876, 4, 2220.22, 114.605, 89.4264, 0, ''), +(17876, 5, 2215.23, 115.990, 89.4549, 0, ''), +(17876, 6, 2210.00, 106.849, 89.4549, 0, ''), +(17876, 7, 2205.66, 105.234, 89.4549, 0, ''), +(17876, 8, 2192.26, 112.618, 89.4549, 0, 'spawn armorer'), +(17876, 9, 2181.28, 118.612, 89.4549,8000, 'get weapon'), +(17876, 10, 2181.62, 120.385, 89.4549,5000, 'get armor'), +(17876, 11, 2189.44, 113.922, 89.4549, 0, ''), +(17876, 12, 2195.63, 110.584, 89.4549, 0, ''), +(17876, 13, 2201.09, 115.115, 89.4549, 0, ''), +(17876, 14, 2204.34, 121.036, 89.4355, 0, ''), +(17876, 15, 2208.66, 129.127, 87.9560, 0, 'first ambush'), +(17876, 16, 2193.09, 137.940, 88.2164, 0, ''), +(17876, 17, 2173.39, 149.064, 87.9227, 0, ''), +(17876, 18, 2164.25, 137.965, 85.0595, 0, ''), +(17876, 19, 2149.31, 125.645, 77.0858, 0, ''), +(17876, 20, 2142.78, 127.173, 75.5954, 0, ''), +(17876, 21, 2139.28, 133.952, 73.6386, 0, 'second ambush'), +(17876, 22, 2139.54, 155.235, 67.1269, 0, ''), +(17876, 23, 2145.38, 167.551, 64.8974, 0, ''), +(17876, 24, 2134.28, 175.304, 67.9446, 0, ''), +(17876, 25, 2118.08, 187.387, 68.8141, 0, ''), +(17876, 26, 2105.88, 195.461, 65.1854, 0, 'third ambush'), +(17876, 27, 2096.77, 196.939, 65.2117, 0, ''), +(17876, 28, 2083.90, 209.395, 64.8736, 0, ''), +(17876, 29, 2067.84, 224.376, 64.8022,30000, 'meeting scarloc'), +(17876, 30, 2055.40, 242.90, 63.3418, 0, 'after skarloc'), +(17876, 31, 2039.20, 266.460, 63.0182,10000, 'mount up'), +(17876, 32, 2011.77, 278.478, 65.3388, 0, ''), +(17876, 33, 2005.08, 289.676, 66.1179, 0, ''), +(17876, 34, 2033.11, 337.450, 66.0948, 0, ''), +(17876, 35, 2070.30, 416.208, 66.0893, 0, ''), +(17876, 36, 2086.76, 469.768, 65.9182, 0, ''), +(17876, 37, 2101.70, 497.955, 61.7881, 0, 'road ambush'), +(17876, 38, 2133.39, 530.933, 55.3700,5000, ''), +(17876, 39, 2157.91, 559.635, 48.5157, 0, ''), +(17876, 40, 2167.34, 586.191, 42.4394, 0, ''), +(17876, 41, 2174.17, 637.643, 33.9002, 0, ''), +(17876, 42, 2179.31, 656.053, 34.723, 0, ''), +(17876, 43, 2183.65, 670.941, 34.0318, 0, ''), +(17876, 44, 2201.50, 668.616, 36.1236, 0, ''), +(17876, 45, 2221.56, 652.747, 36.6153, 0, ''), +(17876, 46, 2238.97, 640.125, 37.2214, 0, ''), +(17876, 47, 2251.17, 620.574, 40.1473, 0, ''), +(17876, 48, 2261.98, 595.303, 41.4117, 0, ''), +(17876, 49, 2278.67, 560.172, 38.9090, 0, ''), +(17876, 50, 2336.72, 528.327, 40.9369, 0, ''), +(17876, 51, 2381.04, 519.612, 37.7312, 0, ''), +(17876, 52, 2412.20, 515.425, 39.2068, 0, ''), +(17876, 53, 2452.39, 516.174, 42.9387, 0, ''), +(17876, 54, 2467.38, 539.389, 47.4992, 0, ''), +(17876, 55, 2470.70, 554.333, 46.6668, 0, ''), +(17876, 56, 2478.07, 575.321, 55.4549, 0, ''), +(17876, 57, 2480.00, 585.408, 56.6921, 0, ''), +(17876, 58, 2482.67, 608.817, 55.6643, 0, ''), +(17876, 59, 2485.62, 626.061, 58.0132, 2000, 'dismount'), +(17876, 60, 2486.91, 626.356, 58.0761, 0, 'scare horse'), +(17876, 61, 2488.58, 660.940, 57.3913, 0, ''), +(17876, 62, 2502.56, 686.059, 55.6252, 0, ''), +(17876, 63, 2502.08, 694.360, 55.5083, 0, ''), +(17876, 64, 2491.46, 694.321, 55.7163, 0, ''), +(17876, 65, 2491.10, 703.300, 55.7630, 0, ''), +(17876, 66, 2485.64, 702.992, 55.7917, 0, ''), +(17876, 67, 2479.10, 695.291, 55.7901, 10000, ''), +(17876, 68, 2476.75, 693.689, 55.7960, 0, 'spawn mobs'), +(17876, 69, 2475.39, 695.983, 55.8146, 0, ''), +(17876, 70, 2477.75, 694.473, 55.7945, 0, ''), +(17876, 71, 2481.27, 697.747, 55.7910, 0, 'mobs in doorway'), +(17876, 72, 2486.31, 703.131, 55.7861, 5000, ''), +(17876, 73, 2490.76, 703.511, 55.7662, 0, ''), +(17876, 74, 2491.30, 694.792, 55.7195, 0, ''), +(17876, 75, 2518.69, 693.876, 55.1383, 0, ''), +(17876, 76, 2531.33, 681.914, 55.1383, 0, ''), +(17876, 77, 2568.25, 682.654, 55.1778, 0, ''), +(17876, 78, 2589.61, 689.981, 55.1421, 0, ''), +(17876, 79, 2634.74, 679.833, 54.6613, 0, ''), +(17876, 80, 2630.41, 661.464, 54.2761, 0, ''), +(17876, 81, 2629.00, 656.982, 56.0651, 0, ''), +(17876, 82, 2620.84, 633.007, 56.0300, 3000, 'stop in church'), +(17876, 83, 2622.99, 639.178, 56.0300, 0, 'summon'), +(17876, 84, 2628.73, 656.693, 56.0610, 5000, ''), +(17876, 85, 2630.34, 661.135, 54.2738, 0, ''), +(17876, 86, 2635.38, 672.243, 54.4508, 0, ''), +(17876, 87, 2644.13, 668.158, 55.3797, 0, ''), +(17876, 88, 2646.82, 666.740, 56.9898, 0, ''), +(17876, 89, 2658.22, 665.432, 57.1725, 0, ''), +(17876, 90, 2661.88, 674.849, 57.1725, 0, ''), +(17876, 91, 2656.23, 677.208, 57.1725, 0, ''), +(17876, 92, 2652.28, 670.270, 61.9353, 0, ''), +(17876, 93, 2650.79, 664.290, 61.9302, 0, 'summon inn'), +(17876, 94, 2658.19, 660.454, 61.9320, 5000, ''), +(17876, 95, 2660.57, 659.173, 61.9370, 0, 'speak with Taretha'), +(17876, 96, 2658.19, 660.454, 61.9320, 5000, 'epoch calls'), +(17876, 97, 2659.84, 659.482, 61.9361, 5000, 'taretha "dies"'), +(17876, 98, 2654.28, 662.722, 61.9313, 0, ''), +(17876, 99, 2652.37, 670.561, 61.9368, 0, ''), +(17876, 100, 2656.05, 676.761, 57.1727, 0, ''), +(17876, 101, 2658.49, 677.166, 57.1727, 0, ''), +(17876, 102, 2659.28, 667.117, 57.1727, 0, ''), +(17876, 103, 2649.71, 665.387, 57.1727, 0, ''), +(17876, 104, 2634.79, 672.964, 54.4577, 0, 'outside inn'), +(17876, 105, 2635.06, 673.892, 54.4713, 30000, 'getting ready'), +(17876, 106, 2634.79, 672.964, 54.4577, 60000, 'when all dead and meet Taretha'), +(17876, 107, 2631.72, 665.629, 54.2923, 0, 'run off'), +(17876, 108, 2647.40, 640.530, 55.7634, 0, ''); + +DELETE FROM script_waypoint WHERE entry=18887; +INSERT INTO script_waypoint VALUES +(18887, 0, 2650.06, 665.473, 61.9305, 0, ''), +(18887, 1, 2652.44, 670.761, 61.9370, 0, ''), +(18887, 2, 2655.96, 676.913, 57.1725, 0, ''), +(18887, 3, 2659.40, 677.317, 57.1725, 0, ''), +(18887, 4, 2651.75, 664.482, 57.1725, 0, ''), +(18887, 5, 2647.49, 666.595, 57.0824, 0, ''), +(18887, 6, 2644.37, 668.167, 55.4182, 0, ''), +(18887, 7, 2640.96, 669.890, 54.7567, 60000, ''); + +DELETE FROM script_waypoint WHERE entry=10096; +INSERT INTO script_waypoint VALUES +(10096, 0, 604.802673, -191.081985, -54.058590, 0,'ring'), +(10096, 1, 604.072998, -222.106918, -52.743759, 0,'first gate'), +(10096, 2, 621.400391, -214.499054, -52.814453, 0,'hiding in corner'), +(10096, 3, 601.300781, -198.556992, -53.950256, 0,'ring'), +(10096, 4, 631.818359, -180.548126, -52.654770, 0,'second gate'), +(10096, 5, 627.390381, -201.075974, -52.692917, 0,'hiding in corner'); + +DELETE FROM script_waypoint WHERE entry=9503; +INSERT INTO script_waypoint VALUES +(9503, 0, 883.294861, -188.926300, -43.703655, 0,''), +(9503, 1, 872.763550, -185.605621, -43.703655, 5000,'b1'), +(9503, 2, 867.923401, -188.006393, -43.703655, 5000,'b2'), +(9503, 3, 863.295898, -190.795212, -43.703655, 5000,'b3'), +(9503, 4, 856.139587, -194.652756, -43.703655, 5000,'b4'), +(9503, 5, 851.878906, -196.928131, -43.703655, 15000,'b5'), +(9503, 6, 877.035217, -187.048080, -43.703655, 0,''), +(9503, 7, 891.198000, -197.924000, -43.620400, 0,'home'); diff --git a/sql/Updates/0.0.3/r956_scriptdev2.sql b/sql/Updates/0.0.3/r956_scriptdev2.sql new file mode 100644 index 0000000..ad22ab6 --- /dev/null +++ b/sql/Updates/0.0.3/r956_scriptdev2.sql @@ -0,0 +1,27 @@ +DELETE FROM script_waypoint WHERE entry=12423; +INSERT INTO script_waypoint VALUES +(12423, 0, -9509.72, -147.03, 58.74, 0, ''), +(12423, 1, -9517.07, -172.82, 58.66, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12427; +INSERT INTO script_waypoint VALUES +(12427, 0, -5689.20, -456.44, 391.08, 0, ''), +(12427, 1, -5700.37, -450.77, 393.19, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12428; +INSERT INTO script_waypoint VALUES +(12428, 0, 2454.09, 361.26, 31.51, 0, ''), +(12428, 1, 2472.03, 378.08, 30.98, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12429; +INSERT INTO script_waypoint VALUES +(12429, 0, 9654.19, 909.58, 1272.11, 0, ''), +(12429, 1, 9642.53, 908.11, 1269.10, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12430; +INSERT INTO script_waypoint VALUES +(12430, 0, 161.65, -4779.34, 14.64, 0, ''), +(12430, 1, 140.71, -4813.56, 17.04, 0, ''); + +UPDATE script_texts SET emote=20 WHERE entry=-1000231; +UPDATE script_texts SET emote=4 WHERE entry IN (-1000232, -1000256, -1000258, -1000260, -1000262); diff --git a/sql/Updates/0.0.3/r963_mangos.sql b/sql/Updates/0.0.3/r963_mangos.sql new file mode 100644 index 0000000..63b3a23 --- /dev/null +++ b/sql/Updates/0.0.3/r963_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kingdom_of_dalaran_quests' WHERE entry IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162); diff --git a/sql/Updates/0.0.3/r964_mangos.sql b/sql/Updates/0.0.3/r964_mangos.sql new file mode 100644 index 0000000..be725f1 --- /dev/null +++ b/sql/Updates/0.0.3/r964_mangos.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET ScriptName='go_tele_to_dalaran_crystal' WHERE entry=191230; +UPDATE gameobject_template SET ScriptName='go_tele_to_violet_stand' WHERE entry=191229; diff --git a/sql/Updates/0.0.3/r965_mangos.sql b/sql/Updates/0.0.3/r965_mangos.sql new file mode 100644 index 0000000..c0285a4 --- /dev/null +++ b/sql/Updates/0.0.3/r965_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_oox17tn' WHERE entry=7784; diff --git a/sql/Updates/0.0.3/r965_scriptdev2.sql b/sql/Updates/0.0.3/r965_scriptdev2.sql new file mode 100644 index 0000000..ee30f1e --- /dev/null +++ b/sql/Updates/0.0.3/r965_scriptdev2.sql @@ -0,0 +1,46 @@ +DELETE FROM script_waypoint WHERE entry=7784; +INSERT INTO script_waypoint VALUES +(7784, 0, -8845.65, -4373.98, 43.87, 5000, 'SAY_START'), +(7784, 1, -8840.79, -4373.73, 44.24, 0, ''), +(7784, 2, -8837.43, -4373.56, 45.60, 0, ''), +(7784, 3, -8832.74, -4373.32, 45.68, 0, ''), +(7784, 4, -8829.37, -4373.14, 44.33, 0, ''), +(7784, 5, -8817.38, -4372.41, 35.58, 0, ''), +(7784, 6, -8803.47, -4371.60, 30.34, 0, ''), +(7784, 7, -8795.10, -4365.61, 26.08, 0, ''), +(7784, 8, -8766.78, -4367.13, 25.15, 0, ''), +(7784, 9, -8755.63, -4367.54, 24.63, 0, ''), +(7784, 10, -8754.42, -4365.59, 24.15, 0, ''), +(7784, 11, -8728.82, -4353.13, 20.90, 0, ''), +(7784, 12, -8706.60, -4356.55, 17.93, 0, ''), +(7784, 13, -8679.00, -4380.23, 12.64, 0, ''), +(7784, 14, -8642.96, -4393.82, 12.52, 0, ''), +(7784, 15, -8611.19, -4399.11, 9.55, 0, ''), +(7784, 16, -8554.87, -4409.32, 13.05, 0, ''), +(7784, 17, -8531.64, -4411.96, 11.20, 0, ''), +(7784, 18, -8510.40, -4414.38, 12.84, 0, ''), +(7784, 19, -8476.92, -4418.34, 9.71, 0, ''), +(7784, 20, -8435.89, -4426.74, 9.67, 0, ''), +(7784, 21, -8381.89, -4446.40, 10.23, 0, ''), +(7784, 22, -8351.15, -4447.79, 9.99, 5000, 'first ambush SAY_AMBUSH'), +(7784, 23, -8324.18, -4445.05, 9.71, 0, ''), +(7784, 24, -8138.94, -4384.78, 10.92, 0, ''), +(7784, 25, -8036.87, -4443.38, 9.65, 0, ''), +(7784, 26, -7780.92, -4761.81, 9.50, 0, ''), +(7784, 27, -7587.67, -4765.01, 8.96, 0, ''), +(7784, 28, -7497.65, -4792.86, 10.01, 0, 'second ambush SAY_AMBUSH'), +(7784, 29, -7391.54, -4774.26, 12.44, 0, ''), +(7784, 30, -7308.42, -4739.87, 12.65, 0, ''), +(7784, 31, -7016.11, -4751.12, 10.06, 0, ''), +(7784, 32, -6985.52, -4777.41, 10.26, 0, ''), +(7784, 33, -6953.02, -4786.00, 6.32, 0, ''), +(7784, 34, -6940.37, -4831.03, 0.67, 10000, 'quest complete SAY_END'); + +DELETE FROM script_texts WHERE entry BETWEEN -1000292 AND -1000287; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000287,'Emergency power activated! Initializing ambulancery motor! CLUCK!',0,0,0,0,'oox17 SAY_START'), +(-1000288,'Physical threat detected! Evasive action! CLUCK!',0,0,0,0,'oox17 SAY_AGGRO1'), +(-1000289,'Thread analyzed! Activating combat plan beta! CLUCK!',0,0,0,0,'oox17 SAY_AGGRO2'), +(-1000290,'CLUCK! Sensors detect spatial anomaly - danger imminent! CLUCK!',0,0,0,0,'oox17 SAY_AMBUSH'), +(-1000291,'No one challanges the Wastewander nomads - not even robotic chickens! ATTACK!',0,0,0,0,'oox17 SAY_AMBUSH_REPLY'), +(-1000292,'Cloaking systems online! CLUCK! Engaging cloak for transport to Booty Bay!',0,0,0,0,'oox17 SAY_END'); diff --git a/sql/Updates/0.0.3/r972_mangos.sql b/sql/Updates/0.0.3/r972_mangos.sql new file mode 100644 index 0000000..e295210 --- /dev/null +++ b/sql/Updates/0.0.3/r972_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_daphne_stilwell' WHERE entry=6182; diff --git a/sql/Updates/0.0.3/r972_scriptdev2.sql b/sql/Updates/0.0.3/r972_scriptdev2.sql new file mode 100644 index 0000000..295331c --- /dev/null +++ b/sql/Updates/0.0.3/r972_scriptdev2.sql @@ -0,0 +1,29 @@ +DELETE FROM script_waypoint WHERE entry=6182; +INSERT INTO script_waypoint VALUES +(6182, 0, -11480.684570, 1545.091187, 49.898571, 0, ''), +(6182, 1, -11466.825195, 1530.151733, 50.263611, 0, ''), +(6182, 2, -11465.213867, 1528.343750, 50.954369, 0, 'entrance hut'), +(6182, 3, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 4, -11461.000000, 1526.614014, 50.937702, 5000, 'pick up rifle'), +(6182, 5, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 6, -11465.213867, 1528.343750, 50.954369, 0, ''), +(6182, 7, -11468.353516, 1535.075562, 50.400948, 15000, 'hold, prepare for wave1'), +(6182, 8, -11468.353516, 1535.075562, 50.400948, 15000, 'hold, prepare for wave2'), +(6182, 9, -11468.353516, 1535.075562, 50.400948, 10000, 'hold, prepare for wave3'), +(6182, 10, -11467.898438, 1532.459595, 50.348885, 0, 'we are done'), +(6182, 11, -11466.064453, 1529.855225, 50.209351, 0, ''), +(6182, 12, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 13, -11461.000000, 1526.614014, 50.937702, 5000, 'deliver rifle'), +(6182, 14, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 15, -11465.213867, 1528.343750, 50.954369, 0, ''), +(6182, 16, -11470.260742, 1537.276733, 50.378487, 0, ''), +(6182, 17, -11475.581055, 1548.678833, 50.184380, 0, 'complete quest'), +(6182, 18, -11482.299805, 1557.410034, 48.624519, 0, ''); + +DELETE FROM script_texts WHERE entry BETWEEN -1000297 AND -1000293; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000293,'To the house! Stay close to me, no matter what! I have my gun and ammo there!',0,0,7,0,'stilwell SAY_DS_START'), +(-1000294,'We showed that one!',0,0,7,0,'stilwell SAY_DS_DOWN_1'), +(-1000295,'One more down!',0,0,7,0,'stilwell SAY_DS_DOWN_2'), +(-1000296,'We\'ve done it! We won!',0,0,7,0,'stilwell SAY_DS_DOWN_3'), +(-1000297,'Meet me down by the orchard--I just need to put my gun away.',0,0,7,0,'stilwell SAY_DS_PROLOGUE'); diff --git a/sql/Updates/0.0.3/r973_mangos.sql b/sql/Updates/0.0.3/r973_mangos.sql new file mode 100644 index 0000000..f460d7e --- /dev/null +++ b/sql/Updates/0.0.3/r973_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_oox22fe' WHERE entry=7807; diff --git a/sql/Updates/0.0.3/r973_scriptdev2_script_waypoint.sql b/sql/Updates/0.0.3/r973_scriptdev2_script_waypoint.sql new file mode 100644 index 0000000..aac25ab --- /dev/null +++ b/sql/Updates/0.0.3/r973_scriptdev2_script_waypoint.sql @@ -0,0 +1,40 @@ +DELETE FROM script_waypoint WHERE entry=7807; +INSERT INTO script_waypoint VALUES +(7807, 0, -4943.74, 1715.74, 62.74, 0, 'SAY_START'), +(7807, 1, -4944.93, 1706.66, 63.16, 0, ''), +(7807, 2, -4942.82, 1690.22, 64.25, 0, ''), +(7807, 3, -4946.47, 1669.62, 63.84, 0, ''), +(7807, 4, -4955.93, 1651.88, 63.00, 0, ''), +(7807, 5, -4967.58, 1643.86, 64.31, 0, ''), +(7807, 6, -4978.12, 1607.90, 64.30, 0, ''), +(7807, 7, -4975.38, 1596.16, 64.70, 0, ''), +(7807, 8, -4972.82, 1581.89, 61.75, 0, ''), +(7807, 9, -4958.65, 1581.05, 61.81, 0, ''), +(7807, 10, -4936.72, 1594.89, 65.96, 0, ''), +(7807, 11, -4885.69, 1598.10, 67.45, 4000, 'first ambush SAY_AMBUSH'), +(7807, 12, -4874.20, 1601.73, 68.54, 0, ''), +(7807, 13, -4816.64, 1594.47, 78.20, 0, ''), +(7807, 14, -4802.20, 1571.92, 87.01, 0, ''), +(7807, 15, -4746.40, 1576.11, 84.59, 0, ''), +(7807, 16, -4739.72, 1707.16, 94.04, 0, ''), +(7807, 17, -4674.03, 1840.44, 89.17, 0, ''), +(7807, 18, -4667.94, 1864.11, 85.18, 0, ''), +(7807, 19, -4668.08, 1886.39, 81.14, 0, ''), +(7807, 20, -4679.43, 1932.32, 73.76, 0, ''), +(7807, 21, -4674.17, 1946.66, 70.83, 5000, 'second ambush SAY_AMBUSH'), +(7807, 22, -4643.94, 1967.45, 65.27, 0, ''), +(7807, 23, -4595.60, 2010.75, 52.10, 0, ''), +(7807, 24, -4562.65, 2029.28, 45.41, 0, ''), +(7807, 25, -4538.56, 2032.65, 45.28, 0, ''), +(7807, 26, -4531.96, 2034.15, 48.34, 0, ''), +(7807, 27, -4507.75, 2039.32, 51.57, 0, ''), +(7807, 28, -4482.74, 2045.67, 48.15, 0, ''), +(7807, 29, -4460.87, 2051.54, 45.55, 0, ''), +(7807, 30, -4449.97, 2060.03, 45.51, 10000, 'third ambush SAY_AMBUSH'), +(7807, 31, -4448.99, 2079.05, 44.64, 0, ''), +(7807, 32, -4436.64, 2134.48, 28.83, 0, ''), +(7807, 33, -4429.25, 2170.20, 15.44, 0, ''), +(7807, 34, -4424.83, 2186.11, 11.48, 0, ''), +(7807, 35, -4416.71, 2209.76, 7.36, 0, ''), +(7807, 36, -4405.25, 2231.77, 5.94, 0, ''), +(7807, 37, -4377.61, 2265.45, 06.71, 15000, 'complete quest SAY_END'); diff --git a/sql/Updates/0.0.3/r975_mangos.sql b/sql/Updates/0.0.3/r975_mangos.sql new file mode 100644 index 0000000..1d68c09 --- /dev/null +++ b/sql/Updates/0.0.3/r975_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_wizzlecranks_shredder' WHERE entry=3439; diff --git a/sql/Updates/0.0.3/r975_scriptdev2.sql b/sql/Updates/0.0.3/r975_scriptdev2.sql new file mode 100644 index 0000000..bb2176e --- /dev/null +++ b/sql/Updates/0.0.3/r975_scriptdev2.sql @@ -0,0 +1,45 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000305 and -1000298; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000298, 'Alright, alright I think I can figure out how to operate this thing...',0,0,0,393,'wizzlecrank SAY_START'), +(-1000299, 'Arrrgh! This isn\'t right!',0,0,0,0,'wizzlecrank SAY_STARTUP1'), +(-1000300, 'Okay, I think I\'ve got it, now. Follow me, $n!',0,0,0,1,'wizzlecrank SAY_STARTUP2'), +(-1000301, 'There\'s the stolen shredder! Stop it or Lugwizzle will have our hides!',0,1,0,0,'wizzlecrank SAY_MERCENARY'), +(-1000302, 'Looks like we\'re out of woods, eh? Wonder what this does...',0,0,0,0,'wizzlecrank SAY_PROGRESS_1'), +(-1000303, 'Come on, don\'t break down on me now!',0,0,0,393,'wizzlecrank SAY_PROGRESS_2'), +(-1000304, 'That was a close one! Well, let\'s get going, it\'s still a ways to Ratchet!',0,0,0,0,'wizzlecrank SAY_PROGRESS_3'), +(-1000305, 'Hmm... I don\'t think this blinking red light is a good thing...',0,0,0,0,'wizzlecrank SAY_END'); + +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1109.15, -3104.11, 82.41, 5000, ''), +(3439, 1, 1105.39, -3102.86, 82.74, 1000, 'SAY_STARTUP1'), +(3439, 2, 1104.97, -3108.52, 83.10, 1000, ''), +(3439, 3, 1110.01, -3110.48, 82.81, 1000, ''), +(3439, 4, 1111.72, -3103.03, 82.21, 1000, ''), +(3439, 5, 1106.98, -3099.44, 82.18, 1000, ''), +(3439, 6, 1103.74, -3103.29, 83.05, 1000, ''), +(3439, 7, 1112.55, -3106.56, 82.31, 1000, ''), +(3439, 8, 1108.12, -3111.04, 82.99, 1000, ''), +(3439, 9, 1109.32, -3100.39, 82.08, 1000, ''), +(3439, 10, 1109.32, -3100.39, 82.08, 5000, 'SAY_STARTUP2'), +(3439, 11, 1098.92, -3095.14, 82.97, 0, ''), +(3439, 12, 1100.94, -3082.60, 82.83, 0, ''), +(3439, 13, 1101.12, -3068.83, 82.53, 0, ''), +(3439, 14, 1096.97, -3051.99, 82.50, 0, ''), +(3439, 15, 1094.06, -3036.79, 82.70, 0, ''), +(3439, 16, 1098.22, -3027.84, 83.79, 0, ''), +(3439, 17, 1109.51, -3015.92, 85.73, 0, ''), +(3439, 18, 1119.87, -3007.21, 87.08, 0, ''), +(3439, 19, 1130.23, -3002.49, 91.27, 5000, ''), +(3439, 20, 1130.23, -3002.49, 91.27, 3000, ''), +(3439, 21, 1130.23, -3002.49, 91.27, 4000, 'SAY_PROGRESS_1'), +(3439, 22, 1129.73, -2985.89, 92.46, 0, ''), +(3439, 23, 1124.10, -2983.29, 92.81, 0, ''), +(3439, 24, 1111.74, -2992.38, 91.59, 0, ''), +(3439, 25, 1111.06, -2976.54, 91.81, 0, ''), +(3439, 26, 1099.91, -2991.17, 91.67, 0, ''), +(3439, 27, 1096.32, -2981.55, 91.73, 8000, 'SAY_PROGRESS_2'), +(3439, 28, 1091.28, -2985.82, 91.74, 5000, 'SAY_PROGRESS_3'), +(3439, 29, 1091.28, -2985.82, 91.74, 0, ''), +(3439, 30, 1091.28, -2985.82, 91.74, 5000, 'SAY_END'), +(3439, 31, 1091.28, -2985.82, 91.74, 180000, ''); diff --git a/sql/Updates/0.0.3/r976_mangos.sql b/sql/Updates/0.0.3/r976_mangos.sql new file mode 100644 index 0000000..34fd35e --- /dev/null +++ b/sql/Updates/0.0.3/r976_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_deathstalker_erland' WHERE entry=1978; diff --git a/sql/Updates/0.0.3/r976_scriptdev2.sql b/sql/Updates/0.0.3/r976_scriptdev2.sql new file mode 100644 index 0000000..78d8b8e --- /dev/null +++ b/sql/Updates/0.0.3/r976_scriptdev2.sql @@ -0,0 +1,45 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000318 and -1000306; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000306, 'Let\'s get to the others, and keep an eye open for those wolves cutside...',0,0,1,0,'erland SAY_START_1'), +(-1000307, 'Be careful, $N. Those wolves like to hide among the trees.',0,0,1,0,'erland SAY_START_2'), +(-1000308, 'A $C attacks!',0,0,1,0,'erland SAY_AGGRO_1'), +(-1000309, 'Beware! I am under attack!',0,0,1,0,'erland SAY_AGGRO_2'), +(-1000310, 'Oh no! A $C is upon us!',0,0,1,0,'erland SAY_AGGRO_3'), +(-1000311, 'We\'re almost there!',0,0,1,0,'erland SAY_PROGRESS'), +(-1000312, 'We made it! Thanks, $N. I couldn\'t have gotten without you.',0,0,1,0,'erland SAY_END'), +(-1000313, 'It\'s good to see you again, Erland. What is your report?',0,0,33,1,'erland SAY_RANE'), +(-1000314, 'Masses of wolves are to the east, and whoever lived at Malden\'s Orchard is gone.',0,0,1,1,'erland SAY_RANE_REPLY'), +(-1000315, 'If I am excused, then I\'d like to check on Quinn...',0,0,1,1,'erland SAY_CHECK_NEXT'), +(-1000316, 'Hello, Quinn. How are you faring?',0,0,1,1,'erland SAY_QUINN'), +(-1000317, 'I\'ve been better. Ivar the Foul got the better of me...',0,0,33,1,'erland SAY_QUINN_REPLY'), +(-1000318, 'Try to take better care of yourself, Quinn. You were lucky this time.',0,0,1,1,'erland SAY_BYE'); + +DELETE FROM script_waypoint WHERE entry=1978; +INSERT INTO script_waypoint VALUES +(1978, 0, 1406.32, 1083.10, 52.55, 0, ''), +(1978, 1, 1400.49, 1080.42, 52.50, 0, 'SAY_START_2'), +(1978, 2, 1388.48, 1083.10, 52.52, 0, ''), +(1978, 3, 1370.16, 1084.02, 52.30, 0, ''), +(1978, 4, 1359.02, 1080.85, 52.46, 0, ''), +(1978, 5, 1341.43, 1087.39, 52.69, 0, ''), +(1978, 6, 1321.93, 1090.51, 50.66, 0, ''), +(1978, 7, 1312.98, 1095.91, 47.49, 0, ''), +(1978, 8, 1301.09, 1102.94, 47.76, 0, ''), +(1978, 9, 1297.73, 1106.35, 50.18, 0, ''), +(1978, 10, 1295.49, 1124.32, 50.49, 0, ''), +(1978, 11, 1294.84, 1137.25, 51.75, 0, ''), +(1978, 12, 1292.89, 1158.99, 52.65, 0, ''), +(1978, 13, 1290.75, 1168.67, 52.56, 2000, 'quest complete SAY_END'), +(1978, 14, 1287.12, 1203.49, 52.66, 5000, 'SAY_RANE'), +(1978, 15, 1288.30, 1203.89, 52.68, 5000, 'SAY_RANE_REPLY'), +(1978, 16, 1288.30, 1203.89, 52.68, 5000, 'SAY_CHECK_NEXT'), +(1978, 17, 1290.72, 1207.44, 52.69, 0, ''), +(1978, 18, 1297.50, 1207.18, 53.74, 0, ''), +(1978, 19, 1301.32, 1220.90, 53.74, 0, ''), +(1978, 20, 1298.55, 1220.43, 53.74, 0, ''), +(1978, 21, 1297.38, 1212.87, 58.51, 0, ''), +(1978, 22, 1297.80, 1210.04, 58.51, 0, ''), +(1978, 23, 1305.01, 1206.10, 58.51, 0, ''), +(1978, 24, 1310.51, 1207.36, 58.51, 5000, 'SAY_QUINN'), +(1978, 25, 1312.59, 1207.21, 58.51, 5000, 'SAY_QUINN_REPLY'), +(1978, 26, 1312.59, 1207.21, 58.51, 30000, 'SAY_BYE'); diff --git a/sql/Updates/0.0.3/r978_mangos.sql b/sql/Updates/0.0.3/r978_mangos.sql new file mode 100644 index 0000000..3e29342 --- /dev/null +++ b/sql/Updates/0.0.3/r978_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_ramparts' WHERE map=543; diff --git a/sql/Updates/0.0.3/r979_mangos.sql b/sql/Updates/0.0.3/r979_mangos.sql new file mode 100644 index 0000000..1c1ea25 --- /dev/null +++ b/sql/Updates/0.0.3/r979_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_kelerun_bloodmourn' WHERE entry=17807; +UPDATE gameobject_template SET ScriptName='go_harbinger_second_trial' WHERE entry=182052; diff --git a/sql/Updates/0.0.3/r979_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r979_scriptdev2_script_texts.sql new file mode 100644 index 0000000..bbc2665 --- /dev/null +++ b/sql/Updates/0.0.3/r979_scriptdev2_script_texts.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000322 AND -1000319; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000319, 'Let the trial begin, Bloodwrath, attack!',0,1,1,0,'kelerun SayId1'), +(-1000320, 'Champion Lightrend, make me proud!',0,1,1,0,'kelerun SayId2'), +(-1000321, 'Show this upstart how a real Blood Knight fights, Swiftblade!',0,1,1,0,'kelerun SayId3'), +(-1000322, 'Show $n the meaning of pain, Sunstriker!',0,1,1,0,'kelerun SayId4'); diff --git a/sql/Updates/0.0.3/r980_mangos.sql b/sql/Updates/0.0.3/r980_mangos.sql new file mode 100644 index 0000000..cba4c36 --- /dev/null +++ b/sql/Updates/0.0.3/r980_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_alexstrasza_wr_gate' WHERE entry=31333; diff --git a/sql/Updates/0.0.3/r982_mangos.sql b/sql/Updates/0.0.3/r982_mangos.sql new file mode 100644 index 0000000..fe164dd --- /dev/null +++ b/sql/Updates/0.0.3/r982_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_mist' WHERE entry=3568; diff --git a/sql/Updates/0.0.3/r982_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r982_scriptdev2_script_texts.sql new file mode 100644 index 0000000..0752d34 --- /dev/null +++ b/sql/Updates/0.0.3/r982_scriptdev2_script_texts.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry IN (-1000323, -1000324); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000323, 'Mist! I feared I would never see you again! Yes, I am well, do not worry for me. You must rest and recover your health.',0,0,7,0,'mist SAY_AT_HOME'), +(-1000324, 'growls in acknowledgement before straightening and making her way off into the forest.',0,2,0,0,'mist EMOTE_AT_HOME'); diff --git a/sql/Updates/0.0.3/r989_mangos.sql b/sql/Updates/0.0.3/r989_mangos.sql new file mode 100644 index 0000000..885a847 --- /dev/null +++ b/sql/Updates/0.0.3/r989_mangos.sql @@ -0,0 +1,4 @@ +UPDATE gameobject_template SET ScriptName='go_ethereum_prison' WHERE entry BETWEEN 184418 AND 184431; +UPDATE gameobject_template SET ScriptName='go_ethereum_stasis' WHERE entry BETWEEN 185465 AND 185467; +UPDATE gameobject_template SET ScriptName='go_ethereum_stasis' WHERE entry=184595; +UPDATE gameobject_template SET ScriptName='go_ethereum_stasis' WHERE entry BETWEEN 185461 AND 185464; diff --git a/sql/Updates/0.0.3/r990_mangos.sql b/sql/Updates/0.0.3/r990_mangos.sql new file mode 100644 index 0000000..d9492d0 --- /dev/null +++ b/sql/Updates/0.0.3/r990_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_engineering_tele_trinket' WHERE entry IN (14742,14743,21493,21494); diff --git a/sql/Updates/0.0.3/r991_scriptdev2.sql b/sql/Updates/0.0.3/r991_scriptdev2.sql new file mode 100644 index 0000000..65667aa --- /dev/null +++ b/sql/Updates/0.0.3/r991_scriptdev2.sql @@ -0,0 +1,46 @@ +DELETE FROM script_waypoint WHERE entry=3849; +INSERT INTO script_waypoint VALUES +(3849, 0, -250.923431, 2116.264160, 81.179, 0, 'SAY_FREE_AD'), +(3849, 1, -255.048538, 2119.392578, 81.179, 0, ''), +(3849, 2, -254.129105, 2123.454346, 81.179, 0, ''), +(3849, 3, -253.897552, 2130.873535, 81.179, 0, ''), +(3849, 4, -249.889435, 2142.307861, 86.972, 0, ''), +(3849, 5, -248.204926, 2144.017090, 87.013, 0, ''), +(3849, 6, -240.552826, 2140.552734, 87.012, 0, ''), +(3849, 7, -237.513916, 2142.066650, 87.012, 0, ''), +(3849, 8, -235.638138, 2149.231689, 90.587, 0, ''), +(3849, 9, -237.188019, 2151.946045, 90.624, 0, ''), +(3849, 10, -241.162064, 2153.649658, 90.624, 0, 'SAY_OPEN_DOOR_AD'), +(3849, 11, -241.129700, 2154.562988, 90.624, 5000, ''), +(3849, 12, -241.129700, 2154.562988, 90.624, 5000, 'SAY_POST1_DOOR_AD'), +(3849, 13, -241.129700, 2154.562988, 90.624, 25000, 'SAY_POST2_DOOR_AD'); + +DELETE FROM script_waypoint WHERE entry=3850; +INSERT INTO script_waypoint VALUES +(3850, 0, -241.816895, 2122.904053, 81.179, 0, 'SAY_FREE_AS'), +(3850, 1, -247.139297, 2124.886475, 81.179, 0, ''), +(3850, 2, -253.179184, 2127.406738, 81.179, 0, ''), +(3850, 3, -253.897552, 2130.873535, 81.179, 0, ''), +(3850, 4, -249.889435, 2142.307861, 86.972, 0, ''), +(3850, 5, -248.204926, 2144.017090, 87.013, 0, ''), +(3850, 6, -240.552826, 2140.552734, 87.012, 0, ''), +(3850, 7, -237.513916, 2142.066650, 87.012, 0, ''), +(3850, 8, -235.638138, 2149.231689, 90.587, 0, ''), +(3850, 9, -237.188019, 2151.946045, 90.624, 0, ''), +(3850, 10, -241.162064, 2153.649658, 90.624, 0, 'SAY_OPEN_DOOR_AS'), +(3850, 11, -241.129700, 2154.562988, 90.624, 5000, 'cast'), +(3850, 12, -241.129700, 2154.562988, 90.624, 5000, 'SAY_POST_DOOR_AS'), +(3850, 13, -241.129700, 2154.562988, 90.624, 25000, ''); + +UPDATE script_texts SET content_default='Follow me and I\'ll open the courtyard door for you.', language=7, comment='prisoner ashcrombe SAY_FREE_AS' WHERE entry=-1033000; + +DELETE FROM script_texts WHERE entry BETWEEN -1033008 AND -1033001; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1033001,'I have just the spell to get this door open. Too bad the cell doors weren\'t locked so haphazardly.',0,0,7,1,'prisoner ashcrombe SAY_OPEN_DOOR_AS'), +(-1033002,'There it is! Wide open. Good luck to you conquering what lies beyond. I must report back to the Kirin Tor at once!',0,0,7,1,'prisoner ashcrombe SAY_POST_DOOR_AS'), +(-1033003,'Free from this wretched cell at last! Let me show you to the courtyard....',0,0,1,1,'prisoner adamant SAY_FREE_AD'), +(-1033004,'You are indeed courageous for wanting to brave the horrors that lie beyond this door.',0,0,1,1,'prisoner adamant SAY_OPEN_DOOR_AD'), +(-1033005,'There we go!',0,0,1,1,'prisoner adamant SAY_POST1_DOOR_AD'), +(-1033006,'Good luck with Arugal. I must hurry back to Hadrec now.',0,0,1,1,'prisoner adamant SAY_POST2_DOOR_AD'), +(-1033007,'About time someone killed the wretch.',0,0,1,1,'prisoner adamant SAY_BOSS_DIE_AD'), +(-1033008,'For once I agree with you... scum.',0,0,7,1,'prisoner ashcrombe SAY_BOSS_DIE_AS'); diff --git a/sql/Updates/0.0.3/r992_mangos.sql b/sql/Updates/0.0.3/r992_mangos.sql new file mode 100644 index 0000000..aee0b65 --- /dev/null +++ b/sql/Updates/0.0.3/r992_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_shrine_of_the_birds' WHERE entry IN (185547,185553,185551); diff --git a/sql/Updates/0.0.3/r993_mangos.sql b/sql/Updates/0.0.3/r993_mangos.sql new file mode 100644 index 0000000..da40bad --- /dev/null +++ b/sql/Updates/0.0.3/r993_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_threshwackonator' WHERE entry=6669; diff --git a/sql/Updates/0.0.3/r993_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r993_scriptdev2_script_texts.sql new file mode 100644 index 0000000..652e44b --- /dev/null +++ b/sql/Updates/0.0.3/r993_scriptdev2_script_texts.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry IN (-1000325, -1000326); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000325, '"Threshwackonator First Mate unit prepared to follow"',0,2,0,0,'threshwackonator EMOTE_START'), +(-1000326, 'YARRR! Swabie, what have ye done?! He\'s gone mad! Baton him down the hatches! Hoist the mast! ARRRR! Every man for hi\'self!',0,0,7,0,'threshwackonator SAY_AT_CLOSE'); diff --git a/sql/Updates/0.0.3/r995_mangos.sql b/sql/Updates/0.0.3/r995_mangos.sql new file mode 100644 index 0000000..2e8ebe4 --- /dev/null +++ b/sql/Updates/0.0.3/r995_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_prospector_remtravel' WHERE entry=2917; diff --git a/sql/Updates/0.0.3/r995_scriptdev2.sql b/sql/Updates/0.0.3/r995_scriptdev2.sql new file mode 100644 index 0000000..df2f33d --- /dev/null +++ b/sql/Updates/0.0.3/r995_scriptdev2.sql @@ -0,0 +1,61 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000339 AND -1000327; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000327, 'Ok, $n, let\'s go find where I left that mysterious fossil. Follow me!',0,0,7,0,'remtravel SAY_REM_START'), +(-1000328, 'Now where did I put that mysterious fossil? Ah, maybe up there...',0,0,7,0,'remtravel SAY_REM_RAMP1_1'), +(-1000329, 'Hrm, nothing up here.',0,0,7,0,'remtravel SAY_REM_RAMP1_2'), +(-1000330, 'No mysterious fossil here... Ah, but my copy of Green Hills of Stranglethorn. What a good book!',0,0,7,0,'remtravel SAY_REM_BOOK'), +(-1000331, 'I bet you I left it in the tent!',0,0,7,0,'remtravel SAY_REM_TENT1_1'), +(-1000332, 'Oh wait, that\'s Hollee\'s tent... and it\'s empty.',0,0,7,0,'remtravel SAY_REM_TENT1_2'), +(-1000333, 'Interesting... I hadn\'t noticed this earlier...',0,0,7,0,'remtravel SAY_REM_MOSS'), +(-1000334, '%s inspects the ancient, mossy stone.',0,2,7,0,'remtravel EMOTE_REM_MOSS'), +(-1000335, 'Oh wait! I\'m supposed to be looking for that mysterious fossil!',0,0,7,0,'remtravel SAY_REM_MOSS_PROGRESS'), +(-1000336, 'Nope. didn\'t leave the fossil back here!',0,0,7,0,'remtravel SAY_REM_PROGRESS'), +(-1000337, 'Ah. I remember now! I gave the mysterious fossil to Hollee! Check with her.',0,0,7,0,'remtravel SAY_REM_REMEMBER'), +(-1000338, '%s goes back to work, oblivious to everything around him.',0,2,7,0,'remtravel EMOTE_REM_END'), +(-1000339, 'Something tells me this $r wants the mysterious fossil too. Help!',0,0,7,0,'remtravel SAY_REM_AGGRO'); + +DELETE FROM script_waypoint WHERE entry=2917; +INSERT INTO script_waypoint VALUES +(2917, 0, 4675.812500, 598.614563, 17.645658, 0, 'SAY_REM_START'), +(2917, 1, 4672.844238, 599.325378, 16.417622, 0, ''), +(2917, 2, 4663.449707, 607.430176, 10.494752, 0, ''), +(2917, 3, 4655.969238, 613.761353, 8.523270, 0, ''), +(2917, 4, 4640.804688, 623.999329, 8.377054, 0, ''), +(2917, 5, 4631.678711, 630.801086, 6.414999, 5000, 'SAY_REM_RAMP1_1'), +(2917, 6, 4633.533203, 632.476440, 6.509831, 0, 'ambush'), +(2917, 7, 4639.413574, 637.120789, 13.338119, 0, ''), +(2917, 8, 4642.352051, 637.668152, 13.437444, 0, ''), +(2917, 9, 4645.082031, 634.463989, 13.437208, 5000, 'SAY_REM_RAMP1_2'), +(2917, 10, 4642.345215, 637.584839, 13.435211, 0, ''), +(2917, 11, 4639.630859, 637.233765, 13.339752, 0, ''), +(2917, 12, 4633.363281, 632.462280, 6.488438, 0, ''), +(2917, 13, 4624.714844, 631.723511, 6.264030, 0, ''), +(2917, 14, 4623.525879, 629.718506, 6.201339, 5000, 'SAY_REM_BOOK'), +(2917, 15, 4623.452148, 630.369629, 6.218942, 0, 'SAY_REM_TENT1_1'), +(2917, 16, 4622.622070, 637.221558, 6.312845, 0, 'ambush'), +(2917, 17, 4619.755371, 637.386230, 6.312050, 5000, 'SAY_REM_TENT1_2'), +(2917, 18, 4620.027832, 637.367676, 6.312050, 0, ''), +(2917, 19, 4624.154785, 637.560303, 6.313898, 0, ''), +(2917, 20, 4622.967773, 634.016479, 6.294979, 0, ''), +(2917, 21, 4616.926758, 630.303284, 6.239193, 0, ''), +(2917, 22, 4614.546387, 616.983337, 5.687642, 0, ''), +(2917, 23, 4610.279297, 610.029419, 5.442539, 0, ''), +(2917, 24, 4601.149902, 604.111694, 2.054856, 0, ''), +(2917, 25, 4589.618164, 597.685730, 1.057147, 0, ''), +(2917, 26, 4577.588379, 592.145813, 1.120190, 0, 'SAY_REM_MOSS (?)'), +(2917, 27, 4569.848145, 592.177490, 1.260874, 5000, 'EMOTE_REM_MOSS (?)'), +(2917, 28, 4568.791992, 590.870911, 1.211338, 3000, 'SAY_REM_MOSS_PROGRESS (?)'), +(2917, 29, 4566.722656, 564.077881, 1.343084, 0, 'ambush'), +(2917, 30, 4568.269531, 551.958435, 5.004200, 0, ''), +(2917, 31, 4566.731934, 551.557861, 5.426314, 5000, 'SAY_REM_PROGRESS'), +(2917, 32, 4566.741699, 560.767639, 1.703257, 0, ''), +(2917, 33, 4573.916016, 582.566101, 0.749801, 0, ''), +(2917, 34, 4594.206055, 598.533020, 1.034056, 0, ''), +(2917, 35, 4601.194824, 604.283081, 2.060146, 0, ''), +(2917, 36, 4609.539551, 610.844727, 5.402220, 0, ''), +(2917, 37, 4624.800293, 618.076477, 5.851541, 0, ''), +(2917, 38, 4632.414063, 623.778442, 7.286243, 0, ''), +(2917, 39, 4645.915039, 621.983765, 8.579967, 0, ''), +(2917, 40, 4658.669922, 611.092651, 8.891747, 0, ''), +(2917, 41, 4671.924316, 599.752197, 16.01242, 5000, 'SAY_REM_REMEMBER'), +(2917, 42, 4676.976074, 600.649780, 17.82566, 5000, 'EMOTE_REM_END'); diff --git a/sql/Updates/0.0.3/r997_mangos.sql b/sql/Updates/0.0.3/r997_mangos.sql new file mode 100644 index 0000000..28e4a27 --- /dev/null +++ b/sql/Updates/0.0.3/r997_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_myranda_the_hag' WHERE entry=11872; diff --git a/sql/Updates/0.0.3/r998_mangos.sql b/sql/Updates/0.0.3/r998_mangos.sql new file mode 100644 index 0000000..905da16 --- /dev/null +++ b/sql/Updates/0.0.3/r998_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_kyle_the_frenzied' WHERE entry=23616; diff --git a/sql/Updates/0.0.3/r998_scriptdev2_script_texts.sql b/sql/Updates/0.0.3/r998_scriptdev2_script_texts.sql new file mode 100644 index 0000000..43eda0c --- /dev/null +++ b/sql/Updates/0.0.3/r998_scriptdev2_script_texts.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000342 AND -1000340; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000340, '%s howls in delight at the sight of his lunch!',0,2,0,0,'kyle EMOTE_SEE_LUNCH'), +(-1000341, '%s eats his lunch.',0,2,0,0,'kyle EMOTE_EAT_LUNCH'), +(-1000342, '%s thanks you with a special dance.',0,2,0,0,'kyle EMOTE_DANCE'); diff --git a/sql/Updates/0.0.4/Makefile.am b/sql/Updates/0.0.4/Makefile.am new file mode 100644 index 0000000..794bb0f --- /dev/null +++ b/sql/Updates/0.0.4/Makefile.am @@ -0,0 +1,69 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse + +## Change installation location +# datadir = scriptdev2/sql/updates/0.0.4 +pkgdatadir = $(datadir)/scriptdev2/sql/updates/0.0.4 + +## Files to be installed +# Install basic SQL files to datadir +pkgdata_DATA = \ + r1453_scriptdev2.sql \ + r1457_scriptdev2.sql \ + r1459_mangos.sql \ + r1460_mangos.sql \ + r1461_mangos.sql \ + r1461_scriptdev2.sql \ + r1463_mangos.sql \ + r1465_scriptdev2.sql \ + r1466_scriptdev2.sql \ + r1470_scriptdev2.sql \ + r1473_scriptdev2.sql \ + r1474_scriptdev2.sql \ + r1476_mangos.sql \ + r1476_scriptdev2.sql \ + r1478_scriptdev2.sql \ + r1486_mangos.sql \ + r1490_scriptdev2.sql \ + r1492_mangos.sql \ + r1493_scriptdev2.sql \ + r1494_mangos.sql \ + r1496_mangos.sql \ + r1498_mangos.sql \ + r1500_mangos.sql \ + r1502_mangos.sql \ + r1503_scriptdev2.sql \ + r1504_scriptdev2.sql \ + r1506_scriptdev2.sql \ + r1508_mangos.sql \ + r1513_scriptdev2.sql \ + r1516_mangos.sql \ + r1516_scriptdev2.sql \ + r1517_scriptdev2.sql \ + r1519_mangos.sql \ + r1523_mangos.sql \ + r1524_scriptdev2.sql \ + r1525_mangos.sql \ + r1525_scriptdev2.sql \ + r1531_mangos.sql \ + r1536_mangos.sql \ + r1538_mangos.sql \ + r1540_mangos.sql \ + r1540_scriptdev2.sql \ + r1542_mangos.sql diff --git a/sql/Updates/0.0.4/r1453_scriptdev2.sql b/sql/Updates/0.0.4/r1453_scriptdev2.sql new file mode 100644 index 0000000..0eead85 --- /dev/null +++ b/sql/Updates/0.0.4/r1453_scriptdev2.sql @@ -0,0 +1,6 @@ +UPDATE script_texts SET content_default='$N! I\'m watching you!' WHERE entry=-1309018; +UPDATE script_texts SET type=4 WHERE entry=-1309019; + +DELETE FROM script_texts WHERE entry=-1309024; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1309024,'%s goes into a rage after seeing his raptor fall in battle!',0,2,0,0,'mandokir EMOTE_RAGE'); diff --git a/sql/Updates/0.0.4/r1457_scriptdev2.sql b/sql/Updates/0.0.4/r1457_scriptdev2.sql new file mode 100644 index 0000000..25d1c13 --- /dev/null +++ b/sql/Updates/0.0.4/r1457_scriptdev2.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry=-1000005; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000005,'%s goes into a frenzy!',0,3,0,0,'EMOTE_BOSS_GENERIC_FRENZY'); + +UPDATE script_texts SET content_default='REUSE ME', type=0, comment='REUSE ME' WHERE entry IN (-1000156, -1269018, -1469031, -1601013, -1409001, -1469002); diff --git a/sql/Updates/0.0.4/r1459_mangos.sql b/sql/Updates/0.0.4/r1459_mangos.sql new file mode 100644 index 0000000..64dc493 --- /dev/null +++ b/sql/Updates/0.0.4/r1459_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_ahnkahet' WHERE map=619; diff --git a/sql/Updates/0.0.4/r1460_mangos.sql b/sql/Updates/0.0.4/r1460_mangos.sql new file mode 100644 index 0000000..f8b728b --- /dev/null +++ b/sql/Updates/0.0.4/r1460_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='mob_chaotic_rift' WHERE entry=26918; diff --git a/sql/Updates/0.0.4/r1461_mangos.sql b/sql/Updates/0.0.4/r1461_mangos.sql new file mode 100644 index 0000000..fd02e51 --- /dev/null +++ b/sql/Updates/0.0.4/r1461_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_annhylde' WHERE entry=24068; diff --git a/sql/Updates/0.0.4/r1461_scriptdev2.sql b/sql/Updates/0.0.4/r1461_scriptdev2.sql new file mode 100644 index 0000000..502c99c --- /dev/null +++ b/sql/Updates/0.0.4/r1461_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1574022; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1574022,'%s roars!',0,3,0,0,'ingvar EMOTE_ROAR'); diff --git a/sql/Updates/0.0.4/r1463_mangos.sql b/sql/Updates/0.0.4/r1463_mangos.sql new file mode 100644 index 0000000..bed3ee8 --- /dev/null +++ b/sql/Updates/0.0.4/r1463_mangos.sql @@ -0,0 +1,4 @@ +DELETE FROM areatrigger_scripts WHERE entry=5140; +INSERT INTO areatrigger_scripts VALUES (5140,'at_svala_intro'); + +UPDATE instance_template SET script='instance_pinnacle' WHERE map=575; diff --git a/sql/Updates/0.0.4/r1465_scriptdev2.sql b/sql/Updates/0.0.4/r1465_scriptdev2.sql new file mode 100644 index 0000000..55bb495 --- /dev/null +++ b/sql/Updates/0.0.4/r1465_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8623+) '; diff --git a/sql/Updates/0.0.4/r1466_scriptdev2.sql b/sql/Updates/0.0.4/r1466_scriptdev2.sql new file mode 100644 index 0000000..6389038 --- /dev/null +++ b/sql/Updates/0.0.4/r1466_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8627+) '; diff --git a/sql/Updates/0.0.4/r1470_scriptdev2.sql b/sql/Updates/0.0.4/r1470_scriptdev2.sql new file mode 100644 index 0000000..2a0f07a --- /dev/null +++ b/sql/Updates/0.0.4/r1470_scriptdev2.sql @@ -0,0 +1,12 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1533129 AND -1533120; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533120,'Hah hah, I\'m just getting warmed up!',8852,1,0,0,'razuvious SAY_AGGRO1'), +(-1533121,'Stand and fight!',8853,1,0,0,'razuvious SAY_AGGRO2'), +(-1533122,'Show me what you\'ve got!',8854,1,0,0,'razuvious SAY_AGGRO3'), +(-1533123,'Sweep the leg! Do you have a problem with that?',8861,1,0,0,'razuvious SAY_SLAY1'), +(-1533124,'You should have stayed home!',8862,1,0,0,'razuvious SAY_SLAY2'), +(-1533125,'Do as I taught you!',8855,1,0,0,'razuvious SAY_COMMAND1'), +(-1533126,'Show them no mercy!',8856,1,0,0,'razuvious SAY_COMMAND2'), +(-1533127,'You disappoint me, students!',8858,1,0,0,'razuvious SAY_COMMAND3'), +(-1533128,'The time for practice is over! Show me what you\'ve learned!',8859,1,0,0,'razuvious SAY_COMMAND4'), +(-1533129,'An honorable... death...',8860,1,0,0,'razuvious SAY_DEATH'); diff --git a/sql/Updates/0.0.4/r1473_scriptdev2.sql b/sql/Updates/0.0.4/r1473_scriptdev2.sql new file mode 100644 index 0000000..476e337 --- /dev/null +++ b/sql/Updates/0.0.4/r1473_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8642+) '; diff --git a/sql/Updates/0.0.4/r1474_scriptdev2.sql b/sql/Updates/0.0.4/r1474_scriptdev2.sql new file mode 100644 index 0000000..59da2db --- /dev/null +++ b/sql/Updates/0.0.4/r1474_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8645+) '; diff --git a/sql/Updates/0.0.4/r1476_mangos.sql b/sql/Updates/0.0.4/r1476_mangos.sql new file mode 100644 index 0000000..52825ae --- /dev/null +++ b/sql/Updates/0.0.4/r1476_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_headless_horseman' WHERE entry=23682; diff --git a/sql/Updates/0.0.4/r1476_scriptdev2.sql b/sql/Updates/0.0.4/r1476_scriptdev2.sql new file mode 100644 index 0000000..b178af5 --- /dev/null +++ b/sql/Updates/0.0.4/r1476_scriptdev2.sql @@ -0,0 +1,15 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1189034 AND -1189022; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1189022,'It is over, your search is done! Let fate choose now, the righteous one.',11961,1,0,0,'horseman SAY_ENTRANCE'), +(-1189023,'Here\'s my body, fit and pure! Now, your blackened souls I\'ll cure!',12567,1,0,0,'horseman SAY_REJOINED'), +(-1189024,'So eager you are for my blood to spill, yet to vanquish me this my head you must kill!',11969,1,0,0,'horseman SAY_BODY_DEFEAT'), +(-1189025,'Over here, you idiot!',12569,1,0,0,'horseman SAY_LOST_HEAD'), +(-1189026,'Harken, cur! Tis you I spurn! Now, $N, feel the burn!',12573,1,0,0,'horseman SAY_CONFLAGRATION'), +(-1189027,'Soldiers arise, stand and fight! Bring victory at last to this fallen knight!',11963,1,0,0,'horseman SAY_SPROUTING_PUMPKINS'), +(-1189028,'Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken.',11962,1,0,0,'horseman SAY_SLAY'), +(-1189029,'This end have I reached before. What new adventure lies in store?',11964,1,0,0,'horseman SAY_DEATH'), +(-1189030,'%s laughs.',0,2,0,0,'horseman EMOTE_LAUGH'), +(-1189031,'Horseman rise...',0,0,0,0,'horseman SAY_PLAYER1'), +(-1189032,'Your time is night...',0,0,0,0,'horseman SAY_PLAYER2'), +(-1189033,'You felt death once...',0,0,0,0,'horseman SAY_PLAYER3'), +(-1189034,'Now, know demise!',0,0,0,0,'horseman SAY_PLAYER4'); diff --git a/sql/Updates/0.0.4/r1478_scriptdev2.sql b/sql/Updates/0.0.4/r1478_scriptdev2.sql new file mode 100644 index 0000000..d0cd141 --- /dev/null +++ b/sql/Updates/0.0.4/r1478_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8659+) '; diff --git a/sql/Updates/0.0.4/r1481_scriptdev2.sql b/sql/Updates/0.0.4/r1481_scriptdev2.sql new file mode 100644 index 0000000..089538a --- /dev/null +++ b/sql/Updates/0.0.4/r1481_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8735+) '; diff --git a/sql/Updates/0.0.4/r1486_mangos.sql b/sql/Updates/0.0.4/r1486_mangos.sql new file mode 100644 index 0000000..b49cb0f --- /dev/null +++ b/sql/Updates/0.0.4/r1486_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='' WHERE npcflag!=npcflag|65536 AND ScriptName='npc_innkeeper'; +UPDATE creature_template SET ScriptName='npc_innkeeper' WHERE npcflag=npcflag|65536; diff --git a/sql/Updates/0.0.4/r1490_scriptdev2.sql b/sql/Updates/0.0.4/r1490_scriptdev2.sql new file mode 100644 index 0000000..d22c888 --- /dev/null +++ b/sql/Updates/0.0.4/r1490_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8758+) '; diff --git a/sql/Updates/0.0.4/r1492_mangos.sql b/sql/Updates/0.0.4/r1492_mangos.sql new file mode 100644 index 0000000..3a161ff --- /dev/null +++ b/sql/Updates/0.0.4/r1492_mangos.sql @@ -0,0 +1,2 @@ +DELETE FROM areatrigger_scripts WHERE entry=4591; +INSERT INTO areatrigger_scripts VALUES (4591,'at_coilfang_waterfall'); diff --git a/sql/Updates/0.0.4/r1493_scriptdev2.sql b/sql/Updates/0.0.4/r1493_scriptdev2.sql new file mode 100644 index 0000000..3ed275b --- /dev/null +++ b/sql/Updates/0.0.4/r1493_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8759+) '; diff --git a/sql/Updates/0.0.4/r1494_mangos.sql b/sql/Updates/0.0.4/r1494_mangos.sql new file mode 100644 index 0000000..f539dfc --- /dev/null +++ b/sql/Updates/0.0.4/r1494_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_ruins_of_ahnqiraj' WHERE map=509; diff --git a/sql/Updates/0.0.4/r1496_mangos.sql b/sql/Updates/0.0.4/r1496_mangos.sql new file mode 100644 index 0000000..de4872f --- /dev/null +++ b/sql/Updates/0.0.4/r1496_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName = 'mob_ahnkahar_egg' WHERE entry IN (30172,30173); diff --git a/sql/Updates/0.0.4/r1498_mangos.sql b/sql/Updates/0.0.4/r1498_mangos.sql new file mode 100644 index 0000000..53631c6 --- /dev/null +++ b/sql/Updates/0.0.4/r1498_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName = 'npc_frostborn_scout' WHERE entry = 29811; diff --git a/sql/Updates/0.0.4/r1500_mangos.sql b/sql/Updates/0.0.4/r1500_mangos.sql new file mode 100644 index 0000000..47ed04d --- /dev/null +++ b/sql/Updates/0.0.4/r1500_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_tabard_vendor' WHERE entry=28776; diff --git a/sql/Updates/0.0.4/r1502_mangos.sql b/sql/Updates/0.0.4/r1502_mangos.sql new file mode 100644 index 0000000..8c67e6e --- /dev/null +++ b/sql/Updates/0.0.4/r1502_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_mcgoyver' WHERE entry=24040; diff --git a/sql/Updates/0.0.4/r1503_scriptdev2.sql b/sql/Updates/0.0.4/r1503_scriptdev2.sql new file mode 100644 index 0000000..6881278 --- /dev/null +++ b/sql/Updates/0.0.4/r1503_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8828+) '; diff --git a/sql/Updates/0.0.4/r1504_scriptdev2.sql b/sql/Updates/0.0.4/r1504_scriptdev2.sql new file mode 100644 index 0000000..5da8b9f --- /dev/null +++ b/sql/Updates/0.0.4/r1504_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8831+) '; diff --git a/sql/Updates/0.0.4/r1506_scriptdev2.sql b/sql/Updates/0.0.4/r1506_scriptdev2.sql new file mode 100644 index 0000000..8214c89 --- /dev/null +++ b/sql/Updates/0.0.4/r1506_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8868+) '; diff --git a/sql/Updates/0.0.4/r1508_mangos.sql b/sql/Updates/0.0.4/r1508_mangos.sql new file mode 100644 index 0000000..9a0c3fd --- /dev/null +++ b/sql/Updates/0.0.4/r1508_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_locksmith' WHERE entry IN (29665,29725,29728); diff --git a/sql/Updates/0.0.4/r1513_scriptdev2.sql b/sql/Updates/0.0.4/r1513_scriptdev2.sql new file mode 100644 index 0000000..5cfebfc --- /dev/null +++ b/sql/Updates/0.0.4/r1513_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 8900+) '; diff --git a/sql/Updates/0.0.4/r1516_mangos.sql b/sql/Updates/0.0.4/r1516_mangos.sql new file mode 100644 index 0000000..66e1cf5 --- /dev/null +++ b/sql/Updates/0.0.4/r1516_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='mob_sladran_summon_target' WHERE entry=29682; diff --git a/sql/Updates/0.0.4/r1516_scriptdev2.sql b/sql/Updates/0.0.4/r1516_scriptdev2.sql new file mode 100644 index 0000000..757891e --- /dev/null +++ b/sql/Updates/0.0.4/r1516_scriptdev2.sql @@ -0,0 +1,2 @@ +UPDATE script_texts SET comment='sladran SAY_SUMMON_CONSTRICTOR' WHERE entry=-1604002; + \ No newline at end of file diff --git a/sql/Updates/0.0.4/r1517_scriptdev2.sql b/sql/Updates/0.0.4/r1517_scriptdev2.sql new file mode 100644 index 0000000..a876d78 --- /dev/null +++ b/sql/Updates/0.0.4/r1517_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1604029; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1604029,'%s transforms into a Mammoth!',14724,2,0,0,'moorabi EMOTE_TRANSFORMED'); diff --git a/sql/Updates/0.0.4/r1519_mangos.sql b/sql/Updates/0.0.4/r1519_mangos.sql new file mode 100644 index 0000000..f2f64e0 --- /dev/null +++ b/sql/Updates/0.0.4/r1519_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='mob_anubisath_guardian' WHERE entry=15355; diff --git a/sql/Updates/0.0.4/r1523_mangos.sql b/sql/Updates/0.0.4/r1523_mangos.sql new file mode 100644 index 0000000..861aacd --- /dev/null +++ b/sql/Updates/0.0.4/r1523_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_sunken_temple' WHERE map=109; diff --git a/sql/Updates/0.0.4/r1524_scriptdev2.sql b/sql/Updates/0.0.4/r1524_scriptdev2.sql new file mode 100644 index 0000000..c676547 --- /dev/null +++ b/sql/Updates/0.0.4/r1524_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9062+) '; diff --git a/sql/Updates/0.0.4/r1525_mangos.sql b/sql/Updates/0.0.4/r1525_mangos.sql new file mode 100644 index 0000000..5d37769 --- /dev/null +++ b/sql/Updates/0.0.4/r1525_mangos.sql @@ -0,0 +1,3 @@ +DELETE FROM areatrigger_scripts WHERE entry=4016; +INSERT INTO areatrigger_scripts VALUES (4016,'at_shade_of_eranikus'); +UPDATE creature_template SET ScriptName='npc_malfurion_stormrage' WHERE entry=15362; diff --git a/sql/Updates/0.0.4/r1525_scriptdev2.sql b/sql/Updates/0.0.4/r1525_scriptdev2.sql new file mode 100644 index 0000000..e78640b --- /dev/null +++ b/sql/Updates/0.0.4/r1525_scriptdev2.sql @@ -0,0 +1,7 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1109004 AND -1109000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1109000,'The walls of the chamber tremble. Something is happening...',0,2,0,0,'malfurion stormrage EMOTE_MALFURION'), +(-1109001,'Be steadfast, champion. I know why it is that you are here and I know what it is that you seek. Eranikus will not give up the shard freely. He has been twisted... twisted by the same force that you seek to destroy.',0,0,0,0,'malfurion stormrge SAY_MALFURION1'), +(-1109002,'Are you really surprised? Is it hard to believe that the power of an Old God could reach even inside the Dream? It is true - Eranikus, Tyrant of the Dream, wages a battle against us all. The Nightmare follows in his wake of destruction.',0,0,0,0,'malfurion stormrge SAY_MALFURION2'), +(-1109003,'Understand this, Eranikus wants nothing more than to be brought to Azeroth from the Dream. Once he is out, he will stop at nothing to destroy my physical manifestation. This, however, is the only way in which you could recover the scepter shard.',0,0,0,0,'malfurion stormrge SAY_MAFLURION3'), +(-1109004,'You will bring him back into this world, champion.',0,0,0,0,'malfurion Stormrge SAY_MALFURION4'); diff --git a/sql/Updates/0.0.4/r1531_mangos.sql b/sql/Updates/0.0.4/r1531_mangos.sql new file mode 100644 index 0000000..ade1afd --- /dev/null +++ b/sql/Updates/0.0.4/r1531_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET script='instance_halls_of_stone' WHERE map=599; diff --git a/sql/Updates/0.0.4/r1536_mangos.sql b/sql/Updates/0.0.4/r1536_mangos.sql new file mode 100644 index 0000000..dabae98 --- /dev/null +++ b/sql/Updates/0.0.4/r1536_mangos.sql @@ -0,0 +1,2 @@ +DELETE FROM areatrigger_scripts WHERE entry=4991; +INSERT INTO areatrigger_scripts VALUES (4991,'at_skadi'); diff --git a/sql/Updates/0.0.4/r1538_mangos.sql b/sql/Updates/0.0.4/r1538_mangos.sql new file mode 100644 index 0000000..2c112dc --- /dev/null +++ b/sql/Updates/0.0.4/r1538_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_liquid_fire_of_elune' WHERE entry IN (26616,26643); diff --git a/sql/Updates/0.0.4/r1540_mangos.sql b/sql/Updates/0.0.4/r1540_mangos.sql new file mode 100644 index 0000000..7c0a1d6 --- /dev/null +++ b/sql/Updates/0.0.4/r1540_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_woodlands_walker' WHERE entry=26421; diff --git a/sql/Updates/0.0.4/r1540_scriptdev2.sql b/sql/Updates/0.0.4/r1540_scriptdev2.sql new file mode 100644 index 0000000..1ee2fc4 --- /dev/null +++ b/sql/Updates/0.0.4/r1540_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry IN (-1000551,-1000552); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000551,'The %s is angered by your request and attacks!',0,2,0,0,'woodlands EMOTE_AGGRO'), +(-1000552,'Breaking off a piece of its bark, the %s hands it to you before departing.',0,2,0,0,'woodlands EMOTE_CREATE'); diff --git a/sql/Updates/0.0.4/r1542_mangos.sql b/sql/Updates/0.0.4/r1542_mangos.sql new file mode 100644 index 0000000..f8dc5db --- /dev/null +++ b/sql/Updates/0.0.4/r1542_mangos.sql @@ -0,0 +1 @@ +UPDATE item_template SET ScriptName='item_petrov_cluster_bombs' WHERE entry=33098; diff --git a/sql/Updates/Makefile.am b/sql/Updates/Makefile.am new file mode 100644 index 0000000..200963a --- /dev/null +++ b/sql/Updates/Makefile.am @@ -0,0 +1,171 @@ +# Copyright (C) 2005-2009 MaNGOS +# +# 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, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +## Process this file with automake to produce Makefile.in + +## Sub-directories to parse + +## Change installation location +# datadir = scriptdev2/sql/updates +pkgdatadir = $(datadir)/scriptdev2/sql/updates + +## Files to be installed +# Install basic SQL files to datadir +pkgdata_DATA = \ + r1543_scriptdev2.sql \ + r1544_mangos.sql \ + r1545_scriptdev2.sql \ + r1548_scriptdev2.sql \ + r1549_mangos.sql \ + r1549_scriptdev2.sql \ + r1551_mangos.sql \ + r1554_mangos.sql \ + r1554_scriptdev2.sql \ + r1555_scriptdev2.sql \ + r1556_mangos.sql \ + r1557_scriptdev2.sql \ + r1563_mangos.sql \ + r1567_mangos.sql \ + r1567_scriptdev2.sql \ + r1570_scriptdev2.sql \ + r1577_mangos.sql \ + r1577_scriptdev2.sql \ + r1583_scriptdev2.sql \ + r1584_scriptdev2.sql \ + r1587_scriptdev2.sql \ + r1589_mangos.sql \ + r1590_mangos.sql \ + r1591_mangos.sql \ + r1592_mangos.sql \ + r1593_mangos.sql \ + r1594_mangos.sql \ + r1595_mangos.sql \ + r1596_mangos.sql \ + r1599_mangos.sql \ + r1600_scriptdev2.sql \ + r1602_mangos.sql \ + r1604_mangos.sql \ + r1605_mangos.sql \ + r1607_mangos.sql \ + r1608_mangos.sql \ + r1615_mangos.sql \ + r1615_scriptdev2.sql \ + r1616_mangos.sql \ + r1617_mangos.sql \ + r1621_scriptdev2.sql \ + r1622_mangos.sql \ + r1622_scriptdev2.sql \ + r1624_mangos.sql \ + r1624_scriptdev2.sql \ + r1627_mangos.sql \ + r1627_scriptdev2.sql \ + r1629_mangos.sql \ + r1629_scriptdev2.sql \ + r1632_mangos.sql \ + r1636_mangos.sql \ + r1637_scriptdev2.sql \ + r1642_scriptdev2.sql \ + r1644_scriptdev2.sql \ + r1647_scriptdev2.sql \ + r1647_mangos.sql \ + r1650_mangos.sql \ + r1651_scriptdev2.sql \ + r1652_scriptdev2.sql \ + r1653_mangos.sql \ + r1658_scriptdev2.sql \ + r1660_scriptdev2.sql \ + r1661_mangos.sql \ + r1662_scriptdev2.sql \ + r1665_mangos.sql \ + r1667_mangos.sql \ + r1667_scriptdev2.sql \ + r1668_mangos.sql \ + r1671_mangos.sql \ + r1671_scriptdev2.sql \ + r1679_mangos.sql \ + r1680_mangos.sql \ + r1681_mangos.sql \ + r1683_scriptdev2.sql \ + r1685_mangos.sql \ + r1685_scriptdev2.sql \ + r1687_mangos.sql \ + r1691_mangos.sql \ + r1694_mangos.sql \ + r1698_mangos.sql \ + r1704_mangos.sql \ + r1705_mangos.sql \ + r1705_scriptdev2.sql \ + r1706_scriptdev2.sql \ + r1711_scriptdev2.sql \ + r1715_mangos.sql \ + r1715_scriptdev2.sql \ + r1720_mangos.sql \ + r1720_scriptdev2.sql \ + r1726_mangos.sql \ + r1727_scriptdev2.sql \ + r1728_mangos.sql \ + r1729_scriptdev2.sql \ + r1734_scriptdev2.sql \ + r1736_scriptdev2.sql \ + r1737_scriptdev2.sql \ + r1741_mangos.sql \ + r1750_scriptdev2.sql \ + r1751_scriptdev2.sql \ + r1752_mangos.sql \ + r1753_scriptdev2.sql \ + r1754_scriptdev2.sql \ + r1759_mangos.sql \ + r1763_mangos.sql \ + r1767_mangos.sql \ + r1771_scriptdev2.sql \ + r1777_scriptdev2.sql \ + r1780_scriptdev2.sql \ + r1782_scriptdev2.sql \ + r1783_scriptdev2.sql \ + r1784_scriptdev2.sql \ + r1785_scriptdev2.sql \ + r1786_scriptdev2.sql \ + r1789_scriptdev2.sql \ + r1791_scriptdev2.sql \ + r1797_mangos.sql \ + r1798_mangos.sql \ + r1800_mangos.sql \ + r1800_scriptdev2.sql \ + r1807_scriptdev2.sql \ + r1810_scriptdev2.sql \ + r1813_mangos.sql \ + r1816_scriptdev2.sql \ + r1818_mangos.sql \ + r1818_scriptdev2.sql \ + r1819_mangos.sql \ + r1822_scriptdev2.sql \ + r1824_mangos.sql \ + r1825_mangos.sql \ + r1825_scriptdev2.sql \ + r1826_mangos.sql \ + r1826_scriptdev2.sql \ + r1827_scriptdev2.sql \ + r1828_scriptdev2.sql \ + r1829_mangos.sql \ + r1830_scriptdev2.sql \ + r1831_scriptdev2.sql \ + r1836_mangos.sql \ + r1842_scriptdev2.sql \ + r1843_mangos.sql \ + r1843_scriptdev2.sql \ + r1844_mangos.sql \ + r1845_mangos.sql \ + r1845_scriptdev2.sql + diff --git a/sql/Updates/r1543_scriptdev2.sql b/sql/Updates/r1543_scriptdev2.sql new file mode 100644 index 0000000..bb46411 --- /dev/null +++ b/sql/Updates/r1543_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9136+) '; diff --git a/sql/Updates/r1544_mangos.sql b/sql/Updates/r1544_mangos.sql new file mode 100644 index 0000000..9eee102 --- /dev/null +++ b/sql/Updates/r1544_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_robot_reprogrammed' WHERE entry IN (25793,25758,25752,25792,25753); diff --git a/sql/Updates/r1545_scriptdev2.sql b/sql/Updates/r1545_scriptdev2.sql new file mode 100644 index 0000000..6b6bc8a --- /dev/null +++ b/sql/Updates/r1545_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9198+) '; diff --git a/sql/Updates/r1548_scriptdev2.sql b/sql/Updates/r1548_scriptdev2.sql new file mode 100644 index 0000000..15433ce --- /dev/null +++ b/sql/Updates/r1548_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9212+) '; diff --git a/sql/Updates/r1549_mangos.sql b/sql/Updates/r1549_mangos.sql new file mode 100644 index 0000000..c0c9e1d --- /dev/null +++ b/sql/Updates/r1549_mangos.sql @@ -0,0 +1,2 @@ +UPDATE item_template SET ScriptName='' WHERE entry=23654; +UPDATE gameobject_template SET ScriptName='go_school_of_red_snapper' WHERE entry=181616; diff --git a/sql/Updates/r1549_scriptdev2.sql b/sql/Updates/r1549_scriptdev2.sql new file mode 100644 index 0000000..9d0af78 --- /dev/null +++ b/sql/Updates/r1549_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9214+) '; diff --git a/sql/Updates/r1551_mangos.sql b/sql/Updates/r1551_mangos.sql new file mode 100644 index 0000000..91bfd61 --- /dev/null +++ b/sql/Updates/r1551_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_fire_of_akumai' WHERE entry IN (21118,21119,21120,21121); diff --git a/sql/Updates/r1554_mangos.sql b/sql/Updates/r1554_mangos.sql new file mode 100644 index 0000000..f95f510 --- /dev/null +++ b/sql/Updates/r1554_mangos.sql @@ -0,0 +1,3 @@ +UPDATE instance_template SET script='instance_violet_hold' WHERE map=608; +UPDATE creature_template SET ScriptName='npc_door_seal' WHERE entry=30896; +UPDATE creature_template SET ScriptName='npc_sinclari' WHERE entry=30658; diff --git a/sql/Updates/r1554_scriptdev2.sql b/sql/Updates/r1554_scriptdev2.sql new file mode 100644 index 0000000..eb45da2 --- /dev/null +++ b/sql/Updates/r1554_scriptdev2.sql @@ -0,0 +1,18 @@ +DELETE FROM script_waypoint WHERE entry=30658; +INSERT INTO script_waypoint VALUES +(30658, 0, 1830.504517, 799.356506, 44.341801, 5000, 'use activation'), +(30658, 1, 1832.461792, 800.431396, 44.311745, 10000, 'SAY_BEGIN call back guards'), +(30658, 2, 1824.786987, 803.828369, 44.363434, 0, 'SAY_LOCK_DOOR close door'), +(30658, 3, 1807.245483, 803.904114, 44.363434, 0, ''), +(30658, 4, 1785.160400, 803.856873, 44.364830, 30000, ''); + +DELETE FROM script_texts WHERE entry BETWEEN -1608007 AND -1608000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1608000,'Prison guards, we are leaving! These adventurers are taking over! Go, go, go!',0,1,0,0,'sinclair SAY_BEGIN'), +(-1608001,'I\'m locking the door. Good luck, and thank you for doing this.',0,0,0,0,'sinclair SAY_LOCK_DOOR'), +(-1608002,'Adventurers, the door is beinning to weaken!',0,1,0,0,'sinclair SAY_SEAL_75'), +(-1608003,'Only half of the door seal\'s strength remains! You must fight on!',0,1,0,0,'sinclair SAY_SEAL_50'), +(-1608004,'The door seal is about to collapse! All is lost if the Blue Dragonflight breaks through the door!',0,1,0,0,'sinclair SAY_SEAL_5'), +(-1608005,'A Portal Guardian defends the new portal!',0,3,0,0,'EMOTE_GUARDIAN_PORTAL'), +(-1608006,'An elite Blue Dragonflight squad appears from the portal!',0,3,0,0,'EMOTE_DRAGONFLIGHT_PORTAL'), +(-1608007,'A Guardian Keeper emerges from the portal!',0,3,0,0,'EMOTE_KEEPER_PORTAL'); diff --git a/sql/Updates/r1555_scriptdev2.sql b/sql/Updates/r1555_scriptdev2.sql new file mode 100644 index 0000000..d56c055 --- /dev/null +++ b/sql/Updates/r1555_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9245+) '; diff --git a/sql/Updates/r1556_mangos.sql b/sql/Updates/r1556_mangos.sql new file mode 100644 index 0000000..dd96f01 --- /dev/null +++ b/sql/Updates/r1556_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_teleportation_portal' WHERE entry IN (31011,30679,32174); +UPDATE gameobject_template SET ScriptName='go_activation_crystal' WHERE entry=193611; diff --git a/sql/Updates/r1557_scriptdev2.sql b/sql/Updates/r1557_scriptdev2.sql new file mode 100644 index 0000000..1f1320d --- /dev/null +++ b/sql/Updates/r1557_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9282+) '; diff --git a/sql/Updates/r1563_mangos.sql b/sql/Updates/r1563_mangos.sql new file mode 100644 index 0000000..e9ef7fd --- /dev/null +++ b/sql/Updates/r1563_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_apprentice_mirveda' WHERE entry=15402; diff --git a/sql/Updates/r1567_mangos.sql b/sql/Updates/r1567_mangos.sql new file mode 100644 index 0000000..d2af52b --- /dev/null +++ b/sql/Updates/r1567_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_deathstalker_faerleia' WHERE entry=2058; diff --git a/sql/Updates/r1567_scriptdev2.sql b/sql/Updates/r1567_scriptdev2.sql new file mode 100644 index 0000000..5a8b376 --- /dev/null +++ b/sql/Updates/r1567_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry IN (-1000553,-1000554); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000553,'Be ready, $N. I hear the council returning. Prepare to ambush!',0,0,0,0,'deathstalker_faerleia SAY_START'), +(-1000554,'Well done. A blow to Arugal no doubt!',0,0,0,0,'deathstalker_faerleia SAY_END'); diff --git a/sql/Updates/r1570_scriptdev2.sql b/sql/Updates/r1570_scriptdev2.sql new file mode 100644 index 0000000..0f17bef --- /dev/null +++ b/sql/Updates/r1570_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 986e5b76ae8758d8c895edce483c8cb84801c57d +) '; diff --git a/sql/Updates/r1577_mangos.sql b/sql/Updates/r1577_mangos.sql new file mode 100644 index 0000000..3822788 --- /dev/null +++ b/sql/Updates/r1577_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='npc_arugal' WHERE entry=10000; +UPDATE creature_template SET ScriptName='npc_deathstalker_vincent' WHERE entry=4444; +UPDATE creature_template SET ScriptName='mob_arugal_voidwalker' WHERE entry=4627; +UPDATE creature_template SET ScriptName='boss_arugal' WHERE entry=4275; diff --git a/sql/Updates/r1577_scriptdev2.sql b/sql/Updates/r1577_scriptdev2.sql new file mode 100644 index 0000000..8e54c57 --- /dev/null +++ b/sql/Updates/r1577_scriptdev2.sql @@ -0,0 +1,69 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1033019 AND -1033009; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1033009,'I have changed my mind loyal servants, you do not need to bring the prisoner all the way to my study, I will deal with him here and now.',0,0,0,1,'arugal SAY_INTRO_1'), +(-1033010,'Vincent! You and your pathetic ilk will find no more success in routing my sons and I than those beggardly remnants of the Kirin Tor.',0,0,0,0,'arugal SAY_INTRO_2'), +(-1033011,'If you will not serve my Master with your sword and knowledge of his enemies...',0,0,0,1,'arugal SAY_INTRO_3'), +(-1033012,'Your moldering remains will serve ME as a testament to what happens when one is foolish enough to trespass in my domain!\n',0,0,0,0,'arugal SAY_INTRO_4'), +(-1033013,'Who dares interfere with the Sons of Arugal?',0,1,0,0,'boss_arugal SAY_FENRUS'), +(-1033014,'%s vanishes.',0,2,0,0,'prisoner ashcrombe EMOTE_VANISH_AS'), +(-1033015,'%s fumbles with the rusty lock on the courtyard door.',0,2,0,432,'prisoner adamant EMOTE_UNLOCK_DOOR_AD'), +(-1033016,'Arrrgh!',0,0,0,0,'deathstalker vincent SAY_VINCENT_DIE'), +(-1033017,'You, too, shall serve!',5793,1,0,0,'boss_arugal SAY_AGGRO'), +(-1033018,'Another Falls!',5795,1,0,0,'boss_arugal SAY_KILLED_PLAYER'), +(-1033019,'Release your rage!',5797,1,0,0,'boss_arugal SAY_COMBAT'); + +DELETE FROM script_waypoint WHERE entry=3849; +INSERT INTO script_waypoint VALUES +(3849, 0, -250.923, 2116.26, 81.179, 0, 'SAY_FREE_AD'), +(3849, 1, -255.049, 2119.39, 81.179, 0, ''), +(3849, 2, -254.129, 2123.45, 81.179, 0, ''), +(3849, 3, -253.898, 2130.87, 81.179, 0, ''), +(3849, 4, -249.889, 2142.31, 86.972, 0, ''), +(3849, 5, -248.205, 2144.02, 87.013, 0, ''), +(3849, 6, -240.553, 2140.55, 87.012, 0, ''), +(3849, 7, -237.514, 2142.07, 87.012, 0, ''), +(3849, 8, -235.638, 2149.23, 90.587, 0, ''), +(3849, 9, -237.188, 2151.95, 90.624, 0, ''), +(3849, 10, -241.162, 2153.65, 90.624, 0, 'SAY_OPEN_DOOR_AD'), +(3849, 11, -241.13, 2154.56, 90.624, 2000, 'SAY_UNLOCK_DOOR_AD'), +(3849, 12, -241.13, 2154.56, 90.624, 3000, ''), +(3849, 13, -241.13, 2154.56, 90.624, 5000, 'SAY_POST1_DOOR_AD'), +(3849, 14, -241.13, 2154.56, 90.624, 0, 'SAY_POST2_DOOR_AD'), +(3849, 15, -208.764, 2141.6, 90.6257, 0, ''), +(3849, 16, -206.441, 2143.51, 90.4287, 0, ''), +(3849, 17, -203.715, 2145.85, 88.7052, 0, ''), +(3849, 18, -199.199, 2144.88, 86.501, 0, ''), +(3849, 19, -195.798, 2143.58, 86.501, 0, ''), +(3849, 20, -190.029, 2141.38, 83.2712, 0, ''), +(3849, 21, -189.353, 2138.65, 83.1102, 0, ''), +(3849, 22, -190.304, 2135.73, 81.5288, 0, ''), +(3849, 23, -207.325, 2112.43, 81.0548, 0, ''), +(3849, 24, -208.754, 2109.9, 81.0527, 0, ''), +(3849, 25, -206.248, 2108.62, 81.0555, 0, ''), +(3849, 26, -202.017, 2106.64, 78.6836, 0, ''), +(3849, 27, -200.928, 2104.49, 78.5569, 0, ''), +(3849, 28, -201.845, 2101.17, 76.9256, 0, ''), +(3849, 29, -202.844, 2100.11, 76.8911, 0, ''), +(3849, 30, -213.326, 2105.83, 76.8925, 0, ''), +(3849, 31, -226.993, 2111.47, 76.8892, 0, ''), +(3849, 32, -227.955, 2112.34, 76.8895, 0, ''), +(3849, 33, -230.05, 2106.64, 76.8895, 0, ''); + +DELETE FROM script_waypoint WHERE entry=3850; +INSERT INTO script_waypoint VALUES +(3850, 0, -241.817, 2122.9, 81.179, 0, 'SAY_FREE_AS'), +(3850, 1, -247.139, 2124.89, 81.179, 0, ''), +(3850, 2, -253.179, 2127.41, 81.179, 0, ''), +(3850, 3, -253.898, 2130.87, 81.179, 0, ''), +(3850, 4, -249.889, 2142.31, 86.972, 0, ''), +(3850, 5, -248.205, 2144.02, 87.013, 0, ''), +(3850, 6, -240.553, 2140.55, 87.012, 0, ''), +(3850, 7, -237.514, 2142.07, 87.012, 0, ''), +(3850, 8, -235.638, 2149.23, 90.587, 0, ''), +(3850, 9, -237.188, 2151.95, 90.624, 0, ''), +(3850, 10, -241.162, 2153.65, 90.624, 0, 'SAY_OPEN_DOOR_AS'), +(3850, 11, -241.13, 2154.56, 90.624, 5000, 'cast'), +(3850, 12, -241.13, 2154.56, 90.624, 0, ''), +(3850, 13, -241.13, 2154.56, 90.624, 5000, 'SAY_POST_DOOR_AS'), +(3850, 14, -241.13, 2154.56, 90.624, 2500, 'cast'), +(3850, 15, -241.13, 2154.56, 90.624, 0, 'SAY_VANISH_AS'); diff --git a/sql/Updates/r1583_scriptdev2.sql b/sql/Updates/r1583_scriptdev2.sql new file mode 100644 index 0000000..f43bd36 --- /dev/null +++ b/sql/Updates/r1583_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9402 +) '; diff --git a/sql/Updates/r1584_scriptdev2.sql b/sql/Updates/r1584_scriptdev2.sql new file mode 100644 index 0000000..c6721a8 --- /dev/null +++ b/sql/Updates/r1584_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9410 +) '; diff --git a/sql/Updates/r1587_scriptdev2.sql b/sql/Updates/r1587_scriptdev2.sql new file mode 100644 index 0000000..b3addbf --- /dev/null +++ b/sql/Updates/r1587_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9414+) '; diff --git a/sql/Updates/r1589_mangos.sql b/sql/Updates/r1589_mangos.sql new file mode 100644 index 0000000..49a1218 --- /dev/null +++ b/sql/Updates/r1589_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_hulking_helboar' WHERE entry=16880; diff --git a/sql/Updates/r1590_mangos.sql b/sql/Updates/r1590_mangos.sql new file mode 100644 index 0000000..0717e8a --- /dev/null +++ b/sql/Updates/r1590_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_morbent_fel' WHERE entry=1200; diff --git a/sql/Updates/r1591_mangos.sql b/sql/Updates/r1591_mangos.sql new file mode 100644 index 0000000..186a6b3 --- /dev/null +++ b/sql/Updates/r1591_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (16880,1200,26616,26643,16518,25793,25758,25752,25792,25753,26421); diff --git a/sql/Updates/r1592_mangos.sql b/sql/Updates/r1592_mangos.sql new file mode 100644 index 0000000..3eb8862 --- /dev/null +++ b/sql/Updates/r1592_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (26841,27808,27122); diff --git a/sql/Updates/r1593_mangos.sql b/sql/Updates/r1593_mangos.sql new file mode 100644 index 0000000..ab2669c --- /dev/null +++ b/sql/Updates/r1593_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry=28068; diff --git a/sql/Updates/r1594_mangos.sql b/sql/Updates/r1594_mangos.sql new file mode 100644 index 0000000..36ea14e --- /dev/null +++ b/sql/Updates/r1594_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (12298,12296); diff --git a/sql/Updates/r1595_mangos.sql b/sql/Updates/r1595_mangos.sql new file mode 100644 index 0000000..cbff8d6 --- /dev/null +++ b/sql/Updates/r1595_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry=24918; diff --git a/sql/Updates/r1596_mangos.sql b/sql/Updates/r1596_mangos.sql new file mode 100644 index 0000000..e8ddff4 --- /dev/null +++ b/sql/Updates/r1596_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_dalaran_guardian_mage' WHERE entry IN (29255, 29254); diff --git a/sql/Updates/r1599_mangos.sql b/sql/Updates/r1599_mangos.sql new file mode 100644 index 0000000..3124376 --- /dev/null +++ b/sql/Updates/r1599_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_dame_evniki_kapsalis' WHERE entry=34885; diff --git a/sql/Updates/r1600_scriptdev2.sql b/sql/Updates/r1600_scriptdev2.sql new file mode 100644 index 0000000..26cccda --- /dev/null +++ b/sql/Updates/r1600_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9444+) '; diff --git a/sql/Updates/r1602_mangos.sql b/sql/Updates/r1602_mangos.sql new file mode 100644 index 0000000..27f109b --- /dev/null +++ b/sql/Updates/r1602_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (17326,17654); diff --git a/sql/Updates/r1604_mangos.sql b/sql/Updates/r1604_mangos.sql new file mode 100644 index 0000000..5a24749 --- /dev/null +++ b/sql/Updates/r1604_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry=16847; diff --git a/sql/Updates/r1605_mangos.sql b/sql/Updates/r1605_mangos.sql new file mode 100644 index 0000000..7f0bdae --- /dev/null +++ b/sql/Updates/r1605_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry=18879; diff --git a/sql/Updates/r1607_mangos.sql b/sql/Updates/r1607_mangos.sql new file mode 100644 index 0000000..577c6b8 --- /dev/null +++ b/sql/Updates/r1607_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (26270,26268); diff --git a/sql/Updates/r1608_mangos.sql b/sql/Updates/r1608_mangos.sql new file mode 100644 index 0000000..8cf3601 --- /dev/null +++ b/sql/Updates/r1608_mangos.sql @@ -0,0 +1,6 @@ +DELETE FROM areatrigger_scripts WHERE entry BETWEEN 5284 AND 5287; +INSERT INTO areatrigger_scripts VALUES +(5284,'at_aldurthar_gate'), +(5285,'at_aldurthar_gate'), +(5286,'at_aldurthar_gate'), +(5287,'at_aldurthar_gate'); diff --git a/sql/Updates/r1615_mangos.sql b/sql/Updates/r1615_mangos.sql new file mode 100644 index 0000000..a9ca1e6 --- /dev/null +++ b/sql/Updates/r1615_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry=30146; diff --git a/sql/Updates/r1615_scriptdev2.sql b/sql/Updates/r1615_scriptdev2.sql new file mode 100644 index 0000000..1121b8e --- /dev/null +++ b/sql/Updates/r1615_scriptdev2.sql @@ -0,0 +1,8 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000560 AND -1000555; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000555,'Back... to work...',0,0,0,0,'exhausted vrykul SAY_RAND_WORK1'), +(-1000556,'You treat us worse than animals!',0,0,0,0,'exhausted vrykul SAY_RAND_WORK2'), +(-1000557,'We will have revenge...some day.',0,0,0,0,'exhausted vrykul SAY_RAND_WORK3'), +(-1000558,'Curse you! You will not treat me like a beast!',0,0,0,0,'exhausted vrykul SAY_RAND_ATTACK1'), +(-1000559,'I\'d rather die fighting than live like a slave.',0,0,0,0,'exhausted vrykul SAY_RAND_ATTACK2'), +(-1000560,'Enough! I will teach you some manners, wench!',0,0,0,0,'exhausted vrykul SAY_RAND_ATTACK3'); diff --git a/sql/Updates/r1616_mangos.sql b/sql/Updates/r1616_mangos.sql new file mode 100644 index 0000000..a1cfcb8 --- /dev/null +++ b/sql/Updates/r1616_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=17267; +UPDATE creature_template SET ScriptName='npc_fiendish_portal' WHERE entry=17265; diff --git a/sql/Updates/r1617_mangos.sql b/sql/Updates/r1617_mangos.sql new file mode 100644 index 0000000..8bc1318 --- /dev/null +++ b/sql/Updates/r1617_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=17229; diff --git a/sql/Updates/r1621_scriptdev2.sql b/sql/Updates/r1621_scriptdev2.sql new file mode 100644 index 0000000..bea0610 --- /dev/null +++ b/sql/Updates/r1621_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1533133 AND -1533130; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533130,'%s summons forth Skeletal Warriors!',0,3,0,0,'noth EMOTE_WARRIOR'), +(-1533131,'%s teleports to the balcony above!',0,3,0,0,'noth EMOTE_SKELETON'), +(-1533132,'%s raises more skeletons!',0,3,0,0,'noth EMOTE_TELEPORT'), +(-1533133,'%s teleports back into the battle!',0,3,0,0,'noth EMOTE_TELEPORT_RETURN'); diff --git a/sql/Updates/r1622_mangos.sql b/sql/Updates/r1622_mangos.sql new file mode 100644 index 0000000..e72079f --- /dev/null +++ b/sql/Updates/r1622_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_kelthuzad' WHERE entry=15990; diff --git a/sql/Updates/r1622_scriptdev2.sql b/sql/Updates/r1622_scriptdev2.sql new file mode 100644 index 0000000..76f24a5 --- /dev/null +++ b/sql/Updates/r1622_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1533134; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533134,'A guardian of Icecrown enters the fight!',0,3,0,0,'kelthuzad EMOTE_GUARDIAN'); diff --git a/sql/Updates/r1624_mangos.sql b/sql/Updates/r1624_mangos.sql new file mode 100644 index 0000000..978df85 --- /dev/null +++ b/sql/Updates/r1624_mangos.sql @@ -0,0 +1,2 @@ +DELETE FROM areatrigger_scripts WHERE entry=4112; +INSERT INTO areatrigger_scripts VALUES (4112,'at_naxxramas'); diff --git a/sql/Updates/r1624_scriptdev2.sql b/sql/Updates/r1624_scriptdev2.sql new file mode 100644 index 0000000..297c19a --- /dev/null +++ b/sql/Updates/r1624_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry=-1533135; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533135,'%s strikes!',0,3,0,0,'kelthuzad EMOTE_PHASE2'); +UPDATE script_texts SET content_default='A Guardian of Icecrown enters the fight!' WHERE entry=-1533134; diff --git a/sql/Updates/r1627_mangos.sql b/sql/Updates/r1627_mangos.sql new file mode 100644 index 0000000..0dca860 --- /dev/null +++ b/sql/Updates/r1627_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_heigan' WHERE entry=15936; diff --git a/sql/Updates/r1627_scriptdev2.sql b/sql/Updates/r1627_scriptdev2.sql new file mode 100644 index 0000000..42314f9 --- /dev/null +++ b/sql/Updates/r1627_scriptdev2.sql @@ -0,0 +1,7 @@ +UPDATE script_texts SET comment='heigan SAY_CHANNELING' WHERE entry=-1533116; +UPDATE script_texts SET comment='heigan SAY_TAUNT4' WHERE entry=-1533117; + +DELETE FROM script_texts WHERE entry IN (-1533136,-1533137); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533136,'%s teleports and begins to channel a spell!',0,3,0,0,'heigan EMOTE_TELEPORT'), +(-1533137,'%s rushes to attack once more!',0,3,0,0,'heigan EMOTE_RETURN'); diff --git a/sql/Updates/r1629_mangos.sql b/sql/Updates/r1629_mangos.sql new file mode 100644 index 0000000..36c58f1 --- /dev/null +++ b/sql/Updates/r1629_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_gothik' WHERE entry=16060; diff --git a/sql/Updates/r1629_scriptdev2.sql b/sql/Updates/r1629_scriptdev2.sql new file mode 100644 index 0000000..1d07fd4 --- /dev/null +++ b/sql/Updates/r1629_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry IN (-1533138,-1533139); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533138,'%s teleports into the fray!',0,3,0,0,'gothik EMOTE_TO_FRAY'), +(-1533139,'The central gate opens!',0,3,0,0,'gothik EMOTE_GATE'); diff --git a/sql/Updates/r1632_mangos.sql b/sql/Updates/r1632_mangos.sql new file mode 100644 index 0000000..bc9112e --- /dev/null +++ b/sql/Updates/r1632_mangos.sql @@ -0,0 +1,9 @@ +UPDATE instance_template SET script='instance_trial_of_the_crusader' WHERE map=649; +UPDATE creature_template SET ScriptName='boss_gormok' WHERE entry=34796; +UPDATE creature_template SET ScriptName='boss_acidmaw' WHERE entry=35144; +UPDATE creature_template SET ScriptName='boss_dreadscale' WHERE entry=34799; +UPDATE creature_template SET ScriptName='boss_icehowl' WHERE entry=34797; +UPDATE creature_template SET ScriptName='boss_jaraxxis' WHERE entry=34780; +UPDATE creature_template SET ScriptName='boss_anubarak_trial' WHERE entry=34564; +UPDATE creature_template SET ScriptName='boss_fjola' WHERE entry=34497; +UPDATE creature_template SET ScriptName='boss_eydis' WHERE entry=34496; diff --git a/sql/Updates/r1636_mangos.sql b/sql/Updates/r1636_mangos.sql new file mode 100644 index 0000000..32777d8 --- /dev/null +++ b/sql/Updates/r1636_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_anchor' WHERE entry=16137; diff --git a/sql/Updates/r1637_scriptdev2.sql b/sql/Updates/r1637_scriptdev2.sql new file mode 100644 index 0000000..f469059 --- /dev/null +++ b/sql/Updates/r1637_scriptdev2.sql @@ -0,0 +1,7 @@ +UPDATE script_texts SET content_default='Foolishly you have sought your own demise.', comment='gothik SAY_SPEECH_1' WHERE entry=-1533040; + +DELETE FROM script_texts WHERE entry BETWEEN -1533142 AND -1533140; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533140,'Brazenly you have disregarded powers beyond your understanding.',0,1,0,0,'gothik SAY_SPEECH_2'), +(-1533141,'You have fought hard to invade the realm of the harvester.',0,1,0,0,'gothik SAY_SPEECH_3'), +(-1533142,'Now there is only one way out - to walk the lonely path of the damned.',0,1,0,0,'gothik SAY_SPEECH_4'); diff --git a/sql/Updates/r1642_scriptdev2.sql b/sql/Updates/r1642_scriptdev2.sql new file mode 100644 index 0000000..a35ed88 --- /dev/null +++ b/sql/Updates/r1642_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9599+) '; diff --git a/sql/Updates/r1644_scriptdev2.sql b/sql/Updates/r1644_scriptdev2.sql new file mode 100644 index 0000000..f6cae12 --- /dev/null +++ b/sql/Updates/r1644_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9603+) '; diff --git a/sql/Updates/r1647_mangos.sql b/sql/Updates/r1647_mangos.sql new file mode 100644 index 0000000..3c33999 --- /dev/null +++ b/sql/Updates/r1647_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_corporal_keeshan' WHERE entry=349; + diff --git a/sql/Updates/r1647_scriptdev2.sql b/sql/Updates/r1647_scriptdev2.sql new file mode 100644 index 0000000..3138e02 --- /dev/null +++ b/sql/Updates/r1647_scriptdev2.sql @@ -0,0 +1,65 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000565 AND -1000561; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000561,'My wounds are grave. Forgive my slow pace but my injuries won''t allow me to walk any faster.',0,0,0,0,'SAY_CORPORAL_KEESHAN_1'), +(-1000562,'Ah, fresh air, at last! I need a moment to reset.',0,0,0,0,'SAY_CORPORAL_KEESHAN_2'), +(-1000563,'The Blackrock infestation is thick in these parts. I will do my best to keep the pace. Let''s go!',0,0,0,0,'SAY_CORPORAL_KEESHAN_3'), +(-1000564,'Marshal Marris, sir. Corporal Keeshan of the 12th Sabre Regiment returned from battle and reporting for duty!',0,0,0,0,'SAY_CORPORAL_KEESHAN_4'), +(-1000565,'Brave adventurer, thank you for rescuing me! I am sure Marshal Marris will reward your kind deed.',0,0,0,0,'SAY_CORPORAL_KEESHAN_5'); + +DELETE FROM script_waypoint WHERE entry = 349; +INSERT INTO script_waypoint VALUES +(349, 01, -8769.591797, -2185.733643, 141.974564, 0, ''), +(349, 02, -8776.540039, -2193.782959, 140.960159, 0, ''), +(349, 03, -8783.289063, -2194.818604, 140.461731, 0, ''), +(349, 04, -8792.520508, -2188.802002, 142.077728, 0, ''), +(349, 05, -8807.547852, -2186.100830, 141.504135, 0, ''), +(349, 06, -8818, -2184.8, 139.153, 0, ''), +(349, 07, -8825.805664, -2188.840576, 138.458832, 0, ''), +(349, 08, -8827.522461, -2199.805664, 139.621933, 0, ''), +(349, 09, -8821.140625, -2212.642334, 143.126419, 0, ''), +(349, 10, -8809.175781, -2230.456299, 143.438431, 0, ''), +(349, 11, -8797.040039, -2240.718262, 146.548203, 0, ''), +(349, 12, -8795.242188, -2251.809814, 146.808044, 0, ''), +(349, 13, -8780.159180, -2258.615967, 148.553772, 0, ''), +(349, 14, -8762.650391, -2259.559326, 151.144241, 0, ''), +(349, 15, -8754.357422, -2253.735352, 152.243073, 0, ''), +(349, 16, -8741.869141, -2250.997070, 154.485718, 0, ''), +(349, 17, -8733.218750, -2251.010742, 154.360031, 0, ''), +(349, 18, -8717.474609, -2245.044678, 154.68614, 0, ''), +(349, 19, -8712.240234, -2246.826172, 154.709473, 0, ''), +(349, 20, -8693.840820, -2240.410889, 152.909714, 0, ''), +(349, 21, -8681.818359, -2245.332764, 155.517838, 0, ''), +(349, 22, -8669.86, -2252.77, 154.854, 0, ''), +(349, 23, -8670.56, -2264.69, 156.978, 0, ''), +(349, 24, -8676.557617, -2269.204346, 155.411316, 0, ''), +(349, 25, -8673.340820, -2288.650146, 157.054123, 0, ''), +(349, 26, -8677.760742, -2302.563965, 155.916580, 16000, 'Corp. Keeshan - Short Break Outside'), +(349, 27, -8682.462891, -2321.688232, 155.916946, 0, ''), +(349, 28, -8690.402344, -2331.779297, 155.970505, 0, ''), +(349, 29, -8715.1, -2353.95, 156.188, 0, ''), +(349, 30, -8748.042969, -2370.701904, 157.988342, 0, ''), +(349, 31, -8780.900391, -2421.370361, 156.108871, 0, ''), +(349, 32, -8792.009766, -2453.379883, 142.746002, 0, ''), +(349, 33, -8804.780273, -2472.429932, 134.192001, 0, ''), +(349, 34, -8841.348633, -2503.626221, 132.276138, 0, ''), +(349, 35, -8867.565430, -2529.892822, 134.738586, 0, ''), +(349, 36, -8870.67, -2542.08, 131.044, 0, ''), +(349, 37, -8922.05, -2585.31, 132.446, 0, ''), +(349, 38, -8949.08, -2596.87, 132.537, 0, ''), +(349, 39, -8993.460938, -2604.042725, 130.756210, 0, ''), +(349, 40, -9006.709961, -2598.469971, 127.966003, 0, ''), +(349, 41, -9038.96, -2572.71, 124.748, 0, ''), +(349, 42, -9046.92, -2560.64, 124.447, 0, ''), +(349, 43, -9066.693359, -2546.633301, 123.110138, 0, ''), +(349, 44, -9077.54, -2541.67, 121.17, 0, ''), +(349, 45, -9125.320313, -2490.059326, 116.057274, 0, ''), +(349, 46, -9145.063477, -2442.239990, 108.231689, 0, ''), +(349, 47, -9158.197266, -2425.363281, 105.500038, 0, ''), +(349, 48, -9151.922852, -2393.671631, 100.856010, 0, ''), +(349, 49, -9165.193359, -2376.031738, 94.821518, 0, ''), +(349, 50, -9187.099609, -2360.520020, 89.923103, 0, ''), +(349, 51, -9235.443359, -2305.239014, 77.925316, 0, ''), +(349, 52, -9264.73, -2292.92, 70.0089, 0, ''), +(349, 53, -9277.468750, -2296.188721, 68.089630, 2500, 'Corp. Keeshan - quest-finish'), +(349, 54, -9277.468750, -2296.188721, 68.089630, 0, 'Corp. Keeshan - Say Goodbye'); + diff --git a/sql/Updates/r1650_mangos.sql b/sql/Updates/r1650_mangos.sql new file mode 100644 index 0000000..2b571c3 --- /dev/null +++ b/sql/Updates/r1650_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='boss_netherspite' WHERE entry=15689; + diff --git a/sql/Updates/r1651_scriptdev2.sql b/sql/Updates/r1651_scriptdev2.sql new file mode 100644 index 0000000..7c9a03d --- /dev/null +++ b/sql/Updates/r1651_scriptdev2.sql @@ -0,0 +1,2 @@ +UPDATE script_texts SET content_default='Ah, fresh air, at last! I need a moment to rest.' WHERE entry=-1000562; + diff --git a/sql/Updates/r1652_scriptdev2.sql b/sql/Updates/r1652_scriptdev2.sql new file mode 100644 index 0000000..c758f30 --- /dev/null +++ b/sql/Updates/r1652_scriptdev2.sql @@ -0,0 +1,3 @@ +UPDATE script_texts SET content_default='%s raises more skeletons!' WHERE entry=-1533131; +UPDATE script_texts SET content_default='%s teleports to the balcony above!' WHERE entry=-1533132; + diff --git a/sql/Updates/r1653_mangos.sql b/sql/Updates/r1653_mangos.sql new file mode 100644 index 0000000..7ed2edf --- /dev/null +++ b/sql/Updates/r1653_mangos.sql @@ -0,0 +1,3 @@ +UPDATE instance_template SET script='instance_uldaman' WHERE map=70; +UPDATE gameobject_template SET ScriptName='go_altar_of_keepers' WHERE entry=130511; + diff --git a/sql/Updates/r1658_scriptdev2.sql b/sql/Updates/r1658_scriptdev2.sql new file mode 100644 index 0000000..b56e7ee --- /dev/null +++ b/sql/Updates/r1658_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry=-1509028; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1509028,'%s drains your mana and turns to stone.',0,2,0,0,'moam EMOTE_ENERGIZING'); + diff --git a/sql/Updates/r1660_scriptdev2.sql b/sql/Updates/r1660_scriptdev2.sql new file mode 100644 index 0000000..8d6b9ee --- /dev/null +++ b/sql/Updates/r1660_scriptdev2.sql @@ -0,0 +1,2 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9641+) '; + diff --git a/sql/Updates/r1661_mangos.sql b/sql/Updates/r1661_mangos.sql new file mode 100644 index 0000000..5126258 --- /dev/null +++ b/sql/Updates/r1661_mangos.sql @@ -0,0 +1,9 @@ +DELETE FROM areatrigger_scripts WHERE entry=5108; +INSERT INTO areatrigger_scripts VALUES (5108,'at_stormwright_shelf'); + +DELETE FROM areatrigger_scripts WHERE entry IN (4871, 4872, 4873); +INSERT INTO areatrigger_scripts VALUES +(4871,'at_warsong_farms'), +(4872,'at_warsong_farms'), +(4873,'at_warsong_farms'); + diff --git a/sql/Updates/r1662_scriptdev2.sql b/sql/Updates/r1662_scriptdev2.sql new file mode 100644 index 0000000..7606eb5 --- /dev/null +++ b/sql/Updates/r1662_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1533145 AND -1533143; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533143,'An aura of necrotic energy blocks all healing!',0,3,0,0,'Loatheb EMOTE_AURA_BLOCKING'), +(-1533144,'The power of Necrotic Aura begins to wane!',0,3,0,0,'Loatheb EMOTE_AURA_WANE'), +(-1533145,'The aura fades away, allowing healing once more!',0,3,0,0,'Loatheb EMOTE_AURA_FADING'); + diff --git a/sql/Updates/r1665_mangos.sql b/sql/Updates/r1665_mangos.sql new file mode 100644 index 0000000..233d731 --- /dev/null +++ b/sql/Updates/r1665_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='boss_moam' WHERE entry=15340; diff --git a/sql/Updates/r1667_mangos.sql b/sql/Updates/r1667_mangos.sql new file mode 100644 index 0000000..c1f2e73 --- /dev/null +++ b/sql/Updates/r1667_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_niby_the_almighty' WHERE entry=14469; + diff --git a/sql/Updates/r1667_scriptdev2.sql b/sql/Updates/r1667_scriptdev2.sql new file mode 100644 index 0000000..83473fc --- /dev/null +++ b/sql/Updates/r1667_scriptdev2.sql @@ -0,0 +1,8 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000570 AND -1000566; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000566,'Stand back! Stand clear! The infernal will need to be given a wide berth!',0,0,0,0,'SAY_NIBY_1'), +(-1000567,'BOW DOWN TO THE ALMIGHTY! BOW DOWN BEFORE MY INFERNAL DESTRO... chicken?',0,0,0,0,'SAY_NIBY_2'), +(-1000568,'%s rolls on the floor laughing.',0,2,0,0,'EMOTE_IMPSY_1'), +(-1000569,'Niby, you\' re an idiot.',0,0,0,0,'SAY_IMPSY_1'), +(-1000570,'Silence, servant! Vengeance will be mine! Death to Stormwind! Death by chicken!',0,0,0,0,'SAY_NIBY_3'); + diff --git a/sql/Updates/r1668_mangos.sql b/sql/Updates/r1668_mangos.sql new file mode 100644 index 0000000..cdcfbd1 --- /dev/null +++ b/sql/Updates/r1668_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='boss_kurinnaxx' WHERE entry=15348; +UPDATE creature_template SET ScriptName='boss_ayamiss' WHERE entry=15369; + diff --git a/sql/Updates/r1671_mangos.sql b/sql/Updates/r1671_mangos.sql new file mode 100644 index 0000000..dd197bd --- /dev/null +++ b/sql/Updates/r1671_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='npc_miran' WHERE entry=1379; +UPDATE creature_template SET ScriptName='boss_jaraxxus' WHERE entry=34780; + diff --git a/sql/Updates/r1671_scriptdev2.sql b/sql/Updates/r1671_scriptdev2.sql new file mode 100644 index 0000000..1751a21 --- /dev/null +++ b/sql/Updates/r1671_scriptdev2.sql @@ -0,0 +1,34 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000574 AND -1000571; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000571,'Help! I\'ve only one hand to defend myself with.',0,0,0,0,'SAY_MIRAN_1'), +(-1000572,'Feel the power of the Dark Iron Dwarves!',0,0,0,0,'SAY_DARK_IRON_DWARF'), +(-1000573,'Send them on! I\'m not afraid of some scrawny beasts!',0,0,0,0,'SAY_MIRAN_2'), +(-1000574,'Ah, here at last! It\'s going to feel so good to get rid of these barrels.',0,0,0,0,'SAY_MIRAN_3'); + +DELETE FROM script_waypoint WHERE entry=1379; +INSERT INTO script_waypoint VALUES +(1379,01,-5751.12,-3441.01,301.743,0,''), +(1379,02,-5738.58,-3485.14,302.410,0,''), +(1379,03,-5721.62,-3507.85,304.011,0,''), +(1379,04,-5710.21,-3527.97,304.708,0,''), +(1379,05,-5706.92,-3542.89,304.871,0,''), +(1379,06,-5701.53,-3551.24,305.962,0,''), +(1379,07,-5699.53,-3555.69,306.505,0,''), +(1379,08,-5690.56,-3571.98,309.035,0,''), +(1379,09,-5678.61,-3587.17,310.607,0,''), +(1379,10,-5677.05,-3594.35,311.527,0,''), +(1379,11,-5674.39,-3605.19,312.239,0,''), +(1379,12,-5674.45,-3614.39,312.337,0,''), +(1379,13,-5673.05,-3630.56,311.105,0,''), +(1379,14,-5680.34,-3645.44,315.185,0,''), +(1379,15,-5684.46,-3650.05,314.687,0,''), +(1379,16,-5693.9,-3674.14,313.03,0,''), +(1379,17,-5701.43,-3712.54,313.959,0,''), +(1379,18,-5698.79,-3720.88,316.943,0,''), +(1379,19,-5699.95,-3733.63,318.597,0,'Protecting the Shipment - Ambush'), +(1379,20,-5698.61,-3754.74,322.047,0,''), +(1379,21,-5688.68,-3769,323.957,0,''), +(1379,22,-5688.14,-3782.65,322.667,0,''), +(1379,23,-5699.23,-3792.65,322.448,30000,'Protecting the Shipment - End'), +(1379,24,-5700.80,-3792.78,322.588,0,''); + diff --git a/sql/Updates/r1679_mangos.sql b/sql/Updates/r1679_mangos.sql new file mode 100644 index 0000000..5f8dc0e --- /dev/null +++ b/sql/Updates/r1679_mangos.sql @@ -0,0 +1,4 @@ +UPDATE creature_template SET ScriptName='' WHERE entry=25059; +UPDATE creature_template SET ScriptName='' WHERE entry=25236; +UPDATE creature_template SET ScriptName='' WHERE entry IN (27274, 27275); + diff --git a/sql/Updates/r1680_mangos.sql b/sql/Updates/r1680_mangos.sql new file mode 100644 index 0000000..74d7f05 --- /dev/null +++ b/sql/Updates/r1680_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='spell_dummy_go' WHERE entry=186949; diff --git a/sql/Updates/r1681_mangos.sql b/sql/Updates/r1681_mangos.sql new file mode 100644 index 0000000..92b1362 --- /dev/null +++ b/sql/Updates/r1681_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='spell_dummy_go' WHERE entry=181616; diff --git a/sql/Updates/r1683_scriptdev2.sql b/sql/Updates/r1683_scriptdev2.sql new file mode 100644 index 0000000..2cfd8ad --- /dev/null +++ b/sql/Updates/r1683_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 9832+) '; diff --git a/sql/Updates/r1685_mangos.sql b/sql/Updates/r1685_mangos.sql new file mode 100644 index 0000000..6965af8 --- /dev/null +++ b/sql/Updates/r1685_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_lurgglbr' WHERE entry=25208; + diff --git a/sql/Updates/r1685_scriptdev2.sql b/sql/Updates/r1685_scriptdev2.sql new file mode 100644 index 0000000..814f4bd --- /dev/null +++ b/sql/Updates/r1685_scriptdev2.sql @@ -0,0 +1,37 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000578 AND -1000575; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000575,'Together we will fight our way out of here. Are you ready?',0,0,0,0,'Lurgglbr - SAY_START_1'), +(-1000576,'Then we leave.',0,0,0,0,'Lurgglbr - SAY_START_2'), +(-1000577,'This is far enough. I can make it on my own from here.',0,0,0,0,'Lurgglbr - SAY_END_1'), +(-1000578,'Thank You for helping me $c. Please tell the king I am back.',0,0,0,0,'Lurgglbr - SAY_END_2'); + +DELETE FROM script_waypoint WHERE entry = 25208; +INSERT INTO script_waypoint VALUES +(25208,0,4013.51,6390.33,29.970,15000,'Lurgglbr - after escaped from cage'), +(25208,1,4023.06,6379.43,29.210,0,''), +(25208,2,4033.61,6370.94,28.430,0,''), +(25208,3,4052.03,6367.42,27.370,0,''), +(25208,4,4061.13,6353.36,25.450,0,''), +(25208,5,4064.28,6330.76,25.310,0,''), +(25208,6,4057.94,6307.85,24.900,0,''), +(25208,7,4057.40,6290.12,24.430,0,''), +(25208,8,4065.63,6277.64,23.900,0,''), +(25208,9,4080.71,6280.77,26.920,0,''), +(25208,10,4098.90,6279.00,25.950,0,''), +(25208,11,4118.00,6277.81,25.720,0,''), +(25208,12,4129.47,6281.65,28.860,0,''), +(25208,13,4143.86,6282.57,29.180,4000,'Lurgglbr - outside cave'), +(25208,14,4159.54,6280.08,30.520,0,''), +(25208,15,4171.95,6291.50,22.250,0,''), +(25208,16,4184.86,6293.45,16.570,0,''), +(25208,17,4194.14,6301.28,13.310,0,''), +(25208,18,4210.34,6285.81,09.500,0,''), +(25208,19,4220.05,6272.75,07.770,0,''), +(25208,20,4242.45,6272.24,01.750,0,''), +(25208,21,4257.79,6252.91,-0.050,0,''), +(25208,22,4256.81,6230.74,-0.090,0,''), +(25208,23,4241.09,6217.87,-0.140,0,''), +(25208,24,4254.66,6205.16,-0.170,0,''), +(25208,25,4261.82,6186.47,-0.140,30000,'Lurgglbr - final point'), +(25208,26,4300.55,6140.35,-2.70,0,''); + diff --git a/sql/Updates/r1687_mangos.sql b/sql/Updates/r1687_mangos.sql new file mode 100644 index 0000000..cf8269f --- /dev/null +++ b/sql/Updates/r1687_mangos.sql @@ -0,0 +1,4 @@ +UPDATE instance_template SET script='instance_culling_of_stratholme' WHERE map=595; +UPDATE creature_template SET ScriptName='npc_chromie' WHERE entry IN (26527, 27915); +UPDATE creature_template SET ScriptName='spell_dummy_npc_crates_bunny' WHERE entry=30996; + diff --git a/sql/Updates/r1691_mangos.sql b/sql/Updates/r1691_mangos.sql new file mode 100644 index 0000000..9634eb7 --- /dev/null +++ b/sql/Updates/r1691_mangos.sql @@ -0,0 +1,15 @@ +DELETE FROM areatrigger_scripts WHERE entry IN (3546, 3547, 3548, 3549, 3550, 3552); +INSERT INTO areatrigger_scripts VALUES +-- Darnassian bank +(3546, 'at_childrens_week_spot'), +-- Undercity - thone room +(3547, 'at_childrens_week_spot'), +-- Stonewrought Dam +(3548, 'at_childrens_week_spot'), +-- The Mor'shan Rampart +(3549, 'at_childrens_week_spot'), +-- Ratchet Docks +(3550, 'at_childrens_week_spot'), +-- Westfall Lighthouse +(3552, 'at_childrens_week_spot'); + diff --git a/sql/Updates/r1694_mangos.sql b/sql/Updates/r1694_mangos.sql new file mode 100644 index 0000000..879673b --- /dev/null +++ b/sql/Updates/r1694_mangos.sql @@ -0,0 +1,2 @@ +UPDATE instance_template SET script='instance_razorfen_kraul' WHERE map=47; + diff --git a/sql/Updates/r1698_mangos.sql b/sql/Updates/r1698_mangos.sql new file mode 100644 index 0000000..688c27d --- /dev/null +++ b/sql/Updates/r1698_mangos.sql @@ -0,0 +1,2 @@ +UPDATE instance_template SET script='instance_wailing_caverns' WHERE map=43; + diff --git a/sql/Updates/r1704_mangos.sql b/sql/Updates/r1704_mangos.sql new file mode 100644 index 0000000..c5d284f --- /dev/null +++ b/sql/Updates/r1704_mangos.sql @@ -0,0 +1,7 @@ +UPDATE instance_template SET script='instance_blackrock_spire' WHERE map=229; + +DELETE FROM areatrigger_scripts WHERE entry IN (2026, 2046); +INSERT INTO areatrigger_scripts VALUES +(2026, 'at_blackrock_spire'), +(2046, 'at_blackrock_spire'); + diff --git a/sql/Updates/r1705_mangos.sql b/sql/Updates/r1705_mangos.sql new file mode 100644 index 0000000..3e2cd6f --- /dev/null +++ b/sql/Updates/r1705_mangos.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET ScriptName='go_blood_filled_orb' WHERE entry=182024; + diff --git a/sql/Updates/r1705_scriptdev2.sql b/sql/Updates/r1705_scriptdev2.sql new file mode 100644 index 0000000..35f4b6f --- /dev/null +++ b/sql/Updates/r1705_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry=-1000579; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000579,'Insolent fool! You thought to steal Zelemar\'s blood? You shall pay with your own!',0,1,0,0,'Zelemar the Wrathful - Aggro'); + diff --git a/sql/Updates/r1706_scriptdev2.sql b/sql/Updates/r1706_scriptdev2.sql new file mode 100644 index 0000000..04bccde --- /dev/null +++ b/sql/Updates/r1706_scriptdev2.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry IN (-1000580, -1000581); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000580,'Sleep now, young one ...',0,0,0,0,'Raelorasz SAY_SLEEP'), +(-1000581,'A wonderful specimen.',0,0,0,0,'Raeloarsz SAY_SPECIMEN'); + diff --git a/sql/Updates/r1711_scriptdev2.sql b/sql/Updates/r1711_scriptdev2.sql new file mode 100644 index 0000000..cf12ff1 --- /dev/null +++ b/sql/Updates/r1711_scriptdev2.sql @@ -0,0 +1,7 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1533093 AND -1533090; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,6,0,0,'kelthuzad SAY_TAUNT1'), +(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,6,0,0,'kelthuzad SAY_TAUNT2'), +(-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,6,0,0,'kelthuzad SAY_TAUNT3'), +(-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,6,0,0,'kelthuzad SAY_TAUNT4'); + diff --git a/sql/Updates/r1715_mangos.sql b/sql/Updates/r1715_mangos.sql new file mode 100644 index 0000000..522c2fa --- /dev/null +++ b/sql/Updates/r1715_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_galen_goodward' WHERE entry=5391; + diff --git a/sql/Updates/r1715_scriptdev2.sql b/sql/Updates/r1715_scriptdev2.sql new file mode 100644 index 0000000..41bd1f0 --- /dev/null +++ b/sql/Updates/r1715_scriptdev2.sql @@ -0,0 +1,35 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000588 AND -1000582; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000582,'Help! Please, You must help me!',0,0,0,0,'Galen - periodic say'), +(-1000583,'Let us leave this place.',0,0,0,0,'Galen - quest accepted'), +(-1000584,'Look out! The $c attacks!',0,0,0,0,'Galen - aggro 1'), +(-1000585,'Help! I\'m under attack!',0,0,0,0,'Galen - aggro 2'), +(-1000586,'Thank you $N. I will remember you always. You can find my strongbox in my camp, north of Stonard.',0,0,0,0,'Galen - quest complete'), +(-1000587,'%s whispers to $N the secret to opening his strongbox.',0,2,0,0,'Galen - emote whisper'), +(-1000588,'%s disappears into the swamp.',0,2,0,0,'Galen - emote disapper'); + +DELETE FROM script_waypoint WHERE entry=5391; +INSERT INTO script_waypoint VALUES +(5391, 0, -9901.12, -3727.29, 22.11, 3000, ''), +(5391, 1, -9909.27, -3727.81, 23.25, 0, ''), +(5391, 2, -9935.25, -3729.02, 22.11, 0, ''), +(5391, 3, -9945.83, -3719.34, 21.68, 0, ''), +(5391, 4, -9963.41, -3710.18, 21.71, 0, ''), +(5391, 5, -9972.75, -3690.13, 21.68, 0, ''), +(5391, 6, -9989.70, -3669.67, 21.67, 0, ''), +(5391, 7, -9989.21, -3647.76, 23.00, 0, ''), +(5391, 8, -9992.27, -3633.74, 21.67, 0, ''), +(5391, 9,-10002.32, -3611.67, 22.26, 0, ''), +(5391,10, -9999.25, -3586.33, 21.85, 0, ''), +(5391,11,-10006.53, -3571.99, 21.67, 0, ''), +(5391,12,-10014.30, -3545.24, 21.67, 0, ''), +(5391,13,-10018.91, -3525.03, 21.68, 0, ''), +(5391,14,-10030.22, -3514.77, 21.67, 0, ''), +(5391,15,-10045.11, -3501.49, 21.67, 0, ''), +(5391,16,-10052.91, -3479.13, 21.67, 0, ''), +(5391,17,-10060.68, -3460.31, 21.67, 0, ''), +(5391,18,-10074.68, -3436.85, 20.97, 0, ''), +(5391,19,-10074.68, -3436.85, 20.97, 0, ''), +(5391,20,-10072.86, -3408.92, 20.43, 15000, ''), +(5391,21,-10108.01, -3406.05, 22.06, 0, ''); + diff --git a/sql/Updates/r1720_mangos.sql b/sql/Updates/r1720_mangos.sql new file mode 100644 index 0000000..474370f --- /dev/null +++ b/sql/Updates/r1720_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_bessy' WHERE entry=20415; + diff --git a/sql/Updates/r1720_scriptdev2.sql b/sql/Updates/r1720_scriptdev2.sql new file mode 100644 index 0000000..6c4cfe1 --- /dev/null +++ b/sql/Updates/r1720_scriptdev2.sql @@ -0,0 +1,16 @@ +DELETE FROM script_waypoint WHERE entry=20415; +INSERT INTO script_waypoint VALUES +(20415, 0, 2488.77, 2184.89, 104.64, 0, ""), +(20415, 1, 2478.72, 2184.77, 98.58, 0, ""), +(20415, 2, 2473.52, 2184.71, 99.00, 0, ""), +(20415, 3, 2453.15, 2184.96, 97.09,4000, ""), +(20415, 4, 2424.18, 2184.15, 94.11, 0, ""), +(20415, 5, 2413.18, 2184.15, 93.42, 0, ""), +(20415, 6, 2402.02, 2183.90, 87.59, 0, ""), +(20415, 7, 2333.31, 2181.63, 90.03,4000, ""), +(20415, 8, 2308.73, 2184.34, 92.04, 0, ""), +(20415, 9, 2303.10, 2196.89, 94.94, 0, ""), +(20415, 10, 2304.58, 2272.23, 96.67, 0, ""), +(20415, 11, 2297.09, 2271.40, 95.16, 0, ""), +(20415, 12, 2297.68, 2266.79, 95.07,4000, ""), +(20415, 13, 2297.67, 2266.76, 95.07,4000, ""); diff --git a/sql/Updates/r1726_mangos.sql b/sql/Updates/r1726_mangos.sql new file mode 100644 index 0000000..f4eb279 --- /dev/null +++ b/sql/Updates/r1726_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_web_wrap' WHERE entry=16486; diff --git a/sql/Updates/r1727_scriptdev2.sql b/sql/Updates/r1727_scriptdev2.sql new file mode 100644 index 0000000..8d2731f --- /dev/null +++ b/sql/Updates/r1727_scriptdev2.sql @@ -0,0 +1,5 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1533148 AND -1533146; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533146,'%s spins her web into a cocoon!',0,3,0,0,'maexxna EMOTE_SPIN_WEB'), +(-1533147,'Spiderlings appear on the web!',0,3,0,0,'maexxna EMOTE_SPIDERLING'), +(-1533148,'%s sprays strands of web everywhere!',0,3,0,0,'maexxna EMOTE_SPRAY'); diff --git a/sql/Updates/r1728_mangos.sql b/sql/Updates/r1728_mangos.sql new file mode 100644 index 0000000..a154d64 --- /dev/null +++ b/sql/Updates/r1728_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_gurgthock' WHERE entry=30007; + diff --git a/sql/Updates/r1729_scriptdev2.sql b/sql/Updates/r1729_scriptdev2.sql new file mode 100644 index 0000000..019e782 --- /dev/null +++ b/sql/Updates/r1729_scriptdev2.sql @@ -0,0 +1,3 @@ +UPDATE script_texts SET content_default='Thank you for helping me $r. Please tell the king I am back.' WHERE entry=-1000578; +UPDATE script_waypoint SET location_x=4270.07, location_y=6188.42, location_z=0.059, waittime=15000 WHERE entry=25208 AND pointid=25; +DELETE FROM script_waypoint WHERE entry=25208 AND pointid=26; diff --git a/sql/Updates/r1734_scriptdev2.sql b/sql/Updates/r1734_scriptdev2.sql new file mode 100644 index 0000000..aa6effc --- /dev/null +++ b/sql/Updates/r1734_scriptdev2.sql @@ -0,0 +1,4 @@ +DELETE FROM script_texts WHERE entry=-1189035; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1189035,'The master has fallen! Avenge him my brethren!',5834,1,0,0,'trainee SAY_TRAINEE_SPAWN'); + diff --git a/sql/Updates/r1736_scriptdev2.sql b/sql/Updates/r1736_scriptdev2.sql new file mode 100644 index 0000000..2838436 --- /dev/null +++ b/sql/Updates/r1736_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10112+) '; diff --git a/sql/Updates/r1737_scriptdev2.sql b/sql/Updates/r1737_scriptdev2.sql new file mode 100644 index 0000000..ea3334d --- /dev/null +++ b/sql/Updates/r1737_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10153+) '; diff --git a/sql/Updates/r1741_mangos.sql b/sql/Updates/r1741_mangos.sql new file mode 100644 index 0000000..bfbf87e --- /dev/null +++ b/sql/Updates/r1741_mangos.sql @@ -0,0 +1 @@ +UPDATE item_template SET ScriptName='' WHERE entry=31742; diff --git a/sql/Updates/r1750_scriptdev2.sql b/sql/Updates/r1750_scriptdev2.sql new file mode 100644 index 0000000..7645bba --- /dev/null +++ b/sql/Updates/r1750_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10296+) '; diff --git a/sql/Updates/r1751_scriptdev2.sql b/sql/Updates/r1751_scriptdev2.sql new file mode 100644 index 0000000..ca56aef --- /dev/null +++ b/sql/Updates/r1751_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10299+) '; diff --git a/sql/Updates/r1752_mangos.sql b/sql/Updates/r1752_mangos.sql new file mode 100644 index 0000000..1a1b4e7 --- /dev/null +++ b/sql/Updates/r1752_mangos.sql @@ -0,0 +1,2 @@ +DELETE FROM event_id_scripts WHERE id=11225; +INSERT INTO event_id_scripts VALUES (11225,'event_taxi_stormcrow'); diff --git a/sql/Updates/r1753_scriptdev2.sql b/sql/Updates/r1753_scriptdev2.sql new file mode 100644 index 0000000..6205479 --- /dev/null +++ b/sql/Updates/r1753_scriptdev2.sql @@ -0,0 +1,22 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10305+) '; + +DROP TABLE IF EXISTS `gossip_texts`; +CREATE TABLE `gossip_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gossip Texts'; + +DELETE FROM gossip_texts WHERE entry IN (-3608000, -3608001); +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3608000,'Activate the crystals when we get in trouble, right?','sinclari GOSSIP_ITEM_INTRO'), +(-3608001,'Get your people to safety, we\'ll keep the Blue Dragonflight\'s forces at bay.','sinclari GOSSIP_ITEM_START'); diff --git a/sql/Updates/r1754_scriptdev2.sql b/sql/Updates/r1754_scriptdev2.sql new file mode 100644 index 0000000..36e8ac1 --- /dev/null +++ b/sql/Updates/r1754_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10307+) '; diff --git a/sql/Updates/r1759_mangos.sql b/sql/Updates/r1759_mangos.sql new file mode 100644 index 0000000..84e9f09 --- /dev/null +++ b/sql/Updates/r1759_mangos.sql @@ -0,0 +1 @@ +UPDATE instance_template SET ScriptName='instance_onyxias_lair' WHERE map=249; diff --git a/sql/Updates/r1763_mangos.sql b/sql/Updates/r1763_mangos.sql new file mode 100644 index 0000000..7e720e7 --- /dev/null +++ b/sql/Updates/r1763_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='boss_archaedas' WHERE entry=2748; +UPDATE creature_template SET ScriptName='mob_archaeras_add' WHERE entry IN (7309,7076,7077,10120); +UPDATE gameobject_template SET ScriptName='go_altar_of_archaedas' WHERE entry=133234; diff --git a/sql/Updates/r1767_mangos.sql b/sql/Updates/r1767_mangos.sql new file mode 100644 index 0000000..de51e8f --- /dev/null +++ b/sql/Updates/r1767_mangos.sql @@ -0,0 +1,7 @@ +UPDATE gameobject_template SET ScriptName='' WHERE entry=130511; +UPDATE gameobject_template SET ScriptName='' WHERE entry=133234; + +DELETE FROM scripted_event_id WHERE id IN (2228,2268); +INSERT INTO scripted_event_id VALUES +(2228,'event_spell_altar_boss_aggro'), +(2268,'event_spell_altar_boss_aggro'); diff --git a/sql/Updates/r1771_scriptdev2.sql b/sql/Updates/r1771_scriptdev2.sql new file mode 100644 index 0000000..9a934e9 --- /dev/null +++ b/sql/Updates/r1771_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1070004 AND -1070001; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1070001,'Who dares awaken Archaedas? Who dares the wrath of the makers!',5855,1,0,0,'archaedas SAY_AGGRO'), +(-1070002,'Awake ye servants, defend the discs!',5856,1,0,0,'archaedas SAY_AWAKE_GUARDIANS'), +(-1070003,'To my side, brothers. For the makers!',5857,1,0,0,'archaedas SAY_AWAKE_WARDERS'), +(-1070004,'Reckless mortal.',5858,1,0,0,'archaedas SAY_UNIT_SLAIN'); diff --git a/sql/Updates/r1777_scriptdev2.sql b/sql/Updates/r1777_scriptdev2.sql new file mode 100644 index 0000000..e5757d8 --- /dev/null +++ b/sql/Updates/r1777_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10338+) '; diff --git a/sql/Updates/r1780_scriptdev2.sql b/sql/Updates/r1780_scriptdev2.sql new file mode 100644 index 0000000..167c553 --- /dev/null +++ b/sql/Updates/r1780_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10363+) '; diff --git a/sql/Updates/r1782_scriptdev2.sql b/sql/Updates/r1782_scriptdev2.sql new file mode 100644 index 0000000..14fae7e --- /dev/null +++ b/sql/Updates/r1782_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10373+) '; diff --git a/sql/Updates/r1783_scriptdev2.sql b/sql/Updates/r1783_scriptdev2.sql new file mode 100644 index 0000000..c30d6f3 --- /dev/null +++ b/sql/Updates/r1783_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1604030; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1604030,'%N is impaled!',0,3,0,0,'EMOTE_IMPALED'); diff --git a/sql/Updates/r1784_scriptdev2.sql b/sql/Updates/r1784_scriptdev2.sql new file mode 100644 index 0000000..fdc715d --- /dev/null +++ b/sql/Updates/r1784_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1329007 AND -1329004; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1329004,'An Ash\'ari Crystal has fallen! Stay true to the Lich King, my brethren, and attempt to resummon it.',0,6,0,0,'thuzadin acolyte SAY_ANNOUNCE_ZIGGURAT_1'), +(-1329005,'One of the Ash\'ari Crystals has been destroyed! Slay the intruders!',0,6,0,0,'thuzadin acolyte SAY_ANNOUNCE_ZIGGURAT_2'), +(-1329006,'An Ash\'ari Crystal has been toppled! Restore the ziggurat before the Necropolis is vulnerable!',0,6,0,0,'thuzadin acolyte SAY_ANNOUNCE_ZIGGURAT_3'), +(-1329007,'The Ash\'ari Crystals have been destroyed! The Slaughterhouse is vulnerable!',0,6,0,0,'baron rivendare SAY_ANNOUNCE_RIVENDARE'); diff --git a/sql/Updates/r1785_scriptdev2.sql b/sql/Updates/r1785_scriptdev2.sql new file mode 100644 index 0000000..5543935 --- /dev/null +++ b/sql/Updates/r1785_scriptdev2.sql @@ -0,0 +1,8 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1230009 AND -1230004; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1230004,'The Sons of Thaurissan shall watch you perish in the Ring of the Law!',0,1,0,0,'grimstone SAY_START_1'), +(-1230005,'You have been sentenced to death for crimes against the Dark Iron Nation!',0,1,0,0,'grimstone SAY_START_2'), +(-1230006,'Unleash the fury and let it be done!',0,1,0,0,'grimstone SAY_OPEN_EAST_GATE'), +(-1230007,'But your real punishment lies ahead.',0,1,0,0,'grimstone SAY_SUMMON_BOSS_1'), +(-1230008,'Haha! I bet you thought you were done!',0,1,0,0,'grimstone SAY_SUMMON_BOSS_2'), +(-1230009,'Good Riddance!',0,1,0,0,'grimstone SAY_OPEN_NORTH_GATE'); diff --git a/sql/Updates/r1786_scriptdev2.sql b/sql/Updates/r1786_scriptdev2.sql new file mode 100644 index 0000000..91a3cee --- /dev/null +++ b/sql/Updates/r1786_scriptdev2.sql @@ -0,0 +1,13 @@ +DELETE FROM gossip_texts WHERE entry=-3000000; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3000000,'[PH] SD2 unknown text','GOSSIP_ID_UNKNOWN_TEXT'); + +DELETE FROM gossip_texts WHERE entry BETWEEN -3560006 AND -3560000; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3560000,'I am ready to go to Durnholde Keep.','brazen GOSSIP_ITEM_READY'), +(-3560001,'I need a pack of Incendiary Bombs.','erozion GOSSIP_ITEM_NEED_BOMBS'), +(-3560002,'Taretha cannot see you, Thrall.','thrall GOSSIP_ITEM_SKARLOC1'), +(-3560003,'The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore\'s men show up. We\'ll make sure Taretha is safe.','thrall GOSSIP_ITEM_SKARLOC2'), +(-3560004,'We\'re ready, Thrall.','thrall GOSSIP_ITEM_TARREN'), +(-3560005,'Strange wizard?','taretha GOSSIP_ITEM_EPOCH1'), +(-3560006,'We\'ll get you out. Taretha. Don\'t worry. I doubt the wizard would wander too far away.','taretha GOSSIP_ITEM_EPOCH2'); diff --git a/sql/Updates/r1789_scriptdev2.sql b/sql/Updates/r1789_scriptdev2.sql new file mode 100644 index 0000000..22cd500 --- /dev/null +++ b/sql/Updates/r1789_scriptdev2.sql @@ -0,0 +1,17 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10390+) '; + +DELETE FROM script_texts WHERE entry BETWEEN -1560053 AND -1560050; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1560050,'That\'s enough out of him.',0,0,0,0,'thrall hillsbrad SAY_TH_KILL_ARMORER'), +(-1560051,'That spell should wipe their memories of us and what just happened. All they should remember now is what reality would be like without the attempted temporal interference. Well done. Thrall will journey on to find his destiny, and Taretha...',0,0,0,0,'erozion SAY_WIPE_MEMORY'), +(-1560052,'Her fate is regrettably unavoidable.',0,0,0,0,'erozion SAY_ABOUT_TARETHA'), +(-1560053,'They call you a monster. But they\'re the monsters, not you. Farewell Thrall.',0,0,0,0,'taretha SAY_TA_FAREWELL'); + +UPDATE script_texts SET type=0 WHERE entry = -1560023; +UPDATE script_texts SET type=0 WHERE entry BETWEEN -1560033 AND -1560031; +UPDATE script_texts SET type=0 WHERE entry BETWEEN -1560041 AND -1560038; +UPDATE script_texts SET type=0 WHERE entry BETWEEN -1560044 AND -1560042; +UPDATE script_texts SET type=0 WHERE entry BETWEEN -1560047 AND -1560045; + +UPDATE script_waypoint SET waittime=15000 WHERE entry=17876 AND pointid=96; +UPDATE script_waypoint SET waittime=10000 WHERE entry=17876 AND pointid=97; diff --git a/sql/Updates/r1791_scriptdev2.sql b/sql/Updates/r1791_scriptdev2.sql new file mode 100644 index 0000000..b5647b3 --- /dev/null +++ b/sql/Updates/r1791_scriptdev2.sql @@ -0,0 +1,21 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1560058 AND -1560054; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1560054,'I\'m glad you\'re safe, Taretha. None of this would have been possible without your friends. They made all of this happen.',0,0,0,0,'thrall hillsbrad SAY_TR_GLAD_SAFE'), +(-1560055,'Thrall, I\'ve never met these people before in my life.',0,0,0,0,'taretha SAY_TA_NEVER_MET'), +(-1560056,'Then who are these people?',0,0,0,0,'thrall hillsbrad SAY_TR_THEN_WHO'), +(-1560057,'I believe I can explain everything to you two if you give me a moment of your time.',0,0,0,0,'erozion SAY_PRE_WIPE'), +(-1560058,'You have done a great thing. Alas, the young warchief\'s memory of these events must be as they originally were ... Andormu awaits you in the master\'s lair.',0,0,0,0,'erozion SAY_AFTER_WIPE'); + +DELETE FROM script_waypoint WHERE entry=17876 AND pointid IN (106,107,108); +INSERT INTO script_waypoint VALUES +(17876, 106, 2630.45, 674.420, 54.4943, 5000, 'when all dead and meet Taretha'), +(17876, 107, 2634.30, 661.698, 54.4147, 0, 'run off'), +(17876, 108, 2652.21, 644.396, 56.1906, 0, ''); + +DELETE FROM script_waypoint WHERE entry=18887 AND pointid IN (7,8,9,10,11); +INSERT INTO script_waypoint VALUES +(18887, 7, 2638.57, 671.231, 54.5200, 60000, ''), +(18887, 8, 2636.56, 679.894, 54.6595, 0, ''), +(18887, 9, 2640.79, 689.647, 55.3215, 0, ''), +(18887, 10, 2639.35, 706.777, 56.0667, 0, ''), +(18887, 11, 2617.70, 731.884, 55.5571, 0, ''); diff --git a/sql/Updates/r1797_mangos.sql b/sql/Updates/r1797_mangos.sql new file mode 100644 index 0000000..51f146e --- /dev/null +++ b/sql/Updates/r1797_mangos.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET ScriptName='go_beacon_torch' WHERE entry=176093; + diff --git a/sql/Updates/r1798_mangos.sql b/sql/Updates/r1798_mangos.sql new file mode 100644 index 0000000..21f3612 --- /dev/null +++ b/sql/Updates/r1798_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_scourge_enclosure' WHERE entry=191548; diff --git a/sql/Updates/r1800_mangos.sql b/sql/Updates/r1800_mangos.sql new file mode 100644 index 0000000..730a24f --- /dev/null +++ b/sql/Updates/r1800_mangos.sql @@ -0,0 +1,4 @@ +DELETE FROM scripted_event_id WHERE id=8328; +INSERT INTO scripted_event_id VALUES +(8328, 'npc_kroshius'); +UPDATE creature_template SET ScriptName='npc_kroshius' WHERE entry=14467; diff --git a/sql/Updates/r1800_scriptdev2.sql b/sql/Updates/r1800_scriptdev2.sql new file mode 100644 index 0000000..e3bd374 --- /dev/null +++ b/sql/Updates/r1800_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1000589; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000589,'Kroshius live? Kroshius crush!',0,1,0,0,'SAY_KROSHIUS_REVIVE'); diff --git a/sql/Updates/r1807_scriptdev2.sql b/sql/Updates/r1807_scriptdev2.sql new file mode 100644 index 0000000..02d7edc --- /dev/null +++ b/sql/Updates/r1807_scriptdev2.sql @@ -0,0 +1,8 @@ +DELETE FROM gossip_texts WHERE entry BETWEEN -3595005 AND -3595000; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3595000,'What do you think they\'re up to?','chromie GOSSIP_ITEM_ENTRANCE_1'), +(-3595001,'You want me to do what?','chromie GOSSIP_ITEM_ENTRANCE_2'), +(-3595002,'Very well, Chromie.','chromie GOSSIP_ITEM_ENTRANCE_3'), +(-3595003,'Why have I been sent back to this particular place and time?','chromie GOSSIP_ITEM_INN_1'), +(-3595004,'What was this decision?','chromie GOSSIP_ITEM_INN_2'), +(-3595005,'So how does the Infinite Dragonflight plan to interfere?','chromie GOSSIP_ITEM_INN_3'); diff --git a/sql/Updates/r1810_scriptdev2.sql b/sql/Updates/r1810_scriptdev2.sql new file mode 100644 index 0000000..c9f2899 --- /dev/null +++ b/sql/Updates/r1810_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM gossip_texts WHERE entry = -3649000; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3649000,'Yes. We are prepared for the challenges ahead of us.','barrett GOSSIP_ITEM_START_EVENT1'); diff --git a/sql/Updates/r1813_mangos.sql b/sql/Updates/r1813_mangos.sql new file mode 100644 index 0000000..ebf90b6 --- /dev/null +++ b/sql/Updates/r1813_mangos.sql @@ -0,0 +1,4 @@ +DELETE FROM scripted_areatrigger WHERE entry IN (5046, 5047); +INSERT INTO scripted_areatrigger VALUES +(5046, 'at_waygate'), +(5047, 'at_waygate'); diff --git a/sql/Updates/r1816_scriptdev2.sql b/sql/Updates/r1816_scriptdev2.sql new file mode 100644 index 0000000..b19ec27 --- /dev/null +++ b/sql/Updates/r1816_scriptdev2.sql @@ -0,0 +1,2 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10449+) '; + diff --git a/sql/Updates/r1818_mangos.sql b/sql/Updates/r1818_mangos.sql new file mode 100644 index 0000000..ee62626 --- /dev/null +++ b/sql/Updates/r1818_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='boss_thermaplugg' WHERE entry=7800; +UPDATE gameobject_template SET ScriptName='go_gnomeface_button' WHERE entry BETWEEN 142214 AND 142219; +UPDATE instance_template SET ScriptName='instance_gnomeregan' WHERE map=90; diff --git a/sql/Updates/r1818_scriptdev2.sql b/sql/Updates/r1818_scriptdev2.sql new file mode 100644 index 0000000..346ba8b --- /dev/null +++ b/sql/Updates/r1818_scriptdev2.sql @@ -0,0 +1,36 @@ +DELETE FROM gossip_texts WHERE entry=-3090000; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3090000,'I am ready to begin.','emi shortfuse GOSSIP_ITEM_START'); + +DELETE FROM script_texts WHERE entry BETWEEN -1090027 AND -1090000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1090000,'With your help, I can evaluate these tunnels.',0,0,0,1,'emi shortfuse SAY_START'), +(-1090001,'Let\'s see if we can find out where these Troggs are coming from.... and put a stop to the invasion!',0,0,0,1,'emi shortfuse SAY_INTRO_1'), -- ' +(-1090002,'Such devastation... what a horrible mess....',0,0,0,5,'emi shortfuse SAY_INTRO_2'), +(-1090003,'It\'s quiet here....',0,0,0,1,'emi shortfuse SAY_INTRO_3'), -- ' +(-1090004,'...too quiet.',0,0,0,1,'emi shortfuse SAY_INTRO_4'), +(-1090005,'Look! Over there at the tunnel wall!',0,0,0,25,'emi shortfuse SAY_LOOK_1'), +(-1090006,'Trogg incursion! Defend me while I blast the hole closed!',0,0,0,5,'emi shortfuse SAY_HEAR_1'), +(-1090007,'Get this, $n off of me!',0,0,0,0,'emi shortfuse SAY_AGGRO'), +(-1090008,'I don\'t think one charge is going to cut it. Keep fending them off!',0,0,0,0,'emi shortfuse SAY_CHARGE_1'), -- ' +(-1090009,'The charges are set. Get back before they blow!',0,0,0,5,'emi shortfuse SAY_CHARGE_2'), +(-1090010,'Incoming blast in 10 seconds!',0,1,0,5,'emi shortfuse SAY_BLOW_1_10'), +(-1090011,'Incoming blast in 5 seconds. Clear the tunnel!',0,1,0,5,'emi shortfuse SAY_BLOW_1_5'), +(-1090012,'FIRE IN THE HOLE!',0,1,0,25,'emi shortfuse SAY_BLOW_1'), +(-1090013,'Well done! without your help I would have never been able to thwart that wave of troggs.',0,0,0,4,'emi shortfuse SAY_FINISH_1'), +(-1090014,'Did you hear something?',0,0,0,6,'emi shortfuse SAY_LOOK_2'), +(-1090015,'I heard something over there.',0,0,0,25,'emi shortfuse SAY_HEAR_2'), +(-1090016,'More troggs! Ward them off as I prepare the explosives!',0,0,0,0,'emi shortfuse SAY_CHARGE_3'), +(-1090017,'The final charges are set. Stand back!',0,0,0,1,'emi shortfuse SAY_CHARGE_4'), +(-1090018,'10 seconds to blast! Stand back!',0,1,0,5,'emi shortfuse SAY_BLOW_2_10'), +(-1090019,'5 seconds until detonation!',0,1,0,5,'emi shortfuse SAY_BLOW_2_5'), +(-1090020,'Good work! I detonate the explosives that no more troggs can reach the surface.',0,0,0,1,'emi shortfuse SAY_BLOW_SOON'), -- TODO: German: Saubere Arbeit! Ich löse die Sprengladungen aus, damit nicht noch mehr Troggs an die Oberfläche gelangen können. +(-1090021,'FIRE IN THE HOLE!',0,1,0,0,'emi shortfuse SAY_BLOW_2'), +(-1090022,'Superb! Because of your help, my people stand a chance of re-taking our belowed city. Three cheers to you!',0,0,0,0,'emi shortfuse SAY_FINISH_2'), + +(-1090023,'We come from below! You can never stop us!',0,1,0,1,'grubbis SAY_GRUBBIS_SPAWN'), + +(-1090024,'Usurpers! Gnomeregan is mine!',5807,1,0,0,'thermaplugg SAY_AGGRO'), +(-1090025,'My machines are the future! They\'ll destroy you all! ',5808,1,0,0,'thermaplugg SAY_PHASE'), -- ' +(-1090026,'Explosions! MORE explosions! I\'ve got to have more explosions! ',5809,1,0,0,'thermaplugg SAY_BOMB'), -- ' +(-1090027,'...and stay dead! He got served',5810,1,0,0,'thermaplugg SAY_SLAY'); diff --git a/sql/Updates/r1819_mangos.sql b/sql/Updates/r1819_mangos.sql new file mode 100644 index 0000000..b4a1c56 --- /dev/null +++ b/sql/Updates/r1819_mangos.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET ScriptName='' WHERE entry=176093; +UPDATE gameobject_template SET ScriptName='go_andorhal_tower' WHERE entry IN (176094,176095,176096,176097); diff --git a/sql/Updates/r1822_scriptdev2.sql b/sql/Updates/r1822_scriptdev2.sql new file mode 100644 index 0000000..fc395fb --- /dev/null +++ b/sql/Updates/r1822_scriptdev2.sql @@ -0,0 +1,11 @@ +DELETE FROM gossip_texts WHERE entry BETWEEN -3603008 AND -3603000; +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3603000,'Teleport to the Expedition Base Camp.','GOSSIP_ITEM_TELE_BASE_CAMP'), +(-3603001,'Teleport to the Formation Grounds.','GOSSIP_ITEM_TELE_FORMATION_GROUNDS'), +(-3603002,'Teleport to the Colossal Forge.','GOSSIP_ITEM_TELE_COLOSSAR_FORGE'), +(-3603003,'Teleport to the Scrapyard.','GOSSIP_ITEM_TELE_SCRAPYARD'), +(-3603004,'Teleport to the Antechamber of Ulduar.','GOSSIP_ITEM_TELE_ANTECHAMBER'), +(-3603005,'Teleport to the Shattered Walkway.','GOSSIP_ITEM_TELE_WALKWAY'), +(-3603006,'Teleport to the Conservatory of Life.','GOSSIP_ITEM_TELE_CONSERVATORY'), +(-3603007,'Teleport to the Spark of Imagination.','GOSSIP_ITEM_TELE_SPARK_IMAGINATION'), +(-3603008,'Teleport to the Prison of Yogg-Saron.','GOSSIP_ITEM_TELE_YOGG_SARON'); diff --git a/sql/Updates/r1824_mangos.sql b/sql/Updates/r1824_mangos.sql new file mode 100644 index 0000000..253a9db --- /dev/null +++ b/sql/Updates/r1824_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (25084,25085); diff --git a/sql/Updates/r1825_mangos.sql b/sql/Updates/r1825_mangos.sql new file mode 100644 index 0000000..8bc7398 --- /dev/null +++ b/sql/Updates/r1825_mangos.sql @@ -0,0 +1,3 @@ +UPDATE creature_template SET ScriptName='boss_bronjahm' WHERE entry=36497; +UPDATE creature_template SET ScriptName='boss_devourer_of_souls' WHERE entry=36502; +UPDATE instance_template SET ScriptName='instance_forge_of_souls' WHERE map=632; diff --git a/sql/Updates/r1825_scriptdev2.sql b/sql/Updates/r1825_scriptdev2.sql new file mode 100644 index 0000000..11964a4 --- /dev/null +++ b/sql/Updates/r1825_scriptdev2.sql @@ -0,0 +1,34 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1632025 AND -1632000; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1632000,'More souls to power the engine!',0,1,0,0,'boss_bronjahm SAY_AGGRO_1'), +(-1632001,'Finally...a captive audience!',16595,1,0,0,'boss_bronjahm SAY_AGGRO_2'), +(-1632002,'Fodder for the engine!',16596,1,0,0,'boss_bronjahm SAY_SLAY_1'), +(-1632003,'Another soul to strengthen the host!',16597,1,0,0,'boss_bronjahm SAY_SLAY_2'), +(-1632004,'My soul for you, master.',16598,1,0,0,'boss_bronjahm SAY_DEATH'), +(-1632005,'The vortex of the harvested calls to you!',16599,1,0,0,'boss_bronjahm SAY_SOULSTORM'), +(-1632006,'I will sever the soul from your body!',16600,1,0,0,'boss_bronjahm SAY_CORRUPT_SOUL'), + +(-1632007,'You dare look upon the host of souls?! I SHALL DEVOUR YOU WHOLE!',16884,1,0,0,'boss_devourer SAY_MALE_1_AGGRO'), +(-1632008,'You dare look upon the host of souls?! I SHALL DEVOUR YOU WHOLE!',16890,1,0,0,'boss_devourer SAY_FEMALE_AGGRO'), +(-1632009,'Damnation!',16885,1,0,0,'boss_devourer SAY_MALE_1_SLAY_1'), +(-1632010,'Damnation!',16891,1,0,0,'boss_devourer SAY_FEMALE_SLAY_1'), +(-1632011,'Damnation!',16896,1,0,0,'boss_devourer SAY_MALE_2_SLAY_1'), +(-1632012,'Doomed for eternity!',16886,1,0,0,'boss_devourer SAY_MALE_1_SLAY_2'), +(-1632013,'Doomed for eternity!',16892,1,0,0,'boss_devourer SAY_FEMALE_SLAY_2'), +(-1632014,'Doomed for eternity!',16897,1,0,0,'boss_devourer SAY_MALE_2_SLAY_2'), +(-1632015,'The swell of souls will not be abated! You only delay the inevitable!',16887,1,0,0,'boss_devourer SAY_MALE_1_DEATH'), +(-1632016,'The swell of souls will not be abated! You only delay the inevitable!',16893,1,0,0,'boss_devourer SAY_FEMALE_DEATH'), +(-1632017,'The swell of souls will not be abated! You only delay the inevitable!',16898,1,0,0,'boss_devourer SAY_MALE_2_DEATH'), +(-1632018,'SUFFERING! ANGUISH! CHAOS! RISE AND FEED!',16888,1,0,0,'boss_devourer SAY_MALE_1_SOUL_ATTACK'), +(-1632019,'SUFFERING! ANGUISH! CHAOS! RISE AND FEED!',16894,1,0,0,'boss_devourer SAY_FEMALE_SOUL_ATTACK'), +(-1632020,'SUFFERING! ANGUISH! CHAOS! RISE AND FEED!',16899,1,0,0,'boss_devourer SAY_MALE_2_SOUL_ATTACK'), +(-1632021,'Stare into the abyss, and see your end!',16889,1,0,0,'boss_devourer SAY_MALE_1_DARK_GLARE'), +(-1632022,'Stare into the abyss, and see your end!',16895,1,0,0,'boss_devourer SAY_FEMALE_DARK_GLARE'), +(-1632023,'%s begins to cast Mirrored Soul!',0,3,0,0,'boss_devourer EMOTE_MIRRORED_SOUL'), +(-1632024,'%s begins to Unleash Souls!',0,3,0,0,'boss_devourer EMOTE_UNLEASH_SOULS'), +(-1632025,'%s begins to cast Wailing Souls!',0,3,0,0,'boss_devourer EMOTE_WAILING_SOULS'); + +DELETE FROM script_texts WHERE entry IN (-1090026, -1090025); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1090025,'My machines are the future! They\'ll destroy you all!',5808,1,0,0,'thermaplugg SAY_PHASE'), +(-1090026,'Explosions! MORE explosions! I\'ve got to have more explosions!',5809,1,0,0,'thermaplugg SAY_BOMB'); diff --git a/sql/Updates/r1826_mangos.sql b/sql/Updates/r1826_mangos.sql new file mode 100644 index 0000000..6288cf4 --- /dev/null +++ b/sql/Updates/r1826_mangos.sql @@ -0,0 +1,2 @@ +UPDATE gameobject_template SET ScriptName='go_veil_skith_cage' WHERE entry IN (185202,185203,185204,185205); +UPDATE creature_template SET ScriptName='npc_captive_child' WHERE entry = 22314; diff --git a/sql/Updates/r1826_scriptdev2.sql b/sql/Updates/r1826_scriptdev2.sql new file mode 100644 index 0000000..fc62acd --- /dev/null +++ b/sql/Updates/r1826_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry IN (-1000590,-1000591,-1000592,-1000593); +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000590,'Woot!',0,0,0,0,'Captive Child SAY_THANKS_1'), +(-1000591,'I think those weird bird guys were going to eat us. Gross!',0,0,0,0,'Captive Child SAY_THANKS_2'), +(-1000592,'Yay! We\'re free!',0,0,0,0,'Captive Child SAY_THANKS_3'), +(-1000593,'Gross!',0,0,0,0,'Captive Child SAY_THANKS_4'); diff --git a/sql/Updates/r1827_scriptdev2.sql b/sql/Updates/r1827_scriptdev2.sql new file mode 100644 index 0000000..ce92928 --- /dev/null +++ b/sql/Updates/r1827_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE script_texts SET type=4 WHERE entry BETWEEN -1000230 AND -1000217; diff --git a/sql/Updates/r1828_scriptdev2.sql b/sql/Updates/r1828_scriptdev2.sql new file mode 100644 index 0000000..b271cc6 --- /dev/null +++ b/sql/Updates/r1828_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10513+) '; diff --git a/sql/Updates/r1829_mangos.sql b/sql/Updates/r1829_mangos.sql new file mode 100644 index 0000000..ad00e93 --- /dev/null +++ b/sql/Updates/r1829_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='' WHERE entry IN (11673, 18254, 22055, 22056); diff --git a/sql/Updates/r1830_scriptdev2.sql b/sql/Updates/r1830_scriptdev2.sql new file mode 100644 index 0000000..e9f57bc --- /dev/null +++ b/sql/Updates/r1830_scriptdev2.sql @@ -0,0 +1,3 @@ +DELETE FROM script_texts WHERE entry=-1574023; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1574023,'Ingvar! Your pathetic failure will serve as a warning to all... you are damned! Arise and carry out the masters will!',13754,1,0,0,'annhylde REZZ'); diff --git a/sql/Updates/r1831_scriptdev2.sql b/sql/Updates/r1831_scriptdev2.sql new file mode 100644 index 0000000..02ac375 --- /dev/null +++ b/sql/Updates/r1831_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10529+) '; diff --git a/sql/Updates/r1836_mangos.sql b/sql/Updates/r1836_mangos.sql new file mode 100644 index 0000000..6f20e46 --- /dev/null +++ b/sql/Updates/r1836_mangos.sql @@ -0,0 +1,4 @@ +DELETE FROM scripted_areatrigger WHERE entry=4752; +INSERT INTO scripted_areatrigger VALUES +(4752,'at_nats_landing'); + diff --git a/sql/Updates/r1842_scriptdev2.sql b/sql/Updates/r1842_scriptdev2.sql new file mode 100644 index 0000000..4901aaf --- /dev/null +++ b/sql/Updates/r1842_scriptdev2.sql @@ -0,0 +1 @@ +UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 10610+) '; diff --git a/sql/Updates/r1843_mangos.sql b/sql/Updates/r1843_mangos.sql new file mode 100644 index 0000000..2f2c311 --- /dev/null +++ b/sql/Updates/r1843_mangos.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry=32149; diff --git a/sql/Updates/r1843_scriptdev2.sql b/sql/Updates/r1843_scriptdev2.sql new file mode 100644 index 0000000..cd748fb --- /dev/null +++ b/sql/Updates/r1843_scriptdev2.sql @@ -0,0 +1,7 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000598 AND -1000594; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000594,'At last... now I can rest.',0,0,0,0,'hero spirit SAY_BLESS_1'), +(-1000595,'I\'m so tired. Just let me rest for a moment.',0,0,0,0,'hero spirit SAY_BLESS_2'), +(-1000596,'I can\'t hear the screams anymore. Is this the end?',0,0,0,0,'hero spirit SAY_BLESS_3'), +(-1000597,'My nightmare, is it finally over?',0,0,0,0,'hero spirit SAY_BLESS_4'), +(-1000598,'It was awful... I dreamt I was fighting against my friends.',0,0,0,0,'hero spirit SAY_BLESS_5'); diff --git a/sql/Updates/r1844_mangos.sql b/sql/Updates/r1844_mangos.sql new file mode 100644 index 0000000..5fc920d --- /dev/null +++ b/sql/Updates/r1844_mangos.sql @@ -0,0 +1 @@ +UPDATE gameobject_template SET ScriptName='go_mysterious_snow_mound' WHERE entry=195308; diff --git a/sql/Updates/r1845_mangos.sql b/sql/Updates/r1845_mangos.sql new file mode 100644 index 0000000..2270210 --- /dev/null +++ b/sql/Updates/r1845_mangos.sql @@ -0,0 +1,2 @@ +UPDATE creature_template SET ScriptName='npc_nesingwary_trapper' WHERE entry=25835; +UPDATE gameobject_template SET ScriptName='go_caribou_trap' WHERE entry IN (187982,187995,187996,187997,187998,187999,188000,188001,188002,188003,188004,188005,188006,188007,188008); diff --git a/sql/Updates/r1845_scriptdev2.sql b/sql/Updates/r1845_scriptdev2.sql new file mode 100644 index 0000000..6df8341 --- /dev/null +++ b/sql/Updates/r1845_scriptdev2.sql @@ -0,0 +1,6 @@ +DELETE FROM script_texts WHERE entry BETWEEN -1000602 AND -1000599; +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000599,'It\'s a miracle! The beast skinned itself!',0,0,0,5,'nesingwary trapper SAY_PHRASE_1'), +(-1000600,'Jackpot!',0,0,0,5,'nesingwary trapper SAY_PHRASE_2'), +(-1000601,'This is the last one i need for that set of Nesingwary steak knives!',0,0,0,5,'nesingwary trapper SAY_PHRASE_3'), +(-1000602,'Silly beasts!',0,0,0,5,'nesingwary trapper SAY_PHRASE_4'); diff --git a/sql/mangos_scriptname_full.sql b/sql/mangos_scriptname_full.sql new file mode 100644 index 0000000..566c5a1 --- /dev/null +++ b/sql/mangos_scriptname_full.sql @@ -0,0 +1,1287 @@ +/* */ + +/* AREATRIGGER */ +DELETE FROM scripted_areatrigger WHERE entry=4591; +INSERT INTO scripted_areatrigger VALUES (4591,'at_coilfang_waterfall'); +DELETE FROM scripted_areatrigger WHERE entry=4560; +INSERT INTO scripted_areatrigger VALUES (4560,'at_legion_teleporter'); +DELETE FROM scripted_areatrigger WHERE entry=3066; +INSERT INTO scripted_areatrigger VALUES (3066,'at_ravenholdt'); +DELETE FROM scripted_areatrigger WHERE entry IN (4871, 4872, 4873); +INSERT INTO scripted_areatrigger VALUES +(4871,'at_warsong_farms'), +(4872,'at_warsong_farms'), +(4873,'at_warsong_farms'); +DELETE FROM scripted_areatrigger WHERE entry IN (5046, 5047); +INSERT INTO scripted_areatrigger VALUES +(5046, 'at_waygate'), +(5047, 'at_waygate'); +DELETE FROM scripted_areatrigger WHERE entry BETWEEN 5284 AND 5287; +INSERT INTO scripted_areatrigger VALUES +(5284,'at_aldurthar_gate'), +(5285,'at_aldurthar_gate'), +(5286,'at_aldurthar_gate'), +(5287,'at_aldurthar_gate'); +DELETE FROM scripted_areatrigger WHERE entry=4112; +INSERT INTO scripted_areatrigger VALUES (4112,'at_naxxramas'); +DELETE FROM scripted_areatrigger WHERE entry=5108; +INSERT INTO scripted_areatrigger VALUES (5108,'at_stormwright_shelf'); +DELETE FROM scripted_areatrigger WHERE entry IN (3546, 3547, 3548, 3549, 3550, 3552); +INSERT INTO scripted_areatrigger VALUES +(3546, 'at_childrens_week_spot'), -- Darnassian bank +(3547, 'at_childrens_week_spot'), -- Undercity - thone room +(3548, 'at_childrens_week_spot'), -- Stonewrought Dam +(3549, 'at_childrens_week_spot'), -- The Mor'shan Rampart +(3550, 'at_childrens_week_spot'), -- Ratchet Docks +(3552, 'at_childrens_week_spot'); -- Westfall Lighthouse +DELETE FROM scripted_areatrigger WHERE entry IN (2026, 2046); +INSERT INTO scripted_areatrigger VALUES +(2026, 'at_blackrock_spire'), +(2046, 'at_blackrock_spire'); + +/* BATTLEGROUNDS */ +UPDATE creature_template SET ScriptName='npc_spirit_guide' WHERE entry IN (13116, 13117); + +/* WORLD BOSS */ +UPDATE creature_template SET ScriptName='boss_ysondre' WHERE entry=14887; +UPDATE creature_template SET ScriptName='boss_emeriss' WHERE entry=14889; +UPDATE creature_template SET ScriptName='boss_taerar' WHERE entry=14890; +UPDATE creature_template SET ScriptName='boss_shade_of_taerar' WHERE entry=15302; +UPDATE creature_template SET ScriptName='boss_kruul' WHERE entry=18338; +UPDATE creature_template SET ScriptName='boss_azuregos' WHERE entry=6109; +UPDATE creature_template SET ScriptName='mob_dementeddruids' WHERE entry=15260; + +/* GO */ +UPDATE gameobject_template SET ScriptName='go_cat_figurine' WHERE entry=13873; +UPDATE gameobject_template SET ScriptName='go_northern_crystal_pylon' WHERE entry=164955; +UPDATE gameobject_template SET ScriptName='go_western_crystal_pylon' WHERE entry=164956; +UPDATE gameobject_template SET ScriptName='go_eastern_crystal_pylon' WHERE entry=164957; +UPDATE gameobject_template SET ScriptName='go_barov_journal' WHERE entry=180794; +UPDATE gameobject_template SET ScriptName='go_ethereum_prison' WHERE entry BETWEEN 184418 AND 184431; +UPDATE gameobject_template SET ScriptName='go_ethereum_stasis' WHERE entry BETWEEN 185465 AND 185467; +UPDATE gameobject_template SET ScriptName='go_ethereum_stasis' WHERE entry=184595; +UPDATE gameobject_template SET ScriptName='go_ethereum_stasis' WHERE entry BETWEEN 185461 AND 185464; +UPDATE gameobject_template SET ScriptName='go_field_repair_bot_74A' where entry=179552; +UPDATE gameobject_template SET ScriptName='go_gilded_brazier' WHERE entry=181956; +UPDATE gameobject_template SET ScriptName='go_jump_a_tron' WHERE entry=183146; +UPDATE gameobject_template SET ScriptName='go_mysterious_snow_mound' WHERE entry=195308; +UPDATE gameobject_template SET ScriptName='go_orb_of_command' WHERE entry=179879; +UPDATE gameobject_template SET ScriptName='go_resonite_cask' WHERE entry=178145; +UPDATE gameobject_template SET ScriptName='go_sacred_fire_of_life' WHERE entry=175944; +UPDATE gameobject_template SET ScriptName='go_shrine_of_the_birds' WHERE entry IN (185547,185553,185551); +UPDATE gameobject_template SET ScriptName='go_tablet_of_madness' WHERE entry=180368; +UPDATE gameobject_template SET ScriptName='go_tablet_of_the_seven' WHERE entry=169294; +UPDATE gameobject_template SET ScriptName='go_tele_to_dalaran_crystal' WHERE entry=191230; +UPDATE gameobject_template SET ScriptName='go_tele_to_violet_stand' WHERE entry=191229; +UPDATE gameobject_template SET ScriptName='go_blood_filled_orb' WHERE entry=182024; +UPDATE gameobject_template SET ScriptName='go_andorhal_tower' WHERE entry IN (176094,176095,176096,176097); +UPDATE gameobject_template SET ScriptName='go_scourge_enclosure' WHERE entry=191548; +UPDATE gameobject_template SET ScriptName='go_veil_skith_cage' WHERE entry IN (185202,185203,185204,185205); + +/* GUARD */ +UPDATE creature_template SET ScriptName='guard_azuremyst' WHERE entry=18038; +UPDATE creature_template SET ScriptName='guard_orgrimmar' WHERE entry=3296; +UPDATE creature_template SET ScriptName='guard_stormwind' WHERE entry IN (68,1976); +UPDATE creature_template SET ScriptName='guard_contested' WHERE entry IN (9460,4624,3502,11190,15184); +UPDATE creature_template SET ScriptName='guard_elwynnforest' WHERE entry=1423; +UPDATE creature_template SET ScriptName='guard_eversong' WHERE entry=16221; +UPDATE creature_template SET ScriptName='guard_darnassus' WHERE entry=4262; +UPDATE creature_template SET ScriptName='guard_teldrassil' WHERE entry=3571; +UPDATE creature_template SET ScriptName='guard_ironforge' WHERE entry=5595; +UPDATE creature_template SET ScriptName='guard_dunmorogh' WHERE entry IN (727,13076); +UPDATE creature_template SET ScriptName='guard_undercity' WHERE entry=5624; +UPDATE creature_template SET ScriptName='guard_bluffwatcher' WHERE entry=3084; +UPDATE creature_template SET ScriptName='guard_durotar' WHERE entry=5953; +UPDATE creature_template SET ScriptName='guard_mulgore' WHERE entry IN (3212,3215,3217,3218,3219,3220,3221,3222,3223,3224); +UPDATE creature_template SET ScriptName='guard_dunmorogh' WHERE entry IN (727,13076); +UPDATE creature_template SET ScriptName='guard_tirisfal' WHERE entry IN (1735,1738,2210,1744,1745,5725,1743,2209,1746,1742); +UPDATE creature_template SET ScriptName='guard_silvermoon' WHERE entry=16222; +UPDATE creature_template SET ScriptName='guard_exodar' WHERE entry=16733; +UPDATE creature_template SET ScriptName='guard_shattrath' WHERE entry=19687; +UPDATE creature_template SET ScriptName='guard_shattrath_aldor' WHERE entry=18549; +UPDATE creature_template SET ScriptName='guard_shattrath_scryer' WHERE entry=18568; + +/* ITEM */ +UPDATE item_template SET ScriptName='item_arcane_charges' WHERE entry=34475; +UPDATE item_template SET ScriptName='item_flying_machine' WHERE entry IN (34060,34061); +UPDATE item_template SET ScriptName='item_gor_dreks_ointment' WHERE entry=30175; +UPDATE item_template SET ScriptName='item_tainted_core' WHERE entry=31088; +UPDATE item_template SET ScriptName='item_petrov_cluster_bombs' WHERE entry=33098; + +/* NPC (usually creatures to be found in more than one specific zone) */ +UPDATE creature_template SET ScriptName='npc_air_force_bots' WHERE entry IN (2614, 2615, 21974, 21993, 21996, 21997, 21999, 22001, 22002, 22003, 22063, 22065, 22066, 22068, 22069, 22070, 22071, 22078, 22079, 22080, 22086, 22087, 22088, 22090, 22124, 22125, 22126); +UPDATE creature_template SET ScriptName='npc_chicken_cluck' WHERE entry=620; +UPDATE creature_template SET ScriptName='npc_dancing_flames' WHERE entry=25305; +UPDATE creature_template SET ScriptName='npc_garments_of_quests' WHERE entry IN (12429,12423,12427,12430,12428); +UPDATE creature_template SET ScriptName='npc_guardian' WHERE entry=5764; +UPDATE creature_template SET ScriptName='npc_kingdom_of_dalaran_quests' WHERE entry IN (29169,23729,26673,27158,29158,29161,26471,29155,29159,29160,29162); +UPDATE creature_template SET ScriptName='npc_lunaclaw_spirit' WHERE entry=12144; +UPDATE creature_template SET ScriptName='npc_mount_vendor' WHERE entry IN (384,1261,1460,2357,3362,3685,4730,4731,4885,7952,7955,16264,17584); +UPDATE creature_template SET ScriptName='npc_doctor' WHERE entry IN (12939,12920); +UPDATE creature_template SET ScriptName='npc_injured_patient' WHERE entry IN (12936,12937,12938,12923,12924,12925); +UPDATE creature_template SET ScriptName='' WHERE npcflag!=npcflag|65536 AND ScriptName='npc_innkeeper'; +UPDATE creature_template SET ScriptName='npc_innkeeper' WHERE npcflag=npcflag|65536; +UPDATE creature_template SET ScriptName='npc_prof_alchemy' WHERE entry IN (17909,19052,22427); +UPDATE creature_template SET ScriptName='npc_prof_blacksmith' WHERE entry IN (5164,11145,11146,11176,11177,11178,11191,11192,11193); +UPDATE creature_template SET ScriptName='npc_engineering_tele_trinket' WHERE entry IN (14742,14743,21493,21494); +UPDATE creature_template SET ScriptName='npc_prof_leather' WHERE entry IN (7866,7867,7868,7869,7870,7871); +UPDATE creature_template SET ScriptName='npc_prof_tailor' WHERE entry IN (22208,22212,22213); +UPDATE creature_template SET ScriptName='npc_rogue_trainer' WHERE entry IN (918,4163,3328,4583,5165,5167,13283,16684); +UPDATE creature_template SET ScriptName='npc_sayge' WHERE entry=14822; +UPDATE creature_template SET ScriptName='npc_tabard_vendor' WHERE entry=28776; +UPDATE creature_template SET ScriptName='npc_locksmith' WHERE entry IN (29665,29725,29728); + +/* SPELL */ +UPDATE creature_template SET ScriptName='spell_dummy_npc' WHERE entry IN (16880,1200,26616,26643,16518,25793,25758,25752,25792,25753,26421,26841,27808,27122,28068,12298,12296,24918,17326,17654,16847,18879,26270,26268,30146,25084,25085,32149); +UPDATE gameobject_template SET ScriptName='spell_dummy_go' WHERE entry IN (181616,186949); + +/* */ +/* ZONE */ +/* */ + +/* ALTERAC MOUNTAINS */ + + +/* ALTERAC VALLEY */ + + +/* ARATHI HIGHLANDS */ +UPDATE creature_template SET ScriptName='npc_professor_phizzlethorpe' WHERE entry=2768; + +/* ASHENVALE */ +UPDATE creature_template SET ScriptName='npc_muglash' WHERE entry=12717; +UPDATE gameobject_template SET ScriptName='go_naga_brazier' WHERE entry=178247; +UPDATE creature_template SET ScriptName='npc_ruul_snowhoof' WHERE entry=12818; +UPDATE creature_template SET ScriptName='npc_torek' WHERE entry=12858; + +/* */ +/* AUCHINDOUN */ +/* */ + +/* MANA TOMBS */ +UPDATE creature_template SET ScriptName='boss_pandemonius' WHERE entry=18341; +UPDATE creature_template SET ScriptName='boss_nexusprince_shaffar' WHERE entry=18344; +UPDATE creature_template SET ScriptName='mob_ethereal_beacon' WHERE entry=18431; + +/* AUCHENAI CRYPTS */ +UPDATE creature_template SET ScriptName='boss_exarch_maladaar' WHERE entry=18373; +UPDATE creature_template SET ScriptName='mob_avatar_of_martyred' WHERE entry=18478; +UPDATE creature_template SET ScriptName='mob_stolen_soul' WHERE entry=18441; + +/* SETHEKK HALLS */ +UPDATE instance_template SET ScriptName='instance_sethekk_halls' WHERE map=556; +UPDATE creature_template SET ScriptName='mob_syth_fire' WHERE entry=19203; +UPDATE creature_template SET ScriptName='mob_syth_arcane' WHERE entry=19205; +UPDATE creature_template SET ScriptName='mob_syth_frost' WHERE entry=19204; +UPDATE creature_template SET ScriptName='mob_syth_shadow' WHERE entry=19206; +UPDATE creature_template SET ScriptName='boss_talon_king_ikiss' WHERE entry=18473; +UPDATE creature_template SET ScriptName='boss_darkweaver_syth' WHERE entry=18472; + +/* SHADOW LABYRINTH */ +UPDATE instance_template SET ScriptName='instance_shadow_labyrinth' WHERE map=555; +UPDATE creature_template SET ScriptName='boss_murmur' WHERE entry=18708; +UPDATE creature_template SET ScriptName='boss_grandmaster_vorpil' WHERE entry=18732; +UPDATE creature_template SET ScriptName='boss_blackheart_the_inciter' WHERE entry=18667; +UPDATE creature_template SET ScriptName='boss_ambassador_hellmaw' WHERE entry=18731; + +/* */ +/* AZJOL-NERUB */ +/* */ + +/* AHN'KAHET */ +UPDATE creature_template SET ScriptName='boss_jedoga' WHERE entry=29310; +UPDATE creature_template SET ScriptName='boss_nadox' WHERE entry=29309; +UPDATE creature_template SET ScriptName = 'mob_ahnkahar_egg' WHERE entry IN (30172,30173); +UPDATE creature_template SET ScriptName='boss_taldaram' WHERE entry=29308; +UPDATE gameobject_template SET ScriptName='go_nerubian_device' WHERE entry IN (193093,193094); +UPDATE creature_template SET ScriptName='boss_volazj' WHERE entry=29311; +UPDATE instance_template SET ScriptName='instance_ahnkahet' WHERE map=619; + +/* AZJOL-NERUB */ +UPDATE creature_template SET ScriptName='boss_anubarak' WHERE entry=29120; +UPDATE creature_template SET ScriptName='boss_hadronox' WHERE entry=28921; +UPDATE creature_template SET ScriptName='boss_krikthir' WHERE entry=28684; +UPDATE instance_template SET ScriptName='instance_azjol-nerub' WHERE map=601; + +/* AZSHARA */ +UPDATE creature_template SET ScriptName='npc_rizzle_sprysprocket' WHERE entry=23002; +UPDATE creature_template SET ScriptName='npc_depth_charge' WHERE entry=23025; +UPDATE gameobject_template SET ScriptName='go_southfury_moonstone' WHERE entry=185566; +UPDATE creature_template SET ScriptName='mobs_spitelashes' WHERE entry IN (6190,6193,6194,6195,6196,7885,7886,12204,12205); +UPDATE creature_template SET ScriptName='npc_loramus_thalipedes' WHERE entry=7783; + +/* AZUREMYST ISLE */ +UPDATE creature_template SET ScriptName='npc_draenei_survivor' WHERE entry=16483; +UPDATE creature_template SET ScriptName='npc_engineer_spark_overgrind' WHERE entry=17243; +UPDATE creature_template SET ScriptName='npc_injured_draenei' WHERE entry=16971; +UPDATE creature_template SET ScriptName='npc_magwin' WHERE entry=17312; +UPDATE creature_template SET ScriptName='npc_susurrus' WHERE entry=17435; + +/* BADLANDS */ + + +/* BARRENS */ +UPDATE creature_template SET ScriptName='npc_beaten_corpse' WHERE entry=10668; +UPDATE creature_template SET ScriptName='npc_gilthares' WHERE entry=3465; +UPDATE creature_template SET ScriptName='npc_sputtervalve' WHERE entry=3442; +UPDATE creature_template SET ScriptName='npc_taskmaster_fizzule' WHERE entry=7233; +UPDATE creature_template SET ScriptName='npc_twiggy_flathead' WHERE entry=6248; +DELETE FROM scripted_areatrigger WHERE entry=522; +INSERT INTO scripted_areatrigger VALUES (522,'at_twiggy_flathead'); +UPDATE creature_template SET ScriptName='npc_wizzlecranks_shredder' WHERE entry=3439; + +/* BLACK TEMPLE */ +UPDATE instance_template SET ScriptName='instance_black_temple' WHERE map=564; +UPDATE creature_template SET ScriptName='npc_akama_shade' WHERE entry=22990; -- Akama at Shade of Akama +UPDATE creature_template SET ScriptName='npc_akama_illidan' WHERE entry=23089; -- Akama at Illidan +UPDATE creature_template SET ScriptName='mob_illidari_council' WHERE entry=23426; -- Illidari Council controller mob +UPDATE creature_template SET ScriptName='mob_blood_elf_council_voice_trigger' WHERE entry=23499; -- Voice Trigger Mob (Controls Aggro + Enrage yells) +UPDATE creature_template SET ScriptName='boss_veras_darkshadow' WHERE entry=22952; -- Rogue of Illidari Council +UPDATE creature_template SET ScriptName='boss_teron_gorefiend' WHERE entry=22871; -- Teron Gorefiend +UPDATE creature_template SET ScriptName='boss_supremus' WHERE entry=22898; -- Supremus +UPDATE creature_template SET ScriptName='boss_shade_of_akama' WHERE entry=22841; -- Shade of Akama +UPDATE creature_template SET ScriptName='boss_reliquary_of_souls' WHERE entry=22856; -- Reliquary Controller Mob +UPDATE creature_template SET ScriptName='boss_essence_of_suffering' WHERE entry=23418; -- Essence Of Suffering +UPDATE creature_template SET ScriptName='boss_essence_of_desire' WHERE entry=23419; -- Essence of Desire +UPDATE creature_template SET ScriptName='boss_essence_of_anger' WHERE entry=23420; -- Essence of Anger +UPDATE creature_template SET ScriptName='boss_najentus' WHERE entry=22887; -- High Warlord Naj'entus +UPDATE creature_template SET ScriptName='boss_gurtogg_bloodboil' WHERE entry=22948; -- Gurtogg Bloodboil +UPDATE creature_template SET ScriptName='boss_mother_shahraz' WHERE entry=22947; -- Mother Shahraz +UPDATE creature_template SET ScriptName='boss_lady_malande' WHERE entry=22951; -- Priest <3 at Illidari Council +UPDATE creature_template SET ScriptName='boss_illidan_stormrage' WHERE entry=22917; -- Illidan The Betrayer! +UPDATE creature_template SET ScriptName='boss_high_nethermancer_zerevor' WHERE entry=22950; -- Mage at Illidari Council +UPDATE creature_template SET ScriptName='boss_gathios_the_shatterer' WHERE entry=22949; -- Paladin at Illidari Council +UPDATE creature_template SET ScriptName='boss_maiev_shadowsong' WHERE entry=23197; -- Maiev Shadowsong +UPDATE gameobject_template SET ScriptName='gameobject_cage_trap' WHERE entry=185916; -- Cage Trap GO in Illidan Encounter +UPDATE creature_template SET ScriptName='mob_blaze' WHERE entry=23259; -- Blaze mob in Illidan Phase 2 +UPDATE creature_template SET ScriptName='mob_flame_of_azzinoth' WHERE entry=22997; -- Flame of Azzinoth (Illidan Phase 2) +UPDATE creature_template SET ScriptName='mob_blade_of_azzinoth' WHERE entry=22996; -- Blade of Azzinoth (Illidan Phase 2) +UPDATE creature_template SET ScriptName='mob_demon_fire' WHERE entry=23069; -- Demon Fire in Illidan Phase 2 +UPDATE creature_template SET ScriptName='mob_flame_crash' WHERE entry=23336; -- Flame Crash in Illidan Normal Form +UPDATE creature_template SET ScriptName='mob_cage_trap_trigger' WHERE entry=23304; -- Cage Trap mob in Illidan Phase 3/4 Normal +UPDATE creature_template SET ScriptName='mob_shadow_demon' WHERE entry=23375; -- Shadow Demon in Illidan Demon Form +UPDATE creature_template SET ScriptName='npc_volcano' WHERE entry=23085; -- Supremus Volcano +UPDATE creature_template SET ScriptName='molten_flame' WHERE entry=23095; -- Molten Flame in SUpremus +UPDATE creature_template SET ScriptName='mob_ashtongue_channeler' WHERE entry=23421; -- Ashtongue CHanneler in Shade of AKama +UPDATE creature_template SET ScriptName='mob_ashtongue_sorcerer' WHERE entry=23215; -- Ashtongue Sorcerer in Shade of Akama +UPDATE creature_template SET ScriptName='npc_enslaved_soul' WHERE entry=23469; -- Enslaved Soul in Reliquary Event +UPDATE creature_template SET ScriptName='mob_doom_blossom' WHERE entry=23123; -- Doom Blossoms in Teron Gorefiend's encounter +UPDATE creature_template SET ScriptName='npc_spirit_of_olum' WHERE entry=23411; +-- UPDATE creature_template SET ScriptName='mob_shadowy_construct' WHERE entry=23111; -- Shadowy Construct in Teron Gorefiend's encounter. Commented until Mind Control is implemented. + +/* BLACKFATHOM DEPTHS */ +UPDATE instance_template SET ScriptName='instance_blackfathom_deeps' WHERE map=48; +UPDATE gameobject_template SET ScriptName='go_fire_of_akumai' WHERE entry IN (21118,21119,21120,21121); + +/* BLACKROCK DEPTHS */ +DELETE FROM scripted_areatrigger WHERE entry=1526; +INSERT INTO scripted_areatrigger VALUES (1526,'at_ring_of_law'); +UPDATE instance_template SET ScriptName='instance_blackrock_depths' WHERE map =230; +UPDATE creature_template SET ScriptName='boss_emperor_dagran_thaurissan' WHERE entry=9019; +UPDATE creature_template SET ScriptName='boss_moira_bronzebeard' WHERE entry=8929; +UPDATE creature_template SET ScriptName='boss_ambassador_flamelash' WHERE entry=9156; +UPDATE creature_template SET ScriptName='boss_anubshiah' WHERE entry=9031; +UPDATE creature_template SET ScriptName='boss_doomrel' WHERE entry=9039; +UPDATE creature_template SET ScriptName='boss_gloomrel' WHERE entry=9037; +UPDATE creature_template SET ScriptName='boss_general_angerforge' WHERE entry=9033; +UPDATE creature_template SET ScriptName='boss_gorosh_the_dervish' WHERE entry=9027; +UPDATE creature_template SET ScriptName='boss_grizzle' WHERE entry=9028; +UPDATE creature_template SET ScriptName='boss_high_interrogator_gerstahn' WHERE entry=9018; +UPDATE creature_template SET ScriptName='boss_magmus' WHERE entry=9938; +UPDATE creature_template SET ScriptName='mob_phalanx' WHERE entry=9502; +UPDATE creature_template SET ScriptName='npc_grimstone' WHERE entry=10096; +UPDATE creature_template SET ScriptName='npc_lokhtos_darkbargainer' WHERE entry=12944; +UPDATE creature_template SET ScriptName='npc_kharan_mighthammer' WHERE entry=9021; +UPDATE creature_template SET ScriptName='npc_rocknot' WHERE entry=9503; +UPDATE gameobject_template SET ScriptName='go_shadowforge_brazier' WHERE entry IN (174744, 174745); + +/* BLACKROCK SPIRE */ +UPDATE instance_template SET ScriptName='instance_blackrock_spire' WHERE map=229; +/* BLACKROCK SPIRE Lower bosses */ +UPDATE creature_template SET ScriptName='boss_highlord_omokk' WHERE entry=9196; +UPDATE creature_template SET ScriptName='boss_shadow_hunter_voshgajin' WHERE entry=9236; +UPDATE creature_template SET ScriptName='boss_warmaster_voone' WHERE entry=9237; +UPDATE creature_template SET ScriptName='boss_mother_smolderweb' WHERE entry=10596; +UPDATE creature_template SET ScriptName='quartermaster_zigris' WHERE entry=9736; +UPDATE creature_template SET ScriptName='boss_halycon' WHERE entry=10220; +UPDATE creature_template SET ScriptName='boss_overlord_wyrmthalak' WHERE entry=9568; +/* BLACKROCK SPIRE Upper bosses */ +UPDATE creature_template SET ScriptName='boss_the_beast' WHERE entry=10430; +UPDATE creature_template SET ScriptName='boss_drakkisath' WHERE entry=10363; +UPDATE creature_template SET ScriptName='boss_gyth' WHERE entry=10339; +UPDATE creature_template SET ScriptName='boss_rend_blackhand' WHERE entry=10429; +UPDATE creature_template SET ScriptName='boss_pyroguard_emberseer' WHERE entry=9816; + +/* BLACKWING LAIR */ +-- UPDATE instance_template SET ScriptName='instance_blackwing_lair' WHERE map=469; +UPDATE creature_template SET ScriptName='boss_razorgore' WHERE entry=12435; +UPDATE creature_template SET ScriptName='boss_vaelastrasz' WHERE entry=13020; +UPDATE creature_template SET ScriptName='boss_broodlord' WHERE entry=12017; +UPDATE creature_template SET ScriptName='boss_firemaw' WHERE entry=11983; +UPDATE creature_template SET ScriptName='boss_ebonroc' WHERE entry=14601; +UPDATE creature_template SET ScriptName='boss_flamegor' WHERE entry=11981; +UPDATE creature_template SET ScriptName='boss_chromaggus' WHERE entry=14020; +UPDATE creature_template SET ScriptName='boss_victor_nefarius' WHERE entry=10162; +UPDATE creature_template SET ScriptName='boss_nefarian' WHERE entry=11583; + +/* BLADE'S EDGE MOUNTAINS */ +UPDATE creature_template SET ScriptName='mobs_bladespire_ogre' WHERE entry IN (19998,20334,21296,21975); +UPDATE creature_template SET ScriptName='mobs_nether_drake' WHERE entry IN (20021,21817,21820,21821,21823); +UPDATE creature_template SET ScriptName='npc_daranelle' WHERE entry=21469; +UPDATE creature_template SET ScriptName='npc_overseer_nuaar' WHERE entry=21981; +UPDATE creature_template SET ScriptName='npc_saikkal_the_elder' WHERE entry=22932; +UPDATE creature_template SET ScriptName='npc_skyguard_handler_deesak' WHERE entry=23415; + +/* BLASTED LANDS */ +UPDATE creature_template SET ScriptName='npc_deathly_usher' WHERE entry=8816; +UPDATE creature_template SET ScriptName='npc_fallen_hero_of_horde' WHERE entry=7572; + +/* BLOODMYST ISLE */ +UPDATE creature_template SET ScriptName='mob_webbed_creature' WHERE entry=17680; +UPDATE creature_template SET ScriptName='npc_captured_sunhawk_agent' WHERE entry=17824; + +/* BOREAN TUNDRA */ +UPDATE creature_template SET ScriptName='npc_fizzcrank_fullthrottle' WHERE entry=25590; +UPDATE creature_template SET ScriptName='npc_iruk' WHERE entry=26219; +UPDATE creature_template SET ScriptName='npc_kara_thricestar' WHERE entry=26602; +UPDATE creature_template SET ScriptName='npc_nesingwary_trapper' WHERE entry=25835; +UPDATE gameobject_template SET ScriptName='go_caribou_trap' WHERE entry IN (187982,187995,187996,187997,187998,187999,188000,188001,188002,188003,188004,188005,188006,188007,188008); +UPDATE creature_template SET ScriptName='npc_surristrasz' WHERE entry=24795; +UPDATE creature_template SET ScriptName='npc_tiare' WHERE entry=30051; +UPDATE creature_template SET ScriptName='npc_lurgglbr' WHERE entry=25208; + +/* BURNING STEPPES */ +UPDATE creature_template SET ScriptName='npc_ragged_john' WHERE entry=9563; + +/* */ +/* CAVERNS OF TIME */ +/* */ + +/* MT. HYJAL */ +UPDATE instance_template SET ScriptName='instance_hyjal' WHERE map=534; +UPDATE creature_template SET ScriptName='npc_tyrande_whisperwind' WHERE entry=17948; +UPDATE creature_template SET ScriptName='npc_thrall' WHERE entry=17852; +UPDATE creature_template SET ScriptName='npc_jaina_proudmoore' WHERE entry=17772; +UPDATE creature_template SET ScriptName='boss_archimonde' WHERE entry=17968; +UPDATE creature_template SET ScriptName='mob_doomfire' WHERE entry=18095; +UPDATE creature_template SET ScriptName='mob_doomfire_targetting' WHERE entry=18104; +UPDATE creature_template SET ScriptName='mob_ancient_wisp' WHERE entry=17946; + +/* OLD HILLSBRAD */ +UPDATE instance_template SET ScriptName='instance_old_hillsbrad' WHERE map=560; +UPDATE creature_template SET ScriptName='boss_lieutenant_drake' WHERE entry=17848; +UPDATE creature_template SET ScriptName='boss_epoch_hunter' WHERE entry=18096; +UPDATE creature_template SET ScriptName='boss_captain_skarloc' WHERE entry=17862; +UPDATE gameobject_template SET ScriptName='go_barrel_old_hillsbrad' WHERE entry=182589; +UPDATE creature_template SET ScriptName='npc_brazen' WHERE entry=18725; +UPDATE creature_template SET ScriptName='npc_erozion' WHERE entry=18723; +UPDATE creature_template SET ScriptName='npc_taretha' WHERE entry=18887; +UPDATE creature_template SET ScriptName='npc_thrall_old_hillsbrad' WHERE entry=17876; + +/* THE CULLING OF STRATHOLME */ +UPDATE instance_template SET ScriptName='instance_culling_of_stratholme' WHERE map=595; +UPDATE creature_template SET ScriptName='npc_chromie' WHERE entry IN (26527, 27915); +UPDATE creature_template SET ScriptName='spell_dummy_npc_crates_bunny' WHERE entry=30996; + +/* THE DARK PORTAL */ +UPDATE creature_template SET ScriptName='boss_chrono_lord_deja' WHERE entry=17879; +UPDATE creature_template SET ScriptName='boss_aeonus' WHERE entry=17881; +UPDATE creature_template SET ScriptName='boss_temporus' WHERE entry=17880; +UPDATE instance_template SET ScriptName='instance_dark_portal' WHERE map=269; +UPDATE creature_template SET ScriptName='npc_medivh_bm' WHERE entry=15608; +UPDATE creature_template SET ScriptName='npc_time_rift' WHERE entry=17838; +UPDATE creature_template SET ScriptName='npc_saat' WHERE entry=20201; + +/* */ +/* COILFANG RESERVOIR */ +/* */ + +/* THE SLAVE PENS */ + +/* THE UNDERBOG */ +UPDATE creature_template SET ScriptName='mob_underbog_mushroom' WHERE entry=17990; +UPDATE creature_template SET ScriptName='boss_hungarfen' WHERE entry=17770; + +/* THE STEAMVAULT */ +UPDATE instance_template SET ScriptName='instance_steam_vault' WHERE map=545; +UPDATE creature_template SET ScriptName='boss_hydromancer_thespia' WHERE entry=17797; +UPDATE creature_template SET ScriptName='boss_mekgineer_steamrigger' WHERE entry=17796; +UPDATE creature_template SET ScriptName='boss_warlord_kalithresh' WHERE entry=17798; +UPDATE gameobject_template SET ScriptName='go_main_chambers_access_panel' WHERE entry IN (184125,184126); +UPDATE creature_template SET ScriptName='mob_coilfang_waterelemental' WHERE entry=17917; +UPDATE creature_template SET ScriptName='mob_naga_distiller' WHERE entry=17954; +UPDATE creature_template SET ScriptName='mob_steamrigger_mechanic' WHERE entry=17951; + +/* SERPENTSHRINE CAVERN */ +UPDATE instance_template SET ScriptName='instance_serpent_shrine' WHERE map=548; +UPDATE creature_template SET ScriptName='boss_hydross_the_unstable' WHERE entry=21216; +/* Leotheras the Blind event */ +UPDATE creature_template SET ScriptName='boss_leotheras_the_blind' WHERE entry=21215; +UPDATE creature_template SET ScriptName='boss_leotheras_the_blind_demonform' WHERE entry=21875; +/* Fathom-lord Karathress event */ +UPDATE creature_template SET ScriptName='boss_fathomlord_karathress' WHERE entry=21214; +UPDATE creature_template SET ScriptName='boss_fathomguard_sharkkis' WHERE entry=21966; +UPDATE creature_template SET ScriptName='boss_fathomguard_tidalvess' WHERE entry=21965; +UPDATE creature_template SET ScriptName='boss_fathomguard_caribdis' WHERE entry=21964; +/* Morogrim Tidewalker event */ +UPDATE creature_template SET ScriptName='boss_morogrim_tidewalker' WHERE entry=21213; +UPDATE creature_template SET ScriptName='mob_water_globule' WHERE entry=21913; +/* Lady Vashj event */ +UPDATE creature_template SET ScriptName='boss_lady_vashj' WHERE entry=21212; +UPDATE creature_template SET ScriptName='mob_enchanted_elemental' WHERE entry=21958; +UPDATE creature_template SET ScriptName='mob_tainted_elemental' WHERE entry=22009; +UPDATE creature_template SET ScriptName='mob_toxic_sporebat' WHERE entry=22140; +UPDATE creature_template SET ScriptName='mob_shield_generator_channel' WHERE entry=19870; + + +/* CRYSTALSONG FOREST */ + +/* */ +/* CRUSADER COLISEUM */ +/* */ + +/* TRAIL OF THE CHAMPION */ + +/* TRIAL OF THE CRUSADER */ +UPDATE instance_template SET ScriptName='instance_trial_of_the_crusader' WHERE map=649; +UPDATE creature_template SET ScriptName='boss_gormok' WHERE entry=34796; +UPDATE creature_template SET ScriptName='boss_acidmaw' WHERE entry=35144; +UPDATE creature_template SET ScriptName='boss_dreadscale' WHERE entry=34799; +UPDATE creature_template SET ScriptName='boss_icehowl' WHERE entry=34797; +UPDATE creature_template SET ScriptName='boss_jaraxxus' WHERE entry=34780; +UPDATE creature_template SET ScriptName='boss_anubarak_trial' WHERE entry=34564; +UPDATE creature_template SET ScriptName='boss_fjola' WHERE entry=34497; +UPDATE creature_template SET ScriptName='boss_eydis' WHERE entry=34496; + +/* DALARAN */ +UPDATE creature_template SET ScriptName='npc_dalaran_guardian_mage' WHERE entry IN (29255, 29254); +UPDATE creature_template SET ScriptName='npc_zidormi' WHERE entry=31848; + +/* DARKSHORE */ +UPDATE creature_template SET ScriptName='npc_kerlonian' WHERE entry=11218; +UPDATE creature_template SET ScriptName='npc_prospector_remtravel' WHERE entry=2917; +UPDATE creature_template SET ScriptName='npc_threshwackonator' WHERE entry=6669; + +/* DARNASSUS */ + + +/* DEADMINES */ +UPDATE instance_template SET ScriptName='instance_deadmines' WHERE map=36; +UPDATE gameobject_template SET ScriptName='go_defias_cannon' WHERE entry=16398; +UPDATE gameobject_template SET ScriptName='go_door_lever_dm' WHERE entry=101833; + +/* DEADWIND PASS */ + + +/* DESOLACE */ +UPDATE creature_template SET ScriptName='npc_aged_dying_ancient_kodo' WHERE entry IN (4700, 4701, 4702, 11627); + +/* DIRE MAUL */ + + +/* DRAGONBLIGHT */ +UPDATE creature_template SET ScriptName='npc_afrasastrasz' WHERE entry=27575; +UPDATE creature_template SET ScriptName='npc_alexstrasza_wr_gate' WHERE entry=31333; +UPDATE creature_template SET ScriptName='npc_tariolstrasz' WHERE entry=26443; +UPDATE creature_template SET ScriptName='npc_torastrasza' WHERE entry=26949; + +/* DRAK'THARON KEEP */ +UPDATE creature_template SET ScriptName='boss_novos' WHERE entry=26631; +UPDATE creature_template SET ScriptName='boss_tharonja' WHERE entry=26632; +UPDATE creature_template SET ScriptName='boss_trollgore' WHERE entry=26630; + +/* DUN MOROGH */ +UPDATE creature_template SET ScriptName='npc_narm_faulk' WHERE entry=6177; + + +/* DUROTAR */ + + +/* DUSKWOOD */ + + +/* DUSTWALLOW MARSH */ +UPDATE creature_template SET ScriptName='mobs_risen_husk_spirit' WHERE entry IN (23554,23555); +UPDATE creature_template SET ScriptName='npc_deserter_agitator' WHERE entry=23602; +UPDATE creature_template SET ScriptName='npc_lady_jaina_proudmoore' WHERE entry=4968; +UPDATE creature_template SET ScriptName='npc_ogron' WHERE entry=4983; +UPDATE creature_template SET ScriptName='npc_morokk' WHERE entry=4500; +UPDATE creature_template SET ScriptName='npc_nat_pagle' WHERE entry=12919; +UPDATE creature_template SET ScriptName='npc_cassa_crimsonwing' WHERE entry=23704; +UPDATE creature_template SET ScriptName='npc_restless_apparition' WHERE entry=23861; +UPDATE creature_template SET ScriptName='npc_private_hendel' WHERE entry=4966; +DELETE FROM scripted_areatrigger WHERE entry=4752; +INSERT INTO scripted_areatrigger VALUES +(4752,'at_nats_landing'); + +/* EASTERN PLAGUELANDS */ +UPDATE creature_template SET ScriptName='mobs_ghoul_flayer' WHERE entry IN (8530,8531,8532); +UPDATE creature_template SET ScriptName='npc_augustus_the_touched' WHERE entry=12384; +UPDATE creature_template SET ScriptName='npc_darrowshire_spirit' WHERE entry=11064; +UPDATE creature_template SET ScriptName='npc_tirion_fordring' WHERE entry=1855; + +/* EBON HOLD */ +UPDATE creature_template SET ScriptName='npc_death_knight_initiate' WHERE entry=28406; +UPDATE creature_template SET ScriptName='npc_unworthy_initiate_anchor' WHERE entry=29521; +UPDATE creature_template SET ScriptName='npc_unworthy_initiate' WHERE entry IN (29519,29520,29565,29566,29567); +UPDATE gameobject_template SET ScriptName='go_acherus_soul_prison' WHERE entry IN (191577,191580,191581,191582,191583,191584,191585,191586,191587,191588,191589,191590); +UPDATE creature_template SET ScriptName='npc_a_special_surprise' WHERE entry IN (29032,29061,29065,29067,29068,29070,29074,29072,29073,29071); +UPDATE creature_template SET ScriptName='npc_koltira_deathweaver' WHERE entry=28912; + +/* ELWYNN FOREST */ +UPDATE creature_template SET ScriptName='npc_henze_faulk' WHERE entry=6172; + +/* EVERSONG WOODS */ +UPDATE creature_template SET ScriptName='npc_kelerun_bloodmourn' WHERE entry=17807; +UPDATE gameobject_template SET ScriptName='go_harbinger_second_trial' WHERE entry=182052; +UPDATE creature_template SET ScriptName='npc_prospector_anvilward' WHERE entry=15420; +UPDATE creature_template SET ScriptName='npc_apprentice_mirveda' WHERE entry=15402; + +/* FELWOOD */ +DELETE FROM scripted_event_id WHERE id=8328; +INSERT INTO scripted_event_id VALUES +(8328, 'npc_kroshius'); +UPDATE creature_template SET ScriptName='npc_kitten' WHERE entry=9937; +UPDATE creature_template SET ScriptName='npc_corrupt_saber' WHERE entry=10042; +UPDATE creature_template SET ScriptName='npcs_riverbreeze_and_silversky' WHERE entry IN (9528,9529); +UPDATE creature_template SET ScriptName='npc_niby_the_almighty' WHERE entry=14469; +UPDATE creature_template SET ScriptName='npc_kroshius' WHERE entry=14467; + +/* FERALAS */ +UPDATE creature_template SET ScriptName='npc_gregan_brewspewer' WHERE entry=7775; +UPDATE creature_template SET ScriptName='npc_oox22fe' WHERE entry=7807; +UPDATE creature_template SET ScriptName='npc_screecher_spirit' WHERE entry=8612; + +/* GHOSTLANDS */ +UPDATE creature_template SET ScriptName='npc_blood_knight_dawnstar' WHERE entry=17832; +UPDATE creature_template SET ScriptName='npc_budd_nedreck' WHERE entry=23559; +UPDATE creature_template SET ScriptName='npc_ranger_lilatha' WHERE entry=16295; +UPDATE creature_template SET ScriptName='npc_rathis_tomber' WHERE entry=16224; + +/* GNOMEREGAN */ +UPDATE creature_template SET ScriptName='boss_thermaplugg' WHERE entry=7800; +UPDATE gameobject_template SET ScriptName='go_gnomeface_button' WHERE entry BETWEEN 142214 AND 142219; +-- UPDATE creature_template SET ScriptName='npc_blastmaster_emi_shortfuse' WHERE entry=7998; +UPDATE instance_template SET ScriptName='instance_gnomeregan' WHERE map=90; + +/* GRIZZLY HILLS */ + + +/* GRUUL'S LAIR */ +UPDATE instance_template SET ScriptName='instance_gruuls_lair' WHERE map =565; +UPDATE creature_template SET ScriptName='boss_gruul' WHERE entry=19044; +/* Maulgar and Event */ +UPDATE creature_template SET ScriptName='boss_high_king_maulgar' WHERE entry=18831; +UPDATE creature_template SET ScriptName='boss_kiggler_the_crazed' WHERE entry=18835; +UPDATE creature_template SET ScriptName='boss_blindeye_the_seer' WHERE entry=18836; +UPDATE creature_template SET ScriptName='boss_olm_the_summoner' WHERE entry=18834; +UPDATE creature_template SET ScriptName='boss_krosh_firehand' WHERE entry=18832; + +/* GUNDRAK */ +UPDATE creature_template SET ScriptName='boss_colossus' WHERE entry=29307; +UPDATE creature_template SET ScriptName='boss_galdarah' WHERE entry=29306; +UPDATE creature_template SET ScriptName='boss_moorabi' WHERE entry=29305; +UPDATE creature_template SET ScriptName='boss_sladran' WHERE entry=29304; +UPDATE creature_template SET ScriptName='mob_sladran_summon_target' WHERE entry=29682; +UPDATE gameobject_template SET ScriptName='go_gundrak_altar' WHERE entry IN (192518, 192519, 192520); +UPDATE instance_template SET ScriptName='instance_gundrak' WHERE map=604; + +/* */ +/* HELLFIRE CITADEL */ +/* */ + +/* BLOOD FURNACE */ +/* The Maker,Broggok,Kelidan,Broggok's cloud */ +UPDATE creature_template SET ScriptName='boss_the_maker' WHERE entry=17381; +UPDATE creature_template SET ScriptName='boss_broggok' WHERE entry=17380; +UPDATE creature_template SET ScriptName='boss_kelidan_the_breaker' WHERE entry=17377; +UPDATE creature_template SET ScriptName='mob_broggok_poisoncloud' WHERE entry=17662; +UPDATE creature_template SET ScriptName='mob_shadowmoon_channeler' WHERE entry=17653; +UPDATE instance_template SET ScriptName='instance_blood_furnace' WHERE map=542; + +/* HELLFIRE RAMPARTS */ +/* Vazruden,Omor the Unscarred,Watchkeeper Gargolmar */ +UPDATE creature_template SET ScriptName='boss_omor_the_unscarred' WHERE entry=17308; +UPDATE creature_template SET ScriptName='boss_watchkeeper_gargolmar' WHERE entry=17306; +UPDATE creature_template SET ScriptName='boss_vazruden_herald' WHERE entry=17307; +UPDATE creature_template SET ScriptName='boss_vazruden' WHERE entry=17537; +UPDATE instance_template SET ScriptName='instance_ramparts' WHERE map=543; + +/* SHATTERED HALLS */ +/* Nethekurse and his spawned shadowfissure */ +UPDATE creature_template SET ScriptName='boss_grand_warlock_nethekurse' WHERE entry=16807; +UPDATE creature_template SET ScriptName='boss_warbringer_omrogg' WHERE entry=16809; +UPDATE creature_template SET ScriptName='mob_fel_orc_convert' WHERE entry=17083; +UPDATE creature_template SET ScriptName='mob_lesser_shadow_fissure' WHERE entry=17471; +UPDATE creature_template SET ScriptName='mob_omrogg_heads' WHERE entry IN (19523,19524); +UPDATE creature_template SET ScriptName='boss_warchief_kargath_bladefist' WHERE entry=16808; +UPDATE instance_template SET ScriptName='instance_shattered_halls' WHERE map=540; + +/* MAGTHERIDON'S LAIR */ +UPDATE instance_template SET ScriptName='instance_magtheridons_lair' WHERE map=544; +UPDATE gameobject_template SET ScriptName='go_manticron_cube' WHERE entry=181713; +UPDATE creature_template SET ScriptName='boss_magtheridon' WHERE entry=17257; +UPDATE creature_template SET ScriptName='mob_abyssal' WHERE entry=17454; +UPDATE creature_template SET ScriptName='mob_hellfire_channeler' WHERE entry=17256; + +/* HELLFIRE PENINSULA */ +UPDATE creature_template SET ScriptName='boss_doomlord_kazzak' WHERE entry=18728; +UPDATE creature_template SET ScriptName='npc_aeranas' WHERE entry=17085; +UPDATE gameobject_template SET ScriptName='go_haaleshi_altar' WHERE entry=181606; +UPDATE creature_template SET ScriptName='npc_ancestral_wolf' WHERE entry=17077; +UPDATE creature_template SET ScriptName='npc_demoniac_scryer' WHERE entry=22258; +UPDATE creature_template SET ScriptName='npc_gryphoneer_windbellow' WHERE entry=20235; +UPDATE creature_template SET ScriptName='npc_naladu' WHERE entry=19361; +UPDATE creature_template SET ScriptName='npc_tracy_proudwell' WHERE entry=18266; +UPDATE creature_template SET ScriptName='npc_trollbane' WHERE entry=16819; +UPDATE creature_template SET ScriptName='npc_wing_commander_brack' WHERE entry=19401; +UPDATE creature_template SET ScriptName='npc_wing_commander_dabiree' WHERE entry=19409; +UPDATE creature_template SET ScriptName='npc_wounded_blood_elf' WHERE entry=16993; + +/* HILLSBRAD FOOTHILLS */ + + +/* HINTERLANDS */ +UPDATE creature_template SET ScriptName='npc_00x09hl' WHERE entry=7806; +UPDATE creature_template SET ScriptName='npc_rinji' WHERE entry=7780; + +/* HOWLING FJORD */ +UPDATE creature_template SET ScriptName='npc_deathstalker_razael' WHERE entry=23998; +UPDATE creature_template SET ScriptName='npc_dark_ranger_lyana' WHERE entry=23778; +UPDATE creature_template SET ScriptName='npc_mcgoyver' WHERE entry=24040; + +/* */ +/* ICECROWN CITADEL */ +/* */ + +/* FORGE OF SOULS */ +UPDATE creature_template SET ScriptName='boss_bronjahm' WHERE entry=36497; +UPDATE creature_template SET ScriptName='boss_devourer_of_souls' WHERE entry=36502; +UPDATE instance_template SET ScriptName='instance_forge_of_souls' WHERE map=632; + +/* ICECROWN */ +UPDATE creature_template SET ScriptName='npc_arete' WHERE entry=29344; +UPDATE creature_template SET ScriptName='npc_dame_evniki_kapsalis' WHERE entry=34885; + +/* IRONFORGE */ +UPDATE creature_template SET ScriptName='npc_royal_historian_archesonus' WHERE entry=8879; + +/* ISLE OF QUEL'DANAS */ +UPDATE creature_template SET ScriptName='npc_converted_sentry' WHERE entry=24981; + +/* KARAZHAN */ +UPDATE instance_template SET ScriptName='instance_karazhan' WHERE map=532; +UPDATE creature_template SET ScriptName='boss_midnight' WHERE entry=16151; +UPDATE creature_template SET ScriptName='boss_attumen' WHERE entry=15550; +UPDATE creature_template SET ScriptName='boss_moroes' WHERE entry=15687; +UPDATE creature_template SET ScriptName='boss_maiden_of_virtue' WHERE entry=16457; +UPDATE creature_template SET ScriptName='boss_curator' WHERE entry=15691; +UPDATE creature_template SET ScriptName='boss_julianne' WHERE entry=17534; +UPDATE creature_template SET ScriptName='boss_romulo' WHERE entry=17533; +UPDATE creature_template SET ScriptName='boss_dorothee' WHERE entry=17535; +UPDATE creature_template SET ScriptName='boss_strawman' WHERE entry=17543; +UPDATE creature_template SET ScriptName='boss_tinhead' WHERE entry=17547; +UPDATE creature_template SET ScriptName='mob_tito' WHERE entry=17548; +UPDATE creature_template SET ScriptName='boss_roar' WHERE entry=17546; +UPDATE creature_template SET ScriptName='boss_crone' WHERE entry=18168; +UPDATE creature_template SET ScriptName='boss_terestian_illhoof' WHERE entry=15688; +UPDATE creature_template SET ScriptName='boss_shade_of_aran' WHERE entry=16524; +UPDATE creature_template SET ScriptName='boss_netherspite' WHERE entry=15689; +UPDATE creature_template SET ScriptName='boss_malchezaar' WHERE entry=15690; +-- UPDATE creature_template SET ScriptName='boss_nightbane' WHERE entry=17225; +UPDATE creature_template SET ScriptName='boss_baroness_dorothea_millstipe' WHERE entry=19875; +UPDATE creature_template SET ScriptName='boss_baron_rafe_dreuger' WHERE entry=19874; +UPDATE creature_template SET ScriptName='boss_lady_catriona_von_indi' WHERE entry=19872; +UPDATE creature_template SET ScriptName='boss_lady_keira_berrybuck' WHERE entry=17007; +UPDATE creature_template SET ScriptName='boss_lord_robin_daris' WHERE entry=19876; +UPDATE creature_template SET ScriptName='boss_lord_crispin_ference' WHERE entry=19873; +UPDATE creature_template SET ScriptName='boss_bigbadwolf' WHERE entry=17521; +UPDATE creature_template SET ScriptName='mob_aran_elemental' WHERE entry=17167; +UPDATE creature_template SET ScriptName='mob_demon_chain' WHERE entry=17248; +UPDATE creature_template SET ScriptName='npc_fiendish_portal' WHERE entry=17265; +UPDATE creature_template SET ScriptName='mob_cyclone' WHERE entry=18412; +UPDATE creature_template SET ScriptName='netherspite_infernal' WHERE entry=17646; +UPDATE creature_template SET ScriptName='npc_berthold' WHERE entry=16153; +UPDATE creature_template SET ScriptName='npc_barnes' WHERE entry=16812; +UPDATE creature_template SET ScriptName='npc_grandmother' WHERE entry=17603; + +/* LOCH MODAN */ +UPDATE creature_template SET ScriptName='npc_mountaineer_pebblebitty' WHERE entry=3836; +UPDATE creature_template SET ScriptName='npc_miran' WHERE entry=1379; + +/* MAGISTER'S TERRACE */ +UPDATE instance_template SET ScriptName='instance_magisters_terrace' WHERE map=585; +UPDATE creature_template SET ScriptName='boss_selin_fireheart' WHERE entry=24723; +UPDATE creature_template SET ScriptName='mob_fel_crystal' WHERE entry=24722; +UPDATE creature_template SET ScriptName='boss_vexallus' WHERE entry=24744; +UPDATE creature_template SET ScriptName='mob_pure_energy' WHERE entry=24745; +UPDATE creature_template SET ScriptName='boss_priestess_delrissa' WHERE entry=24560; +UPDATE creature_template SET ScriptName='boss_kagani_nightstrike' WHERE entry=24557; +UPDATE creature_template SET ScriptName='boss_ellris_duskhallow' WHERE entry=24558; +UPDATE creature_template SET ScriptName='boss_eramas_brightblaze' WHERE entry=24554; +UPDATE creature_template SET ScriptName='boss_yazzai' WHERE entry=24561; +UPDATE creature_template SET ScriptName='boss_warlord_salaris' WHERE entry=24559; +UPDATE creature_template SET ScriptName='boss_garaxxas' WHERE entry=24555; +-- UPDATE creature_template SET ScriptName='mob_sliver' WHERE entry=24552; +UPDATE creature_template SET ScriptName='boss_apoko' WHERE entry=24553; +UPDATE creature_template SET ScriptName='boss_zelfan' WHERE entry=24556; +UPDATE creature_template SET ScriptName='boss_felblood_kaelthas' WHERE entry=24664; +UPDATE creature_template SET ScriptName='mob_arcane_sphere' WHERE entry=24708; +UPDATE creature_template SET ScriptName='mob_felkael_phoenix' WHERE entry=24674; +UPDATE creature_template SET ScriptName='mob_felkael_phoenix_egg' WHERE entry=24675; +UPDATE creature_template SET ScriptName='npc_kalecgos' WHERE entry IN (24844, 24848); + +/* MARAUDON */ +UPDATE creature_template SET ScriptName='boss_princess_theradras' WHERE entry=12201; +UPDATE creature_template SET ScriptName='boss_noxxion' WHERE entry=13282; +UPDATE creature_template SET ScriptName='boss_landslide' WHERE entry=12203; +UPDATE creature_template SET ScriptName='celebras_the_cursed' WHERE entry=12225; + +/* MOLTEN CORE */ +UPDATE instance_template SET ScriptName='instance_molten_core' WHERE map=409; +UPDATE creature_template SET ScriptName='boss_lucifron' WHERE entry=12118; +UPDATE creature_template SET ScriptName='boss_magmadar' WHERE entry=11982; +UPDATE creature_template SET ScriptName='boss_gehennas' WHERE entry=12259; +UPDATE creature_template SET ScriptName='boss_garr' WHERE entry=12057; +UPDATE creature_template SET ScriptName='boss_baron_geddon' WHERE entry=12056; +UPDATE creature_template SET ScriptName='boss_shazzrah' WHERE entry=12264; +UPDATE creature_template SET ScriptName='boss_golemagg' WHERE entry=11988; +UPDATE creature_template SET ScriptName='boss_sulfuron' WHERE entry=12098; +UPDATE creature_template SET ScriptName='boss_majordomo' WHERE entry=12018; +UPDATE creature_template SET ScriptName='boss_ragnaros' WHERE entry=11502; +UPDATE creature_template SET ScriptName='mob_firesworn' WHERE entry=12099; +UPDATE creature_template SET ScriptName='mob_core_rager' WHERE entry=11672; +UPDATE creature_template SET ScriptName='mob_flamewaker_priest' WHERE entry=11662; + +/* MOONGLADE */ +UPDATE creature_template SET ScriptName='npc_bunthen_plainswind' WHERE entry=11798; +UPDATE creature_template SET ScriptName='npc_clintar_dw_spirit' WHERE entry=22916; +UPDATE creature_template SET ScriptName='npc_great_bear_spirit' WHERE entry=11956; +UPDATE creature_template SET ScriptName='npc_silva_filnaveth' WHERE entry=11800; + +/* MULGORE */ +UPDATE creature_template SET ScriptName='npc_kyle_the_frenzied' WHERE entry=23616; +UPDATE creature_template SET ScriptName='npc_skorn_whitecloud' WHERE entry=3052; + +/* NAGRAND */ +UPDATE creature_template SET ScriptName='mob_lump' WHERE entry=18351; +UPDATE creature_template SET ScriptName='mob_shattered_rumbler' WHERE entry=17157; +UPDATE creature_template SET ScriptName='mob_sunspring_villager' WHERE entry=18240; +UPDATE creature_template SET ScriptName='npc_altruis_the_sufferer' WHERE entry=18417; +UPDATE creature_template SET ScriptName='npc_greatmother_geyah' WHERE entry=18141; +UPDATE creature_template SET ScriptName='npc_lantresor_of_the_blade' WHERE entry=18261; +UPDATE creature_template SET ScriptName='npc_maghar_captive' WHERE entry=18210; +UPDATE creature_template SET ScriptName='npc_creditmarker_visit_with_ancestors' WHERE entry IN (18840,18841,18842,18843); + +/* NAXXRAMAS */ +UPDATE instance_template SET ScriptName='instance_naxxramas' WHERE map=533; +UPDATE creature_template SET ScriptName='boss_anubrekhan' WHERE entry=15956; +UPDATE creature_template SET ScriptName='boss_faerlina' WHERE entry=15953; +UPDATE creature_template SET ScriptName='boss_maexxna' WHERE entry=15952; +UPDATE creature_template SET ScriptName='npc_web_wrap' WHERE entry=16486; +UPDATE creature_template SET ScriptName='boss_noth' WHERE entry=15954; +UPDATE creature_template SET ScriptName='boss_heigan' WHERE entry=15936; +UPDATE creature_template SET ScriptName='boss_loatheb' WHERE entry=16011; +UPDATE creature_template SET ScriptName='boss_razuvious' WHERE entry=16061; +UPDATE creature_template SET ScriptName='boss_gothik' WHERE entry=16060; +UPDATE creature_template SET ScriptName='spell_anchor' WHERE entry=16137; +UPDATE creature_template SET ScriptName='boss_thane_korthazz' WHERE entry=16064; +UPDATE creature_template SET ScriptName='boss_sir_zeliek' WHERE entry=16063; +UPDATE creature_template SET ScriptName='boss_lady_blaumeux' WHERE entry=16065; +UPDATE creature_template SET ScriptName='boss_rivendare_naxx' WHERE entry=30549; +UPDATE creature_template SET ScriptName='boss_patchwerk' WHERE entry=16028; +-- UPDATE creature_template SET ScriptName='boss_grobbulus' WHERE entry=15931; +UPDATE creature_template SET ScriptName='boss_gluth' WHERE entry=15932; +-- UPDATE creature_template SET ScriptName='boss_thaddius' WHERE entry=15928; +-- UPDATE creature_template SET ScriptName='boss_stalagg' WHERE entry=15929; +-- UPDATE creature_template SET ScriptName='boss_feugen' WHERE entry=15930; +UPDATE creature_template SET ScriptName='boss_sapphiron' WHERE entry=15989; +UPDATE creature_template SET ScriptName='boss_kelthuzad' WHERE entry=15990; + +/* NETHERSTORM */ +DELETE FROM scripted_areatrigger WHERE entry=4497; +INSERT INTO scripted_areatrigger VALUES (4497,'at_commander_dawnforge'); +UPDATE gameobject_template SET ScriptName='go_manaforge_control_console' WHERE entry IN (183770,183956,184311,184312); +UPDATE creature_template SET ScriptName='npc_manaforge_control_console' WHERE entry IN (20209,20417,20418,20440); +UPDATE creature_template SET ScriptName='npc_commander_dawnforge' WHERE entry=19831; +UPDATE creature_template SET ScriptName='npc_protectorate_nether_drake' WHERE entry=20903; +UPDATE creature_template SET ScriptName='npc_veronia' WHERE entry=20162; +UPDATE creature_template SET ScriptName='npc_bessy' WHERE entry=20415; + +/* */ +/* THE NEXUS */ +/* */ + +/* EYE OF ETERNITY */ + +/* NEXUS */ +UPDATE creature_template SET ScriptName='boss_anomalus' WHERE entry=26763; +UPDATE creature_template SET ScriptName='mob_chaotic_rift' WHERE entry=26918; +UPDATE creature_template SET ScriptName='boss_keristrasza' WHERE entry=26723; +UPDATE creature_template SET ScriptName='boss_ormorok' WHERE entry=26794; +UPDATE creature_template SET ScriptName='boss_telestra' WHERE entry=26731; +UPDATE gameobject_template SET ScriptName='go_containment_sphere' WHERE entry IN (188526, 188527, 188528); +UPDATE instance_template SET ScriptName='instance_nexus' WHERE map=576; + +/* OCULUS */ + + +/* OBSIDIAN SANCTUM */ +UPDATE instance_template SET ScriptName='instance_obsidian_sanctum' WHERE map=615; +UPDATE creature_template SET ScriptName='boss_sartharion' WHERE entry=28860; +UPDATE creature_template SET ScriptName='mob_vesperon' WHERE entry=30449; +UPDATE creature_template SET ScriptName='mob_shadron' WHERE entry=30451; +UPDATE creature_template SET ScriptName='mob_tenebron' WHERE entry=30452; +UPDATE creature_template SET ScriptName='mob_twilight_eggs' WHERE entry=30882; +UPDATE creature_template SET ScriptName='mob_twilight_whelp' WHERE entry IN (30890, 31214); +UPDATE creature_template SET ScriptName='mob_acolyte_of_shadron' WHERE entry=31218; +UPDATE creature_template SET ScriptName='mob_acolyte_of_vesperon' WHERE entry=31219; + +/* ONYXIA'S LAIR */ +UPDATE instance_template SET ScriptName='instance_onyxias_lair' WHERE map=249; +UPDATE creature_template SET ScriptName='boss_onyxia' WHERE entry=10184; + +/* ORGRIMMAR */ +UPDATE creature_template SET ScriptName='npc_neeru_fireblade' WHERE entry=3216; +UPDATE creature_template SET ScriptName='npc_shenthul' WHERE entry=3401; +UPDATE creature_template SET ScriptName='npc_thrall_warchief' WHERE entry=4949; + +/* RAGEFIRE CHASM */ + + +/* RAZORFEN DOWNS */ +UPDATE creature_template SET ScriptName='boss_amnennar_the_coldbringer' WHERE entry=7358; +UPDATE creature_template SET ScriptName='npc_henry_stern' WHERE entry=8696; + +/* RAZORFEN KRAUL */ +UPDATE instance_template SET ScriptName='instance_razorfen_kraul' WHERE map=47; + +/* REDRIDGE MOUNTAINS */ +UPDATE creature_template SET ScriptName='npc_corporal_keeshan' WHERE entry=349; + +/* RUINS OF AHN'QIRAJ */ +UPDATE instance_template SET ScriptName='instance_ruins_of_ahnqiraj' WHERE map=509; +UPDATE creature_template SET ScriptName='mob_anubisath_guardian' WHERE entry=15355; +UPDATE creature_template SET ScriptName='boss_kurinnaxx' WHERE entry=15348; +UPDATE creature_template SET ScriptName='boss_ayamiss' WHERE entry=15369; +UPDATE creature_template SET ScriptName='boss_moam' WHERE entry=15340; + +/* SCARLET MONASTERY */ +UPDATE instance_template SET ScriptName='instance_scarlet_monastery' WHERE map=189; +UPDATE creature_template SET ScriptName='boss_arcanist_doan' WHERE entry=6487; +UPDATE creature_template SET ScriptName='boss_azshir_the_sleepless' WHERE entry=6490; +UPDATE creature_template SET ScriptName='boss_bloodmage_thalnos' WHERE entry=4543; +UPDATE creature_template SET ScriptName='boss_herod' WHERE entry=3975; +UPDATE creature_template SET ScriptName='boss_high_inquisitor_fairbanks' WHERE entry=4542; +UPDATE creature_template SET ScriptName='boss_high_inquisitor_whitemane' WHERE entry=3977; +UPDATE creature_template SET ScriptName='boss_houndmaster_loksey' WHERE entry=3974; +UPDATE creature_template SET ScriptName='boss_interrogator_vishas' WHERE entry=3983; +UPDATE creature_template SET ScriptName='boss_scarlet_commander_mograine' WHERE entry=3976; +UPDATE creature_template SET ScriptName='boss_scorn' WHERE entry=14693; +UPDATE creature_template SET ScriptName='mob_scarlet_trainee' WHERE entry=6575; +UPDATE creature_template SET ScriptName='boss_headless_horseman' WHERE entry=23682; + +/* SCHOLOMANCE */ +UPDATE instance_template SET ScriptName='instance_scholomance' WHERE map=289; +UPDATE creature_template SET ScriptName='boss_darkmaster_gandling' WHERE entry=1853; +UPDATE creature_template SET ScriptName='boss_death_knight_darkreaver' WHERE entry=14516; +UPDATE creature_template SET ScriptName='boss_lord_alexei_barov' WHERE entry=10504; +UPDATE creature_template SET ScriptName='boss_instructor_malicia' WHERE entry=10505; +UPDATE creature_template SET ScriptName='boss_boss_ras_frostwhisper' WHERE entry=10508; +UPDATE creature_template SET ScriptName='boss_the_ravenian' WHERE entry=10507; +UPDATE creature_template SET ScriptName='boss_vectus' WHERE entry=10432; +UPDATE creature_template SET ScriptName='boss_illucia_barov' WHERE entry=10502; +UPDATE creature_template SET ScriptName='boss_doctor_theolen_krastinov' WHERE entry=11261; +UPDATE creature_template SET ScriptName='boss_jandice_barov' WHERE entry=10503; +UPDATE creature_template SET ScriptName='boss_lorekeeper_polkelt' WHERE entry=10901; +UPDATE creature_template SET ScriptName='boss_kormok' WHERE entry=16118; +UPDATE creature_template SET ScriptName='mob_illusionofjandicebarov' WHERE entry=11439; + +/* SEARING GORGE */ +UPDATE creature_template SET ScriptName='npc_kalaran_windblade' WHERE entry=8479; +UPDATE creature_template SET ScriptName='npc_lothos_riftwaker' WHERE entry=14387; +UPDATE creature_template SET ScriptName='npc_zamael_lunthistle' WHERE entry=8436; + +/* SHADOWFANG KEEP */ +UPDATE instance_template SET ScriptName='instance_shadowfang_keep' WHERE map=33; +UPDATE creature_template SET ScriptName='npc_shadowfang_prisoner' WHERE entry IN (3849,3850); +UPDATE creature_template SET ScriptName='npc_arugal' WHERE entry=10000; +UPDATE creature_template SET ScriptName='npc_deathstalker_vincent' WHERE entry=4444; +UPDATE creature_template SET ScriptName='mob_arugal_voidwalker' WHERE entry=4627; +UPDATE creature_template SET ScriptName='boss_arugal' WHERE entry=4275; + +/* SHADOWMOON VALLEY */ +UPDATE creature_template SET ScriptName='boss_doomwalker' WHERE entry=17711; +UPDATE creature_template SET ScriptName='npc_drake_dealer_hurlunk' WHERE entry=23489; +UPDATE creature_template SET ScriptName='npcs_flanis_swiftwing_and_kagrosh' WHERE entry IN (21725,21727); +UPDATE creature_template SET ScriptName='npc_murkblood_overseer' WHERE entry=23309; +UPDATE creature_template SET ScriptName='npc_neltharaku' WHERE entry=21657; +UPDATE creature_template SET ScriptName='npc_oronok_tornheart' WHERE entry=21183; +UPDATE creature_template SET ScriptName='mob_mature_netherwing_drake' WHERE entry=21648; +UPDATE creature_template SET ScriptName='mob_enslaved_netherwing_drake' WHERE entry=21722; +UPDATE creature_template SET ScriptName='npc_karynaku' WHERE entry=22112; +UPDATE creature_template SET ScriptName='npc_wilda' WHERE entry=21027; +UPDATE creature_template SET ScriptName='mob_torloth' WHERE entry=22076; +UPDATE creature_template SET ScriptName='npc_lord_illidan_stormrage' WHERE entry=22083; +UPDATE gameobject_template SET ScriptName='go_crystal_prison' WHERE entry=185126; + +/* SHATTRATH */ +UPDATE creature_template SET ScriptName='npc_dirty_larry' WHERE entry=19720; +UPDATE creature_template SET ScriptName='npc_ishanah' WHERE entry=18538; +UPDATE creature_template SET ScriptName='npc_khadgar' WHERE entry=18166; +UPDATE creature_template SET ScriptName='npc_khadgars_servant' WHERE entry=19685; +UPDATE creature_template SET ScriptName='npc_raliq_the_drunk' WHERE entry=18585; +UPDATE creature_template SET ScriptName='npc_salsalabim' WHERE entry=18584; +UPDATE creature_template SET ScriptName='npc_shattrathflaskvendors' WHERE entry IN (23483,23484); +UPDATE creature_template SET ScriptName='npc_zephyr' WHERE entry=25967; + +/* SHOLAZAR BASIN */ +UPDATE creature_template SET ScriptName='npc_vekjik' WHERE entry=28315; + +/* SILITHUS */ +UPDATE creature_template SET ScriptName='npc_highlord_demitrian' WHERE entry=14347; +UPDATE creature_template SET ScriptName='npcs_rutgar_and_frankal' WHERE entry IN (15170,15171); + +/* SILVERMOON */ +UPDATE creature_template SET ScriptName='npc_blood_knight_stillblade' WHERE entry=17768; + +/* SILVERPINE FOREST */ +UPDATE creature_template SET ScriptName='npc_astor_hadren' WHERE entry=6497; +UPDATE creature_template SET ScriptName='npc_deathstalker_erland' WHERE entry=1978; +UPDATE creature_template SET ScriptName='npc_deathstalker_faerleia' WHERE entry=2058; + +/* STOCKADES */ + +/* STONETALON MOUNTAINS */ +UPDATE creature_template SET ScriptName='npc_braug_dimspirit' WHERE entry=4489; +UPDATE creature_template SET ScriptName='npc_kaya' WHERE entry=11856; + +/* STORM PEAKS */ +UPDATE creature_template SET ScriptName='npc_loklira_the_crone' WHERE entry=29975; +UPDATE creature_template SET ScriptName='npc_thorim' WHERE entry=29445; +UPDATE creature_template SET ScriptName='npc_roxi_ramrocket' WHERE entry=31247; +UPDATE creature_template SET ScriptName = 'npc_frostborn_scout' WHERE entry = 29811; + +/* STORMWIND CITY */ +UPDATE creature_template SET ScriptName='npc_archmage_malin' WHERE entry=2708; +UPDATE creature_template SET ScriptName='npc_bartleby' WHERE entry=6090; +UPDATE creature_template SET ScriptName='npc_dashel_stonefist' WHERE entry=4961; +UPDATE creature_template SET ScriptName='npc_lady_katrana_prestor' WHERE entry=1749; + +/* STRANGLETHORN VALE */ +UPDATE creature_template SET ScriptName='mob_yenniku' WHERE entry=2530; + +/* STRATHOLME */ +UPDATE instance_template SET ScriptName='instance_stratholme' WHERE map=329; +UPDATE creature_template SET ScriptName='boss_dathrohan_balnazzar' WHERE entry=10812; +UPDATE creature_template SET ScriptName='boss_magistrate_barthilas' WHERE entry=10435; +UPDATE creature_template SET ScriptName='boss_maleki_the_pallid' WHERE entry=10438; +UPDATE creature_template SET ScriptName='boss_nerubenkan' WHERE entry=10437; +UPDATE creature_template SET ScriptName='boss_cannon_master_willey' WHERE entry=10997; +UPDATE creature_template SET ScriptName='boss_baroness_anastari' WHERE entry=10436; +UPDATE creature_template SET ScriptName='boss_ramstein_the_gorger' WHERE entry=10439; +UPDATE creature_template SET ScriptName='boss_timmy_the_cruel' WHERE entry=10808; +UPDATE creature_template SET ScriptName='boss_silver_hand_bosses' WHERE entry IN (17910,17911,17912,17913,17914); +UPDATE creature_template SET ScriptName='boss_postmaster_malown' WHERE entry=11143; +UPDATE creature_template SET ScriptName='boss_baron_rivendare' WHERE entry=10440; +UPDATE creature_template SET ScriptName='mobs_spectral_ghostly_citizen' WHERE entry IN (10384,10385); +UPDATE creature_template SET ScriptName='mob_restless_soul' WHERE entry=11122; +UPDATE creature_template SET ScriptName='mob_freed_soul' WHERE entry=11136; +UPDATE gameobject_template SET ScriptName='go_gauntlet_gate' WHERE entry=175357; + +/* SUNKEN TEMPLE */ +UPDATE instance_template SET ScriptName='instance_sunken_temple' WHERE map=109; +DELETE FROM scripted_areatrigger WHERE entry=4016; +INSERT INTO scripted_areatrigger VALUES (4016,'at_shade_of_eranikus'); +UPDATE creature_template SET ScriptName='npc_malfurion_stormrage' WHERE entry=15362; + +/* SUNWELL PLATEAU */ +UPDATE instance_template SET ScriptName='instance_sunwell_plateau' WHERE map=580; +UPDATE creature_template SET ScriptName='boss_brutallus' WHERE entry=24882; +UPDATE creature_template SET ScriptName='boss_kalecgos' WHERE entry=24850; +UPDATE creature_template SET ScriptName='boss_kalecgos_humanoid' WHERE entry=24891; +UPDATE creature_template SET ScriptName='boss_sathrovarr' WHERE entry=24892; +UPDATE gameobject_template SET ScriptName='go_spectral_rift' WHERE entry=187055; +DELETE FROM scripted_areatrigger WHERE entry=4853; +INSERT INTO scripted_areatrigger VALUES (4853,'at_madrigosa'); + +/* SWAMP OF SORROWS */ +UPDATE creature_template SET ScriptName='npc_galen_goodward' WHERE entry=5391; + +/* TANARIS */ +UPDATE creature_template SET ScriptName='mob_aquementas' WHERE entry=9453; +UPDATE creature_template SET ScriptName='npc_custodian_of_time' WHERE entry=20129; +UPDATE creature_template SET ScriptName='npc_marin_noggenfogger' WHERE entry=7564; +UPDATE creature_template SET ScriptName='npc_oox17tn' WHERE entry=7784; +UPDATE creature_template SET ScriptName='npc_steward_of_time' WHERE entry=20142; +UPDATE creature_template SET ScriptName='npc_stone_watcher_of_norgannon' WHERE entry=7918; +UPDATE creature_template SET ScriptName='npc_tooga' WHERE entry=5955; + +/* TELDRASSIL */ +UPDATE creature_template SET ScriptName='npc_mist' WHERE entry=3568; + +/* */ +/* TEMPEST KEEP */ +/* */ + +/* THE MECHANAR */ +UPDATE creature_template SET ScriptName='boss_gatewatcher_iron_hand' WHERE entry=19710; +UPDATE creature_template SET ScriptName='boss_nethermancer_sepethrea' WHERE entry=19221; +UPDATE creature_template SET ScriptName='mob_ragin_flames' WHERE entry=20481; +UPDATE creature_template SET ScriptName='boss_pathaleon_the_calculator' WHERE entry=19220; +UPDATE creature_template SET ScriptName='mob_nether_wraith' WHERE entry=21062; +UPDATE instance_template SET ScriptName='instance_mechanar' WHERE map=554; + +/* THE BOTANICA */ +UPDATE creature_template SET ScriptName='boss_high_botanist_freywinn' WHERE entry=17975; +UPDATE creature_template SET ScriptName='boss_laj' WHERE entry=17980; +UPDATE creature_template SET ScriptName='boss_warp_splinter' WHERE entry=17977; +UPDATE creature_template SET ScriptName='mob_warp_splinter_treant' WHERE entry=19949; + +/* THE ARCATRAZ */ +UPDATE instance_template SET ScriptName='instance_arcatraz' WHERE map=552; +UPDATE creature_template SET ScriptName='mob_zerekethvoidzone' WHERE entry=21101; +UPDATE creature_template SET ScriptName='boss_harbinger_skyriss' WHERE entry=20912; +UPDATE creature_template SET ScriptName='boss_harbinger_skyriss_illusion' WHERE entry IN (21466,21467); +UPDATE creature_template SET ScriptName='npc_warden_mellichar' WHERE entry=20904; +UPDATE creature_template SET ScriptName='npc_millhouse_manastorm' WHERE entry=20977; + +/* THE EYE */ +UPDATE instance_template SET ScriptName='instance_the_eye' WHERE map=550; +/* The Eye Trash Mobs */ +UPDATE creature_template SET ScriptName='mob_crystalcore_devastator' WHERE entry=20040; +/* Void Reaver event */ +UPDATE creature_template SET ScriptName='boss_void_reaver' WHERE entry=19516; +/* Astromancer event */ +UPDATE creature_template SET ScriptName='boss_high_astromancer_solarian' WHERE entry=18805; +UPDATE creature_template SET ScriptName='mob_solarium_priest' WHERE entry=18806; +/* Kael'thas event */ +UPDATE creature_template SET ScriptName='boss_kaelthas' WHERE entry=19622; +UPDATE creature_template SET ScriptName='boss_thaladred_the_darkener' WHERE entry=20064; +UPDATE creature_template SET ScriptName='boss_lord_sanguinar' WHERE entry=20060; +UPDATE creature_template SET ScriptName='boss_grand_astromancer_capernian' WHERE entry=20062; +UPDATE creature_template SET ScriptName='boss_master_engineer_telonicus' WHERE entry=20063; +UPDATE creature_template SET ScriptName='mob_phoenix_tk' WHERE entry=21362; +UPDATE creature_template SET ScriptName='mob_phoenix_egg_tk' WHERE entry=21364; + +/* TEMPLE OF AHN'QIRAJ */ +UPDATE instance_template SET ScriptName='instance_temple_of_ahnqiraj' WHERE map=531; +UPDATE creature_template SET ScriptName='boss_cthun' WHERE entry=15727; +UPDATE creature_template SET ScriptName='boss_skeram' WHERE entry=15263; +UPDATE creature_template SET ScriptName='boss_vem' WHERE entry=15544; +UPDATE creature_template SET ScriptName='boss_yauj' WHERE entry=15543; +UPDATE creature_template SET ScriptName='boss_kri' WHERE entry=15511; +UPDATE creature_template SET ScriptName='boss_sartura' WHERE entry=15516; +UPDATE creature_template SET ScriptName='boss_fankriss' WHERE entry=15510; +-- UPDATE creature_template SET ScriptName='boss_viscidus' WHERE entry=15299; +-- UPDATE creature_template SET ScriptName='boss_glob_of_viscidus' WHERE entry=15667; +UPDATE creature_template SET ScriptName='boss_huhuran' WHERE entry=15509; +UPDATE creature_template SET ScriptName='boss_veklor' WHERE entry=15276; +UPDATE creature_template SET ScriptName='boss_veknilash' WHERE entry=15275; +UPDATE creature_template SET ScriptName='boss_ouro' WHERE entry=15517; +UPDATE creature_template SET ScriptName='boss_eye_of_cthun' WHERE entry=15589; +UPDATE creature_template SET ScriptName='mob_sartura_royal_guard' WHERE entry=15984; +UPDATE creature_template SET ScriptName='mob_claw_tentacle' WHERE entry=15725; +UPDATE creature_template SET ScriptName='mob_eye_tentacle' WHERE entry=15726; +UPDATE creature_template SET ScriptName='mob_giant_claw_tentacle' WHERE entry=15728; +UPDATE creature_template SET ScriptName='mob_giant_eye_tentacle' WHERE entry=15334; +UPDATE creature_template SET ScriptName='mob_giant_flesh_tentacle' WHERE entry=15802; +UPDATE creature_template SET ScriptName='mob_anubisath_sentinel' WHERE entry=15264; + +/* TEROKKAR FOREST */ +UPDATE creature_template SET ScriptName='mob_infested_root_walker' WHERE entry=22095; +UPDATE creature_template SET ScriptName='mob_netherweb_victim' WHERE entry=22355; +UPDATE creature_template SET ScriptName='mob_rotting_forest_rager' WHERE entry=22307; +UPDATE creature_template SET ScriptName='mob_unkor_the_ruthless' WHERE entry=18262; +UPDATE creature_template SET ScriptName='npc_akuno' WHERE entry=22377; +UPDATE creature_template SET ScriptName='npc_floon' WHERE entry=18588; +UPDATE creature_template SET ScriptName='npc_letoll' WHERE entry=22458; +UPDATE creature_template SET ScriptName='npc_mana_bomb_exp_trigger' WHERE entry=20767; +UPDATE gameobject_template SET ScriptName='go_mana_bomb' WHERE entry=184725; +UPDATE creature_template SET ScriptName='npc_skyguard_handler_irena' WHERE entry=23413; +UPDATE creature_template SET ScriptName='npc_slim' WHERE entry=19679; +UPDATE creature_template SET ScriptName='npc_captive_child' WHERE entry=22314; + +/* THOUSAND NEEDLES */ +UPDATE creature_template SET ScriptName='npc_kanati' WHERE entry=10638; +UPDATE creature_template SET ScriptName='npc_plucky_johnson' WHERE entry=6626; +UPDATE creature_template SET ScriptName='npc_paoka_swiftmountain' WHERE entry=10427; +UPDATE creature_template SET ScriptName='npc_lakota_windsong' WHERE entry=10646; + +/* THUNDER BLUFF */ +UPDATE creature_template SET ScriptName='npc_cairne_bloodhoof' WHERE entry=3057; + +/* TIRISFAL GLADES */ +UPDATE gameobject_template SET ScriptName='go_mausoleum_trigger' WHERE entry=104593; +UPDATE gameobject_template SET ScriptName='go_mausoleum_door' WHERE entry=176594; +UPDATE creature_template SET ScriptName='npc_calvin_montague' WHERE entry=6784; + +/* ULDAMAN */ +DELETE FROM scripted_event_id WHERE id IN (2228,2268); +INSERT INTO scripted_event_id VALUES +(2228,'event_spell_altar_boss_aggro'), +(2268,'event_spell_altar_boss_aggro'); +UPDATE creature_template SET ScriptName='boss_archaedas' WHERE entry=2748; +UPDATE creature_template SET ScriptName='mob_archaeras_add' WHERE entry IN (7309,7076,7077,10120); +UPDATE creature_template SET ScriptName='boss_ironaya' WHERE entry=7228; +UPDATE creature_template SET ScriptName='mob_jadespine_basilisk' WHERE entry=4863; +UPDATE creature_template SET ScriptName='npc_lore_keeper_of_norgannon' WHERE entry=7172; +UPDATE instance_template SET ScriptName='instance_uldaman' WHERE map=70; + +/* */ +/* ULDUAR */ +/* */ + +/* HALLS OF LIGHTNING */ +UPDATE instance_template SET ScriptName='instance_halls_of_lightning' WHERE map=602; +UPDATE creature_template SET ScriptName='boss_bjarngrim' WHERE entry=28586; +UPDATE creature_template SET ScriptName='mob_stormforged_lieutenant' WHERE entry=29240; +UPDATE creature_template SET ScriptName='boss_volkhan' WHERE entry=28587; +UPDATE creature_template SET ScriptName='mob_molten_golem' WHERE entry=28695; +UPDATE creature_template SET ScriptName='npc_volkhan_anvil' WHERE entry=28823; +UPDATE creature_template SET ScriptName='boss_ionar' WHERE entry=28546; +UPDATE creature_template SET ScriptName='mob_spark_of_ionar' WHERE entry=28926; +UPDATE creature_template SET ScriptName='boss_loken' WHERE entry=28923; + +/* HALLS OF STONE */ +UPDATE instance_template SET ScriptName='instance_halls_of_stone' WHERE map=599; +UPDATE creature_template SET ScriptName='boss_maiden_of_grief' WHERE entry=27975; +UPDATE creature_template SET ScriptName='boss_sjonnir' WHERE entry=27978; +UPDATE creature_template SET ScriptName='npc_brann_hos' WHERE entry=28070; + +/* ULDUAR */ +UPDATE instance_template SET ScriptName='instance_ulduar' WHERE map=603; + +/* UN'GORO CRATER */ +UPDATE creature_template SET ScriptName='npc_ame01' WHERE entry=9623; +UPDATE creature_template SET ScriptName='npc_ringo' WHERE entry=9999; + +/* UNDERCITY */ +UPDATE creature_template SET ScriptName='npc_lady_sylvanas_windrunner' WHERE entry=10181; +UPDATE creature_template SET ScriptName='npc_highborne_lamenter' WHERE entry=21628; +UPDATE creature_template SET ScriptName='npc_parqual_fintallas' WHERE entry=4488; + +/* */ +/* UTGARDE KEEP */ +/* */ + +/* UTGARDE KEEP */ +UPDATE instance_template SET ScriptName='instance_utgarde_keep' WHERE map=574; +UPDATE creature_template SET ScriptName='mob_dragonflayer_forge_master' WHERE entry=24079; +UPDATE creature_template SET ScriptName='boss_skarvald' WHERE entry=24200; +UPDATE creature_template SET ScriptName='boss_dalronn' WHERE entry=24201; +UPDATE creature_template SET ScriptName='boss_ingvar' WHERE entry=23954; +UPDATE creature_template SET ScriptName='npc_annhylde' WHERE entry=24068; +UPDATE creature_template SET ScriptName='boss_keleseth' WHERE entry=23953; +UPDATE creature_template SET ScriptName='mob_vrykul_skeleton' WHERE entry=23970; + +/* UTGARDE PINNACLE */ +UPDATE creature_template SET ScriptName='boss_gortok' WHERE entry=26687; +DELETE FROM scripted_areatrigger WHERE entry=4991; +INSERT INTO scripted_areatrigger VALUES (4991,'at_skadi'); +UPDATE creature_template SET ScriptName='boss_skadi' WHERE entry=26693; +UPDATE creature_template SET ScriptName='boss_svala' WHERE entry=29281; +DELETE FROM scripted_areatrigger WHERE entry=5140; +INSERT INTO scripted_areatrigger VALUES (5140,'at_svala_intro'); +UPDATE creature_template SET ScriptName='boss_ymiron' WHERE entry=26861; +UPDATE instance_template SET ScriptName='instance_pinnacle' WHERE map=575; + +/* VAULT OF ARCHAVON */ + + +/* VIOLET HOLD */ +UPDATE instance_template SET ScriptName='instance_violet_hold' WHERE map=608; +UPDATE gameobject_template SET ScriptName='go_activation_crystal' WHERE entry=193611; +UPDATE creature_template SET ScriptName='npc_door_seal' WHERE entry=30896; +UPDATE creature_template SET ScriptName='npc_sinclari' WHERE entry=30658; +UPDATE creature_template SET ScriptName='npc_teleportation_portal' WHERE entry IN (31011,30679,32174); + +/* WAILING CAVERNS */ +UPDATE instance_template SET ScriptName='instance_wailing_caverns' WHERE map=43; + +/* WESTERN PLAGUELANDS */ +UPDATE creature_template SET ScriptName='npcs_dithers_and_arbington' WHERE entry IN (11056,11057); +UPDATE creature_template SET ScriptName='npc_myranda_the_hag' WHERE entry=11872; +UPDATE creature_template SET ScriptName='npc_the_scourge_cauldron' WHERE entry=11152; + +/* WESTFALL */ +UPDATE creature_template SET ScriptName='npc_daphne_stilwell' WHERE entry=6182; +UPDATE creature_template SET ScriptName='npc_defias_traitor' WHERE entry=467; + +/* WETLANDS */ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; + +/* WINTERSPRING */ +UPDATE creature_template SET ScriptName='npc_lorax' WHERE entry=10918; +UPDATE creature_template SET ScriptName='npc_rivern_frostwind' WHERE entry=10618; +UPDATE creature_template SET ScriptName='npc_witch_doctor_mauari' WHERE entry=10307; + +/* ZANGARMARSH */ +DELETE FROM scripted_event_id WHERE id=11225; +INSERT INTO scripted_event_id VALUES (11225,'event_taxi_stormcrow'); +UPDATE creature_template SET ScriptName='npcs_ashyen_and_keleth' WHERE entry IN (17900,17901); +UPDATE creature_template SET ScriptName='npc_cooshcoosh' WHERE entry=18586; +UPDATE creature_template SET ScriptName='npc_elder_kuruti' WHERE entry=18197; +UPDATE creature_template SET ScriptName='npc_kayra_longmane' WHERE entry=17969; +UPDATE creature_template SET ScriptName='npc_mortog_steamhead' WHERE entry=23373; +UPDATE creature_template SET ScriptName='npc_timothy_daniels' WHERE entry=18019; + +/* ZUL'AMAN */ +UPDATE instance_template SET ScriptName='instance_zulaman' WHERE map=568; +UPDATE creature_template SET ScriptName='npc_harrison_jones_za' WHERE entry=24358; +UPDATE gameobject_template SET ScriptName='go_strange_gong' WHERE entry=187359; +UPDATE creature_template SET ScriptName='boss_akilzon' WHERE entry=23574; +UPDATE creature_template SET ScriptName='mob_soaring_eagle' WHERE entry=24858; +UPDATE creature_template SET ScriptName='boss_halazzi' WHERE entry=23577; +UPDATE creature_template SET ScriptName='boss_spirit_lynx' WHERE entry=24143; +UPDATE creature_template SET ScriptName='boss_janalai' WHERE entry=23578; +UPDATE creature_template SET ScriptName='boss_malacrass' WHERE entry=24239; +UPDATE creature_template SET ScriptName='mob_alyson_antille' WHERE entry=24240; +UPDATE creature_template SET ScriptName='mob_thurg' WHERE entry=24241; +UPDATE creature_template SET ScriptName='mob_slither' WHERE entry=24242; +UPDATE creature_template SET ScriptName='mob_lord_raadan' WHERE entry=24243; +UPDATE creature_template SET ScriptName='mob_gazakroth' WHERE entry=24244; +UPDATE creature_template SET ScriptName='mob_fenstalker' WHERE entry=24245; +UPDATE creature_template SET ScriptName='mob_darkheart' WHERE entry=24246; +UPDATE creature_template SET ScriptName='mob_koragg' WHERE entry=24247; +UPDATE creature_template SET ScriptName='boss_nalorakk' WHERE entry=23576; +UPDATE creature_template SET ScriptName='boss_zuljin' WHERE entry=23863; +UPDATE creature_template SET ScriptName='mob_jandalai_firebomb' WHERE entry=23920; +UPDATE creature_template SET ScriptName='mob_amanishi_hatcher' WHERE entry IN (23818,24504); +UPDATE creature_template SET ScriptName='mob_hatchling' WHERE entry=23598; +UPDATE creature_template SET ScriptName='npc_forest_frog' WHERE entry=24396; + +/* ZUL'DRAK */ +UPDATE creature_template SET ScriptName='npc_gurgthock' WHERE entry=30007; + + +/* ZUL'FARRAK */ +UPDATE creature_template SET ScriptName='npc_sergeant_bly' WHERE entry=7604; +UPDATE creature_template SET ScriptName='npc_weegli_blastfuse' WHERE entry=7607; + +/* ZUL'GURUB */ +UPDATE instance_template SET ScriptName='instance_zulgurub' WHERE map=309; +UPDATE creature_template SET ScriptName='boss_jeklik' WHERE entry=14517; +UPDATE creature_template SET ScriptName='boss_venoxis' WHERE entry=14507; +UPDATE creature_template SET ScriptName='boss_marli' WHERE entry=14510; +UPDATE creature_template SET ScriptName='boss_mandokir' WHERE entry=11382; +UPDATE creature_template SET ScriptName='mob_ohgan' WHERE entry=14988; +UPDATE creature_template SET ScriptName='boss_gahzranka' WHERE entry=15114; +UPDATE creature_template SET ScriptName='boss_jindo' WHERE entry=11380; +UPDATE creature_template SET ScriptName='boss_hakkar' WHERE entry=14834; +UPDATE creature_template SET ScriptName='boss_thekal' WHERE entry=14509; +UPDATE creature_template SET ScriptName='boss_arlokk' WHERE entry=14515; +UPDATE gameobject_template SET ScriptName='go_gong_of_bethekk' WHERE entry=180526; +UPDATE creature_template SET ScriptName='boss_grilek' WHERE entry=15082; +UPDATE creature_template SET ScriptName='boss_hazzarah' WHERE entry=15083; +UPDATE creature_template SET ScriptName='boss_renataki' WHERE entry=15084; +UPDATE creature_template SET ScriptName='boss_wushoolay' WHERE entry=15085; +UPDATE creature_template SET ScriptName='mob_zealot_lorkhan' WHERE entry=11347; +UPDATE creature_template SET ScriptName='mob_zealot_zath' WHERE entry=11348; +UPDATE creature_template SET ScriptName='mob_healing_ward' WHERE entry=14987; +UPDATE creature_template SET ScriptName='mob_spawn_of_marli' WHERE entry=15041; +UPDATE creature_template SET ScriptName='mob_batrider' WHERE entry=14965; +UPDATE creature_template SET ScriptName='mob_shade_of_jindo' WHERE entry=14986; + +/* EOF */ diff --git a/sql/old/mangos_old_spells.sql b/sql/old/mangos_old_spells.sql new file mode 100644 index 0000000..d2f2e34 --- /dev/null +++ b/sql/old/mangos_old_spells.sql @@ -0,0 +1,374 @@ +/* Old spell queries from Scriptdev revision 55. Not supported by scriptdev anylonger */ +/* To be used in ordinary database developement. Can be added in any changeset/revision as database developers sees fit */ + +UPDATE `creature_template` SET `spell1` = 116 WHERE `entry` = 946; +UPDATE `creature_template` SET `spell1` = 16415 WHERE `entry` = 4063; +UPDATE `creature_template` SET `spell1` = 205 WHERE `entry` = 1867; +UPDATE `creature_template` SET `spell1` = 705 WHERE `entry` = 1915; +UPDATE `creature_template` SET `spell1` = 145, `spell2` = 134 WHERE `entry` = 1914; +UPDATE `creature_template` SET `spell1` = 837, `spell2` = 122 WHERE `entry` = 1889; +UPDATE `creature_template` SET `spell1` = 8406, `spell2` = 865 WHERE `entry` = 314; +UPDATE `creature_template` SET `spell1` = 6041, `spell2` = 6364 WHERE `entry` = 2570; +UPDATE `creature_template` SET `spell1` = 8407, `spell2` = 12486 WHERE `entry` = 2567; +UPDATE `creature_template` SET `spell1` = 6041 WHERE `entry` = 697; +UPDATE `creature_template` SET `spell1` = 8402, `spell2` = 8423 WHERE `entry` = 1653; +UPDATE `creature_template` SET `spell1` = 8402 WHERE `entry` = 1562; +UPDATE `creature_template` SET `spell1` = 7641, `spell2` = 11707 WHERE `entry` = 1564; +UPDATE `creature_template` SET `spell1` = 1106 WHERE `entry` = 3218; +UPDATE `creature_template` SET `spell1` = 837 WHERE `entry` = 2591; +UPDATE `creature_template` SET `spell1` = 837 WHERE `entry` = 2255; +UPDATE `creature_template` SET `spell1` = 205 WHERE `entry` = 1539; +UPDATE `creature_template` SET `spell1` = 15264, `spell2` = 6060, `spell3` = 988 WHERE `entry` = 4299; +UPDATE `creature_template` SET `spell1` = 984, `spell2` = 1026 WHERE `entry` = 4296; +UPDATE `creature_template` SET `spell1` = 8438, `spell2` = 2601 WHERE `entry` = 4300; +UPDATE `creature_template` SET `spell1` = 1088, `spell2` = 992 WHERE `entry` = 533; +UPDATE `creature_template` SET `spell1` = 7322 WHERE `entry` = 203; +UPDATE `creature_template` SET `spell1` = 1106, `spell2` = 2941 WHERE `entry` = 2577; +UPDATE `creature_template` SET `spell1` = 548, `spell2` = 6535 WHERE `entry` = 3273; +UPDATE `creature_template` SET `spell1` = 529 WHERE `entry` = 1183; +UPDATE `creature_template` SET `spell1` = 992, `spell2` = 705 WHERE `entry` = 436; +UPDATE `creature_template` SET `spell1` = 5177 WHERE `entry` = 7235; +UPDATE `creature_template` SET `spell1` = 5177 WHERE `entry` = 2012; +UPDATE `creature_template` SET `spell1` = 403, `spell2` = 770 WHERE `entry` = 1397; +UPDATE `creature_template` SET `spell1` = 2136 WHERE `entry` = 1174; +UPDATE `creature_template` SET `spell1` = 143 WHERE `entry` = 2018; +UPDATE `creature_template` SET `spell1` = 915, `spell2` = 2606 WHERE `entry` = 1399; +UPDATE `creature_template` SET `spell1` = 915, `spell2` = 8293 WHERE `entry` = 3783; +UPDATE `creature_template` SET `spell1` = 984 WHERE `entry` = 3732; +UPDATE `creature_template` SET `spell1` = 13480 WHERE `entry` = 3725; +UPDATE `creature_template` SET `spell1` = 13480 WHERE `entry` = 3728; +UPDATE `creature_template` SET `spell1` = 9672, `spell2` = 7101 WHERE `entry` = 3662; +UPDATE `creature_template` SET `spell1` = 18089 WHERE `entry` = 2207; +UPDATE `creature_template` SET `spell1` = 8402, `spell2` = 10215 WHERE `entry` = 7026; +UPDATE `creature_template` SET `spell1` = 11659, `spell2` = 8402 WHERE `entry` = 7028; +UPDATE `creature_template` SET `spell1` = 7918, `spell2` = 6685 WHERE `entry` = 7038; +UPDATE `creature_template` SET `spell1` = 676, `spell2` = 53, `spell3` = 0 WHERE `entry` = 6866; +UPDATE `creature_template` SET `spell1` = 53, `spell2` = 0, `spell3` = 0 WHERE `entry` = 122; +UPDATE `creature_template` SET `spell1` = 71, `spell2` = 1671 WHERE `entry` = 449; +UPDATE `creature_template` SET `spell1` = 6554 WHERE `entry` = 121; +UPDATE `creature_template` SET `spell1` = 53 WHERE `entry` = 590; +UPDATE `creature_template` SET `spell1` = 12166 WHERE `entry` = 3232; +UPDATE `creature_template` SET `spell1` = 403 WHERE `entry` = 2953; +UPDATE `creature_template` SET `spell1` = 3385 WHERE `entry` = 2954; +UPDATE `creature_template` SET `spell1` = 15657, `spell2` = 17230, `spell3` = 16509, `spell4` = 0 WHERE `entry` = 1707; +UPDATE `creature_template` SET `spell1` = 6253, `spell2` = 16244, `spell3` = 8242, `spell4` = 16509 WHERE `entry` = 1711; +UPDATE `creature_template` SET `spell1` = 6547, `spell2` = 2590, `spell3` = 6253 WHERE `entry` = 1708; +UPDATE `creature_template` SET `spell1` = 11554, `spell2` = 8242, `spell3` = 6253 WHERE `entry` = 1715; +UPDATE `creature_template` SET `spell1` = 1768, `spell2` = 17230, `spell3` = 16509 WHERE `entry` = 1706; +UPDATE `creature_template` SET `spell1` = 5115 WHERE `entry` = 1729; +UPDATE `creature_template` SET `spell1` = 9915 WHERE `entry` = 1732; +UPDATE `creature_template` SET `spell1` = 143 WHERE `entry` = 1726; +UPDATE `creature_template` SET `spell1` = 143 WHERE `entry` = 619; +UPDATE `creature_template` SET `spell1` = 6660 WHERE `entry` = 657; +UPDATE `creature_template` SET `spell1` = 6660, `spell2` = 6685 WHERE `entry` = 4417; +UPDATE `creature_template` SET `spell1` = 6685 WHERE `entry` = 598; +UPDATE `creature_template` SET `spell1` = 6016 WHERE `entry` = 4416; +UPDATE `creature_template` SET `spell1` = 5115, `spell2` = 6435 WHERE `entry` = 594; +UPDATE `creature_template` SET `spell1` = 9915 WHERE `entry` = 634; +UPDATE `creature_template` SET `spell1` = 205 WHERE `entry` = 1725; +UPDATE `creature_template` SET `spell1` = 133, `spell2` = 205, `spell3` = 113 WHERE `entry` = 4418; +UPDATE `creature_template` SET `spell1` = 6136, `spell2` = 116 WHERE `entry` = 474; +UPDATE `creature_template` SET `spell1` = 3140, `spell2` = 12486, `spell3` = 3443 WHERE `entry` = 910; +UPDATE `creature_template` SET `spell1` = 744, `spell2` = 7992, `spell3` = 2590 WHERE `entry` = 909; +UPDATE `creature_template` SET `spell1` = 8646 WHERE `entry` = 116; +UPDATE `creature_template` SET `spell1` = 53 WHERE `entry` = 504; +UPDATE `creature_template` SET `spell1` = 2764 WHERE `entry` = 95; +UPDATE `creature_template` SET `spell1` = 53, `spell2` = 133 WHERE `entry` = 94; +UPDATE `creature_template` SET `spell1` = 168 WHERE `entry` = 589; +UPDATE `creature_template` SET `spell1` = 8382, `spell2` = 8733 WHERE `entry` = 4819; +UPDATE `creature_template` SET `spell1` = 6145, `spell2` = 71, `spell3` = 22691 WHERE `entry` = 4818; +UPDATE `creature_template` SET `spell1` = 14109, `spell2` = 3358, `spell3` = 8733, `spell4` = 12024 WHERE `entry` = 4820; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 4359; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 1024; +UPDATE `creature_template` SET `spell1` = 1777, `spell2` = 6533 WHERE `entry` = 1028; +UPDATE `creature_template` SET `spell1` = 10177 WHERE `entry` = 1418; +UPDATE `creature_template` SET `spell1` = 744, `spell2` = 1707 WHERE `entry` = 1026; +UPDATE `creature_template` SET `spell1` = 7372, `spell2` = 2457 WHERE `entry` = 1027; +UPDATE `creature_template` SET `spell1` = 15869 WHERE `entry` = 1029; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 747; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 171; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 544; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 545; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 578; +UPDATE `creature_template` SET `spell1` = 744, `spell2` = 865 WHERE `entry` = 127; +UPDATE `creature_template` SET `spell1` = 13519, `spell2` = 6074 WHERE `entry` = 517; +UPDATE `creature_template` SET `spell1` = 10277 WHERE `entry` = 458; +UPDATE `creature_template` SET `spell1` = 7357 WHERE `entry` = 126; +UPDATE `creature_template` SET `spell1` = 205, `spell2` = 331 WHERE `entry` = 548; +UPDATE `creature_template` SET `spell1` = 2589 WHERE `entry` = 732; +UPDATE `creature_template` SET `spell1` = 3368 WHERE `entry` = 46; +UPDATE `creature_template` SET `spell1` = 6268 WHERE `entry` = 1083; +UPDATE `creature_template` SET `spell1` = 3393 WHERE `entry` = 422; +UPDATE `creature_template` SET `spell1` = 3288 WHERE `entry` = 1011; +UPDATE `creature_template` SET `spell1` = 8016 WHERE `entry` = 1008; +UPDATE `creature_template` SET `spell1` = 8016 WHERE `entry` = 1007; +UPDATE `creature_template` SET `spell1` = 205 WHERE `entry` = 1009; +UPDATE `creature_template` SET `spell1` = 547, `spell2` = 548 WHERE `entry` = 1013; +UPDATE `creature_template` SET `spell1` = 744 WHERE `entry` = 434; +UPDATE `creature_template` SET `spell1` = 3150 WHERE `entry` = 433; +UPDATE `creature_template` SET `spell1` = 6205 WHERE `entry` = 432; +UPDATE `creature_template` SET `spell1` = 705 WHERE `entry` = 429; +UPDATE `creature_template` SET `spell1` = 71, `spell2` = 8380, `spell3` = 8629 WHERE `entry` = 568; +UPDATE `creature_template` SET `spell1` = 744 WHERE `entry` = 579; +UPDATE `creature_template` SET `spell1` = 6730, `spell2` = 6016 WHERE `entry` = 448; +UPDATE `creature_template` SET `spell1` = 6730, `spell2` = 6016 WHERE `entry` = 500; +UPDATE `creature_template` SET `spell1` = 8016, `spell2` = 0 WHERE `entry` = 123; +UPDATE `creature_template` SET `spell1` = 1160 WHERE `entry` = 124; +UPDATE `creature_template` SET `spell1` = 3368 WHERE `entry` = 501; +UPDATE `creature_template` SET `spell1` = 3237 WHERE `entry` = 1674; +UPDATE `creature_template` SET `spell1` = 3237 WHERE `entry` = 1772; +UPDATE `creature_template` SET `spell1` = 3237, `spell2` = 695 WHERE `entry` = 1773; +UPDATE `creature_template` SET `spell1` = 3237 WHERE `entry` = 1939; +UPDATE `creature_template` SET `spell1` = 3237 WHERE `entry` = 1940; +UPDATE `creature_template` SET `spell1` = 3237 WHERE `entry` = 1942; +UPDATE `creature_template` SET `spell1` = 3237 WHERE `entry` = 1944; +UPDATE `creature_template` SET `spell1` = 2480 WHERE `entry` = 3112; +UPDATE `creature_template` SET `spell1` = 5280 WHERE `entry` = 3111; +UPDATE `creature_template` SET `spell1` = 3248 WHERE `entry` = 3114; +UPDATE `creature_template` SET `spell1` = 6950, `spell2` = 774 WHERE `entry` = 3113; +UPDATE `creature_template` SET `spell1` = 548, `spell2` = 8045, `spell3` = 8052 WHERE `entry` = 3269; +UPDATE `creature_template` SET `spell1` = 594, `spell2` = 8092, `spell3` = 2052 WHERE `entry` = 3458; +UPDATE `creature_template` SET `spell1` = 594, `spell2` = 598, `spell3` = 8102, `spell4` = 6074 WHERE `entry` = 3271; +UPDATE `creature_template` SET `spell1` = 1978, `spell2` = 3044 WHERE `entry` = 3265; +UPDATE `creature_template` SET `spell1` = 13446, `spell2` = 12323, `spell3` = 13443 WHERE `entry` = 3459; +UPDATE `creature_template` SET `spell1` = 22356 WHERE `entry` = 3267; +UPDATE `creature_template` SET `spell1` = 3427 WHERE `entry` = 712; +UPDATE `creature_template` SET `spell1` = 5164 WHERE `entry` = 446; +UPDATE `creature_template` SET `spell1` = 331, `spell2` = 548 WHERE `entry` = 430; +UPDATE `creature_template` SET `spell1` = 7919 WHERE `entry` = 424; +UPDATE `creature_template` SET `spell1` = 3148 WHERE `entry` = 1115; +UPDATE `creature_template` SET `spell1` = 5164 WHERE `entry` = 1117; +UPDATE `creature_template` SET `spell1` = 53 WHERE `entry` = 1116; +UPDATE `creature_template` SET `spell1` = 5164 WHERE `entry` = 1118; +UPDATE `creature_template` SET `spell1` = 10277 WHERE `entry` = 1162; +UPDATE `creature_template` SET `spell1` = 529 WHERE `entry` = 1166; +UPDATE `creature_template` SET `spell1` = 1776 WHERE `entry` = 1163; +UPDATE `creature_template` SET `spell1` = 11976 WHERE `entry` = 1164; +UPDATE `creature_template` SET `spell1` = 331 WHERE `entry` = 1197; +UPDATE `creature_template` SET `spell1` = 2121 WHERE `entry` = 1165; +UPDATE `creature_template` SET `spell1` = 7405, `spell2` = 71 WHERE `entry` = 1167; +UPDATE `creature_template` SET `spell1` = 11660, `spell2` = 17926, `spell3` = 6215, `spell4` = 11672 WHERE `entry` = 1789; +UPDATE `creature_template` SET `spell1` = 348, `spell2` = 686 WHERE `entry` = 4473; +UPDATE `creature_template` SET `spell1` = 15580, `spell2` = 15613, `spell3` = 23600, `spell4` = 16406 WHERE `entry` = 10391; +UPDATE `creature_template` SET `spell1` = 3416 WHERE `entry` = 531; +UPDATE `creature_template` SET `spell1` = 7369 WHERE `entry` = 1783; +UPDATE `creature_template` SET `spell1` = 838 WHERE `entry` = 7341; +UPDATE `creature_template` SET `spell1` = 15580, `spell2` = 15613, `spell3` = 16406 WHERE `entry` = 10390; +UPDATE `creature_template` SET `spell1` = 9734, `spell2` = 6074 WHERE `entry` = 787; +UPDATE `creature_template` SET `spell1` = 7322, `spell2` = 12486 WHERE `entry` = 203; +UPDATE `creature_template` SET `spell1` = 7992 WHERE `entry` = 1110; +UPDATE `creature_template` SET `spell1` = 17312, `spell2` = 992, `spell3` = 984 WHERE `entry` = 7340; +UPDATE `creature_template` SET `spell1` = 22940, `spell2` = 1411 WHERE `entry` = 1784; +UPDATE `creature_template` SET `spell1` = 705, `spell2` = 1014 WHERE `entry` = 7342; +UPDATE `creature_template` SET `spell1` = 8699 WHERE `entry` = 785; +UPDATE `creature_template` SET `spell1` = 7373 WHERE `entry` = 48; +UPDATE `creature_template` SET `spell1` = 19644, `spell2` = 21949, `spell3` = 19642 WHERE `entry` = 6488; +UPDATE `creature_template` SET `spell1` = 10179, `spell2` = 22645, `spell3` = 13009, `spell4` = 12556 WHERE `entry` = 7358; +UPDATE `creature_template` SET `spell1` = 10148, `spell2` = 12470 WHERE `entry` = 7357; +UPDATE `creature_template` SET `spell1` = 12947, `spell2` = 12946 WHERE `entry` = 7356; +UPDATE `creature_template` SET `spell1` = 12255, `spell2` = 12252, `spell3` = 12254 WHERE `entry` = 7355; +UPDATE `creature_template` SET `spell1` = 10892, `spell2` = 11659 WHERE `entry` = 7354; +UPDATE `creature_template` SET `spell1` = 21667, `spell2` = 21331, `spell3` = 21793 WHERE `entry` = 12225; +UPDATE `creature_template` SET `spell1` = 21080, `spell2` = 8817 WHERE `entry` = 12236; +UPDATE `creature_template` SET `spell1` = 24375, `spell2` = 15580 WHERE `entry` = 12237; +UPDATE `creature_template` SET `spell1` = 21909, `spell2` = 21832, `spell3` = 19128, `spell4` = 21869 WHERE `entry` = 12201; +UPDATE `creature_template` SET `spell1` = 21911, `spell2` = 15584, `spell3` = 21749 WHERE `entry` = 12258; +UPDATE `creature_template` SET `spell1` = 21833, `spell2` = 22334 WHERE `entry` = 13601; +UPDATE `creature_template` SET `spell1` = 21687, `spell2` = 21547, `spell3` = 21707 WHERE `entry` = 13282; +UPDATE `creature_template` SET `spell1` = 9770, `spell2` = 16145, `spell3` = 1604, `spell4` = 9776 WHERE `entry` = 6206; +UPDATE `creature_template` SET `spell1` = 9770, `spell2` = 1604, `spell3` = 12540 WHERE `entry` = 6208; +UPDATE `creature_template` SET `spell1` = 10851 WHERE `entry` = 6209; +UPDATE `creature_template` SET `spell1` = 1604, `spell2` = 6409, `spell3` = 3420 WHERE `entry` = 6215; +UPDATE `creature_template` SET `spell1` = 9459, `spell2` = 1604, `spell3` = 10341, `spell4` = 11638 WHERE `entry` = 6219; +UPDATE `creature_template` SET `spell1` = 16169, `spell2` = 5568, `spell3` = 10887 WHERE `entry` = 6229; +UPDATE `creature_template` SET `spell1` = 3053, `spell2` = 16412 WHERE `entry` = 6228; +UPDATE `creature_template` SET `spell1` = 11082, `spell2` = 11085, `spell3` = 11084 WHERE `entry` = 6235; +UPDATE `creature_template` SET `spell1` = 1604 WHERE `entry` = 7361; +UPDATE `creature_template` SET `spell1` = 6660, `spell2` = 8858 WHERE `entry` = 6407; +UPDATE `creature_template` SET `spell1` = 8211, `spell2` = 10341, `spell3` = 1604, `spell4` = 9459 WHERE `entry` = 6220; +UPDATE `creature_template` SET `spell1` = 10341, `spell2` = 1604, `spell3` = 9459 WHERE `entry` = 6218; +UPDATE `creature_template` SET `spell1` = 1604, `spell2` = 11264, `spell3` = 12024 WHERE `entry` = 7603; +UPDATE `creature_template` SET `spell1` = 6660, `spell2` = 2643, `spell3` = 5116 WHERE `entry` = 6223; +UPDATE `creature_template` SET `spell1` = 13398, `spell2` = 1604, `spell3` = 12024 WHERE `entry` = 6222; +UPDATE `creature_template` SET `spell1` = 11820, `spell2` = 1604 WHERE `entry` = 6234; +UPDATE `creature_template` SET `spell1` = 1604 WHERE `entry` = 6233; +UPDATE `creature_template` SET `spell1` = 11306, `spell2` = 10733 WHERE `entry` = 6226; +UPDATE `creature_template` SET `spell1` = 22519, `spell2` = 11264 WHERE `entry` = 6227; +UPDATE `creature_template` SET `spell1` = 10346, `spell2` = 1604, `spell3` = 17174 WHERE `entry` = 6225; +UPDATE `creature_template` SET `spell1` = 6533, `spell2` = 1604, `spell3` = 11820, `spell4` = 11084 WHERE `entry` = 6230; +UPDATE `creature_template` SET `spell1` = 10341, `spell2` = 9459 WHERE `entry` = 7079; +UPDATE `creature_template` SET `spell1` = 22689, `spell2` = 22662, `spell3` = 19319 WHERE `entry` = 11492; +UPDATE `creature_template` SET `spell1` = 15708, `spell2` = 23511 WHERE `entry` = 14325; +UPDATE `creature_template` SET `spell1` = 10947, `spell2` = 10151 WHERE `entry` = 14324; +UPDATE `creature_template` SET `spell1` = 15580, `spell2` = 15655, `spell3` = 22572, `spell4` = 20691 WHERE `entry` = 14321; +UPDATE `creature_template` SET `spell1` = 15580, `spell2` = 15655, `spell3` = 20691 WHERE `entry` = 14326; +UPDATE `creature_template` SET `spell1` = 15580, `spell2` = 17307, `spell3` = 20691 WHERE `entry` = 14323; +UPDATE `creature_template` SET `spell1` = 22419, `spell2` = 22420, `spell3` = 22421 WHERE `entry` = 13280; +UPDATE `creature_template` SET `spell1` = 22422 WHERE `entry` = 14122; +UPDATE `creature_template` SET `spell1` = 5116, `spell2` = 20904, `spell3` = 14290, `spell4` = 14295 WHERE `entry` = 11488; +UPDATE `creature_template` SET `spell1` = 16128, `spell2` = 15550, `spell3` = 22899 WHERE `entry` = 11496; +UPDATE `creature_template` SET `spell1` = 22909 WHERE `entry` = 14396; +UPDATE `creature_template` SET `spell1` = 15708, `spell2` = 24375 WHERE `entry` = 11501; +UPDATE `creature_template` SET `spell1` = 11668, `spell2` = 14887 WHERE `entry` = 14327; +UPDATE `creature_template` SET `spell1` = 10984 WHERE `entry` = 14506; +UPDATE `creature_template` SET `spell1` = 10894, `spell2` = 10947, `spell3` = 18807 WHERE `entry` = 11487; +UPDATE `creature_template` SET `spell1` = 20691, `spell2` = 22920 WHERE `entry` = 11486; +UPDATE `creature_template` SET `spell1` = 22424, `spell2` = 10151, `spell3` = 16144 WHERE `entry` = 14354; +UPDATE `creature_template` SET `spell1` = 20691, `spell2` = 24375 WHERE `entry` = 11498; +UPDATE `creature_template` SET `spell1` = 15550, `spell2` = 22924, `spell3` = 22994 WHERE `entry` = 11489; +UPDATE `creature_template` SET `spell1` = 22478, `spell2` = 22651 WHERE `entry` = 11490; +UPDATE `creature_template` SET `spell1` = 20832, `spell2` = 16102, `spell3` = 15530, `spell4` = 16170 WHERE `entry` = 11444; +UPDATE `creature_template` SET `spell1` = 22572, `spell2` = 22916 WHERE `entry` = 11450; +UPDATE `creature_template` SET `spell1` = 13737, `spell2` = 20677, `spell3` = 24317 WHERE `entry` = 11441; +UPDATE `creature_template` SET `spell1` = 19474 WHERE `entry` = 11457; +UPDATE `creature_template` SET `spell1` = 22460, `spell2` = 22272 WHERE `entry` = 13197; +UPDATE `creature_template` SET `spell1`=512, `spell2`=1010, `spell3`=0, `spell4`=0 WHERE `entry`=10415; +UPDATE `creature_template` SET `spell1`=1096, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10917; +UPDATE `creature_template` SET `spell1`=20603, `spell2`=15398, `spell3`=9256, `spell4`=20741 WHERE `entry`=10813; +UPDATE `creature_template` SET `spell1`=16565, `spell2`=16867, `spell3`=18327, `spell4`=0 WHERE `entry`=10436; +UPDATE `creature_template` SET `spell1`=16866, `spell2`=1604, `spell3`=0, `spell4`=0 WHERE `entry`=10697; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=16866, `spell3`=0, `spell4`=0 WHERE `entry`=10416; +UPDATE `creature_template` SET `spell1`=17439, `spell2`=15584, `spell3`=1604, `spell4`=0 WHERE `entry`=10394; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=5884, `spell3`=0, `spell4`=0 WHERE `entry`=11121; +UPDATE `creature_template` SET `spell1`=16140, `spell2`=1604, `spell3`=0, `spell4`=0 WHERE `entry`=10383; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=3589, `spell3`=0, `spell4`=0 WHERE `entry`=8530; +UPDATE `creature_template` SET `spell1`=23382, `spell2`=15615, `spell3`=16496, `spell4`=0 WHERE `entry`=10997; +UPDATE `creature_template` SET `spell1`=13020, `spell2`=23413, `spell3`=0, `spell4`=0 WHERE `entry`=10425; +UPDATE `creature_template` SET `spell1`=17293, `spell2`=23462, `spell3`=17274, `spell4`=0 WHERE `entry`=10811; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=15749, `spell3`=11972, `spell4`=13534 WHERE `entry`=13118; +UPDATE `creature_template` SET `spell1`=11831, `spell2`=23412, `spell3`=1604, `spell4`=0 WHERE `entry`=10419; +UPDATE `creature_template` SET `spell1`=5101, `spell2`=17143, `spell3`=13005, `spell4`=0 WHERE `entry`=12337; +UPDATE `creature_template` SET `spell1`=13005, `spell2`=1604, `spell3`=20005, `spell4`=0 WHERE `entry`=10421; +UPDATE `creature_template` SET `spell1`=36647, `spell2`=17143, `spell3`=1604, `spell4`=0 WHERE `entry`=10424; +UPDATE `creature_template` SET `spell1`=15749, `spell2`=33871, `spell3`=1604, `spell4`=0 WHERE `entry`=10418; +UPDATE `creature_template` SET `spell1`=17445, `spell2`=1604, `spell3`=39077, `spell4`=0 WHERE `entry`=11120; +UPDATE `creature_template` SET `spell1`=17287, `spell2`=1604, `spell3`=22645, `spell4`=0 WHERE `entry`=10420; +UPDATE `creature_template` SET `spell1`=22645, `spell2`=17165, `spell3`=22947, `spell4`=0 WHERE `entry`=10426; +UPDATE `creature_template` SET `spell1`=36033, `spell2`=17145, `spell3`=1604, `spell4`=0 WHERE `entry`=11043; +UPDATE `creature_template` SET `spell1`=36176, `spell2`=36947, `spell3`=1604, `spell4`=0 WHERE `entry`=10423; +UPDATE `creature_template` SET `spell1`=38094, `spell2`=1604, `spell3`=6788, `spell4`=0 WHERE `entry`=11054; +UPDATE `creature_template` SET `spell1`=15451, `spell2`=16927, `spell3`=16144, `spell4`=15534 WHERE `entry`=10422; +UPDATE `creature_template` SET `spell1`=22412, `spell2`=4962, `spell3`=1604, `spell4`=3589 WHERE `entry`=10413; +UPDATE `creature_template` SET `spell1`=15471, `spell2`=1604, `spell3`=3589, `spell4`=16430 WHERE `entry`=10412; +UPDATE `creature_template` SET `spell1`=16401, `spell2`=12023, `spell3`=1604, `spell4`=20812 WHERE `entry`=8556; +UPDATE `creature_template` SET `spell1`=4629, `spell2`=20549, `spell3`=20812, `spell4`=21949 WHERE `entry`=11859; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=15530, `spell3`=15531, `spell4`=16458 WHERE `entry`=15607; +UPDATE `creature_template` SET `spell1`=16388, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10557; +UPDATE `creature_template` SET `spell1`=18200, `spell2`=1604, `spell3`=9791, `spell4`=16458 WHERE `entry`=10407; +UPDATE `creature_template` SET `spell1`=7964, `spell2`=20712, `spell3`=1604, `spell4`=23511 WHERE `entry`=11058; +UPDATE `creature_template` SET `spell1`=16249, `spell2`=16143, `spell3`=16449, `spell4`=0 WHERE `entry`=11136; +UPDATE `creature_template` SET `spell1`=22687, `spell2`=1604, `spell3`=0, `spell4`=0 WHERE `entry`=10385; +UPDATE `creature_template` SET `spell1`=12538, `spell2`=15608, `spell3`=16172, `spell4`=1604 WHERE `entry`=10406; +UPDATE `creature_template` SET `spell1`=17286, `spell2`=1604, `spell3`=20830, `spell4`=0 WHERE `entry`=10812; +UPDATE `creature_template` SET `spell1`=3589, `spell2`=16867, `spell3`=1604, `spell4`=0 WHERE `entry`=8541; +UPDATE `creature_template` SET `spell1`=17685, `spell2`=18663, `spell3`=19643, `spell4`=20812 WHERE `entry`=16101; +UPDATE `creature_template` SET `spell1`=16793, `spell2`=10887, `spell3`=14099, `spell4`=1604 WHERE `entry`=10435; +UPDATE `creature_template` SET `spell1`=15850, `spell2`=16249, `spell3`=20743, `spell4`=16869 WHERE `entry`=10438; +UPDATE `creature_template` SET `spell1`=12734, `spell2`=16172, `spell3`=1604, `spell4`=6788 WHERE `entry`=11032; +UPDATE `creature_template` SET `spell1`=16143, `spell2`=1604, `spell3`=15043, `spell4`=0 WHERE `entry`=10382; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=6788, `spell3`=0, `spell4`=0 WHERE `entry`=11197; +UPDATE `creature_template` SET `spell1`=1604, `spell2`=6788, `spell3`=0, `spell4`=0 WHERE `entry`=11030; +UPDATE `creature_template` SET `spell1`=5568, `spell2`=17307, `spell3`=1604, `spell4`=6788 WHERE `entry`=10439; +UPDATE `creature_template` SET `spell1`=19813, `spell2`=4283, `spell3`=0, `spell4`=0 WHERE `entry`=11658; +UPDATE `creature_template` SET `spell1`=19393, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=11668; +UPDATE `creature_template` SET `spell1`=25787, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=12101; +UPDATE `creature_template` SET `spell1`=19364, `spell2`=19365, `spell3`=19369, `spell4`=19367 WHERE `entry`=11673; +UPDATE `creature_template` SET `spell1`=4283, `spell2`=19813, `spell3`=0, `spell4`=0 WHERE `entry`=11659; +UPDATE `creature_template` SET `spell1`=20228, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=12143; +UPDATE `creature_template` SET `spell1`=20203, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=11669; +UPDATE `creature_template` SET `spell1`=24668, `spell2`=23952, `spell3`=10960, `spell4`=0 WHERE `entry`=11663; +UPDATE `creature_template` SET `spell1`=23952, `spell2`=20294, `spell3`=0, `spell4`=0 WHERE `entry`=11662; +UPDATE `creature_template` SET `spell1`=20677, `spell2`=20740, `spell3`=0, `spell4`=0 WHERE `entry`=12119; +UPDATE `creature_template` SET `spell1`=20623, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=11664; +UPDATE `creature_template` SET `spell1`=19778, `spell2`=19771, `spell3`=0, `spell4`=0 WHERE `entry`=11671; +UPDATE `creature_template` SET `spell1`=21081, `spell2`=19730, `spell3`=0, `spell4`=0 WHERE `entry`=11661; +UPDATE `creature_template` SET `spell1`=19626, `spell2`=19630, `spell3`=19631, `spell4`=0 WHERE `entry`=11667; +UPDATE `creature_template` SET `spell1`=19798, `spell2`=19496, `spell3`=0, `spell4`=0 WHERE `entry`=12806; +UPDATE `creature_template` SET `spell1`=19635, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=11666; +UPDATE `creature_template` SET `spell1`=19642, `spell2`=19644, `spell3`=0, `spell4`=0 WHERE `entry`=12100; +UPDATE `creature_template` SET `spell1`=19641, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=12076; +UPDATE `creature_template` SET `spell1`=20294, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=12099; +UPDATE `creature_template` SET `spell1`=18108, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=12265; +UPDATE `creature_template` SET `spell1`=22689, `spell2`=19319, `spell3`=0, `spell4`=0 WHERE `entry`=11672; +UPDATE `creature_template` SET `spell1`=35178, `spell2`=15749, `spell3`=0, `spell4`=0 WHERE `entry`=10509; +UPDATE `creature_template` SET `spell1`=35178, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=9819; +UPDATE `creature_template` SET `spell1`=30688, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10319; +UPDATE `creature_template` SET `spell1`=20816, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=9817; +UPDATE `creature_template` SET `spell1`=32192, `spell2`=18108, `spell3`=0, `spell4`=0 WHERE `entry`=9818; +UPDATE `creature_template` SET `spell1`=23462, `spell2`=23341, `spell3`=17274, `spell4`=0 WHERE `entry`=9816; +UPDATE `creature_template` SET `spell1`=24317, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10258; +UPDATE `creature_template` SET `spell1`=145, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10161; +UPDATE `creature_template` SET `spell1`=0, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10683; +UPDATE `creature_template` SET `spell1`=28725, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10264; +UPDATE `creature_template` SET `spell1`=12461, `spell2`=22591, `spell3`=16172, `spell4`=24317 WHERE `entry`=10899; +UPDATE `creature_template` SET `spell1`=12461, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10317; +UPDATE `creature_template` SET `spell1`=0, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10762; +UPDATE `creature_template` SET `spell1`=0, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10742; +UPDATE `creature_template` SET `spell1`=30014, `spell2`=32370, `spell3`=0, `spell4`=0 WHERE `entry`=10447; +UPDATE `creature_template` SET `spell1`=22414, `spell2`=23512, `spell3`=0, `spell4`=0 WHERE `entry`=10442; +UPDATE `creature_template` SET `spell1`=20691, `spell2`=15589, `spell3`=23931, `spell4`=0 WHERE `entry`=10429; +UPDATE `creature_template` SET `spell1`=20667, `spell2`=20712, `spell3`=18763, `spell4`=0 WHERE `entry`=10339; +UPDATE `creature_template` SET `spell1`=11286, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10318; +UPDATE `creature_template` SET `spell1`=23462, `spell2`=25668, `spell3`=0, `spell4`=0 WHERE `entry`=10372; +UPDATE `creature_template` SET `spell1`=28168, `spell2`=27580, `spell3`=0, `spell4`=0 WHERE `entry`=10371; +UPDATE `creature_template` SET `spell1`=23462, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10083; +UPDATE `creature_template` SET `spell1`=20741, `spell2`=24668, `spell3`=0, `spell4`=0 WHERE `entry`=10162; +UPDATE `creature_template` SET `spell1`=17883, `spell2`=16785, `spell3`=0, `spell4`=0 WHERE `entry`=10430; +UPDATE `creature_template` SET `spell1`=23462, `spell2`=20691, `spell3`=23023, `spell4`=23931 WHERE `entry`=10363; +UPDATE `creature_template` SET `spell1`=20276, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10814; +UPDATE `creature_template` SET `spell1`=13496, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=11598; +UPDATE `creature_template` SET `spell1`=27559, `spell2`=20691, `spell3`=12020, `spell4`=30138 WHERE `entry`=10487; +UPDATE `creature_template` SET `spell1`=17715, `spell2`=27559, `spell3`=20276, `spell4`=0 WHERE `entry`=10491; +UPDATE `creature_template` SET `spell1`=11660, `spell2`=18807, `spell3`=0, `spell4`=0 WHERE `entry`=10470; +UPDATE `creature_template` SET `spell1`=18270, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10481; +UPDATE `creature_template` SET `spell1`=18116, `spell2`=17695, `spell3`=20741, `spell4`=15584 WHERE `entry`=10433; +UPDATE `creature_template` SET `spell1`=17472, `spell2`=15584, `spell3`=0, `spell4`=0 WHERE `entry`=10482; +UPDATE `creature_template` SET `spell1`=18106, `spell2`=18116, `spell3`=15584, `spell4`=0 WHERE `entry`=11261; +UPDATE `creature_template` SET `spell1`=18116, `spell2`=20741, `spell3`=18144, `spell4`=0 WHERE `entry`=10506; +UPDATE `creature_template` SET `spell1`=11672, `spell2`=12020, `spell3`=18116, `spell4`=0 WHERE `entry`=10505; +UPDATE `creature_template` SET `spell1`=16359, `spell2`=3584, `spell3`=18116, `spell4`=0 WHERE `entry`=10901; +UPDATE `creature_template` SET `spell1`=24375, `spell2`=18813, `spell3`=18116, `spell4`=0 WHERE `entry`=11622; +UPDATE `creature_template` SET `spell1`=15550, `spell2`=20691, `spell3`=18116, `spell4`=0 WHERE `entry`=10507; +UPDATE `creature_template` SET `spell1`=11668, `spell2`=11700, `spell3`=18116, `spell4`=0 WHERE `entry`=10504; +UPDATE `creature_template` SET `spell1`=24673, `spell2`=18270, `spell3`=18116, `spell4`=0 WHERE `entry`=10503; +UPDATE `creature_template` SET `spell1`=15584, `spell2`=17472, `spell3`=0, `spell4`=0 WHERE `entry`=11439; +UPDATE `creature_template` SET `spell1`=18116, `spell2`=19460, `spell3`=6215, `spell4`=15487 WHERE `entry`=10502; +UPDATE `creature_template` SET `spell1`=18702, `spell2`=10212, `spell3`=18116, `spell4`=0 WHERE `entry`=1853; +UPDATE `creature_template` SET `spell1`=16350, `spell2`=21369, `spell3`=8398, `spell4`=18033 WHERE `entry`=10508; +UPDATE `creature_template` SET `spell1`=27224, `spell2`=30900, `spell3`=3609, `spell4`=0 WHERE `entry`=14861; +UPDATE `creature_template` SET `spell1`=18278, `spell2`=29405, `spell3`=12020, `spell4`=0 WHERE `entry`=10498; +UPDATE `creature_template` SET `spell1`=24063, `spell2`=18270, `spell3`=0, `spell4`=0 WHERE `entry`=10495; +UPDATE `creature_template` SET `spell1`=12020, `spell2`=18278, `spell3`=25304, `spell4`=0 WHERE `entry`=11263; +UPDATE `creature_template` SET `spell1`=16469, `spell2`=25349, `spell3`=0, `spell4`=0 WHERE `entry`=11551; +UPDATE `creature_template` SET `spell1`=25304, `spell2`=11660, `spell3`=12020, `spell4`=0 WHERE `entry`=10477; +UPDATE `creature_template` SET `spell1`=25304, `spell2`=12020, `spell3`=10161, `spell4`=0 WHERE `entry`=10472; +UPDATE `creature_template` SET `spell1`=15571, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10475; +UPDATE `creature_template` SET `spell1`=25304, `spell2`=10161, `spell3`=10473, `spell4`=0 WHERE `entry`=10469; +UPDATE `creature_template` SET `spell1`=11660, `spell2`=15571, `spell3`=10161, `spell4`=0 WHERE `entry`=11284; +UPDATE `creature_template` SET `spell1`=17689, `spell2`=15571, `spell3`=18270, `spell4`=0 WHERE `entry`=10480; +UPDATE `creature_template` SET `spell1`=15571, `spell2`=30138, `spell3`=0, `spell4`=0 WHERE `entry`=10497; +UPDATE `creature_template` SET `spell1`=15571, `spell2`=30138, `spell3`=0, `spell4`=0 WHERE `entry`=10479; +UPDATE `creature_template` SET `spell1`=17504, `spell2`=12867, `spell3`=0, `spell4`=0 WHERE `entry`=14513; +UPDATE `creature_template` SET `spell1`=17504, `spell2`=12867, `spell3`=24673, `spell4`=0 WHERE `entry`=14520; +UPDATE `creature_template` SET `spell1`=30138, `spell2`=11660, `spell3`=0, `spell4`=0 WHERE `entry`=14521; +UPDATE `creature_template` SET `spell1`=11556, `spell2`=8140, `spell3`=23262, `spell4`=0 WHERE `entry`=14518; +UPDATE `creature_template` SET `spell1`=10894, `spell2`=23244, `spell3`=0, `spell4`=0 WHERE `entry`=14519; +UPDATE `creature_template` SET `spell1`=11556, `spell2`=8140, `spell3`=15571, `spell4`=0 WHERE `entry`=14514; +UPDATE `creature_template` SET `spell1`=15571, `spell2`=23244, `spell3`=0, `spell4`=0 WHERE `entry`=14512; +UPDATE `creature_template` SET `spell1`=12292, `spell2`=15571, `spell3`=28168, `spell4`=0 WHERE `entry`=10488; +UPDATE `creature_template` SET `spell1`=15571, `spell2`=24063, `spell3`=18270, `spell4`=12021 WHERE `entry`=10485; +UPDATE `creature_template` SET `spell1`=10161, `spell2`=13021, `spell3`=20883, `spell4`=0 WHERE `entry`=11257; +UPDATE `creature_template` SET `spell1`=15571, `spell2`=0, `spell3`=0, `spell4`=0 WHERE `entry`=10478; +UPDATE `creature_template` SET `spell1`=17504, `spell2`=26554, `spell3`=35011, `spell4`=0 WHERE `entry`=10486; +UPDATE `creature_template` SET `spell1`=19627, `spell2`=18816, `spell3`=13021, `spell4`=0 WHERE `entry`=10432; +UPDATE `creature_template` SET `spell1`=18807, `spell2`=10876, `spell3`=0, `spell4`=0 WHERE `entry`=10471; +UPDATE `creature_template` SET `spell1`=10876, `spell2`=25304, `spell3`=18647, `spell4`=0 WHERE `entry`=10500; +UPDATE `creature_template` SET `spell1`=29684, `spell2`=25051, `spell3`=0, `spell4`=0 WHERE `entry`=10489; + +UPDATE `creature_template` SET `spell1` = 24317, `spell2` = 19644 WHERE `entry` = 8890; +UPDATE `creature_template` SET `spell1` = 30901, `spell2` = 27581, `spell3` = 34510 WHERE `entry` = 8891; +UPDATE `creature_template` SET `spell1` = 29560, `spell2` = 19644 WHERE `entry` = 8892; +UPDATE `creature_template` SET `spell1` = 40082, `spell2` = 30901 WHERE `entry` = 8893; +UPDATE `creature_template` SET `spell1` = 8812, `spell2` = 10961, `spell3` = 10947 WHERE `entry` = 8894; +UPDATE `creature_template` SET `spell1` = 25292, `spell2` = 1020 WHERE `entry` = 8895; +UPDATE `creature_template` SET `spell1` = 17143, `spell2` = 10293, `spell3` = 25292 WHERE `entry` = 8898; diff --git a/sql/optional/mangos_optional_generic_creature.sql b/sql/optional/mangos_optional_generic_creature.sql new file mode 100644 index 0000000..40997ad --- /dev/null +++ b/sql/optional/mangos_optional_generic_creature.sql @@ -0,0 +1,283 @@ +/* */ + +/* WORLD CREATURE These are creatures to be found in more than one specific zone */ +/* Spider */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (14881); + +/* */ +/* ZONE */ +/* */ + +/* ALTERAC MOUNTAINS */ +/* Crushridge Mage, Argus Shadow Mage, Dalaran Summoner, Archmage Ansirem Runeweaver */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (2255, 2318, 2358, 2543); + +/* ALTERAC VALLEY */ +/* Wildpaw Mystic */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (11838); + +/* ARATHI HIGHLANDS */ +/* Feeboz, Boulderfist Shaman, Boulderfist Magus, Syndicate Magus, Dark Iron Shadowcaster, Witherbark Axe Thrower, Plains Creeper, Giant Plains Creeper */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (4063, 2570, 2567, 2591, 2577, 2554, 2563, 2565); + +/* ASHENVALE */ +/* Shadethicket Raincaller, Forsaken Seeker, Dark Strand Cultist, Dark Strand Adept */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (3783, 3732, 3725, 3728); + + +/* */ +/* AUCHINDOUN */ +/* */ + + + +/* AZSHARA */ +/* Draconic Magelord, Draconic Mageweaver, Archmage Xylem */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (6129, 6131, 8379); + +/* BADLANDS */ +/* Dustbelcher Ogre Mage, Dustbelcher Mystic, Shadowmage Vivian Lagrave */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (2720, 2907, 9078); + +/* BARRENS */ +/* Kolkar Stormer, Razormane Geomancer, Razormane Seer, Razormane Mystic, Razormane Hunter, Razormane Warfrenzy, Razormane Water Seeker, Silithid Creeper, Elder Mystic Razorsnout, Horde Axe Thrower */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (3273, 3269, 3458, 3271, 3265, 3459, 3267, 3250, 3270, 9458); + +/* BLACKFATHOM DEPTHS */ +/* Blindlight Oracle, Blindlight Muckdweller, Blindlight Murloc, Twilight Shadowmage */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (4820, 4819, 4818, 4813); + + +/* Hedrum the Creeper, Dark Keeper Zimrel */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (9032, 9441); +/* Anvilrage military */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (8890, 8891, 8892, 8893, 8894, 8895, 8898); +/* Cave Creeper */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (8933); + +/* BLACKROCK SPIRE */ +/* Blackhand Dreadweaver,Blackhand Summoner,Blackhand Veteran,Blackhand Elite,Blackhand Assassin,Blackhand Iron Guard,Chromatic Whelp,Chromatic Dragonspawn,Rookery Whelp,Rookery Guardian,Rage Talon Captain,Rage Talon Fire Tongue,Rage Talon Flamescale */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (9817, 9818, 9819, 10317, 10318, 10319, 10442, 10447, 10161, 10258, 10371, 10372, 10083); +/* Spirestone Battle Mage, Spirestone Mystic, Smolderthorn Mystic, Smolderthorn Axe Thrower, Bloodaxe Summoner , Spire Spider, Spire Spiderling */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (9197, 9198, 9239, 9267, 9717, 10374, 10375); + + +/* BLACKROCK SPIRE Upper */ +/* Jed Runewatcher,Solakar Flamewreath,Goraluk Anvilcrack */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry`IN (10509,10264,10899); + +/* BLACKWING LAIR */ +/* Trash Mobs */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (12420); + + +/* BLASTED LANDS */ +/* Dreadmaul Ogre Mage, Bloodmage Drazial, Bloodmage Lynnore, Archmage Allistarj */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (5975, 7505, 7506, 7666); + +/* BURNING STEPPES */ +/* Blackrock Sorcerer, Blackrock Warlock, Scalding Broodling, Thaurissan Agent, Firegut Ogre Mage */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (7026, 7028, 7048, 7038, 7034); + + +/* DARKSHORE */ +/* Delmanis the Hated, Greymist Oracle, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (3662, 2207); + +/* DEADMINES */ +/* Defias Squallshaper, Defias Magician, Defias Conjurer, Defias Overseer, Defias Watchman, Defias Wizard, Defias Evoker, Defias Pirate, Defias Taskmaster, Defias Miner, Defias Strip Miner, Defias Henchman, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1732, 1726, 619, 634, 1725, 4418, 1729, 657, 4417, 598, 4416, 594); + +/* DEADWIND PASS */ +/* Deadwind Ogre Mage */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (7379); + +/* DESOLACE */ +/* Burning Blade Shadowmage, Burning Blade Summoner, Mage Hunter */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (4667, 4668, 4681); + +/* DIRE MAUL */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (11492, 14325, 14324, 14321, 14326, 14323, 13280, 14122, 11488, 11496, 14396, 11501, 14327, 14506, 11487, 11486, 14354, 11498, 11489, 11490, 11444, 11450, 11441, 11457, 13197); +/* Gordok Mage-Lord, Highborne Summoner */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (11444, 11466); + +/* DUN MOROGH */ +/* Frostmane Novice, Frostmane Seer, Rockjaw Skullthumper, Rockjaw Bonesnapper, Rockjaw Ambusher, Rockjaw Backbreaker, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (946, 1397, 1115, 1117, 1116, 1118); + +/* DUROTAR */ +/* Razormane Scout, Razormane Dustrunner, Razormane Quilboar, Razormane Battleguard, Vile Familiar */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (3112, 3113, 3111, 3114, 3101); + +/* DUSKWOOD */ +/* Eliza, Nightbane Shadow Weaver, Skeletal Mage, Defias Night Runner, Defias Night Blade, Skeletal Fiend, Skeletal Healer, Skeletal Mage, Skeletal Raider, Skeletal Warder, Skeletal Warrior, Venom Web Spider, Pygmy Venom Web Spider */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (314, 533, 203, 215, 909, 531, 787, 203, 1110, 785, 48, 217, 539); + +/* DUSTWALLOW MARSH */ +/* Mirefin Murloc, Darkmist Spider, Withervine Creeper, Darkfang Creeper, Darkfang Spider, Giant Darkfang Spider, Archmage Tervosh */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (4359, 4376, 4382, 4412, 4413, 4415, 4967); + +/* EASTERN PLAGUELANDS */ +/* Crimson Bodyguard, Crimson Courier, Crypt Walker, Hate Shrieker, Cursed Mage, Shadowmage, Dark Summoner, Scarlet Archmage, Archmage Angela Dosantos */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (13118, 12337, 8556, 8541, 8524, 8550, 8551, 9451, 16116); + +/* ELWYNN FOREST */ +/* Hogger, Defias Rogue Wizard, Defias Enchanter, Defias Bodyguard, Defias Bandit, Defias Cutpurse, Murloc Lurker, Murloc Forager, Forest Spider, Mine Spider */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (448, 474, 910, 6866, 116, 94, 732, 46, 30, 43); + +/* FELWOOD */ +/* Timbermaw Mystic */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (11552); + +/* FERALAS */ +/* Gordunni Ogre Mage, Gordunni Mage-Lord, Woodpaw Mystic, Gordok Ogre-Mage */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (5237, 5239, 5254, 11443); + +/* GNOMEREGAN */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (6206, 6208, 6209, 6215, 6219, 6229, 6228, 6235, 7361, 6407, 6220, 6218, 7603, 6223, 6222, 6234, 6233, 6226, 6227, 6225, 6230, 7079); + +/* */ +/* HELLFIRE CITADEL */ +/* */ + +/* Laughing Skull Legionnaire, Laughing Skull Warden, Laughing Skull Rogue, Hellfire Imp, Shadowmoon Channeler, Fel Orc Neophyte, Shadowmoon Technician, Shadowmoon Adept, Hellfire Familiar, Felguard Brute, Shadowmoon Summoner, Shadowmoon Warlock */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (17626, 17624, 17491, 17477, 17653, 17429, 17414, 17397, 19016, 18894, 17395, 17371); + +/* HELLFIRE RAMPARTS */ +/* Vazruden, Omor the Unscarred, Watchkeeper Gargolmar */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (17537, 17308, 17306); +/* Hellfire Watcher , Bonechewer Hungerer, Bonechewer Beastmaster, Bonechewer Ravener, Bonechewer Ripper, Bonechewer Destroyer, Bleeding Hollow Archer, Bleeding Hollow Darkcaster, Hellfire Sentry , Bleeding Hollow Scryer */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (17309, 17259, 17455, 17264, 17281, 17271, 17270, 17269, 17517, 17478); + +/* SHATTERED HALLS */ +/* Warchief Kargath Bladefist */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (16808); +/* Shattered Hand Centurion, Shadowmoon Darkcaster, Shattered Hand Champion, Sharpshooter Guard, Shattered Hand Assassin, Warbringer O'mrogg, Grand Warlock Nethekurse, Shattered Hand Sharpshooter, Shattered Hand Legionnaire, Shattered Hand Reaver, Shattered Hand Brawler */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (17465, 17694, 17671, 17622, 17695, 16809, 16807, 16704, 16700, 16699, 16593); + + +/* HILLSBRAD FOOTHILLS */ +/* Syndicate Shadow Mage, Elder Moss Creeper, Giant Moss Creeper(also AM), Forest Moss Creeper, Writhing Mage */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (2244, 2348, 2349, 2350, 7075); + +/* HINTERLANDS */ +/* Vilebranch Axe Thrower, Mystic Yayo'jin */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (2639, 14739); + +/* LOCH MODAN */ +/* Mo'grosh Mystic, Tunnel Rat Geomancer, Magosh , Stonesplinter Scout, Stonesplinter Seer, Stonesplinter Geomancer, Stonesplinter Skullthumper, Stonesplinter Bonesnapper, Stonesplinter Shaman, Stonesplinter Digger, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1183, 1174, 1399, 1162, 1166, 1165, 1163, 1164, 1197, 1167); + +/* MULGORE */ +/* Bristleback Shaman, Bristleback Interloper, Bristleback Quilboar, Bristleback Battleboar, Bristleback Interloper, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (2953, 3232, 2952, 2954, 3232); + +/* NAXXRAMAS */ +/* Dread Creeper, Archmage Tarsis Kir-Moldir */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (15974, 16381); + +/* ONYXIA'S LAIR */ +/* Onyxian Whelp */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (11262); + +/* RAZORFEN DOWNS */ +/* Mordresh Fire Eye, Plaguemaw the Rotting, Tuten\'kash, Ragglesnout, Glutton */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (7357, 7356, 7355, 7354, 8567); +/* Skeletal Frostweaver, Skeletal Shadowcaster, Skeletal Summoner, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (7341, 7340, 7342); + +/* REDRIDGE MOUNTAINS */ +/* Blackrock Shadowcaster, Murloc Minor Tidecaller, Murloc Nightcrawler, Murloc Tidecaller, Murloc Scout, Murloc Shorestriker, Shadowhide Darkweaver, Rabid Shadowhide Gnoll, Shadowhide Gnoll, Shadowhide Brute, Shadowhide Warrior, Shadowhide Assassin, Redridge Mystic, Redridge Poacher, Redridge Thrasher, Redridge Basher, Black Dragon Whelp, Tarantula, Greater Tarantula, Blackrock Summoner */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (436, 548, 544, 545, 578, 1083, 422, 429, 434, 433, 432, 568, 579, 430, 424, 712, 446, 441, 442, 505, 4463); + +/* SCARLET MONASTERY */ +/* Fallen Champion, Scarlet Chaplain, Scarlet Adept, Scarlet Wizard, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (6488, 4299, 4296, 4300); + +/* SCHOLOMANCE */ +/* Kirtonos the Herald, Rattlegore, Marduk Blackpool, Risen Guard, Risen Bonewarder, Risen Lackey, Risen Aberration, Risen Warrior, Risen Protector, Risen Construct, Risen Guardian, Diseased Ghoul, Ragged Ghoul, Spectral Projection, Spectral Teacher, Necrofiend, Scholomance Neophyte, Scholomance Acolyte, Scholomance Occultist */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (10506, 11622, 10433, 10489, 10491, 10482, 10485, 10486, 10487, 10488, 11598, 10495, 10497, 11263, 10500, 11551, 10470, 10471, 10472); +/* Scholomance Student, Scholomance Necromancer, Scholomance Adept, Scholomance Handler, Splintered Skeleton, Skulking Corpse, Unstable Corpse, Reanimated Corpse, Aspect of Banality, Aspect of Corruption, Aspect of Malice, Aspect of Shadow, Blood Steward of Kirtonos, Spectral Tutor, Dark Shade, Corrupted Spirit, Malicious Spirit, Banal Spirit, Scholomance Dark Summoner */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (10475, 10477, 10469, 11257, 10478, 10479, 10480, 10481, 14518, 14519, 14520, 14521, 14861, 10498, 11284, 14512, 14513, 14514, 11582); + +/* SEARING GORGE */ +/* Glassweb Spider, Searing Lava Spider, Greater Lava Spider */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (5856, 5857, 5858); + +/* SHADOWFANG KEEP */ +/* Archmage Arugal */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (4275); + + +/* SILITHUS */ +/* Orgrimmar Legion Axe Thrower, Stormwind Archmage */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (15617, 15859); + +/* SILVERPINE FOREST */ +/* Dalaran Apprentice, Dalaran Conjuror, Dalaran Mage, Dalaran Wizard, Rot Hide Mystic, Rot Hide Gladerunner, Rot Hide Brute, Rot Hide Plague Weaver, Rot Hide Savage, Rot Hide Bruiser, Mist Creeper, Dalaran Apprentice, Dalaran Wizard, Dalaran Protector, Dalaran Warder, Dalaran Mage, Dalaran Conjuror, Lake Creeper, Elder Lake Creeper, Vile Fin Shorecreeper, Nightlash, Archmage Ataeric */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1867, 1915, 1914, 1889, 1773, 1772, 1939, 1940, 1942, 1944, 1781, 1867, 1889, 1912, 1913, 1914, 1915, 1955, 1956, 1957, 1983, 2120); + +/* STOCKADES */ +/* Defias Captive, Defias Convict, Defias Inmate, Defias Insurgent, Defias Prisoner, */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1707, 1711, 1708, 1715, 1706); + +/* STONETALON MOUNTAINS */ +/* Deepmoss Creeper */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (4005); + +/* STRANGLETHORN VALE */ +/* Bloodscalp Shaman, Bloodsail Elder Magus, Bloodsail Mage, Bloodsail Warlock, Bloodscalp Axe Thrower, Skullsplitter Axe Thrower, Bloodscalp Mystic, Skullsplitter Mystic */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (697, 1653, 1562, 1564, 694, 696, 701, 780); + +/* STRATHOLME */ +/* Jarien, Aurius, Ash'ari Crystal, Elder Farwhisper, Mindless Undead */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (16101, 10917, 10415, 15607, 11030); + +/* SUNKEN TEMPLE */ +/* Zekkis, Kazkaz the Unholy, Spawn of Hakkar, Shade of Eranikus, Jammal'an the Prophet, Ogom the Wretched, Zolo, Gasher, Loro, Hukku, Zul'Lor, Mijan, Morphaz, Weaver, Dreamscythe, Hazzas, Avatar of Hakkar, Atal'alarion */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (5400, 5401, 5708, 5709, 5710, 5711, 5712, 5713, 5714, 5715, 5716, 5717, 5719, 5720, 5721, 5722, 8443, 8580); +/* Jade, Murk Slitherer, Murk Spitter, Murk Worm, Saturated Ooze, Fungal Ooze, Cursed Atal'ai, Atal'ai Witch Doctor, Enthralled Atal'ai, Mummified Atal'ai, Unliving Atal'ai, Atal'ai Priest, Atal'ai Corpse Eater, Atal'ai Deathwalker, Atal'ai High Priest, Nightmare Scalebane, Nightmare Wyrmkin, Nightmare Wanderer, Hakkari Frostwing, Nightmare Whelp, Atal'ai Skeleton, Hakkari Sapper, Hakkari Minion, Hakkari Bloodkeeper, Nightmare Suppressor */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1063, 5224, 5225, 5226, 5228, 5235, 5243, 5259, 5261, 5263, 5267, 5269, 5270, 5271, 5273, 5277, 5280, 5283, 5291, 8319, 8324, 8336, 8437, 8438, 8497); + +/* SWAMP OF SORROWS */ +/* Marsh Murloc, Adolescent Whelp, Dreaming Whelp, Wyrmkin Dreamwalker, Scalebane Captain, Deathstrike Tarantula */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (747, 740, 741, 743, 745, 769); + +/* TANARIS */ +/* Dunemaul Ogre Mage, Wastewander Shadow Mage, Sandfury Axe Thrower */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (5473, 5617, 5646); + +/* TELDRASSIL */ +/* Gnarlpine Mystic, Gnarlpine Pathfinder, Bloodfeather Sorceress, Webwood Spider, Giant Webwood Spider */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (7235, 2012, 2018, 1986, 2001); + +/* TIRISFAL GLADES */ +/* Scarlet Neophyte, Rot Hide Gnoll, Young Night Web Spider, Night Web Spider, Vicious Night Web Spider */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1539, 1674, 1504, 1505, 1555); + +/* UN'GORO CRATER */ +/* Tar Creeper */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (6527); + +/* WAILING CAVERNS */ +/* Deviate Creeper */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (3632); + +/* WESTERN PLAGUELANDS */ +/* Skeletal Acolyte, Skeletal Flayer, Skeletal Sorcerer, Scarlet Mage, Araj the Summoner */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1789, 1783, 1784, 1826, 1852); + +/* WESTFALL */ +/* Defias Pillager, Defias Smuggler, Defias Trapper, Defias Highwayman, Defias Knuckleduster, Defias Pathstalker, Defias Looter, Murloc Oracle, Murloc Hunter, Murloc Warrior, Murloc Tidehunter, Murloc Coastrunner, Riverpaw Scout, Riverpaw Mongrel, Riverpaw Brute, Riverpaw Herbalist, Defias Renegade Mage, Riverpaw Mystic */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (589, 95, 504, 122, 449, 121, 590, 517, 458, 171, 127, 126, 500, 123, 124, 501, 450, 453); + +/* WETLANDS */ +/* Bluegill Forager, Bluegill Murloc, Bluegill Muckdweller, Bluegill Raider, Bluegill Warrior, Bluegill Oracle, Mosshide Mistweaver, Mosshide Mystic, Mosshide Trapper, Mosshide Mongrel, Mosshide Gnoll, Fen Creeper, Red Whelp, Lost Whelp, Flamesnorting Whelp, Crimson Whelp */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (1026, 1024, 1028, 1418, 1027, 1029, 1009, 1013, 1011, 1008, 1007, 1040, 1042, 1043, 1044, 1069); + +/* WINTERSPRING */ +/* Cobalt Mageweaver, Chillwind Chimaera */ +UPDATE `creature_template` SET `ScriptName` = 'generic_creature' WHERE `entry` IN (7437, 7448); + + +/* EOF */ diff --git a/sql/scriptdev2_create_database.sql b/sql/scriptdev2_create_database.sql new file mode 100644 index 0000000..1e01380 --- /dev/null +++ b/sql/scriptdev2_create_database.sql @@ -0,0 +1,4 @@ +CREATE DATABASE `scriptdev2` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; + +GRANT ALL PRIVILEGES ON `scriptdev2` . * TO 'mangos'@'localhost' WITH GRANT OPTION; + diff --git a/sql/scriptdev2_create_structure_mysql.sql b/sql/scriptdev2_create_structure_mysql.sql new file mode 100644 index 0000000..52376dd --- /dev/null +++ b/sql/scriptdev2_create_structure_mysql.sql @@ -0,0 +1,72 @@ +DROP TABLE IF EXISTS `custom_texts`; +CREATE TABLE `custom_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `language` tinyint(3) unsigned NOT NULL DEFAULT '0', + `emote` smallint(5) unsigned NOT NULL DEFAULT '0', + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Custom Texts'; + +DROP TABLE IF EXISTS `gossip_texts`; +CREATE TABLE `gossip_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gossip Texts'; + +DROP TABLE IF EXISTS `script_texts`; +CREATE TABLE `script_texts` ( + `entry` mediumint(8) NOT NULL, + `content_default` text NOT NULL, + `content_loc1` text, + `content_loc2` text, + `content_loc3` text, + `content_loc4` text, + `content_loc5` text, + `content_loc6` text, + `content_loc7` text, + `content_loc8` text, + `sound` mediumint(8) unsigned NOT NULL DEFAULT '0', + `type` tinyint(3) unsigned NOT NULL DEFAULT '0', + `language` tinyint(3) unsigned NOT NULL DEFAULT '0', + `emote` smallint(5) unsigned NOT NULL DEFAULT '0', + `comment` text, + PRIMARY KEY (`entry`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Texts'; + +DROP TABLE IF EXISTS script_waypoint; +CREATE TABLE script_waypoint ( + entry mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT 'creature_template entry', + pointid mediumint(8) unsigned NOT NULL DEFAULT '0', + location_x float NOT NULL DEFAULT '0', + location_y float NOT NULL DEFAULT '0', + location_z float NOT NULL DEFAULT '0', + waittime int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'waittime in millisecs', + point_comment text, + PRIMARY KEY (entry, pointid) +) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; + +DROP TABLE IF EXISTS `sd2_db_version`; +CREATE TABLE `sd2_db_version` ( + `version` varchar(255) NOT NULL default '' COMMENT 'Database version string' +) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/sql/scriptdev2_create_structure_pgsql.sql b/sql/scriptdev2_create_structure_pgsql.sql new file mode 100644 index 0000000..523385f --- /dev/null +++ b/sql/scriptdev2_create_structure_pgsql.sql @@ -0,0 +1,67 @@ +CREATE TABLE custom_texts ( + entry bigint NOT NULL, + content_default text NOT NULL, + content_loc1 text, + content_loc2 text, + content_loc3 text, + content_loc4 text, + content_loc5 text, + content_loc6 text, + content_loc7 text, + content_loc8 text, + sound integer DEFAULT 0 NOT NULL, + type smallint DEFAULT (0)::smallint NOT NULL, + language smallint DEFAULT (0)::smallint NOT NULL, + emote smallint DEFAULT (0)::smallint NOT NULL, + comment text, + PRIMARY KEY(entry) +); + +CREATE TABLE gossip_texts ( + entry bigint NOT NULL, + content_default text NOT NULL, + content_loc1 text, + content_loc2 text, + content_loc3 text, + content_loc4 text, + content_loc5 text, + content_loc6 text, + content_loc7 text, + content_loc8 text, + comment text, + PRIMARY KEY(entry) +); + +CREATE TABLE script_texts ( + entry bigint NOT NULL, + content_default text NOT NULL, + content_loc1 text, + content_loc2 text, + content_loc3 text, + content_loc4 text, + content_loc5 text, + content_loc6 text, + content_loc7 text, + content_loc8 text, + sound integer DEFAULT 0 NOT NULL, + type smallint DEFAULT (0)::smallint NOT NULL, + language smallint DEFAULT (0)::smallint NOT NULL, + emote smallint DEFAULT (0)::smallint NOT NULL, + comment text, + PRIMARY KEY(entry) +); + +CREATE TABLE script_waypoint ( + entry bigint NOT NULL, + pointid bigint NOT NULL, + location_x float DEFAULT (0)::float NOT NULL, + location_y float DEFAULT (0)::float NOT NULL, + location_z float DEFAULT (0)::float NOT NULL, + waittime integer DEFAULT 0 NOT NULL, + point_comment text, + PRIMARY KEY(entry,pointid) +); + +CREATE TABLE sd2_db_version ( + version varchar(255) NOT NULL DEFAULT '' +); diff --git a/sql/scriptdev2_script_full.sql b/sql/scriptdev2_script_full.sql new file mode 100644 index 0000000..4a951e2 --- /dev/null +++ b/sql/scriptdev2_script_full.sql @@ -0,0 +1,4686 @@ +-- +-- Version data (part used in command .server info ) +-- + +DELETE FROM sd2_db_version; +INSERT INTO sd2_db_version (version) VALUES ('ScriptDev2 (for MaNGOS 10610+) '); + +-- +-- Below contains data for table `script_texts` mainly used in C++ parts. +-- valid entries for table are between -1000000 and -1999999 +-- + +TRUNCATE script_texts; + +-- +-- -1 000 000 First 100 entries are reserved for special use, do not add regular text here. +-- + +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000000,'',0,0,0,0,'DEFAULT_TEXT'), +(-1000001,'%s goes into a killing frenzy!',0,2,0,0,'EMOTE_GENERIC_FRENZY_KILL'), +(-1000002,'%s goes into a frenzy!',0,2,0,0,'EMOTE_GENERIC_FRENZY'), +(-1000003,'%s becomes enraged!',0,2,0,0,'EMOTE_GENERIC_ENRAGED'), +(-1000004,'%s goes into a berserker rage!',0,2,0,0,'EMOTE_GENERIC_BERSERK'), +(-1000005,'%s goes into a frenzy!',0,3,0,0,'EMOTE_BOSS_GENERIC_FRENZY'); + +-- +-- Normal text entries below. Say/Yell/Whisper/Emote for any regular world object. +-- Text entries for text used by creatures in instances are using map id as part of entry. +-- Example: for map 430, the database text entry for all creatures normally on this map start with -1430 +-- Values decrement as they are made. +-- For creatures outside instance, use -1 000 100 and below. Decrement value as they are made. +-- +-- Comment should contain a unique name that can be easily identified later by using sql queries like for example +-- SELECT * FROM script_texts WHERE comment LIKE '%defias%'; +-- Place the define used in script itself at the end of the comment. +-- +-- Do not change entry without a very good reason. Localization projects depends on using entries that does not change! +-- Example: UPDATE script_texts SET content_loc1 = 'the translated text' WHERE entry = -1000100; +-- + +-- -1 000 100 GENERAL MAPS (not instance maps) +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1000100,'Come, little ones. Face me!',0,1,0,0,'azuregos SAY_TELEPORT'), + +(-1000101,'Follow me, $N. I\'ll take you to the Defias hideout. But you better protect me or I am as good as dead',0,0,7,0,'defias traitor SAY_START'), +(-1000102,'The entrance is hidden here in Moonbrook. Keep your eyes peeled for thieves. They want me dead.',0,0,7,0,'defias traitor SAY_PROGRESS'), +(-1000103,'You can go tell Stoutmantle this is where the Defias Gang is holed up, $N.',0,0,7,0,'defias traitor SAY_END'), +(-1000104,'%s coming in fast! Prepare to fight!',0,0,7,0,'defias traitor SAY_AGGRO_1'), +(-1000105,'Help!',0,0,7,0,'defias traitor SAY_AGGRO_2'), + +(-1000106,'Everyone ready?',0,0,1,0,'torek SAY_READY'), +(-1000107,'Ok, Lets move out!',0,0,1,0,'torek SAY_MOVE'), +(-1000108,'Prepare yourselves. Silverwing is just around the bend.',0,0,1,0,'torek SAY_PREPARE'), +(-1000109,'Silverwing is ours!',0,0,1,0,'torek SAY_WIN'), +(-1000110,'Go report that the outpost is taken. We will remain here.',0,0,1,0,'torek SAY_END'), + +(-1000111,'Our house is this way, through the thicket.',0,0,7,0,'magwin SAY_START'), +(-1000112,'Help me!',0,0,7,0,'magwin SAY_AGGRO'), +(-1000113,'My poor family. Everything has been destroyed.',0,0,7,0,'magwin SAY_PROGRESS'), +(-1000114,'Father! Father! You\'re alive!',0,0,7,0,'magwin SAY_END1'), +(-1000115,'You can thank $N for getting me back here safely, father.',0,0,7,0,'magwin SAY_END2'), +(-1000116,'%s hugs her father.',0,2,7,0,'magwin EMOTE_HUG'), + +(-1000117,'Thank you for agreeing to help. Now, let\'s get out of here $N.',0,0,1,0,'wounded elf SAY_ELF_START'), +(-1000118,'Over there! They\'re following us!',0,0,1,0,'wounded elf SAY_ELF_SUMMON1'), +(-1000119,'Allow me a moment to rest. The journey taxes what little strength I have.',0,0,1,16,'wounded elf SAY_ELF_RESTING'), +(-1000120,'Did you hear something?',0,0,1,0,'wounded elf SAY_ELF_SUMMON2'), +(-1000121,'Falcon Watch, at last! Now, where\'s my... Oh no! My pack, it\'s missing! Where has -',0,0,1,0,'wounded elf SAY_ELF_COMPLETE'), +(-1000122,'You won\'t keep me from getting to Falcon Watch!',0,0,1,0,'wounded elf SAY_ELF_AGGRO'), + +(-1000123,'Ready when you are, $c.',0,0,0,15,'big will SAY_BIG_WILL_READY'), +(-1000124,'The Affray has begun. $n, get ready to fight!',0,0,0,0,'twiggy SAY_TWIGGY_BEGIN'), +(-1000125,'You! Enter the fray!',0,0,0,0,'twiggy SAY_TWIGGY_FRAY'), +(-1000126,'Challenger is down!',0,0,0,0,'twiggy SAY_TWIGGY_DOWN'), +(-1000127,'The Affray is over.',0,0,0,0,'twiggy SAY_TWIGGY_OVER'), + +(-1000128,'We need you to send reinforcements to Manaforge Duro, Ardonis. This is not a request, it\'s an order.',0,0,0,0,'dawnforge SAY_COMMANDER_DAWNFORGE_1'), +(-1000129,'You cannot be serious! We are severely understaffed and can barely keep this manaforge functional!',0,0,0,0,'dawnforge SAY_ARCANIST_ARDONIS_1'), +(-1000130,'You will do as ordered. Manaforge Duro has come under heavy attack by mana creatures and the situation is out of control. Failure to comply will not be tolerated!',0,0,0,0,'dawnforge SAY_COMMANDER_DAWNFORGE_2'), +(-1000131,'Indeed, it is not a request.',0,0,0,0,'dawnforge SAY_PATHALEON_CULATOR_IMAGE_1'), +(-1000132,'My lord!',0,0,0,0,'dawnforge SAY_COMMANDER_DAWNFORGE_3'), +(-1000133,'Duro will be reinforced! Ultris was a complete disaster. I will NOT have that mistake repeated!',0,0,0,0,'dawnforge PATHALEON_CULATOR_IMAGE_2'), +(-1000134,'We\'ve had too many setbacks along the way: Hellfire Citadel, Fallen Sky Ridge, Firewing Point... Prince Kael\'thas will tolerate no further delays. I will tolerate nothing other than complete success!',0,0,0,0,'dawnforge PATHALEON_CULATOR_IMAGE_2_1'), +(-1000135,'I am returning to Tempest Keep. See to it that I do not have reason to return!',0,0,0,0,'dawnforge PATHALEON_CULATOR_IMAGE_2_2' ), +(-1000136,'Yes, my lord.',0,0,0,0,'dawnforge COMMANDER_DAWNFORGE_4 SAY_ARCANIST_ARDONIS_2'), +(-1000137,'See to it, Ardonis!',0,0,0,0,'dawnforge COMMANDER_DAWNFORGE_5'), + +(-1000138,'Avruu\'s magic... it still controls me. You must fight me, mortal. It\'s the only way to break the spell!',0,0,0,0,'aeranas SAY_SUMMON'), +(-1000139,'Avruu\'s magic is broken! I\'m free once again!',0,0,0,0,'aeranas SAY_FREE'), + +(-1000140,'Let\'s go.',0,0,1,0,'lilatha SAY_START'), +(-1000141,'$N, let\'s use the antechamber to the right.',0,0,1,0,'lilatha SAY_PROGRESS1'), +(-1000142,'I can see the light at the end of the tunnel!',0,0,1,0,'lilatha SAY_PROGRESS2'), +(-1000143,'There\'s Farstrider Enclave now, $C. Not far to go... Look out! Troll ambush!!',0,0,1,0,'lilatha SAY_PROGRESS3'), +(-1000144,'Thank you for saving my life and bringing me back to safety, $N',0,0,1,0,'lilatha SAY_END1'), +(-1000145,'Captain Helios, I\'ve been rescued from the Amani Catacombs. Reporting for duty, sir!',0,0,1,0,'lilatha SAY_END2'), +(-1000146,'Liatha, get someone to look at those injuries. Thank you for bringing her back safely.',0,0,1,0,'lilatha CAPTAIN_ANSWER'), + +(-1000147,'I remember well the sting of defeat at the conclusion of the Third War. I have waited far too long for my revenge. Now the shadow of the Legion falls over this world. It is only a matter of time until all of your failed creation... is undone.',11332,1,0,0,'kazzak SAY_INTRO'), +(-1000148,'The Legion will conquer all!',11333,1,0,0,'kazzak SAY_AGGRO1'), +(-1000149,'All mortals will perish!',11334,1,0,0,'kazzak SAY_AGGRO2'), +(-1000150,'All life must be eradicated!',11335,1,0,0,'kazzak SAY_SURPREME1'), +(-1000151,'I\'ll rip the flesh from your bones!',11336,1,0,0,'kazzak SAY_SURPREME2'), +(-1000152,'Kirel Narak!',11337,1,0,0,'kazzak SAY_KILL1'), +(-1000153,'Contemptible wretch!',11338,1,0,0,'kazzak SAY_KILL2'), +(-1000154,'The universe will be remade.',11339,1,0,0,'kazzak SAY_KILL3'), +(-1000155,'The Legion... will never... fall.',11340,1,0,0,'kazzak SAY_DEATH'), +(-1000156,'REUSE ME',0,0,0,0,'REUSE ME'), +(-1000157,'Invaders, you dangle upon the precipice of oblivion! The Burning Legion comes and with it comes your end.',0,1,0,0,'kazzak SAY_RAND1'), +(-1000158,'Impudent whelps, you only delay the inevitable. Where one has fallen, ten shall rise. Such is the will of Kazzak...',0,1,0,0,'kazzak SAY_RAND2'), + +(-1000159,'Do not proceed. You will be eliminated!',11344,1,0,0,'doomwalker SAY_AGGRO'), +(-1000160,'Tectonic disruption commencing.',11345,1,0,0,'doomwalker SAY_EARTHQUAKE_1'), +(-1000161,'Magnitude set. Release.',11346,1,0,0,'doomwalker SAY_EARTHQUAKE_2'), +(-1000162,'Trajectory locked.',11347,1,0,0,'doomwalker SAY_OVERRUN_1'), +(-1000163,'Engage maximum speed.',11348,1,0,0,'doomwalker SAY_OVERRUN_2'), +(-1000164,'Threat level zero.',11349,1,0,0,'doomwalker SAY_SLAY_1'), +(-1000165,'Directive accomplished.',11350,1,0,0,'doomwalker SAY_SLAY_2'), +(-1000166,'Target exterminated.',11351,1,0,0,'doomwalker SAY_SLAY_3'), +(-1000167,'System failure in five, f-o-u-r...',11352,1,0,0,'doomwalker SAY_DEATH'), + +(-1000168,'Who dares awaken Aquementas?',0,1,0,0,'aquementas AGGRO_YELL_AQUE'), + +(-1000169,'Muahahahaha! You fool! You\'ve released me from my banishment in the interstices between space and time!',0,1,0,0,'nether_drake SAY_NIHIL_1'), +(-1000170,'All of Draenor shall quick beneath my feet! I will destroy this world and reshape it in my image!',0,1,0,0,'nether_drake SAY_NIHIL_2'), +(-1000171,'Where shall I begin? I cannot bother myself with a worm such as yourself. There is a world to be conquered!',0,1,0,0,'nether_drake SAY_NIHIL_3'), +(-1000172,'No doubt the fools that banished me are long dead. I shall take wing survey my demense. Pray to whatever gods you hold dear that we do not meet again.',0,1,0,0,'nether_drake SAY_NIHIL_4'), +(-1000173,'NOOOOooooooo!',0,1,0,0,'nether_drake SAY_NIHIL_INTERRUPT'), + +(-1000174,'Good $N, you are under the spell\'s influence. I must analyze it quickly, then we can talk.',0,0,7,0,'daranelle SAY_SPELL_INFLUENCE'), + +(-1000175,'Thank you, mortal.',0,0,11,0,' SAY_JUST_EATEN'), + +(-1000176,'The last thing I remember is the ship falling and us getting into the pods. I\'ll go see how I can help. Thank you!',0,0,7,0,'draenei_survivor SAY_HEAL1'), +(-1000177,'$C, Where am I? Who are you? Oh no! What happened to the ship?',0,0,7,0,'draenei_survivor SAY_HEAL2'), +(-1000178,'$C You saved me! I owe you a debt that I can never repay. I\'ll go see if I can help the others.',0,0,7,0,'draenei_survivor SAY_HEAL3'), +(-1000179,'Ugh... what is this place? Is that all that\'s left of the ship over there?',0,0,7,0,'draenei_survivor SAY_HEAL4'), +(-1000180,'Oh, the pain...',0,0,7,0,'draenei_survivor SAY_HELP1'), +(-1000181,'Everything hurts, Please make it stop...',0,0,7,0,'draenei_survivor SAY_HELP2'), +(-1000182,'Ughhh... I hurt. Can you help me?',0,0,7,0,'draenei_survivor SAY_HELP3'), +(-1000183,'I don\'t know if I can make it, please help me...',0,0,7,0,'draenei_survivor SAY_HELP4'), + +(-1000184,'Yes Master, all goes along as planned.',0,0,7,0,'engineer_spark SAY_TEXT'), +(-1000185,'%s puts the shell to his ear.',0,2,7,0,'engineer_spark EMOTE_SHELL'), +(-1000186,'Now I cut you!',0,1,7,0,'engineer_spark SAY_ATTACK'), + +(-1000187,'Thank you, dear $C, you just saved my life.',0,0,7,0,'faulk SAY_HEAL'), + +(-1000188,'Deployment sucessful. Trespassers will be neutralized.',0,0,0,0,'converted_sentry SAY_CONVERTED_1'), +(-1000189,'Objective acquired. Initiating security routines.',0,0,0,0,'converted_sentry SAY_CONVERTED_2'), + +(-1000190,'In Nagrand, food hunt ogre!',0,0,0,0,' SAY_LUMP_0'), +(-1000191,'You taste good with maybe a little salt and pepper.',0,0,0,0,' SAY_LUMP_1'), +(-1000192,'OK, OK! Lump give up!',0,0,0,0,' SAY_LUMP_DEFEAT'), + +(-1000193,'Thank you, dear $C, you just saved my life.',0,0,1,0,'stillblade SAY_HEAL'), + +(-1000194,'I give up! Please don\'t kill me!',0,0,0,0,'unkor SAY_SUBMIT'), + +(-1000195,'I choose the third option: KILLING YOU!',0,0,0,0,'floon SAY_FLOON_ATTACK'), + +(-1000196,'Belore...',0,0,1,0,'lady_sylvanas SAY_LAMENT_END'), +(-1000197,'%s kneels down and pick up the amulet.',0,2,1,0,'lady_sylvanas EMOTE_LAMENT_END'), + +(-1000198,'Taste blade, mongrel!',0,0,0,0,'SAY_GUARD_SIL_AGGRO1'), +(-1000199,'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...',0,0,0,0,'SAY_GUARD_SIL_AGGRO2'), +(-1000200,'As if we don\'t have enough problems, you go and create more!',0,0,0,0,'SAY_GUARD_SIL_AGGRO3'), + +(-1000201,'I\'m saved! Thank you, doctor!',0,0,0,0,'injured_patient SAY_DOC1'), +(-1000202,'HOORAY! I AM SAVED!',0,0,0,0,'injured_patient SAY_DOC2'), +(-1000203,'Sweet, sweet embrace... take me...',0,0,0,0,'injured_patient SAY_DOC3'), + +(-1000204,'%s looks up at you quizzically. Maybe you should inspect it?',0,2,0,0,'cluck EMOTE_A_HELLO'), +(-1000205,'%s looks at you unexpectadly.',0,2,0,0,'cluck EMOTE_H_HELLO'), +(-1000206,'%s starts pecking at the feed.',0,2,0,0,'cluck EMOTE_CLUCK_TEXT2'), + +(-1000207,'You have my blessing',0,0,0,0,'ashyen_and_keleth SAY_REWARD_BLESS'), + +(-1000208,'Frenzyheart kill you if you come back. You no welcome here no more!',0,0,0,0,'vekjik SAY_TEXTID_VEKJIK1'), + +(-1000209,'Very well. Let\'s see what you have to show me, $N.',0,0,1,0,'anvilward SAY_ANVIL1'), +(-1000210,'What manner of trick is this, $R? If you seek to ambush me, I warn you I will not go down quietly!',0,0,1,0,'anvilward SAY_ANVIL2'), + +(-1000211,'Warning! %s emergency shutdown process initiated by $N. Shutdown will complete in two minutes.',0,2,0,0,'manaforge_control EMOTE_START'), +(-1000212,'Emergency shutdown will complete in one minute.',0,2,0,0,'manaforge_control EMOTE_60'), +(-1000213,'Emergency shutdown will complete in thirty seconds.',0,2,0,0,'manaforge_control EMOTE_30'), +(-1000214,'Emergency shutdown will complete in ten seconds.',0,2,0,0,'manaforge_control EMOTE_10'), +(-1000215,'Emergency shutdown complete.',0,2,0,0,'manaforge_control EMOTE_COMPLETE'), +(-1000216,'Emergency shutdown aborted.',0,2,0,0,'manaforge_control EMOTE_ABORT'), + +(-1000217,'Greetings, $N. I will guide you through the cavern. Please try and keep up.',0,4,0,0,'WHISPER_CUSTODIAN_1'), +(-1000218,'We do not know if the Caverns of Time have always been accessible to mortals. Truly, it is impossible to tell as the Timeless One is in perpetual motion, changing our timeways as he sees fit. What you see now may very well not exist tomorrow. You may wake up and have no memory of this place.',0,4,0,0,'WHISPER_CUSTODIAN_2'), +(-1000219,'It is strange, I know... Most mortals cannot actually comprehend what they see here, as often, what they see is not anchored within their own perception of reality.',0,4,0,0,'WHISPER_CUSTODIAN_3'), +(-1000220,'Follow me, please.',0,4,0,0,'WHISPER_CUSTODIAN_4'), +(-1000221,'There are only two truths to be found here: First, that time is chaotic, always in flux, and completely malleable and second, perception does not dictate reality.',0,4,0,0,'WHISPER_CUSTODIAN_5'), +(-1000222,'As custodians of time, we watch over and care for Nozdormu\'s realm. The master is away at the moment, which means that attempts are being made to dramatically alter time. The master never meddles in the affairs of mortals but instead corrects the alterations made to time by others. He is reactionary in this regard.',0,4,0,0,'WHISPER_CUSTODIAN_6'), +(-1000223,'For normal maintenance of time, the Keepers of Time are sufficient caretakers. We are able to deal with most ordinary disturbances. I speak of little things, such as rogue mages changing something in the past to elevate their status or wealth in the present.',0,4,0,0,'WHISPER_CUSTODIAN_7'), +(-1000224,'These tunnels that you see are called timeways. They are infinite in number. The ones that currently exist in your reality are what the master has deemed as \'trouble spots.\' These trouble spots may differ completely in theme but they always share a cause. That is, their existence is a result of the same temporal disturbance. Remember that should you venture inside one...',0,4,0,0,'WHISPER_CUSTODIAN_8'), +(-1000225,'This timeway is in great disarray! We have agents inside right now attempting to restore order. What information I have indicates that Thrall\'s freedom is in jeopardy. A malevolent organization known as the Infinite Dragonflight is trying to prevent his escape. I fear without outside assistance, all will be lost.',0,4,0,0,'WHISPER_CUSTODIAN_9'), +(-1000226,'We have very little information on this timeway. Sa\'at has been dispatched and is currently inside. The data we have gathered from his correspondence is that the Infinite Dragonflight are once again attempting to alter time. Could it be that the opening of the Dark Portal is being targeted for sabotage? Let us hope not...',0,4,0,0,'WHISPER_CUSTODIAN_10'), +(-1000227,'This timeway is currently collapsing. What that may hold for the past, present and future is currently unknown...',0,4,0,0,'WHISPER_CUSTODIAN_11'), +(-1000228,'The timeways are currently ranked in order from least catastrophic to most catastrophic. Note that they are all classified as catastrophic, meaning that any single one of these timeways collapsing would mean that your world would end. We only classify them in such a way so that the heroes and adventurers that are sent here know which timeway best suits their abilities.',0,4,0,0,'WHISPER_CUSTODIAN_12'), +(-1000229,'All we know of this timeway is that it leads to Mount Hyjal. The Infinite Dragonflight have gone to great lengths to prevent our involvement. We know next to nothing, mortal. Soridormi is currently attempting to break through the timeway\'s defenses but has thus far been unsuccessful. You might be our only hope of breaking through and resolving the conflict.',0,4,0,0,'WHISPER_CUSTODIAN_13'), +(-1000230,'Our time is at an end $N. I would wish you luck, if such a thing existed.',0,4,0,0,'WHISPER_CUSTODIAN_14'), + +(-1000231,'Ah, $GPriest:Priestess; you came along just in time. I appreciate it.',0,0,0,20,'garments SAY_COMMON_HEALED'), +(-1000232,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those gnolls with your power to back me!',0,0,1,4,'garments SAY_DG_KEL_THANKS'), +(-1000233,'Farewell to you, and may shadow always protect you!',0,0,1,3,'garments SAY_DG_KEL_GOODBYE'), + +(-1000234,'Follow me, stranger. This won\'t take long.',0,0,0,0,'SAY_KHAD_SERV_0'), +(-1000235,'Shattrath was once the draenei capital of this world. Its name means "dwelling of light."',0,4,0,0,'SAY_KHAD_SERV_1'), +(-1000236,'When the Burning Legion turned the orcs against the draenei, the fiercest battle was fought here. The draenei fought tooth and nail, but in the end the city fell.',0,4,0,0,'SAY_KHAD_SERV_2'), +(-1000237,'The city was left in ruins and darkness... until the Sha\'tar arrived.',0,4,0,0,'SAY_KHAD_SERV_3'), +(-1000238,'Let us go into the Lower City. I will warn you that as one of the only safe havens in Outland, Shattrath has attracted droves of refugees from all wars, current and past.',0,4,0,0,'SAY_KHAD_SERV_4'), +(-1000239,'The Sha\'tar, or "born from light" are the naaru that came to Outland to fight the demons of the Burning Legion.',0,4,0,0,'SAY_KHAD_SERV_5'), +(-1000240,'They were drawn to the ruins of Shattrath City where a small remnant of the draenei priesthood conducted its rites inside a ruined temple on this very spot.',0,4,0,0,'SAY_KHAD_SERV_6'), +(-1000241,'The priesthood, known as the Aldor, quickly regained its strength as word spread that the naaru had returned and reconstruction soon began. The ruined temple is now used as an infirmary for injured refugees.',0,4,0,0,'SAY_KHAD_SERV_7'), +(-1000242,'It wouldn\'t be long, however, before the city came under attack once again. This time, the attack came from Illidan\'s armies. A large regiment of blood elves had been sent by Illidan\'s ally, Kael\'thas Sunstrider, to lay waste to the city.',0,4,0,0,'SAY_KHAD_SERV_8'), +(-1000243,'As the regiment of blood elves crossed this very bridge, the Aldor\'s exarchs and vindicators lined up to defend the Terrace of Light. But then the unexpected happened.',0,4,0,0,'SAY_KHAD_SERV_9'), +(-1000244,'The blood elves laid down their weapons in front of the city\'s defenders; their leader, a blood elf elder known as Voren\'thal, stormed into the Terrace of Light and demanded to speak to A\'dal.',0,4,0,0,'SAY_KHAD_SERV_10'), +(-1000245,'As the naaru approached him, Voren\'thal kneeled before him and uttered the following words: "I\'ve seen you in a vision, naaru. My race\'s only hope for survival lies with you. My followers and I are here to serve you."',0,4,0,0,'SAY_KHAD_SERV_11'), +(-1000246,'The defection of Voren\'thal and his followers was the largest loss ever incurred by Kael\'s forces. And these weren\'t just any blood elves. Many of the best and brightest amongst Kael\'s scholars and magisters had been swayed by Voren\'thal\'s influence.',0,4,0,0,'SAY_KHAD_SERV_12'), +(-1000247,'The naaru accepted the defectors, who would become known as the Scryers; their dwelling lies in the platform above. Only those initiated with the Scryers are allowed there.',0,4,0,0,'SAY_KHAD_SERV_13'), +(-1000248,'The Aldor are followers of the Light and forgiveness and redemption are values they understand. However, they found hard to forget the deeds of the blood elves while under Kael\'s command.',0,4,0,0,'SAY_KHAD_SERV_14'), +(-1000249,'Many of the priesthood had been slain by the same magisters who now vowed to serve the naaru. They were not happy to share the city with their former enemies.',0,4,0,0,'SAY_KHAD_SERV_15'), +(-1000250,'The Aldor\'s most holy temple and its surrounding dwellings lie on the terrace above. As a holy site, only the initiated are welcome inside.',0,4,0,0,'SAY_KHAD_SERV_16'), +(-1000251,'The attacks against Shattrath continued, but the city did not fall\, as you can see. On the contrary, the naaru known as Xi\'ri led a successful incursion into Shadowmoon Valley - Illidan\'s doorstep.',0,4,0,0,'SAY_KHAD_SERV_17'), +(-1000252,'There he continues to wage war on Illidan with the assistance of the Aldor and the Scryers. The two factions have not given up on their old feuds, though.',0,4,0,0,'SAY_KHAD_SERV_18'), +(-1000253,'Such is their animosity that they vie for the honor of being sent to assist the naaru there. Each day, that decision is made here by A\'dal. The armies gather here to receive A\'dal\'s blessing before heading to Shadowmoon.',0,4,0,0,'SAY_KHAD_SERV_19'), +(-1000254,'Khadgar should be ready to see you again. Just remember that to serve the Sha\'tar you will most likely have to ally with the Aldor or the Scryers. And seeking the favor of one group will cause the others\' dislike.',0,4,0,0,'SAY_KHAD_SERV_20'), +(-1000255,'Good luck stranger, and welcome to Shattrath City.',0,4,0,0,'SAY_KHAD_SERV_21'), + +(-1000256,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those murlocs with the Light on my side!',0,0,7,4,'garments SAY_ROBERTS_THANKS'), +(-1000257,'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_ROBERTS_GOODBYE'), +(-1000258,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those humans with your power to back me!',0,0,1,4,'garments SAY_KORJA_THANKS'), +(-1000259,'Farewell to you, and may our ancestors be with you always!',0,0,1,3,'garments SAY_KORJA_GOODBYE'), +(-1000260,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those wendigo with the Light on my side!',0,0,7,4,'garments SAY_DOLF_THANKS'), +(-1000261,'Farewell to you, and may the Light be with you always.',0,0,7,3,'garments SAY_DOLF_GOODBYE'), +(-1000262,'Thank you! Thank you, $GPriest:Priestess;. Now I can take on those corrupt timberlings with Elune\'s power behind me!',0,0,2,4,'garments SAY_SHAYA_THANKS'), +(-1000263,'Farewell to you, and may Elune be with you always.',0,0,2,3,'garments SAY_SHAYA_GOODBYE'), + +(-1000264,'Ok, $N. Follow me to the cave where I\'ll attempt to harness the power of the rune stone into these goggles.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_1'), +(-1000265,'I discovered this cave on our first day here. I believe the energy in the stone can be used to our advantage.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_2'), +(-1000266,'I\'ll begin drawing energy from the stone. Your job, $N, is to defend me. This place is cursed... trust me.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_3'), +(-1000267,'%s begins tinkering with the goggles before the stone.',0,2,0,0,'phizzlethorpe EMOTE_PROGRESS_4'), +(-1000268,'Help!!! Get these things off me so I can get my work done!',0,0,0,0,'phizzlethorpe SAY_AGGRO'), +(-1000269,'Almost done! Just a little longer!',0,0,0,1,'phizzlethorpe SAY_PROGRESS_5'), +(-1000270,'I\'ve done it! I have harnessed the power of the stone into the goggles! Let\'s get out of here!',0,0,0,1,'phizzlethorpe SAY_PROGRESS_6'), +(-1000271,'Phew! Glad to be back from that creepy cave.',0,0,0,1,'phizzlethorpe SAY_PROGRESS_7'), +(-1000272,'%s hands one glowing goggles over to Doctor Draxlegauge.',0,2,0,0,'phizzlethorpe EMOTE_PROGRESS_8'), +(-1000273,'Doctor Draxlegauge will give you further instructions, $N. Many thanks for your help!',0,0,0,1,'phizzlethorpe SAY_PROGRESS_9'), + +(-1000274,'Time to teach you a lesson in manners, little $Gboy:girl;!',0,0,0,0,'larry SAY_START'), +(-1000275,'Now I\'m gonna give you to the count of \'3\' to get out of here before I sick the dogs on you.',0,0,0,0,'larry SAY_COUNT'), +(-1000276,'1...',0,0,0,0,'larry SAY_COUNT_1'), +(-1000277,'2...',0,0,0,0,'larry SAY_COUNT_2'), +(-1000278,'Time to meet your maker!',0,0,0,0,'larry SAY_ATTACK_5'), +(-1000279,'Alright, we give up! Don\'t hurt us!',0,0,0,0,'larry SAY_GIVEUP'), + +(-1000280,'A shadowy, sinister presence has invaded the Emerald Dream. Its power is poised to spill over into our world, $N. We must oppose it! That\'s why I cannot accompany you in person.',0,0,0,1,'clintar SAY_START'), +(-1000281,'The Emerald Dream will never be yours!',0,0,0,0,'clintar SAY_AGGRO_1'), +(-1000282,'Begone from this place!',0,0,0,0,'clintar SAY_AGGRO_2'), +(-1000283,'That\'s the first relic, but there are still two more. Follow me, $N.',0,0,0,0,'clintar SAY_RELIC1'), +(-1000284,'I\'ve recovered the second relic. Take a moment to rest, and then we\'ll continue to the last reliquary.',0,0,0,0,'clintar SAY_RELIC2'), +(-1000285,'We have all three of the relics, but my energy is rapidly fading. We must make our way back to Dreamwarden Lurosa! He will let you know what to do next.',0,0,0,0,'clintar SAY_RELIC3'), +(-1000286,'Lurosa, I am entrusting the Relics of Aviana to $N, who will take them to Morthis Whisperwing. I must return completely to the Emerald Dream now. Do not let $N fail!',0,0,0,1,'clintar SAY_END'), + +(-1000287,'Emergency power activated! Initializing ambulanory motor! CLUCK!',0,0,0,0,'oox SAY_OOX_START'), +(-1000288,'Physical threat detected! Evasive action! CLUCK!',0,0,0,0,'oox SAY_OOX_AGGRO1'), +(-1000289,'Thread analyzed! Activating combat plan beta! CLUCK!',0,0,0,0,'oox SAY_OOX_AGGRO2'), +(-1000290,'CLUCK! Sensors detect spatial anomaly - danger imminent! CLUCK!',0,0,0,0,'oox SAY_OOX_AMBUSH'), +(-1000291,'No one challanges the Wastewander nomads - not even robotic chickens! ATTACK!',0,0,0,0,'oox SAY_OOX17_AMBUSH_REPLY'), +(-1000292,'Cloaking systems online! CLUCK! Engaging cloak for transport to Booty Bay!',0,0,0,0,'oox SAY_OOX_END'), + +(-1000293,'To the house! Stay close to me, no matter what! I have my gun and ammo there!',0,0,7,0,'stilwell SAY_DS_START'), +(-1000294,'We showed that one!',0,0,7,0,'stilwell SAY_DS_DOWN_1'), +(-1000295,'One more down!',0,0,7,0,'stilwell SAY_DS_DOWN_2'), +(-1000296,'We\'ve done it! We won!',0,0,7,0,'stilwell SAY_DS_DOWN_3'), +(-1000297,'Meet me down by the orchard--I just need to put my gun away.',0,0,7,0,'stilwell SAY_DS_PROLOGUE'), + +(-1000298,'Alright, alright I think I can figure out how to operate this thing...',0,0,0,393,'wizzlecrank SAY_START'), +(-1000299,'Arrrgh! This isn\'t right!',0,0,0,0,'wizzlecrank SAY_STARTUP1'), +(-1000300,'Okay, I think I\'ve got it, now. Follow me, $n!',0,0,0,1,'wizzlecrank SAY_STARTUP2'), +(-1000301,'There\'s the stolen shredder! Stop it or Lugwizzle will have our hides!',0,1,0,0,'wizzlecrank SAY_MERCENARY'), +(-1000302,'Looks like we\'re out of woods, eh? Wonder what this does...',0,0,0,0,'wizzlecrank SAY_PROGRESS_1'), +(-1000303,'Come on, don\'t break down on me now!',0,0,0,393,'wizzlecrank SAY_PROGRESS_2'), +(-1000304,'That was a close one! Well, let\'s get going, it\'s still a ways to Ratchet!',0,0,0,0,'wizzlecrank SAY_PROGRESS_3'), +(-1000305,'Hmm... I don\'t think this blinking red light is a good thing...',0,0,0,0,'wizzlecrank SAY_END'), + +(-1000306,'Let\'s get to the others, and keep an eye open for those wolves cutside...',0,0,1,0,'erland SAY_START_1'), +(-1000307,'Be careful, $N. Those wolves like to hide among the trees.',0,0,1,0,'erland SAY_START_2'), +(-1000308,'A $C attacks!',0,0,1,0,'erland SAY_AGGRO_1'), +(-1000309,'Beware! I am under attack!',0,0,1,0,'erland SAY_AGGRO_2'), +(-1000310,'Oh no! A $C is upon us!',0,0,1,0,'erland SAY_AGGRO_3'), +(-1000311,'We\'re almost there!',0,0,1,0,'erland SAY_PROGRESS'), +(-1000312,'We made it! Thanks, $N. I couldn\'t have gotten without you.',0,0,1,0,'erland SAY_END'), +(-1000313,'It\'s good to see you again, Erland. What is your report?',0,0,33,1,'erland SAY_RANE'), +(-1000314,'Masses of wolves are to the east, and whoever lived at Malden\'s Orchard is gone.',0,0,1,1,'erland SAY_RANE_REPLY'), +(-1000315,'If I am excused, then I\'d like to check on Quinn...',0,0,1,1,'erland SAY_CHECK_NEXT'), +(-1000316,'Hello, Quinn. How are you faring?',0,0,1,1,'erland SAY_QUINN'), +(-1000317,'I\'ve been better. Ivar the Foul got the better of me...',0,0,33,1,'erland SAY_QUINN_REPLY'), +(-1000318,'Try to take better care of yourself, Quinn. You were lucky this time.',0,0,1,1,'erland SAY_BYE'), + +(-1000319,'Let the trial begin, Bloodwrath, attack!',0,1,1,0,'kelerun SayId1'), +(-1000320,'Champion Lightrend, make me proud!',0,1,1,0,'kelerun SayId2'), +(-1000321,'Show this upstart how a real Blood Knight fights, Swiftblade!',0,1,1,0,'kelerun SayId3'), +(-1000322,'Show $n the meaning of pain, Sunstriker!',0,1,1,0,'kelerun SayId4'), + +(-1000323,'Mist! I feared I would never see you again! Yes, I am well, do not worry for me. You must rest and recover your health.',0,0,7,0,'mist SAY_AT_HOME'), +(-1000324,'%s growls in acknowledgement before straightening and making her way off into the forest.',0,2,0,0,'mist EMOTE_AT_HOME'), + +(-1000325,'"Threshwackonator First Mate unit prepared to follow"',0,2,0,0,'threshwackonator EMOTE_START'), +(-1000326,'YARRR! Swabie, what have ye done?! He\'s gone mad! Baton him down the hatches! Hoist the mast! ARRRR! Every man for hi\'self!',0,0,7,0,'threshwackonator SAY_AT_CLOSE'), + +(-1000327,'Ok, $n, let\'s go find where I left that mysterious fossil. Follow me!',0,0,7,0,'remtravel SAY_REM_START'), +(-1000328,'Now where did I put that mysterious fossil? Ah, maybe up there...',0,0,7,0,'remtravel SAY_REM_RAMP1_1'), +(-1000329,'Hrm, nothing up here.',0,0,7,0,'remtravel SAY_REM_RAMP1_2'), +(-1000330,'No mysterious fossil here... Ah, but my copy of Green Hills of Stranglethorn. What a good book!',0,0,7,0,'remtravel SAY_REM_BOOK'), +(-1000331,'I bet you I left it in the tent!',0,0,7,0,'remtravel SAY_REM_TENT1_1'), +(-1000332,'Oh wait, that\'s Hollee\'s tent... and it\'s empty.',0,0,7,0,'remtravel SAY_REM_TENT1_2'), +(-1000333,'Interesting... I hadn\'t noticed this earlier...',0,0,7,0,'remtravel SAY_REM_MOSS'), +(-1000334,'%s inspects the ancient, mossy stone.',0,2,7,0,'remtravel EMOTE_REM_MOSS'), +(-1000335,'Oh wait! I\'m supposed to be looking for that mysterious fossil!',0,0,7,0,'remtravel SAY_REM_MOSS_PROGRESS'), +(-1000336,'Nope. didn\'t leave the fossil back here!',0,0,7,0,'remtravel SAY_REM_PROGRESS'), +(-1000337,'Ah. I remember now! I gave the mysterious fossil to Hollee! Check with her.',0,0,7,0,'remtravel SAY_REM_REMEMBER'), +(-1000338,'%s goes back to work, oblivious to everything around him.',0,2,7,0,'remtravel EMOTE_REM_END'), +(-1000339,'Something tells me this $r wants the mysterious fossil too. Help!',0,0,7,0,'remtravel SAY_REM_AGGRO'), + +(-1000340,'%s howls in delight at the sight of his lunch!',0,2,0,0,'kyle EMOTE_SEE_LUNCH'), +(-1000341,'%s eats his lunch.',0,2,0,0,'kyle EMOTE_EAT_LUNCH'), +(-1000342,'%s thanks you with a special dance.',0,2,0,0,'kyle EMOTE_DANCE'), + +(-1000343,'Is the way clear? Let\'s get out while we can, $N.',0,0,0,0,'kayra SAY_START'), +(-1000344,'Looks like we won\'t get away so easy. Get ready!',0,0,0,0,'kayra SAY_AMBUSH1'), +(-1000345,'Let\'s keep moving. We\'re not safe here!',0,0,0,0,'kayra SAY_PROGRESS'), +(-1000346,'Look out, $N! Enemies ahead!',0,0,0,0,'kayra SAY_AMBUSH2'), +(-1000347,'We\'re almost to the refuge! Let\'s go.',0,0,0,0,'kayra SAY_END'), + +(-1000348,'Ah...the wondrous sound of kodos. I love the way they make the ground shake... inspect the beast for me.',0,0,0,0,'kodo round SAY_SMEED_HOME_1'), +(-1000349,'Hey, look out with that kodo! You had better inspect that beast before i give you credit!',0,0,0,0,'kodo round SAY_SMEED_HOME_2'), +(-1000350,'That kodo sure is a beauty. Wait a minute, where are my bifocals? Perhaps you should inspect the beast for me.',0,0,0,0,'kodo round SAY_SMEED_HOME_3'), + +(-1000351,'You, there! Hand over that moonstone and nobody gets hurt!',0,1,0,0,'sprysprocket SAY_START'), +(-1000352,'%s takes the Southfury moonstone and escapes into the river. Follow her!',0,3,0,0,'sprysprocket EMOTE_START'), +(-1000353,'Just chill!',0,4,0,0,'sprysprocket SAY_WHISPER_CHILL'), +(-1000354,'Stupid grenade picked a fine time to backfire! So much for high quality goblin engineering!',0,1,0,0,'sprysprocket SAY_GRENADE_FAIL'), +(-1000355,'All right, you win! I surrender! Just don\'t hurt me!',0,1,0,0,'sprysprocket SAY_END'), + +(-1000356,'Okay, okay... gimme a minute to rest now. You gone and beat me up good.',0,0,1,14,'calvin SAY_COMPLETE'), + +(-1000357,'Let\'s go before they find out I\'m free!',0,0,0,1,'KAYA_SAY_START'), +(-1000358,'Look out! We\'re under attack!',0,0,0,0,'KAYA_AMBUSH'), +(-1000359,'Thank you for helping me. I know my way back from here.',0,0,0,0,'KAYA_END'), + +(-1000360,'The strands of LIFE have been severed! The Dreamers must be avenged!',0,1,0,0,' ysondre SAY_AGGRO'), +(-1000361,'Come forth, ye Dreamers - and claim your vengeance!',0,1,0,0,' ysondre SAY_SUMMONDRUIDS'), + +(-1000362,'Let\'s go $N. I am ready to reach Whitereach Post.',0,0,1,0,'paoka SAY_START'), +(-1000363,'Now this looks familiar. If we keep heading east, I think we can... Ahh, Wyvern on the attack!',0,0,1,0,'paoka SAY_WYVERN'), +(-1000364,'Thanks a bunch... I can find my way back to Whitereach Post from here. Be sure to talk with Motega Firemane; perhaps you can keep him from sending me home.',0,0,1,0,'paoka SAY_COMPLETE'), + +(-1000365,'Be on guard... Arnak has some strange power over the Grimtotem... they will not be happy to see me escape.',0,0,1,0,'lakota SAY_LAKO_START'), +(-1000366,'Look out, the Grimtotem are upon us!',0,0,1,0,'lakota SAY_LAKO_LOOK_OUT'), +(-1000367,'Here they come.',0,0,1,0,'lakota SAY_LAKO_HERE_COME'), +(-1000368,'More Grimtotems are coming this way!',0,0,1,0,'lakota SAY_LAKO_MORE'), +(-1000369,'Finally, free at last... I must be going now, thanks for helping me escape. I can get back to Freewind Post by myself.',0,0,1,0,'lakota SAY_LAKO_END'), + +(-1000370,'Stay close, $n. I\'ll need all the help I can get to break out of here. Let\'s go!',0,0,1,1,'gilthares SAY_GIL_START'), +(-1000371,'At last! Free from Northwatch Hold! I need a moment to catch my breath...',0,0,1,5,'gilthares SAY_GIL_AT_LAST'), +(-1000372,'Now i feel better. Let\'s get back to Ratchet. Come on, $n.',0,0,1,23,'gilthares SAY_GIL_PROCEED'), +(-1000373,'Looks like the Southsea Freeboters are heavily entrenched on the coast. This could get rough.',0,0,1,25,'gilthares SAY_GIL_FREEBOOTERS'), +(-1000374,'Help! $C attacking!',0,0,1,0,'gilthares SAY_GIL_AGGRO_1'), +(-1000375,'$C heading this way fast! Time for revenge!',0,0,1,0,'gilthares SAY_GIL_AGGRO_2'), +(-1000376,'$C coming right at us!',0,0,1,0,'gilthares SAY_GIL_AGGRO_3'), +(-1000377,'Get this $C off of me!',0,0,1,0,'gilthares SAY_GIL_AGGRO_4'), +(-1000378,'Almost back to Ratchet! Let\'s keep up the pace...',0,0,1,0,'gilthares SAY_GIL_ALMOST'), +(-1000379,'Ah, the sweet salt air of Ratchet.',0,0,1,0,'gilthares SAY_GIL_SWEET'), +(-1000380,'Captain Brightsun, $N here has freed me! $N, i am certain the Captain will reward your bravery.',0,0,1,66,'gilthares SAY_GIL_FREED'), + +(-1000381,'I sense the tortured spirits, $n. They are this way, come quickly!',0,0,0,1,'wilda SAY_WIL_START'), +(-1000382,'Watch out!',0,0,0,0,'wilda SAY_WIL_AGGRO1'), +(-1000383,'Naga attackers! Defend yourself!',0,0,0,0,'wilda SAY_WIL_AGGRO2'), +(-1000384,'Grant me protection $n, i must break trough their foul magic!',0,0,0,0,'wilda SAY_WIL_PROGRESS1'), +(-1000385,'The naga of Coilskar are exceptionally cruel to their prisoners. It is a miracle that I survived inside that watery prison for as long as I did. Earthmother be praised.',0,0,0,0,'wilda SAY_WIL_PROGRESS2'), +(-1000386,'Now we must find the exit.',0,0,0,0,'wilda SAY_WIL_FIND_EXIT'), +(-1000387,'Lady Vashj must answer for these atrocities. She must be brought to justice!',0,0,0,0,'wilda SAY_WIL_PROGRESS4'), +(-1000388,'The tumultuous nature of the great waterways of Azeroth and Draenor are a direct result of tormented water spirits.',0,0,0,0,'wilda SAY_WIL_PROGRESS5'), +(-1000389,'It shouldn\'t be much further, $n. The exit is just up ahead.',0,0,0,0,'wilda SAY_WIL_JUST_AHEAD'), +(-1000390,'Thank you, $n. Please return to my brethren at the Altar of Damnation, near the Hand of Gul\'dan, and tell them that Wilda is safe. May the Earthmother watch over you...',0,0,0,0,'wilda SAY_WIL_END'), + +(-1000391,'I\'m Thirsty.',0,0,0,0,'tooga SAY_TOOG_THIRST'), +(-1000392,'Torta must be so worried.',0,0,0,0,'tooga SAY_TOOG_WORRIED'), +(-1000393,'Torta, my love! I have returned at long last.',0,0,0,0,'tooga SAY_TOOG_POST_1'), +(-1000394,'You have any idea how long I\'ve been waiting here? And where\'s dinner? All that time gone and nothing to show for it?',0,0,0,0,'tooga SAY_TORT_POST_2'), +(-1000395,'My dearest Torta. I have been gone for so long. Finally we are reunited. At long last our love can blossom again.',0,0,0,0,'tooga SAY_TOOG_POST_3'), +(-1000396,'Enough with the rambling. I am starving! Now, get your dusty shell into that ocean and bring momma some grub.',0,0,0,0,'tooga SAY_TORT_POST_4'), +(-1000397,'Yes Torta. Whatever your heart desires...',0,0,0,0,'tooga SAY_TOOG_POST_5'), +(-1000398,'And try not to get lost this time...',0,0,0,0,'tooga SAY_TORT_POST_6'), + +(-1000399,'Peace is but a fleeting dream! Let the NIGHTMARE reign!',0,1,0,0,'taerar SAY_AGGRO'), +(-1000400,'Children of Madness - I release you upon this world!',0,1,0,0,'taerar SAY_SUMMONSHADE'), + +(-1000401,'Hope is a DISEASE of the soul! This land shall wither and die!',0,1,0,0,'emeriss SAY_AGGRO'), +(-1000402,'Taste your world\'s corruption!',0,1,0,0,'emeriss SAY_CASTCORRUPTION'), + +(-1000403,'Rin\'ji is free!',0,0,0,0,'SAY_RIN_FREE'), +(-1000404,'Attack my sisters! The troll must not escape!',0,0,0,0,'SAY_RIN_BY_OUTRUNNER'), +(-1000405,'Rin\'ji needs help!',0,0,1,0,'SAY_RIN_HELP_1'), +(-1000406,'Rin\'ji is being attacked!',0,0,1,0,'SAY_RIN_HELP_2'), +(-1000407,'Rin\'ji can see road now, $n. Rin\'ji knows the way home.',0,0,1,0,'SAY_RIN_COMPLETE'), +(-1000408,'Rin\'ji will tell you secret now... $n, should go to the Overlook Cliffs. Rin\'ji hid something on island there',0,0,1,0,'SAY_RIN_PROGRESS_1'), +(-1000409,'You find it, you keep it! Don\'t tell no one that Rin\'ji talked to you!',0,0,1,0,'SAY_RIN_PROGRESS_2'), + +(-1000410,'Here they come! Defend yourself!',0,0,1,5,'kanati SAY_KAN_START'), + +(-1000411,'Why don\'t we deal with you now, Hendel? Lady Proudmoore will speak for you back in the tower.',0,0,7,0,'hendel SAY_PROGRESS_1_TER'), +(-1000412,'Please... please... Miss Proudmore. I didn\'t mean to...',0,0,7,0,'hendel SAY_PROGRESS_2_HEN'), +(-1000413,'I apologize for taking so long to get here. I wanted Lady Proudmoore to be present also.',0,0,7,0,'hendel SAY_PROGRESS_3_TER'), +(-1000414,'We can only stay a few moments before returning to the tower. If you wish to speak to us more you may find us there.',0,0,7,0,'hendel SAY_PROGRESS_4_TER'), +(-1000415,'%s, too injured, gives up the chase.',0,2,0,0,'hendel EMOTE_SURRENDER'), + +(-1000416,'Well, I\'m not sure how far I\'ll make it in this state... I\'m feeling kind of faint...',0,0,0,0,'ringo SAY_RIN_START_1'), +(-1000417,'Remember, if I faint again, the water that Spraggle gave you will revive me.',0,0,0,0,'ringo SAY_RIN_START_2'), +(-1000418,'The heat... I can\'t take it...',0,0,0,0,'ringo SAY_FAINT_1'), +(-1000419,'Maybe... you could carry me?',0,0,0,0,'ringo SAY_FAINT_2'), +(-1000420,'Uuuuuuggggghhhhh....',0,0,0,0,'ringo SAY_FAINT_3'), +(-1000421,'I\'m not feeling so well...',0,0,0,0,'ringo SAY_FAINT_4'), +(-1000422,'Where... Where am I?',0,0,0,0,'ringo SAY_WAKE_1'), +(-1000423,'I am feeling a little better now, thank you.',0,0,0,0,'ringo SAY_WAKE_2'), +(-1000424,'Yes, I must go on.',0,0,0,0,'ringo SAY_WAKE_3'), +(-1000425,'How am I feeling? Quite soaked, thank you.',0,0,0,0,'ringo SAY_WAKE_4'), +(-1000426,'Spraggle! I didn\'t think I\'d make it back!',0,0,0,0,'ringo SAY_RIN_END_1'), +(-1000427,'Ringo! You\'re okay!',0,0,0,0,'ringo SAY_SPR_END_2'), +(-1000428,'Oh... I\'m feeling faint...',0,0,0,0,'ringo SAY_RIN_END_3'), +(-1000429,'%s collapses onto the ground.',0,2,0,0,'ringo EMOTE_RIN_END_4'), +(-1000430,'%s stands up after a short pause.',0,2,0,0,'ringo EMOTE_RIN_END_5'), +(-1000431,'Ugh.',0,0,0,0,'ringo SAY_RIN_END_6'), +(-1000432,'Ringo? Wake up! Don\'t worry, I\'ll take care of you.',0,0,0,0,'ringo SAY_SPR_END_7'), +(-1000433,'%s fades away after a long pause.',0,2,0,0,'ringo EMOTE_RIN_END_8'), + +(-1000434,'Liladris has been waiting for me at Maestra\'s Post, so we should make haste, $N.',0,0,0,0,'kerlonian SAY_KER_START'), +(-1000435,'%s looks very sleepy...',0,2,0,0,'kerlonian EMOTE_KER_SLEEP_1'), +(-1000436,'%s suddenly falls asleep',0,2,0,0,'kerlonian EMOTE_KER_SLEEP_2'), +(-1000437,'%s begins to drift off...',0,2,0,0,'kerlonian EMOTE_KER_SLEEP_3'), +(-1000438,'This looks like the perfect place for a nap...',0,0,0,0,'kerlonian SAY_KER_SLEEP_1'), +(-1000439,'Yaaaaawwwwwnnnn...',0,0,0,0,'kerlonian SAY_KER_SLEEP_2'), +(-1000440,'Oh, I am so tired...',0,0,0,0,'kerlonian SAY_KER_SLEEP_3'), +(-1000441,'You don\'t mind if I stop here for a moment, do you?',0,0,0,0,'kerlonian SAY_KER_SLEEP_4'), +(-1000442,'Be on the alert! The Blackwood furbolgs are numerous in the area...',0,0,0,0,'kerlonian SAY_KER_ALERT_1'), +(-1000443,'It\'s quiet... Too quiet...',0,0,0,0,'kerlonian SAY_KER_ALERT_2'), +(-1000444,'Oh, I can see Liladris from here... Tell her I\'m here, won\'t you?',0,0,0,0,'kerlonian SAY_KER_END'), +(-1000445,'%s wakes up!',0,2,0,0,'kerlonian EMOTE_KER_AWAKEN'), + +(-1000446,'A-Me good. Good, A-Me. Follow... follow A-Me. Home. A-Me go home.',0,0,0,0,'ame01 SAY_AME_START'), +(-1000447,'Good... good, A-Me. A-Me good. Home. Find home.',0,0,0,0,'ame01 SAY_AME_PROGRESS'), +(-1000448,'A-Me home! A-Me good! Good A-Me. Home. Home. Home.',0,0,0,0,'ame01 SAY_AME_END'), +(-1000449,'$c, no hurt A-Me. A-Me good.',0,0,0,0,'ame01 SAY_AME_AGGRO1'), +(-1000450,'Danger. Danger! $c try hurt A-Me.',0,0,0,0,'ame01 SAY_AME_AGGRO2'), +(-1000451,'Bad, $c. $c, bad!',0,0,0,0,'ame01 SAY_AME_AGGRO3'), + +(-1000452,'I noticed some fire on that island over there. A human, too. Let\'s go check it out, $n.',0,0,1,0,'ogron SAY_OGR_START'), +(-1000453,'That\'s Reethe alright. Let\'s go see what he has to say, yeah?',0,0,1,1,'ogron SAY_OGR_SPOT'), +(-1000454,'W-what do you want? Just leave me alone...',0,0,0,6,'ogron SAY_OGR_RET_WHAT'), +(-1000455,'I swear. I didn\'t steal anything from you! Here, take some of my supplies, just go away!',0,0,0,27,'ogron SAY_OGR_RET_SWEAR'), +(-1000456,'Just tell us what you know about the Shady Rest Inn, and I won\'t bash your skull in.',0,0,1,0,'ogron SAY_OGR_REPLY_RET'), +(-1000457,'I... Well, I may of taken a little thing or two from the inn... but what would an ogre care about that?',0,0,0,6,'ogron SAY_OGR_RET_TAKEN'), +(-1000458,'Look here, if you don\'t tell me about the fire--',0,0,1,0,'ogron SAY_OGR_TELL_FIRE'), +(-1000459,'Not one step closer, ogre!',0,0,0,27,'ogron SAY_OGR_RET_NOCLOSER'), +(-1000460,'And I don\'t know anything about this fire of yours...',0,0,0,0,'ogron SAY_OGR_RET_NOFIRE'), +(-1000461,'What was that? Did you hear something?',0,0,0,0,'ogron SAY_OGR_RET_HEAR'), +(-1000462,'Paval Reethe! Found you at last. And consorting with ogres now? No fear, even deserters and traitors are afforded some mercy.',0,0,0,0,'ogron SAY_OGR_CAL_FOUND'), +(-1000463,'Private, show Lieutenant Reethe some mercy.',0,0,0,29,'ogron SAY_OGR_CAL_MERCY'), +(-1000464,'Gladly, sir.',0,0,0,0,'ogron SAY_OGR_HALL_GLAD'), +(-1000465,'%s staggers backwards as the arrow lodges itself deeply in his chest.',0,2,0,0,'ogron EMOTE_OGR_RET_ARROW'), +(-1000466,'Ugh... Hallan, didn\'t think you had it in you...',0,0,0,34,'ogron SAY_OGR_RET_ARROW'), +(-1000467,'Now, let\'s clean up the rest of the trash, men!',0,0,0,0,'ogron SAY_OGR_CAL_CLEANUP'), +(-1000468,'Damn it! You\'d better not die on me, human!',0,0,1,0,'ogron SAY_OGR_NODIE'), +(-1000469,'Still with us, Reethe?',0,0,1,0,'ogron SAY_OGR_SURVIVE'), +(-1000470,'Must be your lucky day. Alright, I\'ll talk. Just leave me alone. Look, you\'re not going to believe me, but it wa... oh, Light, looks like the girl could shoot...',0,0,0,0,'ogron SAY_OGR_RET_LUCKY'), +(-1000471,'By the way, thanks for watching my back.',0,0,1,0,'ogron SAY_OGR_THANKS'), + +(-1000472,'1...',0,3,0,0,'mana bomb SAY_COUNT_1'), +(-1000473,'2...',0,3,0,0,'mana bomb SAY_COUNT_2'), +(-1000474,'3...',0,3,0,0,'mana bomb SAY_COUNT_3'), +(-1000475,'4...',0,3,0,0,'mana bomb SAY_COUNT_4'), +(-1000476,'5...',0,3,0,0,'mana bomb SAY_COUNT_5'), + +(-1000477,'Let us leave this place. I\'ve had enough of these madmen!',0,0,0,0,'akuno SAY_AKU_START'), +(-1000478,'You\'ll go nowhere, fool!',0,0,0,0,'akuno SAY_AKU_AMBUSH_A'), +(-1000479,'Beware! More cultists come!',0,0,0,0,'akuno SAY_AKU_AMBUSH_B'), +(-1000480,'You will not escape us so easily!',0,0,0,0,'akuno SAY_AKU_AMBUSH_B_REPLY'), +(-1000481,'I can find my way from here. My friend Mekeda will reward you for your kind actions.',0,0,0,0,'akuno SAY_AKU_COMPLETE'), + +(-1000482,'Look out!',0,0,0,0,'maghar captive SAY_MAG_START'), +(-1000483,'Don\'t let them escape! Kill the strong one first!',0,0,0,0,'maghar captive SAY_MAG_NO_ESCAPE'), +(-1000484,'More of them coming! Watch out!',0,0,0,0,'maghar captive SAY_MAG_MORE'), +(-1000485,'Where do you think you\'re going? Kill them all!',0,0,0,0,'maghar captive SAY_MAG_MORE_REPLY'), +(-1000486,'Ride the lightning, filth!',0,0,0,0,'maghar captive SAY_MAG_LIGHTNING'), +(-1000487,'FROST SHOCK!!!',0,0,0,0,'maghar captive SAY_MAG_SHOCK'), +(-1000488,'It is best that we split up now, in case they send more after us. Hopefully one of us will make it back to Garrosh. Farewell stranger.',0,0,0,0,'maghar captive SAY_MAG_COMPLETE'), + +(-1000489,'Show our guest around Shattrath, will you? Keep an eye out for pickpockets in the lower city.',0,0,0,0,'SAY_KHAD_START'), +(-1000490,'A newcomer to Shattrath! Make sure to drop by later. We can always use a hand with the injured.',0,0,0,0,'SAY_KHAD_INJURED'), +(-1000491,'Be mindful of what you say, this one\'s being shown around by Khadgar\'s pet.',0,0,0,0,'SAY_KHAD_MIND_YOU'), +(-1000492,'Are you joking? I\'m a Scryer, I always watch what i say. More enemies than allies in this city, it seems.',0,0,0,0,'SAY_KHAD_MIND_ALWAYS'), +(-1000493,'Light be with you, $n. And welcome to Shattrath.',0,0,0,0,'SAY_KHAD_ALDOR_GREET'), +(-1000494,'We\'re rather selective of who we befriend, $n. You think you have what it takes?',0,0,0,0,'SAY_KHAD_SCRYER_GREET'), +(-1000495,'Khadgar himself is showing you around? You must have made a good impression, $n.',0,0,0,0,'SAY_KHAD_HAGGARD'), + +(-1000496,'%s lifts its head into the air, as if listening for something.',0,2,0,0,'ancestral wolf EMOTE_WOLF_LIFT_HEAD'), +(-1000497,'%s lets out a howl that rings across the mountains to the north and motions for you to follow.',0,2,0,0,'ancestral wolf EMOTE_WOLF_HOWL'), +(-1000498,'Welcome, kind spirit. What has brought you to us?',0,0,0,0,'ancestral wolf SAY_WOLF_WELCOME'), + +(-1000499,'Puny $r wanna fight %s? Me beat you! Me boss here!',0,0,1,0,'morokk SAY_MOR_CHALLENGE'), +(-1000500,'Me scared! Me run now!',0,1,0,0,'morokk SAY_MOR_SCARED'), + +(-1000501,'Are you sure that you are ready? If we do not have a group of your allies to aid us, we will surely fail.',0,0,1,0,'muglash SAY_MUG_START1'), +(-1000502,'This will be a though fight, $n. Follow me closely.',0,0,1,0,'muglash SAY_MUG_START2'), +(-1000503,'This is the brazier, $n. Put it out. Vorsha is a beast, worthy of praise from no one!',0,0,1,0,'muglash SAY_MUG_BRAZIER'), +(-1000504,'Now we must wait. It won\'t be long before the naga realize what we have done.',0,0,1,0,'muglash SAY_MUG_BRAZIER_WAIT'), +(-1000505,'Be on your guard, $n!',0,0,1,0,'muglash SAY_MUG_ON_GUARD'), +(-1000506,'Perhaps we will get a moment to rest. But i will not give up until we have faced off against Vorsha!',0,0,1,0,'muglash SAY_MUG_REST'), +(-1000507,'We have done it!',0,0,1,0,'muglash SAY_MUG_DONE'), +(-1000508,'You have my deepest gratitude. I thank you.',0,0,1,0,'muglash SAY_MUG_GRATITUDE'), +(-1000509,'I am going to patrol the area for a while longer and ensure that things are truly safe.',0,0,1,0,'muglash SAY_MUG_PATROL'), +(-1000510,'Please return to Zoram\'gar and report our success to the Warsong runner.',0,0,1,0,'muglash SAY_MUG_RETURN'), + +(-1000511,'Aright, listen up! Form a circle around me and move out!',0,0,0,0,'letoll SAY_LE_START'), +(-1000512,'Aright, $r, just keep us safe from harm while we work. We\'ll pay you when we return.',0,0,0,0,'letoll SAY_LE_KEEP_SAFE'), +(-1000513,'The dig site is just north of here.',0,0,0,0,'letoll SAY_LE_NORTH'), +(-1000514,'We\'re here! Start diggin\'!',0,0,0,0,'letoll SAY_LE_ARRIVE'), +(-1000515,'I think there\'s somethin\' buried here, beneath the sand!',0,0,0,0,'letoll SAY_LE_BURIED'), +(-1000516,'Almost got it!',0,0,0,0,'letoll SAY_LE_ALMOST'), +(-1000517,'By brann\'s brittle bananas! What is it!? It... It looks like a drum.',0,0,0,0,'letoll SAY_LE_DRUM'), +(-1000518,'Wow... a drum.',0,0,0,0,'letoll SAY_LE_DRUM_REPLY'), +(-1000519,'This discovery will surely rock the foundation of modern archaeology.',0,0,0,0,'letoll SAY_LE_DISCOVERY'), +(-1000520,'Yea, great. Can we leave now? This desert is giving me hives.',0,0,0,0,'letoll SAY_LE_DISCOVERY_REPLY'), +(-1000521,'Have ye gone mad? You expect me to leave behind a drum without first beatin\' on it? Not this son of Ironforge! No sir!',0,0,0,0,'letoll SAY_LE_NO_LEAVE'), +(-1000522,'This reminds me of that one time where you made us search Silithus for evidence of sand gnomes.',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY1'), +(-1000523,'Or that time when you told us that you\'d discovered the cure for the plague of the 20th century. What is that even? 20th century?',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY2'), +(-1000524,'I don\'t think it can top the one time where he told us that he\'d heard that Artha\'s "cousin\'s" skeleton was frozen beneath a glacier in Winterspring. I\'ll never forgive you for that one, Letoll. I mean honestly... Artha\'s cousin?',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY3'), +(-1000525,'I dunno. It can\'t possibly beat the time he tried to convince us that we\'re all actually a figment of some being\'s imagination and that they only use us for their own personal amusement. That went over well during dinner with the family.',0,0,0,0,'letoll SAY_LE_NO_LEAVE_REPLY4'), +(-1000526,'Shut yer yaps! I\'m gonna bang on this drum and that\'s that!',0,0,0,0,'letoll SAY_LE_SHUT'), +(-1000527,'Say, do you guys hear that?',0,0,0,0,'letoll SAY_LE_REPLY_HEAR'), +(-1000528,'IN YOUR FACE! I told you there was somethin\' here!',0,0,0,0,'letoll SAY_LE_IN_YOUR_FACE'), +(-1000529,'Don\'t just stand there! Help him out!',0,0,0,0,'letoll SAY_LE_HELP_HIM'), +(-1000530,'%s picks up the drum.',0,2,0,0,'letoll EMOTE_LE_PICK_UP'), +(-1000531,'You\'ve been a tremendous help, $r! Let\'s get out of here before more of those things show up! I\'ll let Dwarfowitz know you did the job asked of ya\' admirably.',0,0,0,0,'letoll SAY_LE_THANKS'), + +(-1000532,'At your command, my liege...',0,0,0,0,'torloth TORLOTH_DIALOGUE1'), +(-1000533,'As you desire, Lord Illidan.',0,0,0,0,'torloth TORLOTH_DIALOGUE2'), +(-1000534,'Yes, Lord Illidan, I would sacrifice to you this magnificent physique. On this day you will fall - another victim of Torloth...',0,0,0,0,'torloth TORLOTH_DIALOGUE3'), +(-1000535,'Destroy them, Torloth. Let lose their blood like a river upon this hallowed ground.',0,0,0,0,'lordillidan ILLIDAN_DIALOGUE'), +(-1000536,'What manner of fool dares stand before Illidan Stormrage? Soldiers, destroy these insects!',0,1,0,0,'lordillidan ILLIDAN_SUMMON1'), +(-1000537,'You are no challenge for the Crimson Sigil. Mind breakers, end this nonsense.',0,1,0,0,'lordillidan ILLIDAN_SUMMON2'), +(-1000538,'Run while you still can. The highlords come soon...',0,1,0,0,'lordillidan ILLIDAN_SUMMON3'), +(-1000539,'Torloth your master calls!',0,1,0,0,'lordillidan ILLIDAN_SUMMON4'), +(-1000540,'So you have defeated the Crimson Sigil. You now seek to challenge my rule? Not even Arthas could defeat me, yet you dare to even harbor such thoughts? Then I say to you, come! Come $N! The Black Temple awaits...',0,1,0,0,'lordillidan EVENT_COMPLETED'), + +(-1000541,'%s jumps into the moonwell and goes underwater...',0,2,0,0,'kitten EMOTE_SAB_JUMP'), +(-1000542,'%s follows $n obediertly.',0,2,0,0,'kitten EMOTE_SAB_FOLLOW'), + +(-1000543,'Why have you come here, outsider? You will only find pain! Our fate will be yours...',0,0,0,25,'restless app SAY_RAND_1'), +(-1000544,'It was ... terrible... the demon...',0,0,0,25,'restless app SAY_RAND_2'), +(-1000545,'The darkness... the corruption... they came too quickly for anyone to know...',0,0,0,25,'restless app SAY_RAND_3'), +(-1000546,'The darkness will consume all... all the living...',0,0,0,25,'restless app SAY_RAND_4'), +(-1000547,'It is too late for us, living one. Take yourself and your friend away from here before you both are... claimed...',0,0,0,25,'restless app SAY_RAND_5'), +(-1000548,'It is too late for Jarl... its hold is too strong...',0,0,0,25,'restless app SAY_RAND_6'), +(-1000549,'Go away, whoever you are! Witch Hill is mine... mine!',0,0,0,25,'restless app SAY_RAND_7'), +(-1000550,'The manor... someone else... will soon be consumed...',0,0,0,25,'restless app SAY_RAND_8'), + +(-1000551,'The %s is angered by your request and attacks!',0,2,0,0,'woodlands EMOTE_AGGRO'), +(-1000552,'Breaking off a piece of its bark, the %s hands it to you before departing.',0,2,0,0,'woodlands EMOTE_CREATE'), + +(-1000553,'Be ready, $N. I hear the council returning. Prepare to ambush!',0,0,0,0,'deathstalker_faerleia SAY_START'), +(-1000554,'Well done. A blow to Arugal no doubt!',0,0,0,0,'deathstalker_faerleia SAY_END'), + +(-1000555,'Back... to work...',0,0,0,0,'exhausted vrykul SAY_RAND_WORK1'), +(-1000556,'You treat us worse than animals!',0,0,0,0,'exhausted vrykul SAY_RAND_WORK2'), +(-1000557,'We will have revenge...some day.',0,0,0,0,'exhausted vrykul SAY_RAND_WORK3'), +(-1000558,'Curse you! You will not treat me like a beast!',0,0,0,0,'exhausted vrykul SAY_RAND_ATTACK1'), +(-1000559,'I\'d rather die fighting than live like a slave.',0,0,0,0,'exhausted vrykul SAY_RAND_ATTACK2'), +(-1000560,'Enough! I will teach you some manners, wench!',0,0,0,0,'exhausted vrykul SAY_RAND_ATTACK3'), + +(-1000561,'My wounds are grave. Forgive my slow pace but my injuries won''t allow me to walk any faster.',0,0,0,0,'SAY_CORPORAL_KEESHAN_1'), +(-1000562,'Ah, fresh air, at last! I need a moment to rest.',0,0,0,0,'SAY_CORPORAL_KEESHAN_2'), +(-1000563,'The Blackrock infestation is thick in these parts. I will do my best to keep the pace. Let''s go!',0,0,0,0,'SAY_CORPORAL_KEESHAN_3'), +(-1000564,'Marshal Marris, sir. Corporal Keeshan of the 12th Sabre Regiment returned from battle and reporting for duty!',0,0,0,0,'SAY_CORPORAL_KEESHAN_4'), +(-1000565,'Brave adventurer, thank you for rescuing me! I am sure Marshal Marris will reward your kind deed.',0,0,0,0,'SAY_CORPORAL_KEESHAN_5'), + +(-1000566,'Stand back! Stand clear! The infernal will need to be given a wide berth!',0,0,0,0,'SAY_NIBY_1'), +(-1000567,'BOW DOWN TO THE ALMIGHTY! BOW DOWN BEFORE MY INFERNAL DESTRO... chicken?',0,0,0,0,'SAY_NIBY_2'), +(-1000568,'%s rolls on the floor laughing.',0,2,0,0,'EMOTE_IMPSY_1'), +(-1000569,'Niby, you\' re an idiot.',0,0,0,0,'SAY_IMPSY_1'), +(-1000570,'Silence, servant! Vengeance will be mine! Death to Stormwind! Death by chicken!',0,0,0,0,'SAY_NIBY_3'), + +(-1000571,'Help! I\'ve only one hand to defend myself with.',0,0,0,0,'SAY_MIRAN_1'), +(-1000572,'Feel the power of the Dark Iron Dwarves!',0,0,0,0,'SAY_DARK_IRON_DWARF'), +(-1000573,'Send them on! I\'m not afraid of some scrawny beasts!',0,0,0,0,'SAY_MIRAN_2'), +(-1000574,'Ah, here at last! It\'s going to feel so good to get rid of these barrels.',0,0,0,0,'SAY_MIRAN_3'), + +(-1000575,'Together we will fight our way out of here. Are you ready?',0,0,0,0,'Lurgglbr - SAY_START_1'), +(-1000576,'Then we leave.',0,0,0,0,'Lurgglbr - SAY_START_2'), +(-1000577,'This is far enough. I can make it on my own from here.',0,0,0,0,'Lurgglbr - SAY_END_1'), +(-1000578,'Thank you for helping me $r. Please tell the king I am back.',0,0,0,0,'Lurgglbr - SAY_END_2'), + +(-1000579,'Insolent fool! You thought to steal Zelemar\'s blood? You shall pay with your own!',0,1,0,0,'Zelemar the Wrathful - Aggro'), + +(-1000580,'Sleep now, young one ...',0,0,0,0,'Raelorasz SAY_SLEEP'), +(-1000581,'A wonderful specimen.',0,0,0,0,'Raeloarsz SAY_SPECIMEN'), + +(-1000582,'Help! Please, You must help me!',0,0,0,0,'Galen - periodic say'), +(-1000583,'Let us leave this place.',0,0,0,0,'Galen - quest accepted'), +(-1000584,'Look out! The $c attacks!',0,0,0,0,'Galen - aggro 1'), +(-1000585,'Help! I\'m under attack!',0,0,0,0,'Galen - aggro 2'), +(-1000586,'Thank you $N. I will remember you always. You can find my strongbox in my camp, north of Stonard.',0,0,0,0,'Galen - quest complete'), +(-1000587,'%s whispers to $N the secret to opening his strongbox.',0,2,0,0,'Galen - emote whisper'), +(-1000588,'%s disappears into the swamp.',0,2,0,0,'Galen - emote disapper'), + +(-1000589,'Kroshius live? Kroshius crush!',0,1,0,0,'SAY_KROSHIUS_REVIVE'), + +(-1000590,'Woot!',0,0,0,0,'Captive Child SAY_THANKS_1'), +(-1000591,'I think those weird bird guys were going to eat us. Gross!',0,0,0,0,'Captive Child SAY_THANKS_2'), +(-1000592,'Yay! We\'re free!',0,0,0,0,'Captive Child SAY_THANKS_3'), +(-1000593,'Gross!',0,0,0,0,'Captive Child SAY_THANKS_4'), + +(-1000594,'At last... now I can rest.',0,0,0,0,'hero spirit SAY_BLESS_1'), +(-1000595,'I\'m so tired. Just let me rest for a moment.',0,0,0,0,'hero spirit SAY_BLESS_2'), +(-1000596,'I can\'t hear the screams anymore. Is this the end?',0,0,0,0,'hero spirit SAY_BLESS_3'), +(-1000597,'My nightmare, is it finally over?',0,0,0,0,'hero spirit SAY_BLESS_4'), +(-1000598,'It was awful... I dreamt I was fighting against my friends.',0,0,0,0,'hero spirit SAY_BLESS_5'), + +(-1000599,'It\'s a miracle! The beast skinned itself!',0,0,0,5,'nesingwary trapper SAY_PHRASE_1'), +(-1000600,'Jackpot!',0,0,0,5,'nesingwary trapper SAY_PHRASE_2'), +(-1000601,'This is the last one i need for that set of Nesingwary steak knives!',0,0,0,5,'nesingwary trapper SAY_PHRASE_3'), +(-1000602,'Silly beasts!',0,0,0,5,'nesingwary trapper SAY_PHRASE_4'); + +-- -1 033 000 SHADOWFANG KEEP +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1033000,'Follow me and I\'ll open the courtyard door for you.',0,0,7,1,'prisoner ashcrombe SAY_FREE_AS'), +(-1033001,'I have just the spell to get this door open. Too bad the cell doors weren\'t locked so haphazardly.',0,0,7,1,'prisoner ashcrombe SAY_OPEN_DOOR_AS'), +(-1033002,'There it is! Wide open. Good luck to you conquering what lies beyond. I must report back to the Kirin Tor at once!',0,0,7,1,'prisoner ashcrombe SAY_POST_DOOR_AS'), + +(-1033003,'Free from this wretched cell at last! Let me show you to the courtyard....',0,0,1,1,'prisoner adamant SAY_FREE_AD'), +(-1033004,'You are indeed courageous for wanting to brave the horrors that lie beyond this door.',0,0,1,1,'prisoner adamant SAY_OPEN_DOOR_AD'), +(-1033005,'There we go!',0,0,1,1,'prisoner adamant SAY_POST1_DOOR_AD'), +(-1033006,'Good luck with Arugal. I must hurry back to Hadrec now.',0,0,1,1,'prisoner adamant SAY_POST2_DOOR_AD'), + +(-1033007,'About time someone killed the wretch.',0,0,1,1,'prisoner adamant SAY_BOSS_DIE_AD'), +(-1033008,'For once I agree with you... scum.',0,0,7,1,'prisoner ashcrombe SAY_BOSS_DIE_AS'), + +(-1033009,'I have changed my mind loyal servants, you do not need to bring the prisoner all the way to my study, I will deal with him here and now.',0,0,0,1,'arugal SAY_INTRO_1'), +(-1033010,'Vincent! You and your pathetic ilk will find no more success in routing my sons and I than those beggardly remnants of the Kirin Tor.',0,0,0,0,'arugal SAY_INTRO_2'), +(-1033011,'If you will not serve my Master with your sword and knowledge of his enemies...',0,0,0,1,'arugal SAY_INTRO_3'), +(-1033012,'Your moldering remains will serve ME as a testament to what happens when one is foolish enough to trespass in my domain!\n',0,0,0,0,'arugal SAY_INTRO_4'), + +(-1033013,'Who dares interfere with the Sons of Arugal?',0,1,0,0,'boss_arugal YELL_FENRUS'), +(-1033014,'%s vanishes.',0,2,0,0,'prisoner ashcrombe EMOTE_VANISH_AS'), +(-1033015,'%s fumbles with the rusty lock on the courtyard door.',0,2,0,432,'prisoner adamant EMOTE_UNLOCK_DOOR_AD'), +(-1033016,'Arrrgh!',0,0,0,0,'deathstalker vincent SAY_VINCENT_DIE'), +(-1033017,'You, too, shall serve!',5793,1,0,0,'boss_arugal YELL_AGGRO'), +(-1033018,'Another Falls!',5795,1,0,0,'boss_arugal YELL_KILLED_PLAYER'), +(-1033019,'Release your rage!',5797,1,0,0,'boss_arugal YELL_COMBAT'); + +-- -1 034 000 STOCKADES + +-- -1 036 000 DEADMINES +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1036000,'You there, check out that noise!',5775,1,7,0,'smite INST_SAY_ALARM1'), +(-1036001,'We\'re under attack! A vast, ye swabs! Repel the invaders!',5777,1,7,0,'smite INST_SAY_ALARM2'); + +-- -1 043 000 WAILING CAVERNS + +-- -1 047 000 RAZORFEN KRAUL + +-- -1 048 000 BLACKFATHOM DEEPS + +-- -1 070 000 ULDAMAN +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1070000,'None may steal the secrets of the makers!',5851,1,0,0,'ironaya SAY_AGGRO'), +(-1070001,'Who dares awaken Archaedas? Who dares the wrath of the makers!',5855,1,0,0,'archaedas SAY_AGGRO'), +(-1070002,'Awake ye servants, defend the discs!',5856,1,0,0,'archaedas SAY_AWAKE_GUARDIANS'), +(-1070003,'To my side, brothers. For the makers!',5857,1,0,0,'archaedas SAY_AWAKE_WARDERS'), +(-1070004,'Reckless mortal.',5858,1,0,0,'archaedas SAY_UNIT_SLAIN'); + +-- -1 090 000 GNOMEREGAN +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1090000,'With your help, I can evaluate these tunnels.',0,0,0,1,'emi shortfuse SAY_START'), +(-1090001,'Let\'s see if we can find out where these Troggs are coming from.... and put a stop to the invasion!',0,0,0,1,'emi shortfuse SAY_INTRO_1'), -- ' +(-1090002,'Such devastation... what a horrible mess....',0,0,0,5,'emi shortfuse SAY_INTRO_2'), +(-1090003,'It\'s quiet here....',0,0,0,1,'emi shortfuse SAY_INTRO_3'), -- ' +(-1090004,'...too quiet.',0,0,0,1,'emi shortfuse SAY_INTRO_4'), +(-1090005,'Look! Over there at the tunnel wall!',0,0,0,25,'emi shortfuse SAY_LOOK_1'), +(-1090006,'Trogg incursion! Defend me while I blast the hole closed!',0,0,0,5,'emi shortfuse SAY_HEAR_1'), +(-1090007,'Get this, $n off of me!',0,0,0,0,'emi shortfuse SAY_AGGRO'), +(-1090008,'I don\'t think one charge is going to cut it. Keep fending them off!',0,0,0,0,'emi shortfuse SAY_CHARGE_1'), -- ' +(-1090009,'The charges are set. Get back before they blow!',0,0,0,5,'emi shortfuse SAY_CHARGE_2'), +(-1090010,'Incoming blast in 10 seconds!',0,1,0,5,'emi shortfuse SAY_BLOW_1_10'), +(-1090011,'Incoming blast in 5 seconds. Clear the tunnel!',0,1,0,5,'emi shortfuse SAY_BLOW_1_5'), +(-1090012,'FIRE IN THE HOLE!',0,1,0,25,'emi shortfuse SAY_BLOW_1'), +(-1090013,'Well done! without your help I would have never been able to thwart that wave of troggs.',0,0,0,4,'emi shortfuse SAY_FINISH_1'), +(-1090014,'Did you hear something?',0,0,0,6,'emi shortfuse SAY_LOOK_2'), +(-1090015,'I heard something over there.',0,0,0,25,'emi shortfuse SAY_HEAR_2'), +(-1090016,'More troggs! Ward them off as I prepare the explosives!',0,0,0,0,'emi shortfuse SAY_CHARGE_3'), +(-1090017,'The final charges are set. Stand back!',0,0,0,1,'emi shortfuse SAY_CHARGE_4'), +(-1090018,'10 seconds to blast! Stand back!',0,1,0,5,'emi shortfuse SAY_BLOW_2_10'), +(-1090019,'5 seconds until detonation!',0,1,0,5,'emi shortfuse SAY_BLOW_2_5'), +(-1090020,'Good work! I detonate the explosives that no more troggs can reach the surface.',0,0,0,1,'emi shortfuse SAY_BLOW_SOON'), +(-1090021,'FIRE IN THE HOLE!',0,1,0,0,'emi shortfuse SAY_BLOW_2'), +(-1090022,'Superb! Because of your help, my people stand a chance of re-taking our belowed city. Three cheers to you!',0,0,0,0,'emi shortfuse SAY_FINISH_2'), + +(-1090023,'We come from below! You can never stop us!',0,1,0,1,'grubbis SAY_GRUBBIS_SPAWN'), + +(-1090024,'Usurpers! Gnomeregan is mine!',5807,1,0,0,'thermaplugg SAY_AGGRO'), +(-1090025,'My machines are the future! They\'ll destroy you all!',5808,1,0,0,'thermaplugg SAY_PHASE'), +(-1090026,'Explosions! MORE explosions! I\'ve got to have more explosions!',5809,1,0,0,'thermaplugg SAY_BOMB'), +(-1090027,'...and stay dead! He got served',5810,1,0,0,'thermaplugg SAY_SLAY'); + +-- -1 109 000 SUNKEN TEMPLE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1109000,'The walls of the chamber tremble. Something is happening...',0,2,0,0,'malfurion stormrage EMOTE_MALFURION'), +(-1109001,'Be steadfast, champion. I know why it is that you are here and I know what it is that you seek. Eranikus will not give up the shard freely. He has been twisted... twisted by the same force that you seek to destroy.',0,0,0,0,'malfurion stormrge SAY_MALFURION1'), +(-1109002,'Are you really surprised? Is it hard to believe that the power of an Old God could reach even inside the Dream? It is true - Eranikus, Tyrant of the Dream, wages a battle against us all. The Nightmare follows in his wake of destruction.',0,0,0,0,'malfurion stormrge SAY_MALFURION2'), +(-1109003,'Understand this, Eranikus wants nothing more than to be brought to Azeroth from the Dream. Once he is out, he will stop at nothing to destroy my physical manifestation. This, however, is the only way in which you could recover the scepter shard.',0,0,0,0,'malfurion stormrge SAY_MAFLURION3'), +(-1109004,'You will bring him back into this world, champion.',0,0,0,0,'malfurion Stormrge SAY_MALFURION4'); + +-- -1 129 000 RAZORFEN DOWNS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1129000,'You\'ll never leave this place... alive.',5825,1,0,0,'amnennar SAY_AGGRO'), +(-1129001,'To me, my servants!',5828,1,0,0,'amnennar SAY_SUMMON60'), +(-1129002,'Come, spirits, attend your master!',5829,1,0,0,'amnennar SAY_SUMMON30'), +(-1129003,'I am the hand of the Lich King!',5827,1,0,0,'amnennar SAY_HP'), +(-1129004,'Too...easy!',5826,1,0,0,'amnennar SAY_KILL'); + +-- -1 189 000 SCARLET MONASTERY +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1189000,'Ah, I have been waiting for a real challenge!',5830,1,0,0,'herod SAY_AGGRO'), +(-1189001,'Blades of Light!',5832,1,0,0,'herod SAY_WHIRLWIND'), +(-1189002,'Light, give me strength!',5833,1,0,0,'herod SAY_ENRAGE'), +(-1189003,'Hah, is that all?',5831,1,0,0,'herod SAY_KILL'), +(-1189004,'%s becomes enraged!',0,2,0,0,'herod EMOTE_ENRAGE'), + +(-1189005,'Infidels! They must be purified!',5835,1,0,0,'mograine SAY_MO_AGGRO'), +(-1189006,'Unworthy!',5836,1,0,0,'mograine SAY_MO_KILL'), +(-1189007,'At your side, milady!',5837,1,0,0,'mograine SAY_MO_RESSURECTED'), + +(-1189008,'What, Mograine has fallen? You shall pay for this treachery!',5838,1,0,0,'whitemane SAY_WH_INTRO'), +(-1189009,'The Light has spoken!',5839,1,0,0,'whitemane SAY_WH_KILL'), +(-1189010,'Arise, my champion!',5840,1,0,0,'whitemane SAY_WH_RESSURECT'), + +(-1189011,'Tell me... tell me everything!',5847,1,0,0,'vishas SAY_AGGRO'), +(-1189012,'Naughty secrets!',5849,1,0,0,'vishas SAY_HEALTH1'), +(-1189013,'I\'ll rip the secrets from your flesh!',5850,1,0,0,'vishas SAY_HEALTH2'), +(-1189014,'Purged by pain!',5848,1,0,0,'vishas SAY_KILL'), +(-1189015,'The monster got what he deserved.',0,0,1,0,'vishas SAY_TRIGGER_VORREL'), + +(-1189016,'We hunger for vengeance.',5844,1,0,0,'thalnos SAY_AGGRO'), +(-1189017,'No rest, for the angry dead.',5846,1,0,0,'thalnos SAY_HEALTH'), +(-1189018,'More... More souls.',5845,1,0,0,'thalnos SAY_KILL'), + +(-1189019,'You will not defile these mysteries!',5842,1,0,0,'doan SAY_AGGRO'), +(-1189020,'Burn in righteous fire!',5843,1,0,0,'doan SAY_SPECIALAE'), + +(-1189021,'Release the hounds!',5841,1,0,0,'loksey SAY_AGGRO'), + +(-1189022,'It is over, your search is done! Let fate choose now, the righteous one.',11961,1,0,0,'horseman SAY_ENTRANCE'), +(-1189023,'Here\'s my body, fit and pure! Now, your blackened souls I\'ll cure!',12567,1,0,0,'horseman SAY_REJOINED'), +(-1189024,'So eager you are for my blood to spill, yet to vanquish me this my head you must kill!',11969,1,0,0,'horseman SAY_BODY_DEFEAT'), +(-1189025,'Over here, you idiot!',12569,1,0,0,'horseman SAY_LOST_HEAD'), +(-1189026,'Harken, cur! Tis you I spurn! Now, $N, feel the burn!',12573,1,0,0,'horseman SAY_CONFLAGRATION'), +(-1189027,'Soldiers arise, stand and fight! Bring victory at last to this fallen knight!',11963,1,0,0,'horseman SAY_SPROUTING_PUMPKINS'), +(-1189028,'Your body lies beaten, battered and broken. Let my curse be your own, fate has spoken.',11962,1,0,0,'horseman SAY_SLAY'), +(-1189029,'This end have I reached before. What new adventure lies in store?',11964,1,0,0,'horseman SAY_DEATH'), +(-1189030,'%s laughs.',0,2,0,0,'horseman EMOTE_LAUGH'), +(-1189031,'Horseman rise...',0,0,0,0,'horseman SAY_PLAYER1'), +(-1189032,'Your time is night...',0,0,0,0,'horseman SAY_PLAYER2'), +(-1189033,'You felt death once...',0,0,0,0,'horseman SAY_PLAYER3'), +(-1189034,'Now, know demise!',0,0,0,0,'horseman SAY_PLAYER4'), + +(-1189035,'The master has fallen! Avenge him my brethren!',5834,1,0,0,'trainee SAY_TRAINEE_SPAWN'); + +-- -1 209 000 ZUL'FARRAK + +-- -1 229 000 BLACKROCK SPIRE + +-- -1 230 000 BLACKROCK DEPTHS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1230000,'Ah, hits the spot!',0,0,0,0,'rocknot SAY_GOT_BEER'), +(-1230001,'Come to aid the Throne!',0,1,0,0,'dagran SAY_AGGRO'), +(-1230002,'Hail to the king, baby!',0,1,0,0,'dagran SAY_SLAY'), +(-1230003,'You have challenged the Seven, and now you will die!',0,0,0,0,'doomrel SAY_DOOMREL_START_EVENT'), + +(-1230004,'The Sons of Thaurissan shall watch you perish in the Ring of the Law!',0,1,0,0,'grimstone SAY_START_1'), +(-1230005,'You have been sentenced to death for crimes against the Dark Iron Nation!',0,1,0,0,'grimstone SAY_START_2'), +(-1230006,'Unleash the fury and let it be done!',0,1,0,0,'grimstone SAY_OPEN_EAST_GATE'), +(-1230007,'But your real punishment lies ahead.',0,1,0,0,'grimstone SAY_SUMMON_BOSS_1'), +(-1230008,'Haha! I bet you thought you were done!',0,1,0,0,'grimstone SAY_SUMMON_BOSS_2'), +(-1230009,'Good Riddance!',0,1,0,0,'grimstone SAY_OPEN_NORTH_GATE'); + +-- -1 249 000 ONYXIA'S LAIR +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1249000,'How fortuitous. Usually, I must leave my lair to feed.',0,1,0,0,'onyxia SAY_AGGRO'), +(-1249001,'Learn your place mortal!',0,1,0,0,'onyxia SAY_KILL'), +(-1249002,'This meaningless exertion bores me. I\'ll incinerate you all from above!',0,1,0,254,'onyxia SAY_PHASE_2_TRANS'), +(-1249003,'It seems you\'ll need another lesson, mortals!',0,1,0,293,'onyxia SAY_PHASE_3_TRANS'), +(-1249004,'%s takes in a deep breath...',0,3,0,0,'onyxia EMOTE_BREATH'); + +-- -1 269 000 OPENING OF THE DARK PORTAL (BLACK MORASS) +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1269000,'Why do you persist? Surely you can see the futility of it all. It is not too late! You may still leave with your lives ...',10442,1,0,0,'temporus SAY_ENTER'), +(-1269001,'So be it ... you have been warned.',10444,1,0,0,'temporus SAY_AGGRO'), +(-1269002,'Time... sands of time is run out for you.',10443,1,0,0,'temporus SAY_BANISH'), +(-1269003,'You should have left when you had the chance.',10445,1,0,0,'temporus SAY_SLAY1'), +(-1269004,'Your days are done.',10446,1,0,0,'temporus SAY_SLAY2'), +(-1269005,'My death means ... little.',10447,1,0,0,'temporus SAY_DEATH'), + +(-1269006,'Why do you aid the Magus? Just think of how many lives could be saved if the portal is never opened, if the resulting wars could be erased ...',10412,1,0,0,'chrono_lord_deja SAY_ENTER'), +(-1269007,'If you will not cease this foolish quest, then you will die!',10414,1,0,0,'chrono_lord_deja SAY_AGGRO'), +(-1269008,'You have outstayed your welcome, Timekeeper. Begone!',10413,1,0,0,'chrono_lord_deja SAY_BANISH'), +(-1269009,'I told you it was a fool\'s quest!',10415,1,0,0,'chrono_lord_deja SAY_SLAY1'), +(-1269010,'Leaving so soon?',10416,1,0,0,'chrono_lord_deja SAY_SLAY2'), +(-1269011,'Time ... is on our side.',10417,1,0,0,'chrono_lord_deja SAY_DEATH'), + +(-1269012,'The time has come to shatter this clockwork universe forever! Let us no longer be slaves of the hourglass! I warn you: those who do not embrace the greater path shall become victims of its passing!',10400,1,0,0,'aeonus SAY_ENTER'), +(-1269013,'Let us see what fate lays in store...',10402,1,0,0,'aeonus SAY_AGGRO'), +(-1269014,'Your time is up, slave of the past!',10401,1,0,0,'aeonus SAY_BANISH'), +(-1269015,'One less obstacle in our way!',10403,1,0,0,'aeonus SAY_SLAY1'), +(-1269016,'No one can stop us! No one!',10404,1,0,0,'aeonus SAY_SLAY2'), +(-1269017,'It is only a matter...of time.',10405,1,0,0,'aeonus SAY_DEATH'), +(-1269018,'REUSE ME',0,0,0,0,'REUSE ME'), + +(-1269019,'Stop! Do not go further, mortals. You are ill-prepared to face the forces of the Infinite Dragonflight. Come, let me help you.',0,0,0,0,'saat SAY_SAAT_WELCOME'), + +(-1269020,'The time has come! Gul\'dan, order your warlocks to double their efforts! Moments from now the gateway will open, and your Horde will be released upon this ripe, unsuspecting world!',10435,1,0,0,'medivh SAY_ENTER'), +(-1269021,'What is this? Champions, coming to my aid? I sense the hand of the dark one in this. Truly this sacred event bears his blessing?',10436,1,0,0,'medivh SAY_INTRO'), +(-1269022,'Champions, my shield grows weak!',10437,1,0,0,'medivh SAY_WEAK75'), +(-1269023,'My powers must be concentrated on the portal! I do not have time to hold the shield!',10438,1,0,0,'medivh SAY_WEAK50'), +(-1269024,'The shield is nearly gone! All that I have worked for is in danger!',10439,1,0,0,'medivh SAY_WEAK25'), +(-1269025,'No... damn this feeble mortal coil...',10441,1,0,0,'medivh SAY_DEATH'), +(-1269026,'I am grateful for your aid, champions. Now, Gul\'dan\'s Horde will sweep across this world, like a locust swarm, and all my designs, all my carefully laid plans will at last fall into place.',10440,1,0,0,'medivh SAY_WIN'), +(-1269027,'Orcs of the Horde! This portalis the gateway to your new destiny! Azeroth lies before you, ripe for the taking!',0,1,0,0,'medivh SAY_ORCS_ENTER'), +(-1269028,'Gul\'dan speaks the truth! We should return at once to tell our brothers of the news! Retreat back trought the portal!',0,1,0,0,'medivh SAY_ORCS_ANSWER'); + +-- -1 289 000 SCHOLOMANCE + +-- -1 309 000 ZUL'GURUB +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1309000,'Let the coils of hate unfurl!',8421,1,0,0,'venoxis SAY_TRANSFORM'), +(-1309001,'Ssserenity..at lassst!',0,1,0,0,'venoxis SAY_DEATH'), + +(-1309002,'Lord Hir\'eek, grant me wings of vengance!',8417,1,0,0,'jeklik SAY_AGGRO'), +(-1309003,'I command you to rain fire down upon these invaders!',0,1,0,0,'jeklik SAY_RAIN_FIRE'), +(-1309004,'Finally ...death. Curse you Hakkar! Curse you!',8422,1,0,0,'jeklik SAY_DEATH'), + +(-1309005,'Draw me to your web mistress Shadra. Unleash your venom!',8418,1,0,0,'marli SAY_AGGRO'), +(-1309006,'Shadra, make of me your avatar!',0,1,0,0,'marli SAY_TRANSFORM'), +(-1309007,'Aid me my brood!',0,1,0,0,'marli SAY_SPIDER_SPAWN'), +(-1309008,'Bless you mortal for this release. Hakkar controls me no longer...',8423,1,0,0,'marli SAY_DEATH'), + +(-1309009,'Shirvallah, fill me with your RAGE!',8419,1,0,0,'thekal SAY_AGGRO'), +(-1309010,'Hakkar binds me no more! Peace at last!',8424,1,0,0,'thekal SAY_DEATH'), + +(-1309011,'Bethekk, your priestess calls upon your might!',8416,1,0,0,'arlokk SAY_AGGRO'), +(-1309012,'Feast on $n, my pretties!',0,1,0,0,'arlokk SAY_FEAST_PANTHER'), +(-1309013,'At last, I am free of the Soulflayer!',8412,1,0,0,'arlokk SAY_DEATH'), + +(-1309014,'Welcome to da great show friends! Step right up to die!',8425,1,0,0,'jindo SAY_AGGRO'), + +(-1309015,'I\'ll feed your souls to Hakkar himself!',8413,1,0,0,'mandokir SAY_AGGRO'), +(-1309016,'DING!',0,1,0,0,'mandokir SAY_DING_KILL'), +(-1309017,'GRATS!',0,1,0,0,'mandokir SAY_GRATS_JINDO'), +(-1309018,'$N! I\'m watching you!',0,1,0,0,'mandokir SAY_WATCH'), +(-1309019,'Don\'t make me angry. You won\'t like it when I\'m angry.',0,4,0,0,'mandokir SAY_WATCH_WHISPER'), + +(-1309020,'PRIDE HERALDS THE END OF YOUR WORLD. COME, MORTALS! FACE THE WRATH OF THE SOULFLAYER!',8414,1,0,0,'hakkar SAY_AGGRO'), +(-1309021,'Fleeing will do you no good, mortals!',0,1,0,0,'hakkar SAY_FLEEING'), +(-1309022,'You dare set foot upon Hakkari holy ground? Minions of Hakkar, destroy the infidels!',0,1,0,0,'hakkar SAY_MINION_DESTROY'), +(-1309023,'Minions of Hakkar, hear your God. The sanctity of this temple has been compromised. Invaders encroach upon holy ground! The Altar of Blood must be protected. Kill them all!',0,1,0,0,'hakkar SAY_PROTECT_ALTAR'), + +(-1309024,'%s goes into a rage after seeing his raptor fall in battle!',0,2,0,0,'mandokir EMOTE_RAGE'); + +-- -1 329 000 STRATHOLME +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1329000,'Thanks to Egan',0,0,0,0,'freed_soul SAY_ZAPPED0'), +(-1329001,'Rivendare must die',0,0,0,0,'freed_soul SAY_ZAPPED1'), +(-1329002,'Who you gonna call?',0,0,0,0,'freed_soul SAY_ZAPPED2'), +(-1329003,'Don\'t cross those beams!',0,0,0,0,'freed_soul SAY_ZAPPED3'), + +(-1329004,'An Ash\'ari Crystal has fallen! Stay true to the Lich King, my brethren, and attempt to resummon it.',0,6,0,0,'thuzadin acolyte SAY_ANNOUNCE_ZIGGURAT_1'), +(-1329005,'One of the Ash\'ari Crystals has been destroyed! Slay the intruders!',0,6,0,0,'thuzadin acolyte SAY_ANNOUNCE_ZIGGURAT_2'), +(-1329006,'An Ash\'ari Crystal has been toppled! Restore the ziggurat before the Necropolis is vulnerable!',0,6,0,0,'thuzadin acolyte SAY_ANNOUNCE_ZIGGURAT_3'), +(-1329007,'The Ash\'ari Crystals have been destroyed! The Slaughterhouse is vulnerable!',0,6,0,0,'baron rivendare SAY_ANNOUNCE_RIVENDARE'); + +-- -1 349 000 MARAUDON + +-- -1 389 000 RAGEFIRE CHASM + +-- -1 409 000 MOLTEN CORE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1409000,'%s performs one last service for Ragnaros.',0,2,0,0,'geddon EMOTE_SERVICE'), +(-1409001,'REUSE ME',0,0,0,0,'REUSE ME'), +(-1409002,'%s refuses to die while its master is in trouble.',0,2,0,0,'core rager EMOTE_LOWHP'), + +(-1409003,'Reckless mortals, none may challenge the sons of the living flame!',8035,1,0,0,'majordomo SAY_AGGRO'), +(-1409004,'The runes of warding have been destroyed! Hunt down the infedels my bretheren.',8039,1,0,0,'majordomo SAY_SPAWN'), +(-1409005,'Ashes to Ashes!',8037,1,0,0,'majordomo SAY_SLAY'), +(-1409006,'Burn mortals! Burn for this transgression!',8036,1,0,0,'majordomo SAY_SPECIAL'), +(-1409007,'Impossible! Stay your attack mortals! I submitt! I submitt! Brashly you have come to rest the secrets of the living flame. You will soon regret the recklessness of your quest. I go now to summon the lord whos house this is. Should you seek an audiance with him your paltry lives will surly be forfit. Nevertheless seek out his lair if you dare!',8038,1,0,0,'majordomo SAY_DEFEAT'), + +(-1409008,'Behold Ragnaros, the Firelord! He who was ancient when this world was young! Bow before him, mortals! Bow before your ending!',8040,1,0,0,'ragnaros SAY_SUMMON_MAJ'), +(-1409009,'TOO SOON! YOU HAVE AWAKENED ME TOO SOON, EXECUTUS! WHAT IS THE MEANING OF THIS INTRUSION?',8043,1,0,0,'ragnaros SAY_ARRIVAL1_RAG'), +(-1409010,'These mortal infidels, my lord! They have invaded your sanctum, and seek to steal your secrets!',8041,1,0,0,'ragnaros SAY_ARRIVAL2_MAJ'), +(-1409011,'FOOL! YOU ALLOWED THESE INSECTS TO RUN RAMPANT THROUGH THE HALLOWED CORE, AND NOW YOU LEAD THEM TO MY VERY LAIR? YOU HAVE FAILED ME, EXECUTUS! JUSTICE SHALL BE MET, INDEED!',8044,1,0,0,'ragnaros SAY_ARRIVAL3_RAG'), +(-1409012,'NOW FOR YOU, INSECTS. BOLDLY YOU SAUGHT THE POWER OF RAGNAROS NOW YOU SHALL SEE IT FIRST HAND.',8045,1,0,0,'ragnaros SAY_ARRIVAL5_RAG'), + +(-1409013,'COME FORTH, MY SERVANTS! DEFEND YOUR MASTER!',8049,1,0,0,'ragnaros SAY_REINFORCEMENTS1'), +(-1409014,'YOU CANNOT DEFEAT THE LIVING FLAME! COME YOU MINIONS OF FIRE! COME FORTH YOU CREATURES OF HATE! YOUR MASTER CALLS!',8050,1,0,0,'ragnaros SAY_REINFORCEMENTS2'), +(-1409015,'BY FIRE BE PURGED!',8046,1,0,0,'ragnaros SAY_HAND'), +(-1409016,'TASTE THE FLAMES OF SULFURON!',8047,1,0,0,'ragnaros SAY_WRATH'), +(-1409017,'DIE INSECT!',8051,1,0,0,'ragnaros SAY_KILL'), +(-1409018,'MY PATIENCE IS DWINDILING! COME NATS TO YOUR DEATH!',8048,1,0,0,'ragnaros SAY_MAGMABURST'); + +-- -1 429 000 DIRE MAUL + +-- -1 469 000 BLACKWING LAIR +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1469000,'None of your kind should be here! You\'ve doomed only yourselves!',8286,1,0,0,'broodlord SAY_AGGRO'), +(-1469001,'Clever Mortals but I am not so easily lured away from my sanctum!',8287,1,0,0,'broodlord SAY_LEASH'), + +(-1469002,'REUSE ME',0,0,0,0,'REUSE ME'), +(-1469003,'%s flinches as its skin shimmers.',0,2,0,0,'chromaggus EMOTE_SHIMMER'), + +(-1469004,'In this world where time is your enemy, it is my greatest ally. This grand game of life that you think you play in fact plays you. To that I say...',0,0,0,0,'victor_nefarius SAY_GAMESBEGIN_1'), +(-1469005,'Let the games begin!',8280,1,0,0,'victor_nefarius SAY_GAMESBEGIN_2'), +(-1469006,'Ah, the heroes. You are persistent, aren\'t you. Your allied attempted to match his power against mine, and had to pay the price. Now he shall serve me, by slaughtering you. Get up little red wyrm and destroy them!',8279,1,0,0,'victor_nefarius SAY_VAEL_INTRO'), + +(-1469007,'Well done, my minions. The mortals\' courage begins to wane! Now, let\'s see how they contend with the true Lord of Blackrock Spire!',8288,1,0,0,'nefarian SAY_AGGRO'), +(-1469008,'Enough! Now you vermin shall feel the force of my birthright, the fury of the earth itself.',8289,1,0,0,'nefarian SAY_XHEALTH'), +(-1469009,'Burn, you wretches! Burn!',8290,1,0,0,'nefarian SAY_SHADOWFLAME'), +(-1469010,'Impossible! Rise my minions! Serve your master once more!',8291,1,0,0,'nefarian SAY_RAISE_SKELETONS'), +(-1469011,'Worthless $N! Your friends will join you soon enough!',8293,1,0,0,'nefarian SAY_SLAY'), +(-1469012,'This cannot be! I am the Master here! You mortals are nothing to my kind! DO YOU HEAR? NOTHING!',8292,1,0,0,'nefarian SAY_DEATH'), +(-1469013,'Mages too? You should be more careful when you play with magic...',0,1,0,0,'nefarian SAY_MAGE'), +(-1469014,'Warriors, I know you can hit harder than that! Let\'s see it!',0,1,0,0,'nefarian SAY_WARRIOR'), +(-1469015,'Druids and your silly shapeshifting. Let\'s see it in action!',0,1,0,0,'nefarian SAY_DRUID'), +(-1469016,'Priests! If you\'re going to keep healing like that, we might as well make it a little more interesting!',0,1,0,0,'nefarian SAY_PRIEST'), +(-1469017,'Paladins, I\'ve heard you have many lives. Show me.',0,1,0,0,'nefarian SAY_PALADIN'), +(-1469018,'Shamans, show me what your totems can do!',0,1,0,0,'nefarian SAY_SHAMAN'), +(-1469019,'Warlocks, you shouldn\'t be playing with magic you don\'t understand. See what happens?',0,1,0,0,'nefarian SAY_WARLOCK'), +(-1469020,'Hunters and your annoying pea-shooters!',0,1,0,0,'nefarian SAY_HUNTER'), +(-1469021,'Rogues? Stop hiding and face me!',0,1,0,0,'nefarian SAY_ROGUE'), + +(-1469022,'You\'ll pay for forcing me to do this.',8275,1,0,0,'razorgore SAY_EGGS_BROKEN1'), +(-1469023,'Fools! These eggs are more precious than you know.',8276,1,0,0,'razorgore SAY_EGGS_BROKEN2'), +(-1469024,'No! Not another one! I\'ll have your heads for this atrocity.',8277,1,0,0,'razorgore SAY_EGGS_BROKEN3'), +(-1469025,'If I fall into the abyss I\'ll take all of you mortals with me...',8278,1,0,0,'razorgore SAY_DEATH'), + +(-1469026,'Too late...friends. Nefarius\' corruption has taken hold. I cannot...control myself.',8281,1,0,0,'vaelastrasz SAY_LINE1'), +(-1469027,'I beg you Mortals, flee! Flee before I lose all control. The Black Fire rages within my heart. I must release it!',8282,1,0,0,'vaelastrasz SAY_LINE2'), +(-1469028,'FLAME! DEATH! DESTRUCTION! COWER MORTALS BEFORE THE WRATH OF LORD....NO! I MUST FIGHT THIS!',8283,1,0,0,'vaelastrasz SAY_LINE3'), +(-1469029,'Nefarius\' hate has made me stronger than ever before. You should have fled, while you could, mortals! The fury of Blackrock courses through my veins!',8285,1,0,0,'vaelastrasz SAY_HALFLIFE'), +(-1469030,'Forgive me $N, your death only adds to my failure.',8284,1,0,0,'vaelastrasz SAY_KILLTARGET'), + +(-1469031,'REUSE ME',0,0,0,0,'REUSE ME'); + +-- -1 509 000 RUINS OF AHN'QIRAJ +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1509000,'%s senses your fear.',0,2,0,0,'moam EMOTE_AGGRO'), +(-1509001,'%s bristles with energy!',0,2,0,0,'moan EMOTE_MANA_FULL'), +(-1509028,'%s drains your mana and turns to stone.',0,2,0,0,'moam EMOTE_ENERGIZING'), + +(-1509002,'%s sets eyes on $N!',0,2,0,0,'buru EMOTE_TARGET'), + +(-1509003,'They come now. Try not to get yourself killed, young blood.',0,1,0,0,'andorov SAY_ANDOROV_INTRO'), +(-1509004,'Remember, Rajaxx, when I said I\'d kill you last? I lied...',0,1,0,0,'andorov SAY_ANDOROV_ATTACK'), + +(-1509005,'The time of our retribution is at hand! Let darkness reign in the hearts of our enemies!',8612,1,0,0,'rajaxx SAY_WAVE3'), +(-1509006,'No longer will we wait behind barred doors and walls of stone! No longer will our vengeance be denied! The dragons themselves will tremble before our wrath!',8610,1,0,0,'rajaxx SAY_WAVE4'), +(-1509007,'Fear is for the enemy! Fear and death!',8608,1,0,0,'rajaxx SAY_WAVE5'), +(-1509008,'Staghelm will whimper and beg for his life, just as his whelp of a son did! One thousand years of injustice will end this day!',8611,1,0,0,'rajaxx SAY_WAVE6'), +(-1509009,'Fandral! Your time has come! Go and hide in the Emerald Dream and pray we never find you!',8607,1,0,0,'rajaxx SAY_WAVE7'), +(-1509010,'Impudent fool! I will kill you myself!',8609,1,0,0,'rajaxx SAY_INTRO'), +(-1509011,'Attack and make them pay dearly!',8603,1,0,0,'rajaxx SAY_UNK1'), +(-1509012,'Crush them! Drive them out!',8605,1,0,0,'rajaxx SAY_UNK2'), +(-1509013,'Do not hesitate! Destroy them!',8606,1,0,0,'rajaxx SAY_UNK3'), +(-1509014,'Warriors! Captains! Continue the fight!',8613,1,0,0,'rajaxx SAY_UNK4'), +(-1509015,'You are not worth my time $N!',8614,1,0,0,'rajaxx SAY_DEAGGRO'), +(-1509016,'Breath your last!',8604,1,0,0,'rajaxx SAY_KILLS_ANDOROV'), +(-1509017,'Soon you will know the price of your meddling, mortals... The master is nearly whole... And when he rises, your world will be cease!',0,1,0,0,'rajaxx SAY_COMPLETE_QUEST'), + +(-1509018,'I am rejuvinated!',8593,1,0,0,'ossirian SAY_SURPREME1'), +(-1509019,'My powers are renewed!',8595,1,0,0,'ossirian SAY_SURPREME2'), +(-1509020,'My powers return!',8596,1,0,0,'ossirian SAY_SURPREME3'), +(-1509021,'Protect the city at all costs!',8597,1,0,0,'ossirian SAY_RAND_INTRO1'), +(-1509022,'The walls have been breached!',8599,1,0,0,'ossirian SAY_RAND_INTRO2'), +(-1509023,'To your posts. Defend the city.',8600,1,0,0,'ossirian SAY_RAND_INTRO3'), +(-1509024,'Tresspassers will be terminated.',8601,1,0,0,'ossirian SAY_RAND_INTRO4'), +(-1509025,'Sands of the desert rise and block out the sun!',8598,1,0,0,'ossirian SAY_AGGRO'), +(-1509026,'You are terminated.',8602,1,0,0,'ossirian SAY_SLAY'), +(-1509027,'I...have...failed.',8594,1,0,0,'ossirian SAY_DEATH'); + +-- -1 531 000 TEMPLE OF AHN'QIRAJ +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1531000,'Are you so eager to die? I would be happy to accomodate you.',8615,1,0,0,'skeram SAY_AGGRO1'), +(-1531001,'Cower mortals! The age of darkness is at hand.',8616,1,0,0,'skeram SAY_AGGRO2'), +(-1531002,'Tremble! The end is upon you.',8621,1,0,0,'skeram SAY_AGGRO3'), +(-1531003,'Let your death serve as an example!',8617,1,0,0,'skeram SAY_SLAY1'), +(-1531004,'Spineless wretches! You will drown in rivers of blood!',8619,1,0,0,'skeram SAY_SLAY2'), +(-1531005,'The screams of the dying will fill the air. A symphony of terror is about to begin!',8620,1,0,0,'skeram SAY_SLAY3'), +(-1531006,'Prepare for the return of the ancient ones!',8618,1,0,0,'skeram SAY_SPLIT'), +(-1531007,'You only delay... the inevetable.',8622,1,0,0,'skeram SAY_DEATH'), + +(-1531008,'You will be judged for defiling these sacred grounds! The laws of the Ancients will not be challenged! Trespassers will be annihilated!',8646,1,0,0,'sartura SAY_AGGRO'), +(-1531009,'I sentence you to death!',8647,1,0,0,'sartura SAY_SLAY'), +(-1531010,'I serve to the last!',8648,1,0,0,'sartura SAY_DEATH'), + +(-1531011,'%s is weakened!',0,2,0,0,'cthun EMOTE_WEAKENED'); + +-- -1 532 000 KARAZHAN +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1532000,'Well done Midnight!',9173,1,0,0,'attumen SAY_MIDNIGHT_KILL'), +(-1532001,'Cowards! Wretches!',9167,1,0,0,'attumen SAY_APPEAR1'), +(-1532002,'Who dares attack the steed of the Huntsman?',9298,1,0,0,'attumen SAY_APPEAR2'), +(-1532003,'Perhaps you would rather test yourselves against a more formidable opponent?!',9299,1,0,0,'attumen SAY_APPEAR3'), +(-1532004,'Come, Midnight, let\'s disperse this petty rabble!',9168,1,0,0,'attumen SAY_MOUNT'), +(-1532005,'It was... inevitable.',9169,1,0,0,'attumen SAY_KILL1'), +(-1532006,'Another trophy to add to my collection!',9300,1,0,0,'attumen SAY_KILL2'), +(-1532007,'Weapons are merely a convenience for a warrior of my skill!',9166,1,0,0,'attumen SAY_DISARMED'), +(-1532008,'I always knew... someday I would become... the hunted.',9165,1,0,0,'attumen SAY_DEATH'), +(-1532009,'Such easy sport.',9170,1,0,0,'attumen SAY_RANDOM1'), +(-1532010,'Amateurs! Do not think you can best me! I kill for a living.',9304,1,0,0,'attumen SAY_RANDOM2'), + +(-1532011,'Hmm, unannounced visitors? Preparations must be made.',9211,1,0,0,'moroes SAY_AGGRO'), +(-1532012,'Now, where was I? Oh yes...',9215,1,0,0,'moroes SAY_SPECIAL_1'), +(-1532013,'You rang?',9316,1,0,0,'moroes SAY_SPECIAL_2'), +(-1532014,'One more for dinner this evening.',9214,1,0,0,'moroes SAY_KILL_1'), +(-1532015,'Time... Never enough time.',9314,1,0,0,'moroes SAY_KILL_2'), +(-1532016,'I\'ve gone and made a mess.',9315,1,0,0,'moroes SAY_KILL_3'), +(-1532017,'How terribly clumsy of me...',9213,1,0,0,'moroes SAY_DEATH'), + +(-1532018,'Your behavior will not be tolerated!',9204,1,0,0,'maiden SAY_AGGRO'), +(-1532019,'Ah ah ah...',9207,1,0,0,'maiden SAY_SLAY1'), +(-1532020,'This is for the best.',9312,1,0,0,'maiden SAY_SLAY2'), +(-1532021,'Impure thoughts lead to profane actions.',9311,1,0,0,'maiden SAY_SLAY3'), +(-1532022,'Cast out your corrupt thoughts.',9313,1,0,0,'maiden SAY_REPENTANCE1'), +(-1532023,'Your impurity must be cleansed.',9208,1,0,0,'maiden SAY_REPENTANCE2'), +(-1532024,'Death comes. Will your conscience be clear?',9206,1,0,0,'maiden SAY_DEATH'), + +(-1532025,'Oh at last, at last. I can go home.',9190,1,0,0,'dorothee SAY_DOROTHEE_DEATH'), +(-1532026,'Don\'t let them hurt us, Tito! Oh, you won\'t, will you?',9191,1,0,0,'dorothee SAY_DOROTHEE_SUMMON'), +(-1532027,'Tito, oh Tito, no!',9192,1,0,0,'dorothee SAY_DOROTHEE_TITO_DEATH'), +(-1532028,'Oh dear, we simply must find a way home! The old wizard could be our only hope! Strawman, Roar, Tinhead, will you... wait! Oh golly, look! We have visitors!',9195,1,0,0,'dorothee SAY_DOROTHEE_AGGRO'), + +(-1532029,'Wanna fight? Huh? Do ya? C\'mon, I\'ll fight you with both claws behind my back!',9227,1,0,0,'roar SAY_ROAR_AGGRO'), +(-1532030,'You didn\'t have to go and do that.',9229,1,0,0,'roar SAY_ROAR_DEATH'), +(-1532031,'I think I\'m going to go take fourty winks.',9230,1,0,0,'roar SAY_ROAR_SLAY'), + +(-1532032,'Now what should I do with you? I simply can\'t make up my mind.',9254,1,0,0,'strawman SAY_STRAWMAN_AGGRO'), +(-1532033,'Don\'t let them make a mattress... out of me.',9256,1,0,0,'strawman SAY_STRAWMAN_DEATH'), +(-1532034,'I guess I\'m not a failure after all.',9257,1,0,0,'strawman SAY_STRAWMAN_SLAY'), + +(-1532035,'I could really use a heart. Say, can I have yours?',9268,1,0,0,'tinhead SAY_TINHEAD_AGGRO'), +(-1532036,'Back to being an old rustbucket.',9270,1,0,0,'tinhead SAY_TINHEAD_DEATH'), +(-1532037,'Guess I\'m not so rusty, after all.',9271,1,0,0,'tinhead SAY_TINHEAD_SLAY'), +(-1532038,'%s begins to rust.',0,2,0,0,'tinhead EMOTE_RUST'), + +(-1532039,'Woe to each and every one of you my pretties! ',9179,1,0,0,'crone SAY_CRONE_AGGRO'), +(-1532040,'It will all be over soon! ',9307,1,0,0,'crone SAY_CRONE_AGGRO2'), +(-1532041,'How could you? What a cruel, cruel world!',9178,1,0,0,'crone SAY_CRONE_DEATH'), +(-1532042,'Fixed you, didn\'t I? ',9180,1,0,0,'crone SAY_CRONE_SLAY'), + +(-1532043,'All the better to own you with!',9276,1,0,0,'wolf SAY_WOLF_AGGRO'), +(-1532044,'Mmmm... delicious.',9277,1,0,0,'wolf SAY_WOLF_SLAY'), +(-1532045,'Run away little girl, run away!',9278,1,0,0,'wolf SAY_WOLF_HOOD'), + +(-1532046,'What devil art thou, that dost torment me thus?',9196,1,0,0,'julianne SAY_JULIANNE_AGGRO'), +(-1532047,'Where is my lord? Where is my Romulo?',9199,1,0,0,'julianne SAY_JULIANNE_ENTER'), +(-1532048,'Romulo, I come! Oh... this do I drink to thee!',9198,1,0,0,'julianne SAY_JULIANNE_DEATH01'), +(-1532049,'Where is my Lord? Where is my Romulo? Ohh, happy dagger! This is thy sheath! There rust, and let me die!',9310,1,0,0,'julianne SAY_JULIANNE_DEATH02'), +(-1532050,'Come, gentle night; and give me back my Romulo!',9200,1,0,0,'julianne SAY_JULIANNE_RESURRECT'), +(-1532051,'Parting is such sweet sorrow.',9201,1,0,0,'julianne SAY_JULIANNE_SLAY'), + +(-1532052,'Wilt thou provoke me? Then have at thee, boy!',9233,1,0,0,'romulo SAY_ROMULO_AGGRO'), +(-1532053,'Thou smilest... upon the stroke that... murders me.',9235,1,0,0,'romulo SAY_ROMULO_DEATH'), +(-1532054,'This day\'s black fate on more days doth depend. This but begins the woe. Others must end.',9236,1,0,0,'romulo SAY_ROMULO_ENTER'), +(-1532055,'Thou detestable maw, thou womb of death; I enforce thy rotten jaws to open!',9237,1,0,0,'romulo SAY_ROMULO_RESURRECT'), +(-1532056,'How well my comfort is revived by this!',9238,1,0,0,'romulo SAY_ROMULO_SLAY'), + +(-1532057,'The Menagerie is for guests only.',9183,1,0,0,'curator SAY_AGGRO'), +(-1532058,'Gallery rules will be strictly enforced.',9188,1,0,0,'curator SAY_SUMMON1'), +(-1532059,'This curator is equipped for gallery protection.',9309,1,0,0,'curator SAY_SUMMON2'), +(-1532060,'Your request cannot be processed.',9186,1,0,0,'curator SAY_EVOCATE'), +(-1532061,'Failure to comply will result in offensive action.',9185,1,0,0,'curator SAY_ENRAGE'), +(-1532062,'Do not touch the displays.',9187,1,0,0,'curator SAY_KILL1'), +(-1532063,'You are not a guest.',9308,1,0,0,'curator SAY_KILL2'), +(-1532064,'This Curator is no longer op... er... ation... al.',9184,1,0,0,'curator SAY_DEATH'), + +(-1532065,'Your blood will anoint my circle.',9264,1,0,0,'terestian SAY_SLAY1'), +(-1532066,'The great one will be pleased.',9329,1,0,0,'terestian SAY_SLAY2'), +(-1532067,'My life, is yours. Oh great one.',9262,1,0,0,'terestian SAY_DEATH'), +(-1532068,'Ah, you\'re just in time. The rituals are about to begin.',9260,1,0,0,'terestian SAY_AGGRO'), +(-1532069,'Please, accept this humble offering, oh great one.',9263,1,0,0,'terestian SAY_SACRIFICE1'), +(-1532070,'Let the sacrifice serve his testament to my fealty.',9330,1,0,0,'terestian SAY_SACRIFICE2'), +(-1532071,'Come, you dwellers in the dark. Rally to my call!',9265,1,0,0,'terestian SAY_SUMMON1'), +(-1532072,'Gather, my pets. There is plenty for all.',9331,1,0,0,'terestian SAY_SUMMON2'), + +(-1532073,'Please, no more. My son... he\'s gone mad!',9241,1,0,0,'aran SAY_AGGRO1'), +(-1532074,'I\'ll not be tortured again!',9323,1,0,0,'aran SAY_AGGRO2'), +(-1532075,'Who are you? What do you want? Stay away from me!',9324,1,0,0,'aran SAY_AGGRO3'), +(-1532076,'I\'ll show you this beaten dog still has some teeth!',9245,1,0,0,'aran SAY_FLAMEWREATH1'), +(-1532077,'Burn you hellish fiends!',9326,1,0,0,'aran SAY_FLAMEWREATH2'), +(-1532078,'I\'ll freeze you all!',9246,1,0,0,'aran SAY_BLIZZARD1'), +(-1532079,'Back to the cold dark with you!',9327,1,0,0,'aran SAY_BLIZZARD2'), +(-1532080,'Yes, yes, my son is quite powerful... but I have powers of my own!',9242,1,0,0,'aran SAY_EXPLOSION1'), +(-1532081,'I am not some simple jester! I am Nielas Aran!',9325,1,0,0,'aran SAY_EXPLOSION2'), +(-1532082,'Surely you would not deny an old man a replenishing drink? No, no I thought not.',9248,1,0,0,'aran SAY_DRINK'), +(-1532083,'I\'m not finished yet! No, I have a few more tricks up me sleeve.',9251,1,0,0,'aran SAY_ELEMENTALS'), +(-1532084,'I want this nightmare to be over!',9250,1,0,0,'aran SAY_KILL1'), +(-1532085,'Torment me no more!',9328,1,0,0,'aran SAY_KILL2'), +(-1532086,'You\'ve wasted enough of my time. Let these games be finished!',9247,1,0,0,'aran SAY_TIMEOVER'), +(-1532087,'At last... The nightmare is.. over...',9244,1,0,0,'aran SAY_DEATH'), +(-1532088,'Where did you get that?! Did HE send you?!',9249,1,0,0,'aran SAY_ATIESH'), + +(-1532089,'%s cries out in withdrawal, opening gates to the warp.',0,2,0,0,'netherspite EMOTE_PHASE_PORTAL'), +(-1532090,'%s goes into a nether-fed rage!',0,2,0,0,'netherspite EMOTE_PHASE_BANISH'), + +(-1532091,'Madness has brought you here to me. I shall be your undoing!',9218,1,0,0,'malchezaar SAY_AGGRO'), +(-1532092,'Simple fools! Time is the fire in which you\'ll burn!',9220,1,0,0,'malchezaar SAY_AXE_TOSS1'), +(-1532093,'I see the subtlety of conception is beyond primitives such as you.',9317,1,0,0,'malchezaar SAY_AXE_TOSS2'), +(-1532094,'Who knows what secrets hide in the dark.',9223,1,0,0,'malchezaar SAY_SPECIAL1'), +(-1532095,'The cerestial forces are mine to manipulate.',9320,1,0,0,'malchezaar SAY_SPECIAL2'), +(-1532096,'How can you hope to withstand against such overwhelming power?',9321,1,0,0,'malchezaar SAY_SPECIAL3'), +(-1532097,'Surely you did not think you could win.',9222,1,0,0,'malchezaar SAY_SLAY1'), +(-1532098,'Your greed, your foolishness has brought you to this end.',9318,1,0,0,'malchezaar SAY_SLAY2'), +(-1532099,'You are, but a plaything, unfit even to amuse.',9319,1,0,0,'malchezaar SAY_SLAY3'), +(-1532100,'All realities, all dimensions are open to me!',9224,1,0,0,'malchezaar SAY_SUMMON1'), +(-1532101,'You face not Malchezaar alone, but the legions I command!',9322,1,0,0,'malchezaar SAY_SUMMON2'), +(-1532102,'I refuse to concede defeat. I am a prince of the Eredar! I am...',9221,1,0,0,'malchezaar SAY_DEATH'), + +(-1532103,'Welcome Ladies and Gentlemen, to this evening\'s presentation!',9174,1,0,0,'barnes OZ1'), +(-1532104,'Tonight we plumb the depths of the human soul as we join a lost, lonely girl trying desperately -- with the help of her loyal companions -- to find her way home!',9338,1,0,0,'barnes OZ2'), +(-1532105,'But she is pursued... by a wicked malevolent crone!',9339,1,0,0,'barnes OZ3'), +(-1532106,'Will she survive? Will she prevail? Only time will tell. And now ... on with the show!',9340,1,0,0,'barnes OZ4'), +(-1532107,'Good evening, Ladies and Gentlemen! Welcome to this evening\'s presentation!',9175,1,0,0,'barnes HOOD1'), +(-1532108,'Tonight, things are not what they seem. For tonight, your eyes may not be trusted',9335,1,0,0,'barnes HOOD2'), +(-1532109,'Take for instance, this quiet, elderly woman, waiting for a visit from her granddaughter. Surely there is nothing to fear from this sweet, grey-haired, old lady.',9336,1,0,0,'barnes HOOD3'), +(-1532110,'But don\'t let me pull the wool over your eyes. See for yourself what lies beneath those covers! And now... on with the show!',9337,1,0,0,'barnes HOOD4'), +(-1532111,'Welcome, Ladies and Gentlemen, to this evening\'s presentation!',9176,1,0,0,'barnes RAJ1'), +(-1532112,'Tonight, we explore a tale of forbidden love!',9341,1,0,0,'barnes RAJ2'), +(-1532113,'But beware, for not all love stories end happily, as you may find out. Sometimes, love pricks like a thorn.',9342,1,0,0,'barnes RAJ3'), +(-1532114,'But don\'t take it from me, see for yourself what tragedy lies ahead when the paths of star-crossed lovers meet. And now...on with the show!',9343,1,0,0,'barnes RAJ4'); + +-- -1 533 000 NAXXRAMAS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1533000,'Ahh... welcome to my parlor.',8788,1,0,0,'anubrekhan SAY_GREET'), +(-1533001,'Just a little taste...',8785,1,0,0,'anubrekhan SAY_AGGRO1'), +(-1533002,'There is no way out.',8786,1,0,0,'anubrekhan SAY_AGGRO2'), +(-1533003,'Yes, Run! It makes the blood pump faster!',8787,1,0,0,'anubrekhan SAY_AGGRO3'), +(-1533004,'I hear little hearts beating. Yesss... beating faster now. Soon the beating will stop.',8790,1,0,0,'anubrekhan SAY_TAUNT1'), +(-1533005,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,0,'anubrekhan SAY_TAUNT2'), +(-1533006,'Which one shall I eat first? So difficult to choose... the all smell so delicious.',8792,1,0,0,'anubrekhan SAY_TAUNT3'), +(-1533007,'Closer now... tasty morsels. I\'ve been too long without food. Without blood to drink.',8793,1,0,0,'anubrekhan SAY_TAUNT4'), +(-1533008,'Shh... it will all be over soon.',8789,1,0,0,'anubrekhan SAY_SLAY'), + +(-1533009,'Your old lives, your mortal desires, mean nothing. You are acolytes of the master now, and you will serve the cause without question! The greatest glory is to die in the master\'s service!',8799,1,0,0,'faerlina SAY_GREET'), +(-1533010,'Slay them in the master\'s name!',8794,1,0,0,'faerlina SAY_AGGRO1'), +(-1533011,'You cannot hide from me!',8795,1,0,0,'faerlina SAY_AGGRO2'), +(-1533012,'Kneel before me, worm!',8796,1,0,0,'faerlina SAY_AGGRO3'), +(-1533013,'Run while you still can!',8797,1,0,0,'faerlina SAY_AGGRO4'), +(-1533014,'You have failed!',8800,1,0,0,'faerlina SAY_SLAY1'), +(-1533015,'Pathetic wretch!',8801,1,0,0,'faerlina SAY_SLAY2'), +(-1533016,'The master... will avenge me!',8798,1,0,0,'faerlina SAY_DEATH'), + +(-1533017,'Patchwerk want to play!',8909,1,0,0,'patchwerk SAY_AGGRO1'), +(-1533018,'Kel\'Thuzad make Patchwerk his Avatar of War!',8910,1,0,0,'patchwerk SAY_AGGRO2'), +(-1533019,'No more play?',8912,1,0,0,'patchwerk SAY_SLAY'), +(-1533020,'What happened to... Patch...',8911,1,0,0,'patchwerk SAY_DEATH'), +(-1533021,'%s goes into a berserker rage!',0,2,0,0,'patchwerk EMOTE_BERSERK'), +(-1533022,'%s becomes enraged!',0,2,0,0,'patchwerk EMOTE_ENRAGE'), + +(-1533023,'Stalagg crush you!',8864,1,0,0,'stalagg SAY_STAL_AGGRO'), +(-1533024,'Stalagg kill!',8866,1,0,0,'stalagg SAY_STAL_SLAY'), +(-1533025,'Master save me...',8865,1,0,0,'stalagg SAY_STAL_DEATH'), +(-1533026,'Feed you to master!',8802,1,0,0,'feugen SAY_FEUG_AGGRO'), +(-1533027,'Feugen make master happy!',8804,1,0,0,'feugen SAY_FEUG_SLAY'), +(-1533028,'No... more... Feugen...',8803,1,0,0,'feugen SAY_FEUG_DEATH'), + +(-1533029,'You are too late... I... must... OBEY!',8872,1,0,0,'thaddius SAY_GREET'), +(-1533030,'KILL!',8867,1,0,0,'thaddius SAY_AGGRO1'), +(-1533031,'EAT YOUR BONES!',8868,1,0,0,'thaddius SAY_AGGRO2'), +(-1533032,'BREAK YOU!',8869,1,0,0,'thaddius SAY_AGGRO3'), +(-1533033,'You die now!',8877,1,0,0,'thaddius SAY_SLAY'), +(-1533034,'Now YOU feel pain!',8871,1,0,0,'thaddius SAY_ELECT'), +(-1533035,'Thank... you...',8870,1,0,0,'thaddius SAY_DEATH'), +(-1533036,'Pleeease!',8873,1,0,0,'thaddius SAY_SCREAM1'), +(-1533037,'Stop, make it stop!',8874,1,0,0,'thaddius SAY_SCREAM2'), +(-1533038,'Help me! Save me!',8875,1,0,0,'thaddius SAY_SCREAM3'), +(-1533039,'Please, nooo!',8876,1,0,0,'thaddius SAY_SCREAM4'), + +(-1533040,'Foolishly you have sought your own demise.',8807,1,0,0,'gothik SAY_SPEECH_1'), +(-1533041,'Death is the only escape.',8806,1,0,0,'gothik SAY_KILL'), +(-1533042,'I... am... undone!',8805,1,0,0,'gothik SAY_DEATH'), +(-1533043,'I have waited long enough! Now, you face the harvester of souls!',8808,1,0,0,'gothik SAY_TELEPORT'), + +(-1533044,'Defend youself!',8892,1,0,0,'blaumeux SAY_BLAU_AGGRO'), +(-1533045,'Come, Zeliek, do not drive them out. Not before we\'ve had our fun.',8896,1,0,0,'blaumeux SAY_BLAU_TAUNT1'), +(-1533046,'I do hope they stay alive long enough for me to... introduce myself.',8897,1,0,0,'blaumeux SAY_BLAU_TAUNT2'), +(-1533047,'The first kill goes to me! Anyone care to wager?',8898,1,0,0,'blaumeux SAY_BLAU_TAUNT3'), +(-1533048,'Your life is mine!',8895,1,0,0,'blaumeux SAY_BLAU_SPECIAL'), +(-1533049,'Who\'s next?',8894,1,0,0,'blaumeux SAY_BLAU_SLAY'), +(-1533050,'Tou... che!',8893,1,0,0,'blaumeux SAY_BLAU_DEATH'), + +(-1533051,'Come out and fight, ye wee ninny!',8899,1,0,0,'korthazz SAY_KORT_AGGRO'), +(-1533052,'To arms, ye roustabouts! We\'ve got company!',8903,1,0,0,'korthazz SAY_KORT_TAUNT1'), +(-1533053,'I heard about enough of yer sniveling. Shut yer fly trap \'afore I shut it for ye!',8904,1,0,0,'korthazz SAY_KORT_TAUNT2'), +(-1533054,'I\'m gonna enjoy killin\' these slack-jawed daffodils!',8905,1,0,0,'korthazz SAY_KORT_TAUNT3'), +(-1533055,'I like my meat extra crispy!',8902,1,0,0,'korthazz SAY_KORT_SPECIAl'), +(-1533056,'Next time, bring more friends!',8901,1,0,0,'korthazz SAY_KORT_SLAY'), +(-1533057,'What a bloody waste this is!',8900,1,0,0,'korthazz SAY_KORT_DEATH'), + +(-1533058,'Flee, before it\'s too late!',8913,1,0,0,'zeliek SAY_ZELI_AGGRO'), +(-1533059,'Invaders, cease this foolish venture at once! Turn away while you still can!',8917,1,0,0,'zeliek SAY_ZELI_TAUNT1'), +(-1533060,'Perhaps they will come to their senses, and run away as fast as they can!',8918,1,0,0,'zeliek SAY_ZELI_TAUNT2'), +(-1533061,'Do not continue! Turn back while there\'s still time!',8919,1,0,0,'zeliek SAY_ZELI_TAUNT3'), +(-1533062,'I- I have no choice but to obey!',8916,1,0,0,'zeliek SAY_ZELI_SPECIAL'), +(-1533063,'Forgive me!',8915,1,0,0,'zeliek SAY_ZELI_SLAY'), +(-1533064,'It is... as it should be.',8914,1,0,0,'zeliek SAY_ZELI_DEATH'), + +(-1533065,'You seek death?',14571,1,0,0,'rivendare_naxx SAY_RIVE_AGGRO1'), +(-1533066,'None shall pass!',14572,1,0,0,'rivendare_naxx SAY_RIVE_AGGRO2'), +(-1533067,'Be still!',14573,1,0,0,'rivendare_naxx SAY_RIVE_AGGRO3'), +(-1533068,'You will find no peace in death.',14574,1,0,0,'rivendare_naxx SAY_RIVE_SLAY1'), +(-1533069,'The master\'s will is done.',14575,1,0,0,'rivendare_naxx SAY_RIVE_SLAY2'), +(-1533070,'Bow to the might of the scourge!',14576,1,0,0,'rivendare_naxx SAY_RIVE_SPECIAL'), +(-1533071,'Enough prattling. Let them come! We shall grind their bones to dust.',14577,1,0,0,'rivendare_naxx SAY_RIVE_TAUNT1'), +(-1533072,'Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough.',14578,1,0,0,'rivendare_naxx SAY_RIVE_TAUNT2'), +(-1533073,'Life is meaningless. It is in death that we are truly tested.',14579,1,0,0,'rivendare_naxx SAY_RIVE_TAUNT3'), +(-1533074,'Death... will not stop me...',14580,1,0,0,'rivendare_naxx SAY_RIVE_DEATH'), + +(-1533075,'Glory to the master!',8845,1,0,0,'noth SAY_AGGRO1'), +(-1533076,'Your life is forfeit!',8846,1,0,0,'noth SAY_AGGRO2'), +(-1533077,'Die, trespasser!',8847,1,0,0,'noth SAY_AGGRO3'), +(-1533078,'Rise, my soldiers! Rise and fight once more!',8851,1,0,0,'noth SAY_SUMMON'), +(-1533079,'My task is done!',8849,1,0,0,'noth SAY_SLAY1'), +(-1533080,'Breathe no more!',8850,1,0,0,'noth SAY_SLAY2'), +(-1533081,'I will serve the master... in... death!',8848,1,0,0,'noth SAY_DEATH'), + +(-1533082,'%s takes in a deep breath...',0,2,0,0,'sapphiron EMOTE_BREATH'), +(-1533083,'%s enrages!',0,2,0,0,'sapphiron EMOTE_ENRAGE'), + +(-1533084,'Our preparations continue as planned, master.',14467,1,0,0,'kelthuzad SAY_SAPP_DIALOG1'), +(-1533085,'It is good that you serve me so faithfully. Soon, all will serve the Lich King and in the end, you shall be rewarded...so long as you do not falter.',8881,1,0,0,'kelthuzad SAY_SAPP_DIALOG2_LICH'), +(-1533086,'I see no complications... Wait... What is this?',14468,1,0,0,'kelthuzad SAY_SAPP_DIALOG3'), +(-1533087,'Your security measures have failed! See to this interruption immediately!',8882,1,0,0,'kelthuzad SAY_SAPP_DIALOG4_LICH'), +(-1533088,'Yes, master!',14469,1,0,0,'kelthuzad SAY_SAPP_DIALOG5'), +(-1533089,'No!!! A curse upon you, interlopers! The armies of the Lich King will hunt you down. You will not escape your fate...',14484,1,0,0,'kelthuzad SAY_CAT_DIED'), +(-1533090,'Who dares violate the sanctity of my domain? Be warned, all who trespass here are doomed.',14463,6,0,0,'kelthuzad SAY_TAUNT1'), +(-1533091,'Fools, you think yourselves triumphant? You have only taken one step closer to the abyss! ',14464,6,0,0,'kelthuzad SAY_TAUNT2'), +(-1533092,'I grow tired of these games. Proceed, and I will banish your souls to oblivion!',14465,6,0,0,'kelthuzad SAY_TAUNT3'), +(-1533093,'You have no idea what horrors lie ahead. You have seen nothing! The frozen heart of Naxxramas awaits you!',14466,6,0,0,'kelthuzad SAY_TAUNT4'), +(-1533094,'Pray for mercy!',14475,1,0,0,'kelthuzad SAY_AGGRO1'), +(-1533095,'Scream your dying breath!',14476,1,0,0,'kelthuzad SAY_AGGRO2'), +(-1533096,'The end is upon you!',14477,1,0,0,'kelthuzad SAY_AGGRO3'), +(-1533097,'The dark void awaits you!',14478,1,0,0,'kelthuzad SAY_SLAY1'), +(-1533098,'',14479,1,0,0,'kelthuzad SAY_SLAY2'), +(-1533099,'AAAAGHHH!... Do not rejoice... your victory is a hollow one... for I shall return with powers beyond your imagining!',14480,1,0,0,'kelthuzad SAY_DEATH'), +(-1533100,'Your soul, is bound to me now!',14472,1,0,0,'kelthuzad SAY_CHAIN1'), +(-1533101,'There will be no escape!',14473,1,0,0,'kelthuzad SAY_CHAIN2'), +(-1533102,'I will freeze the blood in your veins!',14474,1,0,0,'kelthuzad SAY_FROST_BLAST'), +(-1533103,'Master! I require aid! ',14470,1,0,0,'kelthuzad SAY_REQUEST_AID'), +(-1533104,'Very well... warriors of the frozen wastes, rise up! I command you to fight, kill, and die for your master. Let none survive...',0,1,0,0,'kelthuzad SAY_ANSWER_REQUEST'), +(-1533105,'Minions, servants, soldiers of the cold dark, obey the call of Kel\'Thuzad!',14471,1,0,0,'kelthuzad SAY_SUMMON_MINIONS'), +(-1533106,'Your petty magics are no challenge to the might of the Scourge! ',14481,1,0,0,'kelthuzad SAY_SPECIAL1_MANA_DET'), +(-1533107,'Enough! I grow tired of these distractions! ',14483,1,0,0,'kelthuzad SAY_SPECIAL3_MANA_DET'), +(-1533108,'Fools, you have spread your powers too thin. Be free, my minions!',14482,1,0,0,'kelthuzad SAY_SPECIAL2_DISPELL'), + +(-1533109,'You are mine now!',8825,1,0,0,'heigan SAY_AGGRO1'), +(-1533110,'I see you!',8826,1,0,0,'heigan SAY_AGGRO2'), +(-1533111,'You...are next!',8827,1,0,0,'heigan SAY_AGGRO3'), +(-1533112,'Close your eyes... sleep!',8829,1,0,0,'heigan SAY_SLAY'), +(-1533113,'The races of the world will perish. It is only a matter of time.',8830,1,0,0,'heigan SAY_TAUNT1'), +(-1533114,'I see endless suffering, I see torment, I see rage. I see... everything!',8831,1,0,0,'heigan SAY_TAUNT2'), +(-1533115,'Soon... the world will tremble!',8832,1,0,0,'heigan SAY_TAUNT3'), +(-1533116,'The end is upon you.',8833,1,0,0,'heigan SAY_CHANNELING'), +(-1533117,'Hungry worms will feast on your rotten flesh!',8834,1,0,0,'heigan SAY_TAUNT4'), +(-1533118,'Noo... o...',8828,1,0,0,'heigan SAY_DEATH'), + +(-1533119,'%s spots a nearby Zombie to devour!',0,3,0,0,'gluth EMOTE_ZOMBIE'), + +(-1533120,'Hah hah, I\'m just getting warmed up!',8852,1,0,0,'razuvious SAY_AGGRO1'), +(-1533121,'Stand and fight!',8853,1,0,0,'razuvious SAY_AGGRO2'), +(-1533122,'Show me what you\'ve got!',8854,1,0,0,'razuvious SAY_AGGRO3'), +(-1533123,'Sweep the leg! Do you have a problem with that?',8861,1,0,0,'razuvious SAY_SLAY1'), +(-1533124,'You should have stayed home!',8862,1,0,0,'razuvious SAY_SLAY2'), +(-1533125,'Do as I taught you!',8855,1,0,0,'razuvious SAY_COMMAND1'), +(-1533126,'Show them no mercy!',8856,1,0,0,'razuvious SAY_COMMAND2'), +(-1533127,'You disappoint me, students!',8858,1,0,0,'razuvious SAY_COMMAND3'), +(-1533128,'The time for practice is over! Show me what you\'ve learned!',8859,1,0,0,'razuvious SAY_COMMAND4'), +(-1533129,'An honorable... death...',8860,1,0,0,'razuvious SAY_DEATH'), + +(-1533130,'%s summons forth Skeletal Warriors!',0,3,0,0,'noth EMOTE_WARRIOR'), +(-1533131,'%s raises more skeletons!',0,3,0,0,'noth EMOTE_SKELETON'), +(-1533132,'%s teleports to the balcony above!',0,3,0,0,'noth EMOTE_TELEPORT'), +(-1533133,'%s teleports back into the battle!',0,3,0,0,'noth EMOTE_TELEPORT_RETURN'), + +(-1533134,'A Guardian of Icecrown enters the fight!',0,3,0,0,'kelthuzad EMOTE_GUARDIAN'), +(-1533135,'%s strikes!',0,3,0,0,'kelthuzad EMOTE_PHASE2'), + +(-1533136,'%s teleports and begins to channel a spell!',0,3,0,0,'heigan EMOTE_TELEPORT'), +(-1533137,'%s rushes to attack once more!',0,3,0,0,'heigan EMOTE_RETURN'), + +(-1533138,'%s teleports into the fray!',0,3,0,0,'gothik EMOTE_TO_FRAY'), +(-1533139,'The central gate opens!',0,3,0,0,'gothik EMOTE_GATE'), +(-1533140,'Brazenly you have disregarded powers beyond your understanding.',0,1,0,0,'gothik SAY_SPEECH_2'), +(-1533141,'You have fought hard to invade the realm of the harvester.',0,1,0,0,'gothik SAY_SPEECH_3'), +(-1533142,'Now there is only one way out - to walk the lonely path of the damned.',0,1,0,0,'gothik SAY_SPEECH_4'), + +(-1533143,'An aura of necrotic energy blocks all healing!',0,3,0,0,'Loatheb EMOTE_AURA_BLOCKING'), +(-1533144,'The power of Necrotic Aura begins to wane!',0,3,0,0,'Loatheb EMOTE_AURA_WANE'), +(-1533145,'The aura fades away, allowing healing once more!',0,3,0,0,'Loatheb EMOTE_AURA_FADING'), + +(-1533146,'%s spins her web into a cocoon!',0,3,0,0,'maexxna EMOTE_SPIN_WEB'), +(-1533147,'Spiderlings appear on the web!',0,3,0,0,'maexxna EMOTE_SPIDERLING'), +(-1533148,'%s sprays strands of web everywhere!',0,3,0,0,'maexxna EMOTE_SPRAY'); + +-- -1 534 000 THE BATTLE OF MT. HYJAL +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1534000,'I\'m in jeopardy, help me if you can!',11007,1,0,0,'jaina hyjal ATTACKED 1'), +(-1534001,'They\'ve broken through!',11049,1,0,0,'jaina hyjal ATTACKED 2'), +(-1534002,'Stay alert! Another wave approaches.',11008,1,0,0,'jaina hyjal INCOMING'), +(-1534003,'Don\'t give up! We must prevail!',11006,1,0,0,'jaina hyjal BEGIN'), +(-1534004,'Hold them back as long as possible.',11050,1,0,0,'jaina hyjal RALLY 1'), +(-1534005,'We must hold strong!',11051,1,0,0,'jaina hyjal RALLY 2'), +(-1534006,'We are lost. Fall back!',11009,1,0,0,'jaina hyjal FAILURE'), +(-1534007,'We have won valuable time. Now we must pull back!',11011,1,0,0,'jaina hyjal SUCCESS'), +(-1534008,'I did... my best.',11010,1,0,0,'jaina hyjal DEATH'), + +(-1534009,'I will lie down for no one!',11031,1,0,0,'thrall hyjal ATTACKED 1'), +(-1534010,'Bring the fight to me and pay with your lives!',11061,1,0,0,'thrall hyjal ATTACKED 2'), +(-1534011,'Make ready for another wave! LOK-TAR OGAR!',11032,1,0,0,'thrall hyjal INCOMING'), +(-1534012,'Hold them back! Do not falter!',11030,1,0,0,'thrall hyjal BEGIN'), +(-1534013,'Victory or death!',11059,1,0,0,'thrall hyjal RALLY 1'), +(-1534014,'Do not give an inch of ground!',11060,1,0,0,'thrall hyjal RALLY 2'), +(-1534015,'It is over. Withdraw! We have failed.',11033,1,0,0,'thrall hyjal FAILURE'), +(-1534016,'We have played our part and done well. It is up to the others now.',11035,1,0,0,'thrall hyjal SUCCESS'), +(-1534017,'Uraaa...',11034,1,0,0,'thrall hyjal DEATH'), + +(-1534018,'All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.',10986,1,0,0,'archimonde SAY_PRE_EVENTS_COMPLETE'), +(-1534019,'Your resistance is insignificant.',10987,1,0,0,'archimonde SAY_AGGRO'), +(-1534020,'This world will burn!',10990,1,0,0,'archimonde SAY_DOOMFIRE1'), +(-1534021,'Manach sheek-thrish!',11041,1,0,0,'archimonde SAY_DOOMFIRE2'), +(-1534022,'A-kreesh!',10989,1,0,0,'archimonde SAY_AIR_BURST1'), +(-1534023,'Away vermin!',11043,1,0,0,'archimonde SAY_AIR_BURST2'), +(-1534024,'All creation will be devoured!',11044,1,0,0,'archimonde SAY_SLAY1'), +(-1534025,'Your soul will languish for eternity.',10991,1,0,0,'archimonde SAY_SLAY2'), +(-1534026,'I am the coming of the end!',11045,1,0,0,'archimonde SAY_SLAY3'), +(-1534027,'At last it is here. Mourn and lament the passing of all you have ever known and all that would have been! Akmin-kurai!',10993,1,0,0,'archimonde SAY_ENRAGE'), +(-1534028,'No, it cannot be! Nooo!',10992,1,0,0,'archimonde SAY_DEATH'), +(-1534029,'You are mine now.',10988,1,0,0,'archimonde SAY_SOUL_CHARGE1'), +(-1534030,'Bow to my will.',11042,1,0,0,'archimonde SAY_SOUL_CHARGE2'); + +-- -1 540 000 SHATTERED HALLS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1540000,'You wish to fight us all at once? This should be amusing!',10262,1,0,0,'nethekurse SAY_INTRO'), +(-1540001,'You can have that one. I no longer need him.',10263,1,0,0,'nethekurse PEON_ATTACK_1'), +(-1540002,'Yes, beat him mercilessly. His skull is a thick as an ogres.',10264,1,0,0,'nethekurse PEON_ATTACK_2'), +(-1540003,'Don\'t waste your time on that one. He\'s weak!',10265,1,0,0,'nethekurse PEON_ATTACK_3'), +(-1540004,'You want him? Very well, take him!',10266,1,0,0,'nethekurse PEON_ATTACK_4'), +(-1540005,'One pitiful wretch down. Go on, take another one.',10267,1,0,0,'nethekurse PEON_DIE_1'), +(-1540006,'Ahh, what a waste... Next!',10268,1,0,0,'nethekurse PEON_DIE_2'), +(-1540007,'I was going to kill him anyway!',10269,1,0,0,'nethekurse PEON_DIE_3'), +(-1540008,'Thank you for saving me the trouble! Now it\'s my turn to have some fun...',10270,1,0,0,'nethekurse PEON_DIE_4'), +(-1540009,'Beg for your pittyfull life!',10259,1,0,0,'nethekurse SAY_TAUNT_1'), +(-1540010,'Run covad, ruun!',10260,1,0,0,'nethekurse SAY_TAUNT_2'), +(-1540011,'Your pain amuses me.',10261,1,0,0,'nethekurse SAY_TAUNT_3'), +(-1540012,'I\'m already bored.',10271,1,0,0,'nethekurse SAY_AGGRO_1'), +(-1540013,'Come on! ... Show me a real fight.',10272,1,0,0,'nethekurse SAY_AGGRO_2'), +(-1540014,'I had more fun torturing the peons.',10273,1,0,0,'nethekurse SAY_AGGRO_3'), +(-1540015,'You Loose.',10274,1,0,0,'nethekurse SAY_SLAY_1'), +(-1540016,'Ohh! Just die.',10275,1,0,0,'nethekurse SAY_SLAY_2'), +(-1540017,'What a ... a shame.',10276,1,0,0,'nethekurse SAY_DIE'), + +(-1540018,'Smash!',10306,1,0,0,'omrogg GoCombat_1'), +(-1540019,'If you nice me let you live.',10308,1,0,0,'omrogg GoCombat_2'), +(-1540020,'Me hungry!',10309,1,0,0,'omrogg GoCombat_3'), +(-1540021,'Why don\'t you let me do the talking?',10317,1,0,0,'omrogg GoCombatDelay_1'), +(-1540022,'No, we will NOT let you live!',10318,1,0,0,'omrogg GoCombatDelay_2'), +(-1540023,'You always hungry. That why we so fat!',10319,1,0,0,'omrogg GoCombatDelay_3'), +(-1540024,'You stay here. Me go kill someone else!',10303,1,0,0,'omrogg Threat_1'), +(-1540025,'What are you doing!',10315,1,0,0,'omrogg Threat_2'), +(-1540026,'Me kill someone else...',10302,1,0,0,'omrogg Threat_3'), +(-1540027,'Me not like this one...',10300,1,0,0,'omrogg Threat_4'), +(-1540028,'That\'s not funny!',10314,1,0,0,'omrogg ThreatDelay1_1'), +(-1540029,'Me get bored...',10305,1,0,0,'omrogg ThreatDelay1_2'), +(-1540030,'I\'m not done yet, idiot!',10313,1,0,0,'omrogg ThreatDelay1_3'), +(-1540031,'Hey you numbskull!',10312,1,0,0,'omrogg ThreatDelay1_4'), +(-1540032,'Ha ha ha.',10304,1,0,0,'omrogg ThreatDelay2_1'), +(-1540033,'Whhy! He almost dead!',10316,1,0,0,'omrogg ThreatDelay2_2'), +(-1540034,'H\'ey...',10307,1,0,0,'omrogg ThreatDelay2_3'), +(-1540035,'We kill his friend!',10301,1,0,0,'omrogg ThreatDelay2_4'), +(-1540036,'This one die easy!',10310,1,0,0,'omrogg Killing_1'), +(-1540037,'I\'m tired. You kill next one!',10320,1,0,0,'omrogg Killing_2'), +(-1540038,'That\'s because I do all the hard work!',10321,1,0,0,'omrogg KillingDelay_1'), +(-1540039,'This all...your fault!',10311,1,0,0,'omrogg YELL_DIE_L'), +(-1540040,'I...hate...you...',10322,1,0,0,'omrogg YELL_DIE_R'), +(-1540041,'%s enrages!',0,2,0,0,'omrogg EMOTE_ENRAGE'), + +(-1540042,'Ours is the true Horde! The only Horde!',10323,1,0,0,'kargath SAY_AGGRO1'), +(-1540043,'I\'ll carve the meat from your bones!',10324,1,0,0,'kargath SAY_AGGRO2'), +(-1540044,'I am called Bladefist for a reason, as you will see!',10325,1,0,0,'kargath SAY_AGGRO3'), +(-1540045,'For the real Horde!',10326,1,0,0,'kargath SAY_SLAY1'), +(-1540046,'I am the only Warchief!',10327,1,0,0,'kargath SAY_SLAY2'), +(-1540047,'The true Horde... will.. prevail...',10328,1,0,0,'kargath SAY_DEATH'); + +-- -1 542 000 BLOOD FURNACE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1542000,'Who dares interrupt... What is this? What have you done? You ruin everything!',10164,1,0,0,'kelidan SAY_WAKE'), +(-1542001,'You mustn\'t let him loose!',10166,1,0,0,'kelidan SAY_ADD_AGGRO_1'), +(-1542002,'Ignorant whelps!',10167,1,0,0,'kelidan SAY_ADD_AGGRO_2'), +(-1542003,'You fools! He\'ll kill us all!',10168,1,0,0,'kelidan SAY_ADD_AGGRO_3'), +(-1542004,'Just as you deserve!',10169,1,0,0,'kelidan SAY_KILL_1'), +(-1542005,'Your friends will soon be joining you.',10170,1,0,0,'kelidan SAY_KILL_2'), +(-1542006,'Closer... Come closer.. and burn!',10165,1,0,0,'kelidan SAY_NOVA'), +(-1542007,'Good luck... you\'ll need it..',10171,1,0,0,'kelidan SAY_DIE'), + +(-1542008,'Come intruders....',0,1,0,0,'broggok SAY_AGGRO'), + +(-1542009,'My work must not be interrupted.',10286,1,0,0,'the_maker SAY_AGGRO_1'), +(-1542010,'Perhaps I can find a use for you.',10287,1,0,0,'the_maker SAY_AGGRO_2'), +(-1542011,'Anger... Hate... These are tools I can use.',10288,1,0,0,'the_maker SAY_AGGRO_3'), +(-1542012,'Let\'s see what I can make of you.',10289,1,0,0,'the_maker SAY_KILL_1'), +(-1542013,'It is pointless to resist.',10290,1,0,0,'the_maker SAY_KILL_2'), +(-1542014,'Stay away from... me.',10291,1,0,0,'the_maker SAY_DIE'); + +-- -1 543 000 HELLFIRE RAMPARTS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1543000,'Do you smell that? Fresh meat has somehow breached our citadel. Be wary of any intruders.',0,1,0,0,'gargolmar SAY_TAUNT'), +(-1543001,'Heal me! QUICKLY!',10329,1,0,0,'gargolmar SAY_HEAL'), +(-1543002,'Back off, pup!',10330,1,0,0,'gargolmar SAY_SURGE'), +(-1543003,'What have we here...?',10331,1,0,0,'gargolmar SAY_AGGRO_1'), +(-1543004,'Heh... this may hurt a little.',10332,1,0,0,'gargolmar SAY_AGGRO_2'), +(-1543005,'I\'m gonna enjoy this.',10333,1,0,0,'gargolmar SAY_AGGRO_3'), +(-1543006,'Say farewell!',10334,1,0,0,'gargolmar SAY_KILL_1'), +(-1543007,'Much too easy...',10335,1,0,0,'gargolmar SAY_KILL_2'), +(-1543008,'Hahah.. ..argh!',10336,1,0,0,'gargolmar SAY_DIE'), + +(-1543009,'You dare stand against me?!',10280,1,0,0,'omor SAY_AGGRO_1'), +(-1543010,'I will not be defeated!',10279,1,0,0,'omor SAY_AGGRO_2'), +(-1543011,'Your insolence will be your death.',10281,1,0,0,'omor SAY_AGGRO_3'), +(-1543012,'Achor-she-ki! Feast my pet! Eat your fill!',10277,1,0,0,'omor SAY_SUMMON'), +(-1543013,'A-Kreesh!',10278,1,0,0,'omor SAY_CURSE'), +(-1543014,'Die, weakling!',10282,1,0,0,'omor SAY_KILL_1'), +(-1543015,'It is... not over.',10284,1,0,0,'omor SAY_DIE'), +(-1543016,'I am victorious!',10283,1,0,0,'omor SAY_WIPE'), + +(-1543017,'You have faced many challenges, pity they were all in vain. Soon your people will kneel to my lord!',10292,1,0,0,'vazruden SAY_INTRO'), +(-1543018,'Your time is running out!',10294,1,0,0,'vazruden SAY_AGGRO1'), +(-1543019,'You are nothing, I answer a higher call!',10295,1,0,0,'vazruden SAY_AGGRO2'), +(-1543020,'The Dark Lord laughs at you!',10296,1,0,0,'vazruden SAY_AGGRO3'), +(-1543021,'Is there no one left to test me?',10293,1,0,0,'vazruden SAY_TAUNT'), +(-1543022,'It is over. Finished!',10297,1,0,0,'vazruden SAY_KILL1'), +(-1543023,'Your days are done!',10298,1,0,0,'vazruden SAY_KILL2'), +(-1543024,'My lord will be the end you all...',10299,1,0,0,'vazruden SAY_DEATH'), +(-1543025,'%s descends from the sky.',0,3,0,0,'vazruden EMOTE_DESCEND'); + +-- -1 544 000 MAGTHERIDON'S LAIR +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1544000,'Wretched, meddling insects. Release me and perhaps i will grant you a merciful death!',10247,1,0,0,'magtheridon SAY_TAUNT1'), +(-1544001,'Vermin! Leeches! Take my blood and choke on it!',10248,1,0,0,'magtheridon SAY_TAUNT2'), +(-1544002,'Illidan is an arrogant fool. I will crush him and reclaim Outland as my own.',10249,1,0,0,'magtheridon SAY_TAUNT3'), +(-1544003,'Away, you mindless parasites. My blood is my own!',10250,1,0,0,'magtheridon SAY_TAUNT4'), +(-1544004,'How long do you believe your pathetic sorcery can hold me?',10251,1,0,0,'magtheridon SAY_TAUNT5'), +(-1544005,'My blood will be the end of you!',10252,1,0,0,'magtheridon SAY_TAUNT6'), +(-1544006,'I...am...UNLEASHED!!!',10253,1,0,0,'magtheridon SAY_FREED'), +(-1544007,'Thank you for releasing me. Now...die!',10254,1,0,0,'magtheridon SAY_AGGRO'), +(-1544008,'Not again...NOT AGAIN!',10256,1,0,0,'magtheridon SAY_BANISH'), +(-1544009,'I will not be taken so easily. Let the walls of this prison tremble...and FALL!!!',10257,1,0,0,'magtheridon SAY_CHAMBER_DESTROY'), +(-1544010,'Did you think me weak? Soft? Who is the weak one now?!',10255,1,0,0,'magtheridon SAY_PLAYER_KILLED'), +(-1544011,'The Legion...will consume you...all...',10258,1,0,0,'magtheridon SAY_DEATH'), +(-1544012,'%s becomes enraged!',0,2,0,0,'magtheridon EMOTE_BERSERK'), +(-1544013,'%s begins to cast Blast Nova!',0,3,0,0,'magtheridon EMOTE_BLASTNOVA'), +(-1544014,'%s\'s bonds begin to weaken!',0,2,0,0,'magtheridon EMOTE_BEGIN'), +(-1544015,'%s breaks free!',0,2,0,0,'magtheridon EMOTE_FREED'); + +-- -1 545 000 THE STEAMVAULT +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1545000,'Surge forth my pets!',10360,1,0,0,'thespia SAY_SUMMON'), +(-1545001,'The depths will consume you!',10361,1,0,0,'thespia SAY_AGGRO_1'), +(-1545002,'Meet your doom, surface dwellers!',10362,1,0,0,'thespia SAY_AGGRO_2'), +(-1545003,'You will drown in blood!',10363,1,0,0,'thespia SAY_AGGRO_3'), +(-1545004,'To the depths of oblivion with you!',10364,1,0,0,'thespia SAY_SLAY_1'), +(-1545005,'For my lady and master!',10365,1,0,0,'thespia SAY_SLAY_2'), +(-1545006,'Our matron will be.. the end of.. you..',10366,1,0,0,'thespia SAY_DEAD'), + +(-1545007,'I\'m bringin\' the pain!',10367,1,0,0,'mekgineer SAY_MECHANICS'), +(-1545008,'You\'re in for a world of hurt!',10368,1,0,0,'mekgineer SAY_AGGRO_1'), +(-1545009,'Eat hot metal, scumbag!',10369,1,0,0,'mekgineer SAY_AGGRO_2'), +(-1545010,'I\'ll come over there!',10370,1,0,0,'mekgineer SAY_AGGRO_3'), +(-1545011,'I\'m bringin\' the pain!',10371,1,0,0,'mekgineer SAY_AGGRO_4'), +(-1545012,'You just got served, punk!',10372,1,0,0,'mekgineer SOUND_SLAY_1'), +(-1545013,'I own you!',10373,1,0,0,'mekgineer SOUND_SLAY_2'), +(-1545014,'Have fun dyin\', cupcake!',10374,1,0,0,'mekgineer SOUND_SLAY_3'), +(-1545015,'Mommy!',10375,1,0,0,'mekgineer SAY_DEATH'), + +(-1545016,'You deem yourselves worthy simply because you bested my guards? Our work here will not be compromised!',10390,1,0,0,'kalithresh SAY_INTRO'), +(-1545017,'This is not nearly over...',10391,1,0,0,'kalithresh SAY_REGEN'), +(-1545018,'Your head will roll!',10392,1,0,0,'kalithresh SAY_AGGRO1'), +(-1545019,'I despise all of your kind!',10393,1,0,0,'kalithresh SAY_AGGRO2'), +(-1545020,'Ba\'ahntha sol\'dorei!',10394,1,0,0,'kalithresh SAY_AGGRO3'), +(-1545021,'Scram, surface filth!',10395,1,0,0,'kalithresh SAY_SLAY1'), +(-1545022,'Ah ha ha ha ha ha ha!',10396,1,0,0,'kalithresh SAY_SLAY2'), +(-1545023,'For her Excellency... for... Vashj!',10397,1,0,0,'kalithresh SAY_DEATH'); + +-- -1 546 000 THE UNDERBOG + +-- -1 547 000 THE SLAVE PENS + +-- -1 548 000 SERPENTSHRINE CAVERN +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1548000,'I cannot allow you to interfere!',11289,1,0,0,'hydross SAY_AGGRO'), +(-1548001,'Better, much better.',11290,1,0,0,'hydross SAY_SWITCH_TO_CLEAN'), +(-1548002,'They have forced me to this...',11291,1,0,0,'hydross SAY_CLEAN_SLAY1'), +(-1548003,'I have no choice.',11292,1,0,0,'hydross SAY_CLEAN_SLAY2'), +(-1548004,'I am... released...',11293,1,0,0,'hydross SAY_CLEAN_DEATH'), +(-1548005,'Aaghh, the poison...',11297,1,0,0,'hydross SAY_SWITCH_TO_CORRUPT'), +(-1548006,'I will purge you from this place.',11298,1,0,0,'hydross SAY_CORRUPT_SLAY1'), +(-1548007,'You are no better than they!',11299,1,0,0,'hydross SAY_CORRUPT_SLAY2'), +(-1548008,'You are the disease, not I',11300,1,0,0,'hydross SAY_CORRUPT_DEATH'), + +(-1548009,'Finally, my banishment ends!',11312,1,0,0,'leotheras SAY_AGGRO'), +(-1548010,'Be gone, trifling elf. I am in control now!',11304,1,0,0,'leotheras SAY_SWITCH_TO_DEMON'), +(-1548011,'We all have our demons...',11305,1,0,0,'leotheras SAY_INNER_DEMONS'), +(-1548012,'I have no equal.',11306,1,0,0,'leotheras SAY_DEMON_SLAY1'), +(-1548013,'Perish, mortal.',11307,1,0,0,'leotheras SAY_DEMON_SLAY2'), +(-1548014,'Yes, YES! Ahahah!',11308,1,0,0,'leotheras SAY_DEMON_SLAY3'), +(-1548015,'Kill! KILL!',11314,1,0,0,'leotheras SAY_NIGHTELF_SLAY1'), +(-1548016,'That\'s right! Yes!',11315,1,0,0,'leotheras SAY_NIGHTELF_SLAY2'), +(-1548017,'Who\'s the master now?',11316,1,0,0,'leotheras SAY_NIGHTELF_SLAY3'), +(-1548018,'No... no! What have you done? I am the master! Do you hear me? I am... aaggh! Can\'t... contain him...',11313,1,0,0,'leotheras SAY_FINAL_FORM'), +(-1548019,'At last I am liberated. It has been too long since I have tasted true freedom!',11309,1,0,0,'leotheras SAY_FREE'), +(-1548020,'You cannot kill me! Fools, I\'ll be back! I\'ll... aarghh...',11317,1,0,0,'leotheras SAY_DEATH'), + +(-1548021,'Guards, attention! We have visitors...',11277,1,0,0,'karathress SAY_AGGRO'), +(-1548022,'Your overconfidence will be your undoing! Guards, lend me your strength!',11278,1,0,0,'karathress SAY_GAIN_BLESSING'), +(-1548023,'Go on, kill them! I\'ll be the better for it!',11279,1,0,0,'karathress SAY_GAIN_ABILITY1'), +(-1548024,'I am more powerful than ever!',11280,1,0,0,'karathress SAY_GAIN_ABILITY2'), +(-1548025,'More knowledge, more power!',11281,1,0,0,'karathress SAY_GAIN_ABILITY3'), +(-1548026,'Land-dwelling scum!',11282,1,0,0,'karathress SAY_SLAY1'), +(-1548027,'Alana be\'lendor!',11283,1,0,0,'karathress SAY_SLAY2'), +(-1548028,'I am rid of you.',11284,1,0,0,'karathress SAY_SLAY3'), +(-1548029,'Her ... excellency ... awaits!',11285,1,0,0,'karathress SAY_DEATH'), + +(-1548030,'Flood of the deep, take you!',11321,1,0,0,'morogrim SAY_AGGRO'), +(-1548031,'By the Tides, kill them at once!',11322,1,0,0,'morogrim SAY_SUMMON1'), +(-1548032,'Destroy them my subjects!',11323,1,0,0,'morogrim SAY_SUMMON2'), +(-1548033,'There is nowhere to hide!',11324,1,0,0,'morogrim SAY_SUMMON_BUBL1'), +(-1548034,'Soon it will be finished!',11325,1,0,0,'morogrim SAY_SUMMON_BUBL2'), +(-1548035,'It is done!',11326,1,0,0,'morogrim SAY_SLAY1'), +(-1548036,'Strugging only makes it worse.',11327,1,0,0,'morogrim SAY_SLAY2'), +(-1548037,'Only the strong survive.',11328,1,0,0,'morogrim SAY_SLAY3'), +(-1548038,'Great... currents of... Ageon.',11329,1,0,0,'morogrim SAY_DEATH'), +(-1548039,'%s sends his enemies to their watery graves!',0,2,0,0,'morogrim EMOTE_WATERY_GRAVE'), +(-1548040,'The violent earthquake has alerted nearby murlocs!',0,3,0,0,'morogrim EMOTE_EARTHQUAKE'), +(-1548041,'%s summons Watery Globules!',0,2,0,0,'morogrim EMOTE_WATERY_GLOBULES'), + +(-1548042,'Water is life. It has become a rare commodity here in Outland. A commodity that we alone shall control. We are the Highborne, and the time has come at last for us to retake our rightful place in the world!',11531,1,0,0,'vashj SAY_INTRO'), +(-1548043,'I\'ll split you from stem to stern!',11532,1,0,0,'vashj SAY_AGGRO1'), +(-1548044,'Victory to Lord Illidan!',11533,1,0,0,'vashj SAY_AGGRO2'), +(-1548045,'I spit on you, surface filth!',11534,1,0,0,'vashj SAY_AGGRO3'), +(-1548046,'Death to the outsiders!',11535,1,0,0,'vashj SAY_AGGRO4'), +(-1548047,'I did not wish to lower myself by engaging your kind, but you leave me little choice!',11538,1,0,0,'vashj SAY_PHASE1'), +(-1548048,'The time is now! Leave none standing!',11539,1,0,0,'vashj SAY_PHASE2'), +(-1548049,'You may want to take cover.',11540,1,0,0,'vashj SAY_PHASE3'), +(-1548050,'Straight to the heart!',11536,1,0,0,'vashj SAY_BOWSHOT1'), +(-1548051,'Seek your mark!',11537,1,0,0,'vashj SAY_BOWSHOT2'), +(-1548052,'Your time ends now!',11541,1,0,0,'vashj SAY_SLAY1'), +(-1548053,'You have failed!',11542,1,0,0,'vashj SAY_SLAY2'), +(-1548054,'Be\'lamere an\'delay',11543,1,0,0,'vashj SAY_SLAY3'), +(-1548055,'Lord Illidan, I... I am... sorry.',11544,1,0,0,'vashj SAY_DEATH'); + +-- -1 550 000 THE EYE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1550000,'Alert, you are marked for extermination!',11213,1,0,0,'voidreaver SAY_AGGRO'), +(-1550001,'Extermination, successful.',11215,1,0,0,'voidreaver SAY_SLAY1'), +(-1550002,'Imbecile life form, no longer functional.',11216,1,0,0,'voidreaver SAY_SLAY2'), +(-1550003,'Threat neutralized.',11217,1,0,0,'voidreaver SAY_SLAY3'), +(-1550004,'Systems... shutting... down...',11214,1,0,0,'voidreaver SAY_DEATH'), +(-1550005,'Alternative measure commencing...',11218,1,0,0,'voidreaver SAY_POUNDING1'), +(-1550006,'Calculating force parameters...',11219,1,0,0,'voidreaver SAY_POUNDING2'), + +(-1550007,'Tal anu\'men no Sin\'dorei!',11134,1,0,0,'solarian SAY_AGGRO'), +(-1550008,'Ha ha ha! You are hopelessly outmatched!',11139,1,0,0,'solarian SAY_SUMMON1'), +(-1550009,'I will crush your delusions of grandeur!',11140,1,0,0,'solarian SAY_SUMMON2'), +(-1550010,'Your soul belongs to the Abyss!',11136,1,0,0,'solarian SAY_KILL1'), +(-1550011,'By the blood of the Highborne!',11137,1,0,0,'solarian SAY_KILL2'), +(-1550012,'For the Sunwell!',11138,1,0,0,'solarian SAY_KILL3'), +(-1550013,'The warmth of the sun... awaits.',11135,1,0,0,'solarian SAY_DEATH'), +(-1550014,'Enough of this! Now I call upon the fury of the cosmos itself.',0,1,0,0,'solarian SAY_VOIDA'), +(-1550015,'I become ONE... with the VOID!',0,1,0,0,'solarian SAY_VOIDB'), + +(-1550016,'Energy. Power. My people are addicted to it... a dependence made manifest after the Sunwell was destroyed. Welcome... to the future. A pity you are too late to stop it. No one can stop me now! Selama ashal\'anore!',11256,1,0,0,'kaelthas SAY_INTRO'), +(-1550017,'Capernian will see to it that your stay here is a short one.',11257,1,0,0,'kaelthas SAY_INTRO_CAPERNIAN'), +(-1550018,'Well done, you have proven worthy to test your skills against my master engineer, Telonicus.',11258,1,0,0,'kaelthas SAY_INTRO_TELONICUS'), +(-1550019,'Let us see how your nerves hold up against the Darkener, Thaladred.',11259,1,0,0,'kaelthas SAY_INTRO_THALADRED'), +(-1550020,'You have persevered against some of my best advisors... but none can withstand the might of the Blood Hammer. Behold, Lord Sanguinar!',11260,1,0,0,'kaelthas SAY_INTRO_SANGUINAR'), +(-1550021,'As you see, I have many weapons in my arsenal...',11261,1,0,0,'kaelthas SAY_PHASE2_WEAPON'), +(-1550022,'Perhaps I underestimated you. It would be unfair to make you fight all four advisors at once, but... fair treatment was never shown to my people. I\'m just returning the favor.',11262,1,0,0,'kaelthas SAY_PHASE3_ADVANCE'), +(-1550023,'Alas, sometimes one must take matters into one\'s own hands. Balamore shanal!',11263,1,0,0,'kaelthas SAY_PHASE4_INTRO2'), +(-1550024,'I have not come this far to be stopped! The future I have planned will not be jeopardized! Now you will taste true power!!',11273,1,0,0,'kaelthas SAY_PHASE5_NUTS'), +(-1550025,'You will not prevail.',11270,1,0,0,'kaelthas SAY_SLAY1'), +(-1550026,'You gambled...and lost.',11271,1,0,0,'kaelthas SAY_SLAY2'), +(-1550027,'This was Child\'s play.',11272,1,0,0,'kaelthas SAY_SLAY3'), +(-1550028,'Obey me.',11268,1,0,0,'kaelthas SAY_MINDCONTROL1'), +(-1550029,'Bow to my will.',11269,1,0,0,'kaelthas SAY_MINDCONTROL2'), +(-1550030,'Let us see how you fare when your world is turned upside down.',11264,1,0,0,'kaelthas SAY_GRAVITYLAPSE1'), +(-1550031,'Having trouble staying grounded?',11265,1,0,0,'kaelthas SAY_GRAVITYLAPSE2'), +(-1550032,'Anara\'nel belore!',11267,1,0,0,'kaelthas SAY_SUMMON_PHOENIX1'), +(-1550033,'By the power of the sun!',11266,1,0,0,'kaelthas SAY_SUMMON_PHOENIX2'), +(-1550034,'For...Quel...thalas!',11274,1,0,0,'kaelthas SAY_DEATH'), + +(-1550035,'Prepare yourselves!',11203,1,0,0,'thaladred SAY_THALADRED_AGGRO'), +(-1550036,'Forgive me, my prince! I have... failed.',11204,1,0,0,'thaladred SAY_THALADRED_DEATH'), +(-1550037,'%s sets his gaze on $N!',0,2,0,0,'thaladred EMOTE_THALADRED_GAZE'), + +(-1550038,'Blood for blood!',11152,1,0,0,'sanguinar SAY_SANGUINAR_AGGRO'), +(-1550039,'NO! I ...will... not...',11153,1,0,0,'sanguinar SAY_SANGUINAR_DEATH'), + +(-1550040,'The sin\'dore reign supreme!',11117,1,0,0,'capernian SAY_CAPERNIAN_AGGRO'), +(-1550041,'This is not over!',11118,1,0,0,'capernian SAY_CAPERNIAN_DEATH'), + +(-1550042,'Anar\'alah belore!',11157,1,0,0,'telonicus SAY_TELONICUS_AGGRO'), +(-1550043,'More perils... await',11158,1,0,0,'telonicus SAY_TELONICUS_DEATH'); + +-- -1 552 000 THE ARCATRAZ +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1552000,'It is a small matter to control the mind of the weak... for I bear allegiance to powers untouched by time, unmoved by fate. No force on this world or beyond harbors the strength to bend our knee... not even the mighty Legion!',11122,1,0,0,'skyriss SAY_INTRO'), +(-1552001,'Bear witness to the agent of your demise!',11123,1,0,0,'skyriss SAY_AGGRO'), +(-1552002,'Your fate is written!',11124,1,0,0,'skyriss SAY_KILL_1'), +(-1552003,'The chaos I have sown here is but a taste...',11125,1,0,0,'skyriss SAY_KILL_2'), +(-1552004,'You will do my bidding, weakling.',11127,1,0,0,'skyriss SAY_MIND_1'), +(-1552005,'Your will is no longer your own.',11128,1,0,0,'skyriss SAY_MIND_2'), +(-1552006,'Flee in terror!',11129,1,0,0,'skyriss SAY_FEAR_1'), +(-1552007,'I will show you horrors undreamed of!',11130,1,0,0,'skyriss SAY_FEAR_2'), +(-1552008,'We span the universe, as countless as the stars!',11131,1,0,0,'skyriss SAY_IMAGE'), +(-1552009,'I am merely one of... infinite multitudes.',11126,1,0,0,'skyriss SAY_DEATH'), + +(-1552010,'Where in Bonzo\'s brass buttons am I? And who are-- yaaghh, that\'s one mother of a headache!',11171,1,0,0,'millhouse SAY_INTRO_1'), +(-1552011,'\"Lowly\"? I don\'t care who you are friend, no one refers to the mighty Millhouse Manastorm as \"Lowly\"! I have no idea what goes on here, but I will gladly join your fight against this impudent imbecile! Prepare to defend yourself, cretin!',11172,1,0,0,'millhouse SAY_INTRO_2'), +(-1552012,'I just need to get some things ready first. You guys go ahead and get started. I need to summon up some water...',11173,1,0,0,'millhouse SAY_WATER'), +(-1552013,'Fantastic! Next, some protective spells. Yes! Now we\'re cookin\'',11174,1,0,0,'millhouse SAY_BUFFS'), +(-1552014,'And of course i\'ll need some mana. You guys are gonna love this, just wait.',11175,1,0,0,'millhouse SAY_DRINK'), +(-1552015,'Aaalllriiiight!! Who ordered up an extra large can of whoop-ass?',11176,1,0,0,'millhouse SAY_READY'), +(-1552016,'I didn\'t even break a sweat on that one.',11177,1,0,0,'millhouse SAY_KILL_1'), +(-1552017,'You guys, feel free to jump in anytime.',11178,1,0,0,'millhouse SAY_KILL_2'), +(-1552018,'I\'m gonna light you up, sweet cheeks!',11179,1,0,0,'millhouse SAY_PYRO'), +(-1552019,'Ice, ice, baby!',11180,1,0,0,'millhouse SAY_ICEBLOCK'), +(-1552020,'Heal me! Oh, for the love of all that is holy, HEAL me! I\'m dying!',11181,1,0,0,'millhouse SAY_LOWHP'), +(-1552021,'You\'ll be hearing from my lawyer...',11182,1,0,0,'millhouse SAY_DEATH'), +(-1552022,'Who\'s bad? Who\'s bad? That\'s right: we bad!',11183,1,0,0,'millhouse SAY_COMPLETE'), + +(-1552023,'I knew the prince would be angry but, I... I have not been myself. I had to let them out! The great one speaks to me, you see. Wait--outsiders. Kael\'thas did not send you! Good... I\'ll just tell the prince you released the prisoners!',11222,1,0,0,'mellichar YELL_INTRO1'), +(-1552024,'The naaru kept some of the most dangerous beings in existence here in these cells. Let me introduce you to another...',11223,1,0,0,'mellichar YELL_INTRO2'), +(-1552025,'Yes, yes... another! Your will is mine!',11224,1,0,0,'mellichar YELL_RELEASE1'), +(-1552026,'Behold another terrifying creature of incomprehensible power!',11225,1,0,0,'mellichar YELL_RELEASE2A'), +(-1552027,'What is this? A lowly gnome? I will do better, O\'great one.',11226,1,0,0,'mellichar YELL_RELEASE2B'), +(-1552028,'Anarchy! Bedlam! Oh, you are so wise! Yes, I see it now, of course!',11227,1,0,0,'mellichar YELL_RELEASE3'), +(-1552029,'One final cell remains. Yes, O\'great one, right away!',11228,1,0,0,'mellichar YELL_RELEASE4'), +(-1552030,'Welcome, O\'great one. I am your humble servant.',11229,1,0,0,'mellichar YELL_WELCOME'); + +-- -1 553 000 THE BOTANICA +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1553000,'What are you doing? These specimens are very delicate!',11144,1,0,0,'freywinn SAY_AGGRO'), +(-1553001,'Your life cycle is now concluded!',11145,1,0,0,'freywinn SAY_KILL_1'), +(-1553002,'You will feed the worms.',11146,1,0,0,'freywinn SAY_KILL_2'), +(-1553003,'Endorel aluminor!',11147,1,0,0,'freywinn SAY_TREE_1'), +(-1553004,'Nature bends to my will!',11148,1,0,0,'freywinn SAY_TREE_2'), +(-1553005,'The specimens...must be preserved.',11149,1,0,0,'freywinn SAY_DEATH'), + +(-1553006,'%s emits a strange noise.',0,2,0,0,'laj EMOTE_SUMMON'), + +(-1553007,'Who disturbs this sanctuary?',11230,1,0,0,'warp SAY_AGGRO'), +(-1553008,'You must die! But wait: this does not--No, no... you must die!',11231,1,0,0,'warp SAY_SLAY_1'), +(-1553009,'What am I doing? Why do I...',11232,1,0,0,'warp SAY_SLAY_2'), +(-1553010,'Children, come to me!',11233,1,0,0,'warp SAY_SUMMON_1'), +(-1553011,'Maybe this is not--No, we fight! Come to my aid.',11234,1,0,0,'warp SAY_SUMMON_2'), +(-1553012,'So... confused. Do not... belong here!',11235,1,0,0,'warp SAY_DEATH'); + +-- -1 554 000 THE MECHANAR +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1554000,'I predict a painful death.',11101,1,0,0,'gyro SAY_AGGRO'), +(-1554001,'Measure twice; cut once!',11104,1,0,0,'gyro SAY_SAW_ATTACK1'), +(-1554002,'If my division is correct, you should be quite dead.',11105,1,0,0,'gyro SAY_SAW_ATTACK2'), +(-1554003,'Your strategy was flawed!',11102,1,0,0,'gyro SAY_SLAY1'), +(-1554004,'Yes, the only logical outcome.',11103,1,0,0,'gyro SAY_SLAY2'), +(-1554005,'An unforseen... contingency',11106,1,0,0,'gyro SAY_DEATH'), + +(-1554006,'You have approximately five seconds to live.',11109,1,0,0,'ironhand SAY_AGGRO_1'), +(-1554007,'With the precise angle and velocity...',11112,1,0,0,'ironhand SAY_HAMMER_1'), +(-1554008,'Low tech yet quiet effective!',11113,1,0,0,'ironhand SAY_HAMMER_2'), +(-1554009,'A foregone conclusion.',11110,1,0,0,'ironhand SAY_SLAY_1'), +(-1554010,'The processing will continue a schedule!',11111,1,0,0,'ironhand SAY_SLAY_2'), +(-1554011,'My calculations did not...',11114,1,0,0,'ironhand SAY_DEATH_1'), +(-1554012,'%s raises his hammer menacingly...',0,3,0,0,'ironhand EMOTE_HAMMER'), + +(-1554013,'Don\'t value your life very much, do you?',11186,1,0,0,'sepethrea SAY_AGGRO'), +(-1554014,'I am not alone.',11191,1,0,0,'sepethrea SAY_SUMMON'), +(-1554015,'Think you can take the heat?',11189,1,0,0,'sepethrea SAY_DRAGONS_BREATH_1'), +(-1554016,'Anar\'endal dracon!',11190,1,0,0,'sepethrea SAY_DRAGONS_BREATH_2'), +(-1554017,'And don\'t come back!',11187,1,0,0,'sepethrea SAY_SLAY1'), +(-1554018,'En\'dala finel el\'dal',11188,1,0,0,'sepethrea SAY_SLAY2'), +(-1554019,'Anu... bala belore...alon.',11192,1,0,0,'sepethrea SAY_DEATH'), + +(-1554020,'We are on a strict timetable. You will not interfere!',11193,1,0,0,'pathaleon SAY_AGGRO'), +(-1554021,'I\'m looking for a team player...',11197,1,0,0,'pathaleon SAY_DOMINATION_1'), +(-1554022,'You work for me now!',11198,1,0,0,'pathaleon SAY_DOMINATION_2'), +(-1554023,'Time to supplement my work force.',11196,1,0,0,'pathaleon SAY_SUMMON'), +(-1554024,'I prefeer to be hands-on...',11199,1,0,0,'pathaleon SAY_ENRAGE'), +(-1554025,'A minor inconvenience.',11194,1,0,0,'pathaleon SAY_SLAY_1'), +(-1554026,'Looks like you lose.',11195,1,0,0,'pathaleon SAY_SLAY_2'), +(-1554027,'The project will... continue.',11200,1,0,0,'pathaleon SAY_DEATH'); + +-- -1 555 000 SHADOW LABYRINTH +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1555000,'Infidels have invaded the sanctuary! Sniveling pests...You have yet to learn the true meaning of agony!',10473,1,0,0,'hellmaw SAY_INTRO'), +(-1555001,'Pathetic mortals! You will pay dearly!',10475,1,0,0,'hellmaw SAY_AGGRO1'), +(-1555002,'I will break you!',10476,1,0,0,'hellmaw SAY_AGGRO2'), +(-1555003,'Finally! Something to relieve the tedium!',10477,1,0,0,'hellmaw SAY_AGGRO3'), +(-1555004,'Aid me, you fools, before it\'s too late!',10474,1,0,0,'hellmaw SAY_HELP'), +(-1555005,'Do you fear death?',10478,1,0,0,'hellmaw SAY_SLAY1'), +(-1555006,'This is the part I enjoy most.',10479,1,0,0,'hellmaw SAY_SLAY2'), +(-1555007,'Do not...grow...overconfident, mortal.',10480,1,0,0,'hellmaw SAY_DEATH'), + +(-1555008,'All flesh must burn.',10482,1,0,0,'blackhearth SAY_INTRO1'), +(-1555009,'All creation must be unmade!',10483,1,0,0,'blackhearth SAY_INTRO2'), +(-1555010,'Power will be yours!',10484,1,0,0,'blackhearth SAY_INTRO3'), +(-1555011,'You\'ll be sorry!',10486,1,0,0,'blackhearth SAY_AGGRO1'), +(-1555012,'Time for fun!',10487,1,0,0,'blackhearth SAY_AGGRO2'), +(-1555013,'I see dead people!',10488,1,0,0,'blackhearth SAY_AGGRO3'), +(-1555014,'No comin\' back for you!',10489,1,0,0,'blackhearth SAY_SLAY1'), +(-1555015,'Nice try!',10490,1,0,0,'blackhearth SAY_SLAY2'), +(-1555016,'Help us, hurry!',10485,1,0,0,'blackhearth SAY_HELP'), +(-1555017,'This... no... good...',10491,1,0,0,'blackhearth SAY_DEATH'), + +(-1555018,'Be ready for Dark One\'s return.',10492,1,0,0,'blackhearth SAY2_INTRO1'), +(-1555019,'So we have place in new universe.',10493,1,0,0,'blackhearth SAY2_INTRO2'), +(-1555020,'Dark one promise!',10494,1,0,0,'blackhearth SAY2_INTRO3'), +(-1555021,'You\'ll be sorry!',10496,1,0,0,'blackhearth SAY2_AGGRO1'), +(-1555022,'Time to kill!',10497,1,0,0,'blackhearth SAY2_AGGRO2'), +(-1555023,'You be dead people!',10498,1,0,0,'blackhearth SAY2_AGGRO3'), +(-1555024,'Now you gone for good.',10499,1,0,0,'blackhearth SAY2_SLAY1'), +(-1555025,'You failed, haha haha',10500,1,0,0,'blackhearth SAY2_SLAY2'), +(-1555026,'Help us, hurry!',10495,1,0,0,'blackhearth SAY2_HELP'), +(-1555027,'Arrgh, aah...ahhh',10501,1,0,0,'blackhearth SAY2_DEATH'), + +(-1555028,'Keep your minds focused for the days of reckoning are close at hand. Soon, the destroyer of worlds will return to make good on his promise. Soon the destruction of all that is will begin!',10522,1,0,0,'vorpil SAY_INTRO'), +(-1555029,'I\'ll make an offering of your blood!',10524,1,0,0,'vorpil SAY_AGGRO1'), +(-1555030,'You\'ll be a fine example, for the others.',10525,1,0,0,'vorpil SAY_AGGRO2'), +(-1555031,'Good, a worthy sacrifice.',10526,1,0,0,'vorpil SAY_AGGRO3'), +(-1555032,'Come to my aid, heed your master now!',10523,1,0,0,'vorpil SAY_HELP'), +(-1555033,'I serve with pride.',10527,1,0,0,'vorpil SAY_SLAY1'), +(-1555034,'Your death is for the greater cause!',10528,1,0,0,'vorpil SAY_SLAY2'), +(-1555035,'I give my life... Gladly.',10529,1,0,0,'vorpil SAY_DEATH'), + +(-1555036,'%s draws energy from the air.',0,2,0,0,'murmur EMOTE_SONIC_BOOM'); + +-- -1 556 000 SETHEKK HALLS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1556000,'I have pets....of my own!',10502,1,0,0,'syth SAY_SUMMON'), +(-1556001,'Hrrmm.. Time to.. hrrm.. make my move.',10503,1,0,0,'syth SAY_AGGRO_1'), +(-1556002,'Nice pets..hrm.. Yes! ',10504,1,0,0,'syth SAY_AGGRO_2'), +(-1556003,'Nice pets have.. weapons. No so....nice.',10505,1,0,0,'syth SAY_AGGRO_3'), +(-1556004,'Death.. meeting life is.. ',10506,1,0,0,'syth SAY_SLAY_1'), +(-1556005,'Uhn.. Be free..',10507,1,0,0,'syth SAY_SLAY_2'), +(-1556006,'No more life..hrm. No more pain. ',10508,1,0,0,'syth SAY_DEATH'), + +(-1556007,'..Trinkets yes pretty Trinkets....power, great power...power in Trinkets..',10557,1,0,0,'ikiss SAY_INTRO'), +(-1556008,'You make war on Ikiss?..',10554,1,0,0,'ikiss SAY_AGGRO_1'), +(-1556009,'Ikiss cut you pretty....slice you. Yes!',10555,1,0,0,'ikiss SAY_AGGRO_2'), +(-1556010,'No escape for....for you',10556,1,0,0,'ikiss SAY_AGGRO_3'), +(-1556011,'You die....stay away from Trinkets',10558,1,0,0,'ikiss SAY_SLAY_1'), +(-1556012,'',10559,1,0,0,'ikiss SAY_SLAY_2'), +(-1556013,'Ikiss will not....die',10560,1,0,0,'ikiss SAY_DEATH'), +(-1556015,'%s begins to channel arcane energy...',0,3,0,0,'ikiss EMOTE_ARCANE_EXP'); + +-- -1 557 000 MANA TOMBS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1557000,'What is this? You must forgive me, but I was not expecting company. As you can see, we are somewhat preoccupied right now. But no matter. As I am a gracious host, I will tend to you... personally.',10539,1,0,0,'shaffar SAY_INTRO'), +(-1557001,'We have not yet been properly introduced.',10541,1,0,0,'shaffar SAY_AGGRO_1'), +(-1557002,'An epic battle. How exciting!',10542,1,0,0,'shaffar SAY_AGGRO_2'), +(-1557003,'I have longed for a good adventure.',10543,1,0,0,'shaffar SAY_AGGRO_3'), +(-1557004,'It has been... entertaining.',10544,1,0,0,'shaffar SAY_SLAY_1'), +(-1557005,'And now we part company.',10545,1,0,0,'shaffar SAY_SLAY_2'), +(-1557006,'I have such fascinating things to show you.',10540,1,0,0,'shaffar SAY_SUMMON'), +(-1557007,'I must bid you... farewell.',10546,1,0,0,'shaffar SAY_DEAD'), + +(-1557008,'I will feed on your soul.',10561,1,0,0,'pandemonius SAY_AGGRO_1'), +(-1557009,'So... full of life!',10562,1,0,0,'pandemonius SAY_AGGRO_2'), +(-1557010,'Do not... resist.',10563,1,0,0,'pandemonius SAY_AGGRO_3'), +(-1557011,'Yes! I am... empowered!',10564,1,0,0,'pandemonius SAY_KILL_1'), +(-1557012,'More... I must have more!',10565,1,0,0,'pandemonius SAY_KILL_2'), +(-1557013,'To the void... once... more..',10566,1,0,0,'pandemonius SAY_DEATH'), +(-1557014,'%s shifts into the void...',0,3,0,0,'pandemonius EMOTE_DARK_SHELL'); + +-- -1 558 000 AUCHENAI CRYPTS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1558000,'You have defiled the resting place of our ancestors. For this offense, there can be but one punishment. It is fitting that you have come to a place of the dead... for you will soon be joining them.',10509,1,0,0,'maladaar SAY_INTRO'), +(-1558001,'Rise my fallen brothers. Take form and fight!',10512,1,0,0,'maladaar SAY_SUMMON'), +(-1558002,'You will pay with your life!',10513,1,0,0,'maladaar SAY_AGGRO_1'), +(-1558003,'There\'s no turning back now!',10514,1,0,0,'maladaar SAY_AGGRO_2'), +(-1558004,'Serve your penitence!',10515,1,0,0,'maladaar SAY_AGGRO_3'), +(-1558005,'Let your mind be clouded.',10510,1,0,0,'maladaar SAY_ROAR'), +(-1558006,'Stare into the darkness of your soul.',10511,1,0,0,'maladaar SAY_SOUL_CLEAVE'), +(-1558007,'These walls will be your doom.',10516,1,0,0,'maladaar SAY_SLAY_1'), +(-1558008,' Now, you\'ll stay for eternity!',10517,1,0,0,'maladaar SAY_SLAY_2'), +(-1558009,'This is... where.. I belong...',10518,1,0,0,'maladaar SAY_DEATH'); + +-- -1 560 000 ESCAPE FROM DURNHOLDE (OLD HILLSBRAD) +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1560000,'Thrall! You didn\'t really think you would escape did you? You and your allies shall answer to Blackmoore - after I\'ve had my fun!',10406,1,0,0,'skarloc SAY_ENTER'), +(-1560001,'You\'re a slave. That\'s all you\'ll ever be.',10407,1,0,0,'skarloc SAY_TAUNT1'), +(-1560002,'I don\'t know what Blackmoore sees in you. For my money, you\'re just another ignorant savage!',10408,1,0,0,'skarloc SAY_TAUNT2'), +(-1560003,'Thrall will never be free!',10409,1,0,0,'skarloc SAY_SLAY1'), +(-1560004,'Did you really think you would leave here alive?',10410,1,0,0,'skarloc SAY_SLAY2'), +(-1560005,'Guards! Urgh..Guards..!',10411,1,0,0,'skarloc SAY_DEATH'), + +(-1560006,'You there, fetch water quickly! Get these flames out before they spread to the rest of the keep! Hurry, damn you!',10428,1,0,0,'lieutenant_drake SAY_ENTER'), +(-1560007,'I know what you\'re up to, and I mean to put an end to it, permanently!',10429,1,0,0,'lieutenant_drake SAY_AGGRO'), +(-1560008,'No more middling for you.',10432,1,0,0,'lieutenant_drake SAY_SLAY1'), +(-1560009,'You will not interfere!',10433,1,0,0,'lieutenant_drake SAY_SLAY2'), +(-1560010,'Time to bleed!',10430,1,0,0,'lieutenant_drake SAY_MORTAL'), +(-1560011,'Run, you blasted cowards!',10431,1,0,0,'lieutenant_drake SAY_SHOUT'), +(-1560012,'Thrall... must not... go free.',10434,1,0,0,'lieutenant_drake SAY_DEATH'), + +(-1560013,'Thrall! Come outside and face your fate!',10418,1,0,0,'epoch SAY_ENTER1'), +(-1560014,'Taretha\'s life hangs in the balance. Surely you care for her. Surely you wish to save her...',10419,1,0,0,'epoch SAY_ENTER2'), +(-1560015,'Ah, there you are. I had hoped to accomplish this with a bit of subtlety, but I suppose direct confrontation was inevitable. Your future, Thrall, must not come to pass and so...you and your troublesome friends must die!',10420,1,0,0,'epoch SAY_ENTER3'), +(-1560016,'Enough! I will erase your very existence!',10421,1,0,0,'epoch SAY_AGGRO1'), +(-1560017,'You cannot fight fate!',10422,1,0,0,'epoch SAY_AGGRO2'), +(-1560018,'You are...irrelevant.',10425,1,0,0,'epoch SAY_SLAY1'), +(-1560019,'Thrall will remain a slave. Taretha will die. You have failed.',10426,1,0,0,'epoch SAY_SLAY2'), +(-1560020,'Not so fast!',10423,1,0,0,'epoch SAY_BREATH1'), +(-1560021,'Struggle as much as you like!',10424,1,0,0,'epoch SAY_BREATH2'), +(-1560022,'No!...The master... will not... be pleased.',10427,1,0,0,'epoch SAY_DEATH'), + +(-1560023,'Very well then. Let\'s go!',10465,0,0,0,'thrall hillsbrad SAY_TH_START_EVENT_PART1'), +(-1560024,'As long as we\'re going with a new plan, I may aswell pick up a weapon and some armor.',0,0,0,0,'thrall hillsbrad SAY_TH_ARMORY'), +(-1560025,'A rider approaches!',10466,0,0,0,'thrall hillsbrad SAY_TH_SKARLOC_MEET'), +(-1560026,'I\'ll never be chained again!',10467,1,0,0,'thrall hillsbrad SAY_TH_SKARLOC_TAUNT'), +(-1560027,'Very well. Tarren Mill lies just west of here. Since time is of the essence...',10468,1,0,0,'thrall hillsbrad SAY_TH_START_EVENT_PART2'), +(-1560028,'Let\'s ride!',10469,0,0,1,'thrall hillsbrad SAY_TH_MOUNTS_UP'), +(-1560029,'Taretha must be in the inn. Let\'s go.',0,0,0,0,'thrall hillsbrad SAY_TH_CHURCH_END'), +(-1560030,'Taretha! What foul magic is this?',0,0,0,0,'thrall hillsbrad SAY_TH_MEET_TARETHA'), +(-1560031,'Who or what was that?',10470,0,0,1,'thrall hillsbrad SAY_TH_EPOCH_WONDER'), +(-1560032,'No!',10471,0,0,5,'thrall hillsbrad SAY_TH_EPOCH_KILL_TARETHA'), +(-1560033,'Goodbye, Taretha. I will never forget your kindness.',10472,0,0,0,'thrall hillsbrad SAY_TH_EVENT_COMPLETE'), +(-1560034,'Things are looking grim...',10458,1,0,0,'thrall hillsbrad SAY_TH_RANDOM_LOW_HP1'), +(-1560035,'I will fight to the last!',10459,1,0,0,'thrall hillsbrad SAY_TH_RANDOM_LOW_HP2'), +(-1560036,'Taretha...',10460,1,0,0,'thrall hillsbrad SAY_TH_RANDOM_DIE1'), +(-1560037,'A good day...to die...',10461,1,0,0,'thrall hillsbrad SAY_TH_RANDOM_DIE2'), +(-1560038,'I have earned my freedom!',10448,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO1'), +(-1560039,'This day is long overdue. Out of my way!',10449,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO2'), +(-1560040,'I am a slave no longer!',10450,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO3'), +(-1560041,'Blackmoore has much to answer for!',10451,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_AGGRO4'), +(-1560042,'You have forced my hand!',10452,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_KILL1'), +(-1560043,'It should not have come to this!',10453,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_KILL2'), +(-1560044,'I did not ask for this!',10454,0,0,0,'thrall hillsbrad SAY_TH_RANDOM_KILL3'), +(-1560045,'I am truly in your debt, strangers.',10455,0,0,0,'thrall hillsbrad SAY_TH_LEAVE_COMBAT1'), +(-1560046,'Thank you, strangers. You have given me hope.',10456,0,0,0,'thrall hillsbrad SAY_TH_LEAVE_COMBAT2'), +(-1560047,'I will not waste this chance. I will seek out my destiny.',10457,0,0,0,'thrall hillsbrad SAY_TH_LEAVE_COMBAT3'), + +(-1560048,'I\'m free! Thank you all!',0,0,0,0,'taretha SAY_TA_FREE'), +(-1560049,'Thrall, you escaped!',0,0,0,0,'taretha SAY_TA_ESCAPED'), + +(-1560050,'That\'s enough out of him.',0,0,0,0,'thrall hillsbrad SAY_TH_KILL_ARMORER'), +(-1560051,'That spell should wipe their memories of us and what just happened. All they should remember now is what reality would be like without the attempted temporal interference. Well done. Thrall will journey on to find his destiny, and Taretha...',0,0,0,0,'erozion SAY_WIPE_MEMORY'), +(-1560052,'Her fate is regrettably unavoidable.',0,0,0,0,'erozion SAY_ABOUT_TARETHA'), +(-1560053,'They call you a monster. But they\'re the monsters, not you. Farewell Thrall.',0,0,0,0,'taretha SAY_TA_FAREWELL'), + +(-1560054,'I\'m glad you\'re safe, Taretha. None of this would have been possible without your friends. They made all of this happen.',0,0,0,0,'thrall hillsbrad SAY_TR_GLAD_SAFE'), +(-1560055,'Thrall, I\'ve never met these people before in my life.',0,0,0,0,'taretha SAY_TA_NEVER_MET'), +(-1560056,'Then who are these people?',0,0,0,0,'thrall hillsbrad SAY_TR_THEN_WHO'), +(-1560057,'I believe I can explain everything to you two if you give me a moment of your time.',0,0,0,0,'erozion SAY_PRE_WIPE'), +(-1560058,'You have done a great thing. Alas, the young warchief\'s memory of these events must be as they originally were ... Andormu awaits you in the master\'s lair.',0,0,0,0,'erozion SAY_AFTER_WIPE'); + +-- -1 564 000 BLACK TEMPLE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1564000,'You will die in the name of Lady Vashj!',11450,1,0,0,'SAY_AGGRO'), +(-1564001,'Stick around!',11451,1,0,0,'SAY_NEEDLE1'), +(-1564002,'I\'ll deal with you later!',11452,1,0,0,'SAY_NEEDLE2'), +(-1564003,'Your success was short lived!',11455,1,0,0,'SAY_SLAY1'), +(-1564004,'Time for you to go!',11456,1,0,0,'SAY_SLAY2'), +(-1564005,'Bel\'anen dal\'lorei!',11453,1,0,0,'SAY_SPECIAL1'), +(-1564006,'Blood will flow!',11454,1,0,0,'SAY_SPECIAL2'), +(-1564007,'Bal\'amer ch\'itah!',11457,1,0,0,'SAY_ENRAGE1'), +(-1564008,'My patience has ran out! Die, DIE!',11458,1,0,0,'SAY_ENRAGE2'), +(-1564009,'Lord Illidan will... crush you.',11459,1,0,0,'SAY_DEATH'), + +(-1564010,'%s acquires a new target!',0,3,0,0,'supremus EMOTE_NEW_TARGET'), +(-1564011,'%s punches the ground in anger!',0,3,0,0,'supremus EMOTE_PUNCH_GROUND'), +(-1564012,'The ground begins to crack open!',0,3,0,0,'supremus EMOTE_GROUND_CRACK'), + +(-1564013,'No! Not yet...',11385,1,0,0,'akama shade SAY_LOW_HEALTH'), +(-1564014,'I will not last much longer...',11386,1,0,0,'akama shade SAY_DEATH'), +(-1564015,'Come out from the shadows! I\'ve returned to lead you against our true enemy! Shed your chains and raise your weapons against your Illidari masters!',0,1,0,0,'akama shade SAY_FREE'), +(-1564016,'Hail our leader! Hail Akama!',0,1,0,0,'akama shade broken SAY_BROKEN_FREE_01'), +(-1564017,'Hail Akama!',0,1,0,0,'akama shade broken SAY_BROKEN_FREE_02'), + +(-1564018,'You play, you pay.',11501,1,0,0,'shahraz SAY_TAUNT1'), +(-1564019,'I\'m not impressed.',11502,1,0,0,'shahraz SAY_TAUNT2'), +(-1564020,'Enjoying yourselves?',11503,1,0,0,'shahraz SAY_TAUNT3'), +(-1564021,'So... business or pleasure?',11504,1,0,0,'shahraz SAY_AGGRO'), +(-1564022,'You seem a little tense.',11505,1,0,0,'shahraz SAY_SPELL1'), +(-1564023,'Don\'t be shy.',11506,1,0,0,'shahraz SAY_SPELL2'), +(-1564024,'I\'m all... yours.',11507,1,0,0,'shahraz SAY_SPELL3'), +(-1564025,'Easy come, easy go.',11508,1,0,0,'shahraz SAY_SLAY1'), +(-1564026,'So much for a happy ending.',11509,1,0,0,'shahraz SAY_SLAY2'), +(-1564027,'Stop toying with my emotions!',11510,1,0,0,'shahraz SAY_ENRAGE'), +(-1564028,'I wasn\'t... finished.',11511,1,0,0,'shahraz SAY_DEATH'), + +(-1564029,'Horde will... crush you.',11432,1,0,0,'bloodboil SOUND_AGGRO'), +(-1564030,'Time to feast!',11433,1,0,0,'bloodboil SAY_SLAY1'), +(-1564031,'More! I want more!',11434,1,0,0,'bloodboil SAY_SLAY2'), +(-1564032,'Drink your blood! Eat your flesh!',11435,1,0,0,'bloodboil SAY_SPECIAL1'), +(-1564033,'I hunger!',11436,1,0,0,'bloodboil SAY_SPECIAL2'), +(-1564034,'',11437,1,0,0,'bloodboil SAY_ENRAGE1'), +(-1564035,'I\'ll rip the meat from your bones!',11438,1,0,0,'bloodboil SAY_ENRAGE2'), +(-1564036,'Aaaahrg...',11439,1,0,0,'bloodboil SAY_DEATH'), + +(-1564037,'I was the first, you know. For me, the wheel of death has spun many times. So much time has passed. I have a lot of catching up to do...',11512,1,0,0,'teron SAY_INTRO'), +(-1564038,'Vengeance is mine!',11513,1,0,0,'teron SAY_AGGRO'), +(-1564039,'I have use for you!',11514,1,0,0,'teron SAY_SLAY1'), +(-1564040,'It gets worse...',11515,1,0,0,'teron SAY_SLAY2'), +(-1564041,'What are you afraid of?',11517,1,0,0,'teron SAY_SPELL1'), +(-1564042,'Death... really isn\'t so bad.',11516,1,0,0,'teron SAY_SPELL2'), +(-1564043,'Give in!',11518,1,0,0,'teron SAY_SPECIAL1'), +(-1564044,'I have something for you...',11519,1,0,0,'teron SAY_SPECIAL2'), +(-1564045,'YOU WILL SHOW THE PROPER RESPECT!',11520,1,0,0,'teron SAY_ENRAGE'), +(-1564046,'The wheel...spins...again....',11521,1,0,0,'teron SAY_DEATH'), + +(-1564047,'Pain and suffering are all that await you!',11415,1,0,0,'essence SUFF_SAY_FREED'), +(-1564048,'Don\'t leave me alone!',11416,1,0,0,'essence SUFF_SAY_AGGRO'), +(-1564049,'Look at what you make me do!',11417,1,0,0,'essence SUFF_SAY_SLAY1'), +(-1564050,'I didn\'t ask for this!',11418,1,0,0,'essence SUFF_SAY_SLAY2'), +(-1564051,'The pain is only beginning!',11419,1,0,0,'essence SUFF_SAY_SLAY3'), +(-1564052,'I don\'t want to go back!',11420,1,0,0,'essence SUFF_SAY_RECAP'), +(-1564053,'Now what do I do?',11421,1,0,0,'essence SUFF_SAY_AFTER'), +(-1564054,'%s becomes enraged!',0,3,0,0,'essence SUFF_EMOTE_ENRAGE'), + +(-1564055,'You can have anything you desire... for a price.',11408,1,0,0,'essence DESI_SAY_FREED'), +(-1564056,'Fulfilment is at hand!',11409,1,0,0,'essence DESI_SAY_SLAY1'), +(-1564057,'Yes... you\'ll stay with us now...',11410,1,0,0,'essence DESI_SAY_SLAY2'), +(-1564058,'Your reach exceeds your grasp.',11412,1,0,0,'essence DESI_SAY_SLAY3'), +(-1564059,'Be careful what you wish for...',11411,1,0,0,'essence DESI_SAY_SPEC'), +(-1564060,'I\'ll be waiting...',11413,1,0,0,'essence DESI_SAY_RECAP'), +(-1564061,'I won\'t be far...',11414,1,0,0,'essence DESI_SAY_AFTER'), + +(-1564062,'Beware: I live!',11399,1,0,0,'essence ANGER_SAY_FREED'), +(-1564063,'So... foolish.',11400,1,0,0,'essence ANGER_SAY_FREED2'), +(-1564064,'',11401,1,0,0,'essence ANGER_SAY_SLAY1'), +(-1564065,'Enough. No more.',11402,1,0,0,'essence ANGER_SAY_SLAY2'), +(-1564066,'On your knees!',11403,1,0,0,'essence ANGER_SAY_SPEC'), +(-1564067,'Beware, coward.',11405,1,0,0,'essence ANGER_SAY_BEFORE'), +(-1564068,'I won\'t... be... ignored.',11404,1,0,0,'essence ANGER_SAY_DEATH'), + +(-1564069,'You wish to test me?',11524,1,0,0,'council vera AGGRO'), +(-1564070,'I have better things to do...',11422,1,0,0,'council gath AGGRO'), +(-1564071,'Flee or die!',11482,1,0,0,'council mala AGGRO'), +(-1564072,'Common... such a crude language. Bandal!',11440,1,0,0,'council zere AGGRO'), + +(-1564073,'Enough games!',11428,1,0,0,'council gath ENRAGE'), +(-1564074,'You wish to kill me? Hahaha, you first!',11530,1,0,0,'council vera ENRAGE'), +(-1564075,'For Quel\'Thalas! For the Sunwell!',11488,1,0,0,'council mala ENRAGE'), +(-1564076,'Sha\'amoor sine menoor!',11446,1,0,0,'council zere ENRAGE'), + +(-1564077,'Enjoy your final moments!',11426,1,0,0,'council gath SPECIAL1'), +(-1564078,'You\'re not caught up for this!',11528,1,0,0,'council vera SPECIAL1'), +(-1564079,'No second chances!',11486,1,0,0,'council mala SPECIAL1'), +(-1564080,'Diel fin\'al',11444,1,0,0,'council zere SPECIAL1'), + +(-1564081,'You are mine!',11427,1,0,0,'council gath SPECIAL2'), +(-1564082,'Anar\'alah belore!',11529,1,0,0,'council vera SPECIAL2'), +(-1564083,'I\'m full of surprises!',11487,1,0,0,'council mala SPECIAL2'), +(-1564084,'Sha\'amoor ara mashal?',11445,1,0,0,'council zere SPECIAL2'), + +(-1564085,'Selama am\'oronor!',11423,1,0,0,'council gath SLAY'), +(-1564086,'Valiant effort!',11525,1,0,0,'council vera SLAY'), +(-1564087,'My work is done.',11483,1,0,0,'council mala SLAY'), +(-1564088,'Shorel\'aran.',11441,1,0,0,'council zere SLAY'), + +(-1564089,'Well done!',11424,1,0,0,'council gath SLAY_COMT'), +(-1564090,'A glorious kill!',11526,1,0,0,'council vera SLAY_COMT'), +(-1564091,'As it should be!',11484,1,0,0,'council mala SLAY_COMT'), +(-1564092,'Belesa menoor!',11442,1,0,0,'council zere SLAY_COMT'), + +(-1564093,'Lord Illidan... I...',11425,1,0,0,'council gath DEATH'), +(-1564094,'You got lucky!',11527,1,0,0,'council vera DEATH'), +(-1564095,'Destiny... awaits.',11485,1,0,0,'council mala DEATH'), +(-1564096,'Diel ma\'ahn... oreindel\'o',11443,1,0,0,'council zere DEATH'), + +(-1564097,'Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.',11463,1,0,0,'illidan SAY_CONVO_1'), +(-1564098,'We\'ve come to end your reign, Illidan. My people and all of Outland shall be free!',11389,1,0,25,'illidan SAY_CONVO_2'), +(-1564099,'Boldly said. But I remain unconvinced.',11464,1,0,396,'illidan SAY_CONVO_3'), +(-1564100,'The time has come! The moment is at hand!',11380,1,0,22,'illidan SAY_CONVO_4'), +(-1564101,'You are not prepared!',11466,1,0,406,'illidan SAY_CONVO_5'), +(-1564102,'Is this it, mortals? Is this all the fury you can muster?',11476,1,0,0,'illidan SAY_CONVO_6'), +(-1564103,'Their fury pales before mine, Illidan. We have some unsettled business between us.',11491,1,0,5,'illidan SAY_CONVO_7'), +(-1564104,'Maiev... How is this even possible?',11477,1,0,1,'illidan SAY_CONVO_8'), +(-1564105,'Ah... my long hunt is finally over. Today, Justice will be done!',11492,1,0,15,'illidan SAY_CONVO_9'), +(-1564106,'Feel the hatred of ten thousand years!',11470,1,0,0,'illidan SAY_CONVO_10'), +(-1564107,'Ahh... It is finished. You are beaten.',11496,1,0,0,'illidan SAY_CONVO_11'), +(-1564108,'You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..',11478,1,0,65,'illidan SAY_CONVO_12'), +(-1564109,'He is right. I feel nothing... I am nothing...',11497,1,0,0,'illidan SAY_CONVO_13'), +(-1564110,'Farewell, champions.',11498,1,0,0,'illidan SAY_CONVO_14'), +(-1564111,'The Light will fill these dismal halls once again. I swear it.',11387,1,0,0,'illidan SAY_CONVO_15'), +(-1564112,'I can feel your hatred.',11467,1,0,0,'illidan SAY_TAUNT_1'), +(-1564113,'Give in to your fear!',11468,1,0,0,'illidan SAY_TAUNT_2'), +(-1564114,'You know nothing of power!',11469,1,0,0,'illidan SAY_TAUNT_3'), +(-1564115,'Such... arrogance!',11471,1,0,0,'illidan SAY_TAUNT_4'), +(-1564116,'That is for Naisha!',11493,1,0,0,'illidan SAY_MAIEV_TAUNT_1'), +(-1564117,'Bleed as I have bled!',11494,1,0,0,'illidan SAY_MAIEV_TAUNT_2'), +(-1564118,'There shall be no prison for you this time!',11495,1,0,0,'illidan SAY_MAIEV_TAUNT_3'), +(-1564119,'Meet your end, demon!',11500,1,0,0,'illidan SAY_MAIEV_TAUNT_4'), +(-1564120,'Be wary friends, The Betrayer meditates in the court just beyond.',11388,1,0,0,'illidan SAY_AKAMA_BEWARE'), +(-1564121,'Come, my minions. Deal with this traitor as he deserves!',11465,1,0,0,'illidan SAY_AKAMA_MINION'), +(-1564122,'I\'ll deal with these mongrels. Strike now, friends! Strike at the betrayer!',11390,1,0,0,'illidan SAY_AKAMA_LEAVE'), +(-1564123,'Who shall be next to taste my blades?!',11473,1,0,0,'illidan SAY_KILL1'), +(-1564124,'This is too easy!',11472,1,0,0,'illidan SAY_KILL2'), +(-1564125,'I will not be touched by rabble such as you!',11479,1,0,254,'illidan SAY_TAKEOFF'), +(-1564126,'Behold the flames of Azzinoth!',11480,1,0,0,'illidan SAY_SUMMONFLAMES'), +(-1564127,'Stare into the eyes of the Betrayer!',11481,1,0,0,'illidan SAY_EYE_BLAST'), +(-1564128,'Behold the power... of the demon within!',11475,1,0,0,'illidan SAY_MORPH'), +(-1564129,'You\'ve wasted too much time mortals, now you shall fall!',11474,1,0,0,'illidan SAY_ENRAGE'); + +-- -1 565 000 GRUUL'S LAIR +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1565000,'Gronn are the real power in outland.',11367,1,0,0,'maulgar SAY_AGGRO'), +(-1565001,'You will not defeat the hand of Gruul!',11368,1,0,0,'maulgar SAY_ENRAGE'), +(-1565002,'You won\'t kill next one so easy!',11369,1,0,0,'maulgar SAY_OGRE_DEATH1'), +(-1565003,'Pah! Does not prove anything!',11370,1,0,0,'maulgar SAY_OGRE_DEATH2'), +(-1565004,'I\'m not afraid of you.',11371,1,0,0,'maulgar SAY_OGRE_DEATH3'), +(-1565005,'Good, now you fight me!',11372,1,0,0,'maulgar SAY_OGRE_DEATH4'), +(-1565006,'You not so tough afterall!',11373,1,0,0,'maulgar SAY_SLAY1'), +(-1565007,'Aha-ha ha ha!',11374,1,0,0,'maulgar SAY_SLAY2'), +(-1565008,'Mulgar is king!',11375,1,0,0,'maulgar SAY_SLAY3'), +(-1565009,'Gruul... will crush you...',11376,1,0,0,'maulgar SAY_DEATH'), + +(-1565010,'Come... and die.',11355,1,0,0,'gruul SAY_AGGRO'), +(-1565011,'Scurry',11356,1,0,0,'gruul SAY_SLAM1'), +(-1565012,'No escape',11357,1,0,0,'gruul SAY_SLAM2'), +(-1565013,'Stay',11358,1,0,0,'gruul SAY_SHATTER1'), +(-1565014,'Beg... for life',11359,1,0,0,'gruul SAY_SHATTER2'), +(-1565015,'No more',11360,1,0,0,'gruul SAY_SLAY1'), +(-1565016,'Unworthy',11361,1,0,0,'gruul SAY_SLAY2'), +(-1565017,'Die',11362,1,0,0,'gruul SAY_SLAY3'), +(-1565018,'Aaargh...',11363,1,0,0,'gruul SAY_DEATH'), +(-1565019,'%s grows in size!',0,2,0,0,'gruul EMOTE_GROW'); + +-- -1 568 000 ZUL'AMAN +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1568000,'Spirits of da wind be your doom!',12031,1,0,0,'janalai SAY_AGGRO'), +(-1568001,'I burn ya now!',12032,1,0,0,'janalai SAY_FIRE_BOMBS'), +(-1568002,'Where ma hatcha? Get to work on dem eggs!',12033,1,0,0,'janalai SAY_SUMMON_HATCHER'), +(-1568003,'I show you strength... in numbers.',12034,1,0,0,'janalai SAY_ALL_EGGS'), +(-1568004,'You done run outta time!',12035,1,0,0,'janalai SAY_BERSERK'), +(-1568005,'It all be over now, mon!',12036,1,0,0,'janalai SAY_SLAY_1'), +(-1568006,'Tazaga-choo!',12037,1,0,0,'janalai SAY_SLAY_2'), +(-1568007,'Zul\'jin... got a surprise for you...',12038,1,0,0,'janalai SAY_DEATH'), +(-1568008,'Come, strangers. The spirit of the dragonhawk hot be hungry for worthy souls.',12039,1,0,0,'janalai SAY_EVENT_STRANGERS'), +(-1568009,'Come, friends. Your bodies gonna feed ma hatchlings, and your souls are going to feed me with power!',12040,1,0,0,'janalai SAY_EVENT_FRIENDS'), + +(-1568010,'Get da move on, guards! It be killin\' time!',12066,1,0,0,'nalorakk SAY_WAVE1_AGGRO'), +(-1568011,'Guards, go already! Who you more afraid of, dem... or me?',12067,1,0,0,'nalorakk SAY_WAVE2_STAIR1'), +(-1568012,'Ride now! Ride out dere and bring me back some heads!',12068,1,0,0,'nalorakk SAY_WAVE3_STAIR2'), +(-1568013,'I be losin\' me patience! Go on: make dem wish dey was never born!',12069,1,0,0,'nalorakk SAY_WAVE4_PLATFORM'), +(-1568014,'What could be better than servin\' da bear spirit for eternity? Come closer now. Bring your souls to me!',12078,1,0,0,'nalorakk SAY_EVENT1_SACRIFICE'), +(-1568015,'Don\'t be delayin\' your fate. Come to me now. I make your sacrifice quick.',12079,1,0,0,'nalorakk SAY_EVENT2_SACRIFICE'), +(-1568016,'You be dead soon enough!',12070,1,0,0,'nalorakk SAY_AGGRO'), +(-1568017,'I bring da pain!',12071,1,0,0,'nalorakk SAY_SURGE'), +(-1568018,'You call on da beast, you gonna get more dan you bargain for!',12072,1,0,0,'nalorakk SAY_TOBEAR'), +(-1568019,'Make way for Nalorakk!',12073,1,0,0,'nalorakk SAY_TOTROLL'), +(-1568020,'You had your chance, now it be too late!',12074,1,0,0,'nalorakk SAY_BERSERK'), +(-1568021,'Mua-ha-ha! Now whatchoo got to say?',12075,1,0,0,'nalorakk SAY_SLAY1'), +(-1568022,'Da Amani gonna rule again!',12076,1,0,0,'nalorakk SAY_SLAY2'), +(-1568023,'I... be waitin\' on da udda side....',12077,1,0,0,'nalorakk SAY_DEATH'), + +(-1568024,'Da eagles gonna bear your spirits to me. Your sacrifice is not gonna be in vein!',12122,1,0,0,'akilzon SAY_EVENT1'), +(-1568025,'Your death gonna be quick, strangers. You shoulda never have come to this place...',12123,1,0,0,'akilzon SAY_EVENT2'), +(-1568026,'I be da predator! You da prey...',12013,1,0,0,'akilzon SAY_AGGRO'), +(-1568027,'Feed, me bruddahs!',12014,1,0,0,'akilzon SAY_SUMMON'), +(-1568028,'Come, and join me bruddahs!',12015,1,0,0,'akilzon SAY_SUMMON_ALT'), +(-1568029,'All you be doing is wasting my time!',12016,1,0,0,'akilzon SAY_ENRAGE'), +(-1568030,'Ya got nothin\'!',12017,1,0,0,'akilzon SAY_SLAY1'), +(-1568031,'Stop your cryin\'!',12018,1,0,0,'akilzon SAY_SLAY2'), +(-1568032,'You can\'t... kill... me spirit!',12019,1,0,0,'akilzon SAY_DEATH'), +(-1568033,'An Electrical Storm Appears!',0,2,0,0,'akilzon EMOTE_STORM'), + +(-1568034,'Get on ya knees and bow.... to da fang and claw!',12020,1,0,0,'halazzi SAY_AGGRO'), +(-1568035,'I fight wit\' untamed spirit....',12021,1,0,0,'halazzi SAY_SPLIT'), +(-1568036,'Spirit, come back to me!',12022,1,0,0,'halazzi SAY_MERGE'), +(-1568037,'Me gonna carve ya now!',12023,1,0,0,'halazzi SAY_SABERLASH1'), +(-1568038,'You gonna leave in pieces!',12024,1,0,0,'halazzi SAY_SABERLASH2'), +(-1568039,'Whatch you be doing? Pissin\' yourselves...',12025,1,0,0,'halazzi SAY_BERSERK'), +(-1568040,'You cant fight the power!',12026,1,0,0,'halazzi SAY_KILL1'), +(-1568041,'You gonna fail!',12027,1,0,0,'halazzi SAY_KILL2'), +(-1568042,'Chaga... choka\'jinn.',12028,1,0,0,'halazzi SAY_DEATH'), +(-1568043,'Come, fools. Fill ma empty cages...',12029,1,0,0,'halazzi SAY_EVENT1'), +(-1568044,'I be waitin, strangers. Your deaths gonna make me stronger!',12030,1,0,0,'halazzi SAY_EVENT2'), + +(-1568045,'Da shadow gonna fall on you...',12041,1,0,0,'malacrass SAY_AGGRO'), +(-1568046,'Ya don\'t kill me yet, ya don\'t get another chance!',12042,1,0,0,'malacrass SAY_ENRAGE'), +(-1568047,'Dis a nightmare ya don\' wake up from!',12043,1,0,0,'malacrass SAY_KILL1'), +(-1568048,'Azzaga choogo zinn!',12044,1,0,0,'malacrass SAY_KILL2'), +(-1568049,'Your will belong ta me now!',12045,1,0,0,'malacrass SAY_SOUL_SIPHON'), +(-1568050,'Darkness comin\' for you...',12046,1,0,0,'malacrass SAY_DRAIN_POWER'), +(-1568051,'Your soul gonna bleed!',12047,1,0,0,'malacrass SAY_SPIRIT_BOLTS'), +(-1568052,'It not gonna make no difference.',12048,1,0,0,'malacrass SAY_ADD_DIED1'), +(-1568053,'You gonna die worse dan him.',12049,1,0,0,'malacrass SAY_ADD_DIED2'), +(-1568054,'Dat no bodda me.',12050,1,0,0,'malacrass SAY_ADD_DIED3'), +(-1568055,'Dis not... da end of me...',12051,1,0,0,'malacrass SAY_DEATH'), + +(-1568056,'Everybody always wanna take from us. Now we gonna start takin\' back. Anybody who get in our way...gonna drown in dey own blood! Da Amani empire be back now...seekin\' vengeance. And we gonna start wit\' you.',12090,1,0,0,'zuljin SAY_INTRO'), +(-1568057,'Nobody badduh dan me!',12091,1,0,0,'zuljin SAY_AGGRO'), +(-1568058,'Got me some new tricks... like me brudda bear....',12092,1,0,0,'zuljin SAY_BEAR_TRANSFORM'), +(-1568059,'Dere be no hidin\' from da eagle!',12093,1,0,0,'zuljin SAY_EAGLE_TRANSFORM'), +(-1568060,'Let me introduce you to me new bruddas: fang and claw!',12094,1,0,0,'zuljin SAY_LYNX_TRANSFORM'), +(-1568061,'Ya don\' have to look to da sky to see da dragonhawk!',12095,1,0,0,'zuljin SAY_DRAGONHAWK_TRANSFORM'), +(-1568062,'Fire kill you just as quick!',12096,1,0,0,'zuljin SAY_FIRE_BREATH'), +(-1568063,'You too slow! Me too strong!',12097,1,0,0,'zuljin SAY_BERSERK'), +(-1568064,'Da Amani de chuka!',12098,1,0,0,'zuljin SAY_KILL1'), +(-1568065,'Lot more gonna fall like you!',12099,1,0,0,'zuljin SAY_KILL2'), +(-1568066,'Mebbe me fall...but da Amani empire...never gonna die...',12100,1,0,0,'zuljin SAY_DEATH'), + +(-1568067,'Zul\'jin got a surprise for ya...',12052,1,0,0,'zulaman SAY_INST_RELEASE'), +(-1568068,'Da spirits gonna feast today! Begin da ceremonies, sacrifice da prisoners... make room for our new guests!',12053,1,0,0,'zulaman SAY_INST_BEGIN'), +(-1568069,'Take your pick, trespassers! Any of ma priests be happy to accommodate ya.',12054,1,0,0,'zulaman SAY_INST_PROGRESS_1'), +(-1568070,'Don\'t be shy. Thousands have come before you. Ya not be alone in your service.',12055,1,0,0,'zulaman SAY_INST_PROGRESS_2'), +(-1568071,'Ya gonna fail, strangers. Many try before you, but dey only make us stronger!',12056,1,0,0,'zulaman SAY_INST_PROGRESS_3'), +(-1568072,'Your efforts was in vain, trespassers. The rituals nearly be complete.',12057,1,0,0,'zulaman SAY_INST_WARN_1'), +(-1568073,'Soon da cages gonna be empty, da sacrifices be complete, and you gonna take dere places.',12058,1,0,0,'zulaman SAY_INST_WARN_2'), +(-1568074,'Time be running low, strangers. Soon you gonna join da souls of dem ya failed to save.',12059,1,0,0,'zulaman SAY_INST_WARN_3'), +(-1568075,'Make haste, ma priests! Da rituals must not be interrupted!',12060,1,0,0,'zulaman SAY_INST_WARN_4'), +(-1568076,'Ya make a good try... but now you gonna join da ones who already fall.',12061,1,0,0,'zulaman SAY_INST_SACRIF1'), +(-1568077,'Ya not do too bad. Ya efforts [...] for a small time. Come to me now. Ya prove yourself worthy offerings.',12062,1,0,0,'zulaman SAY_INST_SACRIF2'), +(-1568078,'Watch now. Every offering gonna strengthen our ties to da spirit world. Soon, we gonna be unstoppable!',12065,1,0,0,'zulaman SAY_INST_COMPLETE'), + +(-1568079,'Suit yourself. At least five of you must assist me if we\'re to get inside. Follow me.',0,1,0,0,'harrison SAY_START'), +(-1568080,'According to my calculations, if enough of us bang the gong at once the seal on these doors will break and we can enter.',0,1,0,0,'harrison SAY_AT_GONG'), +(-1568081,'I\'ve researched this site extensively and I won\'t allow any dim-witted treasure hunters to swoop in and steal what belongs to in a museum. I\'ll lead this charge.',0,1,0,0,'harrison SAY_OPEN_ENTRANCE'); + +-- -1 574 000 UTGARDE KEEP +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1574000,'Your blood is mine!',13221,1,0,0,'keleseth SAY_AGGRO'), +(-1574001,'Not so fast.',13222,1,0,0,'keleseth SAY_FROSTTOMB'), +(-1574002,'Aranal, lidel! Their fate shall be yours!',13224,1,0,0,'keleseth SAY_SKELETONS'), +(-1574003,'Darkness waits!',13223,1,0,0,'keleseth SAY_KILL'), +(-1574004,'I join... the night.',13225,1,0,0,'keleseth SAY_DEATH'), + +(-1574005,'I\'ll paint my face with your blood!',13207,1,0,0,'ingvar SAY_AGGRO_FIRST'), +(-1574006,'I return! A second chance to carve out your skull!',13209,1,0,0,'ingvar SAY_AGGRO_SECOND'), +(-1574007,'My life for the... death god!',13213,1,0,0,'ingvar SAY_DEATH_FIRST'), +(-1574008,'No! I can do... better! I can...',13211,1,0,0,'ingvar SAY_DEATH_SECOND'), +(-1574009,'Mjul orm agn gjor!',13212,1,0,0,'ingvar SAY_KILL_FIRST'), +(-1574010,'I am a warrior born!',13214,1,0,0,'ingvar SAY_KILL_SECOND'), + +(-1574011,'Dalronn! See if you can muster the nerve to join my attack!',13229,1,0,0,'skarvald SAY_SKA_AGGRO'), +(-1574012,'Not... over... yet.',13230,1,0,0,'skarvald SAY_SKA_DEATH'), +(-1574013,'A warrior\'s death.',13231,1,0,0,'skarvald SAY_SKA_DEATH_REAL'), +(-1574014,'???',13232,1,0,0,'skarvald SAY_SKA_KILL'), +(-1574015,'Pagh! What sort of necromancer lets death stop him? I knew you were worthless!',13233,1,0,0,'skarvald SAY_SKA_DAL_DIES_REPLY'), + +(-1574016,'By all means, don\'t assess the situation, you halfwit! Just jump into the fray!',13199,1,0,0,'dalronn SAY_DAL_AGGRO_REPLY'), +(-1574017,'See... you... soon.',13200,1,0,0,'dalronn SAY_DAL_DEATH'), +(-1574018,'There\'s no... greater... glory.',13201,1,0,0,'dalronn SAY_DAL_DEATH_REAL'), +(-1574019,'You may serve me yet.',13202,1,0,0,'dalronn SAY_DAL_KILL'), +(-1574020,'Skarvald, you incompetent slug! Return and make yourself useful!',13203,1,0,0,'dalronn SAY_DAL_SKA_DIES_REPLY'), + +(-1574021,'%s casts Frost Tomb on $N',0,3,0,0,'keleseth EMOTE_FROST_TOMB'), + +(-1574022,'%s roars!',0,3,0,0,'ingvar EMOTE_ROAR'), +(-1574023,'Ingvar! Your pathetic failure will serve as a warning to all... you are damned! Arise and carry out the masters will!',13754,1,0,0,'annhylde REZZ'); + +-- -1 575 000 UTGARDE PINNACLE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1575000,'My liege! I have done as you asked, and now beseech you for your blessing!',13856,1,0,0,'svala SAY_INTRO_1'), +(-1575001,'Your sacrifice is a testament to your obedience. Indeed you are worthy of this charge. Arise, and forever be known as Svala Sorrowgrave!',14732,1,0,0,'svala SAY_INTRO_2_ARTHAS'), +(-1575002,'The sensation is... beyond my imagining. I am yours to command, my king.',13857,1,0,0,'svala SAY_INTRO_3'), +(-1575003,'Your first test awaits you. Destroy our uninvited guests.',14733,1,0,0,'svala SAY_INTRO_4_ARTHAS'), +(-1575004,'I will be happy to slaughter them in your name! Come, enemies of the Scourge! I will show you the might of the Lich King!',13858,1,0,0,'svala SAY_INTRO_5'), +(-1575005,'I will vanquish your soul!',13842,1,0,0,'svala SAY_AGGRO'), +(-1575006,'You were a fool to challenge the power of the Lich King!',13845,1,0,0,'svala SAY_SLAY_1'), +(-1575007,'Your will is done, my king.',13847,1,0,0,'svala SAY_SLAY_2'), +(-1575008,'Another soul for my master.',13848,1,0,0,'svala SAY_SLAY_3'), +(-1575009,'Your death approaches.',13850,1,0,0,'svala SAY_SACRIFICE_1'), +(-1575010,'Go now to my master.',13851,1,0,0,'svala SAY_SACRIFICE_2'), +(-1575011,'Your end is inevitable.',13852,1,0,0,'svala SAY_SACRIFICE_3'), +(-1575012,'Yor-guul mak!',13853,1,0,0,'svala SAY_SACRIFICE_4'), +(-1575013,'Any last words?',13854,1,0,0,'svala SAY_SACRIFICE_5'), +(-1575014,'Nooo! I did not come this far... to...',13855,1,0,0,'svala SAY_DEATH'), + +(-1575015,'What this place? I will destroy you!',13464,1,0,0,'gortok SAY_AGGRO'), +(-1575016,'You die! That what master wants!',13465,1,0,0,'gortok SAY_SLAY_1'), +(-1575017,'An easy task!',13466,1,0,0,'gortok SAY_SLAY_2'), +(-1575018,' ',13467,1,0,0,'gortok SAY_DEATH'), + +(-1575019,'What mongrels dare intrude here? Look alive, my brothers! A feast for the one that brings me their heads!',13497,1,0,0,'skadi SAY_AGGRO'), +(-1575020,'Sear them to the bone!',13498,1,0,0,'skadi SAY_DRAKEBREATH_1'), +(-1575021,'Go now! Leave nothing but ash in your wake!',13499,1,0,0,'skadi SAY_DRAKEBREATH_2'), +(-1575022,'Cleanse our sacred halls with flame!',13500,1,0,0,'skadi SAY_DRAKEBREATH_3'), +(-1575023,'I ask for ... to kill them, yet all I get is feeble whelps! By Ye.. SLAUGHTER THEM!',13501,1,0,0,'skadi SAY_DRAKE_HARPOON_1'), +(-1575024,'If one more harpoon touches my drake I\'ll flae my miserable heins.',13502,1,0,0,'skadi SAY_DRAKE_HARPOON_2'), +(-1575025,'Mjor Na Ul Kaval!',13503,1,0,0,'skadi SAY_KILL_1'), +(-1575026,'Not so brash now, are you?',13504,1,0,0,'skadi SAY_KILL_2'), +(-1575027,'I\'ll mount your skull from the highest tower!',13505,1,0,0,'skadi SAY_KILL_3'), +(-1575028,'ARGH! You call that... an attack? I\'ll... show... aghhhh...',13506,1,0,0,'skadi SAY_DEATH'), +(-1575029,'You motherless knaves! Your corpses will make fine morsels for my new drake!',13507,1,0,0,'skadi SAY_DRAKE_DEATH'), +(-1575030,'%s is within range of the harpoon launchers!',0,3,0,0,'skadi EMOTE_HARPOON_RANGE'), + +(-1575031,'You invade my home and then dare to challenge me? I will tear the hearts from your chests and offer them as gifts to the death god! Rualg nja gaborr!',13609,1,0,0,'ymiron SAY_AGGRO'), +(-1575032,'Bjorn of the Black Storm! Honor me now with your presence!',13610,1,0,0,'ymiron SAY_SUMMON_BJORN'), +(-1575033,'Haldor of the rocky cliffs, grant me your strength!',13611,1,0,0,'ymiron SAY_SUMMON_HALDOR'), +(-1575034,'Ranulf of the screaming abyss, snuff these maggots with darkest night!',13612,1,0,0,'ymiron SAY_SUMMON_RANULF'), +(-1575035,'Tor of the Brutal Siege! Bestow your might upon me!',13613,1,0,0,'ymiron SAY_SUMMON_TORGYN'), +(-1575036,'Your death is only the beginning!',13614,1,0,0,'ymiron SAY_SLAY_1'), +(-1575037,'You have failed your people!',13615,1,0,0,'ymiron SAY_SLAY_2'), +(-1575038,'There is a reason I am king!',13616,1,0,0,'ymiron SAY_SLAY_3'), +(-1575039,'Bleed no more!',13617,1,0,0,'ymiron SAY_SLAY_4'), +(-1575040,'What... awaits me... now?',13618,1,0,0,'ymiron SAY_DEATH'); + +-- -1 576 000 NEXUS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1576000,'You know what they say about curiosity.',13319,1,0,0,'telestra SAY_AGGRO'), +(-1576001,'I\'ll give you more than you can handle.',13321,1,0,0,'telestra SAY_SPLIT_1'), +(-1576002,'There\'s plenty of me to go around.',13322,1,0,0,'telestra SAY_SPLIT_2'), +(-1576003,'Now to finish the job!',13323,1,0,0,'telestra SAY_MERGE'), +(-1576004,'Death becomes you!',13324,1,0,0,'telestra SAY_KILL'), +(-1576005,'Damn the... luck.',13320,1,0,0,'telestra SAY_DEATH'), + +(-1576006,'Chaos beckons.',13186,1,0,0,'anomalus SAY_AGGRO'), +(-1576007,'Reality... unwoven.',13188,1,0,0,'anomalus SAY_RIFT'), +(-1576008,'Indestructible.',13189,1,0,0,'anomalus SAY_SHIELD'), +(-1576009,'Expiration... is necesarry.',13274,1,0,0,'anomalus SAY_KILL'), +(-1576010,'Of course.',13187,1,0,0,'anomalus SAY_DEATH'), + +(-1576011,'Noo!',13328,1,0,0,'ormorok SAY_AGGRO'), +(-1576012,'???',13329,1,0,0,'ormorok SAY_KILL'), +(-1576013,'Baaack!',13331,1,0,0,'ormorok SAY_REFLECT'), +(-1576014,'Bleeeed!',13332,1,0,0,'ormorok SAY_ICESPIKE'), +(-1576015,'Aaggh!',13330,1,0,0,'ormorok SAY_DEATH'), + +(-1576016,'Preserve? Why? There\'s no truth in it. No no no... only in the taking! I see that now!',13450,1,0,0,'keristrasza SAY_AGGRO'), +(-1576017,'Stay. Enjoy your final moments.',13451,1,0,0,'keristrasza SAY_CRYSTAL_NOVA'), +(-1576018,'Finish it! Finish it! Kill me, or I swear by the Dragonqueen you\'ll never see daylight again!',13452,1,0,0,'keristrasza SAY_ENRAGE'), +(-1576019,'Now we\'ve come to the truth!',13453,1,0,0,'keristrasza SAY_KILL'), +(-1576020,'Dragonqueen... Life-Binder... preserve... me.',13454,1,0,0,'keristrasza SAY_DEATH'), + +(-1576021,'%s opens a Chaotic Rift!',0,3,0,0,'anomalus EMOTE_OPEN_RIFT'), +(-1576022,'%s shields himself and divert his power to the rifts!',0,3,0,0,'anomalus EMOTE_SHIELD'); + +-- -1 578 000 OCULUS + +-- -1 580 000 SUNWELL PLATEAU +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1580000,'Aggh! No longer will I be a slave to Malygos! Challenge me and you will be destroyed!',12422,1,0,0,'kalecgos SAY_EVIL_AGGRO'), +(-1580001,'I will purge you!',12423,1,0,0,'kalecgos SAY_EVIL_SPELL1'), +(-1580002,'Your pain has only begun!',12424,1,0,0,'kalecgos SAY_EVIL_SPELL2'), +(-1580003,'In the name of Kil\'jaeden!',12425,1,0,0,'kalecgos SAY_EVIL_SLAY1'), +(-1580004,'You were warned!',12426,1,0,0,'kalecgos SAY_EVIL_SLAY2'), +(-1580005,'My awakening is complete! You shall all perish!',12427,1,0,0,'kalecgos SAY_EVIL_ENRAGE'), +(-1580006,'I need... your help... Cannot... resist him... much longer...',12428,1,0,0,'kalecgos humanoid SAY_GOOD_AGGRO'), +(-1580007,'Aaahhh! Help me, before I lose my mind!',12429,1,0,0,'kalecgos humanoid SAY_GOOD_NEAR_DEATH'), +(-1580008,'Hurry! There is not much of me left!',12430,1,0,0,'kalecgos humanoid SAY_GOOD_NEAR_DEATH2'), +(-1580009,'I am forever in your debt. Once we have triumphed over Kil\'jaeden, this entire world will be in your debt as well.',12431,1,0,0,'kalecgos humanoid SAY_GOOD_PLRWIN'), +(-1580010,'There will be no reprieve. My work here is nearly finished.',12451,1,0,0,'sathrovarr SAY_SATH_AGGRO'), +(-1580011,'I\'m... never on... the losing... side...',12452,1,0,0,'sathrovarr SAY_SATH_DEATH'), +(-1580012,'Your misery is my delight!',12453,1,0,0,'sathrovarr SAY_SATH_SPELL1'), +(-1580013,'I will watch you bleed!',12454,1,0,0,'sathrovarr SAY_SATH_SPELL2'), +(-1580014,'Pitious mortal!',12455,1,0,0,'sathrovarr SAY_SATH_SLAY1'), +(-1580015,'Haven\'t you heard? I always win!',12456,1,0,0,'sathrovarr SAY_SATH_SLAY2'), +(-1580016,'I have toyed with you long enough!',12457,1,0,0,'sathrovarr SAY_SATH_ENRAGE'), + +(-1580017,'Puny lizard! Death is the only answer you\'ll find here!',12458,1,0,0,'brutallus YELL_INTRO'), +(-1580018,'Grah! Your magic is weak!',12459,1,0,0,'brutallus YELL_INTRO_BREAK_ICE'), +(-1580019,'I will crush you!',12460,1,0,0,'brutallus YELL_INTRO_CHARGE'), +(-1580020,'That was fun.',12461,1,0,0,'brutallus YELL_INTRO_KILL_MADRIGOSA'), +(-1580021,'Come, try your luck!',12462,1,0,0,'brutallus YELL_INTRO_TAUNT'), +(-1580022,'Ahh! More lambs to the slaughter!',12463,1,0,0,'brutallus YELL_AGGRO'), +(-1580023,'Perish, insect!',12464,1,0,0,'brutallus YELL_KILL1'), +(-1580024,'You are meat!',12465,1,0,0,'brutallus YELL_KILL2'), +(-1580025,'Too easy!',12466,1,0,0,'brutallus YELL_KILL3'), +(-1580026,'Bring the fight to me!',12467,1,0,0,'brutallus YELL_LOVE1'), +(-1580027,'Another day, another glorious battle!',12468,1,0,0,'brutallus YELL_LOVE2'), +(-1580028,'I live for this!',12469,1,0,0,'brutallus YELL_LOVE3'), +(-1580029,'So much for a real challenge... Die!',12470,1,0,0,'brutallus YELL_BERSERK'), +(-1580030,'Gah! Well done... Now... this gets... interesting...',12471,1,0,0,'brutallus YELL_DEATH'), + +(-1580031,'Hold, friends! There is information to be had before this devil meets his fate!',12472,1,0,0,'madrigosa YELL_MADR_ICE_BARRIER'), +(-1580032,'Where is Anveena, demon? What has become of Kalec?',12473,1,0,0,'madrigosa YELL_MADR_INTRO'), +(-1580033,'You will tell me where they are!',12474,1,0,0,'madrigosa YELL_MADR_ICE_BLOCK'), +(-1580034,'Speak, I grow weary of asking!',12475,1,0,0,'madrigosa YELL_MADR_TRAP'), +(-1580035,'Malygos, my lord! I did my best!',12476,1,0,0,'madrigosa YELL_MADR_DEATH'); + +-- -1 585 000 MAGISTER'S TERRACE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1585000,'You only waste my time!',12378,1,0,0,'selin SAY_AGGRO'), +(-1585001,'My hunger knows no bounds!',12381,1,0,0,'selin SAY_ENERGY'), +(-1585002,'Yes! I am a god!',12382,1,0,0,'selin SAY_EMPOWERED'), +(-1585003,'Enough distractions!',12388,1,0,0,'selin SAY_KILL_1'), +(-1585004,'I am invincible!',12385,1,0,0,'selin SAY_KILL_2'), +(-1585005,'No! More... I must have more!',12383,1,0,0,'selin SAY_DEATH'), +(-1585006,'%s begins to channel from the nearby Fel Crystal...',0,3,0,0,'selin EMOTE_CRYSTAL'), + +(-1585007,'Drain...life!',12389,1,0,0,'vexallus SAY_AGGRO'), +(-1585008,'Un...con...tainable.',12392,1,0,0,'vexallus SAY_ENERGY'), +(-1585009,'Un...leash...',12390,1,0,0,'vexallus SAY_OVERLOAD'), +(-1585010,'Con...sume.',12393,1,0,0,'vexallus SAY_KILL'), +(-1585011,'%s discharges pure energy!',0,3,0,0,'vexallus EMOTE_DISCHARGE_ENERGY'), + +(-1585012,'Annihilate them!',12395,1,0,0,'delrissa SAY_AGGRO'), +(-1585013,'Oh, the horror.',12398,1,0,0,'delrissa LackeyDeath1'), +(-1585014,'Well, aren\'t you lucky?',12400,1,0,0,'delrissa LackeyDeath2'), +(-1585015,'Now I\'m getting annoyed.',12401,1,0,0,'delrissa LackeyDeath3'), +(-1585016,'Lackies be damned! I\'ll finish you myself!',12403,1,0,0,'delrissa LackeyDeath4'), +(-1585017,'I call that a good start.',12405,1,0,0,'delrissa PlayerDeath1'), +(-1585018,'I could have sworn there were more of you.',12407,1,0,0,'delrissa PlayerDeath2'), +(-1585019,'Not really much of a group, anymore, is it?',12409,1,0,0,'delrissa PlayerDeath3'), +(-1585020,'One is such a lonely number.',12410,1,0,0,'delrissa PlayerDeath4'), +(-1585021,'It\'s been a kick, really.',12411,1,0,0,'delrissa PlayerDeath5'), +(-1585022,'Not what I had... planned...',12397,1,0,0,'delrissa SAY_DEATH'), + +(-1585023,'Don\'t look so smug! I know what you\'re thinking, but Tempest Keep was merely a set back. Did you honestly believe I would trust the future to some blind, half-night elf mongrel? Oh no, he was merely an instrument, a stepping stone to a much larger plan! It has all led to this, and this time, you will not interfere!',12413,1,0,0,'kaelthas MT SAY_AGGRO'), +(-1585024,'Vengeance burns!',12415,1,0,0,'kaelthas MT SAY_PHOENIX'), +(-1585025,'Felomin ashal!',12417,1,0,0,'kaelthas MT SAY_FLAMESTRIKE'), +(-1585026,'I\'ll turn your world... upside... down...',12418,1,0,0,'kaelthas MT SAY_GRAVITY_LAPSE'), +(-1585027,'Master... grant me strength.',12419,1,0,0,'kaelthas MT SAY_TIRED'), +(-1585028,'Do not... get too comfortable.',12420,1,0,0,'kaelthas MT SAY_RECAST_GRAVITY'), +(-1585029,'My demise accomplishes nothing! The Master will have you! You will drown in your own blood! This world shall burn! Aaaghh!',12421,1,0,0,'kaelthas MT SAY_DEATH'); + +-- -1 595 000 CULLING OF STRATHOLME + +-- -1 599 000 HALLS OF STONE +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1599000,'Soft, vulnerable shells. Brief, fragile lives. You can not escape the curse of flesh!',14180,1,0,0,'sjonnir SAY_AGGRO'), +(-1599001,'???',14181,1,0,0,'sjonnir SAY_SLAY_1'), +(-1599002,'Flesh is no match for iron!',14182,1,0,0,'sjonnir SAY_SLAY_2'), +(-1599003,'Armies of iron will smother the world!',14183,1,0,0,'sjonnir SAY_SLAY_3'), +(-1599004,'Loken will not rest, until the forge is retaken. You changed nothing!',14184,1,0,0,'sjonnir SAY_DEATH'), + +(-1599005,'You shouldn\'t have come...now you will die!',13487,1,0,0,'maiden SAY_AGGRO'), +(-1599006,'Why must it be this way?',13488,1,0,0,'maiden SAY_SLAY_1'), +(-1599007,'You had it coming!',13489,1,0,0,'maiden SAY_SLAY_2'), +(-1599008,'My burden grows heavier.',13490,1,0,0,'maiden SAY_SLAY_3'), +(-1599009,'This is your own fault!',13491,1,0,0,'maiden SAY_SLAY_4'), +(-1599010,'So much lost time... that you\'ll never get back!',13492,1,0,0,'maiden SAY_STUN'), +(-1599011,'I hope you all rot! I never...wanted...this.',13493,1,0,0,'maiden SAY_DEATH'), + +(-1599012,'Now that\'s owning your supper!',14244,1,0,0,'brann SAY_KILL_1'), +(-1599013,'Press on, that\'s the way!',14245,1,0,0,'brann SAY_KILL_2'), +(-1599014,'Keep it up now. Plenty of death-dealing for everyone!',14246,1,0,0,'brann SAY_KILL_3'), +(-1599015,'I\'m all kinds of busted up. Might not... make it...',14257,1,0,0,'brann SAY_LOW_HEALTH'), +(-1599016,'Not yet, not... yet-',14258,1,0,0,'brann SAY_DEATH'), +(-1599017,'I\'m doing everything I can!',14260,1,0,0,'brann SAY_PLAYER_DEATH_1'), +(-1599018,'Light preserve you!',14261,1,0,0,'brann SAY_PLAYER_DEATH_2'), +(-1599019,'I hope this is all worth it!',14262,1,0,0,'brann SAY_PLAYER_DEATH_3'), +(-1599020,'Time to get some answers! Let\'s get this show on the road!',14259,1,0,0,'brann SAY_ESCORT_START'), + +(-1599021,'Don\'t worry. Old Brann has got your back. Keep that metal monstrosity busy and I\'ll see if I can sweet talk this machine into helping you.',14274,1,0,0,'brann SAY_SPAWN_DWARF'), +(-1599022,'This is a wee bit trickier that before... Oh, bloody--incomin\'!',14275,1,0,0,'brann SAY_SPAWN_TROGG'), +(-1599023,'What in the name o\' Madoran did THAT do? Oh! Wait: I just about got it...',14276,1,0,0,'brann SAY_SPAWN_OOZE'), +(-1599024,'Ha, that did it. Help\'s a-coming. Take this you glow-eying brute!',14277,1,0,0,'brann SAY_SPAWN_EARTHEN'), + +(-1599025,'Take a moment and relish this with me! Soon all will be revealed! Okay then, let\'s do this!',14247,1,0,0,'brann SAY_EVENT_INTRO_1'), +(-1599026,'Now keep an eye out! I\'ll have this licked in two shakes of a--',14248,1,0,0,'brann SAY_EVENT_INTRO_2'), +(-1599027,'Warning! Life form pattern not recognized. Archival processing terminated. Continued interference will result in targeted response.',13765,1,0,0,'brann SAY_EVENT_INTRO_3_ABED'), + +(-1599028,'Oh, that doesn\'t sound good. We might have a complication or two...',14249,1,0,0,'brann SAY_EVENT_A_1'), +(-1599029,'Security breach in progress. Analysis of historical archives transferred to lower priority queue. Countermeasures engaged.',13756,1,0,0,'brann SAY_EVENT_A_2_KADD'), +(-1599030,'Ah, you want to play hardball, eh? That\'s just my game!',14250,1,0,0,'brann SAY_EVENT_A_3'), + +(-1599031,'Couple more minutes and I\'ll--',14251,1,0,0,'brann SAY_EVENT_B_1'), +(-1599032,'Threat index threshold exceeded. Celestial archive aborted. Security level heightened.',13761,1,0,0,'brann SAY_EVENT_B_2_MARN'), +(-1599033,'Heightened? What\'s the good news?',14252,1,0,0,'brann SAY_EVENT_B_3'), + +(-1599034,'So that was the problem? Now I\'m makin\' progress...',14253,1,0,0,'brann SAY_EVENT_C_1'), +(-1599035,'Critical threat index. Void analysis diverted. Initiating sanitization protocol.',13767,1,0,0,'brann SAY_EVENT_C_2_ABED'), +(-1599036,'Hang on! Nobody\'s gonna\' be sanitized as long as I have a say in it!',14254,1,0,0,'brann SAY_EVENT_C_3'), + +(-1599037,'Ha! The old magic fingers finally won through! Now let\'s get down to-',14255,1,0,0,'brann SAY_EVENT_D_1'), +(-1599038,'Alert! Security fail safes deactivated. Beginning memory purge...',13768,1,0,0,'brann SAY_EVENT_D_2_ABED'), +(-1599039,'Purge? No no no no no! Where did I-- Aha, this should do the trick...',14256,1,0,0,'brann SAY_EVENT_D_3'), +(-1599040,'System online. Life form pattern recognized. Welcome Branbronzan. Query?',13769,1,0,0,'brann SAY_EVENT_D_4_ABED'), + +(-1599041,'Query? What do you think I\'m here for? Tea and biscuits? Spill the beans already!',14263,1,0,0,'brann SAY_EVENT_END_01'), +(-1599042,'Tell me how that dwarfs came to be! And start at the beginning!',14264,1,0,0,'brann SAY_EVENT_END_02'), +(-1599043,'Accessing prehistoric data. Retrieved. In the beginning Earthen were created to-',13770,1,0,0,'brann SAY_EVENT_END_03_ABED'), +(-1599044,'Right, right! I know that the Earthen were made of stone to shape the deep reaches of the world but what about the anomalies? Matrix non-stabilizing and whatnot.',14265,1,0,0,'brann SAY_EVENT_END_04'), +(-1599045,'Accessing. In the early stages of its development cycle Azeroth suffered infection by parasitic, necrophotic symbiotes.',13771,1,0,0,'brann SAY_EVENT_END_05_ABED'), +(-1599046,'Necro-what? Speak bloody common will ya?',14266,1,0,0,'brann SAY_EVENT_END_06'), +(-1599047,'Designation: Old Gods. Old Gods rendered all systems, including Earthen defenseless in order to facilitate assimilation. This matrix destabilization has been termed the Curse of Flesh. Effects of destabilization increased over time.',13772,1,0,0,'brann SAY_EVENT_END_07_ABED'), +(-1599048,'Old Gods eh? So they zapped the Earthen with this Curse of Flesh. And then what?',14267,1,0,0,'brann SAY_EVENT_END_08'), +(-1599049,'Accessing. Creators arrived to extirpate symbiotic infection. Assessment revealed that Old God infestation had grown malignant. Excising parasites would result in loss of host.',13757,1,0,0,'brann SAY_EVENT_END_09_KADD'), +(-1599050,'If they killed the Old Gods Azeroth would have been destroyed.',14268,1,0,0,'brann SAY_EVENT_END_10'), +(-1599051,'Correct. Creators neutralized parasitic threat and contained it within the host. Forge of Wills and other systems were instituted to create new Earthen. Safeguards were implemented and protectors were appointed.',13758,1,0,0,'brann SAY_EVENT_END_11_KADD'), +(-1599052,'What protectors?',14269,1,0,0,'brann SAY_EVENT_END_12'), +(-1599053,'Designations: Aesir and Vanir or in common nomenclator Storm and Earth Giants. Sentinel Loken designated supreme. Dragon Aspects appointed to monitor evolution of Azeroth.',13759,1,0,0,'brann SAY_EVENT_END_13_KADD'), +(-1599054,'Aesir and Vanir. Okay. So the Forge of Wills started to make new Earthen. But what happened to the old ones?',14270,1,0,0,'brann SAY_EVENT_END_14'), +(-1599055,'Additional background is relevant to your query. Following global combat between-',13762,1,0,0,'brann SAY_EVENT_END_15_MARN'), +(-1599056,'Hold everything! The Aesir and Vanir went to war? Why?',14271,1,0,0,'brann SAY_EVENT_END_16'), +(-1599057,'Unknown. Data suggests that impetus for global combat originated with prime designate Loken who neutralized all remaining Aesir and Vanir affecting termination of conflict. Prime designate Loken then initiated stasis of several seed races including Earthen, Giant and Vrykul at designated holding facilities.',13763,1,0,0,'brann SAY_EVENT_END_17_MARN'), +(-1599058,'This Loken sounds like a nasty character. Glad we don\'t have to worry about the likes of him anymore. So if I\'m understanding you lads the original Earthen eventually woke up from this statis. And by that time this destabily-whatever had turned them into our brother dwarfs. Or at least dwarf ancestors. Hm?',14272,1,0,0,'brann SAY_EVENT_END_18'), +(-1599059,'Essentially that is correct.',13764,1,0,0,'brann SAY_EVENT_END_19_MARN'), +(-1599060,'Well now. That\'s a lot to digest. I\'m gonna need some time to take all of this in. Thank you!',14273,1,0,0,'brann SAY_EVENT_END_20'), +(-1599061,'Acknowledged Branbronzan. Session terminated.',13773,1,0,0,'brann SAY_EVENT_END_21_ABED'), + +(-1599062,'Loken?! That\'s downright bothersome... We might\'ve neutralized the iron dwarves, but I\'d lay odds there\'s another machine somewhere else churnin\' out a whole mess o\' these iron vrykul!',14278,1,0,0,'brann SAY_VICTORY_SJONNIR_1'), +(-1599063,'I\'ll use the forge to make badtches o\' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!',14279,1,0,0,'brann SAY_VICTORY_SJONNIR_2'), + +(-1599064,'I think it\'s time to see what\'s behind the door near the entrance. I\'m going to sneak over there, nice and quiet. Meet me at the door and I\'ll get us in.',0,1,0,0,'brann SAY_ENTRANCE_MEET'); + +-- -1 600 000 DRAK'THARON KEEP +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1600000,'More grunts, more glands, more FOOD!',13181,1,0,0,'trollgore SAY_AGGRO'), +(-1600001,'So hungry! Must feed!',13182,1,0,0,'trollgore SAY_CONSUME'), +(-1600002,'Aaaargh...',13183,1,0,0,'trollgore SAY_DEATH'), +(-1600003,'Corpse go boom!',13184,1,0,0,'trollgore SAY_EXPLODE'), +(-1600004,'You have gone, me gonna eat you!',13185,1,0,0,'trollgore SAY_KILL'), + +(-1600005,'The chill that you feel is the herald of your doom!',13173,1,0,0,'novos SAY_AGGRO'), +(-1600006,'Your efforts... are in vain.',13174,1,0,0,'novos SAY_DEATH'), +(-1600007,'Such is the fate of all who oppose the Lich King.',13175,1,0,0,'novos SAY_KILL'), +(-1600008,'Bolster my defenses! Hurry, curse you!',13176,1,0,0,'novos SAY_ADDS'), +(-1600009,'Surely you can see the futility of it all!',13177,1,0,0,'novos SAY_BUBBLE_1'), +(-1600010,'Just give up and die already!',13178,1,0,0,'novos SAY_BUBBLE_2'), +(-1600011,'%s calls for assistance.',0,3,0,0,'novos EMOTE_ASSISTANCE'), + +(-1600012,'Tharon\'ja sees all! The work of mortals shall not end the eternal dynasty!',13862,1,0,0,'tharonja SAY_AGGRO'), +(-1600013,'As Tharon\'ja predicted.',13863,1,0,0,'tharonja SAY_KILL_1'), +(-1600014,'As it was written.',13864,1,0,0,'tharonja SAY_KILL_2'), +(-1600015,'Your flesh serves Tharon\'ja now!',13865,1,0,0,'tharonja SAY_FLESH_1'), +(-1600016,'Tharon\'ja has a use for your mortal shell!',13866,1,0,0,'tharonja SAY_FLESH_2'), +(-1600017,'No! A taste... all too brief!',13867,1,0,0,'tharonja SAY_SKELETON_1'), +(-1600018,'Tharon\'ja will have more!',13868,1,0,0,'tharonja SAY_SKELETON_2'), +(-1600019,'Im... impossible! Tharon\'ja is eternal! Tharon\'ja... is...',13869,1,0,0,'tharonja SAY_DEATH'); + +-- -1 601 000 AZJOL-NERUB +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1601000,'This kingdom belongs to the Scourge! Only the dead may enter.',14075,1,0,0,'krikthir SAY_AGGRO'), +(-1601001,'???',14076,1,0,0,'krikthir SAY_KILL_1'), +(-1601002,'You were foolish to come.',14077,1,0,0,'krikthir SAY_KILL_2'), +(-1601003,'As Anub\'Arak commands!',14078,1,0,0,'krikthir SAY_KILL_3'), +(-1601004,'We are besieged. Strike out and bring back their corpses!',14079,1,0,0,'krikthir SAY_SEND_GROUP_1'), +(-1601005,'We must hold the gate. Attack! Tear them limb from limb!',14080,1,0,0,'krikthir SAY_SEND_GROUP_2'), +(-1601006,'The gate must be protected at all costs. Rip them to shreds!',14081,1,0,0,'krikthir SAY_SEND_GROUP_3'), +(-1601007,'Keep an eye on the tunnel. We must not let anyone through!',14082,1,0,0,'krikthir SAY_PREFIGHT_1'), +(-1601008,'I hear footsteps. Be on your guard.',14083,1,0,0,'krikthir SAY_PREFIGHT_2'), +(-1601009,'I sense the living. Be ready.',14084,1,0,0,'krikthir SAY_PREFIGHT_3'), +(-1601010,'They hunger.',14085,1,0,0,'krikthir SAY_SWARM_1'), +(-1601011,'Dinner time, my pets.',14086,1,0,0,'krikthir SAY_SWARM_2'), +(-1601012,'I should be grateful. But I long ago lost the capacity.',14087,1,0,0,'krikthir SAY_DEATH'), +(-1601013,'REUSE ME',0,0,0,0,'REUSE ME'), + +(-1601014,'I was king of this empire once, long ago. In life I stood as champion. In death I returned as conqueror. Now I protect the kingdom once more. Ironic, yes?',14053,1,0,0,'anubarak SAY_INTRO'), +(-1601015,'Eternal agony awaits you!',14054,1,0,0,'anubarak SAY_AGGRO'), +(-1601016,'You shall experience my torment, first-hand!',14055,1,0,0,'anubarak SAY_KILL_1'), +(-1601017,'You have made your choice.',14056,1,0,0,'anubarak SAY_KILL_2'), +(-1601018,'Soon, the Master\'s voice will call to you.',14057,1,0,0,'anubarak SAY_KILL_3'), +(-1601019,'Come forth, my brethren. Feast on their flesh!',14058,1,0,0,'anubarak SAY_SUBMERGE_1'), +(-1601020,'Auum na-l ak-k-k-k, isshhh.',14059,1,0,0,'anubarak SAY_SUBMERGE_2'), +(-1601021,'Your armor is useless against my locusts!',14060,1,0,0,'anubarak SAY_LOCUST_1'), +(-1601022,'The pestilence upon you!',14067,1,0,0,'anubarak SAY_LOCUST_2'), +(-1601023,'Uunak-hissss tik-k-k-k-k!',14068,1,0,0,'anubarak SAY_LOCUST_3'), +(-1601024,'Ahhh... RAAAAAGH! Never thought... I would be free of him...',14069,1,0,0,'anubarak SAY_DEATH'); + +-- -1 602 000 HALLS OF LIGHTNING +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1602000,'I am the greatest of my father\'s sons! Your end has come!',14149,1,0,0,'bjarngrim SAY_AGGRO'), +(-1602001,'So ends your curse!',14153,1,0,0,'bjarngrim SAY_SLAY_1'), +(-1602002,'Flesh... is... weak!',14154,1,0,0,'bjarngrim SAY_SLAY_2'), +(-1602003,'...',14155,1,0,0,'bjarngrim SAY_SLAY_3'), +(-1602004,'How can it be...? Flesh is not... stronger!',14156,1,0,0,'bjarngrim SAY_DEATH'), +(-1602005,'Defend yourself, for all the good it will do!',14151,1,0,0,'bjarngrim SAY_BATTLE_STANCE'), +(-1602006,'%s switches to Battle Stance!',0,3,0,0,'bjarngrim EMOTE_BATTLE_STANCE'), +(-1602007,'GRAAAAAH! Behold the fury of iron and steel!',14152,1,0,0,'bjarngrim SAY_BERSEKER_STANCE'), +(-1602008,'%s switches to Berserker Stance!',0,3,0,0,'bjarngrim EMOTE_BERSEKER_STANCE'), +(-1602009,'Give me your worst!',14150,1,0,0,'bjarngrim SAY_DEFENSIVE_STANCE'), +(-1602010,'%s switches to Defensive Stance!',0,3,0,0,'bjarngrim EMOTE_DEFENSIVE_STANCE'), + +(-1602011,'You wish to confront the master? You must weather the storm!',14453,1,0,0,'ionar SAY_AGGRO'), +(-1602012,'Shocking ... I know!',14456,1,0,0,'ionar SAY_SLAY_1'), +(-1602013,'You atempt the unpossible.',14457,1,0,0,'ionar SAY_SLAY_2'), +(-1602014,'Your spark of light is ... extinguish.',14458,1,0,0,'ionar SAY_SLAY_3'), +(-1602015,'Master... you have guests.',14459,1,0,0,'ionar SAY_DEATH'), +(-1602016,'The slightest spark shall be your undoing.',14454,1,0,0,'ionar SAY_SPLIT_1'), +(-1602017,'No one is safe!',14455,1,0,0,'ionar SAY_SPLIT_2'), + +(-1602018,'What hope is there for you? None!',14162,1,0,0,'loken SAY_AGGRO0'), +(-1602019,'I have witnessed the rise and fall of empires. The birth and extinction of entire species. Over countless millennia the foolishness of mortals has remained beyond a constant. Your presence here confirms this.',14160,1,0,0,'loken SAY_INTRO_1'), +(-1602020,'My master has shown me the future, and you have no place in it. Azeroth will be reborn in darkness. Yogg-Saron shall be released! The Pantheon shall fall!',14162,1,0,0,'loken SAY_INTRO_2'), +(-1602021,'Only mortal...',14166,1,0,0,'loken SAY_SLAY_1'), +(-1602022,'I... am... FOREVER!',14167,1,0,0,'loken SAY_SLAY_2'), +(-1602023,'What little time you had, you wasted!',14168,1,0,0,'loken SAY_SLAY_3'), +(-1602024,'My death... heralds the end of this world.',14172,1,0,0,'loken SAY_DEATH'), +(-1602025,'You cannot hide from fate!',14163,1,0,0,'loken SAY_NOVA_1'), +(-1602026,'Come closer. I will make it quick.',14164,1,0,0,'loken SAY_NOVA_2'), +(-1602027,'Your flesh cannot hold out for long.',14165,1,0,0,'loken SAY_NOVA_3'), +(-1602028,'You stare blindly into the abyss!',14169,1,0,0,'loken SAY_75HEALTH'), +(-1602029,'Your ignorance is profound. Can you not see where this path leads?',14170,1,0,0,'loken SAY_50HEALTH'), +(-1602030,'You cross the precipice of oblivion!',14171,1,0,0,'loken SAY_25HEALTH'), +(-1602031,'%s begins to cast Lightning Nova!',0,3,0,0,'loken EMOTE_NOVA'), + +(-1602032,'It is you who have destroyed my children? You... shall... pay!',13960,1,0,0,'volkhan SAY_AGGRO'), +(-1602033,'The armies of iron will conquer all!',13965, 1,0,0,'volkhan SAY_SLAY_1'), +(-1602034,'Ha, pathetic!',13966,1,0,0,'volkhan SAY_SLAY_2'), +(-1602035,'You have cost me too much work!',13967,1,0,0,'volkhan SAY_SLAY_3'), +(-1602036,'The master was right... to be concerned.',13968,1,0,0,'volkhan SAY_DEATH'), +(-1602037,'I will crush you beneath my boots!',13963,1,0,0,'volkhan SAY_STOMP_1'), +(-1602038,'All my work... undone!',13964,1,0,0,'volkhan SAY_STOMP_2'), +(-1602039,'Life from the lifelessness... death for you.',13961,1,0,0,'volkhan SAY_FORGE_1'), +(-1602040,'Nothing is wasted in the process. You will see....',13962,1,0,0,'volkhan SAY_FORGE_2'), +(-1602041,'%s runs to his anvil!',0,3,0,0,'volkhan EMOTE_TO_ANVIL'), +(-1602042,'%s prepares to shatter his Brittle Golems!',0,3,0,0,'volkhan EMOTE_SHATTER'); + +-- -1 603 000 ULDUAR + +-- -1 604 000 GUNDRAK +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1604000,'Drakkari gonna kill anybody who trespass on these lands!',14443,1,0,0,'sladran SAY_AGGRO'), +(-1604001,'Minions of the scale, heed my call!',14444,1,0,0,'sladran SAY_SUMMON_SNAKE'), +(-1604002,'Our thousand fangs gonna rend your flesh! ',14445,1,0,0,'sladran SAY_SUMMON_CONSTRICTOR'), +(-1604003,'Ye not breathin\'! Good.',14446,1,0,0,'sladran SAY_SLAY_1'), +(-1604004,'You scared now?',14447,1,0,0,'sladran SAY_SLAY_2'), +(-1604005,'I\'ll eat you next, mon!',14448,1,0,0,'sladran SAY_SLAY_3'), +(-1604006,'I sssee now... Ssscourge wasss not... our greatessst enemy...',14449,1,0,0,'sladran SAY_DEATH'), +(-1604007,'%s begins to cast Poison Nova!',0,3,0,0,'sladran EMOTE_NOVA'), + +(-1604008,'%s surges forward!',0,2,0,0,'colossus EMOTE_SURGE'), +(-1604009,'%s seep into the ground.',0,2,0,0,'colossus EMOTE_SEEP'), +(-1604010,'%s begins to glow faintly.',0,2,0,0,'colossus EMOTE_GLOW'), + +(-1604011,'We fought back da Scourge. What chance joo be thinkin\' JOO got?',14721,1,0,0,'moorabi SAY_AGGRO'), +(-1604012,'Da ground gonna swallow you up! ',14723,1,0,0,'moorabi SAY_QUAKE'), +(-1604013,'Get ready for somethin\'... much... BIGGAH!',14722,1,0,0,'moorabi SAY_TRANSFORM'), +(-1604014,'I crush you, cockroaches!',14725,1,0,0,'moorabi SAY_SLAY_1'), +(-1604015,'Who gonna stop me; you?',14726,1,0,0,'moorabi SAY_SLAY_2'), +(-1604016,'Not so tough now.',14727,1,0,0,'moorabi SAY_SLAY_3'), +(-1604017,'If our gods can die... den so can we...',14728,1,0,0,'moorabi SAY_DEATH'), +(-1604018,'%s begins to transform!',0,3,0,0,'moorabi EMOTE_TRANSFORM'), + +(-1604019,'I\'m gonna spill your guts, mon!',14430,1,0,0,'galdarah SAY_AGGRO'), +(-1604020,'Ain\'t gonna be nottin\' left after this!',14431,1,0,0,'galdarah SAY_TRANSFORM_1'), +(-1604021,'You wanna see power? I\'m gonna show you power!',14432,1,0,0,'galdarah SAY_TRANSFORM_2'), +(-1604022,'Gut them! Impale them!',14433,1,0,0,'galdarah SAY_SUMMON_1'), +(-1604023,'Kill them all!',14434,1,0,0,'galdarah SAY_SUMMON_2'), +(-1604024,'Say hello to my BIG friend!',14435,1,0,0,'galdarah SAY_SUMMON_3'), +(-1604025,'What a rush!',14436,1,0,0,'galdarah SAY_SLAY_1'), +(-1604026,'Who needs gods, when WE ARE GODS!',14437,1,0,0,'galdarah SAY_SLAY_2'), +(-1604027,'I told ya so!',14438,1,0,0,'galdarah SAY_SLAY_3'), +(-1604028,'Even the mighty... can fall.',14439,1,0,0,'galdarah SAY_DEATH'), + +(-1604029,'%s transforms into a Mammoth!',14724,2,0,0,'moorabi EMOTE_TRANSFORMED'), +(-1604030,'%N is impaled!',0,3,0,0,'EMOTE_IMPALED'); + + +-- -1 608 000 VIOLET HOLD +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1608000,'Prison guards, we are leaving! These adventurers are taking over! Go, go, go!',0,1,0,0,'sinclair SAY_BEGIN'), +(-1608001,'I\'m locking the door. Good luck, and thank you for doing this.',0,0,0,0,'sinclair SAY_LOCK_DOOR'), + +(-1608002,'Adventurers, the door is beinning to weaken!',0,1,0,0,'sinclair SAY_SEAL_75'), +(-1608003,'Only half of the door seal\'s strength remains! You must fight on!',0,1,0,0,'sinclair SAY_SEAL_50'), +(-1608004,'The door seal is about to collapse! All is lost if the Blue Dragonflight breaks through the door!',0,1,0,0,'sinclair SAY_SEAL_5'), + +(-1608005,'A Portal Guardian defends the new portal!',0,3,0,0,'EMOTE_GUARDIAN_PORTAL'), +(-1608006,'An elite Blue Dragonflight squad appears from the portal!',0,3,0,0,'EMOTE_DRAGONFLIGHT_PORTAL'), +(-1608007,'A Guardian Keeper emerges from the portal!',0,3,0,0,'EMOTE_KEEPER_PORTAL'); + +-- -1 609 000 EBON HOLD (DK START) +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1609000,'You have made a grave error, fiend!',0,0,0,0,'unworthy SAY_START_1'), +(-1609001,'I was a soldier of the Light once... Look at what I have become... ',0,0,0,0,'unworthy SAY_START_2'), +(-1609002,'You are hopelessly outmatched, $R.',0,0,0,0,'unworthy SAY_START_3'), +(-1609003,'They brand me unworthy? I will show them unmorthy!',0,0,0,0,'unworthy SAY_START_4'), +(-1609004,'You will allow me a weapon and armor, yes?',0,0,0,0,'unworthy SAY_START_5'), +(-1609005,'I will win my freedom and leave this cursed place!',0,0,0,0,'unworthy SAY_START_6'), +(-1609006,'I will dismantle this festering hellhole!',0,0,0,0,'unworthy SAY_START_7'), +(-1609007,'There can be only one survivor!',0,0,0,0,'unworthy SAY_START_8'), + +(-1609008,'Let your fears consume you!',0,0,0,0,'unworthy SAY_AGGRO_1'), +(-1609009,'HAH! You can barely hold a blade! Yours will be a quick death.',0,0,0,0,'unworthy SAY_AGGRO_2'), +(-1609010,'And now you die',0,0,0,0,'unworthy SAY_AGGRO_3'), +(-1609011,'To battle!',0,0,0,0,'unworthy SAY_AGGRO_4'), +(-1609012,'There is no hope for our future...',0,0,0,0,'unworthy SAY_AGGRO_5'), +(-1609013,'Sate your hunger on cold steel, $R',0,0,0,0,'unworthy SAY_AGGRO_6'), +(-1609014,'It ends here!',0,0,0,0,'unworthy SAY_AGGRO_7'), +(-1609015,'Death is the only cure!',0,0,0,0,'unworthy SAY_AGGRO_8'), + +(-1609016,'No potions!',0,0,0,0,'dk_initiate SAY_DUEL_A'), +(-1609017,'Remember this day, $n, for it is the day that you will be thoroughly owned.',0,0,0,0,'dk_initiate SAY_DUEL_B'), +(-1609018,'I\'m going to tear your heart out, cupcake!',0,0,0,0,'dk_initiate SAY_DUEL_C'), +(-1609019,'Don\'t make me laugh.',0,0,0,0,'dk_initiate SAY_DUEL_D'), +(-1609020,'Here come the tears...',0,0,0,0,'dk_initiate SAY_DUEL_E'), +(-1609021,'You have challenged death itself!',0,0,0,0,'dk_initiate SAY_DUEL_F'), +(-1609022,'The Lich King will see his true champion on this day!',0,0,0,0,'dk_initiate SAY_DUEL_G'), +(-1609023,'You\'re going down!',0,0,0,0,'dk_initiate SAY_DUEL_H'), +(-1609024,'You don\'t stand a chance, $n',0,0,0,0,'dk_initiate SAY_DUEL_I'), + +(-1609025,'Come to finish the job, have you?',0,0,0,1,'special_surprise SAY_EXEC_START_1'), +(-1609026,'Come to finish the job, have ye?',0,0,0,1,'special_surprise SAY_EXEC_START_2'), +(-1609027,'Come ta finish da job, mon?',0,0,0,1,'special_surprise SAY_EXEC_START_3'), + +(-1609028,'You\'ll look me in the eyes when...',0,0,0,25,'special_surprise SAY_EXEC_PROG_1'), +(-1609029,'Well this son o\' Ironforge would like...',0,0,0,25,'special_surprise SAY_EXEC_PROG_2'), +(-1609030,'Ironic, isn\'t it? To be killed...',0,0,0,25,'special_surprise SAY_EXEC_PROG_3'), +(-1609031,'If you\'d allow me just one...',0,0,0,25,'special_surprise SAY_EXEC_PROG_4'), +(-1609032,'I\'d like to stand for...',0,0,0,25,'special_surprise SAY_EXEC_PROG_5'), +(-1609033,'I want to die like an orc...',0,0,0,25,'special_surprise SAY_EXEC_PROG_6'), +(-1609034,'Dis troll gonna stand for da...',0,0,0,25,'special_surprise SAY_EXEC_PROG_7'), + +(-1609035,'$N?',0,0,0,1,'special_surprise SAY_EXEC_NAME_1'), +(-1609036,'$N? Mon?',0,0,0,1,'special_surprise SAY_EXEC_NAME_2'), + +(-1609037,'$N, I\'d recognize that face anywhere... What... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_1'), +(-1609038,'$N, I\'d recognize those face tentacles anywhere... What... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_2'), +(-1609039,'$N, I\'d recognize that face anywhere... What... What have they done to ye, $Glad:lass;?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_3'), +(-1609040,'$N, I\'d recognize that decay anywhere... What... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_4'), +(-1609041,'$N, I\'d recognize those horns anywhere... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_5'), +(-1609042,'$N, I\'d recognize dem tusks anywhere... What... What have dey done ta you, mon?',0,0,0,1,'special_surprise SAY_EXEC_RECOG_6'), + +(-1609043,'You don\'t remember me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a righteous force of reckoning. Every last ounce of good... Everything that made you a draenei!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_1'), +(-1609044,'Ye don\'t remember me, do ye? Blasted Scourge... They\'ve tried to drain ye o\' everything that made ye a righteous force o\' reckoning. Every last ounce o\' good... Everything that made you a $Gson:daughter; of Ironforge!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_2'), +(-1609045,'You don\'t remember me, do you? We were humans once - long, long ago - until Lordaeron fell to the Scourge. Your transformation to a Scourge zombie came shortly after my own. Not long after that, our minds were freed by the Dark Lady.',0,0,0,1,'special_surprise SAY_EXEC_NOREM_3'), +(-1609046,'You don\'t remember me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a pint-sized force of reckoning. Every last ounce of good... Everything that made you a gnome!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_4'), +(-1609047,'You don\'t remember me, do you? Blasted Scourge...They\'ve tried to drain of everything that made you a righteous force of reckoning. Every last ounce of good...Everything that made you a human!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_5'), +(-1609048,'You don\'t remember me? When you were a child your mother would leave you in my care while she served at the Temple of the Moon. I held you in my arms and fed you with honey and sheep\'s milk to calm you until she would return. You were my little angel. Blasted Scourge... What have they done to you, $N?',0,0,0,1,'special_surprise SAY_EXEC_NOREM_6'), +(-1609049,'You don\'t recognize me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a righteous force of reckoning. Every last ounce of good... Everything that made you an orc!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_7'), +(-1609050,'You don\'t remember me, do you? Blasted Scourge... They\'ve tried to drain you of everything that made you a righteous force of reckoning. Every last ounce of good... Everything that made you a tauren!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_8'), +(-1609051,'You don\'t remember me, mon? Damn da Scourge! Dey gone ta drain you of everytin dat made ya a mojo masta. Every last ounce of good... Everytin\' dat made ya a troll hero, mon!',0,0,0,1,'special_surprise SAY_EXEC_NOREM_9'), + +(-1609052,'A pact was made, $Gbrother:sister;! We vowed vengeance against the Lich King! For what he had done to us! We battled the Scourge as Forsaken, pushing them back into the plaguelands and freeing Tirisfal! You and I were champions of the Forsaken!',0,0,0,1,'special_surprise SAY_EXEC_THINK_1'), +(-1609053,'You must remember the splendor of life, $Gbrother:sister;. You were a champion of the Kaldorei once! This isn\'t you!',0,0,0,1,'special_surprise SAY_EXEC_THINK_2'), +(-1609054,'Think, $N. Think back. Try and remember the majestic halls of Silvermoon City, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the sin\'dorei once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_3'), +(-1609055,'Think, $N. Think back. Try and remember the proud mountains of Argus, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the draenei once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_4'), +(-1609056,'Think, $N. Think back. Try and remember the snow capped mountains o\' Dun Morogh! Ye were born there, $Glad:lass;. Remember the splendor o\' life, $N! Ye were a champion o\' the dwarves once! This isn\'t ye!',0,0,0,6,'special_surprise SAY_EXEC_THINK_5'), +(-1609057,'Think, $N. Think back. Try and remember Gnomeregan before those damned troggs! Remember the feel of an [arclight spanner] $Gbrother:sister;. You were a champion of gnome-kind once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_6'), +(-1609058,'Think, $N. Think back. Try and remember the hills and valleys of Elwynn, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the Alliance once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_7'), +(-1609059,'Think, $N. Think back. Try and remember Durotar, $Gbrother:sister;! Remember the sacrifices our heroes made so that we could be free of the blood curse. Harken back to the Valley of Trials, where we were reborn into a world without demonic influence. We found the splendor of life, $N. Together! This isn\'t you. You were a champion of the Horde once!',0,0,0,6,'special_surprise SAY_EXEC_THINK_8'), +(-1609060,'Think, $N. Think back. Try and remember the rolling plains of Mulgore, where you were born. Remember the splendor of life, $Gbrother:sister;. You were a champion of the tauren once! This isn\'t you.',0,0,0,6,'special_surprise SAY_EXEC_THINK_9'), +(-1609061,'TINK $N. Tink back, mon! We be Darkspear, mon! Bruddas and sistas! Remember when we fought the Zalazane and done took he head and freed da Echo Isles? MON! TINK! You was a champion of da Darkspear trolls!',0,0,0,6,'special_surprise SAY_EXEC_THINK_10'), + +(-1609062,'Listen to me, $N. You must fight against the Lich King\'s control. He is a monster that wants to see this world - our world - in ruin. Don\'t let him use you to accomplish his goals. You were once a hero and you can be again. Fight, damn you! Fight his control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_1'), +(-1609063,'Listen to me, $N Ye must fight against the Lich King\'s control. He\'s a monster that wants to see this world - our world - in ruin. Don\'t let him use ye to accomplish his goals. Ye were once a hero and ye can be again. Fight, damn ye! Fight his control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_2'), +(-1609064,'Listen to me, $N. You must fight against the Lich King\'s control. He is a monster that wants to see this world - our world - in ruin. Don\'t let him use you to accomplish his goals AGAIN. You were once a hero and you can be again. Fight, damn you! Fight his control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_3'), +(-1609065,'Listen ta me, $Gbrudda:sista;. You must fight against da Lich King\'s control. He be a monstar dat want ta see dis world - our world - be ruined. Don\'t let he use you ta accomplish he goals. You be a hero once and you be a hero again! Fight it, mon! Fight he control!',0,0,0,5,'special_surprise SAY_EXEC_LISTEN_4'), + +(-1609066,'What\'s going on in there? What\'s taking so long, $N?',0,1,0,0,'special_surprise SAY_PLAGUEFIST'), + +(-1609067,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Silvermoon. This world is worth saving!',0,0,0,18,'special_surprise SAY_EXEC_TIME_1'), +(-1609068,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Argus. Don\'t let that happen to this world.',0,0,0,18,'special_surprise SAY_EXEC_TIME_2'), +(-1609069,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both $N... For KHAAAAAAAAZZZ MODAAAAAANNNNNN!!!',0,0,0,18,'special_surprise SAY_EXEC_TIME_3'), +(-1609070,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Tirisfal! This world is worth saving!',0,0,0,18,'special_surprise SAY_EXEC_TIME_4'), +(-1609071,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Gnomeregan! This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_5'), +(-1609072,'There... There\'s no more time for me. I\'m done for. FInish me off, $N. Do it or they\'ll kill us both. $N...Remember Elwynn. This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_6'), +(-1609073,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Teldrassil, our beloved home. This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_7'), +(-1609074,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... For the Horde! This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_8'), +(-1609075,'There... There\'s no more time for me. I\'m done for. Finish me off, $N. Do it or they\'ll kill us both. $N... Remember Mulgore. This world is worth saving.',0,0,0,18,'special_surprise SAY_EXEC_TIME_9'), +(-1609076,'Der... Der\'s no more time for me. I be done for. Finish me off $N. Do it or they\'ll kill us both. $N... Remember Sen\'jin Village, mon! Dis world be worth saving!',0,0,0,18,'special_surprise SAY_EXEC_TIME_10'), + +(-1609077,'Do it, $N! Put me out of my misery!',0,0,0,1,'special_surprise SAY_EXEC_WAITING'), +(-1609078,'%s dies from his wounds.',0,2,0,0,'special_surprise EMOTE_DIES'), + +(-1609079,'I\'ll need to get my runeblade and armor... Just need a little more time.',0,0,0,399,'koltira SAY_BREAKOUT1'), +(-1609080,'I\'m still weak, but I think I can get an anti-magic barrier up. Stay inside it or you\'ll be destroyed by their spells.',0,0,0,0,'koltira SAY_BREAKOUT2'), +(-1609081,'Maintaining this barrier will require all of my concentration. Kill them all!',0,0,0,16,'koltira SAY_BREAKOUT3'), +(-1609082,'There are more coming. Defend yourself! Don\'t fall out of the anti-magic field! They\'ll tear you apart without its protection!',0,0,0,0,'koltira SAY_BREAKOUT4'), +(-1609083,'I can\'t keep barrier up much longer... Where is that coward?',0,0,0,0,'koltira SAY_BREAKOUT5'), +(-1609084,'The High Inquisitor comes! Be ready, death knight! Do not let him draw you out of the protective bounds of my anti-magic field! Kill him and take his head!',0,0,0,0,'koltira SAY_BREAKOUT6'), +(-1609085,'Stay in the anti-magic field! Make them come to you!',0,0,0,0,'koltira SAY_BREAKOUT7'), +(-1609086,'The death of the High Inquisitor of New Avalon will not go unnoticed. You need to get out of here at once! Go, before more of them show up. I\'ll be fine on my own.',0,0,0,0,'koltira SAY_BREAKOUT8'), +(-1609087,'I\'ll draw their fire, you make your escape behind me.',0,0,0,0,'koltira SAY_BREAKOUT9'), +(-1609088,'Your High Inquisitor is nothing more than a pile of meat, Crusaders! There are none beyond the grasp of the Scourge!',0,1,0,0,'koltira SAY_BREAKOUT10'); + +-- -1 615 000 OBSIDIAN SANCTUM +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1615000,'I fear nothing! Least of all you!',14111,1,0,0,'shadron SAY_SHADRON_AGGRO'), +(-1615001,'You are insignificant!',14112,1,0,0,'shadron SAY_SHADRON_SLAY_1'), +(-1615002,'Such mediocre resistance!',14113,1,0,0,'shadron SAY_SHADRON_SLAY_2'), +(-1615003,'We...are superior! How could this...be...',14118,1,0,0,'shadron SAY_SHADRON_DEATH'), +(-1615004,'You are easily bested! ',14114,1,0,0,'shadron SAY_SHADRON_BREATH'), +(-1615005,'I will take pity on you Sartharion, just this once.',14117,1,0,0,'shadron SAY_SHADRON_RESPOND'), +(-1615006,'Father tought me well!',14115,1,0,0,'shadron SAY_SHADRON_SPECIAL_1'), +(-1615007,'On your knees!',14116,1,0,0,'shadron SAY_SHADRON_SPECIAL_2'), +(-1615008,'A Shadron Disciple appears in the Twilight!',0,5,0,0,'shadron WHISPER_SHADRON_DICIPLE'), + +(-1615009,'You have no place here. Your place is among the departed.',14122,1,0,0,'tenebron SAY_TENEBRON_AGGRO'), +(-1615010,'No contest.',14123,1,0,0,'tenebron SAY_TENEBRON_SLAY_1'), +(-1615011,'Typical... Just as I was having fun.',14124,1,0,0,'tenebron SAY_TENEBRON_SLAY_2'), +(-1615012,'I should not... have held back...', 14129,1,0,0,'tenebron SAY_TENEBRON_DEATH'), +(-1615013,'To darkness I condemn you...',14125,1,0,0,'tenebron SAY_TENEBRON_BREATH'), +(-1615014,'It is amusing to watch you struggle. Very well, witness how it is done.',14128,1,0,0,'tenebron SAY_TENEBRON_RESPOND'), +(-1615015,'Arrogant little creatures! To challenge powers you do not yet understand...',14126,1,0,0,'tenebron SAY_TENEBRON_SPECIAL_1'), +(-1615016,'I am no mere dragon! You will find I am much, much, more...',14127,1,0,0,'tenebron SAY_TENEBRON_SPECIAL_2'), +(-1615017,'%s begins to hatch eggs in the twilight!',0,5,0,0,'tenebron WHISPER_HATCH_EGGS'), + +(-1615018,'It is my charge to watch over these eggs. I will see you burn before any harm comes to them!',14093,1,0,0,'sartharion SAY_SARTHARION_AGGRO'), +(-1615019,'This pathetic siege ends NOW!',14103,1,0,0,'sartharion SAY_SARTHARION_BERSERK'), +(-1615020,'Burn, you miserable wretches!',14098, 1,0,0,'sartharion SAY_SARTHARION_BREATH'), +(-1615021,'Shadron! Come to me, all is at risk!',14105,1,0,0,'sartharion SARTHARION_CALL_SHADRON'), +(-1615022,'Tenebron! The eggs are yours to protect as well!',14106,1,0,0,'sartharion SAY_SARTHARION_CALL_TENEBRON'), +(-1615023,'Vesperon! The clutch is in danger! Assist me!',14104,1,0,0,'sartharion SAY_SARTHARION_CALL_VESPERON'), +(-1615024,'Such is the price... of failure...',14107,1,0,0,'sartharion SAY_SARTHARION_DEATH'), +(-1615025,'Such flammable little insects....',14099,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_1'), +(-1615026,'Your charred bones will litter the floor!',14100,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_2'), +(-1615027,'How much heat can you take?',14101,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_3'), +(-1615028,'All will be reduced to ash!',14102,1,0,0,'sartharion SAY_SARTHARION_SPECIAL_4'), +(-1615029,'You will make a fine meal for the hatchlings.',14094,1,0,0,'sartharion SAY_SARTHARION_SLAY_1'), +(-1615030,'You are the grave disadvantage.',14096,1,0,0,'sartharion SAY_SARTHARION_SLAY_2'), +(-1615031,'This is why we call you lesser beeings.',14097,1,0,0,'sartharion SAY_SARTHARION_SLAY_3'), +(-1615032,'The lava surrounding %s churns!',0,5,0,0,'sartharion WHISPER_LAVA_CHURN'), + +(-1615033,'You pose no threat, lesser beings...give me your worst!',14133,1,0,0,'vesperon SAY_VESPERON_AGGRO'), +(-1615034,'The least you could do is put up a fight...',14134,1,0,0,'vesperon SAY_VESPERON_SLAY_1'), +(-1615035,'Was that the best you can do?',14135,1,0,0,'vesperon SAY_VESPERON_SLAY_2'), +(-1615036,'I still have some...fight..in...me...', 14140,1,0,0,'vesperon SAY_VESPERON_DEATH'), +(-1615037,'I will pick my teeth with your bones!',14136,1,0,0,'vesperon SAY_VESPERON_BREATH'), +(-1615038,'Father was right about you, Sartharion...You are a weakling!',14139,1,0,0,'vesperon SAY_VESPERON_RESPOND'), +(-1615039,'Aren\'t you tricky...I have a few tricks of my own...',14137,1,0,0,'vesperon SAY_VESPERON_SPECIAL_1'), +(-1615040,'Unlike, I have many talents.',14138,1,0,0,'vesperon SAY_VESPERON_SPECIAL_2'), +(-1615041,'A Vesperon Disciple appears in the Twilight!',0,5,0,0,'shadron WHISPER_VESPERON_DICIPLE'), + +(-1615042,'%s begins to open a Twilight Portal!',0,5,0,0,'sartharion drake WHISPER_OPEN_PORTAL'); + +-- -1 616 000 EYE OF ETERNITY + +-- -1 619 000 AHN'KAHET +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1619000,'The secrets of the deep shall remain hidden.',14033,1,0,0,'nadox SAY_AGGRO'), +(-1619001,'The young must not grow hungry...',14034,1,0,0,'nadox SAY_SUMMON_EGG_1'), +(-1619002,'Shhhad ak kereeesshh chak-k-k!',14035,1,0,0,'nadox SAY_SUMMON_EGG_2'), +(-1619003,'Sleep now, in the cold dark.',14036,1,0,0,'nadox SAY_SLAY_1'), +(-1619004,'For the Lich King!',14037,1,0,0,'nadox SAY_SLAY_2'), +(-1619005,'Perhaps we will be allies soon.',14038,1,0,0,'nadox SAY_SLAY_3'), +(-1619006,'Master, is my service complete?',14039,1,0,0,'nadox SAY_DEATH'), +(-1619007,'An Ahn\'kahar Guardian hatches!',0,3,0,0,'nadox EMOTE_HATCH'), + +(-1619008,'I will feast on your remains.',14360,1,0,0,'taldaram SAY_AGGRO'), +(-1619009,'Your heartbeat is music to my ears.',14361,1,0,0,'taldaram SAY_VANISH_1'), +(-1619010,'I am nowhere. I am everywhere. I am the watcher, unseen.',14362,1,0,0,'taldaram SAY_VANISH_2'), +(-1619011,'So appetizing.',14363,1,0,0,'taldaram SAY_FEED_1'), +(-1619012,'Fresh, warm blood. It has been too long.',14364,1,0,0,'taldaram SAY_FEED_2'), +(-1619013,'Bin-dor\'el',14365,1,0,0,'taldaram SAY_SLAY_1'), +(-1619014,'I will drink no blood before it\'s time.',14366,1,0,0,'taldaram SAY_SLAY_2'), +(-1619015,'One final embrace.',14367,1,0,0,'taldaram SAY_SLAY_3'), +(-1619016,'Still I hunger, still I thirst.',14368,1,0,0,'taldaram SAY_DEATH'), + +(-1619017,'These are sacred halls! Your intrusion will be met with death.',14343,1,0,0,'jedoga SAY_AGGRO'), +(-1619018,'Who among you is devoted?',14344,1,0,0,'jedoga SAY_CALL_SACRIFICE_1'), +(-1619019,'You there! Step forward!',14345,1,0,0,'jedoga SAY_CALL_SACRIFICE_2'), +(-1619020,'Yogg-Saron, grant me your power!',14346,1,0,0,'jedoga SAY_SACRIFICE_1'), +(-1619021,'Master, a gift for you!',14347,1,0,0,'jedoga SAY_SACRIFICE_2'), +(-1619022,'Glory to Yogg-Saron!',14348,1,0,0,'jedoga SAY_SLAY_1'), +(-1619023,'You are unworthy!',14349,1,0,0,'jedoga SAY_SLAY_2'), +(-1619024,'Get up! You haven\'t suffered enough.',14350,1,0,0,'jedoga SAY_SLAY_3'), +(-1619025,'Do not expect your sacrilege... to go unpunished.',14351,1,0,0,'jedoga SAY_DEATH'), +(-1619026,'The elements themselves will rise up against the civilized world! Only the faithful will be spared!',14352,1,0,0,'jedoga SAY_PREACHING_1'), +(-1619027,'Immortality can be yours. But only if you pledge yourself fully to Yogg-Saron!',14353,1,0,0,'jedoga SAY_PREACHING_2'), +(-1619028,'Here on the very borders of his domain. You will experience powers you would never have imagined! ',14354,1,0,0,'jedoga SAY_PREACHING_3'), +(-1619029,'You have traveled long and risked much to be here. Your devotion shall be rewarded.',14355,1,0,0,'jedoga SAY_PREACHING_4'), +(-1619030,'The faithful shall be exalted! But there is more work to be done. We will press on until all of Azeroth lies beneath his shadow!',14356,1,0,0,'jedoga SAY_PREACHING_5'), +(-1619031,'I have been chosen!',0,1,0,0,'jedoga SAY_VOLUNTEER_1'), +(-1619032,'I give myself to the master!',0,1,0,0,'jedoga SAY_VOLUNTEER_2'), + +(-1619033,'Shgla\'yos plahf mh\'naus.',14043,1,0,0,'volazj SAY_AGGRO'), +(-1619034,' ',14044,1,0,0,'volazj SAY_INSANITY'), +(-1619035,' ',14045,1,0,0,'volazj SAY_SLAY_1'), +(-1619036,' ',14046,1,0,0,'volazj SAY_SLAY_2'), +(-1619037,' ',14047,1,0,0,'volazj SAY_SLAY_3'), +(-1619038,' ',14048,1,0,0,'volazj SAY_DEATH_1'), +(-1619039,' ',14049,1,0,0,'volazj SAY_DEATH_2'); + +-- -1 632 000 ICC: FORGE OF SOULS +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1632000,'More souls to power the engine!',0,1,0,0,'boss_bronjahm SAY_AGGRO_1'), +(-1632001,'Finally...a captive audience!',16595,1,0,0,'boss_bronjahm SAY_AGGRO_2'), +(-1632002,'Fodder for the engine!',16596,1,0,0,'boss_bronjahm SAY_SLAY_1'), +(-1632003,'Another soul to strengthen the host!',16597,1,0,0,'boss_bronjahm SAY_SLAY_2'), +(-1632004,'My soul for you, master.',16598,1,0,0,'boss_bronjahm SAY_DEATH'), +(-1632005,'The vortex of the harvested calls to you!',16599,1,0,0,'boss_bronjahm SAY_SOULSTORM'), +(-1632006,'I will sever the soul from your body!',16600,1,0,0,'boss_bronjahm SAY_CORRUPT_SOUL'), + +(-1632007,'You dare look upon the host of souls?! I SHALL DEVOUR YOU WHOLE!',16884,1,0,0,'boss_devourer SAY_MALE_1_AGGRO'), +(-1632008,'You dare look upon the host of souls?! I SHALL DEVOUR YOU WHOLE!',16890,1,0,0,'boss_devourer SAY_FEMALE_AGGRO'), +(-1632009,'Damnation!',16885,1,0,0,'boss_devourer SAY_MALE_1_SLAY_1'), +(-1632010,'Damnation!',16891,1,0,0,'boss_devourer SAY_FEMALE_SLAY_1'), +(-1632011,'Damnation!',16896,1,0,0,'boss_devourer SAY_MALE_2_SLAY_1'), +(-1632012,'Doomed for eternity!',16886,1,0,0,'boss_devourer SAY_MALE_1_SLAY_2'), +(-1632013,'Doomed for eternity!',16892,1,0,0,'boss_devourer SAY_FEMALE_SLAY_2'), +(-1632014,'Doomed for eternity!',16897,1,0,0,'boss_devourer SAY_MALE_2_SLAY_2'), +(-1632015,'The swell of souls will not be abated! You only delay the inevitable!',16887,1,0,0,'boss_devourer SAY_MALE_1_DEATH'), +(-1632016,'The swell of souls will not be abated! You only delay the inevitable!',16893,1,0,0,'boss_devourer SAY_FEMALE_DEATH'), +(-1632017,'The swell of souls will not be abated! You only delay the inevitable!',16898,1,0,0,'boss_devourer SAY_MALE_2_DEATH'), +(-1632018,'SUFFERING! ANGUISH! CHAOS! RISE AND FEED!',16888,1,0,0,'boss_devourer SAY_MALE_1_SOUL_ATTACK'), +(-1632019,'SUFFERING! ANGUISH! CHAOS! RISE AND FEED!',16894,1,0,0,'boss_devourer SAY_FEMALE_SOUL_ATTACK'), +(-1632020,'SUFFERING! ANGUISH! CHAOS! RISE AND FEED!',16899,1,0,0,'boss_devourer SAY_MALE_2_SOUL_ATTACK'), +(-1632021,'Stare into the abyss, and see your end!',16889,1,0,0,'boss_devourer SAY_MALE_1_DARK_GLARE'), +(-1632022,'Stare into the abyss, and see your end!',16895,1,0,0,'boss_devourer SAY_FEMALE_DARK_GLARE'), +(-1632023,'%s begins to cast Mirrored Soul!',0,3,0,0,'boss_devourer EMOTE_MIRRORED_SOUL'), +(-1632024,'%s begins to Unleash Souls!',0,3,0,0,'boss_devourer EMOTE_UNLEASH_SOULS'), +(-1632025,'%s begins to cast Wailing Souls!',0,3,0,0,'boss_devourer EMOTE_WAILING_SOULS'); + +-- -1 999 900 EXAMPLE TEXT +INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES +(-1999900,'Let the games begin.',8280,1,0,0,'example_creature SAY_AGGRO'), +(-1999901,'I see endless suffering. I see torment. I see rage. I see everything.',8831,1,0,0,'example_creature SAY_RANDOM_0'), +(-1999902,'Muahahahaha',8818,1,0,0,'example_creature SAY_RANDOM_1'), +(-1999903,'These mortal infedels my lord, they have invaded your sanctum and seek to steal your secrets.',8041,1,0,0,'example_creature SAY_RANDOM_2'), +(-1999904,'You are already dead.',8581,1,0,0,'example_creature SAY_RANDOM_3'), +(-1999905,'Where to go? What to do? So many choices that all end in pain, end in death.',8791,1,0,0,'example_creature SAY_RANDOM_4'), +(-1999906,'$N, I sentance you to death!',8588,1,0,0,'example_creature SAY_BESERK'), +(-1999907,'The suffering has just begun!',0,1,0,0,'example_creature SAY_PHASE'), +(-1999908,'I always thought I was a good dancer.',0,0,0,0,'example_creature SAY_DANCE'), +(-1999909,'Move out Soldier!',0,0,0,0,'example_creature SAY_SALUTE'), + +(-1999910,'Help $N! I\'m under attack!',0,0,0,0,'example_escort SAY_AGGRO1'), +(-1999911,'Die scum!',0,0,0,0,'example_escort SAY_AGGRO2'), +(-1999912,'Hmm a nice day for a walk alright',0,0,0,0,'example_escort SAY_WP_1'), +(-1999913,'Wild Felboar attack!',0,0,0,0,'example_escort SAY_WP_2'), +(-1999914,'Time for me to go! See ya around $N!',0,0,0,3,'example_escort SAY_WP_3'), +(-1999915,'Bye Bye!',0,0,0,3,'example_escort SAY_WP_4'), +(-1999916,'How dare you leave me like that! I hate you! =*(',0,3,0,0,'example_escort SAY_DEATH_1'), +(-1999917,'...no...how could you let me die $N',0,0,0,0,'example_escort SAY_DEATH_2'), +(-1999918,'ugh...',0,0,0,0,'example_escort SAY_DEATH_3'), +(-1999919,'Taste death!',0,0,0,0,'example_escort SAY_SPELL'), +(-1999920,'Fireworks!',0,0,0,0,'example_escort SAY_RAND_1'), +(-1999921,'Hmm, I think I could use a buff.',0,0,0,0,'example_escort SAY_RAND_2'), + +(-1999922,'Normal select, guess you\'re not interested.',0,0,0,0,'example_gossip_codebox SAY_NOT_INTERESTED'), +(-1999923,'Wrong!',0,0,0,0,'example_gossip_codebox SAY_WRONG'), +(-1999924,'You\'re right, you are allowed to see my inner secrets.',0,0,0,0,'example_gossip_codebox SAY_CORRECT'), + +(-1999925,'Hi!',0,0,0,0,'example_areatrigger SAY_HI'); + +-- +-- GOSSIP TEXTS +-- + +-- +-- Below contains data for table `gossip_texts` +-- valid entries for table are between -3000000 and -3999999 +-- + +TRUNCATE gossip_texts; + +-- -3 000 000 RESERVED (up to 100) +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3000000,'[PH] SD2 unknown text','GOSSIP_ID_UNKNOWN_TEXT'); + +-- -3 090 000 GNOMEREGAN +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3090000,'I am ready to begin.','emi shortfuse GOSSIP_ITEM_START'); + +-- -3 560 000 ESCAPE FROM DURNHOLDE (OLD HILLSBRAD) +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3560000,'I am ready to go to Durnholde Keep.','brazen GOSSIP_ITEM_READY'), +(-3560001,'I need a pack of Incendiary Bombs.','erozion GOSSIP_ITEM_NEED_BOMBS'), +(-3560002,'Taretha cannot see you, Thrall.','thrall GOSSIP_ITEM_SKARLOC1'), +(-3560003,'The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore\'s men show up. We\'ll make sure Taretha is safe.','thrall GOSSIP_ITEM_SKARLOC2'), +(-3560004,'We\'re ready, Thrall.','thrall GOSSIP_ITEM_TARREN'), +(-3560005,'Strange wizard?','taretha GOSSIP_ITEM_EPOCH1'), +(-3560006,'We\'ll get you out. Taretha. Don\'t worry. I doubt the wizard would wander too far away.','taretha GOSSIP_ITEM_EPOCH2'); + +-- -3 595 000 CULLING OF STRATHOLME +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3595000,'What do you think they\'re up to?','chromie GOSSIP_ITEM_ENTRANCE_1'), +(-3595001,'You want me to do what?','chromie GOSSIP_ITEM_ENTRANCE_2'), +(-3595002,'Very well, Chromie.','chromie GOSSIP_ITEM_ENTRANCE_3'), +(-3595003,'Why have I been sent back to this particular place and time?','chromie GOSSIP_ITEM_INN_1'), +(-3595004,'What was this decision?','chromie GOSSIP_ITEM_INN_2'), +(-3595005,'So how does the Infinite Dragonflight plan to interfere?','chromie GOSSIP_ITEM_INN_3'); + +-- -3 603 000 ULDUAR +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3603000,'Teleport to the Expedition Base Camp.','GOSSIP_ITEM_TELE_BASE_CAMP'), +(-3603001,'Teleport to the Formation Grounds.','GOSSIP_ITEM_TELE_FORMATION_GROUNDS'), +(-3603002,'Teleport to the Colossal Forge.','GOSSIP_ITEM_TELE_COLOSSAR_FORGE'), +(-3603003,'Teleport to the Scrapyard.','GOSSIP_ITEM_TELE_SCRAPYARD'), +(-3603004,'Teleport to the Antechamber of Ulduar.','GOSSIP_ITEM_TELE_ANTECHAMBER'), +(-3603005,'Teleport to the Shattered Walkway.','GOSSIP_ITEM_TELE_WALKWAY'), +(-3603006,'Teleport to the Conservatory of Life.','GOSSIP_ITEM_TELE_CONSERVATORY'), +(-3603007,'Teleport to the Spark of Imagination.','GOSSIP_ITEM_TELE_SPARK_IMAGINATION'), +(-3603008,'Teleport to the Prison of Yogg-Saron.','GOSSIP_ITEM_TELE_YOGG_SARON'); + +-- -3 608 000 VIOLET HOLD +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3608000,'Activate the crystals when we get in trouble, right?','sinclari GOSSIP_ITEM_INTRO'), +(-3608001,'Get your people to safety, we\'ll keep the Blue Dragonflight\'s forces at bay.','sinclari GOSSIP_ITEM_START'); + +-- -3 649 000 TRIAL OF CRUSADER +INSERT INTO gossip_texts (entry,content_default,comment) VALUES +(-3649000,'Yes. We are prepared for the challenges ahead of us.','barrett GOSSIP_ITEM_START_EVENT1'); + +-- +-- Below just for beautiful view in table, run at own desire +-- + +-- ALTER TABLE script_texts ORDER BY entry desc; +-- ALTER TABLE gossip_texts ORDER BY entry desc; + +-- +-- Below contains all waypoints used by escortAI scripts +-- Entry is entry == creature_template.entry +-- + +DELETE FROM script_waypoint WHERE entry=467; +INSERT INTO script_waypoint VALUES +(467, 0, -10508.40, 1068.00, 55.21, 0, ''), +(467, 1, -10518.30, 1074.84, 53.96, 0, ''), +(467, 2, -10534.82, 1081.92, 49.88, 0, ''), +(467, 3, -10546.51, 1084.88, 50.13, 0, ''), +(467, 4, -10555.29, 1084.45, 45.75, 0, ''), +(467, 5, -10566.57, 1083.53, 42.10, 0, ''), +(467, 6, -10575.83, 1082.34, 39.46, 0, ''), +(467, 7, -10585.67, 1081.08, 37.77, 0, ''), +(467, 8, -10600.08, 1078.19, 36.23, 0, ''), +(467, 9, -10608.69, 1076.08, 35.88, 0, ''), +(467, 10, -10621.26, 1073.00, 35.40, 0, ''), +(467, 11, -10638.12, 1060.18, 33.61, 0, ''), +(467, 12, -10655.87, 1038.99, 33.48, 0, ''), +(467, 13, -10664.68, 1030.54, 32.70, 0, ''), +(467, 14, -10708.68, 1033.86, 33.32, 0, ''), +(467, 15, -10754.43, 1017.93, 32.79, 0, ''), +(467, 16, -10802.26, 1018.01, 32.16, 0, ''), +(467, 17, -10832.60, 1009.04, 32.71, 0, ''), +(467, 18, -10866.56, 1006.51, 31.71, 0, ''), +(467, 19, -10879.98, 1005.10, 32.84, 0, ''), +(467, 20, -10892.45, 1001.32, 34.46, 0, ''), +(467, 21, -10906.14, 997.11, 36.15, 0, ''), +(467, 22, -10922.26, 1002.23, 35.74, 0, ''), +(467, 23, -10936.32, 1023.38, 36.52, 0, ''), +(467, 24, -10933.35, 1052.61, 35.85, 0, ''), +(467, 25, -10940.25, 1077.66, 36.49, 0, ''), +(467, 26, -10957.09, 1099.33, 36.83, 0, ''), +(467, 27, -10956.53, 1119.90, 36.73, 0, ''), +(467, 28, -10939.30, 1150.75, 37.42, 0, ''), +(467, 29, -10915.14, 1202.09, 36.55, 0, ''), +(467, 30, -10892.59, 1257.03, 33.37, 0, ''), +(467, 31, -10891.93, 1306.66, 35.45, 0, ''), +(467, 32, -10896.17, 1327.86, 37.77, 0, ''), +(467, 33, -10906.03, 1368.05, 40.91, 0, ''), +(467, 34, -10910.18, 1389.33, 42.62, 0, ''), +(467, 35, -10915.42, 1417.72, 42.93, 0, ''), +(467, 36, -10926.37, 1421.18, 43.04, 0, 'walk here and say'), +(467, 37, -10952.31, 1421.74, 43.40, 0, ''), +(467, 38, -10980.04, 1411.38, 42.79, 0, ''), +(467, 39, -11006.06, 1420.47, 43.26, 0, ''), +(467, 40, -11021.98, 1450.59, 43.09, 0, ''), +(467, 41, -11025.36, 1491.59, 43.15, 0, ''), +(467, 42, -11036.09, 1508.32, 43.28, 0, ''), +(467, 43, -11060.68, 1526.72, 43.19, 0, ''), +(467, 44, -11072.75, 1527.77, 43.20, 5000, 'say and quest credit'); + +DELETE FROM script_waypoint WHERE entry=1978; +INSERT INTO script_waypoint VALUES +(1978, 0, 1406.32, 1083.10, 52.55, 0, ''), +(1978, 1, 1400.49, 1080.42, 52.50, 0, 'SAY_START_2'), +(1978, 2, 1388.48, 1083.10, 52.52, 0, ''), +(1978, 3, 1370.16, 1084.02, 52.30, 0, ''), +(1978, 4, 1359.02, 1080.85, 52.46, 0, ''), +(1978, 5, 1341.43, 1087.39, 52.69, 0, ''), +(1978, 6, 1321.93, 1090.51, 50.66, 0, ''), +(1978, 7, 1312.98, 1095.91, 47.49, 0, ''), +(1978, 8, 1301.09, 1102.94, 47.76, 0, ''), +(1978, 9, 1297.73, 1106.35, 50.18, 0, ''), +(1978, 10, 1295.49, 1124.32, 50.49, 0, ''), +(1978, 11, 1294.84, 1137.25, 51.75, 0, ''), +(1978, 12, 1292.89, 1158.99, 52.65, 0, ''), +(1978, 13, 1290.75, 1168.67, 52.56, 2000, 'quest complete SAY_END'), +(1978, 14, 1287.12, 1203.49, 52.66, 5000, 'SAY_RANE'), +(1978, 15, 1288.30, 1203.89, 52.68, 5000, 'SAY_RANE_REPLY'), +(1978, 16, 1288.30, 1203.89, 52.68, 5000, 'SAY_CHECK_NEXT'), +(1978, 17, 1290.72, 1207.44, 52.69, 0, ''), +(1978, 18, 1297.50, 1207.18, 53.74, 0, ''), +(1978, 19, 1301.32, 1220.90, 53.74, 0, ''), +(1978, 20, 1298.55, 1220.43, 53.74, 0, ''), +(1978, 21, 1297.38, 1212.87, 58.51, 0, ''), +(1978, 22, 1297.80, 1210.04, 58.51, 0, ''), +(1978, 23, 1305.01, 1206.10, 58.51, 0, ''), +(1978, 24, 1310.51, 1207.36, 58.51, 5000, 'SAY_QUINN'), +(1978, 25, 1312.59, 1207.21, 58.51, 5000, 'SAY_QUINN_REPLY'), +(1978, 26, 1312.59, 1207.21, 58.51, 30000, 'SAY_BYE'); + +DELETE FROM script_waypoint WHERE entry=2768; +INSERT INTO script_waypoint VALUES +(2768, 0, -2077.73, -2091.17, 9.49, 0, ''), +(2768, 1, -2077.99, -2105.33, 13.24, 0, ''), +(2768, 2, -2074.60, -2109.67, 14.24, 0, ''), +(2768, 3, -2076.60, -2117.46, 16.67, 0, ''), +(2768, 4, -2073.51, -2123.46, 18.42, 2000, ''), +(2768, 5, -2073.51, -2123.46, 18.42, 4000, ''), +(2768, 6, -2066.60, -2131.85, 21.56, 0, ''), +(2768, 7, -2053.85, -2143.19, 20.31, 0, ''), +(2768, 8, -2043.49, -2153.73, 20.20, 10000, ''), +(2768, 9, -2043.49, -2153.73, 20.20, 20000, ''), +(2768, 10, -2043.49, -2153.73, 20.20, 10000, ''), +(2768, 11, -2043.49, -2153.73, 20.20, 2000, ''), +(2768, 12, -2053.85, -2143.19, 20.31, 0, ''), +(2768, 13, -2066.60, -2131.85, 21.56, 0, ''), +(2768, 14, -2073.51, -2123.46, 18.42, 0, ''), +(2768, 15, -2076.60, -2117.46, 16.67, 0, ''), +(2768, 16, -2074.60, -2109.67, 14.24, 0, ''), +(2768, 17, -2077.99, -2105.33, 13.24, 0, ''), +(2768, 18, -2077.73, -2091.17, 9.49, 0, ''), +(2768, 19, -2066.41, -2086.21, 8.97, 6000, ''), +(2768, 20, -2066.41, -2086.21, 8.97, 2000, ''); + +DELETE FROM script_waypoint WHERE entry=2917; +INSERT INTO script_waypoint VALUES +(2917, 0, 4675.812500, 598.614563, 17.645658, 0, 'SAY_REM_START'), +(2917, 1, 4672.844238, 599.325378, 16.417622, 0, ''), +(2917, 2, 4663.449707, 607.430176, 10.494752, 0, ''), +(2917, 3, 4655.969238, 613.761353, 8.523270, 0, ''), +(2917, 4, 4640.804688, 623.999329, 8.377054, 0, ''), +(2917, 5, 4631.678711, 630.801086, 6.414999, 5000, 'SAY_REM_RAMP1_1'), +(2917, 6, 4633.533203, 632.476440, 6.509831, 0, 'ambush'), +(2917, 7, 4639.413574, 637.120789, 13.338119, 0, ''), +(2917, 8, 4642.352051, 637.668152, 13.437444, 0, ''), +(2917, 9, 4645.082031, 634.463989, 13.437208, 5000, 'SAY_REM_RAMP1_2'), +(2917, 10, 4642.345215, 637.584839, 13.435211, 0, ''), +(2917, 11, 4639.630859, 637.233765, 13.339752, 0, ''), +(2917, 12, 4633.363281, 632.462280, 6.488438, 0, ''), +(2917, 13, 4624.714844, 631.723511, 6.264030, 0, ''), +(2917, 14, 4623.525879, 629.718506, 6.201339, 5000, 'SAY_REM_BOOK'), +(2917, 15, 4623.452148, 630.369629, 6.218942, 0, 'SAY_REM_TENT1_1'), +(2917, 16, 4622.622070, 637.221558, 6.312845, 0, 'ambush'), +(2917, 17, 4619.755371, 637.386230, 6.312050, 5000, 'SAY_REM_TENT1_2'), +(2917, 18, 4620.027832, 637.367676, 6.312050, 0, ''), +(2917, 19, 4624.154785, 637.560303, 6.313898, 0, ''), +(2917, 20, 4622.967773, 634.016479, 6.294979, 0, ''), +(2917, 21, 4616.926758, 630.303284, 6.239193, 0, ''), +(2917, 22, 4614.546387, 616.983337, 5.687642, 0, ''), +(2917, 23, 4610.279297, 610.029419, 5.442539, 0, ''), +(2917, 24, 4601.149902, 604.111694, 2.054856, 0, ''), +(2917, 25, 4589.618164, 597.685730, 1.057147, 0, ''), +(2917, 26, 4577.588379, 592.145813, 1.120190, 0, 'SAY_REM_MOSS (?)'), +(2917, 27, 4569.848145, 592.177490, 1.260874, 5000, 'EMOTE_REM_MOSS (?)'), +(2917, 28, 4568.791992, 590.870911, 1.211338, 3000, 'SAY_REM_MOSS_PROGRESS (?)'), +(2917, 29, 4566.722656, 564.077881, 1.343084, 0, 'ambush'), +(2917, 30, 4568.269531, 551.958435, 5.004200, 0, ''), +(2917, 31, 4566.731934, 551.557861, 5.426314, 5000, 'SAY_REM_PROGRESS'), +(2917, 32, 4566.741699, 560.767639, 1.703257, 0, ''), +(2917, 33, 4573.916016, 582.566101, 0.749801, 0, ''), +(2917, 34, 4594.206055, 598.533020, 1.034056, 0, ''), +(2917, 35, 4601.194824, 604.283081, 2.060146, 0, ''), +(2917, 36, 4609.539551, 610.844727, 5.402220, 0, ''), +(2917, 37, 4624.800293, 618.076477, 5.851541, 0, ''), +(2917, 38, 4632.414063, 623.778442, 7.286243, 0, ''), +(2917, 39, 4645.915039, 621.983765, 8.579967, 0, ''), +(2917, 40, 4658.669922, 611.092651, 8.891747, 0, ''), +(2917, 41, 4671.924316, 599.752197, 16.01242, 5000, 'SAY_REM_REMEMBER'), +(2917, 42, 4676.976074, 600.649780, 17.82566, 5000, 'EMOTE_REM_END'); + +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1105.090332, -3101.254150, 82.706, 1000, 'SAY_STARTUP1'), +(3439, 1, 1103.204468, -3104.345215, 83.113, 1000, ''), +(3439, 2, 1107.815186, -3106.495361, 82.739, 1000, ''), +(3439, 3, 1104.733276, -3100.830811, 82.747, 1000, ''), +(3439, 4, 1103.242554, -3106.270020, 83.133, 1000, ''), +(3439, 5, 1112.807373, -3106.285400, 82.320, 1000, ''), +(3439, 6, 1112.826782, -3108.908691, 82.377, 1000, ''), +(3439, 7, 1108.053955, -3115.156738, 82.894, 0, ''), +(3439, 8, 1108.355591, -3104.365234, 82.377, 5000, ''), +(3439, 9, 1100.306763, -3097.539063, 83.150, 0, 'SAY_STARTUP2'), +(3439, 10, 1100.562378, -3082.721924, 82.768, 0, ''), +(3439, 11, 1097.512939, -3069.226563, 82.206, 0, ''), +(3439, 12, 1092.964966, -3053.114746, 82.351, 0, ''), +(3439, 13, 1094.010986, -3036.958496, 82.888, 0, ''), +(3439, 14, 1095.623901, -3025.760254, 83.392, 0, ''), +(3439, 15, 1107.656494, -3013.530518, 85.653, 0, ''), +(3439, 16, 1119.647705, -3006.928223, 87.019, 0, ''), +(3439, 17, 1129.991211, -3002.410645, 91.232, 7000, 'SAY_MERCENARY'), +(3439, 18, 1133.328735, -2997.710693, 91.675, 1000, 'SAY_PROGRESS_1'), +(3439, 19, 1131.799316, -2987.948242, 91.976, 1000, ''), +(3439, 20, 1122.028687, -2993.397461, 91.536, 0, ''), +(3439, 21, 1116.614868, -2981.916748, 92.103, 0, ''), +(3439, 22, 1102.239136, -2994.245117, 92.074, 0, ''), +(3439, 23, 1096.366211, -2978.306885, 91.873, 0, ''), +(3439, 24, 1091.971558, -2985.919189, 91.730, 40000, 'SAY_PROGRESS_2'); + +DELETE FROM script_waypoint WHERE entry=3465; +INSERT INTO script_waypoint VALUES +(3465, 0, -2095.840820, -3650.001221, 61.716, 0, ''), +(3465, 1, -2100.193604, -3613.949219, 61.604, 0, ''), +(3465, 2, -2098.549561, -3601.557129, 59.154, 0, ''), +(3465, 3, -2093.796387, -3595.234375, 56.658, 0, ''), +(3465, 4, -2072.575928, -3578.827637, 48.844, 0, ''), +(3465, 5, -2023.858398, -3568.146240, 24.636, 0, ''), +(3465, 6, -2013.576416, -3571.499756, 22.203, 0, ''), +(3465, 7, -2009.813721, -3580.547852, 21.791, 0, ''), +(3465, 8, -2015.296021, -3597.387695, 21.760, 0, ''), +(3465, 9, -2020.677368, -3610.296143, 21.759, 0, ''), +(3465, 10, -2019.990845, -3640.155273, 21.759, 0, ''), +(3465, 11, -2016.110596, -3664.133301, 21.758, 0, ''), +(3465, 12, -1999.397095, -3679.435059, 21.316, 0, ''), +(3465, 13, -1987.455811, -3688.309326, 18.495, 0, ''), +(3465, 14, -1973.966553, -3687.666748, 14.996, 0, ''), +(3465, 15, -1949.163940, -3678.054932, 11.293, 0, ''), +(3465, 16, -1934.091187, -3682.859619, 9.897, 30000, 'SAY_GIL_AT_LAST'), +(3465, 17, -1935.383911, -3682.322021, 10.029, 1500, 'SAY_GIL_PROCEED'), +(3465, 18, -1879.039185, -3699.498047, 6.582, 7500, 'SAY_GIL_FREEBOOTERS'), +(3465, 19, -1852.728149, -3703.778809, 6.875, 0, ''), +(3465, 20, -1812.989990, -3718.500732, 10.572, 0, ''), +(3465, 21, -1788.171265, -3722.867188, 9.663, 0, ''), +(3465, 22, -1767.206665, -3739.923096, 10.082, 0, ''), +(3465, 23, -1750.194580, -3747.392090, 10.390, 0, ''), +(3465, 24, -1729.335571, -3776.665527, 11.779, 0, ''), +(3465, 25, -1715.997925, -3802.404541, 12.618, 0, ''), +(3465, 26, -1690.711548, -3829.262451, 13.905, 0, ''), +(3465, 27, -1674.700684, -3842.398682, 13.872, 0, ''), +(3465, 28, -1632.726318, -3846.109619, 14.401, 0, ''), +(3465, 29, -1592.734497, -3842.225342, 14.981, 0, ''), +(3465, 30, -1561.614746, -3839.320801, 19.118, 0, ''), +(3465, 31, -1544.567627, -3834.393311, 18.761, 0, ''), +(3465, 32, -1512.514404, -3831.715820, 22.914, 0, ''), +(3465, 33, -1486.889771, -3836.639893, 23.964, 0, ''), +(3465, 34, -1434.193604, -3852.702881, 18.843, 0, ''), +(3465, 35, -1405.794678, -3854.488037, 17.276, 0, ''), +(3465, 36, -1366.592041, -3852.383789, 19.273, 0, ''), +(3465, 37, -1337.360962, -3837.827148, 17.352, 2000, 'SAY_GIL_ALMOST'), +(3465, 38, -1299.744507, -3810.691406, 20.801, 0, ''), +(3465, 39, -1277.144409, -3782.785156, 25.918, 0, ''), +(3465, 40, -1263.686768, -3781.251953, 26.447, 0, ''), +(3465, 41, -1243.674438, -3786.328125, 25.281, 0, ''), +(3465, 42, -1221.875488, -3784.124512, 24.051, 0, ''), +(3465, 43, -1204.011230, -3775.943848, 24.437, 0, ''), +(3465, 44, -1181.706787, -3768.934082, 23.368, 0, ''), +(3465, 45, -1156.913818, -3751.559326, 21.074, 0, ''), +(3465, 46, -1138.830688, -3741.809326, 17.843, 0, ''), +(3465, 47, -1080.101196, -3738.780029, 19.805, 0, 'SAY_GIL_SWEET'), +(3465, 48, -1069.065186, -3735.006348, 19.302, 0, ''), +(3465, 49, -1061.941040, -3724.062256, 21.086, 0, ''), +(3465, 50, -1053.593262, -3697.608643, 27.320, 0, ''), +(3465, 51, -1044.110474, -3690.133301, 24.856, 0, ''), +(3465, 52, -1040.260986, -3690.739014, 25.342, 0, ''), +(3465, 53, -1028.146606, -3688.718750, 23.843, 7500, 'SAY_GIL_FREED'); + +DELETE FROM script_waypoint WHERE entry=3849; +INSERT INTO script_waypoint VALUES +(3849, 0, -250.923, 2116.26, 81.179, 0, 'SAY_FREE_AD'), +(3849, 1, -255.049, 2119.39, 81.179, 0, ''), +(3849, 2, -254.129, 2123.45, 81.179, 0, ''), +(3849, 3, -253.898, 2130.87, 81.179, 0, ''), +(3849, 4, -249.889, 2142.31, 86.972, 0, ''), +(3849, 5, -248.205, 2144.02, 87.013, 0, ''), +(3849, 6, -240.553, 2140.55, 87.012, 0, ''), +(3849, 7, -237.514, 2142.07, 87.012, 0, ''), +(3849, 8, -235.638, 2149.23, 90.587, 0, ''), +(3849, 9, -237.188, 2151.95, 90.624, 0, ''), +(3849, 10, -241.162, 2153.65, 90.624, 0, 'SAY_OPEN_DOOR_AD'), +(3849, 11, -241.13, 2154.56, 90.624, 2000, 'SAY_UNLOCK_DOOR_AD'), +(3849, 12, -241.13, 2154.56, 90.624, 3000, ''), +(3849, 13, -241.13, 2154.56, 90.624, 5000, 'SAY_POST1_DOOR_AD'), +(3849, 14, -241.13, 2154.56, 90.624, 0, 'SAY_POST2_DOOR_AD'), +(3849, 15, -208.764, 2141.6, 90.6257, 0, ''), +(3849, 16, -206.441, 2143.51, 90.4287, 0, ''), +(3849, 17, -203.715, 2145.85, 88.7052, 0, ''), +(3849, 18, -199.199, 2144.88, 86.501, 0, ''), +(3849, 19, -195.798, 2143.58, 86.501, 0, ''), +(3849, 20, -190.029, 2141.38, 83.2712, 0, ''), +(3849, 21, -189.353, 2138.65, 83.1102, 0, ''), +(3849, 22, -190.304, 2135.73, 81.5288, 0, ''), +(3849, 23, -207.325, 2112.43, 81.0548, 0, ''), +(3849, 24, -208.754, 2109.9, 81.0527, 0, ''), +(3849, 25, -206.248, 2108.62, 81.0555, 0, ''), +(3849, 26, -202.017, 2106.64, 78.6836, 0, ''), +(3849, 27, -200.928, 2104.49, 78.5569, 0, ''), +(3849, 28, -201.845, 2101.17, 76.9256, 0, ''), +(3849, 29, -202.844, 2100.11, 76.8911, 0, ''), +(3849, 30, -213.326, 2105.83, 76.8925, 0, ''), +(3849, 31, -226.993, 2111.47, 76.8892, 0, ''), +(3849, 32, -227.955, 2112.34, 76.8895, 0, ''), +(3849, 33, -230.05, 2106.64, 76.8895, 0, ''); + +DELETE FROM script_waypoint WHERE entry=3850; +INSERT INTO script_waypoint VALUES +(3850, 0, -241.817, 2122.9, 81.179, 0, 'SAY_FREE_AS'), +(3850, 1, -247.139, 2124.89, 81.179, 0, ''), +(3850, 2, -253.179, 2127.41, 81.179, 0, ''), +(3850, 3, -253.898, 2130.87, 81.179, 0, ''), +(3850, 4, -249.889, 2142.31, 86.972, 0, ''), +(3850, 5, -248.205, 2144.02, 87.013, 0, ''), +(3850, 6, -240.553, 2140.55, 87.012, 0, ''), +(3850, 7, -237.514, 2142.07, 87.012, 0, ''), +(3850, 8, -235.638, 2149.23, 90.587, 0, ''), +(3850, 9, -237.188, 2151.95, 90.624, 0, ''), +(3850, 10, -241.162, 2153.65, 90.624, 0, 'SAY_OPEN_DOOR_AS'), +(3850, 11, -241.13, 2154.56, 90.624, 5000, 'cast'), +(3850, 12, -241.13, 2154.56, 90.624, 0, ''), +(3850, 13, -241.13, 2154.56, 90.624, 5000, 'SAY_POST_DOOR_AS'), +(3850, 14, -241.13, 2154.56, 90.624, 2500, 'cast'), +(3850, 15, -241.13, 2154.56, 90.624, 0, 'SAY_VANISH_AS'); + +DELETE FROM script_waypoint WHERE entry=4500; +INSERT INTO script_waypoint VALUES +(4500, 0, -3125.597168, -2885.673828, 34.731, 2500, ''), +(4500, 1, -3120.257080, -2877.830322, 34.917, 0, ''), +(4500, 2, -3116.487305, -2850.670410, 34.869, 0, ''), +(4500, 3, -3093.474854, -2819.189697, 34.432, 0, ''), +(4500, 4, -3104.726318, -2802.020996, 33.954, 0, ''), +(4500, 5, -3105.906006, -2780.234375, 34.469, 0, ''), +(4500, 6, -3116.080811, -2757.902588, 34.734, 0, ''), +(4500, 7, -3125.234375, -2733.960205, 33.189, 0, ''); + +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); + +DELETE FROM script_waypoint WHERE entry=4983; +INSERT INTO script_waypoint VALUES +(4983, 0, -3322.649414, -3124.631836, 33.842, 0, ''), +(4983, 1, -3326.336670, -3126.833496, 34.426, 0, ''), +(4983, 2, -3336.984131, -3129.611816, 30.692, 0, ''), +(4983, 3, -3342.598389, -3132.146729, 30.422, 0, ''), +(4983, 4, -3355.827881, -3140.947998, 29.534, 0, ''), +(4983, 5, -3365.828125, -3144.284180, 35.176, 0, ''), +(4983, 6, -3368.904541, -3147.265381, 36.091, 0, ''), +(4983, 7, -3369.355957, -3169.828857, 36.325, 0, ''), +(4983, 8, -3371.443359, -3183.905029, 33.454, 0, ''), +(4983, 9, -3373.824951, -3190.861084, 34.717, 5000, 'SAY_OGR_SPOT'), +(4983, 10, -3368.529785, -3198.210205, 34.926, 0, 'SAY_OGR_RET_WHAT'), +(4983, 11, -3366.265625, -3210.867676, 33.733, 5000, 'pause'), +(4983, 12, -3368.529785, -3198.210205, 34.926, 0, ''), +(4983, 13, -3373.824951, -3190.861084, 34.717, 0, ''), +(4983, 14, -3371.443359, -3183.905029, 33.454, 0, ''), +(4983, 15, -3369.355957, -3169.828857, 36.325, 0, ''), +(4983, 16, -3368.904541, -3147.265381, 36.091, 0, ''), +(4983, 17, -3365.828125, -3144.284180, 35.176, 0, ''), +(4983, 18, -3355.827881, -3140.947998, 29.534, 0, ''), +(4983, 19, -3342.598389, -3132.146729, 30.422, 0, ''), +(4983, 20, -3336.984131, -3129.611816, 30.692, 0, ''), +(4983, 21, -3326.336670, -3126.833496, 34.426, 0, ''), +(4983, 22, -3322.649414, -3124.631836, 33.842, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 5391; +INSERT INTO script_waypoint VALUES +(5391, 0, -9901.12, -3727.29, 22.11, 3000, ''), +(5391, 1, -9909.27, -3727.81, 23.25, 0, ''), +(5391, 2, -9935.25, -3729.02, 22.11, 0, ''), +(5391, 3, -9945.83, -3719.34, 21.68, 0, ''), +(5391, 4, -9963.41, -3710.18, 21.71, 0, ''), +(5391, 5, -9972.75, -3690.13, 21.68, 0, ''), +(5391, 6, -9989.70, -3669.67, 21.67, 0, ''), +(5391, 7, -9989.21, -3647.76, 23.00, 0, ''), +(5391, 8, -9992.27, -3633.74, 21.67, 0, ''), +(5391, 9,-10002.32, -3611.67, 22.26, 0, ''), +(5391,10, -9999.25, -3586.33, 21.85, 0, ''), +(5391,11,-10006.53, -3571.99, 21.67, 0, ''), +(5391,12,-10014.30, -3545.24, 21.67, 0, ''), +(5391,13,-10018.91, -3525.03, 21.68, 0, ''), +(5391,14,-10030.22, -3514.77, 21.67, 0, ''), +(5391,15,-10045.11, -3501.49, 21.67, 0, ''), +(5391,16,-10052.91, -3479.13, 21.67, 0, ''), +(5391,17,-10060.68, -3460.31, 21.67, 0, ''), +(5391,18,-10074.68, -3436.85, 20.97, 0, ''), +(5391,19,-10074.68, -3436.85, 20.97, 0, ''), +(5391,20,-10072.86, -3408.92, 20.43, 15000, ''), +(5391,21,-10108.01, -3406.05, 22.06, 0, ''); + +DELETE FROM script_waypoint WHERE entry=6182; +INSERT INTO script_waypoint VALUES +(6182, 0, -11480.684570, 1545.091187, 49.898571, 0, ''), +(6182, 1, -11466.825195, 1530.151733, 50.263611, 0, ''), +(6182, 2, -11465.213867, 1528.343750, 50.954369, 0, 'entrance hut'), +(6182, 3, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 4, -11461.000000, 1526.614014, 50.937702, 5000, 'pick up rifle'), +(6182, 5, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 6, -11465.213867, 1528.343750, 50.954369, 0, ''), +(6182, 7, -11468.353516, 1535.075562, 50.400948, 15000, 'hold, prepare for wave1'), +(6182, 8, -11468.353516, 1535.075562, 50.400948, 15000, 'hold, prepare for wave2'), +(6182, 9, -11468.353516, 1535.075562, 50.400948, 10000, 'hold, prepare for wave3'), +(6182, 10, -11467.898438, 1532.459595, 50.348885, 0, 'we are done'), +(6182, 11, -11466.064453, 1529.855225, 50.209351, 0, ''), +(6182, 12, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 13, -11461.000000, 1526.614014, 50.937702, 5000, 'deliver rifle'), +(6182, 14, -11462.990234, 1525.235596, 50.937702, 0, ''), +(6182, 15, -11465.213867, 1528.343750, 50.954369, 0, ''), +(6182, 16, -11470.260742, 1537.276733, 50.378487, 0, ''), +(6182, 17, -11475.581055, 1548.678833, 50.184380, 0, 'complete quest'), +(6182, 18, -11482.299805, 1557.410034, 48.624519, 0, ''); + +DELETE FROM script_waypoint WHERE entry=6575; +INSERT INTO script_waypoint VALUES +(6575, 0, 1945.81, -431.54, 16.36, 0, ''), +(6575, 1, 1946.21, -436.41, 16.36, 0, ''), +(6575, 2, 1950.01, -444.11, 14.63, 0, ''), +(6575, 3, 1956.08, -449.34, 13.12, 0, ''), +(6575, 4, 1966.59, -450.55, 11.27, 0, ''), +(6575, 5, 1976.09, -447.51, 11.27, 0, ''), +(6575, 6, 1983.42, -435.85, 11.27, 0, ''), +(6575, 7, 1978.17, -428.81, 11.27, 0, ''), +(6575, 8, 1973.97, -422.08, 9.04, 0, ''), +(6575, 9, 1963.84, -418.90, 6.17, 0, ''), +(6575, 10, 1961.22, -422.74, 6.17, 0, ''), +(6575, 11, 1964.80, -431.26, 6.17, 300000, ''); + +DELETE FROM script_waypoint WHERE entry=7780; +INSERT INTO script_waypoint VALUES +(7780, 0, 261.058868, -2757.876221, 122.553, 0, ''), +(7780, 1, 259.812195, -2758.249023, 122.555, 0, 'SAY_RIN_FREE'), +(7780, 2, 253.823441, -2758.619141, 122.562, 0, ''), +(7780, 3, 241.394791, -2769.754883, 123.309, 0, ''), +(7780, 4, 218.915588, -2783.397461, 123.355, 0, ''), +(7780, 5, 209.088196, -2789.676270, 122.001, 0, ''), +(7780, 6, 204.453568, -2792.205811, 120.620, 0, ''), +(7780, 7, 182.012604, -2809.995361, 113.887, 0, 'summon'), +(7780, 8, 164.411591, -2825.162842, 107.779, 0, ''), +(7780, 9, 149.727600, -2833.704346, 106.224, 0, ''), +(7780, 10, 142.448074, -2838.807373, 109.665, 0, ''), +(7780, 11, 133.274963, -2845.135254, 112.606, 0, ''), +(7780, 12, 111.247459, -2861.065674, 116.305, 0, ''), +(7780, 13, 96.104073, -2874.886230, 114.397, 0, 'summon'), +(7780, 14, 73.369942, -2881.184570, 117.666, 0, ''), +(7780, 15, 58.579178, -2889.151611, 116.253, 0, ''), +(7780, 16, 33.214249, -2906.343994, 115.083, 0, ''), +(7780, 17, 19.586519, -2908.712402, 117.276, 7500, 'SAY_RIN_COMPLETE'), +(7780, 18, 10.282522, -2911.607422, 118.394, 0, ''), +(7780, 19, -37.580383, -2942.730225, 117.145, 0, ''), +(7780, 20, -68.599411, -2953.694824, 116.685, 0, ''), +(7780, 21, -102.054253, -2956.965576, 116.677, 0, ''), +(7780, 22, -135.993637, -2955.743652, 115.788, 0, ''), +(7780, 23, -171.561600, -2951.417480, 115.451, 0, ''); + +DELETE FROM script_waypoint WHERE entry=7784; +INSERT INTO script_waypoint VALUES +(7784, 0, -8845.65, -4373.98, 43.87, 5000, 'SAY_START'), +(7784, 1, -8840.79, -4373.73, 44.24, 0, ''), +(7784, 2, -8837.43, -4373.56, 45.60, 0, ''), +(7784, 3, -8832.74, -4373.32, 45.68, 0, ''), +(7784, 4, -8829.37, -4373.14, 44.33, 0, ''), +(7784, 5, -8817.38, -4372.41, 35.58, 0, ''), +(7784, 6, -8803.47, -4371.60, 30.34, 0, ''), +(7784, 7, -8795.10, -4365.61, 26.08, 0, ''), +(7784, 8, -8766.78, -4367.13, 25.15, 0, ''), +(7784, 9, -8755.63, -4367.54, 24.63, 0, ''), +(7784, 10, -8754.42, -4365.59, 24.15, 0, ''), +(7784, 11, -8728.82, -4353.13, 20.90, 0, ''), +(7784, 12, -8706.60, -4356.55, 17.93, 0, ''), +(7784, 13, -8679.00, -4380.23, 12.64, 0, ''), +(7784, 14, -8642.96, -4393.82, 12.52, 0, ''), +(7784, 15, -8611.19, -4399.11, 9.55, 0, ''), +(7784, 16, -8554.87, -4409.32, 13.05, 0, ''), +(7784, 17, -8531.64, -4411.96, 11.20, 0, ''), +(7784, 18, -8510.40, -4414.38, 12.84, 0, ''), +(7784, 19, -8476.92, -4418.34, 9.71, 0, ''), +(7784, 20, -8435.89, -4426.74, 9.67, 0, ''), +(7784, 21, -8381.89, -4446.40, 10.23, 0, ''), +(7784, 22, -8351.15, -4447.79, 9.99, 5000, 'first ambush SAY_AMBUSH'), +(7784, 23, -8324.18, -4445.05, 9.71, 0, ''), +(7784, 24, -8138.94, -4384.78, 10.92, 0, ''), +(7784, 25, -8036.87, -4443.38, 9.65, 0, ''), +(7784, 26, -7780.92, -4761.81, 9.50, 0, ''), +(7784, 27, -7587.67, -4765.01, 8.96, 0, ''), +(7784, 28, -7497.65, -4792.86, 10.01, 0, 'second ambush SAY_AMBUSH'), +(7784, 29, -7391.54, -4774.26, 12.44, 0, ''), +(7784, 30, -7308.42, -4739.87, 12.65, 0, ''), +(7784, 31, -7016.11, -4751.12, 10.06, 0, ''), +(7784, 32, -6985.52, -4777.41, 10.26, 0, ''), +(7784, 33, -6953.02, -4786.00, 6.32, 0, ''), +(7784, 34, -6940.37, -4831.03, 0.67, 10000, 'quest complete SAY_END'); + +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); + +DELETE FROM script_waypoint WHERE entry=7807; +INSERT INTO script_waypoint VALUES +(7807, 0, -4943.74, 1715.74, 62.74, 0, 'SAY_START'), +(7807, 1, -4944.93, 1706.66, 63.16, 0, ''), +(7807, 2, -4942.82, 1690.22, 64.25, 0, ''), +(7807, 3, -4946.47, 1669.62, 63.84, 0, ''), +(7807, 4, -4955.93, 1651.88, 63.00, 0, ''), +(7807, 5, -4967.58, 1643.86, 64.31, 0, ''), +(7807, 6, -4978.12, 1607.90, 64.30, 0, ''), +(7807, 7, -4975.38, 1596.16, 64.70, 0, ''), +(7807, 8, -4972.82, 1581.89, 61.75, 0, ''), +(7807, 9, -4958.65, 1581.05, 61.81, 0, ''), +(7807, 10, -4936.72, 1594.89, 65.96, 0, ''), +(7807, 11, -4885.69, 1598.10, 67.45, 4000, 'first ambush SAY_AMBUSH'), +(7807, 12, -4874.20, 1601.73, 68.54, 0, ''), +(7807, 13, -4816.64, 1594.47, 78.20, 0, ''), +(7807, 14, -4802.20, 1571.92, 87.01, 0, ''), +(7807, 15, -4746.40, 1576.11, 84.59, 0, ''), +(7807, 16, -4739.72, 1707.16, 94.04, 0, ''), +(7807, 17, -4674.03, 1840.44, 89.17, 0, ''), +(7807, 18, -4667.94, 1864.11, 85.18, 0, ''), +(7807, 19, -4668.08, 1886.39, 81.14, 0, ''), +(7807, 20, -4679.43, 1932.32, 73.76, 0, ''), +(7807, 21, -4674.17, 1946.66, 70.83, 5000, 'second ambush SAY_AMBUSH'), +(7807, 22, -4643.94, 1967.45, 65.27, 0, ''), +(7807, 23, -4595.60, 2010.75, 52.10, 0, ''), +(7807, 24, -4562.65, 2029.28, 45.41, 0, ''), +(7807, 25, -4538.56, 2032.65, 45.28, 0, ''), +(7807, 26, -4531.96, 2034.15, 48.34, 0, ''), +(7807, 27, -4507.75, 2039.32, 51.57, 0, ''), +(7807, 28, -4482.74, 2045.67, 48.15, 0, ''), +(7807, 29, -4460.87, 2051.54, 45.55, 0, ''), +(7807, 30, -4449.97, 2060.03, 45.51, 10000, 'third ambush SAY_AMBUSH'), +(7807, 31, -4448.99, 2079.05, 44.64, 0, ''), +(7807, 32, -4436.64, 2134.48, 28.83, 0, ''), +(7807, 33, -4429.25, 2170.20, 15.44, 0, ''), +(7807, 34, -4424.83, 2186.11, 11.48, 0, ''), +(7807, 35, -4416.71, 2209.76, 7.36, 0, ''), +(7807, 36, -4405.25, 2231.77, 5.94, 0, ''), +(7807, 37, -4377.61, 2265.45, 06.71, 15000, 'complete quest SAY_END'); + +DELETE FROM script_waypoint WHERE entry=9503; +INSERT INTO script_waypoint VALUES +(9503, 0, 883.294861, -188.926300, -43.703655, 0,''), +(9503, 1, 872.763550, -185.605621, -43.703655, 5000,'b1'), +(9503, 2, 867.923401, -188.006393, -43.703655, 5000,'b2'), +(9503, 3, 863.295898, -190.795212, -43.703655, 5000,'b3'), +(9503, 4, 856.139587, -194.652756, -43.703655, 5000,'b4'), +(9503, 5, 851.878906, -196.928131, -43.703655, 15000,'b5'), +(9503, 6, 877.035217, -187.048080, -43.703655, 0,''), +(9503, 7, 891.198000, -197.924000, -43.620400, 0,'home'); + +DELETE FROM script_waypoint WHERE entry=9623; +INSERT INTO script_waypoint VALUES +(9623, 0, -6383.070801, -1964.368896, -258.709, 0, 'SAY_AME_START'), +(9623, 1, -6393.649414, -1949.572266, -261.449, 0, ''), +(9623, 2, -6397.846680, -1931.099609, -263.366, 0, ''), +(9623, 3, -6397.501953, -1921.470703, -263.876, 0, ''), +(9623, 4, -6389.630371, -1909.995361, -259.601, 0, ''), +(9623, 5, -6380.065430, -1905.452881, -255.858, 0, ''), +(9623, 6, -6373.437988, -1900.275024, -254.774, 0, ''), +(9623, 7, -6372.868652, -1893.500854, -255.678, 0, ''), +(9623, 8, -6379.730469, -1877.627808, -259.654, 0, ''), +(9623, 9, -6380.264160, -1871.139648, -260.617, 0, ''), +(9623, 10, -6373.830566, -1855.620361, -259.566, 0, ''), +(9623, 11, -6368.824707, -1847.770508, -259.246, 0, ''), +(9623, 12, -6370.902832, -1835.038940, -260.212, 0, ''), +(9623, 13, -6376.591309, -1821.592285, -260.856, 0, ''), +(9623, 14, -6381.931152, -1810.434326, -266.180, 0, ''), +(9623, 15, -6396.713867, -1807.123535, -269.329, 0, ''), +(9623, 16, -6400.266602, -1795.053589, -269.744, 0, ''), +(9623, 17, -6402.675781, -1747.514648, -272.961, 0, ''), +(9623, 18, -6396.997559, -1710.052979, -273.719, 0, ''), +(9623, 19, -6388.105957, -1676.328125, -272.133, 5000, 'SAY_AME_PROGRESS'), +(9623, 20, -6370.711914, -1638.638306, -272.031, 0, ''), +(9623, 21, -6366.709473, -1592.645996, -272.201, 0, ''), +(9623, 22, -6333.869629, -1534.598755, -270.493, 0, ''), +(9623, 23, -6305.362305, -1477.913330, -269.518, 0, ''), +(9623, 24, -6311.588867, -1419.017456, -267.622, 0, ''), +(9623, 25, -6330.014648, -1400.064331, -266.425, 0, ''), +(9623, 26, -6356.021973, -1392.607422, -267.123, 0, ''), +(9623, 27, -6370.859375, -1386.179321, -270.218, 0, ''), +(9623, 28, -6381.529785, -1369.780273, -272.110, 0, ''), +(9623, 29, -6405.381348, -1321.522827, -271.699, 0, ''), +(9623, 30, -6406.583496, -1307.574585, -271.802, 0, ''), +(9623, 31, -6386.325684, -1286.851074, -272.074, 0, ''), +(9623, 32, -6364.254883, -1264.706299, -269.075, 0, ''), +(9623, 33, -6343.636230, -1239.844360, -268.364, 0, ''), +(9623, 34, -6335.568848, -1202.449585, -271.515, 0, ''), +(9623, 35, -6325.625000, -1184.455322, -270.461, 0, ''), +(9623, 36, -6317.797363, -1177.668091, -269.792, 0, ''), +(9623, 37, -6303.024414, -1180.252686, -269.332, 0, 'SAY_AME_END'), +(9623, 38, -6301.975098, -1184.787842, -269.371, 1000, ''), +(9623, 39, -6297.575684, -1186.412964, -268.962, 5000, ''); + +DELETE FROM script_waypoint WHERE entry=10096; +INSERT INTO script_waypoint VALUES +(10096, 0, 604.802673, -191.081985, -54.058590, 0,'ring'), +(10096, 1, 604.072998, -222.106918, -52.743759, 0,'first gate'), +(10096, 2, 621.400391, -214.499054, -52.814453, 0,'hiding in corner'), +(10096, 3, 601.300781, -198.556992, -53.950256, 0,'ring'), +(10096, 4, 631.818359, -180.548126, -52.654770, 0,'second gate'), +(10096, 5, 627.390381, -201.075974, -52.692917, 0,'hiding in corner'); + +DELETE FROM script_waypoint WHERE entry=10427; +INSERT INTO script_waypoint VALUES +(10427, 0, -5185.463, -1185.927, 45.951, 0, ''), +(10427, 1, -5184.880, -1154.210, 45.035, 0, ''), +(10427, 2, -5175.880, -1126.526, 43.701, 0, ''), +(10427, 3, -5138.651, -1111.874, 44.024, 0, ''), +(10427, 4, -5134.728, -1104.796, 47.365, 0, ''), +(10427, 5, -5129.681, -1097.878, 49.449, 2500, ''), +(10427, 6, -5125.303, -1080.572, 47.033, 0, ''), +(10427, 7, -5146.668, -1053.694, 28.415, 0, ''), +(10427, 8, -5147.463, -1027.539, 13.818, 0, ''), +(10427, 9, -5139.238, -1018.889, 8.220, 0, ''), +(10427, 10, -5121.168, -1013.126, -0.619, 0, ''), +(10427, 11, -5091.919, -1014.205, -4.902, 0, ''), +(10427, 12, -5069.240, -994.299, -4.631, 0, ''), +(10427, 13, -5059.975, -944.112, -5.377, 0, ''), +(10427, 14, -5013.546, -906.184, -5.490, 0, ''), +(10427, 15, -4992.461, -920.983, -4.980, 5000, 'SAY_WYVERN'), +(10427, 16, -4976.355, -1002.997, -5.380, 0, ''), +(10427, 17, -4958.478, -1033.185, -5.433, 0, ''), +(10427, 18, -4953.353, -1052.211, -10.836, 0, ''), +(10427, 19, -4937.447, -1056.351, -22.139, 0, ''), +(10427, 20, -4908.455, -1050.433, -33.458, 0, ''), +(10427, 21, -4905.530, -1056.885, -33.722, 0, ''), +(10427, 22, -4920.830, -1073.284, -45.515, 0, ''), +(10427, 23, -4933.368, -1082.700, -50.186, 0, ''), +(10427, 24, -4935.313, -1092.353, -52.785, 0, ''), +(10427, 25, -4929.553, -1101.268, -50.637, 0, ''), +(10427, 26, -4920.679, -1100.028, -51.944, 10000, 'SAY_COMPLETE'), +(10427, 27, -4920.679, -1100.028, -51.944, 0, 'quest complete'); + +DELETE FROM script_waypoint WHERE entry=10638; +INSERT INTO script_waypoint VALUES +(10638, 0, -4903.521973, -1368.339844, -52.611, 5000, 'SAY_KAN_START'), +(10638, 1, -4906.004395, -1367.048096, -52.611, 0, ''); + +DELETE FROM script_waypoint WHERE entry=10646; +INSERT INTO script_waypoint VALUES +(10646, 0, -4792.401855, -2137.775146, 82.423, 0, ''), +(10646, 1, -4813.508301, -2141.543457, 80.774, 0, ''), +(10646, 2, -4828.630859, -2154.309814, 82.074, 0, ''), +(10646, 3, -4833.772949, -2149.182617, 81.676, 0, ''), +(10646, 4, -4846.418945, -2136.045410, 77.871, 0, ''), +(10646, 5, -4865.076660, -2116.549561, 76.483, 0, ''), +(10646, 6, -4888.434570, -2090.729248, 80.907, 0, ''), +(10646, 7, -4893.068359, -2085.468994, 82.094, 0, ''), +(10646, 8, -4907.256836, -2074.929932, 84.437, 5000, 'SAY_LAKO_LOOK_OUT'), +(10646, 9, -4899.899902, -2062.143555, 83.780, 0, ''), +(10646, 10, -4897.762207, -2056.520020, 84.184, 0, ''), +(10646, 11, -4888.331543, -2033.182495, 83.654, 0, ''), +(10646, 12, -4876.343750, -2003.916138, 90.887, 0, ''), +(10646, 13, -4872.227051, -1994.173340, 91.513, 0, ''), +(10646, 14, -4879.569336, -1976.985229, 92.185, 5000, 'SAY_LAKO_HERE_COME'), +(10646, 15, -4879.049316, -1964.349609, 92.001, 0, ''), +(10646, 16, -4874.720215, -1956.939819, 90.737, 0, ''), +(10646, 17, -4869.474609, -1952.612671, 89.206, 0, ''), +(10646, 18, -4842.466797, -1929.000732, 84.147, 0, ''), +(10646, 19, -4804.444824, -1897.302734, 89.362, 0, ''), +(10646, 20, -4798.072754, -1892.383545, 89.368, 0, ''), +(10646, 21, -4779.447754, -1882.759155, 90.169, 5000, 'SAY_LAKO_MORE'), +(10646, 22, -4762.081055, -1866.530640, 89.481, 0, ''), +(10646, 23, -4766.267090, -1861.867798, 87.847, 0, ''), +(10646, 24, -4782.929688, -1852.174683, 78.354, 0, ''), +(10646, 25, -4793.605469, -1850.961182, 77.658, 0, ''), +(10646, 26, -4803.323730, -1855.102661, 78.958, 0, ''), +(10646, 27, -4807.971680, -1854.501221, 77.743, 0, ''), +(10646, 28, -4837.212891, -1848.493408, 64.488, 0, ''), +(10646, 29, -4884.619629, -1840.401123, 56.219, 0, ''), +(10646, 30, -4889.705566, -1839.623291, 54.417, 0, ''), +(10646, 31, -4893.904297, -1843.685791, 53.012, 0, ''), +(10646, 32, -4903.142090, -1872.383545, 32.266, 0, ''), +(10646, 33, -4910.940918, -1879.864868, 29.940, 0, ''), +(10646, 34, -4920.047363, -1880.940796, 30.597, 0, ''), +(10646, 35, -4924.457031, -1881.447144, 29.292, 0, ''), +(10646, 36, -4966.120117, -1886.033081, 10.977, 0, ''), +(10646, 37, -4999.369629, -1890.847290, 4.430, 0, ''), +(10646, 38, -5007.271484, -1891.669678, 2.771, 0, ''), +(10646, 39, -5013.334473, -1879.588257, -1.947, 0, ''), +(10646, 40, -5023.328613, -1855.959961, -17.103, 0, ''), +(10646, 41, -5038.513184, -1825.986694, -35.821, 0, ''), +(10646, 42, -5048.733887, -1809.798218, -46.457, 0, ''), +(10646, 43, -5053.188965, -1791.682983, -57.186, 0, ''), +(10646, 44, -5062.093750, -1794.399780, -56.515, 0, ''), +(10646, 45, -5052.657227, -1797.044800, -54.734, 5000, 'SAY_LAKO_END'); + +DELETE FROM script_waypoint WHERE entry=11856; +INSERT INTO script_waypoint VALUES +(11856, 0, 113.91, -350.13, 4.55, 0, ''), +(11856, 1, 109.54, -350.08, 3.74, 0, ''), +(11856, 2, 106.95, -353.40, 3.60, 0, ''), +(11856, 3, 100.28, -338.89, 2.97, 0, ''), +(11856, 4, 110.11, -320.26, 3.47, 0, ''), +(11856, 5, 109.78, -287.80, 5.30, 0, ''), +(11856, 6, 105.02, -269.71, 4.71, 0, ''), +(11856, 7, 86.71, -251.81, 5.34, 0, ''), +(11856, 8, 64.10, -246.38, 5.91, 0, ''), +(11856, 9, -2.55, -243.58, 6.3, 0, ''), +(11856, 10, -27.78, -267.53, -1.08, 0, ''), +(11856, 11, -31.27, -283.54, -4.36, 0, ''), +(11856, 12, -28.96, -322.44, -9.19, 0, ''), +(11856, 13, -35.63, -360.03, -16.59, 0, ''), +(11856, 14, -58.30, -412.26, -30.60, 0, ''), +(11856, 15, -58.88, -474.17, -44.54, 0, ''), +(11856, 16, -45.92, -496.57, -46.26, 5000, 'AMBUSH'), +(11856, 17, -40.25, -510.07, -46.05, 0, ''), +(11856, 18, -38.88, -520.72, -46.06, 5000, 'END'); + +DELETE FROM script_waypoint WHERE entry=12423; +INSERT INTO script_waypoint VALUES +(12423, 0, -9509.72, -147.03, 58.74, 0, ''), +(12423, 1, -9517.07, -172.82, 58.66, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12427; +INSERT INTO script_waypoint VALUES +(12427, 0, -5689.20, -456.44, 391.08, 0, ''), +(12427, 1, -5700.37, -450.77, 393.19, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12428; +INSERT INTO script_waypoint VALUES +(12428, 0, 2454.09, 361.26, 31.51, 0, ''), +(12428, 1, 2472.03, 378.08, 30.98, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12429; +INSERT INTO script_waypoint VALUES +(12429, 0, 9654.19, 909.58, 1272.11, 0, ''), +(12429, 1, 9642.53, 908.11, 1269.10, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12430; +INSERT INTO script_waypoint VALUES +(12430, 0, 161.65, -4779.34, 14.64, 0, ''), +(12430, 1, 140.71, -4813.56, 17.04, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12717; +INSERT INTO script_waypoint VALUES +(12717, 0, 3346.247070, 1007.879028, 3.590, 0, 'SAY_MUG_START2'), +(12717, 1, 3367.388428, 1011.505859, 3.720, 0, ''), +(12717, 2, 3418.636963, 1013.963684, 2.905, 0, ''), +(12717, 3, 3426.844971, 1015.097534, 3.449, 0, ''), +(12717, 4, 3437.025391, 1020.786194, 2.742, 0, ''), +(12717, 5, 3460.563721, 1024.256470, 1.353, 0, ''), +(12717, 6, 3479.869629, 1037.957153, 1.023, 0, ''), +(12717, 7, 3490.526367, 1043.346313, 3.338, 0, ''), +(12717, 8, 3504.282959, 1047.772339, 8.205, 0, ''), +(12717, 9, 3510.733398, 1049.790771, 12.143, 0, ''), +(12717, 10, 3514.411133, 1051.167725, 13.235, 0, ''), +(12717, 11, 3516.939697, 1052.911377, 12.918, 0, ''), +(12717, 12, 3523.635742, 1056.297485, 7.563, 0, ''), +(12717, 13, 3531.939941, 1059.863525, 6.175, 0, ''), +(12717, 14, 3535.475342, 1069.959473, 1.697, 0, ''), +(12717, 15, 3546.978027, 1093.485474, 0.680, 0, ''), +(12717, 16, 3549.729980, 1101.882446, -1.123, 0, ''), +(12717, 17, 3555.140137, 1116.985718, -4.326, 0, ''), +(12717, 18, 3571.940430, 1132.175781, -0.634, 0, ''), +(12717, 19, 3574.283203, 1137.575928, 3.684, 0, ''), +(12717, 20, 3579.312744, 1137.252319, 8.205, 0, ''), +(12717, 21, 3590.218994, 1143.646973, 8.291, 0, ''), +(12717, 22, 3595.972900, 1145.827148, 6.773, 0, ''), +(12717, 23, 3603.650391, 1146.920776, 9.763, 0, ''), +(12717, 24, 3607.081787, 1146.014282, 10.692, 5000, 'SAY_MUG_BRAZIER'), +(12717, 25, 3614.518555, 1142.629150, 10.248, 0, ''), +(12717, 26, 3616.660889, 1140.837036, 10.682, 3000, 'SAY_MUG_PATROL'), +(12717, 27, 3621.078613, 1138.109497, 10.369, 0, 'SAY_MUG_RETURN'), +(12717, 28, 3615.478516, 1145.525879, 9.614, 0, ''), +(12717, 29, 3607.188232, 1152.715942, 8.871, 0, ''); + +DELETE FROM script_waypoint WHERE entry=12818; +INSERT INTO script_waypoint VALUES +(12818, 0, 3347.250089, -694.700989, 159.925995, 0, ''), +(12818, 1, 3341.527039, -694.725891, 161.124542, 4000, ''), +(12818, 2, 3338.351074, -686.088138, 163.444000, 0, ''), +(12818, 3, 3352.744873, -677.721741, 162.316269, 0, ''), +(12818, 4, 3370.291016, -669.366943, 160.751358, 0, ''), +(12818, 5, 3381.479492, -659.449097, 162.545303, 0, ''), +(12818, 6, 3389.554199, -648.500000, 163.651825, 0, ''), +(12818, 7, 3396.645020, -641.508911, 164.216019, 0, ''), +(12818, 8, 3410.498535, -634.299622, 165.773453, 0, ''), +(12818, 9, 3418.461426, -631.791992, 166.477615, 0, ''), +(12818, 10, 3429.500000, -631.588745, 166.921265, 0, ''), +(12818, 11,3434.950195, -629.245483, 168.333969, 0, ''), +(12818, 12,3438.927979, -618.503235, 171.503143, 0, ''), +(12818, 13,3444.217529, -609.293640, 173.077972, 1000, 'Ambush 1'), +(12818, 14,3460.505127, -593.794189, 174.342255, 0, ''), +(12818, 15,3480.283203, -578.210327, 176.652313, 0, ''), +(12818, 16,3492.912842, -562.335449, 181.396301, 0, ''), +(12818, 17,3495.230957, -550.977600, 184.652267, 0, ''), +(12818, 18,3496.247070, -529.194214, 188.172028, 0, ''), +(12818, 19,3497.619385, -510.411499, 188.345322, 1000, 'Ambush 2'), +(12818, 20,3498.498047, -497.787506, 185.806274, 0, ''), +(12818, 21,3484.218750, -489.717529, 182.389862, 4000, ''); + +DELETE FROM script_waypoint WHERE entry=12858; +INSERT INTO script_waypoint VALUES +(12858, 0, 1782.63, -2241.11, 109.73, 5000, ''), +(12858, 1, 1788.88, -2240.17, 111.71, 0, ''), +(12858, 2, 1797.49, -2238.11, 112.31, 0, ''), +(12858, 3, 1803.83, -2232.77, 111.22, 0, ''), +(12858, 4, 1806.65, -2217.83, 107.36, 0, ''), +(12858, 5, 1811.81, -2208.01, 107.45, 0, ''), +(12858, 6, 1820.85, -2190.82, 100.49, 0, ''), +(12858, 7, 1829.60, -2177.49, 96.44, 0, ''), +(12858, 8, 1837.98, -2164.19, 96.71, 0, 'prepare'), +(12858, 9, 1839.99, -2149.29, 96.78, 0, ''), +(12858, 10, 1835.14, -2134.98, 96.80, 0, ''), +(12858, 11, 1823.57, -2118.27, 97.43, 0, ''), +(12858, 12, 1814.99, -2110.35, 98.38, 0, ''), +(12858, 13, 1806.60, -2103.09, 99.19, 0, ''), +(12858, 14, 1798.27, -2095.77, 100.04, 0, ''), +(12858, 15, 1783.59, -2079.92, 100.81, 0, ''), +(12858, 16, 1776.79, -2069.48, 101.77, 0, ''), +(12858, 17, 1776.82, -2054.59, 109.82, 0, ''), +(12858, 18, 1776.88, -2047.56, 109.83, 0, ''), +(12858, 19, 1776.86, -2036.55, 109.83, 0, ''), +(12858, 20, 1776.90, -2024.56, 109.83, 0, 'win'), +(12858, 21, 1776.87, -2028.31, 109.83,60000, 'stay'), +(12858, 22, 1776.90, -2028.30, 109.83, 0, ''); + +DELETE FROM script_waypoint WHERE entry=15420; +INSERT INTO script_waypoint VALUES +(15420, 0, 9294.78, -6682.51, 22.42, 0, ''), +(15420, 1, 9298.27, -6667.99, 22.42, 0, ''), +(15420, 2, 9309.63, -6658.84, 22.43, 0, ''), +(15420, 3, 9304.43, -6649.31, 26.46, 0, ''), +(15420, 4, 9298.83, -6648.00, 28.61, 0, ''), +(15420, 5, 9291.06, -6653.46, 31.83,2500, ''), +(15420, 6, 9289.08, -6660.17, 31.85,5000, ''), +(15420, 7, 9291.06, -6653.46, 31.83, 0, ''); + +DELETE FROM script_waypoint WHERE entry=16295; +INSERT INTO script_waypoint VALUES +(16295, 0, 7545.070000, -7359.870000, 162.354000, 4000, 'SAY_START'), +(16295, 1, 7550.048340, -7362.237793, 162.235657, 0, ''), +(16295, 2, 7566.976074, -7364.315430, 161.738770, 0, ''), +(16295, 3, 7578.830566, -7361.677734, 161.738770, 0, ''), +(16295, 4, 7590.969238, -7359.053711, 162.257660, 0, ''), +(16295, 5, 7598.354004, -7362.815430, 162.256683, 4000, 'SAY_PROGRESS_1'), +(16295, 6, 7605.861328, -7380.424316, 161.937073, 0, ''), +(16295, 7, 7605.295410, -7387.382813, 157.253998, 0, ''), +(16295, 8, 7606.131836, -7393.893555, 156.941925, 0, ''), +(16295, 9, 7615.207520, -7400.187012, 157.142639, 0, ''), +(16295, 10, 7618.956543, -7402.652832, 158.202042, 0, ''), +(16295, 11, 7636.850586, -7401.756836, 162.144791, 0, 'SAY_PROGRESS_2'), +(16295, 12, 7637.058105, -7404.944824, 162.206970, 4000, ''), +(16295, 13, 7636.910645, -7412.585449, 162.366425, 0, ''), +(16295, 14, 7637.607910, -7425.591797, 162.630661, 0, ''), +(16295, 15, 7637.816895, -7459.057129, 163.302704, 0, ''), +(16295, 16, 7638.859863, -7470.902344, 162.517059, 0, ''), +(16295, 17, 7641.395996, -7488.217285, 157.381287, 0, ''), +(16295, 18, 7634.455566, -7505.451660, 154.682159, 0, 'SAY_PROGRESS_3'), +(16295, 19, 7631.906738, -7516.948730, 153.597382, 0, ''), +(16295, 20, 7622.231445, -7537.037598, 151.587112, 0, ''), +(16295, 21, 7610.921875, -7550.670410, 149.639374, 0, ''), +(16295, 22, 7598.229004, -7562.551758, 145.953888, 0, ''), +(16295, 23, 7588.509277, -7577.755371, 148.294479, 0, ''), +(16295, 24, 7567.339355, -7608.456055, 146.006485, 0, ''), +(16295, 25, 7562.547852, -7617.417969, 148.097504, 0, ''), +(16295, 26, 7561.508789, -7645.064453, 151.245163, 0, ''), +(16295, 27, 7563.337402, -7654.652344, 151.227158, 0, ''), +(16295, 28, 7565.533691, -7658.296387, 151.248886, 0, ''), +(16295, 39, 7571.155762, -7659.118652, 151.244568, 0, ''), +(16295, 30, 7579.119629, -7662.213867, 151.651505, 0, 'quest complete'), +(16295, 31, 7603.768066, -7667.000488, 153.997726, 0, ''), +(16295, 32, 7603.768066, -7667.000488, 153.997726, 4000, 'SAY_END_1'), +(16295, 33, 7603.768066, -7667.000488, 153.997726, 8000, 'SAY_END_2'), +(16295, 34, 7603.768066, -7667.000488, 153.997726, 0, ''); + +DELETE FROM script_waypoint WHERE entry=16812; +INSERT INTO script_waypoint VALUES +(16812, 0, -10868.260, -1779.836, 90.476, 2500, 'Open door, begin walking'), +(16812, 1, -10875.585, -1779.581, 90.478, 0, ''), +(16812, 2, -10887.447, -1779.258, 90.476, 0, ''), +(16812, 3, -10894.592, -1780.668, 90.476, 0, ''), +(16812, 4, -10895.015, -1782.036, 90.476, 2500, 'Begin Speech after this'), +(16812, 5, -10894.592, -1780.668, 90.476, 0, 'Resume walking (back to spawn point now) after speech'), +(16812, 6, -10887.447, -1779.258, 90.476, 0, ''), +(16812, 7, -10875.585, -1779.581, 90.478, 0, ''), +(16812, 8, -10868.260, -1779.836, 90.476, 5000, 'close door'), +(16812, 9, -10866.799, -1780.958, 90.470, 2000, 'Summon mobs, open curtains'); + +DELETE FROM script_waypoint WHERE entry=16993; +INSERT INTO script_waypoint VALUES +(16993, 0, -1137.72, 4272.10, 14.04, 5000, ''), +(16993, 1, -1141.34, 4232.42, 14.63, 0, ''), +(16993, 2, -1133.47, 4220.88, 11.78, 0, ''), +(16993, 3, -1126.18, 4213.26, 13.51, 0, ''), +(16993, 4, -1100.12, 4204.32, 16.41, 0, ''), +(16993, 5, -1063.68, 4197.92, 15.51, 0, ''), +(16993, 6, -1027.28, 4194.36, 15.52, 0, ''), +(16993, 7, -995.68, 4189.59, 19.84, 0, ''), +(16993, 8, -970.90, 4188.60, 24.61, 0, ''), +(16993, 9, -961.93, 4193.34, 26.11, 15000, 'Summon 1'), +(16993, 10, -935.52, 4210.99, 31.98, 0, ''), +(16993, 11, -913.42, 4218.27, 37.29, 0, ''), +(16993, 12, -896.53, 4207.73, 43.23, 0, ''), +(16993, 13, -868.49, 4194.77, 46.75, 30000, 'Kneel and Rest Here'), +(16993, 14, -852.83, 4198.29, 47.28, 15000, 'Summon 2'), +(16993, 15, -819.85, 4200.50, 46.37, 0, ''), +(16993, 16, -791.92, 4201.96, 44.19, 0, ''), +(16993, 17, -774.42, 4202.46, 47.41, 0, ''), +(16993, 18, -762.90, 4202.17, 48.81, 0, ''), +(16993, 19, -728.25, 4195.35, 50.68, 0, ''), +(16993, 20, -713.58, 4192.07, 53.98, 0, ''), +(16993, 21, -703.09, 4189.74, 56.96, 0, ''), +(16993, 22, -693.70, 4185.43, 57.06, 0, ''), +(16993, 23, -686.38, 4159.81, 60.26, 0, ''), +(16993, 24, -679.88, 4147.04, 64.20, 0, ''), +(16993, 25, -656.74, 4147.72, 64.11, 0, ''), +(16993, 26, -652.22, 4137.50, 64.58, 0, ''), +(16993, 27, -649.99, 4136.38, 64.63, 30000, 'Quest Credit'); + +DELETE FROM script_waypoint WHERE entry=17077; +INSERT INTO script_waypoint VALUES +(17077, 0, -16.950142, 3801.409424, 95.064, 5000, 'EMOTE_WOLF_LIFT_HEAD'), +(17077, 1, -15.577404, 3805.170898, 94.833, 2500, ''), +(17077, 2, -20.011766, 3806.609863, 92.476, 5000, 'EMOTE_WOLF_HOWL'), +(17077, 3, -18.594666, 3816.207764, 91.482, 0, ''), +(17077, 4, -19.293468, 3838.218750, 85.012, 0, ''), +(17077, 5, -16.504408, 3871.034668, 82.327, 0, ''), +(17077, 6, 2.064510, 3898.678711, 85.623, 0, ''), +(17077, 7, 16.403864, 3921.174072, 86.024, 0, ''), +(17077, 8, 47.307926, 3932.001465, 83.302, 0, ''), +(17077, 9, 90.067230, 3942.906250, 77.000, 0, ''), +(17077, 10, 106.886024, 3944.388428, 76.502, 0, ''), +(17077, 11, 139.085480, 3941.897217, 80.617, 0, ''), +(17077, 12, 150.092346, 3942.782959, 80.399, 0, ''), +(17077, 13, 193.511475, 3950.396484, 74.366, 0, ''), +(17077, 14, 226.274948, 3958.003418, 73.257, 0, ''), +(17077, 15, 246.686981, 3963.309326, 76.376, 0, ''), +(17077, 16, 264.206177, 3977.726563, 83.704, 0, ''), +(17077, 17, 279.857422, 3986.417236, 88.245, 0, ''), +(17077, 18, 304.039642, 3998.354004, 95.649, 0, ''), +(17077, 19, 328.071503, 3995.832764, 104.434, 0, ''), +(17077, 20, 347.485229, 3990.817627, 113.608, 0, ''), +(17077, 21, 351.257202, 3954.260254, 125.747, 0, ''), +(17077, 22, 345.625977, 3932.016113, 132.358, 0, ''), +(17077, 23, 347.971893, 3908.549561, 135.520, 0, ''), +(17077, 24, 351.887878, 3891.062744, 139.957, 0, ''), +(17077, 25, 346.116852, 3864.634277, 146.647, 0, ''), +(17077, 26, 330.012360, 3839.859375, 154.148, 0, ''), +(17077, 27, 297.250610, 3811.855225, 166.893, 0, ''), +(17077, 28, 290.783112, 3800.188477, 172.130, 0, ''), +(17077, 29, 288.125427, 3782.474365, 180.825, 0, ''), +(17077, 30, 296.817841, 3771.629639, 184.961, 0, ''), +(17077, 31, 305.256256, 3765.380615, 185.360, 0, ''), +(17077, 32, 311.447906, 3757.902100, 184.312, 0, ''), +(17077, 33, 325.258026, 3730.282227, 184.076, 0, ''), +(17077, 34, 341.158630, 3717.757080, 183.904, 0, ''), +(17077, 35, 365.589020, 3717.200684, 183.902, 0, ''), +(17077, 36, 387.395081, 3731.750732, 183.645, 0, ''), +(17077, 37, 396.574127, 3732.604248, 179.831, 0, ''), +(17077, 38, 404.303192, 3737.313232, 180.151, 0, ''), +(17077, 39, 410.995972, 3742.286865, 183.364, 0, ''), +(17077, 40, 434.904541, 3761.058838, 186.219, 0, ''), +(17077, 41, 460.128815, 3774.436768, 186.348, 0, ''), +(17077, 42, 467.643951, 3788.506104, 186.446, 0, ''), +(17077, 43, 491.551666, 3815.446777, 189.848, 0, ''), +(17077, 44, 496.957855, 3836.875244, 193.078, 0, ''), +(17077, 45, 502.889191, 3855.458740, 194.834, 0, ''), +(17077, 46, 508.208466, 3863.689453, 194.024, 0, ''), +(17077, 47, 528.907593, 3887.348633, 189.762, 0, ''), +(17077, 48, 527.722229, 3890.686523, 189.240, 0, ''), +(17077, 49, 524.637329, 3891.768066, 189.149, 0, ''), +(17077, 50, 519.146057, 3886.701660, 190.128, 60000, 'SAY_WOLF_WELCOME'); + +DELETE FROM script_waypoint WHERE entry=17312; +INSERT INTO script_waypoint VALUES +(17312, 0, -4784.532227, -11051.060547, 3.484263, 0, ''), +(17312, 1, -4805.509277, -11037.293945, 3.043942, 0, ''), +(17312, 2, -4827.826172, -11034.398438, 1.741959, 0, ''), +(17312, 3, -4852.630859, -11033.695313, 2.208656, 0, ''), +(17312, 4, -4876.791992, -11034.517578, 3.175228, 0, ''), +(17312, 5, -4895.486816, -11038.306641, 9.390890, 0, ''), +(17312, 6, -4915.464844, -11048.402344, 12.369793, 0, ''), +(17312, 7, -4937.288086, -11067.041992, 13.857983, 0, ''), +(17312, 8, -4966.577637, -11067.507813, 15.754786, 0, ''), +(17312, 9, -4993.799805, -11056.544922, 19.175295, 0, ''), +(17312, 10, -5017.836426, -11052.569336, 22.476587, 0, ''), +(17312, 11, -5039.706543, -11058.459961, 25.831593, 0, ''), +(17312, 12, -5057.289063, -11045.474609, 26.972496, 0, ''), +(17312, 13, -5078.828125, -11037.601563, 29.053417, 0, ''), +(17312, 14, -5104.158691, -11039.195313, 29.440195, 0, ''), +(17312, 15, -5120.780273, -11039.518555, 30.142139, 0, ''), +(17312, 16, -5140.833008, -11039.810547, 28.788074, 0, ''), +(17312, 17, -5161.201660, -11040.050781, 27.879545, 4000, ''), +(17312, 18, -5171.842285, -11046.803711, 27.183821, 0, ''), +(17312, 19, -5185.995117, -11056.359375, 20.234867, 0, ''), +(17312, 20, -5198.485840, -11065.065430, 18.872593, 0, ''), +(17312, 21, -5214.062500, -11074.653320, 19.215731, 0, ''), +(17312, 22, -5220.157227, -11088.377930, 19.818476, 0, ''), +(17312, 23, -5233.652832, -11098.846680, 18.349432, 0, ''), +(17312, 24, -5250.163086, -11111.653320, 16.438959, 0, ''), +(17312, 25, -5268.194336, -11125.639648, 12.668313, 0, ''), +(17312, 26, -5286.270508, -11130.669922, 6.912246, 0, ''), +(17312, 27, -5317.449707, -11137.392578, 4.963446, 0, ''), +(17312, 28, -5334.854492, -11154.384766, 6.742664, 0, ''), +(17312, 29, -5353.874512, -11171.595703, 6.903912, 20000, ''), +(17312, 30, -5354.240000, -11171.940000, 6.890000, 0, ''); + +DELETE FROM script_waypoint WHERE entry=17876; +INSERT INTO script_waypoint VALUES +(17876, 0, 2230.91, 118.765, 82.2947,5000, ''), +(17876, 1, 2230.33, 114.980, 82.2946, 0, ''), +(17876, 2, 2233.36, 111.057, 82.2996, 0, ''), +(17876, 3, 2231.17, 108.486, 82.6624, 0, ''), +(17876, 4, 2220.22, 114.605, 89.4264, 0, ''), +(17876, 5, 2215.23, 115.990, 89.4549, 0, ''), +(17876, 6, 2210.00, 106.849, 89.4549, 0, ''), +(17876, 7, 2205.66, 105.234, 89.4549, 0, ''), +(17876, 8, 2192.26, 112.618, 89.4549, 0, 'spawn armorer'), +(17876, 9, 2181.28, 118.612, 89.4549,8000, 'get weapon'), +(17876, 10, 2181.62, 120.385, 89.4549,5000, 'get armor'), +(17876, 11, 2189.44, 113.922, 89.4549, 0, ''), +(17876, 12, 2195.63, 110.584, 89.4549, 0, ''), +(17876, 13, 2201.09, 115.115, 89.4549, 0, ''), +(17876, 14, 2204.34, 121.036, 89.4355, 0, ''), +(17876, 15, 2208.66, 129.127, 87.9560, 0, 'first ambush'), +(17876, 16, 2193.09, 137.940, 88.2164, 0, ''), +(17876, 17, 2173.39, 149.064, 87.9227, 0, ''), +(17876, 18, 2164.25, 137.965, 85.0595, 0, ''), +(17876, 19, 2149.31, 125.645, 77.0858, 0, ''), +(17876, 20, 2142.78, 127.173, 75.5954, 0, ''), +(17876, 21, 2139.28, 133.952, 73.6386, 0, 'second ambush'), +(17876, 22, 2139.54, 155.235, 67.1269, 0, ''), +(17876, 23, 2145.38, 167.551, 64.8974, 0, ''), +(17876, 24, 2134.28, 175.304, 67.9446, 0, ''), +(17876, 25, 2118.08, 187.387, 68.8141, 0, ''), +(17876, 26, 2105.88, 195.461, 65.1854, 0, 'third ambush'), +(17876, 27, 2096.77, 196.939, 65.2117, 0, ''), +(17876, 28, 2083.90, 209.395, 64.8736, 0, ''), +(17876, 29, 2067.84, 224.376, 64.8022,30000, 'meeting scarloc'), +(17876, 30, 2055.40, 242.90, 63.3418, 0, 'after skarloc'), +(17876, 31, 2039.20, 266.460, 63.0182,10000, 'mount up'), +(17876, 32, 2011.77, 278.478, 65.3388, 0, ''), +(17876, 33, 2005.08, 289.676, 66.1179, 0, ''), +(17876, 34, 2033.11, 337.450, 66.0948, 0, ''), +(17876, 35, 2070.30, 416.208, 66.0893, 0, ''), +(17876, 36, 2086.76, 469.768, 65.9182, 0, ''), +(17876, 37, 2101.70, 497.955, 61.7881, 0, 'road ambush'), +(17876, 38, 2133.39, 530.933, 55.3700,5000, ''), +(17876, 39, 2157.91, 559.635, 48.5157, 0, ''), +(17876, 40, 2167.34, 586.191, 42.4394, 0, ''), +(17876, 41, 2174.17, 637.643, 33.9002, 0, ''), +(17876, 42, 2179.31, 656.053, 34.723, 0, ''), +(17876, 43, 2183.65, 670.941, 34.0318, 0, ''), +(17876, 44, 2201.50, 668.616, 36.1236, 0, ''), +(17876, 45, 2221.56, 652.747, 36.6153, 0, ''), +(17876, 46, 2238.97, 640.125, 37.2214, 0, ''), +(17876, 47, 2251.17, 620.574, 40.1473, 0, ''), +(17876, 48, 2261.98, 595.303, 41.4117, 0, ''), +(17876, 49, 2278.67, 560.172, 38.9090, 0, ''), +(17876, 50, 2336.72, 528.327, 40.9369, 0, ''), +(17876, 51, 2381.04, 519.612, 37.7312, 0, ''), +(17876, 52, 2412.20, 515.425, 39.2068, 0, ''), +(17876, 53, 2452.39, 516.174, 42.9387, 0, ''), +(17876, 54, 2467.38, 539.389, 47.4992, 0, ''), +(17876, 55, 2470.70, 554.333, 46.6668, 0, ''), +(17876, 56, 2478.07, 575.321, 55.4549, 0, ''), +(17876, 57, 2480.00, 585.408, 56.6921, 0, ''), +(17876, 58, 2482.67, 608.817, 55.6643, 0, ''), +(17876, 59, 2485.62, 626.061, 58.0132, 2000, 'dismount'), +(17876, 60, 2486.91, 626.356, 58.0761, 0, 'scare horse'), +(17876, 61, 2488.58, 660.940, 57.3913, 0, ''), +(17876, 62, 2502.56, 686.059, 55.6252, 0, ''), +(17876, 63, 2502.08, 694.360, 55.5083, 0, ''), +(17876, 64, 2491.46, 694.321, 55.7163, 0, ''), +(17876, 65, 2491.10, 703.300, 55.7630, 0, ''), +(17876, 66, 2485.64, 702.992, 55.7917, 0, ''), +(17876, 67, 2479.10, 695.291, 55.7901, 10000, ''), +(17876, 68, 2476.75, 693.689, 55.7960, 0, 'spawn mobs'), +(17876, 69, 2475.39, 695.983, 55.8146, 0, ''), +(17876, 70, 2477.75, 694.473, 55.7945, 0, ''), +(17876, 71, 2481.27, 697.747, 55.7910, 0, 'mobs in doorway'), +(17876, 72, 2486.31, 703.131, 55.7861, 5000, ''), +(17876, 73, 2490.76, 703.511, 55.7662, 0, ''), +(17876, 74, 2491.30, 694.792, 55.7195, 0, ''), +(17876, 75, 2518.69, 693.876, 55.1383, 0, ''), +(17876, 76, 2531.33, 681.914, 55.1383, 0, ''), +(17876, 77, 2568.25, 682.654, 55.1778, 0, ''), +(17876, 78, 2589.61, 689.981, 55.1421, 0, ''), +(17876, 79, 2634.74, 679.833, 54.6613, 0, ''), +(17876, 80, 2630.41, 661.464, 54.2761, 0, ''), +(17876, 81, 2629.00, 656.982, 56.0651, 0, ''), +(17876, 82, 2620.84, 633.007, 56.0300, 3000, 'stop in church'), +(17876, 83, 2622.99, 639.178, 56.0300, 0, 'summon'), +(17876, 84, 2628.73, 656.693, 56.0610, 5000, ''), +(17876, 85, 2630.34, 661.135, 54.2738, 0, ''), +(17876, 86, 2635.38, 672.243, 54.4508, 0, ''), +(17876, 87, 2644.13, 668.158, 55.3797, 0, ''), +(17876, 88, 2646.82, 666.740, 56.9898, 0, ''), +(17876, 89, 2658.22, 665.432, 57.1725, 0, ''), +(17876, 90, 2661.88, 674.849, 57.1725, 0, ''), +(17876, 91, 2656.23, 677.208, 57.1725, 0, ''), +(17876, 92, 2652.28, 670.270, 61.9353, 0, ''), +(17876, 93, 2650.79, 664.290, 61.9302, 0, 'summon inn'), +(17876, 94, 2658.19, 660.454, 61.9320, 5000, ''), +(17876, 95, 2660.57, 659.173, 61.9370, 0, 'speak with Taretha'), +(17876, 96, 2658.19, 660.454, 61.9320, 15000, 'epoch calls'), +(17876, 97, 2659.84, 659.482, 61.9361, 10000, 'taretha "dies"'), +(17876, 98, 2654.28, 662.722, 61.9313, 0, ''), +(17876, 99, 2652.37, 670.561, 61.9368, 0, ''), +(17876, 100, 2656.05, 676.761, 57.1727, 0, ''), +(17876, 101, 2658.49, 677.166, 57.1727, 0, ''), +(17876, 102, 2659.28, 667.117, 57.1727, 0, ''), +(17876, 103, 2649.71, 665.387, 57.1727, 0, ''), +(17876, 104, 2634.79, 672.964, 54.4577, 0, 'outside inn'), +(17876, 105, 2635.06, 673.892, 54.4713, 30000, 'getting ready'), +(17876, 106, 2630.45, 674.420, 54.4943, 5000, 'when all dead and meet Taretha'), +(17876, 107, 2634.30, 661.698, 54.4147, 0, 'run off'), +(17876, 108, 2652.21, 644.396, 56.1906, 0, ''); + +DELETE FROM script_waypoint WHERE entry=17969; +INSERT INTO script_waypoint VALUES +(17969, 0, -930.048950, 5288.080078, 23.848402, 0, ''), +(17969, 1, -925.677917, 5296.482910, 18.183748, 0, ''), +(17969, 2, -924.297180, 5299.016113, 17.710915, 0, ''), +(17969, 3, -928.390076, 5317.022949, 18.208593, 0, ''), +(17969, 4, -930.620972, 5329.915039, 18.773422, 0, 'SAY_AMBUSH1'), +(17969, 5, -931.490295, 5357.654785, 18.027155, 0, 'SAY_PROGRESS'), +(17969, 6, -934.777771, 5369.341797, 22.278048, 0, ''), +(17969, 7, -934.521851, 5373.407227, 22.834690, 0, ''), +(17969, 8, -937.008545, 5382.980469, 22.699078, 0, ''), +(17969, 9, -941.948059, 5404.141602, 22.669743, 0, ''), +(17969, 10, -931.244263, 5415.846680, 23.063961, 0, 'at crossroad'), +(17969, 11, -901.497925, 5420.315430, 24.213270, 0, ''), +(17969, 12, -860.311707, 5415.617676, 23.671139, 0, ''), +(17969, 13, -777.988953, 5391.982422, 23.001669, 0, ''), +(17969, 14, -750.362000, 5385.786621, 22.765791, 0, ''), +(17969, 15, -731.339417, 5382.449707, 22.517065, 0, ''), +(17969, 16, -681.235901, 5381.377930, 22.050159, 2500, 'end bridge SAY_AMBUSH2'), +(17969, 17, -637.944458, 5384.338379, 22.205647, 0, 'SAY_END'), +(17969, 18, -608.954407, 5408.715332, 21.630386, 0, ''), +(17969, 19, -598.134277, 5413.608398, 21.412275, 0, ''), +(17969, 20, -571.268982, 5420.771973, 21.184925, 0, ''), +(17969, 21, -553.099915, 5424.616211, 21.193716, 0, ''), +(17969, 22, -524.745483, 5443.945313, 20.977013, 0, ''), +(17969, 23, -502.984985, 5446.283691, 22.149435, 0, ''), +(17969, 24, -472.463959, 5449.546875, 22.561453, 0, ''), +(17969, 25, -454.533264, 5461.302246, 22.602837, 30000, 'quest complete'); + +DELETE FROM script_waypoint WHERE entry=18210; +INSERT INTO script_waypoint VALUES +(18210, 0, -1581.410034, 8557.933594, 2.726, 0, ''), +(18210, 1, -1579.908447, 8553.716797, 2.559, 0, ''), +(18210, 2, -1577.829102, 8549.880859, 2.001, 0, ''), +(18210, 3, -1571.161987, 8543.494141, 2.001, 0, ''), +(18210, 4, -1563.944824, 8530.334961, 1.605, 0, ''), +(18210, 5, -1554.565552, 8518.413086, 0.364, 0, ''), +(18210, 6, -1549.239136, 8515.518555, 0.293, 0, ''), +(18210, 7, -1518.490112, 8516.771484, 0.683, 2000, 'SAY_MAG_MORE'), +(18210, 8, -1505.038940, 8513.247070, 0.672, 0, ''), +(18210, 9, -1476.161133, 8496.066406, 2.157, 0, ''), +(18210, 10, -1464.450684, 8492.601563, 3.529, 0, ''), +(18210, 11, -1457.568359, 8492.183594, 4.449, 0, ''), +(18210, 12, -1444.100342, 8499.031250, 6.177, 0, ''), +(18210, 13, -1426.472168, 8510.116211, 7.686, 0, ''), +(18210, 14, -1403.685303, 8524.146484, 9.680, 0, ''), +(18210, 15, -1384.890503, 8542.014648, 11.180, 0, ''), +(18210, 16, -1382.286133, 8539.869141, 11.139, 7500, 'SAY_MAG_COMPLETE'), +(18210, 17, -1361.224609, 8521.440430, 11.144, 0, ''), +(18210, 18, -1324.803589, 8510.688477, 13.050, 0, ''), +(18210, 19, -1312.075439, 8492.709961, 14.235, 0, ''); + +DELETE FROM script_waypoint WHERE entry=18731; +INSERT INTO script_waypoint VALUES +(18731, 0, -157.366, 2.177, 8.073, 0, ''), +(18731, 1, -172.266, -18.280, 8.073, 0, ''), +(18731, 2, -171.051, -38.748, 8.073, 0, ''), +(18731, 3, -170.718, -59.436, 8.073, 0, ''), +(18731, 4, -156.659, -72.118, 8.073, 0, ''), +(18731, 5, -142.292, -59.423, 8.073, 0, ''), +(18731, 6, -141.779, -38.972, 8.073, 0, ''), +(18731, 7, -142.922, -18.950, 8.073, 0, ''), +(18731, 8, -157.366, 2.177, 8.073, 0, ''); + +DELETE FROM script_waypoint WHERE entry=18887; +INSERT INTO script_waypoint VALUES +(18887, 0, 2650.06, 665.473, 61.9305, 0, ''), +(18887, 1, 2652.44, 670.761, 61.9370, 0, ''), +(18887, 2, 2655.96, 676.913, 57.1725, 0, ''), +(18887, 3, 2659.40, 677.317, 57.1725, 0, ''), +(18887, 4, 2651.75, 664.482, 57.1725, 0, ''), +(18887, 5, 2647.49, 666.595, 57.0824, 0, ''), +(18887, 6, 2644.37, 668.167, 55.4182, 0, ''), +(18887, 7, 2638.57, 671.231, 54.5200, 60000, ''), +(18887, 8, 2636.56, 679.894, 54.6595, 0, ''), +(18887, 9, 2640.79, 689.647, 55.3215, 0, ''), +(18887, 10, 2639.35, 706.777, 56.0667, 0, ''), +(18887, 11, 2617.70, 731.884, 55.5571, 0, ''); + +DELETE FROM script_waypoint WHERE entry=19685; +INSERT INTO script_waypoint VALUES +(19685, 0, -1860.536987, 5416.987793, -10.480, 2500, ''), +(19685, 1, -1855.899048, 5412.805664, -12.427, 0, 'SAY_KHAD_SERV_0'), +(19685, 2, -1845.518433, 5385.352539, -12.427, 0, ''), +(19685, 3, -1815.247803, 5340.255371, -12.427, 0, ''), +(19685, 4, -1799.338379, 5312.777344, -12.427, 0, ''), +(19685, 5, -1780.491455, 5278.535156, -33.877, 2500, 'pause'), +(19685, 6, -1776.057983, 5270.247559, -38.809, 0, ''), +(19685, 7, -1772.219727, 5262.777344, -38.810, 0, ''), +(19685, 8, -1762.195557, 5261.720215, -38.850, 0, ''), +(19685, 9, -1759.242798, 5259.751465, -40.208, 0, ''), +(19685, 10, -1743.427612, 5259.661621, -40.208, 0, ''), +(19685, 11, -1744.361816, 5251.179199, -44.523, 0, ''), +(19685, 12, -1740.121582, 5240.120117, -47.740, 0, ''), +(19685, 13, -1737.636719, 5238.288086, -49.793, 0, ''), +(19685, 14, -1727.411621, 5233.874512, -50.477, 0, ''), +(19685, 15, -1707.489746, 5230.437988, -51.050, 0, ''), +(19685, 16, -1684.122925, 5223.633301, -49.415, 0, ''), +(19685, 17, -1669.973267, 5221.929688, -46.336, 0, ''), +(19685, 18, -1662.870117, 5221.712891, -44.959, 0, ''), +(19685, 19, -1657.170410, 5225.206055, -45.708, 0, ''), +(19685, 20, -1645.025635, 5238.360352, -40.212, 0, ''), +(19685, 21, -1631.657471, 5252.759766, -40.962, 0, ''), +(19685, 22, -1631.368286, 5276.543945, -41.032, 0, ''), +(19685, 23, -1621.732544, 5298.553711, -40.209, 0, ''), +(19685, 24, -1615.498169, 5298.098145, -40.209, 2500, 'pause'), +(19685, 25, -1636.979370, 5302.677734, -40.209, 0, ''), +(19685, 26, -1655.330322, 5315.736328, -40.207, 0, ''), +(19685, 27, -1656.884155, 5321.649414, -40.209, 0, ''), +(19685, 28, -1663.975586, 5335.206055, -46.526, 0, ''), +(19685, 29, -1659.141602, 5359.131836, -45.846, 0, ''), +(19685, 30, -1644.207520, 5390.886230, -45.542, 0, ''), +(19685, 31, -1646.183594, 5405.273926, -44.649, 0, ''), +(19685, 32, -1650.202637, 5414.541992, -46.324, 0, ''), +(19685, 33, -1656.052490, 5424.683594, -40.461, 0, ''), +(19685, 34, -1661.628296, 5423.929199, -40.405, 0, ''), +(19685, 35, -1664.651855, 5423.659180, -38.848, 0, ''), +(19685, 36, -1681.772339, 5425.999512, -38.809, 0, ''), +(19685, 37, -1729.785767, 5427.246094, -12.445, 0, ''), +(19685, 38, -1735.371460, 5423.663086, -12.427, 0, ''), +(19685, 39, -1741.627075, 5386.767578, -12.427, 0, ''), +(19685, 40, -1764.786133, 5363.735840, -12.427, 0, ''), +(19685, 41, -1816.372314, 5340.664063, -12.427, 0, ''), +(19685, 42, -1880.022705, 5309.796387, -12.427, 0, ''), +(19685, 43, -1887.374146, 5315.426270, -12.427, 0, ''), +(19685, 44, -1888.768066, 5324.518066, -5.146, 0, ''), +(19685, 45, -1888.399170, 5334.149902, 0.151, 0, ''), +(19685, 46, -1890.221680, 5337.659668, 0.921, 0, ''), +(19685, 47, -1897.542725, 5323.042969, 1.256, 0, ''), +(19685, 48, -1900.250244, 5319.804688, 0.831, 0, ''), +(19685, 49, -1910.039673, 5291.258789, 1.288, 0, ''), +(19685, 50, -1915.219482, 5275.572266, 2.502, 2500, 'pause'), +(19685, 51, -1927.226196, 5273.250977, 2.703, 0, ''), +(19685, 52, -1926.980225, 5278.467285, 0.109, 0, ''), +(19685, 53, -1927.665894, 5299.210449, -12.427, 0, ''), +(19685, 54, -1922.841797, 5319.263672, -12.427, 0, ''), +(19685, 55, -1925.779053, 5347.405273, -12.427, 0, ''), +(19685, 56, -1954.912476, 5384.230957, -12.427, 0, ''), +(19685, 57, -1966.727295, 5428.203613, -12.427, 0, ''), +(19685, 58, -1979.477661, 5448.415527, -12.427, 0, ''), +(19685, 59, -1977.533569, 5453.861328, -12.385, 0, ''), +(19685, 60, -1968.064087, 5455.781250, -4.343, 0, ''), +(19685, 61, -1959.223145, 5454.895020, 0.202, 0, ''), +(19685, 62, -1954.629028, 5457.011230, 0.900, 0, ''), +(19685, 63, -1967.760010, 5464.953125, 1.220, 2500, 'pause'), +(19685, 64, -1952.874023, 5462.962402, 0.956, 0, ''), +(19685, 65, -1955.339478, 5467.116699, 0.445, 0, ''), +(19685, 66, -1962.033203, 5472.804688, -4.243, 0, ''), +(19685, 67, -1968.007690, 5480.914551, -12.427, 0, ''), +(19685, 68, -1945.900146, 5515.948242, -12.427, 0, ''), +(19685, 69, -1874.867310, 5549.783691, -12.427, 0, ''), +(19685, 70, -1840.641602, 5544.234375, -12.427, 0, ''), +(19685, 71, -1838.963501, 5536.059570, -5.639, 0, ''), +(19685, 72, -1839.582275, 5525.627930, 0.193, 0, ''), +(19685, 73, -1837.931763, 5521.119629, 0.844, 0, ''), +(19685, 74, -1829.182495, 5533.433594, 1.209, 2500, 'pause'), +(19685, 75, -1848.397095, 5476.073730, 0.856, 40000, 'end'); + +DELETE FROM script_waypoint WHERE entry=20129; +INSERT INTO script_waypoint VALUES +(20129, 0, -8374.93,-4250.21, -204.38,5000, ''), +(20129, 1, -8374.93,-4250.21, -204.38,16000, ''), +(20129, 2, -8374.93,-4250.21, -204.38,10000, ''), +(20129, 3, -8374.93,-4250.21, -204.38,2000, ''), +(20129, 4, -8439.40,-4180.05, -209.25, 0, ''), +(20129, 5, -8437.82,-4120.84, -208.59,10000, ''), +(20129, 6, -8437.82,-4120.84, -208.59,16000, ''), +(20129, 7, -8437.82,-4120.84, -208.59,13000, ''), +(20129, 8, -8437.82,-4120.84, -208.59,18000, ''), +(20129, 9, -8437.82,-4120.84, -208.59,15000, ''), +(20129, 10, -8437.82,-4120.84, -208.59,2000, ''), +(20129, 11, -8467.26,-4198.63, -214.21, 0, ''), +(20129, 12, -8667.76,-4252.13, -209.56, 0, ''), +(20129, 13, -8703.71,-4234.58, -209.5,14000, ''), +(20129, 14, -8703.71,-4234.58, -209.5,2000, ''), +(20129, 15, -8642.81,-4304.37, -209.57, 0, ''), +(20129, 16, -8649.06,-4394.36, -208.46,6000, ''), +(20129, 17, -8649.06,-4394.36, -208.46,18000, ''), +(20129, 18, -8649.06,-4394.36, -208.46,2000, ''), +(20129, 19, -8468.72,-4437.67, -215.45, 0, ''), +(20129, 20, -8427.54,-4426, -211.13, 0, ''), +(20129, 21, -8364.83,-4393.32, -205.91, 0, ''), +(20129, 22, -8304.54,-4357.2, -208.2,18000, ''), +(20129, 23, -8304.54,-4357.2, -208.2,2000, ''), +(20129, 24, -8375.42,-4250.41, -205.14,5000, ''), +(20129, 25, -8375.42,-4250.41, -205.14,5000, ''); + +DELETE FROM script_waypoint WHERE entry=20415; +INSERT INTO script_waypoint VALUES +(20415, 0, 2488.77, 2184.89, 104.64, 0, ""), +(20415, 1, 2478.72, 2184.77, 98.58, 0, ""), +(20415, 2, 2473.52, 2184.71, 99.00, 0, ""), +(20415, 3, 2453.15, 2184.96, 97.09,4000, ""), +(20415, 4, 2424.18, 2184.15, 94.11, 0, ""), +(20415, 5, 2413.18, 2184.15, 93.42, 0, ""), +(20415, 6, 2402.02, 2183.90, 87.59, 0, ""), +(20415, 7, 2333.31, 2181.63, 90.03,4000, ""), +(20415, 8, 2308.73, 2184.34, 92.04, 0, ""), +(20415, 9, 2303.10, 2196.89, 94.94, 0, ""), +(20415, 10, 2304.58, 2272.23, 96.67, 0, ""), +(20415, 11, 2297.09, 2271.40, 95.16, 0, ""), +(20415, 12, 2297.68, 2266.79, 95.07,4000, ""), +(20415, 13, 2297.67, 2266.76, 95.07,4000, ""); + +DELETE FROM script_waypoint WHERE entry=21027; +INSERT INTO script_waypoint VALUES +(21027, 0, -2714.697266, 1326.879395, 34.306953, 0, ''), +(21027, 1, -2666.364990, 1348.222656, 34.445557, 0, ''), +(21027, 2, -2693.789307, 1336.964966, 34.445557, 0, ''), +(21027, 3, -2715.495361, 1328.054443, 34.106014, 0, ''), +(21027, 4, -2742.530762, 1314.138550, 33.606144, 0, ''), +(21027, 5, -2745.077148, 1311.108765, 33.630898, 0, ''), +(21027, 6, -2749.855225, 1302.737915, 33.475632, 0, ''), +(21027, 7, -2753.639648, 1294.059448, 33.314930, 0, ''), +(21027, 8, -2756.796387, 1285.122192, 33.391262, 0, ''), +(21027, 9, -2750.042969, 1273.661987, 33.188259, 0, ''), +(21027, 10, -2740.378418, 1258.846680, 33.212521, 0, ''), +(21027, 11, -2733.629395, 1248.259766, 33.640598, 0, ''), +(21027, 12, -2727.212646, 1238.606445, 33.520847, 0, ''), +(21027, 13, -2726.377197, 1237.264526, 33.461823, 3000, 'SAY_WIL_PROGRESS1'), +(21027, 14, -2746.383301, 1266.390625, 33.191952, 2000, ''), +(21027, 15, -2746.383301, 1266.390625, 33.191952, 4000, 'SAY_WIL_FIND_EXIT'), +(21027, 16, -2758.927734, 1285.134155, 33.341728, 0, ''), +(21027, 17, -2761.845703, 1292.313599, 33.209042, 0, ''), +(21027, 18, -2758.871826, 1300.677612, 33.285332, 0, ''), +(21027, 19, -2753.928955, 1307.755859, 33.452457, 0, ''), +(21027, 20, -2738.612061, 1316.191284, 33.482975, 0, ''), +(21027, 21, -2727.897461, 1320.013916, 33.381111, 0, ''), +(21027, 22, -2709.458740, 1315.739990, 33.301838, 0, ''), +(21027, 23, -2704.658936, 1301.620361, 32.463303, 0, ''), +(21027, 24, -2704.120117, 1298.922607, 32.768162, 0, ''), +(21027, 25, -2691.798340, 1292.846436, 33.852642, 0, ''), +(21027, 26, -2682.879639, 1288.853882, 32.995399, 0, ''), +(21027, 27, -2661.869141, 1279.682495, 26.686783, 0, ''), +(21027, 28, -2648.943604, 1270.272827, 24.147522, 0, ''), +(21027, 29, -2642.506836, 1262.938721, 23.512444, 0, ''), +(21027, 30, -2636.984863, 1252.429077, 20.418257, 0, ''), +(21027, 31, -2648.113037, 1224.984863, 8.691818, 0, ''), +(21027, 32, -2658.393311, 1200.136719, 5.492243, 0, ''), +(21027, 33, -2668.504395, 1190.450562, 3.127407, 0, ''), +(21027, 34, -2685.930420, 1174.360840, 5.163924, 0, ''), +(21027, 35, -2701.613770, 1160.026367, 5.611311, 0, ''), +(21027, 36, -2714.659668, 1149.980347, 4.342373, 0, ''), +(21027, 37, -2721.443359, 1145.002808, 1.913474, 0, ''), +(21027, 38, -2733.962158, 1143.436279, 2.620415, 0, ''), +(21027, 39, -2757.876709, 1146.937500, 6.184002, 2000, 'SAY_WIL_JUST_AHEAD'), +(21027, 40, -2772.300537, 1166.052734, 6.331811, 0, ''), +(21027, 41, -2790.265381, 1189.941650, 5.207958, 0, ''), +(21027, 42, -2805.448975, 1208.663940, 5.557623, 0, ''), +(21027, 43, -2820.617676, 1225.870239, 6.266103, 0, ''), +(21027, 44, -2831.926758, 1237.725830, 5.808506, 0, ''), +(21027, 45, -2842.578369, 1252.869629, 6.807481, 0, ''), +(21027, 46, -2846.344971, 1258.727295, 7.386168, 0, ''), +(21027, 47, -2847.556396, 1266.771729, 8.208790, 0, ''), +(21027, 48, -2841.654541, 1285.809204, 7.933223, 0, ''), +(21027, 49, -2841.754883, 1289.832520, 6.990304, 0, ''), +(21027, 50, -2871.398438, 1302.348145, 6.807335, 7500, 'SAY_WIL_END'); + +DELETE FROM script_waypoint WHERE entry=22377; +INSERT INTO script_waypoint VALUES +(22377, 0, -2770.457520, 5418.410645, -34.538, 0, ''), +(22377, 1, -2778.180420, 5416.253906, -34.538, 0, ''), +(22377, 2, -2816.960449, 5414.944336, -34.529, 0, ''), +(22377, 3, -2827.533203, 5414.737305, -28.265, 0, ''), +(22377, 4, -2841.610596, 5413.021973, -28.261, 0, ''), +(22377, 5, -2863.605957, 5411.964355, -28.262, 1000, 'SAY_AKU_AMBUSH_A'), +(22377, 6, -2874.559570, 5413.799316, -28.260, 0, ''), +(22377, 7, -2878.775879, 5413.812012, -28.261, 0, ''), +(22377, 8, -2892.586914, 5413.478516, -18.784, 0, ''), +(22377, 9, -2896.040527, 5413.137207, -18.589, 0, ''), +(22377, 10, -2896.318848, 5409.431641, -18.450, 0, ''), +(22377, 11, -2895.997803, 5396.909668, -8.855, 0, ''), +(22377, 12, -2895.734131, 5386.623535, -9.260, 0, ''), +(22377, 13, -2895.318359, 5367.613281, -9.456, 0, ''), +(22377, 14, -2890.306641, 5353.883301, -11.280, 1000, 'SAY_AKU_AMBUSH_B'), +(22377, 15, -2880.419189, 5334.625977, -10.629, 0, ''), +(22377, 16, -2866.394043, 5314.253906, -9.678, 0, ''), +(22377, 17, -2864.753174, 5277.734375, -11.087, 0, ''), +(22377, 18, -2856.330322, 5255.902344, -11.496, 5000, 'SAY_AKU_COMPLETE'); + +DELETE FROM script_waypoint WHERE entry=22458; +INSERT INTO script_waypoint VALUES +(22458, 0, -3739.907959, 5393.691895, -4.213, 5000, 'SAY_LE_KEEP_SAFE'), +(22458, 1, -3733.334229, 5389.243164, -5.331, 0, ''), +(22458, 2, -3728.771729, 5385.649414, -3.704, 0, ''), +(22458, 3, -3717.267090, 5379.179199, -4.400, 0, ''), +(22458, 4, -3705.626465, 5379.261719, -7.711, 0, ''), +(22458, 5, -3688.279541, 5379.716309, -9.400, 0, ''), +(22458, 6, -3649.186523, 5389.111816, -11.917, 0, ''), +(22458, 7, -3612.791504, 5392.812500, -13.655, 0, ''), +(22458, 8, -3574.865479, 5412.704590, -16.543, 0, ''), +(22458, 9, -3564.438232, 5422.615723, -16.104, 0, ''), +(22458, 10, -3553.387695, 5444.732910, -12.184, 2500, 'arivve dig site SAY_LE_ARRIVE'), +(22458, 11, -3557.291016, 5465.319336, -9.282, 7500, 'dig 1'), +(22458, 12, -3548.102051, 5453.417969, -12.282, 10000, 'dig 2 SAY_LE_BURIED pause'), +(22458, 13, -3556.580322, 5446.475098, -11.920, 0, 'start returning'), +(22458, 14, -3564.438232, 5422.615723, -16.104, 0, ''), +(22458, 15, -3574.865479, 5412.704590, -16.543, 0, ''), +(22458, 16, -3612.791504, 5392.812500, -13.655, 0, ''), +(22458, 17, -3649.186523, 5389.111816, -11.917, 0, ''), +(22458, 18, -3688.279541, 5379.716309, -9.400, 0, ''), +(22458, 19, -3705.626465, 5379.261719, -7.711, 0, ''), +(22458, 20, -3717.267090, 5379.179199, -4.400, 0, ''), +(22458, 21, -3728.771729, 5385.649414, -3.704, 0, ''), +(22458, 22, -3733.334229, 5389.243164, -5.331, 0, ''), +(22458, 23, -3739.907959, 5393.691895, -4.213, 0, ''); + +DELETE FROM script_waypoint WHERE entry=22916; +INSERT INTO script_waypoint VALUES +(22916, 0, 7461.49, -3121.06, 438.210, 7000, 'SAY_START'), +(22916, 1, 7465.26, -3115.50, 439.315, 0, ''), +(22916, 2, 7470.03, -3109.29, 439.333, 0, ''), +(22916, 3, 7473.77, -3104.65, 442.366, 0, ''), +(22916, 4, 7478.67, -3098.55, 443.551, 0, ''), +(22916, 5, 7482.78, -3093.35, 441.883, 0, ''), +(22916, 6, 7486.23, -3089.19, 439.698, 0, ''), +(22916, 7, 7484.64, -3084.55, 439.566, 0, ''), +(22916, 8, 7477.09, -3084.43, 442.132, 0, ''), +(22916, 9, 7470.66, -3084.86, 443.194, 0, ''), +(22916, 10, 7456.51, -3085.83, 438.863, 0, ''), +(22916, 11, 7446.00, -3085.59, 438.210, 0, ''), +(22916, 12, 7444.60, -3084.10, 438.323, 0, ''), +(22916, 13, 7445.58, -3080.92, 439.374, 5000, 'collect 1'), +(22916, 14, 7446.18, -3085.36, 438.210, 5000, 'SAY_RELIC1'), +(22916, 15, 7453.90, -3086.69, 439.454, 0, ''), +(22916, 16, 7459.41, -3085.50, 439.158, 0, ''), +(22916, 17, 7465.90, -3085.01, 442.329, 0, ''), +(22916, 18, 7472.80, -3084.81, 443.085, 0, ''), +(22916, 19, 7480.58, -3084.56, 440.642, 0, ''), +(22916, 20, 7484.59, -3084.71, 439.568, 0, ''), +(22916, 21, 7491.81, -3090.55, 440.052, 0, ''), +(22916, 22, 7497.13, -3095.34, 437.505, 0, ''), +(22916, 23, 7496.61, -3113.62, 434.554, 0, ''), +(22916, 24, 7501.79, -3123.79, 435.347, 0, ''), +(22916, 25, 7506.60, -3130.78, 434.179, 0, ''), +(22916, 26, 7504.53, -3133.46, 435.579, 5000, 'collect 2'), +(22916, 27, 7505.20, -3130.03, 434.151, 15000, 'SAY_RELIC2'), +(22916, 28, 7502.04, -3124.44, 435.298, 0, ''), +(22916, 29, 7495.90, -3113.93, 434.538, 0, ''), +(22916, 30, 7488.79, -3111.10, 434.310, 0, ''), +(22916, 31, 7477.81, -3105.37, 430.541, 0, 'summon'), +(22916, 32, 7471.49, -3092.55, 429.006, 0, ''), +(22916, 33, 7472.35, -3062.72, 428.341, 0, ''), +(22916, 34, 7472.26, -3054.92, 427.150, 0, ''), +(22916, 35, 7475.03, -3053.39, 428.672, 5000, 'collect 3'), +(22916, 36, 7472.40, -3057.21, 426.870, 5000, 'SAY_RELIC3'), +(22916, 37, 7472.39, -3062.86, 428.301, 0, ''), +(22916, 38, 7470.24, -3087.69, 429.045, 0, ''), +(22916, 39, 7475.24, -3099.03, 429.917, 0, ''), +(22916, 40, 7484.24, -3109.85, 432.719, 0, ''), +(22916, 41, 7489.10, -3111.31, 434.400, 0, ''), +(22916, 42, 7497.02, -3108.54, 434.798, 0, ''), +(22916, 43, 7497.75, -3097.70, 437.031, 0, ''), +(22916, 44, 7492.53, -3090.12, 440.041, 0, ''), +(22916, 45, 7490.43, -3085.44, 439.807, 0, ''), +(22916, 46, 7501.02, -3069.70, 441.875, 0, ''), +(22916, 47, 7509.15, -3064.67, 445.012, 0, ''), +(22916, 48, 7515.78, -3060.16, 445.727, 0, ''), +(22916, 49, 7516.46, -3058.11, 445.682, 10000, 'quest credit'); + +DELETE FROM script_waypoint WHERE entry=23002; +INSERT INTO script_waypoint VALUES +(23002, 0, 3687.11, -3960.69, 31.8726, 0, ''), +(23002, 1, 3676.28, -3953.76, 29.9396, 0, ''), +(23002, 2, 3658.54, -3952.15, 30.0414, 0, ''), +(23002, 3, 3628.91, -3956.90, 29.4050, 0, ''), +(23002, 4, 3602.54, -3968.16, 31.5110, 0, ''), +(23002, 5, 3564.96, -3978.00, 30.3622, 0, ''), +(23002, 6, 3542.47, -3981.81, 29.1465, 0, ''), +(23002, 7, 3511.34, -3981.25, 30.2822, 0, ''), +(23002, 8, 3473.45, -3992.67, 30.2861, 0, ''), +(23002, 9, 3439.10, -4006.73, 29.2737, 0, ''), +(23002, 10, 3415.66, -4026.24, 25.2498, 0, ''), +(23002, 11, 3380.88, -4045.38, 26.3114, 0, ''), +(23002, 12, 3355.23, -4051.42, 25.5665, 0, ''), +(23002, 13, 3312.00, -4055.65, 28.3297, 0, ''), +(23002, 14, 3286.34, -4079.27, 28.2464, 0, ''), +(23002, 15, 3260.68, -4087.29, 31.4043, 0, ''), +(23002, 16, 3236.83, -4087.65, 32.6894, 0, ''), +(23002, 17, 3215.06, -4082.10, 32.4181, 0, ''), +(23002, 18, 3203.59, -4082.47, 32.7436, 0, ''), +(23002, 19, 3166.41, -4062.09, 33.2357, 0, ''), +(23002, 20, 3147.51, -4055.33, 33.5683, 0, ''), +(23002, 21, 3125.41, -4050.01, 34.6100, 0, ''), +(23002, 22, 3121.16, -4045.07, 36.5481, 0, ''), +(23002, 23, 3101.54, -4023.78, 33.7169, 0, ''), +(23002, 24, 3094.16, -4016.89, 33.8487, 0, ''), +(23002, 25, 3079.57, -4011.01, 35.7546, 0, ''), +(23002, 26, 3058.83, -4001.71, 34.3039, 0, ''), +(23002, 27, 3037.83, -3986.60, 33.4216, 0, ''), +(23002, 28, 3016.93, -3970.83, 33.3743, 0, ''), +(23002, 29, 2998.05, -3954.89, 33.2338, 0, ''), +(23002, 30, 2969.35, -3929.27, 33.4831, 0, ''), +(23002, 31, 2941.23, -3909.56, 31.3506, 0, ''), +(23002, 32, 2911.42, -3895.07, 32.0950, 0, ''), +(23002, 33, 2892.44, -3875.52, 30.8123, 0, ''), +(23002, 34, 2870.52, -3858.97, 32.1977, 0, ''), +(23002, 35, 2865.84, -3836.99, 32.1108, 0, ''), +(23002, 36, 2850.52, -3814.52, 32.8635, 0, ''), +(23002, 37, 2836.63, -3796.94, 33.1473, 0, ''), +(23002, 38, 2820.73, -3780.22, 28.6916, 0, ''), +(23002, 39, 2795.82, -3770.13, 30.1327, 0, ''), +(23002, 40, 2773.15, -3765.54, 30.2947, 0, ''), +(23002, 41, 2742.31, -3761.65, 30.1218, 0, ''), +(23002, 42, 2708.43, -3748.46, 21.2468, 0, ''), +(23002, 43, 2661.45, -3741.11, 21.9603, 0, ''), +(23002, 44, 2623.89, -3735.29, 25.8979, 0, ''), +(23002, 45, 2585.93, -3728.85, 28.5146, 0, ''), +(23002, 46, 2554.93, -3730.10, 26.6795, 0, ''), +(23002, 47, 2538.68, -3721.28, 28.1589, 0, ''), +(23002, 48, 2508.54, -3708.71, 29.6718, 0, ''), +(23002, 49, 2474.69, -3710.37, 31.0805, 0, ''), +(23002, 50, 2456.40, -3698.83, 31.6187, 0, ''), +(23002, 51, 2430.54, -3701.87, 31.0494, 0, ''), +(23002, 52, 2390.13, -3681.76, 29.5484, 0, ''), +(23002, 53, 2357.06, -3673.96, 29.8845, 0, ''), +(23002, 54, 2330.15, -3672.73, 31.1314, 0, ''), +(23002, 55, 2302.77, -3665.22, 29.4110, 0, ''), +(23002, 56, 2279.24, -3659.46, 29.6247, 0, ''), +(23002, 57, 2254.65, -3661.12, 29.6984, 0, ''), +(23002, 58, 2223.32, -3654.92, 31.0149, 0, ''), +(23002, 59, 2194.29, -3645.40, 32.0417, 0, ''), +(23002, 60, 2153.05, -3650.82, 31.2292, 0, ''), +(23002, 61, 2114.15, -3639.96, 31.7371, 0, ''), +(23002, 62, 2093.68, -3646.65, 31.3745, 0, ''), +(23002, 63, 2069.86, -3670.59, 30.6172, 0, ''), +(23002, 64, 2024.40, -3677.64, 29.7682, 0, ''), +(23002, 65, 1988.61, -3680.02, 31.8937, 0, ''), +(23002, 66, 1962.68, -3692.17, 32.7811, 0, ''), +(23002, 67, 1931.94, -3708.48, 31.3641, 0, ''), +(23002, 68, 1893.36, -3710.02, 33.0193, 0, ''), +(23002, 69, 1865.73, -3718.35, 32.1664, 0, ''), +(23002, 70, 1839.74, -3732.92, 32.5322, 0, ''), +(23002, 71, 1805.08, -3757.76, 32.6295, 0, ''), +(23002, 72, 1780.24, -3775.53, 30.5931, 0, ''), +(23002, 73, 1753.28, -3786.79, 30.7445, 0, ''), +(23002, 74, 1731.09, -3796.64, 36.8866, 0, ''); + +DELETE FROM script_waypoint WHERE entry=24358; +INSERT INTO script_waypoint VALUES +(24358, 0, 121.193970, 1645.619385, 42.021, 0, ''), +(24358, 1, 132.051468, 1642.176025, 42.021, 5000, 'SAY_AT_GONG'), +(24358, 2, 120.670631, 1636.346802, 42.415, 0, ''), +(24358, 3, 120.536003, 1611.654663, 43.473, 10000, 'SAY_OPEN_ENTRANCE'), +(24358, 4, 120.536003, 1611.654663, 43.473, 0, ''); + +DELETE FROM script_waypoint WHERE entry=28070; +INSERT INTO script_waypoint VALUES +(28070, 0, 1053.789795, 476.639343, 207.744, 0, ''), +(28070, 1, 1032.293945, 467.623444, 207.736, 0, ''), +(28070, 2, 1017.908752, 454.765656, 207.719, 0, ''), +(28070, 3, 1004.810120, 441.305115, 207.373, 0, ''), +(28070, 4, 988.694214, 424.422485, 207.425, 0, ''), +(28070, 5, 984.816345, 422.177917, 205.994, 0, ''), +(28070, 6, 977.204468, 420.026917, 205.994, 0, ''), +(28070, 7, 962.388123, 421.983307, 205.994, 0, ''), +(28070, 8, 950.419556, 416.515198, 205.994, 0, ''), +(28070, 9, 943.972290, 403.071228, 205.994, 0, ''), +(28070, 10, 947.921936, 387.683563, 205.994, 0, ''), +(28070, 11, 946.554749, 383.270782, 205.994, 0, ''), +(28070, 12, 944.654724, 380.630859, 207.286, 0, ''), +(28070, 13, 941.101563, 377.373413, 207.421, 0, 'reach tribunal, set pause'), +(28070, 14, 935.217896, 370.557343, 207.421, 0, ''), +(28070, 15, 928.035950, 363.026733, 204.018, 0, ''), +(28070, 16, 909.287292, 344.392792, 203.706, 0, ''), +(28070, 17, 897.946838, 333.634735, 203.706, 0, 'reach panel'), +(28070, 18, 918.914429, 351.312866, 203.706, 0, 'reach floor disc (end event begin)'), +(28070, 19, 928.070068, 363.296326, 204.091, 0, 'stealth'), +(28070, 20, 934.817627, 370.136261, 207.421, 0, ''), +(28070, 21, 941.501465, 377.254456, 207.421, 0, ''); + +DELETE FROM script_waypoint WHERE entry=28912; +INSERT INTO script_waypoint VALUES +(28912, 0, 1653.518, -6038.374, 127.585, 0, 'Jump off'), +(28912, 1, 1653.978, -6034.614, 127.585, 5000, 'To Box'), +(28912, 2, 1653.854, -6034.726, 127.585, 500, 'Equip'), +(28912, 3, 1652.297, -6035.671, 127.585, 3000, 'Recover'), +(28912, 4, 1639.762, -6046.343, 127.948, 0, 'Escape'), +(28912, 5, 1640.963, -6028.119, 134.740, 0, ''), +(28912, 6, 1625.805, -6029.197, 134.740, 0, ''), +(28912, 7, 1626.845, -6015.085, 134.740, 0, ''), +(28912, 8, 1649.150, -6016.975, 133.240, 0, ''), +(28912, 9, 1653.063, -5974.844, 132.652, 5000, 'Mount'), +(28912, 10, 1654.747, -5926.424, 121.191, 0, 'Disappear'); + +DELETE FROM script_waypoint WHERE entry=30658; +INSERT INTO script_waypoint VALUES +(30658, 0, 1830.504517, 799.356506, 44.341801, 5000, 'use activation'), +(30658, 1, 1832.461792, 800.431396, 44.311745, 10000, 'SAY_BEGIN call back guards'), +(30658, 2, 1824.786987, 803.828369, 44.363434, 0, 'SAY_LOCK_DOOR close door'), +(30658, 3, 1807.245483, 803.904114, 44.363434, 0, ''), +(30658, 4, 1785.160400, 803.856873, 44.364830, 30000, ''); + +DELETE FROM script_waypoint WHERE entry = 349; +INSERT INTO script_waypoint VALUES +(349, 01, -8769.591797, -2185.733643, 141.974564, 0, ''), +(349, 02, -8776.540039, -2193.782959, 140.960159, 0, ''), +(349, 03, -8783.289063, -2194.818604, 140.461731, 0, ''), +(349, 04, -8792.520508, -2188.802002, 142.077728, 0, ''), +(349, 05, -8807.547852, -2186.100830, 141.504135, 0, ''), +(349, 06, -8818, -2184.8, 139.153, 0, ''), +(349, 07, -8825.805664, -2188.840576, 138.458832, 0, ''), +(349, 08, -8827.522461, -2199.805664, 139.621933, 0, ''), +(349, 09, -8821.140625, -2212.642334, 143.126419, 0, ''), +(349, 10, -8809.175781, -2230.456299, 143.438431, 0, ''), +(349, 11, -8797.040039, -2240.718262, 146.548203, 0, ''), +(349, 12, -8795.242188, -2251.809814, 146.808044, 0, ''), +(349, 13, -8780.159180, -2258.615967, 148.553772, 0, ''), +(349, 14, -8762.650391, -2259.559326, 151.144241, 0, ''), +(349, 15, -8754.357422, -2253.735352, 152.243073, 0, ''), +(349, 16, -8741.869141, -2250.997070, 154.485718, 0, ''), +(349, 17, -8733.218750, -2251.010742, 154.360031, 0, ''), +(349, 18, -8717.474609, -2245.044678, 154.68614, 0, ''), +(349, 19, -8712.240234, -2246.826172, 154.709473, 0, ''), +(349, 20, -8693.840820, -2240.410889, 152.909714, 0, ''), +(349, 21, -8681.818359, -2245.332764, 155.517838, 0, ''), +(349, 22, -8669.86, -2252.77, 154.854, 0, ''), +(349, 23, -8670.56, -2264.69, 156.978, 0, ''), +(349, 24, -8676.557617, -2269.204346, 155.411316, 0, ''), +(349, 25, -8673.340820, -2288.650146, 157.054123, 0, ''), +(349, 26, -8677.760742, -2302.563965, 155.916580, 16000, 'Corp. Keeshan - Short Break Outside'), +(349, 27, -8682.462891, -2321.688232, 155.916946, 0, ''), +(349, 28, -8690.402344, -2331.779297, 155.970505, 0, ''), +(349, 29, -8715.1, -2353.95, 156.188, 0, ''), +(349, 30, -8748.042969, -2370.701904, 157.988342, 0, ''), +(349, 31, -8780.900391, -2421.370361, 156.108871, 0, ''), +(349, 32, -8792.009766, -2453.379883, 142.746002, 0, ''), +(349, 33, -8804.780273, -2472.429932, 134.192001, 0, ''), +(349, 34, -8841.348633, -2503.626221, 132.276138, 0, ''), +(349, 35, -8867.565430, -2529.892822, 134.738586, 0, ''), +(349, 36, -8870.67, -2542.08, 131.044, 0, ''), +(349, 37, -8922.05, -2585.31, 132.446, 0, ''), +(349, 38, -8949.08, -2596.87, 132.537, 0, ''), +(349, 39, -8993.460938, -2604.042725, 130.756210, 0, ''), +(349, 40, -9006.709961, -2598.469971, 127.966003, 0, ''), +(349, 41, -9038.96, -2572.71, 124.748, 0, ''), +(349, 42, -9046.92, -2560.64, 124.447, 0, ''), +(349, 43, -9066.693359, -2546.633301, 123.110138, 0, ''), +(349, 44, -9077.54, -2541.67, 121.17, 0, ''), +(349, 45, -9125.320313, -2490.059326, 116.057274, 0, ''), +(349, 46, -9145.063477, -2442.239990, 108.231689, 0, ''), +(349, 47, -9158.197266, -2425.363281, 105.500038, 0, ''), +(349, 48, -9151.922852, -2393.671631, 100.856010, 0, ''), +(349, 49, -9165.193359, -2376.031738, 94.821518, 0, ''), +(349, 50, -9187.099609, -2360.520020, 89.923103, 0, ''), +(349, 51, -9235.443359, -2305.239014, 77.925316, 0, ''), +(349, 52, -9264.73, -2292.92, 70.0089, 0, ''), +(349, 53, -9277.468750, -2296.188721, 68.089630, 2500, 'Corp. Keeshan - quest-finish'), +(349, 54, -9277.468750, -2296.188721, 68.089630, 0, 'Corp. Keeshan - Say Goodbye'); + +DELETE FROM script_waypoint WHERE entry=1379; +INSERT INTO script_waypoint VALUES +(1379,01,-5751.12,-3441.01,301.743,0,''), +(1379,02,-5738.58,-3485.14,302.410,0,''), +(1379,03,-5721.62,-3507.85,304.011,0,''), +(1379,04,-5710.21,-3527.97,304.708,0,''), +(1379,05,-5706.92,-3542.89,304.871,0,''), +(1379,06,-5701.53,-3551.24,305.962,0,''), +(1379,07,-5699.53,-3555.69,306.505,0,''), +(1379,08,-5690.56,-3571.98,309.035,0,''), +(1379,09,-5678.61,-3587.17,310.607,0,''), +(1379,10,-5677.05,-3594.35,311.527,0,''), +(1379,11,-5674.39,-3605.19,312.239,0,''), +(1379,12,-5674.45,-3614.39,312.337,0,''), +(1379,13,-5673.05,-3630.56,311.105,0,''), +(1379,14,-5680.34,-3645.44,315.185,0,''), +(1379,15,-5684.46,-3650.05,314.687,0,''), +(1379,16,-5693.9,-3674.14,313.03,0,''), +(1379,17,-5701.43,-3712.54,313.959,0,''), +(1379,18,-5698.79,-3720.88,316.943,0,''), +(1379,19,-5699.95,-3733.63,318.597,0,'Protecting the Shipment - Ambush'), +(1379,20,-5698.61,-3754.74,322.047,0,''), +(1379,21,-5688.68,-3769,323.957,0,''), +(1379,22,-5688.14,-3782.65,322.667,0,''), +(1379,23,-5699.23,-3792.65,322.448,30000,'Protecting the Shipment - End'), +(1379,24,-5700.80,-3792.78,322.588,0,''); + +DELETE FROM script_waypoint WHERE entry = 25208; +INSERT INTO script_waypoint VALUES +(25208,0,4013.51,6390.33,29.970,15000,'Lurgglbr - after escaped from cage'), +(25208,1,4023.06,6379.43,29.210,0,''), +(25208,2,4033.61,6370.94,28.430,0,''), +(25208,3,4052.03,6367.42,27.370,0,''), +(25208,4,4061.13,6353.36,25.450,0,''), +(25208,5,4064.28,6330.76,25.310,0,''), +(25208,6,4057.94,6307.85,24.900,0,''), +(25208,7,4057.40,6290.12,24.430,0,''), +(25208,8,4065.63,6277.64,23.900,0,''), +(25208,9,4080.71,6280.77,26.920,0,''), +(25208,10,4098.90,6279.00,25.950,0,''), +(25208,11,4118.00,6277.81,25.720,0,''), +(25208,12,4129.47,6281.65,28.860,0,''), +(25208,13,4143.86,6282.57,29.180,4000,'Lurgglbr - outside cave'), +(25208,14,4159.54,6280.08,30.520,0,''), +(25208,15,4171.95,6291.50,22.250,0,''), +(25208,16,4184.86,6293.45,16.570,0,''), +(25208,17,4194.14,6301.28,13.310,0,''), +(25208,18,4210.34,6285.81,09.500,0,''), +(25208,19,4220.05,6272.75,07.770,0,''), +(25208,20,4242.45,6272.24,01.750,0,''), +(25208,21,4257.79,6252.91,-0.050,0,''), +(25208,22,4256.81,6230.74,-0.090,0,''), +(25208,23,4241.09,6217.87,-0.140,0,''), +(25208,24,4254.66,6205.16,-0.170,0,''), +(25208,25,4270.07,6188.42,0.059,15000,'Lurgglbr - final point'); + +-- uncomment when it is implemented +-- DELETE FROM script_waypoint WHERE entry=7998; +-- INSERT INTO script_waypoint VALUES +-- (7998, 01, -510.1305, -132.6899, -152.5, 0, ''), +-- (7998, 02, -511.0994, -129.74, -153.8453, 0, ''), +-- (7998, 03, -511.7897, -127.4764, -155.5505, 0, ''), +-- (7998, 04, -512.9688, -124.926, -156.1146, 5000, ''), +-- (7998, 05, -513.9719, -120.2358, -156.1161, 0, ''), +-- (7998, 06, -514.3875, -115.1896, -156.1165, 0, ''), +-- (7998, 07, -514.3039, -111.4777, -155.5205, 0, ''), +-- (7998, 08, -514.8401, -107.6633, -154.8925, 0, ''), +-- (7998, 09, -518.9943, -101.4161, -154.6482, 27000, ''), +-- (7998, 10, -526.9984, -98.14884, -155.6253, 0, ''), +-- (7998, 11, -534.5686, -105.4101, -155.989, 30000, ''), +-- (7998, 12, -535.5336, -104.6947, -155.9713, 0, ''), +-- (7998, 13, -541.6304, -98.6583, -155.8584, 25000, ''), +-- (7998, 14, -535.0923, -99.91748, -155.9742, 0, ''), +-- (7998, 15, -519.0099, -101.5097, -154.6766, 3000, ''), +-- (7998, 16, -504.4659, -97.84802, -150.9554, 30000, ''), +-- (7998, 17, -506.9069, -89.14736, -151.083, 23000, ''), +-- (7998, 18, -512.7576, -101.9025, -153.198, 0, ''), +-- (7998, 19, -519.9883, -124.8479, -156.128, 86400000, 'this npc should not reset on wp end'); +-- EOF + diff --git a/system/ScriptLoader.cpp b/system/ScriptLoader.cpp new file mode 100644 index 0000000..5adb7ee --- /dev/null +++ b/system/ScriptLoader.cpp @@ -0,0 +1,865 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" + +//battlegrounds +extern void AddSC_battleground(); + +//custom +extern void AddSC_boss_pusillin(); +extern void AddSC_instance_dire_maul(); + +//examples +extern void AddSC_example_creature(); +extern void AddSC_example_escort(); +extern void AddSC_example_gossip_codebox(); +extern void AddSC_example_misc(); + +//world +extern void AddSC_areatrigger_scripts(); +extern void AddSC_boss_emeriss(); +extern void AddSC_boss_taerar(); +extern void AddSC_boss_ysondre(); +extern void AddSC_generic_creature(); +extern void AddSC_go_scripts(); +extern void AddSC_guards(); +extern void AddSC_item_scripts(); +extern void AddSC_npc_professions(); +extern void AddSC_npcs_special(); +extern void AddSC_spell_scripts(); + +//eastern kingdoms +extern void AddSC_blackrock_depths(); //blackrock_depths +extern void AddSC_boss_ambassador_flamelash(); +extern void AddSC_boss_anubshiah(); +extern void AddSC_boss_draganthaurissan(); +extern void AddSC_boss_general_angerforge(); +extern void AddSC_boss_gorosh_the_dervish(); +extern void AddSC_boss_grizzle(); +extern void AddSC_boss_high_interrogator_gerstahn(); +extern void AddSC_boss_magmus(); +extern void AddSC_boss_tomb_of_seven(); +extern void AddSC_instance_blackrock_depths(); +extern void AddSC_boss_drakkisath(); //blackrock_spire +extern void AddSC_boss_halycon(); +extern void AddSC_boss_highlordomokk(); +extern void AddSC_boss_mothersmolderweb(); +extern void AddSC_boss_overlordwyrmthalak(); +extern void AddSC_boss_shadowvosh(); +extern void AddSC_boss_thebeast(); +extern void AddSC_boss_warmastervoone(); +extern void AddSC_boss_quatermasterzigris(); +extern void AddSC_boss_pyroguard_emberseer(); +extern void AddSC_boss_gyth(); +extern void AddSC_boss_rend_blackhand(); +extern void AddSC_instance_blackrock_spire(); +extern void AddSC_boss_razorgore(); //blackwing_lair +extern void AddSC_boss_vael(); +extern void AddSC_boss_broodlord(); +extern void AddSC_boss_firemaw(); +extern void AddSC_boss_ebonroc(); +extern void AddSC_boss_flamegor(); +extern void AddSC_boss_chromaggus(); +extern void AddSC_boss_nefarian(); +extern void AddSC_boss_victor_nefarius(); +extern void AddSC_deadmines(); //deadmines +extern void AddSC_instance_deadmines(); +extern void AddSC_gnomeregan(); //gnomeregan +extern void AddSC_boss_thermaplugg(); +extern void AddSC_instance_gnomeregan(); +extern void AddSC_boss_attumen(); //karazhan +extern void AddSC_boss_curator(); +extern void AddSC_boss_maiden_of_virtue(); +extern void AddSC_boss_shade_of_aran(); +extern void AddSC_boss_netherspite(); +extern void AddSC_boss_malchezaar(); +extern void AddSC_boss_terestian_illhoof(); +extern void AddSC_netherspite_infernal(); +extern void AddSC_boss_moroes(); +extern void AddSC_bosses_opera(); +extern void AddSC_instance_karazhan(); +extern void AddSC_karazhan(); +extern void AddSC_boss_felblood_kaelthas(); //magisters_terrace +extern void AddSC_boss_selin_fireheart(); +extern void AddSC_boss_vexallus(); +extern void AddSC_boss_priestess_delrissa(); +extern void AddSC_instance_magisters_terrace(); +extern void AddSC_magisters_terrace(); +extern void AddSC_boss_lucifron(); //molten_core +extern void AddSC_boss_magmadar(); +extern void AddSC_boss_gehennas(); +extern void AddSC_boss_garr(); +extern void AddSC_boss_baron_geddon(); +extern void AddSC_boss_shazzrah(); +extern void AddSC_boss_golemagg(); +extern void AddSC_boss_sulfuron(); +extern void AddSC_boss_majordomo(); +extern void AddSC_boss_ragnaros(); +extern void AddSC_instance_molten_core(); +extern void AddSC_molten_core(); +extern void AddSC_ebon_hold(); //scarlet_enclave +extern void AddSC_boss_arcanist_doan(); //scarlet_monastery +extern void AddSC_boss_azshir_the_sleepless(); +extern void AddSC_boss_bloodmage_thalnos(); +extern void AddSC_boss_herod(); +extern void AddSC_boss_high_inquisitor_fairbanks(); +extern void AddSC_boss_houndmaster_loksey(); +extern void AddSC_boss_interrogator_vishas(); +extern void AddSC_boss_mograine_and_whitemane(); +extern void AddSC_boss_scorn(); +extern void AddSC_boss_headless_horseman(); +extern void AddSC_instance_scarlet_monastery(); +extern void AddSC_boss_darkmaster_gandling(); //scholomance +extern void AddSC_boss_death_knight_darkreaver(); +extern void AddSC_boss_theolenkrastinov(); +extern void AddSC_boss_illuciabarov(); +extern void AddSC_boss_instructormalicia(); +extern void AddSC_boss_jandicebarov(); +extern void AddSC_boss_kormok(); +extern void AddSC_boss_lordalexeibarov(); +extern void AddSC_boss_lorekeeperpolkelt(); +extern void AddSC_boss_rasfrost(); +extern void AddSC_boss_theravenian(); +extern void AddSC_boss_vectus(); +extern void AddSC_instance_scholomance(); +extern void AddSC_shadowfang_keep(); //shadowfang_keep +extern void AddSC_instance_shadowfang_keep(); +extern void AddSC_boss_magistrate_barthilas(); //stratholme +extern void AddSC_boss_maleki_the_pallid(); +extern void AddSC_boss_nerubenkan(); +extern void AddSC_boss_cannon_master_willey(); +extern void AddSC_boss_baroness_anastari(); +extern void AddSC_boss_ramstein_the_gorger(); +extern void AddSC_boss_timmy_the_cruel(); +extern void AddSC_boss_postmaster_malown(); +extern void AddSC_boss_baron_rivendare(); +extern void AddSC_boss_dathrohan_balnazzar(); +extern void AddSC_boss_order_of_silver_hand(); +extern void AddSC_instance_stratholme(); +extern void AddSC_stratholme(); +extern void AddSC_instance_sunken_temple(); //sunken_temple +extern void AddSC_sunken_temple(); +extern void AddSC_boss_brutallus(); //sunwell_plateau +extern void AddSC_boss_kalecgos(); +extern void AddSC_instance_sunwell_plateau(); +extern void AddSC_boss_archaedas(); //uldaman +extern void AddSC_boss_ironaya(); +extern void AddSC_instance_uldaman(); +extern void AddSC_uldaman(); +extern void AddSC_boss_akilzon(); //zulaman +extern void AddSC_boss_halazzi(); +extern void AddSC_boss_janalai(); +extern void AddSC_boss_malacrass(); +extern void AddSC_boss_nalorakk(); +extern void AddSC_instance_zulaman(); +extern void AddSC_zulaman(); +extern void AddSC_boss_zuljin(); +extern void AddSC_boss_arlokk(); //zulgurub +extern void AddSC_boss_gahzranka(); +extern void AddSC_boss_grilek(); +extern void AddSC_boss_hakkar(); +extern void AddSC_boss_hazzarah(); +extern void AddSC_boss_jeklik(); +extern void AddSC_boss_jindo(); +extern void AddSC_boss_mandokir(); +extern void AddSC_boss_marli(); +extern void AddSC_boss_ouro(); +extern void AddSC_boss_renataki(); +extern void AddSC_boss_thekal(); +extern void AddSC_boss_venoxis(); +extern void AddSC_boss_wushoolay(); +extern void AddSC_instance_zulgurub(); + +//extern void AddSC_alterac_mountains(); +extern void AddSC_arathi_highlands(); +extern void AddSC_blasted_lands(); +extern void AddSC_boss_kruul(); +extern void AddSC_burning_steppes(); +extern void AddSC_dun_morogh(); +extern void AddSC_eastern_plaguelands(); +extern void AddSC_elwynn_forest(); +extern void AddSC_eversong_woods(); +extern void AddSC_ghostlands(); +extern void AddSC_hinterlands(); +extern void AddSC_ironforge(); +extern void AddSC_isle_of_queldanas(); +extern void AddSC_loch_modan(); +extern void AddSC_redridge_mountains(); +extern void AddSC_searing_gorge(); +extern void AddSC_silvermoon_city(); +extern void AddSC_silverpine_forest(); +extern void AddSC_stormwind_city(); +extern void AddSC_stranglethorn_vale(); +extern void AddSC_swamp_of_sorrows(); +extern void AddSC_tirisfal_glades(); +extern void AddSC_undercity(); +extern void AddSC_western_plaguelands(); +extern void AddSC_westfall(); +extern void AddSC_wetlands(); + +//kalimdor +extern void AddSC_instance_blackfathom_deeps(); //blackfathom_deeps +extern void AddSC_boss_aeonus(); //COT, dark_portal +extern void AddSC_boss_chrono_lord_deja(); +extern void AddSC_boss_temporus(); +extern void AddSC_dark_portal(); +extern void AddSC_instance_dark_portal(); +extern void AddSC_hyjal(); //COT, hyjal +extern void AddSC_boss_archimonde(); +extern void AddSC_instance_mount_hyjal(); +extern void AddSC_boss_captain_skarloc(); //COT, old_hillsbrad +extern void AddSC_boss_epoch_hunter(); +extern void AddSC_boss_lieutenant_drake(); +extern void AddSC_instance_old_hillsbrad(); +extern void AddSC_old_hillsbrad(); +extern void AddSC_culling_of_stratholme(); //Culling of Stratholme +extern void AddSC_instance_culling_of_stratholme(); +extern void AddSC_boss_celebras_the_cursed(); //maraudon +extern void AddSC_boss_landslide(); +extern void AddSC_boss_noxxion(); +extern void AddSC_boss_ptheradras(); +extern void AddSC_boss_onyxia(); //onyxias_lair +extern void AddSC_instance_onyxias_lair(); +extern void AddSC_boss_amnennar_the_coldbringer(); //razorfen_downs +extern void AddSC_razorfen_downs(); +extern void AddSC_instance_razorfen_kraul(); //razorfen_kraul +extern void AddSC_boss_ayamiss(); //ruins_of_ahnqiraj +extern void AddSC_boss_kurinnaxx(); +extern void AddSC_boss_moam(); +extern void AddSC_ruins_of_ahnqiraj(); +extern void AddSC_boss_cthun(); //temple_of_ahnqiraj +extern void AddSC_boss_fankriss(); +extern void AddSC_boss_huhuran(); +extern void AddSC_bug_trio(); +extern void AddSC_boss_sartura(); +extern void AddSC_boss_skeram(); +extern void AddSC_boss_twinemperors(); +extern void AddSC_mob_anubisath_sentinel(); +extern void AddSC_instance_temple_of_ahnqiraj(); +extern void AddSC_instance_wailing_caverns(); // Wailing Caverns +extern void AddSC_zulfarrak(); //zulfarrak + +extern void AddSC_ashenvale(); +extern void AddSC_azshara(); +extern void AddSC_azuremyst_isle(); +extern void AddSC_bloodmyst_isle(); +extern void AddSC_boss_azuregos(); +extern void AddSC_darkshore(); +extern void AddSC_desolace(); +extern void AddSC_dustwallow_marsh(); +extern void AddSC_felwood(); +extern void AddSC_feralas(); +extern void AddSC_moonglade(); +extern void AddSC_mulgore(); +extern void AddSC_orgrimmar(); +extern void AddSC_silithus(); +extern void AddSC_stonetalon_mountains(); +extern void AddSC_tanaris(); +extern void AddSC_teldrassil(); +extern void AddSC_the_barrens(); +extern void AddSC_thousand_needles(); +extern void AddSC_thunder_bluff(); +extern void AddSC_ungoro_crater(); +extern void AddSC_winterspring(); + +//northrend +extern void AddSC_boss_jedoga(); //ahnkahet +extern void AddSC_boss_nadox(); +extern void AddSC_boss_taldaram(); +extern void AddSC_boss_volazj(); +extern void AddSC_boss_amanitar(); +extern void AddSC_instance_ahnkahet(); +extern void AddSC_boss_anubarak(); //azjol-nerub +extern void AddSC_boss_hadronox(); +extern void AddSC_boss_krikthir(); +extern void AddSC_instance_azjol_nerub(); +extern void AddSC_boss_anubarak_trial(); //trial_of_the_crusader +extern void AddSC_boss_jaraxxus(); +extern void AddSC_instance_trial_of_the_crusader(); +extern void AddSC_northrend_beasts(); +extern void AddSC_trial_of_the_crusader(); +extern void AddSC_twin_valkyr(); +extern void AddSC_boss_novos(); //draktharon_keep +extern void AddSC_boss_tharonja(); +extern void AddSC_boss_trollgore(); +extern void AddSC_boss_colossus(); //gundrak +extern void AddSC_boss_galdarah(); +extern void AddSC_boss_moorabi(); +extern void AddSC_boss_sladran(); +extern void AddSC_boss_eck_the_ferocious(); +extern void AddSC_instance_gundrak(); +extern void AddSC_boss_bronjahm(); // ICC, forge_of_souls +extern void AddSC_boss_devourer_of_souls(); +extern void AddSC_instance_forge_of_souls(); +extern void AddSC_boss_anubrekhan(); //naxxramas +extern void AddSC_boss_four_horsemen(); +extern void AddSC_boss_faerlina(); +extern void AddSC_boss_gluth(); +extern void AddSC_boss_gothik(); +extern void AddSC_boss_grobbulus(); +extern void AddSC_boss_kelthuzad(); +extern void AddSC_boss_loatheb(); +extern void AddSC_boss_maexxna(); +extern void AddSC_boss_noth(); +extern void AddSC_boss_heigan(); +extern void AddSC_boss_patchwerk(); +extern void AddSC_boss_razuvious(); +extern void AddSC_boss_sapphiron(); +extern void AddSC_boss_thaddius(); +extern void AddSC_instance_naxxramas(); +extern void AddSC_boss_anomalus(); //nexus +extern void AddSC_boss_keristrasza(); +extern void AddSC_boss_ormorok(); +extern void AddSC_boss_telestra(); +extern void AddSC_instance_nexus(); +extern void AddSC_boss_sartharion(); //obsidian_sanctum +extern void AddSC_instance_obsidian_sanctum(); +extern void AddSC_boss_bjarngrim(); //Ulduar, halls_of_lightning +extern void AddSC_boss_ionar(); +extern void AddSC_boss_loken(); +extern void AddSC_boss_volkhan(); +extern void AddSC_instance_halls_of_lightning(); +extern void AddSC_boss_maiden_of_grief(); //Ulduar, halls_of_stone +extern void AddSC_boss_sjonnir(); +extern void AddSC_halls_of_stone(); +extern void AddSC_instance_halls_of_stone(); +extern void AddSC_instance_ulduar(); //ulduar +extern void AddSC_boss_ingvar(); //utgarde_keep +extern void AddSC_boss_keleseth(); +extern void AddSC_boss_skarvald_and_dalronn(); +extern void AddSC_instance_utgarde_keep(); +extern void AddSC_utgarde_keep(); +extern void AddSC_boss_gortok(); //utgarde_pinnacle +extern void AddSC_boss_skadi(); +extern void AddSC_boss_svala(); +extern void AddSC_boss_ymiron(); +extern void AddSC_instance_pinnacle(); +extern void AddSC_boss_erekem(); //violet_hold +extern void AddSC_boss_ichoron(); +extern void AddSC_boss_lavanthor(); +extern void AddSC_boss_moragg(); +extern void AddSC_boss_xevozz(); +extern void AddSC_boss_zuramat(); +extern void AddSC_boss_cyanigosa(); +extern void AddSC_instance_violet_hold(); +extern void AddSC_violet_hold(); + +extern void AddSC_borean_tundra(); +extern void AddSC_dalaran(); +extern void AddSC_dragonblight(); +extern void AddSC_howling_fjord(); +extern void AddSC_icecrown(); +extern void AddSC_sholazar_basin(); +extern void AddSC_storm_peaks(); +extern void AddSC_zuldrak(); + +//outland +extern void AddSC_boss_exarch_maladaar(); //auchindoun, auchenai_crypts +extern void AddSC_boss_nexusprince_shaffar(); //auchindoun, mana_tombs +extern void AddSC_boss_pandemonius(); +extern void AddSC_boss_darkweaver_syth(); //auchindoun, sethekk_halls +extern void AddSC_boss_talon_king_ikiss(); +extern void AddSC_instance_sethekk_halls(); +extern void AddSC_boss_ambassador_hellmaw(); //auchindoun, shadow_labyrinth +extern void AddSC_boss_blackheart_the_inciter(); +extern void AddSC_boss_grandmaster_vorpil(); +extern void AddSC_boss_murmur(); +extern void AddSC_instance_shadow_labyrinth(); +extern void AddSC_black_temple(); //black_temple +extern void AddSC_boss_illidan(); +extern void AddSC_boss_shade_of_akama(); +extern void AddSC_boss_supremus(); +extern void AddSC_boss_gurtogg_bloodboil(); +extern void AddSC_boss_mother_shahraz(); +extern void AddSC_boss_reliquary_of_souls(); +extern void AddSC_boss_teron_gorefiend(); +extern void AddSC_boss_najentus(); +extern void AddSC_boss_illidari_council(); +extern void AddSC_instance_black_temple(); +extern void AddSC_boss_fathomlord_karathress(); //CR, serpent_shrine +extern void AddSC_boss_hydross_the_unstable(); +extern void AddSC_boss_lady_vashj(); +extern void AddSC_boss_leotheras_the_blind(); +extern void AddSC_boss_morogrim_tidewalker(); +extern void AddSC_instance_serpentshrine_cavern(); +extern void AddSC_boss_hydromancer_thespia(); //CR, steam_vault +extern void AddSC_boss_mekgineer_steamrigger(); +extern void AddSC_boss_warlord_kalithresh(); +extern void AddSC_instance_steam_vault(); +extern void AddSC_boss_hungarfen(); //CR, Underbog +extern void AddSC_boss_gruul(); //gruuls_lair +extern void AddSC_boss_high_king_maulgar(); +extern void AddSC_instance_gruuls_lair(); +extern void AddSC_boss_broggok(); //HC, blood_furnace +extern void AddSC_boss_kelidan_the_breaker(); +extern void AddSC_boss_the_maker(); +extern void AddSC_instance_blood_furnace(); +extern void AddSC_boss_nazan_and_vazruden(); //HC, hellfire_ramparts +extern void AddSC_boss_omor_the_unscarred(); +extern void AddSC_boss_watchkeeper_gargolmar(); +extern void AddSC_instance_ramparts(); +extern void AddSC_boss_magtheridon(); //HC, magtheridons_lair +extern void AddSC_instance_magtheridons_lair(); +extern void AddSC_boss_grand_warlock_nethekurse(); //HC, shattered_halls +extern void AddSC_boss_warbringer_omrogg(); +extern void AddSC_boss_warchief_kargath_bladefist(); +extern void AddSC_instance_shattered_halls(); +extern void AddSC_arcatraz(); //TK, arcatraz +extern void AddSC_boss_harbinger_skyriss(); +extern void AddSC_instance_arcatraz(); +extern void AddSC_boss_high_botanist_freywinn(); //TK, botanica +extern void AddSC_boss_laj(); +extern void AddSC_boss_warp_splinter(); +extern void AddSC_boss_kaelthas(); //TK, the_eye +extern void AddSC_boss_void_reaver(); +extern void AddSC_boss_high_astromancer_solarian(); +extern void AddSC_instance_the_eye(); +extern void AddSC_the_eye(); +extern void AddSC_boss_gatewatcher_iron_hand(); //TK, the_mechanar +extern void AddSC_boss_nethermancer_sepethrea(); +extern void AddSC_boss_pathaleon_the_calculator(); +extern void AddSC_instance_mechanar(); + +extern void AddSC_blades_edge_mountains(); +extern void AddSC_boss_doomlordkazzak(); +extern void AddSC_boss_doomwalker(); +extern void AddSC_hellfire_peninsula(); +extern void AddSC_nagrand(); +extern void AddSC_netherstorm(); +extern void AddSC_shadowmoon_valley(); +extern void AddSC_shattrath_city(); +extern void AddSC_terokkar_forest(); +extern void AddSC_zangarmarsh(); + +void AddScripts() +{ + //battlegrounds + AddSC_battleground(); + + //custom + AddSC_boss_pusillin(); + AddSC_instance_dire_maul(); + //examples + AddSC_example_creature(); + AddSC_example_escort(); + AddSC_example_gossip_codebox(); + AddSC_example_misc(); + + //world + AddSC_areatrigger_scripts(); + AddSC_boss_emeriss(); + AddSC_boss_taerar(); + AddSC_boss_ysondre(); + AddSC_generic_creature(); + AddSC_go_scripts(); + AddSC_guards(); + AddSC_item_scripts(); + AddSC_npc_professions(); + AddSC_npcs_special(); + AddSC_spell_scripts(); + + //eastern kingdoms + AddSC_blackrock_depths(); //blackrock_depths + AddSC_boss_ambassador_flamelash(); + AddSC_boss_anubshiah(); + AddSC_boss_draganthaurissan(); + AddSC_boss_general_angerforge(); + AddSC_boss_gorosh_the_dervish(); + AddSC_boss_grizzle(); + AddSC_boss_high_interrogator_gerstahn(); + AddSC_boss_magmus(); + AddSC_boss_tomb_of_seven(); + AddSC_instance_blackrock_depths(); + AddSC_boss_drakkisath(); //blackrock_spire + AddSC_boss_halycon(); + AddSC_boss_highlordomokk(); + AddSC_boss_mothersmolderweb(); + AddSC_boss_overlordwyrmthalak(); + AddSC_boss_shadowvosh(); + AddSC_boss_thebeast(); + AddSC_boss_warmastervoone(); + AddSC_boss_quatermasterzigris(); + AddSC_boss_pyroguard_emberseer(); + AddSC_boss_gyth(); + AddSC_boss_rend_blackhand(); + AddSC_instance_blackrock_spire(); + AddSC_boss_razorgore(); //blackwing_lair + AddSC_boss_vael(); + AddSC_boss_broodlord(); + AddSC_boss_firemaw(); + AddSC_boss_ebonroc(); + AddSC_boss_flamegor(); + AddSC_boss_chromaggus(); + AddSC_boss_nefarian(); + AddSC_boss_victor_nefarius(); + AddSC_deadmines(); //deadmines + AddSC_instance_deadmines(); + AddSC_gnomeregan(); //gnomeregan + AddSC_boss_thermaplugg(); + AddSC_instance_gnomeregan(); + AddSC_boss_attumen(); //karazhan + AddSC_boss_curator(); + AddSC_boss_maiden_of_virtue(); + AddSC_boss_shade_of_aran(); + AddSC_boss_netherspite(); + AddSC_boss_malchezaar(); + AddSC_boss_terestian_illhoof(); + AddSC_netherspite_infernal(); + AddSC_boss_moroes(); + AddSC_bosses_opera(); + AddSC_instance_karazhan(); + AddSC_karazhan(); + AddSC_boss_felblood_kaelthas(); //magisters_terrace + AddSC_boss_selin_fireheart(); + AddSC_boss_vexallus(); + AddSC_boss_priestess_delrissa(); + AddSC_instance_magisters_terrace(); + AddSC_magisters_terrace(); + AddSC_boss_lucifron(); //molten_core + AddSC_boss_magmadar(); + AddSC_boss_gehennas(); + AddSC_boss_garr(); + AddSC_boss_baron_geddon(); + AddSC_boss_shazzrah(); + AddSC_boss_golemagg(); + AddSC_boss_sulfuron(); + AddSC_boss_majordomo(); + AddSC_boss_ragnaros(); + AddSC_instance_molten_core(); + AddSC_molten_core(); + AddSC_ebon_hold(); //scarlet_enclave + AddSC_boss_arcanist_doan(); //scarlet_monastery + AddSC_boss_azshir_the_sleepless(); + AddSC_boss_bloodmage_thalnos(); + AddSC_boss_herod(); + AddSC_boss_high_inquisitor_fairbanks(); + AddSC_boss_houndmaster_loksey(); + AddSC_boss_interrogator_vishas(); + AddSC_boss_mograine_and_whitemane(); + AddSC_boss_scorn(); + AddSC_boss_headless_horseman(); + AddSC_instance_scarlet_monastery(); + AddSC_boss_darkmaster_gandling(); //scholomance + AddSC_boss_death_knight_darkreaver(); + AddSC_boss_theolenkrastinov(); + AddSC_boss_illuciabarov(); + AddSC_boss_instructormalicia(); + AddSC_boss_jandicebarov(); + AddSC_boss_kormok(); + AddSC_boss_lordalexeibarov(); + AddSC_boss_lorekeeperpolkelt(); + AddSC_boss_rasfrost(); + AddSC_boss_theravenian(); + AddSC_boss_vectus(); + AddSC_instance_scholomance(); + AddSC_shadowfang_keep(); //shadowfang_keep + AddSC_instance_shadowfang_keep(); + AddSC_boss_magistrate_barthilas(); //stratholme + AddSC_boss_maleki_the_pallid(); + AddSC_boss_nerubenkan(); + AddSC_boss_cannon_master_willey(); + AddSC_boss_baroness_anastari(); + AddSC_boss_ramstein_the_gorger(); + AddSC_boss_timmy_the_cruel(); + AddSC_boss_postmaster_malown(); + AddSC_boss_baron_rivendare(); + AddSC_boss_dathrohan_balnazzar(); + AddSC_boss_order_of_silver_hand(); + AddSC_instance_stratholme(); + AddSC_stratholme(); + AddSC_instance_sunken_temple(); //sunken_temple + AddSC_sunken_temple(); + AddSC_boss_brutallus(); //sunwell_plateau + AddSC_boss_kalecgos(); + AddSC_instance_sunwell_plateau(); + AddSC_boss_archaedas(); //uldaman + AddSC_boss_ironaya(); + AddSC_instance_uldaman(); + AddSC_uldaman(); + AddSC_boss_akilzon(); //zulaman + AddSC_boss_halazzi(); + AddSC_boss_janalai(); + AddSC_boss_malacrass(); + AddSC_boss_nalorakk(); + AddSC_instance_zulaman(); + AddSC_zulaman(); + AddSC_boss_zuljin(); + AddSC_boss_arlokk(); //zulgurub + AddSC_boss_gahzranka(); + AddSC_boss_grilek(); + AddSC_boss_hakkar(); + AddSC_boss_hazzarah(); + AddSC_boss_jeklik(); + AddSC_boss_jindo(); + AddSC_boss_mandokir(); + AddSC_boss_marli(); + AddSC_boss_ouro(); + AddSC_boss_renataki(); + AddSC_boss_thekal(); + AddSC_boss_venoxis(); + AddSC_boss_wushoolay(); + AddSC_instance_zulgurub(); + + //AddSC_alterac_mountains(); + AddSC_arathi_highlands(); + AddSC_blasted_lands(); + AddSC_boss_kruul(); + AddSC_burning_steppes(); + AddSC_dun_morogh(); + AddSC_eastern_plaguelands(); + AddSC_elwynn_forest(); + AddSC_eversong_woods(); + AddSC_ghostlands(); + AddSC_hinterlands(); + AddSC_ironforge(); + AddSC_isle_of_queldanas(); + AddSC_loch_modan(); + AddSC_redridge_mountains(); + AddSC_searing_gorge(); + AddSC_silvermoon_city(); + AddSC_silverpine_forest(); + AddSC_stormwind_city(); + AddSC_stranglethorn_vale(); + AddSC_swamp_of_sorrows(); + AddSC_tirisfal_glades(); + AddSC_undercity(); + AddSC_western_plaguelands(); + AddSC_westfall(); + AddSC_wetlands(); + + //kalimdor + AddSC_instance_blackfathom_deeps(); // blackfathom deeps + AddSC_boss_aeonus(); // Opening the Dark Portal + AddSC_boss_chrono_lord_deja(); + AddSC_boss_temporus(); + AddSC_dark_portal(); + AddSC_instance_dark_portal(); + AddSC_hyjal(); // Battle of Mount Hyjal + AddSC_boss_archimonde(); + AddSC_instance_mount_hyjal(); + AddSC_boss_captain_skarloc(); // Escape from Durnholde Keep + AddSC_boss_epoch_hunter(); + AddSC_boss_lieutenant_drake(); + AddSC_instance_old_hillsbrad(); + AddSC_old_hillsbrad(); + AddSC_culling_of_stratholme(); // Culling of Stratholme + AddSC_instance_culling_of_stratholme(); + AddSC_boss_celebras_the_cursed(); //maraudon + AddSC_boss_landslide(); + AddSC_boss_noxxion(); + AddSC_boss_ptheradras(); + AddSC_boss_onyxia(); //onyxias_lair + AddSC_instance_onyxias_lair(); + AddSC_boss_amnennar_the_coldbringer(); //razorfen_downs + AddSC_razorfen_downs(); + AddSC_instance_razorfen_kraul(); //razorfen_kraul + AddSC_boss_ayamiss(); //ruins_of_ahnqiraj + AddSC_boss_kurinnaxx(); + AddSC_boss_moam(); + AddSC_ruins_of_ahnqiraj(); + AddSC_boss_cthun(); //temple_of_ahnqiraj + AddSC_boss_fankriss(); + AddSC_boss_huhuran(); + AddSC_bug_trio(); + AddSC_boss_sartura(); + AddSC_boss_skeram(); + AddSC_boss_twinemperors(); + AddSC_mob_anubisath_sentinel(); + AddSC_instance_temple_of_ahnqiraj(); + AddSC_instance_wailing_caverns(); // Wailing Caverns + AddSC_zulfarrak(); //zulfarrak + + AddSC_ashenvale(); + AddSC_azshara(); + AddSC_azuremyst_isle(); + AddSC_bloodmyst_isle(); + AddSC_boss_azuregos(); + AddSC_darkshore(); + AddSC_desolace(); + AddSC_dustwallow_marsh(); + AddSC_felwood(); + AddSC_feralas(); + AddSC_moonglade(); + AddSC_mulgore(); + AddSC_orgrimmar(); + AddSC_silithus(); + AddSC_stonetalon_mountains(); + AddSC_tanaris(); + AddSC_teldrassil(); + AddSC_the_barrens(); + AddSC_thousand_needles(); + AddSC_thunder_bluff(); + AddSC_ungoro_crater(); + AddSC_winterspring(); + + //northrend + AddSC_boss_jedoga(); //ahnkahet + AddSC_boss_nadox(); + AddSC_boss_taldaram(); + AddSC_boss_volazj(); + AddSC_boss_amanitar(); + AddSC_instance_ahnkahet(); + AddSC_boss_anubarak(); //azjol-nerub + AddSC_boss_hadronox(); + AddSC_boss_krikthir(); + AddSC_instance_azjol_nerub(); + AddSC_boss_anubarak_trial(); //trial_of_the_crusader + AddSC_boss_jaraxxus(); + AddSC_instance_trial_of_the_crusader(); + AddSC_northrend_beasts(); + AddSC_trial_of_the_crusader(); + AddSC_twin_valkyr(); + AddSC_boss_novos(); //draktharon_keep + AddSC_boss_tharonja(); + AddSC_boss_trollgore(); + AddSC_boss_colossus(); //gundrak + AddSC_boss_galdarah(); + AddSC_boss_moorabi(); + AddSC_boss_sladran(); + AddSC_boss_eck_the_ferocious(); + AddSC_instance_gundrak(); + AddSC_boss_bronjahm(); // ICC, forge_of_souls + AddSC_boss_devourer_of_souls(); + AddSC_instance_forge_of_souls(); + AddSC_boss_anubrekhan(); //naxxramas + AddSC_boss_four_horsemen(); + AddSC_boss_faerlina(); + AddSC_boss_gluth(); + AddSC_boss_gothik(); + AddSC_boss_grobbulus(); + AddSC_boss_kelthuzad(); + AddSC_boss_loatheb(); + AddSC_boss_maexxna(); + AddSC_boss_noth(); + AddSC_boss_heigan(); + AddSC_boss_patchwerk(); + AddSC_boss_razuvious(); + AddSC_boss_sapphiron(); + AddSC_boss_thaddius(); + AddSC_instance_naxxramas(); + AddSC_boss_anomalus(); //nexus + AddSC_boss_keristrasza(); + AddSC_boss_ormorok(); + AddSC_boss_telestra(); + AddSC_instance_nexus(); + AddSC_boss_sartharion(); //obsidian_sanctum + AddSC_instance_obsidian_sanctum(); + AddSC_boss_bjarngrim(); //Ulduar, halls_of_lightning + AddSC_boss_ionar(); + AddSC_boss_loken(); + AddSC_boss_volkhan(); + AddSC_instance_halls_of_lightning(); + AddSC_boss_maiden_of_grief(); //Ulduar, halls_of_stone + AddSC_boss_sjonnir(); + AddSC_halls_of_stone(); + AddSC_instance_halls_of_stone(); + AddSC_instance_ulduar(); //ulduar + AddSC_boss_ingvar(); //utgarde_keep + AddSC_boss_keleseth(); + AddSC_boss_skarvald_and_dalronn(); + AddSC_instance_utgarde_keep(); + AddSC_utgarde_keep(); + AddSC_boss_gortok(); //utgarde_pinnacle + AddSC_boss_skadi(); + AddSC_boss_svala(); + AddSC_boss_ymiron(); + AddSC_instance_pinnacle(); + AddSC_boss_erekem(); //violet_hold + AddSC_boss_ichoron(); + AddSC_boss_lavanthor(); + AddSC_boss_moragg(); + AddSC_boss_xevozz(); + AddSC_boss_zuramat(); + AddSC_boss_cyanigosa(); + AddSC_instance_violet_hold(); + AddSC_violet_hold(); + + AddSC_borean_tundra(); + AddSC_dalaran(); + AddSC_dragonblight(); + AddSC_howling_fjord(); + AddSC_icecrown(); + AddSC_sholazar_basin(); + AddSC_storm_peaks(); + AddSC_zuldrak(); + + //outland + AddSC_boss_exarch_maladaar(); //auchindoun, auchenai_crypts + AddSC_boss_nexusprince_shaffar(); //auchindoun, mana_tombs + AddSC_boss_pandemonius(); + AddSC_boss_darkweaver_syth(); //auchindoun, sethekk_halls + AddSC_boss_talon_king_ikiss(); + AddSC_instance_sethekk_halls(); + AddSC_boss_ambassador_hellmaw(); //auchindoun, shadow_labyrinth + AddSC_boss_blackheart_the_inciter(); + AddSC_boss_grandmaster_vorpil(); + AddSC_boss_murmur(); + AddSC_instance_shadow_labyrinth(); + AddSC_black_temple(); //black_temple + AddSC_boss_illidan(); + AddSC_boss_shade_of_akama(); + AddSC_boss_supremus(); + AddSC_boss_gurtogg_bloodboil(); + AddSC_boss_mother_shahraz(); + AddSC_boss_reliquary_of_souls(); + AddSC_boss_teron_gorefiend(); + AddSC_boss_najentus(); + AddSC_boss_illidari_council(); + AddSC_instance_black_temple(); + AddSC_boss_fathomlord_karathress(); //CR, serpent_shrine + AddSC_boss_hydross_the_unstable(); + AddSC_boss_lady_vashj(); + AddSC_boss_leotheras_the_blind(); + AddSC_boss_morogrim_tidewalker(); + AddSC_instance_serpentshrine_cavern(); + AddSC_boss_hydromancer_thespia(); //CR, steam_vault + AddSC_boss_mekgineer_steamrigger(); + AddSC_boss_warlord_kalithresh(); + AddSC_instance_steam_vault(); + AddSC_boss_hungarfen(); //CR, Underbog + AddSC_boss_gruul(); //gruuls_lair + AddSC_boss_high_king_maulgar(); + AddSC_instance_gruuls_lair(); + AddSC_boss_broggok(); //HC, blood_furnace + AddSC_boss_kelidan_the_breaker(); + AddSC_boss_the_maker(); + AddSC_instance_blood_furnace(); + AddSC_boss_nazan_and_vazruden(); //HC, hellfire_ramparts + AddSC_boss_omor_the_unscarred(); + AddSC_boss_watchkeeper_gargolmar(); + AddSC_instance_ramparts(); + AddSC_boss_magtheridon(); //HC, magtheridons_lair + AddSC_instance_magtheridons_lair(); + AddSC_boss_grand_warlock_nethekurse(); //HC, shattered_halls + AddSC_boss_warbringer_omrogg(); + AddSC_boss_warchief_kargath_bladefist(); + AddSC_instance_shattered_halls(); + AddSC_arcatraz(); //TK, arcatraz + AddSC_boss_harbinger_skyriss(); + AddSC_instance_arcatraz(); + AddSC_boss_high_botanist_freywinn(); //TK, botanica + AddSC_boss_laj(); + AddSC_boss_warp_splinter(); + AddSC_boss_kaelthas(); //TK, the_eye + AddSC_boss_void_reaver(); + AddSC_boss_high_astromancer_solarian(); + AddSC_instance_the_eye(); + AddSC_the_eye(); + AddSC_boss_gatewatcher_iron_hand(); //TK, the_mechanar + AddSC_boss_nethermancer_sepethrea(); + AddSC_boss_pathaleon_the_calculator(); + AddSC_instance_mechanar(); + + AddSC_blades_edge_mountains(); + AddSC_boss_doomlordkazzak(); + AddSC_boss_doomwalker(); + AddSC_hellfire_peninsula(); + AddSC_nagrand(); + AddSC_netherstorm(); + AddSC_shadowmoon_valley(); + AddSC_shattrath_city(); + AddSC_terokkar_forest(); + AddSC_zangarmarsh(); +} diff --git a/system/ScriptLoader.h b/system/ScriptLoader.h new file mode 100644 index 0000000..51bcacb --- /dev/null +++ b/system/ScriptLoader.h @@ -0,0 +1,10 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_SCRIPTLOADER_H +#define SC_SCRIPTLOADER_H + +void AddScripts(); + +#endif diff --git a/system/system.cpp b/system/system.cpp new file mode 100644 index 0000000..960c547 --- /dev/null +++ b/system/system.cpp @@ -0,0 +1,242 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#include "precompiled.h" +#include "system.h" +#include "ProgressBar.h" +#include "ObjectMgr.h" +#include "Database/DatabaseEnv.h" + +DatabaseType SD2Database; +std::string strSD2Version; + +SystemMgr::SystemMgr() +{ +} + +SystemMgr& SystemMgr::Instance() +{ + static SystemMgr pSysMgr; + return pSysMgr; +} + +void SystemMgr::LoadVersion() +{ + //Get Version information + QueryResult* pResult = SD2Database.PQuery("SELECT version FROM sd2_db_version LIMIT 1"); + + if (pResult) + { + Field* pFields = pResult->Fetch(); + + strSD2Version = pFields[0].GetCppString(); + + outstring_log("Loading %s", strSD2Version.c_str()); + outstring_log(""); + + delete pResult; + } + else + { + error_log("SD2: Missing `sd2_db_version` information."); + outstring_log(""); + } +} + +void SystemMgr::LoadScriptTexts() +{ + outstring_log("SD2: Loading Script Texts..."); + LoadMangosStrings(SD2Database, "script_texts", TEXT_SOURCE_TEXT_START, TEXT_SOURCE_TEXT_END); + + QueryResult* pResult = SD2Database.PQuery("SELECT entry, sound, type, language, emote FROM script_texts WHERE entry BETWEEN %i AND %i", TEXT_SOURCE_GOSSIP_END, TEXT_SOURCE_TEXT_START); + + outstring_log("SD2: Loading Script Texts additional data..."); + + if (pResult) + { + barGoLink bar(pResult->GetRowCount()); + uint32 uiCount = 0; + + do + { + bar.step(); + Field* pFields = pResult->Fetch(); + StringTextData pTemp; + + int32 iId = pFields[0].GetInt32(); + pTemp.uiSoundId = pFields[1].GetUInt32(); + pTemp.uiType = pFields[2].GetUInt32(); + pTemp.uiLanguage = pFields[3].GetUInt32(); + pTemp.uiEmote = pFields[4].GetUInt32(); + + if (iId >= 0) + { + error_db_log("SD2: Entry %i in table `script_texts` is not a negative value.", iId); + continue; + } + + if (pTemp.uiSoundId) + { + if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) + error_db_log("SD2: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + } + + if (!GetLanguageDescByID(pTemp.uiLanguage)) + error_db_log("SD2: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + + if (pTemp.uiType > CHAT_TYPE_ZONE_YELL) + error_db_log("SD2: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); + + m_mTextDataMap[iId] = pTemp; + ++uiCount; + } while (pResult->NextRow()); + + delete pResult; + + outstring_log(""); + outstring_log(">> Loaded %u additional Script Texts data.", uiCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); + } +} + +void SystemMgr::LoadScriptTextsCustom() +{ + outstring_log("SD2: Loading Custom Texts..."); + LoadMangosStrings(SD2Database, "custom_texts", TEXT_SOURCE_CUSTOM_START, TEXT_SOURCE_CUSTOM_END); + + QueryResult* pResult = SD2Database.PQuery("SELECT entry, sound, type, language, emote FROM custom_texts WHERE entry BETWEEN %i AND %i", TEXT_SOURCE_CUSTOM_END, TEXT_SOURCE_CUSTOM_START); + + outstring_log("SD2: Loading Custom Texts additional data..."); + + if (pResult) + { + barGoLink bar(pResult->GetRowCount()); + uint32 uiCount = 0; + + do + { + bar.step(); + Field* pFields = pResult->Fetch(); + StringTextData pTemp; + + int32 iId = pFields[0].GetInt32(); + pTemp.uiSoundId = pFields[1].GetUInt32(); + pTemp.uiType = pFields[2].GetUInt32(); + pTemp.uiLanguage = pFields[3].GetUInt32(); + pTemp.uiEmote = pFields[4].GetUInt32(); + + if (iId >= 0) + { + error_db_log("SD2: Entry %i in table `custom_texts` is not a negative value.", iId); + continue; + } + + if (pTemp.uiSoundId) + { + if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) + error_db_log("SD2: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + } + + if (!GetLanguageDescByID(pTemp.uiLanguage)) + error_db_log("SD2: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + + if (pTemp.uiType > CHAT_TYPE_ZONE_YELL) + error_db_log("SD2: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); + + m_mTextDataMap[iId] = pTemp; + ++uiCount; + } while (pResult->NextRow()); + + delete pResult; + + outstring_log(""); + outstring_log(">> Loaded %u additional Custom Texts data.", uiCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); + } +} + +void SystemMgr::LoadScriptGossipTexts() +{ + outstring_log("SD2: Loading Gossip Texts..."); + LoadMangosStrings(SD2Database, "gossip_texts", TEXT_SOURCE_GOSSIP_START, TEXT_SOURCE_GOSSIP_END); +} + +void SystemMgr::LoadScriptWaypoints() +{ + // Drop Existing Waypoint list + m_mPointMoveMap.clear(); + + uint64 uiCreatureCount = 0; + + // Load Waypoints + QueryResult* pResult = SD2Database.PQuery("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry"); + if (pResult) + { + uiCreatureCount = pResult->GetRowCount(); + delete pResult; + } + + outstring_log("SD2: Loading Script Waypoints for " UI64FMTD " creature(s)...", uiCreatureCount); + + pResult = SD2Database.PQuery("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); + + if (pResult) + { + barGoLink bar(pResult->GetRowCount()); + uint32 uiNodeCount = 0; + + do + { + bar.step(); + Field* pFields = pResult->Fetch(); + ScriptPointMove pTemp; + + pTemp.uiCreatureEntry = pFields[0].GetUInt32(); + uint32 uiEntry = pTemp.uiCreatureEntry; + pTemp.uiPointId = pFields[1].GetUInt32(); + pTemp.fX = pFields[2].GetFloat(); + pTemp.fY = pFields[3].GetFloat(); + pTemp.fZ = pFields[4].GetFloat(); + pTemp.uiWaitTime = pFields[5].GetUInt32(); + + CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.uiCreatureEntry); + + if (!pCInfo) + { + error_db_log("SD2: DB table script_waypoint has waypoint for nonexistent creature entry %u", pTemp.uiCreatureEntry); + continue; + } + + if (!pCInfo->ScriptID) + error_db_log("SD2: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); + + m_mPointMoveMap[uiEntry].push_back(pTemp); + ++uiNodeCount; + } while (pResult->NextRow()); + + delete pResult; + + outstring_log(""); + outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + } +} diff --git a/system/system.h b/system/system.h new file mode 100644 index 0000000..33c94ef --- /dev/null +++ b/system/system.h @@ -0,0 +1,113 @@ +/* Copyright (C) 2006 - 2010 ScriptDev2 +* This program is free software licensed under GPL version 2 +* Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef SC_SYSTEM_H +#define SC_SYSTEM_H + +extern DatabaseType SD2Database; +extern std::string strSD2Version; //version info from database + +#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available + +#define TEXT_SOURCE_TEXT_START TEXT_SOURCE_RANGE +#define TEXT_SOURCE_TEXT_END TEXT_SOURCE_RANGE*2 + 1 + +#define TEXT_SOURCE_CUSTOM_START TEXT_SOURCE_RANGE*2 +#define TEXT_SOURCE_CUSTOM_END TEXT_SOURCE_RANGE*3 + 1 + +#define TEXT_SOURCE_GOSSIP_START TEXT_SOURCE_RANGE*3 +#define TEXT_SOURCE_GOSSIP_END TEXT_SOURCE_RANGE*4 + 1 + +//TODO: find better namings and definitions. +//N=Neutral, A=Alliance, H=Horde. +//NEUTRAL or FRIEND = Hostility to player surroundings (not a good definition) +//ACTIVE or PASSIVE = Hostility to environment surroundings. +enum eEscortFaction +{ + FACTION_ESCORT_A_NEUTRAL_PASSIVE = 10, + FACTION_ESCORT_H_NEUTRAL_PASSIVE = 33, + FACTION_ESCORT_N_NEUTRAL_PASSIVE = 113, + + FACTION_ESCORT_A_NEUTRAL_ACTIVE = 231, + FACTION_ESCORT_H_NEUTRAL_ACTIVE = 232, + FACTION_ESCORT_N_NEUTRAL_ACTIVE = 250, + + FACTION_ESCORT_N_FRIEND_PASSIVE = 290, + FACTION_ESCORT_N_FRIEND_ACTIVE = 495, + + FACTION_ESCORT_A_PASSIVE = 774, + FACTION_ESCORT_H_PASSIVE = 775, + + FACTION_ESCORT_N_ACTIVE = 1986, + FACTION_ESCORT_H_ACTIVE = 2046 +}; + +struct ScriptPointMove +{ + uint32 uiCreatureEntry; + uint32 uiPointId; + float fX; + float fY; + float fZ; + uint32 uiWaitTime; +}; + +struct StringTextData +{ + uint32 uiSoundId; + uint8 uiType; + uint32 uiLanguage; + uint32 uiEmote; +}; + +#define pSystemMgr SystemMgr::Instance() + +class SystemMgr +{ + public: + SystemMgr(); + ~SystemMgr() {} + + static SystemMgr& Instance(); + + //Maps and lists + typedef UNORDERED_MAP TextDataMap; + typedef UNORDERED_MAP > PointMoveMap; + + //Database + void LoadVersion(); + void LoadScriptTexts(); + void LoadScriptTextsCustom(); + void LoadScriptGossipTexts(); + void LoadScriptWaypoints(); + + //Retrive from storage + StringTextData const* GetTextData(int32 uiTextId) const + { + TextDataMap::const_iterator itr = m_mTextDataMap.find(uiTextId); + + if (itr == m_mTextDataMap.end()) + return NULL; + + return &itr->second; + } + + std::vector const &GetPointMoveList(uint32 uiCreatureEntry) const + { + static std::vector vEmpty; + + PointMoveMap::const_iterator itr = m_mPointMoveMap.find(uiCreatureEntry); + + if (itr == m_mPointMoveMap.end()) + return vEmpty; + + return itr->second; + } + + protected: + TextDataMap m_mTextDataMap; //additional data for text strings + PointMoveMap m_mPointMoveMap; //coordinates for waypoints +}; + +#endif diff --git a/tool/VCProjToLinuxMake.exe b/tool/VCProjToLinuxMake.exe new file mode 100644 index 0000000..1862fe3 Binary files /dev/null and b/tool/VCProjToLinuxMake.exe differ