Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Vincent-Michael committed 2014-09-05 18:26:56 +02:00
commit bbe58b2862
6 files changed
+328 -329

No files matched your search

@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,23 +15,21 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_jandicebarov
SD%Complete: 100
SDComment:
SDCategory: Scholomance
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Spells
{
SPELL_CURSEOFBLOOD = 24673,
//SPELL_ILLUSION = 17773,
SPELL_CURSE_OF_BLOOD = 24673,
SPELL_ILLUSION = 17773,
};
// Spells of Illusion of Jandice Barov
SPELL_CLEAVE = 15284
enum Events
{
EVENT_CURSE_OF_BLOOD = 1,
EVENT_ILLUSION,
EVENT_CLEAVE,
EVENT_SET_VISIBILITY
};
class boss_jandice_barov : public CreatureScript
@@ -40,189 +37,87 @@ class boss_jandice_barov : public CreatureScript
public:
boss_jandice_barov() : CreatureScript("boss_jandice_barov") { }
struct boss_jandicebarovAI : public ScriptedAI
{
boss_jandicebarovAI(Creature* creature) : ScriptedAI(creature), Summons(me) { }
void Reset() override
{
events.Reset();
Summons.DespawnAll();
}
void JustSummoned(Creature* summoned) override
{
// Illusions should attack a random target.
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
summoned->AI()->AttackStart(target);
summoned->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); // Not sure if this is correct.
Summons.Summon(summoned);
}
void EnterCombat(Unit* /*who*/) override
{
events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 15000);
events.ScheduleEvent(EVENT_ILLUSION, 30000);
}
void JustDied(Unit* /*killer*/) override
{
Summons.DespawnAll();
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch (eventId)
{
case EVENT_CURSE_OF_BLOOD:
DoCastVictim(SPELL_CURSE_OF_BLOOD);
events.ScheduleEvent(EVENT_CURSE_OF_BLOOD, 30000);
break;
case EVENT_ILLUSION:
DoCast(SPELL_ILLUSION);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11686); // Invisible Model
DoModifyThreatPercent(me->GetVictim(), -99);
events.ScheduleEvent(EVENT_SET_VISIBILITY, 3000);
events.ScheduleEvent(EVENT_ILLUSION, 25000);
break;
case EVENT_SET_VISIBILITY:
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11073); //Jandice Model
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
private:
EventMap events;
SummonList Summons;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_jandicebarovAI(creature);
}
struct boss_jandicebarovAI : public ScriptedAI
{
boss_jandicebarovAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
CurseOfBlood_Timer = 15000;
Illusion_Timer = 30000;
Invisible_Timer = 3000; //Too much too low?
Invisible = false;
}
uint32 CurseOfBlood_Timer;
uint32 Illusion_Timer;
//uint32 Illusioncounter;
uint32 Invisible_Timer;
bool Invisible;
void Reset() override
{
Initialize();
}
void EnterCombat(Unit* /*who*/) override
{
}
void SummonIllusions(Unit* victim)
{
if (Creature* Illusion = DoSpawnCreature(11439, float(irand(-9, 9)), float(irand(-9, 9)), 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000))
Illusion->AI()->AttackStart(victim);
}
void UpdateAI(uint32 diff) override
{
if (Invisible && Invisible_Timer <= diff)
{
//Become visible again
me->setFaction(14);
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11073); //Jandice Model
Invisible = false;
} else if (Invisible)
{
Invisible_Timer -= diff;
//Do nothing while invisible
return;
}
//Return since we have no target
if (!UpdateVictim())
return;
//CurseOfBlood_Timer
if (CurseOfBlood_Timer <= diff)
{
//Cast
DoCastVictim(SPELL_CURSEOFBLOOD);
//45 seconds
CurseOfBlood_Timer = 30000;
} else CurseOfBlood_Timer -= diff;
//Illusion_Timer
if (!Invisible && Illusion_Timer <= diff)
{
//Interrupt any spell casting
me->InterruptNonMeleeSpells(false);
me->setFaction(35);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->SetDisplayId(11686); // Invisible Model
DoModifyThreatPercent(me->GetVictim(), -99);
//Summon 10 Illusions attacking random gamers
Unit* target = NULL;
for (uint8 i = 0; i < 10; ++i)
{
target = SelectTarget(SELECT_TARGET_RANDOM, 0);
if (target)
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
// DoCastVictim(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
class npc_illusionofjandicebarov : public CreatureScript
{
public:
npc_illusionofjandicebarov() : CreatureScript("npc_illusionofjandicebarov") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new npc_illusionofjandicebarovAI(creature);
}
struct npc_illusionofjandicebarovAI : public ScriptedAI
{
npc_illusionofjandicebarovAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
Cleave_Timer = urand(2000, 8000);
}
uint32 Cleave_Timer;
void Reset() override
{
Initialize();
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true);
}
void EnterCombat(Unit* /*who*/) override
{
}
void UpdateAI(uint32 diff) override
{
//Return since we have no target
if (!UpdateVictim())
return;
//Cleave_Timer
if (Cleave_Timer <= diff)
{
//Cast
DoCastVictim(SPELL_CLEAVE);
//5-8 seconds
Cleave_Timer = urand(5000, 8000);
} else Cleave_Timer -= diff;
DoMeleeAttackIfReady();
}
};
};
void AddSC_boss_jandicebarov()
{
new boss_jandice_barov();
new npc_illusionofjandicebarov();
}
@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,13 +15,6 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_The_Maker
SD%Complete: 80
SDComment: Mind control no support
SDCategory: Hellfire Citadel, Blood Furnace
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
#include "blood_furnace.h"
@@ -42,6 +34,14 @@ enum Spells
SPELL_DOMINATION = 25772
};
enum Events
{
EVENT_ACID_SPRAY = 1,
EVENT_EXPLODING_BREAKER,
EVENT_DOMINATION,
EVENT_KNOCKDOWN
};
class boss_the_maker : public CreatureScript
{
public:
@@ -51,24 +51,15 @@ class boss_the_maker : public CreatureScript
{
boss_the_makerAI(Creature* creature) : BossAI(creature, DATA_THE_MAKER) { }
uint32 AcidSpray_Timer;
uint32 ExplodingBreaker_Timer;
uint32 Domination_Timer;
uint32 Knockdown_Timer;
void Reset() override
{
_Reset();
AcidSpray_Timer = 15000;
ExplodingBreaker_Timer = 6000;
Domination_Timer = 120000;
Knockdown_Timer = 10000;
}
void EnterCombat(Unit* /*who*/) override
{
_EnterCombat();
Talk(SAY_AGGRO);
events.ScheduleEvent(EVENT_ACID_SPRAY, 15000);
events.ScheduleEvent(EVENT_EXPLODING_BREAKER, 6000);
events.ScheduleEvent(EVENT_DOMINATION, 120000);
events.ScheduleEvent(EVENT_KNOCKDOWN, 10000);
}
void KilledUnit(Unit* who) override
@@ -83,49 +74,31 @@ class boss_the_maker : public CreatureScript
Talk(SAY_DIE);
}
void UpdateAI(uint32 diff) override
void ExecuteEvent(uint32 eventId) override
{
if (!UpdateVictim())
return;
if (AcidSpray_Timer <= diff)
switch (eventId)
{
DoCastVictim(SPELL_ACID_SPRAY);
AcidSpray_Timer = 15000 + rand32() % 8000;
case EVENT_ACID_SPRAY:
DoCastVictim(SPELL_ACID_SPRAY);
events.ScheduleEvent(EVENT_ACID_SPRAY, urand(15000, 23000));
break;
case EVENT_EXPLODING_BREAKER:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
DoCast(target, SPELL_EXPLODING_BREAKER);
events.ScheduleEvent(EVENT_EXPLODING_BREAKER, urand(4000, 12000));
break;
case EVENT_DOMINATION:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
DoCast(target, SPELL_DOMINATION);
events.ScheduleEvent(EVENT_DOMINATION, 120000);
break;
case EVENT_KNOCKDOWN:
DoCastVictim(SPELL_KNOCKDOWN);
events.ScheduleEvent(EVENT_KNOCKDOWN, urand(4000, 12000));
break;
default:
break;
}
else
AcidSpray_Timer -=diff;
if (ExplodingBreaker_Timer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
DoCast(target, SPELL_EXPLODING_BREAKER);
ExplodingBreaker_Timer = 4000 + rand32() % 8000;
}
else
ExplodingBreaker_Timer -=diff;
/* // Disabled until Core Support for mind control
if (domination_timer_timer <= diff)
{
Unit* target;
target = SelectUnit(SELECT_TARGET_RANDOM, 0);
DoCast(target, SPELL_DOMINATION);
domination_timer = 120000;
} else domination_timer -=diff;
*/
if (Knockdown_Timer <= diff)
{
DoCastVictim(SPELL_KNOCKDOWN);
Knockdown_Timer = 4000 + rand32() % 8000;
}
else
Knockdown_Timer -=diff;
DoMeleeAttackIfReady();
}
};
@@ -139,4 +112,3 @@ void AddSC_boss_the_maker()
{
new boss_the_maker();
}
@@ -19,7 +19,7 @@
/* ScriptData
SDName: Shadowmoon_Valley
SD%Complete: 100
SDComment: Quest support: 10519, 10583, 10601, 10804, 10854, 10458, 10481, 10480, 10781, 10451. Vendor Drake Dealer Hurlunk.
SDComment: Quest support: 10583, 10601, 10804, 10854, 10458, 10481, 10480, 10781, 10451. Vendor Drake Dealer Hurlunk.
SDCategory: Shadowmoon Valley
EndScriptData */
@@ -29,7 +29,6 @@ npc_enslaved_netherwing_drake
npc_drake_dealer_hurlunk
npcs_flanis_swiftwing_and_kagrosh
npc_karynaku
npc_oronok_tornheart
npc_overlord_morghor
npc_earthmender_wilda
npc_torloth_the_magnificent
@@ -492,81 +491,6 @@ public:
};
/*######
## 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."
class npc_oronok_tornheart : public CreatureScript
{
public:
npc_oronok_tornheart() : CreatureScript("npc_oronok_tornheart") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
switch (action)
{
case GOSSIP_ACTION_TRADE:
player->GetSession()->SendListInventory(creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF:
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(10313, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+1:
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
player->SEND_GOSSIP_MENU(10314, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
player->SEND_GOSSIP_MENU(10315, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK5, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(10316, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+4:
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK6, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+5);
player->SEND_GOSSIP_MENU(10317, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+5:
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+6);
player->SEND_GOSSIP_MENU(10318, creature->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+6:
player->CLOSE_GOSSIP_MENU();
player->AreaExploredOrEventHappens(10519);
break;
}
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (creature->IsVendor())
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
if (player->GetQuestStatus(10519) == QUEST_STATUS_INCOMPLETE)
{
player->ADD_GOSSIP_ITEM(0, GOSSIP_ORONOK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
player->SEND_GOSSIP_MENU(10312, creature->GetGUID());
}else
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*####
# npc_karynaku
####*/
@@ -1909,7 +1833,6 @@ void AddSC_shadowmoon_valley()
new npc_drake_dealer_hurlunk();
new npcs_flanis_swiftwing_and_kagrosh();
new npc_karynaku();
new npc_oronok_tornheart();
new npc_overlord_morghor();
new npc_earthmender_wilda();
new npc_lord_illidan_stormrage();