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

Conflicts:
	src/server/game/Globals/ObjectMgr.cpp
This commit is contained in:
Vincent-Michael
2013-08-20 17:48:18 +02:00
15 changed files with 276 additions and 277 deletions

View File

@@ -505,93 +505,89 @@ public:
## npc_dark_rider_of_acherus
######*/
enum Spells_DR
enum DarkRiderOfAcherus
{
SAY_DARK_RIDER = 0,
SPELL_DESPAWN_HORSE = 51918
};
enum Says_DR
{
SAY_DARK_RIDER = 0
};
class npc_dark_rider_of_acherus : public CreatureScript
{
public:
npc_dark_rider_of_acherus() : CreatureScript("npc_dark_rider_of_acherus") { }
public:
npc_dark_rider_of_acherus() : CreatureScript("npc_dark_rider_of_acherus") { }
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_dark_rider_of_acherusAI(creature);
}
struct npc_dark_rider_of_acherusAI : public ScriptedAI
{
npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) {}
uint32 PhaseTimer;
uint32 Phase;
bool Intro;
uint64 TargetGUID;
void Reset() OVERRIDE
struct npc_dark_rider_of_acherusAI : public ScriptedAI
{
PhaseTimer = 4000;
Phase = 0;
Intro = false;
TargetGUID = 0;
}
npc_dark_rider_of_acherusAI(Creature* creature) : ScriptedAI(creature) { }
void UpdateAI(uint32 diff) OVERRIDE
{
if (!Intro || !TargetGUID)
return;
if (PhaseTimer <= diff)
void Reset() OVERRIDE
{
switch (Phase)
PhaseTimer = 4000;
Phase = 0;
Intro = false;
TargetGUID = 0;
}
void UpdateAI(uint32 diff) OVERRIDE
{
if (!Intro || !TargetGUID)
return;
if (PhaseTimer <= diff)
{
case 0:
me->MonsterSay(SAY_DARK_RIDER, LANG_UNIVERSAL, 0);
PhaseTimer = 5000;
Phase = 1;
break;
case 1:
if (Unit* target = Unit::GetUnit(*me, TargetGUID))
DoCast(target, SPELL_DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
case 2:
me->SetVisible(false);
PhaseTimer = 2000;
Phase = 3;
break;
case 3:
me->DespawnOrUnsummon();
break;
default:
break;
switch (Phase)
{
case 0:
Talk(SAY_DARK_RIDER);
PhaseTimer = 5000;
Phase = 1;
break;
case 1:
if (Unit* target = ObjectAccessor::GetUnit(*me, TargetGUID))
DoCast(target, SPELL_DESPAWN_HORSE, true);
PhaseTimer = 3000;
Phase = 2;
break;
case 2:
me->SetVisible(false);
PhaseTimer = 2000;
Phase = 3;
break;
case 3:
me->DespawnOrUnsummon();
break;
default:
break;
}
}
} else PhaseTimer -= diff;
else
PhaseTimer -= diff;
}
}
void InitDespawnHorse(Unit* who)
{
if (!who)
return;
void InitDespawnHorse(Unit* who)
TargetGUID = who->GetGUID();
me->SetWalk(true);
me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who);
me->SetTarget(TargetGUID);
Intro = true;
}
private:
uint32 PhaseTimer;
uint32 Phase;
bool Intro;
uint64 TargetGUID;
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
if (!who)
return;
TargetGUID = who->GetGUID();
me->SetWalk(true);
me->SetSpeed(MOVE_RUN, 0.4f);
me->GetMotionMaster()->MoveChase(who);
me->SetTarget(TargetGUID);
Intro = true;
return new npc_dark_rider_of_acherusAI(creature);
}
};
};
/*######
@@ -644,7 +640,6 @@ public:
}
void MoveInLineOfSight(Unit* who) OVERRIDE
{
ScriptedAI::MoveInLineOfSight(who);

View File

@@ -428,13 +428,13 @@ class npc_snobold_vassal : public CreatureScript
return;
case EVENT_HEAD_CRACK:
// commented out while SPELL_SNOBOLLED gets fixed
//if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID))
//if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID))
DoCastVictim(SPELL_HEAD_CRACK);
_events.ScheduleEvent(EVENT_HEAD_CRACK, 30*IN_MILLISECONDS);
return;
case EVENT_BATTER:
// commented out while SPELL_SNOBOLLED gets fixed
//if (Unit* target = Unit::GetPlayer(*me, m_uiTargetGUID))
//if (Unit* target = ObjectAccessor::GetPlayer(*me, m_uiTargetGUID))
DoCastVictim(SPELL_BATTER);
_events.ScheduleEvent(EVENT_BATTER, 10*IN_MILLISECONDS);
return;

View File

@@ -196,6 +196,22 @@ class FrostBombExplosion : public BasicEvent
uint64 _sindragosaGUID;
};
class FrostBeaconSelector
{
public:
FrostBeaconSelector(Unit* source) : _source(source) { }
bool operator()(Unit* target) const
{
return target->GetTypeId() == TYPEID_PLAYER &&
target != _source->GetVictim() &&
!target->HasAura(SPELL_ICE_TOMB_UNTARGETABLE);
}
private:
Unit* _source;
};
class boss_sindragosa : public CreatureScript
{
public:
@@ -466,7 +482,7 @@ class boss_sindragosa : public CreatureScript
me->GetMotionMaster()->MovePoint(POINT_AIR_PHASE_FAR, SindragosaAirPosFar);
break;
case EVENT_ICE_TOMB:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true, -SPELL_ICE_TOMB_UNTARGETABLE))
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, FrostBeaconSelector(me)))
{
Talk(EMOTE_WARN_FROZEN_ORB, target->GetGUID());
DoCast(target, SPELL_ICE_TOMB_DUMMY, true);

View File

@@ -465,23 +465,18 @@ public:
#####*/
#define SAY_OFFER "Care to try Grimbooze Thunderbrew's new jungle punch?"
#define SAY_HEMET_1 "Aye, I'll try it."
#define SAY_HEMET_2 "That's exactly what I needed!"
#define SAY_HEMET_3 "It's got my vote! That'll put hair on your chest like nothing else will."
#define SAY_HADRIUS_1 "I'm always up for something of Grimbooze's."
#define SAY_HADRIUS_2 "Well, so far, it tastes like something my wife would drink..."
#define SAY_HADRIUS_3 "Now, there's the kick I've come to expect from Grimbooze's drinks! I like it!"
#define SAY_TAMARA_1 "Sure!"
#define SAY_TAMARA_2 "Oh my..."
#define SAY_TAMARA_3 "Tastes like I'm drinking... engine degreaser!"
enum utils
enum JunglePunch
{
NPC_HEMET = 27986,
NPC_HADRIUS = 28047,
NPC_TAMARA = 28568,
SPELL_OFFER = 51962,
QUEST_ENTRY = 12645,
QUEST_TASTE_TEST = 12645,
SAY_HEMET_HADRIUS_TAMARA_1 = 0,
SAY_HEMET_HADRIUS_TAMARA_2 = 1,
SAY_HEMET_HADRIUS_TAMARA_3 = 2,
SAY_HEMET_4 = 3, // unused
SAY_HEMET_5 = 4 // unused
};
enum NesingwaryChildrensWeek
@@ -492,12 +487,12 @@ enum NesingwaryChildrensWeek
ORPHAN_WOLVAR = 33532,
TEXT_NESINGWARY_1 = 5,
TEXT_WOLVAR_ORPHAN_6 = 6,
TEXT_WOLVAR_ORPHAN_7 = 7,
TEXT_WOLVAR_ORPHAN_8 = 8,
TEXT_WOLVAR_ORPHAN_9 = 9,
TEXT_NESINGWARY_1 = 1,
TEXT_WOLVAR_ORPHAN_9 = 9
};
class npc_jungle_punch_target : public CreatureScript
@@ -520,7 +515,6 @@ public:
}
void MoveInLineOfSight(Unit* who) OVERRIDE
{
if (!phase && who && who->GetDistance2d(me) < 10.0f)
if (Player* player = who->ToPlayer())
@@ -585,99 +579,55 @@ public:
timer -= diff;
}
void UpdateAI(uint32 uiDiff) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
{
if (phase)
proceedCwEvent(uiDiff);
proceedCwEvent(diff);
if (!sayStep)
return;
if (sayTimer < uiDiff)
if (sayTimer < diff)
{
switch (sayStep)
{
case 0:
{
switch (me->GetEntry())
{
case NPC_HEMET: me->MonsterSay(SAY_HEMET_1, LANG_UNIVERSAL, 0); break;
case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_1, LANG_UNIVERSAL, 0); break;
case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_1, LANG_UNIVERSAL, 0); break;
}
sayTimer = 3000;
sayStep++;
break;
}
case 1:
{
switch (me->GetEntry())
{
case NPC_HEMET: me->MonsterSay(SAY_HEMET_2, LANG_UNIVERSAL, 0); break;
case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_2, LANG_UNIVERSAL, 0); break;
case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_2, LANG_UNIVERSAL, 0); break;
}
sayTimer = 3000;
sayStep++;
break;
}
case 2:
{
switch (me->GetEntry())
{
case NPC_HEMET: me->MonsterSay(SAY_HEMET_3, LANG_UNIVERSAL, 0); break;
case NPC_HADRIUS: me->MonsterSay(SAY_HADRIUS_3, LANG_UNIVERSAL, 0); break;
case NPC_TAMARA: me->MonsterSay(SAY_TAMARA_3, LANG_UNIVERSAL, 0); break;
}
sayTimer = 3000;
sayStep = 0;
break;
}
}
Talk(SAY_HEMET_HADRIUS_TAMARA_1 + sayStep - 1);
sayTimer = 3000;
sayStep++;
if (sayStep > 3) // end
sayStep = 0;
}
else
sayTimer -= uiDiff;
sayTimer -= diff;
}
void SpellHit(Unit* caster, const SpellInfo* proto) OVERRIDE
void SpellHit(Unit* caster, SpellInfo const* spellInfo) OVERRIDE
{
if (!proto || proto->Id != SPELL_OFFER)
if (spellInfo->Id != SPELL_OFFER)
return;
if (!caster->ToPlayer())
Player* player = caster->ToPlayer();
if (!player)
return;
QuestStatusMap::const_iterator itr = caster->ToPlayer()->getQuestStatusMap().find(QUEST_ENTRY);
Quest const* quest = sObjectMgr->GetQuestTemplate(QUEST_TASTE_TEST);
if (!quest)
return;
QuestStatusMap::const_iterator itr = player->getQuestStatusMap().find(QUEST_TASTE_TEST);
if (itr->second.Status != QUEST_STATUS_INCOMPLETE)
return;
for (uint8 i=0; i<3; i++)
for (uint8 i = 0; i < 3; ++i)
{
switch (i)
{
case 0:
if (NPC_HEMET != me->GetEntry())
continue;
else
break;
case 1:
if (NPC_HADRIUS != me->GetEntry())
continue;
else
break;
case 2:
if (NPC_TAMARA != me->GetEntry())
continue;
else
break;
}
if (quest->RequiredNpcOrGo[i] != me->GetEntry())
continue;
if (itr->second.CreatureOrGOCount[i] != 0)
continue;
caster->ToPlayer()->KilledMonsterCredit(me->GetEntry(), 0);
caster->ToPlayer()->Say(SAY_OFFER, LANG_UNIVERSAL);
sayStep = 0;
player->KilledMonsterCredit(me->GetEntry(), 0);
player->Say(SAY_OFFER, LANG_UNIVERSAL);
sayStep = 1;
break;
}
}

