Merge remote-tracking branch 'origin/master' into mmaps

This commit is contained in:
Nay
2012-12-27 17:53:34 +00:00
75 changed files with 21494 additions and 223 deletions

View File

@@ -126,7 +126,6 @@ public:
{ "pickpocketing_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesPickpocketingCommand, "", NULL},
{ "points_of_interest", SEC_ADMINISTRATOR, true, &HandleReloadPointsOfInterestCommand, "", NULL },
{ "prospecting_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesProspectingCommand, "", NULL },
{ "quest_end_scripts", SEC_ADMINISTRATOR, true, &HandleReloadQuestEndScriptsCommand, "", NULL },
{ "quest_poi", SEC_ADMINISTRATOR, true, &HandleReloadQuestPOICommand, "", NULL },
{ "quest_template", SEC_ADMINISTRATOR, true, &HandleReloadQuestTemplateCommand, "", NULL },
{ "reference_loot_template", SEC_ADMINISTRATOR, true, &HandleReloadLootTemplatesReferenceCommand, "", NULL },
@@ -263,7 +262,6 @@ public:
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts...");
HandleReloadGameObjectScriptsCommand(handler, "a");
HandleReloadEventScriptsCommand(handler, "a");
HandleReloadQuestEndScriptsCommand(handler, "a");
HandleReloadSpellScriptsCommand(handler, "a");
handler->SendGlobalGMSysMessage("DB tables `*_scripts` reloaded.");
HandleReloadDbScriptStringCommand(handler, "a");
@@ -1043,26 +1041,6 @@ public:
return true;
}
static bool HandleReloadQuestEndScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())
{
handler->SendSysMessage("DB scripts used currently, please attempt reload later.");
handler->SetSentErrorMessage(true);
return false;
}
if (*args != 'a')
sLog->outInfo(LOG_FILTER_GENERAL, "Re-Loading Scripts from `quest_end_scripts`...");
sObjectMgr->LoadQuestEndScripts();
if (*args != 'a')
handler->SendGlobalGMSysMessage("DB table `quest_end_scripts` reloaded.");
return true;
}
static bool HandleReloadSpellScriptsCommand(ChatHandler* handler, const char* args)
{
if (sScriptMgr->IsScriptScheduled())

View File

@@ -1006,7 +1006,7 @@ class boss_icehowl : public CreatureScript
events.ScheduleEvent(EVENT_WHIRL, urand(15*IN_MILLISECONDS, 30*IN_MILLISECONDS));
return;
case EVENT_MASSIVE_CRASH:
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f); // 1: Middle of the room
me->GetMotionMaster()->MoveJump(ToCCommonLoc[1].GetPositionX(), ToCCommonLoc[1].GetPositionY(), ToCCommonLoc[1].GetPositionZ(), 20.0f, 20.0f, 0); // 1: Middle of the room
SetCombatMovement(false);
me->AttackStop();
_stage = 7; //Invalid (Do nothing more than move)
@@ -1059,7 +1059,7 @@ class boss_icehowl : public CreatureScript
_trampleTargetY = target->GetPositionY();
_trampleTargetZ = target->GetPositionZ();
// 2: Hop Backwards
me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f);
me->GetMotionMaster()->MoveJump(2*me->GetPositionX() - _trampleTargetX, 2*me->GetPositionY() - _trampleTargetY, me->GetPositionZ(), 30.0f, 20.0f, 0);
_stage = 7; //Invalid (Do nothing more than move)
}
else

View File

