本文整理汇总了C#中WCell.RealmServer.Spells.SpellCast类的典型用法代码示例。如果您正苦于以下问题:C# SpellCast类的具体用法?C# SpellCast怎么用?C# SpellCast使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SpellCast类属于WCell.RealmServer.Spells命名空间,在下文中一共展示了SpellCast类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: DynamicObject
public DynamicObject(SpellCast cast, float radius)
: this(cast.CasterUnit,
cast.Spell.SpellId, radius,
cast.Caster.Region,
cast.TargetLoc)
{
}
开发者ID:pallmall,项目名称:WCell,代码行数:7,代码来源:DynamicObject.cs
示例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;
}
开发者ID:Jeroz,项目名称:WCell,代码行数:29,代码来源:SpellSummons.cs
示例3: NotifyCasted
internal void NotifyCasted(SpellCast cast)
{
var evt = Casted;
if (evt != null)
{
evt(cast);
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:8,代码来源:Spell.Events.cs
示例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;
}
开发者ID:ray2006,项目名称:WCell,代码行数:8,代码来源:SpellSummonHandlers.cs
示例5: NotifyCancelled
internal void NotifyCancelled(SpellCast cast, SpellFailedReason reason)
{
var evt = Cancelling;
if (evt != null)
{
evt(cast, reason);
}
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:8,代码来源:Spell.Events.cs
示例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);
}
}
开发者ID:pallmall,项目名称:WCell,代码行数:15,代码来源:UnitEvents.cs
示例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);
}
}
开发者ID:MeaNone,项目名称:WCell,代码行数:12,代码来源:SpellSummons.cs
示例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;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:17,代码来源:Spell.Events.cs
示例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;
}
}
}
开发者ID:NVN,项目名称:WCell,代码行数:18,代码来源:WarsongFlagsHandler.cs
示例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);
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:19,代码来源:CombatLogHandler.cs
示例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;
}
}
}
开发者ID:remixod,项目名称:netServer,代码行数:17,代码来源:PlayerSpells.cs
示例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;
}
开发者ID:MeaNone,项目名称:WCell,代码行数:23,代码来源:SpellCast.AI.cs
示例13: FerociousBiteHandler
public FerociousBiteHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
开发者ID:primax,项目名称:WCell,代码行数:4,代码来源:DruidFeralCombatFixes.cs
示例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);
}
}
开发者ID:pallmall,项目名称:WCell,代码行数:12,代码来源:SpellHandler.cs
示例15: ReadinessHandler
public ReadinessHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
开发者ID:MeaNone,项目名称:WCell,代码行数:4,代码来源:HunterMarkmanshipFixes.cs
示例16: WriteCaster
private static void WriteCaster(SpellCast cast, RealmPacketOut packet)
{
if (cast.Caster == null) return;
if (cast.UsedItem != null)
{
//packet.Write(cast.UsedItem.EntityId);
cast.UsedItem.EntityId.WritePacked(packet);
}
else
{
//cast.UsedItem.EntityId.WritePacked(packet);
cast.Caster.EntityId.WritePacked(packet);
}
//packet.Write(cast.Caster.EntityId);
cast.Caster.EntityId.WritePacked(packet);
}
开发者ID:pallmall,项目名称:WCell,代码行数:18,代码来源:SpellHandler.cs
示例17: SendCastFailPackets
/// <summary>
/// Spell went wrong or got cancelled
/// </summary>
internal static void SendCastFailPackets(SpellCast spellCast, SpellFailedReason reason)
{
if (spellCast.Client == null)
{
return;
}
SendCastFailed(spellCast.Client, spellCast.Id, spellCast.Spell, reason);
SendSpellFailure(spellCast, reason);
SendSpellFailedOther(spellCast, reason);
}
开发者ID:pallmall,项目名称:WCell,代码行数:14,代码来源:SpellHandler.cs
示例18: SendSpellGo
/// <summary>
/// Sent after spell start. Triggers the casting animation
/// </summary>
public static void SendSpellGo(ObjectBase caster2, SpellCast cast,
ICollection<WorldObject> hitTargets, ICollection<CastMiss> missedTargets)
{
// TODO: Dynamic packet length?
if (!cast.IsCasting)
{
return;
}
//int len = 200;
int len = 24 + (hitTargets != null ? hitTargets.Count * 8 : 0) + (missedTargets != null ? missedTargets.Count * 10 : 0);
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_SPELL_GO, len))
{
//caster1.EntityId.WritePacked(packet);
cast.Caster.EntityId.WritePacked(packet);
caster2.EntityId.WritePacked(packet);
packet.Write(cast.Id);
packet.Write(cast.Spell.Id);
var castGoFlags = cast.GoFlags;
packet.Write((int)castGoFlags);
//packet.Write(Util.Utility.GetEpochTime());
packet.Write(Utility.GetEpochTime());
//packet.Write(cast.CastDelay);
packet.WriteByte(hitTargets != null ? hitTargets.Count : 0);
if (hitTargets != null)
{
foreach (var target in hitTargets)
{
packet.Write(target.EntityId);
if (target is Character)
{
SendCastSuccess(cast.Caster, cast.Spell.Id, target as Character);
}
}
}
packet.WriteByte(missedTargets != null ? missedTargets.Count : 0);
if (missedTargets != null)
{
foreach (var miss in missedTargets)
{
packet.Write(miss.Target.EntityId);
packet.Write((byte)miss.Reason);
if (miss.Reason == CastMissReason.Reflect)
{
packet.Write((byte)0);// relfectreason
}
}
}
WriteTargets(packet, cast);
if ((castGoFlags & CastFlags.Flag_0x800) != 0)
{
packet.Write(0);
}
if ((castGoFlags & CastFlags.Flag_0x200000) != 0)
{
byte b1 = 0;
byte b2 = 0;
packet.Write(b1);
packet.Write(b2);
for (int i = 0; i < 6; i++)
{
byte mask = (byte)(1 << i);
if ((mask & b1) != 0)
{
if (!((mask & b2) != 0))
{
packet.WriteByte(0);
}
}
}
}
if ((castGoFlags & CastFlags.Flag_0x20000) != 0)
{
packet.WriteFloat(0);
packet.Write(0);
}
if ((cast.StartFlags & CastFlags.Ranged) != 0)
{
WriteAmmoInfo(cast, packet);
}
if ((castGoFlags & CastFlags.Flag_0x80000) != 0)
{
packet.Write(0);
//.........这里部分代码省略.........
开发者ID:pallmall,项目名称:WCell,代码行数:101,代码来源:SpellHandler.cs
示例19: AddBleedWeaponDamageHandler
public AddBleedWeaponDamageHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
开发者ID:primax,项目名称:WCell,代码行数:4,代码来源:DruidFeralCombatFixes.cs
示例20: BurnoutHandler
public BurnoutHandler(SpellCast cast, SpellEffect effect)
: base(cast, effect)
{
}
开发者ID:remixod,项目名称:netServer,代码行数:4,代码来源:MageFireFixes.cs
注:本文中的WCell.RealmServer.Spells.SpellCast类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论