View File

@@ -334,13 +334,19 @@ class npc_wg_quest_giver : public CreatureScript
bool OnGossipHello(Player* player, Creature* creature) OVERRIDE
{
if (creature->IsQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
Battlefield* wintergrasp = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
if (!wintergrasp)
return true;
if (creature->IsVendor())
{
player->ADD_GOSSIP_ITEM_DB(Player::GetDefaultGossipMenuForSource(creature), 0, GOSSIP_SENDER_MAIN, GOSSIP_OPTION_VENDOR);
player->PlayerTalkClass->GetGossipMenu().AddGossipMenuItemData(0, 0, 0);
}
/// @todo: move this to conditions or something else
// Player::PrepareQuestMenu(guid)
if (creature->IsQuestGiver())
{
QuestRelationBounds objectQR = sObjectMgr->GetCreatureQuestRelationBounds(creature->GetEntry());
@@ -368,6 +374,9 @@ class npc_wg_quest_giver : public CreatureScript
if (!quest)
continue;
if (!player->CanTakeQuest(quest, false))
continue;
switch (questId)
{
// Horde attacker
@@ -377,15 +386,8 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_FUELING_THE_DEMOLISHERS_HORDE_ATT:
case QUEST_HEALING_WITH_ROSES_HORDE_ATT:
case QUEST_DEFEND_THE_SIEGE_HORDE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_HORDE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetAttackerTeam() != TEAM_HORDE)
continue;
break;
// Horde defender
case QUEST_BONES_AND_ARROWS_HORDE_DEF:
@@ -395,15 +397,8 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_HEALING_WITH_ROSES_HORDE_DEF:
case QUEST_TOPPLING_THE_TOWERS_HORDE_DEF:
case QUEST_STOP_THE_SIEGE_HORDE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_HORDE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetDefenderTeam() != TEAM_HORDE)
continue;
break;
// Alliance attacker
case QUEST_BONES_AND_ARROWS_ALLIANCE_ATT:
@@ -411,15 +406,8 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_NO_MERCY_FOR_THE_MERCILESS_ALLIANCE_ATT:
case QUEST_DEFEND_THE_SIEGE_ALLIANCE_ATT:
case QUEST_A_RARE_HERB_ALLIANCE_ATT:
if (wintergrasp->GetAttackerTeam() == TEAM_ALLIANCE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetAttackerTeam() != TEAM_ALLIANCE)
continue;
break;
// Alliance defender
case QUEST_BONES_AND_ARROWS_ALLIANCE_DEF:
@@ -428,27 +416,20 @@ class npc_wg_quest_giver : public CreatureScript
case QUEST_SHOUTHERN_SABOTAGE_ALLIANCE_DEF:
case QUEST_STOP_THE_SIEGE_ALLIANCE_DEF:
case QUEST_A_RARE_HERB_ALLIANCE_DEF:
if (wintergrasp->GetDefenderTeam() == TEAM_ALLIANCE)
{
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
}
if (wintergrasp->GetDefenderTeam() != TEAM_ALLIANCE)
continue;
break;
default:
QuestStatus status = player->GetQuestStatus(questId);
if (quest->IsAutoComplete() && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 4);
else if (status == QUEST_STATUS_NONE && player->CanTakeQuest(quest, false))
qm.AddMenuItem(questId, 2);
break;
}
if (quest->IsAutoComplete())
qm.AddMenuItem(questId, 4);
else if (player->GetQuestStatus(questId) == QUEST_STATUS_NONE)
qm.AddMenuItem(questId, 2);
}
}
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}

