mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-14 17:49:10 +00:00
Big re-organization of repository [W.I.P]
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
# Copyright (C)
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
set(scripts_STAT_SRCS
|
||||
${scripts_STAT_SRCS}
|
||||
World/achievement_scripts.cpp
|
||||
World/areatrigger_scripts.cpp
|
||||
World/boss_emerald_dragons.cpp
|
||||
World/go_scripts.cpp
|
||||
World/guards.cpp
|
||||
World/item_scripts.cpp
|
||||
World/mob_generic_creature.cpp
|
||||
World/npc_innkeeper.cpp
|
||||
World/npc_professions.cpp
|
||||
World/npc_taxi.cpp
|
||||
World/npcs_special.cpp
|
||||
)
|
||||
|
||||
AC_ADD_SCRIPT_LOADER("World" "ScriptLoader.h")
|
||||
|
||||
message(" -> Prepared: World")
|
||||
@@ -1,275 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
#include "BattlegroundAB.h"
|
||||
#include "BattlegroundWS.h"
|
||||
#include "BattlegroundIC.h"
|
||||
#include "BattlegroundAV.h"
|
||||
#include "BattlegroundSA.h"
|
||||
#include "Vehicle.h"
|
||||
#include "Player.h"
|
||||
#include "Creature.h"
|
||||
|
||||
class achievement_resilient_victory : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_resilient_victory() : AchievementCriteriaScript("achievement_resilient_victory") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->GetBgTypeID() == BATTLEGROUND_AB && bg->ToBattlegroundAB()->IsTeamScores500Disadvantage(source->GetTeamId());
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_control_all_nodes : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_control_all_nodes() : AchievementCriteriaScript("achievement_bg_control_all_nodes") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->AllNodesConrolledByTeam(source->GetTeamId());
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_save_the_day : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_save_the_day() : AchievementCriteriaScript("achievement_save_the_day") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Player const* player = target->ToPlayer())
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->GetBgTypeID() == BATTLEGROUND_WS && bg->ToBattlegroundWS()->GetFlagState(player->GetTeamId()) == BG_WS_FLAG_STATE_ON_BASE;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_ic_resource_glut : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_ic_resource_glut() : AchievementCriteriaScript("achievement_bg_ic_resource_glut") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->GetBgTypeID() == BATTLEGROUND_IC && bg->ToBattlegroundIC()->IsResourceGlutAllowed(source->GetTeamId());
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_ic_glaive_grave : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_ic_glaive_grave() : AchievementCriteriaScript("achievement_bg_ic_glaive_grave") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
if (Creature* vehicle = source->GetVehicleCreatureBase())
|
||||
return vehicle->GetEntry() == NPC_GLAIVE_THROWER_H || vehicle->GetEntry() == NPC_GLAIVE_THROWER_A;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_ic_mowed_down : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_ic_mowed_down() : AchievementCriteriaScript("achievement_bg_ic_mowed_down") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
if (Creature* vehicle = source->GetVehicleCreatureBase())
|
||||
return vehicle->GetEntry() == NPC_KEEP_CANNON;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_sa_artillery : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_sa_artillery() : AchievementCriteriaScript("achievement_bg_sa_artillery") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
if (Creature* vehicle = source->GetVehicleCreatureBase())
|
||||
return vehicle->GetEntry() == NPC_ANTI_PERSONNAL_CANNON;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_arena_kills : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_arena_kills(char const* name, uint8 arenaType) : AchievementCriteriaScript(name),
|
||||
_arenaType(arenaType)
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
return source->InArena() && source->GetBattleground()->GetArenaType() == _arenaType;
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 const _arenaType;
|
||||
};
|
||||
|
||||
|
||||
class achievement_sickly_gazelle : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_sickly_gazelle() : AchievementCriteriaScript("achievement_sickly_gazelle") { }
|
||||
|
||||
bool OnCheck(Player* /*source*/, Unit* target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
if (Player* victim = target->ToPlayer())
|
||||
if (victim->IsMounted())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_everything_counts : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_everything_counts() : AchievementCriteriaScript("achievement_everything_counts") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->GetBgTypeID() == BATTLEGROUND_AV && bg->ToBattlegroundAV()->IsBothMinesControlledByTeam(source->GetTeamId());
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_bg_av_perfection : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_bg_av_perfection() : AchievementCriteriaScript("achievement_bg_av_perfection") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->GetBgTypeID() == BATTLEGROUND_AV && bg->ToBattlegroundAV()->IsAllTowersControlledAndCaptainAlive(source->GetTeamId());
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_sa_defense_of_the_ancients : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_sa_defense_of_the_ancients() : AchievementCriteriaScript("achievement_sa_defense_of_the_ancients") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
Battleground* bg = source->GetBattleground();
|
||||
return bg && bg->GetBgTypeID() == BATTLEGROUND_SA && bg->ToBattlegroundSA()->AllowDefenseOfTheAncients(source);
|
||||
}
|
||||
};
|
||||
|
||||
enum ArgentTournamentAreas
|
||||
{
|
||||
AREA_ARGENT_TOURNAMENT_FIELDS = 4658,
|
||||
AREA_RING_OF_ASPIRANTS = 4670,
|
||||
AREA_RING_OF_ARGENT_VALIANTS = 4671,
|
||||
AREA_RING_OF_ALLIANCE_VALIANTS = 4672,
|
||||
AREA_RING_OF_HORDE_VALIANTS = 4673,
|
||||
AREA_RING_OF_CHAMPIONS = 4669,
|
||||
};
|
||||
|
||||
class achievement_tilted : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_tilted() : AchievementCriteriaScript("achievement_tilted") {}
|
||||
|
||||
bool OnCheck(Player* player, Unit* /*target*/)
|
||||
{
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
uint32 areaid = player->GetAreaId();
|
||||
bool checkArea = areaid == AREA_ARGENT_TOURNAMENT_FIELDS ||
|
||||
areaid == AREA_RING_OF_ASPIRANTS ||
|
||||
areaid == AREA_RING_OF_ARGENT_VALIANTS ||
|
||||
areaid == AREA_RING_OF_ALLIANCE_VALIANTS ||
|
||||
areaid == AREA_RING_OF_HORDE_VALIANTS ||
|
||||
areaid == AREA_RING_OF_CHAMPIONS;
|
||||
|
||||
return checkArea && player->duel && player->duel->isMounted;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_not_even_a_scratch : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_not_even_a_scratch() : AchievementCriteriaScript("achievement_not_even_a_scratch") { }
|
||||
|
||||
bool OnCheck(Player* source, Unit* /*target*/)
|
||||
{
|
||||
if (!source)
|
||||
return false;
|
||||
|
||||
Battleground* battleground = source->GetBattleground();
|
||||
return battleground && battleground->GetBgTypeID() == BATTLEGROUND_SA && battleground->ToBattlegroundSA()->notEvenAScratch(source->GetTeamId());
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_killed_exp_or_honor_target : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_killed_exp_or_honor_target() : AchievementCriteriaScript("achievement_killed_exp_or_honor_target") { }
|
||||
|
||||
bool OnCheck(Player* player, Unit* target)
|
||||
{
|
||||
return target && player->isHonorOrXPTarget(target);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_achievement_scripts()
|
||||
{
|
||||
new achievement_resilient_victory();
|
||||
new achievement_bg_control_all_nodes();
|
||||
new achievement_save_the_day();
|
||||
new achievement_bg_ic_resource_glut();
|
||||
new achievement_bg_ic_glaive_grave();
|
||||
new achievement_bg_ic_mowed_down();
|
||||
new achievement_bg_sa_artillery();
|
||||
new achievement_sickly_gazelle();
|
||||
new achievement_everything_counts();
|
||||
new achievement_bg_av_perfection();
|
||||
new achievement_arena_kills("achievement_arena_2v2_kills", ARENA_TYPE_2v2);
|
||||
new achievement_arena_kills("achievement_arena_3v3_kills", ARENA_TYPE_3v3);
|
||||
new achievement_arena_kills("achievement_arena_5v5_kills", ARENA_TYPE_5v5);
|
||||
new achievement_sa_defense_of_the_ancients();
|
||||
new achievement_tilted();
|
||||
new achievement_not_even_a_scratch();
|
||||
new achievement_killed_exp_or_honor_target();
|
||||
}
|
||||
@@ -1,473 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Areatrigger_Scripts
|
||||
SD%Complete: 100
|
||||
SDComment: Scripts for areatriggers
|
||||
SDCategory: Areatrigger
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
at_coilfang_waterfall 4591
|
||||
at_legion_teleporter 4560 Teleporter TO Invasion Point: Cataclysm
|
||||
at_stormwright_shelf q12741
|
||||
at_last_rites q12019
|
||||
at_sholazar_waygate q12548
|
||||
at_nats_landing q11209
|
||||
at_bring_your_orphan_to q910 q910 q1800 q1479 q1687 q1558 q10951 q10952
|
||||
at_brewfest
|
||||
at_area_52_entrance
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
// Ours
|
||||
class AreaTrigger_at_voltarus_middle : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_voltarus_middle()
|
||||
: AreaTriggerScript("at_voltarus_middle")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
|
||||
{
|
||||
if (player->IsAlive() && !player->IsInCombat())
|
||||
if (player->HasItemCount(39319)) // Scepter of Domination
|
||||
{
|
||||
player->TeleportTo(571, 6242.67f, -1972.10f, 484.783f, 0.6f);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Theirs
|
||||
/*######
|
||||
## at_coilfang_waterfall
|
||||
######*/
|
||||
|
||||
enum CoilfangGOs
|
||||
{
|
||||
GO_COILFANG_WATERFALL = 184212
|
||||
};
|
||||
|
||||
class AreaTrigger_at_coilfang_waterfall : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_coilfang_waterfall()
|
||||
: AreaTriggerScript("at_coilfang_waterfall")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
|
||||
{
|
||||
if (GameObject* go = GetClosestGameObjectWithEntry(player, GO_COILFANG_WATERFALL, 35.0f))
|
||||
if (go->getLootState() == GO_READY)
|
||||
go->UseDoorOrButton();
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
## at_legion_teleporter
|
||||
#####*/
|
||||
|
||||
enum LegionTeleporter
|
||||
{
|
||||
SPELL_TELE_A_TO = 37387,
|
||||
QUEST_GAINING_ACCESS_A = 10589,
|
||||
|
||||
SPELL_TELE_H_TO = 37389,
|
||||
QUEST_GAINING_ACCESS_H = 10604
|
||||
};
|
||||
|
||||
class AreaTrigger_at_legion_teleporter : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_legion_teleporter()
|
||||
: AreaTriggerScript("at_legion_teleporter")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
|
||||
{
|
||||
if (player->IsAlive() && !player->IsInCombat())
|
||||
{
|
||||
if (player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestRewardStatus(QUEST_GAINING_ACCESS_A))
|
||||
{
|
||||
player->CastSpell(player, SPELL_TELE_A_TO, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player->GetTeamId() == TEAM_HORDE && player->GetQuestRewardStatus(QUEST_GAINING_ACCESS_H))
|
||||
{
|
||||
player->CastSpell(player, SPELL_TELE_H_TO, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_stormwright_shelf
|
||||
######*/
|
||||
|
||||
enum StormwrightShelf
|
||||
{
|
||||
QUEST_STRENGTH_OF_THE_TEMPEST = 12741,
|
||||
|
||||
SPELL_CREATE_TRUE_POWER_OF_THE_TEMPEST = 53067
|
||||
};
|
||||
|
||||
class AreaTrigger_at_stormwright_shelf : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_stormwright_shelf()
|
||||
: AreaTriggerScript("at_stormwright_shelf")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
|
||||
{
|
||||
if (!player->isDead() && player->GetQuestStatus(QUEST_STRENGTH_OF_THE_TEMPEST) == QUEST_STATUS_INCOMPLETE)
|
||||
player->CastSpell(player, SPELL_CREATE_TRUE_POWER_OF_THE_TEMPEST, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_scent_larkorwi
|
||||
######*/
|
||||
|
||||
enum ScentLarkorwi
|
||||
{
|
||||
QUEST_SCENT_OF_LARKORWI = 4291,
|
||||
NPC_LARKORWI_MATE = 9683
|
||||
};
|
||||
|
||||
class AreaTrigger_at_scent_larkorwi : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_scent_larkorwi()
|
||||
: AreaTriggerScript("at_scent_larkorwi")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
|
||||
{
|
||||
if (!player->isDead() && player->GetQuestStatus(QUEST_SCENT_OF_LARKORWI) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (!player->FindNearestCreature(NPC_LARKORWI_MATE, 15))
|
||||
player->SummonCreature(NPC_LARKORWI_MATE, player->GetPositionX()+5, player->GetPositionY(), player->GetPositionZ(), 3.3f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
## at_last_rites
|
||||
#####*/
|
||||
|
||||
enum AtLastRites
|
||||
{
|
||||
QUEST_LAST_RITES = 12019,
|
||||
QUEST_BREAKING_THROUGH = 11898,
|
||||
};
|
||||
|
||||
class AreaTrigger_at_last_rites : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_last_rites()
|
||||
: AreaTriggerScript("at_last_rites")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
{
|
||||
QuestStatus QLR = player->GetQuestStatus(QUEST_LAST_RITES);
|
||||
QuestStatus QBT = player->GetQuestStatus(QUEST_BREAKING_THROUGH);
|
||||
if (!(QLR == QUEST_STATUS_INCOMPLETE || QLR == QUEST_STATUS_COMPLETE ||
|
||||
QBT == QUEST_STATUS_INCOMPLETE || QBT == QUEST_STATUS_COMPLETE))
|
||||
return false;
|
||||
|
||||
WorldLocation pPosition;
|
||||
|
||||
switch (trigger->id)
|
||||
{
|
||||
case 5332:
|
||||
case 5338:
|
||||
case 5339:
|
||||
pPosition = WorldLocation(571, 3733.68f, 3563.25f, 290.812f, 3.665192f);
|
||||
break;
|
||||
case 5334:
|
||||
pPosition = WorldLocation(571, 3802.38f, 3585.95f, 49.5765f, 0.0f);
|
||||
break;
|
||||
case 5340:
|
||||
if (QBT == QUEST_STATUS_INCOMPLETE)
|
||||
pPosition = WorldLocation(571, 3758, 3562, 345.51f, 0.0f);
|
||||
else
|
||||
pPosition = WorldLocation(571, 3687.91f, 3577.28f, 473.342f, 0.0f);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
player->TeleportTo(pPosition);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_sholazar_waygate
|
||||
######*/
|
||||
|
||||
enum Waygate
|
||||
{
|
||||
SPELL_SHOLAZAR_TO_UNGORO_TELEPORT = 52056,
|
||||
SPELL_UNGORO_TO_SHOLAZAR_TELEPORT = 52057,
|
||||
|
||||
AT_SHOLAZAR = 5046,
|
||||
AT_UNGORO = 5047,
|
||||
|
||||
QUEST_THE_MAKERS_OVERLOOK = 12613,
|
||||
QUEST_THE_MAKERS_PERCH = 12559,
|
||||
QUEST_MEETING_A_GREAT_ONE = 13956,
|
||||
};
|
||||
|
||||
class AreaTrigger_at_sholazar_waygate : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
|
||||
AreaTrigger_at_sholazar_waygate() : AreaTriggerScript("at_sholazar_waygate") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
{
|
||||
if (!player->isDead() && (player->GetQuestStatus(QUEST_MEETING_A_GREAT_ONE) != QUEST_STATUS_NONE ||
|
||||
(player->GetQuestStatus(QUEST_THE_MAKERS_OVERLOOK) == QUEST_STATUS_REWARDED && player->GetQuestStatus(QUEST_THE_MAKERS_PERCH) == QUEST_STATUS_REWARDED)))
|
||||
{
|
||||
switch (trigger->id)
|
||||
{
|
||||
case AT_SHOLAZAR:
|
||||
player->CastSpell(player, SPELL_SHOLAZAR_TO_UNGORO_TELEPORT, true);
|
||||
break;
|
||||
|
||||
case AT_UNGORO:
|
||||
player->CastSpell(player, SPELL_UNGORO_TO_SHOLAZAR_TELEPORT, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_nats_landing
|
||||
######*/
|
||||
|
||||
enum NatsLanding
|
||||
{
|
||||
QUEST_NATS_BARGAIN = 11209,
|
||||
SPELL_FISH_PASTE = 42644,
|
||||
NPC_LURKING_SHARK = 23928
|
||||
};
|
||||
|
||||
class AreaTrigger_at_nats_landing : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
AreaTrigger_at_nats_landing() : AreaTriggerScript("at_nats_landing") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*trigger*/)
|
||||
{
|
||||
if (!player->IsAlive() || !player->HasAura(SPELL_FISH_PASTE))
|
||||
return false;
|
||||
|
||||
if (player->GetQuestStatus(QUEST_NATS_BARGAIN) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (!player->FindNearestCreature(NPC_LURKING_SHARK, 20.0f))
|
||||
{
|
||||
if (Creature* shark = player->SummonCreature(NPC_LURKING_SHARK, -4246.243f, -3922.356f, -7.488f, 5.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 100000))
|
||||
shark->AI()->AttackStart(player);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_brewfest
|
||||
######*/
|
||||
|
||||
enum Brewfest
|
||||
{
|
||||
NPC_TAPPER_SWINDLEKEG = 24711,
|
||||
NPC_IPFELKOFER_IRONKEG = 24710,
|
||||
|
||||
AT_BREWFEST_DUROTAR = 4829,
|
||||
AT_BREWFEST_DUN_MOROGH = 4820,
|
||||
|
||||
SAY_WELCOME = 4,
|
||||
|
||||
AREATRIGGER_TALK_COOLDOWN = 5, // in seconds
|
||||
};
|
||||
|
||||
class AreaTrigger_at_brewfest : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
AreaTrigger_at_brewfest() : AreaTriggerScript("at_brewfest")
|
||||
{
|
||||
// Initialize for cooldown
|
||||
_triggerTimes[AT_BREWFEST_DUROTAR] = _triggerTimes[AT_BREWFEST_DUN_MOROGH] = 0;
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
{
|
||||
uint32 triggerId = trigger->id;
|
||||
// Second trigger happened too early after first, skip for now
|
||||
if (sWorld->GetGameTime() - _triggerTimes[triggerId] < AREATRIGGER_TALK_COOLDOWN)
|
||||
return false;
|
||||
|
||||
switch (triggerId)
|
||||
{
|
||||
case AT_BREWFEST_DUROTAR:
|
||||
if (Creature* tapper = player->FindNearestCreature(NPC_TAPPER_SWINDLEKEG, 20.0f))
|
||||
tapper->AI()->Talk(SAY_WELCOME, player);
|
||||
break;
|
||||
case AT_BREWFEST_DUN_MOROGH:
|
||||
if (Creature* ipfelkofer = player->FindNearestCreature(NPC_IPFELKOFER_IRONKEG, 20.0f))
|
||||
ipfelkofer->AI()->Talk(SAY_WELCOME, player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_triggerTimes[triggerId] = sWorld->GetGameTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<uint32, time_t> _triggerTimes;
|
||||
};
|
||||
|
||||
/*######
|
||||
## at_area_52_entrance
|
||||
######*/
|
||||
|
||||
enum Area52Entrance
|
||||
{
|
||||
SPELL_A52_NEURALYZER = 34400,
|
||||
NPC_SPOTLIGHT = 19913,
|
||||
SUMMON_COOLDOWN = 5,
|
||||
|
||||
AT_AREA_52_SOUTH = 4472,
|
||||
AT_AREA_52_NORTH = 4466,
|
||||
AT_AREA_52_WEST = 4471,
|
||||
AT_AREA_52_EAST = 4422,
|
||||
};
|
||||
|
||||
class AreaTrigger_at_area_52_entrance : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
AreaTrigger_at_area_52_entrance() : AreaTriggerScript("at_area_52_entrance")
|
||||
{
|
||||
_triggerTimes[AT_AREA_52_SOUTH] = _triggerTimes[AT_AREA_52_NORTH] = _triggerTimes[AT_AREA_52_WEST] = _triggerTimes[AT_AREA_52_EAST] = 0;
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* trigger)
|
||||
{
|
||||
float x = 0.0f, y = 0.0f, z = 0.0f;
|
||||
|
||||
if (!player->IsAlive())
|
||||
return false;
|
||||
|
||||
uint32 triggerId = trigger->id;
|
||||
if (sWorld->GetGameTime() - _triggerTimes[trigger->id] < SUMMON_COOLDOWN)
|
||||
return false;
|
||||
|
||||
switch (triggerId)
|
||||
{
|
||||
case AT_AREA_52_EAST:
|
||||
x = 3044.176f;
|
||||
y = 3610.692f;
|
||||
z = 143.61f;
|
||||
break;
|
||||
case AT_AREA_52_NORTH:
|
||||
x = 3114.87f;
|
||||
y = 3687.619f;
|
||||
z = 143.62f;
|
||||
break;
|
||||
case AT_AREA_52_WEST:
|
||||
x = 3017.79f;
|
||||
y = 3746.806f;
|
||||
z = 144.27f;
|
||||
break;
|
||||
case AT_AREA_52_SOUTH:
|
||||
x = 2950.63f;
|
||||
y = 3719.905f;
|
||||
z = 143.33f;
|
||||
break;
|
||||
}
|
||||
|
||||
player->SummonCreature(NPC_SPOTLIGHT, x, y, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 5000);
|
||||
player->AddAura(SPELL_A52_NEURALYZER, player);
|
||||
_triggerTimes[trigger->id] = sWorld->GetGameTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<uint32, time_t> _triggerTimes;
|
||||
};
|
||||
|
||||
void AddSC_areatrigger_scripts()
|
||||
{
|
||||
// Ours
|
||||
new AreaTrigger_at_voltarus_middle();
|
||||
|
||||
// Theirs
|
||||
new AreaTrigger_at_coilfang_waterfall();
|
||||
new AreaTrigger_at_legion_teleporter();
|
||||
new AreaTrigger_at_stormwright_shelf();
|
||||
new AreaTrigger_at_scent_larkorwi();
|
||||
new AreaTrigger_at_last_rites();
|
||||
new AreaTrigger_at_sholazar_waygate();
|
||||
new AreaTrigger_at_nats_landing();
|
||||
new AreaTrigger_at_brewfest();
|
||||
new AreaTrigger_at_area_52_entrance();
|
||||
}
|
||||
@@ -1,775 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "ObjectMgr.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "PassiveAI.h"
|
||||
|
||||
//
|
||||
// Emerald Dragon NPCs and IDs (kept here for reference)
|
||||
//
|
||||
|
||||
enum EmeraldDragonNPC
|
||||
{
|
||||
NPC_DREAM_FOG = 15224,
|
||||
DRAGON_YSONDRE = 14887,
|
||||
DRAGON_LETHON = 14888,
|
||||
DRAGON_EMERISS = 14889,
|
||||
DRAGON_TAERAR = 14890,
|
||||
};
|
||||
|
||||
//
|
||||
// Emerald Dragon Spells (used for the dragons)
|
||||
//
|
||||
|
||||
enum EmeraldDragonSpells
|
||||
{
|
||||
SPELL_TAIL_SWEEP = 15847, // tail sweep - slap everything behind dragon (2 seconds interval)
|
||||
SPELL_SUMMON_PLAYER = 24776, // teleport highest threat player in front of dragon if wandering off
|
||||
SPELL_DREAM_FOG = 24777, // auraspell for Dream Fog NPC (15224)
|
||||
SPELL_SLEEP = 24778, // sleep triggerspell (used for Dream Fog)
|
||||
SPELL_SEEPING_FOG_LEFT = 24813, // dream fog - summon left
|
||||
SPELL_SEEPING_FOG_RIGHT = 24814, // dream fog - summon right
|
||||
SPELL_NOXIOUS_BREATH = 24818,
|
||||
SPELL_MARK_OF_NATURE = 25040, // Mark of Nature trigger (applied on target death - 15 minutes of being suspectible to Aura Of Nature)
|
||||
SPELL_MARK_OF_NATURE_AURA = 25041, // Mark of Nature (passive marker-test, ticks every 10 seconds from boss, triggers spellID 25042 (scripted)
|
||||
SPELL_AURA_OF_NATURE = 25043, // Stun for 2 minutes (used when SPELL_MARK_OF_NATURE exists on the target)
|
||||
};
|
||||
|
||||
//
|
||||
// Emerald Dragon Eventlists (shared and specials)
|
||||
//
|
||||
|
||||
enum Events
|
||||
{
|
||||
// General events for all dragons
|
||||
EVENT_SEEPING_FOG = 1,
|
||||
EVENT_NOXIOUS_BREATH,
|
||||
EVENT_TAIL_SWEEP,
|
||||
|
||||
// Ysondre
|
||||
EVENT_LIGHTNING_WAVE,
|
||||
EVENT_SUMMON_DRUID_SPIRITS,
|
||||
|
||||
// Lethon
|
||||
EVENT_SHADOW_BOLT_WHIRL,
|
||||
|
||||
// Emeriss
|
||||
EVENT_VOLATILE_INFECTION,
|
||||
EVENT_CORRUPTION_OF_EARTH,
|
||||
|
||||
// Taerar
|
||||
EVENT_ARCANE_BLAST,
|
||||
EVENT_BELLOWING_ROAR,
|
||||
};
|
||||
|
||||
/*
|
||||
* ---
|
||||
* --- Emerald Dragons : Base AI-structure used for all the Emerald dragons
|
||||
* ---
|
||||
*/
|
||||
|
||||
struct emerald_dragonAI : public WorldBossAI
|
||||
{
|
||||
emerald_dragonAI(Creature* creature) : WorldBossAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
WorldBossAI::Reset();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
DoCast(me, SPELL_MARK_OF_NATURE_AURA, true);
|
||||
events.ScheduleEvent(EVENT_TAIL_SWEEP, 4000);
|
||||
events.ScheduleEvent(EVENT_NOXIOUS_BREATH, urand(7500, 15000));
|
||||
events.ScheduleEvent(EVENT_SEEPING_FOG, urand(12500, 20000));
|
||||
}
|
||||
|
||||
// Target killed during encounter, mark them as suspectible for Aura Of Nature
|
||||
void KilledUnit(Unit* who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
who->CastSpell(who, SPELL_MARK_OF_NATURE, true);
|
||||
}
|
||||
|
||||
// Execute and reschedule base events shared between all Emerald Dragons
|
||||
void ExecuteEvent(uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SEEPING_FOG:
|
||||
// Seeping Fog appears only as "pairs", and only ONE pair at any given time!
|
||||
// Despawntime is 2 minutes, so reschedule it for new cast after 2 minutes + a minor "random time" (30 seconds at max)
|
||||
DoCast(me, SPELL_SEEPING_FOG_LEFT, true);
|
||||
DoCast(me, SPELL_SEEPING_FOG_RIGHT, true);
|
||||
events.ScheduleEvent(EVENT_SEEPING_FOG, urand(120000, 150000));
|
||||
break;
|
||||
case EVENT_NOXIOUS_BREATH:
|
||||
// Noxious Breath is cast on random intervals, no less than 7.5 seconds between
|
||||
DoCast(me, SPELL_NOXIOUS_BREATH);
|
||||
events.ScheduleEvent(EVENT_NOXIOUS_BREATH, urand(7500, 15000));
|
||||
break;
|
||||
case EVENT_TAIL_SWEEP:
|
||||
// Tail Sweep is cast every two seconds, no matter what goes on in front of the dragon
|
||||
DoCast(me, SPELL_TAIL_SWEEP);
|
||||
events.ScheduleEvent(EVENT_TAIL_SWEEP, 2000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
ExecuteEvent(eventId);
|
||||
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, -50.0f, true))
|
||||
DoCast(target, SPELL_SUMMON_PLAYER);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* --- NPC: Dream Fog
|
||||
*/
|
||||
|
||||
class npc_dream_fog : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_dream_fog() : CreatureScript("npc_dream_fog") { }
|
||||
|
||||
struct npc_dream_fogAI : public ScriptedAI
|
||||
{
|
||||
npc_dream_fogAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_roamTimer = 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (!_roamTimer)
|
||||
{
|
||||
// Chase target, but don't attack - otherwise just roam around
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
{
|
||||
_roamTimer = urand(15000, 30000);
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MoveChase(target, 0.2f);
|
||||
}
|
||||
else
|
||||
{
|
||||
_roamTimer = 2500;
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
me->GetMotionMaster()->MoveRandom(25.0f);
|
||||
}
|
||||
// Seeping fog movement is slow enough for a player to be able to walk backwards and still outpace it
|
||||
me->SetWalk(true);
|
||||
me->SetSpeed(MOVE_WALK, 0.75f);
|
||||
}
|
||||
else
|
||||
_roamTimer -= diff;
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _roamTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_dream_fogAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* ---
|
||||
* --- Dragonspecific scripts and handling: YSONDRE
|
||||
* ---
|
||||
*/
|
||||
|
||||
enum YsondreNPC
|
||||
{
|
||||
NPC_DEMENTED_DRUID = 15260,
|
||||
};
|
||||
|
||||
enum YsondreTexts
|
||||
{
|
||||
SAY_YSONDRE_AGGRO = 0,
|
||||
SAY_YSONDRE_SUMMON_DRUIDS = 1,
|
||||
};
|
||||
|
||||
enum YsondreSpells
|
||||
{
|
||||
SPELL_LIGHTNING_WAVE = 24819,
|
||||
SPELL_SUMMON_DRUID_SPIRITS = 24795,
|
||||
};
|
||||
|
||||
class boss_ysondre : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_ysondre() : CreatureScript("boss_ysondre") { }
|
||||
|
||||
struct boss_ysondreAI : public emerald_dragonAI
|
||||
{
|
||||
boss_ysondreAI(Creature* creature) : emerald_dragonAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_stage = 1;
|
||||
emerald_dragonAI::Reset();
|
||||
events.ScheduleEvent(EVENT_LIGHTNING_WAVE, 12000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_YSONDRE_AGGRO);
|
||||
WorldBossAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
// Summon druid spirits on 75%, 50% and 25% health
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
Talk(SAY_YSONDRE_SUMMON_DRUIDS);
|
||||
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
DoCast(me, SPELL_SUMMON_DRUID_SPIRITS, true);
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_LIGHTNING_WAVE:
|
||||
DoCastVictim(SPELL_LIGHTNING_WAVE);
|
||||
events.ScheduleEvent(EVENT_LIGHTNING_WAVE, urand(10000, 20000));
|
||||
break;
|
||||
default:
|
||||
emerald_dragonAI::ExecuteEvent(eventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _stage;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_ysondreAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* ---
|
||||
* --- Dragonspecific scripts and handling: LETHON
|
||||
* ---
|
||||
*
|
||||
* @todo
|
||||
* - Spell: Shadow bolt whirl casts needs custom handling (spellscript)
|
||||
*/
|
||||
|
||||
enum LethonTexts
|
||||
{
|
||||
SAY_LETHON_AGGRO = 0,
|
||||
SAY_LETHON_DRAW_SPIRIT = 1,
|
||||
};
|
||||
|
||||
enum LethonSpells
|
||||
{
|
||||
SPELL_DRAW_SPIRIT = 24811,
|
||||
SPELL_SHADOW_BOLT_WHIRL = 24834,
|
||||
SPELL_DARK_OFFERING = 24804,
|
||||
};
|
||||
|
||||
enum LethonCreatures
|
||||
{
|
||||
NPC_SPIRIT_SHADE = 15261,
|
||||
};
|
||||
|
||||
class boss_lethon : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_lethon() : CreatureScript("boss_lethon") { }
|
||||
|
||||
struct boss_lethonAI : public emerald_dragonAI
|
||||
{
|
||||
boss_lethonAI(Creature* creature) : emerald_dragonAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_stage = 1;
|
||||
emerald_dragonAI::Reset();
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_WHIRL, 10000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_LETHON_AGGRO);
|
||||
WorldBossAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
Talk(SAY_LETHON_DRAW_SPIRIT);
|
||||
DoCast(me, SPELL_DRAW_SPIRIT);
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, SpellInfo const* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_DRAW_SPIRIT && target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Position targetPos;
|
||||
target->GetPosition(&targetPos);
|
||||
me->SummonCreature(NPC_SPIRIT_SHADE, targetPos, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
|
||||
}
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SHADOW_BOLT_WHIRL:
|
||||
me->CastSpell((Unit*)NULL, SPELL_SHADOW_BOLT_WHIRL, false);
|
||||
events.ScheduleEvent(EVENT_SHADOW_BOLT_WHIRL, urand(15000, 30000));
|
||||
break;
|
||||
default:
|
||||
emerald_dragonAI::ExecuteEvent(eventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _stage;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_lethonAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_spirit_shade : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_spirit_shade() : CreatureScript("npc_spirit_shade") { }
|
||||
|
||||
struct npc_spirit_shadeAI : public PassiveAI
|
||||
{
|
||||
npc_spirit_shadeAI(Creature* creature) : PassiveAI(creature), _summonerGuid(0)
|
||||
{
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner)
|
||||
{
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
_summonerGuid = summoner->GetGUID();
|
||||
me->GetMotionMaster()->MoveFollow(summoner, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 moveType, uint32 data)
|
||||
{
|
||||
if (moveType == FOLLOW_MOTION_TYPE && data == _summonerGuid)
|
||||
{
|
||||
me->CastSpell((Unit*)NULL, SPELL_DARK_OFFERING, false);
|
||||
me->DespawnOrUnsummon(1000);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _summonerGuid;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_spirit_shadeAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* ---
|
||||
* --- Dragonspecific scripts and handling: EMERISS
|
||||
* ---
|
||||
*/
|
||||
|
||||
enum EmerissTexts
|
||||
{
|
||||
SAY_EMERISS_AGGRO = 0,
|
||||
SAY_EMERISS_CAST_CORRUPTION = 1,
|
||||
};
|
||||
|
||||
enum EmerissSpells
|
||||
{
|
||||
SPELL_PUTRID_MUSHROOM = 24904,
|
||||
SPELL_CORRUPTION_OF_EARTH = 24910,
|
||||
SPELL_VOLATILE_INFECTION = 24928,
|
||||
};
|
||||
|
||||
class boss_emeriss : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_emeriss() : CreatureScript("boss_emeriss") { }
|
||||
|
||||
struct boss_emerissAI : public emerald_dragonAI
|
||||
{
|
||||
boss_emerissAI(Creature* creature) : emerald_dragonAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_stage = 1;
|
||||
emerald_dragonAI::Reset();
|
||||
events.ScheduleEvent(EVENT_VOLATILE_INFECTION, 12000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
DoCast(who, SPELL_PUTRID_MUSHROOM, true);
|
||||
emerald_dragonAI::KilledUnit(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_EMERISS_AGGRO);
|
||||
WorldBossAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
Talk(SAY_EMERISS_CAST_CORRUPTION);
|
||||
DoCast(me, SPELL_CORRUPTION_OF_EARTH, true);
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_VOLATILE_INFECTION:
|
||||
DoCastVictim(SPELL_VOLATILE_INFECTION);
|
||||
events.ScheduleEvent(EVENT_VOLATILE_INFECTION, 120000);
|
||||
break;
|
||||
default:
|
||||
emerald_dragonAI::ExecuteEvent(eventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 _stage;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_emerissAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* ---
|
||||
* --- Dragonspecific scripts and handling: TAERAR
|
||||
* ---
|
||||
*/
|
||||
|
||||
enum TaerarTexts
|
||||
{
|
||||
SAY_TAERAR_AGGRO = 0,
|
||||
SAY_TAERAR_SUMMON_SHADES = 1,
|
||||
};
|
||||
|
||||
enum TaerarSpells
|
||||
{
|
||||
SPELL_BELLOWING_ROAR = 22686,
|
||||
SPELL_SHADE = 24313,
|
||||
SPELL_SUMMON_SHADE_1 = 24841,
|
||||
SPELL_SUMMON_SHADE_2 = 24842,
|
||||
SPELL_SUMMON_SHADE_3 = 24843,
|
||||
SPELL_ARCANE_BLAST = 24857,
|
||||
};
|
||||
|
||||
uint32 const TaerarShadeSpells[] =
|
||||
{
|
||||
SPELL_SUMMON_SHADE_1, SPELL_SUMMON_SHADE_2, SPELL_SUMMON_SHADE_3
|
||||
};
|
||||
|
||||
class boss_taerar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_taerar() : CreatureScript("boss_taerar") { }
|
||||
|
||||
struct boss_taerarAI : public emerald_dragonAI
|
||||
{
|
||||
boss_taerarAI(Creature* creature) : emerald_dragonAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_SHADE);
|
||||
_stage = 1;
|
||||
|
||||
_shades = 0;
|
||||
_banished = false;
|
||||
_banishedTimer = 0;
|
||||
|
||||
emerald_dragonAI::Reset();
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 12000);
|
||||
events.ScheduleEvent(EVENT_BELLOWING_ROAR, 30000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_TAERAR_AGGRO);
|
||||
emerald_dragonAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* /*summon*/, Unit*)
|
||||
{
|
||||
--_shades;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
// At 75, 50 or 25 percent health, we need to activate the shades and go "banished"
|
||||
// Note: _stage holds the amount of times they have been summoned
|
||||
if (!_banished && !HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
_banished = true;
|
||||
_banishedTimer = 60000;
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
DoStopAttack();
|
||||
|
||||
Talk(SAY_TAERAR_SUMMON_SHADES);
|
||||
|
||||
uint32 count = sizeof(TaerarShadeSpells) / sizeof(uint32);
|
||||
for (uint32 i = 0; i < count; ++i)
|
||||
DoCastVictim(TaerarShadeSpells[i], true);
|
||||
_shades += count;
|
||||
|
||||
DoCast(SPELL_SHADE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ARCANE_BLAST:
|
||||
DoCast(SPELL_ARCANE_BLAST);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, urand(7000, 12000));
|
||||
break;
|
||||
case EVENT_BELLOWING_ROAR:
|
||||
DoCast(SPELL_BELLOWING_ROAR);
|
||||
events.ScheduleEvent(EVENT_BELLOWING_ROAR, urand(20000, 30000));
|
||||
break;
|
||||
default:
|
||||
emerald_dragonAI::ExecuteEvent(eventId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!me->IsInCombat())
|
||||
return;
|
||||
|
||||
if (_banished)
|
||||
{
|
||||
// If all three shades are dead, OR it has taken too long, end the current event and get Taerar back into business
|
||||
if (_banishedTimer <= diff || !_shades)
|
||||
{
|
||||
_banished = false;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->RemoveAurasDueToSpell(SPELL_SHADE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
// _banishtimer has not expired, and we still have active shades:
|
||||
else
|
||||
_banishedTimer -= diff;
|
||||
|
||||
// Update the events before we return (handled under emerald_dragonAI::UpdateAI(diff); if we're not inside this check)
|
||||
events.Update(diff);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
emerald_dragonAI::UpdateAI(diff);
|
||||
}
|
||||
|
||||
private:
|
||||
bool _banished; // used for shades activation testing
|
||||
uint32 _banishedTimer; // counter for banishment timeout
|
||||
uint8 _shades; // keep track of how many shades are dead
|
||||
uint8 _stage; // check which "shade phase" we're at (75-50-25 percentage counters)
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_taerarAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* --- Spell: Dream Fog
|
||||
*/
|
||||
|
||||
class spell_dream_fog_sleep : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_dream_fog_sleep() : SpellScriptLoader("spell_dream_fog_sleep") { }
|
||||
|
||||
class spell_dream_fog_sleep_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_dream_fog_sleep_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SLEEP));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_dream_fog_sleep_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_dream_fog_sleep_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* --- Spell: Mark of Nature
|
||||
*/
|
||||
|
||||
class MarkOfNatureTargetSelector
|
||||
{
|
||||
public:
|
||||
MarkOfNatureTargetSelector() { }
|
||||
|
||||
bool operator()(WorldObject* object)
|
||||
{
|
||||
// return those not tagged or already under the influence of Aura of Nature
|
||||
if (Unit* unit = object->ToUnit())
|
||||
return !(unit->HasAura(SPELL_MARK_OF_NATURE) && !unit->HasAura(SPELL_AURA_OF_NATURE));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_nature : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mark_of_nature() : SpellScriptLoader("spell_mark_of_nature") { }
|
||||
|
||||
class spell_mark_of_nature_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mark_of_nature_SpellScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_NATURE))
|
||||
return false;
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_AURA_OF_NATURE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(MarkOfNatureTargetSelector());
|
||||
}
|
||||
|
||||
void HandleEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetHitUnit()->CastSpell(GetHitUnit(), SPELL_AURA_OF_NATURE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mark_of_nature_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mark_of_nature_SpellScript::HandleEffect, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mark_of_nature_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_emerald_dragons()
|
||||
{
|
||||
// helper NPC scripts
|
||||
new npc_dream_fog();
|
||||
new npc_spirit_shade();
|
||||
|
||||
// dragons
|
||||
new boss_ysondre();
|
||||
new boss_taerar();
|
||||
new boss_emeriss();
|
||||
new boss_lethon();
|
||||
|
||||
// dragon spellscripts
|
||||
new spell_dream_fog_sleep();
|
||||
new spell_mark_of_nature();
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Guards
|
||||
SD%Complete: 100
|
||||
SDComment:
|
||||
SDCategory: Guards
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
guard_generic
|
||||
guard_shattrath_aldor
|
||||
guard_shattrath_scryer
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "GuardAI.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
enum GuardShattrath
|
||||
{
|
||||
SPELL_BANISHED_SHATTRATH_A = 36642,
|
||||
SPELL_BANISHED_SHATTRATH_S = 36671,
|
||||
SPELL_BANISH_TELEPORT = 36643,
|
||||
SPELL_EXILE = 39533
|
||||
};
|
||||
|
||||
class guard_shattrath_scryer : public CreatureScript
|
||||
{
|
||||
public:
|
||||
guard_shattrath_scryer() : CreatureScript("guard_shattrath_scryer") { }
|
||||
|
||||
struct guard_shattrath_scryerAI : public GuardAI
|
||||
{
|
||||
guard_shattrath_scryerAI(Creature* creature) : GuardAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
banishTimer = 5000;
|
||||
exileTimer = 8500;
|
||||
playerGUID = 0;
|
||||
canTeleport = false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (canTeleport)
|
||||
{
|
||||
if (exileTimer <= diff)
|
||||
{
|
||||
if (Unit* temp = ObjectAccessor::GetUnit(*me, playerGUID))
|
||||
{
|
||||
temp->CastSpell(temp, SPELL_EXILE, true);
|
||||
temp->CastSpell(temp, SPELL_BANISH_TELEPORT, true);
|
||||
}
|
||||
playerGUID = 0;
|
||||
exileTimer = 8500;
|
||||
canTeleport = false;
|
||||
} else exileTimer -= diff;
|
||||
}
|
||||
else if (banishTimer <= diff)
|
||||
{
|
||||
Unit* temp = me->GetVictim();
|
||||
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DoCast(temp, SPELL_BANISHED_SHATTRATH_A);
|
||||
banishTimer = 9000;
|
||||
playerGUID = temp->GetGUID();
|
||||
if (playerGUID)
|
||||
canTeleport = true;
|
||||
}
|
||||
} else banishTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 exileTimer;
|
||||
uint32 banishTimer;
|
||||
uint64 playerGUID;
|
||||
bool canTeleport;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new guard_shattrath_scryerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class guard_shattrath_aldor : public CreatureScript
|
||||
{
|
||||
public:
|
||||
guard_shattrath_aldor() : CreatureScript("guard_shattrath_aldor") { }
|
||||
|
||||
struct guard_shattrath_aldorAI : public GuardAI
|
||||
{
|
||||
guard_shattrath_aldorAI(Creature* creature) : GuardAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
banishTimer = 5000;
|
||||
exileTimer = 8500;
|
||||
playerGUID = 0;
|
||||
canTeleport = false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (canTeleport)
|
||||
{
|
||||
if (exileTimer <= diff)
|
||||
{
|
||||
if (Unit* temp = ObjectAccessor::GetUnit(*me, playerGUID))
|
||||
{
|
||||
temp->CastSpell(temp, SPELL_EXILE, true);
|
||||
temp->CastSpell(temp, SPELL_BANISH_TELEPORT, true);
|
||||
}
|
||||
playerGUID = 0;
|
||||
exileTimer = 8500;
|
||||
canTeleport = false;
|
||||
} else exileTimer -= diff;
|
||||
}
|
||||
else if (banishTimer <= diff)
|
||||
{
|
||||
Unit* temp = me->GetVictim();
|
||||
if (temp && temp->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
DoCast(temp, SPELL_BANISHED_SHATTRATH_S);
|
||||
banishTimer = 9000;
|
||||
playerGUID = temp->GetGUID();
|
||||
if (playerGUID)
|
||||
canTeleport = true;
|
||||
}
|
||||
} else banishTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint32 exileTimer;
|
||||
uint32 banishTimer;
|
||||
uint64 playerGUID;
|
||||
bool canTeleport;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new guard_shattrath_aldorAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_guards()
|
||||
{
|
||||
new guard_shattrath_aldor();
|
||||
new guard_shattrath_scryer();
|
||||
}
|
||||
@@ -1,287 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Item_Scripts
|
||||
SD%Complete: 100
|
||||
SDComment: Items for a range of different items. See content below (in script)
|
||||
SDCategory: Items
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
item_nether_wraith_beacon(i31742) Summons creatures for quest Becoming a Spellfire Tailor (q10832)
|
||||
item_flying_machine(i34060, i34061) Engineering crafted flying machines
|
||||
item_gor_dreks_ointment(i30175) Protecting Our Own(q10488)
|
||||
item_only_for_flight Items which should only useable while flying
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "Player.h"
|
||||
|
||||
/*#####
|
||||
# item_only_for_flight
|
||||
#####*/
|
||||
|
||||
enum OnlyForFlight
|
||||
{
|
||||
SPELL_ARCANE_CHARGES = 45072
|
||||
};
|
||||
|
||||
class item_only_for_flight : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_only_for_flight() : ItemScript("item_only_for_flight") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/)
|
||||
{
|
||||
uint32 itemId = item->GetEntry();
|
||||
bool disabled = false;
|
||||
|
||||
//for special scripts
|
||||
switch (itemId)
|
||||
{
|
||||
case 24538:
|
||||
if (player->GetAreaId() != 3628)
|
||||
disabled = true;
|
||||
break;
|
||||
case 34489:
|
||||
if (player->GetZoneId() != 4080)
|
||||
disabled = true;
|
||||
break;
|
||||
case 34475:
|
||||
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_ARCANE_CHARGES))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_ON_GROUND);
|
||||
break;
|
||||
}
|
||||
|
||||
// allow use in flight only
|
||||
if (player->IsInFlight() && !disabled)
|
||||
return false;
|
||||
|
||||
// error
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_nether_wraith_beacon
|
||||
#####*/
|
||||
|
||||
class item_nether_wraith_beacon : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_nether_wraith_beacon() : ItemScript("item_nether_wraith_beacon") { }
|
||||
|
||||
bool OnUse(Player* player, Item* /*item*/, SpellCastTargets const& /*targets*/)
|
||||
{
|
||||
if (player->GetQuestStatus(10832) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY()+20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
nether->AI()->AttackStart(player);
|
||||
|
||||
if (Creature* nether = player->SummonCreature(22408, player->GetPositionX(), player->GetPositionY()-20, player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
nether->AI()->AttackStart(player);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_gor_dreks_ointment
|
||||
#####*/
|
||||
|
||||
class item_gor_dreks_ointment : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_gor_dreks_ointment() : ItemScript("item_gor_dreks_ointment") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& targets)
|
||||
{
|
||||
if (targets.GetUnitTarget() && targets.GetUnitTarget()->GetTypeId() == TYPEID_UNIT &&
|
||||
targets.GetUnitTarget()->GetEntry() == 20748 && !targets.GetUnitTarget()->HasAura(32578))
|
||||
return false;
|
||||
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_incendiary_explosives
|
||||
#####*/
|
||||
|
||||
class item_incendiary_explosives : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_incendiary_explosives() : ItemScript("item_incendiary_explosives") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const & /*targets*/)
|
||||
{
|
||||
if (player->FindNearestCreature(26248, 15) || player->FindNearestCreature(26249, 15))
|
||||
return false;
|
||||
else
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_mysterious_egg
|
||||
#####*/
|
||||
|
||||
class item_mysterious_egg : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_mysterious_egg() : ItemScript("item_mysterious_egg") { }
|
||||
|
||||
bool OnExpire(Player* player, ItemTemplate const* /*pItemProto*/)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 39883, 1); // Cracked Egg
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
player->StoreNewItem(dest, 39883, true, Item::GenerateItemRandomPropertyId(39883));
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_disgusting_jar
|
||||
#####*/
|
||||
|
||||
class item_disgusting_jar : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_disgusting_jar() : ItemScript("item_disgusting_jar") { }
|
||||
|
||||
bool OnExpire(Player* player, ItemTemplate const* /*pItemProto*/)
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 44718, 1); // Ripe Disgusting Jar
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
player->StoreNewItem(dest, 44718, true, Item::GenerateItemRandomPropertyId(44718));
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*#####
|
||||
# item_petrov_cluster_bombs
|
||||
#####*/
|
||||
|
||||
enum PetrovClusterBombs
|
||||
{
|
||||
SPELL_PETROV_BOMB = 42406,
|
||||
AREA_ID_SHATTERED_STRAITS = 4064,
|
||||
ZONE_ID_HOWLING = 495
|
||||
};
|
||||
|
||||
class item_petrov_cluster_bombs : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_petrov_cluster_bombs() : ItemScript("item_petrov_cluster_bombs") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/)
|
||||
{
|
||||
if (player->GetZoneId() != ZONE_ID_HOWLING)
|
||||
return false;
|
||||
|
||||
if (!player->GetTransport() || player->GetAreaId() != AREA_ID_SHATTERED_STRAITS)
|
||||
{
|
||||
player->SendEquipError(EQUIP_ERR_NONE, item, NULL);
|
||||
|
||||
if (const SpellInfo* spellInfo = sSpellMgr->GetSpellInfo(SPELL_PETROV_BOMB))
|
||||
Spell::SendCastResult(player, spellInfo, 1, SPELL_FAILED_NOT_HERE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
enum TheEmissary
|
||||
{
|
||||
QUEST_THE_EMISSARY = 11626,
|
||||
NPC_LEVIROTH = 26452
|
||||
};
|
||||
|
||||
class item_trident_of_nazjan : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_trident_of_nazjan() : ItemScript("item_Trident_of_Nazjan") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, const SpellCastTargets & /*targets*/)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_EMISSARY) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (Creature* pLeviroth = player->FindNearestCreature(NPC_LEVIROTH, 10.0f)) // spell range
|
||||
{
|
||||
pLeviroth->AI()->AttackStart(player);
|
||||
return false;
|
||||
} else
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
} else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
enum CapturedFrog
|
||||
{
|
||||
QUEST_THE_PERFECT_SPIES = 25444,
|
||||
NPC_VANIRAS_SENTRY_TOTEM = 40187
|
||||
};
|
||||
|
||||
class item_captured_frog : public ItemScript
|
||||
{
|
||||
public:
|
||||
item_captured_frog() : ItemScript("item_captured_frog") { }
|
||||
|
||||
bool OnUse(Player* player, Item* item, SpellCastTargets const& /*targets*/)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_THE_PERFECT_SPIES) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (player->FindNearestCreature(NPC_VANIRAS_SENTRY_TOTEM, 10.0f))
|
||||
return false;
|
||||
else
|
||||
player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE, item, NULL);
|
||||
}
|
||||
else
|
||||
player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, NULL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_item_scripts()
|
||||
{
|
||||
new item_only_for_flight();
|
||||
new item_nether_wraith_beacon();
|
||||
new item_gor_dreks_ointment();
|
||||
new item_incendiary_explosives();
|
||||
new item_mysterious_egg();
|
||||
new item_disgusting_jar();
|
||||
new item_petrov_cluster_bombs();
|
||||
new item_trident_of_nazjan();
|
||||
new item_captured_frog();
|
||||
}
|
||||
@@ -1,234 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Generic_Creature
|
||||
SD%Complete: 80
|
||||
SDComment: Should be replaced with core based AI
|
||||
SDCategory: Creatures
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "PassiveAI.h"
|
||||
|
||||
#define GENERIC_CREATURE_COOLDOWN 5000
|
||||
|
||||
class generic_creature : public CreatureScript
|
||||
{
|
||||
public:
|
||||
generic_creature() : CreatureScript("generic_creature") { }
|
||||
|
||||
struct generic_creatureAI : public ScriptedAI
|
||||
{
|
||||
generic_creatureAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds)
|
||||
uint32 BuffTimer; //This variable keeps track of buffs
|
||||
bool IsSelfRooted;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
GlobalCooldown = 0;
|
||||
BuffTimer = 0; //Rebuff as soon as we can
|
||||
IsSelfRooted = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (!me->IsWithinMeleeRange(who))
|
||||
IsSelfRooted = true;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
//Always decrease our global cooldown first
|
||||
if (GlobalCooldown > diff)
|
||||
GlobalCooldown -= diff;
|
||||
else GlobalCooldown = 0;
|
||||
|
||||
//Buff timer (only buff when we are alive and not in combat
|
||||
if (!me->IsInCombat() && me->IsAlive())
|
||||
{
|
||||
if (BuffTimer <= diff)
|
||||
{
|
||||
//Find a spell that targets friendly and applies an aura (these are generally buffs)
|
||||
SpellInfo const* info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_AURA);
|
||||
|
||||
if (info && !GlobalCooldown)
|
||||
{
|
||||
//Cast the buff spell
|
||||
DoCastSpell(me, info);
|
||||
|
||||
//Set our global cooldown
|
||||
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
|
||||
|
||||
//Set our timer to 10 minutes before rebuff
|
||||
BuffTimer = 600000;
|
||||
}//Try agian in 30 seconds
|
||||
else BuffTimer = 30000;
|
||||
} else BuffTimer -= diff;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are within range melee the target
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
//Make sure our attack is ready and we arn't currently casting
|
||||
if (me->isAttackReady() && !me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
bool Healing = false;
|
||||
SpellInfo const* info = NULL;
|
||||
|
||||
//Select a healing spell if less than 30% hp
|
||||
if (HealthBelowPct(30))
|
||||
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
|
||||
|
||||
//No healing spell available, select a hostile spell
|
||||
if (info) Healing = true;
|
||||
else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, 0, 0, SELECT_EFFECT_DONTCARE);
|
||||
|
||||
//50% chance if elite or higher, 20% chance if not, to replace our white hit with a spell
|
||||
if (info && (rand() % (me->GetCreatureTemplate()->rank > 1 ? 2 : 5) == 0) && !GlobalCooldown)
|
||||
{
|
||||
//Cast the spell
|
||||
if (Healing)DoCastSpell(me, info);
|
||||
else DoCastSpell(me->GetVictim(), info);
|
||||
|
||||
//Set our global cooldown
|
||||
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
|
||||
}
|
||||
else me->AttackerStateUpdate(me->GetVictim());
|
||||
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Only run this code if we arn't already casting
|
||||
if (!me->IsNonMeleeSpellCast(false))
|
||||
{
|
||||
bool Healing = false;
|
||||
SpellInfo const* info = NULL;
|
||||
|
||||
//Select a healing spell if less than 30% hp ONLY 33% of the time
|
||||
if (HealthBelowPct(30) && rand() % 3 == 0)
|
||||
info = SelectSpell(me, 0, 0, SELECT_TARGET_ANY_FRIEND, 0, 0, 0, 0, SELECT_EFFECT_HEALING);
|
||||
|
||||
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
|
||||
if (info) Healing = true;
|
||||
else info = SelectSpell(me->GetVictim(), 0, 0, SELECT_TARGET_ANY_ENEMY, 0, 0, NOMINAL_MELEE_RANGE, 0, SELECT_EFFECT_DONTCARE);
|
||||
|
||||
//Found a spell, check if we arn't on cooldown
|
||||
if (info && !GlobalCooldown)
|
||||
{
|
||||
//If we are currently moving stop us and set the movement generator
|
||||
if (!IsSelfRooted)
|
||||
IsSelfRooted = true;
|
||||
|
||||
//Cast spell
|
||||
if (Healing) DoCastSpell(me, info);
|
||||
else DoCastSpell(me->GetVictim(), info);
|
||||
|
||||
//Set our global cooldown
|
||||
GlobalCooldown = GENERIC_CREATURE_COOLDOWN;
|
||||
|
||||
}//If no spells available and we arn't moving run to target
|
||||
else if (IsSelfRooted)
|
||||
{
|
||||
//Cancel our current spell and then allow movement agian
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
IsSelfRooted = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new generic_creatureAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class trigger_periodic : public CreatureScript
|
||||
{
|
||||
public:
|
||||
trigger_periodic() : CreatureScript("trigger_periodic") { }
|
||||
|
||||
struct trigger_periodicAI : public NullCreatureAI
|
||||
{
|
||||
trigger_periodicAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
spell = me->m_spells[0] ? sSpellMgr->GetSpellInfo(me->m_spells[0]) : NULL;
|
||||
interval = me->GetAttackTime(BASE_ATTACK);
|
||||
timer = interval;
|
||||
}
|
||||
|
||||
uint32 timer, interval;
|
||||
const SpellInfo* spell;
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (timer <= diff)
|
||||
{
|
||||
if (spell)
|
||||
me->CastSpell(me, spell, true);
|
||||
timer = interval;
|
||||
}
|
||||
else
|
||||
timer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new trigger_periodicAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class trigger_death : public CreatureScript
|
||||
{
|
||||
public:
|
||||
trigger_death() : CreatureScript("trigger_death") { }
|
||||
|
||||
struct trigger_deathAI : public NullCreatureAI
|
||||
{
|
||||
trigger_deathAI(Creature* creature) : NullCreatureAI(creature) { }
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (me->m_spells[0])
|
||||
me->CastSpell(killer, me->m_spells[0], true);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new trigger_deathAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_generic_creature()
|
||||
{
|
||||
//new generic_creature;
|
||||
new trigger_periodic;
|
||||
//new trigger_death;
|
||||
}
|
||||
@@ -1,68 +0,0 @@
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
enum eTrickOrTreatSpells
|
||||
{
|
||||
SPELL_TRICK = 24714,
|
||||
SPELL_TREAT = 24715,
|
||||
SPELL_TRICKED_OR_TREATED = 24755,
|
||||
HALLOWEEN_EVENTID = 12,
|
||||
};
|
||||
|
||||
class npc_innkeeper : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_innkeeper() : CreatureScript("npc_innkeeper") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (IsEventActive(HALLOWEEN_EVENTID) && !player->HasAura(SPELL_TRICKED_OR_TREATED))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Trick or Treat!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+HALLOWEEN_EVENTID);
|
||||
|
||||
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 (creature->IsInnkeeper())
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1, "Make this inn my home.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INN);
|
||||
|
||||
player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
|
||||
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+HALLOWEEN_EVENTID && IsEventActive(HALLOWEEN_EVENTID) && !player->HasAura(SPELL_TRICKED_OR_TREATED))
|
||||
{
|
||||
player->CastSpell(player, SPELL_TRICKED_OR_TREATED, true);
|
||||
creature->CastSpell(player, roll_chance_i(50) ? SPELL_TRICK : SPELL_TREAT, true);
|
||||
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_TRADE: player->GetSession()->SendListInventory(creature->GetGUID()); break;
|
||||
case GOSSIP_ACTION_INN: player->SetBindPoint(creature->GetGUID()); break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_npc_innkeeper()
|
||||
{
|
||||
new npc_innkeeper;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,299 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Npc_Taxi
|
||||
SD%Complete: 0%
|
||||
SDComment: To be used for taxi NPCs that are located globally.
|
||||
SDCategory: NPCs
|
||||
EndScriptData
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
#define GOSSIP_SUSURRUS "I am ready."
|
||||
#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!"
|
||||
#define GOSSIP_IRONWING "I'd like to take a flight around Stormwind Harbor."
|
||||
#define GOSSIP_DABIREE1 "Fly me to Murketh and Shaadraz Gateways"
|
||||
#define GOSSIP_DABIREE2 "Fly me to Shatter Point"
|
||||
#define GOSSIP_WINDBELLOW1 "Fly me to The Abyssal Shelf"
|
||||
#define GOSSIP_WINDBELLOW2 "Fly me to Honor Point"
|
||||
#define GOSSIP_BRACK1 "Fly me to Murketh and Shaadraz Gateways"
|
||||
#define GOSSIP_BRACK2 "Fly me to The Abyssal Shelf"
|
||||
#define GOSSIP_BRACK3 "Fly me to Spinebreaker Post"
|
||||
#define GOSSIP_IRENA "Fly me to Skettis please"
|
||||
#define GOSSIP_CLOUDBREAKER1 "Speaking of action, I've been ordered to undertake an air strike."
|
||||
#define GOSSIP_CLOUDBREAKER2 "I need to intercept the Dawnblade reinforcements."
|
||||
#define GOSSIP_DRAGONHAWK "<Ride the dragonhawk to Sun's Reach>"
|
||||
#define GOSSIP_VERONIA "Fly me to Manaforge Coruu please"
|
||||
#define GOSSIP_DEESAK "Fly me to Ogri'la please"
|
||||
#define GOSSIP_AFRASASTRASZ1 "I would like to take a flight to the ground, Lord Of Afrasastrasz."
|
||||
#define GOSSIP_AFRASASTRASZ2 "My Lord, I must go to the upper floor of the temple."
|
||||
#define GOSSIP_TARIOLSTRASZ1 "My Lord, I must go to the upper floor of the temple."
|
||||
#define GOSSIP_TARIOLSTRASZ2 "Can you spare a drake to travel to Lord Of Afrasastrasz, in the middle of the temple?"
|
||||
#define GOSSIP_TORASTRASZA1 "I would like to see Lord Of Afrasastrasz, in the middle of the temple."
|
||||
#define GOSSIP_TORASTRASZA2 "Yes, Please. I would like to return to the ground floor of the temple."
|
||||
#define GOSSIP_CRIMSONWING "<Ride the gryphons to Survey Alcaz Island>"
|
||||
#define GOSSIP_WILLIAMKEILAR1 "Take me to Northpass Tower."
|
||||
#define GOSSIP_WILLIAMKEILAR2 "Take me to Eastwall Tower."
|
||||
#define GOSSIP_WILLIAMKEILAR3 "Take me to Crown Guard Tower."
|
||||
|
||||
class npc_taxi : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_taxi() : CreatureScript("npc_taxi") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case 17435: // Azuremyst Isle - Susurrus
|
||||
if (player->HasItemCount(23843, 1, true))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
break;
|
||||
case 20903: // Netherstorm - Protectorate Nether Drake
|
||||
if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
break;
|
||||
case 29154: // Stormwind City - Thargold Ironwing
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
break;
|
||||
case 19409: // Hellfire Peninsula - Wing Commander Dabir'ee
|
||||
//Mission: The Murketh and Shaadraz Gateways
|
||||
if (player->GetQuestStatus(10146) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
|
||||
//Shatter Point
|
||||
if (!player->GetQuestRewardStatus(10340))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DABIREE2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
break;
|
||||
case 20235: // Hellfire Peninsula - Gryphoneer Windbellow
|
||||
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
|
||||
if (player->GetQuestStatus(10163) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10346) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
|
||||
|
||||
//Go to the Front
|
||||
if (player->GetQuestStatus(10382) != QUEST_STATUS_NONE && !player->GetQuestRewardStatus(10382))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WINDBELLOW2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
|
||||
break;
|
||||
case 19401: // Hellfire Peninsula - Wing Commander Brack
|
||||
//Mission: The Murketh and Shaadraz Gateways
|
||||
if (player->GetQuestStatus(10129) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
|
||||
|
||||
//Mission: The Abyssal Shelf || Return to the Abyssal Shelf
|
||||
if (player->GetQuestStatus(10162) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(10347) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
|
||||
|
||||
//Spinebreaker Post
|
||||
if (player->GetQuestStatus(10242) == QUEST_STATUS_COMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRACK3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
|
||||
break;
|
||||
case 23413: // Blade's Edge Mountains - Skyguard Handler Irena
|
||||
if (player->GetReputationRank(1031) >= REP_HONORED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_IRENA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
|
||||
break;
|
||||
case 25059: // Isle of Quel'Danas - Ayren Cloudbreaker
|
||||
if (player->GetQuestStatus(11532) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11533) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CLOUDBREAKER1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
|
||||
|
||||
if (player->GetQuestStatus(11542) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CLOUDBREAKER2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
|
||||
break;
|
||||
case 25236: // Isle of Quel'Danas - Unrestrained Dragonhawk
|
||||
if (player->GetQuestStatus(11542) == QUEST_STATUS_COMPLETE || player->GetQuestStatus(11543) == QUEST_STATUS_COMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DRAGONHAWK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
|
||||
break;
|
||||
case 20162: // Netherstorm - Veronia
|
||||
//Behind Enemy Lines
|
||||
if (player->GetQuestStatus(10652) != QUEST_STATUS_REWARDED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VERONIA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
|
||||
break;
|
||||
case 23415: // Terokkar Forest - Skyguard Handler Deesak
|
||||
if (player->GetReputationRank(1031) >= REP_HONORED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_DEESAK, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 16);
|
||||
break;
|
||||
case 27575: // Dragonblight - Lord Afrasastrasz
|
||||
// middle -> ground
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AFRASASTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 17);
|
||||
// middle -> top
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_AFRASASTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 18);
|
||||
break;
|
||||
case 26443: // Dragonblight - Tariolstrasz //need to check if quests are required before gossip available (12123, 12124)
|
||||
// ground -> top
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TARIOLSTRASZ1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 19);
|
||||
// ground -> middle
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TARIOLSTRASZ2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 20);
|
||||
break;
|
||||
case 26949: // Dragonblight - Torastrasza
|
||||
// top -> middle
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 21);
|
||||
// top -> ground
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TORASTRASZA2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 22);
|
||||
break;
|
||||
case 23704: // Dustwallow Marsh - Cassa Crimsonwing
|
||||
if (player->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+25);
|
||||
break;
|
||||
case 17209:
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 26);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 27);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WILLIAMKEILAR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 28);
|
||||
break;
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
//spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506.
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 32474, true);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155))
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 53335, true); //TaxiPath 1041 (Stormwind Harbor)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 33768, true); //TaxiPath 585 (Gateways Murket and Shaadraz)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 5:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 35069, true); //TaxiPath 612 (Taxi - Hellfire Peninsula - Expedition Point to Shatter Point)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 6:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 33899, true); //TaxiPath 589 (Aerial Assault Flight (Alliance))
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 7:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 35065, true); //TaxiPath 607 (Taxi - Hellfire Peninsula - Shatter Point to Beach Head)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 8:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 33659, true); //TaxiPath 584 (Gateways Murket and Shaadraz)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 9:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 33825, true); //TaxiPath 587 (Aerial Assault Flight (Horde))
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 10:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 34578, true); //TaxiPath 604 (Taxi - Reaver's Fall to Spinebreaker Ridge)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 11:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 41278, true); //TaxiPath 706
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 12:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 45071, true); //TaxiPath 779
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 13:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 45113, true); //TaxiPath 784
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 14:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 45353, true); //TaxiPath 788
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 15:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 34905, true); //TaxiPath 606
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 16:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 41279, true); //TaxiPath 705 (Taxi - Skettis to Skyguard Outpost)
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 17:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(882);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 18:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(881);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 19:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(878);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 20:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(883);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 21:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(880);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 22:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(879);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 23:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 43074, true); //TaxiPath 736
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 24:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
//player->ActivateTaxiPathTo(738);
|
||||
player->CastSpell(player, 43136, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 25:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->CastSpell(player, 42295, true);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 26:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(494);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 27:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(495);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 28:
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->ActivateTaxiPathTo(496);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_npc_taxi()
|
||||
{
|
||||
new npc_taxi;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user