本文整理汇总了C#中WCell.RealmServer.Spells.SpellCast类的典型用法代码示例。如果您正苦于以下问题:C# SpellCast类的具体用法?C# SpellCast怎么用?C# SpellCast使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellCast类属于WCell.RealmServer.Spells命名空间,在下文中一共展示了SpellCast类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DynamicObject
public DynamicObject(SpellCast cast, float radius)
: this(cast.CasterUnit,
cast.Spell.SpellId, radius,
cast.Caster.Region,
cast.TargetLoc)
{
}
示例2: Summon
public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
{
var caster = cast.CasterUnit;
var duration = cast.Spell.GetDuration(cast.CasterReference);
NPC minion;
if (caster != null)
{
minion = caster.SpawnMinion(entry, ref targetLoc, duration);
}
else
{
minion = entry.Create(cast.TargetMap.DifficultyIndex);
minion.Position = targetLoc;
minion.Brain.IsRunning = true;
minion.Phase = cast.Phase;
cast.Map.AddObject(minion);
}
if (caster is Character)
{
minion.Level = caster.Level;
}
minion.Summoner = caster;
minion.Creator = cast.CasterReference.EntityId;
return minion;
}
示例3: NotifyCasted
internal void NotifyCasted(SpellCast cast)
{
var evt = Casted;
if (evt != null)
{
evt(cast);
}
}
示例4: Summon
public virtual NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
{
var caster = cast.CasterUnit;
var pet = caster.SpawnMinion(entry, ref targetLoc, cast.Spell.GetDuration(caster.CasterInfo));
pet.Summoner = caster;
pet.Creator = caster.EntityId;
return pet;
}
示例5: NotifyCancelled
internal void NotifyCancelled(SpellCast cast, SpellFailedReason reason)
{
var evt = Cancelling;
if (evt != null)
{
evt(cast, reason);
}
}
示例6: OnDebuff
/// <summary>
/// Called when this Unit got the given debuff by the given SpellCast
/// </summary>
/// <param name="cast"></param>
internal void OnDebuff(SpellCast cast, Aura debuff)
{
// force combat mode
IsInCombat = true;
var evt = Debuff;
if (evt != null)
{
evt(this, cast, debuff);
}
}
示例7: Summon
public override NPC Summon(SpellCast cast, ref Vector3 targetLoc, NPCEntry entry)
{
var caster = cast.CasterUnit;
if (caster is Character)
{
return ((Character)caster).SpawnPet(entry, ref targetLoc, cast.Spell.GetDuration(caster.SharedReference));
}
else
{
return base.Summon(cast, ref targetLoc, entry);
}
}
示例8: NotifyCasting
/// <summary>
/// Triggers the Casting event
/// </summary>
internal SpellFailedReason NotifyCasting(SpellCast cast)
{
var evt = Casting;
if (evt != null)
{
var err = evt(cast);
if (err != SpellFailedReason.Ok)
{
cast.Cancel(err);
return err;
}
}
return SpellFailedReason.Ok;
}
示例9: CheckInitialize
/// <summary>
/// Ensure that the constraints are correct for the Flag aura to be applied
/// </summary>
protected override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (!(target is Character))
{
failReason = SpellFailedReason.BadTargets;
}
else
{
Instance = target.Region as WarsongGulch;
if (Instance == null)
{
failReason = SpellFailedReason.IncorrectArea;
}
}
}
示例10: SendSpellMiss
/// <summary>
/// Correct 3.0.9
/// </summary>
public static void SendSpellMiss(SpellCast cast, bool display, ICollection<MissedTarget> missedTargets)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELLLOGMISS, 34))
{
packet.Write(cast.Spell.Id);
packet.Write(cast.CasterReference.EntityId);
packet.Write(display);// TODO: test this value. Its a bool that seems to determine whether to display this packet in the combat log
packet.Write(missedTargets.Count);
foreach (var miss in missedTargets)
{
packet.Write(miss.Target.EntityId);
packet.Write((byte)miss.Reason);
}
cast.SendPacketToArea(packet);
}
}
示例11: CheckInitialize
protected override void CheckInitialize(SpellCast creatingCast, ObjectReference casterReference, Unit target, ref SpellFailedReason failReason)
{
if (target is Character)
{
var chr = (Character)target;
var ap = target.TotalMeleeAP;
var sp = chr.GetDamageDoneMod(DamageSchool.Holy);
if (ap > sp)
{
totalBonus = ap;
}
else
{
totalBonus = sp;
}
}
}
示例12: PrepareAI
/// <summary>
/// Find valid targets for AI cast during preparation
/// </summary>
SpellFailedReason PrepareAI(SpellCast cast)
{
var caster = cast.CasterUnit;
cast.SourceLoc = caster.Position;
if (caster.Target != null)
{
caster.SpellCast.TargetLoc = caster.Target.Position;
}
// TODO: Init handlers
//var targets = FindValidTargetsForCaster(caster);
//if (targets == null)
//{
// return SpellFailedReason.NoValidTargets;
//}
return SpellFailedReason.NoValidTargets;
}
示例13: FerociousBiteHandler
public FerociousBiteHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
示例14: SendSpellFailedOther
internal static void SendSpellFailedOther(SpellCast spellCast, SpellFailedReason reason)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_FAILED_OTHER, 15))
{
spellCast.Caster.EntityId.WritePacked(packet);
packet.Write(spellCast.Id);
packet.Write(spellCast.Spell.Id);
packet.Write((byte)reason);
spellCast.Caster.SendPacketToArea(packet);
}
}
示例15: ReadinessHandler
public ReadinessHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}