View File

@@ -198,6 +198,9 @@ enum Gurgthock
EMOTE_YGGDRAS_SPAWN = 4,
SAY_STINKBEARD_SPAWN = 5,
SAY_GURGTHOCK_ELEMENTAL_SPAWN = 6,
SAY_GURGTHOCK_7 = 7,
SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS = 8,
SAY_GURGTHOCK_9 = 9,
SAY_CALL_FOR_HELP = 0,
SAY_RECRUIT = 0,
@@ -319,9 +322,9 @@ public:
uiTimer = 2000;
uiPhase = 12;
break;
}
break;
}
}
break;
}
}
void UpdateAI(uint32 diff) OVERRIDE
@@ -341,8 +344,6 @@ public:
if (uiPhase)
{
Player* player = ObjectAccessor::GetPlayer(*me, _playerGUID);
if (uiTimer <= diff)
{
switch (uiPhase)
@@ -371,27 +372,14 @@ public:
uiPhase = 0;
break;
case 6:
{
if (!player)
return;
std::string sText = ("The grand Amphitheater of Anguish awaits, " + std::string(player->GetName()) + ". Remember, once a battle starts you have to stay in the area. WIN OR DIE!");
me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0);
uiTimer = 5000;
uiPhase = 9;
}
Talk(SAY_GURGTHOCK_7, _playerGUID);
uiTimer = 5000;
uiPhase = 9;
break;
case 7:
{
if (!player)
return;
std::string sText = ("Prepare to make you stand, " + std::string(player->GetName()) + "! Get in the Amphitheater and stand ready! Remember, you and your opponent must stay in the arena at all times or you will be disqualified!");
me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0);
uiTimer = 3000;
uiPhase = 8;
}
Talk(SAY_GURGTHOCK_9, _playerGUID);
uiTimer = 3000;
uiPhase = 8;
break;
case 8:
Talk(SAY_QUEST_ACCEPT_MAGNATAUR);
@@ -399,15 +387,9 @@ public:
uiPhase = 11;
break;
case 9:
{
if (!player)
return;
std::string sText = ("Here we are once again, ladies and gentlemen. The epic struggle between life and death in the Amphitheater of Anguish! For this round we have " + std::string(player->GetName()) + " versus the hulking jormungar, Yg... Yggd? Yggdoze? Who comes up with these names?! " + std::string(player->GetName()) + " versus big worm!");
me->MonsterYell(sText.c_str(), LANG_UNIVERSAL, 0);
uiTimer = 10000;
uiPhase = 10;
}
Talk(SAY_QUEST_AMPHITHEATER_ANGUISH_YGGDRAS, _playerGUID);
uiTimer = 10000;
uiPhase = 10;
break;
case 10:
me->SummonCreature(NPC_YGGDRAS, SpawnPosition[1], TEMPSUMMON_CORPSE_DESPAWN, 1000);
@@ -420,16 +402,10 @@ public:
uiPhase = 0;
break;
case 12:
{
if (!player)
return;
std::string sText = ("Prepare to make you stand, " + std::string(player->GetName()) + "! Get in the Amphitheater and stand ready! Remember, you and your opponent must stay in the arena at all times or you will be disqualified!");
me->MonsterSay(sText.c_str(), LANG_UNIVERSAL, 0);
Talk(SAY_GURGTHOCK_9, _playerGUID);
uiTimer = 5000;
uiPhase = 13;
}
break;
break;
case 13:
Talk(SAY_GURGTHOCK_ELEMENTAL_SPAWN);
uiTimer = 3000;
@@ -443,7 +419,8 @@ public:
break;
}
}
else uiTimer -= diff;
else
uiTimer -= diff;
}
}

View File

@@ -422,7 +422,6 @@ public:
{
damage = 0;
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
me->Yell(SUFF_SAY_RECAP, LANG_UNIVERSAL, 0);
Talk(SUFF_SAY_RECAP);
me->SetReactState(REACT_PASSIVE);
}
@@ -431,14 +430,13 @@ public:
void EnterCombat(Unit* /*who*/) OVERRIDE
{
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
{
{
Talk(SUFF_SAY_FREED);
DoZoneInCombat();
DoCast(me, AURA_OF_SUFFERING, true); // linked aura need core support
DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE, true);
DoCast(me, ESSENCE_OF_SUFFERING_PASSIVE2, true);
}
else return;
}
}
void KilledUnit(Unit* /*victim*/) OVERRIDE