@@ -226,13 +226,13 @@ class boss_ick : public CreatureScript
case EVENT_TOXIC_WASTE:
if (Creature* krick = GetKrick())
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
krick->CastSpell(target, SPELL_TOXIC_WASTE, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
krick->CastSpell(target, SPELL_TOXIC_WASTE);
events.ScheduleEvent(EVENT_TOXIC_WASTE, urand(7000, 10000));
break;
case EVENT_SHADOW_BOLT:
if (Creature* krick = GetKrick())
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
krick->CastSpell(target, SPELL_SHADOW_BOLT, TRIGGERED_IGNORE_CASTER_MOUNTED_OR_ON_VEHICLE);
krick->CastSpell(target, SPELL_SHADOW_BOLT);
events.ScheduleEvent(EVENT_SHADOW_BOLT, 15000);
return;
case EVENT_MIGHTY_KICK:
@@ -322,7 +322,7 @@ class boss_krick : public CreatureScript
void KilledUnit(Unit* victim)
{
if (victim == me)
if (victim->GetTypeId() != TYPEID_PLAYER)
return;
Talk(SAY_KRICK_SLAY);

View File

@@ -232,7 +232,7 @@ class boss_sindragosa : public CreatureScript
}
}
void JustDied(Unit* killer)
void JustDied(Unit* /* killer */)
{
_JustDied();
Talk(SAY_DEATH);

View File

@@ -33,6 +33,8 @@ EndContentData */
#include "SpellScript.h"
#include "SpellAuraEffects.h"
#include "ScriptedEscortAI.h"
#include "Vehicle.h"
#include "CombatAI.h"
#include "Player.h"
enum eEnums
@@ -172,15 +174,27 @@ public:
};
/*######
## wyrmrest_defender
## Quest: Defending Wyrmrest Temple ID: 12372
######*/
enum WyrmDefenderEnum
{
QUEST_DEFENDING_WYRMREST_TEMPLE = 12372,
GOSSIP_TEXTID_DEF1 = 12899,
GOSSIP_TEXTID_DEF2 = 12900,
SPELL_CHARACTER_SCRIPT = 49213
// Quest data
QUEST_DEFENDING_WYRMREST_TEMPLE = 12372,
GOSSIP_TEXTID_DEF1 = 12899,
// Gossip data
GOSSIP_TEXTID_DEF2 = 12900,
// Spells data
SPELL_CHARACTER_SCRIPT = 49213,
SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE = 52421, // ID - 52421 Wyrmrest Defender: On Low Health Boss Emote to Controller - Random /self/
SPELL_RENEW = 49263, // casted to heal drakes
SPELL_WYRMREST_DEFENDER_MOUNT = 49256,
// Texts data
WHISPER_MOUNTED = 0,
BOSS_EMOTE_ON_LOW_HEALTH = 2
};
#define GOSSIP_ITEM_1 "We need to get into the fight. Are you ready?"
@@ -211,10 +225,79 @@ class npc_wyrmrest_defender : public CreatureScript
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_DEF2, creature->GetGUID());
// Makes player cast trigger spell for 49207 on self
player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true);
// The gossip should not auto close
}
return true;
}
struct npc_wyrmrest_defenderAI : public VehicleAI
{
npc_wyrmrest_defenderAI(Creature* creature) : VehicleAI(creature) { }
bool hpWarningReady;
bool renewRecoveryCanCheck;
uint32 RenewRecoveryChecker;
void Reset()
{
hpWarningReady = true;
renewRecoveryCanCheck = false;
RenewRecoveryChecker = 0;
}
void UpdateAI(uint32 const diff)
{
// Check system for Health Warning should happen first time whenever get under 30%,
// after it should be able to happen only after recovery of last renew is fully done (20 sec),
// next one used won't interfere
if (hpWarningReady && me->GetHealthPct() <= 30.0f)
{
me->CastSpell(me, SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE);
hpWarningReady = false;
}
if (renewRecoveryCanCheck)
{
if (RenewRecoveryChecker <= diff)
{
renewRecoveryCanCheck = false;
hpWarningReady = true;
}
else RenewRecoveryChecker -= diff;
}
}
void SpellHit(Unit* /*caster*/, SpellInfo const* spell)
{
switch (spell->Id)
{
case SPELL_WYRMREST_DEFENDER_MOUNT:
Talk(WHISPER_MOUNTED, me->GetCharmerOrOwnerGUID());
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
break;
// Both below are for checking low hp warning
case SPELL_DEFENDER_ON_LOW_HEALTH_EMOTE:
Talk(BOSS_EMOTE_ON_LOW_HEALTH, me->GetCharmerOrOwnerGUID());
break;
case SPELL_RENEW:
if (!hpWarningReady && RenewRecoveryChecker <= 100)
{
RenewRecoveryChecker = 20000;
}
renewRecoveryCanCheck = true;
break;
}
}
};
CreatureAI* GetAI(Creature* creature) const
{
return new npc_wyrmrest_defenderAI(creature);
}
};
void AddSC_dragonblight()

View File

@@ -31,7 +31,9 @@ enum eSays
SAY_AGGRO = 0,
SAY_KILL = 1,
SAY_TREE = 2,
SAY_DEATH = 3
SAY_SUMMON = 3,
SAY_DEATH = 4,
SAY_OOC_RANDOM = 5,
};
enum eSpells

View File

@@ -1284,7 +1284,10 @@ class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader
// 49370 - Wyrmrest Defender: Destabilize Azure Dragonshrine Effect
enum Quest12372Data
{
// NPCs
NPC_WYRMREST_TEMPLE_CREDIT = 27698,
// Spells
WHISPER_ON_HIT_BY_FORCE_WHISPER = 1
};
class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoader
@@ -1318,6 +1321,34 @@ class spell_q12372_destabilize_azure_dragonshrine_dummy : public SpellScriptLoad
}
};
// ID - 50287 Azure Dragon: On Death Force Cast Wyrmrest Defender to Whisper to Controller - Random (casted from Azure Dragons and Azure Drakes on death)
class spell_q12372_azure_on_death_force_whisper : public SpellScriptLoader
{
public:
spell_q12372_azure_on_death_force_whisper() : SpellScriptLoader("spell_q12372_azure_on_death_force_whisper") { }
class spell_q12372_azure_on_death_force_whisper_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q12372_azure_on_death_force_whisper_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Creature* defender = GetHitCreature())
defender->AI()->Talk(WHISPER_ON_HIT_BY_FORCE_WHISPER, defender->GetCharmerOrOwnerGUID());
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_q12372_azure_on_death_force_whisper_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_q12372_azure_on_death_force_whisper_SpellScript();
}
};
// "Bombing Run" and "Bomb Them Again!"
enum Quest11010_11102_11023Data
{
@@ -1522,4 +1553,5 @@ void AddSC_quest_spell_scripts()
new spell_q11010_q11102_q11023_aggro_burst();
new spell_q11010_q11102_q11023_choose_loc();
new spell_q11010_q11102_q11023_q11008_check_fly_mount();
new spell_q12372_azure_on_death_force_whisper();
}