initial commit
This commit is contained in:
@@ -0,0 +1,304 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.BattleGrounds;
|
||||
using Game.BattleGrounds.Zones;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
struct AchievementConst
|
||||
{
|
||||
//Tilted
|
||||
public const uint AreaArgentTournamentFields = 4658;
|
||||
public const uint AreaRingOfAspirants = 4670;
|
||||
public const uint AreaRingOfArgentValiants = 4671;
|
||||
public const uint AreaRingOfAllianceValiants = 4672;
|
||||
public const uint AreaRingOfHordeValiants = 4673;
|
||||
public const uint AreaRingOfChampions = 4669;
|
||||
|
||||
//Flirt With Disaster
|
||||
public const uint AuraPerfumeForever = 70235;
|
||||
public const uint AuraPerfumeEnchantress = 70234;
|
||||
public const uint AuraPerfumeVictory = 70233;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_resilient_victory : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_resilient_victory() : base("achievement_resilient_victory") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.ResilientVictory, source, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_control_all_nodes : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_control_all_nodes() : base("achievement_bg_control_all_nodes") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.IsAllNodesControlledByTeam(source.GetTeam());
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_save_the_day : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_save_the_day() : base("achievement_save_the_day") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.SaveTheDay, source, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_ic_resource_glut : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_ic_resource_glut() : base("achievement_bg_ic_resource_glut") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
if (source.HasAura(ICSpells.OilRefinery) && source.HasAura(ICSpells.Quarry))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_ic_glaive_grave : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_ic_glaive_grave() : base("achievement_bg_ic_glaive_grave") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Creature vehicle = source.GetVehicleCreatureBase();
|
||||
if (vehicle)
|
||||
{
|
||||
if (vehicle.GetEntry() == ICCreatures.GlaiveThrowerH || vehicle.GetEntry() == ICCreatures.GlaiveThrowerA)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_ic_mowed_down : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_ic_mowed_down() : base("achievement_bg_ic_mowed_down") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Creature vehicle = source.GetVehicleCreatureBase();
|
||||
if (vehicle)
|
||||
{
|
||||
if (vehicle.GetEntry() == ICCreatures.KeepCannon)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_sa_artillery : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_sa_artillery() : base("achievement_bg_sa_artillery") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Creature vehicle = source.GetVehicleCreatureBase();
|
||||
if (vehicle)
|
||||
{
|
||||
if (vehicle.GetEntry() == SACreatureIds.AntiPersonnalCannon)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script("achievement_arena_2v2_kills", ArenaTypes.Team2v2)]
|
||||
[Script("achievement_arena_3v3_kills", ArenaTypes.Team3v3)]
|
||||
[Script("achievement_arena_5v5_kills", ArenaTypes.Team5v5)]
|
||||
class achievement_arena_kills : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_arena_kills(string name, ArenaTypes arenaType) : base(name)
|
||||
{
|
||||
_arenaType = arenaType;
|
||||
}
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
// this checks GetBattleground() for NULL already
|
||||
if (!source.InArena())
|
||||
return false;
|
||||
|
||||
return source.GetBattleground().GetArenaType() == _arenaType;
|
||||
}
|
||||
|
||||
ArenaTypes _arenaType;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_sickly_gazelle : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_sickly_gazelle() : base("achievement_sickly_gazelle") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
Player victim = target.ToPlayer();
|
||||
if (victim)
|
||||
if (victim.IsMounted())
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_everything_counts : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_everything_counts() : base("achievement_everything_counts") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.EverythingCounts, source, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_av_perfection : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_av_perfection() : base("achievement_bg_av_perfection") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.AvPerfection, source, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_bg_sa_defense_of_ancients : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_bg_sa_defense_of_ancients() : base("achievement_bg_sa_defense_of_ancients") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.DefenseOfTheAncients, source, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_tilted : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_tilted() : base("achievement_tilted") { }
|
||||
|
||||
public override bool OnCheck(Player player, Unit target)
|
||||
{
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
bool checkArea = player.GetAreaId() == AchievementConst.AreaArgentTournamentFields ||
|
||||
player.GetAreaId() == AchievementConst.AreaRingOfAspirants ||
|
||||
player.GetAreaId() == AchievementConst.AreaRingOfArgentValiants ||
|
||||
player.GetAreaId() == AchievementConst.AreaRingOfAllianceValiants ||
|
||||
player.GetAreaId() == AchievementConst.AreaRingOfHordeValiants ||
|
||||
player.GetAreaId() == AchievementConst.AreaRingOfChampions;
|
||||
|
||||
return checkArea && player.duel != null && player.duel.isMounted;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_not_even_a_scratch : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_not_even_a_scratch() : base("achievement_not_even_a_scratch") { }
|
||||
|
||||
public override bool OnCheck(Player source, Unit target)
|
||||
{
|
||||
Battleground bg = source.GetBattleground();
|
||||
if (bg)
|
||||
return bg.CheckAchievementCriteriaMeet((uint)BattlegroundCriteriaId.NotEvenAScratch, source, target);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_flirt_with_disaster_perf_check : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_flirt_with_disaster_perf_check() : base("achievement_flirt_with_disaster_perf_check") { }
|
||||
|
||||
public override bool OnCheck(Player player, Unit target)
|
||||
{
|
||||
if (!player)
|
||||
return false;
|
||||
|
||||
if (player.HasAura(AchievementConst.AuraPerfumeForever) || player.HasAura(AchievementConst.AuraPerfumeEnchantress) || player.HasAura(AchievementConst.AuraPerfumeVictory))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class achievement_killed_exp_or_honor_target : AchievementCriteriaScript
|
||||
{
|
||||
public achievement_killed_exp_or_honor_target() : base("achievement_killed_exp_or_honor_target") { }
|
||||
|
||||
public override bool OnCheck(Player player, Unit target)
|
||||
{
|
||||
return target && player.isHonorOrXPTarget(target);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,398 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
struct AreaTriggerConst
|
||||
{
|
||||
//Coilfang Waterfall
|
||||
public const uint GoCoilfangWaterfall = 184212;
|
||||
|
||||
//Legion Teleporter
|
||||
public const uint SpellTeleATo = 37387;
|
||||
public const uint QuestGainingAccessA = 10589;
|
||||
|
||||
public const uint SpellTeleHTo = 37389;
|
||||
public const uint QuestGainingAccessH = 10604;
|
||||
|
||||
//Stormwright Shelf
|
||||
public const uint QuestStrengthOfTheTempest = 12741;
|
||||
public const uint SpellCreateTruePowerOfTheTempest = 53067;
|
||||
|
||||
//Scent Larkorwi
|
||||
public const uint QuestScentOfLarkorwi = 4291;
|
||||
public const uint NpcLarkorwiMate = 9683;
|
||||
|
||||
//Last Rites
|
||||
public const uint QuestLastRites = 12019;
|
||||
public const uint QuestBreakingThrough = 11898;
|
||||
|
||||
//Sholazar Waygate
|
||||
public const uint SpellSholazarToUngoroTeleport = 52056;
|
||||
public const uint SpellUngoroToSholazarTeleport = 52057;
|
||||
|
||||
public const uint AtSholazar = 5046;
|
||||
public const uint AtUngoro = 5047;
|
||||
|
||||
public const uint QuestTheMakersOverlook = 12613;
|
||||
public const uint QuestTheMakersPerch = 12559;
|
||||
public const uint QuestMeetingAGreatOne = 13956;
|
||||
|
||||
//Nats Landing
|
||||
public const uint QuestNatsBargain = 11209;
|
||||
public const uint SpellFishPaste = 42644;
|
||||
public const uint NpcLurkingShark = 23928;
|
||||
|
||||
//Brewfest
|
||||
public const uint NpcTapperSwindlekeg = 24711;
|
||||
public const uint NpcIpfelkoferIronkeg = 24710;
|
||||
|
||||
public const uint AtBrewfestDurotar = 4829;
|
||||
public const uint AtBrewfestDunMorogh = 4820;
|
||||
|
||||
public const uint SayWelcome = 4;
|
||||
|
||||
public const uint AreatriggerTalkCooldown = 5; // In Seconds
|
||||
|
||||
//Area 52
|
||||
public const uint SpellA52Neuralyzer = 34400;
|
||||
public const uint NpcSpotlight = 19913;
|
||||
public const uint SummonCooldown = 5;
|
||||
|
||||
public const uint AtArea52South = 4472;
|
||||
public const uint AtArea52North = 4466;
|
||||
public const uint AtArea52West = 4471;
|
||||
public const uint AtArea52East = 4422;
|
||||
|
||||
//Frostgrips Hollow
|
||||
public const uint QuestTheLonesomeWatcher = 12877;
|
||||
|
||||
public const uint NpcStormforgedMonitor = 29862;
|
||||
public const uint NpcStormforgedEradictor = 29861;
|
||||
|
||||
public const uint TypeWaypoint = 0;
|
||||
public const uint DataStart = 0;
|
||||
|
||||
public static Position StormforgedMonitorPosition = new Position(6963.95f, 45.65f, 818.71f, 4.948f);
|
||||
public static Position StormforgedEradictorPosition = new Position(6983.18f, 7.15f, 806.33f, 2.228f);
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_coilfang_waterfall : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_coilfang_waterfall() : base("at_coilfang_waterfall") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
GameObject go = player.FindNearestGameObject(AreaTriggerConst.GoCoilfangWaterfall, 35.0f);
|
||||
if (go)
|
||||
if (go.getLootState() == LootState.Ready)
|
||||
go.UseDoorOrButton();
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_legion_teleporter : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_legion_teleporter() : base("at_legion_teleporter") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (player.IsAlive() && !player.IsInCombat())
|
||||
{
|
||||
if (player.GetTeam() == Team.Alliance && player.GetQuestRewardStatus(AreaTriggerConst.QuestGainingAccessA))
|
||||
{
|
||||
player.CastSpell(player, AreaTriggerConst.SpellTeleATo, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (player.GetTeam() == Team.Horde && player.GetQuestRewardStatus(AreaTriggerConst.QuestGainingAccessH))
|
||||
{
|
||||
player.CastSpell(player, AreaTriggerConst.SpellTeleHTo, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_stormwright_shelf : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_stormwright_shelf() : base("at_stormwright_shelf") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (!player.IsDead() && player.GetQuestStatus(AreaTriggerConst.QuestStrengthOfTheTempest) == QuestStatus.Incomplete)
|
||||
player.CastSpell(player, AreaTriggerConst.SpellCreateTruePowerOfTheTempest, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_scent_larkorwi : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_scent_larkorwi() : base("at_scent_larkorwi") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (!player.IsDead() && player.GetQuestStatus(AreaTriggerConst.QuestScentOfLarkorwi) == QuestStatus.Incomplete)
|
||||
{
|
||||
if (!player.FindNearestCreature(AreaTriggerConst.NpcLarkorwiMate, 15))
|
||||
player.SummonCreature(AreaTriggerConst.NpcLarkorwiMate, player.GetPositionX() + 5, player.GetPositionY(), player.GetPositionZ(), 3.3f, TempSummonType.TimedDespawnOOC, 100000);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_last_rites : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_last_rites() : base("at_last_rites") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (!(player.GetQuestStatus(AreaTriggerConst.QuestLastRites) == QuestStatus.Incomplete ||
|
||||
player.GetQuestStatus(AreaTriggerConst.QuestLastRites) == QuestStatus.Complete ||
|
||||
player.GetQuestStatus(AreaTriggerConst.QuestBreakingThrough) == QuestStatus.Incomplete ||
|
||||
player.GetQuestStatus(AreaTriggerConst.QuestBreakingThrough) == QuestStatus.Complete))
|
||||
return false;
|
||||
|
||||
WorldLocation pPosition;
|
||||
|
||||
switch (trigger.Id)
|
||||
{
|
||||
case 5332:
|
||||
case 5338:
|
||||
pPosition = new WorldLocation(571, 3733.68f, 3563.25f, 290.812f, 3.665192f);
|
||||
break;
|
||||
case 5334:
|
||||
pPosition = new WorldLocation(571, 3802.38f, 3585.95f, 49.5765f, 0.0f);
|
||||
break;
|
||||
case 5340:
|
||||
if (player.GetQuestStatus(AreaTriggerConst.QuestLastRites) == QuestStatus.Incomplete ||
|
||||
player.GetQuestStatus(AreaTriggerConst.QuestLastRites) == QuestStatus.Complete)
|
||||
pPosition = new WorldLocation(571, 3687.91f, 3577.28f, 473.342f);
|
||||
else
|
||||
pPosition = new WorldLocation(571, 3739.38f, 3567.09f, 341.58f);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
player.TeleportTo(pPosition);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_sholazar_waygate : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_sholazar_waygate() : base("at_sholazar_waygate") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (!player.IsDead() && (player.GetQuestStatus(AreaTriggerConst.QuestMeetingAGreatOne) != QuestStatus.None ||
|
||||
(player.GetQuestStatus(AreaTriggerConst.QuestTheMakersOverlook) == QuestStatus.Rewarded && player.GetQuestStatus(AreaTriggerConst.QuestTheMakersPerch) == QuestStatus.Rewarded)))
|
||||
{
|
||||
switch (trigger.Id)
|
||||
{
|
||||
case AreaTriggerConst.AtSholazar:
|
||||
player.CastSpell(player, AreaTriggerConst.SpellSholazarToUngoroTeleport, true);
|
||||
break;
|
||||
|
||||
case AreaTriggerConst.AtUngoro:
|
||||
player.CastSpell(player, AreaTriggerConst.SpellUngoroToSholazarTeleport, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_nats_landing : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_nats_landing() : base("at_nats_landing") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (!player.IsAlive() || !player.HasAura(AreaTriggerConst.SpellFishPaste))
|
||||
return false;
|
||||
|
||||
if (player.GetQuestStatus(AreaTriggerConst.QuestNatsBargain) == QuestStatus.Incomplete)
|
||||
{
|
||||
if (!player.FindNearestCreature(AreaTriggerConst.NpcLurkingShark, 20.0f))
|
||||
{
|
||||
Creature shark = player.SummonCreature(AreaTriggerConst.NpcLurkingShark, -4246.243f, -3922.356f, -7.488f, 5.0f, TempSummonType.TimedDespawnOOC, 100000);
|
||||
if (shark)
|
||||
shark.GetAI().AttackStart(player);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_brewfest : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_brewfest() : base("at_brewfest")
|
||||
{
|
||||
// Initialize for cooldown
|
||||
_triggerTimes[AreaTriggerConst.AtBrewfestDurotar] = _triggerTimes[AreaTriggerConst.AtBrewfestDunMorogh] = 0;
|
||||
}
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
uint triggerId = trigger.Id;
|
||||
// Second trigger happened too early after first, skip for now
|
||||
if (Global.WorldMgr.GetGameTime() - _triggerTimes[triggerId] < AreaTriggerConst.AreatriggerTalkCooldown)
|
||||
return false;
|
||||
|
||||
switch (triggerId)
|
||||
{
|
||||
case AreaTriggerConst.AtBrewfestDurotar:
|
||||
Creature tapper = player.FindNearestCreature(AreaTriggerConst.NpcTapperSwindlekeg, 20.0f);
|
||||
if (tapper)
|
||||
tapper.GetAI().Talk(AreaTriggerConst.SayWelcome, player);
|
||||
break;
|
||||
case AreaTriggerConst.AtBrewfestDunMorogh:
|
||||
Creature ipfelkofer = player.FindNearestCreature(AreaTriggerConst.NpcIpfelkoferIronkeg, 20.0f);
|
||||
if (ipfelkofer)
|
||||
ipfelkofer.GetAI().Talk(AreaTriggerConst.SayWelcome, player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
_triggerTimes[triggerId] = Global.WorldMgr.GetGameTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
Dictionary<uint, long> _triggerTimes = new Dictionary<uint, long>();
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_area_52_entrance : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_area_52_entrance() : base("at_area_52_entrance")
|
||||
{
|
||||
_triggerTimes[AreaTriggerConst.AtArea52South] = _triggerTimes[AreaTriggerConst.AtArea52North] = _triggerTimes[AreaTriggerConst.AtArea52West] = _triggerTimes[AreaTriggerConst.AtArea52East] = 0;
|
||||
}
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
float x = 0.0f, y = 0.0f, z = 0.0f;
|
||||
|
||||
if (!player.IsAlive())
|
||||
return false;
|
||||
|
||||
uint triggerId = trigger.Id;
|
||||
if (Global.WorldMgr.GetGameTime() - _triggerTimes[trigger.Id] < AreaTriggerConst.SummonCooldown)
|
||||
return false;
|
||||
|
||||
switch (triggerId)
|
||||
{
|
||||
case AreaTriggerConst.AtArea52East:
|
||||
x = 3044.176f;
|
||||
y = 3610.692f;
|
||||
z = 143.61f;
|
||||
break;
|
||||
case AreaTriggerConst.AtArea52North:
|
||||
x = 3114.87f;
|
||||
y = 3687.619f;
|
||||
z = 143.62f;
|
||||
break;
|
||||
case AreaTriggerConst.AtArea52West:
|
||||
x = 3017.79f;
|
||||
y = 3746.806f;
|
||||
z = 144.27f;
|
||||
break;
|
||||
case AreaTriggerConst.AtArea52South:
|
||||
x = 2950.63f;
|
||||
y = 3719.905f;
|
||||
z = 143.33f;
|
||||
break;
|
||||
}
|
||||
|
||||
player.SummonCreature(AreaTriggerConst.NpcSpotlight, x, y, z, 0.0f, TempSummonType.TimedDespawn, 5000);
|
||||
player.AddAura(AreaTriggerConst.SpellA52Neuralyzer, player);
|
||||
_triggerTimes[trigger.Id] = Global.WorldMgr.GetGameTime();
|
||||
return false;
|
||||
}
|
||||
|
||||
Dictionary<uint, long> _triggerTimes = new Dictionary<uint, long>();
|
||||
}
|
||||
|
||||
[Script]
|
||||
class AreaTrigger_at_frostgrips_hollow : AreaTriggerScript
|
||||
{
|
||||
public AreaTrigger_at_frostgrips_hollow() : base("at_frostgrips_hollow") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger, bool entered)
|
||||
{
|
||||
if (player.GetQuestStatus(AreaTriggerConst.QuestTheLonesomeWatcher) != QuestStatus.Incomplete)
|
||||
return false;
|
||||
|
||||
Creature stormforgedMonitor = ObjectAccessor.GetCreature(player, stormforgedMonitorGUID);
|
||||
if (stormforgedMonitor)
|
||||
return false;
|
||||
|
||||
Creature stormforgedEradictor = ObjectAccessor.GetCreature(player, stormforgedEradictorGUID);
|
||||
if (stormforgedEradictor)
|
||||
return false;
|
||||
|
||||
stormforgedMonitor = player.SummonCreature(AreaTriggerConst.NpcStormforgedMonitor, AreaTriggerConst.StormforgedMonitorPosition, TempSummonType.TimedDespawnOOC, 60000);
|
||||
if (stormforgedMonitor)
|
||||
{
|
||||
stormforgedMonitorGUID = stormforgedMonitor.GetGUID();
|
||||
stormforgedMonitor.SetWalk(false);
|
||||
// The npc would search an alternative way to get to the last waypoint without this unit state.
|
||||
stormforgedMonitor.AddUnitState(UnitState.IgnorePathfinding);
|
||||
stormforgedMonitor.GetMotionMaster().MovePath(AreaTriggerConst.NpcStormforgedMonitor * 100, false);
|
||||
}
|
||||
|
||||
stormforgedEradictor = player.SummonCreature(AreaTriggerConst.NpcStormforgedEradictor, AreaTriggerConst.StormforgedEradictorPosition, TempSummonType.TimedDespawnOOC, 60000);
|
||||
if (stormforgedEradictor)
|
||||
{
|
||||
stormforgedEradictorGUID = stormforgedEradictor.GetGUID();
|
||||
stormforgedEradictor.GetMotionMaster().MovePath(AreaTriggerConst.NpcStormforgedEradictor * 100, false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ObjectGuid stormforgedMonitorGUID;
|
||||
ObjectGuid stormforgedEradictorGUID;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,621 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.World.BossEmeraldDragons
|
||||
{
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint DragonYsondre = 14887;
|
||||
public const uint DragonLethon = 14888;
|
||||
public const uint DragonEmeriss = 14889;
|
||||
public const uint DragonTaerar = 14890;
|
||||
public const uint DreamFog = 15224;
|
||||
|
||||
//Ysondre
|
||||
public const uint DementedDruid = 15260;
|
||||
|
||||
//Lethon
|
||||
public const uint SpiritShade = 15261;
|
||||
}
|
||||
|
||||
struct Spells
|
||||
{
|
||||
public const uint TailSweep = 15847; // Tail Sweep - Slap Everything Behind Dragon (2 Seconds Interval)
|
||||
public const uint SummonPlayer = 24776; // Teleport Highest Threat Player In Front Of Dragon If Wandering Off
|
||||
public const uint DreamFog = 24777; // Auraspell For Dream Fog Npc (15224)
|
||||
public const uint Sleep = 24778; // Sleep Triggerspell (Used For Dream Fog)
|
||||
public const uint SeepingFogLeft = 24813; // Dream Fog - Summon Left
|
||||
public const uint SeepingFogRight = 24814; // Dream Fog - Summon Right
|
||||
public const uint NoxiousBreath = 24818;
|
||||
public const uint MarkOfNature = 25040; // Mark Of Nature Trigger (Applied On Target Death - 15 Minutes Of Being Suspectible To Aura Of Nature)
|
||||
public const uint MarkOfNatureAura = 25041; // Mark Of Nature (Passive Marker-Test; Ticks Every 10 Seconds From Boss; Triggers Spellid 25042 (Scripted)
|
||||
public const uint AuraOfNature = 25043; // Stun For 2 Minutes (Used When public const uint MarkOfNature Exists On The Target)
|
||||
|
||||
//Ysondre
|
||||
public const uint LightningWave = 24819;
|
||||
public const uint SummonDruidSpirits = 24795;
|
||||
|
||||
//Lethon
|
||||
public const uint DrawSpirit = 24811;
|
||||
public const uint ShadowBoltWhirl = 24834;
|
||||
public const uint DarkOffering = 24804;
|
||||
|
||||
//Emeriss
|
||||
public const uint PutridMushroom = 24904;
|
||||
public const uint CorruptionOfEarth = 24910;
|
||||
public const uint VolatileInfection = 24928;
|
||||
|
||||
//Taerar
|
||||
public const uint BellowingRoar = 22686;
|
||||
public const uint Shade = 24313;
|
||||
public const uint ArcaneBlast = 24857;
|
||||
|
||||
public static uint[] TaerarShadeSpells = { 24841, 24842, 24843 };
|
||||
}
|
||||
|
||||
struct Texts
|
||||
{
|
||||
//Ysondre
|
||||
public const uint YsondreAggro = 0;
|
||||
public const uint YsondreSummonDruids = 1;
|
||||
|
||||
//Lethon
|
||||
public const uint LethonAggro = 0;
|
||||
public const uint LethonDrawSpirit = 1;
|
||||
|
||||
//Emeriss
|
||||
public const uint EmerissAggro = 0;
|
||||
public const uint EmerissCastCorruption = 1;
|
||||
|
||||
//Taerar
|
||||
public const uint TaerarAggro = 0;
|
||||
public const uint TaerarSummonShades = 1;
|
||||
}
|
||||
|
||||
class emerald_dragonAI : WorldBossAI
|
||||
{
|
||||
public emerald_dragonAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
base.Reset();
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
|
||||
me.SetReactState(ReactStates.Aggressive);
|
||||
DoCast(me, Spells.MarkOfNatureAura, true);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
// Tail Sweep is cast every two seconds, no matter what goes on in front of the dragon
|
||||
DoCast(me, Spells.TailSweep);
|
||||
task.Repeat(TimeSpan.FromSeconds(2));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(7.5), TimeSpan.FromSeconds(15), task =>
|
||||
{
|
||||
// Noxious Breath is cast on random intervals, no less than 7.5 seconds between
|
||||
DoCast(me, Spells.NoxiousBreath);
|
||||
task.Repeat();
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12.5), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
// 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, Spells.SeepingFogLeft, true);
|
||||
DoCast(me, Spells.SeepingFogRight, true);
|
||||
task.Repeat(TimeSpan.FromMinutes(2), TimeSpan.FromMinutes(2.5));
|
||||
});
|
||||
}
|
||||
|
||||
// Target killed during encounter, mark them as suspectible for Aura Of Nature
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
who.CastSpell(who, Spells.MarkOfNature, true);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
Unit target = SelectTarget(SelectAggroTarget.TopAggro, 0, -50.0f, true);
|
||||
if (target)
|
||||
DoCast(target, Spells.SummonPlayer);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_dream_fog : CreatureScript
|
||||
{
|
||||
public npc_dream_fog() : base("npc_dream_fog") { }
|
||||
|
||||
class npc_dream_fogAI : ScriptedAI
|
||||
{
|
||||
public npc_dream_fogAI(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_roamTimer = 0;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (_roamTimer == 0)
|
||||
{
|
||||
// Chase target, but don't attack - otherwise just roam around
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 0.0f, true);
|
||||
if (target)
|
||||
{
|
||||
_roamTimer = RandomHelper.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.SetSpeedRate(UnitMoveType.Walk, 0.75f);
|
||||
}
|
||||
else
|
||||
_roamTimer -= diff;
|
||||
}
|
||||
|
||||
uint _roamTimer;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new npc_dream_fogAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_ysondre : CreatureScript
|
||||
{
|
||||
public boss_ysondre() : base("boss_ysondre") { }
|
||||
|
||||
class boss_ysondreAI : emerald_dragonAI
|
||||
{
|
||||
public boss_ysondreAI(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_stage = 1;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
base.Reset();
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
DoCastVictim(Spells.LightningWave);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20));
|
||||
});
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(Texts.YsondreAggro);
|
||||
base.EnterCombat(who);
|
||||
}
|
||||
|
||||
// Summon druid spirits on 75%, 50% and 25% health
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
Talk(Texts.YsondreSummonDruids);
|
||||
|
||||
for (byte i = 0; i < 10; ++i)
|
||||
DoCast(me, Spells.SummonDruidSpirits, true);
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
byte _stage;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new boss_ysondreAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_lethon : CreatureScript
|
||||
{
|
||||
public boss_lethon() : base("boss_lethon") { }
|
||||
|
||||
class boss_lethonAI : emerald_dragonAI
|
||||
{
|
||||
public boss_lethonAI(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_stage = 1;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
base.Reset();
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
|
||||
{
|
||||
me.CastSpell((Unit)null, Spells.ShadowBoltWhirl, false);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(30));
|
||||
});
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(Texts.LethonAggro);
|
||||
base.EnterCombat(who);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
Talk(Texts.LethonDrawSpirit);
|
||||
DoCast(me, Spells.DrawSpirit);
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SpellHitTarget(Unit target, SpellInfo spell)
|
||||
{
|
||||
if (spell.Id == Spells.DrawSpirit && target.IsTypeId(TypeId.Player))
|
||||
{
|
||||
Position targetPos = target.GetPosition();
|
||||
me.SummonCreature(CreatureIds.SpiritShade, targetPos, TempSummonType.TimedDespawnOOC, 50000);
|
||||
}
|
||||
}
|
||||
|
||||
byte _stage;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new boss_lethonAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_spirit_shade : CreatureScript
|
||||
{
|
||||
public npc_spirit_shade() : base("npc_spirit_shade") { }
|
||||
|
||||
class npc_spirit_shadeAI : PassiveAI
|
||||
{
|
||||
public npc_spirit_shadeAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void IsSummonedBy(Unit summoner)
|
||||
{
|
||||
_summonerGuid = summoner.GetGUID();
|
||||
me.GetMotionMaster().MoveFollow(summoner, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
public override void MovementInform(MovementGeneratorType moveType, uint data)
|
||||
{
|
||||
if (moveType == MovementGeneratorType.Follow && data == _summonerGuid.GetCounter())
|
||||
{
|
||||
me.CastSpell((Unit)null, Spells.DarkOffering, false);
|
||||
me.DespawnOrUnsummon(1000);
|
||||
}
|
||||
}
|
||||
|
||||
ObjectGuid _summonerGuid;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new npc_spirit_shadeAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_emeriss : CreatureScript
|
||||
{
|
||||
public boss_emeriss() : base("boss_emeriss") { }
|
||||
|
||||
class boss_emerissAI : emerald_dragonAI
|
||||
{
|
||||
public boss_emerissAI(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_stage = 1;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
base.Reset();
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
DoCastVictim(Spells.VolatileInfection);
|
||||
task.Repeat(TimeSpan.FromSeconds(120));
|
||||
});
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit who)
|
||||
{
|
||||
if (who.IsTypeId(TypeId.Player))
|
||||
DoCast(who, Spells.PutridMushroom, true);
|
||||
base.KilledUnit(who);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(Texts.EmerissAggro);
|
||||
base.EnterCombat(who);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!HealthAbovePct(100 - 25 * _stage))
|
||||
{
|
||||
Talk(Texts.EmerissCastCorruption);
|
||||
DoCast(me, Spells.CorruptionOfEarth, true);
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
byte _stage;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new boss_emerissAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_taerar : CreatureScript
|
||||
{
|
||||
public boss_taerar() : base("boss_taerar") { }
|
||||
|
||||
class boss_taerarAI : emerald_dragonAI
|
||||
{
|
||||
public boss_taerarAI(Creature creature) : base(creature)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_stage = 1;
|
||||
_shades = 0;
|
||||
_banished = false;
|
||||
_banishedTimer = 0;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
me.RemoveAurasDueToSpell(Spells.Shade);
|
||||
|
||||
Initialize();
|
||||
|
||||
base.Reset();
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
DoCast(Spells.ArcaneBlast);
|
||||
task.Repeat(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(12));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(30), task =>
|
||||
{
|
||||
DoCast(Spells.BellowingRoar);
|
||||
task.Repeat(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(30));
|
||||
});
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
Talk(Texts.TaerarAggro);
|
||||
base.EnterCombat(who);
|
||||
}
|
||||
|
||||
public override void SummonedCreatureDies(Creature summon, Unit killer)
|
||||
{
|
||||
--_shades;
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
// 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(Texts.TaerarSummonShades);
|
||||
|
||||
foreach (var spell in Spells.TaerarShadeSpells)
|
||||
DoCastVictim(spell, true);
|
||||
_shades += (byte)Spells.TaerarShadeSpells.Length;
|
||||
|
||||
DoCast(Spells.Shade);
|
||||
me.SetFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
|
||||
++_stage;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint 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 == 0)
|
||||
{
|
||||
_banished = false;
|
||||
|
||||
me.RemoveFlag(UnitFields.Flags, UnitFlags.NotSelectable | UnitFlags.NonAttackable);
|
||||
me.RemoveAurasDueToSpell(Spells.Shade);
|
||||
me.SetReactState(ReactStates.Aggressive);
|
||||
}
|
||||
// _banishtimer has not expired, and we still have active shades:
|
||||
else
|
||||
_banishedTimer -= diff;
|
||||
|
||||
// Update the scheduler before we return (handled under emerald_dragonAI.UpdateAI(diff); if we're not inside this check)
|
||||
_scheduler.Update(diff);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
base.UpdateAI(diff);
|
||||
}
|
||||
|
||||
bool _banished; // used for shades activation testing
|
||||
uint _banishedTimer; // counter for banishment timeout
|
||||
byte _shades; // keep track of how many shades are dead
|
||||
byte _stage; // check which "shade phase" we're at (75-50-25 percentage counters)
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new boss_taerarAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_dream_fog_sleep : SpellScriptLoader
|
||||
{
|
||||
public spell_dream_fog_sleep() : base("spell_dream_fog_sleep") { }
|
||||
|
||||
class spell_dream_fog_sleep_SpellScript : SpellScript
|
||||
{
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
targets.RemoveAll(obj =>
|
||||
{
|
||||
Unit unit = obj.ToUnit();
|
||||
if (unit)
|
||||
return unit.HasAura(Spells.Sleep);
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitDestAreaEnemy));
|
||||
}
|
||||
}
|
||||
|
||||
public override SpellScript GetSpellScript()
|
||||
{
|
||||
return new spell_dream_fog_sleep_SpellScript();
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class spell_mark_of_nature : SpellScriptLoader
|
||||
{
|
||||
public spell_mark_of_nature() : base("spell_mark_of_nature") { }
|
||||
|
||||
class spell_mark_of_nature_SpellScript : SpellScript
|
||||
{
|
||||
public override bool Validate(SpellInfo spellInfo)
|
||||
{
|
||||
return ValidateSpellInfo(Spells.MarkOfNature, Spells.AuraOfNature);
|
||||
}
|
||||
|
||||
void FilterTargets(List<WorldObject> targets)
|
||||
{
|
||||
targets.RemoveAll(obj =>
|
||||
{
|
||||
// return those not tagged or already under the influence of Aura of Nature
|
||||
Unit unit = obj.ToUnit();
|
||||
if (unit)
|
||||
return !(unit.HasAura(Spells.MarkOfNature) && !unit.HasAura(Spells.AuraOfNature));
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
||||
void HandleEffect(uint effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetHitUnit().CastSpell(GetHitUnit(), Spells.AuraOfNature, true);
|
||||
}
|
||||
|
||||
public override void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect.Add(new ObjectAreaTargetSelectHandler(FilterTargets, 0, Targets.UnitSrcAreaEnemy));
|
||||
OnEffectHitTarget.Add(new EffectHandler(HandleEffect, 0, SpellEffectName.ApplyAura));
|
||||
}
|
||||
}
|
||||
|
||||
public override SpellScript GetSpellScript()
|
||||
{
|
||||
return new spell_mark_of_nature_SpellScript();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,144 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
[Script]
|
||||
class DuelResetScript : PlayerScript
|
||||
{
|
||||
public DuelResetScript() : base("DuelResetScript")
|
||||
{
|
||||
_resetCooldowns = WorldConfig.GetBoolValue(WorldCfg.ResetDuelCooldowns);
|
||||
_resetHealthMana = WorldConfig.GetBoolValue(WorldCfg.ResetDuelHealthMana);
|
||||
}
|
||||
|
||||
public override void OnDuelStart(Player player1, Player player2)
|
||||
{
|
||||
// Cooldowns reset
|
||||
if (_resetCooldowns)
|
||||
{
|
||||
player1.GetSpellHistory().SaveCooldownStateBeforeDuel();
|
||||
player2.GetSpellHistory().SaveCooldownStateBeforeDuel();
|
||||
|
||||
ResetSpellCooldowns(player1, true);
|
||||
ResetSpellCooldowns(player2, true);
|
||||
}
|
||||
|
||||
// Health and mana reset
|
||||
if (_resetHealthMana)
|
||||
{
|
||||
player1.SaveHealthBeforeDuel();
|
||||
player1.SetHealth(player1.GetMaxHealth());
|
||||
|
||||
player2.SaveHealthBeforeDuel();
|
||||
player2.SetHealth(player2.GetMaxHealth());
|
||||
|
||||
// check if player1 class uses mana
|
||||
if (player1.getPowerType() == PowerType.Mana || player1.GetClass() == Class.Druid)
|
||||
{
|
||||
player1.SaveManaBeforeDuel();
|
||||
player1.SetPower(PowerType.Mana, player1.GetMaxPower(PowerType.Mana));
|
||||
}
|
||||
|
||||
// check if player2 class uses mana
|
||||
if (player2.getPowerType() == PowerType.Mana || player2.GetClass() == Class.Druid)
|
||||
{
|
||||
player2.SaveManaBeforeDuel();
|
||||
player2.SetPower(PowerType.Mana, player2.GetMaxPower(PowerType.Mana));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDuelEnd(Player winner, Player loser, DuelCompleteType type)
|
||||
{
|
||||
// do not reset anything if DUEL_INTERRUPTED or DUEL_FLED
|
||||
if (type == DuelCompleteType.Won)
|
||||
{
|
||||
// Cooldown restore
|
||||
if (_resetCooldowns)
|
||||
{
|
||||
ResetSpellCooldowns(winner, false);
|
||||
ResetSpellCooldowns(loser, false);
|
||||
|
||||
winner.GetSpellHistory().RestoreCooldownStateAfterDuel();
|
||||
loser.GetSpellHistory().RestoreCooldownStateAfterDuel();
|
||||
}
|
||||
|
||||
// Health and mana restore
|
||||
if (_resetHealthMana)
|
||||
{
|
||||
winner.RestoreHealthAfterDuel();
|
||||
loser.RestoreHealthAfterDuel();
|
||||
|
||||
// check if player1 class uses mana
|
||||
if (winner.getPowerType() == PowerType.Mana || winner.GetClass() == Class.Druid)
|
||||
winner.RestoreManaAfterDuel();
|
||||
|
||||
// check if player2 class uses mana
|
||||
if (loser.getPowerType() == PowerType.Mana || loser.GetClass() == Class.Druid)
|
||||
loser.RestoreManaAfterDuel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ResetSpellCooldowns(Player player, bool onStartDuel)
|
||||
{
|
||||
if (onStartDuel)
|
||||
{
|
||||
// remove cooldowns on spells that have < 10 min CD > 30 sec and has no onHold
|
||||
player.GetSpellHistory().ResetCooldowns(pair =>
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
uint cooldownDuration = pair.Value.CooldownEnd > now ? (uint)(pair.Value.CooldownEnd - now).TotalMilliseconds : 0;
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key);
|
||||
return spellInfo.RecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& spellInfo.CategoryRecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& !pair.Value.OnHold
|
||||
&& cooldownDuration > 0
|
||||
&& (spellInfo.RecoveryTime - cooldownDuration) > (Time.Minute / 2) * Time.InMilliseconds
|
||||
&& (spellInfo.CategoryRecoveryTime - cooldownDuration) > (Time.Minute / 2) * Time.InMilliseconds;
|
||||
}, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
// remove cooldowns on spells that have < 10 min CD and has no onHold
|
||||
player.GetSpellHistory().ResetCooldowns(pair =>
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(pair.Key);
|
||||
return spellInfo.RecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& spellInfo.CategoryRecoveryTime < 10 * Time.Minute * Time.InMilliseconds
|
||||
&& !pair.Value.OnHold;
|
||||
}, true);
|
||||
}
|
||||
|
||||
// pet cooldowns
|
||||
Pet pet = player.GetPet();
|
||||
if (pet)
|
||||
pet.GetSpellHistory().ResetAllCooldowns();
|
||||
}
|
||||
|
||||
bool _resetCooldowns;
|
||||
bool _resetHealthMana;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,979 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
struct GameobjectConst
|
||||
{
|
||||
//CatFigurine
|
||||
public const uint SpellSummonGhostSaber = 5968;
|
||||
|
||||
//GildedBrazier
|
||||
public const uint NpcStillblade = 17716;
|
||||
public const uint QuestTheFirstTrial = 9678;
|
||||
|
||||
//EthereumPrison
|
||||
public const uint SpellRepLc = 39456;
|
||||
public const uint SpellRepShat = 39457;
|
||||
public const uint SpellRepCe = 39460;
|
||||
public const uint SpellRepCon = 39474;
|
||||
public const uint SpellRepKt = 39475;
|
||||
public const uint SpellRepSpor = 39476;
|
||||
public static uint[] NpcPrisonEntry =
|
||||
{
|
||||
22810, 22811, 22812, 22813, 22814, 22815, //Good Guys
|
||||
20783, 20784, 20785, 20786, 20788, 20789, 20790 //Bad Guys
|
||||
};
|
||||
|
||||
//Ethereum Stasis
|
||||
public static uint[] NpcStasisEntry =
|
||||
{
|
||||
22825, 20888, 22827, 22826, 22828
|
||||
};
|
||||
|
||||
//ResoniteCask
|
||||
public const uint NpcGoggeroc = 11920;
|
||||
|
||||
//Sacredfireoflife
|
||||
public const uint NpcArikara = 10882;
|
||||
|
||||
//Shrineofthebirds
|
||||
public const uint NpcHawkGuard = 22992;
|
||||
public const uint NpcEagleGuard = 22993;
|
||||
public const uint NpcFalconGuard = 22994;
|
||||
public const uint GoShrineHawk = 185551;
|
||||
public const uint GoShrineEagle = 185547;
|
||||
public const uint GoShrineFalcon = 185553;
|
||||
|
||||
//Southfury
|
||||
public const uint NpcRizzle = 23002;
|
||||
public const uint SpellBlackjack = 39865; //Stuns Player
|
||||
public const uint SpellSummonRizzle = 39866;
|
||||
|
||||
//Dalarancrystal
|
||||
public const uint QuestLearnLeaveReturn = 12790;
|
||||
public const uint QuestTeleCrystalFlag = 12845;
|
||||
public const string GoTeleToDalaranCrystalFailed = "This Teleport Crystal Cannot Be Used Until The Teleport Crystal In Dalaran Has Been Used At Least Once.";
|
||||
|
||||
//Felcrystalforge
|
||||
public const uint SpellCreate1FlaskOfBeast = 40964;
|
||||
public const uint SpellCreate5FlaskOfBeast = 40965;
|
||||
public const uint GossipFelCrystalforgeText = 31000;
|
||||
public const uint GossipFelCrystalforgeItemTextReturn = 31001;
|
||||
public const string GossipFelCrystalforgeItem1 = "Purchase 1 Unstable Flask Of The Beast For The Cost Of 10 Apexis Shards";
|
||||
public const string GossipFelCrystalforgeItem5 = "Purchase 5 Unstable Flask Of The Beast For The Cost Of 50 Apexis Shards";
|
||||
public const string GossipFelCrystalforgeItemReturn = "Use The Fel Crystalforge To Make Another Purchase.";
|
||||
|
||||
//Bashircrystalforge
|
||||
public const uint SpellCreate1FlaskOfSorcerer = 40968;
|
||||
public const uint SpellCreate5FlaskOfSorcerer = 40970;
|
||||
public const uint GossipBashirCrystalforgeText = 31100;
|
||||
public const uint GossipBashirCrystalforgeItemTextReturn = 31101;
|
||||
public const string GossipBashirCrystalforgeItem1 = "Purchase 1 Unstable Flask Of The Sorcerer For The Cost Of 10 Apexis Shards";
|
||||
public const string GossipBashirCrystalforgeItem5 = "Purchase 5 Unstable Flask Of The Sorcerer For The Cost Of 50 Apexis Shards";
|
||||
public const string GossipBashirCrystalforgeItemReturn = "Use The Bashir Crystalforge To Make Another Purchase.";
|
||||
|
||||
//Matrixpunchograph
|
||||
public const uint ItemWhitePunchCard = 9279;
|
||||
public const uint ItemYellowPunchCard = 9280;
|
||||
public const uint ItemBluePunchCard = 9282;
|
||||
public const uint ItemRedPunchCard = 9281;
|
||||
public const uint ItemPrismaticPunchCard = 9316;
|
||||
public const uint SpellYellowPunchCard = 11512;
|
||||
public const uint SpellBluePunchCard = 11525;
|
||||
public const uint SpellRedPunchCard = 11528;
|
||||
public const uint SpellPrismaticPunchCard = 11545;
|
||||
public const uint MatrixPunchograph3005A = 142345;
|
||||
public const uint MatrixPunchograph3005B = 142475;
|
||||
public const uint MatrixPunchograph3005C = 142476;
|
||||
public const uint MatrixPunchograph3005D = 142696;
|
||||
|
||||
//Scourgecage
|
||||
public const uint NpcScourgePrisoner = 25610;
|
||||
|
||||
//Arcaneprison
|
||||
public const uint QuestPrisonBreak = 11587;
|
||||
public const uint SpellArcanePrisonerKillCredit = 45456;
|
||||
|
||||
//Bloodfilledorb
|
||||
public const uint NpcZelemar = 17830;
|
||||
|
||||
//Jotunheimcage
|
||||
public const uint NpcEbonBladePrisonerHuman = 30186;
|
||||
public const uint NpcEbonBladePrisonerNe = 30194;
|
||||
public const uint NpcEbonBladePrisonerTroll = 30196;
|
||||
public const uint NpcEbonBladePrisonerOrc = 30195;
|
||||
|
||||
public const uint SpellSummonBladeKnightH = 56207;
|
||||
public const uint SpellSummonBladeKnightNe = 56209;
|
||||
public const uint SpellSummonBladeKnightOrc = 56212;
|
||||
public const uint SpellSummonBladeKnightTroll = 56214;
|
||||
|
||||
//Tabletheka
|
||||
public const uint GossipTableTheka = 1653;
|
||||
public const uint QuestSpiderGold = 2936;
|
||||
|
||||
//Inconspicuouslandmark
|
||||
public const uint SpellSummonPiratesTreasureAndTriggerMob = 11462;
|
||||
public const uint ItemCuergosKey = 9275;
|
||||
|
||||
//Prisonersofwyrmskull
|
||||
public const uint QuestPrisonersOfWyrmskull = 11255;
|
||||
public const uint NpcPrisonerPriest = 24086;
|
||||
public const uint NpcPrisonerMage = 24088;
|
||||
public const uint NpcPrisonerWarrior = 24089;
|
||||
public const uint NpcPrisonerPaladin = 24090;
|
||||
public const uint NpcCapturedValgardePrisonerProxy = 24124;
|
||||
|
||||
//Tadpoles
|
||||
public const uint QuestOhNoesTheTadpoles = 11560;
|
||||
public const uint NpcWinterfinTadpole = 25201;
|
||||
|
||||
//Amberpineouthouse
|
||||
public const uint ItemAnderholsSliderCider = 37247;
|
||||
public const uint NpcOuthouseBunny = 27326;
|
||||
public const uint QuestDoingYourDuty = 12227;
|
||||
public const uint SpellIndisposed = 53017;
|
||||
public const uint SpellIndisposedIii = 48341;
|
||||
public const uint SpellCreateAmberseeds = 48330;
|
||||
public const uint GossipOuthouseInuse = 12775;
|
||||
public const uint GossipOuthouseVacant = 12779;
|
||||
|
||||
public const string GossipUseOuthouse = "Use The Outhouse.";
|
||||
public const string GoAnderholsSliderCiderNotFound = "Quest Item Anderhol'S Slider Cider Not Found.";
|
||||
|
||||
//Hives
|
||||
public const uint QuestHiveInTheTower = 9544;
|
||||
public const uint NpcHiveAmbusher = 13301;
|
||||
|
||||
//Missingfriends
|
||||
public const uint QuestMissingFriends = 10852;
|
||||
public const uint NpcCaptiveChild = 22314;
|
||||
public const uint SayFree0 = 0;
|
||||
|
||||
//Thecleansing
|
||||
public const uint QuestTheCleansingHorde = 11317;
|
||||
public const uint QuestTheCleansingAlliance = 11322;
|
||||
public const uint SpellCleansingSoul = 43351;
|
||||
public const uint SpellRecentMeditation = 61720;
|
||||
|
||||
//Midsummerbonfire
|
||||
public const uint StampOutBonfireQuestComplete = 45458;
|
||||
|
||||
//MidsummerPoleRibbon
|
||||
public const uint SpellPoleDance = 29726;
|
||||
public const uint SpellBlueFireRing = 46842;
|
||||
public const uint NpcPoleRibbonBunny = 17066;
|
||||
|
||||
//Toy Train Set
|
||||
public const uint SpellToyTrainPulse = 61551;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_cat_figurine : GameObjectScript
|
||||
{
|
||||
public go_cat_figurine() : base("go_cat_figurine") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
player.CastSpell(player, GameobjectConst.SpellSummonGhostSaber, true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_barov_journal
|
||||
class go_barov_journal : GameObjectScript
|
||||
{
|
||||
public go_barov_journal() : base("go_barov_journal") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.HasSkill(SkillType.Tailoring) && player.GetBaseSkillValue(SkillType.Tailoring) >= 280 && !player.HasSpell(26086))
|
||||
player.CastSpell(player, 26095, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_gilded_brazier (Paladin First Trail quest (9678))
|
||||
class go_gilded_brazier : GameObjectScript
|
||||
{
|
||||
public go_gilded_brazier() : base("go_gilded_brazier") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() == GameObjectTypes.Goober)
|
||||
{
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestTheFirstTrial) == QuestStatus.Incomplete)
|
||||
{
|
||||
Creature Stillblade = player.SummonCreature(GameobjectConst.NpcStillblade, 8106.11f, -7542.06f, 151.775f, 3.02598f, TempSummonType.DeadDespawn, 60000);
|
||||
if (Stillblade)
|
||||
Stillblade.GetAI().AttackStart(player);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_orb_of_command
|
||||
class go_orb_of_command : GameObjectScript
|
||||
{
|
||||
public go_orb_of_command() : base("go_orb_of_command") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.GetQuestRewardStatus(7761))
|
||||
player.CastSpell(player, 23460, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_tablet_of_madness
|
||||
class go_tablet_of_madness : GameObjectScript
|
||||
{
|
||||
public go_tablet_of_madness() : base("go_tablet_of_madness") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.HasSkill(SkillType.Alchemy) && player.GetSkillValue(SkillType.Alchemy) >= 300 && !player.HasSpell(24266))
|
||||
player.CastSpell(player, 24267, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_tablet_of_the_seven
|
||||
class go_tablet_of_the_seven : GameObjectScript
|
||||
{
|
||||
public go_tablet_of_the_seven() : base("go_tablet_of_the_seven") { }
|
||||
|
||||
/// @todo use gossip option ("Transcript the Tablet") instead, if Trinity adds support.
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() != GameObjectTypes.QuestGiver)
|
||||
return true;
|
||||
|
||||
if (player.GetQuestStatus(4296) == QuestStatus.Incomplete)
|
||||
player.CastSpell(player, 15065, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_jump_a_tron
|
||||
class go_jump_a_tron : GameObjectScript
|
||||
{
|
||||
public go_jump_a_tron() : base("go_jump_a_tron") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.GetQuestStatus(10111) == QuestStatus.Incomplete)
|
||||
player.CastSpell(player, 33382, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_ethereum_prison
|
||||
class go_ethereum_prison : GameObjectScript
|
||||
{
|
||||
public go_ethereum_prison() : base("go_ethereum_prison") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
int Random = (int)(RandomHelper.Rand32() % (GameobjectConst.NpcPrisonEntry.Length / sizeof(uint)));
|
||||
Creature creature = player.SummonCreature(GameobjectConst.NpcPrisonEntry[Random], go.GetPositionX(), go.GetPositionY(), go.GetPositionZ(), go.GetAngle(player), TempSummonType.TimedDespawnOOC, 30000);
|
||||
if (creature)
|
||||
{
|
||||
if (!creature.IsHostileTo(player))
|
||||
{
|
||||
FactionTemplateRecord pFaction = creature.GetFactionTemplateEntry();
|
||||
if (pFaction != null)
|
||||
{
|
||||
uint Spell = 0;
|
||||
|
||||
switch (pFaction.Faction)
|
||||
{
|
||||
case 1011: Spell = GameobjectConst.SpellRepLc; break;
|
||||
case 935: Spell = GameobjectConst.SpellRepShat; break;
|
||||
case 942: Spell = GameobjectConst.SpellRepCe; break;
|
||||
case 933: Spell = GameobjectConst.SpellRepCon; break;
|
||||
case 989: Spell = GameobjectConst.SpellRepKt; break;
|
||||
case 970: Spell = GameobjectConst.SpellRepSpor; break;
|
||||
}
|
||||
|
||||
if (Spell != 0)
|
||||
creature.CastSpell(player, Spell, false);
|
||||
else
|
||||
Log.outError(LogFilter.Scripts, "go_ethereum_prison summoned Creature (entry {0}) but faction ({1}) are not expected by script.", creature.GetEntry(), creature.getFaction());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_ethereum_stasis
|
||||
class go_ethereum_stasis : GameObjectScript
|
||||
{
|
||||
public go_ethereum_stasis() : base("go_ethereum_stasis") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
int Random = (int)(RandomHelper.Rand32() % GameobjectConst.NpcStasisEntry.Length / sizeof(uint));
|
||||
|
||||
player.SummonCreature(GameobjectConst.NpcStasisEntry[Random], go.GetPositionX(), go.GetPositionY(), go.GetPositionZ(), go.GetAngle(player), TempSummonType.TimedDespawnOOC, 30000);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_resonite_cask
|
||||
class go_resonite_cask : GameObjectScript
|
||||
{
|
||||
public go_resonite_cask() : base("go_resonite_cask") { }
|
||||
|
||||
public override bool OnGossipHello(Player Player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() == GameObjectTypes.Goober)
|
||||
go.SummonCreature(GameobjectConst.NpcGoggeroc, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.TimedDespawnOOC, 300000);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_sacred_fire_of_life
|
||||
class go_sacred_fire_of_life : GameObjectScript
|
||||
{
|
||||
public go_sacred_fire_of_life() : base("go_sacred_fire_of_life") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() == GameObjectTypes.Goober)
|
||||
player.SummonCreature(GameobjectConst.NpcArikara, -5008.338f, -2118.894f, 83.657f, 0.874f, TempSummonType.TimedDespawnOOC, 30000);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_shrine_of_the_birds
|
||||
class go_shrine_of_the_birds : GameObjectScript
|
||||
{
|
||||
public go_shrine_of_the_birds() : base("go_shrine_of_the_birds") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
uint BirdEntry = 0;
|
||||
|
||||
float fX, fY, fZ;
|
||||
go.GetClosePoint(out fX, out fY, out fZ, go.GetObjectSize(), SharedConst.InteractionDistance);
|
||||
|
||||
switch (go.GetEntry())
|
||||
{
|
||||
case GameobjectConst.GoShrineHawk:
|
||||
BirdEntry = GameobjectConst.NpcHawkGuard;
|
||||
break;
|
||||
case GameobjectConst.GoShrineEagle:
|
||||
BirdEntry = GameobjectConst.NpcEagleGuard;
|
||||
break;
|
||||
case GameobjectConst.GoShrineFalcon:
|
||||
BirdEntry = GameobjectConst.NpcFalconGuard;
|
||||
break;
|
||||
}
|
||||
|
||||
if (BirdEntry != 0)
|
||||
player.SummonCreature(BirdEntry, fX, fY, fZ, go.GetOrientation(), TempSummonType.TimedDespawnOOC, 60000);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_southfury_moonstone
|
||||
class go_southfury_moonstone : GameObjectScript
|
||||
{
|
||||
public go_southfury_moonstone() : base("go_southfury_moonstone") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
//implicitTarget=48 not implemented as of writing this code, and manual summon may be just ok for our purpose
|
||||
//player.CastSpell(player, SPELL_SUMMON_RIZZLE, false);
|
||||
|
||||
Creature creature = player.SummonCreature(GameobjectConst.NpcRizzle, 0.0f, 0.0f, 0.0f, 0.0f, TempSummonType.DeadDespawn, 0);
|
||||
if (creature)
|
||||
creature.CastSpell(player, GameobjectConst.SpellBlackjack, false);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_tele_to_dalaran_crystal
|
||||
class go_tele_to_dalaran_crystal : GameObjectScript
|
||||
{
|
||||
public go_tele_to_dalaran_crystal() : base("go_tele_to_dalaran_crystal") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.GetQuestRewardStatus(GameobjectConst.QuestTeleCrystalFlag))
|
||||
return false;
|
||||
|
||||
player.GetSession().SendNotification(GameobjectConst.GoTeleToDalaranCrystalFailed);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_tele_to_violet_stand
|
||||
class go_tele_to_violet_stand : GameObjectScript
|
||||
{
|
||||
public go_tele_to_violet_stand() : base("go_tele_to_violet_stand") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.GetQuestRewardStatus(GameobjectConst.QuestLearnLeaveReturn) || player.GetQuestStatus(GameobjectConst.QuestLearnLeaveReturn) == QuestStatus.Incomplete)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_fel_crystalforge
|
||||
class go_fel_crystalforge : GameObjectScript
|
||||
{
|
||||
public go_fel_crystalforge() : base("go_fel_crystalforge") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() == GameObjectTypes.QuestGiver) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
|
||||
player.PrepareQuestMenu(go.GetGUID()); /* return true*/
|
||||
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipFelCrystalforgeItem1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipFelCrystalforgeItem5, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipFelCrystalforgeText, go.GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnGossipSelect(Player player, GameObject go, uint sender, uint action)
|
||||
{
|
||||
player.PlayerTalkClass.ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case eTradeskill.GossipActionInfoDef:
|
||||
player.CastSpell(player, GameobjectConst.SpellCreate1FlaskOfBeast, false);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipFelCrystalforgeItemReturn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipFelCrystalforgeItemTextReturn, go.GetGUID());
|
||||
break;
|
||||
case eTradeskill.GossipActionInfoDef + 1:
|
||||
player.CastSpell(player, GameobjectConst.SpellCreate5FlaskOfBeast, false);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipFelCrystalforgeItemReturn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipFelCrystalforgeItemTextReturn, go.GetGUID());
|
||||
break;
|
||||
case eTradeskill.GossipActionInfoDef + 2:
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipFelCrystalforgeItem1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipFelCrystalforgeItem5, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipFelCrystalforgeText, go.GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_bashir_crystalforge
|
||||
class go_bashir_crystalforge : GameObjectScript
|
||||
{
|
||||
public go_bashir_crystalforge() : base("go_bashir_crystalforge") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() == GameObjectTypes.QuestGiver) /* != GAMEOBJECT_TYPE_QUESTGIVER) */
|
||||
player.PrepareQuestMenu(go.GetGUID()); /* return true*/
|
||||
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipBashirCrystalforgeItem1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipBashirCrystalforgeItem5, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipBashirCrystalforgeText, go.GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnGossipSelect(Player player, GameObject go, uint sender, uint action)
|
||||
{
|
||||
player.PlayerTalkClass.ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case eTradeskill.GossipActionInfoDef:
|
||||
player.CastSpell(player, GameobjectConst.SpellCreate1FlaskOfSorcerer, false);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipBashirCrystalforgeItemReturn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipBashirCrystalforgeItemTextReturn, go.GetGUID());
|
||||
break;
|
||||
case eTradeskill.GossipActionInfoDef + 1:
|
||||
player.CastSpell(player, GameobjectConst.SpellCreate5FlaskOfBeast, false);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipBashirCrystalforgeItemReturn, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 2);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipBashirCrystalforgeItemTextReturn, go.GetGUID());
|
||||
break;
|
||||
case eTradeskill.GossipActionInfoDef + 2:
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipBashirCrystalforgeItem1, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef);
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipBashirCrystalforgeItem5, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipBashirCrystalforgeText, go.GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //matrix_punchograph
|
||||
class go_matrix_punchograph : GameObjectScript
|
||||
{
|
||||
public go_matrix_punchograph() : base("go_matrix_punchograph") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
switch (go.GetEntry())
|
||||
{
|
||||
case GameobjectConst.MatrixPunchograph3005A:
|
||||
if (player.HasItemCount(GameobjectConst.ItemWhitePunchCard))
|
||||
{
|
||||
player.DestroyItemCount(GameobjectConst.ItemWhitePunchCard, 1, true);
|
||||
player.CastSpell(player, GameobjectConst.SpellYellowPunchCard, true);
|
||||
}
|
||||
break;
|
||||
case GameobjectConst.MatrixPunchograph3005B:
|
||||
if (player.HasItemCount(GameobjectConst.ItemYellowPunchCard))
|
||||
{
|
||||
player.DestroyItemCount(GameobjectConst.ItemYellowPunchCard, 1, true);
|
||||
player.CastSpell(player, GameobjectConst.SpellBluePunchCard, true);
|
||||
}
|
||||
break;
|
||||
case GameobjectConst.MatrixPunchograph3005C:
|
||||
if (player.HasItemCount(GameobjectConst.ItemBluePunchCard))
|
||||
{
|
||||
player.DestroyItemCount(GameobjectConst.ItemBluePunchCard, 1, true);
|
||||
player.CastSpell(player, GameobjectConst.SpellRedPunchCard, true);
|
||||
}
|
||||
break;
|
||||
case GameobjectConst.MatrixPunchograph3005D:
|
||||
if (player.HasItemCount(GameobjectConst.ItemRedPunchCard))
|
||||
{
|
||||
player.DestroyItemCount(GameobjectConst.ItemRedPunchCard, 1, true);
|
||||
player.CastSpell(player, GameobjectConst.SpellPrismaticPunchCard, true);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_scourge_cage
|
||||
class go_scourge_cage : GameObjectScript
|
||||
{
|
||||
public go_scourge_cage() : base("go_scourge_cage") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
Creature pNearestPrisoner = go.FindNearestCreature(GameobjectConst.NpcScourgePrisoner, 5.0f, true);
|
||||
if (pNearestPrisoner)
|
||||
{
|
||||
player.KilledMonsterCredit(GameobjectConst.NpcScourgePrisoner, pNearestPrisoner.GetGUID());
|
||||
pNearestPrisoner.DisappearAndDie();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_arcane_prison
|
||||
class go_arcane_prison : GameObjectScript
|
||||
{
|
||||
public go_arcane_prison() : base("go_arcane_prison") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestPrisonBreak) == QuestStatus.Incomplete)
|
||||
{
|
||||
go.SummonCreature(25318, 3485.089844f, 6115.7422188f, 70.966812f, 0, TempSummonType.TimedDespawn, 60000);
|
||||
player.CastSpell(player, GameobjectConst.SpellArcanePrisonerKillCredit, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_blood_filled_orb
|
||||
class go_blood_filled_orb : GameObjectScript
|
||||
{
|
||||
public go_blood_filled_orb() : base("go_blood_filled_orb") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (go.GetGoType() == GameObjectTypes.Goober)
|
||||
player.SummonCreature(GameobjectConst.NpcZelemar, -369.746f, 166.759f, -21.50f, 5.235f, TempSummonType.TimedDespawnOOC, 30000);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_jotunheim_cage
|
||||
class go_jotunheim_cage : GameObjectScript
|
||||
{
|
||||
public go_jotunheim_cage() : base("go_jotunheim_cage") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
Creature pPrisoner = go.FindNearestCreature(GameobjectConst.NpcEbonBladePrisonerHuman, 5.0f, true);
|
||||
if (!pPrisoner)
|
||||
{
|
||||
pPrisoner = go.FindNearestCreature(GameobjectConst.NpcEbonBladePrisonerTroll, 5.0f, true);
|
||||
if (!pPrisoner)
|
||||
{
|
||||
pPrisoner = go.FindNearestCreature(GameobjectConst.NpcEbonBladePrisonerOrc, 5.0f, true);
|
||||
if (!pPrisoner)
|
||||
pPrisoner = go.FindNearestCreature(GameobjectConst.NpcEbonBladePrisonerNe, 5.0f, true);
|
||||
}
|
||||
}
|
||||
if (!pPrisoner || !pPrisoner.IsAlive())
|
||||
return false;
|
||||
|
||||
pPrisoner.DisappearAndDie();
|
||||
player.KilledMonsterCredit(GameobjectConst.NpcEbonBladePrisonerHuman);
|
||||
switch (pPrisoner.GetEntry())
|
||||
{
|
||||
case GameobjectConst.NpcEbonBladePrisonerHuman:
|
||||
player.CastSpell(player, GameobjectConst.SpellSummonBladeKnightH, true);
|
||||
break;
|
||||
case GameobjectConst.NpcEbonBladePrisonerNe:
|
||||
player.CastSpell(player, GameobjectConst.SpellSummonBladeKnightNe, true);
|
||||
break;
|
||||
case GameobjectConst.NpcEbonBladePrisonerTroll:
|
||||
player.CastSpell(player, GameobjectConst.SpellSummonBladeKnightTroll, true);
|
||||
break;
|
||||
case GameobjectConst.NpcEbonBladePrisonerOrc:
|
||||
player.CastSpell(player, GameobjectConst.SpellSummonBladeKnightOrc, true);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_table_theka : GameObjectScript
|
||||
{
|
||||
public go_table_theka() : base("go_table_theka") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestSpiderGold) == QuestStatus.Incomplete)
|
||||
player.AreaExploredOrEventHappens(GameobjectConst.QuestSpiderGold);
|
||||
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipTableTheka, go.GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_inconspicuous_landmark
|
||||
class go_inconspicuous_landmark : GameObjectScript
|
||||
{
|
||||
public go_inconspicuous_landmark() : base("go_inconspicuous_landmark") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
if (player.HasItemCount(GameobjectConst.ItemCuergosKey))
|
||||
return false;
|
||||
|
||||
player.CastSpell(player, GameobjectConst.SpellSummonPiratesTreasureAndTriggerMob, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_soulwell
|
||||
class go_soulwell : GameObjectScript
|
||||
{
|
||||
public go_soulwell() : base("go_soulwell") { }
|
||||
|
||||
class go_soulwellAI : GameObjectAI
|
||||
{
|
||||
public go_soulwellAI(GameObject go) : base(go) { }
|
||||
|
||||
public override bool GossipHello(Player player, bool isUse)
|
||||
{
|
||||
if (!isUse)
|
||||
return true;
|
||||
|
||||
Unit owner = go.GetOwner();
|
||||
if (!owner || !owner.IsTypeId(TypeId.Player) || !player.IsInSameRaidWith(owner.ToPlayer()))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public override GameObjectAI GetAI(GameObject go)
|
||||
{
|
||||
return new go_soulwellAI(go);
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_dragonflayer_cage
|
||||
class go_dragonflayer_cage : GameObjectScript
|
||||
{
|
||||
public go_dragonflayer_cage() : base("go_dragonflayer_cage") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestPrisonersOfWyrmskull) != QuestStatus.Incomplete)
|
||||
return true;
|
||||
|
||||
Creature pPrisoner = go.FindNearestCreature(GameobjectConst.NpcPrisonerPriest, 2.0f);
|
||||
if (!pPrisoner)
|
||||
{
|
||||
pPrisoner = go.FindNearestCreature(GameobjectConst.NpcPrisonerMage, 2.0f);
|
||||
if (!pPrisoner)
|
||||
{
|
||||
pPrisoner = go.FindNearestCreature(GameobjectConst.NpcPrisonerWarrior, 2.0f);
|
||||
if (!pPrisoner)
|
||||
pPrisoner = go.FindNearestCreature(GameobjectConst.NpcPrisonerPaladin, 2.0f);
|
||||
}
|
||||
}
|
||||
|
||||
if (!pPrisoner || !pPrisoner.IsAlive())
|
||||
return true;
|
||||
|
||||
/// @todo prisoner should help player for a short period of time
|
||||
player.KilledMonsterCredit(GameobjectConst.NpcCapturedValgardePrisonerProxy);
|
||||
pPrisoner.DespawnOrUnsummon();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_tadpole_cage
|
||||
class go_tadpole_cage : GameObjectScript
|
||||
{
|
||||
public go_tadpole_cage() : base("go_tadpole_cage") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestOhNoesTheTadpoles) == QuestStatus.Incomplete)
|
||||
{
|
||||
Creature pTadpole = go.FindNearestCreature(GameobjectConst.NpcWinterfinTadpole, 1.0f);
|
||||
if (pTadpole)
|
||||
{
|
||||
pTadpole.DisappearAndDie();
|
||||
player.KilledMonsterCredit(GameobjectConst.NpcWinterfinTadpole);
|
||||
//FIX: Summon minion tadpole
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_amberpine_outhouse
|
||||
class go_amberpine_outhouse : GameObjectScript
|
||||
{
|
||||
public go_amberpine_outhouse() : base("go_amberpine_outhouse") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
QuestStatus status = player.GetQuestStatus(GameobjectConst.QuestDoingYourDuty);
|
||||
if (status == QuestStatus.Incomplete || status == QuestStatus.Complete || status == QuestStatus.Rewarded)
|
||||
{
|
||||
player.ADD_GOSSIP_ITEM(GossipOptionIcon.Chat, GameobjectConst.GossipUseOuthouse, eTradeskill.GossipSenderMain, eTradeskill.GossipActionInfoDef + 1);
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipOuthouseVacant, go.GetGUID());
|
||||
}
|
||||
else
|
||||
player.SEND_GOSSIP_MENU(GameobjectConst.GossipOuthouseInuse, go.GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override bool OnGossipSelect(Player player, GameObject go, uint sender, uint action)
|
||||
{
|
||||
player.PlayerTalkClass.ClearMenus();
|
||||
if (action == eTradeskill.GossipActionInfoDef + 1)
|
||||
{
|
||||
player.CLOSE_GOSSIP_MENU();
|
||||
Creature target = ScriptedAI.GetClosestCreatureWithEntry(player, GameobjectConst.NpcOuthouseBunny, 3.0f);
|
||||
if (target)
|
||||
{
|
||||
target.GetAI().SetData(1, (uint)player.GetGender());
|
||||
go.CastSpell(target, GameobjectConst.SpellIndisposedIii);
|
||||
}
|
||||
go.CastSpell(player, GameobjectConst.SpellIndisposed);
|
||||
if (player.HasItemCount(GameobjectConst.ItemAnderholsSliderCider))
|
||||
go.CastSpell(player, GameobjectConst.SpellCreateAmberseeds);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
player.CLOSE_GOSSIP_MENU();
|
||||
player.GetSession().SendNotification(GameobjectConst.GoAnderholsSliderCiderNotFound);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_hive_pod
|
||||
class go_hive_pod : GameObjectScript
|
||||
{
|
||||
public go_hive_pod() : base("go_hive_pod") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
player.SendLoot(go.GetGUID(), LootType.Corpse);
|
||||
go.SummonCreature(GameobjectConst.NpcHiveAmbusher, go.GetPositionX() + 1, go.GetPositionY(), go.GetPositionZ(), go.GetAngle(player), TempSummonType.TimedOrDeadDespawn, 60000);
|
||||
go.SummonCreature(GameobjectConst.NpcHiveAmbusher, go.GetPositionX(), go.GetPositionY() + 1, go.GetPositionZ(), go.GetAngle(player), TempSummonType.TimedOrDeadDespawn, 60000);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_massive_seaforium_charge : GameObjectScript
|
||||
{
|
||||
public go_massive_seaforium_charge() : base("go_massive_seaforium_charge") { }
|
||||
|
||||
public override bool OnGossipHello(Player Player, GameObject go)
|
||||
{
|
||||
go.SetLootState(LootState.JustDeactivated);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_veil_skith_cage
|
||||
class go_veil_skith_cage : GameObjectScript
|
||||
{
|
||||
public go_veil_skith_cage() : base("go_veil_skith_cage") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton();
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestMissingFriends) == QuestStatus.Incomplete)
|
||||
{
|
||||
List<Creature> childrenList = new List<Creature>();
|
||||
go.GetCreatureListWithEntryInGrid(childrenList, GameobjectConst.NpcCaptiveChild, SharedConst.InteractionDistance);
|
||||
foreach (var creature in childrenList)
|
||||
{
|
||||
player.KilledMonsterCredit(GameobjectConst.NpcCaptiveChild, creature.GetGUID());
|
||||
creature.DespawnOrUnsummon(5000);
|
||||
creature.GetMotionMaster().MovePoint(1, go.GetPositionX() + 5, go.GetPositionY(), go.GetPositionZ());
|
||||
creature.GetAI().Talk(GameobjectConst.SayFree0);
|
||||
creature.GetMotionMaster().Clear();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_frostblade_shrine
|
||||
class go_frostblade_shrine : GameObjectScript
|
||||
{
|
||||
public go_frostblade_shrine() : base("go_frostblade_shrine") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
go.UseDoorOrButton(10);
|
||||
if (!player.HasAura(GameobjectConst.SpellRecentMeditation))
|
||||
if (player.GetQuestStatus(GameobjectConst.QuestTheCleansingHorde) == QuestStatus.Incomplete || player.GetQuestStatus(GameobjectConst.QuestTheCleansingAlliance) == QuestStatus.Incomplete)
|
||||
{
|
||||
player.CastSpell(player, GameobjectConst.SpellCleansingSoul);
|
||||
player.SetStandState(UnitStandStateType.Sit);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //go_midsummer_bonfire
|
||||
class go_midsummer_bonfire : GameObjectScript
|
||||
{
|
||||
public go_midsummer_bonfire() : base("go_midsummer_bonfire") { }
|
||||
|
||||
public override bool OnGossipSelect(Player player, GameObject go, uint sender, uint action)
|
||||
{
|
||||
player.CastSpell(player, GameobjectConst.StampOutBonfireQuestComplete, true);
|
||||
player.CLOSE_GOSSIP_MENU();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_midsummer_ribbon_pole : GameObjectScript
|
||||
{
|
||||
public go_midsummer_ribbon_pole() : base("go_midsummer_ribbon_pole") { }
|
||||
|
||||
public override bool OnGossipHello(Player player, GameObject go)
|
||||
{
|
||||
Creature creature = go.FindNearestCreature(GameobjectConst.NpcPoleRibbonBunny, 10.0f);
|
||||
if (creature)
|
||||
{
|
||||
creature.GetAI().DoAction(0);
|
||||
player.CastSpell(creature, GameobjectConst.SpellPoleDance, true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_toy_train_set : GameObjectScript
|
||||
{
|
||||
public go_toy_train_set() : base("go_toy_train_set") { }
|
||||
|
||||
class go_toy_train_setAI : GameObjectAI
|
||||
{
|
||||
public go_toy_train_setAI(GameObject go) : base(go)
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
|
||||
{
|
||||
go.CastSpell(null, GameobjectConst.SpellToyTrainPulse, true);
|
||||
task.Repeat(TimeSpan.FromSeconds(6));
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
|
||||
// triggered on wrecker'd
|
||||
public override void DoAction(int action)
|
||||
{
|
||||
go.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override GameObjectAI GetAI(GameObject go)
|
||||
{
|
||||
return new go_toy_train_setAI(go);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,382 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
public struct GuardsConst
|
||||
{
|
||||
public const int CreatureCooldown = 5000;
|
||||
public const int SaySilAggro = 0;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const int CenarionHoldIndantry = 15184;
|
||||
public const int StormwindCityGuard = 68;
|
||||
public const int StormwindCityPatroller = 1976;
|
||||
public const int OrgimmarGrunt = 3296;
|
||||
}
|
||||
|
||||
struct Spells
|
||||
{
|
||||
public const uint BanishedA = 36642;
|
||||
public const uint BanishedS = 36671;
|
||||
public const uint BanishTeleport = 36643;
|
||||
public const uint Exile = 39533;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class guard_generic : CreatureScript
|
||||
{
|
||||
public guard_generic() : base("guard_generic") { }
|
||||
|
||||
class guard_genericAI : GuardAI
|
||||
{
|
||||
public guard_genericAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
globalCooldown = 0;
|
||||
buffTimer = 0;
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
if (me.GetEntry() == CreatureIds.CenarionHoldIndantry)
|
||||
Talk(GuardsConst.SaySilAggro, who);
|
||||
SpellInfo spell = me.reachWithSpellAttack(who);
|
||||
if (spell != null)
|
||||
DoCast(who, spell.Id);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint 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.IsAlive() && !me.IsInCombat())
|
||||
{
|
||||
if (buffTimer <= diff)
|
||||
{
|
||||
//Find a spell that targets friendly and applies an aura (these are generally buffs)
|
||||
SpellInfo info = SelectSpell(me, 0, 0, SelectTargetType.AnyFriend, 0, 0, SelectEffect.Aura);
|
||||
|
||||
if (info != null && globalCooldown == 0)
|
||||
{
|
||||
//Cast the buff spell
|
||||
DoCast(me, info.Id);
|
||||
|
||||
//Set our global cooldown
|
||||
globalCooldown = GuardsConst.CreatureCooldown;
|
||||
|
||||
//Set our timer to 10 minutes before rebuff
|
||||
buffTimer = 600000;
|
||||
} //Try again in 30 seconds
|
||||
else buffTimer = 30000;
|
||||
}
|
||||
else buffTimer -= diff;
|
||||
}
|
||||
|
||||
//Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// Make sure our attack is ready and we arn't currently casting
|
||||
if (me.isAttackReady() && !me.IsNonMeleeSpellCast(false))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (me.IsWithinMeleeRange(me.GetVictim()))
|
||||
{
|
||||
bool healing = false;
|
||||
SpellInfo info = null;
|
||||
|
||||
//Select a healing spell if less than 30% hp
|
||||
if (me.HealthBelowPct(30))
|
||||
info = SelectSpell(me, 0, 0, SelectTargetType.AnyFriend, 0, 0, SelectEffect.Healing);
|
||||
|
||||
//No healing spell available, select a hostile spell
|
||||
if (info != null)
|
||||
healing = true;
|
||||
else
|
||||
info = SelectSpell(me.GetVictim(), 0, 0, SelectTargetType.AnyEnemy, 0, 0, SelectEffect.DontCare);
|
||||
|
||||
//20% chance to replace our white hit with a spell
|
||||
if (info != null && RandomHelper.IRand(0, 99) < 20 && globalCooldown == 0)
|
||||
{
|
||||
//Cast the spell
|
||||
if (healing)
|
||||
DoCast(me, info.Id);
|
||||
else
|
||||
DoCastVictim(info.Id);
|
||||
|
||||
//Set our global cooldown
|
||||
globalCooldown = GuardsConst.CreatureCooldown;
|
||||
}
|
||||
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 info = null;
|
||||
|
||||
//Select a healing spell if less than 30% hp ONLY 33% of the time
|
||||
if (me.HealthBelowPct(30) && 33 > RandomHelper.IRand(0, 99))
|
||||
info = SelectSpell(me, 0, 0, SelectTargetType.AnyFriend, 0, 0, SelectEffect.Healing);
|
||||
|
||||
//No healing spell available, See if we can cast a ranged spell (Range must be greater than ATTACK_DISTANCE)
|
||||
if (info != null)
|
||||
healing = true;
|
||||
else
|
||||
info = SelectSpell(me.GetVictim(), 0, 0, SelectTargetType.AnyEnemy, SharedConst.NominalMeleeRange, 0, SelectEffect.DontCare);
|
||||
|
||||
//Found a spell, check if we arn't on cooldown
|
||||
if (info != null && globalCooldown == 0)
|
||||
{
|
||||
//If we are currently moving stop us and set the movement generator
|
||||
if (me.GetMotionMaster().GetCurrentMovementGeneratorType() != MovementGeneratorType.Idle)
|
||||
{
|
||||
me.GetMotionMaster().Clear(false);
|
||||
me.GetMotionMaster().MoveIdle();
|
||||
}
|
||||
|
||||
//Cast spell
|
||||
if (healing)
|
||||
DoCast(me, info.Id);
|
||||
else
|
||||
DoCastVictim(info.Id);
|
||||
|
||||
//Set our global cooldown
|
||||
globalCooldown = GuardsConst.CreatureCooldown;
|
||||
} //If no spells available and we arn't moving run to target
|
||||
else if (me.GetMotionMaster().GetCurrentMovementGeneratorType() != MovementGeneratorType.Chase)
|
||||
{
|
||||
//Cancel our current spell and then mutate new movement generator
|
||||
me.InterruptNonMeleeSpells(false);
|
||||
me.GetMotionMaster().Clear(false);
|
||||
me.GetMotionMaster().MoveChase(me.GetVictim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public void DoReplyToTextEmote(TextEmotes emote)
|
||||
{
|
||||
switch (emote)
|
||||
{
|
||||
case TextEmotes.Kiss:
|
||||
me.HandleEmoteCommand(Emote.OneshotBow);
|
||||
break;
|
||||
|
||||
case TextEmotes.Wave:
|
||||
me.HandleEmoteCommand(Emote.OneshotWave);
|
||||
break;
|
||||
|
||||
case TextEmotes.Salute:
|
||||
me.HandleEmoteCommand(Emote.OneshotSalute);
|
||||
break;
|
||||
|
||||
case TextEmotes.Shy:
|
||||
me.HandleEmoteCommand(Emote.OneshotFlex);
|
||||
break;
|
||||
|
||||
case TextEmotes.Rude:
|
||||
case TextEmotes.Chicken:
|
||||
me.HandleEmoteCommand(Emote.OneshotPoint);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void ReceiveEmote(Player player, TextEmotes textEmote)
|
||||
{
|
||||
switch (me.GetEntry())
|
||||
{
|
||||
case CreatureIds.StormwindCityGuard:
|
||||
case CreatureIds.StormwindCityPatroller:
|
||||
case CreatureIds.OrgimmarGrunt:
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (!me.IsFriendlyTo(player))
|
||||
return;
|
||||
|
||||
DoReplyToTextEmote(textEmote);
|
||||
}
|
||||
|
||||
uint globalCooldown;
|
||||
uint buffTimer;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new guard_genericAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class guard_shattrath_scryer : CreatureScript
|
||||
{
|
||||
public guard_shattrath_scryer() : base("guard_shattrath_scryer") { }
|
||||
|
||||
class guard_shattrath_scryerAI : GuardAI
|
||||
{
|
||||
public guard_shattrath_scryerAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
playerGUID.Clear();
|
||||
canTeleport = false;
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
Unit temp = me.GetVictim();
|
||||
if (temp && temp.IsTypeId(TypeId.Player))
|
||||
{
|
||||
DoCast(temp, Spells.BanishedA);
|
||||
playerGUID = temp.GetGUID();
|
||||
if (!playerGUID.IsEmpty())
|
||||
canTeleport = true;
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(9));
|
||||
}
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(8.5), task =>
|
||||
{
|
||||
if (canTeleport)
|
||||
{
|
||||
Unit temp = Global.ObjAccessor.GetUnit(me, playerGUID);
|
||||
if (temp)
|
||||
{
|
||||
temp.CastSpell(temp, Spells.Exile, true);
|
||||
temp.CastSpell(temp, Spells.BanishTeleport, true);
|
||||
}
|
||||
playerGUID.Clear();
|
||||
canTeleport = false;
|
||||
|
||||
task.Repeat();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
ObjectGuid playerGUID;
|
||||
bool canTeleport;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new guard_shattrath_scryerAI(creature);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class guard_shattrath_aldor : CreatureScript
|
||||
{
|
||||
public guard_shattrath_aldor() : base("guard_shattrath_aldor") { }
|
||||
|
||||
class guard_shattrath_aldorAI : GuardAI
|
||||
{
|
||||
public guard_shattrath_aldorAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
playerGUID.Clear();
|
||||
canTeleport = false;
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
Unit temp = me.GetVictim();
|
||||
if (temp && temp.IsTypeId(TypeId.Player))
|
||||
{
|
||||
DoCast(temp, Spells.BanishedA);
|
||||
playerGUID = temp.GetGUID();
|
||||
if (!playerGUID.IsEmpty())
|
||||
canTeleport = true;
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(9));
|
||||
}
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(8.5), task =>
|
||||
{
|
||||
if (canTeleport)
|
||||
{
|
||||
Unit temp = Global.ObjAccessor.GetUnit(me, playerGUID);
|
||||
if (temp)
|
||||
{
|
||||
temp.CastSpell(temp, Spells.Exile, true);
|
||||
temp.CastSpell(temp, Spells.BanishTeleport, true);
|
||||
}
|
||||
playerGUID.Clear();
|
||||
canTeleport = false;
|
||||
|
||||
task.Repeat();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
ObjectGuid playerGUID;
|
||||
bool canTeleport;
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new guard_shattrath_aldorAI(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,361 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Framework.GameMath;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
struct ItemScriptConst
|
||||
{
|
||||
//Onlyforflight
|
||||
public const uint SpellArcaneCharges = 45072;
|
||||
|
||||
//Pilefakefur
|
||||
public const uint GoCaribouTrap1 = 187982;
|
||||
public const uint GoCaribouTrap2 = 187995;
|
||||
public const uint GoCaribouTrap3 = 187996;
|
||||
public const uint GoCaribouTrap4 = 187997;
|
||||
public const uint GoCaribouTrap5 = 187998;
|
||||
public const uint GoCaribouTrap6 = 187999;
|
||||
public const uint GoCaribouTrap7 = 188000;
|
||||
public const uint GoCaribouTrap8 = 188001;
|
||||
public const uint GoCaribouTrap9 = 188002;
|
||||
public const uint GoCaribouTrap10 = 188003;
|
||||
public const uint GoCaribouTrap11 = 188004;
|
||||
public const uint GoCaribouTrap12 = 188005;
|
||||
public const uint GoCaribouTrap13 = 188006;
|
||||
public const uint GoCaribouTrap14 = 188007;
|
||||
public const uint GoCaribouTrap15 = 188008;
|
||||
public const uint GoHighQualityFur = 187983;
|
||||
public const uint NpcNesingwaryTrapper = 25835;
|
||||
|
||||
public static uint[] CaribouTraps =
|
||||
{
|
||||
GoCaribouTrap1, GoCaribouTrap2, GoCaribouTrap3, GoCaribouTrap4, GoCaribouTrap5,
|
||||
GoCaribouTrap6, GoCaribouTrap7, GoCaribouTrap8, GoCaribouTrap9, GoCaribouTrap10,
|
||||
GoCaribouTrap11, GoCaribouTrap12, GoCaribouTrap13, GoCaribouTrap14, GoCaribouTrap15,
|
||||
};
|
||||
|
||||
//Petrovclusterbombs
|
||||
public const uint SpellPetrovBomb = 42406;
|
||||
public const uint AreaIdShatteredStraits = 4064;
|
||||
public const uint ZoneIdHowling = 495;
|
||||
|
||||
//Helpthemselves
|
||||
public const uint QuestCannotHelpThemselves = 11876;
|
||||
public const uint NpcTrappedMammothCalf = 25850;
|
||||
public const uint GoMammothTrap1 = 188022;
|
||||
public const uint GoMammothTrap2 = 188024;
|
||||
public const uint GoMammothTrap3 = 188025;
|
||||
public const uint GoMammothTrap4 = 188026;
|
||||
public const uint GoMammothTrap5 = 188027;
|
||||
public const uint GoMammothTrap6 = 188028;
|
||||
public const uint GoMammothTrap7 = 188029;
|
||||
public const uint GoMammothTrap8 = 188030;
|
||||
public const uint GoMammothTrap9 = 188031;
|
||||
public const uint GoMammothTrap10 = 188032;
|
||||
public const uint GoMammothTrap11 = 188033;
|
||||
public const uint GoMammothTrap12 = 188034;
|
||||
public const uint GoMammothTrap13 = 188035;
|
||||
public const uint GoMammothTrap14 = 188036;
|
||||
public const uint GoMammothTrap15 = 188037;
|
||||
public const uint GoMammothTrap16 = 188038;
|
||||
public const uint GoMammothTrap17 = 188039;
|
||||
public const uint GoMammothTrap18 = 188040;
|
||||
public const uint GoMammothTrap19 = 188041;
|
||||
public const uint GoMammothTrap20 = 188042;
|
||||
public const uint GoMammothTrap21 = 188043;
|
||||
public const uint GoMammothTrap22 = 188044;
|
||||
|
||||
public static uint[] MammothTraps =
|
||||
{
|
||||
GoMammothTrap1, GoMammothTrap2, GoMammothTrap3, GoMammothTrap4, GoMammothTrap5,
|
||||
GoMammothTrap6, GoMammothTrap7, GoMammothTrap8, GoMammothTrap9, GoMammothTrap10,
|
||||
GoMammothTrap11, GoMammothTrap12, GoMammothTrap13, GoMammothTrap14, GoMammothTrap15,
|
||||
GoMammothTrap16, GoMammothTrap17, GoMammothTrap18, GoMammothTrap19, GoMammothTrap20,
|
||||
GoMammothTrap21, GoMammothTrap22
|
||||
};
|
||||
|
||||
//Theemissary
|
||||
public const uint QuestTheEmissary = 11626;
|
||||
public const uint NpcLeviroth = 26452;
|
||||
|
||||
//Capturedfrog
|
||||
public const uint QuestThePerfectSpies = 25444;
|
||||
public const uint NpcVanirasSentryTotem = 40187;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class item_only_for_flight : ItemScript
|
||||
{
|
||||
public item_only_for_flight() : base("item_only_for_flight") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
uint 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:
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ItemScriptConst.SpellArcaneCharges);
|
||||
if (spellInfo != null)
|
||||
Spell.SendCastResult(player, spellInfo, 0, castId, SpellCastResult.NotOnGround);
|
||||
break;
|
||||
}
|
||||
|
||||
// allow use in flight only
|
||||
if (player.IsInFlight() && !disabled)
|
||||
return false;
|
||||
|
||||
// error
|
||||
player.SendEquipError(InventoryResult.ClientLockedOut, item, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_nether_wraith_beacon
|
||||
class item_nether_wraith_beacon : ItemScript
|
||||
{
|
||||
public item_nether_wraith_beacon() : base("item_nether_wraith_beacon") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (player.GetQuestStatus(10832) == QuestStatus.Incomplete)
|
||||
{
|
||||
Creature nether = player.SummonCreature(22408, player.GetPositionX(), player.GetPositionY() + 20, player.GetPositionZ(), 0, TempSummonType.TimedDespawn, 180000);
|
||||
if (nether)
|
||||
nether.GetAI().AttackStart(player);
|
||||
|
||||
Creature nether1 = player.SummonCreature(22408, player.GetPositionX(), player.GetPositionY() - 20, player.GetPositionZ(), 0, TempSummonType.TimedDespawn, 180000);
|
||||
if (nether1)
|
||||
nether1.GetAI().AttackStart(player);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_gor_dreks_ointment
|
||||
class item_gor_dreks_ointment : ItemScript
|
||||
{
|
||||
public item_gor_dreks_ointment() : base("item_gor_dreks_ointment") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (targets.GetUnitTarget() && targets.GetUnitTarget().IsTypeId(TypeId.Unit) &&
|
||||
targets.GetUnitTarget().GetEntry() == 20748 && !targets.GetUnitTarget().HasAura(32578))
|
||||
return false;
|
||||
|
||||
player.SendEquipError(InventoryResult.ClientLockedOut, item, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_incendiary_explosives
|
||||
class item_incendiary_explosives : ItemScript
|
||||
{
|
||||
public item_incendiary_explosives() : base("item_incendiary_explosives") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (player.FindNearestCreature(26248, 15) || player.FindNearestCreature(26249, 15))
|
||||
return false;
|
||||
else
|
||||
{
|
||||
player.SendEquipError(InventoryResult.OutOfRange, item, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_mysterious_egg
|
||||
class item_mysterious_egg : ItemScript
|
||||
{
|
||||
public item_mysterious_egg() : base("item_mysterious_egg") { }
|
||||
|
||||
public override bool OnExpire(Player player, ItemTemplate pItemProto)
|
||||
{
|
||||
List<ItemPosCount> dest = new List<ItemPosCount>();
|
||||
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 39883, 1); // Cracked Egg
|
||||
if (msg == InventoryResult.Ok)
|
||||
player.StoreNewItem(dest, 39883, true, ItemEnchantment.GenerateItemRandomPropertyId(39883));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_disgusting_jar
|
||||
class item_disgusting_jar : ItemScript
|
||||
{
|
||||
public item_disgusting_jar() : base("item_disgusting_jar") { }
|
||||
|
||||
public override bool OnExpire(Player player, ItemTemplate pItemProto)
|
||||
{
|
||||
List<ItemPosCount> dest = new List<ItemPosCount>();
|
||||
InventoryResult msg = player.CanStoreNewItem(ItemConst.NullBag, ItemConst.NullSlot, dest, 44718, 1); // Ripe Disgusting Jar
|
||||
if (msg == InventoryResult.Ok)
|
||||
player.StoreNewItem(dest, 44718, true, ItemEnchantment.GenerateItemRandomPropertyId(44718));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_pile_fake_furs
|
||||
class item_pile_fake_furs : ItemScript
|
||||
{
|
||||
public item_pile_fake_furs() : base("item_pile_fake_furs") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
GameObject go = null;
|
||||
for (byte i = 0; i < ItemScriptConst.CaribouTraps.Length; ++i)
|
||||
{
|
||||
go = player.FindNearestGameObject(ItemScriptConst.CaribouTraps[i], 5.0f);
|
||||
if (go)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!go)
|
||||
return false;
|
||||
|
||||
if (go.FindNearestCreature(ItemScriptConst.NpcNesingwaryTrapper, 10.0f, true) || go.FindNearestCreature(ItemScriptConst.NpcNesingwaryTrapper, 10.0f, false) || go.FindNearestGameObject(ItemScriptConst.GoHighQualityFur, 2.0f))
|
||||
return true;
|
||||
|
||||
float x, y, z;
|
||||
go.GetClosePoint(out x, out y, out z, go.GetObjectSize() / 3, 7.0f);
|
||||
go.SummonGameObject(ItemScriptConst.GoHighQualityFur, go, Quaternion.WAxis, 1);
|
||||
TempSummon summon = player.SummonCreature(ItemScriptConst.NpcNesingwaryTrapper, x, y, z, go.GetOrientation(), TempSummonType.DeadDespawn, 1000);
|
||||
if (summon)
|
||||
{
|
||||
summon.SetVisible(false);
|
||||
summon.SetReactState(ReactStates.Passive);
|
||||
summon.SetFlag(UnitFields.Flags, UnitFlags.ImmuneToPc);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script] //item_petrov_cluster_bombs
|
||||
class item_petrov_cluster_bombs : ItemScript
|
||||
{
|
||||
public item_petrov_cluster_bombs() : base("item_petrov_cluster_bombs") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (player.GetZoneId() != ItemScriptConst.ZoneIdHowling)
|
||||
return false;
|
||||
|
||||
if (!player.GetTransport() || player.GetAreaId() != ItemScriptConst.AreaIdShatteredStraits)
|
||||
{
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(ItemScriptConst.SpellPetrovBomb);
|
||||
if (spellInfo != null)
|
||||
Spell.SendCastResult(player, spellInfo, 0, castId, SpellCastResult.NotHere);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//item_dehta_trap_smasher
|
||||
[Script] //For quest 11876, Help Those That Cannot Help Themselves
|
||||
class item_dehta_trap_smasher : ItemScript
|
||||
{
|
||||
public item_dehta_trap_smasher() : base("item_dehta_trap_smasher") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (player.GetQuestStatus(ItemScriptConst.QuestCannotHelpThemselves) != QuestStatus.Incomplete)
|
||||
return false;
|
||||
|
||||
Creature pMammoth = player.FindNearestCreature(ItemScriptConst.NpcTrappedMammothCalf, 5.0f);
|
||||
if (!pMammoth)
|
||||
return false;
|
||||
|
||||
GameObject pTrap = null;
|
||||
for (byte i = 0; i < ItemScriptConst.MammothTraps.Length; ++i)
|
||||
{
|
||||
pTrap = player.FindNearestGameObject(ItemScriptConst.MammothTraps[i], 11.0f);
|
||||
if (pTrap)
|
||||
{
|
||||
pMammoth.GetAI().DoAction(1);
|
||||
pTrap.SetGoState(GameObjectState.Ready);
|
||||
player.KilledMonsterCredit(ItemScriptConst.NpcTrappedMammothCalf);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class item_trident_of_nazjan : ItemScript
|
||||
{
|
||||
public item_trident_of_nazjan() : base("item_Trident_of_Nazjan") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (player.GetQuestStatus(ItemScriptConst.QuestTheEmissary) == QuestStatus.Incomplete)
|
||||
{
|
||||
Creature pLeviroth = player.FindNearestCreature(ItemScriptConst.NpcLeviroth, 10.0f);
|
||||
if (pLeviroth) // spell range
|
||||
{
|
||||
pLeviroth.GetAI().AttackStart(player);
|
||||
return false;
|
||||
} else
|
||||
player.SendEquipError(InventoryResult.OutOfRange, item, null);
|
||||
} else
|
||||
player.SendEquipError(InventoryResult.ClientLockedOut, item, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class item_captured_frog : ItemScript
|
||||
{
|
||||
public item_captured_frog() : base("item_captured_frog") { }
|
||||
|
||||
public override bool OnUse(Player player, Item item, SpellCastTargets targets, ObjectGuid castId)
|
||||
{
|
||||
if (player.GetQuestStatus(ItemScriptConst.QuestThePerfectSpies) == QuestStatus.Incomplete)
|
||||
{
|
||||
if (player.FindNearestCreature(ItemScriptConst.NpcVanirasSentryTotem, 10.0f))
|
||||
return false;
|
||||
else
|
||||
player.SendEquipError(InventoryResult.OutOfRange, item, null);
|
||||
}
|
||||
else
|
||||
player.SendEquipError(InventoryResult.ClientLockedOut, item, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
[Script]
|
||||
class trigger_periodic : CreatureScript
|
||||
{
|
||||
public trigger_periodic() : base("trigger_periodic") { }
|
||||
|
||||
class trigger_periodicAI : NullCreatureAI
|
||||
{
|
||||
public trigger_periodicAI(Creature creature) : base(creature)
|
||||
{
|
||||
var interval = me.GetBaseAttackTime(Framework.Constants.WeaponAttackType.BaseAttack);
|
||||
_scheduler.Schedule(TimeSpan.FromMilliseconds(interval), task =>
|
||||
{
|
||||
me.CastSpell(me, me.m_spells[0], true);
|
||||
task.Repeat(TimeSpan.FromMilliseconds(interval));
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update();
|
||||
}
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new trigger_periodicAI(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
enum GossipOptionIds
|
||||
{
|
||||
Alchemy = 0,
|
||||
Blacksmithing = 1,
|
||||
Enchanting = 2,
|
||||
Engineering = 3,
|
||||
Herbalism = 4,
|
||||
Inscription = 5,
|
||||
Jewelcrafting = 6,
|
||||
Leatherworking = 7,
|
||||
Mining = 8,
|
||||
Skinning = 9,
|
||||
Tailoring = 10,
|
||||
Multi = 11,
|
||||
}
|
||||
|
||||
enum GossipMenuIds
|
||||
{
|
||||
Herbalism = 12188,
|
||||
Mining = 12189,
|
||||
Skinning = 12190,
|
||||
Alchemy = 12191,
|
||||
Blacksmithing = 12192,
|
||||
Enchanting = 12193,
|
||||
Engineering = 12195,
|
||||
Inscription = 12196,
|
||||
Jewelcrafting = 12197,
|
||||
Leatherworking = 12198,
|
||||
Tailoring = 12199,
|
||||
}
|
||||
|
||||
[Script] //start menu multi profession trainer
|
||||
class npc_multi_profession_trainer : CreatureScript
|
||||
{
|
||||
public npc_multi_profession_trainer() : base("npc_multi_profession_trainer") { }
|
||||
|
||||
class npc_multi_profession_trainerAI : ScriptedAI
|
||||
{
|
||||
public npc_multi_profession_trainerAI(Creature creature) : base(creature) { }
|
||||
|
||||
public override void sGossipSelect(Player player, uint menuId, uint gossipListId)
|
||||
{
|
||||
switch ((GossipOptionIds)gossipListId)
|
||||
{
|
||||
case GossipOptionIds.Alchemy:
|
||||
case GossipOptionIds.Blacksmithing:
|
||||
case GossipOptionIds.Enchanting:
|
||||
case GossipOptionIds.Engineering:
|
||||
case GossipOptionIds.Herbalism:
|
||||
case GossipOptionIds.Inscription:
|
||||
case GossipOptionIds.Jewelcrafting:
|
||||
case GossipOptionIds.Leatherworking:
|
||||
case GossipOptionIds.Mining:
|
||||
case GossipOptionIds.Skinning:
|
||||
case GossipOptionIds.Tailoring:
|
||||
SendTrainerList(player, (GossipOptionIds)gossipListId);
|
||||
break;
|
||||
case GossipOptionIds.Multi:
|
||||
{
|
||||
switch ((GossipMenuIds)menuId)
|
||||
{
|
||||
case GossipMenuIds.Herbalism:
|
||||
SendTrainerList(player, GossipOptionIds.Herbalism);
|
||||
break;
|
||||
case GossipMenuIds.Mining:
|
||||
SendTrainerList(player, GossipOptionIds.Mining);
|
||||
break;
|
||||
case GossipMenuIds.Skinning:
|
||||
SendTrainerList(player, GossipOptionIds.Skinning);
|
||||
break;
|
||||
case GossipMenuIds.Alchemy:
|
||||
SendTrainerList(player, GossipOptionIds.Alchemy);
|
||||
break;
|
||||
case GossipMenuIds.Blacksmithing:
|
||||
SendTrainerList(player, GossipOptionIds.Blacksmithing);
|
||||
break;
|
||||
case GossipMenuIds.Enchanting:
|
||||
SendTrainerList(player, GossipOptionIds.Enchanting);
|
||||
break;
|
||||
case GossipMenuIds.Engineering:
|
||||
SendTrainerList(player, GossipOptionIds.Engineering);
|
||||
break;
|
||||
case GossipMenuIds.Inscription:
|
||||
SendTrainerList(player, GossipOptionIds.Inscription);
|
||||
break;
|
||||
case GossipMenuIds.Jewelcrafting:
|
||||
SendTrainerList(player, GossipOptionIds.Jewelcrafting);
|
||||
break;
|
||||
case GossipMenuIds.Leatherworking:
|
||||
SendTrainerList(player, GossipOptionIds.Leatherworking);
|
||||
break;
|
||||
case GossipMenuIds.Tailoring:
|
||||
SendTrainerList(player, GossipOptionIds.Tailoring);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SendTrainerList(Player player, GossipOptionIds Index)
|
||||
{
|
||||
player.GetSession().SendTrainerList(me.GetGUID(), (uint)Index + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public override CreatureAI GetAI(Creature creature)
|
||||
{
|
||||
return new npc_multi_profession_trainerAI(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2017 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
using Game;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Scripts.World
|
||||
{
|
||||
struct SceneSpells
|
||||
{
|
||||
public const uint DeathwingSimulator = 201184;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class scene_deathwing_simulator : SceneScript
|
||||
{
|
||||
public scene_deathwing_simulator() : base("scene_deathwing_simulator") { }
|
||||
|
||||
// Called when a player receive trigger from scene
|
||||
public override void OnSceneTriggerEvent(Player player, uint sceneInstanceID, SceneTemplate sceneTemplate, string triggerName)
|
||||
{
|
||||
if (triggerName == "BURN PLAYER")
|
||||
player.CastSpell(player, SceneSpells.DeathwingSimulator, true); // Deathwing Simulator Burn player
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user