DB/Scripts: Greengill Slave

(cherry picked from commit c8a346a23c)
This commit is contained in:
Andrew Letson
2017-10-25 15:24:56 -04:00
committed by funjoker
parent 62a267e806
commit bc73b5f8a5
3 changed files with 19 additions and 95 deletions

View File

@@ -0,0 +1,19 @@
-- Greengill Slave
UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` IN (25084);
UPDATE `creature_template` SET `InhabitType` = 3 WHERE `entry` IN (25085);
-- These are reordered from c++-script so that conditions will work on linked events properly.
DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid IN (25084,25085));
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
(25084, 0, 0, 1, 8, 0, 100, 1, 45109, 0, 0, 0, 11, 45111, 2, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Greengill Slave - On Spellhit \'Orb of Murloc Control\' - Cast \'Enrage\''),
(25084, 0, 1, 2, 61, 0, 100, 0, 0, 0, 0, 0, 36, 25085, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Greengill Slave - IC - Load template'),
(25084, 0, 2, 3, 61, 0, 100, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 19, 25060, 100, 0, 0, 0, 0, 0, 'Greengill Slave - On Spellhit \'Orb of Murloc Control\' - Start Attacking'),
(25084, 0, 3, 0, 61, 0, 100, 0, 0, 0, 0, 0, 11, 45110, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 'Greengill Slave - On Spellhit \'Orb of Murloc Control\' - Cast \'Greengill Slave Freed\''),
(25084, 0, 4, 0, 1, 0, 100, 1, 30000, 30000, 0, 0, 36, 25084, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Freed Greengill Slave - OOC - reset template'),
(25084, 0, 5, 0, 7, 0, 100, 0, 0, 0, 0, 0, 41, 5000, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 'Freed Greengill Slave - on evade - despawn');
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=22 AND `SourceEntry`=25084;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(22, 1, 25084, 0, 0, 9, 0, 11541, 0, 0, 0, 0, 0, '', 'Smart event 2 for Greengill Slave will execute if quest Disrupt the Greengill Coast has been taken.'),
(22, 1, 25084, 0, 0, 1, 1, 45111, 1, 0, 1, 0, 0, '', 'Smart event 0 for Greengill Slave will execute if creature does not have aura Enrage.'),
(22, 6, 25084, 0, 0, 31, 1, 3, 25085, 0, 0, 0, 0, '', 'Smart event 5 for Greengill Slave will execute if creature is 25085');

View File

@@ -192,7 +192,6 @@ void AddSC_duskwood();
//void AddSC_eastern_plaguelands();
void AddSC_ghostlands();
void AddSC_hinterlands();
void AddSC_isle_of_queldanas();
void AddSC_redridge_mountains();
void AddSC_silverpine_forest();
void AddSC_stormwind_city();
@@ -384,7 +383,6 @@ void AddEasternKingdomsScripts()
//AddSC_eastern_plaguelands();
AddSC_ghostlands();
AddSC_hinterlands();
AddSC_isle_of_queldanas();
AddSC_redridge_mountains();
AddSC_silverpine_forest();
AddSC_stormwind_city();

View File

@@ -1,93 +0,0 @@
/*
* This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Isle_of_Queldanas
SD%Complete: 100
SDComment: Quest support: 11541
SDCategory: Isle Of Quel'Danas
EndScriptData */
/* ContentData
npc_greengill_slave
EndContentData */
#include "ScriptMgr.h"
#include "Player.h"
#include "ScriptedCreature.h"
#include "SpellInfo.h"
/*######
## npc_greengill_slave
######*/
enum GreengillSlave
{
NPC_DARKSPINE_MYRIDON = 25060,
QUEST_GREENGILL_COAST = 11541,
SPELL_ENRAGE = 45111,
SPELL_ORB_MURLOC_CONTROL = 45109,
SPELL_GREENGILL_SLAVE_FREED = 45110
};
class npc_greengill_slave : public CreatureScript
{
public:
npc_greengill_slave() : CreatureScript("npc_greengill_slave") { }
struct npc_greengill_slaveAI : public ScriptedAI
{
npc_greengill_slaveAI(Creature* creature) : ScriptedAI(creature) { }
void SpellHit(Unit* caster, SpellInfo const* spellInfo) override
{
Player* player = caster->ToPlayer();
if (!player)
return;
if (spellInfo->Id == SPELL_ORB_MURLOC_CONTROL && !me->HasAura(SPELL_ENRAGE))
{
if (player->GetQuestStatus(QUEST_GREENGILL_COAST) == QUEST_STATUS_INCOMPLETE)
DoCast(player, SPELL_GREENGILL_SLAVE_FREED, true);
DoCast(me, SPELL_ENRAGE);
if (Creature* Myrmidon = me->FindNearestCreature(NPC_DARKSPINE_MYRIDON, 70))
{
AddThreat(Myrmidon, 100000.0f);
AttackStart(Myrmidon);
}
}
}
void UpdateAI(uint32 /*diff*/) override
{
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_greengill_slaveAI(creature);
}
};
void AddSC_isle_of_queldanas()
{
new npc_greengill_slave();
}