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

This commit is contained in:
Subv
2012-08-27 15:30:27 -05:00
32 changed files with 416 additions and 57 deletions

View File

@@ -95,14 +95,17 @@ class boss_archaedas : public CreatureScript
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
}
void ActivateMinion(uint64 uiGuid, bool bFlag)
void ActivateMinion(uint64 uiGuid, bool flag)
{
Unit* pMinion = Unit::GetUnit(*me, uiGuid);
Unit* minion = Unit::GetUnit(*me, uiGuid);
if (pMinion && pMinion->isAlive())
if (minion && minion->isAlive())
{
DoCast(pMinion, SPELL_AWAKEN_VAULT_WALKER, bFlag);
pMinion->CastSpell(pMinion, SPELL_ARCHAEDAS_AWAKEN, true);
DoCast(minion, SPELL_AWAKEN_VAULT_WALKER, flag);
minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN, true);
minion->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
minion->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
minion->setFaction(14);
}
}

View File

@@ -202,6 +202,9 @@ class instance_uldaman : public InstanceMapScript
continue;
archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true);
target->CastSpell(target, SPELL_ARCHAEDAS_AWAKEN, true);
target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE);
target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
target->setFaction(14);
return; // only want the first one we find
}
}

View File

@@ -45,6 +45,8 @@ EndScriptData */
//Ohgans Spells
#define SPELL_SUNDERARMOR 24317
#define NPC_SPEAKER 11391
class boss_mandokir : public CreatureScript
{
public:
@@ -79,6 +81,7 @@ class boss_mandokir : public CreatureScript
bool someWatched;
bool RaptorDead;
bool CombatStart;
bool SpeakerDead;
uint64 WatchTarget;
@@ -103,6 +106,7 @@ class boss_mandokir : public CreatureScript
endWatch = false;
RaptorDead = false;
CombatStart = false;
SpeakerDead = false;
DoCast(me, 23243);
}
@@ -129,19 +133,31 @@ class boss_mandokir : public CreatureScript
}
}
}
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
DoCast(me, SPELL_LEVEL_UP, true);
KillCount = 0;
}
}
}
void EnterCombat(Unit* /*who*/)
{
DoScriptText(SAY_AGGRO, me);
DoScriptText(SAY_AGGRO, me);
}
void UpdateAI(const uint32 diff)
{
if (!SpeakerDead)
{
if (!me->FindNearestCreature(NPC_SPEAKER, 100.0f, true))
{
me->GetMotionMaster()->MovePoint(0, -12196.3f, -1948.37f, 130.36f);
SpeakerDead = true;
}
}
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && SpeakerDead)
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
if (!UpdateVictim())
return;

View File

@@ -79,16 +79,16 @@ public:
enum StrengthenAncientsMisc
{
SAY_WALKER_FRIENDLY = 0,
SAY_WALKER_ENEMY = 1,
SAY_LOTHALOR = 0,
SAY_WALKER_FRIENDLY = 0,
SAY_WALKER_ENEMY = 1,
SAY_LOTHALOR = 0,
SPELL_CREATE_ITEM_BARK = 47550,
SPELL_CONFUSED = 47044,
SPELL_CREATE_ITEM_BARK = 47550,
SPELL_CONFUSED = 47044,
NPC_LOTHALOR = 26321,
NPC_LOTHALOR = 26321,
FACTION_WALKER_ENEMY = 14,
FACTION_WALKER_ENEMY = 14,
};
class spell_q12096_q12092_dummy : public SpellScriptLoader // Strengthen the Ancients: On Interact Dummy to Woodlands Walker
@@ -170,9 +170,48 @@ public:
}
};
/*######
## wyrmrest_defender
######*/
enum Spells
{
SPELL_CHARACTER_SCRIPT = 49213
};
#define GOSSIP_ITEM_1 "We need to get into the fight. Are you ready?"
class npc_wyrmrest_defender : public CreatureScript
{
public:
npc_wyrmrest_defender() : CreatureScript("npc_wyrmrest_defender") { }
bool OnGossipHello(Player* player, Creature* creature)
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
// Makes player cast trigger spell for 49207 on self
player->CastSpell(player, SPELL_CHARACTER_SCRIPT, true);
}
return true;
}
};
void AddSC_dragonblight()
{
new npc_alexstrasza_wr_gate;
new spell_q12096_q12092_dummy;
new spell_q12096_q12092_bark;
new npc_wyrmrest_defender;
}

View File

@@ -502,7 +502,7 @@ class spell_wintergrasp_grab_passenger : public SpellScriptLoader
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Player* target = GetHitPlayer())
target->CastSpell(GetCaster(), SPELL_RIDE_WG_VEHICLE, true);
target->CastSpell(GetCaster(), SPELL_RIDE_WG_VEHICLE, false);
}
void Register()

View File

