Core/Refactor: Part 5
This commit is contained in:
@@ -28,6 +28,7 @@ public class Log
|
||||
static Log()
|
||||
{
|
||||
m_logsDir = AppContext.BaseDirectory + ConfigMgr.GetDefaultValue("LogsDir", "");
|
||||
lowestLogLevel = LogLevel.Fatal;
|
||||
|
||||
foreach (var appenderName in ConfigMgr.GetKeysByString("Appender."))
|
||||
{
|
||||
@@ -66,11 +67,15 @@ public class Log
|
||||
outInfo(LogFilter.Server, @" \/___/ `/___/> \ \ \/ \/_/\/_/\/____/ \/_/ ");
|
||||
outInfo(LogFilter.Server, @" /\___/\ \_\ ");
|
||||
outInfo(LogFilter.Server, @" \/__/ \/_/ Core");
|
||||
outInfo(LogFilter.Server, "\r");
|
||||
outInfo(LogFilter.Server, "https://github.com/CypherCore/CypherCore \r\n");
|
||||
}
|
||||
|
||||
static bool ShouldLog(LogFilter type, LogLevel level)
|
||||
{
|
||||
// Don't even look for a logger if the LogLevel is lower than lowest log levels across all loggers
|
||||
if (level < lowestLogLevel)
|
||||
return false;
|
||||
|
||||
Logger logger = GetLoggerByType(type);
|
||||
if (logger == null)
|
||||
return false;
|
||||
@@ -256,6 +261,9 @@ public class Log
|
||||
return;
|
||||
}
|
||||
|
||||
if (level < lowestLogLevel)
|
||||
lowestLogLevel = level;
|
||||
|
||||
Logger logger = new Logger(name, level);
|
||||
|
||||
int i = 0;
|
||||
@@ -316,6 +324,8 @@ public class Log
|
||||
if (logger.getName() == name)
|
||||
{
|
||||
logger.setLogLevel(newLevel);
|
||||
if (newLevel != LogLevel.Disabled && newLevel < lowestLogLevel)
|
||||
lowestLogLevel = newLevel;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -345,6 +355,8 @@ public class Log
|
||||
static Dictionary<LogFilter, Logger> loggers = new Dictionary<LogFilter, Logger>();
|
||||
static string m_logsDir;
|
||||
static byte AppenderId;
|
||||
|
||||
static LogLevel lowestLogLevel;
|
||||
}
|
||||
|
||||
enum AppenderType
|
||||
|
||||
@@ -177,12 +177,12 @@ namespace System.Collections.Generic
|
||||
}
|
||||
}
|
||||
|
||||
public interface ICheck<T>
|
||||
public interface ICheck<in T>
|
||||
{
|
||||
bool Invoke(T obj);
|
||||
}
|
||||
|
||||
public interface IDoWork<T>
|
||||
public interface IDoWork<in T>
|
||||
{
|
||||
void Invoke(T obj);
|
||||
}
|
||||
|
||||
@@ -239,6 +239,7 @@ namespace Game.AI
|
||||
me.m_CombatDistance = spellInfo != null ? spellInfo.GetMaxRange(false) : 0;
|
||||
me.m_SightDistance = me.m_CombatDistance;
|
||||
}
|
||||
|
||||
public override bool CanAIAttack(Unit victim)
|
||||
{
|
||||
// todo use one function to replace it
|
||||
@@ -247,11 +248,13 @@ namespace Game.AI
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void AttackStart(Unit victim)
|
||||
{
|
||||
if (victim != null)
|
||||
me.Attack(victim, false);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
@@ -292,6 +295,10 @@ namespace Game.AI
|
||||
}
|
||||
}
|
||||
|
||||
public override void MoveInLineOfSight(Unit who) { }
|
||||
|
||||
public override void AttackStart(Unit victim) { }
|
||||
|
||||
public override void OnCharmed(bool apply)
|
||||
{
|
||||
if (!me.GetVehicleKit().IsVehicleInUse() && !apply && m_HasConditions)//was used and has conditions
|
||||
@@ -350,6 +357,8 @@ namespace Game.AI
|
||||
{
|
||||
public ReactorAI(Creature c) : base(c) { }
|
||||
|
||||
public override void MoveInLineOfSight(Unit who) { }
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
|
||||
@@ -65,5 +65,7 @@ namespace Game.AI
|
||||
public class NullGameObjectAI : GameObjectAI
|
||||
{
|
||||
public NullGameObjectAI(GameObject g) : base(g) { }
|
||||
|
||||
public override void UpdateAI(uint diff) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -343,9 +343,6 @@ namespace Game.AI
|
||||
// Called when spell hits a target
|
||||
public override void SpellHitTarget(Unit target, SpellInfo spell) { }
|
||||
|
||||
//Called at waypoint reached or PointMovement end
|
||||
public override void MovementInform(MovementGeneratorType type, uint id) { }
|
||||
|
||||
// Called when AI is temporarily replaced or put back when possess is applied or removed
|
||||
public virtual void OnPossess(bool apply) { }
|
||||
|
||||
|
||||
@@ -1449,7 +1449,7 @@ namespace Game.AI
|
||||
break;
|
||||
|
||||
uint delay = e.Action.wpPause.delay;
|
||||
((SmartAI)me.GetAI()).PausePath(delay, e.GetEventType() == SmartEvents.WaypointReached ? false : true);
|
||||
((SmartAI)me.GetAI()).PausePath(delay, e.GetEventType() != SmartEvents.WaypointReached);
|
||||
break;
|
||||
}
|
||||
case SmartActions.WpStop:
|
||||
@@ -2695,7 +2695,7 @@ namespace Game.AI
|
||||
}
|
||||
case SmartTargets.ClosestCreature:
|
||||
{
|
||||
Creature target = baseObject.FindNearestCreature(e.Target.closest.entry, e.Target.closest.dist != 0 ? e.Target.closest.dist : 100, e.Target.closest.dead != 0 ? false : true);
|
||||
Creature target = baseObject.FindNearestCreature(e.Target.closest.entry, e.Target.closest.dist != 0 ? e.Target.closest.dist : 100, e.Target.closest.dead == 0);
|
||||
if (target)
|
||||
l.Add(target);
|
||||
break;
|
||||
@@ -3431,7 +3431,7 @@ namespace Game.AI
|
||||
}
|
||||
// min/max was checked at loading!
|
||||
e.timer = RandomHelper.URand(min, max);
|
||||
e.active = e.timer != 0 ? false : true;
|
||||
e.active = e.timer == 0;
|
||||
}
|
||||
|
||||
void UpdateTimer(SmartScriptHolder e, uint diff)
|
||||
|
||||
@@ -289,7 +289,7 @@ namespace Game
|
||||
stmt.AddValue(0, accountId);
|
||||
stmt.AddValue(1, CalculateShaPassHash(username, password));
|
||||
SQLResult result = DB.Login.Query(stmt);
|
||||
return result.IsEmpty() ? false : true;
|
||||
return !result.IsEmpty();
|
||||
}
|
||||
|
||||
public bool CheckEmail(uint accountId, string newEmail)
|
||||
|
||||
@@ -802,7 +802,7 @@ namespace Game.BattleGrounds.Zones
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void CaptureGraveyard(int i, Player Source)
|
||||
@@ -900,7 +900,7 @@ namespace Game.BattleGrounds.Zones
|
||||
default:
|
||||
//ABORT();
|
||||
break;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
void TitanRelicActivated(Player clicker)
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Game.Chat.Commands
|
||||
return false;
|
||||
|
||||
string all = args.NextString();
|
||||
bool allRanks = !string.IsNullOrEmpty(all) ? all == "all" : false;
|
||||
bool allRanks = !string.IsNullOrEmpty(all) && all == "all";
|
||||
|
||||
SpellInfo spellInfo = Global.SpellMgr.GetSpellInfo(spell);
|
||||
if (spellInfo == null || !Global.SpellMgr.IsSpellValid(spellInfo, handler.GetSession().GetPlayer()))
|
||||
@@ -325,7 +325,7 @@ namespace Game.Chat.Commands
|
||||
return false;
|
||||
|
||||
string allStr = args.NextString();
|
||||
bool allRanks = !string.IsNullOrEmpty(allStr) ? allStr == "all" : false;
|
||||
bool allRanks = !string.IsNullOrEmpty(allStr) && allStr == "all";
|
||||
|
||||
Player target = handler.getSelectedPlayer();
|
||||
if (!target)
|
||||
|
||||
@@ -4023,7 +4023,7 @@ namespace Game.Entities
|
||||
if (keepDays == 0)
|
||||
return;
|
||||
|
||||
Player.DeleteOldCharacters(keepDays);
|
||||
DeleteOldCharacters(keepDays);
|
||||
}
|
||||
|
||||
public static void DeleteOldCharacters(int keepDays)
|
||||
|
||||
@@ -6276,7 +6276,7 @@ namespace Game.Entities
|
||||
if (groupRules)
|
||||
group.UpdateLooterGuid(go, true);
|
||||
|
||||
loot.FillLoot(lootid, LootManager.Gameobject, this, !groupRules, false, go.GetLootMode());
|
||||
loot.FillLoot(lootid, LootStorage.Gameobject, this, !groupRules, false, go.GetLootMode());
|
||||
|
||||
// get next RR player (for next loot)
|
||||
if (groupRules)
|
||||
|
||||
@@ -1973,7 +1973,7 @@ namespace Game.Entities
|
||||
PlayerSpell spell = m_spells.LookupByKey(spellId);
|
||||
|
||||
bool disabled = (spell != null) ? spell.Disabled : false;
|
||||
bool active = disabled ? spell.Active : true;
|
||||
bool active = !disabled || spell.Active;
|
||||
|
||||
bool learning = AddSpell(spellId, active, true, dependent, false, false, fromSkill);
|
||||
|
||||
@@ -2525,7 +2525,7 @@ namespace Game.Entities
|
||||
|
||||
// needs to be when spell is already learned, to prevent infinite recursion crashes
|
||||
if (Global.DB2Mgr.GetMount(spellId) != null)
|
||||
GetSession().GetCollectionMgr().AddMount(spellId, MountStatusFlags.None, false, IsInWorld ? false : true);
|
||||
GetSession().GetCollectionMgr().AddMount(spellId, MountStatusFlags.None, false, !IsInWorld);
|
||||
|
||||
// need to add Battle pets automatically into pet journal
|
||||
foreach (BattlePetSpeciesRecord entry in CliDB.BattlePetSpeciesStorage.Values)
|
||||
|
||||
@@ -5204,6 +5204,9 @@ namespace Game.Entities
|
||||
}
|
||||
|
||||
//Target
|
||||
// Used for serverside target changes, does not apply to players
|
||||
public override void SetTarget(ObjectGuid guid) { }
|
||||
|
||||
public void SetSelection(ObjectGuid guid)
|
||||
{
|
||||
SetGuidValue(UnitFields.Target, guid);
|
||||
|
||||
@@ -1403,7 +1403,7 @@ namespace Game.Entities
|
||||
loot.clear();
|
||||
uint lootid = creature.GetCreatureTemplate().LootId;
|
||||
if (lootid != 0)
|
||||
loot.FillLoot(lootid, LootManager.Creature, looter, false, false, creature.GetLootMode());
|
||||
loot.FillLoot(lootid, LootStorage.Creature, looter, false, false, creature.GetLootMode());
|
||||
|
||||
loot.generateMoneyLoot(creature.GetCreatureTemplate().MinGold, creature.GetCreatureTemplate().MaxGold);
|
||||
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace Game
|
||||
charInfo.HairColor = 0;
|
||||
charInfo.FacialHair = 0;
|
||||
|
||||
if (!(charInfo.CustomizationFlag == CharacterCustomizeFlags.Customize))
|
||||
if (charInfo.CustomizationFlag != CharacterCustomizeFlags.Customize)
|
||||
{
|
||||
PreparedStatement stmt = DB.Characters.GetPreparedStatement(CharStatements.UPD_ADD_AT_LOGIN_FLAG);
|
||||
stmt.AddValue(0, (ushort)AtLoginFlags.Customize);
|
||||
|
||||
@@ -724,7 +724,7 @@ namespace Game.Loots
|
||||
|
||||
if (item.reference > 0) // References processing
|
||||
{
|
||||
LootTemplate Referenced = LootManager.Reference.GetLootFor(item.reference);
|
||||
LootTemplate Referenced = LootStorage.Reference.GetLootFor(item.reference);
|
||||
if (Referenced == null)
|
||||
continue; // Error message already printed at loading stage
|
||||
|
||||
@@ -849,8 +849,8 @@ namespace Game.Loots
|
||||
{
|
||||
if (item.reference > 0)
|
||||
{
|
||||
if (LootManager.Reference.GetLootFor(item.reference) == null)
|
||||
LootManager.Reference.ReportNonExistingId(item.reference, item.itemid);
|
||||
if (LootStorage.Reference.GetLootFor(item.reference) == null)
|
||||
LootStorage.Reference.ReportNonExistingId(item.reference, item.itemid);
|
||||
else if (ref_set != null)
|
||||
ref_set.Remove(item.reference);
|
||||
}
|
||||
@@ -1005,8 +1005,8 @@ namespace Game.Loots
|
||||
{
|
||||
if (item.reference > 0)
|
||||
{
|
||||
if (LootManager.Reference.GetLootFor(item.reference) == null)
|
||||
LootManager.Reference.ReportNonExistingId(item.reference, item.itemid);
|
||||
if (LootStorage.Reference.GetLootFor(item.reference) == null)
|
||||
LootStorage.Reference.ReportNonExistingId(item.reference, item.itemid);
|
||||
else if (ref_set != null)
|
||||
ref_set.Remove(item.reference);
|
||||
}
|
||||
@@ -1016,8 +1016,8 @@ namespace Game.Loots
|
||||
{
|
||||
if (item.reference > 0)
|
||||
{
|
||||
if (LootManager.Reference.GetLootFor(item.reference) == null)
|
||||
LootManager.Reference.ReportNonExistingId(item.reference, item.itemid);
|
||||
if (LootStorage.Reference.GetLootFor(item.reference) == null)
|
||||
LootStorage.Reference.ReportNonExistingId(item.reference, item.itemid);
|
||||
else if (ref_set != null)
|
||||
ref_set.Remove(item.reference);
|
||||
}
|
||||
|
||||
@@ -826,14 +826,11 @@ namespace Game
|
||||
DespawnObject(spawns);
|
||||
|
||||
// recycle minimal amount of quests if possible count is lower than limit
|
||||
if (limit > newQuests.Count && !currentQuests.Empty())
|
||||
while (limit > newQuests.Count && !currentQuests.Empty())
|
||||
{
|
||||
do
|
||||
{
|
||||
ulong questId = currentQuests.SelectRandom();
|
||||
newQuests.Add(questId);
|
||||
currentQuests.Remove(questId);
|
||||
} while (newQuests.Count < limit && !currentQuests.Empty()); // failsafe
|
||||
ulong questId = currentQuests.SelectRandom();
|
||||
newQuests.Add(questId);
|
||||
currentQuests.Remove(questId);
|
||||
}
|
||||
|
||||
if (newQuests.Empty())
|
||||
|
||||
@@ -675,9 +675,7 @@ namespace Game
|
||||
Values[WorldCfg.ThreatRadius] = GetDefaultValue("ThreatRadius", 60.0f);
|
||||
|
||||
// always use declined names in the russian client
|
||||
Values[WorldCfg.DeclinedNamesUsed] =
|
||||
|
||||
((RealmZones)Values[WorldCfg.RealmZone] == RealmZones.Russian) ? true : GetDefaultValue("DeclinedNames", false);
|
||||
Values[WorldCfg.DeclinedNamesUsed] = (RealmZones)Values[WorldCfg.RealmZone] == RealmZones.Russian || GetDefaultValue("DeclinedNames", false);
|
||||
|
||||
Values[WorldCfg.ListenRangeSay] = GetDefaultValue("ListenRange.Say", 25.0f);
|
||||
Values[WorldCfg.ListenRangeTextemote] = GetDefaultValue("ListenRange.TextEmote", 25.0f);
|
||||
|
||||
+28
-30
@@ -1254,12 +1254,12 @@ namespace Game.Spells
|
||||
case SpellEffectName.SummonPlayer:
|
||||
if (m_caster.IsTypeId(TypeId.Player) && !m_caster.GetTarget().IsEmpty())
|
||||
{
|
||||
WorldObject target1 = Global.ObjAccessor.FindPlayer(m_caster.GetTarget());
|
||||
WorldObject rafTarget = Global.ObjAccessor.FindPlayer(m_caster.GetTarget());
|
||||
|
||||
CallScriptObjectTargetSelectHandlers(ref target1, effIndex, new SpellImplicitTargetInfo());
|
||||
CallScriptObjectTargetSelectHandlers(ref rafTarget, effIndex, new SpellImplicitTargetInfo());
|
||||
|
||||
if (target1 != null && target1.IsTypeId(TypeId.Player))
|
||||
AddUnitTarget(target1.ToUnit(), (uint)(1 << (int)effIndex), false);
|
||||
if (rafTarget != null && rafTarget.IsTypeId(TypeId.Player))
|
||||
AddUnitTarget(rafTarget.ToUnit(), (uint)(1 << (int)effIndex), false);
|
||||
}
|
||||
return;
|
||||
default:
|
||||
@@ -4765,8 +4765,8 @@ namespace Game.Spells
|
||||
if (!m_caster.IsTypeId(TypeId.Player))
|
||||
return SpellCastResult.DontReport;
|
||||
|
||||
Unit target1 = m_targets.GetUnitTarget();
|
||||
if (target1 == null || !target1.IsFriendlyTo(m_caster) || target1.getAttackers().Empty())
|
||||
Unit target = m_targets.GetUnitTarget();
|
||||
if (target == null || !target.IsFriendlyTo(m_caster) || target.getAttackers().Empty())
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
}
|
||||
@@ -4819,7 +4819,6 @@ namespace Game.Spells
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
SpellInfo learn_spellproto = Global.SpellMgr.GetSpellInfo(effect.TriggerSpell);
|
||||
|
||||
if (learn_spellproto == null)
|
||||
return SpellCastResult.NotKnown;
|
||||
|
||||
@@ -4919,9 +4918,9 @@ namespace Game.Spells
|
||||
// Can be area effect, Check only for players and not check if target - caster (spell can have multiply drain/burn effects)
|
||||
if (m_caster.IsTypeId(TypeId.Player))
|
||||
{
|
||||
Unit target1 = m_targets.GetUnitTarget();
|
||||
if (target1 != null)
|
||||
if (target1 != m_caster && unitTarget.GetPowerType() != (PowerType)effect.MiscValue)
|
||||
Unit target = m_targets.GetUnitTarget();
|
||||
if (target != null)
|
||||
if (target != m_caster && unitTarget.GetPowerType() != (PowerType)effect.MiscValue)
|
||||
return SpellCastResult.BadTargets;
|
||||
}
|
||||
break;
|
||||
@@ -4933,31 +4932,31 @@ namespace Game.Spells
|
||||
|
||||
if (GetSpellInfo().NeedsExplicitUnitTarget())
|
||||
{
|
||||
Unit target1 = m_targets.GetUnitTarget();
|
||||
if (target1 == null)
|
||||
Unit target = m_targets.GetUnitTarget();
|
||||
if (target == null)
|
||||
return SpellCastResult.DontReport;
|
||||
|
||||
|
||||
float objSize = target1.GetObjectSize();
|
||||
float objSize = target.GetObjectSize();
|
||||
float range = m_spellInfo.GetMaxRange(true, m_caster, this) * 1.5f + objSize; // can't be overly strict
|
||||
|
||||
m_preGeneratedPath.SetPathLengthLimit(range);
|
||||
//first try with raycast, if it fails fall back to normal path
|
||||
float targetObjectSize = Math.Min(target1.GetObjectSize(), 4.0f);
|
||||
bool result = m_preGeneratedPath.CalculatePath(target1.GetPositionX(), target1.GetPositionY(), target1.GetPositionZ() + targetObjectSize, false, true);
|
||||
float targetObjectSize = Math.Min(target.GetObjectSize(), 4.0f);
|
||||
bool result = m_preGeneratedPath.CalculatePath(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ() + targetObjectSize, false, true);
|
||||
if (m_preGeneratedPath.GetPathType().HasAnyFlag(PathType.Short))
|
||||
return SpellCastResult.OutOfRange;
|
||||
else if (!result || m_preGeneratedPath.GetPathType().HasAnyFlag(PathType.NoPath | PathType.Incomplete))
|
||||
{
|
||||
result = m_preGeneratedPath.CalculatePath(target1.GetPositionX(), target1.GetPositionY(), target1.GetPositionZ() + targetObjectSize, false, false);
|
||||
result = m_preGeneratedPath.CalculatePath(target.GetPositionX(), target.GetPositionY(), target.GetPositionZ() + targetObjectSize, false, false);
|
||||
if (m_preGeneratedPath.GetPathType().HasAnyFlag(PathType.Short))
|
||||
return SpellCastResult.OutOfRange;
|
||||
else if (!result || m_preGeneratedPath.GetPathType().HasAnyFlag(PathType.NoPath | PathType.Incomplete))
|
||||
return SpellCastResult.NoPath;
|
||||
else if (m_preGeneratedPath.IsInvalidDestinationZ(target1)) // Check position z, if not in a straight line
|
||||
else if (m_preGeneratedPath.IsInvalidDestinationZ(target)) // Check position z, if not in a straight line
|
||||
return SpellCastResult.NoPath;
|
||||
}
|
||||
else if (m_preGeneratedPath.IsInvalidDestinationZ(target1)) // Check position z, if in a straight line
|
||||
else if (m_preGeneratedPath.IsInvalidDestinationZ(target)) // Check position z, if in a straight line
|
||||
return SpellCastResult.NoPath;
|
||||
|
||||
m_preGeneratedPath.ReducePathLenghtByDist(objSize); //move back
|
||||
@@ -5152,10 +5151,9 @@ namespace Game.Spells
|
||||
if (playerCaster.GetTarget().IsEmpty())
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
Player target1 = Global.ObjAccessor.FindPlayer(playerCaster.GetTarget());
|
||||
|
||||
if (target1 == null ||
|
||||
!(target1.GetSession().GetRecruiterId() == playerCaster.GetSession().GetAccountId() || target1.GetSession().GetAccountId() == playerCaster.GetSession().GetRecruiterId()))
|
||||
Player target = Global.ObjAccessor.FindPlayer(playerCaster.GetTarget());
|
||||
if (target == null ||
|
||||
!(target.GetSession().GetRecruiterId() == playerCaster.GetSession().GetAccountId() || target.GetSession().GetAccountId() == playerCaster.GetSession().GetRecruiterId()))
|
||||
return SpellCastResult.BadTargets;
|
||||
|
||||
break;
|
||||
@@ -5291,23 +5289,23 @@ namespace Game.Spells
|
||||
return SpellCastResult.AlreadyHaveCharm;
|
||||
}
|
||||
|
||||
Unit target1 = m_targets.GetUnitTarget();
|
||||
if (target1 != null)
|
||||
Unit target = m_targets.GetUnitTarget();
|
||||
if (target != null)
|
||||
{
|
||||
if (target1.IsTypeId(TypeId.Unit) && target1.ToCreature().IsVehicle())
|
||||
if (target.IsTypeId(TypeId.Unit) && target.ToCreature().IsVehicle())
|
||||
return SpellCastResult.BadImplicitTargets;
|
||||
|
||||
if (target1.IsMounted())
|
||||
if (target.IsMounted())
|
||||
return SpellCastResult.CantBeCharmed;
|
||||
|
||||
if (!target1.GetCharmerGUID().IsEmpty())
|
||||
if (!target.GetCharmerGUID().IsEmpty())
|
||||
return SpellCastResult.Charmed;
|
||||
|
||||
if (target1.GetOwner() != null && target1.GetOwner().IsTypeId(TypeId.Player))
|
||||
if (target.GetOwner() != null && target.GetOwner().IsTypeId(TypeId.Player))
|
||||
return SpellCastResult.TargetIsPlayerControlled;
|
||||
|
||||
int damage = CalculateDamage(effect.EffectIndex, target1);
|
||||
if (damage != 0 && target1.GetLevelForTarget(m_caster) > damage)
|
||||
int damage = CalculateDamage(effect.EffectIndex, target);
|
||||
if (damage != 0 && target.GetLevelForTarget(m_caster) > damage)
|
||||
return SpellCastResult.Highlevel;
|
||||
}
|
||||
|
||||
|
||||
@@ -1147,7 +1147,7 @@ namespace Game.Spells
|
||||
him, because it would be it's passenger, there's no such case where this gets to fail legitimacy, this problem
|
||||
cannot be solved from within the check in other way since target type cannot be called for the spell currently
|
||||
Spell examples: [ID - 52864 Devour Water, ID - 52862 Devour Wind, ID - 49370 Wyrmrest Defender: Destabilize Azure Dragonshrine Effect] */
|
||||
if (!caster.IsVehicle() && !(caster.GetCharmerOrOwner() == target))
|
||||
if (!caster.IsVehicle() && caster.GetCharmerOrOwner() != target)
|
||||
{
|
||||
if (TargetAuraState != 0 && !unitTarget.HasAuraState(TargetAuraState, this, caster))
|
||||
return SpellCastResult.TargetAurastate;
|
||||
|
||||
@@ -564,10 +564,10 @@ namespace Scripts.Northrend.CrusadersColiseum.TrialOfTheChampion
|
||||
{
|
||||
me.InterruptNonMeleeSpells(true);
|
||||
|
||||
Unit target1 = Global.ObjAccessor.GetUnit(me, uiTargetGUID);
|
||||
if (target1 && me.IsInRange(target1, 5.0f, 30.0f, false))
|
||||
Unit uiTarget = Global.ObjAccessor.GetUnit(me, uiTargetGUID);
|
||||
if (uiTarget && me.IsInRange(uiTarget, 5.0f, 30.0f, false))
|
||||
{
|
||||
DoCast(target1, TrialOfChampionSpells.MULTI_SHOT);
|
||||
DoCast(uiTarget, TrialOfChampionSpells.MULTI_SHOT);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -1091,10 +1091,12 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
switch (eventId)
|
||||
{
|
||||
case EventTypes.ArnathFlashHeal:
|
||||
Creature target = FindFriendlyCreature();
|
||||
if (target)
|
||||
DoCast(target, InstanceSpells.SpellFlashHeal(IsUndead));
|
||||
_events.ScheduleEvent(EventTypes.ArnathFlashHeal, RandomHelper.URand(6000, 9000));
|
||||
{
|
||||
Creature target = FindFriendlyCreature();
|
||||
if (target)
|
||||
DoCast(target, InstanceSpells.SpellFlashHeal(IsUndead));
|
||||
_events.ScheduleEvent(EventTypes.ArnathFlashHeal, RandomHelper.URand(6000, 9000));
|
||||
}
|
||||
break;
|
||||
case EventTypes.ArnathPwShield:
|
||||
{
|
||||
@@ -1108,10 +1110,12 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
_events.ScheduleEvent(EventTypes.ArnathSmite, RandomHelper.URand(4000, 7000));
|
||||
break;
|
||||
case EventTypes.ArnathDominateMind:
|
||||
Unit target1 = SelectTarget(SelectAggroTarget.Random, 1, 0.0f, true);
|
||||
if (target1)
|
||||
DoCast(target1, InstanceSpells.DominateMind);
|
||||
_events.ScheduleEvent(EventTypes.ArnathDominateMind, RandomHelper.URand(28000, 37000));
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 1, 0.0f, true);
|
||||
if (target)
|
||||
DoCast(target, InstanceSpells.DominateMind);
|
||||
_events.ScheduleEvent(EventTypes.ArnathDominateMind, RandomHelper.URand(28000, 37000));
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -145,9 +145,9 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
public const uint FlashHealUndead = 71782;
|
||||
public const uint PowerWordShieldUndead = 71780;
|
||||
public const uint SmiteUndead = 71778;
|
||||
public static uint SpellFlashHeal(bool isUndead) { return isUndead ? InstanceSpells.FlashHealUndead : InstanceSpells.FlashHealNormal; }
|
||||
public static uint SpellPowerWordShield(bool isUndead) { return isUndead ? InstanceSpells.PowerWordShieldUndead : InstanceSpells.PowerWordShieldNormal; }
|
||||
public static uint SpellSmite(bool isUndead) { return isUndead ? InstanceSpells.SmiteUndead : InstanceSpells.SmiteNormal; }
|
||||
public static uint SpellFlashHeal(bool isUndead) { return isUndead ? FlashHealUndead : FlashHealNormal; }
|
||||
public static uint SpellPowerWordShield(bool isUndead) { return isUndead ? PowerWordShieldUndead : PowerWordShieldNormal; }
|
||||
public static uint SpellSmite(bool isUndead) { return isUndead ? SmiteUndead : SmiteNormal; }
|
||||
|
||||
// Captain Brandon
|
||||
public const uint CrusaderStrike = 71549;
|
||||
@@ -168,9 +168,9 @@ namespace Scripts.Northrend.IcecrownCitadel
|
||||
public const uint FelIronBombUndead = 71787;
|
||||
public const uint MachineGunUndead = 71788;
|
||||
public const uint RocketLaunchUndead = 71786;
|
||||
public static uint SpellFelIronBomb(bool isUndead) { return isUndead ? InstanceSpells.FelIronBombUndead : InstanceSpells.FelIronBombNormal; }
|
||||
public static uint SpellMachineGun(bool isUndead) { return isUndead ? InstanceSpells.MachineGunUndead : InstanceSpells.MachineGunNormal; }
|
||||
public static uint SpellRocketLaunch(bool isUndead) { return isUndead ? InstanceSpells.RocketLaunchUndead : InstanceSpells.RocketLaunchNormal; }
|
||||
public static uint SpellFelIronBomb(bool isUndead) { return isUndead ? FelIronBombUndead : FelIronBombNormal; }
|
||||
public static uint SpellMachineGun(bool isUndead) { return isUndead ? MachineGunUndead : MachineGunNormal; }
|
||||
public static uint SpellRocketLaunch(bool isUndead) { return isUndead ? RocketLaunchUndead : RocketLaunchNormal; }
|
||||
|
||||
// Invisible Stalker (Float; Uninteractible; Largeaoi)
|
||||
public const uint SoulMissile = 72585;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- The Stonecore normal donjon portal
|
||||
DELETE FROM `gameobject` WHERE `guid`=200868;
|
||||
INSERT INTO `gameobject` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseUseFlags`, `PhaseId`, `PhaseGroup`, `terrainSwapMap`, `position_x`, `position_y`, `position_z`, `orientation`, `rotation0`, `rotation1`, `rotation2`, `rotation3`, `spawntimesecs`, `animprogress`, `state`, `ScriptName`, `VerifiedBuild`) VALUES
|
||||
(200868, 207897, 646, 5042, 5303, 1, 0, 169, 0, -1, 1029.14, 618.686, 155.706, 1.77533, 0, 0, 0.775599, 0.631225, 120, 255, 1, "", 26365);
|
||||
Reference in New Issue
Block a user