diff options
-rw-r--r-- | sql/updates/3596_world_scripts.sql | 1 | ||||
-rw-r--r-- | sql/world_scripts_full.sql | 1 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp | 107 |
3 files changed, 109 insertions, 0 deletions
diff --git a/sql/updates/3596_world_scripts.sql b/sql/updates/3596_world_scripts.sql new file mode 100644 index 00000000000..14eafdb22db --- /dev/null +++ b/sql/updates/3596_world_scripts.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_death_knight_initiate' WHERE `entry`=28406; diff --git a/sql/world_scripts_full.sql b/sql/world_scripts_full.sql index e539a1229f8..97e4d15ca49 100644 --- a/sql/world_scripts_full.sql +++ b/sql/world_scripts_full.sql @@ -102,6 +102,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate' WHERE `entry UPDATE `creature_template` SET `ScriptName`='npc_unworthy_initiate_anchor' WHERE `entry`=29521; 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_taxi' WHERE `entry` IN (17435, 23413, 18725, 19401, 19409, 20235, 25059, 25236, 20903, 20162, 29154, 23415, 27575, 26443, 26949, 23816); +UPDATE `creature_template` SET `ScriptName`='npc_death_knight_initiate' WHERE `entry`=28406; /* */ /* ZONE */ diff --git a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp index d6ca087a026..4821269e2a1 100644 --- a/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/zone/eastern_plaguelands/the_scarlet_enclave.cpp @@ -360,6 +360,106 @@ bool GOHello_go_acherus_soul_prison(Player *player, GameObject* _GO) return false; } +/*###### +## npc_death_knight_initiate +######*/ + +#define GOSSIP_DKI "Duel with me!" + +#define SAY_DKI_DUEL1 "Remember this day, $N, for it is the day that you will be thoroughly owned." +#define SAY_DKI_DUEL2 "I'm going to tear your heart out, cupcake!" +#define SAY_DKI_DUEL3 "You have challenged death itself!" +#define SAY_DKI_DUEL4 "Don't make me laugh." +#define SAY_DKI_DUEL5 "Here come the tears..." +#define SAY_DKI_DUEL6 "No potions!" + +struct TRINITY_DLL_DECL npc_death_knight_initiateAI : public ScriptedAI +{ + npc_death_knight_initiateAI(Creature *c) : ScriptedAI(c) {Reset();} + + void Reset() + { + m_creature->setFaction(2084); + } + + void EnterCombat(Unit *who) { + if(who->GetTypeId() == TYPEID_PLAYER) { + switch(rand()%6) + { + case 0: DoSay(SAY_DKI_DUEL1, LANG_UNIVERSAL, who); break; + case 1: DoSay(SAY_DKI_DUEL2, LANG_UNIVERSAL, who); break; + case 2: DoSay(SAY_DKI_DUEL3, LANG_UNIVERSAL, who); break; + case 3: DoSay(SAY_DKI_DUEL4, LANG_UNIVERSAL, who); break; + case 4: DoSay(SAY_DKI_DUEL5, LANG_UNIVERSAL, who); break; + case 5: DoSay(SAY_DKI_DUEL6, LANG_UNIVERSAL, who); break; + } + } + } + + void Aggro(Unit *who) { } + + void JustDied(Unit *killer) { } + + void UpdateAI(const uint32 diff) + { + if ( !UpdateVictim() ) + return; + + Unit *victim = m_creature->getVictim(); + + if(victim->GetTypeId() == TYPEID_PLAYER) { + if ( (victim->GetHealth()*100)/victim->GetMaxHealth() <= 10 ) { + m_creature->setFaction(2084); + victim->AttackStop(); + m_creature->CombatStop(); + m_creature->RemoveAllAuras(); + EnterEvadeMode(); + } + } + + DoMeleeAttackIfReady(); + } + + void DamageTaken(Unit *done_by, uint32 & damage) + { + if(done_by->GetTypeId() == TYPEID_PLAYER && damage > m_creature->GetHealth()) + { + //Take 0 damage + damage = 0; + ((Player*)done_by)->AttackStop(); + ((Player*)done_by)->KilledMonster(29025,m_creature->GetGUID()); + m_creature->setFaction(2084); + m_creature->RemoveAllAuras(); + m_creature->CombatStop(); + EnterEvadeMode(); + } + } +}; + +CreatureAI* GetAI_npc_death_knight_initiate(Creature *_Creature) +{ + return new npc_death_knight_initiateAI(_Creature); +} + +bool GossipHello_npc_death_knight_initiate(Player *player, Creature *_Creature) +{ + if( player->GetQuestStatus(12733) == QUEST_STATUS_INCOMPLETE ) + player->ADD_GOSSIP_ITEM(0, GOSSIP_DKI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + player->SEND_GOSSIP_MENU(_Creature->GetNpcTextId(),_Creature->GetGUID()); + return true; +} + +bool GossipSelect_npc_death_knight_initiate(Player *player, Creature *_Creature, uint32 sender, uint32 action ) +{ + if( action == GOSSIP_ACTION_INFO_DEF ) + { + player->CastSpell(player, 52991, true); + _Creature->setFaction(14); + ((npc_death_knight_initiateAI*)_Creature->AI())->AttackStart(player); + } + return true; +} void AddSC_the_scarlet_enclave() { @@ -379,4 +479,11 @@ void AddSC_the_scarlet_enclave() newscript->Name="go_acherus_soul_prison"; newscript->pGOHello = &GOHello_go_acherus_soul_prison; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_death_knight_initiate"; + newscript->pGossipHello = &GossipHello_npc_death_knight_initiate; + newscript->pGossipSelect = &GossipSelect_npc_death_knight_initiate; + newscript->GetAI = &GetAI_npc_death_knight_initiate; + newscript->RegisterSelf(); }
\ No newline at end of file |