@@ -3076,6 +3076,96 @@ class spell_gen_mount : public SpellScriptLoader
uint32 _mount310;
};
enum FoamSword
{
ITEM_FOAM_SWORD_GREEN = 45061,
ITEM_FOAM_SWORD_PINK = 45176,
ITEM_FOAM_SWORD_BLUE = 45177,
ITEM_FOAM_SWORD_RED = 45178,
ITEM_FOAM_SWORD_YELLOW = 45179,
SPELL_BONKED = 62991,
SPELL_FOAM_SWORD_DEFEAT = 62994,
SPELL_ON_GUARD = 62972,
};
class spell_gen_upper_deck_create_foam_sword : public SpellScriptLoader
{
public:
spell_gen_upper_deck_create_foam_sword() : SpellScriptLoader("spell_gen_upper_deck_create_foam_sword") { }
class spell_gen_upper_deck_create_foam_sword_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_upper_deck_create_foam_sword_SpellScript);
void HandleScript(SpellEffIndex effIndex)
{
if (Player* player = GetHitPlayer())
{
static uint32 const itemId[5] = { ITEM_FOAM_SWORD_GREEN, ITEM_FOAM_SWORD_PINK, ITEM_FOAM_SWORD_BLUE, ITEM_FOAM_SWORD_RED, ITEM_FOAM_SWORD_YELLOW };
// player can only have one of these items
for (uint8 i = 0; i < 5; ++i)
{
if (player->HasItemCount(itemId[i], 1, true))
return;
}
CreateItem(effIndex, itemId[urand(0, 4)]);
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_gen_upper_deck_create_foam_sword_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_upper_deck_create_foam_sword_SpellScript();
}
};
class spell_gen_bonked : public SpellScriptLoader
{
public:
spell_gen_bonked() : SpellScriptLoader("spell_gen_bonked") { }
class spell_gen_bonked_SpellScript : public SpellScript
{
PrepareSpellScript(spell_gen_bonked_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
if (Player* target = GetHitPlayer())
{
Aura const* aura = GetHitAura();
if (!(aura && aura->GetStackAmount() == 3))
return;
target->CastSpell(target, SPELL_FOAM_SWORD_DEFEAT, true);
target->RemoveAurasDueToSpell(SPELL_BONKED);
if (Aura const* aura = target->GetAura(SPELL_ON_GUARD))
{
if (Item* item = target->GetItemByGuid(aura->GetCastItemGUID()))
target->DestroyItemCount(item->GetEntry(), 1, true);
}
}
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_gen_bonked_SpellScript::HandleScript, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_gen_bonked_SpellScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -3148,4 +3238,6 @@ void AddSC_generic_spell_scripts()
new spell_gen_mount("spell_blazing_hippogryph", 0, 0, 0, SPELL_BLAZING_HIPPOGRYPH_150, SPELL_BLAZING_HIPPOGRYPH_280);
new spell_gen_mount("spell_celestial_steed", 0, SPELL_CELESTIAL_STEED_60, SPELL_CELESTIAL_STEED_100, SPELL_CELESTIAL_STEED_150, SPELL_CELESTIAL_STEED_280, SPELL_CELESTIAL_STEED_310);
new spell_gen_mount("spell_x53_touring_rocket", 0, 0, 0, SPELL_X53_TOURING_ROCKET_150, SPELL_X53_TOURING_ROCKET_280, SPELL_X53_TOURING_ROCKET_310);
new spell_gen_upper_deck_create_foam_sword();
new spell_gen_bonked();
}

View File

@@ -1245,6 +1245,37 @@ class spell_q12735_song_of_cleansing : public SpellScriptLoader
}
};
enum DefendingWyrmrestTemple
{
SPELL_SUMMON_WYRMREST_DEFENDER = 49207
};
class spell_q12372_cast_from_gossip_trigger : public SpellScriptLoader
{
public:
spell_q12372_cast_from_gossip_trigger() : SpellScriptLoader("spell_q12372_cast_from_gossip_trigger") { }
class spell_q12372_cast_from_gossip_trigger_SpellScript : public SpellScript
{
PrepareSpellScript(spell_q12372_cast_from_gossip_trigger_SpellScript);
void HandleScript(SpellEffIndex /*effIndex*/)
{
GetCaster()->CastSpell(GetCaster(), SPELL_SUMMON_WYRMREST_DEFENDER, true);
}
void Register()
{
OnEffectHitTarget += SpellEffectFn(spell_q12372_cast_from_gossip_trigger_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
}
};
SpellScript* GetSpellScript() const
{
return new spell_q12372_cast_from_gossip_trigger_SpellScript();
}
};
void AddSC_quest_spell_scripts()
{
new spell_q55_sacred_cleansing();
@@ -1274,4 +1305,5 @@ void AddSC_quest_spell_scripts()
new spell_q12277_wintergarde_mine_explosion();
new spell_q12066_bunny_kill_credit();
new spell_q12735_song_of_cleansing();
new spell_q12372_cast_from_gossip_trigger();
}