diff options
author | Wyreth <32145860+Wyreth@users.noreply.github.com> | 2017-11-02 05:36:27 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2021-01-29 19:23:53 +0100 |
commit | 0c6447f94c68495d6a4146d3f2ccbc7800bfbb54 (patch) | |
tree | 2ce5d2637cc63eec1de5f05e8fcb3001d92fbe13 /src | |
parent | 28a4a3bc46bde48d1e1c6e26a9a95f27ba2e8ed8 (diff) |
Scripts/Tanaris: move Aquementas to SAI & improve related event (#20464)
* Script/Tanaris: move Aquementas to SAI and improve related event
Closes #11668
(cherry picked from commit 8888e6d96d026597190190d8f5f554d52df61216)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/zone_tanaris.cpp | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp index 442b35747ca..98849c85e03 100644 --- a/src/server/scripts/Kalimdor/zone_tanaris.cpp +++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp @@ -36,127 +36,6 @@ EndContentData */ #include "ScriptedGossip.h" /*###### -## npc_aquementas -######*/ - -enum Aquementas -{ - AGGRO_YELL_AQUE = 0, - - SPELL_AQUA_JET = 13586, - SPELL_FROST_SHOCK = 15089, - - ITEM_BOOK_OF_AQUOR = 11169, - ITEM_SILVERY_CLAWS = 11172, - ITEM_IRONTREE_HEART = 11173, - ITEM_SILVER_TOTEM = 11522 -}; - -class npc_aquementas : public CreatureScript -{ -public: - npc_aquementas() : CreatureScript("npc_aquementas") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_aquementasAI (creature); - } - - struct npc_aquementasAI : public ScriptedAI - { - npc_aquementasAI(Creature* creature) : ScriptedAI(creature) - { - Initialize(); - } - - void Initialize() - { - SendItemTimer = 0; - SwitchFactionTimer = 10000; - - isFriendly = true; - - AquaJetTimer = 5000; - FrostShockTimer = 1000; - } - - uint32 SendItemTimer; - uint32 SwitchFactionTimer; - bool isFriendly; - - uint32 FrostShockTimer; - uint32 AquaJetTimer; - - void Reset() override - { - Initialize(); - me->SetFaction(FACTION_FRIENDLY); - } - - void SendItem(Unit* receiver) - { - Player* player = receiver->ToPlayer(); - - if (player && player->HasItemCount(ITEM_BOOK_OF_AQUOR, 1, false) && - player->HasItemCount(ITEM_SILVERY_CLAWS, 11, false) && - player->HasItemCount(ITEM_IRONTREE_HEART, 1, false) && - !player->HasItemCount(ITEM_SILVER_TOTEM, 1, true)) - { - ItemPosCountVec dest; - uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, nullptr); - if (msg == EQUIP_ERR_OK) - player->StoreNewItem(dest, ITEM_SILVER_TOTEM, true); - } - } - - void EnterCombat(Unit* who) override - { - Talk(AGGRO_YELL_AQUE, who); - } - - void UpdateAI(uint32 diff) override - { - if (isFriendly) - { - if (SwitchFactionTimer <= diff) - { - me->SetFaction(FACTION_ELEMENTAL); - isFriendly = false; - } else SwitchFactionTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!isFriendly) - { - if (SendItemTimer <= diff) - { - if (me->GetVictim() && me->EnsureVictim()->GetTypeId() == TYPEID_PLAYER) - SendItem(me->GetVictim()); - SendItemTimer = 5000; - } else SendItemTimer -= diff; - } - - if (FrostShockTimer <= diff) - { - DoCastVictim(SPELL_FROST_SHOCK); - FrostShockTimer = 15000; - } else FrostShockTimer -= diff; - - if (AquaJetTimer <= diff) - { - DoCast(me, SPELL_AQUA_JET); - AquaJetTimer = 15000; - } else AquaJetTimer -= diff; - - DoMeleeAttackIfReady(); - } - }; - -}; - -/*###### ## npc_custodian_of_time ######*/ |